@loopr-ai/craft 0.5.1 → 0.6.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.
@@ -1,3645 +1,60 @@
1
- import Dt, { jsx as N, jsxs as Ie, Fragment as Zr } from "react/jsx-runtime";
2
- import { o as Do, P as Ur, H as St, u as qr, j as Kr, k as Qr, G as No, n as mt, e as Gr, l as Nt, m as Mt } from "../../../createSvgIcon-4ecd3248.js";
3
- import * as E from "react";
4
- import Ne, { useRef as Ot, useImperativeHandle as Jr, useEffect as _t, useContext as eo, useState as Ir } from "react";
5
- import { s as en, _ as Se, a as T, P as l, h as tn, c as se, g as rt, e as et, f as on, C as rn } from "../../../createTheme-a4db2989.js";
6
- import { i as nn, u as an, c as Pe, j as sn, k as ln, b as nt, g as Wt, s as Oe, a as it } from "../../../styled-d4863b7f.js";
7
- import { c as un, T as pn } from "../../../useThemeWithoutDefault-188598a8.js";
8
- import { e as dn } from "../../../extendSxProp-db8b9da5.js";
9
- import { u as fn } from "../../../useTheme-3e8a77bb.js";
10
- import { c as Jo } from "../../../chainPropTypes-004bf492.js";
11
- import { r as Io, u as Kt, c as Mo, b as cn, a as vn } from "../../../TransitionGroupContext-fe9a562f.js";
12
- import { B as mn } from "../../../ButtonBase-262628d1.js";
13
- const hn = ["className", "component"];
14
- function gn(e = {}) {
15
- const {
16
- themeId: o,
17
- defaultTheme: t,
18
- defaultClassName: r = "MuiBox-root",
19
- generateClassName: n
20
- } = e, i = nn("div", {
21
- shouldForwardProp: (s) => s !== "theme" && s !== "sx" && s !== "as"
22
- })(en);
23
- return /* @__PURE__ */ E.forwardRef(function(u, d) {
24
- const p = an(t), f = dn(u), {
25
- className: c,
26
- component: v = "div"
27
- } = f, h = Se(f, hn);
28
- return /* @__PURE__ */ N(i, T({
29
- as: v,
30
- ref: d,
31
- className: Pe(c, n ? n(r) : r),
32
- theme: o && p[o] || p
33
- }, h));
34
- });
35
- }
36
- const bn = sn(), yn = bn, wn = ["className", "component", "disableGutters", "fixed", "maxWidth", "classes"], Pn = tn(), Tn = yn("div", {
37
- name: "MuiContainer",
38
- slot: "Root",
39
- overridesResolver: (e, o) => {
40
- const {
41
- ownerState: t
42
- } = e;
43
- return [o.root, o[`maxWidth${se(String(t.maxWidth))}`], t.fixed && o.fixed, t.disableGutters && o.disableGutters];
44
- }
45
- }), Cn = (e) => ln({
46
- props: e,
47
- name: "MuiContainer",
48
- defaultTheme: Pn
49
- }), Sn = (e, o) => {
50
- const t = (u) => rt(o, u), {
51
- classes: r,
52
- fixed: n,
53
- disableGutters: i,
54
- maxWidth: a
55
- } = e, s = {
56
- root: ["root", a && `maxWidth${se(String(a))}`, n && "fixed", i && "disableGutters"]
57
- };
58
- return nt(s, t, r);
59
- };
60
- function On(e = {}) {
61
- const {
62
- // This will allow adding custom styled fn (for example for custom sx style function)
63
- createStyledComponent: o = Tn,
64
- useThemeProps: t = Cn,
65
- componentName: r = "MuiContainer"
66
- } = e, n = o(({
67
- theme: a,
68
- ownerState: s
69
- }) => T({
70
- width: "100%",
71
- marginLeft: "auto",
72
- boxSizing: "border-box",
73
- marginRight: "auto",
74
- display: "block"
75
- }, !s.disableGutters && {
76
- paddingLeft: a.spacing(2),
77
- paddingRight: a.spacing(2),
78
- // @ts-ignore module augmentation fails if custom breakpoints are used
79
- [a.breakpoints.up("sm")]: {
80
- paddingLeft: a.spacing(3),
81
- paddingRight: a.spacing(3)
82
- }
83
- }), ({
84
- theme: a,
85
- ownerState: s
86
- }) => s.fixed && Object.keys(a.breakpoints.values).reduce((u, d) => {
87
- const p = d, f = a.breakpoints.values[p];
88
- return f !== 0 && (u[a.breakpoints.up(p)] = {
89
- maxWidth: `${f}${a.breakpoints.unit}`
90
- }), u;
91
- }, {}), ({
92
- theme: a,
93
- ownerState: s
94
- }) => T({}, s.maxWidth === "xs" && {
95
- // @ts-ignore module augmentation fails if custom breakpoints are used
96
- [a.breakpoints.up("xs")]: {
97
- // @ts-ignore module augmentation fails if custom breakpoints are used
98
- maxWidth: Math.max(a.breakpoints.values.xs, 444)
99
- }
100
- }, s.maxWidth && // @ts-ignore module augmentation fails if custom breakpoints are used
101
- s.maxWidth !== "xs" && {
102
- // @ts-ignore module augmentation fails if custom breakpoints are used
103
- [a.breakpoints.up(s.maxWidth)]: {
104
- // @ts-ignore module augmentation fails if custom breakpoints are used
105
- maxWidth: `${a.breakpoints.values[s.maxWidth]}${a.breakpoints.unit}`
106
- }
107
- })), i = /* @__PURE__ */ E.forwardRef(function(s, u) {
108
- const d = t(s), {
109
- className: p,
110
- component: f = "div",
111
- disableGutters: c = !1,
112
- fixed: v = !1,
113
- maxWidth: h = "lg"
114
- } = d, m = Se(d, wn), g = T({}, d, {
115
- component: f,
116
- disableGutters: c,
117
- fixed: v,
118
- maxWidth: h
119
- }), w = Sn(g, r);
120
- return (
121
- // @ts-ignore theme is injected by the styled util
122
- /* @__PURE__ */ N(n, T({
123
- as: f,
124
- ownerState: g,
125
- className: Pe(w.root, p),
126
- ref: u
127
- }, m))
128
- );
129
- });
130
- return process.env.NODE_ENV !== "production" && (i.propTypes = {
131
- children: l.node,
132
- classes: l.object,
133
- className: l.string,
134
- component: l.elementType,
135
- disableGutters: l.bool,
136
- fixed: l.bool,
137
- maxWidth: l.oneOfType([l.oneOf(["xs", "sm", "md", "lg", "xl", !1]), l.string]),
138
- sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object])
139
- }), i;
140
- }
141
- function En(e) {
142
- return rt("MuiIconButton", e);
143
- }
144
- const xn = Wt("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge"]), Rn = xn, An = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"], Dn = (e) => {
145
- const {
146
- classes: o,
147
- disabled: t,
148
- color: r,
149
- edge: n,
150
- size: i
151
- } = e, a = {
152
- root: ["root", t && "disabled", r !== "default" && `color${se(r)}`, n && `edge${se(n)}`, `size${se(i)}`]
153
- };
154
- return nt(a, En, o);
155
- }, Nn = Oe(mn, {
156
- name: "MuiIconButton",
157
- slot: "Root",
158
- overridesResolver: (e, o) => {
159
- const {
160
- ownerState: t
161
- } = e;
162
- return [o.root, t.color !== "default" && o[`color${se(t.color)}`], t.edge && o[`edge${se(t.edge)}`], o[`size${se(t.size)}`]];
163
- }
164
- })(({
165
- theme: e,
166
- ownerState: o
167
- }) => T({
168
- textAlign: "center",
169
- flex: "0 0 auto",
170
- fontSize: e.typography.pxToRem(24),
171
- padding: 8,
172
- borderRadius: "50%",
173
- overflow: "visible",
174
- // Explicitly set the default value to solve a bug on IE11.
175
- color: (e.vars || e).palette.action.active,
176
- transition: e.transitions.create("background-color", {
177
- duration: e.transitions.duration.shortest
178
- })
179
- }, !o.disableRipple && {
180
- "&:hover": {
181
- backgroundColor: e.vars ? `rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})` : et(e.palette.action.active, e.palette.action.hoverOpacity),
182
- // Reset on touch devices, it doesn't add specificity
183
- "@media (hover: none)": {
184
- backgroundColor: "transparent"
185
- }
186
- }
187
- }, o.edge === "start" && {
188
- marginLeft: o.size === "small" ? -3 : -12
189
- }, o.edge === "end" && {
190
- marginRight: o.size === "small" ? -3 : -12
191
- }), ({
192
- theme: e,
193
- ownerState: o
194
- }) => {
195
- var t;
196
- const r = (t = (e.vars || e).palette) == null ? void 0 : t[o.color];
197
- return T({}, o.color === "inherit" && {
198
- color: "inherit"
199
- }, o.color !== "inherit" && o.color !== "default" && T({
200
- color: r == null ? void 0 : r.main
201
- }, !o.disableRipple && {
202
- "&:hover": T({}, r && {
203
- backgroundColor: e.vars ? `rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})` : et(r.main, e.palette.action.hoverOpacity)
204
- }, {
205
- // Reset on touch devices, it doesn't add specificity
206
- "@media (hover: none)": {
207
- backgroundColor: "transparent"
208
- }
209
- })
210
- }), o.size === "small" && {
211
- padding: 5,
212
- fontSize: e.typography.pxToRem(18)
213
- }, o.size === "large" && {
214
- padding: 12,
215
- fontSize: e.typography.pxToRem(28)
216
- }, {
217
- [`&.${Rn.disabled}`]: {
218
- backgroundColor: "transparent",
219
- color: (e.vars || e).palette.action.disabled
220
- }
221
- });
222
- }), er = /* @__PURE__ */ E.forwardRef(function(o, t) {
223
- const r = it({
224
- props: o,
225
- name: "MuiIconButton"
226
- }), {
227
- edge: n = !1,
228
- children: i,
229
- className: a,
230
- color: s = "default",
231
- disabled: u = !1,
232
- disableFocusRipple: d = !1,
233
- size: p = "medium"
234
- } = r, f = Se(r, An), c = T({}, r, {
235
- edge: n,
236
- color: s,
237
- disabled: u,
238
- disableFocusRipple: d,
239
- size: p
240
- }), v = Dn(c);
241
- return /* @__PURE__ */ N(Nn, T({
242
- className: Pe(v.root, a),
243
- centerRipple: !0,
244
- focusRipple: !d,
245
- disabled: u,
246
- ref: t,
247
- ownerState: c
248
- }, f, {
249
- children: i
250
- }));
251
- });
252
- process.env.NODE_ENV !== "production" && (er.propTypes = {
253
- // ----------------------------- Warning --------------------------------
254
- // | These PropTypes are generated from the TypeScript type definitions |
255
- // | To update them edit the d.ts file and run "yarn proptypes" |
256
- // ----------------------------------------------------------------------
257
- /**
258
- * The icon to display.
259
- */
260
- children: Jo(l.node, (e) => E.Children.toArray(e.children).some((t) => /* @__PURE__ */ E.isValidElement(t) && t.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
261
- `)) : null),
262
- /**
263
- * Override or extend the styles applied to the component.
264
- */
265
- classes: l.object,
266
- /**
267
- * @ignore
268
- */
269
- className: l.string,
270
- /**
271
- * The color of the component.
272
- * It supports both default and custom theme colors, which can be added as shown in the
273
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
274
- * @default 'default'
275
- */
276
- color: l.oneOfType([l.oneOf(["inherit", "default", "primary", "secondary", "error", "info", "success", "warning"]), l.string]),
277
- /**
278
- * If `true`, the component is disabled.
279
- * @default false
280
- */
281
- disabled: l.bool,
282
- /**
283
- * If `true`, the keyboard focus ripple is disabled.
284
- * @default false
285
- */
286
- disableFocusRipple: l.bool,
287
- /**
288
- * If `true`, the ripple effect is disabled.
289
- *
290
- * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
291
- * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
292
- * @default false
293
- */
294
- disableRipple: l.bool,
295
- /**
296
- * If given, uses a negative margin to counteract the padding on one
297
- * side (this is often helpful for aligning the left or right
298
- * side of the icon with content above or below, without ruining the border
299
- * size and shape).
300
- * @default false
301
- */
302
- edge: l.oneOf(["end", "start", !1]),
303
- /**
304
- * The size of the component.
305
- * `small` is equivalent to the dense button styling.
306
- * @default 'medium'
307
- */
308
- size: l.oneOfType([l.oneOf(["small", "medium", "large"]), l.string]),
309
- /**
310
- * The system prop that allows defining system overrides as well as additional CSS styles.
311
- */
312
- sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object])
313
- });
314
- const ht = er, Mn = {
315
- disableDefaultClasses: !1
316
- }, _n = /* @__PURE__ */ E.createContext(Mn);
317
- function Wn(e) {
318
- const {
319
- disableDefaultClasses: o
320
- } = E.useContext(_n);
321
- return (t) => o ? "" : e(t);
322
- }
323
- var H = "top", re = "bottom", ne = "right", F = "left", to = "auto", at = [H, re, ne, F], Be = "start", tt = "end", $n = "clippingParents", tr = "viewport", qe = "popper", Yn = "reference", _o = /* @__PURE__ */ at.reduce(function(e, o) {
324
- return e.concat([o + "-" + Be, o + "-" + tt]);
325
- }, []), or = /* @__PURE__ */ [].concat(at, [to]).reduce(function(e, o) {
326
- return e.concat([o, o + "-" + Be, o + "-" + tt]);
327
- }, []), Bn = "beforeRead", kn = "read", zn = "afterRead", Xn = "beforeMain", jn = "main", Ln = "afterMain", Vn = "beforeWrite", Hn = "write", Fn = "afterWrite", Zn = [Bn, kn, zn, Xn, jn, Ln, Vn, Hn, Fn];
328
- function ve(e) {
329
- return e ? (e.nodeName || "").toLowerCase() : null;
330
- }
331
- function J(e) {
332
- if (e == null)
333
- return window;
334
- if (e.toString() !== "[object Window]") {
335
- var o = e.ownerDocument;
336
- return o && o.defaultView || window;
337
- }
338
- return e;
339
- }
340
- function Me(e) {
341
- var o = J(e).Element;
342
- return e instanceof o || e instanceof Element;
343
- }
344
- function oe(e) {
345
- var o = J(e).HTMLElement;
346
- return e instanceof o || e instanceof HTMLElement;
347
- }
348
- function oo(e) {
349
- if (typeof ShadowRoot > "u")
350
- return !1;
351
- var o = J(e).ShadowRoot;
352
- return e instanceof o || e instanceof ShadowRoot;
353
- }
354
- function Un(e) {
355
- var o = e.state;
356
- Object.keys(o.elements).forEach(function(t) {
357
- var r = o.styles[t] || {}, n = o.attributes[t] || {}, i = o.elements[t];
358
- !oe(i) || !ve(i) || (Object.assign(i.style, r), Object.keys(n).forEach(function(a) {
359
- var s = n[a];
360
- s === !1 ? i.removeAttribute(a) : i.setAttribute(a, s === !0 ? "" : s);
361
- }));
362
- });
363
- }
364
- function qn(e) {
365
- var o = e.state, t = {
366
- popper: {
367
- position: o.options.strategy,
368
- left: "0",
369
- top: "0",
370
- margin: "0"
371
- },
372
- arrow: {
373
- position: "absolute"
374
- },
375
- reference: {}
376
- };
377
- return Object.assign(o.elements.popper.style, t.popper), o.styles = t, o.elements.arrow && Object.assign(o.elements.arrow.style, t.arrow), function() {
378
- Object.keys(o.elements).forEach(function(r) {
379
- var n = o.elements[r], i = o.attributes[r] || {}, a = Object.keys(o.styles.hasOwnProperty(r) ? o.styles[r] : t[r]), s = a.reduce(function(u, d) {
380
- return u[d] = "", u;
381
- }, {});
382
- !oe(n) || !ve(n) || (Object.assign(n.style, s), Object.keys(i).forEach(function(u) {
383
- n.removeAttribute(u);
384
- }));
385
- });
386
- };
387
- }
388
- const Kn = {
389
- name: "applyStyles",
390
- enabled: !0,
391
- phase: "write",
392
- fn: Un,
393
- effect: qn,
394
- requires: ["computeStyles"]
395
- };
396
- function ce(e) {
397
- return e.split("-")[0];
398
- }
399
- var De = Math.max, Et = Math.min, ke = Math.round;
400
- function Qt() {
401
- var e = navigator.userAgentData;
402
- return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(o) {
403
- return o.brand + "/" + o.version;
404
- }).join(" ") : navigator.userAgent;
405
- }
406
- function rr() {
407
- return !/^((?!chrome|android).)*safari/i.test(Qt());
408
- }
409
- function ze(e, o, t) {
410
- o === void 0 && (o = !1), t === void 0 && (t = !1);
411
- var r = e.getBoundingClientRect(), n = 1, i = 1;
412
- o && oe(e) && (n = e.offsetWidth > 0 && ke(r.width) / e.offsetWidth || 1, i = e.offsetHeight > 0 && ke(r.height) / e.offsetHeight || 1);
413
- var a = Me(e) ? J(e) : window, s = a.visualViewport, u = !rr() && t, d = (r.left + (u && s ? s.offsetLeft : 0)) / n, p = (r.top + (u && s ? s.offsetTop : 0)) / i, f = r.width / n, c = r.height / i;
414
- return {
415
- width: f,
416
- height: c,
417
- top: p,
418
- right: d + f,
419
- bottom: p + c,
420
- left: d,
421
- x: d,
422
- y: p
423
- };
424
- }
425
- function ro(e) {
426
- var o = ze(e), t = e.offsetWidth, r = e.offsetHeight;
427
- return Math.abs(o.width - t) <= 1 && (t = o.width), Math.abs(o.height - r) <= 1 && (r = o.height), {
428
- x: e.offsetLeft,
429
- y: e.offsetTop,
430
- width: t,
431
- height: r
432
- };
433
- }
434
- function nr(e, o) {
435
- var t = o.getRootNode && o.getRootNode();
436
- if (e.contains(o))
437
- return !0;
438
- if (t && oo(t)) {
439
- var r = o;
440
- do {
441
- if (r && e.isSameNode(r))
442
- return !0;
443
- r = r.parentNode || r.host;
444
- } while (r);
445
- }
446
- return !1;
447
- }
448
- function be(e) {
449
- return J(e).getComputedStyle(e);
450
- }
451
- function Qn(e) {
452
- return ["table", "td", "th"].indexOf(ve(e)) >= 0;
453
- }
454
- function Ee(e) {
455
- return ((Me(e) ? e.ownerDocument : (
456
- // $FlowFixMe[prop-missing]
457
- e.document
458
- )) || window.document).documentElement;
459
- }
460
- function $t(e) {
461
- return ve(e) === "html" ? e : (
462
- // this is a quicker (but less type safe) way to save quite some bytes from the bundle
463
- // $FlowFixMe[incompatible-return]
464
- // $FlowFixMe[prop-missing]
465
- e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
466
- e.parentNode || // DOM Element detected
467
- (oo(e) ? e.host : null) || // ShadowRoot detected
468
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
469
- Ee(e)
470
- );
471
- }
472
- function Wo(e) {
473
- return !oe(e) || // https://github.com/popperjs/popper-core/issues/837
474
- be(e).position === "fixed" ? null : e.offsetParent;
475
- }
476
- function Gn(e) {
477
- var o = /firefox/i.test(Qt()), t = /Trident/i.test(Qt());
478
- if (t && oe(e)) {
479
- var r = be(e);
480
- if (r.position === "fixed")
481
- return null;
482
- }
483
- var n = $t(e);
484
- for (oo(n) && (n = n.host); oe(n) && ["html", "body"].indexOf(ve(n)) < 0; ) {
485
- var i = be(n);
486
- if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || o && i.willChange === "filter" || o && i.filter && i.filter !== "none")
487
- return n;
488
- n = n.parentNode;
489
- }
490
- return null;
491
- }
492
- function st(e) {
493
- for (var o = J(e), t = Wo(e); t && Qn(t) && be(t).position === "static"; )
494
- t = Wo(t);
495
- return t && (ve(t) === "html" || ve(t) === "body" && be(t).position === "static") ? o : t || Gn(e) || o;
496
- }
497
- function no(e) {
498
- return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
499
- }
500
- function Ge(e, o, t) {
501
- return De(e, Et(o, t));
502
- }
503
- function Jn(e, o, t) {
504
- var r = Ge(e, o, t);
505
- return r > t ? t : r;
506
- }
507
- function ir() {
508
- return {
509
- top: 0,
510
- right: 0,
511
- bottom: 0,
512
- left: 0
513
- };
514
- }
515
- function ar(e) {
516
- return Object.assign({}, ir(), e);
517
- }
518
- function sr(e, o) {
519
- return o.reduce(function(t, r) {
520
- return t[r] = e, t;
521
- }, {});
522
- }
523
- var In = function(o, t) {
524
- return o = typeof o == "function" ? o(Object.assign({}, t.rects, {
525
- placement: t.placement
526
- })) : o, ar(typeof o != "number" ? o : sr(o, at));
527
- };
528
- function ei(e) {
529
- var o, t = e.state, r = e.name, n = e.options, i = t.elements.arrow, a = t.modifiersData.popperOffsets, s = ce(t.placement), u = no(s), d = [F, ne].indexOf(s) >= 0, p = d ? "height" : "width";
530
- if (!(!i || !a)) {
531
- var f = In(n.padding, t), c = ro(i), v = u === "y" ? H : F, h = u === "y" ? re : ne, m = t.rects.reference[p] + t.rects.reference[u] - a[u] - t.rects.popper[p], g = a[u] - t.rects.reference[u], w = st(i), S = w ? u === "y" ? w.clientHeight || 0 : w.clientWidth || 0 : 0, y = m / 2 - g / 2, b = f[v], P = S - c[p] - f[h], C = S / 2 - c[p] / 2 + y, O = Ge(b, C, P), D = u;
532
- t.modifiersData[r] = (o = {}, o[D] = O, o.centerOffset = O - C, o);
533
- }
534
- }
535
- function ti(e) {
536
- var o = e.state, t = e.options, r = t.element, n = r === void 0 ? "[data-popper-arrow]" : r;
537
- n != null && (typeof n == "string" && (n = o.elements.popper.querySelector(n), !n) || nr(o.elements.popper, n) && (o.elements.arrow = n));
538
- }
539
- const oi = {
540
- name: "arrow",
541
- enabled: !0,
542
- phase: "main",
543
- fn: ei,
544
- effect: ti,
545
- requires: ["popperOffsets"],
546
- requiresIfExists: ["preventOverflow"]
547
- };
548
- function Xe(e) {
549
- return e.split("-")[1];
550
- }
551
- var ri = {
552
- top: "auto",
553
- right: "auto",
554
- bottom: "auto",
555
- left: "auto"
556
- };
557
- function ni(e, o) {
558
- var t = e.x, r = e.y, n = o.devicePixelRatio || 1;
559
- return {
560
- x: ke(t * n) / n || 0,
561
- y: ke(r * n) / n || 0
562
- };
563
- }
564
- function $o(e) {
565
- var o, t = e.popper, r = e.popperRect, n = e.placement, i = e.variation, a = e.offsets, s = e.position, u = e.gpuAcceleration, d = e.adaptive, p = e.roundOffsets, f = e.isFixed, c = a.x, v = c === void 0 ? 0 : c, h = a.y, m = h === void 0 ? 0 : h, g = typeof p == "function" ? p({
566
- x: v,
567
- y: m
568
- }) : {
569
- x: v,
570
- y: m
571
- };
572
- v = g.x, m = g.y;
573
- var w = a.hasOwnProperty("x"), S = a.hasOwnProperty("y"), y = F, b = H, P = window;
574
- if (d) {
575
- var C = st(t), O = "clientHeight", D = "clientWidth";
576
- if (C === J(t) && (C = Ee(t), be(C).position !== "static" && s === "absolute" && (O = "scrollHeight", D = "scrollWidth")), C = C, n === H || (n === F || n === ne) && i === tt) {
577
- b = re;
578
- var x = f && C === P && P.visualViewport ? P.visualViewport.height : (
579
- // $FlowFixMe[prop-missing]
580
- C[O]
581
- );
582
- m -= x - r.height, m *= u ? 1 : -1;
583
- }
584
- if (n === F || (n === H || n === re) && i === tt) {
585
- y = ne;
586
- var R = f && C === P && P.visualViewport ? P.visualViewport.width : (
587
- // $FlowFixMe[prop-missing]
588
- C[D]
589
- );
590
- v -= R - r.width, v *= u ? 1 : -1;
591
- }
592
- }
593
- var M = Object.assign({
594
- position: s
595
- }, d && ri), B = p === !0 ? ni({
596
- x: v,
597
- y: m
598
- }, J(t)) : {
599
- x: v,
600
- y: m
601
- };
602
- if (v = B.x, m = B.y, u) {
603
- var W;
604
- return Object.assign({}, M, (W = {}, W[b] = S ? "0" : "", W[y] = w ? "0" : "", W.transform = (P.devicePixelRatio || 1) <= 1 ? "translate(" + v + "px, " + m + "px)" : "translate3d(" + v + "px, " + m + "px, 0)", W));
605
- }
606
- return Object.assign({}, M, (o = {}, o[b] = S ? m + "px" : "", o[y] = w ? v + "px" : "", o.transform = "", o));
607
- }
608
- function ii(e) {
609
- var o = e.state, t = e.options, r = t.gpuAcceleration, n = r === void 0 ? !0 : r, i = t.adaptive, a = i === void 0 ? !0 : i, s = t.roundOffsets, u = s === void 0 ? !0 : s, d = {
610
- placement: ce(o.placement),
611
- variation: Xe(o.placement),
612
- popper: o.elements.popper,
613
- popperRect: o.rects.popper,
614
- gpuAcceleration: n,
615
- isFixed: o.options.strategy === "fixed"
616
- };
617
- o.modifiersData.popperOffsets != null && (o.styles.popper = Object.assign({}, o.styles.popper, $o(Object.assign({}, d, {
618
- offsets: o.modifiersData.popperOffsets,
619
- position: o.options.strategy,
620
- adaptive: a,
621
- roundOffsets: u
622
- })))), o.modifiersData.arrow != null && (o.styles.arrow = Object.assign({}, o.styles.arrow, $o(Object.assign({}, d, {
623
- offsets: o.modifiersData.arrow,
624
- position: "absolute",
625
- adaptive: !1,
626
- roundOffsets: u
627
- })))), o.attributes.popper = Object.assign({}, o.attributes.popper, {
628
- "data-popper-placement": o.placement
629
- });
630
- }
631
- const ai = {
632
- name: "computeStyles",
633
- enabled: !0,
634
- phase: "beforeWrite",
635
- fn: ii,
636
- data: {}
637
- };
638
- var gt = {
639
- passive: !0
640
- };
641
- function si(e) {
642
- var o = e.state, t = e.instance, r = e.options, n = r.scroll, i = n === void 0 ? !0 : n, a = r.resize, s = a === void 0 ? !0 : a, u = J(o.elements.popper), d = [].concat(o.scrollParents.reference, o.scrollParents.popper);
643
- return i && d.forEach(function(p) {
644
- p.addEventListener("scroll", t.update, gt);
645
- }), s && u.addEventListener("resize", t.update, gt), function() {
646
- i && d.forEach(function(p) {
647
- p.removeEventListener("scroll", t.update, gt);
648
- }), s && u.removeEventListener("resize", t.update, gt);
649
- };
650
- }
651
- const li = {
652
- name: "eventListeners",
653
- enabled: !0,
654
- phase: "write",
655
- fn: function() {
656
- },
657
- effect: si,
658
- data: {}
659
- };
660
- var ui = {
661
- left: "right",
662
- right: "left",
663
- bottom: "top",
664
- top: "bottom"
665
- };
666
- function Tt(e) {
667
- return e.replace(/left|right|bottom|top/g, function(o) {
668
- return ui[o];
669
- });
670
- }
671
- var pi = {
672
- start: "end",
673
- end: "start"
674
- };
675
- function Yo(e) {
676
- return e.replace(/start|end/g, function(o) {
677
- return pi[o];
678
- });
679
- }
680
- function io(e) {
681
- var o = J(e), t = o.pageXOffset, r = o.pageYOffset;
682
- return {
683
- scrollLeft: t,
684
- scrollTop: r
685
- };
686
- }
687
- function ao(e) {
688
- return ze(Ee(e)).left + io(e).scrollLeft;
689
- }
690
- function di(e, o) {
691
- var t = J(e), r = Ee(e), n = t.visualViewport, i = r.clientWidth, a = r.clientHeight, s = 0, u = 0;
692
- if (n) {
693
- i = n.width, a = n.height;
694
- var d = rr();
695
- (d || !d && o === "fixed") && (s = n.offsetLeft, u = n.offsetTop);
696
- }
697
- return {
698
- width: i,
699
- height: a,
700
- x: s + ao(e),
701
- y: u
702
- };
703
- }
704
- function fi(e) {
705
- var o, t = Ee(e), r = io(e), n = (o = e.ownerDocument) == null ? void 0 : o.body, i = De(t.scrollWidth, t.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), a = De(t.scrollHeight, t.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s = -r.scrollLeft + ao(e), u = -r.scrollTop;
706
- return be(n || t).direction === "rtl" && (s += De(t.clientWidth, n ? n.clientWidth : 0) - i), {
707
- width: i,
708
- height: a,
709
- x: s,
710
- y: u
711
- };
712
- }
713
- function so(e) {
714
- var o = be(e), t = o.overflow, r = o.overflowX, n = o.overflowY;
715
- return /auto|scroll|overlay|hidden/.test(t + n + r);
716
- }
717
- function lr(e) {
718
- return ["html", "body", "#document"].indexOf(ve(e)) >= 0 ? e.ownerDocument.body : oe(e) && so(e) ? e : lr($t(e));
719
- }
720
- function Je(e, o) {
721
- var t;
722
- o === void 0 && (o = []);
723
- var r = lr(e), n = r === ((t = e.ownerDocument) == null ? void 0 : t.body), i = J(r), a = n ? [i].concat(i.visualViewport || [], so(r) ? r : []) : r, s = o.concat(a);
724
- return n ? s : (
725
- // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
726
- s.concat(Je($t(a)))
727
- );
728
- }
729
- function Gt(e) {
730
- return Object.assign({}, e, {
731
- left: e.x,
732
- top: e.y,
733
- right: e.x + e.width,
734
- bottom: e.y + e.height
735
- });
736
- }
737
- function ci(e, o) {
738
- var t = ze(e, !1, o === "fixed");
739
- return t.top = t.top + e.clientTop, t.left = t.left + e.clientLeft, t.bottom = t.top + e.clientHeight, t.right = t.left + e.clientWidth, t.width = e.clientWidth, t.height = e.clientHeight, t.x = t.left, t.y = t.top, t;
740
- }
741
- function Bo(e, o, t) {
742
- return o === tr ? Gt(di(e, t)) : Me(o) ? ci(o, t) : Gt(fi(Ee(e)));
743
- }
744
- function vi(e) {
745
- var o = Je($t(e)), t = ["absolute", "fixed"].indexOf(be(e).position) >= 0, r = t && oe(e) ? st(e) : e;
746
- return Me(r) ? o.filter(function(n) {
747
- return Me(n) && nr(n, r) && ve(n) !== "body";
748
- }) : [];
749
- }
750
- function mi(e, o, t, r) {
751
- var n = o === "clippingParents" ? vi(e) : [].concat(o), i = [].concat(n, [t]), a = i[0], s = i.reduce(function(u, d) {
752
- var p = Bo(e, d, r);
753
- return u.top = De(p.top, u.top), u.right = Et(p.right, u.right), u.bottom = Et(p.bottom, u.bottom), u.left = De(p.left, u.left), u;
754
- }, Bo(e, a, r));
755
- return s.width = s.right - s.left, s.height = s.bottom - s.top, s.x = s.left, s.y = s.top, s;
756
- }
757
- function ur(e) {
758
- var o = e.reference, t = e.element, r = e.placement, n = r ? ce(r) : null, i = r ? Xe(r) : null, a = o.x + o.width / 2 - t.width / 2, s = o.y + o.height / 2 - t.height / 2, u;
759
- switch (n) {
760
- case H:
761
- u = {
762
- x: a,
763
- y: o.y - t.height
764
- };
765
- break;
766
- case re:
767
- u = {
768
- x: a,
769
- y: o.y + o.height
770
- };
771
- break;
772
- case ne:
773
- u = {
774
- x: o.x + o.width,
775
- y: s
776
- };
777
- break;
778
- case F:
779
- u = {
780
- x: o.x - t.width,
781
- y: s
782
- };
783
- break;
784
- default:
785
- u = {
786
- x: o.x,
787
- y: o.y
788
- };
789
- }
790
- var d = n ? no(n) : null;
791
- if (d != null) {
792
- var p = d === "y" ? "height" : "width";
793
- switch (i) {
794
- case Be:
795
- u[d] = u[d] - (o[p] / 2 - t[p] / 2);
796
- break;
797
- case tt:
798
- u[d] = u[d] + (o[p] / 2 - t[p] / 2);
799
- break;
800
- }
801
- }
802
- return u;
803
- }
804
- function ot(e, o) {
805
- o === void 0 && (o = {});
806
- var t = o, r = t.placement, n = r === void 0 ? e.placement : r, i = t.strategy, a = i === void 0 ? e.strategy : i, s = t.boundary, u = s === void 0 ? $n : s, d = t.rootBoundary, p = d === void 0 ? tr : d, f = t.elementContext, c = f === void 0 ? qe : f, v = t.altBoundary, h = v === void 0 ? !1 : v, m = t.padding, g = m === void 0 ? 0 : m, w = ar(typeof g != "number" ? g : sr(g, at)), S = c === qe ? Yn : qe, y = e.rects.popper, b = e.elements[h ? S : c], P = mi(Me(b) ? b : b.contextElement || Ee(e.elements.popper), u, p, a), C = ze(e.elements.reference), O = ur({
807
- reference: C,
808
- element: y,
809
- strategy: "absolute",
810
- placement: n
811
- }), D = Gt(Object.assign({}, y, O)), x = c === qe ? D : C, R = {
812
- top: P.top - x.top + w.top,
813
- bottom: x.bottom - P.bottom + w.bottom,
814
- left: P.left - x.left + w.left,
815
- right: x.right - P.right + w.right
816
- }, M = e.modifiersData.offset;
817
- if (c === qe && M) {
818
- var B = M[n];
819
- Object.keys(R).forEach(function(W) {
820
- var Z = [ne, re].indexOf(W) >= 0 ? 1 : -1, U = [H, re].indexOf(W) >= 0 ? "y" : "x";
821
- R[W] += B[U] * Z;
822
- });
823
- }
824
- return R;
825
- }
826
- function hi(e, o) {
827
- o === void 0 && (o = {});
828
- var t = o, r = t.placement, n = t.boundary, i = t.rootBoundary, a = t.padding, s = t.flipVariations, u = t.allowedAutoPlacements, d = u === void 0 ? or : u, p = Xe(r), f = p ? s ? _o : _o.filter(function(h) {
829
- return Xe(h) === p;
830
- }) : at, c = f.filter(function(h) {
831
- return d.indexOf(h) >= 0;
832
- });
833
- c.length === 0 && (c = f);
834
- var v = c.reduce(function(h, m) {
835
- return h[m] = ot(e, {
836
- placement: m,
837
- boundary: n,
838
- rootBoundary: i,
839
- padding: a
840
- })[ce(m)], h;
841
- }, {});
842
- return Object.keys(v).sort(function(h, m) {
843
- return v[h] - v[m];
844
- });
845
- }
846
- function gi(e) {
847
- if (ce(e) === to)
848
- return [];
849
- var o = Tt(e);
850
- return [Yo(e), o, Yo(o)];
851
- }
852
- function bi(e) {
853
- var o = e.state, t = e.options, r = e.name;
854
- if (!o.modifiersData[r]._skip) {
855
- for (var n = t.mainAxis, i = n === void 0 ? !0 : n, a = t.altAxis, s = a === void 0 ? !0 : a, u = t.fallbackPlacements, d = t.padding, p = t.boundary, f = t.rootBoundary, c = t.altBoundary, v = t.flipVariations, h = v === void 0 ? !0 : v, m = t.allowedAutoPlacements, g = o.options.placement, w = ce(g), S = w === g, y = u || (S || !h ? [Tt(g)] : gi(g)), b = [g].concat(y).reduce(function(K, Q) {
856
- return K.concat(ce(Q) === to ? hi(o, {
857
- placement: Q,
858
- boundary: p,
859
- rootBoundary: f,
860
- padding: d,
861
- flipVariations: h,
862
- allowedAutoPlacements: m
863
- }) : Q);
864
- }, []), P = o.rects.reference, C = o.rects.popper, O = /* @__PURE__ */ new Map(), D = !0, x = b[0], R = 0; R < b.length; R++) {
865
- var M = b[R], B = ce(M), W = Xe(M) === Be, Z = [H, re].indexOf(B) >= 0, U = Z ? "width" : "height", $ = ot(o, {
866
- placement: M,
867
- boundary: p,
868
- rootBoundary: f,
869
- altBoundary: c,
870
- padding: d
871
- }), k = Z ? W ? ne : F : W ? re : H;
872
- P[U] > C[U] && (k = Tt(k));
873
- var z = Tt(k), q = [];
874
- if (i && q.push($[B] <= 0), s && q.push($[k] <= 0, $[z] <= 0), q.every(function(K) {
875
- return K;
876
- })) {
877
- x = M, D = !1;
878
- break;
879
- }
880
- O.set(M, q);
881
- }
882
- if (D)
883
- for (var ye = h ? 3 : 1, le = function(Q) {
884
- var ue = b.find(function(pe) {
885
- var X = O.get(pe);
886
- if (X)
887
- return X.slice(0, Q).every(function(L) {
888
- return L;
889
- });
890
- });
891
- if (ue)
892
- return x = ue, "break";
893
- }, me = ye; me > 0; me--) {
894
- var ie = le(me);
895
- if (ie === "break")
896
- break;
897
- }
898
- o.placement !== x && (o.modifiersData[r]._skip = !0, o.placement = x, o.reset = !0);
899
- }
900
- }
901
- const yi = {
902
- name: "flip",
903
- enabled: !0,
904
- phase: "main",
905
- fn: bi,
906
- requiresIfExists: ["offset"],
907
- data: {
908
- _skip: !1
909
- }
910
- };
911
- function ko(e, o, t) {
912
- return t === void 0 && (t = {
913
- x: 0,
914
- y: 0
915
- }), {
916
- top: e.top - o.height - t.y,
917
- right: e.right - o.width + t.x,
918
- bottom: e.bottom - o.height + t.y,
919
- left: e.left - o.width - t.x
920
- };
921
- }
922
- function zo(e) {
923
- return [H, ne, re, F].some(function(o) {
924
- return e[o] >= 0;
925
- });
926
- }
927
- function wi(e) {
928
- var o = e.state, t = e.name, r = o.rects.reference, n = o.rects.popper, i = o.modifiersData.preventOverflow, a = ot(o, {
929
- elementContext: "reference"
930
- }), s = ot(o, {
931
- altBoundary: !0
932
- }), u = ko(a, r), d = ko(s, n, i), p = zo(u), f = zo(d);
933
- o.modifiersData[t] = {
934
- referenceClippingOffsets: u,
935
- popperEscapeOffsets: d,
936
- isReferenceHidden: p,
937
- hasPopperEscaped: f
938
- }, o.attributes.popper = Object.assign({}, o.attributes.popper, {
939
- "data-popper-reference-hidden": p,
940
- "data-popper-escaped": f
941
- });
942
- }
943
- const Pi = {
944
- name: "hide",
945
- enabled: !0,
946
- phase: "main",
947
- requiresIfExists: ["preventOverflow"],
948
- fn: wi
949
- };
950
- function Ti(e, o, t) {
951
- var r = ce(e), n = [F, H].indexOf(r) >= 0 ? -1 : 1, i = typeof t == "function" ? t(Object.assign({}, o, {
952
- placement: e
953
- })) : t, a = i[0], s = i[1];
954
- return a = a || 0, s = (s || 0) * n, [F, ne].indexOf(r) >= 0 ? {
955
- x: s,
956
- y: a
957
- } : {
958
- x: a,
959
- y: s
960
- };
961
- }
962
- function Ci(e) {
963
- var o = e.state, t = e.options, r = e.name, n = t.offset, i = n === void 0 ? [0, 0] : n, a = or.reduce(function(p, f) {
964
- return p[f] = Ti(f, o.rects, i), p;
965
- }, {}), s = a[o.placement], u = s.x, d = s.y;
966
- o.modifiersData.popperOffsets != null && (o.modifiersData.popperOffsets.x += u, o.modifiersData.popperOffsets.y += d), o.modifiersData[r] = a;
967
- }
968
- const Si = {
969
- name: "offset",
970
- enabled: !0,
971
- phase: "main",
972
- requires: ["popperOffsets"],
973
- fn: Ci
974
- };
975
- function Oi(e) {
976
- var o = e.state, t = e.name;
977
- o.modifiersData[t] = ur({
978
- reference: o.rects.reference,
979
- element: o.rects.popper,
980
- strategy: "absolute",
981
- placement: o.placement
982
- });
983
- }
984
- const Ei = {
985
- name: "popperOffsets",
986
- enabled: !0,
987
- phase: "read",
988
- fn: Oi,
989
- data: {}
990
- };
991
- function xi(e) {
992
- return e === "x" ? "y" : "x";
993
- }
994
- function Ri(e) {
995
- var o = e.state, t = e.options, r = e.name, n = t.mainAxis, i = n === void 0 ? !0 : n, a = t.altAxis, s = a === void 0 ? !1 : a, u = t.boundary, d = t.rootBoundary, p = t.altBoundary, f = t.padding, c = t.tether, v = c === void 0 ? !0 : c, h = t.tetherOffset, m = h === void 0 ? 0 : h, g = ot(o, {
996
- boundary: u,
997
- rootBoundary: d,
998
- padding: f,
999
- altBoundary: p
1000
- }), w = ce(o.placement), S = Xe(o.placement), y = !S, b = no(w), P = xi(b), C = o.modifiersData.popperOffsets, O = o.rects.reference, D = o.rects.popper, x = typeof m == "function" ? m(Object.assign({}, o.rects, {
1001
- placement: o.placement
1002
- })) : m, R = typeof x == "number" ? {
1003
- mainAxis: x,
1004
- altAxis: x
1005
- } : Object.assign({
1006
- mainAxis: 0,
1007
- altAxis: 0
1008
- }, x), M = o.modifiersData.offset ? o.modifiersData.offset[o.placement] : null, B = {
1009
- x: 0,
1010
- y: 0
1011
- };
1012
- if (C) {
1013
- if (i) {
1014
- var W, Z = b === "y" ? H : F, U = b === "y" ? re : ne, $ = b === "y" ? "height" : "width", k = C[b], z = k + g[Z], q = k - g[U], ye = v ? -D[$] / 2 : 0, le = S === Be ? O[$] : D[$], me = S === Be ? -D[$] : -O[$], ie = o.elements.arrow, K = v && ie ? ro(ie) : {
1015
- width: 0,
1016
- height: 0
1017
- }, Q = o.modifiersData["arrow#persistent"] ? o.modifiersData["arrow#persistent"].padding : ir(), ue = Q[Z], pe = Q[U], X = Ge(0, O[$], K[$]), L = y ? O[$] / 2 - ye - X - ue - R.mainAxis : le - X - ue - R.mainAxis, he = y ? -O[$] / 2 + ye + X + pe + R.mainAxis : me + X + pe + R.mainAxis, j = o.elements.arrow && st(o.elements.arrow), Le = j ? b === "y" ? j.clientTop || 0 : j.clientLeft || 0 : 0, _e = (W = M == null ? void 0 : M[b]) != null ? W : 0, ut = k + L - _e - Le, I = k + he - _e, We = Ge(v ? Et(z, ut) : z, k, v ? De(q, I) : q);
1018
- C[b] = We, B[b] = We - k;
1019
- }
1020
- if (s) {
1021
- var pt, V = b === "x" ? H : F, dt = b === "x" ? re : ne, ae = C[P], $e = P === "y" ? "height" : "width", Re = ae + g[V], Ye = ae - g[dt], we = [H, F].indexOf(w) !== -1, Ae = (pt = M == null ? void 0 : M[P]) != null ? pt : 0, de = we ? Re : ae - O[$e] - D[$e] - Ae + R.altAxis, Ve = we ? ae + O[$e] + D[$e] - Ae - R.altAxis : Ye, ft = v && we ? Jn(de, ae, Ve) : Ge(v ? de : Re, ae, v ? Ve : Ye);
1022
- C[P] = ft, B[P] = ft - ae;
1023
- }
1024
- o.modifiersData[r] = B;
1025
- }
1026
- }
1027
- const Ai = {
1028
- name: "preventOverflow",
1029
- enabled: !0,
1030
- phase: "main",
1031
- fn: Ri,
1032
- requiresIfExists: ["offset"]
1033
- };
1034
- function Di(e) {
1035
- return {
1036
- scrollLeft: e.scrollLeft,
1037
- scrollTop: e.scrollTop
1038
- };
1039
- }
1040
- function Ni(e) {
1041
- return e === J(e) || !oe(e) ? io(e) : Di(e);
1042
- }
1043
- function Mi(e) {
1044
- var o = e.getBoundingClientRect(), t = ke(o.width) / e.offsetWidth || 1, r = ke(o.height) / e.offsetHeight || 1;
1045
- return t !== 1 || r !== 1;
1046
- }
1047
- function _i(e, o, t) {
1048
- t === void 0 && (t = !1);
1049
- var r = oe(o), n = oe(o) && Mi(o), i = Ee(o), a = ze(e, n, t), s = {
1050
- scrollLeft: 0,
1051
- scrollTop: 0
1052
- }, u = {
1053
- x: 0,
1054
- y: 0
1055
- };
1056
- return (r || !r && !t) && ((ve(o) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1057
- so(i)) && (s = Ni(o)), oe(o) ? (u = ze(o, !0), u.x += o.clientLeft, u.y += o.clientTop) : i && (u.x = ao(i))), {
1058
- x: a.left + s.scrollLeft - u.x,
1059
- y: a.top + s.scrollTop - u.y,
1060
- width: a.width,
1061
- height: a.height
1062
- };
1063
- }
1064
- function Wi(e) {
1065
- var o = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), r = [];
1066
- e.forEach(function(i) {
1067
- o.set(i.name, i);
1068
- });
1069
- function n(i) {
1070
- t.add(i.name);
1071
- var a = [].concat(i.requires || [], i.requiresIfExists || []);
1072
- a.forEach(function(s) {
1073
- if (!t.has(s)) {
1074
- var u = o.get(s);
1075
- u && n(u);
1076
- }
1077
- }), r.push(i);
1078
- }
1079
- return e.forEach(function(i) {
1080
- t.has(i.name) || n(i);
1081
- }), r;
1082
- }
1083
- function $i(e) {
1084
- var o = Wi(e);
1085
- return Zn.reduce(function(t, r) {
1086
- return t.concat(o.filter(function(n) {
1087
- return n.phase === r;
1088
- }));
1089
- }, []);
1090
- }
1091
- function Yi(e) {
1092
- var o;
1093
- return function() {
1094
- return o || (o = new Promise(function(t) {
1095
- Promise.resolve().then(function() {
1096
- o = void 0, t(e());
1097
- });
1098
- })), o;
1099
- };
1100
- }
1101
- function Bi(e) {
1102
- var o = e.reduce(function(t, r) {
1103
- var n = t[r.name];
1104
- return t[r.name] = n ? Object.assign({}, n, r, {
1105
- options: Object.assign({}, n.options, r.options),
1106
- data: Object.assign({}, n.data, r.data)
1107
- }) : r, t;
1108
- }, {});
1109
- return Object.keys(o).map(function(t) {
1110
- return o[t];
1111
- });
1112
- }
1113
- var Xo = {
1114
- placement: "bottom",
1115
- modifiers: [],
1116
- strategy: "absolute"
1117
- };
1118
- function jo() {
1119
- for (var e = arguments.length, o = new Array(e), t = 0; t < e; t++)
1120
- o[t] = arguments[t];
1121
- return !o.some(function(r) {
1122
- return !(r && typeof r.getBoundingClientRect == "function");
1123
- });
1124
- }
1125
- function ki(e) {
1126
- e === void 0 && (e = {});
1127
- var o = e, t = o.defaultModifiers, r = t === void 0 ? [] : t, n = o.defaultOptions, i = n === void 0 ? Xo : n;
1128
- return function(s, u, d) {
1129
- d === void 0 && (d = i);
1130
- var p = {
1131
- placement: "bottom",
1132
- orderedModifiers: [],
1133
- options: Object.assign({}, Xo, i),
1134
- modifiersData: {},
1135
- elements: {
1136
- reference: s,
1137
- popper: u
1138
- },
1139
- attributes: {},
1140
- styles: {}
1141
- }, f = [], c = !1, v = {
1142
- state: p,
1143
- setOptions: function(w) {
1144
- var S = typeof w == "function" ? w(p.options) : w;
1145
- m(), p.options = Object.assign({}, i, p.options, S), p.scrollParents = {
1146
- reference: Me(s) ? Je(s) : s.contextElement ? Je(s.contextElement) : [],
1147
- popper: Je(u)
1148
- };
1149
- var y = $i(Bi([].concat(r, p.options.modifiers)));
1150
- return p.orderedModifiers = y.filter(function(b) {
1151
- return b.enabled;
1152
- }), h(), v.update();
1153
- },
1154
- // Sync update – it will always be executed, even if not necessary. This
1155
- // is useful for low frequency updates where sync behavior simplifies the
1156
- // logic.
1157
- // For high frequency updates (e.g. `resize` and `scroll` events), always
1158
- // prefer the async Popper#update method
1159
- forceUpdate: function() {
1160
- if (!c) {
1161
- var w = p.elements, S = w.reference, y = w.popper;
1162
- if (jo(S, y)) {
1163
- p.rects = {
1164
- reference: _i(S, st(y), p.options.strategy === "fixed"),
1165
- popper: ro(y)
1166
- }, p.reset = !1, p.placement = p.options.placement, p.orderedModifiers.forEach(function(R) {
1167
- return p.modifiersData[R.name] = Object.assign({}, R.data);
1168
- });
1169
- for (var b = 0; b < p.orderedModifiers.length; b++) {
1170
- if (p.reset === !0) {
1171
- p.reset = !1, b = -1;
1172
- continue;
1173
- }
1174
- var P = p.orderedModifiers[b], C = P.fn, O = P.options, D = O === void 0 ? {} : O, x = P.name;
1175
- typeof C == "function" && (p = C({
1176
- state: p,
1177
- options: D,
1178
- name: x,
1179
- instance: v
1180
- }) || p);
1181
- }
1182
- }
1183
- }
1184
- },
1185
- // Async and optimistically optimized update – it will not be executed if
1186
- // not necessary (debounced to run at most once-per-tick)
1187
- update: Yi(function() {
1188
- return new Promise(function(g) {
1189
- v.forceUpdate(), g(p);
1190
- });
1191
- }),
1192
- destroy: function() {
1193
- m(), c = !0;
1194
- }
1195
- };
1196
- if (!jo(s, u))
1197
- return v;
1198
- v.setOptions(d).then(function(g) {
1199
- !c && d.onFirstUpdate && d.onFirstUpdate(g);
1200
- });
1201
- function h() {
1202
- p.orderedModifiers.forEach(function(g) {
1203
- var w = g.name, S = g.options, y = S === void 0 ? {} : S, b = g.effect;
1204
- if (typeof b == "function") {
1205
- var P = b({
1206
- state: p,
1207
- name: w,
1208
- instance: v,
1209
- options: y
1210
- }), C = function() {
1211
- };
1212
- f.push(P || C);
1213
- }
1214
- });
1215
- }
1216
- function m() {
1217
- f.forEach(function(g) {
1218
- return g();
1219
- }), f = [];
1220
- }
1221
- return v;
1222
- };
1223
- }
1224
- var zi = [li, Ei, ai, Kn, Si, yi, Ai, oi, Pi], Xi = /* @__PURE__ */ ki({
1225
- defaultModifiers: zi
1226
- });
1227
- function ji(e) {
1228
- return rt("MuiPopper", e);
1229
- }
1230
- Wt("MuiPopper", ["root"]);
1231
- const Li = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"], Vi = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
1232
- function Hi(e, o) {
1233
- if (o === "ltr")
1234
- return e;
1235
- switch (e) {
1236
- case "bottom-end":
1237
- return "bottom-start";
1238
- case "bottom-start":
1239
- return "bottom-end";
1240
- case "top-end":
1241
- return "top-start";
1242
- case "top-start":
1243
- return "top-end";
1244
- default:
1245
- return e;
1246
- }
1247
- }
1248
- function xt(e) {
1249
- return typeof e == "function" ? e() : e;
1250
- }
1251
- function Yt(e) {
1252
- return e.nodeType !== void 0;
1253
- }
1254
- function Fi(e) {
1255
- return !Yt(e);
1256
- }
1257
- const Zi = () => nt({
1258
- root: ["root"]
1259
- }, Wn(ji)), Ui = {}, qi = /* @__PURE__ */ E.forwardRef(function(o, t) {
1260
- var r;
1261
- const {
1262
- anchorEl: n,
1263
- children: i,
1264
- direction: a,
1265
- disablePortal: s,
1266
- modifiers: u,
1267
- open: d,
1268
- placement: p,
1269
- popperOptions: f,
1270
- popperRef: c,
1271
- slotProps: v = {},
1272
- slots: h = {},
1273
- TransitionProps: m
1274
- // @ts-ignore internal logic
1275
- // prevent from spreading to DOM, it can come from the parent component e.g. Select.
1276
- } = o, g = Se(o, Li), w = E.useRef(null), S = Kt(w, t), y = E.useRef(null), b = Kt(y, c), P = E.useRef(b);
1277
- Mo(() => {
1278
- P.current = b;
1279
- }, [b]), E.useImperativeHandle(c, () => y.current, []);
1280
- const C = Hi(p, a), [O, D] = E.useState(C), [x, R] = E.useState(xt(n));
1281
- E.useEffect(() => {
1282
- y.current && y.current.forceUpdate();
1283
- }), E.useEffect(() => {
1284
- n && R(xt(n));
1285
- }, [n]), Mo(() => {
1286
- if (!x || !d)
1287
- return;
1288
- const U = (z) => {
1289
- D(z.placement);
1290
- };
1291
- if (process.env.NODE_ENV !== "production" && x && Yt(x) && x.nodeType === 1) {
1292
- const z = x.getBoundingClientRect();
1293
- process.env.NODE_ENV !== "test" && z.top === 0 && z.left === 0 && z.right === 0 && z.bottom === 0 && console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
1294
- `));
1295
- }
1296
- let $ = [{
1297
- name: "preventOverflow",
1298
- options: {
1299
- altBoundary: s
1300
- }
1301
- }, {
1302
- name: "flip",
1303
- options: {
1304
- altBoundary: s
1305
- }
1306
- }, {
1307
- name: "onUpdate",
1308
- enabled: !0,
1309
- phase: "afterWrite",
1310
- fn: ({
1311
- state: z
1312
- }) => {
1313
- U(z);
1314
- }
1315
- }];
1316
- u != null && ($ = $.concat(u)), f && f.modifiers != null && ($ = $.concat(f.modifiers));
1317
- const k = Xi(x, w.current, T({
1318
- placement: C
1319
- }, f, {
1320
- modifiers: $
1321
- }));
1322
- return P.current(k), () => {
1323
- k.destroy(), P.current(null);
1324
- };
1325
- }, [x, s, u, d, f, C]);
1326
- const M = {
1327
- placement: O
1328
- };
1329
- m !== null && (M.TransitionProps = m);
1330
- const B = Zi(), W = (r = h.root) != null ? r : "div", Z = qr({
1331
- elementType: W,
1332
- externalSlotProps: v.root,
1333
- externalForwardedProps: g,
1334
- additionalProps: {
1335
- role: "tooltip",
1336
- ref: S
1337
- },
1338
- ownerState: o,
1339
- className: B.root
1340
- });
1341
- return /* @__PURE__ */ N(W, T({}, Z, {
1342
- children: typeof i == "function" ? i(M) : i
1343
- }));
1344
- }), pr = /* @__PURE__ */ E.forwardRef(function(o, t) {
1345
- const {
1346
- anchorEl: r,
1347
- children: n,
1348
- container: i,
1349
- direction: a = "ltr",
1350
- disablePortal: s = !1,
1351
- keepMounted: u = !1,
1352
- modifiers: d,
1353
- open: p,
1354
- placement: f = "bottom",
1355
- popperOptions: c = Ui,
1356
- popperRef: v,
1357
- style: h,
1358
- transition: m = !1,
1359
- slotProps: g = {},
1360
- slots: w = {}
1361
- } = o, S = Se(o, Vi), [y, b] = E.useState(!0), P = () => {
1362
- b(!1);
1363
- }, C = () => {
1364
- b(!0);
1365
- };
1366
- if (!u && !p && (!m || y))
1367
- return null;
1368
- let O;
1369
- if (i)
1370
- O = i;
1371
- else if (r) {
1372
- const R = xt(r);
1373
- O = R && Yt(R) ? Do(R).body : Do(null).body;
1374
- }
1375
- const D = !p && u && (!m || y) ? "none" : void 0, x = m ? {
1376
- in: p,
1377
- onEnter: P,
1378
- onExited: C
1379
- } : void 0;
1380
- return /* @__PURE__ */ N(Ur, {
1381
- disablePortal: s,
1382
- container: O,
1383
- children: /* @__PURE__ */ N(qi, T({
1384
- anchorEl: r,
1385
- direction: a,
1386
- disablePortal: s,
1387
- modifiers: d,
1388
- ref: t,
1389
- open: m ? !y : p,
1390
- placement: f,
1391
- popperOptions: c,
1392
- popperRef: v,
1393
- slotProps: g,
1394
- slots: w
1395
- }, S, {
1396
- style: T({
1397
- // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
1398
- position: "fixed",
1399
- // Fix Popper.js display issue
1400
- top: 0,
1401
- left: 0,
1402
- display: D
1403
- }, h),
1404
- TransitionProps: x,
1405
- children: n
1406
- }))
1407
- });
1408
- });
1409
- process.env.NODE_ENV !== "production" && (pr.propTypes = {
1410
- // ----------------------------- Warning --------------------------------
1411
- // | These PropTypes are generated from the TypeScript type definitions |
1412
- // | To update them edit TypeScript types and run "yarn proptypes" |
1413
- // ----------------------------------------------------------------------
1414
- /**
1415
- * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
1416
- * or a function that returns either.
1417
- * It's used to set the position of the popper.
1418
- * The return value will passed as the reference object of the Popper instance.
1419
- */
1420
- anchorEl: Jo(l.oneOfType([St, l.object, l.func]), (e) => {
1421
- if (e.open) {
1422
- const o = xt(e.anchorEl);
1423
- if (o && Yt(o) && o.nodeType === 1) {
1424
- const t = o.getBoundingClientRect();
1425
- if (process.env.NODE_ENV !== "test" && t.top === 0 && t.left === 0 && t.right === 0 && t.bottom === 0)
1426
- return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
1427
- `));
1428
- } else if (!o || typeof o.getBoundingClientRect != "function" || Fi(o) && o.contextElement != null && o.contextElement.nodeType !== 1)
1429
- return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "It should be an HTML element instance or a virtualElement ", "(https://popper.js.org/docs/v2/virtual-elements/)."].join(`
1430
- `));
1431
- }
1432
- return null;
1433
- }),
1434
- /**
1435
- * Popper render function or node.
1436
- */
1437
- children: l.oneOfType([l.node, l.func]),
1438
- /**
1439
- * An HTML element or function that returns one.
1440
- * The `container` will have the portal children appended to it.
1441
- *
1442
- * By default, it uses the body of the top-level document object,
1443
- * so it's simply `document.body` most of the time.
1444
- */
1445
- container: l.oneOfType([St, l.func]),
1446
- /**
1447
- * Direction of the text.
1448
- * @default 'ltr'
1449
- */
1450
- direction: l.oneOf(["ltr", "rtl"]),
1451
- /**
1452
- * The `children` will be under the DOM hierarchy of the parent component.
1453
- * @default false
1454
- */
1455
- disablePortal: l.bool,
1456
- /**
1457
- * Always keep the children in the DOM.
1458
- * This prop can be useful in SEO situation or
1459
- * when you want to maximize the responsiveness of the Popper.
1460
- * @default false
1461
- */
1462
- keepMounted: l.bool,
1463
- /**
1464
- * Popper.js is based on a "plugin-like" architecture,
1465
- * most of its features are fully encapsulated "modifiers".
1466
- *
1467
- * A modifier is a function that is called each time Popper.js needs to
1468
- * compute the position of the popper.
1469
- * For this reason, modifiers should be very performant to avoid bottlenecks.
1470
- * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
1471
- */
1472
- modifiers: l.arrayOf(l.shape({
1473
- data: l.object,
1474
- effect: l.func,
1475
- enabled: l.bool,
1476
- fn: l.func,
1477
- name: l.any,
1478
- options: l.object,
1479
- phase: l.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
1480
- requires: l.arrayOf(l.string),
1481
- requiresIfExists: l.arrayOf(l.string)
1482
- })),
1483
- /**
1484
- * If `true`, the component is shown.
1485
- */
1486
- open: l.bool.isRequired,
1487
- /**
1488
- * Popper placement.
1489
- * @default 'bottom'
1490
- */
1491
- placement: l.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1492
- /**
1493
- * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
1494
- * @default {}
1495
- */
1496
- popperOptions: l.shape({
1497
- modifiers: l.array,
1498
- onFirstUpdate: l.func,
1499
- placement: l.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1500
- strategy: l.oneOf(["absolute", "fixed"])
1501
- }),
1502
- /**
1503
- * A ref that points to the used popper instance.
1504
- */
1505
- popperRef: Io,
1506
- /**
1507
- * The props used for each slot inside the Popper.
1508
- * @default {}
1509
- */
1510
- slotProps: l.shape({
1511
- root: l.oneOfType([l.func, l.object])
1512
- }),
1513
- /**
1514
- * The components used for each slot inside the Popper.
1515
- * Either a string to use a HTML element or a component.
1516
- * @default {}
1517
- */
1518
- slots: l.shape({
1519
- root: l.elementType
1520
- }),
1521
- /**
1522
- * Help supporting a react-transition-group/Transition component.
1523
- * @default false
1524
- */
1525
- transition: l.bool
1526
- });
1527
- const Ki = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"], Qi = Oe(pr, {
1528
- name: "MuiPopper",
1529
- slot: "Root",
1530
- overridesResolver: (e, o) => o.root
1531
- })({}), dr = /* @__PURE__ */ E.forwardRef(function(o, t) {
1532
- var r;
1533
- const n = un(), i = it({
1534
- props: o,
1535
- name: "MuiPopper"
1536
- }), {
1537
- anchorEl: a,
1538
- component: s,
1539
- components: u,
1540
- componentsProps: d,
1541
- container: p,
1542
- disablePortal: f,
1543
- keepMounted: c,
1544
- modifiers: v,
1545
- open: h,
1546
- placement: m,
1547
- popperOptions: g,
1548
- popperRef: w,
1549
- transition: S,
1550
- slots: y,
1551
- slotProps: b
1552
- } = i, P = Se(i, Ki), C = (r = y == null ? void 0 : y.root) != null ? r : u == null ? void 0 : u.Root, O = T({
1553
- anchorEl: a,
1554
- container: p,
1555
- disablePortal: f,
1556
- keepMounted: c,
1557
- modifiers: v,
1558
- open: h,
1559
- placement: m,
1560
- popperOptions: g,
1561
- popperRef: w,
1562
- transition: S
1563
- }, P);
1564
- return /* @__PURE__ */ N(Qi, T({
1565
- as: s,
1566
- direction: n == null ? void 0 : n.direction,
1567
- slots: {
1568
- root: C
1569
- },
1570
- slotProps: b ?? d
1571
- }, O, {
1572
- ref: t
1573
- }));
1574
- });
1575
- process.env.NODE_ENV !== "production" && (dr.propTypes = {
1576
- // ----------------------------- Warning --------------------------------
1577
- // | These PropTypes are generated from the TypeScript type definitions |
1578
- // | To update them edit TypeScript types and run "yarn proptypes" |
1579
- // ----------------------------------------------------------------------
1580
- /**
1581
- * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
1582
- * or a function that returns either.
1583
- * It's used to set the position of the popper.
1584
- * The return value will passed as the reference object of the Popper instance.
1585
- */
1586
- anchorEl: l.oneOfType([St, l.object, l.func]),
1587
- /**
1588
- * Popper render function or node.
1589
- */
1590
- children: l.oneOfType([l.node, l.func]),
1591
- /**
1592
- * The component used for the root node.
1593
- * Either a string to use a HTML element or a component.
1594
- */
1595
- component: l.elementType,
1596
- /**
1597
- * The components used for each slot inside the Popper.
1598
- * Either a string to use a HTML element or a component.
1599
- * @default {}
1600
- */
1601
- components: l.shape({
1602
- Root: l.elementType
1603
- }),
1604
- /**
1605
- * The props used for each slot inside the Popper.
1606
- * @default {}
1607
- */
1608
- componentsProps: l.shape({
1609
- root: l.oneOfType([l.func, l.object])
1610
- }),
1611
- /**
1612
- * An HTML element or function that returns one.
1613
- * The `container` will have the portal children appended to it.
1614
- *
1615
- * By default, it uses the body of the top-level document object,
1616
- * so it's simply `document.body` most of the time.
1617
- */
1618
- container: l.oneOfType([St, l.func]),
1619
- /**
1620
- * The `children` will be under the DOM hierarchy of the parent component.
1621
- * @default false
1622
- */
1623
- disablePortal: l.bool,
1624
- /**
1625
- * Always keep the children in the DOM.
1626
- * This prop can be useful in SEO situation or
1627
- * when you want to maximize the responsiveness of the Popper.
1628
- * @default false
1629
- */
1630
- keepMounted: l.bool,
1631
- /**
1632
- * Popper.js is based on a "plugin-like" architecture,
1633
- * most of its features are fully encapsulated "modifiers".
1634
- *
1635
- * A modifier is a function that is called each time Popper.js needs to
1636
- * compute the position of the popper.
1637
- * For this reason, modifiers should be very performant to avoid bottlenecks.
1638
- * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
1639
- */
1640
- modifiers: l.arrayOf(l.shape({
1641
- data: l.object,
1642
- effect: l.func,
1643
- enabled: l.bool,
1644
- fn: l.func,
1645
- name: l.any,
1646
- options: l.object,
1647
- phase: l.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
1648
- requires: l.arrayOf(l.string),
1649
- requiresIfExists: l.arrayOf(l.string)
1650
- })),
1651
- /**
1652
- * If `true`, the component is shown.
1653
- */
1654
- open: l.bool.isRequired,
1655
- /**
1656
- * Popper placement.
1657
- * @default 'bottom'
1658
- */
1659
- placement: l.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1660
- /**
1661
- * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
1662
- * @default {}
1663
- */
1664
- popperOptions: l.shape({
1665
- modifiers: l.array,
1666
- onFirstUpdate: l.func,
1667
- placement: l.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1668
- strategy: l.oneOf(["absolute", "fixed"])
1669
- }),
1670
- /**
1671
- * A ref that points to the used popper instance.
1672
- */
1673
- popperRef: Io,
1674
- /**
1675
- * The props used for each slot inside the Popper.
1676
- * @default {}
1677
- */
1678
- slotProps: l.shape({
1679
- root: l.oneOfType([l.func, l.object])
1680
- }),
1681
- /**
1682
- * The components used for each slot inside the Popper.
1683
- * Either a string to use a HTML element or a component.
1684
- * @default {}
1685
- */
1686
- slots: l.shape({
1687
- root: l.elementType
1688
- }),
1689
- /**
1690
- * The system prop that allows defining system overrides as well as additional CSS styles.
1691
- */
1692
- sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object]),
1693
- /**
1694
- * Help supporting a react-transition-group/Transition component.
1695
- * @default false
1696
- */
1697
- transition: l.bool
1698
- });
1699
- const fr = dr, Gi = on(), cr = gn({
1700
- themeId: pn,
1701
- defaultTheme: Gi,
1702
- defaultClassName: "MuiBox-root",
1703
- generateClassName: rn.generate
1704
- });
1705
- process.env.NODE_ENV !== "production" && (cr.propTypes = {
1706
- // ----------------------------- Warning --------------------------------
1707
- // | These PropTypes are generated from the TypeScript type definitions |
1708
- // | To update them edit the d.ts file and run "yarn proptypes" |
1709
- // ----------------------------------------------------------------------
1710
- /**
1711
- * @ignore
1712
- */
1713
- children: l.node,
1714
- /**
1715
- * The component used for the root node.
1716
- * Either a string to use a HTML element or a component.
1717
- */
1718
- component: l.elementType,
1719
- /**
1720
- * The system prop that allows defining system overrides as well as additional CSS styles.
1721
- */
1722
- sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object])
1723
- });
1724
- const Ji = cr, vr = On({
1725
- createStyledComponent: Oe("div", {
1726
- name: "MuiContainer",
1727
- slot: "Root",
1728
- overridesResolver: (e, o) => {
1729
- const {
1730
- ownerState: t
1731
- } = e;
1732
- return [o.root, o[`maxWidth${se(String(t.maxWidth))}`], t.fixed && o.fixed, t.disableGutters && o.disableGutters];
1733
- }
1734
- }),
1735
- useThemeProps: (e) => it({
1736
- props: e,
1737
- name: "MuiContainer"
1738
- })
1739
- });
1740
- process.env.NODE_ENV !== "production" && (vr.propTypes = {
1741
- // ----------------------------- Warning --------------------------------
1742
- // | These PropTypes are generated from the TypeScript type definitions |
1743
- // | To update them edit the d.ts file and run "yarn proptypes" |
1744
- // ----------------------------------------------------------------------
1745
- /**
1746
- * @ignore
1747
- */
1748
- children: l.node,
1749
- /**
1750
- * Override or extend the styles applied to the component.
1751
- */
1752
- classes: l.object,
1753
- /**
1754
- * The component used for the root node.
1755
- * Either a string to use a HTML element or a component.
1756
- */
1757
- component: l.elementType,
1758
- /**
1759
- * If `true`, the left and right padding is removed.
1760
- * @default false
1761
- */
1762
- disableGutters: l.bool,
1763
- /**
1764
- * Set the max-width to match the min-width of the current breakpoint.
1765
- * This is useful if you'd prefer to design for a fixed set of sizes
1766
- * instead of trying to accommodate a fully fluid viewport.
1767
- * It's fluid by default.
1768
- * @default false
1769
- */
1770
- fixed: l.bool,
1771
- /**
1772
- * Determine the max-width of the container.
1773
- * The container width grows with the size of the screen.
1774
- * Set to `false` to disable `maxWidth`.
1775
- * @default 'lg'
1776
- */
1777
- maxWidth: l.oneOfType([l.oneOf(["xs", "sm", "md", "lg", "xl", !1]), l.string]),
1778
- /**
1779
- * The system prop that allows defining system overrides as well as additional CSS styles.
1780
- */
1781
- sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object])
1782
- });
1783
- const mr = vr;
1784
- function Ii(e) {
1785
- return rt("MuiDivider", e);
1786
- }
1787
- Wt("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
1788
- const ea = ["absolute", "children", "className", "component", "flexItem", "light", "orientation", "role", "textAlign", "variant"], ta = (e) => {
1789
- const {
1790
- absolute: o,
1791
- children: t,
1792
- classes: r,
1793
- flexItem: n,
1794
- light: i,
1795
- orientation: a,
1796
- textAlign: s,
1797
- variant: u
1798
- } = e;
1799
- return nt({
1800
- root: ["root", o && "absolute", u, i && "light", a === "vertical" && "vertical", n && "flexItem", t && "withChildren", t && a === "vertical" && "withChildrenVertical", s === "right" && a !== "vertical" && "textAlignRight", s === "left" && a !== "vertical" && "textAlignLeft"],
1801
- wrapper: ["wrapper", a === "vertical" && "wrapperVertical"]
1802
- }, Ii, r);
1803
- }, oa = Oe("div", {
1804
- name: "MuiDivider",
1805
- slot: "Root",
1806
- overridesResolver: (e, o) => {
1807
- const {
1808
- ownerState: t
1809
- } = e;
1810
- return [o.root, t.absolute && o.absolute, o[t.variant], t.light && o.light, t.orientation === "vertical" && o.vertical, t.flexItem && o.flexItem, t.children && o.withChildren, t.children && t.orientation === "vertical" && o.withChildrenVertical, t.textAlign === "right" && t.orientation !== "vertical" && o.textAlignRight, t.textAlign === "left" && t.orientation !== "vertical" && o.textAlignLeft];
1811
- }
1812
- })(({
1813
- theme: e,
1814
- ownerState: o
1815
- }) => T({
1816
- margin: 0,
1817
- // Reset browser default style.
1818
- flexShrink: 0,
1819
- borderWidth: 0,
1820
- borderStyle: "solid",
1821
- borderColor: (e.vars || e).palette.divider,
1822
- borderBottomWidth: "thin"
1823
- }, o.absolute && {
1824
- position: "absolute",
1825
- bottom: 0,
1826
- left: 0,
1827
- width: "100%"
1828
- }, o.light && {
1829
- borderColor: e.vars ? `rgba(${e.vars.palette.dividerChannel} / 0.08)` : et(e.palette.divider, 0.08)
1830
- }, o.variant === "inset" && {
1831
- marginLeft: 72
1832
- }, o.variant === "middle" && o.orientation === "horizontal" && {
1833
- marginLeft: e.spacing(2),
1834
- marginRight: e.spacing(2)
1835
- }, o.variant === "middle" && o.orientation === "vertical" && {
1836
- marginTop: e.spacing(1),
1837
- marginBottom: e.spacing(1)
1838
- }, o.orientation === "vertical" && {
1839
- height: "100%",
1840
- borderBottomWidth: 0,
1841
- borderRightWidth: "thin"
1842
- }, o.flexItem && {
1843
- alignSelf: "stretch",
1844
- height: "auto"
1845
- }), ({
1846
- ownerState: e
1847
- }) => T({}, e.children && {
1848
- display: "flex",
1849
- whiteSpace: "nowrap",
1850
- textAlign: "center",
1851
- border: 0,
1852
- "&::before, &::after": {
1853
- content: '""',
1854
- alignSelf: "center"
1855
- }
1856
- }), ({
1857
- theme: e,
1858
- ownerState: o
1859
- }) => T({}, o.children && o.orientation !== "vertical" && {
1860
- "&::before, &::after": {
1861
- width: "100%",
1862
- borderTop: `thin solid ${(e.vars || e).palette.divider}`
1863
- }
1864
- }), ({
1865
- theme: e,
1866
- ownerState: o
1867
- }) => T({}, o.children && o.orientation === "vertical" && {
1868
- flexDirection: "column",
1869
- "&::before, &::after": {
1870
- height: "100%",
1871
- borderLeft: `thin solid ${(e.vars || e).palette.divider}`
1872
- }
1873
- }), ({
1874
- ownerState: e
1875
- }) => T({}, e.textAlign === "right" && e.orientation !== "vertical" && {
1876
- "&::before": {
1877
- width: "90%"
1878
- },
1879
- "&::after": {
1880
- width: "10%"
1881
- }
1882
- }, e.textAlign === "left" && e.orientation !== "vertical" && {
1883
- "&::before": {
1884
- width: "10%"
1885
- },
1886
- "&::after": {
1887
- width: "90%"
1888
- }
1889
- })), ra = Oe("span", {
1890
- name: "MuiDivider",
1891
- slot: "Wrapper",
1892
- overridesResolver: (e, o) => {
1893
- const {
1894
- ownerState: t
1895
- } = e;
1896
- return [o.wrapper, t.orientation === "vertical" && o.wrapperVertical];
1897
- }
1898
- })(({
1899
- theme: e,
1900
- ownerState: o
1901
- }) => T({
1902
- display: "inline-block",
1903
- paddingLeft: `calc(${e.spacing(1)} * 1.2)`,
1904
- paddingRight: `calc(${e.spacing(1)} * 1.2)`
1905
- }, o.orientation === "vertical" && {
1906
- paddingTop: `calc(${e.spacing(1)} * 1.2)`,
1907
- paddingBottom: `calc(${e.spacing(1)} * 1.2)`
1908
- })), lo = /* @__PURE__ */ E.forwardRef(function(o, t) {
1909
- const r = it({
1910
- props: o,
1911
- name: "MuiDivider"
1912
- }), {
1913
- absolute: n = !1,
1914
- children: i,
1915
- className: a,
1916
- component: s = i ? "div" : "hr",
1917
- flexItem: u = !1,
1918
- light: d = !1,
1919
- orientation: p = "horizontal",
1920
- role: f = s !== "hr" ? "separator" : void 0,
1921
- textAlign: c = "center",
1922
- variant: v = "fullWidth"
1923
- } = r, h = Se(r, ea), m = T({}, r, {
1924
- absolute: n,
1925
- component: s,
1926
- flexItem: u,
1927
- light: d,
1928
- orientation: p,
1929
- role: f,
1930
- textAlign: c,
1931
- variant: v
1932
- }), g = ta(m);
1933
- return /* @__PURE__ */ N(oa, T({
1934
- as: s,
1935
- className: Pe(g.root, a),
1936
- role: f,
1937
- ref: t,
1938
- ownerState: m
1939
- }, h, {
1940
- children: i ? /* @__PURE__ */ N(ra, {
1941
- className: g.wrapper,
1942
- ownerState: m,
1943
- children: i
1944
- }) : null
1945
- }));
1946
- });
1947
- lo.muiSkipListHighlight = !0;
1948
- process.env.NODE_ENV !== "production" && (lo.propTypes = {
1949
- // ----------------------------- Warning --------------------------------
1950
- // | These PropTypes are generated from the TypeScript type definitions |
1951
- // | To update them edit the d.ts file and run "yarn proptypes" |
1952
- // ----------------------------------------------------------------------
1953
- /**
1954
- * Absolutely position the element.
1955
- * @default false
1956
- */
1957
- absolute: l.bool,
1958
- /**
1959
- * The content of the component.
1960
- */
1961
- children: l.node,
1962
- /**
1963
- * Override or extend the styles applied to the component.
1964
- */
1965
- classes: l.object,
1966
- /**
1967
- * @ignore
1968
- */
1969
- className: l.string,
1970
- /**
1971
- * The component used for the root node.
1972
- * Either a string to use a HTML element or a component.
1973
- */
1974
- component: l.elementType,
1975
- /**
1976
- * If `true`, a vertical divider will have the correct height when used in flex container.
1977
- * (By default, a vertical divider will have a calculated height of `0px` if it is the child of a flex container.)
1978
- * @default false
1979
- */
1980
- flexItem: l.bool,
1981
- /**
1982
- * If `true`, the divider will have a lighter color.
1983
- * @default false
1984
- */
1985
- light: l.bool,
1986
- /**
1987
- * The component orientation.
1988
- * @default 'horizontal'
1989
- */
1990
- orientation: l.oneOf(["horizontal", "vertical"]),
1991
- /**
1992
- * @ignore
1993
- */
1994
- role: l.string,
1995
- /**
1996
- * The system prop that allows defining system overrides as well as additional CSS styles.
1997
- */
1998
- sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object]),
1999
- /**
2000
- * The text alignment.
2001
- * @default 'center'
2002
- */
2003
- textAlign: l.oneOf(["center", "left", "right"]),
2004
- /**
2005
- * The variant to use.
2006
- * @default 'fullWidth'
2007
- */
2008
- variant: l.oneOfType([l.oneOf(["fullWidth", "inset", "middle"]), l.string])
2009
- });
2010
- const Lo = lo;
2011
- function na(e) {
2012
- return rt("MuiTooltip", e);
2013
- }
2014
- const ia = Wt("MuiTooltip", ["popper", "popperInteractive", "popperArrow", "popperClose", "tooltip", "tooltipArrow", "touch", "tooltipPlacementLeft", "tooltipPlacementRight", "tooltipPlacementTop", "tooltipPlacementBottom", "arrow"]), Te = ia, aa = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "slotProps", "slots", "title", "TransitionComponent", "TransitionProps"];
2015
- function sa(e) {
2016
- return Math.round(e * 1e5) / 1e5;
2017
- }
2018
- const la = (e) => {
2019
- const {
2020
- classes: o,
2021
- disableInteractive: t,
2022
- arrow: r,
2023
- touch: n,
2024
- placement: i
2025
- } = e, a = {
2026
- popper: ["popper", !t && "popperInteractive", r && "popperArrow"],
2027
- tooltip: ["tooltip", r && "tooltipArrow", n && "touch", `tooltipPlacement${se(i.split("-")[0])}`],
2028
- arrow: ["arrow"]
2029
- };
2030
- return nt(a, na, o);
2031
- }, ua = Oe(fr, {
2032
- name: "MuiTooltip",
2033
- slot: "Popper",
2034
- overridesResolver: (e, o) => {
2035
- const {
2036
- ownerState: t
2037
- } = e;
2038
- return [o.popper, !t.disableInteractive && o.popperInteractive, t.arrow && o.popperArrow, !t.open && o.popperClose];
2039
- }
2040
- })(({
2041
- theme: e,
2042
- ownerState: o,
2043
- open: t
2044
- }) => T({
2045
- zIndex: (e.vars || e).zIndex.tooltip,
2046
- pointerEvents: "none"
2047
- }, !o.disableInteractive && {
2048
- pointerEvents: "auto"
2049
- }, !t && {
2050
- pointerEvents: "none"
2051
- }, o.arrow && {
2052
- [`&[data-popper-placement*="bottom"] .${Te.arrow}`]: {
2053
- top: 0,
2054
- marginTop: "-0.71em",
2055
- "&::before": {
2056
- transformOrigin: "0 100%"
2057
- }
2058
- },
2059
- [`&[data-popper-placement*="top"] .${Te.arrow}`]: {
2060
- bottom: 0,
2061
- marginBottom: "-0.71em",
2062
- "&::before": {
2063
- transformOrigin: "100% 0"
2064
- }
2065
- },
2066
- [`&[data-popper-placement*="right"] .${Te.arrow}`]: T({}, o.isRtl ? {
2067
- right: 0,
2068
- marginRight: "-0.71em"
2069
- } : {
2070
- left: 0,
2071
- marginLeft: "-0.71em"
2072
- }, {
2073
- height: "1em",
2074
- width: "0.71em",
2075
- "&::before": {
2076
- transformOrigin: "100% 100%"
2077
- }
2078
- }),
2079
- [`&[data-popper-placement*="left"] .${Te.arrow}`]: T({}, o.isRtl ? {
2080
- left: 0,
2081
- marginLeft: "-0.71em"
2082
- } : {
2083
- right: 0,
2084
- marginRight: "-0.71em"
2085
- }, {
2086
- height: "1em",
2087
- width: "0.71em",
2088
- "&::before": {
2089
- transformOrigin: "0 0"
2090
- }
2091
- })
2092
- })), pa = Oe("div", {
2093
- name: "MuiTooltip",
2094
- slot: "Tooltip",
2095
- overridesResolver: (e, o) => {
2096
- const {
2097
- ownerState: t
2098
- } = e;
2099
- return [o.tooltip, t.touch && o.touch, t.arrow && o.tooltipArrow, o[`tooltipPlacement${se(t.placement.split("-")[0])}`]];
2100
- }
2101
- })(({
2102
- theme: e,
2103
- ownerState: o
2104
- }) => T({
2105
- backgroundColor: e.vars ? e.vars.palette.Tooltip.bg : et(e.palette.grey[700], 0.92),
2106
- borderRadius: (e.vars || e).shape.borderRadius,
2107
- color: (e.vars || e).palette.common.white,
2108
- fontFamily: e.typography.fontFamily,
2109
- padding: "4px 8px",
2110
- fontSize: e.typography.pxToRem(11),
2111
- maxWidth: 300,
2112
- margin: 2,
2113
- wordWrap: "break-word",
2114
- fontWeight: e.typography.fontWeightMedium
2115
- }, o.arrow && {
2116
- position: "relative",
2117
- margin: 0
2118
- }, o.touch && {
2119
- padding: "8px 16px",
2120
- fontSize: e.typography.pxToRem(14),
2121
- lineHeight: `${sa(16 / 14)}em`,
2122
- fontWeight: e.typography.fontWeightRegular
2123
- }, {
2124
- [`.${Te.popper}[data-popper-placement*="left"] &`]: T({
2125
- transformOrigin: "right center"
2126
- }, o.isRtl ? T({
2127
- marginLeft: "14px"
2128
- }, o.touch && {
2129
- marginLeft: "24px"
2130
- }) : T({
2131
- marginRight: "14px"
2132
- }, o.touch && {
2133
- marginRight: "24px"
2134
- })),
2135
- [`.${Te.popper}[data-popper-placement*="right"] &`]: T({
2136
- transformOrigin: "left center"
2137
- }, o.isRtl ? T({
2138
- marginRight: "14px"
2139
- }, o.touch && {
2140
- marginRight: "24px"
2141
- }) : T({
2142
- marginLeft: "14px"
2143
- }, o.touch && {
2144
- marginLeft: "24px"
2145
- })),
2146
- [`.${Te.popper}[data-popper-placement*="top"] &`]: T({
2147
- transformOrigin: "center bottom",
2148
- marginBottom: "14px"
2149
- }, o.touch && {
2150
- marginBottom: "24px"
2151
- }),
2152
- [`.${Te.popper}[data-popper-placement*="bottom"] &`]: T({
2153
- transformOrigin: "center top",
2154
- marginTop: "14px"
2155
- }, o.touch && {
2156
- marginTop: "24px"
2157
- })
2158
- })), da = Oe("span", {
2159
- name: "MuiTooltip",
2160
- slot: "Arrow",
2161
- overridesResolver: (e, o) => o.arrow
2162
- })(({
2163
- theme: e
2164
- }) => ({
2165
- overflow: "hidden",
2166
- position: "absolute",
2167
- width: "1em",
2168
- height: "0.71em",
2169
- boxSizing: "border-box",
2170
- color: e.vars ? e.vars.palette.Tooltip.bg : et(e.palette.grey[700], 0.9),
2171
- "&::before": {
2172
- content: '""',
2173
- margin: "auto",
2174
- display: "block",
2175
- width: "100%",
2176
- height: "100%",
2177
- backgroundColor: "currentColor",
2178
- transform: "rotate(45deg)"
2179
- }
2180
- }));
2181
- let bt = !1, Zt = null, Ke = {
2182
- x: 0,
2183
- y: 0
2184
- };
2185
- function yt(e, o) {
2186
- return (t) => {
2187
- o && o(t), e(t);
2188
- };
2189
- }
2190
- const hr = /* @__PURE__ */ E.forwardRef(function(o, t) {
2191
- var r, n, i, a, s, u, d, p, f, c, v, h, m, g, w, S, y, b, P;
2192
- const C = it({
2193
- props: o,
2194
- name: "MuiTooltip"
2195
- }), {
2196
- arrow: O = !1,
2197
- children: D,
2198
- components: x = {},
2199
- componentsProps: R = {},
2200
- describeChild: M = !1,
2201
- disableFocusListener: B = !1,
2202
- disableHoverListener: W = !1,
2203
- disableInteractive: Z = !1,
2204
- disableTouchListener: U = !1,
2205
- enterDelay: $ = 100,
2206
- enterNextDelay: k = 0,
2207
- enterTouchDelay: z = 700,
2208
- followCursor: q = !1,
2209
- id: ye,
2210
- leaveDelay: le = 0,
2211
- leaveTouchDelay: me = 1500,
2212
- onClose: ie,
2213
- onOpen: K,
2214
- open: Q,
2215
- placement: ue = "bottom",
2216
- PopperComponent: pe,
2217
- PopperProps: X = {},
2218
- slotProps: L = {},
2219
- slots: he = {},
2220
- title: j,
2221
- TransitionComponent: Le = No,
2222
- TransitionProps: _e
2223
- } = C, ut = Se(C, aa), I = /* @__PURE__ */ E.isValidElement(D) ? D : /* @__PURE__ */ N("span", {
2224
- children: D
2225
- }), We = fn(), pt = We.direction === "rtl", [V, dt] = E.useState(), [ae, $e] = E.useState(null), Re = E.useRef(!1), Ye = Z || q, we = E.useRef(), Ae = E.useRef(), de = E.useRef(), Ve = E.useRef(), [ft, ho] = Kr({
2226
- controlled: Q,
2227
- default: !1,
2228
- name: "Tooltip",
2229
- state: "open"
2230
- });
2231
- let ge = ft;
2232
- if (process.env.NODE_ENV !== "production") {
2233
- const {
2234
- current: A
2235
- } = E.useRef(Q !== void 0);
2236
- E.useEffect(() => {
2237
- V && V.disabled && !A && j !== "" && V.tagName.toLowerCase() === "button" && console.error(["MUI: You are providing a disabled `button` child to the Tooltip component.", "A disabled element does not fire events.", "Tooltip needs to listen to the child element's events to display the title.", "", "Add a simple wrapper element, such as a `span`."].join(`
2238
- `));
2239
- }, [j, V, A]);
2240
- }
2241
- const jt = Qr(ye), He = E.useRef(), ct = E.useCallback(() => {
2242
- He.current !== void 0 && (document.body.style.WebkitUserSelect = He.current, He.current = void 0), clearTimeout(Ve.current);
2243
- }, []);
2244
- E.useEffect(() => () => {
2245
- clearTimeout(we.current), clearTimeout(Ae.current), clearTimeout(de.current), ct();
2246
- }, [ct]);
2247
- const go = (A) => {
2248
- clearTimeout(Zt), bt = !0, ho(!0), K && !ge && K(A);
2249
- }, vt = cn(
2250
- /**
2251
- * @param {React.SyntheticEvent | Event} event
2252
- */
2253
- (A) => {
2254
- clearTimeout(Zt), Zt = setTimeout(() => {
2255
- bt = !1;
2256
- }, 800 + le), ho(!1), ie && ge && ie(A), clearTimeout(we.current), we.current = setTimeout(() => {
2257
- Re.current = !1;
2258
- }, We.transitions.duration.shortest);
2259
- }
2260
- ), Lt = (A) => {
2261
- Re.current && A.type !== "touchstart" || (V && V.removeAttribute("title"), clearTimeout(Ae.current), clearTimeout(de.current), $ || bt && k ? Ae.current = setTimeout(() => {
2262
- go(A);
2263
- }, bt ? k : $) : go(A));
2264
- }, bo = (A) => {
2265
- clearTimeout(Ae.current), clearTimeout(de.current), de.current = setTimeout(() => {
2266
- vt(A);
2267
- }, le);
2268
- }, {
2269
- isFocusVisibleRef: yo,
2270
- onBlur: Wr,
2271
- onFocus: $r,
2272
- ref: Yr
2273
- } = vn(), [, wo] = E.useState(!1), Po = (A) => {
2274
- Wr(A), yo.current === !1 && (wo(!1), bo(A));
2275
- }, To = (A) => {
2276
- V || dt(A.currentTarget), $r(A), yo.current === !0 && (wo(!0), Lt(A));
2277
- }, Co = (A) => {
2278
- Re.current = !0;
2279
- const G = I.props;
2280
- G.onTouchStart && G.onTouchStart(A);
2281
- }, So = Lt, Oo = bo, Br = (A) => {
2282
- Co(A), clearTimeout(de.current), clearTimeout(we.current), ct(), He.current = document.body.style.WebkitUserSelect, document.body.style.WebkitUserSelect = "none", Ve.current = setTimeout(() => {
2283
- document.body.style.WebkitUserSelect = He.current, Lt(A);
2284
- }, z);
2285
- }, kr = (A) => {
2286
- I.props.onTouchEnd && I.props.onTouchEnd(A), ct(), clearTimeout(de.current), de.current = setTimeout(() => {
2287
- vt(A);
2288
- }, me);
2289
- };
2290
- E.useEffect(() => {
2291
- if (!ge)
2292
- return;
2293
- function A(G) {
2294
- (G.key === "Escape" || G.key === "Esc") && vt(G);
2295
- }
2296
- return document.addEventListener("keydown", A), () => {
2297
- document.removeEventListener("keydown", A);
2298
- };
2299
- }, [vt, ge]);
2300
- const zr = Kt(I.ref, Yr, dt, t);
2301
- !j && j !== 0 && (ge = !1);
2302
- const Vt = E.useRef(), Xr = (A) => {
2303
- const G = I.props;
2304
- G.onMouseMove && G.onMouseMove(A), Ke = {
2305
- x: A.clientX,
2306
- y: A.clientY
2307
- }, Vt.current && Vt.current.update();
2308
- }, Fe = {}, Ht = typeof j == "string";
2309
- M ? (Fe.title = !ge && Ht && !W ? j : null, Fe["aria-describedby"] = ge ? jt : null) : (Fe["aria-label"] = Ht ? j : null, Fe["aria-labelledby"] = ge && !Ht ? jt : null);
2310
- const ee = T({}, Fe, ut, I.props, {
2311
- className: Pe(ut.className, I.props.className),
2312
- onTouchStart: Co,
2313
- ref: zr
2314
- }, q ? {
2315
- onMouseMove: Xr
2316
- } : {});
2317
- process.env.NODE_ENV !== "production" && (ee["data-mui-internal-clone-element"] = !0, E.useEffect(() => {
2318
- V && !V.getAttribute("data-mui-internal-clone-element") && console.error(["MUI: The `children` component of the Tooltip is not forwarding its props correctly.", "Please make sure that props are spread on the same element that the ref is applied to."].join(`
2319
- `));
2320
- }, [V]));
2321
- const Ze = {};
2322
- U || (ee.onTouchStart = Br, ee.onTouchEnd = kr), W || (ee.onMouseOver = yt(So, ee.onMouseOver), ee.onMouseLeave = yt(Oo, ee.onMouseLeave), Ye || (Ze.onMouseOver = So, Ze.onMouseLeave = Oo)), B || (ee.onFocus = yt(To, ee.onFocus), ee.onBlur = yt(Po, ee.onBlur), Ye || (Ze.onFocus = To, Ze.onBlur = Po)), process.env.NODE_ENV !== "production" && I.props.title && console.error(["MUI: You have provided a `title` prop to the child of <Tooltip />.", `Remove this title prop \`${I.props.title}\` or the Tooltip component.`].join(`
2323
- `));
2324
- const jr = E.useMemo(() => {
2325
- var A;
2326
- let G = [{
2327
- name: "arrow",
2328
- enabled: !!ae,
2329
- options: {
2330
- element: ae,
2331
- padding: 4
2332
- }
2333
- }];
2334
- return (A = X.popperOptions) != null && A.modifiers && (G = G.concat(X.popperOptions.modifiers)), T({}, X.popperOptions, {
2335
- modifiers: G
2336
- });
2337
- }, [ae, X]), Ue = T({}, C, {
2338
- isRtl: pt,
2339
- arrow: O,
2340
- disableInteractive: Ye,
2341
- placement: ue,
2342
- PopperComponentProp: pe,
2343
- touch: Re.current
2344
- }), Ft = la(Ue), Eo = (r = (n = he.popper) != null ? n : x.Popper) != null ? r : ua, xo = (i = (a = (s = he.transition) != null ? s : x.Transition) != null ? a : Le) != null ? i : No, Ro = (u = (d = he.tooltip) != null ? d : x.Tooltip) != null ? u : pa, Ao = (p = (f = he.arrow) != null ? f : x.Arrow) != null ? p : da, Lr = mt(Eo, T({}, X, (c = L.popper) != null ? c : R.popper, {
2345
- className: Pe(Ft.popper, X == null ? void 0 : X.className, (v = (h = L.popper) != null ? h : R.popper) == null ? void 0 : v.className)
2346
- }), Ue), Vr = mt(xo, T({}, _e, (m = L.transition) != null ? m : R.transition), Ue), Hr = mt(Ro, T({}, (g = L.tooltip) != null ? g : R.tooltip, {
2347
- className: Pe(Ft.tooltip, (w = (S = L.tooltip) != null ? S : R.tooltip) == null ? void 0 : w.className)
2348
- }), Ue), Fr = mt(Ao, T({}, (y = L.arrow) != null ? y : R.arrow, {
2349
- className: Pe(Ft.arrow, (b = (P = L.arrow) != null ? P : R.arrow) == null ? void 0 : b.className)
2350
- }), Ue);
2351
- return /* @__PURE__ */ Ie(E.Fragment, {
2352
- children: [/* @__PURE__ */ E.cloneElement(I, ee), /* @__PURE__ */ N(Eo, T({
2353
- as: pe ?? fr,
2354
- placement: ue,
2355
- anchorEl: q ? {
2356
- getBoundingClientRect: () => ({
2357
- top: Ke.y,
2358
- left: Ke.x,
2359
- right: Ke.x,
2360
- bottom: Ke.y,
2361
- width: 0,
2362
- height: 0
2363
- })
2364
- } : V,
2365
- popperRef: Vt,
2366
- open: V ? ge : !1,
2367
- id: jt,
2368
- transition: !0
2369
- }, Ze, Lr, {
2370
- popperOptions: jr,
2371
- children: ({
2372
- TransitionProps: A
2373
- }) => /* @__PURE__ */ N(xo, T({
2374
- timeout: We.transitions.duration.shorter
2375
- }, A, Vr, {
2376
- children: /* @__PURE__ */ Ie(Ro, T({}, Hr, {
2377
- children: [j, O ? /* @__PURE__ */ N(Ao, T({}, Fr, {
2378
- ref: $e
2379
- })) : null]
2380
- }))
2381
- }))
2382
- }))]
2383
- });
2384
- });
2385
- process.env.NODE_ENV !== "production" && (hr.propTypes = {
2386
- // ----------------------------- Warning --------------------------------
2387
- // | These PropTypes are generated from the TypeScript type definitions |
2388
- // | To update them edit the d.ts file and run "yarn proptypes" |
2389
- // ----------------------------------------------------------------------
2390
- /**
2391
- * If `true`, adds an arrow to the tooltip.
2392
- * @default false
2393
- */
2394
- arrow: l.bool,
2395
- /**
2396
- * Tooltip reference element.
2397
- */
2398
- children: Gr.isRequired,
2399
- /**
2400
- * Override or extend the styles applied to the component.
2401
- */
2402
- classes: l.object,
2403
- /**
2404
- * @ignore
2405
- */
2406
- className: l.string,
2407
- /**
2408
- * The components used for each slot inside.
2409
- *
2410
- * This prop is an alias for the `slots` prop.
2411
- * It's recommended to use the `slots` prop instead.
2412
- *
2413
- * @default {}
2414
- */
2415
- components: l.shape({
2416
- Arrow: l.elementType,
2417
- Popper: l.elementType,
2418
- Tooltip: l.elementType,
2419
- Transition: l.elementType
2420
- }),
2421
- /**
2422
- * The extra props for the slot components.
2423
- * You can override the existing props or add new ones.
2424
- *
2425
- * This prop is an alias for the `slotProps` prop.
2426
- * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
2427
- *
2428
- * @default {}
2429
- */
2430
- componentsProps: l.shape({
2431
- arrow: l.object,
2432
- popper: l.object,
2433
- tooltip: l.object,
2434
- transition: l.object
2435
- }),
2436
- /**
2437
- * Set to `true` if the `title` acts as an accessible description.
2438
- * By default the `title` acts as an accessible label for the child.
2439
- * @default false
2440
- */
2441
- describeChild: l.bool,
2442
- /**
2443
- * Do not respond to focus-visible events.
2444
- * @default false
2445
- */
2446
- disableFocusListener: l.bool,
2447
- /**
2448
- * Do not respond to hover events.
2449
- * @default false
2450
- */
2451
- disableHoverListener: l.bool,
2452
- /**
2453
- * Makes a tooltip not interactive, i.e. it will close when the user
2454
- * hovers over the tooltip before the `leaveDelay` is expired.
2455
- * @default false
2456
- */
2457
- disableInteractive: l.bool,
2458
- /**
2459
- * Do not respond to long press touch events.
2460
- * @default false
2461
- */
2462
- disableTouchListener: l.bool,
2463
- /**
2464
- * The number of milliseconds to wait before showing the tooltip.
2465
- * This prop won't impact the enter touch delay (`enterTouchDelay`).
2466
- * @default 100
2467
- */
2468
- enterDelay: l.number,
2469
- /**
2470
- * The number of milliseconds to wait before showing the tooltip when one was already recently opened.
2471
- * @default 0
2472
- */
2473
- enterNextDelay: l.number,
2474
- /**
2475
- * The number of milliseconds a user must touch the element before showing the tooltip.
2476
- * @default 700
2477
- */
2478
- enterTouchDelay: l.number,
2479
- /**
2480
- * If `true`, the tooltip follow the cursor over the wrapped element.
2481
- * @default false
2482
- */
2483
- followCursor: l.bool,
2484
- /**
2485
- * This prop is used to help implement the accessibility logic.
2486
- * If you don't provide this prop. It falls back to a randomly generated id.
2487
- */
2488
- id: l.string,
2489
- /**
2490
- * The number of milliseconds to wait before hiding the tooltip.
2491
- * This prop won't impact the leave touch delay (`leaveTouchDelay`).
2492
- * @default 0
2493
- */
2494
- leaveDelay: l.number,
2495
- /**
2496
- * The number of milliseconds after the user stops touching an element before hiding the tooltip.
2497
- * @default 1500
2498
- */
2499
- leaveTouchDelay: l.number,
2500
- /**
2501
- * Callback fired when the component requests to be closed.
2502
- *
2503
- * @param {React.SyntheticEvent} event The event source of the callback.
2504
- */
2505
- onClose: l.func,
2506
- /**
2507
- * Callback fired when the component requests to be open.
2508
- *
2509
- * @param {React.SyntheticEvent} event The event source of the callback.
2510
- */
2511
- onOpen: l.func,
2512
- /**
2513
- * If `true`, the component is shown.
2514
- */
2515
- open: l.bool,
2516
- /**
2517
- * Tooltip placement.
2518
- * @default 'bottom'
2519
- */
2520
- placement: l.oneOf(["bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
2521
- /**
2522
- * The component used for the popper.
2523
- * @default Popper
2524
- */
2525
- PopperComponent: l.elementType,
2526
- /**
2527
- * Props applied to the [`Popper`](/material-ui/api/popper/) element.
2528
- * @default {}
2529
- */
2530
- PopperProps: l.object,
2531
- /**
2532
- * The extra props for the slot components.
2533
- * You can override the existing props or add new ones.
2534
- *
2535
- * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
2536
- *
2537
- * @default {}
2538
- */
2539
- slotProps: l.shape({
2540
- arrow: l.object,
2541
- popper: l.object,
2542
- tooltip: l.object,
2543
- transition: l.object
2544
- }),
2545
- /**
2546
- * The components used for each slot inside.
2547
- *
2548
- * This prop is an alias for the `components` prop, which will be deprecated in the future.
2549
- *
2550
- * @default {}
2551
- */
2552
- slots: l.shape({
2553
- arrow: l.elementType,
2554
- popper: l.elementType,
2555
- tooltip: l.elementType,
2556
- transition: l.elementType
2557
- }),
2558
- /**
2559
- * The system prop that allows defining system overrides as well as additional CSS styles.
2560
- */
2561
- sx: l.oneOfType([l.arrayOf(l.oneOfType([l.func, l.object, l.bool])), l.func, l.object]),
2562
- /**
2563
- * Tooltip title. Zero-length titles string, undefined, null and false are never displayed.
2564
- */
2565
- title: l.node,
2566
- /**
2567
- * The component used for the transition.
2568
- * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
2569
- * @default Grow
2570
- */
2571
- TransitionComponent: l.elementType,
2572
- /**
2573
- * Props applied to the transition element.
2574
- * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
2575
- */
2576
- TransitionProps: l.object
2577
- });
2578
- const wt = hr;
2579
- var uo = {}, fa = Mt;
2580
- Object.defineProperty(uo, "__esModule", {
2581
- value: !0
2582
- });
2583
- var gr = uo.default = void 0, ca = fa(Nt()), va = Dt, ma = (0, ca.default)(/* @__PURE__ */ (0, va.jsx)("path", {
2584
- d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
2585
- }), "Add");
2586
- gr = uo.default = ma;
2587
- var po = {}, ha = Mt;
2588
- Object.defineProperty(po, "__esModule", {
2589
- value: !0
2590
- });
2591
- var br = po.default = void 0, ga = ha(Nt()), ba = Dt, ya = (0, ga.default)(/* @__PURE__ */ (0, ba.jsx)("path", {
2592
- d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
2593
- }), "Refresh");
2594
- br = po.default = ya;
2595
- var fo = {}, wa = Mt;
2596
- Object.defineProperty(fo, "__esModule", {
2597
- value: !0
2598
- });
2599
- var yr = fo.default = void 0, Pa = wa(Nt()), Ta = Dt, Ca = (0, Pa.default)(/* @__PURE__ */ (0, Ta.jsx)("path", {
2600
- d: "M19 13H5v-2h14v2z"
2601
- }), "Remove");
2602
- yr = fo.default = Ca;
2603
- var co = {}, Sa = Mt;
2604
- Object.defineProperty(co, "__esModule", {
2605
- value: !0
2606
- });
2607
- var wr = co.default = void 0, Oa = Sa(Nt()), Ea = Dt, xa = (0, Oa.default)(/* @__PURE__ */ (0, Ea.jsx)("path", {
2608
- d: "m4 7.59 5-5c.78-.78 2.05-.78 2.83 0L20.24 11h-2.83L10.4 4 5.41 9H8v2H2V5h2v2.59zM20 19h2v-6h-6v2h2.59l-4.99 5-7.01-7H3.76l8.41 8.41c.78.78 2.05.78 2.83 0l5-5V19z"
2609
- }), "ScreenRotationAlt");
2610
- wr = co.default = xa;
2611
- var te = function(e, o) {
2612
- return Number(e.toFixed(o));
2613
- }, Ra = function(e, o) {
2614
- return typeof e == "number" ? e : o;
2615
- }, Y = function(e, o, t) {
2616
- t && typeof t == "function" && t(e, o);
2617
- }, Aa = function(e) {
2618
- return -Math.cos(e * Math.PI) / 2 + 0.5;
2619
- }, Da = function(e) {
2620
- return e;
2621
- }, Na = function(e) {
2622
- return e * e;
2623
- }, Ma = function(e) {
2624
- return e * (2 - e);
2625
- }, _a = function(e) {
2626
- return e < 0.5 ? 2 * e * e : -1 + (4 - 2 * e) * e;
2627
- }, Wa = function(e) {
2628
- return e * e * e;
2629
- }, $a = function(e) {
2630
- return --e * e * e + 1;
2631
- }, Ya = function(e) {
2632
- return e < 0.5 ? 4 * e * e * e : (e - 1) * (2 * e - 2) * (2 * e - 2) + 1;
2633
- }, Ba = function(e) {
2634
- return e * e * e * e;
2635
- }, ka = function(e) {
2636
- return 1 - --e * e * e * e;
2637
- }, za = function(e) {
2638
- return e < 0.5 ? 8 * e * e * e * e : 1 - 8 * --e * e * e * e;
2639
- }, Xa = function(e) {
2640
- return e * e * e * e * e;
2641
- }, ja = function(e) {
2642
- return 1 + --e * e * e * e * e;
2643
- }, La = function(e) {
2644
- return e < 0.5 ? 16 * e * e * e * e * e : 1 + 16 * --e * e * e * e * e;
2645
- }, Pr = {
2646
- easeOut: Aa,
2647
- linear: Da,
2648
- easeInQuad: Na,
2649
- easeOutQuad: Ma,
2650
- easeInOutQuad: _a,
2651
- easeInCubic: Wa,
2652
- easeOutCubic: $a,
2653
- easeInOutCubic: Ya,
2654
- easeInQuart: Ba,
2655
- easeOutQuart: ka,
2656
- easeInOutQuart: za,
2657
- easeInQuint: Xa,
2658
- easeOutQuint: ja,
2659
- easeInOutQuint: La
2660
- }, Tr = function(e) {
2661
- typeof e == "number" && cancelAnimationFrame(e);
2662
- }, fe = function(e) {
2663
- e.mounted && (Tr(e.animation), e.animate = !1, e.animation = null, e.velocity = null);
2664
- };
2665
- function Cr(e, o, t, r) {
2666
- if (e.mounted) {
2667
- var n = (/* @__PURE__ */ new Date()).getTime(), i = 1;
2668
- fe(e), e.animation = function() {
2669
- if (!e.mounted)
2670
- return Tr(e.animation);
2671
- var a = (/* @__PURE__ */ new Date()).getTime() - n, s = a / t, u = Pr[o], d = u(s);
2672
- a >= t ? (r(i), e.animation = null) : e.animation && (r(d), requestAnimationFrame(e.animation));
2673
- }, requestAnimationFrame(e.animation);
2674
- }
2675
- }
2676
- function Va(e) {
2677
- var o = e.scale, t = e.positionX, r = e.positionY;
2678
- return !(Number.isNaN(o) || Number.isNaN(t) || Number.isNaN(r));
2679
- }
2680
- function xe(e, o, t, r) {
2681
- var n = Va(o);
2682
- if (!(!e.mounted || !n)) {
2683
- var i = e.setTransformState, a = e.transformState, s = a.scale, u = a.positionX, d = a.positionY, p = o.scale - s, f = o.positionX - u, c = o.positionY - d;
2684
- t === 0 ? i(o.scale, o.positionX, o.positionY) : Cr(e, r, t, function(v) {
2685
- var h = s + p * v, m = u + f * v, g = d + c * v;
2686
- i(h, m, g);
2687
- });
2688
- }
2689
- }
2690
- function Ha(e, o, t) {
2691
- var r = e.offsetWidth, n = e.offsetHeight, i = o.offsetWidth, a = o.offsetHeight, s = i * t, u = a * t, d = r - s, p = n - u;
2692
- return {
2693
- wrapperWidth: r,
2694
- wrapperHeight: n,
2695
- newContentWidth: s,
2696
- newDiffWidth: d,
2697
- newContentHeight: u,
2698
- newDiffHeight: p
2699
- };
2700
- }
2701
- var Fa = function(e, o, t, r, n, i, a) {
2702
- var s = e > o ? t * (a ? 1 : 0.5) : 0, u = r > n ? i * (a ? 1 : 0.5) : 0, d = e - o - s, p = s, f = r - n - u, c = u;
2703
- return { minPositionX: d, maxPositionX: p, minPositionY: f, maxPositionY: c };
2704
- }, vo = function(e, o) {
2705
- var t = e.wrapperComponent, r = e.contentComponent, n = e.setup.centerZoomedOut;
2706
- if (!t || !r)
2707
- throw new Error("Components are not mounted");
2708
- var i = Ha(t, r, o), a = i.wrapperWidth, s = i.wrapperHeight, u = i.newContentWidth, d = i.newDiffWidth, p = i.newContentHeight, f = i.newDiffHeight, c = Fa(a, u, d, s, p, f, !!n);
2709
- return c;
2710
- }, Jt = function(e, o, t, r) {
2711
- return r ? e < o ? te(o, 2) : e > t ? te(t, 2) : te(e, 2) : te(e, 2);
2712
- }, je = function(e, o) {
2713
- var t = vo(e, o);
2714
- return e.bounds = t, t;
2715
- };
2716
- function Bt(e, o, t, r, n, i, a) {
2717
- var s = t.minPositionX, u = t.minPositionY, d = t.maxPositionX, p = t.maxPositionY, f = 0, c = 0;
2718
- a && (f = n, c = i);
2719
- var v = Jt(e, s - f, d + f, r), h = Jt(o, u - c, p + c, r);
2720
- return { x: v, y: h };
2721
- }
2722
- function kt(e, o, t, r, n, i) {
2723
- var a = e.transformState, s = a.scale, u = a.positionX, d = a.positionY, p = r - s;
2724
- if (typeof o != "number" || typeof t != "number")
2725
- return console.error("Mouse X and Y position were not provided!"), { x: u, y: d };
2726
- var f = u - o * p, c = d - t * p, v = Bt(f, c, n, i, 0, 0, null);
2727
- return v;
2728
- }
2729
- function lt(e, o, t, r, n) {
2730
- var i = n ? r : 0, a = o - i;
2731
- return !Number.isNaN(t) && e >= t ? t : !Number.isNaN(o) && e <= a ? a : e;
2732
- }
2733
- var Vo = function(e, o) {
2734
- var t = e.setup.panning.excluded, r = e.isInitialized, n = e.wrapperComponent, i = o.target, a = n == null ? void 0 : n.contains(i), s = r && i && a;
2735
- if (!s)
2736
- return !1;
2737
- var u = zt(i, t);
2738
- return !u;
2739
- }, Ho = function(e) {
2740
- var o = e.isInitialized, t = e.isPanning, r = e.setup, n = r.panning.disabled, i = o && t && !n;
2741
- return !!i;
2742
- }, Za = function(e, o) {
2743
- var t = e.transformState, r = t.positionX, n = t.positionY;
2744
- e.isPanning = !0;
2745
- var i = o.clientX, a = o.clientY;
2746
- e.startCoords = { x: i - r, y: a - n };
2747
- }, Ua = function(e, o) {
2748
- var t = o.touches, r = e.transformState, n = r.positionX, i = r.positionY;
2749
- e.isPanning = !0;
2750
- var a = t.length === 1;
2751
- if (a) {
2752
- var s = t[0].clientX, u = t[0].clientY;
2753
- e.startCoords = { x: s - n, y: u - i };
2754
- }
2755
- };
2756
- function qa(e) {
2757
- var o = e.transformState, t = o.positionX, r = o.positionY, n = o.scale, i = e.setup, a = i.disabled, s = i.limitToBounds, u = i.centerZoomedOut, d = e.wrapperComponent;
2758
- if (!(a || !d || !e.bounds)) {
2759
- var p = e.bounds, f = p.maxPositionX, c = p.minPositionX, v = p.maxPositionY, h = p.minPositionY, m = t > f || t < c, g = r > v || r < h, w = t > f ? d.offsetWidth : e.setup.minPositionX || 0, S = r > v ? d.offsetHeight : e.setup.minPositionY || 0, y = kt(e, w, S, n, e.bounds, s || u), b = y.x, P = y.y;
2760
- return {
2761
- scale: n,
2762
- positionX: m ? b : t,
2763
- positionY: g ? P : r
2764
- };
2765
- }
2766
- }
2767
- function Ka(e, o, t, r, n) {
2768
- var i = e.setup.limitToBounds, a = e.wrapperComponent, s = e.bounds, u = e.transformState, d = u.scale, p = u.positionX, f = u.positionY;
2769
- if (!(a === null || s === null || o === p && t === f)) {
2770
- var c = Bt(o, t, s, i, r, n, a), v = c.x, h = c.y;
2771
- e.setTransformState(d, v, h);
2772
- }
2773
- }
2774
- var Qa = function(e, o, t) {
2775
- var r = e.startCoords, n = e.transformState, i = e.setup.panning, a = i.lockAxisX, s = i.lockAxisY, u = n.positionX, d = n.positionY;
2776
- if (!r)
2777
- return { x: u, y: d };
2778
- var p = o - r.x, f = t - r.y, c = a ? u : p, v = s ? d : f;
2779
- return { x: c, y: v };
2780
- }, Rt = function(e, o) {
2781
- var t = e.setup, r = e.transformState, n = r.scale, i = t.minScale, a = t.disablePadding;
2782
- return o > 0 && n >= i && !a ? o : 0;
2783
- }, Ga = function(e) {
2784
- var o = e.mounted, t = e.setup, r = t.disabled, n = t.velocityAnimation, i = e.transformState.scale, a = n.disabled, s = !a || i > 1 || !r || o;
2785
- return !!s;
2786
- }, Ja = function(e) {
2787
- var o = e.mounted, t = e.velocity, r = e.bounds, n = e.setup, i = n.disabled, a = n.velocityAnimation, s = e.transformState.scale, u = a.disabled, d = !u || s > 1 || !i || o;
2788
- return !(!d || !t || !r);
2789
- };
2790
- function Ia(e, o) {
2791
- var t = e.setup.velocityAnimation, r = t.equalToMove, n = t.animationTime, i = t.sensitivity;
2792
- return r ? n * o * i : n;
2793
- }
2794
- function Fo(e, o, t, r, n, i, a, s, u, d) {
2795
- if (n) {
2796
- if (o > a && t > a) {
2797
- var p = a + (e - a) * d;
2798
- return p > u ? u : p < a ? a : p;
2799
- }
2800
- if (o < i && t < i) {
2801
- var p = i + (e - i) * d;
2802
- return p < s ? s : p > i ? i : p;
2803
- }
2804
- }
2805
- return r ? o : Jt(e, i, a, n);
2806
- }
2807
- function es(e, o) {
2808
- var t = 1;
2809
- return o ? Math.min(t, e.offsetWidth / window.innerWidth) : t;
2810
- }
2811
- function ts(e, o) {
2812
- var t = Ga(e);
2813
- if (t) {
2814
- var r = e.lastMousePosition, n = e.velocityTime, i = e.setup, a = e.wrapperComponent, s = i.velocityAnimation.equalToMove, u = Date.now();
2815
- if (r && n && a) {
2816
- var d = es(a, s), p = o.x - r.x, f = o.y - r.y, c = p / d, v = f / d, h = u - n, m = p * p + f * f, g = Math.sqrt(m) / h;
2817
- e.velocity = { velocityX: c, velocityY: v, total: g };
2818
- }
2819
- e.lastMousePosition = o, e.velocityTime = u;
2820
- }
2821
- }
2822
- function os(e) {
2823
- var o = e.velocity, t = e.bounds, r = e.setup, n = e.wrapperComponent, i = Ja(e);
2824
- if (!(!i || !o || !t || !n)) {
2825
- var a = o.velocityX, s = o.velocityY, u = o.total, d = t.maxPositionX, p = t.minPositionX, f = t.maxPositionY, c = t.minPositionY, v = r.limitToBounds, h = r.alignmentAnimation, m = r.zoomAnimation, g = r.panning, w = g.lockAxisY, S = g.lockAxisX, y = m.animationType, b = h.sizeX, P = h.sizeY, C = h.velocityAlignmentTime, O = C, D = Ia(e, u), x = Math.max(D, O), R = Rt(e, b), M = Rt(e, P), B = R * n.offsetWidth / 100, W = M * n.offsetHeight / 100, Z = d + B, U = p - B, $ = f + W, k = c - W, z = e.transformState, q = (/* @__PURE__ */ new Date()).getTime();
2826
- Cr(e, y, x, function(ye) {
2827
- var le = e.transformState, me = le.scale, ie = le.positionX, K = le.positionY, Q = (/* @__PURE__ */ new Date()).getTime() - q, ue = Q / O, pe = Pr[h.animationType], X = 1 - pe(Math.min(1, ue)), L = 1 - ye, he = ie + a * L, j = K + s * L, Le = Fo(he, z.positionX, ie, S, v, p, d, U, Z, X), _e = Fo(j, z.positionY, K, w, v, c, f, k, $, X);
2828
- (ie !== he || K !== j) && e.setTransformState(me, Le, _e);
2829
- });
2830
- }
2831
- }
2832
- function Zo(e, o) {
2833
- var t = e.transformState.scale;
2834
- fe(e), je(e, t), window.TouchEvent !== void 0 && o instanceof TouchEvent ? Ua(e, o) : Za(e, o);
2835
- }
2836
- function Sr(e) {
2837
- var o = e.transformState.scale, t = e.setup, r = t.minScale, n = t.alignmentAnimation, i = n.disabled, a = n.sizeX, s = n.sizeY, u = n.animationTime, d = n.animationType, p = i || o < r || !a && !s;
2838
- if (!p) {
2839
- var f = qa(e);
2840
- f && xe(e, f, u, d);
2841
- }
2842
- }
2843
- function Uo(e, o, t) {
2844
- var r = e.startCoords, n = e.setup, i = n.alignmentAnimation, a = i.sizeX, s = i.sizeY;
2845
- if (r) {
2846
- var u = Qa(e, o, t), d = u.x, p = u.y, f = Rt(e, a), c = Rt(e, s);
2847
- ts(e, { x: d, y: p }), Ka(e, d, p, f, c);
2848
- }
2849
- }
2850
- function rs(e) {
2851
- if (e.isPanning) {
2852
- var o = e.setup.panning.velocityDisabled, t = e.velocity, r = e.wrapperComponent, n = e.contentComponent;
2853
- e.isPanning = !1, e.animate = !1, e.animation = null;
2854
- var i = r == null ? void 0 : r.getBoundingClientRect(), a = n == null ? void 0 : n.getBoundingClientRect(), s = (i == null ? void 0 : i.width) || 0, u = (i == null ? void 0 : i.height) || 0, d = (a == null ? void 0 : a.width) || 0, p = (a == null ? void 0 : a.height) || 0, f = s < d || u < p, c = !o && t && (t == null ? void 0 : t.total) > 0.1 && f;
2855
- c ? os(e) : Sr(e);
2856
- }
2857
- }
2858
- function mo(e, o, t, r) {
2859
- var n = e.setup, i = n.minScale, a = n.maxScale, s = n.limitToBounds, u = lt(te(o, 2), i, a, 0, !1), d = je(e, u), p = kt(e, t, r, u, d, s), f = p.x, c = p.y;
2860
- return { scale: u, positionX: f, positionY: c };
2861
- }
2862
- function Or(e, o, t) {
2863
- var r = e.transformState.scale, n = e.wrapperComponent, i = e.setup, a = i.minScale, s = i.limitToBounds, u = i.zoomAnimation, d = u.disabled, p = u.animationTime, f = u.animationType, c = d || r >= a;
2864
- if ((r >= 1 || s) && Sr(e), !(c || !n || !e.mounted)) {
2865
- var v = o || n.offsetWidth / 2, h = t || n.offsetHeight / 2, m = mo(e, a, v, h);
2866
- m && xe(e, m, p, f);
2867
- }
2868
- }
2869
- var Ce = function() {
2870
- return Ce = Object.assign || function(o) {
2871
- for (var t, r = 1, n = arguments.length; r < n; r++) {
2872
- t = arguments[r];
2873
- for (var i in t)
2874
- Object.prototype.hasOwnProperty.call(t, i) && (o[i] = t[i]);
2875
- }
2876
- return o;
2877
- }, Ce.apply(this, arguments);
2878
- };
2879
- function qo(e, o, t) {
2880
- if (t || arguments.length === 2)
2881
- for (var r = 0, n = o.length, i; r < n; r++)
2882
- (i || !(r in o)) && (i || (i = Array.prototype.slice.call(o, 0, r)), i[r] = o[r]);
2883
- return e.concat(i || Array.prototype.slice.call(o));
2884
- }
2885
- var Pt = {
2886
- previousScale: 1,
2887
- scale: 1,
2888
- positionX: 0,
2889
- positionY: 0
2890
- }, Qe = {
2891
- disabled: !1,
2892
- minPositionX: null,
2893
- maxPositionX: null,
2894
- minPositionY: null,
2895
- maxPositionY: null,
2896
- minScale: 1,
2897
- maxScale: 8,
2898
- limitToBounds: !0,
2899
- centerZoomedOut: !1,
2900
- centerOnInit: !1,
2901
- disablePadding: !1,
2902
- smooth: !0,
2903
- wheel: {
2904
- step: 0.2,
2905
- disabled: !1,
2906
- smoothStep: 1e-3,
2907
- wheelDisabled: !1,
2908
- touchPadDisabled: !1,
2909
- activationKeys: [],
2910
- excluded: []
2911
- },
2912
- panning: {
2913
- disabled: !1,
2914
- velocityDisabled: !1,
2915
- lockAxisX: !1,
2916
- lockAxisY: !1,
2917
- activationKeys: [],
2918
- excluded: []
2919
- },
2920
- pinch: {
2921
- step: 5,
2922
- disabled: !1,
2923
- excluded: []
2924
- },
2925
- doubleClick: {
2926
- disabled: !1,
2927
- step: 0.7,
2928
- mode: "zoomIn",
2929
- animationType: "easeOut",
2930
- animationTime: 200,
2931
- excluded: []
2932
- },
2933
- zoomAnimation: {
2934
- disabled: !1,
2935
- size: 0.4,
2936
- animationTime: 200,
2937
- animationType: "easeOut"
2938
- },
2939
- alignmentAnimation: {
2940
- disabled: !1,
2941
- sizeX: 100,
2942
- sizeY: 100,
2943
- animationTime: 200,
2944
- velocityAlignmentTime: 400,
2945
- animationType: "easeOut"
2946
- },
2947
- velocityAnimation: {
2948
- disabled: !1,
2949
- sensitivity: 1,
2950
- animationTime: 400,
2951
- animationType: "easeOut",
2952
- equalToMove: !0
2953
- }
2954
- }, Er = function(e) {
2955
- var o, t, r, n;
2956
- return {
2957
- previousScale: (o = e.initialScale) !== null && o !== void 0 ? o : Pt.scale,
2958
- scale: (t = e.initialScale) !== null && t !== void 0 ? t : Pt.scale,
2959
- positionX: (r = e.initialPositionX) !== null && r !== void 0 ? r : Pt.positionX,
2960
- positionY: (n = e.initialPositionY) !== null && n !== void 0 ? n : Pt.positionY
2961
- };
2962
- }, Ko = function(e) {
2963
- var o = Ce({}, Qe);
2964
- return Object.keys(e).forEach(function(t) {
2965
- var r = typeof e[t] < "u", n = typeof Qe[t] < "u";
2966
- if (n && r) {
2967
- var i = Object.prototype.toString.call(Qe[t]), a = i === "[object Object]", s = i === "[object Array]";
2968
- a ? o[t] = Ce(Ce({}, Qe[t]), e[t]) : s ? o[t] = qo(qo([], Qe[t], !0), e[t], !0) : o[t] = e[t];
2969
- }
2970
- }), o;
2971
- }, xr = function(e, o, t) {
2972
- var r = e.transformState.scale, n = e.wrapperComponent, i = e.setup, a = i.maxScale, s = i.minScale, u = i.zoomAnimation, d = i.smooth, p = u.size;
2973
- if (!n)
2974
- throw new Error("Wrapper is not mounted");
2975
- var f = d ? r * Math.exp(o * t) : r + o * t, c = lt(te(f, 3), s, a, p, !1);
2976
- return c;
2977
- };
2978
- function Rr(e, o, t, r, n) {
2979
- var i = e.wrapperComponent, a = e.transformState, s = a.scale, u = a.positionX, d = a.positionY;
2980
- if (!i)
2981
- return console.error("No WrapperComponent found");
2982
- var p = i.offsetWidth, f = i.offsetHeight, c = (p / 2 - u) / s, v = (f / 2 - d) / s, h = xr(e, o, t), m = mo(e, h, c, v);
2983
- if (!m)
2984
- return console.error("Error during zoom event. New transformation state was not calculated.");
2985
- xe(e, m, r, n);
2986
- }
2987
- function Ar(e, o, t, r) {
2988
- var n = e.setup, i = e.wrapperComponent, a = n.limitToBounds, s = Er(e.props), u = e.transformState, d = u.scale, p = u.positionX, f = u.positionY;
2989
- if (i) {
2990
- var c = vo(e, s.scale), v = Bt(s.positionX, s.positionY, c, a, 0, 0, i), h = {
2991
- scale: s.scale,
2992
- positionX: v.x,
2993
- positionY: v.y
2994
- };
2995
- d === s.scale && p === s.positionX && f === s.positionY || (r == null || r(), xe(e, h, o, t));
2996
- }
2997
- }
2998
- function ns(e, o, t, r) {
2999
- var n = e.getBoundingClientRect(), i = o.getBoundingClientRect(), a = t.getBoundingClientRect(), s = i.x * r.scale, u = i.y * r.scale;
3000
- return {
3001
- x: (n.x - a.x + s) / r.scale,
3002
- y: (n.y - a.y + u) / r.scale
3003
- };
3004
- }
3005
- function is(e, o, t) {
3006
- var r = e.wrapperComponent, n = e.contentComponent, i = e.transformState, a = e.setup, s = a.limitToBounds, u = a.minScale, d = a.maxScale;
3007
- if (!r || !n)
3008
- return i;
3009
- var p = r.getBoundingClientRect(), f = o.getBoundingClientRect(), c = ns(o, r, n, i), v = c.x, h = c.y, m = f.width / i.scale, g = f.height / i.scale, w = r.offsetWidth / m, S = r.offsetHeight / g, y = lt(t || Math.min(w, S), u, d, 0, !1), b = (p.width - m * y) / 2, P = (p.height - g * y) / 2, C = (p.left - v) * y + b, O = (p.top - h) * y + P, D = vo(e, y), x = Bt(C, O, D, s, 0, 0, r), R = x.x, M = x.y;
3010
- return { positionX: R, positionY: M, scale: y };
3011
- }
3012
- var as = function(e) {
3013
- return function(o, t, r) {
3014
- o === void 0 && (o = 0.5), t === void 0 && (t = 300), r === void 0 && (r = "easeOut"), Rr(e, 1, o, t, r);
3015
- };
3016
- }, ss = function(e) {
3017
- return function(o, t, r) {
3018
- o === void 0 && (o = 0.5), t === void 0 && (t = 300), r === void 0 && (r = "easeOut"), Rr(e, -1, o, t, r);
3019
- };
3020
- }, ls = function(e) {
3021
- return function(o, t, r, n, i) {
3022
- n === void 0 && (n = 300), i === void 0 && (i = "easeOut");
3023
- var a = e.transformState, s = a.positionX, u = a.positionY, d = a.scale, p = e.wrapperComponent, f = e.contentComponent, c = e.setup.disabled;
3024
- if (!(c || !p || !f)) {
3025
- var v = {
3026
- positionX: Number.isNaN(o) ? s : o,
3027
- positionY: Number.isNaN(t) ? u : t,
3028
- scale: Number.isNaN(r) ? d : r
3029
- };
3030
- xe(e, v, n, i);
3031
- }
3032
- };
3033
- }, us = function(e) {
3034
- return function(o, t) {
3035
- o === void 0 && (o = 200), t === void 0 && (t = "easeOut"), Ar(e, o, t);
3036
- };
3037
- }, ps = function(e) {
3038
- return function(o, t, r) {
3039
- t === void 0 && (t = 200), r === void 0 && (r = "easeOut");
3040
- var n = e.transformState, i = e.wrapperComponent, a = e.contentComponent;
3041
- if (i && a) {
3042
- var s = Dr(o || n.scale, i, a);
3043
- xe(e, s, t, r);
3044
- }
3045
- };
3046
- }, ds = function(e) {
3047
- return function(o, t, r, n) {
3048
- r === void 0 && (r = 600), n === void 0 && (n = "easeOut"), fe(e);
3049
- var i = e.wrapperComponent, a = typeof o == "string" ? document.getElementById(o) : o;
3050
- if (i && a && i.contains(a)) {
3051
- var s = is(e, a, t);
3052
- xe(e, s, r, n);
3053
- }
3054
- };
3055
- }, At = function(e) {
3056
- return {
3057
- instance: e,
3058
- zoomIn: as(e),
3059
- zoomOut: ss(e),
3060
- setTransform: ls(e),
3061
- resetTransform: us(e),
3062
- centerView: ps(e),
3063
- zoomToElement: ds(e)
3064
- };
3065
- }, fs = function(e) {
3066
- return {
3067
- instance: e,
3068
- state: e.transformState
3069
- };
3070
- }, _ = function(e) {
3071
- var o = {};
3072
- return Object.assign(o, fs(e)), Object.assign(o, At(e)), o;
3073
- }, Ut = !1;
3074
- function qt() {
3075
- try {
3076
- var e = {
3077
- get passive() {
3078
- return Ut = !0, !1;
3079
- }
3080
- };
3081
- return e;
3082
- } catch {
3083
- return Ut = !1, Ut;
3084
- }
3085
- }
3086
- var zt = function(e, o) {
3087
- var t = e.tagName.toUpperCase(), r = o.find(function(i) {
3088
- return i.toUpperCase() === t;
3089
- });
3090
- if (r)
3091
- return !0;
3092
- var n = o.find(function(i) {
3093
- return e.classList.contains(i);
3094
- });
3095
- return !!n;
3096
- }, It = function(e) {
3097
- e && clearTimeout(e);
3098
- }, cs = function(e, o, t) {
3099
- return "translate(".concat(e, "px, ").concat(o, "px) scale(").concat(t, ")");
3100
- }, Dr = function(e, o, t) {
3101
- var r = t.offsetWidth * e, n = t.offsetHeight * e, i = (o.offsetWidth - r) / 2, a = (o.offsetHeight - n) / 2;
3102
- return {
3103
- scale: e,
3104
- positionX: i,
3105
- positionY: a
3106
- };
3107
- };
3108
- function vs(e) {
3109
- return function(o) {
3110
- e.forEach(function(t) {
3111
- typeof t == "function" ? t(o) : t != null && (t.current = o);
3112
- });
3113
- };
3114
- }
3115
- var ms = function(e, o) {
3116
- var t = e.setup.wheel, r = t.disabled, n = t.wheelDisabled, i = t.touchPadDisabled, a = t.excluded, s = e.isInitialized, u = e.isPanning, d = o.target, p = s && !u && !r && d;
3117
- if (!p || n && !o.ctrlKey || i && o.ctrlKey)
3118
- return !1;
3119
- var f = zt(d, a);
3120
- return !f;
3121
- }, hs = function(e) {
3122
- return e ? e.deltaY < 0 ? 1 : -1 : 0;
3123
- };
3124
- function gs(e, o) {
3125
- var t = hs(e), r = Ra(o, t);
3126
- return r;
3127
- }
3128
- function Nr(e, o, t) {
3129
- var r = o.getBoundingClientRect(), n = 0, i = 0;
3130
- if ("clientX" in e)
3131
- n = (e.clientX - r.left) / t, i = (e.clientY - r.top) / t;
3132
- else {
3133
- var a = e.touches[0];
3134
- n = (a.clientX - r.left) / t, i = (a.clientY - r.top) / t;
3135
- }
3136
- return (Number.isNaN(n) || Number.isNaN(i)) && console.error("No mouse or touch offset found"), {
3137
- x: n,
3138
- y: i
3139
- };
3140
- }
3141
- var bs = function(e, o, t, r, n) {
3142
- var i = e.transformState.scale, a = e.wrapperComponent, s = e.setup, u = s.maxScale, d = s.minScale, p = s.zoomAnimation, f = s.disablePadding, c = p.size, v = p.disabled;
3143
- if (!a)
3144
- throw new Error("Wrapper is not mounted");
3145
- var h = i + o * t;
3146
- if (n)
3147
- return h;
3148
- var m = r ? !1 : !v, g = lt(te(h, 3), d, u, c, m && !f);
3149
- return g;
3150
- }, ys = function(e, o) {
3151
- var t = e.previousWheelEvent, r = e.transformState.scale, n = e.setup, i = n.maxScale, a = n.minScale;
3152
- return t ? r < i || r > a || Math.sign(t.deltaY) !== Math.sign(o.deltaY) || t.deltaY > 0 && t.deltaY < o.deltaY || t.deltaY < 0 && t.deltaY > o.deltaY || Math.sign(t.deltaY) !== Math.sign(o.deltaY) : !1;
3153
- }, ws = function(e, o) {
3154
- var t = e.setup.pinch, r = t.disabled, n = t.excluded, i = e.isInitialized, a = o.target, s = i && !r && a;
3155
- if (!s)
3156
- return !1;
3157
- var u = zt(a, n);
3158
- return !u;
3159
- }, Ps = function(e) {
3160
- var o = e.setup.pinch.disabled, t = e.isInitialized, r = e.pinchStartDistance, n = t && !o && r;
3161
- return !!n;
3162
- }, Ts = function(e, o, t) {
3163
- var r = t.getBoundingClientRect(), n = e.touches, i = te(n[0].clientX - r.left, 5), a = te(n[0].clientY - r.top, 5), s = te(n[1].clientX - r.left, 5), u = te(n[1].clientY - r.top, 5);
3164
- return {
3165
- x: (i + s) / 2 / o,
3166
- y: (a + u) / 2 / o
3167
- };
3168
- }, Mr = function(e) {
3169
- return Math.sqrt(Math.pow(e.touches[0].pageX - e.touches[1].pageX, 2) + Math.pow(e.touches[0].pageY - e.touches[1].pageY, 2));
3170
- }, Cs = function(e, o) {
3171
- var t = e.pinchStartScale, r = e.pinchStartDistance, n = e.setup, i = n.maxScale, a = n.minScale, s = n.zoomAnimation, u = n.disablePadding, d = s.size, p = s.disabled;
3172
- if (!t || r === null || !o)
3173
- throw new Error("Pinch touches distance was not provided");
3174
- if (o < 0)
3175
- return e.transformState.scale;
3176
- var f = o / r, c = f * t;
3177
- return lt(te(c, 2), a, i, d, !p && !u);
3178
- }, Ss = 160, Os = 100, Es = function(e, o) {
3179
- var t = e.props, r = t.onWheelStart, n = t.onZoomStart;
3180
- e.wheelStopEventTimer || (fe(e), Y(_(e), o, r), Y(_(e), o, n));
3181
- }, xs = function(e, o) {
3182
- var t = e.props, r = t.onWheel, n = t.onZoom, i = e.contentComponent, a = e.setup, s = e.transformState, u = s.scale, d = a.limitToBounds, p = a.centerZoomedOut, f = a.zoomAnimation, c = a.wheel, v = a.disablePadding, h = a.smooth, m = f.size, g = f.disabled, w = c.step, S = c.smoothStep;
3183
- if (!i)
3184
- throw new Error("Component not mounted");
3185
- o.preventDefault(), o.stopPropagation();
3186
- var y = gs(o, null), b = h ? S * Math.abs(o.deltaY) : w, P = bs(e, y, b, !o.ctrlKey);
3187
- if (u !== P) {
3188
- var C = je(e, P), O = Nr(o, i, u), D = g || m === 0 || p || v, x = d && D, R = kt(e, O.x, O.y, P, C, x), M = R.x, B = R.y;
3189
- e.previousWheelEvent = o, e.setTransformState(P, M, B), Y(_(e), o, r), Y(_(e), o, n);
3190
- }
3191
- }, Rs = function(e, o) {
3192
- var t = e.props, r = t.onWheelStop, n = t.onZoomStop;
3193
- It(e.wheelAnimationTimer), e.wheelAnimationTimer = setTimeout(function() {
3194
- e.mounted && (Or(e, o.x, o.y), e.wheelAnimationTimer = null);
3195
- }, Os);
3196
- var i = ys(e, o);
3197
- i && (It(e.wheelStopEventTimer), e.wheelStopEventTimer = setTimeout(function() {
3198
- e.mounted && (e.wheelStopEventTimer = null, Y(_(e), o, r), Y(_(e), o, n));
3199
- }, Ss));
3200
- }, As = function(e, o) {
3201
- var t = Mr(o);
3202
- e.pinchStartDistance = t, e.lastDistance = t, e.pinchStartScale = e.transformState.scale, e.isPanning = !1, fe(e);
3203
- }, Ds = function(e, o) {
3204
- var t = e.contentComponent, r = e.pinchStartDistance, n = e.transformState.scale, i = e.setup, a = i.limitToBounds, s = i.centerZoomedOut, u = i.zoomAnimation, d = u.disabled, p = u.size;
3205
- if (!(r === null || !t)) {
3206
- var f = Ts(o, n, t);
3207
- if (!(!Number.isFinite(f.x) || !Number.isFinite(f.y))) {
3208
- var c = Mr(o), v = Cs(e, c);
3209
- if (v !== n) {
3210
- var h = je(e, v), m = d || p === 0 || s, g = a && m, w = kt(e, f.x, f.y, v, h, g), S = w.x, y = w.y;
3211
- e.pinchMidpoint = f, e.lastDistance = c, e.setTransformState(v, S, y);
3212
- }
3213
- }
3214
- }
3215
- }, Ns = function(e) {
3216
- var o = e.pinchMidpoint;
3217
- e.velocity = null, e.lastDistance = null, e.pinchMidpoint = null, e.pinchStartScale = null, e.pinchStartDistance = null, Or(e, o == null ? void 0 : o.x, o == null ? void 0 : o.y);
3218
- }, _r = function(e, o) {
3219
- var t = e.props.onZoomStop, r = e.setup.doubleClick.animationTime;
3220
- It(e.doubleClickStopEventTimer), e.doubleClickStopEventTimer = setTimeout(function() {
3221
- e.doubleClickStopEventTimer = null, Y(_(e), o, t);
3222
- }, r);
3223
- }, Ms = function(e, o) {
3224
- var t = e.props, r = t.onZoomStart, n = t.onZoom, i = e.setup.doubleClick, a = i.animationTime, s = i.animationType;
3225
- Y(_(e), o, r), Ar(e, a, s, function() {
3226
- return Y(_(e), o, n);
3227
- }), _r(e, o);
3228
- };
3229
- function _s(e, o) {
3230
- var t = e.setup, r = e.doubleClickStopEventTimer, n = e.transformState, i = e.contentComponent, a = n.scale, s = e.props, u = s.onZoomStart, d = s.onZoom, p = t.doubleClick, f = p.disabled, c = p.mode, v = p.step, h = p.animationTime, m = p.animationType;
3231
- if (!f && !r) {
3232
- if (c === "reset")
3233
- return Ms(e, o);
3234
- if (!i)
3235
- return console.error("No ContentComponent found");
3236
- var g = c === "zoomOut" ? -1 : 1, w = xr(e, g, v);
3237
- if (a !== w) {
3238
- Y(_(e), o, u);
3239
- var S = Nr(o, i, a), y = mo(e, w, S.x, S.y);
3240
- if (!y)
3241
- return console.error("Error during zoom event. New transformation state was not calculated.");
3242
- Y(_(e), o, d), xe(e, y, h, m), _r(e, o);
3243
- }
3244
- }
3245
- }
3246
- var Ws = function(e, o) {
3247
- var t = e.isInitialized, r = e.setup, n = e.wrapperComponent, i = r.doubleClick, a = i.disabled, s = i.excluded, u = o.target, d = n == null ? void 0 : n.contains(u), p = t && u && d && !a;
3248
- if (!p)
3249
- return !1;
3250
- var f = zt(u, s);
3251
- return !f;
3252
- }, $s = (
3253
- /** @class */
3254
- function() {
3255
- function e(o) {
3256
- var t = this;
3257
- this.mounted = !0, this.onChangeCallbacks = /* @__PURE__ */ new Set(), this.onInitCallbacks = /* @__PURE__ */ new Set(), this.wrapperComponent = null, this.contentComponent = null, this.isInitialized = !1, this.bounds = null, this.previousWheelEvent = null, this.wheelStopEventTimer = null, this.wheelAnimationTimer = null, this.isPanning = !1, this.startCoords = null, this.lastTouch = null, this.distance = null, this.lastDistance = null, this.pinchStartDistance = null, this.pinchStartScale = null, this.pinchMidpoint = null, this.doubleClickStopEventTimer = null, this.velocity = null, this.velocityTime = null, this.lastMousePosition = null, this.animate = !1, this.animation = null, this.maxBounds = null, this.pressedKeys = {}, this.mount = function() {
3258
- t.initializeWindowEvents();
3259
- }, this.unmount = function() {
3260
- t.cleanupWindowEvents();
3261
- }, this.update = function(r) {
3262
- je(t, t.transformState.scale), t.setup = Ko(r);
3263
- }, this.initializeWindowEvents = function() {
3264
- var r, n = qt(), i = (r = t.wrapperComponent) === null || r === void 0 ? void 0 : r.ownerDocument, a = i == null ? void 0 : i.defaultView;
3265
- a == null || a.addEventListener("mousedown", t.onPanningStart, n), a == null || a.addEventListener("mousemove", t.onPanning, n), a == null || a.addEventListener("mouseup", t.onPanningStop, n), i == null || i.addEventListener("mouseleave", t.clearPanning, n), a == null || a.addEventListener("keyup", t.setKeyUnPressed, n), a == null || a.addEventListener("keydown", t.setKeyPressed, n);
3266
- }, this.cleanupWindowEvents = function() {
3267
- var r, n, i = qt(), a = (r = t.wrapperComponent) === null || r === void 0 ? void 0 : r.ownerDocument, s = a == null ? void 0 : a.defaultView;
3268
- s == null || s.removeEventListener("mousedown", t.onPanningStart, i), s == null || s.removeEventListener("mousemove", t.onPanning, i), s == null || s.removeEventListener("mouseup", t.onPanningStop, i), a == null || a.removeEventListener("mouseleave", t.clearPanning, i), s == null || s.removeEventListener("keyup", t.setKeyUnPressed, i), s == null || s.removeEventListener("keydown", t.setKeyPressed, i), document.removeEventListener("mouseleave", t.clearPanning, i), fe(t), (n = t.observer) === null || n === void 0 || n.disconnect();
3269
- }, this.handleInitializeWrapperEvents = function(r) {
3270
- var n = qt();
3271
- r.addEventListener("wheel", t.onWheelZoom, n), r.addEventListener("dblclick", t.onDoubleClick, n), r.addEventListener("touchstart", t.onTouchPanningStart, n), r.addEventListener("touchmove", t.onTouchPanning, n), r.addEventListener("touchend", t.onTouchPanningStop, n);
3272
- }, this.handleInitialize = function(r) {
3273
- var n = t.setup.centerOnInit;
3274
- t.applyTransformation(), t.onInitCallbacks.forEach(function(i) {
3275
- return i(_(t));
3276
- }), n && (t.setCenter(), t.observer = new ResizeObserver(function() {
3277
- var i;
3278
- t.onInitCallbacks.forEach(function(a) {
3279
- return a(_(t));
3280
- }), t.setCenter(), (i = t.observer) === null || i === void 0 || i.disconnect();
3281
- }), t.observer.observe(r));
3282
- }, this.onWheelZoom = function(r) {
3283
- var n = t.setup.disabled;
3284
- if (!n) {
3285
- var i = ms(t, r);
3286
- if (i) {
3287
- var a = t.isPressingKeys(t.setup.wheel.activationKeys);
3288
- a && (Es(t, r), xs(t, r), Rs(t, r));
3289
- }
3290
- }
3291
- }, this.onPanningStart = function(r) {
3292
- var n = t.setup.disabled, i = t.props.onPanningStart;
3293
- if (!n) {
3294
- var a = Vo(t, r);
3295
- if (a) {
3296
- var s = t.isPressingKeys(t.setup.panning.activationKeys);
3297
- s && (r.preventDefault(), r.stopPropagation(), fe(t), Zo(t, r), Y(_(t), r, i));
3298
- }
3299
- }
3300
- }, this.onPanning = function(r) {
3301
- var n = t.setup.disabled, i = t.props.onPanning;
3302
- if (!n) {
3303
- var a = Ho(t);
3304
- if (a) {
3305
- var s = t.isPressingKeys(t.setup.panning.activationKeys);
3306
- s && (r.preventDefault(), r.stopPropagation(), Uo(t, r.clientX, r.clientY), Y(_(t), r, i));
3307
- }
3308
- }
3309
- }, this.onPanningStop = function(r) {
3310
- var n = t.props.onPanningStop;
3311
- t.isPanning && (rs(t), Y(_(t), r, n));
3312
- }, this.onPinchStart = function(r) {
3313
- var n = t.setup.disabled, i = t.props, a = i.onPinchingStart, s = i.onZoomStart;
3314
- if (!n) {
3315
- var u = ws(t, r);
3316
- u && (As(t, r), fe(t), Y(_(t), r, a), Y(_(t), r, s));
3317
- }
3318
- }, this.onPinch = function(r) {
3319
- var n = t.setup.disabled, i = t.props, a = i.onPinching, s = i.onZoom;
3320
- if (!n) {
3321
- var u = Ps(t);
3322
- u && (r.preventDefault(), r.stopPropagation(), Ds(t, r), Y(_(t), r, a), Y(_(t), r, s));
3323
- }
3324
- }, this.onPinchStop = function(r) {
3325
- var n = t.props, i = n.onPinchingStop, a = n.onZoomStop;
3326
- t.pinchStartScale && (Ns(t), Y(_(t), r, i), Y(_(t), r, a));
3327
- }, this.onTouchPanningStart = function(r) {
3328
- var n = t.setup.disabled, i = t.props.onPanningStart;
3329
- if (!n) {
3330
- var a = Vo(t, r);
3331
- if (a) {
3332
- var s = t.lastTouch && +/* @__PURE__ */ new Date() - t.lastTouch < 200;
3333
- if (s && r.touches.length === 1)
3334
- t.onDoubleClick(r);
3335
- else {
3336
- t.lastTouch = +/* @__PURE__ */ new Date(), fe(t);
3337
- var u = r.touches, d = u.length === 1, p = u.length === 2;
3338
- d && (fe(t), Zo(t, r), Y(_(t), r, i)), p && t.onPinchStart(r);
3339
- }
3340
- }
3341
- }
3342
- }, this.onTouchPanning = function(r) {
3343
- var n = t.setup.disabled, i = t.props.onPanning;
3344
- if (t.isPanning && r.touches.length === 1) {
3345
- if (n)
3346
- return;
3347
- var a = Ho(t);
3348
- if (!a)
3349
- return;
3350
- r.preventDefault(), r.stopPropagation();
3351
- var s = r.touches[0];
3352
- Uo(t, s.clientX, s.clientY), Y(_(t), r, i);
3353
- } else
3354
- r.touches.length > 1 && t.onPinch(r);
3355
- }, this.onTouchPanningStop = function(r) {
3356
- t.onPanningStop(r), t.onPinchStop(r);
3357
- }, this.onDoubleClick = function(r) {
3358
- var n = t.setup.disabled;
3359
- if (!n) {
3360
- var i = Ws(t, r);
3361
- i && _s(t, r);
3362
- }
3363
- }, this.clearPanning = function(r) {
3364
- t.isPanning && t.onPanningStop(r);
3365
- }, this.setKeyPressed = function(r) {
3366
- t.pressedKeys[r.key] = !0;
3367
- }, this.setKeyUnPressed = function(r) {
3368
- t.pressedKeys[r.key] = !1;
3369
- }, this.isPressingKeys = function(r) {
3370
- return r.length ? !!r.find(function(n) {
3371
- return t.pressedKeys[n];
3372
- }) : !0;
3373
- }, this.setTransformState = function(r, n, i) {
3374
- var a = t.props.onTransformed;
3375
- if (!Number.isNaN(r) && !Number.isNaN(n) && !Number.isNaN(i)) {
3376
- r !== t.transformState.scale && (t.transformState.previousScale = t.transformState.scale, t.transformState.scale = r), t.transformState.positionX = n, t.transformState.positionY = i, t.applyTransformation();
3377
- var s = _(t);
3378
- t.onChangeCallbacks.forEach(function(u) {
3379
- return u(s);
3380
- }), Y(s, { scale: r, positionX: n, positionY: i }, a);
3381
- } else
3382
- console.error("Detected NaN set state values");
3383
- }, this.setCenter = function() {
3384
- if (t.wrapperComponent && t.contentComponent) {
3385
- var r = Dr(t.transformState.scale, t.wrapperComponent, t.contentComponent);
3386
- t.setTransformState(r.scale, r.positionX, r.positionY);
3387
- }
3388
- }, this.handleTransformStyles = function(r, n, i) {
3389
- return t.props.customTransform ? t.props.customTransform(r, n, i) : cs(r, n, i);
3390
- }, this.applyTransformation = function() {
3391
- if (!(!t.mounted || !t.contentComponent)) {
3392
- var r = t.transformState, n = r.scale, i = r.positionX, a = r.positionY, s = t.handleTransformStyles(i, a, n);
3393
- t.contentComponent.style.transform = s;
3394
- }
3395
- }, this.getContext = function() {
3396
- return _(t);
3397
- }, this.onChange = function(r) {
3398
- return t.onChangeCallbacks.has(r) || t.onChangeCallbacks.add(r), function() {
3399
- t.onChangeCallbacks.delete(r);
3400
- };
3401
- }, this.onInit = function(r) {
3402
- return t.onInitCallbacks.has(r) || t.onInitCallbacks.add(r), function() {
3403
- t.onInitCallbacks.delete(r);
3404
- };
3405
- }, this.init = function(r, n) {
3406
- t.cleanupWindowEvents(), t.wrapperComponent = r, t.contentComponent = n, je(t, t.transformState.scale), t.handleInitializeWrapperEvents(r), t.handleInitialize(n), t.initializeWindowEvents(), t.isInitialized = !0;
3407
- var i = _(t);
3408
- Y(i, void 0, t.props.onInit);
3409
- }, this.props = o, this.setup = Ko(this.props), this.transformState = Er(this.props);
3410
- }
3411
- return e;
3412
- }()
3413
- ), Xt = Ne.createContext(null), Ys = function(e, o) {
3414
- return typeof e == "function" ? e(o) : e;
3415
- }, Bs = Ne.forwardRef(function(e, o) {
3416
- var t = Ot(new $s(e)).current, r = Ys(e.children, At(t));
3417
- return Jr(o, function() {
3418
- return At(t);
3419
- }, [t]), _t(function() {
3420
- t.update(e);
3421
- }, [t, e]), Ne.createElement(Xt.Provider, { value: t }, r);
3422
- });
3423
- Ne.forwardRef(function(e, o) {
3424
- var t = Ot(null), r = eo(Xt);
3425
- return _t(function() {
3426
- return r.onChange(function(n) {
3427
- if (t.current) {
3428
- var i = 0, a = 0;
3429
- t.current.style.transform = r.handleTransformStyles(i, a, 1 / n.instance.transformState.scale);
3430
- }
3431
- });
3432
- }, [r]), Ne.createElement("div", Ce({}, e, { ref: vs([t, o]) }));
3433
- });
3434
- function ks(e, o) {
3435
- o === void 0 && (o = {});
3436
- var t = o.insertAt;
3437
- if (!(!e || typeof document > "u")) {
3438
- var r = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
3439
- n.type = "text/css", t === "top" && r.firstChild ? r.insertBefore(n, r.firstChild) : r.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
3440
- }
3441
- }
3442
- var zs = `.transform-component-module_wrapper__SPB86 {
3443
- position: relative;
3444
- width: -moz-fit-content;
3445
- width: fit-content;
3446
- height: -moz-fit-content;
3447
- height: fit-content;
3448
- overflow: hidden;
3449
- -webkit-touch-callout: none; /* iOS Safari */
3450
- -webkit-user-select: none; /* Safari */
3451
- -khtml-user-select: none; /* Konqueror HTML */
3452
- -moz-user-select: none; /* Firefox */
3453
- -ms-user-select: none; /* Internet Explorer/Edge */
3454
- user-select: none;
3455
- margin: 0;
3456
- padding: 0;
3457
- }
3458
- .transform-component-module_content__FBWxo {
3459
- display: flex;
3460
- flex-wrap: wrap;
3461
- width: -moz-fit-content;
3462
- width: fit-content;
3463
- height: -moz-fit-content;
3464
- height: fit-content;
3465
- margin: 0;
3466
- padding: 0;
3467
- transform-origin: 0% 0%;
3468
- }
3469
- .transform-component-module_content__FBWxo img {
3470
- pointer-events: none;
3471
- }
3472
- `, Qo = { wrapper: "transform-component-module_wrapper__SPB86", content: "transform-component-module_content__FBWxo" };
3473
- ks(zs);
3474
- var Xs = function(e) {
3475
- var o = e.children, t = e.wrapperClass, r = t === void 0 ? "" : t, n = e.contentClass, i = n === void 0 ? "" : n, a = e.wrapperStyle, s = e.contentStyle, u = e.wrapperProps, d = u === void 0 ? {} : u, p = e.contentProps, f = p === void 0 ? {} : p, c = eo(Xt).init, v = Ot(null), h = Ot(null);
3476
- return _t(function() {
3477
- var m = v.current, g = h.current;
3478
- m !== null && g !== null && c && c(m, g);
3479
- }, []), Ne.createElement(
3480
- "div",
3481
- Ce({}, d, { ref: v, className: "react-transform-wrapper ".concat(Qo.wrapper, " ").concat(r), style: a }),
3482
- Ne.createElement("div", Ce({}, f, { ref: h, className: "react-transform-component ".concat(Qo.content, " ").concat(i), style: s }), o)
3483
- );
3484
- }, js = function() {
3485
- var e = eo(Xt);
3486
- if (!e)
3487
- throw new Error("Transform context must be placed inside TransformWrapper");
3488
- return e;
3489
- }, Ls = function() {
3490
- var e = js();
3491
- return At(e);
3492
- };
3493
- const Vs = {
1
+ import { jsx as t, jsxs as y } from "react/jsx-runtime";
2
+ import { useState as x, useEffect as n, useMemo as w } from "react";
3
+ import { B as m, T as C, Z as S, a as W } from "../../../ZoomControllers-7fb8d495.js";
4
+ const D = {
3494
5
  position: "relative",
3495
6
  borderRadius: "1rem",
3496
7
  overflow: "hidden"
3497
- }, Hs = {
3498
- position: "absolute",
3499
- zIndex: 1,
3500
- right: "2rem",
3501
- bottom: "2rem",
3502
- width: "fit-content",
3503
- display: "flex",
3504
- flexDirection: "column",
3505
- justifyContent: "flex-end",
3506
- backgroundColor: "#0F0E0E4D",
3507
- borderRadius: "5rem"
3508
- }, Ct = {
3509
- color: "white",
3510
- "&:focus": {
3511
- outline: "none"
3512
- }
3513
- }, Go = {
3514
- backgroundColor: "#0000000D",
3515
- height: "0.0625rem"
3516
- }, Fs = {
3517
- ...Ct,
3518
- position: "absolute",
3519
- zIndex: 1,
3520
- right: "2rem",
3521
- bottom: "10rem",
3522
- background: "#0F0E0E4D",
3523
- color: "white",
3524
- padding: "0.55rem"
3525
- }, Zs = ({
3526
- controllerContainerProps: e,
3527
- zoomInButtonProps: o,
3528
- zoomOutButtonProps: t,
3529
- resetTransformButtonProps: r,
3530
- dividerProps: n,
3531
- handleRotate: i,
3532
- rotateButtonProps: a
8
+ }, v = ({
9
+ children: c,
10
+ parentContainerProps: l,
11
+ zoomControllerProps: f,
12
+ defaultRotationAngle: p,
13
+ onRotate: o,
14
+ height: s,
15
+ width: a,
16
+ rotatedImageScale: i = 0.55,
17
+ ...d
3533
18
  }) => {
3534
- const { zoomIn: s, zoomOut: u, resetTransform: d } = Ls();
3535
- function p() {
3536
- s();
3537
- }
3538
- function f() {
3539
- u();
3540
- }
3541
- function c() {
3542
- d();
3543
- }
3544
- return /* @__PURE__ */ Ie(Zr, { children: [
3545
- /* @__PURE__ */ N(wt, { title: "Rotate", placement: "left", children: /* @__PURE__ */ N(
3546
- ht,
3547
- {
3548
- disableRipple: !0,
3549
- disableFocusRipple: !0,
3550
- "aria-label": "Rotate",
3551
- onClick: i,
3552
- sx: Fs,
3553
- ...a,
3554
- children: /* @__PURE__ */ N(wr, {})
3555
- }
3556
- ) }),
3557
- /* @__PURE__ */ Ie(
3558
- mr,
3559
- {
3560
- disableGutters: !0,
3561
- sx: Hs,
3562
- ...e,
3563
- children: [
3564
- /* @__PURE__ */ N(wt, { title: "Zoom In", placement: "left", children: /* @__PURE__ */ N(
3565
- ht,
3566
- {
3567
- disableRipple: !0,
3568
- disableFocusRipple: !0,
3569
- "aria-label": "Zoom In",
3570
- onClick: p,
3571
- sx: Ct,
3572
- ...o,
3573
- children: /* @__PURE__ */ N(gr, {})
3574
- }
3575
- ) }),
3576
- /* @__PURE__ */ N(Lo, { sx: Go, ...n }),
3577
- /* @__PURE__ */ N(wt, { title: "Zoom Out", placement: "left", children: /* @__PURE__ */ N(
3578
- ht,
3579
- {
3580
- disableFocusRipple: !0,
3581
- disableRipple: !0,
3582
- "aria-label": "Zoom Out",
3583
- onClick: f,
3584
- sx: Ct,
3585
- ...t,
3586
- children: /* @__PURE__ */ N(yr, {})
3587
- }
3588
- ) }),
3589
- /* @__PURE__ */ N(Lo, { sx: Go, ...n }),
3590
- /* @__PURE__ */ N(wt, { title: "Reset", placement: "left", children: /* @__PURE__ */ N(
3591
- ht,
3592
- {
3593
- disableFocusRipple: !0,
3594
- disableRipple: !0,
3595
- "aria-label": "Reset",
3596
- onClick: c,
3597
- sx: Ct,
3598
- ...r,
3599
- children: /* @__PURE__ */ N(br, {})
3600
- }
3601
- ) })
3602
- ]
3603
- }
3604
- )
3605
- ] });
3606
- }, nl = ({
3607
- children: e,
3608
- parentContainerProps: o,
3609
- zoomControllerProps: t,
3610
- defaultRotationAngle: r,
3611
- onRotate: n,
3612
- ...i
3613
- }) => {
3614
- const [a, s] = Ir(r ?? "0");
19
+ const [r, h] = x(p ?? "0");
3615
20
  function u() {
3616
- s((p) => ((parseInt(p) + 90) % 360).toString());
3617
- }
3618
- _t(() => {
3619
- n == null || n(a);
3620
- }, [a]);
3621
- const d = {
3622
- transform: `rotate(${a}deg)`
3623
- };
3624
- return /* @__PURE__ */ N(
3625
- mr,
21
+ h((e) => ((parseInt(e) + 90) % 360).toString());
22
+ }
23
+ n(() => {
24
+ const e = document.querySelector(".react-transform-wrapper");
25
+ e && (e.style.width = "100%", e.style.height = "100%");
26
+ }, []), n(() => {
27
+ const e = document.querySelector(".react-transform-component");
28
+ e && (e.style.transformOrigin = "center center", e.style.height = s ?? "100%", e.style.width = a ?? "100%");
29
+ }, [a, s]), n(() => {
30
+ o == null || o(r);
31
+ }, [r]);
32
+ const g = w(() => ({
33
+ transform: `rotate(${r}deg) scale(${parseInt(r) === 0 || parseInt(r) === 180 ? 1 : i})`,
34
+ width: "100%",
35
+ height: "100%",
36
+ "& img": {
37
+ height: "100%"
38
+ }
39
+ }), [r, i]);
40
+ return /* @__PURE__ */ t(
41
+ m,
3626
42
  {
3627
- disableGutters: !0,
3628
- sx: Vs,
3629
- ...o,
3630
- children: /* @__PURE__ */ Ie(Bs, { ...i, children: [
3631
- /* @__PURE__ */ N(
3632
- Zs,
43
+ sx: D,
44
+ ...l,
45
+ children: /* @__PURE__ */ y(C, { ...d, children: [
46
+ /* @__PURE__ */ t(
47
+ S,
3633
48
  {
3634
49
  handleRotate: u,
3635
- ...t
50
+ ...f
3636
51
  }
3637
52
  ),
3638
- /* @__PURE__ */ N(Xs, { children: /* @__PURE__ */ N(Ji, { sx: d, children: e }) })
53
+ /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(m, { sx: g, children: c }) })
3639
54
  ] })
3640
55
  }
3641
56
  );
3642
57
  };
3643
58
  export {
3644
- nl as default
59
+ v as default
3645
60
  };