impact-nova 1.7.33 → 1.7.34

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,40 +1,40 @@
1
1
  import { jsxs as g, jsx as r, Fragment as gt } from "react/jsx-runtime";
2
- import bt, { useState as W, useRef as F, useEffect as C } from "react";
2
+ import bt, { useState as W, useRef as R, useEffect as I } from "react";
3
3
  import * as ae from "@radix-ui/react-popover";
4
4
  import { useVirtualizer as vt } from "@tanstack/react-virtual";
5
- import St from "./components/LabelWithSequence.js";
6
- import yt from "./components/Submenu.js";
5
+ import yt from "./components/LabelWithSequence.js";
6
+ import St from "./components/Submenu.js";
7
7
  import { LoadingSpinner as wt, Cross as Vt, ChevronRight as Me, Search as Nt, Info as oe } from "../../../icons/index.js";
8
8
  import { Checkbox as Fe } from "../checkbox.js";
9
9
  import { Button as kt } from "../button.js";
10
10
  import { cn as w } from "../../../lib/utils.js";
11
- import { isInvertedSelection as T, isOptionArray as V, isSelected as Pt, getSequence as Dt, getLeafOptions as Ot } from "./utils/select.js";
12
- import { useFlattenOptions as At } from "./hooks/useFlattenOptions.js";
13
- import { useSelectionModel as It } from "./hooks/useSelectionModel.js";
14
- import { useVisibleStats as Ct } from "./hooks/useVisibleStats.js";
11
+ import { isInvertedSelection as L, isOptionArray as V, isSelected as Pt, getSequence as Dt, getLeafOptions as Ct } from "./utils/select.js";
12
+ import { useFlattenOptions as Ot } from "./hooks/useFlattenOptions.js";
13
+ import { useSelectionModel as At } from "./hooks/useSelectionModel.js";
14
+ import { useVisibleStats as It } from "./hooks/useVisibleStats.js";
15
15
  import { useImpactNovaI18n as Et } from "../../../i18n/ImpactNovaI18nContext.js";
