@motiadev/plugin-states 0.9.4-beta.150 → 0.9.4-beta.151-852305
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.
- package/dist/components/state-editor.d.ts.map +1 -1
- package/dist/components/states-page.d.ts.map +1 -1
- package/dist/index.cjs +4 -80
- package/dist/index.js +867 -944
- package/dist/plugin-states.css +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,310 +1,278 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { useThemeStore as
|
|
4
|
-
var he = { exports: {} },
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/
|
|
14
|
-
var Xe;
|
|
15
|
-
function tr() {
|
|
16
|
-
if (Xe) return se;
|
|
17
|
-
Xe = 1;
|
|
1
|
+
import * as $ from "react";
|
|
2
|
+
import B, { forwardRef as _t, createElement as Ne, useState as P, useCallback as W, useEffect as Y, createContext as Jt, useContext as te, isValidElement as Yt, useRef as V, useMemo as ue, memo as He } from "react";
|
|
3
|
+
import { useThemeStore as qt, Button as ye, Sidebar as Bt, Input as Wt, Table as Kt, TableHeader as Gt, TableRow as We, TableHead as pe, Checkbox as Ke, TableBody as Xt, cn as Qt, TableCell as ge } from "@motiadev/ui";
|
|
4
|
+
var he = { exports: {} }, oe = {};
|
|
5
|
+
var Ge;
|
|
6
|
+
function er() {
|
|
7
|
+
if (Ge) return oe;
|
|
8
|
+
Ge = 1;
|
|
18
9
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
19
|
-
function r(n,
|
|
10
|
+
function r(n, o, i) {
|
|
20
11
|
var c = null;
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
for (var l in
|
|
24
|
-
l !== "key" && (
|
|
25
|
-
} else
|
|
26
|
-
return
|
|
12
|
+
if (i !== void 0 && (c = "" + i), o.key !== void 0 && (c = "" + o.key), "key" in o) {
|
|
13
|
+
i = {};
|
|
14
|
+
for (var l in o)
|
|
15
|
+
l !== "key" && (i[l] = o[l]);
|
|
16
|
+
} else i = o;
|
|
17
|
+
return o = i.ref, {
|
|
27
18
|
$$typeof: e,
|
|
28
19
|
type: n,
|
|
29
20
|
key: c,
|
|
30
|
-
ref:
|
|
31
|
-
props:
|
|
21
|
+
ref: o !== void 0 ? o : null,
|
|
22
|
+
props: i
|
|
32
23
|
};
|
|
33
24
|
}
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
function rr() {
|
|
48
|
-
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
49
|
-
function e(i) {
|
|
50
|
-
if (i == null) return null;
|
|
51
|
-
if (typeof i == "function")
|
|
52
|
-
return i.$$typeof === C ? null : i.displayName || i.name || null;
|
|
53
|
-
if (typeof i == "string") return i;
|
|
54
|
-
switch (i) {
|
|
55
|
-
case A:
|
|
25
|
+
return oe.Fragment = t, oe.jsx = r, oe.jsxs = r, oe;
|
|
26
|
+
}
|
|
27
|
+
var se = {};
|
|
28
|
+
var Xe;
|
|
29
|
+
function tr() {
|
|
30
|
+
return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
31
|
+
function e(s) {
|
|
32
|
+
if (s == null) return null;
|
|
33
|
+
if (typeof s == "function")
|
|
34
|
+
return s.$$typeof === L ? null : s.displayName || s.name || null;
|
|
35
|
+
if (typeof s == "string") return s;
|
|
36
|
+
switch (s) {
|
|
37
|
+
case f:
|
|
56
38
|
return "Fragment";
|
|
57
|
-
case
|
|
39
|
+
case k:
|
|
58
40
|
return "Profiler";
|
|
59
|
-
case
|
|
41
|
+
case A:
|
|
60
42
|
return "StrictMode";
|
|
61
|
-
case
|
|
43
|
+
case x:
|
|
62
44
|
return "Suspense";
|
|
63
|
-
case
|
|
45
|
+
case y:
|
|
64
46
|
return "SuspenseList";
|
|
65
|
-
case
|
|
47
|
+
case S:
|
|
66
48
|
return "Activity";
|
|
67
49
|
}
|
|
68
|
-
if (typeof
|
|
69
|
-
switch (typeof
|
|
50
|
+
if (typeof s == "object")
|
|
51
|
+
switch (typeof s.tag == "number" && console.error(
|
|
70
52
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
71
|
-
),
|
|
72
|
-
case
|
|
53
|
+
), s.$$typeof) {
|
|
54
|
+
case _:
|
|
73
55
|
return "Portal";
|
|
74
|
-
case
|
|
75
|
-
return
|
|
76
|
-
case
|
|
77
|
-
return (
|
|
78
|
-
case
|
|
79
|
-
var
|
|
80
|
-
return
|
|
81
|
-
case
|
|
82
|
-
return
|
|
83
|
-
case
|
|
84
|
-
|
|
56
|
+
case w:
|
|
57
|
+
return s.displayName || "Context";
|
|
58
|
+
case R:
|
|
59
|
+
return (s._context.displayName || "Context") + ".Consumer";
|
|
60
|
+
case m:
|
|
61
|
+
var h = s.render;
|
|
62
|
+
return s = s.displayName, s || (s = h.displayName || h.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
63
|
+
case F:
|
|
64
|
+
return h = s.displayName || null, h !== null ? h : e(s.type) || "Memo";
|
|
65
|
+
case N:
|
|
66
|
+
h = s._payload, s = s._init;
|
|
85
67
|
try {
|
|
86
|
-
return e(
|
|
68
|
+
return e(s(h));
|
|
87
69
|
} catch {
|
|
88
70
|
}
|
|
89
71
|
}
|
|
90
72
|
return null;
|
|
91
73
|
}
|
|
92
|
-
function t(
|
|
93
|
-
return "" +
|
|
74
|
+
function t(s) {
|
|
75
|
+
return "" + s;
|
|
94
76
|
}
|
|
95
|
-
function r(
|
|
77
|
+
function r(s) {
|
|
96
78
|
try {
|
|
97
|
-
t(
|
|
98
|
-
var
|
|
79
|
+
t(s);
|
|
80
|
+
var h = !1;
|
|
99
81
|
} catch {
|
|
100
|
-
|
|
82
|
+
h = !0;
|
|
101
83
|
}
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
var
|
|
105
|
-
return
|
|
106
|
-
|
|
84
|
+
if (h) {
|
|
85
|
+
h = console;
|
|
86
|
+
var p = h.error, j = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
87
|
+
return p.call(
|
|
88
|
+
h,
|
|
107
89
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
108
|
-
|
|
109
|
-
), t(
|
|
90
|
+
j
|
|
91
|
+
), t(s);
|
|
110
92
|
}
|
|
111
93
|
}
|
|
112
|
-
function n(
|
|
113
|
-
if (
|
|
114
|
-
if (typeof
|
|
94
|
+
function n(s) {
|
|
95
|
+
if (s === f) return "<>";
|
|
96
|
+
if (typeof s == "object" && s !== null && s.$$typeof === N)
|
|
115
97
|
return "<...>";
|
|
116
98
|
try {
|
|
117
|
-
var
|
|
118
|
-
return
|
|
99
|
+
var h = e(s);
|
|
100
|
+
return h ? "<" + h + ">" : "<...>";
|
|
119
101
|
} catch {
|
|
120
102
|
return "<...>";
|
|
121
103
|
}
|
|
122
104
|
}
|
|
123
|
-
function s() {
|
|
124
|
-
var i = $.A;
|
|
125
|
-
return i === null ? null : i.getOwner();
|
|
126
|
-
}
|
|
127
105
|
function o() {
|
|
106
|
+
var s = D.A;
|
|
107
|
+
return s === null ? null : s.getOwner();
|
|
108
|
+
}
|
|
109
|
+
function i() {
|
|
128
110
|
return Error("react-stack-top-frame");
|
|
129
111
|
}
|
|
130
|
-
function c(
|
|
131
|
-
if (
|
|
132
|
-
var
|
|
133
|
-
if (
|
|
112
|
+
function c(s) {
|
|
113
|
+
if (H.call(s, "key")) {
|
|
114
|
+
var h = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
115
|
+
if (h && h.isReactWarning) return !1;
|
|
134
116
|
}
|
|
135
|
-
return
|
|
117
|
+
return s.key !== void 0;
|
|
136
118
|
}
|
|
137
|
-
function l(
|
|
138
|
-
function
|
|
139
|
-
|
|
119
|
+
function l(s, h) {
|
|
120
|
+
function p() {
|
|
121
|
+
T || (T = !0, console.error(
|
|
140
122
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
141
|
-
|
|
123
|
+
h
|
|
142
124
|
));
|
|
143
125
|
}
|
|
144
|
-
|
|
145
|
-
get:
|
|
126
|
+
p.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
127
|
+
get: p,
|
|
146
128
|
configurable: !0
|
|
147
129
|
});
|
|
148
130
|
}
|
|
149
131
|
function g() {
|
|
150
|
-
var
|
|
151
|
-
return
|
|
132
|
+
var s = e(this.type);
|
|
133
|
+
return M[s] || (M[s] = !0, console.error(
|
|
152
134
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
153
|
-
)),
|
|
135
|
+
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
154
136
|
}
|
|
155
|
-
function u(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
137
|
+
function u(s, h, p, j, K, Se) {
|
|
138
|
+
var U = p.ref;
|
|
139
|
+
return s = {
|
|
140
|
+
$$typeof: C,
|
|
141
|
+
type: s,
|
|
142
|
+
key: h,
|
|
143
|
+
props: p,
|
|
144
|
+
_owner: j
|
|
145
|
+
}, (U !== void 0 ? U : null) !== null ? Object.defineProperty(s, "ref", {
|
|
163
146
|
enumerable: !1,
|
|
164
147
|
get: g
|
|
165
|
-
}) : Object.defineProperty(
|
|
148
|
+
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
166
149
|
configurable: !1,
|
|
167
150
|
enumerable: !1,
|
|
168
151
|
writable: !0,
|
|
169
152
|
value: 0
|
|
170
|
-
}), Object.defineProperty(
|
|
153
|
+
}), Object.defineProperty(s, "_debugInfo", {
|
|
171
154
|
configurable: !1,
|
|
172
155
|
enumerable: !1,
|
|
173
156
|
writable: !0,
|
|
174
157
|
value: null
|
|
175
|
-
}), Object.defineProperty(
|
|
158
|
+
}), Object.defineProperty(s, "_debugStack", {
|
|
176
159
|
configurable: !1,
|
|
177
160
|
enumerable: !1,
|
|
178
161
|
writable: !0,
|
|
179
|
-
value:
|
|
180
|
-
}), Object.defineProperty(
|
|
162
|
+
value: K
|
|
163
|
+
}), Object.defineProperty(s, "_debugTask", {
|
|
181
164
|
configurable: !1,
|
|
182
165
|
enumerable: !1,
|
|
183
166
|
writable: !0,
|
|
184
|
-
value:
|
|
185
|
-
}), Object.freeze && (Object.freeze(
|
|
167
|
+
value: Se
|
|
168
|
+
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
186
169
|
}
|
|
187
|
-
function d(
|
|
188
|
-
var
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
if (U
|
|
192
|
-
for (
|
|
193
|
-
v(
|
|
194
|
-
Object.freeze && Object.freeze(
|
|
170
|
+
function d(s, h, p, j, K, Se) {
|
|
171
|
+
var U = h.children;
|
|
172
|
+
if (U !== void 0)
|
|
173
|
+
if (j)
|
|
174
|
+
if (z(U)) {
|
|
175
|
+
for (j = 0; j < U.length; j++)
|
|
176
|
+
v(U[j]);
|
|
177
|
+
Object.freeze && Object.freeze(U);
|
|
195
178
|
} else
|
|
196
179
|
console.error(
|
|
197
180
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
181
|
);
|
|
199
|
-
else v(
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
var re = Object.keys(
|
|
203
|
-
return
|
|
182
|
+
else v(U);
|
|
183
|
+
if (H.call(h, "key")) {
|
|
184
|
+
U = e(s);
|
|
185
|
+
var re = Object.keys(h).filter(function(Zt) {
|
|
186
|
+
return Zt !== "key";
|
|
204
187
|
});
|
|
205
|
-
|
|
188
|
+
j = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", I[U + j] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
189
|
`A props object containing a "key" prop is being spread into JSX:
|
|
207
190
|
let props = %s;
|
|
208
191
|
<%s {...props} />
|
|
209
192
|
React keys must be passed directly to JSX without using spread:
|
|
210
193
|
let props = %s;
|
|
211
194
|
<%s key={someKey} {...props} />`,
|
|
212
|
-
|
|
213
|
-
|
|
195
|
+
j,
|
|
196
|
+
U,
|
|
214
197
|
re,
|
|
215
|
-
|
|
216
|
-
),
|
|
198
|
+
U
|
|
199
|
+
), I[U + j] = !0);
|
|
217
200
|
}
|
|
218
|
-
if (
|
|
219
|
-
|
|
220
|
-
for (var Ee in
|
|
221
|
-
Ee !== "key" && (
|
|
222
|
-
} else
|
|
223
|
-
return
|
|
224
|
-
|
|
225
|
-
typeof
|
|
201
|
+
if (U = null, p !== void 0 && (r(p), U = "" + p), c(h) && (r(h.key), U = "" + h.key), "key" in h) {
|
|
202
|
+
p = {};
|
|
203
|
+
for (var Ee in h)
|
|
204
|
+
Ee !== "key" && (p[Ee] = h[Ee]);
|
|
205
|
+
} else p = h;
|
|
206
|
+
return U && l(
|
|
207
|
+
p,
|
|
208
|
+
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
226
209
|
), u(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
Se,
|
|
234
|
-
Oe
|
|
210
|
+
s,
|
|
211
|
+
U,
|
|
212
|
+
p,
|
|
213
|
+
o(),
|
|
214
|
+
K,
|
|
215
|
+
Se
|
|
235
216
|
);
|
|
236
217
|
}
|
|
237
|
-
function v(
|
|
238
|
-
typeof
|
|
218
|
+
function v(s) {
|
|
219
|
+
E(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === N && (s._payload.status === "fulfilled" ? E(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
|
|
220
|
+
}
|
|
221
|
+
function E(s) {
|
|
222
|
+
return typeof s == "object" && s !== null && s.$$typeof === C;
|
|
239
223
|
}
|
|
240
|
-
var
|
|
224
|
+
var O = B, C = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), A = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), w = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), N = Symbol.for("react.lazy"), S = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), D = O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, z = Array.isArray, b = console.createTask ? console.createTask : function() {
|
|
241
225
|
return null;
|
|
242
226
|
};
|
|
243
|
-
|
|
244
|
-
react_stack_bottom_frame: function(
|
|
245
|
-
return
|
|
227
|
+
O = {
|
|
228
|
+
react_stack_bottom_frame: function(s) {
|
|
229
|
+
return s();
|
|
246
230
|
}
|
|
247
231
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var
|
|
232
|
+
var T, M = {}, Z = O.react_stack_bottom_frame.bind(
|
|
233
|
+
O,
|
|
234
|
+
i
|
|
235
|
+
)(), J = b(n(i)), I = {};
|
|
236
|
+
se.Fragment = f, se.jsx = function(s, h, p) {
|
|
237
|
+
var j = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
254
238
|
return d(
|
|
255
|
-
|
|
239
|
+
s,
|
|
240
|
+
h,
|
|
256
241
|
p,
|
|
257
|
-
x,
|
|
258
242
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
q ? Error("react-stack-top-frame") : I,
|
|
262
|
-
q ? F(n(i)) : z
|
|
243
|
+
j ? Error("react-stack-top-frame") : Z,
|
|
244
|
+
j ? b(n(s)) : J
|
|
263
245
|
);
|
|
264
|
-
},
|
|
265
|
-
var
|
|
246
|
+
}, se.jsxs = function(s, h, p) {
|
|
247
|
+
var j = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
266
248
|
return d(
|
|
267
|
-
|
|
249
|
+
s,
|
|
250
|
+
h,
|
|
268
251
|
p,
|
|
269
|
-
x,
|
|
270
252
|
!0,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
q ? Error("react-stack-top-frame") : I,
|
|
274
|
-
q ? F(n(i)) : z
|
|
253
|
+
j ? Error("react-stack-top-frame") : Z,
|
|
254
|
+
j ? b(n(s)) : J
|
|
275
255
|
);
|
|
276
256
|
};
|
|
277
|
-
}()),
|
|
278
|
-
}
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
282
|
-
}
|
|
283
|
-
var a =
|
|
284
|
-
|
|
285
|
-
* @license lucide-react v0.545.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/
|
|
290
|
-
const ar = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), sr = (e) => e.replace(
|
|
257
|
+
})()), se;
|
|
258
|
+
}
|
|
259
|
+
var Qe;
|
|
260
|
+
function rr() {
|
|
261
|
+
return Qe || (Qe = 1, process.env.NODE_ENV === "production" ? he.exports = er() : he.exports = tr()), he.exports;
|
|
262
|
+
}
|
|
263
|
+
var a = rr();
|
|
264
|
+
const nr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ar = (e) => e.replace(
|
|
291
265
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
292
266
|
(t, r, n) => n ? n.toUpperCase() : r.toLowerCase()
|
|
293
|
-
),
|
|
294
|
-
const t =
|
|
267
|
+
), et = (e) => {
|
|
268
|
+
const t = ar(e);
|
|
295
269
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
296
|
-
},
|
|
270
|
+
}, Tt = (...e) => e.filter((t, r, n) => !!t && t.trim() !== "" && n.indexOf(t) === r).join(" ").trim(), or = (e) => {
|
|
297
271
|
for (const t in e)
|
|
298
272
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
299
273
|
return !0;
|
|
300
274
|
};
|
|
301
|
-
|
|
302
|
-
* @license lucide-react v0.545.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/
|
|
307
|
-
var ir = {
|
|
275
|
+
var sr = {
|
|
308
276
|
xmlns: "http://www.w3.org/2000/svg",
|
|
309
277
|
width: 24,
|
|
310
278
|
height: 24,
|
|
@@ -315,196 +283,118 @@ var ir = {
|
|
|
315
283
|
strokeLinecap: "round",
|
|
316
284
|
strokeLinejoin: "round"
|
|
317
285
|
};
|
|
318
|
-
|
|
319
|
-
* @license lucide-react v0.545.0 - ISC
|
|
320
|
-
*
|
|
321
|
-
* This source code is licensed under the ISC license.
|
|
322
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
-
*/
|
|
324
|
-
const cr = _t(
|
|
286
|
+
const ir = _t(
|
|
325
287
|
({
|
|
326
288
|
color: e = "currentColor",
|
|
327
289
|
size: t = 24,
|
|
328
290
|
strokeWidth: r = 2,
|
|
329
291
|
absoluteStrokeWidth: n,
|
|
330
|
-
className:
|
|
331
|
-
children:
|
|
292
|
+
className: o = "",
|
|
293
|
+
children: i,
|
|
332
294
|
iconNode: c,
|
|
333
295
|
...l
|
|
334
|
-
}, g) =>
|
|
296
|
+
}, g) => Ne(
|
|
335
297
|
"svg",
|
|
336
298
|
{
|
|
337
299
|
ref: g,
|
|
338
|
-
...
|
|
300
|
+
...sr,
|
|
339
301
|
width: t,
|
|
340
302
|
height: t,
|
|
341
303
|
stroke: e,
|
|
342
304
|
strokeWidth: n ? Number(r) * 24 / Number(t) : r,
|
|
343
|
-
className:
|
|
344
|
-
...!
|
|
305
|
+
className: Tt("lucide", o),
|
|
306
|
+
...!i && !or(l) && { "aria-hidden": "true" },
|
|
345
307
|
...l
|
|
346
308
|
},
|
|
347
309
|
[
|
|
348
|
-
...c.map(([u, d]) =>
|
|
349
|
-
...Array.isArray(
|
|
310
|
+
...c.map(([u, d]) => Ne(u, d)),
|
|
311
|
+
...Array.isArray(i) ? i : [i]
|
|
350
312
|
]
|
|
351
313
|
)
|
|
352
314
|
);
|
|
353
|
-
/**
|
|
354
|
-
* @license lucide-react v0.545.0 - ISC
|
|
355
|
-
*
|
|
356
|
-
* This source code is licensed under the ISC license.
|
|
357
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
-
*/
|
|
359
315
|
const X = (e, t) => {
|
|
360
316
|
const r = _t(
|
|
361
|
-
({ className: n, ...
|
|
362
|
-
ref:
|
|
317
|
+
({ className: n, ...o }, i) => Ne(ir, {
|
|
318
|
+
ref: i,
|
|
363
319
|
iconNode: t,
|
|
364
|
-
className:
|
|
365
|
-
`lucide-${
|
|
320
|
+
className: Tt(
|
|
321
|
+
`lucide-${nr(et(e))}`,
|
|
366
322
|
`lucide-${e}`,
|
|
367
323
|
n
|
|
368
324
|
),
|
|
369
|
-
...
|
|
325
|
+
...o
|
|
370
326
|
})
|
|
371
327
|
);
|
|
372
|
-
return r.displayName =
|
|
328
|
+
return r.displayName = et(e), r;
|
|
373
329
|
};
|
|
374
|
-
|
|
375
|
-
* @license lucide-react v0.545.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/
|
|
380
|
-
const lr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], ur = X("check", lr);
|
|
381
|
-
/**
|
|
382
|
-
* @license lucide-react v0.545.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the ISC license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/
|
|
387
|
-
const dr = [
|
|
388
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
389
|
-
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
390
|
-
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
391
|
-
], rt = X("circle-alert", dr);
|
|
392
|
-
/**
|
|
393
|
-
* @license lucide-react v0.545.0 - ISC
|
|
394
|
-
*
|
|
395
|
-
* This source code is licensed under the ISC license.
|
|
396
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
-
*/
|
|
398
|
-
const fr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], pr = X("loader-circle", fr);
|
|
399
|
-
/**
|
|
400
|
-
* @license lucide-react v0.545.0 - ISC
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the ISC license.
|
|
403
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/
|
|
405
|
-
const gr = [
|
|
330
|
+
const cr = [
|
|
406
331
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
407
332
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
408
333
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
409
334
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
410
|
-
],
|
|
411
|
-
|
|
412
|
-
* @license lucide-react v0.545.0 - ISC
|
|
413
|
-
*
|
|
414
|
-
* This source code is licensed under the ISC license.
|
|
415
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/
|
|
417
|
-
const vr = [
|
|
418
|
-
[
|
|
419
|
-
"path",
|
|
420
|
-
{
|
|
421
|
-
d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
|
|
422
|
-
key: "1c8476"
|
|
423
|
-
}
|
|
424
|
-
],
|
|
425
|
-
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
426
|
-
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
427
|
-
], mr = X("save", vr);
|
|
428
|
-
/**
|
|
429
|
-
* @license lucide-react v0.545.0 - ISC
|
|
430
|
-
*
|
|
431
|
-
* This source code is licensed under the ISC license.
|
|
432
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
-
*/
|
|
434
|
-
const yr = [
|
|
335
|
+
], lr = X("refresh-cw", cr);
|
|
336
|
+
const ur = [
|
|
435
337
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
436
338
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
437
|
-
],
|
|
438
|
-
|
|
439
|
-
* @license lucide-react v0.545.0 - ISC
|
|
440
|
-
*
|
|
441
|
-
* This source code is licensed under the ISC license.
|
|
442
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
-
*/
|
|
444
|
-
const br = [
|
|
339
|
+
], dr = X("search", ur);
|
|
340
|
+
const fr = [
|
|
445
341
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
446
342
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
447
343
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
448
|
-
],
|
|
449
|
-
|
|
450
|
-
* @license lucide-react v0.545.0 - ISC
|
|
451
|
-
*
|
|
452
|
-
* This source code is licensed under the ISC license.
|
|
453
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
-
*/
|
|
455
|
-
const xr = [
|
|
344
|
+
], pr = X("trash", fr);
|
|
345
|
+
const gr = [
|
|
456
346
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
457
347
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
458
|
-
],
|
|
459
|
-
const [e, t] = P([]), r =
|
|
460
|
-
fetch("/__motia/state").then(async (
|
|
461
|
-
if (
|
|
462
|
-
return
|
|
463
|
-
throw await
|
|
464
|
-
}).then(t).catch((
|
|
465
|
-
}, []), n = (
|
|
348
|
+
], Rt = X("x", gr), hr = () => {
|
|
349
|
+
const [e, t] = P([]), r = W(() => {
|
|
350
|
+
fetch("/__motia/state").then(async (o) => {
|
|
351
|
+
if (o.ok)
|
|
352
|
+
return o.json();
|
|
353
|
+
throw await o.json();
|
|
354
|
+
}).then(t).catch((o) => console.error(o));
|
|
355
|
+
}, []), n = (o) => {
|
|
466
356
|
fetch("/__motia/state/delete", {
|
|
467
357
|
method: "POST",
|
|
468
358
|
headers: { "Content-Type": "application/json" },
|
|
469
|
-
body: JSON.stringify({ ids:
|
|
359
|
+
body: JSON.stringify({ ids: o })
|
|
470
360
|
}).then(() => r());
|
|
471
361
|
};
|
|
472
362
|
return Y(() => {
|
|
473
363
|
r();
|
|
474
364
|
}, [r]), { items: e, deleteItems: n, refetch: r };
|
|
475
|
-
},
|
|
365
|
+
}, tt = (e) => {
|
|
476
366
|
let t;
|
|
477
367
|
const r = /* @__PURE__ */ new Set(), n = (u, d) => {
|
|
478
368
|
const v = typeof u == "function" ? u(t) : u;
|
|
479
369
|
if (!Object.is(v, t)) {
|
|
480
|
-
const
|
|
481
|
-
t = d ?? (typeof v != "object" || v === null) ? v : Object.assign({}, t, v), r.forEach((
|
|
370
|
+
const E = t;
|
|
371
|
+
t = d ?? (typeof v != "object" || v === null) ? v : Object.assign({}, t, v), r.forEach((O) => O(t, E));
|
|
482
372
|
}
|
|
483
|
-
},
|
|
373
|
+
}, o = () => t, l = { setState: n, getState: o, getInitialState: () => g, subscribe: (u) => (r.add(u), () => r.delete(u)) }, g = t = e(n, o, l);
|
|
484
374
|
return l;
|
|
485
|
-
},
|
|
486
|
-
function
|
|
487
|
-
const r =
|
|
375
|
+
}, vr = ((e) => e ? tt(e) : tt), mr = (e) => e;
|
|
376
|
+
function yr(e, t = mr) {
|
|
377
|
+
const r = B.useSyncExternalStore(
|
|
488
378
|
e.subscribe,
|
|
489
|
-
|
|
490
|
-
|
|
379
|
+
B.useCallback(() => t(e.getState()), [e, t]),
|
|
380
|
+
B.useCallback(() => t(e.getInitialState()), [e, t])
|
|
491
381
|
);
|
|
492
|
-
return
|
|
382
|
+
return B.useDebugValue(r), r;
|
|
493
383
|
}
|
|
494
|
-
const
|
|
495
|
-
const t =
|
|
384
|
+
const br = (e) => {
|
|
385
|
+
const t = vr(e), r = (n) => yr(t, n);
|
|
496
386
|
return Object.assign(r, t), r;
|
|
497
|
-
},
|
|
387
|
+
}, jr = ((e) => br), rt = jr()((e) => ({
|
|
498
388
|
selectedStateId: void 0,
|
|
499
389
|
selectStateId: (t) => e({ selectedStateId: t })
|
|
500
390
|
}));
|
|
501
|
-
function
|
|
502
|
-
function
|
|
503
|
-
return
|
|
504
|
-
c(
|
|
391
|
+
function wr(e, t, r, n) {
|
|
392
|
+
function o(i) {
|
|
393
|
+
return i instanceof r ? i : new r(function(c) {
|
|
394
|
+
c(i);
|
|
505
395
|
});
|
|
506
396
|
}
|
|
507
|
-
return new (r || (r = Promise))(function(
|
|
397
|
+
return new (r || (r = Promise))(function(i, c) {
|
|
508
398
|
function l(d) {
|
|
509
399
|
try {
|
|
510
400
|
u(n.next(d));
|
|
@@ -520,12 +410,12 @@ function Nr(e, t, r, n) {
|
|
|
520
410
|
}
|
|
521
411
|
}
|
|
522
412
|
function u(d) {
|
|
523
|
-
d.done ?
|
|
413
|
+
d.done ? i(d.value) : o(d.value).then(l, g);
|
|
524
414
|
}
|
|
525
415
|
u((n = n.apply(e, [])).next());
|
|
526
416
|
});
|
|
527
417
|
}
|
|
528
|
-
var
|
|
418
|
+
var xr = function() {
|
|
529
419
|
var e = document.getSelection();
|
|
530
420
|
if (!e.rangeCount)
|
|
531
421
|
return function() {
|
|
@@ -543,33 +433,33 @@ var Tr = function() {
|
|
|
543
433
|
break;
|
|
544
434
|
}
|
|
545
435
|
return e.removeAllRanges(), function() {
|
|
546
|
-
e.type === "Caret" && e.removeAllRanges(), e.rangeCount || r.forEach(function(
|
|
547
|
-
e.addRange(
|
|
436
|
+
e.type === "Caret" && e.removeAllRanges(), e.rangeCount || r.forEach(function(o) {
|
|
437
|
+
e.addRange(o);
|
|
548
438
|
}), t && t.focus();
|
|
549
439
|
};
|
|
550
|
-
},
|
|
440
|
+
}, Cr = xr, nt = {
|
|
551
441
|
"text/plain": "Text",
|
|
552
442
|
"text/html": "Url",
|
|
553
443
|
default: "Text"
|
|
554
|
-
},
|
|
555
|
-
function
|
|
444
|
+
}, Sr = "Copy to clipboard: #{key}, Enter";
|
|
445
|
+
function Er(e) {
|
|
556
446
|
var t = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
|
|
557
447
|
return e.replace(/#{\s*key\s*}/g, t);
|
|
558
448
|
}
|
|
559
|
-
function
|
|
560
|
-
var r, n,
|
|
449
|
+
function Or(e, t) {
|
|
450
|
+
var r, n, o, i, c, l, g = !1;
|
|
561
451
|
t || (t = {}), r = t.debug || !1;
|
|
562
452
|
try {
|
|
563
|
-
|
|
453
|
+
o = Cr(), i = document.createRange(), c = document.getSelection(), l = document.createElement("span"), l.textContent = e, l.ariaHidden = "true", l.style.all = "unset", l.style.position = "fixed", l.style.top = 0, l.style.clip = "rect(0, 0, 0, 0)", l.style.whiteSpace = "pre", l.style.webkitUserSelect = "text", l.style.MozUserSelect = "text", l.style.msUserSelect = "text", l.style.userSelect = "text", l.addEventListener("copy", function(d) {
|
|
564
454
|
if (d.stopPropagation(), t.format)
|
|
565
455
|
if (d.preventDefault(), typeof d.clipboardData > "u") {
|
|
566
456
|
r && console.warn("unable to use e.clipboardData"), r && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
|
|
567
|
-
var v =
|
|
457
|
+
var v = nt[t.format] || nt.default;
|
|
568
458
|
window.clipboardData.setData(v, e);
|
|
569
459
|
} else
|
|
570
460
|
d.clipboardData.clearData(), d.clipboardData.setData(t.format, e);
|
|
571
461
|
t.onCopy && (d.preventDefault(), t.onCopy(d.clipboardData));
|
|
572
|
-
}), document.body.appendChild(l),
|
|
462
|
+
}), document.body.appendChild(l), i.selectNodeContents(l), c.addRange(i);
|
|
573
463
|
var u = document.execCommand("copy");
|
|
574
464
|
if (!u)
|
|
575
465
|
throw new Error("copy command was unsuccessful");
|
|
@@ -579,21 +469,21 @@ function Ir(e, t) {
|
|
|
579
469
|
try {
|
|
580
470
|
window.clipboardData.setData(t.format || "text", e), t.onCopy && t.onCopy(window.clipboardData), g = !0;
|
|
581
471
|
} catch (v) {
|
|
582
|
-
r && console.error("unable to copy using clipboardData: ", v), r && console.error("falling back to prompt"), n =
|
|
472
|
+
r && console.error("unable to copy using clipboardData: ", v), r && console.error("falling back to prompt"), n = Er("message" in t ? t.message : Sr), window.prompt(n, e);
|
|
583
473
|
}
|
|
584
474
|
} finally {
|
|
585
|
-
c && (typeof c.removeRange == "function" ? c.removeRange(
|
|
475
|
+
c && (typeof c.removeRange == "function" ? c.removeRange(i) : c.removeAllRanges()), l && document.body.removeChild(l), o();
|
|
586
476
|
}
|
|
587
477
|
return g;
|
|
588
478
|
}
|
|
589
|
-
var
|
|
479
|
+
var kr = Or;
|
|
590
480
|
function Q(e) {
|
|
591
481
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
592
482
|
}
|
|
593
483
|
function ce(e) {
|
|
594
484
|
return Array.isArray(e) ? e.length : Q(e) ? Object.keys(e).length : 0;
|
|
595
485
|
}
|
|
596
|
-
function
|
|
486
|
+
function Ar(e, t) {
|
|
597
487
|
if (typeof e == "string")
|
|
598
488
|
return e;
|
|
599
489
|
try {
|
|
@@ -614,89 +504,89 @@ function $r(e, t) {
|
|
|
614
504
|
return `${r.name}: ${r.message}` || "JSON.stringify failed";
|
|
615
505
|
}
|
|
616
506
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
507
|
+
function Nr(e) {
|
|
508
|
+
return wr(this, void 0, void 0, function* () {
|
|
619
509
|
try {
|
|
620
510
|
yield navigator.clipboard.writeText(e);
|
|
621
511
|
} catch {
|
|
622
|
-
|
|
512
|
+
kr(e);
|
|
623
513
|
}
|
|
624
514
|
});
|
|
625
515
|
}
|
|
626
|
-
function
|
|
627
|
-
if (
|
|
628
|
-
return !!
|
|
516
|
+
function at(e, t, r, n, o, i) {
|
|
517
|
+
if (i && i.collapsed !== void 0)
|
|
518
|
+
return !!i.collapsed;
|
|
629
519
|
if (typeof n == "boolean")
|
|
630
520
|
return n;
|
|
631
521
|
if (typeof n == "number" && t > n)
|
|
632
522
|
return !0;
|
|
633
523
|
const c = ce(e);
|
|
634
524
|
if (typeof n == "function") {
|
|
635
|
-
const l =
|
|
525
|
+
const l = Fe(n, [{ node: e, depth: t, indexOrName: r, size: c }]);
|
|
636
526
|
if (typeof l == "boolean")
|
|
637
527
|
return l;
|
|
638
528
|
}
|
|
639
|
-
return !!(Array.isArray(e) && c >
|
|
529
|
+
return !!(Array.isArray(e) && c > o || Q(e) && c > o);
|
|
640
530
|
}
|
|
641
|
-
function
|
|
642
|
-
if (
|
|
643
|
-
return !!
|
|
531
|
+
function ot(e, t, r, n, o, i) {
|
|
532
|
+
if (i && i.collapsed !== void 0)
|
|
533
|
+
return !!i.collapsed;
|
|
644
534
|
if (typeof n == "boolean")
|
|
645
535
|
return n;
|
|
646
536
|
if (typeof n == "number" && t > n)
|
|
647
537
|
return !0;
|
|
648
538
|
const c = Math.ceil(e.length / 100);
|
|
649
539
|
if (typeof n == "function") {
|
|
650
|
-
const l =
|
|
540
|
+
const l = Fe(n, [{ node: e, depth: t, indexOrName: r, size: c }]);
|
|
651
541
|
if (typeof l == "boolean")
|
|
652
542
|
return l;
|
|
653
543
|
}
|
|
654
|
-
return !!(Array.isArray(e) && c >
|
|
544
|
+
return !!(Array.isArray(e) && c > o || Q(e) && c > o);
|
|
655
545
|
}
|
|
656
546
|
function ae(e, t, r) {
|
|
657
547
|
return typeof e == "boolean" ? e : !!(typeof e == "number" && t > e || e === "collapsed" && r || e === "expanded" && !r);
|
|
658
548
|
}
|
|
659
|
-
function
|
|
549
|
+
function Fe(e, t) {
|
|
660
550
|
try {
|
|
661
551
|
return e(...t);
|
|
662
552
|
} catch (r) {
|
|
663
553
|
reportError(r);
|
|
664
554
|
}
|
|
665
555
|
}
|
|
666
|
-
function
|
|
556
|
+
function Mt(e) {
|
|
667
557
|
if (e === !0 || Q(e) && e.add === !0)
|
|
668
558
|
return !0;
|
|
669
559
|
}
|
|
670
|
-
function
|
|
560
|
+
function st(e) {
|
|
671
561
|
if (e === !0 || Q(e) && e.edit === !0)
|
|
672
562
|
return !0;
|
|
673
563
|
}
|
|
674
|
-
function
|
|
564
|
+
function Ue(e) {
|
|
675
565
|
if (e === !0 || Q(e) && e.delete === !0)
|
|
676
566
|
return !0;
|
|
677
567
|
}
|
|
678
|
-
function
|
|
568
|
+
function _r(e) {
|
|
679
569
|
return typeof e == "function";
|
|
680
570
|
}
|
|
681
|
-
function
|
|
571
|
+
function It(e) {
|
|
682
572
|
return !e || e.add === void 0 || !!e.add;
|
|
683
573
|
}
|
|
684
|
-
function
|
|
574
|
+
function it(e) {
|
|
685
575
|
return !e || e.edit === void 0 || !!e.edit;
|
|
686
576
|
}
|
|
687
|
-
function
|
|
577
|
+
function ze(e) {
|
|
688
578
|
return !e || e.delete === void 0 || !!e.delete;
|
|
689
579
|
}
|
|
690
580
|
function we(e) {
|
|
691
581
|
return !e || e.enableClipboard === void 0 || !!e.enableClipboard;
|
|
692
582
|
}
|
|
693
|
-
function
|
|
583
|
+
function Tr(e) {
|
|
694
584
|
return !e || e.matchesURL === void 0 || !!e.matchesURL;
|
|
695
585
|
}
|
|
696
|
-
function
|
|
586
|
+
function Rr(e, t) {
|
|
697
587
|
return e === "string" ? t.trim().replace(/^\"([\s\S]+?)\"$/, "$1") : t;
|
|
698
588
|
}
|
|
699
|
-
var
|
|
589
|
+
var ct;
|
|
700
590
|
function _e() {
|
|
701
591
|
return _e = Object.assign ? Object.assign.bind() : function(e) {
|
|
702
592
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -707,437 +597,437 @@ function _e() {
|
|
|
707
597
|
return e;
|
|
708
598
|
}, _e.apply(this, arguments);
|
|
709
599
|
}
|
|
710
|
-
var
|
|
711
|
-
return /* @__PURE__ */
|
|
600
|
+
var Ze = function(t) {
|
|
601
|
+
return /* @__PURE__ */ $.createElement("svg", _e({
|
|
712
602
|
xmlns: "http://www.w3.org/2000/svg",
|
|
713
603
|
width: 16,
|
|
714
604
|
height: 16,
|
|
715
605
|
fill: "none",
|
|
716
606
|
viewBox: "0 0 16 16"
|
|
717
|
-
}, t),
|
|
607
|
+
}, t), ct || (ct = /* @__PURE__ */ $.createElement("path", {
|
|
718
608
|
fill: "currentColor",
|
|
719
609
|
d: "M12.473 5.806a.666.666 0 0 0-.946 0L8.473 8.86a.667.667 0 0 1-.946 0L4.473 5.806a.667.667 0 1 0-.946.94l3.06 3.06a2 2 0 0 0 2.826 0l3.06-3.06a.667.667 0 0 0 0-.94Z"
|
|
720
610
|
})));
|
|
721
|
-
},
|
|
722
|
-
function
|
|
723
|
-
return
|
|
611
|
+
}, lt;
|
|
612
|
+
function Te() {
|
|
613
|
+
return Te = Object.assign ? Object.assign.bind() : function(e) {
|
|
724
614
|
for (var t = 1; t < arguments.length; t++) {
|
|
725
615
|
var r = arguments[t];
|
|
726
616
|
for (var n in r)
|
|
727
617
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
728
618
|
}
|
|
729
619
|
return e;
|
|
730
|
-
},
|
|
620
|
+
}, Te.apply(this, arguments);
|
|
731
621
|
}
|
|
732
|
-
var
|
|
733
|
-
return /* @__PURE__ */
|
|
622
|
+
var Mr = function(t) {
|
|
623
|
+
return /* @__PURE__ */ $.createElement("svg", Te({
|
|
734
624
|
xmlns: "http://www.w3.org/2000/svg",
|
|
735
625
|
width: 24,
|
|
736
626
|
height: 24,
|
|
737
627
|
fill: "none",
|
|
738
628
|
viewBox: "0 0 24 24"
|
|
739
|
-
}, t),
|
|
629
|
+
}, t), lt || (lt = /* @__PURE__ */ $.createElement("path", {
|
|
740
630
|
fill: "currentColor",
|
|
741
631
|
d: "M17.542 2.5h-4.75a3.963 3.963 0 0 0-3.959 3.958v4.75a3.963 3.963 0 0 0 3.959 3.959h4.75a3.963 3.963 0 0 0 3.958-3.959v-4.75A3.963 3.963 0 0 0 17.542 2.5Zm2.375 8.708a2.378 2.378 0 0 1-2.375 2.375h-4.75a2.378 2.378 0 0 1-2.375-2.375v-4.75a2.378 2.378 0 0 1 2.375-2.375h4.75a2.378 2.378 0 0 1 2.375 2.375v4.75Zm-4.75 6.334a3.963 3.963 0 0 1-3.959 3.958h-4.75A3.963 3.963 0 0 1 2.5 17.542v-4.75a3.963 3.963 0 0 1 3.958-3.959.791.791 0 1 1 0 1.584 2.378 2.378 0 0 0-2.375 2.375v4.75a2.378 2.378 0 0 0 2.375 2.375h4.75a2.378 2.378 0 0 0 2.375-2.375.792.792 0 1 1 1.584 0Z"
|
|
742
632
|
})));
|
|
743
|
-
},
|
|
744
|
-
function
|
|
745
|
-
return
|
|
633
|
+
}, ut, dt;
|
|
634
|
+
function Re() {
|
|
635
|
+
return Re = Object.assign ? Object.assign.bind() : function(e) {
|
|
746
636
|
for (var t = 1; t < arguments.length; t++) {
|
|
747
637
|
var r = arguments[t];
|
|
748
638
|
for (var n in r)
|
|
749
639
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
750
640
|
}
|
|
751
641
|
return e;
|
|
752
|
-
},
|
|
642
|
+
}, Re.apply(this, arguments);
|
|
753
643
|
}
|
|
754
|
-
var
|
|
755
|
-
return /* @__PURE__ */
|
|
644
|
+
var Ir = function(t) {
|
|
645
|
+
return /* @__PURE__ */ $.createElement("svg", Re({
|
|
756
646
|
xmlns: "http://www.w3.org/2000/svg",
|
|
757
647
|
width: 24,
|
|
758
648
|
height: 24,
|
|
759
649
|
fill: "none",
|
|
760
650
|
viewBox: "0 0 24 24"
|
|
761
|
-
}, t),
|
|
651
|
+
}, t), ut || (ut = /* @__PURE__ */ $.createElement("path", {
|
|
762
652
|
fill: "currentColor",
|
|
763
653
|
d: "M17.25 3H6.75A3.755 3.755 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.755 3.755 0 0 0 17.25 3Zm2.25 14.25a2.25 2.25 0 0 1-2.25 2.25H6.75a2.25 2.25 0 0 1-2.25-2.25V6.75A2.25 2.25 0 0 1 6.75 4.5h10.5a2.25 2.25 0 0 1 2.25 2.25v10.5Z"
|
|
764
|
-
})),
|
|
654
|
+
})), dt || (dt = /* @__PURE__ */ $.createElement("path", {
|
|
765
655
|
fill: "#14C786",
|
|
766
656
|
d: "M10.312 14.45 7.83 11.906a.625.625 0 0 0-.896 0 .659.659 0 0 0 0 .918l2.481 2.546a1.264 1.264 0 0 0 .896.381 1.237 1.237 0 0 0 .895-.38l5.858-6.011a.658.658 0 0 0 0-.919.625.625 0 0 0-.896 0l-5.857 6.01Z"
|
|
767
657
|
})));
|
|
768
658
|
};
|
|
769
659
|
function xe({ node: e, nodeMeta: t }) {
|
|
770
|
-
const { customizeCopy: r, CopyComponent: n, CopiedComponent:
|
|
660
|
+
const { customizeCopy: r, CopyComponent: n, CopiedComponent: o } = te(ee), [i, c] = P(!1), l = (g) => {
|
|
771
661
|
g.stopPropagation();
|
|
772
662
|
const u = r(e, t);
|
|
773
|
-
typeof u == "string" && u &&
|
|
663
|
+
typeof u == "string" && u && Nr(u), c(!0), setTimeout(() => c(!1), 3e3);
|
|
774
664
|
};
|
|
775
|
-
return
|
|
665
|
+
return i ? typeof o == "function" ? a.jsx(o, { className: "json-view--copy", style: { display: "inline-block" } }) : a.jsx(Ir, { className: "json-view--copy", style: { display: "inline-block" } }) : typeof n == "function" ? a.jsx(n, { onClick: l, className: "json-view--copy" }) : a.jsx(Mr, { onClick: l, className: "json-view--copy" });
|
|
776
666
|
}
|
|
777
|
-
function
|
|
778
|
-
const { displayArrayIndex: l } = te(ee), g = Array.isArray(
|
|
779
|
-
return a.jsxs("div", Object.assign({ className: "json-view--pair" }, { children: [!g || g && l ? a.jsxs(a.Fragment, { children: [a.jsx("span", Object.assign({ className: typeof e == "number" ? "json-view--index" : "json-view--property" }, { children: e })), ":", " "] }) : a.jsx(a.Fragment, {}), a.jsx(
|
|
667
|
+
function Me({ indexOrName: e, value: t, depth: r, deleteHandle: n, editHandle: o, parent: i, parentPath: c }) {
|
|
668
|
+
const { displayArrayIndex: l } = te(ee), g = Array.isArray(i);
|
|
669
|
+
return a.jsxs("div", Object.assign({ className: "json-view--pair" }, { children: [!g || g && l ? a.jsxs(a.Fragment, { children: [a.jsx("span", Object.assign({ className: typeof e == "number" ? "json-view--index" : "json-view--property" }, { children: e })), ":", " "] }) : a.jsx(a.Fragment, {}), a.jsx($t, { node: t, depth: r + 1, deleteHandle: (u, d) => n(u, d), editHandle: (u, d, v, E) => o(u, d, v, E), parent: i, indexOrName: e, parentPath: c })] }));
|
|
780
670
|
}
|
|
781
|
-
var
|
|
782
|
-
function
|
|
783
|
-
return
|
|
671
|
+
var ft, pt;
|
|
672
|
+
function Ie() {
|
|
673
|
+
return Ie = Object.assign ? Object.assign.bind() : function(e) {
|
|
784
674
|
for (var t = 1; t < arguments.length; t++) {
|
|
785
675
|
var r = arguments[t];
|
|
786
676
|
for (var n in r)
|
|
787
677
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
788
678
|
}
|
|
789
679
|
return e;
|
|
790
|
-
},
|
|
680
|
+
}, Ie.apply(this, arguments);
|
|
791
681
|
}
|
|
792
|
-
var
|
|
793
|
-
return /* @__PURE__ */
|
|
682
|
+
var Je = function(t) {
|
|
683
|
+
return /* @__PURE__ */ $.createElement("svg", Ie({
|
|
794
684
|
xmlns: "http://www.w3.org/2000/svg",
|
|
795
685
|
width: 24,
|
|
796
686
|
height: 24,
|
|
797
687
|
fill: "none",
|
|
798
688
|
viewBox: "0 0 24 24"
|
|
799
|
-
}, t),
|
|
689
|
+
}, t), ft || (ft = /* @__PURE__ */ $.createElement("path", {
|
|
800
690
|
fill: "currentColor",
|
|
801
691
|
d: "M18.75 6h-2.325a3.757 3.757 0 0 0-3.675-3h-1.5a3.757 3.757 0 0 0-3.675 3H5.25a.75.75 0 0 0 0 1.5H6v9.75A3.754 3.754 0 0 0 9.75 21h4.5A3.754 3.754 0 0 0 18 17.25V7.5h.75a.75.75 0 1 0 0-1.5Zm-7.5-1.5h1.5A2.255 2.255 0 0 1 14.872 6H9.128a2.255 2.255 0 0 1 2.122-1.5Zm5.25 12.75a2.25 2.25 0 0 1-2.25 2.25h-4.5a2.25 2.25 0 0 1-2.25-2.25V7.5h9v9.75Z"
|
|
802
|
-
})),
|
|
692
|
+
})), pt || (pt = /* @__PURE__ */ $.createElement("path", {
|
|
803
693
|
fill: "#DA0000",
|
|
804
694
|
d: "M10.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM13.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z"
|
|
805
695
|
})));
|
|
806
|
-
},
|
|
807
|
-
function
|
|
808
|
-
return
|
|
696
|
+
}, gt, ht;
|
|
697
|
+
function Pe() {
|
|
698
|
+
return Pe = Object.assign ? Object.assign.bind() : function(e) {
|
|
809
699
|
for (var t = 1; t < arguments.length; t++) {
|
|
810
700
|
var r = arguments[t];
|
|
811
701
|
for (var n in r)
|
|
812
702
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
813
703
|
}
|
|
814
704
|
return e;
|
|
815
|
-
},
|
|
705
|
+
}, Pe.apply(this, arguments);
|
|
816
706
|
}
|
|
817
|
-
var
|
|
818
|
-
return /* @__PURE__ */
|
|
707
|
+
var Pt = function(t) {
|
|
708
|
+
return /* @__PURE__ */ $.createElement("svg", Pe({
|
|
819
709
|
xmlns: "http://www.w3.org/2000/svg",
|
|
820
710
|
width: 24,
|
|
821
711
|
height: 24,
|
|
822
712
|
fill: "none",
|
|
823
713
|
viewBox: "0 0 24 24"
|
|
824
|
-
}, t),
|
|
714
|
+
}, t), gt || (gt = /* @__PURE__ */ $.createElement("path", {
|
|
825
715
|
fill: "currentColor",
|
|
826
716
|
d: "M21 6.75v10.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3h10.5A3.754 3.754 0 0 1 21 6.75Zm-1.5 0c0-1.24-1.01-2.25-2.25-2.25H6.75C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25V6.75Z"
|
|
827
|
-
})),
|
|
717
|
+
})), ht || (ht = /* @__PURE__ */ $.createElement("path", {
|
|
828
718
|
fill: "#14C786",
|
|
829
719
|
d: "M15 12.75a.75.75 0 1 0 0-1.5h-2.25V9a.75.75 0 1 0-1.5 0v2.25H9a.75.75 0 1 0 0 1.5h2.25V15a.75.75 0 1 0 1.5 0v-2.25H15Z"
|
|
830
720
|
})));
|
|
831
|
-
},
|
|
832
|
-
function
|
|
833
|
-
return
|
|
721
|
+
}, vt, mt;
|
|
722
|
+
function $e() {
|
|
723
|
+
return $e = Object.assign ? Object.assign.bind() : function(e) {
|
|
834
724
|
for (var t = 1; t < arguments.length; t++) {
|
|
835
725
|
var r = arguments[t];
|
|
836
726
|
for (var n in r)
|
|
837
727
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
838
728
|
}
|
|
839
729
|
return e;
|
|
840
|
-
},
|
|
730
|
+
}, $e.apply(this, arguments);
|
|
841
731
|
}
|
|
842
|
-
var
|
|
843
|
-
return /* @__PURE__ */
|
|
732
|
+
var Ye = function(t) {
|
|
733
|
+
return /* @__PURE__ */ $.createElement("svg", $e({
|
|
844
734
|
xmlns: "http://www.w3.org/2000/svg",
|
|
845
735
|
width: 24,
|
|
846
736
|
height: 24,
|
|
847
737
|
fill: "none",
|
|
848
738
|
viewBox: "0 0 24 24"
|
|
849
|
-
}, t),
|
|
739
|
+
}, t), vt || (vt = /* @__PURE__ */ $.createElement("path", {
|
|
850
740
|
fill: "currentColor",
|
|
851
741
|
d: "M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"
|
|
852
|
-
})),
|
|
742
|
+
})), mt || (mt = /* @__PURE__ */ $.createElement("path", {
|
|
853
743
|
fill: "#14C786",
|
|
854
744
|
d: "m10.85 13.96-1.986-2.036a.5.5 0 0 0-.716 0 .527.527 0 0 0 0 .735l1.985 2.036a1.01 1.01 0 0 0 .717.305.99.99 0 0 0 .716-.305l4.686-4.808a.526.526 0 0 0 0-.735.5.5 0 0 0-.716 0l-4.687 4.809Z"
|
|
855
745
|
})));
|
|
856
|
-
},
|
|
857
|
-
function
|
|
858
|
-
return
|
|
746
|
+
}, yt, bt;
|
|
747
|
+
function De() {
|
|
748
|
+
return De = Object.assign ? Object.assign.bind() : function(e) {
|
|
859
749
|
for (var t = 1; t < arguments.length; t++) {
|
|
860
750
|
var r = arguments[t];
|
|
861
751
|
for (var n in r)
|
|
862
752
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
863
753
|
}
|
|
864
754
|
return e;
|
|
865
|
-
},
|
|
755
|
+
}, De.apply(this, arguments);
|
|
866
756
|
}
|
|
867
|
-
var
|
|
868
|
-
return /* @__PURE__ */
|
|
757
|
+
var qe = function(t) {
|
|
758
|
+
return /* @__PURE__ */ $.createElement("svg", De({
|
|
869
759
|
xmlns: "http://www.w3.org/2000/svg",
|
|
870
760
|
width: 24,
|
|
871
761
|
height: 24,
|
|
872
762
|
fill: "none",
|
|
873
763
|
viewBox: "0 0 24 24"
|
|
874
|
-
}, t),
|
|
764
|
+
}, t), yt || (yt = /* @__PURE__ */ $.createElement("path", {
|
|
875
765
|
fill: "#DA0000",
|
|
876
766
|
d: "M15 9a.75.75 0 0 0-1.06 0L12 10.94 10.06 9A.75.75 0 0 0 9 10.06L10.94 12 9 13.94A.75.75 0 0 0 10.06 15L12 13.06 13.94 15A.75.75 0 0 0 15 13.94L13.06 12 15 10.06A.75.75 0 0 0 15 9Z"
|
|
877
|
-
})),
|
|
767
|
+
})), bt || (bt = /* @__PURE__ */ $.createElement("path", {
|
|
878
768
|
fill: "currentColor",
|
|
879
769
|
d: "M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"
|
|
880
770
|
})));
|
|
881
771
|
};
|
|
882
|
-
function
|
|
883
|
-
const { enableClipboard: u, src: d, onEdit: v, onChange:
|
|
884
|
-
e[
|
|
772
|
+
function Pr({ originNode: e, node: t, depth: r, index: n, deleteHandle: o, customOptions: i, startIndex: c, parent: l, parentPath: g }) {
|
|
773
|
+
const { enableClipboard: u, src: d, onEdit: v, onChange: E, forceUpdate: O, displaySize: C, CustomOperation: _ } = te(ee), f = [...g, String(n)], [A, k] = P(!0), R = W((x, y, F) => {
|
|
774
|
+
e[x] = y, v && v({
|
|
885
775
|
newValue: y,
|
|
886
|
-
oldValue:
|
|
776
|
+
oldValue: F,
|
|
887
777
|
depth: r,
|
|
888
778
|
src: d,
|
|
889
|
-
indexOrName:
|
|
779
|
+
indexOrName: x,
|
|
890
780
|
parentType: "array",
|
|
891
781
|
parentPath: g
|
|
892
|
-
}),
|
|
893
|
-
}, [t, v,
|
|
894
|
-
e.splice(
|
|
895
|
-
}, m = a.jsxs(a.Fragment, { children: [!
|
|
896
|
-
return a.jsxs("div", { children: [a.jsx("span", { children: "[" }), m,
|
|
782
|
+
}), E && E({ type: "edit", depth: r, src: d, indexOrName: x, parentType: "array", parentPath: g }), O();
|
|
783
|
+
}, [t, v, E, O]), w = (x) => {
|
|
784
|
+
e.splice(x, 1), o && o(x, g), O();
|
|
785
|
+
}, m = a.jsxs(a.Fragment, { children: [!A && a.jsxs("span", Object.assign({ onClick: () => k(!0), className: "jv-size-chevron" }, { children: [ae(C, r, A) && a.jsxs("span", Object.assign({ className: "jv-size" }, { children: [ce(t), " Items"] })), a.jsx(Ze, { className: "jv-chevron" })] })), !A && u && we(i) && a.jsx(xe, { node: t, nodeMeta: { depth: r, indexOrName: n, parent: l, parentPath: g, currentPath: f } }), typeof _ == "function" ? a.jsx(_, { node: t }) : null] });
|
|
786
|
+
return a.jsxs("div", { children: [a.jsx("span", { children: "[" }), m, A ? a.jsxs("button", Object.assign({ onClick: () => k(!1), className: "jv-button" }, { children: [c, " ... ", c + t.length - 1] })) : a.jsx("div", Object.assign({ className: "jv-indent" }, { children: t.map((x, y) => a.jsx(Me, { indexOrName: y + c, value: x, depth: r, parent: t, deleteHandle: w, editHandle: R, parentPath: g }, String(n) + String(y))) })), a.jsx("span", { children: "]" })] });
|
|
897
787
|
}
|
|
898
|
-
function
|
|
788
|
+
function $r({ node: e, depth: t, deleteHandle: r, indexOrName: n, customOptions: o, parent: i, parentPath: c }) {
|
|
899
789
|
const l = typeof n < "u" ? [...c, String(n)] : c, g = [];
|
|
900
|
-
for (let
|
|
901
|
-
g.push(e.slice(
|
|
902
|
-
const { collapsed: u, enableClipboard: d, collapseObjectsAfterLength: v, editable:
|
|
790
|
+
for (let b = 0; b < e.length; b += 100)
|
|
791
|
+
g.push(e.slice(b, b + 100));
|
|
792
|
+
const { collapsed: u, enableClipboard: d, collapseObjectsAfterLength: v, editable: E, onDelete: O, src: C, onAdd: _, CustomOperation: f, onChange: A, forceUpdate: k, displaySize: R } = te(ee), [w, m] = P(ot(e, t, n, u, v, o));
|
|
903
793
|
Y(() => {
|
|
904
|
-
m(
|
|
794
|
+
m(ot(e, t, n, u, v, o));
|
|
905
795
|
}, [u, v]);
|
|
906
|
-
const [
|
|
907
|
-
y(!1), r && r(n, c),
|
|
796
|
+
const [x, y] = P(!1), F = () => {
|
|
797
|
+
y(!1), r && r(n, c), O && O({ value: e, depth: t, src: C, indexOrName: n, parentType: "array", parentPath: c }), A && A({
|
|
908
798
|
type: "delete",
|
|
909
799
|
depth: t,
|
|
910
|
-
src:
|
|
800
|
+
src: C,
|
|
911
801
|
indexOrName: n,
|
|
912
802
|
parentType: "array",
|
|
913
803
|
parentPath: c
|
|
914
804
|
});
|
|
915
|
-
}, [
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
},
|
|
919
|
-
y(!1),
|
|
920
|
-
},
|
|
921
|
-
|
|
922
|
-
} }), !
|
|
923
|
-
return a.jsxs(a.Fragment, { children: [a.jsx("span", { children: "[" }),
|
|
924
|
-
}
|
|
925
|
-
function
|
|
926
|
-
const { collapsed: l, onCollapse: g, enableClipboard: u, ignoreLargeArray: d, collapseObjectsAfterLength: v, editable:
|
|
805
|
+
}, [N, S] = P(!1), L = () => {
|
|
806
|
+
const b = e;
|
|
807
|
+
b.push(null), _ && _({ indexOrName: b.length - 1, depth: t, src: C, parentType: "array", parentPath: c }), A && A({ type: "add", indexOrName: b.length - 1, depth: t, src: C, parentType: "array", parentPath: c }), k();
|
|
808
|
+
}, D = x || N, H = () => {
|
|
809
|
+
y(!1), S(!1);
|
|
810
|
+
}, z = a.jsxs(a.Fragment, { children: [!w && !D && a.jsxs("span", Object.assign({ onClick: () => m(!0), className: "jv-size-chevron" }, { children: [ae(R, t, w) && a.jsxs("span", Object.assign({ className: "jv-size" }, { children: [e.length, " Items"] })), a.jsx(Ze, { className: "jv-chevron" })] })), D && a.jsx(Ye, { className: "json-view--edit", style: { display: "inline-block" }, onClick: N ? L : F }), D && a.jsx(qe, { className: "json-view--edit", style: { display: "inline-block" }, onClick: H }), !w && !D && d && we(o) && a.jsx(xe, { node: e, nodeMeta: { depth: t, indexOrName: n, parent: i, parentPath: c, currentPath: l } }), !w && !D && Mt(E) && It(o) && a.jsx(Pt, { className: "json-view--edit", onClick: () => {
|
|
811
|
+
L();
|
|
812
|
+
} }), !w && !D && Ue(E) && ze(o) && r && a.jsx(Je, { className: "json-view--edit", onClick: () => y(!0) }), typeof f == "function" ? a.jsx(f, { node: e }) : null] });
|
|
813
|
+
return a.jsxs(a.Fragment, { children: [a.jsx("span", { children: "[" }), z, w ? a.jsx("button", Object.assign({ onClick: () => m(!1), className: "jv-button" }, { children: "..." })) : a.jsx("div", Object.assign({ className: "jv-indent" }, { children: g.map((b, T) => a.jsx(Pr, { originNode: e, node: b, depth: t, index: T, startIndex: T * 100, deleteHandle: r, customOptions: o, parentPath: c }, String(n) + String(T))) })), a.jsx("span", { children: "]" }), w && ae(R, t, w) && a.jsxs("span", Object.assign({ onClick: () => m(!1), className: "jv-size" }, { children: [e.length, " Items"] }))] });
|
|
814
|
+
}
|
|
815
|
+
function Dr({ node: e, depth: t, indexOrName: r, deleteHandle: n, customOptions: o, parent: i, parentPath: c }) {
|
|
816
|
+
const { collapsed: l, onCollapse: g, enableClipboard: u, ignoreLargeArray: d, collapseObjectsAfterLength: v, editable: E, onDelete: O, src: C, onAdd: _, onEdit: f, onChange: A, forceUpdate: k, displaySize: R, CustomOperation: w } = te(ee), m = typeof r < "u" ? [...c, String(r)] : c;
|
|
927
817
|
if (!d && Array.isArray(e) && e.length > 100)
|
|
928
|
-
return a.jsx(
|
|
929
|
-
const
|
|
930
|
-
g?.({ isCollapsing: !
|
|
818
|
+
return a.jsx($r, { node: e, depth: t, indexOrName: r, deleteHandle: n, customOptions: o, parentPath: m });
|
|
819
|
+
const x = Q(e), [y, F] = P(at(e, t, r, l, v, o)), N = (p) => {
|
|
820
|
+
g?.({ isCollapsing: !p, node: e, depth: t, indexOrName: r }), F(p);
|
|
931
821
|
};
|
|
932
822
|
Y(() => {
|
|
933
|
-
|
|
823
|
+
N(at(e, t, r, l, v, o));
|
|
934
824
|
}, [l, v]);
|
|
935
|
-
const
|
|
936
|
-
Array.isArray(e) ? e[+
|
|
937
|
-
newValue:
|
|
938
|
-
oldValue:
|
|
825
|
+
const S = W((p, j, K) => {
|
|
826
|
+
Array.isArray(e) ? e[+p] = j : e && (e[p] = j), f && f({
|
|
827
|
+
newValue: j,
|
|
828
|
+
oldValue: K,
|
|
939
829
|
depth: t,
|
|
940
|
-
src:
|
|
941
|
-
indexOrName:
|
|
942
|
-
parentType:
|
|
830
|
+
src: C,
|
|
831
|
+
indexOrName: p,
|
|
832
|
+
parentType: x ? "object" : "array",
|
|
943
833
|
parentPath: m
|
|
944
|
-
}),
|
|
945
|
-
}, [e, f,
|
|
946
|
-
Array.isArray(e) ? e.splice(+
|
|
947
|
-
}, [
|
|
948
|
-
|
|
834
|
+
}), A && A({ type: "edit", depth: t, src: C, indexOrName: p, parentType: x ? "object" : "array", parentPath: m }), k();
|
|
835
|
+
}, [e, f, A, k]), L = (p) => {
|
|
836
|
+
Array.isArray(e) ? e.splice(+p, 1) : e && delete e[p], k();
|
|
837
|
+
}, [D, H] = P(!1), z = () => {
|
|
838
|
+
H(!1), n && n(r, m), O && O({ value: e, depth: t, src: C, indexOrName: r, parentType: x ? "object" : "array", parentPath: m }), A && A({
|
|
949
839
|
type: "delete",
|
|
950
840
|
depth: t,
|
|
951
|
-
src:
|
|
841
|
+
src: C,
|
|
952
842
|
indexOrName: r,
|
|
953
|
-
parentType:
|
|
843
|
+
parentType: x ? "object" : "array",
|
|
954
844
|
parentPath: m
|
|
955
845
|
});
|
|
956
|
-
}, [
|
|
957
|
-
var
|
|
958
|
-
if (
|
|
959
|
-
const
|
|
960
|
-
|
|
846
|
+
}, [b, T] = P(!1), M = V(null), Z = () => {
|
|
847
|
+
var p;
|
|
848
|
+
if (x) {
|
|
849
|
+
const j = (p = M.current) === null || p === void 0 ? void 0 : p.value;
|
|
850
|
+
j && (e[j] = null, M.current && (M.current.value = ""), T(!1), _ && _({ indexOrName: j, depth: t, src: C, parentType: "object", parentPath: m }), A && A({ type: "add", indexOrName: j, depth: t, src: C, parentType: "object", parentPath: m }));
|
|
961
851
|
} else if (Array.isArray(e)) {
|
|
962
|
-
const
|
|
963
|
-
|
|
852
|
+
const j = e;
|
|
853
|
+
j.push(null), _ && _({ indexOrName: j.length - 1, depth: t, src: C, parentType: "array", parentPath: m }), A && A({ type: "add", indexOrName: j.length - 1, depth: t, src: C, parentType: "array", parentPath: m });
|
|
964
854
|
}
|
|
965
|
-
|
|
966
|
-
},
|
|
967
|
-
|
|
968
|
-
},
|
|
969
|
-
|
|
970
|
-
},
|
|
971
|
-
|
|
972
|
-
var
|
|
973
|
-
return (
|
|
974
|
-
})) :
|
|
975
|
-
} }), !y && !
|
|
976
|
-
return Array.isArray(e) ? a.jsxs(a.Fragment, { children: [a.jsx("span", { children: "[" }),
|
|
977
|
-
}
|
|
978
|
-
const
|
|
979
|
-
let { collapseStringMode:
|
|
855
|
+
k();
|
|
856
|
+
}, J = (p) => {
|
|
857
|
+
p.key === "Enter" ? (p.preventDefault(), Z()) : p.key === "Escape" && s();
|
|
858
|
+
}, I = D || b, s = () => {
|
|
859
|
+
H(!1), T(!1);
|
|
860
|
+
}, h = a.jsxs(a.Fragment, { children: [!y && !I && a.jsxs("span", Object.assign({ onClick: () => N(!0), className: "jv-size-chevron" }, { children: [ae(R, t, y) && a.jsxs("span", Object.assign({ className: "jv-size" }, { children: [ce(e), " Items"] })), a.jsx(Ze, { className: "jv-chevron" })] })), b && x && a.jsx("input", { className: "json-view--input", placeholder: "property", ref: M, onKeyDown: J }), I && a.jsx(Ye, { className: "json-view--edit", style: { display: "inline-block" }, onClick: b ? Z : z }), I && a.jsx(qe, { className: "json-view--edit", style: { display: "inline-block" }, onClick: s }), !y && !I && u && we(o) && a.jsx(xe, { node: e, nodeMeta: { depth: t, indexOrName: r, parent: i, parentPath: c, currentPath: m } }), !y && !I && Mt(E) && It(o) && a.jsx(Pt, { className: "json-view--edit", onClick: () => {
|
|
861
|
+
x ? (T(!0), setTimeout(() => {
|
|
862
|
+
var p;
|
|
863
|
+
return (p = M.current) === null || p === void 0 ? void 0 : p.focus();
|
|
864
|
+
})) : Z();
|
|
865
|
+
} }), !y && !I && Ue(E) && ze(o) && n && a.jsx(Je, { className: "json-view--edit", onClick: () => H(!0) }), typeof w == "function" ? a.jsx(w, { node: e }) : null] });
|
|
866
|
+
return Array.isArray(e) ? a.jsxs(a.Fragment, { children: [a.jsx("span", { children: "[" }), h, y ? a.jsx("button", Object.assign({ onClick: () => N(!1), className: "jv-button" }, { children: "..." })) : a.jsx("div", Object.assign({ className: "jv-indent" }, { children: e.map((p, j) => a.jsx(Me, { indexOrName: j, value: p, depth: t, parent: e, deleteHandle: L, editHandle: S, parentPath: m }, String(r) + String(j))) })), a.jsx("span", { children: "]" }), y && ae(R, t, y) && a.jsxs("span", Object.assign({ onClick: () => N(!1), className: "jv-size" }, { children: [ce(e), " Items"] }))] }) : x ? a.jsxs(a.Fragment, { children: [a.jsx("span", { children: "{" }), h, y ? a.jsx("button", Object.assign({ onClick: () => N(!1), className: "jv-button" }, { children: "..." })) : a.jsx("div", Object.assign({ className: "jv-indent" }, { children: Object.entries(e).map(([p, j]) => a.jsx(Me, { indexOrName: p, value: j, depth: t, parent: e, deleteHandle: L, editHandle: S, parentPath: m }, String(r) + String(p))) })), a.jsx("span", { children: "}" }), y && ae(R, t, y) && a.jsxs("span", Object.assign({ onClick: () => N(!1), className: "jv-size" }, { children: [ce(e), " Items"] }))] }) : a.jsx("span", { children: String(e) });
|
|
867
|
+
}
|
|
868
|
+
const Lr = B.forwardRef(({ str: e, className: t, ctrlClick: r }, n) => {
|
|
869
|
+
let { collapseStringMode: o, collapseStringsAfterLength: i, customizeCollapseStringUI: c } = te(ee);
|
|
980
870
|
const [l, g] = P(!0), u = V(null);
|
|
981
|
-
|
|
982
|
-
const d = e.replace(/\s+/g, " "), v = typeof c == "function" ? c(d, l) : typeof c == "string" ? c : "...",
|
|
983
|
-
var
|
|
984
|
-
if ((
|
|
985
|
-
r(
|
|
871
|
+
i = i > 0 ? i : 0;
|
|
872
|
+
const d = e.replace(/\s+/g, " "), v = typeof c == "function" ? c(d, l) : typeof c == "string" ? c : "...", E = (O) => {
|
|
873
|
+
var C;
|
|
874
|
+
if ((O.ctrlKey || O.metaKey) && r)
|
|
875
|
+
r(O);
|
|
986
876
|
else {
|
|
987
|
-
const
|
|
988
|
-
if (
|
|
877
|
+
const _ = window.getSelection();
|
|
878
|
+
if (_ && _.anchorOffset !== _.focusOffset && ((C = _.anchorNode) === null || C === void 0 ? void 0 : C.parentElement) === u.current)
|
|
989
879
|
return;
|
|
990
880
|
g(!l);
|
|
991
881
|
}
|
|
992
882
|
};
|
|
993
|
-
if (e.length <=
|
|
883
|
+
if (e.length <= i)
|
|
994
884
|
return a.jsxs("span", Object.assign({ ref: u, className: t, onClick: r }, { children: ['"', e, '"'] }));
|
|
995
|
-
if (
|
|
996
|
-
return e.length <= 10 ? a.jsxs("span", Object.assign({ ref: u, className: t, onClick: r }, { children: ['"', e, '"'] })) : a.jsxs("span", Object.assign({ ref: u, onClick:
|
|
997
|
-
if (
|
|
998
|
-
return a.jsxs("span", Object.assign({ ref: u, onClick:
|
|
999
|
-
if (
|
|
1000
|
-
let
|
|
885
|
+
if (o === "address")
|
|
886
|
+
return e.length <= 10 ? a.jsxs("span", Object.assign({ ref: u, className: t, onClick: r }, { children: ['"', e, '"'] })) : a.jsxs("span", Object.assign({ ref: u, onClick: E, className: t + " cursor-pointer" }, { children: ['"', l ? [d.slice(0, 6), v, d.slice(-4)] : e, '"'] }));
|
|
887
|
+
if (o === "directly")
|
|
888
|
+
return a.jsxs("span", Object.assign({ ref: u, onClick: E, className: t + " cursor-pointer" }, { children: ['"', l ? [d.slice(0, i), v] : e, '"'] }));
|
|
889
|
+
if (o === "word") {
|
|
890
|
+
let O = i, C = i + 1, _ = d, f = 1;
|
|
1001
891
|
for (; ; ) {
|
|
1002
|
-
if (/\W/.test(e[
|
|
1003
|
-
|
|
892
|
+
if (/\W/.test(e[O])) {
|
|
893
|
+
_ = e.slice(0, O);
|
|
1004
894
|
break;
|
|
1005
895
|
}
|
|
1006
|
-
if (/\W/.test(e[
|
|
1007
|
-
|
|
896
|
+
if (/\W/.test(e[C])) {
|
|
897
|
+
_ = e.slice(0, C);
|
|
1008
898
|
break;
|
|
1009
899
|
}
|
|
1010
900
|
if (f === 6) {
|
|
1011
|
-
|
|
901
|
+
_ = e.slice(0, i);
|
|
1012
902
|
break;
|
|
1013
903
|
}
|
|
1014
|
-
f++,
|
|
904
|
+
f++, O--, C++;
|
|
1015
905
|
}
|
|
1016
|
-
return a.jsxs("span", Object.assign({ ref: u, onClick:
|
|
906
|
+
return a.jsxs("span", Object.assign({ ref: u, onClick: E, className: t + " cursor-pointer" }, { children: ['"', l ? [_, v] : e, '"'] }));
|
|
1017
907
|
}
|
|
1018
908
|
return a.jsxs("span", Object.assign({ ref: u, className: t }, { children: ['"', e, '"'] }));
|
|
1019
909
|
});
|
|
1020
|
-
var
|
|
1021
|
-
function
|
|
1022
|
-
return
|
|
910
|
+
var jt;
|
|
911
|
+
function Le() {
|
|
912
|
+
return Le = Object.assign ? Object.assign.bind() : function(e) {
|
|
1023
913
|
for (var t = 1; t < arguments.length; t++) {
|
|
1024
914
|
var r = arguments[t];
|
|
1025
915
|
for (var n in r)
|
|
1026
916
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
1027
917
|
}
|
|
1028
918
|
return e;
|
|
1029
|
-
},
|
|
919
|
+
}, Le.apply(this, arguments);
|
|
1030
920
|
}
|
|
1031
|
-
var
|
|
1032
|
-
return /* @__PURE__ */
|
|
921
|
+
var Vr = function(t) {
|
|
922
|
+
return /* @__PURE__ */ $.createElement("svg", Le({
|
|
1033
923
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1034
924
|
width: 24,
|
|
1035
925
|
height: 24,
|
|
1036
926
|
fill: "none",
|
|
1037
927
|
viewBox: "0 0 24 24"
|
|
1038
|
-
}, t),
|
|
928
|
+
}, t), jt || (jt = /* @__PURE__ */ $.createElement("path", {
|
|
1039
929
|
fill: "currentColor",
|
|
1040
930
|
d: "M17.25 3H6.75A3.754 3.754 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.754 3.754 0 0 0 17.25 3Zm2.25 14.25c0 1.24-1.01 2.25-2.25 2.25H6.75c-1.24 0-2.25-1.01-2.25-2.25V6.75c0-1.24 1.01-2.25 2.25-2.25h10.5c1.24 0 2.25 1.01 2.25 2.25v10.5Zm-6.09-9.466-5.031 5.03a2.981 2.981 0 0 0-.879 2.121v1.19c0 .415.336.75.75.75h1.19c.8 0 1.554-.312 2.12-.879l5.03-5.03a2.252 2.252 0 0 0 0-3.182c-.85-.85-2.331-.85-3.18 0Zm-2.91 7.151c-.28.28-.666.44-1.06.44H9v-.44c0-.4.156-.777.44-1.06l3.187-3.188 1.06 1.061-3.187 3.188Zm5.03-5.03-.782.783-1.06-1.061.782-.782a.766.766 0 0 1 1.06 0 .75.75 0 0 1 0 1.06Z"
|
|
1041
931
|
})));
|
|
1042
|
-
},
|
|
1043
|
-
function
|
|
1044
|
-
return
|
|
932
|
+
}, wt, xt;
|
|
933
|
+
function Ve() {
|
|
934
|
+
return Ve = Object.assign ? Object.assign.bind() : function(e) {
|
|
1045
935
|
for (var t = 1; t < arguments.length; t++) {
|
|
1046
936
|
var r = arguments[t];
|
|
1047
937
|
for (var n in r)
|
|
1048
938
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
1049
939
|
}
|
|
1050
940
|
return e;
|
|
1051
|
-
},
|
|
941
|
+
}, Ve.apply(this, arguments);
|
|
1052
942
|
}
|
|
1053
|
-
var
|
|
1054
|
-
return /* @__PURE__ */
|
|
943
|
+
var Hr = function(t) {
|
|
944
|
+
return /* @__PURE__ */ $.createElement("svg", Ve({
|
|
1055
945
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1056
946
|
width: 24,
|
|
1057
947
|
height: 24,
|
|
1058
948
|
fill: "none",
|
|
1059
949
|
viewBox: "0 0 24 24"
|
|
1060
|
-
}, t),
|
|
950
|
+
}, t), wt || (wt = /* @__PURE__ */ $.createElement("path", {
|
|
1061
951
|
fill: "currentColor",
|
|
1062
952
|
d: "M6.75 3h5.5v1.5h-5.5C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25v-5.5H21v5.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3Z"
|
|
1063
|
-
})),
|
|
953
|
+
})), xt || (xt = /* @__PURE__ */ $.createElement("path", {
|
|
1064
954
|
fill: "currentColor",
|
|
1065
955
|
d: "M20.013 3h-3.946a.987.987 0 0 0 0 1.973h1.564l-6.342 6.342a1.004 1.004 0 0 0 0 1.396 1.004 1.004 0 0 0 1.396 0l6.342-6.342v1.564a.987.987 0 0 0 1.973 0V3.987A.987.987 0 0 0 20.013 3Z"
|
|
1066
956
|
})));
|
|
1067
957
|
};
|
|
1068
|
-
function
|
|
1069
|
-
const { collapseStringsAfterLength: l, enableClipboard: g, editable: u, src: d, onDelete: v, onChange:
|
|
1070
|
-
let
|
|
1071
|
-
if (typeof
|
|
1072
|
-
if (
|
|
1073
|
-
return
|
|
1074
|
-
if (
|
|
1075
|
-
const m =
|
|
958
|
+
function $t({ node: e, depth: t, deleteHandle: r, indexOrName: n, parent: o, editHandle: i, parentPath: c }) {
|
|
959
|
+
const { collapseStringsAfterLength: l, enableClipboard: g, editable: u, src: d, onDelete: v, onChange: E, customizeNode: O, matchesURL: C, urlRegExp: _, EditComponent: f, DoneComponent: A, CancelComponent: k, CustomOperation: R } = te(ee);
|
|
960
|
+
let w;
|
|
961
|
+
if (typeof O == "function" && (w = Fe(O, [{ node: e, depth: t, indexOrName: n }])), w) {
|
|
962
|
+
if (Yt(w))
|
|
963
|
+
return w;
|
|
964
|
+
if (_r(w)) {
|
|
965
|
+
const m = w;
|
|
1076
966
|
return a.jsx(m, { node: e, depth: t, indexOrName: n });
|
|
1077
967
|
}
|
|
1078
968
|
}
|
|
1079
969
|
if (Array.isArray(e) || Q(e))
|
|
1080
|
-
return a.jsx(
|
|
970
|
+
return a.jsx(Dr, { parent: o, node: e, depth: t, indexOrName: n, deleteHandle: r, parentPath: c, customOptions: typeof w == "object" ? w : void 0 });
|
|
1081
971
|
{
|
|
1082
|
-
const m = typeof e,
|
|
1083
|
-
|
|
1084
|
-
var
|
|
1085
|
-
(
|
|
972
|
+
const m = typeof e, x = typeof n < "u" ? [...c, String(n)] : c, [y, F] = P(!1), [N, S] = P(!1), L = V(null), D = () => {
|
|
973
|
+
F(!0), setTimeout(() => {
|
|
974
|
+
var p, j;
|
|
975
|
+
(p = window.getSelection()) === null || p === void 0 || p.selectAllChildren(L.current), (j = L.current) === null || j === void 0 || j.focus();
|
|
1086
976
|
});
|
|
1087
|
-
},
|
|
1088
|
-
let
|
|
977
|
+
}, H = W(() => {
|
|
978
|
+
let p = L.current.innerText;
|
|
1089
979
|
try {
|
|
1090
|
-
const
|
|
1091
|
-
|
|
980
|
+
const j = JSON.parse(p);
|
|
981
|
+
i && i(n, j, e, c);
|
|
1092
982
|
} catch {
|
|
1093
|
-
const
|
|
1094
|
-
|
|
983
|
+
const K = Rr(m, p);
|
|
984
|
+
i && i(n, K, e, c);
|
|
1095
985
|
}
|
|
1096
|
-
|
|
1097
|
-
}, [
|
|
1098
|
-
|
|
1099
|
-
},
|
|
1100
|
-
|
|
986
|
+
F(!1);
|
|
987
|
+
}, [i, n, e, c, m]), z = () => {
|
|
988
|
+
F(!1), S(!1);
|
|
989
|
+
}, b = () => {
|
|
990
|
+
S(!1), r && r(n, c), v && v({
|
|
1101
991
|
value: e,
|
|
1102
992
|
depth: t,
|
|
1103
993
|
src: d,
|
|
1104
994
|
indexOrName: n,
|
|
1105
|
-
parentType: Array.isArray(
|
|
995
|
+
parentType: Array.isArray(o) ? "array" : "object",
|
|
1106
996
|
parentPath: c
|
|
1107
|
-
}),
|
|
997
|
+
}), E && E({
|
|
1108
998
|
depth: t,
|
|
1109
999
|
src: d,
|
|
1110
1000
|
indexOrName: n,
|
|
1111
|
-
parentType: Array.isArray(
|
|
1001
|
+
parentType: Array.isArray(o) ? "array" : "object",
|
|
1112
1002
|
type: "delete",
|
|
1113
1003
|
parentPath: c
|
|
1114
1004
|
});
|
|
1115
|
-
},
|
|
1116
|
-
|
|
1117
|
-
}, [
|
|
1118
|
-
(
|
|
1119
|
-
} : void 0,
|
|
1120
|
-
let
|
|
1005
|
+
}, T = W((p) => {
|
|
1006
|
+
p.key === "Enter" ? (p.preventDefault(), H()) : p.key === "Escape" && z();
|
|
1007
|
+
}, [H]), M = y || N, Z = !M && st(u) && it(w) && i ? (p) => {
|
|
1008
|
+
(p.ctrlKey || p.metaKey) && D();
|
|
1009
|
+
} : void 0, J = a.jsxs(a.Fragment, { children: [M && (typeof A == "function" ? a.jsx(A, { className: "json-view--edit", style: { display: "inline-block" }, onClick: N ? b : H }) : a.jsx(Ye, { className: "json-view--edit", style: { display: "inline-block" }, onClick: N ? b : H })), M && (typeof k == "function" ? a.jsx(k, { className: "json-view--edit", style: { display: "inline-block" }, onClick: z }) : a.jsx(qe, { className: "json-view--edit", style: { display: "inline-block" }, onClick: z })), !M && g && we(w) && a.jsx(xe, { node: e, nodeMeta: { depth: t, indexOrName: n, parent: o, parentPath: c, currentPath: x } }), !M && C && m === "string" && _.test(e) && Tr(w) && a.jsx("a", Object.assign({ href: e, target: "_blank", className: "json-view--link" }, { children: a.jsx(Hr, {}) })), !M && st(u) && it(w) && i && (typeof f == "function" ? a.jsx(f, { className: "json-view--edit", onClick: D }) : a.jsx(Vr, { className: "json-view--edit", onClick: D })), !M && Ue(u) && ze(w) && r && a.jsx(Je, { className: "json-view--edit", onClick: () => S(!0) }), typeof R == "function" ? a.jsx(R, { node: e }) : null] });
|
|
1010
|
+
let I = "json-view--string";
|
|
1121
1011
|
switch (m) {
|
|
1122
1012
|
case "number":
|
|
1123
1013
|
case "bigint":
|
|
1124
|
-
|
|
1014
|
+
I = "json-view--number";
|
|
1125
1015
|
break;
|
|
1126
1016
|
case "boolean":
|
|
1127
|
-
|
|
1017
|
+
I = "json-view--boolean";
|
|
1128
1018
|
break;
|
|
1129
1019
|
case "object":
|
|
1130
|
-
|
|
1020
|
+
I = "json-view--null";
|
|
1131
1021
|
break;
|
|
1132
1022
|
}
|
|
1133
|
-
typeof
|
|
1134
|
-
let
|
|
1135
|
-
m === "bigint" && (
|
|
1136
|
-
const
|
|
1137
|
-
return m === "string" ? a.jsxs(a.Fragment, { children: [y ?
|
|
1023
|
+
typeof w?.className == "string" && (I += " " + w.className), N && (I += " json-view--deleting");
|
|
1024
|
+
let s = String(e);
|
|
1025
|
+
m === "bigint" && (s += "n");
|
|
1026
|
+
const h = ue(() => a.jsx("span", { contentEditable: !0, className: I, dangerouslySetInnerHTML: { __html: m === "string" ? `"${s}"` : s }, ref: L, onKeyDown: T }), [s, m, T]);
|
|
1027
|
+
return m === "string" ? a.jsxs(a.Fragment, { children: [y ? h : e.length > l ? a.jsx(Lr, { str: e, ref: L, className: I, ctrlClick: Z }) : a.jsxs("span", Object.assign({ className: I, onClick: Z }, { children: ['"', s, '"'] })), J] }) : a.jsxs(a.Fragment, { children: [y ? h : a.jsx("span", Object.assign({ className: I, onClick: Z }, { children: s })), J] });
|
|
1138
1028
|
}
|
|
1139
1029
|
}
|
|
1140
|
-
const
|
|
1030
|
+
const Dt = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/, ee = Jt({
|
|
1141
1031
|
src: void 0,
|
|
1142
1032
|
collapseStringsAfterLength: 99,
|
|
1143
1033
|
collapseStringMode: "directly",
|
|
@@ -1154,12 +1044,12 @@ const Lt = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^
|
|
|
1154
1044
|
forceUpdate: () => {
|
|
1155
1045
|
},
|
|
1156
1046
|
customizeNode: void 0,
|
|
1157
|
-
customizeCopy: () => {
|
|
1158
|
-
},
|
|
1047
|
+
customizeCopy: (() => {
|
|
1048
|
+
}),
|
|
1159
1049
|
displaySize: void 0,
|
|
1160
1050
|
displayArrayIndex: !0,
|
|
1161
1051
|
matchesURL: !1,
|
|
1162
|
-
urlRegExp:
|
|
1052
|
+
urlRegExp: Dt,
|
|
1163
1053
|
ignoreLargeArray: !1,
|
|
1164
1054
|
CopyComponent: void 0,
|
|
1165
1055
|
CopiedComponent: void 0,
|
|
@@ -1168,151 +1058,183 @@ const Lt = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^
|
|
|
1168
1058
|
DoneComponent: void 0,
|
|
1169
1059
|
CustomOperation: void 0
|
|
1170
1060
|
});
|
|
1171
|
-
function
|
|
1172
|
-
const [
|
|
1173
|
-
return Y(() =>
|
|
1174
|
-
src:
|
|
1061
|
+
function Fr({ src: e, collapseStringsAfterLength: t = 99, collapseStringMode: r = "directly", customizeCollapseStringUI: n, collapseObjectsAfterLength: o = 99, collapsed: i, onCollapse: c, enableClipboard: l = !0, editable: g = !1, onEdit: u, onDelete: d, onAdd: v, onChange: E, dark: O = !1, theme: C = "default", customizeNode: _, customizeCopy: f = (z) => Ar(z), displaySize: A, displayArrayIndex: k = !0, style: R, className: w, matchesURL: m = !1, urlRegExp: x = Dt, ignoreLargeArray: y = !1, CopyComponent: F, CopiedComponent: N, EditComponent: S, CancelComponent: L, DoneComponent: D, CustomOperation: H }) {
|
|
1062
|
+
const [z, b] = P(0), T = W(() => b((J) => ++J), []), [M, Z] = P(e);
|
|
1063
|
+
return Y(() => Z(e), [e]), a.jsx(ee.Provider, Object.assign({ value: {
|
|
1064
|
+
src: M,
|
|
1175
1065
|
collapseStringsAfterLength: t,
|
|
1176
1066
|
collapseStringMode: r,
|
|
1177
1067
|
customizeCollapseStringUI: n,
|
|
1178
|
-
collapseObjectsAfterLength:
|
|
1179
|
-
collapsed:
|
|
1068
|
+
collapseObjectsAfterLength: o,
|
|
1069
|
+
collapsed: i,
|
|
1180
1070
|
onCollapse: c,
|
|
1181
1071
|
enableClipboard: l,
|
|
1182
1072
|
editable: g,
|
|
1183
1073
|
onEdit: u,
|
|
1184
1074
|
onDelete: d,
|
|
1185
1075
|
onAdd: v,
|
|
1186
|
-
onChange:
|
|
1187
|
-
forceUpdate:
|
|
1188
|
-
customizeNode:
|
|
1076
|
+
onChange: E,
|
|
1077
|
+
forceUpdate: T,
|
|
1078
|
+
customizeNode: _,
|
|
1189
1079
|
customizeCopy: f,
|
|
1190
|
-
displaySize:
|
|
1191
|
-
displayArrayIndex:
|
|
1080
|
+
displaySize: A,
|
|
1081
|
+
displayArrayIndex: k,
|
|
1192
1082
|
matchesURL: m,
|
|
1193
|
-
urlRegExp:
|
|
1083
|
+
urlRegExp: x,
|
|
1194
1084
|
ignoreLargeArray: y,
|
|
1195
|
-
CopyComponent:
|
|
1196
|
-
CopiedComponent:
|
|
1197
|
-
EditComponent:
|
|
1198
|
-
CancelComponent:
|
|
1199
|
-
DoneComponent:
|
|
1200
|
-
CustomOperation:
|
|
1201
|
-
} }, { children: a.jsx("code", Object.assign({ className: "json-view" + (
|
|
1202
|
-
|
|
1203
|
-
newValue:
|
|
1204
|
-
oldValue:
|
|
1085
|
+
CopyComponent: F,
|
|
1086
|
+
CopiedComponent: N,
|
|
1087
|
+
EditComponent: S,
|
|
1088
|
+
CancelComponent: L,
|
|
1089
|
+
DoneComponent: D,
|
|
1090
|
+
CustomOperation: H
|
|
1091
|
+
} }, { children: a.jsx("code", Object.assign({ className: "json-view" + (O ? " dark" : "") + (C && C !== "default" ? " json-view_" + C : "") + (w ? " " + w : ""), style: R }, { children: a.jsx($t, { node: M, depth: 1, editHandle: (J, I, s, h) => {
|
|
1092
|
+
Z(I), u && u({
|
|
1093
|
+
newValue: I,
|
|
1094
|
+
oldValue: s,
|
|
1205
1095
|
depth: 1,
|
|
1206
|
-
src:
|
|
1207
|
-
indexOrName:
|
|
1096
|
+
src: M,
|
|
1097
|
+
indexOrName: J,
|
|
1208
1098
|
parentType: null,
|
|
1209
|
-
parentPath:
|
|
1210
|
-
}),
|
|
1211
|
-
}, deleteHandle: (
|
|
1212
|
-
|
|
1213
|
-
value:
|
|
1099
|
+
parentPath: h
|
|
1100
|
+
}), E && E({ type: "edit", depth: 1, src: M, indexOrName: J, parentType: null, parentPath: h });
|
|
1101
|
+
}, deleteHandle: (J, I) => {
|
|
1102
|
+
Z(void 0), d && d({
|
|
1103
|
+
value: M,
|
|
1214
1104
|
depth: 1,
|
|
1215
|
-
src:
|
|
1216
|
-
indexOrName:
|
|
1105
|
+
src: M,
|
|
1106
|
+
indexOrName: J,
|
|
1217
1107
|
parentType: null,
|
|
1218
|
-
parentPath:
|
|
1219
|
-
}),
|
|
1108
|
+
parentPath: I
|
|
1109
|
+
}), E && E({
|
|
1220
1110
|
depth: 1,
|
|
1221
|
-
src:
|
|
1222
|
-
indexOrName:
|
|
1111
|
+
src: M,
|
|
1112
|
+
indexOrName: J,
|
|
1223
1113
|
parentType: null,
|
|
1224
1114
|
type: "delete",
|
|
1225
|
-
parentPath:
|
|
1115
|
+
parentPath: I
|
|
1226
1116
|
});
|
|
1227
1117
|
}, parentPath: [] }) })) }));
|
|
1228
1118
|
}
|
|
1229
|
-
const
|
|
1119
|
+
const Ur = ({ state: e }) => /* @__PURE__ */ a.jsx(Fr, { src: e.value, theme: "default" });
|
|
1120
|
+
const zr = [
|
|
1121
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1122
|
+
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
1123
|
+
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
1124
|
+
], Ct = X("circle-alert", zr);
|
|
1125
|
+
const Zr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Jr = X("check", Zr);
|
|
1126
|
+
const Yr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], qr = X("loader-circle", Yr);
|
|
1127
|
+
const Br = [
|
|
1128
|
+
[
|
|
1129
|
+
"path",
|
|
1130
|
+
{
|
|
1131
|
+
d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
|
|
1132
|
+
key: "1c8476"
|
|
1133
|
+
}
|
|
1134
|
+
],
|
|
1135
|
+
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
1136
|
+
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
1137
|
+
], Wr = X("save", Br);
|
|
1138
|
+
function St(e, t) {
|
|
1139
|
+
(t == null || t > e.length) && (t = e.length);
|
|
1140
|
+
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
1141
|
+
return n;
|
|
1142
|
+
}
|
|
1143
|
+
function Kr(e) {
|
|
1144
|
+
if (Array.isArray(e)) return e;
|
|
1145
|
+
}
|
|
1230
1146
|
function Gr(e, t, r) {
|
|
1231
|
-
return t in e ? Object.defineProperty(e, t, {
|
|
1147
|
+
return (t = an(t)) in e ? Object.defineProperty(e, t, {
|
|
1232
1148
|
value: r,
|
|
1233
1149
|
enumerable: !0,
|
|
1234
1150
|
configurable: !0,
|
|
1235
1151
|
writable: !0
|
|
1236
1152
|
}) : e[t] = r, e;
|
|
1237
1153
|
}
|
|
1238
|
-
function
|
|
1154
|
+
function Xr(e, t) {
|
|
1155
|
+
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
1156
|
+
if (r != null) {
|
|
1157
|
+
var n, o, i, c, l = [], g = !0, u = !1;
|
|
1158
|
+
try {
|
|
1159
|
+
if (i = (r = r.call(e)).next, t !== 0) for (; !(g = (n = i.call(r)).done) && (l.push(n.value), l.length !== t); g = !0) ;
|
|
1160
|
+
} catch (d) {
|
|
1161
|
+
u = !0, o = d;
|
|
1162
|
+
} finally {
|
|
1163
|
+
try {
|
|
1164
|
+
if (!g && r.return != null && (c = r.return(), Object(c) !== c)) return;
|
|
1165
|
+
} finally {
|
|
1166
|
+
if (u) throw o;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
return l;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
function Qr() {
|
|
1173
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1174
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1175
|
+
}
|
|
1176
|
+
function Et(e, t) {
|
|
1239
1177
|
var r = Object.keys(e);
|
|
1240
1178
|
if (Object.getOwnPropertySymbols) {
|
|
1241
1179
|
var n = Object.getOwnPropertySymbols(e);
|
|
1242
|
-
t && (n = n.filter(function(
|
|
1243
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
1180
|
+
t && (n = n.filter(function(o) {
|
|
1181
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
1244
1182
|
})), r.push.apply(r, n);
|
|
1245
1183
|
}
|
|
1246
1184
|
return r;
|
|
1247
1185
|
}
|
|
1248
|
-
function
|
|
1186
|
+
function Ot(e) {
|
|
1249
1187
|
for (var t = 1; t < arguments.length; t++) {
|
|
1250
1188
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
1251
|
-
t % 2 ?
|
|
1189
|
+
t % 2 ? Et(Object(r), !0).forEach(function(n) {
|
|
1252
1190
|
Gr(e, n, r[n]);
|
|
1253
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
1191
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Et(Object(r)).forEach(function(n) {
|
|
1254
1192
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
1255
1193
|
});
|
|
1256
1194
|
}
|
|
1257
1195
|
return e;
|
|
1258
1196
|
}
|
|
1259
|
-
function
|
|
1197
|
+
function en(e, t) {
|
|
1260
1198
|
if (e == null) return {};
|
|
1261
|
-
var r
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1199
|
+
var r, n, o = tn(e, t);
|
|
1200
|
+
if (Object.getOwnPropertySymbols) {
|
|
1201
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
1202
|
+
for (n = 0; n < i.length; n++) r = i[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
1203
|
+
}
|
|
1204
|
+
return o;
|
|
1265
1205
|
}
|
|
1266
|
-
function
|
|
1206
|
+
function tn(e, t) {
|
|
1267
1207
|
if (e == null) return {};
|
|
1268
|
-
var r =
|
|
1269
|
-
if (
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
n = o[s], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
|
|
1208
|
+
var r = {};
|
|
1209
|
+
for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
|
|
1210
|
+
if (t.indexOf(n) !== -1) continue;
|
|
1211
|
+
r[n] = e[n];
|
|
1273
1212
|
}
|
|
1274
1213
|
return r;
|
|
1275
1214
|
}
|
|
1276
|
-
function en(e, t) {
|
|
1277
|
-
return tn(e) || rn(e, t) || nn(e, t) || an();
|
|
1278
|
-
}
|
|
1279
|
-
function tn(e) {
|
|
1280
|
-
if (Array.isArray(e)) return e;
|
|
1281
|
-
}
|
|
1282
1215
|
function rn(e, t) {
|
|
1283
|
-
|
|
1284
|
-
var r = [], n = !0, s = !1, o = void 0;
|
|
1285
|
-
try {
|
|
1286
|
-
for (var c = e[Symbol.iterator](), l; !(n = (l = c.next()).done) && (r.push(l.value), !(t && r.length === t)); n = !0)
|
|
1287
|
-
;
|
|
1288
|
-
} catch (g) {
|
|
1289
|
-
s = !0, o = g;
|
|
1290
|
-
} finally {
|
|
1291
|
-
try {
|
|
1292
|
-
!n && c.return != null && c.return();
|
|
1293
|
-
} finally {
|
|
1294
|
-
if (s) throw o;
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
return r;
|
|
1298
|
-
}
|
|
1216
|
+
return Kr(e) || Xr(e, t) || on(e, t) || Qr();
|
|
1299
1217
|
}
|
|
1300
1218
|
function nn(e, t) {
|
|
1301
|
-
if (e)
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
if (
|
|
1219
|
+
if (typeof e != "object" || !e) return e;
|
|
1220
|
+
var r = e[Symbol.toPrimitive];
|
|
1221
|
+
if (r !== void 0) {
|
|
1222
|
+
var n = r.call(e, t);
|
|
1223
|
+
if (typeof n != "object") return n;
|
|
1224
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1306
1225
|
}
|
|
1226
|
+
return (t === "string" ? String : Number)(e);
|
|
1307
1227
|
}
|
|
1308
|
-
function
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
return n;
|
|
1228
|
+
function an(e) {
|
|
1229
|
+
var t = nn(e, "string");
|
|
1230
|
+
return typeof t == "symbol" ? t : t + "";
|
|
1312
1231
|
}
|
|
1313
|
-
function
|
|
1314
|
-
|
|
1315
|
-
|
|
1232
|
+
function on(e, t) {
|
|
1233
|
+
if (e) {
|
|
1234
|
+
if (typeof e == "string") return St(e, t);
|
|
1235
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
1236
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? St(e, t) : void 0;
|
|
1237
|
+
}
|
|
1316
1238
|
}
|
|
1317
1239
|
function sn(e, t, r) {
|
|
1318
1240
|
return t in e ? Object.defineProperty(e, t, {
|
|
@@ -1322,79 +1244,79 @@ function sn(e, t, r) {
|
|
|
1322
1244
|
writable: !0
|
|
1323
1245
|
}) : e[t] = r, e;
|
|
1324
1246
|
}
|
|
1325
|
-
function
|
|
1247
|
+
function kt(e, t) {
|
|
1326
1248
|
var r = Object.keys(e);
|
|
1327
1249
|
if (Object.getOwnPropertySymbols) {
|
|
1328
1250
|
var n = Object.getOwnPropertySymbols(e);
|
|
1329
|
-
t && (n = n.filter(function(
|
|
1330
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
1251
|
+
t && (n = n.filter(function(o) {
|
|
1252
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
1331
1253
|
})), r.push.apply(r, n);
|
|
1332
1254
|
}
|
|
1333
1255
|
return r;
|
|
1334
1256
|
}
|
|
1335
|
-
function
|
|
1257
|
+
function At(e) {
|
|
1336
1258
|
for (var t = 1; t < arguments.length; t++) {
|
|
1337
1259
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
1338
|
-
t % 2 ?
|
|
1260
|
+
t % 2 ? kt(Object(r), !0).forEach(function(n) {
|
|
1339
1261
|
sn(e, n, r[n]);
|
|
1340
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
1262
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : kt(Object(r)).forEach(function(n) {
|
|
1341
1263
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
1342
1264
|
});
|
|
1343
1265
|
}
|
|
1344
1266
|
return e;
|
|
1345
1267
|
}
|
|
1346
|
-
function
|
|
1268
|
+
function cn() {
|
|
1347
1269
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
1348
1270
|
t[r] = arguments[r];
|
|
1349
1271
|
return function(n) {
|
|
1350
|
-
return t.reduceRight(function(
|
|
1351
|
-
return o
|
|
1272
|
+
return t.reduceRight(function(o, i) {
|
|
1273
|
+
return i(o);
|
|
1352
1274
|
}, n);
|
|
1353
1275
|
};
|
|
1354
1276
|
}
|
|
1355
1277
|
function ie(e) {
|
|
1356
1278
|
return function t() {
|
|
1357
|
-
for (var r = this, n = arguments.length,
|
|
1358
|
-
|
|
1359
|
-
return
|
|
1279
|
+
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
1280
|
+
o[i] = arguments[i];
|
|
1281
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
1360
1282
|
for (var c = arguments.length, l = new Array(c), g = 0; g < c; g++)
|
|
1361
1283
|
l[g] = arguments[g];
|
|
1362
|
-
return t.apply(r, [].concat(
|
|
1284
|
+
return t.apply(r, [].concat(o, l));
|
|
1363
1285
|
};
|
|
1364
1286
|
};
|
|
1365
1287
|
}
|
|
1366
|
-
function
|
|
1288
|
+
function be(e) {
|
|
1367
1289
|
return {}.toString.call(e).includes("Object");
|
|
1368
1290
|
}
|
|
1369
|
-
function
|
|
1291
|
+
function ln(e) {
|
|
1370
1292
|
return !Object.keys(e).length;
|
|
1371
1293
|
}
|
|
1372
1294
|
function de(e) {
|
|
1373
1295
|
return typeof e == "function";
|
|
1374
1296
|
}
|
|
1375
|
-
function
|
|
1297
|
+
function un(e, t) {
|
|
1376
1298
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
1377
1299
|
}
|
|
1378
|
-
function
|
|
1379
|
-
return
|
|
1380
|
-
return !
|
|
1300
|
+
function dn(e, t) {
|
|
1301
|
+
return be(t) || G("changeType"), Object.keys(t).some(function(r) {
|
|
1302
|
+
return !un(e, r);
|
|
1381
1303
|
}) && G("changeField"), t;
|
|
1382
1304
|
}
|
|
1383
|
-
function
|
|
1305
|
+
function fn(e) {
|
|
1384
1306
|
de(e) || G("selectorType");
|
|
1385
1307
|
}
|
|
1386
|
-
function
|
|
1387
|
-
de(e) ||
|
|
1308
|
+
function pn(e) {
|
|
1309
|
+
de(e) || be(e) || G("handlerType"), be(e) && Object.values(e).some(function(t) {
|
|
1388
1310
|
return !de(t);
|
|
1389
1311
|
}) && G("handlersType");
|
|
1390
1312
|
}
|
|
1391
|
-
function
|
|
1392
|
-
e || G("initialIsRequired"),
|
|
1313
|
+
function gn(e) {
|
|
1314
|
+
e || G("initialIsRequired"), be(e) || G("initialType"), ln(e) && G("initialContent");
|
|
1393
1315
|
}
|
|
1394
|
-
function
|
|
1316
|
+
function hn(e, t) {
|
|
1395
1317
|
throw new Error(e[t] || e.default);
|
|
1396
1318
|
}
|
|
1397
|
-
var
|
|
1319
|
+
var vn = {
|
|
1398
1320
|
initialIsRequired: "initial state is required",
|
|
1399
1321
|
initialType: "initial state should be an object",
|
|
1400
1322
|
initialContent: "initial state shouldn't be an empty object",
|
|
@@ -1404,18 +1326,18 @@ var hn = {
|
|
|
1404
1326
|
changeType: "provided value of changes should be an object",
|
|
1405
1327
|
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
1406
1328
|
default: "an unknown error accured in `state-local` package"
|
|
1407
|
-
}, G = ie(
|
|
1408
|
-
changes:
|
|
1409
|
-
selector:
|
|
1410
|
-
handler:
|
|
1411
|
-
initial:
|
|
1329
|
+
}, G = ie(hn)(vn), ve = {
|
|
1330
|
+
changes: dn,
|
|
1331
|
+
selector: fn,
|
|
1332
|
+
handler: pn,
|
|
1333
|
+
initial: gn
|
|
1412
1334
|
};
|
|
1413
|
-
function
|
|
1335
|
+
function mn(e) {
|
|
1414
1336
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1415
1337
|
ve.initial(e), ve.handler(t);
|
|
1416
1338
|
var r = {
|
|
1417
1339
|
current: e
|
|
1418
|
-
}, n = ie(jn)(r, t),
|
|
1340
|
+
}, n = ie(jn)(r, t), o = ie(bn)(r), i = ie(ve.changes)(e), c = ie(yn)(r);
|
|
1419
1341
|
function l() {
|
|
1420
1342
|
var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(d) {
|
|
1421
1343
|
return d;
|
|
@@ -1423,57 +1345,57 @@ function vn(e) {
|
|
|
1423
1345
|
return ve.selector(u), u(r.current);
|
|
1424
1346
|
}
|
|
1425
1347
|
function g(u) {
|
|
1426
|
-
|
|
1348
|
+
cn(n, o, i, c)(u);
|
|
1427
1349
|
}
|
|
1428
1350
|
return [l, g];
|
|
1429
1351
|
}
|
|
1430
|
-
function
|
|
1352
|
+
function yn(e, t) {
|
|
1431
1353
|
return de(t) ? t(e.current) : t;
|
|
1432
1354
|
}
|
|
1433
|
-
function
|
|
1434
|
-
return e.current =
|
|
1355
|
+
function bn(e, t) {
|
|
1356
|
+
return e.current = At(At({}, e.current), t), t;
|
|
1435
1357
|
}
|
|
1436
1358
|
function jn(e, t, r) {
|
|
1437
1359
|
return de(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
|
|
1438
|
-
var
|
|
1439
|
-
return (
|
|
1360
|
+
var o;
|
|
1361
|
+
return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
|
|
1440
1362
|
}), r;
|
|
1441
1363
|
}
|
|
1442
|
-
var
|
|
1443
|
-
create:
|
|
1444
|
-
},
|
|
1364
|
+
var wn = {
|
|
1365
|
+
create: mn
|
|
1366
|
+
}, xn = {
|
|
1445
1367
|
paths: {
|
|
1446
|
-
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.
|
|
1368
|
+
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"
|
|
1447
1369
|
}
|
|
1448
1370
|
};
|
|
1449
|
-
function
|
|
1371
|
+
function Cn(e) {
|
|
1450
1372
|
return function t() {
|
|
1451
|
-
for (var r = this, n = arguments.length,
|
|
1452
|
-
|
|
1453
|
-
return
|
|
1373
|
+
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
1374
|
+
o[i] = arguments[i];
|
|
1375
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
1454
1376
|
for (var c = arguments.length, l = new Array(c), g = 0; g < c; g++)
|
|
1455
1377
|
l[g] = arguments[g];
|
|
1456
|
-
return t.apply(r, [].concat(
|
|
1378
|
+
return t.apply(r, [].concat(o, l));
|
|
1457
1379
|
};
|
|
1458
1380
|
};
|
|
1459
1381
|
}
|
|
1460
|
-
function
|
|
1382
|
+
function Sn(e) {
|
|
1461
1383
|
return {}.toString.call(e).includes("Object");
|
|
1462
1384
|
}
|
|
1463
|
-
function
|
|
1464
|
-
return e ||
|
|
1385
|
+
function En(e) {
|
|
1386
|
+
return e || Nt("configIsRequired"), Sn(e) || Nt("configType"), e.urls ? (On(), {
|
|
1465
1387
|
paths: {
|
|
1466
1388
|
vs: e.urls.monacoBase
|
|
1467
1389
|
}
|
|
1468
1390
|
}) : e;
|
|
1469
1391
|
}
|
|
1470
1392
|
function On() {
|
|
1471
|
-
console.warn(
|
|
1393
|
+
console.warn(Lt.deprecation);
|
|
1472
1394
|
}
|
|
1473
|
-
function
|
|
1395
|
+
function kn(e, t) {
|
|
1474
1396
|
throw new Error(e[t] || e.default);
|
|
1475
1397
|
}
|
|
1476
|
-
var
|
|
1398
|
+
var Lt = {
|
|
1477
1399
|
configIsRequired: "the configuration object is required",
|
|
1478
1400
|
configType: "the configuration object should be an object",
|
|
1479
1401
|
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
@@ -1487,293 +1409,294 @@ var Vt = {
|
|
|
1487
1409
|
|
|
1488
1410
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
1489
1411
|
`
|
|
1490
|
-
},
|
|
1491
|
-
config:
|
|
1492
|
-
},
|
|
1412
|
+
}, Nt = Cn(kn)(Lt), An = {
|
|
1413
|
+
config: En
|
|
1414
|
+
}, Nn = function() {
|
|
1493
1415
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
1494
1416
|
r[n] = arguments[n];
|
|
1495
|
-
return function(
|
|
1496
|
-
return r.reduceRight(function(
|
|
1497
|
-
return c(
|
|
1498
|
-
},
|
|
1417
|
+
return function(o) {
|
|
1418
|
+
return r.reduceRight(function(i, c) {
|
|
1419
|
+
return c(i);
|
|
1420
|
+
}, o);
|
|
1499
1421
|
};
|
|
1500
1422
|
};
|
|
1501
|
-
function
|
|
1423
|
+
function Vt(e, t) {
|
|
1502
1424
|
return Object.keys(t).forEach(function(r) {
|
|
1503
|
-
t[r] instanceof Object && e[r] && Object.assign(t[r],
|
|
1504
|
-
}),
|
|
1425
|
+
t[r] instanceof Object && e[r] && Object.assign(t[r], Vt(e[r], t[r]));
|
|
1426
|
+
}), Ot(Ot({}, e), t);
|
|
1505
1427
|
}
|
|
1506
|
-
var
|
|
1428
|
+
var _n = {
|
|
1507
1429
|
type: "cancelation",
|
|
1508
1430
|
msg: "operation is manually canceled"
|
|
1509
1431
|
};
|
|
1510
|
-
function
|
|
1511
|
-
var t = !1, r = new Promise(function(n,
|
|
1512
|
-
e.then(function(
|
|
1513
|
-
return t ?
|
|
1514
|
-
}), e.catch(
|
|
1432
|
+
function Oe(e) {
|
|
1433
|
+
var t = !1, r = new Promise(function(n, o) {
|
|
1434
|
+
e.then(function(i) {
|
|
1435
|
+
return t ? o(_n) : n(i);
|
|
1436
|
+
}), e.catch(o);
|
|
1515
1437
|
});
|
|
1516
1438
|
return r.cancel = function() {
|
|
1517
1439
|
return t = !0;
|
|
1518
1440
|
}, r;
|
|
1519
1441
|
}
|
|
1520
|
-
var Tn =
|
|
1521
|
-
config:
|
|
1442
|
+
var Tn = ["monaco"], Rn = wn.create({
|
|
1443
|
+
config: xn,
|
|
1522
1444
|
isInitialized: !1,
|
|
1523
1445
|
resolve: null,
|
|
1524
1446
|
reject: null,
|
|
1525
1447
|
monaco: null
|
|
1526
|
-
}),
|
|
1527
|
-
function
|
|
1528
|
-
var t =
|
|
1529
|
-
Ce(function(
|
|
1448
|
+
}), Ht = rn(Rn, 2), fe = Ht[0], Ce = Ht[1];
|
|
1449
|
+
function Mn(e) {
|
|
1450
|
+
var t = An.config(e), r = t.monaco, n = en(t, Tn);
|
|
1451
|
+
Ce(function(o) {
|
|
1530
1452
|
return {
|
|
1531
|
-
config:
|
|
1453
|
+
config: Vt(o.config, n),
|
|
1532
1454
|
monaco: r
|
|
1533
1455
|
};
|
|
1534
1456
|
});
|
|
1535
1457
|
}
|
|
1536
|
-
function
|
|
1458
|
+
function In() {
|
|
1537
1459
|
var e = fe(function(t) {
|
|
1538
|
-
var r = t.monaco, n = t.isInitialized,
|
|
1460
|
+
var r = t.monaco, n = t.isInitialized, o = t.resolve;
|
|
1539
1461
|
return {
|
|
1540
1462
|
monaco: r,
|
|
1541
1463
|
isInitialized: n,
|
|
1542
|
-
resolve:
|
|
1464
|
+
resolve: o
|
|
1543
1465
|
};
|
|
1544
1466
|
});
|
|
1545
1467
|
if (!e.isInitialized) {
|
|
1546
1468
|
if (Ce({
|
|
1547
1469
|
isInitialized: !0
|
|
1548
1470
|
}), e.monaco)
|
|
1549
|
-
return e.resolve(e.monaco), ke
|
|
1471
|
+
return e.resolve(e.monaco), Oe(ke);
|
|
1550
1472
|
if (window.monaco && window.monaco.editor)
|
|
1551
|
-
return
|
|
1552
|
-
|
|
1473
|
+
return Ft(window.monaco), e.resolve(window.monaco), Oe(ke);
|
|
1474
|
+
Nn(Pn, Dn)(Ln);
|
|
1553
1475
|
}
|
|
1554
|
-
return ke
|
|
1476
|
+
return Oe(ke);
|
|
1555
1477
|
}
|
|
1556
|
-
function
|
|
1478
|
+
function Pn(e) {
|
|
1557
1479
|
return document.body.appendChild(e);
|
|
1558
1480
|
}
|
|
1559
|
-
function
|
|
1481
|
+
function $n(e) {
|
|
1560
1482
|
var t = document.createElement("script");
|
|
1561
1483
|
return e && (t.src = e), t;
|
|
1562
1484
|
}
|
|
1563
|
-
function
|
|
1485
|
+
function Dn(e) {
|
|
1564
1486
|
var t = fe(function(n) {
|
|
1565
|
-
var
|
|
1487
|
+
var o = n.config, i = n.reject;
|
|
1566
1488
|
return {
|
|
1567
|
-
config:
|
|
1568
|
-
reject:
|
|
1489
|
+
config: o,
|
|
1490
|
+
reject: i
|
|
1569
1491
|
};
|
|
1570
|
-
}), r =
|
|
1492
|
+
}), r = $n("".concat(t.config.paths.vs, "/loader.js"));
|
|
1571
1493
|
return r.onload = function() {
|
|
1572
1494
|
return e();
|
|
1573
1495
|
}, r.onerror = t.reject, r;
|
|
1574
1496
|
}
|
|
1575
|
-
function
|
|
1497
|
+
function Ln() {
|
|
1576
1498
|
var e = fe(function(r) {
|
|
1577
|
-
var n = r.config,
|
|
1499
|
+
var n = r.config, o = r.resolve, i = r.reject;
|
|
1578
1500
|
return {
|
|
1579
1501
|
config: n,
|
|
1580
|
-
resolve:
|
|
1581
|
-
reject:
|
|
1502
|
+
resolve: o,
|
|
1503
|
+
reject: i
|
|
1582
1504
|
};
|
|
1583
1505
|
}), t = window.require;
|
|
1584
1506
|
t.config(e.config), t(["vs/editor/editor.main"], function(r) {
|
|
1585
|
-
|
|
1507
|
+
var n = r.m;
|
|
1508
|
+
Ft(n), e.resolve(n);
|
|
1586
1509
|
}, function(r) {
|
|
1587
1510
|
e.reject(r);
|
|
1588
1511
|
});
|
|
1589
1512
|
}
|
|
1590
|
-
function
|
|
1513
|
+
function Ft(e) {
|
|
1591
1514
|
fe().monaco || Ce({
|
|
1592
1515
|
monaco: e
|
|
1593
1516
|
});
|
|
1594
1517
|
}
|
|
1595
|
-
function
|
|
1518
|
+
function Vn() {
|
|
1596
1519
|
return fe(function(e) {
|
|
1597
1520
|
var t = e.monaco;
|
|
1598
1521
|
return t;
|
|
1599
1522
|
});
|
|
1600
1523
|
}
|
|
1601
|
-
var
|
|
1524
|
+
var ke = new Promise(function(e, t) {
|
|
1602
1525
|
return Ce({
|
|
1603
1526
|
resolve: e,
|
|
1604
1527
|
reject: t
|
|
1605
1528
|
});
|
|
1606
|
-
}),
|
|
1607
|
-
config:
|
|
1608
|
-
init:
|
|
1609
|
-
__getMonacoInstance:
|
|
1610
|
-
},
|
|
1611
|
-
function
|
|
1612
|
-
return
|
|
1613
|
-
}
|
|
1614
|
-
var
|
|
1615
|
-
function
|
|
1616
|
-
return
|
|
1617
|
-
}
|
|
1618
|
-
var
|
|
1619
|
-
function
|
|
1529
|
+
}), je = {
|
|
1530
|
+
config: Mn,
|
|
1531
|
+
init: In,
|
|
1532
|
+
__getMonacoInstance: Vn
|
|
1533
|
+
}, Hn = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, Ae = Hn, Fn = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Un = Fn;
|
|
1534
|
+
function zn({ children: e }) {
|
|
1535
|
+
return B.createElement("div", { style: Un.container }, e);
|
|
1536
|
+
}
|
|
1537
|
+
var Zn = zn, Jn = Zn;
|
|
1538
|
+
function Yn({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: c }) {
|
|
1539
|
+
return B.createElement("section", { style: { ...Ae.wrapper, width: e, height: t }, ...c }, !r && B.createElement(Jn, null, n), B.createElement("div", { ref: o, style: { ...Ae.fullWidth, ...!r && Ae.hide }, className: i }));
|
|
1540
|
+
}
|
|
1541
|
+
var qn = Yn, Ut = He(qn);
|
|
1542
|
+
function Bn(e) {
|
|
1620
1543
|
Y(e, []);
|
|
1621
1544
|
}
|
|
1622
|
-
var
|
|
1623
|
-
function
|
|
1545
|
+
var Be = Bn;
|
|
1546
|
+
function Wn(e, t, r = !0) {
|
|
1624
1547
|
let n = V(!0);
|
|
1625
1548
|
Y(n.current || !r ? () => {
|
|
1626
1549
|
n.current = !1;
|
|
1627
1550
|
} : e, t);
|
|
1628
1551
|
}
|
|
1629
|
-
var
|
|
1552
|
+
var q = Wn;
|
|
1630
1553
|
function le() {
|
|
1631
1554
|
}
|
|
1632
1555
|
function ne(e, t, r, n) {
|
|
1633
|
-
return
|
|
1556
|
+
return Kn(e, n) || Gn(e, t, r, n);
|
|
1634
1557
|
}
|
|
1635
|
-
function
|
|
1636
|
-
return e.editor.getModel(
|
|
1558
|
+
function Kn(e, t) {
|
|
1559
|
+
return e.editor.getModel(zt(e, t));
|
|
1637
1560
|
}
|
|
1638
|
-
function
|
|
1639
|
-
return e.editor.createModel(t, r, n ?
|
|
1561
|
+
function Gn(e, t, r, n) {
|
|
1562
|
+
return e.editor.createModel(t, r, n ? zt(e, n) : void 0);
|
|
1640
1563
|
}
|
|
1641
|
-
function
|
|
1564
|
+
function zt(e, t) {
|
|
1642
1565
|
return e.Uri.parse(t);
|
|
1643
1566
|
}
|
|
1644
|
-
function
|
|
1645
|
-
let [
|
|
1646
|
-
|
|
1647
|
-
let
|
|
1648
|
-
return
|
|
1649
|
-
}),
|
|
1650
|
-
if (
|
|
1651
|
-
let
|
|
1652
|
-
|
|
1567
|
+
function Xn({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: c, keepCurrentOriginalModel: l = !1, keepCurrentModifiedModel: g = !1, theme: u = "light", loading: d = "Loading...", options: v = {}, height: E = "100%", width: O = "100%", className: C, wrapperProps: _ = {}, beforeMount: f = le, onMount: A = le }) {
|
|
1568
|
+
let [k, R] = P(!1), [w, m] = P(!0), x = V(null), y = V(null), F = V(null), N = V(A), S = V(f), L = V(!1);
|
|
1569
|
+
Be(() => {
|
|
1570
|
+
let b = je.init();
|
|
1571
|
+
return b.then((T) => (y.current = T) && m(!1)).catch((T) => T?.type !== "cancelation" && console.error("Monaco initialization: error:", T)), () => x.current ? z() : b.cancel();
|
|
1572
|
+
}), q(() => {
|
|
1573
|
+
if (x.current && y.current) {
|
|
1574
|
+
let b = x.current.getOriginalEditor(), T = ne(y.current, e || "", n || r || "text", i || "");
|
|
1575
|
+
T !== b.getModel() && b.setModel(T);
|
|
1653
1576
|
}
|
|
1654
|
-
}, [
|
|
1655
|
-
if (
|
|
1656
|
-
let
|
|
1657
|
-
|
|
1577
|
+
}, [i], k), q(() => {
|
|
1578
|
+
if (x.current && y.current) {
|
|
1579
|
+
let b = x.current.getModifiedEditor(), T = ne(y.current, t || "", o || r || "text", c || "");
|
|
1580
|
+
T !== b.getModel() && b.setModel(T);
|
|
1658
1581
|
}
|
|
1659
|
-
}, [c],
|
|
1660
|
-
let
|
|
1661
|
-
|
|
1662
|
-
}, [t],
|
|
1663
|
-
|
|
1664
|
-
}, [e],
|
|
1665
|
-
let { original:
|
|
1666
|
-
y.current.editor.setModelLanguage(
|
|
1667
|
-
}, [r, n,
|
|
1582
|
+
}, [c], k), q(() => {
|
|
1583
|
+
let b = x.current.getModifiedEditor();
|
|
1584
|
+
b.getOption(y.current.editor.EditorOption.readOnly) ? b.setValue(t || "") : t !== b.getValue() && (b.executeEdits("", [{ range: b.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), b.pushUndoStop());
|
|
1585
|
+
}, [t], k), q(() => {
|
|
1586
|
+
x.current?.getModel()?.original.setValue(e || "");
|
|
1587
|
+
}, [e], k), q(() => {
|
|
1588
|
+
let { original: b, modified: T } = x.current.getModel();
|
|
1589
|
+
y.current.editor.setModelLanguage(b, n || r || "text"), y.current.editor.setModelLanguage(T, o || r || "text");
|
|
1590
|
+
}, [r, n, o], k), q(() => {
|
|
1668
1591
|
y.current?.editor.setTheme(u);
|
|
1669
|
-
}, [u],
|
|
1670
|
-
|
|
1671
|
-
}, [v],
|
|
1672
|
-
let
|
|
1592
|
+
}, [u], k), q(() => {
|
|
1593
|
+
x.current?.updateOptions(v);
|
|
1594
|
+
}, [v], k);
|
|
1595
|
+
let D = W(() => {
|
|
1673
1596
|
if (!y.current) return;
|
|
1674
|
-
|
|
1675
|
-
let
|
|
1676
|
-
|
|
1677
|
-
}, [r, t,
|
|
1678
|
-
|
|
1679
|
-
}, [v, u,
|
|
1597
|
+
S.current(y.current);
|
|
1598
|
+
let b = ne(y.current, e || "", n || r || "text", i || ""), T = ne(y.current, t || "", o || r || "text", c || "");
|
|
1599
|
+
x.current?.setModel({ original: b, modified: T });
|
|
1600
|
+
}, [r, t, o, e, n, i, c]), H = W(() => {
|
|
1601
|
+
!L.current && F.current && (x.current = y.current.editor.createDiffEditor(F.current, { automaticLayout: !0, ...v }), D(), y.current?.editor.setTheme(u), R(!0), L.current = !0);
|
|
1602
|
+
}, [v, u, D]);
|
|
1680
1603
|
Y(() => {
|
|
1681
|
-
|
|
1682
|
-
}, [
|
|
1683
|
-
!
|
|
1684
|
-
}, [
|
|
1685
|
-
function
|
|
1686
|
-
let
|
|
1687
|
-
l ||
|
|
1604
|
+
k && N.current(x.current, y.current);
|
|
1605
|
+
}, [k]), Y(() => {
|
|
1606
|
+
!w && !k && H();
|
|
1607
|
+
}, [w, k, H]);
|
|
1608
|
+
function z() {
|
|
1609
|
+
let b = x.current?.getModel();
|
|
1610
|
+
l || b?.original?.dispose(), g || b?.modified?.dispose(), x.current?.dispose();
|
|
1688
1611
|
}
|
|
1689
|
-
return
|
|
1612
|
+
return B.createElement(Ut, { width: O, height: E, isEditorReady: k, loading: d, _ref: F, className: C, wrapperProps: _ });
|
|
1690
1613
|
}
|
|
1691
|
-
var
|
|
1692
|
-
|
|
1693
|
-
function
|
|
1694
|
-
let [e, t] = P(
|
|
1695
|
-
return
|
|
1614
|
+
var Qn = Xn;
|
|
1615
|
+
He(Qn);
|
|
1616
|
+
function ea() {
|
|
1617
|
+
let [e, t] = P(je.__getMonacoInstance());
|
|
1618
|
+
return Be(() => {
|
|
1696
1619
|
let r;
|
|
1697
|
-
return e || (r =
|
|
1620
|
+
return e || (r = je.init(), r.then((n) => {
|
|
1698
1621
|
t(n);
|
|
1699
1622
|
})), () => r?.cancel();
|
|
1700
1623
|
}), e;
|
|
1701
1624
|
}
|
|
1702
|
-
var
|
|
1703
|
-
function
|
|
1625
|
+
var ta = ea;
|
|
1626
|
+
function ra(e) {
|
|
1704
1627
|
let t = V();
|
|
1705
1628
|
return Y(() => {
|
|
1706
1629
|
t.current = e;
|
|
1707
1630
|
}, [e]), t.current;
|
|
1708
1631
|
}
|
|
1709
|
-
var
|
|
1710
|
-
function
|
|
1711
|
-
let [m,
|
|
1712
|
-
|
|
1713
|
-
let
|
|
1714
|
-
return
|
|
1715
|
-
}),
|
|
1716
|
-
let
|
|
1717
|
-
|
|
1718
|
-
}, [
|
|
1719
|
-
|
|
1720
|
-
}, [u], m),
|
|
1721
|
-
!
|
|
1722
|
-
}, [n], m),
|
|
1723
|
-
let
|
|
1724
|
-
|
|
1725
|
-
}, [
|
|
1726
|
-
l !== void 0 &&
|
|
1727
|
-
}, [l], m),
|
|
1728
|
-
|
|
1632
|
+
var na = ra, me = /* @__PURE__ */ new Map();
|
|
1633
|
+
function aa({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: c = "light", line: l, loading: g = "Loading...", options: u = {}, overrideServices: d = {}, saveViewState: v = !0, keepCurrentModel: E = !1, width: O = "100%", height: C = "100%", className: _, wrapperProps: f = {}, beforeMount: A = le, onMount: k = le, onChange: R, onValidate: w = le }) {
|
|
1634
|
+
let [m, x] = P(!1), [y, F] = P(!0), N = V(null), S = V(null), L = V(null), D = V(k), H = V(A), z = V(), b = V(n), T = na(i), M = V(!1), Z = V(!1);
|
|
1635
|
+
Be(() => {
|
|
1636
|
+
let s = je.init();
|
|
1637
|
+
return s.then((h) => (N.current = h) && F(!1)).catch((h) => h?.type !== "cancelation" && console.error("Monaco initialization: error:", h)), () => S.current ? I() : s.cancel();
|
|
1638
|
+
}), q(() => {
|
|
1639
|
+
let s = ne(N.current, e || n || "", t || o || "", i || r || "");
|
|
1640
|
+
s !== S.current?.getModel() && (v && me.set(T, S.current?.saveViewState()), S.current?.setModel(s), v && S.current?.restoreViewState(me.get(i)));
|
|
1641
|
+
}, [i], m), q(() => {
|
|
1642
|
+
S.current?.updateOptions(u);
|
|
1643
|
+
}, [u], m), q(() => {
|
|
1644
|
+
!S.current || n === void 0 || (S.current.getOption(N.current.editor.EditorOption.readOnly) ? S.current.setValue(n) : n !== S.current.getValue() && (Z.current = !0, S.current.executeEdits("", [{ range: S.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), S.current.pushUndoStop(), Z.current = !1));
|
|
1645
|
+
}, [n], m), q(() => {
|
|
1646
|
+
let s = S.current?.getModel();
|
|
1647
|
+
s && o && N.current?.editor.setModelLanguage(s, o);
|
|
1648
|
+
}, [o], m), q(() => {
|
|
1649
|
+
l !== void 0 && S.current?.revealLine(l);
|
|
1650
|
+
}, [l], m), q(() => {
|
|
1651
|
+
N.current?.editor.setTheme(c);
|
|
1729
1652
|
}, [c], m);
|
|
1730
|
-
let
|
|
1731
|
-
if (!(
|
|
1732
|
-
|
|
1733
|
-
let
|
|
1734
|
-
|
|
1653
|
+
let J = W(() => {
|
|
1654
|
+
if (!(!L.current || !N.current) && !M.current) {
|
|
1655
|
+
H.current(N.current);
|
|
1656
|
+
let s = i || r, h = ne(N.current, n || e || "", t || o || "", s || "");
|
|
1657
|
+
S.current = N.current?.editor.create(L.current, { model: h, automaticLayout: !0, ...u }, d), v && S.current.restoreViewState(me.get(s)), N.current.editor.setTheme(c), l !== void 0 && S.current.revealLine(l), x(!0), M.current = !0;
|
|
1735
1658
|
}
|
|
1736
|
-
}, [e, t, r, n,
|
|
1659
|
+
}, [e, t, r, n, o, i, u, d, v, c, l]);
|
|
1737
1660
|
Y(() => {
|
|
1738
|
-
m &&
|
|
1661
|
+
m && D.current(S.current, N.current);
|
|
1739
1662
|
}, [m]), Y(() => {
|
|
1740
|
-
!y && !m &&
|
|
1741
|
-
}, [y, m,
|
|
1742
|
-
m &&
|
|
1743
|
-
|
|
1663
|
+
!y && !m && J();
|
|
1664
|
+
}, [y, m, J]), b.current = n, Y(() => {
|
|
1665
|
+
m && R && (z.current?.dispose(), z.current = S.current?.onDidChangeModelContent((s) => {
|
|
1666
|
+
Z.current || R(S.current.getValue(), s);
|
|
1744
1667
|
}));
|
|
1745
|
-
}, [m,
|
|
1668
|
+
}, [m, R]), Y(() => {
|
|
1746
1669
|
if (m) {
|
|
1747
|
-
let
|
|
1748
|
-
let
|
|
1749
|
-
if (
|
|
1750
|
-
let
|
|
1751
|
-
|
|
1670
|
+
let s = N.current.editor.onDidChangeMarkers((h) => {
|
|
1671
|
+
let p = S.current.getModel()?.uri;
|
|
1672
|
+
if (p && h.find((j) => j.path === p.path)) {
|
|
1673
|
+
let j = N.current.editor.getModelMarkers({ resource: p });
|
|
1674
|
+
w?.(j);
|
|
1752
1675
|
}
|
|
1753
1676
|
});
|
|
1754
1677
|
return () => {
|
|
1755
|
-
|
|
1678
|
+
s?.dispose();
|
|
1756
1679
|
};
|
|
1757
1680
|
}
|
|
1758
1681
|
return () => {
|
|
1759
1682
|
};
|
|
1760
|
-
}, [m,
|
|
1761
|
-
function
|
|
1762
|
-
|
|
1683
|
+
}, [m, w]);
|
|
1684
|
+
function I() {
|
|
1685
|
+
z.current?.dispose(), E ? v && me.set(i, S.current.saveViewState()) : S.current.getModel()?.dispose(), S.current.dispose();
|
|
1763
1686
|
}
|
|
1764
|
-
return
|
|
1687
|
+
return B.createElement(Ut, { width: O, height: C, isEditorReady: m, loading: g, _ref: L, className: _, wrapperProps: f });
|
|
1765
1688
|
}
|
|
1766
|
-
var
|
|
1767
|
-
const
|
|
1689
|
+
var oa = aa, sa = He(oa), ia = sa;
|
|
1690
|
+
const ca = ({
|
|
1768
1691
|
value: e,
|
|
1769
1692
|
height: t = 300,
|
|
1770
1693
|
schema: r,
|
|
1771
1694
|
onChange: n,
|
|
1772
|
-
onValidate:
|
|
1773
|
-
language:
|
|
1695
|
+
onValidate: o,
|
|
1696
|
+
language: i = "json",
|
|
1774
1697
|
readOnly: c = !1
|
|
1775
1698
|
}) => {
|
|
1776
|
-
const l =
|
|
1699
|
+
const l = ta(), g = qt((d) => d.theme), u = ue(() => g === "dark" ? "vs-dark" : "light", [g]);
|
|
1777
1700
|
return Y(() => {
|
|
1778
1701
|
l && (l.languages.typescript.javascriptDefaults.setCompilerOptions({ isolatedModules: !0 }), l.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1779
1702
|
schemas: r ? [
|
|
@@ -1784,18 +1707,18 @@ const oa = ({
|
|
|
1784
1707
|
}
|
|
1785
1708
|
] : []
|
|
1786
1709
|
}));
|
|
1787
|
-
}, [l, r,
|
|
1788
|
-
|
|
1710
|
+
}, [l, r, i]), /* @__PURE__ */ a.jsx(
|
|
1711
|
+
ia,
|
|
1789
1712
|
{
|
|
1790
1713
|
"data-testid": "json-editor",
|
|
1791
1714
|
height: t,
|
|
1792
|
-
language:
|
|
1715
|
+
language: i,
|
|
1793
1716
|
value: e,
|
|
1794
1717
|
theme: u,
|
|
1795
1718
|
onChange: (d) => {
|
|
1796
|
-
d ||
|
|
1719
|
+
d || o?.(!1), n?.(d ?? "");
|
|
1797
1720
|
},
|
|
1798
|
-
onValidate: (d) =>
|
|
1721
|
+
onValidate: (d) => o?.(d.length === 0),
|
|
1799
1722
|
options: {
|
|
1800
1723
|
readOnly: c,
|
|
1801
1724
|
scrollBeyondLastLine: !1,
|
|
@@ -1803,14 +1726,14 @@ const oa = ({
|
|
|
1803
1726
|
}
|
|
1804
1727
|
}
|
|
1805
1728
|
);
|
|
1806
|
-
},
|
|
1807
|
-
const [t, r] = P(!1), [n,
|
|
1729
|
+
}, la = ({ state: e }) => {
|
|
1730
|
+
const [t, r] = P(!1), [n, o] = P(!0), [i, c] = P(JSON.stringify(e.value, null, 2)), [l, g] = P(!1), [u, d] = P("idle"), v = V(JSON.stringify(e.value, null, 2));
|
|
1808
1731
|
Y(() => {
|
|
1809
1732
|
c(JSON.stringify(e.value, null, 2));
|
|
1810
1733
|
}, [e.value]);
|
|
1811
|
-
const
|
|
1734
|
+
const E = W((f) => {
|
|
1812
1735
|
g(f !== v.current), c(f), d("idle");
|
|
1813
|
-
}, []),
|
|
1736
|
+
}, []), O = async () => {
|
|
1814
1737
|
if (!(!n || !l))
|
|
1815
1738
|
try {
|
|
1816
1739
|
r(!0), d("idle");
|
|
@@ -1822,12 +1745,12 @@ const oa = ({
|
|
|
1822
1745
|
body: JSON.stringify({
|
|
1823
1746
|
key: e.key,
|
|
1824
1747
|
groupId: e.groupId,
|
|
1825
|
-
value: JSON.parse(
|
|
1748
|
+
value: JSON.parse(i)
|
|
1826
1749
|
})
|
|
1827
1750
|
});
|
|
1828
1751
|
if (!f.ok)
|
|
1829
1752
|
throw new Error(`HTTP error! status: ${f.status}`);
|
|
1830
|
-
v.current =
|
|
1753
|
+
v.current = i, d("success"), g(!1), setTimeout(() => {
|
|
1831
1754
|
d("idle");
|
|
1832
1755
|
}, 3e3);
|
|
1833
1756
|
} catch (f) {
|
|
@@ -1835,13 +1758,13 @@ const oa = ({
|
|
|
1835
1758
|
} finally {
|
|
1836
1759
|
r(!1);
|
|
1837
1760
|
}
|
|
1838
|
-
},
|
|
1761
|
+
}, C = W(() => {
|
|
1839
1762
|
c(JSON.stringify(e.value, null, 2)), g(!1), d("idle");
|
|
1840
|
-
}, [e.value]),
|
|
1841
|
-
/* @__PURE__ */ a.jsx(
|
|
1763
|
+
}, [e.value]), _ = ue(() => u === "success" ? /* @__PURE__ */ a.jsx("div", { className: "bg-green-50 dark:bg-green-950/20 border border-green-200 dark:border-green-800 rounded-lg p-2", children: /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 text-green-700 dark:text-green-400 text-sm", children: [
|
|
1764
|
+
/* @__PURE__ */ a.jsx(Jr, { className: "w-4 h-4" }),
|
|
1842
1765
|
"State saved successfully!"
|
|
1843
1766
|
] }) }) : u === "error" ? /* @__PURE__ */ a.jsx("div", { className: "bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 rounded-lg p-2", children: /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 text-red-700 dark:text-red-400 text-sm", children: [
|
|
1844
|
-
/* @__PURE__ */ a.jsx(
|
|
1767
|
+
/* @__PURE__ */ a.jsx(Ct, { className: "w-4 h-4" }),
|
|
1845
1768
|
"Failed to save state. Please try again."
|
|
1846
1769
|
] }) }) : /* @__PURE__ */ a.jsx("div", { className: "text-xs text-muted-foreground", children: l ? /* @__PURE__ */ a.jsxs("span", { className: "flex items-center gap-1", children: [
|
|
1847
1770
|
/* @__PURE__ */ a.jsx("div", { className: "w-2 h-2 bg-orange-500 rounded-full" }),
|
|
@@ -1854,35 +1777,35 @@ const oa = ({
|
|
|
1854
1777
|
/* @__PURE__ */ a.jsx("p", { className: "text-xs text-muted-foreground", children: "Modify the state value using the JSON editor below." }),
|
|
1855
1778
|
/* @__PURE__ */ a.jsx("div", { className: "space-y-3 pt-2 flex flex-col", children: /* @__PURE__ */ a.jsxs("div", { className: "relative flex-1", children: [
|
|
1856
1779
|
/* @__PURE__ */ a.jsx(
|
|
1857
|
-
|
|
1780
|
+
ca,
|
|
1858
1781
|
{
|
|
1859
|
-
value:
|
|
1860
|
-
onChange:
|
|
1861
|
-
onValidate:
|
|
1782
|
+
value: i,
|
|
1783
|
+
onChange: E,
|
|
1784
|
+
onValidate: o,
|
|
1862
1785
|
height: "calc(100vh - 300px)"
|
|
1863
1786
|
}
|
|
1864
1787
|
),
|
|
1865
1788
|
!n && /* @__PURE__ */ a.jsxs("div", { className: "absolute top-2 right-2 bg-destructive/90 text-destructive-foreground px-2 py-1 rounded text-xs flex items-center gap-1", children: [
|
|
1866
|
-
/* @__PURE__ */ a.jsx(
|
|
1789
|
+
/* @__PURE__ */ a.jsx(Ct, { className: "w-3 h-3" }),
|
|
1867
1790
|
"Invalid JSON"
|
|
1868
1791
|
] })
|
|
1869
1792
|
] }) }),
|
|
1870
1793
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center justify-between pt-2", children: [
|
|
1871
|
-
|
|
1794
|
+
_,
|
|
1872
1795
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1873
|
-
l && /* @__PURE__ */ a.jsx(ye, { variant: "secondary", onClick:
|
|
1796
|
+
l && /* @__PURE__ */ a.jsx(ye, { variant: "secondary", onClick: C, disabled: t, children: "Reset" }),
|
|
1874
1797
|
/* @__PURE__ */ a.jsx(
|
|
1875
1798
|
ye,
|
|
1876
1799
|
{
|
|
1877
|
-
onClick:
|
|
1800
|
+
onClick: O,
|
|
1878
1801
|
variant: "accent",
|
|
1879
1802
|
disabled: t || !n || !l,
|
|
1880
1803
|
"data-testid": "state-save-button",
|
|
1881
1804
|
children: t ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1882
|
-
/* @__PURE__ */ a.jsx(
|
|
1805
|
+
/* @__PURE__ */ a.jsx(qr, { className: "w-3 h-3 animate-spin mr-1" }),
|
|
1883
1806
|
"Saving..."
|
|
1884
1807
|
] }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1885
|
-
/* @__PURE__ */ a.jsx(
|
|
1808
|
+
/* @__PURE__ */ a.jsx(Wr, { className: "w-3 h-3 mr-1" }),
|
|
1886
1809
|
"Save Changes"
|
|
1887
1810
|
] })
|
|
1888
1811
|
}
|
|
@@ -1890,8 +1813,8 @@ const oa = ({
|
|
|
1890
1813
|
] })
|
|
1891
1814
|
] })
|
|
1892
1815
|
] });
|
|
1893
|
-
},
|
|
1894
|
-
|
|
1816
|
+
}, ua = ({ state: e, onClose: t }) => /* @__PURE__ */ a.jsx(
|
|
1817
|
+
Bt,
|
|
1895
1818
|
{
|
|
1896
1819
|
onClose: t,
|
|
1897
1820
|
title: "State Details",
|
|
@@ -1899,85 +1822,85 @@ const oa = ({
|
|
|
1899
1822
|
tabs: [
|
|
1900
1823
|
{
|
|
1901
1824
|
label: "Overview",
|
|
1902
|
-
content: /* @__PURE__ */ a.jsx(
|
|
1825
|
+
content: /* @__PURE__ */ a.jsx(Ur, { state: e })
|
|
1903
1826
|
},
|
|
1904
1827
|
{
|
|
1905
1828
|
label: "Editor",
|
|
1906
|
-
content: /* @__PURE__ */ a.jsx(
|
|
1829
|
+
content: /* @__PURE__ */ a.jsx(la, { state: e })
|
|
1907
1830
|
}
|
|
1908
1831
|
],
|
|
1909
|
-
actions: [{ icon: /* @__PURE__ */ a.jsx(
|
|
1832
|
+
actions: [{ icon: /* @__PURE__ */ a.jsx(Rt, {}), onClick: t, label: "Close" }]
|
|
1910
1833
|
}
|
|
1911
|
-
),
|
|
1912
|
-
const e =
|
|
1834
|
+
), pa = () => {
|
|
1835
|
+
const e = rt((f) => f.selectedStateId), t = rt((f) => f.selectStateId), { items: r, deleteItems: n, refetch: o } = hr(), [i, c] = P(""), l = ue(() => r.filter((f) => f.groupId.toLowerCase().includes(i.toLowerCase()) || f.key.toLowerCase().includes(i.toLowerCase())), [r, i]), g = ue(
|
|
1913
1836
|
() => e ? l.find((f) => `${f.groupId}:${f.key}` === e) : null,
|
|
1914
1837
|
[l, e]
|
|
1915
|
-
), [u, d] = P(/* @__PURE__ */ new Set()), v = (f) => t(`${f.groupId}:${f.key}`),
|
|
1838
|
+
), [u, d] = P(/* @__PURE__ */ new Set()), v = (f) => t(`${f.groupId}:${f.key}`), E = () => t(void 0), O = () => {
|
|
1916
1839
|
n(Array.from(u)), d(/* @__PURE__ */ new Set());
|
|
1917
|
-
},
|
|
1918
|
-
const
|
|
1919
|
-
d((
|
|
1920
|
-
const
|
|
1921
|
-
return
|
|
1840
|
+
}, C = (f) => {
|
|
1841
|
+
const A = u.has(`${f.groupId}:${f.key}`);
|
|
1842
|
+
d((k) => {
|
|
1843
|
+
const R = new Set(k);
|
|
1844
|
+
return A ? R.delete(`${f.groupId}:${f.key}`) : R.add(`${f.groupId}:${f.key}`), R;
|
|
1922
1845
|
});
|
|
1923
|
-
},
|
|
1924
|
-
d((
|
|
1925
|
-
const
|
|
1926
|
-
return f ? l.forEach((
|
|
1846
|
+
}, _ = (f) => {
|
|
1847
|
+
d((A) => {
|
|
1848
|
+
const k = new Set(A);
|
|
1849
|
+
return f ? l.forEach((R) => k.add(`${R.groupId}:${R.key}`)) : l.forEach((R) => k.delete(`${R.groupId}:${R.key}`)), k;
|
|
1927
1850
|
});
|
|
1928
1851
|
};
|
|
1929
1852
|
return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1930
|
-
g && /* @__PURE__ */ a.jsx(
|
|
1853
|
+
g && /* @__PURE__ */ a.jsx(ua, { state: g, onClose: E }),
|
|
1931
1854
|
/* @__PURE__ */ a.jsxs("div", { className: "grid grid-rows-[auto_1fr] h-full", "data-testid": "states-container", children: [
|
|
1932
1855
|
/* @__PURE__ */ a.jsxs("div", { className: "flex p-2 border-b gap-2", "data-testid": "logs-search-container", children: [
|
|
1933
1856
|
/* @__PURE__ */ a.jsxs("div", { className: "flex-1 relative", children: [
|
|
1934
1857
|
/* @__PURE__ */ a.jsx(
|
|
1935
|
-
|
|
1858
|
+
Wt,
|
|
1936
1859
|
{
|
|
1937
1860
|
variant: "shade",
|
|
1938
|
-
value:
|
|
1861
|
+
value: i,
|
|
1939
1862
|
onChange: (f) => c(f.target.value),
|
|
1940
1863
|
className: "px-9 font-medium",
|
|
1941
1864
|
placeholder: "Search by Group ID or Key"
|
|
1942
1865
|
}
|
|
1943
1866
|
),
|
|
1944
|
-
/* @__PURE__ */ a.jsx(
|
|
1867
|
+
/* @__PURE__ */ a.jsx(dr, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
|
|
1945
1868
|
/* @__PURE__ */ a.jsx(
|
|
1946
|
-
|
|
1869
|
+
Rt,
|
|
1947
1870
|
{
|
|
1948
1871
|
className: "cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground",
|
|
1949
1872
|
onClick: () => c("")
|
|
1950
1873
|
}
|
|
1951
1874
|
)
|
|
1952
1875
|
] }),
|
|
1953
|
-
/* @__PURE__ */ a.jsxs(ye, { variant: "default", className: "h-[34px]", disabled: u.size === 0, onClick:
|
|
1954
|
-
/* @__PURE__ */ a.jsx(
|
|
1876
|
+
/* @__PURE__ */ a.jsxs(ye, { variant: "default", className: "h-[34px]", disabled: u.size === 0, onClick: O, children: [
|
|
1877
|
+
/* @__PURE__ */ a.jsx(pr, {}),
|
|
1955
1878
|
" Delete"
|
|
1956
1879
|
] }),
|
|
1957
|
-
/* @__PURE__ */ a.jsx(ye, { variant: "default", className: "h-[34px]", onClick:
|
|
1880
|
+
/* @__PURE__ */ a.jsx(ye, { variant: "default", className: "h-[34px]", onClick: o, children: /* @__PURE__ */ a.jsx(lr, { className: "w-4 h-4 text-muted-foreground" }) })
|
|
1958
1881
|
] }),
|
|
1959
|
-
/* @__PURE__ */ a.jsxs(
|
|
1960
|
-
/* @__PURE__ */ a.jsx(
|
|
1961
|
-
/* @__PURE__ */ a.jsx(pe, { children: /* @__PURE__ */ a.jsx(
|
|
1882
|
+
/* @__PURE__ */ a.jsxs(Kt, { children: [
|
|
1883
|
+
/* @__PURE__ */ a.jsx(Gt, { className: "sticky top-0 bg-background/20 backdrop-blur-sm", children: /* @__PURE__ */ a.jsxs(We, { children: [
|
|
1884
|
+
/* @__PURE__ */ a.jsx(pe, { children: /* @__PURE__ */ a.jsx(Ke, { onClick: (f) => f.stopPropagation(), onCheckedChange: _ }) }),
|
|
1962
1885
|
/* @__PURE__ */ a.jsx(pe, { className: "rounded-0", children: "Group ID" }),
|
|
1963
1886
|
/* @__PURE__ */ a.jsx(pe, { children: "Key" }),
|
|
1964
1887
|
/* @__PURE__ */ a.jsx(pe, { children: "Type" })
|
|
1965
1888
|
] }) }),
|
|
1966
|
-
/* @__PURE__ */ a.jsx(
|
|
1967
|
-
|
|
1889
|
+
/* @__PURE__ */ a.jsx(Xt, { children: l.map((f) => /* @__PURE__ */ a.jsxs(
|
|
1890
|
+
We,
|
|
1968
1891
|
{
|
|
1969
1892
|
"data-testid": `item-${f}`,
|
|
1970
1893
|
onClick: () => v(f),
|
|
1971
|
-
className:
|
|
1894
|
+
className: Qt(
|
|
1972
1895
|
"font-mono font-semibold cursor-pointer border-0",
|
|
1973
1896
|
g === f ? "bg-muted-foreground/10 hover:bg-muted-foreground/20" : "hover:bg-muted-foreground/10"
|
|
1974
1897
|
),
|
|
1975
1898
|
children: [
|
|
1976
|
-
/* @__PURE__ */ a.jsx(ge, { onClick: (
|
|
1977
|
-
|
|
1899
|
+
/* @__PURE__ */ a.jsx(ge, { onClick: (A) => A.stopPropagation(), children: /* @__PURE__ */ a.jsx(
|
|
1900
|
+
Ke,
|
|
1978
1901
|
{
|
|
1979
1902
|
checked: u.has(`${f.groupId}:${f.key}`),
|
|
1980
|
-
onClick: () =>
|
|
1903
|
+
onClick: () => C(f)
|
|
1981
1904
|
}
|
|
1982
1905
|
) }),
|
|
1983
1906
|
/* @__PURE__ */ a.jsx(ge, { className: "hover:bg-transparent", children: f.groupId }),
|
|
@@ -1992,5 +1915,5 @@ const oa = ({
|
|
|
1992
1915
|
] });
|
|
1993
1916
|
};
|
|
1994
1917
|
export {
|
|
1995
|
-
|
|
1918
|
+
pa as StatesPage
|
|
1996
1919
|
};
|