@pinia/colada-devtools 0.0.3 → 0.0.5

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 (30) hide show
  1. package/dist/index.js +239 -230
  2. package/dist/index.js.map +1 -1
  3. package/dist-panel/{_queryId_-dahx0N-a.js → _queryId_-BGMH9Qyr.js} +65 -65
  4. package/dist-panel/_queryId_-BGMH9Qyr.js.map +1 -0
  5. package/dist-panel/{index-BoUh47CR.js → index-BqoCeMqo.js} +2 -2
  6. package/dist-panel/{index-BoUh47CR.js.map → index-BqoCeMqo.js.map} +1 -1
  7. package/dist-panel/{index-BkrEntNA.js → index-D9g_5JvD.js} +3 -3
  8. package/dist-panel/{index-BkrEntNA.js.map → index-D9g_5JvD.js.map} +1 -1
  9. package/dist-panel/{index-Covr4drg.js → index-hPJdBAcc.js} +945 -926
  10. package/dist-panel/{index-Covr4drg.js.map → index-hPJdBAcc.js.map} +1 -1
  11. package/dist-panel/index.js +1 -1
  12. package/dist-panel/{loader-CuAz6irK.js → loader-HsZ_tw6Q.js} +2 -2
  13. package/dist-panel/loader-HsZ_tw6Q.js.map +1 -0
  14. package/dist-panel/{mouse-pointer-click-BRg0nGpd.js → mouse-pointer-click-BVbSKgPQ.js} +2 -2
  15. package/dist-panel/mouse-pointer-click-BVbSKgPQ.js.map +1 -0
  16. package/dist-panel/mutations-C5PrXZzg.js +13 -0
  17. package/dist-panel/mutations-C5PrXZzg.js.map +1 -0
  18. package/dist-panel/{queries-C8H8bbDX.js → queries-D1tnLOMJ.js} +88 -89
  19. package/dist-panel/queries-D1tnLOMJ.js.map +1 -0
  20. package/dist-panel/{settings-DoijmHf7.js → settings-BDqpjtmF.js} +2 -2
  21. package/dist-panel/{settings-DoijmHf7.js.map → settings-BDqpjtmF.js.map} +1 -1
  22. package/dist-shared/index.d.ts +1 -1
  23. package/dist-shared/index.js.map +1 -1
  24. package/package.json +1 -1
  25. package/dist-panel/_queryId_-dahx0N-a.js.map +0 -1
  26. package/dist-panel/loader-CuAz6irK.js.map +0 -1
  27. package/dist-panel/mouse-pointer-click-BRg0nGpd.js.map +0 -1
  28. package/dist-panel/mutations-ComK9mEg.js +0 -13
  29. package/dist-panel/mutations-ComK9mEg.js.map +0 -1
  30. package/dist-panel/queries-C8H8bbDX.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as $, ref as R, onMounted as L, renderSlot as ne, createCommentVNode as M, toValue as A, getCurrentScope as J, onScopeDispose as Q, useTemplateRef as oe, shallowRef as N, watch as P, onBeforeUnmount as ie, createBlock as W, openBlock as x, Teleport as se, createElementVNode as re, nextTick as G, readonly as K, getCurrentInstance as ae, toRef as le, customRef as ue, computed as U, unref as F, withCtx as ce, createElementBlock as de } from "vue";
1
+ import { defineComponent as $, ref as R, onMounted as L, renderSlot as ne, createCommentVNode as M, toValue as T, getCurrentScope as J, onScopeDispose as Q, useTemplateRef as oe, shallowRef as N, watch as _, onBeforeUnmount as ie, createBlock as W, openBlock as x, Teleport as re, createElementVNode as se, nextTick as G, readonly as K, getCurrentInstance as ae, toRef as le, customRef as ue, computed as U, unref as F, withCtx as ce, createElementBlock as de } from "vue";
2
2
  import { useQueryCache as fe } from "@pinia/colada";
3
3
  import { DEVTOOLS_INFO_KEY as p, DuplexChannel as pe } from "@pinia/colada-devtools/shared";
