lone-format 0.1.1 → 0.1.2

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,32 +1,895 @@
1
- import { defineComponent as G, useCssVars as R, ref as C, computed as g, resolveComponent as X, createElementBlock as r, openBlock as u, createElementVNode as k, createCommentVNode as m, withDirectives as z, toDisplayString as S, withKeys as w, vModelText as M, createTextVNode as Y, Fragment as Z, renderList as ee, createVNode as H, normalizeClass as te, nextTick as W, watch as ne } from "vue";
2
- const se = { class: "json-node" }, oe = {
1
+ import { defineComponent as De, useCssVars as Me, ref as ye, computed as fe, resolveComponent as qe, createElementBlock as Y, openBlock as K, createElementVNode as le, createCommentVNode as se, withDirectives as je, toDisplayString as he, withKeys as me, vModelText as Ce, createTextVNode as Ge, Fragment as ze, renderList as He, createVNode as Ue, normalizeClass as Xe, nextTick as Pe, watch as We } from "vue";
2
+ function Ye(G) {
3
+ return G && G.__esModule && Object.prototype.hasOwnProperty.call(G, "default") ? G.default : G;
4
+ }
5
+ var we = { exports: {} }, Ie = { exports: {} }, Ae = { exports: {} }, Ke = Ae.exports, Te;
6
+ function Le() {
7
+ return Te || (Te = 1, function(G) {
8
+ (function(ee) {
9
+ var N, ne = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, O = Math.ceil, j = Math.floor, C = "[BigNumber Error] ", y = C + "Number primitive has more than 15 significant digits: ", T = 1e14, w = 14, J = 9007199254740991, A = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], P = 1e7, $ = 1e9;
10
+ function z(S) {
11
+ var k, L, g, c = v.prototype = { constructor: v, toString: null, valueOf: null }, _ = new v(1), m = 20, p = 4, h = -7, U = 21, M = -1e7, H = 1e7, ie = !1, pe = 1, ge = 0, ke = {
12
+ prefix: "",
13
+ groupSize: 3,
14
+ secondaryGroupSize: 0,
15
+ groupSeparator: ",",
16
+ decimalSeparator: ".",
17
+ fractionGroupSize: 0,
18
+ fractionGroupSeparator: " ",
19
+ // non-breaking space
20
+ suffix: ""
21
+ }, ve = "0123456789abcdefghijklmnopqrstuvwxyz", Ee = !0;
22
+ function v(e, t) {
23
+ var n, u, i, s, f, r, o, a, l = this;
24
+ if (!(l instanceof v)) return new v(e, t);
25
+ if (t == null) {
26
+ if (e && e._isBigNumber === !0) {
27
+ l.s = e.s, !e.c || e.e > H ? l.c = l.e = null : e.e < M ? l.c = [l.e = 0] : (l.e = e.e, l.c = e.c.slice());
28
+ return;
29
+ }
30
+ if ((r = typeof e == "number") && e * 0 == 0) {
31
+ if (l.s = 1 / e < 0 ? (e = -e, -1) : 1, e === ~~e) {
32
+ for (s = 0, f = e; f >= 10; f /= 10, s++) ;
33
+ s > H ? l.c = l.e = null : (l.e = s, l.c = [e]);
34
+ return;
35
+ }
36
+ a = String(e);
37
+ } else {
38
+ if (!ne.test(a = String(e))) return g(l, a, r);
39
+ l.s = a.charCodeAt(0) == 45 ? (a = a.slice(1), -1) : 1;
40
+ }
41
+ (s = a.indexOf(".")) > -1 && (a = a.replace(".", "")), (f = a.search(/e/i)) > 0 ? (s < 0 && (s = f), s += +a.slice(f + 1), a = a.substring(0, f)) : s < 0 && (s = a.length);
42
+ } else {
43
+ if (x(t, 2, ve.length, "Base"), t == 10 && Ee)
44
+ return l = new v(e), ue(l, m + l.e + 1, p);
45
+ if (a = String(e), r = typeof e == "number") {
46
+ if (e * 0 != 0) return g(l, a, r, t);
47
+ if (l.s = 1 / e < 0 ? (a = a.slice(1), -1) : 1, v.DEBUG && a.replace(/^0\.0*|\./, "").length > 15)
48
+ throw Error(y + e);
49
+ } else
50
+ l.s = a.charCodeAt(0) === 45 ? (a = a.slice(1), -1) : 1;
51
+ for (n = ve.slice(0, t), s = f = 0, o = a.length; f < o; f++)
52
+ if (n.indexOf(u = a.charAt(f)) < 0) {
53
+ if (u == ".") {
54
+ if (f > s) {
55
+ s = o;
56
+ continue;
57
+ }
58
+ } else if (!i && (a == a.toUpperCase() && (a = a.toLowerCase()) || a == a.toLowerCase() && (a = a.toUpperCase()))) {
59
+ i = !0, f = -1, s = 0;
60
+ continue;
61
+ }
62
+ return g(l, String(e), r, t);
63
+ }
64
+ r = !1, a = L(a, t, 10, l.s), (s = a.indexOf(".")) > -1 ? a = a.replace(".", "") : s = a.length;
65
+ }
66
+ for (f = 0; a.charCodeAt(f) === 48; f++) ;
67
+ for (o = a.length; a.charCodeAt(--o) === 48; ) ;
68
+ if (a = a.slice(f, ++o)) {
69
+ if (o -= f, r && v.DEBUG && o > 15 && (e > J || e !== j(e)))
70
+ throw Error(y + l.s * e);
71
+ if ((s = s - f - 1) > H)
72
+ l.c = l.e = null;
73
+ else if (s < M)
74
+ l.c = [l.e = 0];
75
+ else {
76
+ if (l.e = s, l.c = [], f = (s + 1) % w, s < 0 && (f += w), f < o) {
77
+ for (f && l.c.push(+a.slice(0, f)), o -= w; f < o; )
78
+ l.c.push(+a.slice(f, f += w));
79
+ f = w - (a = a.slice(f)).length;
80
+ } else
81
+ f -= o;
82
+ for (; f--; a += "0") ;
83
+ l.c.push(+a);
84
+ }
85
+ } else
86
+ l.c = [l.e = 0];
87
+ }
88
+ v.clone = z, v.ROUND_UP = 0, v.ROUND_DOWN = 1, v.ROUND_CEIL = 2, v.ROUND_FLOOR = 3, v.ROUND_HALF_UP = 4, v.ROUND_HALF_DOWN = 5, v.ROUND_HALF_EVEN = 6, v.ROUND_HALF_CEIL = 7, v.ROUND_HALF_FLOOR = 8, v.EUCLID = 9, v.config = v.set = function(e) {
89
+ var t, n;
90
+ if (e != null)
91
+ if (typeof e == "object") {
92
+ if (e.hasOwnProperty(t = "DECIMAL_PLACES") && (n = e[t], x(n, 0, $, t), m = n), e.hasOwnProperty(t = "ROUNDING_MODE") && (n = e[t], x(n, 0, 8, t), p = n), e.hasOwnProperty(t = "EXPONENTIAL_AT") && (n = e[t], n && n.pop ? (x(n[0], -$, 0, t), x(n[1], 0, $, t), h = n[0], U = n[1]) : (x(n, -$, $, t), h = -(U = n < 0 ? -n : n))), e.hasOwnProperty(t = "RANGE"))
93
+ if (n = e[t], n && n.pop)
94
+ x(n[0], -$, -1, t), x(n[1], 1, $, t), M = n[0], H = n[1];
95
+ else if (x(n, -$, $, t), n)
96
+ M = -(H = n < 0 ? -n : n);
97
+ else
98
+ throw Error(C + t + " cannot be zero: " + n);
99
+ if (e.hasOwnProperty(t = "CRYPTO"))
100
+ if (n = e[t], n === !!n)
101
+ if (n)
102
+ if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
103
+ ie = n;
104
+ else
105
+ throw ie = !n, Error(C + "crypto unavailable");
106
+ else
107
+ ie = n;
108
+ else
109
+ throw Error(C + t + " not true or false: " + n);
110
+ if (e.hasOwnProperty(t = "MODULO_MODE") && (n = e[t], x(n, 0, 9, t), pe = n), e.hasOwnProperty(t = "POW_PRECISION") && (n = e[t], x(n, 0, $, t), ge = n), e.hasOwnProperty(t = "FORMAT"))
111
+ if (n = e[t], typeof n == "object") ke = n;
112
+ else throw Error(C + t + " not an object: " + n);
113
+ if (e.hasOwnProperty(t = "ALPHABET"))
114
+ if (n = e[t], typeof n == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(n))
115
+ Ee = n.slice(0, 10) == "0123456789", ve = n;
116
+ else
117
+ throw Error(C + t + " invalid: " + n);
118
+ } else
119
+ throw Error(C + "Object expected: " + e);
120
+ return {
121
+ DECIMAL_PLACES: m,
122
+ ROUNDING_MODE: p,
123
+ EXPONENTIAL_AT: [h, U],
124
+ RANGE: [M, H],
125
+ CRYPTO: ie,
126
+ MODULO_MODE: pe,
127
+ POW_PRECISION: ge,
128
+ FORMAT: ke,
129
+ ALPHABET: ve
130
+ };
131
+ }, v.isBigNumber = function(e) {
132
+ if (!e || e._isBigNumber !== !0) return !1;
133
+ if (!v.DEBUG) return !0;
134
+ var t, n, u = e.c, i = e.e, s = e.s;
135
+ e: if ({}.toString.call(u) == "[object Array]") {
136
+ if ((s === 1 || s === -1) && i >= -$ && i <= $ && i === j(i)) {
137
+ if (u[0] === 0) {
138
+ if (i === 0 && u.length === 1) return !0;
139
+ break e;
140
+ }
141
+ if (t = (i + 1) % w, t < 1 && (t += w), String(u[0]).length == t) {
142
+ for (t = 0; t < u.length; t++)
143
+ if (n = u[t], n < 0 || n >= T || n !== j(n)) break e;
144
+ if (n !== 0) return !0;
145
+ }
146
+ }
147
+ } else if (u === null && i === null && (s === null || s === 1 || s === -1))
148
+ return !0;
149
+ throw Error(C + "Invalid BigNumber: " + e);
150
+ }, v.maximum = v.max = function() {
151
+ return $e(arguments, -1);
152
+ }, v.minimum = v.min = function() {
153
+ return $e(arguments, 1);
154
+ }, v.random = function() {
155
+ var e = 9007199254740992, t = Math.random() * e & 2097151 ? function() {
156
+ return j(Math.random() * e);
157
+ } : function() {
158
+ return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
159
+ };
160
+ return function(n) {
161
+ var u, i, s, f, r, o = 0, a = [], l = new v(_);
162
+ if (n == null ? n = m : x(n, 0, $), f = O(n / w), ie)
163
+ if (crypto.getRandomValues) {
164
+ for (u = crypto.getRandomValues(new Uint32Array(f *= 2)); o < f; )
165
+ r = u[o] * 131072 + (u[o + 1] >>> 11), r >= 9e15 ? (i = crypto.getRandomValues(new Uint32Array(2)), u[o] = i[0], u[o + 1] = i[1]) : (a.push(r % 1e14), o += 2);
166
+ o = f / 2;
167
+ } else if (crypto.randomBytes) {
168
+ for (u = crypto.randomBytes(f *= 7); o < f; )
169
+ r = (u[o] & 31) * 281474976710656 + u[o + 1] * 1099511627776 + u[o + 2] * 4294967296 + u[o + 3] * 16777216 + (u[o + 4] << 16) + (u[o + 5] << 8) + u[o + 6], r >= 9e15 ? crypto.randomBytes(7).copy(u, o) : (a.push(r % 1e14), o += 7);
170
+ o = f / 7;
171
+ } else
172
+ throw ie = !1, Error(C + "crypto unavailable");
173
+ if (!ie)
174
+ for (; o < f; )
175
+ r = t(), r < 9e15 && (a[o++] = r % 1e14);
176
+ for (f = a[--o], n %= w, f && n && (r = A[w - n], a[o] = j(f / r) * r); a[o] === 0; a.pop(), o--) ;
177
+ if (o < 0)
178
+ a = [s = 0];
179
+ else {
180
+ for (s = -1; a[0] === 0; a.splice(0, 1), s -= w) ;
181
+ for (o = 1, r = a[0]; r >= 10; r /= 10, o++) ;
182
+ o < w && (s -= w - o);
183
+ }
184
+ return l.e = s, l.c = a, l;
185
+ };
186
+ }(), v.sum = function() {
187
+ for (var e = 1, t = arguments, n = new v(t[0]); e < t.length; ) n = n.plus(t[e++]);
188
+ return n;
189
+ }, L = /* @__PURE__ */ function() {
190
+ var e = "0123456789";
191
+ function t(n, u, i, s) {
192
+ for (var f, r = [0], o, a = 0, l = n.length; a < l; ) {
193
+ for (o = r.length; o--; r[o] *= u) ;
194
+ for (r[0] += s.indexOf(n.charAt(a++)), f = 0; f < r.length; f++)
195
+ r[f] > i - 1 && (r[f + 1] == null && (r[f + 1] = 0), r[f + 1] += r[f] / i | 0, r[f] %= i);
196
+ }
197
+ return r.reverse();
198
+ }
199
+ return function(n, u, i, s, f) {
200
+ var r, o, a, l, d, E, B, R, Q = n.indexOf("."), te = m, F = p;
201
+ for (Q >= 0 && (l = ge, ge = 0, n = n.replace(".", ""), R = new v(u), E = R.pow(n.length - Q), ge = l, R.c = t(
202
+ V(D(E.c), E.e, "0"),
203
+ 10,
204
+ i,
205
+ e
206
+ ), R.e = R.c.length), B = t(n, u, i, f ? (r = ve, e) : (r = e, ve)), a = l = B.length; B[--l] == 0; B.pop()) ;
207
+ if (!B[0]) return r.charAt(0);
208
+ if (Q < 0 ? --a : (E.c = B, E.e = a, E.s = s, E = k(E, R, te, F, i), B = E.c, d = E.r, a = E.e), o = a + te + 1, Q = B[o], l = i / 2, d = d || o < 0 || B[o + 1] != null, d = F < 4 ? (Q != null || d) && (F == 0 || F == (E.s < 0 ? 3 : 2)) : Q > l || Q == l && (F == 4 || d || F == 6 && B[o - 1] & 1 || F == (E.s < 0 ? 8 : 7)), o < 1 || !B[0])
209
+ n = d ? V(r.charAt(1), -te, r.charAt(0)) : r.charAt(0);
210
+ else {
211
+ if (B.length = o, d)
212
+ for (--i; ++B[--o] > i; )
213
+ B[o] = 0, o || (++a, B = [1].concat(B));
214
+ for (l = B.length; !B[--l]; ) ;
215
+ for (Q = 0, n = ""; Q <= l; n += r.charAt(B[Q++])) ;
216
+ n = V(n, a, r.charAt(0));
217
+ }
218
+ return n;
219
+ };
220
+ }(), k = /* @__PURE__ */ function() {
221
+ function e(u, i, s) {
222
+ var f, r, o, a, l = 0, d = u.length, E = i % P, B = i / P | 0;
223
+ for (u = u.slice(); d--; )
224
+ o = u[d] % P, a = u[d] / P | 0, f = B * o + a * E, r = E * o + f % P * P + l, l = (r / s | 0) + (f / P | 0) + B * a, u[d] = r % s;
225
+ return l && (u = [l].concat(u)), u;
226
+ }
227
+ function t(u, i, s, f) {
228
+ var r, o;
229
+ if (s != f)
230
+ o = s > f ? 1 : -1;
231
+ else
232
+ for (r = o = 0; r < s; r++)
233
+ if (u[r] != i[r]) {
234
+ o = u[r] > i[r] ? 1 : -1;
235
+ break;
236
+ }
237
+ return o;
238
+ }
239
+ function n(u, i, s, f) {
240
+ for (var r = 0; s--; )
241
+ u[s] -= r, r = u[s] < i[s] ? 1 : 0, u[s] = r * f + u[s] - i[s];
242
+ for (; !u[0] && u.length > 1; u.splice(0, 1)) ;
243
+ }
244
+ return function(u, i, s, f, r) {
245
+ var o, a, l, d, E, B, R, Q, te, F, q, re, Ne, Se, Be, ce, _e, ae = u.s == i.s ? 1 : -1, oe = u.c, Z = i.c;
246
+ if (!oe || !oe[0] || !Z || !Z[0])
247
+ return new v(
248
+ // Return NaN if either NaN, or both Infinity or 0.
249
+ !u.s || !i.s || (oe ? Z && oe[0] == Z[0] : !Z) ? NaN : (
250
+ // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
251
+ oe && oe[0] == 0 || !Z ? ae * 0 : ae / 0
252
+ )
253
+ );
254
+ for (Q = new v(ae), te = Q.c = [], a = u.e - i.e, ae = s + a + 1, r || (r = T, a = X(u.e / w) - X(i.e / w), ae = ae / w | 0), l = 0; Z[l] == (oe[l] || 0); l++) ;
255
+ if (Z[l] > (oe[l] || 0) && a--, ae < 0)
256
+ te.push(1), d = !0;
257
+ else {
258
+ for (Se = oe.length, ce = Z.length, l = 0, ae += 2, E = j(r / (Z[0] + 1)), E > 1 && (Z = e(Z, E, r), oe = e(oe, E, r), ce = Z.length, Se = oe.length), Ne = ce, F = oe.slice(0, ce), q = F.length; q < ce; F[q++] = 0) ;
259
+ _e = Z.slice(), _e = [0].concat(_e), Be = Z[0], Z[1] >= r / 2 && Be++;
260
+ do {
261
+ if (E = 0, o = t(Z, F, ce, q), o < 0) {
262
+ if (re = F[0], ce != q && (re = re * r + (F[1] || 0)), E = j(re / Be), E > 1)
263
+ for (E >= r && (E = r - 1), B = e(Z, E, r), R = B.length, q = F.length; t(B, F, R, q) == 1; )
264
+ E--, n(B, ce < R ? _e : Z, R, r), R = B.length, o = 1;
265
+ else
266
+ E == 0 && (o = E = 1), B = Z.slice(), R = B.length;
267
+ if (R < q && (B = [0].concat(B)), n(F, B, q, r), q = F.length, o == -1)
268
+ for (; t(Z, F, ce, q) < 1; )
269
+ E++, n(F, ce < q ? _e : Z, q, r), q = F.length;
270
+ } else o === 0 && (E++, F = [0]);
271
+ te[l++] = E, F[0] ? F[q++] = oe[Ne] || 0 : (F = [oe[Ne]], q = 1);
272
+ } while ((Ne++ < Se || F[0] != null) && ae--);
273
+ d = F[0] != null, te[0] || te.splice(0, 1);
274
+ }
275
+ if (r == T) {
276
+ for (l = 1, ae = te[0]; ae >= 10; ae /= 10, l++) ;
277
+ ue(Q, s + (Q.e = l + a * w - 1) + 1, f, d);
278
+ } else
279
+ Q.e = a, Q.r = +d;
280
+ return Q;
281
+ };
282
+ }();
283
+ function Oe(e, t, n, u) {
284
+ var i, s, f, r, o;
285
+ if (n == null ? n = p : x(n, 0, 8), !e.c) return e.toString();
286
+ if (i = e.c[0], f = e.e, t == null)
287
+ o = D(e.c), o = u == 1 || u == 2 && (f <= h || f >= U) ? b(o, f) : V(o, f, "0");
288
+ else if (e = ue(new v(e), t, n), s = e.e, o = D(e.c), r = o.length, u == 1 || u == 2 && (t <= s || s <= h)) {
289
+ for (; r < t; o += "0", r++) ;
290
+ o = b(o, s);
291
+ } else if (t -= f + (u === 2 && s > f), o = V(o, s, "0"), s + 1 > r) {
292
+ if (--t > 0) for (o += "."; t--; o += "0") ;
293
+ } else if (t += s - r, t > 0)
294
+ for (s + 1 == r && (o += "."); t--; o += "0") ;
295
+ return e.s < 0 && i ? "-" + o : o;
296
+ }
297
+ function $e(e, t) {
298
+ for (var n, u, i = 1, s = new v(e[0]); i < e.length; i++)
299
+ u = new v(e[i]), (!u.s || (n = W(s, u)) === t || n === 0 && s.s === t) && (s = u);
300
+ return s;
301
+ }
302
+ function xe(e, t, n) {
303
+ for (var u = 1, i = t.length; !t[--i]; t.pop()) ;
304
+ for (i = t[0]; i >= 10; i /= 10, u++) ;
305
+ return (n = u + n * w - 1) > H ? e.c = e.e = null : n < M ? e.c = [e.e = 0] : (e.e = n, e.c = t), e;
306
+ }
307
+ g = /* @__PURE__ */ function() {
308
+ var e = /^(-?)0([xbo])(?=\w[\w.]*$)/i, t = /^([^.]+)\.$/, n = /^\.([^.]+)$/, u = /^-?(Infinity|NaN)$/, i = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
309
+ return function(s, f, r, o) {
310
+ var a, l = r ? f : f.replace(i, "");
311
+ if (u.test(l))
312
+ s.s = isNaN(l) ? null : l < 0 ? -1 : 1;
313
+ else {
314
+ if (!r && (l = l.replace(e, function(d, E, B) {
315
+ return a = (B = B.toLowerCase()) == "x" ? 16 : B == "b" ? 2 : 8, !o || o == a ? E : d;
316
+ }), o && (a = o, l = l.replace(t, "$1").replace(n, "0.$1")), f != l))
317
+ return new v(l, a);
318
+ if (v.DEBUG)
319
+ throw Error(C + "Not a" + (o ? " base " + o : "") + " number: " + f);
320
+ s.s = null;
321
+ }
322
+ s.c = s.e = null;
323
+ };
324
+ }();
325
+ function ue(e, t, n, u) {
326
+ var i, s, f, r, o, a, l, d = e.c, E = A;
327
+ if (d) {
328
+ e: {
329
+ for (i = 1, r = d[0]; r >= 10; r /= 10, i++) ;
330
+ if (s = t - i, s < 0)
331
+ s += w, f = t, o = d[a = 0], l = j(o / E[i - f - 1] % 10);
332
+ else if (a = O((s + 1) / w), a >= d.length)
333
+ if (u) {
334
+ for (; d.length <= a; d.push(0)) ;
335
+ o = l = 0, i = 1, s %= w, f = s - w + 1;
336
+ } else
337
+ break e;
338
+ else {
339
+ for (o = r = d[a], i = 1; r >= 10; r /= 10, i++) ;
340
+ s %= w, f = s - w + i, l = f < 0 ? 0 : j(o / E[i - f - 1] % 10);
341
+ }
342
+ if (u = u || t < 0 || // Are there any non-zero digits after the rounding digit?
343
+ // The expression n % pows10[d - j - 1] returns all digits of n to the right
344
+ // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
345
+ d[a + 1] != null || (f < 0 ? o : o % E[i - f - 1]), u = n < 4 ? (l || u) && (n == 0 || n == (e.s < 0 ? 3 : 2)) : l > 5 || l == 5 && (n == 4 || u || n == 6 && // Check whether the digit to the left of the rounding digit is odd.
346
+ (s > 0 ? f > 0 ? o / E[i - f] : 0 : d[a - 1]) % 10 & 1 || n == (e.s < 0 ? 8 : 7)), t < 1 || !d[0])
347
+ return d.length = 0, u ? (t -= e.e + 1, d[0] = E[(w - t % w) % w], e.e = -t || 0) : d[0] = e.e = 0, e;
348
+ if (s == 0 ? (d.length = a, r = 1, a--) : (d.length = a + 1, r = E[w - s], d[a] = f > 0 ? j(o / E[i - f] % E[f]) * r : 0), u)
349
+ for (; ; )
350
+ if (a == 0) {
351
+ for (s = 1, f = d[0]; f >= 10; f /= 10, s++) ;
352
+ for (f = d[0] += r, r = 1; f >= 10; f /= 10, r++) ;
353
+ s != r && (e.e++, d[0] == T && (d[0] = 1));
354
+ break;
355
+ } else {
356
+ if (d[a] += r, d[a] != T) break;
357
+ d[a--] = 0, r = 1;
358
+ }
359
+ for (s = d.length; d[--s] === 0; d.pop()) ;
360
+ }
361
+ e.e > H ? e.c = e.e = null : e.e < M && (e.c = [e.e = 0]);
362
+ }
363
+ return e;
364
+ }
365
+ function de(e) {
366
+ var t, n = e.e;
367
+ return n === null ? e.toString() : (t = D(e.c), t = n <= h || n >= U ? b(t, n) : V(t, n, "0"), e.s < 0 ? "-" + t : t);
368
+ }
369
+ return c.absoluteValue = c.abs = function() {
370
+ var e = new v(this);
371
+ return e.s < 0 && (e.s = 1), e;
372
+ }, c.comparedTo = function(e, t) {
373
+ return W(this, new v(e, t));
374
+ }, c.decimalPlaces = c.dp = function(e, t) {
375
+ var n, u, i, s = this;
376
+ if (e != null)
377
+ return x(e, 0, $), t == null ? t = p : x(t, 0, 8), ue(new v(s), e + s.e + 1, t);
378
+ if (!(n = s.c)) return null;
379
+ if (u = ((i = n.length - 1) - X(this.e / w)) * w, i = n[i]) for (; i % 10 == 0; i /= 10, u--) ;
380
+ return u < 0 && (u = 0), u;
381
+ }, c.dividedBy = c.div = function(e, t) {
382
+ return k(this, new v(e, t), m, p);
383
+ }, c.dividedToIntegerBy = c.idiv = function(e, t) {
384
+ return k(this, new v(e, t), 0, 1);
385
+ }, c.exponentiatedBy = c.pow = function(e, t) {
386
+ var n, u, i, s, f, r, o, a, l, d = this;
387
+ if (e = new v(e), e.c && !e.isInteger())
388
+ throw Error(C + "Exponent not an integer: " + de(e));
389
+ if (t != null && (t = new v(t)), r = e.e > 14, !d.c || !d.c[0] || d.c[0] == 1 && !d.e && d.c.length == 1 || !e.c || !e.c[0])
390
+ return l = new v(Math.pow(+de(d), r ? e.s * (2 - I(e)) : +de(e))), t ? l.mod(t) : l;
391
+ if (o = e.s < 0, t) {
392
+ if (t.c ? !t.c[0] : !t.s) return new v(NaN);
393
+ u = !o && d.isInteger() && t.isInteger(), u && (d = d.mod(t));
394
+ } else {
395
+ if (e.e > 9 && (d.e > 0 || d.e < -1 || (d.e == 0 ? d.c[0] > 1 || r && d.c[1] >= 24e7 : d.c[0] < 8e13 || r && d.c[0] <= 9999975e7)))
396
+ return s = d.s < 0 && I(e) ? -0 : 0, d.e > -1 && (s = 1 / s), new v(o ? 1 / s : s);
397
+ ge && (s = O(ge / w + 2));
398
+ }
399
+ for (r ? (n = new v(0.5), o && (e.s = 1), a = I(e)) : (i = Math.abs(+de(e)), a = i % 2), l = new v(_); ; ) {
400
+ if (a) {
401
+ if (l = l.times(d), !l.c) break;
402
+ s ? l.c.length > s && (l.c.length = s) : u && (l = l.mod(t));
403
+ }
404
+ if (i) {
405
+ if (i = j(i / 2), i === 0) break;
406
+ a = i % 2;
407
+ } else if (e = e.times(n), ue(e, e.e + 1, 1), e.e > 14)
408
+ a = I(e);
409
+ else {
410
+ if (i = +de(e), i === 0) break;
411
+ a = i % 2;
412
+ }
413
+ d = d.times(d), s ? d.c && d.c.length > s && (d.c.length = s) : u && (d = d.mod(t));
414
+ }
415
+ return u ? l : (o && (l = _.div(l)), t ? l.mod(t) : s ? ue(l, ge, p, f) : l);
416
+ }, c.integerValue = function(e) {
417
+ var t = new v(this);
418
+ return e == null ? e = p : x(e, 0, 8), ue(t, t.e + 1, e);
419
+ }, c.isEqualTo = c.eq = function(e, t) {
420
+ return W(this, new v(e, t)) === 0;
421
+ }, c.isFinite = function() {
422
+ return !!this.c;
423
+ }, c.isGreaterThan = c.gt = function(e, t) {
424
+ return W(this, new v(e, t)) > 0;
425
+ }, c.isGreaterThanOrEqualTo = c.gte = function(e, t) {
426
+ return (t = W(this, new v(e, t))) === 1 || t === 0;
427
+ }, c.isInteger = function() {
428
+ return !!this.c && X(this.e / w) > this.c.length - 2;
429
+ }, c.isLessThan = c.lt = function(e, t) {
430
+ return W(this, new v(e, t)) < 0;
431
+ }, c.isLessThanOrEqualTo = c.lte = function(e, t) {
432
+ return (t = W(this, new v(e, t))) === -1 || t === 0;
433
+ }, c.isNaN = function() {
434
+ return !this.s;
435
+ }, c.isNegative = function() {
436
+ return this.s < 0;
437
+ }, c.isPositive = function() {
438
+ return this.s > 0;
439
+ }, c.isZero = function() {
440
+ return !!this.c && this.c[0] == 0;
441
+ }, c.minus = function(e, t) {
442
+ var n, u, i, s, f = this, r = f.s;
443
+ if (e = new v(e, t), t = e.s, !r || !t) return new v(NaN);
444
+ if (r != t)
445
+ return e.s = -t, f.plus(e);
446
+ var o = f.e / w, a = e.e / w, l = f.c, d = e.c;
447
+ if (!o || !a) {
448
+ if (!l || !d) return l ? (e.s = -t, e) : new v(d ? f : NaN);
449
+ if (!l[0] || !d[0])
450
+ return d[0] ? (e.s = -t, e) : new v(l[0] ? f : (
451
+ // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
452
+ p == 3 ? -0 : 0
453
+ ));
454
+ }
455
+ if (o = X(o), a = X(a), l = l.slice(), r = o - a) {
456
+ for ((s = r < 0) ? (r = -r, i = l) : (a = o, i = d), i.reverse(), t = r; t--; i.push(0)) ;
457
+ i.reverse();
458
+ } else
459
+ for (u = (s = (r = l.length) < (t = d.length)) ? r : t, r = t = 0; t < u; t++)
460
+ if (l[t] != d[t]) {
461
+ s = l[t] < d[t];
462
+ break;
463
+ }
464
+ if (s && (i = l, l = d, d = i, e.s = -e.s), t = (u = d.length) - (n = l.length), t > 0) for (; t--; l[n++] = 0) ;
465
+ for (t = T - 1; u > r; ) {
466
+ if (l[--u] < d[u]) {
467
+ for (n = u; n && !l[--n]; l[n] = t) ;
468
+ --l[n], l[u] += T;
469
+ }
470
+ l[u] -= d[u];
471
+ }
472
+ for (; l[0] == 0; l.splice(0, 1), --a) ;
473
+ return l[0] ? xe(e, l, a) : (e.s = p == 3 ? -1 : 1, e.c = [e.e = 0], e);
474
+ }, c.modulo = c.mod = function(e, t) {
475
+ var n, u, i = this;
476
+ return e = new v(e, t), !i.c || !e.s || e.c && !e.c[0] ? new v(NaN) : !e.c || i.c && !i.c[0] ? new v(i) : (pe == 9 ? (u = e.s, e.s = 1, n = k(i, e, 0, 3), e.s = u, n.s *= u) : n = k(i, e, 0, pe), e = i.minus(n.times(e)), !e.c[0] && pe == 1 && (e.s = i.s), e);
477
+ }, c.multipliedBy = c.times = function(e, t) {
478
+ var n, u, i, s, f, r, o, a, l, d, E, B, R, Q, te, F = this, q = F.c, re = (e = new v(e, t)).c;
479
+ if (!q || !re || !q[0] || !re[0])
480
+ return !F.s || !e.s || q && !q[0] && !re || re && !re[0] && !q ? e.c = e.e = e.s = null : (e.s *= F.s, !q || !re ? e.c = e.e = null : (e.c = [0], e.e = 0)), e;
481
+ for (u = X(F.e / w) + X(e.e / w), e.s *= F.s, o = q.length, d = re.length, o < d && (R = q, q = re, re = R, i = o, o = d, d = i), i = o + d, R = []; i--; R.push(0)) ;
482
+ for (Q = T, te = P, i = d; --i >= 0; ) {
483
+ for (n = 0, E = re[i] % te, B = re[i] / te | 0, f = o, s = i + f; s > i; )
484
+ a = q[--f] % te, l = q[f] / te | 0, r = B * a + l * E, a = E * a + r % te * te + R[s] + n, n = (a / Q | 0) + (r / te | 0) + B * l, R[s--] = a % Q;
485
+ R[s] = n;
486
+ }
487
+ return n ? ++u : R.splice(0, 1), xe(e, R, u);
488
+ }, c.negated = function() {
489
+ var e = new v(this);
490
+ return e.s = -e.s || null, e;
491
+ }, c.plus = function(e, t) {
492
+ var n, u = this, i = u.s;
493
+ if (e = new v(e, t), t = e.s, !i || !t) return new v(NaN);
494
+ if (i != t)
495
+ return e.s = -t, u.minus(e);
496
+ var s = u.e / w, f = e.e / w, r = u.c, o = e.c;
497
+ if (!s || !f) {
498
+ if (!r || !o) return new v(i / 0);
499
+ if (!r[0] || !o[0]) return o[0] ? e : new v(r[0] ? u : i * 0);
500
+ }
501
+ if (s = X(s), f = X(f), r = r.slice(), i = s - f) {
502
+ for (i > 0 ? (f = s, n = o) : (i = -i, n = r), n.reverse(); i--; n.push(0)) ;
503
+ n.reverse();
504
+ }
505
+ for (i = r.length, t = o.length, i - t < 0 && (n = o, o = r, r = n, t = i), i = 0; t; )
506
+ i = (r[--t] = r[t] + o[t] + i) / T | 0, r[t] = T === r[t] ? 0 : r[t] % T;
507
+ return i && (r = [i].concat(r), ++f), xe(e, r, f);
508
+ }, c.precision = c.sd = function(e, t) {
509
+ var n, u, i, s = this;
510
+ if (e != null && e !== !!e)
511
+ return x(e, 1, $), t == null ? t = p : x(t, 0, 8), ue(new v(s), e, t);
512
+ if (!(n = s.c)) return null;
513
+ if (i = n.length - 1, u = i * w + 1, i = n[i]) {
514
+ for (; i % 10 == 0; i /= 10, u--) ;
515
+ for (i = n[0]; i >= 10; i /= 10, u++) ;
516
+ }
517
+ return e && s.e + 1 > u && (u = s.e + 1), u;
518
+ }, c.shiftedBy = function(e) {
519
+ return x(e, -J, J), this.times("1e" + e);
520
+ }, c.squareRoot = c.sqrt = function() {
521
+ var e, t, n, u, i, s = this, f = s.c, r = s.s, o = s.e, a = m + 4, l = new v("0.5");
522
+ if (r !== 1 || !f || !f[0])
523
+ return new v(!r || r < 0 && (!f || f[0]) ? NaN : f ? s : 1 / 0);
524
+ if (r = Math.sqrt(+de(s)), r == 0 || r == 1 / 0 ? (t = D(f), (t.length + o) % 2 == 0 && (t += "0"), r = Math.sqrt(+t), o = X((o + 1) / 2) - (o < 0 || o % 2), r == 1 / 0 ? t = "5e" + o : (t = r.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + o), n = new v(t)) : n = new v(r + ""), n.c[0]) {
525
+ for (o = n.e, r = o + a, r < 3 && (r = 0); ; )
526
+ if (i = n, n = l.times(i.plus(k(s, i, a, 1))), D(i.c).slice(0, r) === (t = D(n.c)).slice(0, r))
527
+ if (n.e < o && --r, t = t.slice(r - 3, r + 1), t == "9999" || !u && t == "4999") {
528
+ if (!u && (ue(i, i.e + m + 2, 0), i.times(i).eq(s))) {
529
+ n = i;
530
+ break;
531
+ }
532
+ a += 4, r += 4, u = 1;
533
+ } else {
534
+ (!+t || !+t.slice(1) && t.charAt(0) == "5") && (ue(n, n.e + m + 2, 1), e = !n.times(n).eq(s));
535
+ break;
536
+ }
537
+ }
538
+ return ue(n, n.e + m + 1, p, e);
539
+ }, c.toExponential = function(e, t) {
540
+ return e != null && (x(e, 0, $), e++), Oe(this, e, t, 1);
541
+ }, c.toFixed = function(e, t) {
542
+ return e != null && (x(e, 0, $), e = e + this.e + 1), Oe(this, e, t);
543
+ }, c.toFormat = function(e, t, n) {
544
+ var u, i = this;
545
+ if (n == null)
546
+ e != null && t && typeof t == "object" ? (n = t, t = null) : e && typeof e == "object" ? (n = e, e = t = null) : n = ke;
547
+ else if (typeof n != "object")
548
+ throw Error(C + "Argument not an object: " + n);
549
+ if (u = i.toFixed(e, t), i.c) {
550
+ var s, f = u.split("."), r = +n.groupSize, o = +n.secondaryGroupSize, a = n.groupSeparator || "", l = f[0], d = f[1], E = i.s < 0, B = E ? l.slice(1) : l, R = B.length;
551
+ if (o && (s = r, r = o, o = s, R -= s), r > 0 && R > 0) {
552
+ for (s = R % r || r, l = B.substr(0, s); s < R; s += r) l += a + B.substr(s, r);
553
+ o > 0 && (l += a + B.slice(s)), E && (l = "-" + l);
554
+ }
555
+ u = d ? l + (n.decimalSeparator || "") + ((o = +n.fractionGroupSize) ? d.replace(
556
+ new RegExp("\\d{" + o + "}\\B", "g"),
557
+ "$&" + (n.fractionGroupSeparator || "")
558
+ ) : d) : l;
559
+ }
560
+ return (n.prefix || "") + u + (n.suffix || "");
561
+ }, c.toFraction = function(e) {
562
+ var t, n, u, i, s, f, r, o, a, l, d, E, B = this, R = B.c;
563
+ if (e != null && (r = new v(e), !r.isInteger() && (r.c || r.s !== 1) || r.lt(_)))
564
+ throw Error(C + "Argument " + (r.isInteger() ? "out of range: " : "not an integer: ") + de(r));
565
+ if (!R) return new v(B);
566
+ for (t = new v(_), a = n = new v(_), u = o = new v(_), E = D(R), s = t.e = E.length - B.e - 1, t.c[0] = A[(f = s % w) < 0 ? w + f : f], e = !e || r.comparedTo(t) > 0 ? s > 0 ? t : a : r, f = H, H = 1 / 0, r = new v(E), o.c[0] = 0; l = k(r, t, 0, 1), i = n.plus(l.times(u)), i.comparedTo(e) != 1; )
567
+ n = u, u = i, a = o.plus(l.times(i = a)), o = i, t = r.minus(l.times(i = t)), r = i;
568
+ return i = k(e.minus(n), u, 0, 1), o = o.plus(i.times(a)), n = n.plus(i.times(u)), o.s = a.s = B.s, s = s * 2, d = k(a, u, s, p).minus(B).abs().comparedTo(
569
+ k(o, n, s, p).minus(B).abs()
570
+ ) < 1 ? [a, u] : [o, n], H = f, d;
571
+ }, c.toNumber = function() {
572
+ return +de(this);
573
+ }, c.toPrecision = function(e, t) {
574
+ return e != null && x(e, 1, $), Oe(this, e, t, 2);
575
+ }, c.toString = function(e) {
576
+ var t, n = this, u = n.s, i = n.e;
577
+ return i === null ? u ? (t = "Infinity", u < 0 && (t = "-" + t)) : t = "NaN" : (e == null ? t = i <= h || i >= U ? b(D(n.c), i) : V(D(n.c), i, "0") : e === 10 && Ee ? (n = ue(new v(n), m + i + 1, p), t = V(D(n.c), n.e, "0")) : (x(e, 2, ve.length, "Base"), t = L(V(D(n.c), i, "0"), 10, e, u, !0)), u < 0 && n.c[0] && (t = "-" + t)), t;
578
+ }, c.valueOf = c.toJSON = function() {
579
+ return de(this);
580
+ }, c._isBigNumber = !0, S != null && v.set(S), v;
581
+ }
582
+ function X(S) {
583
+ var k = S | 0;
584
+ return S > 0 || S === k ? k : k - 1;
585
+ }
586
+ function D(S) {
587
+ for (var k, L, g = 1, c = S.length, _ = S[0] + ""; g < c; ) {
588
+ for (k = S[g++] + "", L = w - k.length; L--; k = "0" + k) ;
589
+ _ += k;
590
+ }
591
+ for (c = _.length; _.charCodeAt(--c) === 48; ) ;
592
+ return _.slice(0, c + 1 || 1);
593
+ }
594
+ function W(S, k) {
595
+ var L, g, c = S.c, _ = k.c, m = S.s, p = k.s, h = S.e, U = k.e;
596
+ if (!m || !p) return null;
597
+ if (L = c && !c[0], g = _ && !_[0], L || g) return L ? g ? 0 : -p : m;
598
+ if (m != p) return m;
599
+ if (L = m < 0, g = h == U, !c || !_) return g ? 0 : !c ^ L ? 1 : -1;
600
+ if (!g) return h > U ^ L ? 1 : -1;
601
+ for (p = (h = c.length) < (U = _.length) ? h : U, m = 0; m < p; m++) if (c[m] != _[m]) return c[m] > _[m] ^ L ? 1 : -1;
602
+ return h == U ? 0 : h > U ^ L ? 1 : -1;
603
+ }
604
+ function x(S, k, L, g) {
605
+ if (S < k || S > L || S !== j(S))
606
+ throw Error(C + (g || "Argument") + (typeof S == "number" ? S < k || S > L ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(S));
607
+ }
608
+ function I(S) {
609
+ var k = S.c.length - 1;
610
+ return X(S.e / w) == k && S.c[k] % 2 != 0;
611
+ }
612
+ function b(S, k) {
613
+ return (S.length > 1 ? S.charAt(0) + "." + S.slice(1) : S) + (k < 0 ? "e" : "e+") + k;
614
+ }
615
+ function V(S, k, L) {
616
+ var g, c;
617
+ if (k < 0) {
618
+ for (c = L + "."; ++k; c += L) ;
619
+ S = c + S;
620
+ } else if (g = S.length, ++k > g) {
621
+ for (c = L, k -= g; --k; c += L) ;
622
+ S += c;
623
+ } else k < g && (S = S.slice(0, k) + "." + S.slice(k));
624
+ return S;
625
+ }
626
+ N = z(), N.default = N.BigNumber = N, G.exports ? G.exports = N : (ee || (ee = typeof self < "u" && self ? self : window), ee.BigNumber = N);
627
+ })(Ke);
628
+ }(Ae)), Ae.exports;
629
+ }
630
+ var Fe;
631
+ function Qe() {
632
+ return Fe || (Fe = 1, function(G) {
633
+ var ee = Le(), N = G.exports;
634
+ (function() {
635
+ var ne = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, O, j, C = {
636
+ // table of character substitutions
637
+ "\b": "\\b",
638
+ " ": "\\t",
639
+ "\n": "\\n",
640
+ "\f": "\\f",
641
+ "\r": "\\r",
642
+ '"': '\\"',
643
+ "\\": "\\\\"
644
+ }, y;
645
+ function T(J) {
646
+ return ne.lastIndex = 0, ne.test(J) ? '"' + J.replace(ne, function(A) {
647
+ var P = C[A];
648
+ return typeof P == "string" ? P : "\\u" + ("0000" + A.charCodeAt(0).toString(16)).slice(-4);
649
+ }) + '"' : '"' + J + '"';
650
+ }
651
+ function w(J, A) {
652
+ var P, $, z, X, D = O, W, x = A[J], I = x != null && (x instanceof ee || ee.isBigNumber(x));
653
+ switch (x && typeof x == "object" && typeof x.toJSON == "function" && (x = x.toJSON(J)), typeof y == "function" && (x = y.call(A, J, x)), typeof x) {
654
+ case "string":
655
+ return I ? x : T(x);
656
+ case "number":
657
+ return isFinite(x) ? String(x) : "null";
658
+ case "boolean":
659
+ case "null":
660
+ case "bigint":
661
+ return String(x);
662
+ // If the type is 'object', we might be dealing with an object or an array or
663
+ // null.
664
+ case "object":
665
+ if (!x)
666
+ return "null";
667
+ if (O += j, W = [], Object.prototype.toString.apply(x) === "[object Array]") {
668
+ for (X = x.length, P = 0; P < X; P += 1)
669
+ W[P] = w(P, x) || "null";
670
+ return z = W.length === 0 ? "[]" : O ? `[
671
+ ` + O + W.join(`,
672
+ ` + O) + `
673
+ ` + D + "]" : "[" + W.join(",") + "]", O = D, z;
674
+ }
675
+ if (y && typeof y == "object")
676
+ for (X = y.length, P = 0; P < X; P += 1)
677
+ typeof y[P] == "string" && ($ = y[P], z = w($, x), z && W.push(T($) + (O ? ": " : ":") + z));
678
+ else
679
+ Object.keys(x).forEach(function(b) {
680
+ var V = w(b, x);
681
+ V && W.push(T(b) + (O ? ": " : ":") + V);
682
+ });
683
+ return z = W.length === 0 ? "{}" : O ? `{
684
+ ` + O + W.join(`,
685
+ ` + O) + `
686
+ ` + D + "}" : "{" + W.join(",") + "}", O = D, z;
687
+ }
688
+ }
689
+ typeof N.stringify != "function" && (N.stringify = function(J, A, P) {
690
+ var $;
691
+ if (O = "", j = "", typeof P == "number")
692
+ for ($ = 0; $ < P; $ += 1)
693
+ j += " ";
694
+ else typeof P == "string" && (j = P);
695
+ if (y = A, A && typeof A != "function" && (typeof A != "object" || typeof A.length != "number"))
696
+ throw new Error("JSON.stringify");
697
+ return w("", { "": J });
698
+ });
699
+ })();
700
+ }(Ie)), Ie.exports;
701
+ }
702
+ var be, Je;
703
+ function Ze() {
704
+ if (Je) return be;
705
+ Je = 1;
706
+ var G = null;
707
+ const ee = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/, N = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
708
+ var ne = function(O) {
709
+ var j = {
710
+ strict: !1,
711
+ // not being strict means do not generate syntax errors for "duplicate key"
712
+ storeAsString: !1,
713
+ // toggles whether the values should be stored as BigNumber (default) or a string
714
+ alwaysParseAsBig: !1,
715
+ // toggles whether all numbers should be Big
716
+ useNativeBigInt: !1,
717
+ // toggles whether to use native BigInt instead of bignumber.js
718
+ protoAction: "error",
719
+ constructorAction: "error"
720
+ };
721
+ if (O != null) {
722
+ if (O.strict === !0 && (j.strict = !0), O.storeAsString === !0 && (j.storeAsString = !0), j.alwaysParseAsBig = O.alwaysParseAsBig === !0 ? O.alwaysParseAsBig : !1, j.useNativeBigInt = O.useNativeBigInt === !0 ? O.useNativeBigInt : !1, typeof O.constructorAction < "u")
723
+ if (O.constructorAction === "error" || O.constructorAction === "ignore" || O.constructorAction === "preserve")
724
+ j.constructorAction = O.constructorAction;
725
+ else
726
+ throw new Error(
727
+ `Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${O.constructorAction}`
728
+ );
729
+ if (typeof O.protoAction < "u")
730
+ if (O.protoAction === "error" || O.protoAction === "ignore" || O.protoAction === "preserve")
731
+ j.protoAction = O.protoAction;
732
+ else
733
+ throw new Error(
734
+ `Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${O.protoAction}`
735
+ );
736
+ }
737
+ var C, y, T = {
738
+ '"': '"',
739
+ "\\": "\\",
740
+ "/": "/",
741
+ b: "\b",
742
+ f: "\f",
743
+ n: `
744
+ `,
745
+ r: "\r",
746
+ t: " "
747
+ }, w, J = function(I) {
748
+ throw {
749
+ name: "SyntaxError",
750
+ message: I,
751
+ at: C,
752
+ text: w
753
+ };
754
+ }, A = function(I) {
755
+ return I && I !== y && J("Expected '" + I + "' instead of '" + y + "'"), y = w.charAt(C), C += 1, y;
756
+ }, P = function() {
757
+ var I, b = "";
758
+ for (y === "-" && (b = "-", A("-")); y >= "0" && y <= "9"; )
759
+ b += y, A();
760
+ if (y === ".")
761
+ for (b += "."; A() && y >= "0" && y <= "9"; )
762
+ b += y;
763
+ if (y === "e" || y === "E")
764
+ for (b += y, A(), (y === "-" || y === "+") && (b += y, A()); y >= "0" && y <= "9"; )
765
+ b += y, A();
766
+ if (I = +b, !isFinite(I))
767
+ J("Bad number");
768
+ else
769
+ return G == null && (G = Le()), b.length > 15 ? j.storeAsString ? b : j.useNativeBigInt ? BigInt(b) : new G(b) : j.alwaysParseAsBig ? j.useNativeBigInt ? BigInt(I) : new G(I) : I;
770
+ }, $ = function() {
771
+ var I, b, V = "", S;
772
+ if (y === '"')
773
+ for (var k = C; A(); ) {
774
+ if (y === '"')
775
+ return C - 1 > k && (V += w.substring(k, C - 1)), A(), V;
776
+ if (y === "\\") {
777
+ if (C - 1 > k && (V += w.substring(k, C - 1)), A(), y === "u") {
778
+ for (S = 0, b = 0; b < 4 && (I = parseInt(A(), 16), !!isFinite(I)); b += 1)
779
+ S = S * 16 + I;
780
+ V += String.fromCharCode(S);
781
+ } else if (typeof T[y] == "string")
782
+ V += T[y];
783
+ else
784
+ break;
785
+ k = C;
786
+ }
787
+ }
788
+ J("Bad string");
789
+ }, z = function() {
790
+ for (; y && y <= " "; )
791
+ A();
792
+ }, X = function() {
793
+ switch (y) {
794
+ case "t":
795
+ return A("t"), A("r"), A("u"), A("e"), !0;
796
+ case "f":
797
+ return A("f"), A("a"), A("l"), A("s"), A("e"), !1;
798
+ case "n":
799
+ return A("n"), A("u"), A("l"), A("l"), null;
800
+ }
801
+ J("Unexpected '" + y + "'");
802
+ }, D, W = function() {
803
+ var I = [];
804
+ if (y === "[") {
805
+ if (A("["), z(), y === "]")
806
+ return A("]"), I;
807
+ for (; y; ) {
808
+ if (I.push(D()), z(), y === "]")
809
+ return A("]"), I;
810
+ A(","), z();
811
+ }
812
+ }
813
+ J("Bad array");
814
+ }, x = function() {
815
+ var I, b = /* @__PURE__ */ Object.create(null);
816
+ if (y === "{") {
817
+ if (A("{"), z(), y === "}")
818
+ return A("}"), b;
819
+ for (; y; ) {
820
+ if (I = $(), z(), A(":"), j.strict === !0 && Object.hasOwnProperty.call(b, I) && J('Duplicate key "' + I + '"'), ee.test(I) === !0 ? j.protoAction === "error" ? J("Object contains forbidden prototype property") : j.protoAction === "ignore" ? D() : b[I] = D() : N.test(I) === !0 ? j.constructorAction === "error" ? J("Object contains forbidden constructor property") : j.constructorAction === "ignore" ? D() : b[I] = D() : b[I] = D(), z(), y === "}")
821
+ return A("}"), b;
822
+ A(","), z();
823
+ }
824
+ }
825
+ J("Bad object");
826
+ };
827
+ return D = function() {
828
+ switch (z(), y) {
829
+ case "{":
830
+ return x();
831
+ case "[":
832
+ return W();
833
+ case '"':
834
+ return $();
835
+ case "-":
836
+ return P();
837
+ default:
838
+ return y >= "0" && y <= "9" ? P() : X();
839
+ }
840
+ }, function(I, b) {
841
+ var V;
842
+ return w = I + "", C = 0, y = " ", V = D(), z(), y && J("Syntax error"), typeof b == "function" ? function S(k, L) {
843
+ var g, c = k[L];
844
+ return c && typeof c == "object" && Object.keys(c).forEach(function(_) {
845
+ g = S(c, _), g !== void 0 ? c[_] = g : delete c[_];
846
+ }), b.call(k, L, c);
847
+ }({ "": V }, "") : V;
848
+ };
849
+ };
850
+ return be = ne, be;
851
+ }
852
+ var Re;
853
+ function et() {
854
+ if (Re) return we.exports;
855
+ Re = 1;
856
+ var G = Qe().stringify, ee = Ze();
857
+ return we.exports = function(N) {
858
+ return {
859
+ parse: ee(N),
860
+ stringify: G
861
+ };
862
+ }, we.exports.parse = ee(), we.exports.stringify = G, we.exports;
863
+ }
864
+ var tt = et();
865
+ const nt = /* @__PURE__ */ Ye(tt), rt = { class: "json-node" }, it = {
3
866
  key: 0,
4
867
  class: "json-node__container"
5
- }, le = { class: "json-node__line" }, ae = {
868
+ }, ot = { class: "json-node__line" }, st = {
6
869
  key: 2,
7
870
  class: "json-node__colon"
8
- }, re = ["title"], ue = {
871
+ }, lt = ["title"], ut = {
9
872
  key: 3,
10
873
  class: "json-node__collapsed"
11
- }, ie = {
874
+ }, at = {
12
875
  key: 4,
13
876
  class: "json-node__comma"
14
- }, ce = {
877
+ }, ft = {
15
878
  key: 0,
16
879
  class: "json-node__children"
17
- }, de = { class: "json-node__line" }, ve = { class: "json-node__bracket" }, pe = {
880
+ }, ct = { class: "json-node__line" }, pt = { class: "json-node__bracket" }, dt = {
18
881
  key: 0,
19
882
  class: "json-node__comma"
20
- }, fe = {
883
+ }, gt = {
21
884
  key: 1,
22
885
  class: "json-node__primitive"
23
- }, ye = {
886
+ }, ht = {
24
887
  key: 2,
25
888
  class: "json-node__colon"
26
- }, _e = ["title"], me = {
889
+ }, vt = ["title"], yt = {
27
890
  key: 5,
28
891
  class: "json-node__comma"
29
- }, ke = /* @__PURE__ */ G({
892
+ }, mt = /* @__PURE__ */ De({
30
893
  name: "JsonNode",
31
894
  __name: "JsonNode",
32
895
  props: {
@@ -38,196 +901,196 @@ const se = { class: "json-node" }, oe = {
38
901
  isLast: { type: Boolean, default: !1 }
39
902
  },
40
903
  emits: ["update:value", "toggle-expand", "copy", "update:key"],
41
- setup(A, { emit: j }) {
42
- R((e) => ({
43
- "623b775d": e.level
904
+ setup(G, { emit: ee }) {
905
+ Me((p) => ({
906
+ "623b775d": p.level
44
907
  }));
45
- const o = A, b = j, p = C(!1), y = C(!1), c = C(""), d = C(""), f = (e) => {
46
- if (!/^-?\d+(\.\d+)?$/.test(e)) return !1;
47
- const t = Number(e);
48
- return !Number.isSafeInteger(t) || e.length > 15;
49
- }, N = g(() => o.value !== null && typeof o.value == "object"), $ = g(() => Array.isArray(o.value)), h = g(() => o.path ? o.path : o.keyName ? o.keyName : "root"), V = g(() => o.expanded.has(h.value)), O = g(() => o.keyName), I = g(() => $.value ? "[" : "{"), x = g(() => $.value ? "]" : "}"), T = g(() => {
50
- if (!o.value) return "";
51
- const t = Object.keys(o.value).length;
52
- return $.value ? t > 0 ? ` ${t} items ` : " " : t > 0 ? ` ${t} keys ` : " ";
53
- }), L = g(() => {
54
- const e = typeof o.value;
55
- return o.value === null ? "json-node__value--null" : e === "boolean" ? "json-node__value--boolean" : e === "number" ? "json-node__value--number" : e === "string" ? f(o.value) ? "json-node__value--number" : "json-node__value--string" : "";
56
- }), F = g(() => y.value ? d.value : o.value === null ? "null" : typeof o.value == "boolean" || typeof o.value == "number" ? String(o.value) : typeof o.value == "string" ? f(o.value) ? o.value : `"${o.value}"` : String(o.value)), U = g(() => "Click to edit, double-click to copy"), D = (e) => o.level === 0 ? e : h.value ? `${h.value}.${e}` : e, E = (e) => {
57
- const t = Object.keys(o.value);
58
- return t.indexOf(e) === t.length - 1;
59
- }, B = () => {
60
- b("toggle-expand", h.value);
61
- }, P = () => {
62
- o.level !== 0 && (p.value = !0, c.value = o.keyName, W(() => {
63
- const e = document.querySelectorAll(".json-node__key-input"), t = e[e.length - 1];
64
- t && (t.focus(), t.select());
908
+ const N = G, ne = ee, O = ye(!1), j = ye(!1), C = ye(""), y = ye(""), T = (p) => {
909
+ if (!/^-?\d+(\.\d+)?$/.test(p)) return !1;
910
+ const h = Number(p);
911
+ return !Number.isSafeInteger(h) || p.length > 15;
912
+ }, w = fe(() => N.value !== null && typeof N.value == "object"), J = fe(() => Array.isArray(N.value)), A = fe(() => N.path ? N.path : N.keyName ? N.keyName : "root"), P = fe(() => N.expanded.has(A.value)), $ = fe(() => N.keyName), z = fe(() => J.value ? "[" : "{"), X = fe(() => J.value ? "]" : "}"), D = fe(() => {
913
+ if (!N.value) return "";
914
+ const h = Object.keys(N.value).length;
915
+ return J.value ? h > 0 ? ` ${h} items ` : " " : h > 0 ? ` ${h} keys ` : " ";
916
+ }), W = fe(() => {
917
+ const p = typeof N.value;
918
+ return N.value === null ? "json-node__value--null" : p === "boolean" ? "json-node__value--boolean" : p === "number" ? "json-node__value--number" : p === "string" ? T(N.value) ? "json-node__value--number" : "json-node__value--string" : "";
919
+ }), x = fe(() => j.value ? y.value : N.value === null ? "null" : typeof N.value == "boolean" || typeof N.value == "number" ? String(N.value) : typeof N.value == "string" ? T(N.value) ? N.value : `"${N.value}"` : String(N.value)), I = fe(() => "Click to edit, double-click to copy"), b = (p) => N.level === 0 ? p : A.value ? `${A.value}.${p}` : p, V = (p) => {
920
+ const h = Object.keys(N.value);
921
+ return h.indexOf(p) === h.length - 1;
922
+ }, S = () => {
923
+ ne("toggle-expand", A.value);
924
+ }, k = () => {
925
+ N.level !== 0 && (O.value = !0, C.value = N.keyName, Pe(() => {
926
+ const p = document.querySelectorAll(".json-node__key-input"), h = p[p.length - 1];
927
+ h && (h.focus(), h.select());
65
928
  }));
66
- }, q = () => {
67
- N.value || (y.value = !0, typeof o.value == "string" && f(o.value) || typeof o.value == "string" ? d.value = o.value : d.value = String(o.value), W(() => {
68
- const e = document.querySelectorAll(".json-node__value-input"), t = e[e.length - 1];
69
- t && (t.focus(), t.select());
929
+ }, L = () => {
930
+ w.value || (j.value = !0, typeof N.value == "string" && T(N.value) || typeof N.value == "string" ? y.value = N.value : y.value = String(N.value), Pe(() => {
931
+ const p = document.querySelectorAll(".json-node__value-input"), h = p[p.length - 1];
932
+ h && (h.focus(), h.select());
70
933
  }));
71
- }, n = () => {
72
- if (o.level === 0 || !p.value) return;
73
- const e = c.value.trim();
74
- if (!e) {
75
- a();
934
+ }, g = () => {
935
+ if (N.level === 0 || !O.value) return;
936
+ const p = C.value.trim();
937
+ if (!p) {
938
+ _();
76
939
  return;
77
940
  }
78
- if (e === o.keyName) {
79
- p.value = !1;
941
+ if (p === N.keyName) {
942
+ O.value = !1;
80
943
  return;
81
944
  }
82
- p.value = !1, b("update:key", h.value, e);
83
- }, s = () => {
945
+ O.value = !1, ne("update:key", A.value, p);
946
+ }, c = () => {
84
947
  try {
85
- let e;
86
- const t = d.value.trim();
87
- if (t === "null")
88
- e = null;
89
- else if (t === "true" || t === "false")
90
- e = t === "true";
91
- else if (!isNaN(Number(t)) && t !== "") {
92
- const v = Number(t);
93
- !Number.isSafeInteger(v) || t.length > 15 ? e = t : e = v;
948
+ let p;
949
+ const h = y.value.trim();
950
+ if (h === "null")
951
+ p = null;
952
+ else if (h === "true" || h === "false")
953
+ p = h === "true";
954
+ else if (!isNaN(Number(h)) && h !== "") {
955
+ const U = Number(h);
956
+ !Number.isSafeInteger(U) || h.length > 15 ? p = h : p = U;
94
957
  } else
95
- e = d.value;
96
- b("update:value", h.value, e), y.value = !1;
97
- } catch (e) {
98
- console.error("Failed to parse value:", e), y.value = !1;
958
+ p = y.value;
959
+ ne("update:value", A.value, p), j.value = !1;
960
+ } catch (p) {
961
+ console.error("Failed to parse value:", p), j.value = !1;
99
962
  }
100
- }, a = () => {
101
- p.value = !1, c.value = o.keyName;
102
- }, l = () => {
103
- y.value = !1, typeof o.value == "string" && f(o.value) || typeof o.value == "string" ? d.value = o.value : d.value = String(o.value);
963
+ }, _ = () => {
964
+ O.value = !1, C.value = N.keyName;
965
+ }, m = () => {
966
+ j.value = !1, typeof N.value == "string" && T(N.value) || typeof N.value == "string" ? y.value = N.value : y.value = String(N.value);
104
967
  };
105
- return (e, t) => {
106
- const v = X("JsonNode", !0);
107
- return u(), r("div", se, [
108
- N.value ? (u(), r("div", oe, [
109
- k("div", le, [
110
- e.keyName && !p.value ? (u(), r("span", {
968
+ return (p, h) => {
969
+ const U = qe("JsonNode", !0);
970
+ return K(), Y("div", rt, [
971
+ w.value ? (K(), Y("div", it, [
972
+ le("div", ot, [
973
+ p.keyName && !O.value ? (K(), Y("span", {
111
974
  key: 0,
112
975
  class: "json-node__key",
113
- onClick: P,
976
+ onClick: k,
114
977
  title: "Click to edit key"
115
- }, ' "' + S(O.value) + '" ', 1)) : m("", !0),
116
- e.keyName && p.value ? z((u(), r("input", {
978
+ }, ' "' + he($.value) + '" ', 1)) : se("", !0),
979
+ p.keyName && O.value ? je((K(), Y("input", {
117
980
  key: 1,
118
- "onUpdate:modelValue": t[0] || (t[0] = (i) => c.value = i),
981
+ "onUpdate:modelValue": h[0] || (h[0] = (M) => C.value = M),
119
982
  onKeyup: [
120
- w(n, ["enter"]),
121
- w(a, ["escape"])
983
+ me(g, ["enter"]),
984
+ me(_, ["escape"])
122
985
  ],
123
- onBlur: n,
986
+ onBlur: g,
124
987
  class: "json-node__key-input"
125
988
  }, null, 544)), [
126
- [M, c.value]
127
- ]) : m("", !0),
128
- e.keyName ? (u(), r("span", ae, ": ")) : m("", !0),
129
- k("span", {
989
+ [Ce, C.value]
990
+ ]) : se("", !0),
991
+ p.keyName ? (K(), Y("span", st, ": ")) : se("", !0),
992
+ le("span", {
130
993
  class: "json-node__bracket json-node__bracket--clickable",
131
- onClick: B,
132
- title: V.value ? "Click to collapse" : "Click to expand"
133
- }, S(I.value), 9, re),
134
- V.value ? m("", !0) : (u(), r("span", ue, [
135
- Y(S(T.value) + " ", 1),
136
- k("span", {
994
+ onClick: S,
995
+ title: P.value ? "Click to collapse" : "Click to expand"
996
+ }, he(z.value), 9, lt),
997
+ P.value ? se("", !0) : (K(), Y("span", ut, [
998
+ Ge(he(D.value) + " ", 1),
999
+ le("span", {
137
1000
  class: "json-node__bracket json-node__bracket--clickable",
138
- onClick: B
139
- }, S(x.value), 1)
1001
+ onClick: S
1002
+ }, he(X.value), 1)
140
1003
  ])),
141
- !V.value && !e.isLast ? (u(), r("span", ie, ",")) : m("", !0)
1004
+ !P.value && !p.isLast ? (K(), Y("span", at, ",")) : se("", !0)
142
1005
  ]),
143
- V.value ? (u(), r("div", ce, [
144
- (u(!0), r(Z, null, ee(e.value, (i, _) => (u(), r("div", {
145
- key: _,
1006
+ P.value ? (K(), Y("div", ft, [
1007
+ (K(!0), Y(ze, null, He(p.value, (M, H) => (K(), Y("div", {
1008
+ key: H,
146
1009
  class: "json-node__child"
147
1010
  }, [
148
- H(v, {
149
- value: i,
150
- "key-name": $.value ? "" : String(_),
151
- level: e.level + 1,
152
- path: D(String(_)),
153
- expanded: e.expanded,
154
- "onUpdate:value": t[1] || (t[1] = (J, K) => e.$emit("update:value", J, K)),
155
- onToggleExpand: t[2] || (t[2] = (J) => e.$emit("toggle-expand", J)),
156
- onCopy: t[3] || (t[3] = (J) => e.$emit("copy", J)),
157
- "onUpdate:key": t[4] || (t[4] = (J, K) => e.$emit("update:key", J, K)),
158
- "is-last": E(String(_))
1011
+ Ue(U, {
1012
+ value: M,
1013
+ "key-name": J.value ? "" : String(H),
1014
+ level: p.level + 1,
1015
+ path: b(String(H)),
1016
+ expanded: p.expanded,
1017
+ "onUpdate:value": h[1] || (h[1] = (ie, pe) => p.$emit("update:value", ie, pe)),
1018
+ onToggleExpand: h[2] || (h[2] = (ie) => p.$emit("toggle-expand", ie)),
1019
+ onCopy: h[3] || (h[3] = (ie) => p.$emit("copy", ie)),
1020
+ "onUpdate:key": h[4] || (h[4] = (ie, pe) => p.$emit("update:key", ie, pe)),
1021
+ "is-last": V(String(H))
159
1022
  }, null, 8, ["value", "key-name", "level", "path", "expanded", "is-last"])
160
1023
  ]))), 128)),
161
- k("div", de, [
162
- k("span", ve, S(x.value), 1),
163
- e.isLast ? m("", !0) : (u(), r("span", pe, ","))
1024
+ le("div", ct, [
1025
+ le("span", pt, he(X.value), 1),
1026
+ p.isLast ? se("", !0) : (K(), Y("span", dt, ","))
164
1027
  ])
165
- ])) : m("", !0)
166
- ])) : (u(), r("div", fe, [
167
- e.keyName && !p.value ? (u(), r("span", {
1028
+ ])) : se("", !0)
1029
+ ])) : (K(), Y("div", gt, [
1030
+ p.keyName && !O.value ? (K(), Y("span", {
168
1031
  key: 0,
169
1032
  class: "json-node__key",
170
- onClick: P,
1033
+ onClick: k,
171
1034
  title: "Click to edit key"
172
- }, ' "' + S(O.value) + '" ', 1)) : m("", !0),
173
- e.keyName && p.value ? z((u(), r("input", {
1035
+ }, ' "' + he($.value) + '" ', 1)) : se("", !0),
1036
+ p.keyName && O.value ? je((K(), Y("input", {
174
1037
  key: 1,
175
- "onUpdate:modelValue": t[5] || (t[5] = (i) => c.value = i),
1038
+ "onUpdate:modelValue": h[5] || (h[5] = (M) => C.value = M),
176
1039
  onKeyup: [
177
- w(n, ["enter"]),
178
- w(a, ["escape"])
1040
+ me(g, ["enter"]),
1041
+ me(_, ["escape"])
179
1042
  ],
180
- onBlur: n,
1043
+ onBlur: g,
181
1044
  class: "json-node__key-input"
182
1045
  }, null, 544)), [
183
- [M, c.value]
184
- ]) : m("", !0),
185
- e.keyName ? (u(), r("span", ye, ": ")) : m("", !0),
186
- y.value ? m("", !0) : (u(), r("span", {
1046
+ [Ce, C.value]
1047
+ ]) : se("", !0),
1048
+ p.keyName ? (K(), Y("span", ht, ": ")) : se("", !0),
1049
+ j.value ? se("", !0) : (K(), Y("span", {
187
1050
  key: 3,
188
- class: te(["json-node__value", L.value]),
189
- onClick: q,
190
- onDblclick: t[6] || (t[6] = (i) => e.$emit("copy", e.value)),
191
- title: U.value
192
- }, S(F.value), 43, _e)),
193
- y.value ? z((u(), r("input", {
1051
+ class: Xe(["json-node__value", W.value]),
1052
+ onClick: L,
1053
+ onDblclick: h[6] || (h[6] = (M) => p.$emit("copy", p.value)),
1054
+ title: I.value
1055
+ }, he(x.value), 43, vt)),
1056
+ j.value ? je((K(), Y("input", {
194
1057
  key: 4,
195
- "onUpdate:modelValue": t[7] || (t[7] = (i) => d.value = i),
1058
+ "onUpdate:modelValue": h[7] || (h[7] = (M) => y.value = M),
196
1059
  onKeyup: [
197
- w(s, ["enter"]),
198
- w(l, ["escape"])
1060
+ me(c, ["enter"]),
1061
+ me(m, ["escape"])
199
1062
  ],
200
- onBlur: s,
1063
+ onBlur: c,
201
1064
  class: "json-node__value-input"
202
1065
  }, null, 544)), [
203
- [M, d.value]
204
- ]) : m("", !0),
205
- e.isLast ? m("", !0) : (u(), r("span", me, ","))
1066
+ [Ce, y.value]
1067
+ ]) : se("", !0),
1068
+ p.isLast ? se("", !0) : (K(), Y("span", yt, ","))
206
1069
  ]))
207
1070
  ]);
208
1071
  };
209
1072
  }
210
- }), Q = (A, j) => {
211
- const o = A.__vccOpts || A;
212
- for (const [b, p] of j)
213
- o[b] = p;
214
- return o;
215
- }, ge = /* @__PURE__ */ Q(ke, [["__scopeId", "data-v-ac834fbd"]]), Ne = { class: "json-format" }, je = {
1073
+ }), Ve = (G, ee) => {
1074
+ const N = G.__vccOpts || G;
1075
+ for (const [ne, O] of ee)
1076
+ N[ne] = O;
1077
+ return N;
1078
+ }, _t = /* @__PURE__ */ Ve(mt, [["__scopeId", "data-v-ac834fbd"]]), wt = { class: "json-format" }, Nt = {
216
1079
  key: 0,
217
1080
  class: "json-format__toolbar"
218
- }, be = { class: "json-format__actions" }, he = ["disabled"], Ae = ["disabled"], Se = ["disabled"], $e = { class: "json-format__info" }, Je = {
1081
+ }, At = { class: "json-format__actions" }, kt = ["disabled"], Et = ["disabled"], Ot = ["disabled"], xt = { class: "json-format__info" }, St = {
219
1082
  key: 0,
220
1083
  class: "json-format__status json-format__status--success"
221
- }, Ce = {
1084
+ }, Bt = {
222
1085
  key: 1,
223
1086
  class: "json-format__status json-format__status--error"
224
- }, Ve = { class: "json-format__content" }, Ee = {
1087
+ }, jt = { class: "json-format__content" }, Ct = {
225
1088
  key: 0,
226
1089
  class: "json-format__error"
227
- }, we = {
1090
+ }, It = {
228
1091
  key: 1,
229
1092
  class: "json-format__viewer"
230
- }, Oe = require("json-bigint"), xe = /* @__PURE__ */ G({
1093
+ }, bt = /* @__PURE__ */ De({
231
1094
  name: "JsonFormat",
232
1095
  __name: "index",
233
1096
  props: {
@@ -237,216 +1100,216 @@ const se = { class: "json-node" }, oe = {
237
1100
  showToolbar: { type: Boolean, default: !0 }
238
1101
  },
239
1102
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all"],
240
- setup(A, { expose: j, emit: o }) {
241
- const b = Oe({
1103
+ setup(G, { expose: ee, emit: N }) {
1104
+ const ne = nt({
242
1105
  storeAsString: !0,
243
1106
  // 将大数存储为字符串
244
1107
  useNativeBigInt: !1
245
- }), p = A, y = o, c = C(null), d = C(""), f = C(/* @__PURE__ */ new Set()), N = g(() => d.value === ""), $ = (n) => {
246
- if (!n.trim()) {
247
- c.value = null, d.value = "";
1108
+ }), O = G, j = N, C = ye(null), y = ye(""), T = ye(/* @__PURE__ */ new Set()), w = fe(() => y.value === ""), J = (g) => {
1109
+ if (!g.trim()) {
1110
+ C.value = null, y.value = "";
248
1111
  return;
249
1112
  }
250
1113
  try {
251
- c.value = b.parse(n), d.value = "", W(() => {
252
- c.value !== null && f.value.add("root");
1114
+ C.value = ne.parse(g), y.value = "", Pe(() => {
1115
+ C.value !== null && z();
253
1116
  });
254
- } catch (s) {
255
- d.value = s instanceof Error ? s.message : "Unknown parsing error", c.value = null;
1117
+ } catch (c) {
1118
+ y.value = c instanceof Error ? c.message : "Unknown parsing error", C.value = null;
256
1119
  }
257
1120
  };
258
- ne(() => p.modelValue, (n) => {
259
- $(n);
1121
+ We(() => O.modelValue, (g) => {
1122
+ J(g);
260
1123
  }, { immediate: !0 });
261
- const h = (n, s) => {
262
- if (!p.readonly)
1124
+ const A = (g, c) => {
1125
+ if (!O.readonly)
263
1126
  try {
264
- const a = V(c.value, n, s), l = b.stringify(a, null, 2);
265
- y("update:modelValue", l);
266
- } catch (a) {
267
- console.error("Failed to update JSON:", a);
1127
+ const _ = P(C.value, g, c), m = ne.stringify(_, null, 2);
1128
+ j("update:modelValue", m);
1129
+ } catch (_) {
1130
+ console.error("Failed to update JSON:", _);
268
1131
  }
269
- }, V = (n, s, a) => {
270
- if (!s || s === "root") return a;
271
- const l = s.split("."), e = E(n, l.slice(0, -1));
272
- let t = e;
273
- for (let i = 0; i < l.length - 1; i++) {
274
- const _ = l[i];
275
- _ !== "root" && (Array.isArray(t) ? t = t[parseInt(_)] : t = t[_]);
1132
+ }, P = (g, c, _) => {
1133
+ if (!c || c === "root") return _;
1134
+ const m = c.split("."), p = V(g, m.slice(0, -1));
1135
+ let h = p;
1136
+ for (let M = 0; M < m.length - 1; M++) {
1137
+ const H = m[M];
1138
+ H !== "root" && (Array.isArray(h) ? h = h[parseInt(H)] : h = h[H]);
276
1139
  }
277
- const v = l[l.length - 1];
278
- return v === "root" ? a : (Array.isArray(t) ? t[parseInt(v)] = a : t[v] = a, e);
279
- }, O = (n) => {
280
- f.value.has(n) ? f.value.delete(n) : f.value.add(n);
281
- }, I = () => {
282
- const n = /* @__PURE__ */ new Set(), s = (a, l = "") => {
283
- a !== null && typeof a == "object" && (n.add(l || "root"), Array.isArray(a) ? a.forEach((e, t) => {
284
- const v = l ? `${l}.${t}` : `${t}`;
285
- s(e, v);
286
- }) : Object.keys(a).forEach((e) => {
287
- const t = l ? `${l}.${e}` : e;
288
- s(a[e], t);
1140
+ const U = m[m.length - 1];
1141
+ return U === "root" ? _ : (Array.isArray(h) ? h[parseInt(U)] = _ : h[U] = _, p);
1142
+ }, $ = (g) => {
1143
+ T.value.has(g) ? T.value.delete(g) : T.value.add(g);
1144
+ }, z = () => {
1145
+ const g = /* @__PURE__ */ new Set(), c = (_, m = "") => {
1146
+ _ !== null && typeof _ == "object" && (g.add(m || "root"), Array.isArray(_) ? _.forEach((p, h) => {
1147
+ const U = m ? `${m}.${h}` : `${h}`;
1148
+ c(p, U);
1149
+ }) : Object.keys(_).forEach((p) => {
1150
+ const h = m ? `${m}.${p}` : p;
1151
+ c(_[p], h);
289
1152
  }));
290
1153
  };
291
- s(c.value), f.value = n, y("expand-all");
292
- }, x = () => {
293
- f.value = /* @__PURE__ */ new Set(["root"]), y("collapse-all");
294
- }, T = async () => {
295
- if (N.value)
1154
+ c(C.value), T.value = g, j("expand-all");
1155
+ }, X = () => {
1156
+ T.value = /* @__PURE__ */ new Set(["root"]), j("collapse-all");
1157
+ }, D = async () => {
1158
+ if (w.value)
296
1159
  try {
297
- const s = JSON.stringify(c.value, null, 2).replace(/"(\d{16,})"/g, "$1");
298
- await navigator.clipboard.writeText(s), y("copy-success", s);
299
- } catch (n) {
300
- console.error("Failed to copy JSON:", n), y("copy-error", n instanceof Error ? n : new Error("Failed to copy JSON"));
1160
+ const c = JSON.stringify(C.value, null, 2).replace(/"(\d{16,})"/g, "$1");
1161
+ await navigator.clipboard.writeText(c), j("copy-success", c);
1162
+ } catch (g) {
1163
+ console.error("Failed to copy JSON:", g), j("copy-error", g instanceof Error ? g : new Error("Failed to copy JSON"));
301
1164
  }
302
- }, L = (n) => {
303
- if (!/^-?\d+(\.\d+)?$/.test(n)) return !1;
304
- const s = Number(n);
305
- return !Number.isSafeInteger(s) || n.length > 15;
306
- }, F = async (n) => {
1165
+ }, W = (g) => {
1166
+ if (!/^-?\d+(\.\d+)?$/.test(g)) return !1;
1167
+ const c = Number(g);
1168
+ return !Number.isSafeInteger(c) || g.length > 15;
1169
+ }, x = async (g) => {
307
1170
  try {
308
- let s;
309
- typeof n == "string" && L(n) ? s = n : typeof n == "string" ? s = `"${n}"` : s = JSON.stringify(n), await navigator.clipboard.writeText(s);
310
- } catch (s) {
311
- console.error("Failed to copy value:", s);
1171
+ let c;
1172
+ typeof g == "string" && W(g) ? c = g : typeof g == "string" ? c = `"${g}"` : c = JSON.stringify(g), await navigator.clipboard.writeText(c);
1173
+ } catch (c) {
1174
+ console.error("Failed to copy value:", c);
312
1175
  }
313
- }, U = (n, s) => {
314
- if (!p.readonly)
1176
+ }, I = (g, c) => {
1177
+ if (!O.readonly)
315
1178
  try {
316
- const a = D(c.value, n, s), l = b.stringify(a, null, 2);
317
- y("update:modelValue", l), q(n, s);
318
- } catch (a) {
319
- console.error("Failed to rename key:", a);
1179
+ const _ = b(C.value, g, c), m = ne.stringify(_, null, 2);
1180
+ j("update:modelValue", m), L(g, c);
1181
+ } catch (_) {
1182
+ console.error("Failed to rename key:", _);
320
1183
  }
321
- }, D = (n, s, a) => {
322
- if (!s || s === "root") return n;
323
- const l = s.split("."), e = E(n, l.slice(0, -1));
324
- if (l.length === 1) {
325
- const i = l[0];
326
- return e && typeof e == "object" && !Array.isArray(e) ? B(e, i, a) : e;
1184
+ }, b = (g, c, _) => {
1185
+ if (!c || c === "root") return g;
1186
+ const m = c.split("."), p = V(g, m.slice(0, -1));
1187
+ if (m.length === 1) {
1188
+ const M = m[0];
1189
+ return p && typeof p == "object" && !Array.isArray(p) ? S(p, M, _) : p;
327
1190
  }
328
- let t = e;
329
- for (let i = 0; i < l.length - 1; i++) {
330
- const _ = l[i];
331
- Array.isArray(t) ? t = t[parseInt(_)] : t = t[_];
1191
+ let h = p;
1192
+ for (let M = 0; M < m.length - 1; M++) {
1193
+ const H = m[M];
1194
+ Array.isArray(h) ? h = h[parseInt(H)] : h = h[H];
332
1195
  }
333
- const v = l[l.length - 1];
334
- if (!Array.isArray(t) && t && typeof t == "object") {
335
- const i = B(t, v, a), _ = l.slice(0, -1);
336
- _.length > 0 && P(e, _, i);
1196
+ const U = m[m.length - 1];
1197
+ if (!Array.isArray(h) && h && typeof h == "object") {
1198
+ const M = S(h, U, _), H = m.slice(0, -1);
1199
+ H.length > 0 && k(p, H, M);
337
1200
  }
338
- return e;
339
- }, E = (n, s) => {
340
- if (s.length === 0) return n;
341
- if (Array.isArray(n)) {
342
- const a = [...n], l = s[0], e = parseInt(l);
343
- return s.length === 1 || (a[e] = E(n[e], s.slice(1))), a;
344
- } else if (n && typeof n == "object") {
345
- const a = { ...n }, l = s[0];
346
- return s.length === 1 || (a[l] = E(n[l], s.slice(1))), a;
1201
+ return p;
1202
+ }, V = (g, c) => {
1203
+ if (c.length === 0) return g;
1204
+ if (Array.isArray(g)) {
1205
+ const _ = [...g], m = c[0], p = parseInt(m);
1206
+ return c.length === 1 || (_[p] = V(g[p], c.slice(1))), _;
1207
+ } else if (g && typeof g == "object") {
1208
+ const _ = { ...g }, m = c[0];
1209
+ return c.length === 1 || (_[m] = V(g[m], c.slice(1))), _;
347
1210
  }
348
- return n;
349
- }, B = (n, s, a) => {
350
- if (!n || typeof n != "object" || Array.isArray(n))
351
- return n;
352
- const l = Object.keys(n), e = {};
353
- for (const t of l)
354
- t === s ? e[a] = n[t] : e[t] = n[t];
355
- return e;
356
- }, P = (n, s, a) => {
357
- let l = n;
358
- for (let t = 0; t < s.length - 1; t++) {
359
- const v = s[t];
360
- Array.isArray(l) ? l = l[parseInt(v)] : l = l[v];
1211
+ return g;
1212
+ }, S = (g, c, _) => {
1213
+ if (!g || typeof g != "object" || Array.isArray(g))
1214
+ return g;
1215
+ const m = Object.keys(g), p = {};
1216
+ for (const h of m)
1217
+ h === c ? p[_] = g[h] : p[h] = g[h];
1218
+ return p;
1219
+ }, k = (g, c, _) => {
1220
+ let m = g;
1221
+ for (let h = 0; h < c.length - 1; h++) {
1222
+ const U = c[h];
1223
+ Array.isArray(m) ? m = m[parseInt(U)] : m = m[U];
361
1224
  }
362
- const e = s[s.length - 1];
363
- Array.isArray(l) ? l[parseInt(e)] = a : l[e] = a;
364
- }, q = (n, s) => {
365
- const a = /* @__PURE__ */ new Set();
366
- f.value.forEach((l) => {
367
- if (l === n) {
368
- const e = n.split(".");
369
- e[e.length - 1] = s, a.add(e.join("."));
370
- } else if (l.startsWith(n + ".")) {
371
- const e = n.split(".");
372
- e[e.length - 1] = s;
373
- const t = e.join("."), v = l.substring(n.length);
374
- a.add(t + v);
1225
+ const p = c[c.length - 1];
1226
+ Array.isArray(m) ? m[parseInt(p)] = _ : m[p] = _;
1227
+ }, L = (g, c) => {
1228
+ const _ = /* @__PURE__ */ new Set();
1229
+ T.value.forEach((m) => {
1230
+ if (m === g) {
1231
+ const p = g.split(".");
1232
+ p[p.length - 1] = c, _.add(p.join("."));
1233
+ } else if (m.startsWith(g + ".")) {
1234
+ const p = g.split(".");
1235
+ p[p.length - 1] = c;
1236
+ const h = p.join("."), U = m.substring(g.length);
1237
+ _.add(h + U);
375
1238
  } else
376
- a.add(l);
377
- }), f.value = a;
1239
+ _.add(m);
1240
+ }), T.value = _;
378
1241
  };
379
- return j({
1242
+ return ee({
380
1243
  // 核心操作方法
381
- copyJson: T,
382
- expandAll: I,
383
- collapseAll: x,
384
- toggleExpand: O,
385
- updateValue: h,
386
- updateKey: U,
1244
+ copyJson: D,
1245
+ expandAll: z,
1246
+ collapseAll: X,
1247
+ toggleExpand: $,
1248
+ updateValue: A,
1249
+ updateKey: I,
387
1250
  // 状态访问方法
388
- isValidJson: () => N.value,
389
- getParsedJson: () => c.value,
390
- getExpandedNodes: () => f.value,
391
- getParseError: () => d.value,
1251
+ isValidJson: () => w.value,
1252
+ getParsedJson: () => C.value,
1253
+ getExpandedNodes: () => T.value,
1254
+ getParseError: () => y.value,
392
1255
  // 工具方法
393
- parseJson: (n) => $(n),
394
- copyValue: (n) => F(n)
395
- }), (n, s) => (u(), r("div", Ne, [
396
- n.showToolbar ? (u(), r("div", je, [
397
- k("div", be, [
398
- k("button", {
1256
+ parseJson: (g) => J(g),
1257
+ copyValue: (g) => x(g)
1258
+ }), (g, c) => (K(), Y("div", wt, [
1259
+ g.showToolbar ? (K(), Y("div", Nt, [
1260
+ le("div", At, [
1261
+ le("button", {
399
1262
  class: "json-format__btn json-format__btn--primary",
400
- onClick: T,
401
- disabled: !N.value,
1263
+ onClick: D,
1264
+ disabled: !w.value,
402
1265
  title: "Copy JSON"
403
- }, " 📋 Copy ", 8, he),
404
- k("button", {
1266
+ }, " 📋 Copy ", 8, kt),
1267
+ le("button", {
405
1268
  class: "json-format__btn json-format__btn--secondary",
406
- onClick: I,
407
- disabled: !N.value,
1269
+ onClick: z,
1270
+ disabled: !w.value,
408
1271
  title: "Expand All"
409
- }, " ⬇️ Expand All ", 8, Ae),
410
- k("button", {
1272
+ }, " ⬇️ Expand All ", 8, Et),
1273
+ le("button", {
411
1274
  class: "json-format__btn json-format__btn--secondary",
412
- onClick: x,
413
- disabled: !N.value,
1275
+ onClick: X,
1276
+ disabled: !w.value,
414
1277
  title: "Collapse All"
415
- }, " ➡️ Collapse All ", 8, Se)
1278
+ }, " ➡️ Collapse All ", 8, Ot)
416
1279
  ]),
417
- k("div", $e, [
418
- N.value ? (u(), r("span", Je, " ✅ Valid JSON ")) : (u(), r("span", Ce, " ❌ Invalid JSON "))
1280
+ le("div", xt, [
1281
+ w.value ? (K(), Y("span", St, " ✅ Valid JSON ")) : (K(), Y("span", Bt, " ❌ Invalid JSON "))
419
1282
  ])
420
- ])) : m("", !0),
421
- k("div", Ve, [
422
- N.value ? (u(), r("div", we, [
423
- H(ge, {
424
- value: c.value,
1283
+ ])) : se("", !0),
1284
+ le("div", jt, [
1285
+ w.value ? (K(), Y("div", It, [
1286
+ Ue(_t, {
1287
+ value: C.value,
425
1288
  "key-name": "",
426
1289
  level: 0,
427
- expanded: f.value,
1290
+ expanded: T.value,
428
1291
  "is-last": !0,
429
- "onUpdate:value": h,
430
- onToggleExpand: O,
431
- onCopy: F,
432
- "onUpdate:key": U
1292
+ "onUpdate:value": A,
1293
+ onToggleExpand: $,
1294
+ onCopy: x,
1295
+ "onUpdate:key": I
433
1296
  }, null, 8, ["value", "expanded"])
434
- ])) : (u(), r("div", Ee, [
435
- s[0] || (s[0] = k("h4", null, "JSON Parse Error:", -1)),
436
- k("pre", null, S(d.value), 1)
1297
+ ])) : (K(), Y("div", Ct, [
1298
+ c[0] || (c[0] = le("h4", null, "JSON Parse Error:", -1)),
1299
+ le("pre", null, he(y.value), 1)
437
1300
  ]))
438
1301
  ])
439
1302
  ]));
440
1303
  }
441
- }), Be = /* @__PURE__ */ Q(xe, [["__scopeId", "data-v-c044be43"]]), Ie = [Be], Te = (A) => {
442
- Ie.forEach((j) => {
443
- const o = j.name || j.__name || "UnknownComponent";
444
- A.component(o, j);
1304
+ }), Pt = /* @__PURE__ */ Ve(bt, [["__scopeId", "data-v-ad2f6a66"]]), $t = [Pt], Tt = (G) => {
1305
+ $t.forEach((ee) => {
1306
+ const N = ee.name || ee.__name || "UnknownComponent";
1307
+ G.component(N, ee);
445
1308
  });
446
- }, Ue = {
447
- install: Te
1309
+ }, Jt = {
1310
+ install: Tt
448
1311
  };
449
1312
  export {
450
- Be as JsonFormat,
451
- Ue as default
1313
+ Pt as JsonFormat,
1314
+ Jt as default
452
1315
  };