@hybridcore/ui 1.6.13 → 1.6.14

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.
Files changed (95) hide show
  1. package/dist/AccordionSummary-DUtr16g6.js +781 -0
  2. package/dist/Add-Bk8R160M.js +403 -0
  3. package/dist/Button-Cem3nbwc.js +357 -0
  4. package/dist/ButtonBase-DObmf4Q_.js +886 -0
  5. package/dist/Delete-CVJ6FeDn.js +203 -0
  6. package/dist/FormGroup-BRj1o7-E.js +89 -0
  7. package/dist/InputLabel-CjD30ZHz.js +341 -0
  8. package/dist/MenuItem-BKvRGLvM.js +233 -0
  9. package/dist/Modal-BVYydOr5.js +1156 -0
  10. package/dist/Paper-B1HV8GyO.js +582 -0
  11. package/dist/Select-Bfhvigsx.js +3914 -0
  12. package/dist/Source-BSZST_GH.js +4410 -0
  13. package/dist/SwitchBase-BEK49kdS.js +235 -0
  14. package/dist/Text-ChJRuaD8.js +2197 -0
  15. package/dist/TextField-Ca9ykixI.js +696 -0
  16. package/dist/TransitionGroupContext-Ja2CgIob.js +96 -0
  17. package/dist/Typography-D3X-Y5fh.js +178 -0
  18. package/dist/Vector-BmuhQO4p.js +3606 -0
  19. package/dist/Vector-DfTqQEln.js +1735 -0
  20. package/dist/WKT-2wsDT-nq.js +2310 -0
  21. package/dist/{_commonjsHelpers-BVfed4GL.js → _commonjsHelpers-BkfeUUK-.js} +2 -2
  22. package/dist/assertThisInitialized-C1dAyb4j.js +7 -0
  23. package/dist/assets/index.css +1 -1
  24. package/dist/assets/index2.css +1 -1
  25. package/dist/assets/index3.css +1 -0
  26. package/dist/assets/index4.css +1 -0
  27. package/dist/clsx-OuTLNxxd.js +16 -0
  28. package/dist/components/button/styled.js +1 -1
  29. package/dist/components/charts/_common/format.js +126 -82
  30. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +1 -1
  31. package/dist/components/collapsible-card/index.js +30 -21
  32. package/dist/components/collapsible-card/styled.js +14 -16
  33. package/dist/components/color-picker/index.js +3358 -2228
  34. package/dist/components/color-picker/styled.js +7 -87
  35. package/dist/components/confirm/dialog.js +7 -89
  36. package/dist/components/confirm/index.js +1 -1
  37. package/dist/components/data-map/index.js +1 -1
  38. package/dist/components/data-map/logic.js +20 -20
  39. package/dist/components/data-security-selectors/dissemination-list/index.js +3117 -32
  40. package/dist/components/date-range-picker/index.js +454 -466
  41. package/dist/components/document-viewer/components/viewer/index.js +1 -1
  42. package/dist/components/duration-select/index.js +10 -10
  43. package/dist/components/duration-select/styled.js +1 -1
  44. package/dist/components/geometry-picker/coordinate/index.js +14 -14
  45. package/dist/components/geometry-picker/edit/index.js +1 -1
  46. package/dist/components/geometry-picker/geometry/index.js +1 -1
  47. package/dist/components/geometry-picker/kml/index.js +11 -11
  48. package/dist/components/geometry-picker/map/logic.js +3656 -145
  49. package/dist/components/geometry-picker/map/style.js +17 -18
  50. package/dist/components/geometry-picker/parser/coordinate-input/logic.js +1255 -43
  51. package/dist/components/heat-map/index.js +1 -1
  52. package/dist/components/heat-map/logic.js +1924 -77
  53. package/dist/components/instance-form/components/composite-matrix/components/json-editor/index.js +2 -2
  54. package/dist/components/instance-hierarchy-table/styled.js +16 -18
  55. package/dist/components/map/helpers/mapbox.js +15 -17
  56. package/dist/components/map/helpers/ol.js +27 -386
  57. package/dist/components/map/index.js +10 -11
  58. package/dist/components/map/logic.js +22 -22
  59. package/dist/components/map/styled.js +27 -31
  60. package/dist/components/phone-input/index.js +9 -10
  61. package/dist/components/property-mapping/index.js +1 -1
  62. package/dist/components/prr-map/index.js +1 -1
  63. package/dist/components/prr-map/logic.js +26 -27
  64. package/dist/components/raster-grid-map/index.js +1 -1
  65. package/dist/components/raster-grid-map/logic.js +57 -60
  66. package/dist/components/sortable-list/index.js +1264 -1091
  67. package/dist/components/template-form/components/property-list/index.js +32 -36
  68. package/dist/components/template-form/components/property-list/property-list-columns.js +17 -19
  69. package/dist/components/template-form/components/property-list/property-list-form.js +600 -137
  70. package/dist/components/template-form/components/recognition-property-list/index.js +36 -40
  71. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +9 -11
  72. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +64 -57
  73. package/dist/components/tree-select/index.js +16 -16
  74. package/dist/createChainedFunction-C0nujS3O.js +9 -0
  75. package/dist/createSvgIcon-BghzB2Y9.js +93 -0
  76. package/dist/createSvgIcon-D7U1nd99.js +185 -0
  77. package/dist/debounce-46wSf_lW.js +15 -0
  78. package/dist/dialog-BtJhjyF5.js +664 -0
  79. package/dist/extends-C3382pL0.js +22 -0
  80. package/dist/formControlState-vgaj2ksH.js +10 -0
  81. package/dist/generateUtilityClasses-Cc-owZ4J.js +2971 -0
  82. package/dist/{index-C__OZmYy.js → index-CblbdqjE.js} +1 -1
  83. package/dist/index-DH6qsPBn.js +153 -0
  84. package/dist/index.esm-DAf19hyR.js +318 -0
  85. package/dist/math-Bvt2Ubuz.js +704 -0
  86. package/dist/ol-yOE-NV0X.js +7465 -0
  87. package/dist/ownerWindow-wg6foiOE.js +10 -0
  88. package/dist/setPrototypeOf-NPgp4cYc.js +8 -0
  89. package/dist/styled-DD4BkuVf.js +350 -0
  90. package/dist/useControlled-BYdyS7Pn.js +31 -0
  91. package/dist/useFormControl-CatNKXAi.js +10 -0
  92. package/dist/useId-BW-oWmul.js +19 -0
  93. package/dist/useSlot-u4t0X96G.js +42 -0
  94. package/package.json +1 -1
  95. package/dist/index.esm-UfGMjYOL.js +0 -197