4
4
  const ve = /* @__PURE__ */ $({
@@ -7,89 +7,89 @@ const ve = /* @__PURE__ */ $({
7
7
  const t = R(!1);
8
8
  return L(() => {
9
9
  t.value = !0;
10
- }), (o, l) => t.value ? ne(o.$slots, "default", { key: 0 }) : M("", !0);
10
+ }), (n, l) => t.value ? ne(n.$slots, "default", { key: 0 }) : M("", !0);
11
11
  }
12
- }), S = () => performance.timeOrigin + performance.now();
12
+ }), b = () => performance.timeOrigin + performance.now();
13
13
  function me(e) {
14
14
  var t;
15
15
  if (!I.has(e)) {
16
16
  I.set(e, !0);
17
- for (const o of e.getEntries())
18
- o[t = p] ?? (o[t] = {
17
+ for (const n of e.getEntries())
18
+ n[t = p] ?? (n[t] = {
19
19
  count: {
20
20
  total: 0,
21
21
  succeed: 0,
22
22
  errored: 0,
23
23
  cancelled: 0
24
24
  },
25
- updatedAt: S(),
25
+ updatedAt: b(),
26
26
  inactiveAt: 0,
27
27
  simulate: null,
28
28
  history: []
29
29
  });
30
- e.$onAction(({ name: o, args: l, after: s, onError: d }) => {
30
+ e.$onAction(({ name: n, args: l, after: r, onError: d }) => {
31
31
  var h, f;
32
- if (o === "create")
33
- s((r) => {
34
- r[p] = {
32
+ if (n === "create")
33
+ r((s) => {
34
+ s[p] = {
35
35
  count: {
36
36
  total: 0,
37
37
  succeed: 0,
38
38
  errored: 0,
39
39
  cancelled: 0
40
40
  },
41
- updatedAt: S(),
41
+ updatedAt: b(),
42
42
  inactiveAt: 0,
43
43
  simulate: null,
44
44
  history: []
45
45
  };
46
46
  });
47
- else if (o === "fetch") {
48
- const [r] = l;
49
- r[p].count.total++, r[p].updatedAt = S();
50
- const u = S(), v = {
51
- id: (((h = r[p].history.at(0)) == null ? void 0 : h.id) ?? -1) + 1,
52
- key: r.key,
53
- state: r.state.value,
47
+ else if (n === "fetch") {
48
+ const [s] = l;
49
+ s[p].count.total++, s[p].updatedAt = b();
50
+ const u = b(), v = {
51
+ id: (((h = s[p].history.at(0)) == null ? void 0 : h.id) ?? -1) + 1,
52
+ key: s.key,
53
+ state: s.state.value,
54
54
  updatedAt: u,
55
55
  createdAt: u,
56
56
  fetchTime: null
57
- }, n = A((f = r.options) == null ? void 0 : f.enabled) ?? !0;
58
- n && (v.fetchTime = {
57
+ }, E = T((f = s.options) == null ? void 0 : f.enabled) ?? !0;
58
+ E && (v.fetchTime = {
59
59
  start: u,
60
60
  end: null
61
- }), r[p].history.unshift(v), r[p].history = r[p].history.slice(0, 10), s(() => {
62
- n && (v.fetchTime.end = S(), r[p].count.succeed++, v.state = r.state.value, v.updatedAt = S());
61
+ }), s[p].history.unshift(v), s[p].history = s[p].history.slice(0, 10), r(() => {
62
+ E && (v.fetchTime.end = b(), s[p].count.succeed++, v.state = s.state.value, v.updatedAt = b());
63
63
  }), d(() => {
64
- n && (v.fetchTime.end = S(), r[p].count.errored++, v.state = r.state.value, v.updatedAt = S());
64
+ E && (v.fetchTime.end = b(), s[p].count.errored++, v.state = s.state.value, v.updatedAt = b());
65
65
  });
66
- } else if (o === "cancel") {
67
- const [r] = l;
68
- r.pending && r[p].count.cancelled++;
69
- } else if (o === "setEntryState") {
70
- const [r] = l;
71
- let u = r[p].history[0];
72
- s(() => {
73
- r[p].updatedAt = S(), u ?? (u = r[p].history[0]), u && (u.state = r.state.value, u.updatedAt = S());
66
+ } else if (n === "cancel") {
67
+ const [s] = l;
68
+ s.pending && s[p].count.cancelled++;
69
+ } else if (n === "setEntryState") {
70
+ const [s] = l;
71
+ let u = s[p].history[0];
72
+ r(() => {
73
+ s[p].updatedAt = b(), u ?? (u = s[p].history[0]), u && (u.state = s.state.value, u.updatedAt = b());
74
74
  });
75
- } else if (o === "untrack") {
76
- const [r] = l;
77
- s(() => {
78
- r.active || (r[p].inactiveAt = S());
75
+ } else if (n === "untrack") {
76
+ const [s] = l;
77
+ r(() => {
78
+ s.active || (s[p].inactiveAt = b());
79
79
  });
80
- } else if (o === "setQueryData") {
81
- const [r] = l;
82
- s(() => {
83
- const u = e.getEntries({ key: r, exact: !0 })[0];
84
- u && !u.active && (u[p].inactiveAt = S());
80
+ } else if (n === "setQueryData") {
81
+ const [s] = l;
82
+ r(() => {
83
+ const u = e.getEntries({ key: s, exact: !0 })[0];
84
+ u && !u.active && (u[p].inactiveAt = b());
85
85
  });
86
86
  }
87
87
  });
88
88
  }
89
89
  }
90
- function w(e) {
90
+ function S(e) {
91
91
  return {
92
- id: e.key.join("\0"),
92
+ keyHash: e.keyHash,
93
93
  key: e.key,
94
94
  state: e.state.value,
95
95
  asyncStatus: e.asyncStatus.value,
@@ -99,10 +99,10 @@ function w(e) {
99
99
  options: e.options && {
100
100
  staleTime: e.options.staleTime,
101
101
  gcTime: e.options.gcTime,
102
- refetchOnMount: A(e.options.refetchOnMount),
103
- refetchOnReconnect: A(e.options.refetchOnReconnect),
104
- refetchOnWindowFocus: A(e.options.refetchOnWindowFocus),
105
- enabled: A(e.options.enabled)
102
+ refetchOnMount: T(e.options.refetchOnMount),
103
+ refetchOnReconnect: T(e.options.refetchOnReconnect),
104
+ refetchOnWindowFocus: T(e.options.refetchOnWindowFocus),
105
+ enabled: T(e.options.enabled)
106
106
  },
107
107
  deps: Array.from(e.deps).map(
108
108
  (t) => "uid" in t ? {
@@ -120,127 +120,127 @@ function w(e) {
120
120
  };
121
121
  }
122
122
  const I = /* @__PURE__ */ new WeakMap();
123
- function ye(e, t, o, l) {
124
- e.addEventListener(t, o, l), J() && Q(() => {
125
- e.removeEventListener(t, o);
123
+ function ye(e, t, n, l) {
124
+ e.addEventListener(t, n, l), J() && Q(() => {
125
+ e.removeEventListener(t, n);
126
126
  });
127
127
  }
128
128
  const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
129
129
  __name: "PiniaColadaDevtools",
130
130
  setup(e) {
131
131
  const t = fe();
132
- me(t), t.$onAction(({ name: n, after: i, onError: m, args: E }) => {
133
- if (n === "remove") {
134
- const [a] = E;
135
- i(() => {
136
- s.emit("queries:delete", w(a));
132
+ me(t), t.$onAction(({ name: i, after: o, onError: m, args: g }) => {
133
+ if (i === "remove") {
134
+ const [a] = g;
135
+ o(() => {
136
+ r.emit("queries:delete", S(a));
137
137
  });
138
- } else if (n === "track" || n === "untrack" || n === "cancel" || n === "invalidate" || n === "fetch" || n === "setEntryState") {
139
- const [a] = E;
140
- if (n === "fetch") {
141
- const y = w(a);
142
- y.asyncStatus = "loading", s.emit("queries:update", y);
138
+ } else if (i === "track" || i === "untrack" || i === "cancel" || i === "invalidate" || i === "fetch" || i === "setEntryState") {
139
+ const [a] = g;
140
+ if (i === "fetch") {
141
+ const y = S(a);
142
+ y.asyncStatus = "loading", r.emit("queries:update", y);
143
143
  }
144
- i(() => {
144
+ o(() => {
145
145
  var y;
146
- a[p].simulate = null, s.emit("queries:update", w(a)), n === "fetch" && ((y = a.options) == null ? void 0 : y.staleTime) != null && Number.isFinite(a.options.staleTime) && setTimeout(() => {
147
- s.emit("queries:update", w(a));
146
+ a[p].simulate = null, r.emit("queries:update", S(a)), i === "fetch" && ((y = a.options) == null ? void 0 : y.staleTime) != null && Number.isFinite(a.options.staleTime) && setTimeout(() => {
147
+ r.emit("queries:update", S(a));
148
148
  }, a.options.staleTime);
149
149
  }), m(() => {
150
- s.emit("queries:update", w(a));
150
+ r.emit("queries:update", S(a));
151
151
  });
152
- } else if (n === "create")
153
- i((a) => {
154
- s.emit("queries:update", w(a));
152
+ } else if (i === "create")
153
+ o((a) => {
154
+ r.emit("queries:update", S(a));
155
155
  });
156
- else if (n === "setQueryData") {
157
- const [a] = E;
158
- i(() => {
156
+ else if (i === "setQueryData") {
157
+ const [a] = g;
158
+ o(() => {
159
159
  const y = t.getEntries({ key: a, exact: !0 })[0];
160
- y && s.emit("queries:update", w(y));
160
+ y && r.emit("queries:update", S(y));
161
161
  });
162
162
  }
163
163
  });
164
- const o = oe("devtools"), l = N(new MessageChannel()), s = new pe(l.value.port1);
165
- P(
164
+ const n = oe("devtools"), l = N(new MessageChannel()), r = new pe(l.value.port1);
165
+ _(
166
166
  l,
167
- (n) => {
168
- s.setPort(n.port1);
167
+ (i) => {
168
+ r.setPort(i.port1);
169
169
  },
170
170
  { flush: "sync" }
171
- ), s.on("ping", () => {
172
- console.log("[App] Received ping from devtools"), s.emit("pong");
173
- }), s.on("pong", () => {
171
+ ), r.on("ping", () => {
172
+ console.log("[App] Received ping from devtools"), r.emit("pong");
173
+ }), r.on("pong", () => {
174
174
  console.log("[App] Received pong from devtools");
175
- }), s.on("queries:refetch", (n) => {
176
- t.invalidateQueries({ key: n, exact: !0, active: null, stale: null });
177
- }), s.on("queries:invalidate", (n) => {
178
- t.invalidateQueries({ key: n, exact: !0 });
179
- }), s.on("queries:reset", (n) => {
180
- const i = t.getEntries({ key: n, exact: !0 })[0];
181
- i && (t.cancel(i), t.setEntryState(i, {
175
+ }), r.on("queries:refetch", (i) => {
176
+ t.invalidateQueries({ key: i, exact: !0, active: null, stale: null });
177
+ }), r.on("queries:invalidate", (i) => {
178
+ t.invalidateQueries({ key: i, exact: !0 });
179
+ }), r.on("queries:reset", (i) => {
180
+ const o = t.getEntries({ key: i, exact: !0 })[0];
181
+ o && (t.cancel(o), t.setEntryState(o, {
182
182
  status: "pending",
183
183
  data: void 0,
184
184
  error: null
185
185
  }));
186
- }), s.on("queries:set:state", (n, i) => {
187
- const m = t.getEntries({ key: n, exact: !0 })[0];
188
- m && (t.setEntryState(m, i), s.emit("queries:update", w(m)));
189
- }), s.on("queries:simulate:loading", (n) => {
190
- const i = t.getEntries({ key: n, exact: !0 })[0];
191
- i && (i.asyncStatus.value = "loading", i[p].simulate = "loading", s.emit("queries:update", w(i)));
192
- }), s.on("queries:simulate:loading:stop", (n) => {
193
- const i = t.getEntries({ key: n, exact: !0 })[0];
194
- i && i[p].simulate === "loading" && (i.asyncStatus.value = "idle", i[p].simulate = null, s.emit("queries:update", w(i)));
195
- }), s.on("queries:simulate:error", (n) => {
196
- const i = t.getEntries({ key: n, exact: !0 })[0];
197
- i && (t.cancel(i), t.setEntryState(i, {
198
- ...i.state.value,
186
+ }), r.on("queries:set:state", (i, o) => {
187
+ const m = t.getEntries({ key: i, exact: !0 })[0];
188
+ m && (t.setEntryState(m, o), r.emit("queries:update", S(m)));
189
+ }), r.on("queries:simulate:loading", (i) => {
190
+ const o = t.getEntries({ key: i, exact: !0 })[0];
191
+ o && (o.asyncStatus.value = "loading", o[p].simulate = "loading", r.emit("queries:update", S(o)));
192
+ }), r.on("queries:simulate:loading:stop", (i) => {
193
+ const o = t.getEntries({ key: i, exact: !0 })[0];
194
+ o && o[p].simulate === "loading" && (o.asyncStatus.value = "idle", o[p].simulate = null, r.emit("queries:update", S(o)));
195
+ }), r.on("queries:simulate:error", (i) => {
196
+ const o = t.getEntries({ key: i, exact: !0 })[0];
197
+ o && (t.cancel(o), t.setEntryState(o, {
198
+ ...o.state.value,
199
199
  status: "error",
200
200
  error: new Error("Simulated error")
201
- }), i[p].simulate = "error", s.emit("queries:update", w(i)));
202
- }), s.on("queries:simulate:error:stop", (n) => {
203
- const i = t.getEntries({ key: n, exact: !0 })[0];
204
- i && i[p].simulate === "error" && (t.cancel(i), t.setEntryState(i, {
205
- ...i.state.value,
206
- status: i.state.value.data !== void 0 ? "success" : "pending",
201
+ }), o[p].simulate = "error", r.emit("queries:update", S(o)));
202
+ }), r.on("queries:simulate:error:stop", (i) => {
203
+ const o = t.getEntries({ key: i, exact: !0 })[0];
204
+ o && o[p].simulate === "error" && (t.cancel(o), t.setEntryState(o, {
205
+ ...o.state.value,
206
+ status: o.state.value.data !== void 0 ? "success" : "pending",
207
207
  error: null
208
- }), i[p].simulate = null, s.emit("queries:update", w(i)));
208
+ }), o[p].simulate = null, r.emit("queries:update", S(o)));
209
209
  });
210
210
  const d = N(null);
211
- P(d, () => {
211
+ _(d, () => {
212
212
  l.value = new MessageChannel();
213
213
  }), ye(
214
214
  window,
215
215
  "unload",
216
216
  () => {
217
- var n;
218
- (n = d.value) == null || n.close();
217
+ var i;
218
+ (i = d.value) == null || i.close();
219
219
  },
220
220
  { passive: !0 }
221
221
  ), ie(() => {
222
- var n;
223
- (n = d.value) == null || n.close();
222
+ var i;
223
+ (i = d.value) == null || i.close();
224
224
  });
225
225
  function h() {
226
- var n;
227
- (n = d.value) == null || n.close(), d.value = null;
226
+ var i;
227
+ (i = d.value) == null || i.close(), d.value = null;
228
228
  }
229
229
  function f() {
230
- const n = o.value;
231
- if (!n || !n.shadowRoot)
230
+ const i = n.value;
231
+ if (!i || !i.shadowRoot)
232
232
  throw new Error("No devtools elemnt found for Pinia Colada devtools");
233
- const i = n.shadowRoot.getElementById("root");
234
- if (!i)
233
+ const o = i.shadowRoot.getElementById("root");
234
+ if (!o)
235
235
  throw new Error("No devtools root element found for Pinia Colada devtools");
236
- const m = Math.max(i.offsetWidth, 400), E = Math.max(i.offsetHeight, 400), a = window.open(
236
+ const m = Math.max(o.offsetWidth, 400), g = Math.max(o.offsetHeight, 400), a = window.open(
237
237
  "",
238
238
  "pinia-colada-devtools",
239
- `popup,width=${m},height=${E}`
239
+ `popup,width=${m},height=${g}`
240
240
  );
241
241
  if (!a)
242
242
  throw new Error("Failed to open PiP window for Pinia Colada devtools");
243
- d.value = a, a.document.head.innerHTML = "", a.document.body.innerHTML = "", a.document.title = "🍹 Pinia Colada Devtools", a.document.body.style.margin = "0", r(n, a.document), a.addEventListener(
243
+ d.value = a, a.document.head.innerHTML = "", a.document.body.innerHTML = "", a.document.title = "🍹 Pinia Colada Devtools", a.document.body.style.margin = "0", s(i, a.document), a.addEventListener(
244
244
  "unload",
245
245
  () => {
246
246
  d.value = null;
@@ -248,33 +248,42 @@ const he = [".isPip", ".port"], ge = /* @__PURE__ */ $({
248
248
  { passive: !0 }
249
249
  );
250
250
  }
251
- function r(n, i = document) {
252
- if (!n || !n.shadowRoot)
251
+ function s(i, o = document) {
252
+ if (!i || !i.shadowRoot)
253
253
  throw new Error("No devtools element found for Pinia Colada devtools");
254
- const m = i.getElementById("__pc-tw-properties") ?? i.createElement("style");
254
+ const m = o.getElementById("__pc-tw-properties") ?? o.createElement("style");
255
255
  m.setAttribute("id", "__pc-tw-properties");
256
- const E = [...n.shadowRoot.styleSheets].flatMap((a) => [...a.cssRules]).filter((a) => a instanceof CSSPropertyRule).map((a) => a.cssText).join("");
257
- m.textContent = E, i.head.appendChild(m);
256
+ const g = [...i.shadowRoot.styleSheets].flatMap((a) => [...a.cssRules]).filter((a) => a instanceof CSSPropertyRule).map((a) => a.cssText).join("");
257
+ m.textContent = g, o.head.appendChild(m);
258
258
  }
259
259
  function u() {
260
260
  d.value ? h() : f();
261
261
  }
262
- async function v() {
263
- r(o.value), s.emit("queries:all", t.getEntries({}).map(w)), s.emit(
262
+ let v = 0;
263
+ async function E() {
264
+ if (!n.value) {
265
+ if (++v > 100)
266
+ throw new Error("Failed to find devtools element for Pinia Colada devtools");
267
+ setTimeout(() => {
268
+ E();
269
+ }, 100);
270
+ return;
271
+ }
272
+ s(n.value), r.emit("queries:all", t.getEntries({}).map(S)), r.emit(
264
273
  "mutations:all",
265
274
  // FIXME: mutations
266
- t.getEntries({}).map(w)
275
+ t.getEntries({}).map(S)
267
276
  );
268
277
  }
269
- return (n, i) => (x(), W(se, {
278
+ return (i, o) => (x(), W(re, {
270
279
  to: d.value ? d.value.document.body : "body"
271
280
  }, [
272
- re("pinia-colada-devtools-panel", {
281
+ se("pinia-colada-devtools-panel", {
273
282
  ref: "devtools",
274
283
  ".isPip": !!d.value,
275
284
  ".port": l.value.port2,
276
- onTogglePip: i[0] || (i[0] = (m) => u()),
277
- onReady: i[1] || (i[1] = (m) => v())
285
+ onTogglePip: o[0] || (o[0] = (m) => u()),
286
+ onReady: o[1] || (o[1] = (m) => E())
278
287
  }, null, 40, he)
279
288
  ], 8, ["to"]));
280
289
  }
@@ -293,19 +302,19 @@ function Te(...e) {
293
302
  return typeof t == "function" ? K(ue(() => ({ get: t, set: Ae }))) : R(t);
294
303
  }
295
304
  function Ce(e, t) {
296
- function o(...l) {
297
- return new Promise((s, d) => {
298
- Promise.resolve(e(() => t.apply(this, l), { fn: t, thisArg: this, args: l })).then(s).catch(d);
305
+ function n(...l) {
306
+ return new Promise((r, d) => {
307
+ Promise.resolve(e(() => t.apply(this, l), { fn: t, thisArg: this, args: l })).then(r).catch(d);
299
308
  });
300
309
  }
301
- return o;
310
+ return n;
302
311
  }
303
312
  const Y = (e) => e();
304
- function _e(e = Y, t = {}) {
313
+ function Pe(e = Y, t = {}) {
305
314
  const {
306
- initialState: o = "active"
307
- } = t, l = Te(o === "active");
308
- function s() {
315
+ initialState: n = "active"
316
+ } = t, l = Te(n === "active");
317
+ function r() {
309
318
  l.value = !1;
310
319
  }
311
320
  function d() {
@@ -314,34 +323,34 @@ function _e(e = Y, t = {}) {
314
323
  const h = (...f) => {
315
324
  l.value && e(...f);
316
325
  };
317
- return { isActive: K(l), pause: s, resume: d, eventFilter: h };
326
+ return { isActive: K(l), pause: r, resume: d, eventFilter: h };
318
327
  }
319
328
  function q(e) {
320
329
  return Array.isArray(e) ? e : [e];
321
330
  }
322
- function Pe(e) {
331
+ function _e(e) {
323
332
  return ae();
324
333
  }
325
- function Oe(e, t, o = {}) {
334
+ function Oe(e, t, n = {}) {
326
335
  const {
327
336
  eventFilter: l = Y,
328
- ...s
329
- } = o;
330
- return P(
337
+ ...r
338
+ } = n;
339
+ return _(
331
340
  e,
332
341
  Ce(
333
342
  l,
334
343
  t
335
344
  ),
336
- s
345
+ r
337
346
  );
338
347
  }
339
- function ke(e, t, o = {}) {
348
+ function ke(e, t, n = {}) {
340
349
  const {
341
350
  eventFilter: l,
342
- initialState: s = "active",
351
+ initialState: r = "active",
343
352
  ...d
344
- } = o, { eventFilter: h, pause: f, resume: r, isActive: u } = _e(l, { initialState: s });
353
+ } = n, { eventFilter: h, pause: f, resume: s, isActive: u } = Pe(l, { initialState: r });
345
354
  return { stop: Oe(
346
355
  e,
347
356
  t,
@@ -349,17 +358,17 @@ function ke(e, t, o = {}) {
349
358
  ...d,
350
359
  eventFilter: h
351
360
  }
352
- ), pause: f, resume: r, isActive: u };
361
+ ), pause: f, resume: s, isActive: u };
353
362
  }
354
- function xe(e, t = !0, o) {
355
- Pe() ? L(e, o) : t ? e() : G(e);
363
+ function xe(e, t = !0, n) {
364
+ _e() ? L(e, n) : t ? e() : G(e);
356
365
  }
357
- function De(e, t, o) {
358
- return P(
366
+ function De(e, t, n) {
367
+ return _(
359
368
  e,
360
369
  t,
361
370
  {
362
- ...o,
371
+ ...n,
363
372
  immediate: !0
364
373
  }
365
374
  );
@@ -367,43 +376,43 @@ function De(e, t, o) {
367
376
  const D = Ee ? window : void 0;
368
377
  function Re(e) {
369
378
  var t;
370
- const o = A(e);
371
- return (t = o == null ? void 0 : o.$el) != null ? t : o;
379
+ const n = T(e);
380
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
372
381
  }
373
382
  function z(...e) {
374
- const t = [], o = () => {
383
+ const t = [], n = () => {
375
384
  t.forEach((f) => f()), t.length = 0;
376
- }, l = (f, r, u, v) => (f.addEventListener(r, u, v), () => f.removeEventListener(r, u, v)), s = U(() => {
377
- const f = q(A(e[0])).filter((r) => r != null);
378
- return f.every((r) => typeof r != "string") ? f : void 0;
385
+ }, l = (f, s, u, v) => (f.addEventListener(s, u, v), () => f.removeEventListener(s, u, v)), r = U(() => {
386
+ const f = q(T(e[0])).filter((s) => s != null);
387
+ return f.every((s) => typeof s != "string") ? f : void 0;
379
388
  }), d = De(
380
389
  () => {
381
- var f, r;
390
+ var f, s;
382
391
  return [
383
- (r = (f = s.value) == null ? void 0 : f.map((u) => Re(u))) != null ? r : [D].filter((u) => u != null),
384
- q(A(s.value ? e[1] : e[0])),
385
- q(F(s.value ? e[2] : e[1])),
392
+ (s = (f = r.value) == null ? void 0 : f.map((u) => Re(u))) != null ? s : [D].filter((u) => u != null),
393
+ q(T(r.value ? e[1] : e[0])),
394
+ q(F(r.value ? e[2] : e[1])),
386
395
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
387
- A(s.value ? e[3] : e[2])
396
+ T(r.value ? e[3] : e[2])
388
397
  ];
389
398
  },
390
- ([f, r, u, v]) => {
391
- if (o(), !(f != null && f.length) || !(r != null && r.length) || !(u != null && u.length))
399
+ ([f, s, u, v]) => {
400
+ if (n(), !(f != null && f.length) || !(s != null && s.length) || !(u != null && u.length))
392
401
  return;
393
- const n = be(v) ? { ...v } : v;
402
+ const E = be(v) ? { ...v } : v;
394
403
  t.push(
395
404
  ...f.flatMap(
396
- (i) => r.flatMap(
397
- (m) => u.map((E) => l(i, m, E, n))
405
+ (i) => s.flatMap(
406
+ (o) => u.map((m) => l(i, o, m, E))
398
407
  )
399
408
  )
400
409
  );
401
410
  },
402
411
  { flush: "post" }
403
412
  ), h = () => {
404
- d(), o();
413
+ d(), n();
405
414
  };
406
- return we(o), h;
415
+ return we(n), h;
407
416
  }
408
417
  const O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, k = "__vueuse_ssr_handlers__", qe = /* @__PURE__ */ Me();
409
418
  function Me() {
@@ -449,128 +458,128 @@ const Fe = {
449
458
  write: (e) => e.toISOString()
450
459
  }
451
460
  }, B = "vueuse-storage";
452
- function $e(e, t, o, l = {}) {
453
- var s;
461
+ function $e(e, t, n, l = {}) {
462
+ var r;
454
463
  const {
455
464
  flush: d = "pre",
456
465
  deep: h = !0,
457
466
  listenToStorageChanges: f = !0,
458
- writeDefaults: r = !0,
467
+ writeDefaults: s = !0,
459
468
  mergeDefaults: u = !1,
460
469
  shallow: v,
461
- window: n = D,
470
+ window: E = D,
462
471
  eventFilter: i,
463
- onError: m = (c) => {
472
+ onError: o = (c) => {
464
473
  console.error(c);
465
474
  },
466
- initOnMounted: E
467
- } = l, a = (v ? N : R)(t), y = U(() => A(e));
468
- if (!o)
475
+ initOnMounted: m
476
+ } = l, g = (v ? N : R)(t), a = U(() => T(e));
477
+ if (!n)
469
478
  try {
470
- o = Ne("getDefaultStorage", () => {
479
+ n = Ne("getDefaultStorage", () => {
471
480
  var c;
472
481
  return (c = D) == null ? void 0 : c.localStorage;
473
482
  })();
474
483
  } catch (c) {
475
- m(c);
484
+ o(c);
476
485
  }
477
- if (!o)
478
- return a;
479
- const T = A(t), j = We(T), C = (s = l.serializer) != null ? s : Fe[j], { pause: X, resume: V } = ke(
480
- a,
481
- () => Z(a.value),
486
+ if (!n)
487
+ return g;
488
+ const y = T(t), j = We(y), C = (r = l.serializer) != null ? r : Fe[j], { pause: X, resume: H } = ke(
489
+ g,
490
+ () => Z(g.value),
482
491
  { flush: d, deep: h, eventFilter: i }
483
492
  );
484
- P(y, () => _(), { flush: d }), n && f && xe(() => {
485
- o instanceof Storage ? z(n, "storage", _, { passive: !0 }) : z(n, B, te), E && _();
486
- }), E || _();
487
- function H(c, g) {
488
- if (n) {
489
- const b = {
490
- key: y.value,
493
+ _(a, () => P(), { flush: d }), E && f && xe(() => {
494
+ n instanceof Storage ? z(E, "storage", P, { passive: !0 }) : z(E, B, te), m && P();
495
+ }), m || P();
496
+ function V(c, w) {
497
+ if (E) {
498
+ const A = {
499
+ key: a.value,
491
500
  oldValue: c,
492
- newValue: g,
493
- storageArea: o
501
+ newValue: w,
502
+ storageArea: n
494
503
  };
495
- n.dispatchEvent(o instanceof Storage ? new StorageEvent("storage", b) : new CustomEvent(B, {
496
- detail: b
504
+ E.dispatchEvent(n instanceof Storage ? new StorageEvent("storage", A) : new CustomEvent(B, {
505
+ detail: A
497
506
  }));
498
507
  }
499
508
  }
500
509
  function Z(c) {
501
510
  try {
502
- const g = o.getItem(y.value);
511
+ const w = n.getItem(a.value);
503
512
  if (c == null)
504
- H(g, null), o.removeItem(y.value);
513
+ V(w, null), n.removeItem(a.value);
505
514
  else {
506
- const b = C.write(c);
507
- g !== b && (o.setItem(y.value, b), H(g, b));
515
+ const A = C.write(c);
516
+ w !== A && (n.setItem(a.value, A), V(w, A));
508
517
  }
509
- } catch (g) {
510
- m(g);
518
+ } catch (w) {
519
+ o(w);
511
520
  }
512
521
  }
513
522
  function ee(c) {
514
- const g = c ? c.newValue : o.getItem(y.value);
515
- if (g == null)
516
- return r && T != null && o.setItem(y.value, C.write(T)), T;
523
+ const w = c ? c.newValue : n.getItem(a.value);
524
+ if (w == null)
525
+ return s && y != null && n.setItem(a.value, C.write(y)), y;
517
526
  if (!c && u) {
518
- const b = C.read(g);
519
- return typeof u == "function" ? u(b, T) : j === "object" && !Array.isArray(b) ? { ...T, ...b } : b;
520
- } else return typeof g != "string" ? g : C.read(g);
527
+ const A = C.read(w);
528
+ return typeof u == "function" ? u(A, y) : j === "object" && !Array.isArray(A) ? { ...y, ...A } : A;
529
+ } else return typeof w != "string" ? w : C.read(w);
521
530
  }
522
- function _(c) {
523
- if (!(c && c.storageArea !== o)) {
531
+ function P(c) {
532
+ if (!(c && c.storageArea !== n)) {
524
533
  if (c && c.key == null) {
525
- a.value = T;
534
+ g.value = y;
526
535
  return;
527
536
  }
528
- if (!(c && c.key !== y.value)) {
537
+ if (!(c && c.key !== a.value)) {
529
538
  X();
530
539
  try {
531
- (c == null ? void 0 : c.newValue) !== C.write(a.value) && (a.value = ee(c));
532
- } catch (g) {
533
- m(g);
540
+ (c == null ? void 0 : c.newValue) !== C.write(g.value) && (g.value = ee(c));
541
+ } catch (w) {
542
+ o(w);
534
543
  } finally {
535
- c ? G(V) : V();
544
+ c ? G(H) : H();
536
545
  }
537
546
  }
538
547
  }
539
548
  }
540
549
  function te(c) {
541
- _(c.detail);
550
+ P(c.detail);
542
551
  }
543
- return a;
552
+ return g;
544
553
  }
545
- function Le(e, t, o = {}) {
546
- const { window: l = D } = o;
547
- return $e(e, t, l == null ? void 0 : l.localStorage, o);
554
+ function Le(e, t, n = {}) {
555
+ const { window: l = D } = n;
556
+ return $e(e, t, l == null ? void 0 : l.localStorage, n);
548
557
  }
549
558
  const Ie = /* @__PURE__ */ $({
550
559
  __name: "PCDevtoolsWrapper",
551
560
  setup(e) {
552
- const t = R(!1), o = Le("pinia-colada-devtools-open", !1);
561
+ const t = R(!1), n = Le("pinia-colada-devtools-open", !1);
553
562
  async function l() {
554
563
  if (!t.value && (t.value = !0, !customElements.get("pinia-colada-devtools-panel"))) {
555
564
  const { DevtoolsPanel: d } = await import("@pinia/colada-devtools/panel");
556
565
  customElements.define("pinia-colada-devtools-panel", d);
557
566
  }
558
567
  }
559
- async function s() {
560
- await l(), o.value = !0;
568
+ async function r() {
569
+ await l(), n.value = !0;
561
570
  }
562
571
  return L(() => {
563
572
  requestIdleCallback(() => {
564
573
  import("@pinia/colada-devtools/panel");
565
- }), o.value && s();
574
+ }), n.value && r();
566
575
  }), (d, h) => (x(), W(ve, null, {
567
576
  default: ce(() => [
568
- F(o) ? M("", !0) : (x(), de("button", {
577
+ F(n) ? M("", !0) : (x(), de("button", {
569
578
  key: 0,
570
579
  class: "fixed bottom-2 right-2 bg-primary-500 hover:cursor-pointer z-99999",
571
- onClick: h[0] || (h[0] = (f) => s())
580
+ onClick: h[0] || (h[0] = (f) => r())
572
581
  }, " 🍹 Devtools ")),
573
- t.value && F(o) ? (x(), W(ge, { key: 1 })) : M("", !0)
582
+ t.value && F(n) ? (x(), W(ge, { key: 1 })) : M("", !0)
574
583
  ]),
575
584
  _: 1
576
585
  }));