@lax-wp/design-system 0.13.74 → 0.13.75

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,29 +1,29 @@
1
- import { jsx as n, jsxs as ke } from "react/jsx-runtime";
2
- import { useSensors as Rt, useSensor as Ze, MouseSensor as zt, TouchSensor as Wt, DndContext as Pt, closestCenter as Ft } from "@dnd-kit/core";
3
- import { SortableContext as Bt, horizontalListSortingStrategy as jt, arrayMove as Ke } from "@dnd-kit/sortable";
4
- import { Dropdown as ye } from "antd";
1
+ import { jsx as n, jsxs as ve } from "react/jsx-runtime";
2
+ import { useSensors as Xt, useSensor as it, MouseSensor as qt, TouchSensor as Qt, DndContext as Kt, closestCenter as Zt } from "@dnd-kit/core";
3
+ import { SortableContext as en, horizontalListSortingStrategy as tn, arrayMove as lt } from "@dnd-kit/sortable";
4
+ import { Dropdown as De } from "antd";
5
5
  import l from "../../../_virtual/index.es.js";
6
- import { useState as w, useRef as Te, useMemo as M, useCallback as v, useEffect as j } from "react";
7
- import { useTranslation as $t } from "react-i18next";
8
- import et from "@mui/icons-material/MoreHorizOutlined";
9
- import { INITIAL_TAB_OPTION_CONFIG as At } from "./types.es.js";
10
- import { formatCount as Gt } from "../../../utils/formatters.es.js";
11
- import { useTabConfig as Yt } from "../../../providers/design-system-provider/hooks.es.js";
12
- import { useTextWidth as Jt } from "../../../hooks/useTextWidth.es.js";
13
- import qt from "../../button/IconButton.es.js";
14
- import { OptionButton as y } from "../../buttons/option-button/OptionButton.es.js";
15
- import { SearchBar as Qt } from "../../forms/search-bar/SearchBar.es.js";
16
- import Ce from "../../tooltip/Tooltip.es.js";
17
- import { EditIcon as Xt } from "../../icons/EditIcon.es.js";
18
- import { toast as Zt } from "react-toastify";
19
- import { TabSwitch as Se } from "./TabSwitch.es.js";
20
- import { PinIcon as se, ArrowOutwardIcon as Kt, ArrowUpwardIcon as en, ArrowDownwardIcon as tn, ContentCopyIcon as nn, VisibilityOffIcon as sn, VisibilityIcon as on, UnpinFilledIcon as an, DeleteIcon as rn } from "../../icon/icons.generated.es.js";
21
- import { SortableTab as tt } from "./SortableTab.es.js";
22
- import { DropableWrapper as ln } from "./DropableWrapper.es.js";
23
- import { MoreButton as cn } from "./MoreButton.es.js";
24
- import { TabOptions as dn } from "./TabOptions.es.js";
25
- import { TabDragOverlay as un } from "./TabDragOverlay.es.js";
26
- const mn = () => Math.random().toString(16).slice(2, 13), oe = [
6
+ import { useState as g, useRef as re, useMemo as U, useCallback as C, useLayoutEffect as nn, useEffect as ae } from "react";
7
+ import { useTranslation as on } from "react-i18next";
8
+ import ct from "@mui/icons-material/MoreHorizOutlined";
9
+ import { INITIAL_TAB_OPTION_CONFIG as sn } from "./types.es.js";
10
+ import { formatCount as rn } from "../../../utils/formatters.es.js";
11
+ import { useTabConfig as an } from "../../../providers/design-system-provider/hooks.es.js";
12
+ import { useTextWidth as ln } from "../../../hooks/useTextWidth.es.js";
13
+ import cn from "../../button/IconButton.es.js";
14
+ import { OptionButton as k } from "../../buttons/option-button/OptionButton.es.js";
15
+ import { SearchBar as dn } from "../../forms/search-bar/SearchBar.es.js";
16
+ import Oe from "../../tooltip/Tooltip.es.js";
17
+ import { EditIcon as un } from "../../icons/EditIcon.es.js";
18
+ import { toast as mn } from "react-toastify";
19
+ import { TabSwitch as Ve } from "./TabSwitch.es.js";
20
+ import { PinIcon as ie, ArrowOutwardIcon as pn, ArrowUpwardIcon as fn, ArrowDownwardIcon as hn, ContentCopyIcon as bn, VisibilityOffIcon as xn, VisibilityIcon as gn, UnpinFilledIcon as wn, DeleteIcon as kn } from "../../icon/icons.generated.es.js";
21
+ import { SortableTab as dt } from "./SortableTab.es.js";
22
+ import { DropableWrapper as yn } from "./DropableWrapper.es.js";
23
+ import { MoreButton as Tn } from "./MoreButton.es.js";
24
+ import { TabOptions as Nn } from "./TabOptions.es.js";
25
+ import { TabDragOverlay as Sn } from "./TabDragOverlay.es.js";
26
+ const _n = () => Math.random().toString(16).slice(2, 13), le = [
27
27
  "[&_.ant-dropdown-menu-item]:!outline-none",
28
28
  "[&_.ant-dropdown-menu-submenu-title]:!outline-none",
29
29
  "[&_.ant-dropdown-menu-item:focus-visible_.option-button-inner]:ring-2",
@@ -34,15 +34,15 @@ const mn = () => Math.random().toString(16).slice(2, 13), oe = [
34
34
  "[&_.ant-dropdown-menu-submenu-title:focus-visible_.option-button-inner]:ring-primary-500",
35
35
  "[&_.ant-dropdown-menu-submenu-title:focus-visible_.option-button-inner]:bg-gray-50",
36
36
  "[&_.ant-dropdown-menu-submenu-title:focus-visible_.option-button-inner]:dark:bg-black-600"
37
- ].join(" ");
38
- let Ne = null;
39
- const Ie = (T) => {
40
- T ? (Ne = document.activeElement, setTimeout(() => {
37
+ ].join(" "), Cn = 26, ut = 6, In = 20, En = 32, vn = 24, Dn = 37, On = "(min-width: 640px)", Vn = 2, Ln = 'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif';
38
+ let Le = null;
39
+ const Me = (b) => {
40
+ b ? (Le = document.activeElement, setTimeout(() => {
41
41
  document.querySelector(
42
42
  ".row-option-cell .ant-dropdown-menu-item:not(.ant-dropdown-menu-item-disabled), .row-option-cell .ant-dropdown-menu-submenu-title"
43
43
  )?.focus();
44
44
  }, 50)) : setTimeout(() => {
45
- Ne?.focus(), Ne = null;
45
+ Le?.focus(), Le = null;
46
46
  }, 0);
47
47
  }, c = {
48
48
  SELECT: "Select",
@@ -55,318 +55,328 @@ const Ie = (T) => {
55
55
  PIN: "Pin",
56
56
  UNPIN: "Unpin",
57
57
  EDIT: "Edit"
58
- }, Pn = ({
59
- variant: T = "default",
60
- tabs: _ = [],
61
- activeTab: r,
62
- onTabClick: nt,
58
+ }, ro = ({
59
+ variant: b = "default",
60
+ tabs: y = [],
61
+ activeTab: i,
62
+ onTabClick: mt,
63
63
  suffixRecord: $,
64
- isLoading: st,
65
- size: O = "md",
66
- className: ve,
67
- draggable: E = !1,
68
- showAllItems: A = !1,
69
- copyLink: ot = !1,
70
- isDisabled: at = !1,
71
- color: ae = "light",
72
- iconsOnly: rt = !1,
73
- tabIcons: re = {},
74
- height: it = "h-6",
75
- fullWidth: ie = !1,
76
- fitContentWidth: lt = !1,
77
- disableAnimation: ct = !1,
78
- onEdit: _e,
79
- onDelete: Oe,
80
- onCopyLink: Ee,
81
- allowPin: C = !1,
82
- isFullWidth: G = !1,
83
- rightSection: H,
84
- initialTabs: dt,
85
- tabConfig: ut,
86
- onTabConfigChange: De,
87
- onTabsChange: Ve,
88
- parentContainer: mt = document.body,
89
- tabKey: S,
90
- linkConfig: m,
91
- showTabOptions: pt = !0
64
+ isLoading: pt,
65
+ size: T = "md",
66
+ className: Ue,
67
+ draggable: I = !1,
68
+ showAllItems: G = !1,
69
+ copyLink: ft = !1,
70
+ isDisabled: ht = !1,
71
+ color: ce = "light",
72
+ iconsOnly: E = !1,
73
+ tabIcons: Y = {},
74
+ height: bt = "h-6",
75
+ fullWidth: de = !1,
76
+ fitContentWidth: ue = !1,
77
+ disableAnimation: xt = !1,
78
+ onEdit: He,
79
+ onDelete: Re,
80
+ onCopyLink: Ae,
81
+ allowPin: v = !1,
82
+ isFullWidth: D = !1,
83
+ rightSection: P,
84
+ initialTabs: gt,
85
+ tabConfig: wt,
86
+ onTabConfigChange: Pe,
87
+ onTabsChange: Fe,
88
+ parentContainer: kt = document.body,
89
+ tabKey: N,
90
+ linkConfig: p,
91
+ showTabOptions: me = !0
92
92
  }) => {
93
- const x = Yt(), Le = S ? x?.getTabSettings(S) : void 0, le = dt ?? Le?.tab_items, Y = ut ?? Le?.tab_options, [ce, ft] = w(""), [I, J] = w(!1), [U, bt] = w(0), [d, de] = w([]), [q, ht] = w([]), [xt, Q] = w(null), [D, X] = w(null), [gt, Me] = w(!1), [He, Ue] = w(
94
- Y ?? At
95
- ), [ue, wt] = w(""), [Re, kt] = w("contains"), { showCounts: k, lockOrder: R, sortOrder: me } = He, { t: u } = $t(), Z = Te(null), yt = Te(null), ze = Te(U), { measureText: z } = Jt(), W = M(() => mn(), []), Tt = Rt(
96
- Ze(zt, { activationConstraint: { distance: 5 } }),
97
- Ze(Wt, { activationConstraint: { delay: 300, tolerance: 5 } })
98
- ), p = M(() => $ && Object.fromEntries(
93
+ const h = an(), Be = N ? h?.getTabSettings(N) : void 0, pe = gt ?? Be?.tab_items, J = wt ?? Be?.tab_options, [fe, yt] = g(""), [O, X] = g(!1), [he, ze] = g(0), [m, be] = g([]), [q, Tt] = g([]), [Nt, Q] = g(null), [H, K] = g(null), [St, We] = g(!1), [je, $e] = g(
94
+ J ?? sn
95
+ ), [xe, _t] = g(""), [Ge, Ct] = g("contains"), { showCounts: S, lockOrder: F, sortOrder: ge } = je, { t: u } = on(), we = re(null), It = re(null), ke = re(!1), ye = re(""), { measureText: Z, clearCache: Ye } = ln(), B = U(() => _n(), []), Et = Xt(
96
+ it(qt, { activationConstraint: { distance: 5 } }),
97
+ it(Qt, { activationConstraint: { delay: 300, tolerance: 5 } })
98
+ ), w = U(() => $ && Object.fromEntries(
99
99
  Object.entries($).map(([e, t]) => [
100
100
  e,
101
- Gt(t)
101
+ rn(t)
102
102
  ])
103
- ), [$]), We = M(() => q.filter(({ is_hidden: e }) => !e), [q]), V = M(() => q.filter(({ is_hidden: e }) => e), [q]), Pe = M(
104
- () => We.filter(({ name: e }) => {
105
- if (!ue) return !0;
106
- const t = (e ?? "").toLowerCase(), s = ue.toLowerCase();
107
- return Re === "contains" ? t.includes(s) : !t.includes(s);
103
+ ), [$]), Je = U(() => q.filter(({ is_hidden: e }) => !e), [q]), R = U(() => q.filter(({ is_hidden: e }) => e), [q]), Xe = U(
104
+ () => Je.filter(({ name: e }) => {
105
+ if (!xe) return !0;
106
+ const t = (e ?? "").toLowerCase(), o = xe.toLowerCase();
107
+ return Ge === "contains" ? t.includes(o) : !t.includes(o);
108
108
  }),
109
- [We, ue, Re]
110
- ), a = M(
111
- () => [...Pe].sort((e, t) => e.is_pinned && !t.is_pinned ? -1 : !e.is_pinned && t.is_pinned ? 1 : 0),
112
- [Pe]
113
- ), Ct = U < a.length, K = A ? a.length : Ct ? U : a.length, Fe = a.findIndex((e) => e.name === r) >= K, Be = d.length - K - (Fe ? 1 : 0);
114
- ze.current = U;
115
- const P = v(
109
+ [Je, xe, Ge]
110
+ ), d = U(
111
+ () => [...Xe].sort((e, t) => e.is_pinned && !t.is_pinned ? -1 : !e.is_pinned && t.is_pinned ? 1 : 0),
112
+ [Xe]
113
+ ), qe = JSON.stringify(
114
+ Object.entries(Y ?? {}).filter(([, e]) => e != null).map(([e]) => e).sort()
115
+ ), Qe = U(
116
+ () => new Set(JSON.parse(qe)),
117
+ [qe]
118
+ ), vt = he < d.length, ee = G ? d.length : vt ? he : d.length, Ke = d.findIndex((e) => e.name === i) >= ee, Ze = Math.max(0, d.length - ee - (Ke ? 1 : 0)) + R.length, z = C(
116
119
  (e) => {
117
- de(e), Ve?.(e), S && x?.persistTabSettings && x.persistTabSettings({ tab_type: S, tab_items: e });
120
+ be(e), Fe?.(e), N && h?.persistTabSettings && h.persistTabSettings({ tab_type: N, tab_items: e });
118
121
  },
119
- [Ve, S, x]
120
- ), St = v(
122
+ [Fe, N, h]
123
+ ), Dt = C(
121
124
  (e) => {
122
- Ue(e), De?.(e), S && x?.persistTabSettings && x.persistTabSettings({ tab_type: S, tab_options: e });
125
+ $e(e), Pe?.(e), N && h?.persistTabSettings && h.persistTabSettings({ tab_type: N, tab_options: e });
123
126
  },
124
- [De, S, x]
125
- ), je = (e) => e.is_pinned ? 32 : 0, pe = v(
127
+ [Pe, N, h]
128
+ ), et = C(() => {
129
+ if (ye.current) return ye.current;
130
+ const e = we.current?.querySelector('[id^="btn-tabs-tabswitch-"] span'), t = e ? getComputedStyle(e).fontFamily : "";
131
+ return t && (ye.current = t), t || Ln;
132
+ }, []), te = C(
126
133
  (e) => {
127
134
  if (!e) return;
128
- const t = E ? 30 : 0, s = k ? 190 : 84, i = O === "sm" ? 4 : 8, o = 32;
129
- let f = 0, te = 0, g = 0;
130
- const b = e - (H?.width || 0) - t, Ye = ze.current, Je = Ye < a.length, qe = V.length > 0;
131
- for (let h = 0; h < a.length; h++) {
132
- const N = a[h], ne = p?.[N.name] ? String(p?.[N.name]) : "", xe = k && ne ? z(ne, {
133
- fontSize: "16px",
134
- fontWeight: "500",
135
- fontFamily: "Inter, system-ui, -apple-system, sans-serif"
136
- }) + 18 + 2 : 0, ge = z(N?.name || "", {
137
- fontSize: "16px",
138
- fontWeight: "600",
139
- fontFamily: "Inter, system-ui, -apple-system, sans-serif"
140
- }), we = C ? je(N) : 0, Xe = ge + xe + o + i + we;
141
- if (N.name === r && (te = Xe), f += Xe, b > f + (Je || qe ? s : 0) + h * 25)
142
- g = h + 1;
143
- else
144
- break;
135
+ const t = d.length;
136
+ if (G) {
137
+ ze(t);
138
+ return;
145
139
  }
146
- const Qe = a.length - g;
147
- if (Qe + V.length === 1 && V.length === 0 && Qe === 1 && g < a.length) {
148
- const h = a[g];
149
- if (h) {
150
- const N = p?.[h.name] ? String(p?.[h.name]) : "", ne = k && N ? z(N, {
151
- fontSize: "16px",
152
- fontWeight: "500",
153
- fontFamily: "Inter, system-ui, -apple-system, sans-serif"
154
- }) + 18 + 2 : 0, xe = z(h?.name || "", {
155
- fontSize: "16px",
156
- fontWeight: "600",
157
- fontFamily: "Inter, system-ui, -apple-system, sans-serif"
158
- }), ge = C ? je(h) : 0, we = xe + ne + o + i + ge;
159
- b >= f + we && (g += 1);
140
+ const o = typeof window > "u" || window.matchMedia(On).matches, r = et(), s = { fontSize: "14px", fontWeight: "600", fontFamily: r }, f = { fontSize: "12px", fontWeight: "400", fontFamily: r }, V = (a, L = !1) => {
141
+ const M = E ? 0 : Z(u(a.name).toUpperCase(), s), _ = w?.[a.name], se = S && _ !== void 0 ? Z(String(_), f) + Cn + (E ? 0 : ut) : 0, $t = v && a.is_pinned || Qe.has(a.name) ? In + (E ? 0 : ut) : 0, Gt = I && a.name === i ? L ? vn : En : 0, Yt = b === "secondary" ? T === "sm" ? 24 : 32 : o ? 16 : 20, Jt = o && (L || !D) ? 8 : 0;
142
+ return M + se + $t + Gt + Yt + Jt;
143
+ }, oe = e - Vn, x = D ? 0 : T === "sm" ? 4 : 8, _e = [0];
144
+ d.forEach((a, L) => {
145
+ _e.push(_e[L] + V(a));
146
+ });
147
+ const Ce = d.findIndex((a) => a.name === i), zt = Ce >= 0 ? V(d[Ce], !0) : 0, Wt = b === "secondary" ? T === "sm" ? 24 : 32 : o ? 32 : 48, jt = (a) => Z(S ? `${a} MORE...` : "MORE...", s) + Wt + (o ? 8 : 0), st = I && me && y.length > 0 ? Dn : 0, rt = P?.width || 0, at = (a, L) => {
148
+ let M = _e[a], _ = a;
149
+ const se = L && Ce >= a;
150
+ if (se && (M += zt, _ += 1), L) {
151
+ const Ee = Math.max(0, t - a - (se ? 1 : 0)) + R.length;
152
+ Ee > 0 && (M += jt(Ee), _ += 1);
160
153
  }
161
- }
162
- const Ut = A ? a.length : g;
163
- a.findIndex((h) => h.name === r) >= Ut && (f += te, b < f + (Je || qe ? s : 0) && (g = Math.max(g - 1, 0))), g !== Ye && bt(g);
154
+ return st && (M += st, _ += 1), rt && (M += rt, _ += 1), M + x * Math.max(_ - 1, 0);
155
+ };
156
+ let Ie = 0;
157
+ if (R.length === 0 && at(t, !1) <= oe)
158
+ Ie = t;
159
+ else
160
+ for (let a = t; a >= 0; a--)
161
+ if (at(a, !0) <= oe) {
162
+ Ie = a;
163
+ break;
164
+ }
165
+ ze(Ie);
164
166
  },
165
167
  [
166
- a,
167
- k,
168
- A,
169
- C,
170
- p,
171
- H?.width,
172
- r,
173
- O,
168
+ d,
169
+ R.length,
170
+ y.length,
171
+ G,
172
+ i,
173
+ b,
174
+ T,
174
175
  E,
175
- V.length,
176
- z
176
+ D,
177
+ S,
178
+ w,
179
+ v,
180
+ Qe,
181
+ I,
182
+ me,
183
+ P?.width,
184
+ Z,
185
+ et,
186
+ u
177
187
  ]
178
- ), fe = v(
188
+ ), Te = C(
179
189
  () => {
180
190
  if (typeof window < "u")
181
191
  return new URLSearchParams(window.location.search);
182
- if (m && x?.getSearchParam) {
183
- const e = new URLSearchParams(), t = x.getSearchParam(m.key);
184
- return t && e.set(m.key, t), e;
192
+ if (p && h?.getSearchParam) {
193
+ const e = new URLSearchParams(), t = h.getSearchParam(p.key);
194
+ return t && e.set(p.key, t), e;
185
195
  }
186
196
  return new URLSearchParams();
187
197
  },
188
- [m, x]
189
- ), be = v(
190
- (e, t) => (m && (t === m.defaultLink ? e.delete(m.key) : e.set(m.key, t), m.onResolve?.(e)), e),
191
- [m]
192
- ), F = v(
193
- (e) => m ? `?${be(fe(), e).toString()}` : void 0,
194
- [be, fe, m]
195
- ), Nt = ot || !!m, It = v(
198
+ [p, h]
199
+ ), Ne = C(
200
+ (e, t) => (p && (t === p.defaultLink ? e.delete(p.key) : e.set(p.key, t), p.onResolve?.(e)), e),
201
+ [p]
202
+ ), W = C(
203
+ (e) => p ? `?${Ne(Te(), e).toString()}` : void 0,
204
+ [Ne, Te, p]
205
+ ), Ot = ft || !!p, Vt = C(
196
206
  async (e) => {
197
- const t = F(e), s = typeof window < "u" ? window.location.origin : "", i = typeof window < "u" ? window.location.pathname : "", o = t ? `${s}${i}${t}` : `${s}${i}`;
198
- await navigator.clipboard.writeText(o), Zt.success(u("Link copied to clipboard"), {
207
+ const t = W(e), o = typeof window < "u" ? window.location.origin : "", r = typeof window < "u" ? window.location.pathname : "", s = t ? `${o}${r}${t}` : `${o}${r}`;
208
+ await navigator.clipboard.writeText(s), mn.success(u("Link copied to clipboard"), {
199
209
  toastId: "Link copied to clipboard"
200
- }), Ee?.(e, o);
210
+ }), Ae?.(e, s);
201
211
  },
202
- [F, u, Ee]
203
- ), B = (e) => {
204
- if (J(!1), nt?.(e), m && x?.navigate) {
205
- const t = be(fe(), e);
206
- x.navigate(`?${t.toString()}`);
212
+ [W, u, Ae]
213
+ ), j = (e) => {
214
+ if (X(!1), mt?.(e), p && h?.navigate) {
215
+ const t = Ne(Te(), e);
216
+ h.navigate(`?${t.toString()}`);
207
217
  }
208
- }, $e = (e) => {
209
- if (a.length <= 1) return;
210
- const t = d.map(
211
- (o) => o.name === e ? { ...o, is_hidden: !0 } : o
212
- ), s = a.findIndex((o) => o.name === e), i = s === 0 ? 1 : s - 1;
213
- B(a[i].name), P(t);
214
- }, vt = (e) => {
215
- const t = d.map(
216
- (s) => s.name === e ? { ...s, is_hidden: !1 } : s
218
+ }, tt = (e) => {
219
+ if (d.length <= 1) return;
220
+ const t = m.map(
221
+ (s) => s.name === e ? { ...s, is_hidden: !0 } : s
222
+ ), o = d.findIndex((s) => s.name === e), r = o === 0 ? 1 : o - 1;
223
+ j(d[r].name), z(t);
224
+ }, Lt = (e) => {
225
+ const t = m.map(
226
+ (o) => o.name === e ? { ...o, is_hidden: !1 } : o
217
227
  );
218
- J(!1), P(t);
219
- }, ee = (e) => {
220
- if (!C) return;
221
- const t = d.map(
222
- (s) => s.name === e ? { ...s, is_pinned: !s.is_pinned } : s
228
+ X(!1), z(t);
229
+ }, ne = (e) => {
230
+ if (!v) return;
231
+ const t = m.map(
232
+ (o) => o.name === e ? { ...o, is_pinned: !o.is_pinned } : o
223
233
  );
224
- P(t);
225
- }, Ae = (e, t) => {
226
- const s = d.findIndex(({ name: o }) => o === e), i = t === "left" ? s - (d[s - 1]?.name === r ? 2 : 1) : s + 1;
227
- P(Ke(d, s, i));
228
- }, Ge = () => J(!I), _t = (e) => X(e.active.id), Ot = (e) => {
229
- const { active: t, over: s } = e;
230
- if (s?.id === "more-tabs") {
231
- $e(t.id), X(null), Q(null);
234
+ z(t);
235
+ }, nt = (e, t) => {
236
+ const o = m.findIndex(({ name: s }) => s === e), r = t === "left" ? o - (m[o - 1]?.name === i ? 2 : 1) : o + 1;
237
+ z(lt(m, o, r));
238
+ }, ot = () => X(!O), Mt = (e) => K(e.active.id), Ut = (e) => {
239
+ const { active: t, over: o } = e;
240
+ if (o?.id === "more-tabs") {
241
+ tt(t.id), K(null), Q(null);
232
242
  return;
233
243
  }
234
- const i = d.findIndex(({ name: f }) => f === t.id), o = d.findIndex(({ name: f }) => f === s?.id);
235
- P(Ke(d, i, o)), X(null), Q(null);
236
- }, Et = () => {
237
- X(null), Q(null);
238
- }, Dt = (e) => {
244
+ const r = m.findIndex(({ name: f }) => f === t.id), s = m.findIndex(({ name: f }) => f === o?.id);
245
+ z(lt(m, r, s)), K(null), Q(null);
246
+ }, Ht = () => {
247
+ K(null), Q(null);
248
+ }, Rt = (e) => {
239
249
  Q(e.over?.id === "more-tabs" ? "more-tabs" : null);
240
- }, Vt = () => {
241
- }, Lt = (e, t) => {
242
- wt(e), kt(t);
243
- }, he = (e, t = !1, s = !1) => {
244
- const o = d.find((b) => b.name === e)?.is_pinned, f = [
250
+ }, At = () => {
251
+ }, Pt = (e, t) => {
252
+ _t(e), Ct(t);
253
+ }, Se = (e, t = !1, o = !1) => {
254
+ const s = m.find((x) => x.name === e)?.is_pinned, f = [
245
255
  {
246
256
  label: /* @__PURE__ */ n(
247
- y,
257
+ k,
248
258
  {
249
- icon: /* @__PURE__ */ n(Kt, { size: 18, className: "text-inherit dark:text-inherit" }),
259
+ icon: /* @__PURE__ */ n(pn, { size: 18, className: "text-inherit dark:text-inherit" }),
250
260
  text: u("Select Tab"),
251
261
  className: "text-black-900 dark:text-white"
252
262
  }
253
263
  ),
254
264
  key: c.SELECT,
255
- onClick: () => B(e)
265
+ onClick: () => j(e)
256
266
  },
257
267
  {
258
268
  label: /* @__PURE__ */ n(
259
- y,
269
+ k,
260
270
  {
261
- icon: /* @__PURE__ */ n(en, { size: 18, className: "text-inherit dark:text-inherit" }),
271
+ icon: /* @__PURE__ */ n(fn, { size: 18, className: "text-inherit dark:text-inherit" }),
262
272
  text: u("Move Up"),
263
- isDisabled: R,
273
+ isDisabled: F,
264
274
  className: "text-black-900 dark:text-white"
265
275
  }
266
276
  ),
267
277
  key: c.MOVE_LEFT,
268
- disabled: R,
269
- onClick: () => Ae(e, "left")
278
+ disabled: F,
279
+ onClick: () => nt(e, "left")
270
280
  },
271
281
  {
272
282
  label: /* @__PURE__ */ n(
273
- y,
283
+ k,
274
284
  {
275
- icon: /* @__PURE__ */ n(tn, { size: 18, className: "text-inherit dark:text-inherit" }),
285
+ icon: /* @__PURE__ */ n(hn, { size: 18, className: "text-inherit dark:text-inherit" }),
276
286
  text: u("Move Down"),
277
- isDisabled: R,
287
+ isDisabled: F,
278
288
  className: "text-black-900 dark:text-white"
279
289
  }
280
290
  ),
281
291
  key: c.MOVE_RIGHT,
282
- disabled: R,
283
- onClick: () => Ae(e, "right")
292
+ disabled: F,
293
+ onClick: () => nt(e, "right")
284
294
  },
285
295
  {
286
296
  label: /* @__PURE__ */ n(
287
- y,
297
+ k,
288
298
  {
289
- icon: /* @__PURE__ */ n(nn, { size: 18, className: "text-inherit dark:text-inherit" }),
299
+ icon: /* @__PURE__ */ n(bn, { size: 18, className: "text-inherit dark:text-inherit" }),
290
300
  text: u("Copy Link"),
291
301
  className: "text-black-900 dark:text-white"
292
302
  }
293
303
  ),
294
304
  key: c.COPY_LINK,
295
- onClick: () => It(e)
305
+ onClick: () => Vt(e)
296
306
  },
297
307
  {
298
308
  label: /* @__PURE__ */ n(
299
- y,
309
+ k,
300
310
  {
301
- icon: /* @__PURE__ */ n(sn, { size: 18, className: "text-inherit dark:text-inherit" }),
311
+ icon: /* @__PURE__ */ n(xn, { size: 18, className: "text-inherit dark:text-inherit" }),
302
312
  text: u("Hide"),
303
313
  className: "text-black-900 dark:text-white"
304
314
  }
305
315
  ),
306
316
  key: c.HIDE,
307
- onClick: () => $e(e)
317
+ onClick: () => tt(e)
308
318
  },
309
319
  {
310
320
  label: /* @__PURE__ */ n(
311
- y,
321
+ k,
312
322
  {
313
- icon: /* @__PURE__ */ n(on, { size: 18, className: "text-inherit dark:text-inherit" }),
323
+ icon: /* @__PURE__ */ n(gn, { size: 18, className: "text-inherit dark:text-inherit" }),
314
324
  text: u("Unhide"),
315
325
  className: "text-black-900 dark:text-white"
316
326
  }
317
327
  ),
318
328
  key: c.UNHIDE,
319
- onClick: () => vt(e)
329
+ onClick: () => Lt(e)
320
330
  },
321
331
  {
322
332
  label: /* @__PURE__ */ n(
323
- y,
333
+ k,
324
334
  {
325
- icon: o ? /* @__PURE__ */ n(an, { size: 20, className: "rotate-12 text-inherit dark:text-inherit" }) : /* @__PURE__ */ n(se, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }),
326
- text: u(o ? "Unpin" : "Pin"),
335
+ icon: s ? /* @__PURE__ */ n(wn, { size: 20, className: "rotate-12 text-inherit dark:text-inherit" }) : /* @__PURE__ */ n(ie, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }),
336
+ text: u(s ? "Unpin" : "Pin"),
327
337
  className: "text-black-900 dark:text-white",
328
- notVisible: !C
338
+ notVisible: !v
329
339
  }
330
340
  ),
331
- key: o ? c.UNPIN : c.PIN,
332
- onClick: () => ee(e)
341
+ key: s ? c.UNPIN : c.PIN,
342
+ onClick: () => ne(e)
333
343
  },
334
344
  {
335
345
  label: /* @__PURE__ */ n(
336
- y,
346
+ k,
337
347
  {
338
348
  className: "text-black-900 dark:text-white",
339
- icon: /* @__PURE__ */ n(Xt, {}),
349
+ icon: /* @__PURE__ */ n(un, {}),
340
350
  text: u("Edit"),
341
- notVisible: !_e
351
+ notVisible: !He
342
352
  }
343
353
  ),
344
354
  key: c.EDIT,
345
- onClick: () => _e?.(e)
355
+ onClick: () => He?.(e)
346
356
  },
347
357
  {
348
358
  label: /* @__PURE__ */ n(
349
- y,
359
+ k,
350
360
  {
351
361
  className: "text-error-600 dark:text-error-600",
352
- icon: /* @__PURE__ */ n(rn, { size: 18, className: "text-error-600 dark:text-error-600" }),
362
+ icon: /* @__PURE__ */ n(kn, { size: 18, className: "text-error-600 dark:text-error-600" }),
353
363
  text: u("Delete"),
354
- notVisible: !Oe
364
+ notVisible: !Re
355
365
  }
356
366
  ),
357
367
  key: c.DELETE,
358
- onClick: () => Oe?.(e)
368
+ onClick: () => Re?.(e)
359
369
  }
360
- ], te = [c.HIDE, c.UNHIDE], g = [c.SELECT, c.MOVE_LEFT, c.MOVE_RIGHT, c.UNHIDE];
370
+ ], V = [c.HIDE, c.UNHIDE], oe = [c.SELECT, c.MOVE_LEFT, c.MOVE_RIGHT, c.UNHIDE];
361
371
  return f.filter(
362
- (b) => t ? b.key === c.UNHIDE : s ? !te.includes(b.key) : !g.includes(b.key)
363
- ).filter((b) => Nt ? !0 : b.key !== c.COPY_LINK).filter((b) => a.length === 1 ? b.key !== c.HIDE : !0);
364
- }, L = (e, t) => ({
372
+ (x) => t ? x.key === c.UNHIDE : o ? !V.includes(x.key) : !oe.includes(x.key)
373
+ ).filter((x) => Ot ? !0 : x.key !== c.COPY_LINK).filter((x) => d.length === 1 ? x.key !== c.HIDE : !0);
374
+ }, A = (e, t) => ({
365
375
  classValue: {
366
376
  default: l("relative inline-flex pt-2 pb-3 px-2 pl-3 sm:px-2 rounded-t-sm group"),
367
377
  secondary: l(
368
378
  "flex w-full sm:w-auto relative rounded-lg font-sans font-semibold text-center cursor-pointer uppercase",
369
- O === "sm" ? "py-1 px-3 text-sm" : "py-2 px-4 text-base"
379
+ T === "sm" ? "py-1 px-3 text-sm" : "py-2 px-4 text-base"
370
380
  )
371
381
  },
372
382
  selectedClassValue: {
@@ -383,78 +393,87 @@ const Ie = (T) => {
383
393
  t ? "text-primary-600 dark:text-primary-500" : "text-neutral-400 dark:text-neutral-400"
384
394
  )
385
395
  }
386
- })[e][T];
387
- j(() => {
388
- if (!Z.current || T === "switch") return;
389
- const e = new ResizeObserver((t) => {
390
- const s = t[0].contentRect.width;
391
- pe(s);
396
+ })[e][b];
397
+ nn(() => {
398
+ const e = we.current;
399
+ if (!e || b === "switch") return;
400
+ const t = (ue ? e.parentElement : e) ?? e, o = (f) => {
401
+ const V = getComputedStyle(f);
402
+ return f.clientWidth - (parseFloat(V.paddingLeft) || 0) - (parseFloat(V.paddingRight) || 0);
403
+ };
404
+ let r = !1;
405
+ const s = new ResizeObserver((f) => {
406
+ te(f[0].contentRect.width);
392
407
  });
393
- return e.observe(Z.current), pe(Z.current.clientWidth), () => e.disconnect();
394
- }, [pe, T]);
395
- const Mt = JSON.stringify(_), Ht = JSON.stringify(le?.map(({ name: e }) => e));
396
- return j(() => {
397
- if (le?.length) {
398
- let e = [...le];
399
- _.forEach((t) => {
400
- e.find((s) => s.name === t) || e.push({ name: t, is_default: !1, is_hidden: !1, is_pinned: !1 });
408
+ return s.observe(t), te(o(t)), !ke.current && typeof document < "u" && document.fonts && document.fonts.ready.then(() => {
409
+ r || ke.current || (ke.current = !0, Ye(), te(o(t)));
410
+ }), () => {
411
+ r = !0, s.disconnect();
412
+ };
413
+ }, [te, b, ue, Ye]);
414
+ const Ft = JSON.stringify(y), Bt = JSON.stringify(pe?.map(({ name: e }) => e));
415
+ return ae(() => {
416
+ if (pe?.length) {
417
+ let e = [...pe];
418
+ y.forEach((t) => {
419
+ e.find((o) => o.name === t) || e.push({ name: t, is_default: !1, is_hidden: !1, is_pinned: !1 });
401
420
  }), e = e.filter(
402
- (t, s, i) => _.includes(t.name) && s === i.findIndex((o) => o.name === t.name)
403
- ), de(e);
421
+ (t, o, r) => y.includes(t.name) && o === r.findIndex((s) => s.name === t.name)
422
+ ), be(e);
404
423
  } else
405
- de(
406
- _.map((e) => ({ name: e, is_default: !1, is_hidden: !1, is_pinned: !1 })).filter((e, t, s) => t === s.findIndex((i) => i.name === e.name))
424
+ be(
425
+ y.map((e) => ({ name: e, is_default: !1, is_hidden: !1, is_pinned: !1 })).filter((e, t, o) => t === o.findIndex((r) => r.name === e.name))
407
426
  );
408
- }, [Mt, Ht]), j(() => {
409
- Y && Ue(Y);
410
- }, [Y]), j(() => {
411
- if (!d.length) return;
412
- const e = [...d];
413
- me === "asc" ? e.sort((t, s) => t.name.localeCompare(s.name)) : me === "desc" && e.sort((t, s) => s.name.localeCompare(t.name)), ht(e);
414
- }, [d, me]), j(() => {
415
- Ie(I);
416
- }, [I]), T === "switch" ? /* @__PURE__ */ n("div", { className: l("inline", ve), children: /* @__PURE__ */ n(
427
+ }, [Ft, Bt]), ae(() => {
428
+ J && $e(J);
429
+ }, [J]), ae(() => {
430
+ if (!m.length) return;
431
+ const e = [...m];
432
+ ge === "asc" ? e.sort((t, o) => t.name.localeCompare(o.name)) : ge === "desc" && e.sort((t, o) => o.name.localeCompare(t.name)), Tt(e);
433
+ }, [m, ge]), ae(() => {
434
+ Me(O);
435
+ }, [O]), b === "switch" ? /* @__PURE__ */ n("div", { className: l("inline", Ue), children: /* @__PURE__ */ n(
417
436
  "ul",
418
437
  {
419
438
  role: "tablist",
420
439
  "aria-orientation": "horizontal",
421
440
  className: l(
422
441
  "inline-flex grow-0 p-1 rounded-lg",
423
- ae === "dark" ? "border-[1.5px] border-neutral-800 bg-neutral-800 dark:border-black-800" : "bg-neutral-100 dark:bg-black-700",
424
- ie ? "w-full" : "w-auto"
442
+ ce === "dark" ? "border-[1.5px] border-neutral-800 bg-neutral-800 dark:border-black-800" : "bg-neutral-100 dark:bg-black-700",
443
+ de ? "w-full" : "w-auto"
425
444
  ),
426
- children: _.map((e) => {
427
- const t = r === e, s = re?.[e], i = d.find((f) => f.name === e), o = C && i?.is_pinned;
428
- return /* @__PURE__ */ n("li", { role: "presentation", className: l("inline-flex", ie ? "w-full" : "w-auto"), children: /* @__PURE__ */ n(
429
- Se,
445
+ children: y.map((e) => {
446
+ const t = i === e, o = Y?.[e], r = m.find((f) => f.name === e), s = v && r?.is_pinned;
447
+ return /* @__PURE__ */ n("li", { role: "presentation", className: l("inline-flex", de ? "w-full" : "w-auto"), children: /* @__PURE__ */ n(
448
+ Ve,
430
449
  {
431
450
  title: e,
432
- showCounts: k,
451
+ showCounts: S,
433
452
  role: "tab",
434
453
  ariaSelected: t,
435
454
  tabIndex: 0,
436
- icon: o ? /* @__PURE__ */ n(Ce, { title: "Unpin", children: /* @__PURE__ */ n("span", { onClick: () => ee(e), children: /* @__PURE__ */ n(se, { className: "rotate-45 w-icon h-icon text-inherit dark:text-inherit" }) }) }) : s,
437
- iconsOnly: rt,
455
+ icon: s ? /* @__PURE__ */ n(Oe, { title: "Unpin", children: /* @__PURE__ */ n("span", { onClick: () => ne(e), children: /* @__PURE__ */ n(ie, { className: "rotate-45 w-icon h-icon text-inherit dark:text-inherit" }) }) }) : o,
456
+ iconsOnly: E,
438
457
  classValue: l(
439
458
  "relative py-0.5 border-gray-200",
440
- it,
441
- ie ? "w-full flex items-center justify-center" : "px-2"
459
+ bt,
460
+ de ? "w-full flex items-center justify-center" : "px-2"
442
461
  ),
443
462
  selectedClassValue: l(
444
463
  "absolute inset-0 rounded-md z-0",
445
- ae === "dark" ? "bg-neutral-900" : "bg-white dark:bg-black-800"
464
+ ce === "dark" ? "bg-neutral-900" : "bg-white dark:bg-black-800"
446
465
  ),
447
466
  textClassValue: l(
448
467
  "relative text-xs font-semibold font-sans whitespace-nowrap",
449
468
  t ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-700 dark:text-neutral-100"
450
469
  ),
451
470
  isSelected: t,
452
- href: F(e),
453
- onClick: at ? void 0 : () => B(e),
454
- suffixRecord: p,
455
- selectedId: W,
456
- color: ae,
457
- disableAnimation: ct
471
+ href: W(e),
472
+ onClick: ht ? void 0 : () => j(e),
473
+ suffixRecord: w,
474
+ selectedId: B,
475
+ color: ce,
476
+ disableAnimation: xt
458
477
  }
459
478
  ) }, e);
460
479
  })
@@ -462,136 +481,138 @@ const Ie = (T) => {
462
481
  ) }) : /* @__PURE__ */ n(
463
482
  "div",
464
483
  {
465
- ref: Z,
466
- className: l(lt ? "w-fit" : "w-full"),
467
- onMouseEnter: () => Me(!0),
468
- onMouseLeave: () => Me(!1),
469
- children: /* @__PURE__ */ ke(
470
- Pt,
484
+ ref: we,
485
+ className: l(ue ? "w-fit" : "w-full"),
486
+ onMouseEnter: () => We(!0),
487
+ onMouseLeave: () => We(!1),
488
+ children: /* @__PURE__ */ ve(
489
+ Kt,
471
490
  {
472
- sensors: Tt,
473
- onDragEnd: Ot,
474
- onDragStart: _t,
475
- onDragCancel: Et,
476
- collisionDetection: Ft,
477
- onDragOver: Dt,
491
+ sensors: Et,
492
+ onDragEnd: Ut,
493
+ onDragStart: Mt,
494
+ onDragCancel: Ht,
495
+ collisionDetection: Zt,
496
+ onDragOver: Rt,
478
497
  children: [
479
- /* @__PURE__ */ ke(
498
+ /* @__PURE__ */ ve(
480
499
  "ul",
481
500
  {
482
501
  role: "tablist",
483
502
  "aria-orientation": "horizontal",
484
503
  className: l(
485
504
  "flex items-center w-full",
486
- ve,
487
- G ? "gap-0" : O === "sm" ? "gap-1" : "gap-2"
505
+ Ue,
506
+ D ? "gap-0" : T === "sm" ? "gap-1" : "gap-2"
488
507
  ),
489
- ref: yt,
508
+ ref: It,
490
509
  children: [
491
- st ? /* @__PURE__ */ n("div", { className: "skeleton bg-neutral-300 dark:bg-black-700 animate-pulse h-10 min-w-[100px] w-full rounded" }) : /* @__PURE__ */ ke(
492
- Bt,
510
+ pt ? /* @__PURE__ */ n("div", { className: "skeleton bg-neutral-300 dark:bg-black-700 animate-pulse h-10 min-w-[100px] w-full rounded" }) : /* @__PURE__ */ ve(
511
+ en,
493
512
  {
494
- items: a.map(({ name: e }) => e),
495
- strategy: jt,
513
+ items: d.map(({ name: e }) => e),
514
+ strategy: tn,
496
515
  id: "sortable",
497
- disabled: !E || R,
516
+ disabled: !I || F,
498
517
  children: [
499
- a.slice(0, K).map(({ name: e, is_pinned: t }) => {
500
- const s = r === e && !I, i = C && t;
518
+ d.slice(0, ee).map(({ name: e, is_pinned: t }) => {
519
+ const o = i === e && !O, r = v && t;
501
520
  return /* @__PURE__ */ n(
502
- tt,
521
+ dt,
503
522
  {
504
523
  title: e,
505
- isDragging: D === e,
506
- className: G ? "flex-1 flex justify-center" : "",
507
- children: /* @__PURE__ */ n("li", { role: "presentation", className: l(G ? "w-full flex" : "sm:mr-2"), children: /* @__PURE__ */ n(
508
- Se,
524
+ isDragging: H === e,
525
+ className: D ? "flex-1 flex justify-center" : "",
526
+ children: /* @__PURE__ */ n("li", { role: "presentation", className: l(D ? "w-full flex" : "sm:mr-2"), children: /* @__PURE__ */ n(
527
+ Ve,
509
528
  {
510
- showCounts: k,
529
+ showCounts: S,
511
530
  title: e,
531
+ iconsOnly: E,
512
532
  role: "tab",
513
- ariaSelected: s,
533
+ ariaSelected: o,
514
534
  tabIndex: 0,
515
535
  classValue: l(
516
- L("classValue", s),
517
- G ? "w-full justify-center" : ""
536
+ A("classValue", o),
537
+ D ? "w-full justify-center" : ""
518
538
  ),
519
- selectedClassValue: L("selectedClassValue", s),
520
- textClassValue: L("textClassValue", s),
521
- isSelected: s,
522
- tabOptions: s && E ? /* @__PURE__ */ n(
523
- ye,
539
+ selectedClassValue: A("selectedClassValue", o),
540
+ textClassValue: A("textClassValue", o),
541
+ isSelected: o,
542
+ tabOptions: o && I ? /* @__PURE__ */ n(
543
+ De,
524
544
  {
525
545
  menu: {
526
- items: he(e),
527
- className: oe
546
+ items: Se(e),
547
+ className: le
528
548
  },
529
549
  trigger: ["click"],
530
- onOpenChange: Ie,
550
+ onOpenChange: Me,
531
551
  overlayClassName: "row-option-cell",
532
552
  rootClassName: "",
533
553
  openClassName: "max-h-[350px] overflow-y-auto",
534
554
  placement: "bottom",
535
555
  children: /* @__PURE__ */ n(
536
- qt,
556
+ cn,
537
557
  {
538
558
  tooltip: u("More"),
539
559
  variant: "ghost",
540
560
  className: "!text-primary-500 hover:!bg-primary-100 dark:hover:!bg-primary-900",
541
- children: /* @__PURE__ */ n(et, { sx: { fontSize: 20 } })
561
+ children: /* @__PURE__ */ n(ct, { sx: { fontSize: 20 } })
542
562
  }
543
563
  )
544
564
  }
545
565
  ) : null,
546
- draggingTab: D === e,
547
- href: F(e),
548
- onClick: () => B(e),
549
- suffixRecord: p,
550
- selectedId: W,
551
- icon: i ? /* @__PURE__ */ n(Ce, { title: u("Unpin"), children: /* @__PURE__ */ n("span", { onClick: () => ee(e), children: /* @__PURE__ */ n(se, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : re?.[e] ?? null
566
+ draggingTab: H === e,
567
+ href: W(e),
568
+ onClick: () => j(e),
569
+ suffixRecord: w,
570
+ selectedId: B,
571
+ icon: r ? /* @__PURE__ */ n(Oe, { title: u("Unpin"), children: /* @__PURE__ */ n("span", { onClick: () => ne(e), children: /* @__PURE__ */ n(ie, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : Y?.[e] ?? null
552
572
  }
553
573
  ) }, e)
554
574
  },
555
575
  e
556
576
  );
557
577
  }),
558
- r && Fe ? /* @__PURE__ */ n(tt, { title: r, isDragging: D === r, children: /* @__PURE__ */ n("li", { role: "presentation", className: l("sm:mr-2"), children: /* @__PURE__ */ n(
559
- Se,
578
+ i && Ke ? /* @__PURE__ */ n(dt, { title: i, isDragging: H === i, children: /* @__PURE__ */ n("li", { role: "presentation", className: l("sm:mr-2"), children: /* @__PURE__ */ n(
579
+ Ve,
560
580
  {
561
- showCounts: k,
562
- title: r,
581
+ showCounts: S,
582
+ title: i,
583
+ iconsOnly: E,
563
584
  role: "tab",
564
585
  ariaSelected: !0,
565
586
  tabIndex: 0,
566
- classValue: L("classValue", !0),
567
- selectedClassValue: L("selectedClassValue", !0),
568
- textClassValue: L("textClassValue", !0),
587
+ classValue: A("classValue", !0),
588
+ selectedClassValue: A("selectedClassValue", !0),
589
+ textClassValue: A("textClassValue", !0),
569
590
  isSelected: !0,
570
- tabOptions: E ? /* @__PURE__ */ n(
571
- ye,
591
+ tabOptions: I ? /* @__PURE__ */ n(
592
+ De,
572
593
  {
573
594
  menu: {
574
- items: he(r),
575
- className: oe
595
+ items: Se(i),
596
+ className: le
576
597
  },
577
598
  trigger: ["click"],
578
- onOpenChange: Ie,
599
+ onOpenChange: Me,
579
600
  overlayClassName: "row-option-cell",
580
601
  rootClassName: "",
581
602
  openClassName: "max-h-[350px] overflow-y-auto",
582
603
  placement: "bottom",
583
- children: /* @__PURE__ */ n(et, { sx: { fontSize: 20 }, className: "text-primary-600" })
604
+ children: /* @__PURE__ */ n(ct, { sx: { fontSize: 20 }, className: "text-primary-600" })
584
605
  }
585
606
  ) : null,
586
- draggingTab: D === r,
587
- href: F(r),
588
- suffixRecord: p,
589
- selectedId: W,
590
- icon: C && d.find((e) => e.name === r)?.is_pinned ? /* @__PURE__ */ n(Ce, { title: u("Pinned"), children: /* @__PURE__ */ n("span", { onClick: () => ee(r), children: /* @__PURE__ */ n(se, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : re?.[r] ?? null
607
+ draggingTab: H === i,
608
+ href: W(i),
609
+ suffixRecord: w,
610
+ selectedId: B,
611
+ icon: v && m.find((e) => e.name === i)?.is_pinned ? /* @__PURE__ */ n(Oe, { title: u("Pinned"), children: /* @__PURE__ */ n("span", { onClick: () => ne(i), children: /* @__PURE__ */ n(ie, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : Y?.[i] ?? null
591
612
  }
592
- ) }, r) }, r) : null,
593
- (U < a.length && !A || V.length > 0) && Be > 0 ? /* @__PURE__ */ n(ln, { id: "more-tabs", children: /* @__PURE__ */ n(
594
- ye,
613
+ ) }, i) }, i) : null,
614
+ (he < d.length && !G || R.length > 0) && Ze > 0 ? /* @__PURE__ */ n(yn, { id: "more-tabs", children: /* @__PURE__ */ n(
615
+ De,
595
616
  {
596
617
  overlayStyle: {
597
618
  maxHeight: "calc(100vh - 350px)",
@@ -601,8 +622,8 @@ const Ie = (T) => {
601
622
  borderRadius: 8,
602
623
  boxShadow: "0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)"
603
624
  },
604
- onOpenChange: () => Ge(),
605
- open: I,
625
+ onOpenChange: () => ot(),
626
+ open: O,
606
627
  menu: {
607
628
  items: [
608
629
  {
@@ -610,41 +631,41 @@ const Ie = (T) => {
610
631
  disabled: !0,
611
632
  style: { minWidth: "190px", marginBottom: "8px" },
612
633
  label: /* @__PURE__ */ n("div", { className: "px-2 bg-white dark:bg-black-800", children: /* @__PURE__ */ n(
613
- Qt,
634
+ dn,
614
635
  {
615
636
  id: "search-bar-more-tabs",
616
- value: ce,
637
+ value: fe,
617
638
  classValues: "!rounded-lg",
618
- onChange: (e) => ft(e)
639
+ onChange: (e) => yt(e)
619
640
  }
620
641
  ) })
621
642
  },
622
- ...a.slice(K).filter((e) => e.name !== r).concat(V).filter(
623
- ({ name: e }) => typeof e == "string" && (e ?? "").toLowerCase().includes(ce.toLowerCase())
643
+ ...d.slice(ee).filter((e) => e.name !== i).concat(R).filter(
644
+ ({ name: e }) => typeof e == "string" && (e ?? "").toLowerCase().includes(fe.toLowerCase())
624
645
  ).map(({ name: e, is_hidden: t }) => ({
625
646
  key: e,
626
647
  label: /* @__PURE__ */ n(
627
- y,
648
+ k,
628
649
  {
629
650
  className: l(
630
651
  "uppercase",
631
652
  t ? "text-neutral-400 dark:text-neutral-500" : "text-black-900 dark:text-black-200"
632
653
  ),
633
654
  text: e,
634
- suffixRecord: k ? p : {},
635
- highlight: ce,
655
+ suffixRecord: S ? w : {},
656
+ highlight: fe,
636
657
  truncateText: !0,
637
658
  isDisabled: t,
638
659
  onClick: t ? void 0 : () => {
639
- B(e), J(!1);
660
+ j(e), X(!1);
640
661
  }
641
662
  }
642
663
  ),
643
- popupClassName: oe,
644
- children: I ? he(e, t, !0) : null
664
+ popupClassName: le,
665
+ children: O ? Se(e, t, !0) : null
645
666
  }))
646
667
  ],
647
- className: oe
668
+ className: le
648
669
  },
649
670
  openClassName: "max-h-[350px] overflow-y-auto",
650
671
  trigger: ["click"],
@@ -652,16 +673,16 @@ const Ie = (T) => {
652
673
  placement: "bottomRight",
653
674
  getPopupContainer: (e) => e.parentElement,
654
675
  children: /* @__PURE__ */ n(
655
- cn,
676
+ Tn,
656
677
  {
657
- title: `${k ? Be : ""} MORE...`,
658
- variant: T,
659
- size: O,
660
- draggingOver: xt,
661
- suffixRecord: p,
662
- handleShowMoreDropdown: Ge,
663
- selectedId: W,
664
- showMoreDropdown: I
678
+ title: `${S ? `${Ze} ` : ""}MORE...`,
679
+ variant: b,
680
+ size: T,
681
+ draggingOver: Nt,
682
+ suffixRecord: w,
683
+ handleShowMoreDropdown: ot,
684
+ selectedId: B,
685
+ showMoreDropdown: O
665
686
  }
666
687
  )
667
688
  }
@@ -669,40 +690,40 @@ const Ie = (T) => {
669
690
  ]
670
691
  }
671
692
  ),
672
- H ? /* @__PURE__ */ n("div", { className: l(H?.className), children: /* @__PURE__ */ n("li", { children: H.component }) }) : null,
673
- E && pt && /* @__PURE__ */ n(
693
+ P ? /* @__PURE__ */ n("div", { className: l(P?.className), children: /* @__PURE__ */ n("li", { children: P.component }) }) : null,
694
+ I && me && y.length > 0 ? /* @__PURE__ */ n(
674
695
  "li",
675
696
  {
676
697
  className: l(
677
- gt ? "opacity-100" : "opacity-0",
698
+ St ? "opacity-100" : "opacity-0",
678
699
  "transition-opacity duration-300"
679
700
  ),
680
701
  children: /* @__PURE__ */ n(
681
- dn,
702
+ Nn,
682
703
  {
683
- hasSuffixRecord: !!(p && Object.keys(p).length > 0),
684
- savedConfig: He,
685
- onApplyFilter: (e) => St(e),
704
+ hasSuffixRecord: !!(w && Object.keys(w).length > 0),
705
+ savedConfig: je,
706
+ onApplyFilter: (e) => Dt(e),
686
707
  setUnsavedChanges: () => {
687
708
  },
688
- handleTabSort: Vt,
689
- onSearchChange: Lt
709
+ handleTabSort: At,
710
+ onSearchChange: Pt
690
711
  }
691
712
  )
692
713
  }
693
- )
714
+ ) : null
694
715
  ]
695
716
  }
696
717
  ),
697
- D ? /* @__PURE__ */ n(
698
- un,
718
+ H ? /* @__PURE__ */ n(
719
+ Sn,
699
720
  {
700
- draggingTab: D,
701
- suffixRecord: p,
702
- size: O,
703
- variant: T,
704
- selectedId: W,
705
- parentContainer: mt
721
+ draggingTab: H,
722
+ suffixRecord: w,
723
+ size: T,
724
+ variant: b,
725
+ selectedId: B,
726
+ parentContainer: kt
706
727
  }
707
728
  ) : null
708
729
  ]
@@ -712,6 +733,6 @@ const Ie = (T) => {
712
733
  );
713
734
  };
714
735
  export {
715
- Pn as Tabs
736
+ ro as Tabs
716
737
  };
717
738
  //# sourceMappingURL=Tabs.es.js.map