@@ -0,0 +1,886 @@
1
+ import { a as X, _ as ae } from "./extends-C3382pL0.js";
2
+ import * as c from "react";
3
+ import W, { Children as Ye, isValidElement as G, cloneElement as J } from "react";
4
+ import { P as t } from "./index-CblbdqjE.js";
5
+ import { c as v } from "./clsx-OuTLNxxd.js";
6
+ import { g as Ee, s as ue, u as Ce, a as qe, c as We } from "./generateUtilityClasses-Cc-owZ4J.js";
7
+ import { keyframes as le } from "@mui/system";
8
+ import { jsx as U, jsxs as He } from "react/jsx-runtime";
9
+ import { T as Ge, _ as Je, d as be, e as Qe, u as ge, b as H, r as Ze, f as et } from "./TransitionGroupContext-Ja2CgIob.js";
10
+ import { _ as tt } from "./assertThisInitialized-C1dAyb4j.js";
11
+ let Q = !0, ie = !1;
12
+ const nt = new Ge(), ot = {
13
+ text: !0,
14
+ search: !0,
15
+ url: !0,
16
+ tel: !0,
17
+ email: !0,
18
+ password: !0,
19
+ number: !0,
20
+ date: !0,
21
+ month: !0,
22
+ week: !0,
23
+ time: !0,
24
+ datetime: !0,
25
+ "datetime-local": !0
26
+ };
27
+ function rt(e) {
28
+ const {
29
+ type: n,
30
+ tagName: i
31
+ } = e;
32
+ return !!(i === "INPUT" && ot[n] && !e.readOnly || i === "TEXTAREA" && !e.readOnly || e.isContentEditable);
33
+ }
34
+ function it(e) {
35
+ e.metaKey || e.altKey || e.ctrlKey || (Q = !0);
36
+ }
37
+ function re() {
38
+ Q = !1;
39
+ }
40
+ function st() {
41
+ this.visibilityState === "hidden" && ie && (Q = !0);
42
+ }
43
+ function at(e) {
44
+ e.addEventListener("keydown", it, !0), e.addEventListener("mousedown", re, !0), e.addEventListener("pointerdown", re, !0), e.addEventListener("touchstart", re, !0), e.addEventListener("visibilitychange", st, !0);
45
+ }
46
+ function ut(e) {
47
+ const {
48
+ target: n
49
+ } = e;
50
+ try {
51
+ return n.matches(":focus-visible");
52
+ } catch {
53
+ }
54
+ return Q || rt(n);
55
+ }
56
+ function lt() {
57
+ const e = c.useCallback((o) => {
58
+ o != null && at(o.ownerDocument);
59
+ }, []), n = c.useRef(!1);
60
+ function i() {
61
+ return n.current ? (ie = !0, nt.start(100, () => {
62
+ ie = !1;
63
+ }), n.current = !1, !0) : !1;
64
+ }
65
+ function u(o) {
66
+ return ut(o) ? (n.current = !0, !0) : !1;
67
+ }
68
+ return {
69
+ isFocusVisibleRef: n,
70
+ onFocus: u,
71
+ onBlur: i,
72
+ ref: e
73
+ };
74
+ }
75
+ function ce(e, n) {
76
+ var i = function(r) {
77
+ return n && G(r) ? n(r) : r;
78
+ }, u = /* @__PURE__ */ Object.create(null);
79
+ return e && Ye.map(e, function(o) {
80
+ return o;
81
+ }).forEach(function(o) {
82
+ u[o.key] = i(o);
83
+ }), u;
84
+ }
85
+ function ct(e, n) {
86
+ e = e || {}, n = n || {};
87
+ function i(h) {
88
+ return h in n ? n[h] : e[h];
89
+ }
90
+ var u = /* @__PURE__ */ Object.create(null), o = [];
91
+ for (var r in e)
92
+ r in n ? o.length && (u[r] = o, o = []) : o.push(r);
93
+ var s, p = {};
94
+ for (var l in n) {
95
+ if (u[l])
96
+ for (s = 0; s < u[l].length; s++) {
97
+ var f = u[l][s];
98
+ p[u[l][s]] = i(f);
99
+ }
100
+ p[l] = i(l);
101
+ }
102
+ for (s = 0; s < o.length; s++)
103
+ p[o[s]] = i(o[s]);
104
+ return p;
105
+ }
106
+ function S(e, n, i) {
107
+ return i[n] != null ? i[n] : e.props[n];
108
+ }
109
+ function pt(e, n) {
110
+ return ce(e.children, function(i) {
111
+ return J(i, {
112
+ onExited: n.bind(null, i),
113
+ in: !0,
114
+ appear: S(i, "appear", e),
115
+ enter: S(i, "enter", e),
116
+ exit: S(i, "exit", e)
117
+ });
118
+ });
119
+ }
120
+ function ft(e, n, i) {
121
+ var u = ce(e.children), o = ct(n, u);
122
+ return Object.keys(o).forEach(function(r) {
123
+ var s = o[r];
124
+ if (G(s)) {
125
+ var p = r in n, l = r in u, f = n[r], h = G(f) && !f.props.in;
126
+ l && (!p || h) ? o[r] = J(s, {
127
+ onExited: i.bind(null, s),
128
+ in: !0,
129
+ exit: S(s, "exit", e),
130
+ enter: S(s, "enter", e)
131
+ }) : !l && p && !h ? o[r] = J(s, {
132
+ in: !1
133
+ }) : l && p && G(f) && (o[r] = J(s, {
134
+ onExited: i.bind(null, s),
135
+ in: f.props.in,
136
+ exit: S(s, "exit", e),
137
+ enter: S(s, "enter", e)
138
+ }));
139
+ }
140
+ }), o;
141
+ }
142
+ var dt = Object.values || function(e) {
143
+ return Object.keys(e).map(function(n) {
144
+ return e[n];
145
+ });
146
+ }, ht = {
147
+ component: "div",
148
+ childFactory: function(n) {
149
+ return n;
150
+ }
151
+ }, pe = /* @__PURE__ */ function(e) {
152
+ Je(n, e);
153
+ function n(u, o) {
154
+ var r;
155
+ r = e.call(this, u, o) || this;
156
+ var s = r.handleExited.bind(tt(r));
157
+ return r.state = {
158
+ contextValue: {
159
+ isMounting: !0
160
+ },
161
+ handleExited: s,
162
+ firstRender: !0
163
+ }, r;
164
+ }
165
+ var i = n.prototype;
166
+ return i.componentDidMount = function() {
167
+ this.mounted = !0, this.setState({
168
+ contextValue: {
169
+ isMounting: !1
170
+ }
171
+ });
172
+ }, i.componentWillUnmount = function() {
173
+ this.mounted = !1;
174
+ }, n.getDerivedStateFromProps = function(o, r) {
175
+ var s = r.children, p = r.handleExited, l = r.firstRender;
176
+ return {
177
+ children: l ? pt(o, p) : ft(o, s, p),
178
+ firstRender: !1
179
+ };
180
+ }, i.handleExited = function(o, r) {
181
+ var s = ce(this.props.children);
182
+ o.key in s || (o.props.onExited && o.props.onExited(r), this.mounted && this.setState(function(p) {
183
+ var l = X({}, p.children);
184
+ return delete l[o.key], {
185
+ children: l
186
+ };
187
+ }));
188
+ }, i.render = function() {
189
+ var o = this.props, r = o.component, s = o.childFactory, p = ae(o, ["component", "childFactory"]), l = this.state.contextValue, f = dt(this.state.children).map(s);
190
+ return delete p.appear, delete p.enter, delete p.exit, r === null ? /* @__PURE__ */ W.createElement(be.Provider, {
191
+ value: l
192
+ }, f) : /* @__PURE__ */ W.createElement(be.Provider, {
193
+ value: l
194
+ }, /* @__PURE__ */ W.createElement(r, p, f));
195
+ }, n;
196
+ }(W.Component);
197
+ pe.propTypes = process.env.NODE_ENV !== "production" ? {
198
+ /**
199
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
200
+ * behavior by providing a `component` prop.
201
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
202
+ * you can pass in `component={null}`. This is useful if the wrapping div
203
+ * borks your css styles.
204
+ */
205
+ component: t.any,
206
+ /**
207
+ * A set of `<Transition>` components, that are toggled `in` and out as they
208
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
209
+ * remember to spread them through if you are wrapping the `<Transition>` as
210
+ * with our `<Fade>` example.
211
+ *
212
+ * While this component is meant for multiple `Transition` or `CSSTransition`
213
+ * children, sometimes you may want to have a single transition child with
214
+ * content that you want to be transitioned out and in when you change it
215
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
216
+ * the transition child as you change its content, this will cause
217
+ * `TransitionGroup` to transition the child out and back in.
218
+ */
219
+ children: t.node,
220
+ /**
221
+ * A convenience prop that enables or disables appear animations
222
+ * for all children. Note that specifying this will override any defaults set
223
+ * on individual children Transitions.
224
+ */
225
+ appear: t.bool,
226
+ /**
227
+ * A convenience prop that enables or disables enter animations
228
+ * for all children. Note that specifying this will override any defaults set
229
+ * on individual children Transitions.
230
+ */
231
+ enter: t.bool,
232
+ /**
233
+ * A convenience prop that enables or disables exit animations
234
+ * for all children. Note that specifying this will override any defaults set
235
+ * on individual children Transitions.
236
+ */
237
+ exit: t.bool,
238
+ /**
239
+ * You may need to apply reactive updates to a child as it is exiting.
240
+ * This is generally done by using `cloneElement` however in the case of an exiting
241
+ * child the element has already been removed and not accessible to the consumer.
242
+ *
243
+ * If you do need to update a child as it leaves you can provide a `childFactory`
244
+ * to wrap every child, even the ones that are leaving.
245
+ *
246
+ * @type Function(child: ReactElement) -> ReactElement
247
+ */
248
+ childFactory: t.func
249
+ } : {};
250
+ pe.defaultProps = ht;
251
+ function ve(e) {
252
+ const {
253
+ className: n,
254
+ classes: i,
255
+ pulsate: u = !1,
256
+ rippleX: o,
257
+ rippleY: r,
258
+ rippleSize: s,
259
+ in: p,
260
+ onExited: l,
261
+ timeout: f
262
+ } = e, [h, R] = c.useState(!1), g = v(n, i.ripple, i.rippleVisible, u && i.ripplePulsate), x = {
263
+ width: s,
264
+ height: s,
265
+ top: -(s / 2) + r,
266
+ left: -(s / 2) + o
267
+ }, m = v(i.child, h && i.childLeaving, u && i.childPulsate);
268
+ return !p && !h && R(!0), c.useEffect(() => {
269
+ if (!p && l != null) {
270
+ const T = setTimeout(l, f);
271
+ return () => {
272
+ clearTimeout(T);
273
+ };
274
+ }
275
+ }, [l, p, f]), /* @__PURE__ */ U("span", {
276
+ className: g,
277
+ style: x,
278
+ children: /* @__PURE__ */ U("span", {
279
+ className: m
280
+ })
281
+ });
282
+ }
283
+ process.env.NODE_ENV !== "production" && (ve.propTypes = {
284
+ /**
285
+ * Override or extend the styles applied to the component.
286
+ */
287
+ classes: t.object.isRequired,
288
+ className: t.string,
289
+ /**
290
+ * @ignore - injected from TransitionGroup
291
+ */
292
+ in: t.bool,
293
+ /**
294
+ * @ignore - injected from TransitionGroup
295
+ */
296
+ onExited: t.func,
297
+ /**
298
+ * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.
299
+ */
300
+ pulsate: t.bool,
301
+ /**
302
+ * Diameter of the ripple.
303
+ */
304
+ rippleSize: t.number,
305
+ /**
306
+ * Horizontal position of the ripple center.
307
+ */
308
+ rippleX: t.number,
309
+ /**
310
+ * Vertical position of the ripple center.
311
+ */
312
+ rippleY: t.number,
313
+ /**
314
+ * exit delay
315
+ */
316
+ timeout: t.number.isRequired
317
+ });
318
+ const b = Ee("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsate", "child", "childLeaving", "childPulsate"]), mt = ["center", "classes", "className"];
319
+ let Z = (e) => e, ye, Re, Te, Me;
320
+ const se = 550, bt = 80, gt = le(ye || (ye = Z`
321
+ 0% {
322
+ transform: scale(0);
323
+ opacity: 0.1;
324
+ }
325
+
326
+ 100% {
327
+ transform: scale(1);
328
+ opacity: 0.3;
329
+ }
330
+ `)), yt = le(Re || (Re = Z`
331
+ 0% {
332
+ opacity: 1;
333
+ }
334
+
335
+ 100% {
336
+ opacity: 0;
337
+ }
338
+ `)), Rt = le(Te || (Te = Z`
339
+ 0% {
340
+ transform: scale(1);
341
+ }
342
+
343
+ 50% {
344
+ transform: scale(0.92);
345
+ }
346
+
347
+ 100% {
348
+ transform: scale(1);
349
+ }
350
+ `)), Tt = ue("span", {
351
+ name: "MuiTouchRipple",
352
+ slot: "Root"
353
+ })({
354
+ overflow: "hidden",
355
+ pointerEvents: "none",
356
+ position: "absolute",
357
+ zIndex: 0,
358
+ top: 0,
359
+ right: 0,
360
+ bottom: 0,
361
+ left: 0,
362
+ borderRadius: "inherit"
363
+ }), Mt = ue(ve, {
364
+ name: "MuiTouchRipple",
365
+ slot: "Ripple"
366
+ })(Me || (Me = Z`
367
+ opacity: 0;
368
+ position: absolute;
369
+
370
+ &.${0} {
371
+ opacity: 0.3;
372
+ transform: scale(1);
373
+ animation-name: ${0};
374
+ animation-duration: ${0}ms;
375
+ animation-timing-function: ${0};
376
+ }
377
+
378
+ &.${0} {
379
+ animation-duration: ${0}ms;
380
+ }
381
+
382
+ & .${0} {
383
+ opacity: 1;
384
+ display: block;
385
+ width: 100%;
386
+ height: 100%;
387
+ border-radius: 50%;
388
+ background-color: currentColor;
389
+ }
390
+
391
+ & .${0} {
392
+ opacity: 0;
393
+ animation-name: ${0};
394
+ animation-duration: ${0}ms;
395
+ animation-timing-function: ${0};
396
+ }
397
+
398
+ & .${0} {
399
+ position: absolute;
400
+ /* @noflip */
401
+ left: 0px;
402
+ top: 0;
403
+ animation-name: ${0};
404
+ animation-duration: 2500ms;
405
+ animation-timing-function: ${0};
406
+ animation-iteration-count: infinite;
407
+ animation-delay: 200ms;
408
+ }
409
+ `), b.rippleVisible, gt, se, ({
410
+ theme: e
411
+ }) => e.transitions.easing.easeInOut, b.ripplePulsate, ({
412
+ theme: e
413
+ }) => e.transitions.duration.shorter, b.child, b.childLeaving, yt, se, ({
414
+ theme: e
415
+ }) => e.transitions.easing.easeInOut, b.childPulsate, Rt, ({
416
+ theme: e
417
+ }) => e.transitions.easing.easeInOut), xe = /* @__PURE__ */ c.forwardRef(function(n, i) {
418
+ const u = Ce({
419
+ props: n,
420
+ name: "MuiTouchRipple"
421
+ }), {
422
+ center: o = !1,
423
+ classes: r = {},
424
+ className: s
425
+ } = u, p = ae(u, mt), [l, f] = c.useState([]), h = c.useRef(0), R = c.useRef(null);
426
+ c.useEffect(() => {
427
+ R.current && (R.current(), R.current = null);
428
+ }, [l]);
429
+ const g = c.useRef(!1), x = Qe(), m = c.useRef(null), T = c.useRef(null), $ = c.useCallback((d) => {
430
+ const {
431
+ pulsate: M,
432
+ rippleX: E,
433
+ rippleY: L,
434
+ rippleSize: I,
435
+ cb: K
436
+ } = d;
437
+ f((C) => [...C, /* @__PURE__ */ U(Mt, {
438
+ classes: {
439
+ ripple: v(r.ripple, b.ripple),
440
+ rippleVisible: v(r.rippleVisible, b.rippleVisible),
441
+ ripplePulsate: v(r.ripplePulsate, b.ripplePulsate),
442
+ child: v(r.child, b.child),
443
+ childLeaving: v(r.childLeaving, b.childLeaving),
444
+ childPulsate: v(r.childPulsate, b.childPulsate)
445
+ },
446
+ timeout: se,
447
+ pulsate: M,
448
+ rippleX: E,
449
+ rippleY: L,
450
+ rippleSize: I
451
+ }, h.current)]), h.current += 1, R.current = K;
452
+ }, [r]), O = c.useCallback((d = {}, M = {}, E = () => {
453
+ }) => {
454
+ const {
455
+ pulsate: L = !1,
456
+ center: I = o || M.pulsate,
457
+ fakeElement: K = !1
458
+ // For test purposes
459
+ } = M;
460
+ if ((d == null ? void 0 : d.type) === "mousedown" && g.current) {
461
+ g.current = !1;
462
+ return;
463
+ }
464
+ (d == null ? void 0 : d.type) === "touchstart" && (g.current = !0);
465
+ const C = K ? null : T.current, P = C ? C.getBoundingClientRect() : {
466
+ width: 0,
467
+ height: 0,
468
+ left: 0,
469
+ top: 0
470
+ };
471
+ let V, w, B;
472
+ if (I || d === void 0 || d.clientX === 0 && d.clientY === 0 || !d.clientX && !d.touches)
473
+ V = Math.round(P.width / 2), w = Math.round(P.height / 2);
474
+ else {
475
+ const {
476
+ clientX: F,
477
+ clientY: D
478
+ } = d.touches && d.touches.length > 0 ? d.touches[0] : d;
479
+ V = Math.round(F - P.left), w = Math.round(D - P.top);
480
+ }
481
+ if (I)
482
+ B = Math.sqrt((2 * P.width ** 2 + P.height ** 2) / 3), B % 2 === 0 && (B += 1);
483
+ else {
484
+ const F = Math.max(Math.abs((C ? C.clientWidth : 0) - V), V) * 2 + 2, D = Math.max(Math.abs((C ? C.clientHeight : 0) - w), w) * 2 + 2;
485
+ B = Math.sqrt(F ** 2 + D ** 2);
486
+ }
487
+ d != null && d.touches ? m.current === null && (m.current = () => {
488
+ $({
489
+ pulsate: L,
490
+ rippleX: V,
491
+ rippleY: w,
492
+ rippleSize: B,
493
+ cb: E
494
+ });
495
+ }, x.start(bt, () => {
496
+ m.current && (m.current(), m.current = null);
497
+ })) : $({
498
+ pulsate: L,
499
+ rippleX: V,
500
+ rippleY: w,
501
+ rippleSize: B,
502
+ cb: E
503
+ });
504
+ }, [o, $, x]), j = c.useCallback(() => {
505
+ O({}, {
506
+ pulsate: !0
507
+ });
508
+ }, [O]), _ = c.useCallback((d, M) => {
509
+ if (x.clear(), (d == null ? void 0 : d.type) === "touchend" && m.current) {
510
+ m.current(), m.current = null, x.start(0, () => {
511
+ _(d, M);
512
+ });
513
+ return;
514
+ }
515
+ m.current = null, f((E) => E.length > 0 ? E.slice(1) : E), R.current = M;
516
+ }, [x]);
517
+ return c.useImperativeHandle(i, () => ({
518
+ pulsate: j,
519
+ start: O,
520
+ stop: _
521
+ }), [j, O, _]), /* @__PURE__ */ U(Tt, X({
522
+ className: v(b.root, r.root, s),
523
+ ref: T
524
+ }, p, {
525
+ children: /* @__PURE__ */ U(pe, {
526
+ component: null,
527
+ exit: !0,
528
+ children: l
529
+ })
530
+ }));
531
+ });
532
+ process.env.NODE_ENV !== "production" && (xe.propTypes = {
533
+ /**
534
+ * If `true`, the ripple starts at the center of the component
535
+ * rather than at the point of interaction.
536
+ */
537
+ center: t.bool,
538
+ /**
539
+ * Override or extend the styles applied to the component.
540
+ */
541
+ classes: t.object,
542
+ /**
543
+ * @ignore
544
+ */
545
+ className: t.string
546
+ });
547
+ function Et(e) {
548
+ return qe("MuiButtonBase", e);
549
+ }
550
+ const Ct = Ee("MuiButtonBase", ["root", "disabled", "focusVisible"]), vt = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"], xt = (e) => {
551
+ const {
552
+ disabled: n,
553
+ focusVisible: i,
554
+ focusVisibleClassName: u,
555
+ classes: o
556
+ } = e, s = We({
557
+ root: ["root", n && "disabled", i && "focusVisible"]
558
+ }, Et, o);
559
+ return i && u && (s.root += ` ${u}`), s;
560
+ }, Vt = ue("button", {
561
+ name: "MuiButtonBase",
562
+ slot: "Root",
563
+ overridesResolver: (e, n) => n.root
564
+ })({
565
+ display: "inline-flex",
566
+ alignItems: "center",
567
+ justifyContent: "center",
568
+ position: "relative",
569
+ boxSizing: "border-box",
570
+ WebkitTapHighlightColor: "transparent",
571
+ backgroundColor: "transparent",
572
+ // Reset default value
573
+ // We disable the focus ring for mouse, touch and keyboard users.
574
+ outline: 0,
575
+ border: 0,
576
+ margin: 0,
577
+ // Remove the margin in Safari
578
+ borderRadius: 0,
579
+ padding: 0,
580
+ // Remove the padding in Firefox
581
+ cursor: "pointer",
582
+ userSelect: "none",
583
+ verticalAlign: "middle",
584
+ MozAppearance: "none",
585
+ // Reset
586
+ WebkitAppearance: "none",
587
+ // Reset
588
+ textDecoration: "none",
589
+ // So we take precedent over the style of a native <a /> element.
590
+ color: "inherit",
591
+ "&::-moz-focus-inner": {
592
+ borderStyle: "none"
593
+ // Remove Firefox dotted outline.
594
+ },
595
+ [`&.${Ct.disabled}`]: {
596
+ pointerEvents: "none",
597
+ // Disable link interactions
598
+ cursor: "default"
599
+ },
600
+ "@media print": {
601
+ colorAdjust: "exact"
602
+ }
603
+ }), Dt = /* @__PURE__ */ c.forwardRef(function(n, i) {
604
+ const u = Ce({
605
+ props: n,
606
+ name: "MuiButtonBase"
607
+ }), {
608
+ action: o,
609
+ centerRipple: r = !1,
610
+ children: s,
611
+ className: p,
612
+ component: l = "button",
613
+ disabled: f = !1,
614
+ disableRipple: h = !1,
615
+ disableTouchRipple: R = !1,
616
+ focusRipple: g = !1,
617
+ LinkComponent: x = "a",
618
+ onBlur: m,
619
+ onClick: T,
620
+ onContextMenu: $,
621
+ onDragLeave: O,
622
+ onFocus: j,
623
+ onFocusVisible: _,
624
+ onKeyDown: d,
625
+ onKeyUp: M,
626
+ onMouseDown: E,
627
+ onMouseLeave: L,
628
+ onMouseUp: I,
629
+ onTouchEnd: K,
630
+ onTouchMove: C,
631
+ onTouchStart: P,
632
+ tabIndex: V = 0,
633
+ TouchRippleProps: w,
634
+ touchRippleRef: B,
635
+ type: F
636
+ } = u, D = ae(u, vt), z = c.useRef(null), y = c.useRef(null), Ve = ge(y, B), {
637
+ isFocusVisibleRef: fe,
638
+ onFocus: De,
639
+ onBlur: Ne,
640
+ ref: Pe
641
+ } = lt(), [k, Y] = c.useState(!1);
642
+ f && k && Y(!1), c.useImperativeHandle(o, () => ({
643
+ focusVisible: () => {
644
+ Y(!0), z.current.focus();
645
+ }
646
+ }), []);
647
+ const [ee, we] = c.useState(!1);
648
+ c.useEffect(() => {
649
+ we(!0);
650
+ }, []);
651
+ const te = ee && !h && !f;
652
+ c.useEffect(() => {
653
+ k && g && !h && ee && y.current.pulsate();
654
+ }, [h, g, k, ee]);
655
+ function N(a, he, Xe = R) {
656
+ return H((me) => (he && he(me), !Xe && y.current && y.current[a](me), !0));
657
+ }
658
+ const Be = N("start", E), Le = N("stop", $), Fe = N("stop", O), ke = N("stop", I), Se = N("stop", (a) => {
659
+ k && a.preventDefault(), L && L(a);
660
+ }), Oe = N("start", P), _e = N("stop", K), Ie = N("stop", C), Ue = N("stop", (a) => {
661
+ Ne(a), fe.current === !1 && Y(!1), m && m(a);
662
+ }, !1), $e = H((a) => {
663
+ z.current || (z.current = a.currentTarget), De(a), fe.current === !0 && (Y(!0), _ && _(a)), j && j(a);
664
+ }), ne = () => {
665
+ const a = z.current;
666
+ return l && l !== "button" && !(a.tagName === "A" && a.href);
667
+ }, oe = c.useRef(!1), je = H((a) => {
668
+ g && !oe.current && k && y.current && a.key === " " && (oe.current = !0, y.current.stop(a, () => {
669
+ y.current.start(a);
670
+ })), a.target === a.currentTarget && ne() && a.key === " " && a.preventDefault(), d && d(a), a.target === a.currentTarget && ne() && a.key === "Enter" && !f && (a.preventDefault(), T && T(a));
671
+ }), Ke = H((a) => {
672
+ g && a.key === " " && y.current && k && !a.defaultPrevented && (oe.current = !1, y.current.stop(a, () => {
673
+ y.current.pulsate(a);
674
+ })), M && M(a), T && a.target === a.currentTarget && ne() && a.key === " " && !a.defaultPrevented && T(a);
675
+ });
676
+ let q = l;
677
+ q === "button" && (D.href || D.to) && (q = x);
678
+ const A = {};
679
+ q === "button" ? (A.type = F === void 0 ? "button" : F, A.disabled = f) : (!D.href && !D.to && (A.role = "button"), f && (A["aria-disabled"] = f));
680
+ const ze = ge(i, Pe, z);
681
+ process.env.NODE_ENV !== "production" && c.useEffect(() => {
682
+ te && !y.current && console.error(["MUI: The `component` prop provided to ButtonBase is invalid.", "Please make sure the children prop is rendered in this custom component."].join(`
683
+ `));
684
+ }, [te]);
685
+ const de = X({}, u, {
686
+ centerRipple: r,
687
+ component: l,
688
+ disabled: f,
689
+ disableRipple: h,
690
+ disableTouchRipple: R,
691
+ focusRipple: g,
692
+ tabIndex: V,
693
+ focusVisible: k
694
+ }), Ae = xt(de);
695
+ return /* @__PURE__ */ He(Vt, X({
696
+ as: q,
697
+ className: v(Ae.root, p),
698
+ ownerState: de,
699
+ onBlur: Ue,
700
+ onClick: T,
701
+ onContextMenu: Le,
702
+ onFocus: $e,
703
+ onKeyDown: je,
704
+ onKeyUp: Ke,
705
+ onMouseDown: Be,
706
+ onMouseLeave: Se,
707
+ onMouseUp: ke,
708
+ onDragLeave: Fe,
709
+ onTouchEnd: _e,
710
+ onTouchMove: Ie,
711
+ onTouchStart: Oe,
712
+ ref: ze,
713
+ tabIndex: f ? -1 : V,
714
+ type: F
715
+ }, A, D, {
716
+ children: [s, te ? (
717
+ /* TouchRipple is only needed client-side, x2 boost on the server. */
718
+ /* @__PURE__ */ U(xe, X({
719
+ ref: Ve,
720
+ center: r
721
+ }, w))
722
+ ) : null]
723
+ }));
724
+ });
725
+ process.env.NODE_ENV !== "production" && (Dt.propTypes = {
726
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
727
+ // │ These PropTypes are generated from the TypeScript type definitions. │
728
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
729
+ // └─────────────────────────────────────────────────────────────────────┘
730
+ /**
731
+ * A ref for imperative actions.
732
+ * It currently only supports `focusVisible()` action.
733
+ */
734
+ action: Ze,
735
+ /**
736
+ * If `true`, the ripples are centered.
737
+ * They won't start at the cursor interaction position.
738
+ * @default false
739
+ */
740
+ centerRipple: t.bool,
741
+ /**
742
+ * The content of the component.
743
+ */
744
+ children: t.node,
745
+ /**
746
+ * Override or extend the styles applied to the component.
747
+ */
748
+ classes: t.object,
749
+ /**
750
+ * @ignore
751
+ */
752
+ className: t.string,
753
+ /**
754
+ * The component used for the root node.
755
+ * Either a string to use a HTML element or a component.
756
+ */
757
+ component: et,
758
+ /**
759
+ * If `true`, the component is disabled.
760
+ * @default false
761
+ */
762
+ disabled: t.bool,
763
+ /**
764
+ * If `true`, the ripple effect is disabled.
765
+ *
766
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
767
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
768
+ * @default false
769
+ */
770
+ disableRipple: t.bool,
771
+ /**
772
+ * If `true`, the touch ripple effect is disabled.
773
+ * @default false
774
+ */
775
+ disableTouchRipple: t.bool,
776
+ /**
777
+ * If `true`, the base button will have a keyboard focus ripple.
778
+ * @default false
779
+ */
780
+ focusRipple: t.bool,
781
+ /**
782
+ * This prop can help identify which element has keyboard focus.
783
+ * The class name will be applied when the element gains the focus through keyboard interaction.
784
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
785
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
786
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
787
+ * if needed.
788
+ */
789
+ focusVisibleClassName: t.string,
790
+ /**
791
+ * @ignore
792
+ */
793
+ href: t.any,
794
+ /**
795
+ * The component used to render a link when the `href` prop is provided.
796
+ * @default 'a'
797
+ */
798
+ LinkComponent: t.elementType,
799
+ /**
800
+ * @ignore
801
+ */
802
+ onBlur: t.func,
803
+ /**
804
+ * @ignore
805
+ */
806
+ onClick: t.func,
807
+ /**
808
+ * @ignore
809
+ */
810
+ onContextMenu: t.func,
811
+ /**
812
+ * @ignore
813
+ */
814
+ onDragLeave: t.func,
815
+ /**
816
+ * @ignore
817
+ */
818
+ onFocus: t.func,
819
+ /**
820
+ * Callback fired when the component is focused with a keyboard.
821
+ * We trigger a `onFocus` callback too.
822
+ */
823
+ onFocusVisible: t.func,
824
+ /**
825
+ * @ignore
826
+ */
827
+ onKeyDown: t.func,
828
+ /**
829
+ * @ignore
830
+ */
831
+ onKeyUp: t.func,
832
+ /**
833
+ * @ignore
834
+ */
835
+ onMouseDown: t.func,
836
+ /**
837
+ * @ignore
838
+ */
839
+ onMouseLeave: t.func,
840
+ /**
841
+ * @ignore
842
+ */
843
+ onMouseUp: t.func,
844
+ /**
845
+ * @ignore
846
+ */
847
+ onTouchEnd: t.func,
848
+ /**
849
+ * @ignore
850
+ */
851
+ onTouchMove: t.func,
852
+ /**
853
+ * @ignore
854
+ */
855
+ onTouchStart: t.func,
856
+ /**
857
+ * The system prop that allows defining system overrides as well as additional CSS styles.
858
+ */
859
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
860
+ /**
861
+ * @default 0
862
+ */
863
+ tabIndex: t.number,
864
+ /**
865
+ * Props applied to the `TouchRipple` element.
866
+ */
867
+ TouchRippleProps: t.object,
868
+ /**
869
+ * A ref that points to the `TouchRipple` element.
870
+ */
871
+ touchRippleRef: t.oneOfType([t.func, t.shape({
872
+ current: t.shape({
873
+ pulsate: t.func.isRequired,
874
+ start: t.func.isRequired,
875
+ stop: t.func.isRequired
876
+ })
877
+ })]),
878
+ /**
879
+ * @ignore
880
+ */
881
+ type: t.oneOfType([t.oneOf(["button", "reset", "submit"]), t.string])
882
+ });
883
+ export {
884
+ Dt as B,
885
+ lt as u
886
+ };