Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

589 lines
18 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: fb331b08bcf9fa6e.3b67e0d42a.js
* Module id: 819151
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(462214),
r = e.i(358379),
o = e.i(7284),
n = e.i(600354),
i = e.i(909243),
a = e.i(855698),
l = e.i(141460),
s = e.i(142385),
u = e.i(938202),
d = e.i(479324),
c = e.i(450943),
f = e.i(124859),
p = e.i(593307),
m = e.i(46978),
h = e.i(487101),
v = e.i(981933),
g = e.i(754654),
x = e.i(764218);
let w = { duration: 100, transition: "fade" };
function b(e, t) {
return { ...w, ...t, ...e };
}
var y = { tooltip: "m_1b3c8819", arrow: "m_f898399f" },
P = e.i(620428),
R = e.i(830744);
function C(e, t) {
return Array.isArray(e)
? [...e].reduce((e, r) => ({ ...e, ...C(r, t) }), {})
: "function" == typeof e
? e(t)
: null == e
? {}
: e;
}
e.s(["getStyleObject", () => C], 819151);
var S = e.i(800109),
E = e.i(520466),
T = e.i(888659);
let D = {
refProp: "ref",
withinPortal: !0,
offset: 10,
position: "right",
zIndex: (0, i.getDefaultZIndex)("popover"),
},
M = (0, u.createVarsResolver)((e, { radius: t, color: r }) => ({
tooltip: {
"--tooltip-radius": void 0 === t ? void 0 : (0, a.getRadius)(t),
"--tooltip-bg": r ? (0, P.getThemeColor)(r, e) : void 0,
"--tooltip-color": r ? "var(--mantine-color-white)" : void 0,
},
})),
k = (0, p.factory)((e, o) => {
let i = (0, d.useProps)("TooltipFloating", D, e),
{
children: a,
refProp: u,
withinPortal: p,
style: m,
className: h,
classNames: v,
styles: x,
unstyled: w,
radius: b,
color: P,
label: k,
offset: j,
position: N,
multiline: O,
zIndex: L,
disabled: F,
defaultOpened: B,
variant: I,
vars: _,
portalProps: A,
attributes: z,
...$
} = i,
V = (0, R.useMantineTheme)(),
K = (0, c.useStyles)({
name: "TooltipFloating",
props: i,
classes: y,
className: h,
style: m,
classNames: v,
styles: x,
unstyled: w,
attributes: z,
rootSelector: "tooltip",
vars: _,
varsResolver: M,
}),
{
handleMouseMove: U,
x: Y,
y: H,
opened: X,
boundaryRef: G,
floating: W,
setOpened: Z,
} = (function ({ offset: e, position: t, defaultOpened: o }) {
let [n, i] = (0, r.useState)(o),
a = (0, r.useRef)(null),
{
x: l,
y: s,
elements: u,
refs: d,
update: c,
placement: f,
} = (0, S.useFloating)({
placement: t,
middleware: [
(0, E.shift)({
crossAxis: !0,
padding: 5,
rootBoundary: "document",
}),
],
}),
p = f.includes("right") ? e : t.includes("left") ? -1 * e : 0,
m = f.includes("bottom") ? e : t.includes("top") ? -1 * e : 0,
h = (0, r.useCallback)(
({ clientX: e, clientY: t }) => {
d.setPositionReference({
getBoundingClientRect: () => ({
width: 0,
height: 0,
x: e,
y: t,
left: e + p,
top: t + m,
right: e,
bottom: t,
}),
});
},
[u.reference],
);
return (
(0, r.useEffect)(() => {
if (d.floating.current) {
let e = a.current;
e.addEventListener("mousemove", h);
let t = (0, T.getOverflowAncestors)(d.floating.current);
return (
t.forEach((e) => {
e.addEventListener("scroll", c);
}),
() => {
e.removeEventListener("mousemove", h),
t.forEach((e) => {
e.removeEventListener("scroll", c);
});
}
);
}
}, [u.reference, d.floating.current, c, h, n]),
{
handleMouseMove: h,
x: l,
y: s,
opened: n,
setOpened: i,
boundaryRef: a,
floating: d.setFloating,
}
);
})({ offset: j, position: N, defaultOpened: B }),
J = (0, s.getSingleElementChild)(a);
if (!J)
throw Error(
"[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported",
);
let q = (0, n.useMergedRef)(G, (0, l.getRefProp)(J), o),
Q = J.props;
return (0, t.jsxs)(t.Fragment, {
children: [
(0, t.jsx)(g.OptionalPortal, {
...A,
withinPortal: p,
children: (0, t.jsx)(f.Box, {
...$,
...K("tooltip", {
style: {
...C(m, V),
zIndex: L,
display: !F && X ? "block" : "none",
top: (H && Math.round(H)) ?? "",
left: (Y && Math.round(Y)) ?? "",
},
}),
variant: I,
ref: W,
mod: { multiline: O },
children: k,
}),
}),
(0, r.cloneElement)(J, {
...Q,
[u]: q,
onMouseEnter: (e) => {
Q.onMouseEnter?.(e), U(e), Z(!0);
},
onMouseLeave: (e) => {
Q.onMouseLeave?.(e), Z(!1);
},
}),
],
});
});
(k.classes = y), (k.displayName = "@mantine/core/TooltipFloating");
let j = (0, r.createContext)(!1),
N = j.Provider,
O = { openDelay: 0, closeDelay: 0 };
function L(e) {
let {
openDelay: r,
closeDelay: o,
children: n,
} = (0, d.useProps)("TooltipGroup", O, e);
return (0, t.jsx)(N, {
value: !0,
children: (0, t.jsx)(S.FloatingDelayGroup, {
delay: { open: r, close: o },
children: n,
}),
});
}
(L.displayName = "@mantine/core/TooltipGroup"), (L.extend = (e) => e);
var F = e.i(641712),
B = e.i(192830),
I = e.i(361752);
let _ = {
position: "top",
refProp: "ref",
withinPortal: !0,
arrowSize: 4,
arrowOffset: 5,
arrowRadius: 0,
arrowPosition: "side",
offset: 5,
transitionProps: { duration: 100, transition: "fade" },
events: { hover: !0, focus: !1, touch: !1 },
zIndex: (0, i.getDefaultZIndex)("popover"),
positionDependencies: [],
middlewares: { flip: !0, shift: !0, inline: !1 },
},
A = (0, u.createVarsResolver)(
(e, { radius: t, color: r, variant: o, autoContrast: n }) => {
let i = e.variantColorResolver({
theme: e,
color: r || e.primaryColor,
autoContrast: n,
variant: o || "filled",
});
return {
tooltip: {
"--tooltip-radius": void 0 === t ? void 0 : (0, a.getRadius)(t),
"--tooltip-bg": r ? i.background : void 0,
"--tooltip-color": r ? i.color : void 0,
},
};
},
),
z = (0, p.factory)((e, i) => {
let a = (0, d.useProps)("Tooltip", _, e),
{
children: u,
position: p,
refProp: w,
label: P,
openDelay: R,
closeDelay: C,
onPositionChange: T,
opened: D,
defaultOpened: M,
withinPortal: k,
radius: N,
color: O,
classNames: L,
styles: z,
unstyled: $,
style: V,
className: K,
withArrow: U,
arrowSize: Y,
arrowOffset: H,
arrowRadius: X,
arrowPosition: G,
offset: W,
transitionProps: Z,
multiline: J,
events: q,
zIndex: Q,
disabled: ee,
positionDependencies: et,
onClick: er,
onMouseEnter: eo,
onMouseLeave: en,
inline: ei,
variant: ea,
keepMounted: el,
vars: es,
portalProps: eu,
mod: ed,
floatingStrategy: ec,
middlewares: ef,
autoContrast: ep,
attributes: em,
target: eh,
...ev
} = (0, d.useProps)("Tooltip", _, a),
{ dir: eg } = (0, m.useDirection)(),
ex = (0, r.useRef)(null),
ew = (function (e) {
let t,
o,
[n, i] = (0, r.useState)(e.defaultOpened),
a = "boolean" == typeof e.opened ? e.opened : n,
l = (0, r.useContext)(j),
s = (0, B.useId)(),
u = (0, r.useCallback)(
(e) => {
i(e), e && w(s);
},
[s],
),
{
x: d,
y: c,
context: f,
refs: p,
placement: m,
middlewareData: { arrow: { x: h, y: v } = {} },
} = (0, S.useFloating)({
strategy: e.strategy,
placement: e.position,
open: a,
onOpenChange: u,
middleware:
((t = (function (e) {
if (void 0 === e) return { shift: !0, flip: !0 };
let t = { ...e };
return (
void 0 === e.shift && (t.shift = !0),
void 0 === e.flip && (t.flip = !0),
t
);
})(e.middlewares)),
(o = [(0, E.offset)(e.offset)]),
t.shift &&
o.push(
(0, E.shift)(
"boolean" == typeof t.shift
? { padding: 8 }
: { padding: 8, ...t.shift },
),
),
t.flip &&
o.push(
"boolean" == typeof t.flip
? (0, E.flip)()
: (0, E.flip)(t.flip),
),
o.push(
(0, E.arrow)({
element: e.arrowRef,
padding: e.arrowOffset,
}),
),
t.inline
? o.push(
"boolean" == typeof t.inline
? (0, E.inline)()
: (0, E.inline)(t.inline),
)
: e.inline && o.push((0, E.inline)()),
o),
whileElementsMounted: F.autoUpdate,
}),
{
delay: g,
currentId: x,
setCurrentId: w,
} = (0, S.useDelayGroup)(f, { id: s }),
{ getReferenceProps: b, getFloatingProps: y } = (0,
S.useInteractions)([
(0, S.useHover)(f, {
enabled: e.events?.hover,
delay: l ? g : { open: e.openDelay, close: e.closeDelay },
mouseOnly: !e.events?.touch,
}),
(0, S.useFocus)(f, {
enabled: e.events?.focus,
visibleOnly: !0,
}),
(0, S.useRole)(f, { role: "tooltip" }),
(0, S.useDismiss)(f, { enabled: void 0 === e.opened }),
]);
(0, I.useDidUpdate)(() => {
e.onPositionChange?.(m);
}, [m]);
let P = a && x && x !== s;
return {
x: d,
y: c,
arrowX: h,
arrowY: v,
reference: p.setReference,
floating: p.setFloating,
getFloatingProps: y,
getReferenceProps: b,
isGroupPhase: P,
opened: a,
placement: m,
};
})({
position: (0, v.getFloatingPosition)(eg, p),
closeDelay: C,
openDelay: R,
onPositionChange: T,
opened: D,
defaultOpened: M,
events: q,
arrowRef: ex,
arrowOffset: H,
offset: "number" == typeof W ? W + (U ? Y / 2 : 0) : W,
positionDependencies: [...et, eh ?? u],
inline: ei,
strategy: ec,
middlewares: ef,
});
(0, r.useEffect)(() => {
let e =
eh instanceof HTMLElement
? eh
: "string" == typeof eh
? document.querySelector(eh)
: eh?.current || null;
e && ew.reference(e);
}, [eh, ew]);
let eb = (0, c.useStyles)({
name: "Tooltip",
props: a,
classes: y,
className: K,
style: V,
classNames: L,
styles: z,
unstyled: $,
attributes: em,
rootSelector: "tooltip",
vars: es,
varsResolver: A,
}),
ey = (0, s.getSingleElementChild)(u);
if (!eh && !ey) return null;
if (eh) {
let e = b(Z, { duration: 100, transition: "fade" });
return (0, t.jsx)(t.Fragment, {
children: (0, t.jsx)(g.OptionalPortal, {
...eu,
withinPortal: k,
children: (0, t.jsx)(x.Transition, {
...e,
keepMounted: el,
mounted: !ee && !!ew.opened,
duration: ew.isGroupPhase ? 10 : e.duration,
children: (e) =>
(0, t.jsxs)(f.Box, {
...ev,
"data-fixed": "fixed" === ec || void 0,
variant: ea,
mod: [{ multiline: J }, ed],
...ew.getFloatingProps({
ref: ew.floating,
className: eb("tooltip").className,
style: {
...eb("tooltip").style,
...e,
zIndex: Q,
top: ew.y ?? 0,
left: ew.x ?? 0,
},
}),
children: [
P,
(0, t.jsx)(h.FloatingArrow, {
ref: ex,
arrowX: ew.arrowX,
arrowY: ew.arrowY,
visible: U,
position: ew.placement,
arrowSize: Y,
arrowOffset: H,
arrowRadius: X,
arrowPosition: G,
...eb("arrow"),
}),
],
}),
}),
}),
});
}
let eP = ey.props,
eR = (0, n.useMergedRef)(ew.reference, (0, l.getRefProp)(ey), i),
eC = b(Z, { duration: 100, transition: "fade" });
return (0, t.jsxs)(t.Fragment, {
children: [
(0, t.jsx)(g.OptionalPortal, {
...eu,
withinPortal: k,
children: (0, t.jsx)(x.Transition, {
...eC,
keepMounted: el,
mounted: !ee && !!ew.opened,
duration: ew.isGroupPhase ? 10 : eC.duration,
children: (e) =>
(0, t.jsxs)(f.Box, {
...ev,
"data-fixed": "fixed" === ec || void 0,
variant: ea,
mod: [{ multiline: J }, ed],
...ew.getFloatingProps({
ref: ew.floating,
className: eb("tooltip").className,
style: {
...eb("tooltip").style,
...e,
zIndex: Q,
top: ew.y ?? 0,
left: ew.x ?? 0,
},
}),
children: [
P,
(0, t.jsx)(h.FloatingArrow, {
ref: ex,
arrowX: ew.arrowX,
arrowY: ew.arrowY,
visible: U,
position: ew.placement,
arrowSize: Y,
arrowOffset: H,
arrowRadius: X,
arrowPosition: G,
...eb("arrow"),
}),
],
}),
}),
}),
(0, r.cloneElement)(
ey,
ew.getReferenceProps({
onClick: er,
onMouseEnter: eo,
onMouseLeave: en,
onMouseMove: a.onMouseMove,
onPointerDown: a.onPointerDown,
onPointerEnter: a.onPointerEnter,
...eP,
className: (0, o.default)(K, eP.className),
[w]: eR,
}),
),
],
});
});
(z.classes = y),
(z.displayName = "@mantine/core/Tooltip"),
(z.Floating = k),
(z.Group = L),
e.s(["Tooltip", () => z], 510161);
};
export default moduleFactory;