@pdf-viewer/react 0.9.0-beta.2 → 0.9.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/{Container-83627c27.js → Container-fdb0a71f.js} +7 -6
  2. package/dist/{RPDefaultLayout-3d9595ed.js → RPDefaultLayout-1a423868.js} +18 -17
  3. package/dist/components/RPController.js +1 -1
  4. package/dist/components/RPPages.js +1 -1
  5. package/dist/components/RPProvider.js +1 -1
  6. package/dist/components/layout/Container.js +1 -1
  7. package/dist/components/layout/RPDefaultLayout.js +2 -2
  8. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  10. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  11. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  12. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  13. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  14. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  15. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  16. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  17. package/dist/components/layout/toolbar/Paginate.js +1 -1
  18. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  19. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  20. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  21. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  22. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  23. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  24. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  25. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  26. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  27. package/dist/components/page/AnnotationLayer.js +1 -1
  28. package/dist/components/page/CanvasLayer.js +1 -1
  29. package/dist/components/page/DualPage.js +1 -1
  30. package/dist/components/page/RPPage.js +1 -1
  31. package/dist/components/page/SinglePage.js +1 -1
  32. package/dist/components/page/TextLayer.js +1 -1
  33. package/dist/components/ui/Checkbox.js +1 -1
  34. package/dist/components/ui/DropDown.js +1 -1
  35. package/dist/components/ui/LoadingIndicator.js +1 -1
  36. package/dist/components/ui/RPTooltip.js +532 -1793
  37. package/dist/contexts/PaginationContext.js +1 -1
  38. package/dist/contexts/PrintContext.js +1 -1
  39. package/dist/contexts/SearchContext.js +1 -1
  40. package/dist/contexts/ThumbnailsContext.js +1 -1
  41. package/dist/floating-ui.react-dom-e6d5fe8f.js +1327 -0
  42. package/dist/index-316854c1.js +2299 -0
  43. package/dist/{index-743c36f0.js → index-71898eb9.js} +30 -30
  44. package/dist/main.js +1 -1
  45. package/dist/utils/hooks/useFileDownload.js +1 -1
  46. package/dist/utils/hooks/useLicense.js +1 -1
  47. package/dist/utils/hooks/usePaginate.js +1 -1
  48. package/dist/utils/hooks/usePrint.js +1 -1
  49. package/dist/utils/hooks/useScrollToPage.js +1 -1
  50. package/dist/utils/hooks/useSearch.js +1 -1
  51. package/dist/utils/hooks/useThumbnail.js +1 -1
  52. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  53. package/package.json +4 -4
  54. package/dist/index-3459164c.js +0 -3609
@@ -1,113 +1,62 @@
1
- import { jsx as A, Fragment as gt, jsxs as De } from "react/jsx-runtime";
2
- import * as u from "react";
3
- import { useLayoutEffect as mn, useEffect as gn, forwardRef as yn } from "react";
1
+ import { jsx as f, Fragment as F, jsxs as Y } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { forwardRef as mt } from "react";
4
+ import { u as Q, c as Ee, d as ht, a as H, b as vt } from "../../index-71898eb9.js";
4
5
  import * as yt from "react-dom";
5
- import '../../assets/RPTooltip.css';function Y(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
6
+ import { u as gt, a as wt, b as Ct, o as Et, s as Pt, f as bt, c as xt, d as Rt, h as At, l as Tt, e as Ot } from "../../floating-ui.react-dom-e6d5fe8f.js";
7
+ import '../../assets/RPTooltip.css';function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
6
8
  return function(r) {
7
9
  if (e == null || e(r), n === !1 || !r.defaultPrevented)
8
10
  return t == null ? void 0 : t(r);
9
11
  };
10
12
  }
