lone-format 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { defineComponent as 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";
2
- class Je {
1
+ import { defineComponent as be, useCssVars as Ce, ref as W, computed as V, resolveComponent as je, createElementBlock as A, openBlock as k, createElementVNode as y, createCommentVNode as H, withKeys as de, withModifiers as Ee, toDisplayString as B, Fragment as re, renderList as ae, createVNode as Me, normalizeClass as Oe, nextTick as he, watch as Ue, normalizeStyle as N, createBlock as Fe } from "vue";
2
+ class ze {
3
3
  /**
4
4
  * @callback HookCallback
5
5
  * @this {*|Jsep} this
@@ -42,7 +42,7 @@ class Je {
42
42
  });
43
43
  }
44
44
  }
45
- class et {
45
+ class De {
46
46
  constructor(e) {
47
47
  this.jsep = e, this.registered = {};
48
48
  }
@@ -69,7 +69,7 @@ class et {
69
69
  });
70
70
  }
71
71
  }
72
- class c {
72
+ class u {
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" + u.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 u.max_unop_len = Math.max(e.length, u.max_unop_len), u.unary_ops[e] = 1, u;
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 u.max_binop_len = Math.max(e.length, u.max_binop_len), u.binary_ops[e] = t, s ? u.right_associative.add(e) : u.right_associative.delete(e), u;
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 u.additional_identifier_chars.add(e), u;
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 u.literals[e] = t, u;
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 u.unary_ops[e], e.length === u.max_unop_len && (u.max_unop_len = u.getMaxKeyLen(u.unary_ops)), u;
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 u.unary_ops = {}, u.max_unop_len = 0, u;
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 u.additional_identifier_chars.delete(e), u;
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 u.binary_ops[e], e.length === u.max_binop_len && (u.max_binop_len = u.getMaxKeyLen(u.binary_ops)), u.right_associative.delete(e), u;
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 u.binary_ops = {}, u.max_binop_len = 0, u;
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 u.literals[e], u;
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 u.literals = {}, u;
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 u(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 u.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 && !u.binary_ops[String.fromCharCode(e)] || // any non-ASCII that is not an operator
234
+ u.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 u.isIdentifierStart(e) || u.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 (u.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 u.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 (u.hooks[e]) {
275
275
  const t = {
276
276
  context: this
277
277
  };
278
- return c.hooks[e].find(function(s) {
278
+ return u.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 === u.SPACE_CODE || e === u.TAB_CODE || e === u.LF_CODE || e === u.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: u.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 === u.SEMCOL_CODE || s === u.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, u.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 (u.binary_ops.hasOwnProperty(e) && (!u.isIdentifierStart(this.code) || this.index + e.length < this.expr.length && !u.isIdentifierPart(this.expr.charCodeAt(this.index + e.length))))
343
343
  return this.index += t, e;
344
344
  e = e.substr(0, --t);
345
345
  }
@@ -351,36 +351,36 @@ class c {
351
351
  * @returns {?jsep.BinaryExpression}
352
352
  */
353
353
  gobbleBinaryExpression() {
354
- let e, t, s, n, o, i, u, a, l;
354
+ let e, t, s, n, o, i, c, a, l;
355
355
  if (i = this.gobbleToken(), !i || (t = this.gobbleBinaryOp(), !t))
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)
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) {
359
+ prec: u.binaryPrecedence(t),
360
+ right_a: u.right_associative.has(t)
361
+ }, c = this.gobbleToken(), c || this.throwError("Expected expression after " + t), n = [i, o, c]; t = this.gobbleBinaryOp(); ) {
362
+ if (s = u.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: u.right_associative.has(t)
370
370
  }, l = t;
371
371
  const h = (f) => o.right_a && f.right_a ? s > f.prec : s <= f.prec;
372
372
  for (; n.length > 2 && h(n[n.length - 2]); )
373
- u = n.pop(), t = n.pop().value, i = n.pop(), e = {
374
- type: c.BINARY_EXP,
373
+ c = n.pop(), t = n.pop().value, i = n.pop(), e = {
374
+ type: u.BINARY_EXP,
375
375
  operator: t,
376
376
  left: i,
377
- right: u
377
+ right: c
378
378
  }, n.push(e);
379
379
  e = this.gobbleToken(), e || this.throwError("Expected expression after " + l), n.push(o, e);
380
380
  }
381
381
  for (a = n.length - 1, e = n[a]; a > 1; )
382
382
  e = {
383
- type: c.BINARY_EXP,
383
+ type: u.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, u.isDecimalDigit(e) || e === u.PERIOD_CODE)
400
400
  return this.gobbleNumericLiteral();
401
- if (e === c.SQUOTE_CODE || e === c.DQUOTE_CODE)
401
+ if (e === u.SQUOTE_CODE || e === u.DQUOTE_CODE)
402
402
  n = this.gobbleStringLiteral();
403
- else if (e === c.OBRACK_CODE)
403
+ else if (e === u.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, u.max_unop_len), s = t.length; s > 0; ) {
407
+ if (u.unary_ops.hasOwnProperty(t) && (!u.isIdentifierStart(this.code) || this.index + t.length < this.expr.length && !u.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: u.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
+ u.isIdentifierStart(e) ? (n = this.gobbleIdentifier(), u.literals.hasOwnProperty(n.name) ? n = {
420
+ type: u.LITERAL,
421
+ value: u.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 === u.this_str && (n = {
424
+ type: u.THIS_EXP
425
+ })) : e === u.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 === u.PERIOD_CODE || t === u.OBRACK_CODE || t === u.OPAREN_CODE || t === u.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 === u.QUMARK_CODE) {
443
+ if (this.expr.charCodeAt(this.index + 1) !== u.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 === u.OBRACK_CODE ? (e = {
448
+ type: u.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 !== u.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : t === u.OPAREN_CODE ? e = {
453
+ type: u.CALL_EXP,
454
+ arguments: this.gobbleArguments(u.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 === u.PERIOD_CODE || s) && (s && this.index--, this.gobbleSpaces(), e = {
457
+ type: u.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 (; u.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 === u.PERIOD_CODE)
475
+ for (e += this.expr.charAt(this.index++); u.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++)); u.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
+ u.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, u.isIdentifierStart(s) ? this.throwError("Variable names cannot start with a number (" + e + this.char + ")") : (s === u.PERIOD_CODE || e.length === 1 && e.charCodeAt(0) === u.PERIOD_CODE) && this.throwError("Unexpected period"), {
483
+ type: u.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: u.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 (u.isIdentifierStart(e) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e = this.code, u.isIdentifierPart(e)); )
545
545
  this.index++;
546
546
  return {
547
- type: c.IDENTIFIER,
547
+ type: u.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 === u.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 === u.COMMA_CODE) {
570
570
  if (this.index++, n++, n !== t.length) {
571
- if (e === c.CPAREN_CODE)
571
+ if (e === u.CPAREN_CODE)
572
572
  this.throwError("Unexpected token ,");
573
- else if (e === c.CBRACK_CODE)
573
+ else if (e === u.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 === u.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(u.CPAREN_CODE);
598
+ if (this.code === u.CPAREN_CODE)
599
599
  return this.index++, e.length === 1 ? e[0] : e.length ? {
600
- type: c.SEQUENCE_EXP,
600
+ type: u.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: u.ARRAY_EXP,
614
+ elements: this.gobbleArguments(u.CBRACK_CODE)
615
615
  };
616
616
  }
617
617
  }
618
- const tt = new Je();
619
- Object.assign(c, {
620
- hooks: tt,
621
- plugins: new et(c),
618
+ const Je = new ze();
619
+ Object.assign(u, {
620
+ hooks: Je,
621
+ plugins: new De(u),
622
622
  // Node Types
623
623
  // ----------
624
624
  // This is the full set of types that any JSEP node can be.
@@ -712,16 +712,16 @@ 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
+ u.max_unop_len = u.getMaxKeyLen(u.unary_ops);
716
+ u.max_binop_len = u.getMaxKeyLen(u.binary_ops);
717
+ const ee = (r) => new u(r).parse(), et = 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(u).filter((r) => !et.includes(r) && ee[r] === void 0).forEach((r) => {
720
+ ee[r] = u[r];
721
721
  });
722
- te.Jsep = c;
723
- const nt = "ConditionalExpression";
724
- var st = {
722
+ ee.Jsep = u;
723
+ const tt = "ConditionalExpression";
724
+ var rt = {
725
725
  name: "ternary",
726
726
  init(r) {
727
727
  r.hooks.add("after-expression", function(t) {
@@ -732,7 +732,7 @@ var st = {
732
732
  this.index++;
733
733
  const o = this.gobbleExpression();
734
734
  if (o || this.throwError("Expected expression"), t.node = {
735
- type: nt,
735
+ type: tt,
736
736
  test: s,
737
737
  consequent: n,
738
738
  alternate: o
@@ -748,17 +748,17 @@ var st = {
748
748
  });
749
749
  }
750
750
  };
751
- te.plugins.register(st);
752
- const Ie = 47, ot = 92;
753
- var it = {
751
+ ee.plugins.register(rt);
752
+ const $e = 47, nt = 92;
753
+ var st = {
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 === $e) {
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 === $e && !n) {
762
762
  const o = this.expr.slice(s, this.index);
763
763
  let i = "";
764
764
  for (; ++this.index < this.expr.length; ) {
@@ -768,46 +768,46 @@ var it = {
768
768
  else
769
769
  break;
770
770
  }
771
- let u;
771
+ let c;
772
772
  try {
773
- u = new RegExp(o, i);
773
+ c = new RegExp(o, i);
774
774
  } catch (a) {
775
775
  this.throwError(a.message);
776
776
  }
777
777
  return t.node = {
778
778
  type: r.LITERAL,
779
- value: u,
779
+ value: c,
780
780
  raw: this.expr.slice(s - 1, this.index)
781
781
  }, t.node = this.gobbleTokenProperty(t.node), t.node;
782
782
  }
783
- this.code === r.OBRACK_CODE ? n = !0 : n && this.code === r.CBRACK_CODE && (n = !1), this.index += this.code === ot ? 2 : 1;
783
+ this.code === r.OBRACK_CODE ? n = !0 : n && this.code === r.CBRACK_CODE && (n = !1), this.index += this.code === nt ? 2 : 1;
784
784
  }
785
785
  this.throwError("Unclosed Regex");
786
786
  }
787
787
  });
788
788
  }
789
789
  };
790
- const Ne = 43, at = 45, ce = {
790
+ const xe = 43, ot = 45, fe = {
791
791
  name: "assignment",
792
792
  assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
793
- updateOperators: [Ne, at],
793
+ updateOperators: [xe, ot],
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 === xe ? "++" : "--",
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 === xe ? "++" : "--",
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
+ ee.plugins.register(st, fe);
826
+ ee.addUnaryOp("typeof");
827
+ ee.addLiteral("null", null);
828
+ ee.addLiteral("undefined", void 0);
829
+ const it = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]), j = {
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 j.evalBinaryExpression(r, e);
839
839
  case "Compound":
840
- return M.evalCompound(r, e);
840
+ return j.evalCompound(r, e);
841
841
  case "ConditionalExpression":
842
- return M.evalConditionalExpression(r, e);
842
+ return j.evalConditionalExpression(r, e);
843
843
  case "Identifier":
844
- return M.evalIdentifier(r, e);
844
+ return j.evalIdentifier(r, e);
845
845
  case "Literal":
846
- return M.evalLiteral(r, e);
846
+ return j.evalLiteral(r, e);
847
847
  case "MemberExpression":
848
- return M.evalMemberExpression(r, e);
848
+ return j.evalMemberExpression(r, e);
849
849
  case "UnaryExpression":
850
- return M.evalUnaryExpression(r, e);
850
+ return j.evalUnaryExpression(r, e);
851
851
  case "ArrayExpression":
852
- return M.evalArrayExpression(r, e);
852
+ return j.evalArrayExpression(r, e);
853
853
  case "CallExpression":
854
- return M.evalCallExpression(r, e);
854
+ return j.evalCallExpression(r, e);
855
855
  case "AssignmentExpression":
856
- return M.evalAssignmentExpression(r, e);
856
+ return j.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](j.evalAst(r.left, e), () => j.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 = j.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 j.evalAst(r.test, e) ? j.evalAst(r.consequent, e) : j.evalAst(r.alternate, e);
899
899
  },
900
900
  evalIdentifier(r, e) {
901
901
  if (Object.hasOwn(e, r.name))
@@ -910,46 +910,46 @@ 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 ? j.evalAst(r.property) : r.property.name
914
914
  // `object.property` property is Identifier
915
- ), s = M.evalAst(r.object, e);
915
+ ), s = j.evalAst(r.object, e);
916
916
  if (s == null)
917
917
  throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);
918
- if (!Object.hasOwn(s, t) && lt.has(t))
918
+ if (!Object.hasOwn(s, t) && it.has(t))
919
919
  throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);
920
920
  const n = s[t];
921
921
  return typeof n == "function" ? n.bind(s) : n;
922
922
  },
923
923
  evalUnaryExpression(r, e) {
924
924
  return {
925
- "-": (s) => -M.evalAst(s, e),
926
- "!": (s) => !M.evalAst(s, e),
927
- "~": (s) => ~M.evalAst(s, e),
925
+ "-": (s) => -j.evalAst(s, e),
926
+ "!": (s) => !j.evalAst(s, e),
927
+ "~": (s) => ~j.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) => +j.evalAst(s, e),
930
+ typeof: (s) => typeof j.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) => j.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) => j.evalAst(n, e));
938
+ return j.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 = j.evalAst(r.right, e);
944
944
  return e[t] = s, e[t];
945
945
  }
946
946
  };
947
- class ut {
947
+ class at {
948
948
  /**
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 = ee(this.code);
953
953
  }
954
954
  /**
955
955
  * @param {object} context Object whose items will be added
@@ -958,16 +958,16 @@ 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 j.evalAst(this.ast, t);
962
962
  }
963
963
  }
964
- function re(r, e) {
964
+ function te(r, e) {
965
965
  return r = r.slice(), r.push(e), r;
966
966
  }
967
- function ke(r, e) {
967
+ function Ne(r, e) {
968
968
  return e = e.slice(), e.unshift(r), e;
969
969
  }
970
- class ct extends Error {
970
+ class lt extends Error {
971
971
  /**
972
972
  * @param {AnyResult} value The evaluated scalar value
973
973
  */
@@ -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;
@@ -993,16 +993,16 @@ function B(r, e, t, s, n) {
993
993
  path: o ? r.path : e
994
994
  };
995
995
  o ? "json" in r && (i.json = r.json) : i.json = t;
996
- const u = this.evaluate(i);
997
- if (!u || typeof u != "object")
998
- throw new ct(u);
999
- return u;
996
+ const c = this.evaluate(i);
997
+ if (!c || typeof c != "object")
998
+ throw new lt(c);
999
+ return c;
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
- wrap: u
1005
+ wrap: c
1006
1006
  } = this;
1007
1007
  if (this.currResultType = this.resultType, this.currEval = this.eval, this.currSandbox = this.sandbox, t = t || this.callback, this.currOtherTypeCallback = s || this.otherTypeCallback, e = e || this.json, r = r || this.path, r && typeof r == "object" && !Array.isArray(r)) {
1008
1008
  if (!r.path && r.path !== "")
@@ -1011,46 +1011,46 @@ B.prototype.evaluate = function(r, e, t, s) {
1011
1011
  throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');
1012
1012
  ({
1013
1013
  json: e
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;
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, c = Object.hasOwn(r, "wrap") ? r.wrap : c, 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
1020
  const l = this._trace(a, e, ["$"], n, o, t).filter(function(h) {
1021
1021
  return h && !h.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;
1026
- }, []) : u ? [] : void 0;
1023
+ return l.length ? !c && l.length === 1 && !l[0].hasArrExpr ? this._getPreferredOutput(l[0]) : l.reduce((h, f) => {
1024
+ const E = this._getPreferredOutput(f);
1025
+ return i && Array.isArray(E) ? h = h.concat(E) : h.push(E), h;
1026
+ }, []) : c ? [] : 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, c) {
1054
1054
  let a;
1055
1055
  if (!r.length)
1056
1056
  return a = {
@@ -1061,20 +1061,20 @@ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1061
1061
  hasArrExpr: i
1062
1062
  }, this._handleCallback(a, o, "value"), a;
1063
1063
  const l = r[0], h = r.slice(1), f = [];
1064
- function b(m) {
1065
- Array.isArray(m) ? m.forEach((w) => {
1064
+ function E(_) {
1065
+ Array.isArray(_) ? _.forEach((w) => {
1066
1066
  f.push(w);
1067
- }) : f.push(m);
1067
+ }) : f.push(_);
1068
1068
  }
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));
1069
+ if ((typeof l != "string" || c) && e && Object.hasOwn(e, l))
1070
+ E(this._trace(h, e[l], te(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, (_) => {
1073
+ E(this._trace(h, e[_], te(t, _), e, _, 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
+ E(this._trace(h, e, t, s, n, o, i)), this._walk(e, (_) => {
1077
+ typeof e[_] == "object" && E(this._trace(r.slice(), e[_], te(t, _), e, _, o, !0));
1078
1078
  });
1079
1079
  else {
1080
1080
  if (l === "^")
@@ -1085,68 +1085,68 @@ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1085
1085
  };
1086
1086
  if (l === "~")
1087
1087
  return a = {
1088
- path: re(t, l),
1088
+ path: te(t, l),
1089
1089
  value: n,
1090
1090
  parent: s,
1091
1091
  parentProperty: null
1092
1092
  }, this._handleCallback(a, o, "property"), a;
1093
1093
  if (l === "$")
1094
- b(this._trace(h, e, t, null, null, o, i));
1094
+ E(this._trace(h, 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
+ E(this._slice(l, h, e, t, s, n, o));
1097
1097
  else if (l.indexOf("?(") === 0) {
1098
1098
  if (this.currEval === !1)
1099
1099
  throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
1100
- const m = l.replace(/^\?\((.*?)\)$/u, "$1"), 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 _ = l.replace(/^\?\((.*?)\)$/u, "$1"), w = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(_);
1101
+ w ? this._walk(e, (O) => {
1102
+ const x = [w[2]], S = w[1] ? e[O][w[1]] : e[O];
1103
+ this._trace(x, S, t, s, n, o, !0).length > 0 && E(this._trace(h, e[O], te(t, O), e, O, o, !0));
1104
+ }) : this._walk(e, (O) => {
1105
+ this._eval(_, e[O], O, t, s, n) && E(this._trace(h, e[O], te(t, O), e, O, 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
+ E(this._trace(Ne(this._eval(l, e, t.at(-1), t.slice(0, -1), s, n), h), e, t, s, n, o, i));
1111
1111
  } else if (l[0] === "@") {
1112
- let m = !1;
1112
+ let _ = !1;
1113
1113
  const w = l.slice(1, -2);
1114
1114
  switch (w) {
1115
1115
  case "scalar":
1116
- (!e || !["object", "function"].includes(typeof e)) && (m = !0);
1116
+ (!e || !["object", "function"].includes(typeof e)) && (_ = !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 === w && (_ = !0);
1123
1123
  break;
1124
1124
  case "integer":
1125
- Number.isFinite(e) && !(e % 1) && (m = !0);
1125
+ Number.isFinite(e) && !(e % 1) && (_ = !0);
1126
1126
  break;
1127
1127
  case "number":
1128
- Number.isFinite(e) && (m = !0);
1128
+ Number.isFinite(e) && (_ = !0);
1129
1129
  break;
1130
1130
  case "nonFinite":
1131
- typeof e == "number" && !Number.isFinite(e) && (m = !0);
1131
+ typeof e == "number" && !Number.isFinite(e) && (_ = !0);
1132
1132
  break;
1133
1133
  case "object":
1134
- e && typeof e === w && (m = !0);
1134
+ e && typeof e === w && (_ = !0);
1135
1135
  break;
1136
1136
  case "array":
1137
- Array.isArray(e) && (m = !0);
1137
+ Array.isArray(e) && (_ = !0);
1138
1138
  break;
1139
1139
  case "other":
1140
- m = this.currOtherTypeCallback(e, t, s, n);
1140
+ _ = this.currOtherTypeCallback(e, t, s, n);
1141
1141
  break;
1142
1142
  case "null":
1143
- e === null && (m = !0);
1143
+ e === null && (_ = !0);
1144
1144
  break;
1145
1145
  /* c8 ignore next 2 */
1146
1146
  default:
1147
1147
  throw new TypeError("Unknown value type " + w);
1148
1148
  }
1149
- if (m)
1149
+ if (_)
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 _ = l.slice(1);
1158
+ E(this._trace(h, e[_], te(t, _), e, _, 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 _ = l.split(",");
1161
+ for (const w of _)
1162
+ E(this._trace(Ne(w, h), e, t, s, n, o, !0));
1163
+ } else !c && e && Object.hasOwn(e, l) && E(this._trace(h, e[l], te(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];
1166
+ for (let _ = 0; _ < f.length; _++) {
1167
+ const w = f[_];
1168
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]);
1169
+ const O = this._trace(w.expr, e, w.path, s, n, o, i);
1170
+ if (Array.isArray(O)) {
1171
+ f[_] = O[0];
1172
+ const x = O.length;
1173
+ for (let S = 1; S < x; S++)
1174
+ _++, f.splice(_, 0, O[S]);
1175
1175
  } else
1176
- f[m] = S;
1176
+ f[_] = O;
1177
1177
  }
1178
1178
  }
1179
1179
  return f;
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
- 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);
1193
+ const c = 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]) || c;
1195
+ h = h < 0 ? Math.max(0, h + c) : Math.min(c, h), f = f < 0 ? Math.max(0, f + c) : Math.min(c, f);
1196
+ const E = [];
1197
+ for (let _ = h; _ < f; _ += l)
1198
+ this._trace(Ne(_, e), t, s, n, o, i, !0).forEach((O) => {
1199
+ E.push(O);
1200
1200
  });
1201
- return b;
1201
+ return E;
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])));
1207
- const u = this.currEval + "Script:" + r;
1208
- if (!B.cache[u]) {
1206
+ i && (this.currSandbox._$_path = L.toPathString(s.concat([t])));
1207
+ const c = this.currEval + "Script:" + r;
1208
+ if (!L.cache[c]) {
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[c] = new this.safeVm.Script(a);
1212
1212
  else if (this.currEval === "native")
1213
- B.cache[u] = new this.vm.Script(a);
1213
+ L.cache[c] = 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[c] = new l(a);
1217
1217
  } else if (typeof this.currEval == "function")
1218
- B.cache[u] = {
1218
+ L.cache[c] = {
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[c].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,17 +1262,17 @@ B.toPathArray = function(r) {
1262
1262
  });
1263
1263
  return e[r] = n, e[r].concat();
1264
1264
  };
1265
- B.prototype.safeVm = {
1266
- Script: ut
1265
+ L.prototype.safeVm = {
1266
+ Script: at
1267
1267
  };
1268
- const dt = function(r, e, t) {
1268
+ const ct = function(r, e, t) {
1269
1269
  const s = r.length;
1270
1270
  for (let n = 0; n < s; n++) {
1271
1271
  const o = r[n];
1272
1272
  t(o) && e.push(r.splice(n--, 1)[0]);
1273
1273
  }
1274
1274
  };
1275
- class ft {
1275
+ class ut {
1276
1276
  /**
1277
1277
  * @param {string} expr Expression to evaluate
1278
1278
  */
@@ -1287,47 +1287,44 @@ class ft {
1287
1287
  runInNewContext(e) {
1288
1288
  let t = this.code;
1289
1289
  const s = Object.keys(e), n = [];
1290
- dt(s, n, (l) => typeof e[l] == "function");
1290
+ ct(s, n, (l) => typeof e[l] == "function");
1291
1291
  const o = s.map((l) => e[l]);
1292
1292
  t = n.reduce((l, h) => {
1293
1293
  let f = e[h].toString();
1294
1294
  return /function/u.test(f) || (f = "function " + f), "var " + h + "=" + f + ";" + l;
1295
1295
  }, "") + t, !/(['"])use strict\1/u.test(t) && !s.includes("arguments") && (t = "var arguments = undefined;" + t), t = t.replace(/;\s*$/u, "");
1296
- const u = t.lastIndexOf(";"), a = u !== -1 ? t.slice(0, u + 1) + " return " + t.slice(u + 1) : " return " + t;
1296
+ const c = t.lastIndexOf(";"), a = c !== -1 ? t.slice(0, c + 1) + " return " + t.slice(c + 1) : " return " + t;
1297
1297
  return new Function(...s, a)(...o);
1298
1298
  }
1299
1299
  }
1300
- B.prototype.vm = {
1301
- Script: ft
1300
+ L.prototype.vm = {
1301
+ Script: ut
1302
1302
  };
1303
- const ht = { class: "json-node" }, pt = {
1303
+ const dt = { class: "json-node" }, ft = {
1304
1304
  key: 0,
1305
1305
  class: "json-node__container"
1306
- }, gt = { class: "json-node__line" }, mt = {
1307
- key: 2,
1306
+ }, ht = { class: "json-node__line" }, pt = ["contenteditable", "onKeydown"], gt = {
1307
+ key: 1,
1308
1308
  class: "json-node__colon"
1309
- }, yt = ["title"], bt = {
1310
- key: 3,
1311
- class: "json-node__collapsed"
1312
- }, vt = {
1309
+ }, mt = ["title"], bt = ["title"], yt = {
1313
1310
  key: 4,
1314
1311
  class: "json-node__comma"
1315
- }, Et = {
1312
+ }, vt = {
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
+ }, _t = { class: "json-node__children-content" }, Et = { class: "json-node__line json-node__closing-bracket" }, xt = { class: "json-node__bracket" }, kt = {
1319
1316
  key: 0,
1320
1317
  class: "json-node__comma"
1321
- }, kt = {
1318
+ }, Nt = {
1322
1319
  key: 1,
1323
1320
  class: "json-node__primitive"
1324
- }, wt = {
1325
- key: 2,
1321
+ }, At = ["contenteditable", "onKeydown"], wt = {
1322
+ key: 1,
1326
1323
  class: "json-node__colon"
1327
- }, Ct = ["title"], Ot = {
1324
+ }, Ct = ["title"], Ot = ["contenteditable", "onKeydown"], Tt = {
1328
1325
  key: 0,
1329
1326
  class: "json-node__comma"
1330
- }, Tt = /* @__PURE__ */ ye({
1327
+ }, Pt = /* @__PURE__ */ be({
1331
1328
  name: "JsonNode",
1332
1329
  __name: "JsonNode",
1333
1330
  props: {
@@ -1341,191 +1338,202 @@ 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
+ Ce((d) => ({
1342
+ "2a18b018": d.level,
1343
+ "58a14b93": d.theme.colors.syntaxKey,
1344
+ "46fe1b3e": d.theme.colors.hoverBackground,
1345
+ fbe2c048: d.theme.colors.syntaxBracket,
1346
+ "4bd524bb": d.theme.colors.collapsedText,
1347
+ "3308d23c": d.theme.colors.collapsedBackground,
1348
+ "36380c60": d.theme.colors.collapsedBackgroundHover,
1349
+ "0892365d": d.theme.colors.syntaxString,
1350
+ "0015b195": d.theme.colors.syntaxNumber,
1351
+ "7db95f5c": d.theme.colors.syntaxBoolean,
1352
+ "88ec825a": d.theme.colors.syntaxNull,
1353
+ "537157f7": d.theme.colors.background,
1354
+ "3cee3331": d.theme.colors.selectionBackground,
1355
+ "81323cee": d.theme.colors.indentLine
1356
1356
  }));
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(() => {
1357
+ const t = r, s = e, n = W(!1), o = W(!1), i = W(""), c = W(""), a = W("string"), l = W(null), h = W(null), f = (d) => d !== null && typeof d == "object" && !Array.isArray(d) && "__protected_number__" in d && Object.keys(d).length === 1, E = (d) => f(d) ? d.__protected_number__ : "", _ = V(() => f(t.value) ? !1 : t.value !== null && typeof t.value == "object"), w = V(() => Array.isArray(t.value)), O = V(() => t.path ? t.path : t.keyName ? t.keyName : "root"), x = V(() => t.expanded.has(O.value)), S = V(() => t.keyName), X = V(() => w.value ? "[" : "{"), Z = V(() => w.value ? "]" : "}"), p = V(() => {
1358
1358
  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 = () => {
1368
- s("toggle-expand", b.value);
1369
- }, X = () => {
1359
+ const m = Object.keys(t.value).length;
1360
+ return w.value ? m > 0 ? ` ${m} items ` : " " : m > 0 ? ` ${m} keys ` : " ";
1361
+ }), g = V(() => {
1362
+ const d = typeof t.value;
1363
+ return t.value === null ? "json-node__value--null" : d === "boolean" ? "json-node__value--boolean" : d === "number" || f(t.value) ? "json-node__value--number" : d === "string" ? "json-node__value--string" : "";
1364
+ }), C = V(() => t.value === null ? "null" : typeof t.value == "boolean" || typeof t.value == "number" ? String(t.value) : f(t.value) ? E(t.value) : typeof t.value == "string" ? `"${t.value}"` : String(t.value)), $ = V(() => "Double-click to edit"), R = (d) => t.level === 0 ? d : O.value ? `${O.value}.${d}` : d, K = (d) => {
1365
+ const m = Object.keys(t.value);
1366
+ return m.indexOf(d) === m.length - 1;
1367
+ }, Y = () => {
1368
+ s("toggle-expand", O.value);
1369
+ }, q = () => {
1370
1370
  t.level !== 0 && (n.value = !0, i.value = t.keyName, he(() => {
1371
- const y = document.querySelectorAll(".json-node__key-input"), d = y[y.length - 1];
1372
- d && (d.focus(), d.select());
1371
+ if (l.value) {
1372
+ l.value.focus();
1373
+ const d = document.createRange();
1374
+ d.selectNodeContents(l.value);
1375
+ const m = window.getSelection();
1376
+ m?.removeAllRanges(), m?.addRange(d);
1377
+ }
1373
1378
  }));
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());
1379
+ }, se = () => {
1380
+ _.value || (o.value = !0, t.value === null ? a.value = "null" : f(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"), f(t.value) ? c.value = E(t.value) : typeof t.value == "string" ? c.value = t.value : c.value = String(t.value), he(() => {
1381
+ if (h.value) {
1382
+ h.value.focus();
1383
+ const d = document.createRange();
1384
+ d.selectNodeContents(h.value);
1385
+ const m = window.getSelection();
1386
+ m?.removeAllRanges(), m?.addRange(d);
1387
+ }
1378
1388
  }));
1379
- }, Y = () => {
1389
+ }, J = () => {
1380
1390
  if (t.level === 0 || !n.value) return;
1381
- const y = i.value.trim();
1382
- if (!y) {
1383
- ee();
1391
+ const d = l.value?.innerText.trim() || "";
1392
+ if (!d) {
1393
+ b();
1384
1394
  return;
1385
1395
  }
1386
- if (y === t.keyName) {
1396
+ if (d === t.keyName) {
1387
1397
  n.value = !1;
1388
1398
  return;
1389
1399
  }
1390
- n.value = !1, s("update:key", b.value, y);
1391
- }, Q = () => {
1392
- 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;
1402
- } 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;
1407
- }
1408
- }, ee = () => {
1400
+ n.value = !1, s("update:key", O.value, d);
1401
+ }, oe = () => {
1402
+ if (o.value)
1403
+ try {
1404
+ let d;
1405
+ const m = h.value?.innerText.trim() || "";
1406
+ if (a.value === "string")
1407
+ m === "null" ? d = null : m === "true" || m === "false" ? d = m === "true" : d = m;
1408
+ else if (a.value === "protected-number")
1409
+ d = { __protected_number__: m };
1410
+ else if (m === "null")
1411
+ d = null;
1412
+ else if (m === "true" || m === "false")
1413
+ d = m === "true";
1414
+ else if (!isNaN(Number(m)) && m !== "") {
1415
+ const T = Number(m);
1416
+ !Number.isSafeInteger(T) || m.length > 15 ? d = { __protected_number__: m } : d = T;
1417
+ } else
1418
+ d = m;
1419
+ s("update:value", O.value, d), o.value = !1;
1420
+ } catch (d) {
1421
+ console.error("Failed to parse value:", d), o.value = !1;
1422
+ }
1423
+ }, b = () => {
1409
1424
  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);
1425
+ }, v = () => {
1426
+ o.value = !1, f(t.value) ? c.value = E(t.value) : typeof t.value == "string" ? c.value = t.value : c.value = String(t.value);
1412
1427
  };
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", {
1428
+ return (d, m) => {
1429
+ const T = je("JsonNode", !0);
1430
+ return k(), A("div", dt, [
1431
+ _.value ? (k(), A("div", ft, [
1432
+ y("div", ht, [
1433
+ d.keyName ? (k(), A("span", {
1419
1434
  key: 0,
1420
1435
  class: "json-node__key",
1421
- onClick: X,
1422
- title: "Click to edit key"
1423
- }, ' "' + R(w.value) + '" ', 1)) : F("", !0),
1424
- y.keyName && n.value ? _e((x(), A("input", {
1425
- key: 1,
1426
- "onUpdate:modelValue": d[0] || (d[0] = (k) => i.value = k),
1427
- onKeyup: [
1428
- ue(Y, ["enter"]),
1429
- ue(ee, ["escape"])
1436
+ contenteditable: n.value,
1437
+ onDblclick: q,
1438
+ onKeydown: [
1439
+ de(Ee(J, ["prevent"]), ["enter"]),
1440
+ de(b, ["escape"])
1430
1441
  ],
1431
- onBlur: Y,
1432
- class: "json-node__key-input"
1433
- }, null, 544)), [
1434
- [xe, i.value]
1435
- ]) : F("", !0),
1436
- y.keyName ? (x(), A("span", mt, ": ")) : F("", !0),
1437
- v("span", {
1442
+ onBlur: J,
1443
+ ref_key: "keyRef",
1444
+ ref: l,
1445
+ title: "Double-click to edit key"
1446
+ }, B(n.value ? i.value : `"${S.value}"`), 41, pt)) : H("", !0),
1447
+ d.keyName ? (k(), A("span", gt, ": ")) : H("", !0),
1448
+ y("span", {
1449
+ class: "json-node__bracket json-node__bracket--clickable",
1450
+ onClick: Y,
1451
+ title: x.value ? "Click to collapse" : "Click to expand"
1452
+ }, B(X.value), 9, mt),
1453
+ x.value ? H("", !0) : (k(), A("span", {
1454
+ key: 2,
1455
+ class: "json-node__collapsed-info",
1456
+ onClick: Y,
1457
+ title: `Click to expand ${p.value.trim()}`
1458
+ }, B(p.value), 9, bt)),
1459
+ x.value ? H("", !0) : (k(), A("span", {
1460
+ key: 3,
1438
1461
  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)
1462
+ onClick: Y,
1463
+ title: "Click to expand"
1464
+ }, B(Z.value), 1)),
1465
+ !x.value && !d.isLast ? (k(), A("span", yt, ",")) : H("", !0)
1450
1466
  ]),
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,
1467
+ x.value ? (k(), A("div", vt, [
1468
+ y("div", _t, [
1469
+ (k(!0), A(re, null, ae(d.value, (P, I) => (k(), A("div", {
1470
+ key: I,
1455
1471
  class: "json-node__child"
1456
1472
  }, [
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))
1473
+ Me(T, {
1474
+ value: P,
1475
+ "key-name": w.value ? "" : String(I),
1476
+ level: d.level + 1,
1477
+ path: R(String(I)),
1478
+ expanded: d.expanded,
1479
+ theme: d.theme,
1480
+ "onUpdate:value": m[0] || (m[0] = (M, U) => d.$emit("update:value", M, U)),
1481
+ onToggleExpand: m[1] || (m[1] = (M) => d.$emit("toggle-expand", M)),
1482
+ onCopy: m[2] || (m[2] = (M) => d.$emit("copy", M)),
1483
+ "onUpdate:key": m[3] || (m[3] = (M, U) => d.$emit("update:key", M, U)),
1484
+ "is-last": K(String(I))
1469
1485
  }, null, 8, ["value", "key-name", "level", "path", "expanded", "theme", "is-last"])
1470
1486
  ]))), 128))
1471
1487
  ]),
1472
- v("div", xt, [
1473
- v("span", Nt, R(_.value), 1),
1474
- y.isLast ? F("", !0) : (x(), A("span", At, ","))
1488
+ y("div", Et, [
1489
+ y("span", xt, B(Z.value), 1),
1490
+ d.isLast ? H("", !0) : (k(), A("span", kt, ","))
1475
1491
  ])
1476
- ])) : F("", !0)
1477
- ])) : (x(), A("div", kt, [
1478
- y.keyName && !n.value ? (x(), A("span", {
1492
+ ])) : H("", !0)
1493
+ ])) : (k(), A("div", Nt, [
1494
+ d.keyName ? (k(), A("span", {
1479
1495
  key: 0,
1480
1496
  class: "json-node__key",
1481
- onClick: X,
1482
- title: "Click to edit key"
1483
- }, ' "' + R(w.value) + '" ', 1)) : F("", !0),
1484
- y.keyName && n.value ? _e((x(), A("input", {
1485
- key: 1,
1486
- "onUpdate:modelValue": d[5] || (d[5] = (k) => i.value = k),
1487
- onKeyup: [
1488
- ue(Y, ["enter"]),
1489
- ue(ee, ["escape"])
1497
+ contenteditable: n.value,
1498
+ onDblclick: q,
1499
+ onKeydown: [
1500
+ de(Ee(J, ["prevent"]), ["enter"]),
1501
+ de(b, ["escape"])
1490
1502
  ],
1491
- onBlur: Y,
1492
- class: "json-node__key-input"
1493
- }, null, 544)), [
1494
- [xe, i.value]
1495
- ]) : F("", !0),
1496
- y.keyName ? (x(), A("span", wt, ": ")) : F("", !0),
1497
- o.value ? F("", !0) : (x(), A("span", {
1498
- 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)),
1503
+ onBlur: J,
1504
+ ref_key: "keyRef",
1505
+ ref: l,
1506
+ title: "Double-click to edit key"
1507
+ }, B(n.value ? i.value : `"${S.value}"`), 41, At)) : H("", !0),
1508
+ d.keyName ? (k(), A("span", wt, ": ")) : H("", !0),
1509
+ y("span", {
1510
+ class: Oe(["json-node__value-wrapper", g.value]),
1511
+ onDblclick: se,
1502
1512
  title: $.value
1503
1513
  }, [
1504
- Se(R(p.value), 1),
1505
- y.isLast ? F("", !0) : (x(), A("span", Ot, ","))
1506
- ], 42, Ct)),
1507
- o.value ? _e((x(), A("input", {
1508
- key: 4,
1509
- "onUpdate:modelValue": d[7] || (d[7] = (k) => u.value = k),
1510
- onKeyup: [
1511
- ue(Q, ["enter"]),
1512
- ue(ae, ["escape"])
1513
- ],
1514
- onBlur: Q,
1515
- class: "json-node__value-input"
1516
- }, null, 544)), [
1517
- [xe, u.value]
1518
- ]) : F("", !0)
1514
+ y("span", {
1515
+ class: "json-node__value",
1516
+ contenteditable: o.value,
1517
+ onKeydown: [
1518
+ de(Ee(oe, ["prevent"]), ["enter"]),
1519
+ de(v, ["escape"])
1520
+ ],
1521
+ onBlur: oe,
1522
+ ref_key: "valueRef",
1523
+ ref: h
1524
+ }, B(o.value ? c.value : C.value), 41, Ot),
1525
+ d.isLast ? H("", !0) : (k(), A("span", Tt, ","))
1526
+ ], 42, Ct)
1519
1527
  ]))
1520
1528
  ]);
1521
1529
  };
1522
1530
  }
1523
- }), be = (r, e) => {
1531
+ }), ye = (r, e) => {
1524
1532
  const t = r.__vccOpts || r;
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
+ }, $t = /* @__PURE__ */ ye(Pt, [["__scopeId", "data-v-1472a8af"]]), Xe = {
1529
1537
  name: "github-light",
1530
1538
  colors: {
1531
1539
  // 背景色
@@ -1557,10 +1565,16 @@ const ht = { class: "json-node" }, pt = {
1557
1565
  syntaxBracket: "#24292f",
1558
1566
  // 悬停效果
1559
1567
  hoverBackground: "#f6f8fa",
1568
+ // 选中背景色
1569
+ selectionBackground: "rgba(9, 105, 218, 0.2)",
1570
+ // 折叠信息样式
1571
+ collapsedBackground: "#ddf4ff",
1572
+ collapsedBackgroundHover: "#b6e3ff",
1573
+ collapsedText: "#0969da",
1560
1574
  // 缩进线
1561
1575
  indentLine: "#d0d7de"
1562
1576
  }
1563
- }, $t = {
1577
+ }, St = {
1564
1578
  name: "github-dark",
1565
1579
  colors: {
1566
1580
  // 背景色
@@ -1592,10 +1606,16 @@ const ht = { class: "json-node" }, pt = {
1592
1606
  syntaxBracket: "#e6edf3",
1593
1607
  // 悬停效果
1594
1608
  hoverBackground: "#161b22",
1609
+ // 选中背景色
1610
+ selectionBackground: "rgba(121, 192, 255, 0.2)",
1611
+ // 折叠信息样式
1612
+ collapsedBackground: "#1c2128",
1613
+ collapsedBackgroundHover: "#2d333b",
1614
+ collapsedText: "#79c0ff",
1595
1615
  // 缩进线
1596
1616
  indentLine: "#30363d"
1597
1617
  }
1598
- }, St = {
1618
+ }, Bt = {
1599
1619
  name: "min-light",
1600
1620
  colors: {
1601
1621
  // 背景色 - 纯白简洁
@@ -1627,6 +1647,12 @@ const ht = { class: "json-node" }, pt = {
1627
1647
  syntaxBracket: "#374151",
1628
1648
  // 悬停效果
1629
1649
  hoverBackground: "#f9f9f9",
1650
+ // 选中背景色
1651
+ selectionBackground: "rgba(59, 130, 246, 0.2)",
1652
+ // 折叠信息样式
1653
+ collapsedBackground: "#e0f2fe",
1654
+ collapsedBackgroundHover: "#bae6fd",
1655
+ collapsedText: "#0284c7",
1630
1656
  // 缩进线
1631
1657
  indentLine: "#e5e7eb"
1632
1658
  }
@@ -1662,37 +1688,43 @@ const ht = { class: "json-node" }, pt = {
1662
1688
  syntaxBracket: "#6b5444",
1663
1689
  // 悬停效果
1664
1690
  hoverBackground: "#f8f2eb",
1691
+ // 选中背景色
1692
+ selectionBackground: "rgba(255, 107, 53, 0.2)",
1693
+ // 折叠信息样式
1694
+ collapsedBackground: "#ffe8d6",
1695
+ collapsedBackgroundHover: "#ffd4b0",
1696
+ collapsedText: "#d73502",
1665
1697
  // 缩进线
1666
1698
  indentLine: "#e8d5b7"
1667
1699
  }
1668
- }, Bt = {
1669
- "github-light": Ke,
1670
- "github-dark": $t,
1671
- "min-light": St,
1700
+ }, Vt = {
1701
+ "github-light": Xe,
1702
+ "github-dark": St,
1703
+ "min-light": Bt,
1672
1704
  "slack-ochin": It
1673
1705
  };
1674
- function Vt(r = "github-light") {
1675
- return Bt[r] || Ke;
1706
+ function Lt(r = "github-light") {
1707
+ return Vt[r] || Xe;
1676
1708
  }
1677
- const Lt = {
1709
+ const Rt = {
1678
1710
  key: 0,
1679
1711
  class: "json-format__toolbar"
1680
- }, Rt = { class: "json-format__actions" }, jt = ["disabled"], Mt = ["disabled"], Ut = ["disabled"], Ft = ["disabled"], Xt = { class: "json-format__info" }, Ht = {
1712
+ }, jt = { class: "json-format__actions" }, Mt = ["disabled"], Ut = ["disabled"], Ft = ["disabled"], Xt = ["disabled"], Ht = { class: "json-format__info" }, Kt = {
1681
1713
  key: 0,
1682
1714
  class: "json-format__status json-format__status--success"
1683
- }, Kt = {
1715
+ }, qt = {
1684
1716
  key: 1,
1685
1717
  class: "json-format__status json-format__status--error"
1686
- }, qt = { class: "json-format__content" }, Yt = {
1718
+ }, Qt = { class: "json-format__content" }, Wt = {
1687
1719
  key: 0,
1688
1720
  class: "json-format__error"
1689
- }, Qt = {
1721
+ }, Yt = {
1690
1722
  key: 1,
1691
1723
  class: "json-format__error"
1692
- }, Wt = {
1724
+ }, Gt = {
1693
1725
  key: 2,
1694
1726
  class: "json-format__viewer"
1695
- }, Gt = /* @__PURE__ */ ye({
1727
+ }, Zt = /* @__PURE__ */ be({
1696
1728
  name: "JsonFormat",
1697
1729
  __name: "index",
1698
1730
  props: {
@@ -1704,7 +1736,7 @@ const Lt = {
1704
1736
  },
1705
1737
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress"],
1706
1738
  setup(r, { expose: e, emit: t }) {
1707
- Oe((d) => ({
1739
+ Ce((b) => ({
1708
1740
  "325d5f6b": f.value.colors.border,
1709
1741
  "407388ed": f.value.colors.background,
1710
1742
  "1276f42c": f.value.colors.text,
@@ -1720,54 +1752,54 @@ const Lt = {
1720
1752
  "781064f7": f.value.colors.errorBackground,
1721
1753
  "3b9a02e9": f.value.colors.error
1722
1754
  }));
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()) {
1755
+ const s = r, n = t, o = W(null), i = W(""), c = W(/* @__PURE__ */ new Set()), a = W(null), l = W(""), h = V(() => i.value === ""), f = V(() => Lt(s.theme)), E = V(() => l.value ? null : a.value !== null ? a.value : o.value), _ = (b) => {
1756
+ if (!b.trim()) {
1725
1757
  o.value = null, i.value = "", a.value = null, l.value = "";
1726
1758
  return;
1727
1759
  }
1728
1760
  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)
1761
+ let v = b;
1762
+ const d = /(:\s*|,\s*|\[\s*)-?\d{16,}/.test(v), m = /(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(v);
1763
+ if (!d && !m)
1732
1764
  try {
1733
- o.value = JSON.parse(g), i.value = "", a.value = null, l.value = "", he(() => {
1734
- b.value !== null && $();
1765
+ o.value = JSON.parse(v), i.value = "", a.value = null, l.value = "", he(() => {
1766
+ E.value !== null && p();
1735
1767
  });
1736
1768
  return;
1737
1769
  } catch {
1738
1770
  }
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++;
1771
+ v = ((P) => {
1772
+ let I = "", M = !1, U = !1, D = 0;
1773
+ for (; D < P.length; ) {
1774
+ const ue = P[D];
1775
+ if (M)
1776
+ U ? U = !1 : ue === "\\" ? U = !0 : ue === '"' && (M = !1), I += ue, D++;
1777
+ else if (ue === '"')
1778
+ M = !0, I += ue, D++;
1747
1779
  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;
1780
+ const Pe = P.slice(D);
1781
+ let z = Pe.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);
1782
+ if (z) {
1783
+ I += z[1] + '{"__protected_number__":"' + z[2] + '"}' + z[3], D += z[0].length;
1752
1784
  continue;
1753
1785
  }
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;
1786
+ if (z = Pe.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/), z) {
1787
+ I += z[1] + '{"__protected_number__":"' + z[2] + '"}' + z[3], D += z[0].length;
1756
1788
  continue;
1757
1789
  }
1758
- L += le, J++;
1790
+ I += ue, D++;
1759
1791
  }
1760
1792
  }
1761
- return L;
1762
- })(g), o.value = JSON.parse(g), i.value = "", a.value = null, l.value = "", he(() => {
1763
- b.value !== null && $();
1793
+ return I;
1794
+ })(v), o.value = JSON.parse(v), i.value = "", a.value = null, l.value = "", he(() => {
1795
+ E.value !== null && p();
1764
1796
  });
1765
- } catch (g) {
1766
- i.value = g instanceof Error ? g.message : "Unknown parsing error", o.value = null, a.value = null, l.value = "";
1797
+ } catch (v) {
1798
+ i.value = v instanceof Error ? v.message : "Unknown parsing error", o.value = null, a.value = null, l.value = "";
1767
1799
  }
1768
- }, w = (d) => {
1769
- if (!d || !d.expression.trim()) {
1770
- S();
1800
+ }, w = (b) => {
1801
+ if (!b || !b.expression.trim()) {
1802
+ O();
1771
1803
  return;
1772
1804
  }
1773
1805
  if (!o.value) {
@@ -1775,272 +1807,275 @@ const Lt = {
1775
1807
  return;
1776
1808
  }
1777
1809
  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", `
1810
+ let v;
1811
+ if (b.type === "jsonpath")
1812
+ v = L({ path: b.expression, json: o.value }), v.length === 1 && b.expression.includes("$[") === !1 && !b.expression.endsWith("[*]") ? a.value = v[0] : a.value = v;
1813
+ else if (b.type === "js")
1814
+ v = new Function("data", `
1783
1815
  try {
1784
- return ${d.expression};
1816
+ return ${b.expression};
1785
1817
  } catch (error) {
1786
1818
  throw new Error('JavaScript expression error: ' + error.message);
1787
1819
  }
1788
- `)(o.value), a.value = g;
1820
+ `)(o.value), a.value = v;
1789
1821
  else
1790
- throw new Error(`Unsupported filter type: ${d.type}`);
1822
+ throw new Error(`Unsupported filter type: ${b.type}`);
1791
1823
  l.value = "", he(() => {
1792
- $();
1824
+ p();
1793
1825
  });
1794
- } catch (g) {
1795
- l.value = g instanceof Error ? g.message : "Filter execution error", a.value = null;
1826
+ } catch (v) {
1827
+ l.value = v instanceof Error ? v.message : "Filter execution error", a.value = null;
1796
1828
  }
1797
- }, S = () => {
1829
+ }, O = () => {
1798
1830
  a.value = null, l.value = "";
1799
1831
  };
1800
- Xe(() => s.modelValue, (d) => {
1801
- m(d);
1832
+ Ue(() => s.modelValue, (b) => {
1833
+ _(b);
1802
1834
  }, { 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) => {
1835
+ const x = (b, v, d) => {
1836
+ const m = (I) => {
1837
+ if (I === null || typeof I != "object")
1838
+ return I;
1839
+ if (!Array.isArray(I) && "__protected_number__" in I && Object.keys(I).length === 1)
1840
+ return `__PROTECTED_NUMBER_${I.__protected_number__}_PROTECTED_NUMBER__`;
1841
+ if (Array.isArray(I))
1842
+ return I.map((U) => m(U));
1843
+ const M = {};
1844
+ for (const [U, D] of Object.entries(I))
1845
+ M[U] = m(D);
1846
+ return M;
1847
+ }, T = m(b);
1848
+ return JSON.stringify(T, v, d).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g, "$1");
1849
+ }, S = (b, v) => {
1818
1850
  if (!s.readonly)
1819
1851
  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);
1852
+ const d = X(o.value, b, v), m = x(d, null, 2);
1853
+ n("update:modelValue", m);
1854
+ } catch (d) {
1855
+ console.error("Failed to update JSON:", d);
1824
1856
  }
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]);
1857
+ }, X = (b, v, d) => {
1858
+ if (!v || v === "root") return d;
1859
+ const m = v.split("."), T = q(b, m.slice(0, -1));
1860
+ let P = T;
1861
+ for (let M = 0; M < m.length - 1; M++) {
1862
+ const U = m[M];
1863
+ U !== "root" && (Array.isArray(P) ? P = P[parseInt(U)] : P = P[U]);
1832
1864
  }
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);
1865
+ const I = m[m.length - 1];
1866
+ return I === "root" ? d : (Array.isArray(P) ? P[parseInt(I)] = d : P[I] = d, T);
1867
+ }, Z = (b) => {
1868
+ c.value.has(b) ? c.value.delete(b) : c.value.add(b);
1869
+ }, p = () => {
1870
+ const b = /* @__PURE__ */ new Set(), v = (d, m = "") => {
1871
+ d !== null && typeof d == "object" && (b.add(m || "root"), Array.isArray(d) ? d.forEach((T, P) => {
1872
+ const I = m ? `${m}.${P}` : `${P}`;
1873
+ v(T, I);
1874
+ }) : Object.keys(d).forEach((T) => {
1875
+ const P = m ? `${m}.${T}` : T;
1876
+ v(d[T], P);
1845
1877
  }));
1846
1878
  };
1847
- g(b.value), u.value = d, n("expand-all");
1848
- }, E = () => {
1849
- u.value = /* @__PURE__ */ new Set(["root"]), n("collapse-all");
1850
- }, O = async () => {
1879
+ v(E.value), c.value = b, n("expand-all");
1880
+ }, g = () => {
1881
+ c.value = /* @__PURE__ */ new Set(["root"]), n("collapse-all");
1882
+ }, C = async () => {
1851
1883
  if (h.value)
1852
1884
  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"));
1885
+ const b = E.value, v = x(b, null, 2);
1886
+ await navigator.clipboard.writeText(v), n("copy-success", v);
1887
+ } catch (b) {
1888
+ console.error("Failed to copy JSON:", b), n("copy-error", b instanceof Error ? b : new Error("Failed to copy JSON"));
1857
1889
  }
1858
- }, I = () => {
1890
+ }, $ = () => {
1859
1891
  if (h.value)
1860
1892
  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);
1893
+ const b = E.value, v = x(b);
1894
+ n("update:modelValue", v), n("compress", v);
1895
+ } catch (b) {
1896
+ console.error("Failed to compress JSON:", b);
1865
1897
  }
1866
- }, X = async (d) => {
1898
+ }, R = async (b) => {
1867
1899
  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);
1900
+ let v;
1901
+ typeof b == "object" && b !== null && !Array.isArray(b) && "__protected_number__" in b && Object.keys(b).length === 1 ? v = b.__protected_number__ : typeof b == "string" ? v = `"${b}"` : v = JSON.stringify(b), await navigator.clipboard.writeText(v);
1902
+ } catch (v) {
1903
+ console.error("Failed to copy value:", v);
1872
1904
  }
1873
- }, Z = (d, g) => {
1905
+ }, K = (b, v) => {
1874
1906
  if (!s.readonly)
1875
1907
  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);
1908
+ const d = Y(o.value, b, v), m = x(d, null, 2);
1909
+ n("update:modelValue", m), oe(b, v);
1910
+ } catch (d) {
1911
+ console.error("Failed to rename key:", d);
1880
1912
  }
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;
1913
+ }, Y = (b, v, d) => {
1914
+ if (!v || v === "root") return b;
1915
+ const m = v.split("."), T = q(b, m.slice(0, -1));
1916
+ if (m.length === 1) {
1917
+ const M = m[0];
1918
+ return T && typeof T == "object" && !Array.isArray(T) ? se(T, M, d) : T;
1887
1919
  }
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];
1920
+ let P = T;
1921
+ for (let M = 0; M < m.length - 1; M++) {
1922
+ const U = m[M];
1923
+ Array.isArray(P) ? P = P[parseInt(U)] : P = P[U];
1892
1924
  }
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);
1925
+ const I = m[m.length - 1];
1926
+ if (!Array.isArray(P) && P && typeof P == "object") {
1927
+ const M = se(P, I, d), U = m.slice(0, -1);
1928
+ U.length > 0 && J(T, U, M);
1897
1929
  }
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;
1930
+ return T;
1931
+ }, q = (b, v) => {
1932
+ if (v.length === 0) return b;
1933
+ if (Array.isArray(b)) {
1934
+ const d = [...b], m = v[0], T = parseInt(m);
1935
+ return v.length === 1 || (d[T] = q(b[T], v.slice(1))), d;
1936
+ } else if (b && typeof b == "object") {
1937
+ const d = { ...b }, m = v[0];
1938
+ return v.length === 1 || (d[m] = q(b[m], v.slice(1))), d;
1907
1939
  }
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];
1940
+ return b;
1941
+ }, se = (b, v, d) => {
1942
+ if (!b || typeof b != "object" || Array.isArray(b))
1943
+ return b;
1944
+ const m = Object.keys(b), T = {};
1945
+ for (const P of m)
1946
+ P === v ? T[d] = b[P] : T[P] = b[P];
1947
+ return T;
1948
+ }, J = (b, v, d) => {
1949
+ let m = b;
1950
+ for (let P = 0; P < v.length - 1; P++) {
1951
+ const I = v[P];
1952
+ Array.isArray(m) ? m = m[parseInt(I)] : m = m[I];
1921
1953
  }
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);
1954
+ const T = v[v.length - 1];
1955
+ Array.isArray(m) ? m[parseInt(T)] = d : m[T] = d;
1956
+ }, oe = (b, v) => {
1957
+ const d = /* @__PURE__ */ new Set();
1958
+ c.value.forEach((m) => {
1959
+ if (m === b) {
1960
+ const T = b.split(".");
1961
+ T[T.length - 1] = v, d.add(T.join("."));
1962
+ } else if (m.startsWith(b + ".")) {
1963
+ const T = b.split(".");
1964
+ T[T.length - 1] = v;
1965
+ const P = T.join("."), I = m.substring(b.length);
1966
+ d.add(P + I);
1935
1967
  } else
1936
- k.add(N);
1937
- }), u.value = k;
1968
+ d.add(m);
1969
+ }), c.value = d;
1938
1970
  };
1939
1971
  return e({
1940
1972
  // 核心操作方法
1941
- copyJson: O,
1942
- compressSource: I,
1943
- expandAll: $,
1944
- collapseAll: E,
1945
- toggleExpand: p,
1946
- updateValue: j,
1947
- updateKey: Z,
1973
+ copyJson: C,
1974
+ compressSource: $,
1975
+ expandAll: p,
1976
+ collapseAll: g,
1977
+ toggleExpand: Z,
1978
+ updateValue: S,
1979
+ updateKey: K,
1948
1980
  // Filter 相关方法
1949
1981
  filter: w,
1950
- clearFilter: S,
1982
+ clearFilter: O,
1951
1983
  // 状态访问方法
1952
1984
  isValidJson: () => h.value,
1953
1985
  getParsedJson: () => o.value,
1954
1986
  getFilteredJson: () => a.value,
1955
- getExpandedNodes: () => u.value,
1987
+ getExpandedNodes: () => c.value,
1956
1988
  getParseError: () => i.value,
1957
1989
  getFilterError: () => l.value,
1958
1990
  // 工具方法
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}`])
1991
+ parseJson: (b) => _(b),
1992
+ copyValue: (b) => R(b)
1993
+ }), (b, v) => (k(), A("div", {
1994
+ class: Oe(["json-format", `json-format--${f.value.name}`])
1963
1995
  }, [
1964
- d.showToolbar ? (x(), A("div", Lt, [
1965
- v("div", Rt, [
1966
- v("button", {
1996
+ b.showToolbar ? (k(), A("div", Rt, [
1997
+ y("div", jt, [
1998
+ y("button", {
1967
1999
  class: "json-format__btn json-format__btn--primary",
1968
- onClick: O,
2000
+ onClick: C,
1969
2001
  disabled: !h.value,
1970
2002
  title: "Copy JSON"
1971
- }, " 📋 Copy ", 8, jt),
1972
- v("button", {
2003
+ }, " 📋 Copy ", 8, Mt),
2004
+ y("button", {
1973
2005
  class: "json-format__btn json-format__btn--secondary",
1974
- onClick: $,
2006
+ onClick: p,
1975
2007
  disabled: !h.value,
1976
2008
  title: "Expand All"
1977
- }, " ⬇️ Expand All ", 8, Mt),
1978
- v("button", {
2009
+ }, " ⬇️ Expand All ", 8, Ut),
2010
+ y("button", {
1979
2011
  class: "json-format__btn json-format__btn--secondary",
1980
- onClick: E,
2012
+ onClick: g,
1981
2013
  disabled: !h.value,
1982
2014
  title: "Collapse All"
1983
- }, " ➡️ Collapse All ", 8, Ut),
1984
- v("button", {
2015
+ }, " ➡️ Collapse All ", 8, Ft),
2016
+ y("button", {
1985
2017
  class: "json-format__btn json-format__btn--secondary",
1986
- onClick: I,
2018
+ onClick: $,
1987
2019
  disabled: !h.value,
1988
2020
  title: "Compress JSON"
1989
- }, " 📦 Compress ", 8, Ft)
2021
+ }, " 📦 Compress ", 8, Xt)
1990
2022
  ]),
1991
- v("div", Xt, [
1992
- h.value ? (x(), A("span", Ht, " ✅ Valid JSON ")) : (x(), A("span", Kt, " ❌ Invalid JSON "))
2023
+ y("div", Ht, [
2024
+ h.value ? (k(), A("span", Kt, " ✅ Valid JSON ")) : (k(), A("span", qt, " ❌ Invalid JSON "))
1993
2025
  ])
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,
2026
+ ])) : H("", !0),
2027
+ y("div", Qt, [
2028
+ h.value ? l.value ? (k(), A("div", Yt, [
2029
+ v[1] || (v[1] = y("h4", null, "Filter Error:", -1)),
2030
+ y("pre", null, B(l.value), 1)
2031
+ ])) : (k(), A("div", Gt, [
2032
+ Me($t, {
2033
+ value: E.value,
2002
2034
  "key-name": "",
2003
2035
  level: 0,
2004
- expanded: u.value,
2036
+ expanded: c.value,
2005
2037
  "is-last": !0,
2006
2038
  theme: f.value,
2007
- "onUpdate:value": j,
2008
- onToggleExpand: p,
2009
- onCopy: X,
2010
- "onUpdate:key": Z
2039
+ "onUpdate:value": S,
2040
+ onToggleExpand: Z,
2041
+ onCopy: R,
2042
+ "onUpdate:key": K
2011
2043
  }, 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)
2044
+ ])) : (k(), A("div", Wt, [
2045
+ v[0] || (v[0] = y("h4", null, "JSON Parse Error:", -1)),
2046
+ y("pre", null, B(i.value), 1)
2015
2047
  ]))
2016
2048
  ])
2017
2049
  ], 2));
2018
2050
  }
2019
- }), Zt = /* @__PURE__ */ be(Gt, [["__scopeId", "data-v-b956002c"]]), zt = {
2051
+ }), zt = /* @__PURE__ */ ye(Zt, [["__scopeId", "data-v-b956002c"]]), Dt = {
2020
2052
  key: 0,
2021
2053
  class: "xml-node__comment"
2022
- }, Dt = {
2054
+ }, Jt = {
2023
2055
  key: 1,
2024
2056
  class: "xml-node__cdata"
2025
- }, Jt = {
2057
+ }, er = {
2026
2058
  key: 2,
2027
2059
  class: "xml-node__element"
2028
- }, er = {
2060
+ }, tr = {
2029
2061
  key: 0,
2030
2062
  class: "xml-node__line"
2031
- }, tr = {
2063
+ }, rr = {
2032
2064
  key: 1,
2033
2065
  class: "xml-node__line"
2034
- }, rr = { key: 2 }, nr = { class: "xml-node__line" }, sr = ["title"], or = { key: 1 }, ir = ["title"], ar = {
2066
+ }, nr = { key: 2 }, sr = {
2067
+ key: 0,
2068
+ class: "xml-node__line"
2069
+ }, or = ["title"], ir = { class: "xml-node__line" }, ar = ["title"], lr = { key: 1 }, cr = ["title"], ur = {
2035
2070
  key: 0,
2036
2071
  class: "xml-node__children"
2037
- }, lr = {
2072
+ }, dr = {
2038
2073
  key: 0,
2039
2074
  class: "xml-node__text"
2040
- }, ur = {
2075
+ }, fr = {
2041
2076
  key: 1,
2042
2077
  class: "xml-node__line"
2043
- }, cr = /* @__PURE__ */ ye({
2078
+ }, hr = /* @__PURE__ */ be({
2044
2079
  __name: "XmlNode",
2045
2080
  props: {
2046
2081
  node: {},
@@ -2052,279 +2087,351 @@ const Lt = {
2052
2087
  },
2053
2088
  emits: ["toggle-expand", "copy"],
2054
2089
  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
- }), $;
2090
+ const t = r, s = e, n = V(() => Object.keys(t.node).find((g) => !g.startsWith(":") && !g.startsWith("#")) || ""), o = V(() => n.value ? t.parentPath ? `${t.parentPath}[${t.index}]` : `${n.value}[${t.index}]` : ""), i = V(() => t.expanded.has(o.value)), c = V(() => t.node["#comment"] ? "comment" : t.node.__cdata ? "cdata" : n.value ? "element" : "unknown"), a = V(() => {
2091
+ const p = t.node[":@"] || {}, g = {};
2092
+ return Object.keys(p).forEach((C) => {
2093
+ C.startsWith("@_") && (g[C.substring(2)] = p[C]);
2094
+ }), g;
2060
2095
  }), l = V(() => {
2061
- if (u.value !== "element" || !n.value) return [];
2096
+ if (c.value !== "element" || !n.value) return [];
2062
2097
  const p = t.node[n.value];
2063
2098
  return Array.isArray(p) ? p : [];
2064
2099
  }), h = V(() => l.value.some((p) => p.__cdata)), f = V(() => {
2065
2100
  if (!h.value) return "";
2066
- const p = l.value.find(($) => $.__cdata);
2101
+ const p = l.value.find((g) => g.__cdata);
2067
2102
  if (p && Array.isArray(p.__cdata)) {
2068
- const $ = p.__cdata;
2069
- if ($.length > 0 && $[0]["#text"])
2070
- return $[0]["#text"];
2103
+ const g = p.__cdata;
2104
+ if (g.length > 0 && g[0]["#text"])
2105
+ return g[0]["#text"];
2071
2106
  }
2072
2107
  return "";
2073
- }), b = V(() => {
2074
- if (u.value !== "element" || !n.value || h.value) return "";
2108
+ }), E = V(() => {
2109
+ if (c.value !== "element" || !n.value || h.value) return "";
2075
2110
  const p = t.node[n.value];
2076
2111
  if (!Array.isArray(p)) return "";
2077
- const $ = p.find((E) => E["#text"]);
2078
- return $ ? $["#text"] : "";
2079
- }), m = V(() => {
2080
- if (u.value !== "comment") return "";
2112
+ const g = p.find((C) => C["#text"]);
2113
+ return g ? g["#text"] : "";
2114
+ }), _ = V(() => {
2115
+ if (c.value !== "comment") return "";
2081
2116
  const p = t.node["#comment"];
2082
2117
  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() !== ""), _ = () => {
2118
+ }), w = V(() => l.value.some((p) => Object.keys(p).some((C) => !C.startsWith("#") && !C.startsWith(":")))), O = V(() => w.value ? l.value.filter((p) => Object.keys(p).some((C) => !C.startsWith("#") && !C.startsWith(":"))).length : 0), x = V(() => c.value === "element" && !w.value && E.value.trim() !== ""), S = () => {
2084
2119
  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", {
2120
+ }, X = (p, g) => `${o.value}-child-${g}`, Z = () => `${o.value}.${n.value}`;
2121
+ return (p, g) => {
2122
+ const C = je("XmlNode", !0);
2123
+ return k(), A("div", {
2089
2124
  class: "xml-node",
2090
- style: P({ paddingLeft: p.level > 0 ? "16px" : "0" })
2125
+ style: N({ paddingLeft: p.level > 0 ? "16px" : "0" })
2091
2126
  }, [
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", {
2127
+ c.value === "comment" ? (k(), A("div", Dt, [
2128
+ y("span", {
2129
+ style: N({ color: p.theme.colors.xmlComment })
2130
+ }, " <!-- " + B(_.value) + " --> ", 5)
2131
+ ])) : c.value === "cdata" ? (k(), A("div", Jt, [
2132
+ y("span", {
2133
+ style: N({ color: p.theme.colors.xmlCdata })
2134
+ }, " <![CDATA[" + B(p.node.__cdata) + "]]> ", 5)
2135
+ ])) : c.value === "element" ? (k(), A("div", er, [
2136
+ h.value ? (k(), A("div", tr, [
2137
+ y("span", {
2103
2138
  class: "xml-node__bracket",
2104
- style: P({ color: p.theme.colors.xmlBracket })
2139
+ style: N({ color: p.theme.colors.xmlBracket })
2105
2140
  }, "<", 4),
2106
- v("span", {
2141
+ y("span", {
2107
2142
  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,
2143
+ style: N({ color: p.theme.colors.xmlTag })
2144
+ }, B(n.value), 5),
2145
+ (k(!0), A(re, null, ae(a.value, ($, R) => (k(), A("span", {
2146
+ key: R,
2112
2147
  class: "xml-node__attribute"
2113
2148
  }, [
2114
- v("span", {
2149
+ y("span", {
2115
2150
  class: "xml-node__attr-name",
2116
- style: P({ color: p.theme.colors.xmlAttribute })
2117
- }, R(I), 5),
2118
- v("span", {
2151
+ style: N({ color: p.theme.colors.xmlAttribute })
2152
+ }, B(R), 5),
2153
+ y("span", {
2119
2154
  class: "xml-node__equals",
2120
- style: P({ color: p.theme.colors.xmlEquals })
2155
+ style: N({ color: p.theme.colors.xmlEquals })
2121
2156
  }, "=", 4),
2122
- v("span", {
2157
+ y("span", {
2123
2158
  class: "xml-node__quote",
2124
- style: P({ color: p.theme.colors.xmlQuote })
2159
+ style: N({ color: p.theme.colors.xmlQuote })
2125
2160
  }, '"', 4),
2126
- v("span", {
2161
+ y("span", {
2127
2162
  class: "xml-node__attr-value",
2128
- style: P({ color: p.theme.colors.xmlAttributeValue })
2129
- }, R(O), 5),
2130
- v("span", {
2163
+ style: N({ color: p.theme.colors.xmlAttributeValue })
2164
+ }, B($), 5),
2165
+ y("span", {
2131
2166
  class: "xml-node__quote",
2132
- style: P({ color: p.theme.colors.xmlQuote })
2167
+ style: N({ color: p.theme.colors.xmlQuote })
2133
2168
  }, '"', 4)
2134
2169
  ]))), 128)),
2135
- v("span", {
2170
+ y("span", {
2136
2171
  class: "xml-node__bracket",
2137
- style: P({ color: p.theme.colors.xmlBracket })
2172
+ style: N({ color: p.theme.colors.xmlBracket })
2138
2173
  }, ">", 4),
2139
- v("span", {
2174
+ y("span", {
2140
2175
  class: "xml-node__cdata",
2141
- style: P({ color: p.theme.colors.xmlCdata })
2142
- }, "<![CDATA[" + R(f.value) + "]]>", 5),
2143
- v("span", {
2176
+ style: N({ color: p.theme.colors.xmlCdata })
2177
+ }, "<![CDATA[" + B(f.value) + "]]>", 5),
2178
+ y("span", {
2144
2179
  class: "xml-node__bracket",
2145
- style: P({ color: p.theme.colors.xmlBracket })
2180
+ style: N({ color: p.theme.colors.xmlBracket })
2146
2181
  }, "</", 4),
2147
- v("span", {
2182
+ y("span", {
2148
2183
  class: "xml-node__tag",
2149
- style: P({ color: p.theme.colors.xmlTag })
2150
- }, R(n.value), 5),
2151
- v("span", {
2184
+ style: N({ color: p.theme.colors.xmlTag })
2185
+ }, B(n.value), 5),
2186
+ y("span", {
2152
2187
  class: "xml-node__bracket",
2153
- style: P({ color: p.theme.colors.xmlBracket })
2188
+ style: N({ color: p.theme.colors.xmlBracket })
2154
2189
  }, ">", 4)
2155
- ])) : S.value ? (x(), A("div", tr, [
2156
- v("span", {
2190
+ ])) : x.value ? (k(), A("div", rr, [
2191
+ y("span", {
2157
2192
  class: "xml-node__bracket",
2158
- style: P({ color: p.theme.colors.xmlBracket })
2193
+ style: N({ color: p.theme.colors.xmlBracket })
2159
2194
  }, "<", 4),
2160
- v("span", {
2195
+ y("span", {
2161
2196
  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,
2197
+ style: N({ color: p.theme.colors.xmlTag })
2198
+ }, B(n.value), 5),
2199
+ (k(!0), A(re, null, ae(a.value, ($, R) => (k(), A("span", {
2200
+ key: R,
2166
2201
  class: "xml-node__attribute"
2167
2202
  }, [
2168
- v("span", {
2203
+ y("span", {
2169
2204
  class: "xml-node__attr-name",
2170
- style: P({ color: p.theme.colors.xmlAttribute })
2171
- }, R(I), 5),
2172
- v("span", {
2205
+ style: N({ color: p.theme.colors.xmlAttribute })
2206
+ }, B(R), 5),
2207
+ y("span", {
2173
2208
  class: "xml-node__equals",
2174
- style: P({ color: p.theme.colors.xmlEquals })
2209
+ style: N({ color: p.theme.colors.xmlEquals })
2175
2210
  }, "=", 4),
2176
- v("span", {
2211
+ y("span", {
2177
2212
  class: "xml-node__quote",
2178
- style: P({ color: p.theme.colors.xmlQuote })
2213
+ style: N({ color: p.theme.colors.xmlQuote })
2179
2214
  }, '"', 4),
2180
- v("span", {
2215
+ y("span", {
2181
2216
  class: "xml-node__attr-value",
2182
- style: P({ color: p.theme.colors.xmlAttributeValue })
2183
- }, R(O), 5),
2184
- v("span", {
2217
+ style: N({ color: p.theme.colors.xmlAttributeValue })
2218
+ }, B($), 5),
2219
+ y("span", {
2185
2220
  class: "xml-node__quote",
2186
- style: P({ color: p.theme.colors.xmlQuote })
2221
+ style: N({ color: p.theme.colors.xmlQuote })
2187
2222
  }, '"', 4)
2188
2223
  ]))), 128)),
2189
- v("span", {
2224
+ y("span", {
2190
2225
  class: "xml-node__bracket",
2191
- style: P({ color: p.theme.colors.xmlBracket })
2226
+ style: N({ color: p.theme.colors.xmlBracket })
2192
2227
  }, ">", 4),
2193
- v("span", {
2228
+ y("span", {
2194
2229
  class: "xml-node__text-content",
2195
- style: P({ color: p.theme.colors.xmlText })
2196
- }, R(b.value), 5),
2197
- v("span", {
2230
+ style: N({ color: p.theme.colors.xmlText })
2231
+ }, B(E.value), 5),
2232
+ y("span", {
2198
2233
  class: "xml-node__bracket",
2199
- style: P({ color: p.theme.colors.xmlBracket })
2234
+ style: N({ color: p.theme.colors.xmlBracket })
2200
2235
  }, "</", 4),
2201
- v("span", {
2236
+ y("span", {
2202
2237
  class: "xml-node__tag",
2203
- style: P({ color: p.theme.colors.xmlTag })
2204
- }, R(n.value), 5),
2205
- v("span", {
2238
+ style: N({ color: p.theme.colors.xmlTag })
2239
+ }, B(n.value), 5),
2240
+ y("span", {
2206
2241
  class: "xml-node__bracket",
2207
- style: P({ color: p.theme.colors.xmlBracket })
2242
+ style: N({ color: p.theme.colors.xmlBracket })
2208
2243
  }, ">", 4)
2209
- ])) : (x(), A("div", rr, [
2210
- v("div", nr, [
2211
- w.value ? (x(), A("span", {
2212
- key: 0,
2244
+ ])) : (k(), A("div", nr, [
2245
+ !i.value && w.value ? (k(), A("div", sr, [
2246
+ y("span", {
2213
2247
  class: "xml-node__clickable-part",
2214
- onClick: $[0] || ($[0] = (O) => _()),
2215
- title: i.value ? "Click to collapse" : "Click to expand"
2248
+ onClick: g[0] || (g[0] = ($) => S()),
2249
+ title: "Click to expand"
2216
2250
  }, [
2217
- v("span", {
2251
+ y("span", {
2218
2252
  class: "xml-node__bracket",
2219
- style: P({ color: p.theme.colors.xmlBracket })
2253
+ style: N({ color: p.theme.colors.xmlBracket })
2220
2254
  }, "<", 4),
2221
- v("span", {
2255
+ y("span", {
2222
2256
  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,
2257
+ style: N({ color: p.theme.colors.xmlTag })
2258
+ }, B(n.value), 5)
2259
+ ]),
2260
+ (k(!0), A(re, null, ae(a.value, ($, R) => (k(), A("span", {
2261
+ key: R,
2237
2262
  class: "xml-node__attribute"
2238
2263
  }, [
2239
- v("span", {
2264
+ y("span", {
2240
2265
  class: "xml-node__attr-name",
2241
- style: P({ color: p.theme.colors.xmlAttribute })
2242
- }, R(I), 5),
2243
- v("span", {
2266
+ style: N({ color: p.theme.colors.xmlAttribute })
2267
+ }, B(R), 5),
2268
+ y("span", {
2244
2269
  class: "xml-node__equals",
2245
- style: P({ color: p.theme.colors.xmlEquals })
2270
+ style: N({ color: p.theme.colors.xmlEquals })
2246
2271
  }, "=", 4),
2247
- v("span", {
2272
+ y("span", {
2248
2273
  class: "xml-node__quote",
2249
- style: P({ color: p.theme.colors.xmlQuote })
2274
+ style: N({ color: p.theme.colors.xmlQuote })
2250
2275
  }, '"', 4),
2251
- v("span", {
2276
+ y("span", {
2252
2277
  class: "xml-node__attr-value",
2253
- style: P({ color: p.theme.colors.xmlAttributeValue })
2254
- }, R(O), 5),
2255
- v("span", {
2278
+ style: N({ color: p.theme.colors.xmlAttributeValue })
2279
+ }, B($), 5),
2280
+ y("span", {
2256
2281
  class: "xml-node__quote",
2257
- style: P({ color: p.theme.colors.xmlQuote })
2282
+ style: N({ color: p.theme.colors.xmlQuote })
2258
2283
  }, '"', 4)
2259
2284
  ]))), 128)),
2260
- w.value ? (x(), A("span", {
2261
- key: 2,
2285
+ y("span", {
2262
2286
  class: "xml-node__clickable-part",
2263
- onClick: $[1] || ($[1] = (O) => _()),
2264
- title: i.value ? "Click to collapse" : "Click to expand"
2287
+ onClick: g[1] || (g[1] = ($) => S()),
2288
+ title: "Click to expand"
2265
2289
  }, [
2266
- v("span", {
2290
+ y("span", {
2267
2291
  class: "xml-node__bracket",
2268
- style: P({ color: p.theme.colors.xmlBracket })
2292
+ style: N({ color: p.theme.colors.xmlBracket })
2269
2293
  }, ">", 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", {
2294
+ ]),
2295
+ y("span", {
2296
+ class: "xml-node__collapsed-badge",
2297
+ style: N({
2298
+ backgroundColor: p.theme.colors.collapsedBackground,
2299
+ color: p.theme.colors.collapsedText
2300
+ }),
2301
+ onClick: g[2] || (g[2] = ($) => S()),
2302
+ title: `Click to expand ${O.value} child element${O.value > 1 ? "s" : ""}`
2303
+ }, B(O.value) + " child" + B(O.value > 1 ? "ren" : ""), 13, or),
2304
+ y("span", {
2304
2305
  class: "xml-node__clickable-part",
2305
- onClick: $[5] || ($[5] = (O) => _()),
2306
- title: "Click to collapse"
2306
+ onClick: g[3] || (g[3] = ($) => S()),
2307
+ title: "Click to expand"
2307
2308
  }, [
2308
- v("span", {
2309
+ y("span", {
2309
2310
  class: "xml-node__bracket",
2310
- style: P({ color: p.theme.colors.xmlBracket })
2311
+ style: N({ color: p.theme.colors.xmlBracket })
2311
2312
  }, "</", 4),
2312
- v("span", {
2313
+ y("span", {
2313
2314
  class: "xml-node__tag",
2314
- style: P({ color: p.theme.colors.xmlTag })
2315
- }, R(n.value), 5),
2316
- v("span", {
2315
+ style: N({ color: p.theme.colors.xmlTag })
2316
+ }, B(n.value), 5),
2317
+ y("span", {
2317
2318
  class: "xml-node__bracket",
2318
- style: P({ color: p.theme.colors.xmlBracket })
2319
+ style: N({ color: p.theme.colors.xmlBracket })
2319
2320
  }, ">", 4)
2320
2321
  ])
2321
- ])) : F("", !0)
2322
+ ])) : (k(), A(re, { key: 1 }, [
2323
+ y("div", ir, [
2324
+ w.value ? (k(), A("span", {
2325
+ key: 0,
2326
+ class: "xml-node__clickable-part",
2327
+ onClick: g[4] || (g[4] = ($) => S()),
2328
+ title: i.value ? "Click to collapse" : "Click to expand"
2329
+ }, [
2330
+ y("span", {
2331
+ class: "xml-node__bracket",
2332
+ style: N({ color: p.theme.colors.xmlBracket })
2333
+ }, "<", 4),
2334
+ y("span", {
2335
+ class: "xml-node__tag",
2336
+ style: N({ color: p.theme.colors.xmlTag })
2337
+ }, B(n.value), 5)
2338
+ ], 8, ar)) : (k(), A("span", lr, [
2339
+ y("span", {
2340
+ class: "xml-node__bracket",
2341
+ style: N({ color: p.theme.colors.xmlBracket })
2342
+ }, "<", 4),
2343
+ y("span", {
2344
+ class: "xml-node__tag",
2345
+ style: N({ color: p.theme.colors.xmlTag })
2346
+ }, B(n.value), 5)
2347
+ ])),
2348
+ (k(!0), A(re, null, ae(a.value, ($, R) => (k(), A("span", {
2349
+ key: R,
2350
+ class: "xml-node__attribute"
2351
+ }, [
2352
+ y("span", {
2353
+ class: "xml-node__attr-name",
2354
+ style: N({ color: p.theme.colors.xmlAttribute })
2355
+ }, B(R), 5),
2356
+ y("span", {
2357
+ class: "xml-node__equals",
2358
+ style: N({ color: p.theme.colors.xmlEquals })
2359
+ }, "=", 4),
2360
+ y("span", {
2361
+ class: "xml-node__quote",
2362
+ style: N({ color: p.theme.colors.xmlQuote })
2363
+ }, '"', 4),
2364
+ y("span", {
2365
+ class: "xml-node__attr-value",
2366
+ style: N({ color: p.theme.colors.xmlAttributeValue })
2367
+ }, B($), 5),
2368
+ y("span", {
2369
+ class: "xml-node__quote",
2370
+ style: N({ color: p.theme.colors.xmlQuote })
2371
+ }, '"', 4)
2372
+ ]))), 128)),
2373
+ w.value ? (k(), A("span", {
2374
+ key: 2,
2375
+ class: "xml-node__clickable-part",
2376
+ onClick: g[5] || (g[5] = ($) => S()),
2377
+ title: i.value ? "Click to collapse" : "Click to expand"
2378
+ }, [
2379
+ y("span", {
2380
+ class: "xml-node__bracket",
2381
+ style: N({ color: p.theme.colors.xmlBracket })
2382
+ }, ">", 4)
2383
+ ], 8, cr)) : (k(), A("span", {
2384
+ key: 3,
2385
+ class: "xml-node__bracket",
2386
+ style: N({ color: p.theme.colors.xmlBracket })
2387
+ }, B(w.value ? ">" : "/>"), 5))
2388
+ ]),
2389
+ i.value && w.value ? (k(), A("div", ur, [
2390
+ l.value.length === 0 && E.value.trim() ? (k(), A("div", dr, [
2391
+ y("span", {
2392
+ class: "xml-node__text-content",
2393
+ style: N({ color: p.theme.colors.xmlText })
2394
+ }, B(E.value), 5)
2395
+ ])) : H("", !0),
2396
+ (k(!0), A(re, null, ae(l.value, ($, R) => (k(), Fe(C, {
2397
+ key: X($, R),
2398
+ node: $,
2399
+ index: R,
2400
+ level: p.level + 1,
2401
+ "parent-path": Z(),
2402
+ expanded: p.expanded,
2403
+ theme: p.theme,
2404
+ onToggleExpand: g[6] || (g[6] = (K) => p.$emit("toggle-expand", K)),
2405
+ onCopy: g[7] || (g[7] = (K) => p.$emit("copy", K))
2406
+ }, null, 8, ["node", "index", "level", "parent-path", "expanded", "theme"]))), 128))
2407
+ ])) : H("", !0),
2408
+ i.value && w.value ? (k(), A("div", fr, [
2409
+ y("span", {
2410
+ class: "xml-node__clickable-part",
2411
+ onClick: g[8] || (g[8] = ($) => S()),
2412
+ title: "Click to collapse"
2413
+ }, [
2414
+ y("span", {
2415
+ class: "xml-node__bracket",
2416
+ style: N({ color: p.theme.colors.xmlBracket })
2417
+ }, "</", 4),
2418
+ y("span", {
2419
+ class: "xml-node__tag",
2420
+ style: N({ color: p.theme.colors.xmlTag })
2421
+ }, B(n.value), 5),
2422
+ y("span", {
2423
+ class: "xml-node__bracket",
2424
+ style: N({ color: p.theme.colors.xmlBracket })
2425
+ }, ">", 4)
2426
+ ])
2427
+ ])) : H("", !0)
2428
+ ], 64))
2322
2429
  ]))
2323
- ])) : F("", !0)
2430
+ ])) : H("", !0)
2324
2431
  ], 4);
2325
2432
  };
2326
2433
  }
2327
- }), dr = /* @__PURE__ */ be(cr, [["__scopeId", "data-v-9c0c90fa"]]), fr = {
2434
+ }), pr = /* @__PURE__ */ ye(hr, [["__scopeId", "data-v-afb7b2ab"]]), gr = {
2328
2435
  name: "github-light",
2329
2436
  colors: {
2330
2437
  // 背景色
@@ -2366,10 +2473,15 @@ const Lt = {
2366
2473
  // 括号 - 灰色
2367
2474
  xmlEquals: "#6e7781",
2368
2475
  // 等号 - 灰色
2369
- xmlQuote: "#0550ae"
2476
+ xmlQuote: "#0550ae",
2370
2477
  // 引号 - 蓝色
2478
+ // 折叠效果
2479
+ collapsedBackground: "#ddf4ff",
2480
+ // 折叠信息背景色 - 浅蓝
2481
+ collapsedText: "#0969da"
2482
+ // 折叠信息文本色 - 蓝色
2371
2483
  }
2372
- }, hr = {
2484
+ }, mr = {
2373
2485
  name: "github-dark",
2374
2486
  colors: {
2375
2487
  // 背景色
@@ -2411,10 +2523,15 @@ const Lt = {
2411
2523
  // 括号 - 灰色
2412
2524
  xmlEquals: "#8b949e",
2413
2525
  // 等号 - 灰色
2414
- xmlQuote: "#79c0ff"
2526
+ xmlQuote: "#79c0ff",
2415
2527
  // 引号 - 亮蓝色
2528
+ // 折叠效果
2529
+ collapsedBackground: "#1c2d41",
2530
+ // 折叠信息背景色 - 深蓝
2531
+ collapsedText: "#58a6ff"
2532
+ // 折叠信息文本色 - 亮蓝
2416
2533
  }
2417
- }, pr = {
2534
+ }, br = {
2418
2535
  name: "min-light",
2419
2536
  colors: {
2420
2537
  // 背景色
@@ -2456,10 +2573,15 @@ const Lt = {
2456
2573
  // 括号 - 灰色
2457
2574
  xmlEquals: "#737373",
2458
2575
  // 等号 - 灰色
2459
- xmlQuote: "#2563eb"
2576
+ xmlQuote: "#2563eb",
2460
2577
  // 引号 - 蓝色
2578
+ // 折叠效果
2579
+ collapsedBackground: "#dbeafe",
2580
+ // 折叠信息背景色 - 浅蓝
2581
+ collapsedText: "#1d4ed8"
2582
+ // 折叠信息文本色 - 蓝色
2461
2583
  }
2462
- }, gr = {
2584
+ }, yr = {
2463
2585
  name: "slack-ochin",
2464
2586
  colors: {
2465
2587
  // 背景色
@@ -2501,16 +2623,21 @@ const Lt = {
2501
2623
  // 括号 - 灰色
2502
2624
  xmlEquals: "#616061",
2503
2625
  // 等号 - 灰色
2504
- xmlQuote: "#1264a3"
2626
+ xmlQuote: "#1264a3",
2505
2627
  // 引号 - 蓝色
2628
+ // 折叠效果
2629
+ collapsedBackground: "#d8eaf5",
2630
+ // 折叠信息背景色 - 浅蓝
2631
+ collapsedText: "#0b4c8c"
2632
+ // 折叠信息文本色 - 深蓝
2506
2633
  }
2507
- }, 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) {
2634
+ }, Se = {
2635
+ "github-light": gr,
2636
+ "github-dark": mr,
2637
+ "min-light": br,
2638
+ "slack-ochin": yr
2639
+ }, vr = (r) => Se[r] || Se["github-light"], He = ":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", _r = He + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", Er = "[" + He + "][" + _r + "]*", xr = new RegExp("^" + Er + "$");
2640
+ function Ke(r, e) {
2514
2641
  const t = [];
2515
2642
  let s = e.exec(r);
2516
2643
  for (; s; ) {
@@ -2524,122 +2651,122 @@ function Ye(r, e) {
2524
2651
  return t;
2525
2652
  }
2526
2653
  const ve = function(r) {
2527
- const e = vr.exec(r);
2654
+ const e = xr.exec(r);
2528
2655
  return !(e === null || typeof e > "u");
2529
2656
  };
2530
- function Er(r) {
2657
+ function kr(r) {
2531
2658
  return typeof r < "u";
2532
2659
  }
2533
- const _r = {
2660
+ const Nr = {
2534
2661
  allowBooleanAttributes: !1,
2535
2662
  //A tag can have attributes without any value
2536
2663
  unpairedTags: []
2537
2664
  };
2538
- function Qe(r, e) {
2539
- e = Object.assign({}, _r, e);
2665
+ function qe(r, e) {
2666
+ e = Object.assign({}, Nr, e);
2540
2667
  const t = [];
2541
2668
  let s = !1, n = !1;
2542
2669
  r[0] === "\uFEFF" && (r = r.substr(1));
2543
2670
  for (let o = 0; o < r.length; o++)
2544
2671
  if (r[o] === "<" && r[o + 1] === "?") {
2545
- if (o += 2, o = Le(r, o), o.err) return o;
2672
+ if (o += 2, o = Ie(r, o), o.err) return o;
2546
2673
  } else if (r[o] === "<") {
2547
2674
  let i = o;
2548
2675
  if (o++, r[o] === "!") {
2549
- o = Re(r, o);
2676
+ o = Ve(r, o);
2550
2677
  continue;
2551
2678
  } else {
2552
- let u = !1;
2553
- r[o] === "/" && (u = !0, o++);
2679
+ let c = !1;
2680
+ r[o] === "/" && (c = !0, o++);
2554
2681
  let a = "";
2555
2682
  for (; o < r.length && r[o] !== ">" && r[o] !== " " && r[o] !== " " && r[o] !== `
2556
2683
  ` && r[o] !== "\r"; o++)
2557
2684
  a += r[o];
2558
- if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), o--), !Tr(a)) {
2685
+ if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), o--), !Sr(a)) {
2559
2686
  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));
2687
+ return a.trim().length === 0 ? f = "Invalid space after '<'." : f = "Tag '" + a + "' is an invalid name.", F("InvalidTag", f, Q(r, o));
2561
2688
  }
2562
- const l = Ar(r, o);
2689
+ const l = Cr(r, o);
2563
2690
  if (l === !1)
2564
- return U("InvalidAttr", "Attributes for '" + a + "' have open quote.", W(r, o));
2691
+ return F("InvalidAttr", "Attributes for '" + a + "' have open quote.", Q(r, o));
2565
2692
  let h = l.value;
2566
2693
  if (o = l.index, h[h.length - 1] === "/") {
2567
2694
  const f = o - h.length;
2568
2695
  h = h.substring(0, h.length - 1);
2569
- const b = je(h, e);
2570
- if (b === !0)
2696
+ const E = Le(h, e);
2697
+ if (E === !0)
2571
2698
  s = !0;
2572
2699
  else
2573
- return U(b.err.code, b.err.msg, W(r, f + b.err.line));
2574
- } else if (u)
2700
+ return F(E.err.code, E.err.msg, Q(r, f + E.err.line));
2701
+ } else if (c)
2575
2702
  if (l.tagClosed) {
2576
2703
  if (h.trim().length > 0)
2577
- return U("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", W(r, i));
2704
+ return F("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", Q(r, i));
2578
2705
  if (t.length === 0)
2579
- return U("InvalidTag", "Closing tag '" + a + "' has not been opened.", W(r, i));
2706
+ return F("InvalidTag", "Closing tag '" + a + "' has not been opened.", Q(r, i));
2580
2707
  {
2581
2708
  const f = t.pop();
2582
2709
  if (a !== f.tagName) {
2583
- let b = W(r, f.tagStartPos);
2584
- return U(
2710
+ let E = Q(r, f.tagStartPos);
2711
+ return F(
2585
2712
  "InvalidTag",
2586
- "Expected closing tag '" + f.tagName + "' (opened in line " + b.line + ", col " + b.col + ") instead of closing tag '" + a + "'.",
2587
- W(r, i)
2713
+ "Expected closing tag '" + f.tagName + "' (opened in line " + E.line + ", col " + E.col + ") instead of closing tag '" + a + "'.",
2714
+ Q(r, i)
2588
2715
  );
2589
2716
  }
2590
2717
  t.length == 0 && (n = !0);
2591
2718
  }
2592
- } else return U("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", W(r, o));
2719
+ } else return F("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", Q(r, o));
2593
2720
  else {
2594
- const f = je(h, e);
2721
+ const f = Le(h, e);
2595
2722
  if (f !== !0)
2596
- return U(f.err.code, f.err.msg, W(r, o - h.length + f.err.line));
2723
+ return F(f.err.code, f.err.msg, Q(r, o - h.length + f.err.line));
2597
2724
  if (n === !0)
2598
- return U("InvalidXml", "Multiple possible root nodes found.", W(r, o));
2725
+ return F("InvalidXml", "Multiple possible root nodes found.", Q(r, o));
2599
2726
  e.unpairedTags.indexOf(a) !== -1 || t.push({ tagName: a, tagStartPos: i }), s = !0;
2600
2727
  }
2601
2728
  for (o++; o < r.length; o++)
2602
2729
  if (r[o] === "<")
2603
2730
  if (r[o + 1] === "!") {
2604
- o++, o = Re(r, o);
2731
+ o++, o = Ve(r, o);
2605
2732
  continue;
2606
2733
  } else if (r[o + 1] === "?") {
2607
- if (o = Le(r, ++o), o.err) return o;
2734
+ if (o = Ie(r, ++o), o.err) return o;
2608
2735
  } else
2609
2736
  break;
2610
2737
  else if (r[o] === "&") {
2611
- const f = Cr(r, o);
2738
+ const f = Pr(r, o);
2612
2739
  if (f == -1)
2613
- return U("InvalidChar", "char '&' is not expected.", W(r, o));
2740
+ return F("InvalidChar", "char '&' is not expected.", Q(r, o));
2614
2741
  o = f;
2615
- } else if (n === !0 && !Ve(r[o]))
2616
- return U("InvalidXml", "Extra text at the end", W(r, o));
2742
+ } else if (n === !0 && !Be(r[o]))
2743
+ return F("InvalidXml", "Extra text at the end", Q(r, o));
2617
2744
  r[o] === "<" && o--;
2618
2745
  }
2619
2746
  } else {
2620
- if (Ve(r[o]))
2747
+ if (Be(r[o]))
2621
2748
  continue;
2622
- return U("InvalidChar", "char '" + r[o] + "' is not expected.", W(r, o));
2749
+ return F("InvalidChar", "char '" + r[o] + "' is not expected.", Q(r, o));
2623
2750
  }
2624
2751
  if (s) {
2625
2752
  if (t.length == 1)
2626
- return U("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", W(r, t[0].tagStartPos));
2753
+ return F("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", Q(r, t[0].tagStartPos));
2627
2754
  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);
2755
+ return F("InvalidXml", "Invalid '" + JSON.stringify(t.map((o) => o.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
2756
+ } else return F("InvalidXml", "Start tag expected.", 1);
2630
2757
  return !0;
2631
2758
  }
2632
- function Ve(r) {
2759
+ function Be(r) {
2633
2760
  return r === " " || r === " " || r === `
2634
2761
  ` || r === "\r";
2635
2762
  }
2636
- function Le(r, e) {
2763
+ function Ie(r, e) {
2637
2764
  const t = e;
2638
2765
  for (; e < r.length; e++)
2639
2766
  if (r[e] == "?" || r[e] == " ") {
2640
2767
  const s = r.substr(t, e - t);
2641
2768
  if (e > 5 && s === "xml")
2642
- return U("InvalidXml", "XML declaration allowed only at the start of the document.", W(r, e));
2769
+ return F("InvalidXml", "XML declaration allowed only at the start of the document.", Q(r, e));
2643
2770
  if (r[e] == "?" && r[e + 1] == ">") {
2644
2771
  e++;
2645
2772
  break;
@@ -2648,7 +2775,7 @@ function Le(r, e) {
2648
2775
  }
2649
2776
  return e;
2650
2777
  }
2651
- function Re(r, e) {
2778
+ function Ve(r, e) {
2652
2779
  if (r.length > e + 5 && r[e + 1] === "-" && r[e + 2] === "-") {
2653
2780
  for (e += 3; e < r.length; e++)
2654
2781
  if (r[e] === "-" && r[e + 1] === "-" && r[e + 2] === ">") {
@@ -2671,11 +2798,11 @@ function Re(r, e) {
2671
2798
  }
2672
2799
  return e;
2673
2800
  }
2674
- const xr = '"', Nr = "'";
2675
- function Ar(r, e) {
2801
+ const Ar = '"', wr = "'";
2802
+ function Cr(r, e) {
2676
2803
  let t = "", s = "", n = !1;
2677
2804
  for (; e < r.length; e++) {
2678
- if (r[e] === xr || r[e] === Nr)
2805
+ if (r[e] === Ar || r[e] === wr)
2679
2806
  s === "" ? s = r[e] : s !== r[e] || (s = "");
2680
2807
  else if (r[e] === ">" && s === "") {
2681
2808
  n = !0;
@@ -2689,27 +2816,27 @@ function Ar(r, e) {
2689
2816
  tagClosed: n
2690
2817
  };
2691
2818
  }
2692
- const kr = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2693
- function je(r, e) {
2694
- const t = Ye(r, kr), s = {};
2819
+ const Or = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2820
+ function Le(r, e) {
2821
+ const t = Ke(r, Or), s = {};
2695
2822
  for (let n = 0; n < t.length; n++) {
2696
2823
  if (t[n][1].length === 0)
2697
- return U("InvalidAttr", "Attribute '" + t[n][2] + "' has no space in starting.", pe(t[n]));
2824
+ return F("InvalidAttr", "Attribute '" + t[n][2] + "' has no space in starting.", pe(t[n]));
2698
2825
  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]));
2826
+ return F("InvalidAttr", "Attribute '" + t[n][2] + "' is without value.", pe(t[n]));
2700
2827
  if (t[n][3] === void 0 && !e.allowBooleanAttributes)
2701
- return U("InvalidAttr", "boolean attribute '" + t[n][2] + "' is not allowed.", pe(t[n]));
2828
+ return F("InvalidAttr", "boolean attribute '" + t[n][2] + "' is not allowed.", pe(t[n]));
2702
2829
  const o = t[n][2];
2703
- if (!Or(o))
2704
- return U("InvalidAttr", "Attribute '" + o + "' is an invalid name.", pe(t[n]));
2830
+ if (!$r(o))
2831
+ return F("InvalidAttr", "Attribute '" + o + "' is an invalid name.", pe(t[n]));
2705
2832
  if (!s.hasOwnProperty(o))
2706
2833
  s[o] = 1;
2707
2834
  else
2708
- return U("InvalidAttr", "Attribute '" + o + "' is repeated.", pe(t[n]));
2835
+ return F("InvalidAttr", "Attribute '" + o + "' is repeated.", pe(t[n]));
2709
2836
  }
2710
2837
  return !0;
2711
2838
  }
2712
- function wr(r, e) {
2839
+ function Tr(r, e) {
2713
2840
  let t = /\d/;
2714
2841
  for (r[e] === "x" && (e++, t = /[\da-fA-F]/); e < r.length; e++) {
2715
2842
  if (r[e] === ";")
@@ -2719,11 +2846,11 @@ function wr(r, e) {
2719
2846
  }
2720
2847
  return -1;
2721
2848
  }
2722
- function Cr(r, e) {
2849
+ function Pr(r, e) {
2723
2850
  if (e++, r[e] === ";")
2724
2851
  return -1;
2725
2852
  if (r[e] === "#")
2726
- return e++, wr(r, e);
2853
+ return e++, Tr(r, e);
2727
2854
  let t = 0;
2728
2855
  for (; e < r.length; e++, t++)
2729
2856
  if (!(r[e].match(/\w/) && t < 20)) {
@@ -2733,7 +2860,7 @@ function Cr(r, e) {
2733
2860
  }
2734
2861
  return e;
2735
2862
  }
2736
- function U(r, e, t) {
2863
+ function F(r, e, t) {
2737
2864
  return {
2738
2865
  err: {
2739
2866
  code: r,
@@ -2743,13 +2870,13 @@ function U(r, e, t) {
2743
2870
  }
2744
2871
  };
2745
2872
  }
2746
- function Or(r) {
2873
+ function $r(r) {
2747
2874
  return ve(r);
2748
2875
  }
2749
- function Tr(r) {
2876
+ function Sr(r) {
2750
2877
  return ve(r);
2751
2878
  }
2752
- function W(r, e) {
2879
+ function Q(r, e) {
2753
2880
  const t = r.substring(0, e).split(/\r?\n/);
2754
2881
  return {
2755
2882
  line: t.length,
@@ -2760,7 +2887,7 @@ function W(r, e) {
2760
2887
  function pe(r) {
2761
2888
  return r.startIndex + r[1].length;
2762
2889
  }
2763
- const Pr = {
2890
+ const Br = {
2764
2891
  preserveOrder: !1,
2765
2892
  attributeNamePrefix: "@_",
2766
2893
  attributesGroupName: !1,
@@ -2804,12 +2931,12 @@ const Pr = {
2804
2931
  },
2805
2932
  // skipEmptyListItem: false
2806
2933
  captureMetaData: !1
2807
- }, $r = function(r) {
2808
- return Object.assign({}, Pr, r);
2934
+ }, Ir = function(r) {
2935
+ return Object.assign({}, Br, r);
2809
2936
  };
2810
2937
  let me;
2811
2938
  typeof Symbol != "function" ? me = "@@xmlMetadata" : me = Symbol("XML Node Metadata");
2812
- class oe {
2939
+ class le {
2813
2940
  constructor(e) {
2814
2941
  this.tagname = e, this.child = [], this[":@"] = {};
2815
2942
  }
@@ -2824,7 +2951,7 @@ class oe {
2824
2951
  return me;
2825
2952
  }
2826
2953
  }
2827
- class Sr {
2954
+ class Vr {
2828
2955
  constructor(e) {
2829
2956
  this.suppressValidationErr = !e;
2830
2957
  }
@@ -2832,33 +2959,33 @@ class Sr {
2832
2959
  const s = {};
2833
2960
  if (e[t + 3] === "O" && e[t + 4] === "C" && e[t + 5] === "T" && e[t + 6] === "Y" && e[t + 7] === "P" && e[t + 8] === "E") {
2834
2961
  t = t + 9;
2835
- let n = 1, o = !1, i = !1, u = "";
2962
+ let n = 1, o = !1, i = !1, c = "";
2836
2963
  for (; t < e.length; t++)
2837
2964
  if (e[t] === "<" && !i) {
2838
- if (o && se(e, "!ENTITY", t)) {
2965
+ if (o && ie(e, "!ENTITY", t)) {
2839
2966
  t += 7;
2840
2967
  let a, l;
2841
2968
  [a, l, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr), l.indexOf("&") === -1 && (s[a] = {
2842
2969
  regx: RegExp(`&${a};`, "g"),
2843
2970
  val: l
2844
2971
  });
2845
- } else if (o && se(e, "!ELEMENT", t)) {
2972
+ } else if (o && ie(e, "!ELEMENT", t)) {
2846
2973
  t += 8;
2847
2974
  const { index: a } = this.readElementExp(e, t + 1);
2848
2975
  t = a;
2849
- } else if (o && se(e, "!ATTLIST", t))
2976
+ } else if (o && ie(e, "!ATTLIST", t))
2850
2977
  t += 8;
2851
- else if (o && se(e, "!NOTATION", t)) {
2978
+ else if (o && ie(e, "!NOTATION", t)) {
2852
2979
  t += 9;
2853
2980
  const { index: a } = this.readNotationExp(e, t + 1, this.suppressValidationErr);
2854
2981
  t = a;
2855
- } else if (se(e, "!--", t)) i = !0;
2982
+ } else if (ie(e, "!--", t)) i = !0;
2856
2983
  else throw new Error("Invalid DOCTYPE");
2857
- n++, u = "";
2984
+ n++, c = "";
2858
2985
  } else if (e[t] === ">") {
2859
2986
  if (i ? e[t - 1] === "-" && e[t - 2] === "-" && (i = !1, n--) : n--, n === 0)
2860
2987
  break;
2861
- } else e[t] === "[" ? o = !0 : u += e[t];
2988
+ } else e[t] === "[" ? o = !0 : c += e[t];
2862
2989
  if (n !== 0)
2863
2990
  throw new Error("Unclosed DOCTYPE");
2864
2991
  } else
@@ -2916,8 +3043,8 @@ class Sr {
2916
3043
  throw new Error(`Invalid element name: "${s}"`);
2917
3044
  t = G(e, t);
2918
3045
  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;
3046
+ if (e[t] === "E" && ie(e, "MPTY", t)) t += 4;
3047
+ else if (e[t] === "A" && ie(e, "NY", t)) t += 2;
2921
3048
  else if (e[t] === "(") {
2922
3049
  for (t++; t < e.length && e[t] !== ")"; )
2923
3050
  n += e[t], t++;
@@ -2948,23 +3075,23 @@ class Sr {
2948
3075
  if (o = "NOTATION", t += 8, t = G(e, t), e[t] !== "(")
2949
3076
  throw new Error(`Expected '(', found "${e[t]}"`);
2950
3077
  t++;
2951
- let u = [];
3078
+ let c = [];
2952
3079
  for (; t < e.length && e[t] !== ")"; ) {
2953
3080
  let a = "";
2954
3081
  for (; t < e.length && e[t] !== "|" && e[t] !== ")"; )
2955
3082
  a += e[t], t++;
2956
3083
  if (a = a.trim(), !ge(a))
2957
3084
  throw new Error(`Invalid notation name: "${a}"`);
2958
- u.push(a), e[t] === "|" && (t++, t = G(e, t));
3085
+ c.push(a), e[t] === "|" && (t++, t = G(e, t));
2959
3086
  }
2960
3087
  if (e[t] !== ")")
2961
3088
  throw new Error("Unterminated list of notations");
2962
- t++, o += " (" + u.join("|") + ")";
3089
+ t++, o += " (" + c.join("|") + ")";
2963
3090
  } else {
2964
3091
  for (; t < e.length && !/\s/.test(e[t]); )
2965
3092
  o += e[t], t++;
2966
- const u = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
2967
- if (!this.suppressValidationErr && !u.includes(o.toUpperCase()))
3093
+ const c = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
3094
+ if (!this.suppressValidationErr && !c.includes(o.toUpperCase()))
2968
3095
  throw new Error(`Invalid attribute type: "${o}"`);
2969
3096
  }
2970
3097
  t = G(e, t);
@@ -2983,7 +3110,7 @@ const G = (r, e) => {
2983
3110
  e++;
2984
3111
  return e;
2985
3112
  };
2986
- function se(r, e, t) {
3113
+ function ie(r, e, t) {
2987
3114
  for (let s = 0; s < e.length; s++)
2988
3115
  if (e[s] !== r[t + s + 1]) return !1;
2989
3116
  return !0;
@@ -2993,7 +3120,7 @@ function ge(r) {
2993
3120
  return r;
2994
3121
  throw new Error(`Invalid entity name ${r}`);
2995
3122
  }
2996
- const Ir = /^[-+]?0x[a-fA-F0-9]+$/, Br = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Vr = {
3123
+ const Lr = /^[-+]?0x[a-fA-F0-9]+$/, Rr = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, jr = {
2997
3124
  hex: !0,
2998
3125
  // oct: false,
2999
3126
  leadingZeros: !0,
@@ -3001,25 +3128,25 @@ const Ir = /^[-+]?0x[a-fA-F0-9]+$/, Br = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V
3001
3128
  eNotation: !0
3002
3129
  //skipLike: /regex/
3003
3130
  };
3004
- function Lr(r, e = {}) {
3005
- if (e = Object.assign({}, Vr, e), !r || typeof r != "string") return r;
3131
+ function Mr(r, e = {}) {
3132
+ if (e = Object.assign({}, jr, e), !r || typeof r != "string") return r;
3006
3133
  let t = r.trim();
3007
3134
  if (e.skipLike !== void 0 && e.skipLike.test(t)) return r;
3008
3135
  if (r === "0") return 0;
3009
- if (e.hex && Ir.test(t))
3010
- return Ur(t, 16);
3136
+ if (e.hex && Lr.test(t))
3137
+ return Hr(t, 16);
3011
3138
  if (t.search(/.+[eE].+/) !== -1)
3012
- return jr(r, t, e);
3139
+ return Fr(r, t, e);
3013
3140
  {
3014
- const s = Br.exec(t);
3141
+ const s = Rr.exec(t);
3015
3142
  if (s) {
3016
3143
  const n = s[1] || "", o = s[2];
3017
- let i = Mr(s[3]);
3018
- const u = n ? (
3144
+ let i = Xr(s[3]);
3145
+ const c = n ? (
3019
3146
  // 0., -00., 000.
3020
3147
  r[o.length + 1] === "."
3021
3148
  ) : r[o.length] === ".";
3022
- if (!e.leadingZeros && (o.length > 1 || o.length === 1 && !u))
3149
+ if (!e.leadingZeros && (o.length > 1 || o.length === 1 && !c))
3023
3150
  return r;
3024
3151
  {
3025
3152
  const a = Number(t), l = String(a);
@@ -3035,37 +3162,37 @@ function Lr(r, e = {}) {
3035
3162
  return r;
3036
3163
  }
3037
3164
  }
3038
- const Rr = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
3039
- function jr(r, e, t) {
3165
+ const Ur = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
3166
+ function Fr(r, e, t) {
3040
3167
  if (!t.eNotation) return r;
3041
- const s = e.match(Rr);
3168
+ const s = e.match(Ur);
3042
3169
  if (s) {
3043
3170
  let n = s[1] || "";
3044
- const o = s[3].indexOf("e") === -1 ? "E" : "e", i = s[2], u = n ? (
3171
+ const o = s[3].indexOf("e") === -1 ? "E" : "e", i = s[2], c = n ? (
3045
3172
  // 0E.
3046
3173
  r[i.length + 1] === o
3047
3174
  ) : r[i.length] === o;
3048
- return i.length > 1 && u ? r : i.length === 1 && (s[3].startsWith(`.${o}`) || s[3][0] === o) ? Number(e) : t.leadingZeros && !u ? (e = (s[1] || "") + s[3], Number(e)) : r;
3175
+ return i.length > 1 && c ? r : i.length === 1 && (s[3].startsWith(`.${o}`) || s[3][0] === o) ? Number(e) : t.leadingZeros && !c ? (e = (s[1] || "") + s[3], Number(e)) : r;
3049
3176
  } else
3050
3177
  return r;
3051
3178
  }
3052
- function Mr(r) {
3179
+ function Xr(r) {
3053
3180
  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
3181
  }
3055
- function Ur(r, e) {
3182
+ function Hr(r, e) {
3056
3183
  if (parseInt) return parseInt(r, e);
3057
3184
  if (Number.parseInt) return Number.parseInt(r, e);
3058
3185
  if (window && window.parseInt) return window.parseInt(r, e);
3059
3186
  throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
3060
3187
  }
3061
- function We(r) {
3188
+ function Qe(r) {
3062
3189
  return typeof r == "function" ? r : Array.isArray(r) ? (e) => {
3063
3190
  for (const t of r)
3064
3191
  if (typeof t == "string" && e === t || t instanceof RegExp && t.test(e))
3065
3192
  return !0;
3066
3193
  } : () => !1;
3067
3194
  }
3068
- class Fr {
3195
+ class Kr {
3069
3196
  constructor(e) {
3070
3197
  this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
3071
3198
  apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
@@ -3088,10 +3215,10 @@ class Fr {
3088
3215
  inr: { regex: /&(inr|#8377);/g, val: "₹" },
3089
3216
  num_dec: { regex: /&#([0-9]{1,7});/g, val: (t, s) => String.fromCodePoint(Number.parseInt(s, 10)) },
3090
3217
  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);
3218
+ }, this.addExternalEntities = qr, this.parseXml = Zr, this.parseTextData = Qr, this.resolveNameSpace = Wr, this.buildAttributesMap = Gr, this.isItStopNode = en, this.replaceEntitiesValue = Dr, this.readStopNodeData = rn, this.saveTextToParentTag = Jr, this.addChild = zr, this.ignoreAttributesFn = Qe(this.options.ignoreAttributes);
3092
3219
  }
3093
3220
  }
3094
- function Xr(r) {
3221
+ function qr(r) {
3095
3222
  const e = Object.keys(r);
3096
3223
  for (let t = 0; t < e.length; t++) {
3097
3224
  const s = e[t];
@@ -3101,14 +3228,14 @@ function Xr(r) {
3101
3228
  };
3102
3229
  }
3103
3230
  }
3104
- function Hr(r, e, t, s, n, o, i) {
3231
+ function Qr(r, e, t, s, n, o, i) {
3105
3232
  if (r !== void 0 && (this.options.trimValues && !s && (r = r.trim()), r.length > 0)) {
3106
3233
  i || (r = this.replaceEntitiesValue(r));
3107
- const u = this.options.tagValueProcessor(e, r, t, n, o);
3108
- 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;
3234
+ const c = this.options.tagValueProcessor(e, r, t, n, o);
3235
+ return c == null ? r : typeof c != typeof r || c !== r ? c : this.options.trimValues ? we(r, this.options.parseTagValue, this.options.numberParseOptions) : r.trim() === r ? we(r, this.options.parseTagValue, this.options.numberParseOptions) : r;
3109
3236
  }
3110
3237
  }
3111
- function Kr(r) {
3238
+ function Wr(r) {
3112
3239
  if (this.options.removeNSPrefix) {
3113
3240
  const e = r.split(":"), t = r.charAt(0) === "/" ? "/" : "";
3114
3241
  if (e[0] === "xmlns")
@@ -3117,20 +3244,20 @@ function Kr(r) {
3117
3244
  }
3118
3245
  return r;
3119
3246
  }
3120
- const qr = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
3121
- function Yr(r, e, t) {
3247
+ const Yr = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
3248
+ function Gr(r, e, t) {
3122
3249
  if (this.options.ignoreAttributes !== !0 && typeof r == "string") {
3123
- const s = Ye(r, qr), n = s.length, o = {};
3250
+ const s = Ke(r, Yr), n = s.length, o = {};
3124
3251
  for (let i = 0; i < n; i++) {
3125
- const u = this.resolveNameSpace(s[i][1]);
3126
- if (this.ignoreAttributesFn(u, e))
3252
+ const c = this.resolveNameSpace(s[i][1]);
3253
+ if (this.ignoreAttributesFn(c, e))
3127
3254
  continue;
3128
- let a = s[i][4], l = this.options.attributeNamePrefix + u;
3129
- if (u.length)
3255
+ let a = s[i][4], l = this.options.attributeNamePrefix + c;
3256
+ if (c.length)
3130
3257
  if (this.options.transformAttributeName && (l = this.options.transformAttributeName(l)), l === "__proto__" && (l = "#__proto__"), a !== void 0) {
3131
3258
  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(
3259
+ const h = this.options.attributeValueProcessor(c, a, e);
3260
+ h == null ? o[l] = a : typeof h != typeof a || h !== a ? o[l] = h : o[l] = we(
3134
3261
  a,
3135
3262
  this.options.parseAttributeValue,
3136
3263
  this.options.numberParseOptions
@@ -3146,20 +3273,20 @@ function Yr(r, e, t) {
3146
3273
  return o;
3147
3274
  }
3148
3275
  }
3149
- const Qr = function(r) {
3276
+ const Zr = function(r) {
3150
3277
  r = r.replace(/\r\n?/g, `
3151
3278
  `);
3152
- const e = new oe("!xml");
3279
+ const e = new le("!xml");
3153
3280
  let t = e, s = "", n = "";
3154
- const o = new Sr(this.options.processEntities);
3281
+ const o = new Vr(this.options.processEntities);
3155
3282
  for (let i = 0; i < r.length; i++)
3156
3283
  if (r[i] === "<")
3157
3284
  if (r[i + 1] === "/") {
3158
- const a = ie(r, ">", i, "Closing Tag is not closed.");
3285
+ const a = ce(r, ">", i, "Closing Tag is not closed.");
3159
3286
  let l = r.substring(i + 2, a).trim();
3160
3287
  if (this.options.removeNSPrefix) {
3161
- const b = l.indexOf(":");
3162
- b !== -1 && (l = l.substr(b + 1));
3288
+ const E = l.indexOf(":");
3289
+ E !== -1 && (l = l.substr(E + 1));
3163
3290
  }
3164
3291
  this.options.transformTagName && (l = this.options.transformTagName(l)), t && (s = this.saveTextToParentTag(s, t, n));
3165
3292
  const h = n.substring(n.lastIndexOf(".") + 1);
@@ -3168,15 +3295,15 @@ const Qr = function(r) {
3168
3295
  let f = 0;
3169
3296
  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;
3170
3297
  } else if (r[i + 1] === "?") {
3171
- let a = we(r, i, !1, "?>");
3298
+ let a = Ae(r, i, !1, "?>");
3172
3299
  if (!a) throw new Error("Pi Tag is not closed.");
3173
3300
  if (s = this.saveTextToParentTag(s, t, n), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
3174
- const l = new oe(a.tagName);
3301
+ const l = new le(a.tagName);
3175
3302
  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
3303
  }
3177
3304
  i = a.closeIndex + 1;
3178
3305
  } else if (r.substr(i + 1, 3) === "!--") {
3179
- const a = ie(r, "-->", i + 4, "Comment is not closed.");
3306
+ const a = ce(r, "-->", i + 4, "Comment is not closed.");
3180
3307
  if (this.options.commentPropName) {
3181
3308
  const l = r.substring(i + 4, a - 2);
3182
3309
  s = this.saveTextToParentTag(s, t, n), t.add(this.options.commentPropName, [{ [this.options.textNodeName]: l }]);
@@ -3186,53 +3313,53 @@ const Qr = function(r) {
3186
3313
  const a = o.readDocType(r, i);
3187
3314
  this.docTypeEntities = a.entities, i = a.i;
3188
3315
  } else if (r.substr(i + 1, 2) === "![") {
3189
- const a = ie(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
3316
+ const a = ce(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
3190
3317
  s = this.saveTextToParentTag(s, t, n);
3191
3318
  let h = this.parseTextData(l, t.tagname, n, !0, !1, !0, !0);
3192
3319
  h == null && (h = ""), this.options.cdataPropName ? t.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : t.add(this.options.textNodeName, h), i = a + 2;
3193
3320
  } else {
3194
- let a = we(r, i, this.options.removeNSPrefix), l = a.tagName;
3321
+ let a = Ae(r, i, this.options.removeNSPrefix), l = a.tagName;
3195
3322
  const h = a.rawTagName;
3196
- let f = a.tagExp, b = a.attrExpPresent, m = a.closeIndex;
3323
+ let f = a.tagExp, E = a.attrExpPresent, _ = a.closeIndex;
3197
3324
  this.options.transformTagName && (l = this.options.transformTagName(l)), t && s && t.tagname !== "!xml" && (s = this.saveTextToParentTag(s, t, n, !1));
3198
3325
  const w = t;
3199
3326
  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;
3327
+ const O = i;
3201
3328
  if (this.isItStopNode(this.options.stopNodes, n, l)) {
3202
- let _ = "";
3329
+ let x = "";
3203
3330
  if (f.length > 0 && f.lastIndexOf("/") === f.length - 1)
3204
3331
  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;
3205
3332
  else if (this.options.unpairedTags.indexOf(l) !== -1)
3206
3333
  i = a.closeIndex;
3207
3334
  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;
3335
+ const X = this.readStopNodeData(r, h, _ + 1);
3336
+ if (!X) throw new Error(`Unexpected end of ${h}`);
3337
+ i = X.i, x = X.tagContent;
3211
3338
  }
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);
3339
+ const S = new le(l);
3340
+ l !== f && E && (S[":@"] = this.buildAttributesMap(f, n, l)), x && (x = this.parseTextData(x, l, n, !0, E, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), S.add(this.options.textNodeName, x), this.addChild(t, S, n, O);
3214
3341
  } else {
3215
3342
  if (f.length > 0 && f.lastIndexOf("/") === f.length - 1) {
3216
3343
  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("."));
3344
+ const x = new le(l);
3345
+ l !== f && E && (x[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, x, n, O), n = n.substr(0, n.lastIndexOf("."));
3219
3346
  } 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 = _;
3347
+ const x = new le(l);
3348
+ this.tagsNodeStack.push(t), l !== f && E && (x[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, x, n, O), t = x;
3222
3349
  }
3223
- s = "", i = m;
3350
+ s = "", i = _;
3224
3351
  }
3225
3352
  }
3226
3353
  else
3227
3354
  s += r[i];
3228
3355
  return e.child;
3229
3356
  };
3230
- function Wr(r, e, t, s) {
3357
+ function zr(r, e, t, s) {
3231
3358
  this.options.captureMetaData || (s = void 0);
3232
3359
  const n = this.options.updateTag(e.tagname, t, e[":@"]);
3233
3360
  n === !1 || (typeof n == "string" && (e.tagname = n), r.addChild(e, s));
3234
3361
  }
3235
- const Gr = function(r) {
3362
+ const Dr = function(r) {
3236
3363
  if (this.options.processEntities) {
3237
3364
  for (let e in this.docTypeEntities) {
3238
3365
  const t = this.docTypeEntities[e];
@@ -3251,7 +3378,7 @@ const Gr = function(r) {
3251
3378
  }
3252
3379
  return r;
3253
3380
  };
3254
- function Zr(r, e, t, s) {
3381
+ function Jr(r, e, t, s) {
3255
3382
  return r && (s === void 0 && (s = e.child.length === 0), r = this.parseTextData(
3256
3383
  r,
3257
3384
  e.tagname,
@@ -3261,7 +3388,7 @@ function Zr(r, e, t, s) {
3261
3388
  s
3262
3389
  ), r !== void 0 && r !== "" && e.add(this.options.textNodeName, r), r = ""), r;
3263
3390
  }
3264
- function zr(r, e, t) {
3391
+ function en(r, e, t) {
3265
3392
  const s = "*." + t;
3266
3393
  for (const n in r) {
3267
3394
  const o = r[n];
@@ -3269,7 +3396,7 @@ function zr(r, e, t) {
3269
3396
  }
3270
3397
  return !1;
3271
3398
  }
3272
- function Dr(r, e, t = ">") {
3399
+ function tn(r, e, t = ">") {
3273
3400
  let s, n = "";
3274
3401
  for (let o = e; o < r.length; o++) {
3275
3402
  let i = r[o];
@@ -3293,19 +3420,19 @@ function Dr(r, e, t = ">") {
3293
3420
  n += i;
3294
3421
  }
3295
3422
  }
3296
- function ie(r, e, t, s) {
3423
+ function ce(r, e, t, s) {
3297
3424
  const n = r.indexOf(e, t);
3298
3425
  if (n === -1)
3299
3426
  throw new Error(s);
3300
3427
  return n + e.length - 1;
3301
3428
  }
3302
- function we(r, e, t, s = ">") {
3303
- const n = Dr(r, e + 1, s);
3429
+ function Ae(r, e, t, s = ">") {
3430
+ const n = tn(r, e + 1, s);
3304
3431
  if (!n) return;
3305
3432
  let o = n.data;
3306
- const i = n.index, u = o.search(/\s/);
3433
+ const i = n.index, c = o.search(/\s/);
3307
3434
  let a = o, l = !0;
3308
- u !== -1 && (a = o.substring(0, u), o = o.substring(u + 1).trimStart());
3435
+ c !== -1 && (a = o.substring(0, c), o = o.substring(c + 1).trimStart());
3309
3436
  const h = a;
3310
3437
  if (t) {
3311
3438
  const f = a.indexOf(":");
@@ -3319,13 +3446,13 @@ function we(r, e, t, s = ">") {
3319
3446
  rawTagName: h
3320
3447
  };
3321
3448
  }
3322
- function Jr(r, e, t) {
3449
+ function rn(r, e, t) {
3323
3450
  const s = t;
3324
3451
  let n = 1;
3325
3452
  for (; t < r.length; t++)
3326
3453
  if (r[t] === "<")
3327
3454
  if (r[t + 1] === "/") {
3328
- const o = ie(r, ">", t, `${e} is not closed`);
3455
+ const o = ce(r, ">", t, `${e} is not closed`);
3329
3456
  if (r.substring(t + 2, o).trim() === e && (n--, n === 0))
3330
3457
  return {
3331
3458
  tagContent: r.substring(s, t),
@@ -3333,70 +3460,70 @@ function Jr(r, e, t) {
3333
3460
  };
3334
3461
  t = o;
3335
3462
  } else if (r[t + 1] === "?")
3336
- t = ie(r, "?>", t + 1, "StopNode is not closed.");
3463
+ t = ce(r, "?>", t + 1, "StopNode is not closed.");
3337
3464
  else if (r.substr(t + 1, 3) === "!--")
3338
- t = ie(r, "-->", t + 3, "StopNode is not closed.");
3465
+ t = ce(r, "-->", t + 3, "StopNode is not closed.");
3339
3466
  else if (r.substr(t + 1, 2) === "![")
3340
- t = ie(r, "]]>", t, "StopNode is not closed.") - 2;
3467
+ t = ce(r, "]]>", t, "StopNode is not closed.") - 2;
3341
3468
  else {
3342
- const o = we(r, t, ">");
3469
+ const o = Ae(r, t, ">");
3343
3470
  o && ((o && o.tagName) === e && o.tagExp[o.tagExp.length - 1] !== "/" && n++, t = o.closeIndex);
3344
3471
  }
3345
3472
  }
3346
- function Ce(r, e, t) {
3473
+ function we(r, e, t) {
3347
3474
  if (e && typeof r == "string") {
3348
3475
  const s = r.trim();
3349
- return s === "true" ? !0 : s === "false" ? !1 : Lr(r, t);
3476
+ return s === "true" ? !0 : s === "false" ? !1 : Mr(r, t);
3350
3477
  } else
3351
- return Er(r) ? r : "";
3478
+ return kr(r) ? r : "";
3352
3479
  }
3353
- const Ae = oe.getMetaDataSymbol();
3354
- function en(r, e) {
3355
- return Ge(r, e);
3480
+ const ke = le.getMetaDataSymbol();
3481
+ function nn(r, e) {
3482
+ return We(r, e);
3356
3483
  }
3357
- function Ge(r, e, t) {
3484
+ function We(r, e, t) {
3358
3485
  let s;
3359
3486
  const n = {};
3360
3487
  for (let o = 0; o < r.length; o++) {
3361
- const i = r[o], u = tn(i);
3488
+ const i = r[o], c = sn(i);
3362
3489
  let a = "";
3363
- if (t === void 0 ? a = u : a = t + "." + u, u === e.textNodeName)
3364
- s === void 0 ? s = i[u] : s += "" + i[u];
3490
+ if (t === void 0 ? a = c : a = t + "." + c, c === e.textNodeName)
3491
+ s === void 0 ? s = i[c] : s += "" + i[c];
3365
3492
  else {
3366
- if (u === void 0)
3493
+ if (c === void 0)
3367
3494
  continue;
3368
- 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;
3495
+ if (i[c]) {
3496
+ let l = We(i[c], e, a);
3497
+ const h = an(l, e);
3498
+ i[ke] !== void 0 && (l[ke] = i[ke]), i[":@"] ? on(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[c] !== void 0 && n.hasOwnProperty(c) ? (Array.isArray(n[c]) || (n[c] = [n[c]]), n[c].push(l)) : e.isArray(c, a, h) ? n[c] = [l] : n[c] = l;
3372
3499
  }
3373
3500
  }
3374
3501
  }
3375
3502
  return typeof s == "string" ? s.length > 0 && (n[e.textNodeName] = s) : s !== void 0 && (n[e.textNodeName] = s), n;
3376
3503
  }
3377
- function tn(r) {
3504
+ function sn(r) {
3378
3505
  const e = Object.keys(r);
3379
3506
  for (let t = 0; t < e.length; t++) {
3380
3507
  const s = e[t];
3381
3508
  if (s !== ":@") return s;
3382
3509
  }
3383
3510
  }
3384
- function rn(r, e, t, s) {
3511
+ function on(r, e, t, s) {
3385
3512
  if (e) {
3386
3513
  const n = Object.keys(e), o = n.length;
3387
3514
  for (let i = 0; i < o; i++) {
3388
- const u = n[i];
3389
- s.isArray(u, t + "." + u, !0, !0) ? r[u] = [e[u]] : r[u] = e[u];
3515
+ const c = n[i];
3516
+ s.isArray(c, t + "." + c, !0, !0) ? r[c] = [e[c]] : r[c] = e[c];
3390
3517
  }
3391
3518
  }
3392
3519
  }
3393
- function nn(r, e) {
3520
+ function an(r, e) {
3394
3521
  const { textNodeName: t } = e, s = Object.keys(r).length;
3395
3522
  return !!(s === 0 || s === 1 && (r[t] || typeof r[t] == "boolean" || r[t] === 0));
3396
3523
  }
3397
- class sn {
3524
+ class ln {
3398
3525
  constructor(e) {
3399
- this.externalEntities = {}, this.options = $r(e);
3526
+ this.externalEntities = {}, this.options = Ir(e);
3400
3527
  }
3401
3528
  /**
3402
3529
  * Parse XML dats to JS object
@@ -3410,14 +3537,14 @@ class sn {
3410
3537
  throw new Error("XML data is accepted in String or Bytes[] form.");
3411
3538
  if (t) {
3412
3539
  t === !0 && (t = {});
3413
- const o = Qe(e, t);
3540
+ const o = qe(e, t);
3414
3541
  if (o !== !0)
3415
3542
  throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`);
3416
3543
  }
3417
- const s = new Fr(this.options);
3544
+ const s = new Kr(this.options);
3418
3545
  s.addExternalEntities(this.externalEntities);
3419
3546
  const n = s.parseXml(e);
3420
- return this.options.preserveOrder || n === void 0 ? n : en(n, this.options);
3547
+ return this.options.preserveOrder || n === void 0 ? n : nn(n, this.options);
3421
3548
  }
3422
3549
  /**
3423
3550
  * Add Entity which is not by default supported by this library
@@ -3444,45 +3571,45 @@ class sn {
3444
3571
  * is true in the options.
3445
3572
  */
3446
3573
  static getMetaDataSymbol() {
3447
- return oe.getMetaDataSymbol();
3574
+ return le.getMetaDataSymbol();
3448
3575
  }
3449
3576
  }
3450
- const on = `
3577
+ const cn = `
3451
3578
  `;
3452
- function an(r, e) {
3579
+ function un(r, e) {
3453
3580
  let t = "";
3454
- return e.format && e.indentBy.length > 0 && (t = on), Ze(r, e, "", t);
3581
+ return e.format && e.indentBy.length > 0 && (t = cn), Ye(r, e, "", t);
3455
3582
  }
3456
- function Ze(r, e, t, s) {
3583
+ function Ye(r, e, t, s) {
3457
3584
  let n = "", o = !1;
3458
3585
  for (let i = 0; i < r.length; i++) {
3459
- const u = r[i], a = ln(u);
3586
+ const c = r[i], a = dn(c);
3460
3587
  if (a === void 0) continue;
3461
3588
  let l = "";
3462
3589
  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;
3590
+ let w = c[a];
3591
+ fn(l, e) || (w = e.tagValueProcessor(a, w), w = Ge(w, e)), o && (n += s), n += w, o = !1;
3465
3592
  continue;
3466
3593
  } else if (a === e.cdataPropName) {
3467
- o && (n += s), n += `<![CDATA[${u[a][0][e.textNodeName]}]]>`, o = !1;
3594
+ o && (n += s), n += `<![CDATA[${c[a][0][e.textNodeName]}]]>`, o = !1;
3468
3595
  continue;
3469
3596
  } else if (a === e.commentPropName) {
3470
- n += s + `<!--${u[a][0][e.textNodeName]}-->`, o = !0;
3597
+ n += s + `<!--${c[a][0][e.textNodeName]}-->`, o = !0;
3471
3598
  continue;
3472
3599
  } 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;
3600
+ const w = Re(c[":@"], e), O = a === "?xml" ? "" : s;
3601
+ let x = c[a][0][e.textNodeName];
3602
+ x = x.length !== 0 ? " " + x : "", n += O + `<${a}${x}${w}?>`, o = !0;
3476
3603
  continue;
3477
3604
  }
3478
3605
  let h = s;
3479
3606
  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;
3607
+ const f = Re(c[":@"], e), E = s + `<${a}${f}`, _ = Ye(c[a], e, l, h);
3608
+ e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += E + ">" : n += E + "/>" : (!_ || _.length === 0) && e.suppressEmptyNode ? n += E + "/>" : _ && _.endsWith(">") ? n += E + `>${_}${s}</${a}>` : (n += E + ">", _ && s !== "" && (_.includes("/>") || _.includes("</")) ? n += s + e.indentBy + _ + s : n += _, n += `</${a}>`), o = !0;
3482
3609
  }
3483
3610
  return n;
3484
3611
  }
3485
- function ln(r) {
3612
+ function dn(r) {
3486
3613
  const e = Object.keys(r);
3487
3614
  for (let t = 0; t < e.length; t++) {
3488
3615
  const s = e[t];
@@ -3490,24 +3617,24 @@ function ln(r) {
3490
3617
  return s;
3491
3618
  }
3492
3619
  }
3493
- function Me(r, e) {
3620
+ function Re(r, e) {
3494
3621
  let t = "";
3495
3622
  if (r && !e.ignoreAttributes)
3496
3623
  for (let s in r) {
3497
3624
  if (!r.hasOwnProperty(s)) continue;
3498
3625
  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}"`;
3626
+ n = Ge(n, e), n === !0 && e.suppressBooleanAttributes ? t += ` ${s.substr(e.attributeNamePrefix.length)}` : t += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
3500
3627
  }
3501
3628
  return t;
3502
3629
  }
3503
- function un(r, e) {
3630
+ function fn(r, e) {
3504
3631
  r = r.substr(0, r.length - e.textNodeName.length - 1);
3505
3632
  let t = r.substr(r.lastIndexOf(".") + 1);
3506
3633
  for (let s in e.stopNodes)
3507
3634
  if (e.stopNodes[s] === r || e.stopNodes[s] === "*." + t) return !0;
3508
3635
  return !1;
3509
3636
  }
3510
- function ze(r, e) {
3637
+ function Ge(r, e) {
3511
3638
  if (r && r.length > 0 && e.processEntities)
3512
3639
  for (let t = 0; t < e.entities.length; t++) {
3513
3640
  const s = e.entities[t];
@@ -3515,7 +3642,7 @@ function ze(r, e) {
3515
3642
  }
3516
3643
  return r;
3517
3644
  }
3518
- const cn = {
3645
+ const hn = {
3519
3646
  attributeNamePrefix: "@_",
3520
3647
  attributesGroupName: !1,
3521
3648
  textNodeName: "#text",
@@ -3550,16 +3677,16 @@ const cn = {
3550
3677
  oneListGroup: !1
3551
3678
  };
3552
3679
  function ne(r) {
3553
- this.options = Object.assign({}, cn, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3680
+ this.options = Object.assign({}, hn, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3554
3681
  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 = `>
3682
+ } : (this.ignoreAttributesFn = Qe(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = mn), this.processTextOrObjNode = pn, this.options.format ? (this.indentate = gn, this.tagEndChar = `>
3556
3683
  `, this.newLine = `
3557
3684
  `) : (this.indentate = function() {
3558
3685
  return "";
3559
3686
  }, this.tagEndChar = ">", this.newLine = "");
3560
3687
  }
3561
3688
  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 = {
3689
+ return this.options.preserveOrder ? un(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
3563
3690
  [this.options.arrayNodeName]: r
3564
3691
  }), this.j2x(r, 0, []).val);
3565
3692
  };
@@ -3575,39 +3702,39 @@ ne.prototype.j2x = function(r, e, t) {
3575
3702
  else if (r[i] instanceof Date)
3576
3703
  n += this.buildTextValNode(r[i], i, "", e);
3577
3704
  else if (typeof r[i] != "object") {
3578
- const u = this.isAttribute(i);
3579
- if (u && !this.ignoreAttributesFn(u, o))
3580
- s += this.buildAttrPairStr(u, "" + r[i]);
3581
- else if (!u)
3705
+ const c = this.isAttribute(i);
3706
+ if (c && !this.ignoreAttributesFn(c, o))
3707
+ s += this.buildAttrPairStr(c, "" + r[i]);
3708
+ else if (!c)
3582
3709
  if (i === this.options.textNodeName) {
3583
3710
  let a = this.options.tagValueProcessor(i, "" + r[i]);
3584
3711
  n += this.replaceEntitiesValue(a);
3585
3712
  } else
3586
3713
  n += this.buildTextValNode(r[i], i, "", e);
3587
3714
  } else if (Array.isArray(r[i])) {
3588
- const u = r[i].length;
3715
+ const c = r[i].length;
3589
3716
  let a = "", l = "";
3590
- for (let h = 0; h < u; h++) {
3717
+ for (let h = 0; h < c; h++) {
3591
3718
  const f = r[i][h];
3592
3719
  if (!(typeof f > "u")) if (f === null)
3593
3720
  i[0] === "?" ? n += this.indentate(e) + "<" + i + "?" + this.tagEndChar : n += this.indentate(e) + "<" + i + "/" + this.tagEndChar;
3594
3721
  else if (typeof f == "object")
3595
3722
  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);
3723
+ const E = this.j2x(f, e + 1, t.concat(i));
3724
+ a += E.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (l += E.attrStr);
3598
3725
  } else
3599
3726
  a += this.processTextOrObjNode(f, i, e, t);
3600
3727
  else if (this.options.oneListGroup) {
3601
- let b = this.options.tagValueProcessor(i, f);
3602
- b = this.replaceEntitiesValue(b), a += b;
3728
+ let E = this.options.tagValueProcessor(i, f);
3729
+ E = this.replaceEntitiesValue(E), a += E;
3603
3730
  } else
3604
3731
  a += this.buildTextValNode(f, i, "", e);
3605
3732
  }
3606
3733
  this.options.oneListGroup && (a = this.buildObjectNode(a, i, l, e)), n += a;
3607
3734
  } else if (this.options.attributesGroupName && i === this.options.attributesGroupName) {
3608
- const u = Object.keys(r[i]), a = u.length;
3735
+ const c = Object.keys(r[i]), a = c.length;
3609
3736
  for (let l = 0; l < a; l++)
3610
- s += this.buildAttrPairStr(u[l], "" + r[i][u[l]]);
3737
+ s += this.buildAttrPairStr(c[l], "" + r[i][c[l]]);
3611
3738
  } else
3612
3739
  n += this.processTextOrObjNode(r[i], i, e, t);
3613
3740
  return { attrStr: s, val: n };
@@ -3615,7 +3742,7 @@ ne.prototype.j2x = function(r, e, t) {
3615
3742
  ne.prototype.buildAttrPairStr = function(r, e) {
3616
3743
  return e = this.options.attributeValueProcessor(r, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + r : " " + r + '="' + e + '"';
3617
3744
  };
3618
- function dn(r, e, t, s) {
3745
+ function pn(r, e, t, s) {
3619
3746
  const n = this.j2x(r, t + 1, s.concat(e));
3620
3747
  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
3748
  }
@@ -3651,15 +3778,15 @@ ne.prototype.replaceEntitiesValue = function(r) {
3651
3778
  }
3652
3779
  return r;
3653
3780
  };
3654
- function fn(r) {
3781
+ function gn(r) {
3655
3782
  return this.options.indentBy.repeat(r);
3656
3783
  }
3657
- function hn(r) {
3784
+ function mn(r) {
3658
3785
  return r.startsWith(this.options.attributeNamePrefix) && r !== this.options.textNodeName ? r.substr(this.attrPrefixLen) : !1;
3659
3786
  }
3660
- const pn = {
3661
- validate: Qe
3662
- }, gn = {
3787
+ const bn = {
3788
+ validate: qe
3789
+ }, yn = {
3663
3790
  ignoreAttributes: !1,
3664
3791
  // 保留属性
3665
3792
  attributeNamePrefix: "@_",
@@ -3694,7 +3821,7 @@ const pn = {
3694
3821
  // 停止解析的节点
3695
3822
  alwaysCreateTextNode: !1
3696
3823
  // 仅在有文本时创建文本节点
3697
- }, mn = {
3824
+ }, vn = {
3698
3825
  ignoreAttributes: !1,
3699
3826
  attributeNamePrefix: "@_",
3700
3827
  textNodeName: "#text",
@@ -3706,9 +3833,9 @@ const pn = {
3706
3833
  // 不抑制空节点
3707
3834
  suppressBooleanAttributes: !1,
3708
3835
  suppressUnpairedNode: !1
3709
- }, yn = (r) => {
3836
+ }, _n = (r) => {
3710
3837
  try {
3711
- const e = pn.validate(r, {
3838
+ const e = bn.validate(r, {
3712
3839
  allowBooleanAttributes: !0
3713
3840
  });
3714
3841
  return e === !0 ? { valid: !0 } : {
@@ -3721,10 +3848,10 @@ const pn = {
3721
3848
  error: e instanceof Error ? e.message : "Unknown validation error"
3722
3849
  };
3723
3850
  }
3724
- }, De = (r, e) => {
3851
+ }, Ze = (r, e) => {
3725
3852
  try {
3726
- return new sn({
3727
- ...gn,
3853
+ return new ln({
3854
+ ...yn,
3728
3855
  ...e
3729
3856
  }).parse(r);
3730
3857
  } catch (t) {
@@ -3732,10 +3859,10 @@ const pn = {
3732
3859
  `XML 解析失败: ${t instanceof Error ? t.message : "Unknown error"}`
3733
3860
  );
3734
3861
  }
3735
- }, Pe = (r, e) => {
3862
+ }, Te = (r, e) => {
3736
3863
  try {
3737
3864
  let s = new ne({
3738
- ...mn,
3865
+ ...vn,
3739
3866
  format: e?.format ?? !0,
3740
3867
  indentBy: e?.indentBy ?? " "
3741
3868
  }).build(r);
@@ -3746,66 +3873,66 @@ const pn = {
3746
3873
  `XML 构建失败: ${t instanceof Error ? t.message : "Unknown error"}`
3747
3874
  );
3748
3875
  }
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, {
3876
+ }, En = (r) => Array.isArray(r) ? _e(r, { format: !1 }) : Te(r, { format: !1, showDeclaration: !1 }), xn = (r, e) => {
3877
+ const t = Ze(r);
3878
+ return Array.isArray(t) ? _e(t, {
3752
3879
  indent: e?.indentBy
3753
- }) : Pe(t, e);
3754
- }, Ee = (r, e = {}) => {
3880
+ }) : Te(t, e);
3881
+ }, _e = (r, e = {}) => {
3755
3882
  const t = e.indent !== void 0 ? e.indent : " ", s = e.level || 0, n = e.format !== !1, o = n ? t.repeat(s) : "", i = n ? `
3756
3883
  ` : "";
3757
- let u = "";
3884
+ let c = "";
3758
3885
  for (const a of r) {
3759
3886
  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}`;
3887
+ const x = a[":@"] || {}, S = Object.entries(x).map(([X, Z]) => `${X.startsWith("@_") ? X.substring(2) : X}="${Z}"`).join(" ");
3888
+ c += `<?xml ${S}?>${i}`;
3762
3889
  continue;
3763
3890
  }
3764
3891
  if (a["#comment"]) {
3765
- const _ = a["#comment"];
3766
- if (Array.isArray(_) && _.length > 0) {
3767
- const j = _[0]["#text"] || _[0];
3768
- u += `${o}<!--${j}-->${i}`;
3892
+ const x = a["#comment"];
3893
+ if (Array.isArray(x) && x.length > 0) {
3894
+ const S = x[0]["#text"] || x[0];
3895
+ c += `${o}<!--${S}-->${i}`;
3769
3896
  }
3770
3897
  continue;
3771
3898
  }
3772
- const l = Object.keys(a).find((_) => !_.startsWith(":") && !_.startsWith("#") && !_.startsWith("__"));
3899
+ const l = Object.keys(a).find((x) => !x.startsWith(":") && !x.startsWith("#") && !x.startsWith("__"));
3773
3900
  if (!l) continue;
3774
- const h = a[l], f = a[":@"] || {}, b = Object.entries(f).map(([_, j]) => `${_.startsWith("@_") ? _.substring(2) : _}="${j}"`).join(" "), m = b ? " " + b : "";
3901
+ const h = a[l], f = a[":@"] || {}, E = Object.entries(f).map(([x, S]) => `${x.startsWith("@_") ? x.substring(2) : x}="${S}"`).join(" "), _ = E ? " " + E : "";
3775
3902
  if (!Array.isArray(h) || h.length === 0) {
3776
- u += `${o}<${l}${m}/>${i}`;
3903
+ c += `${o}<${l}${_}/>${i}`;
3777
3904
  continue;
3778
3905
  }
3779
3906
  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}`;
3907
+ if (h.some((x) => x.__cdata)) {
3908
+ const x = h.find((S) => S.__cdata);
3909
+ if (x) {
3910
+ const S = x.__cdata[0]["#text"] || "";
3911
+ c += `${o}<${l}${_}><![CDATA[${S}]]></${l}>${i}`;
3785
3912
  }
3786
3913
  } else if (w) {
3787
- const _ = h[0]["#text"];
3788
- u += `${o}<${l}${m}>${_}</${l}>${i}`;
3914
+ const x = h[0]["#text"];
3915
+ c += `${o}<${l}${_}>${x}</${l}>${i}`;
3789
3916
  } else
3790
- u += `${o}<${l}${m}>${i}`, u += Ee(h, { indent: t, level: s + 1, format: n }), u += `${o}</${l}>${i}`;
3917
+ c += `${o}<${l}${_}>${i}`, c += _e(h, { indent: t, level: s + 1, format: n }), c += `${o}</${l}>${i}`;
3791
3918
  }
3792
- return u;
3793
- }, En = {
3919
+ return c;
3920
+ }, kn = {
3794
3921
  key: 0,
3795
3922
  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 = {
3923
+ }, Nn = { class: "xml-format__actions" }, An = ["disabled"], wn = ["disabled"], Cn = ["disabled"], On = ["disabled"], Tn = ["disabled"], Pn = { class: "xml-format__info" }, $n = {
3797
3924
  key: 0,
3798
3925
  class: "xml-format__status xml-format__status--success"
3799
- }, Tn = {
3926
+ }, Sn = {
3800
3927
  key: 1,
3801
3928
  class: "xml-format__status xml-format__status--error"
3802
- }, Pn = { class: "xml-format__content" }, $n = {
3929
+ }, Bn = { class: "xml-format__content" }, In = {
3803
3930
  key: 0,
3804
3931
  class: "xml-format__error"
3805
- }, Sn = {
3932
+ }, Vn = {
3806
3933
  key: 1,
3807
3934
  class: "xml-format__viewer"
3808
- }, In = /* @__PURE__ */ ye({
3935
+ }, Ln = /* @__PURE__ */ be({
3809
3936
  __name: "index",
3810
3937
  props: {
3811
3938
  modelValue: { default: "" },
@@ -3819,7 +3946,7 @@ const pn = {
3819
3946
  },
3820
3947
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress", "format"],
3821
3948
  setup(r, { expose: e, emit: t }) {
3822
- Oe((E) => ({
3949
+ Ce((g) => ({
3823
3950
  "0db40539": l.value.colors.border,
3824
3951
  bd72d08a: l.value.colors.background,
3825
3952
  "1738b57a": l.value.colors.text,
@@ -3835,182 +3962,182 @@ const pn = {
3835
3962
  "61df294a": l.value.colors.error,
3836
3963
  "3307322e": l.value.colors.errorBackground
3837
3964
  }));
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(() => {
3965
+ const s = r, n = t, o = W(null), i = W(""), c = W(/* @__PURE__ */ new Set()), a = V(() => i.value === ""), l = V(() => vr(s.theme)), h = V(() => !o.value || !Array.isArray(o.value) ? [] : o.value.filter((g) => !g["?xml"])), f = V(() => {
3839
3966
  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()) {
3967
+ const g = o.value.find((R) => R["?xml"]);
3968
+ if (!g || !g[":@"]) return null;
3969
+ const C = g[":@"], $ = [];
3970
+ return C["@_version"] && $.push(`version="${C["@_version"]}"`), C["@_encoding"] && $.push(`encoding="${C["@_encoding"]}"`), C["@_standalone"] && $.push(`standalone="${C["@_standalone"]}"`), $.length > 0 ? `<?xml ${$.join(" ")}?>` : null;
3971
+ }), E = V(() => h.value), _ = (g) => {
3972
+ if (!g || !g.trim()) {
3846
3973
  i.value = "", o.value = null;
3847
3974
  return;
3848
3975
  }
3849
3976
  try {
3850
- const O = yn(E);
3851
- if (!O.valid) {
3852
- i.value = O.error || "Invalid XML", o.value = null;
3977
+ const C = _n(g);
3978
+ if (!C.valid) {
3979
+ i.value = C.error || "Invalid XML", o.value = null;
3853
3980
  return;
3854
3981
  }
3855
- o.value = De(E), i.value = "", he(() => {
3856
- S();
3982
+ o.value = Ze(g), i.value = "", he(() => {
3983
+ O();
3857
3984
  });
3858
- } catch (O) {
3859
- i.value = O instanceof Error ? O.message : "Unknown parse error", o.value = null;
3985
+ } catch (C) {
3986
+ i.value = C instanceof Error ? C.message : "Unknown parse error", o.value = null;
3860
3987
  }
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);
3988
+ }, w = (g) => {
3989
+ c.value.has(g) ? c.value.delete(g) : c.value.add(g);
3990
+ }, O = () => {
3991
+ const g = /* @__PURE__ */ new Set(), C = ($, R = "") => {
3992
+ Array.isArray($) && $.forEach((K, Y) => {
3993
+ const q = Object.keys(K).find((oe) => !oe.startsWith(":") && !oe.startsWith("#"));
3994
+ if (!q) return;
3995
+ const se = R ? `${R}[${Y}]` : `${q}[${Y}]`;
3996
+ g.add(se);
3997
+ const J = K[q];
3998
+ Array.isArray(J) && C(J, se + "." + q);
3872
3999
  });
3873
4000
  };
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);
4001
+ h.value.forEach(($, R) => {
4002
+ const K = Object.keys($).find((Y) => !Y.startsWith(":") && !Y.startsWith("#"));
4003
+ if (K) {
4004
+ const Y = `${K}[${R}]`;
4005
+ g.add(Y);
4006
+ const q = $[K];
4007
+ Array.isArray(q) && C(q, Y + "." + K);
3881
4008
  }
3882
- }), u.value = E, n("expand-all");
3883
- }, _ = () => {
3884
- u.value.clear(), n("collapse-all");
3885
- }, j = async () => {
4009
+ }), c.value = g, n("expand-all");
4010
+ }, x = () => {
4011
+ c.value.clear(), n("collapse-all");
4012
+ }, S = async () => {
3886
4013
  if (!(!a.value || !o.value))
3887
4014
  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);
4015
+ const g = Array.isArray(o.value) ? _e(o.value, { indent: " " }) : Te(o.value, { format: !0, indentBy: " " });
4016
+ await navigator.clipboard.writeText(g), n("copy-success", g);
4017
+ } catch (g) {
4018
+ const C = g instanceof Error ? g : new Error("Copy failed");
4019
+ n("copy-error", C), console.error("Failed to copy XML:", g);
3893
4020
  }
3894
- }, H = () => {
4021
+ }, X = () => {
3895
4022
  if (!(!a.value || !o.value))
3896
4023
  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);
4024
+ const g = En(o.value);
4025
+ n("update:modelValue", g), n("compress", g);
4026
+ } catch (g) {
4027
+ console.error("Failed to compress XML:", g);
3901
4028
  }
3902
- }, p = () => {
4029
+ }, Z = () => {
3903
4030
  if (a.value)
3904
4031
  try {
3905
- const E = vn(s.modelValue, {
4032
+ const g = xn(s.modelValue, {
3906
4033
  format: !0,
3907
4034
  indentBy: " "
3908
4035
  });
3909
- n("update:modelValue", E), n("format", E);
3910
- } catch (E) {
3911
- console.error("Failed to format XML:", E);
4036
+ n("update:modelValue", g), n("format", g);
4037
+ } catch (g) {
4038
+ console.error("Failed to format XML:", g);
3912
4039
  }
3913
- }, $ = async (E) => {
4040
+ }, p = async (g) => {
3914
4041
  try {
3915
- const O = typeof E == "string" ? E : JSON.stringify(E, null, 2);
3916
- await navigator.clipboard.writeText(O), n("copy-success", O);
3917
- } 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);
4042
+ const C = typeof g == "string" ? g : JSON.stringify(g, null, 2);
4043
+ await navigator.clipboard.writeText(C), n("copy-success", C);
4044
+ } catch (C) {
4045
+ const $ = C instanceof Error ? C : new Error("Copy failed");
4046
+ n("copy-error", $), console.error("Failed to copy value:", C);
3920
4047
  }
3921
4048
  };
3922
- return Xe(() => s.modelValue, (E) => {
3923
- m(E);
4049
+ return Ue(() => s.modelValue, (g) => {
4050
+ _(g);
3924
4051
  }, { immediate: !0 }), e({
3925
4052
  // 核心操作方法
3926
- copyXml: j,
3927
- compressSource: H,
3928
- formatSource: p,
3929
- expandAll: S,
3930
- collapseAll: _,
4053
+ copyXml: S,
4054
+ compressSource: X,
4055
+ formatSource: Z,
4056
+ expandAll: O,
4057
+ collapseAll: x,
3931
4058
  toggleExpand: w,
3932
4059
  // 状态访问方法
3933
4060
  isValidXml: () => a.value,
3934
4061
  getParsedXml: () => o.value,
3935
- getExpandedNodes: () => u.value,
4062
+ getExpandedNodes: () => c.value,
3936
4063
  getParseError: () => i.value,
3937
4064
  // 工具方法
3938
- parseXmlString: (E) => m(E),
3939
- copyValue: (E) => $(E)
3940
- }), (E, O) => (x(), A("div", {
3941
- class: Te(["xml-format", `xml-format--${l.value.name}`])
4065
+ parseXmlString: (g) => _(g),
4066
+ copyValue: (g) => p(g)
4067
+ }), (g, C) => (k(), A("div", {
4068
+ class: Oe(["xml-format", `xml-format--${l.value.name}`])
3942
4069
  }, [
3943
- E.showToolbar ? (x(), A("div", En, [
3944
- v("div", _n, [
3945
- v("button", {
4070
+ g.showToolbar ? (k(), A("div", kn, [
4071
+ y("div", Nn, [
4072
+ y("button", {
3946
4073
  class: "xml-format__btn xml-format__btn--primary",
3947
- onClick: j,
4074
+ onClick: S,
3948
4075
  disabled: !a.value,
3949
4076
  title: "Copy XML"
3950
- }, " 📋 Copy ", 8, xn),
3951
- v("button", {
4077
+ }, " 📋 Copy ", 8, An),
4078
+ y("button", {
3952
4079
  class: "xml-format__btn xml-format__btn--secondary",
3953
- onClick: S,
4080
+ onClick: O,
3954
4081
  disabled: !a.value,
3955
4082
  title: "Expand All"
3956
- }, " ⬇️ Expand All ", 8, Nn),
3957
- v("button", {
4083
+ }, " ⬇️ Expand All ", 8, wn),
4084
+ y("button", {
3958
4085
  class: "xml-format__btn xml-format__btn--secondary",
3959
- onClick: _,
4086
+ onClick: x,
3960
4087
  disabled: !a.value,
3961
4088
  title: "Collapse All"
3962
- }, " ➡️ Collapse All ", 8, An),
3963
- v("button", {
4089
+ }, " ➡️ Collapse All ", 8, Cn),
4090
+ y("button", {
3964
4091
  class: "xml-format__btn xml-format__btn--secondary",
3965
- onClick: H,
4092
+ onClick: X,
3966
4093
  disabled: !a.value,
3967
4094
  title: "Compress XML"
3968
- }, " 📦 Compress ", 8, kn),
3969
- v("button", {
4095
+ }, " 📦 Compress ", 8, On),
4096
+ y("button", {
3970
4097
  class: "xml-format__btn xml-format__btn--secondary",
3971
- onClick: p,
4098
+ onClick: Z,
3972
4099
  disabled: !a.value,
3973
4100
  title: "Format XML"
3974
- }, " ✨ Format ", 8, wn)
4101
+ }, " ✨ Format ", 8, Tn)
3975
4102
  ]),
3976
- v("div", Cn, [
3977
- a.value ? (x(), A("span", On, " ✅ Valid XML ")) : (x(), A("span", Tn, " ❌ Invalid XML "))
4103
+ y("div", Pn, [
4104
+ a.value ? (k(), A("span", $n, " ✅ Valid XML ")) : (k(), A("span", Sn, " ❌ Invalid XML "))
3978
4105
  ])
3979
- ])) : F("", !0),
3980
- v("div", Pn, [
3981
- a.value ? (x(), A("div", Sn, [
3982
- f.value ? (x(), A("div", {
4106
+ ])) : H("", !0),
4107
+ y("div", Bn, [
4108
+ a.value ? (k(), A("div", Vn, [
4109
+ f.value ? (k(), A("div", {
3983
4110
  key: 0,
3984
4111
  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,
4112
+ style: N({ color: l.value.colors.xmlDeclaration })
4113
+ }, B(f.value), 5)) : H("", !0),
4114
+ (k(!0), A(re, null, ae(E.value, ($, R) => (k(), Fe(pr, {
4115
+ key: R,
4116
+ node: $,
4117
+ index: R,
3991
4118
  level: 0,
3992
- expanded: u.value,
4119
+ expanded: c.value,
3993
4120
  theme: l.value,
3994
4121
  onToggleExpand: w,
3995
- onCopy: $
4122
+ onCopy: p
3996
4123
  }, 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)
4124
+ ])) : (k(), A("div", In, [
4125
+ C[0] || (C[0] = y("h4", null, "XML Parse Error:", -1)),
4126
+ y("pre", null, B(i.value), 1)
4000
4127
  ]))
4001
4128
  ])
4002
4129
  ], 2));
4003
4130
  }
4004
- }), jn = /* @__PURE__ */ be(In, [["__scopeId", "data-v-f9125514"]]), Bn = [Zt], Vn = (r) => {
4005
- Bn.forEach((e) => {
4131
+ }), Fn = /* @__PURE__ */ ye(Ln, [["__scopeId", "data-v-f9125514"]]), Rn = [zt], jn = (r) => {
4132
+ Rn.forEach((e) => {
4006
4133
  const t = e.name || e.__name || "UnknownComponent";
4007
4134
  r.component(t, e);
4008
4135
  });
4009
- }, Mn = {
4010
- install: Vn
4136
+ }, Xn = {
4137
+ install: jn
4011
4138
  };
4012
4139
  export {
4013
- Zt as JsonFormat,
4014
- jn as XmlFormat,
4015
- Mn as default
4140
+ zt as JsonFormat,
4141
+ Fn as XmlFormat,
4142
+ Xn as default
4016
4143
  };