@alixpartners/ui-components 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ToastProvider-D5LImZ-Q.js +1136 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/NavBar.css +1 -1
- package/dist/assets/SplitButton.css +1 -1
- package/dist/assets/Tooltip.css +1 -1
- package/dist/components/Banner/Banner.test.js +1 -1
- package/dist/components/Button/Button.test.js +124 -3217
- package/dist/components/Checkbox/Checkbox.js +7 -6
- package/dist/components/Checkbox/Checkbox.test.js +47 -47
- package/dist/components/Creatable/Creatable.js +107 -108
- package/dist/components/Dialog/Dialog.d.ts +21 -7
- package/dist/components/Dialog/Dialog.js +296 -61
- package/dist/components/Dialog/Dialog.test.d.ts +1 -0
- package/dist/components/Dialog/Dialog.test.js +368 -0
- package/dist/components/Dropdown/Dropdown.js +80 -81
- package/dist/components/FilePicker/FilePicker.test.js +1 -1
- package/dist/components/Ghost/Ghost.test.js +6 -6
- package/dist/components/Input/Input.test.js +2 -2
- package/dist/components/NavBar/NavBar.js +16 -16
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.test.js +1 -1
- package/dist/components/Search/Search.test.js +1 -1
- package/dist/components/SplitButton/SplitButton.js +8 -9
- package/dist/components/SplitButton/SplitButton.test.js +1 -1
- package/dist/components/Tag/Tag.test.js +1 -1
- package/dist/components/TagsFields/TagsFields.js +3 -4
- package/dist/components/Textarea/Textarea.js +68 -70
- package/dist/components/Textarea/Textarea.test.js +2 -2
- package/dist/components/Toast/Toast.d.ts +5 -19
- package/dist/components/Toast/Toast.js +65 -62
- package/dist/components/Toast/Toast.test.js +47 -30
- package/dist/components/ToastProvider/ToastContext.d.ts +11 -0
- package/dist/components/ToastProvider/ToastProvider.d.ts +19 -0
- package/dist/components/ToastProvider/ToastProvider.js +7 -0
- package/dist/components/ToastProvider/ToastProvider.test.d.ts +1 -0
- package/dist/components/ToastProvider/ToastProvider.test.js +264 -0
- package/dist/components/ToastProvider/types.d.ts +54 -0
- package/dist/components/ToastProvider/useToast.d.ts +28 -0
- package/dist/components/Toggle/Toggle.js +31 -30
- package/dist/components/Toggle/Toggle.test.js +9 -9
- package/dist/components/Tooltip/Tooltip.js +20 -19
- package/dist/{index-2H7slGYV.js → index-7CBv-Jx6.js} +1 -1
- package/dist/{index-DpfPnSMn.js → index-BymOxiM6.js} +2 -2
- package/dist/index-C-3_YVJ1.js +1539 -0
- package/dist/{index-BKtdMA_j.js → index-C4ffg1vf.js} +24 -23
- package/dist/{index-BGZDIjm9.js → index-Chv2KjIL.js} +171 -168
- package/dist/{index-BJXIvJs4.js → index-CpsmI33B.js} +24 -23
- package/dist/index-CxAtPSMM.js +27 -0
- package/dist/{index-CjQV7MmW.js → index-DEphED6n.js} +11 -11
- package/dist/index-DM51yNMI.js +237 -0
- package/dist/{index-CVWHq7Pr.js → index-D_3jWVyV.js} +37 -36
- package/dist/index-DkTDHhag.js +3098 -0
- package/dist/index-DrR82jOT.js +142 -0
- package/dist/magic-string.es-uPKorP4O.js +663 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +38 -34
- package/dist/useToast-Cz5MGKnw.js +11 -0
- package/dist/{vi.ClIskdbk-CFW_9sOK.js → vi.bdSIJ99Y-017e_Pkz.js} +9494 -10227
- package/package.json +6 -3
- package/dist/index-DWydnyjJ.js +0 -245
- package/dist/index-DieLVN0p.js +0 -1664
- package/dist/magic-string.es-D4UQQyt0.js +0 -859
|
@@ -0,0 +1,1136 @@
|
|
|
1
|
+
import { jsx as U } from "react/jsx-runtime";
|
|
2
|
+
import g, { forwardRef as F, useRef as I, useCallback as L, useEffect as R, createElement as X, cloneElement as Qe, useMemo as he, useLayoutEffect as Ye, Component as Je, isValidElement as en, memo as Pe, useState as nn, useContext as tn, createContext as Ae } from "react";
|
|
3
|
+
import { createPortal as rn } from "react-dom";
|
|
4
|
+
import an from "./components/Toast/Toast.js";
|
|
5
|
+
function Re(t) {
|
|
6
|
+
var e, i, o = "";
|
|
7
|
+
if (typeof t == "string" || typeof t == "number") o += t;
|
|
8
|
+
else if (typeof t == "object") if (Array.isArray(t)) for (e = 0; e < t.length; e++) t[e] && (i = Re(t[e])) && (o && (o += " "), o += i);
|
|
9
|
+
else for (e in t) t[e] && (o && (o += " "), o += e);
|
|
10
|
+
return o;
|
|
11
|
+
}
|
|
12
|
+
function M() {
|
|
13
|
+
for (var t, e, i = 0, o = ""; i < arguments.length; ) (t = arguments[i++]) && (e = Re(t)) && (o && (o += " "), o += e);
|
|
14
|
+
return o;
|
|
15
|
+
}
|
|
16
|
+
let on = { data: "" }, sn = (t) => {
|
|
17
|
+
if (typeof window == "object") {
|
|
18
|
+
let e = (t ? t.querySelector("#_goober") : window._goober) || Object.assign(document.createElement("style"), { innerHTML: " ", id: "_goober" });
|
|
19
|
+
return e.nonce = window.__nonce__, e.parentNode || (t || document.head).appendChild(e), e.firstChild;
|
|
20
|
+
}
|
|
21
|
+
return t || on;
|
|
22
|
+
}, un = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, cn = /\/\*[^]*?\*\/| +/g, be = /\n+/g, P = (t, e) => {
|
|
23
|
+
let i = "", o = "", n = "";
|
|
24
|
+
for (let r in t) {
|
|
25
|
+
let a = t[r];
|
|
26
|
+
r[0] == "@" ? r[1] == "i" ? i = r + " " + a + ";" : o += r[1] == "f" ? P(a, r) : r + "{" + P(a, r[1] == "k" ? "" : e) + "}" : typeof a == "object" ? o += P(a, e ? e.replace(/([^,])+/g, (s) => r.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (l) => /&/.test(l) ? l.replace(/&/g, s) : s ? s + " " + l : l)) : r) : a != null && (r = /^--/.test(r) ? r : r.replace(/[A-Z]/g, "-$&").toLowerCase(), n += P.p ? P.p(r, a) : r + ":" + a + ";");
|
|
27
|
+
}
|
|
28
|
+
return i + (e && n ? e + "{" + n + "}" : n) + o;
|
|
29
|
+
}, N = {}, Me = (t) => {
|
|
30
|
+
if (typeof t == "object") {
|
|
31
|
+
let e = "";
|
|
32
|
+
for (let i in t) e += i + Me(t[i]);
|
|
33
|
+
return e;
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
}, ln = (t, e, i, o, n) => {
|
|
37
|
+
let r = Me(t), a = N[r] || (N[r] = ((l) => {
|
|
38
|
+
let c = 0, u = 11;
|
|
39
|
+
for (; c < l.length; ) u = 101 * u + l.charCodeAt(c++) >>> 0;
|
|
40
|
+
return "go" + u;
|
|
41
|
+
})(r));
|
|
42
|
+
if (!N[a]) {
|
|
43
|
+
let l = r !== t ? t : ((c) => {
|
|
44
|
+
let u, d, f = [{}];
|
|
45
|
+
for (; u = un.exec(c.replace(cn, "")); ) u[4] ? f.shift() : u[3] ? (d = u[3].replace(be, " ").trim(), f.unshift(f[0][d] = f[0][d] || {})) : f[0][u[1]] = u[2].replace(be, " ").trim();
|
|
46
|
+
return f[0];
|
|
47
|
+
})(t);
|
|
48
|
+
N[a] = P(n ? { ["@keyframes " + a]: l } : l, i ? "" : "." + a);
|
|
49
|
+
}
|
|
50
|
+
let s = i && N.g ? N.g : null;
|
|
51
|
+
return i && (N.g = N[a]), ((l, c, u, d) => {
|
|
52
|
+
d ? c.data = c.data.replace(d, l) : c.data.indexOf(l) === -1 && (c.data = u ? l + c.data : c.data + l);
|
|
53
|
+
})(N[a], e, o, s), a;
|
|
54
|
+
}, dn = (t, e, i) => t.reduce((o, n, r) => {
|
|
55
|
+
let a = e[r];
|
|
56
|
+
if (a && a.call) {
|
|
57
|
+
let s = a(i), l = s && s.props && s.props.className || /^go/.test(s) && s;
|
|
58
|
+
a = l ? "." + l : s && typeof s == "object" ? s.props ? "" : P(s, "") : s === !1 ? "" : s;
|
|
59
|
+
}
|
|
60
|
+
return o + n + (a ?? "");
|
|
61
|
+
}, "");
|
|
62
|
+
function me(t) {
|
|
63
|
+
let e = this || {}, i = t.call ? t(e.p) : t;
|
|
64
|
+
return ln(i.unshift ? i.raw ? dn(i, [].slice.call(arguments, 1), e.p) : i.reduce((o, n) => Object.assign(o, n && n.call ? n(e.p) : n), {}) : i, sn(e.target), e.g, e.o, e.k);
|
|
65
|
+
}
|
|
66
|
+
me.bind({ g: 1 });
|
|
67
|
+
me.bind({ k: 1 });
|
|
68
|
+
function fn(t, e) {
|
|
69
|
+
for (var i = 0; i < e.length; i++) {
|
|
70
|
+
var o = e[i];
|
|
71
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function We(t, e, i) {
|
|
75
|
+
return e && fn(t.prototype, e), t;
|
|
76
|
+
}
|
|
77
|
+
function m() {
|
|
78
|
+
return m = Object.assign || function(t) {
|
|
79
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
80
|
+
var i = arguments[e];
|
|
81
|
+
for (var o in i)
|
|
82
|
+
Object.prototype.hasOwnProperty.call(i, o) && (t[o] = i[o]);
|
|
83
|
+
}
|
|
84
|
+
return t;
|
|
85
|
+
}, m.apply(this, arguments);
|
|
86
|
+
}
|
|
87
|
+
function He(t, e) {
|
|
88
|
+
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e;
|
|
89
|
+
}
|
|
90
|
+
function G(t, e) {
|
|
91
|
+
if (t == null) return {};
|
|
92
|
+
var i = {}, o = Object.keys(t), n, r;
|
|
93
|
+
for (r = 0; r < o.length; r++)
|
|
94
|
+
n = o[r], !(e.indexOf(n) >= 0) && (i[n] = t[n]);
|
|
95
|
+
return i;
|
|
96
|
+
}
|
|
97
|
+
function ke(t) {
|
|
98
|
+
if (t === void 0)
|
|
99
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
100
|
+
return t;
|
|
101
|
+
}
|
|
102
|
+
var Ce = function() {
|
|
103
|
+
return "";
|
|
104
|
+
}, Ve = /* @__PURE__ */ g.createContext({
|
|
105
|
+
enqueueSnackbar: Ce,
|
|
106
|
+
closeSnackbar: Ce
|
|
107
|
+
}), O = {
|
|
108
|
+
downXs: "@media (max-width:599.95px)",
|
|
109
|
+
upSm: "@media (min-width:600px)"
|
|
110
|
+
}, ye = function(e) {
|
|
111
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
112
|
+
}, ge = function(e) {
|
|
113
|
+
return "" + ye(e.vertical) + ye(e.horizontal);
|
|
114
|
+
}, Q = function(e) {
|
|
115
|
+
return !!e || e === 0;
|
|
116
|
+
}, Y = "unmounted", W = "exited", H = "entering", $ = "entered", Se = "exiting", Ee = /* @__PURE__ */ (function(t) {
|
|
117
|
+
He(e, t);
|
|
118
|
+
function e(o) {
|
|
119
|
+
var n;
|
|
120
|
+
n = t.call(this, o) || this;
|
|
121
|
+
var r = o.appear, a;
|
|
122
|
+
return n.appearStatus = null, o.in ? r ? (a = W, n.appearStatus = H) : a = $ : o.unmountOnExit || o.mountOnEnter ? a = Y : a = W, n.state = {
|
|
123
|
+
status: a
|
|
124
|
+
}, n.nextCallback = null, n;
|
|
125
|
+
}
|
|
126
|
+
e.getDerivedStateFromProps = function(n, r) {
|
|
127
|
+
var a = n.in;
|
|
128
|
+
return a && r.status === Y ? {
|
|
129
|
+
status: W
|
|
130
|
+
} : null;
|
|
131
|
+
};
|
|
132
|
+
var i = e.prototype;
|
|
133
|
+
return i.componentDidMount = function() {
|
|
134
|
+
this.updateStatus(!0, this.appearStatus);
|
|
135
|
+
}, i.componentDidUpdate = function(n) {
|
|
136
|
+
var r = null;
|
|
137
|
+
if (n !== this.props) {
|
|
138
|
+
var a = this.state.status;
|
|
139
|
+
this.props.in ? a !== H && a !== $ && (r = H) : (a === H || a === $) && (r = Se);
|
|
140
|
+
}
|
|
141
|
+
this.updateStatus(!1, r);
|
|
142
|
+
}, i.componentWillUnmount = function() {
|
|
143
|
+
this.cancelNextCallback();
|
|
144
|
+
}, i.getTimeouts = function() {
|
|
145
|
+
var n = this.props.timeout, r = n, a = n;
|
|
146
|
+
return n != null && typeof n != "number" && typeof n != "string" && (a = n.exit, r = n.enter), {
|
|
147
|
+
exit: a,
|
|
148
|
+
enter: r
|
|
149
|
+
};
|
|
150
|
+
}, i.updateStatus = function(n, r) {
|
|
151
|
+
n === void 0 && (n = !1), r !== null ? (this.cancelNextCallback(), r === H ? this.performEnter(n) : this.performExit()) : this.props.unmountOnExit && this.state.status === W && this.setState({
|
|
152
|
+
status: Y
|
|
153
|
+
});
|
|
154
|
+
}, i.performEnter = function(n) {
|
|
155
|
+
var r = this, a = this.props.enter, s = n, l = this.getTimeouts();
|
|
156
|
+
if (!n && !a) {
|
|
157
|
+
this.safeSetState({
|
|
158
|
+
status: $
|
|
159
|
+
}, function() {
|
|
160
|
+
r.props.onEntered && r.props.onEntered(r.node, s);
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
this.props.onEnter && this.props.onEnter(this.node, s), this.safeSetState({
|
|
165
|
+
status: H
|
|
166
|
+
}, function() {
|
|
167
|
+
r.props.onEntering && r.props.onEntering(r.node, s), r.onTransitionEnd(l.enter, function() {
|
|
168
|
+
r.safeSetState({
|
|
169
|
+
status: $
|
|
170
|
+
}, function() {
|
|
171
|
+
r.props.onEntered && r.props.onEntered(r.node, s);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}, i.performExit = function() {
|
|
176
|
+
var n = this, r = this.props.exit, a = this.getTimeouts();
|
|
177
|
+
if (!r) {
|
|
178
|
+
this.safeSetState({
|
|
179
|
+
status: W
|
|
180
|
+
}, function() {
|
|
181
|
+
n.props.onExited && n.props.onExited(n.node);
|
|
182
|
+
});
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.props.onExit && this.props.onExit(this.node), this.safeSetState({
|
|
186
|
+
status: Se
|
|
187
|
+
}, function() {
|
|
188
|
+
n.props.onExiting && n.props.onExiting(n.node), n.onTransitionEnd(a.exit, function() {
|
|
189
|
+
n.safeSetState({
|
|
190
|
+
status: W
|
|
191
|
+
}, function() {
|
|
192
|
+
n.props.onExited && n.props.onExited(n.node);
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}, i.cancelNextCallback = function() {
|
|
197
|
+
this.nextCallback !== null && this.nextCallback.cancel && (this.nextCallback.cancel(), this.nextCallback = null);
|
|
198
|
+
}, i.safeSetState = function(n, r) {
|
|
199
|
+
r = this.setNextCallback(r), this.setState(n, r);
|
|
200
|
+
}, i.setNextCallback = function(n) {
|
|
201
|
+
var r = this, a = !0;
|
|
202
|
+
return this.nextCallback = function() {
|
|
203
|
+
a && (a = !1, r.nextCallback = null, n());
|
|
204
|
+
}, this.nextCallback.cancel = function() {
|
|
205
|
+
a = !1;
|
|
206
|
+
}, this.nextCallback;
|
|
207
|
+
}, i.onTransitionEnd = function(n, r) {
|
|
208
|
+
this.setNextCallback(r);
|
|
209
|
+
var a = n == null && !this.props.addEndListener;
|
|
210
|
+
if (!this.node || a) {
|
|
211
|
+
setTimeout(this.nextCallback, 0);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
this.props.addEndListener && this.props.addEndListener(this.node, this.nextCallback), n != null && setTimeout(this.nextCallback, n);
|
|
215
|
+
}, i.render = function() {
|
|
216
|
+
var n = this.state.status;
|
|
217
|
+
if (n === Y)
|
|
218
|
+
return null;
|
|
219
|
+
var r = this.props, a = r.children, s = G(r, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
220
|
+
return a(n, s);
|
|
221
|
+
}, We(e, [{
|
|
222
|
+
key: "node",
|
|
223
|
+
get: function() {
|
|
224
|
+
var n, r = (n = this.props.nodeRef) === null || n === void 0 ? void 0 : n.current;
|
|
225
|
+
if (!r)
|
|
226
|
+
throw new Error("notistack - Custom snackbar is not refForwarding");
|
|
227
|
+
return r;
|
|
228
|
+
}
|
|
229
|
+
}]), e;
|
|
230
|
+
})(g.Component);
|
|
231
|
+
function V() {
|
|
232
|
+
}
|
|
233
|
+
Ee.defaultProps = {
|
|
234
|
+
in: !1,
|
|
235
|
+
mountOnEnter: !1,
|
|
236
|
+
unmountOnExit: !1,
|
|
237
|
+
appear: !1,
|
|
238
|
+
enter: !0,
|
|
239
|
+
exit: !0,
|
|
240
|
+
onEnter: V,
|
|
241
|
+
onEntering: V,
|
|
242
|
+
onEntered: V,
|
|
243
|
+
onExit: V,
|
|
244
|
+
onExiting: V,
|
|
245
|
+
onExited: V
|
|
246
|
+
};
|
|
247
|
+
function we(t, e) {
|
|
248
|
+
typeof t == "function" ? t(e) : t && (t.current = e);
|
|
249
|
+
}
|
|
250
|
+
function pe(t, e) {
|
|
251
|
+
return he(function() {
|
|
252
|
+
return t == null && e == null ? null : function(i) {
|
|
253
|
+
we(t, i), we(e, i);
|
|
254
|
+
};
|
|
255
|
+
}, [t, e]);
|
|
256
|
+
}
|
|
257
|
+
function re(t) {
|
|
258
|
+
var e = t.timeout, i = t.style, o = i === void 0 ? {} : i, n = t.mode;
|
|
259
|
+
return {
|
|
260
|
+
duration: typeof e == "object" ? e[n] || 0 : e,
|
|
261
|
+
easing: o.transitionTimingFunction,
|
|
262
|
+
delay: o.transitionDelay
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
var ve = {
|
|
266
|
+
// This is the most common easing curve.
|
|
267
|
+
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
268
|
+
// Objects enter the screen at full velocity from off-screen and
|
|
269
|
+
// slowly decelerate to a resting point.
|
|
270
|
+
easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
|
|
271
|
+
// The sharp curve is used by objects that may return to the screen at any time.
|
|
272
|
+
sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
|
|
273
|
+
}, je = function(e) {
|
|
274
|
+
e.scrollTop = e.scrollTop;
|
|
275
|
+
}, Te = function(e) {
|
|
276
|
+
return Math.round(e) + "ms";
|
|
277
|
+
};
|
|
278
|
+
function j(t, e) {
|
|
279
|
+
t === void 0 && (t = ["all"]);
|
|
280
|
+
var i = e || {}, o = i.duration, n = o === void 0 ? 300 : o, r = i.easing, a = r === void 0 ? ve.easeInOut : r, s = i.delay, l = s === void 0 ? 0 : s, c = Array.isArray(t) ? t : [t];
|
|
281
|
+
return c.map(function(u) {
|
|
282
|
+
var d = typeof n == "string" ? n : Te(n), f = typeof l == "string" ? l : Te(l);
|
|
283
|
+
return u + " " + d + " " + a + " " + f;
|
|
284
|
+
}).join(",");
|
|
285
|
+
}
|
|
286
|
+
function pn(t) {
|
|
287
|
+
return t && t.ownerDocument || document;
|
|
288
|
+
}
|
|
289
|
+
function qe(t) {
|
|
290
|
+
var e = pn(t);
|
|
291
|
+
return e.defaultView || window;
|
|
292
|
+
}
|
|
293
|
+
function vn(t, e) {
|
|
294
|
+
e === void 0 && (e = 166);
|
|
295
|
+
var i;
|
|
296
|
+
function o() {
|
|
297
|
+
for (var n = this, r = arguments.length, a = new Array(r), s = 0; s < r; s++)
|
|
298
|
+
a[s] = arguments[s];
|
|
299
|
+
var l = function() {
|
|
300
|
+
t.apply(n, a);
|
|
301
|
+
};
|
|
302
|
+
clearTimeout(i), i = setTimeout(l, e);
|
|
303
|
+
}
|
|
304
|
+
return o.clear = function() {
|
|
305
|
+
clearTimeout(i);
|
|
306
|
+
}, o;
|
|
307
|
+
}
|
|
308
|
+
function hn(t, e) {
|
|
309
|
+
var i = e.getBoundingClientRect(), o = qe(e), n;
|
|
310
|
+
if (e.fakeTransform)
|
|
311
|
+
n = e.fakeTransform;
|
|
312
|
+
else {
|
|
313
|
+
var r = o.getComputedStyle(e);
|
|
314
|
+
n = r.getPropertyValue("-webkit-transform") || r.getPropertyValue("transform");
|
|
315
|
+
}
|
|
316
|
+
var a = 0, s = 0;
|
|
317
|
+
if (n && n !== "none" && typeof n == "string") {
|
|
318
|
+
var l = n.split("(")[1].split(")")[0].split(",");
|
|
319
|
+
a = parseInt(l[4], 10), s = parseInt(l[5], 10);
|
|
320
|
+
}
|
|
321
|
+
switch (t) {
|
|
322
|
+
case "left":
|
|
323
|
+
return "translateX(" + (o.innerWidth + a - i.left) + "px)";
|
|
324
|
+
case "right":
|
|
325
|
+
return "translateX(-" + (i.left + i.width - a) + "px)";
|
|
326
|
+
case "up":
|
|
327
|
+
return "translateY(" + (o.innerHeight + s - i.top) + "px)";
|
|
328
|
+
default:
|
|
329
|
+
return "translateY(-" + (i.top + i.height - s) + "px)";
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function J(t, e) {
|
|
333
|
+
if (e) {
|
|
334
|
+
var i = hn(t, e);
|
|
335
|
+
i && (e.style.webkitTransform = i, e.style.transform = i);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
var Fe = /* @__PURE__ */ F(function(t, e) {
|
|
339
|
+
var i = t.children, o = t.direction, n = o === void 0 ? "down" : o, r = t.in, a = t.style, s = t.timeout, l = s === void 0 ? 0 : s, c = t.onEnter, u = t.onEntered, d = t.onExit, f = t.onExited, x = G(t, ["children", "direction", "in", "style", "timeout", "onEnter", "onEntered", "onExit", "onExited"]), p = I(null), v = pe(i.ref, p), h = pe(v, e), k = function(E, T) {
|
|
340
|
+
J(n, E), je(E), c && c(E, T);
|
|
341
|
+
}, C = function(E) {
|
|
342
|
+
var T = (a == null ? void 0 : a.transitionTimingFunction) || ve.easeOut, D = re({
|
|
343
|
+
timeout: l,
|
|
344
|
+
mode: "enter",
|
|
345
|
+
style: m({}, a, {
|
|
346
|
+
transitionTimingFunction: T
|
|
347
|
+
})
|
|
348
|
+
});
|
|
349
|
+
E.style.webkitTransition = j("-webkit-transform", D), E.style.transition = j("transform", D), E.style.webkitTransform = "none", E.style.transform = "none";
|
|
350
|
+
}, b = function(E) {
|
|
351
|
+
var T = (a == null ? void 0 : a.transitionTimingFunction) || ve.sharp, D = re({
|
|
352
|
+
timeout: l,
|
|
353
|
+
mode: "exit",
|
|
354
|
+
style: m({}, a, {
|
|
355
|
+
transitionTimingFunction: T
|
|
356
|
+
})
|
|
357
|
+
});
|
|
358
|
+
E.style.webkitTransition = j("-webkit-transform", D), E.style.transition = j("transform", D), J(n, E), d && d(E);
|
|
359
|
+
}, w = function(E) {
|
|
360
|
+
E.style.webkitTransition = "", E.style.transition = "", f && f(E);
|
|
361
|
+
}, y = L(function() {
|
|
362
|
+
p.current && J(n, p.current);
|
|
363
|
+
}, [n]);
|
|
364
|
+
return R(function() {
|
|
365
|
+
if (!(r || n === "down" || n === "right")) {
|
|
366
|
+
var S = vn(function() {
|
|
367
|
+
p.current && J(n, p.current);
|
|
368
|
+
}), E = qe(p.current);
|
|
369
|
+
return E.addEventListener("resize", S), function() {
|
|
370
|
+
S.clear(), E.removeEventListener("resize", S);
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
}, [n, r]), R(function() {
|
|
374
|
+
r || y();
|
|
375
|
+
}, [r, y]), X(Ee, Object.assign({
|
|
376
|
+
appear: !0,
|
|
377
|
+
nodeRef: p,
|
|
378
|
+
onEnter: k,
|
|
379
|
+
onEntered: u,
|
|
380
|
+
onEntering: C,
|
|
381
|
+
onExit: b,
|
|
382
|
+
onExited: w,
|
|
383
|
+
in: r,
|
|
384
|
+
timeout: l
|
|
385
|
+
}, x), function(S, E) {
|
|
386
|
+
return Qe(i, m({
|
|
387
|
+
ref: h,
|
|
388
|
+
style: m({
|
|
389
|
+
visibility: S === "exited" && !r ? "hidden" : void 0
|
|
390
|
+
}, a, {}, i.props.style)
|
|
391
|
+
}, E));
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
Fe.displayName = "Slide";
|
|
395
|
+
var ie = function(e) {
|
|
396
|
+
return g.createElement("svg", Object.assign({
|
|
397
|
+
viewBox: "0 0 24 24",
|
|
398
|
+
focusable: "false",
|
|
399
|
+
style: {
|
|
400
|
+
fontSize: 20,
|
|
401
|
+
marginInlineEnd: 8,
|
|
402
|
+
userSelect: "none",
|
|
403
|
+
width: "1em",
|
|
404
|
+
height: "1em",
|
|
405
|
+
display: "inline-block",
|
|
406
|
+
fill: "currentColor",
|
|
407
|
+
flexShrink: 0
|
|
408
|
+
}
|
|
409
|
+
}, e));
|
|
410
|
+
}, mn = function() {
|
|
411
|
+
return g.createElement(ie, null, g.createElement("path", {
|
|
412
|
+
d: `M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
413
|
+
10.59L10 14.17L17.59 6.58L19 8L10 17Z`
|
|
414
|
+
}));
|
|
415
|
+
}, gn = function() {
|
|
416
|
+
return g.createElement(ie, null, g.createElement("path", {
|
|
417
|
+
d: "M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"
|
|
418
|
+
}));
|
|
419
|
+
}, En = function() {
|
|
420
|
+
return g.createElement(ie, null, g.createElement("path", {
|
|
421
|
+
d: `M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
|
|
422
|
+
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
|
|
423
|
+
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`
|
|
424
|
+
}));
|
|
425
|
+
}, xn = function() {
|
|
426
|
+
return g.createElement(ie, null, g.createElement("path", {
|
|
427
|
+
d: `M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|
|
428
|
+
0 22,12A10,10 0 0,0 12,2Z`
|
|
429
|
+
}));
|
|
430
|
+
}, bn = {
|
|
431
|
+
default: void 0,
|
|
432
|
+
success: /* @__PURE__ */ g.createElement(mn, null),
|
|
433
|
+
warning: /* @__PURE__ */ g.createElement(gn, null),
|
|
434
|
+
error: /* @__PURE__ */ g.createElement(En, null),
|
|
435
|
+
info: /* @__PURE__ */ g.createElement(xn, null)
|
|
436
|
+
}, A = {
|
|
437
|
+
maxSnack: 3,
|
|
438
|
+
persist: !1,
|
|
439
|
+
hideIconVariant: !1,
|
|
440
|
+
disableWindowBlurListener: !1,
|
|
441
|
+
variant: "default",
|
|
442
|
+
autoHideDuration: 5e3,
|
|
443
|
+
iconVariant: bn,
|
|
444
|
+
anchorOrigin: {
|
|
445
|
+
vertical: "bottom",
|
|
446
|
+
horizontal: "left"
|
|
447
|
+
},
|
|
448
|
+
TransitionComponent: Fe,
|
|
449
|
+
transitionDuration: {
|
|
450
|
+
enter: 225,
|
|
451
|
+
exit: 195
|
|
452
|
+
}
|
|
453
|
+
}, kn = function(e, i) {
|
|
454
|
+
var o = function(r) {
|
|
455
|
+
return typeof r == "number" || r === null;
|
|
456
|
+
};
|
|
457
|
+
return o(e) ? e : o(i) ? i : A.autoHideDuration;
|
|
458
|
+
}, Cn = function(e, i) {
|
|
459
|
+
var o = function(r, a) {
|
|
460
|
+
return a.some(function(s) {
|
|
461
|
+
return typeof r === s;
|
|
462
|
+
});
|
|
463
|
+
};
|
|
464
|
+
return o(e, ["string", "number"]) ? e : o(e, ["object"]) ? m({}, A.transitionDuration, {}, o(i, ["object"]) && i, {}, e) : o(i, ["string", "number"]) ? i : o(i, ["object"]) ? m({}, A.transitionDuration, {}, i) : A.transitionDuration;
|
|
465
|
+
}, yn = function(e, i) {
|
|
466
|
+
return function(o, n) {
|
|
467
|
+
return n === void 0 && (n = !1), n ? m({}, A[o], {}, i[o], {}, e[o]) : o === "autoHideDuration" ? kn(e.autoHideDuration, i.autoHideDuration) : o === "transitionDuration" ? Cn(e.transitionDuration, i.transitionDuration) : e[o] || i[o] || A[o];
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
function Z(t) {
|
|
471
|
+
return Object.entries(t).reduce(function(e, i) {
|
|
472
|
+
var o, n = i[0], r = i[1];
|
|
473
|
+
return m({}, e, (o = {}, o[n] = me(r), o));
|
|
474
|
+
}, {});
|
|
475
|
+
}
|
|
476
|
+
var q = {
|
|
477
|
+
SnackbarContainer: "notistack-SnackbarContainer",
|
|
478
|
+
Snackbar: "notistack-Snackbar",
|
|
479
|
+
CollapseWrapper: "notistack-CollapseWrapper",
|
|
480
|
+
MuiContent: "notistack-MuiContent",
|
|
481
|
+
MuiContentVariant: function(e) {
|
|
482
|
+
return "notistack-MuiContent-" + e;
|
|
483
|
+
}
|
|
484
|
+
}, De = /* @__PURE__ */ Z({
|
|
485
|
+
root: {
|
|
486
|
+
height: 0
|
|
487
|
+
},
|
|
488
|
+
entered: {
|
|
489
|
+
height: "auto"
|
|
490
|
+
}
|
|
491
|
+
}), se = "0px", ue = 175, $e = /* @__PURE__ */ F(function(t, e) {
|
|
492
|
+
var i = t.children, o = t.in, n = t.onExited, r = I(null), a = I(null), s = pe(e, a), l = function() {
|
|
493
|
+
return r.current ? r.current.clientHeight : 0;
|
|
494
|
+
}, c = function(v) {
|
|
495
|
+
v.style.height = se;
|
|
496
|
+
}, u = function(v) {
|
|
497
|
+
var h = l(), k = re({
|
|
498
|
+
timeout: ue,
|
|
499
|
+
mode: "enter"
|
|
500
|
+
}), C = k.duration, b = k.easing;
|
|
501
|
+
v.style.transitionDuration = typeof C == "string" ? C : C + "ms", v.style.height = h + "px", v.style.transitionTimingFunction = b || "";
|
|
502
|
+
}, d = function(v) {
|
|
503
|
+
v.style.height = "auto";
|
|
504
|
+
}, f = function(v) {
|
|
505
|
+
v.style.height = l() + "px";
|
|
506
|
+
}, x = function(v) {
|
|
507
|
+
je(v);
|
|
508
|
+
var h = re({
|
|
509
|
+
timeout: ue,
|
|
510
|
+
mode: "exit"
|
|
511
|
+
}), k = h.duration, C = h.easing;
|
|
512
|
+
v.style.transitionDuration = typeof k == "string" ? k : k + "ms", v.style.height = se, v.style.transitionTimingFunction = C || "";
|
|
513
|
+
};
|
|
514
|
+
return X(Ee, {
|
|
515
|
+
in: o,
|
|
516
|
+
unmountOnExit: !0,
|
|
517
|
+
onEnter: c,
|
|
518
|
+
onEntered: d,
|
|
519
|
+
onEntering: u,
|
|
520
|
+
onExit: f,
|
|
521
|
+
onExited: n,
|
|
522
|
+
onExiting: x,
|
|
523
|
+
nodeRef: a,
|
|
524
|
+
timeout: ue
|
|
525
|
+
}, function(p, v) {
|
|
526
|
+
return X("div", Object.assign({
|
|
527
|
+
ref: s,
|
|
528
|
+
className: M(De.root, p === "entered" && De.entered),
|
|
529
|
+
style: m({
|
|
530
|
+
pointerEvents: "all",
|
|
531
|
+
overflow: "hidden",
|
|
532
|
+
minHeight: se,
|
|
533
|
+
transition: j("height")
|
|
534
|
+
}, p === "entered" && {
|
|
535
|
+
overflow: "visible"
|
|
536
|
+
}, {}, p === "exited" && !o && {
|
|
537
|
+
visibility: "hidden"
|
|
538
|
+
})
|
|
539
|
+
}, v), X("div", {
|
|
540
|
+
ref: r,
|
|
541
|
+
className: q.CollapseWrapper,
|
|
542
|
+
// Hack to get children with a negative margin to not falsify the height computation.
|
|
543
|
+
style: {
|
|
544
|
+
display: "flex",
|
|
545
|
+
width: "100%"
|
|
546
|
+
}
|
|
547
|
+
}, i));
|
|
548
|
+
});
|
|
549
|
+
});
|
|
550
|
+
$e.displayName = "Collapse";
|
|
551
|
+
var Ne = {
|
|
552
|
+
right: "left",
|
|
553
|
+
left: "right",
|
|
554
|
+
bottom: "up",
|
|
555
|
+
top: "down"
|
|
556
|
+
}, Sn = function(e) {
|
|
557
|
+
return e.horizontal !== "center" ? Ne[e.horizontal] : Ne[e.vertical];
|
|
558
|
+
}, wn = function(e) {
|
|
559
|
+
return "anchorOrigin" + ge(e);
|
|
560
|
+
}, Tn = function(e) {
|
|
561
|
+
e === void 0 && (e = {});
|
|
562
|
+
var i = {
|
|
563
|
+
containerRoot: !0,
|
|
564
|
+
containerAnchorOriginTopCenter: !0,
|
|
565
|
+
containerAnchorOriginBottomCenter: !0,
|
|
566
|
+
containerAnchorOriginTopRight: !0,
|
|
567
|
+
containerAnchorOriginBottomRight: !0,
|
|
568
|
+
containerAnchorOriginTopLeft: !0,
|
|
569
|
+
containerAnchorOriginBottomLeft: !0
|
|
570
|
+
};
|
|
571
|
+
return Object.keys(e).filter(function(o) {
|
|
572
|
+
return !i[o];
|
|
573
|
+
}).reduce(function(o, n) {
|
|
574
|
+
var r;
|
|
575
|
+
return m({}, o, (r = {}, r[n] = e[n], r));
|
|
576
|
+
}, {});
|
|
577
|
+
}, Dn = function() {
|
|
578
|
+
};
|
|
579
|
+
function K(t, e) {
|
|
580
|
+
return t.reduce(function(i, o) {
|
|
581
|
+
return o == null ? i : function() {
|
|
582
|
+
for (var r = arguments.length, a = new Array(r), s = 0; s < r; s++)
|
|
583
|
+
a[s] = arguments[s];
|
|
584
|
+
var l = [].concat(a);
|
|
585
|
+
e && l.indexOf(e) === -1 && l.push(e), i.apply(this, l), o.apply(this, l);
|
|
586
|
+
};
|
|
587
|
+
}, Dn);
|
|
588
|
+
}
|
|
589
|
+
var Nn = typeof window < "u" ? Ye : R;
|
|
590
|
+
function _e(t) {
|
|
591
|
+
var e = I(t);
|
|
592
|
+
return Nn(function() {
|
|
593
|
+
e.current = t;
|
|
594
|
+
}), L(function() {
|
|
595
|
+
return (
|
|
596
|
+
// @ts-expect-error hide `this`
|
|
597
|
+
e.current.apply(void 0, arguments)
|
|
598
|
+
);
|
|
599
|
+
}, []);
|
|
600
|
+
}
|
|
601
|
+
var ze = /* @__PURE__ */ F(function(t, e) {
|
|
602
|
+
var i = t.children, o = t.className, n = t.autoHideDuration, r = t.disableWindowBlurListener, a = r === void 0 ? !1 : r, s = t.onClose, l = t.id, c = t.open, u = t.SnackbarProps, d = u === void 0 ? {} : u, f = I(), x = _e(function() {
|
|
603
|
+
s && s.apply(void 0, arguments);
|
|
604
|
+
}), p = _e(function(b) {
|
|
605
|
+
!s || b == null || (f.current && clearTimeout(f.current), f.current = setTimeout(function() {
|
|
606
|
+
x(null, "timeout", l);
|
|
607
|
+
}, b));
|
|
608
|
+
});
|
|
609
|
+
R(function() {
|
|
610
|
+
return c && p(n), function() {
|
|
611
|
+
f.current && clearTimeout(f.current);
|
|
612
|
+
};
|
|
613
|
+
}, [c, n, p]);
|
|
614
|
+
var v = function() {
|
|
615
|
+
f.current && clearTimeout(f.current);
|
|
616
|
+
}, h = L(function() {
|
|
617
|
+
n != null && p(n * 0.5);
|
|
618
|
+
}, [n, p]), k = function(w) {
|
|
619
|
+
d.onMouseEnter && d.onMouseEnter(w), v();
|
|
620
|
+
}, C = function(w) {
|
|
621
|
+
d.onMouseLeave && d.onMouseLeave(w), h();
|
|
622
|
+
};
|
|
623
|
+
return R(function() {
|
|
624
|
+
if (!a && c)
|
|
625
|
+
return window.addEventListener("focus", h), window.addEventListener("blur", v), function() {
|
|
626
|
+
window.removeEventListener("focus", h), window.removeEventListener("blur", v);
|
|
627
|
+
};
|
|
628
|
+
}, [a, h, c]), X("div", Object.assign({
|
|
629
|
+
ref: e
|
|
630
|
+
}, d, {
|
|
631
|
+
className: M(q.Snackbar, o),
|
|
632
|
+
onMouseEnter: k,
|
|
633
|
+
onMouseLeave: C
|
|
634
|
+
}), i);
|
|
635
|
+
});
|
|
636
|
+
ze.displayName = "Snackbar";
|
|
637
|
+
var ce, _n = /* @__PURE__ */ Z({
|
|
638
|
+
root: (ce = {
|
|
639
|
+
display: "flex",
|
|
640
|
+
flexWrap: "wrap",
|
|
641
|
+
flexGrow: 1
|
|
642
|
+
}, ce[O.upSm] = {
|
|
643
|
+
flexGrow: "initial",
|
|
644
|
+
minWidth: "288px"
|
|
645
|
+
}, ce)
|
|
646
|
+
}), Be = /* @__PURE__ */ F(function(t, e) {
|
|
647
|
+
var i = t.className, o = G(t, ["className"]);
|
|
648
|
+
return g.createElement("div", Object.assign({
|
|
649
|
+
ref: e,
|
|
650
|
+
className: M(_n.root, i)
|
|
651
|
+
}, o));
|
|
652
|
+
});
|
|
653
|
+
Be.displayName = "SnackbarContent";
|
|
654
|
+
var z = /* @__PURE__ */ Z({
|
|
655
|
+
root: {
|
|
656
|
+
backgroundColor: "#313131",
|
|
657
|
+
fontSize: "0.875rem",
|
|
658
|
+
lineHeight: 1.43,
|
|
659
|
+
letterSpacing: "0.01071em",
|
|
660
|
+
color: "#fff",
|
|
661
|
+
alignItems: "center",
|
|
662
|
+
padding: "6px 16px",
|
|
663
|
+
borderRadius: "4px",
|
|
664
|
+
boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"
|
|
665
|
+
},
|
|
666
|
+
lessPadding: {
|
|
667
|
+
paddingLeft: 8 * 2.5 + "px"
|
|
668
|
+
},
|
|
669
|
+
default: {
|
|
670
|
+
backgroundColor: "#313131"
|
|
671
|
+
},
|
|
672
|
+
success: {
|
|
673
|
+
backgroundColor: "#43a047"
|
|
674
|
+
},
|
|
675
|
+
error: {
|
|
676
|
+
backgroundColor: "#d32f2f"
|
|
677
|
+
},
|
|
678
|
+
warning: {
|
|
679
|
+
backgroundColor: "#ff9800"
|
|
680
|
+
},
|
|
681
|
+
info: {
|
|
682
|
+
backgroundColor: "#2196f3"
|
|
683
|
+
},
|
|
684
|
+
message: {
|
|
685
|
+
display: "flex",
|
|
686
|
+
alignItems: "center",
|
|
687
|
+
padding: "8px 0"
|
|
688
|
+
},
|
|
689
|
+
action: {
|
|
690
|
+
display: "flex",
|
|
691
|
+
alignItems: "center",
|
|
692
|
+
marginLeft: "auto",
|
|
693
|
+
paddingLeft: "16px",
|
|
694
|
+
marginRight: "-8px"
|
|
695
|
+
}
|
|
696
|
+
}), Le = "notistack-snackbar", Ue = /* @__PURE__ */ F(function(t, e) {
|
|
697
|
+
var i = t.id, o = t.message, n = t.action, r = t.iconVariant, a = t.variant, s = t.hideIconVariant, l = t.style, c = t.className, u = r[a], d = n;
|
|
698
|
+
return typeof d == "function" && (d = d(i)), g.createElement(Be, {
|
|
699
|
+
ref: e,
|
|
700
|
+
role: "alert",
|
|
701
|
+
"aria-describedby": Le,
|
|
702
|
+
style: l,
|
|
703
|
+
className: M(q.MuiContent, q.MuiContentVariant(a), z.root, z[a], c, !s && u && z.lessPadding)
|
|
704
|
+
}, g.createElement("div", {
|
|
705
|
+
id: Le,
|
|
706
|
+
className: z.message
|
|
707
|
+
}, s ? null : u, o), d && g.createElement("div", {
|
|
708
|
+
className: z.action
|
|
709
|
+
}, d));
|
|
710
|
+
});
|
|
711
|
+
Ue.displayName = "MaterialDesignContent";
|
|
712
|
+
var Ln = /* @__PURE__ */ Pe(Ue), In = /* @__PURE__ */ Z({
|
|
713
|
+
wrappedRoot: {
|
|
714
|
+
width: "100%",
|
|
715
|
+
position: "relative",
|
|
716
|
+
transform: "translateX(0)",
|
|
717
|
+
top: 0,
|
|
718
|
+
right: 0,
|
|
719
|
+
bottom: 0,
|
|
720
|
+
left: 0,
|
|
721
|
+
minWidth: "288px"
|
|
722
|
+
}
|
|
723
|
+
}), On = function(e) {
|
|
724
|
+
var i = I(), o = nn(!0), n = o[0], r = o[1], a = K([e.snack.onClose, e.onClose]), s = function() {
|
|
725
|
+
e.snack.requestClose && a(null, "instructed", e.snack.id);
|
|
726
|
+
}, l = L(function() {
|
|
727
|
+
i.current = setTimeout(function() {
|
|
728
|
+
r(function(D) {
|
|
729
|
+
return !D;
|
|
730
|
+
});
|
|
731
|
+
}, 125);
|
|
732
|
+
}, []);
|
|
733
|
+
R(function() {
|
|
734
|
+
return function() {
|
|
735
|
+
i.current && clearTimeout(i.current);
|
|
736
|
+
};
|
|
737
|
+
}, []);
|
|
738
|
+
var c = e.snack, u = e.classes, d = e.Component, f = d === void 0 ? Ln : d, x = he(function() {
|
|
739
|
+
return Tn(u);
|
|
740
|
+
}, [u]), p = c.open, v = c.SnackbarProps, h = c.TransitionComponent, k = c.TransitionProps, C = c.transitionDuration, b = c.disableWindowBlurListener, w = c.content, y = G(c, ["open", "SnackbarProps", "TransitionComponent", "TransitionProps", "transitionDuration", "disableWindowBlurListener", "content", "entered", "requestClose", "onEnter", "onEntered", "onExit", "onExited"]), S = m({
|
|
741
|
+
direction: Sn(y.anchorOrigin),
|
|
742
|
+
timeout: C
|
|
743
|
+
}, k), E = w;
|
|
744
|
+
typeof E == "function" && (E = E(y.id, y.message));
|
|
745
|
+
var T = ["onEnter", "onEntered", "onExit", "onExited"].reduce(function(D, ae) {
|
|
746
|
+
var oe;
|
|
747
|
+
return m({}, D, (oe = {}, oe[ae] = K([e.snack[ae], e[ae]], y.id), oe));
|
|
748
|
+
}, {});
|
|
749
|
+
return g.createElement($e, {
|
|
750
|
+
in: n,
|
|
751
|
+
onExited: T.onExited
|
|
752
|
+
}, g.createElement(ze, {
|
|
753
|
+
open: p,
|
|
754
|
+
id: y.id,
|
|
755
|
+
disableWindowBlurListener: b,
|
|
756
|
+
autoHideDuration: y.autoHideDuration,
|
|
757
|
+
className: M(In.wrappedRoot, x.root, x[wn(y.anchorOrigin)]),
|
|
758
|
+
SnackbarProps: v,
|
|
759
|
+
onClose: a
|
|
760
|
+
}, g.createElement(h, Object.assign({}, S, {
|
|
761
|
+
appear: !0,
|
|
762
|
+
in: p,
|
|
763
|
+
onExit: T.onExit,
|
|
764
|
+
onExited: l,
|
|
765
|
+
onEnter: T.onEnter,
|
|
766
|
+
// order matters. first callbacks.onEntered to set entered: true,
|
|
767
|
+
// then handleEntered to check if there's a request for closing
|
|
768
|
+
onEntered: K([T.onEntered, s], y.id)
|
|
769
|
+
}), E || g.createElement(f, Object.assign({}, y)))));
|
|
770
|
+
}, B, le, ee, ne, de, _ = {
|
|
771
|
+
view: {
|
|
772
|
+
default: 20
|
|
773
|
+
},
|
|
774
|
+
snackbar: {
|
|
775
|
+
default: 6,
|
|
776
|
+
dense: 2
|
|
777
|
+
}
|
|
778
|
+
}, Ie = "." + q.CollapseWrapper, fe = 16, te = /* @__PURE__ */ Z({
|
|
779
|
+
root: (B = {
|
|
780
|
+
boxSizing: "border-box",
|
|
781
|
+
display: "flex",
|
|
782
|
+
maxHeight: "100%",
|
|
783
|
+
position: "fixed",
|
|
784
|
+
zIndex: 1400,
|
|
785
|
+
height: "auto",
|
|
786
|
+
width: "auto",
|
|
787
|
+
transition: /* @__PURE__ */ j(["top", "right", "bottom", "left", "max-width"], {
|
|
788
|
+
duration: 300,
|
|
789
|
+
easing: "ease"
|
|
790
|
+
}),
|
|
791
|
+
// container itself is invisible and should not block clicks, clicks should be passed to its children
|
|
792
|
+
// a pointerEvents: all is applied in the collapse component
|
|
793
|
+
pointerEvents: "none"
|
|
794
|
+
}, B[Ie] = {
|
|
795
|
+
padding: _.snackbar.default + "px 0px",
|
|
796
|
+
transition: "padding 300ms ease 0ms"
|
|
797
|
+
}, B.maxWidth = "calc(100% - " + _.view.default * 2 + "px)", B[O.downXs] = {
|
|
798
|
+
width: "100%",
|
|
799
|
+
maxWidth: "calc(100% - " + fe * 2 + "px)"
|
|
800
|
+
}, B),
|
|
801
|
+
rootDense: (le = {}, le[Ie] = {
|
|
802
|
+
padding: _.snackbar.dense + "px 0px"
|
|
803
|
+
}, le),
|
|
804
|
+
top: {
|
|
805
|
+
top: _.view.default - _.snackbar.default + "px",
|
|
806
|
+
flexDirection: "column"
|
|
807
|
+
},
|
|
808
|
+
bottom: {
|
|
809
|
+
bottom: _.view.default - _.snackbar.default + "px",
|
|
810
|
+
flexDirection: "column-reverse"
|
|
811
|
+
},
|
|
812
|
+
left: (ee = {
|
|
813
|
+
left: _.view.default + "px"
|
|
814
|
+
}, ee[O.upSm] = {
|
|
815
|
+
alignItems: "flex-start"
|
|
816
|
+
}, ee[O.downXs] = {
|
|
817
|
+
left: fe + "px"
|
|
818
|
+
}, ee),
|
|
819
|
+
right: (ne = {
|
|
820
|
+
right: _.view.default + "px"
|
|
821
|
+
}, ne[O.upSm] = {
|
|
822
|
+
alignItems: "flex-end"
|
|
823
|
+
}, ne[O.downXs] = {
|
|
824
|
+
right: fe + "px"
|
|
825
|
+
}, ne),
|
|
826
|
+
center: (de = {
|
|
827
|
+
left: "50%",
|
|
828
|
+
transform: "translateX(-50%)"
|
|
829
|
+
}, de[O.upSm] = {
|
|
830
|
+
alignItems: "center"
|
|
831
|
+
}, de)
|
|
832
|
+
}), Pn = function(e) {
|
|
833
|
+
var i = e.classes, o = i === void 0 ? {} : i, n = e.anchorOrigin, r = e.dense, a = e.children, s = M(
|
|
834
|
+
q.SnackbarContainer,
|
|
835
|
+
te[n.vertical],
|
|
836
|
+
te[n.horizontal],
|
|
837
|
+
te.root,
|
|
838
|
+
// root should come after others to override maxWidth
|
|
839
|
+
o.containerRoot,
|
|
840
|
+
o["containerAnchorOrigin" + ge(n)],
|
|
841
|
+
r && te.rootDense
|
|
842
|
+
);
|
|
843
|
+
return g.createElement("div", {
|
|
844
|
+
className: s
|
|
845
|
+
}, a);
|
|
846
|
+
}, An = /* @__PURE__ */ Pe(Pn), Rn = process.env.NODE_ENV !== "production", Mn = {
|
|
847
|
+
NO_PERSIST_ALL: "Reached maxSnack while all enqueued snackbars have 'persist' flag. Notistack will dismiss the oldest snackbar anyway to allow other ones in the queue to be presented."
|
|
848
|
+
}, Wn = (function(t) {
|
|
849
|
+
if (Rn) {
|
|
850
|
+
var e = Mn[t];
|
|
851
|
+
typeof console < "u" && console.error("WARNING - notistack: " + e);
|
|
852
|
+
try {
|
|
853
|
+
throw new Error(e);
|
|
854
|
+
} catch {
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
}), Oe = function(e) {
|
|
858
|
+
var i = typeof e == "string" || en(e);
|
|
859
|
+
return !i;
|
|
860
|
+
}, Hn = /* @__PURE__ */ (function(t) {
|
|
861
|
+
He(e, t);
|
|
862
|
+
function e(o) {
|
|
863
|
+
var n;
|
|
864
|
+
return n = t.call(this, o) || this, n.enqueueSnackbar = function(r, a) {
|
|
865
|
+
if (a === void 0 && (a = {}), r == null)
|
|
866
|
+
throw new Error("enqueueSnackbar called with invalid argument");
|
|
867
|
+
var s = Oe(r) ? r : a, l = Oe(r) ? r.message : r, c = s.key, u = s.preventDuplicate, d = G(s, ["key", "preventDuplicate"]), f = Q(c), x = f ? c : (/* @__PURE__ */ new Date()).getTime() + Math.random(), p = yn(d, n.props), v = m({
|
|
868
|
+
id: x
|
|
869
|
+
}, d, {
|
|
870
|
+
message: l,
|
|
871
|
+
open: !0,
|
|
872
|
+
entered: !1,
|
|
873
|
+
requestClose: !1,
|
|
874
|
+
persist: p("persist"),
|
|
875
|
+
action: p("action"),
|
|
876
|
+
content: p("content"),
|
|
877
|
+
variant: p("variant"),
|
|
878
|
+
anchorOrigin: p("anchorOrigin"),
|
|
879
|
+
disableWindowBlurListener: p("disableWindowBlurListener"),
|
|
880
|
+
autoHideDuration: p("autoHideDuration"),
|
|
881
|
+
hideIconVariant: p("hideIconVariant"),
|
|
882
|
+
TransitionComponent: p("TransitionComponent"),
|
|
883
|
+
transitionDuration: p("transitionDuration"),
|
|
884
|
+
TransitionProps: p("TransitionProps", !0),
|
|
885
|
+
iconVariant: p("iconVariant", !0),
|
|
886
|
+
style: p("style", !0),
|
|
887
|
+
SnackbarProps: p("SnackbarProps", !0),
|
|
888
|
+
className: M(n.props.className, d.className)
|
|
889
|
+
});
|
|
890
|
+
return v.persist && (v.autoHideDuration = void 0), n.setState(function(h) {
|
|
891
|
+
if (u === void 0 && n.props.preventDuplicate || u) {
|
|
892
|
+
var k = function(y) {
|
|
893
|
+
return f ? y.id === x : y.message === l;
|
|
894
|
+
}, C = h.queue.findIndex(k) > -1, b = h.snacks.findIndex(k) > -1;
|
|
895
|
+
if (C || b)
|
|
896
|
+
return h;
|
|
897
|
+
}
|
|
898
|
+
return n.handleDisplaySnack(m({}, h, {
|
|
899
|
+
queue: [].concat(h.queue, [v])
|
|
900
|
+
}));
|
|
901
|
+
}), x;
|
|
902
|
+
}, n.handleDisplaySnack = function(r) {
|
|
903
|
+
var a = r.snacks;
|
|
904
|
+
return a.length >= n.maxSnack ? n.handleDismissOldest(r) : n.processQueue(r);
|
|
905
|
+
}, n.processQueue = function(r) {
|
|
906
|
+
var a = r.queue, s = r.snacks;
|
|
907
|
+
return a.length > 0 ? m({}, r, {
|
|
908
|
+
snacks: [].concat(s, [a[0]]),
|
|
909
|
+
queue: a.slice(1, a.length)
|
|
910
|
+
}) : r;
|
|
911
|
+
}, n.handleDismissOldest = function(r) {
|
|
912
|
+
if (r.snacks.some(function(u) {
|
|
913
|
+
return !u.open || u.requestClose;
|
|
914
|
+
}))
|
|
915
|
+
return r;
|
|
916
|
+
var a = !1, s = !1, l = r.snacks.reduce(function(u, d) {
|
|
917
|
+
return u + (d.open && d.persist ? 1 : 0);
|
|
918
|
+
}, 0);
|
|
919
|
+
l === n.maxSnack && (process.env.NODE_ENV !== "production" && Wn("NO_PERSIST_ALL"), s = !0);
|
|
920
|
+
var c = r.snacks.map(function(u) {
|
|
921
|
+
return !a && (!u.persist || s) ? (a = !0, u.entered ? (u.onClose && u.onClose(null, "maxsnack", u.id), n.props.onClose && n.props.onClose(null, "maxsnack", u.id), m({}, u, {
|
|
922
|
+
open: !1
|
|
923
|
+
})) : m({}, u, {
|
|
924
|
+
requestClose: !0
|
|
925
|
+
})) : m({}, u);
|
|
926
|
+
});
|
|
927
|
+
return m({}, r, {
|
|
928
|
+
snacks: c
|
|
929
|
+
});
|
|
930
|
+
}, n.handleEnteredSnack = function(r, a, s) {
|
|
931
|
+
if (!Q(s))
|
|
932
|
+
throw new Error("handleEnteredSnack Cannot be called with undefined key");
|
|
933
|
+
n.setState(function(l) {
|
|
934
|
+
var c = l.snacks;
|
|
935
|
+
return {
|
|
936
|
+
snacks: c.map(function(u) {
|
|
937
|
+
return u.id === s ? m({}, u, {
|
|
938
|
+
entered: !0
|
|
939
|
+
}) : m({}, u);
|
|
940
|
+
})
|
|
941
|
+
};
|
|
942
|
+
});
|
|
943
|
+
}, n.handleCloseSnack = function(r, a, s) {
|
|
944
|
+
n.props.onClose && n.props.onClose(r, a, s);
|
|
945
|
+
var l = s === void 0;
|
|
946
|
+
n.setState(function(c) {
|
|
947
|
+
var u = c.snacks, d = c.queue;
|
|
948
|
+
return {
|
|
949
|
+
snacks: u.map(function(f) {
|
|
950
|
+
return !l && f.id !== s ? m({}, f) : f.entered ? m({}, f, {
|
|
951
|
+
open: !1
|
|
952
|
+
}) : m({}, f, {
|
|
953
|
+
requestClose: !0
|
|
954
|
+
});
|
|
955
|
+
}),
|
|
956
|
+
queue: d.filter(function(f) {
|
|
957
|
+
return f.id !== s;
|
|
958
|
+
})
|
|
959
|
+
};
|
|
960
|
+
});
|
|
961
|
+
}, n.closeSnackbar = function(r) {
|
|
962
|
+
var a = n.state.snacks.find(function(s) {
|
|
963
|
+
return s.id === r;
|
|
964
|
+
});
|
|
965
|
+
Q(r) && a && a.onClose && a.onClose(null, "instructed", r), n.handleCloseSnack(null, "instructed", r);
|
|
966
|
+
}, n.handleExitedSnack = function(r, a) {
|
|
967
|
+
if (!Q(a))
|
|
968
|
+
throw new Error("handleExitedSnack Cannot be called with undefined key");
|
|
969
|
+
n.setState(function(s) {
|
|
970
|
+
var l = n.processQueue(m({}, s, {
|
|
971
|
+
snacks: s.snacks.filter(function(c) {
|
|
972
|
+
return c.id !== a;
|
|
973
|
+
})
|
|
974
|
+
}));
|
|
975
|
+
return l.queue.length === 0 ? l : n.handleDismissOldest(l);
|
|
976
|
+
});
|
|
977
|
+
}, n.enqueueSnackbar, n.closeSnackbar, n.state = {
|
|
978
|
+
snacks: [],
|
|
979
|
+
queue: [],
|
|
980
|
+
contextValue: {
|
|
981
|
+
enqueueSnackbar: n.enqueueSnackbar.bind(ke(n)),
|
|
982
|
+
closeSnackbar: n.closeSnackbar.bind(ke(n))
|
|
983
|
+
}
|
|
984
|
+
}, n;
|
|
985
|
+
}
|
|
986
|
+
var i = e.prototype;
|
|
987
|
+
return i.render = function() {
|
|
988
|
+
var n = this, r = this.state.contextValue, a = this.props, s = a.domRoot, l = a.children, c = a.dense, u = c === void 0 ? !1 : c, d = a.Components, f = d === void 0 ? {} : d, x = a.classes, p = this.state.snacks.reduce(function(h, k) {
|
|
989
|
+
var C, b = ge(k.anchorOrigin), w = h[b] || [];
|
|
990
|
+
return m({}, h, (C = {}, C[b] = [].concat(w, [k]), C));
|
|
991
|
+
}, {}), v = Object.keys(p).map(function(h) {
|
|
992
|
+
var k = p[h], C = k[0];
|
|
993
|
+
return g.createElement(An, {
|
|
994
|
+
key: h,
|
|
995
|
+
dense: u,
|
|
996
|
+
anchorOrigin: C.anchorOrigin,
|
|
997
|
+
classes: x
|
|
998
|
+
}, k.map(function(b) {
|
|
999
|
+
return g.createElement(On, {
|
|
1000
|
+
key: b.id,
|
|
1001
|
+
snack: b,
|
|
1002
|
+
classes: x,
|
|
1003
|
+
Component: f[b.variant],
|
|
1004
|
+
onClose: n.handleCloseSnack,
|
|
1005
|
+
onEnter: n.props.onEnter,
|
|
1006
|
+
onExit: n.props.onExit,
|
|
1007
|
+
onExited: K([n.handleExitedSnack, n.props.onExited], b.id),
|
|
1008
|
+
onEntered: K([n.handleEnteredSnack, n.props.onEntered], b.id)
|
|
1009
|
+
});
|
|
1010
|
+
}));
|
|
1011
|
+
});
|
|
1012
|
+
return g.createElement(Ve.Provider, {
|
|
1013
|
+
value: r
|
|
1014
|
+
}, l, s ? rn(v, s) : v);
|
|
1015
|
+
}, We(e, [{
|
|
1016
|
+
key: "maxSnack",
|
|
1017
|
+
get: function() {
|
|
1018
|
+
return this.props.maxSnack || A.maxSnack;
|
|
1019
|
+
}
|
|
1020
|
+
}]), e;
|
|
1021
|
+
})(Je), Vn = (function() {
|
|
1022
|
+
return tn(Ve);
|
|
1023
|
+
});
|
|
1024
|
+
const jn = Ae(null), Xe = Ae(null), qn = {
|
|
1025
|
+
vertical: "top",
|
|
1026
|
+
horizontal: "center"
|
|
1027
|
+
}, Fn = 3, $n = 3e3, zn = !0;
|
|
1028
|
+
function xe(t) {
|
|
1029
|
+
return F(function({
|
|
1030
|
+
message: i,
|
|
1031
|
+
id: o
|
|
1032
|
+
}, n) {
|
|
1033
|
+
const r = g.useContext(Xe);
|
|
1034
|
+
process.env.NODE_ENV !== "production" && !r && console.warn("ToastContent components must be used within ToastOptionsContext.Provider. Ensure ToastProvider wraps your application.");
|
|
1035
|
+
const a = r == null ? void 0 : r(o);
|
|
1036
|
+
return /* @__PURE__ */ U(an, { ref: n, type: t, label: String(i), noIcon: a == null ? void 0 : a.noIcon, noAlignment: !0 });
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
const Ke = xe("success");
|
|
1040
|
+
Ke.displayName = "SuccessToast";
|
|
1041
|
+
const Ge = xe("warning");
|
|
1042
|
+
Ge.displayName = "WarningToast";
|
|
1043
|
+
const Ze = xe("error");
|
|
1044
|
+
Ze.displayName = "ErrorToast";
|
|
1045
|
+
function Bn({
|
|
1046
|
+
children: t,
|
|
1047
|
+
toastOptionsStore: e,
|
|
1048
|
+
idMappingStore: i
|
|
1049
|
+
}) {
|
|
1050
|
+
const {
|
|
1051
|
+
enqueueSnackbar: o,
|
|
1052
|
+
closeSnackbar: n
|
|
1053
|
+
} = Vn(), r = L((c, u, d) => {
|
|
1054
|
+
try {
|
|
1055
|
+
const f = o(u, {
|
|
1056
|
+
variant: c,
|
|
1057
|
+
autoHideDuration: (d == null ? void 0 : d.duration) === 0 ? null : d == null ? void 0 : d.duration
|
|
1058
|
+
});
|
|
1059
|
+
d && e.current && e.current.set(f, d);
|
|
1060
|
+
const x = String(f);
|
|
1061
|
+
return i.current && i.current.set(x, f), x;
|
|
1062
|
+
} catch (f) {
|
|
1063
|
+
return console.error("Failed to show toast:", f), "";
|
|
1064
|
+
}
|
|
1065
|
+
}, [o, e, i]), a = L((c) => {
|
|
1066
|
+
var u, d, f, x, p;
|
|
1067
|
+
try {
|
|
1068
|
+
const v = (u = i.current) == null ? void 0 : u.get(c);
|
|
1069
|
+
if (v !== void 0) {
|
|
1070
|
+
n(v), (d = e.current) == null || d.delete(v), (f = i.current) == null || f.delete(c);
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
if (/^\d+$/.test(c)) {
|
|
1074
|
+
const h = Number(c);
|
|
1075
|
+
if (!Number.isNaN(h)) {
|
|
1076
|
+
n(h), (x = e.current) == null || x.delete(h);
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
n(c), (p = e.current) == null || p.delete(c);
|
|
1081
|
+
} catch (v) {
|
|
1082
|
+
console.error("Failed to close toast:", v);
|
|
1083
|
+
}
|
|
1084
|
+
}, [n, e, i]), s = L(() => {
|
|
1085
|
+
var c, u;
|
|
1086
|
+
try {
|
|
1087
|
+
n(), (c = e.current) == null || c.clear(), (u = i.current) == null || u.clear();
|
|
1088
|
+
} catch (d) {
|
|
1089
|
+
console.error("Failed to close all toasts:", d);
|
|
1090
|
+
}
|
|
1091
|
+
}, [n, e, i]), l = he(() => ({
|
|
1092
|
+
success: (c, u) => r("success", c, u),
|
|
1093
|
+
warning: (c, u) => r("warning", c, u),
|
|
1094
|
+
error: (c, u) => r("error", c, u),
|
|
1095
|
+
close: a,
|
|
1096
|
+
closeAll: s
|
|
1097
|
+
}), [r, a, s]);
|
|
1098
|
+
return /* @__PURE__ */ U(jn.Provider, { value: l, children: t });
|
|
1099
|
+
}
|
|
1100
|
+
function Zn({
|
|
1101
|
+
children: t,
|
|
1102
|
+
maxSnack: e = Fn,
|
|
1103
|
+
anchorOrigin: i = qn,
|
|
1104
|
+
autoHideDuration: o = $n,
|
|
1105
|
+
preventDuplicate: n = zn
|
|
1106
|
+
}) {
|
|
1107
|
+
const r = I(/* @__PURE__ */ new Map()), a = I(/* @__PURE__ */ new Map()), s = L((c) => {
|
|
1108
|
+
var u;
|
|
1109
|
+
return (u = r.current) == null ? void 0 : u.get(c);
|
|
1110
|
+
}, []), l = L((c, u) => {
|
|
1111
|
+
var f;
|
|
1112
|
+
(f = r.current) == null || f.delete(u);
|
|
1113
|
+
const d = a.current;
|
|
1114
|
+
if (d) {
|
|
1115
|
+
for (const [x, p] of d.entries())
|
|
1116
|
+
if (p === u) {
|
|
1117
|
+
d.delete(x);
|
|
1118
|
+
break;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}, []);
|
|
1122
|
+
return R(() => {
|
|
1123
|
+
const c = r.current, u = a.current;
|
|
1124
|
+
return () => {
|
|
1125
|
+
c.clear(), u.clear();
|
|
1126
|
+
};
|
|
1127
|
+
}, []), /* @__PURE__ */ U(Xe.Provider, { value: s, children: /* @__PURE__ */ U(Hn, { maxSnack: e, anchorOrigin: i, autoHideDuration: o, preventDuplicate: n, onExited: l, Components: {
|
|
1128
|
+
success: Ke,
|
|
1129
|
+
warning: Ge,
|
|
1130
|
+
error: Ze
|
|
1131
|
+
}, children: /* @__PURE__ */ U(Bn, { toastOptionsStore: r, idMappingStore: a, children: t }) }) });
|
|
1132
|
+
}
|
|
1133
|
+
export {
|
|
1134
|
+
Zn as T,
|
|
1135
|
+
jn as a
|
|
1136
|
+
};
|