@pdf-viewer/react 1.4.2 → 1.4.3-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Popover-b7402893.js +1445 -0
- package/dist/{RPDefaultLayout-e27ef121.js → RPDefaultLayout-b9f5eccb.js} +228 -228
- package/dist/component-1da194e8.js +337 -0
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +2 -2
- package/dist/components/RPProvider.js +12 -11
- package/dist/components/layout/LayoutContainer.js +3 -2
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +3 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +4 -3
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +4 -3
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +4 -3
- package/dist/components/page/AnnotationLayer.js +3 -2
- package/dist/components/page/CanvasLayer.js +3 -2
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +3 -2
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +3 -2
- package/dist/components/page/TextLayer.js +3 -2
- package/dist/components/ui/Checkbox.js +7 -6
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/Popover.js +1 -1
- package/dist/components/ui/RPTooltip.js +687 -328
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/floating-ui.react-dom-15b9b819.js +1310 -0
- package/dist/index-2e540713.js +23 -0
- package/dist/index-353ec0a6.js +172 -0
- package/dist/index-5ff5dbd0.js +1675 -0
- package/dist/index-71898eb9.js +139 -0
- package/dist/main.js +1 -1
- package/dist/types/utils/hooks/useWatermark.d.ts +1 -1
- package/dist/utils/hooks/useFileDownload.js +3 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +3 -2
- package/dist/utils/hooks/usePrint.js +3 -2
- package/dist/utils/hooks/useScrollToPage.js +3 -2
- package/dist/utils/hooks/useSearch.js +3 -2
- package/dist/utils/hooks/useThumbnail.js +3 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +3 -2
- package/dist/utils/hooks/useWatermark.js +59 -28
- package/package.json +1 -1
- package/dist/Popover-d11ec15c.js +0 -3061
- package/dist/floating-ui.react-dom-88a86594.js +0 -1447
- package/dist/index-48ca3f30.js +0 -307
- package/dist/index-4ba3ab9a.js +0 -1877
|
@@ -1,143 +1,355 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as f, Fragment as ve, jsxs as Y } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { forwardRef as it } from "react";
|
|
4
|
+
import { u as K, c as ye, d as st, a as H, b as at } from "../../index-71898eb9.js";
|
|
5
|
+
import * as lt from "react-dom";
|
|
6
|
+
import { u as ct, a as ut } from "../../index-2e540713.js";
|
|
7
|
+
import { u as dt, a as ft, o as pt, s as ht, f as mt, b as vt, c as yt, h as gt, l as wt } from "../../floating-ui.react-dom-15b9b819.js";
|
|
8
|
+
import '../../assets/RPTooltip.css';function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
9
|
+
return function(r) {
|
|
10
|
+
if (e == null || e(r), n === !1 || !r.defaultPrevented)
|
|
11
|
+
return t == null ? void 0 : t(r);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function de(e, t) {
|
|
15
|
+
if (typeof e == "function")
|
|
16
|
+
return e(t);
|
|
17
|
+
e != null && (e.current = t);
|
|
18
|
+
}
|
|
19
|
+
function ge(...e) {
|
|
20
|
+
return (t) => {
|
|
21
|
+
let n = !1;
|
|
22
|
+
const o = e.map((r) => {
|
|
23
|
+
const i = de(r, t);
|
|
24
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
25
|
+
});
|
|
26
|
+
if (n)
|
|
27
|
+
return () => {
|
|
28
|
+
for (let r = 0; r < o.length; r++) {
|
|
29
|
+
const i = o[r];
|
|
30
|
+
typeof i == "function" ? i() : de(e[r], null);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function O(...e) {
|
|
36
|
+
return s.useCallback(ge(...e), e);
|
|
37
|
+
}
|
|
38
|
+
var we = s.forwardRef((e, t) => {
|
|
39
|
+
const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Ct);
|
|
40
|
+
if (i) {
|
|
41
|
+
const a = i.props.children, d = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
|
|
42
|
+
return /* @__PURE__ */ f(G, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, d) : null });
|
|
43
|
+
}
|
|
44
|
+
return /* @__PURE__ */ f(G, { ...o, ref: t, children: n });
|
|
45
|
+
});
|
|
46
|
+
we.displayName = "Slot";
|
|
47
|
+
var G = s.forwardRef((e, t) => {
|
|
48
|
+
const { children: n, ...o } = e;
|
|
49
|
+
if (s.isValidElement(n)) {
|
|
50
|
+
const r = Et(n), i = Pt(o, n.props);
|
|
51
|
+
return n.type !== s.Fragment && (i.ref = t ? ge(t, r) : r), s.cloneElement(n, i);
|
|
52
|
+
}
|
|
53
|
+
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
54
|
+
});
|
|
55
|
+
G.displayName = "SlotClone";
|
|
56
|
+
var Ce = ({ children: e }) => /* @__PURE__ */ f(ve, { children: e });
|
|
57
|
+
function Ct(e) {
|
|
58
|
+
return s.isValidElement(e) && e.type === Ce;
|
|
59
|
+
}
|
|
60
|
+
function Pt(e, t) {
|
|
61
|
+
const n = { ...t };
|
|
62
|
+
for (const o in t) {
|
|
63
|
+
const r = e[o], i = t[o];
|
|
64
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...d) => {
|
|
65
|
+
i(...d), r(...d);
|
|
66
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
67
|
+
}
|
|
68
|
+
return { ...e, ...n };
|
|
69
|
+
}
|
|
70
|
+
function Et(e) {
|
|
71
|
+
var o, r;
|
|
72
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
73
|
+
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);
|
|
74
|
+
}
|
|
75
|
+
var bt = [
|
|
76
|
+
"a",
|
|
77
|
+
"button",
|
|
78
|
+
"div",
|
|
79
|
+
"form",
|
|
80
|
+
"h2",
|
|
81
|
+
"h3",
|
|
82
|
+
"img",
|
|
83
|
+
"input",
|
|
84
|
+
"label",
|
|
85
|
+
"li",
|
|
86
|
+
"nav",
|
|
87
|
+
"ol",
|
|
88
|
+
"p",
|
|
89
|
+
"span",
|
|
90
|
+
"svg",
|
|
91
|
+
"ul"
|
|
92
|
+
], S = bt.reduce((e, t) => {
|
|
93
|
+
const n = s.forwardRef((o, r) => {
|
|
94
|
+
const { asChild: i, ...a } = o, d = i ? we : t;
|
|
95
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(d, { ...a, ref: r });
|
|
96
|
+
});
|
|
97
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
98
|
+
}, {});
|
|
99
|
+
function xt(e, t) {
|
|
100
|
+
e && lt.flushSync(() => e.dispatchEvent(t));
|
|
101
|
+
}
|
|
102
|
+
var Tt = "DismissableLayer", X = "dismissableLayer.update", At = "dismissableLayer.pointerDownOutside", Rt = "dismissableLayer.focusOutside", fe, Pe = s.createContext({
|
|
103
|
+
layers: /* @__PURE__ */ new Set(),
|
|
104
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
105
|
+
branches: /* @__PURE__ */ new Set()
|
|
106
|
+
}), Ee = s.forwardRef(
|
|
107
|
+
(e, t) => {
|
|
108
|
+
const {
|
|
109
|
+
disableOutsidePointerEvents: n = !1,
|
|
110
|
+
onEscapeKeyDown: o,
|
|
111
|
+
onPointerDownOutside: r,
|
|
112
|
+
onFocusOutside: i,
|
|
113
|
+
onInteractOutside: a,
|
|
114
|
+
onDismiss: d,
|
|
115
|
+
...l
|
|
116
|
+
} = e, c = s.useContext(Pe), [u, h] = s.useState(null), m = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = s.useState({}), v = O(t, (g) => h(g)), y = Array.from(c.layers), [w] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), P = y.indexOf(w), C = u ? y.indexOf(u) : -1, x = c.layersWithOutsidePointerEventsDisabled.size > 0, E = C >= P, T = Dt((g) => {
|
|
117
|
+
const R = g.target, M = [...c.branches].some((_) => _.contains(R));
|
|
118
|
+
!E || M || (r == null || r(g), a == null || a(g), g.defaultPrevented || d == null || d());
|
|
119
|
+
}, m), b = St((g) => {
|
|
120
|
+
const R = g.target;
|
|
121
|
+
[...c.branches].some((_) => _.contains(R)) || (i == null || i(g), a == null || a(g), g.defaultPrevented || d == null || d());
|
|
122
|
+
}, m);
|
|
123
|
+
return ct((g) => {
|
|
124
|
+
C === c.layers.size - 1 && (o == null || o(g), !g.defaultPrevented && d && (g.preventDefault(), d()));
|
|
125
|
+
}, m), s.useEffect(() => {
|
|
126
|
+
if (u)
|
|
127
|
+
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (fe = m.body.style.pointerEvents, m.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), pe(), () => {
|
|
128
|
+
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (m.body.style.pointerEvents = fe);
|
|
129
|
+
};
|
|
130
|
+
}, [u, m, n, c]), s.useEffect(() => () => {
|
|
131
|
+
u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), pe());
|
|
132
|
+
}, [u, c]), s.useEffect(() => {
|
|
133
|
+
const g = () => p({});
|
|
134
|
+
return document.addEventListener(X, g), () => document.removeEventListener(X, g);
|
|
135
|
+
}, []), /* @__PURE__ */ f(
|
|
136
|
+
S.div,
|
|
137
|
+
{
|
|
138
|
+
...l,
|
|
139
|
+
ref: v,
|
|
140
|
+
style: {
|
|
141
|
+
pointerEvents: x ? E ? "auto" : "none" : void 0,
|
|
142
|
+
...e.style
|
|
143
|
+
},
|
|
144
|
+
onFocusCapture: A(e.onFocusCapture, b.onFocusCapture),
|
|
145
|
+
onBlurCapture: A(e.onBlurCapture, b.onBlurCapture),
|
|
146
|
+
onPointerDownCapture: A(
|
|
147
|
+
e.onPointerDownCapture,
|
|
148
|
+
T.onPointerDownCapture
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
Ee.displayName = Tt;
|
|
155
|
+
var Ot = "DismissableLayerBranch", Nt = s.forwardRef((e, t) => {
|
|
156
|
+
const n = s.useContext(Pe), o = s.useRef(null), r = O(t, o);
|
|
157
|
+
return s.useEffect(() => {
|
|
158
|
+
const i = o.current;
|
|
159
|
+
if (i)
|
|
160
|
+
return n.branches.add(i), () => {
|
|
161
|
+
n.branches.delete(i);
|
|
162
|
+
};
|
|
163
|
+
}, [n.branches]), /* @__PURE__ */ f(S.div, { ...e, ref: r });
|
|
164
|
+
});
|
|
165
|
+
Nt.displayName = Ot;
|
|
166
|
+
function Dt(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
167
|
+
const n = K(e), o = s.useRef(!1), r = s.useRef(() => {
|
|
168
|
+
});
|
|
169
|
+
return s.useEffect(() => {
|
|
170
|
+
const i = (d) => {
|
|
171
|
+
if (d.target && !o.current) {
|
|
172
|
+
let l = function() {
|
|
173
|
+
be(
|
|
174
|
+
At,
|
|
175
|
+
n,
|
|
176
|
+
c,
|
|
177
|
+
{ discrete: !0 }
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
const c = { originalEvent: d };
|
|
181
|
+
d.pointerType === "touch" ? (t.removeEventListener("click", r.current), r.current = l, t.addEventListener("click", r.current, { once: !0 })) : l();
|
|
182
|
+
} else
|
|
183
|
+
t.removeEventListener("click", r.current);
|
|
184
|
+
o.current = !1;
|
|
185
|
+
}, a = window.setTimeout(() => {
|
|
186
|
+
t.addEventListener("pointerdown", i);
|
|
187
|
+
}, 0);
|
|
188
|
+
return () => {
|
|
189
|
+
window.clearTimeout(a), t.removeEventListener("pointerdown", i), t.removeEventListener("click", r.current);
|
|
190
|
+
};
|
|
191
|
+
}, [t, n]), {
|
|
192
|
+
// ensures we check React component tree (not just DOM tree)
|
|
193
|
+
onPointerDownCapture: () => o.current = !0
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function St(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
197
|
+
const n = K(e), o = s.useRef(!1);
|
|
198
|
+
return s.useEffect(() => {
|
|
199
|
+
const r = (i) => {
|
|
200
|
+
i.target && !o.current && be(Rt, n, { originalEvent: i }, {
|
|
201
|
+
discrete: !1
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
return t.addEventListener("focusin", r), () => t.removeEventListener("focusin", r);
|
|
205
|
+
}, [t, n]), {
|
|
206
|
+
onFocusCapture: () => o.current = !0,
|
|
207
|
+
onBlurCapture: () => o.current = !1
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function pe() {
|
|
211
|
+
const e = new CustomEvent(X);
|
|
212
|
+
document.dispatchEvent(e);
|
|
213
|
+
}
|
|
214
|
+
function be(e, t, n, { discrete: o }) {
|
|
215
|
+
const r = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
216
|
+
t && r.addEventListener(e, t, { once: !0 }), o ? xt(r, i) : r.dispatchEvent(i);
|
|
217
|
+
}
|
|
218
|
+
var _t = "Arrow", xe = s.forwardRef((e, t) => {
|
|
219
|
+
const { children: n, width: o = 10, height: r = 5, ...i } = e;
|
|
220
|
+
return /* @__PURE__ */ f(
|
|
221
|
+
S.svg,
|
|
10
222
|
{
|
|
11
|
-
...
|
|
12
|
-
ref:
|
|
223
|
+
...i,
|
|
224
|
+
ref: t,
|
|
13
225
|
width: o,
|
|
14
|
-
height:
|
|
226
|
+
height: r,
|
|
15
227
|
viewBox: "0 0 30 10",
|
|
16
228
|
preserveAspectRatio: "none",
|
|
17
|
-
children: e.asChild ?
|
|
229
|
+
children: e.asChild ? n : /* @__PURE__ */ f("polygon", { points: "0,0 30,0 15,10" })
|
|
18
230
|
}
|
|
19
231
|
);
|
|
20
232
|
});
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
const { __scopePopper:
|
|
24
|
-
return /* @__PURE__ */
|
|
233
|
+
xe.displayName = _t;
|
|
234
|
+
var Lt = xe, J = "Popper", [Te, Ae] = ye(J), [Mt, Re] = Te(J), Oe = (e) => {
|
|
235
|
+
const { __scopePopper: t, children: n } = e, [o, r] = s.useState(null);
|
|
236
|
+
return /* @__PURE__ */ f(Mt, { scope: t, anchor: o, onAnchorChange: r, children: n });
|
|
25
237
|
};
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
(e,
|
|
29
|
-
const { __scopePopper:
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
}), o ? null : /* @__PURE__ */
|
|
238
|
+
Oe.displayName = J;
|
|
239
|
+
var Ne = "PopperAnchor", De = s.forwardRef(
|
|
240
|
+
(e, t) => {
|
|
241
|
+
const { __scopePopper: n, virtualRef: o, ...r } = e, i = Re(Ne, n), a = s.useRef(null), d = O(t, a);
|
|
242
|
+
return s.useEffect(() => {
|
|
243
|
+
i.onAnchorChange((o == null ? void 0 : o.current) || a.current);
|
|
244
|
+
}), o ? null : /* @__PURE__ */ f(S.div, { ...r, ref: d });
|
|
33
245
|
}
|
|
34
246
|
);
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
(e,
|
|
38
|
-
var
|
|
247
|
+
De.displayName = Ne;
|
|
248
|
+
var Q = "PopperContent", [It, Wt] = Te(Q), Se = s.forwardRef(
|
|
249
|
+
(e, t) => {
|
|
250
|
+
var oe, ie, se, ae, le, ce;
|
|
39
251
|
const {
|
|
40
|
-
__scopePopper:
|
|
252
|
+
__scopePopper: n,
|
|
41
253
|
side: o = "bottom",
|
|
42
|
-
sideOffset:
|
|
43
|
-
align:
|
|
44
|
-
alignOffset:
|
|
45
|
-
arrowPadding:
|
|
254
|
+
sideOffset: r = 0,
|
|
255
|
+
align: i = "center",
|
|
256
|
+
alignOffset: a = 0,
|
|
257
|
+
arrowPadding: d = 0,
|
|
46
258
|
avoidCollisions: l = !0,
|
|
47
|
-
collisionBoundary:
|
|
48
|
-
collisionPadding:
|
|
49
|
-
sticky:
|
|
259
|
+
collisionBoundary: c = [],
|
|
260
|
+
collisionPadding: u = 0,
|
|
261
|
+
sticky: h = "partial",
|
|
50
262
|
hideWhenDetached: m = !1,
|
|
51
|
-
updatePositionStrategy:
|
|
263
|
+
updatePositionStrategy: p = "optimized",
|
|
52
264
|
onPlaced: v,
|
|
53
|
-
...
|
|
54
|
-
} = e,
|
|
55
|
-
padding:
|
|
56
|
-
boundary:
|
|
265
|
+
...y
|
|
266
|
+
} = e, w = Re(Q, n), [P, C] = s.useState(null), x = O(t, (L) => C(L)), [E, T] = s.useState(null), b = st(E), g = (b == null ? void 0 : b.width) ?? 0, R = (b == null ? void 0 : b.height) ?? 0, M = o + (i !== "center" ? "-" + i : ""), _ = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, te = Array.isArray(c) ? c : [c], Ge = te.length > 0, I = {
|
|
267
|
+
padding: _,
|
|
268
|
+
boundary: te.filter($t),
|
|
57
269
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
58
|
-
altBoundary:
|
|
59
|
-
}, { refs:
|
|
270
|
+
altBoundary: Ge
|
|
271
|
+
}, { refs: Xe, floatingStyles: ne, placement: ze, isPositioned: W, middlewareData: N } = dt({
|
|
60
272
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
61
273
|
strategy: "fixed",
|
|
62
|
-
placement:
|
|
63
|
-
whileElementsMounted: (...
|
|
64
|
-
animationFrame:
|
|
274
|
+
placement: M,
|
|
275
|
+
whileElementsMounted: (...L) => ft(...L, {
|
|
276
|
+
animationFrame: p === "always"
|
|
65
277
|
}),
|
|
66
278
|
elements: {
|
|
67
|
-
reference:
|
|
279
|
+
reference: w.anchor
|
|
68
280
|
},
|
|
69
281
|
middleware: [
|
|
70
|
-
|
|
71
|
-
l &&
|
|
282
|
+
pt({ mainAxis: r + R, alignmentAxis: a }),
|
|
283
|
+
l && ht({
|
|
72
284
|
mainAxis: !0,
|
|
73
285
|
crossAxis: !1,
|
|
74
|
-
limiter:
|
|
75
|
-
...
|
|
286
|
+
limiter: h === "partial" ? wt() : void 0,
|
|
287
|
+
...I
|
|
76
288
|
}),
|
|
77
|
-
l &&
|
|
78
|
-
|
|
79
|
-
...
|
|
80
|
-
apply: ({ elements:
|
|
81
|
-
const { width:
|
|
82
|
-
|
|
289
|
+
l && mt({ ...I }),
|
|
290
|
+
vt({
|
|
291
|
+
...I,
|
|
292
|
+
apply: ({ elements: L, rects: ue, availableWidth: tt, availableHeight: nt }) => {
|
|
293
|
+
const { width: rt, height: ot } = ue.reference, $ = L.floating.style;
|
|
294
|
+
$.setProperty("--radix-popper-available-width", `${tt}px`), $.setProperty("--radix-popper-available-height", `${nt}px`), $.setProperty("--radix-popper-anchor-width", `${rt}px`), $.setProperty("--radix-popper-anchor-height", `${ot}px`);
|
|
83
295
|
}
|
|
84
296
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
m &&
|
|
297
|
+
E && yt({ element: E, padding: d }),
|
|
298
|
+
Ft({ arrowWidth: g, arrowHeight: R }),
|
|
299
|
+
m && gt({ strategy: "referenceHidden", ...I })
|
|
88
300
|
]
|
|
89
|
-
}), [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}, [
|
|
93
|
-
const
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
}, [
|
|
301
|
+
}), [re, Ze] = Me(ze), k = K(v);
|
|
302
|
+
H(() => {
|
|
303
|
+
W && (k == null || k());
|
|
304
|
+
}, [W, k]);
|
|
305
|
+
const qe = (oe = N.arrow) == null ? void 0 : oe.x, Ke = (ie = N.arrow) == null ? void 0 : ie.y, Je = ((se = N.arrow) == null ? void 0 : se.centerOffset) !== 0, [Qe, et] = s.useState();
|
|
306
|
+
return H(() => {
|
|
307
|
+
P && et(window.getComputedStyle(P).zIndex);
|
|
308
|
+
}, [P]), /* @__PURE__ */ f(
|
|
97
309
|
"div",
|
|
98
310
|
{
|
|
99
|
-
ref:
|
|
311
|
+
ref: Xe.setFloating,
|
|
100
312
|
"data-radix-popper-content-wrapper": "",
|
|
101
313
|
style: {
|
|
102
|
-
...
|
|
103
|
-
transform:
|
|
314
|
+
...ne,
|
|
315
|
+
transform: W ? ne.transform : "translate(0, -200%)",
|
|
104
316
|
// keep off the page when measuring
|
|
105
317
|
minWidth: "max-content",
|
|
106
|
-
zIndex:
|
|
318
|
+
zIndex: Qe,
|
|
107
319
|
"--radix-popper-transform-origin": [
|
|
108
|
-
(
|
|
109
|
-
(
|
|
320
|
+
(ae = N.transformOrigin) == null ? void 0 : ae.x,
|
|
321
|
+
(le = N.transformOrigin) == null ? void 0 : le.y
|
|
110
322
|
].join(" "),
|
|
111
323
|
// hide the content if using the hide middleware and should be hidden
|
|
112
324
|
// set visibility to hidden and disable pointer events so the UI behaves
|
|
113
325
|
// as if the PopperContent isn't there at all
|
|
114
|
-
...((
|
|
326
|
+
...((ce = N.hide) == null ? void 0 : ce.referenceHidden) && {
|
|
115
327
|
visibility: "hidden",
|
|
116
328
|
pointerEvents: "none"
|
|
117
329
|
}
|
|
118
330
|
},
|
|
119
331
|
dir: e.dir,
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
|
|
332
|
+
children: /* @__PURE__ */ f(
|
|
333
|
+
It,
|
|
122
334
|
{
|
|
123
|
-
scope:
|
|
124
|
-
placedSide:
|
|
125
|
-
onArrowChange:
|
|
126
|
-
arrowX:
|
|
127
|
-
arrowY:
|
|
128
|
-
shouldHideArrow:
|
|
129
|
-
children: /* @__PURE__ */
|
|
130
|
-
|
|
335
|
+
scope: n,
|
|
336
|
+
placedSide: re,
|
|
337
|
+
onArrowChange: T,
|
|
338
|
+
arrowX: qe,
|
|
339
|
+
arrowY: Ke,
|
|
340
|
+
shouldHideArrow: Je,
|
|
341
|
+
children: /* @__PURE__ */ f(
|
|
342
|
+
S.div,
|
|
131
343
|
{
|
|
132
|
-
"data-side":
|
|
133
|
-
"data-align":
|
|
134
|
-
...
|
|
135
|
-
ref:
|
|
344
|
+
"data-side": re,
|
|
345
|
+
"data-align": Ze,
|
|
346
|
+
...y,
|
|
347
|
+
ref: x,
|
|
136
348
|
style: {
|
|
137
|
-
...
|
|
349
|
+
...y.style,
|
|
138
350
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
139
351
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
140
|
-
animation:
|
|
352
|
+
animation: W ? void 0 : "none"
|
|
141
353
|
}
|
|
142
354
|
}
|
|
143
355
|
)
|
|
@@ -147,48 +359,48 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
|
|
|
147
359
|
);
|
|
148
360
|
}
|
|
149
361
|
);
|
|
150
|
-
|
|
151
|
-
var
|
|
362
|
+
Se.displayName = Q;
|
|
363
|
+
var _e = "PopperArrow", kt = {
|
|
152
364
|
top: "bottom",
|
|
153
365
|
right: "left",
|
|
154
366
|
bottom: "top",
|
|
155
367
|
left: "right"
|
|
156
|
-
},
|
|
157
|
-
const { __scopePopper: o, ...
|
|
368
|
+
}, Le = s.forwardRef(function(t, n) {
|
|
369
|
+
const { __scopePopper: o, ...r } = t, i = Wt(_e, o), a = kt[i.placedSide];
|
|
158
370
|
return (
|
|
159
371
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
160
372
|
// doesn't report size as we'd expect on SVG elements.
|
|
161
373
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
162
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ f(
|
|
163
375
|
"span",
|
|
164
376
|
{
|
|
165
|
-
ref:
|
|
377
|
+
ref: i.onArrowChange,
|
|
166
378
|
style: {
|
|
167
379
|
position: "absolute",
|
|
168
|
-
left:
|
|
169
|
-
top:
|
|
170
|
-
[
|
|
380
|
+
left: i.arrowX,
|
|
381
|
+
top: i.arrowY,
|
|
382
|
+
[a]: 0,
|
|
171
383
|
transformOrigin: {
|
|
172
384
|
top: "",
|
|
173
385
|
right: "0 0",
|
|
174
386
|
bottom: "center 0",
|
|
175
387
|
left: "100% 0"
|
|
176
|
-
}[
|
|
388
|
+
}[i.placedSide],
|
|
177
389
|
transform: {
|
|
178
390
|
top: "translateY(100%)",
|
|
179
391
|
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
180
392
|
bottom: "rotate(180deg)",
|
|
181
393
|
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
182
|
-
}[
|
|
183
|
-
visibility:
|
|
394
|
+
}[i.placedSide],
|
|
395
|
+
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
184
396
|
},
|
|
185
|
-
children: /* @__PURE__ */
|
|
186
|
-
|
|
397
|
+
children: /* @__PURE__ */ f(
|
|
398
|
+
Lt,
|
|
187
399
|
{
|
|
188
|
-
...
|
|
189
|
-
ref:
|
|
400
|
+
...r,
|
|
401
|
+
ref: n,
|
|
190
402
|
style: {
|
|
191
|
-
...
|
|
403
|
+
...r.style,
|
|
192
404
|
// ensures the element can be measured correctly (mostly for if SVG)
|
|
193
405
|
display: "block"
|
|
194
406
|
}
|
|
@@ -198,30 +410,177 @@ var he = "PopperArrow", ct = {
|
|
|
198
410
|
)
|
|
199
411
|
);
|
|
200
412
|
});
|
|
201
|
-
|
|
202
|
-
function
|
|
413
|
+
Le.displayName = _e;
|
|
414
|
+
function $t(e) {
|
|
203
415
|
return e !== null;
|
|
204
416
|
}
|
|
205
|
-
var
|
|
417
|
+
var Ft = (e) => ({
|
|
206
418
|
name: "transformOrigin",
|
|
207
419
|
options: e,
|
|
208
|
-
fn(
|
|
209
|
-
var
|
|
210
|
-
const { placement:
|
|
211
|
-
let v = "",
|
|
212
|
-
return
|
|
420
|
+
fn(t) {
|
|
421
|
+
var w, P, C;
|
|
422
|
+
const { placement: n, rects: o, middlewareData: r } = t, a = ((w = r.arrow) == null ? void 0 : w.centerOffset) !== 0, d = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [c, u] = Me(n), h = { start: "0%", center: "50%", end: "100%" }[u], m = (((P = r.arrow) == null ? void 0 : P.x) ?? 0) + d / 2, p = (((C = r.arrow) == null ? void 0 : C.y) ?? 0) + l / 2;
|
|
423
|
+
let v = "", y = "";
|
|
424
|
+
return c === "bottom" ? (v = a ? h : `${m}px`, y = `${-l}px`) : c === "top" ? (v = a ? h : `${m}px`, y = `${o.floating.height + l}px`) : c === "right" ? (v = `${-l}px`, y = a ? h : `${p}px`) : c === "left" && (v = `${o.floating.width + l}px`, y = a ? h : `${p}px`), { data: { x: v, y } };
|
|
213
425
|
}
|
|
214
426
|
});
|
|
215
|
-
function
|
|
216
|
-
const [
|
|
217
|
-
return [
|
|
427
|
+
function Me(e) {
|
|
428
|
+
const [t, n = "center"] = e.split("-");
|
|
429
|
+
return [t, n];
|
|
218
430
|
}
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
|
|
431
|
+
var Ht = Oe, Bt = De, Ut = Se, Vt = Le;
|
|
432
|
+
function jt(e, t) {
|
|
433
|
+
return s.useReducer((n, o) => t[n][o] ?? n, e);
|
|
434
|
+
}
|
|
435
|
+
var Ie = (e) => {
|
|
436
|
+
const { present: t, children: n } = e, o = Yt(t), r = typeof n == "function" ? n({ present: o.isPresent }) : s.Children.only(n), i = O(o.ref, Gt(r));
|
|
437
|
+
return typeof n == "function" || o.isPresent ? s.cloneElement(r, { ref: i }) : null;
|
|
438
|
+
};
|
|
439
|
+
Ie.displayName = "Presence";
|
|
440
|
+
function Yt(e) {
|
|
441
|
+
const [t, n] = s.useState(), o = s.useRef({}), r = s.useRef(e), i = s.useRef("none"), a = e ? "mounted" : "unmounted", [d, l] = jt(a, {
|
|
442
|
+
mounted: {
|
|
443
|
+
UNMOUNT: "unmounted",
|
|
444
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
445
|
+
},
|
|
446
|
+
unmountSuspended: {
|
|
447
|
+
MOUNT: "mounted",
|
|
448
|
+
ANIMATION_END: "unmounted"
|
|
449
|
+
},
|
|
450
|
+
unmounted: {
|
|
451
|
+
MOUNT: "mounted"
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
return s.useEffect(() => {
|
|
455
|
+
const c = F(o.current);
|
|
456
|
+
i.current = d === "mounted" ? c : "none";
|
|
457
|
+
}, [d]), H(() => {
|
|
458
|
+
const c = o.current, u = r.current;
|
|
459
|
+
if (u !== e) {
|
|
460
|
+
const m = i.current, p = F(c);
|
|
461
|
+
e ? l("MOUNT") : p === "none" || (c == null ? void 0 : c.display) === "none" ? l("UNMOUNT") : l(u && m !== p ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
|
|
462
|
+
}
|
|
463
|
+
}, [e, l]), H(() => {
|
|
464
|
+
if (t) {
|
|
465
|
+
let c;
|
|
466
|
+
const u = t.ownerDocument.defaultView ?? window, h = (p) => {
|
|
467
|
+
const y = F(o.current).includes(p.animationName);
|
|
468
|
+
if (p.target === t && y && (l("ANIMATION_END"), !r.current)) {
|
|
469
|
+
const w = t.style.animationFillMode;
|
|
470
|
+
t.style.animationFillMode = "forwards", c = u.setTimeout(() => {
|
|
471
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = w);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
}, m = (p) => {
|
|
475
|
+
p.target === t && (i.current = F(o.current));
|
|
476
|
+
};
|
|
477
|
+
return t.addEventListener("animationstart", m), t.addEventListener("animationcancel", h), t.addEventListener("animationend", h), () => {
|
|
478
|
+
u.clearTimeout(c), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", h), t.removeEventListener("animationend", h);
|
|
479
|
+
};
|
|
480
|
+
} else
|
|
481
|
+
l("ANIMATION_END");
|
|
482
|
+
}, [t, l]), {
|
|
483
|
+
isPresent: ["mounted", "unmountSuspended"].includes(d),
|
|
484
|
+
ref: s.useCallback((c) => {
|
|
485
|
+
c && (o.current = getComputedStyle(c)), n(c);
|
|
486
|
+
}, [])
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function F(e) {
|
|
490
|
+
return (e == null ? void 0 : e.animationName) || "none";
|
|
491
|
+
}
|
|
492
|
+
function Gt(e) {
|
|
493
|
+
var o, r;
|
|
494
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
495
|
+
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);
|
|
496
|
+
}
|
|
497
|
+
function he(e, t) {
|
|
498
|
+
if (typeof e == "function")
|
|
499
|
+
return e(t);
|
|
500
|
+
e != null && (e.current = t);
|
|
501
|
+
}
|
|
502
|
+
function Xt(...e) {
|
|
503
|
+
return (t) => {
|
|
504
|
+
let n = !1;
|
|
505
|
+
const o = e.map((r) => {
|
|
506
|
+
const i = he(r, t);
|
|
507
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
508
|
+
});
|
|
509
|
+
if (n)
|
|
510
|
+
return () => {
|
|
511
|
+
for (let r = 0; r < o.length; r++) {
|
|
512
|
+
const i = o[r];
|
|
513
|
+
typeof i == "function" ? i() : he(e[r], null);
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
var We = s.forwardRef((e, t) => {
|
|
519
|
+
const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Zt);
|
|
520
|
+
if (i) {
|
|
521
|
+
const a = i.props.children, d = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
|
|
522
|
+
return /* @__PURE__ */ f(z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, d) : null });
|
|
523
|
+
}
|
|
524
|
+
return /* @__PURE__ */ f(z, { ...o, ref: t, children: n });
|
|
525
|
+
});
|
|
526
|
+
We.displayName = "Slot";
|
|
527
|
+
var z = s.forwardRef((e, t) => {
|
|
528
|
+
const { children: n, ...o } = e;
|
|
529
|
+
if (s.isValidElement(n)) {
|
|
530
|
+
const r = Kt(n), i = qt(o, n.props);
|
|
531
|
+
return n.type !== s.Fragment && (i.ref = t ? Xt(t, r) : r), s.cloneElement(n, i);
|
|
532
|
+
}
|
|
533
|
+
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
534
|
+
});
|
|
535
|
+
z.displayName = "SlotClone";
|
|
536
|
+
var zt = ({ children: e }) => /* @__PURE__ */ f(ve, { children: e });
|
|
537
|
+
function Zt(e) {
|
|
538
|
+
return s.isValidElement(e) && e.type === zt;
|
|
539
|
+
}
|
|
540
|
+
function qt(e, t) {
|
|
541
|
+
const n = { ...t };
|
|
542
|
+
for (const o in t) {
|
|
543
|
+
const r = e[o], i = t[o];
|
|
544
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...d) => {
|
|
545
|
+
i(...d), r(...d);
|
|
546
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
547
|
+
}
|
|
548
|
+
return { ...e, ...n };
|
|
549
|
+
}
|
|
550
|
+
function Kt(e) {
|
|
551
|
+
var o, r;
|
|
552
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
553
|
+
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);
|
|
554
|
+
}
|
|
555
|
+
var Jt = [
|
|
556
|
+
"a",
|
|
557
|
+
"button",
|
|
558
|
+
"div",
|
|
559
|
+
"form",
|
|
560
|
+
"h2",
|
|
561
|
+
"h3",
|
|
562
|
+
"img",
|
|
563
|
+
"input",
|
|
564
|
+
"label",
|
|
565
|
+
"li",
|
|
566
|
+
"nav",
|
|
567
|
+
"ol",
|
|
568
|
+
"p",
|
|
569
|
+
"span",
|
|
570
|
+
"svg",
|
|
571
|
+
"ul"
|
|
572
|
+
], Qt = Jt.reduce((e, t) => {
|
|
573
|
+
const n = s.forwardRef((o, r) => {
|
|
574
|
+
const { asChild: i, ...a } = o, d = i ? We : t;
|
|
575
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(d, { ...a, ref: r });
|
|
576
|
+
});
|
|
577
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
578
|
+
}, {}), en = "VisuallyHidden", ke = s.forwardRef(
|
|
579
|
+
(e, t) => /* @__PURE__ */ f(
|
|
580
|
+
Qt.span,
|
|
222
581
|
{
|
|
223
582
|
...e,
|
|
224
|
-
ref:
|
|
583
|
+
ref: t,
|
|
225
584
|
style: {
|
|
226
585
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
227
586
|
position: "absolute",
|
|
@@ -239,192 +598,192 @@ var ut = de, ft = ue, ht = fe, vt = ve, gt = "VisuallyHidden", me = a.forwardRef
|
|
|
239
598
|
}
|
|
240
599
|
)
|
|
241
600
|
);
|
|
242
|
-
|
|
243
|
-
var
|
|
244
|
-
|
|
245
|
-
]),
|
|
601
|
+
ke.displayName = en;
|
|
602
|
+
var tn = ke, [B, An] = ye("Tooltip", [
|
|
603
|
+
Ae
|
|
604
|
+
]), U = Ae(), $e = "TooltipProvider", nn = 700, Z = "tooltip.open", [rn, ee] = B($e), Fe = (e) => {
|
|
246
605
|
const {
|
|
247
|
-
__scopeTooltip:
|
|
248
|
-
delayDuration:
|
|
606
|
+
__scopeTooltip: t,
|
|
607
|
+
delayDuration: n = nn,
|
|
249
608
|
skipDelayDuration: o = 300,
|
|
250
|
-
disableHoverableContent:
|
|
251
|
-
children:
|
|
252
|
-
} = e, [
|
|
253
|
-
return
|
|
254
|
-
const
|
|
255
|
-
return () => window.clearTimeout(
|
|
256
|
-
}, []), /* @__PURE__ */
|
|
257
|
-
|
|
609
|
+
disableHoverableContent: r = !1,
|
|
610
|
+
children: i
|
|
611
|
+
} = e, [a, d] = s.useState(!0), l = s.useRef(!1), c = s.useRef(0);
|
|
612
|
+
return s.useEffect(() => {
|
|
613
|
+
const u = c.current;
|
|
614
|
+
return () => window.clearTimeout(u);
|
|
615
|
+
}, []), /* @__PURE__ */ f(
|
|
616
|
+
rn,
|
|
258
617
|
{
|
|
259
|
-
scope:
|
|
260
|
-
isOpenDelayed:
|
|
261
|
-
delayDuration:
|
|
262
|
-
onOpen:
|
|
263
|
-
window.clearTimeout(
|
|
618
|
+
scope: t,
|
|
619
|
+
isOpenDelayed: a,
|
|
620
|
+
delayDuration: n,
|
|
621
|
+
onOpen: s.useCallback(() => {
|
|
622
|
+
window.clearTimeout(c.current), d(!1);
|
|
264
623
|
}, []),
|
|
265
|
-
onClose:
|
|
266
|
-
window.clearTimeout(
|
|
267
|
-
() =>
|
|
624
|
+
onClose: s.useCallback(() => {
|
|
625
|
+
window.clearTimeout(c.current), c.current = window.setTimeout(
|
|
626
|
+
() => d(!0),
|
|
268
627
|
o
|
|
269
628
|
);
|
|
270
629
|
}, [o]),
|
|
271
630
|
isPointerInTransitRef: l,
|
|
272
|
-
onPointerInTransitChange:
|
|
273
|
-
l.current =
|
|
631
|
+
onPointerInTransitChange: s.useCallback((u) => {
|
|
632
|
+
l.current = u;
|
|
274
633
|
}, []),
|
|
275
|
-
disableHoverableContent:
|
|
276
|
-
children:
|
|
634
|
+
disableHoverableContent: r,
|
|
635
|
+
children: i
|
|
277
636
|
}
|
|
278
637
|
);
|
|
279
638
|
};
|
|
280
|
-
|
|
281
|
-
var
|
|
639
|
+
Fe.displayName = $e;
|
|
640
|
+
var V = "Tooltip", [on, j] = B(V), He = (e) => {
|
|
282
641
|
const {
|
|
283
|
-
__scopeTooltip:
|
|
284
|
-
children:
|
|
642
|
+
__scopeTooltip: t,
|
|
643
|
+
children: n,
|
|
285
644
|
open: o,
|
|
286
|
-
defaultOpen:
|
|
287
|
-
onOpenChange:
|
|
288
|
-
disableHoverableContent:
|
|
289
|
-
delayDuration:
|
|
290
|
-
} = e, l =
|
|
645
|
+
defaultOpen: r = !1,
|
|
646
|
+
onOpenChange: i,
|
|
647
|
+
disableHoverableContent: a,
|
|
648
|
+
delayDuration: d
|
|
649
|
+
} = e, l = ee(V, e.__scopeTooltip), c = U(t), [u, h] = s.useState(null), m = ut(), p = s.useRef(0), v = a ?? l.disableHoverableContent, y = d ?? l.delayDuration, w = s.useRef(!1), [P = !1, C] = at({
|
|
291
650
|
prop: o,
|
|
292
|
-
defaultProp:
|
|
293
|
-
onChange: (
|
|
294
|
-
|
|
651
|
+
defaultProp: r,
|
|
652
|
+
onChange: (g) => {
|
|
653
|
+
g ? (l.onOpen(), document.dispatchEvent(new CustomEvent(Z))) : l.onClose(), i == null || i(g);
|
|
295
654
|
}
|
|
296
|
-
}),
|
|
297
|
-
window.clearTimeout(
|
|
298
|
-
}, [
|
|
299
|
-
window.clearTimeout(
|
|
300
|
-
}, [
|
|
301
|
-
window.clearTimeout(
|
|
302
|
-
|
|
303
|
-
},
|
|
304
|
-
}, [
|
|
305
|
-
return
|
|
306
|
-
|
|
307
|
-
}, []), /* @__PURE__ */
|
|
308
|
-
|
|
655
|
+
}), x = s.useMemo(() => P ? w.current ? "delayed-open" : "instant-open" : "closed", [P]), E = s.useCallback(() => {
|
|
656
|
+
window.clearTimeout(p.current), p.current = 0, w.current = !1, C(!0);
|
|
657
|
+
}, [C]), T = s.useCallback(() => {
|
|
658
|
+
window.clearTimeout(p.current), p.current = 0, C(!1);
|
|
659
|
+
}, [C]), b = s.useCallback(() => {
|
|
660
|
+
window.clearTimeout(p.current), p.current = window.setTimeout(() => {
|
|
661
|
+
w.current = !0, C(!0), p.current = 0;
|
|
662
|
+
}, y);
|
|
663
|
+
}, [y, C]);
|
|
664
|
+
return s.useEffect(() => () => {
|
|
665
|
+
p.current && (window.clearTimeout(p.current), p.current = 0);
|
|
666
|
+
}, []), /* @__PURE__ */ f(Ht, { ...c, children: /* @__PURE__ */ f(
|
|
667
|
+
on,
|
|
309
668
|
{
|
|
310
|
-
scope:
|
|
669
|
+
scope: t,
|
|
311
670
|
contentId: m,
|
|
312
|
-
open:
|
|
313
|
-
stateAttribute:
|
|
314
|
-
trigger:
|
|
315
|
-
onTriggerChange:
|
|
316
|
-
onTriggerEnter:
|
|
317
|
-
l.isOpenDelayed ?
|
|
318
|
-
}, [l.isOpenDelayed,
|
|
319
|
-
onTriggerLeave:
|
|
320
|
-
v ?
|
|
321
|
-
}, [
|
|
322
|
-
onOpen:
|
|
323
|
-
onClose:
|
|
671
|
+
open: P,
|
|
672
|
+
stateAttribute: x,
|
|
673
|
+
trigger: u,
|
|
674
|
+
onTriggerChange: h,
|
|
675
|
+
onTriggerEnter: s.useCallback(() => {
|
|
676
|
+
l.isOpenDelayed ? b() : E();
|
|
677
|
+
}, [l.isOpenDelayed, b, E]),
|
|
678
|
+
onTriggerLeave: s.useCallback(() => {
|
|
679
|
+
v ? T() : (window.clearTimeout(p.current), p.current = 0);
|
|
680
|
+
}, [T, v]),
|
|
681
|
+
onOpen: E,
|
|
682
|
+
onClose: T,
|
|
324
683
|
disableHoverableContent: v,
|
|
325
|
-
children:
|
|
684
|
+
children: n
|
|
326
685
|
}
|
|
327
686
|
) });
|
|
328
687
|
};
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
(e,
|
|
332
|
-
const { __scopeTooltip:
|
|
333
|
-
return
|
|
334
|
-
|
|
688
|
+
He.displayName = V;
|
|
689
|
+
var q = "TooltipTrigger", Be = s.forwardRef(
|
|
690
|
+
(e, t) => {
|
|
691
|
+
const { __scopeTooltip: n, ...o } = e, r = j(q, n), i = ee(q, n), a = U(n), d = s.useRef(null), l = O(t, d, r.onTriggerChange), c = s.useRef(!1), u = s.useRef(!1), h = s.useCallback(() => c.current = !1, []);
|
|
692
|
+
return s.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ f(Bt, { asChild: !0, ...a, children: /* @__PURE__ */ f(
|
|
693
|
+
S.button,
|
|
335
694
|
{
|
|
336
|
-
"aria-describedby":
|
|
337
|
-
"data-state":
|
|
695
|
+
"aria-describedby": r.open ? r.contentId : void 0,
|
|
696
|
+
"data-state": r.stateAttribute,
|
|
338
697
|
...o,
|
|
339
698
|
ref: l,
|
|
340
|
-
onPointerMove:
|
|
341
|
-
m.pointerType !== "touch" && !
|
|
699
|
+
onPointerMove: A(e.onPointerMove, (m) => {
|
|
700
|
+
m.pointerType !== "touch" && !u.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), u.current = !0);
|
|
342
701
|
}),
|
|
343
|
-
onPointerLeave:
|
|
344
|
-
|
|
702
|
+
onPointerLeave: A(e.onPointerLeave, () => {
|
|
703
|
+
r.onTriggerLeave(), u.current = !1;
|
|
345
704
|
}),
|
|
346
|
-
onPointerDown:
|
|
347
|
-
|
|
705
|
+
onPointerDown: A(e.onPointerDown, () => {
|
|
706
|
+
c.current = !0, document.addEventListener("pointerup", h, { once: !0 });
|
|
348
707
|
}),
|
|
349
|
-
onFocus:
|
|
350
|
-
|
|
708
|
+
onFocus: A(e.onFocus, () => {
|
|
709
|
+
c.current || r.onOpen();
|
|
351
710
|
}),
|
|
352
|
-
onBlur:
|
|
353
|
-
onClick:
|
|
711
|
+
onBlur: A(e.onBlur, r.onClose),
|
|
712
|
+
onClick: A(e.onClick, r.onClose)
|
|
354
713
|
}
|
|
355
714
|
) });
|
|
356
715
|
}
|
|
357
716
|
);
|
|
358
|
-
|
|
359
|
-
var
|
|
717
|
+
Be.displayName = q;
|
|
718
|
+
var sn = "TooltipPortal", [Rn, an] = B(sn, {
|
|
360
719
|
forceMount: void 0
|
|
361
|
-
}),
|
|
362
|
-
(e,
|
|
363
|
-
const
|
|
364
|
-
return /* @__PURE__ */
|
|
720
|
+
}), D = "TooltipContent", Ue = s.forwardRef(
|
|
721
|
+
(e, t) => {
|
|
722
|
+
const n = an(D, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, a = j(D, e.__scopeTooltip);
|
|
723
|
+
return /* @__PURE__ */ f(Ie, { present: o || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ f(Ve, { side: r, ...i, ref: t }) : /* @__PURE__ */ f(ln, { side: r, ...i, ref: t }) });
|
|
365
724
|
}
|
|
366
|
-
),
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
}, [
|
|
370
|
-
(v,
|
|
371
|
-
const
|
|
372
|
-
|
|
725
|
+
), ln = s.forwardRef((e, t) => {
|
|
726
|
+
const n = j(D, e.__scopeTooltip), o = ee(D, e.__scopeTooltip), r = s.useRef(null), i = O(t, r), [a, d] = s.useState(null), { trigger: l, onClose: c } = n, u = r.current, { onPointerInTransitChange: h } = o, m = s.useCallback(() => {
|
|
727
|
+
d(null), h(!1);
|
|
728
|
+
}, [h]), p = s.useCallback(
|
|
729
|
+
(v, y) => {
|
|
730
|
+
const w = v.currentTarget, P = { x: v.clientX, y: v.clientY }, C = dn(P, w.getBoundingClientRect()), x = fn(P, C), E = pn(y.getBoundingClientRect()), T = mn([...x, ...E]);
|
|
731
|
+
d(T), h(!0);
|
|
373
732
|
},
|
|
374
|
-
[
|
|
733
|
+
[h]
|
|
375
734
|
);
|
|
376
|
-
return
|
|
377
|
-
if (l &&
|
|
378
|
-
const v = (
|
|
379
|
-
return l.addEventListener("pointerleave", v),
|
|
380
|
-
l.removeEventListener("pointerleave", v),
|
|
735
|
+
return s.useEffect(() => () => m(), [m]), s.useEffect(() => {
|
|
736
|
+
if (l && u) {
|
|
737
|
+
const v = (w) => p(w, u), y = (w) => p(w, l);
|
|
738
|
+
return l.addEventListener("pointerleave", v), u.addEventListener("pointerleave", y), () => {
|
|
739
|
+
l.removeEventListener("pointerleave", v), u.removeEventListener("pointerleave", y);
|
|
381
740
|
};
|
|
382
741
|
}
|
|
383
|
-
}, [l,
|
|
384
|
-
if (
|
|
385
|
-
const v = (
|
|
386
|
-
const
|
|
387
|
-
|
|
742
|
+
}, [l, u, p, m]), s.useEffect(() => {
|
|
743
|
+
if (a) {
|
|
744
|
+
const v = (y) => {
|
|
745
|
+
const w = y.target, P = { x: y.clientX, y: y.clientY }, C = (l == null ? void 0 : l.contains(w)) || (u == null ? void 0 : u.contains(w)), x = !hn(P, a);
|
|
746
|
+
C ? m() : x && (m(), c());
|
|
388
747
|
};
|
|
389
748
|
return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
|
|
390
749
|
}
|
|
391
|
-
}, [l,
|
|
392
|
-
}), [
|
|
393
|
-
(e,
|
|
750
|
+
}, [l, u, a, c, m]), /* @__PURE__ */ f(Ve, { ...e, ref: i });
|
|
751
|
+
}), [cn, un] = B(V, { isInside: !1 }), Ve = s.forwardRef(
|
|
752
|
+
(e, t) => {
|
|
394
753
|
const {
|
|
395
|
-
__scopeTooltip:
|
|
754
|
+
__scopeTooltip: n,
|
|
396
755
|
children: o,
|
|
397
|
-
"aria-label":
|
|
398
|
-
onEscapeKeyDown:
|
|
399
|
-
onPointerDownOutside:
|
|
400
|
-
...
|
|
401
|
-
} = e, l =
|
|
402
|
-
return
|
|
756
|
+
"aria-label": r,
|
|
757
|
+
onEscapeKeyDown: i,
|
|
758
|
+
onPointerDownOutside: a,
|
|
759
|
+
...d
|
|
760
|
+
} = e, l = j(D, n), c = U(n), { onClose: u } = l;
|
|
761
|
+
return s.useEffect(() => (document.addEventListener(Z, u), () => document.removeEventListener(Z, u)), [u]), s.useEffect(() => {
|
|
403
762
|
if (l.trigger) {
|
|
404
|
-
const
|
|
405
|
-
const
|
|
406
|
-
|
|
763
|
+
const h = (m) => {
|
|
764
|
+
const p = m.target;
|
|
765
|
+
p != null && p.contains(l.trigger) && u();
|
|
407
766
|
};
|
|
408
|
-
return window.addEventListener("scroll",
|
|
767
|
+
return window.addEventListener("scroll", h, { capture: !0 }), () => window.removeEventListener("scroll", h, { capture: !0 });
|
|
409
768
|
}
|
|
410
|
-
}, [l.trigger,
|
|
411
|
-
|
|
769
|
+
}, [l.trigger, u]), /* @__PURE__ */ f(
|
|
770
|
+
Ee,
|
|
412
771
|
{
|
|
413
772
|
asChild: !0,
|
|
414
773
|
disableOutsidePointerEvents: !1,
|
|
415
|
-
onEscapeKeyDown:
|
|
416
|
-
onPointerDownOutside:
|
|
417
|
-
onFocusOutside: (
|
|
418
|
-
onDismiss:
|
|
419
|
-
children: /* @__PURE__ */
|
|
420
|
-
|
|
774
|
+
onEscapeKeyDown: i,
|
|
775
|
+
onPointerDownOutside: a,
|
|
776
|
+
onFocusOutside: (h) => h.preventDefault(),
|
|
777
|
+
onDismiss: u,
|
|
778
|
+
children: /* @__PURE__ */ Y(
|
|
779
|
+
Ut,
|
|
421
780
|
{
|
|
422
781
|
"data-state": l.stateAttribute,
|
|
423
|
-
...
|
|
424
|
-
...
|
|
425
|
-
ref:
|
|
782
|
+
...c,
|
|
783
|
+
...d,
|
|
784
|
+
ref: t,
|
|
426
785
|
style: {
|
|
427
|
-
...
|
|
786
|
+
...d.style,
|
|
428
787
|
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
429
788
|
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
430
789
|
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -432,8 +791,8 @@ var Ct = "TooltipPortal", [Wt, Pt] = L(Ct, {
|
|
|
432
791
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
433
792
|
},
|
|
434
793
|
children: [
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ f(Ce, { children: o }),
|
|
795
|
+
/* @__PURE__ */ f(cn, { scope: n, isInside: !0, children: /* @__PURE__ */ f(tn, { id: l.contentId, role: "tooltip", children: r || o }) })
|
|
437
796
|
]
|
|
438
797
|
}
|
|
439
798
|
)
|
|
@@ -441,25 +800,25 @@ var Ct = "TooltipPortal", [Wt, Pt] = L(Ct, {
|
|
|
441
800
|
);
|
|
442
801
|
}
|
|
443
802
|
);
|
|
444
|
-
|
|
445
|
-
var
|
|
446
|
-
(e,
|
|
447
|
-
const { __scopeTooltip:
|
|
448
|
-
return
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
).isInside ? null : /* @__PURE__ */
|
|
803
|
+
Ue.displayName = D;
|
|
804
|
+
var je = "TooltipArrow", Ye = s.forwardRef(
|
|
805
|
+
(e, t) => {
|
|
806
|
+
const { __scopeTooltip: n, ...o } = e, r = U(n);
|
|
807
|
+
return un(
|
|
808
|
+
je,
|
|
809
|
+
n
|
|
810
|
+
).isInside ? null : /* @__PURE__ */ f(Vt, { ...r, ...o, ref: t });
|
|
452
811
|
}
|
|
453
812
|
);
|
|
454
|
-
|
|
455
|
-
function
|
|
456
|
-
const
|
|
457
|
-
switch (Math.min(
|
|
458
|
-
case
|
|
813
|
+
Ye.displayName = je;
|
|
814
|
+
function dn(e, t) {
|
|
815
|
+
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);
|
|
816
|
+
switch (Math.min(n, o, r, i)) {
|
|
817
|
+
case i:
|
|
459
818
|
return "left";
|
|
460
|
-
case
|
|
819
|
+
case r:
|
|
461
820
|
return "right";
|
|
462
|
-
case
|
|
821
|
+
case n:
|
|
463
822
|
return "top";
|
|
464
823
|
case o:
|
|
465
824
|
return "bottom";
|
|
@@ -467,102 +826,102 @@ function Et(e, r) {
|
|
|
467
826
|
throw new Error("unreachable");
|
|
468
827
|
}
|
|
469
828
|
}
|
|
470
|
-
function
|
|
829
|
+
function fn(e, t, n = 5) {
|
|
471
830
|
const o = [];
|
|
472
|
-
switch (
|
|
831
|
+
switch (t) {
|
|
473
832
|
case "top":
|
|
474
833
|
o.push(
|
|
475
|
-
{ x: e.x -
|
|
476
|
-
{ x: e.x +
|
|
834
|
+
{ x: e.x - n, y: e.y + n },
|
|
835
|
+
{ x: e.x + n, y: e.y + n }
|
|
477
836
|
);
|
|
478
837
|
break;
|
|
479
838
|
case "bottom":
|
|
480
839
|
o.push(
|
|
481
|
-
{ x: e.x -
|
|
482
|
-
{ x: e.x +
|
|
840
|
+
{ x: e.x - n, y: e.y - n },
|
|
841
|
+
{ x: e.x + n, y: e.y - n }
|
|
483
842
|
);
|
|
484
843
|
break;
|
|
485
844
|
case "left":
|
|
486
845
|
o.push(
|
|
487
|
-
{ x: e.x +
|
|
488
|
-
{ x: e.x +
|
|
846
|
+
{ x: e.x + n, y: e.y - n },
|
|
847
|
+
{ x: e.x + n, y: e.y + n }
|
|
489
848
|
);
|
|
490
849
|
break;
|
|
491
850
|
case "right":
|
|
492
851
|
o.push(
|
|
493
|
-
{ x: e.x -
|
|
494
|
-
{ x: e.x -
|
|
852
|
+
{ x: e.x - n, y: e.y - n },
|
|
853
|
+
{ x: e.x - n, y: e.y + n }
|
|
495
854
|
);
|
|
496
855
|
break;
|
|
497
856
|
}
|
|
498
857
|
return o;
|
|
499
858
|
}
|
|
500
|
-
function
|
|
501
|
-
const { top:
|
|
859
|
+
function pn(e) {
|
|
860
|
+
const { top: t, right: n, bottom: o, left: r } = e;
|
|
502
861
|
return [
|
|
503
|
-
{ x:
|
|
504
|
-
{ x:
|
|
505
|
-
{ x:
|
|
506
|
-
{ x:
|
|
862
|
+
{ x: r, y: t },
|
|
863
|
+
{ x: n, y: t },
|
|
864
|
+
{ x: n, y: o },
|
|
865
|
+
{ x: r, y: o }
|
|
507
866
|
];
|
|
508
867
|
}
|
|
509
|
-
function
|
|
510
|
-
const { x:
|
|
511
|
-
let
|
|
512
|
-
for (let
|
|
513
|
-
const
|
|
514
|
-
l > o !=
|
|
868
|
+
function hn(e, t) {
|
|
869
|
+
const { x: n, y: o } = e;
|
|
870
|
+
let r = !1;
|
|
871
|
+
for (let i = 0, a = t.length - 1; i < t.length; a = i++) {
|
|
872
|
+
const d = t[i].x, l = t[i].y, c = t[a].x, u = t[a].y;
|
|
873
|
+
l > o != u > o && n < (c - d) * (o - l) / (u - l) + d && (r = !r);
|
|
515
874
|
}
|
|
516
|
-
return
|
|
875
|
+
return r;
|
|
517
876
|
}
|
|
518
|
-
function
|
|
519
|
-
const
|
|
520
|
-
return
|
|
877
|
+
function mn(e) {
|
|
878
|
+
const t = e.slice();
|
|
879
|
+
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), vn(t);
|
|
521
880
|
}
|
|
522
|
-
function
|
|
881
|
+
function vn(e) {
|
|
523
882
|
if (e.length <= 1)
|
|
524
883
|
return e.slice();
|
|
525
|
-
const
|
|
884
|
+
const t = [];
|
|
526
885
|
for (let o = 0; o < e.length; o++) {
|
|
527
|
-
const
|
|
528
|
-
for (;
|
|
529
|
-
const
|
|
530
|
-
if ((
|
|
531
|
-
|
|
886
|
+
const r = e[o];
|
|
887
|
+
for (; t.length >= 2; ) {
|
|
888
|
+
const i = t[t.length - 1], a = t[t.length - 2];
|
|
889
|
+
if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
|
|
890
|
+
t.pop();
|
|
532
891
|
else
|
|
533
892
|
break;
|
|
534
893
|
}
|
|
535
|
-
|
|
894
|
+
t.push(r);
|
|
536
895
|
}
|
|
537
|
-
|
|
538
|
-
const
|
|
896
|
+
t.pop();
|
|
897
|
+
const n = [];
|
|
539
898
|
for (let o = e.length - 1; o >= 0; o--) {
|
|
540
|
-
const
|
|
541
|
-
for (;
|
|
542
|
-
const
|
|
543
|
-
if ((
|
|
544
|
-
|
|
899
|
+
const r = e[o];
|
|
900
|
+
for (; n.length >= 2; ) {
|
|
901
|
+
const i = n[n.length - 1], a = n[n.length - 2];
|
|
902
|
+
if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
|
|
903
|
+
n.pop();
|
|
545
904
|
else
|
|
546
905
|
break;
|
|
547
906
|
}
|
|
548
|
-
|
|
907
|
+
n.push(r);
|
|
549
908
|
}
|
|
550
|
-
return
|
|
909
|
+
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);
|
|
551
910
|
}
|
|
552
|
-
const
|
|
553
|
-
tooltipContent:
|
|
554
|
-
tooltipArrow:
|
|
555
|
-
fadeIn:
|
|
556
|
-
},
|
|
557
|
-
({ children: e, content:
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
/* @__PURE__ */
|
|
911
|
+
const yn = "_tooltipContent_thtj1_1", gn = "_tooltipArrow_thtj1_8", wn = "_fadeIn_thtj1_1", me = {
|
|
912
|
+
tooltipContent: yn,
|
|
913
|
+
tooltipArrow: gn,
|
|
914
|
+
fadeIn: wn
|
|
915
|
+
}, Cn = it(
|
|
916
|
+
({ children: e, content: t, className: n, style: o }, r) => /* @__PURE__ */ f(Fe, { children: /* @__PURE__ */ Y(He, { delayDuration: 1e3, children: [
|
|
917
|
+
/* @__PURE__ */ f(Be, { asChild: !0, children: /* @__PURE__ */ f("div", { ref: r, className: n, style: o, children: e }) }),
|
|
918
|
+
/* @__PURE__ */ Y(Ue, { className: me.tooltipContent, sideOffset: 5, children: [
|
|
919
|
+
/* @__PURE__ */ f(Ye, { className: me.tooltipArrow }),
|
|
920
|
+
/* @__PURE__ */ f("span", { children: t })
|
|
562
921
|
] })
|
|
563
922
|
] }) })
|
|
564
923
|
);
|
|
565
|
-
|
|
924
|
+
Cn.displayName = "RPTooltip";
|
|
566
925
|
export {
|
|
567
|
-
|
|
926
|
+
Cn as default
|
|
568
927
|
};
|