likec4 1.56.0 → 1.58.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/__app__/codegen/react.mjs +7 -8
- package/__app__/codegen/webcomponent.mjs +77 -736
- package/__app__/src/aichat/index.mjs +8 -0
- package/__app__/src/chunks/AIChat.mjs +959 -0
- package/__app__/src/chunks/DiagramActorProvider.mjs +7638 -0
- package/__app__/src/chunks/LikeC4Styles.mjs +1866 -0
- package/__app__/src/chunks/Markdown.mjs +146 -0
- package/__app__/src/chunks/NavigationPanel.mjs +61 -0
- package/__app__/src/chunks/ProjectsOverview.mjs +540 -0
- package/__app__/src/chunks/adhoc-editor.mjs +3386 -0
- package/__app__/src/chunks/es.mjs +439 -0
- package/__app__/src/chunks/hooks.mjs +145 -0
- package/__app__/src/chunks/libs/@dagrejs/dagre.mjs +1894 -0
- package/__app__/src/chunks/libs/@floating-ui.mjs +2218 -0
- package/__app__/src/chunks/libs/@mantine.mjs +12070 -0
- package/__app__/src/chunks/libs/@tabler/icons-react.mjs +252 -0
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +1768 -0
- package/__app__/src/chunks/libs/@tanstack.mjs +2718 -0
- package/__app__/src/chunks/libs/@xstate/react.mjs +1982 -0
- package/__app__/src/chunks/libs/@xyflow/react.mjs +5256 -0
- package/__app__/src/chunks/libs/bezier-js.mjs +1003 -0
- package/__app__/src/chunks/libs/d3.mjs +2842 -0
- package/__app__/src/chunks/libs/fast-equals.mjs +268 -0
- package/__app__/src/chunks/libs/framer.mjs +5872 -0
- package/__app__/src/chunks/libs/remeda.mjs +642 -0
- package/__app__/src/chunks/libs/zod.mjs +3170 -0
- package/__app__/src/chunks/rolldown-runtime.mjs +23 -0
- package/__app__/src/chunks/styled-system.mjs +1040 -0
- package/__app__/src/fonts.css +1 -1
- package/__app__/src/main.mjs +14847 -1
- package/__app__/src/style.css +1 -1
- package/config/schema.json +14 -41
- package/dist/chunks/enableServer.mjs +1 -0
- package/dist/chunks/filenames.mjs +2 -2
- package/dist/chunks/index2.d.mts +2057 -722
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -3
- package/dist/chunks/libs/@ts-graphviz/ast.mjs +3 -0
- package/dist/chunks/libs/@ts-graphviz/common.d.mts +9 -0
- package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -0
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/chunks/libs/chevrotain.mjs +26 -26
- package/dist/chunks/libs/langium.d.mts +5 -5
- package/dist/chunks/libs/langium.mjs +10 -10
- package/dist/chunks/libs/merge-error-cause.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +3 -1
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/which.mjs +1 -1
- package/dist/chunks/libs/zod.d.mts +60 -25
- package/dist/chunks/libs/zod.mjs +65 -0
- package/dist/chunks/node.mjs +84 -56
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/vite-plugin.mjs +593 -0
- package/dist/cli/index.mjs +184 -141
- package/dist/index.d.mts +2 -131
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +2 -2
- package/dist/vite-plugin/index.d.mts +53 -2
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal/index.d.mts +327 -4
- package/dist/vite-plugin/internal/index.mjs +946 -1
- package/package.json +85 -72
- package/react/index.d.mts +174 -73
- package/react/index.mjs +42468 -38926
- package/vite-plugin-modules.d.ts +4 -0
- package/__app__/chunks/ColorSchemeToggle.mjs +0 -1
- package/__app__/chunks/DiagramActorProvider.mjs +0 -10
- package/__app__/chunks/Fallback.mjs +0 -1
- package/__app__/chunks/Header.mjs +0 -13
- package/__app__/chunks/IconRenderer.mjs +0 -1
- package/__app__/chunks/LikeC4Diagram.mjs +0 -19
- package/__app__/chunks/LikeC4ModelContext.mjs +0 -1
- package/__app__/chunks/LikeC4ModelContext2.mjs +0 -1
- package/__app__/chunks/LikeC4Styles.mjs +0 -48
- package/__app__/chunks/NavigationPanel.mjs +0 -1
- package/__app__/chunks/StaticLikeC4Diagram.mjs +0 -1
- package/__app__/chunks/ViewReact.mjs +0 -1
- package/__app__/chunks/__root.mjs +0 -1
- package/__app__/chunks/adhoc-editor.mjs +0 -1
- package/__app__/chunks/hooks.mjs +0 -1
- package/__app__/chunks/libs/@dagrejs/dagre.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/core.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/dom.mjs +0 -1
- package/__app__/chunks/libs/@floating-ui/react.mjs +0 -1
- package/__app__/chunks/libs/@mantine/core.mjs +0 -41
- package/__app__/chunks/libs/@mantine/hooks.mjs +0 -1
- package/__app__/chunks/libs/@nanostores/react.mjs +0 -1
- package/__app__/chunks/libs/@react-hookz/web.mjs +0 -1
- package/__app__/chunks/libs/@tabler/icons-react.mjs +0 -15
- package/__app__/chunks/libs/@tanstack/history.mjs +0 -1
- package/__app__/chunks/libs/@tanstack/react-router.mjs +0 -3
- package/__app__/chunks/libs/@tanstack/router-core.mjs +0 -1
- package/__app__/chunks/libs/@xstate/react.mjs +0 -1
- package/__app__/chunks/libs/@xstate/store.mjs +0 -1
- package/__app__/chunks/libs/@xyflow/react.mjs +0 -7
- package/__app__/chunks/libs/@zag-js/anatomy.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/collection.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/core.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/react.mjs +0 -1
- package/__app__/chunks/libs/@zag-js/tree-view.mjs +0 -1
- package/__app__/chunks/libs/bezier-js.mjs +0 -1
- package/__app__/chunks/libs/d3-path.mjs +0 -1
- package/__app__/chunks/libs/d3-shape.mjs +0 -1
- package/__app__/chunks/libs/fast-equals.mjs +0 -1
- package/__app__/chunks/libs/framer-motion.mjs +0 -9
- package/__app__/chunks/libs/html-to-image.mjs +0 -2
- package/__app__/chunks/libs/motion-dom.mjs +0 -1
- package/__app__/chunks/libs/motion.mjs +0 -1
- package/__app__/chunks/libs/nanostores.mjs +0 -1
- package/__app__/chunks/libs/react-error-boundary.mjs +0 -1
- package/__app__/chunks/libs/react-resizable-panels.mjs +0 -1
- package/__app__/chunks/libs/remeda.mjs +0 -1
- package/__app__/chunks/libs/xstate.mjs +0 -1
- package/__app__/chunks/libs/zod.mjs +0 -39
- package/__app__/chunks/rolldown-runtime.mjs +0 -1
- package/__app__/chunks/safeCtx.mjs +0 -1
- package/__app__/chunks/searchParams.mjs +0 -1
- package/__app__/chunks/single-index.mjs +0 -1
- package/__app__/chunks/styled-system.mjs +0 -1
- package/__app__/chunks/styles.css.mjs +0 -1
- package/__app__/chunks/useLikeC4Project.mjs +0 -1
- package/__app__/chunks/useUpdateEffect.mjs +0 -1
- package/__app__/src/pages/AdHocViewEditor.mjs +0 -1
- package/__app__/src/pages/EmbedPage.mjs +0 -1
- package/__app__/src/pages/ExportPage.mjs +0 -1
- package/__app__/src/pages/ProjectsOverview.mjs +0 -1
- package/__app__/src/pages/ViewAsD2.mjs +0 -1
- package/__app__/src/pages/ViewAsDot.mjs +0 -1
- package/__app__/src/pages/ViewAsMmd.mjs +0 -1
- package/__app__/src/pages/ViewAsPuml.mjs +0 -1
- package/__app__/src/pages/ViewEditor.mjs +0 -1
- package/__app__/src/pages/ViewReact.mjs +0 -1
- package/__app__/src/routeTree.gen.mjs +0 -1
- package/__app__/src/routes/__root.mjs +0 -1
- package/__app__/src/routes/_single/adhoc.mjs +0 -1
- package/__app__/src/routes/_single/embed._viewId.mjs +0 -1
- package/__app__/src/routes/_single/export._viewId.mjs +0 -1
- package/__app__/src/routes/_single/route.mjs +0 -1
- package/__app__/src/routes/_single/single-index.mjs +0 -1
- package/__app__/src/routes/_single/view._viewId.d2.mjs +0 -1
- package/__app__/src/routes/_single/view._viewId.dot.mjs +0 -1
- package/__app__/src/routes/_single/view._viewId.index.mjs +0 -1
- package/__app__/src/routes/_single/view._viewId.mjs +0 -1
- package/__app__/src/routes/_single/view._viewId.mmd.mjs +0 -1
- package/__app__/src/routes/_single/view._viewId.puml.mjs +0 -1
- package/__app__/src/routes/_single/webcomponent._.mjs +0 -33
- package/__app__/src/routes/index.mjs +0 -1
- package/__app__/src/routes/project._projectId/-components.mjs +0 -1
- package/__app__/src/routes/project._projectId/adhoc.mjs +0 -1
- package/__app__/src/routes/project._projectId/embed._viewId.mjs +0 -1
- package/__app__/src/routes/project._projectId/export._viewId.mjs +0 -1
- package/__app__/src/routes/project._projectId/index.mjs +0 -1
- package/__app__/src/routes/project._projectId/route.mjs +0 -1
- package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +0 -1
- package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +0 -1
- package/__app__/src/routes/project._projectId/view._viewId.index.mjs +0 -1
- package/__app__/src/routes/project._projectId/view._viewId.mjs +0 -1
- package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +0 -1
- package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +0 -1
- package/__app__/src/routes/projects.mjs +0 -1
- package/dist/chunks/libs/@chevrotain/utils.mjs +0 -1
- package/dist/chunks/libs/@hono/mcp.mjs +0 -45
- package/dist/chunks/libs/@hono/node-server.mjs +0 -1
- package/dist/chunks/libs/@logtape/logtape.d.mts +0 -1023
- package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
- package/dist/chunks/libs/ajv.mjs +0 -1
- package/dist/chunks/libs/ansi-align.mjs +0 -2
- package/dist/chunks/libs/ansi-regex.mjs +0 -1
- package/dist/chunks/libs/ansi-styles.mjs +0 -1
- package/dist/chunks/libs/atomically.mjs +0 -1
- package/dist/chunks/libs/boxen.mjs +0 -22
- package/dist/chunks/libs/conf.mjs +0 -1
- package/dist/chunks/libs/defu.mjs +0 -1
- package/dist/chunks/libs/destr.mjs +0 -1
- package/dist/chunks/libs/find-up-simple.mjs +0 -1
- package/dist/chunks/libs/get-port.mjs +0 -1
- package/dist/chunks/libs/hono.mjs +0 -1
- package/dist/chunks/libs/is-docker.mjs +0 -1
- package/dist/chunks/libs/is-error-instance.mjs +0 -1
- package/dist/chunks/libs/is-inside-container.mjs +0 -1
- package/dist/chunks/libs/is-plain-obj.mjs +0 -1
- package/dist/chunks/libs/isexe.mjs +0 -1
- package/dist/chunks/libs/ky.mjs +0 -3
- package/dist/chunks/libs/p-debounce.mjs +0 -1
- package/dist/chunks/libs/p-limit.mjs +0 -1
- package/dist/chunks/libs/p-timeout.mjs +0 -1
- package/dist/chunks/libs/package-up.mjs +0 -1
- package/dist/chunks/libs/parse-ms.mjs +0 -1
- package/dist/chunks/libs/safe-stringify.mjs +0 -1
- package/dist/chunks/libs/strip-indent.mjs +0 -1
- package/dist/chunks/libs/tinyrainbow.mjs +0 -1
- package/dist/chunks/libs/ts-graphviz.d.mts +0 -12
- package/dist/chunks/libs/ts-graphviz.mjs +0 -4
- package/dist/chunks/libs/vscode-languageserver.mjs +0 -1
- package/dist/chunks/libs/word-wrap.mjs +0 -12
- package/dist/chunks/plugin.mjs +0 -400
- package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.d.mts +0 -269
- package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/nanostores.d.mts +0 -59
- package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +0 -1
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +0 -1
|
@@ -0,0 +1,2218 @@
|
|
|
1
|
+
import { i as e } from "../rolldown-runtime.mjs";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { useLayoutEffect as n } from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import * as i from "react-dom";
|
|
6
|
+
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
7
|
+
function hasWindow() {
|
|
8
|
+
return typeof window < "u";
|
|
9
|
+
}
|
|
10
|
+
function getNodeName(e) {
|
|
11
|
+
return isNode(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
12
|
+
}
|
|
13
|
+
function getWindow(e) {
|
|
14
|
+
var t;
|
|
15
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
16
|
+
}
|
|
17
|
+
function getDocumentElement(e) {
|
|
18
|
+
return ((isNode(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
19
|
+
}
|
|
20
|
+
function isNode(e) {
|
|
21
|
+
return hasWindow() ? e instanceof Node || e instanceof getWindow(e).Node : !1;
|
|
22
|
+
}
|
|
23
|
+
function isElement(e) {
|
|
24
|
+
return hasWindow() ? e instanceof Element || e instanceof getWindow(e).Element : !1;
|
|
25
|
+
}
|
|
26
|
+
function isHTMLElement(e) {
|
|
27
|
+
return hasWindow() ? e instanceof HTMLElement || e instanceof getWindow(e).HTMLElement : !1;
|
|
28
|
+
}
|
|
29
|
+
function isShadowRoot(e) {
|
|
30
|
+
return !hasWindow() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof getWindow(e).ShadowRoot;
|
|
31
|
+
}
|
|
32
|
+
function isOverflowElement(e) {
|
|
33
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = getComputedStyle$1(e);
|
|
34
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
35
|
+
}
|
|
36
|
+
function isTableElement(e) {
|
|
37
|
+
return /^(table|td|th)$/.test(getNodeName(e));
|
|
38
|
+
}
|
|
39
|
+
function isTopLayer(e) {
|
|
40
|
+
try {
|
|
41
|
+
if (e.matches(":popover-open")) return !0;
|
|
42
|
+
} catch {}
|
|
43
|
+
try {
|
|
44
|
+
return e.matches(":modal");
|
|
45
|
+
} catch {
|
|
46
|
+
return !1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
var a = /transform|translate|scale|rotate|perspective|filter/, o = /paint|layout|strict|content/, isNotNone = (e) => !!e && e !== "none", s;
|
|
50
|
+
function isContainingBlock(e) {
|
|
51
|
+
let t = isElement(e) ? getComputedStyle$1(e) : e;
|
|
52
|
+
return isNotNone(t.transform) || isNotNone(t.translate) || isNotNone(t.scale) || isNotNone(t.rotate) || isNotNone(t.perspective) || !isWebKit() && (isNotNone(t.backdropFilter) || isNotNone(t.filter)) || a.test(t.willChange || "") || o.test(t.contain || "");
|
|
53
|
+
}
|
|
54
|
+
function getContainingBlock(e) {
|
|
55
|
+
let t = getParentNode(e);
|
|
56
|
+
for (; isHTMLElement(t) && !isLastTraversableNode(t);) {
|
|
57
|
+
if (isContainingBlock(t)) return t;
|
|
58
|
+
if (isTopLayer(t)) return null;
|
|
59
|
+
t = getParentNode(t);
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
function isWebKit() {
|
|
64
|
+
return s ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), s;
|
|
65
|
+
}
|
|
66
|
+
function isLastTraversableNode(e) {
|
|
67
|
+
return /^(html|body|#document)$/.test(getNodeName(e));
|
|
68
|
+
}
|
|
69
|
+
function getComputedStyle$1(e) {
|
|
70
|
+
return getWindow(e).getComputedStyle(e);
|
|
71
|
+
}
|
|
72
|
+
e(getComputedStyle$1, "getComputedStyle");
|
|
73
|
+
function getNodeScroll(e) {
|
|
74
|
+
return isElement(e) ? {
|
|
75
|
+
scrollLeft: e.scrollLeft,
|
|
76
|
+
scrollTop: e.scrollTop
|
|
77
|
+
} : {
|
|
78
|
+
scrollLeft: e.scrollX,
|
|
79
|
+
scrollTop: e.scrollY
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function getParentNode(e) {
|
|
83
|
+
if (getNodeName(e) === "html") return e;
|
|
84
|
+
let t = e.assignedSlot || e.parentNode || isShadowRoot(e) && e.host || getDocumentElement(e);
|
|
85
|
+
return isShadowRoot(t) ? t.host : t;
|
|
86
|
+
}
|
|
87
|
+
function getNearestOverflowAncestor(e) {
|
|
88
|
+
let t = getParentNode(e);
|
|
89
|
+
return isLastTraversableNode(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : isHTMLElement(t) && isOverflowElement(t) ? t : getNearestOverflowAncestor(t);
|
|
90
|
+
}
|
|
91
|
+
function getOverflowAncestors(e, t, n) {
|
|
92
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
93
|
+
let r = getNearestOverflowAncestor(e), i = r === e.ownerDocument?.body, a = getWindow(r);
|
|
94
|
+
if (i) {
|
|
95
|
+
let e = getFrameElement(a);
|
|
96
|
+
return t.concat(a, a.visualViewport || [], isOverflowElement(r) ? r : [], e && n ? getOverflowAncestors(e) : []);
|
|
97
|
+
} else return t.concat(r, getOverflowAncestors(r, [], n));
|
|
98
|
+
}
|
|
99
|
+
function getFrameElement(e) {
|
|
100
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
104
|
+
var c = [
|
|
105
|
+
"top",
|
|
106
|
+
"right",
|
|
107
|
+
"bottom",
|
|
108
|
+
"left"
|
|
109
|
+
], l = ["start", "end"], u = /* @__PURE__ */ c.reduce((e, t) => e.concat(t, t + "-" + l[0], t + "-" + l[1]), []), d = Math.min, f = Math.max, p = Math.round, m = Math.floor, createCoords = (e) => ({
|
|
110
|
+
x: e,
|
|
111
|
+
y: e
|
|
112
|
+
}), h = {
|
|
113
|
+
left: "right",
|
|
114
|
+
right: "left",
|
|
115
|
+
bottom: "top",
|
|
116
|
+
top: "bottom"
|
|
117
|
+
};
|
|
118
|
+
function clamp(e, t, n) {
|
|
119
|
+
return f(e, d(t, n));
|
|
120
|
+
}
|
|
121
|
+
function evaluate(e, t) {
|
|
122
|
+
return typeof e == "function" ? e(t) : e;
|
|
123
|
+
}
|
|
124
|
+
function getSide(e) {
|
|
125
|
+
return e.split("-")[0];
|
|
126
|
+
}
|
|
127
|
+
function getAlignment(e) {
|
|
128
|
+
return e.split("-")[1];
|
|
129
|
+
}
|
|
130
|
+
function getOppositeAxis(e) {
|
|
131
|
+
return e === "x" ? "y" : "x";
|
|
132
|
+
}
|
|
133
|
+
function getAxisLength(e) {
|
|
134
|
+
return e === "y" ? "height" : "width";
|
|
135
|
+
}
|
|
136
|
+
function getSideAxis(e) {
|
|
137
|
+
let t = e[0];
|
|
138
|
+
return t === "t" || t === "b" ? "y" : "x";
|
|
139
|
+
}
|
|
140
|
+
function getAlignmentAxis(e) {
|
|
141
|
+
return getOppositeAxis(getSideAxis(e));
|
|
142
|
+
}
|
|
143
|
+
function getAlignmentSides(e, t, n) {
|
|
144
|
+
n === void 0 && (n = !1);
|
|
145
|
+
let r = getAlignment(e), i = getAlignmentAxis(e), a = getAxisLength(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
146
|
+
return t.reference[a] > t.floating[a] && (o = getOppositePlacement(o)), [o, getOppositePlacement(o)];
|
|
147
|
+
}
|
|
148
|
+
function getExpandedPlacements(e) {
|
|
149
|
+
let t = getOppositePlacement(e);
|
|
150
|
+
return [
|
|
151
|
+
getOppositeAlignmentPlacement(e),
|
|
152
|
+
t,
|
|
153
|
+
getOppositeAlignmentPlacement(t)
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
function getOppositeAlignmentPlacement(e) {
|
|
157
|
+
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
158
|
+
}
|
|
159
|
+
var g = ["left", "right"], _ = ["right", "left"], v = ["top", "bottom"], y = ["bottom", "top"];
|
|
160
|
+
function getSideList(e, t, n) {
|
|
161
|
+
switch (e) {
|
|
162
|
+
case "top":
|
|
163
|
+
case "bottom": return n ? t ? _ : g : t ? g : _;
|
|
164
|
+
case "left":
|
|
165
|
+
case "right": return t ? v : y;
|
|
166
|
+
default: return [];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function getOppositeAxisPlacements(e, t, n, r) {
|
|
170
|
+
let i = getAlignment(e), a = getSideList(getSide(e), n === "start", r);
|
|
171
|
+
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(getOppositeAlignmentPlacement)))), a;
|
|
172
|
+
}
|
|
173
|
+
function getOppositePlacement(e) {
|
|
174
|
+
let t = getSide(e);
|
|
175
|
+
return h[t] + e.slice(t.length);
|
|
176
|
+
}
|
|
177
|
+
function expandPaddingObject(e) {
|
|
178
|
+
return {
|
|
179
|
+
top: 0,
|
|
180
|
+
right: 0,
|
|
181
|
+
bottom: 0,
|
|
182
|
+
left: 0,
|
|
183
|
+
...e
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function getPaddingObject(e) {
|
|
187
|
+
return typeof e == "number" ? {
|
|
188
|
+
top: e,
|
|
189
|
+
right: e,
|
|
190
|
+
bottom: e,
|
|
191
|
+
left: e
|
|
192
|
+
} : expandPaddingObject(e);
|
|
193
|
+
}
|
|
194
|
+
function rectToClientRect(e) {
|
|
195
|
+
let { x: t, y: n, width: r, height: i } = e;
|
|
196
|
+
return {
|
|
197
|
+
width: r,
|
|
198
|
+
height: i,
|
|
199
|
+
top: n,
|
|
200
|
+
left: t,
|
|
201
|
+
right: t + r,
|
|
202
|
+
bottom: n + i,
|
|
203
|
+
x: t,
|
|
204
|
+
y: n
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region ../../node_modules/.pnpm/@floating-ui+react@0.27.19_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs
|
|
209
|
+
function getPlatform() {
|
|
210
|
+
let e = navigator.userAgentData;
|
|
211
|
+
return e != null && e.platform ? e.platform : navigator.platform;
|
|
212
|
+
}
|
|
213
|
+
function getUserAgent() {
|
|
214
|
+
let e = navigator.userAgentData;
|
|
215
|
+
return e && Array.isArray(e.brands) ? e.brands.map((e) => {
|
|
216
|
+
let { brand: t, version: n } = e;
|
|
217
|
+
return t + "/" + n;
|
|
218
|
+
}).join(" ") : navigator.userAgent;
|
|
219
|
+
}
|
|
220
|
+
function isSafari() {
|
|
221
|
+
return /apple/i.test(navigator.vendor);
|
|
222
|
+
}
|
|
223
|
+
function isMac() {
|
|
224
|
+
return getPlatform().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
225
|
+
}
|
|
226
|
+
function isJSDOM() {
|
|
227
|
+
return getUserAgent().includes("jsdom/");
|
|
228
|
+
}
|
|
229
|
+
var b = "data-floating-ui-focusable", x = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
230
|
+
function activeElement(e) {
|
|
231
|
+
let t = e.activeElement;
|
|
232
|
+
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null;) {
|
|
233
|
+
var n;
|
|
234
|
+
t = t.shadowRoot.activeElement;
|
|
235
|
+
}
|
|
236
|
+
return t;
|
|
237
|
+
}
|
|
238
|
+
function contains$1(e, t) {
|
|
239
|
+
if (!e || !t) return !1;
|
|
240
|
+
let n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
241
|
+
if (e.contains(t)) return !0;
|
|
242
|
+
if (n && isShadowRoot(n)) {
|
|
243
|
+
let n = t;
|
|
244
|
+
for (; n;) {
|
|
245
|
+
if (e === n) return !0;
|
|
246
|
+
n = n.parentNode || n.host;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return !1;
|
|
250
|
+
}
|
|
251
|
+
e(contains$1, "contains");
|
|
252
|
+
function getTarget$1(e) {
|
|
253
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
254
|
+
}
|
|
255
|
+
e(getTarget$1, "getTarget");
|
|
256
|
+
function isEventTargetWithin(e, t) {
|
|
257
|
+
if (t == null) return !1;
|
|
258
|
+
if ("composedPath" in e) return e.composedPath().includes(t);
|
|
259
|
+
let n = e;
|
|
260
|
+
return n.target != null && t.contains(n.target);
|
|
261
|
+
}
|
|
262
|
+
function isRootElement(e) {
|
|
263
|
+
return e.matches("html,body");
|
|
264
|
+
}
|
|
265
|
+
function getDocument(e) {
|
|
266
|
+
return e?.ownerDocument || document;
|
|
267
|
+
}
|
|
268
|
+
function isTypeableElement(e) {
|
|
269
|
+
return isHTMLElement(e) && e.matches(x);
|
|
270
|
+
}
|
|
271
|
+
function matchesFocusVisible(e) {
|
|
272
|
+
if (!e || isJSDOM()) return !0;
|
|
273
|
+
try {
|
|
274
|
+
return e.matches(":focus-visible");
|
|
275
|
+
} catch {
|
|
276
|
+
return !0;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function getFloatingFocusElement(e) {
|
|
280
|
+
return e ? e.hasAttribute(b) ? e : e.querySelector("[data-floating-ui-focusable]") || e : null;
|
|
281
|
+
}
|
|
282
|
+
function getNodeChildren$1(e, t, n) {
|
|
283
|
+
return n === void 0 && (n = !0), e.filter((e) => e.parentId === t && (!n || e.context?.open)).flatMap((t) => [t, ...getNodeChildren$1(e, t.id, n)]);
|
|
284
|
+
}
|
|
285
|
+
e(getNodeChildren$1, "getNodeChildren");
|
|
286
|
+
function isReactEvent(e) {
|
|
287
|
+
return "nativeEvent" in e;
|
|
288
|
+
}
|
|
289
|
+
function isMouseLikePointerType(e, t) {
|
|
290
|
+
let n = ["mouse", "pen"];
|
|
291
|
+
return t || n.push("", void 0), n.includes(e);
|
|
292
|
+
}
|
|
293
|
+
var S = typeof document < "u" ? n : function noop() {}, C = { ...t };
|
|
294
|
+
function useLatestRef$1(e) {
|
|
295
|
+
let n = t.useRef(e);
|
|
296
|
+
return S(() => {
|
|
297
|
+
n.current = e;
|
|
298
|
+
}), n;
|
|
299
|
+
}
|
|
300
|
+
e(useLatestRef$1, "useLatestRef");
|
|
301
|
+
var w = C.useInsertionEffect || ((e) => e());
|
|
302
|
+
function useEffectEvent$1(e) {
|
|
303
|
+
let n = t.useRef(() => {});
|
|
304
|
+
return w(() => {
|
|
305
|
+
n.current = e;
|
|
306
|
+
}), t.useCallback(function() {
|
|
307
|
+
var e = [...arguments];
|
|
308
|
+
return n.current == null ? void 0 : n.current(...e);
|
|
309
|
+
}, []);
|
|
310
|
+
}
|
|
311
|
+
e(useEffectEvent$1, "useEffectEvent");
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region ../../node_modules/.pnpm/@floating-ui+core@1.7.5/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
314
|
+
function computeCoordsFromPlacement(e, t, n) {
|
|
315
|
+
let { reference: r, floating: i } = e, a = getSideAxis(t), o = getAlignmentAxis(t), s = getAxisLength(o), c = getSide(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
|
|
316
|
+
switch (c) {
|
|
317
|
+
case "top":
|
|
318
|
+
p = {
|
|
319
|
+
x: u,
|
|
320
|
+
y: r.y - i.height
|
|
321
|
+
};
|
|
322
|
+
break;
|
|
323
|
+
case "bottom":
|
|
324
|
+
p = {
|
|
325
|
+
x: u,
|
|
326
|
+
y: r.y + r.height
|
|
327
|
+
};
|
|
328
|
+
break;
|
|
329
|
+
case "right":
|
|
330
|
+
p = {
|
|
331
|
+
x: r.x + r.width,
|
|
332
|
+
y: d
|
|
333
|
+
};
|
|
334
|
+
break;
|
|
335
|
+
case "left":
|
|
336
|
+
p = {
|
|
337
|
+
x: r.x - i.width,
|
|
338
|
+
y: d
|
|
339
|
+
};
|
|
340
|
+
break;
|
|
341
|
+
default: p = {
|
|
342
|
+
x: r.x,
|
|
343
|
+
y: r.y
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
switch (getAlignment(t)) {
|
|
347
|
+
case "start":
|
|
348
|
+
p[o] -= f * (n && l ? -1 : 1);
|
|
349
|
+
break;
|
|
350
|
+
case "end":
|
|
351
|
+
p[o] += f * (n && l ? -1 : 1);
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
return p;
|
|
355
|
+
}
|
|
356
|
+
async function detectOverflow(e, t) {
|
|
357
|
+
t === void 0 && (t = {});
|
|
358
|
+
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = evaluate(t, e), p = getPaddingObject(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = rectToClientRect(await i.getClippingRect({
|
|
359
|
+
element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
|
|
360
|
+
boundary: c,
|
|
361
|
+
rootBoundary: l,
|
|
362
|
+
strategy: s
|
|
363
|
+
})), g = u === "floating" ? {
|
|
364
|
+
x: n,
|
|
365
|
+
y: r,
|
|
366
|
+
width: a.floating.width,
|
|
367
|
+
height: a.floating.height
|
|
368
|
+
} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
|
|
369
|
+
x: 1,
|
|
370
|
+
y: 1
|
|
371
|
+
}, y = rectToClientRect(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
372
|
+
elements: o,
|
|
373
|
+
rect: g,
|
|
374
|
+
offsetParent: _,
|
|
375
|
+
strategy: s
|
|
376
|
+
}) : g);
|
|
377
|
+
return {
|
|
378
|
+
top: (h.top - y.top + p.top) / v.y,
|
|
379
|
+
bottom: (y.bottom - h.bottom + p.bottom) / v.y,
|
|
380
|
+
left: (h.left - y.left + p.left) / v.x,
|
|
381
|
+
right: (y.right - h.right + p.right) / v.x
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
var T = 50, E = /* @__PURE__ */ e(async (e, t, n) => {
|
|
385
|
+
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
|
|
386
|
+
...o,
|
|
387
|
+
detectOverflow
|
|
388
|
+
}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
389
|
+
reference: e,
|
|
390
|
+
floating: t,
|
|
391
|
+
strategy: i
|
|
392
|
+
}), { x: u, y: d } = computeCoordsFromPlacement(l, r, c), f = r, p = 0, m = {};
|
|
393
|
+
for (let n = 0; n < a.length; n++) {
|
|
394
|
+
let h = a[n];
|
|
395
|
+
if (!h) continue;
|
|
396
|
+
let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
|
|
397
|
+
x: u,
|
|
398
|
+
y: d,
|
|
399
|
+
initialPlacement: r,
|
|
400
|
+
placement: f,
|
|
401
|
+
strategy: i,
|
|
402
|
+
middlewareData: m,
|
|
403
|
+
rects: l,
|
|
404
|
+
platform: s,
|
|
405
|
+
elements: {
|
|
406
|
+
reference: e,
|
|
407
|
+
floating: t
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
u = v ?? u, d = y ?? d, m[g] = {
|
|
411
|
+
...m[g],
|
|
412
|
+
...b
|
|
413
|
+
}, x && p < T && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
414
|
+
reference: e,
|
|
415
|
+
floating: t,
|
|
416
|
+
strategy: i
|
|
417
|
+
}) : x.rects), {x: u, y: d} = computeCoordsFromPlacement(l, f, c)), n = -1);
|
|
418
|
+
}
|
|
419
|
+
return {
|
|
420
|
+
x: u,
|
|
421
|
+
y: d,
|
|
422
|
+
placement: f,
|
|
423
|
+
strategy: i,
|
|
424
|
+
middlewareData: m
|
|
425
|
+
};
|
|
426
|
+
}, "computePosition"), D = /* @__PURE__ */ e((e) => ({
|
|
427
|
+
name: "arrow",
|
|
428
|
+
options: e,
|
|
429
|
+
async fn(t) {
|
|
430
|
+
let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = evaluate(e, t) || {};
|
|
431
|
+
if (l == null) return {};
|
|
432
|
+
let f = getPaddingObject(u), p = {
|
|
433
|
+
x: n,
|
|
434
|
+
y: r
|
|
435
|
+
}, m = getAlignmentAxis(i), h = getAxisLength(m), g = await o.getDimensions(l), _ = m === "y", v = _ ? "top" : "left", y = _ ? "bottom" : "right", b = _ ? "clientHeight" : "clientWidth", x = a.reference[h] + a.reference[m] - p[m] - a.floating[h], S = p[m] - a.reference[m], C = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), w = C ? C[b] : 0;
|
|
436
|
+
(!w || !await (o.isElement == null ? void 0 : o.isElement(C))) && (w = s.floating[b] || a.floating[h]);
|
|
437
|
+
let T = x / 2 - S / 2, E = w / 2 - g[h] / 2 - 1, D = d(f[v], E), O = d(f[y], E), k = D, A = w - g[h] - O, j = w / 2 - g[h] / 2 + T, M = clamp(k, j, A), N = !c.arrow && getAlignment(i) != null && j !== M && a.reference[h] / 2 - (j < k ? D : O) - g[h] / 2 < 0, P = N ? j < k ? j - k : j - A : 0;
|
|
438
|
+
return {
|
|
439
|
+
[m]: p[m] + P,
|
|
440
|
+
data: {
|
|
441
|
+
[m]: M,
|
|
442
|
+
centerOffset: j - M - P,
|
|
443
|
+
...N && { alignmentOffset: P }
|
|
444
|
+
},
|
|
445
|
+
reset: N
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
}), "arrow");
|
|
449
|
+
function getPlacementList(e, t, n) {
|
|
450
|
+
return (e ? [...n.filter((t) => getAlignment(t) === e), ...n.filter((t) => getAlignment(t) !== e)] : n.filter((e) => getSide(e) === e)).filter((n) => e ? getAlignment(n) === e || (t ? getOppositeAlignmentPlacement(n) !== n : !1) : !0);
|
|
451
|
+
}
|
|
452
|
+
var O = /* @__PURE__ */ e(function(e) {
|
|
453
|
+
return e === void 0 && (e = {}), {
|
|
454
|
+
name: "autoPlacement",
|
|
455
|
+
options: e,
|
|
456
|
+
async fn(t) {
|
|
457
|
+
let { rects: n, middlewareData: r, placement: i, platform: a, elements: o } = t, { crossAxis: s = !1, alignment: c, allowedPlacements: l = u, autoAlignment: d = !0, ...f } = evaluate(e, t), p = c !== void 0 || l === u ? getPlacementList(c || null, d, l) : l, m = await a.detectOverflow(t, f), h = r.autoPlacement?.index || 0, g = p[h];
|
|
458
|
+
if (g == null) return {};
|
|
459
|
+
let _ = getAlignmentSides(g, n, await (a.isRTL == null ? void 0 : a.isRTL(o.floating)));
|
|
460
|
+
if (i !== g) return { reset: { placement: p[0] } };
|
|
461
|
+
let v = [
|
|
462
|
+
m[getSide(g)],
|
|
463
|
+
m[_[0]],
|
|
464
|
+
m[_[1]]
|
|
465
|
+
], y = [...r.autoPlacement?.overflows || [], {
|
|
466
|
+
placement: g,
|
|
467
|
+
overflows: v
|
|
468
|
+
}], b = p[h + 1];
|
|
469
|
+
if (b) return {
|
|
470
|
+
data: {
|
|
471
|
+
index: h + 1,
|
|
472
|
+
overflows: y
|
|
473
|
+
},
|
|
474
|
+
reset: { placement: b }
|
|
475
|
+
};
|
|
476
|
+
let x = y.map((e) => {
|
|
477
|
+
let t = getAlignment(e.placement);
|
|
478
|
+
return [
|
|
479
|
+
e.placement,
|
|
480
|
+
t && s ? e.overflows.slice(0, 2).reduce((e, t) => e + t, 0) : e.overflows[0],
|
|
481
|
+
e.overflows
|
|
482
|
+
];
|
|
483
|
+
}).sort((e, t) => e[1] - t[1]), S = x.filter((e) => e[2].slice(0, getAlignment(e[0]) ? 2 : 3).every((e) => e <= 0))[0]?.[0] || x[0][0];
|
|
484
|
+
return S === i ? {} : {
|
|
485
|
+
data: {
|
|
486
|
+
index: h + 1,
|
|
487
|
+
overflows: y
|
|
488
|
+
},
|
|
489
|
+
reset: { placement: S }
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
}, "autoPlacement"), k = /* @__PURE__ */ e(function(e) {
|
|
494
|
+
return e === void 0 && (e = {}), {
|
|
495
|
+
name: "flip",
|
|
496
|
+
options: e,
|
|
497
|
+
async fn(t) {
|
|
498
|
+
var n;
|
|
499
|
+
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = evaluate(e, t);
|
|
500
|
+
if ((n = i.arrow) != null && n.alignmentOffset) return {};
|
|
501
|
+
let g = getSide(r), _ = getSideAxis(o), v = getSide(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [getOppositePlacement(o)] : getExpandedPlacements(o)), x = p !== "none";
|
|
502
|
+
!d && x && b.push(...getOppositeAxisPlacements(o, m, p, y));
|
|
503
|
+
let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
|
|
504
|
+
if (l && w.push(C[g]), u) {
|
|
505
|
+
let e = getAlignmentSides(r, a, y);
|
|
506
|
+
w.push(C[e[0]], C[e[1]]);
|
|
507
|
+
}
|
|
508
|
+
if (T = [...T, {
|
|
509
|
+
placement: r,
|
|
510
|
+
overflows: w
|
|
511
|
+
}], !w.every((e) => e <= 0)) {
|
|
512
|
+
let e = (i.flip?.index || 0) + 1, t = S[e];
|
|
513
|
+
if (t && (!(u === "alignment" && _ !== getSideAxis(t)) || T.every((e) => getSideAxis(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
|
|
514
|
+
data: {
|
|
515
|
+
index: e,
|
|
516
|
+
overflows: T
|
|
517
|
+
},
|
|
518
|
+
reset: { placement: t }
|
|
519
|
+
};
|
|
520
|
+
let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
|
|
521
|
+
if (!n) switch (f) {
|
|
522
|
+
case "bestFit": {
|
|
523
|
+
let e = T.filter((e) => {
|
|
524
|
+
if (x) {
|
|
525
|
+
let t = getSideAxis(e.placement);
|
|
526
|
+
return t === _ || t === "y";
|
|
527
|
+
}
|
|
528
|
+
return !0;
|
|
529
|
+
}).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
|
|
530
|
+
e && (n = e);
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
533
|
+
case "initialPlacement":
|
|
534
|
+
n = o;
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
if (r !== n) return { reset: { placement: n } };
|
|
538
|
+
}
|
|
539
|
+
return {};
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
}, "flip");
|
|
543
|
+
function getSideOffsets(e, t) {
|
|
544
|
+
return {
|
|
545
|
+
top: e.top - t.height,
|
|
546
|
+
right: e.right - t.width,
|
|
547
|
+
bottom: e.bottom - t.height,
|
|
548
|
+
left: e.left - t.width
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function isAnySideFullyClipped(e) {
|
|
552
|
+
return c.some((t) => e[t] >= 0);
|
|
553
|
+
}
|
|
554
|
+
var A = /* @__PURE__ */ e(function(e) {
|
|
555
|
+
return e === void 0 && (e = {}), {
|
|
556
|
+
name: "hide",
|
|
557
|
+
options: e,
|
|
558
|
+
async fn(t) {
|
|
559
|
+
let { rects: n, platform: r } = t, { strategy: i = "referenceHidden", ...a } = evaluate(e, t);
|
|
560
|
+
switch (i) {
|
|
561
|
+
case "referenceHidden": {
|
|
562
|
+
let e = getSideOffsets(await r.detectOverflow(t, {
|
|
563
|
+
...a,
|
|
564
|
+
elementContext: "reference"
|
|
565
|
+
}), n.reference);
|
|
566
|
+
return { data: {
|
|
567
|
+
referenceHiddenOffsets: e,
|
|
568
|
+
referenceHidden: isAnySideFullyClipped(e)
|
|
569
|
+
} };
|
|
570
|
+
}
|
|
571
|
+
case "escaped": {
|
|
572
|
+
let e = getSideOffsets(await r.detectOverflow(t, {
|
|
573
|
+
...a,
|
|
574
|
+
altBoundary: !0
|
|
575
|
+
}), n.floating);
|
|
576
|
+
return { data: {
|
|
577
|
+
escapedOffsets: e,
|
|
578
|
+
escaped: isAnySideFullyClipped(e)
|
|
579
|
+
} };
|
|
580
|
+
}
|
|
581
|
+
default: return {};
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
}, "hide");
|
|
586
|
+
function getBoundingRect(e) {
|
|
587
|
+
let t = d(...e.map((e) => e.left)), n = d(...e.map((e) => e.top)), r = f(...e.map((e) => e.right)), i = f(...e.map((e) => e.bottom));
|
|
588
|
+
return {
|
|
589
|
+
x: t,
|
|
590
|
+
y: n,
|
|
591
|
+
width: r - t,
|
|
592
|
+
height: i - n
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
function getRectsByLine(e) {
|
|
596
|
+
let t = e.slice().sort((e, t) => e.y - t.y), n = [], r = null;
|
|
597
|
+
for (let e = 0; e < t.length; e++) {
|
|
598
|
+
let i = t[e];
|
|
599
|
+
!r || i.y - r.y > r.height / 2 ? n.push([i]) : n[n.length - 1].push(i), r = i;
|
|
600
|
+
}
|
|
601
|
+
return n.map((e) => rectToClientRect(getBoundingRect(e)));
|
|
602
|
+
}
|
|
603
|
+
var j = /* @__PURE__ */ e(function(e) {
|
|
604
|
+
return e === void 0 && (e = {}), {
|
|
605
|
+
name: "inline",
|
|
606
|
+
options: e,
|
|
607
|
+
async fn(t) {
|
|
608
|
+
let { placement: n, elements: r, rects: i, platform: a, strategy: o } = t, { padding: s = 2, x: c, y: l } = evaluate(e, t), u = Array.from(await (a.getClientRects == null ? void 0 : a.getClientRects(r.reference)) || []), p = getRectsByLine(u), m = rectToClientRect(getBoundingRect(u)), h = getPaddingObject(s);
|
|
609
|
+
function getBoundingClientRect() {
|
|
610
|
+
if (p.length === 2 && p[0].left > p[1].right && c != null && l != null) return p.find((e) => c > e.left - h.left && c < e.right + h.right && l > e.top - h.top && l < e.bottom + h.bottom) || m;
|
|
611
|
+
if (p.length >= 2) {
|
|
612
|
+
if (getSideAxis(n) === "y") {
|
|
613
|
+
let e = p[0], t = p[p.length - 1], r = getSide(n) === "top", i = e.top, a = t.bottom, o = r ? e.left : t.left, s = r ? e.right : t.right;
|
|
614
|
+
return {
|
|
615
|
+
top: i,
|
|
616
|
+
bottom: a,
|
|
617
|
+
left: o,
|
|
618
|
+
right: s,
|
|
619
|
+
width: s - o,
|
|
620
|
+
height: a - i,
|
|
621
|
+
x: o,
|
|
622
|
+
y: i
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
let e = getSide(n) === "left", t = f(...p.map((e) => e.right)), r = d(...p.map((e) => e.left)), i = p.filter((n) => e ? n.left === r : n.right === t), a = i[0].top, o = i[i.length - 1].bottom, s = r, c = t;
|
|
626
|
+
return {
|
|
627
|
+
top: a,
|
|
628
|
+
bottom: o,
|
|
629
|
+
left: s,
|
|
630
|
+
right: c,
|
|
631
|
+
width: c - s,
|
|
632
|
+
height: o - a,
|
|
633
|
+
x: s,
|
|
634
|
+
y: a
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
return m;
|
|
638
|
+
}
|
|
639
|
+
let g = await a.getElementRects({
|
|
640
|
+
reference: { getBoundingClientRect },
|
|
641
|
+
floating: r.floating,
|
|
642
|
+
strategy: o
|
|
643
|
+
});
|
|
644
|
+
return i.reference.x !== g.reference.x || i.reference.y !== g.reference.y || i.reference.width !== g.reference.width || i.reference.height !== g.reference.height ? { reset: { rects: g } } : {};
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
}, "inline"), M = /* @__PURE__ */ new Set(["left", "top"]);
|
|
648
|
+
async function convertValueToCoords(e, t) {
|
|
649
|
+
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = getSide(n), s = getAlignment(n), c = getSideAxis(n) === "y", l = M.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = evaluate(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
|
|
650
|
+
mainAxis: d,
|
|
651
|
+
crossAxis: 0,
|
|
652
|
+
alignmentAxis: null
|
|
653
|
+
} : {
|
|
654
|
+
mainAxis: d.mainAxis || 0,
|
|
655
|
+
crossAxis: d.crossAxis || 0,
|
|
656
|
+
alignmentAxis: d.alignmentAxis
|
|
657
|
+
};
|
|
658
|
+
return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
|
|
659
|
+
x: p * u,
|
|
660
|
+
y: f * l
|
|
661
|
+
} : {
|
|
662
|
+
x: f * l,
|
|
663
|
+
y: p * u
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
var N = /* @__PURE__ */ e(function(e) {
|
|
667
|
+
return e === void 0 && (e = 0), {
|
|
668
|
+
name: "offset",
|
|
669
|
+
options: e,
|
|
670
|
+
async fn(t) {
|
|
671
|
+
var n;
|
|
672
|
+
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await convertValueToCoords(t, e);
|
|
673
|
+
return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
|
|
674
|
+
x: r + s.x,
|
|
675
|
+
y: i + s.y,
|
|
676
|
+
data: {
|
|
677
|
+
...s,
|
|
678
|
+
placement: a
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
}, "offset"), P = /* @__PURE__ */ e(function(e) {
|
|
684
|
+
return e === void 0 && (e = {}), {
|
|
685
|
+
name: "shift",
|
|
686
|
+
options: e,
|
|
687
|
+
async fn(t) {
|
|
688
|
+
let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
|
|
689
|
+
let { x: t, y: n } = e;
|
|
690
|
+
return {
|
|
691
|
+
x: t,
|
|
692
|
+
y: n
|
|
693
|
+
};
|
|
694
|
+
} }, ...l } = evaluate(e, t), u = {
|
|
695
|
+
x: n,
|
|
696
|
+
y: r
|
|
697
|
+
}, d = await a.detectOverflow(t, l), f = getSideAxis(getSide(i)), p = getOppositeAxis(f), m = u[p], h = u[f];
|
|
698
|
+
if (o) {
|
|
699
|
+
let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
|
|
700
|
+
m = clamp(n, m, r);
|
|
701
|
+
}
|
|
702
|
+
if (s) {
|
|
703
|
+
let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
|
|
704
|
+
h = clamp(n, h, r);
|
|
705
|
+
}
|
|
706
|
+
let g = c.fn({
|
|
707
|
+
...t,
|
|
708
|
+
[p]: m,
|
|
709
|
+
[f]: h
|
|
710
|
+
});
|
|
711
|
+
return {
|
|
712
|
+
...g,
|
|
713
|
+
data: {
|
|
714
|
+
x: g.x - n,
|
|
715
|
+
y: g.y - r,
|
|
716
|
+
enabled: {
|
|
717
|
+
[p]: o,
|
|
718
|
+
[f]: s
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
}, "shift"), F = /* @__PURE__ */ e(function(e) {
|
|
725
|
+
return e === void 0 && (e = {}), {
|
|
726
|
+
options: e,
|
|
727
|
+
fn(t) {
|
|
728
|
+
let { x: n, y: r, placement: i, rects: a, middlewareData: o } = t, { offset: s = 0, mainAxis: c = !0, crossAxis: l = !0 } = evaluate(e, t), u = {
|
|
729
|
+
x: n,
|
|
730
|
+
y: r
|
|
731
|
+
}, d = getSideAxis(i), f = getOppositeAxis(d), p = u[f], m = u[d], h = evaluate(s, t), g = typeof h == "number" ? {
|
|
732
|
+
mainAxis: h,
|
|
733
|
+
crossAxis: 0
|
|
734
|
+
} : {
|
|
735
|
+
mainAxis: 0,
|
|
736
|
+
crossAxis: 0,
|
|
737
|
+
...h
|
|
738
|
+
};
|
|
739
|
+
if (c) {
|
|
740
|
+
let e = f === "y" ? "height" : "width", t = a.reference[f] - a.floating[e] + g.mainAxis, n = a.reference[f] + a.reference[e] - g.mainAxis;
|
|
741
|
+
p < t ? p = t : p > n && (p = n);
|
|
742
|
+
}
|
|
743
|
+
if (l) {
|
|
744
|
+
let e = f === "y" ? "width" : "height", t = M.has(getSide(i)), n = a.reference[d] - a.floating[e] + (t && o.offset?.[d] || 0) + (t ? 0 : g.crossAxis), r = a.reference[d] + a.reference[e] + (t ? 0 : o.offset?.[d] || 0) - (t ? g.crossAxis : 0);
|
|
745
|
+
m < n ? m = n : m > r && (m = r);
|
|
746
|
+
}
|
|
747
|
+
return {
|
|
748
|
+
[f]: p,
|
|
749
|
+
[d]: m
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
}, "limitShift"), ee = /* @__PURE__ */ e(function(e) {
|
|
754
|
+
return e === void 0 && (e = {}), {
|
|
755
|
+
name: "size",
|
|
756
|
+
options: e,
|
|
757
|
+
async fn(t) {
|
|
758
|
+
var n, r;
|
|
759
|
+
let { placement: i, rects: a, platform: o, elements: s } = t, { apply = () => {}, ...c } = evaluate(e, t), l = await o.detectOverflow(t, c), u = getSide(i), p = getAlignment(i), m = getSideAxis(i) === "y", { width: h, height: g } = a.floating, _, v;
|
|
760
|
+
u === "top" || u === "bottom" ? (_ = u, v = p === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (v = u, _ = p === "end" ? "top" : "bottom");
|
|
761
|
+
let y = g - l.top - l.bottom, b = h - l.left - l.right, x = d(g - l[_], y), S = d(h - l[v], b), C = !t.middlewareData.shift, w = x, T = S;
|
|
762
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (T = b), (r = t.middlewareData.shift) != null && r.enabled.y && (w = y), C && !p) {
|
|
763
|
+
let e = f(l.left, 0), t = f(l.right, 0), n = f(l.top, 0), r = f(l.bottom, 0);
|
|
764
|
+
m ? T = h - 2 * (e !== 0 || t !== 0 ? e + t : f(l.left, l.right)) : w = g - 2 * (n !== 0 || r !== 0 ? n + r : f(l.top, l.bottom));
|
|
765
|
+
}
|
|
766
|
+
await apply({
|
|
767
|
+
...t,
|
|
768
|
+
availableWidth: T,
|
|
769
|
+
availableHeight: w
|
|
770
|
+
});
|
|
771
|
+
let E = await o.getDimensions(s.floating);
|
|
772
|
+
return h !== E.width || g !== E.height ? { reset: { rects: !0 } } : {};
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
}, "size");
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region ../../node_modules/.pnpm/@floating-ui+dom@1.7.6/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
778
|
+
function getCssDimensions(e) {
|
|
779
|
+
let t = getComputedStyle$1(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = isHTMLElement(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = p(n) !== a || p(r) !== o;
|
|
780
|
+
return s && (n = a, r = o), {
|
|
781
|
+
width: n,
|
|
782
|
+
height: r,
|
|
783
|
+
$: s
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
function unwrapElement(e) {
|
|
787
|
+
return isElement(e) ? e : e.contextElement;
|
|
788
|
+
}
|
|
789
|
+
function getScale(e) {
|
|
790
|
+
let t = unwrapElement(e);
|
|
791
|
+
if (!isHTMLElement(t)) return createCoords(1);
|
|
792
|
+
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = getCssDimensions(t), o = (a ? p(n.width) : n.width) / r, s = (a ? p(n.height) : n.height) / i;
|
|
793
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
794
|
+
x: o,
|
|
795
|
+
y: s
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
var te = /* @__PURE__ */ createCoords(0);
|
|
799
|
+
function getVisualOffsets(e) {
|
|
800
|
+
let t = getWindow(e);
|
|
801
|
+
return !isWebKit() || !t.visualViewport ? te : {
|
|
802
|
+
x: t.visualViewport.offsetLeft,
|
|
803
|
+
y: t.visualViewport.offsetTop
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
function shouldAddVisualOffsets(e, t, n) {
|
|
807
|
+
return t === void 0 && (t = !1), !n || t && n !== getWindow(e) ? !1 : t;
|
|
808
|
+
}
|
|
809
|
+
function getBoundingClientRect(e, t, n, r) {
|
|
810
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
811
|
+
let i = e.getBoundingClientRect(), a = unwrapElement(e), o = createCoords(1);
|
|
812
|
+
t && (r ? isElement(r) && (o = getScale(r)) : o = getScale(e));
|
|
813
|
+
let s = shouldAddVisualOffsets(a, n, r) ? getVisualOffsets(a) : createCoords(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
|
|
814
|
+
if (a) {
|
|
815
|
+
let e = getWindow(a), t = r && isElement(r) ? getWindow(r) : r, n = e, i = getFrameElement(n);
|
|
816
|
+
for (; i && r && t !== n;) {
|
|
817
|
+
let e = getScale(i), t = i.getBoundingClientRect(), r = getComputedStyle$1(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
|
|
818
|
+
c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = getWindow(i), i = getFrameElement(n);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return rectToClientRect({
|
|
822
|
+
width: u,
|
|
823
|
+
height: d,
|
|
824
|
+
x: c,
|
|
825
|
+
y: l
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
function getWindowScrollBarX(e, t) {
|
|
829
|
+
let n = getNodeScroll(e).scrollLeft;
|
|
830
|
+
return t ? t.left + n : getBoundingClientRect(getDocumentElement(e)).left + n;
|
|
831
|
+
}
|
|
832
|
+
function getHTMLOffset(e, t) {
|
|
833
|
+
let n = e.getBoundingClientRect();
|
|
834
|
+
return {
|
|
835
|
+
x: n.left + t.scrollLeft - getWindowScrollBarX(e, n),
|
|
836
|
+
y: n.top + t.scrollTop
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(e) {
|
|
840
|
+
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = getDocumentElement(r), s = t ? isTopLayer(t.floating) : !1;
|
|
841
|
+
if (r === o || s && a) return n;
|
|
842
|
+
let c = {
|
|
843
|
+
scrollLeft: 0,
|
|
844
|
+
scrollTop: 0
|
|
845
|
+
}, l = createCoords(1), u = createCoords(0), d = isHTMLElement(r);
|
|
846
|
+
if ((d || !d && !a) && ((getNodeName(r) !== "body" || isOverflowElement(o)) && (c = getNodeScroll(r)), d)) {
|
|
847
|
+
let e = getBoundingClientRect(r);
|
|
848
|
+
l = getScale(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
|
|
849
|
+
}
|
|
850
|
+
let f = o && !d && !a ? getHTMLOffset(o, c) : createCoords(0);
|
|
851
|
+
return {
|
|
852
|
+
width: n.width * l.x,
|
|
853
|
+
height: n.height * l.y,
|
|
854
|
+
x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
|
|
855
|
+
y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
function getClientRects(e) {
|
|
859
|
+
return Array.from(e.getClientRects());
|
|
860
|
+
}
|
|
861
|
+
function getDocumentRect(e) {
|
|
862
|
+
let t = getDocumentElement(e), n = getNodeScroll(e), r = e.ownerDocument.body, i = f(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = f(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + getWindowScrollBarX(e), s = -n.scrollTop;
|
|
863
|
+
return getComputedStyle$1(r).direction === "rtl" && (o += f(t.clientWidth, r.clientWidth) - i), {
|
|
864
|
+
width: i,
|
|
865
|
+
height: a,
|
|
866
|
+
x: o,
|
|
867
|
+
y: s
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
var I = 25;
|
|
871
|
+
function getViewportRect(e, t) {
|
|
872
|
+
let n = getWindow(e), r = getDocumentElement(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
|
|
873
|
+
if (i) {
|
|
874
|
+
a = i.width, o = i.height;
|
|
875
|
+
let e = isWebKit();
|
|
876
|
+
(!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
|
|
877
|
+
}
|
|
878
|
+
let l = getWindowScrollBarX(r);
|
|
879
|
+
if (l <= 0) {
|
|
880
|
+
let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
|
|
881
|
+
o <= I && (a -= o);
|
|
882
|
+
} else l <= I && (a += l);
|
|
883
|
+
return {
|
|
884
|
+
width: a,
|
|
885
|
+
height: o,
|
|
886
|
+
x: s,
|
|
887
|
+
y: c
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
function getInnerBoundingClientRect(e, t) {
|
|
891
|
+
let n = getBoundingClientRect(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = isHTMLElement(e) ? getScale(e) : createCoords(1);
|
|
892
|
+
return {
|
|
893
|
+
width: e.clientWidth * a.x,
|
|
894
|
+
height: e.clientHeight * a.y,
|
|
895
|
+
x: i * a.x,
|
|
896
|
+
y: r * a.y
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
function getClientRectFromClippingAncestor(e, t, n) {
|
|
900
|
+
let r;
|
|
901
|
+
if (t === "viewport") r = getViewportRect(e, n);
|
|
902
|
+
else if (t === "document") r = getDocumentRect(getDocumentElement(e));
|
|
903
|
+
else if (isElement(t)) r = getInnerBoundingClientRect(t, n);
|
|
904
|
+
else {
|
|
905
|
+
let n = getVisualOffsets(e);
|
|
906
|
+
r = {
|
|
907
|
+
x: t.x - n.x,
|
|
908
|
+
y: t.y - n.y,
|
|
909
|
+
width: t.width,
|
|
910
|
+
height: t.height
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
return rectToClientRect(r);
|
|
914
|
+
}
|
|
915
|
+
function hasFixedPositionAncestor(e, t) {
|
|
916
|
+
let n = getParentNode(e);
|
|
917
|
+
return n === t || !isElement(n) || isLastTraversableNode(n) ? !1 : getComputedStyle$1(n).position === "fixed" || hasFixedPositionAncestor(n, t);
|
|
918
|
+
}
|
|
919
|
+
function getClippingElementAncestors(e, t) {
|
|
920
|
+
let n = t.get(e);
|
|
921
|
+
if (n) return n;
|
|
922
|
+
let r = getOverflowAncestors(e, [], !1).filter((e) => isElement(e) && getNodeName(e) !== "body"), i = null, a = getComputedStyle$1(e).position === "fixed", o = a ? getParentNode(e) : e;
|
|
923
|
+
for (; isElement(o) && !isLastTraversableNode(o);) {
|
|
924
|
+
let t = getComputedStyle$1(o), n = isContainingBlock(o);
|
|
925
|
+
!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || isOverflowElement(o) && !n && hasFixedPositionAncestor(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = getParentNode(o);
|
|
926
|
+
}
|
|
927
|
+
return t.set(e, r), r;
|
|
928
|
+
}
|
|
929
|
+
function getClippingRect(e) {
|
|
930
|
+
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? isTopLayer(t) ? [] : getClippingElementAncestors(t, this._c) : [].concat(n), r], o = getClientRectFromClippingAncestor(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
|
|
931
|
+
for (let e = 1; e < a.length; e++) {
|
|
932
|
+
let n = getClientRectFromClippingAncestor(t, a[e], i);
|
|
933
|
+
s = f(n.top, s), c = d(n.right, c), l = d(n.bottom, l), u = f(n.left, u);
|
|
934
|
+
}
|
|
935
|
+
return {
|
|
936
|
+
width: c - u,
|
|
937
|
+
height: l - s,
|
|
938
|
+
x: u,
|
|
939
|
+
y: s
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
function getDimensions(e) {
|
|
943
|
+
let { width: t, height: n } = getCssDimensions(e);
|
|
944
|
+
return {
|
|
945
|
+
width: t,
|
|
946
|
+
height: n
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
function getRectRelativeToOffsetParent(e, t, n) {
|
|
950
|
+
let r = isHTMLElement(t), i = getDocumentElement(t), a = n === "fixed", o = getBoundingClientRect(e, !0, a, t), s = {
|
|
951
|
+
scrollLeft: 0,
|
|
952
|
+
scrollTop: 0
|
|
953
|
+
}, c = createCoords(0);
|
|
954
|
+
function setLeftRTLScrollbarOffset() {
|
|
955
|
+
c.x = getWindowScrollBarX(i);
|
|
956
|
+
}
|
|
957
|
+
if (r || !r && !a) if ((getNodeName(t) !== "body" || isOverflowElement(i)) && (s = getNodeScroll(t)), r) {
|
|
958
|
+
let e = getBoundingClientRect(t, !0, a, t);
|
|
959
|
+
c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
|
|
960
|
+
} else i && setLeftRTLScrollbarOffset();
|
|
961
|
+
a && !r && i && setLeftRTLScrollbarOffset();
|
|
962
|
+
let l = i && !r && !a ? getHTMLOffset(i, s) : createCoords(0);
|
|
963
|
+
return {
|
|
964
|
+
x: o.left + s.scrollLeft - c.x - l.x,
|
|
965
|
+
y: o.top + s.scrollTop - c.y - l.y,
|
|
966
|
+
width: o.width,
|
|
967
|
+
height: o.height
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
function isStaticPositioned(e) {
|
|
971
|
+
return getComputedStyle$1(e).position === "static";
|
|
972
|
+
}
|
|
973
|
+
function getTrueOffsetParent(e, t) {
|
|
974
|
+
if (!isHTMLElement(e) || getComputedStyle$1(e).position === "fixed") return null;
|
|
975
|
+
if (t) return t(e);
|
|
976
|
+
let n = e.offsetParent;
|
|
977
|
+
return getDocumentElement(e) === n && (n = n.ownerDocument.body), n;
|
|
978
|
+
}
|
|
979
|
+
function getOffsetParent(e, t) {
|
|
980
|
+
let n = getWindow(e);
|
|
981
|
+
if (isTopLayer(e)) return n;
|
|
982
|
+
if (!isHTMLElement(e)) {
|
|
983
|
+
let t = getParentNode(e);
|
|
984
|
+
for (; t && !isLastTraversableNode(t);) {
|
|
985
|
+
if (isElement(t) && !isStaticPositioned(t)) return t;
|
|
986
|
+
t = getParentNode(t);
|
|
987
|
+
}
|
|
988
|
+
return n;
|
|
989
|
+
}
|
|
990
|
+
let r = getTrueOffsetParent(e, t);
|
|
991
|
+
for (; r && isTableElement(r) && isStaticPositioned(r);) r = getTrueOffsetParent(r, t);
|
|
992
|
+
return r && isLastTraversableNode(r) && isStaticPositioned(r) && !isContainingBlock(r) ? n : r || getContainingBlock(e) || n;
|
|
993
|
+
}
|
|
994
|
+
var getElementRects = async function(e) {
|
|
995
|
+
let t = this.getOffsetParent || getOffsetParent, n = this.getDimensions, r = await n(e.floating);
|
|
996
|
+
return {
|
|
997
|
+
reference: getRectRelativeToOffsetParent(e.reference, await t(e.floating), e.strategy),
|
|
998
|
+
floating: {
|
|
999
|
+
x: 0,
|
|
1000
|
+
y: 0,
|
|
1001
|
+
width: r.width,
|
|
1002
|
+
height: r.height
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
};
|
|
1006
|
+
function isRTL(e) {
|
|
1007
|
+
return getComputedStyle$1(e).direction === "rtl";
|
|
1008
|
+
}
|
|
1009
|
+
var ne = {
|
|
1010
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1011
|
+
getDocumentElement,
|
|
1012
|
+
getClippingRect,
|
|
1013
|
+
getOffsetParent,
|
|
1014
|
+
getElementRects,
|
|
1015
|
+
getClientRects,
|
|
1016
|
+
getDimensions,
|
|
1017
|
+
getScale,
|
|
1018
|
+
isElement,
|
|
1019
|
+
isRTL
|
|
1020
|
+
};
|
|
1021
|
+
function rectsAreEqual(e, t) {
|
|
1022
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1023
|
+
}
|
|
1024
|
+
function observeMove(e, t) {
|
|
1025
|
+
let n = null, r, i = getDocumentElement(e);
|
|
1026
|
+
function cleanup() {
|
|
1027
|
+
var e;
|
|
1028
|
+
clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
|
|
1029
|
+
}
|
|
1030
|
+
function refresh(a, o) {
|
|
1031
|
+
a === void 0 && (a = !1), o === void 0 && (o = 1), cleanup();
|
|
1032
|
+
let s = e.getBoundingClientRect(), { left: c, top: l, width: u, height: p } = s;
|
|
1033
|
+
if (a || t(), !u || !p) return;
|
|
1034
|
+
let h = m(l), g = m(i.clientWidth - (c + u)), _ = m(i.clientHeight - (l + p)), v = m(c), y = {
|
|
1035
|
+
rootMargin: -h + "px " + -g + "px " + -_ + "px " + -v + "px",
|
|
1036
|
+
threshold: f(0, d(1, o)) || 1
|
|
1037
|
+
}, b = !0;
|
|
1038
|
+
function handleObserve(t) {
|
|
1039
|
+
let n = t[0].intersectionRatio;
|
|
1040
|
+
if (n !== o) {
|
|
1041
|
+
if (!b) return refresh();
|
|
1042
|
+
n ? refresh(!1, n) : r = setTimeout(() => {
|
|
1043
|
+
refresh(!1, 1e-7);
|
|
1044
|
+
}, 1e3);
|
|
1045
|
+
}
|
|
1046
|
+
n === 1 && !rectsAreEqual(s, e.getBoundingClientRect()) && refresh(), b = !1;
|
|
1047
|
+
}
|
|
1048
|
+
try {
|
|
1049
|
+
n = new IntersectionObserver(handleObserve, {
|
|
1050
|
+
...y,
|
|
1051
|
+
root: i.ownerDocument
|
|
1052
|
+
});
|
|
1053
|
+
} catch {
|
|
1054
|
+
n = new IntersectionObserver(handleObserve, y);
|
|
1055
|
+
}
|
|
1056
|
+
n.observe(e);
|
|
1057
|
+
}
|
|
1058
|
+
return refresh(!0), cleanup;
|
|
1059
|
+
}
|
|
1060
|
+
function autoUpdate(e, t, n, r) {
|
|
1061
|
+
r === void 0 && (r = {});
|
|
1062
|
+
let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = unwrapElement(e), u = i || a ? [...l ? getOverflowAncestors(l) : [], ...t ? getOverflowAncestors(t) : []] : [];
|
|
1063
|
+
u.forEach((e) => {
|
|
1064
|
+
i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
|
|
1065
|
+
});
|
|
1066
|
+
let d = l && s ? observeMove(l, n) : null, f = -1, p = null;
|
|
1067
|
+
o && (p = new ResizeObserver((e) => {
|
|
1068
|
+
let [r] = e;
|
|
1069
|
+
r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
1070
|
+
var e;
|
|
1071
|
+
(e = p) == null || e.observe(t);
|
|
1072
|
+
})), n();
|
|
1073
|
+
}), l && !c && p.observe(l), t && p.observe(t));
|
|
1074
|
+
let m, h = c ? getBoundingClientRect(e) : null;
|
|
1075
|
+
c && frameLoop();
|
|
1076
|
+
function frameLoop() {
|
|
1077
|
+
let t = getBoundingClientRect(e);
|
|
1078
|
+
h && !rectsAreEqual(h, t) && n(), h = t, m = requestAnimationFrame(frameLoop);
|
|
1079
|
+
}
|
|
1080
|
+
return n(), () => {
|
|
1081
|
+
var e;
|
|
1082
|
+
u.forEach((e) => {
|
|
1083
|
+
i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
|
|
1084
|
+
}), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
var L = N, R = O, z = P, B = k, V = ee, H = A, U = D, re = j, ie = F, computePosition = (e, t, n) => {
|
|
1088
|
+
let r = /* @__PURE__ */ new Map(), i = {
|
|
1089
|
+
platform: ne,
|
|
1090
|
+
...n
|
|
1091
|
+
}, a = {
|
|
1092
|
+
...i.platform,
|
|
1093
|
+
_c: r
|
|
1094
|
+
};
|
|
1095
|
+
return E(e, t, {
|
|
1096
|
+
...i,
|
|
1097
|
+
platform: a
|
|
1098
|
+
});
|
|
1099
|
+
}, W = typeof document < "u" ? n : function noop() {};
|
|
1100
|
+
function deepEqual(e, t) {
|
|
1101
|
+
if (e === t) return !0;
|
|
1102
|
+
if (typeof e != typeof t) return !1;
|
|
1103
|
+
if (typeof e == "function" && e.toString() === t.toString()) return !0;
|
|
1104
|
+
let n, r, i;
|
|
1105
|
+
if (e && t && typeof e == "object") {
|
|
1106
|
+
if (Array.isArray(e)) {
|
|
1107
|
+
if (n = e.length, n !== t.length) return !1;
|
|
1108
|
+
for (r = n; r-- !== 0;) if (!deepEqual(e[r], t[r])) return !1;
|
|
1109
|
+
return !0;
|
|
1110
|
+
}
|
|
1111
|
+
if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
|
|
1112
|
+
for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
|
|
1113
|
+
for (r = n; r-- !== 0;) {
|
|
1114
|
+
let n = i[r];
|
|
1115
|
+
if (!(n === "_owner" && e.$$typeof) && !deepEqual(e[n], t[n])) return !1;
|
|
1116
|
+
}
|
|
1117
|
+
return !0;
|
|
1118
|
+
}
|
|
1119
|
+
return e !== e && t !== t;
|
|
1120
|
+
}
|
|
1121
|
+
function getDPR(e) {
|
|
1122
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1123
|
+
}
|
|
1124
|
+
function roundByDPR(e, t) {
|
|
1125
|
+
let n = getDPR(e);
|
|
1126
|
+
return Math.round(t * n) / n;
|
|
1127
|
+
}
|
|
1128
|
+
function useLatestRef(e) {
|
|
1129
|
+
let n = t.useRef(e);
|
|
1130
|
+
return W(() => {
|
|
1131
|
+
n.current = e;
|
|
1132
|
+
}), n;
|
|
1133
|
+
}
|
|
1134
|
+
function useFloating$1(e) {
|
|
1135
|
+
e === void 0 && (e = {});
|
|
1136
|
+
let { placement: n = "bottom", strategy: r = "absolute", middleware: a = [], platform: o, elements: { reference: s, floating: c } = {}, transform: l = !0, whileElementsMounted: u, open: d } = e, [f, p] = t.useState({
|
|
1137
|
+
x: 0,
|
|
1138
|
+
y: 0,
|
|
1139
|
+
strategy: r,
|
|
1140
|
+
placement: n,
|
|
1141
|
+
middlewareData: {},
|
|
1142
|
+
isPositioned: !1
|
|
1143
|
+
}), [m, h] = t.useState(a);
|
|
1144
|
+
deepEqual(m, a) || h(a);
|
|
1145
|
+
let [g, _] = t.useState(null), [v, y] = t.useState(null), b = t.useCallback((e) => {
|
|
1146
|
+
e !== w.current && (w.current = e, _(e));
|
|
1147
|
+
}, []), x = t.useCallback((e) => {
|
|
1148
|
+
e !== T.current && (T.current = e, y(e));
|
|
1149
|
+
}, []), S = s || g, C = c || v, w = t.useRef(null), T = t.useRef(null), E = t.useRef(f), D = u != null, O = useLatestRef(u), k = useLatestRef(o), A = useLatestRef(d), j = t.useCallback(() => {
|
|
1150
|
+
if (!w.current || !T.current) return;
|
|
1151
|
+
let e = {
|
|
1152
|
+
placement: n,
|
|
1153
|
+
strategy: r,
|
|
1154
|
+
middleware: m
|
|
1155
|
+
};
|
|
1156
|
+
k.current && (e.platform = k.current), computePosition(w.current, T.current, e).then((e) => {
|
|
1157
|
+
let t = {
|
|
1158
|
+
...e,
|
|
1159
|
+
isPositioned: A.current !== !1
|
|
1160
|
+
};
|
|
1161
|
+
M.current && !deepEqual(E.current, t) && (E.current = t, i.flushSync(() => {
|
|
1162
|
+
p(t);
|
|
1163
|
+
}));
|
|
1164
|
+
});
|
|
1165
|
+
}, [
|
|
1166
|
+
m,
|
|
1167
|
+
n,
|
|
1168
|
+
r,
|
|
1169
|
+
k,
|
|
1170
|
+
A
|
|
1171
|
+
]);
|
|
1172
|
+
W(() => {
|
|
1173
|
+
d === !1 && E.current.isPositioned && (E.current.isPositioned = !1, p((e) => ({
|
|
1174
|
+
...e,
|
|
1175
|
+
isPositioned: !1
|
|
1176
|
+
})));
|
|
1177
|
+
}, [d]);
|
|
1178
|
+
let M = t.useRef(!1);
|
|
1179
|
+
W(() => (M.current = !0, () => {
|
|
1180
|
+
M.current = !1;
|
|
1181
|
+
}), []), W(() => {
|
|
1182
|
+
if (S && (w.current = S), C && (T.current = C), S && C) {
|
|
1183
|
+
if (O.current) return O.current(S, C, j);
|
|
1184
|
+
j();
|
|
1185
|
+
}
|
|
1186
|
+
}, [
|
|
1187
|
+
S,
|
|
1188
|
+
C,
|
|
1189
|
+
j,
|
|
1190
|
+
O,
|
|
1191
|
+
D
|
|
1192
|
+
]);
|
|
1193
|
+
let N = t.useMemo(() => ({
|
|
1194
|
+
reference: w,
|
|
1195
|
+
floating: T,
|
|
1196
|
+
setReference: b,
|
|
1197
|
+
setFloating: x
|
|
1198
|
+
}), [b, x]), P = t.useMemo(() => ({
|
|
1199
|
+
reference: S,
|
|
1200
|
+
floating: C
|
|
1201
|
+
}), [S, C]), F = t.useMemo(() => {
|
|
1202
|
+
let e = {
|
|
1203
|
+
position: r,
|
|
1204
|
+
left: 0,
|
|
1205
|
+
top: 0
|
|
1206
|
+
};
|
|
1207
|
+
if (!P.floating) return e;
|
|
1208
|
+
let t = roundByDPR(P.floating, f.x), n = roundByDPR(P.floating, f.y);
|
|
1209
|
+
return l ? {
|
|
1210
|
+
...e,
|
|
1211
|
+
transform: "translate(" + t + "px, " + n + "px)",
|
|
1212
|
+
...getDPR(P.floating) >= 1.5 && { willChange: "transform" }
|
|
1213
|
+
} : {
|
|
1214
|
+
position: r,
|
|
1215
|
+
left: t,
|
|
1216
|
+
top: n
|
|
1217
|
+
};
|
|
1218
|
+
}, [
|
|
1219
|
+
r,
|
|
1220
|
+
l,
|
|
1221
|
+
P.floating,
|
|
1222
|
+
f.x,
|
|
1223
|
+
f.y
|
|
1224
|
+
]);
|
|
1225
|
+
return t.useMemo(() => ({
|
|
1226
|
+
...f,
|
|
1227
|
+
update: j,
|
|
1228
|
+
refs: N,
|
|
1229
|
+
elements: P,
|
|
1230
|
+
floatingStyles: F
|
|
1231
|
+
}), [
|
|
1232
|
+
f,
|
|
1233
|
+
j,
|
|
1234
|
+
N,
|
|
1235
|
+
P,
|
|
1236
|
+
F
|
|
1237
|
+
]);
|
|
1238
|
+
}
|
|
1239
|
+
e(useFloating$1, "useFloating");
|
|
1240
|
+
var arrow$1 = (e) => {
|
|
1241
|
+
function isRef(e) {
|
|
1242
|
+
return {}.hasOwnProperty.call(e, "current");
|
|
1243
|
+
}
|
|
1244
|
+
return {
|
|
1245
|
+
name: "arrow",
|
|
1246
|
+
options: e,
|
|
1247
|
+
fn(t) {
|
|
1248
|
+
let { element: n, padding: r } = typeof e == "function" ? e(t) : e;
|
|
1249
|
+
return n && isRef(n) ? n.current == null ? {} : U({
|
|
1250
|
+
element: n.current,
|
|
1251
|
+
padding: r
|
|
1252
|
+
}).fn(t) : n ? U({
|
|
1253
|
+
element: n,
|
|
1254
|
+
padding: r
|
|
1255
|
+
}).fn(t) : {};
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
}, offset = (e, t) => {
|
|
1259
|
+
let n = L(e);
|
|
1260
|
+
return {
|
|
1261
|
+
name: n.name,
|
|
1262
|
+
fn: n.fn,
|
|
1263
|
+
options: [e, t]
|
|
1264
|
+
};
|
|
1265
|
+
}, shift = (e, t) => {
|
|
1266
|
+
let n = z(e);
|
|
1267
|
+
return {
|
|
1268
|
+
name: n.name,
|
|
1269
|
+
fn: n.fn,
|
|
1270
|
+
options: [e, t]
|
|
1271
|
+
};
|
|
1272
|
+
}, limitShift = (e, t) => ({
|
|
1273
|
+
fn: ie(e).fn,
|
|
1274
|
+
options: [e, t]
|
|
1275
|
+
}), flip = (e, t) => {
|
|
1276
|
+
let n = B(e);
|
|
1277
|
+
return {
|
|
1278
|
+
name: n.name,
|
|
1279
|
+
fn: n.fn,
|
|
1280
|
+
options: [e, t]
|
|
1281
|
+
};
|
|
1282
|
+
}, size = (e, t) => {
|
|
1283
|
+
let n = V(e);
|
|
1284
|
+
return {
|
|
1285
|
+
name: n.name,
|
|
1286
|
+
fn: n.fn,
|
|
1287
|
+
options: [e, t]
|
|
1288
|
+
};
|
|
1289
|
+
}, hide = (e, t) => {
|
|
1290
|
+
let n = H(e);
|
|
1291
|
+
return {
|
|
1292
|
+
name: n.name,
|
|
1293
|
+
fn: n.fn,
|
|
1294
|
+
options: [e, t]
|
|
1295
|
+
};
|
|
1296
|
+
}, inline = (e, t) => {
|
|
1297
|
+
let n = re(e);
|
|
1298
|
+
return {
|
|
1299
|
+
name: n.name,
|
|
1300
|
+
fn: n.fn,
|
|
1301
|
+
options: [e, t]
|
|
1302
|
+
};
|
|
1303
|
+
}, arrow = (e, t) => {
|
|
1304
|
+
let n = arrow$1(e);
|
|
1305
|
+
return {
|
|
1306
|
+
name: n.name,
|
|
1307
|
+
fn: n.fn,
|
|
1308
|
+
options: [e, t]
|
|
1309
|
+
};
|
|
1310
|
+
};
|
|
1311
|
+
//#endregion
|
|
1312
|
+
//#region ../../node_modules/.pnpm/@floating-ui+react@0.27.19_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
1313
|
+
function useMergeRefs(e) {
|
|
1314
|
+
let n = t.useRef(void 0), r = t.useCallback((t) => {
|
|
1315
|
+
let n = e.map((e) => {
|
|
1316
|
+
if (e != null) {
|
|
1317
|
+
if (typeof e == "function") {
|
|
1318
|
+
let n = e, r = n(t);
|
|
1319
|
+
return typeof r == "function" ? r : () => {
|
|
1320
|
+
n(null);
|
|
1321
|
+
};
|
|
1322
|
+
}
|
|
1323
|
+
return e.current = t, () => {
|
|
1324
|
+
e.current = null;
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1328
|
+
return () => {
|
|
1329
|
+
n.forEach((e) => e?.());
|
|
1330
|
+
};
|
|
1331
|
+
}, e);
|
|
1332
|
+
return t.useMemo(() => e.every((e) => e == null) ? null : (e) => {
|
|
1333
|
+
n.current &&= (n.current(), void 0), e != null && (n.current = r(e));
|
|
1334
|
+
}, e);
|
|
1335
|
+
}
|
|
1336
|
+
var G = "data-floating-ui-focusable", K = "active", q = "selected", J = "ArrowLeft", ae = "ArrowRight", oe = "ArrowUp", se = "ArrowDown", ce = [J, ae], le = [oe, se];
|
|
1337
|
+
[...ce, ...le];
|
|
1338
|
+
var ue = { ...t }, Y = !1, de = 0, genId = () => "floating-ui-" + Math.random().toString(36).slice(2, 6) + de++;
|
|
1339
|
+
function useFloatingId() {
|
|
1340
|
+
let [e, n] = t.useState(() => Y ? genId() : void 0);
|
|
1341
|
+
return S(() => {
|
|
1342
|
+
e ?? n(genId());
|
|
1343
|
+
}, []), t.useEffect(() => {
|
|
1344
|
+
Y = !0;
|
|
1345
|
+
}, []), e;
|
|
1346
|
+
}
|
|
1347
|
+
var X = ue.useId || useFloatingId;
|
|
1348
|
+
function createEventEmitter() {
|
|
1349
|
+
let e = /* @__PURE__ */ new Map();
|
|
1350
|
+
return {
|
|
1351
|
+
emit(t, n) {
|
|
1352
|
+
var r;
|
|
1353
|
+
(r = e.get(t)) == null || r.forEach((e) => e(n));
|
|
1354
|
+
},
|
|
1355
|
+
on(t, n) {
|
|
1356
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
1357
|
+
},
|
|
1358
|
+
off(t, n) {
|
|
1359
|
+
var r;
|
|
1360
|
+
(r = e.get(t)) == null || r.delete(n);
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
var Z = /* @__PURE__ */ t.createContext(null), fe = /* @__PURE__ */ t.createContext(null), useFloatingParentNodeId = () => t.useContext(Z)?.id || null, useFloatingTree = () => t.useContext(fe);
|
|
1365
|
+
function createAttribute(e) {
|
|
1366
|
+
return "data-floating-ui-" + e;
|
|
1367
|
+
}
|
|
1368
|
+
function clearTimeoutIfSet(e) {
|
|
1369
|
+
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
1370
|
+
}
|
|
1371
|
+
var Q = /* @__PURE__ */ createAttribute("safe-polygon");
|
|
1372
|
+
function getDelay(e, t, n) {
|
|
1373
|
+
if (n && !isMouseLikePointerType(n)) return 0;
|
|
1374
|
+
if (typeof e == "number") return e;
|
|
1375
|
+
if (typeof e == "function") {
|
|
1376
|
+
let n = e();
|
|
1377
|
+
return typeof n == "number" ? n : n?.[t];
|
|
1378
|
+
}
|
|
1379
|
+
return e?.[t];
|
|
1380
|
+
}
|
|
1381
|
+
function getRestMs(e) {
|
|
1382
|
+
return typeof e == "function" ? e() : e;
|
|
1383
|
+
}
|
|
1384
|
+
function useHover(e, n) {
|
|
1385
|
+
n === void 0 && (n = {});
|
|
1386
|
+
let { open: r, onOpenChange: i, dataRef: a, events: o, elements: s } = e, { enabled: c = !0, delay: l = 0, handleClose: u = null, mouseOnly: d = !1, restMs: f = 0, move: p = !0 } = n, m = useFloatingTree(), h = useFloatingParentNodeId(), g = useLatestRef$1(u), _ = useLatestRef$1(l), v = useLatestRef$1(r), y = useLatestRef$1(f), b = t.useRef(), x = t.useRef(-1), C = t.useRef(), w = t.useRef(-1), T = t.useRef(!0), E = t.useRef(!1), D = t.useRef(() => {}), O = t.useRef(!1), k = useEffectEvent$1(() => {
|
|
1387
|
+
let e = a.current.openEvent?.type;
|
|
1388
|
+
return e?.includes("mouse") && e !== "mousedown";
|
|
1389
|
+
});
|
|
1390
|
+
t.useEffect(() => {
|
|
1391
|
+
if (!c) return;
|
|
1392
|
+
function onOpenChange(e) {
|
|
1393
|
+
let { open: t } = e;
|
|
1394
|
+
t || (clearTimeoutIfSet(x), clearTimeoutIfSet(w), T.current = !0, O.current = !1);
|
|
1395
|
+
}
|
|
1396
|
+
return o.on("openchange", onOpenChange), () => {
|
|
1397
|
+
o.off("openchange", onOpenChange);
|
|
1398
|
+
};
|
|
1399
|
+
}, [c, o]), t.useEffect(() => {
|
|
1400
|
+
if (!c || !g.current || !r) return;
|
|
1401
|
+
function onLeave(e) {
|
|
1402
|
+
k() && i(!1, e, "hover");
|
|
1403
|
+
}
|
|
1404
|
+
let e = getDocument(s.floating).documentElement;
|
|
1405
|
+
return e.addEventListener("mouseleave", onLeave), () => {
|
|
1406
|
+
e.removeEventListener("mouseleave", onLeave);
|
|
1407
|
+
};
|
|
1408
|
+
}, [
|
|
1409
|
+
s.floating,
|
|
1410
|
+
r,
|
|
1411
|
+
i,
|
|
1412
|
+
c,
|
|
1413
|
+
g,
|
|
1414
|
+
k
|
|
1415
|
+
]);
|
|
1416
|
+
let A = t.useCallback(function(e, t, n) {
|
|
1417
|
+
t === void 0 && (t = !0), n === void 0 && (n = "hover");
|
|
1418
|
+
let r = getDelay(_.current, "close", b.current);
|
|
1419
|
+
r && !C.current ? (clearTimeoutIfSet(x), x.current = window.setTimeout(() => i(!1, e, n), r)) : t && (clearTimeoutIfSet(x), i(!1, e, n));
|
|
1420
|
+
}, [_, i]), j = useEffectEvent$1(() => {
|
|
1421
|
+
D.current(), C.current = void 0;
|
|
1422
|
+
}), M = useEffectEvent$1(() => {
|
|
1423
|
+
if (E.current) {
|
|
1424
|
+
let e = getDocument(s.floating).body;
|
|
1425
|
+
e.style.pointerEvents = "", e.removeAttribute(Q), E.current = !1;
|
|
1426
|
+
}
|
|
1427
|
+
}), N = useEffectEvent$1(() => a.current.openEvent ? ["click", "mousedown"].includes(a.current.openEvent.type) : !1);
|
|
1428
|
+
t.useEffect(() => {
|
|
1429
|
+
if (!c) return;
|
|
1430
|
+
function onReferenceMouseEnter(e) {
|
|
1431
|
+
if (clearTimeoutIfSet(x), T.current = !1, d && !isMouseLikePointerType(b.current) || getRestMs(y.current) > 0 && !getDelay(_.current, "open")) return;
|
|
1432
|
+
let t = getDelay(_.current, "open", b.current);
|
|
1433
|
+
t ? x.current = window.setTimeout(() => {
|
|
1434
|
+
v.current || i(!0, e, "hover");
|
|
1435
|
+
}, t) : r || i(!0, e, "hover");
|
|
1436
|
+
}
|
|
1437
|
+
function onReferenceMouseLeave(e) {
|
|
1438
|
+
if (N()) {
|
|
1439
|
+
M();
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1442
|
+
D.current();
|
|
1443
|
+
let t = getDocument(s.floating);
|
|
1444
|
+
if (clearTimeoutIfSet(w), O.current = !1, g.current && a.current.floatingContext) {
|
|
1445
|
+
r || clearTimeoutIfSet(x), C.current = g.current({
|
|
1446
|
+
...a.current.floatingContext,
|
|
1447
|
+
tree: m,
|
|
1448
|
+
x: e.clientX,
|
|
1449
|
+
y: e.clientY,
|
|
1450
|
+
onClose() {
|
|
1451
|
+
M(), j(), N() || A(e, !0, "safe-polygon");
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
let n = C.current;
|
|
1455
|
+
t.addEventListener("mousemove", n), D.current = () => {
|
|
1456
|
+
t.removeEventListener("mousemove", n);
|
|
1457
|
+
};
|
|
1458
|
+
return;
|
|
1459
|
+
}
|
|
1460
|
+
(b.current !== "touch" || !contains$1(s.floating, e.relatedTarget)) && A(e);
|
|
1461
|
+
}
|
|
1462
|
+
function onScrollMouseLeave(e) {
|
|
1463
|
+
N() || a.current.floatingContext && (g.current == null || g.current({
|
|
1464
|
+
...a.current.floatingContext,
|
|
1465
|
+
tree: m,
|
|
1466
|
+
x: e.clientX,
|
|
1467
|
+
y: e.clientY,
|
|
1468
|
+
onClose() {
|
|
1469
|
+
M(), j(), N() || A(e);
|
|
1470
|
+
}
|
|
1471
|
+
})(e));
|
|
1472
|
+
}
|
|
1473
|
+
function onFloatingMouseEnter() {
|
|
1474
|
+
clearTimeoutIfSet(x);
|
|
1475
|
+
}
|
|
1476
|
+
function onFloatingMouseLeave(e) {
|
|
1477
|
+
N() || A(e, !1);
|
|
1478
|
+
}
|
|
1479
|
+
if (isElement(s.domReference)) {
|
|
1480
|
+
let e = s.domReference, t = s.floating;
|
|
1481
|
+
return r && e.addEventListener("mouseleave", onScrollMouseLeave), p && e.addEventListener("mousemove", onReferenceMouseEnter, { once: !0 }), e.addEventListener("mouseenter", onReferenceMouseEnter), e.addEventListener("mouseleave", onReferenceMouseLeave), t && (t.addEventListener("mouseleave", onScrollMouseLeave), t.addEventListener("mouseenter", onFloatingMouseEnter), t.addEventListener("mouseleave", onFloatingMouseLeave)), () => {
|
|
1482
|
+
r && e.removeEventListener("mouseleave", onScrollMouseLeave), p && e.removeEventListener("mousemove", onReferenceMouseEnter), e.removeEventListener("mouseenter", onReferenceMouseEnter), e.removeEventListener("mouseleave", onReferenceMouseLeave), t && (t.removeEventListener("mouseleave", onScrollMouseLeave), t.removeEventListener("mouseenter", onFloatingMouseEnter), t.removeEventListener("mouseleave", onFloatingMouseLeave));
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
}, [
|
|
1486
|
+
s,
|
|
1487
|
+
c,
|
|
1488
|
+
e,
|
|
1489
|
+
d,
|
|
1490
|
+
p,
|
|
1491
|
+
A,
|
|
1492
|
+
j,
|
|
1493
|
+
M,
|
|
1494
|
+
i,
|
|
1495
|
+
r,
|
|
1496
|
+
v,
|
|
1497
|
+
m,
|
|
1498
|
+
_,
|
|
1499
|
+
g,
|
|
1500
|
+
a,
|
|
1501
|
+
N,
|
|
1502
|
+
y
|
|
1503
|
+
]), S(() => {
|
|
1504
|
+
var e;
|
|
1505
|
+
if (c && r && (e = g.current) != null && (e = e.__options) != null && e.blockPointerEvents && k()) {
|
|
1506
|
+
E.current = !0;
|
|
1507
|
+
let e = s.floating;
|
|
1508
|
+
if (isElement(s.domReference) && e) {
|
|
1509
|
+
var t;
|
|
1510
|
+
let n = getDocument(s.floating).body;
|
|
1511
|
+
n.setAttribute(Q, "");
|
|
1512
|
+
let r = s.domReference, i = m == null || (t = m.nodesRef.current.find((e) => e.id === h)) == null || (t = t.context) == null ? void 0 : t.elements.floating;
|
|
1513
|
+
return i && (i.style.pointerEvents = ""), n.style.pointerEvents = "none", r.style.pointerEvents = "auto", e.style.pointerEvents = "auto", () => {
|
|
1514
|
+
n.style.pointerEvents = "", r.style.pointerEvents = "", e.style.pointerEvents = "";
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}, [
|
|
1519
|
+
c,
|
|
1520
|
+
r,
|
|
1521
|
+
h,
|
|
1522
|
+
s,
|
|
1523
|
+
m,
|
|
1524
|
+
g,
|
|
1525
|
+
k
|
|
1526
|
+
]), S(() => {
|
|
1527
|
+
r || (b.current = void 0, O.current = !1, j(), M());
|
|
1528
|
+
}, [
|
|
1529
|
+
r,
|
|
1530
|
+
j,
|
|
1531
|
+
M
|
|
1532
|
+
]), t.useEffect(() => () => {
|
|
1533
|
+
j(), clearTimeoutIfSet(x), clearTimeoutIfSet(w), M();
|
|
1534
|
+
}, [
|
|
1535
|
+
c,
|
|
1536
|
+
s.domReference,
|
|
1537
|
+
j,
|
|
1538
|
+
M
|
|
1539
|
+
]);
|
|
1540
|
+
let P = t.useMemo(() => {
|
|
1541
|
+
function setPointerRef(e) {
|
|
1542
|
+
b.current = e.pointerType;
|
|
1543
|
+
}
|
|
1544
|
+
return {
|
|
1545
|
+
onPointerDown: setPointerRef,
|
|
1546
|
+
onPointerEnter: setPointerRef,
|
|
1547
|
+
onMouseMove(e) {
|
|
1548
|
+
let { nativeEvent: t } = e;
|
|
1549
|
+
function handleMouseMove() {
|
|
1550
|
+
!T.current && !v.current && i(!0, t, "hover");
|
|
1551
|
+
}
|
|
1552
|
+
d && !isMouseLikePointerType(b.current) || r || getRestMs(y.current) === 0 || O.current && e.movementX ** 2 + e.movementY ** 2 < 2 || (clearTimeoutIfSet(w), b.current === "touch" ? handleMouseMove() : (O.current = !0, w.current = window.setTimeout(handleMouseMove, getRestMs(y.current))));
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
}, [
|
|
1556
|
+
d,
|
|
1557
|
+
i,
|
|
1558
|
+
r,
|
|
1559
|
+
v,
|
|
1560
|
+
y
|
|
1561
|
+
]);
|
|
1562
|
+
return t.useMemo(() => c ? { reference: P } : {}, [c, P]);
|
|
1563
|
+
}
|
|
1564
|
+
var NOOP = () => {}, $ = /* @__PURE__ */ t.createContext({
|
|
1565
|
+
delay: 0,
|
|
1566
|
+
initialDelay: 0,
|
|
1567
|
+
timeoutMs: 0,
|
|
1568
|
+
currentId: null,
|
|
1569
|
+
setCurrentId: NOOP,
|
|
1570
|
+
setState: NOOP,
|
|
1571
|
+
isInstantPhase: !1
|
|
1572
|
+
}), useDelayGroupContext = () => t.useContext($);
|
|
1573
|
+
function FloatingDelayGroup(e) {
|
|
1574
|
+
let { children: n, delay: i, timeoutMs: a = 0 } = e, [o, s] = t.useReducer((e, t) => ({
|
|
1575
|
+
...e,
|
|
1576
|
+
...t
|
|
1577
|
+
}), {
|
|
1578
|
+
delay: i,
|
|
1579
|
+
timeoutMs: a,
|
|
1580
|
+
initialDelay: i,
|
|
1581
|
+
currentId: null,
|
|
1582
|
+
isInstantPhase: !1
|
|
1583
|
+
}), c = t.useRef(null), l = t.useCallback((e) => {
|
|
1584
|
+
s({ currentId: e });
|
|
1585
|
+
}, []);
|
|
1586
|
+
return S(() => {
|
|
1587
|
+
o.currentId ? c.current === null ? c.current = o.currentId : o.isInstantPhase || s({ isInstantPhase: !0 }) : (o.isInstantPhase && s({ isInstantPhase: !1 }), c.current = null);
|
|
1588
|
+
}, [o.currentId, o.isInstantPhase]), /* @__PURE__ */ r($.Provider, {
|
|
1589
|
+
value: t.useMemo(() => ({
|
|
1590
|
+
...o,
|
|
1591
|
+
setState: s,
|
|
1592
|
+
setCurrentId: l
|
|
1593
|
+
}), [o, l]),
|
|
1594
|
+
children: n
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
function useDelayGroup(e, t) {
|
|
1598
|
+
t === void 0 && (t = {});
|
|
1599
|
+
let { open: n, onOpenChange: r, floatingId: i } = e, { id: a, enabled: o = !0 } = t, s = a ?? i, c = useDelayGroupContext(), { currentId: l, setCurrentId: u, initialDelay: d, setState: f, timeoutMs: p } = c;
|
|
1600
|
+
return S(() => {
|
|
1601
|
+
o && l && (f({ delay: {
|
|
1602
|
+
open: 1,
|
|
1603
|
+
close: getDelay(d, "close")
|
|
1604
|
+
} }), l !== s && r(!1));
|
|
1605
|
+
}, [
|
|
1606
|
+
o,
|
|
1607
|
+
s,
|
|
1608
|
+
r,
|
|
1609
|
+
f,
|
|
1610
|
+
l,
|
|
1611
|
+
d
|
|
1612
|
+
]), S(() => {
|
|
1613
|
+
function unset() {
|
|
1614
|
+
r(!1), f({
|
|
1615
|
+
delay: d,
|
|
1616
|
+
currentId: null
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1619
|
+
if (o && l && !n && l === s) {
|
|
1620
|
+
if (p) {
|
|
1621
|
+
let e = window.setTimeout(unset, p);
|
|
1622
|
+
return () => {
|
|
1623
|
+
clearTimeout(e);
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
unset();
|
|
1627
|
+
}
|
|
1628
|
+
}, [
|
|
1629
|
+
o,
|
|
1630
|
+
n,
|
|
1631
|
+
f,
|
|
1632
|
+
l,
|
|
1633
|
+
s,
|
|
1634
|
+
r,
|
|
1635
|
+
d,
|
|
1636
|
+
p
|
|
1637
|
+
]), S(() => {
|
|
1638
|
+
o && (u === NOOP || !n || u(s));
|
|
1639
|
+
}, [
|
|
1640
|
+
o,
|
|
1641
|
+
n,
|
|
1642
|
+
u,
|
|
1643
|
+
s
|
|
1644
|
+
]), c;
|
|
1645
|
+
}
|
|
1646
|
+
function contains(e, t) {
|
|
1647
|
+
if (!e || !t) return !1;
|
|
1648
|
+
let n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
1649
|
+
if (e.contains(t)) return !0;
|
|
1650
|
+
if (n && isShadowRoot(n)) {
|
|
1651
|
+
let n = t;
|
|
1652
|
+
for (; n;) {
|
|
1653
|
+
if (e === n) return !0;
|
|
1654
|
+
n = n.parentNode || n.host;
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
return !1;
|
|
1658
|
+
}
|
|
1659
|
+
function getTarget(e) {
|
|
1660
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
1661
|
+
}
|
|
1662
|
+
var pe = {
|
|
1663
|
+
pointerdown: "onPointerDown",
|
|
1664
|
+
mousedown: "onMouseDown",
|
|
1665
|
+
click: "onClick"
|
|
1666
|
+
}, me = {
|
|
1667
|
+
pointerdown: "onPointerDownCapture",
|
|
1668
|
+
mousedown: "onMouseDownCapture",
|
|
1669
|
+
click: "onClickCapture"
|
|
1670
|
+
}, normalizeProp = (e) => ({
|
|
1671
|
+
escapeKey: typeof e == "boolean" ? e : e?.escapeKey ?? !1,
|
|
1672
|
+
outsidePress: typeof e == "boolean" ? e : e?.outsidePress ?? !0
|
|
1673
|
+
});
|
|
1674
|
+
function useDismiss(e, n) {
|
|
1675
|
+
n === void 0 && (n = {});
|
|
1676
|
+
let { open: r, onOpenChange: i, elements: a, dataRef: o } = e, { enabled: s = !0, escapeKey: c = !0, outsidePress: l = !0, outsidePressEvent: u = "pointerdown", referencePress: d = !1, referencePressEvent: f = "pointerdown", ancestorScroll: p = !1, bubbles: m, capture: h } = n, g = useFloatingTree(), _ = useEffectEvent$1(typeof l == "function" ? l : () => !1), v = typeof l == "function" ? _ : l, y = t.useRef(!1), { escapeKey: b, outsidePress: x } = normalizeProp(m), { escapeKey: S, outsidePress: C } = normalizeProp(h), w = t.useRef(!1), T = useEffectEvent$1((e) => {
|
|
1677
|
+
if (!r || !s || !c || e.key !== "Escape" || w.current) return;
|
|
1678
|
+
let t = o.current.floatingContext?.nodeId, n = g ? getNodeChildren$1(g.nodesRef.current, t) : [];
|
|
1679
|
+
if (!b && (e.stopPropagation(), n.length > 0)) {
|
|
1680
|
+
let e = !0;
|
|
1681
|
+
if (n.forEach((t) => {
|
|
1682
|
+
var n;
|
|
1683
|
+
if ((n = t.context) != null && n.open && !t.context.dataRef.current.__escapeKeyBubbles) {
|
|
1684
|
+
e = !1;
|
|
1685
|
+
return;
|
|
1686
|
+
}
|
|
1687
|
+
}), !e) return;
|
|
1688
|
+
}
|
|
1689
|
+
i(!1, isReactEvent(e) ? e.nativeEvent : e, "escape-key");
|
|
1690
|
+
}), E = useEffectEvent$1((e) => {
|
|
1691
|
+
var t;
|
|
1692
|
+
let callback = () => {
|
|
1693
|
+
var t;
|
|
1694
|
+
T(e), (t = getTarget$1(e)) == null || t.removeEventListener("keydown", callback);
|
|
1695
|
+
};
|
|
1696
|
+
(t = getTarget$1(e)) == null || t.addEventListener("keydown", callback);
|
|
1697
|
+
}), D = useEffectEvent$1((e) => {
|
|
1698
|
+
let t = o.current.insideReactTree;
|
|
1699
|
+
o.current.insideReactTree = !1;
|
|
1700
|
+
let n = y.current;
|
|
1701
|
+
if (y.current = !1, u === "click" && n || t || typeof v == "function" && !v(e)) return;
|
|
1702
|
+
let r = getTarget$1(e), s = "[" + createAttribute("inert") + "]", c = getDocument(a.floating).querySelectorAll(s), l = isElement(r) ? r : null;
|
|
1703
|
+
for (; l && !isLastTraversableNode(l);) {
|
|
1704
|
+
let e = getParentNode(l);
|
|
1705
|
+
if (isLastTraversableNode(e) || !isElement(e)) break;
|
|
1706
|
+
l = e;
|
|
1707
|
+
}
|
|
1708
|
+
if (c.length && isElement(r) && !isRootElement(r) && !contains$1(r, a.floating) && Array.from(c).every((e) => !contains$1(l, e))) return;
|
|
1709
|
+
if (isHTMLElement(r) && A) {
|
|
1710
|
+
let t = isLastTraversableNode(r), n = getComputedStyle$1(r), i = /auto|scroll/, a = t || i.test(n.overflowX), o = t || i.test(n.overflowY), s = a && r.clientWidth > 0 && r.scrollWidth > r.clientWidth, c = o && r.clientHeight > 0 && r.scrollHeight > r.clientHeight, l = n.direction === "rtl", u = c && (l ? e.offsetX <= r.offsetWidth - r.clientWidth : e.offsetX > r.clientWidth), d = s && e.offsetY > r.clientHeight;
|
|
1711
|
+
if (u || d) return;
|
|
1712
|
+
}
|
|
1713
|
+
let d = o.current.floatingContext?.nodeId, f = g && getNodeChildren$1(g.nodesRef.current, d).some((t) => isEventTargetWithin(e, t.context?.elements.floating));
|
|
1714
|
+
if (isEventTargetWithin(e, a.floating) || isEventTargetWithin(e, a.domReference) || f) return;
|
|
1715
|
+
let p = g ? getNodeChildren$1(g.nodesRef.current, d) : [];
|
|
1716
|
+
if (p.length > 0) {
|
|
1717
|
+
let e = !0;
|
|
1718
|
+
if (p.forEach((t) => {
|
|
1719
|
+
var n;
|
|
1720
|
+
if ((n = t.context) != null && n.open && !t.context.dataRef.current.__outsidePressBubbles) {
|
|
1721
|
+
e = !1;
|
|
1722
|
+
return;
|
|
1723
|
+
}
|
|
1724
|
+
}), !e) return;
|
|
1725
|
+
}
|
|
1726
|
+
i(!1, e, "outside-press");
|
|
1727
|
+
}), O = useEffectEvent$1((e) => {
|
|
1728
|
+
var t;
|
|
1729
|
+
let callback = () => {
|
|
1730
|
+
var t;
|
|
1731
|
+
D(e), (t = getTarget$1(e)) == null || t.removeEventListener(u, callback);
|
|
1732
|
+
};
|
|
1733
|
+
(t = getTarget$1(e)) == null || t.addEventListener(u, callback);
|
|
1734
|
+
});
|
|
1735
|
+
t.useEffect(() => {
|
|
1736
|
+
if (!r || !s) return;
|
|
1737
|
+
o.current.__escapeKeyBubbles = b, o.current.__outsidePressBubbles = x;
|
|
1738
|
+
let e = -1;
|
|
1739
|
+
function onScroll(e) {
|
|
1740
|
+
i(!1, e, "ancestor-scroll");
|
|
1741
|
+
}
|
|
1742
|
+
function handleCompositionStart() {
|
|
1743
|
+
window.clearTimeout(e), w.current = !0;
|
|
1744
|
+
}
|
|
1745
|
+
function handleCompositionEnd() {
|
|
1746
|
+
e = window.setTimeout(() => {
|
|
1747
|
+
w.current = !1;
|
|
1748
|
+
}, isWebKit() ? 5 : 0);
|
|
1749
|
+
}
|
|
1750
|
+
let t = getDocument(a.floating);
|
|
1751
|
+
c && (t.addEventListener("keydown", S ? E : T, S), t.addEventListener("compositionstart", handleCompositionStart), t.addEventListener("compositionend", handleCompositionEnd)), v && t.addEventListener(u, C ? O : D, C);
|
|
1752
|
+
let n = [];
|
|
1753
|
+
return p && (isElement(a.domReference) && (n = getOverflowAncestors(a.domReference)), isElement(a.floating) && (n = n.concat(getOverflowAncestors(a.floating))), !isElement(a.reference) && a.reference && a.reference.contextElement && (n = n.concat(getOverflowAncestors(a.reference.contextElement)))), n = n.filter((e) => e !== t.defaultView?.visualViewport), n.forEach((e) => {
|
|
1754
|
+
e.addEventListener("scroll", onScroll, { passive: !0 });
|
|
1755
|
+
}), () => {
|
|
1756
|
+
c && (t.removeEventListener("keydown", S ? E : T, S), t.removeEventListener("compositionstart", handleCompositionStart), t.removeEventListener("compositionend", handleCompositionEnd)), v && t.removeEventListener(u, C ? O : D, C), n.forEach((e) => {
|
|
1757
|
+
e.removeEventListener("scroll", onScroll);
|
|
1758
|
+
}), window.clearTimeout(e);
|
|
1759
|
+
};
|
|
1760
|
+
}, [
|
|
1761
|
+
o,
|
|
1762
|
+
a,
|
|
1763
|
+
c,
|
|
1764
|
+
v,
|
|
1765
|
+
u,
|
|
1766
|
+
r,
|
|
1767
|
+
i,
|
|
1768
|
+
p,
|
|
1769
|
+
s,
|
|
1770
|
+
b,
|
|
1771
|
+
x,
|
|
1772
|
+
T,
|
|
1773
|
+
S,
|
|
1774
|
+
E,
|
|
1775
|
+
D,
|
|
1776
|
+
C,
|
|
1777
|
+
O
|
|
1778
|
+
]), t.useEffect(() => {
|
|
1779
|
+
o.current.insideReactTree = !1;
|
|
1780
|
+
}, [
|
|
1781
|
+
o,
|
|
1782
|
+
v,
|
|
1783
|
+
u
|
|
1784
|
+
]);
|
|
1785
|
+
let k = t.useMemo(() => ({
|
|
1786
|
+
onKeyDown: T,
|
|
1787
|
+
...d && {
|
|
1788
|
+
[pe[f]]: (e) => {
|
|
1789
|
+
i(!1, e.nativeEvent, "reference-press");
|
|
1790
|
+
},
|
|
1791
|
+
...f !== "click" && { onClick(e) {
|
|
1792
|
+
i(!1, e.nativeEvent, "reference-press");
|
|
1793
|
+
} }
|
|
1794
|
+
}
|
|
1795
|
+
}), [
|
|
1796
|
+
T,
|
|
1797
|
+
i,
|
|
1798
|
+
d,
|
|
1799
|
+
f
|
|
1800
|
+
]), A = t.useMemo(() => {
|
|
1801
|
+
function setMouseDownOrUpInside(e) {
|
|
1802
|
+
e.button === 0 && (y.current = !0);
|
|
1803
|
+
}
|
|
1804
|
+
return {
|
|
1805
|
+
onKeyDown: T,
|
|
1806
|
+
onMouseDown: setMouseDownOrUpInside,
|
|
1807
|
+
onMouseUp: setMouseDownOrUpInside,
|
|
1808
|
+
[me[u]]: () => {
|
|
1809
|
+
o.current.insideReactTree = !0;
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
}, [
|
|
1813
|
+
T,
|
|
1814
|
+
u,
|
|
1815
|
+
o
|
|
1816
|
+
]);
|
|
1817
|
+
return t.useMemo(() => s ? {
|
|
1818
|
+
reference: k,
|
|
1819
|
+
floating: A
|
|
1820
|
+
} : {}, [
|
|
1821
|
+
s,
|
|
1822
|
+
k,
|
|
1823
|
+
A
|
|
1824
|
+
]);
|
|
1825
|
+
}
|
|
1826
|
+
function useFloatingRootContext(e) {
|
|
1827
|
+
let { open: n = !1, onOpenChange: r, elements: i } = e, a = X(), o = t.useRef({}), [s] = t.useState(() => createEventEmitter()), c = useFloatingParentNodeId() != null, [l, u] = t.useState(i.reference), d = useEffectEvent$1((e, t, n) => {
|
|
1828
|
+
o.current.openEvent = e ? t : void 0, s.emit("openchange", {
|
|
1829
|
+
open: e,
|
|
1830
|
+
event: t,
|
|
1831
|
+
reason: n,
|
|
1832
|
+
nested: c
|
|
1833
|
+
}), r?.(e, t, n);
|
|
1834
|
+
}), f = t.useMemo(() => ({ setPositionReference: u }), []), p = t.useMemo(() => ({
|
|
1835
|
+
reference: l || i.reference || null,
|
|
1836
|
+
floating: i.floating || null,
|
|
1837
|
+
domReference: i.reference
|
|
1838
|
+
}), [
|
|
1839
|
+
l,
|
|
1840
|
+
i.reference,
|
|
1841
|
+
i.floating
|
|
1842
|
+
]);
|
|
1843
|
+
return t.useMemo(() => ({
|
|
1844
|
+
dataRef: o,
|
|
1845
|
+
open: n,
|
|
1846
|
+
onOpenChange: d,
|
|
1847
|
+
elements: p,
|
|
1848
|
+
events: s,
|
|
1849
|
+
floatingId: a,
|
|
1850
|
+
refs: f
|
|
1851
|
+
}), [
|
|
1852
|
+
n,
|
|
1853
|
+
d,
|
|
1854
|
+
p,
|
|
1855
|
+
s,
|
|
1856
|
+
a,
|
|
1857
|
+
f
|
|
1858
|
+
]);
|
|
1859
|
+
}
|
|
1860
|
+
function useFloating(e) {
|
|
1861
|
+
e === void 0 && (e = {});
|
|
1862
|
+
let { nodeId: n } = e, r = useFloatingRootContext({
|
|
1863
|
+
...e,
|
|
1864
|
+
elements: {
|
|
1865
|
+
reference: null,
|
|
1866
|
+
floating: null,
|
|
1867
|
+
...e.elements
|
|
1868
|
+
}
|
|
1869
|
+
}), i = e.rootContext || r, a = i.elements, [o, s] = t.useState(null), [c, l] = t.useState(null), u = a?.domReference || o, d = t.useRef(null), f = useFloatingTree();
|
|
1870
|
+
S(() => {
|
|
1871
|
+
u && (d.current = u);
|
|
1872
|
+
}, [u]);
|
|
1873
|
+
let p = useFloating$1({
|
|
1874
|
+
...e,
|
|
1875
|
+
elements: {
|
|
1876
|
+
...a,
|
|
1877
|
+
...c && { reference: c }
|
|
1878
|
+
}
|
|
1879
|
+
}), m = t.useCallback((e) => {
|
|
1880
|
+
let t = isElement(e) ? {
|
|
1881
|
+
getBoundingClientRect: () => e.getBoundingClientRect(),
|
|
1882
|
+
getClientRects: () => e.getClientRects(),
|
|
1883
|
+
contextElement: e
|
|
1884
|
+
} : e;
|
|
1885
|
+
l(t), p.refs.setReference(t);
|
|
1886
|
+
}, [p.refs]), h = t.useCallback((e) => {
|
|
1887
|
+
(isElement(e) || e === null) && (d.current = e, s(e)), (isElement(p.refs.reference.current) || p.refs.reference.current === null || e !== null && !isElement(e)) && p.refs.setReference(e);
|
|
1888
|
+
}, [p.refs]), g = t.useMemo(() => ({
|
|
1889
|
+
...p.refs,
|
|
1890
|
+
setReference: h,
|
|
1891
|
+
setPositionReference: m,
|
|
1892
|
+
domReference: d
|
|
1893
|
+
}), [
|
|
1894
|
+
p.refs,
|
|
1895
|
+
h,
|
|
1896
|
+
m
|
|
1897
|
+
]), _ = t.useMemo(() => ({
|
|
1898
|
+
...p.elements,
|
|
1899
|
+
domReference: u
|
|
1900
|
+
}), [p.elements, u]), v = t.useMemo(() => ({
|
|
1901
|
+
...p,
|
|
1902
|
+
...i,
|
|
1903
|
+
refs: g,
|
|
1904
|
+
elements: _,
|
|
1905
|
+
nodeId: n
|
|
1906
|
+
}), [
|
|
1907
|
+
p,
|
|
1908
|
+
g,
|
|
1909
|
+
_,
|
|
1910
|
+
n,
|
|
1911
|
+
i
|
|
1912
|
+
]);
|
|
1913
|
+
return S(() => {
|
|
1914
|
+
i.dataRef.current.floatingContext = v;
|
|
1915
|
+
let e = f?.nodesRef.current.find((e) => e.id === n);
|
|
1916
|
+
e && (e.context = v);
|
|
1917
|
+
}), t.useMemo(() => ({
|
|
1918
|
+
...p,
|
|
1919
|
+
context: v,
|
|
1920
|
+
refs: g,
|
|
1921
|
+
elements: _
|
|
1922
|
+
}), [
|
|
1923
|
+
p,
|
|
1924
|
+
g,
|
|
1925
|
+
_,
|
|
1926
|
+
v
|
|
1927
|
+
]);
|
|
1928
|
+
}
|
|
1929
|
+
function isMacSafari() {
|
|
1930
|
+
return isMac() && isSafari();
|
|
1931
|
+
}
|
|
1932
|
+
function useFocus(e, n) {
|
|
1933
|
+
n === void 0 && (n = {});
|
|
1934
|
+
let { open: r, onOpenChange: i, events: a, dataRef: o, elements: s } = e, { enabled: c = !0, visibleOnly: l = !0 } = n, u = t.useRef(!1), d = t.useRef(-1), f = t.useRef(!0);
|
|
1935
|
+
t.useEffect(() => {
|
|
1936
|
+
if (!c) return;
|
|
1937
|
+
let e = getWindow(s.domReference);
|
|
1938
|
+
function onBlur() {
|
|
1939
|
+
!r && isHTMLElement(s.domReference) && s.domReference === activeElement(getDocument(s.domReference)) && (u.current = !0);
|
|
1940
|
+
}
|
|
1941
|
+
function onKeyDown() {
|
|
1942
|
+
f.current = !0;
|
|
1943
|
+
}
|
|
1944
|
+
function onPointerDown() {
|
|
1945
|
+
f.current = !1;
|
|
1946
|
+
}
|
|
1947
|
+
return e.addEventListener("blur", onBlur), isMacSafari() && (e.addEventListener("keydown", onKeyDown, !0), e.addEventListener("pointerdown", onPointerDown, !0)), () => {
|
|
1948
|
+
e.removeEventListener("blur", onBlur), isMacSafari() && (e.removeEventListener("keydown", onKeyDown, !0), e.removeEventListener("pointerdown", onPointerDown, !0));
|
|
1949
|
+
};
|
|
1950
|
+
}, [
|
|
1951
|
+
s.domReference,
|
|
1952
|
+
r,
|
|
1953
|
+
c
|
|
1954
|
+
]), t.useEffect(() => {
|
|
1955
|
+
if (!c) return;
|
|
1956
|
+
function onOpenChange(e) {
|
|
1957
|
+
let { reason: t } = e;
|
|
1958
|
+
(t === "reference-press" || t === "escape-key") && (u.current = !0);
|
|
1959
|
+
}
|
|
1960
|
+
return a.on("openchange", onOpenChange), () => {
|
|
1961
|
+
a.off("openchange", onOpenChange);
|
|
1962
|
+
};
|
|
1963
|
+
}, [a, c]), t.useEffect(() => () => {
|
|
1964
|
+
clearTimeoutIfSet(d);
|
|
1965
|
+
}, []);
|
|
1966
|
+
let p = t.useMemo(() => ({
|
|
1967
|
+
onMouseLeave() {
|
|
1968
|
+
u.current = !1;
|
|
1969
|
+
},
|
|
1970
|
+
onFocus(e) {
|
|
1971
|
+
if (u.current) return;
|
|
1972
|
+
let t = getTarget$1(e.nativeEvent);
|
|
1973
|
+
if (l && isElement(t)) {
|
|
1974
|
+
if (isMacSafari() && !e.relatedTarget) {
|
|
1975
|
+
if (!f.current && !isTypeableElement(t)) return;
|
|
1976
|
+
} else if (!matchesFocusVisible(t)) return;
|
|
1977
|
+
}
|
|
1978
|
+
i(!0, e.nativeEvent, "focus");
|
|
1979
|
+
},
|
|
1980
|
+
onBlur(e) {
|
|
1981
|
+
u.current = !1;
|
|
1982
|
+
let t = e.relatedTarget, n = e.nativeEvent, r = isElement(t) && t.hasAttribute(createAttribute("focus-guard")) && t.getAttribute("data-type") === "outside";
|
|
1983
|
+
d.current = window.setTimeout(() => {
|
|
1984
|
+
let e = activeElement(s.domReference ? s.domReference.ownerDocument : document);
|
|
1985
|
+
!t && e === s.domReference || contains$1(o.current.floatingContext?.refs.floating.current, e) || contains$1(s.domReference, e) || r || i(!1, n, "focus");
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
}), [
|
|
1989
|
+
o,
|
|
1990
|
+
s.domReference,
|
|
1991
|
+
i,
|
|
1992
|
+
l
|
|
1993
|
+
]);
|
|
1994
|
+
return t.useMemo(() => c ? { reference: p } : {}, [c, p]);
|
|
1995
|
+
}
|
|
1996
|
+
function mergeProps(e, t, n) {
|
|
1997
|
+
let r = /* @__PURE__ */ new Map(), i = n === "item", a = e;
|
|
1998
|
+
if (i && e) {
|
|
1999
|
+
let { [K]: t, [q]: n, ...r } = e;
|
|
2000
|
+
a = r;
|
|
2001
|
+
}
|
|
2002
|
+
return {
|
|
2003
|
+
...n === "floating" && {
|
|
2004
|
+
tabIndex: -1,
|
|
2005
|
+
[G]: ""
|
|
2006
|
+
},
|
|
2007
|
+
...a,
|
|
2008
|
+
...t.map((t) => {
|
|
2009
|
+
let r = t ? t[n] : null;
|
|
2010
|
+
return typeof r == "function" ? e ? r(e) : null : r;
|
|
2011
|
+
}).concat(e).reduce((e, t) => (t && Object.entries(t).forEach((t) => {
|
|
2012
|
+
let [n, a] = t;
|
|
2013
|
+
if (!(i && [K, q].includes(n))) if (n.indexOf("on") === 0) {
|
|
2014
|
+
if (r.has(n) || r.set(n, []), typeof a == "function") {
|
|
2015
|
+
var o;
|
|
2016
|
+
(o = r.get(n)) == null || o.push(a), e[n] = function() {
|
|
2017
|
+
var e = [...arguments];
|
|
2018
|
+
return r.get(n)?.map((t) => t(...e)).find((e) => e !== void 0);
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
} else e[n] = a;
|
|
2022
|
+
}), e), {})
|
|
2023
|
+
};
|
|
2024
|
+
}
|
|
2025
|
+
function useInteractions(e) {
|
|
2026
|
+
e === void 0 && (e = []);
|
|
2027
|
+
let n = e.map((e) => e?.reference), r = e.map((e) => e?.floating), i = e.map((e) => e?.item), a = t.useCallback((t) => mergeProps(t, e, "reference"), n), o = t.useCallback((t) => mergeProps(t, e, "floating"), r), s = t.useCallback((t) => mergeProps(t, e, "item"), i);
|
|
2028
|
+
return t.useMemo(() => ({
|
|
2029
|
+
getReferenceProps: a,
|
|
2030
|
+
getFloatingProps: o,
|
|
2031
|
+
getItemProps: s
|
|
2032
|
+
}), [
|
|
2033
|
+
a,
|
|
2034
|
+
o,
|
|
2035
|
+
s
|
|
2036
|
+
]);
|
|
2037
|
+
}
|
|
2038
|
+
var he = /* @__PURE__ */ new Map([
|
|
2039
|
+
["select", "listbox"],
|
|
2040
|
+
["combobox", "listbox"],
|
|
2041
|
+
["label", !1]
|
|
2042
|
+
]);
|
|
2043
|
+
function useRole(e, n) {
|
|
2044
|
+
n === void 0 && (n = {});
|
|
2045
|
+
let { open: r, elements: i, floatingId: a } = e, { enabled: o = !0, role: s = "dialog" } = n, c = X(), l = i.domReference?.id || c, u = t.useMemo(() => getFloatingFocusElement(i.floating)?.id || a, [i.floating, a]), d = he.get(s) ?? s, f = useFloatingParentNodeId() != null, p = t.useMemo(() => d === "tooltip" || s === "label" ? { ["aria-" + (s === "label" ? "labelledby" : "describedby")]: r ? u : void 0 } : {
|
|
2046
|
+
"aria-expanded": r ? "true" : "false",
|
|
2047
|
+
"aria-haspopup": d === "alertdialog" ? "dialog" : d,
|
|
2048
|
+
"aria-controls": r ? u : void 0,
|
|
2049
|
+
...d === "listbox" && { role: "combobox" },
|
|
2050
|
+
...d === "menu" && { id: l },
|
|
2051
|
+
...d === "menu" && f && { role: "menuitem" },
|
|
2052
|
+
...s === "select" && { "aria-autocomplete": "none" },
|
|
2053
|
+
...s === "combobox" && { "aria-autocomplete": "list" }
|
|
2054
|
+
}, [
|
|
2055
|
+
d,
|
|
2056
|
+
u,
|
|
2057
|
+
f,
|
|
2058
|
+
r,
|
|
2059
|
+
l,
|
|
2060
|
+
s
|
|
2061
|
+
]), m = t.useMemo(() => {
|
|
2062
|
+
let e = {
|
|
2063
|
+
id: u,
|
|
2064
|
+
...d && { role: d }
|
|
2065
|
+
};
|
|
2066
|
+
return d === "tooltip" || s === "label" ? e : {
|
|
2067
|
+
...e,
|
|
2068
|
+
...d === "menu" && { "aria-labelledby": l }
|
|
2069
|
+
};
|
|
2070
|
+
}, [
|
|
2071
|
+
d,
|
|
2072
|
+
u,
|
|
2073
|
+
l,
|
|
2074
|
+
s
|
|
2075
|
+
]), h = t.useCallback((e) => {
|
|
2076
|
+
let { active: t, selected: n } = e, r = {
|
|
2077
|
+
role: "option",
|
|
2078
|
+
...t && { id: u + "-fui-option" }
|
|
2079
|
+
};
|
|
2080
|
+
switch (s) {
|
|
2081
|
+
case "select":
|
|
2082
|
+
case "combobox": return {
|
|
2083
|
+
...r,
|
|
2084
|
+
"aria-selected": n
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
return {};
|
|
2088
|
+
}, [u, s]);
|
|
2089
|
+
return t.useMemo(() => o ? {
|
|
2090
|
+
reference: p,
|
|
2091
|
+
floating: m,
|
|
2092
|
+
item: h
|
|
2093
|
+
} : {}, [
|
|
2094
|
+
o,
|
|
2095
|
+
p,
|
|
2096
|
+
m,
|
|
2097
|
+
h
|
|
2098
|
+
]);
|
|
2099
|
+
}
|
|
2100
|
+
function getNodeChildren(e, t, n) {
|
|
2101
|
+
return n === void 0 && (n = !0), e.filter((e) => e.parentId === t && (!n || e.context?.open)).flatMap((t) => [t, ...getNodeChildren(e, t.id, n)]);
|
|
2102
|
+
}
|
|
2103
|
+
function isPointInPolygon(e, t) {
|
|
2104
|
+
let [n, r] = e, i = !1, a = t.length;
|
|
2105
|
+
for (let e = 0, o = a - 1; e < a; o = e++) {
|
|
2106
|
+
let [a, s] = t[e] || [0, 0], [c, l] = t[o] || [0, 0];
|
|
2107
|
+
s >= r != l >= r && n <= (c - a) * (r - s) / (l - s) + a && (i = !i);
|
|
2108
|
+
}
|
|
2109
|
+
return i;
|
|
2110
|
+
}
|
|
2111
|
+
function isInside(e, t) {
|
|
2112
|
+
return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
|
|
2113
|
+
}
|
|
2114
|
+
function safePolygon(e) {
|
|
2115
|
+
e === void 0 && (e = {});
|
|
2116
|
+
let { buffer: t = .5, blockPointerEvents: n = !1, requireIntent: r = !0 } = e, i = { current: -1 }, a = !1, o = null, s = null, c = typeof performance < "u" ? performance.now() : 0;
|
|
2117
|
+
function getCursorSpeed(e, t) {
|
|
2118
|
+
let n = performance.now(), r = n - c;
|
|
2119
|
+
if (o === null || s === null || r === 0) return o = e, s = t, c = n, null;
|
|
2120
|
+
let i = e - o, a = t - s, l = Math.sqrt(i * i + a * a) / r;
|
|
2121
|
+
return o = e, s = t, c = n, l;
|
|
2122
|
+
}
|
|
2123
|
+
let fn = (e) => {
|
|
2124
|
+
let { x: n, y: o, placement: s, elements: c, onClose: l, nodeId: u, tree: d } = e;
|
|
2125
|
+
return function onMouseMove(e) {
|
|
2126
|
+
function close() {
|
|
2127
|
+
clearTimeoutIfSet(i), l();
|
|
2128
|
+
}
|
|
2129
|
+
if (clearTimeoutIfSet(i), !c.domReference || !c.floating || s == null || n == null || o == null) return;
|
|
2130
|
+
let { clientX: f, clientY: p } = e, m = [f, p], h = getTarget(e), g = e.type === "mouseleave", _ = contains(c.floating, h), v = contains(c.domReference, h), y = c.domReference.getBoundingClientRect(), b = c.floating.getBoundingClientRect(), x = s.split("-")[0], S = n > b.right - b.width / 2, C = o > b.bottom - b.height / 2, w = isInside(m, y), T = b.width > y.width, E = b.height > y.height, D = (T ? y : b).left, O = (T ? y : b).right, k = (E ? y : b).top, A = (E ? y : b).bottom;
|
|
2131
|
+
if (_ && (a = !0, !g)) return;
|
|
2132
|
+
if (v && (a = !1), v && !g) {
|
|
2133
|
+
a = !0;
|
|
2134
|
+
return;
|
|
2135
|
+
}
|
|
2136
|
+
if (g && isElement(e.relatedTarget) && contains(c.floating, e.relatedTarget) || d && getNodeChildren(d.nodesRef.current, u).length) return;
|
|
2137
|
+
if (x === "top" && o >= y.bottom - 1 || x === "bottom" && o <= y.top + 1 || x === "left" && n >= y.right - 1 || x === "right" && n <= y.left + 1) return close();
|
|
2138
|
+
let j = [];
|
|
2139
|
+
switch (x) {
|
|
2140
|
+
case "top":
|
|
2141
|
+
j = [
|
|
2142
|
+
[D, y.top + 1],
|
|
2143
|
+
[D, b.bottom - 1],
|
|
2144
|
+
[O, b.bottom - 1],
|
|
2145
|
+
[O, y.top + 1]
|
|
2146
|
+
];
|
|
2147
|
+
break;
|
|
2148
|
+
case "bottom":
|
|
2149
|
+
j = [
|
|
2150
|
+
[D, b.top + 1],
|
|
2151
|
+
[D, y.bottom - 1],
|
|
2152
|
+
[O, y.bottom - 1],
|
|
2153
|
+
[O, b.top + 1]
|
|
2154
|
+
];
|
|
2155
|
+
break;
|
|
2156
|
+
case "left":
|
|
2157
|
+
j = [
|
|
2158
|
+
[b.right - 1, A],
|
|
2159
|
+
[b.right - 1, k],
|
|
2160
|
+
[y.left + 1, k],
|
|
2161
|
+
[y.left + 1, A]
|
|
2162
|
+
];
|
|
2163
|
+
break;
|
|
2164
|
+
case "right":
|
|
2165
|
+
j = [
|
|
2166
|
+
[y.right - 1, A],
|
|
2167
|
+
[y.right - 1, k],
|
|
2168
|
+
[b.left + 1, k],
|
|
2169
|
+
[b.left + 1, A]
|
|
2170
|
+
];
|
|
2171
|
+
break;
|
|
2172
|
+
}
|
|
2173
|
+
function getPolygon(e) {
|
|
2174
|
+
let [n, r] = e;
|
|
2175
|
+
switch (x) {
|
|
2176
|
+
case "top": return [
|
|
2177
|
+
[T ? n + t / 2 : S ? n + t * 4 : n - t * 4, r + t + 1],
|
|
2178
|
+
[T ? n - t / 2 : S ? n + t * 4 : n - t * 4, r + t + 1],
|
|
2179
|
+
[b.left, S || T ? b.bottom - t : b.top],
|
|
2180
|
+
[b.right, S ? T ? b.bottom - t : b.top : b.bottom - t]
|
|
2181
|
+
];
|
|
2182
|
+
case "bottom": return [
|
|
2183
|
+
[T ? n + t / 2 : S ? n + t * 4 : n - t * 4, r - t],
|
|
2184
|
+
[T ? n - t / 2 : S ? n + t * 4 : n - t * 4, r - t],
|
|
2185
|
+
[b.left, S || T ? b.top + t : b.bottom],
|
|
2186
|
+
[b.right, S ? T ? b.top + t : b.bottom : b.top + t]
|
|
2187
|
+
];
|
|
2188
|
+
case "left": {
|
|
2189
|
+
let e = [n + t + 1, E ? r + t / 2 : C ? r + t * 4 : r - t * 4], i = [n + t + 1, E ? r - t / 2 : C ? r + t * 4 : r - t * 4];
|
|
2190
|
+
return [
|
|
2191
|
+
[C || E ? b.right - t : b.left, b.top],
|
|
2192
|
+
[C ? E ? b.right - t : b.left : b.right - t, b.bottom],
|
|
2193
|
+
e,
|
|
2194
|
+
i
|
|
2195
|
+
];
|
|
2196
|
+
}
|
|
2197
|
+
case "right": return [
|
|
2198
|
+
[n - t, E ? r + t / 2 : C ? r + t * 4 : r - t * 4],
|
|
2199
|
+
[n - t, E ? r - t / 2 : C ? r + t * 4 : r - t * 4],
|
|
2200
|
+
[C || E ? b.left + t : b.right, b.top],
|
|
2201
|
+
[C ? E ? b.left + t : b.right : b.left + t, b.bottom]
|
|
2202
|
+
];
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
if (!isPointInPolygon([f, p], j)) {
|
|
2206
|
+
if (a && !w) return close();
|
|
2207
|
+
if (!g && r) {
|
|
2208
|
+
let t = getCursorSpeed(e.clientX, e.clientY);
|
|
2209
|
+
if (t !== null && t < .1) return close();
|
|
2210
|
+
}
|
|
2211
|
+
isPointInPolygon([f, p], getPolygon([n, o])) ? !a && r && (i.current = window.setTimeout(close, 40)) : close();
|
|
2212
|
+
}
|
|
2213
|
+
};
|
|
2214
|
+
};
|
|
2215
|
+
return fn.__options = { blockPointerEvents: n }, fn;
|
|
2216
|
+
}
|
|
2217
|
+
//#endregion
|
|
2218
|
+
export { L as C, H as S, getOverflowAncestors as T, shift as _, useFloating as a, autoUpdate as b, useInteractions as c, arrow as d, flip as f, offset as g, limitShift as h, useDismiss as i, useMergeRefs as l, inline as m, safePolygon as n, useFocus as o, hide as p, useDelayGroup as r, useHover as s, FloatingDelayGroup as t, useRole as u, size as v, V as w, computePosition as x, R as y };
|