@pinia/colada-devtools 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/index.js +261 -267
  2. package/dist/index.js.map +1 -1
  3. package/dist-panel/_queryId_-13o6pDV6.js +708 -0
  4. package/dist-panel/_queryId_-13o6pDV6.js.map +1 -0
  5. package/dist-panel/{index-D50XbbDk.js → index-BgTq8RHl.js} +906 -901
  6. package/dist-panel/index-BgTq8RHl.js.map +1 -0
  7. package/dist-panel/{index-B6c9Loor.js → index-DcKBZRe1.js} +3 -3
  8. package/dist-panel/{index-B6c9Loor.js.map → index-DcKBZRe1.js.map} +1 -1
  9. package/dist-panel/{index-DsbwSvSM.js → index-DgZ0YYsh.js} +2 -2
  10. package/dist-panel/{index-DsbwSvSM.js.map → index-DgZ0YYsh.js.map} +1 -1
  11. package/dist-panel/index.js +1 -1
  12. package/dist-panel/{loader-BxXz3POc.js → loader-Dx4_68Bp.js} +2 -2
  13. package/dist-panel/loader-Dx4_68Bp.js.map +1 -0
  14. package/dist-panel/{mouse-pointer-click--GgfMFjw.js → mouse-pointer-click-BeSJo9Pm.js} +2 -2
  15. package/dist-panel/mouse-pointer-click-BeSJo9Pm.js.map +1 -0
  16. package/dist-panel/{mutations-CNQGJZrN.js → mutations-4_Hc86Rz.js} +2 -2
  17. package/dist-panel/{mutations-CNQGJZrN.js.map → mutations-4_Hc86Rz.js.map} +1 -1
  18. package/dist-panel/queries-BWAwqUDO.js +795 -0
  19. package/dist-panel/{queries-CSBvC4-S.js.map → queries-BWAwqUDO.js.map} +1 -1
  20. package/dist-panel/{settings-Cl-hr-ie.js → settings-CAkjqhkP.js} +2 -2
  21. package/dist-panel/{settings-Cl-hr-ie.js.map → settings-CAkjqhkP.js.map} +1 -1
  22. package/dist-shared/index.d.ts +27 -0
  23. package/dist-shared/index.js +295 -65
  24. package/dist-shared/index.js.map +1 -1
  25. package/package.json +8 -8
  26. package/dist-panel/_queryId_-Bilvrtoo.js +0 -621
  27. package/dist-panel/_queryId_-Bilvrtoo.js.map +0 -1
  28. package/dist-panel/index-D50XbbDk.js.map +0 -1
  29. package/dist-panel/loader-BxXz3POc.js.map +0 -1
  30. package/dist-panel/mouse-pointer-click--GgfMFjw.js.map +0 -1
  31. package/dist-panel/queries-CSBvC4-S.js +0 -813
