@rinzai/zen 0.1.9 → 0.1.11

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