16
16
  const Tt = (Ve) => {
17
17
  const {
18
- options: R,
18
+ options: H,
19
19
  value: ce,
20
20
  defaultValue: Re,
21
21
  onChange: u,
22
- isMulti: m,
22
+ isMulti: p,
23
23
  isDisabled: k,
24
24
  isLoading: E,
25
25
  isClearable: He = !0,
26
- isSearchable: L = !0,
26
+ isSearchable: z = !0,
27
27
  placeholder: _e,
28
28
  // menuPortalTarget is kept for API compatibility but no longer used (Radix handles portalling)
29
29
  menuPortalTarget: Lt,
30
30
  autoFocus: je,
31
- closeMenuOnSelect: qe = !m,
31
+ closeMenuOnSelect: qe = !p,
32
32
  defaultMenuIsOpen: Be = !1,
33
33
  scrollToSelectedOnOpen: Ne = !1,
34
34
  maxSelectableOptions: b,
35
35
  showSequence: ke,
36
36
  selectionOrder: Ke,
37
- label: H,
37
+ label: _,
38
38
  isRequired: Ue,
39
39
  error: ue,
40
40
  helperText: X,
@@ -45,88 +45,88 @@ const Tt = (Ve) => {
45
45
  onMenuScrollToBottom: $,
46
46
  name: Ye,
47
47
  isSelectAllEnabled: Q = !0,
48
- isReadOnly: p = !1,
49
- searchPosition: z = "menu",
48
+ isReadOnly: h = !1,
49
+ searchPosition: G = "menu",
50
50
  footerContent: Pe,
51
51
  onInputChange: Je,
52
52
  getOptionLabel: De,
53
- renderOption: Oe,
53
+ renderOption: Ce,
54
54
  onMenuOpen: Qe,
55
- onMenuClose: Ae,
55
+ onMenuClose: Oe,
56
56
  labelOrientation: fe = "top",
57
- leftContent: Ie,
57
+ leftContent: Ae,
58
58
  ignoreCase: Ze,
59
59
  ignoreAccents: et,
60
60
  matchFrom: tt,
61
- stringify: lt,
62
- trim: nt,
61
+ stringify: nt,
62
+ trim: lt,
63
63
  filterOption: st,
64
- enableSubMenus: S = !1,
64
+ enableSubMenus: y = !1,
65
65
  enableGroups: D = !1,
66
- fetchError: _,
67
- onRefetch: Ce,
66
+ fetchError: j,
67
+ onRefetch: Ie,
68
68
  menuWidth: it,
69
69
  onClearAll: Ee,
70
70
  onFocus: rt,
71
71
  onBlur: at
72
- } = Ve, { t: Y } = Et(), me = _e ?? Y("select.placeholder"), [h, Te] = W(Be), [G, Z] = W(""), [Le, pe] = W(void 0), [d, v] = W(Re || (m ? [] : null)), [ot, he] = W(null), J = -2, [O, A] = W(-1), xe = F(!1), ge = F(null), ee = F(null), ct = F(null), te = F(null), j = F(null);
73
- C(() => {
72
+ } = Ve, { t: Y } = Et(), pe = _e ?? Y("select.placeholder"), [m, Te] = W(Be), [M, Z] = W(""), [Le, me] = W(void 0), [d, v] = W(Re || (p ? [] : null)), [ot, he] = W(null), J = -2, [C, O] = W(-1), xe = R(!1), ge = R(null), ee = R(null), ct = R(null), te = R(null), q = R(null);
73
+ I(() => {
74
74
  ce !== void 0 && v(ce);
75
- }, [ce]), C(() => {
76
- if (!(h && L && z === "menu")) return;
75
+ }, [ce]), I(() => {
76
+ if (!(m && z && G === "menu")) return;
77
77
  let e = !1;
78
78
  const t = () => {
79
- !e && j.current && j.current.focus();
79
+ !e && q.current && q.current.focus();
80
80
  };
81
81
  requestAnimationFrame(t);
82
- const l = setTimeout(t, 50);
82
+ const n = setTimeout(t, 50);
83
83
  return () => {
84
- e = !0, clearTimeout(l);
84
+ e = !0, clearTimeout(n);
85
85
  };
86
- }, [h, L, z]);
87
- const { flatOptions: f, isProcessing: I, totalOptionsCount: $e, workerSelectAll: ut } = At(R, G, {
86
+ }, [m, z, G]);
87
+ const { flatOptions: f, isProcessing: A, totalOptionsCount: ze, workerSelectAll: ut } = Ot(H, M, {
88
88
  ignoreCase: Ze,
89
89
  ignoreAccents: et,
90
90
  matchFrom: tt,
91
- stringify: lt,
92
- trim: nt,
91
+ stringify: nt,
92
+ trim: lt,
93
93
  filterOption: st,
94
- enableSubMenus: S,
94
+ enableSubMenus: y,
95
95
  enableGroups: D
96
- }), y = It(d, m ?? !1), { stats: q, getGroupStats: be } = Ct(
96
+ }), S = At(d, p ?? !1), { stats: B, getGroupStats: be } = It(
97
97
  f,
98
- $e,
99
- G,
100
- y,
98
+ ze,
99
+ M,
100
+ S,
101
101
  d,
102
- m ?? !1
102
+ p ?? !1
103
103
  ), N = vt({
104
104
  count: f.length,
105
105
  getScrollElement: () => te.current,
106
106
  estimateSize: () => 34,
107
107
  overscan: 5
108
108
  });
109
- C(() => {
110
- if (!h)
111
- pe(void 0), A(-1);
109
+ I(() => {
110
+ if (!m)
111
+ me(void 0), O(-1);
112
112
  else if (xe.current)
113
- if (xe.current = !1, L && z === "menu" && !p)
114
- A(-1);
113
+ if (xe.current = !1, z && G === "menu" && !h)
114
+ O(-1);
115
115
  else {
116
- const e = !E && !I && !_ && m && Q && !p && f.length > 0;
117
- A(e ? J : 0);
116
+ const e = !E && !A && !j && p && Q && !h && f.length > 0;
117
+ O(e ? J : 0);
118
118
  }
119
- }, [h]), C(() => {
120
- O !== -1 && A(0);
121
- }, [G]), C(() => {
122
- if (!h) return;
119
+ }, [m]), I(() => {
120
+ C !== -1 && O(0);
121
+ }, [M]), I(() => {
122
+ if (!m) return;
123
123
  const e = requestAnimationFrame(() => {
124
124
  N.measure();
125
125
  });
126
126
  return () => cancelAnimationFrame(e);
127
- }, [h, N]), C(() => {
128
- if (h && Ne && !I && f.length > 0) {
129
- const e = f.findIndex((t) => m ? y.mode === "exclude" ? !y.set.has(t.value) : y.set.has(t.value) : d?.value === t.value);
127
+ }, [m, N]), I(() => {
128
+ if (m && Ne && !A && f.length > 0) {
129
+ const e = f.findIndex((t) => p ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value);
130
130
  if (e !== -1) {
131
131
  const t = setTimeout(() => {
132
132
  N.scrollToIndex(e, { align: "center" });
@@ -134,76 +134,76 @@ const Tt = (Ve) => {
134
134
  return () => clearTimeout(t);
135
135
  }
136
136
  }
137
- }, [h, Ne, I, f.length, m, y.mode, y.set, d, N]);
138
- const B = F(null), ze = N.getVirtualItems(), ve = ze[ze.length - 1], le = bt.useCallback(() => {
139
- E || I || B.current || $ && ($(), B.current = setTimeout(() => {
140
- B.current = null;
137
+ }, [m, Ne, A, f.length, p, S.mode, S.set, d, N]);
138
+ const K = R(null), $e = N.getVirtualItems(), ve = $e[$e.length - 1], ne = bt.useCallback(() => {
139
+ E || A || K.current || $ && ($(), K.current = setTimeout(() => {
140
+ K.current = null;
141
141
  }, 500));
142
- }, [E, I, $]);
143
- C(() => () => {
144
- B.current && (clearTimeout(B.current), B.current = null);
145
- }, []), C(() => {
146
- if (!h || !te.current || !$) return;
142
+ }, [E, A, $]);
143
+ I(() => () => {
144
+ K.current && (clearTimeout(K.current), K.current = null);
145
+ }, []), I(() => {
146
+ if (!m || !te.current || !$) return;
147
147
  const e = () => {
148
- const { scrollTop: l, scrollHeight: s, clientHeight: n } = t;
149
- s - l - n <= 64 && le();
148
+ const { scrollTop: n, scrollHeight: l, clientHeight: s } = t;
149
+ l - n - s <= 64 && ne();
150
150
  }, t = te.current;
151
151
  return t.addEventListener("scroll", e), e(), () => {
152
152
  t.removeEventListener("scroll", e);
153
153
  };
154
154
  }, [
155
155
  $,
156
- h,
157
- le
158
- ]), C(() => {
159
- if (!h || !$ || !ve) return;
156
+ m,
157
+ ne
158
+ ]), I(() => {
159
+ if (!m || !$ || !ve) return;
160
160
  const e = f.length - 1;
161
- e < 0 || ve.index < e - 1 || le();
161
+ e < 0 || ve.index < e - 1 || ne();
162
162
  }, [
163
- h,
163
+ m,
164
164
  $,
165
165
  f.length,
166
166
  ve,
167
- le
167
+ ne
168
168
  ]);
169
- const K = (e) => {
169
+ const T = (e) => {
170
170
  if (!k)
171
171
  if (Te(e), e)
172
172
  Qe?.();
173
173
  else {
174
- const t = d, l = m && V(d) ? d.map((s) => s.value) : void 0;
175
- Ae?.(t, l), Z(""), he(null);
174
+ const t = d, n = p && V(d) ? d.map((l) => l.value) : void 0;
175
+ Oe?.(t, n), Z(""), he(null);
176
176
  }
177
177
  };
178
- C(() => {
179
- if (!h) return;
178
+ I(() => {
179
+ if (!m) return;
180
180
  const e = (t) => {
181
- const l = t.target;
182
- l && ee.current?.contains(l) || (t.preventDefault(), t.stopPropagation());
181
+ const n = t.target;
182
+ n && ee.current?.contains(n) || (t.preventDefault(), t.stopPropagation());
183
183
  };
184
184
  return document.addEventListener("scroll", e, !0), document.addEventListener("wheel", e, { passive: !1, capture: !0 }), document.addEventListener("touchmove", e, { passive: !1, capture: !0 }), () => {
185
185
  document.removeEventListener("scroll", e, !0), document.removeEventListener("wheel", e, !0), document.removeEventListener("touchmove", e, !0);
186
186
  };
187
- }, [h]);
188
- const ne = (e) => {
189
- if (!(k || p || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
190
- if (m) {
191
- const l = d || [];
187
+ }, [m]);
188
+ const le = (e) => {
189
+ if (!(k || h || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
190
+ if (p) {
191
+ const n = d || [];
192
192
  if ("children" in e || "options" in e) {
193
- const n = Ot(
193
+ const s = Ct(
194
194
  e,
195
- S,
195
+ y,
196
196
  D
197
197
  ).filter((i) => !i.isDisabled);
198
- if (T(l)) {
199
- const i = l.excludedValues, a = n.every(
198
+ if (L(n)) {
199
+ const i = n.excludedValues, a = s.every(
200
200
  (x) => !i.includes(x.value)
201
201
  );
202
202
  let c = [...i];
203
- a ? n.forEach((x) => {
203
+ a ? s.forEach((x) => {
204
204
  c.includes(x.value) || c.push(x.value);
205
205
  }) : c = c.filter(
206
- (x) => !n.some((ie) => ie.value === x)
206
+ (x) => !s.some((ie) => ie.value === x)
207
207
  );
208
208
  const o = {
209
209
  isAllSelected: !0,
@@ -213,14 +213,14 @@ const Tt = (Ve) => {
213
213
  action: "select-option",
214
214
  option: e
215
215
  });
216
- } else if (V(l)) {
217
- const i = l, a = n.every(
216
+ } else if (V(n)) {
217
+ const i = n, a = s.every(
218
218
  (o) => i.some((x) => x.value === o.value)
219
219
  );
220
220
  let c = [...i];
221
221
  if (a ? c = c.filter(
222
- (o) => !n.some((x) => x.value === o.value)
223
- ) : n.forEach((o) => {
222
+ (o) => !s.some((x) => x.value === o.value)
223
+ ) : s.forEach((o) => {
224
224
  c.some((x) => x.value === o.value) || c.push(o);
225
225
  }), b && c.length > b)
226
226
  return;
@@ -229,30 +229,30 @@ const Tt = (Ve) => {
229
229
  option: e
230
230
  });
231
231
  }
232
- } else if (T(l)) {
233
- const s = l.excludedValues, n = s.includes(e.value);
234
- let i = [...s];
235
- n ? i = i.filter((c) => c !== e.value) : i.push(e.value);
232
+ } else if (L(n)) {
233
+ const l = n.excludedValues, s = l.includes(e.value);
234
+ let i = [...l];
235
+ s ? i = i.filter((c) => c !== e.value) : i.push(e.value);
236
236
  const a = {
237
237
  isAllSelected: !0,
238
238
  excludedValues: i
239
239
  };
240
240
  v(a), u && u(a, {
241
- action: n ? "select-option" : "deselect-option",
241
+ action: s ? "select-option" : "deselect-option",
242
242
  option: e
243
243
  });
244
- } else if (V(l)) {
245
- const s = l, n = m ? y.mode === "exclude" ? !y.set.has(e.value) : y.set.has(e.value) : d?.value === e.value;
244
+ } else if (V(n)) {
245
+ const l = n, s = p ? S.mode === "exclude" ? !S.set.has(e.value) : S.set.has(e.value) : d?.value === e.value;
246
246
  let i = [];
247
- if (n)
248
- i = s.filter((a) => a.value !== e.value);
247
+ if (s)
248
+ i = l.filter((a) => a.value !== e.value);
249
249
  else {
250
- if (b && l.length >= b)
250
+ if (b && n.length >= b)
251
251
  return;
252
- i = [...s, e];
252
+ i = [...l, e];
253
253
  }
254
254
  v(i), u && u(i, {
255
- action: n ? "deselect-option" : "select-option",
255
+ action: s ? "deselect-option" : "select-option",
256
256
  option: e
257
257
  });
258
258
  }
@@ -260,14 +260,14 @@ const Tt = (Ve) => {
260
260
  v(e), u && u(e, {
261
261
  action: "select-option",
262
262
  option: e
263
- }), qe && (Te(!1), Ae?.(e, void 0), Z(""));
264
- }, Se = async () => {
265
- if (!(!m || k || p)) {
266
- if (R.length > 3e3) {
263
+ }), qe && (Te(!1), Oe?.(e, void 0), Z(""));
264
+ }, ye = async () => {
265
+ if (!(!p || k || h)) {
266
+ if (H.length > 3e3) {
267
267
  try {
268
268
  const e = await ut(
269
269
  d,
270
- T(d),
270
+ L(d),
271
271
  b
272
272
  );
273
273
  v(e), u && u(e, { action: "select-option" });
@@ -275,19 +275,19 @@ const Tt = (Ve) => {
275
275
  }
276
276
  return;
277
277
  }
278
- if (G) {
278
+ if (M) {
279
279
  let e = !1;
280
- for (const l of f)
281
- if (!l.isGroup && !l.isSubmenuParent && !l.isDisabled) {
280
+ for (const n of f)
281
+ if (!n.isGroup && !n.isSubmenuParent && !n.isDisabled) {
282
282
  e = !0;
283
283
  break;
284
284
  }
285
285
  if (!e)
286
286
  return;
287
287
  const t = d || [];
288
- if (T(t)) {
289
- const l = t.excludedValues, { totalVisible: s, selectedVisible: n } = q, i = s > 0 && s === n;
290
- let a = [...l];
288
+ if (L(t)) {
289
+ const n = t.excludedValues, { totalVisible: l, selectedVisible: s } = B, i = l > 0 && l === s;
290
+ let a = [...n];
291
291
  if (i)
292
292
  for (const o of f)
293
293
  !o.isGroup && !o.isSubmenuParent && !o.isDisabled && (a.includes(o.value) || a.push(o.value));
@@ -303,8 +303,8 @@ const Tt = (Ve) => {
303
303
  };
304
304
  v(c), u && u(c, { action: "select-option" });
305
305
  } else if (V(t)) {
306
- const l = t, { totalVisible: s, selectedVisible: n } = q, i = s > 0 && s === n;
307
- let a = [...l];
306
+ const n = t, { totalVisible: l, selectedVisible: s } = B, i = l > 0 && l === s;
307
+ let a = [...n];
308
308
  if (i) {
309
309
  const c = /* @__PURE__ */ new Set();
310
310
  for (const o of f)
@@ -320,53 +320,53 @@ const Tt = (Ve) => {
320
320
  v(a), u && u(a, { action: "select-option" });
321
321
  }
322
322
  } else if (b) {
323
- const e = d, { totalVisible: t } = q, l = V(e) ? e.length : 0, s = Math.min(t, b);
324
- if (V(e) && l >= s && l > 0) {
325
- const n = e.filter((i) => i.isDisabled);
326
- v(n), u && u(n, {
323
+ const e = d, { totalVisible: t } = B, n = V(e) ? e.length : 0, l = Math.min(t, b);
324
+ if (V(e) && n >= l && n > 0) {
325
+ const s = e.filter((i) => i.isDisabled);
326
+ v(s), u && u(s, {
327
327
  action: "select-option"
328
328
  });
329
329
  } else if (V(e)) {
330
- const n = e.filter(
330
+ const s = e.filter(
331
331
  (a) => a.isDisabled
332
332
  );
333
- let i = n.length;
333
+ let i = s.length;
334
334
  for (const a of f)
335
- if (!a.isGroup && !a.isSubmenuParent && !a.isDisabled && (n.push(a), i++, i >= b))
335
+ if (!a.isGroup && !a.isSubmenuParent && !a.isDisabled && (s.push(a), i++, i >= b))
336
336
  break;
337
- v(n), u && u(n, {
337
+ v(s), u && u(s, {
338
338
  action: "select-option"
339
339
  });
340
340
  }
341
341
  } else {
342
- const e = d, t = T(e) && e.excludedValues.length === 0;
342
+ const e = d, t = L(e) && e.excludedValues.length === 0;
343
343
  if (Ve.enableInvertedSelection)
344
344
  if (t) {
345
- const l = V(e) ? e.filter((s) => s.isDisabled) : [];
346
- v(l), u && u(l, {
345
+ const n = V(e) ? e.filter((l) => l.isDisabled) : [];
346
+ v(n), u && u(n, {
347
347
  action: "select-option"
348
348
  });
349
349
  } else {
350
- const s = {
350
+ const l = {
351
351
  isAllSelected: !0,
352
352
  excludedValues: f.filter(
353
- (n) => n.isDisabled && (V(e) ? !e.some((i) => i.value === n.value) : !0)
354
- ).map((n) => n.value)
353
+ (s) => s.isDisabled && (V(e) ? !e.some((i) => i.value === s.value) : !0)
354
+ ).map((s) => s.value)
355
355
  };
356
- v(s), u && u(s, { action: "select-option" });
356
+ v(l), u && u(l, { action: "select-option" });
357
357
  }
358
358
  else {
359
- const { totalVisible: l, selectedVisible: s } = q;
360
- if (l > 0 && l === s) {
361
- const n = V(e) ? e.filter((i) => i.isDisabled) : [];
362
- v(n), u && u(n, {
359
+ const { totalVisible: n, selectedVisible: l } = B;
360
+ if (n > 0 && n === l) {
361
+ const s = V(e) ? e.filter((i) => i.isDisabled) : [];
362
+ v(s), u && u(s, {
363
363
  action: "select-option"
364
364
  });
365
365
  } else {
366
- const n = V(e) ? e.filter((i) => i.isDisabled) : [];
366
+ const s = V(e) ? e.filter((i) => i.isDisabled) : [];
367
367
  for (const i of f)
368
- !i.isGroup && !i.isSubmenuParent && !i.isDisabled && n.push(i);
369
- v(n), u && u(n, {
368
+ !i.isGroup && !i.isSubmenuParent && !i.isDisabled && s.push(i);
369
+ v(s), u && u(s, {
370
370
  action: "select-option"
371
371
  });
372
372
  }
@@ -374,131 +374,135 @@ const Tt = (Ve) => {
374
374
  }
375
375
  }
376
376
  }, dt = (e) => {
377
- if (e.stopPropagation(), !p)
378
- if (m) {
379
- const t = [], l = (n) => {
380
- for (const i of n) {
377
+ if (e.stopPropagation(), !h)
378
+ if (p) {
379
+ const t = [], n = (s) => {
380
+ for (const i of s) {
381
381
  if (D && "options" in i) {
382
- l(
382
+ n(
383
383
  i.options
384
384
  );
385
385
  continue;
386
386
  }
387
- if (S && "children" in i && Array.isArray(i.children)) {
388
- l(i.children);
387
+ if (y && "children" in i && Array.isArray(i.children)) {
388
+ n(i.children);
389
389
  continue;
390
390
  }
391
391
  const a = i;
392
- a.isDisabled && (y.mode === "exclude" ? !y.set.has(a.value) : y.set.has(a.value)) && t.push(a);
392
+ a.isDisabled && (S.mode === "exclude" ? !S.set.has(a.value) : S.set.has(a.value)) && t.push(a);
393
393
  }
394
394
  };
395
- l(R);
396
- const s = t;
397
- v(s), u && u(s, { action: "clear" }), Ee?.();
395
+ n(H);
396
+ const l = t;
397
+ v(l), u && u(l, { action: "clear" }), Ee?.();
398
398
  } else {
399
399
  const t = d;
400
400
  if (t) {
401
- let s;
402
- const n = (i) => {
401
+ let l;
402
+ const s = (i) => {
403
403
  for (const a of i) {
404
- if (s) return;
404
+ if (l) return;
405
405
  if (D && "options" in a) {
406
- if (n(
406
+ if (s(
407
407
  a.options
408
- ), s) return;
408
+ ), l) return;
409
409
  continue;
410
410
  }
411
- if (S && "children" in a && Array.isArray(a.children)) {
412
- if (n(
411
+ if (y && "children" in a && Array.isArray(a.children)) {
412
+ if (s(
413
413
  a.children
414
- ), s) return;
414
+ ), l) return;
415
415
  continue;
416
416
  }
417
417
  const c = a;
418
418
  if (c.value === t.value) {
419
- s = c;
419
+ l = c;
420
420
  return;
421
421
  }
422
422
  }
423
423
  };
424
- if (n(R), s?.isDisabled)
424
+ if (s(H), l?.isDisabled)
425
425
  return;
426
426
  }
427
- const l = null;
428
- v(l), u && u(l, { action: "clear" }), Ee?.();
427
+ const n = null;
428
+ v(n), u && u(n, { action: "clear" }), Ee?.();
429
429
  }
430
430
  }, ft = (e) => Dt(
431
431
  e,
432
432
  ke ?? !1,
433
- m ?? !1,
433
+ p ?? !1,
434
434
  Ke,
435
435
  d
436
436
  ), se = (e) => De ? De(e) : e.label, Ge = () => {
437
437
  const e = [];
438
- return !E && !I && !_ && m && Q && !p && f.length > 0 && e.push(J), f.forEach((l, s) => {
439
- !l.isGroup && !(S && l.isSubmenuParent) && !l.isDisabled && e.push(s);
438
+ return !E && !A && !j && p && Q && !h && f.length > 0 && e.push(J), f.forEach((n, l) => {
439
+ !n.isGroup && !(y && n.isSubmenuParent) && !n.isDisabled && e.push(l);
440
440
  }), e;
441
- }, mt = (e) => {
442
- if (k || p) return;
443
- if (!h) {
444
- (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), xe.current = !0, K(!0));
441
+ }, pt = (e) => {
442
+ if (k || h) return;
443
+ if (e.key === "Tab") {
444
+ m && T(!1);
445
445
  return;
446
446
  }
447
- if (L && z === "menu" && !p && j.current) {
448
- document.activeElement !== j.current && j.current.focus();
447
+ if (!m) {
448
+ (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), xe.current = !0, T(!0));
449
+ return;
450
+ }
451
+ if (z && G === "menu" && !h && q.current) {
452
+ document.activeElement !== q.current && q.current.focus();
449
453
  return;
450
454
  }
451
455
  const t = Ge();
452
456
  if (t.length === 0) return;
453
- const l = t.indexOf(O);
457
+ const n = t.indexOf(C);
454
458
  if (e.key === "ArrowDown") {
455
459
  e.preventDefault();
456
- const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
457
- A(n), n >= 0 && N.scrollToIndex(n, { align: "auto" });
460
+ const l = n < t.length - 1 ? n + 1 : 0, s = t[l];
461
+ O(s), s >= 0 && N.scrollToIndex(s, { align: "auto" });
458
462
  } else if (e.key === "ArrowUp") {
459
463
  e.preventDefault();
460
- const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
461
- A(n), n >= 0 && N.scrollToIndex(n, { align: "auto" });
464
+ const l = n > 0 ? n - 1 : t.length - 1, s = t[l];
465
+ O(s), s >= 0 && N.scrollToIndex(s, { align: "auto" });
462
466
  } else if (e.key === "Enter" || e.key === " ") {
463
- if (e.preventDefault(), O === J)
464
- Se();
465
- else if (O >= 0 && O < f.length) {
466
- const s = f[O];
467
- s.isDisabled || ne(s);
467
+ if (e.preventDefault(), C === J)
468
+ ye();
469
+ else if (C >= 0 && C < f.length) {
470
+ const l = f[C];
471
+ l.isDisabled || le(l);
468
472
  }
469
473
  } else if (e.key === "Escape")
470
- e.preventDefault(), K(!1), ge.current?.focus();
474
+ e.preventDefault(), T(!1), ge.current?.focus();
471
475
  else if (e.key === "Home")
472
- e.preventDefault(), t.length > 0 && (A(t[0]), t[0] >= 0 && N.scrollToIndex(t[0], { align: "auto" }));
476
+ e.preventDefault(), t.length > 0 && (O(t[0]), t[0] >= 0 && N.scrollToIndex(t[0], { align: "auto" }));
473
477
  else if (e.key === "End" && (e.preventDefault(), t.length > 0)) {
474
- const s = t[t.length - 1];
475
- A(s), s >= 0 && N.scrollToIndex(s, { align: "auto" });
478
+ const l = t[t.length - 1];
479
+ O(l), l >= 0 && N.scrollToIndex(l, { align: "auto" });
476
480
  }
477
- }, pt = (e) => {
481
+ }, mt = (e) => {
478
482
  const t = Ge();
479
483
  if (t.length === 0) return;
480
- const l = t.indexOf(O);
484
+ const n = t.indexOf(C);
481
485
  if (e.key === "ArrowDown") {
482
486
  e.preventDefault();
483
- const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
484
- A(n), n >= 0 && N.scrollToIndex(n, { align: "auto" });
487
+ const l = n < t.length - 1 ? n + 1 : 0, s = t[l];
488
+ O(s), s >= 0 && N.scrollToIndex(s, { align: "auto" });
485
489
  } else if (e.key === "ArrowUp") {
486
490
  e.preventDefault();
487
- const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
488
- A(n), n >= 0 && N.scrollToIndex(n, { align: "auto" });
491
+ const l = n > 0 ? n - 1 : t.length - 1, s = t[l];
492
+ O(s), s >= 0 && N.scrollToIndex(s, { align: "auto" });
489
493
  } else if (e.key === "Enter") {
490
- if (e.preventDefault(), O === J)
491
- Se();
492
- else if (O >= 0 && O < f.length) {
493
- const s = f[O];
494
- s.isDisabled || ne(s);
494
+ if (e.preventDefault(), C === J)
495
+ ye();
496
+ else if (C >= 0 && C < f.length) {
497
+ const l = f[C];
498
+ l.isDisabled || le(l);
495
499
  }
496
- } else e.key === "Escape" && (e.preventDefault(), K(!1), ge.current?.focus());
500
+ } else e.key === "Escape" && (e.preventDefault(), T(!1), ge.current?.focus());
497
501
  }, ht = () => {
498
- if (m) {
502
+ if (p) {
499
503
  const e = d || [];
500
504
  let t = 0;
501
- return T(e) ? t = $e - e.excludedValues.length : V(e) && (t = e.length), t === 0 ? null : t === 1 && V(e) ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", k ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: se(e[0]) }) : /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", k ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: Y("select.selectedCount", { count: t }) });
505
+ return L(e) ? t = ze - e.excludedValues.length : V(e) && (t = e.length), t === 0 ? null : t === 1 && V(e) ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", k ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: se(e[0]) }) : /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", k ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: Y("select.selectedCount", { count: t }) });
502
506
  } else {
503
507
  const e = d;
504
508
  return e ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", k ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: se(e) }) : null;
@@ -515,7 +519,7 @@ const Tt = (Ve) => {
515
519
  "data-testid": `select-${P || "default"}`,
516
520
  "data-component": "select",
517
521
  children: [
518
- H && /* @__PURE__ */ g(
522
+ _ && /* @__PURE__ */ g(
519
523
  "label",
520
524
  {
521
525
  className: w(
@@ -523,7 +527,7 @@ const Tt = (Ve) => {
523
527
  fe === "left" ? "shrink-0" : ""
524
528
  ),
525
529
  children: [
526
- H,
530
+ _,
527
531
  " ",
528
532
  Ue && /* @__PURE__ */ r("span", { className: "text-[red]", children: "*" })
529
533
  ]
@@ -537,7 +541,7 @@ const Tt = (Ve) => {
537
541
  X && de === "absolute" && "relative"
538
542
  ),
539
543
  children: [
540
- /* @__PURE__ */ g(ae.Root, { open: h, onOpenChange: K, children: [
544
+ /* @__PURE__ */ g(ae.Root, { open: m, onOpenChange: T, children: [
541
545
  /* @__PURE__ */ r(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
542
546
  "div",
543
547
  {
@@ -546,9 +550,9 @@ const Tt = (Ve) => {
546
550
  "relative h-[32px] w-full cursor-pointer rounded-[8px] border border-solid px-3 py-1 text-left shadow-sm sm:text-sm transition-all flex items-center overflow-hidden",
547
551
  ue ? "border-[#e15554] focus-visible:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus-visible:border-indigo-500 focus-visible:ring-1 focus-visible:ring-indigo-500",
548
552
  k ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
549
- p ? "cursor-default bg-[#f2f4fb]" : "",
550
- h ? "ring-1 ring-indigo-500 border-indigo-500" : "",
551
- !k && !p && "bg-white",
553
+ h ? "cursor-default bg-[#f2f4fb]" : "",
554
+ m ? "ring-1 ring-indigo-500 border-indigo-500" : "",
555
+ !k && !h && "bg-white",
552
556
  We
553
557
  ),
554
558
  id: P,
@@ -556,15 +560,22 @@ const Tt = (Ve) => {
556
560
  onFocus: rt,
557
561
  onBlur: at,
558
562
  role: "combobox",
559
- "aria-expanded": h,
563
+ "aria-expanded": m,
560
564
  "aria-haspopup": "listbox",
561
- "aria-label": H ? String(H) : me,
565
+ "aria-label": _ ? String(_) : pe,
562
566
  "data-component": "select-trigger",
563
567
  "data-disabled": k || void 0,
564
- "data-state": h ? "open" : "closed",
565
- onKeyDown: mt,
568
+ "data-state": m ? "open" : "closed",
569
+ onKeyDown: pt,
570
+ onClick: (e) => {
571
+ const t = e.target, n = t.closest("[data-chevron-button]"), l = t.closest("[data-clear-button]");
572
+ if (n || l) {
573
+ e.preventDefault(), e.stopPropagation();
574
+ return;
575
+ }
576
+ },
566
577
  children: /* @__PURE__ */ g("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
567
- Ie && /* @__PURE__ */ r("div", { className: "flex items-center text-gray-500 shrink-0", children: Ie }),
578
+ Ae && /* @__PURE__ */ r("div", { className: "flex items-center text-gray-500 shrink-0", children: Ae }),
568
579
  /* @__PURE__ */ g(
569
580
  "div",
570
581
  {
@@ -577,16 +588,16 @@ const Tt = (Ve) => {
577
588
  className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
578
589
  "data-testid": `select-placeholder-${P || "default"}`,
579
590
  "data-has-value": !1,
580
- children: me
591
+ children: pe
581
592
  }
582
593
  ),
583
- L && h && z === "trigger" && !p && /* @__PURE__ */ r(
594
+ z && m && G === "trigger" && !h && /* @__PURE__ */ r(
584
595
  "input",
585
596
  {
586
597
  ref: ct,
587
598
  type: "text",
588
599
  className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
589
- value: G,
600
+ value: M,
590
601
  onChange: (e) => Z(e.target.value),
591
602
  onClick: (e) => e.stopPropagation(),
592
603
  autoFocus: je,
@@ -596,25 +607,40 @@ const Tt = (Ve) => {
596
607
  ]
597
608
  }
598
609
  ),
599
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !h && (E || I) ? /* @__PURE__ */ r(wt, { size: "14px" }) : /* @__PURE__ */ g(gt, { children: [
600
- He && !p && !k && (m && (T(
610
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !m && (E || A) ? /* @__PURE__ */ r(wt, { size: "14px" }) : /* @__PURE__ */ g(gt, { children: [
611
+ He && !h && !k && (p && (L(
601
612
  d
602
- ) && d.isAllSelected || V(d) && d.length > 0) || !m && d) && /* @__PURE__ */ r(
613
+ ) && d.isAllSelected || V(d) && d.length > 0) || !p && d) && /* @__PURE__ */ r(
603
614
  "div",
604
615
  {
605
616
  role: "button",
606
- onClick: dt,
607
- className: "hover:text-gray-600 p-0.5",
617
+ "data-clear-button": !0,
618
+ onPointerDown: (e) => {
619
+ e.preventDefault(), e.stopPropagation(), dt(e);
620
+ },
621
+ className: "hover:text-gray-600 p-0.5 cursor-pointer z-10 relative",
608
622
  children: /* @__PURE__ */ r(Vt, { size: "11px", color: "#758490" })
609
623
  }
610
624
  ),
611
625
  /* @__PURE__ */ r(
612
- Me,
626
+ "div",
613
627
  {
614
- size: "16px",
615
- className: w(
616
- "transition-transform duration-200",
617
- h ? "-rotate-90" : "rotate-90"
628
+ role: "button",
629
+ "data-chevron-button": !0,
630
+ "aria-label": m ? "Close dropdown" : "Open dropdown",
631
+ onPointerDown: (e) => {
632
+ e.preventDefault(), e.stopPropagation(), T(!m);
633
+ },
634
+ className: "hover:text-gray-600 p-0.5 cursor-pointer z-10 relative",
635
+ children: /* @__PURE__ */ r(
636
+ Me,
637
+ {
638
+ size: "16px",
639
+ className: w(
640
+ "transition-transform duration-200",
641
+ m ? "-rotate-90" : "rotate-90"
642
+ )
643
+ }
618
644
  )
619
645
  }
620
646
  )
@@ -632,8 +658,8 @@ const Tt = (Ve) => {
632
658
  avoidCollisions: !0,
633
659
  collisionPadding: 8,
634
660
  onOpenAutoFocus: (e) => e.preventDefault(),
635
- onInteractOutside: () => K(!1),
636
- onFocusOutside: () => K(!1),
661
+ onInteractOutside: () => T(!1),
662
+ onFocusOutside: () => T(!1),
637
663
  onWheel: (e) => e.stopPropagation(),
638
664
  style: {
639
665
  width: it || "var(--radix-popover-trigger-width)",
@@ -642,7 +668,7 @@ const Tt = (Ve) => {
642
668
  },
643
669
  className: w(
644
670
  "z-50 overflow-hidden rounded-[12px] text-base shadow-[0px_1px_6px_0px_rgba(26,39,124,0.14)] focus:outline-none sm:text-sm flex flex-col border-none pointer-events-auto",
645
- p ? "bg-[#f5f5f5]" : "bg-white"
671
+ h ? "bg-[#f5f5f5]" : "bg-white"
646
672
  ),
647
673
  "data-testid": `select-menu-${P || "default"}`,
648
674
  "data-component": "select-menu",
@@ -652,11 +678,11 @@ const Tt = (Ve) => {
652
678
  {
653
679
  className: w(
654
680
  "flex flex-col z-10 sticky top-0 px-[6px] pt-[8px]",
655
- p ? "bg-[#f5f5f5]" : "bg-white",
656
- !_ && (L && z === "menu" && !p || m && Q && !p && f.length > 0) ? "border-b border-solid border-gray-100" : ""
681
+ h ? "bg-[#f5f5f5]" : "bg-white",
682
+ !j && (z && G === "menu" && !h || p && Q && !h && f.length > 0) ? "border-b border-solid border-gray-100" : ""
657
683
  ),
658
684
  children: [
659
- L && z === "menu" && !p && !_ && /* @__PURE__ */ r(
685
+ z && G === "menu" && !h && !j && /* @__PURE__ */ r(
660
686
  "div",
661
687
  {
662
688
  className: "p-0",
@@ -666,15 +692,15 @@ const Tt = (Ve) => {
666
692
  /* @__PURE__ */ r(
667
693
  "input",
668
694
  {
669
- ref: j,
695
+ ref: q,
670
696
  type: "text",
671
697
  className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus-visible:ring-1 focus-visible:ring-indigo-500 focus-visible:rounded-md",
672
698
  placeholder: Y("select.searchHere"),
673
- value: G,
674
- onKeyDown: pt,
699
+ value: M,
700
+ onKeyDown: mt,
675
701
  onChange: (e) => {
676
702
  const t = e.target.value;
677
- G === "" && t !== "" ? ee.current && pe(ee.current.offsetHeight) : t === "" && pe(void 0), Z(t), Je?.(t);
703
+ M === "" && t !== "" ? ee.current && me(ee.current.offsetHeight) : t === "" && me(void 0), Z(t), Je?.(t);
678
704
  },
679
705
  onClick: (e) => e.stopPropagation(),
680
706
  "data-testid": `select-search-input-${P || "default"}`
@@ -683,7 +709,7 @@ const Tt = (Ve) => {
683
709
  ] })
684
710
  }
685
711
  ),
686
- !E && !I && !_ && m && Q && !p && f.length > 0 && /* @__PURE__ */ r(
712
+ !E && !A && !j && p && Q && !h && f.length > 0 && /* @__PURE__ */ r(
687
713
  "div",
688
714
  {
689
715
  className: "pb-1",
@@ -693,9 +719,9 @@ const Tt = (Ve) => {
693
719
  {
694
720
  className: w(
695
721
  "flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
696
- O === J && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
722
+ C === J && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
697
723
  ),
698
- onClick: Se,
724
+ onClick: ye,
699
725
  role: "option",
700
726
  "aria-selected": !1,
701
727
  "data-testid": `select-select-all-button-${P || "default"}`,
@@ -704,12 +730,12 @@ const Tt = (Ve) => {
704
730
  Fe,
705
731
  {
706
732
  checked: (() => {
707
- const { totalVisible: e, selectedVisible: t } = q;
733
+ const { totalVisible: e, selectedVisible: t } = B;
708
734
  if (e === 0) return !1;
709
- const l = b ? Math.min(e, b) : e;
710
- return t > 0 && t < l ? "indeterminate" : t >= l;
735
+ const n = b ? Math.min(e, b) : e;
736
+ return t > 0 && t < n ? "indeterminate" : t >= n;
711
737
  })(),
712
- disabled: k || p,
738
+ disabled: k || h,
713
739
  onChange: () => {
714
740
  },
715
741
  "data-testid": `select-select-all-checkbox-${P || "default"}`
@@ -721,8 +747,8 @@ const Tt = (Ve) => {
721
747
  className: "text-sm font-medium text-gray-700",
722
748
  "data-testid": `select-select-all-label-${P || "default"}`,
723
749
  children: (() => {
724
- const { totalVisible: e, selectedVisible: t } = q, l = b ? Math.min(e, b) : e, s = e > 0 && t >= l;
725
- return Y(s ? "select.unselectAll" : "select.selectAll");
750
+ const { totalVisible: e, selectedVisible: t } = B, n = b ? Math.min(e, b) : e, l = e > 0 && t >= n;
751
+ return Y(l ? "select.unselectAll" : "select.selectAll");
726
752
  })()
727
753
  }
728
754
  )
@@ -739,30 +765,30 @@ const Tt = (Ve) => {
739
765
  {
740
766
  ref: te,
741
767
  role: "listbox",
742
- "aria-label": H ? String(H) : me,
768
+ "aria-label": _ ? String(_) : pe,
743
769
  className: "flex-1 overflow-auto py-1 px-[6px]",
744
770
  style: {
745
771
  maxHeight: "297px",
746
772
  overscrollBehavior: "contain"
747
773
  },
748
774
  onWheel: (e) => e.stopPropagation(),
749
- children: _ ? /* @__PURE__ */ g("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
775
+ children: j ? /* @__PURE__ */ g("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
750
776
  /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 font-medium mb-3", children: "Something went wrong" }),
751
- Ce && /* @__PURE__ */ r(
777
+ Ie && /* @__PURE__ */ r(
752
778
  kt,
753
779
  {
754
780
  size: "sm",
755
781
  variant: "outline",
756
- onClick: () => Ce(),
782
+ onClick: () => Ie(),
757
783
  children: "Refetch"
758
784
  }
759
785
  )
760
- ] }) : f.length === 0 && !E && !I ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : E || I ? /* @__PURE__ */ r("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g(
786
+ ] }) : f.length === 0 && !E && !A ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : E || A ? /* @__PURE__ */ r("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g(
761
787
  "div",
762
788
  {
763
789
  className: "flex items-center gap-2 px-3 py-2 animate-pulse",
764
790
  children: [
765
- m && /* @__PURE__ */ r("div", { className: "w-4 h-4 bg-gray-200 rounded shrink-0" }),
791
+ p && /* @__PURE__ */ r("div", { className: "w-4 h-4 bg-gray-200 rounded shrink-0" }),
766
792
  /* @__PURE__ */ r("div", { className: "h-4 bg-gray-200 rounded w-full" })
767
793
  ]
768
794
  },
@@ -776,7 +802,7 @@ const Tt = (Ve) => {
776
802
  position: "relative"
777
803
  },
778
804
  children: N.getVirtualItems().map((e) => {
779
- const t = f[e.index], l = m ? y.mode === "exclude" ? !y.set.has(t.value) : y.set.has(t.value) : d?.value === t.value, s = d || [], n = m && b ? T(s) ? !1 : V(s) && s.length >= b : !1, i = t.isDisabled || n && !l && !(D && t.isGroup) && !(S && t.isSubmenuParent), a = D && t.isGroup || S && t.isSubmenuParent ? be(t.original) : void 0, c = a?.selected || 0, o = a?.total || 0, x = c > 0 && c < o, ie = t.isParentSelectable !== !1, ye = P || "default", re = String(t.value || ""), we = se(
805
+ const t = f[e.index], n = p ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value, l = d || [], s = p && b ? L(l) ? !1 : V(l) && l.length >= b : !1, i = t.isDisabled || s && !n && !(D && t.isGroup) && !(y && t.isSubmenuParent), a = D && t.isGroup || y && t.isSubmenuParent ? be(t.original) : void 0, c = a?.selected || 0, o = a?.total || 0, x = c > 0 && c < o, ie = t.isParentSelectable !== !1, Se = P || "default", re = String(t.value || ""), we = se(
780
806
  t
781
807
  ), xt = typeof we == "string" ? we : re;
782
808
  return /* @__PURE__ */ g(
@@ -789,59 +815,59 @@ const Tt = (Ve) => {
789
815
  transform: `translateY(${e.start}px)`,
790
816
  width: "100%"
791
817
  },
792
- "data-testid": `select-option-wrapper-${ye}-${re}`,
818
+ "data-testid": `select-option-wrapper-${Se}-${re}`,
793
819
  children: [
794
820
  /* @__PURE__ */ r(
795
821
  "div",
796
822
  {
797
823
  className: w(
798
824
  "cursor-default select-none py-[6px] px-3 flex items-center justify-between transition-colors rounded-md",
799
- i ? "opacity-50 cursor-not-allowed bg-[#f5f5f5]" : p ? "cursor-default" : "hover:bg-gray-100 cursor-pointer",
800
- l && !i && !(D && t.isGroup) && !(S && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
801
- O === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
825
+ i ? "opacity-50 cursor-not-allowed bg-[#f5f5f5]" : h ? "cursor-default" : "hover:bg-gray-100 cursor-pointer",
826
+ n && !i && !(D && t.isGroup) && !(y && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
827
+ C === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
802
828
  ),
803
829
  style: {
804
830
  paddingLeft: `${t.depth * 16 + 12}px`
805
831
  },
806
832
  onClick: () => {
807
- i || (D && t.isGroup || S && t.isSubmenuParent) && !ie || ne(t);
833
+ i || (D && t.isGroup || y && t.isSubmenuParent) && !ie || le(t);
808
834
  },
809
- onMouseEnter: (M) => {
810
- if (S && t.isSubmenuParent) {
835
+ onMouseEnter: (F) => {
836
+ if (y && t.isSubmenuParent) {
811
837
  he(t.value);
812
- const U = M.currentTarget.getBoundingClientRect();
838
+ const U = F.currentTarget.getBoundingClientRect();
813
839
  t.rect = U;
814
840
  } else
815
841
  he(null);
816
842
  },
817
- "data-testid": `select-option-${ye}-${re}`,
818
- "data-state": l ? "checked" : "unchecked",
843
+ "data-testid": `select-option-${Se}-${re}`,
844
+ "data-state": n ? "checked" : "unchecked",
819
845
  "data-disabled": i || void 0,
820
846
  "data-component": "select-option",
821
847
  role: "option",
822
- "aria-selected": l,
848
+ "aria-selected": n,
823
849
  "aria-disabled": i || void 0,
824
- children: Oe ? Oe(
850
+ children: Ce ? Ce(
825
851
  {
826
852
  onClick: () => {
827
853
  },
828
854
  className: "w-full",
829
- selected: l,
855
+ selected: n,
830
856
  disabled: i
831
857
  },
832
858
  t
833
859
  ) : /* @__PURE__ */ g("div", { className: "flex items-center flex-1 overflow-hidden", children: [
834
- m && (D && t.isGroup || S && t.isSubmenuParent ? ie : !0) && /* @__PURE__ */ r(
860
+ p && (D && t.isGroup || y && t.isSubmenuParent ? ie : !0) && /* @__PURE__ */ r(
835
861
  Fe,
836
862
  {
837
- checked: x ? "indeterminate" : l,
838
- disabled: i || p,
863
+ checked: x ? "indeterminate" : n,
864
+ disabled: i || h,
839
865
  onChange: () => {
840
866
  }
841
867
  }
842
868
  ),
843
- ke && !(D && t.isGroup) && !(S && t.isSubmenuParent) ? /* @__PURE__ */ r(
844
- St,
869
+ ke && !(D && t.isGroup) && !(y && t.isSubmenuParent) ? /* @__PURE__ */ r(
870
+ yt,
845
871
  {
846
872
  label: se(
847
873
  t
@@ -854,18 +880,18 @@ const Tt = (Ve) => {
854
880
  {
855
881
  className: w(
856
882
  "block truncate",
857
- D && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(S && t.isSubmenuParent) ? "font-medium" : "font-normal",
883
+ D && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : n && !(y && t.isSubmenuParent) ? "font-medium" : "font-normal",
858
884
  !(D && t.isGroup) && "text-[14px]"
859
885
  ),
860
- "data-testid": `select-option-label-${ye}-${re}`,
861
- "data-state": l ? "checked" : "unchecked",
886
+ "data-testid": `select-option-label-${Se}-${re}`,
887
+ "data-state": n ? "checked" : "unchecked",
862
888
  title: xt,
863
889
  children: we
864
890
  }
865
891
  ),
866
- (D && t.isGroup || S && t.isSubmenuParent) && c > 0 && /* @__PURE__ */ r("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800", children: c })
892
+ (D && t.isGroup || y && t.isSubmenuParent) && c > 0 && /* @__PURE__ */ r("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800", children: c })
867
893
  ] }),
868
- S && t.isSubmenuParent && /* @__PURE__ */ r(
894
+ y && t.isSubmenuParent && /* @__PURE__ */ r(
869
895
  Me,
870
896
  {
871
897
  size: "12px",
@@ -875,19 +901,19 @@ const Tt = (Ve) => {
875
901
  ] })
876
902
  }
877
903
  ),
878
- S && ot === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ r(
879
- yt,
904
+ y && ot === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ r(
905
+ St,
880
906
  {
881
907
  parentOption: t,
882
- isMulti: !!m,
883
- isReadOnly: !!p,
884
- isSelected: (M) => Pt(M, d, !!m),
885
- getIndeterminateState: (M) => {
886
- const U = be(M);
908
+ isMulti: !!p,
909
+ isReadOnly: !!h,
910
+ isSelected: (F) => Pt(F, d, !!p),
911
+ getIndeterminateState: (F) => {
912
+ const U = be(F);
887
913
  return U ? U.selected > 0 && U.selected < U.total : !1;
888
914
  },
889
- getSelectedCount: (M) => be(M)?.selected || 0,
890
- handleSelect: ne,
915
+ getSelectedCount: (F) => be(F)?.selected || 0,
916
+ handleSelect: le,
891
917
  id: P
892
918
  }
893
919
  )
@@ -900,14 +926,14 @@ const Tt = (Ve) => {
900
926
  )
901
927
  }
902
928
  ),
903
- (Pe || b || R.length > 5e3) && /* @__PURE__ */ r("div", { className: "px-3 py-[10px] border-t border-solid border-gray-100 z-10 sticky bottom-0 bg-white", children: b ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
929
+ (Pe || b || H.length > 5e3) && /* @__PURE__ */ r("div", { className: "px-3 py-[10px] border-t border-solid border-gray-100 z-10 sticky bottom-0 bg-white", children: b ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
904
930
  /* @__PURE__ */ r(oe, { size: "12px", className: "text-gray-400" }),
905
931
  /* @__PURE__ */ g("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
906
932
  "Maximum ",
907
933
  b,
908
934
  " selections"
909
935
  ] })
910
- ] }) : R.length > 5e3 ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
936
+ ] }) : H.length > 5e3 ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
911
937
  /* @__PURE__ */ r(oe, { size: "12px", className: "text-gray-400" }),
912
938
  /* @__PURE__ */ r("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: "Large dataset detected. Operations might be slower." })
913
939
  ] }) : Pe })