@@ -0,0 +1,708 @@
1
+ import { _ as W } from "./mouse-pointer-click-BeSJo9Pm.js";
2
+ import { isPlainObject as H, getValueTypeClass as D, formatValue as L } from "@pinia/colada-devtools/shared";
3
+ import { m as _, c as r, o as n, a as e, d as z, x as Y, b as j, r as G, n as C, H as X, h as M, g as w, t as u, i as a, F as q, j as V, Q as K, l as Z, p as ee, R as te, C as T, P as f, S as oe, _ as se, M as ne, T as le, U as re, O, y as ie, k as d, w as p, V as E, W as ae, X as I, Y as de } from "./index-BgTq8RHl.js";
4
+ import { _ as ue, a as ce } from "./loader-Dx4_68Bp.js";
5
+ const pe = {
6
+ viewBox: "0 0 24 24",
7
+ width: "1.2em",
8
+ height: "1.2em"
9
+ };
10
+ function me(l, s) {
11
+ return n(), r("svg", pe, s[0] || (s[0] = [
12
+ e("path", {
13
+ fill: "none",
14
+ stroke: "currentColor",
15
+ "stroke-linecap": "round",
16
+ "stroke-linejoin": "round",
17
+ "stroke-width": "2",
18
+ d: "m9 18l6-6l-6-6"
19
+ }, null, -1)
20
+ ]));
21
+ }
22
+ const ve = _({ name: "lucide-chevron-right", render: me }), fe = ["title"], he = /* @__PURE__ */ z({
23
+ __name: "JsonItem",
24
+ props: {
25
+ itemKey: {},
26
+ value: { type: [String, Number, Boolean, null, Array, Object, Map, Set] },
27
+ depth: {}
28
+ },
29
+ setup(l) {
30
+ const s = l, m = Y(!1), t = j(() => {
31
+ const { value: i } = s;
32
+ return Array.isArray(i) && i.length > 0 || H(i) && Object.keys(i).length > 0 || i instanceof Map && i.size > 0 || i instanceof Set && i.size > 0;
33
+ }), y = j(() => {
34
+ const { value: i } = s;
35
+ return Array.isArray(i) ? i.map((h, v) => [v, h]) : H(i) ? Object.entries(i) : i instanceof Map ? i.entries() : i instanceof Set ? Array.from(i).map((h, v) => [v, h]) : [];
36
+ });
37
+ function b() {
38
+ t.value && (m.value = !m.value);
39
+ }
40
+ return (i, h) => {
41
+ const v = ve, B = G("JsonItem", !0);
42
+ return n(), r("div", {
43
+ style: X({ paddingLeft: `${i.depth * 0.35}em` }),
44
+ class: C(["ring-(--ui-bg-muted)", {
45
+ "hover:ring": t.value,
46
+ "rounded-tl": i.depth > 0
47
+ }])
48
+ }, [
49
+ e("div", {
50
+ class: C(["flex items-center gap-2 py-0.5 bg-transparent hover:bg-(--ui-bg-muted) duration-200 transition-colors", i.depth > 0 && "rounded-l"])
51
+ }, [
52
+ t.value ? (n(), w(v, {
53
+ key: 0,
54
+ class: C(["size-3 text-(--ui-text-dimmed) transition-transform duration-200 cursor-pointer", { "rotate-90": m.value }]),
55
+ onClick: b
56
+ }, null, 8, ["class"])) : M("", !0),
57
+ e("span", {
58
+ class: C(["text-(--devtools-syntax-gray)", !t.value && "ml-5"])
59
+ }, u(i.itemKey) + ": ", 3),
60
+ e("span", {
61
+ class: C([a(D)(i.value), t.value && "cursor-pointer"]),
62
+ title: t.value ? "Click to expand" : void 0,
63
+ onClick: b
64
+ }, u(a(L)(i.value)), 11, fe)
65
+ ], 2),
66
+ t.value && m.value ? (n(!0), r(q, { key: 0 }, V(y.value, ([S, x]) => (n(), w(B, {
67
+ key: S,
68
+ "item-key": String(S),
69
+ value: x,
70
+ depth: i.depth + 1
71
+ }, null, 8, ["item-key", "value", "depth"]))), 128)) : M("", !0)
72
+ ], 6);
73
+ };
74
+ }
75
+ });
76
+ function _e(l) {
77
+ return !!l && (Array.isArray(l) || H(l) || l instanceof Map || l instanceof Set);
78
+ }
79
+ const ge = /* @__PURE__ */ z({
80
+ __name: "JsonViewer",
81
+ props: {
82
+ data: {}
83
+ },
84
+ setup(l) {
85
+ return (s, m) => _e(s.data) ? (n(!0), r(q, { key: 0 }, V(Object.entries(s.data), ([t, y]) => (n(), w(he, {
86
+ key: t,
87
+ "item-key": t,
88
+ value: y,
89
+ depth: 0
90
+ }, null, 8, ["item-key", "value"]))), 128)) : (n(), r("span", {
91
+ key: 1,
92
+ class: C(a(D)(s.data))
93
+ }, u(a(L)(s.data)), 3));
94
+ }
95
+ }), ye = {
96
+ viewBox: "0 0 24 24",
97
+ width: "1.2em",
98
+ height: "1.2em"
99
+ };
100
+ function ke(l, s) {
101
+ return n(), r("svg", ye, s[0] || (s[0] = [
102
+ e("path", {
103
+ fill: "none",
104
+ stroke: "currentColor",
105
+ "stroke-linecap": "round",
106
+ "stroke-linejoin": "round",
107
+ "stroke-width": "2",
108
+ d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
109
+ }, null, -1)
110
+ ]));
111
+ }
112
+ const be = _({ name: "lucide-trash", render: ke }), we = {
113
+ viewBox: "0 0 24 24",
114
+ width: "1.2em",
115
+ height: "1.2em"
116
+ };
117
+ function xe(l, s) {
118
+ return n(), r("svg", we, s[0] || (s[0] = [
119
+ e("g", {
120
+ fill: "none",
121
+ stroke: "currentColor",
122
+ "stroke-linecap": "round",
123
+ "stroke-linejoin": "round",
124
+ "stroke-width": "2"
125
+ }, [
126
+ e("path", { d: "M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8" }),
127
+ e("path", { d: "M3 3v5h5" })
128
+ ], -1)
129
+ ]));
130
+ }
131
+ const $e = _({ name: "lucide-rotate-ccw", render: xe }), Ce = {
132
+ viewBox: "0 0 24 24",
133
+ width: "1.2em",
134
+ height: "1.2em"
135
+ };
136
+ function Me(l, s) {
137
+ return n(), r("svg", Ce, s[0] || (s[0] = [
138
+ e("g", {
139
+ fill: "none",
140
+ stroke: "currentColor",
141
+ "stroke-linecap": "round",
142
+ "stroke-linejoin": "round",
143
+ "stroke-width": "2"
144
+ }, [
145
+ e("path", { d: "M10 2h4m-2 12v-4m-8 3a8 8 0 0 1 8-7a8 8 0 1 1-5.3 14L4 17.6" }),
146
+ e("path", { d: "M9 17H4v5" })
147
+ ], -1)
148
+ ]));
149
+ }
150
+ const Se = _({ name: "lucide-timer-reset", render: Me }), qe = {
151
+ viewBox: "0 0 24 24",
152
+ width: "1.2em",
153
+ height: "1.2em"
154
+ };
155
+ function Be(l, s) {
156
+ return n(), r("svg", qe, s[0] || (s[0] = [
157
+ e("g", {
158
+ fill: "none",
159
+ stroke: "currentColor",
160
+ "stroke-linecap": "round",
161
+ "stroke-linejoin": "round",
162
+ "stroke-width": "2"
163
+ }, [
164
+ e("path", { d: "M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8" }),
165
+ e("path", { d: "M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16" }),
166
+ e("path", { d: "M8 16H3v5" })
167
+ ], -1)
168
+ ]));
169
+ }
170
+ const je = _({ name: "lucide-refresh-cw", render: Be }), ze = { class: "collapse collapse-arrow" }, Te = { class: "collapse-title px-2 py-0.5 bg-neutral-200 dark:bg-neutral-800 theme-neutral" }, Ie = { class: "font-semibold text-sm flex gap-x-1 items-center" }, He = /* @__PURE__ */ z({
171
+ __name: "UCollapse.ce",
172
+ props: /* @__PURE__ */ K({
173
+ title: { type: String },
174
+ icon: { type: null },
175
+ noPadding: { type: Boolean }
176
+ }, {
177
+ open: { type: Boolean, default: !0 },
178
+ openModifiers: {}
179
+ }),
180
+ emits: ["update:open"],
181
+ setup(l) {
182
+ const s = Z(l, "open");
183
+ function m(t) {
184
+ if (t.target instanceof HTMLElement) {
185
+ const y = {
186
+ block: "nearest",
187
+ inline: "nearest",
188
+ behavior: "smooth"
189
+ };
190
+ t.target.scrollIntoView(y);
191
+ }
192
+ }
193
+ return (t, y) => (n(), r("div", ze, [
194
+ ee(e("input", {
195
+ "onUpdate:modelValue": y[0] || (y[0] = (b) => s.value = b),
196
+ type: "checkbox"
197
+ }, null, 512), [
198
+ [te, s.value]
199
+ ]),
200
+ e("div", Te, [
201
+ T(t.$slots, "title", {
202
+ open: s.value,
203
+ title: t.title
204
+ }, () => [
205
+ e("h3", Ie, [
206
+ T(t.$slots, "icon", {}, () => [
207
+ t.icon ? (n(), w(oe(t.icon), {
208
+ key: 0,
209
+ class: "size-4"
210
+ })) : M("", !0)
211
+ ], !0),
212
+ f(" " + u(t.title ?? "Group"), 1)
213
+ ])
214
+ ], !0)
215
+ ]),
216
+ e("div", {
217
+ class: C([!t.noPadding && "px-2", "collapse-content text-sm overflow-hidden"]),
218
+ onTransitionend: m
219
+ }, [
220
+ T(t.$slots, "default", { open: s.value }, void 0, !0)
221
+ ], 34)
222
+ ]));
223
+ }
224
+ }), Ve = '.collapse[data-v-1b4f74d5]:not(td,tr,colgroup){visibility:visible}.collapse[data-v-1b4f74d5]{position:relative;display:grid;overflow:hidden;width:100%;grid-template-rows:max-content 0fr;transition:grid-template-rows .2s;isolation:isolate}.collapse>input[data-v-1b4f74d5]:is([type=checkbox],[type=radio]){grid-column-start:1;grid-row-start:1;appearance:none;opacity:0}.collapse[data-v-1b4f74d5]:is([open],:focus),.collapse[data-v-1b4f74d5]:has(>input:is([type=checkbox],[type=radio]):checked){grid-template-rows:max-content 1fr}.collapse:is([open],:focus)>.collapse-content[data-v-1b4f74d5],.collapse[data-v-1b4f74d5]:not(.collapse-close)>:where(input:is([type=checkbox],[type=radio]):checked~.collapse-content){visibility:visible;min-height:fit-content}.collapse[data-v-1b4f74d5]:focus-visible,.collapse[data-v-1b4f74d5]:has(>input:is([type=checkbox],[type=radio]):focus-visible){outline-color:var(--ui-text);outline-style:solid;outline-width:2px;outline-offset:2px}.collapse:not(.collapse-close)>input[type=checkbox][data-v-1b4f74d5],.collapse:not(.collapse-close)>input[type=radio][data-v-1b4f74d5]:not(:checked),.collapse:not(.collapse-close)>.collapse-title[data-v-1b4f74d5]{cursor:pointer}.collapse:focus:not(.collapse-close,.collapse[open])>.collapse-title[data-v-1b4f74d5]{cursor:unset}.collapse:is([open]).collapse-arrow>.collapse-title[data-v-1b4f74d5]:after{transform:translateY(-50%) rotate(225deg)}.collapse.collapse-arrow:focus>.collapse-title[data-v-1b4f74d5]:after{transform:translateY(-50%) rotate(225deg)}.collapse.collapse-arrow>input:is([type=checkbox],[type=radio]):checked~.collapse-title[data-v-1b4f74d5]:after{transform:translateY(-50%) rotate(225deg)}.collapse>input[data-v-1b4f74d5]:is([type=checkbox],[type=radio]){z-index:1;width:100%}.collapse-title[data-v-1b4f74d5],.collapse-content[data-v-1b4f74d5]{grid-column-start:1;grid-row-start:1}.collapse-content[data-v-1b4f74d5]{visibility:hidden;grid-column-start:1;grid-row-start:2;min-height:0;cursor:unset;transition:visibility .2s}.collapse-arrow>.collapse-title[data-v-1b4f74d5]:after{position:absolute;display:block;height:.5rem;width:.5rem;transform:translateY(-100%) rotate(45deg);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;top:50%;right:.8em;inset-inline-end:.75rem;content:"";transform-origin:75% 75%;box-shadow:2px 2px;pointer-events:none}.collapse-title[data-v-1b4f74d5]{position:relative;width:100%;transition:background-color .2s ease-out}', Ae = /* @__PURE__ */ se(He, [["styles", [Ve]], ["__scopeId", "data-v-1b4f74d5"]]);
225
+ function Oe(l) {
226
+ if (l < 1e3)
227
+ return `${Math.round(l)} ms`;
228
+ const s = l / 1e3;
229
+ if (l < 1e4)
230
+ return `${s.toFixed(3)} seconds`;
231
+ if (l < 6e4)
232
+ return `${Math.floor(s)} seconds`;
233
+ const m = Math.floor(s / 60);
234
+ return l < 36e5 ? `${m} minute${m > 1 ? "s" : ""}` : `${Math.floor(m / 60)}h${m % 60}m${s % 60}s`;
235
+ }
236
+ const Ee = {
237
+ viewBox: "0 0 24 24",
238
+ width: "1.2em",
239
+ height: "1.2em"
240
+ };
241
+ function De(l, s) {
242
+ return n(), r("svg", Ee, s[0] || (s[0] = [
243
+ e("path", {
244
+ fill: "none",
245
+ stroke: "currentColor",
246
+ "stroke-linecap": "round",
247
+ "stroke-linejoin": "round",
248
+ "stroke-width": "2",
249
+ d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"
250
+ }, null, -1)
251
+ ]));
252
+ }
253
+ const Le = _({ name: "lucide-wrench", render: De }), Re = {
254
+ viewBox: "0 0 24 24",
255
+ width: "1.2em",
256
+ height: "1.2em"
257
+ };
258
+ function Ne(l, s) {
259
+ return n(), r("svg", Re, s[0] || (s[0] = [
260
+ e("g", {
261
+ fill: "none",
262
+ stroke: "currentColor",
263
+ "stroke-linecap": "round",
264
+ "stroke-linejoin": "round",
265
+ "stroke-width": "2"
266
+ }, [
267
+ e("circle", {
268
+ cx: "12",
269
+ cy: "12",
270
+ r: "10"
271
+ }),
272
+ e("path", { d: "M12 16v-4m0-4h.01" })
273
+ ], -1)
274
+ ]));
275
+ }
276
+ const Ue = _({ name: "lucide-info", render: Ne }), Fe = {
277
+ viewBox: "0 0 24 24",
278
+ width: "1.2em",
279
+ height: "1.2em"
280
+ };
281
+ function Je(l, s) {
282
+ return n(), r("svg", Fe, s[0] || (s[0] = [
283
+ e("g", {
284
+ fill: "none",
285
+ stroke: "currentColor",
286
+ "stroke-linecap": "round",
287
+ "stroke-linejoin": "round",
288
+ "stroke-width": "2"
289
+ }, [
290
+ e("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
291
+ e("path", { d: "M14 2v4a2 2 0 0 0 2 2h4M10 9H8m8 4H8m8 4H8" })
292
+ ], -1)
293
+ ]));
294
+ }
295
+ const Pe = _({ name: "lucide-file-text", render: Je }), Qe = {
296
+ viewBox: "0 0 24 24",
297
+ width: "1.2em",
298
+ height: "1.2em"
299
+ };
300
+ function We(l, s) {
301
+ return n(), r("svg", Qe, s[0] || (s[0] = [
302
+ e("g", {
303
+ fill: "none",
304
+ stroke: "currentColor",
305
+ "stroke-linecap": "round",
306
+ "stroke-linejoin": "round",
307
+ "stroke-width": "2"
308
+ }, [
309
+ e("circle", {
310
+ cx: "12",
311
+ cy: "12",
312
+ r: "10"
313
+ }),
314
+ e("path", { d: "m15 9l-6 6m0-6l6 6" })
315
+ ], -1)
316
+ ]));
317
+ }
318
+ const Ye = _({ name: "lucide-circle-x", render: We }), Ge = {
319
+ viewBox: "0 0 24 24",
320
+ width: "1.2em",
321
+ height: "1.2em"
322
+ };
323
+ function Xe(l, s) {
324
+ return n(), r("svg", Ge, s[0] || (s[0] = [
325
+ e("path", {
326
+ fill: "none",
327
+ stroke: "currentColor",
328
+ "stroke-linecap": "round",
329
+ "stroke-linejoin": "round",
330
+ "stroke-width": "2",
331
+ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2a2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1m8 0h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"
332
+ }, null, -1)
333
+ ]));
334
+ }
335
+ const Ke = _({ name: "lucide-braces", render: Xe }), Ze = {
336
+ viewBox: "0 0 24 24",
337
+ width: "1.2em",
338
+ height: "1.2em"
339
+ };
340
+ function et(l, s) {
341
+ return n(), r("svg", Ze, s[0] || (s[0] = [
342
+ e("g", {
343
+ fill: "none",
344
+ stroke: "currentColor",
345
+ "stroke-linecap": "round",
346
+ "stroke-linejoin": "round",
347
+ "stroke-width": "2"
348
+ }, [
349
+ e("path", { d: "M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8" }),
350
+ e("path", { d: "M3 3v5h5m4-1v5l4 2" })
351
+ ], -1)
352
+ ]));
353
+ }
354
+ const tt = _({ name: "lucide-history", render: et }), ot = {
355
+ viewBox: "0 0 24 24",
356
+ width: "1.2em",
357
+ height: "1.2em"
358
+ };
359
+ function st(l, s) {
360
+ return n(), r("svg", ot, s[0] || (s[0] = [
361
+ e("g", {
362
+ fill: "none",
363
+ stroke: "currentColor",
364
+ "stroke-linecap": "round",
365
+ "stroke-linejoin": "round",
366
+ "stroke-width": "2"
367
+ }, [
368
+ e("rect", {
369
+ width: "18",
370
+ height: "18",
371
+ x: "3",
372
+ y: "3",
373
+ rx: "2"
374
+ }),
375
+ e("path", { d: "M16 8.9V7H8l4 5l-4 5h8v-1.9" })
376
+ ], -1)
377
+ ]));
378
+ }
379
+ const nt = _({ name: "lucide-sigma-square", render: st }), lt = { class: "flex flex-col divide-y dark:divide-(--ui-border) divide-(--ui-border-accented)" }, rt = { class: "py-1 text-sm" }, it = { class: "grid grid-cols-[auto_1fr] gap-1" }, at = { class: "rounded bg-neutral-500/20 p-0.5" }, dt = {
380
+ class: "grid grid-cols-[auto_1fr] gap-x-2",
381
+ title: "When was the query entry last updated"
382
+ }, ut = { class: "font-bold" }, ct = {
383
+ key: 0,
384
+ class: "grid grid-cols-[auto_1fr] gap-x-2",
385
+ title: "When was the last time the query was fetched"
386
+ }, pt = { class: "font-bold" }, mt = {
387
+ key: 1,
388
+ class: "grid grid-cols-[auto_1fr] gap-x-2",
389
+ title: "How long did the last query take to fetch"
390
+ }, vt = { class: "font-bold" }, ft = {
391
+ class: "grid grid-cols-[auto_1fr] gap-x-2",
392
+ title: "How many components and effects are using this query"
393
+ }, ht = { class: "font-bold" }, _t = {
394
+ key: 2,
395
+ class: "grid grid-cols-[auto_1fr] gap-x-2",
396
+ title: "When is this query entry garbace collected"
397
+ }, gt = { class: "font-bold" }, yt = { class: "py-2 gap-2 flex flex-wrap items-center justify-items-start" }, kt = { class: "py-1" }, bt = {
398
+ key: 0,
399
+ class: "rounded p-1 overflow-auto max-h-[1200px]"
400
+ }, wt = {
401
+ key: 1,
402
+ class: "text-neutral-500/50"
403
+ }, xt = { class: "py-1" }, $t = { class: "grid grid-cols-[auto_1fr] gap-1" }, Ct = { class: "font-bold" }, Mt = { class: "font-bold" }, St = { class: "font-bold" }, qt = { class: "font-bold" }, Bt = { class: "py-1" }, jt = { class: "rounded p-1 overflow-auto max-h-[1200px]" }, zt = { class: "py-1" }, Tt = {
404
+ key: 0,
405
+ class: "rounded bg-neutral-500/20 p-1 overflow-auto max-h-[1200px]"
406
+ }, It = { key: 1 }, Ht = {
407
+ key: 1,
408
+ class: "py-6 mx-auto"
409
+ }, Vt = { class: "flex flex-col text-center items-center gap-2 text-lg px-2" }, Lt = /* @__PURE__ */ z({
410
+ __name: "[queryId]",
411
+ setup(l) {
412
+ const s = ae(), m = ne(), t = j(() => m.value.find((g) => g.keyHash === s.params.queryId) ?? null), y = j(() => t.value?.devtools.history.map((g) => {
413
+ let o;
414
+ try {
415
+ o = JSON.stringify(g, null, 2);
416
+ } catch (k) {
417
+ o = `Error serializing entry: ${String(k)}`;
418
+ }
419
+ return {
420
+ ...g,
421
+ data: o
422
+ };
423
+ }) ?? []), b = {
424
+ showSecond: !0,
425
+ rounding: "floor",
426
+ max: 1e3 * 60 * 5
427
+ // 5 minutes
428
+ }, i = le(() => t.value?.devtools.updatedAt ?? 0, {
429
+ ...b,
430
+ updateInterval: 3e3
431
+ }), h = re(), v = O("pc:query:details:data:open", !1, {});
432
+ let B = v.value, S = null;
433
+ const x = O("pc:query:details:error:open", !1, {});
434
+ return ie(
435
+ () => t.value?.state,
436
+ (g) => {
437
+ !g || S === g.status || (S = g.status, g.status === "error" ? (x.value = !0, B = v.value, v.value = !1) : g.status === "success" && (v.value = B, x.value = !1));
438
+ }
439
+ ), (g, o) => {
440
+ const k = Ae, R = je, $ = de, N = Se, A = ue, U = ce, F = $e, J = be, P = ge, Q = W;
441
+ return n(), r("div", lt, [
442
+ t.value ? (n(), r(q, { key: 0 }, [
443
+ d(k, {
444
+ title: "Details",
445
+ icon: a(Ue)
446
+ }, {
447
+ default: p(() => [
448
+ e("div", rt, [
449
+ e("p", it, [
450
+ o[9] || (o[9] = e("span", null, "key:", -1)),
451
+ e("span", null, [
452
+ e("code", at, u(t.value.key), 1)
453
+ ])
454
+ ]),
455
+ e("p", dt, [
456
+ o[10] || (o[10] = e("span", null, "Last update:", -1)),
457
+ e("span", ut, u(a(i)), 1)
458
+ ]),
459
+ t.value.devtools.history.at(0)?.fetchTime ? (n(), r("p", ct, [
460
+ o[11] || (o[11] = e("span", null, "Last fetch:", -1)),
461
+ e("span", pt, u(a(I)(new Date(t.value.devtools.history.at(0).fetchTime.start), {
462
+ ...b,
463
+ max: void 0
464
+ })), 1)
465
+ ])) : M("", !0),
466
+ t.value.devtools.history.at(0)?.fetchTime?.end ? (n(), r("p", mt, [
467
+ o[12] || (o[12] = e("span", null, "Fetch duration:", -1)),
468
+ e("span", vt, u(a(Oe)(
469
+ t.value.devtools.history.at(0).fetchTime.end - t.value.devtools.history.at(0).fetchTime.start
470
+ )), 1)
471
+ ])) : M("", !0),
472
+ e("p", ft, [
473
+ e("span", null, [
474
+ o[13] || (o[13] = f("Observers: ")),
475
+ e("span", ht, u(t.value.deps.length), 1)
476
+ ])
477
+ ]),
478
+ !t.value.active && t.value.options ? (n(), r("p", _t, [
479
+ typeof t.value.options.gcTime == "number" && Number.isFinite(t.value.options.gcTime) ? (n(), r(q, { key: 0 }, [
480
+ o[14] || (o[14] = e("span", null, [
481
+ f("Will be "),
482
+ e("i", null, "gced")
483
+ ], -1)),
484
+ e("span", gt, u(a(I)(
485
+ new Date(t.value.devtools.inactiveAt + t.value.options.gcTime),
486
+ {
487
+ ...b,
488
+ max: void 0
489
+ }
490
+ )), 1)
491
+ ], 64)) : M("", !0)
492
+ ])) : M("", !0)
493
+ ])
494
+ ]),
495
+ _: 1
496
+ }, 8, ["icon"]),
497
+ d(k, {
498
+ title: "Actions",
499
+ icon: a(Le)
500
+ }, {
501
+ default: p(() => [
502
+ e("div", yt, [
503
+ d($, {
504
+ class: "theme-info",
505
+ size: "sm",
506
+ title: "Refetch this query",
507
+ disabled: t.value.options?.enabled === !1,
508
+ onClick: o[0] || (o[0] = (c) => a(h).emit("queries:refetch", t.value.key))
509
+ }, {
510
+ default: p(() => [
511
+ d(R, { class: "size-3.5" }),
512
+ o[15] || (o[15] = f(" Refetch "))
513
+ ]),
514
+ _: 1,
515
+ __: [15]
516
+ }, 8, ["disabled"]),
517
+ d($, {
518
+ class: "theme-neutral",
519
+ size: "sm",
520
+ title: "Invalidate this query",
521
+ onClick: o[1] || (o[1] = (c) => a(h).emit("queries:invalidate", t.value.key))
522
+ }, {
523
+ default: p(() => [
524
+ d(N),
525
+ o[16] || (o[16] = f(" Invalidate "))
526
+ ]),
527
+ _: 1,
528
+ __: [16]
529
+ }),
530
+ t.value.devtools.simulate !== "loading" ? (n(), w($, {
531
+ key: 0,
532
+ class: "theme-purple",
533
+ size: "sm",
534
+ title: "Restore the previous state",
535
+ onClick: o[2] || (o[2] = (c) => a(h).emit("queries:simulate:loading", t.value.key))
536
+ }, {
537
+ default: p(() => [
538
+ d(A),
539
+ o[17] || (o[17] = f(" Simulate loading "))
540
+ ]),
541
+ _: 1,
542
+ __: [17]
543
+ })) : (n(), w($, {
544
+ key: 1,
545
+ class: "theme-purple",
546
+ size: "sm",
547
+ title: "Simulate a loading state",
548
+ onClick: o[3] || (o[3] = (c) => a(h).emit("queries:simulate:loading:stop", t.value.key))
549
+ }, {
550
+ default: p(() => [
551
+ d(A, { class: "animate-spin" }),
552
+ o[18] || (o[18] = f(" Stop loading "))
553
+ ]),
554
+ _: 1,
555
+ __: [18]
556
+ })),
557
+ t.value.devtools.simulate !== "error" ? (n(), w($, {
558
+ key: 2,
559
+ class: "theme-error",
560
+ size: "sm",
561
+ title: "Simulate an Error state",
562
+ onClick: o[4] || (o[4] = (c) => a(h).emit("queries:simulate:error", t.value.key))
563
+ }, {
564
+ default: p(() => [
565
+ d(U),
566
+ o[19] || (o[19] = f(" Simulate error "))
567
+ ]),
568
+ _: 1,
569
+ __: [19]
570
+ })) : (n(), w($, {
571
+ key: 3,
572
+ class: "theme-error",
573
+ size: "sm",
574
+ title: "Restore the previous state",
575
+ onClick: o[5] || (o[5] = (c) => a(h).emit("queries:simulate:error:stop", t.value.key))
576
+ }, {
577
+ default: p(() => [
578
+ d(F),
579
+ o[20] || (o[20] = f(" Remove error "))
580
+ ]),
581
+ _: 1,
582
+ __: [20]
583
+ })),
584
+ d($, {
585
+ class: "theme-warning",
586
+ size: "sm",
587
+ title: "Reset this query to its initial (pending) state",
588
+ onClick: o[6] || (o[6] = (c) => a(h).emit("queries:reset", t.value.key))
589
+ }, {
590
+ default: p(() => [
591
+ d(J),
592
+ o[21] || (o[21] = f(" Reset "))
593
+ ]),
594
+ _: 1,
595
+ __: [21]
596
+ })
597
+ ])
598
+ ]),
599
+ _: 1
600
+ }, 8, ["icon"]),
601
+ d(k, {
602
+ open: a(v),
603
+ "onUpdate:open": o[7] || (o[7] = (c) => E(v) ? v.value = c : null),
604
+ title: "Data",
605
+ icon: a(Pe),
606
+ class: "font-mono",
607
+ "no-padding": ""
608
+ }, {
609
+ default: p(() => [
610
+ d(P, {
611
+ data: t.value.state.data
612
+ }, null, 8, ["data"])
613
+ ]),
614
+ _: 1
615
+ }, 8, ["open", "icon"]),
616
+ d(k, {
617
+ open: a(x),
618
+ "onUpdate:open": o[8] || (o[8] = (c) => E(x) ? x.value = c : null),
619
+ title: `Error${t.value.state.status === "error" ? " (!)" : ""}`,
620
+ icon: a(Ye)
621
+ }, {
622
+ default: p(() => [
623
+ e("div", kt, [
624
+ t.value.state.error ? (n(), r("pre", bt, u(t.value.state.error), 1)) : (n(), r("p", wt, " No error "))
625
+ ])
626
+ ]),
627
+ _: 1
628
+ }, 8, ["open", "title", "icon"]),
629
+ d(k, {
630
+ title: "Call count",
631
+ icon: a(nt),
632
+ open: !1
633
+ }, {
634
+ default: p(() => [
635
+ e("div", xt, [
636
+ e("p", $t, [
637
+ o[22] || (o[22] = e("span", null, "Calls:", -1)),
638
+ e("span", null, [
639
+ e("code", Ct, u(t.value.devtools.count.total), 1)
640
+ ]),
641
+ o[23] || (o[23] = e("span", null, "Success:", -1)),
642
+ e("span", null, [
643
+ e("code", Mt, u(t.value.devtools.count.succeed), 1)
644
+ ]),
645
+ o[24] || (o[24] = e("span", null, "Errors:", -1)),
646
+ e("span", null, [
647
+ e("code", St, u(t.value.devtools.count.errored), 1)
648
+ ]),
649
+ o[25] || (o[25] = e("span", null, "Cancelled:", -1)),
650
+ e("span", null, [
651
+ e("code", qt, u(t.value.devtools.count.cancelled), 1)
652
+ ])
653
+ ])
654
+ ])
655
+ ]),
656
+ _: 1
657
+ }, 8, ["icon"]),
658
+ d(k, {
659
+ title: `History (${t.value.devtools.history.length})`,
660
+ icon: a(tt),
661
+ open: !1
662
+ }, {
663
+ default: p(() => [
664
+ e("div", Bt, [
665
+ (n(!0), r(q, null, V(y.value, (c) => (n(), w(k, {
666
+ key: c.updatedAt,
667
+ title: `Entry nº${c.id} (${a(I)(new Date(c.updatedAt), b)})`,
668
+ open: !1
669
+ }, {
670
+ default: p(() => [
671
+ e("pre", jt, u(c.data), 1)
672
+ ]),
673
+ _: 2
674
+ }, 1032, ["title"]))), 128))
675
+ ])
676
+ ]),
677
+ _: 1
678
+ }, 8, ["title", "icon"]),
679
+ d(k, {
680
+ title: "Options",
681
+ open: !1,
682
+ icon: a(Ke)
683
+ }, {
684
+ default: p(() => [
685
+ e("div", zt, [
686
+ t.value.options ? (n(), r("pre", Tt, u(t.value.options), 1)) : (n(), r("p", It, o[26] || (o[26] = [
687
+ f(" This Query entry has no options. It might have been created from the server or manually set with "),
688
+ e("code", null, "queryCache.setQueryData()", -1),
689
+ f(" for prefetching. ")
690
+ ])))
691
+ ])
692
+ ]),
693
+ _: 1
694
+ }, 8, ["icon"])
695
+ ], 64)) : (n(), r("div", Ht, [
696
+ e("p", Vt, [
697
+ o[27] || (o[27] = f(" Select a Query to inspect ")),
698
+ d(Q)
699
+ ])
700
+ ]))
701
+ ]);
702
+ };
703
+ }
704
+ });
705
+ export {
706
+ Lt as default
707
+ };
708
+ //# sourceMappingURL=_queryId_-13o6pDV6.js.map