@rinzai/zen 0.1.7 → 0.1.9

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.
package/dist/zen.js CHANGED
@@ -1,46 +1,46 @@
1
- import { jsx as b, jsxs as W, Fragment as Fe } from "react/jsx-runtime";
1
+ import { jsx as b, jsxs as W, Fragment as Ve } from "react/jsx-runtime";
2
2
  import * as C from "react";
3
- import { useLayoutEffect as tt, useEffect as re, useState as de, useId as nt, useMemo as ve, useRef as Ee } from "react";
4
- import * as ot from "react-dom";
5
- import { createPortal as st, flushSync as it } from "react-dom";
6
- const k = (...e) => e.reduce((o, t) => t == null || t === !1 ? o : typeof t == "string" || typeof t == "number" ? o + " " + t : Array.isArray(t) ? o + " " + k(...t) : typeof t == "object" ? o + " " + Object.entries(t).reduce((n, [s, i]) => i == null || i === !1 ? n : typeof i == "string" || typeof i == "number" ? n + " " + s + "-" + i : typeof i == "boolean" && i ? n + " " + s : n, "") : o, ""), Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ve = (e, o) => (t) => {
7
- var c;
8
- if ((o == null ? void 0 : o.variants) == null) return k(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
9
- const { variants: n, defaultVariants: s } = o, i = Object.keys(n).map((a) => {
10
- const u = t == null ? void 0 : t[a], d = s == null ? void 0 : s[a];
3
+ import { useLayoutEffect as ot, useEffect as re, useState as de, useId as it, useMemo as ve, useRef as Ee } from "react";
4
+ import * as st from "react-dom";
5
+ import { createPortal as rt, flushSync as lt } from "react-dom";
6
+ const M = (...e) => e.reduce((o, t) => t == null || t === !1 ? o : typeof t == "string" || typeof t == "number" ? o + " " + t : Array.isArray(t) ? o + " " + M(...t) : typeof t == "object" ? o + " " + Object.entries(t).reduce((n, [i, s]) => s == null || s === !1 ? n : typeof s == "string" || typeof s == "number" ? n + " " + i + "-" + s : typeof s == "boolean" && s ? n + " " + i : n, "") : o, ""), Ae = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, We = (e, o) => (t) => {
7
+ var a;
8
+ if ((o == null ? void 0 : o.variants) == null) return M(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
9
+ const { variants: n, defaultVariants: i } = o, s = Object.keys(n).map((c) => {
10
+ const u = t == null ? void 0 : t[c], d = i == null ? void 0 : i[c];
11
11
  if (u === null) return null;
12
- const m = Te(u) || Te(d);
13
- return n[a][m];
12
+ const h = Ae(u) || Ae(d);
13
+ return n[c][h];
14
14
  }), r = t && Object.entries(t).reduce(
15
- (a, [u, d]) => (d === void 0 || (a[u] = d), a),
15
+ (c, [u, d]) => (d === void 0 || (c[u] = d), c),
16
16
  {}
17
- ), l = (c = o == null ? void 0 : o.compoundVariants) == null ? void 0 : c.reduce(
18
- (a, { class: u, className: d, ...m }) => Object.entries(m).every(
17
+ ), l = (a = o == null ? void 0 : o.compoundVariants) == null ? void 0 : a.reduce(
18
+ (c, { class: u, className: d, ...h }) => Object.entries(h).every(
19
19
  ([f, g]) => Array.isArray(g) ? g.includes(
20
20
  {
21
- ...s,
21
+ ...i,
22
22
  ...r
23
23
  }[f]
24
24
  ) : {
25
- ...s,
25
+ ...i,
26
26
  ...r
27
27
  }[f] === g
28
- ) ? [...a, u, d] : a,
28
+ ) ? [...c, u, d] : c,
29
29
  []
30
30
  );
31
- return k(e, i, l, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
31
+ return M(e, s, l, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
32
32
  };
33
- function We({ variant: e, className: o, ...t }) {
34
- return /* @__PURE__ */ b("span", { ...t, className: rt({ variant: e, className: o }) });
33
+ function Be({ variant: e, className: o, ...t }) {
34
+ return /* @__PURE__ */ b("span", { ...t, className: ct({ variant: e, className: o }) });
35
35
  }
36
- const rt = Ve(
36
+ const ct = We(
37
37
  "zen__badge inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors whitespace-nowrap",
38
38
  {
39
39
  variants: {
40
40
  variant: {
41
- default: "border-transparent bg-primary text-primary-foreground shadow",
41
+ default: "border-transparent bg-primary text-primary-foreground shadow-sm",
42
42
  secondary: "border-transparent bg-secondary text-secondary-foreground",
43
- destructive: "border-transparent bg-destructive text-destructive-foreground shadow",
43
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow-sm",
44
44
  outline: "text-foreground"
45
45
  }
46
46
  },
@@ -49,18 +49,18 @@ const rt = Ve(
49
49
  }
50
50
  }
51
51
  );
52
- function lt({ className: e, variant: o, size: t, ...n }) {
53
- return /* @__PURE__ */ b("button", { className: ct({ variant: o, size: t, className: e }), ...n });
52
+ function at({ className: e, variant: o, size: t, ...n }) {
53
+ return /* @__PURE__ */ b("button", { className: ut({ variant: o, size: t, className: e }), ...n });
54
54
  }
55
- const ct = Ve(
56
- "zen__button inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
55
+ const ut = We(
56
+ "zen__button inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
57
57
  {
58
58
  variants: {
59
59
  variant: {
60
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
61
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
62
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
63
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
60
+ default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
61
+ destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",
62
+ outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
63
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
64
64
  ghost: "hover:bg-accent hover:text-accent-foreground",
65
65
  link: "text-primary underline-offset-4 hover:underline",
66
66
  icon: ""
@@ -77,19 +77,19 @@ const ct = Ve(
77
77
  size: "default"
78
78
  }
79
79
  }
80
- ), le = Math.min, H = Math.max, ce = Math.round, se = Math.floor, _ = (e) => ({
80
+ ), le = Math.min, H = Math.max, ce = Math.round, ie = Math.floor, _ = (e) => ({
81
81
  x: e,
82
82
  y: e
83
- }), at = {
83
+ }), ft = {
84
84
  left: "right",
85
85
  right: "left",
86
86
  bottom: "top",
87
87
  top: "bottom"
88
- }, ut = {
88
+ }, dt = {
89
89
  start: "end",
90
90
  end: "start"
91
91
  };
92
- function Ae(e, o, t) {
92
+ function Te(e, o, t) {
93
93
  return H(e, le(o, t));
94
94
  }
95
95
  function he(e, o) {
@@ -101,53 +101,53 @@ function U(e) {
101
101
  function me(e) {
102
102
  return e.split("-")[1];
103
103
  }
104
- function Be(e) {
104
+ function je(e) {
105
105
  return e === "x" ? "y" : "x";
106
106
  }
107
- function je(e) {
107
+ function $e(e) {
108
108
  return e === "y" ? "height" : "width";
109
109
  }
110
110
  function G(e) {
111
111
  return ["top", "bottom"].includes(U(e)) ? "y" : "x";
112
112
  }
113
- function $e(e) {
114
- return Be(G(e));
113
+ function He(e) {
114
+ return je(G(e));
115
115
  }
116
- function ft(e, o, t) {
116
+ function ht(e, o, t) {
117
117
  t === void 0 && (t = !1);
118
- const n = me(e), s = $e(e), i = je(s);
119
- let r = s === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
120
- return o.reference[i] > o.floating[i] && (r = ae(r)), [r, ae(r)];
118
+ const n = me(e), i = He(e), s = $e(i);
119
+ let r = i === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
120
+ return o.reference[s] > o.floating[s] && (r = ae(r)), [r, ae(r)];
121
121
  }
122
- function dt(e) {
122
+ function mt(e) {
123
123
  const o = ae(e);
124
124
  return [Se(e), o, Se(o)];
125
125
  }
126
126
  function Se(e) {
127
- return e.replace(/start|end/g, (o) => ut[o]);
127
+ return e.replace(/start|end/g, (o) => dt[o]);
128
128
  }
129
- function ht(e, o, t) {
130
- const n = ["left", "right"], s = ["right", "left"], i = ["top", "bottom"], r = ["bottom", "top"];
129
+ function gt(e, o, t) {
130
+ const n = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
131
131
  switch (e) {
132
132
  case "top":
133
133
  case "bottom":
134
- return t ? o ? s : n : o ? n : s;
134
+ return t ? o ? i : n : o ? n : i;
135
135
  case "left":
136
136
  case "right":
137
- return o ? i : r;
137
+ return o ? s : r;
138
138
  default:
139
139
  return [];
140
140
  }
141
141
  }
142
- function mt(e, o, t, n) {
143
- const s = me(e);
144
- let i = ht(U(e), t === "start", n);
145
- return s && (i = i.map((r) => r + "-" + s), o && (i = i.concat(i.map(Se)))), i;
142
+ function pt(e, o, t, n) {
143
+ const i = me(e);
144
+ let s = gt(U(e), t === "start", n);
145
+ return i && (s = s.map((r) => r + "-" + i), o && (s = s.concat(s.map(Se)))), s;
146
146
  }
147
147
  function ae(e) {
148
- return e.replace(/left|right|bottom|top/g, (o) => at[o]);
148
+ return e.replace(/left|right|bottom|top/g, (o) => ft[o]);
149
149
  }
150
- function gt(e) {
150
+ function xt(e) {
151
151
  return {
152
152
  top: 0,
153
153
  right: 0,
@@ -156,8 +156,8 @@ function gt(e) {
156
156
  ...e
157
157
  };
158
158
  }
159
- function pt(e) {
160
- return typeof e != "number" ? gt(e) : {
159
+ function wt(e) {
160
+ return typeof e != "number" ? xt(e) : {
161
161
  top: e,
162
162
  right: e,
163
163
  bottom: e,
@@ -169,15 +169,15 @@ function ue(e) {
169
169
  x: o,
170
170
  y: t,
171
171
  width: n,
172
- height: s
172
+ height: i
173
173
  } = e;
174
174
  return {
175
175
  width: n,
176
- height: s,
176
+ height: i,
177
177
  top: t,
178
178
  left: o,
179
179
  right: o + n,
180
- bottom: t + s,
180
+ bottom: t + i,
181
181
  x: o,
182
182
  y: t
183
183
  };
@@ -185,15 +185,15 @@ function ue(e) {
185
185
  function ze(e, o, t) {
186
186
  let {
187
187
  reference: n,
188
- floating: s
188
+ floating: i
189
189
  } = e;
190
- const i = G(o), r = $e(o), l = je(r), c = U(o), a = i === "y", u = n.x + n.width / 2 - s.width / 2, d = n.y + n.height / 2 - s.height / 2, m = n[l] / 2 - s[l] / 2;
190
+ const s = G(o), r = He(o), l = $e(r), a = U(o), c = s === "y", u = n.x + n.width / 2 - i.width / 2, d = n.y + n.height / 2 - i.height / 2, h = n[l] / 2 - i[l] / 2;
191
191
  let f;
192
- switch (c) {
192
+ switch (a) {
193
193
  case "top":
194
194
  f = {
195
195
  x: u,
196
- y: n.y - s.height
196
+ y: n.y - i.height
197
197
  };
198
198
  break;
199
199
  case "bottom":
@@ -210,7 +210,7 @@ function ze(e, o, t) {
210
210
  break;
211
211
  case "left":
212
212
  f = {
213
- x: n.x - s.width,
213
+ x: n.x - i.width,
214
214
  y: d
215
215
  };
216
216
  break;
@@ -222,46 +222,46 @@ function ze(e, o, t) {
222
222
  }
223
223
  switch (me(o)) {
224
224
  case "start":
225
- f[r] -= m * (t && a ? -1 : 1);
225
+ f[r] -= h * (t && c ? -1 : 1);
226
226
  break;
227
227
  case "end":
228
- f[r] += m * (t && a ? -1 : 1);
228
+ f[r] += h * (t && c ? -1 : 1);
229
229
  break;
230
230
  }
231
231
  return f;
232
232
  }
233
- const xt = async (e, o, t) => {
233
+ const yt = async (e, o, t) => {
234
234
  const {
235
235
  placement: n = "bottom",
236
- strategy: s = "absolute",
237
- middleware: i = [],
236
+ strategy: i = "absolute",
237
+ middleware: s = [],
238
238
  platform: r
239
- } = t, l = i.filter(Boolean), c = await (r.isRTL == null ? void 0 : r.isRTL(o));
240
- let a = await r.getElementRects({
239
+ } = t, l = s.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(o));
240
+ let c = await r.getElementRects({
241
241
  reference: e,
242
242
  floating: o,
243
- strategy: s
243
+ strategy: i
244
244
  }), {
245
245
  x: u,
246
246
  y: d
247
- } = ze(a, n, c), m = n, f = {}, g = 0;
247
+ } = ze(c, n, a), h = n, f = {}, g = 0;
248
248
  for (let x = 0; x < l.length; x++) {
249
249
  const {
250
250
  name: w,
251
- fn: h
251
+ fn: m
252
252
  } = l[x], {
253
253
  x: p,
254
254
  y: v,
255
255
  data: E,
256
256
  reset: y
257
- } = await h({
257
+ } = await m({
258
258
  x: u,
259
259
  y: d,
260
260
  initialPlacement: n,
261
- placement: m,
262
- strategy: s,
261
+ placement: h,
262
+ strategy: i,
263
263
  middlewareData: f,
264
- rects: a,
264
+ rects: c,
265
265
  platform: r,
266
266
  elements: {
267
267
  reference: e,
@@ -274,141 +274,141 @@ const xt = async (e, o, t) => {
274
274
  ...f[w],
275
275
  ...E
276
276
  }
277
- }, y && g <= 50 && (g++, typeof y == "object" && (y.placement && (m = y.placement), y.rects && (a = y.rects === !0 ? await r.getElementRects({
277
+ }, y && g <= 50 && (g++, typeof y == "object" && (y.placement && (h = y.placement), y.rects && (c = y.rects === !0 ? await r.getElementRects({
278
278
  reference: e,
279
279
  floating: o,
280
- strategy: s
280
+ strategy: i
281
281
  }) : y.rects), {
282
282
  x: u,
283
283
  y: d
284
- } = ze(a, m, c)), x = -1);
284
+ } = ze(c, h, a)), x = -1);
285
285
  }
286
286
  return {
287
287
  x: u,
288
288
  y: d,
289
- placement: m,
290
- strategy: s,
289
+ placement: h,
290
+ strategy: i,
291
291
  middlewareData: f
292
292
  };
293
293
  };
294
- async function He(e, o) {
294
+ async function Ue(e, o) {
295
295
  var t;
296
296
  o === void 0 && (o = {});
297
297
  const {
298
298
  x: n,
299
- y: s,
300
- platform: i,
299
+ y: i,
300
+ platform: s,
301
301
  rects: r,
302
302
  elements: l,
303
- strategy: c
303
+ strategy: a
304
304
  } = e, {
305
- boundary: a = "clippingAncestors",
305
+ boundary: c = "clippingAncestors",
306
306
  rootBoundary: u = "viewport",
307
307
  elementContext: d = "floating",
308
- altBoundary: m = !1,
308
+ altBoundary: h = !1,
309
309
  padding: f = 0
310
- } = he(o, e), g = pt(f), w = l[m ? d === "floating" ? "reference" : "floating" : d], h = ue(await i.getClippingRect({
311
- element: (t = await (i.isElement == null ? void 0 : i.isElement(w))) == null || t ? w : w.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
312
- boundary: a,
310
+ } = he(o, e), g = wt(f), w = l[h ? d === "floating" ? "reference" : "floating" : d], m = ue(await s.getClippingRect({
311
+ element: (t = await (s.isElement == null ? void 0 : s.isElement(w))) == null || t ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
312
+ boundary: c,
313
313
  rootBoundary: u,
314
- strategy: c
314
+ strategy: a
315
315
  })), p = d === "floating" ? {
316
316
  x: n,
317
- y: s,
317
+ y: i,
318
318
  width: r.floating.width,
319
319
  height: r.floating.height
320
- } : r.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), E = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
320
+ } : r.reference, v = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), E = await (s.isElement == null ? void 0 : s.isElement(v)) ? await (s.getScale == null ? void 0 : s.getScale(v)) || {
321
321
  x: 1,
322
322
  y: 1
323
323
  } : {
324
324
  x: 1,
325
325
  y: 1
326
- }, y = ue(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
326
+ }, y = ue(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
327
327
  elements: l,
328
328
  rect: p,
329
329
  offsetParent: v,
330
- strategy: c
330
+ strategy: a
331
331
  }) : p);
332
332
  return {
333
- top: (h.top - y.top + g.top) / E.y,
334
- bottom: (y.bottom - h.bottom + g.bottom) / E.y,
335
- left: (h.left - y.left + g.left) / E.x,
336
- right: (y.right - h.right + g.right) / E.x
333
+ top: (m.top - y.top + g.top) / E.y,
334
+ bottom: (y.bottom - m.bottom + g.bottom) / E.y,
335
+ left: (m.left - y.left + g.left) / E.x,
336
+ right: (y.right - m.right + g.right) / E.x
337
337
  };
338
338
  }
339
- const wt = function(e) {
339
+ const bt = function(e) {
340
340
  return e === void 0 && (e = {}), {
341
341
  name: "flip",
342
342
  options: e,
343
343
  async fn(o) {
344
344
  var t, n;
345
345
  const {
346
- placement: s,
347
- middlewareData: i,
346
+ placement: i,
347
+ middlewareData: s,
348
348
  rects: r,
349
349
  initialPlacement: l,
350
- platform: c,
351
- elements: a
350
+ platform: a,
351
+ elements: c
352
352
  } = o, {
353
353
  mainAxis: u = !0,
354
354
  crossAxis: d = !0,
355
- fallbackPlacements: m,
355
+ fallbackPlacements: h,
356
356
  fallbackStrategy: f = "bestFit",
357
357
  fallbackAxisSideDirection: g = "none",
358
358
  flipAlignment: x = !0,
359
359
  ...w
360
360
  } = he(e, o);
361
- if ((t = i.arrow) != null && t.alignmentOffset)
361
+ if ((t = s.arrow) != null && t.alignmentOffset)
362
362
  return {};
363
- const h = U(s), p = G(l), v = U(l) === l, E = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), y = m || (v || !x ? [ae(l)] : dt(l)), O = g !== "none";
364
- !m && O && y.push(...mt(l, x, g, E));
365
- const R = [l, ...y], z = await He(o, w), Y = [];
366
- let F = ((n = i.flip) == null ? void 0 : n.overflows) || [];
367
- if (u && Y.push(z[h]), d) {
368
- const I = ft(s, r, E);
369
- Y.push(z[I[0]], z[I[1]]);
363
+ const m = U(i), p = G(l), v = U(l) === l, E = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), y = h || (v || !x ? [ae(l)] : mt(l)), R = g !== "none";
364
+ !h && R && y.push(...pt(l, x, g, E));
365
+ const O = [l, ...y], z = await Ue(o, w), K = [];
366
+ let P = ((n = s.flip) == null ? void 0 : n.overflows) || [];
367
+ if (u && K.push(z[m]), d) {
368
+ const N = ht(i, r, E);
369
+ K.push(z[N[0]], z[N[1]]);
370
370
  }
371
- if (F = [...F, {
372
- placement: s,
373
- overflows: Y
374
- }], !Y.every((I) => I <= 0)) {
375
- var q, ee;
376
- const I = (((q = i.flip) == null ? void 0 : q.index) || 0) + 1, te = R[I];
371
+ if (P = [...P, {
372
+ placement: i,
373
+ overflows: K
374
+ }], !K.every((N) => N <= 0)) {
375
+ var Y, ee;
376
+ const N = (((Y = s.flip) == null ? void 0 : Y.index) || 0) + 1, te = O[N];
377
377
  if (te)
378
378
  return {
379
379
  data: {
380
- index: I,
381
- overflows: F
380
+ index: N,
381
+ overflows: P
382
382
  },
383
383
  reset: {
384
384
  placement: te
385
385
  }
386
386
  };
387
- let M = (ee = F.filter((V) => V.overflows[0] <= 0).sort((V, S) => V.overflows[1] - S.overflows[1])[0]) == null ? void 0 : ee.placement;
388
- if (!M)
387
+ let k = (ee = P.filter((V) => V.overflows[0] <= 0).sort((V, S) => V.overflows[1] - S.overflows[1])[0]) == null ? void 0 : ee.placement;
388
+ if (!k)
389
389
  switch (f) {
390
390
  case "bestFit": {
391
391
  var B;
392
- const V = (B = F.filter((S) => {
393
- if (O) {
394
- const T = G(S.placement);
395
- return T === p || // Create a bias to the `y` side axis due to horizontal
392
+ const V = (B = P.filter((S) => {
393
+ if (R) {
394
+ const A = G(S.placement);
395
+ return A === p || // Create a bias to the `y` side axis due to horizontal
396
396
  // reading directions favoring greater width.
397
- T === "y";
397
+ A === "y";
398
398
  }
399
399
  return !0;
400
- }).map((S) => [S.placement, S.overflows.filter((T) => T > 0).reduce((T, j) => T + j, 0)]).sort((S, T) => S[1] - T[1])[0]) == null ? void 0 : B[0];
401
- V && (M = V);
400
+ }).map((S) => [S.placement, S.overflows.filter((A) => A > 0).reduce((A, j) => A + j, 0)]).sort((S, A) => S[1] - A[1])[0]) == null ? void 0 : B[0];
401
+ V && (k = V);
402
402
  break;
403
403
  }
404
404
  case "initialPlacement":
405
- M = l;
405
+ k = l;
406
406
  break;
407
407
  }
408
- if (s !== M)
408
+ if (i !== k)
409
409
  return {
410
410
  reset: {
411
- placement: M
411
+ placement: k
412
412
  }
413
413
  };
414
414
  }
@@ -416,14 +416,14 @@ const wt = function(e) {
416
416
  }
417
417
  };
418
418
  };
419
- async function yt(e, o) {
419
+ async function vt(e, o) {
420
420
  const {
421
421
  placement: t,
422
422
  platform: n,
423
- elements: s
424
- } = e, i = await (n.isRTL == null ? void 0 : n.isRTL(s.floating)), r = U(t), l = me(t), c = G(t) === "y", a = ["left", "top"].includes(r) ? -1 : 1, u = i && c ? -1 : 1, d = he(o, e);
423
+ elements: i
424
+ } = e, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = U(t), l = me(t), a = G(t) === "y", c = ["left", "top"].includes(r) ? -1 : 1, u = s && a ? -1 : 1, d = he(o, e);
425
425
  let {
426
- mainAxis: m,
426
+ mainAxis: h,
427
427
  crossAxis: f,
428
428
  alignmentAxis: g
429
429
  } = typeof d == "number" ? {
@@ -435,37 +435,37 @@ async function yt(e, o) {
435
435
  crossAxis: d.crossAxis || 0,
436
436
  alignmentAxis: d.alignmentAxis
437
437
  };
438
- return l && typeof g == "number" && (f = l === "end" ? g * -1 : g), c ? {
438
+ return l && typeof g == "number" && (f = l === "end" ? g * -1 : g), a ? {
439
439
  x: f * u,
440
- y: m * a
440
+ y: h * c
441
441
  } : {
442
- x: m * a,
442
+ x: h * c,
443
443
  y: f * u
444
444
  };
445
445
  }
446
- const bt = function(e) {
446
+ const Et = function(e) {
447
447
  return e === void 0 && (e = 0), {
448
448
  name: "offset",
449
449
  options: e,
450
450
  async fn(o) {
451
451
  var t, n;
452
452
  const {
453
- x: s,
454
- y: i,
453
+ x: i,
454
+ y: s,
455
455
  placement: r,
456
456
  middlewareData: l
457
- } = o, c = await yt(o, e);
457
+ } = o, a = await vt(o, e);
458
458
  return r === ((t = l.offset) == null ? void 0 : t.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
459
- x: s + c.x,
460
- y: i + c.y,
459
+ x: i + a.x,
460
+ y: s + a.y,
461
461
  data: {
462
- ...c,
462
+ ...a,
463
463
  placement: r
464
464
  }
465
465
  };
466
466
  }
467
467
  };
468
- }, vt = function(e) {
468
+ }, St = function(e) {
469
469
  return e === void 0 && (e = {}), {
470
470
  name: "shift",
471
471
  options: e,
@@ -473,39 +473,39 @@ const bt = function(e) {
473
473
  const {
474
474
  x: t,
475
475
  y: n,
476
- placement: s
476
+ placement: i
477
477
  } = o, {
478
- mainAxis: i = !0,
478
+ mainAxis: s = !0,
479
479
  crossAxis: r = !1,
480
480
  limiter: l = {
481
481
  fn: (w) => {
482
482
  let {
483
- x: h,
483
+ x: m,
484
484
  y: p
485
485
  } = w;
486
486
  return {
487
- x: h,
487
+ x: m,
488
488
  y: p
489
489
  };
490
490
  }
491
491
  },
492
- ...c
493
- } = he(e, o), a = {
492
+ ...a
493
+ } = he(e, o), c = {
494
494
  x: t,
495
495
  y: n
496
- }, u = await He(o, c), d = G(U(s)), m = Be(d);
497
- let f = a[m], g = a[d];
498
- if (i) {
499
- const w = m === "y" ? "top" : "left", h = m === "y" ? "bottom" : "right", p = f + u[w], v = f - u[h];
500
- f = Ae(p, f, v);
496
+ }, u = await Ue(o, a), d = G(U(i)), h = je(d);
497
+ let f = c[h], g = c[d];
498
+ if (s) {
499
+ const w = h === "y" ? "top" : "left", m = h === "y" ? "bottom" : "right", p = f + u[w], v = f - u[m];
500
+ f = Te(p, f, v);
501
501
  }
502
502
  if (r) {
503
- const w = d === "y" ? "top" : "left", h = d === "y" ? "bottom" : "right", p = g + u[w], v = g - u[h];
504
- g = Ae(p, g, v);
503
+ const w = d === "y" ? "top" : "left", m = d === "y" ? "bottom" : "right", p = g + u[w], v = g - u[m];
504
+ g = Te(p, g, v);
505
505
  }
506
506
  const x = l.fn({
507
507
  ...o,
508
- [m]: f,
508
+ [h]: f,
509
509
  [d]: g
510
510
  });
511
511
  return {
@@ -514,7 +514,7 @@ const bt = function(e) {
514
514
  x: x.x - t,
515
515
  y: x.y - n,
516
516
  enabled: {
517
- [m]: i,
517
+ [h]: s,
518
518
  [d]: r
519
519
  }
520
520
  }
@@ -526,38 +526,38 @@ function ge() {
526
526
  return typeof window < "u";
527
527
  }
528
528
  function Q(e) {
529
- return Ue(e) ? (e.nodeName || "").toLowerCase() : "#document";
529
+ return qe(e) ? (e.nodeName || "").toLowerCase() : "#document";
530
530
  }
531
- function A(e) {
531
+ function T(e) {
532
532
  var o;
533
533
  return (e == null || (o = e.ownerDocument) == null ? void 0 : o.defaultView) || window;
534
534
  }
535
- function P(e) {
535
+ function F(e) {
536
536
  var o;
537
- return (o = (Ue(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : o.documentElement;
537
+ return (o = (qe(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : o.documentElement;
538
538
  }
539
- function Ue(e) {
540
- return ge() ? e instanceof Node || e instanceof A(e).Node : !1;
539
+ function qe(e) {
540
+ return ge() ? e instanceof Node || e instanceof T(e).Node : !1;
541
541
  }
542
- function N(e) {
543
- return ge() ? e instanceof Element || e instanceof A(e).Element : !1;
542
+ function I(e) {
543
+ return ge() ? e instanceof Element || e instanceof T(e).Element : !1;
544
544
  }
545
545
  function D(e) {
546
- return ge() ? e instanceof HTMLElement || e instanceof A(e).HTMLElement : !1;
546
+ return ge() ? e instanceof HTMLElement || e instanceof T(e).HTMLElement : !1;
547
547
  }
548
- function Ie(e) {
549
- return !ge() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof A(e).ShadowRoot;
548
+ function Ne(e) {
549
+ return !ge() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof T(e).ShadowRoot;
550
550
  }
551
551
  function oe(e) {
552
552
  const {
553
553
  overflow: o,
554
554
  overflowX: t,
555
555
  overflowY: n,
556
- display: s
556
+ display: i
557
557
  } = L(e);
558
- return /auto|scroll|overlay|hidden|clip/.test(o + n + t) && !["inline", "contents"].includes(s);
558
+ return /auto|scroll|overlay|hidden|clip/.test(o + n + t) && !["inline", "contents"].includes(i);
559
559
  }
560
- function Et(e) {
560
+ function Ot(e) {
561
561
  return ["table", "td", "th"].includes(Q(e));
562
562
  }
563
563
  function pe(e) {
@@ -569,14 +569,14 @@ function pe(e) {
569
569
  }
570
570
  });
571
571
  }
572
- function Oe(e) {
573
- const o = Re(), t = N(e) ? L(e) : e;
574
- return t.transform !== "none" || t.perspective !== "none" || (t.containerType ? t.containerType !== "normal" : !1) || !o && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !o && (t.filter ? t.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (t.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (t.contain || "").includes(n));
572
+ function Ce(e) {
573
+ const o = Re(), t = I(e) ? L(e) : e;
574
+ return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !o && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !o && (t.filter ? t.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (t.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (t.contain || "").includes(n));
575
575
  }
576
- function St(e) {
576
+ function Ct(e) {
577
577
  let o = $(e);
578
578
  for (; D(o) && !J(o); ) {
579
- if (Oe(o))
579
+ if (Ce(o))
580
580
  return o;
581
581
  if (pe(o))
582
582
  return null;
@@ -591,10 +591,10 @@ function J(e) {
591
591
  return ["html", "body", "#document"].includes(Q(e));
592
592
  }
593
593
  function L(e) {
594
- return A(e).getComputedStyle(e);
594
+ return T(e).getComputedStyle(e);
595
595
  }
596
596
  function xe(e) {
597
- return N(e) ? {
597
+ return I(e) ? {
598
598
  scrollLeft: e.scrollLeft,
599
599
  scrollTop: e.scrollTop
600
600
  } : {
@@ -609,10 +609,10 @@ function $(e) {
609
609
  // Step into the shadow DOM of the parent of a slotted node.
610
610
  e.assignedSlot || // DOM Element detected.
611
611
  e.parentNode || // ShadowRoot detected.
612
- Ie(e) && e.host || // Fallback.
613
- P(e)
612
+ Ne(e) && e.host || // Fallback.
613
+ F(e)
614
614
  );
615
- return Ie(o) ? o.host : o;
615
+ return Ne(o) ? o.host : o;
616
616
  }
617
617
  function Ke(e) {
618
618
  const o = $(e);
@@ -621,212 +621,212 @@ function Ke(e) {
621
621
  function ne(e, o, t) {
622
622
  var n;
623
623
  o === void 0 && (o = []), t === void 0 && (t = !0);
624
- const s = Ke(e), i = s === ((n = e.ownerDocument) == null ? void 0 : n.body), r = A(s);
625
- if (i) {
626
- const l = Ce(r);
627
- return o.concat(r, r.visualViewport || [], oe(s) ? s : [], l && t ? ne(l) : []);
624
+ const i = Ke(e), s = i === ((n = e.ownerDocument) == null ? void 0 : n.body), r = T(i);
625
+ if (s) {
626
+ const l = Oe(r);
627
+ return o.concat(r, r.visualViewport || [], oe(i) ? i : [], l && t ? ne(l) : []);
628
628
  }
629
- return o.concat(s, ne(s, [], t));
629
+ return o.concat(i, ne(i, [], t));
630
630
  }
631
- function Ce(e) {
631
+ function Oe(e) {
632
632
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
633
633
  }
634
634
  function Ye(e) {
635
635
  const o = L(e);
636
636
  let t = parseFloat(o.width) || 0, n = parseFloat(o.height) || 0;
637
- const s = D(e), i = s ? e.offsetWidth : t, r = s ? e.offsetHeight : n, l = ce(t) !== i || ce(n) !== r;
638
- return l && (t = i, n = r), {
637
+ const i = D(e), s = i ? e.offsetWidth : t, r = i ? e.offsetHeight : n, l = ce(t) !== s || ce(n) !== r;
638
+ return l && (t = s, n = r), {
639
639
  width: t,
640
640
  height: n,
641
641
  $: l
642
642
  };
643
643
  }
644
- function ke(e) {
645
- return N(e) ? e : e.contextElement;
644
+ function Me(e) {
645
+ return I(e) ? e : e.contextElement;
646
646
  }
647
647
  function Z(e) {
648
- const o = ke(e);
648
+ const o = Me(e);
649
649
  if (!D(o))
650
650
  return _(1);
651
651
  const t = o.getBoundingClientRect(), {
652
652
  width: n,
653
- height: s,
654
- $: i
653
+ height: i,
654
+ $: s
655
655
  } = Ye(o);
656
- let r = (i ? ce(t.width) : t.width) / n, l = (i ? ce(t.height) : t.height) / s;
656
+ let r = (s ? ce(t.width) : t.width) / n, l = (s ? ce(t.height) : t.height) / i;
657
657
  return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
658
658
  x: r,
659
659
  y: l
660
660
  };
661
661
  }
662
- const Ct = /* @__PURE__ */ _(0);
663
- function qe(e) {
664
- const o = A(e);
665
- return !Re() || !o.visualViewport ? Ct : {
662
+ const Rt = /* @__PURE__ */ _(0);
663
+ function Xe(e) {
664
+ const o = T(e);
665
+ return !Re() || !o.visualViewport ? Rt : {
666
666
  x: o.visualViewport.offsetLeft,
667
667
  y: o.visualViewport.offsetTop
668
668
  };
669
669
  }
670
- function Ot(e, o, t) {
671
- return o === void 0 && (o = !1), !t || o && t !== A(e) ? !1 : o;
670
+ function Mt(e, o, t) {
671
+ return o === void 0 && (o = !1), !t || o && t !== T(e) ? !1 : o;
672
672
  }
673
- function K(e, o, t, n) {
673
+ function q(e, o, t, n) {
674
674
  o === void 0 && (o = !1), t === void 0 && (t = !1);
675
- const s = e.getBoundingClientRect(), i = ke(e);
675
+ const i = e.getBoundingClientRect(), s = Me(e);
676
676
  let r = _(1);
677
- o && (n ? N(n) && (r = Z(n)) : r = Z(e));
678
- const l = Ot(i, t, n) ? qe(i) : _(0);
679
- let c = (s.left + l.x) / r.x, a = (s.top + l.y) / r.y, u = s.width / r.x, d = s.height / r.y;
680
- if (i) {
681
- const m = A(i), f = n && N(n) ? A(n) : n;
682
- let g = m, x = Ce(g);
677
+ o && (n ? I(n) && (r = Z(n)) : r = Z(e));
678
+ const l = Mt(s, t, n) ? Xe(s) : _(0);
679
+ let a = (i.left + l.x) / r.x, c = (i.top + l.y) / r.y, u = i.width / r.x, d = i.height / r.y;
680
+ if (s) {
681
+ const h = T(s), f = n && I(n) ? T(n) : n;
682
+ let g = h, x = Oe(g);
683
683
  for (; x && n && f !== g; ) {
684
- const w = Z(x), h = x.getBoundingClientRect(), p = L(x), v = h.left + (x.clientLeft + parseFloat(p.paddingLeft)) * w.x, E = h.top + (x.clientTop + parseFloat(p.paddingTop)) * w.y;
685
- c *= w.x, a *= w.y, u *= w.x, d *= w.y, c += v, a += E, g = A(x), x = Ce(g);
684
+ const w = Z(x), m = x.getBoundingClientRect(), p = L(x), v = m.left + (x.clientLeft + parseFloat(p.paddingLeft)) * w.x, E = m.top + (x.clientTop + parseFloat(p.paddingTop)) * w.y;
685
+ a *= w.x, c *= w.y, u *= w.x, d *= w.y, a += v, c += E, g = T(x), x = Oe(g);
686
686
  }
687
687
  }
688
688
  return ue({
689
689
  width: u,
690
690
  height: d,
691
- x: c,
692
- y: a
691
+ x: a,
692
+ y: c
693
693
  });
694
694
  }
695
- function Me(e, o) {
695
+ function ke(e, o) {
696
696
  const t = xe(e).scrollLeft;
697
- return o ? o.left + t : K(P(e)).left + t;
697
+ return o ? o.left + t : q(F(e)).left + t;
698
698
  }
699
- function Xe(e, o, t) {
699
+ function Ze(e, o, t) {
700
700
  t === void 0 && (t = !1);
701
- const n = e.getBoundingClientRect(), s = n.left + o.scrollLeft - (t ? 0 : (
701
+ const n = e.getBoundingClientRect(), i = n.left + o.scrollLeft - (t ? 0 : (
702
702
  // RTL <body> scrollbar.
703
- Me(e, n)
704
- )), i = n.top + o.scrollTop;
703
+ ke(e, n)
704
+ )), s = n.top + o.scrollTop;
705
705
  return {
706
- x: s,
707
- y: i
706
+ x: i,
707
+ y: s
708
708
  };
709
709
  }
710
- function Rt(e) {
710
+ function kt(e) {
711
711
  let {
712
712
  elements: o,
713
713
  rect: t,
714
714
  offsetParent: n,
715
- strategy: s
715
+ strategy: i
716
716
  } = e;
717
- const i = s === "fixed", r = P(n), l = o ? pe(o.floating) : !1;
718
- if (n === r || l && i)
717
+ const s = i === "fixed", r = F(n), l = o ? pe(o.floating) : !1;
718
+ if (n === r || l && s)
719
719
  return t;
720
- let c = {
720
+ let a = {
721
721
  scrollLeft: 0,
722
722
  scrollTop: 0
723
- }, a = _(1);
723
+ }, c = _(1);
724
724
  const u = _(0), d = D(n);
725
- if ((d || !d && !i) && ((Q(n) !== "body" || oe(r)) && (c = xe(n)), D(n))) {
726
- const f = K(n);
727
- a = Z(n), u.x = f.x + n.clientLeft, u.y = f.y + n.clientTop;
725
+ if ((d || !d && !s) && ((Q(n) !== "body" || oe(r)) && (a = xe(n)), D(n))) {
726
+ const f = q(n);
727
+ c = Z(n), u.x = f.x + n.clientLeft, u.y = f.y + n.clientTop;
728
728
  }
729
- const m = r && !d && !i ? Xe(r, c, !0) : _(0);
729
+ const h = r && !d && !s ? Ze(r, a, !0) : _(0);
730
730
  return {
731
- width: t.width * a.x,
732
- height: t.height * a.y,
733
- x: t.x * a.x - c.scrollLeft * a.x + u.x + m.x,
734
- y: t.y * a.y - c.scrollTop * a.y + u.y + m.y
731
+ width: t.width * c.x,
732
+ height: t.height * c.y,
733
+ x: t.x * c.x - a.scrollLeft * c.x + u.x + h.x,
734
+ y: t.y * c.y - a.scrollTop * c.y + u.y + h.y
735
735
  };
736
736
  }
737
- function kt(e) {
737
+ function At(e) {
738
738
  return Array.from(e.getClientRects());
739
739
  }
740
- function Mt(e) {
741
- const o = P(e), t = xe(e), n = e.ownerDocument.body, s = H(o.scrollWidth, o.clientWidth, n.scrollWidth, n.clientWidth), i = H(o.scrollHeight, o.clientHeight, n.scrollHeight, n.clientHeight);
742
- let r = -t.scrollLeft + Me(e);
740
+ function Tt(e) {
741
+ const o = F(e), t = xe(e), n = e.ownerDocument.body, i = H(o.scrollWidth, o.clientWidth, n.scrollWidth, n.clientWidth), s = H(o.scrollHeight, o.clientHeight, n.scrollHeight, n.clientHeight);
742
+ let r = -t.scrollLeft + ke(e);
743
743
  const l = -t.scrollTop;
744
- return L(n).direction === "rtl" && (r += H(o.clientWidth, n.clientWidth) - s), {
745
- width: s,
746
- height: i,
744
+ return L(n).direction === "rtl" && (r += H(o.clientWidth, n.clientWidth) - i), {
745
+ width: i,
746
+ height: s,
747
747
  x: r,
748
748
  y: l
749
749
  };
750
750
  }
751
- function Tt(e, o) {
752
- const t = A(e), n = P(e), s = t.visualViewport;
753
- let i = n.clientWidth, r = n.clientHeight, l = 0, c = 0;
754
- if (s) {
755
- i = s.width, r = s.height;
756
- const a = Re();
757
- (!a || a && o === "fixed") && (l = s.offsetLeft, c = s.offsetTop);
751
+ function zt(e, o) {
752
+ const t = T(e), n = F(e), i = t.visualViewport;
753
+ let s = n.clientWidth, r = n.clientHeight, l = 0, a = 0;
754
+ if (i) {
755
+ s = i.width, r = i.height;
756
+ const c = Re();
757
+ (!c || c && o === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
758
758
  }
759
759
  return {
760
- width: i,
760
+ width: s,
761
761
  height: r,
762
762
  x: l,
763
- y: c
763
+ y: a
764
764
  };
765
765
  }
766
- function At(e, o) {
767
- const t = K(e, !0, o === "fixed"), n = t.top + e.clientTop, s = t.left + e.clientLeft, i = D(e) ? Z(e) : _(1), r = e.clientWidth * i.x, l = e.clientHeight * i.y, c = s * i.x, a = n * i.y;
766
+ function Nt(e, o) {
767
+ const t = q(e, !0, o === "fixed"), n = t.top + e.clientTop, i = t.left + e.clientLeft, s = D(e) ? Z(e) : _(1), r = e.clientWidth * s.x, l = e.clientHeight * s.y, a = i * s.x, c = n * s.y;
768
768
  return {
769
769
  width: r,
770
770
  height: l,
771
- x: c,
772
- y: a
771
+ x: a,
772
+ y: c
773
773
  };
774
774
  }
775
- function Ne(e, o, t) {
775
+ function Ie(e, o, t) {
776
776
  let n;
777
777
  if (o === "viewport")
778
- n = Tt(e, t);
778
+ n = zt(e, t);
779
779
  else if (o === "document")
780
- n = Mt(P(e));
781
- else if (N(o))
782
- n = At(o, t);
780
+ n = Tt(F(e));
781
+ else if (I(o))
782
+ n = Nt(o, t);
783
783
  else {
784
- const s = qe(e);
784
+ const i = Xe(e);
785
785
  n = {
786
- x: o.x - s.x,
787
- y: o.y - s.y,
786
+ x: o.x - i.x,
787
+ y: o.y - i.y,
788
788
  width: o.width,
789
789
  height: o.height
790
790
  };
791
791
  }
792
792
  return ue(n);
793
793
  }
794
- function Ze(e, o) {
794
+ function Ge(e, o) {
795
795
  const t = $(e);
796
- return t === o || !N(t) || J(t) ? !1 : L(t).position === "fixed" || Ze(t, o);
796
+ return t === o || !I(t) || J(t) ? !1 : L(t).position === "fixed" || Ge(t, o);
797
797
  }
798
- function zt(e, o) {
798
+ function It(e, o) {
799
799
  const t = o.get(e);
800
800
  if (t)
801
801
  return t;
802
- let n = ne(e, [], !1).filter((l) => N(l) && Q(l) !== "body"), s = null;
803
- const i = L(e).position === "fixed";
804
- let r = i ? $(e) : e;
805
- for (; N(r) && !J(r); ) {
806
- const l = L(r), c = Oe(r);
807
- !c && l.position === "fixed" && (s = null), (i ? !c && !s : !c && l.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || oe(r) && !c && Ze(e, r)) ? n = n.filter((u) => u !== r) : s = l, r = $(r);
802
+ let n = ne(e, [], !1).filter((l) => I(l) && Q(l) !== "body"), i = null;
803
+ const s = L(e).position === "fixed";
804
+ let r = s ? $(e) : e;
805
+ for (; I(r) && !J(r); ) {
806
+ const l = L(r), a = Ce(r);
807
+ !a && l.position === "fixed" && (i = null), (s ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || oe(r) && !a && Ge(e, r)) ? n = n.filter((u) => u !== r) : i = l, r = $(r);
808
808
  }
809
809
  return o.set(e, n), n;
810
810
  }
811
- function It(e) {
811
+ function Lt(e) {
812
812
  let {
813
813
  element: o,
814
814
  boundary: t,
815
815
  rootBoundary: n,
816
- strategy: s
816
+ strategy: i
817
817
  } = e;
818
- const r = [...t === "clippingAncestors" ? pe(o) ? [] : zt(o, this._c) : [].concat(t), n], l = r[0], c = r.reduce((a, u) => {
819
- const d = Ne(o, u, s);
820
- return a.top = H(d.top, a.top), a.right = le(d.right, a.right), a.bottom = le(d.bottom, a.bottom), a.left = H(d.left, a.left), a;
821
- }, Ne(o, l, s));
818
+ const r = [...t === "clippingAncestors" ? pe(o) ? [] : It(o, this._c) : [].concat(t), n], l = r[0], a = r.reduce((c, u) => {
819
+ const d = Ie(o, u, i);
820
+ return c.top = H(d.top, c.top), c.right = le(d.right, c.right), c.bottom = le(d.bottom, c.bottom), c.left = H(d.left, c.left), c;
821
+ }, Ie(o, l, i));
822
822
  return {
823
- width: c.right - c.left,
824
- height: c.bottom - c.top,
825
- x: c.left,
826
- y: c.top
823
+ width: a.right - a.left,
824
+ height: a.bottom - a.top,
825
+ x: a.left,
826
+ y: a.top
827
827
  };
828
828
  }
829
- function Nt(e) {
829
+ function _t(e) {
830
830
  const {
831
831
  width: o,
832
832
  height: t
@@ -836,19 +836,19 @@ function Nt(e) {
836
836
  height: t
837
837
  };
838
838
  }
839
- function Lt(e, o, t) {
840
- const n = D(o), s = P(o), i = t === "fixed", r = K(e, !0, i, o);
839
+ function Dt(e, o, t) {
840
+ const n = D(o), i = F(o), s = t === "fixed", r = q(e, !0, s, o);
841
841
  let l = {
842
842
  scrollLeft: 0,
843
843
  scrollTop: 0
844
844
  };
845
- const c = _(0);
846
- if (n || !n && !i)
847
- if ((Q(o) !== "body" || oe(s)) && (l = xe(o)), n) {
848
- const m = K(o, !0, i, o);
849
- c.x = m.x + o.clientLeft, c.y = m.y + o.clientTop;
850
- } else s && (c.x = Me(s));
851
- const a = s && !n && !i ? Xe(s, l) : _(0), u = r.left + l.scrollLeft - c.x - a.x, d = r.top + l.scrollTop - c.y - a.y;
845
+ const a = _(0);
846
+ if (n || !n && !s)
847
+ if ((Q(o) !== "body" || oe(i)) && (l = xe(o)), n) {
848
+ const h = q(o, !0, s, o);
849
+ a.x = h.x + o.clientLeft, a.y = h.y + o.clientTop;
850
+ } else i && (a.x = ke(i));
851
+ const c = i && !n && !s ? Ze(i, l) : _(0), u = r.left + l.scrollLeft - a.x - c.x, d = r.top + l.scrollTop - a.y - c.y;
852
852
  return {
853
853
  x: u,
854
854
  y: d,
@@ -865,30 +865,30 @@ function Le(e, o) {
865
865
  if (o)
866
866
  return o(e);
867
867
  let t = e.offsetParent;
868
- return P(e) === t && (t = t.ownerDocument.body), t;
868
+ return F(e) === t && (t = t.ownerDocument.body), t;
869
869
  }
870
- function Ge(e, o) {
871
- const t = A(e);
870
+ function Je(e, o) {
871
+ const t = T(e);
872
872
  if (pe(e))
873
873
  return t;
874
874
  if (!D(e)) {
875
- let s = $(e);
876
- for (; s && !J(s); ) {
877
- if (N(s) && !we(s))
878
- return s;
879
- s = $(s);
875
+ let i = $(e);
876
+ for (; i && !J(i); ) {
877
+ if (I(i) && !we(i))
878
+ return i;
879
+ i = $(i);
880
880
  }
881
881
  return t;
882
882
  }
883
883
  let n = Le(e, o);
884
- for (; n && Et(n) && we(n); )
884
+ for (; n && Ot(n) && we(n); )
885
885
  n = Le(n, o);
886
- return n && J(n) && we(n) && !Oe(n) ? t : n || St(e) || t;
886
+ return n && J(n) && we(n) && !Ce(n) ? t : n || Ct(e) || t;
887
887
  }
888
- const _t = async function(e) {
889
- const o = this.getOffsetParent || Ge, t = this.getDimensions, n = await t(e.floating);
888
+ const Ft = async function(e) {
889
+ const o = this.getOffsetParent || Je, t = this.getDimensions, n = await t(e.floating);
890
890
  return {
891
- reference: Lt(e.reference, await o(e.floating), e.strategy),
891
+ reference: Dt(e.reference, await o(e.floating), e.strategy),
892
892
  floating: {
893
893
  x: 0,
894
894
  y: 0,
@@ -897,117 +897,120 @@ const _t = async function(e) {
897
897
  }
898
898
  };
899
899
  };
900
- function Dt(e) {
900
+ function Pt(e) {
901
901
  return L(e).direction === "rtl";
902
902
  }
903
- const Pt = {
904
- convertOffsetParentRelativeRectToViewportRelativeRect: Rt,
905
- getDocumentElement: P,
906
- getClippingRect: It,
907
- getOffsetParent: Ge,
908
- getElementRects: _t,
909
- getClientRects: kt,
910
- getDimensions: Nt,
903
+ const Vt = {
904
+ convertOffsetParentRelativeRectToViewportRelativeRect: kt,
905
+ getDocumentElement: F,
906
+ getClippingRect: Lt,
907
+ getOffsetParent: Je,
908
+ getElementRects: Ft,
909
+ getClientRects: At,
910
+ getDimensions: _t,
911
911
  getScale: Z,
912
- isElement: N,
913
- isRTL: Dt
912
+ isElement: I,
913
+ isRTL: Pt
914
914
  };
915
- function Ft(e, o) {
915
+ function Qe(e, o) {
916
+ return e.x === o.x && e.y === o.y && e.width === o.width && e.height === o.height;
917
+ }
918
+ function Wt(e, o) {
916
919
  let t = null, n;
917
- const s = P(e);
918
- function i() {
920
+ const i = F(e);
921
+ function s() {
919
922
  var l;
920
923
  clearTimeout(n), (l = t) == null || l.disconnect(), t = null;
921
924
  }
922
- function r(l, c) {
923
- l === void 0 && (l = !1), c === void 0 && (c = 1), i();
924
- const {
925
- left: a,
926
- top: u,
927
- width: d,
928
- height: m
929
- } = e.getBoundingClientRect();
930
- if (l || o(), !d || !m)
925
+ function r(l, a) {
926
+ l === void 0 && (l = !1), a === void 0 && (a = 1), s();
927
+ const c = e.getBoundingClientRect(), {
928
+ left: u,
929
+ top: d,
930
+ width: h,
931
+ height: f
932
+ } = c;
933
+ if (l || o(), !h || !f)
931
934
  return;
932
- const f = se(u), g = se(s.clientWidth - (a + d)), x = se(s.clientHeight - (u + m)), w = se(a), p = {
933
- rootMargin: -f + "px " + -g + "px " + -x + "px " + -w + "px",
934
- threshold: H(0, le(1, c)) || 1
935
+ const g = ie(d), x = ie(i.clientWidth - (u + h)), w = ie(i.clientHeight - (d + f)), m = ie(u), v = {
936
+ rootMargin: -g + "px " + -x + "px " + -w + "px " + -m + "px",
937
+ threshold: H(0, le(1, a)) || 1
935
938
  };
936
- let v = !0;
937
- function E(y) {
938
- const O = y[0].intersectionRatio;
939
- if (O !== c) {
940
- if (!v)
939
+ let E = !0;
940
+ function y(R) {
941
+ const O = R[0].intersectionRatio;
942
+ if (O !== a) {
943
+ if (!E)
941
944
  return r();
942
945
  O ? r(!1, O) : n = setTimeout(() => {
943
946
  r(!1, 1e-7);
944
947
  }, 1e3);
945
948
  }
946
- v = !1;
949
+ O === 1 && !Qe(c, e.getBoundingClientRect()) && r(), E = !1;
947
950
  }
948
951
  try {
949
- t = new IntersectionObserver(E, {
950
- ...p,
952
+ t = new IntersectionObserver(y, {
953
+ ...v,
951
954
  // Handle <iframe>s
952
- root: s.ownerDocument
955
+ root: i.ownerDocument
953
956
  });
954
957
  } catch {
955
- t = new IntersectionObserver(E, p);
958
+ t = new IntersectionObserver(y, v);
956
959
  }
957
960
  t.observe(e);
958
961
  }
959
- return r(!0), i;
962
+ return r(!0), s;
960
963
  }
961
- function Vt(e, o, t, n) {
964
+ function Bt(e, o, t, n) {
962
965
  n === void 0 && (n = {});
963
966
  const {
964
- ancestorScroll: s = !0,
965
- ancestorResize: i = !0,
967
+ ancestorScroll: i = !0,
968
+ ancestorResize: s = !0,
966
969
  elementResize: r = typeof ResizeObserver == "function",
967
970
  layoutShift: l = typeof IntersectionObserver == "function",
968
- animationFrame: c = !1
969
- } = n, a = ke(e), u = s || i ? [...a ? ne(a) : [], ...ne(o)] : [];
970
- u.forEach((h) => {
971
- s && h.addEventListener("scroll", t, {
971
+ animationFrame: a = !1
972
+ } = n, c = Me(e), u = i || s ? [...c ? ne(c) : [], ...ne(o)] : [];
973
+ u.forEach((m) => {
974
+ i && m.addEventListener("scroll", t, {
972
975
  passive: !0
973
- }), i && h.addEventListener("resize", t);
976
+ }), s && m.addEventListener("resize", t);
974
977
  });
975
- const d = a && l ? Ft(a, t) : null;
976
- let m = -1, f = null;
977
- r && (f = new ResizeObserver((h) => {
978
- let [p] = h;
979
- p && p.target === a && f && (f.unobserve(o), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
978
+ const d = c && l ? Wt(c, t) : null;
979
+ let h = -1, f = null;
980
+ r && (f = new ResizeObserver((m) => {
981
+ let [p] = m;
982
+ p && p.target === c && f && (f.unobserve(o), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
980
983
  var v;
981
984
  (v = f) == null || v.observe(o);
982
985
  })), t();
983
- }), a && !c && f.observe(a), f.observe(o));
984
- let g, x = c ? K(e) : null;
985
- c && w();
986
+ }), c && !a && f.observe(c), f.observe(o));
987
+ let g, x = a ? q(e) : null;
988
+ a && w();
986
989
  function w() {
987
- const h = K(e);
988
- x && (h.x !== x.x || h.y !== x.y || h.width !== x.width || h.height !== x.height) && t(), x = h, g = requestAnimationFrame(w);
990
+ const m = q(e);
991
+ x && !Qe(x, m) && t(), x = m, g = requestAnimationFrame(w);
989
992
  }
990
993
  return t(), () => {
991
- var h;
994
+ var m;
992
995
  u.forEach((p) => {
993
- s && p.removeEventListener("scroll", t), i && p.removeEventListener("resize", t);
994
- }), d == null || d(), (h = f) == null || h.disconnect(), f = null, c && cancelAnimationFrame(g);
996
+ i && p.removeEventListener("scroll", t), s && p.removeEventListener("resize", t);
997
+ }), d == null || d(), (m = f) == null || m.disconnect(), f = null, a && cancelAnimationFrame(g);
995
998
  };
996
999
  }
997
- const Wt = bt, Bt = vt, jt = wt, $t = (e, o, t) => {
998
- const n = /* @__PURE__ */ new Map(), s = {
999
- platform: Pt,
1000
+ const jt = Et, $t = St, Ht = bt, Ut = (e, o, t) => {
1001
+ const n = /* @__PURE__ */ new Map(), i = {
1002
+ platform: Vt,
1000
1003
  ...t
1001
- }, i = {
1002
- ...s.platform,
1004
+ }, s = {
1005
+ ...i.platform,
1003
1006
  _c: n
1004
1007
  };
1005
- return xt(e, o, {
1006
- ...s,
1007
- platform: i
1008
+ return yt(e, o, {
1009
+ ...i,
1010
+ platform: s
1008
1011
  });
1009
1012
  };
1010
- var ie = typeof document < "u" ? tt : re;
1013
+ var se = typeof document < "u" ? ot : re;
1011
1014
  function fe(e, o) {
1012
1015
  if (e === o)
1013
1016
  return !0;
@@ -1015,7 +1018,7 @@ function fe(e, o) {
1015
1018
  return !1;
1016
1019
  if (typeof e == "function" && e.toString() === o.toString())
1017
1020
  return !0;
1018
- let t, n, s;
1021
+ let t, n, i;
1019
1022
  if (e && o && typeof e == "object") {
1020
1023
  if (Array.isArray(e)) {
1021
1024
  if (t = e.length, t !== o.length) return !1;
@@ -1024,47 +1027,47 @@ function fe(e, o) {
1024
1027
  return !1;
1025
1028
  return !0;
1026
1029
  }
1027
- if (s = Object.keys(e), t = s.length, t !== Object.keys(o).length)
1030
+ if (i = Object.keys(e), t = i.length, t !== Object.keys(o).length)
1028
1031
  return !1;
1029
1032
  for (n = t; n-- !== 0; )
1030
- if (!{}.hasOwnProperty.call(o, s[n]))
1033
+ if (!{}.hasOwnProperty.call(o, i[n]))
1031
1034
  return !1;
1032
1035
  for (n = t; n-- !== 0; ) {
1033
- const i = s[n];
1034
- if (!(i === "_owner" && e.$$typeof) && !fe(e[i], o[i]))
1036
+ const s = i[n];
1037
+ if (!(s === "_owner" && e.$$typeof) && !fe(e[s], o[s]))
1035
1038
  return !1;
1036
1039
  }
1037
1040
  return !0;
1038
1041
  }
1039
1042
  return e !== e && o !== o;
1040
1043
  }
1041
- function Je(e) {
1044
+ function et(e) {
1042
1045
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1043
1046
  }
1044
1047
  function _e(e, o) {
1045
- const t = Je(e);
1048
+ const t = et(e);
1046
1049
  return Math.round(o * t) / t;
1047
1050
  }
1048
1051
  function ye(e) {
1049
1052
  const o = C.useRef(e);
1050
- return ie(() => {
1053
+ return se(() => {
1051
1054
  o.current = e;
1052
1055
  }), o;
1053
1056
  }
1054
- function Ht(e) {
1057
+ function qt(e) {
1055
1058
  e === void 0 && (e = {});
1056
1059
  const {
1057
1060
  placement: o = "bottom",
1058
1061
  strategy: t = "absolute",
1059
1062
  middleware: n = [],
1060
- platform: s,
1063
+ platform: i,
1061
1064
  elements: {
1062
- reference: i,
1065
+ reference: s,
1063
1066
  floating: r
1064
1067
  } = {},
1065
1068
  transform: l = !0,
1066
- whileElementsMounted: c,
1067
- open: a
1069
+ whileElementsMounted: a,
1070
+ open: c
1068
1071
  } = e, [u, d] = C.useState({
1069
1072
  x: 0,
1070
1073
  y: 0,
@@ -1072,56 +1075,56 @@ function Ht(e) {
1072
1075
  placement: o,
1073
1076
  middlewareData: {},
1074
1077
  isPositioned: !1
1075
- }), [m, f] = C.useState(n);
1076
- fe(m, n) || f(n);
1077
- const [g, x] = C.useState(null), [w, h] = C.useState(null), p = C.useCallback((S) => {
1078
- S !== O.current && (O.current = S, x(S));
1078
+ }), [h, f] = C.useState(n);
1079
+ fe(h, n) || f(n);
1080
+ const [g, x] = C.useState(null), [w, m] = C.useState(null), p = C.useCallback((S) => {
1081
+ S !== R.current && (R.current = S, x(S));
1079
1082
  }, []), v = C.useCallback((S) => {
1080
- S !== R.current && (R.current = S, h(S));
1081
- }, []), E = i || g, y = r || w, O = C.useRef(null), R = C.useRef(null), z = C.useRef(u), Y = c != null, F = ye(c), q = ye(s), ee = ye(a), B = C.useCallback(() => {
1082
- if (!O.current || !R.current)
1083
+ S !== O.current && (O.current = S, m(S));
1084
+ }, []), E = s || g, y = r || w, R = C.useRef(null), O = C.useRef(null), z = C.useRef(u), K = a != null, P = ye(a), Y = ye(i), ee = ye(c), B = C.useCallback(() => {
1085
+ if (!R.current || !O.current)
1083
1086
  return;
1084
1087
  const S = {
1085
1088
  placement: o,
1086
1089
  strategy: t,
1087
- middleware: m
1090
+ middleware: h
1088
1091
  };
1089
- q.current && (S.platform = q.current), $t(O.current, R.current, S).then((T) => {
1092
+ Y.current && (S.platform = Y.current), Ut(R.current, O.current, S).then((A) => {
1090
1093
  const j = {
1091
- ...T,
1094
+ ...A,
1092
1095
  // The floating element's position may be recomputed while it's closed
1093
1096
  // but still mounted (such as when transitioning out). To ensure
1094
1097
  // `isPositioned` will be `false` initially on the next open, avoid
1095
1098
  // setting it to `true` when `open === false` (must be specified).
1096
1099
  isPositioned: ee.current !== !1
1097
1100
  };
1098
- I.current && !fe(z.current, j) && (z.current = j, ot.flushSync(() => {
1101
+ N.current && !fe(z.current, j) && (z.current = j, st.flushSync(() => {
1099
1102
  d(j);
1100
1103
  }));
1101
1104
  });
1102
- }, [m, o, t, q, ee]);
1103
- ie(() => {
1104
- a === !1 && z.current.isPositioned && (z.current.isPositioned = !1, d((S) => ({
1105
+ }, [h, o, t, Y, ee]);
1106
+ se(() => {
1107
+ c === !1 && z.current.isPositioned && (z.current.isPositioned = !1, d((S) => ({
1105
1108
  ...S,
1106
1109
  isPositioned: !1
1107
1110
  })));
1108
- }, [a]);
1109
- const I = C.useRef(!1);
1110
- ie(() => (I.current = !0, () => {
1111
- I.current = !1;
1112
- }), []), ie(() => {
1113
- if (E && (O.current = E), y && (R.current = y), E && y) {
1114
- if (F.current)
1115
- return F.current(E, y, B);
1111
+ }, [c]);
1112
+ const N = C.useRef(!1);
1113
+ se(() => (N.current = !0, () => {
1114
+ N.current = !1;
1115
+ }), []), se(() => {
1116
+ if (E && (R.current = E), y && (O.current = y), E && y) {
1117
+ if (P.current)
1118
+ return P.current(E, y, B);
1116
1119
  B();
1117
1120
  }
1118
- }, [E, y, B, F, Y]);
1121
+ }, [E, y, B, P, K]);
1119
1122
  const te = C.useMemo(() => ({
1120
- reference: O,
1121
- floating: R,
1123
+ reference: R,
1124
+ floating: O,
1122
1125
  setReference: p,
1123
1126
  setFloating: v
1124
- }), [p, v]), M = C.useMemo(() => ({
1127
+ }), [p, v]), k = C.useMemo(() => ({
1125
1128
  reference: E,
1126
1129
  floating: y
1127
1130
  }), [E, y]), V = C.useMemo(() => {
@@ -1130,40 +1133,40 @@ function Ht(e) {
1130
1133
  left: 0,
1131
1134
  top: 0
1132
1135
  };
1133
- if (!M.floating)
1136
+ if (!k.floating)
1134
1137
  return S;
1135
- const T = _e(M.floating, u.x), j = _e(M.floating, u.y);
1138
+ const A = _e(k.floating, u.x), j = _e(k.floating, u.y);
1136
1139
  return l ? {
1137
1140
  ...S,
1138
- transform: "translate(" + T + "px, " + j + "px)",
1139
- ...Je(M.floating) >= 1.5 && {
1141
+ transform: "translate(" + A + "px, " + j + "px)",
1142
+ ...et(k.floating) >= 1.5 && {
1140
1143
  willChange: "transform"
1141
1144
  }
1142
1145
  } : {
1143
1146
  position: t,
1144
- left: T,
1147
+ left: A,
1145
1148
  top: j
1146
1149
  };
1147
- }, [t, l, M.floating, u.x, u.y]);
1150
+ }, [t, l, k.floating, u.x, u.y]);
1148
1151
  return C.useMemo(() => ({
1149
1152
  ...u,
1150
1153
  update: B,
1151
1154
  refs: te,
1152
- elements: M,
1155
+ elements: k,
1153
1156
  floatingStyles: V
1154
- }), [u, B, te, M, V]);
1157
+ }), [u, B, te, k, V]);
1155
1158
  }
1156
- const Ut = (e, o) => ({
1157
- ...Wt(e),
1158
- options: [e, o]
1159
- }), Kt = (e, o) => ({
1160
- ...Bt(e),
1159
+ const Kt = (e, o) => ({
1160
+ ...jt(e),
1161
1161
  options: [e, o]
1162
1162
  }), Yt = (e, o) => ({
1163
- ...jt(e),
1163
+ ...$t(e),
1164
+ options: [e, o]
1165
+ }), Xt = (e, o) => ({
1166
+ ...Ht(e),
1164
1167
  options: [e, o]
1165
1168
  });
1166
- function qt(e, o) {
1169
+ function Zt(e, o) {
1167
1170
  return () => {
1168
1171
  if (typeof document > "u")
1169
1172
  return;
@@ -1175,153 +1178,156 @@ function qt(e, o) {
1175
1178
  };
1176
1179
  };
1177
1180
  }
1178
- function Qe(e) {
1181
+ function tt(e) {
1179
1182
  const {
1180
1183
  className: o,
1181
1184
  placement: t = "bottom-start",
1182
1185
  trigger: n = "hover",
1183
- content: s,
1184
- children: i,
1186
+ content: i,
1187
+ children: s,
1185
1188
  onClose: r,
1186
1189
  onOpen: l,
1187
- disabled: c = !1,
1188
- show: a = !1,
1190
+ disabled: a = !1,
1191
+ show: c = !1,
1189
1192
  setShow: u,
1190
1193
  role: d = "tooltip",
1191
- style: m,
1194
+ style: h,
1192
1195
  ...f
1193
- } = e, [g, x] = de(a), w = () => u !== void 0 && a !== void 0 ? a : g, h = () => u !== void 0 && a !== void 0 ? u : x, { x: p, y: v, strategy: E, refs: y } = Ht({
1196
+ } = e, [g, x] = de(c), w = () => u !== void 0 && c !== void 0 ? c : g, m = () => u !== void 0 && c !== void 0 ? u : x, { x: p, y: v, strategy: E, refs: y } = qt({
1194
1197
  open: w(),
1195
- middleware: [Ut(4), Yt(), Kt()],
1196
- whileElementsMounted: Vt,
1198
+ middleware: [Kt(4), Xt(), Yt()],
1199
+ whileElementsMounted: Bt,
1197
1200
  placement: t
1198
- }), O = nt();
1201
+ }), R = it();
1199
1202
  return re(
1200
- qt(y.floating, (R) => {
1201
- R && h()(!1);
1203
+ Zt(y.floating, (O) => {
1204
+ O && m()(!1);
1202
1205
  }),
1203
1206
  []
1204
- ), /* @__PURE__ */ W(Fe, { children: [
1207
+ ), /* @__PURE__ */ W(Ve, { children: [
1205
1208
  /* @__PURE__ */ b(
1206
1209
  "div",
1207
1210
  {
1208
1211
  className: "z-auto min-w-fit max-w-fit",
1209
- id: `zen__popover-${O}`,
1212
+ id: `zen__popover-${R}`,
1210
1213
  ref: y.setReference,
1211
- onClick: (R) => {
1214
+ onClick: (O) => {
1212
1215
  if (n === "click") {
1213
- if (c)
1216
+ if (a)
1214
1217
  return;
1215
- w() ? (h()(!1), r == null || r()) : (h()(!0), l == null || l());
1218
+ w() ? (m()(!1), r == null || r()) : (m()(!0), l == null || l());
1216
1219
  }
1217
- R.stopPropagation();
1220
+ O.stopPropagation();
1218
1221
  },
1219
1222
  role: d,
1220
- children: i
1223
+ children: s
1221
1224
  }
1222
1225
  ),
1223
- w() && st(
1226
+ w() && rt(
1224
1227
  /* @__PURE__ */ b(
1225
1228
  "div",
1226
1229
  {
1227
1230
  ...f,
1228
- onClick: (R) => R.stopPropagation(),
1231
+ onClick: (O) => O.stopPropagation(),
1229
1232
  role: "tooltip",
1230
- className: k(
1233
+ className: M(
1231
1234
  "zen__popover z-50 w-fit rounded border border-border bg-background shadow-secondary",
1232
1235
  o
1233
1236
  ),
1234
1237
  ref: y.setFloating,
1235
1238
  style: {
1236
- ...m,
1239
+ ...h,
1237
1240
  position: E,
1238
1241
  top: v ?? 0,
1239
1242
  left: p ?? 0
1240
1243
  },
1241
- children: s
1244
+ children: i
1242
1245
  }
1243
1246
  ),
1244
1247
  document.body
1245
1248
  )
1246
1249
  ] });
1247
1250
  }
1248
- function Xt(e) {
1251
+ function Gt(e) {
1249
1252
  var x, w;
1250
1253
  const {
1251
1254
  items: o = [],
1252
1255
  children: t,
1253
1256
  moreItemsLabel: n = "",
1254
- parentRef: s,
1255
- data: i,
1256
- estimator: r = (h, p) => p + 30,
1257
+ parentRef: i,
1258
+ data: s,
1259
+ estimator: r = (m, p) => p + 30,
1257
1260
  font: l = "12px Inter",
1258
- badgeVariant: c = "secondary",
1259
- badgeStyles: a
1261
+ badgeVariant: a = "secondary",
1262
+ badgeStyles: c
1260
1263
  } = e, [u, d] = de({
1261
1264
  visible: o,
1262
1265
  hidden: []
1263
- }), m = ve(() => {
1266
+ }), h = ve(() => {
1264
1267
  if (typeof document > "u")
1265
1268
  return null;
1266
1269
  const p = document.createElement("canvas").getContext("2d");
1267
1270
  return p && (p.font = l), p;
1268
1271
  }, []), f = () => {
1269
- const h = s == null ? void 0 : s.current;
1270
- if (!h)
1272
+ const m = i == null ? void 0 : i.current;
1273
+ if (!m)
1271
1274
  return;
1272
- const p = h.offsetWidth, v = [], E = [], y = r(n, m.measureText(n).width + 10);
1273
- g == null || g.reduce((O, R, z) => (O + R + y > p - 20 ? E.push(o[z]) : v.push(o[z]), O + R), 0), d({
1275
+ const p = m.offsetWidth, v = [], E = [], y = r(
1276
+ n,
1277
+ ((h == null ? void 0 : h.measureText(n).width) ?? 0) + 10
1278
+ );
1279
+ g == null || g.reduce((R, O, z) => (R + O + y > p - 20 ? E.push(o[z]) : v.push(o[z]), R + O), 0), d({
1274
1280
  visible: v,
1275
1281
  hidden: E
1276
1282
  });
1277
1283
  }, g = ve(
1278
- () => (o == null ? void 0 : o.map((h) => r(h, m.measureText(h).width))) ?? [],
1284
+ () => (o == null ? void 0 : o.map((m) => r(m, (h == null ? void 0 : h.measureText(m).width) ?? 0))) ?? [],
1279
1285
  [o]
1280
1286
  );
1281
1287
  return re(() => {
1282
1288
  f();
1283
1289
  }, [o]), re(() => {
1284
- if (!(s != null && s.current)) return;
1285
- const h = new ResizeObserver(() => {
1290
+ if (!(i != null && i.current)) return;
1291
+ const m = new ResizeObserver(() => {
1286
1292
  f();
1287
1293
  });
1288
- return h.observe(s.current), () => {
1289
- h.disconnect();
1294
+ return m.observe(i.current), () => {
1295
+ m.disconnect();
1290
1296
  };
1291
- }, [o]), /* @__PURE__ */ W(Fe, { children: [
1292
- (x = u.visible) == null ? void 0 : x.map((h, p) => t(h, p, i == null ? void 0 : i[p])),
1297
+ }, [o]), /* @__PURE__ */ W(Ve, { children: [
1298
+ (x = u.visible) == null ? void 0 : x.map((m, p) => t(m, p, s == null ? void 0 : s[p])),
1293
1299
  ((w = u.hidden) == null ? void 0 : w.length) > 0 && /* @__PURE__ */ b(
1294
- Qe,
1300
+ tt,
1295
1301
  {
1296
1302
  trigger: "click",
1297
1303
  content: /* @__PURE__ */ b("div", { className: "grid max-h-60 grid-flow-row grid-cols-2 gap-3 overflow-auto p-2", children: u.hidden.map(
1298
- (h, p) => t(
1299
- h,
1304
+ (m, p) => t(
1305
+ m,
1300
1306
  u.visible.length + p,
1301
- i == null ? void 0 : i[u.visible.length + p]
1307
+ s == null ? void 0 : s[u.visible.length + p]
1302
1308
  )
1303
1309
  ) }),
1304
- children: /* @__PURE__ */ b(We, { className: a, variant: c, children: /* @__PURE__ */ b("p", { children: `+${u.hidden.length} ${n}` }) }, "more_items_button")
1310
+ children: /* @__PURE__ */ b(Be, { className: c, variant: a, children: /* @__PURE__ */ b("p", { children: `+${u.hidden.length} ${n}` }) }, "more_items_button")
1305
1311
  }
1306
1312
  )
1307
1313
  ] });
1308
1314
  }
1309
1315
  function X(e, o, t) {
1310
- let n = t.initialDeps ?? [], s;
1316
+ let n = t.initialDeps ?? [], i;
1311
1317
  return () => {
1312
- var i, r, l, c;
1313
- let a;
1314
- t.key && ((i = t.debug) != null && i.call(t)) && (a = Date.now());
1318
+ var s, r, l, a;
1319
+ let c;
1320
+ t.key && ((s = t.debug) != null && s.call(t)) && (c = Date.now());
1315
1321
  const u = e();
1316
1322
  if (!(u.length !== n.length || u.some((f, g) => n[g] !== f)))
1317
- return s;
1323
+ return i;
1318
1324
  n = u;
1319
- let m;
1320
- if (t.key && ((r = t.debug) != null && r.call(t)) && (m = Date.now()), s = o(...u), t.key && ((l = t.debug) != null && l.call(t))) {
1321
- const f = Math.round((Date.now() - a) * 100) / 100, g = Math.round((Date.now() - m) * 100) / 100, x = g / 16, w = (h, p) => {
1322
- for (h = String(h); h.length < p; )
1323
- h = " " + h;
1324
- return h;
1325
+ let h;
1326
+ if (t.key && ((r = t.debug) != null && r.call(t)) && (h = Date.now()), i = o(...u), t.key && ((l = t.debug) != null && l.call(t))) {
1327
+ const f = Math.round((Date.now() - c) * 100) / 100, g = Math.round((Date.now() - h) * 100) / 100, x = g / 16, w = (m, p) => {
1328
+ for (m = String(m); m.length < p; )
1329
+ m = " " + m;
1330
+ return m;
1325
1331
  };
1326
1332
  console.info(
1327
1333
  `%c⏱ ${w(g, 5)} /${w(f, 5)} ms`,
@@ -1335,7 +1341,7 @@ function X(e, o, t) {
1335
1341
  t == null ? void 0 : t.key
1336
1342
  );
1337
1343
  }
1338
- return (c = t == null ? void 0 : t.onChange) == null || c.call(t, s), s;
1344
+ return (a = t == null ? void 0 : t.onChange) == null || a.call(t, i), i;
1339
1345
  };
1340
1346
  }
1341
1347
  function be(e, o) {
@@ -1343,69 +1349,74 @@ function be(e, o) {
1343
1349
  throw new Error("Unexpected undefined");
1344
1350
  return e;
1345
1351
  }
1346
- const Zt = (e, o) => Math.abs(e - o) < 1, Gt = (e, o, t) => {
1352
+ const Jt = (e, o) => Math.abs(e - o) < 1, Qt = (e, o, t) => {
1347
1353
  let n;
1348
- return function(...s) {
1349
- e.clearTimeout(n), n = e.setTimeout(() => o.apply(this, s), t);
1354
+ return function(...i) {
1355
+ e.clearTimeout(n), n = e.setTimeout(() => o.apply(this, i), t);
1350
1356
  };
1351
- }, Jt = (e) => e, Qt = (e) => {
1357
+ }, en = (e) => e, tn = (e) => {
1352
1358
  const o = Math.max(e.startIndex - e.overscan, 0), t = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
1353
- for (let s = o; s <= t; s++)
1354
- n.push(s);
1359
+ for (let i = o; i <= t; i++)
1360
+ n.push(i);
1355
1361
  return n;
1356
- }, en = (e, o) => {
1362
+ }, nn = (e, o) => {
1357
1363
  const t = e.scrollElement;
1358
1364
  if (!t)
1359
1365
  return;
1360
1366
  const n = e.targetWindow;
1361
1367
  if (!n)
1362
1368
  return;
1363
- const s = (r) => {
1364
- const { width: l, height: c } = r;
1365
- o({ width: Math.round(l), height: Math.round(c) });
1369
+ const i = (r) => {
1370
+ const { width: l, height: a } = r;
1371
+ o({ width: Math.round(l), height: Math.round(a) });
1366
1372
  };
1367
- if (s(t.getBoundingClientRect()), !n.ResizeObserver)
1373
+ if (i(t.getBoundingClientRect()), !n.ResizeObserver)
1368
1374
  return () => {
1369
1375
  };
1370
- const i = new n.ResizeObserver((r) => {
1371
- const l = r[0];
1372
- if (l != null && l.borderBoxSize) {
1373
- const c = l.borderBoxSize[0];
1374
- if (c) {
1375
- s({ width: c.inlineSize, height: c.blockSize });
1376
- return;
1376
+ const s = new n.ResizeObserver((r) => {
1377
+ const l = () => {
1378
+ const a = r[0];
1379
+ if (a != null && a.borderBoxSize) {
1380
+ const c = a.borderBoxSize[0];
1381
+ if (c) {
1382
+ i({ width: c.inlineSize, height: c.blockSize });
1383
+ return;
1384
+ }
1377
1385
  }
1378
- }
1379
- s(t.getBoundingClientRect());
1386
+ i(t.getBoundingClientRect());
1387
+ };
1388
+ e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
1380
1389
  });
1381
- return i.observe(t, { box: "border-box" }), () => {
1382
- i.unobserve(t);
1390
+ return s.observe(t, { box: "border-box" }), () => {
1391
+ s.unobserve(t);
1383
1392
  };
1384
1393
  }, De = {
1385
1394
  passive: !0
1386
- }, tn = typeof window > "u" ? !0 : "onscrollend" in window, nn = (e, o) => {
1395
+ }, Fe = typeof window > "u" ? !0 : "onscrollend" in window, on = (e, o) => {
1387
1396
  const t = e.scrollElement;
1388
1397
  if (!t)
1389
1398
  return;
1390
1399
  const n = e.targetWindow;
1391
1400
  if (!n)
1392
1401
  return;
1393
- let s = 0;
1394
- const i = e.options.useScrollendEvent && tn ? () => {
1395
- } : Gt(
1402
+ let i = 0;
1403
+ const s = e.options.useScrollendEvent && Fe ? () => {
1404
+ } : Qt(
1396
1405
  n,
1397
1406
  () => {
1398
- o(s, !1);
1407
+ o(i, !1);
1399
1408
  },
1400
1409
  e.options.isScrollingResetDelay
1401
- ), r = (a) => () => {
1402
- const { horizontal: u, isRtl: d } = e.options;
1403
- s = u ? t.scrollLeft * (d && -1 || 1) : t.scrollTop, i(), o(s, a);
1404
- }, l = r(!0), c = r(!1);
1405
- return c(), t.addEventListener("scroll", l, De), t.addEventListener("scrollend", c, De), () => {
1406
- t.removeEventListener("scroll", l), t.removeEventListener("scrollend", c);
1410
+ ), r = (u) => () => {
1411
+ const { horizontal: d, isRtl: h } = e.options;
1412
+ i = d ? t.scrollLeft * (h && -1 || 1) : t.scrollTop, s(), o(i, u);
1413
+ }, l = r(!0), a = r(!1);
1414
+ a(), t.addEventListener("scroll", l, De);
1415
+ const c = e.options.useScrollendEvent && Fe;
1416
+ return c && t.addEventListener("scrollend", a, De), () => {
1417
+ t.removeEventListener("scroll", l), c && t.removeEventListener("scrollend", a);
1407
1418
  };
1408
- }, on = (e, o, t) => {
1419
+ }, sn = (e, o, t) => {
1409
1420
  if (o != null && o.borderBoxSize) {
1410
1421
  const n = o.borderBoxSize[0];
1411
1422
  if (n)
@@ -1416,43 +1427,46 @@ const Zt = (e, o) => Math.abs(e - o) < 1, Gt = (e, o, t) => {
1416
1427
  return Math.round(
1417
1428
  e.getBoundingClientRect()[t.options.horizontal ? "width" : "height"]
1418
1429
  );
1419
- }, sn = (e, {
1430
+ }, rn = (e, {
1420
1431
  adjustments: o = 0,
1421
1432
  behavior: t
1422
1433
  }, n) => {
1423
- var s, i;
1434
+ var i, s;
1424
1435
  const r = e + o;
1425
- (i = (s = n.scrollElement) == null ? void 0 : s.scrollTo) == null || i.call(s, {
1436
+ (s = (i = n.scrollElement) == null ? void 0 : i.scrollTo) == null || s.call(i, {
1426
1437
  [n.options.horizontal ? "left" : "top"]: r,
1427
1438
  behavior: t
1428
1439
  });
1429
1440
  };
1430
- class rn {
1441
+ class ln {
1431
1442
  constructor(o) {
1432
1443
  this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
1433
1444
  let t = null;
1434
- const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((s) => {
1435
- s.forEach((i) => {
1436
- this._measureElement(i.target, i);
1445
+ const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((i) => {
1446
+ i.forEach((s) => {
1447
+ const r = () => {
1448
+ this._measureElement(s.target, s);
1449
+ };
1450
+ this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
1437
1451
  });
1438
1452
  }));
1439
1453
  return {
1440
1454
  disconnect: () => {
1441
- var s;
1442
- (s = n()) == null || s.disconnect(), t = null;
1443
- },
1444
- observe: (s) => {
1445
1455
  var i;
1446
- return (i = n()) == null ? void 0 : i.observe(s, { box: "border-box" });
1456
+ (i = n()) == null || i.disconnect(), t = null;
1447
1457
  },
1448
- unobserve: (s) => {
1449
- var i;
1450
- return (i = n()) == null ? void 0 : i.unobserve(s);
1458
+ observe: (i) => {
1459
+ var s;
1460
+ return (s = n()) == null ? void 0 : s.observe(i, { box: "border-box" });
1461
+ },
1462
+ unobserve: (i) => {
1463
+ var s;
1464
+ return (s = n()) == null ? void 0 : s.unobserve(i);
1451
1465
  }
1452
1466
  };
1453
1467
  })(), this.range = null, this.setOptions = (t) => {
1454
- Object.entries(t).forEach(([n, s]) => {
1455
- typeof s > "u" && delete t[n];
1468
+ Object.entries(t).forEach(([n, i]) => {
1469
+ typeof i > "u" && delete t[n];
1456
1470
  }), this.options = {
1457
1471
  debug: !1,
1458
1472
  initialOffset: 0,
@@ -1462,11 +1476,11 @@ class rn {
1462
1476
  scrollPaddingStart: 0,
1463
1477
  scrollPaddingEnd: 0,
1464
1478
  horizontal: !1,
1465
- getItemKey: Jt,
1466
- rangeExtractor: Qt,
1479
+ getItemKey: en,
1480
+ rangeExtractor: tn,
1467
1481
  onChange: () => {
1468
1482
  },
1469
- measureElement: on,
1483
+ measureElement: sn,
1470
1484
  initialRect: { width: 0, height: 0 },
1471
1485
  scrollMargin: 0,
1472
1486
  gap: 0,
@@ -1477,11 +1491,12 @@ class rn {
1477
1491
  enabled: !0,
1478
1492
  isRtl: !1,
1479
1493
  useScrollendEvent: !0,
1494
+ useAnimationFrameWithResizeObserver: !1,
1480
1495
  ...t
1481
1496
  };
1482
1497
  }, this.notify = (t) => {
1483
- var n, s;
1484
- (s = (n = this.options).onChange) == null || s.call(n, this, t);
1498
+ var n, i;
1499
+ (i = (n = this.options).onChange) == null || i.call(n, this, t);
1485
1500
  }, this.maybeNotify = X(
1486
1501
  () => (this.calculateRange(), [
1487
1502
  this.isScrolling,
@@ -1512,34 +1527,34 @@ class rn {
1512
1527
  this.maybeNotify();
1513
1528
  return;
1514
1529
  }
1515
- this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((s) => {
1516
- this.observer.observe(s);
1530
+ this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((i) => {
1531
+ this.observer.observe(i);
1517
1532
  }), this._scrollToOffset(this.getScrollOffset(), {
1518
1533
  adjustments: void 0,
1519
1534
  behavior: void 0
1520
1535
  }), this.unsubs.push(
1521
- this.options.observeElementRect(this, (s) => {
1522
- this.scrollRect = s, this.maybeNotify();
1536
+ this.options.observeElementRect(this, (i) => {
1537
+ this.scrollRect = i, this.maybeNotify();
1523
1538
  })
1524
1539
  ), this.unsubs.push(
1525
- this.options.observeElementOffset(this, (s, i) => {
1526
- this.scrollAdjustments = 0, this.scrollDirection = i ? this.getScrollOffset() < s ? "forward" : "backward" : null, this.scrollOffset = s, this.isScrolling = i, this.maybeNotify();
1540
+ this.options.observeElementOffset(this, (i, s) => {
1541
+ this.scrollAdjustments = 0, this.scrollDirection = s ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = s, this.maybeNotify();
1527
1542
  })
1528
1543
  );
1529
1544
  }
1530
1545
  }, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
1531
- const s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
1546
+ const i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1532
1547
  for (let r = n - 1; r >= 0; r--) {
1533
1548
  const l = t[r];
1534
- if (s.has(l.lane))
1549
+ if (i.has(l.lane))
1535
1550
  continue;
1536
- const c = i.get(
1551
+ const a = s.get(
1537
1552
  l.lane
1538
1553
  );
1539
- if (c == null || l.end > c.end ? i.set(l.lane, l) : l.end < c.end && s.set(l.lane, !0), s.size === this.options.lanes)
1554
+ if (a == null || l.end > a.end ? s.set(l.lane, l) : l.end < a.end && i.set(l.lane, !0), i.size === this.options.lanes)
1540
1555
  break;
1541
1556
  }
1542
- return i.size === this.options.lanes ? Array.from(i.values()).sort((r, l) => r.end === l.end ? r.index - l.index : r.end - l.end)[0] : void 0;
1557
+ return s.size === this.options.lanes ? Array.from(s.values()).sort((r, l) => r.end === l.end ? r.index - l.index : r.end - l.end)[0] : void 0;
1543
1558
  }, this.getMeasurementOptions = X(
1544
1559
  () => [
1545
1560
  this.options.count,
@@ -1548,11 +1563,11 @@ class rn {
1548
1563
  this.options.getItemKey,
1549
1564
  this.options.enabled
1550
1565
  ],
1551
- (t, n, s, i, r) => (this.pendingMeasuredCacheIndexes = [], {
1566
+ (t, n, i, s, r) => (this.pendingMeasuredCacheIndexes = [], {
1552
1567
  count: t,
1553
1568
  paddingStart: n,
1554
- scrollMargin: s,
1555
- getItemKey: i,
1569
+ scrollMargin: i,
1570
+ getItemKey: s,
1556
1571
  enabled: r
1557
1572
  }),
1558
1573
  {
@@ -1560,97 +1575,108 @@ class rn {
1560
1575
  }
1561
1576
  ), this.getMeasurements = X(
1562
1577
  () => [this.getMeasurementOptions(), this.itemSizeCache],
1563
- ({ count: t, paddingStart: n, scrollMargin: s, getItemKey: i, enabled: r }, l) => {
1578
+ ({ count: t, paddingStart: n, scrollMargin: i, getItemKey: s, enabled: r }, l) => {
1564
1579
  if (!r)
1565
1580
  return this.measurementsCache = [], this.itemSizeCache.clear(), [];
1566
1581
  this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((u) => {
1567
1582
  this.itemSizeCache.set(u.key, u.size);
1568
1583
  }));
1569
- const c = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
1584
+ const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
1570
1585
  this.pendingMeasuredCacheIndexes = [];
1571
- const a = this.measurementsCache.slice(0, c);
1572
- for (let u = c; u < t; u++) {
1573
- const d = i(u), m = this.options.lanes === 1 ? a[u - 1] : this.getFurthestMeasurement(a, u), f = m ? m.end + this.options.gap : n + s, g = l.get(d), x = typeof g == "number" ? g : this.options.estimateSize(u), w = f + x, h = m ? m.lane : u % this.options.lanes;
1574
- a[u] = {
1586
+ const c = this.measurementsCache.slice(0, a);
1587
+ for (let u = a; u < t; u++) {
1588
+ const d = s(u), h = this.options.lanes === 1 ? c[u - 1] : this.getFurthestMeasurement(c, u), f = h ? h.end + this.options.gap : n + i, g = l.get(d), x = typeof g == "number" ? g : this.options.estimateSize(u), w = f + x, m = h ? h.lane : u % this.options.lanes;
1589
+ c[u] = {
1575
1590
  index: u,
1576
1591
  start: f,
1577
1592
  size: x,
1578
1593
  end: w,
1579
1594
  key: d,
1580
- lane: h
1595
+ lane: m
1581
1596
  };
1582
1597
  }
1583
- return this.measurementsCache = a, a;
1598
+ return this.measurementsCache = c, c;
1584
1599
  },
1585
1600
  {
1586
1601
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
1587
1602
  debug: () => this.options.debug
1588
1603
  }
1589
1604
  ), this.calculateRange = X(
1590
- () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
1591
- (t, n, s) => this.range = t.length > 0 && n > 0 ? ln({
1605
+ () => [
1606
+ this.getMeasurements(),
1607
+ this.getSize(),
1608
+ this.getScrollOffset(),
1609
+ this.options.lanes
1610
+ ],
1611
+ (t, n, i, s) => this.range = t.length > 0 && n > 0 ? cn({
1592
1612
  measurements: t,
1593
1613
  outerSize: n,
1594
- scrollOffset: s
1614
+ scrollOffset: i,
1615
+ lanes: s
1595
1616
  }) : null,
1596
1617
  {
1597
1618
  key: process.env.NODE_ENV !== "production" && "calculateRange",
1598
1619
  debug: () => this.options.debug
1599
1620
  }
1600
- ), this.getIndexes = X(
1601
- () => [
1602
- this.options.rangeExtractor,
1603
- this.calculateRange(),
1604
- this.options.overscan,
1605
- this.options.count
1606
- ],
1607
- (t, n, s, i) => n === null ? [] : t({
1608
- startIndex: n.startIndex,
1609
- endIndex: n.endIndex,
1610
- overscan: s,
1621
+ ), this.getVirtualIndexes = X(
1622
+ () => {
1623
+ let t = null, n = null;
1624
+ const i = this.calculateRange();
1625
+ return i && (t = i.startIndex, n = i.endIndex), [
1626
+ this.options.rangeExtractor,
1627
+ this.options.overscan,
1628
+ this.options.count,
1629
+ t,
1630
+ n
1631
+ ];
1632
+ },
1633
+ (t, n, i, s, r) => s === null || r === null ? [] : t({
1634
+ startIndex: s,
1635
+ endIndex: r,
1636
+ overscan: n,
1611
1637
  count: i
1612
1638
  }),
1613
1639
  {
1614
- key: process.env.NODE_ENV !== "production" && "getIndexes",
1640
+ key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
1615
1641
  debug: () => this.options.debug
1616
1642
  }
1617
1643
  ), this.indexFromElement = (t) => {
1618
- const n = this.options.indexAttribute, s = t.getAttribute(n);
1619
- return s ? parseInt(s, 10) : (console.warn(
1644
+ const n = this.options.indexAttribute, i = t.getAttribute(n);
1645
+ return i ? parseInt(i, 10) : (console.warn(
1620
1646
  `Missing attribute name '${n}={index}' on measured element.`
1621
1647
  ), -1);
1622
1648
  }, this._measureElement = (t, n) => {
1623
- const s = this.indexFromElement(t), i = this.measurementsCache[s];
1624
- if (!i)
1649
+ const i = this.indexFromElement(t), s = this.measurementsCache[i];
1650
+ if (!s)
1625
1651
  return;
1626
- const r = i.key, l = this.elementsCache.get(r);
1627
- l !== t && (l && this.observer.unobserve(l), this.observer.observe(t), this.elementsCache.set(r, t)), t.isConnected && this.resizeItem(s, this.options.measureElement(t, n, this));
1652
+ const r = s.key, l = this.elementsCache.get(r);
1653
+ l !== t && (l && this.observer.unobserve(l), this.observer.observe(t), this.elementsCache.set(r, t)), t.isConnected && this.resizeItem(i, this.options.measureElement(t, n, this));
1628
1654
  }, this.resizeItem = (t, n) => {
1629
- const s = this.measurementsCache[t];
1630
- if (!s)
1655
+ const i = this.measurementsCache[t];
1656
+ if (!i)
1631
1657
  return;
1632
- const i = this.itemSizeCache.get(s.key) ?? s.size, r = n - i;
1633
- r !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(s, r, this) : s.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
1658
+ const s = this.itemSizeCache.get(i.key) ?? i.size, r = n - s;
1659
+ r !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(i, r, this) : i.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
1634
1660
  adjustments: this.scrollAdjustments += r,
1635
1661
  behavior: void 0
1636
- })), this.pendingMeasuredCacheIndexes.push(s.index), this.itemSizeCache = new Map(this.itemSizeCache.set(s.key, n)), this.notify(!1));
1662
+ })), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, n)), this.notify(!1));
1637
1663
  }, this.measureElement = (t) => {
1638
1664
  if (!t) {
1639
- this.elementsCache.forEach((n, s) => {
1640
- n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(s));
1665
+ this.elementsCache.forEach((n, i) => {
1666
+ n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(i));
1641
1667
  });
1642
1668
  return;
1643
1669
  }
1644
1670
  this._measureElement(t, void 0);
1645
1671
  }, this.getVirtualItems = X(
1646
- () => [this.getIndexes(), this.getMeasurements()],
1672
+ () => [this.getVirtualIndexes(), this.getMeasurements()],
1647
1673
  (t, n) => {
1648
- const s = [];
1649
- for (let i = 0, r = t.length; i < r; i++) {
1650
- const l = t[i], c = n[l];
1651
- s.push(c);
1674
+ const i = [];
1675
+ for (let s = 0, r = t.length; s < r; s++) {
1676
+ const l = t[s], a = n[l];
1677
+ i.push(a);
1652
1678
  }
1653
- return s;
1679
+ return i;
1654
1680
  },
1655
1681
  {
1656
1682
  key: process.env.NODE_ENV !== "production" && "getVirtualItems",
@@ -1660,59 +1686,62 @@ class rn {
1660
1686
  const n = this.getMeasurements();
1661
1687
  if (n.length !== 0)
1662
1688
  return be(
1663
- n[et(
1689
+ n[nt(
1664
1690
  0,
1665
1691
  n.length - 1,
1666
- (s) => be(n[s]).start,
1692
+ (i) => be(n[i]).start,
1667
1693
  t
1668
1694
  )]
1669
1695
  );
1670
- }, this.getOffsetForAlignment = (t, n) => {
1671
- const s = this.getSize(), i = this.getScrollOffset();
1672
- n === "auto" && (t <= i ? n = "start" : t >= i + s ? n = "end" : n = "start"), n === "start" ? t = t : n === "end" ? t = t - s : n === "center" && (t = t - s / 2);
1673
- const r = this.options.horizontal ? "scrollWidth" : "scrollHeight", c = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[r] : this.scrollElement[r] : 0) - s;
1696
+ }, this.getOffsetForAlignment = (t, n, i = 0) => {
1697
+ const s = this.getSize(), r = this.getScrollOffset();
1698
+ n === "auto" && (n = t >= r + s ? "end" : "start"), n === "center" ? t += (i - s) / 2 : n === "end" && (t -= s);
1699
+ const l = this.options.horizontal ? "scrollWidth" : "scrollHeight", c = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[l] : this.scrollElement[l] : 0) - s;
1674
1700
  return Math.max(Math.min(c, t), 0);
1675
1701
  }, this.getOffsetForIndex = (t, n = "auto") => {
1676
1702
  t = Math.max(0, Math.min(t, this.options.count - 1));
1677
- const s = this.measurementsCache[t];
1678
- if (!s)
1703
+ const i = this.measurementsCache[t];
1704
+ if (!i)
1679
1705
  return;
1680
- const i = this.getSize(), r = this.getScrollOffset();
1706
+ const s = this.getSize(), r = this.getScrollOffset();
1681
1707
  if (n === "auto")
1682
- if (s.end >= r + i - this.options.scrollPaddingEnd)
1708
+ if (i.end >= r + s - this.options.scrollPaddingEnd)
1683
1709
  n = "end";
1684
- else if (s.start <= r + this.options.scrollPaddingStart)
1710
+ else if (i.start <= r + this.options.scrollPaddingStart)
1685
1711
  n = "start";
1686
1712
  else
1687
1713
  return [r, n];
1688
- const l = n === "end" ? s.end + this.options.scrollPaddingEnd : s.start - this.options.scrollPaddingStart;
1689
- return [this.getOffsetForAlignment(l, n), n];
1714
+ const l = n === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
1715
+ return [
1716
+ this.getOffsetForAlignment(l, n, i.size),
1717
+ n
1718
+ ];
1690
1719
  }, this.isDynamicMode = () => this.elementsCache.size > 0, this.cancelScrollToIndex = () => {
1691
1720
  this.scrollToIndexTimeoutId !== null && this.targetWindow && (this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId), this.scrollToIndexTimeoutId = null);
1692
- }, this.scrollToOffset = (t, { align: n = "start", behavior: s } = {}) => {
1693
- this.cancelScrollToIndex(), s === "smooth" && this.isDynamicMode() && console.warn(
1721
+ }, this.scrollToOffset = (t, { align: n = "start", behavior: i } = {}) => {
1722
+ this.cancelScrollToIndex(), i === "smooth" && this.isDynamicMode() && console.warn(
1694
1723
  "The `smooth` scroll behavior is not fully supported with dynamic size."
1695
1724
  ), this._scrollToOffset(this.getOffsetForAlignment(t, n), {
1696
1725
  adjustments: void 0,
1697
- behavior: s
1726
+ behavior: i
1698
1727
  });
1699
- }, this.scrollToIndex = (t, { align: n = "auto", behavior: s } = {}) => {
1700
- t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(), s === "smooth" && this.isDynamicMode() && console.warn(
1728
+ }, this.scrollToIndex = (t, { align: n = "auto", behavior: i } = {}) => {
1729
+ t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(), i === "smooth" && this.isDynamicMode() && console.warn(
1701
1730
  "The `smooth` scroll behavior is not fully supported with dynamic size."
1702
1731
  );
1703
- const i = this.getOffsetForIndex(t, n);
1704
- if (!i) return;
1705
- const [r, l] = i;
1706
- this._scrollToOffset(r, { adjustments: void 0, behavior: s }), s !== "smooth" && this.isDynamicMode() && this.targetWindow && (this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
1732
+ const s = this.getOffsetForIndex(t, n);
1733
+ if (!s) return;
1734
+ const [r, l] = s;
1735
+ this._scrollToOffset(r, { adjustments: void 0, behavior: i }), i !== "smooth" && this.isDynamicMode() && this.targetWindow && (this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
1707
1736
  if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
1708
1737
  this.options.getItemKey(t)
1709
1738
  )) {
1710
- const [a] = be(
1739
+ const [c] = be(
1711
1740
  this.getOffsetForIndex(t, l)
1712
1741
  );
1713
- Zt(a, this.getScrollOffset()) || this.scrollToIndex(t, { align: l, behavior: s });
1742
+ Jt(c, this.getScrollOffset()) || this.scrollToIndex(t, { align: l, behavior: i });
1714
1743
  } else
1715
- this.scrollToIndex(t, { align: l, behavior: s });
1744
+ this.scrollToIndex(t, { align: l, behavior: i });
1716
1745
  }));
1717
1746
  }, this.scrollBy = (t, { behavior: n } = {}) => {
1718
1747
  this.cancelScrollToIndex(), n === "smooth" && this.isDynamicMode() && console.warn(
@@ -1724,68 +1753,74 @@ class rn {
1724
1753
  }, this.getTotalSize = () => {
1725
1754
  var t;
1726
1755
  const n = this.getMeasurements();
1727
- let s;
1728
- return n.length === 0 ? s = this.options.paddingStart : s = this.options.lanes === 1 ? ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0 : Math.max(
1729
- ...n.slice(-this.options.lanes).map((i) => i.end)
1756
+ let i;
1757
+ return n.length === 0 ? i = this.options.paddingStart : i = this.options.lanes === 1 ? ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0 : Math.max(
1758
+ ...n.slice(-this.options.lanes).map((s) => s.end)
1730
1759
  ), Math.max(
1731
- s - this.options.scrollMargin + this.options.paddingEnd,
1760
+ i - this.options.scrollMargin + this.options.paddingEnd,
1732
1761
  0
1733
1762
  );
1734
1763
  }, this._scrollToOffset = (t, {
1735
1764
  adjustments: n,
1736
- behavior: s
1765
+ behavior: i
1737
1766
  }) => {
1738
- this.options.scrollToFn(t, { behavior: s, adjustments: n }, this);
1767
+ this.options.scrollToFn(t, { behavior: i, adjustments: n }, this);
1739
1768
  }, this.measure = () => {
1740
1769
  this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
1741
1770
  }, this.setOptions(o);
1742
1771
  }
1743
1772
  }
1744
- const et = (e, o, t, n) => {
1773
+ const nt = (e, o, t, n) => {
1745
1774
  for (; e <= o; ) {
1746
- const s = (e + o) / 2 | 0, i = t(s);
1747
- if (i < n)
1748
- e = s + 1;
1749
- else if (i > n)
1750
- o = s - 1;
1775
+ const i = (e + o) / 2 | 0, s = t(i);
1776
+ if (s < n)
1777
+ e = i + 1;
1778
+ else if (s > n)
1779
+ o = i - 1;
1751
1780
  else
1752
- return s;
1781
+ return i;
1753
1782
  }
1754
1783
  return e > 0 ? e - 1 : 0;
1755
1784
  };
1756
- function ln({
1785
+ function cn({
1757
1786
  measurements: e,
1758
1787
  outerSize: o,
1759
- scrollOffset: t
1788
+ scrollOffset: t,
1789
+ lanes: n
1760
1790
  }) {
1761
- const n = e.length - 1, i = et(0, n, (l) => e[l].start, t);
1762
- let r = i;
1763
- for (; r < n && e[r].end < t + o; )
1764
- r++;
1765
- return { startIndex: i, endIndex: r };
1791
+ const i = e.length - 1;
1792
+ let r = nt(
1793
+ 0,
1794
+ i,
1795
+ (a) => e[a].start,
1796
+ t
1797
+ ), l = r;
1798
+ for (; l < i && e[l].end < t + o; )
1799
+ l++;
1800
+ return n > 1 && (r = Math.max(0, r - r % n), l = Math.min(i, l + (n - 1 - l % n))), { startIndex: r, endIndex: l };
1766
1801
  }
1767
1802
  const Pe = typeof document < "u" ? C.useLayoutEffect : C.useEffect;
1768
- function cn(e) {
1803
+ function an(e) {
1769
1804
  const o = C.useReducer(() => ({}), {})[1], t = {
1770
1805
  ...e,
1771
- onChange: (s, i) => {
1806
+ onChange: (i, s) => {
1772
1807
  var r;
1773
- i ? it(o) : o(), (r = e.onChange) == null || r.call(e, s, i);
1808
+ s ? lt(o) : o(), (r = e.onChange) == null || r.call(e, i, s);
1774
1809
  }
1775
1810
  }, [n] = C.useState(
1776
- () => new rn(t)
1811
+ () => new ln(t)
1777
1812
  );
1778
1813
  return n.setOptions(t), Pe(() => n._didMount(), []), Pe(() => n._willUpdate()), n;
1779
1814
  }
1780
- function an(e) {
1781
- return cn({
1782
- observeElementRect: en,
1783
- observeElementOffset: nn,
1784
- scrollToFn: sn,
1815
+ function un(e) {
1816
+ return an({
1817
+ observeElementRect: nn,
1818
+ observeElementOffset: on,
1819
+ scrollToFn: rn,
1785
1820
  ...e
1786
1821
  });
1787
1822
  }
1788
- function un(e) {
1823
+ function fn(e) {
1789
1824
  return /* @__PURE__ */ b(
1790
1825
  "svg",
1791
1826
  {
@@ -1800,7 +1835,7 @@ function un(e) {
1800
1835
  }
1801
1836
  );
1802
1837
  }
1803
- function fn(e) {
1838
+ function dn(e) {
1804
1839
  return /* @__PURE__ */ b(
1805
1840
  "svg",
1806
1841
  {
@@ -1822,7 +1857,7 @@ function fn(e) {
1822
1857
  }
1823
1858
  );
1824
1859
  }
1825
- function dn(e) {
1860
+ function hn(e) {
1826
1861
  return /* @__PURE__ */ b(
1827
1862
  "svg",
1828
1863
  {
@@ -1837,45 +1872,45 @@ function dn(e) {
1837
1872
  }
1838
1873
  );
1839
1874
  }
1840
- function xn(e) {
1875
+ function wn(e) {
1841
1876
  var g;
1842
1877
  const {
1843
1878
  items: o,
1844
1879
  selected: t,
1845
1880
  className: n,
1846
- onChange: s,
1847
- disabled: i,
1881
+ onChange: i,
1882
+ disabled: s,
1848
1883
  placeholder: r = "Select an Item",
1849
1884
  multiple: l,
1850
- mutable: c,
1851
- onAdd: a
1852
- } = e, u = Ee(null), [d, m] = de(!1), f = Ee(null);
1885
+ mutable: a,
1886
+ onAdd: c
1887
+ } = e, u = Ee(null), [d, h] = de(!1), f = Ee(null);
1853
1888
  return /* @__PURE__ */ b(
1854
- Qe,
1889
+ tt,
1855
1890
  {
1856
1891
  placement: "bottom",
1857
1892
  trigger: "click",
1858
1893
  show: d,
1859
- setShow: m,
1894
+ setShow: h,
1860
1895
  role: "combobox",
1861
- disabled: i,
1896
+ disabled: s,
1862
1897
  style: {
1863
1898
  "--input-width": `${(g = f.current) == null ? void 0 : g.offsetWidth}px`
1864
1899
  },
1865
1900
  content: /* @__PURE__ */ b(
1866
- hn,
1901
+ mn,
1867
1902
  {
1868
- ...c ? { mutable: c, onAdd: a } : { mutable: c },
1869
- ...l ? { multiple: l, items: o, onChange: s, selected: t } : { items: o, onChange: s, selected: t }
1903
+ ...a ? { mutable: a, onAdd: c } : { mutable: a },
1904
+ ...l ? { multiple: l, items: o, onChange: i, selected: t } : { items: o, onChange: i, selected: t }
1870
1905
  }
1871
1906
  ),
1872
1907
  children: /* @__PURE__ */ W(
1873
1908
  "div",
1874
1909
  {
1875
- className: k(
1910
+ className: M(
1876
1911
  "inline-flex h-10 w-56 grow items-center justify-between rounded border-2 border-input bg-background p-2 transition",
1877
- i ? "cursor-not-allowed bg-muted text-muted" : "cursor-pointer",
1878
- d && "border-primary shadow-sm shadow-ring",
1912
+ s ? "cursor-not-allowed bg-muted text-muted" : "cursor-pointer",
1913
+ d && "border-primary shadow-xs shadow-ring",
1879
1914
  n
1880
1915
  ),
1881
1916
  ref: f,
@@ -1883,37 +1918,37 @@ function xn(e) {
1883
1918
  /* @__PURE__ */ b(
1884
1919
  "div",
1885
1920
  {
1886
- className: k(
1921
+ className: M(
1887
1922
  "flex max-w-[calc(100%-30px)] flex-none grow items-center gap-1 text-sm",
1888
- i ? "text-muted-foreground" : "text-foreground"
1923
+ s ? "text-muted-foreground" : "text-foreground"
1889
1924
  ),
1890
1925
  ref: u,
1891
1926
  children: l ? /* @__PURE__ */ b(
1892
- Xt,
1927
+ Gt,
1893
1928
  {
1894
1929
  items: t.map((x) => x.text),
1895
1930
  data: t,
1896
1931
  parentRef: u,
1897
1932
  estimator: (x, w) => w + 40,
1898
1933
  badgeVariant: "secondary",
1899
- badgeStyles: "!bg-input h-6 min-w-min gap-2 !bg-input",
1900
- children: (x, w, h) => /* @__PURE__ */ W(
1901
- We,
1934
+ badgeStyles: "bg-input! h-6 min-w-min gap-2 bg-input!",
1935
+ children: (x, w, m) => /* @__PURE__ */ W(
1936
+ Be,
1902
1937
  {
1903
- className: "flex h-6 min-w-min gap-2 !bg-input pr-1",
1938
+ className: "flex h-6 min-w-min gap-2 bg-input! pr-1",
1904
1939
  variant: "secondary",
1905
1940
  children: [
1906
1941
  x,
1907
1942
  /* @__PURE__ */ b(
1908
- lt,
1943
+ at,
1909
1944
  {
1910
1945
  onClick: () => {
1911
- s(t.filter((p) => p.key !== (h == null ? void 0 : h.key)));
1946
+ i(t.filter((p) => p.key !== (m == null ? void 0 : m.key)));
1912
1947
  },
1913
1948
  variant: "icon",
1914
1949
  size: "icon",
1915
1950
  className: "group bg-muted p-0.5 hover:bg-muted-foreground",
1916
- children: /* @__PURE__ */ b(dn, { className: "size-3 transition duration-300 group-hover:rotate-90 group-hover:text-muted" })
1951
+ children: /* @__PURE__ */ b(hn, { className: "size-3 transition duration-300 group-hover:rotate-90 group-hover:text-muted" })
1917
1952
  }
1918
1953
  )
1919
1954
  ]
@@ -1925,12 +1960,12 @@ function xn(e) {
1925
1960
  }
1926
1961
  ),
1927
1962
  /* @__PURE__ */ b(
1928
- un,
1963
+ fn,
1929
1964
  {
1930
- className: k(
1965
+ className: M(
1931
1966
  "size-4 rounded-full bg-input p-0.5 transition duration-300 ease-in-out",
1932
1967
  d ? "rotate-180" : "rotate-0",
1933
- i ? "text-muted-foreground" : "text-foreground"
1968
+ s ? "text-muted-foreground" : "text-foreground"
1934
1969
  )
1935
1970
  }
1936
1971
  )
@@ -1940,33 +1975,33 @@ function xn(e) {
1940
1975
  }
1941
1976
  );
1942
1977
  }
1943
- function hn(e) {
1944
- const { items: o, multiple: t, selected: n, onChange: s, mutable: i, onAdd: r } = e, [l, c] = de(""), a = Ee(null), u = ve(
1978
+ function mn(e) {
1979
+ const { items: o, multiple: t, selected: n, onChange: i, mutable: s, onAdd: r } = e, [l, a] = de(""), c = Ee(null), u = ve(
1945
1980
  () => o.reduce((f, g) => ((!l.length || g.text.toLowerCase().includes(l.toLowerCase())) && f.push(g), f), []),
1946
1981
  [o, l]
1947
- ), d = an({
1982
+ ), d = un({
1948
1983
  count: u.length,
1949
- getScrollElement: () => a.current,
1984
+ getScrollElement: () => c.current,
1950
1985
  estimateSize: () => 35
1951
- }), m = n instanceof Array ? n.map((f) => f.key) : [n.key];
1986
+ }), h = n instanceof Array ? n.map((f) => f.key) : [n.key];
1952
1987
  return /* @__PURE__ */ W("div", { className: "flex min-w-[var(--input-width)] flex-col divide-y-2 divide-border overflow-hidden rounded border border-input bg-background", children: [
1953
- /* @__PURE__ */ W("div", { className: k("inline-flex grow items-center rounded px-3 py-2"), children: [
1954
- /* @__PURE__ */ b(fn, { className: "left-3 top-3 mr-2 size-4 text-muted-foreground" }),
1988
+ /* @__PURE__ */ W("div", { className: M("inline-flex grow items-center rounded px-3 py-2"), children: [
1989
+ /* @__PURE__ */ b(dn, { className: "left-3 top-3 mr-2 size-4 text-muted-foreground" }),
1955
1990
  /* @__PURE__ */ b(
1956
1991
  "input",
1957
1992
  {
1958
- className: "inline-flex grow bg-transparent text-sm text-foreground outline-none",
1993
+ className: "inline-flex grow bg-transparent text-sm text-foreground outline-hidden",
1959
1994
  placeholder: "Search",
1960
1995
  value: l,
1961
- onChange: (f) => c(f.target.value)
1996
+ onChange: (f) => a(f.target.value)
1962
1997
  }
1963
1998
  )
1964
1999
  ] }),
1965
2000
  /* @__PURE__ */ W(
1966
2001
  "ul",
1967
2002
  {
1968
- className: k("max-h-60 grow overflow-auto shadow", "focus:outline-none focus:ring-0"),
1969
- ref: a,
2003
+ className: M("max-h-60 grow overflow-auto shadow-sm", "focus:outline-hidden focus:ring-0"),
2004
+ ref: c,
1970
2005
  children: [
1971
2006
  /* @__PURE__ */ b(
1972
2007
  "div",
@@ -1983,18 +2018,18 @@ function hn(e) {
1983
2018
  height: `${f.size}px`,
1984
2019
  transform: `translateY(${f.start}px)`
1985
2020
  },
1986
- className: k(
2021
+ className: M(
1987
2022
  "absolute left-0 top-0 w-full cursor-pointer px-3 py-2 text-sm text-foreground",
1988
- m.includes(u[f.index].key) ? "bg-primary/90 text-primary-foreground" : "transition hover:bg-primary/60"
2023
+ h.includes(u[f.index].key) ? "bg-primary/90 text-primary-foreground" : "transition hover:bg-primary/60"
1989
2024
  ),
1990
2025
  onClick: () => {
1991
- t ? m.includes(u[f.index].key) ? s(
2026
+ t ? h.includes(u[f.index].key) ? i(
1992
2027
  structuredClone(
1993
2028
  n.filter(
1994
2029
  (g) => g.key !== u[f.index].key
1995
2030
  )
1996
2031
  )
1997
- ) : s(structuredClone([...n, u[f.index]])) : s(u[f.index]);
2032
+ ) : i(structuredClone([...n, u[f.index]])) : i(u[f.index]);
1998
2033
  },
1999
2034
  children: u[f.index].text
2000
2035
  },
@@ -2002,25 +2037,25 @@ function hn(e) {
2002
2037
  ))
2003
2038
  }
2004
2039
  ),
2005
- l.length > 0 && u.length === 0 && (i ? /* @__PURE__ */ W(
2040
+ l.length > 0 && u.length === 0 && (s ? /* @__PURE__ */ W(
2006
2041
  "li",
2007
2042
  {
2008
- className: k("px-3 py-2 text-sm text-foreground"),
2043
+ className: M("px-3 py-2 text-sm text-foreground"),
2009
2044
  onClick: () => {
2010
- r({ text: l, key: l }), c("");
2045
+ r({ text: l, key: l }), a("");
2011
2046
  },
2012
2047
  children: [
2013
2048
  "Add ",
2014
2049
  l
2015
2050
  ]
2016
2051
  }
2017
- ) : /* @__PURE__ */ b("li", { className: k("cursor-not-allowed px-3 py-2 text-sm text-foreground"), children: "No results found" }))
2052
+ ) : /* @__PURE__ */ b("li", { className: M("cursor-not-allowed px-3 py-2 text-sm text-foreground"), children: "No results found" }))
2018
2053
  ]
2019
2054
  }
2020
2055
  )
2021
2056
  ] });
2022
2057
  }
2023
- function wn(e) {
2058
+ function yn(e) {
2024
2059
  return /* @__PURE__ */ b(
2025
2060
  "svg",
2026
2061
  {
@@ -2035,15 +2070,15 @@ function wn(e) {
2035
2070
  }
2036
2071
  );
2037
2072
  }
2038
- function yn(e) {
2073
+ function bn(e) {
2039
2074
  const { className: o, ...t } = e;
2040
2075
  return /* @__PURE__ */ b(
2041
2076
  "input",
2042
2077
  {
2043
- className: k(
2078
+ className: M(
2044
2079
  "h-10 w-full rounded border-2 border-input bg-background px-3 py-2 text-sm text-foreground transition",
2045
- "focus-visible:border-primary focus-visible:shadow-sm focus-visible:shadow-ring focus-visible:outline-none",
2046
- "read-only:cursor-pointer read-only:!border-none read-only:bg-transparent read-only:text-foreground read-only:!shadow-none read-only:!outline-none",
2080
+ "focus-visible:border-primary focus-visible:shadow-xs focus-visible:shadow-ring focus-visible:outline-hidden",
2081
+ "read-only:cursor-pointer read-only:border-none! read-only:bg-transparent read-only:text-foreground read-only:shadow-none! read-only:outline-hidden!",
2047
2082
  "disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted",
2048
2083
  "file:border-0 file:bg-transparent file:text-sm file:font-medium",
2049
2084
  o
@@ -2052,12 +2087,12 @@ function yn(e) {
2052
2087
  }
2053
2088
  );
2054
2089
  }
2055
- function bn(e) {
2056
- const { className: o, checked: t, onChange: n, defaultChecked: s, ...i } = e;
2090
+ function vn(e) {
2091
+ const { className: o, checked: t, onChange: n, defaultChecked: i, ...s } = e;
2057
2092
  return /* @__PURE__ */ W(
2058
2093
  "div",
2059
2094
  {
2060
- className: k(
2095
+ className: M(
2061
2096
  "rounded-full",
2062
2097
  "h-5 w-10",
2063
2098
  "border border-muted bg-secondary",
@@ -2066,11 +2101,11 @@ function bn(e) {
2066
2101
  ),
2067
2102
  onClick: () => n == null ? void 0 : n(!t),
2068
2103
  children: [
2069
- /* @__PURE__ */ b("input", { type: "hidden", readOnly: !0, ...i, defaultChecked: s, checked: t }),
2104
+ /* @__PURE__ */ b("input", { type: "hidden", readOnly: !0, ...s, defaultChecked: i, checked: t }),
2070
2105
  /* @__PURE__ */ b(
2071
2106
  "div",
2072
2107
  {
2073
- className: k(
2108
+ className: M(
2074
2109
  "[animation-timing-function:cubic-bezier(1, 0, 0, 1)] duration-250 h-4 w-4 rounded-full bg-primary transition-all",
2075
2110
  t ? "translate-x-5" : "translate-x-1"
2076
2111
  )
@@ -2081,16 +2116,16 @@ function bn(e) {
2081
2116
  );
2082
2117
  }
2083
2118
  export {
2084
- We as Badge,
2085
- lt as Button,
2086
- wn as ChevronDown,
2087
- un as ChevronUp,
2088
- Xt as Collapse,
2089
- xn as Dropdown,
2090
- yn as Input,
2091
- Qe as Popover,
2092
- fn as Search,
2093
- bn as Toggle,
2094
- Ve as cva,
2095
- k as cx
2119
+ Be as Badge,
2120
+ at as Button,
2121
+ yn as ChevronDown,
2122
+ fn as ChevronUp,
2123
+ Gt as Collapse,
2124
+ wn as Dropdown,
2125
+ bn as Input,
2126
+ tt as Popover,
2127
+ dn as Search,
2128
+ vn as Toggle,
2129
+ We as cva,
2130
+ M as cx
2096
2131
  };