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

753 lines
22 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 334606b5978d0903.36ee2c232b.js
* Module id: 622983
* 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),
n = e.i(403557);
function a(e, t) {
let r = e;
for (; (r = r.parentElement) && !r.matches(t); );
return r;
}
e.i(7284);
var i = e.i(759455),
o = e.i(450943),
l = e.i(479324),
s = e.i(593307);
function u({ open: e, close: t, openDelay: n, closeDelay: a }) {
let i = (0, r.useRef)(-1),
o = (0, r.useRef)(-1),
l = () => {
window.clearTimeout(i.current), window.clearTimeout(o.current);
};
return (
(0, r.useEffect)(() => l, []),
{
openDropdown: () => {
l(),
0 === n || void 0 === n
? e()
: (i.current = window.setTimeout(e, n));
},
closeDropdown: () => {
l(),
0 === a || void 0 === a
? t()
: (o.current = window.setTimeout(t, a));
},
}
);
}
var c = e.i(529833);
let [f, d] = (0, e.i(559394).createSafeContext)(
"Menu component was not found in the tree",
);
var p = {
dropdown: "m_dc9b7c9f",
label: "m_9bfac126",
divider: "m_efdf90cb",
item: "m_99ac2aa1",
itemLabel: "m_5476e0d3",
itemSection: "m_8b75e504",
chevron: "m_b85b0bed",
},
m = e.i(124859);
let h = (0, s.factory)((e, r) => {
let {
classNames: n,
className: a,
style: i,
styles: o,
vars: s,
...u
} = (0, l.useProps)("MenuDivider", null, e),
c = d();
return (0, t.jsx)(m.Box, {
ref: r,
...c.getStyles("divider", {
className: a,
style: i,
styles: o,
classNames: n,
}),
...u,
});
});
(h.classes = p), (h.displayName = "@mantine/core/MenuDivider");
var v = e.i(600354),
g = e.i(264589);
let b = (0, s.factory)((e, n) => {
let {
classNames: a,
className: i,
style: o,
styles: s,
vars: u,
onMouseEnter: f,
onMouseLeave: p,
onKeyDown: m,
children: h,
...b
} = (0, l.useProps)("MenuDropdown", null, e),
y = (0, r.useRef)(null),
x = d(),
w = (0, g.createEventHandler)(m, (e) => {
("ArrowUp" === e.key || "ArrowDown" === e.key) &&
(e.preventDefault(),
y.current
?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]
?.focus());
}),
k = (0, g.createEventHandler)(
f,
() =>
("hover" === x.trigger || "click-hover" === x.trigger) &&
x.openDropdown(),
),
C = (0, g.createEventHandler)(
p,
() =>
("hover" === x.trigger || "click-hover" === x.trigger) &&
x.closeDropdown(),
);
return (0, t.jsxs)(c.Popover.Dropdown, {
...b,
onMouseEnter: k,
onMouseLeave: C,
role: "menu",
"aria-orientation": "vertical",
ref: (0, v.useMergedRef)(n, y),
...x.getStyles("dropdown", {
className: i,
style: o,
styles: s,
classNames: a,
withStaticClass: !1,
}),
tabIndex: -1,
"data-menu-dropdown": !0,
onKeyDown: w,
children: [
x.withInitialFocusPlaceholder &&
(0, t.jsx)("div", {
tabIndex: -1,
"data-autofocus": !0,
"data-mantine-stop-propagation": !0,
style: { outline: 0 },
}),
h,
],
});
});
function y({
parentSelector: e,
siblingSelector: t,
onKeyDown: r,
loop: n = !0,
activateOnFocus: i = !1,
dir: o = "rtl",
orientation: l,
}) {
return (s) => {
r?.(s);
let u = Array.from(
a(s.currentTarget, e)?.querySelectorAll(t) || [],
).filter((t) => {
var r;
return (r = s.currentTarget), a(r, e) === a(t, e);
}),
c = u.findIndex((e) => s.currentTarget === e),
f = (function (e, t, r) {
for (let r = e + 1; r < t.length; r += 1)
if (!t[r].disabled) return r;
if (r) {
for (let e = 0; e < t.length; e += 1)
if (!t[e].disabled) return e;
}
return e;
})(c, u, n),
d = (function (e, t, r) {
for (let r = e - 1; r >= 0; r -= 1) if (!t[r].disabled) return r;
if (r) {
for (let e = t.length - 1; e > -1; e -= 1)
if (!t[e].disabled) return e;
}
return e;
})(c, u, n),
p = "rtl" === o ? d : f,
m = "rtl" === o ? f : d;
switch (s.key) {
case "ArrowRight":
"horizontal" === l &&
(s.stopPropagation(),
s.preventDefault(),
u[p].focus(),
i && u[p].click());
break;
case "ArrowLeft":
"horizontal" === l &&
(s.stopPropagation(),
s.preventDefault(),
u[m].focus(),
i && u[m].click());
break;
case "ArrowUp":
"vertical" === l &&
(s.stopPropagation(),
s.preventDefault(),
u[d].focus(),
i && u[d].click());
break;
case "ArrowDown":
"vertical" === l &&
(s.stopPropagation(),
s.preventDefault(),
u[f].focus(),
i && u[f].click());
break;
case "Home":
s.stopPropagation(),
s.preventDefault(),
u[0].disabled || u[0].focus();
break;
case "End": {
s.stopPropagation(), s.preventDefault();
let e = u.length - 1;
u[e].disabled || u[e].focus();
}
}
};
}
(b.classes = p),
(b.displayName = "@mantine/core/MenuDropdown"),
e.s(["createScopedKeydownHandler", () => y], 958133);
var x = e.i(801727),
w = e.i(830744),
k = e.i(910655),
C = e.i(46978),
E = e.i(606227);
let [j, P] = (0, e.i(209276).createOptionalContext)(),
F = (0, k.polymorphicFactory)((e, n) => {
let {
classNames: a,
className: i,
style: o,
styles: s,
vars: u,
color: c,
closeMenuOnClick: f,
leftSection: p,
rightSection: m,
children: h,
disabled: b,
"data-disabled": k,
...j
} = (0, l.useProps)("MenuItem", null, e),
F = d(),
_ = P(),
S = (0, w.useMantineTheme)(),
{ dir: N } = (0, C.useDirection)(),
O = (0, r.useRef)(null),
A = (0, g.createEventHandler)(j.onClick, () => {
!k &&
("boolean" == typeof f
? f && F.closeDropdownImmediately()
: F.closeOnItemClick && F.closeDropdownImmediately());
}),
M = c
? S.variantColorResolver({ color: c, theme: S, variant: "light" })
: void 0,
T = c ? (0, x.parseThemeColor)({ color: c, theme: S }) : null,
$ = (0, g.createEventHandler)(j.onKeyDown, (e) => {
"ArrowLeft" === e.key && _ && (_.close(), _.focusParentItem());
});
return (0, t.jsxs)(E.UnstyledButton, {
onMouseDown: (e) => e.preventDefault(),
...j,
unstyled: F.unstyled,
tabIndex: F.menuItemTabIndex,
...F.getStyles("item", {
className: i,
style: o,
styles: s,
classNames: a,
}),
ref: (0, v.useMergedRef)(O, n),
role: "menuitem",
disabled: b,
"data-menu-item": !0,
"data-disabled": b || k || void 0,
"data-mantine-stop-propagation": !0,
onClick: A,
onKeyDown: y({
siblingSelector: "[data-menu-item]:not([data-disabled])",
parentSelector: "[data-menu-dropdown]",
activateOnFocus: !1,
loop: F.loop,
dir: N,
orientation: "vertical",
onKeyDown: $,
}),
__vars: {
"--menu-item-color":
T?.isThemeColor && T?.shade === void 0
? `var(--mantine-color-${T.color}-6)`
: M?.color,
"--menu-item-hover": M?.hover,
},
children: [
p &&
(0, t.jsx)("div", {
...F.getStyles("itemSection", { styles: s, classNames: a }),
"data-position": "left",
children: p,
}),
h &&
(0, t.jsx)("div", {
...F.getStyles("itemLabel", { styles: s, classNames: a }),
children: h,
}),
m &&
(0, t.jsx)("div", {
...F.getStyles("itemSection", { styles: s, classNames: a }),
"data-position": "right",
children: m,
}),
],
});
});
(F.classes = p), (F.displayName = "@mantine/core/MenuItem");
let _ = (0, s.factory)((e, r) => {
let {
classNames: n,
className: a,
style: i,
styles: o,
vars: s,
...u
} = (0, l.useProps)("MenuLabel", null, e),
c = d();
return (0, t.jsx)(m.Box, {
ref: r,
...c.getStyles("label", {
className: a,
style: i,
styles: o,
classNames: n,
}),
...u,
});
});
(_.classes = p), (_.displayName = "@mantine/core/MenuLabel");
var S = e.i(192830),
N = e.i(11623);
let O = (0, s.factory)((e, n) => {
let {
classNames: a,
className: i,
style: o,
styles: s,
vars: u,
onMouseEnter: f,
onMouseLeave: p,
onKeyDown: m,
children: h,
...b
} = (0, l.useProps)("MenuSubDropdown", null, e),
y = (0, r.useRef)(null),
x = d(),
w = P(),
k = (0, g.createEventHandler)(f, w?.open),
C = (0, g.createEventHandler)(p, w?.close);
return (0, t.jsx)(c.Popover.Dropdown, {
...b,
onMouseEnter: k,
onMouseLeave: C,
role: "menu",
"aria-orientation": "vertical",
ref: (0, v.useMergedRef)(n, y),
...x.getStyles("dropdown", {
className: i,
style: o,
styles: s,
classNames: a,
withStaticClass: !1,
}),
tabIndex: -1,
"data-menu-dropdown": !0,
children: h,
});
});
(O.classes = p), (O.displayName = "@mantine/core/MenuSubDropdown");
var A = e.i(389435);
function M({ style: e, size: r = 16, ...n }) {
return (0, t.jsx)("svg", {
viewBox: "0 0 15 15",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
style: {
...e,
width: (0, A.rem)(r),
height: (0, A.rem)(r),
display: "block",
},
...n,
children: (0, t.jsx)("path", {
d: "M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",
fill: "currentColor",
fillRule: "evenodd",
clipRule: "evenodd",
}),
});
}
(M.displayName = "@mantine/core/AccordionChevron"),
e.s(["AccordionChevron", () => M], 622983);
let T = (0, k.polymorphicFactory)((e, n) => {
let {
classNames: a,
className: i,
style: o,
styles: s,
vars: u,
color: c,
leftSection: f,
rightSection: p,
children: m,
disabled: h,
"data-disabled": b,
closeMenuOnClick: k,
...j
} = (0, l.useProps)("MenuSubItem", null, e),
F = d(),
_ = P(),
S = (0, w.useMantineTheme)(),
{ dir: N } = (0, C.useDirection)(),
O = (0, r.useRef)(null),
A = c
? S.variantColorResolver({ color: c, theme: S, variant: "light" })
: void 0,
T = c ? (0, x.parseThemeColor)({ color: c, theme: S }) : null,
$ = (0, g.createEventHandler)(j.onKeyDown, (e) => {
"ArrowRight" === e.key && (_?.open(), _?.focusFirstItem()),
"ArrowLeft" === e.key &&
_?.parentContext &&
(_.parentContext.close(), _.parentContext.focusParentItem());
}),
I = (0, g.createEventHandler)(j.onClick, () => {
!b && k && F.closeDropdownImmediately();
}),
R = (0, g.createEventHandler)(j.onMouseEnter, _?.open),
D = (0, g.createEventHandler)(j.onMouseLeave, _?.close);
return (0, t.jsxs)(E.UnstyledButton, {
onMouseDown: (e) => e.preventDefault(),
...j,
unstyled: F.unstyled,
tabIndex: F.menuItemTabIndex,
...F.getStyles("item", {
className: i,
style: o,
styles: s,
classNames: a,
}),
ref: (0, v.useMergedRef)(O, n),
role: "menuitem",
disabled: h,
"data-menu-item": !0,
"data-sub-menu-item": !0,
"data-disabled": h || b || void 0,
"data-mantine-stop-propagation": !0,
onMouseEnter: R,
onMouseLeave: D,
onClick: I,
onKeyDown: y({
siblingSelector: "[data-menu-item]:not([data-disabled])",
parentSelector: "[data-menu-dropdown]",
activateOnFocus: !1,
loop: F.loop,
dir: N,
orientation: "vertical",
onKeyDown: $,
}),
__vars: {
"--menu-item-color":
T?.isThemeColor && T?.shade === void 0
? `var(--mantine-color-${T.color}-6)`
: A?.color,
"--menu-item-hover": A?.hover,
},
children: [
f &&
(0, t.jsx)("div", {
...F.getStyles("itemSection", { styles: s, classNames: a }),
"data-position": "left",
children: f,
}),
m &&
(0, t.jsx)("div", {
...F.getStyles("itemLabel", { styles: s, classNames: a }),
children: m,
}),
(0, t.jsx)("div", {
...F.getStyles("itemSection", { styles: s, classNames: a }),
"data-position": "right",
children:
p || (0, t.jsx)(M, { ...F.getStyles("chevron"), size: 14 }),
}),
],
});
});
(T.classes = p), (T.displayName = "@mantine/core/MenuSubItem");
var $ = e.i(886979);
function I({ children: e, refProp: r }) {
if (!(0, $.isElement)(e))
throw Error(
"Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported",
);
return (
d(),
(0, t.jsx)(c.Popover.Target, {
refProp: r,
popupType: "menu",
children: e,
})
);
}
I.displayName = "@mantine/core/MenuSubTarget";
let R = {
offset: 0,
position: "right-start",
transitionProps: { duration: 0 },
openDelay: 0,
middlewares: { shift: { crossAxis: !0 } },
};
function D(e) {
let {
children: r,
closeDelay: n,
openDelay: a,
...i
} = (0, l.useProps)("MenuSub", R, e),
o = (0, S.useId)(),
[s, { open: f, close: d }] = (0, N.useDisclosure)(!1),
p = P(),
{ openDropdown: m, closeDropdown: h } = u({
open: f,
close: d,
closeDelay: n,
openDelay: a,
});
return (0, t.jsx)(j, {
value: {
opened: s,
close: h,
open: m,
focusFirstItem: () =>
window.setTimeout(() => {
document
.getElementById(`${o}-dropdown`)
?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]
?.focus();
}, 16),
focusParentItem: () =>
window.setTimeout(() => {
document.getElementById(`${o}-target`)?.focus();
}, 16),
parentContext: p,
},
children: (0, t.jsx)(c.Popover, {
opened: s,
withinPortal: !1,
withArrow: !1,
id: o,
...i,
children: r,
}),
});
}
(D.extend = (e) => e),
(D.displayName = "@mantine/core/MenuSub"),
(D.Target = I),
(D.Dropdown = O),
(D.Item = T);
var V = e.i(142385);
let L = { refProp: "ref" },
B = (0, r.forwardRef)((e, n) => {
let {
children: a,
refProp: i,
...o
} = (0, l.useProps)("MenuTarget", L, e),
s = (0, V.getSingleElementChild)(a);
if (!s)
throw Error(
"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported",
);
let u = d(),
f = s.props,
p = (0, g.createEventHandler)(f.onClick, () => {
"click" === u.trigger
? u.toggleDropdown()
: "click-hover" === u.trigger &&
(u.setOpenedViaClick(!0), u.opened || u.openDropdown());
}),
m = (0, g.createEventHandler)(
f.onMouseEnter,
() =>
("hover" === u.trigger || "click-hover" === u.trigger) &&
u.openDropdown(),
),
h = (0, g.createEventHandler)(f.onMouseLeave, () => {
"hover" === u.trigger
? u.closeDropdown()
: "click-hover" !== u.trigger ||
u.openedViaClick ||
u.closeDropdown();
});
return (0, t.jsx)(c.Popover.Target, {
refProp: i,
popupType: "menu",
ref: n,
...o,
children: (0, r.cloneElement)(s, {
onClick: p,
onMouseEnter: m,
onMouseLeave: h,
"data-expanded": !!u.opened || void 0,
}),
});
});
B.displayName = "@mantine/core/MenuTarget";
let z = {
trapFocus: !0,
closeOnItemClick: !0,
withInitialFocusPlaceholder: !0,
clickOutsideEvents: ["mousedown", "touchstart", "keydown"],
loop: !0,
trigger: "click",
openDelay: 0,
closeDelay: 100,
menuItemTabIndex: -1,
};
function U(e) {
let s = (0, l.useProps)("Menu", z, e),
{
children: d,
onOpen: m,
onClose: h,
opened: v,
defaultOpened: g,
trapFocus: b,
onChange: y,
closeOnItemClick: x,
loop: w,
closeOnEscape: k,
trigger: C,
openDelay: E,
closeDelay: j,
classNames: P,
styles: F,
unstyled: _,
variant: S,
vars: N,
menuItemTabIndex: O,
keepMounted: A,
withInitialFocusPlaceholder: M,
attributes: T,
...$
} = s,
I = (0, o.useStyles)({
name: "Menu",
classes: p,
props: s,
classNames: P,
styles: F,
unstyled: _,
attributes: T,
}),
[R, D] = (0, n.useUncontrolled)({
value: v,
defaultValue: g,
finalValue: !1,
onChange: y,
}),
[V, L] = (0, r.useState)(!1),
B = () => {
D(!1), L(!1), R && h?.();
},
U = () => {
D(!0), R || m?.();
},
H = () => {
R ? B() : U();
},
{ openDropdown: q, closeDropdown: W } = u({
open: U,
close: B,
closeDelay: j,
openDelay: E,
}),
{ resolvedClassNames: Y, resolvedStyles: K } = (0,
i.useResolvedStylesApi)({ classNames: P, styles: F, props: s });
return (0, t.jsx)(f, {
value: {
getStyles: I,
opened: R,
toggleDropdown: H,
getItemIndex: (e) =>
e
? Array.from(
a(e, "[data-menu-dropdown]")?.querySelectorAll(
"[data-menu-item]",
) || [],
).findIndex((t) => t === e)
: null,
openedViaClick: V,
setOpenedViaClick: L,
closeOnItemClick: x,
closeDropdown: "click" === C ? B : W,
openDropdown: "click" === C ? U : q,
closeDropdownImmediately: B,
loop: w,
trigger: C,
unstyled: _,
menuItemTabIndex: O,
withInitialFocusPlaceholder: M,
},
children: (0, t.jsx)(c.Popover, {
returnFocus: !0,
...$,
opened: R,
onChange: H,
defaultOpened: g,
trapFocus: !A && b,
closeOnEscape: k,
__staticSelector: "Menu",
classNames: Y,
styles: K,
unstyled: _,
variant: S,
keepMounted: A,
children: d,
}),
});
}
(U.extend = (e) => e),
(U.withProps = (0, s.getWithProps)(U)),
(U.classes = p),
(U.displayName = "@mantine/core/Menu"),
(U.Item = F),
(U.Label = _),
(U.Dropdown = b),
(U.Target = B),
(U.Divider = h),
(U.Sub = D),
e.s(["Menu", () => U], 911872);
};
export default moduleFactory;