vue3-router-tab 1.3.1 → 1.3.2

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.
@@ -1,7 +1,7 @@
1
1
  import './vue3-router-tab.css';
2
- import { reactive as pe, ref as $, shallowRef as dt, computed as k, watch as A, nextTick as N, inject as Pe, getCurrentInstance as je, onMounted as ge, defineComponent as Oe, provide as bt, onBeforeUnmount as pt, resolveComponent as gt, createElementBlock as x, openBlock as C, createElementVNode as O, createCommentVNode as ie, normalizeClass as H, renderSlot as le, createVNode as Ae, TransitionGroup as mt, mergeProps as se, withCtx as ue, Fragment as Ke, renderList as Ee, withModifiers as ce, toDisplayString as Ie, createBlock as J, normalizeProps as vt, Transition as yt, resolveDynamicComponent as fe, KeepAlive as ht, normalizeStyle as Tt, isRef as kt, isReadonly as wt } from "vue";
3
- import { RouterView as Ct } from "vue-router";
4
- function Rt(e = {}) {
2
+ import { reactive as be, ref as $, shallowRef as dt, computed as k, watch as A, nextTick as j, inject as Re, getCurrentInstance as je, onMounted as pe, defineComponent as Oe, provide as bt, onBeforeUnmount as pt, resolveComponent as gt, createElementBlock as S, openBlock as P, createElementVNode as L, withDirectives as mt, normalizeClass as H, renderSlot as re, createVNode as Pe, TransitionGroup as vt, mergeProps as le, withCtx as se, Fragment as Ae, renderList as Ke, withModifiers as ue, createCommentVNode as Ee, toDisplayString as Ie, createBlock as J, normalizeProps as yt, Transition as ht, resolveDynamicComponent as ce, KeepAlive as Tt, normalizeStyle as kt, vShow as wt, isRef as Ct, isReadonly as Rt } from "vue";
3
+ import { RouterView as Pt } from "vue-router";
4
+ function At(e = {}) {
5
5
  return {
6
6
  initialTabs: e.initialTabs ?? [],
7
7
  keepAlive: e.keepAlive ?? !0,
@@ -11,35 +11,35 @@ function Rt(e = {}) {
11
11
  defaultRoute: e.defaultRoute ?? "/"
12
12
  };
13
13
  }
14
- function U(e, n) {
14
+ function V(e, n) {
15
15
  const o = e.resolve(n);
16
16
  if (!o || !o.matched.length)
17
17
  throw new Error(`[RouterTabs] Unable to resolve route: ${String(n)}`);
18
18
  return o;
19
19
  }
20
- const Pt = {
20
+ const Kt = {
21
21
  path: (e) => e.path,
22
22
  fullpath: (e) => e.fullPath,
23
23
  fullname: (e) => e.fullPath,
24
24
  full: (e) => e.fullPath,
25
25
  name: (e) => e.name ? String(e.name) : e.fullPath
26
26
  };
27
- function V(e) {
27
+ function N(e) {
28
28
  const n = e.meta?.key;
29
29
  if (typeof n == "function") {
30
30
  const o = n(e);
31
31
  if (typeof o == "string" && o.length) return o;
32
32
  } else if (typeof n == "string" && n.length) {
33
- const o = Pt[n.toLowerCase()];
33
+ const o = Kt[n.toLowerCase()];
34
34
  return o ? o(e) : n;
35
35
  }
36
36
  return e.fullPath;
37
37
  }
38
- function me(e, n) {
38
+ function ge(e, n) {
39
39
  const o = e.meta?.keepAlive;
40
40
  return typeof o == "boolean" ? o : n;
41
41
  }
42
- function ve(e, n) {
42
+ function me(e, n) {
43
43
  const o = e.meta?.reuse;
44
44
  return typeof o == "boolean" ? o : n;
45
45
  }
@@ -50,19 +50,19 @@ function Ue(e) {
50
50
  function q(e, n, o) {
51
51
  const l = Ue(e);
52
52
  return {
53
- id: V(e),
53
+ id: N(e),
54
54
  to: e.fullPath,
55
55
  fullPath: e.fullPath,
56
56
  matched: e,
57
- alive: me(e, o),
58
- reusable: ve(e, !1),
57
+ alive: ge(e, o),
58
+ reusable: me(e, !1),
59
59
  closable: l.closable ?? !0,
60
60
  renderKey: typeof n.renderKey == "number" ? n.renderKey : 0,
61
61
  ...l,
62
62
  ...n
63
63
  };
64
64
  }
65
- function de(e, n, o, l) {
65
+ function fe(e, n, o, l) {
66
66
  if (!e.find((p) => p.id === n.id)) {
67
67
  if (o === "next" && l) {
68
68
  const p = e.findIndex((T) => T.id === l);
@@ -76,15 +76,15 @@ function de(e, n, o, l) {
76
76
  }
77
77
  function xe(e, n, o) {
78
78
  if (!n || n <= 0) return;
79
- const l = e.filter((r) => r.alive);
79
+ const l = e.filter((i) => i.alive);
80
80
  for (; l.length > n; ) {
81
- const r = l.shift();
82
- if (!r || r.id === o) continue;
83
- const p = e.findIndex((T) => T.id === r.id);
81
+ const i = l.shift();
82
+ if (!i || i.id === o) continue;
83
+ const p = e.findIndex((T) => T.id === i.id);
84
84
  p > -1 && (e[p].alive = !1);
85
85
  }
86
86
  }
87
- function At(e) {
87
+ function Et(e) {
88
88
  return {
89
89
  to: e.to,
90
90
  title: e.title,
@@ -95,95 +95,95 @@ function At(e) {
95
95
  renderKey: e.renderKey
96
96
  };
97
97
  }
98
- function Kt(e) {
98
+ function It(e) {
99
99
  const n = {};
100
100
  return "title" in e && (n.title = e.title), "tips" in e && (n.tips = e.tips), "icon" in e && (n.icon = e.icon), "tabClass" in e && (n.tabClass = e.tabClass), "closable" in e && (n.closable = e.closable), "renderKey" in e && typeof e.renderKey == "number" && (n.renderKey = e.renderKey), n;
101
101
  }
102
- function Et(e, n = {}) {
103
- const o = Rt(n), l = pe([]), r = $(null), p = dt(), T = $(null), s = k(
104
- () => l.filter((i) => i.alive).map((i) => `${i.id}::${i.renderKey ?? 0}`)
102
+ function xt(e, n = {}) {
103
+ const o = At(n), l = be([]), i = $(null), p = dt(), T = $(null), s = k(
104
+ () => l.filter((r) => r.alive).map((r) => `${r.id}::${r.renderKey ?? 0}`)
105
105
  );
106
106
  let c = !1;
107
- function g(i) {
108
- const b = typeof i.matched == "object" ? i : U(e, i);
107
+ function g(r) {
108
+ const b = typeof r.matched == "object" ? r : V(e, r);
109
109
  return {
110
- key: V(b),
110
+ key: N(b),
111
111
  fullPath: b.fullPath,
112
- alive: me(b, o.keepAlive),
113
- reusable: ve(b, !1),
112
+ alive: ge(b, o.keepAlive),
113
+ reusable: me(b, !1),
114
114
  matched: b
115
115
  };
116
116
  }
117
- function P(i) {
118
- const b = V(i);
117
+ function R(r) {
118
+ const b = N(r);
119
119
  let d = l.find((h) => h.id === b);
120
- return d ? (d.fullPath = i.fullPath, d.to = i.fullPath, d.matched = i, d.alive = me(i, o.keepAlive), d.reusable = ve(i, d.reusable), typeof d.renderKey != "number" && (d.renderKey = 0), Object.assign(d, Ue(i)), d) : (d = q(i, {}, o.keepAlive), de(l, d, o.appendPosition, r.value), xe(l, o.maxAlive, r.value), d);
120
+ return d ? (d.fullPath = r.fullPath, d.to = r.fullPath, d.matched = r, d.alive = ge(r, o.keepAlive), d.reusable = me(r, d.reusable), typeof d.renderKey != "number" && (d.renderKey = 0), Object.assign(d, Ue(r)), d) : (d = q(r, {}, o.keepAlive), fe(l, d, o.appendPosition, i.value), xe(l, o.maxAlive, i.value), d);
121
121
  }
122
- async function D(i, b = !1, d = !0) {
123
- const h = U(e, i), w = V(h), K = r.value === w;
124
- d === "sameTab" && (d = K), d && await L(w, !0), await e[b ? "replace" : "push"](h), K && await y();
122
+ async function x(r, b = !1, d = !0) {
123
+ const h = V(e, r), w = N(h), K = i.value === w;
124
+ d === "sameTab" && (d = K), d && await O(w, !0), await e[b ? "replace" : "push"](h), K && await y();
125
125
  }
126
- function B(i) {
127
- const b = l.findIndex((I) => I.id === i);
126
+ function B(r) {
127
+ const b = l.findIndex((I) => I.id === r);
128
128
  if (b === -1) return o.defaultRoute;
129
- const d = l[b + 1], h = l[b - 1], w = l.find((I) => I.id !== i), K = d || h || w;
129
+ const d = l[b + 1], h = l[b - 1], w = l.find((I) => I.id !== r), K = d || h || w;
130
130
  return K ? K.to : o.defaultRoute;
131
131
  }
132
- async function z(i = r.value, b = {}) {
133
- if (!i) return;
132
+ async function z(r = i.value, b = {}) {
133
+ if (!r) return;
134
134
  if (!b.force && o.keepLastTab && l.length === 1)
135
135
  throw new Error("[RouterTabs] Unable to close the final tab when keepLastTab is true.");
136
- const h = r.value === i && b.redirect !== null, w = h ? b.redirect ?? B(i) : null;
137
- await _(i, { force: b.force }), b.redirect !== null && h && w && await e.replace(w);
136
+ const h = i.value === r && b.redirect !== null, w = h ? b.redirect ?? B(r) : null;
137
+ await _(r, { force: b.force }), b.redirect !== null && h && w && await e.replace(w);
138
138
  }
139
- async function _(i, b = {}) {
140
- const d = l.findIndex((h) => h.id === i);
141
- d !== -1 && (l.splice(d, 1), T.value === i && (T.value = null), r.value === i && (r.value = null, p.value = void 0));
139
+ async function _(r, b = {}) {
140
+ const d = l.findIndex((h) => h.id === r);
141
+ d !== -1 && (l.splice(d, 1), T.value === r && (T.value = null), i.value === r && (i.value = null, p.value = void 0));
142
142
  }
143
- async function L(i = r.value ?? void 0, b = !1) {
144
- if (!i) return;
145
- const d = l.find((w) => w.id === i);
143
+ async function O(r = i.value ?? void 0, b = !1) {
144
+ if (!r) return;
145
+ const d = l.find((w) => w.id === r);
146
146
  if (!d) return;
147
147
  const h = o.keepAlive && d.alive;
148
- h && (d.alive = !1, await N()), d.renderKey = (d.renderKey ?? 0) + 1, h && (d.alive = !0), T.value = i, await N(), b || await N(), T.value = null;
148
+ h && (d.alive = !1, await j()), d.renderKey = (d.renderKey ?? 0) + 1, h && (d.alive = !0), T.value = r, await j(), b || await j(), T.value = null;
149
149
  }
150
- async function te(i = !1) {
150
+ async function te(r = !1) {
151
151
  for (const b of l)
152
- await L(b.id, i);
152
+ await O(b.id, r);
153
153
  }
154
- async function ne(i = o.defaultRoute) {
155
- l.splice(0, l.length), r.value = null, p.value = void 0;
154
+ async function ne(r = o.defaultRoute) {
155
+ l.splice(0, l.length), i.value = null, p.value = void 0;
156
156
  for (const b of o.initialTabs) {
157
- const d = U(e, b.to), h = q(d, b, o.keepAlive);
157
+ const d = V(e, b.to), h = q(d, b, o.keepAlive);
158
158
  l.push(h);
159
159
  }
160
- await e.replace(i);
160
+ await e.replace(r);
161
161
  }
162
162
  async function y() {
163
- const i = r.value;
164
- i && await L(i, !0);
163
+ const r = i.value;
164
+ r && await O(r, !0);
165
165
  }
166
- function G(i) {
167
- return typeof i.matched == "object" ? V(i) : V(U(e, i));
166
+ function G(r) {
167
+ return typeof r.matched == "object" ? N(r) : N(V(e, r));
168
168
  }
169
169
  function M() {
170
- const i = l.find((b) => b.id === r.value);
170
+ const r = l.find((b) => b.id === i.value);
171
171
  return {
172
- tabs: l.map(At),
173
- active: i ? i.to : null
172
+ tabs: l.map(Et),
173
+ active: r ? r.to : null
174
174
  };
175
175
  }
176
- async function S(i) {
177
- c = !0, l.splice(0, l.length), r.value = null, p.value = void 0;
178
- const b = i?.tabs ?? [];
176
+ async function D(r) {
177
+ c = !0, l.splice(0, l.length), i.value = null, p.value = void 0;
178
+ const b = r?.tabs ?? [];
179
179
  for (const h of b)
180
180
  try {
181
- const w = U(e, h.to), K = Kt(h), I = q(w, K, o.keepAlive);
182
- de(l, I, "last", null);
181
+ const w = V(e, h.to), K = It(h), I = q(w, K, o.keepAlive);
182
+ fe(l, I, "last", null);
183
183
  } catch {
184
184
  }
185
185
  c = !1;
186
- const d = i?.active ?? b[b.length - 1]?.to ?? o.defaultRoute;
186
+ const d = r?.active ?? b[b.length - 1]?.to ?? o.defaultRoute;
187
187
  if (d)
188
188
  try {
189
189
  await e.replace(d);
@@ -192,33 +192,33 @@ function Et(e, n = {}) {
192
192
  }
193
193
  return A(
194
194
  () => e.currentRoute.value,
195
- (i) => {
195
+ (r) => {
196
196
  if (c) return;
197
- const b = P(i);
198
- r.value = b.id, p.value = b, xe(l, o.maxAlive, r.value);
197
+ const b = R(r);
198
+ i.value = b.id, p.value = b, xe(l, o.maxAlive, i.value);
199
199
  },
200
200
  { immediate: !0 }
201
- ), o.initialTabs.length && o.initialTabs.forEach((i) => {
202
- const b = U(e, i.to), d = q(b, i, o.keepAlive);
203
- de(l, d, "last", null);
201
+ ), o.initialTabs.length && o.initialTabs.forEach((r) => {
202
+ const b = V(e, r.to), d = q(b, r, o.keepAlive);
203
+ fe(l, d, "last", null);
204
204
  }), {
205
205
  options: o,
206
206
  tabs: l,
207
- activeId: r,
207
+ activeId: i,
208
208
  current: p,
209
209
  includeKeys: s,
210
210
  refreshingKey: T,
211
- openTab: D,
211
+ openTab: x,
212
212
  closeTab: z,
213
213
  removeTab: _,
214
- refreshTab: L,
214
+ refreshTab: O,
215
215
  refreshAll: te,
216
216
  reset: ne,
217
217
  reload: y,
218
218
  getRouteKey: G,
219
219
  matchRoute: g,
220
220
  snapshot: M,
221
- hydrate: S
221
+ hydrate: D
222
222
  };
223
223
  }
224
224
  function De(e) {
@@ -226,9 +226,9 @@ function De(e) {
226
226
  }
227
227
  const ee = Symbol("RouterTabsContext"), Z = "router-tabs:snapshot";
228
228
  function Se(e = {}) {
229
- const { optional: n = !1 } = e, o = Pe(ee, null);
229
+ const { optional: n = !1 } = e, o = Re(ee, null);
230
230
  if (o) return o;
231
- const l = Pe("$tabs", null);
231
+ const l = Re("$tabs", null);
232
232
  if (l) return l;
233
233
  const p = je()?.appContext.config.globalProperties.$tabs;
234
234
  if (p) return p;
@@ -236,8 +236,8 @@ function Se(e = {}) {
236
236
  throw new Error("[RouterTabs] useRouterTabs must be used within <router-tab>.");
237
237
  return null;
238
238
  }
239
- const It = 864e5;
240
- function xt(e) {
239
+ const Dt = 864e5;
240
+ function St(e) {
241
241
  if (typeof document > "u") return null;
242
242
  const n = `${encodeURIComponent(e)}=`, o = document.cookie ? document.cookie.split("; ") : [];
243
243
  for (const l of o)
@@ -249,23 +249,23 @@ function $e(e, n, o) {
249
249
  if (typeof document > "u") return;
250
250
  const {
251
251
  expiresInDays: l = 7,
252
- path: r = "/",
252
+ path: i = "/",
253
253
  domain: p,
254
254
  secure: T,
255
255
  sameSite: s = "lax"
256
256
  } = o, c = [`${encodeURIComponent(e)}=${encodeURIComponent(n)}`];
257
257
  if (l !== 1 / 0) {
258
- const g = new Date(Date.now() + l * It).toUTCString();
258
+ const g = new Date(Date.now() + l * Dt).toUTCString();
259
259
  c.push(`Expires=${g}`);
260
260
  }
261
- r && c.push(`Path=${r}`), p && c.push(`Domain=${p}`), T && c.push("Secure"), s && c.push(`SameSite=${s.charAt(0).toUpperCase()}${s.slice(1)}`), document.cookie = c.join("; ");
261
+ i && c.push(`Path=${i}`), p && c.push(`Domain=${p}`), T && c.push("Secure"), s && c.push(`SameSite=${s.charAt(0).toUpperCase()}${s.slice(1)}`), document.cookie = c.join("; ");
262
262
  }
263
263
  function Be(e, n) {
264
264
  if (typeof document > "u") return;
265
- const { path: o = "/", domain: l } = n, r = [`${encodeURIComponent(e)}=`];
266
- r.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && r.push(`Path=${o}`), l && r.push(`Domain=${l}`), document.cookie = r.join("; ");
265
+ const { path: o = "/", domain: l } = n, i = [`${encodeURIComponent(e)}=`];
266
+ i.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && i.push(`Path=${o}`), l && i.push(`Domain=${l}`), document.cookie = i.join("; ");
267
267
  }
268
- const Dt = (e) => JSON.stringify(e ?? null), St = (e) => {
268
+ const $t = (e) => JSON.stringify(e ?? null), Bt = (e) => {
269
269
  if (!e) return null;
270
270
  try {
271
271
  return JSON.parse(e);
@@ -276,17 +276,17 @@ const Dt = (e) => JSON.stringify(e ?? null), St = (e) => {
276
276
  function Ve(e = {}) {
277
277
  const {
278
278
  cookieKey: n = Z,
279
- serialize: o = Dt,
280
- deserialize: l = St
281
- } = e, r = Se({ optional: !0 }), p = $(!0), T = (s) => {
282
- ge(async () => {
283
- const c = l(xt(n));
279
+ serialize: o = $t,
280
+ deserialize: l = Bt
281
+ } = e, i = Se({ optional: !0 }), p = $(!0), T = (s) => {
282
+ pe(async () => {
283
+ const c = l(St(n));
284
284
  if (c && c.tabs?.length)
285
285
  try {
286
286
  if (p.value = !0, await s.hydrate(c), c.active) {
287
- await N();
288
- const P = s.tabs.find((D) => D.to === c.active);
289
- P && (s.activeId.value = P.id, s.current.value = P);
287
+ await j();
288
+ const R = s.tabs.find((x) => x.to === c.active);
289
+ R && (s.activeId.value = R.id, s.current.value = R);
290
290
  }
291
291
  } finally {
292
292
  p.value = !1;
@@ -294,8 +294,8 @@ function Ve(e = {}) {
294
294
  else if (Object.prototype.hasOwnProperty.call(e, "fallbackRoute"))
295
295
  try {
296
296
  p.value = !0;
297
- const P = e.fallbackRoute ?? s.options.defaultRoute;
298
- await s.reset(P);
297
+ const R = e.fallbackRoute ?? s.options.defaultRoute;
298
+ await s.reset(R);
299
299
  } finally {
300
300
  p.value = !1;
301
301
  }
@@ -324,14 +324,14 @@ function Ve(e = {}) {
324
324
  { deep: !0 }
325
325
  );
326
326
  };
327
- r ? T(r) : ge(() => {
327
+ i ? T(i) : pe(() => {
328
328
  const s = Se({ optional: !0 });
329
329
  s && T(s);
330
330
  });
331
331
  }
332
- const $t = Oe({
332
+ const Mt = Oe({
333
333
  name: "RouterTab",
334
- components: { RouterView: Ct },
334
+ components: { RouterView: Pt },
335
335
  props: {
336
336
  tabs: {
337
337
  type: Array,
@@ -390,7 +390,7 @@ const $t = Oe({
390
390
  const l = o.appContext.app.config.globalProperties.$router;
391
391
  if (!l)
392
392
  throw new Error("[RouterTab] Vue Router is required. Make sure to call app.use(router) before RouterTab.");
393
- const r = Et(l, {
393
+ const i = xt(l, {
394
394
  initialTabs: e.tabs,
395
395
  keepAlive: e.keepAlive,
396
396
  maxAlive: e.maxAlive,
@@ -398,23 +398,23 @@ const $t = Oe({
398
398
  appendPosition: e.append,
399
399
  defaultRoute: e.defaultPage
400
400
  });
401
- bt(ee, r), o.appContext.config.globalProperties.$tabs = r;
401
+ bt(ee, i), o.appContext.config.globalProperties.$tabs = i;
402
402
  const p = k(() => !!o?.slots?.default), T = k(() => !!o?.slots?.start), s = k(() => !!o?.slots?.end), c = $(0), g = k(() => {
403
403
  c.value;
404
404
  const t = {};
405
- return r.tabs.forEach((a) => {
405
+ return i.tabs.forEach((a) => {
406
406
  const f = typeof a.title == "string" ? a.title : String(a.title || oe(a));
407
407
  t[a.id] = f;
408
408
  }), t;
409
409
  });
410
- function P() {
410
+ function R() {
411
411
  c.value++;
412
412
  }
413
- const D = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
413
+ const x = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
414
414
  function z(t, a) {
415
- if (!a || D.has(t)) return;
416
- D.set(t, a);
417
- const f = r.tabs.find((v) => r.getRouteKey(v.to) === t);
415
+ if (!a || x.has(t)) return;
416
+ x.set(t, a);
417
+ const f = i.tabs.find((v) => i.getRouteKey(v.to) === t);
418
418
  if (!f) return;
419
419
  const m = [];
420
420
  if (a.routeTabTitle !== void 0) {
@@ -425,8 +425,8 @@ const $t = Oe({
425
425
  },
426
426
  (u) => {
427
427
  if (u != null) {
428
- const j = String(u);
429
- f.title = j, P();
428
+ const U = String(u);
429
+ f.title = U, R();
430
430
  }
431
431
  },
432
432
  { immediate: !0 }
@@ -440,7 +440,7 @@ const $t = Oe({
440
440
  return u && typeof u == "object" && "value" in u ? u.value : u;
441
441
  },
442
442
  (u) => {
443
- u != null && (f.icon = String(u), P());
443
+ u != null && (f.icon = String(u), R());
444
444
  },
445
445
  { immediate: !0 }
446
446
  );
@@ -453,7 +453,7 @@ const $t = Oe({
453
453
  return u && typeof u == "object" && "value" in u ? u.value : u;
454
454
  },
455
455
  (u) => {
456
- u != null && (f.closable = !!u, P());
456
+ u != null && (f.closable = !!u, R());
457
457
  },
458
458
  { immediate: !0 }
459
459
  );
@@ -466,7 +466,7 @@ const $t = Oe({
466
466
  return u && typeof u == "object" && "value" in u ? u.value : u;
467
467
  },
468
468
  (u) => {
469
- u && typeof u == "object" && (Object.assign(f, u), P());
469
+ u && typeof u == "object" && (Object.assign(f, u), R());
470
470
  },
471
471
  { immediate: !0, deep: !0 }
472
472
  );
@@ -476,9 +476,9 @@ const $t = Oe({
476
476
  }
477
477
  function _(t) {
478
478
  const a = B.get(t);
479
- a && (a.forEach((f) => f()), B.delete(t)), D.delete(t);
479
+ a && (a.forEach((f) => f()), B.delete(t)), x.delete(t);
480
480
  }
481
- function L(t, a) {
481
+ function O(t, a) {
482
482
  t ? t.routeTabTitle !== void 0 || t.routeTabIcon !== void 0 || t.routeTabClosable !== void 0 ? z(a, t) : t.$ && (t.$.routeTabTitle !== void 0 || t.$.routeTabIcon !== void 0 || t.$.routeTabClosable !== void 0) && z(a, t.$) : t === null && _(a);
483
483
  }
484
484
  if (e.cookieKey !== null || e.persistence) {
@@ -487,11 +487,11 @@ const $t = Oe({
487
487
  };
488
488
  e.cookieKey !== null ? t.cookieKey = e.cookieKey || Z : t.cookieKey || (t.cookieKey = Z), Ve(t);
489
489
  }
490
- const te = k(() => De(e.tabTransition)), ne = k(() => De(e.pageTransition)), y = pe({
490
+ const te = k(() => De(e.tabTransition)), ne = k(() => De(e.pageTransition)), y = be({
491
491
  visible: !1,
492
492
  target: null,
493
493
  position: { x: 0, y: 0 }
494
- }), G = $(null), M = $([]), S = $(-1), i = pe({
494
+ }), G = $(null), M = $([]), D = $(-1), r = be({
495
495
  dragging: !1,
496
496
  dragIndex: -1,
497
497
  dropIndex: -1,
@@ -505,44 +505,44 @@ const $t = Oe({
505
505
  "closeOthers"
506
506
  ];
507
507
  function d(t) {
508
- return r.tabs.findIndex((a) => a.id === t);
508
+ return i.tabs.findIndex((a) => a.id === t);
509
509
  }
510
510
  function h(t) {
511
511
  const a = d(t.id);
512
- return a > 0 ? r.tabs.slice(0, a) : [];
512
+ return a > 0 ? i.tabs.slice(0, a) : [];
513
513
  }
514
514
  function w(t) {
515
515
  const a = d(t.id);
516
- return a > -1 ? r.tabs.slice(a + 1) : [];
516
+ return a > -1 ? i.tabs.slice(a + 1) : [];
517
517
  }
518
518
  function K(t) {
519
- return r.tabs.filter((a) => a.id !== t.id);
519
+ return i.tabs.filter((a) => a.id !== t.id);
520
520
  }
521
521
  async function I(t, a) {
522
522
  const f = t.filter((m) => m.closable !== !1);
523
523
  if (f.length) {
524
524
  for (const m of f)
525
- r.activeId.value === m.id ? await r.closeTab(m.id, { redirect: a.to, force: !0 }) : await r.removeTab(m.id, { force: !0 });
526
- r.activeId.value !== a.id && await r.openTab(a.to, !0, !1);
525
+ i.activeId.value === m.id ? await i.closeTab(m.id, { redirect: a.to, force: !0 }) : await i.removeTab(m.id, { force: !0 });
526
+ i.activeId.value !== a.id && await i.openTab(a.to, !0, !1);
527
527
  }
528
528
  }
529
529
  const Fe = {
530
530
  refresh: {
531
531
  label: "Refresh",
532
532
  handler: async ({ target: t }) => {
533
- await r.refreshTab(t.id, !0);
533
+ await i.refreshTab(t.id, !0);
534
534
  }
535
535
  },
536
536
  refreshAll: {
537
537
  label: "Refresh All",
538
538
  handler: async () => {
539
- await r.refreshAll(!0);
539
+ await i.refreshAll(!0);
540
540
  }
541
541
  },
542
542
  close: {
543
543
  label: "Close",
544
544
  handler: async ({ target: t }) => {
545
- await r.closeTab(t.id);
545
+ await i.closeTab(t.id);
546
546
  },
547
547
  enable: ({ target: t }) => ae(t)
548
548
  },
@@ -569,20 +569,22 @@ const $t = Oe({
569
569
  }
570
570
  };
571
571
  function E() {
572
- y.visible = !1, y.target = null, S.value = -1, M.value = [];
572
+ y.visible = !1, y.target = null, D.value = -1, M.value = [];
573
573
  }
574
574
  function He(t, a) {
575
- e.contextmenu && (y.visible = !0, y.target = t, y.position.x = a.clientX, y.position.y = a.clientY, document.addEventListener("click", E, { once: !0 }), N(() => {
576
- We();
575
+ e.contextmenu && (y.target = t, y.position.x = a.clientX, y.position.y = a.clientY, j(() => {
576
+ y.visible = !0, document.addEventListener("click", E, { once: !0 }), j(() => {
577
+ We();
578
+ });
577
579
  }));
578
580
  }
579
581
  function Je(t, a) {
580
582
  const f = typeof t == "string" ? { id: t } : t, m = Fe[f.id], v = f.label ?? m?.label ?? String(f.id), u = f.visible ?? m?.visible ?? !0;
581
583
  if (!(typeof u == "function" ? u(a) : u !== !1)) return null;
582
- const re = f.enable ?? m?.enable ?? !0, ct = typeof re == "function" ? re(a) : re !== !1, Re = f.handler ?? m?.handler;
583
- if (!Re) return null;
584
+ const ie = f.enable ?? m?.enable ?? !0, ct = typeof ie == "function" ? ie(a) : ie !== !1, Ce = f.handler ?? m?.handler;
585
+ if (!Ce) return null;
584
586
  const ft = async () => {
585
- await Promise.resolve(Re(a));
587
+ await Promise.resolve(Ce(a));
586
588
  };
587
589
  return {
588
590
  id: String(f.id),
@@ -593,15 +595,15 @@ const $t = Oe({
593
595
  }
594
596
  const Y = k(() => {
595
597
  if (!y.visible || !y.target || e.contextmenu === !1) return [];
596
- const t = Array.isArray(e.contextmenu) ? e.contextmenu : b, a = { target: y.target, controller: r };
598
+ const t = Array.isArray(e.contextmenu) ? e.contextmenu : b, a = { target: y.target, controller: i };
597
599
  return t.map((f) => Je(f, a)).filter((f) => !!f);
598
600
  });
599
601
  function We() {
600
602
  const t = G.value;
601
603
  if (!t) return;
602
604
  const a = 8, { innerWidth: f, innerHeight: m } = window, v = t.getBoundingClientRect();
603
- let u = y.position.x, j = y.position.y;
604
- v.right > f - a && (u = Math.max(a, f - v.width - a)), v.bottom > m - a && (j = Math.max(a, m - v.height - a)), (u !== y.position.x || j !== y.position.y) && (y.position.x = u, y.position.y = j);
605
+ let u = y.position.x, U = y.position.y;
606
+ v.right > f - a && (u = Math.max(a, f - v.width - a)), v.bottom > m - a && (U = Math.max(a, m - v.height - a)), (u !== y.position.x || U !== y.position.y) && (y.position.x = u, y.position.y = U);
605
607
  }
606
608
  function Ge(t, a) {
607
609
  M.value[a] = t ?? null;
@@ -619,10 +621,10 @@ const $t = Oe({
619
621
  return -1;
620
622
  }
621
623
  function F(t) {
622
- S.value = t, !(t < 0) && N(() => Xe(t));
624
+ D.value = t, !(t < 0) && j(() => Xe(t));
623
625
  }
624
- function Te(t) {
625
- const a = X(S.value, t);
626
+ function he(t) {
627
+ const a = X(D.value, t);
626
628
  a !== -1 && F(a);
627
629
  }
628
630
  function qe(t) {
@@ -648,11 +650,11 @@ const $t = Oe({
648
650
  switch (t.preventDefault(), a) {
649
651
  case "ArrowDown":
650
652
  case "ArrowRight":
651
- Te(1);
653
+ he(1);
652
654
  break;
653
655
  case "ArrowUp":
654
656
  case "ArrowLeft":
655
- Te(-1);
657
+ he(-1);
656
658
  break;
657
659
  case "Home":
658
660
  F(X(-1, 1));
@@ -663,10 +665,10 @@ const $t = Oe({
663
665
  case "Enter":
664
666
  case " ":
665
667
  case "Spacebar": {
666
- const v = S.value;
668
+ const v = D.value;
667
669
  if (v > -1) {
668
670
  const u = f[v];
669
- u.disabled || ke(u);
671
+ u.disabled || Te(u);
670
672
  }
671
673
  break;
672
674
  }
@@ -675,7 +677,7 @@ const $t = Oe({
675
677
  break;
676
678
  }
677
679
  }
678
- async function ke(t) {
680
+ async function Te(t) {
679
681
  t.disabled || (E(), await t.action());
680
682
  }
681
683
  function oe(t) {
@@ -684,82 +686,82 @@ const $t = Oe({
684
686
  function Qe(t) {
685
687
  return g.value[t.id] || oe(t);
686
688
  }
687
- function we(t) {
688
- const a = r.getRouteKey(t), m = r.tabs.find((v) => v.id === a)?.renderKey ?? 0;
689
+ function ke(t) {
690
+ const a = i.getRouteKey(t), m = i.tabs.find((v) => v.id === a)?.renderKey ?? 0;
689
691
  return `${a}::${m}`;
690
692
  }
691
693
  function Ze(t) {
692
- return `${we(t)}::refresh`;
694
+ return `${ke(t)}::refresh`;
693
695
  }
694
696
  function ae(t) {
695
- return !(t.closable === !1 || r.options.keepLastTab && r.tabs.length <= 1);
697
+ return !(t.closable === !1 || i.options.keepLastTab && i.tabs.length <= 1);
696
698
  }
697
699
  async function et(t) {
698
- await r.closeTab(t.id);
700
+ await i.closeTab(t.id);
699
701
  }
700
702
  function tt(t) {
701
703
  if (t.href && typeof window < "u") {
702
704
  t.target && t.target !== "_self" ? window.open(t.href, t.target) : window.location.assign(t.href);
703
705
  return;
704
706
  }
705
- r.activeId.value !== t.id && r.openTab(t.to, !1);
707
+ i.activeId.value !== t.id && i.openTab(t.to, !1);
706
708
  }
707
709
  function nt(t) {
708
710
  return [
709
711
  "router-tab__item",
710
712
  {
711
- "is-active": r.activeId.value === t.id,
713
+ "is-active": i.activeId.value === t.id,
712
714
  "is-closable": ae(t),
713
- "is-dragging": i.dragging && i.dragTab?.id === t.id,
714
- "is-drag-over": i.dropIndex === d(t.id)
715
+ "is-dragging": r.dragging && r.dragTab?.id === t.id,
716
+ "is-drag-over": r.dropIndex === d(t.id)
715
717
  },
716
718
  t.tabClass
717
719
  ];
718
720
  }
719
721
  function ot(t) {
720
- return r.refreshingKey.value === r.getRouteKey(t);
722
+ return i.refreshingKey.value === i.getRouteKey(t);
721
723
  }
722
724
  function at(t, a, f) {
723
- e.sortable && (i.dragging = !0, i.dragIndex = a, i.dragTab = t, f.dataTransfer && (f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", t.id)), n("tab-sort", { tab: t, index: a }));
725
+ e.sortable && (r.dragging = !0, r.dragIndex = a, r.dragTab = t, f.dataTransfer && (f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", t.id)), n("tab-sort", { tab: t, index: a }));
724
726
  }
725
- function rt(t, a) {
726
- !e.sortable || !i.dragging || (a.preventDefault(), a.dataTransfer && (a.dataTransfer.dropEffect = "move"));
727
+ function it(t, a) {
728
+ !e.sortable || !r.dragging || (a.preventDefault(), a.dataTransfer && (a.dataTransfer.dropEffect = "move"));
727
729
  }
728
- function it(t) {
729
- !e.sortable || !i.dragging || (i.dropIndex = t);
730
+ function rt(t) {
731
+ !e.sortable || !r.dragging || (r.dropIndex = t);
730
732
  }
731
733
  function lt() {
732
- !e.sortable || i.dragging;
734
+ !e.sortable || r.dragging;
733
735
  }
734
736
  function st(t, a) {
735
- if (!(!e.sortable || !i.dragging)) {
736
- if (a.preventDefault(), i.dragIndex !== -1 && i.dragIndex !== t) {
737
- const f = r.tabs.splice(i.dragIndex, 1)[0];
738
- r.tabs.splice(t, 0, f), n("tab-sorted", {
737
+ if (!(!e.sortable || !r.dragging)) {
738
+ if (a.preventDefault(), r.dragIndex !== -1 && r.dragIndex !== t) {
739
+ const f = i.tabs.splice(r.dragIndex, 1)[0];
740
+ i.tabs.splice(t, 0, f), n("tab-sorted", {
739
741
  tab: f,
740
- fromIndex: i.dragIndex,
742
+ fromIndex: r.dragIndex,
741
743
  toIndex: t
742
744
  });
743
745
  }
744
- Ce();
746
+ we();
745
747
  }
746
748
  }
747
- function Ce() {
748
- i.dragging = !1, i.dragIndex = -1, i.dropIndex = -1, i.dragTab = null;
749
+ function we() {
750
+ r.dragging = !1, r.dragIndex = -1, r.dropIndex = -1, r.dragTab = null;
749
751
  }
750
- ge(() => {
752
+ pe(() => {
751
753
  document.addEventListener("keydown", E);
752
754
  }), pt(() => {
753
755
  document.removeEventListener("keydown", E), o.appContext.config.globalProperties.$tabs = null, B.forEach((t) => {
754
756
  t.forEach((a) => a());
755
- }), B.clear(), D.clear();
757
+ }), B.clear(), x.clear();
756
758
  }), A(
757
759
  () => e.keepAlive,
758
760
  (t) => {
759
- r.options.keepAlive = t;
761
+ i.options.keepAlive = t;
760
762
  }
761
763
  ), A(
762
- () => r.activeId.value,
764
+ () => i.activeId.value,
763
765
  () => E()
764
766
  ), A(
765
767
  () => e.contextmenu,
@@ -770,21 +772,24 @@ const $t = Oe({
770
772
  () => Y.value.length,
771
773
  (t) => {
772
774
  y.visible && t === 0 && E();
773
- }
775
+ },
776
+ { flush: "post" }
777
+ // Run after component updates to prevent blocking render
774
778
  ), A(Y, (t) => {
775
- if (M.value = new Array(t.length).fill(null), !y.visible) return;
779
+ if (!y.visible) return;
780
+ M.value = new Array(t.length).fill(null);
776
781
  const a = X(-1, 1, t);
777
782
  F(a);
778
- }), A(
783
+ }, { flush: "post" }), A(
779
784
  () => y.visible,
780
785
  (t) => {
781
- t || (S.value = -1, M.value = []);
786
+ t || (D.value = -1, M.value = []);
782
787
  }
783
788
  );
784
- const ut = r.includeKeys;
789
+ const ut = i.includeKeys;
785
790
  return {
786
- controller: r,
787
- tabs: r.tabs,
791
+ controller: i,
792
+ tabs: i.tabs,
788
793
  includeKeys: ut,
789
794
  tabTransitionProps: te,
790
795
  pageTransitionProps: ne,
@@ -793,7 +798,7 @@ const $t = Oe({
793
798
  close: et,
794
799
  context: y,
795
800
  menuItems: Y,
796
- handleMenuAction: ke,
801
+ handleMenuAction: Te,
797
802
  showContextMenu: He,
798
803
  hideContextMenu: E,
799
804
  getTabTitle: oe,
@@ -803,54 +808,54 @@ const $t = Oe({
803
808
  hasStartSlot: T,
804
809
  hasEndSlot: s,
805
810
  onDragStart: at,
806
- onDragOver: rt,
807
- onDragEnter: it,
811
+ onDragOver: it,
812
+ onDragEnter: rt,
808
813
  onDragLeave: lt,
809
814
  onDrop: st,
810
- onDragEnd: Ce,
815
+ onDragEnd: we,
811
816
  setupComponentWatching: z,
812
817
  cleanupComponentWatching: _,
813
- handleComponentRef: L,
818
+ handleComponentRef: O,
814
819
  getReactiveTabTitle: Qe,
815
- getComponentCacheKey: we,
820
+ getComponentCacheKey: ke,
816
821
  getRefreshComponentKey: Ze,
817
- triggerTabUpdate: P,
822
+ triggerTabUpdate: R,
818
823
  menuRef: G,
819
- highlightedIndex: S,
824
+ highlightedIndex: D,
820
825
  setMenuItemRef: Ge,
821
826
  onMenuKeydown: qe,
822
827
  highlightMenuIndex: F
823
828
  };
824
829
  }
825
- }), Bt = (e, n) => {
830
+ }), Lt = (e, n) => {
826
831
  const o = e.__vccOpts || e;
827
- for (const [l, r] of n)
828
- o[l] = r;
832
+ for (const [l, i] of n)
833
+ o[l] = i;
829
834
  return o;
830
- }, Mt = { class: "router-tab" }, Lt = { class: "router-tab__header" }, jt = { class: "router-tab__scroll" }, Ot = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], Ut = ["title"], Vt = ["onClick"], Nt = { class: "router-tab__container" }, zt = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
831
- function _t(e, n, o, l, r, p) {
835
+ }, jt = { class: "router-tab" }, Ot = { class: "router-tab__header" }, Ut = { class: "router-tab__scroll" }, Vt = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], Nt = ["title"], zt = ["onClick"], _t = { class: "router-tab__container" }, Yt = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
836
+ function Ft(e, n, o, l, i, p) {
832
837
  const T = gt("RouterView");
833
- return C(), x("div", Mt, [
834
- O("header", Lt, [
835
- O("div", {
838
+ return P(), S("div", jt, [
839
+ L("header", Ot, [
840
+ L("div", {
836
841
  class: H(["router-tab__slot-start", { "has-content": e.hasStartSlot }])
837
842
  }, [
838
- le(e.$slots, "start")
843
+ re(e.$slots, "start")
839
844
  ], 2),
840
- O("div", jt, [
841
- Ae(mt, se({
845
+ L("div", Ut, [
846
+ Pe(vt, le({
842
847
  tag: "ul",
843
848
  class: "router-tab__nav"
844
849
  }, e.tabTransitionProps), {
845
- default: ue(() => [
846
- (C(!0), x(Ke, null, Ee(e.tabs, (s, c) => (C(), x("li", {
850
+ default: se(() => [
851
+ (P(!0), S(Ae, null, Ke(e.tabs, (s, c) => (P(), S("li", {
847
852
  key: s.id,
848
853
  class: H(e.buildTabClass(s)),
849
854
  "data-title": e.getTabTitle(s),
850
855
  draggable: e.sortable,
851
856
  onClick: (g) => e.activate(s),
852
- onAuxclick: ce((g) => e.close(s), ["middle", "prevent"]),
853
- onContextmenu: ce((g) => e.showContextMenu(s, g), ["prevent"]),
857
+ onAuxclick: ue((g) => e.close(s), ["middle", "prevent"]),
858
+ onContextmenu: ue((g) => e.showContextMenu(s, g), ["prevent"]),
854
859
  onDragstart: (g) => e.onDragStart(s, c, g),
855
860
  onDragover: (g) => e.onDragOver(c, g),
856
861
  onDragenter: (g) => e.onDragEnter(c),
@@ -858,55 +863,55 @@ function _t(e, n, o, l, r, p) {
858
863
  onDrop: (g) => e.onDrop(c, g),
859
864
  onDragend: n[1] || (n[1] = (...g) => e.onDragEnd && e.onDragEnd(...g))
860
865
  }, [
861
- s.icon ? (C(), x("i", {
866
+ s.icon ? (P(), S("i", {
862
867
  key: 0,
863
868
  class: H(["router-tab__item-icon", s.icon])
864
- }, null, 2)) : ie("", !0),
865
- O("span", {
869
+ }, null, 2)) : Ee("", !0),
870
+ L("span", {
866
871
  class: "router-tab__item-title",
867
872
  title: e.getReactiveTabTitle(s)
868
- }, Ie(e.getReactiveTabTitle(s)), 9, Ut),
869
- e.isClosable(s) ? (C(), x("a", {
873
+ }, Ie(e.getReactiveTabTitle(s)), 9, Nt),
874
+ e.isClosable(s) ? (P(), S("a", {
870
875
  key: 1,
871
876
  class: "router-tab__item-close",
872
- onClick: ce((g) => e.close(s), ["stop"])
873
- }, null, 8, Vt)) : ie("", !0)
874
- ], 42, Ot))), 128))
877
+ onClick: ue((g) => e.close(s), ["stop"])
878
+ }, null, 8, zt)) : Ee("", !0)
879
+ ], 42, Vt))), 128))
875
880
  ]),
876
881
  _: 1
877
882
  }, 16)
878
883
  ]),
879
- O("div", {
884
+ L("div", {
880
885
  class: H(["router-tab__slot-end", { "has-content": e.hasEndSlot }])
881
886
  }, [
882
- le(e.$slots, "end")
887
+ re(e.$slots, "end")
883
888
  ], 2)
884
889
  ]),
885
- O("div", Nt, [
886
- Ae(T, null, {
887
- default: ue((s) => [
888
- e.hasCustomSlot ? le(e.$slots, "default", vt(se({ key: 0 }, {
890
+ L("div", _t, [
891
+ Pe(T, null, {
892
+ default: se((s) => [
893
+ e.hasCustomSlot ? re(e.$slots, "default", yt(le({ key: 0 }, {
889
894
  ...s,
890
895
  controller: e.controller,
891
896
  // Expose a ref binder so custom slots can keep reactivity
892
897
  pageRef: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route))
893
- }))) : (C(), J(yt, se({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
894
- default: ue(() => [
895
- e.isRefreshing(s.route) ? (C(), J(fe(s.Component), {
898
+ }))) : (P(), J(ht, le({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
899
+ default: se(() => [
900
+ e.isRefreshing(s.route) ? (P(), J(ce(s.Component), {
896
901
  key: e.getRefreshComponentKey(s.route),
897
902
  ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
898
903
  class: "router-tab-page"
899
- })) : e.controller.options.keepAlive ? (C(), J(ht, {
904
+ })) : e.controller.options.keepAlive ? (P(), J(Tt, {
900
905
  key: 1,
901
906
  include: e.includeKeys,
902
907
  max: e.controller.options.maxAlive || void 0
903
908
  }, [
904
- (C(), J(fe(s.Component), {
909
+ (P(), J(ce(s.Component), {
905
910
  key: e.getComponentCacheKey(s.route),
906
911
  ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
907
912
  class: "router-tab-page"
908
913
  }))
909
- ], 1032, ["include", "max"])) : (C(), J(fe(s.Component), {
914
+ ], 1032, ["include", "max"])) : (P(), J(ce(s.Component), {
910
915
  key: e.getComponentCacheKey(s.route),
911
916
  ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
912
917
  class: "router-tab-page"
@@ -918,15 +923,14 @@ function _t(e, n, o, l, r, p) {
918
923
  _: 3
919
924
  })
920
925
  ]),
921
- e.context.visible && e.context.target ? (C(), x("div", {
922
- key: 0,
926
+ mt(L("div", {
923
927
  ref: "menuRef",
924
928
  class: "router-tab__contextmenu",
925
929
  role: "menu",
926
930
  onKeydown: n[2] || (n[2] = (...s) => e.onMenuKeydown && e.onMenuKeydown(...s)),
927
- style: Tt({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
931
+ style: kt({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
928
932
  }, [
929
- (C(!0), x(Ke, null, Ee(e.menuItems, (s, c) => (C(), x("a", {
933
+ (P(!0), S(Ae, null, Ke(e.menuItems, (s, c) => (P(), S("a", {
930
934
  key: s.id,
931
935
  role: "menuitem",
932
936
  class: H(["router-tab__contextmenu-item", { "is-focused": c === e.highlightedIndex }]),
@@ -937,14 +941,16 @@ function _t(e, n, o, l, r, p) {
937
941
  ref: (g) => e.setMenuItemRef(g, c),
938
942
  onMouseenter: (g) => !s.disabled && e.highlightMenuIndex(c),
939
943
  onClick: (g) => e.handleMenuAction(s)
940
- }, Ie(s.label), 43, zt))), 128))
941
- ], 36)) : ie("", !0)
944
+ }, Ie(s.label), 43, Yt))), 128))
945
+ ], 36), [
946
+ [wt, e.context.visible && e.context.target]
947
+ ])
942
948
  ]);
943
949
  }
944
- const Me = /* @__PURE__ */ Bt($t, [["render", _t]]), Yt = {
950
+ const Me = /* @__PURE__ */ Lt(Mt, [["render", Ft]]), Ht = {
945
951
  class: "router-tabs",
946
952
  "aria-hidden": "true"
947
- }, be = /* @__PURE__ */ Oe({
953
+ }, de = /* @__PURE__ */ Oe({
948
954
  name: "RouterTabs",
949
955
  __name: "RouterTabs",
950
956
  props: {
@@ -959,11 +965,11 @@ const Me = /* @__PURE__ */ Bt($t, [["render", _t]]), Yt = {
959
965
  fallbackRoute: {}
960
966
  },
961
967
  setup(e) {
962
- return Ve(e), (o, l) => (C(), x("span", Yt));
968
+ return Ve(e), (o, l) => (P(), S("span", Ht));
963
969
  }
964
- }), Ne = "tab-theme-style", ze = "tab-theme-primary-color", Ft = "system", _e = "(prefers-color-scheme: dark)";
970
+ }), Ne = "tab-theme-style", ze = "tab-theme-primary-color", Jt = "system", _e = "(prefers-color-scheme: dark)";
965
971
  let W = null;
966
- const R = {
972
+ const C = {
967
973
  primary: "#034960",
968
974
  background: "#ffffff",
969
975
  text: "#1e293b",
@@ -977,7 +983,7 @@ const R = {
977
983
  activeButtonBackground: "#034960",
978
984
  activeButtonColor: "#ffffff",
979
985
  iconColor: "#475569"
980
- }, Ht = {
986
+ }, Wt = {
981
987
  primary: "#38bdf8",
982
988
  background: "#0f172a",
983
989
  text: "#f1f5f9",
@@ -993,7 +999,7 @@ const R = {
993
999
  activeButtonColor: "#0f172a",
994
1000
  iconColor: "#cbd5e1"
995
1001
  };
996
- function Jt(e) {
1002
+ function Gt(e) {
997
1003
  if (typeof window > "u") return null;
998
1004
  const n = window.localStorage.getItem(e);
999
1005
  if (!n) return null;
@@ -1004,8 +1010,8 @@ function Jt(e) {
1004
1010
  return null;
1005
1011
  }
1006
1012
  }
1007
- function ye(e) {
1008
- typeof document > "u" || (document.documentElement.style.setProperty("--router-tab-primary", e.primary ?? R.primary), document.documentElement.style.setProperty("--router-tab-header-bg", e.headerBackground ?? R.headerBackground), document.documentElement.style.setProperty("--router-tab-background", e.background ?? R.background), document.documentElement.style.setProperty("--router-tab-active-background", e.activeBackground ?? R.activeBackground), document.documentElement.style.setProperty("--router-tab-text", e.text ?? R.text), document.documentElement.style.setProperty("--router-tab-active-text", e.activeText ?? R.activeText), document.documentElement.style.setProperty("--router-tab-border", e.border ?? R.border), document.documentElement.style.setProperty("--router-tab-active-border", e.activeBorder ?? R.activeBorder), document.documentElement.style.setProperty("--router-tab-button-color", e.buttonColor ?? R.buttonColor), document.documentElement.style.setProperty("--router-tab-active-button-color", e.activeButtonColor ?? R.activeButtonColor), document.documentElement.style.setProperty("--router-tab-button-background", e.buttonBackground ?? R.buttonBackground), document.documentElement.style.setProperty("--router-tab-active-button-background", e.activeButtonBackground ?? R.activeButtonBackground), document.documentElement.style.setProperty("--router-tab-icon-color", e.iconColor ?? R.iconColor));
1013
+ function ve(e) {
1014
+ typeof document > "u" || (document.documentElement.style.setProperty("--router-tab-primary", e.primary ?? C.primary), document.documentElement.style.setProperty("--router-tab-header-bg", e.headerBackground ?? C.headerBackground), document.documentElement.style.setProperty("--router-tab-background", e.background ?? C.background), document.documentElement.style.setProperty("--router-tab-active-background", e.activeBackground ?? C.activeBackground), document.documentElement.style.setProperty("--router-tab-text", e.text ?? C.text), document.documentElement.style.setProperty("--router-tab-active-text", e.activeText ?? C.activeText), document.documentElement.style.setProperty("--router-tab-border", e.border ?? C.border), document.documentElement.style.setProperty("--router-tab-active-border", e.activeBorder ?? C.activeBorder), document.documentElement.style.setProperty("--router-tab-button-color", e.buttonColor ?? C.buttonColor), document.documentElement.style.setProperty("--router-tab-active-button-color", e.activeButtonColor ?? C.activeButtonColor), document.documentElement.style.setProperty("--router-tab-button-background", e.buttonBackground ?? C.buttonBackground), document.documentElement.style.setProperty("--router-tab-active-button-background", e.activeButtonBackground ?? C.activeButtonBackground), document.documentElement.style.setProperty("--router-tab-icon-color", e.iconColor ?? C.iconColor));
1009
1015
  }
1010
1016
  function Ye(e) {
1011
1017
  if (typeof document > "u") return;
@@ -1014,40 +1020,40 @@ function Ye(e) {
1014
1020
  };
1015
1021
  W && (o.removeEventListener("change", W), W = null), e === "system" ? (l(), W = () => l(), o.addEventListener("change", W)) : n.dataset.theme = e;
1016
1022
  }
1017
- function Wt(e = {}) {
1023
+ function Xt(e = {}) {
1018
1024
  if (typeof window > "u") return;
1019
1025
  const {
1020
1026
  styleKey: n = Ne,
1021
1027
  primaryKey: o = ze,
1022
- defaultStyle: l = Ft,
1023
- defaultPrimary: r
1028
+ defaultStyle: l = Jt,
1029
+ defaultPrimary: i
1024
1030
  } = e, p = window.localStorage.getItem(n) ?? l;
1025
1031
  Ye(p);
1026
- const s = p === "dark" || p === "system" && window.matchMedia(_e).matches ? { ...Ht } : { ...R };
1027
- r && (s.primary = r);
1028
- const c = Jt(o);
1029
- ye(c ? {
1032
+ const s = p === "dark" || p === "system" && window.matchMedia(_e).matches ? { ...Wt } : { ...C };
1033
+ i && (s.primary = i);
1034
+ const c = Gt(o);
1035
+ ve(c ? {
1030
1036
  ...s,
1031
1037
  ...c
1032
1038
  } : s);
1033
1039
  }
1034
- function qt(e, n) {
1040
+ function Zt(e, n) {
1035
1041
  if (typeof window > "u") return;
1036
1042
  const o = n?.styleKey ?? Ne;
1037
1043
  window.localStorage.setItem(o, e), Ye(e);
1038
1044
  }
1039
- function Qt(e, n) {
1045
+ function en(e, n) {
1040
1046
  if (typeof window > "u") return;
1041
1047
  const o = n?.primaryKey ?? ze;
1042
- window.localStorage.setItem(o, JSON.stringify(e)), ye(e);
1048
+ window.localStorage.setItem(o, JSON.stringify(e)), ve(e);
1043
1049
  }
1044
1050
  function Q(e, n) {
1045
- if (kt(e)) {
1046
- const l = !wt(e);
1051
+ if (Ct(e)) {
1052
+ const l = !Rt(e);
1047
1053
  return {
1048
1054
  value: e,
1049
- update: l ? (r) => {
1050
- e.value = r;
1055
+ update: l ? (i) => {
1056
+ e.value = i;
1051
1057
  } : () => {
1052
1058
  }
1053
1059
  };
@@ -1068,57 +1074,57 @@ function Q(e, n) {
1068
1074
  }
1069
1075
  };
1070
1076
  }
1071
- function he(e = {}) {
1072
- const n = Q(e.title, "Untitled"), o = Q(e.icon, ""), l = Q(e.closable, !0), r = Q(e.meta, {});
1077
+ function ye(e = {}) {
1078
+ const n = Q(e.title, "Untitled"), o = Q(e.icon, ""), l = Q(e.closable, !0), i = Q(e.meta, {});
1073
1079
  return {
1074
1080
  routeTabTitle: n.value,
1075
1081
  routeTabIcon: o.value,
1076
1082
  routeTabClosable: l.value,
1077
- routeTabMeta: r.value,
1083
+ routeTabMeta: i.value,
1078
1084
  updateTitle: n.update,
1079
1085
  updateIcon: o.update,
1080
1086
  updateClosable: l.update,
1081
- updateMeta: r.update
1087
+ updateMeta: i.update
1082
1088
  };
1083
1089
  }
1084
- function Zt(e, n = "Page") {
1085
- return he({
1090
+ function tn(e, n = "Page") {
1091
+ return ye({
1086
1092
  title: k(() => e.value ? "Loading..." : n),
1087
1093
  icon: k(() => e.value ? "mdi-loading mdi-spin" : "mdi-page"),
1088
1094
  closable: k(() => !e.value)
1089
1095
  });
1090
1096
  }
1091
- function en(e, n = "Page", o = "mdi-page") {
1092
- return he({
1097
+ function nn(e, n = "Page", o = "mdi-page") {
1098
+ return ye({
1093
1099
  title: k(() => e.value > 0 ? `${n} (${e.value})` : n),
1094
1100
  icon: k(() => e.value > 0 ? "mdi-bell-badge" : o)
1095
1101
  });
1096
1102
  }
1097
- function tn(e, n = "Page") {
1103
+ function on(e, n = "Page") {
1098
1104
  const o = {
1099
1105
  normal: { suffix: "", icon: "mdi-page" },
1100
1106
  loading: { suffix: " - Loading", icon: "mdi-loading mdi-spin" },
1101
1107
  error: { suffix: " - Error", icon: "mdi-alert" },
1102
1108
  success: { suffix: " - Success", icon: "mdi-check-circle" }
1103
1109
  };
1104
- return he({
1110
+ return ye({
1105
1111
  title: k(() => n + o[e.value].suffix),
1106
1112
  icon: k(() => o[e.value].icon),
1107
1113
  closable: k(() => e.value !== "loading")
1108
1114
  });
1109
1115
  }
1110
1116
  let Le = !1;
1111
- const nn = {
1117
+ const an = {
1112
1118
  install(e, n) {
1113
1119
  if (Le) return;
1114
1120
  Le = !0;
1115
1121
  const {
1116
1122
  initTheme: o = !0,
1117
1123
  themeOptions: l,
1118
- componentName: r = Me.name || "RouterTab",
1119
- tabsComponentName: p = be.name || "RouterTabs"
1124
+ componentName: i = Me.name || "RouterTab",
1125
+ tabsComponentName: p = de.name || "RouterTabs"
1120
1126
  } = n ?? {};
1121
- o && Wt(l ?? {}), e.component(r, Me), e.component(p, be), p.toLowerCase() !== "router-tabs" && e.component("router-tabs", be), Object.defineProperty(e.config.globalProperties, "$tabs", {
1127
+ o && Xt(l ?? {}), e.component(i, Me), e.component(p, de), p.toLowerCase() !== "router-tabs" && e.component("router-tabs", de), Object.defineProperty(e.config.globalProperties, "$tabs", {
1122
1128
  configurable: !0,
1123
1129
  enumerable: !1,
1124
1130
  get() {
@@ -1132,16 +1138,16 @@ const nn = {
1132
1138
  };
1133
1139
  export {
1134
1140
  Me as RouterTab,
1135
- be as RouterTabs,
1136
- nn as default,
1137
- Wt as initRouterTabsTheme,
1141
+ de as RouterTabs,
1142
+ an as default,
1143
+ Xt as initRouterTabsTheme,
1138
1144
  ee as routerTabsKey,
1139
- Qt as setRouterTabsPrimary,
1140
- qt as setRouterTabsTheme,
1141
- Zt as useLoadingTab,
1142
- en as useNotificationTab,
1143
- he as useReactiveTab,
1145
+ en as setRouterTabsPrimary,
1146
+ Zt as setRouterTabsTheme,
1147
+ tn as useLoadingTab,
1148
+ nn as useNotificationTab,
1149
+ ye as useReactiveTab,
1144
1150
  Se as useRouterTabs,
1145
1151
  Ve as useRouterTabsPersistence,
1146
- tn as useStatusTab
1152
+ on as useStatusTab
1147
1153
  };