mimir-ui-kit 1.36.14 → 1.36.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,34 +1,34 @@
1
- import { n as U, u as wt, d as Te, s as Pe, o as M, p as Zt, t as An, e as Le, W as me, y as Oe, T as $n, H as pe, M as At, a as Re, $ as en, b as tn, D as yt, I as Dn, c as Z } from "./keyboard-mgWkd2Vh.js";
2
- import * as w from "react";
3
- import j, { useReducer as nn, useMemo as X, useSyncExternalStore as Fn, useId as Be, useEffect as oe, useCallback as Ne, useRef as J, useLayoutEffect as on, createContext as he, useContext as le, useState as ce, Fragment as tt, createRef as Ln } from "react";
4
- import * as Xe from "react-dom";
5
- import { flushSync as xe, createPortal as _n } from "react-dom";
6
- import { w as Nn } from "./use-active-press-CqLGIFz7.js";
7
- import { u as kn } from "./use-by-comparator-CVuf9KBq.js";
8
- import { K as zn, a as Hn, b as Vn, T as Bn, z as Wn, j as jn, u as Un, I as Et, G as Yn } from "./label-D4GFpe5F.js";
9
- import { A as qn, h as Kn, f as Gn, _ as Xn } from "./focus-management-DOYCPyGg.js";
10
- import { e as Jn } from "./use-resolve-button-type-DhFdPxnv.js";
11
- import { c as Qn, i as Je, u as Zn, x as eo, R as to } from "./open-closed-D2VjDhAN.js";
12
- import { r as no } from "./bugs-diTMAGNw.js";
13
- function Se(e, t, n) {
1
+ import { n as B, u as gt, d as Te, s as Me, o as I, p as Xt, t as Mn, e as Le, W as pe, y as Se, T as Pn, H as he, M as Tt, a as Re, $ as Jt, b as Qt, D as vt, I as An, c as Q } from "./keyboard-B0lm_zyn.js";
2
+ import * as y from "react";
3
+ import W, { useReducer as Zt, useMemo as q, useSyncExternalStore as $n, useId as We, useEffect as oe, useCallback as ke, useRef as K, useLayoutEffect as en, createContext as ge, useContext as le, useState as ae, Fragment as tt, createRef as Dn } from "react";
4
+ import * as Ne from "react-dom";
5
+ import { flushSync as we, createPortal as Fn } from "react-dom";
6
+ import { w as Ln } from "./use-active-press-86hajhdd.js";
7
+ import { u as _n } from "./use-by-comparator-CVuf9KBq.js";
8
+ import { K as kn, a as Nn, b as zn, T as Hn, z as Vn, j as Wn, u as Bn, I as bt, G as jn } from "./label-y3ANLTNC.js";
9
+ import { A as Un, h as Yn, f as qn, _ as Kn } from "./focus-management-XwV-9qkO.js";
10
+ import { e as Gn } from "./use-resolve-button-type-DhFdPxnv.js";
11
+ import { c as Xn, i as Xe, u as Jn, R as Qn, H as Zn } from "./open-closed-CdldUPoq.js";
12
+ import { r as eo } from "./bugs-diTMAGNw.js";
13
+ function De(e, t, n) {
14
14
  let o = n.initialDeps ?? [], i;
15
15
  return () => {
16
16
  var r, s, l, a;
17
- let u;
18
- n.key && ((r = n.debug) != null && r.call(n)) && (u = Date.now());
19
- const c = e();
20
- if (!(c.length !== o.length || c.some((f, m) => o[m] !== f)))
17
+ let c;
18
+ n.key && ((r = n.debug) != null && r.call(n)) && (c = Date.now());
19
+ const f = e();
20
+ if (!(f.length !== o.length || f.some((u, m) => o[m] !== u)))
21
21
  return i;
22
- o = c;
22
+ o = f;
23
23
  let p;
24
- if (n.key && ((s = n.debug) != null && s.call(n)) && (p = Date.now()), i = t(...c), n.key && ((l = n.debug) != null && l.call(n))) {
25
- const f = Math.round((Date.now() - u) * 100) / 100, m = Math.round((Date.now() - p) * 100) / 100, h = m / 16, g = (v, y) => {
26
- for (v = String(v); v.length < y; )
24
+ if (n.key && ((s = n.debug) != null && s.call(n)) && (p = Date.now()), i = t(...f), n.key && ((l = n.debug) != null && l.call(n))) {
25
+ const u = Math.round((Date.now() - c) * 100) / 100, m = Math.round((Date.now() - p) * 100) / 100, h = m / 16, g = (v, E) => {
26
+ for (v = String(v); v.length < E; )
27
27
  v = " " + v;
28
28
  return v;
29
29
  };
30
30
  console.info(
31
- `%c⏱ ${g(m, 5)} /${g(f, 5)} ms`,
31
+ `%c⏱ ${g(m, 5)} /${g(u, 5)} ms`,
32
32
  `
33
33
  font-size: .6rem;
34
34
  font-weight: bold;
@@ -42,22 +42,22 @@ function Se(e, t, n) {
42
42
  return (a = n == null ? void 0 : n.onChange) == null || a.call(n, i), i;
43
43
  };
44
44
  }
45
- function st(e, t) {
45
+ function lt(e, t) {
46
46
  if (e === void 0)
47
47
  throw new Error("Unexpected undefined");
48
48
  return e;
49
49
  }
50
- const oo = (e, t) => Math.abs(e - t) < 1, io = (e, t, n) => {
50
+ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
51
51
  let o;
52
52
  return function(...i) {
53
53
  e.clearTimeout(o), o = e.setTimeout(() => t.apply(this, i), n);
54
54
  };
55
- }, ro = (e) => e, lo = (e) => {
55
+ }, oo = (e) => e, io = (e) => {
56
56
  const t = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1), o = [];
57
57
  for (let i = t; i <= n; i++)
58
58
  o.push(i);
59
59
  return o;
60
- }, so = (e, t) => {
60
+ }, ro = (e, t) => {
61
61
  const n = e.scrollElement;
62
62
  if (!n)
63
63
  return;
@@ -85,9 +85,9 @@ const oo = (e, t) => Math.abs(e - t) < 1, io = (e, t, n) => {
85
85
  return r.observe(n, { box: "border-box" }), () => {
86
86
  r.unobserve(n);
87
87
  };
88
- }, $t = {
88
+ }, It = {
89
89
  passive: !0
90
- }, ao = typeof window > "u" ? !0 : "onscrollend" in window, co = (e, t) => {
90
+ }, lo = typeof window > "u" ? !0 : "onscrollend" in window, so = (e, t) => {
91
91
  const n = e.scrollElement;
92
92
  if (!n)
93
93
  return;
@@ -95,21 +95,20 @@ const oo = (e, t) => Math.abs(e - t) < 1, io = (e, t, n) => {
95
95
  if (!o)
96
96
  return;
97
97
  let i = 0;
98
- const r = ao ? () => {
99
- } : io(
98
+ const r = lo ? () => {
99
+ } : no(
100
100
  o,
101
101
  () => {
102
102
  t(i, !1);
103
103
  },
104
104
  e.options.isScrollingResetDelay
105
- ), s = (u) => () => {
106
- const { horizontal: c, isRtl: d } = e.options;
107
- i = c ? n.scrollLeft * (d && -1 || 1) : n.scrollTop, r(), t(i, u);
105
+ ), s = (c) => () => {
106
+ i = n[e.options.horizontal ? "scrollLeft" : "scrollTop"], r(), t(i, c);
108
107
  }, l = s(!0), a = s(!1);
109
- return a(), n.addEventListener("scroll", l, $t), n.addEventListener("scrollend", a, $t), () => {
108
+ return a(), n.addEventListener("scroll", l, It), n.addEventListener("scrollend", a, It), () => {
110
109
  n.removeEventListener("scroll", l), n.removeEventListener("scrollend", a);
111
110
  };
112
- }, uo = (e, t, n) => {
111
+ }, ao = (e, t, n) => {
113
112
  if (t != null && t.borderBoxSize) {
114
113
  const o = t.borderBoxSize[0];
115
114
  if (o)
@@ -120,7 +119,7 @@ const oo = (e, t) => Math.abs(e - t) < 1, io = (e, t, n) => {
120
119
  return Math.round(
121
120
  e.getBoundingClientRect()[n.options.horizontal ? "width" : "height"]
122
121
  );
123
- }, fo = (e, {
122
+ }, co = (e, {
124
123
  adjustments: t = 0,
125
124
  behavior: n
126
125
  }, o) => {
@@ -131,7 +130,7 @@ const oo = (e, t) => Math.abs(e - t) < 1, io = (e, t, n) => {
131
130
  behavior: n
132
131
  });
133
132
  };
134
- class mo {
133
+ class uo {
135
134
  constructor(t) {
136
135
  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__ */ (() => {
137
136
  let n = null;
@@ -143,7 +142,7 @@ class mo {
143
142
  return {
144
143
  disconnect: () => {
145
144
  var i;
146
- (i = o()) == null || i.disconnect(), n = null;
145
+ return (i = o()) == null ? void 0 : i.disconnect();
147
146
  },
148
147
  observe: (i) => {
149
148
  var r;
@@ -166,11 +165,11 @@ class mo {
166
165
  scrollPaddingStart: 0,
167
166
  scrollPaddingEnd: 0,
168
167
  horizontal: !1,
169
- getItemKey: ro,
170
- rangeExtractor: lo,
168
+ getItemKey: oo,
169
+ rangeExtractor: io,
171
170
  onChange: () => {
172
171
  },
173
- measureElement: uo,
172
+ measureElement: ao,
174
173
  initialRect: { width: 0, height: 0 },
175
174
  scrollMargin: 0,
176
175
  gap: 0,
@@ -179,32 +178,17 @@ class mo {
179
178
  lanes: 1,
180
179
  isScrollingResetDelay: 150,
181
180
  enabled: !0,
182
- isRtl: !1,
183
181
  ...n
184
182
  };
185
- }, this.notify = (n) => {
186
- var o, i;
187
- (i = (o = this.options).onChange) == null || i.call(o, this, n);
188
- }, this.maybeNotify = Se(
189
- () => (this.calculateRange(), [
190
- this.isScrolling,
191
- this.range ? this.range.startIndex : null,
192
- this.range ? this.range.endIndex : null
193
- ]),
194
- (n) => {
195
- this.notify(n);
196
- },
197
- {
198
- key: process.env.NODE_ENV !== "production" && "maybeNotify",
199
- debug: () => this.options.debug,
200
- initialDeps: [
201
- this.isScrolling,
202
- this.range ? this.range.startIndex : null,
203
- this.range ? this.range.endIndex : null
204
- ]
205
- }
206
- ), this.cleanup = () => {
207
- this.unsubs.filter(Boolean).forEach((n) => n()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
183
+ }, this.notify = (n, o) => {
184
+ var i, r;
185
+ const { startIndex: s, endIndex: l } = this.range ?? {
186
+ startIndex: void 0,
187
+ endIndex: void 0
188
+ }, a = this.calculateRange();
189
+ (n || s !== (a == null ? void 0 : a.startIndex) || l !== (a == null ? void 0 : a.endIndex)) && ((r = (i = this.options).onChange) == null || r.call(i, this, o));
190
+ }, this.cleanup = () => {
191
+ this.unsubs.filter(Boolean).forEach((n) => n()), this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.observer.disconnect(), this.elementsCache.clear();
208
192
  }, this._didMount = () => () => {
209
193
  this.cleanup();
210
194
  }, this._willUpdate = () => {
@@ -212,21 +196,21 @@ class mo {
212
196
  const o = this.options.enabled ? this.options.getScrollElement() : null;
213
197
  if (this.scrollElement !== o) {
214
198
  if (this.cleanup(), !o) {
215
- this.maybeNotify();
199
+ this.notify(!1, !1);
216
200
  return;
217
201
  }
218
- this.scrollElement = o, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this.elementsCache.forEach((i) => {
219
- this.observer.observe(i);
220
- }), this._scrollToOffset(this.getScrollOffset(), {
202
+ this.scrollElement = o, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this._scrollToOffset(this.getScrollOffset(), {
221
203
  adjustments: void 0,
222
204
  behavior: void 0
223
205
  }), this.unsubs.push(
224
206
  this.options.observeElementRect(this, (i) => {
225
- this.scrollRect = i, this.maybeNotify();
207
+ this.scrollRect = i, this.notify(!1, !1);
226
208
  })
227
209
  ), this.unsubs.push(
228
210
  this.options.observeElementOffset(this, (i, r) => {
229
- this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = r, this.maybeNotify();
211
+ this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i;
212
+ const s = this.isScrolling;
213
+ this.isScrolling = r, this.notify(s !== r, r);
230
214
  })
231
215
  );
232
216
  }
@@ -243,7 +227,7 @@ class mo {
243
227
  break;
244
228
  }
245
229
  return r.size === this.options.lanes ? Array.from(r.values()).sort((s, l) => s.end === l.end ? s.index - l.index : s.end - l.end)[0] : void 0;
246
- }, this.getMeasurementOptions = Se(
230
+ }, this.getMeasurementOptions = De(
247
231
  () => [
248
232
  this.options.count,
249
233
  this.options.paddingStart,
@@ -261,37 +245,51 @@ class mo {
261
245
  {
262
246
  key: !1
263
247
  }
264
- ), this.getMeasurements = Se(
248
+ ), this.getMeasurements = De(
265
249
  () => [this.getMeasurementOptions(), this.itemSizeCache],
266
250
  ({ count: n, paddingStart: o, scrollMargin: i, getItemKey: r, enabled: s }, l) => {
251
+ var a;
267
252
  if (!s)
268
253
  return this.measurementsCache = [], this.itemSizeCache.clear(), [];
269
- this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
270
- this.itemSizeCache.set(c.key, c.size);
254
+ this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((d) => {
255
+ this.itemSizeCache.set(d.key, d.size);
271
256
  }));
272
- const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
257
+ const c = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
273
258
  this.pendingMeasuredCacheIndexes = [];
274
- const u = this.measurementsCache.slice(0, a);
275
- for (let c = a; c < n; c++) {
276
- const d = r(c), p = this.options.lanes === 1 ? u[c - 1] : this.getFurthestMeasurement(u, c), f = p ? p.end + this.options.gap : o + i, m = l.get(d), h = typeof m == "number" ? m : this.options.estimateSize(c), g = f + h, v = p ? p.lane : c % this.options.lanes;
277
- u[c] = {
278
- index: c,
279
- start: f,
280
- size: h,
281
- end: g,
282
- key: d,
283
- lane: v
259
+ const f = this.measurementsCache.slice(0, c);
260
+ for (let d = c; d < n; d++) {
261
+ let p = (a = this.measurementsCache[d]) == null ? void 0 : a.measureElement;
262
+ p || (p = (x) => {
263
+ const O = r(d), S = this.elementsCache.get(O);
264
+ if (!x) {
265
+ S && (this.observer.unobserve(S), this.elementsCache.delete(O));
266
+ return;
267
+ }
268
+ S !== x && (S && this.observer.unobserve(S), this.observer.observe(x), this.elementsCache.set(O, x)), x.isConnected && this.resizeItem(
269
+ d,
270
+ this.options.measureElement(x, void 0, this)
271
+ );
272
+ });
273
+ const u = r(d), m = this.options.lanes === 1 ? f[d - 1] : this.getFurthestMeasurement(f, d), h = m ? m.end + this.options.gap : o + i, g = l.get(u), v = typeof g == "number" ? g : this.options.estimateSize(d), E = h + v, b = m ? m.lane : d % this.options.lanes;
274
+ f[d] = {
275
+ index: d,
276
+ start: h,
277
+ size: v,
278
+ end: E,
279
+ key: u,
280
+ lane: b,
281
+ measureElement: p
284
282
  };
285
283
  }
286
- return this.measurementsCache = u, u;
284
+ return this.measurementsCache = f, f;
287
285
  },
288
286
  {
289
287
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
290
288
  debug: () => this.options.debug
291
289
  }
292
- ), this.calculateRange = Se(
290
+ ), this.calculateRange = De(
293
291
  () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
294
- (n, o, i) => this.range = n.length > 0 && o > 0 ? po({
292
+ (n, o, i) => this.range = n.length > 0 && o > 0 ? fo({
295
293
  measurements: n,
296
294
  outerSize: o,
297
295
  scrollOffset: i
@@ -300,7 +298,7 @@ class mo {
300
298
  key: process.env.NODE_ENV !== "production" && "calculateRange",
301
299
  debug: () => this.options.debug
302
300
  }
303
- ), this.getIndexes = Se(
301
+ ), this.getIndexes = De(
304
302
  () => [
305
303
  this.options.rangeExtractor,
306
304
  this.calculateRange(),
@@ -323,29 +321,27 @@ class mo {
323
321
  `Missing attribute name '${o}={index}' on measured element.`
324
322
  ), -1);
325
323
  }, this._measureElement = (n, o) => {
326
- const i = this.indexFromElement(n), r = this.measurementsCache[i];
327
- if (!r)
324
+ const i = this.indexFromElement(n), r = this.getMeasurements()[i];
325
+ if (!r || !n.isConnected) {
326
+ this.elementsCache.forEach((l, a) => {
327
+ l === n && (this.observer.unobserve(n), this.elementsCache.delete(a));
328
+ });
328
329
  return;
329
- const s = r.key, l = this.elementsCache.get(s);
330
- l !== n && (l && this.observer.unobserve(l), this.observer.observe(n), this.elementsCache.set(s, n)), n.isConnected && this.resizeItem(i, this.options.measureElement(n, o, this));
330
+ }
331
+ const s = this.elementsCache.get(r.key);
332
+ s !== n && (s && this.observer.unobserve(s), this.observer.observe(n), this.elementsCache.set(r.key, n)), this.resizeItem(i, this.options.measureElement(n, o, this));
331
333
  }, this.resizeItem = (n, o) => {
332
- const i = this.measurementsCache[n];
334
+ const i = this.getMeasurements()[n];
333
335
  if (!i)
334
336
  return;
335
337
  const r = this.itemSizeCache.get(i.key) ?? i.size, s = o - r;
336
338
  s !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(i, s, this) : i.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", s), this._scrollToOffset(this.getScrollOffset(), {
337
339
  adjustments: this.scrollAdjustments += s,
338
340
  behavior: void 0
339
- })), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, o)), this.notify(!1));
341
+ })), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, o)), this.notify(!0, !1));
340
342
  }, this.measureElement = (n) => {
341
- if (!n) {
342
- this.elementsCache.forEach((o, i) => {
343
- o.isConnected || (this.observer.unobserve(o), this.elementsCache.delete(i));
344
- });
345
- return;
346
- }
347
- this._measureElement(n, void 0);
348
- }, this.getVirtualItems = Se(
343
+ n && this._measureElement(n, void 0);
344
+ }, this.getVirtualItems = De(
349
345
  () => [this.getIndexes(), this.getMeasurements()],
350
346
  (n, o) => {
351
347
  const i = [];
@@ -356,17 +352,17 @@ class mo {
356
352
  return i;
357
353
  },
358
354
  {
359
- key: process.env.NODE_ENV !== "production" && "getVirtualItems",
355
+ key: process.env.NODE_ENV !== "production" && "getIndexes",
360
356
  debug: () => this.options.debug
361
357
  }
362
358
  ), this.getVirtualItemForOffset = (n) => {
363
359
  const o = this.getMeasurements();
364
360
  if (o.length !== 0)
365
- return st(
366
- o[rn(
361
+ return lt(
362
+ o[tn(
367
363
  0,
368
364
  o.length - 1,
369
- (i) => st(o[i]).start,
365
+ (i) => lt(o[i]).start,
370
366
  n
371
367
  )]
372
368
  );
@@ -377,7 +373,7 @@ class mo {
377
373
  return Math.max(Math.min(a, n), 0);
378
374
  }, this.getOffsetForIndex = (n, o = "auto") => {
379
375
  n = Math.max(0, Math.min(n, this.options.count - 1));
380
- const i = this.measurementsCache[n];
376
+ const i = this.getMeasurements()[n];
381
377
  if (!i)
382
378
  return;
383
379
  const r = this.getSize(), s = this.getScrollOffset();
@@ -410,10 +406,10 @@ class mo {
410
406
  if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
411
407
  this.options.getItemKey(n)
412
408
  )) {
413
- const [u] = st(
409
+ const [c] = lt(
414
410
  this.getOffsetForIndex(n, l)
415
411
  );
416
- oo(u, this.getScrollOffset()) || this.scrollToIndex(n, { align: l, behavior: i });
412
+ to(c, this.getScrollOffset()) || this.scrollToIndex(n, { align: l, behavior: i });
417
413
  } else
418
414
  this.scrollToIndex(n, { align: l, behavior: i });
419
415
  }));
@@ -430,21 +426,19 @@ class mo {
430
426
  let i;
431
427
  return o.length === 0 ? i = this.options.paddingStart : i = this.options.lanes === 1 ? ((n = o[o.length - 1]) == null ? void 0 : n.end) ?? 0 : Math.max(
432
428
  ...o.slice(-this.options.lanes).map((r) => r.end)
433
- ), Math.max(
434
- i - this.options.scrollMargin + this.options.paddingEnd,
435
- 0
436
- );
429
+ ), i - this.options.scrollMargin + this.options.paddingEnd;
437
430
  }, this._scrollToOffset = (n, {
438
431
  adjustments: o,
439
432
  behavior: i
440
433
  }) => {
441
434
  this.options.scrollToFn(n, { behavior: i, adjustments: o }, this);
442
435
  }, this.measure = () => {
443
- this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
436
+ var n, o;
437
+ this.itemSizeCache = /* @__PURE__ */ new Map(), (o = (n = this.options).onChange) == null || o.call(n, this, !1);
444
438
  }, this.setOptions(t);
445
439
  }
446
440
  }
447
- const rn = (e, t, n, o) => {
441
+ const tn = (e, t, n, o) => {
448
442
  for (; e <= t; ) {
449
443
  const i = (e + t) / 2 | 0, r = n(i);
450
444
  if (r < o)
@@ -456,46 +450,46 @@ const rn = (e, t, n, o) => {
456
450
  }
457
451
  return e > 0 ? e - 1 : 0;
458
452
  };
459
- function po({
453
+ function fo({
460
454
  measurements: e,
461
455
  outerSize: t,
462
456
  scrollOffset: n
463
457
  }) {
464
- const o = e.length - 1, r = rn(0, o, (l) => e[l].start, n);
458
+ const o = e.length - 1, r = tn(0, o, (l) => e[l].start, n);
465
459
  let s = r;
466
460
  for (; s < o && e[s].end < n + t; )
467
461
  s++;
468
462
  return { startIndex: r, endIndex: s };
469
463
  }
470
- const ho = typeof document < "u" ? w.useLayoutEffect : w.useEffect;
471
- function go(e) {
472
- const t = w.useReducer(() => ({}), {})[1], n = {
464
+ const mo = typeof document < "u" ? y.useLayoutEffect : y.useEffect;
465
+ function po(e) {
466
+ const t = y.useReducer(() => ({}), {})[1], n = {
473
467
  ...e,
474
468
  onChange: (i, r) => {
475
469
  var s;
476
- r ? xe(t) : t(), (s = e.onChange) == null || s.call(e, i, r);
470
+ r ? we(t) : t(), (s = e.onChange) == null || s.call(e, i, r);
477
471
  }
478
- }, [o] = w.useState(
479
- () => new mo(n)
472
+ }, [o] = y.useState(
473
+ () => new uo(n)
480
474
  );
481
- return o.setOptions(n), w.useEffect(() => o._didMount(), []), ho(() => o._willUpdate()), o;
475
+ return o.setOptions(n), y.useEffect(() => o._didMount(), []), mo(() => o._willUpdate()), o;
482
476
  }
483
- function vo(e) {
484
- return go({
485
- observeElementRect: so,
486
- observeElementOffset: co,
487
- scrollToFn: fo,
477
+ function ho(e) {
478
+ return po({
479
+ observeElementRect: ro,
480
+ observeElementOffset: so,
481
+ scrollToFn: co,
488
482
  ...e
489
483
  });
490
484
  }
491
- function bo(e) {
485
+ function go(e) {
492
486
  if (e === null) return { width: 0, height: 0 };
493
487
  let { width: t, height: n } = e.getBoundingClientRect();
494
488
  return { width: t, height: n };
495
489
  }
496
- function Dt(e, t = !1) {
497
- let [n, o] = nn(() => ({}), {}), i = X(() => bo(e), [e, n]);
498
- return U(() => {
490
+ function Mt(e, t = !1) {
491
+ let [n, o] = Zt(() => ({}), {}), i = q(() => go(e), [e, n]);
492
+ return B(() => {
499
493
  if (!e) return;
500
494
  let r = new ResizeObserver(o);
501
495
  return r.observe(e), () => {
@@ -503,7 +497,7 @@ function Dt(e, t = !1) {
503
497
  };
504
498
  }, [e]), t ? { width: `${i.width}px`, height: `${i.height}px` } : i;
505
499
  }
506
- let xo = class extends Map {
500
+ let vo = class extends Map {
507
501
  constructor(t) {
508
502
  super(), this.factory = t;
509
503
  }
@@ -512,7 +506,7 @@ let xo = class extends Map {
512
506
  return n === void 0 && (n = this.factory(t), this.set(t, n)), n;
513
507
  }
514
508
  };
515
- function ln(e, t) {
509
+ function nn(e, t) {
516
510
  let n = e(), o = /* @__PURE__ */ new Set();
517
511
  return { getSnapshot() {
518
512
  return n;
@@ -523,10 +517,10 @@ function ln(e, t) {
523
517
  s && (n = s, o.forEach((l) => l()));
524
518
  } };
525
519
  }
526
- function sn(e) {
527
- return Fn(e.subscribe, e.getSnapshot, e.getSnapshot);
520
+ function on(e) {
521
+ return $n(e.subscribe, e.getSnapshot, e.getSnapshot);
528
522
  }
529
- let wo = new xo(() => ln(() => [], { ADD(e) {
523
+ let bo = new vo(() => nn(() => [], { ADD(e) {
530
524
  return this.includes(e) ? this : [...this, e];
531
525
  }, REMOVE(e) {
532
526
  let t = this.indexOf(e);
@@ -534,50 +528,50 @@ let wo = new xo(() => ln(() => [], { ADD(e) {
534
528
  let n = this.slice();
535
529
  return n.splice(t, 1), n;
536
530
  } }));
537
- function Ot(e, t) {
538
- let n = wo.get(t), o = Be(), i = sn(n);
539
- if (U(() => {
531
+ function xt(e, t) {
532
+ let n = bo.get(t), o = We(), i = on(n);
533
+ if (B(() => {
540
534
  if (e) return n.dispatch("ADD", o), () => n.dispatch("REMOVE", o);
541
535
  }, [n, e]), !e) return !1;
542
536
  let r = i.indexOf(o), s = i.length;
543
537
  return r === -1 && (r = s, s += 1), r === s - 1;
544
538
  }
545
- let pt = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
546
- function Ft(e) {
539
+ let dt = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
540
+ function Pt(e) {
547
541
  var t;
548
542
  let n = (t = _e.get(e)) != null ? t : 0;
549
- return _e.set(e, n + 1), n !== 0 ? () => Lt(e) : (pt.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Lt(e));
543
+ return _e.set(e, n + 1), n !== 0 ? () => At(e) : (dt.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => At(e));
550
544
  }
551
- function Lt(e) {
545
+ function At(e) {
552
546
  var t;
553
547
  let n = (t = _e.get(e)) != null ? t : 1;
554
548
  if (n === 1 ? _e.delete(e) : _e.set(e, n - 1), n !== 1) return;
555
- let o = pt.get(e);
556
- o && (o["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", o["aria-hidden"]), e.inert = o.inert, pt.delete(e));
549
+ let o = dt.get(e);
550
+ o && (o["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", o["aria-hidden"]), e.inert = o.inert, dt.delete(e));
557
551
  }
558
- function yo(e, { allowed: t, disallowed: n } = {}) {
559
- let o = Ot(e, "inert-others");
560
- U(() => {
552
+ function xo(e, { allowed: t, disallowed: n } = {}) {
553
+ let o = xt(e, "inert-others");
554
+ B(() => {
561
555
  var i, r;
562
556
  if (!o) return;
563
557
  let s = Te();
564
- for (let a of (i = n == null ? void 0 : n()) != null ? i : []) a && s.add(Ft(a));
558
+ for (let a of (i = n == null ? void 0 : n()) != null ? i : []) a && s.add(Pt(a));
565
559
  let l = (r = t == null ? void 0 : t()) != null ? r : [];
566
560
  for (let a of l) {
567
561
  if (!a) continue;
568
- let u = wt(a);
569
- if (!u) continue;
570
- let c = a.parentElement;
571
- for (; c && c !== u.body; ) {
572
- for (let d of c.children) l.some((p) => d.contains(p)) || s.add(Ft(d));
573
- c = c.parentElement;
562
+ let c = gt(a);
563
+ if (!c) continue;
564
+ let f = a.parentElement;
565
+ for (; f && f !== c.body; ) {
566
+ for (let d of f.children) l.some((p) => d.contains(p)) || s.add(Pt(d));
567
+ f = f.parentElement;
574
568
  }
575
569
  }
576
570
  return s.dispose;
577
571
  }, [o, t, n]);
578
572
  }
579
- function Eo(e, t, n) {
580
- let o = Pe((i) => {
573
+ function wo(e, t, n) {
574
+ let o = Me((i) => {
581
575
  let r = i.getBoundingClientRect();
582
576
  r.x === 0 && r.y === 0 && r.width === 0 && r.height === 0 && n();
583
577
  });
@@ -597,17 +591,17 @@ function Eo(e, t, n) {
597
591
  return () => r.dispose();
598
592
  }, [t, o, e]);
599
593
  }
600
- function an() {
594
+ function rn() {
601
595
  return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
602
596
  }
603
- function Oo() {
597
+ function Eo() {
604
598
  return /Android/gi.test(window.navigator.userAgent);
605
599
  }
606
- function cn() {
607
- return an() || Oo();
600
+ function ln() {
601
+ return rn() || Eo();
608
602
  }
609
603
  function Fe(e, t, n, o) {
610
- let i = Pe(n);
604
+ let i = Me(n);
611
605
  oe(() => {
612
606
  if (!e) return;
613
607
  function r(s) {
@@ -616,8 +610,8 @@ function Fe(e, t, n, o) {
616
610
  return document.addEventListener(t, r, o), () => document.removeEventListener(t, r, o);
617
611
  }, [e, t, o]);
618
612
  }
619
- function So(e, t, n, o) {
620
- let i = Pe(n);
613
+ function yo(e, t, n, o) {
614
+ let i = Me(n);
621
615
  oe(() => {
622
616
  if (!e) return;
623
617
  function r(s) {
@@ -626,40 +620,40 @@ function So(e, t, n, o) {
626
620
  return window.addEventListener(t, r, o), () => window.removeEventListener(t, r, o);
627
621
  }, [e, t, o]);
628
622
  }
629
- const _t = 30;
630
- function Ro(e, t, n) {
631
- let o = Ot(e, "outside-click"), i = Pe(n), r = Ne(function(a, u) {
623
+ const $t = 30;
624
+ function Oo(e, t, n) {
625
+ let o = xt(e, "outside-click"), i = Me(n), r = ke(function(a, c) {
632
626
  if (a.defaultPrevented) return;
633
- let c = u(a);
634
- if (c === null || !c.getRootNode().contains(c) || !c.isConnected) return;
635
- let d = function p(f) {
636
- return typeof f == "function" ? p(f()) : Array.isArray(f) || f instanceof Set ? f : [f];
627
+ let f = c(a);
628
+ if (f === null || !f.getRootNode().contains(f) || !f.isConnected) return;
629
+ let d = function p(u) {
630
+ return typeof u == "function" ? p(u()) : Array.isArray(u) || u instanceof Set ? u : [u];
637
631
  }(t);
638
- for (let p of d) if (p !== null && (p.contains(c) || a.composed && a.composedPath().includes(p))) return;
639
- return !qn(c, Kn.Loose) && c.tabIndex !== -1 && a.preventDefault(), i.current(a, c);
640
- }, [i, t]), s = J(null);
632
+ for (let p of d) if (p !== null && (p.contains(f) || a.composed && a.composedPath().includes(p))) return;
633
+ return !Un(f, Yn.Loose) && f.tabIndex !== -1 && a.preventDefault(), i.current(a, f);
634
+ }, [i, t]), s = K(null);
641
635
  Fe(o, "pointerdown", (a) => {
642
- var u, c;
643
- s.current = ((c = (u = a.composedPath) == null ? void 0 : u.call(a)) == null ? void 0 : c[0]) || a.target;
636
+ var c, f;
637
+ s.current = ((f = (c = a.composedPath) == null ? void 0 : c.call(a)) == null ? void 0 : f[0]) || a.target;
644
638
  }, !0), Fe(o, "mousedown", (a) => {
645
- var u, c;
646
- s.current = ((c = (u = a.composedPath) == null ? void 0 : u.call(a)) == null ? void 0 : c[0]) || a.target;
639
+ var c, f;
640
+ s.current = ((f = (c = a.composedPath) == null ? void 0 : c.call(a)) == null ? void 0 : f[0]) || a.target;
647
641
  }, !0), Fe(o, "click", (a) => {
648
- cn() || s.current && (r(a, () => s.current), s.current = null);
642
+ ln() || s.current && (r(a, () => s.current), s.current = null);
649
643
  }, !0);
650
- let l = J({ x: 0, y: 0 });
644
+ let l = K({ x: 0, y: 0 });
651
645
  Fe(o, "touchstart", (a) => {
652
646
  l.current.x = a.touches[0].clientX, l.current.y = a.touches[0].clientY;
653
647
  }, !0), Fe(o, "touchend", (a) => {
654
- let u = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY };
655
- if (!(Math.abs(u.x - l.current.x) >= _t || Math.abs(u.y - l.current.y) >= _t)) return r(a, () => a.target instanceof HTMLElement ? a.target : null);
656
- }, !0), So(o, "blur", (a) => r(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
648
+ let c = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY };
649
+ if (!(Math.abs(c.x - l.current.x) >= $t || Math.abs(c.y - l.current.y) >= $t)) return r(a, () => a.target instanceof HTMLElement ? a.target : null);
650
+ }, !0), yo(o, "blur", (a) => r(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
657
651
  }
658
652
  function nt(...e) {
659
- return X(() => wt(...e), [...e]);
653
+ return q(() => gt(...e), [...e]);
660
654
  }
661
- function Co(e, t, n, o) {
662
- let i = Pe(n);
655
+ function So(e, t, n, o) {
656
+ let i = Me(n);
663
657
  oe(() => {
664
658
  e = e ?? window;
665
659
  function r(s) {
@@ -668,12 +662,12 @@ function Co(e, t, n, o) {
668
662
  return e.addEventListener(t, r, o), () => e.removeEventListener(t, r, o);
669
663
  }, [e, t, o]);
670
664
  }
671
- function un(e) {
672
- let t = J({ value: "", selectionStart: null, selectionEnd: null });
673
- return Co(e, "blur", (n) => {
665
+ function sn(e) {
666
+ let t = K({ value: "", selectionStart: null, selectionEnd: null });
667
+ return So(e, "blur", (n) => {
674
668
  let o = n.target;
675
669
  o instanceof HTMLInputElement && (t.current = { value: o.value, selectionStart: o.selectionStart, selectionEnd: o.selectionEnd });
676
- }), M(() => {
670
+ }), I(() => {
677
671
  if (document.activeElement !== e && e instanceof HTMLInputElement && e.isConnected) {
678
672
  if (e.focus({ preventScroll: !0 }), e.value !== t.current.value) e.setSelectionRange(e.value.length, e.value.length);
679
673
  else {
@@ -684,7 +678,7 @@ function un(e) {
684
678
  }
685
679
  });
686
680
  }
687
- function To() {
681
+ function Ro() {
688
682
  let e;
689
683
  return { before({ doc: t }) {
690
684
  var n;
@@ -695,8 +689,8 @@ function To() {
695
689
  n.style(o, "paddingRight", `${r}px`);
696
690
  } };
697
691
  }
698
- function Io() {
699
- return an() ? { before({ doc: e, d: t, meta: n }) {
692
+ function Co() {
693
+ return rn() ? { before({ doc: e, d: t, meta: n }) {
700
694
  function o(i) {
701
695
  return n.containers.flatMap((r) => r()).some((r) => r.contains(i));
702
696
  }
@@ -711,8 +705,8 @@ function Io() {
711
705
  if (l.target instanceof HTMLElement) try {
712
706
  let a = l.target.closest("a");
713
707
  if (!a) return;
714
- let { hash: u } = new URL(a.href), c = e.querySelector(u);
715
- c && !o(c) && (s = c);
708
+ let { hash: c } = new URL(a.href), f = e.querySelector(c);
709
+ f && !o(f) && (s = f);
716
710
  } catch {
717
711
  }
718
712
  }, !0), t.addEventListener(e, "touchstart", (l) => {
@@ -738,17 +732,17 @@ function Io() {
738
732
  });
739
733
  } } : {};
740
734
  }
741
- function Mo() {
735
+ function To() {
742
736
  return { before({ doc: e, d: t }) {
743
737
  t.style(e.documentElement, "overflow", "hidden");
744
738
  } };
745
739
  }
746
- function Po(e) {
740
+ function Io(e) {
747
741
  let t = {};
748
742
  for (let n of e) Object.assign(t, n(t));
749
743
  return t;
750
744
  }
751
- let we = ln(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
745
+ let Ee = nn(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
752
746
  var n;
753
747
  let o = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: Te(), meta: /* @__PURE__ */ new Set() };
754
748
  return o.count++, o.meta.add(t), this.set(e, o), this;
@@ -756,60 +750,60 @@ let we = ln(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
756
750
  let n = this.get(e);
757
751
  return n && (n.count--, n.meta.delete(t)), this;
758
752
  }, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
759
- let o = { doc: e, d: t, meta: Po(n) }, i = [Io(), To(), Mo()];
753
+ let o = { doc: e, d: t, meta: Io(n) }, i = [Co(), Ro(), To()];
760
754
  i.forEach(({ before: r }) => r == null ? void 0 : r(o)), i.forEach(({ after: r }) => r == null ? void 0 : r(o));
761
755
  }, SCROLL_ALLOW({ d: e }) {
762
756
  e.dispose();
763
757
  }, TEARDOWN({ doc: e }) {
764
758
  this.delete(e);
765
759
  } });
766
- we.subscribe(() => {
767
- let e = we.getSnapshot(), t = /* @__PURE__ */ new Map();
760
+ Ee.subscribe(() => {
761
+ let e = Ee.getSnapshot(), t = /* @__PURE__ */ new Map();
768
762
  for (let [n] of e) t.set(n, n.documentElement.style.overflow);
769
763
  for (let n of e.values()) {
770
764
  let o = t.get(n.doc) === "hidden", i = n.count !== 0;
771
- (i && !o || !i && o) && we.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && we.dispatch("TEARDOWN", n);
765
+ (i && !o || !i && o) && Ee.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && Ee.dispatch("TEARDOWN", n);
772
766
  }
773
767
  });
774
- function Ao(e, t, n = () => ({ containers: [] })) {
775
- let o = sn(we), i = t ? o.get(t) : void 0, r = i ? i.count > 0 : !1;
776
- return U(() => {
777
- if (!(!t || !e)) return we.dispatch("PUSH", t, n), () => we.dispatch("POP", t, n);
768
+ function Mo(e, t, n = () => ({ containers: [] })) {
769
+ let o = on(Ee), i = t ? o.get(t) : void 0, r = i ? i.count > 0 : !1;
770
+ return B(() => {
771
+ if (!(!t || !e)) return Ee.dispatch("PUSH", t, n), () => Ee.dispatch("POP", t, n);
778
772
  }, [e, t]), r;
779
773
  }
780
- function $o(e, t, n = () => [document.body]) {
781
- let o = Ot(e, "scroll-lock");
782
- Ao(o, t, (i) => {
774
+ function Po(e, t, n = () => [document.body]) {
775
+ let o = xt(e, "scroll-lock");
776
+ Mo(o, t, (i) => {
783
777
  var r;
784
778
  return { containers: [...(r = i.containers) != null ? r : [], n] };
785
779
  });
786
780
  }
787
- function Nt(e) {
781
+ function Dt(e) {
788
782
  return [e.screenX, e.screenY];
789
783
  }
790
- function Do() {
791
- let e = J([-1, -1]);
784
+ function Ao() {
785
+ let e = K([-1, -1]);
792
786
  return { wasMoved(t) {
793
- let n = Nt(t);
787
+ let n = Dt(t);
794
788
  return e.current[0] === n[0] && e.current[1] === n[1] ? !1 : (e.current = n, !0);
795
789
  }, update(t) {
796
- e.current = Nt(t);
790
+ e.current = Dt(t);
797
791
  } };
798
792
  }
799
- function Fo(e, { container: t, accept: n, walk: o }) {
800
- let i = J(n), r = J(o);
793
+ function $o(e, { container: t, accept: n, walk: o }) {
794
+ let i = K(n), r = K(o);
801
795
  oe(() => {
802
796
  i.current = n, r.current = o;
803
- }, [n, o]), U(() => {
797
+ }, [n, o]), B(() => {
804
798
  if (!t || !e) return;
805
- let s = wt(t);
799
+ let s = gt(t);
806
800
  if (!s) return;
807
- let l = i.current, a = r.current, u = Object.assign((d) => l(d), { acceptNode: l }), c = s.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, u, !1);
808
- for (; c.nextNode(); ) a(c.currentNode);
801
+ let l = i.current, a = r.current, c = Object.assign((d) => l(d), { acceptNode: l }), f = s.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, c, !1);
802
+ for (; f.nextNode(); ) a(f.currentNode);
809
803
  }, [t, e, i, r]);
810
804
  }
811
- function kt(e, t) {
812
- let n = J([]), o = M(e);
805
+ function Ft(e, t) {
806
+ let n = K([]), o = I(e);
813
807
  oe(() => {
814
808
  let i = [...n.current];
815
809
  for (let [r, s] of t.entries()) if (n.current[r] !== s) {
@@ -818,33 +812,30 @@ function kt(e, t) {
818
812
  }
819
813
  }, [o, ...t]);
820
814
  }
821
- function ot() {
822
- return typeof window < "u";
823
- }
824
- function Ae(e) {
825
- return fn(e) ? (e.nodeName || "").toLowerCase() : "#document";
815
+ function Pe(e) {
816
+ return an(e) ? (e.nodeName || "").toLowerCase() : "#document";
826
817
  }
827
818
  function ee(e) {
828
819
  var t;
829
820
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
830
821
  }
831
- function ae(e) {
822
+ function ce(e) {
832
823
  var t;
833
- return (t = (fn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
824
+ return (t = (an(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
834
825
  }
835
- function fn(e) {
836
- return ot() ? e instanceof Node || e instanceof ee(e).Node : !1;
826
+ function an(e) {
827
+ return e instanceof Node || e instanceof ee(e).Node;
837
828
  }
838
- function G(e) {
839
- return ot() ? e instanceof Element || e instanceof ee(e).Element : !1;
829
+ function X(e) {
830
+ return e instanceof Element || e instanceof ee(e).Element;
840
831
  }
841
832
  function se(e) {
842
- return ot() ? e instanceof HTMLElement || e instanceof ee(e).HTMLElement : !1;
833
+ return e instanceof HTMLElement || e instanceof ee(e).HTMLElement;
843
834
  }
844
- function zt(e) {
845
- return !ot() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
835
+ function Lt(e) {
836
+ return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
846
837
  }
847
- function We(e) {
838
+ function Be(e) {
848
839
  const {
849
840
  overflow: t,
850
841
  overflowX: n,
@@ -853,10 +844,10 @@ function We(e) {
853
844
  } = ie(e);
854
845
  return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(i);
855
846
  }
856
- function Lo(e) {
857
- return ["table", "td", "th"].includes(Ae(e));
847
+ function Do(e) {
848
+ return ["table", "td", "th"].includes(Pe(e));
858
849
  }
859
- function it(e) {
850
+ function ot(e) {
860
851
  return [":popover-open", ":modal"].some((t) => {
861
852
  try {
862
853
  return e.matches(t);
@@ -865,32 +856,32 @@ function it(e) {
865
856
  }
866
857
  });
867
858
  }
868
- function St(e) {
869
- const t = Rt(), n = G(e) ? ie(e) : e;
859
+ function wt(e) {
860
+ const t = Et(), n = ie(e);
870
861
  return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
871
862
  }
872
- function _o(e) {
873
- let t = ue(e);
863
+ function Fo(e) {
864
+ let t = fe(e);
874
865
  for (; se(t) && !Ie(t); ) {
875
- if (St(t))
876
- return t;
877
- if (it(t))
866
+ if (ot(t))
878
867
  return null;
879
- t = ue(t);
868
+ if (wt(t))
869
+ return t;
870
+ t = fe(t);
880
871
  }
881
872
  return null;
882
873
  }
883
- function Rt() {
874
+ function Et() {
884
875
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
885
876
  }
886
877
  function Ie(e) {
887
- return ["html", "body", "#document"].includes(Ae(e));
878
+ return ["html", "body", "#document"].includes(Pe(e));
888
879
  }
889
880
  function ie(e) {
890
881
  return ee(e).getComputedStyle(e);
891
882
  }
892
- function rt(e) {
893
- return G(e) ? {
883
+ function it(e) {
884
+ return X(e) ? {
894
885
  scrollLeft: e.scrollLeft,
895
886
  scrollTop: e.scrollTop
896
887
  } : {
@@ -898,36 +889,29 @@ function rt(e) {
898
889
  scrollTop: e.scrollY
899
890
  };
900
891
  }
901
- function ue(e) {
902
- if (Ae(e) === "html")
892
+ function fe(e) {
893
+ if (Pe(e) === "html")
903
894
  return e;
904
895
  const t = (
905
896
  // Step into the shadow DOM of the parent of a slotted node.
906
897
  e.assignedSlot || // DOM Element detected.
907
898
  e.parentNode || // ShadowRoot detected.
908
- zt(e) && e.host || // Fallback.
909
- ae(e)
899
+ Lt(e) && e.host || // Fallback.
900
+ ce(e)
910
901
  );
911
- return zt(t) ? t.host : t;
902
+ return Lt(t) ? t.host : t;
912
903
  }
913
- function dn(e) {
914
- const t = ue(e);
915
- return Ie(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : se(t) && We(t) ? t : dn(t);
904
+ function cn(e) {
905
+ const t = fe(e);
906
+ return Ie(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : se(t) && Be(t) ? t : cn(t);
916
907
  }
917
- function ke(e, t, n) {
908
+ function ze(e, t, n) {
918
909
  var o;
919
910
  t === void 0 && (t = []), n === void 0 && (n = !0);
920
- const i = dn(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), s = ee(i);
921
- if (r) {
922
- const l = ht(s);
923
- return t.concat(s, s.visualViewport || [], We(i) ? i : [], l && n ? ke(l) : []);
924
- }
925
- return t.concat(i, ke(i, [], n));
911
+ const i = cn(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), s = ee(i);
912
+ return r ? t.concat(s, s.visualViewport || [], Be(i) ? i : [], s.frameElement && n ? ze(s.frameElement) : []) : t.concat(i, ze(i, [], n));
926
913
  }
927
- function ht(e) {
928
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
929
- }
930
- function No() {
914
+ function Lo() {
931
915
  const e = navigator.userAgentData;
932
916
  return e && Array.isArray(e.brands) ? e.brands.map((t) => {
933
917
  let {
@@ -937,56 +921,56 @@ function No() {
937
921
  return n + "/" + o;
938
922
  }).join(" ") : navigator.userAgent;
939
923
  }
940
- const Me = Math.min, K = Math.max, ze = Math.round, Ke = Math.floor, fe = (e) => ({
924
+ const ue = Math.min, Z = Math.max, Je = Math.round, Ke = Math.floor, de = (e) => ({
941
925
  x: e,
942
926
  y: e
943
- }), ko = {
927
+ }), _o = {
944
928
  left: "right",
945
929
  right: "left",
946
930
  bottom: "top",
947
931
  top: "bottom"
948
- }, zo = {
932
+ }, ko = {
949
933
  start: "end",
950
934
  end: "start"
951
935
  };
952
- function Ht(e, t, n) {
953
- return K(e, Me(t, n));
936
+ function _t(e, t, n) {
937
+ return Z(e, ue(t, n));
954
938
  }
955
- function $e(e, t) {
939
+ function Ae(e, t) {
956
940
  return typeof e == "function" ? e(t) : e;
957
941
  }
958
- function de(e) {
942
+ function me(e) {
959
943
  return e.split("-")[0];
960
944
  }
961
945
  function je(e) {
962
946
  return e.split("-")[1];
963
947
  }
964
- function mn(e) {
948
+ function un(e) {
965
949
  return e === "x" ? "y" : "x";
966
950
  }
967
- function pn(e) {
951
+ function fn(e) {
968
952
  return e === "y" ? "height" : "width";
969
953
  }
970
954
  function ye(e) {
971
- return ["top", "bottom"].includes(de(e)) ? "y" : "x";
955
+ return ["top", "bottom"].includes(me(e)) ? "y" : "x";
972
956
  }
973
- function hn(e) {
974
- return mn(ye(e));
957
+ function dn(e) {
958
+ return un(ye(e));
975
959
  }
976
- function Ho(e, t, n) {
960
+ function No(e, t, n) {
977
961
  n === void 0 && (n = !1);
978
- const o = je(e), i = hn(e), r = pn(i);
962
+ const o = je(e), i = dn(e), r = fn(i);
979
963
  let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
980
964
  return t.reference[r] > t.floating[r] && (s = Qe(s)), [s, Qe(s)];
981
965
  }
982
- function Vo(e) {
966
+ function zo(e) {
983
967
  const t = Qe(e);
984
- return [gt(e), t, gt(t)];
968
+ return [mt(e), t, mt(t)];
985
969
  }
986
- function gt(e) {
987
- return e.replace(/start|end/g, (t) => zo[t]);
970
+ function mt(e) {
971
+ return e.replace(/start|end/g, (t) => ko[t]);
988
972
  }
989
- function Bo(e, t, n) {
973
+ function Ho(e, t, n) {
990
974
  const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
991
975
  switch (e) {
992
976
  case "top":
@@ -999,15 +983,15 @@ function Bo(e, t, n) {
999
983
  return [];
1000
984
  }
1001
985
  }
1002
- function Wo(e, t, n, o) {
986
+ function Vo(e, t, n, o) {
1003
987
  const i = je(e);
1004
- let r = Bo(de(e), n === "start", o);
1005
- return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(gt)))), r;
988
+ let r = Ho(me(e), n === "start", o);
989
+ return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(mt)))), r;
1006
990
  }
1007
991
  function Qe(e) {
1008
- return e.replace(/left|right|bottom|top/g, (t) => ko[t]);
992
+ return e.replace(/left|right|bottom|top/g, (t) => _o[t]);
1009
993
  }
1010
- function jo(e) {
994
+ function Wo(e) {
1011
995
  return {
1012
996
  top: 0,
1013
997
  right: 0,
@@ -1016,8 +1000,8 @@ function jo(e) {
1016
1000
  ...e
1017
1001
  };
1018
1002
  }
1019
- function Uo(e) {
1020
- return typeof e != "number" ? jo(e) : {
1003
+ function Bo(e) {
1004
+ return typeof e != "number" ? Wo(e) : {
1021
1005
  top: e,
1022
1006
  right: e,
1023
1007
  bottom: e,
@@ -1042,116 +1026,116 @@ function Ze(e) {
1042
1026
  y: n
1043
1027
  };
1044
1028
  }
1045
- function Vt(e, t, n) {
1029
+ function kt(e, t, n) {
1046
1030
  let {
1047
1031
  reference: o,
1048
1032
  floating: i
1049
1033
  } = e;
1050
- const r = ye(t), s = hn(t), l = pn(s), a = de(t), u = r === "y", c = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
1051
- let f;
1034
+ const r = ye(t), s = dn(t), l = fn(s), a = me(t), c = r === "y", f = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
1035
+ let u;
1052
1036
  switch (a) {
1053
1037
  case "top":
1054
- f = {
1055
- x: c,
1038
+ u = {
1039
+ x: f,
1056
1040
  y: o.y - i.height
1057
1041
  };
1058
1042
  break;
1059
1043
  case "bottom":
1060
- f = {
1061
- x: c,
1044
+ u = {
1045
+ x: f,
1062
1046
  y: o.y + o.height
1063
1047
  };
1064
1048
  break;
1065
1049
  case "right":
1066
- f = {
1050
+ u = {
1067
1051
  x: o.x + o.width,
1068
1052
  y: d
1069
1053
  };
1070
1054
  break;
1071
1055
  case "left":
1072
- f = {
1056
+ u = {
1073
1057
  x: o.x - i.width,
1074
1058
  y: d
1075
1059
  };
1076
1060
  break;
1077
1061
  default:
1078
- f = {
1062
+ u = {
1079
1063
  x: o.x,
1080
1064
  y: o.y
1081
1065
  };
1082
1066
  }
1083
1067
  switch (je(t)) {
1084
1068
  case "start":
1085
- f[s] -= p * (n && u ? -1 : 1);
1069
+ u[s] -= p * (n && c ? -1 : 1);
1086
1070
  break;
1087
1071
  case "end":
1088
- f[s] += p * (n && u ? -1 : 1);
1072
+ u[s] += p * (n && c ? -1 : 1);
1089
1073
  break;
1090
1074
  }
1091
- return f;
1075
+ return u;
1092
1076
  }
1093
- const Yo = async (e, t, n) => {
1077
+ const jo = async (e, t, n) => {
1094
1078
  const {
1095
1079
  placement: o = "bottom",
1096
1080
  strategy: i = "absolute",
1097
1081
  middleware: r = [],
1098
1082
  platform: s
1099
1083
  } = n, l = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
1100
- let u = await s.getElementRects({
1084
+ let c = await s.getElementRects({
1101
1085
  reference: e,
1102
1086
  floating: t,
1103
1087
  strategy: i
1104
1088
  }), {
1105
- x: c,
1089
+ x: f,
1106
1090
  y: d
1107
- } = Vt(u, o, a), p = o, f = {}, m = 0;
1091
+ } = kt(c, o, a), p = o, u = {}, m = 0;
1108
1092
  for (let h = 0; h < l.length; h++) {
1109
1093
  const {
1110
1094
  name: g,
1111
1095
  fn: v
1112
1096
  } = l[h], {
1113
- x: y,
1097
+ x: E,
1114
1098
  y: b,
1115
- data: E,
1099
+ data: x,
1116
1100
  reset: O
1117
1101
  } = await v({
1118
- x: c,
1102
+ x: f,
1119
1103
  y: d,
1120
1104
  initialPlacement: o,
1121
1105
  placement: p,
1122
1106
  strategy: i,
1123
- middlewareData: f,
1124
- rects: u,
1107
+ middlewareData: u,
1108
+ rects: c,
1125
1109
  platform: s,
1126
1110
  elements: {
1127
1111
  reference: e,
1128
1112
  floating: t
1129
1113
  }
1130
1114
  });
1131
- c = y ?? c, d = b ?? d, f = {
1132
- ...f,
1115
+ f = E ?? f, d = b ?? d, u = {
1116
+ ...u,
1133
1117
  [g]: {
1134
- ...f[g],
1135
- ...E
1118
+ ...u[g],
1119
+ ...x
1136
1120
  }
1137
- }, O && m <= 50 && (m++, typeof O == "object" && (O.placement && (p = O.placement), O.rects && (u = O.rects === !0 ? await s.getElementRects({
1121
+ }, O && m <= 50 && (m++, typeof O == "object" && (O.placement && (p = O.placement), O.rects && (c = O.rects === !0 ? await s.getElementRects({
1138
1122
  reference: e,
1139
1123
  floating: t,
1140
1124
  strategy: i
1141
1125
  }) : O.rects), {
1142
- x: c,
1126
+ x: f,
1143
1127
  y: d
1144
- } = Vt(u, p, a)), h = -1);
1128
+ } = kt(c, p, a)), h = -1);
1145
1129
  }
1146
1130
  return {
1147
- x: c,
1131
+ x: f,
1148
1132
  y: d,
1149
1133
  placement: p,
1150
1134
  strategy: i,
1151
- middlewareData: f
1135
+ middlewareData: u
1152
1136
  };
1153
1137
  };
1154
- async function lt(e, t) {
1138
+ async function rt(e, t) {
1155
1139
  var n;
1156
1140
  t === void 0 && (t = {});
1157
1141
  const {
@@ -1162,22 +1146,22 @@ async function lt(e, t) {
1162
1146
  elements: l,
1163
1147
  strategy: a
1164
1148
  } = e, {
1165
- boundary: u = "clippingAncestors",
1166
- rootBoundary: c = "viewport",
1149
+ boundary: c = "clippingAncestors",
1150
+ rootBoundary: f = "viewport",
1167
1151
  elementContext: d = "floating",
1168
1152
  altBoundary: p = !1,
1169
- padding: f = 0
1170
- } = $e(t, e), m = Uo(f), g = l[p ? d === "floating" ? "reference" : "floating" : d], v = Ze(await r.getClippingRect({
1153
+ padding: u = 0
1154
+ } = Ae(t, e), m = Bo(u), g = l[p ? d === "floating" ? "reference" : "floating" : d], v = Ze(await r.getClippingRect({
1171
1155
  element: (n = await (r.isElement == null ? void 0 : r.isElement(g))) == null || n ? g : g.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
1172
- boundary: u,
1173
- rootBoundary: c,
1156
+ boundary: c,
1157
+ rootBoundary: f,
1174
1158
  strategy: a
1175
- })), y = d === "floating" ? {
1159
+ })), E = d === "floating" ? {
1176
1160
  x: o,
1177
1161
  y: i,
1178
1162
  width: s.floating.width,
1179
1163
  height: s.floating.height
1180
- } : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), E = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
1164
+ } : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), x = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
1181
1165
  x: 1,
1182
1166
  y: 1
1183
1167
  } : {
@@ -1185,18 +1169,18 @@ async function lt(e, t) {
1185
1169
  y: 1
1186
1170
  }, O = Ze(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
1187
1171
  elements: l,
1188
- rect: y,
1172
+ rect: E,
1189
1173
  offsetParent: b,
1190
1174
  strategy: a
1191
- }) : y);
1175
+ }) : E);
1192
1176
  return {
1193
- top: (v.top - O.top + m.top) / E.y,
1194
- bottom: (O.bottom - v.bottom + m.bottom) / E.y,
1195
- left: (v.left - O.left + m.left) / E.x,
1196
- right: (O.right - v.right + m.right) / E.x
1177
+ top: (v.top - O.top + m.top) / x.y,
1178
+ bottom: (O.bottom - v.bottom + m.bottom) / x.y,
1179
+ left: (v.left - O.left + m.left) / x.x,
1180
+ right: (O.right - v.right + m.right) / x.x
1197
1181
  };
1198
1182
  }
1199
- const qo = function(e) {
1183
+ const Uo = function(e) {
1200
1184
  return e === void 0 && (e = {}), {
1201
1185
  name: "flip",
1202
1186
  options: e,
@@ -1208,67 +1192,67 @@ const qo = function(e) {
1208
1192
  rects: s,
1209
1193
  initialPlacement: l,
1210
1194
  platform: a,
1211
- elements: u
1195
+ elements: c
1212
1196
  } = t, {
1213
- mainAxis: c = !0,
1197
+ mainAxis: f = !0,
1214
1198
  crossAxis: d = !0,
1215
1199
  fallbackPlacements: p,
1216
- fallbackStrategy: f = "bestFit",
1200
+ fallbackStrategy: u = "bestFit",
1217
1201
  fallbackAxisSideDirection: m = "none",
1218
1202
  flipAlignment: h = !0,
1219
1203
  ...g
1220
- } = $e(e, t);
1204
+ } = Ae(e, t);
1221
1205
  if ((n = r.arrow) != null && n.alignmentOffset)
1222
1206
  return {};
1223
- const v = de(i), y = ye(l), b = de(l) === l, E = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), O = p || (b || !h ? [Qe(l)] : Vo(l)), C = m !== "none";
1224
- !p && C && O.push(...Wo(l, h, m, E));
1225
- const T = [l, ...O], S = await lt(t, g), L = [];
1226
- let A = ((o = r.flip) == null ? void 0 : o.overflows) || [];
1227
- if (c && L.push(S[v]), d) {
1228
- const x = Ho(i, s, E);
1229
- L.push(S[x[0]], S[x[1]]);
1207
+ const v = me(i), E = ye(l), b = me(l) === l, x = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), O = p || (b || !h ? [Qe(l)] : zo(l)), S = m !== "none";
1208
+ !p && S && O.push(...Vo(l, h, m, x));
1209
+ const M = [l, ...O], C = await rt(t, g), N = [];
1210
+ let $ = ((o = r.flip) == null ? void 0 : o.overflows) || [];
1211
+ if (f && N.push(C[v]), d) {
1212
+ const w = No(i, s, x);
1213
+ N.push(C[w[0]], C[w[1]]);
1230
1214
  }
1231
- if (A = [...A, {
1215
+ if ($ = [...$, {
1232
1216
  placement: i,
1233
- overflows: L
1234
- }], !L.every((x) => x <= 0)) {
1217
+ overflows: N
1218
+ }], !N.every((w) => w <= 0)) {
1235
1219
  var D, k;
1236
- const x = (((D = r.flip) == null ? void 0 : D.index) || 0) + 1, B = T[x];
1237
- if (B)
1220
+ const w = (((D = r.flip) == null ? void 0 : D.index) || 0) + 1, F = M[w];
1221
+ if (F)
1238
1222
  return {
1239
1223
  data: {
1240
- index: x,
1241
- overflows: A
1224
+ index: w,
1225
+ overflows: $
1242
1226
  },
1243
1227
  reset: {
1244
- placement: B
1228
+ placement: F
1245
1229
  }
1246
1230
  };
1247
- let _ = (k = A.filter((z) => z.overflows[0] <= 0).sort((z, P) => z.overflows[1] - P.overflows[1])[0]) == null ? void 0 : k.placement;
1248
- if (!_)
1249
- switch (f) {
1231
+ let j = (k = $.filter((P) => P.overflows[0] <= 0).sort((P, L) => P.overflows[1] - L.overflows[1])[0]) == null ? void 0 : k.placement;
1232
+ if (!j)
1233
+ switch (u) {
1250
1234
  case "bestFit": {
1251
- var F;
1252
- const z = (F = A.filter((P) => {
1253
- if (C) {
1254
- const $ = ye(P.placement);
1255
- return $ === y || // Create a bias to the `y` side axis due to horizontal
1235
+ var z;
1236
+ const P = (z = $.filter((L) => {
1237
+ if (S) {
1238
+ const A = ye(L.placement);
1239
+ return A === E || // Create a bias to the `y` side axis due to horizontal
1256
1240
  // reading directions favoring greater width.
1257
- $ === "y";
1241
+ A === "y";
1258
1242
  }
1259
1243
  return !0;
1260
- }).map((P) => [P.placement, P.overflows.filter(($) => $ > 0).reduce(($, H) => $ + H, 0)]).sort((P, $) => P[1] - $[1])[0]) == null ? void 0 : F[0];
1261
- z && (_ = z);
1244
+ }).map((L) => [L.placement, L.overflows.filter((A) => A > 0).reduce((A, J) => A + J, 0)]).sort((L, A) => L[1] - A[1])[0]) == null ? void 0 : z[0];
1245
+ P && (j = P);
1262
1246
  break;
1263
1247
  }
1264
1248
  case "initialPlacement":
1265
- _ = l;
1249
+ j = l;
1266
1250
  break;
1267
1251
  }
1268
- if (i !== _)
1252
+ if (i !== j)
1269
1253
  return {
1270
1254
  reset: {
1271
- placement: _
1255
+ placement: j
1272
1256
  }
1273
1257
  };
1274
1258
  }
@@ -1276,34 +1260,35 @@ const qo = function(e) {
1276
1260
  }
1277
1261
  };
1278
1262
  };
1279
- async function Ko(e, t) {
1263
+ async function Yo(e, t) {
1280
1264
  const {
1281
1265
  placement: n,
1282
1266
  platform: o,
1283
1267
  elements: i
1284
- } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = de(n), l = je(n), a = ye(n) === "y", u = ["left", "top"].includes(s) ? -1 : 1, c = r && a ? -1 : 1, d = $e(t, e);
1268
+ } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = me(n), l = je(n), a = ye(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, f = r && a ? -1 : 1, d = Ae(t, e);
1285
1269
  let {
1286
1270
  mainAxis: p,
1287
- crossAxis: f,
1271
+ crossAxis: u,
1288
1272
  alignmentAxis: m
1289
1273
  } = typeof d == "number" ? {
1290
1274
  mainAxis: d,
1291
1275
  crossAxis: 0,
1292
1276
  alignmentAxis: null
1293
1277
  } : {
1294
- mainAxis: d.mainAxis || 0,
1295
- crossAxis: d.crossAxis || 0,
1296
- alignmentAxis: d.alignmentAxis
1278
+ mainAxis: 0,
1279
+ crossAxis: 0,
1280
+ alignmentAxis: null,
1281
+ ...d
1297
1282
  };
1298
- return l && typeof m == "number" && (f = l === "end" ? m * -1 : m), a ? {
1299
- x: f * c,
1300
- y: p * u
1283
+ return l && typeof m == "number" && (u = l === "end" ? m * -1 : m), a ? {
1284
+ x: u * f,
1285
+ y: p * c
1301
1286
  } : {
1302
- x: p * u,
1303
- y: f * c
1287
+ x: p * c,
1288
+ y: u * f
1304
1289
  };
1305
1290
  }
1306
- const Go = function(e) {
1291
+ const qo = function(e) {
1307
1292
  return e === void 0 && (e = 0), {
1308
1293
  name: "offset",
1309
1294
  options: e,
@@ -1314,7 +1299,7 @@ const Go = function(e) {
1314
1299
  y: r,
1315
1300
  placement: s,
1316
1301
  middlewareData: l
1317
- } = t, a = await Ko(t, e);
1302
+ } = t, a = await Yo(t, e);
1318
1303
  return s === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
1319
1304
  x: i + a.x,
1320
1305
  y: r + a.y,
@@ -1325,7 +1310,7 @@ const Go = function(e) {
1325
1310
  };
1326
1311
  }
1327
1312
  };
1328
- }, Xo = function(e) {
1313
+ }, Ko = function(e) {
1329
1314
  return e === void 0 && (e = {}), {
1330
1315
  name: "shift",
1331
1316
  options: e,
@@ -1341,80 +1326,75 @@ const Go = function(e) {
1341
1326
  fn: (g) => {
1342
1327
  let {
1343
1328
  x: v,
1344
- y
1329
+ y: E
1345
1330
  } = g;
1346
1331
  return {
1347
1332
  x: v,
1348
- y
1333
+ y: E
1349
1334
  };
1350
1335
  }
1351
1336
  },
1352
1337
  ...a
1353
- } = $e(e, t), u = {
1338
+ } = Ae(e, t), c = {
1354
1339
  x: n,
1355
1340
  y: o
1356
- }, c = await lt(t, a), d = ye(de(i)), p = mn(d);
1357
- let f = u[p], m = u[d];
1341
+ }, f = await rt(t, a), d = ye(me(i)), p = un(d);
1342
+ let u = c[p], m = c[d];
1358
1343
  if (r) {
1359
- const g = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", y = f + c[g], b = f - c[v];
1360
- f = Ht(y, f, b);
1344
+ const g = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", E = u + f[g], b = u - f[v];
1345
+ u = _t(E, u, b);
1361
1346
  }
1362
1347
  if (s) {
1363
- const g = d === "y" ? "top" : "left", v = d === "y" ? "bottom" : "right", y = m + c[g], b = m - c[v];
1364
- m = Ht(y, m, b);
1348
+ const g = d === "y" ? "top" : "left", v = d === "y" ? "bottom" : "right", E = m + f[g], b = m - f[v];
1349
+ m = _t(E, m, b);
1365
1350
  }
1366
1351
  const h = l.fn({
1367
1352
  ...t,
1368
- [p]: f,
1353
+ [p]: u,
1369
1354
  [d]: m
1370
1355
  });
1371
1356
  return {
1372
1357
  ...h,
1373
1358
  data: {
1374
1359
  x: h.x - n,
1375
- y: h.y - o,
1376
- enabled: {
1377
- [p]: r,
1378
- [d]: s
1379
- }
1360
+ y: h.y - o
1380
1361
  }
1381
1362
  };
1382
1363
  }
1383
1364
  };
1384
- }, Jo = function(e) {
1365
+ }, Go = function(e) {
1385
1366
  return e === void 0 && (e = {}), {
1386
1367
  name: "size",
1387
1368
  options: e,
1388
1369
  async fn(t) {
1389
- var n, o;
1390
1370
  const {
1391
- placement: i,
1392
- rects: r,
1393
- platform: s,
1394
- elements: l
1371
+ placement: n,
1372
+ rects: o,
1373
+ platform: i,
1374
+ elements: r
1395
1375
  } = t, {
1396
- apply: a = () => {
1376
+ apply: s = () => {
1397
1377
  },
1398
- ...u
1399
- } = $e(e, t), c = await lt(t, u), d = de(i), p = je(i), f = ye(i) === "y", {
1400
- width: m,
1401
- height: h
1402
- } = r.floating;
1403
- let g, v;
1404
- d === "top" || d === "bottom" ? (g = d, v = p === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (v = d, g = p === "end" ? "top" : "bottom");
1405
- const y = h - c.top - c.bottom, b = m - c.left - c.right, E = Me(h - c[g], y), O = Me(m - c[v], b), C = !t.middlewareData.shift;
1406
- let T = E, S = O;
1407
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (S = b), (o = t.middlewareData.shift) != null && o.enabled.y && (T = y), C && !p) {
1408
- const A = K(c.left, 0), D = K(c.right, 0), k = K(c.top, 0), F = K(c.bottom, 0);
1409
- f ? S = m - 2 * (A !== 0 || D !== 0 ? A + D : K(c.left, c.right)) : T = h - 2 * (k !== 0 || F !== 0 ? k + F : K(c.top, c.bottom));
1378
+ ...l
1379
+ } = Ae(e, t), a = await rt(t, l), c = me(n), f = je(n), d = ye(n) === "y", {
1380
+ width: p,
1381
+ height: u
1382
+ } = o.floating;
1383
+ let m, h;
1384
+ c === "top" || c === "bottom" ? (m = c, h = f === (await (i.isRTL == null ? void 0 : i.isRTL(r.floating)) ? "start" : "end") ? "left" : "right") : (h = c, m = f === "end" ? "top" : "bottom");
1385
+ const g = u - a.top - a.bottom, v = p - a.left - a.right, E = ue(u - a[m], g), b = ue(p - a[h], v), x = !t.middlewareData.shift;
1386
+ let O = E, S = b;
1387
+ if (d ? S = f || x ? ue(b, v) : v : O = f || x ? ue(E, g) : g, x && !f) {
1388
+ const C = Z(a.left, 0), N = Z(a.right, 0), $ = Z(a.top, 0), D = Z(a.bottom, 0);
1389
+ d ? S = p - 2 * (C !== 0 || N !== 0 ? C + N : Z(a.left, a.right)) : O = u - 2 * ($ !== 0 || D !== 0 ? $ + D : Z(a.top, a.bottom));
1410
1390
  }
1411
- await a({
1391
+ await s({
1412
1392
  ...t,
1413
1393
  availableWidth: S,
1414
- availableHeight: T
1394
+ availableHeight: O
1415
1395
  });
1416
- const L = await s.getDimensions(l.floating);
1417
- return m !== L.width || h !== L.height ? {
1396
+ const M = await i.getDimensions(r.floating);
1397
+ return p !== M.width || u !== M.height ? {
1418
1398
  reset: {
1419
1399
  rects: !0
1420
1400
  }
@@ -1422,118 +1402,117 @@ const Go = function(e) {
1422
1402
  }
1423
1403
  };
1424
1404
  };
1425
- function gn(e) {
1405
+ function mn(e) {
1426
1406
  const t = ie(e);
1427
1407
  let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
1428
- const i = se(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, l = ze(n) !== r || ze(o) !== s;
1408
+ const i = se(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, l = Je(n) !== r || Je(o) !== s;
1429
1409
  return l && (n = r, o = s), {
1430
1410
  width: n,
1431
1411
  height: o,
1432
1412
  $: l
1433
1413
  };
1434
1414
  }
1435
- function Ct(e) {
1436
- return G(e) ? e : e.contextElement;
1415
+ function yt(e) {
1416
+ return X(e) ? e : e.contextElement;
1437
1417
  }
1438
1418
  function Ce(e) {
1439
- const t = Ct(e);
1419
+ const t = yt(e);
1440
1420
  if (!se(t))
1441
- return fe(1);
1421
+ return de(1);
1442
1422
  const n = t.getBoundingClientRect(), {
1443
1423
  width: o,
1444
1424
  height: i,
1445
1425
  $: r
1446
- } = gn(t);
1447
- let s = (r ? ze(n.width) : n.width) / o, l = (r ? ze(n.height) : n.height) / i;
1426
+ } = mn(t);
1427
+ let s = (r ? Je(n.width) : n.width) / o, l = (r ? Je(n.height) : n.height) / i;
1448
1428
  return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
1449
1429
  x: s,
1450
1430
  y: l
1451
1431
  };
1452
1432
  }
1453
- const Qo = /* @__PURE__ */ fe(0);
1454
- function vn(e) {
1433
+ const Xo = /* @__PURE__ */ de(0);
1434
+ function pn(e) {
1455
1435
  const t = ee(e);
1456
- return !Rt() || !t.visualViewport ? Qo : {
1436
+ return !Et() || !t.visualViewport ? Xo : {
1457
1437
  x: t.visualViewport.offsetLeft,
1458
1438
  y: t.visualViewport.offsetTop
1459
1439
  };
1460
1440
  }
1461
- function Zo(e, t, n) {
1441
+ function Jo(e, t, n) {
1462
1442
  return t === void 0 && (t = !1), !n || t && n !== ee(e) ? !1 : t;
1463
1443
  }
1464
- function Ee(e, t, n, o) {
1444
+ function Oe(e, t, n, o) {
1465
1445
  t === void 0 && (t = !1), n === void 0 && (n = !1);
1466
- const i = e.getBoundingClientRect(), r = Ct(e);
1467
- let s = fe(1);
1468
- t && (o ? G(o) && (s = Ce(o)) : s = Ce(e));
1469
- const l = Zo(r, n, o) ? vn(r) : fe(0);
1470
- let a = (i.left + l.x) / s.x, u = (i.top + l.y) / s.y, c = i.width / s.x, d = i.height / s.y;
1446
+ const i = e.getBoundingClientRect(), r = yt(e);
1447
+ let s = de(1);
1448
+ t && (o ? X(o) && (s = Ce(o)) : s = Ce(e));
1449
+ const l = Jo(r, n, o) ? pn(r) : de(0);
1450
+ let a = (i.left + l.x) / s.x, c = (i.top + l.y) / s.y, f = i.width / s.x, d = i.height / s.y;
1471
1451
  if (r) {
1472
- const p = ee(r), f = o && G(o) ? ee(o) : o;
1473
- let m = p, h = ht(m);
1474
- for (; h && o && f !== m; ) {
1475
- const g = Ce(h), v = h.getBoundingClientRect(), y = ie(h), b = v.left + (h.clientLeft + parseFloat(y.paddingLeft)) * g.x, E = v.top + (h.clientTop + parseFloat(y.paddingTop)) * g.y;
1476
- a *= g.x, u *= g.y, c *= g.x, d *= g.y, a += b, u += E, m = ee(h), h = ht(m);
1452
+ const p = ee(r), u = o && X(o) ? ee(o) : o;
1453
+ let m = p, h = m.frameElement;
1454
+ for (; h && o && u !== m; ) {
1455
+ const g = Ce(h), v = h.getBoundingClientRect(), E = ie(h), b = v.left + (h.clientLeft + parseFloat(E.paddingLeft)) * g.x, x = v.top + (h.clientTop + parseFloat(E.paddingTop)) * g.y;
1456
+ a *= g.x, c *= g.y, f *= g.x, d *= g.y, a += b, c += x, m = ee(h), h = m.frameElement;
1477
1457
  }
1478
1458
  }
1479
1459
  return Ze({
1480
- width: c,
1460
+ width: f,
1481
1461
  height: d,
1482
1462
  x: a,
1483
- y: u
1463
+ y: c
1484
1464
  });
1485
1465
  }
1486
- function ei(e) {
1466
+ function Qo(e) {
1487
1467
  let {
1488
1468
  elements: t,
1489
1469
  rect: n,
1490
1470
  offsetParent: o,
1491
1471
  strategy: i
1492
1472
  } = e;
1493
- const r = i === "fixed", s = ae(o), l = t ? it(t.floating) : !1;
1473
+ const r = i === "fixed", s = ce(o), l = t ? ot(t.floating) : !1;
1494
1474
  if (o === s || l && r)
1495
1475
  return n;
1496
1476
  let a = {
1497
1477
  scrollLeft: 0,
1498
1478
  scrollTop: 0
1499
- }, u = fe(1);
1500
- const c = fe(0), d = se(o);
1501
- if ((d || !d && !r) && ((Ae(o) !== "body" || We(s)) && (a = rt(o)), se(o))) {
1502
- const p = Ee(o);
1503
- u = Ce(o), c.x = p.x + o.clientLeft, c.y = p.y + o.clientTop;
1479
+ }, c = de(1);
1480
+ const f = de(0), d = se(o);
1481
+ if ((d || !d && !r) && ((Pe(o) !== "body" || Be(s)) && (a = it(o)), se(o))) {
1482
+ const p = Oe(o);
1483
+ c = Ce(o), f.x = p.x + o.clientLeft, f.y = p.y + o.clientTop;
1504
1484
  }
1505
1485
  return {
1506
- width: n.width * u.x,
1507
- height: n.height * u.y,
1508
- x: n.x * u.x - a.scrollLeft * u.x + c.x,
1509
- y: n.y * u.y - a.scrollTop * u.y + c.y
1486
+ width: n.width * c.x,
1487
+ height: n.height * c.y,
1488
+ x: n.x * c.x - a.scrollLeft * c.x + f.x,
1489
+ y: n.y * c.y - a.scrollTop * c.y + f.y
1510
1490
  };
1511
1491
  }
1512
- function ti(e) {
1492
+ function Zo(e) {
1513
1493
  return Array.from(e.getClientRects());
1514
1494
  }
1515
- function vt(e, t) {
1516
- const n = rt(e).scrollLeft;
1517
- return t ? t.left + n : Ee(ae(e)).left + n;
1495
+ function hn(e) {
1496
+ return Oe(ce(e)).left + it(e).scrollLeft;
1518
1497
  }
1519
- function ni(e) {
1520
- const t = ae(e), n = rt(e), o = e.ownerDocument.body, i = K(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = K(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1521
- let s = -n.scrollLeft + vt(e);
1498
+ function ei(e) {
1499
+ const t = ce(e), n = it(e), o = e.ownerDocument.body, i = Z(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = Z(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1500
+ let s = -n.scrollLeft + hn(e);
1522
1501
  const l = -n.scrollTop;
1523
- return ie(o).direction === "rtl" && (s += K(t.clientWidth, o.clientWidth) - i), {
1502
+ return ie(o).direction === "rtl" && (s += Z(t.clientWidth, o.clientWidth) - i), {
1524
1503
  width: i,
1525
1504
  height: r,
1526
1505
  x: s,
1527
1506
  y: l
1528
1507
  };
1529
1508
  }
1530
- function oi(e, t) {
1531
- const n = ee(e), o = ae(e), i = n.visualViewport;
1509
+ function ti(e, t) {
1510
+ const n = ee(e), o = ce(e), i = n.visualViewport;
1532
1511
  let r = o.clientWidth, s = o.clientHeight, l = 0, a = 0;
1533
1512
  if (i) {
1534
1513
  r = i.width, s = i.height;
1535
- const u = Rt();
1536
- (!u || u && t === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
1514
+ const c = Et();
1515
+ (!c || c && t === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
1537
1516
  }
1538
1517
  return {
1539
1518
  width: r,
@@ -1542,25 +1521,25 @@ function oi(e, t) {
1542
1521
  y: a
1543
1522
  };
1544
1523
  }
1545
- function ii(e, t) {
1546
- const n = Ee(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, r = se(e) ? Ce(e) : fe(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, a = i * r.x, u = o * r.y;
1524
+ function ni(e, t) {
1525
+ const n = Oe(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, r = se(e) ? Ce(e) : de(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, a = i * r.x, c = o * r.y;
1547
1526
  return {
1548
1527
  width: s,
1549
1528
  height: l,
1550
1529
  x: a,
1551
- y: u
1530
+ y: c
1552
1531
  };
1553
1532
  }
1554
- function Bt(e, t, n) {
1533
+ function Nt(e, t, n) {
1555
1534
  let o;
1556
1535
  if (t === "viewport")
1557
- o = oi(e, n);
1536
+ o = ti(e, n);
1558
1537
  else if (t === "document")
1559
- o = ni(ae(e));
1560
- else if (G(t))
1561
- o = ii(t, n);
1538
+ o = ei(ce(e));
1539
+ else if (X(t))
1540
+ o = ni(t, n);
1562
1541
  else {
1563
- const i = vn(e);
1542
+ const i = pn(e);
1564
1543
  o = {
1565
1544
  ...t,
1566
1545
  x: t.x - i.x,
@@ -1569,34 +1548,34 @@ function Bt(e, t, n) {
1569
1548
  }
1570
1549
  return Ze(o);
1571
1550
  }
1572
- function bn(e, t) {
1573
- const n = ue(e);
1574
- return n === t || !G(n) || Ie(n) ? !1 : ie(n).position === "fixed" || bn(n, t);
1551
+ function gn(e, t) {
1552
+ const n = fe(e);
1553
+ return n === t || !X(n) || Ie(n) ? !1 : ie(n).position === "fixed" || gn(n, t);
1575
1554
  }
1576
- function ri(e, t) {
1555
+ function oi(e, t) {
1577
1556
  const n = t.get(e);
1578
1557
  if (n)
1579
1558
  return n;
1580
- let o = ke(e, [], !1).filter((l) => G(l) && Ae(l) !== "body"), i = null;
1559
+ let o = ze(e, [], !1).filter((l) => X(l) && Pe(l) !== "body"), i = null;
1581
1560
  const r = ie(e).position === "fixed";
1582
- let s = r ? ue(e) : e;
1583
- for (; G(s) && !Ie(s); ) {
1584
- const l = ie(s), a = St(s);
1585
- !a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || We(s) && !a && bn(e, s)) ? o = o.filter((c) => c !== s) : i = l, s = ue(s);
1561
+ let s = r ? fe(e) : e;
1562
+ for (; X(s) && !Ie(s); ) {
1563
+ const l = ie(s), a = wt(s);
1564
+ !a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Be(s) && !a && gn(e, s)) ? o = o.filter((f) => f !== s) : i = l, s = fe(s);
1586
1565
  }
1587
1566
  return t.set(e, o), o;
1588
1567
  }
1589
- function li(e) {
1568
+ function ii(e) {
1590
1569
  let {
1591
1570
  element: t,
1592
1571
  boundary: n,
1593
1572
  rootBoundary: o,
1594
1573
  strategy: i
1595
1574
  } = e;
1596
- const s = [...n === "clippingAncestors" ? it(t) ? [] : ri(t, this._c) : [].concat(n), o], l = s[0], a = s.reduce((u, c) => {
1597
- const d = Bt(t, c, i);
1598
- return u.top = K(d.top, u.top), u.right = Me(d.right, u.right), u.bottom = Me(d.bottom, u.bottom), u.left = K(d.left, u.left), u;
1599
- }, Bt(t, l, i));
1575
+ const s = [...n === "clippingAncestors" ? ot(t) ? [] : oi(t, this._c) : [].concat(n), o], l = s[0], a = s.reduce((c, f) => {
1576
+ const d = Nt(t, f, i);
1577
+ return c.top = Z(d.top, c.top), c.right = ue(d.right, c.right), c.bottom = ue(d.bottom, c.bottom), c.left = Z(d.left, c.left), c;
1578
+ }, Nt(t, l, i));
1600
1579
  return {
1601
1580
  width: a.right - a.left,
1602
1581
  height: a.bottom - a.top,
@@ -1604,75 +1583,64 @@ function li(e) {
1604
1583
  y: a.top
1605
1584
  };
1606
1585
  }
1607
- function si(e) {
1586
+ function ri(e) {
1608
1587
  const {
1609
1588
  width: t,
1610
1589
  height: n
1611
- } = gn(e);
1590
+ } = mn(e);
1612
1591
  return {
1613
1592
  width: t,
1614
1593
  height: n
1615
1594
  };
1616
1595
  }
1617
- function ai(e, t, n) {
1618
- const o = se(t), i = ae(t), r = n === "fixed", s = Ee(e, !0, r, t);
1596
+ function li(e, t, n) {
1597
+ const o = se(t), i = ce(t), r = n === "fixed", s = Oe(e, !0, r, t);
1619
1598
  let l = {
1620
1599
  scrollLeft: 0,
1621
1600
  scrollTop: 0
1622
1601
  };
1623
- const a = fe(0);
1602
+ const a = de(0);
1624
1603
  if (o || !o && !r)
1625
- if ((Ae(t) !== "body" || We(i)) && (l = rt(t)), o) {
1626
- const f = Ee(t, !0, r, t);
1627
- a.x = f.x + t.clientLeft, a.y = f.y + t.clientTop;
1628
- } else i && (a.x = vt(i));
1629
- let u = 0, c = 0;
1630
- if (i && !o && !r) {
1631
- const f = i.getBoundingClientRect();
1632
- c = f.top + l.scrollTop, u = f.left + l.scrollLeft - // RTL <body> scrollbar.
1633
- vt(i, f);
1634
- }
1635
- const d = s.left + l.scrollLeft - a.x - u, p = s.top + l.scrollTop - a.y - c;
1604
+ if ((Pe(t) !== "body" || Be(i)) && (l = it(t)), o) {
1605
+ const d = Oe(t, !0, r, t);
1606
+ a.x = d.x + t.clientLeft, a.y = d.y + t.clientTop;
1607
+ } else i && (a.x = hn(i));
1608
+ const c = s.left + l.scrollLeft - a.x, f = s.top + l.scrollTop - a.y;
1636
1609
  return {
1637
- x: d,
1638
- y: p,
1610
+ x: c,
1611
+ y: f,
1639
1612
  width: s.width,
1640
1613
  height: s.height
1641
1614
  };
1642
1615
  }
1643
- function at(e) {
1616
+ function st(e) {
1644
1617
  return ie(e).position === "static";
1645
1618
  }
1646
- function Wt(e, t) {
1647
- if (!se(e) || ie(e).position === "fixed")
1648
- return null;
1649
- if (t)
1650
- return t(e);
1651
- let n = e.offsetParent;
1652
- return ae(e) === n && (n = n.ownerDocument.body), n;
1619
+ function zt(e, t) {
1620
+ return !se(e) || ie(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
1653
1621
  }
1654
- function xn(e, t) {
1622
+ function vn(e, t) {
1655
1623
  const n = ee(e);
1656
- if (it(e))
1624
+ if (ot(e))
1657
1625
  return n;
1658
1626
  if (!se(e)) {
1659
- let i = ue(e);
1627
+ let i = fe(e);
1660
1628
  for (; i && !Ie(i); ) {
1661
- if (G(i) && !at(i))
1629
+ if (X(i) && !st(i))
1662
1630
  return i;
1663
- i = ue(i);
1631
+ i = fe(i);
1664
1632
  }
1665
1633
  return n;
1666
1634
  }
1667
- let o = Wt(e, t);
1668
- for (; o && Lo(o) && at(o); )
1669
- o = Wt(o, t);
1670
- return o && Ie(o) && at(o) && !St(o) ? n : o || _o(e) || n;
1635
+ let o = zt(e, t);
1636
+ for (; o && Do(o) && st(o); )
1637
+ o = zt(o, t);
1638
+ return o && Ie(o) && st(o) && !wt(o) ? n : o || Fo(e) || n;
1671
1639
  }
1672
- const ci = async function(e) {
1673
- const t = this.getOffsetParent || xn, n = this.getDimensions, o = await n(e.floating);
1640
+ const si = async function(e) {
1641
+ const t = this.getOffsetParent || vn, n = this.getDimensions, o = await n(e.floating);
1674
1642
  return {
1675
- reference: ai(e.reference, await t(e.floating), e.strategy),
1643
+ reference: li(e.reference, await t(e.floating), e.strategy),
1676
1644
  floating: {
1677
1645
  x: 0,
1678
1646
  y: 0,
@@ -1681,24 +1649,24 @@ const ci = async function(e) {
1681
1649
  }
1682
1650
  };
1683
1651
  };
1684
- function ui(e) {
1652
+ function ai(e) {
1685
1653
  return ie(e).direction === "rtl";
1686
1654
  }
1687
- const fi = {
1688
- convertOffsetParentRelativeRectToViewportRelativeRect: ei,
1689
- getDocumentElement: ae,
1690
- getClippingRect: li,
1691
- getOffsetParent: xn,
1692
- getElementRects: ci,
1693
- getClientRects: ti,
1694
- getDimensions: si,
1655
+ const ci = {
1656
+ convertOffsetParentRelativeRectToViewportRelativeRect: Qo,
1657
+ getDocumentElement: ce,
1658
+ getClippingRect: ii,
1659
+ getOffsetParent: vn,
1660
+ getElementRects: si,
1661
+ getClientRects: Zo,
1662
+ getDimensions: ri,
1695
1663
  getScale: Ce,
1696
- isElement: G,
1697
- isRTL: ui
1664
+ isElement: X,
1665
+ isRTL: ai
1698
1666
  };
1699
- function di(e, t) {
1667
+ function ui(e, t) {
1700
1668
  let n = null, o;
1701
- const i = ae(e);
1669
+ const i = ce(e);
1702
1670
  function r() {
1703
1671
  var l;
1704
1672
  clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
@@ -1706,43 +1674,43 @@ function di(e, t) {
1706
1674
  function s(l, a) {
1707
1675
  l === void 0 && (l = !1), a === void 0 && (a = 1), r();
1708
1676
  const {
1709
- left: u,
1710
- top: c,
1677
+ left: c,
1678
+ top: f,
1711
1679
  width: d,
1712
1680
  height: p
1713
1681
  } = e.getBoundingClientRect();
1714
1682
  if (l || t(), !d || !p)
1715
1683
  return;
1716
- const f = Ke(c), m = Ke(i.clientWidth - (u + d)), h = Ke(i.clientHeight - (c + p)), g = Ke(u), y = {
1717
- rootMargin: -f + "px " + -m + "px " + -h + "px " + -g + "px",
1718
- threshold: K(0, Me(1, a)) || 1
1684
+ const u = Ke(f), m = Ke(i.clientWidth - (c + d)), h = Ke(i.clientHeight - (f + p)), g = Ke(c), E = {
1685
+ rootMargin: -u + "px " + -m + "px " + -h + "px " + -g + "px",
1686
+ threshold: Z(0, ue(1, a)) || 1
1719
1687
  };
1720
1688
  let b = !0;
1721
- function E(O) {
1722
- const C = O[0].intersectionRatio;
1723
- if (C !== a) {
1689
+ function x(O) {
1690
+ const S = O[0].intersectionRatio;
1691
+ if (S !== a) {
1724
1692
  if (!b)
1725
1693
  return s();
1726
- C ? s(!1, C) : o = setTimeout(() => {
1694
+ S ? s(!1, S) : o = setTimeout(() => {
1727
1695
  s(!1, 1e-7);
1728
1696
  }, 1e3);
1729
1697
  }
1730
1698
  b = !1;
1731
1699
  }
1732
1700
  try {
1733
- n = new IntersectionObserver(E, {
1734
- ...y,
1701
+ n = new IntersectionObserver(x, {
1702
+ ...E,
1735
1703
  // Handle <iframe>s
1736
1704
  root: i.ownerDocument
1737
1705
  });
1738
1706
  } catch {
1739
- n = new IntersectionObserver(E, y);
1707
+ n = new IntersectionObserver(x, E);
1740
1708
  }
1741
1709
  n.observe(e);
1742
1710
  }
1743
1711
  return s(!0), r;
1744
1712
  }
1745
- function mi(e, t, n, o) {
1713
+ function fi(e, t, n, o) {
1746
1714
  o === void 0 && (o = {});
1747
1715
  const {
1748
1716
  ancestorScroll: i = !0,
@@ -1750,48 +1718,48 @@ function mi(e, t, n, o) {
1750
1718
  elementResize: s = typeof ResizeObserver == "function",
1751
1719
  layoutShift: l = typeof IntersectionObserver == "function",
1752
1720
  animationFrame: a = !1
1753
- } = o, u = Ct(e), c = i || r ? [...u ? ke(u) : [], ...ke(t)] : [];
1754
- c.forEach((v) => {
1721
+ } = o, c = yt(e), f = i || r ? [...c ? ze(c) : [], ...ze(t)] : [];
1722
+ f.forEach((v) => {
1755
1723
  i && v.addEventListener("scroll", n, {
1756
1724
  passive: !0
1757
1725
  }), r && v.addEventListener("resize", n);
1758
1726
  });
1759
- const d = u && l ? di(u, n) : null;
1760
- let p = -1, f = null;
1761
- s && (f = new ResizeObserver((v) => {
1762
- let [y] = v;
1763
- y && y.target === u && f && (f.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1727
+ const d = c && l ? ui(c, n) : null;
1728
+ let p = -1, u = null;
1729
+ s && (u = new ResizeObserver((v) => {
1730
+ let [E] = v;
1731
+ E && E.target === c && u && (u.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1764
1732
  var b;
1765
- (b = f) == null || b.observe(t);
1733
+ (b = u) == null || b.observe(t);
1766
1734
  })), n();
1767
- }), u && !a && f.observe(u), f.observe(t));
1768
- let m, h = a ? Ee(e) : null;
1735
+ }), c && !a && u.observe(c), u.observe(t));
1736
+ let m, h = a ? Oe(e) : null;
1769
1737
  a && g();
1770
1738
  function g() {
1771
- const v = Ee(e);
1739
+ const v = Oe(e);
1772
1740
  h && (v.x !== h.x || v.y !== h.y || v.width !== h.width || v.height !== h.height) && n(), h = v, m = requestAnimationFrame(g);
1773
1741
  }
1774
1742
  return n(), () => {
1775
1743
  var v;
1776
- c.forEach((y) => {
1777
- i && y.removeEventListener("scroll", n), r && y.removeEventListener("resize", n);
1778
- }), d == null || d(), (v = f) == null || v.disconnect(), f = null, a && cancelAnimationFrame(m);
1744
+ f.forEach((E) => {
1745
+ i && E.removeEventListener("scroll", n), r && E.removeEventListener("resize", n);
1746
+ }), d == null || d(), (v = u) == null || v.disconnect(), u = null, a && cancelAnimationFrame(m);
1779
1747
  };
1780
1748
  }
1781
- const ct = lt, pi = Go, hi = Xo, gi = qo, vi = Jo, bi = (e, t, n) => {
1749
+ const at = rt, di = qo, mi = Ko, pi = Uo, hi = Go, gi = (e, t, n) => {
1782
1750
  const o = /* @__PURE__ */ new Map(), i = {
1783
- platform: fi,
1751
+ platform: ci,
1784
1752
  ...n
1785
1753
  }, r = {
1786
1754
  ...i.platform,
1787
1755
  _c: o
1788
1756
  };
1789
- return Yo(e, t, {
1757
+ return jo(e, t, {
1790
1758
  ...i,
1791
1759
  platform: r
1792
1760
  });
1793
1761
  };
1794
- var Ge = typeof document < "u" ? on : oe;
1762
+ var Ge = typeof document < "u" ? en : oe;
1795
1763
  function et(e, t) {
1796
1764
  if (e === t)
1797
1765
  return !0;
@@ -1822,20 +1790,20 @@ function et(e, t) {
1822
1790
  }
1823
1791
  return e !== e && t !== t;
1824
1792
  }
1825
- function wn(e) {
1793
+ function bn(e) {
1826
1794
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1827
1795
  }
1828
- function jt(e, t) {
1829
- const n = wn(e);
1796
+ function Ht(e, t) {
1797
+ const n = bn(e);
1830
1798
  return Math.round(t * n) / n;
1831
1799
  }
1832
- function ut(e) {
1833
- const t = w.useRef(e);
1800
+ function Vt(e) {
1801
+ const t = y.useRef(e);
1834
1802
  return Ge(() => {
1835
1803
  t.current = e;
1836
1804
  }), t;
1837
1805
  }
1838
- function xi(e) {
1806
+ function vi(e) {
1839
1807
  e === void 0 && (e = {});
1840
1808
  const {
1841
1809
  placement: t = "bottom",
@@ -1848,142 +1816,138 @@ function xi(e) {
1848
1816
  } = {},
1849
1817
  transform: l = !0,
1850
1818
  whileElementsMounted: a,
1851
- open: u
1852
- } = e, [c, d] = w.useState({
1819
+ open: c
1820
+ } = e, [f, d] = y.useState({
1853
1821
  x: 0,
1854
1822
  y: 0,
1855
1823
  strategy: n,
1856
1824
  placement: t,
1857
1825
  middlewareData: {},
1858
1826
  isPositioned: !1
1859
- }), [p, f] = w.useState(o);
1860
- et(p, o) || f(o);
1861
- const [m, h] = w.useState(null), [g, v] = w.useState(null), y = w.useCallback((P) => {
1862
- P !== C.current && (C.current = P, h(P));
1863
- }, []), b = w.useCallback((P) => {
1864
- P !== T.current && (T.current = P, v(P));
1865
- }, []), E = r || m, O = s || g, C = w.useRef(null), T = w.useRef(null), S = w.useRef(c), L = a != null, A = ut(a), D = ut(i), k = ut(u), F = w.useCallback(() => {
1866
- if (!C.current || !T.current)
1827
+ }), [p, u] = y.useState(o);
1828
+ et(p, o) || u(o);
1829
+ const [m, h] = y.useState(null), [g, v] = y.useState(null), E = y.useCallback((P) => {
1830
+ P !== S.current && (S.current = P, h(P));
1831
+ }, []), b = y.useCallback((P) => {
1832
+ P !== M.current && (M.current = P, v(P));
1833
+ }, []), x = r || m, O = s || g, S = y.useRef(null), M = y.useRef(null), C = y.useRef(f), N = a != null, $ = Vt(a), D = Vt(i), k = y.useCallback(() => {
1834
+ if (!S.current || !M.current)
1867
1835
  return;
1868
1836
  const P = {
1869
1837
  placement: t,
1870
1838
  strategy: n,
1871
1839
  middleware: p
1872
1840
  };
1873
- D.current && (P.platform = D.current), bi(C.current, T.current, P).then(($) => {
1874
- const H = {
1875
- ...$,
1876
- // The floating element's position may be recomputed while it's closed
1877
- // but still mounted (such as when transitioning out). To ensure
1878
- // `isPositioned` will be `false` initially on the next open, avoid
1879
- // setting it to `true` when `open === false` (must be specified).
1880
- isPositioned: k.current !== !1
1841
+ D.current && (P.platform = D.current), gi(S.current, M.current, P).then((L) => {
1842
+ const A = {
1843
+ ...L,
1844
+ isPositioned: !0
1881
1845
  };
1882
- x.current && !et(S.current, H) && (S.current = H, Xe.flushSync(() => {
1883
- d(H);
1846
+ z.current && !et(C.current, A) && (C.current = A, Ne.flushSync(() => {
1847
+ d(A);
1884
1848
  }));
1885
1849
  });
1886
- }, [p, t, n, D, k]);
1850
+ }, [p, t, n, D]);
1887
1851
  Ge(() => {
1888
- u === !1 && S.current.isPositioned && (S.current.isPositioned = !1, d((P) => ({
1852
+ c === !1 && C.current.isPositioned && (C.current.isPositioned = !1, d((P) => ({
1889
1853
  ...P,
1890
1854
  isPositioned: !1
1891
1855
  })));
1892
- }, [u]);
1893
- const x = w.useRef(!1);
1894
- Ge(() => (x.current = !0, () => {
1895
- x.current = !1;
1856
+ }, [c]);
1857
+ const z = y.useRef(!1);
1858
+ Ge(() => (z.current = !0, () => {
1859
+ z.current = !1;
1896
1860
  }), []), Ge(() => {
1897
- if (E && (C.current = E), O && (T.current = O), E && O) {
1898
- if (A.current)
1899
- return A.current(E, O, F);
1900
- F();
1861
+ if (x && (S.current = x), O && (M.current = O), x && O) {
1862
+ if ($.current)
1863
+ return $.current(x, O, k);
1864
+ k();
1901
1865
  }
1902
- }, [E, O, F, A, L]);
1903
- const B = w.useMemo(() => ({
1904
- reference: C,
1905
- floating: T,
1906
- setReference: y,
1866
+ }, [x, O, k, $, N]);
1867
+ const w = y.useMemo(() => ({
1868
+ reference: S,
1869
+ floating: M,
1870
+ setReference: E,
1907
1871
  setFloating: b
1908
- }), [y, b]), _ = w.useMemo(() => ({
1909
- reference: E,
1872
+ }), [E, b]), F = y.useMemo(() => ({
1873
+ reference: x,
1910
1874
  floating: O
1911
- }), [E, O]), z = w.useMemo(() => {
1875
+ }), [x, O]), j = y.useMemo(() => {
1912
1876
  const P = {
1913
1877
  position: n,
1914
1878
  left: 0,
1915
1879
  top: 0
1916
1880
  };
1917
- if (!_.floating)
1881
+ if (!F.floating)
1918
1882
  return P;
1919
- const $ = jt(_.floating, c.x), H = jt(_.floating, c.y);
1883
+ const L = Ht(F.floating, f.x), A = Ht(F.floating, f.y);
1920
1884
  return l ? {
1921
1885
  ...P,
1922
- transform: "translate(" + $ + "px, " + H + "px)",
1923
- ...wn(_.floating) >= 1.5 && {
1886
+ transform: "translate(" + L + "px, " + A + "px)",
1887
+ ...bn(F.floating) >= 1.5 && {
1924
1888
  willChange: "transform"
1925
1889
  }
1926
1890
  } : {
1927
1891
  position: n,
1928
- left: $,
1929
- top: H
1892
+ left: L,
1893
+ top: A
1930
1894
  };
1931
- }, [n, l, _.floating, c.x, c.y]);
1932
- return w.useMemo(() => ({
1933
- ...c,
1934
- update: F,
1935
- refs: B,
1936
- elements: _,
1937
- floatingStyles: z
1938
- }), [c, F, B, _, z]);
1939
- }
1940
- const yn = (e, t) => ({
1895
+ }, [n, l, F.floating, f.x, f.y]);
1896
+ return y.useMemo(() => ({
1897
+ ...f,
1898
+ update: k,
1899
+ refs: w,
1900
+ elements: F,
1901
+ floatingStyles: j
1902
+ }), [f, k, w, F, j]);
1903
+ }
1904
+ const xn = (e, t) => ({
1905
+ ...di(e),
1906
+ options: [e, t]
1907
+ }), bi = (e, t) => ({
1908
+ ...mi(e),
1909
+ options: [e, t]
1910
+ }), xi = (e, t) => ({
1941
1911
  ...pi(e),
1942
1912
  options: [e, t]
1943
1913
  }), wi = (e, t) => ({
1944
1914
  ...hi(e),
1945
1915
  options: [e, t]
1946
- }), yi = (e, t) => ({
1947
- ...gi(e),
1948
- options: [e, t]
1949
- }), Ei = (e, t) => ({
1950
- ...vi(e),
1951
- options: [e, t]
1952
- }), En = {
1953
- ...w
1954
- }, Oi = En.useInsertionEffect, Si = Oi || ((e) => e());
1955
- function On(e) {
1956
- const t = w.useRef(() => {
1916
+ }), wn = {
1917
+ ...y
1918
+ }, Ei = wn.useInsertionEffect, yi = Ei || ((e) => e());
1919
+ function En(e) {
1920
+ const t = y.useRef(() => {
1957
1921
  if (process.env.NODE_ENV !== "production")
1958
1922
  throw new Error("Cannot call an event handler while rendering.");
1959
1923
  });
1960
- return Si(() => {
1924
+ return yi(() => {
1961
1925
  t.current = e;
1962
- }), w.useCallback(function() {
1926
+ }), y.useCallback(function() {
1963
1927
  for (var n = arguments.length, o = new Array(n), i = 0; i < n; i++)
1964
1928
  o[i] = arguments[i];
1965
1929
  return t.current == null ? void 0 : t.current(...o);
1966
1930
  }, []);
1967
1931
  }
1968
- var bt = typeof document < "u" ? on : oe;
1969
- let Ut = !1, Ri = 0;
1970
- const Yt = () => (
1932
+ var pt = typeof document < "u" ? en : oe;
1933
+ let Wt = !1, Oi = 0;
1934
+ const Bt = () => (
1971
1935
  // Ensure the id is unique with multiple independent versions of Floating UI
1972
1936
  // on <React 18
1973
- "floating-ui-" + Math.random().toString(36).slice(2, 6) + Ri++
1937
+ "floating-ui-" + Math.random().toString(36).slice(2, 6) + Oi++
1974
1938
  );
1975
- function Ci() {
1976
- const [e, t] = w.useState(() => Ut ? Yt() : void 0);
1977
- return bt(() => {
1978
- e == null && t(Yt());
1979
- }, []), w.useEffect(() => {
1980
- Ut = !0;
1939
+ function Si() {
1940
+ const [e, t] = y.useState(() => Wt ? Bt() : void 0);
1941
+ return pt(() => {
1942
+ e == null && t(Bt());
1943
+ }, []), y.useEffect(() => {
1944
+ Wt = !0;
1981
1945
  }, []), e;
1982
1946
  }
1983
- const Ti = En.useId, Ii = Ti || Ci;
1947
+ const Ri = wn.useId, Ci = Ri || Si;
1984
1948
  let He;
1985
1949
  process.env.NODE_ENV !== "production" && (He = /* @__PURE__ */ new Set());
1986
- function Mi() {
1950
+ function Ti() {
1987
1951
  for (var e, t = arguments.length, n = new Array(t), o = 0; o < t; o++)
1988
1952
  n[o] = arguments[o];
1989
1953
  const i = "Floating UI: " + n.join(" ");
@@ -1992,7 +1956,7 @@ function Mi() {
1992
1956
  (r = He) == null || r.add(i), console.warn(i);
1993
1957
  }
1994
1958
  }
1995
- function Pi() {
1959
+ function Ii() {
1996
1960
  for (var e, t = arguments.length, n = new Array(t), o = 0; o < t; o++)
1997
1961
  n[o] = arguments[o];
1998
1962
  const i = "Floating UI: " + n.join(" ");
@@ -2001,7 +1965,7 @@ function Pi() {
2001
1965
  (r = He) == null || r.add(i), console.error(i);
2002
1966
  }
2003
1967
  }
2004
- function Ai() {
1968
+ function Mi() {
2005
1969
  const e = /* @__PURE__ */ new Map();
2006
1970
  return {
2007
1971
  emit(t, n) {
@@ -2017,60 +1981,60 @@ function Ai() {
2017
1981
  }
2018
1982
  };
2019
1983
  }
2020
- const $i = /* @__PURE__ */ w.createContext(null), Di = /* @__PURE__ */ w.createContext(null), Fi = () => {
1984
+ const Pi = /* @__PURE__ */ y.createContext(null), Ai = /* @__PURE__ */ y.createContext(null), $i = () => {
2021
1985
  var e;
2022
- return ((e = w.useContext($i)) == null ? void 0 : e.id) || null;
2023
- }, Li = () => w.useContext(Di), _i = "data-floating-ui-focusable";
2024
- function Ni(e) {
1986
+ return ((e = y.useContext(Pi)) == null ? void 0 : e.id) || null;
1987
+ }, Di = () => y.useContext(Ai);
1988
+ function Fi(e) {
2025
1989
  const {
2026
1990
  open: t = !1,
2027
1991
  onOpenChange: n,
2028
1992
  elements: o
2029
- } = e, i = Ii(), r = w.useRef({}), [s] = w.useState(() => Ai()), l = Fi() != null;
1993
+ } = e, i = Ci(), r = y.useRef({}), [s] = y.useState(() => Mi()), l = $i() != null;
2030
1994
  if (process.env.NODE_ENV !== "production") {
2031
- const f = o.reference;
2032
- f && !G(f) && Pi("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
1995
+ const u = o.reference;
1996
+ u && !X(u) && Ii("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
2033
1997
  }
2034
- const [a, u] = w.useState(o.reference), c = On((f, m, h) => {
2035
- r.current.openEvent = f ? m : void 0, s.emit("openchange", {
2036
- open: f,
1998
+ const [a, c] = y.useState(o.reference), f = En((u, m, h) => {
1999
+ r.current.openEvent = u ? m : void 0, s.emit("openchange", {
2000
+ open: u,
2037
2001
  event: m,
2038
2002
  reason: h,
2039
2003
  nested: l
2040
- }), n == null || n(f, m, h);
2041
- }), d = w.useMemo(() => ({
2042
- setPositionReference: u
2043
- }), []), p = w.useMemo(() => ({
2004
+ }), n == null || n(u, m, h);
2005
+ }), d = y.useMemo(() => ({
2006
+ setPositionReference: c
2007
+ }), []), p = y.useMemo(() => ({
2044
2008
  reference: a || o.reference || null,
2045
2009
  floating: o.floating || null,
2046
2010
  domReference: o.reference
2047
2011
  }), [a, o.reference, o.floating]);
2048
- return w.useMemo(() => ({
2012
+ return y.useMemo(() => ({
2049
2013
  dataRef: r,
2050
2014
  open: t,
2051
- onOpenChange: c,
2015
+ onOpenChange: f,
2052
2016
  elements: p,
2053
2017
  events: s,
2054
2018
  floatingId: i,
2055
2019
  refs: d
2056
- }), [t, c, p, s, i, d]);
2020
+ }), [t, f, p, s, i, d]);
2057
2021
  }
2058
- function ki(e) {
2022
+ function Li(e) {
2059
2023
  e === void 0 && (e = {});
2060
2024
  const {
2061
2025
  nodeId: t
2062
- } = e, n = Ni({
2026
+ } = e, n = Fi({
2063
2027
  ...e,
2064
2028
  elements: {
2065
2029
  reference: null,
2066
2030
  floating: null,
2067
2031
  ...e.elements
2068
2032
  }
2069
- }), o = e.rootContext || n, i = o.elements, [r, s] = w.useState(null), [l, a] = w.useState(null), c = (i == null ? void 0 : i.reference) || r, d = w.useRef(null), p = Li();
2070
- bt(() => {
2071
- c && (d.current = c);
2072
- }, [c]);
2073
- const f = xi({
2033
+ }), o = e.rootContext || n, i = o.elements, [r, s] = y.useState(null), [l, a] = y.useState(null), f = (i == null ? void 0 : i.reference) || r, d = y.useRef(null), p = Di();
2034
+ pt(() => {
2035
+ f && (d.current = f);
2036
+ }, [f]);
2037
+ const u = vi({
2074
2038
  ...e,
2075
2039
  elements: {
2076
2040
  ...i,
@@ -2078,103 +2042,102 @@ function ki(e) {
2078
2042
  reference: l
2079
2043
  }
2080
2044
  }
2081
- }), m = w.useCallback((b) => {
2082
- const E = G(b) ? {
2045
+ }), m = y.useCallback((b) => {
2046
+ const x = X(b) ? {
2083
2047
  getBoundingClientRect: () => b.getBoundingClientRect(),
2084
2048
  contextElement: b
2085
2049
  } : b;
2086
- a(E), f.refs.setReference(E);
2087
- }, [f.refs]), h = w.useCallback((b) => {
2088
- (G(b) || b === null) && (d.current = b, s(b)), (G(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2050
+ a(x), u.refs.setReference(x);
2051
+ }, [u.refs]), h = y.useCallback((b) => {
2052
+ (X(b) || b === null) && (d.current = b, s(b)), (X(u.refs.reference.current) || u.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2089
2053
  // `null` to support `positionReference` + an unstable `reference`
2090
2054
  // callback ref.
2091
- b !== null && !G(b)) && f.refs.setReference(b);
2092
- }, [f.refs]), g = w.useMemo(() => ({
2093
- ...f.refs,
2055
+ b !== null && !X(b)) && u.refs.setReference(b);
2056
+ }, [u.refs]), g = y.useMemo(() => ({
2057
+ ...u.refs,
2094
2058
  setReference: h,
2095
2059
  setPositionReference: m,
2096
2060
  domReference: d
2097
- }), [f.refs, h, m]), v = w.useMemo(() => ({
2098
- ...f.elements,
2099
- domReference: c
2100
- }), [f.elements, c]), y = w.useMemo(() => ({
2101
- ...f,
2061
+ }), [u.refs, h, m]), v = y.useMemo(() => ({
2062
+ ...u.elements,
2063
+ domReference: f
2064
+ }), [u.elements, f]), E = y.useMemo(() => ({
2065
+ ...u,
2102
2066
  ...o,
2103
2067
  refs: g,
2104
2068
  elements: v,
2105
2069
  nodeId: t
2106
- }), [f, g, v, t, o]);
2107
- return bt(() => {
2108
- o.dataRef.current.floatingContext = y;
2109
- const b = p == null ? void 0 : p.nodesRef.current.find((E) => E.id === t);
2110
- b && (b.context = y);
2111
- }), w.useMemo(() => ({
2112
- ...f,
2113
- context: y,
2070
+ }), [u, g, v, t, o]);
2071
+ return pt(() => {
2072
+ o.dataRef.current.floatingContext = E;
2073
+ const b = p == null ? void 0 : p.nodesRef.current.find((x) => x.id === t);
2074
+ b && (b.context = E);
2075
+ }), y.useMemo(() => ({
2076
+ ...u,
2077
+ context: E,
2114
2078
  refs: g,
2115
2079
  elements: v
2116
- }), [f, g, v, y]);
2080
+ }), [u, g, v, E]);
2117
2081
  }
2118
- const qt = "active", Kt = "selected";
2119
- function ft(e, t, n) {
2082
+ const jt = "active", Ut = "selected";
2083
+ function ct(e, t, n) {
2120
2084
  const o = /* @__PURE__ */ new Map(), i = n === "item";
2121
2085
  let r = e;
2122
2086
  if (i && e) {
2123
2087
  const {
2124
- [qt]: s,
2125
- [Kt]: l,
2088
+ [jt]: s,
2089
+ [Ut]: l,
2126
2090
  ...a
2127
2091
  } = e;
2128
2092
  r = a;
2129
2093
  }
2130
2094
  return {
2131
2095
  ...n === "floating" && {
2132
- tabIndex: -1,
2133
- [_i]: ""
2096
+ tabIndex: -1
2134
2097
  },
2135
2098
  ...r,
2136
2099
  ...t.map((s) => {
2137
2100
  const l = s ? s[n] : null;
2138
2101
  return typeof l == "function" ? e ? l(e) : null : l;
2139
2102
  }).concat(e).reduce((s, l) => (l && Object.entries(l).forEach((a) => {
2140
- let [u, c] = a;
2141
- if (!(i && [qt, Kt].includes(u)))
2142
- if (u.indexOf("on") === 0) {
2143
- if (o.has(u) || o.set(u, []), typeof c == "function") {
2103
+ let [c, f] = a;
2104
+ if (!(i && [jt, Ut].includes(c)))
2105
+ if (c.indexOf("on") === 0) {
2106
+ if (o.has(c) || o.set(c, []), typeof f == "function") {
2144
2107
  var d;
2145
- (d = o.get(u)) == null || d.push(c), s[u] = function() {
2146
- for (var p, f = arguments.length, m = new Array(f), h = 0; h < f; h++)
2108
+ (d = o.get(c)) == null || d.push(f), s[c] = function() {
2109
+ for (var p, u = arguments.length, m = new Array(u), h = 0; h < u; h++)
2147
2110
  m[h] = arguments[h];
2148
- return (p = o.get(u)) == null ? void 0 : p.map((g) => g(...m)).find((g) => g !== void 0);
2111
+ return (p = o.get(c)) == null ? void 0 : p.map((g) => g(...m)).find((g) => g !== void 0);
2149
2112
  };
2150
2113
  }
2151
2114
  } else
2152
- s[u] = c;
2115
+ s[c] = f;
2153
2116
  }), s), {})
2154
2117
  };
2155
2118
  }
2156
- function zi(e) {
2119
+ function _i(e) {
2157
2120
  e === void 0 && (e = []);
2158
- const t = e.map((l) => l == null ? void 0 : l.reference), n = e.map((l) => l == null ? void 0 : l.floating), o = e.map((l) => l == null ? void 0 : l.item), i = w.useCallback(
2159
- (l) => ft(l, e, "reference"),
2121
+ const t = e.map((l) => l == null ? void 0 : l.reference), n = e.map((l) => l == null ? void 0 : l.floating), o = e.map((l) => l == null ? void 0 : l.item), i = y.useCallback(
2122
+ (l) => ct(l, e, "reference"),
2160
2123
  // eslint-disable-next-line react-hooks/exhaustive-deps
2161
2124
  t
2162
- ), r = w.useCallback(
2163
- (l) => ft(l, e, "floating"),
2125
+ ), r = y.useCallback(
2126
+ (l) => ct(l, e, "floating"),
2164
2127
  // eslint-disable-next-line react-hooks/exhaustive-deps
2165
2128
  n
2166
- ), s = w.useCallback(
2167
- (l) => ft(l, e, "item"),
2129
+ ), s = y.useCallback(
2130
+ (l) => ct(l, e, "item"),
2168
2131
  // eslint-disable-next-line react-hooks/exhaustive-deps
2169
2132
  o
2170
2133
  );
2171
- return w.useMemo(() => ({
2134
+ return y.useMemo(() => ({
2172
2135
  getReferenceProps: i,
2173
2136
  getFloatingProps: r,
2174
2137
  getItemProps: s
2175
2138
  }), [i, r, s]);
2176
2139
  }
2177
- function Gt(e, t) {
2140
+ function Yt(e, t) {
2178
2141
  return {
2179
2142
  ...e,
2180
2143
  rects: {
@@ -2186,7 +2149,7 @@ function Gt(e, t) {
2186
2149
  }
2187
2150
  };
2188
2151
  }
2189
- const Hi = (e) => ({
2152
+ const ki = (e) => ({
2190
2153
  name: "inner",
2191
2154
  options: e,
2192
2155
  async fn(t) {
@@ -2198,36 +2161,32 @@ const Hi = (e) => ({
2198
2161
  index: s = 0,
2199
2162
  minItemsVisible: l = 4,
2200
2163
  referenceOverflowThreshold: a = 0,
2201
- scrollRef: u,
2202
- ...c
2203
- } = $e(e, t), {
2164
+ scrollRef: c,
2165
+ ...f
2166
+ } = Ae(e, t), {
2204
2167
  rects: d,
2205
2168
  elements: {
2206
2169
  floating: p
2207
2170
  }
2208
- } = t, f = n.current[s], m = (u == null ? void 0 : u.current) || p, h = p.clientTop || m.clientTop, g = p.clientTop !== 0, v = m.clientTop !== 0, y = p === m;
2209
- if (process.env.NODE_ENV !== "production" && (t.placement.startsWith("bottom") || Mi('`placement` side must be "bottom" when using the `inner`', "middleware.")), !f)
2171
+ } = t, u = n.current[s];
2172
+ if (process.env.NODE_ENV !== "production" && (t.placement.startsWith("bottom") || Ti('`placement` side must be "bottom" when using the `inner`', "middleware.")), !u)
2210
2173
  return {};
2211
- const b = {
2174
+ const m = {
2212
2175
  ...t,
2213
- ...await yn(-f.offsetTop - p.clientTop - d.reference.height / 2 - f.offsetHeight / 2 - r).fn(t)
2214
- }, E = await ct(Gt(b, m.scrollHeight + h + p.clientTop), c), O = await ct(b, {
2215
- ...c,
2176
+ ...await xn(-u.offsetTop - p.clientTop - d.reference.height / 2 - u.offsetHeight / 2 - r).fn(t)
2177
+ }, h = (c == null ? void 0 : c.current) || p, g = await at(Yt(m, h.scrollHeight), f), v = await at(m, {
2178
+ ...f,
2216
2179
  elementContext: "reference"
2217
- }), C = K(0, E.top), T = b.y + C, S = ze(K(0, m.scrollHeight + (g && y || v ? h * 2 : 0) - C - K(0, E.bottom)));
2218
- if (m.style.maxHeight = S + "px", m.scrollTop = C, i) {
2219
- const L = m.scrollHeight > m.offsetHeight && m.offsetHeight < f.offsetHeight * l - 1 || O.top >= -a || O.bottom >= -a;
2220
- Xe.flushSync(() => i(L));
2221
- }
2222
- return o && (o.current = await ct(Gt({
2223
- ...b,
2224
- y: T
2225
- }, m.offsetHeight + h + p.clientTop), c)), {
2226
- y: T
2180
+ }), E = Math.max(0, g.top), b = m.y + E, x = Math.max(0, h.scrollHeight - E - Math.max(0, g.bottom));
2181
+ return h.style.maxHeight = x + "px", h.scrollTop = E, i && (h.offsetHeight < u.offsetHeight * Math.min(l, n.current.length - 1) - 1 || v.top >= -a || v.bottom >= -a ? Ne.flushSync(() => i(!0)) : Ne.flushSync(() => i(!1))), o && (o.current = await at(Yt({
2182
+ ...m,
2183
+ y: b
2184
+ }, h.offsetHeight), f)), {
2185
+ y: b
2227
2186
  };
2228
2187
  }
2229
2188
  });
2230
- function Vi(e, t) {
2189
+ function Ni(e, t) {
2231
2190
  const {
2232
2191
  open: n,
2233
2192
  elements: o
@@ -2236,119 +2195,116 @@ function Vi(e, t) {
2236
2195
  overflowRef: r,
2237
2196
  scrollRef: s,
2238
2197
  onChange: l
2239
- } = t, a = On(l), u = w.useRef(!1), c = w.useRef(null), d = w.useRef(null);
2240
- w.useEffect(() => {
2198
+ } = t, a = En(l), c = y.useRef(!1), f = y.useRef(null), d = y.useRef(null);
2199
+ y.useEffect(() => {
2241
2200
  if (!i) return;
2242
- function f(h) {
2201
+ function u(h) {
2243
2202
  if (h.ctrlKey || !m || r.current == null)
2244
2203
  return;
2245
- const g = h.deltaY, v = r.current.top >= -0.5, y = r.current.bottom >= -0.5, b = m.scrollHeight - m.clientHeight, E = g < 0 ? -1 : 1, O = g < 0 ? "max" : "min";
2246
- m.scrollHeight <= m.clientHeight || (!v && g > 0 || !y && g < 0 ? (h.preventDefault(), Xe.flushSync(() => {
2247
- a((C) => C + Math[O](g, b * E));
2248
- })) : /firefox/i.test(No()) && (m.scrollTop += g));
2204
+ const g = h.deltaY, v = r.current.top >= -0.5, E = r.current.bottom >= -0.5, b = m.scrollHeight - m.clientHeight, x = g < 0 ? -1 : 1, O = g < 0 ? "max" : "min";
2205
+ m.scrollHeight <= m.clientHeight || (!v && g > 0 || !E && g < 0 ? (h.preventDefault(), Ne.flushSync(() => {
2206
+ a((S) => S + Math[O](g, b * x));
2207
+ })) : /firefox/i.test(Lo()) && (m.scrollTop += g));
2249
2208
  }
2250
2209
  const m = (s == null ? void 0 : s.current) || o.floating;
2251
2210
  if (n && m)
2252
- return m.addEventListener("wheel", f), requestAnimationFrame(() => {
2253
- c.current = m.scrollTop, r.current != null && (d.current = {
2211
+ return m.addEventListener("wheel", u), requestAnimationFrame(() => {
2212
+ f.current = m.scrollTop, r.current != null && (d.current = {
2254
2213
  ...r.current
2255
2214
  });
2256
2215
  }), () => {
2257
- c.current = null, d.current = null, m.removeEventListener("wheel", f);
2216
+ f.current = null, d.current = null, m.removeEventListener("wheel", u);
2258
2217
  };
2259
2218
  }, [i, n, o.floating, r, s, a]);
2260
- const p = w.useMemo(() => ({
2219
+ const p = y.useMemo(() => ({
2261
2220
  onKeyDown() {
2262
- u.current = !0;
2221
+ c.current = !0;
2263
2222
  },
2264
2223
  onWheel() {
2265
- u.current = !1;
2224
+ c.current = !1;
2266
2225
  },
2267
2226
  onPointerMove() {
2268
- u.current = !1;
2227
+ c.current = !1;
2269
2228
  },
2270
2229
  onScroll() {
2271
- const f = (s == null ? void 0 : s.current) || o.floating;
2272
- if (!(!r.current || !f || !u.current)) {
2273
- if (c.current !== null) {
2274
- const m = f.scrollTop - c.current;
2275
- (r.current.bottom < -0.5 && m < -1 || r.current.top < -0.5 && m > 1) && Xe.flushSync(() => a((h) => h + m));
2230
+ const u = (s == null ? void 0 : s.current) || o.floating;
2231
+ if (!(!r.current || !u || !c.current)) {
2232
+ if (f.current !== null) {
2233
+ const m = u.scrollTop - f.current;
2234
+ (r.current.bottom < -0.5 && m < -1 || r.current.top < -0.5 && m > 1) && Ne.flushSync(() => a((h) => h + m));
2276
2235
  }
2277
2236
  requestAnimationFrame(() => {
2278
- c.current = f.scrollTop;
2237
+ f.current = u.scrollTop;
2279
2238
  });
2280
2239
  }
2281
2240
  }
2282
2241
  }), [o.floating, a, r, s]);
2283
- return w.useMemo(() => i ? {
2242
+ return y.useMemo(() => i ? {
2284
2243
  floating: p
2285
2244
  } : {}, [i, p]);
2286
2245
  }
2287
- let Ue = he({ styles: void 0, setReference: () => {
2246
+ let Ue = ge({ styles: void 0, setReference: () => {
2288
2247
  }, setFloating: () => {
2289
2248
  }, getReferenceProps: () => ({}), getFloatingProps: () => ({}), slot: {} });
2290
2249
  Ue.displayName = "FloatingContext";
2291
- let Tt = he(null);
2292
- Tt.displayName = "PlacementContext";
2293
- function Bi(e) {
2294
- return X(() => e ? typeof e == "string" ? { to: e } : e : null, [e]);
2250
+ let Ot = ge(null);
2251
+ Ot.displayName = "PlacementContext";
2252
+ function zi(e) {
2253
+ return q(() => e ? typeof e == "string" ? { to: e } : e : null, [e]);
2295
2254
  }
2296
- function Wi() {
2255
+ function Hi() {
2297
2256
  return le(Ue).setReference;
2298
2257
  }
2299
- function ji() {
2258
+ function Vi() {
2300
2259
  let { getFloatingProps: e, slot: t } = le(Ue);
2301
- return Ne((...n) => Object.assign({}, e(...n), { "data-anchor": t.anchor }), [e, t]);
2260
+ return ke((...n) => Object.assign({}, e(...n), { "data-anchor": t.anchor }), [e, t]);
2302
2261
  }
2303
- function Ui(e = null) {
2262
+ function Wi(e = null) {
2304
2263
  e === !1 && (e = null), typeof e == "string" && (e = { to: e });
2305
- let t = le(Tt), n = X(() => e, [JSON.stringify(e, (i, r) => {
2306
- var s;
2307
- return (s = r == null ? void 0 : r.outerHTML) != null ? s : r;
2308
- })]);
2309
- U(() => {
2264
+ let t = le(Ot), n = q(() => e, [JSON.stringify(e, typeof HTMLElement < "u" ? (i, r) => r instanceof HTMLElement ? r.outerHTML : r : void 0)]);
2265
+ B(() => {
2310
2266
  t == null || t(n ?? null);
2311
2267
  }, [t, n]);
2312
2268
  let o = le(Ue);
2313
- return X(() => [o.setFloating, e ? o.styles : {}], [o.setFloating, e, o.styles]);
2314
- }
2315
- let Xt = 4;
2316
- function Yi({ children: e, enabled: t = !0 }) {
2317
- let [n, o] = ce(null), [i, r] = ce(0), s = J(null), [l, a] = ce(null);
2318
- qi(l);
2319
- let u = t && n !== null && l !== null, { to: c = "bottom", gap: d = 0, offset: p = 0, padding: f = 0, inner: m } = Ki(n, l), [h, g = "center"] = c.split(" ");
2320
- U(() => {
2321
- u && r(0);
2322
- }, [u]);
2323
- let { refs: v, floatingStyles: y, context: b } = ki({ open: u, placement: h === "selection" ? g === "center" ? "bottom" : `bottom-${g}` : g === "center" ? `${h}` : `${h}-${g}`, strategy: "absolute", transform: !1, middleware: [yn({ mainAxis: h === "selection" ? 0 : d, crossAxis: p }), wi({ padding: f }), h !== "selection" && yi({ padding: f }), h === "selection" && m ? Hi({ ...m, padding: f, overflowRef: s, offset: i, minItemsVisible: Xt, referenceOverflowThreshold: f, onFallbackChange(D) {
2324
- var k, F;
2269
+ return q(() => [o.setFloating, e ? o.styles : {}], [o.setFloating, e, o.styles]);
2270
+ }
2271
+ let qt = 4;
2272
+ function Bi({ children: e, enabled: t = !0 }) {
2273
+ let [n, o] = ae(null), [i, r] = ae(0), s = K(null), [l, a] = ae(null);
2274
+ ji(l);
2275
+ let c = t && n !== null && l !== null, { to: f = "bottom", gap: d = 0, offset: p = 0, padding: u = 0, inner: m } = Ui(n, l), [h, g = "center"] = f.split(" ");
2276
+ B(() => {
2277
+ c && r(0);
2278
+ }, [c]);
2279
+ let { refs: v, floatingStyles: E, context: b } = Li({ open: c, placement: h === "selection" ? g === "center" ? "bottom" : `bottom-${g}` : g === "center" ? `${h}` : `${h}-${g}`, strategy: "absolute", transform: !1, middleware: [xn({ mainAxis: h === "selection" ? 0 : d, crossAxis: p }), bi({ padding: u }), h !== "selection" && xi({ padding: u }), h === "selection" && m ? ki({ ...m, padding: u, overflowRef: s, offset: i, minItemsVisible: qt, referenceOverflowThreshold: u, onFallbackChange(D) {
2280
+ var k, z;
2325
2281
  if (!D) return;
2326
- let x = b.elements.floating;
2327
- if (!x) return;
2328
- let B = parseFloat(getComputedStyle(x).scrollPaddingBottom) || 0, _ = Math.min(Xt, x.childElementCount), z = 0, P = 0;
2329
- for (let $ of (F = (k = b.elements.floating) == null ? void 0 : k.childNodes) != null ? F : []) if ($ instanceof HTMLElement) {
2330
- let H = $.offsetTop, Y = H + $.clientHeight + B, ge = x.scrollTop, R = ge + x.clientHeight;
2331
- if (H >= ge && Y <= R) _--;
2282
+ let w = b.elements.floating;
2283
+ if (!w) return;
2284
+ let F = parseFloat(getComputedStyle(w).scrollPaddingBottom) || 0, j = Math.min(qt, w.childElementCount), P = 0, L = 0;
2285
+ for (let A of (z = (k = b.elements.floating) == null ? void 0 : k.childNodes) != null ? z : []) if (A instanceof HTMLElement) {
2286
+ let J = A.offsetTop, U = J + A.clientHeight + F, ve = w.scrollTop, R = ve + w.clientHeight;
2287
+ if (J >= ve && U <= R) j--;
2332
2288
  else {
2333
- P = Math.max(0, Math.min(Y, R) - Math.max(H, ge)), z = $.clientHeight;
2289
+ L = Math.max(0, Math.min(U, R) - Math.max(J, ve)), P = A.clientHeight;
2334
2290
  break;
2335
2291
  }
2336
2292
  }
2337
- _ >= 1 && r(($) => {
2338
- let H = z * _ - P + B;
2339
- return $ >= H ? $ : H;
2293
+ j >= 1 && r((A) => {
2294
+ let J = P * j - L + F;
2295
+ return A >= J ? A : J;
2340
2296
  });
2341
- } }) : null, Ei({ padding: f, apply({ availableWidth: D, availableHeight: k, elements: F }) {
2342
- Object.assign(F.floating.style, { overflow: "auto", maxWidth: `${D}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${k}px)` });
2343
- } })].filter(Boolean), whileElementsMounted: mi }), [E = h, O = g] = b.placement.split("-");
2344
- h === "selection" && (E = "selection");
2345
- let C = X(() => ({ anchor: [E, O].filter(Boolean).join(" ") }), [E, O]), T = Vi(b, { overflowRef: s, onChange: r }), { getReferenceProps: S, getFloatingProps: L } = zi([T]), A = M((D) => {
2297
+ } }) : null, wi({ padding: u, apply({ availableWidth: D, availableHeight: k, elements: z }) {
2298
+ Object.assign(z.floating.style, { overflow: "auto", maxWidth: `${D}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${k}px)` });
2299
+ } })].filter(Boolean), whileElementsMounted: fi }), [x = h, O = g] = b.placement.split("-");
2300
+ h === "selection" && (x = "selection");
2301
+ let S = q(() => ({ anchor: [x, O].filter(Boolean).join(" ") }), [x, O]), M = Ni(b, { overflowRef: s, onChange: r }), { getReferenceProps: C, getFloatingProps: N } = _i([M]), $ = I((D) => {
2346
2302
  a(D), v.setFloating(D);
2347
2303
  });
2348
- return w.createElement(Tt.Provider, { value: o }, w.createElement(Ue.Provider, { value: { setFloating: A, setReference: v.setReference, styles: y, getReferenceProps: S, getFloatingProps: L, slot: C } }, e));
2304
+ return y.createElement(Ot.Provider, { value: o }, y.createElement(Ue.Provider, { value: { setFloating: $, setReference: v.setReference, styles: E, getReferenceProps: C, getFloatingProps: N, slot: S } }, e));
2349
2305
  }
2350
- function qi(e) {
2351
- U(() => {
2306
+ function ji(e) {
2307
+ B(() => {
2352
2308
  if (!e) return;
2353
2309
  let t = new MutationObserver(() => {
2354
2310
  let n = window.getComputedStyle(e).maxHeight, o = parseFloat(n);
@@ -2361,91 +2317,91 @@ function qi(e) {
2361
2317
  };
2362
2318
  }, [e]);
2363
2319
  }
2364
- function Ki(e, t) {
2320
+ function Ui(e, t) {
2365
2321
  var n, o, i;
2366
- let r = dt((n = e == null ? void 0 : e.gap) != null ? n : "var(--anchor-gap, 0)", t), s = dt((o = e == null ? void 0 : e.offset) != null ? o : "var(--anchor-offset, 0)", t), l = dt((i = e == null ? void 0 : e.padding) != null ? i : "var(--anchor-padding, 0)", t);
2322
+ let r = ut((n = e == null ? void 0 : e.gap) != null ? n : "var(--anchor-gap, 0)", t), s = ut((o = e == null ? void 0 : e.offset) != null ? o : "var(--anchor-offset, 0)", t), l = ut((i = e == null ? void 0 : e.padding) != null ? i : "var(--anchor-padding, 0)", t);
2367
2323
  return { ...e, gap: r, offset: s, padding: l };
2368
2324
  }
2369
- function dt(e, t, n = void 0) {
2370
- let o = Zt(), i = M((a, u) => {
2325
+ function ut(e, t, n = void 0) {
2326
+ let o = Xt(), i = I((a, c) => {
2371
2327
  if (a == null) return [n, null];
2372
2328
  if (typeof a == "number") return [a, null];
2373
2329
  if (typeof a == "string") {
2374
- if (!u) return [n, null];
2375
- let c = Jt(a, u);
2376
- return [c, (d) => {
2377
- let p = Sn(a);
2330
+ if (!c) return [n, null];
2331
+ let f = Kt(a, c);
2332
+ return [f, (d) => {
2333
+ let p = yn(a);
2378
2334
  {
2379
- let f = p.map((m) => window.getComputedStyle(u).getPropertyValue(m));
2335
+ let u = p.map((m) => window.getComputedStyle(c).getPropertyValue(m));
2380
2336
  o.requestAnimationFrame(function m() {
2381
2337
  o.nextFrame(m);
2382
2338
  let h = !1;
2383
- for (let [v, y] of p.entries()) {
2384
- let b = window.getComputedStyle(u).getPropertyValue(y);
2385
- if (f[v] !== b) {
2386
- f[v] = b, h = !0;
2339
+ for (let [v, E] of p.entries()) {
2340
+ let b = window.getComputedStyle(c).getPropertyValue(E);
2341
+ if (u[v] !== b) {
2342
+ u[v] = b, h = !0;
2387
2343
  break;
2388
2344
  }
2389
2345
  }
2390
2346
  if (!h) return;
2391
- let g = Jt(a, u);
2392
- c !== g && (d(g), c = g);
2347
+ let g = Kt(a, c);
2348
+ f !== g && (d(g), f = g);
2393
2349
  });
2394
2350
  }
2395
2351
  return o.dispose;
2396
2352
  }];
2397
2353
  }
2398
2354
  return [n, null];
2399
- }), r = X(() => i(e, t)[0], [e, t]), [s = r, l] = ce();
2400
- return U(() => {
2401
- let [a, u] = i(e, t);
2402
- if (l(a), !!u) return u(l);
2355
+ }), r = q(() => i(e, t)[0], [e, t]), [s = r, l] = ae();
2356
+ return B(() => {
2357
+ let [a, c] = i(e, t);
2358
+ if (l(a), !!c) return c(l);
2403
2359
  }, [e, t]), s;
2404
2360
  }
2405
- function Sn(e) {
2361
+ function yn(e) {
2406
2362
  let t = /var\((.*)\)/.exec(e);
2407
2363
  if (t) {
2408
2364
  let n = t[1].indexOf(",");
2409
2365
  if (n === -1) return [t[1]];
2410
2366
  let o = t[1].slice(0, n).trim(), i = t[1].slice(n + 1).trim();
2411
- return i ? [o, ...Sn(i)] : [o];
2367
+ return i ? [o, ...yn(i)] : [o];
2412
2368
  }
2413
2369
  return [];
2414
2370
  }
2415
- function Jt(e, t) {
2371
+ function Kt(e, t) {
2416
2372
  let n = document.createElement("div");
2417
2373
  t.appendChild(n), n.style.setProperty("margin-top", "0px", "important"), n.style.setProperty("margin-top", e, "important");
2418
2374
  let o = parseFloat(window.getComputedStyle(n).marginTop) || 0;
2419
2375
  return t.removeChild(n), o;
2420
2376
  }
2421
- function Gi({ children: e, freeze: t }) {
2422
- let n = xt(t, e);
2423
- return j.createElement(j.Fragment, null, n);
2377
+ function Yi({ children: e, freeze: t }) {
2378
+ let n = ht(t, e);
2379
+ return W.createElement(W.Fragment, null, n);
2424
2380
  }
2425
- function xt(e, t) {
2426
- let [n, o] = ce(t);
2381
+ function ht(e, t) {
2382
+ let [n, o] = ae(t);
2427
2383
  return !e && n !== t && o(t), e ? n : t;
2428
2384
  }
2429
- function Xi(e) {
2385
+ function qi(e) {
2430
2386
  function t() {
2431
2387
  document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
2432
2388
  }
2433
2389
  typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
2434
2390
  }
2435
- let be = [];
2436
- Xi(() => {
2391
+ let xe = [];
2392
+ qi(() => {
2437
2393
  function e(t) {
2438
- if (!(t.target instanceof HTMLElement) || t.target === document.body || be[0] === t.target) return;
2394
+ if (!(t.target instanceof HTMLElement) || t.target === document.body || xe[0] === t.target) return;
2439
2395
  let n = t.target;
2440
- n = n.closest(Gn), be.unshift(n ?? t.target), be = be.filter((o) => o != null && o.isConnected), be.splice(10);
2396
+ n = n.closest(qn), xe.unshift(n ?? t.target), xe = xe.filter((o) => o != null && o.isConnected), xe.splice(10);
2441
2397
  }
2442
2398
  window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
2443
2399
  });
2444
- function Ji(e) {
2400
+ function Ki(e) {
2445
2401
  throw new Error("Unexpected object: " + e);
2446
2402
  }
2447
- var V = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(V || {});
2448
- function Qt(e, t) {
2403
+ var H = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(H || {});
2404
+ function Gt(e, t) {
2449
2405
  let n = t.resolveItems();
2450
2406
  if (n.length <= 0) return null;
2451
2407
  let o = t.resolveActiveIndex(), i = o ?? -1;
@@ -2474,35 +2430,35 @@ function Qt(e, t) {
2474
2430
  case 5:
2475
2431
  return null;
2476
2432
  default:
2477
- Ji(e);
2433
+ Ki(e);
2478
2434
  }
2479
2435
  }
2480
- var It = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(It || {});
2481
- function Qi(e) {
2482
- let t = M(e), n = J(!1);
2436
+ var St = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(St || {});
2437
+ function Gi(e) {
2438
+ let t = I(e), n = K(!1);
2483
2439
  oe(() => (n.current = !1, () => {
2484
- n.current = !0, An(() => {
2440
+ n.current = !0, Mn(() => {
2485
2441
  n.current && t();
2486
2442
  });
2487
2443
  }), [t]);
2488
2444
  }
2489
- function Zi() {
2445
+ function Xi() {
2490
2446
  let e = typeof document > "u";
2491
- return "useSyncExternalStore" in w ? ((t) => t.useSyncExternalStore)(w)(() => () => {
2447
+ return "useSyncExternalStore" in y ? ((t) => t.useSyncExternalStore)(y)(() => () => {
2492
2448
  }, () => !1, () => !e) : !1;
2493
2449
  }
2494
- function er() {
2495
- let e = Zi(), [t, n] = w.useState(Le.isHandoffComplete);
2496
- return t && Le.isHandoffComplete === !1 && n(!1), w.useEffect(() => {
2450
+ function Ji() {
2451
+ let e = Xi(), [t, n] = y.useState(Le.isHandoffComplete);
2452
+ return t && Le.isHandoffComplete === !1 && n(!1), y.useEffect(() => {
2497
2453
  t !== !0 && n(!0);
2498
- }, [t]), w.useEffect(() => Le.handoff(), []), e ? !1 : t;
2454
+ }, [t]), y.useEffect(() => Le.handoff(), []), e ? !1 : t;
2499
2455
  }
2500
- let tr = he(!1);
2501
- function nr() {
2502
- return le(tr);
2456
+ let Qi = ge(!1);
2457
+ function Zi() {
2458
+ return le(Qi);
2503
2459
  }
2504
- function or(e) {
2505
- let t = nr(), n = le(Cn), o = nt(e), [i, r] = ce(() => {
2460
+ function er(e) {
2461
+ let t = Zi(), n = le(Sn), o = nt(e), [i, r] = ae(() => {
2506
2462
  var s;
2507
2463
  if (!t && n !== null) return (s = n.current) != null ? s : null;
2508
2464
  if (Le.isServer) return null;
@@ -2518,38 +2474,38 @@ function or(e) {
2518
2474
  t || n !== null && r(n.current);
2519
2475
  }, [n, r, t]), i;
2520
2476
  }
2521
- let Rn = tt, ir = me(function(e, t) {
2522
- let n = e, o = J(null), i = Oe($n((c) => {
2523
- o.current = c;
2524
- }), t), r = nt(o), s = or(o), [l] = ce(() => {
2525
- var c;
2526
- return Le.isServer ? null : (c = r == null ? void 0 : r.createElement("div")) != null ? c : null;
2527
- }), a = le(ar), u = er();
2528
- return U(() => {
2477
+ let On = tt, tr = pe(function(e, t) {
2478
+ let n = e, o = K(null), i = Se(Pn((f) => {
2479
+ o.current = f;
2480
+ }), t), r = nt(o), s = er(o), [l] = ae(() => {
2481
+ var f;
2482
+ return Le.isServer ? null : (f = r == null ? void 0 : r.createElement("div")) != null ? f : null;
2483
+ }), a = le(rr), c = Ji();
2484
+ return B(() => {
2529
2485
  !s || !l || s.contains(l) || (l.setAttribute("data-headlessui-portal", ""), s.appendChild(l));
2530
- }, [s, l]), U(() => {
2486
+ }, [s, l]), B(() => {
2531
2487
  if (l && a) return a.register(l);
2532
- }, [a, l]), Qi(() => {
2533
- var c;
2534
- !s || !l || (l instanceof Node && s.contains(l) && s.removeChild(l), s.childNodes.length <= 0 && ((c = s.parentElement) == null || c.removeChild(s)));
2535
- }), u ? !s || !l ? null : _n(pe({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: Rn, name: "Portal" }), l) : null;
2488
+ }, [a, l]), Gi(() => {
2489
+ var f;
2490
+ !s || !l || (l instanceof Node && s.contains(l) && s.removeChild(l), s.childNodes.length <= 0 && ((f = s.parentElement) == null || f.removeChild(s)));
2491
+ }), c ? !s || !l ? null : Fn(he({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: On, name: "Portal" }), l) : null;
2536
2492
  });
2537
- function rr(e, t) {
2538
- let n = Oe(t), { enabled: o = !0, ...i } = e;
2539
- return o ? j.createElement(ir, { ...i, ref: n }) : pe({ ourProps: { ref: n }, theirProps: i, slot: {}, defaultTag: Rn, name: "Portal" });
2540
- }
2541
- let lr = tt, Cn = he(null);
2542
- function sr(e, t) {
2543
- let { target: n, ...o } = e, i = { ref: Oe(t) };
2544
- return j.createElement(Cn.Provider, { value: n }, pe({ ourProps: i, theirProps: o, defaultTag: lr, name: "Popover.Group" }));
2545
- }
2546
- let ar = he(null), cr = me(rr), ur = me(sr), fr = Object.assign(cr, { Group: ur });
2547
- var dr = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(dr || {}), mr = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(mr || {}), pr = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(pr || {}), hr = ((e) => (e[e.OpenCombobox = 0] = "OpenCombobox", e[e.CloseCombobox = 1] = "CloseCombobox", e[e.GoToOption = 2] = "GoToOption", e[e.SetTyping = 3] = "SetTyping", e[e.RegisterOption = 4] = "RegisterOption", e[e.UnregisterOption = 5] = "UnregisterOption", e[e.SetActivationTrigger = 6] = "SetActivationTrigger", e[e.UpdateVirtualConfiguration = 7] = "UpdateVirtualConfiguration", e[e.SetInputElement = 8] = "SetInputElement", e[e.SetButtonElement = 9] = "SetButtonElement", e[e.SetOptionsElement = 10] = "SetOptionsElement", e))(hr || {});
2548
- function mt(e, t = (n) => n) {
2549
- let n = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, o = t(e.options.slice()), i = o.length > 0 && o[0].dataRef.current.order !== null ? o.sort((s, l) => s.dataRef.current.order - l.dataRef.current.order) : Xn(o, (s) => s.dataRef.current.domRef.current), r = n ? i.indexOf(n) : null;
2493
+ function nr(e, t) {
2494
+ let n = Se(t), { enabled: o = !0, ...i } = e;
2495
+ return o ? W.createElement(tr, { ...i, ref: n }) : he({ ourProps: { ref: n }, theirProps: i, slot: {}, defaultTag: On, name: "Portal" });
2496
+ }
2497
+ let or = tt, Sn = ge(null);
2498
+ function ir(e, t) {
2499
+ let { target: n, ...o } = e, i = { ref: Se(t) };
2500
+ return W.createElement(Sn.Provider, { value: n }, he({ ourProps: i, theirProps: o, defaultTag: or, name: "Popover.Group" }));
2501
+ }
2502
+ let rr = ge(null), lr = pe(nr), sr = pe(ir), ar = Object.assign(lr, { Group: sr });
2503
+ var cr = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(cr || {}), ur = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(ur || {}), fr = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(fr || {}), dr = ((e) => (e[e.OpenCombobox = 0] = "OpenCombobox", e[e.CloseCombobox = 1] = "CloseCombobox", e[e.GoToOption = 2] = "GoToOption", e[e.SetTyping = 3] = "SetTyping", e[e.RegisterOption = 4] = "RegisterOption", e[e.UnregisterOption = 5] = "UnregisterOption", e[e.SetActivationTrigger = 6] = "SetActivationTrigger", e[e.UpdateVirtualConfiguration = 7] = "UpdateVirtualConfiguration", e[e.SetInputElement = 8] = "SetInputElement", e[e.SetButtonElement = 9] = "SetButtonElement", e[e.SetOptionsElement = 10] = "SetOptionsElement", e))(dr || {});
2504
+ function ft(e, t = (n) => n) {
2505
+ let n = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, o = t(e.options.slice()), i = o.length > 0 && o[0].dataRef.current.order !== null ? o.sort((s, l) => s.dataRef.current.order - l.dataRef.current.order) : Kn(o, (s) => s.dataRef.current.domRef.current), r = n ? i.indexOf(n) : null;
2550
2506
  return r === -1 && (r = null), { options: i, activeOptionIndex: r };
2551
2507
  }
2552
- let gr = { 1(e) {
2508
+ let mr = { 1(e) {
2553
2509
  var t;
2554
2510
  return (t = e.dataRef.current) != null && t.disabled || e.comboboxState === 1 ? e : { ...e, activeOptionIndex: null, comboboxState: 1, isTyping: !1, activationTrigger: 2, __demoMode: !1 };
2555
2511
  }, 0(e) {
@@ -2566,32 +2522,32 @@ let gr = { 1(e) {
2566
2522
  var n, o, i, r;
2567
2523
  if ((n = e.dataRef.current) != null && n.disabled || e.optionsElement && !((o = e.dataRef.current) != null && o.optionsPropsRef.current.static) && e.comboboxState === 1) return e;
2568
2524
  if (e.virtual) {
2569
- let { options: u, disabled: c } = e.virtual, d = t.focus === V.Specific ? t.idx : Qt(t, { resolveItems: () => u, resolveActiveIndex: () => {
2570
- var f, m;
2571
- return (m = (f = e.activeOptionIndex) != null ? f : u.findIndex((h) => !c(h))) != null ? m : null;
2572
- }, resolveDisabled: c, resolveId() {
2525
+ let { options: c, disabled: f } = e.virtual, d = t.focus === H.Specific ? t.idx : Gt(t, { resolveItems: () => c, resolveActiveIndex: () => {
2526
+ var u, m;
2527
+ return (m = (u = e.activeOptionIndex) != null ? u : c.findIndex((h) => !f(h))) != null ? m : null;
2528
+ }, resolveDisabled: f, resolveId() {
2573
2529
  throw new Error("Function not implemented.");
2574
2530
  } }), p = (i = t.trigger) != null ? i : 2;
2575
2531
  return e.activeOptionIndex === d && e.activationTrigger === p ? e : { ...e, activeOptionIndex: d, activationTrigger: p, isTyping: !1, __demoMode: !1 };
2576
2532
  }
2577
- let s = mt(e);
2533
+ let s = ft(e);
2578
2534
  if (s.activeOptionIndex === null) {
2579
- let u = s.options.findIndex((c) => !c.dataRef.current.disabled);
2580
- u !== -1 && (s.activeOptionIndex = u);
2535
+ let c = s.options.findIndex((f) => !f.dataRef.current.disabled);
2536
+ c !== -1 && (s.activeOptionIndex = c);
2581
2537
  }
2582
- let l = t.focus === V.Specific ? t.idx : Qt(t, { resolveItems: () => s.options, resolveActiveIndex: () => s.activeOptionIndex, resolveId: (u) => u.id, resolveDisabled: (u) => u.dataRef.current.disabled }), a = (r = t.trigger) != null ? r : 2;
2538
+ let l = t.focus === H.Specific ? t.idx : Gt(t, { resolveItems: () => s.options, resolveActiveIndex: () => s.activeOptionIndex, resolveId: (c) => c.id, resolveDisabled: (c) => c.dataRef.current.disabled }), a = (r = t.trigger) != null ? r : 2;
2583
2539
  return e.activeOptionIndex === l && e.activationTrigger === a ? e : { ...e, ...s, isTyping: !1, activeOptionIndex: l, activationTrigger: a, __demoMode: !1 };
2584
2540
  }, 4: (e, t) => {
2585
2541
  var n, o, i;
2586
2542
  if ((n = e.dataRef.current) != null && n.virtual) return { ...e, options: [...e.options, t.payload] };
2587
- let r = t.payload, s = mt(e, (a) => (a.push(r), a));
2543
+ let r = t.payload, s = ft(e, (a) => (a.push(r), a));
2588
2544
  e.activeOptionIndex === null && (o = e.dataRef.current) != null && o.isSelected(t.payload.dataRef.current.value) && (s.activeOptionIndex = s.options.indexOf(r));
2589
2545
  let l = { ...e, ...s, activationTrigger: 2 };
2590
2546
  return (i = e.dataRef.current) != null && i.__demoMode && e.dataRef.current.value === void 0 && (l.activeOptionIndex = 0), l;
2591
2547
  }, 5: (e, t) => {
2592
2548
  var n;
2593
2549
  if ((n = e.dataRef.current) != null && n.virtual) return { ...e, options: e.options.filter((i) => i.id !== t.id) };
2594
- let o = mt(e, (i) => {
2550
+ let o = ft(e, (i) => {
2595
2551
  let r = i.findIndex((s) => s.id === t.id);
2596
2552
  return r !== -1 && i.splice(r, 1), i;
2597
2553
  });
@@ -2606,291 +2562,294 @@ let gr = { 1(e) {
2606
2562
  r !== -1 ? i = r : i = null;
2607
2563
  }
2608
2564
  return { ...e, activeOptionIndex: i, virtual: { options: t.options, disabled: (o = t.disabled) != null ? o : () => !1 } };
2609
- }, 8: (e, t) => e.inputElement === t.element ? e : { ...e, inputElement: t.element }, 9: (e, t) => e.buttonElement === t.element ? e : { ...e, buttonElement: t.element }, 10: (e, t) => e.optionsElement === t.element ? e : { ...e, optionsElement: t.element } }, Mt = he(null);
2610
- Mt.displayName = "ComboboxActionsContext";
2565
+ }, 8: (e, t) => e.inputElement === t.element ? e : { ...e, inputElement: t.element }, 9: (e, t) => e.buttonElement === t.element ? e : { ...e, buttonElement: t.element }, 10: (e, t) => e.optionsElement === t.element ? e : { ...e, optionsElement: t.element } }, Rt = ge(null);
2566
+ Rt.displayName = "ComboboxActionsContext";
2611
2567
  function Ye(e) {
2612
- let t = le(Mt);
2568
+ let t = le(Rt);
2613
2569
  if (t === null) {
2614
2570
  let n = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
2615
2571
  throw Error.captureStackTrace && Error.captureStackTrace(n, Ye), n;
2616
2572
  }
2617
2573
  return t;
2618
2574
  }
2619
- let Tn = he(null);
2620
- function vr(e) {
2621
- let t = De("VirtualProvider"), { options: n } = t.virtual, [o, i] = X(() => {
2622
- let u = t.optionsElement;
2623
- if (!u) return [0, 0];
2624
- let c = window.getComputedStyle(u);
2625
- return [parseFloat(c.paddingBlockStart || c.paddingTop), parseFloat(c.paddingBlockEnd || c.paddingBottom)];
2626
- }, [t.optionsElement]), r = vo({ enabled: n.length !== 0, scrollPaddingStart: o, scrollPaddingEnd: i, count: n.length, estimateSize() {
2575
+ let Rn = ge(null);
2576
+ function pr(e) {
2577
+ let t = $e("VirtualProvider"), { options: n } = t.virtual, [o, i] = q(() => {
2578
+ let c = t.optionsElement;
2579
+ if (!c) return [0, 0];
2580
+ let f = window.getComputedStyle(c);
2581
+ return [parseFloat(f.paddingBlockStart || f.paddingTop), parseFloat(f.paddingBlockEnd || f.paddingBottom)];
2582
+ }, [t.optionsElement]), r = ho({ enabled: n.length !== 0, scrollPaddingStart: o, scrollPaddingEnd: i, count: n.length, estimateSize() {
2627
2583
  return 40;
2628
2584
  }, getScrollElement() {
2629
2585
  return t.optionsElement;
2630
- }, overscan: 12 }), [s, l] = ce(0);
2631
- U(() => {
2632
- l((u) => u + 1);
2586
+ }, overscan: 12 }), [s, l] = ae(0);
2587
+ B(() => {
2588
+ l((c) => c + 1);
2633
2589
  }, [n]);
2634
2590
  let a = r.getVirtualItems();
2635
- return a.length === 0 ? null : j.createElement(Tn.Provider, { value: r }, j.createElement("div", { style: { position: "relative", width: "100%", height: `${r.getTotalSize()}px` }, ref: (u) => {
2636
- u && t.activationTrigger !== 0 && t.activeOptionIndex !== null && n.length > t.activeOptionIndex && r.scrollToIndex(t.activeOptionIndex);
2637
- } }, a.map((u) => {
2638
- var c;
2639
- return j.createElement(tt, { key: u.key }, j.cloneElement((c = e.children) == null ? void 0 : c.call(e, { ...e.slot, option: n[u.index] }), { key: `${s}-${u.key}`, "data-index": u.index, "aria-setsize": n.length, "aria-posinset": u.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${u.start}px)`, overflowAnchor: "none" } }));
2591
+ return a.length === 0 ? null : W.createElement(Rn.Provider, { value: r }, W.createElement("div", { style: { position: "relative", width: "100%", height: `${r.getTotalSize()}px` }, ref: (c) => {
2592
+ if (c) {
2593
+ if (typeof process < "u" && process.env.JEST_WORKER_ID !== void 0 || t.activationTrigger === 0) return;
2594
+ t.activeOptionIndex !== null && n.length > t.activeOptionIndex && r.scrollToIndex(t.activeOptionIndex);
2595
+ }
2596
+ } }, a.map((c) => {
2597
+ var f;
2598
+ return W.createElement(tt, { key: c.key }, W.cloneElement((f = e.children) == null ? void 0 : f.call(e, { ...e.slot, option: n[c.index] }), { key: `${s}-${c.key}`, "data-index": c.index, "aria-setsize": n.length, "aria-posinset": c.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${c.start}px)`, overflowAnchor: "none" } }));
2640
2599
  })));
2641
2600
  }
2642
- let Ve = he(null);
2601
+ let Ve = ge(null);
2643
2602
  Ve.displayName = "ComboboxDataContext";
2644
- function De(e) {
2603
+ function $e(e) {
2645
2604
  let t = le(Ve);
2646
2605
  if (t === null) {
2647
2606
  let n = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
2648
- throw Error.captureStackTrace && Error.captureStackTrace(n, De), n;
2607
+ throw Error.captureStackTrace && Error.captureStackTrace(n, $e), n;
2649
2608
  }
2650
2609
  return t;
2651
2610
  }
2652
- function br(e, t) {
2653
- return Re(t.type, gr, e, t);
2611
+ function hr(e, t) {
2612
+ return Re(t.type, mr, e, t);
2654
2613
  }
2655
- let xr = tt;
2656
- function wr(e, t) {
2614
+ let gr = tt;
2615
+ function vr(e, t) {
2657
2616
  var n, o;
2658
- let i = Hn(), { value: r, defaultValue: s, onChange: l, form: a, name: u, by: c, disabled: d = i || !1, onClose: p, __demoMode: f = !1, multiple: m = !1, immediate: h = !1, virtual: g = null, nullable: v, ...y } = e, b = Vn(s), [E = m ? [] : void 0, O] = Bn(r, l, b), [C, T] = nn(br, { dataRef: Ln(), comboboxState: f ? 0 : 1, isTyping: !1, options: [], virtual: g ? { options: g.options, disabled: (n = g.disabled) != null ? n : () => !1 } : null, activeOptionIndex: null, activationTrigger: 2, inputElement: null, buttonElement: null, optionsElement: null, __demoMode: f }), S = J(!1), L = J({ static: !1, hold: !1 }), A = kn(c), D = M((I) => g ? c === null ? g.options.indexOf(I) : g.options.findIndex((N) => A(N, I)) : C.options.findIndex((N) => A(N.dataRef.current.value, I))), k = Ne((I) => Re(x.mode, { 1: () => E.some((N) => A(N, I)), 0: () => A(E, I) }), [E]), F = M((I) => C.activeOptionIndex === D(I)), x = X(() => ({ ...C, immediate: h, optionsPropsRef: L, value: E, defaultValue: b, disabled: d, mode: m ? 1 : 0, virtual: g ? C.virtual : null, get activeOptionIndex() {
2659
- if (S.current && C.activeOptionIndex === null && (g ? g.options.length > 0 : C.options.length > 0)) {
2617
+ let i = Nn(), { value: r, defaultValue: s, onChange: l, form: a, name: c, by: f, disabled: d = i || !1, onClose: p, __demoMode: u = !1, multiple: m = !1, immediate: h = !1, virtual: g = null, nullable: v, ...E } = e, b = zn(s), [x = m ? [] : void 0, O] = Hn(r, l, b), [S, M] = Zt(hr, { dataRef: Dn(), comboboxState: u ? 0 : 1, isTyping: !1, options: [], virtual: g ? { options: g.options, disabled: (n = g.disabled) != null ? n : () => !1 } : null, activeOptionIndex: null, activationTrigger: 2, inputElement: null, buttonElement: null, optionsElement: null, __demoMode: u }), C = K(!1), N = K({ static: !1, hold: !1 }), $ = _n(f), D = I((T) => g ? f === null ? g.options.indexOf(T) : g.options.findIndex((_) => $(_, T)) : S.options.findIndex((_) => $(_.dataRef.current.value, T))), k = ke((T) => Re(w.mode, { 1: () => x.some((_) => $(_, T)), 0: () => $(x, T) }), [x]), z = I((T) => S.activeOptionIndex === D(T)), w = q(() => ({ ...S, immediate: h, optionsPropsRef: N, value: x, defaultValue: b, disabled: d, mode: m ? 1 : 0, virtual: g ? S.virtual : null, get activeOptionIndex() {
2618
+ if (C.current && S.activeOptionIndex === null && (g ? g.options.length > 0 : S.options.length > 0)) {
2660
2619
  if (g) {
2661
- let N = g.options.findIndex((re) => {
2662
- var qe, Pt;
2663
- return !((Pt = (qe = g.disabled) == null ? void 0 : qe.call(g, re)) != null && Pt);
2620
+ let _ = g.options.findIndex((re) => {
2621
+ var qe, Ct;
2622
+ return !((Ct = (qe = g.disabled) == null ? void 0 : qe.call(g, re)) != null && Ct);
2664
2623
  });
2665
- if (N !== -1) return N;
2624
+ if (_ !== -1) return _;
2666
2625
  }
2667
- let I = C.options.findIndex((N) => !N.dataRef.current.disabled);
2668
- if (I !== -1) return I;
2626
+ let T = S.options.findIndex((_) => !_.dataRef.current.disabled);
2627
+ if (T !== -1) return T;
2669
2628
  }
2670
- return C.activeOptionIndex;
2671
- }, calculateIndex: D, compare: A, isSelected: k, isActive: F }), [E, b, d, m, f, C, g]);
2672
- U(() => {
2673
- var I;
2674
- g && T({ type: 7, options: g.options, disabled: (I = g.disabled) != null ? I : null });
2675
- }, [g, g == null ? void 0 : g.options, g == null ? void 0 : g.disabled]), U(() => {
2676
- C.dataRef.current = x;
2677
- }, [x]);
2678
- let B = x.comboboxState === 0;
2679
- Ro(B, [x.buttonElement, x.inputElement, x.optionsElement], () => Q.closeCombobox());
2680
- let _ = X(() => {
2681
- var I, N, re;
2682
- return { open: x.comboboxState === 0, disabled: d, activeIndex: x.activeOptionIndex, activeOption: x.activeOptionIndex === null ? null : x.virtual ? x.virtual.options[(I = x.activeOptionIndex) != null ? I : 0] : (re = (N = x.options[x.activeOptionIndex]) == null ? void 0 : N.dataRef.current.value) != null ? re : null, value: E };
2683
- }, [x, d, E]), z = M(() => {
2684
- if (x.activeOptionIndex !== null) {
2685
- if (Q.setIsTyping(!1), x.virtual) R(x.virtual.options[x.activeOptionIndex]);
2629
+ return S.activeOptionIndex;
2630
+ }, calculateIndex: D, compare: $, isSelected: k, isActive: z }), [x, b, d, m, u, S, g]);
2631
+ B(() => {
2632
+ var T;
2633
+ g && M({ type: 7, options: g.options, disabled: (T = g.disabled) != null ? T : null });
2634
+ }, [g, g == null ? void 0 : g.options, g == null ? void 0 : g.disabled]), B(() => {
2635
+ S.dataRef.current = w;
2636
+ }, [w]);
2637
+ let F = w.comboboxState === 0;
2638
+ Oo(F, [w.buttonElement, w.inputElement, w.optionsElement], () => G.closeCombobox());
2639
+ let j = q(() => {
2640
+ var T, _, re;
2641
+ return { open: w.comboboxState === 0, disabled: d, activeIndex: w.activeOptionIndex, activeOption: w.activeOptionIndex === null ? null : w.virtual ? w.virtual.options[(T = w.activeOptionIndex) != null ? T : 0] : (re = (_ = w.options[w.activeOptionIndex]) == null ? void 0 : _.dataRef.current.value) != null ? re : null, value: x };
2642
+ }, [w, d, x]), P = I(() => {
2643
+ if (w.activeOptionIndex !== null) {
2644
+ if (G.setIsTyping(!1), w.virtual) R(w.virtual.options[w.activeOptionIndex]);
2686
2645
  else {
2687
- let { dataRef: I } = x.options[x.activeOptionIndex];
2688
- R(I.current.value);
2646
+ let { dataRef: T } = w.options[w.activeOptionIndex];
2647
+ R(T.current.value);
2689
2648
  }
2690
- Q.goToOption(V.Specific, x.activeOptionIndex);
2649
+ G.goToOption(H.Specific, w.activeOptionIndex);
2691
2650
  }
2692
- }), P = M(() => {
2693
- T({ type: 0 }), S.current = !0;
2694
- }), $ = M(() => {
2695
- T({ type: 1 }), S.current = !1, p == null || p();
2696
- }), H = M((I) => {
2697
- T({ type: 3, isTyping: I });
2698
- }), Y = M((I, N, re) => (S.current = !1, I === V.Specific ? T({ type: 2, focus: V.Specific, idx: N, trigger: re }) : T({ type: 2, focus: I, trigger: re }))), ge = M((I, N) => (T({ type: 4, payload: { id: I, dataRef: N } }), () => {
2699
- x.isActive(N.current.value) && (S.current = !0), T({ type: 5, id: I });
2700
- })), R = M((I) => Re(x.mode, { 0() {
2701
- return O == null ? void 0 : O(I);
2651
+ }), L = I(() => {
2652
+ M({ type: 0 }), C.current = !0;
2653
+ }), A = I(() => {
2654
+ M({ type: 1 }), C.current = !1, p == null || p();
2655
+ }), J = I((T) => {
2656
+ M({ type: 3, isTyping: T });
2657
+ }), U = I((T, _, re) => (C.current = !1, T === H.Specific ? M({ type: 2, focus: H.Specific, idx: _, trigger: re }) : M({ type: 2, focus: T, trigger: re }))), ve = I((T, _) => (M({ type: 4, payload: { id: T, dataRef: _ } }), () => {
2658
+ w.isActive(_.current.value) && (C.current = !0), M({ type: 5, id: T });
2659
+ })), R = I((T) => Re(w.mode, { 0() {
2660
+ return O == null ? void 0 : O(T);
2702
2661
  }, 1() {
2703
- let N = x.value.slice(), re = N.findIndex((qe) => A(qe, I));
2704
- return re === -1 ? N.push(I) : N.splice(re, 1), O == null ? void 0 : O(N);
2705
- } })), te = M((I) => {
2706
- T({ type: 6, trigger: I });
2707
- }), q = M((I) => {
2708
- T({ type: 8, element: I });
2709
- }), ne = M((I) => {
2710
- T({ type: 9, element: I });
2711
- }), W = M((I) => {
2712
- T({ type: 10, element: I });
2713
- }), Q = X(() => ({ onChange: R, registerOption: ge, goToOption: Y, setIsTyping: H, closeCombobox: $, openCombobox: P, setActivationTrigger: te, selectActiveOption: z, setInputElement: q, setButtonElement: ne, setOptionsElement: W }), []), [ve, In] = Wn(), Mn = t === null ? {} : { ref: t }, Pn = Ne(() => {
2662
+ let _ = w.value.slice(), re = _.findIndex((qe) => $(qe, T));
2663
+ return re === -1 ? _.push(T) : _.splice(re, 1), O == null ? void 0 : O(_);
2664
+ } })), te = I((T) => {
2665
+ M({ type: 6, trigger: T });
2666
+ }), Y = I((T) => {
2667
+ M({ type: 8, element: T });
2668
+ }), ne = I((T) => {
2669
+ M({ type: 9, element: T });
2670
+ }), V = I((T) => {
2671
+ M({ type: 10, element: T });
2672
+ }), G = q(() => ({ onChange: R, registerOption: ve, goToOption: U, setIsTyping: J, closeCombobox: A, openCombobox: L, setActivationTrigger: te, selectActiveOption: P, setInputElement: Y, setButtonElement: ne, setOptionsElement: V }), []), [be, Cn] = Vn(), Tn = t === null ? {} : { ref: t }, In = ke(() => {
2714
2673
  if (b !== void 0) return O == null ? void 0 : O(b);
2715
2674
  }, [O, b]);
2716
- return j.createElement(In, { value: ve, props: { htmlFor: (o = x.inputElement) == null ? void 0 : o.id }, slot: { open: x.comboboxState === 0, disabled: d } }, j.createElement(Yi, null, j.createElement(Mt.Provider, { value: Q }, j.createElement(Ve.Provider, { value: x }, j.createElement(Qn, { value: Re(x.comboboxState, { 0: Je.Open, 1: Je.Closed }) }, u != null && j.createElement(jn, { disabled: d, data: E != null ? { [u]: E } : {}, form: a, onReset: Pn }), pe({ ourProps: Mn, theirProps: y, slot: _, defaultTag: xr, name: "Combobox" }))))));
2675
+ return W.createElement(Cn, { value: be, props: { htmlFor: (o = w.inputElement) == null ? void 0 : o.id }, slot: { open: w.comboboxState === 0, disabled: d } }, W.createElement(Bi, null, W.createElement(Rt.Provider, { value: G }, W.createElement(Ve.Provider, { value: w }, W.createElement(Xn, { value: Re(w.comboboxState, { 0: Xe.Open, 1: Xe.Closed }) }, c != null && W.createElement(Wn, { disabled: d, data: x != null ? { [c]: x } : {}, form: a, onReset: In }), he({ ourProps: Tn, theirProps: E, slot: j, defaultTag: gr, name: "Combobox" }))))));
2717
2676
  }
2718
- let yr = "input";
2719
- function Er(e, t) {
2677
+ let br = "input";
2678
+ function xr(e, t) {
2720
2679
  var n, o, i, r, s;
2721
- let l = De("Combobox.Input"), a = Ye("Combobox.Input"), u = Be(), c = Un(), { id: d = c || `headlessui-combobox-input-${u}`, onChange: p, displayValue: f, disabled: m = l.disabled || !1, autoFocus: h = !1, type: g = "text", ...v } = e, y = J(null), b = Oe(y, t, Wi(), a.setInputElement), E = nt(l.inputElement), O = Zt(), C = M(() => {
2722
- a.onChange(null), l.optionsElement && (l.optionsElement.scrollTop = 0), a.goToOption(V.Nothing);
2723
- }), T = X(() => {
2680
+ let l = $e("Combobox.Input"), a = Ye("Combobox.Input"), c = We(), f = Bn(), { id: d = f || `headlessui-combobox-input-${c}`, onChange: p, displayValue: u, disabled: m = l.disabled || !1, autoFocus: h = !1, type: g = "text", ...v } = e, E = K(null), b = Se(E, t, Hi(), a.setInputElement), x = nt(l.inputElement), O = Xt(), S = I(() => {
2681
+ a.onChange(null), l.optionsElement && (l.optionsElement.scrollTop = 0), a.goToOption(H.Nothing);
2682
+ }), M = q(() => {
2724
2683
  var R;
2725
- return typeof f == "function" && l.value !== void 0 ? (R = f(l.value)) != null ? R : "" : typeof l.value == "string" ? l.value : "";
2726
- }, [l.value, f]);
2727
- kt(([R, te], [q, ne]) => {
2684
+ return typeof u == "function" && l.value !== void 0 ? (R = u(l.value)) != null ? R : "" : typeof l.value == "string" ? l.value : "";
2685
+ }, [l.value, u]);
2686
+ Ft(([R, te], [Y, ne]) => {
2728
2687
  if (l.isTyping) return;
2729
- let W = y.current;
2730
- W && ((ne === 0 && te === 1 || R !== q) && (W.value = R), requestAnimationFrame(() => {
2731
- if (l.isTyping || !W || (E == null ? void 0 : E.activeElement) !== W) return;
2732
- let { selectionStart: Q, selectionEnd: ve } = W;
2733
- Math.abs((ve ?? 0) - (Q ?? 0)) === 0 && Q === 0 && W.setSelectionRange(W.value.length, W.value.length);
2688
+ let V = E.current;
2689
+ V && ((ne === 0 && te === 1 || R !== Y) && (V.value = R), requestAnimationFrame(() => {
2690
+ if (l.isTyping || !V || (x == null ? void 0 : x.activeElement) !== V) return;
2691
+ let { selectionStart: G, selectionEnd: be } = V;
2692
+ Math.abs((be ?? 0) - (G ?? 0)) === 0 && G === 0 && V.setSelectionRange(V.value.length, V.value.length);
2734
2693
  }));
2735
- }, [T, l.comboboxState, E, l.isTyping]), kt(([R], [te]) => {
2694
+ }, [M, l.comboboxState, x, l.isTyping]), Ft(([R], [te]) => {
2736
2695
  if (R === 0 && te === 1) {
2737
2696
  if (l.isTyping) return;
2738
- let q = y.current;
2739
- if (!q) return;
2740
- let ne = q.value, { selectionStart: W, selectionEnd: Q, selectionDirection: ve } = q;
2741
- q.value = "", q.value = ne, ve !== null ? q.setSelectionRange(W, Q, ve) : q.setSelectionRange(W, Q);
2697
+ let Y = E.current;
2698
+ if (!Y) return;
2699
+ let ne = Y.value, { selectionStart: V, selectionEnd: G, selectionDirection: be } = Y;
2700
+ Y.value = "", Y.value = ne, be !== null ? Y.setSelectionRange(V, G, be) : Y.setSelectionRange(V, G);
2742
2701
  }
2743
2702
  }, [l.comboboxState]);
2744
- let S = J(!1), L = M(() => {
2745
- S.current = !0;
2746
- }), A = M(() => {
2703
+ let C = K(!1), N = I(() => {
2704
+ C.current = !0;
2705
+ }), $ = I(() => {
2747
2706
  O.nextFrame(() => {
2748
- S.current = !1;
2707
+ C.current = !1;
2749
2708
  });
2750
- }), D = M((R) => {
2709
+ }), D = I((R) => {
2751
2710
  switch (a.setIsTyping(!0), R.key) {
2752
- case Z.Enter:
2753
- if (l.comboboxState !== 0 || S.current) return;
2711
+ case Q.Enter:
2712
+ if (l.comboboxState !== 0 || C.current) return;
2754
2713
  if (R.preventDefault(), R.stopPropagation(), l.activeOptionIndex === null) {
2755
2714
  a.closeCombobox();
2756
2715
  return;
2757
2716
  }
2758
2717
  a.selectActiveOption(), l.mode === 0 && a.closeCombobox();
2759
2718
  break;
2760
- case Z.ArrowDown:
2761
- return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(V.Next), 1: () => a.openCombobox() });
2762
- case Z.ArrowUp:
2763
- return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(V.Previous), 1: () => {
2764
- xe(() => a.openCombobox()), l.value || a.goToOption(V.Last);
2719
+ case Q.ArrowDown:
2720
+ return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(H.Next), 1: () => a.openCombobox() });
2721
+ case Q.ArrowUp:
2722
+ return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(H.Previous), 1: () => {
2723
+ we(() => a.openCombobox()), l.value || a.goToOption(H.Last);
2765
2724
  } });
2766
- case Z.Home:
2725
+ case Q.Home:
2767
2726
  if (R.shiftKey) break;
2768
- return R.preventDefault(), R.stopPropagation(), a.goToOption(V.First);
2769
- case Z.PageUp:
2770
- return R.preventDefault(), R.stopPropagation(), a.goToOption(V.First);
2771
- case Z.End:
2727
+ return R.preventDefault(), R.stopPropagation(), a.goToOption(H.First);
2728
+ case Q.PageUp:
2729
+ return R.preventDefault(), R.stopPropagation(), a.goToOption(H.First);
2730
+ case Q.End:
2772
2731
  if (R.shiftKey) break;
2773
- return R.preventDefault(), R.stopPropagation(), a.goToOption(V.Last);
2774
- case Z.PageDown:
2775
- return R.preventDefault(), R.stopPropagation(), a.goToOption(V.Last);
2776
- case Z.Escape:
2777
- return l.comboboxState !== 0 ? void 0 : (R.preventDefault(), l.optionsElement && !l.optionsPropsRef.current.static && R.stopPropagation(), l.mode === 0 && l.value === null && C(), a.closeCombobox());
2778
- case Z.Tab:
2732
+ return R.preventDefault(), R.stopPropagation(), a.goToOption(H.Last);
2733
+ case Q.PageDown:
2734
+ return R.preventDefault(), R.stopPropagation(), a.goToOption(H.Last);
2735
+ case Q.Escape:
2736
+ return l.comboboxState !== 0 ? void 0 : (R.preventDefault(), l.optionsElement && !l.optionsPropsRef.current.static && R.stopPropagation(), l.mode === 0 && l.value === null && S(), a.closeCombobox());
2737
+ case Q.Tab:
2779
2738
  if (l.comboboxState !== 0) return;
2780
2739
  l.mode === 0 && l.activationTrigger !== 1 && a.selectActiveOption(), a.closeCombobox();
2781
2740
  break;
2782
2741
  }
2783
- }), k = M((R) => {
2784
- p == null || p(R), l.mode === 0 && R.target.value === "" && C(), a.openCombobox();
2785
- }), F = M((R) => {
2786
- var te, q, ne;
2787
- let W = (te = R.relatedTarget) != null ? te : be.find((Q) => Q !== R.currentTarget);
2788
- if (!((q = l.optionsElement) != null && q.contains(W)) && !((ne = l.buttonElement) != null && ne.contains(W)) && l.comboboxState === 0) return R.preventDefault(), l.mode === 0 && l.value === null && C(), a.closeCombobox();
2789
- }), x = M((R) => {
2790
- var te, q, ne;
2791
- let W = (te = R.relatedTarget) != null ? te : be.find((Q) => Q !== R.currentTarget);
2792
- (q = l.buttonElement) != null && q.contains(W) || (ne = l.optionsElement) != null && ne.contains(W) || l.disabled || l.immediate && l.comboboxState !== 0 && O.microTask(() => {
2793
- xe(() => a.openCombobox()), a.setActivationTrigger(1);
2742
+ }), k = I((R) => {
2743
+ p == null || p(R), l.mode === 0 && R.target.value === "" && S(), a.openCombobox();
2744
+ }), z = I((R) => {
2745
+ var te, Y, ne;
2746
+ let V = (te = R.relatedTarget) != null ? te : xe.find((G) => G !== R.currentTarget);
2747
+ if (!((Y = l.optionsElement) != null && Y.contains(V)) && !((ne = l.buttonElement) != null && ne.contains(V)) && l.comboboxState === 0) return R.preventDefault(), l.mode === 0 && l.value === null && S(), a.closeCombobox();
2748
+ }), w = I((R) => {
2749
+ var te, Y, ne;
2750
+ let V = (te = R.relatedTarget) != null ? te : xe.find((G) => G !== R.currentTarget);
2751
+ (Y = l.buttonElement) != null && Y.contains(V) || (ne = l.optionsElement) != null && ne.contains(V) || l.disabled || l.immediate && l.comboboxState !== 0 && O.microTask(() => {
2752
+ we(() => a.openCombobox()), a.setActivationTrigger(1);
2794
2753
  });
2795
- }), B = Et(), _ = Yn(), { isFocused: z, focusProps: P } = en({ autoFocus: h }), { isHovered: $, hoverProps: H } = tn({ isDisabled: m }), Y = X(() => ({ open: l.comboboxState === 0, disabled: m, hover: $, focus: z, autofocus: h }), [l, $, z, h, m]), ge = yt({ ref: b, id: d, role: "combobox", type: g, "aria-controls": (n = l.optionsElement) == null ? void 0 : n.id, "aria-expanded": l.comboboxState === 0, "aria-activedescendant": l.activeOptionIndex === null ? void 0 : l.virtual ? (o = l.options.find((R) => !R.dataRef.current.disabled && l.compare(R.dataRef.current.value, l.virtual.options[l.activeOptionIndex]))) == null ? void 0 : o.id : (i = l.options[l.activeOptionIndex]) == null ? void 0 : i.id, "aria-labelledby": B, "aria-describedby": _, "aria-autocomplete": "list", defaultValue: (s = (r = e.defaultValue) != null ? r : l.defaultValue !== void 0 ? f == null ? void 0 : f(l.defaultValue) : null) != null ? s : l.defaultValue, disabled: m || void 0, autoFocus: h, onCompositionStart: L, onCompositionEnd: A, onKeyDown: D, onChange: k, onFocus: x, onBlur: F }, P, H);
2796
- return pe({ ourProps: ge, theirProps: v, slot: Y, defaultTag: yr, name: "Combobox.Input" });
2754
+ }), F = bt(), j = jn(), { isFocused: P, focusProps: L } = Jt({ autoFocus: h }), { isHovered: A, hoverProps: J } = Qt({ isDisabled: m }), U = q(() => ({ open: l.comboboxState === 0, disabled: m, hover: A, focus: P, autofocus: h }), [l, A, P, h, m]), ve = vt({ ref: b, id: d, role: "combobox", type: g, "aria-controls": (n = l.optionsElement) == null ? void 0 : n.id, "aria-expanded": l.comboboxState === 0, "aria-activedescendant": l.activeOptionIndex === null ? void 0 : l.virtual ? (o = l.options.find((R) => !R.dataRef.current.disabled && l.compare(R.dataRef.current.value, l.virtual.options[l.activeOptionIndex]))) == null ? void 0 : o.id : (i = l.options[l.activeOptionIndex]) == null ? void 0 : i.id, "aria-labelledby": F, "aria-describedby": j, "aria-autocomplete": "list", defaultValue: (s = (r = e.defaultValue) != null ? r : l.defaultValue !== void 0 ? u == null ? void 0 : u(l.defaultValue) : null) != null ? s : l.defaultValue, disabled: m || void 0, autoFocus: h, onCompositionStart: N, onCompositionEnd: $, onKeyDown: D, onChange: k, onFocus: w, onBlur: z }, L, J);
2755
+ return he({ ourProps: ve, theirProps: v, slot: U, defaultTag: br, name: "Combobox.Input" });
2797
2756
  }
2798
- let Or = "button";
2799
- function Sr(e, t) {
2757
+ let wr = "button";
2758
+ function Er(e, t) {
2800
2759
  var n;
2801
- let o = De("Combobox.Button"), i = Ye("Combobox.Button"), r = Oe(t, i.setButtonElement), s = Dn(), l = Be(), { id: a = `headlessui-combobox-button-${l}`, disabled: u = o.disabled || !1, autoFocus: c = !1, ...d } = e, p = un(o.inputElement), f = M((S) => {
2802
- switch (S.key) {
2803
- case Z.Space:
2804
- case Z.Enter:
2805
- S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && xe(() => i.openCombobox()), p();
2760
+ let o = $e("Combobox.Button"), i = Ye("Combobox.Button"), r = Se(t, i.setButtonElement), s = An(), l = We(), { id: a = `headlessui-combobox-button-${l}`, disabled: c = o.disabled || !1, autoFocus: f = !1, ...d } = e, p = sn(o.inputElement), u = I((C) => {
2761
+ switch (C.key) {
2762
+ case Q.Space:
2763
+ case Q.Enter:
2764
+ C.preventDefault(), C.stopPropagation(), o.comboboxState === 1 && we(() => i.openCombobox()), p();
2806
2765
  return;
2807
- case Z.ArrowDown:
2808
- S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && (xe(() => i.openCombobox()), o.value || i.goToOption(V.First)), p();
2766
+ case Q.ArrowDown:
2767
+ C.preventDefault(), C.stopPropagation(), o.comboboxState === 1 && (we(() => i.openCombobox()), o.value || i.goToOption(H.First)), p();
2809
2768
  return;
2810
- case Z.ArrowUp:
2811
- S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && (xe(() => i.openCombobox()), o.value || i.goToOption(V.Last)), p();
2769
+ case Q.ArrowUp:
2770
+ C.preventDefault(), C.stopPropagation(), o.comboboxState === 1 && (we(() => i.openCombobox()), o.value || i.goToOption(H.Last)), p();
2812
2771
  return;
2813
- case Z.Escape:
2772
+ case Q.Escape:
2814
2773
  if (o.comboboxState !== 0) return;
2815
- S.preventDefault(), o.optionsElement && !o.optionsPropsRef.current.static && S.stopPropagation(), xe(() => i.closeCombobox()), p();
2774
+ C.preventDefault(), o.optionsElement && !o.optionsPropsRef.current.static && C.stopPropagation(), we(() => i.closeCombobox()), p();
2816
2775
  return;
2817
2776
  default:
2818
2777
  return;
2819
2778
  }
2820
- }), m = M((S) => {
2821
- S.preventDefault(), !no(S.currentTarget) && (S.button === It.Left && (o.comboboxState === 0 ? i.closeCombobox() : i.openCombobox()), p());
2822
- }), h = Et([a]), { isFocusVisible: g, focusProps: v } = en({ autoFocus: c }), { isHovered: y, hoverProps: b } = tn({ isDisabled: u }), { pressed: E, pressProps: O } = Nn({ disabled: u }), C = X(() => ({ open: o.comboboxState === 0, active: E || o.comboboxState === 0, disabled: u, value: o.value, hover: y, focus: g }), [o, y, g, E, u]), T = yt({ ref: r, id: a, type: Jn(e, o.buttonElement), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (n = o.optionsElement) == null ? void 0 : n.id, "aria-expanded": o.comboboxState === 0, "aria-labelledby": h, disabled: u || void 0, autoFocus: c, onMouseDown: m, onKeyDown: f }, v, b, O);
2823
- return pe({ mergeRefs: s, ourProps: T, theirProps: d, slot: C, defaultTag: Or, name: "Combobox.Button" });
2779
+ }), m = I((C) => {
2780
+ C.preventDefault(), !eo(C.currentTarget) && (C.button === St.Left && (o.comboboxState === 0 ? i.closeCombobox() : i.openCombobox()), p());
2781
+ }), h = bt([a]), { isFocusVisible: g, focusProps: v } = Jt({ autoFocus: f }), { isHovered: E, hoverProps: b } = Qt({ isDisabled: c }), { pressed: x, pressProps: O } = Ln({ disabled: c }), S = q(() => ({ open: o.comboboxState === 0, active: x || o.comboboxState === 0, disabled: c, value: o.value, hover: E, focus: g }), [o, E, g, x, c]), M = vt({ ref: r, id: a, type: Gn(e, o.buttonElement), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (n = o.optionsElement) == null ? void 0 : n.id, "aria-expanded": o.comboboxState === 0, "aria-labelledby": h, disabled: c || void 0, autoFocus: f, onMouseDown: m, onKeyDown: u }, v, b, O);
2782
+ return he({ mergeRefs: s, ourProps: M, theirProps: d, slot: S, defaultTag: wr, name: "Combobox.Button" });
2824
2783
  }
2825
- let Rr = "div", Cr = At.RenderStrategy | At.Static;
2826
- function Tr(e, t) {
2784
+ let yr = "div", Or = Tt.RenderStrategy | Tt.Static;
2785
+ function Sr(e, t) {
2827
2786
  var n, o, i;
2828
- let r = Be(), { id: s = `headlessui-combobox-options-${r}`, hold: l = !1, anchor: a, portal: u = !1, modal: c = !0, transition: d = !1, ...p } = e, f = De("Combobox.Options"), m = Ye("Combobox.Options"), h = Bi(a);
2829
- h && (u = !0);
2830
- let [g, v] = Ui(h), [y, b] = ce(null), E = ji(), O = Oe(t, h ? g : null, m.setOptionsElement, b), C = nt(f.optionsElement), T = Zn(), [S, L] = eo(d, y, T !== null ? (T & Je.Open) === Je.Open : f.comboboxState === 0);
2831
- Eo(S, f.inputElement, m.closeCombobox);
2832
- let A = f.__demoMode ? !1 : c && f.comboboxState === 0;
2833
- $o(A, C);
2834
- let D = f.__demoMode ? !1 : c && f.comboboxState === 0;
2835
- yo(D, { allowed: Ne(() => [f.inputElement, f.buttonElement, f.optionsElement], [f.inputElement, f.buttonElement, f.optionsElement]) }), U(() => {
2836
- var Y;
2837
- f.optionsPropsRef.current.static = (Y = e.static) != null ? Y : !1;
2838
- }, [f.optionsPropsRef, e.static]), U(() => {
2839
- f.optionsPropsRef.current.hold = l;
2840
- }, [f.optionsPropsRef, l]), Fo(f.comboboxState === 0, { container: f.optionsElement, accept(Y) {
2841
- return Y.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : Y.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
2842
- }, walk(Y) {
2843
- Y.setAttribute("role", "none");
2787
+ let r = We(), { id: s = `headlessui-combobox-options-${r}`, hold: l = !1, anchor: a, portal: c = !1, modal: f = !0, transition: d = !1, ...p } = e, u = $e("Combobox.Options"), m = Ye("Combobox.Options"), h = zi(a);
2788
+ h && (c = !0);
2789
+ let [g, v] = Wi(h), [E, b] = ae(null), x = Vi(), O = Se(t, h ? g : null, m.setOptionsElement, b), S = nt(u.optionsElement), M = Jn(), [C, N] = Qn(d, E, M !== null ? (M & Xe.Open) === Xe.Open : u.comboboxState === 0);
2790
+ wo(C, u.inputElement, m.closeCombobox);
2791
+ let $ = u.__demoMode ? !1 : f && u.comboboxState === 0;
2792
+ Po($, S);
2793
+ let D = u.__demoMode ? !1 : f && u.comboboxState === 0;
2794
+ xo(D, { allowed: ke(() => [u.inputElement, u.buttonElement, u.optionsElement], [u.inputElement, u.buttonElement, u.optionsElement]) }), B(() => {
2795
+ var U;
2796
+ u.optionsPropsRef.current.static = (U = e.static) != null ? U : !1;
2797
+ }, [u.optionsPropsRef, e.static]), B(() => {
2798
+ u.optionsPropsRef.current.hold = l;
2799
+ }, [u.optionsPropsRef, l]), $o(u.comboboxState === 0, { container: u.optionsElement, accept(U) {
2800
+ return U.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : U.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
2801
+ }, walk(U) {
2802
+ U.setAttribute("role", "none");
2844
2803
  } });
2845
- let k = Et([(n = f.buttonElement) == null ? void 0 : n.id]), F = X(() => ({ open: f.comboboxState === 0, option: void 0 }), [f.comboboxState]), x = M(() => {
2804
+ let k = bt([(n = u.buttonElement) == null ? void 0 : n.id]), z = q(() => ({ open: u.comboboxState === 0, option: void 0 }), [u.comboboxState]), w = I(() => {
2846
2805
  m.setActivationTrigger(0);
2847
- }), B = M((Y) => {
2848
- Y.preventDefault(), m.setActivationTrigger(0);
2849
- }), _ = yt(h ? E() : {}, { "aria-labelledby": k, role: "listbox", "aria-multiselectable": f.mode === 1 ? !0 : void 0, id: s, ref: O, style: { ...p.style, ...v, "--input-width": Dt(f.inputElement, !0).width, "--button-width": Dt(f.buttonElement, !0).width }, onWheel: f.activationTrigger === 0 ? void 0 : x, onMouseDown: B, ...to(L) }), z = S && f.comboboxState === 1, P = xt(z, (o = f.virtual) == null ? void 0 : o.options), $ = xt(z, f.value), H = M((Y) => f.compare($, Y));
2850
- if (f.virtual) {
2851
- if (P === void 0) throw new Error("Missing `options` in virtual mode");
2852
- Object.assign(p, { children: j.createElement(Ve.Provider, { value: P !== f.virtual.options ? { ...f, virtual: { ...f.virtual, options: P } } : f }, j.createElement(vr, { slot: F }, p.children)) });
2806
+ }), F = I((U) => {
2807
+ U.preventDefault(), m.setActivationTrigger(0);
2808
+ }), j = vt(h ? x() : {}, { "aria-labelledby": k, role: "listbox", "aria-multiselectable": u.mode === 1 ? !0 : void 0, id: s, ref: O, style: { ...p.style, ...v, "--input-width": Mt(u.inputElement, !0).width, "--button-width": Mt(u.buttonElement, !0).width }, onWheel: u.activationTrigger === 0 ? void 0 : w, onMouseDown: F, ...Zn(N) }), P = C && u.comboboxState === 1, L = ht(P, (o = u.virtual) == null ? void 0 : o.options), A = ht(P, u.value), J = I((U) => u.compare(A, U));
2809
+ if (u.virtual) {
2810
+ if (L === void 0) throw new Error("Missing `options` in virtual mode");
2811
+ Object.assign(p, { children: W.createElement(Ve.Provider, { value: L !== u.virtual.options ? { ...u, virtual: { ...u.virtual, options: L } } : u }, W.createElement(pr, { slot: z }, p.children)) });
2853
2812
  }
2854
- return j.createElement(fr, { enabled: u ? e.static || S : !1 }, j.createElement(Ve.Provider, { value: f.mode === 1 ? f : { ...f, isSelected: H } }, pe({ ourProps: _, theirProps: { ...p, children: j.createElement(Gi, { freeze: z }, typeof p.children == "function" ? (i = p.children) == null ? void 0 : i.call(p, F) : p.children) }, slot: F, defaultTag: Rr, features: Cr, visible: S, name: "Combobox.Options" })));
2813
+ return W.createElement(ar, { enabled: c ? e.static || C : !1 }, W.createElement(Ve.Provider, { value: u.mode === 1 ? u : { ...u, isSelected: J } }, he({ ourProps: j, theirProps: { ...p, children: W.createElement(Yi, { freeze: P }, typeof p.children == "function" ? (i = p.children) == null ? void 0 : i.call(p, z) : p.children) }, slot: z, defaultTag: yr, features: Or, visible: C, name: "Combobox.Options" })));
2855
2814
  }
2856
- let Ir = "div";
2857
- function Mr(e, t) {
2815
+ let Rr = "div";
2816
+ function Cr(e, t) {
2858
2817
  var n, o, i, r;
2859
- let s = De("Combobox.Option"), l = Ye("Combobox.Option"), a = Be(), { id: u = `headlessui-combobox-option-${a}`, value: c, disabled: d = (i = (o = (n = s.virtual) == null ? void 0 : n.disabled) == null ? void 0 : o.call(n, c)) != null ? i : !1, order: p = null, ...f } = e, m = un(s.inputElement), h = s.virtual ? s.activeOptionIndex === s.calculateIndex(c) : s.activeOptionIndex === null ? !1 : ((r = s.options[s.activeOptionIndex]) == null ? void 0 : r.id) === u, g = s.isSelected(c), v = J(null), y = Pe({ disabled: d, value: c, domRef: v, order: p }), b = le(Tn), E = Oe(t, v, b ? b.measureElement : null), O = M(() => {
2860
- l.setIsTyping(!1), l.onChange(c);
2818
+ let s = $e("Combobox.Option"), l = Ye("Combobox.Option"), a = We(), { id: c = `headlessui-combobox-option-${a}`, value: f, disabled: d = (i = (o = (n = s.virtual) == null ? void 0 : n.disabled) == null ? void 0 : o.call(n, f)) != null ? i : !1, order: p = null, ...u } = e, m = sn(s.inputElement), h = s.virtual ? s.activeOptionIndex === s.calculateIndex(f) : s.activeOptionIndex === null ? !1 : ((r = s.options[s.activeOptionIndex]) == null ? void 0 : r.id) === c, g = s.isSelected(f), v = K(null), E = Me({ disabled: d, value: f, domRef: v, order: p }), b = le(Rn), x = Se(t, v, b ? b.measureElement : null), O = I(() => {
2819
+ l.setIsTyping(!1), l.onChange(f);
2861
2820
  });
2862
- U(() => l.registerOption(u, y), [y, u]);
2863
- let C = J(!(s.virtual || s.__demoMode));
2864
- U(() => {
2821
+ B(() => l.registerOption(c, E), [E, c]);
2822
+ let S = K(!(s.virtual || s.__demoMode));
2823
+ B(() => {
2865
2824
  if (!s.virtual && !s.__demoMode) return Te().requestAnimationFrame(() => {
2866
- C.current = !0;
2825
+ S.current = !0;
2867
2826
  });
2868
- }, [s.virtual, s.__demoMode]), U(() => {
2869
- if (C.current && s.comboboxState === 0 && h && s.activationTrigger !== 0) return Te().requestAnimationFrame(() => {
2870
- var x, B;
2871
- (B = (x = v.current) == null ? void 0 : x.scrollIntoView) == null || B.call(x, { block: "nearest" });
2827
+ }, [s.virtual, s.__demoMode]), B(() => {
2828
+ if (S.current && s.comboboxState === 0 && h && s.activationTrigger !== 0) return Te().requestAnimationFrame(() => {
2829
+ var w, F;
2830
+ (F = (w = v.current) == null ? void 0 : w.scrollIntoView) == null || F.call(w, { block: "nearest" });
2872
2831
  });
2873
2832
  }, [v, h, s.comboboxState, s.activationTrigger, s.activeOptionIndex]);
2874
- let T = M((x) => {
2875
- x.preventDefault(), x.button === It.Left && (d || (O(), cn() || requestAnimationFrame(() => m()), s.mode === 0 && l.closeCombobox()));
2876
- }), S = M(() => {
2877
- if (d) return l.goToOption(V.Nothing);
2878
- let x = s.calculateIndex(c);
2879
- l.goToOption(V.Specific, x);
2880
- }), L = Do(), A = M((x) => L.update(x)), D = M((x) => {
2881
- if (!L.wasMoved(x) || d || h) return;
2882
- let B = s.calculateIndex(c);
2883
- l.goToOption(V.Specific, B, 0);
2884
- }), k = M((x) => {
2885
- L.wasMoved(x) && (d || h && (s.optionsPropsRef.current.hold || l.goToOption(V.Nothing)));
2886
- }), F = X(() => ({ active: h, focus: h, selected: g, disabled: d }), [h, g, d]);
2887
- return pe({ ourProps: { id: u, ref: E, role: "option", tabIndex: d === !0 ? void 0 : -1, "aria-disabled": d === !0 ? !0 : void 0, "aria-selected": g, disabled: void 0, onMouseDown: T, onFocus: S, onPointerEnter: A, onMouseEnter: A, onPointerMove: D, onMouseMove: D, onPointerLeave: k, onMouseLeave: k }, theirProps: f, slot: F, defaultTag: Ir, name: "Combobox.Option" });
2888
- }
2889
- let Pr = me(wr), Ar = me(Sr), $r = me(Er), Dr = zn, Fr = me(Tr), Lr = me(Mr), qr = Object.assign(Pr, { Input: $r, Button: Ar, Label: Dr, Options: Fr, Option: Lr });
2833
+ let M = I((w) => {
2834
+ w.preventDefault(), w.button === St.Left && (d || (O(), ln() || requestAnimationFrame(() => m()), s.mode === 0 && l.closeCombobox()));
2835
+ }), C = I(() => {
2836
+ if (d) return l.goToOption(H.Nothing);
2837
+ let w = s.calculateIndex(f);
2838
+ l.goToOption(H.Specific, w);
2839
+ }), N = Ao(), $ = I((w) => N.update(w)), D = I((w) => {
2840
+ if (!N.wasMoved(w) || d || h) return;
2841
+ let F = s.calculateIndex(f);
2842
+ l.goToOption(H.Specific, F, 0);
2843
+ }), k = I((w) => {
2844
+ N.wasMoved(w) && (d || h && (s.optionsPropsRef.current.hold || l.goToOption(H.Nothing)));
2845
+ }), z = q(() => ({ active: h, focus: h, selected: g, disabled: d }), [h, g, d]);
2846
+ return he({ ourProps: { id: c, ref: x, role: "option", tabIndex: d === !0 ? void 0 : -1, "aria-disabled": d === !0 ? !0 : void 0, "aria-selected": g, disabled: void 0, onMouseDown: M, onFocus: C, onPointerEnter: $, onMouseEnter: $, onPointerMove: D, onMouseMove: D, onPointerLeave: k, onMouseLeave: k }, theirProps: u, slot: z, defaultTag: Rr, name: "Combobox.Option" });
2847
+ }
2848
+ let Tr = pe(vr), Ir = pe(Er), Mr = pe(xr), Pr = kn, Ar = pe(Sr), $r = pe(Cr), jr = Object.assign(Tr, { Input: Mr, Button: Ir, Label: Pr, Options: Ar, Option: $r });
2890
2849
  export {
2891
- $r as G,
2892
- qr as H,
2893
- Fr as K,
2894
- Ar as U,
2895
- Lr as j
2850
+ Mr as G,
2851
+ jr as H,
2852
+ Ar as K,
2853
+ Ir as U,
2854
+ $r as W
2896
2855
  };