@carto/ps-react-ui 4.25.0 → 4.27.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.
Files changed (91) hide show
  1. package/dist/actions-DON6fSCh.js +1289 -0
  2. package/dist/actions-DON6fSCh.js.map +1 -0
  3. package/dist/category-BoT5FHHp.js +950 -0
  4. package/dist/category-BoT5FHHp.js.map +1 -0
  5. package/dist/item-color-C1cu6EJd.js +20 -0
  6. package/dist/item-color-C1cu6EJd.js.map +1 -0
  7. package/dist/scale-0elCv3tk.js +29 -0
  8. package/dist/scale-0elCv3tk.js.map +1 -0
  9. package/dist/types/widgets-v2/actions/index.d.ts +1 -1
  10. package/dist/types/widgets-v2/actions/relative-data/index.d.ts +1 -0
  11. package/dist/types/widgets-v2/actions/relative-data/labels.d.ts +3 -0
  12. package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +16 -2
  13. package/dist/types/widgets-v2/actions/relative-data/scale.d.ts +26 -0
  14. package/dist/types/widgets-v2/actions/relative-data/style.d.ts +12 -0
  15. package/dist/types/widgets-v2/bar/types.d.ts +6 -0
  16. package/dist/types/widgets-v2/category/category.d.ts +2 -1
  17. package/dist/types/widgets-v2/histogram/bins.d.ts +7 -0
  18. package/dist/types/widgets-v2/histogram/download.d.ts +2 -2
  19. package/dist/types/widgets-v2/histogram/index.d.ts +2 -1
  20. package/dist/types/widgets-v2/histogram/options.d.ts +1 -1
  21. package/dist/types/widgets-v2/histogram/transforms.d.ts +5 -4
  22. package/dist/types/widgets-v2/histogram/types.d.ts +22 -5
  23. package/dist/types/widgets-v2/index.d.ts +2 -2
  24. package/dist/types/widgets-v2/pie/types.d.ts +6 -0
  25. package/dist/types/widgets-v2/scatterplot/download.d.ts +2 -2
  26. package/dist/types/widgets-v2/scatterplot/index.d.ts +2 -1
  27. package/dist/types/widgets-v2/scatterplot/points.d.ts +7 -0
  28. package/dist/types/widgets-v2/scatterplot/transforms.d.ts +4 -3
  29. package/dist/types/widgets-v2/scatterplot/types.d.ts +21 -2
  30. package/dist/types/widgets-v2/timeseries/types.d.ts +6 -0
  31. package/dist/types/widgets-v2/utils/item-color.d.ts +26 -0
  32. package/dist/widgets-v2/actions.js +1 -1
  33. package/dist/widgets-v2/bar.js +91 -81
  34. package/dist/widgets-v2/bar.js.map +1 -1
  35. package/dist/widgets-v2/category.js +1 -1
  36. package/dist/widgets-v2/histogram.js +133 -100
  37. package/dist/widgets-v2/histogram.js.map +1 -1
  38. package/dist/widgets-v2/pie.js +98 -78
  39. package/dist/widgets-v2/pie.js.map +1 -1
  40. package/dist/widgets-v2/scatterplot.js +151 -110
  41. package/dist/widgets-v2/scatterplot.js.map +1 -1
  42. package/dist/widgets-v2/timeseries.js +96 -86
  43. package/dist/widgets-v2/timeseries.js.map +1 -1
  44. package/dist/widgets-v2.js +2 -2
  45. package/dist/widgets-v2.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/widgets-v2/actions/fullscreen/fullscreen-store.test.tsx +77 -13
  48. package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +48 -5
  49. package/src/widgets-v2/actions/index.ts +1 -0
  50. package/src/widgets-v2/actions/relative-data/index.ts +1 -0
  51. package/src/widgets-v2/actions/relative-data/labels.ts +6 -0
  52. package/src/widgets-v2/actions/relative-data/relative-data.test.tsx +78 -1
  53. package/src/widgets-v2/actions/relative-data/relative-data.tsx +137 -20
  54. package/src/widgets-v2/actions/relative-data/scale.ts +48 -0
  55. package/src/widgets-v2/actions/relative-data/style.ts +10 -0
  56. package/src/widgets-v2/bar/options.test.ts +122 -0
  57. package/src/widgets-v2/bar/options.ts +31 -16
  58. package/src/widgets-v2/bar/types.ts +6 -0
  59. package/src/widgets-v2/category/category.relative-data.test.tsx +51 -63
  60. package/src/widgets-v2/category/category.tsx +25 -11
  61. package/src/widgets-v2/histogram/bins.ts +22 -0
  62. package/src/widgets-v2/histogram/download.test.ts +10 -0
  63. package/src/widgets-v2/histogram/download.ts +7 -3
  64. package/src/widgets-v2/histogram/index.ts +3 -0
  65. package/src/widgets-v2/histogram/options.test.ts +62 -0
  66. package/src/widgets-v2/histogram/options.ts +44 -19
  67. package/src/widgets-v2/histogram/transforms.test.ts +21 -7
  68. package/src/widgets-v2/histogram/transforms.ts +26 -12
  69. package/src/widgets-v2/histogram/types.ts +25 -5
  70. package/src/widgets-v2/index.ts +7 -1
  71. package/src/widgets-v2/pie/options.test.ts +91 -0
  72. package/src/widgets-v2/pie/options.ts +50 -20
  73. package/src/widgets-v2/pie/types.ts +6 -0
  74. package/src/widgets-v2/scatterplot/download.test.ts +9 -0
  75. package/src/widgets-v2/scatterplot/download.ts +5 -3
  76. package/src/widgets-v2/scatterplot/index.ts +3 -0
  77. package/src/widgets-v2/scatterplot/options.test.ts +90 -0
  78. package/src/widgets-v2/scatterplot/options.ts +53 -15
  79. package/src/widgets-v2/scatterplot/points.ts +35 -0
  80. package/src/widgets-v2/scatterplot/transforms.test.ts +19 -0
  81. package/src/widgets-v2/scatterplot/transforms.ts +23 -18
  82. package/src/widgets-v2/scatterplot/types.ts +25 -2
  83. package/src/widgets-v2/timeseries/options.test.ts +65 -0
  84. package/src/widgets-v2/timeseries/options.ts +38 -19
  85. package/src/widgets-v2/timeseries/types.ts +6 -0
  86. package/src/widgets-v2/utils/item-color.test.ts +74 -0
  87. package/src/widgets-v2/utils/item-color.ts +55 -0
  88. package/dist/actions-B1ss030_.js +0 -1167
  89. package/dist/actions-B1ss030_.js.map +0 -1
  90. package/dist/category-DuKx_CJX.js +0 -933
  91. package/dist/category-DuKx_CJX.js.map +0 -1
