@motiadev/plugin-logs 0.8.2-beta.140-364012 → 0.8.2-beta.140-930160

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.
Files changed (3) hide show
  1. package/dist/index.cjs +4 -39
  2. package/dist/index.js +259 -1128
  3. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,43 +1,23 @@
1
- import { Stream as gt } from "@motiadev/stream-client-browser";
2
- import * as _ from "react";
3
- import K, { forwardRef as rt, createElement as fe, useState as F, useCallback as ne, useEffect as xe, createContext as mt, useContext as J, isValidElement as vt, useRef as Ce, useMemo as se } from "react";
4
- import { Sidebar as ht, LevelDot as at, Input as jt, Button as bt, Table as yt, TableBody as wt, TableRow as xt, cn as Ct, TableCell as re } from "@motiadev/ui";
5
- const Re = (e) => {
6
- let t;
7
- const n = /* @__PURE__ */ new Set(), r = (d, g) => {
8
- const m = typeof d == "function" ? d(t) : d;
9
- if (!Object.is(m, t)) {
10
- const y = t;
11
- t = g ?? (typeof m != "object" || m === null) ? m : Object.assign({}, t, m), n.forEach((E) => E(t, y));
12
- }
13
- }, l = () => t, c = { setState: r, getState: l, getInitialState: () => u, subscribe: (d) => (n.add(d), () => n.delete(d)) }, u = t = e(r, l, c);
14
- return c;
15
- }, Et = (e) => e ? Re(e) : Re, At = (e) => e;
16
- function St(e, t = At) {
17
- const n = K.useSyncExternalStore(
18
- e.subscribe,
19
- K.useCallback(() => t(e.getState()), [e, t]),
20
- K.useCallback(() => t(e.getInitialState()), [e, t])
21
- );
22
- return K.useDebugValue(n), n;
23
- }
24
- const kt = (e) => {
25
- const t = Et(e), n = (r) => St(t, r);
26
- return Object.assign(n, t), n;
27
- }, _t = (e) => kt, ee = _t()((e) => ({
1
+ import { Stream as ce } from "@motiadev/stream-client-browser";
2
+ import { create as ie } from "zustand";
3
+ import ue, { useState as z, useMemo as L } from "react";
4
+ import { Sidebar as de, LevelDot as G, Input as fe, Button as me, Table as pe, TableBody as be, TableRow as ve, cn as he, TableCell as T } from "@motiadev/ui";
5
+ import { X as V, Search as ge, Trash as Ee } from "lucide-react";
6
+ import _e from "react18-json-view";
7
+ const x = ie()((t) => ({
28
8
  logs: [],
29
9
  selectedLogId: void 0,
30
- addLog: (t) => e((n) => ({
31
- logs: [t, ...n.logs]
10
+ addLog: (l) => t((u) => ({
11
+ logs: [l, ...u.logs]
32
12
  })),
33
13
  resetLogs: () => {
34
- e({ logs: [] });
14
+ t({ logs: [] });
35
15
  },
36
- selectLogId: (t) => e({ selectedLogId: t })
37
- })), Tt = "__motia.logs", Nt = "default", Ot = "log", Rt = () => {
38
- new gt(window.location.origin.replace("http", "ws")).subscribeGroup(Tt, Nt).onEvent(Ot, ee.getState().addLog);
16
+ selectLogId: (l) => t({ selectedLogId: l })
17
+ })), xe = "__motia.logs", Re = "default", Te = "log", we = () => {
18
+ new ce(window.location.origin.replace("http", "ws")).subscribeGroup(xe, Re).onEvent(Te, x.getState().addLog);
39
19
  };
40
- var ae = { exports: {} }, X = {};
20
+ var w = { exports: {} }, E = {};
41
21
  /**
42
22
  * @license React
43
23
  * react-jsx-runtime.production.js
@@ -47,29 +27,29 @@ var ae = { exports: {} }, X = {};
47
27
  * This source code is licensed under the MIT license found in the
48
28
  * LICENSE file in the root directory of this source tree.
49
29
  */
50
- var Le;
51
- function Lt() {
52
- if (Le) return X;
53
- Le = 1;
54
- var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
55
- function n(r, l, i) {
56
- var o = null;
57
- if (i !== void 0 && (o = "" + i), l.key !== void 0 && (o = "" + l.key), "key" in l) {
58
- i = {};
59
- for (var c in l)
60
- c !== "key" && (i[c] = l[c]);
61
- } else i = l;
62
- return l = i.ref, {
63
- $$typeof: e,
64
- type: r,
65
- key: o,
66
- ref: l !== void 0 ? l : null,
67
- props: i
30
+ var W;
31
+ function je() {
32
+ if (W) return E;
33
+ W = 1;
34
+ var t = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
35
+ function u(m, d, s) {
36
+ var f = null;
37
+ if (s !== void 0 && (f = "" + s), d.key !== void 0 && (f = "" + d.key), "key" in d) {
38
+ s = {};
39
+ for (var p in d)
40
+ p !== "key" && (s[p] = d[p]);
41
+ } else s = d;
42
+ return d = s.ref, {
43
+ $$typeof: t,
44
+ type: m,
45
+ key: f,
46
+ ref: d !== void 0 ? d : null,
47
+ props: s
68
48
  };
69
49
  }
70
- return X.Fragment = t, X.jsx = n, X.jsxs = n, X;
50
+ return E.Fragment = l, E.jsx = u, E.jsxs = u, E;
71
51
  }
72
- var Q = {};
52
+ var _ = {};
73
53
  /**
74
54
  * @license React
75
55
  * react-jsx-runtime.development.js
@@ -79,1211 +59,362 @@ var Q = {};
79
59
  * This source code is licensed under the MIT license found in the
80
60
  * LICENSE file in the root directory of this source tree.
81
61
  */
82
- var De;
83
- function Dt() {
84
- return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
85
- function e(s) {
86
- if (s == null) return null;
87
- if (typeof s == "function")
88
- return s.$$typeof === Y ? null : s.displayName || s.name || null;
89
- if (typeof s == "string") return s;
90
- switch (s) {
91
- case C:
62
+ var J;
63
+ function Se() {
64
+ return J || (J = 1, process.env.NODE_ENV !== "production" && function() {
65
+ function t(e) {
66
+ if (e == null) return null;
67
+ if (typeof e == "function")
68
+ return e.$$typeof === ne ? null : e.displayName || e.name || null;
69
+ if (typeof e == "string") return e;
70
+ switch (e) {
71
+ case j:
92
72
  return "Fragment";
93
- case A:
73
+ case Z:
94
74
  return "Profiler";
95
- case N:
75
+ case H:
96
76
  return "StrictMode";
97
- case h:
77
+ case re:
98
78
  return "Suspense";
99
- case S:
79
+ case te:
100
80
  return "SuspenseList";
101
- case O:
81
+ case oe:
102
82
  return "Activity";
103
83
  }
104
- if (typeof s == "object")
105
- switch (typeof s.tag == "number" && console.error(
84
+ if (typeof e == "object")
85
+ switch (typeof e.tag == "number" && console.error(
106
86
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
107
- ), s.$$typeof) {
108
- case w:
87
+ ), e.$$typeof) {
88
+ case B:
109
89
  return "Portal";
110
- case P:
111
- return (s.displayName || "Context") + ".Provider";
112
- case D:
113
- return (s._context.displayName || "Context") + ".Consumer";
114
- case v:
115
- var p = s.render;
116
- return s = s.displayName, s || (s = p.displayName || p.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
117
- case x:
118
- return p = s.displayName || null, p !== null ? p : e(s.type) || "Memo";
119
- case H:
120
- p = s._payload, s = s._init;
90
+ case K:
91
+ return (e.displayName || "Context") + ".Provider";
92
+ case Q:
93
+ return (e._context.displayName || "Context") + ".Consumer";
94
+ case ee:
95
+ var r = e.render;
96
+ return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
97
+ case ae:
98
+ return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
99
+ case I:
100
+ r = e._payload, e = e._init;
121
101
  try {
122
- return e(s(p));
102
+ return t(e(r));
123
103
  } catch {
124
104
  }
125
105
  }
126
106
  return null;
127
107
  }
128
- function t(s) {
129
- return "" + s;
108
+ function l(e) {
109
+ return "" + e;
130
110
  }
131
- function n(s) {
111
+ function u(e) {
132
112
  try {
133
- t(s);
134
- var p = !1;
113
+ l(e);
114
+ var r = !1;
135
115
  } catch {
136
- p = !0;
116
+ r = !0;
137
117
  }
138
- if (p) {
139
- p = console;
140
- var b = p.error, f = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
141
- return b.call(
142
- p,
118
+ if (r) {
119
+ r = console;
120
+ var n = r.error, c = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
121
+ return n.call(
122
+ r,
143
123
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
144
- f
145
- ), t(s);
124
+ c
125
+ ), l(e);
146
126
  }
147
127
  }
148
- function r(s) {
149
- if (s === C) return "<>";
150
- if (typeof s == "object" && s !== null && s.$$typeof === H)
128
+ function m(e) {
129
+ if (e === j) return "<>";
130
+ if (typeof e == "object" && e !== null && e.$$typeof === I)
151
131
  return "<...>";
152
132
  try {
153
- var p = e(s);
154
- return p ? "<" + p + ">" : "<...>";
133
+ var r = t(e);
134
+ return r ? "<" + r + ">" : "<...>";
155
135
  } catch {
156
136
  return "<...>";
157
137
  }
158
138
  }
159
- function l() {
160
- var s = R.A;
161
- return s === null ? null : s.getOwner();
139
+ function d() {
140
+ var e = S.A;
141
+ return e === null ? null : e.getOwner();
162
142
  }
163
- function i() {
143
+ function s() {
164
144
  return Error("react-stack-top-frame");
165
145
  }
166
- function o(s) {
167
- if (L.call(s, "key")) {
168
- var p = Object.getOwnPropertyDescriptor(s, "key").get;
169
- if (p && p.isReactWarning) return !1;
146
+ function f(e) {
147
+ if ($.call(e, "key")) {
148
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
149
+ if (r && r.isReactWarning) return !1;
170
150
  }
171
- return s.key !== void 0;
151
+ return e.key !== void 0;
172
152
  }
173
- function c(s, p) {
174
- function b() {
175
- T || (T = !0, console.error(
153
+ function p(e, r) {
154
+ function n() {
155
+ D || (D = !0, console.error(
176
156
  "%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)",
177
- p
157
+ r
178
158
  ));
179
159
  }
180
- b.isReactWarning = !0, Object.defineProperty(s, "key", {
181
- get: b,
160
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
161
+ get: n,
182
162
  configurable: !0
183
163
  });
184
164
  }
185
- function u() {
186
- var s = e(this.type);
187
- return $[s] || ($[s] = !0, console.error(
165
+ function a() {
166
+ var e = t(this.type);
167
+ return Y[e] || (Y[e] = !0, console.error(
188
168
  "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."
189
- )), s = this.props.ref, s !== void 0 ? s : null;
190
- }
191
- function d(s, p, b, f, j, z, le, ce) {
192
- return b = z.ref, s = {
193
- $$typeof: E,
194
- type: s,
195
- key: p,
196
- props: z,
197
- _owner: j
198
- }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(s, "ref", {
169
+ )), e = this.props.ref, e !== void 0 ? e : null;
170
+ }
171
+ function h(e, r, n, c, v, b, N, O) {
172
+ return n = b.ref, e = {
173
+ $$typeof: y,
174
+ type: e,
175
+ key: r,
176
+ props: b,
177
+ _owner: v
178
+ }, (n !== void 0 ? n : null) !== null ? Object.defineProperty(e, "ref", {
199
179
  enumerable: !1,
200
- get: u
201
- }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
180
+ get: a
181
+ }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
202
182
  configurable: !1,
203
183
  enumerable: !1,
204
184
  writable: !0,
205
185
  value: 0
206
- }), Object.defineProperty(s, "_debugInfo", {
186
+ }), Object.defineProperty(e, "_debugInfo", {
207
187
  configurable: !1,
208
188
  enumerable: !1,
209
189
  writable: !0,
210
190
  value: null
211
- }), Object.defineProperty(s, "_debugStack", {
191
+ }), Object.defineProperty(e, "_debugStack", {
212
192
  configurable: !1,
213
193
  enumerable: !1,
214
194
  writable: !0,
215
- value: le
216
- }), Object.defineProperty(s, "_debugTask", {
195
+ value: N
196
+ }), Object.defineProperty(e, "_debugTask", {
217
197
  configurable: !1,
218
198
  enumerable: !1,
219
199
  writable: !0,
220
- value: ce
221
- }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
222
- }
223
- function g(s, p, b, f, j, z, le, ce) {
224
- var I = p.children;
225
- if (I !== void 0)
226
- if (f)
227
- if (U(I)) {
228
- for (f = 0; f < I.length; f++)
229
- m(I[f]);
230
- Object.freeze && Object.freeze(I);
200
+ value: O
201
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
202
+ }
203
+ function A(e, r, n, c, v, b, N, O) {
204
+ var i = r.children;
205
+ if (i !== void 0)
206
+ if (c)
207
+ if (se(i)) {
208
+ for (c = 0; c < i.length; c++)
209
+ C(i[c]);
210
+ Object.freeze && Object.freeze(i);
231
211
  } else
232
212
  console.error(
233
213
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
234
214
  );
235
- else m(I);
236
- if (L.call(p, "key")) {
237
- I = e(s);
238
- var q = Object.keys(p).filter(function(pt) {
239
- return pt !== "key";
215
+ else C(i);
216
+ if ($.call(r, "key")) {
217
+ i = t(e);
218
+ var g = Object.keys(r).filter(function(le) {
219
+ return le !== "key";
240
220
  });
241
- f = 0 < q.length ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}", M[I + f] || (q = 0 < q.length ? "{" + q.join(": ..., ") + ": ...}" : "{}", console.error(
221
+ c = 0 < g.length ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}", U[i + c] || (g = 0 < g.length ? "{" + g.join(": ..., ") + ": ...}" : "{}", console.error(
242
222
  `A props object containing a "key" prop is being spread into JSX:
243
223
  let props = %s;
244
224
  <%s {...props} />
245
225
  React keys must be passed directly to JSX without using spread:
246
226
  let props = %s;
247
227
  <%s key={someKey} {...props} />`,
248
- f,
249
- I,
250
- q,
251
- I
252
- ), M[I + f] = !0);
228
+ c,
229
+ i,
230
+ g,
231
+ i
232
+ ), U[i + c] = !0);
253
233
  }
254
- if (I = null, b !== void 0 && (n(b), I = "" + b), o(p) && (n(p.key), I = "" + p.key), "key" in p) {
255
- b = {};
256
- for (var ue in p)
257
- ue !== "key" && (b[ue] = p[ue]);
258
- } else b = p;
259
- return I && c(
260
- b,
261
- typeof s == "function" ? s.displayName || s.name || "Unknown" : s
262
- ), d(
263
- s,
264
- I,
265
- z,
266
- j,
267
- l(),
234
+ if (i = null, n !== void 0 && (u(n), i = "" + n), f(r) && (u(r.key), i = "" + r.key), "key" in r) {
235
+ n = {};
236
+ for (var P in r)
237
+ P !== "key" && (n[P] = r[P]);
238
+ } else n = r;
239
+ return i && p(
240
+ n,
241
+ typeof e == "function" ? e.displayName || e.name || "Unknown" : e
242
+ ), h(
243
+ e,
244
+ i,
268
245
  b,
269
- le,
270
- ce
246
+ v,
247
+ d(),
248
+ n,
249
+ N,
250
+ O
271
251
  );
272
252
  }
273
- function m(s) {
274
- typeof s == "object" && s !== null && s.$$typeof === E && s._store && (s._store.validated = 1);
253
+ function C(e) {
254
+ typeof e == "object" && e !== null && e.$$typeof === y && e._store && (e._store.validated = 1);
275
255
  }
276
- var y = K, E = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), N = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), P = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), S = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), Y = Symbol.for("react.client.reference"), R = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, U = Array.isArray, Z = console.createTask ? console.createTask : function() {
256
+ var R = ue, y = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), H = Symbol.for("react.strict_mode"), Z = Symbol.for("react.profiler"), Q = Symbol.for("react.consumer"), K = Symbol.for("react.context"), ee = Symbol.for("react.forward_ref"), re = Symbol.for("react.suspense"), te = Symbol.for("react.suspense_list"), ae = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), oe = Symbol.for("react.activity"), ne = Symbol.for("react.client.reference"), S = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, se = Array.isArray, k = console.createTask ? console.createTask : function() {
277
257
  return null;
278
258
  };
279
- y = {
280
- react_stack_bottom_frame: function(s) {
281
- return s();
259
+ R = {
260
+ react_stack_bottom_frame: function(e) {
261
+ return e();
282
262
  }
283
263
  };
284
- var T, $ = {}, k = y.react_stack_bottom_frame.bind(
285
- y,
286
- i
287
- )(), V = Z(r(i)), M = {};
288
- Q.Fragment = C, Q.jsx = function(s, p, b, f, j) {
289
- var z = 1e4 > R.recentlyCreatedOwnerStacks++;
290
- return g(
291
- s,
292
- p,
293
- b,
264
+ var D, Y = {}, F = R.react_stack_bottom_frame.bind(
265
+ R,
266
+ s
267
+ )(), M = k(m(s)), U = {};
268
+ _.Fragment = j, _.jsx = function(e, r, n, c, v) {
269
+ var b = 1e4 > S.recentlyCreatedOwnerStacks++;
270
+ return A(
271
+ e,
272
+ r,
273
+ n,
294
274
  !1,
295
- f,
296
- j,
297
- z ? Error("react-stack-top-frame") : k,
298
- z ? Z(r(s)) : V
275
+ c,
276
+ v,
277
+ b ? Error("react-stack-top-frame") : F,
278
+ b ? k(m(e)) : M
299
279
  );
300
- }, Q.jsxs = function(s, p, b, f, j) {
301
- var z = 1e4 > R.recentlyCreatedOwnerStacks++;
302
- return g(
303
- s,
304
- p,
305
- b,
280
+ }, _.jsxs = function(e, r, n, c, v) {
281
+ var b = 1e4 > S.recentlyCreatedOwnerStacks++;
282
+ return A(
283
+ e,
284
+ r,
285
+ n,
306
286
  !0,
307
- f,
308
- j,
309
- z ? Error("react-stack-top-frame") : k,
310
- z ? Z(r(s)) : V
287
+ c,
288
+ v,
289
+ b ? Error("react-stack-top-frame") : F,
290
+ b ? k(m(e)) : M
311
291
  );
312
292
  };
313
- }()), Q;
314
- }
315
- var Ie;
316
- function It() {
317
- return Ie || (Ie = 1, process.env.NODE_ENV === "production" ? ae.exports = Lt() : ae.exports = Dt()), ae.exports;
318
- }
319
- var a = It();
320
- /**
321
- * @license lucide-react v0.545.0 - ISC
322
- *
323
- * This source code is licensed under the ISC license.
324
- * See the LICENSE file in the root directory of this source tree.
325
- */
326
- const Pt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), $t = (e) => e.replace(
327
- /^([A-Z])|[\s-_]+(\w)/g,
328
- (t, n, r) => r ? r.toUpperCase() : n.toLowerCase()
329
- ), Pe = (e) => {
330
- const t = $t(e);
331
- return t.charAt(0).toUpperCase() + t.slice(1);
332
- }, st = (...e) => e.filter((t, n, r) => !!t && t.trim() !== "" && r.indexOf(t) === n).join(" ").trim(), Mt = (e) => {
333
- for (const t in e)
334
- if (t.startsWith("aria-") || t === "role" || t === "title")
335
- return !0;
336
- };
337
- /**
338
- * @license lucide-react v0.545.0 - ISC
339
- *
340
- * This source code is licensed under the ISC license.
341
- * See the LICENSE file in the root directory of this source tree.
342
- */
343
- var Ft = {
344
- xmlns: "http://www.w3.org/2000/svg",
345
- width: 24,
346
- height: 24,
347
- viewBox: "0 0 24 24",
348
- fill: "none",
349
- stroke: "currentColor",
350
- strokeWidth: 2,
351
- strokeLinecap: "round",
352
- strokeLinejoin: "round"
353
- };
354
- /**
355
- * @license lucide-react v0.545.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */
360
- const Ht = rt(
361
- ({
362
- color: e = "currentColor",
363
- size: t = 24,
364
- strokeWidth: n = 2,
365
- absoluteStrokeWidth: r,
366
- className: l = "",
367
- children: i,
368
- iconNode: o,
369
- ...c
370
- }, u) => fe(
371
- "svg",
372
- {
373
- ref: u,
374
- ...Ft,
375
- width: t,
376
- height: t,
377
- stroke: e,
378
- strokeWidth: r ? Number(n) * 24 / Number(t) : n,
379
- className: st("lucide", l),
380
- ...!i && !Mt(c) && { "aria-hidden": "true" },
381
- ...c
382
- },
383
- [
384
- ...o.map(([d, g]) => fe(d, g)),
385
- ...Array.isArray(i) ? i : [i]
386
- ]
387
- )
388
- );
389
- /**
390
- * @license lucide-react v0.545.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */
395
- const Ee = (e, t) => {
396
- const n = rt(
397
- ({ className: r, ...l }, i) => fe(Ht, {
398
- ref: i,
399
- iconNode: t,
400
- className: st(
401
- `lucide-${Pt(Pe(e))}`,
402
- `lucide-${e}`,
403
- r
404
- ),
405
- ...l
406
- })
407
- );
408
- return n.displayName = Pe(e), n;
409
- };
410
- /**
411
- * @license lucide-react v0.545.0 - ISC
412
- *
413
- * This source code is licensed under the ISC license.
414
- * See the LICENSE file in the root directory of this source tree.
415
- */
416
- const Ut = [
417
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
418
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
419
- ], Zt = Ee("search", Ut);
420
- /**
421
- * @license lucide-react v0.545.0 - ISC
422
- *
423
- * This source code is licensed under the ISC license.
424
- * See the LICENSE file in the root directory of this source tree.
425
- */
426
- const Vt = [
427
- ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
428
- ["path", { d: "M3 6h18", key: "d0wm0j" }],
429
- ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
430
- ], zt = Ee("trash", Vt);
431
- /**
432
- * @license lucide-react v0.545.0 - ISC
433
- *
434
- * This source code is licensed under the ISC license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */
437
- const Yt = [
438
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
439
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
440
- ], ot = Ee("x", Yt), it = (e) => {
441
- const t = new Date(Number(e));
442
- return `${t.toLocaleDateString("en-US", { year: void 0, month: "short", day: "2-digit" })}, ${t.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", second: "2-digit", hourCycle: "h24" })}.${t.getMilliseconds().toString().padStart(3, "0")}`;
443
- };
444
- function Bt(e, t, n, r) {
445
- function l(i) {
446
- return i instanceof n ? i : new n(function(o) {
447
- o(i);
448
- });
449
- }
450
- return new (n || (n = Promise))(function(i, o) {
451
- function c(g) {
452
- try {
453
- d(r.next(g));
454
- } catch (m) {
455
- o(m);
456
- }
457
- }
458
- function u(g) {
459
- try {
460
- d(r.throw(g));
461
- } catch (m) {
462
- o(m);
463
- }
464
- }
465
- function d(g) {
466
- g.done ? i(g.value) : l(g.value).then(c, u);
467
- }
468
- d((r = r.apply(e, [])).next());
469
- });
470
- }
471
- var Wt = function() {
472
- var e = document.getSelection();
473
- if (!e.rangeCount)
474
- return function() {
475
- };
476
- for (var t = document.activeElement, n = [], r = 0; r < e.rangeCount; r++)
477
- n.push(e.getRangeAt(r));
478
- switch (t.tagName.toUpperCase()) {
479
- // .toUpperCase handles XHTML
480
- case "INPUT":
481
- case "TEXTAREA":
482
- t.blur();
483
- break;
484
- default:
485
- t = null;
486
- break;
487
- }
488
- return e.removeAllRanges(), function() {
489
- e.type === "Caret" && e.removeAllRanges(), e.rangeCount || n.forEach(function(l) {
490
- e.addRange(l);
491
- }), t && t.focus();
492
- };
493
- }, Jt = Wt, $e = {
494
- "text/plain": "Text",
495
- "text/html": "Url",
496
- default: "Text"
497
- }, qt = "Copy to clipboard: #{key}, Enter";
498
- function Kt(e) {
499
- var t = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
500
- return e.replace(/#{\s*key\s*}/g, t);
501
- }
502
- function Gt(e, t) {
503
- var n, r, l, i, o, c, u = !1;
504
- t || (t = {}), n = t.debug || !1;
505
- try {
506
- l = Jt(), i = document.createRange(), o = document.getSelection(), c = document.createElement("span"), c.textContent = e, c.ariaHidden = "true", c.style.all = "unset", c.style.position = "fixed", c.style.top = 0, c.style.clip = "rect(0, 0, 0, 0)", c.style.whiteSpace = "pre", c.style.webkitUserSelect = "text", c.style.MozUserSelect = "text", c.style.msUserSelect = "text", c.style.userSelect = "text", c.addEventListener("copy", function(g) {
507
- if (g.stopPropagation(), t.format)
508
- if (g.preventDefault(), typeof g.clipboardData > "u") {
509
- n && console.warn("unable to use e.clipboardData"), n && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
510
- var m = $e[t.format] || $e.default;
511
- window.clipboardData.setData(m, e);
512
- } else
513
- g.clipboardData.clearData(), g.clipboardData.setData(t.format, e);
514
- t.onCopy && (g.preventDefault(), t.onCopy(g.clipboardData));
515
- }), document.body.appendChild(c), i.selectNodeContents(c), o.addRange(i);
516
- var d = document.execCommand("copy");
517
- if (!d)
518
- throw new Error("copy command was unsuccessful");
519
- u = !0;
520
- } catch (g) {
521
- n && console.error("unable to copy using execCommand: ", g), n && console.warn("trying IE specific stuff");
522
- try {
523
- window.clipboardData.setData(t.format || "text", e), t.onCopy && t.onCopy(window.clipboardData), u = !0;
524
- } catch (m) {
525
- n && console.error("unable to copy using clipboardData: ", m), n && console.error("falling back to prompt"), r = Kt("message" in t ? t.message : qt), window.prompt(r, e);
526
- }
527
- } finally {
528
- o && (typeof o.removeRange == "function" ? o.removeRange(i) : o.removeAllRanges()), c && document.body.removeChild(c), l();
529
- }
530
- return u;
531
- }
532
- var Xt = Gt;
533
- function B(e) {
534
- return Object.prototype.toString.call(e) === "[object Object]";
535
- }
536
- function te(e) {
537
- return Array.isArray(e) ? e.length : B(e) ? Object.keys(e).length : 0;
538
- }
539
- function Qt(e, t) {
540
- if (typeof e == "string")
541
- return e;
542
- try {
543
- return JSON.stringify(e, (n, r) => {
544
- switch (typeof r) {
545
- case "bigint":
546
- return String(r) + "n";
547
- case "number":
548
- case "boolean":
549
- case "object":
550
- case "string":
551
- return r;
552
- default:
553
- return String(r);
554
- }
555
- }, t);
556
- } catch (n) {
557
- return `${n.name}: ${n.message}` || "JSON.stringify failed";
558
- }
559
- }
560
- function en(e) {
561
- return Bt(this, void 0, void 0, function* () {
562
- try {
563
- yield navigator.clipboard.writeText(e);
564
- } catch {
565
- Xt(e);
566
- }
567
- });
568
- }
569
- function Me(e, t, n, r, l, i) {
570
- if (i && i.collapsed !== void 0)
571
- return !!i.collapsed;
572
- if (typeof r == "boolean")
573
- return r;
574
- if (typeof r == "number" && t > r)
575
- return !0;
576
- const o = te(e);
577
- if (typeof r == "function") {
578
- const c = Ae(r, [{ node: e, depth: t, indexOrName: n, size: o }]);
579
- if (typeof c == "boolean")
580
- return c;
581
- }
582
- return !!(Array.isArray(e) && o > l || B(e) && o > l);
583
- }
584
- function Fe(e, t, n, r, l, i) {
585
- if (i && i.collapsed !== void 0)
586
- return !!i.collapsed;
587
- if (typeof r == "boolean")
588
- return r;
589
- if (typeof r == "number" && t > r)
590
- return !0;
591
- const o = Math.ceil(e.length / 100);
592
- if (typeof r == "function") {
593
- const c = Ae(r, [{ node: e, depth: t, indexOrName: n, size: o }]);
594
- if (typeof c == "boolean")
595
- return c;
596
- }
597
- return !!(Array.isArray(e) && o > l || B(e) && o > l);
598
- }
599
- function G(e, t, n) {
600
- return typeof e == "boolean" ? e : !!(typeof e == "number" && t > e || e === "collapsed" && n || e === "expanded" && !n);
601
- }
602
- function Ae(e, t) {
603
- try {
604
- return e(...t);
605
- } catch (n) {
606
- reportError(n);
607
- }
608
- }
609
- function lt(e) {
610
- if (e === !0 || B(e) && e.add === !0)
611
- return !0;
612
- }
613
- function He(e) {
614
- if (e === !0 || B(e) && e.edit === !0)
615
- return !0;
616
- }
617
- function Se(e) {
618
- if (e === !0 || B(e) && e.delete === !0)
619
- return !0;
620
- }
621
- function tn(e) {
622
- return typeof e == "function";
623
- }
624
- function ct(e) {
625
- return !e || e.add === void 0 || !!e.add;
626
- }
627
- function Ue(e) {
628
- return !e || e.edit === void 0 || !!e.edit;
629
- }
630
- function ke(e) {
631
- return !e || e.delete === void 0 || !!e.delete;
632
- }
633
- function oe(e) {
634
- return !e || e.enableClipboard === void 0 || !!e.enableClipboard;
635
- }
636
- function nn(e) {
637
- return !e || e.matchesURL === void 0 || !!e.matchesURL;
638
- }
639
- function rn(e, t) {
640
- return e === "string" ? t.trim().replace(/^\"([\s\S]+?)\"$/, "$1") : t;
641
- }
642
- var Ze;
643
- function de() {
644
- return de = Object.assign ? Object.assign.bind() : function(e) {
645
- for (var t = 1; t < arguments.length; t++) {
646
- var n = arguments[t];
647
- for (var r in n)
648
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
649
- }
650
- return e;
651
- }, de.apply(this, arguments);
652
- }
653
- var _e = function(t) {
654
- return /* @__PURE__ */ _.createElement("svg", de({
655
- xmlns: "http://www.w3.org/2000/svg",
656
- width: 16,
657
- height: 16,
658
- fill: "none",
659
- viewBox: "0 0 16 16"
660
- }, t), Ze || (Ze = /* @__PURE__ */ _.createElement("path", {
661
- fill: "currentColor",
662
- 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"
663
- })));
664
- }, Ve;
665
- function pe() {
666
- return pe = Object.assign ? Object.assign.bind() : function(e) {
667
- for (var t = 1; t < arguments.length; t++) {
668
- var n = arguments[t];
669
- for (var r in n)
670
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
671
- }
672
- return e;
673
- }, pe.apply(this, arguments);
674
- }
675
- var an = function(t) {
676
- return /* @__PURE__ */ _.createElement("svg", pe({
677
- xmlns: "http://www.w3.org/2000/svg",
678
- width: 24,
679
- height: 24,
680
- fill: "none",
681
- viewBox: "0 0 24 24"
682
- }, t), Ve || (Ve = /* @__PURE__ */ _.createElement("path", {
683
- fill: "currentColor",
684
- 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"
685
- })));
686
- }, ze, Ye;
687
- function ge() {
688
- return ge = Object.assign ? Object.assign.bind() : function(e) {
689
- for (var t = 1; t < arguments.length; t++) {
690
- var n = arguments[t];
691
- for (var r in n)
692
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
693
- }
694
- return e;
695
- }, ge.apply(this, arguments);
696
- }
697
- var sn = function(t) {
698
- return /* @__PURE__ */ _.createElement("svg", ge({
699
- xmlns: "http://www.w3.org/2000/svg",
700
- width: 24,
701
- height: 24,
702
- fill: "none",
703
- viewBox: "0 0 24 24"
704
- }, t), ze || (ze = /* @__PURE__ */ _.createElement("path", {
705
- fill: "currentColor",
706
- 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"
707
- })), Ye || (Ye = /* @__PURE__ */ _.createElement("path", {
708
- fill: "#14C786",
709
- 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"
710
- })));
711
- };
712
- function ie({ node: e, nodeMeta: t }) {
713
- const { customizeCopy: n, CopyComponent: r, CopiedComponent: l } = J(W), [i, o] = F(!1), c = (u) => {
714
- u.stopPropagation();
715
- const d = n(e, t);
716
- typeof d == "string" && d && en(d), o(!0), setTimeout(() => o(!1), 3e3);
717
- };
718
- return i ? typeof l == "function" ? a.jsx(l, { className: "json-view--copy", style: { display: "inline-block" } }) : a.jsx(sn, { className: "json-view--copy", style: { display: "inline-block" } }) : typeof r == "function" ? a.jsx(r, { onClick: c, className: "json-view--copy" }) : a.jsx(an, { onClick: c, className: "json-view--copy" });
719
- }
720
- function me({ indexOrName: e, value: t, depth: n, deleteHandle: r, editHandle: l, parent: i, parentPath: o }) {
721
- const { displayArrayIndex: c } = J(W), u = Array.isArray(i);
722
- return a.jsxs("div", Object.assign({ className: "json-view--pair" }, { children: [!u || u && c ? 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(ft, { node: t, depth: n + 1, deleteHandle: (d, g) => r(d, g), editHandle: (d, g, m, y) => l(d, g, m, y), parent: i, indexOrName: e, parentPath: o })] }));
723
- }
724
- var Be, We;
725
- function ve() {
726
- return ve = Object.assign ? Object.assign.bind() : function(e) {
727
- for (var t = 1; t < arguments.length; t++) {
728
- var n = arguments[t];
729
- for (var r in n)
730
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
731
- }
732
- return e;
733
- }, ve.apply(this, arguments);
734
- }
735
- var Te = function(t) {
736
- return /* @__PURE__ */ _.createElement("svg", ve({
737
- xmlns: "http://www.w3.org/2000/svg",
738
- width: 24,
739
- height: 24,
740
- fill: "none",
741
- viewBox: "0 0 24 24"
742
- }, t), Be || (Be = /* @__PURE__ */ _.createElement("path", {
743
- fill: "currentColor",
744
- 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"
745
- })), We || (We = /* @__PURE__ */ _.createElement("path", {
746
- fill: "#DA0000",
747
- 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"
748
- })));
749
- }, Je, qe;
750
- function he() {
751
- return he = Object.assign ? Object.assign.bind() : function(e) {
752
- for (var t = 1; t < arguments.length; t++) {
753
- var n = arguments[t];
754
- for (var r in n)
755
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
756
- }
757
- return e;
758
- }, he.apply(this, arguments);
759
- }
760
- var ut = function(t) {
761
- return /* @__PURE__ */ _.createElement("svg", he({
762
- xmlns: "http://www.w3.org/2000/svg",
763
- width: 24,
764
- height: 24,
765
- fill: "none",
766
- viewBox: "0 0 24 24"
767
- }, t), Je || (Je = /* @__PURE__ */ _.createElement("path", {
768
- fill: "currentColor",
769
- 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"
770
- })), qe || (qe = /* @__PURE__ */ _.createElement("path", {
771
- fill: "#14C786",
772
- 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"
773
- })));
774
- }, Ke, Ge;
775
- function je() {
776
- return je = Object.assign ? Object.assign.bind() : function(e) {
777
- for (var t = 1; t < arguments.length; t++) {
778
- var n = arguments[t];
779
- for (var r in n)
780
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
781
- }
782
- return e;
783
- }, je.apply(this, arguments);
784
- }
785
- var Ne = function(t) {
786
- return /* @__PURE__ */ _.createElement("svg", je({
787
- xmlns: "http://www.w3.org/2000/svg",
788
- width: 24,
789
- height: 24,
790
- fill: "none",
791
- viewBox: "0 0 24 24"
792
- }, t), Ke || (Ke = /* @__PURE__ */ _.createElement("path", {
793
- fill: "currentColor",
794
- 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"
795
- })), Ge || (Ge = /* @__PURE__ */ _.createElement("path", {
796
- fill: "#14C786",
797
- 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"
798
- })));
799
- }, Xe, Qe;
800
- function be() {
801
- return be = Object.assign ? Object.assign.bind() : function(e) {
802
- for (var t = 1; t < arguments.length; t++) {
803
- var n = arguments[t];
804
- for (var r in n)
805
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
806
- }
807
- return e;
808
- }, be.apply(this, arguments);
809
- }
810
- var Oe = function(t) {
811
- return /* @__PURE__ */ _.createElement("svg", be({
812
- xmlns: "http://www.w3.org/2000/svg",
813
- width: 24,
814
- height: 24,
815
- fill: "none",
816
- viewBox: "0 0 24 24"
817
- }, t), Xe || (Xe = /* @__PURE__ */ _.createElement("path", {
818
- fill: "#DA0000",
819
- 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"
820
- })), Qe || (Qe = /* @__PURE__ */ _.createElement("path", {
821
- fill: "currentColor",
822
- 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"
823
- })));
824
- };
825
- function on({ originNode: e, node: t, depth: n, index: r, deleteHandle: l, customOptions: i, startIndex: o, parent: c, parentPath: u }) {
826
- const { enableClipboard: d, src: g, onEdit: m, onChange: y, forceUpdate: E, displaySize: w, CustomOperation: C } = J(W), N = [...u, String(r)], [A, D] = F(!0), P = ne((S, x, H) => {
827
- e[S] = x, m && m({
828
- newValue: x,
829
- oldValue: H,
830
- depth: n,
831
- src: g,
832
- indexOrName: S,
833
- parentType: "array",
834
- parentPath: u
835
- }), y && y({ type: "edit", depth: n, src: g, indexOrName: S, parentType: "array", parentPath: u }), E();
836
- }, [t, m, y, E]), v = (S) => {
837
- e.splice(S, 1), l && l(S, u), E();
838
- }, h = a.jsxs(a.Fragment, { children: [!A && a.jsxs("span", Object.assign({ onClick: () => D(!0), className: "jv-size-chevron" }, { children: [G(w, n, A) && a.jsxs("span", Object.assign({ className: "jv-size" }, { children: [te(t), " Items"] })), a.jsx(_e, { className: "jv-chevron" })] })), !A && d && oe(i) && a.jsx(ie, { node: t, nodeMeta: { depth: n, indexOrName: r, parent: c, parentPath: u, currentPath: N } }), typeof C == "function" ? a.jsx(C, { node: t }) : null] });
839
- return a.jsxs("div", { children: [a.jsx("span", { children: "[" }), h, A ? a.jsxs("button", Object.assign({ onClick: () => D(!1), className: "jv-button" }, { children: [o, " ... ", o + t.length - 1] })) : a.jsx("div", Object.assign({ className: "jv-indent" }, { children: t.map((S, x) => a.jsx(me, { indexOrName: x + o, value: S, depth: n, parent: t, deleteHandle: v, editHandle: P, parentPath: u }, String(r) + String(x))) })), a.jsx("span", { children: "]" })] });
840
- }
841
- function ln({ node: e, depth: t, deleteHandle: n, indexOrName: r, customOptions: l, parent: i, parentPath: o }) {
842
- const c = typeof r < "u" ? [...o, String(r)] : o, u = [];
843
- for (let T = 0; T < e.length; T += 100)
844
- u.push(e.slice(T, T + 100));
845
- const { collapsed: d, enableClipboard: g, collapseObjectsAfterLength: m, editable: y, onDelete: E, src: w, onAdd: C, CustomOperation: N, onChange: A, forceUpdate: D, displaySize: P } = J(W), [v, h] = F(Fe(e, t, r, d, m, l));
846
- xe(() => {
847
- h(Fe(e, t, r, d, m, l));
848
- }, [d, m]);
849
- const [S, x] = F(!1), H = () => {
850
- x(!1), n && n(r, o), E && E({ value: e, depth: t, src: w, indexOrName: r, parentType: "array", parentPath: o }), A && A({
851
- type: "delete",
852
- depth: t,
853
- src: w,
854
- indexOrName: r,
855
- parentType: "array",
856
- parentPath: o
857
- });
858
- }, [O, Y] = F(!1), R = () => {
859
- const T = e;
860
- T.push(null), C && C({ indexOrName: T.length - 1, depth: t, src: w, parentType: "array", parentPath: o }), A && A({ type: "add", indexOrName: T.length - 1, depth: t, src: w, parentType: "array", parentPath: o }), D();
861
- }, L = S || O, U = () => {
862
- x(!1), Y(!1);
863
- }, Z = a.jsxs(a.Fragment, { children: [!v && !L && a.jsxs("span", Object.assign({ onClick: () => h(!0), className: "jv-size-chevron" }, { children: [G(P, t, v) && a.jsxs("span", Object.assign({ className: "jv-size" }, { children: [e.length, " Items"] })), a.jsx(_e, { className: "jv-chevron" })] })), L && a.jsx(Ne, { className: "json-view--edit", style: { display: "inline-block" }, onClick: O ? R : H }), L && a.jsx(Oe, { className: "json-view--edit", style: { display: "inline-block" }, onClick: U }), !v && !L && g && oe(l) && a.jsx(ie, { node: e, nodeMeta: { depth: t, indexOrName: r, parent: i, parentPath: o, currentPath: c } }), !v && !L && lt(y) && ct(l) && a.jsx(ut, { className: "json-view--edit", onClick: () => {
864
- R();
865
- } }), !v && !L && Se(y) && ke(l) && n && a.jsx(Te, { className: "json-view--edit", onClick: () => x(!0) }), typeof N == "function" ? a.jsx(N, { node: e }) : null] });
866
- return a.jsxs(a.Fragment, { children: [a.jsx("span", { children: "[" }), Z, v ? a.jsx("button", Object.assign({ onClick: () => h(!1), className: "jv-button" }, { children: "..." })) : a.jsx("div", Object.assign({ className: "jv-indent" }, { children: u.map((T, $) => a.jsx(on, { originNode: e, node: T, depth: t, index: $, startIndex: $ * 100, deleteHandle: n, customOptions: l, parentPath: o }, String(r) + String($))) })), a.jsx("span", { children: "]" }), v && G(P, t, v) && a.jsxs("span", Object.assign({ onClick: () => h(!1), className: "jv-size" }, { children: [e.length, " Items"] }))] });
867
- }
868
- function cn({ node: e, depth: t, indexOrName: n, deleteHandle: r, customOptions: l, parent: i, parentPath: o }) {
869
- const { collapsed: c, onCollapse: u, enableClipboard: d, ignoreLargeArray: g, collapseObjectsAfterLength: m, editable: y, onDelete: E, src: w, onAdd: C, onEdit: N, onChange: A, forceUpdate: D, displaySize: P, CustomOperation: v } = J(W), h = typeof n < "u" ? [...o, String(n)] : o;
870
- if (!g && Array.isArray(e) && e.length > 100)
871
- return a.jsx(ln, { node: e, depth: t, indexOrName: n, deleteHandle: r, customOptions: l, parentPath: h });
872
- const S = B(e), [x, H] = F(Me(e, t, n, c, m, l)), O = (f) => {
873
- u?.({ isCollapsing: !f, node: e, depth: t, indexOrName: n }), H(f);
874
- };
875
- xe(() => {
876
- O(Me(e, t, n, c, m, l));
877
- }, [c, m]);
878
- const Y = ne((f, j, z) => {
879
- Array.isArray(e) ? e[+f] = j : e && (e[f] = j), N && N({
880
- newValue: j,
881
- oldValue: z,
882
- depth: t,
883
- src: w,
884
- indexOrName: f,
885
- parentType: S ? "object" : "array",
886
- parentPath: h
887
- }), A && A({ type: "edit", depth: t, src: w, indexOrName: f, parentType: S ? "object" : "array", parentPath: h }), D();
888
- }, [e, N, A, D]), R = (f) => {
889
- Array.isArray(e) ? e.splice(+f, 1) : e && delete e[f], D();
890
- }, [L, U] = F(!1), Z = () => {
891
- U(!1), r && r(n, h), E && E({ value: e, depth: t, src: w, indexOrName: n, parentType: S ? "object" : "array", parentPath: h }), A && A({
892
- type: "delete",
893
- depth: t,
894
- src: w,
895
- indexOrName: n,
896
- parentType: S ? "object" : "array",
897
- parentPath: h
898
- });
899
- }, [T, $] = F(!1), k = Ce(null), V = () => {
900
- var f;
901
- if (S) {
902
- const j = (f = k.current) === null || f === void 0 ? void 0 : f.value;
903
- j && (e[j] = null, k.current && (k.current.value = ""), $(!1), C && C({ indexOrName: j, depth: t, src: w, parentType: "object", parentPath: h }), A && A({ type: "add", indexOrName: j, depth: t, src: w, parentType: "object", parentPath: h }));
904
- } else if (Array.isArray(e)) {
905
- const j = e;
906
- j.push(null), C && C({ indexOrName: j.length - 1, depth: t, src: w, parentType: "array", parentPath: h }), A && A({ type: "add", indexOrName: j.length - 1, depth: t, src: w, parentType: "array", parentPath: h });
907
- }
908
- D();
909
- }, M = (f) => {
910
- f.key === "Enter" ? (f.preventDefault(), V()) : f.key === "Escape" && p();
911
- }, s = L || T, p = () => {
912
- U(!1), $(!1);
913
- }, b = a.jsxs(a.Fragment, { children: [!x && !s && a.jsxs("span", Object.assign({ onClick: () => O(!0), className: "jv-size-chevron" }, { children: [G(P, t, x) && a.jsxs("span", Object.assign({ className: "jv-size" }, { children: [te(e), " Items"] })), a.jsx(_e, { className: "jv-chevron" })] })), T && S && a.jsx("input", { className: "json-view--input", placeholder: "property", ref: k, onKeyDown: M }), s && a.jsx(Ne, { className: "json-view--edit", style: { display: "inline-block" }, onClick: T ? V : Z }), s && a.jsx(Oe, { className: "json-view--edit", style: { display: "inline-block" }, onClick: p }), !x && !s && d && oe(l) && a.jsx(ie, { node: e, nodeMeta: { depth: t, indexOrName: n, parent: i, parentPath: o, currentPath: h } }), !x && !s && lt(y) && ct(l) && a.jsx(ut, { className: "json-view--edit", onClick: () => {
914
- S ? ($(!0), setTimeout(() => {
915
- var f;
916
- return (f = k.current) === null || f === void 0 ? void 0 : f.focus();
917
- })) : V();
918
- } }), !x && !s && Se(y) && ke(l) && r && a.jsx(Te, { className: "json-view--edit", onClick: () => U(!0) }), typeof v == "function" ? a.jsx(v, { node: e }) : null] });
919
- return Array.isArray(e) ? a.jsxs(a.Fragment, { children: [a.jsx("span", { children: "[" }), b, x ? a.jsx("button", Object.assign({ onClick: () => O(!1), className: "jv-button" }, { children: "..." })) : a.jsx("div", Object.assign({ className: "jv-indent" }, { children: e.map((f, j) => a.jsx(me, { indexOrName: j, value: f, depth: t, parent: e, deleteHandle: R, editHandle: Y, parentPath: h }, String(n) + String(j))) })), a.jsx("span", { children: "]" }), x && G(P, t, x) && a.jsxs("span", Object.assign({ onClick: () => O(!1), className: "jv-size" }, { children: [te(e), " Items"] }))] }) : S ? a.jsxs(a.Fragment, { children: [a.jsx("span", { children: "{" }), b, x ? a.jsx("button", Object.assign({ onClick: () => O(!1), className: "jv-button" }, { children: "..." })) : a.jsx("div", Object.assign({ className: "jv-indent" }, { children: Object.entries(e).map(([f, j]) => a.jsx(me, { indexOrName: f, value: j, depth: t, parent: e, deleteHandle: R, editHandle: Y, parentPath: h }, String(n) + String(f))) })), a.jsx("span", { children: "}" }), x && G(P, t, x) && a.jsxs("span", Object.assign({ onClick: () => O(!1), className: "jv-size" }, { children: [te(e), " Items"] }))] }) : a.jsx("span", { children: String(e) });
920
- }
921
- const un = K.forwardRef(({ str: e, className: t, ctrlClick: n }, r) => {
922
- let { collapseStringMode: l, collapseStringsAfterLength: i, customizeCollapseStringUI: o } = J(W);
923
- const [c, u] = F(!0), d = Ce(null);
924
- i = i > 0 ? i : 0;
925
- const g = e.replace(/\s+/g, " "), m = typeof o == "function" ? o(g, c) : typeof o == "string" ? o : "...", y = (E) => {
926
- var w;
927
- if ((E.ctrlKey || E.metaKey) && n)
928
- n(E);
929
- else {
930
- const C = window.getSelection();
931
- if (C && C.anchorOffset !== C.focusOffset && ((w = C.anchorNode) === null || w === void 0 ? void 0 : w.parentElement) === d.current)
932
- return;
933
- u(!c);
934
- }
935
- };
936
- if (e.length <= i)
937
- return a.jsxs("span", Object.assign({ ref: d, className: t, onClick: n }, { children: ['"', e, '"'] }));
938
- if (l === "address")
939
- return e.length <= 10 ? a.jsxs("span", Object.assign({ ref: d, className: t, onClick: n }, { children: ['"', e, '"'] })) : a.jsxs("span", Object.assign({ ref: d, onClick: y, className: t + " cursor-pointer" }, { children: ['"', c ? [g.slice(0, 6), m, g.slice(-4)] : e, '"'] }));
940
- if (l === "directly")
941
- return a.jsxs("span", Object.assign({ ref: d, onClick: y, className: t + " cursor-pointer" }, { children: ['"', c ? [g.slice(0, i), m] : e, '"'] }));
942
- if (l === "word") {
943
- let E = i, w = i + 1, C = g, N = 1;
944
- for (; ; ) {
945
- if (/\W/.test(e[E])) {
946
- C = e.slice(0, E);
947
- break;
948
- }
949
- if (/\W/.test(e[w])) {
950
- C = e.slice(0, w);
951
- break;
952
- }
953
- if (N === 6) {
954
- C = e.slice(0, i);
955
- break;
956
- }
957
- N++, E--, w++;
958
- }
959
- return a.jsxs("span", Object.assign({ ref: d, onClick: y, className: t + " cursor-pointer" }, { children: ['"', c ? [C, m] : e, '"'] }));
960
- }
961
- return a.jsxs("span", Object.assign({ ref: d, className: t }, { children: ['"', e, '"'] }));
962
- });
963
- var et;
964
- function ye() {
965
- return ye = Object.assign ? Object.assign.bind() : function(e) {
966
- for (var t = 1; t < arguments.length; t++) {
967
- var n = arguments[t];
968
- for (var r in n)
969
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
970
- }
971
- return e;
972
- }, ye.apply(this, arguments);
973
- }
974
- var fn = function(t) {
975
- return /* @__PURE__ */ _.createElement("svg", ye({
976
- xmlns: "http://www.w3.org/2000/svg",
977
- width: 24,
978
- height: 24,
979
- fill: "none",
980
- viewBox: "0 0 24 24"
981
- }, t), et || (et = /* @__PURE__ */ _.createElement("path", {
982
- fill: "currentColor",
983
- 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"
984
- })));
985
- }, tt, nt;
986
- function we() {
987
- return we = Object.assign ? Object.assign.bind() : function(e) {
988
- for (var t = 1; t < arguments.length; t++) {
989
- var n = arguments[t];
990
- for (var r in n)
991
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
992
- }
993
- return e;
994
- }, we.apply(this, arguments);
995
- }
996
- var dn = function(t) {
997
- return /* @__PURE__ */ _.createElement("svg", we({
998
- xmlns: "http://www.w3.org/2000/svg",
999
- width: 24,
1000
- height: 24,
1001
- fill: "none",
1002
- viewBox: "0 0 24 24"
1003
- }, t), tt || (tt = /* @__PURE__ */ _.createElement("path", {
1004
- fill: "currentColor",
1005
- 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"
1006
- })), nt || (nt = /* @__PURE__ */ _.createElement("path", {
1007
- fill: "currentColor",
1008
- 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"
1009
- })));
1010
- };
1011
- function ft({ node: e, depth: t, deleteHandle: n, indexOrName: r, parent: l, editHandle: i, parentPath: o }) {
1012
- const { collapseStringsAfterLength: c, enableClipboard: u, editable: d, src: g, onDelete: m, onChange: y, customizeNode: E, matchesURL: w, urlRegExp: C, EditComponent: N, DoneComponent: A, CancelComponent: D, CustomOperation: P } = J(W);
1013
- let v;
1014
- if (typeof E == "function" && (v = Ae(E, [{ node: e, depth: t, indexOrName: r }])), v) {
1015
- if (vt(v))
1016
- return v;
1017
- if (tn(v)) {
1018
- const h = v;
1019
- return a.jsx(h, { node: e, depth: t, indexOrName: r });
1020
- }
1021
- }
1022
- if (Array.isArray(e) || B(e))
1023
- return a.jsx(cn, { parent: l, node: e, depth: t, indexOrName: r, deleteHandle: n, parentPath: o, customOptions: typeof v == "object" ? v : void 0 });
1024
- {
1025
- const h = typeof e, S = typeof r < "u" ? [...o, String(r)] : o, [x, H] = F(!1), [O, Y] = F(!1), R = Ce(null), L = () => {
1026
- H(!0), setTimeout(() => {
1027
- var f, j;
1028
- (f = window.getSelection()) === null || f === void 0 || f.selectAllChildren(R.current), (j = R.current) === null || j === void 0 || j.focus();
1029
- });
1030
- }, U = ne(() => {
1031
- let f = R.current.innerText;
1032
- try {
1033
- const j = JSON.parse(f);
1034
- i && i(r, j, e, o);
1035
- } catch {
1036
- const z = rn(h, f);
1037
- i && i(r, z, e, o);
1038
- }
1039
- H(!1);
1040
- }, [i, r, e, o, h]), Z = () => {
1041
- H(!1), Y(!1);
1042
- }, T = () => {
1043
- Y(!1), n && n(r, o), m && m({
1044
- value: e,
1045
- depth: t,
1046
- src: g,
1047
- indexOrName: r,
1048
- parentType: Array.isArray(l) ? "array" : "object",
1049
- parentPath: o
1050
- }), y && y({
1051
- depth: t,
1052
- src: g,
1053
- indexOrName: r,
1054
- parentType: Array.isArray(l) ? "array" : "object",
1055
- type: "delete",
1056
- parentPath: o
1057
- });
1058
- }, $ = ne((f) => {
1059
- f.key === "Enter" ? (f.preventDefault(), U()) : f.key === "Escape" && Z();
1060
- }, [U]), k = x || O, V = !k && He(d) && Ue(v) && i ? (f) => {
1061
- (f.ctrlKey || f.metaKey) && L();
1062
- } : void 0, M = a.jsxs(a.Fragment, { children: [k && (typeof A == "function" ? a.jsx(A, { className: "json-view--edit", style: { display: "inline-block" }, onClick: O ? T : U }) : a.jsx(Ne, { className: "json-view--edit", style: { display: "inline-block" }, onClick: O ? T : U })), k && (typeof D == "function" ? a.jsx(D, { className: "json-view--edit", style: { display: "inline-block" }, onClick: Z }) : a.jsx(Oe, { className: "json-view--edit", style: { display: "inline-block" }, onClick: Z })), !k && u && oe(v) && a.jsx(ie, { node: e, nodeMeta: { depth: t, indexOrName: r, parent: l, parentPath: o, currentPath: S } }), !k && w && h === "string" && C.test(e) && nn(v) && a.jsx("a", Object.assign({ href: e, target: "_blank", className: "json-view--link" }, { children: a.jsx(dn, {}) })), !k && He(d) && Ue(v) && i && (typeof N == "function" ? a.jsx(N, { className: "json-view--edit", onClick: L }) : a.jsx(fn, { className: "json-view--edit", onClick: L })), !k && Se(d) && ke(v) && n && a.jsx(Te, { className: "json-view--edit", onClick: () => Y(!0) }), typeof P == "function" ? a.jsx(P, { node: e }) : null] });
1063
- let s = "json-view--string";
1064
- switch (h) {
1065
- case "number":
1066
- case "bigint":
1067
- s = "json-view--number";
1068
- break;
1069
- case "boolean":
1070
- s = "json-view--boolean";
1071
- break;
1072
- case "object":
1073
- s = "json-view--null";
1074
- break;
1075
- }
1076
- typeof v?.className == "string" && (s += " " + v.className), O && (s += " json-view--deleting");
1077
- let p = String(e);
1078
- h === "bigint" && (p += "n");
1079
- const b = se(() => a.jsx("span", { contentEditable: !0, className: s, dangerouslySetInnerHTML: { __html: h === "string" ? `"${p}"` : p }, ref: R, onKeyDown: $ }), [p, h, $]);
1080
- return h === "string" ? a.jsxs(a.Fragment, { children: [x ? b : e.length > c ? a.jsx(un, { str: e, ref: R, className: s, ctrlClick: V }) : a.jsxs("span", Object.assign({ className: s, onClick: V }, { children: ['"', p, '"'] })), M] }) : a.jsxs(a.Fragment, { children: [x ? b : a.jsx("span", Object.assign({ className: s, onClick: V }, { children: p })), M] });
1081
- }
1082
- }
1083
- const dt = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/, W = mt({
1084
- src: void 0,
1085
- collapseStringsAfterLength: 99,
1086
- collapseStringMode: "directly",
1087
- customizeCollapseStringUI: void 0,
1088
- collapseObjectsAfterLength: 20,
1089
- collapsed: !1,
1090
- onCollapse: void 0,
1091
- enableClipboard: !0,
1092
- editable: !1,
1093
- onEdit: void 0,
1094
- onDelete: void 0,
1095
- onAdd: void 0,
1096
- onChange: void 0,
1097
- forceUpdate: () => {
1098
- },
1099
- customizeNode: void 0,
1100
- customizeCopy: () => {
1101
- },
1102
- displaySize: void 0,
1103
- displayArrayIndex: !0,
1104
- matchesURL: !1,
1105
- urlRegExp: dt,
1106
- ignoreLargeArray: !1,
1107
- CopyComponent: void 0,
1108
- CopiedComponent: void 0,
1109
- EditComponent: void 0,
1110
- CancelComponent: void 0,
1111
- DoneComponent: void 0,
1112
- CustomOperation: void 0
1113
- });
1114
- function pn({ src: e, collapseStringsAfterLength: t = 99, collapseStringMode: n = "directly", customizeCollapseStringUI: r, collapseObjectsAfterLength: l = 99, collapsed: i, onCollapse: o, enableClipboard: c = !0, editable: u = !1, onEdit: d, onDelete: g, onAdd: m, onChange: y, dark: E = !1, theme: w = "default", customizeNode: C, customizeCopy: N = (Z) => Qt(Z), displaySize: A, displayArrayIndex: D = !0, style: P, className: v, matchesURL: h = !1, urlRegExp: S = dt, ignoreLargeArray: x = !1, CopyComponent: H, CopiedComponent: O, EditComponent: Y, CancelComponent: R, DoneComponent: L, CustomOperation: U }) {
1115
- const [Z, T] = F(0), $ = ne(() => T((M) => ++M), []), [k, V] = F(e);
1116
- return xe(() => V(e), [e]), a.jsx(W.Provider, Object.assign({ value: {
1117
- src: k,
1118
- collapseStringsAfterLength: t,
1119
- collapseStringMode: n,
1120
- customizeCollapseStringUI: r,
1121
- collapseObjectsAfterLength: l,
1122
- collapsed: i,
1123
- onCollapse: o,
1124
- enableClipboard: c,
1125
- editable: u,
1126
- onEdit: d,
1127
- onDelete: g,
1128
- onAdd: m,
1129
- onChange: y,
1130
- forceUpdate: $,
1131
- customizeNode: C,
1132
- customizeCopy: N,
1133
- displaySize: A,
1134
- displayArrayIndex: D,
1135
- matchesURL: h,
1136
- urlRegExp: S,
1137
- ignoreLargeArray: x,
1138
- CopyComponent: H,
1139
- CopiedComponent: O,
1140
- EditComponent: Y,
1141
- CancelComponent: R,
1142
- DoneComponent: L,
1143
- CustomOperation: U
1144
- } }, { children: a.jsx("code", Object.assign({ className: "json-view" + (E ? " dark" : "") + (w && w !== "default" ? " json-view_" + w : "") + (v ? " " + v : ""), style: P }, { children: a.jsx(ft, { node: k, depth: 1, editHandle: (M, s, p, b) => {
1145
- V(s), d && d({
1146
- newValue: s,
1147
- oldValue: p,
1148
- depth: 1,
1149
- src: k,
1150
- indexOrName: M,
1151
- parentType: null,
1152
- parentPath: b
1153
- }), y && y({ type: "edit", depth: 1, src: k, indexOrName: M, parentType: null, parentPath: b });
1154
- }, deleteHandle: (M, s) => {
1155
- V(void 0), g && g({
1156
- value: k,
1157
- depth: 1,
1158
- src: k,
1159
- indexOrName: M,
1160
- parentType: null,
1161
- parentPath: s
1162
- }), y && y({
1163
- depth: 1,
1164
- src: k,
1165
- indexOrName: M,
1166
- parentType: null,
1167
- type: "delete",
1168
- parentPath: s
1169
- });
1170
- }, parentPath: [] }) })) }));
1171
- }
1172
- const gn = ["id", "msg", "time", "level", "step", "flows", "traceId"], mn = ({ log: e, onClose: t }) => {
1173
- const [n, r] = F(!1), l = se(() => {
1174
- if (!e)
293
+ }()), _;
294
+ }
295
+ var q;
296
+ function ke() {
297
+ return q || (q = 1, process.env.NODE_ENV === "production" ? w.exports = je() : w.exports = Se()), w.exports;
298
+ }
299
+ var o = ke();
300
+ const X = (t) => {
301
+ const l = new Date(Number(t));
302
+ return `${l.toLocaleDateString("en-US", { year: void 0, month: "short", day: "2-digit" })}, ${l.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", second: "2-digit", hourCycle: "h24" })}.${l.getMilliseconds().toString().padStart(3, "0")}`;
303
+ }, Ne = ["id", "msg", "time", "level", "step", "flows", "traceId"], Oe = ({ log: t, onClose: l }) => {
304
+ const [u, m] = z(!1), d = L(() => {
305
+ if (!t)
1175
306
  return null;
1176
- const i = Object.keys(e ?? {}).filter((o) => !gn.includes(o));
1177
- return r(i.length > 0), i.reduce(
1178
- (o, c) => (o[c] = e[c], o),
307
+ const s = Object.keys(t ?? {}).filter((f) => !Ne.includes(f));
308
+ return m(s.length > 0), s.reduce(
309
+ (f, p) => (f[p] = t[p], f),
1179
310
  {}
1180
311
  );
1181
- }, [e]);
1182
- return e ? /* @__PURE__ */ a.jsx(
1183
- ht,
312
+ }, [t]);
313
+ return t ? /* @__PURE__ */ o.jsx(
314
+ de,
1184
315
  {
1185
- onClose: t,
316
+ onClose: l,
1186
317
  title: "Logs Details",
1187
318
  subtitle: "Details including custom properties",
1188
- actions: [{ icon: /* @__PURE__ */ a.jsx(ot, {}), onClick: t, label: "Close" }],
319
+ actions: [{ icon: /* @__PURE__ */ o.jsx(V, {}), onClick: l, label: "Close" }],
1189
320
  details: [
1190
321
  {
1191
322
  label: "Level",
1192
- value: /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
1193
- /* @__PURE__ */ a.jsx(at, { level: e.level }),
1194
- /* @__PURE__ */ a.jsx("div", { className: "capitalize", children: e.level })
323
+ value: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2", children: [
324
+ /* @__PURE__ */ o.jsx(G, { level: t.level }),
325
+ /* @__PURE__ */ o.jsx("div", { className: "capitalize", children: t.level })
1195
326
  ] })
1196
327
  },
1197
- { label: "Time", value: it(e.time) },
1198
- { label: "Step", value: e.step },
1199
- { label: "Flows", value: e.flows.join(", ") },
1200
- { label: "Trace ID", value: e.traceId }
328
+ { label: "Time", value: X(t.time) },
329
+ { label: "Step", value: t.step },
330
+ { label: "Flows", value: t.flows.join(", ") },
331
+ { label: "Trace ID", value: t.traceId }
1201
332
  ],
1202
- children: n && /* @__PURE__ */ a.jsx(pn, { src: l, theme: "default", enableClipboard: !0 })
333
+ children: u && /* @__PURE__ */ o.jsx(_e, { src: d, theme: "default", enableClipboard: !0 })
1203
334
  }
1204
335
  ) : null;
1205
- }, bn = () => {
1206
- const e = ee((u) => u.logs), t = ee((u) => u.resetLogs), n = ee((u) => u.selectedLogId), r = ee((u) => u.selectLogId), l = se(
1207
- () => n ? e.find((u) => u.id === n) : void 0,
1208
- [e, n]
1209
- ), [i, o] = F(""), c = se(() => e.filter((u) => u.msg.toLowerCase().includes(i.toLowerCase()) || u.traceId.toLowerCase().includes(i.toLowerCase()) || u.step.toLowerCase().includes(i.toLowerCase())), [e, i]);
1210
- return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
1211
- /* @__PURE__ */ a.jsxs("div", { className: "grid grid-rows-[auto_1fr] h-full", "data-testid": "logs-container", children: [
1212
- /* @__PURE__ */ a.jsxs("div", { className: "flex p-2 border-b gap-2", "data-testid": "logs-search-container", children: [
1213
- /* @__PURE__ */ a.jsxs("div", { className: "flex-1 relative", children: [
1214
- /* @__PURE__ */ a.jsx(
1215
- jt,
336
+ }, $e = () => {
337
+ const t = x((a) => a.logs), l = x((a) => a.resetLogs), u = x((a) => a.selectedLogId), m = x((a) => a.selectLogId), d = L(
338
+ () => u ? t.find((a) => a.id === u) : void 0,
339
+ [t, u]
340
+ ), [s, f] = z(""), p = L(() => t.filter((a) => a.msg.toLowerCase().includes(s.toLowerCase()) || a.traceId.toLowerCase().includes(s.toLowerCase()) || a.step.toLowerCase().includes(s.toLowerCase())), [t, s]);
341
+ return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
342
+ /* @__PURE__ */ o.jsxs("div", { className: "grid grid-rows-[auto_1fr] h-full", "data-testid": "logs-container", children: [
343
+ /* @__PURE__ */ o.jsxs("div", { className: "flex p-2 border-b gap-2", "data-testid": "logs-search-container", children: [
344
+ /* @__PURE__ */ o.jsxs("div", { className: "flex-1 relative", children: [
345
+ /* @__PURE__ */ o.jsx(
346
+ fe,
1216
347
  {
1217
348
  variant: "shade",
1218
- value: i,
1219
- onChange: (u) => o(u.target.value),
349
+ value: s,
350
+ onChange: (a) => f(a.target.value),
1220
351
  className: "px-9 font-medium",
1221
352
  placeholder: "Search by Trace ID or Message"
1222
353
  }
1223
354
  ),
1224
- /* @__PURE__ */ a.jsx(Zt, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
1225
- /* @__PURE__ */ a.jsx(
1226
- ot,
355
+ /* @__PURE__ */ o.jsx(ge, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
356
+ /* @__PURE__ */ o.jsx(
357
+ V,
1227
358
  {
1228
359
  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",
1229
- onClick: () => o("")
360
+ onClick: () => f("")
1230
361
  }
1231
362
  )
1232
363
  ] }),
1233
- /* @__PURE__ */ a.jsxs(bt, { variant: "default", onClick: t, className: "h-[34px]", children: [
1234
- /* @__PURE__ */ a.jsx(zt, {}),
364
+ /* @__PURE__ */ o.jsxs(me, { variant: "default", onClick: l, className: "h-[34px]", children: [
365
+ /* @__PURE__ */ o.jsx(Ee, {}),
1235
366
  " Clear"
1236
367
  ] })
1237
368
  ] }),
1238
- /* @__PURE__ */ a.jsx(yt, { children: /* @__PURE__ */ a.jsx(wt, { className: "font-mono font-medium", children: c.map((u, d) => /* @__PURE__ */ a.jsxs(
1239
- xt,
369
+ /* @__PURE__ */ o.jsx(pe, { children: /* @__PURE__ */ o.jsx(be, { className: "font-mono font-medium", children: p.map((a, h) => /* @__PURE__ */ o.jsxs(
370
+ ve,
1240
371
  {
1241
372
  "data-testid": "log-row",
1242
- className: Ct("font-mono font-semibold cursor-pointer border-0", {
1243
- "bg-muted-foreground/10 hover:bg-muted-foreground/20": n === u.id,
1244
- "hover:bg-muted-foreground/10": n !== u.id
373
+ className: he("font-mono font-semibold cursor-pointer border-0", {
374
+ "bg-muted-foreground/10 hover:bg-muted-foreground/20": u === a.id,
375
+ "hover:bg-muted-foreground/10": u !== a.id
1245
376
  }),
1246
- onClick: () => r(u.id),
377
+ onClick: () => m(a.id),
1247
378
  children: [
1248
- /* @__PURE__ */ a.jsxs(
1249
- re,
379
+ /* @__PURE__ */ o.jsxs(
380
+ T,
1250
381
  {
1251
- "data-testid": `time-${d}`,
382
+ "data-testid": `time-${h}`,
1252
383
  className: "whitespace-nowrap flex items-center gap-2 text-muted-foreground",
1253
384
  children: [
1254
- /* @__PURE__ */ a.jsx(at, { level: u.level }),
1255
- it(u.time)
385
+ /* @__PURE__ */ o.jsx(G, { level: a.level }),
386
+ X(a.time)
1256
387
  ]
1257
388
  }
1258
389
  ),
1259
- /* @__PURE__ */ a.jsx(
1260
- re,
390
+ /* @__PURE__ */ o.jsx(
391
+ T,
1261
392
  {
1262
- "data-testid": `trace-${u.traceId}`,
393
+ "data-testid": `trace-${a.traceId}`,
1263
394
  className: "whitespace-nowrap cursor-pointer hover:text-primary text-muted-foreground",
1264
- onClick: () => o(u.traceId),
1265
- children: u.traceId
395
+ onClick: () => f(a.traceId),
396
+ children: a.traceId
1266
397
  }
1267
398
  ),
1268
- /* @__PURE__ */ a.jsx(re, { "data-testid": `step-${d}`, "aria-label": u.step, className: "whitespace-nowrap", children: u.step }),
1269
- /* @__PURE__ */ a.jsx(
1270
- re,
399
+ /* @__PURE__ */ o.jsx(T, { "data-testid": `step-${h}`, "aria-label": a.step, className: "whitespace-nowrap", children: a.step }),
400
+ /* @__PURE__ */ o.jsx(
401
+ T,
1271
402
  {
1272
- "data-testid": `msg-${d}`,
1273
- "aria-label": u.msg,
403
+ "data-testid": `msg-${h}`,
404
+ "aria-label": a.msg,
1274
405
  className: "whitespace-nowrap max-w-[500px] truncate w-full",
1275
- children: u.msg
406
+ children: a.msg
1276
407
  }
1277
408
  )
1278
409
  ]
1279
410
  },
1280
- d
411
+ h
1281
412
  )) }) })
1282
413
  ] }),
1283
- /* @__PURE__ */ a.jsx(mn, { log: l, onClose: () => r(void 0) })
414
+ /* @__PURE__ */ o.jsx(Oe, { log: d, onClose: () => m(void 0) })
1284
415
  ] });
1285
416
  };
1286
- Rt();
417
+ we();
1287
418
  export {
1288
- bn as LogsPage
419
+ $e as LogsPage
1289
420
  };