lone-format 0.3.3 → 0.4.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 be, useCssVars as Ce, ref as G, computed as L, resolveComponent as Me, createElementBlock as N, openBlock as x, createElementVNode as E, createCommentVNode as X, withDirectives as ve, toDisplayString as j, withKeys as le, vModelText as _e, createTextVNode as Se, Fragment as he, renderList as pe, createVNode as Ue, normalizeClass as Oe, nextTick as ce, watch as Fe, normalizeStyle as I, createBlock as Xe } from "vue";
2
- class De {
1
+ import { defineComponent as ye, useCssVars as Oe, ref as z, computed as V, resolveComponent as Ue, createElementBlock as k, openBlock as x, createElementVNode as v, createCommentVNode as F, withDirectives as _e, toDisplayString as R, withKeys as ue, vModelText as xe, createTextVNode as Se, Fragment as de, renderList as fe, createVNode as Fe, normalizeClass as Te, nextTick as he, watch as Xe, normalizeStyle as P, createBlock as He } from "vue";
2
+ class Je {
3
3
  /**
4
4
  * @callback HookCallback
5
5
  * @this {*|Jsep} this
@@ -42,7 +42,7 @@ class De {
42
42
  });
43
43
  }
44
44
  }
45
- class Je {
45
+ class et {
46
46
  constructor(e) {
47
47
  this.jsep = e, this.registered = {};
48
48
  }
@@ -615,10 +615,10 @@ class c {
615
615
  };
616
616
  }
617
617
  }
618
- const et = new De();
618
+ const tt = new Je();
619
619
  Object.assign(c, {
620
- hooks: et,
621
- plugins: new Je(c),
620
+ hooks: tt,
621
+ plugins: new et(c),
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(c, {
714
714
  });
715
715
  c.max_unop_len = c.getMaxKeyLen(c.unary_ops);
716
716
  c.max_binop_len = c.getMaxKeyLen(c.binary_ops);
717
- const ee = (r) => new c(r).parse(), tt = Object.getOwnPropertyNames(class {
717
+ const te = (r) => new c(r).parse(), rt = Object.getOwnPropertyNames(class {
718
718
  });
719
- Object.getOwnPropertyNames(c).filter((r) => !tt.includes(r) && ee[r] === void 0).forEach((r) => {
720
- ee[r] = c[r];
719
+ Object.getOwnPropertyNames(c).filter((r) => !rt.includes(r) && te[r] === void 0).forEach((r) => {
720
+ te[r] = c[r];
721
721
  });
722
- ee.Jsep = c;
723
- const rt = "ConditionalExpression";
724
- var nt = {
722
+ te.Jsep = c;
723
+ const nt = "ConditionalExpression";
724
+ var st = {
725
725
  name: "ternary",
726
726
  init(r) {
727
727
  r.hooks.add("after-expression", function(t) {
@@ -732,7 +732,7 @@ var nt = {
732
732
  this.index++;
733
733
  const o = this.gobbleExpression();
734
734
  if (o || this.throwError("Expected expression"), t.node = {
735
- type: rt,
735
+ type: nt,
736
736
  test: s,
737
737
  consequent: n,
738
738
  alternate: o
@@ -748,9 +748,9 @@ var nt = {
748
748
  });
749
749
  }
750
750
  };
751
- ee.plugins.register(nt);
752
- const Ie = 47, st = 92;
753
- var ot = {
751
+ te.plugins.register(st);
752
+ const Ie = 47, ot = 92;
753
+ var it = {
754
754
  name: "regex",
755
755
  init(r) {
756
756
  r.hooks.add("gobble-token", function(t) {
@@ -780,34 +780,34 @@ var ot = {
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 === st ? 2 : 1;
783
+ this.code === r.OBRACK_CODE ? n = !0 : n && this.code === r.CBRACK_CODE && (n = !1), this.index += this.code === ot ? 2 : 1;
784
784
  }
785
785
  this.throwError("Unclosed Regex");
786
786
  }
787
787
  });
788
788
  }
789
789
  };
790
- const xe = 43, it = 45, ue = {
790
+ const Ne = 43, at = 45, ce = {
791
791
  name: "assignment",
792
792
  assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
793
- updateOperators: [xe, it],
793
+ updateOperators: [Ne, at],
794
794
  assignmentPrecedence: 0.9,
795
795
  init(r) {
796
796
  const e = [r.IDENTIFIER, r.MEMBER_EXP];
797
- ue.assignmentOperators.forEach((s) => r.addBinaryOp(s, ue.assignmentPrecedence, !0)), r.hooks.add("gobble-token", function(n) {
797
+ ce.assignmentOperators.forEach((s) => r.addBinaryOp(s, ce.assignmentPrecedence, !0)), r.hooks.add("gobble-token", function(n) {
798
798
  const o = this.code;
799
- ue.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, n.node = {
799
+ ce.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, n.node = {
800
800
  type: "UpdateExpression",
801
- operator: o === xe ? "++" : "--",
801
+ operator: o === Ne ? "++" : "--",
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 o = this.code;
808
- ue.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (e.includes(n.node.type) || this.throwError(`Unexpected ${n.node.operator}`), this.index += 2, n.node = {
808
+ ce.updateOperators.some((i) => i === o && i === 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: o === xe ? "++" : "--",
810
+ operator: o === Ne ? "++" : "--",
811
811
  argument: n.node,
812
812
  prefix: !1
813
813
  });
@@ -816,17 +816,17 @@ const xe = 43, it = 45, ue = {
816
816
  n.node && t(n.node);
817
817
  });
818
818
  function t(s) {
819
- ue.assignmentOperators.has(s.operator) ? (s.type = "AssignmentExpression", t(s.left), t(s.right)) : s.operator || Object.values(s).forEach((n) => {
819
+ ce.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
- ee.plugins.register(ot, ue);
826
- ee.addUnaryOp("typeof");
827
- ee.addLiteral("null", null);
828
- ee.addLiteral("undefined", void 0);
829
- const at = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]), R = {
825
+ te.plugins.register(it, ce);
826
+ te.addUnaryOp("typeof");
827
+ te.addLiteral("null", null);
828
+ te.addLiteral("undefined", void 0);
829
+ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]), M = {
830
830
  /**
831
831
  * @param {jsep.Expression} ast
832
832
  * @param {Record<string, any>} subs
@@ -835,25 +835,25 @@ const at = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
835
835
  switch (r.type) {
836
836
  case "BinaryExpression":
837
837
  case "LogicalExpression":
838
- return R.evalBinaryExpression(r, e);
838
+ return M.evalBinaryExpression(r, e);
839
839
  case "Compound":
840
- return R.evalCompound(r, e);
840
+ return M.evalCompound(r, e);
841
841
  case "ConditionalExpression":
842
- return R.evalConditionalExpression(r, e);
842
+ return M.evalConditionalExpression(r, e);
843
843
  case "Identifier":
844
- return R.evalIdentifier(r, e);
844
+ return M.evalIdentifier(r, e);
845
845
  case "Literal":
846
- return R.evalLiteral(r, e);
846
+ return M.evalLiteral(r, e);
847
847
  case "MemberExpression":
848
- return R.evalMemberExpression(r, e);
848
+ return M.evalMemberExpression(r, e);
849
849
  case "UnaryExpression":
850
- return R.evalUnaryExpression(r, e);
850
+ return M.evalUnaryExpression(r, e);
851
851
  case "ArrayExpression":
852
- return R.evalArrayExpression(r, e);
852
+ return M.evalArrayExpression(r, e);
853
853
  case "CallExpression":
854
- return R.evalCallExpression(r, e);
854
+ return M.evalCallExpression(r, e);
855
855
  case "AssignmentExpression":
856
- return R.evalAssignmentExpression(r, e);
856
+ return M.evalAssignmentExpression(r, e);
857
857
  default:
858
858
  throw SyntaxError("Unexpected expression", r);
859
859
  }
@@ -883,19 +883,19 @@ const at = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
883
883
  "*": (s, n) => s * n(),
884
884
  "/": (s, n) => s / n(),
885
885
  "%": (s, n) => s % n()
886
- }[r.operator](R.evalAst(r.left, e), () => R.evalAst(r.right, e));
886
+ }[r.operator](M.evalAst(r.left, e), () => M.evalAst(r.right, e));
887
887
  },
888
888
  evalCompound(r, e) {
889
889
  let t;
890
890
  for (let s = 0; s < r.body.length; s++) {
891
891
  r.body[s].type === "Identifier" && ["var", "let", "const"].includes(r.body[s].name) && r.body[s + 1] && r.body[s + 1].type === "AssignmentExpression" && (s += 1);
892
892
  const n = r.body[s];
893
- t = R.evalAst(n, e);
893
+ t = M.evalAst(n, e);
894
894
  }
895
895
  return t;
896
896
  },
897
897
  evalConditionalExpression(r, e) {
898
- return R.evalAst(r.test, e) ? R.evalAst(r.consequent, e) : R.evalAst(r.alternate, e);
898
+ return M.evalAst(r.test, e) ? M.evalAst(r.consequent, e) : M.evalAst(r.alternate, e);
899
899
  },
900
900
  evalIdentifier(r, e) {
901
901
  if (Object.hasOwn(e, r.name))
@@ -910,46 +910,46 @@ const at = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
910
910
  // NOTE: `String(value)` throws error when
911
911
  // value has overwritten the toString method to return non-string
912
912
  // i.e. `value = {toString: () => []}`
913
- r.computed ? R.evalAst(r.property) : r.property.name
913
+ r.computed ? M.evalAst(r.property) : r.property.name
914
914
  // `object.property` property is Identifier
915
- ), s = R.evalAst(r.object, e);
915
+ ), s = M.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) && at.has(t))
918
+ if (!Object.hasOwn(s, t) && lt.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;
922
922
  },
923
923
  evalUnaryExpression(r, e) {
924
924
  return {
925
- "-": (s) => -R.evalAst(s, e),
926
- "!": (s) => !R.evalAst(s, e),
927
- "~": (s) => ~R.evalAst(s, e),
925
+ "-": (s) => -M.evalAst(s, e),
926
+ "!": (s) => !M.evalAst(s, e),
927
+ "~": (s) => ~M.evalAst(s, e),
928
928
  // eslint-disable-next-line no-implicit-coercion -- API
929
- "+": (s) => +R.evalAst(s, e),
930
- typeof: (s) => typeof R.evalAst(s, e)
929
+ "+": (s) => +M.evalAst(s, e),
930
+ typeof: (s) => typeof M.evalAst(s, e)
931
931
  }[r.operator](r.argument);
932
932
  },
933
933
  evalArrayExpression(r, e) {
934
- return r.elements.map((t) => R.evalAst(t, e));
934
+ return r.elements.map((t) => M.evalAst(t, e));
935
935
  },
936
936
  evalCallExpression(r, e) {
937
- const t = r.arguments.map((n) => R.evalAst(n, e));
938
- return R.evalAst(r.callee, e)(...t);
937
+ const t = r.arguments.map((n) => M.evalAst(n, e));
938
+ return M.evalAst(r.callee, e)(...t);
939
939
  },
940
940
  evalAssignmentExpression(r, e) {
941
941
  if (r.left.type !== "Identifier")
942
942
  throw SyntaxError("Invalid left-hand side in assignment");
943
- const t = r.left.name, s = R.evalAst(r.right, e);
943
+ const t = r.left.name, s = M.evalAst(r.right, e);
944
944
  return e[t] = s, e[t];
945
945
  }
946
946
  };
947
- class lt {
947
+ class ut {
948
948
  /**
949
949
  * @param {string} expr Expression to evaluate
950
950
  */
951
951
  constructor(e) {
952
- this.code = e, this.ast = ee(this.code);
952
+ this.code = e, this.ast = te(this.code);
953
953
  }
954
954
  /**
955
955
  * @param {object} context Object whose items will be added
@@ -958,16 +958,16 @@ class lt {
958
958
  */
959
959
  runInNewContext(e) {
960
960
  const t = Object.assign(/* @__PURE__ */ Object.create(null), e);
961
- return R.evalAst(this.ast, t);
961
+ return M.evalAst(this.ast, t);
962
962
  }
963
963
  }
964
- function te(r, e) {
964
+ function re(r, e) {
965
965
  return r = r.slice(), r.push(e), r;
966
966
  }
967
- function ke(r, e) {
967
+ function Ae(r, e) {
968
968
  return e = e.slice(), e.unshift(r), e;
969
969
  }
970
- class ut extends Error {
970
+ class ct extends Error {
971
971
  /**
972
972
  * @param {AnyResult} value The evaluated scalar value
973
973
  */
@@ -975,10 +975,10 @@ class ut 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 $(r, e, t, s, n) {
979
- if (!(this instanceof $))
978
+ function B(r, e, t, s, n) {
979
+ if (!(this instanceof B))
980
980
  try {
981
- return new $(r, e, t, s, n);
981
+ return new B(r, e, t, s, n);
982
982
  } catch (i) {
983
983
  if (!i.avoidNew)
984
984
  throw i;
@@ -995,11 +995,11 @@ function $(r, e, t, s, n) {
995
995
  o ? "json" in r && (i.json = r.json) : i.json = t;
996
996
  const u = this.evaluate(i);
997
997
  if (!u || typeof u != "object")
998
- throw new ut(u);
998
+ throw new ct(u);
999
999
  return u;
1000
1000
  }
1001
1001
  }
1002
- $.prototype.evaluate = function(r, e, t, s) {
1002
+ B.prototype.evaluate = function(r, e, t, s) {
1003
1003
  let n = this.parent, o = this.parentProperty, {
1004
1004
  flatten: i,
1005
1005
  wrap: u
@@ -1013,44 +1013,44 @@ $.prototype.evaluate = function(r, e, t, s) {
1013
1013
  json: e
1014
1014
  } = r), i = Object.hasOwn(r, "flatten") ? r.flatten : i, this.currResultType = Object.hasOwn(r, "resultType") ? r.resultType : this.currResultType, this.currSandbox = Object.hasOwn(r, "sandbox") ? r.sandbox : this.currSandbox, u = Object.hasOwn(r, "wrap") ? r.wrap : u, 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, o = Object.hasOwn(r, "parentProperty") ? r.parentProperty : o, r = r.path;
1015
1015
  }
1016
- if (n = n || null, o = o || null, Array.isArray(r) && (r = $.toPathString(r)), !r && r !== "" || !e)
1016
+ if (n = n || null, o = o || null, Array.isArray(r) && (r = B.toPathString(r)), !r && r !== "" || !e)
1017
1017
  return;
1018
- const a = $.toPathArray(r);
1018
+ const a = B.toPathArray(r);
1019
1019
  a[0] === "$" && a.length > 1 && a.shift(), this._hasParentSelector = null;
1020
1020
  const l = this._trace(a, e, ["$"], n, o, t).filter(function(h) {
1021
1021
  return h && !h.isParentSelector;
1022
1022
  });
1023
1023
  return l.length ? !u && l.length === 1 && !l[0].hasArrExpr ? this._getPreferredOutput(l[0]) : l.reduce((h, f) => {
1024
- const y = this._getPreferredOutput(f);
1025
- return i && Array.isArray(y) ? h = h.concat(y) : h.push(y), h;
1024
+ const b = this._getPreferredOutput(f);
1025
+ return i && Array.isArray(b) ? h = h.concat(b) : h.push(b), h;
1026
1026
  }, []) : u ? [] : void 0;
1027
1027
  };
1028
- $.prototype._getPreferredOutput = function(r) {
1028
+ B.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 : $.toPathArray(r.path);
1033
- return r.pointer = $.toPointer(t), r.path = typeof r.path == "string" ? r.path : $.toPathString(r.path), r;
1032
+ const t = Array.isArray(r.path) ? r.path : B.toPathArray(r.path);
1033
+ return r.pointer = B.toPointer(t), r.path = typeof r.path == "string" ? r.path : B.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 $.toPathString(r[e]);
1040
+ return B.toPathString(r[e]);
1041
1041
  case "pointer":
1042
- return $.toPointer(r.path);
1042
+ return B.toPointer(r.path);
1043
1043
  default:
1044
1044
  throw new TypeError("Unknown result type");
1045
1045
  }
1046
1046
  };
1047
- $.prototype._handleCallback = function(r, e, t) {
1047
+ B.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 : $.toPathString(r.path), e(s, t, r);
1050
+ r.path = typeof r.path == "string" ? r.path : B.toPathString(r.path), e(s, t, r);
1051
1051
  }
1052
1052
  };
1053
- $.prototype._trace = function(r, e, t, s, n, o, i, u) {
1053
+ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1054
1054
  let a;
1055
1055
  if (!r.length)
1056
1056
  return a = {
@@ -1061,20 +1061,20 @@ $.prototype._trace = function(r, e, t, s, n, o, i, u) {
1061
1061
  hasArrExpr: i
1062
1062
  }, this._handleCallback(a, o, "value"), a;
1063
1063
  const l = r[0], h = r.slice(1), f = [];
1064
- function y(m) {
1065
- Array.isArray(m) ? m.forEach((C) => {
1066
- f.push(C);
1064
+ function b(m) {
1065
+ Array.isArray(m) ? m.forEach((w) => {
1066
+ f.push(w);
1067
1067
  }) : f.push(m);
1068
1068
  }
1069
1069
  if ((typeof l != "string" || u) && e && Object.hasOwn(e, l))
1070
- y(this._trace(h, e[l], te(t, l), e, l, o, i));
1070
+ b(this._trace(h, e[l], re(t, l), e, l, o, i));
1071
1071
  else if (l === "*")
1072
1072
  this._walk(e, (m) => {
1073
- y(this._trace(h, e[m], te(t, m), e, m, o, !0, !0));
1073
+ b(this._trace(h, e[m], re(t, m), e, m, o, !0, !0));
1074
1074
  });
1075
1075
  else if (l === "..")
1076
- y(this._trace(h, e, t, s, n, o, i)), this._walk(e, (m) => {
1077
- typeof e[m] == "object" && y(this._trace(r.slice(), e[m], te(t, m), e, m, o, !0));
1076
+ b(this._trace(h, e, t, s, n, o, i)), this._walk(e, (m) => {
1077
+ typeof e[m] == "object" && b(this._trace(r.slice(), e[m], re(t, m), e, m, o, !0));
1078
1078
  });
1079
1079
  else {
1080
1080
  if (l === "^")
@@ -1085,33 +1085,33 @@ $.prototype._trace = function(r, e, t, s, n, o, i, u) {
1085
1085
  };
1086
1086
  if (l === "~")
1087
1087
  return a = {
1088
- path: te(t, l),
1088
+ path: re(t, l),
1089
1089
  value: n,
1090
1090
  parent: s,
1091
1091
  parentProperty: null
1092
1092
  }, this._handleCallback(a, o, "property"), a;
1093
1093
  if (l === "$")
1094
- y(this._trace(h, e, t, null, null, o, i));
1094
+ b(this._trace(h, e, t, null, null, o, i));
1095
1095
  else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))
1096
- y(this._slice(l, h, e, t, s, n, o));
1096
+ b(this._slice(l, h, e, t, s, n, o));
1097
1097
  else if (l.indexOf("?(") === 0) {
1098
1098
  if (this.currEval === !1)
1099
1099
  throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
1100
- const m = l.replace(/^\?\((.*?)\)$/u, "$1"), C = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(m);
1101
- C ? this._walk(e, (O) => {
1102
- const P = [C[2]], M = C[1] ? e[O][C[1]] : e[O];
1103
- this._trace(P, M, t, s, n, o, !0).length > 0 && y(this._trace(h, e[O], te(t, O), e, O, o, !0));
1104
- }) : this._walk(e, (O) => {
1105
- this._eval(m, e[O], O, t, s, n) && y(this._trace(h, e[O], te(t, O), e, O, o, !0));
1100
+ const m = l.replace(/^\?\((.*?)\)$/u, "$1"), w = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(m);
1101
+ w ? this._walk(e, (S) => {
1102
+ const _ = [w[2]], j = w[1] ? e[S][w[1]] : e[S];
1103
+ this._trace(_, j, t, s, n, o, !0).length > 0 && b(this._trace(h, e[S], re(t, S), e, S, o, !0));
1104
+ }) : this._walk(e, (S) => {
1105
+ this._eval(m, e[S], S, t, s, n) && b(this._trace(h, e[S], re(t, S), e, S, o, !0));
1106
1106
  });
1107
1107
  } else if (l[0] === "(") {
1108
1108
  if (this.currEval === !1)
1109
1109
  throw new Error("Eval [(expr)] prevented in JSONPath expression.");
1110
- y(this._trace(ke(this._eval(l, e, t.at(-1), t.slice(0, -1), s, n), h), e, t, s, n, o, i));
1110
+ b(this._trace(Ae(this._eval(l, e, t.at(-1), t.slice(0, -1), s, n), h), e, t, s, n, o, i));
1111
1111
  } else if (l[0] === "@") {
1112
1112
  let m = !1;
1113
- const C = l.slice(1, -2);
1114
- switch (C) {
1113
+ const w = l.slice(1, -2);
1114
+ switch (w) {
1115
1115
  case "scalar":
1116
1116
  (!e || !["object", "function"].includes(typeof e)) && (m = !0);
1117
1117
  break;
@@ -1119,7 +1119,7 @@ $.prototype._trace = function(r, e, t, s, n, o, i, u) {
1119
1119
  case "string":
1120
1120
  case "undefined":
1121
1121
  case "function":
1122
- typeof e === C && (m = !0);
1122
+ typeof e === w && (m = !0);
1123
1123
  break;
1124
1124
  case "integer":
1125
1125
  Number.isFinite(e) && !(e % 1) && (m = !0);
@@ -1131,7 +1131,7 @@ $.prototype._trace = function(r, e, t, s, n, o, i, u) {
1131
1131
  typeof e == "number" && !Number.isFinite(e) && (m = !0);
1132
1132
  break;
1133
1133
  case "object":
1134
- e && typeof e === C && (m = !0);
1134
+ e && typeof e === w && (m = !0);
1135
1135
  break;
1136
1136
  case "array":
1137
1137
  Array.isArray(e) && (m = !0);
@@ -1144,7 +1144,7 @@ $.prototype._trace = function(r, e, t, s, n, o, i, u) {
1144
1144
  break;
1145
1145
  /* c8 ignore next 2 */
1146
1146
  default:
1147
- throw new TypeError("Unknown value type " + C);
1147
+ throw new TypeError("Unknown value type " + w);
1148
1148
  }
1149
1149
  if (m)
1150
1150
  return a = {
@@ -1155,30 +1155,30 @@ $.prototype._trace = function(r, e, t, s, n, o, i, u) {
1155
1155
  }, this._handleCallback(a, o, "value"), a;
1156
1156
  } else if (l[0] === "`" && e && Object.hasOwn(e, l.slice(1))) {
1157
1157
  const m = l.slice(1);
1158
- y(this._trace(h, e[m], te(t, m), e, m, o, i, !0));
1158
+ b(this._trace(h, e[m], re(t, m), e, m, o, i, !0));
1159
1159
  } else if (l.includes(",")) {
1160
1160
  const m = l.split(",");
1161
- for (const C of m)
1162
- y(this._trace(ke(C, h), e, t, s, n, o, !0));
1163
- } else !u && e && Object.hasOwn(e, l) && y(this._trace(h, e[l], te(t, l), e, l, o, i, !0));
1161
+ for (const w of m)
1162
+ b(this._trace(Ae(w, h), e, t, s, n, o, !0));
1163
+ } else !u && e && Object.hasOwn(e, l) && b(this._trace(h, e[l], re(t, l), e, l, o, i, !0));
1164
1164
  }
1165
1165
  if (this._hasParentSelector)
1166
1166
  for (let m = 0; m < f.length; m++) {
1167
- const C = f[m];
1168
- if (C && C.isParentSelector) {
1169
- const O = this._trace(C.expr, e, C.path, s, n, o, i);
1170
- if (Array.isArray(O)) {
1171
- f[m] = O[0];
1172
- const P = O.length;
1173
- for (let M = 1; M < P; M++)
1174
- m++, f.splice(m, 0, O[M]);
1167
+ const w = f[m];
1168
+ if (w && w.isParentSelector) {
1169
+ const S = this._trace(w.expr, e, w.path, s, n, o, i);
1170
+ if (Array.isArray(S)) {
1171
+ f[m] = S[0];
1172
+ const _ = S.length;
1173
+ for (let j = 1; j < _; j++)
1174
+ m++, f.splice(m, 0, S[j]);
1175
1175
  } else
1176
- f[m] = O;
1176
+ f[m] = S;
1177
1177
  }
1178
1178
  }
1179
1179
  return f;
1180
1180
  };
1181
- $.prototype._walk = function(r, e) {
1181
+ B.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 @@ $.prototype._walk = function(r, e) {
1187
1187
  e(t);
1188
1188
  });
1189
1189
  };
1190
- $.prototype._slice = function(r, e, t, s, n, o, i) {
1190
+ B.prototype._slice = function(r, e, t, s, n, o, i) {
1191
1191
  if (!Array.isArray(t))
1192
1192
  return;
1193
1193
  const u = t.length, a = r.split(":"), l = a[2] && Number.parseInt(a[2]) || 1;
1194
1194
  let h = a[0] && Number.parseInt(a[0]) || 0, f = a[1] && Number.parseInt(a[1]) || u;
1195
1195
  h = h < 0 ? Math.max(0, h + u) : Math.min(u, h), f = f < 0 ? Math.max(0, f + u) : Math.min(u, f);
1196
- const y = [];
1196
+ const b = [];
1197
1197
  for (let m = h; m < f; m += l)
1198
- this._trace(ke(m, e), t, s, n, o, i, !0).forEach((O) => {
1199
- y.push(O);
1198
+ this._trace(Ae(m, e), t, s, n, o, i, !0).forEach((S) => {
1199
+ b.push(S);
1200
1200
  });
1201
- return y;
1201
+ return b;
1202
1202
  };
1203
- $.prototype._eval = function(r, e, t, s, n, o) {
1203
+ B.prototype._eval = function(r, e, t, s, n, o) {
1204
1204
  this.currSandbox._$_parentProperty = o, this.currSandbox._$_parent = n, this.currSandbox._$_property = t, this.currSandbox._$_root = this.json, this.currSandbox._$_v = e;
1205
1205
  const i = r.includes("@path");
1206
- i && (this.currSandbox._$_path = $.toPathString(s.concat([t])));
1206
+ i && (this.currSandbox._$_path = B.toPathString(s.concat([t])));
1207
1207
  const u = this.currEval + "Script:" + r;
1208
- if (!$.cache[u]) {
1208
+ if (!B.cache[u]) {
1209
1209
  let a = r.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1");
1210
1210
  if (i && (a = a.replaceAll("@path", "_$_path")), this.currEval === "safe" || this.currEval === !0 || this.currEval === void 0)
1211
- $.cache[u] = new this.safeVm.Script(a);
1211
+ B.cache[u] = new this.safeVm.Script(a);
1212
1212
  else if (this.currEval === "native")
1213
- $.cache[u] = new this.vm.Script(a);
1213
+ B.cache[u] = new this.vm.Script(a);
1214
1214
  else if (typeof this.currEval == "function" && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, "runInNewContext")) {
1215
1215
  const l = this.currEval;
1216
- $.cache[u] = new l(a);
1216
+ B.cache[u] = new l(a);
1217
1217
  } else if (typeof this.currEval == "function")
1218
- $.cache[u] = {
1218
+ B.cache[u] = {
1219
1219
  runInNewContext: (l) => this.currEval(a, l)
1220
1220
  };
1221
1221
  else
1222
1222
  throw new TypeError(`Unknown "eval" property "${this.currEval}"`);
1223
1223
  }
1224
1224
  try {
1225
- return $.cache[u].runInNewContext(this.currSandbox);
1225
+ return B.cache[u].runInNewContext(this.currSandbox);
1226
1226
  } catch (a) {
1227
1227
  if (this.ignoreEvalErrors)
1228
1228
  return !1;
1229
1229
  throw new Error("jsonPath: " + a.message + ": " + r);
1230
1230
  }
1231
1231
  };
1232
- $.cache = {};
1233
- $.toPathString = function(r) {
1232
+ B.cache = {};
1233
+ B.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
- $.toPointer = function(r) {
1240
+ B.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
- $.toPathArray = function(r) {
1247
+ B.toPathArray = function(r) {
1248
1248
  const {
1249
1249
  cache: e
1250
- } = $;
1250
+ } = B;
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(o, i) {
@@ -1262,17 +1262,17 @@ $.toPathArray = function(r) {
1262
1262
  });
1263
1263
  return e[r] = n, e[r].concat();
1264
1264
  };
1265
- $.prototype.safeVm = {
1266
- Script: lt
1265
+ B.prototype.safeVm = {
1266
+ Script: ut
1267
1267
  };
1268
- const ct = function(r, e, t) {
1268
+ const dt = function(r, e, t) {
1269
1269
  const s = r.length;
1270
1270
  for (let n = 0; n < s; n++) {
1271
1271
  const o = r[n];
1272
1272
  t(o) && e.push(r.splice(n--, 1)[0]);
1273
1273
  }
1274
1274
  };
1275
- class dt {
1275
+ class ft {
1276
1276
  /**
1277
1277
  * @param {string} expr Expression to evaluate
1278
1278
  */
@@ -1287,7 +1287,7 @@ class dt {
1287
1287
  runInNewContext(e) {
1288
1288
  let t = this.code;
1289
1289
  const s = Object.keys(e), n = [];
1290
- ct(s, n, (l) => typeof e[l] == "function");
1290
+ dt(s, n, (l) => typeof e[l] == "function");
1291
1291
  const o = s.map((l) => e[l]);
1292
1292
  t = n.reduce((l, h) => {
1293
1293
  let f = e[h].toString();
@@ -1297,37 +1297,37 @@ class dt {
1297
1297
  return new Function(...s, a)(...o);
1298
1298
  }
1299
1299
  }
1300
- $.prototype.vm = {
1301
- Script: dt
1300
+ B.prototype.vm = {
1301
+ Script: ft
1302
1302
  };
1303
- const ft = { class: "json-node" }, ht = {
1303
+ const ht = { class: "json-node" }, pt = {
1304
1304
  key: 0,
1305
1305
  class: "json-node__container"
1306
- }, pt = { class: "json-node__line" }, gt = {
1306
+ }, gt = { class: "json-node__line" }, mt = {
1307
1307
  key: 2,
1308
1308
  class: "json-node__colon"
1309
- }, bt = ["title"], mt = {
1309
+ }, yt = ["title"], bt = {
1310
1310
  key: 3,
1311
1311
  class: "json-node__collapsed"
1312
- }, yt = {
1312
+ }, vt = {
1313
1313
  key: 4,
1314
1314
  class: "json-node__comma"
1315
1315
  }, Et = {
1316
1316
  key: 0,
1317
1317
  class: "json-node__children"
1318
- }, vt = { class: "json-node__children-content" }, _t = { class: "json-node__line json-node__closing-bracket" }, xt = { class: "json-node__bracket" }, Nt = {
1318
+ }, _t = { class: "json-node__children-content" }, xt = { class: "json-node__line json-node__closing-bracket" }, Nt = { class: "json-node__bracket" }, kt = {
1319
1319
  key: 0,
1320
1320
  class: "json-node__comma"
1321
- }, kt = {
1321
+ }, At = {
1322
1322
  key: 1,
1323
1323
  class: "json-node__primitive"
1324
1324
  }, wt = {
1325
1325
  key: 2,
1326
1326
  class: "json-node__colon"
1327
- }, At = ["title"], Ct = {
1327
+ }, Ct = ["title"], Ot = {
1328
1328
  key: 0,
1329
1329
  class: "json-node__comma"
1330
- }, Ot = /* @__PURE__ */ be({
1330
+ }, Tt = /* @__PURE__ */ ye({
1331
1331
  name: "JsonNode",
1332
1332
  __name: "JsonNode",
1333
1333
  props: {
@@ -1341,191 +1341,191 @@ const ft = { class: "json-node" }, ht = {
1341
1341
  },
1342
1342
  emits: ["update:value", "toggle-expand", "copy", "update:key"],
1343
1343
  setup(r, { emit: e }) {
1344
- Ce((b) => ({
1345
- "7b112182": b.level,
1346
- "1501a3a8": b.theme.colors.syntaxKey,
1347
- "4c2226b6": b.theme.colors.hoverBackground,
1348
- "30aa351e": b.theme.colors.syntaxBracket,
1349
- "090e30f3": b.theme.colors.textSecondary,
1350
- cf872bb0: b.theme.colors.syntaxString,
1351
- e0803540: b.theme.colors.syntaxNumber,
1352
- "3954b61e": b.theme.colors.syntaxBoolean,
1353
- e9972d44: b.theme.colors.syntaxNull,
1354
- "231c0282": b.theme.colors.background,
1355
- e1dce7d8: b.theme.colors.indentLine
1344
+ Oe((y) => ({
1345
+ "7b112182": y.level,
1346
+ "1501a3a8": y.theme.colors.syntaxKey,
1347
+ "4c2226b6": y.theme.colors.hoverBackground,
1348
+ "30aa351e": y.theme.colors.syntaxBracket,
1349
+ "090e30f3": y.theme.colors.textSecondary,
1350
+ cf872bb0: y.theme.colors.syntaxString,
1351
+ e0803540: y.theme.colors.syntaxNumber,
1352
+ "3954b61e": y.theme.colors.syntaxBoolean,
1353
+ e9972d44: y.theme.colors.syntaxNull,
1354
+ "231c0282": y.theme.colors.background,
1355
+ e1dce7d8: y.theme.colors.indentLine
1356
1356
  }));
1357
- const t = r, s = e, n = G(!1), o = G(!1), i = G(""), u = G(""), a = (b) => b !== null && typeof b == "object" && !Array.isArray(b) && "__protected_number__" in b && Object.keys(b).length === 1, l = (b) => a(b) ? b.__protected_number__ : "", h = L(() => a(t.value) ? !1 : t.value !== null && typeof t.value == "object"), f = L(() => Array.isArray(t.value)), y = L(() => t.path ? t.path : t.keyName ? t.keyName : "root"), m = L(() => t.expanded.has(y.value)), C = L(() => t.keyName), O = L(() => f.value ? "[" : "{"), P = L(() => f.value ? "]" : "}"), M = L(() => {
1357
+ const t = r, s = e, n = z(!1), o = z(!1), i = z(""), u = z(""), a = (y) => y !== null && typeof y == "object" && !Array.isArray(y) && "__protected_number__" in y && Object.keys(y).length === 1, l = (y) => a(y) ? y.__protected_number__ : "", h = V(() => a(t.value) ? !1 : t.value !== null && typeof t.value == "object"), f = V(() => Array.isArray(t.value)), b = V(() => t.path ? t.path : t.keyName ? t.keyName : "root"), m = V(() => t.expanded.has(b.value)), w = V(() => t.keyName), S = V(() => f.value ? "[" : "{"), _ = V(() => f.value ? "]" : "}"), j = V(() => {
1358
1358
  if (!t.value) return "";
1359
1359
  const d = Object.keys(t.value).length;
1360
1360
  return f.value ? d > 0 ? ` ${d} items ` : " " : d > 0 ? ` ${d} keys ` : " ";
1361
- }), k = L(() => {
1362
- const b = typeof t.value;
1363
- return t.value === null ? "json-node__value--null" : b === "boolean" ? "json-node__value--boolean" : b === "number" || a(t.value) ? "json-node__value--number" : b === "string" ? "json-node__value--string" : "";
1364
- }), S = L(() => o.value ? u.value : t.value === null ? "null" : typeof t.value == "boolean" || typeof t.value == "number" ? String(t.value) : a(t.value) ? l(t.value) : typeof t.value == "string" ? `"${t.value}"` : String(t.value)), g = L(() => "Click to edit, double-click to copy"), T = (b) => t.level === 0 ? b : y.value ? `${y.value}.${b}` : b, U = (b) => {
1361
+ }), H = V(() => {
1362
+ const y = typeof t.value;
1363
+ return t.value === null ? "json-node__value--null" : y === "boolean" ? "json-node__value--boolean" : y === "number" || a(t.value) ? "json-node__value--number" : y === "string" ? "json-node__value--string" : "";
1364
+ }), p = V(() => o.value ? u.value : t.value === null ? "null" : typeof t.value == "boolean" || typeof t.value == "number" ? String(t.value) : a(t.value) ? l(t.value) : typeof t.value == "string" ? `"${t.value}"` : String(t.value)), $ = V(() => "Click to edit, double-click to copy"), E = (y) => t.level === 0 ? y : b.value ? `${b.value}.${y}` : y, O = (y) => {
1365
1365
  const d = Object.keys(t.value);
1366
- return d.indexOf(b) === d.length - 1;
1367
- }, V = () => {
1368
- s("toggle-expand", y.value);
1369
- }, Y = () => {
1370
- t.level !== 0 && (n.value = !0, i.value = t.keyName, ce(() => {
1371
- const b = document.querySelectorAll(".json-node__key-input"), d = b[b.length - 1];
1366
+ return d.indexOf(y) === d.length - 1;
1367
+ }, I = () => {
1368
+ s("toggle-expand", b.value);
1369
+ }, X = () => {
1370
+ t.level !== 0 && (n.value = !0, i.value = t.keyName, he(() => {
1371
+ const y = document.querySelectorAll(".json-node__key-input"), d = y[y.length - 1];
1372
1372
  d && (d.focus(), d.select());
1373
1373
  }));
1374
1374
  }, Z = () => {
1375
- h.value || (o.value = !0, a(t.value) ? u.value = l(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value), ce(() => {
1376
- const b = document.querySelectorAll(".json-node__value-input"), d = b[b.length - 1];
1375
+ h.value || (o.value = !0, a(t.value) ? u.value = l(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value), he(() => {
1376
+ const y = document.querySelectorAll(".json-node__value-input"), d = y[y.length - 1];
1377
1377
  d && (d.focus(), d.select());
1378
1378
  }));
1379
- }, D = () => {
1379
+ }, Y = () => {
1380
1380
  if (t.level === 0 || !n.value) return;
1381
- const b = i.value.trim();
1382
- if (!b) {
1383
- ie();
1381
+ const y = i.value.trim();
1382
+ if (!y) {
1383
+ ee();
1384
1384
  return;
1385
1385
  }
1386
- if (b === t.keyName) {
1386
+ if (y === t.keyName) {
1387
1387
  n.value = !1;
1388
1388
  return;
1389
1389
  }
1390
- n.value = !1, s("update:key", y.value, b);
1391
- }, J = () => {
1390
+ n.value = !1, s("update:key", b.value, y);
1391
+ }, Q = () => {
1392
1392
  try {
1393
- let b;
1393
+ let y;
1394
1394
  const d = u.value.trim();
1395
1395
  if (d === "null")
1396
- b = null;
1396
+ y = null;
1397
1397
  else if (d === "true" || d === "false")
1398
- b = d === "true";
1398
+ y = d === "true";
1399
1399
  else if (!isNaN(Number(d)) && d !== "") {
1400
- const p = Number(d);
1401
- !Number.isSafeInteger(p) || d.length > 15 ? b = { __protected_number__: d } : b = p;
1400
+ const g = Number(d);
1401
+ !Number.isSafeInteger(g) || d.length > 15 ? y = { __protected_number__: d } : y = g;
1402
1402
  } else
1403
- b = u.value;
1404
- s("update:value", y.value, b), o.value = !1;
1405
- } catch (b) {
1406
- console.error("Failed to parse value:", b), o.value = !1;
1403
+ y = u.value;
1404
+ s("update:value", b.value, y), o.value = !1;
1405
+ } catch (y) {
1406
+ console.error("Failed to parse value:", y), o.value = !1;
1407
1407
  }
1408
- }, ie = () => {
1408
+ }, ee = () => {
1409
1409
  n.value = !1, i.value = t.keyName;
1410
- }, Ee = () => {
1410
+ }, ae = () => {
1411
1411
  o.value = !1, a(t.value) ? u.value = l(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value);
1412
1412
  };
1413
- return (b, d) => {
1414
- const p = Me("JsonNode", !0);
1415
- return x(), N("div", ft, [
1416
- h.value ? (x(), N("div", ht, [
1417
- E("div", pt, [
1418
- b.keyName && !n.value ? (x(), N("span", {
1413
+ return (y, d) => {
1414
+ const g = Ue("JsonNode", !0);
1415
+ return x(), k("div", ht, [
1416
+ h.value ? (x(), k("div", pt, [
1417
+ v("div", gt, [
1418
+ y.keyName && !n.value ? (x(), k("span", {
1419
1419
  key: 0,
1420
1420
  class: "json-node__key",
1421
- onClick: Y,
1421
+ onClick: X,
1422
1422
  title: "Click to edit key"
1423
- }, ' "' + j(C.value) + '" ', 1)) : X("", !0),
1424
- b.keyName && n.value ? ve((x(), N("input", {
1423
+ }, ' "' + R(w.value) + '" ', 1)) : F("", !0),
1424
+ y.keyName && n.value ? _e((x(), k("input", {
1425
1425
  key: 1,
1426
- "onUpdate:modelValue": d[0] || (d[0] = (_) => i.value = _),
1426
+ "onUpdate:modelValue": d[0] || (d[0] = (A) => i.value = A),
1427
1427
  onKeyup: [
1428
- le(D, ["enter"]),
1429
- le(ie, ["escape"])
1428
+ ue(Y, ["enter"]),
1429
+ ue(ee, ["escape"])
1430
1430
  ],
1431
- onBlur: D,
1431
+ onBlur: Y,
1432
1432
  class: "json-node__key-input"
1433
1433
  }, null, 544)), [
1434
- [_e, i.value]
1435
- ]) : X("", !0),
1436
- b.keyName ? (x(), N("span", gt, ": ")) : X("", !0),
1437
- E("span", {
1434
+ [xe, i.value]
1435
+ ]) : F("", !0),
1436
+ y.keyName ? (x(), k("span", mt, ": ")) : F("", !0),
1437
+ v("span", {
1438
1438
  class: "json-node__bracket json-node__bracket--clickable",
1439
- onClick: V,
1439
+ onClick: I,
1440
1440
  title: m.value ? "Click to collapse" : "Click to expand"
1441
- }, j(O.value), 9, bt),
1442
- m.value ? X("", !0) : (x(), N("span", mt, [
1443
- Se(j(M.value) + " ", 1),
1444
- E("span", {
1441
+ }, R(S.value), 9, yt),
1442
+ m.value ? F("", !0) : (x(), k("span", bt, [
1443
+ Se(R(j.value) + " ", 1),
1444
+ v("span", {
1445
1445
  class: "json-node__bracket json-node__bracket--clickable",
1446
- onClick: V
1447
- }, j(P.value), 1)
1446
+ onClick: I
1447
+ }, R(_.value), 1)
1448
1448
  ])),
1449
- !m.value && !b.isLast ? (x(), N("span", yt, ",")) : X("", !0)
1449
+ !m.value && !y.isLast ? (x(), k("span", vt, ",")) : F("", !0)
1450
1450
  ]),
1451
- m.value ? (x(), N("div", Et, [
1452
- E("div", vt, [
1453
- (x(!0), N(he, null, pe(b.value, (_, v) => (x(), N("div", {
1454
- key: v,
1451
+ m.value ? (x(), k("div", Et, [
1452
+ v("div", _t, [
1453
+ (x(!0), k(de, null, fe(y.value, (A, N) => (x(), k("div", {
1454
+ key: N,
1455
1455
  class: "json-node__child"
1456
1456
  }, [
1457
- Ue(p, {
1458
- value: _,
1459
- "key-name": f.value ? "" : String(v),
1460
- level: b.level + 1,
1461
- path: T(String(v)),
1462
- expanded: b.expanded,
1463
- theme: b.theme,
1464
- "onUpdate:value": d[1] || (d[1] = (w, A) => b.$emit("update:value", w, A)),
1465
- onToggleExpand: d[2] || (d[2] = (w) => b.$emit("toggle-expand", w)),
1466
- onCopy: d[3] || (d[3] = (w) => b.$emit("copy", w)),
1467
- "onUpdate:key": d[4] || (d[4] = (w, A) => b.$emit("update:key", w, A)),
1468
- "is-last": U(String(v))
1457
+ Fe(g, {
1458
+ value: A,
1459
+ "key-name": f.value ? "" : String(N),
1460
+ level: y.level + 1,
1461
+ path: E(String(N)),
1462
+ expanded: y.expanded,
1463
+ theme: y.theme,
1464
+ "onUpdate:value": d[1] || (d[1] = (C, T) => y.$emit("update:value", C, T)),
1465
+ onToggleExpand: d[2] || (d[2] = (C) => y.$emit("toggle-expand", C)),
1466
+ onCopy: d[3] || (d[3] = (C) => y.$emit("copy", C)),
1467
+ "onUpdate:key": d[4] || (d[4] = (C, T) => y.$emit("update:key", C, T)),
1468
+ "is-last": O(String(N))
1469
1469
  }, null, 8, ["value", "key-name", "level", "path", "expanded", "theme", "is-last"])
1470
1470
  ]))), 128))
1471
1471
  ]),
1472
- E("div", _t, [
1473
- E("span", xt, j(P.value), 1),
1474
- b.isLast ? X("", !0) : (x(), N("span", Nt, ","))
1472
+ v("div", xt, [
1473
+ v("span", Nt, R(_.value), 1),
1474
+ y.isLast ? F("", !0) : (x(), k("span", kt, ","))
1475
1475
  ])
1476
- ])) : X("", !0)
1477
- ])) : (x(), N("div", kt, [
1478
- b.keyName && !n.value ? (x(), N("span", {
1476
+ ])) : F("", !0)
1477
+ ])) : (x(), k("div", At, [
1478
+ y.keyName && !n.value ? (x(), k("span", {
1479
1479
  key: 0,
1480
1480
  class: "json-node__key",
1481
- onClick: Y,
1481
+ onClick: X,
1482
1482
  title: "Click to edit key"
1483
- }, ' "' + j(C.value) + '" ', 1)) : X("", !0),
1484
- b.keyName && n.value ? ve((x(), N("input", {
1483
+ }, ' "' + R(w.value) + '" ', 1)) : F("", !0),
1484
+ y.keyName && n.value ? _e((x(), k("input", {
1485
1485
  key: 1,
1486
- "onUpdate:modelValue": d[5] || (d[5] = (_) => i.value = _),
1486
+ "onUpdate:modelValue": d[5] || (d[5] = (A) => i.value = A),
1487
1487
  onKeyup: [
1488
- le(D, ["enter"]),
1489
- le(ie, ["escape"])
1488
+ ue(Y, ["enter"]),
1489
+ ue(ee, ["escape"])
1490
1490
  ],
1491
- onBlur: D,
1491
+ onBlur: Y,
1492
1492
  class: "json-node__key-input"
1493
1493
  }, null, 544)), [
1494
- [_e, i.value]
1495
- ]) : X("", !0),
1496
- b.keyName ? (x(), N("span", wt, ": ")) : X("", !0),
1497
- o.value ? X("", !0) : (x(), N("span", {
1494
+ [xe, i.value]
1495
+ ]) : F("", !0),
1496
+ y.keyName ? (x(), k("span", wt, ": ")) : F("", !0),
1497
+ o.value ? F("", !0) : (x(), k("span", {
1498
1498
  key: 3,
1499
- class: Oe(["json-node__value", k.value]),
1499
+ class: Te(["json-node__value", H.value]),
1500
1500
  onClick: Z,
1501
- onDblclick: d[6] || (d[6] = (_) => b.$emit("copy", b.value)),
1502
- title: g.value
1501
+ onDblclick: d[6] || (d[6] = (A) => y.$emit("copy", y.value)),
1502
+ title: $.value
1503
1503
  }, [
1504
- Se(j(S.value), 1),
1505
- b.isLast ? X("", !0) : (x(), N("span", Ct, ","))
1506
- ], 42, At)),
1507
- o.value ? ve((x(), N("input", {
1504
+ Se(R(p.value), 1),
1505
+ y.isLast ? F("", !0) : (x(), k("span", Ot, ","))
1506
+ ], 42, Ct)),
1507
+ o.value ? _e((x(), k("input", {
1508
1508
  key: 4,
1509
- "onUpdate:modelValue": d[7] || (d[7] = (_) => u.value = _),
1509
+ "onUpdate:modelValue": d[7] || (d[7] = (A) => u.value = A),
1510
1510
  onKeyup: [
1511
- le(J, ["enter"]),
1512
- le(Ee, ["escape"])
1511
+ ue(Q, ["enter"]),
1512
+ ue(ae, ["escape"])
1513
1513
  ],
1514
- onBlur: J,
1514
+ onBlur: Q,
1515
1515
  class: "json-node__value-input"
1516
1516
  }, null, 544)), [
1517
- [_e, u.value]
1518
- ]) : X("", !0)
1517
+ [xe, u.value]
1518
+ ]) : F("", !0)
1519
1519
  ]))
1520
1520
  ]);
1521
1521
  };
1522
1522
  }
1523
- }), me = (r, e) => {
1523
+ }), be = (r, e) => {
1524
1524
  const t = r.__vccOpts || r;
1525
1525
  for (const [s, n] of e)
1526
1526
  t[s] = n;
1527
1527
  return t;
1528
- }, Tt = /* @__PURE__ */ me(Ot, [["__scopeId", "data-v-860beb35"]]), He = {
1528
+ }, Pt = /* @__PURE__ */ be(Tt, [["__scopeId", "data-v-860beb35"]]), Ke = {
1529
1529
  name: "github-light",
1530
1530
  colors: {
1531
1531
  // 背景色
@@ -1564,7 +1564,7 @@ const ft = { class: "json-node" }, ht = {
1564
1564
  // 缩进线
1565
1565
  indentLine: "#d0d7de"
1566
1566
  }
1567
- }, Pt = {
1567
+ }, $t = {
1568
1568
  name: "github-dark",
1569
1569
  colors: {
1570
1570
  // 背景色
@@ -1681,34 +1681,34 @@ const ft = { class: "json-node" }, ht = {
1681
1681
  // 缩进线
1682
1682
  indentLine: "#e8d5b7"
1683
1683
  }
1684
- }, $t = {
1685
- "github-light": He,
1686
- "github-dark": Pt,
1684
+ }, Bt = {
1685
+ "github-light": Ke,
1686
+ "github-dark": $t,
1687
1687
  "min-light": St,
1688
1688
  "slack-ochin": It
1689
1689
  };
1690
- function Bt(r = "github-light") {
1691
- return $t[r] || He;
1690
+ function Vt(r = "github-light") {
1691
+ return Bt[r] || Ke;
1692
1692
  }
1693
1693
  const Lt = {
1694
1694
  key: 0,
1695
1695
  class: "json-format__toolbar"
1696
- }, Vt = { class: "json-format__actions" }, Rt = ["disabled"], jt = ["disabled"], Mt = ["disabled"], Ut = ["disabled"], Ft = { class: "json-format__info" }, Xt = {
1696
+ }, Rt = { class: "json-format__actions" }, jt = ["disabled"], Mt = ["disabled"], Ut = ["disabled"], Ft = ["disabled"], Xt = { class: "json-format__info" }, Ht = {
1697
1697
  key: 0,
1698
1698
  class: "json-format__status json-format__status--success"
1699
- }, Ht = {
1699
+ }, Kt = {
1700
1700
  key: 1,
1701
1701
  class: "json-format__status json-format__status--error"
1702
- }, Kt = { class: "json-format__content" }, Yt = {
1702
+ }, qt = { class: "json-format__content" }, Yt = {
1703
1703
  key: 0,
1704
1704
  class: "json-format__error"
1705
- }, qt = {
1705
+ }, Qt = {
1706
1706
  key: 1,
1707
1707
  class: "json-format__error"
1708
- }, Qt = {
1708
+ }, Wt = {
1709
1709
  key: 2,
1710
1710
  class: "json-format__viewer"
1711
- }, Gt = /* @__PURE__ */ be({
1711
+ }, Gt = /* @__PURE__ */ ye({
1712
1712
  name: "JsonFormat",
1713
1713
  __name: "index",
1714
1714
  props: {
@@ -1720,7 +1720,7 @@ const Lt = {
1720
1720
  },
1721
1721
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress"],
1722
1722
  setup(r, { expose: e, emit: t }) {
1723
- Ce((d) => ({
1723
+ Oe((d) => ({
1724
1724
  "50e4672c": f.value.colors.border,
1725
1725
  "64d14328": f.value.colors.background,
1726
1726
  "668c94eb": f.value.colors.text,
@@ -1739,54 +1739,54 @@ const Lt = {
1739
1739
  "2c1c44e4": f.value.colors.scrollbarThumb,
1740
1740
  "8ba97764": f.value.colors.scrollbarThumbHover
1741
1741
  }));
1742
- const s = r, n = t, o = G(null), i = G(""), u = G(/* @__PURE__ */ new Set()), a = G(null), l = G(""), h = L(() => i.value === ""), f = L(() => Bt(s.theme)), y = L(() => l.value ? null : a.value !== null ? a.value : o.value), m = (d) => {
1742
+ const s = r, n = t, o = z(null), i = z(""), u = z(/* @__PURE__ */ new Set()), a = z(null), l = z(""), h = V(() => i.value === ""), f = V(() => Vt(s.theme)), b = V(() => l.value ? null : a.value !== null ? a.value : o.value), m = (d) => {
1743
1743
  if (!d.trim()) {
1744
1744
  o.value = null, i.value = "", a.value = null, l.value = "";
1745
1745
  return;
1746
1746
  }
1747
1747
  try {
1748
- let p = d;
1749
- const _ = /(:\s*|,\s*|\[\s*)-?\d{16,}/.test(p), v = /(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(p);
1750
- if (!_ && !v)
1748
+ let g = d;
1749
+ const A = /(:\s*|,\s*|\[\s*)-?\d{16,}/.test(g), N = /(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(g);
1750
+ if (!A && !N)
1751
1751
  try {
1752
- o.value = JSON.parse(p), i.value = "", a.value = null, l.value = "", ce(() => {
1753
- y.value !== null && g();
1752
+ o.value = JSON.parse(g), i.value = "", a.value = null, l.value = "", he(() => {
1753
+ b.value !== null && $();
1754
1754
  });
1755
1755
  return;
1756
1756
  } catch {
1757
1757
  }
1758
- p = ((A) => {
1759
- let B = "", H = !1, K = !1, z = 0;
1760
- for (; z < A.length; ) {
1761
- const ae = A[z];
1762
- if (H)
1763
- K ? K = !1 : ae === "\\" ? K = !0 : ae === '"' && (H = !1), B += ae, z++;
1764
- else if (ae === '"')
1765
- H = !0, B += ae, z++;
1758
+ g = ((T) => {
1759
+ let L = "", K = !1, q = !1, J = 0;
1760
+ for (; J < T.length; ) {
1761
+ const le = T[J];
1762
+ if (K)
1763
+ q ? q = !1 : le === "\\" ? q = !0 : le === '"' && (K = !1), L += le, J++;
1764
+ else if (le === '"')
1765
+ K = !0, L += le, J++;
1766
1766
  else {
1767
- const Pe = A.slice(z);
1768
- let W = Pe.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);
1769
- if (W) {
1770
- B += W[1] + '{"__protected_number__":"' + W[2] + '"}' + W[3], z += W[0].length;
1767
+ const $e = T.slice(J);
1768
+ let D = $e.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);
1769
+ if (D) {
1770
+ L += D[1] + '{"__protected_number__":"' + D[2] + '"}' + D[3], J += D[0].length;
1771
1771
  continue;
1772
1772
  }
1773
- if (W = Pe.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/), W) {
1774
- B += W[1] + '{"__protected_number__":"' + W[2] + '"}' + W[3], z += W[0].length;
1773
+ if (D = $e.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/), D) {
1774
+ L += D[1] + '{"__protected_number__":"' + D[2] + '"}' + D[3], J += D[0].length;
1775
1775
  continue;
1776
1776
  }
1777
- B += ae, z++;
1777
+ L += le, J++;
1778
1778
  }
1779
1779
  }
1780
- return B;
1781
- })(p), o.value = JSON.parse(p), i.value = "", a.value = null, l.value = "", ce(() => {
1782
- y.value !== null && g();
1780
+ return L;
1781
+ })(g), o.value = JSON.parse(g), i.value = "", a.value = null, l.value = "", he(() => {
1782
+ b.value !== null && $();
1783
1783
  });
1784
- } catch (p) {
1785
- i.value = p instanceof Error ? p.message : "Unknown parsing error", o.value = null, a.value = null, l.value = "";
1784
+ } catch (g) {
1785
+ i.value = g instanceof Error ? g.message : "Unknown parsing error", o.value = null, a.value = null, l.value = "";
1786
1786
  }
1787
- }, C = (d) => {
1787
+ }, w = (d) => {
1788
1788
  if (!d || !d.expression.trim()) {
1789
- O();
1789
+ S();
1790
1790
  return;
1791
1791
  }
1792
1792
  if (!o.value) {
@@ -1794,179 +1794,179 @@ const Lt = {
1794
1794
  return;
1795
1795
  }
1796
1796
  try {
1797
- let p;
1797
+ let g;
1798
1798
  if (d.type === "jsonpath")
1799
- p = $({ path: d.expression, json: o.value }), p.length === 1 && d.expression.includes("$[") === !1 && !d.expression.endsWith("[*]") ? a.value = p[0] : a.value = p;
1799
+ g = B({ path: d.expression, json: o.value }), g.length === 1 && d.expression.includes("$[") === !1 && !d.expression.endsWith("[*]") ? a.value = g[0] : a.value = g;
1800
1800
  else if (d.type === "js")
1801
- p = new Function("data", `
1801
+ g = new Function("data", `
1802
1802
  try {
1803
1803
  return ${d.expression};
1804
1804
  } catch (error) {
1805
1805
  throw new Error('JavaScript expression error: ' + error.message);
1806
1806
  }
1807
- `)(o.value), a.value = p;
1807
+ `)(o.value), a.value = g;
1808
1808
  else
1809
1809
  throw new Error(`Unsupported filter type: ${d.type}`);
1810
- l.value = "", ce(() => {
1811
- g();
1810
+ l.value = "", he(() => {
1811
+ $();
1812
1812
  });
1813
- } catch (p) {
1814
- l.value = p instanceof Error ? p.message : "Filter execution error", a.value = null;
1813
+ } catch (g) {
1814
+ l.value = g instanceof Error ? g.message : "Filter execution error", a.value = null;
1815
1815
  }
1816
- }, O = () => {
1816
+ }, S = () => {
1817
1817
  a.value = null, l.value = "";
1818
1818
  };
1819
- Fe(() => s.modelValue, (d) => {
1819
+ Xe(() => s.modelValue, (d) => {
1820
1820
  m(d);
1821
1821
  }, { immediate: !0 });
1822
- const P = (d, p, _) => {
1823
- const v = (B) => {
1824
- if (B === null || typeof B != "object")
1825
- return B;
1826
- if (!Array.isArray(B) && "__protected_number__" in B && Object.keys(B).length === 1)
1827
- return `__PROTECTED_NUMBER_${B.__protected_number__}_PROTECTED_NUMBER__`;
1828
- if (Array.isArray(B))
1829
- return B.map((K) => v(K));
1830
- const H = {};
1831
- for (const [K, z] of Object.entries(B))
1832
- H[K] = v(z);
1833
- return H;
1834
- }, w = v(d);
1835
- return JSON.stringify(w, p, _).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g, "$1");
1836
- }, M = (d, p) => {
1822
+ const _ = (d, g, A) => {
1823
+ const N = (L) => {
1824
+ if (L === null || typeof L != "object")
1825
+ return L;
1826
+ if (!Array.isArray(L) && "__protected_number__" in L && Object.keys(L).length === 1)
1827
+ return `__PROTECTED_NUMBER_${L.__protected_number__}_PROTECTED_NUMBER__`;
1828
+ if (Array.isArray(L))
1829
+ return L.map((q) => N(q));
1830
+ const K = {};
1831
+ for (const [q, J] of Object.entries(L))
1832
+ K[q] = N(J);
1833
+ return K;
1834
+ }, C = N(d);
1835
+ return JSON.stringify(C, g, A).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g, "$1");
1836
+ }, j = (d, g) => {
1837
1837
  if (!s.readonly)
1838
1838
  try {
1839
- const _ = k(o.value, d, p), v = P(_, null, 2);
1840
- n("update:modelValue", v);
1841
- } catch (_) {
1842
- console.error("Failed to update JSON:", _);
1839
+ const A = H(o.value, d, g), N = _(A, null, 2);
1840
+ n("update:modelValue", N);
1841
+ } catch (A) {
1842
+ console.error("Failed to update JSON:", A);
1843
1843
  }
1844
- }, k = (d, p, _) => {
1845
- if (!p || p === "root") return _;
1846
- const v = p.split("."), w = J(d, v.slice(0, -1));
1847
- let A = w;
1848
- for (let H = 0; H < v.length - 1; H++) {
1849
- const K = v[H];
1850
- K !== "root" && (Array.isArray(A) ? A = A[parseInt(K)] : A = A[K]);
1844
+ }, H = (d, g, A) => {
1845
+ if (!g || g === "root") return A;
1846
+ const N = g.split("."), C = Q(d, N.slice(0, -1));
1847
+ let T = C;
1848
+ for (let K = 0; K < N.length - 1; K++) {
1849
+ const q = N[K];
1850
+ q !== "root" && (Array.isArray(T) ? T = T[parseInt(q)] : T = T[q]);
1851
1851
  }
1852
- const B = v[v.length - 1];
1853
- return B === "root" ? _ : (Array.isArray(A) ? A[parseInt(B)] = _ : A[B] = _, w);
1854
- }, S = (d) => {
1852
+ const L = N[N.length - 1];
1853
+ return L === "root" ? A : (Array.isArray(T) ? T[parseInt(L)] = A : T[L] = A, C);
1854
+ }, p = (d) => {
1855
1855
  u.value.has(d) ? u.value.delete(d) : u.value.add(d);
1856
- }, g = () => {
1857
- const d = /* @__PURE__ */ new Set(), p = (_, v = "") => {
1858
- _ !== null && typeof _ == "object" && (d.add(v || "root"), Array.isArray(_) ? _.forEach((w, A) => {
1859
- const B = v ? `${v}.${A}` : `${A}`;
1860
- p(w, B);
1861
- }) : Object.keys(_).forEach((w) => {
1862
- const A = v ? `${v}.${w}` : w;
1863
- p(_[w], A);
1856
+ }, $ = () => {
1857
+ const d = /* @__PURE__ */ new Set(), g = (A, N = "") => {
1858
+ A !== null && typeof A == "object" && (d.add(N || "root"), Array.isArray(A) ? A.forEach((C, T) => {
1859
+ const L = N ? `${N}.${T}` : `${T}`;
1860
+ g(C, L);
1861
+ }) : Object.keys(A).forEach((C) => {
1862
+ const T = N ? `${N}.${C}` : C;
1863
+ g(A[C], T);
1864
1864
  }));
1865
1865
  };
1866
- p(y.value), u.value = d, n("expand-all");
1867
- }, T = () => {
1866
+ g(b.value), u.value = d, n("expand-all");
1867
+ }, E = () => {
1868
1868
  u.value = /* @__PURE__ */ new Set(["root"]), n("collapse-all");
1869
- }, U = async () => {
1869
+ }, O = async () => {
1870
1870
  if (h.value)
1871
1871
  try {
1872
- const d = y.value, p = P(d, null, 2);
1873
- await navigator.clipboard.writeText(p), n("copy-success", p);
1872
+ const d = b.value, g = _(d, null, 2);
1873
+ await navigator.clipboard.writeText(g), n("copy-success", g);
1874
1874
  } catch (d) {
1875
1875
  console.error("Failed to copy JSON:", d), n("copy-error", d instanceof Error ? d : new Error("Failed to copy JSON"));
1876
1876
  }
1877
- }, V = () => {
1877
+ }, I = () => {
1878
1878
  if (h.value)
1879
1879
  try {
1880
- const d = y.value, p = P(d);
1881
- n("update:modelValue", p), n("compress", p);
1880
+ const d = b.value, g = _(d);
1881
+ n("update:modelValue", g), n("compress", g);
1882
1882
  } catch (d) {
1883
1883
  console.error("Failed to compress JSON:", d);
1884
1884
  }
1885
- }, Y = async (d) => {
1885
+ }, X = async (d) => {
1886
1886
  try {
1887
- let p;
1888
- typeof d == "object" && d !== null && !Array.isArray(d) && "__protected_number__" in d && Object.keys(d).length === 1 ? p = d.__protected_number__ : typeof d == "string" ? p = `"${d}"` : p = JSON.stringify(d), await navigator.clipboard.writeText(p);
1889
- } catch (p) {
1890
- console.error("Failed to copy value:", p);
1887
+ let g;
1888
+ typeof d == "object" && d !== null && !Array.isArray(d) && "__protected_number__" in d && Object.keys(d).length === 1 ? g = d.__protected_number__ : typeof d == "string" ? g = `"${d}"` : g = JSON.stringify(d), await navigator.clipboard.writeText(g);
1889
+ } catch (g) {
1890
+ console.error("Failed to copy value:", g);
1891
1891
  }
1892
- }, Z = (d, p) => {
1892
+ }, Z = (d, g) => {
1893
1893
  if (!s.readonly)
1894
1894
  try {
1895
- const _ = D(o.value, d, p), v = P(_, null, 2);
1896
- n("update:modelValue", v), b(d, p);
1897
- } catch (_) {
1898
- console.error("Failed to rename key:", _);
1895
+ const A = Y(o.value, d, g), N = _(A, null, 2);
1896
+ n("update:modelValue", N), y(d, g);
1897
+ } catch (A) {
1898
+ console.error("Failed to rename key:", A);
1899
1899
  }
1900
- }, D = (d, p, _) => {
1901
- if (!p || p === "root") return d;
1902
- const v = p.split("."), w = J(d, v.slice(0, -1));
1903
- if (v.length === 1) {
1904
- const H = v[0];
1905
- return w && typeof w == "object" && !Array.isArray(w) ? ie(w, H, _) : w;
1900
+ }, Y = (d, g, A) => {
1901
+ if (!g || g === "root") return d;
1902
+ const N = g.split("."), C = Q(d, N.slice(0, -1));
1903
+ if (N.length === 1) {
1904
+ const K = N[0];
1905
+ return C && typeof C == "object" && !Array.isArray(C) ? ee(C, K, A) : C;
1906
1906
  }
1907
- let A = w;
1908
- for (let H = 0; H < v.length - 1; H++) {
1909
- const K = v[H];
1910
- Array.isArray(A) ? A = A[parseInt(K)] : A = A[K];
1907
+ let T = C;
1908
+ for (let K = 0; K < N.length - 1; K++) {
1909
+ const q = N[K];
1910
+ Array.isArray(T) ? T = T[parseInt(q)] : T = T[q];
1911
1911
  }
1912
- const B = v[v.length - 1];
1913
- if (!Array.isArray(A) && A && typeof A == "object") {
1914
- const H = ie(A, B, _), K = v.slice(0, -1);
1915
- K.length > 0 && Ee(w, K, H);
1912
+ const L = N[N.length - 1];
1913
+ if (!Array.isArray(T) && T && typeof T == "object") {
1914
+ const K = ee(T, L, A), q = N.slice(0, -1);
1915
+ q.length > 0 && ae(C, q, K);
1916
1916
  }
1917
- return w;
1918
- }, J = (d, p) => {
1919
- if (p.length === 0) return d;
1917
+ return C;
1918
+ }, Q = (d, g) => {
1919
+ if (g.length === 0) return d;
1920
1920
  if (Array.isArray(d)) {
1921
- const _ = [...d], v = p[0], w = parseInt(v);
1922
- return p.length === 1 || (_[w] = J(d[w], p.slice(1))), _;
1921
+ const A = [...d], N = g[0], C = parseInt(N);
1922
+ return g.length === 1 || (A[C] = Q(d[C], g.slice(1))), A;
1923
1923
  } else if (d && typeof d == "object") {
1924
- const _ = { ...d }, v = p[0];
1925
- return p.length === 1 || (_[v] = J(d[v], p.slice(1))), _;
1924
+ const A = { ...d }, N = g[0];
1925
+ return g.length === 1 || (A[N] = Q(d[N], g.slice(1))), A;
1926
1926
  }
1927
1927
  return d;
1928
- }, ie = (d, p, _) => {
1928
+ }, ee = (d, g, A) => {
1929
1929
  if (!d || typeof d != "object" || Array.isArray(d))
1930
1930
  return d;
1931
- const v = Object.keys(d), w = {};
1932
- for (const A of v)
1933
- A === p ? w[_] = d[A] : w[A] = d[A];
1934
- return w;
1935
- }, Ee = (d, p, _) => {
1936
- let v = d;
1937
- for (let A = 0; A < p.length - 1; A++) {
1938
- const B = p[A];
1939
- Array.isArray(v) ? v = v[parseInt(B)] : v = v[B];
1931
+ const N = Object.keys(d), C = {};
1932
+ for (const T of N)
1933
+ T === g ? C[A] = d[T] : C[T] = d[T];
1934
+ return C;
1935
+ }, ae = (d, g, A) => {
1936
+ let N = d;
1937
+ for (let T = 0; T < g.length - 1; T++) {
1938
+ const L = g[T];
1939
+ Array.isArray(N) ? N = N[parseInt(L)] : N = N[L];
1940
1940
  }
1941
- const w = p[p.length - 1];
1942
- Array.isArray(v) ? v[parseInt(w)] = _ : v[w] = _;
1943
- }, b = (d, p) => {
1944
- const _ = /* @__PURE__ */ new Set();
1945
- u.value.forEach((v) => {
1946
- if (v === d) {
1947
- const w = d.split(".");
1948
- w[w.length - 1] = p, _.add(w.join("."));
1949
- } else if (v.startsWith(d + ".")) {
1950
- const w = d.split(".");
1951
- w[w.length - 1] = p;
1952
- const A = w.join("."), B = v.substring(d.length);
1953
- _.add(A + B);
1941
+ const C = g[g.length - 1];
1942
+ Array.isArray(N) ? N[parseInt(C)] = A : N[C] = A;
1943
+ }, y = (d, g) => {
1944
+ const A = /* @__PURE__ */ new Set();
1945
+ u.value.forEach((N) => {
1946
+ if (N === d) {
1947
+ const C = d.split(".");
1948
+ C[C.length - 1] = g, A.add(C.join("."));
1949
+ } else if (N.startsWith(d + ".")) {
1950
+ const C = d.split(".");
1951
+ C[C.length - 1] = g;
1952
+ const T = C.join("."), L = N.substring(d.length);
1953
+ A.add(T + L);
1954
1954
  } else
1955
- _.add(v);
1956
- }), u.value = _;
1955
+ A.add(N);
1956
+ }), u.value = A;
1957
1957
  };
1958
1958
  return e({
1959
1959
  // 核心操作方法
1960
- copyJson: U,
1961
- compressSource: V,
1962
- expandAll: g,
1963
- collapseAll: T,
1964
- toggleExpand: S,
1965
- updateValue: M,
1960
+ copyJson: O,
1961
+ compressSource: I,
1962
+ expandAll: $,
1963
+ collapseAll: E,
1964
+ toggleExpand: p,
1965
+ updateValue: j,
1966
1966
  updateKey: Z,
1967
1967
  // Filter 相关方法
1968
- filter: C,
1969
- clearFilter: O,
1968
+ filter: w,
1969
+ clearFilter: S,
1970
1970
  // 状态访问方法
1971
1971
  isValidJson: () => h.value,
1972
1972
  getParsedJson: () => o.value,
@@ -1976,266 +1976,759 @@ const Lt = {
1976
1976
  getFilterError: () => l.value,
1977
1977
  // 工具方法
1978
1978
  parseJson: (d) => m(d),
1979
- copyValue: (d) => Y(d)
1980
- }), (d, p) => (x(), N("div", {
1981
- class: Oe(["json-format", `json-format--${f.value.name}`])
1979
+ copyValue: (d) => X(d)
1980
+ }), (d, g) => (x(), k("div", {
1981
+ class: Te(["json-format", `json-format--${f.value.name}`])
1982
1982
  }, [
1983
- d.showToolbar ? (x(), N("div", Lt, [
1984
- E("div", Vt, [
1985
- E("button", {
1983
+ d.showToolbar ? (x(), k("div", Lt, [
1984
+ v("div", Rt, [
1985
+ v("button", {
1986
1986
  class: "json-format__btn json-format__btn--primary",
1987
- onClick: U,
1987
+ onClick: O,
1988
1988
  disabled: !h.value,
1989
1989
  title: "Copy JSON"
1990
- }, " 📋 Copy ", 8, Rt),
1991
- E("button", {
1990
+ }, " 📋 Copy ", 8, jt),
1991
+ v("button", {
1992
1992
  class: "json-format__btn json-format__btn--secondary",
1993
- onClick: g,
1993
+ onClick: $,
1994
1994
  disabled: !h.value,
1995
1995
  title: "Expand All"
1996
- }, " ⬇️ Expand All ", 8, jt),
1997
- E("button", {
1996
+ }, " ⬇️ Expand All ", 8, Mt),
1997
+ v("button", {
1998
1998
  class: "json-format__btn json-format__btn--secondary",
1999
- onClick: T,
1999
+ onClick: E,
2000
2000
  disabled: !h.value,
2001
2001
  title: "Collapse All"
2002
- }, " ➡️ Collapse All ", 8, Mt),
2003
- E("button", {
2002
+ }, " ➡️ Collapse All ", 8, Ut),
2003
+ v("button", {
2004
2004
  class: "json-format__btn json-format__btn--secondary",
2005
- onClick: V,
2005
+ onClick: I,
2006
2006
  disabled: !h.value,
2007
2007
  title: "Compress JSON"
2008
- }, " 📦 Compress ", 8, Ut)
2008
+ }, " 📦 Compress ", 8, Ft)
2009
2009
  ]),
2010
- E("div", Ft, [
2011
- h.value ? (x(), N("span", Xt, " ✅ Valid JSON ")) : (x(), N("span", Ht, " ❌ Invalid JSON "))
2010
+ v("div", Xt, [
2011
+ h.value ? (x(), k("span", Ht, " ✅ Valid JSON ")) : (x(), k("span", Kt, " ❌ Invalid JSON "))
2012
2012
  ])
2013
- ])) : X("", !0),
2014
- E("div", Kt, [
2015
- h.value ? l.value ? (x(), N("div", qt, [
2016
- p[1] || (p[1] = E("h4", null, "Filter Error:", -1)),
2017
- E("pre", null, j(l.value), 1)
2018
- ])) : (x(), N("div", Qt, [
2019
- Ue(Tt, {
2020
- value: y.value,
2013
+ ])) : F("", !0),
2014
+ v("div", qt, [
2015
+ h.value ? l.value ? (x(), k("div", Qt, [
2016
+ g[1] || (g[1] = v("h4", null, "Filter Error:", -1)),
2017
+ v("pre", null, R(l.value), 1)
2018
+ ])) : (x(), k("div", Wt, [
2019
+ Fe(Pt, {
2020
+ value: b.value,
2021
2021
  "key-name": "",
2022
2022
  level: 0,
2023
2023
  expanded: u.value,
2024
2024
  "is-last": !0,
2025
2025
  theme: f.value,
2026
- "onUpdate:value": M,
2027
- onToggleExpand: S,
2028
- onCopy: Y,
2026
+ "onUpdate:value": j,
2027
+ onToggleExpand: p,
2028
+ onCopy: X,
2029
2029
  "onUpdate:key": Z
2030
2030
  }, null, 8, ["value", "expanded", "theme"])
2031
- ])) : (x(), N("div", Yt, [
2032
- p[0] || (p[0] = E("h4", null, "JSON Parse Error:", -1)),
2033
- E("pre", null, j(i.value), 1)
2031
+ ])) : (x(), k("div", Yt, [
2032
+ g[0] || (g[0] = v("h4", null, "JSON Parse Error:", -1)),
2033
+ v("pre", null, R(i.value), 1)
2034
2034
  ]))
2035
2035
  ])
2036
2036
  ], 2));
2037
2037
  }
2038
- }), Wt = /* @__PURE__ */ me(Gt, [["__scopeId", "data-v-7a477244"]]), Ke = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", Zt = Ke + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", zt = "[" + Ke + "][" + Zt + "]*", Dt = new RegExp("^" + zt + "$");
2039
- function Ye(r, e) {
2040
- const t = [];
2041
- let s = e.exec(r);
2042
- for (; s; ) {
2043
- const n = [];
2044
- n.startIndex = e.lastIndex - s[0].length;
2045
- const o = s.length;
2046
- for (let i = 0; i < o; i++)
2047
- n.push(s[i]);
2048
- t.push(n), s = e.exec(r);
2049
- }
2050
- return t;
2051
- }
2052
- const ye = function(r) {
2053
- const e = Dt.exec(r);
2054
- return !(e === null || typeof e > "u");
2055
- };
2056
- function Jt(r) {
2057
- return typeof r < "u";
2058
- }
2059
- const er = {
2060
- allowBooleanAttributes: !1,
2061
- //A tag can have attributes without any value
2062
- unpairedTags: []
2063
- };
2064
- function qe(r, e) {
2065
- e = Object.assign({}, er, e);
2066
- const t = [];
2067
- let s = !1, n = !1;
2068
- r[0] === "\uFEFF" && (r = r.substr(1));
2069
- for (let o = 0; o < r.length; o++)
2070
- if (r[o] === "<" && r[o + 1] === "?") {
2071
- if (o += 2, o = Be(r, o), o.err) return o;
2072
- } else if (r[o] === "<") {
2073
- let i = o;
2074
- if (o++, r[o] === "!") {
2075
- o = Le(r, o);
2076
- continue;
2077
- } else {
2078
- let u = !1;
2079
- r[o] === "/" && (u = !0, o++);
2080
- let a = "";
2081
- for (; o < r.length && r[o] !== ">" && r[o] !== " " && r[o] !== " " && r[o] !== `
2082
- ` && r[o] !== "\r"; o++)
2083
- a += r[o];
2084
- if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), o--), !lr(a)) {
2085
- let f;
2086
- return a.trim().length === 0 ? f = "Invalid space after '<'." : f = "Tag '" + a + "' is an invalid name.", F("InvalidTag", f, q(r, o));
2087
- }
2088
- const l = nr(r, o);
2089
- if (l === !1)
2090
- return F("InvalidAttr", "Attributes for '" + a + "' have open quote.", q(r, o));
2091
- let h = l.value;
2092
- if (o = l.index, h[h.length - 1] === "/") {
2093
- const f = o - h.length;
2094
- h = h.substring(0, h.length - 1);
2095
- const y = Ve(h, e);
2096
- if (y === !0)
2097
- s = !0;
2098
- else
2099
- return F(y.err.code, y.err.msg, q(r, f + y.err.line));
2100
- } else if (u)
2101
- if (l.tagClosed) {
2102
- if (h.trim().length > 0)
2103
- return F("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", q(r, i));
2104
- if (t.length === 0)
2105
- return F("InvalidTag", "Closing tag '" + a + "' has not been opened.", q(r, i));
2106
- {
2107
- const f = t.pop();
2108
- if (a !== f.tagName) {
2109
- let y = q(r, f.tagStartPos);
2110
- return F(
2111
- "InvalidTag",
2112
- "Expected closing tag '" + f.tagName + "' (opened in line " + y.line + ", col " + y.col + ") instead of closing tag '" + a + "'.",
2113
- q(r, i)
2114
- );
2115
- }
2116
- t.length == 0 && (n = !0);
2117
- }
2118
- } else return F("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", q(r, o));
2119
- else {
2120
- const f = Ve(h, e);
2121
- if (f !== !0)
2122
- return F(f.err.code, f.err.msg, q(r, o - h.length + f.err.line));
2123
- if (n === !0)
2124
- return F("InvalidXml", "Multiple possible root nodes found.", q(r, o));
2125
- e.unpairedTags.indexOf(a) !== -1 || t.push({ tagName: a, tagStartPos: i }), s = !0;
2126
- }
2127
- for (o++; o < r.length; o++)
2128
- if (r[o] === "<")
2129
- if (r[o + 1] === "!") {
2130
- o++, o = Le(r, o);
2131
- continue;
2132
- } else if (r[o + 1] === "?") {
2133
- if (o = Be(r, ++o), o.err) return o;
2134
- } else
2135
- break;
2136
- else if (r[o] === "&") {
2137
- const f = ir(r, o);
2138
- if (f == -1)
2139
- return F("InvalidChar", "char '&' is not expected.", q(r, o));
2140
- o = f;
2141
- } else if (n === !0 && !$e(r[o]))
2142
- return F("InvalidXml", "Extra text at the end", q(r, o));
2143
- r[o] === "<" && o--;
2144
- }
2145
- } else {
2146
- if ($e(r[o]))
2147
- continue;
2148
- return F("InvalidChar", "char '" + r[o] + "' is not expected.", q(r, o));
2149
- }
2150
- if (s) {
2151
- if (t.length == 1)
2152
- return F("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", q(r, t[0].tagStartPos));
2153
- if (t.length > 0)
2154
- return F("InvalidXml", "Invalid '" + JSON.stringify(t.map((o) => o.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
2155
- } else return F("InvalidXml", "Start tag expected.", 1);
2156
- return !0;
2157
- }
2158
- function $e(r) {
2159
- return r === " " || r === " " || r === `
2160
- ` || r === "\r";
2161
- }
2162
- function Be(r, e) {
2163
- const t = e;
2164
- for (; e < r.length; e++)
2165
- if (r[e] == "?" || r[e] == " ") {
2166
- const s = r.substr(t, e - t);
2167
- if (e > 5 && s === "xml")
2168
- return F("InvalidXml", "XML declaration allowed only at the start of the document.", q(r, e));
2169
- if (r[e] == "?" && r[e + 1] == ">") {
2170
- e++;
2171
- break;
2172
- } else
2173
- continue;
2174
- }
2175
- return e;
2176
- }
2177
- function Le(r, e) {
2178
- if (r.length > e + 5 && r[e + 1] === "-" && r[e + 2] === "-") {
2179
- for (e += 3; e < r.length; e++)
2180
- if (r[e] === "-" && r[e + 1] === "-" && r[e + 2] === ">") {
2181
- e += 2;
2182
- break;
2183
- }
2184
- } else if (r.length > e + 8 && r[e + 1] === "D" && r[e + 2] === "O" && r[e + 3] === "C" && r[e + 4] === "T" && r[e + 5] === "Y" && r[e + 6] === "P" && r[e + 7] === "E") {
2185
- let t = 1;
2186
- for (e += 8; e < r.length; e++)
2187
- if (r[e] === "<")
2188
- t++;
2189
- else if (r[e] === ">" && (t--, t === 0))
2190
- break;
2191
- } else if (r.length > e + 9 && r[e + 1] === "[" && r[e + 2] === "C" && r[e + 3] === "D" && r[e + 4] === "A" && r[e + 5] === "T" && r[e + 6] === "A" && r[e + 7] === "[") {
2192
- for (e += 8; e < r.length; e++)
2193
- if (r[e] === "]" && r[e + 1] === "]" && r[e + 2] === ">") {
2194
- e += 2;
2195
- break;
2038
+ }), Zt = /* @__PURE__ */ be(Gt, [["__scopeId", "data-v-7a477244"]]), zt = {
2039
+ key: 0,
2040
+ class: "xml-node__comment"
2041
+ }, Dt = {
2042
+ key: 1,
2043
+ class: "xml-node__cdata"
2044
+ }, Jt = {
2045
+ key: 2,
2046
+ class: "xml-node__element"
2047
+ }, er = {
2048
+ key: 0,
2049
+ class: "xml-node__line"
2050
+ }, tr = {
2051
+ key: 1,
2052
+ class: "xml-node__line"
2053
+ }, rr = { key: 2 }, nr = { class: "xml-node__line" }, sr = ["title"], or = { key: 1 }, ir = ["title"], ar = {
2054
+ key: 0,
2055
+ class: "xml-node__children"
2056
+ }, lr = {
2057
+ key: 0,
2058
+ class: "xml-node__text"
2059
+ }, ur = {
2060
+ key: 1,
2061
+ class: "xml-node__line"
2062
+ }, cr = /* @__PURE__ */ ye({
2063
+ __name: "XmlNode",
2064
+ props: {
2065
+ node: {},
2066
+ index: {},
2067
+ level: { default: 0 },
2068
+ parentPath: { default: "" },
2069
+ expanded: {},
2070
+ theme: {}
2071
+ },
2072
+ emits: ["toggle-expand", "copy"],
2073
+ setup(r, { emit: e }) {
2074
+ const t = r, s = e, n = V(() => Object.keys(t.node).find(($) => !$.startsWith(":") && !$.startsWith("#")) || ""), o = V(() => n.value ? t.parentPath ? `${t.parentPath}[${t.index}]` : `${n.value}[${t.index}]` : ""), i = V(() => t.expanded.has(o.value)), u = V(() => t.node["#comment"] ? "comment" : t.node.__cdata ? "cdata" : n.value ? "element" : "unknown"), a = V(() => {
2075
+ const p = t.node[":@"] || {}, $ = {};
2076
+ return Object.keys(p).forEach((E) => {
2077
+ E.startsWith("@_") && ($[E.substring(2)] = p[E]);
2078
+ }), $;
2079
+ }), l = V(() => {
2080
+ if (u.value !== "element" || !n.value) return [];
2081
+ const p = t.node[n.value];
2082
+ return Array.isArray(p) ? p : [];
2083
+ }), h = V(() => l.value.some((p) => p.__cdata)), f = V(() => {
2084
+ if (!h.value) return "";
2085
+ const p = l.value.find(($) => $.__cdata);
2086
+ if (p && Array.isArray(p.__cdata)) {
2087
+ const $ = p.__cdata;
2088
+ if ($.length > 0 && $[0]["#text"])
2089
+ return $[0]["#text"];
2196
2090
  }
2091
+ return "";
2092
+ }), b = V(() => {
2093
+ if (u.value !== "element" || !n.value || h.value) return "";
2094
+ const p = t.node[n.value];
2095
+ if (!Array.isArray(p)) return "";
2096
+ const $ = p.find((E) => E["#text"]);
2097
+ return $ ? $["#text"] : "";
2098
+ }), m = V(() => {
2099
+ if (u.value !== "comment") return "";
2100
+ const p = t.node["#comment"];
2101
+ return Array.isArray(p) && p.length > 0 && p[0]["#text"] || "";
2102
+ }), w = V(() => l.value.some((p) => Object.keys(p).some((E) => !E.startsWith("#") && !E.startsWith(":")))), S = V(() => u.value === "element" && !w.value && b.value.trim() !== ""), _ = () => {
2103
+ w.value && s("toggle-expand", o.value);
2104
+ }, j = (p, $) => `${o.value}-child-${$}`, H = () => `${o.value}.${n.value}`;
2105
+ return (p, $) => {
2106
+ const E = Ue("XmlNode", !0);
2107
+ return x(), k("div", {
2108
+ class: "xml-node",
2109
+ style: P({ paddingLeft: p.level > 0 ? "16px" : "0" })
2110
+ }, [
2111
+ u.value === "comment" ? (x(), k("div", zt, [
2112
+ v("span", {
2113
+ style: P({ color: p.theme.colors.xmlComment })
2114
+ }, " <!-- " + R(m.value) + " --> ", 5)
2115
+ ])) : u.value === "cdata" ? (x(), k("div", Dt, [
2116
+ v("span", {
2117
+ style: P({ color: p.theme.colors.xmlCdata })
2118
+ }, " <![CDATA[" + R(p.node.__cdata) + "]]> ", 5)
2119
+ ])) : u.value === "element" ? (x(), k("div", Jt, [
2120
+ h.value ? (x(), k("div", er, [
2121
+ v("span", {
2122
+ class: "xml-node__bracket",
2123
+ style: P({ color: p.theme.colors.xmlBracket })
2124
+ }, "<", 4),
2125
+ v("span", {
2126
+ class: "xml-node__tag",
2127
+ style: P({ color: p.theme.colors.xmlTag })
2128
+ }, R(n.value), 5),
2129
+ (x(!0), k(de, null, fe(a.value, (O, I) => (x(), k("span", {
2130
+ key: I,
2131
+ class: "xml-node__attribute"
2132
+ }, [
2133
+ v("span", {
2134
+ class: "xml-node__attr-name",
2135
+ style: P({ color: p.theme.colors.xmlAttribute })
2136
+ }, R(I), 5),
2137
+ v("span", {
2138
+ class: "xml-node__equals",
2139
+ style: P({ color: p.theme.colors.xmlEquals })
2140
+ }, "=", 4),
2141
+ v("span", {
2142
+ class: "xml-node__quote",
2143
+ style: P({ color: p.theme.colors.xmlQuote })
2144
+ }, '"', 4),
2145
+ v("span", {
2146
+ class: "xml-node__attr-value",
2147
+ style: P({ color: p.theme.colors.xmlAttributeValue })
2148
+ }, R(O), 5),
2149
+ v("span", {
2150
+ class: "xml-node__quote",
2151
+ style: P({ color: p.theme.colors.xmlQuote })
2152
+ }, '"', 4)
2153
+ ]))), 128)),
2154
+ v("span", {
2155
+ class: "xml-node__bracket",
2156
+ style: P({ color: p.theme.colors.xmlBracket })
2157
+ }, ">", 4),
2158
+ v("span", {
2159
+ class: "xml-node__cdata",
2160
+ style: P({ color: p.theme.colors.xmlCdata })
2161
+ }, "<![CDATA[" + R(f.value) + "]]>", 5),
2162
+ v("span", {
2163
+ class: "xml-node__bracket",
2164
+ style: P({ color: p.theme.colors.xmlBracket })
2165
+ }, "</", 4),
2166
+ v("span", {
2167
+ class: "xml-node__tag",
2168
+ style: P({ color: p.theme.colors.xmlTag })
2169
+ }, R(n.value), 5),
2170
+ v("span", {
2171
+ class: "xml-node__bracket",
2172
+ style: P({ color: p.theme.colors.xmlBracket })
2173
+ }, ">", 4)
2174
+ ])) : S.value ? (x(), k("div", tr, [
2175
+ v("span", {
2176
+ class: "xml-node__bracket",
2177
+ style: P({ color: p.theme.colors.xmlBracket })
2178
+ }, "<", 4),
2179
+ v("span", {
2180
+ class: "xml-node__tag",
2181
+ style: P({ color: p.theme.colors.xmlTag })
2182
+ }, R(n.value), 5),
2183
+ (x(!0), k(de, null, fe(a.value, (O, I) => (x(), k("span", {
2184
+ key: I,
2185
+ class: "xml-node__attribute"
2186
+ }, [
2187
+ v("span", {
2188
+ class: "xml-node__attr-name",
2189
+ style: P({ color: p.theme.colors.xmlAttribute })
2190
+ }, R(I), 5),
2191
+ v("span", {
2192
+ class: "xml-node__equals",
2193
+ style: P({ color: p.theme.colors.xmlEquals })
2194
+ }, "=", 4),
2195
+ v("span", {
2196
+ class: "xml-node__quote",
2197
+ style: P({ color: p.theme.colors.xmlQuote })
2198
+ }, '"', 4),
2199
+ v("span", {
2200
+ class: "xml-node__attr-value",
2201
+ style: P({ color: p.theme.colors.xmlAttributeValue })
2202
+ }, R(O), 5),
2203
+ v("span", {
2204
+ class: "xml-node__quote",
2205
+ style: P({ color: p.theme.colors.xmlQuote })
2206
+ }, '"', 4)
2207
+ ]))), 128)),
2208
+ v("span", {
2209
+ class: "xml-node__bracket",
2210
+ style: P({ color: p.theme.colors.xmlBracket })
2211
+ }, ">", 4),
2212
+ v("span", {
2213
+ class: "xml-node__text-content",
2214
+ style: P({ color: p.theme.colors.xmlText })
2215
+ }, R(b.value), 5),
2216
+ v("span", {
2217
+ class: "xml-node__bracket",
2218
+ style: P({ color: p.theme.colors.xmlBracket })
2219
+ }, "</", 4),
2220
+ v("span", {
2221
+ class: "xml-node__tag",
2222
+ style: P({ color: p.theme.colors.xmlTag })
2223
+ }, R(n.value), 5),
2224
+ v("span", {
2225
+ class: "xml-node__bracket",
2226
+ style: P({ color: p.theme.colors.xmlBracket })
2227
+ }, ">", 4)
2228
+ ])) : (x(), k("div", rr, [
2229
+ v("div", nr, [
2230
+ w.value ? (x(), k("span", {
2231
+ key: 0,
2232
+ class: "xml-node__clickable-part",
2233
+ onClick: $[0] || ($[0] = (O) => _()),
2234
+ title: i.value ? "Click to collapse" : "Click to expand"
2235
+ }, [
2236
+ v("span", {
2237
+ class: "xml-node__bracket",
2238
+ style: P({ color: p.theme.colors.xmlBracket })
2239
+ }, "<", 4),
2240
+ v("span", {
2241
+ class: "xml-node__tag",
2242
+ style: P({ color: p.theme.colors.xmlTag })
2243
+ }, R(n.value), 5)
2244
+ ], 8, sr)) : (x(), k("span", or, [
2245
+ v("span", {
2246
+ class: "xml-node__bracket",
2247
+ style: P({ color: p.theme.colors.xmlBracket })
2248
+ }, "<", 4),
2249
+ v("span", {
2250
+ class: "xml-node__tag",
2251
+ style: P({ color: p.theme.colors.xmlTag })
2252
+ }, R(n.value), 5)
2253
+ ])),
2254
+ (x(!0), k(de, null, fe(a.value, (O, I) => (x(), k("span", {
2255
+ key: I,
2256
+ class: "xml-node__attribute"
2257
+ }, [
2258
+ v("span", {
2259
+ class: "xml-node__attr-name",
2260
+ style: P({ color: p.theme.colors.xmlAttribute })
2261
+ }, R(I), 5),
2262
+ v("span", {
2263
+ class: "xml-node__equals",
2264
+ style: P({ color: p.theme.colors.xmlEquals })
2265
+ }, "=", 4),
2266
+ v("span", {
2267
+ class: "xml-node__quote",
2268
+ style: P({ color: p.theme.colors.xmlQuote })
2269
+ }, '"', 4),
2270
+ v("span", {
2271
+ class: "xml-node__attr-value",
2272
+ style: P({ color: p.theme.colors.xmlAttributeValue })
2273
+ }, R(O), 5),
2274
+ v("span", {
2275
+ class: "xml-node__quote",
2276
+ style: P({ color: p.theme.colors.xmlQuote })
2277
+ }, '"', 4)
2278
+ ]))), 128)),
2279
+ w.value ? (x(), k("span", {
2280
+ key: 2,
2281
+ class: "xml-node__clickable-part",
2282
+ onClick: $[1] || ($[1] = (O) => _()),
2283
+ title: i.value ? "Click to collapse" : "Click to expand"
2284
+ }, [
2285
+ v("span", {
2286
+ class: "xml-node__bracket",
2287
+ style: P({ color: p.theme.colors.xmlBracket })
2288
+ }, ">", 4)
2289
+ ], 8, ir)) : (x(), k("span", {
2290
+ key: 3,
2291
+ class: "xml-node__bracket",
2292
+ style: P({ color: p.theme.colors.xmlBracket })
2293
+ }, R(w.value ? ">" : "/>"), 5)),
2294
+ !i.value && w.value ? (x(), k("span", {
2295
+ key: 4,
2296
+ class: "xml-node__collapsed xml-node__collapsed--clickable",
2297
+ style: P({ color: p.theme.colors.textSecondary }),
2298
+ onClick: $[2] || ($[2] = (O) => _()),
2299
+ title: "Click to expand"
2300
+ }, "...", 4)) : F("", !0)
2301
+ ]),
2302
+ i.value && w.value ? (x(), k("div", ar, [
2303
+ l.value.length === 0 && b.value.trim() ? (x(), k("div", lr, [
2304
+ v("span", {
2305
+ class: "xml-node__text-content",
2306
+ style: P({ color: p.theme.colors.xmlText })
2307
+ }, R(b.value), 5)
2308
+ ])) : F("", !0),
2309
+ (x(!0), k(de, null, fe(l.value, (O, I) => (x(), He(E, {
2310
+ key: j(O, I),
2311
+ node: O,
2312
+ index: I,
2313
+ level: p.level + 1,
2314
+ "parent-path": H(),
2315
+ expanded: p.expanded,
2316
+ theme: p.theme,
2317
+ onToggleExpand: $[3] || ($[3] = (X) => p.$emit("toggle-expand", X)),
2318
+ onCopy: $[4] || ($[4] = (X) => p.$emit("copy", X))
2319
+ }, null, 8, ["node", "index", "level", "parent-path", "expanded", "theme"]))), 128))
2320
+ ])) : F("", !0),
2321
+ i.value && w.value ? (x(), k("div", ur, [
2322
+ v("span", {
2323
+ class: "xml-node__clickable-part",
2324
+ onClick: $[5] || ($[5] = (O) => _()),
2325
+ title: "Click to collapse"
2326
+ }, [
2327
+ v("span", {
2328
+ class: "xml-node__bracket",
2329
+ style: P({ color: p.theme.colors.xmlBracket })
2330
+ }, "</", 4),
2331
+ v("span", {
2332
+ class: "xml-node__tag",
2333
+ style: P({ color: p.theme.colors.xmlTag })
2334
+ }, R(n.value), 5),
2335
+ v("span", {
2336
+ class: "xml-node__bracket",
2337
+ style: P({ color: p.theme.colors.xmlBracket })
2338
+ }, ">", 4)
2339
+ ])
2340
+ ])) : F("", !0)
2341
+ ]))
2342
+ ])) : F("", !0)
2343
+ ], 4);
2344
+ };
2197
2345
  }
2198
- return e;
2199
- }
2200
- const tr = '"', rr = "'";
2201
- function nr(r, e) {
2202
- let t = "", s = "", n = !1;
2203
- for (; e < r.length; e++) {
2204
- if (r[e] === tr || r[e] === rr)
2205
- s === "" ? s = r[e] : s !== r[e] || (s = "");
2206
- else if (r[e] === ">" && s === "") {
2207
- n = !0;
2208
- break;
2209
- }
2210
- t += r[e];
2211
- }
2212
- return s !== "" ? !1 : {
2213
- value: t,
2214
- index: e,
2346
+ }), dr = /* @__PURE__ */ be(cr, [["__scopeId", "data-v-9c0c90fa"]]), fr = {
2347
+ name: "github-light",
2348
+ colors: {
2349
+ // 背景色
2350
+ background: "#ffffff",
2351
+ surfaceBackground: "#f6f8fa",
2352
+ // 边框色
2353
+ border: "#d0d7de",
2354
+ // 文本色
2355
+ text: "#24292f",
2356
+ textSecondary: "#57606a",
2357
+ // 按钮样式
2358
+ buttonBackground: "#f6f8fa",
2359
+ buttonBackgroundHover: "#f3f4f6",
2360
+ buttonBorder: "#d0d7de",
2361
+ buttonText: "#24292f",
2362
+ buttonPrimary: "#1f883d",
2363
+ buttonPrimaryHover: "#1a7f37",
2364
+ // 状态指示
2365
+ success: "#1f883d",
2366
+ successBackground: "#dafbe1",
2367
+ error: "#cf222e",
2368
+ errorBackground: "#ffebe9",
2369
+ // XML 语法高亮
2370
+ xmlTag: "#116329",
2371
+ // 标签名 - 绿色
2372
+ xmlAttribute: "#0550ae",
2373
+ // 属性名 - 蓝色
2374
+ xmlAttributeValue: "#0a3069",
2375
+ // 属性值 - 深蓝
2376
+ xmlText: "#24292f",
2377
+ // 文本内容 - 黑色
2378
+ xmlComment: "#6e7781",
2379
+ // 注释 - 灰色
2380
+ xmlCdata: "#8250df",
2381
+ // CDATA - 紫色
2382
+ xmlDeclaration: "#953800",
2383
+ // 声明 - 橙色
2384
+ xmlBracket: "#6e7781",
2385
+ // 括号 - 灰色
2386
+ xmlEquals: "#6e7781",
2387
+ // 等号 - 灰色
2388
+ xmlQuote: "#0550ae"
2389
+ // 引号 - 蓝色
2390
+ }
2391
+ }, hr = {
2392
+ name: "github-dark",
2393
+ colors: {
2394
+ // 背景色
2395
+ background: "#0d1117",
2396
+ surfaceBackground: "#161b22",
2397
+ // 边框色
2398
+ border: "#30363d",
2399
+ // 文本色
2400
+ text: "#c9d1d9",
2401
+ textSecondary: "#8b949e",
2402
+ // 按钮样式
2403
+ buttonBackground: "#21262d",
2404
+ buttonBackgroundHover: "#30363d",
2405
+ buttonBorder: "#30363d",
2406
+ buttonText: "#c9d1d9",
2407
+ buttonPrimary: "#238636",
2408
+ buttonPrimaryHover: "#2ea043",
2409
+ // 状态指示
2410
+ success: "#3fb950",
2411
+ successBackground: "#0f2e1c",
2412
+ error: "#f85149",
2413
+ errorBackground: "#3d1319",
2414
+ // XML 语法高亮
2415
+ xmlTag: "#7ee787",
2416
+ // 标签名 - 亮绿色
2417
+ xmlAttribute: "#79c0ff",
2418
+ // 属性名 - 亮蓝色
2419
+ xmlAttributeValue: "#a5d6ff",
2420
+ // 属性值 - 淡蓝色
2421
+ xmlText: "#c9d1d9",
2422
+ // 文本内容 - 白色
2423
+ xmlComment: "#8b949e",
2424
+ // 注释 - 灰色
2425
+ xmlCdata: "#d2a8ff",
2426
+ // CDATA - 紫色
2427
+ xmlDeclaration: "#ffa657",
2428
+ // 声明 - 橙色
2429
+ xmlBracket: "#8b949e",
2430
+ // 括号 - 灰色
2431
+ xmlEquals: "#8b949e",
2432
+ // 等号 - 灰色
2433
+ xmlQuote: "#79c0ff"
2434
+ // 引号 - 亮蓝色
2435
+ }
2436
+ }, pr = {
2437
+ name: "min-light",
2438
+ colors: {
2439
+ // 背景色
2440
+ background: "#ffffff",
2441
+ surfaceBackground: "#fafafa",
2442
+ // 边框色
2443
+ border: "#e5e5e5",
2444
+ // 文本色
2445
+ text: "#171717",
2446
+ textSecondary: "#737373",
2447
+ // 按钮样式
2448
+ buttonBackground: "#fafafa",
2449
+ buttonBackgroundHover: "#f5f5f5",
2450
+ buttonBorder: "#e5e5e5",
2451
+ buttonText: "#171717",
2452
+ buttonPrimary: "#22c55e",
2453
+ buttonPrimaryHover: "#16a34a",
2454
+ // 状态指示
2455
+ success: "#22c55e",
2456
+ successBackground: "#dcfce7",
2457
+ error: "#ef4444",
2458
+ errorBackground: "#fee2e2",
2459
+ // XML 语法高亮
2460
+ xmlTag: "#16a34a",
2461
+ // 标签名 - 绿色
2462
+ xmlAttribute: "#2563eb",
2463
+ // 属性名 - 蓝色
2464
+ xmlAttributeValue: "#1e40af",
2465
+ // 属性值 - 深蓝
2466
+ xmlText: "#171717",
2467
+ // 文本内容 - 黑色
2468
+ xmlComment: "#737373",
2469
+ // 注释 - 灰色
2470
+ xmlCdata: "#9333ea",
2471
+ // CDATA - 紫色
2472
+ xmlDeclaration: "#ea580c",
2473
+ // 声明 - 橙色
2474
+ xmlBracket: "#737373",
2475
+ // 括号 - 灰色
2476
+ xmlEquals: "#737373",
2477
+ // 等号 - 灰色
2478
+ xmlQuote: "#2563eb"
2479
+ // 引号 - 蓝色
2480
+ }
2481
+ }, gr = {
2482
+ name: "slack-ochin",
2483
+ colors: {
2484
+ // 背景色
2485
+ background: "#fef5ed",
2486
+ surfaceBackground: "#fef9f3",
2487
+ // 边框色
2488
+ border: "#e9dcc9",
2489
+ // 文本色
2490
+ text: "#3d3c40",
2491
+ textSecondary: "#616061",
2492
+ // 按钮样式
2493
+ buttonBackground: "#fef9f3",
2494
+ buttonBackgroundHover: "#f9f0e5",
2495
+ buttonBorder: "#e9dcc9",
2496
+ buttonText: "#3d3c40",
2497
+ buttonPrimary: "#007a5a",
2498
+ buttonPrimaryHover: "#006644",
2499
+ // 状态指示
2500
+ success: "#007a5a",
2501
+ successBackground: "#d1f4e0",
2502
+ error: "#e01e5a",
2503
+ errorBackground: "#ffdbea",
2504
+ // XML 语法高亮
2505
+ xmlTag: "#007a5a",
2506
+ // 标签名 - 绿色
2507
+ xmlAttribute: "#1264a3",
2508
+ // 属性名 - 蓝色
2509
+ xmlAttributeValue: "#0b4c8c",
2510
+ // 属性值 - 深蓝
2511
+ xmlText: "#3d3c40",
2512
+ // 文本内容 - 黑色
2513
+ xmlComment: "#616061",
2514
+ // 注释 - 灰色
2515
+ xmlCdata: "#8b2eff",
2516
+ // CDATA - 紫色
2517
+ xmlDeclaration: "#e8912d",
2518
+ // 声明 - 橙色
2519
+ xmlBracket: "#616061",
2520
+ // 括号 - 灰色
2521
+ xmlEquals: "#616061",
2522
+ // 等号 - 灰色
2523
+ xmlQuote: "#1264a3"
2524
+ // 引号 - 蓝色
2525
+ }
2526
+ }, Be = {
2527
+ "github-light": fr,
2528
+ "github-dark": hr,
2529
+ "min-light": pr,
2530
+ "slack-ochin": gr
2531
+ }, mr = (r) => Be[r] || Be["github-light"], qe = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", yr = qe + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", br = "[" + qe + "][" + yr + "]*", vr = new RegExp("^" + br + "$");
2532
+ function Ye(r, e) {
2533
+ const t = [];
2534
+ let s = e.exec(r);
2535
+ for (; s; ) {
2536
+ const n = [];
2537
+ n.startIndex = e.lastIndex - s[0].length;
2538
+ const o = s.length;
2539
+ for (let i = 0; i < o; i++)
2540
+ n.push(s[i]);
2541
+ t.push(n), s = e.exec(r);
2542
+ }
2543
+ return t;
2544
+ }
2545
+ const ve = function(r) {
2546
+ const e = vr.exec(r);
2547
+ return !(e === null || typeof e > "u");
2548
+ };
2549
+ function Er(r) {
2550
+ return typeof r < "u";
2551
+ }
2552
+ const _r = {
2553
+ allowBooleanAttributes: !1,
2554
+ //A tag can have attributes without any value
2555
+ unpairedTags: []
2556
+ };
2557
+ function Qe(r, e) {
2558
+ e = Object.assign({}, _r, e);
2559
+ const t = [];
2560
+ let s = !1, n = !1;
2561
+ r[0] === "\uFEFF" && (r = r.substr(1));
2562
+ for (let o = 0; o < r.length; o++)
2563
+ if (r[o] === "<" && r[o + 1] === "?") {
2564
+ if (o += 2, o = Le(r, o), o.err) return o;
2565
+ } else if (r[o] === "<") {
2566
+ let i = o;
2567
+ if (o++, r[o] === "!") {
2568
+ o = Re(r, o);
2569
+ continue;
2570
+ } else {
2571
+ let u = !1;
2572
+ r[o] === "/" && (u = !0, o++);
2573
+ let a = "";
2574
+ for (; o < r.length && r[o] !== ">" && r[o] !== " " && r[o] !== " " && r[o] !== `
2575
+ ` && r[o] !== "\r"; o++)
2576
+ a += r[o];
2577
+ if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), o--), !Tr(a)) {
2578
+ let f;
2579
+ return a.trim().length === 0 ? f = "Invalid space after '<'." : f = "Tag '" + a + "' is an invalid name.", U("InvalidTag", f, W(r, o));
2580
+ }
2581
+ const l = kr(r, o);
2582
+ if (l === !1)
2583
+ return U("InvalidAttr", "Attributes for '" + a + "' have open quote.", W(r, o));
2584
+ let h = l.value;
2585
+ if (o = l.index, h[h.length - 1] === "/") {
2586
+ const f = o - h.length;
2587
+ h = h.substring(0, h.length - 1);
2588
+ const b = je(h, e);
2589
+ if (b === !0)
2590
+ s = !0;
2591
+ else
2592
+ return U(b.err.code, b.err.msg, W(r, f + b.err.line));
2593
+ } else if (u)
2594
+ if (l.tagClosed) {
2595
+ if (h.trim().length > 0)
2596
+ return U("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", W(r, i));
2597
+ if (t.length === 0)
2598
+ return U("InvalidTag", "Closing tag '" + a + "' has not been opened.", W(r, i));
2599
+ {
2600
+ const f = t.pop();
2601
+ if (a !== f.tagName) {
2602
+ let b = W(r, f.tagStartPos);
2603
+ return U(
2604
+ "InvalidTag",
2605
+ "Expected closing tag '" + f.tagName + "' (opened in line " + b.line + ", col " + b.col + ") instead of closing tag '" + a + "'.",
2606
+ W(r, i)
2607
+ );
2608
+ }
2609
+ t.length == 0 && (n = !0);
2610
+ }
2611
+ } else return U("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", W(r, o));
2612
+ else {
2613
+ const f = je(h, e);
2614
+ if (f !== !0)
2615
+ return U(f.err.code, f.err.msg, W(r, o - h.length + f.err.line));
2616
+ if (n === !0)
2617
+ return U("InvalidXml", "Multiple possible root nodes found.", W(r, o));
2618
+ e.unpairedTags.indexOf(a) !== -1 || t.push({ tagName: a, tagStartPos: i }), s = !0;
2619
+ }
2620
+ for (o++; o < r.length; o++)
2621
+ if (r[o] === "<")
2622
+ if (r[o + 1] === "!") {
2623
+ o++, o = Re(r, o);
2624
+ continue;
2625
+ } else if (r[o + 1] === "?") {
2626
+ if (o = Le(r, ++o), o.err) return o;
2627
+ } else
2628
+ break;
2629
+ else if (r[o] === "&") {
2630
+ const f = Cr(r, o);
2631
+ if (f == -1)
2632
+ return U("InvalidChar", "char '&' is not expected.", W(r, o));
2633
+ o = f;
2634
+ } else if (n === !0 && !Ve(r[o]))
2635
+ return U("InvalidXml", "Extra text at the end", W(r, o));
2636
+ r[o] === "<" && o--;
2637
+ }
2638
+ } else {
2639
+ if (Ve(r[o]))
2640
+ continue;
2641
+ return U("InvalidChar", "char '" + r[o] + "' is not expected.", W(r, o));
2642
+ }
2643
+ if (s) {
2644
+ if (t.length == 1)
2645
+ return U("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", W(r, t[0].tagStartPos));
2646
+ if (t.length > 0)
2647
+ return U("InvalidXml", "Invalid '" + JSON.stringify(t.map((o) => o.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
2648
+ } else return U("InvalidXml", "Start tag expected.", 1);
2649
+ return !0;
2650
+ }
2651
+ function Ve(r) {
2652
+ return r === " " || r === " " || r === `
2653
+ ` || r === "\r";
2654
+ }
2655
+ function Le(r, e) {
2656
+ const t = e;
2657
+ for (; e < r.length; e++)
2658
+ if (r[e] == "?" || r[e] == " ") {
2659
+ const s = r.substr(t, e - t);
2660
+ if (e > 5 && s === "xml")
2661
+ return U("InvalidXml", "XML declaration allowed only at the start of the document.", W(r, e));
2662
+ if (r[e] == "?" && r[e + 1] == ">") {
2663
+ e++;
2664
+ break;
2665
+ } else
2666
+ continue;
2667
+ }
2668
+ return e;
2669
+ }
2670
+ function Re(r, e) {
2671
+ if (r.length > e + 5 && r[e + 1] === "-" && r[e + 2] === "-") {
2672
+ for (e += 3; e < r.length; e++)
2673
+ if (r[e] === "-" && r[e + 1] === "-" && r[e + 2] === ">") {
2674
+ e += 2;
2675
+ break;
2676
+ }
2677
+ } else if (r.length > e + 8 && r[e + 1] === "D" && r[e + 2] === "O" && r[e + 3] === "C" && r[e + 4] === "T" && r[e + 5] === "Y" && r[e + 6] === "P" && r[e + 7] === "E") {
2678
+ let t = 1;
2679
+ for (e += 8; e < r.length; e++)
2680
+ if (r[e] === "<")
2681
+ t++;
2682
+ else if (r[e] === ">" && (t--, t === 0))
2683
+ break;
2684
+ } else if (r.length > e + 9 && r[e + 1] === "[" && r[e + 2] === "C" && r[e + 3] === "D" && r[e + 4] === "A" && r[e + 5] === "T" && r[e + 6] === "A" && r[e + 7] === "[") {
2685
+ for (e += 8; e < r.length; e++)
2686
+ if (r[e] === "]" && r[e + 1] === "]" && r[e + 2] === ">") {
2687
+ e += 2;
2688
+ break;
2689
+ }
2690
+ }
2691
+ return e;
2692
+ }
2693
+ const xr = '"', Nr = "'";
2694
+ function kr(r, e) {
2695
+ let t = "", s = "", n = !1;
2696
+ for (; e < r.length; e++) {
2697
+ if (r[e] === xr || r[e] === Nr)
2698
+ s === "" ? s = r[e] : s !== r[e] || (s = "");
2699
+ else if (r[e] === ">" && s === "") {
2700
+ n = !0;
2701
+ break;
2702
+ }
2703
+ t += r[e];
2704
+ }
2705
+ return s !== "" ? !1 : {
2706
+ value: t,
2707
+ index: e,
2215
2708
  tagClosed: n
2216
2709
  };
2217
2710
  }
2218
- const sr = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2219
- function Ve(r, e) {
2220
- const t = Ye(r, sr), s = {};
2711
+ const Ar = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2712
+ function je(r, e) {
2713
+ const t = Ye(r, Ar), s = {};
2221
2714
  for (let n = 0; n < t.length; n++) {
2222
2715
  if (t[n][1].length === 0)
2223
- return F("InvalidAttr", "Attribute '" + t[n][2] + "' has no space in starting.", de(t[n]));
2716
+ return U("InvalidAttr", "Attribute '" + t[n][2] + "' has no space in starting.", pe(t[n]));
2224
2717
  if (t[n][3] !== void 0 && t[n][4] === void 0)
2225
- return F("InvalidAttr", "Attribute '" + t[n][2] + "' is without value.", de(t[n]));
2718
+ return U("InvalidAttr", "Attribute '" + t[n][2] + "' is without value.", pe(t[n]));
2226
2719
  if (t[n][3] === void 0 && !e.allowBooleanAttributes)
2227
- return F("InvalidAttr", "boolean attribute '" + t[n][2] + "' is not allowed.", de(t[n]));
2720
+ return U("InvalidAttr", "boolean attribute '" + t[n][2] + "' is not allowed.", pe(t[n]));
2228
2721
  const o = t[n][2];
2229
- if (!ar(o))
2230
- return F("InvalidAttr", "Attribute '" + o + "' is an invalid name.", de(t[n]));
2722
+ if (!Or(o))
2723
+ return U("InvalidAttr", "Attribute '" + o + "' is an invalid name.", pe(t[n]));
2231
2724
  if (!s.hasOwnProperty(o))
2232
2725
  s[o] = 1;
2233
2726
  else
2234
- return F("InvalidAttr", "Attribute '" + o + "' is repeated.", de(t[n]));
2727
+ return U("InvalidAttr", "Attribute '" + o + "' is repeated.", pe(t[n]));
2235
2728
  }
2236
2729
  return !0;
2237
2730
  }
2238
- function or(r, e) {
2731
+ function wr(r, e) {
2239
2732
  let t = /\d/;
2240
2733
  for (r[e] === "x" && (e++, t = /[\da-fA-F]/); e < r.length; e++) {
2241
2734
  if (r[e] === ";")
@@ -2245,11 +2738,11 @@ function or(r, e) {
2245
2738
  }
2246
2739
  return -1;
2247
2740
  }
2248
- function ir(r, e) {
2741
+ function Cr(r, e) {
2249
2742
  if (e++, r[e] === ";")
2250
2743
  return -1;
2251
2744
  if (r[e] === "#")
2252
- return e++, or(r, e);
2745
+ return e++, wr(r, e);
2253
2746
  let t = 0;
2254
2747
  for (; e < r.length; e++, t++)
2255
2748
  if (!(r[e].match(/\w/) && t < 20)) {
@@ -2259,7 +2752,7 @@ function ir(r, e) {
2259
2752
  }
2260
2753
  return e;
2261
2754
  }
2262
- function F(r, e, t) {
2755
+ function U(r, e, t) {
2263
2756
  return {
2264
2757
  err: {
2265
2758
  code: r,
@@ -2269,13 +2762,13 @@ function F(r, e, t) {
2269
2762
  }
2270
2763
  };
2271
2764
  }
2272
- function ar(r) {
2273
- return ye(r);
2765
+ function Or(r) {
2766
+ return ve(r);
2274
2767
  }
2275
- function lr(r) {
2276
- return ye(r);
2768
+ function Tr(r) {
2769
+ return ve(r);
2277
2770
  }
2278
- function q(r, e) {
2771
+ function W(r, e) {
2279
2772
  const t = r.substring(0, e).split(/\r?\n/);
2280
2773
  return {
2281
2774
  line: t.length,
@@ -2283,10 +2776,10 @@ function q(r, e) {
2283
2776
  col: t[t.length - 1].length + 1
2284
2777
  };
2285
2778
  }
2286
- function de(r) {
2779
+ function pe(r) {
2287
2780
  return r.startIndex + r[1].length;
2288
2781
  }
2289
- const ur = {
2782
+ const Pr = {
2290
2783
  preserveOrder: !1,
2291
2784
  attributeNamePrefix: "@_",
2292
2785
  attributesGroupName: !1,
@@ -2330,12 +2823,12 @@ const ur = {
2330
2823
  },
2331
2824
  // skipEmptyListItem: false
2332
2825
  captureMetaData: !1
2333
- }, cr = function(r) {
2334
- return Object.assign({}, ur, r);
2826
+ }, $r = function(r) {
2827
+ return Object.assign({}, Pr, r);
2335
2828
  };
2336
- let ge;
2337
- typeof Symbol != "function" ? ge = "@@xmlMetadata" : ge = Symbol("XML Node Metadata");
2338
- let se = class {
2829
+ let me;
2830
+ typeof Symbol != "function" ? me = "@@xmlMetadata" : me = Symbol("XML Node Metadata");
2831
+ class oe {
2339
2832
  constructor(e) {
2340
2833
  this.tagname = e, this.child = [], this[":@"] = {};
2341
2834
  }
@@ -2343,14 +2836,14 @@ let se = class {
2343
2836
  e === "__proto__" && (e = "#__proto__"), this.child.push({ [e]: t });
2344
2837
  }
2345
2838
  addChild(e, t) {
2346
- e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({ [e.tagname]: e.child, ":@": e[":@"] }) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][ge] = { startIndex: t });
2839
+ e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({ [e.tagname]: e.child, ":@": e[":@"] }) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][me] = { startIndex: t });
2347
2840
  }
2348
2841
  /** symbol used for metadata */
2349
2842
  static getMetaDataSymbol() {
2350
- return ge;
2843
+ return me;
2351
2844
  }
2352
- };
2353
- class dr {
2845
+ }
2846
+ class Sr {
2354
2847
  constructor(e) {
2355
2848
  this.suppressValidationErr = !e;
2356
2849
  }
@@ -2361,24 +2854,24 @@ class dr {
2361
2854
  let n = 1, o = !1, i = !1, u = "";
2362
2855
  for (; t < e.length; t++)
2363
2856
  if (e[t] === "<" && !i) {
2364
- if (o && ne(e, "!ENTITY", t)) {
2857
+ if (o && se(e, "!ENTITY", t)) {
2365
2858
  t += 7;
2366
2859
  let a, l;
2367
2860
  [a, l, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr), l.indexOf("&") === -1 && (s[a] = {
2368
2861
  regx: RegExp(`&${a};`, "g"),
2369
2862
  val: l
2370
2863
  });
2371
- } else if (o && ne(e, "!ELEMENT", t)) {
2864
+ } else if (o && se(e, "!ELEMENT", t)) {
2372
2865
  t += 8;
2373
2866
  const { index: a } = this.readElementExp(e, t + 1);
2374
2867
  t = a;
2375
- } else if (o && ne(e, "!ATTLIST", t))
2868
+ } else if (o && se(e, "!ATTLIST", t))
2376
2869
  t += 8;
2377
- else if (o && ne(e, "!NOTATION", t)) {
2870
+ else if (o && se(e, "!NOTATION", t)) {
2378
2871
  t += 9;
2379
2872
  const { index: a } = this.readNotationExp(e, t + 1, this.suppressValidationErr);
2380
2873
  t = a;
2381
- } else if (ne(e, "!--", t)) i = !0;
2874
+ } else if (se(e, "!--", t)) i = !0;
2382
2875
  else throw new Error("Invalid DOCTYPE");
2383
2876
  n++, u = "";
2384
2877
  } else if (e[t] === ">") {
@@ -2392,11 +2885,11 @@ class dr {
2392
2885
  return { entities: s, i: t };
2393
2886
  }
2394
2887
  readEntityExp(e, t) {
2395
- t = Q(e, t);
2888
+ t = G(e, t);
2396
2889
  let s = "";
2397
2890
  for (; t < e.length && !/\s/.test(e[t]) && e[t] !== '"' && e[t] !== "'"; )
2398
2891
  s += e[t], t++;
2399
- if (fe(s), t = Q(e, t), !this.suppressValidationErr) {
2892
+ if (ge(s), t = G(e, t), !this.suppressValidationErr) {
2400
2893
  if (e.substring(t, t + 6).toUpperCase() === "SYSTEM")
2401
2894
  throw new Error("External entities are not supported");
2402
2895
  if (e[t] === "%")
@@ -2406,18 +2899,18 @@ class dr {
2406
2899
  return [t, n] = this.readIdentifierVal(e, t, "entity"), t--, [s, n, t];
2407
2900
  }
2408
2901
  readNotationExp(e, t) {
2409
- t = Q(e, t);
2902
+ t = G(e, t);
2410
2903
  let s = "";
2411
2904
  for (; t < e.length && !/\s/.test(e[t]); )
2412
2905
  s += e[t], t++;
2413
- !this.suppressValidationErr && fe(s), t = Q(e, t);
2906
+ !this.suppressValidationErr && ge(s), t = G(e, t);
2414
2907
  const n = e.substring(t, t + 6).toUpperCase();
2415
2908
  if (!this.suppressValidationErr && n !== "SYSTEM" && n !== "PUBLIC")
2416
2909
  throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);
2417
- t += n.length, t = Q(e, t);
2910
+ t += n.length, t = G(e, t);
2418
2911
  let o = null, i = null;
2419
2912
  if (n === "PUBLIC")
2420
- [t, o] = this.readIdentifierVal(e, t, "publicIdentifier"), t = Q(e, t), (e[t] === '"' || e[t] === "'") && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"));
2913
+ [t, o] = this.readIdentifierVal(e, t, "publicIdentifier"), t = G(e, t), (e[t] === '"' || e[t] === "'") && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"));
2421
2914
  else if (n === "SYSTEM" && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"), !this.suppressValidationErr && !i))
2422
2915
  throw new Error("Missing mandatory system identifier for SYSTEM notation");
2423
2916
  return { notationName: s, publicIdentifier: o, systemIdentifier: i, index: --t };
@@ -2434,16 +2927,16 @@ class dr {
2434
2927
  return t++, [t, n];
2435
2928
  }
2436
2929
  readElementExp(e, t) {
2437
- t = Q(e, t);
2930
+ t = G(e, t);
2438
2931
  let s = "";
2439
2932
  for (; t < e.length && !/\s/.test(e[t]); )
2440
2933
  s += e[t], t++;
2441
- if (!this.suppressValidationErr && !ye(s))
2934
+ if (!this.suppressValidationErr && !ve(s))
2442
2935
  throw new Error(`Invalid element name: "${s}"`);
2443
- t = Q(e, t);
2936
+ t = G(e, t);
2444
2937
  let n = "";
2445
- if (e[t] === "E" && ne(e, "MPTY", t)) t += 4;
2446
- else if (e[t] === "A" && ne(e, "NY", t)) t += 2;
2938
+ if (e[t] === "E" && se(e, "MPTY", t)) t += 4;
2939
+ else if (e[t] === "A" && se(e, "NY", t)) t += 2;
2447
2940
  else if (e[t] === "(") {
2448
2941
  for (t++; t < e.length && e[t] !== ")"; )
2449
2942
  n += e[t], t++;
@@ -2458,20 +2951,20 @@ class dr {
2458
2951
  };
2459
2952
  }
2460
2953
  readAttlistExp(e, t) {
2461
- t = Q(e, t);
2954
+ t = G(e, t);
2462
2955
  let s = "";
2463
2956
  for (; t < e.length && !/\s/.test(e[t]); )
2464
2957
  s += e[t], t++;
2465
- fe(s), t = Q(e, t);
2958
+ ge(s), t = G(e, t);
2466
2959
  let n = "";
2467
2960
  for (; t < e.length && !/\s/.test(e[t]); )
2468
2961
  n += e[t], t++;
2469
- if (!fe(n))
2962
+ if (!ge(n))
2470
2963
  throw new Error(`Invalid attribute name: "${n}"`);
2471
- t = Q(e, t);
2964
+ t = G(e, t);
2472
2965
  let o = "";
2473
2966
  if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
2474
- if (o = "NOTATION", t += 8, t = Q(e, t), e[t] !== "(")
2967
+ if (o = "NOTATION", t += 8, t = G(e, t), e[t] !== "(")
2475
2968
  throw new Error(`Expected '(', found "${e[t]}"`);
2476
2969
  t++;
2477
2970
  let u = [];
@@ -2479,9 +2972,9 @@ class dr {
2479
2972
  let a = "";
2480
2973
  for (; t < e.length && e[t] !== "|" && e[t] !== ")"; )
2481
2974
  a += e[t], t++;
2482
- if (a = a.trim(), !fe(a))
2975
+ if (a = a.trim(), !ge(a))
2483
2976
  throw new Error(`Invalid notation name: "${a}"`);
2484
- u.push(a), e[t] === "|" && (t++, t = Q(e, t));
2977
+ u.push(a), e[t] === "|" && (t++, t = G(e, t));
2485
2978
  }
2486
2979
  if (e[t] !== ")")
2487
2980
  throw new Error("Unterminated list of notations");
@@ -2493,7 +2986,7 @@ class dr {
2493
2986
  if (!this.suppressValidationErr && !u.includes(o.toUpperCase()))
2494
2987
  throw new Error(`Invalid attribute type: "${o}"`);
2495
2988
  }
2496
- t = Q(e, t);
2989
+ t = G(e, t);
2497
2990
  let i = "";
2498
2991
  return e.substring(t, t + 8).toUpperCase() === "#REQUIRED" ? (i = "#REQUIRED", t += 8) : e.substring(t, t + 7).toUpperCase() === "#IMPLIED" ? (i = "#IMPLIED", t += 7) : [t, i] = this.readIdentifierVal(e, t, "ATTLIST"), {
2499
2992
  elementName: s,
@@ -2504,22 +2997,22 @@ class dr {
2504
2997
  };
2505
2998
  }
2506
2999
  }
2507
- const Q = (r, e) => {
3000
+ const G = (r, e) => {
2508
3001
  for (; e < r.length && /\s/.test(r[e]); )
2509
3002
  e++;
2510
3003
  return e;
2511
3004
  };
2512
- function ne(r, e, t) {
3005
+ function se(r, e, t) {
2513
3006
  for (let s = 0; s < e.length; s++)
2514
3007
  if (e[s] !== r[t + s + 1]) return !1;
2515
3008
  return !0;
2516
3009
  }
2517
- function fe(r) {
2518
- if (ye(r))
3010
+ function ge(r) {
3011
+ if (ve(r))
2519
3012
  return r;
2520
3013
  throw new Error(`Invalid entity name ${r}`);
2521
3014
  }
2522
- const fr = /^[-+]?0x[a-fA-F0-9]+$/, hr = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, pr = {
3015
+ const Ir = /^[-+]?0x[a-fA-F0-9]+$/, Br = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Vr = {
2523
3016
  hex: !0,
2524
3017
  // oct: false,
2525
3018
  leadingZeros: !0,
@@ -2527,20 +3020,20 @@ const fr = /^[-+]?0x[a-fA-F0-9]+$/, hr = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, p
2527
3020
  eNotation: !0
2528
3021
  //skipLike: /regex/
2529
3022
  };
2530
- function gr(r, e = {}) {
2531
- if (e = Object.assign({}, pr, e), !r || typeof r != "string") return r;
3023
+ function Lr(r, e = {}) {
3024
+ if (e = Object.assign({}, Vr, e), !r || typeof r != "string") return r;
2532
3025
  let t = r.trim();
2533
3026
  if (e.skipLike !== void 0 && e.skipLike.test(t)) return r;
2534
3027
  if (r === "0") return 0;
2535
- if (e.hex && fr.test(t))
2536
- return Er(t, 16);
3028
+ if (e.hex && Ir.test(t))
3029
+ return Ur(t, 16);
2537
3030
  if (t.search(/.+[eE].+/) !== -1)
2538
- return mr(r, t, e);
3031
+ return jr(r, t, e);
2539
3032
  {
2540
- const s = hr.exec(t);
3033
+ const s = Br.exec(t);
2541
3034
  if (s) {
2542
3035
  const n = s[1] || "", o = s[2];
2543
- let i = yr(s[3]);
3036
+ let i = Mr(s[3]);
2544
3037
  const u = n ? (
2545
3038
  // 0., -00., 000.
2546
3039
  r[o.length + 1] === "."
@@ -2561,10 +3054,10 @@ function gr(r, e = {}) {
2561
3054
  return r;
2562
3055
  }
2563
3056
  }
2564
- const br = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
2565
- function mr(r, e, t) {
3057
+ const Rr = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
3058
+ function jr(r, e, t) {
2566
3059
  if (!t.eNotation) return r;
2567
- const s = e.match(br);
3060
+ const s = e.match(Rr);
2568
3061
  if (s) {
2569
3062
  let n = s[1] || "";
2570
3063
  const o = s[3].indexOf("e") === -1 ? "E" : "e", i = s[2], u = n ? (
@@ -2575,23 +3068,23 @@ function mr(r, e, t) {
2575
3068
  } else
2576
3069
  return r;
2577
3070
  }
2578
- function yr(r) {
3071
+ function Mr(r) {
2579
3072
  return r && r.indexOf(".") !== -1 && (r = r.replace(/0+$/, ""), r === "." ? r = "0" : r[0] === "." ? r = "0" + r : r[r.length - 1] === "." && (r = r.substring(0, r.length - 1))), r;
2580
3073
  }
2581
- function Er(r, e) {
3074
+ function Ur(r, e) {
2582
3075
  if (parseInt) return parseInt(r, e);
2583
3076
  if (Number.parseInt) return Number.parseInt(r, e);
2584
3077
  if (window && window.parseInt) return window.parseInt(r, e);
2585
3078
  throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
2586
3079
  }
2587
- function Qe(r) {
3080
+ function We(r) {
2588
3081
  return typeof r == "function" ? r : Array.isArray(r) ? (e) => {
2589
3082
  for (const t of r)
2590
3083
  if (typeof t == "string" && e === t || t instanceof RegExp && t.test(e))
2591
3084
  return !0;
2592
3085
  } : () => !1;
2593
3086
  }
2594
- class vr {
3087
+ class Fr {
2595
3088
  constructor(e) {
2596
3089
  this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
2597
3090
  apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
@@ -2614,10 +3107,10 @@ class vr {
2614
3107
  inr: { regex: /&(inr|#8377);/g, val: "₹" },
2615
3108
  num_dec: { regex: /&#([0-9]{1,7});/g, val: (t, s) => String.fromCodePoint(Number.parseInt(s, 10)) },
2616
3109
  num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t, s) => String.fromCodePoint(Number.parseInt(s, 16)) }
2617
- }, this.addExternalEntities = _r, this.parseXml = Ar, this.parseTextData = xr, this.resolveNameSpace = Nr, this.buildAttributesMap = wr, this.isItStopNode = Pr, this.replaceEntitiesValue = Or, this.readStopNodeData = Ir, this.saveTextToParentTag = Tr, this.addChild = Cr, this.ignoreAttributesFn = Qe(this.options.ignoreAttributes);
3110
+ }, this.addExternalEntities = Xr, this.parseXml = Qr, this.parseTextData = Hr, this.resolveNameSpace = Kr, this.buildAttributesMap = Yr, this.isItStopNode = zr, this.replaceEntitiesValue = Gr, this.readStopNodeData = Jr, this.saveTextToParentTag = Zr, this.addChild = Wr, this.ignoreAttributesFn = We(this.options.ignoreAttributes);
2618
3111
  }
2619
3112
  }
2620
- function _r(r) {
3113
+ function Xr(r) {
2621
3114
  const e = Object.keys(r);
2622
3115
  for (let t = 0; t < e.length; t++) {
2623
3116
  const s = e[t];
@@ -2627,14 +3120,14 @@ function _r(r) {
2627
3120
  };
2628
3121
  }
2629
3122
  }
2630
- function xr(r, e, t, s, n, o, i) {
3123
+ function Hr(r, e, t, s, n, o, i) {
2631
3124
  if (r !== void 0 && (this.options.trimValues && !s && (r = r.trim()), r.length > 0)) {
2632
3125
  i || (r = this.replaceEntitiesValue(r));
2633
3126
  const u = this.options.tagValueProcessor(e, r, t, n, o);
2634
- return u == null ? r : typeof u != typeof r || u !== r ? u : this.options.trimValues ? Ae(r, this.options.parseTagValue, this.options.numberParseOptions) : r.trim() === r ? Ae(r, this.options.parseTagValue, this.options.numberParseOptions) : r;
3127
+ return u == null ? r : typeof u != typeof r || u !== r ? u : this.options.trimValues ? Ce(r, this.options.parseTagValue, this.options.numberParseOptions) : r.trim() === r ? Ce(r, this.options.parseTagValue, this.options.numberParseOptions) : r;
2635
3128
  }
2636
3129
  }
2637
- function Nr(r) {
3130
+ function Kr(r) {
2638
3131
  if (this.options.removeNSPrefix) {
2639
3132
  const e = r.split(":"), t = r.charAt(0) === "/" ? "/" : "";
2640
3133
  if (e[0] === "xmlns")
@@ -2643,10 +3136,10 @@ function Nr(r) {
2643
3136
  }
2644
3137
  return r;
2645
3138
  }
2646
- const kr = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
2647
- function wr(r, e, t) {
3139
+ const qr = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
3140
+ function Yr(r, e, t) {
2648
3141
  if (this.options.ignoreAttributes !== !0 && typeof r == "string") {
2649
- const s = Ye(r, kr), n = s.length, o = {};
3142
+ const s = Ye(r, qr), n = s.length, o = {};
2650
3143
  for (let i = 0; i < n; i++) {
2651
3144
  const u = this.resolveNameSpace(s[i][1]);
2652
3145
  if (this.ignoreAttributesFn(u, e))
@@ -2656,7 +3149,7 @@ function wr(r, e, t) {
2656
3149
  if (this.options.transformAttributeName && (l = this.options.transformAttributeName(l)), l === "__proto__" && (l = "#__proto__"), a !== void 0) {
2657
3150
  this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
2658
3151
  const h = this.options.attributeValueProcessor(u, a, e);
2659
- h == null ? o[l] = a : typeof h != typeof a || h !== a ? o[l] = h : o[l] = Ae(
3152
+ h == null ? o[l] = a : typeof h != typeof a || h !== a ? o[l] = h : o[l] = Ce(
2660
3153
  a,
2661
3154
  this.options.parseAttributeValue,
2662
3155
  this.options.numberParseOptions
@@ -2672,20 +3165,20 @@ function wr(r, e, t) {
2672
3165
  return o;
2673
3166
  }
2674
3167
  }
2675
- const Ar = function(r) {
3168
+ const Qr = function(r) {
2676
3169
  r = r.replace(/\r\n?/g, `
2677
3170
  `);
2678
- const e = new se("!xml");
3171
+ const e = new oe("!xml");
2679
3172
  let t = e, s = "", n = "";
2680
- const o = new dr(this.options.processEntities);
3173
+ const o = new Sr(this.options.processEntities);
2681
3174
  for (let i = 0; i < r.length; i++)
2682
3175
  if (r[i] === "<")
2683
3176
  if (r[i + 1] === "/") {
2684
- const a = oe(r, ">", i, "Closing Tag is not closed.");
3177
+ const a = ie(r, ">", i, "Closing Tag is not closed.");
2685
3178
  let l = r.substring(i + 2, a).trim();
2686
3179
  if (this.options.removeNSPrefix) {
2687
- const y = l.indexOf(":");
2688
- y !== -1 && (l = l.substr(y + 1));
3180
+ const b = l.indexOf(":");
3181
+ b !== -1 && (l = l.substr(b + 1));
2689
3182
  }
2690
3183
  this.options.transformTagName && (l = this.options.transformTagName(l)), t && (s = this.saveTextToParentTag(s, t, n));
2691
3184
  const h = n.substring(n.lastIndexOf(".") + 1);
@@ -2697,12 +3190,12 @@ const Ar = function(r) {
2697
3190
  let a = we(r, i, !1, "?>");
2698
3191
  if (!a) throw new Error("Pi Tag is not closed.");
2699
3192
  if (s = this.saveTextToParentTag(s, t, n), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
2700
- const l = new se(a.tagName);
3193
+ const l = new oe(a.tagName);
2701
3194
  l.add(this.options.textNodeName, ""), a.tagName !== a.tagExp && a.attrExpPresent && (l[":@"] = this.buildAttributesMap(a.tagExp, n, a.tagName)), this.addChild(t, l, n, i);
2702
3195
  }
2703
3196
  i = a.closeIndex + 1;
2704
3197
  } else if (r.substr(i + 1, 3) === "!--") {
2705
- const a = oe(r, "-->", i + 4, "Comment is not closed.");
3198
+ const a = ie(r, "-->", i + 4, "Comment is not closed.");
2706
3199
  if (this.options.commentPropName) {
2707
3200
  const l = r.substring(i + 4, a - 2);
2708
3201
  s = this.saveTextToParentTag(s, t, n), t.add(this.options.commentPropName, [{ [this.options.textNodeName]: l }]);
@@ -2712,39 +3205,39 @@ const Ar = function(r) {
2712
3205
  const a = o.readDocType(r, i);
2713
3206
  this.docTypeEntities = a.entities, i = a.i;
2714
3207
  } else if (r.substr(i + 1, 2) === "![") {
2715
- const a = oe(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
3208
+ const a = ie(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
2716
3209
  s = this.saveTextToParentTag(s, t, n);
2717
3210
  let h = this.parseTextData(l, t.tagname, n, !0, !1, !0, !0);
2718
3211
  h == null && (h = ""), this.options.cdataPropName ? t.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : t.add(this.options.textNodeName, h), i = a + 2;
2719
3212
  } else {
2720
3213
  let a = we(r, i, this.options.removeNSPrefix), l = a.tagName;
2721
3214
  const h = a.rawTagName;
2722
- let f = a.tagExp, y = a.attrExpPresent, m = a.closeIndex;
3215
+ let f = a.tagExp, b = a.attrExpPresent, m = a.closeIndex;
2723
3216
  this.options.transformTagName && (l = this.options.transformTagName(l)), t && s && t.tagname !== "!xml" && (s = this.saveTextToParentTag(s, t, n, !1));
2724
- const C = t;
2725
- C && this.options.unpairedTags.indexOf(C.tagname) !== -1 && (t = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), l !== e.tagname && (n += n ? "." + l : l);
2726
- const O = i;
3217
+ const w = t;
3218
+ w && this.options.unpairedTags.indexOf(w.tagname) !== -1 && (t = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), l !== e.tagname && (n += n ? "." + l : l);
3219
+ const S = i;
2727
3220
  if (this.isItStopNode(this.options.stopNodes, n, l)) {
2728
- let P = "";
3221
+ let _ = "";
2729
3222
  if (f.length > 0 && f.lastIndexOf("/") === f.length - 1)
2730
3223
  l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), n = n.substr(0, n.length - 1), f = l) : f = f.substr(0, f.length - 1), i = a.closeIndex;
2731
3224
  else if (this.options.unpairedTags.indexOf(l) !== -1)
2732
3225
  i = a.closeIndex;
2733
3226
  else {
2734
- const k = this.readStopNodeData(r, h, m + 1);
2735
- if (!k) throw new Error(`Unexpected end of ${h}`);
2736
- i = k.i, P = k.tagContent;
3227
+ const H = this.readStopNodeData(r, h, m + 1);
3228
+ if (!H) throw new Error(`Unexpected end of ${h}`);
3229
+ i = H.i, _ = H.tagContent;
2737
3230
  }
2738
- const M = new se(l);
2739
- l !== f && y && (M[":@"] = this.buildAttributesMap(f, n, l)), P && (P = this.parseTextData(P, l, n, !0, y, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), M.add(this.options.textNodeName, P), this.addChild(t, M, n, O);
3231
+ const j = new oe(l);
3232
+ l !== f && b && (j[":@"] = this.buildAttributesMap(f, n, l)), _ && (_ = this.parseTextData(_, l, n, !0, b, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), j.add(this.options.textNodeName, _), this.addChild(t, j, n, S);
2740
3233
  } else {
2741
3234
  if (f.length > 0 && f.lastIndexOf("/") === f.length - 1) {
2742
3235
  l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), n = n.substr(0, n.length - 1), f = l) : f = f.substr(0, f.length - 1), this.options.transformTagName && (l = this.options.transformTagName(l));
2743
- const P = new se(l);
2744
- l !== f && y && (P[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, P, n, O), n = n.substr(0, n.lastIndexOf("."));
3236
+ const _ = new oe(l);
3237
+ l !== f && b && (_[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, _, n, S), n = n.substr(0, n.lastIndexOf("."));
2745
3238
  } else {
2746
- const P = new se(l);
2747
- this.tagsNodeStack.push(t), l !== f && y && (P[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, P, n, O), t = P;
3239
+ const _ = new oe(l);
3240
+ this.tagsNodeStack.push(t), l !== f && b && (_[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, _, n, S), t = _;
2748
3241
  }
2749
3242
  s = "", i = m;
2750
3243
  }
@@ -2753,12 +3246,12 @@ const Ar = function(r) {
2753
3246
  s += r[i];
2754
3247
  return e.child;
2755
3248
  };
2756
- function Cr(r, e, t, s) {
3249
+ function Wr(r, e, t, s) {
2757
3250
  this.options.captureMetaData || (s = void 0);
2758
3251
  const n = this.options.updateTag(e.tagname, t, e[":@"]);
2759
3252
  n === !1 || (typeof n == "string" && (e.tagname = n), r.addChild(e, s));
2760
3253
  }
2761
- const Or = function(r) {
3254
+ const Gr = function(r) {
2762
3255
  if (this.options.processEntities) {
2763
3256
  for (let e in this.docTypeEntities) {
2764
3257
  const t = this.docTypeEntities[e];
@@ -2777,7 +3270,7 @@ const Or = function(r) {
2777
3270
  }
2778
3271
  return r;
2779
3272
  };
2780
- function Tr(r, e, t, s) {
3273
+ function Zr(r, e, t, s) {
2781
3274
  return r && (s === void 0 && (s = e.child.length === 0), r = this.parseTextData(
2782
3275
  r,
2783
3276
  e.tagname,
@@ -2787,7 +3280,7 @@ function Tr(r, e, t, s) {
2787
3280
  s
2788
3281
  ), r !== void 0 && r !== "" && e.add(this.options.textNodeName, r), r = ""), r;
2789
3282
  }
2790
- function Pr(r, e, t) {
3283
+ function zr(r, e, t) {
2791
3284
  const s = "*." + t;
2792
3285
  for (const n in r) {
2793
3286
  const o = r[n];
@@ -2795,7 +3288,7 @@ function Pr(r, e, t) {
2795
3288
  }
2796
3289
  return !1;
2797
3290
  }
2798
- function Sr(r, e, t = ">") {
3291
+ function Dr(r, e, t = ">") {
2799
3292
  let s, n = "";
2800
3293
  for (let o = e; o < r.length; o++) {
2801
3294
  let i = r[o];
@@ -2819,14 +3312,14 @@ function Sr(r, e, t = ">") {
2819
3312
  n += i;
2820
3313
  }
2821
3314
  }
2822
- function oe(r, e, t, s) {
3315
+ function ie(r, e, t, s) {
2823
3316
  const n = r.indexOf(e, t);
2824
3317
  if (n === -1)
2825
3318
  throw new Error(s);
2826
3319
  return n + e.length - 1;
2827
3320
  }
2828
3321
  function we(r, e, t, s = ">") {
2829
- const n = Sr(r, e + 1, s);
3322
+ const n = Dr(r, e + 1, s);
2830
3323
  if (!n) return;
2831
3324
  let o = n.data;
2832
3325
  const i = n.index, u = o.search(/\s/);
@@ -2845,13 +3338,13 @@ function we(r, e, t, s = ">") {
2845
3338
  rawTagName: h
2846
3339
  };
2847
3340
  }
2848
- function Ir(r, e, t) {
3341
+ function Jr(r, e, t) {
2849
3342
  const s = t;
2850
3343
  let n = 1;
2851
3344
  for (; t < r.length; t++)
2852
3345
  if (r[t] === "<")
2853
3346
  if (r[t + 1] === "/") {
2854
- const o = oe(r, ">", t, `${e} is not closed`);
3347
+ const o = ie(r, ">", t, `${e} is not closed`);
2855
3348
  if (r.substring(t + 2, o).trim() === e && (n--, n === 0))
2856
3349
  return {
2857
3350
  tagContent: r.substring(s, t),
@@ -2859,32 +3352,32 @@ function Ir(r, e, t) {
2859
3352
  };
2860
3353
  t = o;
2861
3354
  } else if (r[t + 1] === "?")
2862
- t = oe(r, "?>", t + 1, "StopNode is not closed.");
3355
+ t = ie(r, "?>", t + 1, "StopNode is not closed.");
2863
3356
  else if (r.substr(t + 1, 3) === "!--")
2864
- t = oe(r, "-->", t + 3, "StopNode is not closed.");
3357
+ t = ie(r, "-->", t + 3, "StopNode is not closed.");
2865
3358
  else if (r.substr(t + 1, 2) === "![")
2866
- t = oe(r, "]]>", t, "StopNode is not closed.") - 2;
3359
+ t = ie(r, "]]>", t, "StopNode is not closed.") - 2;
2867
3360
  else {
2868
3361
  const o = we(r, t, ">");
2869
3362
  o && ((o && o.tagName) === e && o.tagExp[o.tagExp.length - 1] !== "/" && n++, t = o.closeIndex);
2870
3363
  }
2871
3364
  }
2872
- function Ae(r, e, t) {
3365
+ function Ce(r, e, t) {
2873
3366
  if (e && typeof r == "string") {
2874
3367
  const s = r.trim();
2875
- return s === "true" ? !0 : s === "false" ? !1 : gr(r, t);
3368
+ return s === "true" ? !0 : s === "false" ? !1 : Lr(r, t);
2876
3369
  } else
2877
- return Jt(r) ? r : "";
3370
+ return Er(r) ? r : "";
2878
3371
  }
2879
- const Ne = se.getMetaDataSymbol();
2880
- function $r(r, e) {
3372
+ const ke = oe.getMetaDataSymbol();
3373
+ function en(r, e) {
2881
3374
  return Ge(r, e);
2882
3375
  }
2883
3376
  function Ge(r, e, t) {
2884
3377
  let s;
2885
3378
  const n = {};
2886
3379
  for (let o = 0; o < r.length; o++) {
2887
- const i = r[o], u = Br(i);
3380
+ const i = r[o], u = tn(i);
2888
3381
  let a = "";
2889
3382
  if (t === void 0 ? a = u : a = t + "." + u, u === e.textNodeName)
2890
3383
  s === void 0 ? s = i[u] : s += "" + i[u];
@@ -2893,21 +3386,21 @@ function Ge(r, e, t) {
2893
3386
  continue;
2894
3387
  if (i[u]) {
2895
3388
  let l = Ge(i[u], e, a);
2896
- const h = Vr(l, e);
2897
- i[Ne] !== void 0 && (l[Ne] = i[Ne]), i[":@"] ? Lr(l, i[":@"], a, e) : Object.keys(l).length === 1 && l[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? l = l[e.textNodeName] : Object.keys(l).length === 0 && (e.alwaysCreateTextNode ? l[e.textNodeName] = "" : l = ""), n[u] !== void 0 && n.hasOwnProperty(u) ? (Array.isArray(n[u]) || (n[u] = [n[u]]), n[u].push(l)) : e.isArray(u, a, h) ? n[u] = [l] : n[u] = l;
3389
+ const h = nn(l, e);
3390
+ i[ke] !== void 0 && (l[ke] = i[ke]), i[":@"] ? rn(l, i[":@"], a, e) : Object.keys(l).length === 1 && l[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? l = l[e.textNodeName] : Object.keys(l).length === 0 && (e.alwaysCreateTextNode ? l[e.textNodeName] = "" : l = ""), n[u] !== void 0 && n.hasOwnProperty(u) ? (Array.isArray(n[u]) || (n[u] = [n[u]]), n[u].push(l)) : e.isArray(u, a, h) ? n[u] = [l] : n[u] = l;
2898
3391
  }
2899
3392
  }
2900
3393
  }
2901
3394
  return typeof s == "string" ? s.length > 0 && (n[e.textNodeName] = s) : s !== void 0 && (n[e.textNodeName] = s), n;
2902
3395
  }
2903
- function Br(r) {
3396
+ function tn(r) {
2904
3397
  const e = Object.keys(r);
2905
3398
  for (let t = 0; t < e.length; t++) {
2906
3399
  const s = e[t];
2907
3400
  if (s !== ":@") return s;
2908
3401
  }
2909
3402
  }
2910
- function Lr(r, e, t, s) {
3403
+ function rn(r, e, t, s) {
2911
3404
  if (e) {
2912
3405
  const n = Object.keys(e), o = n.length;
2913
3406
  for (let i = 0; i < o; i++) {
@@ -2916,13 +3409,13 @@ function Lr(r, e, t, s) {
2916
3409
  }
2917
3410
  }
2918
3411
  }
2919
- function Vr(r, e) {
3412
+ function nn(r, e) {
2920
3413
  const { textNodeName: t } = e, s = Object.keys(r).length;
2921
3414
  return !!(s === 0 || s === 1 && (r[t] || typeof r[t] == "boolean" || r[t] === 0));
2922
3415
  }
2923
- class Rr {
3416
+ class sn {
2924
3417
  constructor(e) {
2925
- this.externalEntities = {}, this.options = cr(e);
3418
+ this.externalEntities = {}, this.options = $r(e);
2926
3419
  }
2927
3420
  /**
2928
3421
  * Parse XML dats to JS object
@@ -2936,14 +3429,14 @@ class Rr {
2936
3429
  throw new Error("XML data is accepted in String or Bytes[] form.");
2937
3430
  if (t) {
2938
3431
  t === !0 && (t = {});
2939
- const o = qe(e, t);
3432
+ const o = Qe(e, t);
2940
3433
  if (o !== !0)
2941
3434
  throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`);
2942
3435
  }
2943
- const s = new vr(this.options);
3436
+ const s = new Fr(this.options);
2944
3437
  s.addExternalEntities(this.externalEntities);
2945
3438
  const n = s.parseXml(e);
2946
- return this.options.preserveOrder || n === void 0 ? n : $r(n, this.options);
3439
+ return this.options.preserveOrder || n === void 0 ? n : en(n, this.options);
2947
3440
  }
2948
3441
  /**
2949
3442
  * Add Entity which is not by default supported by this library
@@ -2970,24 +3463,24 @@ class Rr {
2970
3463
  * is true in the options.
2971
3464
  */
2972
3465
  static getMetaDataSymbol() {
2973
- return se.getMetaDataSymbol();
3466
+ return oe.getMetaDataSymbol();
2974
3467
  }
2975
3468
  }
2976
- const jr = `
3469
+ const on = `
2977
3470
  `;
2978
- function Mr(r, e) {
3471
+ function an(r, e) {
2979
3472
  let t = "";
2980
- return e.format && e.indentBy.length > 0 && (t = jr), We(r, e, "", t);
3473
+ return e.format && e.indentBy.length > 0 && (t = on), Ze(r, e, "", t);
2981
3474
  }
2982
- function We(r, e, t, s) {
3475
+ function Ze(r, e, t, s) {
2983
3476
  let n = "", o = !1;
2984
3477
  for (let i = 0; i < r.length; i++) {
2985
- const u = r[i], a = Ur(u);
3478
+ const u = r[i], a = ln(u);
2986
3479
  if (a === void 0) continue;
2987
3480
  let l = "";
2988
3481
  if (t.length === 0 ? l = a : l = `${t}.${a}`, a === e.textNodeName) {
2989
- let C = u[a];
2990
- Fr(l, e) || (C = e.tagValueProcessor(a, C), C = Ze(C, e)), o && (n += s), n += C, o = !1;
3482
+ let w = u[a];
3483
+ un(l, e) || (w = e.tagValueProcessor(a, w), w = ze(w, e)), o && (n += s), n += w, o = !1;
2991
3484
  continue;
2992
3485
  } else if (a === e.cdataPropName) {
2993
3486
  o && (n += s), n += `<![CDATA[${u[a][0][e.textNodeName]}]]>`, o = !1;
@@ -2996,19 +3489,19 @@ function We(r, e, t, s) {
2996
3489
  n += s + `<!--${u[a][0][e.textNodeName]}-->`, o = !0;
2997
3490
  continue;
2998
3491
  } else if (a[0] === "?") {
2999
- const C = Re(u[":@"], e), O = a === "?xml" ? "" : s;
3000
- let P = u[a][0][e.textNodeName];
3001
- P = P.length !== 0 ? " " + P : "", n += O + `<${a}${P}${C}?>`, o = !0;
3492
+ const w = Me(u[":@"], e), S = a === "?xml" ? "" : s;
3493
+ let _ = u[a][0][e.textNodeName];
3494
+ _ = _.length !== 0 ? " " + _ : "", n += S + `<${a}${_}${w}?>`, o = !0;
3002
3495
  continue;
3003
3496
  }
3004
3497
  let h = s;
3005
3498
  h !== "" && (h += e.indentBy);
3006
- const f = Re(u[":@"], e), y = s + `<${a}${f}`, m = We(u[a], e, l, h);
3007
- e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += y + ">" : n += y + "/>" : (!m || m.length === 0) && e.suppressEmptyNode ? n += y + "/>" : m && m.endsWith(">") ? n += y + `>${m}${s}</${a}>` : (n += y + ">", m && s !== "" && (m.includes("/>") || m.includes("</")) ? n += s + e.indentBy + m + s : n += m, n += `</${a}>`), o = !0;
3499
+ const f = Me(u[":@"], e), b = s + `<${a}${f}`, m = Ze(u[a], e, l, h);
3500
+ e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += b + ">" : n += b + "/>" : (!m || m.length === 0) && e.suppressEmptyNode ? n += b + "/>" : m && m.endsWith(">") ? n += b + `>${m}${s}</${a}>` : (n += b + ">", m && s !== "" && (m.includes("/>") || m.includes("</")) ? n += s + e.indentBy + m + s : n += m, n += `</${a}>`), o = !0;
3008
3501
  }
3009
3502
  return n;
3010
3503
  }
3011
- function Ur(r) {
3504
+ function ln(r) {
3012
3505
  const e = Object.keys(r);
3013
3506
  for (let t = 0; t < e.length; t++) {
3014
3507
  const s = e[t];
@@ -3016,24 +3509,24 @@ function Ur(r) {
3016
3509
  return s;
3017
3510
  }
3018
3511
  }
3019
- function Re(r, e) {
3512
+ function Me(r, e) {
3020
3513
  let t = "";
3021
3514
  if (r && !e.ignoreAttributes)
3022
3515
  for (let s in r) {
3023
3516
  if (!r.hasOwnProperty(s)) continue;
3024
3517
  let n = e.attributeValueProcessor(s, r[s]);
3025
- n = Ze(n, e), n === !0 && e.suppressBooleanAttributes ? t += ` ${s.substr(e.attributeNamePrefix.length)}` : t += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
3518
+ n = ze(n, e), n === !0 && e.suppressBooleanAttributes ? t += ` ${s.substr(e.attributeNamePrefix.length)}` : t += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
3026
3519
  }
3027
3520
  return t;
3028
3521
  }
3029
- function Fr(r, e) {
3522
+ function un(r, e) {
3030
3523
  r = r.substr(0, r.length - e.textNodeName.length - 1);
3031
3524
  let t = r.substr(r.lastIndexOf(".") + 1);
3032
3525
  for (let s in e.stopNodes)
3033
3526
  if (e.stopNodes[s] === r || e.stopNodes[s] === "*." + t) return !0;
3034
3527
  return !1;
3035
3528
  }
3036
- function Ze(r, e) {
3529
+ function ze(r, e) {
3037
3530
  if (r && r.length > 0 && e.processEntities)
3038
3531
  for (let t = 0; t < e.entities.length; t++) {
3039
3532
  const s = e.entities[t];
@@ -3041,7 +3534,7 @@ function Ze(r, e) {
3041
3534
  }
3042
3535
  return r;
3043
3536
  }
3044
- const Xr = {
3537
+ const cn = {
3045
3538
  attributeNamePrefix: "@_",
3046
3539
  attributesGroupName: !1,
3047
3540
  textNodeName: "#text",
@@ -3075,21 +3568,21 @@ const Xr = {
3075
3568
  // transformAttributeName: false,
3076
3569
  oneListGroup: !1
3077
3570
  };
3078
- function re(r) {
3079
- this.options = Object.assign({}, Xr, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3571
+ function ne(r) {
3572
+ this.options = Object.assign({}, cn, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3080
3573
  return !1;
3081
- } : (this.ignoreAttributesFn = Qe(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Yr), this.processTextOrObjNode = Hr, this.options.format ? (this.indentate = Kr, this.tagEndChar = `>
3574
+ } : (this.ignoreAttributesFn = We(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = hn), this.processTextOrObjNode = dn, this.options.format ? (this.indentate = fn, this.tagEndChar = `>
3082
3575
  `, this.newLine = `
3083
3576
  `) : (this.indentate = function() {
3084
3577
  return "";
3085
3578
  }, this.tagEndChar = ">", this.newLine = "");
3086
3579
  }
3087
- re.prototype.build = function(r) {
3088
- return this.options.preserveOrder ? Mr(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
3580
+ ne.prototype.build = function(r) {
3581
+ return this.options.preserveOrder ? an(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
3089
3582
  [this.options.arrayNodeName]: r
3090
3583
  }), this.j2x(r, 0, []).val);
3091
3584
  };
3092
- re.prototype.j2x = function(r, e, t) {
3585
+ ne.prototype.j2x = function(r, e, t) {
3093
3586
  let s = "", n = "";
3094
3587
  const o = t.join(".");
3095
3588
  for (let i in r)
@@ -3119,13 +3612,13 @@ re.prototype.j2x = function(r, e, t) {
3119
3612
  i[0] === "?" ? n += this.indentate(e) + "<" + i + "?" + this.tagEndChar : n += this.indentate(e) + "<" + i + "/" + this.tagEndChar;
3120
3613
  else if (typeof f == "object")
3121
3614
  if (this.options.oneListGroup) {
3122
- const y = this.j2x(f, e + 1, t.concat(i));
3123
- a += y.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (l += y.attrStr);
3615
+ const b = this.j2x(f, e + 1, t.concat(i));
3616
+ a += b.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (l += b.attrStr);
3124
3617
  } else
3125
3618
  a += this.processTextOrObjNode(f, i, e, t);
3126
3619
  else if (this.options.oneListGroup) {
3127
- let y = this.options.tagValueProcessor(i, f);
3128
- y = this.replaceEntitiesValue(y), a += y;
3620
+ let b = this.options.tagValueProcessor(i, f);
3621
+ b = this.replaceEntitiesValue(b), a += b;
3129
3622
  } else
3130
3623
  a += this.buildTextValNode(f, i, "", e);
3131
3624
  }
@@ -3138,14 +3631,14 @@ re.prototype.j2x = function(r, e, t) {
3138
3631
  n += this.processTextOrObjNode(r[i], i, e, t);
3139
3632
  return { attrStr: s, val: n };
3140
3633
  };
3141
- re.prototype.buildAttrPairStr = function(r, e) {
3634
+ ne.prototype.buildAttrPairStr = function(r, e) {
3142
3635
  return e = this.options.attributeValueProcessor(r, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + r : " " + r + '="' + e + '"';
3143
3636
  };
3144
- function Hr(r, e, t, s) {
3637
+ function dn(r, e, t, s) {
3145
3638
  const n = this.j2x(r, t + 1, s.concat(e));
3146
3639
  return r[this.options.textNodeName] !== void 0 && Object.keys(r).length === 1 ? this.buildTextValNode(r[this.options.textNodeName], e, n.attrStr, t) : this.buildObjectNode(n.val, e, n.attrStr, t);
3147
3640
  }
3148
- re.prototype.buildObjectNode = function(r, e, t, s) {
3641
+ ne.prototype.buildObjectNode = function(r, e, t, s) {
3149
3642
  if (r === "")
3150
3643
  return e[0] === "?" ? this.indentate(s) + "<" + e + t + "?" + this.tagEndChar : this.indentate(s) + "<" + e + t + this.closeTag(e) + this.tagEndChar;
3151
3644
  {
@@ -3153,11 +3646,11 @@ re.prototype.buildObjectNode = function(r, e, t, s) {
3153
3646
  return e[0] === "?" && (o = "?", n = ""), (t || t === "") && r.indexOf("<") === -1 ? this.indentate(s) + "<" + e + t + o + ">" + r + n : this.options.commentPropName !== !1 && e === this.options.commentPropName && o.length === 0 ? this.indentate(s) + `<!--${r}-->` + this.newLine : this.indentate(s) + "<" + e + t + o + this.tagEndChar + r + this.indentate(s) + n;
3154
3647
  }
3155
3648
  };
3156
- re.prototype.closeTag = function(r) {
3649
+ ne.prototype.closeTag = function(r) {
3157
3650
  let e = "";
3158
3651
  return this.options.unpairedTags.indexOf(r) !== -1 ? this.options.suppressUnpairedNode || (e = "/") : this.options.suppressEmptyNode ? e = "/" : e = `></${r}`, e;
3159
3652
  };
3160
- re.prototype.buildTextValNode = function(r, e, t, s) {
3653
+ ne.prototype.buildTextValNode = function(r, e, t, s) {
3161
3654
  if (this.options.cdataPropName !== !1 && e === this.options.cdataPropName)
3162
3655
  return this.indentate(s) + `<![CDATA[${r}]]>` + this.newLine;
3163
3656
  if (this.options.commentPropName !== !1 && e === this.options.commentPropName)
@@ -3169,7 +3662,7 @@ re.prototype.buildTextValNode = function(r, e, t, s) {
3169
3662
  return n = this.replaceEntitiesValue(n), n === "" ? this.indentate(s) + "<" + e + t + this.closeTag(e) + this.tagEndChar : this.indentate(s) + "<" + e + t + ">" + n + "</" + e + this.tagEndChar;
3170
3663
  }
3171
3664
  };
3172
- re.prototype.replaceEntitiesValue = function(r) {
3665
+ ne.prototype.replaceEntitiesValue = function(r) {
3173
3666
  if (r && r.length > 0 && this.options.processEntities)
3174
3667
  for (let e = 0; e < this.options.entities.length; e++) {
3175
3668
  const t = this.options.entities[e];
@@ -3177,15 +3670,15 @@ re.prototype.replaceEntitiesValue = function(r) {
3177
3670
  }
3178
3671
  return r;
3179
3672
  };
3180
- function Kr(r) {
3673
+ function fn(r) {
3181
3674
  return this.options.indentBy.repeat(r);
3182
3675
  }
3183
- function Yr(r) {
3676
+ function hn(r) {
3184
3677
  return r.startsWith(this.options.attributeNamePrefix) && r !== this.options.textNodeName ? r.substr(this.attrPrefixLen) : !1;
3185
3678
  }
3186
- const qr = {
3187
- validate: qe
3188
- }, Qr = {
3679
+ const pn = {
3680
+ validate: Qe
3681
+ }, gn = {
3189
3682
  ignoreAttributes: !1,
3190
3683
  // 保留属性
3191
3684
  attributeNamePrefix: "@_",
@@ -3198,540 +3691,140 @@ const qr = {
3198
3691
  // 注释属性名
3199
3692
  cdataPropName: "__cdata",
3200
3693
  // CDATA 属性名
3201
- preserveOrder: !1,
3202
- // 不保留顺序(使用对象结构)
3694
+ preserveOrder: !0,
3695
+ // 保留顺序(使用数组结构以保留注释位置)
3203
3696
  parseAttributeValue: !1,
3204
3697
  // 不解析属性值(保持字符串)
3205
3698
  trimValues: !0,
3206
- // 去除首尾空白
3207
- parseTagValue: !1,
3208
- // 不解析标签值(保持字符串)
3209
- processEntities: !0,
3210
- // 处理实体
3211
- htmlEntities: !1,
3212
- // 不是 HTML 实体
3213
- ignoreNameSpace: !1,
3214
- // 保留命名空间
3215
- allowBooleanAttributes: !0,
3216
- // 允许布尔属性
3217
- unpairedTags: [],
3218
- // 未配对的标签
3219
- stopNodes: [],
3220
- // 停止解析的节点
3221
- alwaysCreateTextNode: !1
3222
- // 仅在有文本时创建文本节点
3223
- }, Gr = {
3224
- ignoreAttributes: !1,
3225
- attributeNamePrefix: "@_",
3226
- textNodeName: "#text",
3227
- format: !0,
3228
- // 格式化输出
3229
- indentBy: " ",
3230
- // 缩进 2 空格
3231
- suppressEmptyNode: !1,
3232
- // 不抑制空节点
3233
- suppressBooleanAttributes: !1,
3234
- suppressUnpairedNode: !1
3235
- }, Wr = (r) => {
3236
- try {
3237
- const e = qr.validate(r, {
3238
- allowBooleanAttributes: !0
3239
- });
3240
- return e === !0 ? { valid: !0 } : {
3241
- valid: !1,
3242
- error: `Line ${e.err.line}: ${e.err.msg}`
3243
- };
3244
- } catch (e) {
3245
- return {
3246
- valid: !1,
3247
- error: e instanceof Error ? e.message : "Unknown validation error"
3248
- };
3249
- }
3250
- }, ze = (r, e) => {
3251
- try {
3252
- return new Rr({
3253
- ...Qr,
3254
- ...e
3255
- }).parse(r);
3256
- } catch (t) {
3257
- throw new Error(
3258
- `XML 解析失败: ${t instanceof Error ? t.message : "Unknown error"}`
3259
- );
3260
- }
3261
- }, Te = (r, e) => {
3262
- try {
3263
- let s = new re({
3264
- ...Gr,
3265
- format: e?.format ?? !0,
3266
- indentBy: e?.indentBy ?? " "
3267
- }).build(r);
3268
- return e?.showDeclaration !== !1 && !s.startsWith("<?xml") && (s = `<?xml version="1.0" encoding="UTF-8"?>
3269
- ` + s), s;
3270
- } catch (t) {
3271
- throw new Error(
3272
- `XML 构建失败: ${t instanceof Error ? t.message : "Unknown error"}`
3273
- );
3274
- }
3275
- }, Zr = (r) => Te(r, { format: !1, showDeclaration: !1 }), zr = (r, e) => {
3276
- const t = ze(r);
3277
- return Te(t, e);
3278
- }, Dr = (r) => {
3279
- if (!r || typeof r != "object") return {};
3280
- const e = {};
3281
- return Object.keys(r).forEach((t) => {
3282
- if (t.startsWith("@_")) {
3283
- const s = t.substring(2);
3284
- e[s] = r[t];
3285
- }
3286
- }), e;
3287
- }, Jr = (r) => !r || typeof r != "object" ? typeof r == "string" ? r : null : r["#text"] || null, en = {
3288
- key: 0,
3289
- class: "xml-node__element"
3290
- }, tn = {
3291
- key: 0,
3292
- class: "xml-node__line"
3293
- }, rn = { key: 1 }, nn = { class: "xml-node__line" }, sn = ["title"], on = { key: 1 }, an = ["title"], ln = {
3294
- key: 0,
3295
- class: "xml-node__children"
3296
- }, un = {
3297
- key: 0,
3298
- class: "xml-node__text"
3299
- }, cn = {
3300
- key: 1,
3301
- class: "xml-node__line"
3302
- }, dn = {
3303
- key: 1,
3304
- class: "xml-node__text"
3305
- }, fn = {
3306
- key: 2,
3307
- class: "xml-node__comment"
3308
- }, hn = {
3309
- key: 3,
3310
- class: "xml-node__cdata"
3311
- }, pn = /* @__PURE__ */ be({
3312
- __name: "XmlNode",
3313
- props: {
3314
- value: {},
3315
- tagName: {},
3316
- level: { default: 0 },
3317
- path: { default: "" },
3318
- expanded: {},
3319
- theme: {}
3320
- },
3321
- emits: ["toggle-expand", "copy"],
3322
- setup(r, { emit: e }) {
3323
- const t = r, s = e, n = L(() => t.path || t.tagName), o = L(() => t.expanded.has(n.value)), i = L(() => t.tagName && !t.tagName.startsWith("#") && t.tagName !== "__cdata" ? !0 : t.value !== null && typeof t.value == "object"), u = L(() => !t.tagName && typeof t.value == "string"), a = L(() => t.tagName === "#comment"), l = L(() => t.tagName === "__cdata"), h = L(() => i.value ? Dr(t.value) : {}), f = L(() => typeof t.value == "string" ? t.value : i.value ? Jr(t.value) || "" : t.value || ""), y = L(() => t.value || ""), m = L(() => t.value || ""), C = L(() => {
3324
- if (typeof t.value != "object" || t.value === null)
3325
- return [];
3326
- const g = [];
3327
- return Object.keys(t.value).forEach((T) => {
3328
- if (T.startsWith("@_") || T === "#text") return;
3329
- const U = t.value[T];
3330
- Array.isArray(U) ? U.forEach((V) => {
3331
- g.push({ tagName: T, value: V });
3332
- }) : g.push({ tagName: T, value: U });
3333
- }), g;
3334
- }), O = L(() => C.value.length > 0 ? !0 : f.value.trim() !== ""), P = L(() => i.value && C.value.length === 0 && f.value.trim() !== ""), M = () => {
3335
- O.value && s("toggle-expand", n.value);
3336
- }, k = (g, T) => {
3337
- let U = 0;
3338
- for (let V = 0; V < T; V++)
3339
- C.value[V].tagName === g && U++;
3340
- return `${n.value}.${g}[${U}]`;
3341
- }, S = (g, T) => `${g.tagName}-${T}`;
3342
- return (g, T) => {
3343
- const U = Me("XmlNode", !0);
3344
- return x(), N("div", {
3345
- class: "xml-node",
3346
- style: I({ paddingLeft: g.level > 0 ? "16px" : "0" })
3347
- }, [
3348
- i.value ? (x(), N("div", en, [
3349
- P.value ? (x(), N("div", tn, [
3350
- E("span", {
3351
- class: "xml-node__bracket",
3352
- style: I({ color: g.theme.colors.xmlBracket })
3353
- }, "<", 4),
3354
- E("span", {
3355
- class: "xml-node__tag",
3356
- style: I({ color: g.theme.colors.xmlTag })
3357
- }, j(g.tagName), 5),
3358
- (x(!0), N(he, null, pe(h.value, (V, Y) => (x(), N("span", {
3359
- key: Y,
3360
- class: "xml-node__attribute"
3361
- }, [
3362
- E("span", {
3363
- class: "xml-node__attr-name",
3364
- style: I({ color: g.theme.colors.xmlAttribute })
3365
- }, j(Y), 5),
3366
- E("span", {
3367
- class: "xml-node__equals",
3368
- style: I({ color: g.theme.colors.xmlEquals })
3369
- }, "=", 4),
3370
- E("span", {
3371
- class: "xml-node__quote",
3372
- style: I({ color: g.theme.colors.xmlQuote })
3373
- }, '"', 4),
3374
- E("span", {
3375
- class: "xml-node__attr-value",
3376
- style: I({ color: g.theme.colors.xmlAttributeValue })
3377
- }, j(V), 5),
3378
- E("span", {
3379
- class: "xml-node__quote",
3380
- style: I({ color: g.theme.colors.xmlQuote })
3381
- }, '"', 4)
3382
- ]))), 128)),
3383
- E("span", {
3384
- class: "xml-node__bracket",
3385
- style: I({ color: g.theme.colors.xmlBracket })
3386
- }, ">", 4),
3387
- E("span", {
3388
- class: "xml-node__text-content",
3389
- style: I({ color: g.theme.colors.xmlText })
3390
- }, j(f.value), 5),
3391
- E("span", {
3392
- class: "xml-node__bracket",
3393
- style: I({ color: g.theme.colors.xmlBracket })
3394
- }, "</", 4),
3395
- E("span", {
3396
- class: "xml-node__tag",
3397
- style: I({ color: g.theme.colors.xmlTag })
3398
- }, j(g.tagName), 5),
3399
- E("span", {
3400
- class: "xml-node__bracket",
3401
- style: I({ color: g.theme.colors.xmlBracket })
3402
- }, ">", 4)
3403
- ])) : (x(), N("div", rn, [
3404
- E("div", nn, [
3405
- O.value ? (x(), N("span", {
3406
- key: 0,
3407
- class: "xml-node__clickable-part",
3408
- onClick: T[0] || (T[0] = (V) => M()),
3409
- title: o.value ? "Click to collapse" : "Click to expand"
3410
- }, [
3411
- E("span", {
3412
- class: "xml-node__bracket",
3413
- style: I({ color: g.theme.colors.xmlBracket })
3414
- }, "<", 4),
3415
- E("span", {
3416
- class: "xml-node__tag",
3417
- style: I({ color: g.theme.colors.xmlTag })
3418
- }, j(g.tagName), 5)
3419
- ], 8, sn)) : (x(), N("span", on, [
3420
- E("span", {
3421
- class: "xml-node__bracket",
3422
- style: I({ color: g.theme.colors.xmlBracket })
3423
- }, "<", 4),
3424
- E("span", {
3425
- class: "xml-node__tag",
3426
- style: I({ color: g.theme.colors.xmlTag })
3427
- }, j(g.tagName), 5)
3428
- ])),
3429
- (x(!0), N(he, null, pe(h.value, (V, Y) => (x(), N("span", {
3430
- key: Y,
3431
- class: "xml-node__attribute"
3432
- }, [
3433
- E("span", {
3434
- class: "xml-node__attr-name",
3435
- style: I({ color: g.theme.colors.xmlAttribute })
3436
- }, j(Y), 5),
3437
- E("span", {
3438
- class: "xml-node__equals",
3439
- style: I({ color: g.theme.colors.xmlEquals })
3440
- }, "=", 4),
3441
- E("span", {
3442
- class: "xml-node__quote",
3443
- style: I({ color: g.theme.colors.xmlQuote })
3444
- }, '"', 4),
3445
- E("span", {
3446
- class: "xml-node__attr-value",
3447
- style: I({ color: g.theme.colors.xmlAttributeValue })
3448
- }, j(V), 5),
3449
- E("span", {
3450
- class: "xml-node__quote",
3451
- style: I({ color: g.theme.colors.xmlQuote })
3452
- }, '"', 4)
3453
- ]))), 128)),
3454
- O.value ? (x(), N("span", {
3455
- key: 2,
3456
- class: "xml-node__clickable-part",
3457
- onClick: T[1] || (T[1] = (V) => M()),
3458
- title: o.value ? "Click to collapse" : "Click to expand"
3459
- }, [
3460
- E("span", {
3461
- class: "xml-node__bracket",
3462
- style: I({ color: g.theme.colors.xmlBracket })
3463
- }, ">", 4)
3464
- ], 8, an)) : (x(), N("span", {
3465
- key: 3,
3466
- class: "xml-node__bracket",
3467
- style: I({ color: g.theme.colors.xmlBracket })
3468
- }, j(O.value ? ">" : "/>"), 5)),
3469
- !o.value && O.value ? (x(), N("span", {
3470
- key: 4,
3471
- class: "xml-node__collapsed xml-node__collapsed--clickable",
3472
- style: I({ color: g.theme.colors.textSecondary }),
3473
- onClick: T[2] || (T[2] = (V) => M()),
3474
- title: "Click to expand"
3475
- }, "...", 4)) : X("", !0)
3476
- ]),
3477
- o.value && O.value ? (x(), N("div", ln, [
3478
- C.value.length === 0 && f.value.trim() ? (x(), N("div", un, [
3479
- E("span", {
3480
- class: "xml-node__text-content",
3481
- style: I({ color: g.theme.colors.xmlText })
3482
- }, j(f.value), 5)
3483
- ])) : X("", !0),
3484
- (x(!0), N(he, null, pe(C.value, (V, Y) => (x(), Xe(U, {
3485
- key: S(V, Y),
3486
- value: V.value,
3487
- "tag-name": V.tagName,
3488
- level: g.level + 1,
3489
- path: k(V.tagName, Y),
3490
- expanded: g.expanded,
3491
- theme: g.theme,
3492
- onToggleExpand: T[3] || (T[3] = (Z) => g.$emit("toggle-expand", Z)),
3493
- onCopy: T[4] || (T[4] = (Z) => g.$emit("copy", Z))
3494
- }, null, 8, ["value", "tag-name", "level", "path", "expanded", "theme"]))), 128))
3495
- ])) : X("", !0),
3496
- o.value && O.value ? (x(), N("div", cn, [
3497
- E("span", {
3498
- class: "xml-node__clickable-part",
3499
- onClick: T[5] || (T[5] = (V) => M()),
3500
- title: "Click to collapse"
3501
- }, [
3502
- E("span", {
3503
- class: "xml-node__bracket",
3504
- style: I({ color: g.theme.colors.xmlBracket })
3505
- }, "</", 4),
3506
- E("span", {
3507
- class: "xml-node__tag",
3508
- style: I({ color: g.theme.colors.xmlTag })
3509
- }, j(g.tagName), 5),
3510
- E("span", {
3511
- class: "xml-node__bracket",
3512
- style: I({ color: g.theme.colors.xmlBracket })
3513
- }, ">", 4)
3514
- ])
3515
- ])) : X("", !0)
3516
- ]))
3517
- ])) : u.value ? (x(), N("div", dn, [
3518
- E("span", {
3519
- class: "xml-node__text-content",
3520
- style: I({ color: g.theme.colors.xmlText })
3521
- }, j(f.value), 5)
3522
- ])) : a.value ? (x(), N("div", fn, [
3523
- E("span", {
3524
- style: I({ color: g.theme.colors.xmlComment })
3525
- }, " <!-- " + j(y.value) + " --> ", 5)
3526
- ])) : l.value ? (x(), N("div", hn, [
3527
- E("span", {
3528
- style: I({ color: g.theme.colors.xmlCdata })
3529
- }, " <![CDATA[" + j(m.value) + "]]> ", 5)
3530
- ])) : X("", !0)
3531
- ], 4);
3699
+ // 去除首尾空白
3700
+ parseTagValue: !1,
3701
+ // 不解析标签值(保持字符串)
3702
+ processEntities: !0,
3703
+ // 处理实体
3704
+ htmlEntities: !1,
3705
+ // 不是 HTML 实体
3706
+ ignoreNameSpace: !1,
3707
+ // 保留命名空间
3708
+ allowBooleanAttributes: !0,
3709
+ // 允许布尔属性
3710
+ unpairedTags: [],
3711
+ // 未配对的标签
3712
+ stopNodes: [],
3713
+ // 停止解析的节点
3714
+ alwaysCreateTextNode: !1
3715
+ // 仅在有文本时创建文本节点
3716
+ }, mn = {
3717
+ ignoreAttributes: !1,
3718
+ attributeNamePrefix: "@_",
3719
+ textNodeName: "#text",
3720
+ format: !0,
3721
+ // 格式化输出
3722
+ indentBy: " ",
3723
+ // 缩进 2 空格
3724
+ suppressEmptyNode: !1,
3725
+ // 不抑制空节点
3726
+ suppressBooleanAttributes: !1,
3727
+ suppressUnpairedNode: !1
3728
+ }, yn = (r) => {
3729
+ try {
3730
+ const e = pn.validate(r, {
3731
+ allowBooleanAttributes: !0
3732
+ });
3733
+ return e === !0 ? { valid: !0 } : {
3734
+ valid: !1,
3735
+ error: `Line ${e.err.line}: ${e.err.msg}`
3736
+ };
3737
+ } catch (e) {
3738
+ return {
3739
+ valid: !1,
3740
+ error: e instanceof Error ? e.message : "Unknown validation error"
3532
3741
  };
3533
3742
  }
3534
- }), gn = /* @__PURE__ */ me(pn, [["__scopeId", "data-v-c8f9132d"]]), bn = {
3535
- name: "github-light",
3536
- colors: {
3537
- // 背景色
3538
- background: "#ffffff",
3539
- surfaceBackground: "#f6f8fa",
3540
- // 边框色
3541
- border: "#d0d7de",
3542
- // 文本色
3543
- text: "#24292f",
3544
- textSecondary: "#57606a",
3545
- // 按钮样式
3546
- buttonBackground: "#f6f8fa",
3547
- buttonBackgroundHover: "#f3f4f6",
3548
- buttonBorder: "#d0d7de",
3549
- buttonText: "#24292f",
3550
- buttonPrimary: "#1f883d",
3551
- buttonPrimaryHover: "#1a7f37",
3552
- // 状态指示
3553
- success: "#1f883d",
3554
- successBackground: "#dafbe1",
3555
- error: "#cf222e",
3556
- errorBackground: "#ffebe9",
3557
- // XML 语法高亮
3558
- xmlTag: "#116329",
3559
- // 标签名 - 绿色
3560
- xmlAttribute: "#0550ae",
3561
- // 属性名 - 蓝色
3562
- xmlAttributeValue: "#0a3069",
3563
- // 属性值 - 深蓝
3564
- xmlText: "#24292f",
3565
- // 文本内容 - 黑色
3566
- xmlComment: "#6e7781",
3567
- // 注释 - 灰色
3568
- xmlCdata: "#8250df",
3569
- // CDATA - 紫色
3570
- xmlDeclaration: "#953800",
3571
- // 声明 - 橙色
3572
- xmlBracket: "#6e7781",
3573
- // 括号 - 灰色
3574
- xmlEquals: "#6e7781",
3575
- // 等号 - 灰色
3576
- xmlQuote: "#0550ae"
3577
- // 引号 - 蓝色
3743
+ }, De = (r, e) => {
3744
+ try {
3745
+ return new sn({
3746
+ ...gn,
3747
+ ...e
3748
+ }).parse(r);
3749
+ } catch (t) {
3750
+ throw new Error(
3751
+ `XML 解析失败: ${t instanceof Error ? t.message : "Unknown error"}`
3752
+ );
3578
3753
  }
3579
- }, mn = {
3580
- name: "github-dark",
3581
- colors: {
3582
- // 背景色
3583
- background: "#0d1117",
3584
- surfaceBackground: "#161b22",
3585
- // 边框色
3586
- border: "#30363d",
3587
- // 文本色
3588
- text: "#c9d1d9",
3589
- textSecondary: "#8b949e",
3590
- // 按钮样式
3591
- buttonBackground: "#21262d",
3592
- buttonBackgroundHover: "#30363d",
3593
- buttonBorder: "#30363d",
3594
- buttonText: "#c9d1d9",
3595
- buttonPrimary: "#238636",
3596
- buttonPrimaryHover: "#2ea043",
3597
- // 状态指示
3598
- success: "#3fb950",
3599
- successBackground: "#0f2e1c",
3600
- error: "#f85149",
3601
- errorBackground: "#3d1319",
3602
- // XML 语法高亮
3603
- xmlTag: "#7ee787",
3604
- // 标签名 - 亮绿色
3605
- xmlAttribute: "#79c0ff",
3606
- // 属性名 - 亮蓝色
3607
- xmlAttributeValue: "#a5d6ff",
3608
- // 属性值 - 淡蓝色
3609
- xmlText: "#c9d1d9",
3610
- // 文本内容 - 白色
3611
- xmlComment: "#8b949e",
3612
- // 注释 - 灰色
3613
- xmlCdata: "#d2a8ff",
3614
- // CDATA - 紫色
3615
- xmlDeclaration: "#ffa657",
3616
- // 声明 - 橙色
3617
- xmlBracket: "#8b949e",
3618
- // 括号 - 灰色
3619
- xmlEquals: "#8b949e",
3620
- // 等号 - 灰色
3621
- xmlQuote: "#79c0ff"
3622
- // 引号 - 亮蓝色
3754
+ }, Pe = (r, e) => {
3755
+ try {
3756
+ let s = new ne({
3757
+ ...mn,
3758
+ format: e?.format ?? !0,
3759
+ indentBy: e?.indentBy ?? " "
3760
+ }).build(r);
3761
+ return e?.showDeclaration !== !1 && !s.startsWith("<?xml") && (s = `<?xml version="1.0" encoding="UTF-8"?>
3762
+ ` + s), s;
3763
+ } catch (t) {
3764
+ throw new Error(
3765
+ `XML 构建失败: ${t instanceof Error ? t.message : "Unknown error"}`
3766
+ );
3623
3767
  }
3624
- }, yn = {
3625
- name: "min-light",
3626
- colors: {
3627
- // 背景色
3628
- background: "#ffffff",
3629
- surfaceBackground: "#fafafa",
3630
- // 边框色
3631
- border: "#e5e5e5",
3632
- // 文本色
3633
- text: "#171717",
3634
- textSecondary: "#737373",
3635
- // 按钮样式
3636
- buttonBackground: "#fafafa",
3637
- buttonBackgroundHover: "#f5f5f5",
3638
- buttonBorder: "#e5e5e5",
3639
- buttonText: "#171717",
3640
- buttonPrimary: "#22c55e",
3641
- buttonPrimaryHover: "#16a34a",
3642
- // 状态指示
3643
- success: "#22c55e",
3644
- successBackground: "#dcfce7",
3645
- error: "#ef4444",
3646
- errorBackground: "#fee2e2",
3647
- // XML 语法高亮
3648
- xmlTag: "#16a34a",
3649
- // 标签名 - 绿色
3650
- xmlAttribute: "#2563eb",
3651
- // 属性名 - 蓝色
3652
- xmlAttributeValue: "#1e40af",
3653
- // 属性值 - 深蓝
3654
- xmlText: "#171717",
3655
- // 文本内容 - 黑色
3656
- xmlComment: "#737373",
3657
- // 注释 - 灰色
3658
- xmlCdata: "#9333ea",
3659
- // CDATA - 紫色
3660
- xmlDeclaration: "#ea580c",
3661
- // 声明 - 橙色
3662
- xmlBracket: "#737373",
3663
- // 括号 - 灰色
3664
- xmlEquals: "#737373",
3665
- // 等号 - 灰色
3666
- xmlQuote: "#2563eb"
3667
- // 引号 - 蓝色
3768
+ }, bn = (r) => Array.isArray(r) ? Ee(r, { format: !1 }) : Pe(r, { format: !1, showDeclaration: !1 }), vn = (r, e) => {
3769
+ const t = De(r);
3770
+ return Array.isArray(t) ? Ee(t, {
3771
+ indent: e?.indentBy
3772
+ }) : Pe(t, e);
3773
+ }, Ee = (r, e = {}) => {
3774
+ const t = e.indent !== void 0 ? e.indent : " ", s = e.level || 0, n = e.format !== !1, o = n ? t.repeat(s) : "", i = n ? `
3775
+ ` : "";
3776
+ let u = "";
3777
+ for (const a of r) {
3778
+ if (a["?xml"]) {
3779
+ const _ = a[":@"] || {}, j = Object.entries(_).map(([H, p]) => `${H.startsWith("@_") ? H.substring(2) : H}="${p}"`).join(" ");
3780
+ u += `<?xml ${j}?>${i}`;
3781
+ continue;
3782
+ }
3783
+ if (a["#comment"]) {
3784
+ const _ = a["#comment"];
3785
+ if (Array.isArray(_) && _.length > 0) {
3786
+ const j = _[0]["#text"] || _[0];
3787
+ u += `${o}<!--${j}-->${i}`;
3788
+ }
3789
+ continue;
3790
+ }
3791
+ const l = Object.keys(a).find((_) => !_.startsWith(":") && !_.startsWith("#") && !_.startsWith("__"));
3792
+ if (!l) continue;
3793
+ const h = a[l], f = a[":@"] || {}, b = Object.entries(f).map(([_, j]) => `${_.startsWith("@_") ? _.substring(2) : _}="${j}"`).join(" "), m = b ? " " + b : "";
3794
+ if (!Array.isArray(h) || h.length === 0) {
3795
+ u += `${o}<${l}${m}/>${i}`;
3796
+ continue;
3797
+ }
3798
+ const w = h.length === 1 && h[0]["#text"] !== void 0;
3799
+ if (h.some((_) => _.__cdata)) {
3800
+ const _ = h.find((j) => j.__cdata);
3801
+ if (_) {
3802
+ const j = _.__cdata[0]["#text"] || "";
3803
+ u += `${o}<${l}${m}><![CDATA[${j}]]></${l}>${i}`;
3804
+ }
3805
+ } else if (w) {
3806
+ const _ = h[0]["#text"];
3807
+ u += `${o}<${l}${m}>${_}</${l}>${i}`;
3808
+ } else
3809
+ u += `${o}<${l}${m}>${i}`, u += Ee(h, { indent: t, level: s + 1, format: n }), u += `${o}</${l}>${i}`;
3668
3810
  }
3811
+ return u;
3669
3812
  }, En = {
3670
- name: "slack-ochin",
3671
- colors: {
3672
- // 背景色
3673
- background: "#fef5ed",
3674
- surfaceBackground: "#fef9f3",
3675
- // 边框色
3676
- border: "#e9dcc9",
3677
- // 文本色
3678
- text: "#3d3c40",
3679
- textSecondary: "#616061",
3680
- // 按钮样式
3681
- buttonBackground: "#fef9f3",
3682
- buttonBackgroundHover: "#f9f0e5",
3683
- buttonBorder: "#e9dcc9",
3684
- buttonText: "#3d3c40",
3685
- buttonPrimary: "#007a5a",
3686
- buttonPrimaryHover: "#006644",
3687
- // 状态指示
3688
- success: "#007a5a",
3689
- successBackground: "#d1f4e0",
3690
- error: "#e01e5a",
3691
- errorBackground: "#ffdbea",
3692
- // XML 语法高亮
3693
- xmlTag: "#007a5a",
3694
- // 标签名 - 绿色
3695
- xmlAttribute: "#1264a3",
3696
- // 属性名 - 蓝色
3697
- xmlAttributeValue: "#0b4c8c",
3698
- // 属性值 - 深蓝
3699
- xmlText: "#3d3c40",
3700
- // 文本内容 - 黑色
3701
- xmlComment: "#616061",
3702
- // 注释 - 灰色
3703
- xmlCdata: "#8b2eff",
3704
- // CDATA - 紫色
3705
- xmlDeclaration: "#e8912d",
3706
- // 声明 - 橙色
3707
- xmlBracket: "#616061",
3708
- // 括号 - 灰色
3709
- xmlEquals: "#616061",
3710
- // 等号 - 灰色
3711
- xmlQuote: "#1264a3"
3712
- // 引号 - 蓝色
3713
- }
3714
- }, je = {
3715
- "github-light": bn,
3716
- "github-dark": mn,
3717
- "min-light": yn,
3718
- "slack-ochin": En
3719
- }, vn = (r) => je[r] || je["github-light"], _n = {
3720
3813
  key: 0,
3721
3814
  class: "xml-format__toolbar"
3722
- }, xn = { class: "xml-format__actions" }, Nn = ["disabled"], kn = ["disabled"], wn = ["disabled"], An = ["disabled"], Cn = ["disabled"], On = { class: "xml-format__info" }, Tn = {
3815
+ }, _n = { class: "xml-format__actions" }, xn = ["disabled"], Nn = ["disabled"], kn = ["disabled"], An = ["disabled"], wn = ["disabled"], Cn = { class: "xml-format__info" }, On = {
3723
3816
  key: 0,
3724
3817
  class: "xml-format__status xml-format__status--success"
3725
- }, Pn = {
3818
+ }, Tn = {
3726
3819
  key: 1,
3727
3820
  class: "xml-format__status xml-format__status--error"
3728
- }, Sn = { class: "xml-format__content" }, In = {
3821
+ }, Pn = { class: "xml-format__content" }, $n = {
3729
3822
  key: 0,
3730
3823
  class: "xml-format__error"
3731
- }, $n = {
3824
+ }, Sn = {
3732
3825
  key: 1,
3733
3826
  class: "xml-format__viewer"
3734
- }, Bn = /* @__PURE__ */ be({
3827
+ }, In = /* @__PURE__ */ ye({
3735
3828
  __name: "index",
3736
3829
  props: {
3737
3830
  modelValue: { default: "" },
@@ -3744,175 +3837,199 @@ const qr = {
3744
3837
  preserveWhitespace: { type: Boolean, default: !1 }
3745
3838
  },
3746
3839
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress", "format"],
3747
- setup(r, { emit: e }) {
3748
- Ce((k) => ({
3749
- 19083852: a.value.colors.border,
3750
- "9aacd358": a.value.colors.background,
3751
- "34ab9c56": a.value.colors.surfaceBackground,
3752
- "43d12cb8": a.value.colors.buttonBorder,
3753
- "0f3bcea6": a.value.colors.buttonBackground,
3754
- "177038a5": a.value.colors.buttonText,
3755
- "39377b94": a.value.colors.buttonBackgroundHover,
3756
- "63de70ec": a.value.colors.buttonPrimary,
3757
- "0009905c": a.value.colors.buttonPrimaryHover,
3758
- d69bfec6: a.value.colors.success,
3759
- "55ddd1ab": a.value.colors.successBackground,
3760
- "4b4cf122": a.value.colors.error,
3761
- "5344c020": a.value.colors.errorBackground,
3762
- "3400dad3": a.value.colors.text
3840
+ setup(r, { expose: e, emit: t }) {
3841
+ Oe((E) => ({
3842
+ "0db40539": l.value.colors.border,
3843
+ bd72d08a: l.value.colors.background,
3844
+ "1738b57a": l.value.colors.text,
3845
+ "69331e8e": l.value.colors.surfaceBackground,
3846
+ cd0ca56a: l.value.colors.buttonBorder,
3847
+ "02f5e6cd": l.value.colors.buttonBackground,
3848
+ "060d3a0c": l.value.colors.buttonText,
3849
+ "6ac62a6f": l.value.colors.buttonBackgroundHover,
3850
+ "7ef6f8c3": l.value.colors.buttonPrimary,
3851
+ "24e03b8e": l.value.colors.buttonPrimaryHover,
3852
+ "357fd096": l.value.colors.success,
3853
+ "4d328338": l.value.colors.successBackground,
3854
+ "61df294a": l.value.colors.error,
3855
+ "3307322e": l.value.colors.errorBackground
3763
3856
  }));
3764
- const t = r, s = e, n = G(null), o = G(""), i = G(/* @__PURE__ */ new Set()), u = L(() => o.value === ""), a = L(() => vn(t.theme)), l = L(() => {
3765
- if (!n.value) return {};
3766
- const k = {};
3767
- return Object.keys(n.value).forEach((S) => {
3768
- !S.startsWith("?") && !S.startsWith("#") && (k[S] = n.value[S]);
3769
- }), k;
3770
- }), h = (k) => {
3771
- if (!k || !k.trim()) {
3772
- o.value = "", n.value = null;
3857
+ const s = r, n = t, o = z(null), i = z(""), u = z(/* @__PURE__ */ new Set()), a = V(() => i.value === ""), l = V(() => mr(s.theme)), h = V(() => !o.value || !Array.isArray(o.value) ? [] : o.value.filter((E) => !E["?xml"])), f = V(() => {
3858
+ if (!o.value || !Array.isArray(o.value)) return null;
3859
+ const E = o.value.find((X) => X["?xml"]);
3860
+ if (!E || !E[":@"]) return null;
3861
+ const O = E[":@"], I = [];
3862
+ return O["@_version"] && I.push(`version="${O["@_version"]}"`), O["@_encoding"] && I.push(`encoding="${O["@_encoding"]}"`), O["@_standalone"] && I.push(`standalone="${O["@_standalone"]}"`), I.length > 0 ? `<?xml ${I.join(" ")}?>` : null;
3863
+ }), b = V(() => h.value), m = (E) => {
3864
+ if (!E || !E.trim()) {
3865
+ i.value = "", o.value = null;
3773
3866
  return;
3774
3867
  }
3775
3868
  try {
3776
- const S = Wr(k);
3777
- if (!S.valid) {
3778
- o.value = S.error || "Invalid XML", n.value = null;
3869
+ const O = yn(E);
3870
+ if (!O.valid) {
3871
+ i.value = O.error || "Invalid XML", o.value = null;
3779
3872
  return;
3780
3873
  }
3781
- n.value = ze(k), o.value = "", ce(() => {
3782
- y();
3874
+ o.value = De(E), i.value = "", he(() => {
3875
+ S();
3783
3876
  });
3784
- } catch (S) {
3785
- o.value = S instanceof Error ? S.message : "Unknown parse error", n.value = null;
3877
+ } catch (O) {
3878
+ i.value = O instanceof Error ? O.message : "Unknown parse error", o.value = null;
3786
3879
  }
3787
- }, f = (k) => {
3788
- i.value.has(k) ? i.value.delete(k) : i.value.add(k);
3789
- }, y = () => {
3790
- const k = /* @__PURE__ */ new Set(), S = (g, T = "") => {
3791
- g !== null && typeof g == "object" && (T && k.add(T), Object.keys(g).forEach((U) => {
3792
- if (U.startsWith("@_") || U === "#text") return;
3793
- const V = g[U], Y = T ? `${T}.${U}[0]` : U;
3794
- Array.isArray(V) ? V.forEach((Z, D) => {
3795
- const J = T ? `${T}.${U}[${D}]` : `${U}[${D}]`;
3796
- S(Z, J);
3797
- }) : S(V, Y);
3798
- }));
3880
+ }, w = (E) => {
3881
+ u.value.has(E) ? u.value.delete(E) : u.value.add(E);
3882
+ }, S = () => {
3883
+ const E = /* @__PURE__ */ new Set(), O = (I, X = "") => {
3884
+ Array.isArray(I) && I.forEach((Z, Y) => {
3885
+ const Q = Object.keys(Z).find((y) => !y.startsWith(":") && !y.startsWith("#"));
3886
+ if (!Q) return;
3887
+ const ee = X ? `${X}[${Y}]` : `${Q}[${Y}]`;
3888
+ E.add(ee);
3889
+ const ae = Z[Q];
3890
+ Array.isArray(ae) && O(ae, ee + "." + Q);
3891
+ });
3799
3892
  };
3800
- Object.keys(l.value).forEach((g) => {
3801
- S(l.value[g], g);
3802
- }), i.value = k, s("expand-all");
3803
- }, m = () => {
3804
- i.value.clear(), s("collapse-all");
3805
- }, C = async () => {
3806
- if (!(!u.value || !n.value))
3893
+ h.value.forEach((I, X) => {
3894
+ const Z = Object.keys(I).find((Y) => !Y.startsWith(":") && !Y.startsWith("#"));
3895
+ if (Z) {
3896
+ const Y = `${Z}[${X}]`;
3897
+ E.add(Y);
3898
+ const Q = I[Z];
3899
+ Array.isArray(Q) && O(Q, Y + "." + Z);
3900
+ }
3901
+ }), u.value = E, n("expand-all");
3902
+ }, _ = () => {
3903
+ u.value.clear(), n("collapse-all");
3904
+ }, j = async () => {
3905
+ if (!(!a.value || !o.value))
3807
3906
  try {
3808
- const k = Te(n.value, {
3809
- format: !0,
3810
- indentBy: " "
3811
- });
3812
- await navigator.clipboard.writeText(k), s("copy-success", k);
3813
- } catch (k) {
3814
- const S = k instanceof Error ? k : new Error("Copy failed");
3815
- s("copy-error", S), console.error("Failed to copy XML:", k);
3907
+ const E = Array.isArray(o.value) ? Ee(o.value, { indent: " " }) : Pe(o.value, { format: !0, indentBy: " " });
3908
+ await navigator.clipboard.writeText(E), n("copy-success", E);
3909
+ } catch (E) {
3910
+ const O = E instanceof Error ? E : new Error("Copy failed");
3911
+ n("copy-error", O), console.error("Failed to copy XML:", E);
3816
3912
  }
3817
- }, O = () => {
3818
- if (!(!u.value || !n.value))
3913
+ }, H = () => {
3914
+ if (!(!a.value || !o.value))
3819
3915
  try {
3820
- const k = Zr(n.value);
3821
- s("update:modelValue", k), s("compress", k);
3822
- } catch (k) {
3823
- console.error("Failed to compress XML:", k);
3916
+ const E = bn(o.value);
3917
+ n("update:modelValue", E), n("compress", E);
3918
+ } catch (E) {
3919
+ console.error("Failed to compress XML:", E);
3824
3920
  }
3825
- }, P = () => {
3826
- if (u.value)
3921
+ }, p = () => {
3922
+ if (a.value)
3827
3923
  try {
3828
- const k = zr(t.modelValue, {
3924
+ const E = vn(s.modelValue, {
3829
3925
  format: !0,
3830
3926
  indentBy: " "
3831
3927
  });
3832
- s("update:modelValue", k), s("format", k);
3833
- } catch (k) {
3834
- console.error("Failed to format XML:", k);
3928
+ n("update:modelValue", E), n("format", E);
3929
+ } catch (E) {
3930
+ console.error("Failed to format XML:", E);
3835
3931
  }
3836
- }, M = async (k) => {
3932
+ }, $ = async (E) => {
3837
3933
  try {
3838
- const S = typeof k == "string" ? k : JSON.stringify(k, null, 2);
3839
- await navigator.clipboard.writeText(S), s("copy-success", S);
3840
- } catch (S) {
3841
- const g = S instanceof Error ? S : new Error("Copy failed");
3842
- s("copy-error", g), console.error("Failed to copy value:", S);
3934
+ const O = typeof E == "string" ? E : JSON.stringify(E, null, 2);
3935
+ await navigator.clipboard.writeText(O), n("copy-success", O);
3936
+ } catch (O) {
3937
+ const I = O instanceof Error ? O : new Error("Copy failed");
3938
+ n("copy-error", I), console.error("Failed to copy value:", O);
3843
3939
  }
3844
3940
  };
3845
- return Fe(() => t.modelValue, (k) => {
3846
- h(k);
3847
- }, { immediate: !0 }), (k, S) => (x(), N("div", {
3848
- class: Oe(["xml-format", `xml-format--${a.value.name}`])
3941
+ return Xe(() => s.modelValue, (E) => {
3942
+ m(E);
3943
+ }, { immediate: !0 }), e({
3944
+ // 核心操作方法
3945
+ copyXml: j,
3946
+ compressSource: H,
3947
+ formatSource: p,
3948
+ expandAll: S,
3949
+ collapseAll: _,
3950
+ toggleExpand: w,
3951
+ // 状态访问方法
3952
+ isValidXml: () => a.value,
3953
+ getParsedXml: () => o.value,
3954
+ getExpandedNodes: () => u.value,
3955
+ getParseError: () => i.value,
3956
+ // 工具方法
3957
+ parseXmlString: (E) => m(E),
3958
+ copyValue: (E) => $(E)
3959
+ }), (E, O) => (x(), k("div", {
3960
+ class: Te(["xml-format", `xml-format--${l.value.name}`])
3849
3961
  }, [
3850
- k.showToolbar ? (x(), N("div", _n, [
3851
- E("div", xn, [
3852
- E("button", {
3962
+ E.showToolbar ? (x(), k("div", En, [
3963
+ v("div", _n, [
3964
+ v("button", {
3853
3965
  class: "xml-format__btn xml-format__btn--primary",
3854
- onClick: C,
3855
- disabled: !u.value,
3966
+ onClick: j,
3967
+ disabled: !a.value,
3856
3968
  title: "Copy XML"
3857
- }, " 📋 Copy ", 8, Nn),
3858
- E("button", {
3969
+ }, " 📋 Copy ", 8, xn),
3970
+ v("button", {
3859
3971
  class: "xml-format__btn xml-format__btn--secondary",
3860
- onClick: y,
3861
- disabled: !u.value,
3972
+ onClick: S,
3973
+ disabled: !a.value,
3862
3974
  title: "Expand All"
3863
- }, " ⬇️ Expand All ", 8, kn),
3864
- E("button", {
3975
+ }, " ⬇️ Expand All ", 8, Nn),
3976
+ v("button", {
3865
3977
  class: "xml-format__btn xml-format__btn--secondary",
3866
- onClick: m,
3867
- disabled: !u.value,
3978
+ onClick: _,
3979
+ disabled: !a.value,
3868
3980
  title: "Collapse All"
3869
- }, " ➡️ Collapse All ", 8, wn),
3870
- E("button", {
3981
+ }, " ➡️ Collapse All ", 8, kn),
3982
+ v("button", {
3871
3983
  class: "xml-format__btn xml-format__btn--secondary",
3872
- onClick: O,
3873
- disabled: !u.value,
3984
+ onClick: H,
3985
+ disabled: !a.value,
3874
3986
  title: "Compress XML"
3875
3987
  }, " 📦 Compress ", 8, An),
3876
- E("button", {
3988
+ v("button", {
3877
3989
  class: "xml-format__btn xml-format__btn--secondary",
3878
- onClick: P,
3879
- disabled: !u.value,
3990
+ onClick: p,
3991
+ disabled: !a.value,
3880
3992
  title: "Format XML"
3881
- }, " ✨ Format ", 8, Cn)
3993
+ }, " ✨ Format ", 8, wn)
3882
3994
  ]),
3883
- E("div", On, [
3884
- u.value ? (x(), N("span", Tn, " ✅ Valid XML ")) : (x(), N("span", Pn, " ❌ Invalid XML "))
3995
+ v("div", Cn, [
3996
+ a.value ? (x(), k("span", On, " ✅ Valid XML ")) : (x(), k("span", Tn, " ❌ Invalid XML "))
3885
3997
  ])
3886
- ])) : X("", !0),
3887
- E("div", Sn, [
3888
- u.value ? (x(), N("div", $n, [
3889
- (x(!0), N(he, null, pe(l.value, (g, T) => (x(), Xe(gn, {
3890
- key: String(T),
3891
- value: g,
3892
- "tag-name": String(T),
3998
+ ])) : F("", !0),
3999
+ v("div", Pn, [
4000
+ a.value ? (x(), k("div", Sn, [
4001
+ f.value ? (x(), k("div", {
4002
+ key: 0,
4003
+ class: "xml-declaration",
4004
+ style: P({ color: l.value.colors.xmlDeclaration })
4005
+ }, R(f.value), 5)) : F("", !0),
4006
+ (x(!0), k(de, null, fe(b.value, (I, X) => (x(), He(dr, {
4007
+ key: X,
4008
+ node: I,
4009
+ index: X,
3893
4010
  level: 0,
3894
- expanded: i.value,
3895
- theme: a.value,
3896
- onToggleExpand: f,
3897
- onCopy: M
3898
- }, null, 8, ["value", "tag-name", "expanded", "theme"]))), 128))
3899
- ])) : (x(), N("div", In, [
3900
- S[0] || (S[0] = E("h4", null, "XML Parse Error:", -1)),
3901
- E("pre", null, j(o.value), 1)
4011
+ expanded: u.value,
4012
+ theme: l.value,
4013
+ onToggleExpand: w,
4014
+ onCopy: $
4015
+ }, null, 8, ["node", "index", "expanded", "theme"]))), 128))
4016
+ ])) : (x(), k("div", $n, [
4017
+ O[0] || (O[0] = v("h4", null, "XML Parse Error:", -1)),
4018
+ v("pre", null, R(i.value), 1)
3902
4019
  ]))
3903
4020
  ])
3904
4021
  ], 2));
3905
4022
  }
3906
- }), Un = /* @__PURE__ */ me(Bn, [["__scopeId", "data-v-ec8763a7"]]), Ln = [Wt], Vn = (r) => {
3907
- Ln.forEach((e) => {
4023
+ }), jn = /* @__PURE__ */ be(In, [["__scopeId", "data-v-f9125514"]]), Bn = [Zt], Vn = (r) => {
4024
+ Bn.forEach((e) => {
3908
4025
  const t = e.name || e.__name || "UnknownComponent";
3909
4026
  r.component(t, e);
3910
4027
  });
3911
- }, Fn = {
4028
+ }, Mn = {
3912
4029
  install: Vn
3913
4030
  };
3914
4031
  export {
3915
- Wt as JsonFormat,
3916
- Un as XmlFormat,
3917
- Fn as default
4032
+ Zt as JsonFormat,
4033
+ jn as XmlFormat,
4034
+ Mn as default
3918
4035
  };