lone-format 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { defineComponent as ye, useCssVars as Oe, ref as z, computed as V, resolveComponent as Ue, createElementBlock as A, 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";
1
+ import { defineComponent as ye, useCssVars as Oe, ref as Y, computed as V, resolveComponent as Me, createElementBlock as x, openBlock as _, createElementVNode as y, createCommentVNode as U, withDirectives as Ee, toDisplayString as B, withKeys as de, vModelText as xe, Fragment as ne, renderList as ie, createVNode as Ue, normalizeClass as Te, createTextVNode as De, nextTick as he, watch as Fe, normalizeStyle as N, createBlock as Xe } from "vue";
2
2
  class Je {
3
3
  /**
4
4
  * @callback HookCallback
@@ -69,7 +69,7 @@ class et {
69
69
  });
70
70
  }
71
71
  }
72
- class c {
72
+ class d {
73
73
  /**
74
74
  * @returns {string}
75
75
  */
@@ -80,7 +80,7 @@ class c {
80
80
  * @returns {string}
81
81
  */
82
82
  static toString() {
83
- return "JavaScript Expression Parser (JSEP) v" + c.version;
83
+ return "JavaScript Expression Parser (JSEP) v" + d.version;
84
84
  }
85
85
  // ==================== CONFIG ================================
86
86
  /**
@@ -89,7 +89,7 @@ class c {
89
89
  * @returns {Jsep}
90
90
  */
91
91
  static addUnaryOp(e) {
92
- return c.max_unop_len = Math.max(e.length, c.max_unop_len), c.unary_ops[e] = 1, c;
92
+ return d.max_unop_len = Math.max(e.length, d.max_unop_len), d.unary_ops[e] = 1, d;
93
93
  }
94
94
  /**
95
95
  * @method jsep.addBinaryOp
@@ -99,7 +99,7 @@ class c {
99
99
  * @returns {Jsep}
100
100
  */
101
101
  static addBinaryOp(e, t, s) {
102
- return c.max_binop_len = Math.max(e.length, c.max_binop_len), c.binary_ops[e] = t, s ? c.right_associative.add(e) : c.right_associative.delete(e), c;
102
+ return d.max_binop_len = Math.max(e.length, d.max_binop_len), d.binary_ops[e] = t, s ? d.right_associative.add(e) : d.right_associative.delete(e), d;
103
103
  }
104
104
  /**
105
105
  * @method addIdentifierChar
@@ -107,7 +107,7 @@ class c {
107
107
  * @returns {Jsep}
108
108
  */
109
109
  static addIdentifierChar(e) {
110
- return c.additional_identifier_chars.add(e), c;
110
+ return d.additional_identifier_chars.add(e), d;
111
111
  }
112
112
  /**
113
113
  * @method addLiteral
@@ -116,7 +116,7 @@ class c {
116
116
  * @returns {Jsep}
117
117
  */
118
118
  static addLiteral(e, t) {
119
- return c.literals[e] = t, c;
119
+ return d.literals[e] = t, d;
120
120
  }
121
121
  /**
122
122
  * @method removeUnaryOp
@@ -124,14 +124,14 @@ class c {
124
124
  * @returns {Jsep}
125
125
  */
126
126
  static removeUnaryOp(e) {
127
- return delete c.unary_ops[e], e.length === c.max_unop_len && (c.max_unop_len = c.getMaxKeyLen(c.unary_ops)), c;
127
+ return delete d.unary_ops[e], e.length === d.max_unop_len && (d.max_unop_len = d.getMaxKeyLen(d.unary_ops)), d;
128
128
  }
129
129
  /**
130
130
  * @method removeAllUnaryOps
131
131
  * @returns {Jsep}
132
132
  */
133
133
  static removeAllUnaryOps() {
134
- return c.unary_ops = {}, c.max_unop_len = 0, c;
134
+ return d.unary_ops = {}, d.max_unop_len = 0, d;
135
135
  }
136
136
  /**
137
137
  * @method removeIdentifierChar
@@ -139,7 +139,7 @@ class c {
139
139
  * @returns {Jsep}
140
140
  */
141
141
  static removeIdentifierChar(e) {
142
- return c.additional_identifier_chars.delete(e), c;
142
+ return d.additional_identifier_chars.delete(e), d;
143
143
  }
144
144
  /**
145
145
  * @method removeBinaryOp
@@ -147,14 +147,14 @@ class c {
147
147
  * @returns {Jsep}
148
148
  */
149
149
  static removeBinaryOp(e) {
150
- return delete c.binary_ops[e], e.length === c.max_binop_len && (c.max_binop_len = c.getMaxKeyLen(c.binary_ops)), c.right_associative.delete(e), c;
150
+ return delete d.binary_ops[e], e.length === d.max_binop_len && (d.max_binop_len = d.getMaxKeyLen(d.binary_ops)), d.right_associative.delete(e), d;
151
151
  }
152
152
  /**
153
153
  * @method removeAllBinaryOps
154
154
  * @returns {Jsep}
155
155
  */
156
156
  static removeAllBinaryOps() {
157
- return c.binary_ops = {}, c.max_binop_len = 0, c;
157
+ return d.binary_ops = {}, d.max_binop_len = 0, d;
158
158
  }
159
159
  /**
160
160
  * @method removeLiteral
@@ -162,14 +162,14 @@ class c {
162
162
  * @returns {Jsep}
163
163
  */
164
164
  static removeLiteral(e) {
165
- return delete c.literals[e], c;
165
+ return delete d.literals[e], d;
166
166
  }
167
167
  /**
168
168
  * @method removeAllLiterals
169
169
  * @returns {Jsep}
170
170
  */
171
171
  static removeAllLiterals() {
172
- return c.literals = {}, c;
172
+ return d.literals = {}, d;
173
173
  }
174
174
  // ==================== END CONFIG ============================
175
175
  /**
@@ -196,7 +196,7 @@ class c {
196
196
  * @returns {jsep.Expression}
197
197
  */
198
198
  static parse(e) {
199
- return new c(e).parse();
199
+ return new d(e).parse();
200
200
  }
201
201
  /**
202
202
  * Get the longest key length of any object
@@ -220,7 +220,7 @@ class c {
220
220
  * @returns {number}
221
221
  */
222
222
  static binaryPrecedence(e) {
223
- return c.binary_ops[e] || 0;
223
+ return d.binary_ops[e] || 0;
224
224
  }
225
225
  /**
226
226
  * Looks for start of identifier
@@ -230,15 +230,15 @@ class c {
230
230
  static isIdentifierStart(e) {
231
231
  return e >= 65 && e <= 90 || // A...Z
232
232
  e >= 97 && e <= 122 || // a...z
233
- e >= 128 && !c.binary_ops[String.fromCharCode(e)] || // any non-ASCII that is not an operator
234
- c.additional_identifier_chars.has(String.fromCharCode(e));
233
+ e >= 128 && !d.binary_ops[String.fromCharCode(e)] || // any non-ASCII that is not an operator
234
+ d.additional_identifier_chars.has(String.fromCharCode(e));
235
235
  }
236
236
  /**
237
237
  * @param {number} ch
238
238
  * @returns {boolean}
239
239
  */
240
240
  static isIdentifierPart(e) {
241
- return c.isIdentifierStart(e) || c.isDecimalDigit(e);
241
+ return d.isIdentifierStart(e) || d.isDecimalDigit(e);
242
242
  }
243
243
  /**
244
244
  * throw error at index of the expression
@@ -256,12 +256,12 @@ class c {
256
256
  * @returns {?jsep.Expression}
257
257
  */
258
258
  runHook(e, t) {
259
- if (c.hooks[e]) {
259
+ if (d.hooks[e]) {
260
260
  const s = {
261
261
  context: this,
262
262
  node: t
263
263
  };
264
- return c.hooks.run(e, s), s.node;
264
+ return d.hooks.run(e, s), s.node;
265
265
  }
266
266
  return t;
267
267
  }
@@ -271,11 +271,11 @@ class c {
271
271
  * @returns {?jsep.Expression}
272
272
  */
273
273
  searchHook(e) {
274
- if (c.hooks[e]) {
274
+ if (d.hooks[e]) {
275
275
  const t = {
276
276
  context: this
277
277
  };
278
- return c.hooks[e].find(function(s) {
278
+ return d.hooks[e].find(function(s) {
279
279
  return s.call(t.context, t), t.node;
280
280
  }), t.node;
281
281
  }
@@ -285,7 +285,7 @@ class c {
285
285
  */
286
286
  gobbleSpaces() {
287
287
  let e = this.code;
288
- for (; e === c.SPACE_CODE || e === c.TAB_CODE || e === c.LF_CODE || e === c.CR_CODE; )
288
+ for (; e === d.SPACE_CODE || e === d.TAB_CODE || e === d.LF_CODE || e === d.CR_CODE; )
289
289
  e = this.expr.charCodeAt(++this.index);
290
290
  this.runHook("gobble-spaces");
291
291
  }
@@ -296,7 +296,7 @@ class c {
296
296
  parse() {
297
297
  this.runHook("before-all");
298
298
  const e = this.gobbleExpressions(), t = e.length === 1 ? e[0] : {
299
- type: c.COMPOUND,
299
+ type: d.COMPOUND,
300
300
  body: e
301
301
  };
302
302
  return this.runHook("after-all", t);
@@ -309,7 +309,7 @@ class c {
309
309
  gobbleExpressions(e) {
310
310
  let t = [], s, n;
311
311
  for (; this.index < this.expr.length; )
312
- if (s = this.code, s === c.SEMCOL_CODE || s === c.COMMA_CODE)
312
+ if (s = this.code, s === d.SEMCOL_CODE || s === d.COMMA_CODE)
313
313
  this.index++;
314
314
  else if (n = this.gobbleExpression())
315
315
  t.push(n);
@@ -337,9 +337,9 @@ class c {
337
337
  */
338
338
  gobbleBinaryOp() {
339
339
  this.gobbleSpaces();
340
- let e = this.expr.substr(this.index, c.max_binop_len), t = e.length;
340
+ let e = this.expr.substr(this.index, d.max_binop_len), t = e.length;
341
341
  for (; t > 0; ) {
342
- if (c.binary_ops.hasOwnProperty(e) && (!c.isIdentifierStart(this.code) || this.index + e.length < this.expr.length && !c.isIdentifierPart(this.expr.charCodeAt(this.index + e.length))))
342
+ if (d.binary_ops.hasOwnProperty(e) && (!d.isIdentifierStart(this.code) || this.index + e.length < this.expr.length && !d.isIdentifierPart(this.expr.charCodeAt(this.index + e.length))))
343
343
  return this.index += t, e;
344
344
  e = e.substr(0, --t);
345
345
  }
@@ -356,22 +356,22 @@ class c {
356
356
  return i;
357
357
  for (o = {
358
358
  value: t,
359
- prec: c.binaryPrecedence(t),
360
- right_a: c.right_associative.has(t)
359
+ prec: d.binaryPrecedence(t),
360
+ right_a: d.right_associative.has(t)
361
361
  }, u = this.gobbleToken(), u || this.throwError("Expected expression after " + t), n = [i, o, u]; t = this.gobbleBinaryOp(); ) {
362
- if (s = c.binaryPrecedence(t), s === 0) {
362
+ if (s = d.binaryPrecedence(t), s === 0) {
363
363
  this.index -= t.length;
364
364
  break;
365
365
  }
366
366
  o = {
367
367
  value: t,
368
368
  prec: s,
369
- right_a: c.right_associative.has(t)
369
+ right_a: d.right_associative.has(t)
370
370
  }, l = t;
371
- const h = (f) => o.right_a && f.right_a ? s > f.prec : s <= f.prec;
372
- for (; n.length > 2 && h(n[n.length - 2]); )
371
+ const p = (h) => o.right_a && h.right_a ? s > h.prec : s <= h.prec;
372
+ for (; n.length > 2 && p(n[n.length - 2]); )
373
373
  u = n.pop(), t = n.pop().value, i = n.pop(), e = {
374
- type: c.BINARY_EXP,
374
+ type: d.BINARY_EXP,
375
375
  operator: t,
376
376
  left: i,
377
377
  right: u
@@ -380,7 +380,7 @@ class c {
380
380
  }
381
381
  for (a = n.length - 1, e = n[a]; a > 1; )
382
382
  e = {
383
- type: c.BINARY_EXP,
383
+ type: d.BINARY_EXP,
384
384
  operator: n[a - 1].value,
385
385
  left: n[a - 2],
386
386
  right: e
@@ -396,19 +396,19 @@ class c {
396
396
  let e, t, s, n;
397
397
  if (this.gobbleSpaces(), n = this.searchHook("gobble-token"), n)
398
398
  return this.runHook("after-token", n);
399
- if (e = this.code, c.isDecimalDigit(e) || e === c.PERIOD_CODE)
399
+ if (e = this.code, d.isDecimalDigit(e) || e === d.PERIOD_CODE)
400
400
  return this.gobbleNumericLiteral();
401
- if (e === c.SQUOTE_CODE || e === c.DQUOTE_CODE)
401
+ if (e === d.SQUOTE_CODE || e === d.DQUOTE_CODE)
402
402
  n = this.gobbleStringLiteral();
403
- else if (e === c.OBRACK_CODE)
403
+ else if (e === d.OBRACK_CODE)
404
404
  n = this.gobbleArray();
405
405
  else {
406
- for (t = this.expr.substr(this.index, c.max_unop_len), s = t.length; s > 0; ) {
407
- if (c.unary_ops.hasOwnProperty(t) && (!c.isIdentifierStart(this.code) || this.index + t.length < this.expr.length && !c.isIdentifierPart(this.expr.charCodeAt(this.index + t.length)))) {
406
+ for (t = this.expr.substr(this.index, d.max_unop_len), s = t.length; s > 0; ) {
407
+ if (d.unary_ops.hasOwnProperty(t) && (!d.isIdentifierStart(this.code) || this.index + t.length < this.expr.length && !d.isIdentifierPart(this.expr.charCodeAt(this.index + t.length)))) {
408
408
  this.index += s;
409
409
  const o = this.gobbleToken();
410
410
  return o || this.throwError("missing unaryOp argument"), this.runHook("after-token", {
411
- type: c.UNARY_EXP,
411
+ type: d.UNARY_EXP,
412
412
  operator: t,
413
413
  argument: o,
414
414
  prefix: !0
@@ -416,13 +416,13 @@ class c {
416
416
  }
417
417
  t = t.substr(0, --s);
418
418
  }
419
- c.isIdentifierStart(e) ? (n = this.gobbleIdentifier(), c.literals.hasOwnProperty(n.name) ? n = {
420
- type: c.LITERAL,
421
- value: c.literals[n.name],
419
+ d.isIdentifierStart(e) ? (n = this.gobbleIdentifier(), d.literals.hasOwnProperty(n.name) ? n = {
420
+ type: d.LITERAL,
421
+ value: d.literals[n.name],
422
422
  raw: n.name
423
- } : n.name === c.this_str && (n = {
424
- type: c.THIS_EXP
425
- })) : e === c.OPAREN_CODE && (n = this.gobbleGroup());
423
+ } : n.name === d.this_str && (n = {
424
+ type: d.THIS_EXP
425
+ })) : e === d.OPAREN_CODE && (n = this.gobbleGroup());
426
426
  }
427
427
  return n ? (n = this.gobbleTokenProperty(n), this.runHook("after-token", n)) : this.runHook("after-token", !1);
428
428
  }
@@ -437,24 +437,24 @@ class c {
437
437
  gobbleTokenProperty(e) {
438
438
  this.gobbleSpaces();
439
439
  let t = this.code;
440
- for (; t === c.PERIOD_CODE || t === c.OBRACK_CODE || t === c.OPAREN_CODE || t === c.QUMARK_CODE; ) {
440
+ for (; t === d.PERIOD_CODE || t === d.OBRACK_CODE || t === d.OPAREN_CODE || t === d.QUMARK_CODE; ) {
441
441
  let s;
442
- if (t === c.QUMARK_CODE) {
443
- if (this.expr.charCodeAt(this.index + 1) !== c.PERIOD_CODE)
442
+ if (t === d.QUMARK_CODE) {
443
+ if (this.expr.charCodeAt(this.index + 1) !== d.PERIOD_CODE)
444
444
  break;
445
445
  s = !0, this.index += 2, this.gobbleSpaces(), t = this.code;
446
446
  }
447
- this.index++, t === c.OBRACK_CODE ? (e = {
448
- type: c.MEMBER_EXP,
447
+ this.index++, t === d.OBRACK_CODE ? (e = {
448
+ type: d.MEMBER_EXP,
449
449
  computed: !0,
450
450
  object: e,
451
451
  property: this.gobbleExpression()
452
- }, e.property || this.throwError('Unexpected "' + this.char + '"'), this.gobbleSpaces(), t = this.code, t !== c.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : t === c.OPAREN_CODE ? e = {
453
- type: c.CALL_EXP,
454
- arguments: this.gobbleArguments(c.CPAREN_CODE),
452
+ }, e.property || this.throwError('Unexpected "' + this.char + '"'), this.gobbleSpaces(), t = this.code, t !== d.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : t === d.OPAREN_CODE ? e = {
453
+ type: d.CALL_EXP,
454
+ arguments: this.gobbleArguments(d.CPAREN_CODE),
455
455
  callee: e
456
- } : (t === c.PERIOD_CODE || s) && (s && this.index--, this.gobbleSpaces(), e = {
457
- type: c.MEMBER_EXP,
456
+ } : (t === d.PERIOD_CODE || s) && (s && this.index--, this.gobbleSpaces(), e = {
457
+ type: d.MEMBER_EXP,
458
458
  computed: !1,
459
459
  object: e,
460
460
  property: this.gobbleIdentifier()
@@ -469,18 +469,18 @@ class c {
469
469
  */
470
470
  gobbleNumericLiteral() {
471
471
  let e = "", t, s;
472
- for (; c.isDecimalDigit(this.code); )
472
+ for (; d.isDecimalDigit(this.code); )
473
473
  e += this.expr.charAt(this.index++);
474
- if (this.code === c.PERIOD_CODE)
475
- for (e += this.expr.charAt(this.index++); c.isDecimalDigit(this.code); )
474
+ if (this.code === d.PERIOD_CODE)
475
+ for (e += this.expr.charAt(this.index++); d.isDecimalDigit(this.code); )
476
476
  e += this.expr.charAt(this.index++);
477
477
  if (t = this.char, t === "e" || t === "E") {
478
- for (e += this.expr.charAt(this.index++), t = this.char, (t === "+" || t === "-") && (e += this.expr.charAt(this.index++)); c.isDecimalDigit(this.code); )
478
+ for (e += this.expr.charAt(this.index++), t = this.char, (t === "+" || t === "-") && (e += this.expr.charAt(this.index++)); d.isDecimalDigit(this.code); )
479
479
  e += this.expr.charAt(this.index++);
480
- c.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" + e + this.char + ")");
480
+ d.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" + e + this.char + ")");
481
481
  }
482
- return s = this.code, c.isIdentifierStart(s) ? this.throwError("Variable names cannot start with a number (" + e + this.char + ")") : (s === c.PERIOD_CODE || e.length === 1 && e.charCodeAt(0) === c.PERIOD_CODE) && this.throwError("Unexpected period"), {
483
- type: c.LITERAL,
482
+ return s = this.code, d.isIdentifierStart(s) ? this.throwError("Variable names cannot start with a number (" + e + this.char + ")") : (s === d.PERIOD_CODE || e.length === 1 && e.charCodeAt(0) === d.PERIOD_CODE) && this.throwError("Unexpected period"), {
483
+ type: d.LITERAL,
484
484
  value: parseFloat(e),
485
485
  raw: e
486
486
  };
@@ -527,7 +527,7 @@ class c {
527
527
  e += o;
528
528
  }
529
529
  return n || this.throwError('Unclosed quote after "' + e + '"'), {
530
- type: c.LITERAL,
530
+ type: d.LITERAL,
531
531
  value: e,
532
532
  raw: this.expr.substring(t, this.index)
533
533
  };
@@ -541,10 +541,10 @@ class c {
541
541
  */
542
542
  gobbleIdentifier() {
543
543
  let e = this.code, t = this.index;
544
- for (c.isIdentifierStart(e) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e = this.code, c.isIdentifierPart(e)); )
544
+ for (d.isIdentifierStart(e) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e = this.code, d.isIdentifierPart(e)); )
545
545
  this.index++;
546
546
  return {
547
- type: c.IDENTIFIER,
547
+ type: d.IDENTIFIER,
548
548
  name: this.expr.slice(t, this.index)
549
549
  };
550
550
  }
@@ -564,13 +564,13 @@ class c {
564
564
  this.gobbleSpaces();
565
565
  let o = this.code;
566
566
  if (o === e) {
567
- s = !0, this.index++, e === c.CPAREN_CODE && n && n >= t.length && this.throwError("Unexpected token " + String.fromCharCode(e));
567
+ s = !0, this.index++, e === d.CPAREN_CODE && n && n >= t.length && this.throwError("Unexpected token " + String.fromCharCode(e));
568
568
  break;
569
- } else if (o === c.COMMA_CODE) {
569
+ } else if (o === d.COMMA_CODE) {
570
570
  if (this.index++, n++, n !== t.length) {
571
- if (e === c.CPAREN_CODE)
571
+ if (e === d.CPAREN_CODE)
572
572
  this.throwError("Unexpected token ,");
573
- else if (e === c.CBRACK_CODE)
573
+ else if (e === d.CBRACK_CODE)
574
574
  for (let i = t.length; i < n; i++)
575
575
  t.push(null);
576
576
  }
@@ -578,7 +578,7 @@ class c {
578
578
  this.throwError("Expected comma");
579
579
  else {
580
580
  const i = this.gobbleExpression();
581
- (!i || i.type === c.COMPOUND) && this.throwError("Expected comma"), t.push(i);
581
+ (!i || i.type === d.COMPOUND) && this.throwError("Expected comma"), t.push(i);
582
582
  }
583
583
  }
584
584
  return s || this.throwError("Expected " + String.fromCharCode(e)), t;
@@ -594,10 +594,10 @@ class c {
594
594
  */
595
595
  gobbleGroup() {
596
596
  this.index++;
597
- let e = this.gobbleExpressions(c.CPAREN_CODE);
598
- if (this.code === c.CPAREN_CODE)
597
+ let e = this.gobbleExpressions(d.CPAREN_CODE);
598
+ if (this.code === d.CPAREN_CODE)
599
599
  return this.index++, e.length === 1 ? e[0] : e.length ? {
600
- type: c.SEQUENCE_EXP,
600
+ type: d.SEQUENCE_EXP,
601
601
  expressions: e
602
602
  } : !1;
603
603
  this.throwError("Unclosed (");
@@ -610,15 +610,15 @@ class c {
610
610
  */
611
611
  gobbleArray() {
612
612
  return this.index++, {
613
- type: c.ARRAY_EXP,
614
- elements: this.gobbleArguments(c.CBRACK_CODE)
613
+ type: d.ARRAY_EXP,
614
+ elements: this.gobbleArguments(d.CBRACK_CODE)
615
615
  };
616
616
  }
617
617
  }
618
618
  const tt = new Je();
619
- Object.assign(c, {
619
+ Object.assign(d, {
620
620
  hooks: tt,
621
- plugins: new et(c),
621
+ plugins: new et(d),
622
622
  // Node Types
623
623
  // ----------
624
624
  // This is the full set of types that any JSEP node can be.
@@ -712,14 +712,14 @@ Object.assign(c, {
712
712
  // Except for `this`, which is special. This could be changed to something like `'self'` as well
713
713
  this_str: "this"
714
714
  });
715
- c.max_unop_len = c.getMaxKeyLen(c.unary_ops);
716
- c.max_binop_len = c.getMaxKeyLen(c.binary_ops);
717
- const te = (r) => new c(r).parse(), rt = Object.getOwnPropertyNames(class {
715
+ d.max_unop_len = d.getMaxKeyLen(d.unary_ops);
716
+ d.max_binop_len = d.getMaxKeyLen(d.binary_ops);
717
+ const J = (r) => new d(r).parse(), rt = Object.getOwnPropertyNames(class {
718
718
  });
719
- Object.getOwnPropertyNames(c).filter((r) => !rt.includes(r) && te[r] === void 0).forEach((r) => {
720
- te[r] = c[r];
719
+ Object.getOwnPropertyNames(d).filter((r) => !rt.includes(r) && J[r] === void 0).forEach((r) => {
720
+ J[r] = d[r];
721
721
  });
722
- te.Jsep = c;
722
+ J.Jsep = d;
723
723
  const nt = "ConditionalExpression";
724
724
  var st = {
725
725
  name: "ternary",
@@ -748,17 +748,17 @@ var st = {
748
748
  });
749
749
  }
750
750
  };
751
- te.plugins.register(st);
752
- const Ie = 47, ot = 92;
751
+ J.plugins.register(st);
752
+ const Se = 47, ot = 92;
753
753
  var it = {
754
754
  name: "regex",
755
755
  init(r) {
756
756
  r.hooks.add("gobble-token", function(t) {
757
- if (this.code === Ie) {
757
+ if (this.code === Se) {
758
758
  const s = ++this.index;
759
759
  let n = !1;
760
760
  for (; this.index < this.expr.length; ) {
761
- if (this.code === Ie && !n) {
761
+ if (this.code === Se && !n) {
762
762
  const o = this.expr.slice(s, this.index);
763
763
  let i = "";
764
764
  for (; ++this.index < this.expr.length; ) {
@@ -787,27 +787,27 @@ var it = {
787
787
  });
788
788
  }
789
789
  };
790
- const Ne = 43, at = 45, ce = {
790
+ const ke = 43, at = 45, fe = {
791
791
  name: "assignment",
792
792
  assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
793
- updateOperators: [Ne, at],
793
+ updateOperators: [ke, at],
794
794
  assignmentPrecedence: 0.9,
795
795
  init(r) {
796
796
  const e = [r.IDENTIFIER, r.MEMBER_EXP];
797
- ce.assignmentOperators.forEach((s) => r.addBinaryOp(s, ce.assignmentPrecedence, !0)), r.hooks.add("gobble-token", function(n) {
797
+ fe.assignmentOperators.forEach((s) => r.addBinaryOp(s, fe.assignmentPrecedence, !0)), r.hooks.add("gobble-token", function(n) {
798
798
  const o = this.code;
799
- ce.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, n.node = {
799
+ fe.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, n.node = {
800
800
  type: "UpdateExpression",
801
- operator: o === Ne ? "++" : "--",
801
+ operator: o === ke ? "++" : "--",
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
- 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 = {
808
+ fe.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 === Ne ? "++" : "--",
810
+ operator: o === ke ? "++" : "--",
811
811
  argument: n.node,
812
812
  prefix: !1
813
813
  });
@@ -816,17 +816,17 @@ const Ne = 43, at = 45, ce = {
816
816
  n.node && t(n.node);
817
817
  });
818
818
  function t(s) {
819
- ce.assignmentOperators.has(s.operator) ? (s.type = "AssignmentExpression", t(s.left), t(s.right)) : s.operator || Object.values(s).forEach((n) => {
819
+ fe.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
- 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 = {
825
+ J.plugins.register(it, fe);
826
+ J.addUnaryOp("typeof");
827
+ J.addLiteral("null", null);
828
+ J.addLiteral("undefined", void 0);
829
+ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]), R = {
830
830
  /**
831
831
  * @param {jsep.Expression} ast
832
832
  * @param {Record<string, any>} subs
@@ -835,25 +835,25 @@ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
835
835
  switch (r.type) {
836
836
  case "BinaryExpression":
837
837
  case "LogicalExpression":
838
- return M.evalBinaryExpression(r, e);
838
+ return R.evalBinaryExpression(r, e);
839
839
  case "Compound":
840
- return M.evalCompound(r, e);
840
+ return R.evalCompound(r, e);
841
841
  case "ConditionalExpression":
842
- return M.evalConditionalExpression(r, e);
842
+ return R.evalConditionalExpression(r, e);
843
843
  case "Identifier":
844
- return M.evalIdentifier(r, e);
844
+ return R.evalIdentifier(r, e);
845
845
  case "Literal":
846
- return M.evalLiteral(r, e);
846
+ return R.evalLiteral(r, e);
847
847
  case "MemberExpression":
848
- return M.evalMemberExpression(r, e);
848
+ return R.evalMemberExpression(r, e);
849
849
  case "UnaryExpression":
850
- return M.evalUnaryExpression(r, e);
850
+ return R.evalUnaryExpression(r, e);
851
851
  case "ArrayExpression":
852
- return M.evalArrayExpression(r, e);
852
+ return R.evalArrayExpression(r, e);
853
853
  case "CallExpression":
854
- return M.evalCallExpression(r, e);
854
+ return R.evalCallExpression(r, e);
855
855
  case "AssignmentExpression":
856
- return M.evalAssignmentExpression(r, e);
856
+ return R.evalAssignmentExpression(r, e);
857
857
  default:
858
858
  throw SyntaxError("Unexpected expression", r);
859
859
  }
@@ -883,19 +883,19 @@ const lt = /* @__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](M.evalAst(r.left, e), () => M.evalAst(r.right, e));
886
+ }[r.operator](R.evalAst(r.left, e), () => R.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 = M.evalAst(n, e);
893
+ t = R.evalAst(n, e);
894
894
  }
895
895
  return t;
896
896
  },
897
897
  evalConditionalExpression(r, e) {
898
- return M.evalAst(r.test, e) ? M.evalAst(r.consequent, e) : M.evalAst(r.alternate, e);
898
+ return R.evalAst(r.test, e) ? R.evalAst(r.consequent, e) : R.evalAst(r.alternate, e);
899
899
  },
900
900
  evalIdentifier(r, e) {
901
901
  if (Object.hasOwn(e, r.name))
@@ -910,9 +910,9 @@ const lt = /* @__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 ? M.evalAst(r.property) : r.property.name
913
+ r.computed ? R.evalAst(r.property) : r.property.name
914
914
  // `object.property` property is Identifier
915
- ), s = M.evalAst(r.object, e);
915
+ ), s = R.evalAst(r.object, e);
916
916
  if (s == null)
917
917
  throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);
918
918
  if (!Object.hasOwn(s, t) && lt.has(t))
@@ -922,25 +922,25 @@ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
922
922
  },
923
923
  evalUnaryExpression(r, e) {
924
924
  return {
925
- "-": (s) => -M.evalAst(s, e),
926
- "!": (s) => !M.evalAst(s, e),
927
- "~": (s) => ~M.evalAst(s, e),
925
+ "-": (s) => -R.evalAst(s, e),
926
+ "!": (s) => !R.evalAst(s, e),
927
+ "~": (s) => ~R.evalAst(s, e),
928
928
  // eslint-disable-next-line no-implicit-coercion -- API
929
- "+": (s) => +M.evalAst(s, e),
930
- typeof: (s) => typeof M.evalAst(s, e)
929
+ "+": (s) => +R.evalAst(s, e),
930
+ typeof: (s) => typeof R.evalAst(s, e)
931
931
  }[r.operator](r.argument);
932
932
  },
933
933
  evalArrayExpression(r, e) {
934
- return r.elements.map((t) => M.evalAst(t, e));
934
+ return r.elements.map((t) => R.evalAst(t, e));
935
935
  },
936
936
  evalCallExpression(r, e) {
937
- const t = r.arguments.map((n) => M.evalAst(n, e));
938
- return M.evalAst(r.callee, e)(...t);
937
+ const t = r.arguments.map((n) => R.evalAst(n, e));
938
+ return R.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 = M.evalAst(r.right, e);
943
+ const t = r.left.name, s = R.evalAst(r.right, e);
944
944
  return e[t] = s, e[t];
945
945
  }
946
946
  };
@@ -949,7 +949,7 @@ class ut {
949
949
  * @param {string} expr Expression to evaluate
950
950
  */
951
951
  constructor(e) {
952
- this.code = e, this.ast = te(this.code);
952
+ this.code = e, this.ast = J(this.code);
953
953
  }
954
954
  /**
955
955
  * @param {object} context Object whose items will be added
@@ -958,13 +958,13 @@ class ut {
958
958
  */
959
959
  runInNewContext(e) {
960
960
  const t = Object.assign(/* @__PURE__ */ Object.create(null), e);
961
- return M.evalAst(this.ast, t);
961
+ return R.evalAst(this.ast, t);
962
962
  }
963
963
  }
964
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
970
  class ct extends Error {
@@ -975,10 +975,10 @@ class ct 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 B(r, e, t, s, n) {
979
- if (!(this instanceof B))
978
+ function L(r, e, t, s, n) {
979
+ if (!(this instanceof L))
980
980
  try {
981
- return new B(r, e, t, s, n);
981
+ return new L(r, e, t, s, n);
982
982
  } catch (i) {
983
983
  if (!i.avoidNew)
984
984
  throw i;
@@ -999,7 +999,7 @@ function B(r, e, t, s, n) {
999
999
  return u;
1000
1000
  }
1001
1001
  }
1002
- B.prototype.evaluate = function(r, e, t, s) {
1002
+ L.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 @@ B.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 = B.toPathString(r)), !r && r !== "" || !e)
1016
+ if (n = n || null, o = o || null, Array.isArray(r) && (r = L.toPathString(r)), !r && r !== "" || !e)
1017
1017
  return;
1018
- const a = B.toPathArray(r);
1018
+ const a = L.toPathArray(r);
1019
1019
  a[0] === "$" && a.length > 1 && a.shift(), this._hasParentSelector = null;
1020
- const l = this._trace(a, e, ["$"], n, o, t).filter(function(h) {
1021
- return h && !h.isParentSelector;
1020
+ const l = this._trace(a, e, ["$"], n, o, t).filter(function(p) {
1021
+ return p && !p.isParentSelector;
1022
1022
  });
1023
- return l.length ? !u && l.length === 1 && !l[0].hasArrExpr ? this._getPreferredOutput(l[0]) : l.reduce((h, f) => {
1024
- const b = this._getPreferredOutput(f);
1025
- return i && Array.isArray(b) ? h = h.concat(b) : h.push(b), h;
1023
+ return l.length ? !u && l.length === 1 && !l[0].hasArrExpr ? this._getPreferredOutput(l[0]) : l.reduce((p, h) => {
1024
+ const v = this._getPreferredOutput(h);
1025
+ return i && Array.isArray(v) ? p = p.concat(v) : p.push(v), p;
1026
1026
  }, []) : u ? [] : void 0;
1027
1027
  };
1028
- B.prototype._getPreferredOutput = function(r) {
1028
+ L.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 : B.toPathArray(r.path);
1033
- return r.pointer = B.toPointer(t), r.path = typeof r.path == "string" ? r.path : B.toPathString(r.path), r;
1032
+ const t = Array.isArray(r.path) ? r.path : L.toPathArray(r.path);
1033
+ return r.pointer = L.toPointer(t), r.path = typeof r.path == "string" ? r.path : L.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 B.toPathString(r[e]);
1040
+ return L.toPathString(r[e]);
1041
1041
  case "pointer":
1042
- return B.toPointer(r.path);
1042
+ return L.toPointer(r.path);
1043
1043
  default:
1044
1044
  throw new TypeError("Unknown result type");
1045
1045
  }
1046
1046
  };
1047
- B.prototype._handleCallback = function(r, e, t) {
1047
+ L.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 : B.toPathString(r.path), e(s, t, r);
1050
+ r.path = typeof r.path == "string" ? r.path : L.toPathString(r.path), e(s, t, r);
1051
1051
  }
1052
1052
  };
1053
- B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1053
+ L.prototype._trace = function(r, e, t, s, n, o, i, u) {
1054
1054
  let a;
1055
1055
  if (!r.length)
1056
1056
  return a = {
@@ -1060,27 +1060,27 @@ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1060
1060
  parentProperty: n,
1061
1061
  hasArrExpr: i
1062
1062
  }, this._handleCallback(a, o, "value"), a;
1063
- const l = r[0], h = r.slice(1), f = [];
1064
- function b(m) {
1065
- Array.isArray(m) ? m.forEach((w) => {
1066
- f.push(w);
1067
- }) : f.push(m);
1063
+ const l = r[0], p = r.slice(1), h = [];
1064
+ function v(b) {
1065
+ Array.isArray(b) ? b.forEach((A) => {
1066
+ h.push(A);
1067
+ }) : h.push(b);
1068
1068
  }
1069
1069
  if ((typeof l != "string" || u) && e && Object.hasOwn(e, l))
1070
- b(this._trace(h, e[l], re(t, l), e, l, o, i));
1070
+ v(this._trace(p, e[l], re(t, l), e, l, o, i));
1071
1071
  else if (l === "*")
1072
- this._walk(e, (m) => {
1073
- b(this._trace(h, e[m], re(t, m), e, m, o, !0, !0));
1072
+ this._walk(e, (b) => {
1073
+ v(this._trace(p, e[b], re(t, b), e, b, o, !0, !0));
1074
1074
  });
1075
1075
  else if (l === "..")
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));
1076
+ v(this._trace(p, e, t, s, n, o, i)), this._walk(e, (b) => {
1077
+ typeof e[b] == "object" && v(this._trace(r.slice(), e[b], re(t, b), e, b, o, !0));
1078
1078
  });
1079
1079
  else {
1080
1080
  if (l === "^")
1081
1081
  return this._hasParentSelector = !0, {
1082
1082
  path: t.slice(0, -1),
1083
- expr: h,
1083
+ expr: p,
1084
1084
  isParentSelector: !0
1085
1085
  };
1086
1086
  if (l === "~")
@@ -1091,62 +1091,62 @@ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1091
1091
  parentProperty: null
1092
1092
  }, this._handleCallback(a, o, "property"), a;
1093
1093
  if (l === "$")
1094
- b(this._trace(h, e, t, null, null, o, i));
1094
+ v(this._trace(p, e, t, null, null, o, i));
1095
1095
  else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))
1096
- b(this._slice(l, h, e, t, s, n, o));
1096
+ v(this._slice(l, p, 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"), 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));
1100
+ const b = l.replace(/^\?\((.*?)\)$/u, "$1"), A = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(b);
1101
+ A ? this._walk(e, (P) => {
1102
+ const k = [A[2]], S = A[1] ? e[P][A[1]] : e[P];
1103
+ this._trace(k, S, t, s, n, o, !0).length > 0 && v(this._trace(p, e[P], re(t, P), e, P, o, !0));
1104
+ }) : this._walk(e, (P) => {
1105
+ this._eval(b, e[P], P, t, s, n) && v(this._trace(p, e[P], re(t, P), e, P, 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
- b(this._trace(ke(this._eval(l, e, t.at(-1), t.slice(0, -1), s, n), h), e, t, s, n, o, i));
1110
+ v(this._trace(Ae(this._eval(l, e, t.at(-1), t.slice(0, -1), s, n), p), e, t, s, n, o, i));
1111
1111
  } else if (l[0] === "@") {
1112
- let m = !1;
1113
- const w = l.slice(1, -2);
1114
- switch (w) {
1112
+ let b = !1;
1113
+ const A = l.slice(1, -2);
1114
+ switch (A) {
1115
1115
  case "scalar":
1116
- (!e || !["object", "function"].includes(typeof e)) && (m = !0);
1116
+ (!e || !["object", "function"].includes(typeof e)) && (b = !0);
1117
1117
  break;
1118
1118
  case "boolean":
1119
1119
  case "string":
1120
1120
  case "undefined":
1121
1121
  case "function":
1122
- typeof e === w && (m = !0);
1122
+ typeof e === A && (b = !0);
1123
1123
  break;
1124
1124
  case "integer":
1125
- Number.isFinite(e) && !(e % 1) && (m = !0);
1125
+ Number.isFinite(e) && !(e % 1) && (b = !0);
1126
1126
  break;
1127
1127
  case "number":
1128
- Number.isFinite(e) && (m = !0);
1128
+ Number.isFinite(e) && (b = !0);
1129
1129
  break;
1130
1130
  case "nonFinite":
1131
- typeof e == "number" && !Number.isFinite(e) && (m = !0);
1131
+ typeof e == "number" && !Number.isFinite(e) && (b = !0);
1132
1132
  break;
1133
1133
  case "object":
1134
- e && typeof e === w && (m = !0);
1134
+ e && typeof e === A && (b = !0);
1135
1135
  break;
1136
1136
  case "array":
1137
- Array.isArray(e) && (m = !0);
1137
+ Array.isArray(e) && (b = !0);
1138
1138
  break;
1139
1139
  case "other":
1140
- m = this.currOtherTypeCallback(e, t, s, n);
1140
+ b = this.currOtherTypeCallback(e, t, s, n);
1141
1141
  break;
1142
1142
  case "null":
1143
- e === null && (m = !0);
1143
+ e === null && (b = !0);
1144
1144
  break;
1145
1145
  /* c8 ignore next 2 */
1146
1146
  default:
1147
- throw new TypeError("Unknown value type " + w);
1147
+ throw new TypeError("Unknown value type " + A);
1148
1148
  }
1149
- if (m)
1149
+ if (b)
1150
1150
  return a = {
1151
1151
  path: t,
1152
1152
  value: e,
@@ -1154,31 +1154,31 @@ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1154
1154
  parentProperty: n
1155
1155
  }, this._handleCallback(a, o, "value"), a;
1156
1156
  } else if (l[0] === "`" && e && Object.hasOwn(e, l.slice(1))) {
1157
- const m = l.slice(1);
1158
- b(this._trace(h, e[m], re(t, m), e, m, o, i, !0));
1157
+ const b = l.slice(1);
1158
+ v(this._trace(p, e[b], re(t, b), e, b, o, i, !0));
1159
1159
  } else if (l.includes(",")) {
1160
- const m = l.split(",");
1161
- for (const w of m)
1162
- b(this._trace(ke(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));
1160
+ const b = l.split(",");
1161
+ for (const A of b)
1162
+ v(this._trace(Ae(A, p), e, t, s, n, o, !0));
1163
+ } else !u && e && Object.hasOwn(e, l) && v(this._trace(p, e[l], re(t, l), e, l, o, i, !0));
1164
1164
  }
1165
1165
  if (this._hasParentSelector)
1166
- for (let m = 0; m < f.length; 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]);
1166
+ for (let b = 0; b < h.length; b++) {
1167
+ const A = h[b];
1168
+ if (A && A.isParentSelector) {
1169
+ const P = this._trace(A.expr, e, A.path, s, n, o, i);
1170
+ if (Array.isArray(P)) {
1171
+ h[b] = P[0];
1172
+ const k = P.length;
1173
+ for (let S = 1; S < k; S++)
1174
+ b++, h.splice(b, 0, P[S]);
1175
1175
  } else
1176
- f[m] = S;
1176
+ h[b] = P;
1177
1177
  }
1178
1178
  }
1179
- return f;
1179
+ return h;
1180
1180
  };
1181
- B.prototype._walk = function(r, e) {
1181
+ L.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 @@ B.prototype._walk = function(r, e) {
1187
1187
  e(t);
1188
1188
  });
1189
1189
  };
1190
- B.prototype._slice = function(r, e, t, s, n, o, i) {
1190
+ L.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
- let h = a[0] && Number.parseInt(a[0]) || 0, f = a[1] && Number.parseInt(a[1]) || u;
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 b = [];
1197
- for (let m = h; m < f; m += l)
1198
- this._trace(ke(m, e), t, s, n, o, i, !0).forEach((S) => {
1199
- b.push(S);
1194
+ let p = a[0] && Number.parseInt(a[0]) || 0, h = a[1] && Number.parseInt(a[1]) || u;
1195
+ p = p < 0 ? Math.max(0, p + u) : Math.min(u, p), h = h < 0 ? Math.max(0, h + u) : Math.min(u, h);
1196
+ const v = [];
1197
+ for (let b = p; b < h; b += l)
1198
+ this._trace(Ae(b, e), t, s, n, o, i, !0).forEach((P) => {
1199
+ v.push(P);
1200
1200
  });
1201
- return b;
1201
+ return v;
1202
1202
  };
1203
- B.prototype._eval = function(r, e, t, s, n, o) {
1203
+ L.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 = B.toPathString(s.concat([t])));
1206
+ i && (this.currSandbox._$_path = L.toPathString(s.concat([t])));
1207
1207
  const u = this.currEval + "Script:" + r;
1208
- if (!B.cache[u]) {
1208
+ if (!L.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
- B.cache[u] = new this.safeVm.Script(a);
1211
+ L.cache[u] = new this.safeVm.Script(a);
1212
1212
  else if (this.currEval === "native")
1213
- B.cache[u] = new this.vm.Script(a);
1213
+ L.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
- B.cache[u] = new l(a);
1216
+ L.cache[u] = new l(a);
1217
1217
  } else if (typeof this.currEval == "function")
1218
- B.cache[u] = {
1218
+ L.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 B.cache[u].runInNewContext(this.currSandbox);
1225
+ return L.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
- B.cache = {};
1233
- B.toPathString = function(r) {
1232
+ L.cache = {};
1233
+ L.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
- B.toPointer = function(r) {
1240
+ L.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
- B.toPathArray = function(r) {
1247
+ L.toPathArray = function(r) {
1248
1248
  const {
1249
1249
  cache: e
1250
- } = B;
1250
+ } = L;
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,7 +1262,7 @@ B.toPathArray = function(r) {
1262
1262
  });
1263
1263
  return e[r] = n, e[r].concat();
1264
1264
  };
1265
- B.prototype.safeVm = {
1265
+ L.prototype.safeVm = {
1266
1266
  Script: ut
1267
1267
  };
1268
1268
  const dt = function(r, e, t) {
@@ -1289,15 +1289,15 @@ class ft {
1289
1289
  const s = Object.keys(e), n = [];
1290
1290
  dt(s, n, (l) => typeof e[l] == "function");
1291
1291
  const o = s.map((l) => e[l]);
1292
- t = n.reduce((l, h) => {
1293
- let f = e[h].toString();
1294
- return /function/u.test(f) || (f = "function " + f), "var " + h + "=" + f + ";" + l;
1292
+ t = n.reduce((l, p) => {
1293
+ let h = e[p].toString();
1294
+ return /function/u.test(h) || (h = "function " + h), "var " + p + "=" + h + ";" + l;
1295
1295
  }, "") + t, !/(['"])use strict\1/u.test(t) && !s.includes("arguments") && (t = "var arguments = undefined;" + t), t = t.replace(/;\s*$/u, "");
1296
1296
  const u = t.lastIndexOf(";"), a = u !== -1 ? t.slice(0, u + 1) + " return " + t.slice(u + 1) : " return " + t;
1297
1297
  return new Function(...s, a)(...o);
1298
1298
  }
1299
1299
  }
1300
- B.prototype.vm = {
1300
+ L.prototype.vm = {
1301
1301
  Script: ft
1302
1302
  };
1303
1303
  const ht = { class: "json-node" }, pt = {
@@ -1306,19 +1306,16 @@ const ht = { class: "json-node" }, pt = {
1306
1306
  }, gt = { class: "json-node__line" }, mt = {
1307
1307
  key: 2,
1308
1308
  class: "json-node__colon"
1309
- }, yt = ["title"], bt = {
1310
- key: 3,
1311
- class: "json-node__collapsed"
1312
- }, vt = {
1313
- key: 4,
1309
+ }, yt = ["title"], bt = ["title"], vt = {
1310
+ key: 5,
1314
1311
  class: "json-node__comma"
1315
- }, Et = {
1312
+ }, _t = {
1316
1313
  key: 0,
1317
1314
  class: "json-node__children"
1318
- }, _t = { class: "json-node__children-content" }, xt = { class: "json-node__line json-node__closing-bracket" }, Nt = { class: "json-node__bracket" }, At = {
1315
+ }, Et = { class: "json-node__children-content" }, xt = { class: "json-node__line json-node__closing-bracket" }, kt = { class: "json-node__bracket" }, Nt = {
1319
1316
  key: 0,
1320
1317
  class: "json-node__comma"
1321
- }, kt = {
1318
+ }, At = {
1322
1319
  key: 1,
1323
1320
  class: "json-node__primitive"
1324
1321
  }, wt = {
@@ -1341,181 +1338,192 @@ const ht = { class: "json-node" }, pt = {
1341
1338
  },
1342
1339
  emits: ["update:value", "toggle-expand", "copy", "update:key"],
1343
1340
  setup(r, { emit: e }) {
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
1341
+ Oe((c) => ({
1342
+ "35be1c39": c.level,
1343
+ "5e416c24": c.theme.colors.syntaxKey,
1344
+ a0c0ff08: c.theme.colors.hoverBackground,
1345
+ d7c00e92: c.theme.colors.syntaxBracket,
1346
+ "5de67d96": c.theme.colors.collapsedText,
1347
+ "19acdad7": c.theme.colors.collapsedBackground,
1348
+ f54fa6b6: c.theme.colors.collapsedBackgroundHover,
1349
+ "825653bc": c.theme.colors.syntaxString,
1350
+ "934f5d4c": c.theme.colors.syntaxNumber,
1351
+ e06a8f92: c.theme.colors.syntaxBoolean,
1352
+ "4b0b8bd8": c.theme.colors.syntaxNull,
1353
+ "3a19b608": c.theme.colors.background,
1354
+ "4ee8ae8e": c.theme.colors.indentLine
1356
1355
  }));
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(() => {
1356
+ const t = r, s = e, n = Y(!1), o = Y(!1), i = Y(""), u = Y(""), a = Y("string"), l = (c) => c !== null && typeof c == "object" && !Array.isArray(c) && "__protected_number__" in c && Object.keys(c).length === 1, p = (c) => l(c) ? c.__protected_number__ : "", h = V(() => l(t.value) ? !1 : t.value !== null && typeof t.value == "object"), v = V(() => Array.isArray(t.value)), b = V(() => t.path ? t.path : t.keyName ? t.keyName : "root"), A = V(() => t.expanded.has(b.value)), P = V(() => t.keyName), k = V(() => v.value ? "[" : "{"), S = V(() => v.value ? "]" : "}"), F = V(() => {
1358
1357
  if (!t.value) return "";
1359
- const d = Object.keys(t.value).length;
1360
- return f.value ? d > 0 ? ` ${d} items ` : " " : d > 0 ? ` ${d} keys ` : " ";
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
- const d = Object.keys(t.value);
1366
- return d.indexOf(y) === d.length - 1;
1367
- }, I = () => {
1358
+ const f = Object.keys(t.value).length;
1359
+ return v.value ? f > 0 ? ` ${f} items ` : " " : f > 0 ? ` ${f} keys ` : " ";
1360
+ }), Z = V(() => {
1361
+ const c = typeof t.value;
1362
+ return t.value === null ? "json-node__value--null" : c === "boolean" ? "json-node__value--boolean" : c === "number" || l(t.value) ? "json-node__value--number" : c === "string" ? "json-node__value--string" : "";
1363
+ }), g = V(() => o.value ? u.value : t.value === null ? "null" : typeof t.value == "boolean" || typeof t.value == "number" ? String(t.value) : l(t.value) ? p(t.value) : typeof t.value == "string" ? `"${t.value}"` : String(t.value)), m = V(() => "Click to edit, double-click to copy"), O = (c) => t.level === 0 ? c : b.value ? `${b.value}.${c}` : c, $ = (c) => {
1364
+ const f = Object.keys(t.value);
1365
+ return f.indexOf(c) === f.length - 1;
1366
+ }, j = () => {
1368
1367
  s("toggle-expand", b.value);
1369
- }, X = () => {
1368
+ }, H = () => {
1370
1369
  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
- d && (d.focus(), d.select());
1370
+ const c = document.querySelectorAll(".json-node__key-input"), f = c[c.length - 1];
1371
+ f && (f.focus(), f.select());
1373
1372
  }));
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), he(() => {
1376
- const y = document.querySelectorAll(".json-node__value-input"), d = y[y.length - 1];
1377
- d && (d.focus(), d.select());
1373
+ }, G = () => {
1374
+ h.value || (o.value = !0, t.value === null ? a.value = "null" : l(t.value) ? a.value = "protected-number" : typeof t.value == "string" ? a.value = "string" : typeof t.value == "number" ? a.value = "number" : typeof t.value == "boolean" && (a.value = "boolean"), l(t.value) ? u.value = p(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value), he(() => {
1375
+ const c = document.querySelectorAll(".json-node__value-input"), f = c[c.length - 1];
1376
+ f && (f.focus(), f.select());
1378
1377
  }));
1379
- }, Y = () => {
1378
+ }, K = () => {
1380
1379
  if (t.level === 0 || !n.value) return;
1381
- const y = i.value.trim();
1382
- if (!y) {
1383
- ee();
1380
+ const c = i.value.trim();
1381
+ if (!c) {
1382
+ te();
1384
1383
  return;
1385
1384
  }
1386
- if (y === t.keyName) {
1385
+ if (c === t.keyName) {
1387
1386
  n.value = !1;
1388
1387
  return;
1389
1388
  }
1390
- n.value = !1, s("update:key", b.value, y);
1391
- }, Q = () => {
1389
+ n.value = !1, s("update:key", b.value, c);
1390
+ }, ee = () => {
1392
1391
  try {
1393
- let y;
1394
- const d = u.value.trim();
1395
- if (d === "null")
1396
- y = null;
1397
- else if (d === "true" || d === "false")
1398
- y = d === "true";
1399
- else if (!isNaN(Number(d)) && d !== "") {
1400
- const g = Number(d);
1401
- !Number.isSafeInteger(g) || d.length > 15 ? y = { __protected_number__: d } : y = g;
1392
+ let c;
1393
+ const f = u.value.trim();
1394
+ if (a.value === "string")
1395
+ f === "null" ? c = null : f === "true" || f === "false" ? c = f === "true" : c = u.value;
1396
+ else if (a.value === "protected-number")
1397
+ c = { __protected_number__: f };
1398
+ else if (f === "null")
1399
+ c = null;
1400
+ else if (f === "true" || f === "false")
1401
+ c = f === "true";
1402
+ else if (!isNaN(Number(f)) && f !== "") {
1403
+ const w = Number(f);
1404
+ !Number.isSafeInteger(w) || f.length > 15 ? c = { __protected_number__: f } : c = w;
1402
1405
  } else
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;
1406
+ c = u.value;
1407
+ s("update:value", b.value, c), o.value = !1;
1408
+ } catch (c) {
1409
+ console.error("Failed to parse value:", c), o.value = !1;
1407
1410
  }
1408
- }, ee = () => {
1411
+ }, te = () => {
1409
1412
  n.value = !1, i.value = t.keyName;
1410
- }, ae = () => {
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);
1413
+ }, ue = () => {
1414
+ o.value = !1, l(t.value) ? u.value = p(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value);
1412
1415
  };
1413
- return (y, d) => {
1414
- const g = Ue("JsonNode", !0);
1415
- return x(), A("div", ht, [
1416
- h.value ? (x(), A("div", pt, [
1417
- v("div", gt, [
1418
- y.keyName && !n.value ? (x(), A("span", {
1416
+ return (c, f) => {
1417
+ const w = Me("JsonNode", !0);
1418
+ return _(), x("div", ht, [
1419
+ h.value ? (_(), x("div", pt, [
1420
+ y("div", gt, [
1421
+ c.keyName && !n.value ? (_(), x("span", {
1419
1422
  key: 0,
1420
1423
  class: "json-node__key",
1421
- onClick: X,
1424
+ onClick: H,
1422
1425
  title: "Click to edit key"
1423
- }, ' "' + R(w.value) + '" ', 1)) : F("", !0),
1424
- y.keyName && n.value ? _e((x(), A("input", {
1426
+ }, ' "' + B(P.value) + '" ', 1)) : U("", !0),
1427
+ c.keyName && n.value ? Ee((_(), x("input", {
1425
1428
  key: 1,
1426
- "onUpdate:modelValue": d[0] || (d[0] = (k) => i.value = k),
1429
+ "onUpdate:modelValue": f[0] || (f[0] = (E) => i.value = E),
1427
1430
  onKeyup: [
1428
- ue(Y, ["enter"]),
1429
- ue(ee, ["escape"])
1431
+ de(K, ["enter"]),
1432
+ de(te, ["escape"])
1430
1433
  ],
1431
- onBlur: Y,
1434
+ onBlur: K,
1432
1435
  class: "json-node__key-input"
1433
1436
  }, null, 544)), [
1434
1437
  [xe, i.value]
1435
- ]) : F("", !0),
1436
- y.keyName ? (x(), A("span", mt, ": ")) : F("", !0),
1437
- v("span", {
1438
+ ]) : U("", !0),
1439
+ c.keyName ? (_(), x("span", mt, ": ")) : U("", !0),
1440
+ y("span", {
1438
1441
  class: "json-node__bracket json-node__bracket--clickable",
1439
- onClick: I,
1440
- title: m.value ? "Click to collapse" : "Click to expand"
1441
- }, R(S.value), 9, yt),
1442
- m.value ? F("", !0) : (x(), A("span", bt, [
1443
- Se(R(j.value) + " ", 1),
1444
- v("span", {
1445
- class: "json-node__bracket json-node__bracket--clickable",
1446
- onClick: I
1447
- }, R(_.value), 1)
1448
- ])),
1449
- !m.value && !y.isLast ? (x(), A("span", vt, ",")) : F("", !0)
1442
+ onClick: j,
1443
+ title: A.value ? "Click to collapse" : "Click to expand"
1444
+ }, B(k.value), 9, yt),
1445
+ A.value ? U("", !0) : (_(), x("span", {
1446
+ key: 3,
1447
+ class: "json-node__collapsed-info",
1448
+ onClick: j,
1449
+ title: `Click to expand ${F.value.trim()}`
1450
+ }, B(F.value), 9, bt)),
1451
+ A.value ? U("", !0) : (_(), x("span", {
1452
+ key: 4,
1453
+ class: "json-node__bracket json-node__bracket--clickable",
1454
+ onClick: j,
1455
+ title: "Click to expand"
1456
+ }, B(S.value), 1)),
1457
+ !A.value && !c.isLast ? (_(), x("span", vt, ",")) : U("", !0)
1450
1458
  ]),
1451
- m.value ? (x(), A("div", Et, [
1452
- v("div", _t, [
1453
- (x(!0), A(de, null, fe(y.value, (k, N) => (x(), A("div", {
1454
- key: N,
1459
+ A.value ? (_(), x("div", _t, [
1460
+ y("div", Et, [
1461
+ (_(!0), x(ne, null, ie(c.value, (E, T) => (_(), x("div", {
1462
+ key: T,
1455
1463
  class: "json-node__child"
1456
1464
  }, [
1457
- Fe(g, {
1458
- value: k,
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))
1465
+ Ue(w, {
1466
+ value: E,
1467
+ "key-name": v.value ? "" : String(T),
1468
+ level: c.level + 1,
1469
+ path: O(String(T)),
1470
+ expanded: c.expanded,
1471
+ theme: c.theme,
1472
+ "onUpdate:value": f[1] || (f[1] = (C, I) => c.$emit("update:value", C, I)),
1473
+ onToggleExpand: f[2] || (f[2] = (C) => c.$emit("toggle-expand", C)),
1474
+ onCopy: f[3] || (f[3] = (C) => c.$emit("copy", C)),
1475
+ "onUpdate:key": f[4] || (f[4] = (C, I) => c.$emit("update:key", C, I)),
1476
+ "is-last": $(String(T))
1469
1477
  }, null, 8, ["value", "key-name", "level", "path", "expanded", "theme", "is-last"])
1470
1478
  ]))), 128))
1471
1479
  ]),
1472
- v("div", xt, [
1473
- v("span", Nt, R(_.value), 1),
1474
- y.isLast ? F("", !0) : (x(), A("span", At, ","))
1480
+ y("div", xt, [
1481
+ y("span", kt, B(S.value), 1),
1482
+ c.isLast ? U("", !0) : (_(), x("span", Nt, ","))
1475
1483
  ])
1476
- ])) : F("", !0)
1477
- ])) : (x(), A("div", kt, [
1478
- y.keyName && !n.value ? (x(), A("span", {
1484
+ ])) : U("", !0)
1485
+ ])) : (_(), x("div", At, [
1486
+ c.keyName && !n.value ? (_(), x("span", {
1479
1487
  key: 0,
1480
1488
  class: "json-node__key",
1481
- onClick: X,
1489
+ onClick: H,
1482
1490
  title: "Click to edit key"
1483
- }, ' "' + R(w.value) + '" ', 1)) : F("", !0),
1484
- y.keyName && n.value ? _e((x(), A("input", {
1491
+ }, ' "' + B(P.value) + '" ', 1)) : U("", !0),
1492
+ c.keyName && n.value ? Ee((_(), x("input", {
1485
1493
  key: 1,
1486
- "onUpdate:modelValue": d[5] || (d[5] = (k) => i.value = k),
1494
+ "onUpdate:modelValue": f[5] || (f[5] = (E) => i.value = E),
1487
1495
  onKeyup: [
1488
- ue(Y, ["enter"]),
1489
- ue(ee, ["escape"])
1496
+ de(K, ["enter"]),
1497
+ de(te, ["escape"])
1490
1498
  ],
1491
- onBlur: Y,
1499
+ onBlur: K,
1492
1500
  class: "json-node__key-input"
1493
1501
  }, null, 544)), [
1494
1502
  [xe, i.value]
1495
- ]) : F("", !0),
1496
- y.keyName ? (x(), A("span", wt, ": ")) : F("", !0),
1497
- o.value ? F("", !0) : (x(), A("span", {
1503
+ ]) : U("", !0),
1504
+ c.keyName ? (_(), x("span", wt, ": ")) : U("", !0),
1505
+ o.value ? U("", !0) : (_(), x("span", {
1498
1506
  key: 3,
1499
- class: Te(["json-node__value", H.value]),
1500
- onClick: Z,
1501
- onDblclick: d[6] || (d[6] = (k) => y.$emit("copy", y.value)),
1502
- title: $.value
1507
+ class: Te(["json-node__value", Z.value]),
1508
+ onClick: G,
1509
+ onDblclick: f[6] || (f[6] = (E) => c.$emit("copy", c.value)),
1510
+ title: m.value
1503
1511
  }, [
1504
- Se(R(p.value), 1),
1505
- y.isLast ? F("", !0) : (x(), A("span", Ot, ","))
1512
+ De(B(g.value), 1),
1513
+ c.isLast ? U("", !0) : (_(), x("span", Ot, ","))
1506
1514
  ], 42, Ct)),
1507
- o.value ? _e((x(), A("input", {
1515
+ o.value ? Ee((_(), x("input", {
1508
1516
  key: 4,
1509
- "onUpdate:modelValue": d[7] || (d[7] = (k) => u.value = k),
1517
+ "onUpdate:modelValue": f[7] || (f[7] = (E) => u.value = E),
1510
1518
  onKeyup: [
1511
- ue(Q, ["enter"]),
1512
- ue(ae, ["escape"])
1519
+ de(ee, ["enter"]),
1520
+ de(ue, ["escape"])
1513
1521
  ],
1514
- onBlur: Q,
1522
+ onBlur: ee,
1515
1523
  class: "json-node__value-input"
1516
1524
  }, null, 544)), [
1517
1525
  [xe, u.value]
1518
- ]) : F("", !0)
1526
+ ]) : U("", !0)
1519
1527
  ]))
1520
1528
  ]);
1521
1529
  };
@@ -1525,7 +1533,7 @@ const ht = { class: "json-node" }, pt = {
1525
1533
  for (const [s, n] of e)
1526
1534
  t[s] = n;
1527
1535
  return t;
1528
- }, Pt = /* @__PURE__ */ be(Tt, [["__scopeId", "data-v-860beb35"]]), Ke = {
1536
+ }, Pt = /* @__PURE__ */ be(Tt, [["__scopeId", "data-v-58992c45"]]), He = {
1529
1537
  name: "github-light",
1530
1538
  colors: {
1531
1539
  // 背景色
@@ -1557,6 +1565,10 @@ const ht = { class: "json-node" }, pt = {
1557
1565
  syntaxBracket: "#24292f",
1558
1566
  // 悬停效果
1559
1567
  hoverBackground: "#f6f8fa",
1568
+ // 折叠信息样式
1569
+ collapsedBackground: "#ddf4ff",
1570
+ collapsedBackgroundHover: "#b6e3ff",
1571
+ collapsedText: "#0969da",
1560
1572
  // 缩进线
1561
1573
  indentLine: "#d0d7de"
1562
1574
  }
@@ -1592,6 +1604,10 @@ const ht = { class: "json-node" }, pt = {
1592
1604
  syntaxBracket: "#e6edf3",
1593
1605
  // 悬停效果
1594
1606
  hoverBackground: "#161b22",
1607
+ // 折叠信息样式
1608
+ collapsedBackground: "#1c2128",
1609
+ collapsedBackgroundHover: "#2d333b",
1610
+ collapsedText: "#79c0ff",
1595
1611
  // 缩进线
1596
1612
  indentLine: "#30363d"
1597
1613
  }
@@ -1627,10 +1643,14 @@ const ht = { class: "json-node" }, pt = {
1627
1643
  syntaxBracket: "#374151",
1628
1644
  // 悬停效果
1629
1645
  hoverBackground: "#f9f9f9",
1646
+ // 折叠信息样式
1647
+ collapsedBackground: "#e0f2fe",
1648
+ collapsedBackgroundHover: "#bae6fd",
1649
+ collapsedText: "#0284c7",
1630
1650
  // 缩进线
1631
1651
  indentLine: "#e5e7eb"
1632
1652
  }
1633
- }, It = {
1653
+ }, Bt = {
1634
1654
  name: "slack-ochin",
1635
1655
  colors: {
1636
1656
  // 背景色 - 温暖的米色调
@@ -1662,34 +1682,38 @@ const ht = { class: "json-node" }, pt = {
1662
1682
  syntaxBracket: "#6b5444",
1663
1683
  // 悬停效果
1664
1684
  hoverBackground: "#f8f2eb",
1685
+ // 折叠信息样式
1686
+ collapsedBackground: "#ffe8d6",
1687
+ collapsedBackgroundHover: "#ffd4b0",
1688
+ collapsedText: "#d73502",
1665
1689
  // 缩进线
1666
1690
  indentLine: "#e8d5b7"
1667
1691
  }
1668
- }, Bt = {
1669
- "github-light": Ke,
1692
+ }, It = {
1693
+ "github-light": He,
1670
1694
  "github-dark": $t,
1671
1695
  "min-light": St,
1672
- "slack-ochin": It
1696
+ "slack-ochin": Bt
1673
1697
  };
1674
1698
  function Vt(r = "github-light") {
1675
- return Bt[r] || Ke;
1699
+ return It[r] || He;
1676
1700
  }
1677
1701
  const Lt = {
1678
1702
  key: 0,
1679
1703
  class: "json-format__toolbar"
1680
- }, Rt = { class: "json-format__actions" }, jt = ["disabled"], Mt = ["disabled"], Ut = ["disabled"], Ft = ["disabled"], Xt = { class: "json-format__info" }, Ht = {
1704
+ }, jt = { class: "json-format__actions" }, Rt = ["disabled"], Mt = ["disabled"], Ut = ["disabled"], Ft = ["disabled"], Xt = { class: "json-format__info" }, Ht = {
1681
1705
  key: 0,
1682
1706
  class: "json-format__status json-format__status--success"
1683
1707
  }, Kt = {
1684
1708
  key: 1,
1685
1709
  class: "json-format__status json-format__status--error"
1686
- }, qt = { class: "json-format__content" }, Yt = {
1710
+ }, qt = { class: "json-format__content" }, Qt = {
1687
1711
  key: 0,
1688
1712
  class: "json-format__error"
1689
- }, Qt = {
1713
+ }, Wt = {
1690
1714
  key: 1,
1691
1715
  class: "json-format__error"
1692
- }, Wt = {
1716
+ }, Yt = {
1693
1717
  key: 2,
1694
1718
  class: "json-format__viewer"
1695
1719
  }, Gt = /* @__PURE__ */ ye({
@@ -1704,70 +1728,70 @@ const Lt = {
1704
1728
  },
1705
1729
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress"],
1706
1730
  setup(r, { expose: e, emit: t }) {
1707
- Oe((d) => ({
1708
- "325d5f6b": f.value.colors.border,
1709
- "407388ed": f.value.colors.background,
1710
- "1276f42c": f.value.colors.text,
1711
- "34805dc8": f.value.colors.surfaceBackground,
1712
- "212f19fd": f.value.colors.buttonBorder,
1713
- b83cab02: f.value.colors.buttonBackground,
1714
- b58ba984: f.value.colors.buttonText,
1715
- d50a3406: f.value.colors.buttonBackgroundHover,
1716
- "2421bb5e": f.value.colors.buttonPrimary,
1717
- "0299816b": f.value.colors.buttonPrimaryHover,
1718
- "55f370f2": f.value.colors.successBackground,
1719
- b3fc86b8: f.value.colors.success,
1720
- "781064f7": f.value.colors.errorBackground,
1721
- "3b9a02e9": f.value.colors.error
1731
+ Oe((c) => ({
1732
+ "325d5f6b": h.value.colors.border,
1733
+ "407388ed": h.value.colors.background,
1734
+ "1276f42c": h.value.colors.text,
1735
+ "34805dc8": h.value.colors.surfaceBackground,
1736
+ "212f19fd": h.value.colors.buttonBorder,
1737
+ b83cab02: h.value.colors.buttonBackground,
1738
+ b58ba984: h.value.colors.buttonText,
1739
+ d50a3406: h.value.colors.buttonBackgroundHover,
1740
+ "2421bb5e": h.value.colors.buttonPrimary,
1741
+ "0299816b": h.value.colors.buttonPrimaryHover,
1742
+ "55f370f2": h.value.colors.successBackground,
1743
+ b3fc86b8: h.value.colors.success,
1744
+ "781064f7": h.value.colors.errorBackground,
1745
+ "3b9a02e9": h.value.colors.error
1722
1746
  }));
1723
- 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) => {
1724
- if (!d.trim()) {
1747
+ const s = r, n = t, o = Y(null), i = Y(""), u = Y(/* @__PURE__ */ new Set()), a = Y(null), l = Y(""), p = V(() => i.value === ""), h = V(() => Vt(s.theme)), v = V(() => l.value ? null : a.value !== null ? a.value : o.value), b = (c) => {
1748
+ if (!c.trim()) {
1725
1749
  o.value = null, i.value = "", a.value = null, l.value = "";
1726
1750
  return;
1727
1751
  }
1728
1752
  try {
1729
- let g = d;
1730
- const k = /(:\s*|,\s*|\[\s*)-?\d{16,}/.test(g), N = /(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(g);
1731
- if (!k && !N)
1753
+ let f = c;
1754
+ const w = /(:\s*|,\s*|\[\s*)-?\d{16,}/.test(f), E = /(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(f);
1755
+ if (!w && !E)
1732
1756
  try {
1733
- o.value = JSON.parse(g), i.value = "", a.value = null, l.value = "", he(() => {
1734
- b.value !== null && $();
1757
+ o.value = JSON.parse(f), i.value = "", a.value = null, l.value = "", he(() => {
1758
+ v.value !== null && g();
1735
1759
  });
1736
1760
  return;
1737
1761
  } catch {
1738
1762
  }
1739
- g = ((T) => {
1740
- let L = "", K = !1, q = !1, J = 0;
1741
- for (; J < T.length; ) {
1742
- const le = T[J];
1743
- if (K)
1744
- q ? q = !1 : le === "\\" ? q = !0 : le === '"' && (K = !1), L += le, J++;
1745
- else if (le === '"')
1746
- K = !0, L += le, J++;
1763
+ f = ((C) => {
1764
+ let I = "", X = !1, q = !1, D = 0;
1765
+ for (; D < C.length; ) {
1766
+ const ce = C[D];
1767
+ if (X)
1768
+ q ? q = !1 : ce === "\\" ? q = !0 : ce === '"' && (X = !1), I += ce, D++;
1769
+ else if (ce === '"')
1770
+ X = !0, I += ce, D++;
1747
1771
  else {
1748
- const $e = T.slice(J);
1749
- let D = $e.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);
1750
- if (D) {
1751
- L += D[1] + '{"__protected_number__":"' + D[2] + '"}' + D[3], J += D[0].length;
1772
+ const $e = C.slice(D);
1773
+ let z = $e.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);
1774
+ if (z) {
1775
+ I += z[1] + '{"__protected_number__":"' + z[2] + '"}' + z[3], D += z[0].length;
1752
1776
  continue;
1753
1777
  }
1754
- if (D = $e.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/), D) {
1755
- L += D[1] + '{"__protected_number__":"' + D[2] + '"}' + D[3], J += D[0].length;
1778
+ if (z = $e.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/), z) {
1779
+ I += z[1] + '{"__protected_number__":"' + z[2] + '"}' + z[3], D += z[0].length;
1756
1780
  continue;
1757
1781
  }
1758
- L += le, J++;
1782
+ I += ce, D++;
1759
1783
  }
1760
1784
  }
1761
- return L;
1762
- })(g), o.value = JSON.parse(g), i.value = "", a.value = null, l.value = "", he(() => {
1763
- b.value !== null && $();
1785
+ return I;
1786
+ })(f), o.value = JSON.parse(f), i.value = "", a.value = null, l.value = "", he(() => {
1787
+ v.value !== null && g();
1764
1788
  });
1765
- } catch (g) {
1766
- i.value = g instanceof Error ? g.message : "Unknown parsing error", o.value = null, a.value = null, l.value = "";
1789
+ } catch (f) {
1790
+ i.value = f instanceof Error ? f.message : "Unknown parsing error", o.value = null, a.value = null, l.value = "";
1767
1791
  }
1768
- }, w = (d) => {
1769
- if (!d || !d.expression.trim()) {
1770
- S();
1792
+ }, A = (c) => {
1793
+ if (!c || !c.expression.trim()) {
1794
+ P();
1771
1795
  return;
1772
1796
  }
1773
1797
  if (!o.value) {
@@ -1775,243 +1799,243 @@ const Lt = {
1775
1799
  return;
1776
1800
  }
1777
1801
  try {
1778
- let g;
1779
- if (d.type === "jsonpath")
1780
- 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;
1781
- else if (d.type === "js")
1782
- g = new Function("data", `
1802
+ let f;
1803
+ if (c.type === "jsonpath")
1804
+ f = L({ path: c.expression, json: o.value }), f.length === 1 && c.expression.includes("$[") === !1 && !c.expression.endsWith("[*]") ? a.value = f[0] : a.value = f;
1805
+ else if (c.type === "js")
1806
+ f = new Function("data", `
1783
1807
  try {
1784
- return ${d.expression};
1808
+ return ${c.expression};
1785
1809
  } catch (error) {
1786
1810
  throw new Error('JavaScript expression error: ' + error.message);
1787
1811
  }
1788
- `)(o.value), a.value = g;
1812
+ `)(o.value), a.value = f;
1789
1813
  else
1790
- throw new Error(`Unsupported filter type: ${d.type}`);
1814
+ throw new Error(`Unsupported filter type: ${c.type}`);
1791
1815
  l.value = "", he(() => {
1792
- $();
1816
+ g();
1793
1817
  });
1794
- } catch (g) {
1795
- l.value = g instanceof Error ? g.message : "Filter execution error", a.value = null;
1818
+ } catch (f) {
1819
+ l.value = f instanceof Error ? f.message : "Filter execution error", a.value = null;
1796
1820
  }
1797
- }, S = () => {
1821
+ }, P = () => {
1798
1822
  a.value = null, l.value = "";
1799
1823
  };
1800
- Xe(() => s.modelValue, (d) => {
1801
- m(d);
1824
+ Fe(() => s.modelValue, (c) => {
1825
+ b(c);
1802
1826
  }, { immediate: !0 });
1803
- const _ = (d, g, k) => {
1804
- const N = (L) => {
1805
- if (L === null || typeof L != "object")
1806
- return L;
1807
- if (!Array.isArray(L) && "__protected_number__" in L && Object.keys(L).length === 1)
1808
- return `__PROTECTED_NUMBER_${L.__protected_number__}_PROTECTED_NUMBER__`;
1809
- if (Array.isArray(L))
1810
- return L.map((q) => N(q));
1811
- const K = {};
1812
- for (const [q, J] of Object.entries(L))
1813
- K[q] = N(J);
1814
- return K;
1815
- }, C = N(d);
1816
- return JSON.stringify(C, g, k).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g, "$1");
1817
- }, j = (d, g) => {
1827
+ const k = (c, f, w) => {
1828
+ const E = (I) => {
1829
+ if (I === null || typeof I != "object")
1830
+ return I;
1831
+ if (!Array.isArray(I) && "__protected_number__" in I && Object.keys(I).length === 1)
1832
+ return `__PROTECTED_NUMBER_${I.__protected_number__}_PROTECTED_NUMBER__`;
1833
+ if (Array.isArray(I))
1834
+ return I.map((q) => E(q));
1835
+ const X = {};
1836
+ for (const [q, D] of Object.entries(I))
1837
+ X[q] = E(D);
1838
+ return X;
1839
+ }, T = E(c);
1840
+ return JSON.stringify(T, f, w).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g, "$1");
1841
+ }, S = (c, f) => {
1818
1842
  if (!s.readonly)
1819
1843
  try {
1820
- const k = H(o.value, d, g), N = _(k, null, 2);
1821
- n("update:modelValue", N);
1822
- } catch (k) {
1823
- console.error("Failed to update JSON:", k);
1844
+ const w = F(o.value, c, f), E = k(w, null, 2);
1845
+ n("update:modelValue", E);
1846
+ } catch (w) {
1847
+ console.error("Failed to update JSON:", w);
1824
1848
  }
1825
- }, H = (d, g, k) => {
1826
- if (!g || g === "root") return k;
1827
- const N = g.split("."), C = Q(d, N.slice(0, -1));
1828
- let T = C;
1829
- for (let K = 0; K < N.length - 1; K++) {
1830
- const q = N[K];
1831
- q !== "root" && (Array.isArray(T) ? T = T[parseInt(q)] : T = T[q]);
1849
+ }, F = (c, f, w) => {
1850
+ if (!f || f === "root") return w;
1851
+ const E = f.split("."), T = K(c, E.slice(0, -1));
1852
+ let C = T;
1853
+ for (let X = 0; X < E.length - 1; X++) {
1854
+ const q = E[X];
1855
+ q !== "root" && (Array.isArray(C) ? C = C[parseInt(q)] : C = C[q]);
1832
1856
  }
1833
- const L = N[N.length - 1];
1834
- return L === "root" ? k : (Array.isArray(T) ? T[parseInt(L)] = k : T[L] = k, C);
1835
- }, p = (d) => {
1836
- u.value.has(d) ? u.value.delete(d) : u.value.add(d);
1837
- }, $ = () => {
1838
- const d = /* @__PURE__ */ new Set(), g = (k, N = "") => {
1839
- k !== null && typeof k == "object" && (d.add(N || "root"), Array.isArray(k) ? k.forEach((C, T) => {
1840
- const L = N ? `${N}.${T}` : `${T}`;
1841
- g(C, L);
1842
- }) : Object.keys(k).forEach((C) => {
1843
- const T = N ? `${N}.${C}` : C;
1844
- g(k[C], T);
1857
+ const I = E[E.length - 1];
1858
+ return I === "root" ? w : (Array.isArray(C) ? C[parseInt(I)] = w : C[I] = w, T);
1859
+ }, Z = (c) => {
1860
+ u.value.has(c) ? u.value.delete(c) : u.value.add(c);
1861
+ }, g = () => {
1862
+ const c = /* @__PURE__ */ new Set(), f = (w, E = "") => {
1863
+ w !== null && typeof w == "object" && (c.add(E || "root"), Array.isArray(w) ? w.forEach((T, C) => {
1864
+ const I = E ? `${E}.${C}` : `${C}`;
1865
+ f(T, I);
1866
+ }) : Object.keys(w).forEach((T) => {
1867
+ const C = E ? `${E}.${T}` : T;
1868
+ f(w[T], C);
1845
1869
  }));
1846
1870
  };
1847
- g(b.value), u.value = d, n("expand-all");
1848
- }, E = () => {
1871
+ f(v.value), u.value = c, n("expand-all");
1872
+ }, m = () => {
1849
1873
  u.value = /* @__PURE__ */ new Set(["root"]), n("collapse-all");
1850
1874
  }, O = async () => {
1851
- if (h.value)
1875
+ if (p.value)
1852
1876
  try {
1853
- const d = b.value, g = _(d, null, 2);
1854
- await navigator.clipboard.writeText(g), n("copy-success", g);
1855
- } catch (d) {
1856
- console.error("Failed to copy JSON:", d), n("copy-error", d instanceof Error ? d : new Error("Failed to copy JSON"));
1877
+ const c = v.value, f = k(c, null, 2);
1878
+ await navigator.clipboard.writeText(f), n("copy-success", f);
1879
+ } catch (c) {
1880
+ console.error("Failed to copy JSON:", c), n("copy-error", c instanceof Error ? c : new Error("Failed to copy JSON"));
1857
1881
  }
1858
- }, I = () => {
1859
- if (h.value)
1882
+ }, $ = () => {
1883
+ if (p.value)
1860
1884
  try {
1861
- const d = b.value, g = _(d);
1862
- n("update:modelValue", g), n("compress", g);
1863
- } catch (d) {
1864
- console.error("Failed to compress JSON:", d);
1885
+ const c = v.value, f = k(c);
1886
+ n("update:modelValue", f), n("compress", f);
1887
+ } catch (c) {
1888
+ console.error("Failed to compress JSON:", c);
1865
1889
  }
1866
- }, X = async (d) => {
1890
+ }, j = async (c) => {
1867
1891
  try {
1868
- let g;
1869
- 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);
1870
- } catch (g) {
1871
- console.error("Failed to copy value:", g);
1892
+ let f;
1893
+ typeof c == "object" && c !== null && !Array.isArray(c) && "__protected_number__" in c && Object.keys(c).length === 1 ? f = c.__protected_number__ : typeof c == "string" ? f = `"${c}"` : f = JSON.stringify(c), await navigator.clipboard.writeText(f);
1894
+ } catch (f) {
1895
+ console.error("Failed to copy value:", f);
1872
1896
  }
1873
- }, Z = (d, g) => {
1897
+ }, H = (c, f) => {
1874
1898
  if (!s.readonly)
1875
1899
  try {
1876
- const k = Y(o.value, d, g), N = _(k, null, 2);
1877
- n("update:modelValue", N), y(d, g);
1878
- } catch (k) {
1879
- console.error("Failed to rename key:", k);
1900
+ const w = G(o.value, c, f), E = k(w, null, 2);
1901
+ n("update:modelValue", E), ue(c, f);
1902
+ } catch (w) {
1903
+ console.error("Failed to rename key:", w);
1880
1904
  }
1881
- }, Y = (d, g, k) => {
1882
- if (!g || g === "root") return d;
1883
- const N = g.split("."), C = Q(d, N.slice(0, -1));
1884
- if (N.length === 1) {
1885
- const K = N[0];
1886
- return C && typeof C == "object" && !Array.isArray(C) ? ee(C, K, k) : C;
1905
+ }, G = (c, f, w) => {
1906
+ if (!f || f === "root") return c;
1907
+ const E = f.split("."), T = K(c, E.slice(0, -1));
1908
+ if (E.length === 1) {
1909
+ const X = E[0];
1910
+ return T && typeof T == "object" && !Array.isArray(T) ? ee(T, X, w) : T;
1887
1911
  }
1888
- let T = C;
1889
- for (let K = 0; K < N.length - 1; K++) {
1890
- const q = N[K];
1891
- Array.isArray(T) ? T = T[parseInt(q)] : T = T[q];
1912
+ let C = T;
1913
+ for (let X = 0; X < E.length - 1; X++) {
1914
+ const q = E[X];
1915
+ Array.isArray(C) ? C = C[parseInt(q)] : C = C[q];
1892
1916
  }
1893
- const L = N[N.length - 1];
1894
- if (!Array.isArray(T) && T && typeof T == "object") {
1895
- const K = ee(T, L, k), q = N.slice(0, -1);
1896
- q.length > 0 && ae(C, q, K);
1917
+ const I = E[E.length - 1];
1918
+ if (!Array.isArray(C) && C && typeof C == "object") {
1919
+ const X = ee(C, I, w), q = E.slice(0, -1);
1920
+ q.length > 0 && te(T, q, X);
1897
1921
  }
1898
- return C;
1899
- }, Q = (d, g) => {
1900
- if (g.length === 0) return d;
1901
- if (Array.isArray(d)) {
1902
- const k = [...d], N = g[0], C = parseInt(N);
1903
- return g.length === 1 || (k[C] = Q(d[C], g.slice(1))), k;
1904
- } else if (d && typeof d == "object") {
1905
- const k = { ...d }, N = g[0];
1906
- return g.length === 1 || (k[N] = Q(d[N], g.slice(1))), k;
1922
+ return T;
1923
+ }, K = (c, f) => {
1924
+ if (f.length === 0) return c;
1925
+ if (Array.isArray(c)) {
1926
+ const w = [...c], E = f[0], T = parseInt(E);
1927
+ return f.length === 1 || (w[T] = K(c[T], f.slice(1))), w;
1928
+ } else if (c && typeof c == "object") {
1929
+ const w = { ...c }, E = f[0];
1930
+ return f.length === 1 || (w[E] = K(c[E], f.slice(1))), w;
1907
1931
  }
1908
- return d;
1909
- }, ee = (d, g, k) => {
1910
- if (!d || typeof d != "object" || Array.isArray(d))
1911
- return d;
1912
- const N = Object.keys(d), C = {};
1913
- for (const T of N)
1914
- T === g ? C[k] = d[T] : C[T] = d[T];
1915
- return C;
1916
- }, ae = (d, g, k) => {
1917
- let N = d;
1918
- for (let T = 0; T < g.length - 1; T++) {
1919
- const L = g[T];
1920
- Array.isArray(N) ? N = N[parseInt(L)] : N = N[L];
1932
+ return c;
1933
+ }, ee = (c, f, w) => {
1934
+ if (!c || typeof c != "object" || Array.isArray(c))
1935
+ return c;
1936
+ const E = Object.keys(c), T = {};
1937
+ for (const C of E)
1938
+ C === f ? T[w] = c[C] : T[C] = c[C];
1939
+ return T;
1940
+ }, te = (c, f, w) => {
1941
+ let E = c;
1942
+ for (let C = 0; C < f.length - 1; C++) {
1943
+ const I = f[C];
1944
+ Array.isArray(E) ? E = E[parseInt(I)] : E = E[I];
1921
1945
  }
1922
- const C = g[g.length - 1];
1923
- Array.isArray(N) ? N[parseInt(C)] = k : N[C] = k;
1924
- }, y = (d, g) => {
1925
- const k = /* @__PURE__ */ new Set();
1926
- u.value.forEach((N) => {
1927
- if (N === d) {
1928
- const C = d.split(".");
1929
- C[C.length - 1] = g, k.add(C.join("."));
1930
- } else if (N.startsWith(d + ".")) {
1931
- const C = d.split(".");
1932
- C[C.length - 1] = g;
1933
- const T = C.join("."), L = N.substring(d.length);
1934
- k.add(T + L);
1946
+ const T = f[f.length - 1];
1947
+ Array.isArray(E) ? E[parseInt(T)] = w : E[T] = w;
1948
+ }, ue = (c, f) => {
1949
+ const w = /* @__PURE__ */ new Set();
1950
+ u.value.forEach((E) => {
1951
+ if (E === c) {
1952
+ const T = c.split(".");
1953
+ T[T.length - 1] = f, w.add(T.join("."));
1954
+ } else if (E.startsWith(c + ".")) {
1955
+ const T = c.split(".");
1956
+ T[T.length - 1] = f;
1957
+ const C = T.join("."), I = E.substring(c.length);
1958
+ w.add(C + I);
1935
1959
  } else
1936
- k.add(N);
1937
- }), u.value = k;
1960
+ w.add(E);
1961
+ }), u.value = w;
1938
1962
  };
1939
1963
  return e({
1940
1964
  // 核心操作方法
1941
1965
  copyJson: O,
1942
- compressSource: I,
1943
- expandAll: $,
1944
- collapseAll: E,
1945
- toggleExpand: p,
1946
- updateValue: j,
1947
- updateKey: Z,
1966
+ compressSource: $,
1967
+ expandAll: g,
1968
+ collapseAll: m,
1969
+ toggleExpand: Z,
1970
+ updateValue: S,
1971
+ updateKey: H,
1948
1972
  // Filter 相关方法
1949
- filter: w,
1950
- clearFilter: S,
1973
+ filter: A,
1974
+ clearFilter: P,
1951
1975
  // 状态访问方法
1952
- isValidJson: () => h.value,
1976
+ isValidJson: () => p.value,
1953
1977
  getParsedJson: () => o.value,
1954
1978
  getFilteredJson: () => a.value,
1955
1979
  getExpandedNodes: () => u.value,
1956
1980
  getParseError: () => i.value,
1957
1981
  getFilterError: () => l.value,
1958
1982
  // 工具方法
1959
- parseJson: (d) => m(d),
1960
- copyValue: (d) => X(d)
1961
- }), (d, g) => (x(), A("div", {
1962
- class: Te(["json-format", `json-format--${f.value.name}`])
1983
+ parseJson: (c) => b(c),
1984
+ copyValue: (c) => j(c)
1985
+ }), (c, f) => (_(), x("div", {
1986
+ class: Te(["json-format", `json-format--${h.value.name}`])
1963
1987
  }, [
1964
- d.showToolbar ? (x(), A("div", Lt, [
1965
- v("div", Rt, [
1966
- v("button", {
1988
+ c.showToolbar ? (_(), x("div", Lt, [
1989
+ y("div", jt, [
1990
+ y("button", {
1967
1991
  class: "json-format__btn json-format__btn--primary",
1968
1992
  onClick: O,
1969
- disabled: !h.value,
1993
+ disabled: !p.value,
1970
1994
  title: "Copy JSON"
1971
- }, " 📋 Copy ", 8, jt),
1972
- v("button", {
1995
+ }, " 📋 Copy ", 8, Rt),
1996
+ y("button", {
1973
1997
  class: "json-format__btn json-format__btn--secondary",
1974
- onClick: $,
1975
- disabled: !h.value,
1998
+ onClick: g,
1999
+ disabled: !p.value,
1976
2000
  title: "Expand All"
1977
2001
  }, " ⬇️ Expand All ", 8, Mt),
1978
- v("button", {
2002
+ y("button", {
1979
2003
  class: "json-format__btn json-format__btn--secondary",
1980
- onClick: E,
1981
- disabled: !h.value,
2004
+ onClick: m,
2005
+ disabled: !p.value,
1982
2006
  title: "Collapse All"
1983
2007
  }, " ➡️ Collapse All ", 8, Ut),
1984
- v("button", {
2008
+ y("button", {
1985
2009
  class: "json-format__btn json-format__btn--secondary",
1986
- onClick: I,
1987
- disabled: !h.value,
2010
+ onClick: $,
2011
+ disabled: !p.value,
1988
2012
  title: "Compress JSON"
1989
2013
  }, " 📦 Compress ", 8, Ft)
1990
2014
  ]),
1991
- v("div", Xt, [
1992
- h.value ? (x(), A("span", Ht, " ✅ Valid JSON ")) : (x(), A("span", Kt, " ❌ Invalid JSON "))
2015
+ y("div", Xt, [
2016
+ p.value ? (_(), x("span", Ht, " ✅ Valid JSON ")) : (_(), x("span", Kt, " ❌ Invalid JSON "))
1993
2017
  ])
1994
- ])) : F("", !0),
1995
- v("div", qt, [
1996
- h.value ? l.value ? (x(), A("div", Qt, [
1997
- g[1] || (g[1] = v("h4", null, "Filter Error:", -1)),
1998
- v("pre", null, R(l.value), 1)
1999
- ])) : (x(), A("div", Wt, [
2000
- Fe(Pt, {
2001
- value: b.value,
2018
+ ])) : U("", !0),
2019
+ y("div", qt, [
2020
+ p.value ? l.value ? (_(), x("div", Wt, [
2021
+ f[1] || (f[1] = y("h4", null, "Filter Error:", -1)),
2022
+ y("pre", null, B(l.value), 1)
2023
+ ])) : (_(), x("div", Yt, [
2024
+ Ue(Pt, {
2025
+ value: v.value,
2002
2026
  "key-name": "",
2003
2027
  level: 0,
2004
2028
  expanded: u.value,
2005
2029
  "is-last": !0,
2006
- theme: f.value,
2007
- "onUpdate:value": j,
2008
- onToggleExpand: p,
2009
- onCopy: X,
2010
- "onUpdate:key": Z
2030
+ theme: h.value,
2031
+ "onUpdate:value": S,
2032
+ onToggleExpand: Z,
2033
+ onCopy: j,
2034
+ "onUpdate:key": H
2011
2035
  }, null, 8, ["value", "expanded", "theme"])
2012
- ])) : (x(), A("div", Yt, [
2013
- g[0] || (g[0] = v("h4", null, "JSON Parse Error:", -1)),
2014
- v("pre", null, R(i.value), 1)
2036
+ ])) : (_(), x("div", Qt, [
2037
+ f[0] || (f[0] = y("h4", null, "JSON Parse Error:", -1)),
2038
+ y("pre", null, B(i.value), 1)
2015
2039
  ]))
2016
2040
  ])
2017
2041
  ], 2));
@@ -2031,16 +2055,19 @@ const Lt = {
2031
2055
  }, tr = {
2032
2056
  key: 1,
2033
2057
  class: "xml-node__line"
2034
- }, rr = { key: 2 }, nr = { class: "xml-node__line" }, sr = ["title"], or = { key: 1 }, ir = ["title"], ar = {
2058
+ }, rr = { key: 2 }, nr = {
2059
+ key: 0,
2060
+ class: "xml-node__line"
2061
+ }, sr = ["title"], or = { class: "xml-node__line" }, ir = ["title"], ar = { key: 1 }, lr = ["title"], ur = {
2035
2062
  key: 0,
2036
2063
  class: "xml-node__children"
2037
- }, lr = {
2064
+ }, cr = {
2038
2065
  key: 0,
2039
2066
  class: "xml-node__text"
2040
- }, ur = {
2067
+ }, dr = {
2041
2068
  key: 1,
2042
2069
  class: "xml-node__line"
2043
- }, cr = /* @__PURE__ */ ye({
2070
+ }, fr = /* @__PURE__ */ ye({
2044
2071
  __name: "XmlNode",
2045
2072
  props: {
2046
2073
  node: {},
@@ -2052,279 +2079,351 @@ const Lt = {
2052
2079
  },
2053
2080
  emits: ["toggle-expand", "copy"],
2054
2081
  setup(r, { emit: e }) {
2055
- 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(() => {
2056
- const p = t.node[":@"] || {}, $ = {};
2057
- return Object.keys(p).forEach((E) => {
2058
- E.startsWith("@_") && ($[E.substring(2)] = p[E]);
2059
- }), $;
2082
+ const t = r, s = e, n = V(() => Object.keys(t.node).find((m) => !m.startsWith(":") && !m.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(() => {
2083
+ const g = t.node[":@"] || {}, m = {};
2084
+ return Object.keys(g).forEach((O) => {
2085
+ O.startsWith("@_") && (m[O.substring(2)] = g[O]);
2086
+ }), m;
2060
2087
  }), l = V(() => {
2061
2088
  if (u.value !== "element" || !n.value) return [];
2062
- const p = t.node[n.value];
2063
- return Array.isArray(p) ? p : [];
2064
- }), h = V(() => l.value.some((p) => p.__cdata)), f = V(() => {
2065
- if (!h.value) return "";
2066
- const p = l.value.find(($) => $.__cdata);
2067
- if (p && Array.isArray(p.__cdata)) {
2068
- const $ = p.__cdata;
2069
- if ($.length > 0 && $[0]["#text"])
2070
- return $[0]["#text"];
2089
+ const g = t.node[n.value];
2090
+ return Array.isArray(g) ? g : [];
2091
+ }), p = V(() => l.value.some((g) => g.__cdata)), h = V(() => {
2092
+ if (!p.value) return "";
2093
+ const g = l.value.find((m) => m.__cdata);
2094
+ if (g && Array.isArray(g.__cdata)) {
2095
+ const m = g.__cdata;
2096
+ if (m.length > 0 && m[0]["#text"])
2097
+ return m[0]["#text"];
2071
2098
  }
2072
2099
  return "";
2100
+ }), v = V(() => {
2101
+ if (u.value !== "element" || !n.value || p.value) return "";
2102
+ const g = t.node[n.value];
2103
+ if (!Array.isArray(g)) return "";
2104
+ const m = g.find((O) => O["#text"]);
2105
+ return m ? m["#text"] : "";
2073
2106
  }), b = V(() => {
2074
- if (u.value !== "element" || !n.value || h.value) return "";
2075
- const p = t.node[n.value];
2076
- if (!Array.isArray(p)) return "";
2077
- const $ = p.find((E) => E["#text"]);
2078
- return $ ? $["#text"] : "";
2079
- }), m = V(() => {
2080
2107
  if (u.value !== "comment") return "";
2081
- const p = t.node["#comment"];
2082
- return Array.isArray(p) && p.length > 0 && p[0]["#text"] || "";
2083
- }), 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() !== ""), _ = () => {
2084
- w.value && s("toggle-expand", o.value);
2085
- }, j = (p, $) => `${o.value}-child-${$}`, H = () => `${o.value}.${n.value}`;
2086
- return (p, $) => {
2087
- const E = Ue("XmlNode", !0);
2088
- return x(), A("div", {
2108
+ const g = t.node["#comment"];
2109
+ return Array.isArray(g) && g.length > 0 && g[0]["#text"] || "";
2110
+ }), A = V(() => l.value.some((g) => Object.keys(g).some((O) => !O.startsWith("#") && !O.startsWith(":")))), P = V(() => A.value ? l.value.filter((g) => Object.keys(g).some((O) => !O.startsWith("#") && !O.startsWith(":"))).length : 0), k = V(() => u.value === "element" && !A.value && v.value.trim() !== ""), S = () => {
2111
+ A.value && s("toggle-expand", o.value);
2112
+ }, F = (g, m) => `${o.value}-child-${m}`, Z = () => `${o.value}.${n.value}`;
2113
+ return (g, m) => {
2114
+ const O = Me("XmlNode", !0);
2115
+ return _(), x("div", {
2089
2116
  class: "xml-node",
2090
- style: P({ paddingLeft: p.level > 0 ? "16px" : "0" })
2117
+ style: N({ paddingLeft: g.level > 0 ? "16px" : "0" })
2091
2118
  }, [
2092
- u.value === "comment" ? (x(), A("div", zt, [
2093
- v("span", {
2094
- style: P({ color: p.theme.colors.xmlComment })
2095
- }, " <!-- " + R(m.value) + " --> ", 5)
2096
- ])) : u.value === "cdata" ? (x(), A("div", Dt, [
2097
- v("span", {
2098
- style: P({ color: p.theme.colors.xmlCdata })
2099
- }, " <![CDATA[" + R(p.node.__cdata) + "]]> ", 5)
2100
- ])) : u.value === "element" ? (x(), A("div", Jt, [
2101
- h.value ? (x(), A("div", er, [
2102
- v("span", {
2119
+ u.value === "comment" ? (_(), x("div", zt, [
2120
+ y("span", {
2121
+ style: N({ color: g.theme.colors.xmlComment })
2122
+ }, " <!-- " + B(b.value) + " --> ", 5)
2123
+ ])) : u.value === "cdata" ? (_(), x("div", Dt, [
2124
+ y("span", {
2125
+ style: N({ color: g.theme.colors.xmlCdata })
2126
+ }, " <![CDATA[" + B(g.node.__cdata) + "]]> ", 5)
2127
+ ])) : u.value === "element" ? (_(), x("div", Jt, [
2128
+ p.value ? (_(), x("div", er, [
2129
+ y("span", {
2103
2130
  class: "xml-node__bracket",
2104
- style: P({ color: p.theme.colors.xmlBracket })
2131
+ style: N({ color: g.theme.colors.xmlBracket })
2105
2132
  }, "<", 4),
2106
- v("span", {
2133
+ y("span", {
2107
2134
  class: "xml-node__tag",
2108
- style: P({ color: p.theme.colors.xmlTag })
2109
- }, R(n.value), 5),
2110
- (x(!0), A(de, null, fe(a.value, (O, I) => (x(), A("span", {
2111
- key: I,
2135
+ style: N({ color: g.theme.colors.xmlTag })
2136
+ }, B(n.value), 5),
2137
+ (_(!0), x(ne, null, ie(a.value, ($, j) => (_(), x("span", {
2138
+ key: j,
2112
2139
  class: "xml-node__attribute"
2113
2140
  }, [
2114
- v("span", {
2141
+ y("span", {
2115
2142
  class: "xml-node__attr-name",
2116
- style: P({ color: p.theme.colors.xmlAttribute })
2117
- }, R(I), 5),
2118
- v("span", {
2143
+ style: N({ color: g.theme.colors.xmlAttribute })
2144
+ }, B(j), 5),
2145
+ y("span", {
2119
2146
  class: "xml-node__equals",
2120
- style: P({ color: p.theme.colors.xmlEquals })
2147
+ style: N({ color: g.theme.colors.xmlEquals })
2121
2148
  }, "=", 4),
2122
- v("span", {
2149
+ y("span", {
2123
2150
  class: "xml-node__quote",
2124
- style: P({ color: p.theme.colors.xmlQuote })
2151
+ style: N({ color: g.theme.colors.xmlQuote })
2125
2152
  }, '"', 4),
2126
- v("span", {
2153
+ y("span", {
2127
2154
  class: "xml-node__attr-value",
2128
- style: P({ color: p.theme.colors.xmlAttributeValue })
2129
- }, R(O), 5),
2130
- v("span", {
2155
+ style: N({ color: g.theme.colors.xmlAttributeValue })
2156
+ }, B($), 5),
2157
+ y("span", {
2131
2158
  class: "xml-node__quote",
2132
- style: P({ color: p.theme.colors.xmlQuote })
2159
+ style: N({ color: g.theme.colors.xmlQuote })
2133
2160
  }, '"', 4)
2134
2161
  ]))), 128)),
2135
- v("span", {
2162
+ y("span", {
2136
2163
  class: "xml-node__bracket",
2137
- style: P({ color: p.theme.colors.xmlBracket })
2164
+ style: N({ color: g.theme.colors.xmlBracket })
2138
2165
  }, ">", 4),
2139
- v("span", {
2166
+ y("span", {
2140
2167
  class: "xml-node__cdata",
2141
- style: P({ color: p.theme.colors.xmlCdata })
2142
- }, "<![CDATA[" + R(f.value) + "]]>", 5),
2143
- v("span", {
2168
+ style: N({ color: g.theme.colors.xmlCdata })
2169
+ }, "<![CDATA[" + B(h.value) + "]]>", 5),
2170
+ y("span", {
2144
2171
  class: "xml-node__bracket",
2145
- style: P({ color: p.theme.colors.xmlBracket })
2172
+ style: N({ color: g.theme.colors.xmlBracket })
2146
2173
  }, "</", 4),
2147
- v("span", {
2174
+ y("span", {
2148
2175
  class: "xml-node__tag",
2149
- style: P({ color: p.theme.colors.xmlTag })
2150
- }, R(n.value), 5),
2151
- v("span", {
2176
+ style: N({ color: g.theme.colors.xmlTag })
2177
+ }, B(n.value), 5),
2178
+ y("span", {
2152
2179
  class: "xml-node__bracket",
2153
- style: P({ color: p.theme.colors.xmlBracket })
2180
+ style: N({ color: g.theme.colors.xmlBracket })
2154
2181
  }, ">", 4)
2155
- ])) : S.value ? (x(), A("div", tr, [
2156
- v("span", {
2182
+ ])) : k.value ? (_(), x("div", tr, [
2183
+ y("span", {
2157
2184
  class: "xml-node__bracket",
2158
- style: P({ color: p.theme.colors.xmlBracket })
2185
+ style: N({ color: g.theme.colors.xmlBracket })
2159
2186
  }, "<", 4),
2160
- v("span", {
2187
+ y("span", {
2161
2188
  class: "xml-node__tag",
2162
- style: P({ color: p.theme.colors.xmlTag })
2163
- }, R(n.value), 5),
2164
- (x(!0), A(de, null, fe(a.value, (O, I) => (x(), A("span", {
2165
- key: I,
2189
+ style: N({ color: g.theme.colors.xmlTag })
2190
+ }, B(n.value), 5),
2191
+ (_(!0), x(ne, null, ie(a.value, ($, j) => (_(), x("span", {
2192
+ key: j,
2166
2193
  class: "xml-node__attribute"
2167
2194
  }, [
2168
- v("span", {
2195
+ y("span", {
2169
2196
  class: "xml-node__attr-name",
2170
- style: P({ color: p.theme.colors.xmlAttribute })
2171
- }, R(I), 5),
2172
- v("span", {
2197
+ style: N({ color: g.theme.colors.xmlAttribute })
2198
+ }, B(j), 5),
2199
+ y("span", {
2173
2200
  class: "xml-node__equals",
2174
- style: P({ color: p.theme.colors.xmlEquals })
2201
+ style: N({ color: g.theme.colors.xmlEquals })
2175
2202
  }, "=", 4),
2176
- v("span", {
2203
+ y("span", {
2177
2204
  class: "xml-node__quote",
2178
- style: P({ color: p.theme.colors.xmlQuote })
2205
+ style: N({ color: g.theme.colors.xmlQuote })
2179
2206
  }, '"', 4),
2180
- v("span", {
2207
+ y("span", {
2181
2208
  class: "xml-node__attr-value",
2182
- style: P({ color: p.theme.colors.xmlAttributeValue })
2183
- }, R(O), 5),
2184
- v("span", {
2209
+ style: N({ color: g.theme.colors.xmlAttributeValue })
2210
+ }, B($), 5),
2211
+ y("span", {
2185
2212
  class: "xml-node__quote",
2186
- style: P({ color: p.theme.colors.xmlQuote })
2213
+ style: N({ color: g.theme.colors.xmlQuote })
2187
2214
  }, '"', 4)
2188
2215
  ]))), 128)),
2189
- v("span", {
2216
+ y("span", {
2190
2217
  class: "xml-node__bracket",
2191
- style: P({ color: p.theme.colors.xmlBracket })
2218
+ style: N({ color: g.theme.colors.xmlBracket })
2192
2219
  }, ">", 4),
2193
- v("span", {
2220
+ y("span", {
2194
2221
  class: "xml-node__text-content",
2195
- style: P({ color: p.theme.colors.xmlText })
2196
- }, R(b.value), 5),
2197
- v("span", {
2222
+ style: N({ color: g.theme.colors.xmlText })
2223
+ }, B(v.value), 5),
2224
+ y("span", {
2198
2225
  class: "xml-node__bracket",
2199
- style: P({ color: p.theme.colors.xmlBracket })
2226
+ style: N({ color: g.theme.colors.xmlBracket })
2200
2227
  }, "</", 4),
2201
- v("span", {
2228
+ y("span", {
2202
2229
  class: "xml-node__tag",
2203
- style: P({ color: p.theme.colors.xmlTag })
2204
- }, R(n.value), 5),
2205
- v("span", {
2230
+ style: N({ color: g.theme.colors.xmlTag })
2231
+ }, B(n.value), 5),
2232
+ y("span", {
2206
2233
  class: "xml-node__bracket",
2207
- style: P({ color: p.theme.colors.xmlBracket })
2234
+ style: N({ color: g.theme.colors.xmlBracket })
2208
2235
  }, ">", 4)
2209
- ])) : (x(), A("div", rr, [
2210
- v("div", nr, [
2211
- w.value ? (x(), A("span", {
2212
- key: 0,
2236
+ ])) : (_(), x("div", rr, [
2237
+ !i.value && A.value ? (_(), x("div", nr, [
2238
+ y("span", {
2213
2239
  class: "xml-node__clickable-part",
2214
- onClick: $[0] || ($[0] = (O) => _()),
2215
- title: i.value ? "Click to collapse" : "Click to expand"
2240
+ onClick: m[0] || (m[0] = ($) => S()),
2241
+ title: "Click to expand"
2216
2242
  }, [
2217
- v("span", {
2243
+ y("span", {
2218
2244
  class: "xml-node__bracket",
2219
- style: P({ color: p.theme.colors.xmlBracket })
2245
+ style: N({ color: g.theme.colors.xmlBracket })
2220
2246
  }, "<", 4),
2221
- v("span", {
2247
+ y("span", {
2222
2248
  class: "xml-node__tag",
2223
- style: P({ color: p.theme.colors.xmlTag })
2224
- }, R(n.value), 5)
2225
- ], 8, sr)) : (x(), A("span", or, [
2226
- v("span", {
2227
- class: "xml-node__bracket",
2228
- style: P({ color: p.theme.colors.xmlBracket })
2229
- }, "<", 4),
2230
- v("span", {
2231
- class: "xml-node__tag",
2232
- style: P({ color: p.theme.colors.xmlTag })
2233
- }, R(n.value), 5)
2234
- ])),
2235
- (x(!0), A(de, null, fe(a.value, (O, I) => (x(), A("span", {
2236
- key: I,
2249
+ style: N({ color: g.theme.colors.xmlTag })
2250
+ }, B(n.value), 5)
2251
+ ]),
2252
+ (_(!0), x(ne, null, ie(a.value, ($, j) => (_(), x("span", {
2253
+ key: j,
2237
2254
  class: "xml-node__attribute"
2238
2255
  }, [
2239
- v("span", {
2256
+ y("span", {
2240
2257
  class: "xml-node__attr-name",
2241
- style: P({ color: p.theme.colors.xmlAttribute })
2242
- }, R(I), 5),
2243
- v("span", {
2258
+ style: N({ color: g.theme.colors.xmlAttribute })
2259
+ }, B(j), 5),
2260
+ y("span", {
2244
2261
  class: "xml-node__equals",
2245
- style: P({ color: p.theme.colors.xmlEquals })
2262
+ style: N({ color: g.theme.colors.xmlEquals })
2246
2263
  }, "=", 4),
2247
- v("span", {
2264
+ y("span", {
2248
2265
  class: "xml-node__quote",
2249
- style: P({ color: p.theme.colors.xmlQuote })
2266
+ style: N({ color: g.theme.colors.xmlQuote })
2250
2267
  }, '"', 4),
2251
- v("span", {
2268
+ y("span", {
2252
2269
  class: "xml-node__attr-value",
2253
- style: P({ color: p.theme.colors.xmlAttributeValue })
2254
- }, R(O), 5),
2255
- v("span", {
2270
+ style: N({ color: g.theme.colors.xmlAttributeValue })
2271
+ }, B($), 5),
2272
+ y("span", {
2256
2273
  class: "xml-node__quote",
2257
- style: P({ color: p.theme.colors.xmlQuote })
2274
+ style: N({ color: g.theme.colors.xmlQuote })
2258
2275
  }, '"', 4)
2259
2276
  ]))), 128)),
2260
- w.value ? (x(), A("span", {
2261
- key: 2,
2277
+ y("span", {
2262
2278
  class: "xml-node__clickable-part",
2263
- onClick: $[1] || ($[1] = (O) => _()),
2264
- title: i.value ? "Click to collapse" : "Click to expand"
2279
+ onClick: m[1] || (m[1] = ($) => S()),
2280
+ title: "Click to expand"
2265
2281
  }, [
2266
- v("span", {
2282
+ y("span", {
2267
2283
  class: "xml-node__bracket",
2268
- style: P({ color: p.theme.colors.xmlBracket })
2284
+ style: N({ color: g.theme.colors.xmlBracket })
2269
2285
  }, ">", 4)
2270
- ], 8, ir)) : (x(), A("span", {
2271
- key: 3,
2272
- class: "xml-node__bracket",
2273
- style: P({ color: p.theme.colors.xmlBracket })
2274
- }, R(w.value ? ">" : "/>"), 5)),
2275
- !i.value && w.value ? (x(), A("span", {
2276
- key: 4,
2277
- class: "xml-node__collapsed xml-node__collapsed--clickable",
2278
- style: P({ color: p.theme.colors.textSecondary }),
2279
- onClick: $[2] || ($[2] = (O) => _()),
2280
- title: "Click to expand"
2281
- }, "...", 4)) : F("", !0)
2282
- ]),
2283
- i.value && w.value ? (x(), A("div", ar, [
2284
- l.value.length === 0 && b.value.trim() ? (x(), A("div", lr, [
2285
- v("span", {
2286
- class: "xml-node__text-content",
2287
- style: P({ color: p.theme.colors.xmlText })
2288
- }, R(b.value), 5)
2289
- ])) : F("", !0),
2290
- (x(!0), A(de, null, fe(l.value, (O, I) => (x(), He(E, {
2291
- key: j(O, I),
2292
- node: O,
2293
- index: I,
2294
- level: p.level + 1,
2295
- "parent-path": H(),
2296
- expanded: p.expanded,
2297
- theme: p.theme,
2298
- onToggleExpand: $[3] || ($[3] = (X) => p.$emit("toggle-expand", X)),
2299
- onCopy: $[4] || ($[4] = (X) => p.$emit("copy", X))
2300
- }, null, 8, ["node", "index", "level", "parent-path", "expanded", "theme"]))), 128))
2301
- ])) : F("", !0),
2302
- i.value && w.value ? (x(), A("div", ur, [
2303
- v("span", {
2286
+ ]),
2287
+ y("span", {
2288
+ class: "xml-node__collapsed-badge",
2289
+ style: N({
2290
+ backgroundColor: g.theme.colors.collapsedBackground,
2291
+ color: g.theme.colors.collapsedText
2292
+ }),
2293
+ onClick: m[2] || (m[2] = ($) => S()),
2294
+ title: `Click to expand ${P.value} child element${P.value > 1 ? "s" : ""}`
2295
+ }, B(P.value) + " child" + B(P.value > 1 ? "ren" : ""), 13, sr),
2296
+ y("span", {
2304
2297
  class: "xml-node__clickable-part",
2305
- onClick: $[5] || ($[5] = (O) => _()),
2306
- title: "Click to collapse"
2298
+ onClick: m[3] || (m[3] = ($) => S()),
2299
+ title: "Click to expand"
2307
2300
  }, [
2308
- v("span", {
2301
+ y("span", {
2309
2302
  class: "xml-node__bracket",
2310
- style: P({ color: p.theme.colors.xmlBracket })
2303
+ style: N({ color: g.theme.colors.xmlBracket })
2311
2304
  }, "</", 4),
2312
- v("span", {
2305
+ y("span", {
2313
2306
  class: "xml-node__tag",
2314
- style: P({ color: p.theme.colors.xmlTag })
2315
- }, R(n.value), 5),
2316
- v("span", {
2307
+ style: N({ color: g.theme.colors.xmlTag })
2308
+ }, B(n.value), 5),
2309
+ y("span", {
2317
2310
  class: "xml-node__bracket",
2318
- style: P({ color: p.theme.colors.xmlBracket })
2311
+ style: N({ color: g.theme.colors.xmlBracket })
2319
2312
  }, ">", 4)
2320
2313
  ])
2321
- ])) : F("", !0)
2314
+ ])) : (_(), x(ne, { key: 1 }, [
2315
+ y("div", or, [
2316
+ A.value ? (_(), x("span", {
2317
+ key: 0,
2318
+ class: "xml-node__clickable-part",
2319
+ onClick: m[4] || (m[4] = ($) => S()),
2320
+ title: i.value ? "Click to collapse" : "Click to expand"
2321
+ }, [
2322
+ y("span", {
2323
+ class: "xml-node__bracket",
2324
+ style: N({ color: g.theme.colors.xmlBracket })
2325
+ }, "<", 4),
2326
+ y("span", {
2327
+ class: "xml-node__tag",
2328
+ style: N({ color: g.theme.colors.xmlTag })
2329
+ }, B(n.value), 5)
2330
+ ], 8, ir)) : (_(), x("span", ar, [
2331
+ y("span", {
2332
+ class: "xml-node__bracket",
2333
+ style: N({ color: g.theme.colors.xmlBracket })
2334
+ }, "<", 4),
2335
+ y("span", {
2336
+ class: "xml-node__tag",
2337
+ style: N({ color: g.theme.colors.xmlTag })
2338
+ }, B(n.value), 5)
2339
+ ])),
2340
+ (_(!0), x(ne, null, ie(a.value, ($, j) => (_(), x("span", {
2341
+ key: j,
2342
+ class: "xml-node__attribute"
2343
+ }, [
2344
+ y("span", {
2345
+ class: "xml-node__attr-name",
2346
+ style: N({ color: g.theme.colors.xmlAttribute })
2347
+ }, B(j), 5),
2348
+ y("span", {
2349
+ class: "xml-node__equals",
2350
+ style: N({ color: g.theme.colors.xmlEquals })
2351
+ }, "=", 4),
2352
+ y("span", {
2353
+ class: "xml-node__quote",
2354
+ style: N({ color: g.theme.colors.xmlQuote })
2355
+ }, '"', 4),
2356
+ y("span", {
2357
+ class: "xml-node__attr-value",
2358
+ style: N({ color: g.theme.colors.xmlAttributeValue })
2359
+ }, B($), 5),
2360
+ y("span", {
2361
+ class: "xml-node__quote",
2362
+ style: N({ color: g.theme.colors.xmlQuote })
2363
+ }, '"', 4)
2364
+ ]))), 128)),
2365
+ A.value ? (_(), x("span", {
2366
+ key: 2,
2367
+ class: "xml-node__clickable-part",
2368
+ onClick: m[5] || (m[5] = ($) => S()),
2369
+ title: i.value ? "Click to collapse" : "Click to expand"
2370
+ }, [
2371
+ y("span", {
2372
+ class: "xml-node__bracket",
2373
+ style: N({ color: g.theme.colors.xmlBracket })
2374
+ }, ">", 4)
2375
+ ], 8, lr)) : (_(), x("span", {
2376
+ key: 3,
2377
+ class: "xml-node__bracket",
2378
+ style: N({ color: g.theme.colors.xmlBracket })
2379
+ }, B(A.value ? ">" : "/>"), 5))
2380
+ ]),
2381
+ i.value && A.value ? (_(), x("div", ur, [
2382
+ l.value.length === 0 && v.value.trim() ? (_(), x("div", cr, [
2383
+ y("span", {
2384
+ class: "xml-node__text-content",
2385
+ style: N({ color: g.theme.colors.xmlText })
2386
+ }, B(v.value), 5)
2387
+ ])) : U("", !0),
2388
+ (_(!0), x(ne, null, ie(l.value, ($, j) => (_(), Xe(O, {
2389
+ key: F($, j),
2390
+ node: $,
2391
+ index: j,
2392
+ level: g.level + 1,
2393
+ "parent-path": Z(),
2394
+ expanded: g.expanded,
2395
+ theme: g.theme,
2396
+ onToggleExpand: m[6] || (m[6] = (H) => g.$emit("toggle-expand", H)),
2397
+ onCopy: m[7] || (m[7] = (H) => g.$emit("copy", H))
2398
+ }, null, 8, ["node", "index", "level", "parent-path", "expanded", "theme"]))), 128))
2399
+ ])) : U("", !0),
2400
+ i.value && A.value ? (_(), x("div", dr, [
2401
+ y("span", {
2402
+ class: "xml-node__clickable-part",
2403
+ onClick: m[8] || (m[8] = ($) => S()),
2404
+ title: "Click to collapse"
2405
+ }, [
2406
+ y("span", {
2407
+ class: "xml-node__bracket",
2408
+ style: N({ color: g.theme.colors.xmlBracket })
2409
+ }, "</", 4),
2410
+ y("span", {
2411
+ class: "xml-node__tag",
2412
+ style: N({ color: g.theme.colors.xmlTag })
2413
+ }, B(n.value), 5),
2414
+ y("span", {
2415
+ class: "xml-node__bracket",
2416
+ style: N({ color: g.theme.colors.xmlBracket })
2417
+ }, ">", 4)
2418
+ ])
2419
+ ])) : U("", !0)
2420
+ ], 64))
2322
2421
  ]))
2323
- ])) : F("", !0)
2422
+ ])) : U("", !0)
2324
2423
  ], 4);
2325
2424
  };
2326
2425
  }
2327
- }), dr = /* @__PURE__ */ be(cr, [["__scopeId", "data-v-9c0c90fa"]]), fr = {
2426
+ }), hr = /* @__PURE__ */ be(fr, [["__scopeId", "data-v-afb7b2ab"]]), pr = {
2328
2427
  name: "github-light",
2329
2428
  colors: {
2330
2429
  // 背景色
@@ -2366,10 +2465,15 @@ const Lt = {
2366
2465
  // 括号 - 灰色
2367
2466
  xmlEquals: "#6e7781",
2368
2467
  // 等号 - 灰色
2369
- xmlQuote: "#0550ae"
2468
+ xmlQuote: "#0550ae",
2370
2469
  // 引号 - 蓝色
2470
+ // 折叠效果
2471
+ collapsedBackground: "#ddf4ff",
2472
+ // 折叠信息背景色 - 浅蓝
2473
+ collapsedText: "#0969da"
2474
+ // 折叠信息文本色 - 蓝色
2371
2475
  }
2372
- }, hr = {
2476
+ }, gr = {
2373
2477
  name: "github-dark",
2374
2478
  colors: {
2375
2479
  // 背景色
@@ -2411,10 +2515,15 @@ const Lt = {
2411
2515
  // 括号 - 灰色
2412
2516
  xmlEquals: "#8b949e",
2413
2517
  // 等号 - 灰色
2414
- xmlQuote: "#79c0ff"
2518
+ xmlQuote: "#79c0ff",
2415
2519
  // 引号 - 亮蓝色
2520
+ // 折叠效果
2521
+ collapsedBackground: "#1c2d41",
2522
+ // 折叠信息背景色 - 深蓝
2523
+ collapsedText: "#58a6ff"
2524
+ // 折叠信息文本色 - 亮蓝
2416
2525
  }
2417
- }, pr = {
2526
+ }, mr = {
2418
2527
  name: "min-light",
2419
2528
  colors: {
2420
2529
  // 背景色
@@ -2456,10 +2565,15 @@ const Lt = {
2456
2565
  // 括号 - 灰色
2457
2566
  xmlEquals: "#737373",
2458
2567
  // 等号 - 灰色
2459
- xmlQuote: "#2563eb"
2568
+ xmlQuote: "#2563eb",
2460
2569
  // 引号 - 蓝色
2570
+ // 折叠效果
2571
+ collapsedBackground: "#dbeafe",
2572
+ // 折叠信息背景色 - 浅蓝
2573
+ collapsedText: "#1d4ed8"
2574
+ // 折叠信息文本色 - 蓝色
2461
2575
  }
2462
- }, gr = {
2576
+ }, yr = {
2463
2577
  name: "slack-ochin",
2464
2578
  colors: {
2465
2579
  // 背景色
@@ -2501,16 +2615,21 @@ const Lt = {
2501
2615
  // 括号 - 灰色
2502
2616
  xmlEquals: "#616061",
2503
2617
  // 等号 - 灰色
2504
- xmlQuote: "#1264a3"
2618
+ xmlQuote: "#1264a3",
2505
2619
  // 引号 - 蓝色
2620
+ // 折叠效果
2621
+ collapsedBackground: "#d8eaf5",
2622
+ // 折叠信息背景色 - 浅蓝
2623
+ collapsedText: "#0b4c8c"
2624
+ // 折叠信息文本色 - 深蓝
2506
2625
  }
2507
2626
  }, Be = {
2508
- "github-light": fr,
2509
- "github-dark": hr,
2510
- "min-light": pr,
2511
- "slack-ochin": gr
2512
- }, 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 + "$");
2513
- function Ye(r, e) {
2627
+ "github-light": pr,
2628
+ "github-dark": gr,
2629
+ "min-light": mr,
2630
+ "slack-ochin": yr
2631
+ }, br = (r) => Be[r] || Be["github-light"], 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", vr = Ke + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", _r = "[" + Ke + "][" + vr + "]*", Er = new RegExp("^" + _r + "$");
2632
+ function qe(r, e) {
2514
2633
  const t = [];
2515
2634
  let s = e.exec(r);
2516
2635
  for (; s; ) {
@@ -2524,29 +2643,29 @@ function Ye(r, e) {
2524
2643
  return t;
2525
2644
  }
2526
2645
  const ve = function(r) {
2527
- const e = vr.exec(r);
2646
+ const e = Er.exec(r);
2528
2647
  return !(e === null || typeof e > "u");
2529
2648
  };
2530
- function Er(r) {
2649
+ function xr(r) {
2531
2650
  return typeof r < "u";
2532
2651
  }
2533
- const _r = {
2652
+ const kr = {
2534
2653
  allowBooleanAttributes: !1,
2535
2654
  //A tag can have attributes without any value
2536
2655
  unpairedTags: []
2537
2656
  };
2538
2657
  function Qe(r, e) {
2539
- e = Object.assign({}, _r, e);
2658
+ e = Object.assign({}, kr, e);
2540
2659
  const t = [];
2541
2660
  let s = !1, n = !1;
2542
2661
  r[0] === "\uFEFF" && (r = r.substr(1));
2543
2662
  for (let o = 0; o < r.length; o++)
2544
2663
  if (r[o] === "<" && r[o + 1] === "?") {
2545
- if (o += 2, o = Le(r, o), o.err) return o;
2664
+ if (o += 2, o = Ve(r, o), o.err) return o;
2546
2665
  } else if (r[o] === "<") {
2547
2666
  let i = o;
2548
2667
  if (o++, r[o] === "!") {
2549
- o = Re(r, o);
2668
+ o = Le(r, o);
2550
2669
  continue;
2551
2670
  } else {
2552
2671
  let u = !1;
@@ -2555,91 +2674,91 @@ function Qe(r, e) {
2555
2674
  for (; o < r.length && r[o] !== ">" && r[o] !== " " && r[o] !== " " && r[o] !== `
2556
2675
  ` && r[o] !== "\r"; o++)
2557
2676
  a += r[o];
2558
- if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), o--), !Tr(a)) {
2559
- let f;
2560
- return a.trim().length === 0 ? f = "Invalid space after '<'." : f = "Tag '" + a + "' is an invalid name.", U("InvalidTag", f, W(r, o));
2677
+ if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), o--), !$r(a)) {
2678
+ let h;
2679
+ return a.trim().length === 0 ? h = "Invalid space after '<'." : h = "Tag '" + a + "' is an invalid name.", M("InvalidTag", h, Q(r, o));
2561
2680
  }
2562
- const l = Ar(r, o);
2681
+ const l = wr(r, o);
2563
2682
  if (l === !1)
2564
- return U("InvalidAttr", "Attributes for '" + a + "' have open quote.", W(r, o));
2565
- let h = l.value;
2566
- if (o = l.index, h[h.length - 1] === "/") {
2567
- const f = o - h.length;
2568
- h = h.substring(0, h.length - 1);
2569
- const b = je(h, e);
2570
- if (b === !0)
2683
+ return M("InvalidAttr", "Attributes for '" + a + "' have open quote.", Q(r, o));
2684
+ let p = l.value;
2685
+ if (o = l.index, p[p.length - 1] === "/") {
2686
+ const h = o - p.length;
2687
+ p = p.substring(0, p.length - 1);
2688
+ const v = je(p, e);
2689
+ if (v === !0)
2571
2690
  s = !0;
2572
2691
  else
2573
- return U(b.err.code, b.err.msg, W(r, f + b.err.line));
2692
+ return M(v.err.code, v.err.msg, Q(r, h + v.err.line));
2574
2693
  } else if (u)
2575
2694
  if (l.tagClosed) {
2576
- if (h.trim().length > 0)
2577
- return U("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", W(r, i));
2695
+ if (p.trim().length > 0)
2696
+ return M("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", Q(r, i));
2578
2697
  if (t.length === 0)
2579
- return U("InvalidTag", "Closing tag '" + a + "' has not been opened.", W(r, i));
2698
+ return M("InvalidTag", "Closing tag '" + a + "' has not been opened.", Q(r, i));
2580
2699
  {
2581
- const f = t.pop();
2582
- if (a !== f.tagName) {
2583
- let b = W(r, f.tagStartPos);
2584
- return U(
2700
+ const h = t.pop();
2701
+ if (a !== h.tagName) {
2702
+ let v = Q(r, h.tagStartPos);
2703
+ return M(
2585
2704
  "InvalidTag",
2586
- "Expected closing tag '" + f.tagName + "' (opened in line " + b.line + ", col " + b.col + ") instead of closing tag '" + a + "'.",
2587
- W(r, i)
2705
+ "Expected closing tag '" + h.tagName + "' (opened in line " + v.line + ", col " + v.col + ") instead of closing tag '" + a + "'.",
2706
+ Q(r, i)
2588
2707
  );
2589
2708
  }
2590
2709
  t.length == 0 && (n = !0);
2591
2710
  }
2592
- } else return U("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", W(r, o));
2711
+ } else return M("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", Q(r, o));
2593
2712
  else {
2594
- const f = je(h, e);
2595
- if (f !== !0)
2596
- return U(f.err.code, f.err.msg, W(r, o - h.length + f.err.line));
2713
+ const h = je(p, e);
2714
+ if (h !== !0)
2715
+ return M(h.err.code, h.err.msg, Q(r, o - p.length + h.err.line));
2597
2716
  if (n === !0)
2598
- return U("InvalidXml", "Multiple possible root nodes found.", W(r, o));
2717
+ return M("InvalidXml", "Multiple possible root nodes found.", Q(r, o));
2599
2718
  e.unpairedTags.indexOf(a) !== -1 || t.push({ tagName: a, tagStartPos: i }), s = !0;
2600
2719
  }
2601
2720
  for (o++; o < r.length; o++)
2602
2721
  if (r[o] === "<")
2603
2722
  if (r[o + 1] === "!") {
2604
- o++, o = Re(r, o);
2723
+ o++, o = Le(r, o);
2605
2724
  continue;
2606
2725
  } else if (r[o + 1] === "?") {
2607
- if (o = Le(r, ++o), o.err) return o;
2726
+ if (o = Ve(r, ++o), o.err) return o;
2608
2727
  } else
2609
2728
  break;
2610
2729
  else if (r[o] === "&") {
2611
- const f = Cr(r, o);
2612
- if (f == -1)
2613
- return U("InvalidChar", "char '&' is not expected.", W(r, o));
2614
- o = f;
2615
- } else if (n === !0 && !Ve(r[o]))
2616
- return U("InvalidXml", "Extra text at the end", W(r, o));
2730
+ const h = Tr(r, o);
2731
+ if (h == -1)
2732
+ return M("InvalidChar", "char '&' is not expected.", Q(r, o));
2733
+ o = h;
2734
+ } else if (n === !0 && !Ie(r[o]))
2735
+ return M("InvalidXml", "Extra text at the end", Q(r, o));
2617
2736
  r[o] === "<" && o--;
2618
2737
  }
2619
2738
  } else {
2620
- if (Ve(r[o]))
2739
+ if (Ie(r[o]))
2621
2740
  continue;
2622
- return U("InvalidChar", "char '" + r[o] + "' is not expected.", W(r, o));
2741
+ return M("InvalidChar", "char '" + r[o] + "' is not expected.", Q(r, o));
2623
2742
  }
2624
2743
  if (s) {
2625
2744
  if (t.length == 1)
2626
- return U("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", W(r, t[0].tagStartPos));
2745
+ return M("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", Q(r, t[0].tagStartPos));
2627
2746
  if (t.length > 0)
2628
- return U("InvalidXml", "Invalid '" + JSON.stringify(t.map((o) => o.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
2629
- } else return U("InvalidXml", "Start tag expected.", 1);
2747
+ return M("InvalidXml", "Invalid '" + JSON.stringify(t.map((o) => o.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
2748
+ } else return M("InvalidXml", "Start tag expected.", 1);
2630
2749
  return !0;
2631
2750
  }
2632
- function Ve(r) {
2751
+ function Ie(r) {
2633
2752
  return r === " " || r === " " || r === `
2634
2753
  ` || r === "\r";
2635
2754
  }
2636
- function Le(r, e) {
2755
+ function Ve(r, e) {
2637
2756
  const t = e;
2638
2757
  for (; e < r.length; e++)
2639
2758
  if (r[e] == "?" || r[e] == " ") {
2640
2759
  const s = r.substr(t, e - t);
2641
2760
  if (e > 5 && s === "xml")
2642
- return U("InvalidXml", "XML declaration allowed only at the start of the document.", W(r, e));
2761
+ return M("InvalidXml", "XML declaration allowed only at the start of the document.", Q(r, e));
2643
2762
  if (r[e] == "?" && r[e + 1] == ">") {
2644
2763
  e++;
2645
2764
  break;
@@ -2648,7 +2767,7 @@ function Le(r, e) {
2648
2767
  }
2649
2768
  return e;
2650
2769
  }
2651
- function Re(r, e) {
2770
+ function Le(r, e) {
2652
2771
  if (r.length > e + 5 && r[e + 1] === "-" && r[e + 2] === "-") {
2653
2772
  for (e += 3; e < r.length; e++)
2654
2773
  if (r[e] === "-" && r[e + 1] === "-" && r[e + 2] === ">") {
@@ -2671,11 +2790,11 @@ function Re(r, e) {
2671
2790
  }
2672
2791
  return e;
2673
2792
  }
2674
- const xr = '"', Nr = "'";
2675
- function Ar(r, e) {
2793
+ const Nr = '"', Ar = "'";
2794
+ function wr(r, e) {
2676
2795
  let t = "", s = "", n = !1;
2677
2796
  for (; e < r.length; e++) {
2678
- if (r[e] === xr || r[e] === Nr)
2797
+ if (r[e] === Nr || r[e] === Ar)
2679
2798
  s === "" ? s = r[e] : s !== r[e] || (s = "");
2680
2799
  else if (r[e] === ">" && s === "") {
2681
2800
  n = !0;
@@ -2689,27 +2808,27 @@ function Ar(r, e) {
2689
2808
  tagClosed: n
2690
2809
  };
2691
2810
  }
2692
- const kr = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2811
+ const Cr = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2693
2812
  function je(r, e) {
2694
- const t = Ye(r, kr), s = {};
2813
+ const t = qe(r, Cr), s = {};
2695
2814
  for (let n = 0; n < t.length; n++) {
2696
2815
  if (t[n][1].length === 0)
2697
- return U("InvalidAttr", "Attribute '" + t[n][2] + "' has no space in starting.", pe(t[n]));
2816
+ return M("InvalidAttr", "Attribute '" + t[n][2] + "' has no space in starting.", pe(t[n]));
2698
2817
  if (t[n][3] !== void 0 && t[n][4] === void 0)
2699
- return U("InvalidAttr", "Attribute '" + t[n][2] + "' is without value.", pe(t[n]));
2818
+ return M("InvalidAttr", "Attribute '" + t[n][2] + "' is without value.", pe(t[n]));
2700
2819
  if (t[n][3] === void 0 && !e.allowBooleanAttributes)
2701
- return U("InvalidAttr", "boolean attribute '" + t[n][2] + "' is not allowed.", pe(t[n]));
2820
+ return M("InvalidAttr", "boolean attribute '" + t[n][2] + "' is not allowed.", pe(t[n]));
2702
2821
  const o = t[n][2];
2703
- if (!Or(o))
2704
- return U("InvalidAttr", "Attribute '" + o + "' is an invalid name.", pe(t[n]));
2822
+ if (!Pr(o))
2823
+ return M("InvalidAttr", "Attribute '" + o + "' is an invalid name.", pe(t[n]));
2705
2824
  if (!s.hasOwnProperty(o))
2706
2825
  s[o] = 1;
2707
2826
  else
2708
- return U("InvalidAttr", "Attribute '" + o + "' is repeated.", pe(t[n]));
2827
+ return M("InvalidAttr", "Attribute '" + o + "' is repeated.", pe(t[n]));
2709
2828
  }
2710
2829
  return !0;
2711
2830
  }
2712
- function wr(r, e) {
2831
+ function Or(r, e) {
2713
2832
  let t = /\d/;
2714
2833
  for (r[e] === "x" && (e++, t = /[\da-fA-F]/); e < r.length; e++) {
2715
2834
  if (r[e] === ";")
@@ -2719,11 +2838,11 @@ function wr(r, e) {
2719
2838
  }
2720
2839
  return -1;
2721
2840
  }
2722
- function Cr(r, e) {
2841
+ function Tr(r, e) {
2723
2842
  if (e++, r[e] === ";")
2724
2843
  return -1;
2725
2844
  if (r[e] === "#")
2726
- return e++, wr(r, e);
2845
+ return e++, Or(r, e);
2727
2846
  let t = 0;
2728
2847
  for (; e < r.length; e++, t++)
2729
2848
  if (!(r[e].match(/\w/) && t < 20)) {
@@ -2733,7 +2852,7 @@ function Cr(r, e) {
2733
2852
  }
2734
2853
  return e;
2735
2854
  }
2736
- function U(r, e, t) {
2855
+ function M(r, e, t) {
2737
2856
  return {
2738
2857
  err: {
2739
2858
  code: r,
@@ -2743,13 +2862,13 @@ function U(r, e, t) {
2743
2862
  }
2744
2863
  };
2745
2864
  }
2746
- function Or(r) {
2865
+ function Pr(r) {
2747
2866
  return ve(r);
2748
2867
  }
2749
- function Tr(r) {
2868
+ function $r(r) {
2750
2869
  return ve(r);
2751
2870
  }
2752
- function W(r, e) {
2871
+ function Q(r, e) {
2753
2872
  const t = r.substring(0, e).split(/\r?\n/);
2754
2873
  return {
2755
2874
  line: t.length,
@@ -2760,7 +2879,7 @@ function W(r, e) {
2760
2879
  function pe(r) {
2761
2880
  return r.startIndex + r[1].length;
2762
2881
  }
2763
- const Pr = {
2882
+ const Sr = {
2764
2883
  preserveOrder: !1,
2765
2884
  attributeNamePrefix: "@_",
2766
2885
  attributesGroupName: !1,
@@ -2804,12 +2923,12 @@ const Pr = {
2804
2923
  },
2805
2924
  // skipEmptyListItem: false
2806
2925
  captureMetaData: !1
2807
- }, $r = function(r) {
2808
- return Object.assign({}, Pr, r);
2926
+ }, Br = function(r) {
2927
+ return Object.assign({}, Sr, r);
2809
2928
  };
2810
2929
  let me;
2811
2930
  typeof Symbol != "function" ? me = "@@xmlMetadata" : me = Symbol("XML Node Metadata");
2812
- class oe {
2931
+ class ae {
2813
2932
  constructor(e) {
2814
2933
  this.tagname = e, this.child = [], this[":@"] = {};
2815
2934
  }
@@ -2824,7 +2943,7 @@ class oe {
2824
2943
  return me;
2825
2944
  }
2826
2945
  }
2827
- class Sr {
2946
+ class Ir {
2828
2947
  constructor(e) {
2829
2948
  this.suppressValidationErr = !e;
2830
2949
  }
@@ -2835,24 +2954,24 @@ class Sr {
2835
2954
  let n = 1, o = !1, i = !1, u = "";
2836
2955
  for (; t < e.length; t++)
2837
2956
  if (e[t] === "<" && !i) {
2838
- if (o && se(e, "!ENTITY", t)) {
2957
+ if (o && oe(e, "!ENTITY", t)) {
2839
2958
  t += 7;
2840
2959
  let a, l;
2841
2960
  [a, l, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr), l.indexOf("&") === -1 && (s[a] = {
2842
2961
  regx: RegExp(`&${a};`, "g"),
2843
2962
  val: l
2844
2963
  });
2845
- } else if (o && se(e, "!ELEMENT", t)) {
2964
+ } else if (o && oe(e, "!ELEMENT", t)) {
2846
2965
  t += 8;
2847
2966
  const { index: a } = this.readElementExp(e, t + 1);
2848
2967
  t = a;
2849
- } else if (o && se(e, "!ATTLIST", t))
2968
+ } else if (o && oe(e, "!ATTLIST", t))
2850
2969
  t += 8;
2851
- else if (o && se(e, "!NOTATION", t)) {
2970
+ else if (o && oe(e, "!NOTATION", t)) {
2852
2971
  t += 9;
2853
2972
  const { index: a } = this.readNotationExp(e, t + 1, this.suppressValidationErr);
2854
2973
  t = a;
2855
- } else if (se(e, "!--", t)) i = !0;
2974
+ } else if (oe(e, "!--", t)) i = !0;
2856
2975
  else throw new Error("Invalid DOCTYPE");
2857
2976
  n++, u = "";
2858
2977
  } else if (e[t] === ">") {
@@ -2866,11 +2985,11 @@ class Sr {
2866
2985
  return { entities: s, i: t };
2867
2986
  }
2868
2987
  readEntityExp(e, t) {
2869
- t = G(e, t);
2988
+ t = W(e, t);
2870
2989
  let s = "";
2871
2990
  for (; t < e.length && !/\s/.test(e[t]) && e[t] !== '"' && e[t] !== "'"; )
2872
2991
  s += e[t], t++;
2873
- if (ge(s), t = G(e, t), !this.suppressValidationErr) {
2992
+ if (ge(s), t = W(e, t), !this.suppressValidationErr) {
2874
2993
  if (e.substring(t, t + 6).toUpperCase() === "SYSTEM")
2875
2994
  throw new Error("External entities are not supported");
2876
2995
  if (e[t] === "%")
@@ -2880,18 +2999,18 @@ class Sr {
2880
2999
  return [t, n] = this.readIdentifierVal(e, t, "entity"), t--, [s, n, t];
2881
3000
  }
2882
3001
  readNotationExp(e, t) {
2883
- t = G(e, t);
3002
+ t = W(e, t);
2884
3003
  let s = "";
2885
3004
  for (; t < e.length && !/\s/.test(e[t]); )
2886
3005
  s += e[t], t++;
2887
- !this.suppressValidationErr && ge(s), t = G(e, t);
3006
+ !this.suppressValidationErr && ge(s), t = W(e, t);
2888
3007
  const n = e.substring(t, t + 6).toUpperCase();
2889
3008
  if (!this.suppressValidationErr && n !== "SYSTEM" && n !== "PUBLIC")
2890
3009
  throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);
2891
- t += n.length, t = G(e, t);
3010
+ t += n.length, t = W(e, t);
2892
3011
  let o = null, i = null;
2893
3012
  if (n === "PUBLIC")
2894
- [t, o] = this.readIdentifierVal(e, t, "publicIdentifier"), t = G(e, t), (e[t] === '"' || e[t] === "'") && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"));
3013
+ [t, o] = this.readIdentifierVal(e, t, "publicIdentifier"), t = W(e, t), (e[t] === '"' || e[t] === "'") && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"));
2895
3014
  else if (n === "SYSTEM" && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"), !this.suppressValidationErr && !i))
2896
3015
  throw new Error("Missing mandatory system identifier for SYSTEM notation");
2897
3016
  return { notationName: s, publicIdentifier: o, systemIdentifier: i, index: --t };
@@ -2908,16 +3027,16 @@ class Sr {
2908
3027
  return t++, [t, n];
2909
3028
  }
2910
3029
  readElementExp(e, t) {
2911
- t = G(e, t);
3030
+ t = W(e, t);
2912
3031
  let s = "";
2913
3032
  for (; t < e.length && !/\s/.test(e[t]); )
2914
3033
  s += e[t], t++;
2915
3034
  if (!this.suppressValidationErr && !ve(s))
2916
3035
  throw new Error(`Invalid element name: "${s}"`);
2917
- t = G(e, t);
3036
+ t = W(e, t);
2918
3037
  let n = "";
2919
- if (e[t] === "E" && se(e, "MPTY", t)) t += 4;
2920
- else if (e[t] === "A" && se(e, "NY", t)) t += 2;
3038
+ if (e[t] === "E" && oe(e, "MPTY", t)) t += 4;
3039
+ else if (e[t] === "A" && oe(e, "NY", t)) t += 2;
2921
3040
  else if (e[t] === "(") {
2922
3041
  for (t++; t < e.length && e[t] !== ")"; )
2923
3042
  n += e[t], t++;
@@ -2932,20 +3051,20 @@ class Sr {
2932
3051
  };
2933
3052
  }
2934
3053
  readAttlistExp(e, t) {
2935
- t = G(e, t);
3054
+ t = W(e, t);
2936
3055
  let s = "";
2937
3056
  for (; t < e.length && !/\s/.test(e[t]); )
2938
3057
  s += e[t], t++;
2939
- ge(s), t = G(e, t);
3058
+ ge(s), t = W(e, t);
2940
3059
  let n = "";
2941
3060
  for (; t < e.length && !/\s/.test(e[t]); )
2942
3061
  n += e[t], t++;
2943
3062
  if (!ge(n))
2944
3063
  throw new Error(`Invalid attribute name: "${n}"`);
2945
- t = G(e, t);
3064
+ t = W(e, t);
2946
3065
  let o = "";
2947
3066
  if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
2948
- if (o = "NOTATION", t += 8, t = G(e, t), e[t] !== "(")
3067
+ if (o = "NOTATION", t += 8, t = W(e, t), e[t] !== "(")
2949
3068
  throw new Error(`Expected '(', found "${e[t]}"`);
2950
3069
  t++;
2951
3070
  let u = [];
@@ -2955,7 +3074,7 @@ class Sr {
2955
3074
  a += e[t], t++;
2956
3075
  if (a = a.trim(), !ge(a))
2957
3076
  throw new Error(`Invalid notation name: "${a}"`);
2958
- u.push(a), e[t] === "|" && (t++, t = G(e, t));
3077
+ u.push(a), e[t] === "|" && (t++, t = W(e, t));
2959
3078
  }
2960
3079
  if (e[t] !== ")")
2961
3080
  throw new Error("Unterminated list of notations");
@@ -2967,7 +3086,7 @@ class Sr {
2967
3086
  if (!this.suppressValidationErr && !u.includes(o.toUpperCase()))
2968
3087
  throw new Error(`Invalid attribute type: "${o}"`);
2969
3088
  }
2970
- t = G(e, t);
3089
+ t = W(e, t);
2971
3090
  let i = "";
2972
3091
  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"), {
2973
3092
  elementName: s,
@@ -2978,12 +3097,12 @@ class Sr {
2978
3097
  };
2979
3098
  }
2980
3099
  }
2981
- const G = (r, e) => {
3100
+ const W = (r, e) => {
2982
3101
  for (; e < r.length && /\s/.test(r[e]); )
2983
3102
  e++;
2984
3103
  return e;
2985
3104
  };
2986
- function se(r, e, t) {
3105
+ function oe(r, e, t) {
2987
3106
  for (let s = 0; s < e.length; s++)
2988
3107
  if (e[s] !== r[t + s + 1]) return !1;
2989
3108
  return !0;
@@ -2993,7 +3112,7 @@ function ge(r) {
2993
3112
  return r;
2994
3113
  throw new Error(`Invalid entity name ${r}`);
2995
3114
  }
2996
- const Ir = /^[-+]?0x[a-fA-F0-9]+$/, Br = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Vr = {
3115
+ const Vr = /^[-+]?0x[a-fA-F0-9]+$/, Lr = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, jr = {
2997
3116
  hex: !0,
2998
3117
  // oct: false,
2999
3118
  leadingZeros: !0,
@@ -3001,20 +3120,20 @@ const Ir = /^[-+]?0x[a-fA-F0-9]+$/, Br = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V
3001
3120
  eNotation: !0
3002
3121
  //skipLike: /regex/
3003
3122
  };
3004
- function Lr(r, e = {}) {
3005
- if (e = Object.assign({}, Vr, e), !r || typeof r != "string") return r;
3123
+ function Rr(r, e = {}) {
3124
+ if (e = Object.assign({}, jr, e), !r || typeof r != "string") return r;
3006
3125
  let t = r.trim();
3007
3126
  if (e.skipLike !== void 0 && e.skipLike.test(t)) return r;
3008
3127
  if (r === "0") return 0;
3009
- if (e.hex && Ir.test(t))
3010
- return Ur(t, 16);
3128
+ if (e.hex && Vr.test(t))
3129
+ return Xr(t, 16);
3011
3130
  if (t.search(/.+[eE].+/) !== -1)
3012
- return jr(r, t, e);
3131
+ return Ur(r, t, e);
3013
3132
  {
3014
- const s = Br.exec(t);
3133
+ const s = Lr.exec(t);
3015
3134
  if (s) {
3016
3135
  const n = s[1] || "", o = s[2];
3017
- let i = Mr(s[3]);
3136
+ let i = Fr(s[3]);
3018
3137
  const u = n ? (
3019
3138
  // 0., -00., 000.
3020
3139
  r[o.length + 1] === "."
@@ -3028,17 +3147,17 @@ function Lr(r, e = {}) {
3028
3147
  return e.eNotation ? a : r;
3029
3148
  if (t.indexOf(".") !== -1)
3030
3149
  return l === "0" || l === i || l === `${n}${i}` ? a : r;
3031
- let h = o ? i : t;
3032
- return o ? h === l || n + h === l ? a : r : h === l || h === n + l ? a : r;
3150
+ let p = o ? i : t;
3151
+ return o ? p === l || n + p === l ? a : r : p === l || p === n + l ? a : r;
3033
3152
  }
3034
3153
  } else
3035
3154
  return r;
3036
3155
  }
3037
3156
  }
3038
- const Rr = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
3039
- function jr(r, e, t) {
3157
+ const Mr = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
3158
+ function Ur(r, e, t) {
3040
3159
  if (!t.eNotation) return r;
3041
- const s = e.match(Rr);
3160
+ const s = e.match(Mr);
3042
3161
  if (s) {
3043
3162
  let n = s[1] || "";
3044
3163
  const o = s[3].indexOf("e") === -1 ? "E" : "e", i = s[2], u = n ? (
@@ -3049,10 +3168,10 @@ function jr(r, e, t) {
3049
3168
  } else
3050
3169
  return r;
3051
3170
  }
3052
- function Mr(r) {
3171
+ function Fr(r) {
3053
3172
  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;
3054
3173
  }
3055
- function Ur(r, e) {
3174
+ function Xr(r, e) {
3056
3175
  if (parseInt) return parseInt(r, e);
3057
3176
  if (Number.parseInt) return Number.parseInt(r, e);
3058
3177
  if (window && window.parseInt) return window.parseInt(r, e);
@@ -3065,7 +3184,7 @@ function We(r) {
3065
3184
  return !0;
3066
3185
  } : () => !1;
3067
3186
  }
3068
- class Fr {
3187
+ class Hr {
3069
3188
  constructor(e) {
3070
3189
  this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
3071
3190
  apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
@@ -3088,10 +3207,10 @@ class Fr {
3088
3207
  inr: { regex: /&(inr|#8377);/g, val: "₹" },
3089
3208
  num_dec: { regex: /&#([0-9]{1,7});/g, val: (t, s) => String.fromCodePoint(Number.parseInt(s, 10)) },
3090
3209
  num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t, s) => String.fromCodePoint(Number.parseInt(s, 16)) }
3091
- }, 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);
3210
+ }, this.addExternalEntities = Kr, this.parseXml = Gr, this.parseTextData = qr, this.resolveNameSpace = Qr, this.buildAttributesMap = Yr, this.isItStopNode = Jr, this.replaceEntitiesValue = zr, this.readStopNodeData = tn, this.saveTextToParentTag = Dr, this.addChild = Zr, this.ignoreAttributesFn = We(this.options.ignoreAttributes);
3092
3211
  }
3093
3212
  }
3094
- function Xr(r) {
3213
+ function Kr(r) {
3095
3214
  const e = Object.keys(r);
3096
3215
  for (let t = 0; t < e.length; t++) {
3097
3216
  const s = e[t];
@@ -3101,14 +3220,14 @@ function Xr(r) {
3101
3220
  };
3102
3221
  }
3103
3222
  }
3104
- function Hr(r, e, t, s, n, o, i) {
3223
+ function qr(r, e, t, s, n, o, i) {
3105
3224
  if (r !== void 0 && (this.options.trimValues && !s && (r = r.trim()), r.length > 0)) {
3106
3225
  i || (r = this.replaceEntitiesValue(r));
3107
3226
  const u = this.options.tagValueProcessor(e, r, t, n, o);
3108
3227
  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;
3109
3228
  }
3110
3229
  }
3111
- function Kr(r) {
3230
+ function Qr(r) {
3112
3231
  if (this.options.removeNSPrefix) {
3113
3232
  const e = r.split(":"), t = r.charAt(0) === "/" ? "/" : "";
3114
3233
  if (e[0] === "xmlns")
@@ -3117,10 +3236,10 @@ function Kr(r) {
3117
3236
  }
3118
3237
  return r;
3119
3238
  }
3120
- const qr = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
3239
+ const Wr = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
3121
3240
  function Yr(r, e, t) {
3122
3241
  if (this.options.ignoreAttributes !== !0 && typeof r == "string") {
3123
- const s = Ye(r, qr), n = s.length, o = {};
3242
+ const s = qe(r, Wr), n = s.length, o = {};
3124
3243
  for (let i = 0; i < n; i++) {
3125
3244
  const u = this.resolveNameSpace(s[i][1]);
3126
3245
  if (this.ignoreAttributesFn(u, e))
@@ -3129,8 +3248,8 @@ function Yr(r, e, t) {
3129
3248
  if (u.length)
3130
3249
  if (this.options.transformAttributeName && (l = this.options.transformAttributeName(l)), l === "__proto__" && (l = "#__proto__"), a !== void 0) {
3131
3250
  this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
3132
- const h = this.options.attributeValueProcessor(u, a, e);
3133
- h == null ? o[l] = a : typeof h != typeof a || h !== a ? o[l] = h : o[l] = Ce(
3251
+ const p = this.options.attributeValueProcessor(u, a, e);
3252
+ p == null ? o[l] = a : typeof p != typeof a || p !== a ? o[l] = p : o[l] = Ce(
3134
3253
  a,
3135
3254
  this.options.parseAttributeValue,
3136
3255
  this.options.numberParseOptions
@@ -3146,37 +3265,37 @@ function Yr(r, e, t) {
3146
3265
  return o;
3147
3266
  }
3148
3267
  }
3149
- const Qr = function(r) {
3268
+ const Gr = function(r) {
3150
3269
  r = r.replace(/\r\n?/g, `
3151
3270
  `);
3152
- const e = new oe("!xml");
3271
+ const e = new ae("!xml");
3153
3272
  let t = e, s = "", n = "";
3154
- const o = new Sr(this.options.processEntities);
3273
+ const o = new Ir(this.options.processEntities);
3155
3274
  for (let i = 0; i < r.length; i++)
3156
3275
  if (r[i] === "<")
3157
3276
  if (r[i + 1] === "/") {
3158
- const a = ie(r, ">", i, "Closing Tag is not closed.");
3277
+ const a = le(r, ">", i, "Closing Tag is not closed.");
3159
3278
  let l = r.substring(i + 2, a).trim();
3160
3279
  if (this.options.removeNSPrefix) {
3161
- const b = l.indexOf(":");
3162
- b !== -1 && (l = l.substr(b + 1));
3280
+ const v = l.indexOf(":");
3281
+ v !== -1 && (l = l.substr(v + 1));
3163
3282
  }
3164
3283
  this.options.transformTagName && (l = this.options.transformTagName(l)), t && (s = this.saveTextToParentTag(s, t, n));
3165
- const h = n.substring(n.lastIndexOf(".") + 1);
3284
+ const p = n.substring(n.lastIndexOf(".") + 1);
3166
3285
  if (l && this.options.unpairedTags.indexOf(l) !== -1)
3167
3286
  throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`);
3168
- let f = 0;
3169
- h && this.options.unpairedTags.indexOf(h) !== -1 ? (f = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : f = n.lastIndexOf("."), n = n.substring(0, f), t = this.tagsNodeStack.pop(), s = "", i = a;
3287
+ let h = 0;
3288
+ p && this.options.unpairedTags.indexOf(p) !== -1 ? (h = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : h = n.lastIndexOf("."), n = n.substring(0, h), t = this.tagsNodeStack.pop(), s = "", i = a;
3170
3289
  } else if (r[i + 1] === "?") {
3171
3290
  let a = we(r, i, !1, "?>");
3172
3291
  if (!a) throw new Error("Pi Tag is not closed.");
3173
3292
  if (s = this.saveTextToParentTag(s, t, n), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
3174
- const l = new oe(a.tagName);
3293
+ const l = new ae(a.tagName);
3175
3294
  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);
3176
3295
  }
3177
3296
  i = a.closeIndex + 1;
3178
3297
  } else if (r.substr(i + 1, 3) === "!--") {
3179
- const a = ie(r, "-->", i + 4, "Comment is not closed.");
3298
+ const a = le(r, "-->", i + 4, "Comment is not closed.");
3180
3299
  if (this.options.commentPropName) {
3181
3300
  const l = r.substring(i + 4, a - 2);
3182
3301
  s = this.saveTextToParentTag(s, t, n), t.add(this.options.commentPropName, [{ [this.options.textNodeName]: l }]);
@@ -3186,53 +3305,53 @@ const Qr = function(r) {
3186
3305
  const a = o.readDocType(r, i);
3187
3306
  this.docTypeEntities = a.entities, i = a.i;
3188
3307
  } else if (r.substr(i + 1, 2) === "![") {
3189
- const a = ie(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
3308
+ const a = le(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
3190
3309
  s = this.saveTextToParentTag(s, t, n);
3191
- let h = this.parseTextData(l, t.tagname, n, !0, !1, !0, !0);
3192
- h == null && (h = ""), this.options.cdataPropName ? t.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : t.add(this.options.textNodeName, h), i = a + 2;
3310
+ let p = this.parseTextData(l, t.tagname, n, !0, !1, !0, !0);
3311
+ p == null && (p = ""), this.options.cdataPropName ? t.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : t.add(this.options.textNodeName, p), i = a + 2;
3193
3312
  } else {
3194
3313
  let a = we(r, i, this.options.removeNSPrefix), l = a.tagName;
3195
- const h = a.rawTagName;
3196
- let f = a.tagExp, b = a.attrExpPresent, m = a.closeIndex;
3314
+ const p = a.rawTagName;
3315
+ let h = a.tagExp, v = a.attrExpPresent, b = a.closeIndex;
3197
3316
  this.options.transformTagName && (l = this.options.transformTagName(l)), t && s && t.tagname !== "!xml" && (s = this.saveTextToParentTag(s, t, n, !1));
3198
- const w = t;
3199
- 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);
3200
- const S = i;
3317
+ const A = t;
3318
+ A && this.options.unpairedTags.indexOf(A.tagname) !== -1 && (t = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), l !== e.tagname && (n += n ? "." + l : l);
3319
+ const P = i;
3201
3320
  if (this.isItStopNode(this.options.stopNodes, n, l)) {
3202
- let _ = "";
3203
- if (f.length > 0 && f.lastIndexOf("/") === f.length - 1)
3204
- 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;
3321
+ let k = "";
3322
+ if (h.length > 0 && h.lastIndexOf("/") === h.length - 1)
3323
+ l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), n = n.substr(0, n.length - 1), h = l) : h = h.substr(0, h.length - 1), i = a.closeIndex;
3205
3324
  else if (this.options.unpairedTags.indexOf(l) !== -1)
3206
3325
  i = a.closeIndex;
3207
3326
  else {
3208
- const H = this.readStopNodeData(r, h, m + 1);
3209
- if (!H) throw new Error(`Unexpected end of ${h}`);
3210
- i = H.i, _ = H.tagContent;
3327
+ const F = this.readStopNodeData(r, p, b + 1);
3328
+ if (!F) throw new Error(`Unexpected end of ${p}`);
3329
+ i = F.i, k = F.tagContent;
3211
3330
  }
3212
- const j = new oe(l);
3213
- 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);
3331
+ const S = new ae(l);
3332
+ l !== h && v && (S[":@"] = this.buildAttributesMap(h, n, l)), k && (k = this.parseTextData(k, l, n, !0, v, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), S.add(this.options.textNodeName, k), this.addChild(t, S, n, P);
3214
3333
  } else {
3215
- if (f.length > 0 && f.lastIndexOf("/") === f.length - 1) {
3216
- 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));
3217
- const _ = new oe(l);
3218
- l !== f && b && (_[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, _, n, S), n = n.substr(0, n.lastIndexOf("."));
3334
+ if (h.length > 0 && h.lastIndexOf("/") === h.length - 1) {
3335
+ l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), n = n.substr(0, n.length - 1), h = l) : h = h.substr(0, h.length - 1), this.options.transformTagName && (l = this.options.transformTagName(l));
3336
+ const k = new ae(l);
3337
+ l !== h && v && (k[":@"] = this.buildAttributesMap(h, n, l)), this.addChild(t, k, n, P), n = n.substr(0, n.lastIndexOf("."));
3219
3338
  } else {
3220
- const _ = new oe(l);
3221
- this.tagsNodeStack.push(t), l !== f && b && (_[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, _, n, S), t = _;
3339
+ const k = new ae(l);
3340
+ this.tagsNodeStack.push(t), l !== h && v && (k[":@"] = this.buildAttributesMap(h, n, l)), this.addChild(t, k, n, P), t = k;
3222
3341
  }
3223
- s = "", i = m;
3342
+ s = "", i = b;
3224
3343
  }
3225
3344
  }
3226
3345
  else
3227
3346
  s += r[i];
3228
3347
  return e.child;
3229
3348
  };
3230
- function Wr(r, e, t, s) {
3349
+ function Zr(r, e, t, s) {
3231
3350
  this.options.captureMetaData || (s = void 0);
3232
3351
  const n = this.options.updateTag(e.tagname, t, e[":@"]);
3233
3352
  n === !1 || (typeof n == "string" && (e.tagname = n), r.addChild(e, s));
3234
3353
  }
3235
- const Gr = function(r) {
3354
+ const zr = function(r) {
3236
3355
  if (this.options.processEntities) {
3237
3356
  for (let e in this.docTypeEntities) {
3238
3357
  const t = this.docTypeEntities[e];
@@ -3251,7 +3370,7 @@ const Gr = function(r) {
3251
3370
  }
3252
3371
  return r;
3253
3372
  };
3254
- function Zr(r, e, t, s) {
3373
+ function Dr(r, e, t, s) {
3255
3374
  return r && (s === void 0 && (s = e.child.length === 0), r = this.parseTextData(
3256
3375
  r,
3257
3376
  e.tagname,
@@ -3261,7 +3380,7 @@ function Zr(r, e, t, s) {
3261
3380
  s
3262
3381
  ), r !== void 0 && r !== "" && e.add(this.options.textNodeName, r), r = ""), r;
3263
3382
  }
3264
- function zr(r, e, t) {
3383
+ function Jr(r, e, t) {
3265
3384
  const s = "*." + t;
3266
3385
  for (const n in r) {
3267
3386
  const o = r[n];
@@ -3269,7 +3388,7 @@ function zr(r, e, t) {
3269
3388
  }
3270
3389
  return !1;
3271
3390
  }
3272
- function Dr(r, e, t = ">") {
3391
+ function en(r, e, t = ">") {
3273
3392
  let s, n = "";
3274
3393
  for (let o = e; o < r.length; o++) {
3275
3394
  let i = r[o];
@@ -3293,39 +3412,39 @@ function Dr(r, e, t = ">") {
3293
3412
  n += i;
3294
3413
  }
3295
3414
  }
3296
- function ie(r, e, t, s) {
3415
+ function le(r, e, t, s) {
3297
3416
  const n = r.indexOf(e, t);
3298
3417
  if (n === -1)
3299
3418
  throw new Error(s);
3300
3419
  return n + e.length - 1;
3301
3420
  }
3302
3421
  function we(r, e, t, s = ">") {
3303
- const n = Dr(r, e + 1, s);
3422
+ const n = en(r, e + 1, s);
3304
3423
  if (!n) return;
3305
3424
  let o = n.data;
3306
3425
  const i = n.index, u = o.search(/\s/);
3307
3426
  let a = o, l = !0;
3308
3427
  u !== -1 && (a = o.substring(0, u), o = o.substring(u + 1).trimStart());
3309
- const h = a;
3428
+ const p = a;
3310
3429
  if (t) {
3311
- const f = a.indexOf(":");
3312
- f !== -1 && (a = a.substr(f + 1), l = a !== n.data.substr(f + 1));
3430
+ const h = a.indexOf(":");
3431
+ h !== -1 && (a = a.substr(h + 1), l = a !== n.data.substr(h + 1));
3313
3432
  }
3314
3433
  return {
3315
3434
  tagName: a,
3316
3435
  tagExp: o,
3317
3436
  closeIndex: i,
3318
3437
  attrExpPresent: l,
3319
- rawTagName: h
3438
+ rawTagName: p
3320
3439
  };
3321
3440
  }
3322
- function Jr(r, e, t) {
3441
+ function tn(r, e, t) {
3323
3442
  const s = t;
3324
3443
  let n = 1;
3325
3444
  for (; t < r.length; t++)
3326
3445
  if (r[t] === "<")
3327
3446
  if (r[t + 1] === "/") {
3328
- const o = ie(r, ">", t, `${e} is not closed`);
3447
+ const o = le(r, ">", t, `${e} is not closed`);
3329
3448
  if (r.substring(t + 2, o).trim() === e && (n--, n === 0))
3330
3449
  return {
3331
3450
  tagContent: r.substring(s, t),
@@ -3333,11 +3452,11 @@ function Jr(r, e, t) {
3333
3452
  };
3334
3453
  t = o;
3335
3454
  } else if (r[t + 1] === "?")
3336
- t = ie(r, "?>", t + 1, "StopNode is not closed.");
3455
+ t = le(r, "?>", t + 1, "StopNode is not closed.");
3337
3456
  else if (r.substr(t + 1, 3) === "!--")
3338
- t = ie(r, "-->", t + 3, "StopNode is not closed.");
3457
+ t = le(r, "-->", t + 3, "StopNode is not closed.");
3339
3458
  else if (r.substr(t + 1, 2) === "![")
3340
- t = ie(r, "]]>", t, "StopNode is not closed.") - 2;
3459
+ t = le(r, "]]>", t, "StopNode is not closed.") - 2;
3341
3460
  else {
3342
3461
  const o = we(r, t, ">");
3343
3462
  o && ((o && o.tagName) === e && o.tagExp[o.tagExp.length - 1] !== "/" && n++, t = o.closeIndex);
@@ -3346,19 +3465,19 @@ function Jr(r, e, t) {
3346
3465
  function Ce(r, e, t) {
3347
3466
  if (e && typeof r == "string") {
3348
3467
  const s = r.trim();
3349
- return s === "true" ? !0 : s === "false" ? !1 : Lr(r, t);
3468
+ return s === "true" ? !0 : s === "false" ? !1 : Rr(r, t);
3350
3469
  } else
3351
- return Er(r) ? r : "";
3470
+ return xr(r) ? r : "";
3352
3471
  }
3353
- const Ae = oe.getMetaDataSymbol();
3354
- function en(r, e) {
3355
- return Ge(r, e);
3472
+ const Ne = ae.getMetaDataSymbol();
3473
+ function rn(r, e) {
3474
+ return Ye(r, e);
3356
3475
  }
3357
- function Ge(r, e, t) {
3476
+ function Ye(r, e, t) {
3358
3477
  let s;
3359
3478
  const n = {};
3360
3479
  for (let o = 0; o < r.length; o++) {
3361
- const i = r[o], u = tn(i);
3480
+ const i = r[o], u = nn(i);
3362
3481
  let a = "";
3363
3482
  if (t === void 0 ? a = u : a = t + "." + u, u === e.textNodeName)
3364
3483
  s === void 0 ? s = i[u] : s += "" + i[u];
@@ -3366,22 +3485,22 @@ function Ge(r, e, t) {
3366
3485
  if (u === void 0)
3367
3486
  continue;
3368
3487
  if (i[u]) {
3369
- let l = Ge(i[u], e, a);
3370
- const h = nn(l, e);
3371
- i[Ae] !== void 0 && (l[Ae] = i[Ae]), 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;
3488
+ let l = Ye(i[u], e, a);
3489
+ const p = on(l, e);
3490
+ i[Ne] !== void 0 && (l[Ne] = i[Ne]), i[":@"] ? sn(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, p) ? n[u] = [l] : n[u] = l;
3372
3491
  }
3373
3492
  }
3374
3493
  }
3375
3494
  return typeof s == "string" ? s.length > 0 && (n[e.textNodeName] = s) : s !== void 0 && (n[e.textNodeName] = s), n;
3376
3495
  }
3377
- function tn(r) {
3496
+ function nn(r) {
3378
3497
  const e = Object.keys(r);
3379
3498
  for (let t = 0; t < e.length; t++) {
3380
3499
  const s = e[t];
3381
3500
  if (s !== ":@") return s;
3382
3501
  }
3383
3502
  }
3384
- function rn(r, e, t, s) {
3503
+ function sn(r, e, t, s) {
3385
3504
  if (e) {
3386
3505
  const n = Object.keys(e), o = n.length;
3387
3506
  for (let i = 0; i < o; i++) {
@@ -3390,13 +3509,13 @@ function rn(r, e, t, s) {
3390
3509
  }
3391
3510
  }
3392
3511
  }
3393
- function nn(r, e) {
3512
+ function on(r, e) {
3394
3513
  const { textNodeName: t } = e, s = Object.keys(r).length;
3395
3514
  return !!(s === 0 || s === 1 && (r[t] || typeof r[t] == "boolean" || r[t] === 0));
3396
3515
  }
3397
- class sn {
3516
+ class an {
3398
3517
  constructor(e) {
3399
- this.externalEntities = {}, this.options = $r(e);
3518
+ this.externalEntities = {}, this.options = Br(e);
3400
3519
  }
3401
3520
  /**
3402
3521
  * Parse XML dats to JS object
@@ -3414,10 +3533,10 @@ class sn {
3414
3533
  if (o !== !0)
3415
3534
  throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`);
3416
3535
  }
3417
- const s = new Fr(this.options);
3536
+ const s = new Hr(this.options);
3418
3537
  s.addExternalEntities(this.externalEntities);
3419
3538
  const n = s.parseXml(e);
3420
- return this.options.preserveOrder || n === void 0 ? n : en(n, this.options);
3539
+ return this.options.preserveOrder || n === void 0 ? n : rn(n, this.options);
3421
3540
  }
3422
3541
  /**
3423
3542
  * Add Entity which is not by default supported by this library
@@ -3444,24 +3563,24 @@ class sn {
3444
3563
  * is true in the options.
3445
3564
  */
3446
3565
  static getMetaDataSymbol() {
3447
- return oe.getMetaDataSymbol();
3566
+ return ae.getMetaDataSymbol();
3448
3567
  }
3449
3568
  }
3450
- const on = `
3569
+ const ln = `
3451
3570
  `;
3452
- function an(r, e) {
3571
+ function un(r, e) {
3453
3572
  let t = "";
3454
- return e.format && e.indentBy.length > 0 && (t = on), Ze(r, e, "", t);
3573
+ return e.format && e.indentBy.length > 0 && (t = ln), Ge(r, e, "", t);
3455
3574
  }
3456
- function Ze(r, e, t, s) {
3575
+ function Ge(r, e, t, s) {
3457
3576
  let n = "", o = !1;
3458
3577
  for (let i = 0; i < r.length; i++) {
3459
- const u = r[i], a = ln(u);
3578
+ const u = r[i], a = cn(u);
3460
3579
  if (a === void 0) continue;
3461
3580
  let l = "";
3462
3581
  if (t.length === 0 ? l = a : l = `${t}.${a}`, a === e.textNodeName) {
3463
- let w = u[a];
3464
- un(l, e) || (w = e.tagValueProcessor(a, w), w = ze(w, e)), o && (n += s), n += w, o = !1;
3582
+ let A = u[a];
3583
+ dn(l, e) || (A = e.tagValueProcessor(a, A), A = Ze(A, e)), o && (n += s), n += A, o = !1;
3465
3584
  continue;
3466
3585
  } else if (a === e.cdataPropName) {
3467
3586
  o && (n += s), n += `<![CDATA[${u[a][0][e.textNodeName]}]]>`, o = !1;
@@ -3470,19 +3589,19 @@ function Ze(r, e, t, s) {
3470
3589
  n += s + `<!--${u[a][0][e.textNodeName]}-->`, o = !0;
3471
3590
  continue;
3472
3591
  } else if (a[0] === "?") {
3473
- const w = Me(u[":@"], e), S = a === "?xml" ? "" : s;
3474
- let _ = u[a][0][e.textNodeName];
3475
- _ = _.length !== 0 ? " " + _ : "", n += S + `<${a}${_}${w}?>`, o = !0;
3592
+ const A = Re(u[":@"], e), P = a === "?xml" ? "" : s;
3593
+ let k = u[a][0][e.textNodeName];
3594
+ k = k.length !== 0 ? " " + k : "", n += P + `<${a}${k}${A}?>`, o = !0;
3476
3595
  continue;
3477
3596
  }
3478
- let h = s;
3479
- h !== "" && (h += e.indentBy);
3480
- const f = Me(u[":@"], e), b = s + `<${a}${f}`, m = Ze(u[a], e, l, h);
3481
- 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;
3597
+ let p = s;
3598
+ p !== "" && (p += e.indentBy);
3599
+ const h = Re(u[":@"], e), v = s + `<${a}${h}`, b = Ge(u[a], e, l, p);
3600
+ e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += v + ">" : n += v + "/>" : (!b || b.length === 0) && e.suppressEmptyNode ? n += v + "/>" : b && b.endsWith(">") ? n += v + `>${b}${s}</${a}>` : (n += v + ">", b && s !== "" && (b.includes("/>") || b.includes("</")) ? n += s + e.indentBy + b + s : n += b, n += `</${a}>`), o = !0;
3482
3601
  }
3483
3602
  return n;
3484
3603
  }
3485
- function ln(r) {
3604
+ function cn(r) {
3486
3605
  const e = Object.keys(r);
3487
3606
  for (let t = 0; t < e.length; t++) {
3488
3607
  const s = e[t];
@@ -3490,24 +3609,24 @@ function ln(r) {
3490
3609
  return s;
3491
3610
  }
3492
3611
  }
3493
- function Me(r, e) {
3612
+ function Re(r, e) {
3494
3613
  let t = "";
3495
3614
  if (r && !e.ignoreAttributes)
3496
3615
  for (let s in r) {
3497
3616
  if (!r.hasOwnProperty(s)) continue;
3498
3617
  let n = e.attributeValueProcessor(s, r[s]);
3499
- n = ze(n, e), n === !0 && e.suppressBooleanAttributes ? t += ` ${s.substr(e.attributeNamePrefix.length)}` : t += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
3618
+ n = Ze(n, e), n === !0 && e.suppressBooleanAttributes ? t += ` ${s.substr(e.attributeNamePrefix.length)}` : t += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
3500
3619
  }
3501
3620
  return t;
3502
3621
  }
3503
- function un(r, e) {
3622
+ function dn(r, e) {
3504
3623
  r = r.substr(0, r.length - e.textNodeName.length - 1);
3505
3624
  let t = r.substr(r.lastIndexOf(".") + 1);
3506
3625
  for (let s in e.stopNodes)
3507
3626
  if (e.stopNodes[s] === r || e.stopNodes[s] === "*." + t) return !0;
3508
3627
  return !1;
3509
3628
  }
3510
- function ze(r, e) {
3629
+ function Ze(r, e) {
3511
3630
  if (r && r.length > 0 && e.processEntities)
3512
3631
  for (let t = 0; t < e.entities.length; t++) {
3513
3632
  const s = e.entities[t];
@@ -3515,7 +3634,7 @@ function ze(r, e) {
3515
3634
  }
3516
3635
  return r;
3517
3636
  }
3518
- const cn = {
3637
+ const fn = {
3519
3638
  attributeNamePrefix: "@_",
3520
3639
  attributesGroupName: !1,
3521
3640
  textNodeName: "#text",
@@ -3549,21 +3668,21 @@ const cn = {
3549
3668
  // transformAttributeName: false,
3550
3669
  oneListGroup: !1
3551
3670
  };
3552
- function ne(r) {
3553
- this.options = Object.assign({}, cn, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3671
+ function se(r) {
3672
+ this.options = Object.assign({}, fn, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3554
3673
  return !1;
3555
- } : (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 = `>
3674
+ } : (this.ignoreAttributesFn = We(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = gn), this.processTextOrObjNode = hn, this.options.format ? (this.indentate = pn, this.tagEndChar = `>
3556
3675
  `, this.newLine = `
3557
3676
  `) : (this.indentate = function() {
3558
3677
  return "";
3559
3678
  }, this.tagEndChar = ">", this.newLine = "");
3560
3679
  }
3561
- ne.prototype.build = function(r) {
3562
- return this.options.preserveOrder ? an(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
3680
+ se.prototype.build = function(r) {
3681
+ return this.options.preserveOrder ? un(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
3563
3682
  [this.options.arrayNodeName]: r
3564
3683
  }), this.j2x(r, 0, []).val);
3565
3684
  };
3566
- ne.prototype.j2x = function(r, e, t) {
3685
+ se.prototype.j2x = function(r, e, t) {
3567
3686
  let s = "", n = "";
3568
3687
  const o = t.join(".");
3569
3688
  for (let i in r)
@@ -3587,21 +3706,21 @@ ne.prototype.j2x = function(r, e, t) {
3587
3706
  } else if (Array.isArray(r[i])) {
3588
3707
  const u = r[i].length;
3589
3708
  let a = "", l = "";
3590
- for (let h = 0; h < u; h++) {
3591
- const f = r[i][h];
3592
- if (!(typeof f > "u")) if (f === null)
3709
+ for (let p = 0; p < u; p++) {
3710
+ const h = r[i][p];
3711
+ if (!(typeof h > "u")) if (h === null)
3593
3712
  i[0] === "?" ? n += this.indentate(e) + "<" + i + "?" + this.tagEndChar : n += this.indentate(e) + "<" + i + "/" + this.tagEndChar;
3594
- else if (typeof f == "object")
3713
+ else if (typeof h == "object")
3595
3714
  if (this.options.oneListGroup) {
3596
- const b = this.j2x(f, e + 1, t.concat(i));
3597
- a += b.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (l += b.attrStr);
3715
+ const v = this.j2x(h, e + 1, t.concat(i));
3716
+ a += v.val, this.options.attributesGroupName && h.hasOwnProperty(this.options.attributesGroupName) && (l += v.attrStr);
3598
3717
  } else
3599
- a += this.processTextOrObjNode(f, i, e, t);
3718
+ a += this.processTextOrObjNode(h, i, e, t);
3600
3719
  else if (this.options.oneListGroup) {
3601
- let b = this.options.tagValueProcessor(i, f);
3602
- b = this.replaceEntitiesValue(b), a += b;
3720
+ let v = this.options.tagValueProcessor(i, h);
3721
+ v = this.replaceEntitiesValue(v), a += v;
3603
3722
  } else
3604
- a += this.buildTextValNode(f, i, "", e);
3723
+ a += this.buildTextValNode(h, i, "", e);
3605
3724
  }
3606
3725
  this.options.oneListGroup && (a = this.buildObjectNode(a, i, l, e)), n += a;
3607
3726
  } else if (this.options.attributesGroupName && i === this.options.attributesGroupName) {
@@ -3612,14 +3731,14 @@ ne.prototype.j2x = function(r, e, t) {
3612
3731
  n += this.processTextOrObjNode(r[i], i, e, t);
3613
3732
  return { attrStr: s, val: n };
3614
3733
  };
3615
- ne.prototype.buildAttrPairStr = function(r, e) {
3734
+ se.prototype.buildAttrPairStr = function(r, e) {
3616
3735
  return e = this.options.attributeValueProcessor(r, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + r : " " + r + '="' + e + '"';
3617
3736
  };
3618
- function dn(r, e, t, s) {
3737
+ function hn(r, e, t, s) {
3619
3738
  const n = this.j2x(r, t + 1, s.concat(e));
3620
3739
  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);
3621
3740
  }
3622
- ne.prototype.buildObjectNode = function(r, e, t, s) {
3741
+ se.prototype.buildObjectNode = function(r, e, t, s) {
3623
3742
  if (r === "")
3624
3743
  return e[0] === "?" ? this.indentate(s) + "<" + e + t + "?" + this.tagEndChar : this.indentate(s) + "<" + e + t + this.closeTag(e) + this.tagEndChar;
3625
3744
  {
@@ -3627,11 +3746,11 @@ ne.prototype.buildObjectNode = function(r, e, t, s) {
3627
3746
  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;
3628
3747
  }
3629
3748
  };
3630
- ne.prototype.closeTag = function(r) {
3749
+ se.prototype.closeTag = function(r) {
3631
3750
  let e = "";
3632
3751
  return this.options.unpairedTags.indexOf(r) !== -1 ? this.options.suppressUnpairedNode || (e = "/") : this.options.suppressEmptyNode ? e = "/" : e = `></${r}`, e;
3633
3752
  };
3634
- ne.prototype.buildTextValNode = function(r, e, t, s) {
3753
+ se.prototype.buildTextValNode = function(r, e, t, s) {
3635
3754
  if (this.options.cdataPropName !== !1 && e === this.options.cdataPropName)
3636
3755
  return this.indentate(s) + `<![CDATA[${r}]]>` + this.newLine;
3637
3756
  if (this.options.commentPropName !== !1 && e === this.options.commentPropName)
@@ -3643,7 +3762,7 @@ ne.prototype.buildTextValNode = function(r, e, t, s) {
3643
3762
  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;
3644
3763
  }
3645
3764
  };
3646
- ne.prototype.replaceEntitiesValue = function(r) {
3765
+ se.prototype.replaceEntitiesValue = function(r) {
3647
3766
  if (r && r.length > 0 && this.options.processEntities)
3648
3767
  for (let e = 0; e < this.options.entities.length; e++) {
3649
3768
  const t = this.options.entities[e];
@@ -3651,15 +3770,15 @@ ne.prototype.replaceEntitiesValue = function(r) {
3651
3770
  }
3652
3771
  return r;
3653
3772
  };
3654
- function fn(r) {
3773
+ function pn(r) {
3655
3774
  return this.options.indentBy.repeat(r);
3656
3775
  }
3657
- function hn(r) {
3776
+ function gn(r) {
3658
3777
  return r.startsWith(this.options.attributeNamePrefix) && r !== this.options.textNodeName ? r.substr(this.attrPrefixLen) : !1;
3659
3778
  }
3660
- const pn = {
3779
+ const mn = {
3661
3780
  validate: Qe
3662
- }, gn = {
3781
+ }, yn = {
3663
3782
  ignoreAttributes: !1,
3664
3783
  // 保留属性
3665
3784
  attributeNamePrefix: "@_",
@@ -3694,7 +3813,7 @@ const pn = {
3694
3813
  // 停止解析的节点
3695
3814
  alwaysCreateTextNode: !1
3696
3815
  // 仅在有文本时创建文本节点
3697
- }, mn = {
3816
+ }, bn = {
3698
3817
  ignoreAttributes: !1,
3699
3818
  attributeNamePrefix: "@_",
3700
3819
  textNodeName: "#text",
@@ -3706,9 +3825,9 @@ const pn = {
3706
3825
  // 不抑制空节点
3707
3826
  suppressBooleanAttributes: !1,
3708
3827
  suppressUnpairedNode: !1
3709
- }, yn = (r) => {
3828
+ }, vn = (r) => {
3710
3829
  try {
3711
- const e = pn.validate(r, {
3830
+ const e = mn.validate(r, {
3712
3831
  allowBooleanAttributes: !0
3713
3832
  });
3714
3833
  return e === !0 ? { valid: !0 } : {
@@ -3721,10 +3840,10 @@ const pn = {
3721
3840
  error: e instanceof Error ? e.message : "Unknown validation error"
3722
3841
  };
3723
3842
  }
3724
- }, De = (r, e) => {
3843
+ }, ze = (r, e) => {
3725
3844
  try {
3726
- return new sn({
3727
- ...gn,
3845
+ return new an({
3846
+ ...yn,
3728
3847
  ...e
3729
3848
  }).parse(r);
3730
3849
  } catch (t) {
@@ -3734,8 +3853,8 @@ const pn = {
3734
3853
  }
3735
3854
  }, Pe = (r, e) => {
3736
3855
  try {
3737
- let s = new ne({
3738
- ...mn,
3856
+ let s = new se({
3857
+ ...bn,
3739
3858
  format: e?.format ?? !0,
3740
3859
  indentBy: e?.indentBy ?? " "
3741
3860
  }).build(r);
@@ -3746,66 +3865,66 @@ const pn = {
3746
3865
  `XML 构建失败: ${t instanceof Error ? t.message : "Unknown error"}`
3747
3866
  );
3748
3867
  }
3749
- }, bn = (r) => Array.isArray(r) ? Ee(r, { format: !1 }) : Pe(r, { format: !1, showDeclaration: !1 }), vn = (r, e) => {
3750
- const t = De(r);
3751
- return Array.isArray(t) ? Ee(t, {
3868
+ }, _n = (r) => Array.isArray(r) ? _e(r, { format: !1 }) : Pe(r, { format: !1, showDeclaration: !1 }), En = (r, e) => {
3869
+ const t = ze(r);
3870
+ return Array.isArray(t) ? _e(t, {
3752
3871
  indent: e?.indentBy
3753
3872
  }) : Pe(t, e);
3754
- }, Ee = (r, e = {}) => {
3873
+ }, _e = (r, e = {}) => {
3755
3874
  const t = e.indent !== void 0 ? e.indent : " ", s = e.level || 0, n = e.format !== !1, o = n ? t.repeat(s) : "", i = n ? `
3756
3875
  ` : "";
3757
3876
  let u = "";
3758
3877
  for (const a of r) {
3759
3878
  if (a["?xml"]) {
3760
- const _ = a[":@"] || {}, j = Object.entries(_).map(([H, p]) => `${H.startsWith("@_") ? H.substring(2) : H}="${p}"`).join(" ");
3761
- u += `<?xml ${j}?>${i}`;
3879
+ const k = a[":@"] || {}, S = Object.entries(k).map(([F, Z]) => `${F.startsWith("@_") ? F.substring(2) : F}="${Z}"`).join(" ");
3880
+ u += `<?xml ${S}?>${i}`;
3762
3881
  continue;
3763
3882
  }
3764
3883
  if (a["#comment"]) {
3765
- const _ = a["#comment"];
3766
- if (Array.isArray(_) && _.length > 0) {
3767
- const j = _[0]["#text"] || _[0];
3768
- u += `${o}<!--${j}-->${i}`;
3884
+ const k = a["#comment"];
3885
+ if (Array.isArray(k) && k.length > 0) {
3886
+ const S = k[0]["#text"] || k[0];
3887
+ u += `${o}<!--${S}-->${i}`;
3769
3888
  }
3770
3889
  continue;
3771
3890
  }
3772
- const l = Object.keys(a).find((_) => !_.startsWith(":") && !_.startsWith("#") && !_.startsWith("__"));
3891
+ const l = Object.keys(a).find((k) => !k.startsWith(":") && !k.startsWith("#") && !k.startsWith("__"));
3773
3892
  if (!l) continue;
3774
- const h = a[l], f = a[":@"] || {}, b = Object.entries(f).map(([_, j]) => `${_.startsWith("@_") ? _.substring(2) : _}="${j}"`).join(" "), m = b ? " " + b : "";
3775
- if (!Array.isArray(h) || h.length === 0) {
3776
- u += `${o}<${l}${m}/>${i}`;
3893
+ const p = a[l], h = a[":@"] || {}, v = Object.entries(h).map(([k, S]) => `${k.startsWith("@_") ? k.substring(2) : k}="${S}"`).join(" "), b = v ? " " + v : "";
3894
+ if (!Array.isArray(p) || p.length === 0) {
3895
+ u += `${o}<${l}${b}/>${i}`;
3777
3896
  continue;
3778
3897
  }
3779
- const w = h.length === 1 && h[0]["#text"] !== void 0;
3780
- if (h.some((_) => _.__cdata)) {
3781
- const _ = h.find((j) => j.__cdata);
3782
- if (_) {
3783
- const j = _.__cdata[0]["#text"] || "";
3784
- u += `${o}<${l}${m}><![CDATA[${j}]]></${l}>${i}`;
3898
+ const A = p.length === 1 && p[0]["#text"] !== void 0;
3899
+ if (p.some((k) => k.__cdata)) {
3900
+ const k = p.find((S) => S.__cdata);
3901
+ if (k) {
3902
+ const S = k.__cdata[0]["#text"] || "";
3903
+ u += `${o}<${l}${b}><![CDATA[${S}]]></${l}>${i}`;
3785
3904
  }
3786
- } else if (w) {
3787
- const _ = h[0]["#text"];
3788
- u += `${o}<${l}${m}>${_}</${l}>${i}`;
3905
+ } else if (A) {
3906
+ const k = p[0]["#text"];
3907
+ u += `${o}<${l}${b}>${k}</${l}>${i}`;
3789
3908
  } else
3790
- u += `${o}<${l}${m}>${i}`, u += Ee(h, { indent: t, level: s + 1, format: n }), u += `${o}</${l}>${i}`;
3909
+ u += `${o}<${l}${b}>${i}`, u += _e(p, { indent: t, level: s + 1, format: n }), u += `${o}</${l}>${i}`;
3791
3910
  }
3792
3911
  return u;
3793
- }, En = {
3912
+ }, xn = {
3794
3913
  key: 0,
3795
3914
  class: "xml-format__toolbar"
3796
- }, _n = { class: "xml-format__actions" }, xn = ["disabled"], Nn = ["disabled"], An = ["disabled"], kn = ["disabled"], wn = ["disabled"], Cn = { class: "xml-format__info" }, On = {
3915
+ }, kn = { class: "xml-format__actions" }, Nn = ["disabled"], An = ["disabled"], wn = ["disabled"], Cn = ["disabled"], On = ["disabled"], Tn = { class: "xml-format__info" }, Pn = {
3797
3916
  key: 0,
3798
3917
  class: "xml-format__status xml-format__status--success"
3799
- }, Tn = {
3918
+ }, $n = {
3800
3919
  key: 1,
3801
3920
  class: "xml-format__status xml-format__status--error"
3802
- }, Pn = { class: "xml-format__content" }, $n = {
3921
+ }, Sn = { class: "xml-format__content" }, Bn = {
3803
3922
  key: 0,
3804
3923
  class: "xml-format__error"
3805
- }, Sn = {
3924
+ }, In = {
3806
3925
  key: 1,
3807
3926
  class: "xml-format__viewer"
3808
- }, In = /* @__PURE__ */ ye({
3927
+ }, Vn = /* @__PURE__ */ ye({
3809
3928
  __name: "index",
3810
3929
  props: {
3811
3930
  modelValue: { default: "" },
@@ -3819,7 +3938,7 @@ const pn = {
3819
3938
  },
3820
3939
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress", "format"],
3821
3940
  setup(r, { expose: e, emit: t }) {
3822
- Oe((E) => ({
3941
+ Oe((m) => ({
3823
3942
  "0db40539": l.value.colors.border,
3824
3943
  bd72d08a: l.value.colors.background,
3825
3944
  "1738b57a": l.value.colors.text,
@@ -3835,182 +3954,182 @@ const pn = {
3835
3954
  "61df294a": l.value.colors.error,
3836
3955
  "3307322e": l.value.colors.errorBackground
3837
3956
  }));
3838
- 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(() => {
3957
+ const s = r, n = t, o = Y(null), i = Y(""), u = Y(/* @__PURE__ */ new Set()), a = V(() => i.value === ""), l = V(() => br(s.theme)), p = V(() => !o.value || !Array.isArray(o.value) ? [] : o.value.filter((m) => !m["?xml"])), h = V(() => {
3839
3958
  if (!o.value || !Array.isArray(o.value)) return null;
3840
- const E = o.value.find((X) => X["?xml"]);
3841
- if (!E || !E[":@"]) return null;
3842
- const O = E[":@"], I = [];
3843
- 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;
3844
- }), b = V(() => h.value), m = (E) => {
3845
- if (!E || !E.trim()) {
3959
+ const m = o.value.find((j) => j["?xml"]);
3960
+ if (!m || !m[":@"]) return null;
3961
+ const O = m[":@"], $ = [];
3962
+ return O["@_version"] && $.push(`version="${O["@_version"]}"`), O["@_encoding"] && $.push(`encoding="${O["@_encoding"]}"`), O["@_standalone"] && $.push(`standalone="${O["@_standalone"]}"`), $.length > 0 ? `<?xml ${$.join(" ")}?>` : null;
3963
+ }), v = V(() => p.value), b = (m) => {
3964
+ if (!m || !m.trim()) {
3846
3965
  i.value = "", o.value = null;
3847
3966
  return;
3848
3967
  }
3849
3968
  try {
3850
- const O = yn(E);
3969
+ const O = vn(m);
3851
3970
  if (!O.valid) {
3852
3971
  i.value = O.error || "Invalid XML", o.value = null;
3853
3972
  return;
3854
3973
  }
3855
- o.value = De(E), i.value = "", he(() => {
3856
- S();
3974
+ o.value = ze(m), i.value = "", he(() => {
3975
+ P();
3857
3976
  });
3858
3977
  } catch (O) {
3859
3978
  i.value = O instanceof Error ? O.message : "Unknown parse error", o.value = null;
3860
3979
  }
3861
- }, w = (E) => {
3862
- u.value.has(E) ? u.value.delete(E) : u.value.add(E);
3863
- }, S = () => {
3864
- const E = /* @__PURE__ */ new Set(), O = (I, X = "") => {
3865
- Array.isArray(I) && I.forEach((Z, Y) => {
3866
- const Q = Object.keys(Z).find((y) => !y.startsWith(":") && !y.startsWith("#"));
3867
- if (!Q) return;
3868
- const ee = X ? `${X}[${Y}]` : `${Q}[${Y}]`;
3869
- E.add(ee);
3870
- const ae = Z[Q];
3871
- Array.isArray(ae) && O(ae, ee + "." + Q);
3980
+ }, A = (m) => {
3981
+ u.value.has(m) ? u.value.delete(m) : u.value.add(m);
3982
+ }, P = () => {
3983
+ const m = /* @__PURE__ */ new Set(), O = ($, j = "") => {
3984
+ Array.isArray($) && $.forEach((H, G) => {
3985
+ const K = Object.keys(H).find((ue) => !ue.startsWith(":") && !ue.startsWith("#"));
3986
+ if (!K) return;
3987
+ const ee = j ? `${j}[${G}]` : `${K}[${G}]`;
3988
+ m.add(ee);
3989
+ const te = H[K];
3990
+ Array.isArray(te) && O(te, ee + "." + K);
3872
3991
  });
3873
3992
  };
3874
- h.value.forEach((I, X) => {
3875
- const Z = Object.keys(I).find((Y) => !Y.startsWith(":") && !Y.startsWith("#"));
3876
- if (Z) {
3877
- const Y = `${Z}[${X}]`;
3878
- E.add(Y);
3879
- const Q = I[Z];
3880
- Array.isArray(Q) && O(Q, Y + "." + Z);
3993
+ p.value.forEach(($, j) => {
3994
+ const H = Object.keys($).find((G) => !G.startsWith(":") && !G.startsWith("#"));
3995
+ if (H) {
3996
+ const G = `${H}[${j}]`;
3997
+ m.add(G);
3998
+ const K = $[H];
3999
+ Array.isArray(K) && O(K, G + "." + H);
3881
4000
  }
3882
- }), u.value = E, n("expand-all");
3883
- }, _ = () => {
4001
+ }), u.value = m, n("expand-all");
4002
+ }, k = () => {
3884
4003
  u.value.clear(), n("collapse-all");
3885
- }, j = async () => {
4004
+ }, S = async () => {
3886
4005
  if (!(!a.value || !o.value))
3887
4006
  try {
3888
- const E = Array.isArray(o.value) ? Ee(o.value, { indent: " " }) : Pe(o.value, { format: !0, indentBy: " " });
3889
- await navigator.clipboard.writeText(E), n("copy-success", E);
3890
- } catch (E) {
3891
- const O = E instanceof Error ? E : new Error("Copy failed");
3892
- n("copy-error", O), console.error("Failed to copy XML:", E);
4007
+ const m = Array.isArray(o.value) ? _e(o.value, { indent: " " }) : Pe(o.value, { format: !0, indentBy: " " });
4008
+ await navigator.clipboard.writeText(m), n("copy-success", m);
4009
+ } catch (m) {
4010
+ const O = m instanceof Error ? m : new Error("Copy failed");
4011
+ n("copy-error", O), console.error("Failed to copy XML:", m);
3893
4012
  }
3894
- }, H = () => {
4013
+ }, F = () => {
3895
4014
  if (!(!a.value || !o.value))
3896
4015
  try {
3897
- const E = bn(o.value);
3898
- n("update:modelValue", E), n("compress", E);
3899
- } catch (E) {
3900
- console.error("Failed to compress XML:", E);
4016
+ const m = _n(o.value);
4017
+ n("update:modelValue", m), n("compress", m);
4018
+ } catch (m) {
4019
+ console.error("Failed to compress XML:", m);
3901
4020
  }
3902
- }, p = () => {
4021
+ }, Z = () => {
3903
4022
  if (a.value)
3904
4023
  try {
3905
- const E = vn(s.modelValue, {
4024
+ const m = En(s.modelValue, {
3906
4025
  format: !0,
3907
4026
  indentBy: " "
3908
4027
  });
3909
- n("update:modelValue", E), n("format", E);
3910
- } catch (E) {
3911
- console.error("Failed to format XML:", E);
4028
+ n("update:modelValue", m), n("format", m);
4029
+ } catch (m) {
4030
+ console.error("Failed to format XML:", m);
3912
4031
  }
3913
- }, $ = async (E) => {
4032
+ }, g = async (m) => {
3914
4033
  try {
3915
- const O = typeof E == "string" ? E : JSON.stringify(E, null, 2);
4034
+ const O = typeof m == "string" ? m : JSON.stringify(m, null, 2);
3916
4035
  await navigator.clipboard.writeText(O), n("copy-success", O);
3917
4036
  } catch (O) {
3918
- const I = O instanceof Error ? O : new Error("Copy failed");
3919
- n("copy-error", I), console.error("Failed to copy value:", O);
4037
+ const $ = O instanceof Error ? O : new Error("Copy failed");
4038
+ n("copy-error", $), console.error("Failed to copy value:", O);
3920
4039
  }
3921
4040
  };
3922
- return Xe(() => s.modelValue, (E) => {
3923
- m(E);
4041
+ return Fe(() => s.modelValue, (m) => {
4042
+ b(m);
3924
4043
  }, { immediate: !0 }), e({
3925
4044
  // 核心操作方法
3926
- copyXml: j,
3927
- compressSource: H,
3928
- formatSource: p,
3929
- expandAll: S,
3930
- collapseAll: _,
3931
- toggleExpand: w,
4045
+ copyXml: S,
4046
+ compressSource: F,
4047
+ formatSource: Z,
4048
+ expandAll: P,
4049
+ collapseAll: k,
4050
+ toggleExpand: A,
3932
4051
  // 状态访问方法
3933
4052
  isValidXml: () => a.value,
3934
4053
  getParsedXml: () => o.value,
3935
4054
  getExpandedNodes: () => u.value,
3936
4055
  getParseError: () => i.value,
3937
4056
  // 工具方法
3938
- parseXmlString: (E) => m(E),
3939
- copyValue: (E) => $(E)
3940
- }), (E, O) => (x(), A("div", {
4057
+ parseXmlString: (m) => b(m),
4058
+ copyValue: (m) => g(m)
4059
+ }), (m, O) => (_(), x("div", {
3941
4060
  class: Te(["xml-format", `xml-format--${l.value.name}`])
3942
4061
  }, [
3943
- E.showToolbar ? (x(), A("div", En, [
3944
- v("div", _n, [
3945
- v("button", {
4062
+ m.showToolbar ? (_(), x("div", xn, [
4063
+ y("div", kn, [
4064
+ y("button", {
3946
4065
  class: "xml-format__btn xml-format__btn--primary",
3947
- onClick: j,
4066
+ onClick: S,
3948
4067
  disabled: !a.value,
3949
4068
  title: "Copy XML"
3950
- }, " 📋 Copy ", 8, xn),
3951
- v("button", {
4069
+ }, " 📋 Copy ", 8, Nn),
4070
+ y("button", {
3952
4071
  class: "xml-format__btn xml-format__btn--secondary",
3953
- onClick: S,
4072
+ onClick: P,
3954
4073
  disabled: !a.value,
3955
4074
  title: "Expand All"
3956
- }, " ⬇️ Expand All ", 8, Nn),
3957
- v("button", {
4075
+ }, " ⬇️ Expand All ", 8, An),
4076
+ y("button", {
3958
4077
  class: "xml-format__btn xml-format__btn--secondary",
3959
- onClick: _,
4078
+ onClick: k,
3960
4079
  disabled: !a.value,
3961
4080
  title: "Collapse All"
3962
- }, " ➡️ Collapse All ", 8, An),
3963
- v("button", {
4081
+ }, " ➡️ Collapse All ", 8, wn),
4082
+ y("button", {
3964
4083
  class: "xml-format__btn xml-format__btn--secondary",
3965
- onClick: H,
4084
+ onClick: F,
3966
4085
  disabled: !a.value,
3967
4086
  title: "Compress XML"
3968
- }, " 📦 Compress ", 8, kn),
3969
- v("button", {
4087
+ }, " 📦 Compress ", 8, Cn),
4088
+ y("button", {
3970
4089
  class: "xml-format__btn xml-format__btn--secondary",
3971
- onClick: p,
4090
+ onClick: Z,
3972
4091
  disabled: !a.value,
3973
4092
  title: "Format XML"
3974
- }, " ✨ Format ", 8, wn)
4093
+ }, " ✨ Format ", 8, On)
3975
4094
  ]),
3976
- v("div", Cn, [
3977
- a.value ? (x(), A("span", On, " ✅ Valid XML ")) : (x(), A("span", Tn, " ❌ Invalid XML "))
4095
+ y("div", Tn, [
4096
+ a.value ? (_(), x("span", Pn, " ✅ Valid XML ")) : (_(), x("span", $n, " ❌ Invalid XML "))
3978
4097
  ])
3979
- ])) : F("", !0),
3980
- v("div", Pn, [
3981
- a.value ? (x(), A("div", Sn, [
3982
- f.value ? (x(), A("div", {
4098
+ ])) : U("", !0),
4099
+ y("div", Sn, [
4100
+ a.value ? (_(), x("div", In, [
4101
+ h.value ? (_(), x("div", {
3983
4102
  key: 0,
3984
4103
  class: "xml-declaration",
3985
- style: P({ color: l.value.colors.xmlDeclaration })
3986
- }, R(f.value), 5)) : F("", !0),
3987
- (x(!0), A(de, null, fe(b.value, (I, X) => (x(), He(dr, {
3988
- key: X,
3989
- node: I,
3990
- index: X,
4104
+ style: N({ color: l.value.colors.xmlDeclaration })
4105
+ }, B(h.value), 5)) : U("", !0),
4106
+ (_(!0), x(ne, null, ie(v.value, ($, j) => (_(), Xe(hr, {
4107
+ key: j,
4108
+ node: $,
4109
+ index: j,
3991
4110
  level: 0,
3992
4111
  expanded: u.value,
3993
4112
  theme: l.value,
3994
- onToggleExpand: w,
3995
- onCopy: $
4113
+ onToggleExpand: A,
4114
+ onCopy: g
3996
4115
  }, null, 8, ["node", "index", "expanded", "theme"]))), 128))
3997
- ])) : (x(), A("div", $n, [
3998
- O[0] || (O[0] = v("h4", null, "XML Parse Error:", -1)),
3999
- v("pre", null, R(i.value), 1)
4116
+ ])) : (_(), x("div", Bn, [
4117
+ O[0] || (O[0] = y("h4", null, "XML Parse Error:", -1)),
4118
+ y("pre", null, B(i.value), 1)
4000
4119
  ]))
4001
4120
  ])
4002
4121
  ], 2));
4003
4122
  }
4004
- }), jn = /* @__PURE__ */ be(In, [["__scopeId", "data-v-f9125514"]]), Bn = [Zt], Vn = (r) => {
4005
- Bn.forEach((e) => {
4123
+ }), Un = /* @__PURE__ */ be(Vn, [["__scopeId", "data-v-f9125514"]]), Ln = [Zt], jn = (r) => {
4124
+ Ln.forEach((e) => {
4006
4125
  const t = e.name || e.__name || "UnknownComponent";
4007
4126
  r.component(t, e);
4008
4127
  });
4009
- }, Mn = {
4010
- install: Vn
4128
+ }, Fn = {
4129
+ install: jn
4011
4130
  };
4012
4131
  export {
4013
4132
  Zt as JsonFormat,
4014
- jn as XmlFormat,
4015
- Mn as default
4133
+ Un as XmlFormat,
4134
+ Fn as default
4016
4135
  };