@@ -0,0 +1,950 @@
1
+ import { t as e } from "./tooltip-DJUGNZxY.js";
2
+ import "./components-DKjBezcJ.js";
3
+ import { C as t, S as n, T as r, p as i } from "./stores-BVFMfgyo.js";
4
+ import { r as a } from "./scale-0elCv3tk.js";
5
+ import { n as o, t as s } from "./download--wRRnf19.js";
6
+ import { c } from "react/compiler-runtime";
7
+ import { useRef as l, useState as u } from "react";
8
+ import { Box as d, Skeleton as f, Typography as p, useTheme as m } from "@mui/material";
9
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
10
+ var _ = {
11
+ root: {
12
+ display: "flex",
13
+ flexDirection: "column",
14
+ position: "relative",
15
+ width: "100%"
16
+ },
17
+ list: {
18
+ position: "relative",
19
+ display: "grid",
20
+ gridTemplateColumns: "minmax(0, 1fr)",
21
+ gap: 1,
22
+ py: .5
23
+ },
24
+ listMulti: { gridTemplateColumns: "minmax(0, 1fr) max-content" },
25
+ barWrap: { position: "relative" },
26
+ multiZeroArea: {
27
+ position: "absolute",
28
+ inset: 0,
29
+ gridColumn: "1 / 2",
30
+ pointerEvents: "none"
31
+ },
32
+ zeroTick: {
33
+ position: "absolute",
34
+ top: -6,
35
+ bottom: -6,
36
+ width: "1px",
37
+ transform: "translateX(-50%)",
38
+ bgcolor: "text.disabled",
39
+ pointerEvents: "none"
40
+ },
41
+ listScroll: { pr: 1 },
42
+ rowSingle: {
43
+ gridColumn: "1 / -1",
44
+ display: "flex",
45
+ flexDirection: "column",
46
+ gap: .5,
47
+ cursor: "pointer",
48
+ userSelect: "none",
49
+ transition: "background-color 80ms ease",
50
+ "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
51
+ "&:focus-visible": {
52
+ outline: "2px solid",
53
+ outlineColor: "primary.main",
54
+ outlineOffset: -2
55
+ }
56
+ },
57
+ rowHeader: {
58
+ display: "flex",
59
+ justifyContent: "space-between",
60
+ alignItems: "center",
61
+ gap: 1
62
+ },
63
+ rowMulti: {
64
+ position: "relative",
65
+ gridColumn: "1 / -1",
66
+ display: "grid",
67
+ gridTemplateColumns: "subgrid",
68
+ rowGap: .5,
69
+ cursor: "pointer",
70
+ userSelect: "none",
71
+ transition: "background-color 80ms ease",
72
+ "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
73
+ "&:focus-visible": {
74
+ outline: "2px solid",
75
+ outlineColor: "primary.main",
76
+ outlineOffset: -2
77
+ }
78
+ },
79
+ name: {
80
+ overflow: "hidden",
81
+ whiteSpace: "nowrap",
82
+ textOverflow: "ellipsis",
83
+ color: "text.primary",
84
+ fontWeight: "medium"
85
+ },
86
+ multiName: {
87
+ gridColumn: "1 / -1",
88
+ overflow: "hidden",
89
+ whiteSpace: "nowrap",
90
+ textOverflow: "ellipsis",
91
+ color: "text.primary",
92
+ fontWeight: "medium"
93
+ },
94
+ value: {
95
+ color: "text.secondary",
96
+ fontVariantNumeric: "tabular-nums",
97
+ minWidth: 48,
98
+ textAlign: "right",
99
+ alignSelf: "center"
100
+ },
101
+ bar: {
102
+ small: {
103
+ position: "relative",
104
+ height: 4,
105
+ bgcolor: "action.hover",
106
+ borderRadius: 1,
107
+ overflow: "hidden",
108
+ transition: "background-color 150ms ease"
109
+ },
110
+ medium: {
111
+ position: "relative",
112
+ height: 12,
113
+ bgcolor: "action.hover",
114
+ borderRadius: .25,
115
+ overflow: "hidden",
116
+ transition: "background-color 150ms ease"
117
+ }
118
+ },
119
+ barFill: {
120
+ small: {
121
+ position: "absolute",
122
+ top: 0,
123
+ bottom: 0,
124
+ borderRadius: 1,
125
+ transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
126
+ },
127
+ medium: {
128
+ position: "absolute",
129
+ top: 0,
130
+ bottom: 0,
131
+ borderRadius: .25,
132
+ transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
133
+ }
134
+ },
135
+ stackedSegment: {
136
+ small: {
137
+ position: "absolute",
138
+ top: 0,
139
+ bottom: 0,
140
+ transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
141
+ },
142
+ medium: {
143
+ position: "absolute",
144
+ top: 0,
145
+ bottom: 0,
146
+ transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
147
+ }
148
+ },
149
+ multiBarRow: { display: "contents" },
150
+ multiBarContainer: { alignSelf: "center" },
151
+ rowStacked: {
152
+ gridColumn: "1 / -1",
153
+ display: "flex",
154
+ flexDirection: "column",
155
+ gap: .5,
156
+ cursor: "pointer",
157
+ userSelect: "none",
158
+ transition: "background-color 80ms ease",
159
+ "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
160
+ "&:focus-visible": {
161
+ outline: "2px solid",
162
+ outlineColor: "primary.main",
163
+ outlineOffset: -2
164
+ }
165
+ },
166
+ stackedHeader: {
167
+ display: "flex",
168
+ justifyContent: "space-between",
169
+ alignItems: "center",
170
+ gap: 1
171
+ },
172
+ stackedTotal: {
173
+ color: "text.primary",
174
+ fontWeight: "medium",
175
+ fontVariantNumeric: "tabular-nums",
176
+ minWidth: 48,
177
+ textAlign: "right"
178
+ },
179
+ stackedBreakdown: {
180
+ display: "flex",
181
+ flexWrap: "wrap",
182
+ columnGap: 2,
183
+ rowGap: .25
184
+ },
185
+ stackedBreakdownItem: {
186
+ color: "text.secondary",
187
+ fontVariantNumeric: "tabular-nums"
188
+ },
189
+ legend: {
190
+ display: "flex",
191
+ alignItems: "center",
192
+ gap: 2,
193
+ flexWrap: "wrap",
194
+ pt: 2,
195
+ mt: 2,
196
+ position: "sticky",
197
+ bottom: 0,
198
+ bgcolor: "background.paper",
199
+ borderTop: (e) => `1px solid ${e.palette.divider}`
200
+ },
201
+ legendItem: {
202
+ display: "flex",
203
+ alignItems: "center",
204
+ gap: 1,
205
+ cursor: "pointer"
206
+ },
207
+ legendItemHidden: {
208
+ display: "flex",
209
+ alignItems: "center",
210
+ gap: 1,
211
+ cursor: "pointer",
212
+ opacity: .5
213
+ },
214
+ legendDot: {
215
+ width: 14,
216
+ height: 14,
217
+ borderRadius: "50%"
218
+ },
219
+ legendLabel: {
220
+ color: "text.secondary",
221
+ textTransform: "uppercase",
222
+ fontWeight: "medium"
223
+ },
224
+ otherRow: {
225
+ gridColumn: "1 / -1",
226
+ display: "flex",
227
+ alignItems: "center",
228
+ gap: 1,
229
+ py: .5,
230
+ px: .5
231
+ },
232
+ otherLabelButton: {
233
+ cursor: "pointer",
234
+ userSelect: "none",
235
+ borderRadius: 1,
236
+ px: .5,
237
+ ml: -.5,
238
+ transition: "background-color 80ms ease",
239
+ "&:hover": { bgcolor: "action.hover" },
240
+ "&:focus-visible": {
241
+ outline: "2px solid",
242
+ outlineColor: "primary.main",
243
+ outlineOffset: 2
244
+ }
245
+ },
246
+ otherLabel: {
247
+ color: "text.primary",
248
+ fontWeight: "medium"
249
+ },
250
+ otherCount: {
251
+ color: "text.secondary",
252
+ fontVariantNumeric: "tabular-nums"
253
+ }
254
+ };
255
+ //#endregion
256
+ //#region src/widgets-v2/category/components/category-bar.tsx
257
+ function v(e) {
258
+ let t = c(17), { value: n, maxValue: r, minValue: i, color: a, size: o, zeroTick: s } = e, l = i === void 0 ? 0 : i, u = o === void 0 ? "small" : o, f = s === void 0 || s, p = r - l, m = p > 0 ? (Math.min(0, n) - l) / p * 100 : 0, g = p > 0 ? Math.abs(n) / p * 100 : 0, v = f && l < 0 && r > 0 ? -l / p * 100 : void 0, b = _.bar[u], x = _.barFill[u], S = `${m}%`, C = `${g}%`, w;
259
+ t[0] === n ? w = t[1] : (w = n < 0 ? {
260
+ borderTopRightRadius: 0,
261
+ borderBottomRightRadius: 0
262
+ } : {
263
+ borderTopLeftRadius: 0,
264
+ borderBottomLeftRadius: 0
265
+ }, t[0] = n, t[1] = w);
266
+ let T;
267
+ t[2] !== a || t[3] !== S || t[4] !== C || t[5] !== w ? (T = {
268
+ left: S,
269
+ width: C,
270
+ backgroundColor: a,
271
+ ...w
272
+ }, t[2] = a, t[3] = S, t[4] = C, t[5] = w, t[6] = T) : T = t[6];
273
+ let E;
274
+ t[7] !== T || t[8] !== x ? (E = /* @__PURE__ */ h(d, {
275
+ sx: x,
276
+ style: T,
277
+ "data-bar-fill": "true"
278
+ }), t[7] = T, t[8] = x, t[9] = E) : E = t[9];
279
+ let D;
280
+ t[10] !== u || t[11] !== E || t[12] !== b ? (D = /* @__PURE__ */ h(d, {
281
+ sx: b,
282
+ "data-size": u,
283
+ children: E
284
+ }), t[10] = u, t[11] = E, t[12] = b, t[13] = D) : D = t[13];
285
+ let O;
286
+ return t[14] !== D || t[15] !== v ? (O = /* @__PURE__ */ h(y, {
287
+ zeroPct: v,
288
+ children: D
289
+ }), t[14] = D, t[15] = v, t[16] = O) : O = t[16], O;
290
+ }
291
+ function y(e) {
292
+ let t = c(5), { zeroPct: n, children: r } = e;
293
+ if (n === void 0) return r;
294
+ let i = `${n}%`, a;
295
+ t[0] === i ? a = t[1] : (a = /* @__PURE__ */ h(d, {
296
+ "aria-hidden": !0,
297
+ "data-zero-tick": "true",
298
+ sx: _.zeroTick,
299
+ style: { left: i }
300
+ }), t[0] = i, t[1] = a);
301
+ let o;
302
+ return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ g(d, {
303
+ sx: _.barWrap,
304
+ children: [a, r]
305
+ }), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
306
+ }
307
+ //#endregion
308
+ //#region src/widgets-v2/category/components/category-row-single.tsx
309
+ function b(e) {
310
+ let t = c(28), { name: n, displayName: r, value: i, maxValue: a, minValue: o, color: s, formatter: l, selected: u, onToggle: f, size: m } = e, y;
311
+ t[0] !== n || t[1] !== f ? (y = (e) => {
312
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f(n));
313
+ }, t[0] = n, t[1] = f, t[2] = y) : y = t[2];
314
+ let b = y, x;
315
+ t[3] !== n || t[4] !== f ? (x = () => f(n), t[3] = n, t[4] = f, t[5] = x) : x = t[5];
316
+ let S = r ?? n, C;
317
+ t[6] === S ? C = t[7] : (C = /* @__PURE__ */ h(p, {
318
+ variant: "body2",
319
+ sx: _.name,
320
+ children: S
321
+ }), t[6] = S, t[7] = C);
322
+ let w;
323
+ t[8] !== l || t[9] !== i ? (w = l(i), t[8] = l, t[9] = i, t[10] = w) : w = t[10];
324
+ let T;
325
+ t[11] === w ? T = t[12] : (T = /* @__PURE__ */ h(p, {
326
+ variant: "body2",
327
+ sx: _.value,
328
+ children: w
329
+ }), t[11] = w, t[12] = T);
330
+ let E;
331
+ t[13] !== C || t[14] !== T ? (E = /* @__PURE__ */ g(d, {
332
+ sx: _.rowHeader,
333
+ children: [C, T]
334
+ }), t[13] = C, t[14] = T, t[15] = E) : E = t[15];
335
+ let D;
336
+ t[16] !== s || t[17] !== a || t[18] !== o || t[19] !== m || t[20] !== i ? (D = /* @__PURE__ */ h(v, {
337
+ value: i,
338
+ maxValue: a,
339
+ minValue: o,
340
+ color: s,
341
+ size: m
342
+ }), t[16] = s, t[17] = a, t[18] = o, t[19] = m, t[20] = i, t[21] = D) : D = t[21];
343
+ let O;
344
+ return t[22] !== b || t[23] !== u || t[24] !== x || t[25] !== E || t[26] !== D ? (O = /* @__PURE__ */ g(d, {
345
+ role: "button",
346
+ "aria-pressed": u,
347
+ tabIndex: 0,
348
+ onClick: x,
349
+ onKeyDown: b,
350
+ sx: _.rowSingle,
351
+ children: [E, D]
352
+ }), t[22] = b, t[23] = u, t[24] = x, t[25] = E, t[26] = D, t[27] = O) : O = t[27], O;
353
+ }
354
+ //#endregion
355
+ //#region src/widgets-v2/category/components/category-row-multi.tsx
356
+ function x(e) {
357
+ let t = c(34), { name: n, displayName: r, values: i, colors: a, maxValue: o, minValue: s, formatter: l, selected: u, onToggle: f, size: m } = e, y = s ?? 0, b;
358
+ t[0] !== n || t[1] !== f ? (b = (e) => {
359
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f(n));
360
+ }, t[0] = n, t[1] = f, t[2] = b) : b = t[2];
361
+ let x = b, S;
362
+ t[3] !== n || t[4] !== f ? (S = () => f(n), t[3] = n, t[4] = f, t[5] = S) : S = t[5];
363
+ let C = r ?? n, w;
364
+ t[6] === C ? w = t[7] : (w = /* @__PURE__ */ h(p, {
365
+ variant: "body2",
366
+ sx: _.multiName,
367
+ children: C
368
+ }), t[6] = C, t[7] = w);
369
+ let T;
370
+ t[8] !== o || t[9] !== y || t[10] !== i.length ? (T = y < 0 && o > 0 && /* @__PURE__ */ h(d, {
371
+ "aria-hidden": !0,
372
+ sx: _.multiZeroArea,
373
+ style: { gridRow: `2 / span ${i.length}` },
374
+ children: /* @__PURE__ */ h(d, {
375
+ "data-zero-tick": "true",
376
+ sx: _.zeroTick,
377
+ style: { left: `${-y / (o - y) * 100}%` }
378
+ })
379
+ }), t[8] = o, t[9] = y, t[10] = i.length, t[11] = T) : T = t[11];
380
+ let E;
381
+ if (t[12] !== a || t[13] !== l || t[14] !== o || t[15] !== s || t[16] !== n || t[17] !== m || t[18] !== i) {
382
+ let e;
383
+ t[20] !== a || t[21] !== l || t[22] !== o || t[23] !== s || t[24] !== n || t[25] !== m ? (e = (e, t) => /* @__PURE__ */ g(d, {
384
+ sx: _.multiBarRow,
385
+ children: [/* @__PURE__ */ h(d, {
386
+ sx: _.multiBarContainer,
387
+ children: /* @__PURE__ */ h(v, {
388
+ value: e,
389
+ maxValue: o,
390
+ minValue: s,
391
+ color: a[t] ?? "",
392
+ size: m,
393
+ zeroTick: !1
394
+ })
395
+ }), /* @__PURE__ */ h(p, {
396
+ variant: "body2",
397
+ sx: _.value,
398
+ children: l(e)
399
+ })]
400
+ }, `${n}-series-${t}`), t[20] = a, t[21] = l, t[22] = o, t[23] = s, t[24] = n, t[25] = m, t[26] = e) : e = t[26], E = i.map(e), t[12] = a, t[13] = l, t[14] = o, t[15] = s, t[16] = n, t[17] = m, t[18] = i, t[19] = E;
401
+ } else E = t[19];
402
+ let D;
403
+ return t[27] !== x || t[28] !== u || t[29] !== S || t[30] !== w || t[31] !== T || t[32] !== E ? (D = /* @__PURE__ */ g(d, {
404
+ role: "button",
405
+ "aria-pressed": u,
406
+ tabIndex: 0,
407
+ onClick: S,
408
+ onKeyDown: x,
409
+ sx: _.rowMulti,
410
+ children: [
411
+ w,
412
+ T,
413
+ E
414
+ ]
415
+ }), t[27] = x, t[28] = u, t[29] = S, t[30] = w, t[31] = T, t[32] = E, t[33] = D) : D = t[33], D;
416
+ }
417
+ //#endregion
418
+ //#region src/widgets-v2/category/components/category-bar-stacked.tsx
419
+ function S(e) {
420
+ let t = c(22), { values: n, colors: r, maxValue: i, zeroPct: a, size: o } = e, s = a === void 0 ? 0 : a, l = o === void 0 ? "small" : o, u;
421
+ if (t[0] !== n) {
422
+ u = [];
423
+ let e = 0, r = 0;
424
+ for (let t of n) t < 0 && (r -= t), u.push(t < 0 ? -r : e), t > 0 && (e += t);
425
+ t[0] = n, t[1] = u;
426
+ } else u = t[1];
427
+ let f = s > 0 && s < 100 ? s : void 0, p = _.bar[l], m;
428
+ if (t[2] !== r || t[3] !== u || t[4] !== i || t[5] !== l || t[6] !== n || t[7] !== s) {
429
+ let e;
430
+ t[9] !== r || t[10] !== u || t[11] !== i || t[12] !== l || t[13] !== s ? (e = (e, t) => {
431
+ if (e === 0 || i <= 0) return null;
432
+ let n = s + u[t] / i * 100, a = Math.abs(e) / i * 100;
433
+ return /* @__PURE__ */ h(d, {
434
+ sx: _.stackedSegment[l],
435
+ style: {
436
+ left: `${n}%`,
437
+ width: `${a}%`,
438
+ backgroundColor: r[t] ?? ""
439
+ },
440
+ "data-bar-fill": "true"
441
+ }, `seg-${r[t] ?? "none"}-${t}`);
442
+ }, t[9] = r, t[10] = u, t[11] = i, t[12] = l, t[13] = s, t[14] = e) : e = t[14], m = n.map(e), t[2] = r, t[3] = u, t[4] = i, t[5] = l, t[6] = n, t[7] = s, t[8] = m;
443
+ } else m = t[8];
444
+ let g;
445
+ t[15] !== l || t[16] !== p || t[17] !== m ? (g = /* @__PURE__ */ h(d, {
446
+ sx: p,
447
+ "data-size": l,
448
+ children: m
449
+ }), t[15] = l, t[16] = p, t[17] = m, t[18] = g) : g = t[18];
450
+ let v;
451
+ return t[19] !== f || t[20] !== g ? (v = /* @__PURE__ */ h(y, {
452
+ zeroPct: f,
453
+ children: g
454
+ }), t[19] = f, t[20] = g, t[21] = v) : v = t[21], v;
455
+ }
456
+ //#endregion
457
+ //#region src/widgets-v2/category/components/category-row-stacked.tsx
458
+ function C(e) {
459
+ let t = c(67), { name: n, displayName: r, values: i, colors: a, seriesNames: o, formatter: s, selected: l, onToggle: u, size: f, zeroPct: m } = e, v = m === void 0 ? 0 : m, y;
460
+ t[0] !== n || t[1] !== u ? (y = (e) => {
461
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), u(n));
462
+ }, t[0] = n, t[1] = u, t[2] = y) : y = t[2];
463
+ let b = y, x, C, T, E, D, O, k, A, j, M, N, P, F, I, L;
464
+ if (t[3] !== r || t[4] !== s || t[5] !== b || t[6] !== n || t[7] !== u || t[8] !== l || t[9] !== i || t[10] !== v) {
465
+ let e = i.reduce(w, 0), a = 0, o = 0;
466
+ for (let e of i) e > 0 ? a += e : o -= e;
467
+ E = Math.max(v < 100 ? a * 100 / (100 - v) : 0, v > 0 ? o * 100 / v : 0), T = d, I = "button", L = l, D = 0, t[26] !== n || t[27] !== u ? (O = () => u(n), t[26] = n, t[27] = u, t[28] = O) : O = t[28], k = b, A = _.rowStacked, C = d, P = _.stackedHeader;
468
+ let c = r ?? n;
469
+ t[29] === c ? F = t[30] : (F = /* @__PURE__ */ h(p, {
470
+ variant: "body2",
471
+ sx: _.multiName,
472
+ children: c
473
+ }), t[29] = c, t[30] = F), x = p, j = "body2", M = _.stackedTotal, N = s(e), t[3] = r, t[4] = s, t[5] = b, t[6] = n, t[7] = u, t[8] = l, t[9] = i, t[10] = v, t[11] = x, t[12] = C, t[13] = T, t[14] = E, t[15] = D, t[16] = O, t[17] = k, t[18] = A, t[19] = j, t[20] = M, t[21] = N, t[22] = P, t[23] = F, t[24] = I, t[25] = L;
474
+ } else x = t[11], C = t[12], T = t[13], E = t[14], D = t[15], O = t[16], k = t[17], A = t[18], j = t[19], M = t[20], N = t[21], P = t[22], F = t[23], I = t[24], L = t[25];
475
+ let R;
476
+ t[31] !== x || t[32] !== j || t[33] !== M || t[34] !== N ? (R = /* @__PURE__ */ h(x, {
477
+ variant: j,
478
+ sx: M,
479
+ children: N
480
+ }), t[31] = x, t[32] = j, t[33] = M, t[34] = N, t[35] = R) : R = t[35];
481
+ let z;
482
+ t[36] !== C || t[37] !== R || t[38] !== P || t[39] !== F ? (z = /* @__PURE__ */ g(C, {
483
+ sx: P,
484
+ children: [F, R]
485
+ }), t[36] = C, t[37] = R, t[38] = P, t[39] = F, t[40] = z) : z = t[40];
486
+ let B;
487
+ t[41] !== a || t[42] !== E || t[43] !== f || t[44] !== i || t[45] !== v ? (B = /* @__PURE__ */ h(S, {
488
+ values: i,
489
+ colors: a,
490
+ maxValue: E,
491
+ zeroPct: v,
492
+ size: f
493
+ }), t[41] = a, t[42] = E, t[43] = f, t[44] = i, t[45] = v, t[46] = B) : B = t[46];
494
+ let V;
495
+ if (t[47] !== s || t[48] !== o || t[49] !== i) {
496
+ let e;
497
+ t[51] !== s || t[52] !== o ? (e = (e, t) => /* @__PURE__ */ h(p, {
498
+ variant: "body2",
499
+ sx: _.stackedBreakdownItem,
500
+ children: `${o[t]}: ${s(e)}`
501
+ }, `breakdown-${o[t]}`), t[51] = s, t[52] = o, t[53] = e) : e = t[53], V = i.map(e), t[47] = s, t[48] = o, t[49] = i, t[50] = V;
502
+ } else V = t[50];
503
+ let H;
504
+ t[54] === V ? H = t[55] : (H = /* @__PURE__ */ h(d, {
505
+ sx: _.stackedBreakdown,
506
+ children: V
507
+ }), t[54] = V, t[55] = H);
508
+ let U;
509
+ return t[56] !== T || t[57] !== D || t[58] !== O || t[59] !== k || t[60] !== A || t[61] !== z || t[62] !== B || t[63] !== H || t[64] !== I || t[65] !== L ? (U = /* @__PURE__ */ g(T, {
510
+ role: I,
511
+ "aria-pressed": L,
512
+ tabIndex: D,
513
+ onClick: O,
514
+ onKeyDown: k,
515
+ sx: A,
516
+ children: [
517
+ z,
518
+ B,
519
+ H
520
+ ]
521
+ }), t[56] = T, t[57] = D, t[58] = O, t[59] = k, t[60] = A, t[61] = z, t[62] = B, t[63] = H, t[64] = I, t[65] = L, t[66] = U) : U = t[66], U;
522
+ }
523
+ function w(e, t) {
524
+ return e + t;
525
+ }
526
+ //#endregion
527
+ //#region src/widgets-v2/category/components/category-row-other.tsx
528
+ function T(t) {
529
+ let n = c(23), { hiddenCount: r, otherLabel: i, otherCountLabel: a, onShowAll: o, showAllLabel: s } = t, l = i === void 0 ? "Others" : i, u = a === void 0 ? "{count}" : a, f = s === void 0 ? "Show all" : s, m;
530
+ n[0] !== r || n[1] !== u ? (m = u.replace("{count}", String(r)), n[0] = r, n[1] = u, n[2] = m) : m = n[2];
531
+ let v = m, y;
532
+ n[3] === v ? y = n[4] : (y = /* @__PURE__ */ h(p, {
533
+ variant: "body2",
534
+ sx: _.otherCount,
535
+ children: v
536
+ }), n[3] = v, n[4] = y);
537
+ let b = y;
538
+ if (!o) {
539
+ let e;
540
+ n[5] === l ? e = n[6] : (e = /* @__PURE__ */ h(p, {
541
+ variant: "body2",
542
+ sx: _.otherLabel,
543
+ children: l
544
+ }), n[5] = l, n[6] = e);
545
+ let t;
546
+ return n[7] !== b || n[8] !== e ? (t = /* @__PURE__ */ g(d, {
547
+ sx: _.otherRow,
548
+ children: [e, b]
549
+ }), n[7] = b, n[8] = e, n[9] = t) : t = n[9], t;
550
+ }
551
+ let x;
552
+ n[10] === o ? x = n[11] : (x = (e) => {
553
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
554
+ }, n[10] = o, n[11] = x);
555
+ let S = x, C;
556
+ n[12] === Symbol.for("react.memo_cache_sentinel") ? (C = {
557
+ ..._.otherLabel,
558
+ ..._.otherLabelButton
559
+ }, n[12] = C) : C = n[12];
560
+ let w;
561
+ n[13] !== S || n[14] !== o || n[15] !== l ? (w = /* @__PURE__ */ h(p, {
562
+ variant: "body2",
563
+ component: "span",
564
+ role: "button",
565
+ tabIndex: 0,
566
+ onClick: o,
567
+ onKeyDown: S,
568
+ sx: C,
569
+ children: l
570
+ }), n[13] = S, n[14] = o, n[15] = l, n[16] = w) : w = n[16];
571
+ let T;
572
+ n[17] !== f || n[18] !== w ? (T = /* @__PURE__ */ h(e, {
573
+ title: f,
574
+ children: w
575
+ }), n[17] = f, n[18] = w, n[19] = T) : T = n[19];
576
+ let E;
577
+ return n[20] !== b || n[21] !== T ? (E = /* @__PURE__ */ g(d, {
578
+ sx: _.otherRow,
579
+ children: [T, b]
580
+ }), n[20] = b, n[21] = T, n[22] = E) : E = n[22], E;
581
+ }
582
+ //#endregion
583
+ //#region src/widgets-v2/category/components/category-legend.tsx
584
+ var E = /* @__PURE__ */ new Set();
585
+ function D(e) {
586
+ let t = c(11), { series: n, colorAt: r, hiddenSeries: i, onToggle: a } = e, o = i === void 0 ? E : i;
587
+ if (n.length === 0) return null;
588
+ let s;
589
+ if (t[0] !== r || t[1] !== o || t[2] !== a || t[3] !== n) {
590
+ let e;
591
+ t[5] !== r || t[6] !== o || t[7] !== a ? (e = (e, t) => {
592
+ let n = o.has(t);
593
+ return /* @__PURE__ */ g(d, {
594
+ role: "checkbox",
595
+ "aria-checked": !n,
596
+ tabIndex: 0,
597
+ onClick: () => a?.(t),
598
+ onKeyDown: (e) => {
599
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a?.(t));
600
+ },
601
+ sx: n ? _.legendItemHidden : _.legendItem,
602
+ children: [/* @__PURE__ */ h(d, {
603
+ sx: _.legendDot,
604
+ style: { backgroundColor: e.color ?? r(t) }
605
+ }), /* @__PURE__ */ h(p, {
606
+ variant: "caption",
607
+ sx: _.legendLabel,
608
+ children: e.name
609
+ })]
610
+ }, e.name);
611
+ }, t[5] = r, t[6] = o, t[7] = a, t[8] = e) : e = t[8], s = n.map(e), t[0] = r, t[1] = o, t[2] = a, t[3] = n, t[4] = s;
612
+ } else s = t[4];
613
+ let l;
614
+ return t[9] === s ? l = t[10] : (l = /* @__PURE__ */ h(d, {
615
+ sx: _.legend,
616
+ children: s
617
+ }), t[9] = s, t[10] = l), l;
618
+ }
619
+ //#endregion
620
+ //#region src/widgets-v2/category/category-ui.tsx
621
+ var O = 20, k = {
622
+ small: 36,
623
+ medium: 44
624
+ }, A = 8;
625
+ function j(e) {
626
+ if (!e || e.length === 0) return [];
627
+ let t = Math.max(e.length, 1), n = /* @__PURE__ */ new Map(), r = [];
628
+ for (let i = 0; i < e.length; i++) {
629
+ let a = e[i] ?? [];
630
+ for (let e of a) {
631
+ let a = n.get(e.name);
632
+ a || (a = {
633
+ name: e.name,
634
+ values: Array(t).fill(0),
635
+ rowColors: Array(t).fill(void 0)
636
+ }, n.set(e.name, a), r.push(e.name)), a.values[i] = e.value, a.rowColors[i] = e.color;
637
+ }
638
+ }
639
+ return r.map((e) => n.get(e));
640
+ }
641
+ function M(e, t, n) {
642
+ let r = 0, i = 0;
643
+ for (let t of e) for (let e of t.values) e < r && (r = e), e > i && (i = e);
644
+ if (typeof t == "number" && t < 0 && (r = t), typeof n == "number" && n > 0 && (i = n), r < 0 && i > 0) {
645
+ let e = Math.max(-r, i);
646
+ return [-e, e];
647
+ }
648
+ return [r, i];
649
+ }
650
+ function N(e, t) {
651
+ return (t < 0 ? "−" : "") + e(Math.abs(t));
652
+ }
653
+ function P(e) {
654
+ let t = c(94), { data: n, selection: r, onSelectionChange: i, formatter: a, labelFormatter: o, series: s, maxItems: f, labels: p, onShowAll: v, maxOverride: y, minOverride: S, size: w, stacked: E, hiddenSeries: P, onHiddenSeriesChange: z } = e, B = f === void 0 ? O : f, V = w === void 0 ? "small" : w, H = E !== void 0 && E, U = m(), ee = a ?? R, W;
655
+ t[0] === ee ? W = t[1] : (W = (e) => N(ee, e), t[0] = ee, t[1] = W);
656
+ let te = W, ne = !!r && r.length > 0, G;
657
+ t[2] === r ? G = t[3] : (G = r ?? [], t[2] = r, t[3] = G);
658
+ let re;
659
+ t[4] === G ? re = t[5] : (re = new Set(G), t[4] = G, t[5] = re);
660
+ let ie = re, ae;
661
+ t[6] !== i || t[7] !== r ? (ae = (e) => {
662
+ if (!i) return;
663
+ let t = r ?? [], n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
664
+ i(n);
665
+ }, t[6] = i, t[7] = r, t[8] = ae) : ae = t[8];
666
+ let oe = ae, se = U.palette.secondary.main, ce;
667
+ t[9] === U.palette ? ce = t[10] : (ce = Object.values(U.palette.qualitative?.bold ?? {}), t[9] = U.palette, t[10] = ce);
668
+ let le;
669
+ t[11] !== ce || t[12] !== U.palette.secondary.main ? (le = [se, ...ce], t[11] = ce, t[12] = U.palette.secondary.main, t[13] = le) : le = t[13];
670
+ let ue = le, de;
671
+ t[14] !== ue || t[15] !== s || t[16] !== U.palette.secondary.main ? (de = (e, t) => t || s?.[e]?.color || (ue[e % ue.length] ?? U.palette.secondary.main), t[14] = ue, t[15] = s, t[16] = U.palette.secondary.main, t[17] = de) : de = t[17];
672
+ let fe = de, pe = U.palette.action.disabled, me;
673
+ t[18] === n ? me = t[19] : (me = j(n), t[18] = n, t[19] = me);
674
+ let K = me, he;
675
+ t[20] !== K || t[21] !== y || t[22] !== S ? (he = M(K, S, y), t[20] = K, t[21] = y, t[22] = S, t[23] = he) : he = t[23];
676
+ let [q, ge] = he, _e = ge > q ? -q / (ge - q) * 100 : 0, J = B === 0, ve = l(!1), [ye, be] = u(null), xe;
677
+ t[24] === J ? xe = t[25] : (xe = (e) => {
678
+ if (!e || ve.current || J) return;
679
+ let t = e.clientHeight;
680
+ t > 0 && (ve.current = !0, be(t));
681
+ }, t[24] = J, t[25] = xe);
682
+ let Se = xe, [Ce, we] = u(L), Y = P ?? Ce, Te;
683
+ t[26] === s ? Te = t[27] : (Te = JSON.stringify(s?.map(I) ?? []), t[26] = s, t[27] = Te);
684
+ let Ee = Te, [De, Oe] = u(Ee);
685
+ Ee !== De && (Oe(Ee), we(/* @__PURE__ */ new Set()));
686
+ let ke = Math.max(n.length, 1), Ae;
687
+ t[28] !== Y || t[29] !== z || t[30] !== ke ? (Ae = (e) => {
688
+ let t = new Set(Y);
689
+ t.has(e) ? t.delete(e) : t.add(e), (z ?? we)(t.size >= ke ? /* @__PURE__ */ new Set() : t);
690
+ }, t[28] = Y, t[29] = z, t[30] = ke, t[31] = Ae) : Ae = t[31];
691
+ let je = Ae;
692
+ if (K.length === 0) return null;
693
+ let Me;
694
+ t[32] === B ? Me = t[33] : (Me = typeof B == "number" && Number.isFinite(B) && B > 0, t[32] = B, t[33] = Me);
695
+ let Ne = Me, Pe, Fe, Ie, X, Z, Q, $, Le, Re;
696
+ if (t[34] !== fe || t[35] !== n.length || t[36] !== pe || t[37] !== te || t[38] !== K || t[39] !== Ne || t[40] !== ne || t[41] !== Y || t[42] !== o || t[43] !== Se || t[44] !== B || t[45] !== ge || t[46] !== q || t[47] !== ye || t[48] !== J || t[49] !== ie || t[50] !== s || t[51] !== ke || t[52] !== V || t[53] !== H || t[54] !== oe || t[55] !== _e) {
697
+ let e = Ne ? K.slice(0, B) : K;
698
+ X = Ne ? K.length - e.length : 0;
699
+ let r = n.length > 1;
700
+ Ie = r && !!s && s.length > 0;
701
+ let i = Array.from({ length: ke }, F).filter((e) => !Y.has(e)), a = J ? ye ?? k[V] * A : void 0;
702
+ Fe = d, Re = _.root, Pe = d, Z = Se;
703
+ let c = r && !H && _.listMulti, l = J && _.listScroll;
704
+ t[65] !== c || t[66] !== l ? (Q = {
705
+ ..._.list,
706
+ ...c,
707
+ ...l
708
+ }, t[65] = c, t[66] = l, t[67] = Q) : Q = t[67], t[68] === a ? $ = t[69] : ($ = a === void 0 ? void 0 : {
709
+ maxHeight: a,
710
+ overflowY: "auto"
711
+ }, t[68] = a, t[69] = $), Le = e.map((e) => {
712
+ let t = ie.has(e.name), n = ne && !t, a = o ? o(e.name) : void 0, c = (t) => n ? pe : fe(t, e.rowColors[t]);
713
+ return r ? H ? /* @__PURE__ */ h(C, {
714
+ name: e.name,
715
+ displayName: a,
716
+ values: i.map((t) => e.values[t]),
717
+ colors: i.map((e) => c(e)),
718
+ seriesNames: i.map((e) => s?.[e]?.name ?? `Series ${e + 1}`),
719
+ formatter: te,
720
+ selected: t,
721
+ onToggle: oe,
722
+ size: V,
723
+ zeroPct: _e
724
+ }, String(e.name)) : /* @__PURE__ */ h(x, {
725
+ name: e.name,
726
+ displayName: a,
727
+ values: i.map((t) => e.values[t]),
728
+ colors: i.map((e) => c(e)),
729
+ maxValue: ge,
730
+ minValue: q,
731
+ formatter: te,
732
+ selected: t,
733
+ onToggle: oe,
734
+ size: V
735
+ }, String(e.name)) : /* @__PURE__ */ h(b, {
736
+ name: e.name,
737
+ displayName: a,
738
+ value: e.values[0] ?? 0,
739
+ maxValue: ge,
740
+ minValue: q,
741
+ color: c(0),
742
+ formatter: te,
743
+ selected: t,
744
+ onToggle: oe,
745
+ size: V
746
+ }, String(e.name));
747
+ }), t[34] = fe, t[35] = n.length, t[36] = pe, t[37] = te, t[38] = K, t[39] = Ne, t[40] = ne, t[41] = Y, t[42] = o, t[43] = Se, t[44] = B, t[45] = ge, t[46] = q, t[47] = ye, t[48] = J, t[49] = ie, t[50] = s, t[51] = ke, t[52] = V, t[53] = H, t[54] = oe, t[55] = _e, t[56] = Pe, t[57] = Fe, t[58] = Ie, t[59] = X, t[60] = Z, t[61] = Q, t[62] = $, t[63] = Le, t[64] = Re;
748
+ } else Pe = t[56], Fe = t[57], Ie = t[58], X = t[59], Z = t[60], Q = t[61], $ = t[62], Le = t[63], Re = t[64];
749
+ let ze;
750
+ t[70] !== X || t[71] !== p?.other || t[72] !== p?.otherCount || t[73] !== p?.showAll || t[74] !== v ? (ze = X > 0 && /* @__PURE__ */ h(T, {
751
+ hiddenCount: X,
752
+ otherLabel: p?.other,
753
+ otherCountLabel: p?.otherCount,
754
+ showAllLabel: p?.showAll,
755
+ onShowAll: v
756
+ }), t[70] = X, t[71] = p?.other, t[72] = p?.otherCount, t[73] = p?.showAll, t[74] = v, t[75] = ze) : ze = t[75];
757
+ let Be;
758
+ t[76] !== Pe || t[77] !== Z || t[78] !== Q || t[79] !== $ || t[80] !== Le || t[81] !== ze ? (Be = /* @__PURE__ */ g(Pe, {
759
+ ref: Z,
760
+ sx: Q,
761
+ style: $,
762
+ children: [Le, ze]
763
+ }), t[76] = Pe, t[77] = Z, t[78] = Q, t[79] = $, t[80] = Le, t[81] = ze, t[82] = Be) : Be = t[82];
764
+ let Ve;
765
+ t[83] !== fe || t[84] !== Ie || t[85] !== Y || t[86] !== s || t[87] !== je ? (Ve = Ie && s && /* @__PURE__ */ h(D, {
766
+ series: s,
767
+ colorAt: (e) => fe(e),
768
+ hiddenSeries: Y,
769
+ onToggle: je
770
+ }), t[83] = fe, t[84] = Ie, t[85] = Y, t[86] = s, t[87] = je, t[88] = Ve) : Ve = t[88];
771
+ let He;
772
+ return t[89] !== Fe || t[90] !== Re || t[91] !== Be || t[92] !== Ve ? (He = /* @__PURE__ */ g(Fe, {
773
+ sx: Re,
774
+ children: [Be, Ve]
775
+ }), t[89] = Fe, t[90] = Re, t[91] = Be, t[92] = Ve, t[93] = He) : He = t[93], He;
776
+ }
777
+ function F(e, t) {
778
+ return t;
779
+ }
780
+ function I(e) {
781
+ return e.name;
782
+ }
783
+ function L() {
784
+ return /* @__PURE__ */ new Set();
785
+ }
786
+ function R(e) {
787
+ return String(e);
788
+ }
789
+ //#endregion
790
+ //#region src/widgets-v2/category/category.tsx
791
+ var z = (e) => ({
792
+ data: e.data ?? [],
793
+ rawData: e.rawData ?? void 0,
794
+ formatter: e.formatter,
795
+ labelFormatter: e.labelFormatter
796
+ }), B = /* @__PURE__ */ new Set();
797
+ function V(e) {
798
+ let t = 0, n = 0;
799
+ for (let r of e ?? []) for (let e of r) e.value < t && (t = e.value), e.value > n && (n = e.value);
800
+ return [t, n];
801
+ }
802
+ function H(e) {
803
+ let o = c(31), { selection: s, onSelectionChange: l, series: u, maxItems: d, labels: f, onShowAll: p, maxOverride: m, minOverride: g, size: _, stacked: v } = e, y = r(), b = t(y, z), x = n(y, a), S;
804
+ bb0: {
805
+ let e;
806
+ o[0] === b.rawData ? e = o[1] : (e = V(b.rawData), o[0] = b.rawData, o[1] = e);
807
+ let [t, n] = e;
808
+ if (x === "total") {
809
+ let e = t < 0 ? -100 : 0, r = n > 0 ? 100 : 0, i;
810
+ o[2] !== e || o[3] !== r ? (i = [e, r], o[2] = e, o[3] = r, o[4] = i) : i = o[4], S = i;
811
+ break bb0;
812
+ }
813
+ if (x === "max") {
814
+ let e;
815
+ o[5] === b.data ? e = o[6] : (e = V(b.data), o[5] = b.data, o[6] = e), S = e;
816
+ break bb0;
817
+ }
818
+ let r;
819
+ o[7] !== n || o[8] !== t ? (r = [t, n], o[7] = n, o[8] = t, o[9] = r) : r = o[9], S = r;
820
+ }
821
+ let [C, w] = S, T = w > 0 ? (x ? void 0 : m) ?? w : void 0, E = C < 0 ? (x ? void 0 : g) ?? C : void 0, D;
822
+ o[10] === u ? D = o[11] : (D = JSON.stringify(u?.map(ee) ?? []), o[10] = u, o[11] = D);
823
+ let O = D, k = n(y, U), A = k?.key === O ? k.indices : B, j;
824
+ o[12] !== y || o[13] !== O ? (j = (e) => i(y).setState({ categoryHiddenSeries: {
825
+ key: O,
826
+ indices: e
827
+ } }), o[12] = y, o[13] = O, o[14] = j) : j = o[14];
828
+ let M = j, N;
829
+ return o[15] !== T || o[16] !== E || o[17] !== A || o[18] !== f || o[19] !== d || o[20] !== M || o[21] !== l || o[22] !== p || o[23] !== s || o[24] !== u || o[25] !== _ || o[26] !== b.data || o[27] !== b.formatter || o[28] !== b.labelFormatter || o[29] !== v ? (N = /* @__PURE__ */ h(P, {
830
+ data: b.data,
831
+ formatter: b.formatter,
832
+ labelFormatter: b.labelFormatter,
833
+ selection: s,
834
+ onSelectionChange: l,
835
+ series: u,
836
+ maxItems: d,
837
+ labels: f,
838
+ onShowAll: p,
839
+ maxOverride: T,
840
+ minOverride: E,
841
+ size: _,
842
+ stacked: v,
843
+ hiddenSeries: A,
844
+ onHiddenSeriesChange: M
845
+ }), o[15] = T, o[16] = E, o[17] = A, o[18] = f, o[19] = d, o[20] = M, o[21] = l, o[22] = p, o[23] = s, o[24] = u, o[25] = _, o[26] = b.data, o[27] = b.formatter, o[28] = b.labelFormatter, o[29] = v, o[30] = N) : N = o[30], N;
846
+ }
847
+ function U(e) {
848
+ return e.categoryHiddenSeries;
849
+ }
850
+ function ee(e) {
851
+ return e.name;
852
+ }
853
+ //#endregion
854
+ //#region src/widgets-v2/category/skeleton.tsx
855
+ var W = {
856
+ root: {
857
+ display: "flex",
858
+ flexDirection: "column",
859
+ gap: 1,
860
+ py: .5
861
+ },
862
+ row: {
863
+ display: "flex",
864
+ flexDirection: "column",
865
+ gap: .5
866
+ },
867
+ rowHeader: {
868
+ display: "flex",
869
+ justifyContent: "space-between",
870
+ alignItems: "center",
871
+ gap: 1
872
+ },
873
+ name: {
874
+ height: 14,
875
+ width: 80
876
+ },
877
+ value: {
878
+ height: 14,
879
+ width: 48
880
+ }
881
+ }, te = {
882
+ small: 4,
883
+ medium: 12
884
+ }, ne = [
885
+ "95%",
886
+ "80%",
887
+ "55%",
888
+ "75%",
889
+ "60%"
890
+ ];
891
+ function G(e) {
892
+ let t = c(5), { rows: n, size: r } = e, i = n === void 0 ? 5 : n, a = r === void 0 ? "small" : r, o;
893
+ t[0] === i ? o = t[1] : (o = Array.from({ length: i }), t[0] = i, t[1] = o);
894
+ let s;
895
+ return t[2] !== a || t[3] !== o ? (s = /* @__PURE__ */ h(d, {
896
+ sx: W.root,
897
+ children: o.map((e, t) => /* @__PURE__ */ g(d, {
898
+ sx: W.row,
899
+ children: [/* @__PURE__ */ g(d, {
900
+ sx: W.rowHeader,
901
+ children: [/* @__PURE__ */ h(f, {
902
+ variant: "rectangular",
903
+ sx: W.name
904
+ }), /* @__PURE__ */ h(f, {
905
+ variant: "rectangular",
906
+ sx: W.value
907
+ })]
908
+ }), /* @__PURE__ */ h(f, {
909
+ variant: "rectangular",
910
+ sx: {
911
+ height: te[a],
912
+ width: ne[t % ne.length]
913
+ }
914
+ })]
915
+ }, `row-${t}`))
916
+ }), t[2] = a, t[3] = o, t[4] = s) : s = t[4], s;
917
+ }
918
+ //#endregion
919
+ //#region src/widgets-v2/category/download.ts
920
+ function re(e) {
921
+ let t = [];
922
+ return e.getCaptureEl && t.push(o({
923
+ filename: e.filename,
924
+ getCaptureEl: e.getCaptureEl,
925
+ pixelRatio: e.pngPixelRatio,
926
+ backgroundColor: e.pngBackgroundColor
927
+ })), t.push(s({
928
+ filename: e.filename,
929
+ getRows: (t) => {
930
+ let n = e.getData(t), r = [[
931
+ "series",
932
+ "name",
933
+ "value"
934
+ ]];
935
+ for (let [t, i] of n.entries()) {
936
+ let n = e.seriesNames?.[t] ?? `series_${t + 1}`;
937
+ for (let e of i) r.push([
938
+ n,
939
+ e.name,
940
+ e.value
941
+ ]);
942
+ }
943
+ return r;
944
+ }
945
+ })), t;
946
+ }
947
+ //#endregion
948
+ export { D as a, b as c, P as i, v as l, G as n, T as o, H as r, x as s, re as t };
949
+
950
+ //# sourceMappingURL=category-BoT5FHHp.js.map