400 lines
12 KiB
JavaScript
400 lines
12 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 5d5b47876e53e564.da1ba52a93.js
|
|
* Module id: 711400
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
e.i(23741);
|
|
var t = e.i(935492),
|
|
r = e.i(358379),
|
|
n = e.i(564199),
|
|
o = e.i(371636),
|
|
a = e.i(556957),
|
|
i = e.i(30037),
|
|
l = e.i(643861),
|
|
s = e.i(46734),
|
|
c = e.i(264458);
|
|
e.i(556781);
|
|
var u = e.i(191508),
|
|
u = u,
|
|
d = e.i(943132),
|
|
d = d,
|
|
f = e.i(556466),
|
|
m = e.i(995650),
|
|
p = e.i(653993);
|
|
function h(e) {
|
|
let t,
|
|
r = new Promise((r) => {
|
|
t = e(() => {
|
|
r(!0);
|
|
});
|
|
}),
|
|
n = () => {
|
|
null == t || t();
|
|
};
|
|
return (n.then = (e, t) => r.then(e, t)), (n.promise = r), n;
|
|
}
|
|
var g = function (e, t) {
|
|
var r = {};
|
|
for (var n in e)
|
|
Object.prototype.hasOwnProperty.call(e, n) &&
|
|
0 > t.indexOf(n) &&
|
|
(r[n] = e[n]);
|
|
if (null != e && "function" == typeof Object.getOwnPropertySymbols)
|
|
for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++)
|
|
0 > t.indexOf(n[o]) &&
|
|
Object.prototype.propertyIsEnumerable.call(e, n[o]) &&
|
|
(r[n[o]] = e[n[o]]);
|
|
return r;
|
|
};
|
|
let b = ({ children: e, prefixCls: t }) => {
|
|
let n = (0, m.default)(t),
|
|
[o, a, i] = (0, p.default)(t, n);
|
|
return o(
|
|
r.createElement(
|
|
u.default,
|
|
{ classNames: { list: (0, c.default)(a, i, n) } },
|
|
e,
|
|
),
|
|
);
|
|
},
|
|
v = (e, { prefixCls: t, key: n }) =>
|
|
r.createElement(b, { prefixCls: t, key: n }, e),
|
|
_ = r.forwardRef((e, t) => {
|
|
let {
|
|
top: n,
|
|
prefixCls: o,
|
|
getContainer: i,
|
|
maxCount: l,
|
|
duration: u = 3,
|
|
rtl: f,
|
|
transitionName: m,
|
|
onAllRemoved: p,
|
|
} = e,
|
|
{
|
|
getPrefixCls: h,
|
|
getPopupContainer: g,
|
|
message: b,
|
|
direction: _,
|
|
} = r.useContext(a.ConfigContext),
|
|
y = o || h("message"),
|
|
x = r.createElement(
|
|
"span",
|
|
{ className: `${y}-close-x` },
|
|
r.createElement(s.default, { className: `${y}-close-icon` }),
|
|
),
|
|
[C, E] = (0, d.default)({
|
|
prefixCls: y,
|
|
style: () => ({
|
|
left: "50%",
|
|
transform: "translateX(-50%)",
|
|
top: null != n ? n : 8,
|
|
}),
|
|
className: () =>
|
|
(0, c.default)({ [`${y}-rtl`]: null != f ? f : "rtl" === _ }),
|
|
motion: () => ({ motionName: null != m ? m : `${y}-move-up` }),
|
|
closable: !1,
|
|
closeIcon: x,
|
|
duration: u,
|
|
getContainer: () =>
|
|
(null == i ? void 0 : i()) ||
|
|
(null == g ? void 0 : g()) ||
|
|
document.body,
|
|
maxCount: l,
|
|
onAllRemoved: p,
|
|
renderNotifications: v,
|
|
});
|
|
return (
|
|
r.useImperativeHandle(t, () =>
|
|
Object.assign(Object.assign({}, C), { prefixCls: y, message: b }),
|
|
),
|
|
E
|
|
);
|
|
}),
|
|
y = 0;
|
|
function x(e) {
|
|
let t = r.useRef(null);
|
|
return (
|
|
(0, f.devUseWarning)("Message"),
|
|
[
|
|
r.useMemo(() => {
|
|
let e = (e) => {
|
|
var r;
|
|
null == (r = t.current) || r.close(e);
|
|
},
|
|
n = (n) => {
|
|
if (!t.current) {
|
|
let e = () => {};
|
|
return (e.then = () => {}), e;
|
|
}
|
|
let { open: o, prefixCls: a, message: i } = t.current,
|
|
s = `${a}-notice`,
|
|
{
|
|
content: u,
|
|
icon: d,
|
|
type: f,
|
|
key: m,
|
|
className: p,
|
|
style: b,
|
|
onClose: v,
|
|
} = n,
|
|
_ = g(n, [
|
|
"content",
|
|
"icon",
|
|
"type",
|
|
"key",
|
|
"className",
|
|
"style",
|
|
"onClose",
|
|
]),
|
|
x = m;
|
|
return (
|
|
null == x && ((y += 1), (x = `antd-message-${y}`)),
|
|
h(
|
|
(t) => (
|
|
o(
|
|
Object.assign(Object.assign({}, _), {
|
|
key: x,
|
|
content: r.createElement(
|
|
l.PureContent,
|
|
{ prefixCls: a, type: f, icon: d },
|
|
u,
|
|
),
|
|
placement: "top",
|
|
className: (0, c.default)(
|
|
f && `${s}-${f}`,
|
|
p,
|
|
null == i ? void 0 : i.className,
|
|
),
|
|
style: Object.assign(
|
|
Object.assign({}, null == i ? void 0 : i.style),
|
|
b,
|
|
),
|
|
onClose: () => {
|
|
null == v || v(), t();
|
|
},
|
|
}),
|
|
),
|
|
() => {
|
|
e(x);
|
|
}
|
|
),
|
|
)
|
|
);
|
|
},
|
|
o = {
|
|
open: n,
|
|
destroy: (r) => {
|
|
var n;
|
|
void 0 !== r ? e(r) : null == (n = t.current) || n.destroy();
|
|
},
|
|
};
|
|
return (
|
|
["info", "success", "warning", "error", "loading"].forEach(
|
|
(e) => {
|
|
o[e] = (t, r, o) => {
|
|
let a, i, l;
|
|
return (
|
|
(a =
|
|
t && "object" == typeof t && "content" in t
|
|
? t
|
|
: { content: t }),
|
|
"function" == typeof r ? (l = r) : ((i = r), (l = o)),
|
|
n(
|
|
Object.assign(
|
|
Object.assign({ onClose: l, duration: i }, a),
|
|
{ type: e },
|
|
),
|
|
)
|
|
);
|
|
};
|
|
},
|
|
),
|
|
o
|
|
);
|
|
}, []),
|
|
r.createElement(
|
|
_,
|
|
Object.assign({ key: "message-holder" }, e, { ref: t }),
|
|
),
|
|
]
|
|
);
|
|
}
|
|
let C = null,
|
|
E = [],
|
|
S = {};
|
|
function w() {
|
|
let { getContainer: e, duration: t, rtl: r, maxCount: n, top: o } = S,
|
|
a = (null == e ? void 0 : e()) || document.body;
|
|
return {
|
|
getContainer: () => a,
|
|
duration: t,
|
|
rtl: r,
|
|
maxCount: n,
|
|
top: o,
|
|
};
|
|
}
|
|
let k = r.default.forwardRef((e, t) => {
|
|
let { messageConfig: o, sync: i } = e,
|
|
{ getPrefixCls: l } = (0, r.useContext)(a.ConfigContext),
|
|
s = S.prefixCls || l("message"),
|
|
c = (0, r.useContext)(n.AppConfigContext),
|
|
[u, d] = x(
|
|
Object.assign(
|
|
Object.assign(Object.assign({}, o), { prefixCls: s }),
|
|
c.message,
|
|
),
|
|
);
|
|
return (
|
|
r.default.useImperativeHandle(t, () => {
|
|
let e = Object.assign({}, u);
|
|
return (
|
|
Object.keys(e).forEach((t) => {
|
|
e[t] = (...e) => (i(), u[t].apply(u, e));
|
|
}),
|
|
{ instance: e, sync: i }
|
|
);
|
|
}),
|
|
d
|
|
);
|
|
}),
|
|
j = r.default.forwardRef((e, t) => {
|
|
let [n, a] = r.default.useState(w),
|
|
i = () => {
|
|
a(w);
|
|
};
|
|
r.default.useEffect(i, []);
|
|
let l = (0, o.globalConfig)(),
|
|
s = l.getRootPrefixCls(),
|
|
c = l.getIconPrefixCls(),
|
|
u = l.getTheme(),
|
|
d = r.default.createElement(k, { ref: t, sync: i, messageConfig: n });
|
|
return r.default.createElement(
|
|
o.default,
|
|
{ prefixCls: s, iconPrefixCls: c, theme: u },
|
|
l.holderRender ? l.holderRender(d) : d,
|
|
);
|
|
}),
|
|
P = () => {
|
|
if (!C) {
|
|
let e = document.createDocumentFragment(),
|
|
t = { fragment: e };
|
|
(C = t),
|
|
(() => {
|
|
(0, i.unstableSetRender)()(
|
|
r.default.createElement(j, {
|
|
ref: (e) => {
|
|
let { instance: r, sync: n } = e || {};
|
|
Promise.resolve().then(() => {
|
|
!t.instance && r && ((t.instance = r), (t.sync = n), P());
|
|
});
|
|
},
|
|
}),
|
|
e,
|
|
);
|
|
})();
|
|
return;
|
|
}
|
|
C.instance &&
|
|
(E.forEach((e) => {
|
|
let { type: r, skipped: n } = e;
|
|
if (!n)
|
|
switch (r) {
|
|
case "open":
|
|
{
|
|
let t = C.instance.open(
|
|
Object.assign(Object.assign({}, S), e.config),
|
|
);
|
|
null == t || t.then(e.resolve), e.setCloseFn(t);
|
|
}
|
|
break;
|
|
case "destroy":
|
|
null == C || C.instance.destroy(e.key);
|
|
break;
|
|
default: {
|
|
var o;
|
|
let n = (o = C.instance)[r].apply(o, (0, t.default)(e.args));
|
|
null == n || n.then(e.resolve), e.setCloseFn(n);
|
|
}
|
|
}
|
|
}),
|
|
(E = []));
|
|
},
|
|
R = {
|
|
open: function (e) {
|
|
let t = h((t) => {
|
|
let r,
|
|
n = {
|
|
type: "open",
|
|
config: e,
|
|
resolve: t,
|
|
setCloseFn: (e) => {
|
|
r = e;
|
|
},
|
|
};
|
|
return (
|
|
E.push(n),
|
|
() => {
|
|
r
|
|
? (() => {
|
|
r();
|
|
})()
|
|
: (n.skipped = !0);
|
|
}
|
|
);
|
|
});
|
|
return P(), t;
|
|
},
|
|
destroy: (e) => {
|
|
E.push({ type: "destroy", key: e }), P();
|
|
},
|
|
config: function (e) {
|
|
(S = Object.assign(Object.assign({}, S), e)),
|
|
(() => {
|
|
var e;
|
|
null == (e = null == C ? void 0 : C.sync) || e.call(C);
|
|
})();
|
|
},
|
|
useMessage: function (e) {
|
|
return x(e);
|
|
},
|
|
_InternalPanelDoNotUseOrYouWillBeFired: l.default,
|
|
};
|
|
["success", "info", "warning", "error", "loading"].forEach((e) => {
|
|
R[e] = (...t) => {
|
|
let r;
|
|
return (
|
|
(0, o.globalConfig)(),
|
|
(r = h((r) => {
|
|
let n,
|
|
o = {
|
|
type: e,
|
|
args: t,
|
|
resolve: r,
|
|
setCloseFn: (e) => {
|
|
n = e;
|
|
},
|
|
};
|
|
return (
|
|
E.push(o),
|
|
() => {
|
|
n
|
|
? (() => {
|
|
n();
|
|
})()
|
|
: (o.skipped = !0);
|
|
}
|
|
);
|
|
})),
|
|
P(),
|
|
r
|
|
);
|
|
};
|
|
});
|
|
e.s(["message", 0, R], 711400);
|
|
};
|
|
|
|
export default moduleFactory;
|