11
- function ot(e, t) {
13
+ function me(e, t) {
12
14
  if (typeof e == "function")
13
15
  return e(t);
14
16
  e != null && (e.current = t);
15
17
  }
16
- function wt(...e) {
18
+ function Pe(...e) {
17
19
  return (t) => {
18
20
  let n = !1;
19
21
  const o = e.map((r) => {
20
- const i = ot(r, t);
22
+ const i = me(r, t);
21
23
  return !n && typeof i == "function" && (n = !0), i;
22
24
  });
23
25
  if (n)
24
26
  return () => {
25
27
  for (let r = 0; r < o.length; r++) {
26
28
  const i = o[r];
27
- typeof i == "function" ? i() : ot(e[r], null);
29
+ typeof i == "function" ? i() : me(e[r], null);
28
30
  }
29
31
  };
30
32
  };
31
33
  }
32
- function ae(...e) {
33
- return u.useCallback(wt(...e), e);
34
+ function _(...e) {
35
+ return s.useCallback(Pe(...e), e);
34
36
  }
35
- function vt(e, t = []) {
36
- let n = [];
37
- function o(i, s) {
38
- const c = u.createContext(s), l = n.length;
39
- n = [...n, s];
40
- const a = (d) => {
41
- var w;
42
- const { scope: h, children: p, ...m } = d, g = ((w = h == null ? void 0 : h[e]) == null ? void 0 : w[l]) || c, y = u.useMemo(() => m, Object.values(m));
43
- return /* @__PURE__ */ A(g.Provider, { value: y, children: p });
44
- };
45
- a.displayName = i + "Provider";
46
- function f(d, h) {
47
- var g;
48
- const p = ((g = h == null ? void 0 : h[e]) == null ? void 0 : g[l]) || c, m = u.useContext(p);
49
- if (m)
50
- return m;
51
- if (s !== void 0)
52
- return s;
53
- throw new Error(`\`${d}\` must be used within \`${i}\``);
54
- }
55
- return [a, f];
56
- }
57
- const r = () => {
58
- const i = n.map((s) => u.createContext(s));
59
- return function(c) {
60
- const l = (c == null ? void 0 : c[e]) || i;
61
- return u.useMemo(
62
- () => ({ [`__scope${e}`]: { ...c, [e]: l } }),
63
- [c, l]
64
- );
65
- };
66
- };
67
- return r.scopeName = e, [o, wn(r, ...t)];
68
- }
69
- function wn(...e) {
70
- const t = e[0];
71
- if (e.length === 1)
72
- return t;
73
- const n = () => {
74
- const o = e.map((r) => ({
75
- useScope: r(),
76
- scopeName: r.scopeName
77
- }));
78
- return function(i) {
79
- const s = o.reduce((c, { useScope: l, scopeName: a }) => {
80
- const d = l(i)[`__scope${a}`];
81
- return { ...c, ...d };
82
- }, {});
83
- return u.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
84
- };
85
- };
86
- return n.scopeName = t.scopeName, n;
87
- }
88
- var xt = u.forwardRef((e, t) => {
89
- const { children: n, ...o } = e, r = u.Children.toArray(n), i = r.find(vn);
37
+ var be = s.forwardRef((e, t) => {
38
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Nt);
90
39
  if (i) {
91
- const s = i.props.children, c = r.map((l) => l === i ? u.Children.count(s) > 1 ? u.Children.only(null) : u.isValidElement(s) ? s.props.children : null : l);
92
- return /* @__PURE__ */ A(Ne, { ...o, ref: t, children: u.isValidElement(s) ? u.cloneElement(s, void 0, c) : null });
40
+ const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
41
+ return /* @__PURE__ */ f(G, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
93
42
  }
94
- return /* @__PURE__ */ A(Ne, { ...o, ref: t, children: n });
43
+ return /* @__PURE__ */ f(G, { ...o, ref: t, children: n });
95
44
  });
96
- xt.displayName = "Slot";
97
- var Ne = u.forwardRef((e, t) => {
45
+ be.displayName = "Slot";
46
+ var G = s.forwardRef((e, t) => {
98
47
  const { children: n, ...o } = e;
99
- if (u.isValidElement(n)) {
100
- const r = bn(n), i = xn(o, n.props);
101
- return n.type !== u.Fragment && (i.ref = t ? wt(t, r) : r), u.cloneElement(n, i);
48
+ if (s.isValidElement(n)) {
49
+ const r = Dt(n), i = St(o, n.props);
50
+ return n.type !== s.Fragment && (i.ref = t ? Pe(t, r) : r), s.cloneElement(n, i);
102
51
  }
103
- return u.Children.count(n) > 1 ? u.Children.only(null) : null;
52
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
104
53
  });
105
- Ne.displayName = "SlotClone";
106
- var bt = ({ children: e }) => /* @__PURE__ */ A(gt, { children: e });
107
- function vn(e) {
108
- return u.isValidElement(e) && e.type === bt;
54
+ G.displayName = "SlotClone";
55
+ var xe = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
56
+ function Nt(e) {
57
+ return s.isValidElement(e) && e.type === xe;
109
58
  }
110
- function xn(e, t) {
59
+ function St(e, t) {
111
60
  const n = { ...t };
112
61
  for (const o in t) {
113
62
  const r = e[o], i = t[o];
@@ -117,12 +66,12 @@ function xn(e, t) {
117
66
  }
118
67
  return { ...e, ...n };
119
68
  }
120
- function bn(e) {
69
+ function Dt(e) {
121
70
  var o, r;
122
71
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
123
72
  return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
124
73
  }
125
- var Cn = [
74
+ var _t = [
126
75
  "a",
127
76
  "button",
128
77
  "div",
@@ -139,133 +88,115 @@ var Cn = [
139
88
  "span",
140
89
  "svg",
141
90
  "ul"
142
- ], Ie = Cn.reduce((e, t) => {
143
- const n = u.forwardRef((o, r) => {
144
- const { asChild: i, ...s } = o, c = i ? xt : t;
145
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ A(c, { ...s, ref: r });
91
+ ], ee = _t.reduce((e, t) => {
92
+ const n = s.forwardRef((o, r) => {
93
+ const { asChild: i, ...a } = o, c = i ? be : t;
94
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
146
95
  });
147
96
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
148
97
  }, {});
149
- function En(e, t) {
98
+ function Lt(e, t) {
150
99
  e && yt.flushSync(() => e.dispatchEvent(t));
151
100
  }
152
- function oe(e) {
153
- const t = u.useRef(e);
154
- return u.useEffect(() => {
155
- t.current = e;
156
- }), u.useMemo(() => (...n) => {
157
- var o;
158
- return (o = t.current) == null ? void 0 : o.call(t, ...n);
159
- }, []);
160
- }
161
- function An(e, t = globalThis == null ? void 0 : globalThis.document) {
162
- const n = oe(e);
163
- u.useEffect(() => {
164
- const o = (r) => {
165
- r.key === "Escape" && n(r);
166
- };
167
- return t.addEventListener("keydown", o, { capture: !0 }), () => t.removeEventListener("keydown", o, { capture: !0 });
168
- }, [n, t]);
169
- }
170
- var Pn = "DismissableLayer", Le = "dismissableLayer.update", Rn = "dismissableLayer.pointerDownOutside", On = "dismissableLayer.focusOutside", rt, Ct = u.createContext({
101
+ var $t = "DismissableLayer", X = "dismissableLayer.update", Mt = "dismissableLayer.pointerDownOutside", It = "dismissableLayer.focusOutside", he, Re = s.createContext({
171
102
  layers: /* @__PURE__ */ new Set(),
172
103
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
173
104
  branches: /* @__PURE__ */ new Set()
174
- }), Et = u.forwardRef(
105
+ }), Ae = s.forwardRef(
175
106
  (e, t) => {
176
107
  const {
177
108
  disableOutsidePointerEvents: n = !1,
178
109
  onEscapeKeyDown: o,
179
110
  onPointerDownOutside: r,
180
111
  onFocusOutside: i,
181
- onInteractOutside: s,
112
+ onInteractOutside: a,
182
113
  onDismiss: c,
183
114
  ...l
184
- } = e, a = u.useContext(Ct), [f, d] = u.useState(null), h = (f == null ? void 0 : f.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = u.useState({}), m = ae(t, (b) => d(b)), g = Array.from(a.layers), [y] = [...a.layersWithOutsidePointerEventsDisabled].slice(-1), w = g.indexOf(y), v = f ? g.indexOf(f) : -1, E = a.layersWithOutsidePointerEventsDisabled.size > 0, x = v >= w, C = Dn((b) => {
185
- const O = b.target, M = [...a.branches].some((T) => T.contains(O));
186
- !x || M || (r == null || r(b), s == null || s(b), b.defaultPrevented || c == null || c());
187
- }, h), P = Nn((b) => {
188
- const O = b.target;
189
- [...a.branches].some((T) => T.contains(O)) || (i == null || i(b), s == null || s(b), b.defaultPrevented || c == null || c());
115
+ } = e, u = s.useContext(Re), [d, m] = s.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = s.useState({}), v = _(t, (g) => m(g)), y = Array.from(u.layers), [w] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), E = y.indexOf(w), C = d ? y.indexOf(d) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, P = C >= E, R = Ht((g) => {
116
+ const T = g.target, L = [...u.branches].some((S) => S.contains(T));
117
+ !P || L || (r == null || r(g), a == null || a(g), g.defaultPrevented || c == null || c());
118
+ }, h), b = Ft((g) => {
119
+ const T = g.target;
120
+ [...u.branches].some((S) => S.contains(T)) || (i == null || i(g), a == null || a(g), g.defaultPrevented || c == null || c());
190
121
  }, h);
191
- return An((b) => {
192
- v === a.layers.size - 1 && (o == null || o(b), !b.defaultPrevented && c && (b.preventDefault(), c()));
193
- }, h), u.useEffect(() => {
194
- if (f)
195
- return n && (a.layersWithOutsidePointerEventsDisabled.size === 0 && (rt = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), a.layersWithOutsidePointerEventsDisabled.add(f)), a.layers.add(f), it(), () => {
196
- n && a.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = rt);
122
+ return gt((g) => {
123
+ C === u.layers.size - 1 && (o == null || o(g), !g.defaultPrevented && c && (g.preventDefault(), c()));
124
+ }, h), s.useEffect(() => {
125
+ if (d)
126
+ return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (he = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), ve(), () => {
127
+ n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = he);
197
128
  };
198
- }, [f, h, n, a]), u.useEffect(() => () => {
199
- f && (a.layers.delete(f), a.layersWithOutsidePointerEventsDisabled.delete(f), it());
200
- }, [f, a]), u.useEffect(() => {
201
- const b = () => p({});
202
- return document.addEventListener(Le, b), () => document.removeEventListener(Le, b);
203
- }, []), /* @__PURE__ */ A(
204
- Ie.div,
129
+ }, [d, h, n, u]), s.useEffect(() => () => {
130
+ d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), ve());
131
+ }, [d, u]), s.useEffect(() => {
132
+ const g = () => p({});
133
+ return document.addEventListener(X, g), () => document.removeEventListener(X, g);
134
+ }, []), /* @__PURE__ */ f(
135
+ ee.div,
205
136
  {
206
137
  ...l,
207
- ref: m,
138
+ ref: v,
208
139
  style: {
209
- pointerEvents: E ? x ? "auto" : "none" : void 0,
140
+ pointerEvents: x ? P ? "auto" : "none" : void 0,
210
141
  ...e.style
211
142
  },
212
- onFocusCapture: Y(e.onFocusCapture, P.onFocusCapture),
213
- onBlurCapture: Y(e.onBlurCapture, P.onBlurCapture),
214
- onPointerDownCapture: Y(
143
+ onFocusCapture: A(e.onFocusCapture, b.onFocusCapture),
144
+ onBlurCapture: A(e.onBlurCapture, b.onBlurCapture),
145
+ onPointerDownCapture: A(
215
146
  e.onPointerDownCapture,
216
- C.onPointerDownCapture
147
+ R.onPointerDownCapture
217
148
  )
218
149
  }
219
150
  );
220
151
  }
221
152
  );
222
- Et.displayName = Pn;
223
- var Tn = "DismissableLayerBranch", Sn = u.forwardRef((e, t) => {
224
- const n = u.useContext(Ct), o = u.useRef(null), r = ae(t, o);
225
- return u.useEffect(() => {
153
+ Ae.displayName = $t;
154
+ var Wt = "DismissableLayerBranch", kt = s.forwardRef((e, t) => {
155
+ const n = s.useContext(Re), o = s.useRef(null), r = _(t, o);
156
+ return s.useEffect(() => {
226
157
  const i = o.current;
227
158
  if (i)
228
159
  return n.branches.add(i), () => {
229
160
  n.branches.delete(i);
230
161
  };
231
- }, [n.branches]), /* @__PURE__ */ A(Ie.div, { ...e, ref: r });
162
+ }, [n.branches]), /* @__PURE__ */ f(ee.div, { ...e, ref: r });
232
163
  });
233
- Sn.displayName = Tn;
234
- function Dn(e, t = globalThis == null ? void 0 : globalThis.document) {
235
- const n = oe(e), o = u.useRef(!1), r = u.useRef(() => {
164
+ kt.displayName = Wt;
165
+ function Ht(e, t = globalThis == null ? void 0 : globalThis.document) {
166
+ const n = Q(e), o = s.useRef(!1), r = s.useRef(() => {
236
167
  });
237
- return u.useEffect(() => {
168
+ return s.useEffect(() => {
238
169
  const i = (c) => {
239
170
  if (c.target && !o.current) {
240
171
  let l = function() {
241
- At(
242
- Rn,
172
+ Te(
173
+ Mt,
243
174
  n,
244
- a,
175
+ u,
245
176
  { discrete: !0 }
246
177
  );
247
178
  };
248
- const a = { originalEvent: c };
179
+ const u = { originalEvent: c };
249
180
  c.pointerType === "touch" ? (t.removeEventListener("click", r.current), r.current = l, t.addEventListener("click", r.current, { once: !0 })) : l();
250
181
  } else
251
182
  t.removeEventListener("click", r.current);
252
183
  o.current = !1;
253
- }, s = window.setTimeout(() => {
184
+ }, a = window.setTimeout(() => {
254
185
  t.addEventListener("pointerdown", i);
255
186
  }, 0);
256
187
  return () => {
257
- window.clearTimeout(s), t.removeEventListener("pointerdown", i), t.removeEventListener("click", r.current);
188
+ window.clearTimeout(a), t.removeEventListener("pointerdown", i), t.removeEventListener("click", r.current);
258
189
  };
259
190
  }, [t, n]), {
260
191
  // ensures we check React component tree (not just DOM tree)
261
192
  onPointerDownCapture: () => o.current = !0
262
193
  };
263
194
  }
264
- function Nn(e, t = globalThis == null ? void 0 : globalThis.document) {
265
- const n = oe(e), o = u.useRef(!1);
266
- return u.useEffect(() => {
195
+ function Ft(e, t = globalThis == null ? void 0 : globalThis.document) {
196
+ const n = Q(e), o = s.useRef(!1);
197
+ return s.useEffect(() => {
267
198
  const r = (i) => {
268
- i.target && !o.current && At(On, n, { originalEvent: i }, {
199
+ i.target && !o.current && Te(It, n, { originalEvent: i }, {
269
200
  discrete: !1
270
201
  });
271
202
  };
@@ -275,1366 +206,159 @@ function Nn(e, t = globalThis == null ? void 0 : globalThis.document) {
275
206
  onBlurCapture: () => o.current = !1
276
207
  };
277
208
  }
278
- function it() {
279
- const e = new CustomEvent(Le);
209
+ function ve() {
210
+ const e = new CustomEvent(X);
280
211
  document.dispatchEvent(e);
281
212
  }
282
- function At(e, t, n, { discrete: o }) {
213
+ function Te(e, t, n, { discrete: o }) {
283
214
  const r = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
284
- t && r.addEventListener(e, t, { once: !0 }), o ? En(r, i) : r.dispatchEvent(i);
285
- }
286
- var ee = globalThis != null && globalThis.document ? u.useLayoutEffect : () => {
287
- }, Ln = u["useId".toString()] || (() => {
288
- }), Mn = 0;
289
- function _n(e) {
290
- const [t, n] = u.useState(Ln());
291
- return ee(() => {
292
- e || n((o) => o ?? String(Mn++));
293
- }, [e]), e || (t ? `radix-${t}` : "");
294
- }
295
- const kn = ["top", "right", "bottom", "left"], q = Math.min, W = Math.max, ge = Math.round, pe = Math.floor, z = (e) => ({
296
- x: e,
297
- y: e
298
- }), $n = {
299
- left: "right",
300
- right: "left",
301
- bottom: "top",
302
- top: "bottom"
303
- }, Wn = {
304
- start: "end",
305
- end: "start"
306
- };
307
- function Me(e, t, n) {
308
- return W(e, q(t, n));
309
- }
310
- function X(e, t) {
311
- return typeof e == "function" ? e(t) : e;
312
- }
313
- function G(e) {
314
- return e.split("-")[0];
315
- }
316
- function re(e) {
317
- return e.split("-")[1];
318
- }
319
- function He(e) {
320
- return e === "x" ? "y" : "x";
321
- }
322
- function Be(e) {
323
- return e === "y" ? "height" : "width";
324
- }
325
- function K(e) {
326
- return ["top", "bottom"].includes(G(e)) ? "y" : "x";
327
- }
328
- function Ve(e) {
329
- return He(K(e));
330
- }
331
- function Fn(e, t, n) {
332
- n === void 0 && (n = !1);
333
- const o = re(e), r = Ve(e), i = Be(r);
334
- let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
335
- return t.reference[i] > t.floating[i] && (s = ye(s)), [s, ye(s)];
336
- }
337
- function In(e) {
338
- const t = ye(e);
339
- return [_e(e), t, _e(t)];
340
- }
341
- function _e(e) {
342
- return e.replace(/start|end/g, (t) => Wn[t]);
343
- }
344
- function Hn(e, t, n) {
345
- const o = ["left", "right"], r = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"];
346
- switch (e) {
347
- case "top":
348
- case "bottom":
349
- return n ? t ? r : o : t ? o : r;
350
- case "left":
351
- case "right":
352
- return t ? i : s;
353
- default:
354
- return [];
355
- }
356
- }
357
- function Bn(e, t, n, o) {
358
- const r = re(e);
359
- let i = Hn(G(e), n === "start", o);
360
- return r && (i = i.map((s) => s + "-" + r), t && (i = i.concat(i.map(_e)))), i;
361
- }
362
- function ye(e) {
363
- return e.replace(/left|right|bottom|top/g, (t) => $n[t]);
364
- }
365
- function Vn(e) {
366
- return {
367
- top: 0,
368
- right: 0,
369
- bottom: 0,
370
- left: 0,
371
- ...e
372
- };
373
- }
374
- function Pt(e) {
375
- return typeof e != "number" ? Vn(e) : {
376
- top: e,
377
- right: e,
378
- bottom: e,
379
- left: e
380
- };
381
- }
382
- function we(e) {
383
- const {
384
- x: t,
385
- y: n,
386
- width: o,
387
- height: r
388
- } = e;
389
- return {
390
- width: o,
391
- height: r,
392
- top: n,
393
- left: t,
394
- right: t + o,
395
- bottom: n + r,
396
- x: t,
397
- y: n
398
- };
215
+ t && r.addEventListener(e, t, { once: !0 }), o ? Lt(r, i) : r.dispatchEvent(i);
399
216
  }
400
- function st(e, t, n) {
401
- let {
402
- reference: o,
403
- floating: r
404
- } = e;
405
- const i = K(t), s = Ve(t), c = Be(s), l = G(t), a = i === "y", f = o.x + o.width / 2 - r.width / 2, d = o.y + o.height / 2 - r.height / 2, h = o[c] / 2 - r[c] / 2;
406
- let p;
407
- switch (l) {
408
- case "top":
409
- p = {
410
- x: f,
411
- y: o.y - r.height
412
- };
413
- break;
414
- case "bottom":
415
- p = {
416
- x: f,
417
- y: o.y + o.height
418
- };
419
- break;
420
- case "right":
421
- p = {
422
- x: o.x + o.width,
423
- y: d
424
- };
425
- break;
426
- case "left":
427
- p = {
428
- x: o.x - r.width,
429
- y: d
430
- };
431
- break;
432
- default:
433
- p = {
434
- x: o.x,
435
- y: o.y
436
- };
437
- }
438
- switch (re(t)) {
439
- case "start":
440
- p[s] -= h * (n && a ? -1 : 1);
441
- break;
442
- case "end":
443
- p[s] += h * (n && a ? -1 : 1);
444
- break;
445
- }
446
- return p;
217
+ function ye(e, t) {
218
+ if (typeof e == "function")
219
+ return e(t);
220
+ e != null && (e.current = t);
447
221
  }
448
- const zn = async (e, t, n) => {
449
- const {
450
- placement: o = "bottom",
451
- strategy: r = "absolute",
452
- middleware: i = [],
453
- platform: s
454
- } = n, c = i.filter(Boolean), l = await (s.isRTL == null ? void 0 : s.isRTL(t));
455
- let a = await s.getElementRects({
456
- reference: e,
457
- floating: t,
458
- strategy: r
459
- }), {
460
- x: f,
461
- y: d
462
- } = st(a, o, l), h = o, p = {}, m = 0;
463
- for (let g = 0; g < c.length; g++) {
464
- const {
465
- name: y,
466
- fn: w
467
- } = c[g], {
468
- x: v,
469
- y: E,
470
- data: x,
471
- reset: C
472
- } = await w({
473
- x: f,
474
- y: d,
475
- initialPlacement: o,
476
- placement: h,
477
- strategy: r,
478
- middlewareData: p,
479
- rects: a,
480
- platform: s,
481
- elements: {
482
- reference: e,
483
- floating: t
484
- }
222
+ function Vt(...e) {
223
+ return (t) => {
224
+ let n = !1;
225
+ const o = e.map((r) => {
226
+ const i = ye(r, t);
227
+ return !n && typeof i == "function" && (n = !0), i;
485
228
  });
486
- f = v ?? f, d = E ?? d, p = {
487
- ...p,
488
- [y]: {
489
- ...p[y],
490
- ...x
491
- }
492
- }, C && m <= 50 && (m++, typeof C == "object" && (C.placement && (h = C.placement), C.rects && (a = C.rects === !0 ? await s.getElementRects({
493
- reference: e,
494
- floating: t,
495
- strategy: r
496
- }) : C.rects), {
497
- x: f,
498
- y: d
499
- } = st(a, h, l)), g = -1);
500
- }
501
- return {
502
- x: f,
503
- y: d,
504
- placement: h,
505
- strategy: r,
506
- middlewareData: p
507
- };
508
- };
509
- async function ce(e, t) {
510
- var n;
511
- t === void 0 && (t = {});
512
- const {
513
- x: o,
514
- y: r,
515
- platform: i,
516
- rects: s,
517
- elements: c,
518
- strategy: l
519
- } = e, {
520
- boundary: a = "clippingAncestors",
521
- rootBoundary: f = "viewport",
522
- elementContext: d = "floating",
523
- altBoundary: h = !1,
524
- padding: p = 0
525
- } = X(t, e), m = Pt(p), y = c[h ? d === "floating" ? "reference" : "floating" : d], w = we(await i.getClippingRect({
526
- element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
527
- boundary: a,
528
- rootBoundary: f,
529
- strategy: l
530
- })), v = d === "floating" ? {
531
- x: o,
532
- y: r,
533
- width: s.floating.width,
534
- height: s.floating.height
535
- } : s.reference, E = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), x = await (i.isElement == null ? void 0 : i.isElement(E)) ? await (i.getScale == null ? void 0 : i.getScale(E)) || {
536
- x: 1,
537
- y: 1
538
- } : {
539
- x: 1,
540
- y: 1
541
- }, C = we(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
542
- elements: c,
543
- rect: v,
544
- offsetParent: E,
545
- strategy: l
546
- }) : v);
547
- return {
548
- top: (w.top - C.top + m.top) / x.y,
549
- bottom: (C.bottom - w.bottom + m.bottom) / x.y,
550
- left: (w.left - C.left + m.left) / x.x,
551
- right: (C.right - w.right + m.right) / x.x
552
- };
553
- }
554
- const jn = (e) => ({
555
- name: "arrow",
556
- options: e,
557
- async fn(t) {
558
- const {
559
- x: n,
560
- y: o,
561
- placement: r,
562
- rects: i,
563
- platform: s,
564
- elements: c,
565
- middlewareData: l
566
- } = t, {
567
- element: a,
568
- padding: f = 0
569
- } = X(e, t) || {};
570
- if (a == null)
571
- return {};
572
- const d = Pt(f), h = {
573
- x: n,
574
- y: o
575
- }, p = Ve(r), m = Be(p), g = await s.getDimensions(a), y = p === "y", w = y ? "top" : "left", v = y ? "bottom" : "right", E = y ? "clientHeight" : "clientWidth", x = i.reference[m] + i.reference[p] - h[p] - i.floating[m], C = h[p] - i.reference[p], P = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a));
576
- let b = P ? P[E] : 0;
577
- (!b || !await (s.isElement == null ? void 0 : s.isElement(P))) && (b = c.floating[E] || i.floating[m]);
578
- const O = x / 2 - C / 2, M = b / 2 - g[m] / 2 - 1, T = q(d[w], M), k = q(d[v], M), $ = T, D = b - g[m] - k, S = b / 2 - g[m] / 2 + O, I = Me($, S, D), N = !l.arrow && re(r) != null && S !== I && i.reference[m] / 2 - (S < $ ? T : k) - g[m] / 2 < 0, L = N ? S < $ ? S - $ : S - D : 0;
579
- return {
580
- [p]: h[p] + L,
581
- data: {
582
- [p]: I,
583
- centerOffset: S - I - L,
584
- ...N && {
585
- alignmentOffset: L
586
- }
587
- },
588
- reset: N
589
- };
590
- }
591
- }), Un = function(e) {
592
- return e === void 0 && (e = {}), {
593
- name: "flip",
594
- options: e,
595
- async fn(t) {
596
- var n, o;
597
- const {
598
- placement: r,
599
- middlewareData: i,
600
- rects: s,
601
- initialPlacement: c,
602
- platform: l,
603
- elements: a
604
- } = t, {
605
- mainAxis: f = !0,
606
- crossAxis: d = !0,
607
- fallbackPlacements: h,
608
- fallbackStrategy: p = "bestFit",
609
- fallbackAxisSideDirection: m = "none",
610
- flipAlignment: g = !0,
611
- ...y
612
- } = X(e, t);
613
- if ((n = i.arrow) != null && n.alignmentOffset)
614
- return {};
615
- const w = G(r), v = K(c), E = G(c) === c, x = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), C = h || (E || !g ? [ye(c)] : In(c)), P = m !== "none";
616
- !h && P && C.push(...Bn(c, g, m, x));
617
- const b = [c, ...C], O = await ce(t, y), M = [];
618
- let T = ((o = i.flip) == null ? void 0 : o.overflows) || [];
619
- if (f && M.push(O[w]), d) {
620
- const S = Fn(r, s, x);
621
- M.push(O[S[0]], O[S[1]]);
622
- }
623
- if (T = [...T, {
624
- placement: r,
625
- overflows: M
626
- }], !M.every((S) => S <= 0)) {
627
- var k, $;
628
- const S = (((k = i.flip) == null ? void 0 : k.index) || 0) + 1, I = b[S];
629
- if (I)
630
- return {
631
- data: {
632
- index: S,
633
- overflows: T
634
- },
635
- reset: {
636
- placement: I
637
- }
638
- };
639
- let N = ($ = T.filter((L) => L.overflows[0] <= 0).sort((L, R) => L.overflows[1] - R.overflows[1])[0]) == null ? void 0 : $.placement;
640
- if (!N)
641
- switch (p) {
642
- case "bestFit": {
643
- var D;
644
- const L = (D = T.filter((R) => {
645
- if (P) {
646
- const _ = K(R.placement);
647
- return _ === v || // Create a bias to the `y` side axis due to horizontal
648
- // reading directions favoring greater width.
649
- _ === "y";
650
- }
651
- return !0;
652
- }).map((R) => [R.placement, R.overflows.filter((_) => _ > 0).reduce((_, V) => _ + V, 0)]).sort((R, _) => R[1] - _[1])[0]) == null ? void 0 : D[0];
653
- L && (N = L);
654
- break;
655
- }
656
- case "initialPlacement":
657
- N = c;
658
- break;
659
- }
660
- if (r !== N)
661
- return {
662
- reset: {
663
- placement: N
664
- }
665
- };
666
- }
667
- return {};
668
- }
669
- };
670
- };
671
- function ct(e, t) {
672
- return {
673
- top: e.top - t.height,
674
- right: e.right - t.width,
675
- bottom: e.bottom - t.height,
676
- left: e.left - t.width
677
- };
678
- }
679
- function lt(e) {
680
- return kn.some((t) => e[t] >= 0);
681
- }
682
- const Yn = function(e) {
683
- return e === void 0 && (e = {}), {
684
- name: "hide",
685
- options: e,
686
- async fn(t) {
687
- const {
688
- rects: n
689
- } = t, {
690
- strategy: o = "referenceHidden",
691
- ...r
692
- } = X(e, t);
693
- switch (o) {
694
- case "referenceHidden": {
695
- const i = await ce(t, {
696
- ...r,
697
- elementContext: "reference"
698
- }), s = ct(i, n.reference);
699
- return {
700
- data: {
701
- referenceHiddenOffsets: s,
702
- referenceHidden: lt(s)
703
- }
704
- };
705
- }
706
- case "escaped": {
707
- const i = await ce(t, {
708
- ...r,
709
- altBoundary: !0
710
- }), s = ct(i, n.floating);
711
- return {
712
- data: {
713
- escapedOffsets: s,
714
- escaped: lt(s)
715
- }
716
- };
717
- }
718
- default:
719
- return {};
720
- }
721
- }
722
- };
723
- };
724
- async function Xn(e, t) {
725
- const {
726
- placement: n,
727
- platform: o,
728
- elements: r
729
- } = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = G(n), c = re(n), l = K(n) === "y", a = ["left", "top"].includes(s) ? -1 : 1, f = i && l ? -1 : 1, d = X(t, e);
730
- let {
731
- mainAxis: h,
732
- crossAxis: p,
733
- alignmentAxis: m
734
- } = typeof d == "number" ? {
735
- mainAxis: d,
736
- crossAxis: 0,
737
- alignmentAxis: null
738
- } : {
739
- mainAxis: d.mainAxis || 0,
740
- crossAxis: d.crossAxis || 0,
741
- alignmentAxis: d.alignmentAxis
742
- };
743
- return c && typeof m == "number" && (p = c === "end" ? m * -1 : m), l ? {
744
- x: p * f,
745
- y: h * a
746
- } : {
747
- x: h * a,
748
- y: p * f
749
- };
750
- }
751
- const Gn = function(e) {
752
- return e === void 0 && (e = 0), {
753
- name: "offset",
754
- options: e,
755
- async fn(t) {
756
- var n, o;
757
- const {
758
- x: r,
759
- y: i,
760
- placement: s,
761
- middlewareData: c
762
- } = t, l = await Xn(t, e);
763
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
764
- x: r + l.x,
765
- y: i + l.y,
766
- data: {
767
- ...l,
768
- placement: s
769
- }
770
- };
771
- }
772
- };
773
- }, qn = function(e) {
774
- return e === void 0 && (e = {}), {
775
- name: "shift",
776
- options: e,
777
- async fn(t) {
778
- const {
779
- x: n,
780
- y: o,
781
- placement: r
782
- } = t, {
783
- mainAxis: i = !0,
784
- crossAxis: s = !1,
785
- limiter: c = {
786
- fn: (y) => {
787
- let {
788
- x: w,
789
- y: v
790
- } = y;
791
- return {
792
- x: w,
793
- y: v
794
- };
795
- }
796
- },
797
- ...l
798
- } = X(e, t), a = {
799
- x: n,
800
- y: o
801
- }, f = await ce(t, l), d = K(G(r)), h = He(d);
802
- let p = a[h], m = a[d];
803
- if (i) {
804
- const y = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", v = p + f[y], E = p - f[w];
805
- p = Me(v, p, E);
806
- }
807
- if (s) {
808
- const y = d === "y" ? "top" : "left", w = d === "y" ? "bottom" : "right", v = m + f[y], E = m - f[w];
809
- m = Me(v, m, E);
810
- }
811
- const g = c.fn({
812
- ...t,
813
- [h]: p,
814
- [d]: m
815
- });
816
- return {
817
- ...g,
818
- data: {
819
- x: g.x - n,
820
- y: g.y - o,
821
- enabled: {
822
- [h]: i,
823
- [d]: s
824
- }
229
+ if (n)
230
+ return () => {
231
+ for (let r = 0; r < o.length; r++) {
232
+ const i = o[r];
233
+ typeof i == "function" ? i() : ye(e[r], null);
825
234
  }
826
235
  };
827
- }
828
- };
829
- }, Kn = function(e) {
830
- return e === void 0 && (e = {}), {
831
- options: e,
832
- fn(t) {
833
- const {
834
- x: n,
835
- y: o,
836
- placement: r,
837
- rects: i,
838
- middlewareData: s
839
- } = t, {
840
- offset: c = 0,
841
- mainAxis: l = !0,
842
- crossAxis: a = !0
843
- } = X(e, t), f = {
844
- x: n,
845
- y: o
846
- }, d = K(r), h = He(d);
847
- let p = f[h], m = f[d];
848
- const g = X(c, t), y = typeof g == "number" ? {
849
- mainAxis: g,
850
- crossAxis: 0
851
- } : {
852
- mainAxis: 0,
853
- crossAxis: 0,
854
- ...g
855
- };
856
- if (l) {
857
- const E = h === "y" ? "height" : "width", x = i.reference[h] - i.floating[E] + y.mainAxis, C = i.reference[h] + i.reference[E] - y.mainAxis;
858
- p < x ? p = x : p > C && (p = C);
859
- }
860
- if (a) {
861
- var w, v;
862
- const E = h === "y" ? "width" : "height", x = ["top", "left"].includes(G(r)), C = i.reference[d] - i.floating[E] + (x && ((w = s.offset) == null ? void 0 : w[d]) || 0) + (x ? 0 : y.crossAxis), P = i.reference[d] + i.reference[E] + (x ? 0 : ((v = s.offset) == null ? void 0 : v[d]) || 0) - (x ? y.crossAxis : 0);
863
- m < C ? m = C : m > P && (m = P);
864
- }
865
- return {
866
- [h]: p,
867
- [d]: m
868
- };
869
- }
870
236
  };
871
- }, Zn = function(e) {
872
- return e === void 0 && (e = {}), {
873
- name: "size",
874
- options: e,
875
- async fn(t) {
876
- var n, o;
877
- const {
878
- placement: r,
879
- rects: i,
880
- platform: s,
881
- elements: c
882
- } = t, {
883
- apply: l = () => {
884
- },
885
- ...a
886
- } = X(e, t), f = await ce(t, a), d = G(r), h = re(r), p = K(r) === "y", {
887
- width: m,
888
- height: g
889
- } = i.floating;
890
- let y, w;
891
- d === "top" || d === "bottom" ? (y = d, w = h === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (w = d, y = h === "end" ? "top" : "bottom");
892
- const v = g - f.top - f.bottom, E = m - f.left - f.right, x = q(g - f[y], v), C = q(m - f[w], E), P = !t.middlewareData.shift;
893
- let b = x, O = C;
894
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (O = E), (o = t.middlewareData.shift) != null && o.enabled.y && (b = v), P && !h) {
895
- const T = W(f.left, 0), k = W(f.right, 0), $ = W(f.top, 0), D = W(f.bottom, 0);
896
- p ? O = m - 2 * (T !== 0 || k !== 0 ? T + k : W(f.left, f.right)) : b = g - 2 * ($ !== 0 || D !== 0 ? $ + D : W(f.top, f.bottom));
897
- }
898
- await l({
899
- ...t,
900
- availableWidth: O,
901
- availableHeight: b
902
- });
903
- const M = await s.getDimensions(c.floating);
904
- return m !== M.width || g !== M.height ? {
905
- reset: {
906
- rects: !0
907
- }
908
- } : {};
909
- }
910
- };
911
- };
912
- function xe() {
913
- return typeof window < "u";
914
- }
915
- function ie(e) {
916
- return Rt(e) ? (e.nodeName || "").toLowerCase() : "#document";
917
- }
918
- function F(e) {
919
- var t;
920
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
921
- }
922
- function U(e) {
923
- var t;
924
- return (t = (Rt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
925
- }
926
- function Rt(e) {
927
- return xe() ? e instanceof Node || e instanceof F(e).Node : !1;
928
- }
929
- function H(e) {
930
- return xe() ? e instanceof Element || e instanceof F(e).Element : !1;
931
- }
932
- function j(e) {
933
- return xe() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
934
- }
935
- function at(e) {
936
- return !xe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
937
- }
938
- function ue(e) {
939
- const {
940
- overflow: t,
941
- overflowX: n,
942
- overflowY: o,
943
- display: r
944
- } = B(e);
945
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(r);
946
- }
947
- function Jn(e) {
948
- return ["table", "td", "th"].includes(ie(e));
949
- }
950
- function be(e) {
951
- return [":popover-open", ":modal"].some((t) => {
952
- try {
953
- return e.matches(t);
954
- } catch {
955
- return !1;
956
- }
957
- });
958
- }
959
- function ze(e) {
960
- const t = je(), n = H(e) ? B(e) : e;
961
- return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
962
- }
963
- function Qn(e) {
964
- let t = Z(e);
965
- for (; j(t) && !te(t); ) {
966
- if (ze(t))
967
- return t;
968
- if (be(t))
969
- return null;
970
- t = Z(t);
971
- }
972
- return null;
973
237
  }
974
- function je() {
975
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
976
- }
977
- function te(e) {
978
- return ["html", "body", "#document"].includes(ie(e));
979
- }
980
- function B(e) {
981
- return F(e).getComputedStyle(e);
982
- }
983
- function Ce(e) {
984
- return H(e) ? {
985
- scrollLeft: e.scrollLeft,
986
- scrollTop: e.scrollTop
987
- } : {
988
- scrollLeft: e.scrollX,
989
- scrollTop: e.scrollY
990
- };
991
- }
992
- function Z(e) {
993
- if (ie(e) === "html")
994
- return e;
995
- const t = (
996
- // Step into the shadow DOM of the parent of a slotted node.
997
- e.assignedSlot || // DOM Element detected.
998
- e.parentNode || // ShadowRoot detected.
999
- at(e) && e.host || // Fallback.
1000
- U(e)
1001
- );
1002
- return at(t) ? t.host : t;
1003
- }
1004
- function Ot(e) {
1005
- const t = Z(e);
1006
- return te(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : j(t) && ue(t) ? t : Ot(t);
1007
- }
1008
- function le(e, t, n) {
1009
- var o;
1010
- t === void 0 && (t = []), n === void 0 && (n = !0);
1011
- const r = Ot(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = F(r);
1012
- if (i) {
1013
- const c = ke(s);
1014
- return t.concat(s, s.visualViewport || [], ue(r) ? r : [], c && n ? le(c) : []);
1015
- }
1016
- return t.concat(r, le(r, [], n));
1017
- }
1018
- function ke(e) {
1019
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1020
- }
1021
- function Tt(e) {
1022
- const t = B(e);
1023
- let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
1024
- const r = j(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, c = ge(n) !== i || ge(o) !== s;
1025
- return c && (n = i, o = s), {
1026
- width: n,
1027
- height: o,
1028
- $: c
1029
- };
1030
- }
1031
- function Ue(e) {
1032
- return H(e) ? e : e.contextElement;
1033
- }
1034
- function Q(e) {
1035
- const t = Ue(e);
1036
- if (!j(t))
1037
- return z(1);
1038
- const n = t.getBoundingClientRect(), {
1039
- width: o,
1040
- height: r,
1041
- $: i
1042
- } = Tt(t);
1043
- let s = (i ? ge(n.width) : n.width) / o, c = (i ? ge(n.height) : n.height) / r;
1044
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
1045
- x: s,
1046
- y: c
1047
- };
1048
- }
1049
- const eo = /* @__PURE__ */ z(0);
1050
- function St(e) {
1051
- const t = F(e);
1052
- return !je() || !t.visualViewport ? eo : {
1053
- x: t.visualViewport.offsetLeft,
1054
- y: t.visualViewport.offsetTop
1055
- };
1056
- }
1057
- function to(e, t, n) {
1058
- return t === void 0 && (t = !1), !n || t && n !== F(e) ? !1 : t;
1059
- }
1060
- function J(e, t, n, o) {
1061
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1062
- const r = e.getBoundingClientRect(), i = Ue(e);
1063
- let s = z(1);
1064
- t && (o ? H(o) && (s = Q(o)) : s = Q(e));
1065
- const c = to(i, n, o) ? St(i) : z(0);
1066
- let l = (r.left + c.x) / s.x, a = (r.top + c.y) / s.y, f = r.width / s.x, d = r.height / s.y;
238
+ var Oe = s.forwardRef((e, t) => {
239
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Ut);
1067
240
  if (i) {
1068
- const h = F(i), p = o && H(o) ? F(o) : o;
1069
- let m = h, g = ke(m);
1070
- for (; g && o && p !== m; ) {
1071
- const y = Q(g), w = g.getBoundingClientRect(), v = B(g), E = w.left + (g.clientLeft + parseFloat(v.paddingLeft)) * y.x, x = w.top + (g.clientTop + parseFloat(v.paddingTop)) * y.y;
1072
- l *= y.x, a *= y.y, f *= y.x, d *= y.y, l += E, a += x, m = F(g), g = ke(m);
1073
- }
241
+ const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
242
+ return /* @__PURE__ */ f(z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
1074
243
  }
1075
- return we({
1076
- width: f,
1077
- height: d,
1078
- x: l,
1079
- y: a
1080
- });
1081
- }
1082
- function Ye(e, t) {
1083
- const n = Ce(e).scrollLeft;
1084
- return t ? t.left + n : J(U(e)).left + n;
1085
- }
1086
- function Dt(e, t, n) {
1087
- n === void 0 && (n = !1);
1088
- const o = e.getBoundingClientRect(), r = o.left + t.scrollLeft - (n ? 0 : (
1089
- // RTL <body> scrollbar.
1090
- Ye(e, o)
1091
- )), i = o.top + t.scrollTop;
1092
- return {
1093
- x: r,
1094
- y: i
1095
- };
1096
- }
1097
- function no(e) {
1098
- let {
1099
- elements: t,
1100
- rect: n,
1101
- offsetParent: o,
1102
- strategy: r
1103
- } = e;
1104
- const i = r === "fixed", s = U(o), c = t ? be(t.floating) : !1;
1105
- if (o === s || c && i)
1106
- return n;
1107
- let l = {
1108
- scrollLeft: 0,
1109
- scrollTop: 0
1110
- }, a = z(1);
1111
- const f = z(0), d = j(o);
1112
- if ((d || !d && !i) && ((ie(o) !== "body" || ue(s)) && (l = Ce(o)), j(o))) {
1113
- const p = J(o);
1114
- a = Q(o), f.x = p.x + o.clientLeft, f.y = p.y + o.clientTop;
1115
- }
1116
- const h = s && !d && !i ? Dt(s, l, !0) : z(0);
1117
- return {
1118
- width: n.width * a.x,
1119
- height: n.height * a.y,
1120
- x: n.x * a.x - l.scrollLeft * a.x + f.x + h.x,
1121
- y: n.y * a.y - l.scrollTop * a.y + f.y + h.y
1122
- };
1123
- }
1124
- function oo(e) {
1125
- return Array.from(e.getClientRects());
1126
- }
1127
- function ro(e) {
1128
- const t = U(e), n = Ce(e), o = e.ownerDocument.body, r = W(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = W(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1129
- let s = -n.scrollLeft + Ye(e);
1130
- const c = -n.scrollTop;
1131
- return B(o).direction === "rtl" && (s += W(t.clientWidth, o.clientWidth) - r), {
1132
- width: r,
1133
- height: i,
1134
- x: s,
1135
- y: c
1136
- };
1137
- }
1138
- function io(e, t) {
1139
- const n = F(e), o = U(e), r = n.visualViewport;
1140
- let i = o.clientWidth, s = o.clientHeight, c = 0, l = 0;
1141
- if (r) {
1142
- i = r.width, s = r.height;
1143
- const a = je();
1144
- (!a || a && t === "fixed") && (c = r.offsetLeft, l = r.offsetTop);
1145
- }
1146
- return {
1147
- width: i,
1148
- height: s,
1149
- x: c,
1150
- y: l
1151
- };
1152
- }
1153
- function so(e, t) {
1154
- const n = J(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = j(e) ? Q(e) : z(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, l = r * i.x, a = o * i.y;
1155
- return {
1156
- width: s,
1157
- height: c,
1158
- x: l,
1159
- y: a
1160
- };
1161
- }
1162
- function ut(e, t, n) {
1163
- let o;
1164
- if (t === "viewport")
1165
- o = io(e, n);
1166
- else if (t === "document")
1167
- o = ro(U(e));
1168
- else if (H(t))
1169
- o = so(t, n);
1170
- else {
1171
- const r = St(e);
1172
- o = {
1173
- x: t.x - r.x,
1174
- y: t.y - r.y,
1175
- width: t.width,
1176
- height: t.height
1177
- };
1178
- }
1179
- return we(o);
1180
- }
1181
- function Nt(e, t) {
1182
- const n = Z(e);
1183
- return n === t || !H(n) || te(n) ? !1 : B(n).position === "fixed" || Nt(n, t);
1184
- }
1185
- function co(e, t) {
1186
- const n = t.get(e);
1187
- if (n)
1188
- return n;
1189
- let o = le(e, [], !1).filter((c) => H(c) && ie(c) !== "body"), r = null;
1190
- const i = B(e).position === "fixed";
1191
- let s = i ? Z(e) : e;
1192
- for (; H(s) && !te(s); ) {
1193
- const c = B(s), l = ze(s);
1194
- !l && c.position === "fixed" && (r = null), (i ? !l && !r : !l && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || ue(s) && !l && Nt(e, s)) ? o = o.filter((f) => f !== s) : r = c, s = Z(s);
1195
- }
1196
- return t.set(e, o), o;
1197
- }
1198
- function lo(e) {
1199
- let {
1200
- element: t,
1201
- boundary: n,
1202
- rootBoundary: o,
1203
- strategy: r
1204
- } = e;
1205
- const s = [...n === "clippingAncestors" ? be(t) ? [] : co(t, this._c) : [].concat(n), o], c = s[0], l = s.reduce((a, f) => {
1206
- const d = ut(t, f, r);
1207
- return a.top = W(d.top, a.top), a.right = q(d.right, a.right), a.bottom = q(d.bottom, a.bottom), a.left = W(d.left, a.left), a;
1208
- }, ut(t, c, r));
1209
- return {
1210
- width: l.right - l.left,
1211
- height: l.bottom - l.top,
1212
- x: l.left,
1213
- y: l.top
1214
- };
1215
- }
1216
- function ao(e) {
1217
- const {
1218
- width: t,
1219
- height: n
1220
- } = Tt(e);
1221
- return {
1222
- width: t,
1223
- height: n
1224
- };
1225
- }
1226
- function uo(e, t, n) {
1227
- const o = j(t), r = U(t), i = n === "fixed", s = J(e, !0, i, t);
1228
- let c = {
1229
- scrollLeft: 0,
1230
- scrollTop: 0
1231
- };
1232
- const l = z(0);
1233
- if (o || !o && !i)
1234
- if ((ie(t) !== "body" || ue(r)) && (c = Ce(t)), o) {
1235
- const h = J(t, !0, i, t);
1236
- l.x = h.x + t.clientLeft, l.y = h.y + t.clientTop;
1237
- } else
1238
- r && (l.x = Ye(r));
1239
- const a = r && !o && !i ? Dt(r, c) : z(0), f = s.left + c.scrollLeft - l.x - a.x, d = s.top + c.scrollTop - l.y - a.y;
1240
- return {
1241
- x: f,
1242
- y: d,
1243
- width: s.width,
1244
- height: s.height
1245
- };
1246
- }
1247
- function Te(e) {
1248
- return B(e).position === "static";
1249
- }
1250
- function ft(e, t) {
1251
- if (!j(e) || B(e).position === "fixed")
1252
- return null;
1253
- if (t)
1254
- return t(e);
1255
- let n = e.offsetParent;
1256
- return U(e) === n && (n = n.ownerDocument.body), n;
1257
- }
1258
- function Lt(e, t) {
1259
- const n = F(e);
1260
- if (be(e))
1261
- return n;
1262
- if (!j(e)) {
1263
- let r = Z(e);
1264
- for (; r && !te(r); ) {
1265
- if (H(r) && !Te(r))
1266
- return r;
1267
- r = Z(r);
1268
- }
1269
- return n;
244
+ return /* @__PURE__ */ f(z, { ...o, ref: t, children: n });
245
+ });
246
+ Oe.displayName = "Slot";
247
+ var z = s.forwardRef((e, t) => {
248
+ const { children: n, ...o } = e;
249
+ if (s.isValidElement(n)) {
250
+ const r = Yt(n), i = jt(o, n.props);
251
+ return n.type !== s.Fragment && (i.ref = t ? Vt(t, r) : r), s.cloneElement(n, i);
1270
252
  }
1271
- let o = ft(e, t);
1272
- for (; o && Jn(o) && Te(o); )
1273
- o = ft(o, t);
1274
- return o && te(o) && Te(o) && !ze(o) ? n : o || Qn(e) || n;
1275
- }
1276
- const fo = async function(e) {
1277
- const t = this.getOffsetParent || Lt, n = this.getDimensions, o = await n(e.floating);
1278
- return {
1279
- reference: uo(e.reference, await t(e.floating), e.strategy),
1280
- floating: {
1281
- x: 0,
1282
- y: 0,
1283
- width: o.width,
1284
- height: o.height
1285
- }
1286
- };
1287
- };
1288
- function po(e) {
1289
- return B(e).direction === "rtl";
1290
- }
1291
- const ho = {
1292
- convertOffsetParentRelativeRectToViewportRelativeRect: no,
1293
- getDocumentElement: U,
1294
- getClippingRect: lo,
1295
- getOffsetParent: Lt,
1296
- getElementRects: fo,
1297
- getClientRects: oo,
1298
- getDimensions: ao,
1299
- getScale: Q,
1300
- isElement: H,
1301
- isRTL: po
1302
- };
1303
- function Mt(e, t) {
1304
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
253
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
254
+ });
255
+ z.displayName = "SlotClone";
256
+ var Bt = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
257
+ function Ut(e) {
258
+ return s.isValidElement(e) && e.type === Bt;
1305
259
  }
1306
- function mo(e, t) {
1307
- let n = null, o;
1308
- const r = U(e);
1309
- function i() {
1310
- var c;
1311
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1312
- }
1313
- function s(c, l) {
1314
- c === void 0 && (c = !1), l === void 0 && (l = 1), i();
1315
- const a = e.getBoundingClientRect(), {
1316
- left: f,
1317
- top: d,
1318
- width: h,
1319
- height: p
1320
- } = a;
1321
- if (c || t(), !h || !p)
1322
- return;
1323
- const m = pe(d), g = pe(r.clientWidth - (f + h)), y = pe(r.clientHeight - (d + p)), w = pe(f), E = {
1324
- rootMargin: -m + "px " + -g + "px " + -y + "px " + -w + "px",
1325
- threshold: W(0, q(1, l)) || 1
1326
- };
1327
- let x = !0;
1328
- function C(P) {
1329
- const b = P[0].intersectionRatio;
1330
- if (b !== l) {
1331
- if (!x)
1332
- return s();
1333
- b ? s(!1, b) : o = setTimeout(() => {
1334
- s(!1, 1e-7);
1335
- }, 1e3);
1336
- }
1337
- b === 1 && !Mt(a, e.getBoundingClientRect()) && s(), x = !1;
1338
- }
1339
- try {
1340
- n = new IntersectionObserver(C, {
1341
- ...E,
1342
- // Handle <iframe>s
1343
- root: r.ownerDocument
1344
- });
1345
- } catch {
1346
- n = new IntersectionObserver(C, E);
1347
- }
1348
- n.observe(e);
260
+ function jt(e, t) {
261
+ const n = { ...t };
262
+ for (const o in t) {
263
+ const r = e[o], i = t[o];
264
+ /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
265
+ i(...c), r(...c);
266
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
1349
267
  }
1350
- return s(!0), i;
268
+ return { ...e, ...n };
1351
269
  }
1352
- function go(e, t, n, o) {
1353
- o === void 0 && (o = {});
1354
- const {
1355
- ancestorScroll: r = !0,
1356
- ancestorResize: i = !0,
1357
- elementResize: s = typeof ResizeObserver == "function",
1358
- layoutShift: c = typeof IntersectionObserver == "function",
1359
- animationFrame: l = !1
1360
- } = o, a = Ue(e), f = r || i ? [...a ? le(a) : [], ...le(t)] : [];
1361
- f.forEach((w) => {
1362
- r && w.addEventListener("scroll", n, {
1363
- passive: !0
1364
- }), i && w.addEventListener("resize", n);
1365
- });
1366
- const d = a && c ? mo(a, n) : null;
1367
- let h = -1, p = null;
1368
- s && (p = new ResizeObserver((w) => {
1369
- let [v] = w;
1370
- v && v.target === a && p && (p.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
1371
- var E;
1372
- (E = p) == null || E.observe(t);
1373
- })), n();
1374
- }), a && !l && p.observe(a), p.observe(t));
1375
- let m, g = l ? J(e) : null;
1376
- l && y();
1377
- function y() {
1378
- const w = J(e);
1379
- g && !Mt(g, w) && n(), g = w, m = requestAnimationFrame(y);
1380
- }
1381
- return n(), () => {
1382
- var w;
1383
- f.forEach((v) => {
1384
- r && v.removeEventListener("scroll", n), i && v.removeEventListener("resize", n);
1385
- }), d == null || d(), (w = p) == null || w.disconnect(), p = null, l && cancelAnimationFrame(m);
1386
- };
270
+ function Yt(e) {
271
+ var o, r;
272
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
273
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
1387
274
  }
1388
- const yo = Gn, wo = qn, vo = Un, xo = Zn, bo = Yn, dt = jn, Co = Kn, Eo = (e, t, n) => {
1389
- const o = /* @__PURE__ */ new Map(), r = {
1390
- platform: ho,
1391
- ...n
1392
- }, i = {
1393
- ...r.platform,
1394
- _c: o
1395
- };
1396
- return zn(e, t, {
1397
- ...r,
1398
- platform: i
275
+ var Gt = [
276
+ "a",
277
+ "button",
278
+ "div",
279
+ "form",
280
+ "h2",
281
+ "h3",
282
+ "img",
283
+ "input",
284
+ "label",
285
+ "li",
286
+ "nav",
287
+ "ol",
288
+ "p",
289
+ "span",
290
+ "svg",
291
+ "ul"
292
+ ], Xt = Gt.reduce((e, t) => {
293
+ const n = s.forwardRef((o, r) => {
294
+ const { asChild: i, ...a } = o, c = i ? Oe : t;
295
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
1399
296
  });
1400
- };
1401
- var me = typeof document < "u" ? mn : gn;
1402
- function ve(e, t) {
1403
- if (e === t)
1404
- return !0;
1405
- if (typeof e != typeof t)
1406
- return !1;
1407
- if (typeof e == "function" && e.toString() === t.toString())
1408
- return !0;
1409
- let n, o, r;
1410
- if (e && t && typeof e == "object") {
1411
- if (Array.isArray(e)) {
1412
- if (n = e.length, n !== t.length)
1413
- return !1;
1414
- for (o = n; o-- !== 0; )
1415
- if (!ve(e[o], t[o]))
1416
- return !1;
1417
- return !0;
1418
- }
1419
- if (r = Object.keys(e), n = r.length, n !== Object.keys(t).length)
1420
- return !1;
1421
- for (o = n; o-- !== 0; )
1422
- if (!{}.hasOwnProperty.call(t, r[o]))
1423
- return !1;
1424
- for (o = n; o-- !== 0; ) {
1425
- const i = r[o];
1426
- if (!(i === "_owner" && e.$$typeof) && !ve(e[i], t[i]))
1427
- return !1;
1428
- }
1429
- return !0;
1430
- }
1431
- return e !== e && t !== t;
1432
- }
1433
- function _t(e) {
1434
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1435
- }
1436
- function pt(e, t) {
1437
- const n = _t(e);
1438
- return Math.round(t * n) / n;
1439
- }
1440
- function Se(e) {
1441
- const t = u.useRef(e);
1442
- return me(() => {
1443
- t.current = e;
1444
- }), t;
1445
- }
1446
- function Ao(e) {
1447
- e === void 0 && (e = {});
1448
- const {
1449
- placement: t = "bottom",
1450
- strategy: n = "absolute",
1451
- middleware: o = [],
1452
- platform: r,
1453
- elements: {
1454
- reference: i,
1455
- floating: s
1456
- } = {},
1457
- transform: c = !0,
1458
- whileElementsMounted: l,
1459
- open: a
1460
- } = e, [f, d] = u.useState({
1461
- x: 0,
1462
- y: 0,
1463
- strategy: n,
1464
- placement: t,
1465
- middlewareData: {},
1466
- isPositioned: !1
1467
- }), [h, p] = u.useState(o);
1468
- ve(h, o) || p(o);
1469
- const [m, g] = u.useState(null), [y, w] = u.useState(null), v = u.useCallback((R) => {
1470
- R !== P.current && (P.current = R, g(R));
1471
- }, []), E = u.useCallback((R) => {
1472
- R !== b.current && (b.current = R, w(R));
1473
- }, []), x = i || m, C = s || y, P = u.useRef(null), b = u.useRef(null), O = u.useRef(f), M = l != null, T = Se(l), k = Se(r), $ = Se(a), D = u.useCallback(() => {
1474
- if (!P.current || !b.current)
1475
- return;
1476
- const R = {
1477
- placement: t,
1478
- strategy: n,
1479
- middleware: h
1480
- };
1481
- k.current && (R.platform = k.current), Eo(P.current, b.current, R).then((_) => {
1482
- const V = {
1483
- ..._,
1484
- // The floating element's position may be recomputed while it's closed
1485
- // but still mounted (such as when transitioning out). To ensure
1486
- // `isPositioned` will be `false` initially on the next open, avoid
1487
- // setting it to `true` when `open === false` (must be specified).
1488
- isPositioned: $.current !== !1
1489
- };
1490
- S.current && !ve(O.current, V) && (O.current = V, yt.flushSync(() => {
1491
- d(V);
1492
- }));
1493
- });
1494
- }, [h, t, n, k, $]);
1495
- me(() => {
1496
- a === !1 && O.current.isPositioned && (O.current.isPositioned = !1, d((R) => ({
1497
- ...R,
1498
- isPositioned: !1
1499
- })));
1500
- }, [a]);
1501
- const S = u.useRef(!1);
1502
- me(() => (S.current = !0, () => {
1503
- S.current = !1;
1504
- }), []), me(() => {
1505
- if (x && (P.current = x), C && (b.current = C), x && C) {
1506
- if (T.current)
1507
- return T.current(x, C, D);
1508
- D();
1509
- }
1510
- }, [x, C, D, T, M]);
1511
- const I = u.useMemo(() => ({
1512
- reference: P,
1513
- floating: b,
1514
- setReference: v,
1515
- setFloating: E
1516
- }), [v, E]), N = u.useMemo(() => ({
1517
- reference: x,
1518
- floating: C
1519
- }), [x, C]), L = u.useMemo(() => {
1520
- const R = {
1521
- position: n,
1522
- left: 0,
1523
- top: 0
1524
- };
1525
- if (!N.floating)
1526
- return R;
1527
- const _ = pt(N.floating, f.x), V = pt(N.floating, f.y);
1528
- return c ? {
1529
- ...R,
1530
- transform: "translate(" + _ + "px, " + V + "px)",
1531
- ..._t(N.floating) >= 1.5 && {
1532
- willChange: "transform"
1533
- }
1534
- } : {
1535
- position: n,
1536
- left: _,
1537
- top: V
1538
- };
1539
- }, [n, c, N.floating, f.x, f.y]);
1540
- return u.useMemo(() => ({
1541
- ...f,
1542
- update: D,
1543
- refs: I,
1544
- elements: N,
1545
- floatingStyles: L
1546
- }), [f, D, I, N, L]);
1547
- }
1548
- const Po = (e) => {
1549
- function t(n) {
1550
- return {}.hasOwnProperty.call(n, "current");
1551
- }
1552
- return {
1553
- name: "arrow",
1554
- options: e,
1555
- fn(n) {
1556
- const {
1557
- element: o,
1558
- padding: r
1559
- } = typeof e == "function" ? e(n) : e;
1560
- return o && t(o) ? o.current != null ? dt({
1561
- element: o.current,
1562
- padding: r
1563
- }).fn(n) : {} : o ? dt({
1564
- element: o,
1565
- padding: r
1566
- }).fn(n) : {};
297
+ return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
298
+ }, {}), zt = "Arrow", Ne = s.forwardRef((e, t) => {
299
+ const { children: n, width: o = 10, height: r = 5, ...i } = e;
300
+ return /* @__PURE__ */ f(
301
+ Xt.svg,
302
+ {
303
+ ...i,
304
+ ref: t,
305
+ width: o,
306
+ height: r,
307
+ viewBox: "0 0 30 10",
308
+ preserveAspectRatio: "none",
309
+ children: e.asChild ? n : /* @__PURE__ */ f("polygon", { points: "0,0 30,0 15,10" })
1567
310
  }
1568
- };
1569
- }, Ro = (e, t) => ({
1570
- ...yo(e),
1571
- options: [e, t]
1572
- }), Oo = (e, t) => ({
1573
- ...wo(e),
1574
- options: [e, t]
1575
- }), To = (e, t) => ({
1576
- ...Co(e),
1577
- options: [e, t]
1578
- }), So = (e, t) => ({
1579
- ...vo(e),
1580
- options: [e, t]
1581
- }), Do = (e, t) => ({
1582
- ...xo(e),
1583
- options: [e, t]
1584
- }), No = (e, t) => ({
1585
- ...bo(e),
1586
- options: [e, t]
1587
- }), Lo = (e, t) => ({
1588
- ...Po(e),
1589
- options: [e, t]
311
+ );
1590
312
  });
1591
- function ht(e, t) {
313
+ Ne.displayName = zt;
314
+ var Zt = Ne;
315
+ function ge(e, t) {
1592
316
  if (typeof e == "function")
1593
317
  return e(t);
1594
318
  e != null && (e.current = t);
1595
319
  }
1596
- function kt(...e) {
320
+ function Se(...e) {
1597
321
  return (t) => {
1598
322
  let n = !1;
1599
323
  const o = e.map((r) => {
1600
- const i = ht(r, t);
324
+ const i = ge(r, t);
1601
325
  return !n && typeof i == "function" && (n = !0), i;
1602
326
  });
1603
327
  if (n)
1604
328
  return () => {
1605
329
  for (let r = 0; r < o.length; r++) {
1606
330
  const i = o[r];
1607
- typeof i == "function" ? i() : ht(e[r], null);
331
+ typeof i == "function" ? i() : ge(e[r], null);
1608
332
  }
1609
333
  };
1610
334
  };
1611
335
  }
1612
- function $t(...e) {
1613
- return u.useCallback(kt(...e), e);
336
+ function De(...e) {
337
+ return s.useCallback(Se(...e), e);
1614
338
  }
1615
- var Wt = u.forwardRef((e, t) => {
1616
- const { children: n, ...o } = e, r = u.Children.toArray(n), i = r.find(_o);
339
+ var _e = s.forwardRef((e, t) => {
340
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Kt);
1617
341
  if (i) {
1618
- const s = i.props.children, c = r.map((l) => l === i ? u.Children.count(s) > 1 ? u.Children.only(null) : u.isValidElement(s) ? s.props.children : null : l);
1619
- return /* @__PURE__ */ A($e, { ...o, ref: t, children: u.isValidElement(s) ? u.cloneElement(s, void 0, c) : null });
342
+ const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
343
+ return /* @__PURE__ */ f(Z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
1620
344
  }
1621
- return /* @__PURE__ */ A($e, { ...o, ref: t, children: n });
345
+ return /* @__PURE__ */ f(Z, { ...o, ref: t, children: n });
1622
346
  });
1623
- Wt.displayName = "Slot";
1624
- var $e = u.forwardRef((e, t) => {
347
+ _e.displayName = "Slot";
348
+ var Z = s.forwardRef((e, t) => {
1625
349
  const { children: n, ...o } = e;
1626
- if (u.isValidElement(n)) {
1627
- const r = $o(n), i = ko(o, n.props);
1628
- return n.type !== u.Fragment && (i.ref = t ? kt(t, r) : r), u.cloneElement(n, i);
350
+ if (s.isValidElement(n)) {
351
+ const r = Qt(n), i = Jt(o, n.props);
352
+ return n.type !== s.Fragment && (i.ref = t ? Se(t, r) : r), s.cloneElement(n, i);
1629
353
  }
1630
- return u.Children.count(n) > 1 ? u.Children.only(null) : null;
354
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
1631
355
  });
1632
- $e.displayName = "SlotClone";
1633
- var Mo = ({ children: e }) => /* @__PURE__ */ A(gt, { children: e });
1634
- function _o(e) {
1635
- return u.isValidElement(e) && e.type === Mo;
356
+ Z.displayName = "SlotClone";
357
+ var qt = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
358
+ function Kt(e) {
359
+ return s.isValidElement(e) && e.type === qt;
1636
360
  }
1637
- function ko(e, t) {
361
+ function Jt(e, t) {
1638
362
  const n = { ...t };
1639
363
  for (const o in t) {
1640
364
  const r = e[o], i = t[o];
@@ -1644,12 +368,12 @@ function ko(e, t) {
1644
368
  }
1645
369
  return { ...e, ...n };
1646
370
  }
1647
- function $o(e) {
371
+ function Qt(e) {
1648
372
  var o, r;
1649
373
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
1650
374
  return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
1651
375
  }
1652
- var Wo = [
376
+ var en = [
1653
377
  "a",
1654
378
  "button",
1655
379
  "div",
@@ -1666,170 +390,131 @@ var Wo = [
1666
390
  "span",
1667
391
  "svg",
1668
392
  "ul"
1669
- ], Ee = Wo.reduce((e, t) => {
1670
- const n = u.forwardRef((o, r) => {
1671
- const { asChild: i, ...s } = o, c = i ? Wt : t;
1672
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ A(c, { ...s, ref: r });
393
+ ], Le = en.reduce((e, t) => {
394
+ const n = s.forwardRef((o, r) => {
395
+ const { asChild: i, ...a } = o, c = i ? _e : t;
396
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
1673
397
  });
1674
398
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
1675
- }, {}), Fo = "Arrow", Ft = u.forwardRef((e, t) => {
1676
- const { children: n, width: o = 10, height: r = 5, ...i } = e;
1677
- return /* @__PURE__ */ A(
1678
- Ee.svg,
1679
- {
1680
- ...i,
1681
- ref: t,
1682
- width: o,
1683
- height: r,
1684
- viewBox: "0 0 30 10",
1685
- preserveAspectRatio: "none",
1686
- children: e.asChild ? n : /* @__PURE__ */ A("polygon", { points: "0,0 30,0 15,10" })
1687
- }
1688
- );
1689
- });
1690
- Ft.displayName = Fo;
1691
- var Io = Ft;
1692
- function Ho(e) {
1693
- const [t, n] = u.useState(void 0);
1694
- return ee(() => {
1695
- if (e) {
1696
- n({ width: e.offsetWidth, height: e.offsetHeight });
1697
- const o = new ResizeObserver((r) => {
1698
- if (!Array.isArray(r) || !r.length)
1699
- return;
1700
- const i = r[0];
1701
- let s, c;
1702
- if ("borderBoxSize" in i) {
1703
- const l = i.borderBoxSize, a = Array.isArray(l) ? l[0] : l;
1704
- s = a.inlineSize, c = a.blockSize;
1705
- } else
1706
- s = e.offsetWidth, c = e.offsetHeight;
1707
- n({ width: s, height: c });
1708
- });
1709
- return o.observe(e, { box: "border-box" }), () => o.unobserve(e);
1710
- } else
1711
- n(void 0);
1712
- }, [e]), t;
1713
- }
1714
- var Xe = "Popper", [It, Ht] = vt(Xe), [Bo, Bt] = It(Xe), Vt = (e) => {
1715
- const { __scopePopper: t, children: n } = e, [o, r] = u.useState(null);
1716
- return /* @__PURE__ */ A(Bo, { scope: t, anchor: o, onAnchorChange: r, children: n });
399
+ }, {}), te = "Popper", [$e, Me] = Ee(te), [tn, Ie] = $e(te), We = (e) => {
400
+ const { __scopePopper: t, children: n } = e, [o, r] = s.useState(null);
401
+ return /* @__PURE__ */ f(tn, { scope: t, anchor: o, onAnchorChange: r, children: n });
1717
402
  };
1718
- Vt.displayName = Xe;
1719
- var zt = "PopperAnchor", jt = u.forwardRef(
403
+ We.displayName = te;
404
+ var ke = "PopperAnchor", He = s.forwardRef(
1720
405
  (e, t) => {
1721
- const { __scopePopper: n, virtualRef: o, ...r } = e, i = Bt(zt, n), s = u.useRef(null), c = $t(t, s);
1722
- return u.useEffect(() => {
1723
- i.onAnchorChange((o == null ? void 0 : o.current) || s.current);
1724
- }), o ? null : /* @__PURE__ */ A(Ee.div, { ...r, ref: c });
406
+ const { __scopePopper: n, virtualRef: o, ...r } = e, i = Ie(ke, n), a = s.useRef(null), c = De(t, a);
407
+ return s.useEffect(() => {
408
+ i.onAnchorChange((o == null ? void 0 : o.current) || a.current);
409
+ }), o ? null : /* @__PURE__ */ f(Le.div, { ...r, ref: c });
1725
410
  }
1726
411
  );
1727
- jt.displayName = zt;
1728
- var Ge = "PopperContent", [Vo, zo] = It(Ge), Ut = u.forwardRef(
412
+ He.displayName = ke;
413
+ var ne = "PopperContent", [nn, rn] = $e(ne), Fe = s.forwardRef(
1729
414
  (e, t) => {
1730
- var Ke, Ze, Je, Qe, et, tt;
415
+ var ae, le, ce, ue, de, fe;
1731
416
  const {
1732
417
  __scopePopper: n,
1733
418
  side: o = "bottom",
1734
419
  sideOffset: r = 0,
1735
420
  align: i = "center",
1736
- alignOffset: s = 0,
421
+ alignOffset: a = 0,
1737
422
  arrowPadding: c = 0,
1738
423
  avoidCollisions: l = !0,
1739
- collisionBoundary: a = [],
1740
- collisionPadding: f = 0,
1741
- sticky: d = "partial",
424
+ collisionBoundary: u = [],
425
+ collisionPadding: d = 0,
426
+ sticky: m = "partial",
1742
427
  hideWhenDetached: h = !1,
1743
428
  updatePositionStrategy: p = "optimized",
1744
- onPlaced: m,
1745
- ...g
1746
- } = e, y = Bt(Ge, n), [w, v] = u.useState(null), E = $t(t, (se) => v(se)), [x, C] = u.useState(null), P = Ho(x), b = (P == null ? void 0 : P.width) ?? 0, O = (P == null ? void 0 : P.height) ?? 0, M = o + (i !== "center" ? "-" + i : ""), T = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, k = Array.isArray(a) ? a : [a], $ = k.length > 0, D = {
1747
- padding: T,
1748
- boundary: k.filter(Uo),
429
+ onPlaced: v,
430
+ ...y
431
+ } = e, w = Ie(ne, n), [E, C] = s.useState(null), x = De(t, (D) => C(D)), [P, R] = s.useState(null), b = ht(P), g = (b == null ? void 0 : b.width) ?? 0, T = (b == null ? void 0 : b.height) ?? 0, L = o + (i !== "center" ? "-" + i : ""), S = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, oe = Array.isArray(u) ? u : [u], tt = oe.length > 0, $ = {
432
+ padding: S,
433
+ boundary: oe.filter(sn),
1749
434
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1750
- altBoundary: $
1751
- }, { refs: S, floatingStyles: I, placement: N, isPositioned: L, middlewareData: R } = Ao({
435
+ altBoundary: tt
436
+ }, { refs: nt, floatingStyles: ie, placement: rt, isPositioned: M, middlewareData: O } = wt({
1752
437
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1753
438
  strategy: "fixed",
1754
- placement: M,
1755
- whileElementsMounted: (...se) => go(...se, {
439
+ placement: L,
440
+ whileElementsMounted: (...D) => Ct(...D, {
1756
441
  animationFrame: p === "always"
1757
442
  }),
1758
443
  elements: {
1759
- reference: y.anchor
444
+ reference: w.anchor
1760
445
  },
1761
446
  middleware: [
1762
- Ro({ mainAxis: r + O, alignmentAxis: s }),
1763
- l && Oo({
447
+ Et({ mainAxis: r + T, alignmentAxis: a }),
448
+ l && Pt({
1764
449
  mainAxis: !0,
1765
450
  crossAxis: !1,
1766
- limiter: d === "partial" ? To() : void 0,
1767
- ...D
451
+ limiter: m === "partial" ? Tt() : void 0,
452
+ ...$
1768
453
  }),
1769
- l && So({ ...D }),
1770
- Do({
1771
- ...D,
1772
- apply: ({ elements: se, rects: nt, availableWidth: fn, availableHeight: dn }) => {
1773
- const { width: pn, height: hn } = nt.reference, de = se.floating.style;
1774
- de.setProperty("--radix-popper-available-width", `${fn}px`), de.setProperty("--radix-popper-available-height", `${dn}px`), de.setProperty("--radix-popper-anchor-width", `${pn}px`), de.setProperty("--radix-popper-anchor-height", `${hn}px`);
454
+ l && bt({ ...$ }),
455
+ xt({
456
+ ...$,
457
+ apply: ({ elements: D, rects: pe, availableWidth: ut, availableHeight: dt }) => {
458
+ const { width: ft, height: pt } = pe.reference, W = D.floating.style;
459
+ W.setProperty("--radix-popper-available-width", `${ut}px`), W.setProperty("--radix-popper-available-height", `${dt}px`), W.setProperty("--radix-popper-anchor-width", `${ft}px`), W.setProperty("--radix-popper-anchor-height", `${pt}px`);
1775
460
  }
1776
461
  }),
1777
- x && Lo({ element: x, padding: c }),
1778
- Yo({ arrowWidth: b, arrowHeight: O }),
1779
- h && No({ strategy: "referenceHidden", ...D })
462
+ P && Rt({ element: P, padding: c }),
463
+ an({ arrowWidth: g, arrowHeight: T }),
464
+ h && At({ strategy: "referenceHidden", ...$ })
1780
465
  ]
1781
- }), [_, V] = Gt(N), fe = oe(m);
1782
- ee(() => {
1783
- L && (fe == null || fe());
1784
- }, [L, fe]);
1785
- const sn = (Ke = R.arrow) == null ? void 0 : Ke.x, cn = (Ze = R.arrow) == null ? void 0 : Ze.y, ln = ((Je = R.arrow) == null ? void 0 : Je.centerOffset) !== 0, [an, un] = u.useState();
1786
- return ee(() => {
1787
- w && un(window.getComputedStyle(w).zIndex);
1788
- }, [w]), /* @__PURE__ */ A(
466
+ }), [se, ot] = Ue(rt), I = Q(v);
467
+ H(() => {
468
+ M && (I == null || I());
469
+ }, [M, I]);
470
+ const it = (ae = O.arrow) == null ? void 0 : ae.x, st = (le = O.arrow) == null ? void 0 : le.y, at = ((ce = O.arrow) == null ? void 0 : ce.centerOffset) !== 0, [lt, ct] = s.useState();
471
+ return H(() => {
472
+ E && ct(window.getComputedStyle(E).zIndex);
473
+ }, [E]), /* @__PURE__ */ f(
1789
474
  "div",
1790
475
  {
1791
- ref: S.setFloating,
476
+ ref: nt.setFloating,
1792
477
  "data-radix-popper-content-wrapper": "",
1793
478
  style: {
1794
- ...I,
1795
- transform: L ? I.transform : "translate(0, -200%)",
479
+ ...ie,
480
+ transform: M ? ie.transform : "translate(0, -200%)",
1796
481
  // keep off the page when measuring
1797
482
  minWidth: "max-content",
1798
- zIndex: an,
483
+ zIndex: lt,
1799
484
  "--radix-popper-transform-origin": [
1800
- (Qe = R.transformOrigin) == null ? void 0 : Qe.x,
1801
- (et = R.transformOrigin) == null ? void 0 : et.y
485
+ (ue = O.transformOrigin) == null ? void 0 : ue.x,
486
+ (de = O.transformOrigin) == null ? void 0 : de.y
1802
487
  ].join(" "),
1803
488
  // hide the content if using the hide middleware and should be hidden
1804
489
  // set visibility to hidden and disable pointer events so the UI behaves
1805
490
  // as if the PopperContent isn't there at all
1806
- ...((tt = R.hide) == null ? void 0 : tt.referenceHidden) && {
491
+ ...((fe = O.hide) == null ? void 0 : fe.referenceHidden) && {
1807
492
  visibility: "hidden",
1808
493
  pointerEvents: "none"
1809
494
  }
1810
495
  },
1811
496
  dir: e.dir,
1812
- children: /* @__PURE__ */ A(
1813
- Vo,
497
+ children: /* @__PURE__ */ f(
498
+ nn,
1814
499
  {
1815
500
  scope: n,
1816
- placedSide: _,
1817
- onArrowChange: C,
1818
- arrowX: sn,
1819
- arrowY: cn,
1820
- shouldHideArrow: ln,
1821
- children: /* @__PURE__ */ A(
1822
- Ee.div,
501
+ placedSide: se,
502
+ onArrowChange: R,
503
+ arrowX: it,
504
+ arrowY: st,
505
+ shouldHideArrow: at,
506
+ children: /* @__PURE__ */ f(
507
+ Le.div,
1823
508
  {
1824
- "data-side": _,
1825
- "data-align": V,
1826
- ...g,
1827
- ref: E,
509
+ "data-side": se,
510
+ "data-align": ot,
511
+ ...y,
512
+ ref: x,
1828
513
  style: {
1829
- ...g.style,
514
+ ...y.style,
1830
515
  // if the PopperContent hasn't been placed yet (not all measurements done)
1831
516
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
1832
- animation: L ? void 0 : "none"
517
+ animation: M ? void 0 : "none"
1833
518
  }
1834
519
  }
1835
520
  )
@@ -1839,19 +524,19 @@ var Ge = "PopperContent", [Vo, zo] = It(Ge), Ut = u.forwardRef(
1839
524
  );
1840
525
  }
1841
526
  );
1842
- Ut.displayName = Ge;
1843
- var Yt = "PopperArrow", jo = {
527
+ Fe.displayName = ne;
528
+ var Ve = "PopperArrow", on = {
1844
529
  top: "bottom",
1845
530
  right: "left",
1846
531
  bottom: "top",
1847
532
  left: "right"
1848
- }, Xt = u.forwardRef(function(t, n) {
1849
- const { __scopePopper: o, ...r } = t, i = zo(Yt, o), s = jo[i.placedSide];
533
+ }, Be = s.forwardRef(function(t, n) {
534
+ const { __scopePopper: o, ...r } = t, i = rn(Ve, o), a = on[i.placedSide];
1850
535
  return (
1851
536
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1852
537
  // doesn't report size as we'd expect on SVG elements.
1853
538
  // it reports their bounding box which is effectively the largest path inside the SVG.
1854
- /* @__PURE__ */ A(
539
+ /* @__PURE__ */ f(
1855
540
  "span",
1856
541
  {
1857
542
  ref: i.onArrowChange,
@@ -1859,7 +544,7 @@ var Yt = "PopperArrow", jo = {
1859
544
  position: "absolute",
1860
545
  left: i.arrowX,
1861
546
  top: i.arrowY,
1862
- [s]: 0,
547
+ [a]: 0,
1863
548
  transformOrigin: {
1864
549
  top: "",
1865
550
  right: "0 0",
@@ -1874,8 +559,8 @@ var Yt = "PopperArrow", jo = {
1874
559
  }[i.placedSide],
1875
560
  visibility: i.shouldHideArrow ? "hidden" : void 0
1876
561
  },
1877
- children: /* @__PURE__ */ A(
1878
- Io,
562
+ children: /* @__PURE__ */ f(
563
+ Zt,
1879
564
  {
1880
565
  ...r,
1881
566
  ref: n,
@@ -1890,35 +575,35 @@ var Yt = "PopperArrow", jo = {
1890
575
  )
1891
576
  );
1892
577
  });
1893
- Xt.displayName = Yt;
1894
- function Uo(e) {
578
+ Be.displayName = Ve;
579
+ function sn(e) {
1895
580
  return e !== null;
1896
581
  }
1897
- var Yo = (e) => ({
582
+ var an = (e) => ({
1898
583
  name: "transformOrigin",
1899
584
  options: e,
1900
585
  fn(t) {
1901
- var y, w, v;
1902
- const { placement: n, rects: o, middlewareData: r } = t, s = ((y = r.arrow) == null ? void 0 : y.centerOffset) !== 0, c = s ? 0 : e.arrowWidth, l = s ? 0 : e.arrowHeight, [a, f] = Gt(n), d = { start: "0%", center: "50%", end: "100%" }[f], h = (((w = r.arrow) == null ? void 0 : w.x) ?? 0) + c / 2, p = (((v = r.arrow) == null ? void 0 : v.y) ?? 0) + l / 2;
1903
- let m = "", g = "";
1904
- return a === "bottom" ? (m = s ? d : `${h}px`, g = `${-l}px`) : a === "top" ? (m = s ? d : `${h}px`, g = `${o.floating.height + l}px`) : a === "right" ? (m = `${-l}px`, g = s ? d : `${p}px`) : a === "left" && (m = `${o.floating.width + l}px`, g = s ? d : `${p}px`), { data: { x: m, y: g } };
586
+ var w, E, C;
587
+ const { placement: n, rects: o, middlewareData: r } = t, a = ((w = r.arrow) == null ? void 0 : w.centerOffset) !== 0, c = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [u, d] = Ue(n), m = { start: "0%", center: "50%", end: "100%" }[d], h = (((E = r.arrow) == null ? void 0 : E.x) ?? 0) + c / 2, p = (((C = r.arrow) == null ? void 0 : C.y) ?? 0) + l / 2;
588
+ let v = "", y = "";
589
+ return u === "bottom" ? (v = a ? m : `${h}px`, y = `${-l}px`) : u === "top" ? (v = a ? m : `${h}px`, y = `${o.floating.height + l}px`) : u === "right" ? (v = `${-l}px`, y = a ? m : `${p}px`) : u === "left" && (v = `${o.floating.width + l}px`, y = a ? m : `${p}px`), { data: { x: v, y } };
1905
590
  }
1906
591
  });
1907
- function Gt(e) {
592
+ function Ue(e) {
1908
593
  const [t, n = "center"] = e.split("-");
1909
594
  return [t, n];
1910
595
  }
1911
- var Xo = Vt, Go = jt, qo = Ut, Ko = Xt;
1912
- function Zo(e, t) {
1913
- return u.useReducer((n, o) => t[n][o] ?? n, e);
596
+ var ln = We, cn = He, un = Fe, dn = Be;
597
+ function fn(e, t) {
598
+ return s.useReducer((n, o) => t[n][o] ?? n, e);
1914
599
  }
1915
- var qt = (e) => {
1916
- const { present: t, children: n } = e, o = Jo(t), r = typeof n == "function" ? n({ present: o.isPresent }) : u.Children.only(n), i = ae(o.ref, Qo(r));
1917
- return typeof n == "function" || o.isPresent ? u.cloneElement(r, { ref: i }) : null;
600
+ var je = (e) => {
601
+ const { present: t, children: n } = e, o = pn(t), r = typeof n == "function" ? n({ present: o.isPresent }) : s.Children.only(n), i = _(o.ref, mn(r));
602
+ return typeof n == "function" || o.isPresent ? s.cloneElement(r, { ref: i }) : null;
1918
603
  };
1919
- qt.displayName = "Presence";
1920
- function Jo(e) {
1921
- const [t, n] = u.useState(), o = u.useRef({}), r = u.useRef(e), i = u.useRef("none"), s = e ? "mounted" : "unmounted", [c, l] = Zo(s, {
604
+ je.displayName = "Presence";
605
+ function pn(e) {
606
+ const [t, n] = s.useState(), o = s.useRef({}), r = s.useRef(e), i = s.useRef("none"), a = e ? "mounted" : "unmounted", [c, l] = fn(a, {
1922
607
  mounted: {
1923
608
  UNMOUNT: "unmounted",
1924
609
  ANIMATION_OUT: "unmountSuspended"
@@ -1931,79 +616,133 @@ function Jo(e) {
1931
616
  MOUNT: "mounted"
1932
617
  }
1933
618
  });
1934
- return u.useEffect(() => {
1935
- const a = he(o.current);
1936
- i.current = c === "mounted" ? a : "none";
1937
- }, [c]), ee(() => {
1938
- const a = o.current, f = r.current;
1939
- if (f !== e) {
1940
- const h = i.current, p = he(a);
1941
- e ? l("MOUNT") : p === "none" || (a == null ? void 0 : a.display) === "none" ? l("UNMOUNT") : l(f && h !== p ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
619
+ return s.useEffect(() => {
620
+ const u = k(o.current);
621
+ i.current = c === "mounted" ? u : "none";
622
+ }, [c]), H(() => {
623
+ const u = o.current, d = r.current;
624
+ if (d !== e) {
625
+ const h = i.current, p = k(u);
626
+ e ? l("MOUNT") : p === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(d && h !== p ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
1942
627
  }
1943
- }, [e, l]), ee(() => {
628
+ }, [e, l]), H(() => {
1944
629
  if (t) {
1945
- let a;
1946
- const f = t.ownerDocument.defaultView ?? window, d = (p) => {
1947
- const g = he(o.current).includes(p.animationName);
1948
- if (p.target === t && g && (l("ANIMATION_END"), !r.current)) {
1949
- const y = t.style.animationFillMode;
1950
- t.style.animationFillMode = "forwards", a = f.setTimeout(() => {
1951
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = y);
630
+ let u;
631
+ const d = t.ownerDocument.defaultView ?? window, m = (p) => {
632
+ const y = k(o.current).includes(p.animationName);
633
+ if (p.target === t && y && (l("ANIMATION_END"), !r.current)) {
634
+ const w = t.style.animationFillMode;
635
+ t.style.animationFillMode = "forwards", u = d.setTimeout(() => {
636
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = w);
1952
637
  });
1953
638
  }
1954
639
  }, h = (p) => {
1955
- p.target === t && (i.current = he(o.current));
640
+ p.target === t && (i.current = k(o.current));
1956
641
  };
1957
- return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
1958
- f.clearTimeout(a), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
642
+ return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", m), t.addEventListener("animationend", m), () => {
643
+ d.clearTimeout(u), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", m), t.removeEventListener("animationend", m);
1959
644
  };
1960
645
  } else
1961
646
  l("ANIMATION_END");
1962
647
  }, [t, l]), {
1963
648
  isPresent: ["mounted", "unmountSuspended"].includes(c),
1964
- ref: u.useCallback((a) => {
1965
- a && (o.current = getComputedStyle(a)), n(a);
649
+ ref: s.useCallback((u) => {
650
+ u && (o.current = getComputedStyle(u)), n(u);
1966
651
  }, [])
1967
652
  };
1968
653
  }
1969
- function he(e) {
654
+ function k(e) {
1970
655
  return (e == null ? void 0 : e.animationName) || "none";
1971
656
  }
1972
- function Qo(e) {
657
+ function mn(e) {
1973
658
  var o, r;
1974
659
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
1975
660
  return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
1976
661
  }
1977
- function er({
1978
- prop: e,
1979
- defaultProp: t,
1980
- onChange: n = () => {
662
+ function we(e, t) {
663
+ if (typeof e == "function")
664
+ return e(t);
665
+ e != null && (e.current = t);
666
+ }
667
+ function hn(...e) {
668
+ return (t) => {
669
+ let n = !1;
670
+ const o = e.map((r) => {
671
+ const i = we(r, t);
672
+ return !n && typeof i == "function" && (n = !0), i;
673
+ });
674
+ if (n)
675
+ return () => {
676
+ for (let r = 0; r < o.length; r++) {
677
+ const i = o[r];
678
+ typeof i == "function" ? i() : we(e[r], null);
679
+ }
680
+ };
681
+ };
682
+ }
683
+ var Ye = s.forwardRef((e, t) => {
684
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(yn);
685
+ if (i) {
686
+ const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
687
+ return /* @__PURE__ */ f(q, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
1981
688
  }
1982
- }) {
1983
- const [o, r] = tr({ defaultProp: t, onChange: n }), i = e !== void 0, s = i ? e : o, c = oe(n), l = u.useCallback(
1984
- (a) => {
1985
- if (i) {
1986
- const d = typeof a == "function" ? a(e) : a;
1987
- d !== e && c(d);
1988
- } else
1989
- r(a);
1990
- },
1991
- [i, e, r, c]
1992
- );
1993
- return [s, l];
689
+ return /* @__PURE__ */ f(q, { ...o, ref: t, children: n });
690
+ });
691
+ Ye.displayName = "Slot";
692
+ var q = s.forwardRef((e, t) => {
693
+ const { children: n, ...o } = e;
694
+ if (s.isValidElement(n)) {
695
+ const r = wn(n), i = gn(o, n.props);
696
+ return n.type !== s.Fragment && (i.ref = t ? hn(t, r) : r), s.cloneElement(n, i);
697
+ }
698
+ return s.Children.count(n) > 1 ? s.Children.only(null) : null;
699
+ });
700
+ q.displayName = "SlotClone";
701
+ var vn = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
702
+ function yn(e) {
703
+ return s.isValidElement(e) && e.type === vn;
1994
704
  }
1995
- function tr({
1996
- defaultProp: e,
1997
- onChange: t
1998
- }) {
1999
- const n = u.useState(e), [o] = n, r = u.useRef(o), i = oe(t);
2000
- return u.useEffect(() => {
2001
- r.current !== o && (i(o), r.current = o);
2002
- }, [o, r, i]), n;
705
+ function gn(e, t) {
706
+ const n = { ...t };
707
+ for (const o in t) {
708
+ const r = e[o], i = t[o];
709
+ /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
710
+ i(...c), r(...c);
711
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
712
+ }
713
+ return { ...e, ...n };
2003
714
  }
2004
- var nr = "VisuallyHidden", Kt = u.forwardRef(
2005
- (e, t) => /* @__PURE__ */ A(
2006
- Ee.span,
715
+ function wn(e) {
716
+ var o, r;
717
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
718
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
719
+ }
720
+ var Cn = [
721
+ "a",
722
+ "button",
723
+ "div",
724
+ "form",
725
+ "h2",
726
+ "h3",
727
+ "img",
728
+ "input",
729
+ "label",
730
+ "li",
731
+ "nav",
732
+ "ol",
733
+ "p",
734
+ "span",
735
+ "svg",
736
+ "ul"
737
+ ], En = Cn.reduce((e, t) => {
738
+ const n = s.forwardRef((o, r) => {
739
+ const { asChild: i, ...a } = o, c = i ? Ye : t;
740
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
741
+ });
742
+ return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
743
+ }, {}), Pn = "VisuallyHidden", Ge = s.forwardRef(
744
+ (e, t) => /* @__PURE__ */ f(
745
+ En.span,
2007
746
  {
2008
747
  ...e,
2009
748
  ref: t,
@@ -2024,188 +763,188 @@ var nr = "VisuallyHidden", Kt = u.forwardRef(
2024
763
  }
2025
764
  )
2026
765
  );
2027
- Kt.displayName = nr;
2028
- var or = Kt, [Ae, Ar] = vt("Tooltip", [
2029
- Ht
2030
- ]), Pe = Ht(), Zt = "TooltipProvider", rr = 700, We = "tooltip.open", [ir, qe] = Ae(Zt), Jt = (e) => {
766
+ Ge.displayName = Pn;
767
+ var bn = Ge, [V, Gn] = Ee("Tooltip", [
768
+ Me
769
+ ]), B = Me(), Xe = "TooltipProvider", xn = 700, K = "tooltip.open", [Rn, re] = V(Xe), ze = (e) => {
2031
770
  const {
2032
771
  __scopeTooltip: t,
2033
- delayDuration: n = rr,
772
+ delayDuration: n = xn,
2034
773
  skipDelayDuration: o = 300,
2035
774
  disableHoverableContent: r = !1,
2036
775
  children: i
2037
- } = e, [s, c] = u.useState(!0), l = u.useRef(!1), a = u.useRef(0);
2038
- return u.useEffect(() => {
2039
- const f = a.current;
2040
- return () => window.clearTimeout(f);
2041
- }, []), /* @__PURE__ */ A(
2042
- ir,
776
+ } = e, [a, c] = s.useState(!0), l = s.useRef(!1), u = s.useRef(0);
777
+ return s.useEffect(() => {
778
+ const d = u.current;
779
+ return () => window.clearTimeout(d);
780
+ }, []), /* @__PURE__ */ f(
781
+ Rn,
2043
782
  {
2044
783
  scope: t,
2045
- isOpenDelayed: s,
784
+ isOpenDelayed: a,
2046
785
  delayDuration: n,
2047
- onOpen: u.useCallback(() => {
2048
- window.clearTimeout(a.current), c(!1);
786
+ onOpen: s.useCallback(() => {
787
+ window.clearTimeout(u.current), c(!1);
2049
788
  }, []),
2050
- onClose: u.useCallback(() => {
2051
- window.clearTimeout(a.current), a.current = window.setTimeout(
789
+ onClose: s.useCallback(() => {
790
+ window.clearTimeout(u.current), u.current = window.setTimeout(
2052
791
  () => c(!0),
2053
792
  o
2054
793
  );
2055
794
  }, [o]),
2056
795
  isPointerInTransitRef: l,
2057
- onPointerInTransitChange: u.useCallback((f) => {
2058
- l.current = f;
796
+ onPointerInTransitChange: s.useCallback((d) => {
797
+ l.current = d;
2059
798
  }, []),
2060
799
  disableHoverableContent: r,
2061
800
  children: i
2062
801
  }
2063
802
  );
2064
803
  };
2065
- Jt.displayName = Zt;
2066
- var Re = "Tooltip", [sr, Oe] = Ae(Re), Qt = (e) => {
804
+ ze.displayName = Xe;
805
+ var U = "Tooltip", [An, j] = V(U), Ze = (e) => {
2067
806
  const {
2068
807
  __scopeTooltip: t,
2069
808
  children: n,
2070
809
  open: o,
2071
810
  defaultOpen: r = !1,
2072
811
  onOpenChange: i,
2073
- disableHoverableContent: s,
812
+ disableHoverableContent: a,
2074
813
  delayDuration: c
2075
- } = e, l = qe(Re, e.__scopeTooltip), a = Pe(t), [f, d] = u.useState(null), h = _n(), p = u.useRef(0), m = s ?? l.disableHoverableContent, g = c ?? l.delayDuration, y = u.useRef(!1), [w = !1, v] = er({
814
+ } = e, l = re(U, e.__scopeTooltip), u = B(t), [d, m] = s.useState(null), h = Ot(), p = s.useRef(0), v = a ?? l.disableHoverableContent, y = c ?? l.delayDuration, w = s.useRef(!1), [E = !1, C] = vt({
2076
815
  prop: o,
2077
816
  defaultProp: r,
2078
- onChange: (b) => {
2079
- b ? (l.onOpen(), document.dispatchEvent(new CustomEvent(We))) : l.onClose(), i == null || i(b);
817
+ onChange: (g) => {
818
+ g ? (l.onOpen(), document.dispatchEvent(new CustomEvent(K))) : l.onClose(), i == null || i(g);
2080
819
  }
2081
- }), E = u.useMemo(() => w ? y.current ? "delayed-open" : "instant-open" : "closed", [w]), x = u.useCallback(() => {
2082
- window.clearTimeout(p.current), p.current = 0, y.current = !1, v(!0);
2083
- }, [v]), C = u.useCallback(() => {
2084
- window.clearTimeout(p.current), p.current = 0, v(!1);
2085
- }, [v]), P = u.useCallback(() => {
820
+ }), x = s.useMemo(() => E ? w.current ? "delayed-open" : "instant-open" : "closed", [E]), P = s.useCallback(() => {
821
+ window.clearTimeout(p.current), p.current = 0, w.current = !1, C(!0);
822
+ }, [C]), R = s.useCallback(() => {
823
+ window.clearTimeout(p.current), p.current = 0, C(!1);
824
+ }, [C]), b = s.useCallback(() => {
2086
825
  window.clearTimeout(p.current), p.current = window.setTimeout(() => {
2087
- y.current = !0, v(!0), p.current = 0;
2088
- }, g);
2089
- }, [g, v]);
2090
- return u.useEffect(() => () => {
826
+ w.current = !0, C(!0), p.current = 0;
827
+ }, y);
828
+ }, [y, C]);
829
+ return s.useEffect(() => () => {
2091
830
  p.current && (window.clearTimeout(p.current), p.current = 0);
2092
- }, []), /* @__PURE__ */ A(Xo, { ...a, children: /* @__PURE__ */ A(
2093
- sr,
831
+ }, []), /* @__PURE__ */ f(ln, { ...u, children: /* @__PURE__ */ f(
832
+ An,
2094
833
  {
2095
834
  scope: t,
2096
835
  contentId: h,
2097
- open: w,
2098
- stateAttribute: E,
2099
- trigger: f,
2100
- onTriggerChange: d,
2101
- onTriggerEnter: u.useCallback(() => {
2102
- l.isOpenDelayed ? P() : x();
2103
- }, [l.isOpenDelayed, P, x]),
2104
- onTriggerLeave: u.useCallback(() => {
2105
- m ? C() : (window.clearTimeout(p.current), p.current = 0);
2106
- }, [C, m]),
2107
- onOpen: x,
2108
- onClose: C,
2109
- disableHoverableContent: m,
836
+ open: E,
837
+ stateAttribute: x,
838
+ trigger: d,
839
+ onTriggerChange: m,
840
+ onTriggerEnter: s.useCallback(() => {
841
+ l.isOpenDelayed ? b() : P();
842
+ }, [l.isOpenDelayed, b, P]),
843
+ onTriggerLeave: s.useCallback(() => {
844
+ v ? R() : (window.clearTimeout(p.current), p.current = 0);
845
+ }, [R, v]),
846
+ onOpen: P,
847
+ onClose: R,
848
+ disableHoverableContent: v,
2110
849
  children: n
2111
850
  }
2112
851
  ) });
2113
852
  };
2114
- Qt.displayName = Re;
2115
- var Fe = "TooltipTrigger", en = u.forwardRef(
853
+ Ze.displayName = U;
854
+ var J = "TooltipTrigger", qe = s.forwardRef(
2116
855
  (e, t) => {
2117
- const { __scopeTooltip: n, ...o } = e, r = Oe(Fe, n), i = qe(Fe, n), s = Pe(n), c = u.useRef(null), l = ae(t, c, r.onTriggerChange), a = u.useRef(!1), f = u.useRef(!1), d = u.useCallback(() => a.current = !1, []);
2118
- return u.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ A(Go, { asChild: !0, ...s, children: /* @__PURE__ */ A(
2119
- Ie.button,
856
+ const { __scopeTooltip: n, ...o } = e, r = j(J, n), i = re(J, n), a = B(n), c = s.useRef(null), l = _(t, c, r.onTriggerChange), u = s.useRef(!1), d = s.useRef(!1), m = s.useCallback(() => u.current = !1, []);
857
+ return s.useEffect(() => () => document.removeEventListener("pointerup", m), [m]), /* @__PURE__ */ f(cn, { asChild: !0, ...a, children: /* @__PURE__ */ f(
858
+ ee.button,
2120
859
  {
2121
860
  "aria-describedby": r.open ? r.contentId : void 0,
2122
861
  "data-state": r.stateAttribute,
2123
862
  ...o,
2124
863
  ref: l,
2125
- onPointerMove: Y(e.onPointerMove, (h) => {
2126
- h.pointerType !== "touch" && !f.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), f.current = !0);
864
+ onPointerMove: A(e.onPointerMove, (h) => {
865
+ h.pointerType !== "touch" && !d.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), d.current = !0);
2127
866
  }),
2128
- onPointerLeave: Y(e.onPointerLeave, () => {
2129
- r.onTriggerLeave(), f.current = !1;
867
+ onPointerLeave: A(e.onPointerLeave, () => {
868
+ r.onTriggerLeave(), d.current = !1;
2130
869
  }),
2131
- onPointerDown: Y(e.onPointerDown, () => {
2132
- a.current = !0, document.addEventListener("pointerup", d, { once: !0 });
870
+ onPointerDown: A(e.onPointerDown, () => {
871
+ u.current = !0, document.addEventListener("pointerup", m, { once: !0 });
2133
872
  }),
2134
- onFocus: Y(e.onFocus, () => {
2135
- a.current || r.onOpen();
873
+ onFocus: A(e.onFocus, () => {
874
+ u.current || r.onOpen();
2136
875
  }),
2137
- onBlur: Y(e.onBlur, r.onClose),
2138
- onClick: Y(e.onClick, r.onClose)
876
+ onBlur: A(e.onBlur, r.onClose),
877
+ onClick: A(e.onClick, r.onClose)
2139
878
  }
2140
879
  ) });
2141
880
  }
2142
881
  );
2143
- en.displayName = Fe;
2144
- var cr = "TooltipPortal", [Pr, lr] = Ae(cr, {
882
+ qe.displayName = J;
883
+ var Tn = "TooltipPortal", [Xn, On] = V(Tn, {
2145
884
  forceMount: void 0
2146
- }), ne = "TooltipContent", tn = u.forwardRef(
885
+ }), N = "TooltipContent", Ke = s.forwardRef(
2147
886
  (e, t) => {
2148
- const n = lr(ne, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, s = Oe(ne, e.__scopeTooltip);
2149
- return /* @__PURE__ */ A(qt, { present: o || s.open, children: s.disableHoverableContent ? /* @__PURE__ */ A(nn, { side: r, ...i, ref: t }) : /* @__PURE__ */ A(ar, { side: r, ...i, ref: t }) });
887
+ const n = On(N, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, a = j(N, e.__scopeTooltip);
888
+ return /* @__PURE__ */ f(je, { present: o || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ f(Je, { side: r, ...i, ref: t }) : /* @__PURE__ */ f(Nn, { side: r, ...i, ref: t }) });
2150
889
  }
2151
- ), ar = u.forwardRef((e, t) => {
2152
- const n = Oe(ne, e.__scopeTooltip), o = qe(ne, e.__scopeTooltip), r = u.useRef(null), i = ae(t, r), [s, c] = u.useState(null), { trigger: l, onClose: a } = n, f = r.current, { onPointerInTransitChange: d } = o, h = u.useCallback(() => {
2153
- c(null), d(!1);
2154
- }, [d]), p = u.useCallback(
2155
- (m, g) => {
2156
- const y = m.currentTarget, w = { x: m.clientX, y: m.clientY }, v = dr(w, y.getBoundingClientRect()), E = pr(w, v), x = hr(g.getBoundingClientRect()), C = gr([...E, ...x]);
2157
- c(C), d(!0);
890
+ ), Nn = s.forwardRef((e, t) => {
891
+ const n = j(N, e.__scopeTooltip), o = re(N, e.__scopeTooltip), r = s.useRef(null), i = _(t, r), [a, c] = s.useState(null), { trigger: l, onClose: u } = n, d = r.current, { onPointerInTransitChange: m } = o, h = s.useCallback(() => {
892
+ c(null), m(!1);
893
+ }, [m]), p = s.useCallback(
894
+ (v, y) => {
895
+ const w = v.currentTarget, E = { x: v.clientX, y: v.clientY }, C = _n(E, w.getBoundingClientRect()), x = Ln(E, C), P = $n(y.getBoundingClientRect()), R = In([...x, ...P]);
896
+ c(R), m(!0);
2158
897
  },
2159
- [d]
898
+ [m]
2160
899
  );
2161
- return u.useEffect(() => () => h(), [h]), u.useEffect(() => {
2162
- if (l && f) {
2163
- const m = (y) => p(y, f), g = (y) => p(y, l);
2164
- return l.addEventListener("pointerleave", m), f.addEventListener("pointerleave", g), () => {
2165
- l.removeEventListener("pointerleave", m), f.removeEventListener("pointerleave", g);
900
+ return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
901
+ if (l && d) {
902
+ const v = (w) => p(w, d), y = (w) => p(w, l);
903
+ return l.addEventListener("pointerleave", v), d.addEventListener("pointerleave", y), () => {
904
+ l.removeEventListener("pointerleave", v), d.removeEventListener("pointerleave", y);
2166
905
  };
2167
906
  }
2168
- }, [l, f, p, h]), u.useEffect(() => {
2169
- if (s) {
2170
- const m = (g) => {
2171
- const y = g.target, w = { x: g.clientX, y: g.clientY }, v = (l == null ? void 0 : l.contains(y)) || (f == null ? void 0 : f.contains(y)), E = !mr(w, s);
2172
- v ? h() : E && (h(), a());
907
+ }, [l, d, p, h]), s.useEffect(() => {
908
+ if (a) {
909
+ const v = (y) => {
910
+ const w = y.target, E = { x: y.clientX, y: y.clientY }, C = (l == null ? void 0 : l.contains(w)) || (d == null ? void 0 : d.contains(w)), x = !Mn(E, a);
911
+ C ? h() : x && (h(), u());
2173
912
  };
2174
- return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
913
+ return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
2175
914
  }
2176
- }, [l, f, s, a, h]), /* @__PURE__ */ A(nn, { ...e, ref: i });
2177
- }), [ur, fr] = Ae(Re, { isInside: !1 }), nn = u.forwardRef(
915
+ }, [l, d, a, u, h]), /* @__PURE__ */ f(Je, { ...e, ref: i });
916
+ }), [Sn, Dn] = V(U, { isInside: !1 }), Je = s.forwardRef(
2178
917
  (e, t) => {
2179
918
  const {
2180
919
  __scopeTooltip: n,
2181
920
  children: o,
2182
921
  "aria-label": r,
2183
922
  onEscapeKeyDown: i,
2184
- onPointerDownOutside: s,
923
+ onPointerDownOutside: a,
2185
924
  ...c
2186
- } = e, l = Oe(ne, n), a = Pe(n), { onClose: f } = l;
2187
- return u.useEffect(() => (document.addEventListener(We, f), () => document.removeEventListener(We, f)), [f]), u.useEffect(() => {
925
+ } = e, l = j(N, n), u = B(n), { onClose: d } = l;
926
+ return s.useEffect(() => (document.addEventListener(K, d), () => document.removeEventListener(K, d)), [d]), s.useEffect(() => {
2188
927
  if (l.trigger) {
2189
- const d = (h) => {
928
+ const m = (h) => {
2190
929
  const p = h.target;
2191
- p != null && p.contains(l.trigger) && f();
930
+ p != null && p.contains(l.trigger) && d();
2192
931
  };
2193
- return window.addEventListener("scroll", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
932
+ return window.addEventListener("scroll", m, { capture: !0 }), () => window.removeEventListener("scroll", m, { capture: !0 });
2194
933
  }
2195
- }, [l.trigger, f]), /* @__PURE__ */ A(
2196
- Et,
934
+ }, [l.trigger, d]), /* @__PURE__ */ f(
935
+ Ae,
2197
936
  {
2198
937
  asChild: !0,
2199
938
  disableOutsidePointerEvents: !1,
2200
939
  onEscapeKeyDown: i,
2201
- onPointerDownOutside: s,
2202
- onFocusOutside: (d) => d.preventDefault(),
2203
- onDismiss: f,
2204
- children: /* @__PURE__ */ De(
2205
- qo,
940
+ onPointerDownOutside: a,
941
+ onFocusOutside: (m) => m.preventDefault(),
942
+ onDismiss: d,
943
+ children: /* @__PURE__ */ Y(
944
+ un,
2206
945
  {
2207
946
  "data-state": l.stateAttribute,
2208
- ...a,
947
+ ...u,
2209
948
  ...c,
2210
949
  ref: t,
2211
950
  style: {
@@ -2217,8 +956,8 @@ var cr = "TooltipPortal", [Pr, lr] = Ae(cr, {
2217
956
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
2218
957
  },
2219
958
  children: [
2220
- /* @__PURE__ */ A(bt, { children: o }),
2221
- /* @__PURE__ */ A(ur, { scope: n, isInside: !0, children: /* @__PURE__ */ A(or, { id: l.contentId, role: "tooltip", children: r || o }) })
959
+ /* @__PURE__ */ f(xe, { children: o }),
960
+ /* @__PURE__ */ f(Sn, { scope: n, isInside: !0, children: /* @__PURE__ */ f(bn, { id: l.contentId, role: "tooltip", children: r || o }) })
2222
961
  ]
2223
962
  }
2224
963
  )
@@ -2226,18 +965,18 @@ var cr = "TooltipPortal", [Pr, lr] = Ae(cr, {
2226
965
  );
2227
966
  }
2228
967
  );
2229
- tn.displayName = ne;
2230
- var on = "TooltipArrow", rn = u.forwardRef(
968
+ Ke.displayName = N;
969
+ var Qe = "TooltipArrow", et = s.forwardRef(
2231
970
  (e, t) => {
2232
- const { __scopeTooltip: n, ...o } = e, r = Pe(n);
2233
- return fr(
2234
- on,
971
+ const { __scopeTooltip: n, ...o } = e, r = B(n);
972
+ return Dn(
973
+ Qe,
2235
974
  n
2236
- ).isInside ? null : /* @__PURE__ */ A(Ko, { ...r, ...o, ref: t });
975
+ ).isInside ? null : /* @__PURE__ */ f(dn, { ...r, ...o, ref: t });
2237
976
  }
2238
977
  );
2239
- rn.displayName = on;
2240
- function dr(e, t) {
978
+ et.displayName = Qe;
979
+ function _n(e, t) {
2241
980
  const n = Math.abs(t.top - e.y), o = Math.abs(t.bottom - e.y), r = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
2242
981
  switch (Math.min(n, o, r, i)) {
2243
982
  case i:
@@ -2252,7 +991,7 @@ function dr(e, t) {
2252
991
  throw new Error("unreachable");
2253
992
  }
2254
993
  }
2255
- function pr(e, t, n = 5) {
994
+ function Ln(e, t, n = 5) {
2256
995
  const o = [];
2257
996
  switch (t) {
2258
997
  case "top":
@@ -2282,7 +1021,7 @@ function pr(e, t, n = 5) {
2282
1021
  }
2283
1022
  return o;
2284
1023
  }
2285
- function hr(e) {
1024
+ function $n(e) {
2286
1025
  const { top: t, right: n, bottom: o, left: r } = e;
2287
1026
  return [
2288
1027
  { x: r, y: t },
@@ -2291,28 +1030,28 @@ function hr(e) {
2291
1030
  { x: r, y: o }
2292
1031
  ];
2293
1032
  }
2294
- function mr(e, t) {
1033
+ function Mn(e, t) {
2295
1034
  const { x: n, y: o } = e;
2296
1035
  let r = !1;
2297
- for (let i = 0, s = t.length - 1; i < t.length; s = i++) {
2298
- const c = t[i].x, l = t[i].y, a = t[s].x, f = t[s].y;
2299
- l > o != f > o && n < (a - c) * (o - l) / (f - l) + c && (r = !r);
1036
+ for (let i = 0, a = t.length - 1; i < t.length; a = i++) {
1037
+ const c = t[i].x, l = t[i].y, u = t[a].x, d = t[a].y;
1038
+ l > o != d > o && n < (u - c) * (o - l) / (d - l) + c && (r = !r);
2300
1039
  }
2301
1040
  return r;
2302
1041
  }
2303
- function gr(e) {
1042
+ function In(e) {
2304
1043
  const t = e.slice();
2305
- return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), yr(t);
1044
+ return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), Wn(t);
2306
1045
  }
2307
- function yr(e) {
1046
+ function Wn(e) {
2308
1047
  if (e.length <= 1)
2309
1048
  return e.slice();
2310
1049
  const t = [];
2311
1050
  for (let o = 0; o < e.length; o++) {
2312
1051
  const r = e[o];
2313
1052
  for (; t.length >= 2; ) {
2314
- const i = t[t.length - 1], s = t[t.length - 2];
2315
- if ((i.x - s.x) * (r.y - s.y) >= (i.y - s.y) * (r.x - s.x))
1053
+ const i = t[t.length - 1], a = t[t.length - 2];
1054
+ if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
2316
1055
  t.pop();
2317
1056
  else
2318
1057
  break;
@@ -2324,8 +1063,8 @@ function yr(e) {
2324
1063
  for (let o = e.length - 1; o >= 0; o--) {
2325
1064
  const r = e[o];
2326
1065
  for (; n.length >= 2; ) {
2327
- const i = n[n.length - 1], s = n[n.length - 2];
2328
- if ((i.x - s.x) * (r.y - s.y) >= (i.y - s.y) * (r.x - s.x))
1066
+ const i = n[n.length - 1], a = n[n.length - 2];
1067
+ if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
2329
1068
  n.pop();
2330
1069
  else
2331
1070
  break;
@@ -2334,20 +1073,20 @@ function yr(e) {
2334
1073
  }
2335
1074
  return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
2336
1075
  }
2337
- const wr = "_tooltipContent_1i9ed_1", vr = "_tooltipArrow_1i9ed_8", xr = "_fadeIn_1i9ed_1", mt = {
2338
- tooltipContent: wr,
2339
- tooltipArrow: vr,
2340
- fadeIn: xr
2341
- }, br = yn(
2342
- ({ children: e, content: t, className: n }, o) => /* @__PURE__ */ A(Jt, { children: /* @__PURE__ */ De(Qt, { delayDuration: 1e3, children: [
2343
- /* @__PURE__ */ A(en, { asChild: !0, children: /* @__PURE__ */ A("div", { ref: o, className: n, children: e }) }),
2344
- /* @__PURE__ */ De(tn, { className: mt.tooltipContent, sideOffset: 5, children: [
2345
- /* @__PURE__ */ A(rn, { className: mt.tooltipArrow }),
2346
- /* @__PURE__ */ A("span", { children: t })
1076
+ const kn = "_tooltipContent_1i9ed_1", Hn = "_tooltipArrow_1i9ed_8", Fn = "_fadeIn_1i9ed_1", Ce = {
1077
+ tooltipContent: kn,
1078
+ tooltipArrow: Hn,
1079
+ fadeIn: Fn
1080
+ }, Vn = mt(
1081
+ ({ children: e, content: t, className: n }, o) => /* @__PURE__ */ f(ze, { children: /* @__PURE__ */ Y(Ze, { delayDuration: 1e3, children: [
1082
+ /* @__PURE__ */ f(qe, { asChild: !0, children: /* @__PURE__ */ f("div", { ref: o, className: n, children: e }) }),
1083
+ /* @__PURE__ */ Y(Ke, { className: Ce.tooltipContent, sideOffset: 5, children: [
1084
+ /* @__PURE__ */ f(et, { className: Ce.tooltipArrow }),
1085
+ /* @__PURE__ */ f("span", { children: t })
2347
1086
  ] })
2348
1087
  ] }) })
2349
1088
  );
2350
- br.displayName = "RPTooltip";
1089
+ Vn.displayName = "RPTooltip";
2351
1090
  export {
2352
- br as default
1091
+ Vn as default
2353
1092
  };