vue3-router-tab 1.3.2 → 1.3.4

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