@motiadev/plugin-bullmq 0.13.0-beta.162-717198

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/index.js ADDED
@@ -0,0 +1,2636 @@
1
+ import * as T from "react";
2
+ import de, { useCallback as C, useEffect as ie, forwardRef as _t, createElement as Me, useState as I, createContext as ln, useContext as le, isValidElement as cn, useRef as qe, useMemo as ye, memo as Y } from "react";
3
+ import { Button as Z, TooltipProvider as Rt, Tooltip as ee, TooltipTrigger as te, TooltipContent as ne, Table as Tt, TableHeader as Mt, TableRow as Ne, TableHead as B, TableBody as Ot, TableCell as K, Sidebar as Pt, cn as re, DropdownMenu as Lt, DropdownMenuTrigger as Qt, DropdownMenuContent as Jt, DropdownMenuItem as ue, DropdownMenuSeparator as dn, Tabs as un, TabsList as fn, TabsTrigger as mn, Input as hn } from "@motiadev/ui";
4
+ var be = { exports: {} }, he = {};
5
+ /**
6
+ * @license React
7
+ * react-jsx-runtime.production.js
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 tt;
15
+ function pn() {
16
+ if (tt) return he;
17
+ tt = 1;
18
+ var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
19
+ function s(a, o, i) {
20
+ var r = null;
21
+ if (i !== void 0 && (r = "" + i), o.key !== void 0 && (r = "" + o.key), "key" in o) {
22
+ i = {};
23
+ for (var c in o)
24
+ c !== "key" && (i[c] = o[c]);
25
+ } else i = o;
26
+ return o = i.ref, {
27
+ $$typeof: e,
28
+ type: a,
29
+ key: r,
30
+ ref: o !== void 0 ? o : null,
31
+ props: i
32
+ };
33
+ }
34
+ return he.Fragment = n, he.jsx = s, he.jsxs = s, he;
35
+ }
36
+ var pe = {};
37
+ /**
38
+ * @license React
39
+ * react-jsx-runtime.development.js
40
+ *
41
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
42
+ *
43
+ * This source code is licensed under the MIT license found in the
44
+ * LICENSE file in the root directory of this source tree.
45
+ */
46
+ var nt;
47
+ function xn() {
48
+ return nt || (nt = 1, process.env.NODE_ENV !== "production" && function() {
49
+ function e(l) {
50
+ if (l == null) return null;
51
+ if (typeof l == "function")
52
+ return l.$$typeof === X ? null : l.displayName || l.name || null;
53
+ if (typeof l == "string") return l;
54
+ switch (l) {
55
+ case j:
56
+ return "Fragment";
57
+ case g:
58
+ return "Profiler";
59
+ case _:
60
+ return "StrictMode";
61
+ case w:
62
+ return "Suspense";
63
+ case A:
64
+ return "SuspenseList";
65
+ case P:
66
+ return "Activity";
67
+ }
68
+ if (typeof l == "object")
69
+ switch (typeof l.tag == "number" && console.error(
70
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
71
+ ), l.$$typeof) {
72
+ case v:
73
+ return "Portal";
74
+ case S:
75
+ return (l.displayName || "Context") + ".Provider";
76
+ case b:
77
+ return (l._context.displayName || "Context") + ".Consumer";
78
+ case N:
79
+ var y = l.render;
80
+ return l = l.displayName, l || (l = y.displayName || y.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
81
+ case E:
82
+ return y = l.displayName || null, y !== null ? y : e(l.type) || "Memo";
83
+ case W:
84
+ y = l._payload, l = l._init;
85
+ try {
86
+ return e(l(y));
87
+ } catch {
88
+ }
89
+ }
90
+ return null;
91
+ }
92
+ function n(l) {
93
+ return "" + l;
94
+ }
95
+ function s(l) {
96
+ try {
97
+ n(l);
98
+ var y = !1;
99
+ } catch {
100
+ y = !0;
101
+ }
102
+ if (y) {
103
+ y = console;
104
+ var D = y.error, p = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
105
+ return D.call(
106
+ y,
107
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
108
+ p
109
+ ), n(l);
110
+ }
111
+ }
112
+ function a(l) {
113
+ if (l === j) return "<>";
114
+ if (typeof l == "object" && l !== null && l.$$typeof === W)
115
+ return "<...>";
116
+ try {
117
+ var y = e(l);
118
+ return y ? "<" + y + ">" : "<...>";
119
+ } catch {
120
+ return "<...>";
121
+ }
122
+ }
123
+ function o() {
124
+ var l = L.A;
125
+ return l === null ? null : l.getOwner();
126
+ }
127
+ function i() {
128
+ return Error("react-stack-top-frame");
129
+ }
130
+ function r(l) {
131
+ if (Q.call(l, "key")) {
132
+ var y = Object.getOwnPropertyDescriptor(l, "key").get;
133
+ if (y && y.isReactWarning) return !1;
134
+ }
135
+ return l.key !== void 0;
136
+ }
137
+ function c(l, y) {
138
+ function D() {
139
+ O || (O = !0, console.error(
140
+ "%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
+ y
142
+ ));
143
+ }
144
+ D.isReactWarning = !0, Object.defineProperty(l, "key", {
145
+ get: D,
146
+ configurable: !0
147
+ });
148
+ }
149
+ function d() {
150
+ var l = e(this.type);
151
+ return $[l] || ($[l] = !0, console.error(
152
+ "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
+ )), l = this.props.ref, l !== void 0 ? l : null;
154
+ }
155
+ function m(l, y, D, p, k, V, Ae, _e) {
156
+ return D = V.ref, l = {
157
+ $$typeof: h,
158
+ type: l,
159
+ key: y,
160
+ props: V,
161
+ _owner: k
162
+ }, (D !== void 0 ? D : null) !== null ? Object.defineProperty(l, "ref", {
163
+ enumerable: !1,
164
+ get: d
165
+ }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
166
+ configurable: !1,
167
+ enumerable: !1,
168
+ writable: !0,
169
+ value: 0
170
+ }), Object.defineProperty(l, "_debugInfo", {
171
+ configurable: !1,
172
+ enumerable: !1,
173
+ writable: !0,
174
+ value: null
175
+ }), Object.defineProperty(l, "_debugStack", {
176
+ configurable: !1,
177
+ enumerable: !1,
178
+ writable: !0,
179
+ value: Ae
180
+ }), Object.defineProperty(l, "_debugTask", {
181
+ configurable: !1,
182
+ enumerable: !1,
183
+ writable: !0,
184
+ value: _e
185
+ }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
186
+ }
187
+ function f(l, y, D, p, k, V, Ae, _e) {
188
+ var F = y.children;
189
+ if (F !== void 0)
190
+ if (p)
191
+ if (z(F)) {
192
+ for (p = 0; p < F.length; p++)
193
+ x(F[p]);
194
+ Object.freeze && Object.freeze(F);
195
+ } else
196
+ console.error(
197
+ "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
+ );
199
+ else x(F);
200
+ if (Q.call(y, "key")) {
201
+ F = e(l);
202
+ var ce = Object.keys(y).filter(function(on) {
203
+ return on !== "key";
204
+ });
205
+ p = 0 < ce.length ? "{key: someKey, " + ce.join(": ..., ") + ": ...}" : "{key: someKey}", U[F + p] || (ce = 0 < ce.length ? "{" + ce.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ `A props object containing a "key" prop is being spread into JSX:
207
+ let props = %s;
208
+ <%s {...props} />
209
+ React keys must be passed directly to JSX without using spread:
210
+ let props = %s;
211
+ <%s key={someKey} {...props} />`,
212
+ p,
213
+ F,
214
+ ce,
215
+ F
216
+ ), U[F + p] = !0);
217
+ }
218
+ if (F = null, D !== void 0 && (s(D), F = "" + D), r(y) && (s(y.key), F = "" + y.key), "key" in y) {
219
+ D = {};
220
+ for (var Re in y)
221
+ Re !== "key" && (D[Re] = y[Re]);
222
+ } else D = y;
223
+ return F && c(
224
+ D,
225
+ typeof l == "function" ? l.displayName || l.name || "Unknown" : l
226
+ ), m(
227
+ l,
228
+ F,
229
+ V,
230
+ k,
231
+ o(),
232
+ D,
233
+ Ae,
234
+ _e
235
+ );
236
+ }
237
+ function x(l) {
238
+ typeof l == "object" && l !== null && l.$$typeof === h && l._store && (l._store.validated = 1);
239
+ }
240
+ var u = de, h = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), S = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), A = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), W = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), X = Symbol.for("react.client.reference"), L = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, z = Array.isArray, q = console.createTask ? console.createTask : function() {
241
+ return null;
242
+ };
243
+ u = {
244
+ react_stack_bottom_frame: function(l) {
245
+ return l();
246
+ }
247
+ };
248
+ var O, $ = {}, R = u.react_stack_bottom_frame.bind(
249
+ u,
250
+ i
251
+ )(), H = q(a(i)), U = {};
252
+ pe.Fragment = j, pe.jsx = function(l, y, D, p, k) {
253
+ var V = 1e4 > L.recentlyCreatedOwnerStacks++;
254
+ return f(
255
+ l,
256
+ y,
257
+ D,
258
+ !1,
259
+ p,
260
+ k,
261
+ V ? Error("react-stack-top-frame") : R,
262
+ V ? q(a(l)) : H
263
+ );
264
+ }, pe.jsxs = function(l, y, D, p, k) {
265
+ var V = 1e4 > L.recentlyCreatedOwnerStacks++;
266
+ return f(
267
+ l,
268
+ y,
269
+ D,
270
+ !0,
271
+ p,
272
+ k,
273
+ V ? Error("react-stack-top-frame") : R,
274
+ V ? q(a(l)) : H
275
+ );
276
+ };
277
+ }()), pe;
278
+ }
279
+ var st;
280
+ function gn() {
281
+ return st || (st = 1, process.env.NODE_ENV === "production" ? be.exports = pn() : be.exports = xn()), be.exports;
282
+ }
283
+ var t = gn();
284
+ const at = (e) => {
285
+ let n;
286
+ const s = /* @__PURE__ */ new Set(), a = (m, f) => {
287
+ const x = typeof m == "function" ? m(n) : m;
288
+ if (!Object.is(x, n)) {
289
+ const u = n;
290
+ n = f ?? (typeof x != "object" || x === null) ? x : Object.assign({}, n, x), s.forEach((h) => h(n, u));
291
+ }
292
+ }, o = () => n, c = { setState: a, getState: o, getInitialState: () => d, subscribe: (m) => (s.add(m), () => s.delete(m)) }, d = n = e(a, o, c);
293
+ return c;
294
+ }, jn = (e) => e ? at(e) : at, bn = (e) => e;
295
+ function vn(e, n = bn) {
296
+ const s = de.useSyncExternalStore(
297
+ e.subscribe,
298
+ de.useCallback(() => n(e.getState()), [e, n]),
299
+ de.useCallback(() => n(e.getInitialState()), [e, n])
300
+ );
301
+ return de.useDebugValue(s), s;
302
+ }
303
+ const rt = (e) => {
304
+ const n = jn(e), s = (a) => vn(n, a);
305
+ return Object.assign(s, n), s;
306
+ }, yn = (e) => e ? rt(e) : rt, ot = {
307
+ queues: [],
308
+ selectedQueue: null,
309
+ jobs: [],
310
+ selectedJob: null,
311
+ selectedStatus: "waiting",
312
+ isLoading: !1,
313
+ error: null,
314
+ searchQuery: "",
315
+ jobDetailOpen: !1
316
+ }, M = yn((e) => ({
317
+ ...ot,
318
+ setQueues: (n) => e({ queues: n }),
319
+ setSelectedQueue: (n) => e({ selectedQueue: n, jobs: [], selectedJob: null }),
320
+ updateSelectedQueueStats: (n) => e({ selectedQueue: n }),
321
+ setJobs: (n) => e({ jobs: n }),
322
+ setSelectedJob: (n) => e({ selectedJob: n }),
323
+ setSelectedStatus: (n) => e({ selectedStatus: n, jobs: [] }),
324
+ setLoading: (n) => e({ isLoading: n }),
325
+ setError: (n) => e({ error: n }),
326
+ setSearchQuery: (n) => e({ searchQuery: n }),
327
+ setJobDetailOpen: (n) => e({ jobDetailOpen: n }),
328
+ reset: () => e(ot)
329
+ })), He = () => {
330
+ const { queues: e, setQueues: n, setLoading: s, setError: a, isLoading: o, error: i } = M(), r = C(async () => {
331
+ s(!0), a(null);
332
+ try {
333
+ const u = await fetch("/__motia/bullmq/queues");
334
+ if (!u.ok)
335
+ throw new Error("Failed to fetch queues");
336
+ const h = await u.json();
337
+ n(h.queues);
338
+ } catch (u) {
339
+ a(u instanceof Error ? u.message : "Unknown error");
340
+ } finally {
341
+ s(!1);
342
+ }
343
+ }, [n, s, a]), c = C(async (u) => {
344
+ try {
345
+ const h = await fetch(`/__motia/bullmq/queues/${encodeURIComponent(u)}`);
346
+ if (!h.ok)
347
+ throw new Error("Failed to fetch queue");
348
+ return await h.json();
349
+ } catch {
350
+ return null;
351
+ }
352
+ }, []), d = C(
353
+ async (u) => {
354
+ try {
355
+ await fetch(`/__motia/bullmq/queues/${encodeURIComponent(u)}/pause`, { method: "POST" }), await r();
356
+ } catch (h) {
357
+ a(h instanceof Error ? h.message : "Failed to pause queue");
358
+ }
359
+ },
360
+ [r, a]
361
+ ), m = C(
362
+ async (u) => {
363
+ try {
364
+ await fetch(`/__motia/bullmq/queues/${encodeURIComponent(u)}/resume`, { method: "POST" }), await r();
365
+ } catch (h) {
366
+ a(h instanceof Error ? h.message : "Failed to resume queue");
367
+ }
368
+ },
369
+ [r, a]
370
+ ), f = C(
371
+ async (u, h, v = 0, j = 1e3) => {
372
+ try {
373
+ await fetch(`/__motia/bullmq/queues/${encodeURIComponent(u)}/clean`, {
374
+ method: "POST",
375
+ headers: { "Content-Type": "application/json" },
376
+ body: JSON.stringify({ status: h, grace: v, limit: j })
377
+ }), await r();
378
+ } catch (_) {
379
+ a(_ instanceof Error ? _.message : "Failed to clean queue");
380
+ }
381
+ },
382
+ [r, a]
383
+ ), x = C(
384
+ async (u) => {
385
+ try {
386
+ await fetch(`/__motia/bullmq/queues/${encodeURIComponent(u)}/drain`, { method: "POST" }), await r();
387
+ } catch (h) {
388
+ a(h instanceof Error ? h.message : "Failed to drain queue");
389
+ }
390
+ },
391
+ [r, a]
392
+ );
393
+ return ie(() => {
394
+ r();
395
+ const u = setInterval(r, 5e3);
396
+ return () => clearInterval(u);
397
+ }, [r]), {
398
+ queues: e,
399
+ isLoading: o,
400
+ error: i,
401
+ fetchQueues: r,
402
+ refreshQueue: c,
403
+ pauseQueue: d,
404
+ resumeQueue: m,
405
+ cleanQueue: f,
406
+ drainQueue: x
407
+ };
408
+ };
409
+ function J(e) {
410
+ const n = Object.prototype.toString.call(e);
411
+ return e instanceof Date || typeof e == "object" && n === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || n === "[object Number]" || typeof e == "string" || n === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
412
+ }
413
+ function wn(e, n) {
414
+ return e instanceof Date ? new e.constructor(n) : new Date(n);
415
+ }
416
+ const ve = 43200, it = 1440;
417
+ let Nn = {};
418
+ function Cn() {
419
+ return Nn;
420
+ }
421
+ function lt(e) {
422
+ const n = J(e), s = new Date(
423
+ Date.UTC(
424
+ n.getFullYear(),
425
+ n.getMonth(),
426
+ n.getDate(),
427
+ n.getHours(),
428
+ n.getMinutes(),
429
+ n.getSeconds(),
430
+ n.getMilliseconds()
431
+ )
432
+ );
433
+ return s.setUTCFullYear(n.getFullYear()), +e - +s;
434
+ }
435
+ function we(e, n) {
436
+ const s = J(e), a = J(n), o = s.getTime() - a.getTime();
437
+ return o < 0 ? -1 : o > 0 ? 1 : o;
438
+ }
439
+ function Sn(e) {
440
+ return wn(e, Date.now());
441
+ }
442
+ function kn(e, n) {
443
+ const s = J(e), a = J(n), o = s.getFullYear() - a.getFullYear(), i = s.getMonth() - a.getMonth();
444
+ return o * 12 + i;
445
+ }
446
+ function Dn(e) {
447
+ return (n) => {
448
+ const a = (e ? Math[e] : Math.trunc)(n);
449
+ return a === 0 ? 0 : a;
450
+ };
451
+ }
452
+ function En(e, n) {
453
+ return +J(e) - +J(n);
454
+ }
455
+ function An(e) {
456
+ const n = J(e);
457
+ return n.setHours(23, 59, 59, 999), n;
458
+ }
459
+ function _n(e) {
460
+ const n = J(e), s = n.getMonth();
461
+ return n.setFullYear(n.getFullYear(), s + 1, 0), n.setHours(23, 59, 59, 999), n;
462
+ }
463
+ function Rn(e) {
464
+ const n = J(e);
465
+ return +An(n) == +_n(n);
466
+ }
467
+ function Tn(e, n) {
468
+ const s = J(e), a = J(n), o = we(s, a), i = Math.abs(
469
+ kn(s, a)
470
+ );
471
+ let r;
472
+ if (i < 1)
473
+ r = 0;
474
+ else {
475
+ s.getMonth() === 1 && s.getDate() > 27 && s.setDate(30), s.setMonth(s.getMonth() - o * i);
476
+ let c = we(s, a) === -o;
477
+ Rn(J(e)) && i === 1 && we(e, a) === 1 && (c = !1), r = o * (i - Number(c));
478
+ }
479
+ return r === 0 ? 0 : r;
480
+ }
481
+ function Mn(e, n, s) {
482
+ const a = En(e, n) / 1e3;
483
+ return Dn(s?.roundingMethod)(a);
484
+ }
485
+ const On = {
486
+ lessThanXSeconds: {
487
+ one: "less than a second",
488
+ other: "less than {{count}} seconds"
489
+ },
490
+ xSeconds: {
491
+ one: "1 second",
492
+ other: "{{count}} seconds"
493
+ },
494
+ halfAMinute: "half a minute",
495
+ lessThanXMinutes: {
496
+ one: "less than a minute",
497
+ other: "less than {{count}} minutes"
498
+ },
499
+ xMinutes: {
500
+ one: "1 minute",
501
+ other: "{{count}} minutes"
502
+ },
503
+ aboutXHours: {
504
+ one: "about 1 hour",
505
+ other: "about {{count}} hours"
506
+ },
507
+ xHours: {
508
+ one: "1 hour",
509
+ other: "{{count}} hours"
510
+ },
511
+ xDays: {
512
+ one: "1 day",
513
+ other: "{{count}} days"
514
+ },
515
+ aboutXWeeks: {
516
+ one: "about 1 week",
517
+ other: "about {{count}} weeks"
518
+ },
519
+ xWeeks: {
520
+ one: "1 week",
521
+ other: "{{count}} weeks"
522
+ },
523
+ aboutXMonths: {
524
+ one: "about 1 month",
525
+ other: "about {{count}} months"
526
+ },
527
+ xMonths: {
528
+ one: "1 month",
529
+ other: "{{count}} months"
530
+ },
531
+ aboutXYears: {
532
+ one: "about 1 year",
533
+ other: "about {{count}} years"
534
+ },
535
+ xYears: {
536
+ one: "1 year",
537
+ other: "{{count}} years"
538
+ },
539
+ overXYears: {
540
+ one: "over 1 year",
541
+ other: "over {{count}} years"
542
+ },
543
+ almostXYears: {
544
+ one: "almost 1 year",
545
+ other: "almost {{count}} years"
546
+ }
547
+ }, Pn = (e, n, s) => {
548
+ let a;
549
+ const o = On[e];
550
+ return typeof o == "string" ? a = o : n === 1 ? a = o.one : a = o.other.replace("{{count}}", n.toString()), s?.addSuffix ? s.comparison && s.comparison > 0 ? "in " + a : a + " ago" : a;
551
+ };
552
+ function Te(e) {
553
+ return (n = {}) => {
554
+ const s = n.width ? String(n.width) : e.defaultWidth;
555
+ return e.formats[s] || e.formats[e.defaultWidth];
556
+ };
557
+ }
558
+ const Ln = {
559
+ full: "EEEE, MMMM do, y",
560
+ long: "MMMM do, y",
561
+ medium: "MMM d, y",
562
+ short: "MM/dd/yyyy"
563
+ }, Qn = {
564
+ full: "h:mm:ss a zzzz",
565
+ long: "h:mm:ss a z",
566
+ medium: "h:mm:ss a",
567
+ short: "h:mm a"
568
+ }, Jn = {
569
+ full: "{{date}} 'at' {{time}}",
570
+ long: "{{date}} 'at' {{time}}",
571
+ medium: "{{date}}, {{time}}",
572
+ short: "{{date}}, {{time}}"
573
+ }, Fn = {
574
+ date: Te({
575
+ formats: Ln,
576
+ defaultWidth: "full"
577
+ }),
578
+ time: Te({
579
+ formats: Qn,
580
+ defaultWidth: "full"
581
+ }),
582
+ dateTime: Te({
583
+ formats: Jn,
584
+ defaultWidth: "full"
585
+ })
586
+ }, In = {
587
+ lastWeek: "'last' eeee 'at' p",
588
+ yesterday: "'yesterday at' p",
589
+ today: "'today at' p",
590
+ tomorrow: "'tomorrow at' p",
591
+ nextWeek: "eeee 'at' p",
592
+ other: "P"
593
+ }, $n = (e, n, s, a) => In[e];
594
+ function xe(e) {
595
+ return (n, s) => {
596
+ const a = s?.context ? String(s.context) : "standalone";
597
+ let o;
598
+ if (a === "formatting" && e.formattingValues) {
599
+ const r = e.defaultFormattingWidth || e.defaultWidth, c = s?.width ? String(s.width) : r;
600
+ o = e.formattingValues[c] || e.formattingValues[r];
601
+ } else {
602
+ const r = e.defaultWidth, c = s?.width ? String(s.width) : e.defaultWidth;
603
+ o = e.values[c] || e.values[r];
604
+ }
605
+ const i = e.argumentCallback ? e.argumentCallback(n) : n;
606
+ return o[i];
607
+ };
608
+ }
609
+ const Un = {
610
+ narrow: ["B", "A"],
611
+ abbreviated: ["BC", "AD"],
612
+ wide: ["Before Christ", "Anno Domini"]
613
+ }, Wn = {
614
+ narrow: ["1", "2", "3", "4"],
615
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
616
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
617
+ }, zn = {
618
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
619
+ abbreviated: [
620
+ "Jan",
621
+ "Feb",
622
+ "Mar",
623
+ "Apr",
624
+ "May",
625
+ "Jun",
626
+ "Jul",
627
+ "Aug",
628
+ "Sep",
629
+ "Oct",
630
+ "Nov",
631
+ "Dec"
632
+ ],
633
+ wide: [
634
+ "January",
635
+ "February",
636
+ "March",
637
+ "April",
638
+ "May",
639
+ "June",
640
+ "July",
641
+ "August",
642
+ "September",
643
+ "October",
644
+ "November",
645
+ "December"
646
+ ]
647
+ }, qn = {
648
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
649
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
650
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
651
+ wide: [
652
+ "Sunday",
653
+ "Monday",
654
+ "Tuesday",
655
+ "Wednesday",
656
+ "Thursday",
657
+ "Friday",
658
+ "Saturday"
659
+ ]
660
+ }, Hn = {
661
+ narrow: {
662
+ am: "a",
663
+ pm: "p",
664
+ midnight: "mi",
665
+ noon: "n",
666
+ morning: "morning",
667
+ afternoon: "afternoon",
668
+ evening: "evening",
669
+ night: "night"
670
+ },
671
+ abbreviated: {
672
+ am: "AM",
673
+ pm: "PM",
674
+ midnight: "midnight",
675
+ noon: "noon",
676
+ morning: "morning",
677
+ afternoon: "afternoon",
678
+ evening: "evening",
679
+ night: "night"
680
+ },
681
+ wide: {
682
+ am: "a.m.",
683
+ pm: "p.m.",
684
+ midnight: "midnight",
685
+ noon: "noon",
686
+ morning: "morning",
687
+ afternoon: "afternoon",
688
+ evening: "evening",
689
+ night: "night"
690
+ }
691
+ }, Vn = {
692
+ narrow: {
693
+ am: "a",
694
+ pm: "p",
695
+ midnight: "mi",
696
+ noon: "n",
697
+ morning: "in the morning",
698
+ afternoon: "in the afternoon",
699
+ evening: "in the evening",
700
+ night: "at night"
701
+ },
702
+ abbreviated: {
703
+ am: "AM",
704
+ pm: "PM",
705
+ midnight: "midnight",
706
+ noon: "noon",
707
+ morning: "in the morning",
708
+ afternoon: "in the afternoon",
709
+ evening: "in the evening",
710
+ night: "at night"
711
+ },
712
+ wide: {
713
+ am: "a.m.",
714
+ pm: "p.m.",
715
+ midnight: "midnight",
716
+ noon: "noon",
717
+ morning: "in the morning",
718
+ afternoon: "in the afternoon",
719
+ evening: "in the evening",
720
+ night: "at night"
721
+ }
722
+ }, Yn = (e, n) => {
723
+ const s = Number(e), a = s % 100;
724
+ if (a > 20 || a < 10)
725
+ switch (a % 10) {
726
+ case 1:
727
+ return s + "st";
728
+ case 2:
729
+ return s + "nd";
730
+ case 3:
731
+ return s + "rd";
732
+ }
733
+ return s + "th";
734
+ }, Zn = {
735
+ ordinalNumber: Yn,
736
+ era: xe({
737
+ values: Un,
738
+ defaultWidth: "wide"
739
+ }),
740
+ quarter: xe({
741
+ values: Wn,
742
+ defaultWidth: "wide",
743
+ argumentCallback: (e) => e - 1
744
+ }),
745
+ month: xe({
746
+ values: zn,
747
+ defaultWidth: "wide"
748
+ }),
749
+ day: xe({
750
+ values: qn,
751
+ defaultWidth: "wide"
752
+ }),
753
+ dayPeriod: xe({
754
+ values: Hn,
755
+ defaultWidth: "wide",
756
+ formattingValues: Vn,
757
+ defaultFormattingWidth: "wide"
758
+ })
759
+ };
760
+ function ge(e) {
761
+ return (n, s = {}) => {
762
+ const a = s.width, o = a && e.matchPatterns[a] || e.matchPatterns[e.defaultMatchWidth], i = n.match(o);
763
+ if (!i)
764
+ return null;
765
+ const r = i[0], c = a && e.parsePatterns[a] || e.parsePatterns[e.defaultParseWidth], d = Array.isArray(c) ? Bn(c, (x) => x.test(r)) : (
766
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
767
+ Xn(c, (x) => x.test(r))
768
+ );
769
+ let m;
770
+ m = e.valueCallback ? e.valueCallback(d) : d, m = s.valueCallback ? (
771
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
772
+ s.valueCallback(m)
773
+ ) : m;
774
+ const f = n.slice(r.length);
775
+ return { value: m, rest: f };
776
+ };
777
+ }
778
+ function Xn(e, n) {
779
+ for (const s in e)
780
+ if (Object.prototype.hasOwnProperty.call(e, s) && n(e[s]))
781
+ return s;
782
+ }
783
+ function Bn(e, n) {
784
+ for (let s = 0; s < e.length; s++)
785
+ if (n(e[s]))
786
+ return s;
787
+ }
788
+ function Kn(e) {
789
+ return (n, s = {}) => {
790
+ const a = n.match(e.matchPattern);
791
+ if (!a) return null;
792
+ const o = a[0], i = n.match(e.parsePattern);
793
+ if (!i) return null;
794
+ let r = e.valueCallback ? e.valueCallback(i[0]) : i[0];
795
+ r = s.valueCallback ? s.valueCallback(r) : r;
796
+ const c = n.slice(o.length);
797
+ return { value: r, rest: c };
798
+ };
799
+ }
800
+ const Gn = /^(\d+)(th|st|nd|rd)?/i, es = /\d+/i, ts = {
801
+ narrow: /^(b|a)/i,
802
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
803
+ wide: /^(before christ|before common era|anno domini|common era)/i
804
+ }, ns = {
805
+ any: [/^b/i, /^(a|c)/i]
806
+ }, ss = {
807
+ narrow: /^[1234]/i,
808
+ abbreviated: /^q[1234]/i,
809
+ wide: /^[1234](th|st|nd|rd)? quarter/i
810
+ }, as = {
811
+ any: [/1/i, /2/i, /3/i, /4/i]
812
+ }, rs = {
813
+ narrow: /^[jfmasond]/i,
814
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
815
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
816
+ }, os = {
817
+ narrow: [
818
+ /^j/i,
819
+ /^f/i,
820
+ /^m/i,
821
+ /^a/i,
822
+ /^m/i,
823
+ /^j/i,
824
+ /^j/i,
825
+ /^a/i,
826
+ /^s/i,
827
+ /^o/i,
828
+ /^n/i,
829
+ /^d/i
830
+ ],
831
+ any: [
832
+ /^ja/i,
833
+ /^f/i,
834
+ /^mar/i,
835
+ /^ap/i,
836
+ /^may/i,
837
+ /^jun/i,
838
+ /^jul/i,
839
+ /^au/i,
840
+ /^s/i,
841
+ /^o/i,
842
+ /^n/i,
843
+ /^d/i
844
+ ]
845
+ }, is = {
846
+ narrow: /^[smtwf]/i,
847
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
848
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
849
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
850
+ }, ls = {
851
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
852
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
853
+ }, cs = {
854
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
855
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
856
+ }, ds = {
857
+ any: {
858
+ am: /^a/i,
859
+ pm: /^p/i,
860
+ midnight: /^mi/i,
861
+ noon: /^no/i,
862
+ morning: /morning/i,
863
+ afternoon: /afternoon/i,
864
+ evening: /evening/i,
865
+ night: /night/i
866
+ }
867
+ }, us = {
868
+ ordinalNumber: Kn({
869
+ matchPattern: Gn,
870
+ parsePattern: es,
871
+ valueCallback: (e) => parseInt(e, 10)
872
+ }),
873
+ era: ge({
874
+ matchPatterns: ts,
875
+ defaultMatchWidth: "wide",
876
+ parsePatterns: ns,
877
+ defaultParseWidth: "any"
878
+ }),
879
+ quarter: ge({
880
+ matchPatterns: ss,
881
+ defaultMatchWidth: "wide",
882
+ parsePatterns: as,
883
+ defaultParseWidth: "any",
884
+ valueCallback: (e) => e + 1
885
+ }),
886
+ month: ge({
887
+ matchPatterns: rs,
888
+ defaultMatchWidth: "wide",
889
+ parsePatterns: os,
890
+ defaultParseWidth: "any"
891
+ }),
892
+ day: ge({
893
+ matchPatterns: is,
894
+ defaultMatchWidth: "wide",
895
+ parsePatterns: ls,
896
+ defaultParseWidth: "any"
897
+ }),
898
+ dayPeriod: ge({
899
+ matchPatterns: cs,
900
+ defaultMatchWidth: "any",
901
+ parsePatterns: ds,
902
+ defaultParseWidth: "any"
903
+ })
904
+ }, fs = {
905
+ code: "en-US",
906
+ formatDistance: Pn,
907
+ formatLong: Fn,
908
+ formatRelative: $n,
909
+ localize: Zn,
910
+ match: us,
911
+ options: {
912
+ weekStartsOn: 0,
913
+ firstWeekContainsDate: 1
914
+ }
915
+ };
916
+ function ms(e, n, s) {
917
+ const a = Cn(), o = s?.locale ?? a.locale ?? fs, i = 2520, r = we(e, n);
918
+ if (isNaN(r))
919
+ throw new RangeError("Invalid time value");
920
+ const c = Object.assign({}, s, {
921
+ addSuffix: s?.addSuffix,
922
+ comparison: r
923
+ });
924
+ let d, m;
925
+ r > 0 ? (d = J(n), m = J(e)) : (d = J(e), m = J(n));
926
+ const f = Mn(m, d), x = (lt(m) - lt(d)) / 1e3, u = Math.round((f - x) / 60);
927
+ let h;
928
+ if (u < 2)
929
+ return s?.includeSeconds ? f < 5 ? o.formatDistance("lessThanXSeconds", 5, c) : f < 10 ? o.formatDistance("lessThanXSeconds", 10, c) : f < 20 ? o.formatDistance("lessThanXSeconds", 20, c) : f < 40 ? o.formatDistance("halfAMinute", 0, c) : f < 60 ? o.formatDistance("lessThanXMinutes", 1, c) : o.formatDistance("xMinutes", 1, c) : u === 0 ? o.formatDistance("lessThanXMinutes", 1, c) : o.formatDistance("xMinutes", u, c);
930
+ if (u < 45)
931
+ return o.formatDistance("xMinutes", u, c);
932
+ if (u < 90)
933
+ return o.formatDistance("aboutXHours", 1, c);
934
+ if (u < it) {
935
+ const v = Math.round(u / 60);
936
+ return o.formatDistance("aboutXHours", v, c);
937
+ } else {
938
+ if (u < i)
939
+ return o.formatDistance("xDays", 1, c);
940
+ if (u < ve) {
941
+ const v = Math.round(u / it);
942
+ return o.formatDistance("xDays", v, c);
943
+ } else if (u < ve * 2)
944
+ return h = Math.round(u / ve), o.formatDistance("aboutXMonths", h, c);
945
+ }
946
+ if (h = Tn(m, d), h < 12) {
947
+ const v = Math.round(u / ve);
948
+ return o.formatDistance("xMonths", v, c);
949
+ } else {
950
+ const v = h % 12, j = Math.trunc(h / 12);
951
+ return v < 3 ? o.formatDistance("aboutXYears", j, c) : v < 9 ? o.formatDistance("overXYears", j, c) : o.formatDistance("almostXYears", j + 1, c);
952
+ }
953
+ }
954
+ function Ce(e, n) {
955
+ return ms(e, Sn(e), n);
956
+ }
957
+ /**
958
+ * @license lucide-react v0.545.0 - ISC
959
+ *
960
+ * This source code is licensed under the ISC license.
961
+ * See the LICENSE file in the root directory of this source tree.
962
+ */
963
+ const hs = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ps = (e) => e.replace(
964
+ /^([A-Z])|[\s-_]+(\w)/g,
965
+ (n, s, a) => a ? a.toUpperCase() : s.toLowerCase()
966
+ ), ct = (e) => {
967
+ const n = ps(e);
968
+ return n.charAt(0).toUpperCase() + n.slice(1);
969
+ }, Ft = (...e) => e.filter((n, s, a) => !!n && n.trim() !== "" && a.indexOf(n) === s).join(" ").trim(), xs = (e) => {
970
+ for (const n in e)
971
+ if (n.startsWith("aria-") || n === "role" || n === "title")
972
+ return !0;
973
+ };
974
+ /**
975
+ * @license lucide-react v0.545.0 - ISC
976
+ *
977
+ * This source code is licensed under the ISC license.
978
+ * See the LICENSE file in the root directory of this source tree.
979
+ */
980
+ var gs = {
981
+ xmlns: "http://www.w3.org/2000/svg",
982
+ width: 24,
983
+ height: 24,
984
+ viewBox: "0 0 24 24",
985
+ fill: "none",
986
+ stroke: "currentColor",
987
+ strokeWidth: 2,
988
+ strokeLinecap: "round",
989
+ strokeLinejoin: "round"
990
+ };
991
+ /**
992
+ * @license lucide-react v0.545.0 - ISC
993
+ *
994
+ * This source code is licensed under the ISC license.
995
+ * See the LICENSE file in the root directory of this source tree.
996
+ */
997
+ const js = _t(
998
+ ({
999
+ color: e = "currentColor",
1000
+ size: n = 24,
1001
+ strokeWidth: s = 2,
1002
+ absoluteStrokeWidth: a,
1003
+ className: o = "",
1004
+ children: i,
1005
+ iconNode: r,
1006
+ ...c
1007
+ }, d) => Me(
1008
+ "svg",
1009
+ {
1010
+ ref: d,
1011
+ ...gs,
1012
+ width: n,
1013
+ height: n,
1014
+ stroke: e,
1015
+ strokeWidth: a ? Number(s) * 24 / Number(n) : s,
1016
+ className: Ft("lucide", o),
1017
+ ...!i && !xs(c) && { "aria-hidden": "true" },
1018
+ ...c
1019
+ },
1020
+ [
1021
+ ...r.map(([m, f]) => Me(m, f)),
1022
+ ...Array.isArray(i) ? i : [i]
1023
+ ]
1024
+ )
1025
+ );
1026
+ /**
1027
+ * @license lucide-react v0.545.0 - ISC
1028
+ *
1029
+ * This source code is licensed under the ISC license.
1030
+ * See the LICENSE file in the root directory of this source tree.
1031
+ */
1032
+ const G = (e, n) => {
1033
+ const s = _t(
1034
+ ({ className: a, ...o }, i) => Me(js, {
1035
+ ref: i,
1036
+ iconNode: n,
1037
+ className: Ft(
1038
+ `lucide-${hs(ct(e))}`,
1039
+ `lucide-${e}`,
1040
+ a
1041
+ ),
1042
+ ...o
1043
+ })
1044
+ );
1045
+ return s.displayName = ct(e), s;
1046
+ };
1047
+ /**
1048
+ * @license lucide-react v0.545.0 - ISC
1049
+ *
1050
+ * This source code is licensed under the ISC license.
1051
+ * See the LICENSE file in the root directory of this source tree.
1052
+ */
1053
+ const bs = [
1054
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
1055
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
1056
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
1057
+ ["path", { d: "M8 16H3v5", key: "1cv678" }]
1058
+ ], oe = G("refresh-cw", bs);
1059
+ /**
1060
+ * @license lucide-react v0.545.0 - ISC
1061
+ *
1062
+ * This source code is licensed under the ISC license.
1063
+ * See the LICENSE file in the root directory of this source tree.
1064
+ */
1065
+ const vs = [
1066
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
1067
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
1068
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
1069
+ ], fe = G("trash", vs);
1070
+ /**
1071
+ * @license lucide-react v0.545.0 - ISC
1072
+ *
1073
+ * This source code is licensed under the ISC license.
1074
+ * See the LICENSE file in the root directory of this source tree.
1075
+ */
1076
+ const ys = [
1077
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
1078
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
1079
+ ], Ve = G("x", ys);
1080
+ function ws(e, n, s, a) {
1081
+ function o(i) {
1082
+ return i instanceof s ? i : new s(function(r) {
1083
+ r(i);
1084
+ });
1085
+ }
1086
+ return new (s || (s = Promise))(function(i, r) {
1087
+ function c(f) {
1088
+ try {
1089
+ m(a.next(f));
1090
+ } catch (x) {
1091
+ r(x);
1092
+ }
1093
+ }
1094
+ function d(f) {
1095
+ try {
1096
+ m(a.throw(f));
1097
+ } catch (x) {
1098
+ r(x);
1099
+ }
1100
+ }
1101
+ function m(f) {
1102
+ f.done ? i(f.value) : o(f.value).then(c, d);
1103
+ }
1104
+ m((a = a.apply(e, [])).next());
1105
+ });
1106
+ }
1107
+ var Ns = function() {
1108
+ var e = document.getSelection();
1109
+ if (!e.rangeCount)
1110
+ return function() {
1111
+ };
1112
+ for (var n = document.activeElement, s = [], a = 0; a < e.rangeCount; a++)
1113
+ s.push(e.getRangeAt(a));
1114
+ switch (n.tagName.toUpperCase()) {
1115
+ // .toUpperCase handles XHTML
1116
+ case "INPUT":
1117
+ case "TEXTAREA":
1118
+ n.blur();
1119
+ break;
1120
+ default:
1121
+ n = null;
1122
+ break;
1123
+ }
1124
+ return e.removeAllRanges(), function() {
1125
+ e.type === "Caret" && e.removeAllRanges(), e.rangeCount || s.forEach(function(o) {
1126
+ e.addRange(o);
1127
+ }), n && n.focus();
1128
+ };
1129
+ }, Cs = Ns, dt = {
1130
+ "text/plain": "Text",
1131
+ "text/html": "Url",
1132
+ default: "Text"
1133
+ }, Ss = "Copy to clipboard: #{key}, Enter";
1134
+ function ks(e) {
1135
+ var n = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
1136
+ return e.replace(/#{\s*key\s*}/g, n);
1137
+ }
1138
+ function Ds(e, n) {
1139
+ var s, a, o, i, r, c, d = !1;
1140
+ n || (n = {}), s = n.debug || !1;
1141
+ try {
1142
+ o = Cs(), i = document.createRange(), r = 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(f) {
1143
+ if (f.stopPropagation(), n.format)
1144
+ if (f.preventDefault(), typeof f.clipboardData > "u") {
1145
+ s && console.warn("unable to use e.clipboardData"), s && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
1146
+ var x = dt[n.format] || dt.default;
1147
+ window.clipboardData.setData(x, e);
1148
+ } else
1149
+ f.clipboardData.clearData(), f.clipboardData.setData(n.format, e);
1150
+ n.onCopy && (f.preventDefault(), n.onCopy(f.clipboardData));
1151
+ }), document.body.appendChild(c), i.selectNodeContents(c), r.addRange(i);
1152
+ var m = document.execCommand("copy");
1153
+ if (!m)
1154
+ throw new Error("copy command was unsuccessful");
1155
+ d = !0;
1156
+ } catch (f) {
1157
+ s && console.error("unable to copy using execCommand: ", f), s && console.warn("trying IE specific stuff");
1158
+ try {
1159
+ window.clipboardData.setData(n.format || "text", e), n.onCopy && n.onCopy(window.clipboardData), d = !0;
1160
+ } catch (x) {
1161
+ s && console.error("unable to copy using clipboardData: ", x), s && console.error("falling back to prompt"), a = ks("message" in n ? n.message : Ss), window.prompt(a, e);
1162
+ }
1163
+ } finally {
1164
+ r && (typeof r.removeRange == "function" ? r.removeRange(i) : r.removeAllRanges()), c && document.body.removeChild(c), o();
1165
+ }
1166
+ return d;
1167
+ }
1168
+ var Es = Ds;
1169
+ function se(e) {
1170
+ return Object.prototype.toString.call(e) === "[object Object]";
1171
+ }
1172
+ function je(e) {
1173
+ return Array.isArray(e) ? e.length : se(e) ? Object.keys(e).length : 0;
1174
+ }
1175
+ function As(e, n) {
1176
+ if (typeof e == "string")
1177
+ return e;
1178
+ try {
1179
+ return JSON.stringify(e, (s, a) => {
1180
+ switch (typeof a) {
1181
+ case "bigint":
1182
+ return String(a) + "n";
1183
+ case "number":
1184
+ case "boolean":
1185
+ case "object":
1186
+ case "string":
1187
+ return a;
1188
+ default:
1189
+ return String(a);
1190
+ }
1191
+ }, n);
1192
+ } catch (s) {
1193
+ return `${s.name}: ${s.message}` || "JSON.stringify failed";
1194
+ }
1195
+ }
1196
+ function _s(e) {
1197
+ return ws(this, void 0, void 0, function* () {
1198
+ try {
1199
+ yield navigator.clipboard.writeText(e);
1200
+ } catch {
1201
+ Es(e);
1202
+ }
1203
+ });
1204
+ }
1205
+ function ut(e, n, s, a, o, i) {
1206
+ if (i && i.collapsed !== void 0)
1207
+ return !!i.collapsed;
1208
+ if (typeof a == "boolean")
1209
+ return a;
1210
+ if (typeof a == "number" && n > a)
1211
+ return !0;
1212
+ const r = je(e);
1213
+ if (typeof a == "function") {
1214
+ const c = Ye(a, [{ node: e, depth: n, indexOrName: s, size: r }]);
1215
+ if (typeof c == "boolean")
1216
+ return c;
1217
+ }
1218
+ return !!(Array.isArray(e) && r > o || se(e) && r > o);
1219
+ }
1220
+ function ft(e, n, s, a, o, i) {
1221
+ if (i && i.collapsed !== void 0)
1222
+ return !!i.collapsed;
1223
+ if (typeof a == "boolean")
1224
+ return a;
1225
+ if (typeof a == "number" && n > a)
1226
+ return !0;
1227
+ const r = Math.ceil(e.length / 100);
1228
+ if (typeof a == "function") {
1229
+ const c = Ye(a, [{ node: e, depth: n, indexOrName: s, size: r }]);
1230
+ if (typeof c == "boolean")
1231
+ return c;
1232
+ }
1233
+ return !!(Array.isArray(e) && r > o || se(e) && r > o);
1234
+ }
1235
+ function me(e, n, s) {
1236
+ return typeof e == "boolean" ? e : !!(typeof e == "number" && n > e || e === "collapsed" && s || e === "expanded" && !s);
1237
+ }
1238
+ function Ye(e, n) {
1239
+ try {
1240
+ return e(...n);
1241
+ } catch (s) {
1242
+ reportError(s);
1243
+ }
1244
+ }
1245
+ function It(e) {
1246
+ if (e === !0 || se(e) && e.add === !0)
1247
+ return !0;
1248
+ }
1249
+ function mt(e) {
1250
+ if (e === !0 || se(e) && e.edit === !0)
1251
+ return !0;
1252
+ }
1253
+ function Ze(e) {
1254
+ if (e === !0 || se(e) && e.delete === !0)
1255
+ return !0;
1256
+ }
1257
+ function Rs(e) {
1258
+ return typeof e == "function";
1259
+ }
1260
+ function $t(e) {
1261
+ return !e || e.add === void 0 || !!e.add;
1262
+ }
1263
+ function ht(e) {
1264
+ return !e || e.edit === void 0 || !!e.edit;
1265
+ }
1266
+ function Xe(e) {
1267
+ return !e || e.delete === void 0 || !!e.delete;
1268
+ }
1269
+ function Se(e) {
1270
+ return !e || e.enableClipboard === void 0 || !!e.enableClipboard;
1271
+ }
1272
+ function Ts(e) {
1273
+ return !e || e.matchesURL === void 0 || !!e.matchesURL;
1274
+ }
1275
+ function Ms(e, n) {
1276
+ return e === "string" ? n.trim().replace(/^\"([\s\S]+?)\"$/, "$1") : n;
1277
+ }
1278
+ var pt;
1279
+ function Oe() {
1280
+ return Oe = Object.assign ? Object.assign.bind() : function(e) {
1281
+ for (var n = 1; n < arguments.length; n++) {
1282
+ var s = arguments[n];
1283
+ for (var a in s)
1284
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1285
+ }
1286
+ return e;
1287
+ }, Oe.apply(this, arguments);
1288
+ }
1289
+ var Be = function(n) {
1290
+ return /* @__PURE__ */ T.createElement("svg", Oe({
1291
+ xmlns: "http://www.w3.org/2000/svg",
1292
+ width: 16,
1293
+ height: 16,
1294
+ fill: "none",
1295
+ viewBox: "0 0 16 16"
1296
+ }, n), pt || (pt = /* @__PURE__ */ T.createElement("path", {
1297
+ fill: "currentColor",
1298
+ 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"
1299
+ })));
1300
+ }, xt;
1301
+ function Pe() {
1302
+ return Pe = Object.assign ? Object.assign.bind() : function(e) {
1303
+ for (var n = 1; n < arguments.length; n++) {
1304
+ var s = arguments[n];
1305
+ for (var a in s)
1306
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1307
+ }
1308
+ return e;
1309
+ }, Pe.apply(this, arguments);
1310
+ }
1311
+ var Os = function(n) {
1312
+ return /* @__PURE__ */ T.createElement("svg", Pe({
1313
+ xmlns: "http://www.w3.org/2000/svg",
1314
+ width: 24,
1315
+ height: 24,
1316
+ fill: "none",
1317
+ viewBox: "0 0 24 24"
1318
+ }, n), xt || (xt = /* @__PURE__ */ T.createElement("path", {
1319
+ fill: "currentColor",
1320
+ 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"
1321
+ })));
1322
+ }, gt, jt;
1323
+ function Le() {
1324
+ return Le = Object.assign ? Object.assign.bind() : function(e) {
1325
+ for (var n = 1; n < arguments.length; n++) {
1326
+ var s = arguments[n];
1327
+ for (var a in s)
1328
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1329
+ }
1330
+ return e;
1331
+ }, Le.apply(this, arguments);
1332
+ }
1333
+ var Ps = function(n) {
1334
+ return /* @__PURE__ */ T.createElement("svg", Le({
1335
+ xmlns: "http://www.w3.org/2000/svg",
1336
+ width: 24,
1337
+ height: 24,
1338
+ fill: "none",
1339
+ viewBox: "0 0 24 24"
1340
+ }, n), gt || (gt = /* @__PURE__ */ T.createElement("path", {
1341
+ fill: "currentColor",
1342
+ 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"
1343
+ })), jt || (jt = /* @__PURE__ */ T.createElement("path", {
1344
+ fill: "#14C786",
1345
+ 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"
1346
+ })));
1347
+ };
1348
+ function ke({ node: e, nodeMeta: n }) {
1349
+ const { customizeCopy: s, CopyComponent: a, CopiedComponent: o } = le(ae), [i, r] = I(!1), c = (d) => {
1350
+ d.stopPropagation();
1351
+ const m = s(e, n);
1352
+ typeof m == "string" && m && _s(m), r(!0), setTimeout(() => r(!1), 3e3);
1353
+ };
1354
+ return i ? typeof o == "function" ? t.jsx(o, { className: "json-view--copy", style: { display: "inline-block" } }) : t.jsx(Ps, { className: "json-view--copy", style: { display: "inline-block" } }) : typeof a == "function" ? t.jsx(a, { onClick: c, className: "json-view--copy" }) : t.jsx(Os, { onClick: c, className: "json-view--copy" });
1355
+ }
1356
+ function Qe({ indexOrName: e, value: n, depth: s, deleteHandle: a, editHandle: o, parent: i, parentPath: r }) {
1357
+ const { displayArrayIndex: c } = le(ae), d = Array.isArray(i);
1358
+ return t.jsxs("div", Object.assign({ className: "json-view--pair" }, { children: [!d || d && c ? t.jsxs(t.Fragment, { children: [t.jsx("span", Object.assign({ className: typeof e == "number" ? "json-view--index" : "json-view--property" }, { children: e })), ":", " "] }) : t.jsx(t.Fragment, {}), t.jsx(Wt, { node: n, depth: s + 1, deleteHandle: (m, f) => a(m, f), editHandle: (m, f, x, u) => o(m, f, x, u), parent: i, indexOrName: e, parentPath: r })] }));
1359
+ }
1360
+ var bt, vt;
1361
+ function Je() {
1362
+ return Je = Object.assign ? Object.assign.bind() : function(e) {
1363
+ for (var n = 1; n < arguments.length; n++) {
1364
+ var s = arguments[n];
1365
+ for (var a in s)
1366
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1367
+ }
1368
+ return e;
1369
+ }, Je.apply(this, arguments);
1370
+ }
1371
+ var Ke = function(n) {
1372
+ return /* @__PURE__ */ T.createElement("svg", Je({
1373
+ xmlns: "http://www.w3.org/2000/svg",
1374
+ width: 24,
1375
+ height: 24,
1376
+ fill: "none",
1377
+ viewBox: "0 0 24 24"
1378
+ }, n), bt || (bt = /* @__PURE__ */ T.createElement("path", {
1379
+ fill: "currentColor",
1380
+ 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"
1381
+ })), vt || (vt = /* @__PURE__ */ T.createElement("path", {
1382
+ fill: "#DA0000",
1383
+ 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"
1384
+ })));
1385
+ }, yt, wt;
1386
+ function Fe() {
1387
+ return Fe = Object.assign ? Object.assign.bind() : function(e) {
1388
+ for (var n = 1; n < arguments.length; n++) {
1389
+ var s = arguments[n];
1390
+ for (var a in s)
1391
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1392
+ }
1393
+ return e;
1394
+ }, Fe.apply(this, arguments);
1395
+ }
1396
+ var Ut = function(n) {
1397
+ return /* @__PURE__ */ T.createElement("svg", Fe({
1398
+ xmlns: "http://www.w3.org/2000/svg",
1399
+ width: 24,
1400
+ height: 24,
1401
+ fill: "none",
1402
+ viewBox: "0 0 24 24"
1403
+ }, n), yt || (yt = /* @__PURE__ */ T.createElement("path", {
1404
+ fill: "currentColor",
1405
+ 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"
1406
+ })), wt || (wt = /* @__PURE__ */ T.createElement("path", {
1407
+ fill: "#14C786",
1408
+ 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"
1409
+ })));
1410
+ }, Nt, Ct;
1411
+ function Ie() {
1412
+ return Ie = Object.assign ? Object.assign.bind() : function(e) {
1413
+ for (var n = 1; n < arguments.length; n++) {
1414
+ var s = arguments[n];
1415
+ for (var a in s)
1416
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1417
+ }
1418
+ return e;
1419
+ }, Ie.apply(this, arguments);
1420
+ }
1421
+ var Ge = function(n) {
1422
+ return /* @__PURE__ */ T.createElement("svg", Ie({
1423
+ xmlns: "http://www.w3.org/2000/svg",
1424
+ width: 24,
1425
+ height: 24,
1426
+ fill: "none",
1427
+ viewBox: "0 0 24 24"
1428
+ }, n), Nt || (Nt = /* @__PURE__ */ T.createElement("path", {
1429
+ fill: "currentColor",
1430
+ 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"
1431
+ })), Ct || (Ct = /* @__PURE__ */ T.createElement("path", {
1432
+ fill: "#14C786",
1433
+ 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"
1434
+ })));
1435
+ }, St, kt;
1436
+ function $e() {
1437
+ return $e = Object.assign ? Object.assign.bind() : function(e) {
1438
+ for (var n = 1; n < arguments.length; n++) {
1439
+ var s = arguments[n];
1440
+ for (var a in s)
1441
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1442
+ }
1443
+ return e;
1444
+ }, $e.apply(this, arguments);
1445
+ }
1446
+ var et = function(n) {
1447
+ return /* @__PURE__ */ T.createElement("svg", $e({
1448
+ xmlns: "http://www.w3.org/2000/svg",
1449
+ width: 24,
1450
+ height: 24,
1451
+ fill: "none",
1452
+ viewBox: "0 0 24 24"
1453
+ }, n), St || (St = /* @__PURE__ */ T.createElement("path", {
1454
+ fill: "#DA0000",
1455
+ 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"
1456
+ })), kt || (kt = /* @__PURE__ */ T.createElement("path", {
1457
+ fill: "currentColor",
1458
+ 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"
1459
+ })));
1460
+ };
1461
+ function Ls({ originNode: e, node: n, depth: s, index: a, deleteHandle: o, customOptions: i, startIndex: r, parent: c, parentPath: d }) {
1462
+ const { enableClipboard: m, src: f, onEdit: x, onChange: u, forceUpdate: h, displaySize: v, CustomOperation: j } = le(ae), _ = [...d, String(a)], [g, b] = I(!0), S = C((A, E, W) => {
1463
+ e[A] = E, x && x({
1464
+ newValue: E,
1465
+ oldValue: W,
1466
+ depth: s,
1467
+ src: f,
1468
+ indexOrName: A,
1469
+ parentType: "array",
1470
+ parentPath: d
1471
+ }), u && u({ type: "edit", depth: s, src: f, indexOrName: A, parentType: "array", parentPath: d }), h();
1472
+ }, [n, x, u, h]), N = (A) => {
1473
+ e.splice(A, 1), o && o(A, d), h();
1474
+ }, w = t.jsxs(t.Fragment, { children: [!g && t.jsxs("span", Object.assign({ onClick: () => b(!0), className: "jv-size-chevron" }, { children: [me(v, s, g) && t.jsxs("span", Object.assign({ className: "jv-size" }, { children: [je(n), " Items"] })), t.jsx(Be, { className: "jv-chevron" })] })), !g && m && Se(i) && t.jsx(ke, { node: n, nodeMeta: { depth: s, indexOrName: a, parent: c, parentPath: d, currentPath: _ } }), typeof j == "function" ? t.jsx(j, { node: n }) : null] });
1475
+ return t.jsxs("div", { children: [t.jsx("span", { children: "[" }), w, g ? t.jsxs("button", Object.assign({ onClick: () => b(!1), className: "jv-button" }, { children: [r, " ... ", r + n.length - 1] })) : t.jsx("div", Object.assign({ className: "jv-indent" }, { children: n.map((A, E) => t.jsx(Qe, { indexOrName: E + r, value: A, depth: s, parent: n, deleteHandle: N, editHandle: S, parentPath: d }, String(a) + String(E))) })), t.jsx("span", { children: "]" })] });
1476
+ }
1477
+ function Qs({ node: e, depth: n, deleteHandle: s, indexOrName: a, customOptions: o, parent: i, parentPath: r }) {
1478
+ const c = typeof a < "u" ? [...r, String(a)] : r, d = [];
1479
+ for (let O = 0; O < e.length; O += 100)
1480
+ d.push(e.slice(O, O + 100));
1481
+ const { collapsed: m, enableClipboard: f, collapseObjectsAfterLength: x, editable: u, onDelete: h, src: v, onAdd: j, CustomOperation: _, onChange: g, forceUpdate: b, displaySize: S } = le(ae), [N, w] = I(ft(e, n, a, m, x, o));
1482
+ ie(() => {
1483
+ w(ft(e, n, a, m, x, o));
1484
+ }, [m, x]);
1485
+ const [A, E] = I(!1), W = () => {
1486
+ E(!1), s && s(a, r), h && h({ value: e, depth: n, src: v, indexOrName: a, parentType: "array", parentPath: r }), g && g({
1487
+ type: "delete",
1488
+ depth: n,
1489
+ src: v,
1490
+ indexOrName: a,
1491
+ parentType: "array",
1492
+ parentPath: r
1493
+ });
1494
+ }, [P, X] = I(!1), L = () => {
1495
+ const O = e;
1496
+ O.push(null), j && j({ indexOrName: O.length - 1, depth: n, src: v, parentType: "array", parentPath: r }), g && g({ type: "add", indexOrName: O.length - 1, depth: n, src: v, parentType: "array", parentPath: r }), b();
1497
+ }, Q = A || P, z = () => {
1498
+ E(!1), X(!1);
1499
+ }, q = t.jsxs(t.Fragment, { children: [!N && !Q && t.jsxs("span", Object.assign({ onClick: () => w(!0), className: "jv-size-chevron" }, { children: [me(S, n, N) && t.jsxs("span", Object.assign({ className: "jv-size" }, { children: [e.length, " Items"] })), t.jsx(Be, { className: "jv-chevron" })] })), Q && t.jsx(Ge, { className: "json-view--edit", style: { display: "inline-block" }, onClick: P ? L : W }), Q && t.jsx(et, { className: "json-view--edit", style: { display: "inline-block" }, onClick: z }), !N && !Q && f && Se(o) && t.jsx(ke, { node: e, nodeMeta: { depth: n, indexOrName: a, parent: i, parentPath: r, currentPath: c } }), !N && !Q && It(u) && $t(o) && t.jsx(Ut, { className: "json-view--edit", onClick: () => {
1500
+ L();
1501
+ } }), !N && !Q && Ze(u) && Xe(o) && s && t.jsx(Ke, { className: "json-view--edit", onClick: () => E(!0) }), typeof _ == "function" ? t.jsx(_, { node: e }) : null] });
1502
+ return t.jsxs(t.Fragment, { children: [t.jsx("span", { children: "[" }), q, N ? t.jsx("button", Object.assign({ onClick: () => w(!1), className: "jv-button" }, { children: "..." })) : t.jsx("div", Object.assign({ className: "jv-indent" }, { children: d.map((O, $) => t.jsx(Ls, { originNode: e, node: O, depth: n, index: $, startIndex: $ * 100, deleteHandle: s, customOptions: o, parentPath: r }, String(a) + String($))) })), t.jsx("span", { children: "]" }), N && me(S, n, N) && t.jsxs("span", Object.assign({ onClick: () => w(!1), className: "jv-size" }, { children: [e.length, " Items"] }))] });
1503
+ }
1504
+ function Js({ node: e, depth: n, indexOrName: s, deleteHandle: a, customOptions: o, parent: i, parentPath: r }) {
1505
+ const { collapsed: c, onCollapse: d, enableClipboard: m, ignoreLargeArray: f, collapseObjectsAfterLength: x, editable: u, onDelete: h, src: v, onAdd: j, onEdit: _, onChange: g, forceUpdate: b, displaySize: S, CustomOperation: N } = le(ae), w = typeof s < "u" ? [...r, String(s)] : r;
1506
+ if (!f && Array.isArray(e) && e.length > 100)
1507
+ return t.jsx(Qs, { node: e, depth: n, indexOrName: s, deleteHandle: a, customOptions: o, parentPath: w });
1508
+ const A = se(e), [E, W] = I(ut(e, n, s, c, x, o)), P = (p) => {
1509
+ d?.({ isCollapsing: !p, node: e, depth: n, indexOrName: s }), W(p);
1510
+ };
1511
+ ie(() => {
1512
+ P(ut(e, n, s, c, x, o));
1513
+ }, [c, x]);
1514
+ const X = C((p, k, V) => {
1515
+ Array.isArray(e) ? e[+p] = k : e && (e[p] = k), _ && _({
1516
+ newValue: k,
1517
+ oldValue: V,
1518
+ depth: n,
1519
+ src: v,
1520
+ indexOrName: p,
1521
+ parentType: A ? "object" : "array",
1522
+ parentPath: w
1523
+ }), g && g({ type: "edit", depth: n, src: v, indexOrName: p, parentType: A ? "object" : "array", parentPath: w }), b();
1524
+ }, [e, _, g, b]), L = (p) => {
1525
+ Array.isArray(e) ? e.splice(+p, 1) : e && delete e[p], b();
1526
+ }, [Q, z] = I(!1), q = () => {
1527
+ z(!1), a && a(s, w), h && h({ value: e, depth: n, src: v, indexOrName: s, parentType: A ? "object" : "array", parentPath: w }), g && g({
1528
+ type: "delete",
1529
+ depth: n,
1530
+ src: v,
1531
+ indexOrName: s,
1532
+ parentType: A ? "object" : "array",
1533
+ parentPath: w
1534
+ });
1535
+ }, [O, $] = I(!1), R = qe(null), H = () => {
1536
+ var p;
1537
+ if (A) {
1538
+ const k = (p = R.current) === null || p === void 0 ? void 0 : p.value;
1539
+ k && (e[k] = null, R.current && (R.current.value = ""), $(!1), j && j({ indexOrName: k, depth: n, src: v, parentType: "object", parentPath: w }), g && g({ type: "add", indexOrName: k, depth: n, src: v, parentType: "object", parentPath: w }));
1540
+ } else if (Array.isArray(e)) {
1541
+ const k = e;
1542
+ k.push(null), j && j({ indexOrName: k.length - 1, depth: n, src: v, parentType: "array", parentPath: w }), g && g({ type: "add", indexOrName: k.length - 1, depth: n, src: v, parentType: "array", parentPath: w });
1543
+ }
1544
+ b();
1545
+ }, U = (p) => {
1546
+ p.key === "Enter" ? (p.preventDefault(), H()) : p.key === "Escape" && y();
1547
+ }, l = Q || O, y = () => {
1548
+ z(!1), $(!1);
1549
+ }, D = t.jsxs(t.Fragment, { children: [!E && !l && t.jsxs("span", Object.assign({ onClick: () => P(!0), className: "jv-size-chevron" }, { children: [me(S, n, E) && t.jsxs("span", Object.assign({ className: "jv-size" }, { children: [je(e), " Items"] })), t.jsx(Be, { className: "jv-chevron" })] })), O && A && t.jsx("input", { className: "json-view--input", placeholder: "property", ref: R, onKeyDown: U }), l && t.jsx(Ge, { className: "json-view--edit", style: { display: "inline-block" }, onClick: O ? H : q }), l && t.jsx(et, { className: "json-view--edit", style: { display: "inline-block" }, onClick: y }), !E && !l && m && Se(o) && t.jsx(ke, { node: e, nodeMeta: { depth: n, indexOrName: s, parent: i, parentPath: r, currentPath: w } }), !E && !l && It(u) && $t(o) && t.jsx(Ut, { className: "json-view--edit", onClick: () => {
1550
+ A ? ($(!0), setTimeout(() => {
1551
+ var p;
1552
+ return (p = R.current) === null || p === void 0 ? void 0 : p.focus();
1553
+ })) : H();
1554
+ } }), !E && !l && Ze(u) && Xe(o) && a && t.jsx(Ke, { className: "json-view--edit", onClick: () => z(!0) }), typeof N == "function" ? t.jsx(N, { node: e }) : null] });
1555
+ return Array.isArray(e) ? t.jsxs(t.Fragment, { children: [t.jsx("span", { children: "[" }), D, E ? t.jsx("button", Object.assign({ onClick: () => P(!1), className: "jv-button" }, { children: "..." })) : t.jsx("div", Object.assign({ className: "jv-indent" }, { children: e.map((p, k) => t.jsx(Qe, { indexOrName: k, value: p, depth: n, parent: e, deleteHandle: L, editHandle: X, parentPath: w }, String(s) + String(k))) })), t.jsx("span", { children: "]" }), E && me(S, n, E) && t.jsxs("span", Object.assign({ onClick: () => P(!1), className: "jv-size" }, { children: [je(e), " Items"] }))] }) : A ? t.jsxs(t.Fragment, { children: [t.jsx("span", { children: "{" }), D, E ? t.jsx("button", Object.assign({ onClick: () => P(!1), className: "jv-button" }, { children: "..." })) : t.jsx("div", Object.assign({ className: "jv-indent" }, { children: Object.entries(e).map(([p, k]) => t.jsx(Qe, { indexOrName: p, value: k, depth: n, parent: e, deleteHandle: L, editHandle: X, parentPath: w }, String(s) + String(p))) })), t.jsx("span", { children: "}" }), E && me(S, n, E) && t.jsxs("span", Object.assign({ onClick: () => P(!1), className: "jv-size" }, { children: [je(e), " Items"] }))] }) : t.jsx("span", { children: String(e) });
1556
+ }
1557
+ const Fs = de.forwardRef(({ str: e, className: n, ctrlClick: s }, a) => {
1558
+ let { collapseStringMode: o, collapseStringsAfterLength: i, customizeCollapseStringUI: r } = le(ae);
1559
+ const [c, d] = I(!0), m = qe(null);
1560
+ i = i > 0 ? i : 0;
1561
+ const f = e.replace(/\s+/g, " "), x = typeof r == "function" ? r(f, c) : typeof r == "string" ? r : "...", u = (h) => {
1562
+ var v;
1563
+ if ((h.ctrlKey || h.metaKey) && s)
1564
+ s(h);
1565
+ else {
1566
+ const j = window.getSelection();
1567
+ if (j && j.anchorOffset !== j.focusOffset && ((v = j.anchorNode) === null || v === void 0 ? void 0 : v.parentElement) === m.current)
1568
+ return;
1569
+ d(!c);
1570
+ }
1571
+ };
1572
+ if (e.length <= i)
1573
+ return t.jsxs("span", Object.assign({ ref: m, className: n, onClick: s }, { children: ['"', e, '"'] }));
1574
+ if (o === "address")
1575
+ return e.length <= 10 ? t.jsxs("span", Object.assign({ ref: m, className: n, onClick: s }, { children: ['"', e, '"'] })) : t.jsxs("span", Object.assign({ ref: m, onClick: u, className: n + " cursor-pointer" }, { children: ['"', c ? [f.slice(0, 6), x, f.slice(-4)] : e, '"'] }));
1576
+ if (o === "directly")
1577
+ return t.jsxs("span", Object.assign({ ref: m, onClick: u, className: n + " cursor-pointer" }, { children: ['"', c ? [f.slice(0, i), x] : e, '"'] }));
1578
+ if (o === "word") {
1579
+ let h = i, v = i + 1, j = f, _ = 1;
1580
+ for (; ; ) {
1581
+ if (/\W/.test(e[h])) {
1582
+ j = e.slice(0, h);
1583
+ break;
1584
+ }
1585
+ if (/\W/.test(e[v])) {
1586
+ j = e.slice(0, v);
1587
+ break;
1588
+ }
1589
+ if (_ === 6) {
1590
+ j = e.slice(0, i);
1591
+ break;
1592
+ }
1593
+ _++, h--, v++;
1594
+ }
1595
+ return t.jsxs("span", Object.assign({ ref: m, onClick: u, className: n + " cursor-pointer" }, { children: ['"', c ? [j, x] : e, '"'] }));
1596
+ }
1597
+ return t.jsxs("span", Object.assign({ ref: m, className: n }, { children: ['"', e, '"'] }));
1598
+ });
1599
+ var Dt;
1600
+ function Ue() {
1601
+ return Ue = Object.assign ? Object.assign.bind() : function(e) {
1602
+ for (var n = 1; n < arguments.length; n++) {
1603
+ var s = arguments[n];
1604
+ for (var a in s)
1605
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1606
+ }
1607
+ return e;
1608
+ }, Ue.apply(this, arguments);
1609
+ }
1610
+ var Is = function(n) {
1611
+ return /* @__PURE__ */ T.createElement("svg", Ue({
1612
+ xmlns: "http://www.w3.org/2000/svg",
1613
+ width: 24,
1614
+ height: 24,
1615
+ fill: "none",
1616
+ viewBox: "0 0 24 24"
1617
+ }, n), Dt || (Dt = /* @__PURE__ */ T.createElement("path", {
1618
+ fill: "currentColor",
1619
+ 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"
1620
+ })));
1621
+ }, Et, At;
1622
+ function We() {
1623
+ return We = Object.assign ? Object.assign.bind() : function(e) {
1624
+ for (var n = 1; n < arguments.length; n++) {
1625
+ var s = arguments[n];
1626
+ for (var a in s)
1627
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
1628
+ }
1629
+ return e;
1630
+ }, We.apply(this, arguments);
1631
+ }
1632
+ var $s = function(n) {
1633
+ return /* @__PURE__ */ T.createElement("svg", We({
1634
+ xmlns: "http://www.w3.org/2000/svg",
1635
+ width: 24,
1636
+ height: 24,
1637
+ fill: "none",
1638
+ viewBox: "0 0 24 24"
1639
+ }, n), Et || (Et = /* @__PURE__ */ T.createElement("path", {
1640
+ fill: "currentColor",
1641
+ 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"
1642
+ })), At || (At = /* @__PURE__ */ T.createElement("path", {
1643
+ fill: "currentColor",
1644
+ 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"
1645
+ })));
1646
+ };
1647
+ function Wt({ node: e, depth: n, deleteHandle: s, indexOrName: a, parent: o, editHandle: i, parentPath: r }) {
1648
+ const { collapseStringsAfterLength: c, enableClipboard: d, editable: m, src: f, onDelete: x, onChange: u, customizeNode: h, matchesURL: v, urlRegExp: j, EditComponent: _, DoneComponent: g, CancelComponent: b, CustomOperation: S } = le(ae);
1649
+ let N;
1650
+ if (typeof h == "function" && (N = Ye(h, [{ node: e, depth: n, indexOrName: a }])), N) {
1651
+ if (cn(N))
1652
+ return N;
1653
+ if (Rs(N)) {
1654
+ const w = N;
1655
+ return t.jsx(w, { node: e, depth: n, indexOrName: a });
1656
+ }
1657
+ }
1658
+ if (Array.isArray(e) || se(e))
1659
+ return t.jsx(Js, { parent: o, node: e, depth: n, indexOrName: a, deleteHandle: s, parentPath: r, customOptions: typeof N == "object" ? N : void 0 });
1660
+ {
1661
+ const w = typeof e, A = typeof a < "u" ? [...r, String(a)] : r, [E, W] = I(!1), [P, X] = I(!1), L = qe(null), Q = () => {
1662
+ W(!0), setTimeout(() => {
1663
+ var p, k;
1664
+ (p = window.getSelection()) === null || p === void 0 || p.selectAllChildren(L.current), (k = L.current) === null || k === void 0 || k.focus();
1665
+ });
1666
+ }, z = C(() => {
1667
+ let p = L.current.innerText;
1668
+ try {
1669
+ const k = JSON.parse(p);
1670
+ i && i(a, k, e, r);
1671
+ } catch {
1672
+ const V = Ms(w, p);
1673
+ i && i(a, V, e, r);
1674
+ }
1675
+ W(!1);
1676
+ }, [i, a, e, r, w]), q = () => {
1677
+ W(!1), X(!1);
1678
+ }, O = () => {
1679
+ X(!1), s && s(a, r), x && x({
1680
+ value: e,
1681
+ depth: n,
1682
+ src: f,
1683
+ indexOrName: a,
1684
+ parentType: Array.isArray(o) ? "array" : "object",
1685
+ parentPath: r
1686
+ }), u && u({
1687
+ depth: n,
1688
+ src: f,
1689
+ indexOrName: a,
1690
+ parentType: Array.isArray(o) ? "array" : "object",
1691
+ type: "delete",
1692
+ parentPath: r
1693
+ });
1694
+ }, $ = C((p) => {
1695
+ p.key === "Enter" ? (p.preventDefault(), z()) : p.key === "Escape" && q();
1696
+ }, [z]), R = E || P, H = !R && mt(m) && ht(N) && i ? (p) => {
1697
+ (p.ctrlKey || p.metaKey) && Q();
1698
+ } : void 0, U = t.jsxs(t.Fragment, { children: [R && (typeof g == "function" ? t.jsx(g, { className: "json-view--edit", style: { display: "inline-block" }, onClick: P ? O : z }) : t.jsx(Ge, { className: "json-view--edit", style: { display: "inline-block" }, onClick: P ? O : z })), R && (typeof b == "function" ? t.jsx(b, { className: "json-view--edit", style: { display: "inline-block" }, onClick: q }) : t.jsx(et, { className: "json-view--edit", style: { display: "inline-block" }, onClick: q })), !R && d && Se(N) && t.jsx(ke, { node: e, nodeMeta: { depth: n, indexOrName: a, parent: o, parentPath: r, currentPath: A } }), !R && v && w === "string" && j.test(e) && Ts(N) && t.jsx("a", Object.assign({ href: e, target: "_blank", className: "json-view--link" }, { children: t.jsx($s, {}) })), !R && mt(m) && ht(N) && i && (typeof _ == "function" ? t.jsx(_, { className: "json-view--edit", onClick: Q }) : t.jsx(Is, { className: "json-view--edit", onClick: Q })), !R && Ze(m) && Xe(N) && s && t.jsx(Ke, { className: "json-view--edit", onClick: () => X(!0) }), typeof S == "function" ? t.jsx(S, { node: e }) : null] });
1699
+ let l = "json-view--string";
1700
+ switch (w) {
1701
+ case "number":
1702
+ case "bigint":
1703
+ l = "json-view--number";
1704
+ break;
1705
+ case "boolean":
1706
+ l = "json-view--boolean";
1707
+ break;
1708
+ case "object":
1709
+ l = "json-view--null";
1710
+ break;
1711
+ }
1712
+ typeof N?.className == "string" && (l += " " + N.className), P && (l += " json-view--deleting");
1713
+ let y = String(e);
1714
+ w === "bigint" && (y += "n");
1715
+ const D = ye(() => t.jsx("span", { contentEditable: !0, className: l, dangerouslySetInnerHTML: { __html: w === "string" ? `"${y}"` : y }, ref: L, onKeyDown: $ }), [y, w, $]);
1716
+ return w === "string" ? t.jsxs(t.Fragment, { children: [E ? D : e.length > c ? t.jsx(Fs, { str: e, ref: L, className: l, ctrlClick: H }) : t.jsxs("span", Object.assign({ className: l, onClick: H }, { children: ['"', y, '"'] })), U] }) : t.jsxs(t.Fragment, { children: [E ? D : t.jsx("span", Object.assign({ className: l, onClick: H }, { children: y })), U] });
1717
+ }
1718
+ }
1719
+ const zt = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/, ae = ln({
1720
+ src: void 0,
1721
+ collapseStringsAfterLength: 99,
1722
+ collapseStringMode: "directly",
1723
+ customizeCollapseStringUI: void 0,
1724
+ collapseObjectsAfterLength: 20,
1725
+ collapsed: !1,
1726
+ onCollapse: void 0,
1727
+ enableClipboard: !0,
1728
+ editable: !1,
1729
+ onEdit: void 0,
1730
+ onDelete: void 0,
1731
+ onAdd: void 0,
1732
+ onChange: void 0,
1733
+ forceUpdate: () => {
1734
+ },
1735
+ customizeNode: void 0,
1736
+ customizeCopy: () => {
1737
+ },
1738
+ displaySize: void 0,
1739
+ displayArrayIndex: !0,
1740
+ matchesURL: !1,
1741
+ urlRegExp: zt,
1742
+ ignoreLargeArray: !1,
1743
+ CopyComponent: void 0,
1744
+ CopiedComponent: void 0,
1745
+ EditComponent: void 0,
1746
+ CancelComponent: void 0,
1747
+ DoneComponent: void 0,
1748
+ CustomOperation: void 0
1749
+ });
1750
+ function De({ src: e, collapseStringsAfterLength: n = 99, collapseStringMode: s = "directly", customizeCollapseStringUI: a, collapseObjectsAfterLength: o = 99, collapsed: i, onCollapse: r, enableClipboard: c = !0, editable: d = !1, onEdit: m, onDelete: f, onAdd: x, onChange: u, dark: h = !1, theme: v = "default", customizeNode: j, customizeCopy: _ = (q) => As(q), displaySize: g, displayArrayIndex: b = !0, style: S, className: N, matchesURL: w = !1, urlRegExp: A = zt, ignoreLargeArray: E = !1, CopyComponent: W, CopiedComponent: P, EditComponent: X, CancelComponent: L, DoneComponent: Q, CustomOperation: z }) {
1751
+ const [q, O] = I(0), $ = C(() => O((U) => ++U), []), [R, H] = I(e);
1752
+ return ie(() => H(e), [e]), t.jsx(ae.Provider, Object.assign({ value: {
1753
+ src: R,
1754
+ collapseStringsAfterLength: n,
1755
+ collapseStringMode: s,
1756
+ customizeCollapseStringUI: a,
1757
+ collapseObjectsAfterLength: o,
1758
+ collapsed: i,
1759
+ onCollapse: r,
1760
+ enableClipboard: c,
1761
+ editable: d,
1762
+ onEdit: m,
1763
+ onDelete: f,
1764
+ onAdd: x,
1765
+ onChange: u,
1766
+ forceUpdate: $,
1767
+ customizeNode: j,
1768
+ customizeCopy: _,
1769
+ displaySize: g,
1770
+ displayArrayIndex: b,
1771
+ matchesURL: w,
1772
+ urlRegExp: A,
1773
+ ignoreLargeArray: E,
1774
+ CopyComponent: W,
1775
+ CopiedComponent: P,
1776
+ EditComponent: X,
1777
+ CancelComponent: L,
1778
+ DoneComponent: Q,
1779
+ CustomOperation: z
1780
+ } }, { children: t.jsx("code", Object.assign({ className: "json-view" + (h ? " dark" : "") + (v && v !== "default" ? " json-view_" + v : "") + (N ? " " + N : ""), style: S }, { children: t.jsx(Wt, { node: R, depth: 1, editHandle: (U, l, y, D) => {
1781
+ H(l), m && m({
1782
+ newValue: l,
1783
+ oldValue: y,
1784
+ depth: 1,
1785
+ src: R,
1786
+ indexOrName: U,
1787
+ parentType: null,
1788
+ parentPath: D
1789
+ }), u && u({ type: "edit", depth: 1, src: R, indexOrName: U, parentType: null, parentPath: D });
1790
+ }, deleteHandle: (U, l) => {
1791
+ H(void 0), f && f({
1792
+ value: R,
1793
+ depth: 1,
1794
+ src: R,
1795
+ indexOrName: U,
1796
+ parentType: null,
1797
+ parentPath: l
1798
+ }), u && u({
1799
+ depth: 1,
1800
+ src: R,
1801
+ indexOrName: U,
1802
+ parentType: null,
1803
+ type: "delete",
1804
+ parentPath: l
1805
+ });
1806
+ }, parentPath: [] }) })) }));
1807
+ }
1808
+ const Ee = () => {
1809
+ const { jobs: e, selectedQueue: n, selectedStatus: s, setJobs: a, setLoading: o, setError: i, isLoading: r, error: c } = M(), d = C(
1810
+ async (g, b, S = 0, N = 100) => {
1811
+ o(!0), i(null);
1812
+ try {
1813
+ const w = new URLSearchParams({ status: b, start: String(S), end: String(N) }), A = await fetch(`/__motia/bullmq/queues/${encodeURIComponent(g)}/jobs?${w}`);
1814
+ if (!A.ok)
1815
+ throw new Error("Failed to fetch jobs");
1816
+ const E = await A.json();
1817
+ a(E.jobs);
1818
+ } catch (w) {
1819
+ i(w instanceof Error ? w.message : "Unknown error");
1820
+ } finally {
1821
+ o(!1);
1822
+ }
1823
+ },
1824
+ [a, o, i]
1825
+ ), m = C(async (g, b) => {
1826
+ try {
1827
+ const S = await fetch(
1828
+ `/__motia/bullmq/queues/${encodeURIComponent(g)}/jobs/${encodeURIComponent(b)}`
1829
+ );
1830
+ return S.ok ? await S.json() : null;
1831
+ } catch {
1832
+ return null;
1833
+ }
1834
+ }, []), f = C(
1835
+ async (g, b) => {
1836
+ try {
1837
+ await fetch(`/__motia/bullmq/queues/${encodeURIComponent(g)}/jobs/${encodeURIComponent(b)}/retry`, {
1838
+ method: "POST"
1839
+ }), n && await d(n.name, s);
1840
+ } catch (S) {
1841
+ i(S instanceof Error ? S.message : "Failed to retry job");
1842
+ }
1843
+ },
1844
+ [n, s, d, i]
1845
+ ), x = C(
1846
+ async (g, b) => {
1847
+ try {
1848
+ await fetch(
1849
+ `/__motia/bullmq/queues/${encodeURIComponent(g)}/jobs/${encodeURIComponent(b)}/remove`,
1850
+ {
1851
+ method: "POST"
1852
+ }
1853
+ ), n && await d(n.name, s);
1854
+ } catch (S) {
1855
+ i(S instanceof Error ? S.message : "Failed to remove job");
1856
+ }
1857
+ },
1858
+ [n, s, d, i]
1859
+ ), u = C(
1860
+ async (g, b) => {
1861
+ try {
1862
+ await fetch(
1863
+ `/__motia/bullmq/queues/${encodeURIComponent(g)}/jobs/${encodeURIComponent(b)}/promote`,
1864
+ {
1865
+ method: "POST"
1866
+ }
1867
+ ), n && await d(n.name, s);
1868
+ } catch (S) {
1869
+ i(S instanceof Error ? S.message : "Failed to promote job");
1870
+ }
1871
+ },
1872
+ [n, s, d, i]
1873
+ ), h = C(async (g, b = 0, S = 100) => {
1874
+ try {
1875
+ const N = new URLSearchParams({ start: String(b), end: String(S) }), w = await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(g)}/jobs?${N}`);
1876
+ return w.ok ? (await w.json()).jobs : [];
1877
+ } catch {
1878
+ return [];
1879
+ }
1880
+ }, []), v = C(
1881
+ async (g, b) => {
1882
+ try {
1883
+ await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(g)}/retry/${encodeURIComponent(b)}`, {
1884
+ method: "POST"
1885
+ });
1886
+ } catch (S) {
1887
+ i(S instanceof Error ? S.message : "Failed to retry from DLQ");
1888
+ }
1889
+ },
1890
+ [i]
1891
+ ), j = C(
1892
+ async (g) => {
1893
+ try {
1894
+ await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(g)}/retry-all`, {
1895
+ method: "POST"
1896
+ });
1897
+ } catch (b) {
1898
+ i(b instanceof Error ? b.message : "Failed to retry all from DLQ");
1899
+ }
1900
+ },
1901
+ [i]
1902
+ ), _ = C(
1903
+ async (g) => {
1904
+ try {
1905
+ await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(g)}/clear`, {
1906
+ method: "POST"
1907
+ });
1908
+ } catch (b) {
1909
+ i(b instanceof Error ? b.message : "Failed to clear DLQ");
1910
+ }
1911
+ },
1912
+ [i]
1913
+ );
1914
+ return ie(() => {
1915
+ n && d(n.name, s);
1916
+ }, [n, s, d]), {
1917
+ jobs: e,
1918
+ isLoading: r,
1919
+ error: c,
1920
+ fetchJobs: d,
1921
+ getJob: m,
1922
+ retryJob: f,
1923
+ removeJob: x,
1924
+ promoteJob: u,
1925
+ getDLQJobs: h,
1926
+ retryFromDLQ: v,
1927
+ retryAllFromDLQ: j,
1928
+ clearDLQ: _
1929
+ };
1930
+ }, qt = Y(({ job: e, onRetry: n }) => /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
1931
+ /* @__PURE__ */ t.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ t.jsxs(Z, { variant: "outline", size: "sm", onClick: n, children: [
1932
+ /* @__PURE__ */ t.jsx(oe, { className: "mr-2 h-4 w-4" }),
1933
+ "Retry"
1934
+ ] }) }),
1935
+ /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
1936
+ /* @__PURE__ */ t.jsxs("div", { children: [
1937
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Job ID" }),
1938
+ /* @__PURE__ */ t.jsx("div", { className: "font-mono text-xs", children: e.id })
1939
+ ] }),
1940
+ /* @__PURE__ */ t.jsxs("div", { children: [
1941
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Original Job ID" }),
1942
+ /* @__PURE__ */ t.jsx("div", { className: "font-mono text-xs", children: e.originalJobId || "-" })
1943
+ ] }),
1944
+ /* @__PURE__ */ t.jsxs("div", { children: [
1945
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Attempts Made" }),
1946
+ /* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: e.attemptsMade })
1947
+ ] }),
1948
+ /* @__PURE__ */ t.jsxs("div", { children: [
1949
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Failed At" }),
1950
+ /* @__PURE__ */ t.jsx("div", { children: Ce(e.failureTimestamp, { addSuffix: !0 }) })
1951
+ ] })
1952
+ ] }),
1953
+ /* @__PURE__ */ t.jsxs("div", { children: [
1954
+ /* @__PURE__ */ t.jsx("div", { className: "text-sm font-semibold text-destructive mb-2", children: "Failure Reason" }),
1955
+ /* @__PURE__ */ t.jsx("div", { className: "font-mono text-sm bg-destructive/10 p-3 rounded text-destructive", children: e.failureReason })
1956
+ ] })
1957
+ ] }));
1958
+ qt.displayName = "DLQJobDetailContent";
1959
+ const Ht = Y(({ data: e }) => /* @__PURE__ */ t.jsx("div", { className: "bg-muted/30 p-4 rounded overflow-auto max-h-[400px]", children: /* @__PURE__ */ t.jsx(De, { src: e, theme: "atom", collapsed: 2 }) }));
1960
+ Ht.displayName = "DLQJobDataTab";
1961
+ const Vt = Y(() => {
1962
+ const e = M((b) => b.selectedQueue), { getDLQJobs: n, retryFromDLQ: s, retryAllFromDLQ: a, clearDLQ: o } = Ee(), { fetchQueues: i } = He(), [r, c] = I([]), [d, m] = I(!1), [f, x] = I(null), u = C(async () => {
1963
+ if (e?.isDLQ) {
1964
+ m(!0);
1965
+ try {
1966
+ const b = await n(e.name);
1967
+ c(b);
1968
+ } finally {
1969
+ m(!1);
1970
+ }
1971
+ }
1972
+ }, [e, n]);
1973
+ ie(() => {
1974
+ e?.isDLQ && u();
1975
+ }, [e, u]);
1976
+ const h = C(
1977
+ async (b) => {
1978
+ e && (await s(e.name, b), await u(), await i());
1979
+ },
1980
+ [e, s, u, i]
1981
+ ), v = C(async () => {
1982
+ e && (await a(e.name), await u(), await i());
1983
+ }, [e, a, u, i]), j = C(async () => {
1984
+ e && (await o(e.name), await u(), await i());
1985
+ }, [e, o, u, i]), _ = C(() => {
1986
+ x(null);
1987
+ }, []), g = C(() => {
1988
+ f && (h(f.id), x(null));
1989
+ }, [f, h]);
1990
+ return e?.isDLQ ? /* @__PURE__ */ t.jsx(Rt, { children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col h-full", children: [
1991
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between p-3 border-b border-border", children: [
1992
+ /* @__PURE__ */ t.jsxs("div", { children: [
1993
+ /* @__PURE__ */ t.jsx("h2", { className: "font-semibold text-lg", children: e.displayName }),
1994
+ /* @__PURE__ */ t.jsxs("p", { className: "text-sm text-muted-foreground", children: [
1995
+ r.length,
1996
+ " failed job",
1997
+ r.length !== 1 ? "s" : "",
1998
+ " in dead letter queue"
1999
+ ] })
2000
+ ] }),
2001
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2002
+ /* @__PURE__ */ t.jsxs(ee, { children: [
2003
+ /* @__PURE__ */ t.jsx(te, { asChild: !0, children: /* @__PURE__ */ t.jsx(Z, { variant: "ghost", size: "icon", onClick: u, disabled: d, children: /* @__PURE__ */ t.jsx(oe, { className: `h-4 w-4 ${d ? "animate-spin" : ""}` }) }) }),
2004
+ /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx("p", { children: "Refresh DLQ jobs list" }) })
2005
+ ] }),
2006
+ /* @__PURE__ */ t.jsxs(ee, { children: [
2007
+ /* @__PURE__ */ t.jsx(te, { asChild: !0, children: /* @__PURE__ */ t.jsxs(Z, { variant: "outline", size: "sm", onClick: v, disabled: r.length === 0, children: [
2008
+ /* @__PURE__ */ t.jsx(oe, { className: "mr-2 h-4 w-4" }),
2009
+ "Retry All"
2010
+ ] }) }),
2011
+ /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx("p", { children: "Re-queue all failed jobs to the original queue" }) })
2012
+ ] }),
2013
+ /* @__PURE__ */ t.jsxs(ee, { children: [
2014
+ /* @__PURE__ */ t.jsx(te, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
2015
+ Z,
2016
+ {
2017
+ variant: "outline",
2018
+ size: "sm",
2019
+ onClick: j,
2020
+ disabled: r.length === 0,
2021
+ className: "text-destructive",
2022
+ children: [
2023
+ /* @__PURE__ */ t.jsx(fe, { className: "mr-2 h-4 w-4" }),
2024
+ "Clear All"
2025
+ ]
2026
+ }
2027
+ ) }),
2028
+ /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx("p", { children: "Permanently delete all jobs from DLQ" }) })
2029
+ ] })
2030
+ ] })
2031
+ ] }),
2032
+ r.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-center flex-1 text-muted-foreground", children: "No jobs in dead letter queue" }) : /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ t.jsxs(Tt, { children: [
2033
+ /* @__PURE__ */ t.jsx(Mt, { className: "sticky top-0 bg-background/95 backdrop-blur-sm", children: /* @__PURE__ */ t.jsxs(Ne, { children: [
2034
+ /* @__PURE__ */ t.jsx(B, { className: "w-[180px]", children: "Job ID" }),
2035
+ /* @__PURE__ */ t.jsx(B, { className: "w-[180px]", children: "Original Job" }),
2036
+ /* @__PURE__ */ t.jsx(B, { children: "Failure Reason" }),
2037
+ /* @__PURE__ */ t.jsx(B, { className: "w-[100px]", children: "Attempts" }),
2038
+ /* @__PURE__ */ t.jsx(B, { className: "w-[150px]", children: "Failed At" }),
2039
+ /* @__PURE__ */ t.jsx(B, { className: "w-[100px]", children: "Actions" })
2040
+ ] }) }),
2041
+ /* @__PURE__ */ t.jsx(Ot, { children: r.map((b) => /* @__PURE__ */ t.jsxs(
2042
+ Ne,
2043
+ {
2044
+ className: "cursor-pointer hover:bg-muted-foreground/10",
2045
+ onClick: () => x(b),
2046
+ children: [
2047
+ /* @__PURE__ */ t.jsx(K, { className: "font-mono text-xs", children: b.id }),
2048
+ /* @__PURE__ */ t.jsx(K, { className: "font-mono text-xs text-muted-foreground", children: b.originalJobId || "-" }),
2049
+ /* @__PURE__ */ t.jsx(K, { className: "text-destructive text-sm truncate max-w-[300px]", children: b.failureReason }),
2050
+ /* @__PURE__ */ t.jsx(K, { children: b.attemptsMade }),
2051
+ /* @__PURE__ */ t.jsx(K, { className: "text-xs text-muted-foreground", children: Ce(b.failureTimestamp, { addSuffix: !0 }) }),
2052
+ /* @__PURE__ */ t.jsx(K, { onClick: (S) => S.stopPropagation(), children: /* @__PURE__ */ t.jsxs(ee, { children: [
2053
+ /* @__PURE__ */ t.jsx(te, { asChild: !0, children: /* @__PURE__ */ t.jsx(Z, { variant: "ghost", size: "sm", onClick: () => h(b.id), children: /* @__PURE__ */ t.jsx(oe, { className: "h-4 w-4" }) }) }),
2054
+ /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx("p", { children: "Retry this job" }) })
2055
+ ] }) })
2056
+ ]
2057
+ },
2058
+ b.id
2059
+ )) })
2060
+ ] }) }),
2061
+ f && /* @__PURE__ */ t.jsx(
2062
+ Pt,
2063
+ {
2064
+ onClose: _,
2065
+ title: "Dead Letter Job",
2066
+ initialWidth: 600,
2067
+ tabs: [
2068
+ {
2069
+ label: "Details",
2070
+ content: /* @__PURE__ */ t.jsx(qt, { job: f, onRetry: g })
2071
+ },
2072
+ {
2073
+ label: "Event Data",
2074
+ content: /* @__PURE__ */ t.jsx(Ht, { data: f.originalEvent })
2075
+ }
2076
+ ],
2077
+ actions: [{ icon: /* @__PURE__ */ t.jsx(Ve, {}), onClick: _, label: "Close" }]
2078
+ }
2079
+ )
2080
+ ] }) }) : null;
2081
+ });
2082
+ Vt.displayName = "DLQPanel";
2083
+ /**
2084
+ * @license lucide-react v0.545.0 - ISC
2085
+ *
2086
+ * This source code is licensed under the ISC license.
2087
+ * See the LICENSE file in the root directory of this source tree.
2088
+ */
2089
+ const Us = [
2090
+ ["path", { d: "M7 7h10v10", key: "1tivn9" }],
2091
+ ["path", { d: "M7 17 17 7", key: "1vkiza" }]
2092
+ ], Yt = G("arrow-up-right", Us), Zt = Y(({ data: e }) => /* @__PURE__ */ t.jsx("div", { className: "bg-muted/30 p-4 rounded", children: /* @__PURE__ */ t.jsx(De, { src: e, theme: "atom", collapsed: 2 }) }));
2093
+ Zt.displayName = "JobDataTab";
2094
+ const Xt = Y(({ opts: e }) => /* @__PURE__ */ t.jsx("div", { className: "bg-muted/30 p-4 rounded", children: /* @__PURE__ */ t.jsx(De, { src: e, theme: "atom", collapsed: 2 }) }));
2095
+ Xt.displayName = "JobOptionsTab";
2096
+ const Bt = Y(({ returnvalue: e }) => /* @__PURE__ */ t.jsx("div", { className: "bg-muted/30 p-4 rounded", children: /* @__PURE__ */ t.jsx(De, { src: e, theme: "atom", collapsed: 2 }) }));
2097
+ Bt.displayName = "JobResultTab";
2098
+ const Kt = Y(({ failedReason: e, stacktrace: n }) => /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
2099
+ /* @__PURE__ */ t.jsxs("div", { children: [
2100
+ /* @__PURE__ */ t.jsx("div", { className: "text-sm font-semibold text-destructive mb-1", children: "Error Message" }),
2101
+ /* @__PURE__ */ t.jsx("div", { className: "font-mono text-sm bg-destructive/10 p-3 rounded text-destructive", children: e })
2102
+ ] }),
2103
+ n && n.length > 0 && /* @__PURE__ */ t.jsxs("div", { children: [
2104
+ /* @__PURE__ */ t.jsx("div", { className: "text-sm font-semibold text-muted-foreground mb-1", children: "Stack Trace" }),
2105
+ /* @__PURE__ */ t.jsx("pre", { className: "font-mono text-xs bg-muted p-3 rounded overflow-auto max-h-[300px]", children: n.join(`
2106
+ `) })
2107
+ ] })
2108
+ ] }));
2109
+ Kt.displayName = "JobErrorTab";
2110
+ const Gt = Y(() => {
2111
+ const e = M((g) => g.selectedJob), n = M((g) => g.selectedQueue), s = M((g) => g.jobDetailOpen), a = M((g) => g.setJobDetailOpen), o = M((g) => g.setSelectedJob), { retryJob: i, removeJob: r, promoteJob: c } = Ee(), d = C(() => {
2112
+ a(!1), o(null);
2113
+ }, [a, o]), m = C(async () => {
2114
+ !n || !e || (await i(n.name, e.id), d());
2115
+ }, [n, e, i, d]), f = C(async () => {
2116
+ !n || !e || (await r(n.name, e.id), d());
2117
+ }, [n, e, r, d]), x = C(async () => {
2118
+ !n || !e || (await c(n.name, e.id), d());
2119
+ }, [n, e, c, d]);
2120
+ if (!s || !e || !n) return null;
2121
+ const u = !!e.failedReason, h = e.delay && e.delay > 0, v = e.returnvalue !== void 0 && e.returnvalue !== null, j = [
2122
+ { label: "Data", content: /* @__PURE__ */ t.jsx(Zt, { data: e.data }) },
2123
+ { label: "Options", content: /* @__PURE__ */ t.jsx(Xt, { opts: e.opts }) },
2124
+ ...v ? [{ label: "Result", content: /* @__PURE__ */ t.jsx(Bt, { returnvalue: e.returnvalue }) }] : [],
2125
+ ...u ? [
2126
+ {
2127
+ label: "Error",
2128
+ content: /* @__PURE__ */ t.jsx(Kt, { failedReason: e.failedReason, stacktrace: e.stacktrace })
2129
+ }
2130
+ ] : []
2131
+ ], _ = u ? /* @__PURE__ */ t.jsx("span", { className: "text-destructive", children: "Failed" }) : e.finishedOn ? /* @__PURE__ */ t.jsx("span", { className: "text-green-500", children: "Completed" }) : e.processedOn ? /* @__PURE__ */ t.jsx("span", { className: "text-yellow-500", children: "Processing" }) : h ? /* @__PURE__ */ t.jsx("span", { className: "text-purple-500", children: "Delayed" }) : /* @__PURE__ */ t.jsx("span", { className: "text-blue-500", children: "Waiting" });
2132
+ return /* @__PURE__ */ t.jsx(
2133
+ Pt,
2134
+ {
2135
+ onClose: d,
2136
+ title: e.name,
2137
+ initialWidth: 600,
2138
+ tabs: j,
2139
+ actions: [{ icon: /* @__PURE__ */ t.jsx(Ve, {}), onClick: d, label: "Close" }],
2140
+ children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
2141
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2", children: [
2142
+ u && /* @__PURE__ */ t.jsxs(Z, { variant: "outline", size: "sm", onClick: m, children: [
2143
+ /* @__PURE__ */ t.jsx(oe, { className: "mr-2 h-4 w-4" }),
2144
+ "Retry"
2145
+ ] }),
2146
+ h && /* @__PURE__ */ t.jsxs(Z, { variant: "outline", size: "sm", onClick: x, children: [
2147
+ /* @__PURE__ */ t.jsx(Yt, { className: "mr-2 h-4 w-4" }),
2148
+ "Promote"
2149
+ ] }),
2150
+ /* @__PURE__ */ t.jsxs(Z, { variant: "outline", size: "sm", onClick: f, className: "text-destructive", children: [
2151
+ /* @__PURE__ */ t.jsx(fe, { className: "mr-2 h-4 w-4" }),
2152
+ "Remove"
2153
+ ] })
2154
+ ] }),
2155
+ /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
2156
+ /* @__PURE__ */ t.jsxs("div", { children: [
2157
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Job ID" }),
2158
+ /* @__PURE__ */ t.jsx("div", { className: "font-mono text-xs", children: e.id })
2159
+ ] }),
2160
+ /* @__PURE__ */ t.jsxs("div", { children: [
2161
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Status" }),
2162
+ /* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: _ })
2163
+ ] }),
2164
+ /* @__PURE__ */ t.jsxs("div", { children: [
2165
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Created" }),
2166
+ /* @__PURE__ */ t.jsx("div", { children: Ce(e.timestamp, { addSuffix: !0 }) })
2167
+ ] }),
2168
+ /* @__PURE__ */ t.jsxs("div", { children: [
2169
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Attempts" }),
2170
+ /* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: e.attemptsMade })
2171
+ ] }),
2172
+ /* @__PURE__ */ t.jsxs("div", { children: [
2173
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Progress" }),
2174
+ /* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: typeof e.progress == "number" ? `${e.progress}%` : "-" })
2175
+ ] }),
2176
+ /* @__PURE__ */ t.jsxs("div", { children: [
2177
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Delay" }),
2178
+ /* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: e.delay ? `${e.delay}ms` : "-" })
2179
+ ] })
2180
+ ] })
2181
+ ] })
2182
+ }
2183
+ );
2184
+ });
2185
+ Gt.displayName = "JobDetail";
2186
+ /**
2187
+ * @license lucide-react v0.545.0 - ISC
2188
+ *
2189
+ * This source code is licensed under the ISC license.
2190
+ * See the LICENSE file in the root directory of this source tree.
2191
+ */
2192
+ const Ws = [
2193
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
2194
+ ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
2195
+ ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
2196
+ ], en = G("ellipsis-vertical", Ws);
2197
+ /**
2198
+ * @license lucide-react v0.545.0 - ISC
2199
+ *
2200
+ * This source code is licensed under the ISC license.
2201
+ * See the LICENSE file in the root directory of this source tree.
2202
+ */
2203
+ const zs = [
2204
+ ["rect", { x: "14", y: "3", width: "5", height: "18", rx: "1", key: "kaeet6" }],
2205
+ ["rect", { x: "5", y: "3", width: "5", height: "18", rx: "1", key: "1wsw3u" }]
2206
+ ], tn = G("pause", zs);
2207
+ /**
2208
+ * @license lucide-react v0.545.0 - ISC
2209
+ *
2210
+ * This source code is licensed under the ISC license.
2211
+ * See the LICENSE file in the root directory of this source tree.
2212
+ */
2213
+ const qs = [
2214
+ [
2215
+ "path",
2216
+ {
2217
+ d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
2218
+ key: "10ikf1"
2219
+ }
2220
+ ]
2221
+ ], Hs = G("play", qs), nn = Y(({ job: e, queueName: n, onSelect: s, isSelected: a }) => {
2222
+ const { retryJob: o, removeJob: i, promoteJob: r } = Ee(), c = C(
2223
+ (f) => {
2224
+ f.stopPropagation(), o(n, e.id);
2225
+ },
2226
+ [n, e.id, o]
2227
+ ), d = C(
2228
+ (f) => {
2229
+ f.stopPropagation(), i(n, e.id);
2230
+ },
2231
+ [n, e.id, i]
2232
+ ), m = C(
2233
+ (f) => {
2234
+ f.stopPropagation(), r(n, e.id);
2235
+ },
2236
+ [n, e.id, r]
2237
+ );
2238
+ return /* @__PURE__ */ t.jsxs(
2239
+ Ne,
2240
+ {
2241
+ onClick: s,
2242
+ className: re(
2243
+ "cursor-pointer border-0",
2244
+ a ? "bg-muted-foreground/10 hover:bg-muted-foreground/20" : "hover:bg-muted-foreground/10"
2245
+ ),
2246
+ children: [
2247
+ /* @__PURE__ */ t.jsx(K, { className: "font-mono text-xs", children: e.id }),
2248
+ /* @__PURE__ */ t.jsx(K, { className: "font-medium", children: e.name }),
2249
+ /* @__PURE__ */ t.jsx(K, { className: "text-xs text-muted-foreground", children: Ce(e.timestamp, { addSuffix: !0 }) }),
2250
+ /* @__PURE__ */ t.jsx(K, { children: /* @__PURE__ */ t.jsx("span", { className: "text-xs", children: e.attemptsMade }) }),
2251
+ /* @__PURE__ */ t.jsx(K, { children: typeof e.progress == "number" ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2252
+ /* @__PURE__ */ t.jsx("div", { className: "w-16 h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ t.jsx("div", { className: "h-full bg-primary transition-all", style: { width: `${Math.min(100, e.progress)}%` } }) }),
2253
+ /* @__PURE__ */ t.jsxs("span", { className: "text-xs text-muted-foreground", children: [
2254
+ e.progress,
2255
+ "%"
2256
+ ] })
2257
+ ] }) : /* @__PURE__ */ t.jsx("span", { className: "text-xs text-muted-foreground", children: "-" }) }),
2258
+ /* @__PURE__ */ t.jsx(K, { onClick: (f) => f.stopPropagation(), children: /* @__PURE__ */ t.jsxs(Lt, { children: [
2259
+ /* @__PURE__ */ t.jsx(Qt, { asChild: !0, children: /* @__PURE__ */ t.jsx(Z, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ t.jsx(en, { className: "h-4 w-4" }) }) }),
2260
+ /* @__PURE__ */ t.jsxs(Jt, { align: "end", children: [
2261
+ e.failedReason && /* @__PURE__ */ t.jsxs(ue, { onClick: c, children: [
2262
+ /* @__PURE__ */ t.jsx(oe, { className: "mr-2 h-4 w-4" }),
2263
+ "Retry"
2264
+ ] }),
2265
+ e.delay && e.delay > 0 && /* @__PURE__ */ t.jsxs(ue, { onClick: m, children: [
2266
+ /* @__PURE__ */ t.jsx(Yt, { className: "mr-2 h-4 w-4" }),
2267
+ "Promote"
2268
+ ] }),
2269
+ /* @__PURE__ */ t.jsxs(ue, { onClick: d, className: "text-destructive", children: [
2270
+ /* @__PURE__ */ t.jsx(fe, { className: "mr-2 h-4 w-4" }),
2271
+ "Remove"
2272
+ ] })
2273
+ ] })
2274
+ ] }) })
2275
+ ]
2276
+ }
2277
+ );
2278
+ });
2279
+ nn.displayName = "JobRow";
2280
+ const sn = Y(() => {
2281
+ const e = M((r) => r.jobs), n = M((r) => r.selectedQueue), s = M((r) => r.selectedJob), a = M((r) => r.setSelectedJob), o = M((r) => r.setJobDetailOpen), i = C(
2282
+ (r) => {
2283
+ a(r), o(!0);
2284
+ },
2285
+ [a, o]
2286
+ );
2287
+ return n ? e.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "No jobs in this status" }) : /* @__PURE__ */ t.jsxs(Tt, { children: [
2288
+ /* @__PURE__ */ t.jsx(Mt, { className: "sticky top-0 bg-background/95 backdrop-blur-sm", children: /* @__PURE__ */ t.jsxs(Ne, { children: [
2289
+ /* @__PURE__ */ t.jsx(B, { className: "w-[200px]", children: "Job ID" }),
2290
+ /* @__PURE__ */ t.jsx(B, { children: "Name" }),
2291
+ /* @__PURE__ */ t.jsx(B, { className: "w-[150px]", children: "Created" }),
2292
+ /* @__PURE__ */ t.jsx(B, { className: "w-[80px]", children: "Attempts" }),
2293
+ /* @__PURE__ */ t.jsx(B, { className: "w-[140px]", children: "Progress" }),
2294
+ /* @__PURE__ */ t.jsx(B, { className: "w-[60px]", children: "Actions" })
2295
+ ] }) }),
2296
+ /* @__PURE__ */ t.jsx(Ot, { children: e.map((r) => /* @__PURE__ */ t.jsx(
2297
+ nn,
2298
+ {
2299
+ job: r,
2300
+ queueName: n.name,
2301
+ onSelect: () => i(r),
2302
+ isSelected: s?.id === r.id
2303
+ },
2304
+ r.id
2305
+ )) })
2306
+ ] }) : /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "Select a queue to view jobs" });
2307
+ });
2308
+ sn.displayName = "JobsTable";
2309
+ const Vs = [
2310
+ { value: "waiting", label: "Waiting" },
2311
+ { value: "active", label: "Active" },
2312
+ { value: "completed", label: "Completed" },
2313
+ { value: "failed", label: "Failed" },
2314
+ { value: "delayed", label: "Delayed" }
2315
+ ], an = Y(() => {
2316
+ const e = M((j) => j.selectedQueue), n = M((j) => j.selectedStatus), s = M((j) => j.setSelectedStatus), { pauseQueue: a, resumeQueue: o, cleanQueue: i, drainQueue: r, fetchQueues: c } = He(), { fetchJobs: d } = Ee(), m = C(async () => {
2317
+ e && await a(e.name);
2318
+ }, [e, a]), f = C(async () => {
2319
+ e && await o(e.name);
2320
+ }, [e, o]), x = C(async () => {
2321
+ e && await i(e.name, "completed", 0, 1e3);
2322
+ }, [e, i]), u = C(async () => {
2323
+ e && await i(e.name, "failed", 0, 1e3);
2324
+ }, [e, i]), h = C(async () => {
2325
+ e && await r(e.name);
2326
+ }, [e, r]), v = C(async () => {
2327
+ e && (await c(), await d(e.name, n));
2328
+ }, [e, n, c, d]);
2329
+ return e ? /* @__PURE__ */ t.jsx(Rt, { children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col h-full", children: [
2330
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between p-3 border-b border-border", children: [
2331
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3", children: [
2332
+ /* @__PURE__ */ t.jsx("h2", { className: "font-semibold text-lg", children: e.displayName }),
2333
+ e.isPaused && /* @__PURE__ */ t.jsx("span", { className: "px-2 py-0.5 text-xs rounded bg-yellow-500/20 text-yellow-600", children: "Paused" })
2334
+ ] }),
2335
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2336
+ /* @__PURE__ */ t.jsxs(ee, { children: [
2337
+ /* @__PURE__ */ t.jsx(te, { asChild: !0, children: /* @__PURE__ */ t.jsx(Z, { variant: "ghost", size: "icon", onClick: v, children: /* @__PURE__ */ t.jsx(oe, { className: "h-4 w-4" }) }) }),
2338
+ /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx("p", { children: "Refresh queue stats and jobs list" }) })
2339
+ ] }),
2340
+ e.isPaused ? /* @__PURE__ */ t.jsxs(ee, { children: [
2341
+ /* @__PURE__ */ t.jsx(te, { asChild: !0, children: /* @__PURE__ */ t.jsxs(Z, { variant: "ghost", size: "sm", onClick: f, children: [
2342
+ /* @__PURE__ */ t.jsx(Hs, { className: "mr-2 h-4 w-4" }),
2343
+ "Resume"
2344
+ ] }) }),
2345
+ /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx("p", { children: "Resume processing jobs in this queue" }) })
2346
+ ] }) : /* @__PURE__ */ t.jsxs(ee, { children: [
2347
+ /* @__PURE__ */ t.jsx(te, { asChild: !0, children: /* @__PURE__ */ t.jsxs(Z, { variant: "ghost", size: "sm", onClick: m, children: [
2348
+ /* @__PURE__ */ t.jsx(tn, { className: "mr-2 h-4 w-4" }),
2349
+ "Pause"
2350
+ ] }) }),
2351
+ /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx("p", { children: "Stop workers from picking up new jobs" }) })
2352
+ ] }),
2353
+ /* @__PURE__ */ t.jsxs(ee, { children: [
2354
+ /* @__PURE__ */ t.jsx(te, { asChild: !0, children: /* @__PURE__ */ t.jsxs(Lt, { children: [
2355
+ /* @__PURE__ */ t.jsx(Qt, { asChild: !0, children: /* @__PURE__ */ t.jsx(Z, { variant: "ghost", size: "icon", children: /* @__PURE__ */ t.jsx(en, { className: "h-4 w-4" }) }) }),
2356
+ /* @__PURE__ */ t.jsxs(Jt, { align: "end", children: [
2357
+ /* @__PURE__ */ t.jsxs(ue, { onClick: x, children: [
2358
+ /* @__PURE__ */ t.jsx(fe, { className: "mr-2 h-4 w-4" }),
2359
+ "Clean Completed"
2360
+ ] }),
2361
+ /* @__PURE__ */ t.jsxs(ue, { onClick: u, children: [
2362
+ /* @__PURE__ */ t.jsx(fe, { className: "mr-2 h-4 w-4" }),
2363
+ "Clean Failed"
2364
+ ] }),
2365
+ /* @__PURE__ */ t.jsx(dn, {}),
2366
+ /* @__PURE__ */ t.jsxs(ue, { onClick: h, className: "text-destructive", children: [
2367
+ /* @__PURE__ */ t.jsx(fe, { className: "mr-2 h-4 w-4" }),
2368
+ "Drain Queue"
2369
+ ] })
2370
+ ] })
2371
+ ] }) }),
2372
+ /* @__PURE__ */ t.jsx(ne, { children: /* @__PURE__ */ t.jsx("p", { children: "More actions" }) })
2373
+ ] })
2374
+ ] })
2375
+ ] }),
2376
+ /* @__PURE__ */ t.jsx("div", { className: "p-3 border-b border-border", children: /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-6 gap-4 text-center", children: [
2377
+ /* @__PURE__ */ t.jsxs("div", { children: [
2378
+ /* @__PURE__ */ t.jsx("div", { className: "text-2xl font-bold text-blue-500", children: e.stats.waiting }),
2379
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs text-muted-foreground", children: "Waiting" })
2380
+ ] }),
2381
+ /* @__PURE__ */ t.jsxs("div", { children: [
2382
+ /* @__PURE__ */ t.jsx("div", { className: "text-2xl font-bold text-yellow-500", children: e.stats.active }),
2383
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs text-muted-foreground", children: "Active" })
2384
+ ] }),
2385
+ /* @__PURE__ */ t.jsxs("div", { children: [
2386
+ /* @__PURE__ */ t.jsx("div", { className: "text-2xl font-bold text-green-500", children: e.stats.completed }),
2387
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs text-muted-foreground", children: "Completed" })
2388
+ ] }),
2389
+ /* @__PURE__ */ t.jsxs("div", { children: [
2390
+ /* @__PURE__ */ t.jsx("div", { className: "text-2xl font-bold text-destructive", children: e.stats.failed }),
2391
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs text-muted-foreground", children: "Failed" })
2392
+ ] }),
2393
+ /* @__PURE__ */ t.jsxs("div", { children: [
2394
+ /* @__PURE__ */ t.jsx("div", { className: "text-2xl font-bold text-purple-500", children: e.stats.delayed }),
2395
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs text-muted-foreground", children: "Delayed" })
2396
+ ] }),
2397
+ /* @__PURE__ */ t.jsxs("div", { children: [
2398
+ /* @__PURE__ */ t.jsx("div", { className: "text-2xl font-bold text-muted-foreground", children: e.stats.paused }),
2399
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs text-muted-foreground", children: "Paused" })
2400
+ ] })
2401
+ ] }) }),
2402
+ /* @__PURE__ */ t.jsxs(
2403
+ un,
2404
+ {
2405
+ value: n,
2406
+ onValueChange: (j) => s(j),
2407
+ className: "flex-1 flex flex-col",
2408
+ children: [
2409
+ /* @__PURE__ */ t.jsx("div", { className: "px-3 pt-2 border-b border-border", children: /* @__PURE__ */ t.jsx(fn, { children: Vs.map((j) => /* @__PURE__ */ t.jsxs(
2410
+ mn,
2411
+ {
2412
+ value: j.value,
2413
+ className: re(
2414
+ "relative",
2415
+ n === j.value && "after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary"
2416
+ ),
2417
+ children: [
2418
+ j.label,
2419
+ e.stats[j.value] > 0 && /* @__PURE__ */ t.jsx("span", { className: "ml-1.5 px-1.5 py-0.5 text-[10px] rounded-full bg-muted", children: e.stats[j.value] })
2420
+ ]
2421
+ },
2422
+ j.value
2423
+ )) }) }),
2424
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ t.jsx(sn, {}) })
2425
+ ]
2426
+ }
2427
+ )
2428
+ ] }) }) : /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "Select a queue from the list to view details" });
2429
+ });
2430
+ an.displayName = "QueueDetail";
2431
+ /**
2432
+ * @license lucide-react v0.545.0 - ISC
2433
+ *
2434
+ * This source code is licensed under the ISC license.
2435
+ * See the LICENSE file in the root directory of this source tree.
2436
+ */
2437
+ const Ys = [
2438
+ [
2439
+ "path",
2440
+ {
2441
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
2442
+ key: "wmoenq"
2443
+ }
2444
+ ],
2445
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
2446
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
2447
+ ], Zs = G("triangle-alert", Ys);
2448
+ /**
2449
+ * @license lucide-react v0.545.0 - ISC
2450
+ *
2451
+ * This source code is licensed under the ISC license.
2452
+ * See the LICENSE file in the root directory of this source tree.
2453
+ */
2454
+ const Xs = [
2455
+ [
2456
+ "path",
2457
+ {
2458
+ d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
2459
+ key: "zw3jo"
2460
+ }
2461
+ ],
2462
+ [
2463
+ "path",
2464
+ {
2465
+ d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
2466
+ key: "1wduqc"
2467
+ }
2468
+ ],
2469
+ [
2470
+ "path",
2471
+ {
2472
+ d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
2473
+ key: "kqbvx6"
2474
+ }
2475
+ ]
2476
+ ], Bs = G("layers", Xs);
2477
+ /**
2478
+ * @license lucide-react v0.545.0 - ISC
2479
+ *
2480
+ * This source code is licensed under the ISC license.
2481
+ * See the LICENSE file in the root directory of this source tree.
2482
+ */
2483
+ const Ks = [
2484
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
2485
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
2486
+ ], Gs = G("search", Ks);
2487
+ /**
2488
+ * @license lucide-react v0.545.0 - ISC
2489
+ *
2490
+ * This source code is licensed under the ISC license.
2491
+ * See the LICENSE file in the root directory of this source tree.
2492
+ */
2493
+ const ea = [
2494
+ ["path", { d: "m12.5 17-.5-1-.5 1h1z", key: "3me087" }],
2495
+ [
2496
+ "path",
2497
+ {
2498
+ d: "M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",
2499
+ key: "1o5pge"
2500
+ }
2501
+ ],
2502
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
2503
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }]
2504
+ ], ta = G("skull", ea), ze = Y(({ queue: e, isSelected: n, onClick: s }) => {
2505
+ const a = e.stats.waiting + e.stats.active + e.stats.delayed + e.stats.prioritized, o = e.stats.failed > 0;
2506
+ return /* @__PURE__ */ t.jsxs(
2507
+ "button",
2508
+ {
2509
+ type: "button",
2510
+ onClick: s,
2511
+ className: re(
2512
+ "w-full text-left p-3 transition-colors border-b border-border",
2513
+ n ? "bg-muted-foreground/10" : "hover:bg-muted/70"
2514
+ ),
2515
+ children: [
2516
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
2517
+ e.isDLQ ? /* @__PURE__ */ t.jsx(ta, { className: "w-4 h-4 text-destructive" }) : /* @__PURE__ */ t.jsx(Bs, { className: "w-4 h-4 text-muted-foreground" }),
2518
+ /* @__PURE__ */ t.jsx("span", { className: "font-semibold text-sm truncate flex-1", children: e.displayName }),
2519
+ e.isPaused && /* @__PURE__ */ t.jsx(tn, { className: "w-3 h-3 text-yellow-500" }),
2520
+ o && /* @__PURE__ */ t.jsx(Zs, { className: "w-3 h-3 text-destructive" })
2521
+ ] }),
2522
+ /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-4 gap-1 text-xs", children: [
2523
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
2524
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Wait" }),
2525
+ /* @__PURE__ */ t.jsx("span", { className: re("font-mono", e.stats.waiting > 0 && "text-blue-500"), children: e.stats.waiting })
2526
+ ] }),
2527
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
2528
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Active" }),
2529
+ /* @__PURE__ */ t.jsx("span", { className: re("font-mono", e.stats.active > 0 && "text-yellow-500"), children: e.stats.active })
2530
+ ] }),
2531
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
2532
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Done" }),
2533
+ /* @__PURE__ */ t.jsx("span", { className: re("font-mono", e.stats.completed > 0 && "text-green-500"), children: e.stats.completed })
2534
+ ] }),
2535
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
2536
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Failed" }),
2537
+ /* @__PURE__ */ t.jsx("span", { className: re("font-mono", e.stats.failed > 0 && "text-destructive"), children: e.stats.failed })
2538
+ ] })
2539
+ ] }),
2540
+ (e.stats.delayed > 0 || a > 0) && /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 mt-1 text-xs text-muted-foreground", children: [
2541
+ e.stats.delayed > 0 && /* @__PURE__ */ t.jsxs("span", { children: [
2542
+ e.stats.delayed,
2543
+ " delayed"
2544
+ ] }),
2545
+ a > 0 && /* @__PURE__ */ t.jsxs("span", { className: "ml-auto", children: [
2546
+ a,
2547
+ " pending"
2548
+ ] })
2549
+ ] })
2550
+ ]
2551
+ }
2552
+ );
2553
+ });
2554
+ ze.displayName = "QueueItem";
2555
+ const rn = Y(() => {
2556
+ const e = M((d) => d.queues), n = M((d) => d.selectedQueue), s = M((d) => d.setSelectedQueue), a = M((d) => d.searchQuery), o = M((d) => d.setSearchQuery), i = ye(() => {
2557
+ if (!a) return e;
2558
+ const d = a.toLowerCase();
2559
+ return e.filter((m) => m.name.toLowerCase().includes(d) || m.displayName.toLowerCase().includes(d));
2560
+ }, [e, a]), r = ye(() => i.filter((d) => !d.isDLQ), [i]), c = ye(() => i.filter((d) => d.isDLQ), [i]);
2561
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col h-full", children: [
2562
+ /* @__PURE__ */ t.jsx("div", { className: "p-2 border-b border-border", children: /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
2563
+ /* @__PURE__ */ t.jsx(
2564
+ hn,
2565
+ {
2566
+ variant: "shade",
2567
+ value: a,
2568
+ onChange: (d) => o(d.target.value),
2569
+ className: "px-9 font-medium text-sm",
2570
+ placeholder: "Search queues..."
2571
+ }
2572
+ ),
2573
+ /* @__PURE__ */ t.jsx(Gs, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
2574
+ a && /* @__PURE__ */ t.jsx(
2575
+ Ve,
2576
+ {
2577
+ 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",
2578
+ onClick: () => o("")
2579
+ }
2580
+ )
2581
+ ] }) }),
2582
+ /* @__PURE__ */ t.jsxs("div", { className: "flex-1 overflow-auto", children: [
2583
+ r.length > 0 && /* @__PURE__ */ t.jsxs("div", { children: [
2584
+ /* @__PURE__ */ t.jsxs("div", { className: "px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider bg-muted/30", children: [
2585
+ "Queues (",
2586
+ r.length,
2587
+ ")"
2588
+ ] }),
2589
+ r.map((d) => /* @__PURE__ */ t.jsx(
2590
+ ze,
2591
+ {
2592
+ queue: d,
2593
+ isSelected: n?.name === d.name,
2594
+ onClick: () => s(d)
2595
+ },
2596
+ d.name
2597
+ ))
2598
+ ] }),
2599
+ c.length > 0 && /* @__PURE__ */ t.jsxs("div", { children: [
2600
+ /* @__PURE__ */ t.jsxs("div", { className: "px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider bg-destructive/10", children: [
2601
+ "Dead Letter Queues (",
2602
+ c.length,
2603
+ ")"
2604
+ ] }),
2605
+ c.map((d) => /* @__PURE__ */ t.jsx(
2606
+ ze,
2607
+ {
2608
+ queue: d,
2609
+ isSelected: n?.name === d.name,
2610
+ onClick: () => s(d)
2611
+ },
2612
+ d.name
2613
+ ))
2614
+ ] }),
2615
+ i.length === 0 && /* @__PURE__ */ t.jsx("div", { className: "p-4 text-center text-muted-foreground text-sm", children: a ? "No queues match your search" : "No queues found" })
2616
+ ] })
2617
+ ] });
2618
+ });
2619
+ rn.displayName = "QueueList";
2620
+ const na = Y(() => {
2621
+ const e = M((a) => a.selectedQueue), n = M((a) => a.updateSelectedQueueStats), { queues: s } = He();
2622
+ return ie(() => {
2623
+ if (e) {
2624
+ const a = s.find((o) => o.name === e.name);
2625
+ a && n(a);
2626
+ }
2627
+ }, [s, e, n]), /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[300px_1fr] h-full overflow-hidden", children: [
2628
+ /* @__PURE__ */ t.jsx("div", { className: "border-r border-border overflow-hidden", children: /* @__PURE__ */ t.jsx(rn, {}) }),
2629
+ /* @__PURE__ */ t.jsx("div", { className: "overflow-hidden", children: e?.isDLQ ? /* @__PURE__ */ t.jsx(Vt, {}) : /* @__PURE__ */ t.jsx(an, {}) }),
2630
+ /* @__PURE__ */ t.jsx(Gt, {})
2631
+ ] });
2632
+ });
2633
+ na.displayName = "QueuesPage";
2634
+ export {
2635
+ na as QueuesPage
2636
+ };