@smart-factor/gem-ui-components 0.0.7 → 0.0.9

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.
@@ -0,0 +1,2981 @@
1
+ import { jsx as w, jsxs as ve } from "react/jsx-runtime";
2
+ import * as x from "react";
3
+ import { createElement as Qt } from "react";
4
+ import { J as Zt, K as tt, L as en, M as tn, N as nn, k as fe, l as me, m as U, _ as D, p as st, O as on, T as rn, q as Le, r as sn, Q as ln, h as de, t as Ie, P as r, R as lt, v as ge, x as nt, U as an, D as at, f as cn, V as ct, a as ue, b as te, n as dn, d as un, g as G, o as pn, E as fn, u as mn, B as ce, W as In, X as dt, Y as ie, A as ot, e as gn, F as hn, S as bn, H as yn, I as xn } from "./Stack-CrOcI22K.js";
5
+ function je(e, t = 0, n = 1) {
6
+ return process.env.NODE_ENV !== "production" && (e < t || e > n) && console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`), Zt(e, t, n);
7
+ }
8
+ function En(e) {
9
+ e = e.slice(1);
10
+ const t = new RegExp(`.{1,${e.length >= 6 ? 2 : 1}}`, "g");
11
+ let n = e.match(t);
12
+ return n && n[0].length === 1 && (n = n.map((o) => o + o)), n ? `rgb${n.length === 4 ? "a" : ""}(${n.map((o, s) => s < 3 ? parseInt(o, 16) : Math.round(parseInt(o, 16) / 255 * 1e3) / 1e3).join(", ")})` : "";
13
+ }
14
+ function Me(e) {
15
+ if (e.type)
16
+ return e;
17
+ if (e.charAt(0) === "#")
18
+ return Me(En(e));
19
+ const t = e.indexOf("("), n = e.substring(0, t);
20
+ if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(n) === -1)
21
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported \`${e}\` color.
22
+ The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : tt(9, e));
23
+ let o = e.substring(t + 1, e.length - 1), s;
24
+ if (n === "color") {
25
+ if (o = o.split(" "), s = o.shift(), o.length === 4 && o[3].charAt(0) === "/" && (o[3] = o[3].slice(1)), ["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(s) === -1)
26
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: unsupported \`${s}\` color space.
27
+ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : tt(10, s));
28
+ } else
29
+ o = o.split(",");
30
+ return o = o.map((d) => parseFloat(d)), {
31
+ type: n,
32
+ values: o,
33
+ colorSpace: s
34
+ };
35
+ }
36
+ function _e(e) {
37
+ const {
38
+ type: t,
39
+ colorSpace: n
40
+ } = e;
41
+ let {
42
+ values: o
43
+ } = e;
44
+ return t.indexOf("rgb") !== -1 ? o = o.map((s, d) => d < 3 ? parseInt(s, 10) : s) : t.indexOf("hsl") !== -1 && (o[1] = `${o[1]}%`, o[2] = `${o[2]}%`), t.indexOf("color") !== -1 ? o = `${n} ${o.join(" ")}` : o = `${o.join(", ")}`, `${t}(${o})`;
45
+ }
46
+ function X(e, t) {
47
+ return e = Me(e), t = je(t), (e.type === "rgb" || e.type === "hsl") && (e.type += "a"), e.type === "color" ? e.values[3] = `/${t}` : e.values[3] = t, _e(e);
48
+ }
49
+ function Xo(e, t) {
50
+ if (e = Me(e), t = je(t), e.type.indexOf("hsl") !== -1)
51
+ e.values[2] *= 1 - t;
52
+ else if (e.type.indexOf("rgb") !== -1 || e.type.indexOf("color") !== -1)
53
+ for (let n = 0; n < 3; n += 1)
54
+ e.values[n] *= 1 - t;
55
+ return _e(e);
56
+ }
57
+ function Wo(e, t) {
58
+ if (e = Me(e), t = je(t), e.type.indexOf("hsl") !== -1)
59
+ e.values[2] += (100 - e.values[2]) * t;
60
+ else if (e.type.indexOf("rgb") !== -1)
61
+ for (let n = 0; n < 3; n += 1)
62
+ e.values[n] += (255 - e.values[n]) * t;
63
+ else if (e.type.indexOf("color") !== -1)
64
+ for (let n = 0; n < 3; n += 1)
65
+ e.values[n] += (1 - e.values[n]) * t;
66
+ return _e(e);
67
+ }
68
+ function Cn({
69
+ props: e,
70
+ name: t
71
+ }) {
72
+ return en({
73
+ props: e,
74
+ name: t,
75
+ defaultTheme: tn,
76
+ themeId: nn
77
+ });
78
+ }
79
+ function Tn(e) {
80
+ return fe("MuiCollapse", e);
81
+ }
82
+ me("MuiCollapse", ["root", "horizontal", "vertical", "entered", "hidden", "wrapper", "wrapperInner"]);
83
+ const wn = ["addEndListener", "children", "className", "collapsedSize", "component", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "orientation", "style", "timeout", "TransitionComponent"], vn = (e) => {
84
+ const {
85
+ orientation: t,
86
+ classes: n
87
+ } = e, o = {
88
+ root: ["root", `${t}`],
89
+ entered: ["entered"],
90
+ hidden: ["hidden"],
91
+ wrapper: ["wrapper", `${t}`],
92
+ wrapperInner: ["wrapperInner", `${t}`]
93
+ };
94
+ return ge(o, Tn, n);
95
+ }, Mn = U("div", {
96
+ name: "MuiCollapse",
97
+ slot: "Root",
98
+ overridesResolver: (e, t) => {
99
+ const {
100
+ ownerState: n
101
+ } = e;
102
+ return [t.root, t[n.orientation], n.state === "entered" && t.entered, n.state === "exited" && !n.in && n.collapsedSize === "0px" && t.hidden];
103
+ }
104
+ })(({
105
+ theme: e,
106
+ ownerState: t
107
+ }) => D({
108
+ height: 0,
109
+ overflow: "hidden",
110
+ transition: e.transitions.create("height")
111
+ }, t.orientation === "horizontal" && {
112
+ height: "auto",
113
+ width: 0,
114
+ transition: e.transitions.create("width")
115
+ }, t.state === "entered" && D({
116
+ height: "auto",
117
+ overflow: "visible"
118
+ }, t.orientation === "horizontal" && {
119
+ width: "auto"
120
+ }), t.state === "exited" && !t.in && t.collapsedSize === "0px" && {
121
+ visibility: "hidden"
122
+ })), Sn = U("div", {
123
+ name: "MuiCollapse",
124
+ slot: "Wrapper",
125
+ overridesResolver: (e, t) => t.wrapper
126
+ })(({
127
+ ownerState: e
128
+ }) => D({
129
+ // Hack to get children with a negative margin to not falsify the height computation.
130
+ display: "flex",
131
+ width: "100%"
132
+ }, e.orientation === "horizontal" && {
133
+ width: "auto",
134
+ height: "100%"
135
+ })), Rn = U("div", {
136
+ name: "MuiCollapse",
137
+ slot: "WrapperInner",
138
+ overridesResolver: (e, t) => t.wrapperInner
139
+ })(({
140
+ ownerState: e
141
+ }) => D({
142
+ width: "100%"
143
+ }, e.orientation === "horizontal" && {
144
+ width: "auto",
145
+ height: "100%"
146
+ })), Be = /* @__PURE__ */ x.forwardRef(function(t, n) {
147
+ const o = st({
148
+ props: t,
149
+ name: "MuiCollapse"
150
+ }), {
151
+ addEndListener: s,
152
+ children: d,
153
+ className: c,
154
+ collapsedSize: i = "0px",
155
+ component: p,
156
+ easing: u,
157
+ in: l,
158
+ onEnter: a,
159
+ onEntered: m,
160
+ onEntering: I,
161
+ onExit: h,
162
+ onExited: f,
163
+ onExiting: g,
164
+ orientation: b = "vertical",
165
+ style: y,
166
+ timeout: C = on.standard,
167
+ // eslint-disable-next-line react/prop-types
168
+ TransitionComponent: O = rn
169
+ } = o, T = Le(o, wn), v = D({}, o, {
170
+ orientation: b,
171
+ collapsedSize: i
172
+ }), R = vn(v), B = sn(), K = ln(), V = x.useRef(null), A = x.useRef(), z = typeof i == "number" ? `${i}px` : i, j = b === "horizontal", q = j ? "width" : "height", N = x.useRef(null), H = de(n, N), L = (M) => (F) => {
173
+ if (M) {
174
+ const _ = N.current;
175
+ F === void 0 ? M(_) : M(_, F);
176
+ }
177
+ }, W = () => V.current ? V.current[j ? "clientWidth" : "clientHeight"] : 0, k = L((M, F) => {
178
+ V.current && j && (V.current.style.position = "absolute"), M.style[q] = z, a && a(M, F);
179
+ }), P = L((M, F) => {
180
+ const _ = W();
181
+ V.current && j && (V.current.style.position = "");
182
+ const {
183
+ duration: $,
184
+ easing: Y
185
+ } = nt({
186
+ style: y,
187
+ timeout: C,
188
+ easing: u
189
+ }, {
190
+ mode: "enter"
191
+ });
192
+ if (C === "auto") {
193
+ const xe = B.transitions.getAutoHeightDuration(_);
194
+ M.style.transitionDuration = `${xe}ms`, A.current = xe;
195
+ } else
196
+ M.style.transitionDuration = typeof $ == "string" ? $ : `${$}ms`;
197
+ M.style[q] = `${_}px`, M.style.transitionTimingFunction = Y, I && I(M, F);
198
+ }), ne = L((M, F) => {
199
+ M.style[q] = "auto", m && m(M, F);
200
+ }), ye = L((M) => {
201
+ M.style[q] = `${W()}px`, h && h(M);
202
+ }), Oe = L(f), ke = L((M) => {
203
+ const F = W(), {
204
+ duration: _,
205
+ easing: $
206
+ } = nt({
207
+ style: y,
208
+ timeout: C,
209
+ easing: u
210
+ }, {
211
+ mode: "exit"
212
+ });
213
+ if (C === "auto") {
214
+ const Y = B.transitions.getAutoHeightDuration(F);
215
+ M.style.transitionDuration = `${Y}ms`, A.current = Y;
216
+ } else
217
+ M.style.transitionDuration = typeof _ == "string" ? _ : `${_}ms`;
218
+ M.style[q] = z, M.style.transitionTimingFunction = $, g && g(M);
219
+ });
220
+ return /* @__PURE__ */ w(O, D({
221
+ in: l,
222
+ onEnter: k,
223
+ onEntered: ne,
224
+ onEntering: P,
225
+ onExit: ye,
226
+ onExited: Oe,
227
+ onExiting: ke,
228
+ addEndListener: (M) => {
229
+ C === "auto" && K.start(A.current || 0, M), s && s(N.current, M);
230
+ },
231
+ nodeRef: N,
232
+ timeout: C === "auto" ? null : C
233
+ }, T, {
234
+ children: (M, F) => /* @__PURE__ */ w(Mn, D({
235
+ as: p,
236
+ className: Ie(R.root, c, {
237
+ entered: R.entered,
238
+ exited: !l && z === "0px" && R.hidden
239
+ }[M]),
240
+ style: D({
241
+ [j ? "minWidth" : "minHeight"]: z
242
+ }, y),
243
+ ref: H
244
+ }, F, {
245
+ // `ownerState` is set after `childProps` to override any existing `ownerState` property in `childProps`
246
+ // that might have been forwarded from the Transition component.
247
+ ownerState: D({}, v, {
248
+ state: M
249
+ }),
250
+ children: /* @__PURE__ */ w(Sn, {
251
+ ownerState: D({}, v, {
252
+ state: M
253
+ }),
254
+ className: R.wrapper,
255
+ ref: V,
256
+ children: /* @__PURE__ */ w(Rn, {
257
+ ownerState: D({}, v, {
258
+ state: M
259
+ }),
260
+ className: R.wrapperInner,
261
+ children: d
262
+ })
263
+ })
264
+ }))
265
+ }));
266
+ });
267
+ process.env.NODE_ENV !== "production" && (Be.propTypes = {
268
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
269
+ // │ These PropTypes are generated from the TypeScript type definitions. │
270
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
271
+ // └─────────────────────────────────────────────────────────────────────┘
272
+ /**
273
+ * Add a custom transition end trigger. Called with the transitioning DOM
274
+ * node and a done callback. Allows for more fine grained transition end
275
+ * logic. Note: Timeouts are still used as a fallback if provided.
276
+ */
277
+ addEndListener: r.func,
278
+ /**
279
+ * The content node to be collapsed.
280
+ */
281
+ children: r.node,
282
+ /**
283
+ * Override or extend the styles applied to the component.
284
+ */
285
+ classes: r.object,
286
+ /**
287
+ * @ignore
288
+ */
289
+ className: r.string,
290
+ /**
291
+ * The width (horizontal) or height (vertical) of the container when collapsed.
292
+ * @default '0px'
293
+ */
294
+ collapsedSize: r.oneOfType([r.number, r.string]),
295
+ /**
296
+ * The component used for the root node.
297
+ * Either a string to use a HTML element or a component.
298
+ */
299
+ component: lt,
300
+ /**
301
+ * The transition timing function.
302
+ * You may specify a single easing or a object containing enter and exit values.
303
+ */
304
+ easing: r.oneOfType([r.shape({
305
+ enter: r.string,
306
+ exit: r.string
307
+ }), r.string]),
308
+ /**
309
+ * If `true`, the component will transition in.
310
+ */
311
+ in: r.bool,
312
+ /**
313
+ * @ignore
314
+ */
315
+ onEnter: r.func,
316
+ /**
317
+ * @ignore
318
+ */
319
+ onEntered: r.func,
320
+ /**
321
+ * @ignore
322
+ */
323
+ onEntering: r.func,
324
+ /**
325
+ * @ignore
326
+ */
327
+ onExit: r.func,
328
+ /**
329
+ * @ignore
330
+ */
331
+ onExited: r.func,
332
+ /**
333
+ * @ignore
334
+ */
335
+ onExiting: r.func,
336
+ /**
337
+ * The transition orientation.
338
+ * @default 'vertical'
339
+ */
340
+ orientation: r.oneOf(["horizontal", "vertical"]),
341
+ /**
342
+ * @ignore
343
+ */
344
+ style: r.object,
345
+ /**
346
+ * The system prop that allows defining system overrides as well as additional CSS styles.
347
+ */
348
+ sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
349
+ /**
350
+ * The duration for the transition, in milliseconds.
351
+ * You may specify a single timeout for all transitions, or individually with an object.
352
+ *
353
+ * Set to 'auto' to automatically calculate transition time based on height.
354
+ * @default duration.standard
355
+ */
356
+ timeout: r.oneOfType([r.oneOf(["auto"]), r.number, r.shape({
357
+ appear: r.number,
358
+ enter: r.number,
359
+ exit: r.number
360
+ })])
361
+ });
362
+ Be.muiSupportAuto = !0;
363
+ const ut = /* @__PURE__ */ x.createContext(void 0);
364
+ process.env.NODE_ENV !== "production" && (ut.displayName = "FormControlContext");
365
+ function On() {
366
+ return x.useContext(ut);
367
+ }
368
+ function kn(e) {
369
+ return fe("PrivateSwitchBase", e);
370
+ }
371
+ me("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
372
+ const Pn = ["autoFocus", "checked", "checkedIcon", "className", "defaultChecked", "disabled", "disableFocusRipple", "edge", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"], Dn = (e) => {
373
+ const {
374
+ classes: t,
375
+ checked: n,
376
+ disabled: o,
377
+ edge: s
378
+ } = e, d = {
379
+ root: ["root", n && "checked", o && "disabled", s && `edge${ue(s)}`],
380
+ input: ["input"]
381
+ };
382
+ return ge(d, kn, t);
383
+ }, Vn = U(an)(({
384
+ ownerState: e
385
+ }) => D({
386
+ padding: 9,
387
+ borderRadius: "50%"
388
+ }, e.edge === "start" && {
389
+ marginLeft: e.size === "small" ? -3 : -12
390
+ }, e.edge === "end" && {
391
+ marginRight: e.size === "small" ? -3 : -12
392
+ })), $n = U("input", {
393
+ shouldForwardProp: at
394
+ })({
395
+ cursor: "inherit",
396
+ position: "absolute",
397
+ opacity: 0,
398
+ width: "100%",
399
+ height: "100%",
400
+ top: 0,
401
+ left: 0,
402
+ margin: 0,
403
+ padding: 0,
404
+ zIndex: 1
405
+ }), pt = /* @__PURE__ */ x.forwardRef(function(t, n) {
406
+ const {
407
+ autoFocus: o,
408
+ checked: s,
409
+ checkedIcon: d,
410
+ className: c,
411
+ defaultChecked: i,
412
+ disabled: p,
413
+ disableFocusRipple: u = !1,
414
+ edge: l = !1,
415
+ icon: a,
416
+ id: m,
417
+ inputProps: I,
418
+ inputRef: h,
419
+ name: f,
420
+ onBlur: g,
421
+ onChange: b,
422
+ onFocus: y,
423
+ readOnly: C,
424
+ required: O = !1,
425
+ tabIndex: T,
426
+ type: v,
427
+ value: R
428
+ } = t, B = Le(t, Pn), [K, V] = cn({
429
+ controlled: s,
430
+ default: !!i,
431
+ name: "SwitchBase",
432
+ state: "checked"
433
+ }), A = On(), z = (k) => {
434
+ y && y(k), A && A.onFocus && A.onFocus(k);
435
+ }, j = (k) => {
436
+ g && g(k), A && A.onBlur && A.onBlur(k);
437
+ }, q = (k) => {
438
+ if (k.nativeEvent.defaultPrevented)
439
+ return;
440
+ const P = k.target.checked;
441
+ V(P), b && b(k, P);
442
+ };
443
+ let N = p;
444
+ A && typeof N > "u" && (N = A.disabled);
445
+ const H = v === "checkbox" || v === "radio", L = D({}, t, {
446
+ checked: K,
447
+ disabled: N,
448
+ disableFocusRipple: u,
449
+ edge: l
450
+ }), W = Dn(L);
451
+ return /* @__PURE__ */ ve(Vn, D({
452
+ component: "span",
453
+ className: Ie(W.root, c),
454
+ centerRipple: !0,
455
+ focusRipple: !u,
456
+ disabled: N,
457
+ tabIndex: null,
458
+ role: void 0,
459
+ onFocus: z,
460
+ onBlur: j,
461
+ ownerState: L,
462
+ ref: n
463
+ }, B, {
464
+ children: [/* @__PURE__ */ w($n, D({
465
+ autoFocus: o,
466
+ checked: s,
467
+ defaultChecked: i,
468
+ className: W.input,
469
+ disabled: N,
470
+ id: H ? m : void 0,
471
+ name: f,
472
+ onChange: q,
473
+ readOnly: C,
474
+ ref: h,
475
+ required: O,
476
+ ownerState: L,
477
+ tabIndex: T,
478
+ type: v
479
+ }, v === "checkbox" && R === void 0 ? {} : {
480
+ value: R
481
+ }, I)), K ? d : a]
482
+ }));
483
+ });
484
+ process.env.NODE_ENV !== "production" && (pt.propTypes = {
485
+ /**
486
+ * If `true`, the `input` element is focused during the first mount.
487
+ */
488
+ autoFocus: r.bool,
489
+ /**
490
+ * If `true`, the component is checked.
491
+ */
492
+ checked: r.bool,
493
+ /**
494
+ * The icon to display when the component is checked.
495
+ */
496
+ checkedIcon: r.node.isRequired,
497
+ /**
498
+ * Override or extend the styles applied to the component.
499
+ */
500
+ classes: r.object,
501
+ /**
502
+ * @ignore
503
+ */
504
+ className: r.string,
505
+ /**
506
+ * @ignore
507
+ */
508
+ defaultChecked: r.bool,
509
+ /**
510
+ * If `true`, the component is disabled.
511
+ */
512
+ disabled: r.bool,
513
+ /**
514
+ * If `true`, the keyboard focus ripple is disabled.
515
+ * @default false
516
+ */
517
+ disableFocusRipple: r.bool,
518
+ /**
519
+ * If given, uses a negative margin to counteract the padding on one
520
+ * side (this is often helpful for aligning the left or right
521
+ * side of the icon with content above or below, without ruining the border
522
+ * size and shape).
523
+ * @default false
524
+ */
525
+ edge: r.oneOf(["end", "start", !1]),
526
+ /**
527
+ * The icon to display when the component is unchecked.
528
+ */
529
+ icon: r.node.isRequired,
530
+ /**
531
+ * The id of the `input` element.
532
+ */
533
+ id: r.string,
534
+ /**
535
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
536
+ */
537
+ inputProps: r.object,
538
+ /**
539
+ * Pass a ref to the `input` element.
540
+ */
541
+ inputRef: ct,
542
+ /*
543
+ * @ignore
544
+ */
545
+ name: r.string,
546
+ /**
547
+ * @ignore
548
+ */
549
+ onBlur: r.func,
550
+ /**
551
+ * Callback fired when the state is changed.
552
+ *
553
+ * @param {object} event The event source of the callback.
554
+ * You can pull out the new checked state by accessing `event.target.checked` (boolean).
555
+ */
556
+ onChange: r.func,
557
+ /**
558
+ * @ignore
559
+ */
560
+ onFocus: r.func,
561
+ /**
562
+ * It prevents the user from changing the value of the field
563
+ * (not from interacting with the field).
564
+ */
565
+ readOnly: r.bool,
566
+ /**
567
+ * If `true`, the `input` element is required.
568
+ */
569
+ required: r.bool,
570
+ /**
571
+ * The system prop that allows defining system overrides as well as additional CSS styles.
572
+ */
573
+ sx: r.object,
574
+ /**
575
+ * @ignore
576
+ */
577
+ tabIndex: r.oneOfType([r.number, r.string]),
578
+ /**
579
+ * The input component prop `type`.
580
+ */
581
+ type: r.string.isRequired,
582
+ /**
583
+ * The value of the component.
584
+ */
585
+ value: r.any
586
+ });
587
+ const An = te(/* @__PURE__ */ w("path", {
588
+ d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
589
+ }), "CheckBoxOutlineBlank"), Fn = te(/* @__PURE__ */ w("path", {
590
+ d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
591
+ }), "CheckBox"), Nn = te(/* @__PURE__ */ w("path", {
592
+ d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
593
+ }), "IndeterminateCheckBox");
594
+ function Ln(e) {
595
+ return fe("MuiCheckbox", e);
596
+ }
597
+ const Ae = me("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]), jn = ["checkedIcon", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size", "className"], _n = (e) => {
598
+ const {
599
+ classes: t,
600
+ indeterminate: n,
601
+ color: o,
602
+ size: s
603
+ } = e, d = {
604
+ root: ["root", n && "indeterminate", `color${ue(o)}`, `size${ue(s)}`]
605
+ }, c = ge(d, Ln, t);
606
+ return D({}, t, c);
607
+ }, Bn = U(pt, {
608
+ shouldForwardProp: (e) => at(e) || e === "classes",
609
+ name: "MuiCheckbox",
610
+ slot: "Root",
611
+ overridesResolver: (e, t) => {
612
+ const {
613
+ ownerState: n
614
+ } = e;
615
+ return [t.root, n.indeterminate && t.indeterminate, t[`size${ue(n.size)}`], n.color !== "default" && t[`color${ue(n.color)}`]];
616
+ }
617
+ })(({
618
+ theme: e,
619
+ ownerState: t
620
+ }) => D({
621
+ color: (e.vars || e).palette.text.secondary
622
+ }, !t.disableRipple && {
623
+ "&:hover": {
624
+ backgroundColor: e.vars ? `rgba(${t.color === "default" ? e.vars.palette.action.activeChannel : e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})` : dn(t.color === "default" ? e.palette.action.active : e.palette[t.color].main, e.palette.action.hoverOpacity),
625
+ // Reset on touch devices, it doesn't add specificity
626
+ "@media (hover: none)": {
627
+ backgroundColor: "transparent"
628
+ }
629
+ }
630
+ }, t.color !== "default" && {
631
+ [`&.${Ae.checked}, &.${Ae.indeterminate}`]: {
632
+ color: (e.vars || e).palette[t.color].main
633
+ },
634
+ [`&.${Ae.disabled}`]: {
635
+ color: (e.vars || e).palette.action.disabled
636
+ }
637
+ })), zn = /* @__PURE__ */ w(Fn, {}), Un = /* @__PURE__ */ w(An, {}), Kn = /* @__PURE__ */ w(Nn, {}), ft = /* @__PURE__ */ x.forwardRef(function(t, n) {
638
+ var o, s;
639
+ const d = st({
640
+ props: t,
641
+ name: "MuiCheckbox"
642
+ }), {
643
+ checkedIcon: c = zn,
644
+ color: i = "primary",
645
+ icon: p = Un,
646
+ indeterminate: u = !1,
647
+ indeterminateIcon: l = Kn,
648
+ inputProps: a,
649
+ size: m = "medium",
650
+ className: I
651
+ } = d, h = Le(d, jn), f = u ? l : p, g = u ? l : c, b = D({}, d, {
652
+ color: i,
653
+ indeterminate: u,
654
+ size: m
655
+ }), y = _n(b);
656
+ return /* @__PURE__ */ w(Bn, D({
657
+ type: "checkbox",
658
+ inputProps: D({
659
+ "data-indeterminate": u
660
+ }, a),
661
+ icon: /* @__PURE__ */ x.cloneElement(f, {
662
+ fontSize: (o = f.props.fontSize) != null ? o : m
663
+ }),
664
+ checkedIcon: /* @__PURE__ */ x.cloneElement(g, {
665
+ fontSize: (s = g.props.fontSize) != null ? s : m
666
+ }),
667
+ ownerState: b,
668
+ ref: n,
669
+ className: Ie(y.root, I)
670
+ }, h, {
671
+ classes: y
672
+ }));
673
+ });
674
+ process.env.NODE_ENV !== "production" && (ft.propTypes = {
675
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
676
+ // │ These PropTypes are generated from the TypeScript type definitions. │
677
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
678
+ // └─────────────────────────────────────────────────────────────────────┘
679
+ /**
680
+ * If `true`, the component is checked.
681
+ */
682
+ checked: r.bool,
683
+ /**
684
+ * The icon to display when the component is checked.
685
+ * @default <CheckBoxIcon />
686
+ */
687
+ checkedIcon: r.node,
688
+ /**
689
+ * Override or extend the styles applied to the component.
690
+ */
691
+ classes: r.object,
692
+ /**
693
+ * @ignore
694
+ */
695
+ className: r.string,
696
+ /**
697
+ * The color of the component.
698
+ * It supports both default and custom theme colors, which can be added as shown in the
699
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
700
+ * @default 'primary'
701
+ */
702
+ color: r.oneOfType([r.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), r.string]),
703
+ /**
704
+ * The default checked state. Use when the component is not controlled.
705
+ */
706
+ defaultChecked: r.bool,
707
+ /**
708
+ * If `true`, the component is disabled.
709
+ * @default false
710
+ */
711
+ disabled: r.bool,
712
+ /**
713
+ * If `true`, the ripple effect is disabled.
714
+ * @default false
715
+ */
716
+ disableRipple: r.bool,
717
+ /**
718
+ * The icon to display when the component is unchecked.
719
+ * @default <CheckBoxOutlineBlankIcon />
720
+ */
721
+ icon: r.node,
722
+ /**
723
+ * The id of the `input` element.
724
+ */
725
+ id: r.string,
726
+ /**
727
+ * If `true`, the component appears indeterminate.
728
+ * This does not set the native input element to indeterminate due
729
+ * to inconsistent behavior across browsers.
730
+ * However, we set a `data-indeterminate` attribute on the `input`.
731
+ * @default false
732
+ */
733
+ indeterminate: r.bool,
734
+ /**
735
+ * The icon to display when the component is indeterminate.
736
+ * @default <IndeterminateCheckBoxIcon />
737
+ */
738
+ indeterminateIcon: r.node,
739
+ /**
740
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
741
+ */
742
+ inputProps: r.object,
743
+ /**
744
+ * Pass a ref to the `input` element.
745
+ */
746
+ inputRef: ct,
747
+ /**
748
+ * Callback fired when the state is changed.
749
+ *
750
+ * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
751
+ * You can pull out the new checked state by accessing `event.target.checked` (boolean).
752
+ */
753
+ onChange: r.func,
754
+ /**
755
+ * If `true`, the `input` element is required.
756
+ * @default false
757
+ */
758
+ required: r.bool,
759
+ /**
760
+ * The size of the component.
761
+ * `small` is equivalent to the dense checkbox styling.
762
+ * @default 'medium'
763
+ */
764
+ size: r.oneOfType([r.oneOf(["medium", "small"]), r.string]),
765
+ /**
766
+ * The system prop that allows defining system overrides as well as additional CSS styles.
767
+ */
768
+ sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
769
+ /**
770
+ * The value of the component. The DOM API casts this to a string.
771
+ * The browser uses "on" as the default value.
772
+ */
773
+ value: r.any
774
+ });
775
+ const qn = te(/* @__PURE__ */ w("path", {
776
+ d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"
777
+ }), "Visibility"), Xn = te(/* @__PURE__ */ w("path", {
778
+ d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"
779
+ }), "VisibilityOff");
780
+ function E() {
781
+ return E = Object.assign ? Object.assign.bind() : function(e) {
782
+ for (var t = 1; t < arguments.length; t++) {
783
+ var n = arguments[t];
784
+ for (var o in n) ({}).hasOwnProperty.call(n, o) && (e[o] = n[o]);
785
+ }
786
+ return e;
787
+ }, E.apply(null, arguments);
788
+ }
789
+ function mt(e) {
790
+ return Cn;
791
+ }
792
+ const rt = /* @__PURE__ */ new Set();
793
+ function It(e, t = "warning") {
794
+ if (process.env.NODE_ENV === "production")
795
+ return;
796
+ const n = Array.isArray(e) ? e.join(`
797
+ `) : e;
798
+ rt.has(n) || (rt.add(n), t === "error" ? console.error(n) : console.warn(n));
799
+ }
800
+ function Wn(e) {
801
+ return fe("MuiSimpleTreeView", e);
802
+ }
803
+ me("MuiSimpleTreeView", ["root"]);
804
+ const Jn = (e, t) => {
805
+ const n = x.useRef({}), [o, s] = x.useState(() => {
806
+ const c = {};
807
+ return e.forEach((i) => {
808
+ i.models && Object.entries(i.models).forEach(([p, u]) => {
809
+ n.current[p] = {
810
+ isControlled: t[p] !== void 0,
811
+ getDefaultValue: u.getDefaultValue
812
+ }, c[p] = u.getDefaultValue(t);
813
+ });
814
+ }), c;
815
+ }), d = Object.fromEntries(Object.entries(n.current).map(([c, i]) => {
816
+ const p = t[c] ?? o[c];
817
+ return [c, {
818
+ value: p,
819
+ setControlledValue: (u) => {
820
+ i.isControlled || s((l) => E({}, l, {
821
+ [c]: u
822
+ }));
823
+ }
824
+ }];
825
+ }));
826
+ return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([c, i]) => {
827
+ const p = t[c], u = i.getDefaultValue(t);
828
+ x.useEffect(() => {
829
+ i.isControlled !== (p !== void 0) && console.error([`MUI X: A component is changing the ${i.isControlled ? "" : "un"}controlled ${c} state of TreeView to be ${i.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${c} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
830
+ `));
831
+ }, [p]);
832
+ const {
833
+ current: l
834
+ } = x.useRef(u);
835
+ x.useEffect(() => {
836
+ !i.isControlled && l !== u && console.error([`MUI X: A component is changing the default ${c} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
837
+ `));
838
+ }, [JSON.stringify(u)]);
839
+ }), d;
840
+ };
841
+ class Gn {
842
+ constructor() {
843
+ this.maxListeners = 20, this.warnOnce = !1, this.events = {};
844
+ }
845
+ on(t, n, o = {}) {
846
+ let s = this.events[t];
847
+ if (s || (s = {
848
+ highPriority: /* @__PURE__ */ new Map(),
849
+ regular: /* @__PURE__ */ new Map()
850
+ }, this.events[t] = s), o.isFirst ? s.highPriority.set(n, !0) : s.regular.set(n, !0), process.env.NODE_ENV !== "production") {
851
+ const d = s.highPriority.size + s.regular.size;
852
+ d > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${d} ${t} listeners added.`].join(`
853
+ `)));
854
+ }
855
+ }
856
+ removeListener(t, n) {
857
+ this.events[t] && (this.events[t].regular.delete(n), this.events[t].highPriority.delete(n));
858
+ }
859
+ removeAllListeners() {
860
+ this.events = {};
861
+ }
862
+ emit(t, ...n) {
863
+ const o = this.events[t];
864
+ if (!o)
865
+ return;
866
+ const s = Array.from(o.highPriority.keys()), d = Array.from(o.regular.keys());
867
+ for (let c = s.length - 1; c >= 0; c -= 1) {
868
+ const i = s[c];
869
+ o.highPriority.has(i) && i.apply(this, n);
870
+ }
871
+ for (let c = 0; c < d.length; c += 1) {
872
+ const i = d[c];
873
+ o.regular.has(i) && i.apply(this, n);
874
+ }
875
+ }
876
+ once(t, n) {
877
+ const o = this;
878
+ this.on(t, function s(...d) {
879
+ o.removeListener(t, s), n.apply(o, d);
880
+ });
881
+ }
882
+ }
883
+ const Hn = (e) => e.isPropagationStopped !== void 0, gt = () => {
884
+ const [e] = x.useState(() => new Gn()), t = x.useCallback((...o) => {
885
+ const [s, d, c = {}] = o;
886
+ c.defaultMuiPrevented = !1, !(Hn(c) && c.isPropagationStopped()) && e.emit(s, d, c);
887
+ }, [e]), n = x.useCallback((o, s) => (e.on(o, s), () => {
888
+ e.removeListener(o, s);
889
+ }), [e]);
890
+ return {
891
+ instance: {
892
+ $$publishEvent: t,
893
+ $$subscribeEvent: n
894
+ }
895
+ };
896
+ };
897
+ gt.params = {};
898
+ const ht = ({
899
+ plugins: e
900
+ }) => {
901
+ const t = new Set(e);
902
+ return {
903
+ instance: {
904
+ getAvailablePlugins: () => t
905
+ }
906
+ };
907
+ };
908
+ ht.params = {};
909
+ const bt = ({
910
+ params: e
911
+ }) => {
912
+ const t = un(e.id), n = x.useCallback((o, s) => s ?? `${t}-${o}`, [t]);
913
+ return {
914
+ getRootProps: () => ({
915
+ id: t
916
+ }),
917
+ instance: {
918
+ getTreeItemIdAttribute: n
919
+ }
920
+ };
921
+ };
922
+ bt.params = {
923
+ id: !0
924
+ };
925
+ const Yn = [gt, ht, bt];
926
+ function Q(e, t) {
927
+ if (e == null) return {};
928
+ var n = {};
929
+ for (var o in e) if ({}.hasOwnProperty.call(e, o)) {
930
+ if (t.includes(o)) continue;
931
+ n[o] = e[o];
932
+ }
933
+ return n;
934
+ }
935
+ const Qn = ["slots", "slotProps", "apiRef", "experimentalFeatures"], Zn = (e) => {
936
+ let {
937
+ props: {
938
+ slots: t,
939
+ slotProps: n,
940
+ apiRef: o,
941
+ experimentalFeatures: s
942
+ },
943
+ plugins: d
944
+ } = e, c = Q(e.props, Qn);
945
+ const i = {};
946
+ d.forEach((a) => {
947
+ Object.assign(i, a.params);
948
+ });
949
+ const p = {}, u = {};
950
+ Object.keys(c).forEach((a) => {
951
+ const m = c[a];
952
+ i[a] ? p[a] = m : u[a] = m;
953
+ });
954
+ const l = d.reduce((a, m) => m.getDefaultizedParams ? m.getDefaultizedParams(a) : a, p);
955
+ return {
956
+ apiRef: o,
957
+ forwardedProps: u,
958
+ pluginParams: l,
959
+ slots: t ?? {},
960
+ slotProps: n ?? {},
961
+ experimentalFeatures: s ?? {}
962
+ };
963
+ }, eo = ({
964
+ plugins: e,
965
+ instance: t,
966
+ publicAPI: n,
967
+ rootRef: o
968
+ }) => ({
969
+ runItemPlugins: (i) => {
970
+ let p = null, u = null;
971
+ const l = [], a = {};
972
+ e.forEach((h) => {
973
+ if (!h.itemPlugin)
974
+ return;
975
+ const f = h.itemPlugin({
976
+ props: i,
977
+ rootRef: p,
978
+ contentRef: u
979
+ });
980
+ f != null && f.rootRef && (p = f.rootRef), f != null && f.contentRef && (u = f.contentRef), f != null && f.propsEnhancers && (l.push(f.propsEnhancers), Object.keys(f.propsEnhancers).forEach((g) => {
981
+ a[g] = !0;
982
+ }));
983
+ });
984
+ const m = (h) => (f) => {
985
+ const g = {};
986
+ return l.forEach((b) => {
987
+ const y = b[h];
988
+ y != null && Object.assign(g, y(f));
989
+ }), g;
990
+ }, I = Object.fromEntries(Object.keys(a).map((h) => [h, m(h)]));
991
+ return {
992
+ contentRef: u,
993
+ rootRef: p,
994
+ propsEnhancers: I
995
+ };
996
+ },
997
+ wrapItem: ({
998
+ itemId: i,
999
+ children: p
1000
+ }) => {
1001
+ let u = p;
1002
+ for (let l = e.length - 1; l >= 0; l -= 1) {
1003
+ const a = e[l];
1004
+ a.wrapItem && (u = a.wrapItem({
1005
+ itemId: i,
1006
+ children: u,
1007
+ instance: t
1008
+ }));
1009
+ }
1010
+ return u;
1011
+ },
1012
+ wrapRoot: ({
1013
+ children: i
1014
+ }) => {
1015
+ let p = i;
1016
+ for (let u = e.length - 1; u >= 0; u -= 1) {
1017
+ const l = e[u];
1018
+ l.wrapRoot && (p = l.wrapRoot({
1019
+ children: p,
1020
+ instance: t
1021
+ }));
1022
+ }
1023
+ return p;
1024
+ },
1025
+ instance: t,
1026
+ rootRef: o,
1027
+ publicAPI: n
1028
+ });
1029
+ function to(e) {
1030
+ const t = x.useRef({});
1031
+ return e ? (e.current == null && (e.current = {}), e.current) : t.current;
1032
+ }
1033
+ const no = ({
1034
+ plugins: e,
1035
+ rootRef: t,
1036
+ props: n
1037
+ }) => {
1038
+ const o = [...Yn, ...e], {
1039
+ pluginParams: s,
1040
+ forwardedProps: d,
1041
+ apiRef: c,
1042
+ experimentalFeatures: i,
1043
+ slots: p,
1044
+ slotProps: u
1045
+ } = Zn({
1046
+ plugins: o,
1047
+ props: n
1048
+ }), l = Jn(o, s), m = x.useRef({}).current, I = to(c), h = x.useRef(null), f = de(h, t), g = eo({
1049
+ plugins: o,
1050
+ instance: m,
1051
+ publicAPI: I,
1052
+ rootRef: h
1053
+ }), [b, y] = x.useState(() => {
1054
+ const v = {};
1055
+ return o.forEach((R) => {
1056
+ R.getInitialState && Object.assign(v, R.getInitialState(s));
1057
+ }), v;
1058
+ }), C = [], O = (v) => {
1059
+ const R = v({
1060
+ instance: m,
1061
+ params: s,
1062
+ slots: p,
1063
+ slotProps: u,
1064
+ experimentalFeatures: i,
1065
+ state: b,
1066
+ setState: y,
1067
+ rootRef: h,
1068
+ models: l,
1069
+ plugins: o
1070
+ });
1071
+ R.getRootProps && C.push(R.getRootProps), R.publicAPI && Object.assign(I, R.publicAPI), R.instance && Object.assign(m, R.instance), R.contextValue && Object.assign(g, R.contextValue);
1072
+ };
1073
+ return o.forEach(O), {
1074
+ getRootProps: (v = {}) => {
1075
+ const R = E({
1076
+ role: "tree"
1077
+ }, d, v, {
1078
+ ref: f
1079
+ });
1080
+ return C.forEach((B) => {
1081
+ Object.assign(R, B(v));
1082
+ }), R;
1083
+ },
1084
+ rootRef: f,
1085
+ contextValue: g,
1086
+ instance: m
1087
+ };
1088
+ }, ze = /* @__PURE__ */ x.createContext(null);
1089
+ process.env.NODE_ENV !== "production" && (ze.displayName = "TreeViewContext");
1090
+ function oo(e) {
1091
+ const {
1092
+ value: t,
1093
+ children: n
1094
+ } = e;
1095
+ return /* @__PURE__ */ w(ze.Provider, {
1096
+ value: t,
1097
+ children: t.wrapRoot({
1098
+ children: n
1099
+ })
1100
+ });
1101
+ }
1102
+ const le = () => {
1103
+ const e = x.useContext(ze);
1104
+ if (e == null)
1105
+ throw new Error(["MUI X: Could not find the Tree View context.", "It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join(`
1106
+ `));
1107
+ return e;
1108
+ }, yt = (e, t, n) => {
1109
+ e.$$publishEvent(t, n);
1110
+ }, Z = "__TREE_VIEW_ROOT_PARENT_ID__", xt = (e) => {
1111
+ const t = {};
1112
+ return e.forEach((n, o) => {
1113
+ t[n] = o;
1114
+ }), t;
1115
+ }, se = /* @__PURE__ */ x.createContext(() => -1);
1116
+ process.env.NODE_ENV !== "production" && (se.displayName = "TreeViewItemDepthContext");
1117
+ const ro = ["children"], Et = ({
1118
+ items: e,
1119
+ isItemDisabled: t,
1120
+ getItemLabel: n,
1121
+ getItemId: o
1122
+ }) => {
1123
+ const s = {}, d = {}, c = {
1124
+ [Z]: []
1125
+ }, i = (u, l, a) => {
1126
+ var f, g;
1127
+ const m = o ? o(u) : u.id;
1128
+ if (m == null)
1129
+ throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(u)].join(`
1130
+ `));
1131
+ if (s[m] != null)
1132
+ throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${m}"`].join(`
1133
+ `));
1134
+ const I = n ? n(u) : u.label;
1135
+ if (I == null)
1136
+ throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(u)].join(`
1137
+ `));
1138
+ s[m] = {
1139
+ id: m,
1140
+ label: I,
1141
+ parentId: a,
1142
+ idAttribute: void 0,
1143
+ expandable: !!((f = u.children) != null && f.length),
1144
+ disabled: t ? t(u) : !1,
1145
+ depth: l
1146
+ }, d[m] = u;
1147
+ const h = a ?? Z;
1148
+ c[h] || (c[h] = []), c[h].push(m), (g = u.children) == null || g.forEach((b) => i(b, l + 1, m));
1149
+ };
1150
+ e.forEach((u) => i(u, 0, null));
1151
+ const p = {};
1152
+ return Object.keys(c).forEach((u) => {
1153
+ p[u] = xt(c[u]);
1154
+ }), {
1155
+ itemMetaMap: s,
1156
+ itemMap: d,
1157
+ itemOrderedChildrenIds: c,
1158
+ itemChildrenIndexes: p
1159
+ };
1160
+ }, he = ({
1161
+ instance: e,
1162
+ params: t,
1163
+ state: n,
1164
+ setState: o,
1165
+ experimentalFeatures: s
1166
+ }) => {
1167
+ const d = x.useCallback((b) => n.items.itemMetaMap[b], [n.items.itemMetaMap]), c = x.useCallback((b) => n.items.itemMap[b], [n.items.itemMap]), i = x.useCallback(() => {
1168
+ const b = (y) => {
1169
+ const C = n.items.itemMap[y], O = Q(C, ro), T = n.items.itemOrderedChildrenIds[y];
1170
+ return T && (O.children = T.map(b)), O;
1171
+ };
1172
+ return n.items.itemOrderedChildrenIds[Z].map(b);
1173
+ }, [n.items.itemMap, n.items.itemOrderedChildrenIds]), p = x.useCallback((b) => {
1174
+ if (b == null)
1175
+ return !1;
1176
+ let y = e.getItemMeta(b);
1177
+ if (!y)
1178
+ return !1;
1179
+ if (y.disabled)
1180
+ return !0;
1181
+ for (; y.parentId != null; )
1182
+ if (y = e.getItemMeta(y.parentId), y.disabled)
1183
+ return !0;
1184
+ return !1;
1185
+ }, [e]), u = x.useCallback((b) => {
1186
+ const y = e.getItemMeta(b).parentId ?? Z;
1187
+ return n.items.itemChildrenIndexes[y][b];
1188
+ }, [e, n.items.itemChildrenIndexes]), l = x.useCallback((b) => n.items.itemOrderedChildrenIds[b ?? Z] ?? [], [n.items.itemOrderedChildrenIds]), a = (b) => {
1189
+ const y = e.getItemMeta(b);
1190
+ return y == null ? null : document.getElementById(e.getTreeItemIdAttribute(b, y.idAttribute));
1191
+ }, m = (b) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(b), I = x.useRef(!1), h = x.useCallback(() => {
1192
+ I.current = !0;
1193
+ }, []), f = x.useCallback(() => I.current, []);
1194
+ return x.useEffect(() => {
1195
+ e.areItemUpdatesPrevented() || o((b) => {
1196
+ const y = Et({
1197
+ items: t.items,
1198
+ isItemDisabled: t.isItemDisabled,
1199
+ getItemId: t.getItemId,
1200
+ getItemLabel: t.getItemLabel
1201
+ });
1202
+ return Object.values(b.items.itemMetaMap).forEach((C) => {
1203
+ y.itemMetaMap[C.id] || yt(e, "removeItem", {
1204
+ id: C.id
1205
+ });
1206
+ }), E({}, b, {
1207
+ items: y
1208
+ });
1209
+ });
1210
+ }, [e, o, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
1211
+ getRootProps: () => ({
1212
+ style: {
1213
+ "--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation
1214
+ }
1215
+ }),
1216
+ publicAPI: {
1217
+ getItem: c,
1218
+ getItemDOMElement: a,
1219
+ getItemTree: i,
1220
+ getItemOrderedChildrenIds: l
1221
+ },
1222
+ instance: {
1223
+ getItemMeta: d,
1224
+ getItem: c,
1225
+ getItemTree: i,
1226
+ getItemsToRender: () => {
1227
+ const b = (y) => {
1228
+ var O;
1229
+ const C = n.items.itemMetaMap[y];
1230
+ return {
1231
+ label: C.label,
1232
+ itemId: C.id,
1233
+ id: C.idAttribute,
1234
+ children: (O = n.items.itemOrderedChildrenIds[y]) == null ? void 0 : O.map(b)
1235
+ };
1236
+ };
1237
+ return n.items.itemOrderedChildrenIds[Z].map(b);
1238
+ },
1239
+ getItemIndex: u,
1240
+ getItemDOMElement: a,
1241
+ getItemOrderedChildrenIds: l,
1242
+ isItemDisabled: p,
1243
+ isItemNavigable: m,
1244
+ preventItemUpdates: h,
1245
+ areItemUpdatesPrevented: f
1246
+ },
1247
+ contextValue: {
1248
+ items: {
1249
+ onItemClick: t.onItemClick,
1250
+ disabledItemsFocusable: t.disabledItemsFocusable,
1251
+ indentationAtItemLevel: s.indentationAtItemLevel ?? !1
1252
+ }
1253
+ }
1254
+ };
1255
+ };
1256
+ he.getInitialState = (e) => ({
1257
+ items: Et({
1258
+ items: e.items,
1259
+ isItemDisabled: e.isItemDisabled,
1260
+ getItemId: e.getItemId,
1261
+ getItemLabel: e.getItemLabel
1262
+ })
1263
+ });
1264
+ he.getDefaultizedParams = (e) => E({}, e, {
1265
+ disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
1266
+ itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
1267
+ });
1268
+ he.wrapRoot = ({
1269
+ children: e,
1270
+ instance: t
1271
+ }) => /* @__PURE__ */ w(se.Provider, {
1272
+ value: (n) => {
1273
+ var o;
1274
+ return ((o = t.getItemMeta(n)) == null ? void 0 : o.depth) ?? 0;
1275
+ },
1276
+ children: e
1277
+ });
1278
+ he.params = {
1279
+ disabledItemsFocusable: !0,
1280
+ items: !0,
1281
+ isItemDisabled: !0,
1282
+ getItemLabel: !0,
1283
+ getItemId: !0,
1284
+ onItemClick: !0,
1285
+ itemChildrenIndentation: !0
1286
+ };
1287
+ const Se = ({
1288
+ instance: e,
1289
+ params: t,
1290
+ models: n
1291
+ }) => {
1292
+ const o = x.useMemo(() => {
1293
+ const a = /* @__PURE__ */ new Map();
1294
+ return n.expandedItems.value.forEach((m) => {
1295
+ a.set(m, !0);
1296
+ }), a;
1297
+ }, [n.expandedItems.value]), s = (a, m) => {
1298
+ var I;
1299
+ (I = t.onExpandedItemsChange) == null || I.call(t, a, m), n.expandedItems.setControlledValue(m);
1300
+ }, d = x.useCallback((a) => o.has(a), [o]), c = x.useCallback((a) => {
1301
+ var m;
1302
+ return !!((m = e.getItemMeta(a)) != null && m.expandable);
1303
+ }, [e]), i = G((a, m) => {
1304
+ const I = e.isItemExpanded(m);
1305
+ e.setItemExpansion(a, m, !I);
1306
+ }), p = G((a, m, I) => {
1307
+ if (e.isItemExpanded(m) === I)
1308
+ return;
1309
+ let f;
1310
+ I ? f = [m].concat(n.expandedItems.value) : f = n.expandedItems.value.filter((g) => g !== m), t.onItemExpansionToggle && t.onItemExpansionToggle(a, m, I), s(a, f);
1311
+ }), u = (a, m) => {
1312
+ const I = e.getItemMeta(m), f = e.getItemOrderedChildrenIds(I.parentId).filter((b) => e.isItemExpandable(b) && !e.isItemExpanded(b)), g = n.expandedItems.value.concat(f);
1313
+ f.length > 0 && (t.onItemExpansionToggle && f.forEach((b) => {
1314
+ t.onItemExpansionToggle(a, b, !0);
1315
+ }), s(a, g));
1316
+ }, l = x.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
1317
+ return {
1318
+ publicAPI: {
1319
+ setItemExpansion: p
1320
+ },
1321
+ instance: {
1322
+ isItemExpanded: d,
1323
+ isItemExpandable: c,
1324
+ setItemExpansion: p,
1325
+ toggleItemExpansion: i,
1326
+ expandAllSiblings: u
1327
+ },
1328
+ contextValue: {
1329
+ expansion: {
1330
+ expansionTrigger: l
1331
+ }
1332
+ }
1333
+ };
1334
+ };
1335
+ Se.models = {
1336
+ expandedItems: {
1337
+ getDefaultValue: (e) => e.defaultExpandedItems
1338
+ }
1339
+ };
1340
+ const io = [];
1341
+ Se.getDefaultizedParams = (e) => E({}, e, {
1342
+ defaultExpandedItems: e.defaultExpandedItems ?? io
1343
+ });
1344
+ Se.params = {
1345
+ expandedItems: !0,
1346
+ defaultExpandedItems: !0,
1347
+ onExpandedItemsChange: !0,
1348
+ onItemExpansionToggle: !0,
1349
+ expansionTrigger: !0
1350
+ };
1351
+ const Ct = (e, t) => {
1352
+ let n = t.length - 1;
1353
+ for (; n >= 0 && !e.isItemNavigable(t[n]); )
1354
+ n -= 1;
1355
+ if (n !== -1)
1356
+ return t[n];
1357
+ }, Tt = (e, t) => {
1358
+ const n = e.getItemMeta(t), o = e.getItemOrderedChildrenIds(n.parentId), s = e.getItemIndex(t);
1359
+ if (s === 0)
1360
+ return n.parentId;
1361
+ let d = s - 1;
1362
+ for (; !e.isItemNavigable(o[d]) && d >= 0; )
1363
+ d -= 1;
1364
+ if (d === -1)
1365
+ return n.parentId == null ? null : Tt(e, n.parentId);
1366
+ let c = o[d], i = Ct(e, e.getItemOrderedChildrenIds(c));
1367
+ for (; e.isItemExpanded(c) && i != null; )
1368
+ c = i, i = e.getItemOrderedChildrenIds(c).find(e.isItemNavigable);
1369
+ return c;
1370
+ }, Ce = (e, t) => {
1371
+ if (e.isItemExpanded(t)) {
1372
+ const o = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
1373
+ if (o != null)
1374
+ return o;
1375
+ }
1376
+ let n = e.getItemMeta(t);
1377
+ for (; n != null; ) {
1378
+ const o = e.getItemOrderedChildrenIds(n.parentId), s = e.getItemIndex(n.id);
1379
+ if (s < o.length - 1) {
1380
+ let d = s + 1;
1381
+ for (; !e.isItemNavigable(o[d]) && d < o.length - 1; )
1382
+ d += 1;
1383
+ if (e.isItemNavigable(o[d]))
1384
+ return o[d];
1385
+ }
1386
+ n = e.getItemMeta(n.parentId);
1387
+ }
1388
+ return null;
1389
+ }, wt = (e) => {
1390
+ let t = null;
1391
+ for (; t == null || e.isItemExpanded(t); ) {
1392
+ const n = e.getItemOrderedChildrenIds(t), o = Ct(e, n);
1393
+ if (o == null)
1394
+ return t;
1395
+ t = o;
1396
+ }
1397
+ return t;
1398
+ }, pe = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), vt = (e, t, n) => {
1399
+ if (t === n)
1400
+ return [t, n];
1401
+ const o = e.getItemMeta(t), s = e.getItemMeta(n);
1402
+ if (o.parentId === s.id || s.parentId === o.id)
1403
+ return s.parentId === o.id ? [o.id, s.id] : [s.id, o.id];
1404
+ const d = [o.id], c = [s.id];
1405
+ let i = o.parentId, p = s.parentId, u = c.indexOf(i) !== -1, l = d.indexOf(p) !== -1, a = !0, m = !0;
1406
+ for (; !l && !u; )
1407
+ a && (d.push(i), u = c.indexOf(i) !== -1, a = i !== null, !u && a && (i = e.getItemMeta(i).parentId)), m && !u && (c.push(p), l = d.indexOf(p) !== -1, m = p !== null, !l && m && (p = e.getItemMeta(p).parentId));
1408
+ const I = u ? i : p, h = e.getItemOrderedChildrenIds(I), f = d[d.indexOf(I) - 1], g = c[c.indexOf(I) - 1];
1409
+ return h.indexOf(f) < h.indexOf(g) ? [t, n] : [n, t];
1410
+ }, so = (e, t, n) => {
1411
+ const o = (p) => {
1412
+ if (e.isItemExpandable(p) && e.isItemExpanded(p))
1413
+ return e.getItemOrderedChildrenIds(p)[0];
1414
+ let u = e.getItemMeta(p);
1415
+ for (; u != null; ) {
1416
+ const l = e.getItemOrderedChildrenIds(u.parentId), a = e.getItemIndex(u.id);
1417
+ if (a < l.length - 1)
1418
+ return l[a + 1];
1419
+ u = e.getItemMeta(u.parentId);
1420
+ }
1421
+ throw new Error("Invalid range");
1422
+ }, [s, d] = vt(e, t, n), c = [s];
1423
+ let i = s;
1424
+ for (; i !== d; )
1425
+ i = o(i), e.isItemDisabled(i) || c.push(i);
1426
+ return c;
1427
+ }, lo = (e) => {
1428
+ let t = pe(e);
1429
+ const n = [];
1430
+ for (; t != null; )
1431
+ n.push(t), t = Ce(e, t);
1432
+ return n;
1433
+ }, Ne = (e, t) => t !== e.closest('*[role="treeitem"]'), Te = (e) => Array.isArray(e) ? e : e != null ? [e] : [], Fe = (e) => {
1434
+ const t = {};
1435
+ return e.forEach((n) => {
1436
+ t[n] = !0;
1437
+ }), t;
1438
+ }, Re = ({
1439
+ instance: e,
1440
+ params: t,
1441
+ models: n
1442
+ }) => {
1443
+ const o = x.useRef(null), s = x.useRef({}), d = x.useMemo(() => {
1444
+ const f = /* @__PURE__ */ new Map();
1445
+ return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((g) => {
1446
+ f.set(g, !0);
1447
+ }) : n.selectedItems.value != null && f.set(n.selectedItems.value, !0), f;
1448
+ }, [n.selectedItems.value]), c = (f, g) => {
1449
+ if (t.onItemSelectionToggle)
1450
+ if (t.multiSelect) {
1451
+ const b = g.filter((C) => !e.isItemSelected(C)), y = n.selectedItems.value.filter((C) => !g.includes(C));
1452
+ b.forEach((C) => {
1453
+ t.onItemSelectionToggle(f, C, !0);
1454
+ }), y.forEach((C) => {
1455
+ t.onItemSelectionToggle(f, C, !1);
1456
+ });
1457
+ } else g !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(f, n.selectedItems.value, !1), g != null && t.onItemSelectionToggle(f, g, !0));
1458
+ t.onSelectedItemsChange && t.onSelectedItemsChange(f, g), n.selectedItems.setControlledValue(g);
1459
+ }, i = (f) => d.has(f), p = ({
1460
+ event: f,
1461
+ itemId: g,
1462
+ keepExistingSelection: b = !1,
1463
+ shouldBeSelected: y
1464
+ }) => {
1465
+ if (t.disableSelection)
1466
+ return;
1467
+ let C;
1468
+ if (b) {
1469
+ const O = Te(n.selectedItems.value), T = e.isItemSelected(g);
1470
+ T && (y === !1 || y == null) ? C = O.filter((v) => v !== g) : !T && (y === !0 || y == null) ? C = [g].concat(O) : C = O;
1471
+ } else
1472
+ y === !1 || y == null && e.isItemSelected(g) ? C = t.multiSelect ? [] : null : C = t.multiSelect ? [g] : g;
1473
+ c(f, C), o.current = g, s.current = {};
1474
+ }, u = (f, [g, b]) => {
1475
+ if (t.disableSelection || !t.multiSelect)
1476
+ return;
1477
+ let y = Te(n.selectedItems.value).slice();
1478
+ Object.keys(s.current).length > 0 && (y = y.filter((v) => !s.current[v]));
1479
+ const C = Fe(y), O = so(e, g, b), T = O.filter((v) => !C[v]);
1480
+ y = y.concat(T), c(f, y), s.current = Fe(O);
1481
+ };
1482
+ return {
1483
+ getRootProps: () => ({
1484
+ "aria-multiselectable": t.multiSelect
1485
+ }),
1486
+ publicAPI: {
1487
+ selectItem: p
1488
+ },
1489
+ instance: {
1490
+ isItemSelected: i,
1491
+ selectItem: p,
1492
+ selectAllNavigableItems: (f) => {
1493
+ if (t.disableSelection || !t.multiSelect)
1494
+ return;
1495
+ const g = lo(e);
1496
+ c(f, g), s.current = Fe(g);
1497
+ },
1498
+ expandSelectionRange: (f, g) => {
1499
+ if (o.current != null) {
1500
+ const [b, y] = vt(e, g, o.current);
1501
+ u(f, [b, y]);
1502
+ }
1503
+ },
1504
+ selectRangeFromStartToItem: (f, g) => {
1505
+ u(f, [pe(e), g]);
1506
+ },
1507
+ selectRangeFromItemToEnd: (f, g) => {
1508
+ u(f, [g, wt(e)]);
1509
+ },
1510
+ selectItemFromArrowNavigation: (f, g, b) => {
1511
+ if (t.disableSelection || !t.multiSelect)
1512
+ return;
1513
+ let y = Te(n.selectedItems.value).slice();
1514
+ Object.keys(s.current).length === 0 ? (y.push(b), s.current = {
1515
+ [g]: !0,
1516
+ [b]: !0
1517
+ }) : (s.current[g] || (s.current = {}), s.current[b] ? (y = y.filter((C) => C !== g), delete s.current[g]) : (y.push(b), s.current[b] = !0)), c(f, y);
1518
+ }
1519
+ },
1520
+ contextValue: {
1521
+ selection: {
1522
+ multiSelect: t.multiSelect,
1523
+ checkboxSelection: t.checkboxSelection,
1524
+ disableSelection: t.disableSelection
1525
+ }
1526
+ }
1527
+ };
1528
+ };
1529
+ Re.models = {
1530
+ selectedItems: {
1531
+ getDefaultValue: (e) => e.defaultSelectedItems
1532
+ }
1533
+ };
1534
+ const ao = [];
1535
+ Re.getDefaultizedParams = (e) => E({}, e, {
1536
+ disableSelection: e.disableSelection ?? !1,
1537
+ multiSelect: e.multiSelect ?? !1,
1538
+ checkboxSelection: e.checkboxSelection ?? !1,
1539
+ defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? ao : null)
1540
+ });
1541
+ Re.params = {
1542
+ disableSelection: !0,
1543
+ multiSelect: !0,
1544
+ checkboxSelection: !0,
1545
+ defaultSelectedItems: !0,
1546
+ selectedItems: !0,
1547
+ onSelectedItemsChange: !0,
1548
+ onItemSelectionToggle: !0
1549
+ };
1550
+ const it = 1e3;
1551
+ class co {
1552
+ constructor(t = it) {
1553
+ this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = it, this.cleanupTimeout = t;
1554
+ }
1555
+ register(t, n, o) {
1556
+ this.timeouts || (this.timeouts = /* @__PURE__ */ new Map());
1557
+ const s = setTimeout(() => {
1558
+ typeof n == "function" && n(), this.timeouts.delete(o.cleanupToken);
1559
+ }, this.cleanupTimeout);
1560
+ this.timeouts.set(o.cleanupToken, s);
1561
+ }
1562
+ unregister(t) {
1563
+ const n = this.timeouts.get(t.cleanupToken);
1564
+ n && (this.timeouts.delete(t.cleanupToken), clearTimeout(n));
1565
+ }
1566
+ reset() {
1567
+ this.timeouts && (this.timeouts.forEach((t, n) => {
1568
+ this.unregister({
1569
+ cleanupToken: n
1570
+ });
1571
+ }), this.timeouts = void 0);
1572
+ }
1573
+ }
1574
+ class uo {
1575
+ constructor() {
1576
+ this.registry = new FinalizationRegistry((t) => {
1577
+ typeof t == "function" && t();
1578
+ });
1579
+ }
1580
+ register(t, n, o) {
1581
+ this.registry.register(t, n, o);
1582
+ }
1583
+ unregister(t) {
1584
+ this.registry.unregister(t);
1585
+ }
1586
+ // eslint-disable-next-line class-methods-use-this
1587
+ reset() {
1588
+ }
1589
+ }
1590
+ class po {
1591
+ }
1592
+ function fo(e) {
1593
+ let t = 0;
1594
+ return function(o, s, d) {
1595
+ e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new uo() : new co());
1596
+ const [c] = x.useState(new po()), i = x.useRef(null), p = x.useRef();
1597
+ p.current = d;
1598
+ const u = x.useRef(null);
1599
+ if (!i.current && p.current) {
1600
+ const l = (a, m) => {
1601
+ var I;
1602
+ m.defaultMuiPrevented || (I = p.current) == null || I.call(p, a, m);
1603
+ };
1604
+ i.current = o.$$subscribeEvent(s, l), t += 1, u.current = {
1605
+ cleanupToken: t
1606
+ }, e.registry.register(
1607
+ c,
1608
+ // The callback below will be called once this reference stops being retained
1609
+ () => {
1610
+ var a;
1611
+ (a = i.current) == null || a.call(i), i.current = null, u.current = null;
1612
+ },
1613
+ u.current
1614
+ );
1615
+ } else !p.current && i.current && (i.current(), i.current = null, u.current && (e.registry.unregister(u.current), u.current = null));
1616
+ x.useEffect(() => {
1617
+ if (!i.current && p.current) {
1618
+ const l = (a, m) => {
1619
+ var I;
1620
+ m.defaultMuiPrevented || (I = p.current) == null || I.call(p, a, m);
1621
+ };
1622
+ i.current = o.$$subscribeEvent(s, l);
1623
+ }
1624
+ return u.current && e.registry && (e.registry.unregister(u.current), u.current = null), () => {
1625
+ var l;
1626
+ (l = i.current) == null || l.call(i), i.current = null;
1627
+ };
1628
+ }, [o, s]);
1629
+ };
1630
+ }
1631
+ const mo = {
1632
+ registry: null
1633
+ }, Io = fo(mo), Mt = (e = document) => {
1634
+ const t = e.activeElement;
1635
+ return t ? t.shadowRoot ? Mt(t.shadowRoot) : t : null;
1636
+ };
1637
+ function go(e) {
1638
+ return e.replace(/["\\]/g, "\\$&");
1639
+ }
1640
+ const ho = (e, t) => {
1641
+ let n = Te(t).find((o) => {
1642
+ if (!e.isItemNavigable(o))
1643
+ return !1;
1644
+ const s = e.getItemMeta(o);
1645
+ return s && (s.parentId == null || e.isItemExpanded(s.parentId));
1646
+ });
1647
+ return n == null && (n = pe(e)), n;
1648
+ }, Ue = ({
1649
+ instance: e,
1650
+ params: t,
1651
+ state: n,
1652
+ setState: o,
1653
+ models: s,
1654
+ rootRef: d
1655
+ }) => {
1656
+ const c = ho(e, s.selectedItems.value), i = G((g) => {
1657
+ const b = typeof g == "function" ? g(n.focusedItemId) : g;
1658
+ n.focusedItemId !== b && o((y) => E({}, y, {
1659
+ focusedItemId: b
1660
+ }));
1661
+ }), p = x.useCallback(() => !!d.current && d.current.contains(Mt(pn(d.current))), [d]), u = x.useCallback((g) => n.focusedItemId === g && p(), [n.focusedItemId, p]), l = (g) => {
1662
+ const b = e.getItemMeta(g);
1663
+ return b && (b.parentId == null || e.isItemExpanded(b.parentId));
1664
+ }, a = (g, b) => {
1665
+ const y = e.getItemDOMElement(b);
1666
+ y && y.focus(), i(b), t.onItemFocus && t.onItemFocus(g, b);
1667
+ }, m = G((g, b) => {
1668
+ l(b) && a(g, b);
1669
+ }), I = G(() => {
1670
+ if (n.focusedItemId == null)
1671
+ return;
1672
+ const g = e.getItemMeta(n.focusedItemId);
1673
+ if (g) {
1674
+ const b = document.getElementById(e.getTreeItemIdAttribute(n.focusedItemId, g.idAttribute));
1675
+ b && b.blur();
1676
+ }
1677
+ i(null);
1678
+ }), h = (g) => g === c;
1679
+ Io(e, "removeItem", ({
1680
+ id: g
1681
+ }) => {
1682
+ n.focusedItemId === g && a(null, c);
1683
+ });
1684
+ const f = (g) => (b) => {
1685
+ var y;
1686
+ (y = g.onFocus) == null || y.call(g, b), !b.defaultMuiPrevented && b.target === b.currentTarget && a(b, c);
1687
+ };
1688
+ return {
1689
+ getRootProps: (g) => ({
1690
+ onFocus: f(g)
1691
+ }),
1692
+ publicAPI: {
1693
+ focusItem: m
1694
+ },
1695
+ instance: {
1696
+ isItemFocused: u,
1697
+ canItemBeTabbed: h,
1698
+ focusItem: m,
1699
+ removeFocusedItem: I
1700
+ }
1701
+ };
1702
+ };
1703
+ Ue.getInitialState = () => ({
1704
+ focusedItemId: null
1705
+ });
1706
+ Ue.params = {
1707
+ onItemFocus: !0
1708
+ };
1709
+ const we = (e, t) => e.getAvailablePlugins().has(t), bo = ({
1710
+ props: e
1711
+ }) => {
1712
+ const {
1713
+ instance: t
1714
+ } = le(), {
1715
+ label: n,
1716
+ itemId: o
1717
+ } = e, [s, d] = x.useState(n), c = t.isItemBeingEdited(o);
1718
+ return x.useEffect(() => {
1719
+ c || d(n);
1720
+ }, [c, n]), {
1721
+ propsEnhancers: {
1722
+ labelInput: ({
1723
+ externalEventHandlers: i,
1724
+ interactions: p
1725
+ }) => t.isItemEditable(o) ? {
1726
+ value: s ?? "",
1727
+ "data-element": "labelInput",
1728
+ onChange: (I) => {
1729
+ var h;
1730
+ (h = i.onChange) == null || h.call(i, I), d(I.target.value);
1731
+ },
1732
+ onKeyDown: (I) => {
1733
+ var f;
1734
+ if ((f = i.onKeyDown) == null || f.call(i, I), I.defaultMuiPrevented)
1735
+ return;
1736
+ const h = I.target;
1737
+ I.key === "Enter" && h.value ? p.handleSaveItemLabel(I, h.value) : I.key === "Escape" && p.handleCancelItemLabelEditing(I);
1738
+ },
1739
+ onBlur: (I) => {
1740
+ var h;
1741
+ (h = i.onBlur) == null || h.call(i, I), !I.defaultMuiPrevented && I.target.value && p.handleSaveItemLabel(I, I.target.value);
1742
+ },
1743
+ autoFocus: !0,
1744
+ type: "text"
1745
+ } : {}
1746
+ }
1747
+ };
1748
+ }, ee = ({
1749
+ instance: e,
1750
+ state: t,
1751
+ setState: n,
1752
+ params: o,
1753
+ experimentalFeatures: s
1754
+ }) => {
1755
+ process.env.NODE_ENV !== "production" && o.isItemEditable && !(s != null && s.labelEditing) && It(["MUI X: The label editing feature requires the `labelEditing` experimental feature to be enabled.", "You can do it by passing `experimentalFeatures={{ labelEditing: true}}` to the `RichTreeViewPro` component.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/editing/"]);
1756
+ const d = x.useRef(t.editedItemId), c = (m) => d.current === m, i = (m) => {
1757
+ n((I) => E({}, I, {
1758
+ editedItemId: m
1759
+ })), d.current = m;
1760
+ }, p = (m) => m === t.editedItemId, u = !!o.isItemEditable && !!s.labelEditing, l = (m) => {
1761
+ if (m == null || !u)
1762
+ return !1;
1763
+ const I = e.getItem(m);
1764
+ return I ? typeof o.isItemEditable == "function" ? o.isItemEditable(I) : !!o.isItemEditable : !1;
1765
+ }, a = (m, I) => {
1766
+ if (!I)
1767
+ throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "The label of an item cannot be empty.", m].join(`
1768
+ `));
1769
+ n((h) => {
1770
+ const f = h.items.itemMetaMap[m];
1771
+ return f.label !== I ? E({}, h, {
1772
+ items: E({}, h.items, {
1773
+ itemMetaMap: E({}, h.items.itemMetaMap, {
1774
+ [m]: E({}, f, {
1775
+ label: I
1776
+ })
1777
+ })
1778
+ })
1779
+ }) : h;
1780
+ }), o.onItemLabelChange && o.onItemLabelChange(m, I);
1781
+ };
1782
+ return {
1783
+ instance: {
1784
+ setEditedItemId: i,
1785
+ isItemBeingEdited: p,
1786
+ updateItemLabel: a,
1787
+ isItemEditable: l,
1788
+ isTreeViewEditable: u,
1789
+ isItemBeingEditedRef: c
1790
+ },
1791
+ publicAPI: {
1792
+ updateItemLabel: a
1793
+ }
1794
+ };
1795
+ };
1796
+ ee.itemPlugin = bo;
1797
+ ee.getInitialState = () => ({
1798
+ editedItemId: null
1799
+ });
1800
+ ee.params = {
1801
+ onItemLabelChange: !0,
1802
+ isItemEditable: !0
1803
+ };
1804
+ function yo(e) {
1805
+ return !!e && e.length === 1 && !!e.match(/\S/);
1806
+ }
1807
+ const St = ({
1808
+ instance: e,
1809
+ params: t,
1810
+ state: n
1811
+ }) => {
1812
+ const o = fn(), s = x.useRef({}), d = G((l) => {
1813
+ s.current = l(s.current);
1814
+ });
1815
+ x.useEffect(() => {
1816
+ if (e.areItemUpdatesPrevented())
1817
+ return;
1818
+ const l = {}, a = (m) => {
1819
+ l[m.id] = m.label.substring(0, 1).toLowerCase();
1820
+ };
1821
+ Object.values(n.items.itemMetaMap).forEach(a), s.current = l;
1822
+ }, [n.items.itemMetaMap, t.getItemId, e]);
1823
+ const c = (l, a) => {
1824
+ const m = a.toLowerCase(), I = (b) => {
1825
+ const y = Ce(e, b);
1826
+ return y === null ? pe(e) : y;
1827
+ };
1828
+ let h = null, f = I(l);
1829
+ const g = {};
1830
+ for (; h == null && !g[f]; )
1831
+ s.current[f] === m ? h = f : (g[f] = !0, f = I(f));
1832
+ return h;
1833
+ }, i = (l) => !t.disableSelection && !e.isItemDisabled(l), p = (l) => !e.isItemDisabled(l) && e.isItemExpandable(l);
1834
+ return {
1835
+ instance: {
1836
+ updateFirstCharMap: d,
1837
+ handleItemKeyDown: (l, a) => {
1838
+ if (l.defaultMuiPrevented || l.altKey || Ne(l.target, l.currentTarget))
1839
+ return;
1840
+ const m = l.ctrlKey || l.metaKey, I = l.key;
1841
+ switch (!0) {
1842
+ case (I === " " && i(a)): {
1843
+ l.preventDefault(), t.multiSelect && l.shiftKey ? e.expandSelectionRange(l, a) : e.selectItem({
1844
+ event: l,
1845
+ itemId: a,
1846
+ keepExistingSelection: t.multiSelect,
1847
+ shouldBeSelected: t.multiSelect ? void 0 : !0
1848
+ });
1849
+ break;
1850
+ }
1851
+ case I === "Enter": {
1852
+ we(e, ee) && e.isItemEditable(a) && !e.isItemBeingEdited(a) ? e.setEditedItemId(a) : p(a) ? (e.toggleItemExpansion(l, a), l.preventDefault()) : i(a) && (t.multiSelect ? (l.preventDefault(), e.selectItem({
1853
+ event: l,
1854
+ itemId: a,
1855
+ keepExistingSelection: !0
1856
+ })) : e.isItemSelected(a) || (e.selectItem({
1857
+ event: l,
1858
+ itemId: a
1859
+ }), l.preventDefault()));
1860
+ break;
1861
+ }
1862
+ case I === "ArrowDown": {
1863
+ const h = Ce(e, a);
1864
+ h && (l.preventDefault(), e.focusItem(l, h), t.multiSelect && l.shiftKey && i(h) && e.selectItemFromArrowNavigation(l, a, h));
1865
+ break;
1866
+ }
1867
+ case I === "ArrowUp": {
1868
+ const h = Tt(e, a);
1869
+ h && (l.preventDefault(), e.focusItem(l, h), t.multiSelect && l.shiftKey && i(h) && e.selectItemFromArrowNavigation(l, a, h));
1870
+ break;
1871
+ }
1872
+ case (I === "ArrowRight" && !o || I === "ArrowLeft" && o): {
1873
+ if (e.isItemExpanded(a)) {
1874
+ const h = Ce(e, a);
1875
+ h && (e.focusItem(l, h), l.preventDefault());
1876
+ } else p(a) && (e.toggleItemExpansion(l, a), l.preventDefault());
1877
+ break;
1878
+ }
1879
+ case (I === "ArrowLeft" && !o || I === "ArrowRight" && o): {
1880
+ if (p(a) && e.isItemExpanded(a))
1881
+ e.toggleItemExpansion(l, a), l.preventDefault();
1882
+ else {
1883
+ const h = e.getItemMeta(a).parentId;
1884
+ h && (e.focusItem(l, h), l.preventDefault());
1885
+ }
1886
+ break;
1887
+ }
1888
+ case I === "Home": {
1889
+ i(a) && t.multiSelect && m && l.shiftKey ? e.selectRangeFromStartToItem(l, a) : e.focusItem(l, pe(e)), l.preventDefault();
1890
+ break;
1891
+ }
1892
+ case I === "End": {
1893
+ i(a) && t.multiSelect && m && l.shiftKey ? e.selectRangeFromItemToEnd(l, a) : e.focusItem(l, wt(e)), l.preventDefault();
1894
+ break;
1895
+ }
1896
+ case I === "*": {
1897
+ e.expandAllSiblings(l, a), l.preventDefault();
1898
+ break;
1899
+ }
1900
+ case (I === "a" && m && t.multiSelect && !t.disableSelection): {
1901
+ e.selectAllNavigableItems(l), l.preventDefault();
1902
+ break;
1903
+ }
1904
+ case (!m && !l.shiftKey && yo(I)): {
1905
+ const h = c(a, I);
1906
+ h != null && (e.focusItem(l, h), l.preventDefault());
1907
+ break;
1908
+ }
1909
+ }
1910
+ }
1911
+ }
1912
+ };
1913
+ };
1914
+ St.params = {};
1915
+ const Rt = ({
1916
+ slots: e,
1917
+ slotProps: t
1918
+ }) => ({
1919
+ contextValue: {
1920
+ icons: {
1921
+ slots: {
1922
+ collapseIcon: e.collapseIcon,
1923
+ expandIcon: e.expandIcon,
1924
+ endIcon: e.endIcon
1925
+ },
1926
+ slotProps: {
1927
+ collapseIcon: t.collapseIcon,
1928
+ expandIcon: t.expandIcon,
1929
+ endIcon: t.endIcon
1930
+ }
1931
+ }
1932
+ }
1933
+ });
1934
+ Rt.params = {};
1935
+ const Ke = /* @__PURE__ */ x.createContext(null);
1936
+ process.env.NODE_ENV !== "production" && (Ke.displayName = "TreeViewChildrenItemContext");
1937
+ function qe(e) {
1938
+ const {
1939
+ children: t,
1940
+ itemId: n = null
1941
+ } = e, {
1942
+ instance: o,
1943
+ rootRef: s
1944
+ } = le(), d = x.useRef(/* @__PURE__ */ new Map());
1945
+ x.useEffect(() => {
1946
+ if (!s.current)
1947
+ return;
1948
+ let i = null;
1949
+ if (n == null)
1950
+ i = s.current.id;
1951
+ else {
1952
+ const I = o.getItemMeta(n);
1953
+ I !== void 0 && (i = o.getTreeItemIdAttribute(n, I.idAttribute));
1954
+ }
1955
+ if (i == null)
1956
+ return;
1957
+ const p = o.getItemOrderedChildrenIds(n ?? null) ?? [], u = go(i), l = s.current.querySelectorAll(`${n == null ? "" : `*[id="${u}"] `}[role="treeitem"]:not(*[id="${u}"] [role="treeitem"] [role="treeitem"])`), a = Array.from(l).map((I) => d.current.get(I.id));
1958
+ (a.length !== p.length || a.some((I, h) => I !== p[h])) && o.setJSXItemsOrderedChildrenIds(n ?? null, a);
1959
+ });
1960
+ const c = x.useMemo(() => ({
1961
+ registerChild: (i, p) => d.current.set(i, p),
1962
+ unregisterChild: (i) => d.current.delete(i),
1963
+ parentId: n
1964
+ }), [n]);
1965
+ return /* @__PURE__ */ w(Ke.Provider, {
1966
+ value: c,
1967
+ children: t
1968
+ });
1969
+ }
1970
+ process.env.NODE_ENV !== "production" && (qe.propTypes = {
1971
+ children: r.node,
1972
+ id: r.string
1973
+ });
1974
+ const be = ({
1975
+ instance: e,
1976
+ setState: t
1977
+ }) => {
1978
+ e.preventItemUpdates();
1979
+ const n = G((d) => (t((c) => {
1980
+ if (c.items.itemMetaMap[d.id] != null)
1981
+ throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${d.id}"`].join(`
1982
+ `));
1983
+ return E({}, c, {
1984
+ items: E({}, c.items, {
1985
+ itemMetaMap: E({}, c.items.itemMetaMap, {
1986
+ [d.id]: d
1987
+ }),
1988
+ // For `SimpleTreeView`, we don't have a proper `item` object, so we create a very basic one.
1989
+ itemMap: E({}, c.items.itemMap, {
1990
+ [d.id]: {
1991
+ id: d.id,
1992
+ label: d.label
1993
+ }
1994
+ })
1995
+ })
1996
+ });
1997
+ }), () => {
1998
+ t((c) => {
1999
+ const i = E({}, c.items.itemMetaMap), p = E({}, c.items.itemMap);
2000
+ return delete i[d.id], delete p[d.id], E({}, c, {
2001
+ items: E({}, c.items, {
2002
+ itemMetaMap: i,
2003
+ itemMap: p
2004
+ })
2005
+ });
2006
+ }), yt(e, "removeItem", {
2007
+ id: d.id
2008
+ });
2009
+ })), o = (d, c) => {
2010
+ const i = d ?? Z;
2011
+ t((p) => E({}, p, {
2012
+ items: E({}, p.items, {
2013
+ itemOrderedChildrenIds: E({}, p.items.itemOrderedChildrenIds, {
2014
+ [i]: c
2015
+ }),
2016
+ itemChildrenIndexes: E({}, p.items.itemChildrenIndexes, {
2017
+ [i]: xt(c)
2018
+ })
2019
+ })
2020
+ }));
2021
+ }, s = G((d, c) => (e.updateFirstCharMap((i) => (i[d] = c, i)), () => {
2022
+ e.updateFirstCharMap((i) => {
2023
+ const p = E({}, i);
2024
+ return delete p[d], p;
2025
+ });
2026
+ }));
2027
+ return {
2028
+ instance: {
2029
+ insertJSXItem: n,
2030
+ setJSXItemsOrderedChildrenIds: o,
2031
+ mapFirstCharFromJSX: s
2032
+ }
2033
+ };
2034
+ }, Ot = (e) => Array.isArray(e) ? e.length > 0 && e.some(Ot) : !!e, xo = ({
2035
+ props: e,
2036
+ rootRef: t,
2037
+ contentRef: n
2038
+ }) => {
2039
+ const {
2040
+ instance: o
2041
+ } = le(), {
2042
+ children: s,
2043
+ disabled: d = !1,
2044
+ label: c,
2045
+ itemId: i,
2046
+ id: p
2047
+ } = e, u = x.useContext(Ke);
2048
+ if (u == null)
2049
+ throw new Error(["MUI X: Could not find the Tree View Children Item context.", "It looks like you rendered your component outside of a SimpleTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join(`
2050
+ `));
2051
+ const {
2052
+ registerChild: l,
2053
+ unregisterChild: a,
2054
+ parentId: m
2055
+ } = u, I = Ot(s), h = x.useRef(null), f = de(h, n);
2056
+ return mn(() => {
2057
+ const g = o.getTreeItemIdAttribute(i, p);
2058
+ return l(g, i), () => {
2059
+ a(g);
2060
+ };
2061
+ }, [o, l, a, i, p]), x.useEffect(() => o.insertJSXItem({
2062
+ id: i,
2063
+ idAttribute: p,
2064
+ parentId: m,
2065
+ expandable: I,
2066
+ disabled: d
2067
+ }), [o, m, i, I, d, p]), x.useEffect(() => {
2068
+ var g;
2069
+ if (c)
2070
+ return o.mapFirstCharFromJSX(i, (((g = h.current) == null ? void 0 : g.textContent) ?? "").substring(0, 1).toLowerCase());
2071
+ }, [o, i, c]), {
2072
+ contentRef: f,
2073
+ rootRef: t
2074
+ };
2075
+ };
2076
+ be.itemPlugin = xo;
2077
+ be.wrapItem = ({
2078
+ children: e,
2079
+ itemId: t
2080
+ }) => {
2081
+ const n = x.useContext(se);
2082
+ return /* @__PURE__ */ w(qe, {
2083
+ itemId: t,
2084
+ children: /* @__PURE__ */ w(se.Provider, {
2085
+ value: n + 1,
2086
+ children: e
2087
+ })
2088
+ });
2089
+ };
2090
+ be.wrapRoot = ({
2091
+ children: e
2092
+ }) => /* @__PURE__ */ w(qe, {
2093
+ children: /* @__PURE__ */ w(se.Provider, {
2094
+ value: 0,
2095
+ children: e
2096
+ })
2097
+ });
2098
+ be.params = {};
2099
+ const Eo = [he, Se, Re, Ue, St, Rt, be], Co = mt(), To = (e) => {
2100
+ const {
2101
+ classes: t
2102
+ } = e;
2103
+ return ge({
2104
+ root: ["root"]
2105
+ }, Wn, t);
2106
+ }, wo = U("ul", {
2107
+ name: "MuiSimpleTreeView",
2108
+ slot: "Root",
2109
+ overridesResolver: (e, t) => t.root
2110
+ })({
2111
+ padding: 0,
2112
+ margin: 0,
2113
+ listStyle: "none",
2114
+ outline: 0,
2115
+ position: "relative"
2116
+ }), vo = [], kt = /* @__PURE__ */ x.forwardRef(function(t, n) {
2117
+ const o = Co({
2118
+ props: t,
2119
+ name: "MuiSimpleTreeView"
2120
+ }), s = o;
2121
+ process.env.NODE_ENV !== "production" && o.items != null && It(["MUI X: The `SimpleTreeView` component does not support the `items` prop.", "If you want to add items, you need to pass them as JSX children.", "Check the documentation for more details: https://mui.com/x/react-tree-view/simple-tree-view/items/."]);
2122
+ const {
2123
+ getRootProps: d,
2124
+ contextValue: c
2125
+ } = no({
2126
+ plugins: Eo,
2127
+ rootRef: n,
2128
+ props: E({}, o, {
2129
+ items: vo
2130
+ })
2131
+ }), {
2132
+ slots: i,
2133
+ slotProps: p
2134
+ } = o, u = To(o), l = (i == null ? void 0 : i.root) ?? wo, a = ce({
2135
+ elementType: l,
2136
+ externalSlotProps: p == null ? void 0 : p.root,
2137
+ className: u.root,
2138
+ getSlotProps: d,
2139
+ ownerState: s
2140
+ });
2141
+ return /* @__PURE__ */ w(oo, {
2142
+ value: c,
2143
+ children: /* @__PURE__ */ w(l, E({}, a))
2144
+ });
2145
+ });
2146
+ process.env.NODE_ENV !== "production" && (kt.propTypes = {
2147
+ // ----------------------------- Warning --------------------------------
2148
+ // | These PropTypes are generated from the TypeScript type definitions |
2149
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
2150
+ // ----------------------------------------------------------------------
2151
+ /**
2152
+ * The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
2153
+ */
2154
+ apiRef: r.shape({
2155
+ current: r.shape({
2156
+ focusItem: r.func.isRequired,
2157
+ getItem: r.func.isRequired,
2158
+ getItemDOMElement: r.func.isRequired,
2159
+ getItemOrderedChildrenIds: r.func.isRequired,
2160
+ getItemTree: r.func.isRequired,
2161
+ selectItem: r.func.isRequired,
2162
+ setItemExpansion: r.func.isRequired
2163
+ })
2164
+ }),
2165
+ /**
2166
+ * If `true`, the tree view renders a checkbox at the left of its label that allows selecting it.
2167
+ * @default false
2168
+ */
2169
+ checkboxSelection: r.bool,
2170
+ /**
2171
+ * The content of the component.
2172
+ */
2173
+ children: r.node,
2174
+ /**
2175
+ * Override or extend the styles applied to the component.
2176
+ */
2177
+ classes: r.object,
2178
+ className: r.string,
2179
+ /**
2180
+ * Expanded item ids.
2181
+ * Used when the item's expansion is not controlled.
2182
+ * @default []
2183
+ */
2184
+ defaultExpandedItems: r.arrayOf(r.string),
2185
+ /**
2186
+ * Selected item ids. (Uncontrolled)
2187
+ * When `multiSelect` is true this takes an array of strings; when false (default) a string.
2188
+ * @default []
2189
+ */
2190
+ defaultSelectedItems: r.any,
2191
+ /**
2192
+ * If `true`, will allow focus on disabled items.
2193
+ * @default false
2194
+ */
2195
+ disabledItemsFocusable: r.bool,
2196
+ /**
2197
+ * If `true` selection is disabled.
2198
+ * @default false
2199
+ */
2200
+ disableSelection: r.bool,
2201
+ /**
2202
+ * Expanded item ids.
2203
+ * Used when the item's expansion is controlled.
2204
+ */
2205
+ expandedItems: r.arrayOf(r.string),
2206
+ /**
2207
+ * The slot that triggers the item's expansion when clicked.
2208
+ * @default 'content'
2209
+ */
2210
+ expansionTrigger: r.oneOf(["content", "iconContainer"]),
2211
+ /**
2212
+ * Unstable features, breaking changes might be introduced.
2213
+ * For each feature, if the flag is not explicitly set to `true`,
2214
+ * the feature will be fully disabled and any property / method call will not have any effect.
2215
+ */
2216
+ experimentalFeatures: r.shape({
2217
+ indentationAtItemLevel: r.bool
2218
+ }),
2219
+ /**
2220
+ * This prop is used to help implement the accessibility logic.
2221
+ * If you don't provide this prop. It falls back to a randomly generated id.
2222
+ */
2223
+ id: r.string,
2224
+ /**
2225
+ * Horizontal indentation between an item and its children.
2226
+ * Examples: 24, "24px", "2rem", "2em".
2227
+ * @default 12px
2228
+ */
2229
+ itemChildrenIndentation: r.oneOfType([r.number, r.string]),
2230
+ /**
2231
+ * If `true`, `ctrl` and `shift` will trigger multiselect.
2232
+ * @default false
2233
+ */
2234
+ multiSelect: r.bool,
2235
+ /**
2236
+ * Callback fired when tree items are expanded/collapsed.
2237
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change.
2238
+ * @param {array} itemIds The ids of the expanded items.
2239
+ */
2240
+ onExpandedItemsChange: r.func,
2241
+ /**
2242
+ * Callback fired when the `content` slot of a given tree item is clicked.
2243
+ * @param {React.MouseEvent} event The DOM event that triggered the change.
2244
+ * @param {string} itemId The id of the focused item.
2245
+ */
2246
+ onItemClick: r.func,
2247
+ /**
2248
+ * Callback fired when a tree item is expanded or collapsed.
2249
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change.
2250
+ * @param {array} itemId The itemId of the modified item.
2251
+ * @param {array} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
2252
+ */
2253
+ onItemExpansionToggle: r.func,
2254
+ /**
2255
+ * Callback fired when a given tree item is focused.
2256
+ * @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
2257
+ * @param {string} itemId The id of the focused item.
2258
+ */
2259
+ onItemFocus: r.func,
2260
+ /**
2261
+ * Callback fired when a tree item is selected or deselected.
2262
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change.
2263
+ * @param {array} itemId The itemId of the modified item.
2264
+ * @param {array} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
2265
+ */
2266
+ onItemSelectionToggle: r.func,
2267
+ /**
2268
+ * Callback fired when tree items are selected/deselected.
2269
+ * @param {React.SyntheticEvent} event The DOM event that triggered the change.
2270
+ * @param {string[] | string} itemIds The ids of the selected items.
2271
+ * When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
2272
+ */
2273
+ onSelectedItemsChange: r.func,
2274
+ /**
2275
+ * Selected item ids. (Controlled)
2276
+ * When `multiSelect` is true this takes an array of strings; when false (default) a string.
2277
+ */
2278
+ selectedItems: r.any,
2279
+ /**
2280
+ * The props used for each component slot.
2281
+ */
2282
+ slotProps: r.object,
2283
+ /**
2284
+ * Overridable component slots.
2285
+ */
2286
+ slots: r.object,
2287
+ /**
2288
+ * The system prop that allows defining system overrides as well as additional CSS styles.
2289
+ */
2290
+ sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object])
2291
+ });
2292
+ function Pt(e) {
2293
+ const {
2294
+ instance: t,
2295
+ items: {
2296
+ onItemClick: n
2297
+ },
2298
+ selection: {
2299
+ multiSelect: o,
2300
+ checkboxSelection: s,
2301
+ disableSelection: d
2302
+ },
2303
+ expansion: {
2304
+ expansionTrigger: c
2305
+ }
2306
+ } = le(), i = t.isItemExpandable(e), p = t.isItemExpanded(e), u = t.isItemFocused(e), l = t.isItemSelected(e), a = t.isItemDisabled(e), m = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, I = t.isItemEditable ? t.isItemEditable(e) : !1, h = (T) => {
2307
+ if (!a) {
2308
+ u || t.focusItem(T, e);
2309
+ const v = o && (T.shiftKey || T.ctrlKey || T.metaKey);
2310
+ i && !(v && t.isItemExpanded(e)) && t.toggleItemExpansion(T, e);
2311
+ }
2312
+ }, f = (T) => {
2313
+ a || (u || t.focusItem(T, e), o && (T.shiftKey || T.ctrlKey || T.metaKey) ? T.shiftKey ? t.expandSelectionRange(T, e) : t.selectItem({
2314
+ event: T,
2315
+ itemId: e,
2316
+ keepExistingSelection: !0
2317
+ }) : t.selectItem({
2318
+ event: T,
2319
+ itemId: e,
2320
+ shouldBeSelected: !0
2321
+ }));
2322
+ }, g = (T) => {
2323
+ if (d || a)
2324
+ return;
2325
+ const v = T.nativeEvent.shiftKey;
2326
+ o && v ? t.expandSelectionRange(T, e) : t.selectItem({
2327
+ event: T,
2328
+ itemId: e,
2329
+ keepExistingSelection: o,
2330
+ shouldBeSelected: T.target.checked
2331
+ });
2332
+ }, b = (T) => {
2333
+ (T.shiftKey || T.ctrlKey || T.metaKey || a) && T.preventDefault();
2334
+ }, y = () => {
2335
+ we(t, ee) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
2336
+ };
2337
+ return {
2338
+ disabled: a,
2339
+ expanded: p,
2340
+ selected: l,
2341
+ focused: u,
2342
+ editable: I,
2343
+ editing: m,
2344
+ disableSelection: d,
2345
+ checkboxSelection: s,
2346
+ handleExpansion: h,
2347
+ handleSelection: f,
2348
+ handleCheckboxSelection: g,
2349
+ handleContentClick: n,
2350
+ preventSelection: b,
2351
+ expansionTrigger: c,
2352
+ toggleItemEditing: y,
2353
+ handleSaveItemLabel: (T, v) => {
2354
+ we(t, ee) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, v), y(), t.focusItem(T, e));
2355
+ },
2356
+ handleCancelItemLabelEditing: (T) => {
2357
+ we(t, ee) && t.isItemBeingEditedRef(e) && (y(), t.focusItem(T, e));
2358
+ }
2359
+ };
2360
+ }
2361
+ const Mo = U("div", {
2362
+ name: "MuiTreeItem2DragAndDropOverlay",
2363
+ slot: "Root",
2364
+ overridesResolver: (e, t) => t.root,
2365
+ shouldForwardProp: (e) => In(e) && e !== "action"
2366
+ })(({
2367
+ theme: e
2368
+ }) => ({
2369
+ position: "absolute",
2370
+ left: 0,
2371
+ display: "flex",
2372
+ top: 0,
2373
+ bottom: 0,
2374
+ right: 0,
2375
+ pointerEvents: "none",
2376
+ variants: [{
2377
+ props: {
2378
+ action: "make-child"
2379
+ },
2380
+ style: {
2381
+ marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
2382
+ borderRadius: e.shape.borderRadius,
2383
+ backgroundColor: X((e.vars || e).palette.primary.dark, 0.15)
2384
+ }
2385
+ }, {
2386
+ props: {
2387
+ action: "reorder-above"
2388
+ },
2389
+ style: E({
2390
+ marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
2391
+ borderTop: `1px solid ${X((e.vars || e).palette.grey[900], 0.6)}`
2392
+ }, e.applyStyles("dark", {
2393
+ borderTopColor: X((e.vars || e).palette.grey[100], 0.6)
2394
+ }))
2395
+ }, {
2396
+ props: {
2397
+ action: "reorder-below"
2398
+ },
2399
+ style: E({
2400
+ marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
2401
+ borderBottom: `1px solid ${X((e.vars || e).palette.grey[900], 0.6)}`
2402
+ }, e.applyStyles("dark", {
2403
+ borderBottomColor: X((e.vars || e).palette.grey[100], 0.6)
2404
+ }))
2405
+ }, {
2406
+ props: {
2407
+ action: "move-to-parent"
2408
+ },
2409
+ style: E({
2410
+ marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
2411
+ borderBottom: `1px solid ${X((e.vars || e).palette.grey[900], 0.6)}`
2412
+ }, e.applyStyles("dark", {
2413
+ borderBottomColor: X((e.vars || e).palette.grey[900], 0.6)
2414
+ }))
2415
+ }]
2416
+ }));
2417
+ function So(e) {
2418
+ return e.action == null ? null : /* @__PURE__ */ w(Mo, E({}, e));
2419
+ }
2420
+ const Ro = U("input", {
2421
+ name: "MuiTreeItem2",
2422
+ slot: "LabelInput",
2423
+ overridesResolver: (e, t) => t.labelInput
2424
+ })(({
2425
+ theme: e
2426
+ }) => E({}, e.typography.body1, {
2427
+ width: "100%",
2428
+ backgroundColor: e.palette.background.paper,
2429
+ borderRadius: e.shape.borderRadius,
2430
+ border: "none",
2431
+ padding: "0 2px",
2432
+ boxSizing: "border-box",
2433
+ "&:focus": {
2434
+ outline: `1px solid ${e.palette.primary.main}`
2435
+ }
2436
+ })), Oo = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], Xe = /* @__PURE__ */ x.forwardRef(function(t, n) {
2437
+ const {
2438
+ classes: o,
2439
+ className: s,
2440
+ displayIcon: d,
2441
+ expansionIcon: c,
2442
+ icon: i,
2443
+ label: p,
2444
+ itemId: u,
2445
+ onClick: l,
2446
+ onMouseDown: a,
2447
+ dragAndDropOverlayProps: m,
2448
+ labelInputProps: I
2449
+ } = t, h = Q(t, Oo), {
2450
+ disabled: f,
2451
+ expanded: g,
2452
+ selected: b,
2453
+ focused: y,
2454
+ editing: C,
2455
+ editable: O,
2456
+ disableSelection: T,
2457
+ checkboxSelection: v,
2458
+ handleExpansion: R,
2459
+ handleSelection: B,
2460
+ handleCheckboxSelection: K,
2461
+ handleContentClick: V,
2462
+ preventSelection: A,
2463
+ expansionTrigger: z,
2464
+ toggleItemEditing: j
2465
+ } = Pt(u), q = i || c || d, N = x.useRef(null), H = (k) => {
2466
+ A(k), a && a(k);
2467
+ }, L = (k) => {
2468
+ var P;
2469
+ V == null || V(k, u), !((P = N.current) != null && P.contains(k.target)) && (z === "content" && R(k), v || B(k), l && l(k));
2470
+ }, W = (k) => {
2471
+ k.defaultMuiPrevented || j();
2472
+ };
2473
+ return (
2474
+ /* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
2475
+ /* @__PURE__ */ ve("div", E({}, h, {
2476
+ className: Ie(s, o.root, g && o.expanded, b && o.selected, y && o.focused, f && o.disabled, C && o.editing, O && o.editable),
2477
+ onClick: L,
2478
+ onMouseDown: H,
2479
+ ref: n,
2480
+ children: [/* @__PURE__ */ w("div", {
2481
+ className: o.iconContainer,
2482
+ children: q
2483
+ }), v && /* @__PURE__ */ w(ft, {
2484
+ className: o.checkbox,
2485
+ checked: b,
2486
+ onChange: K,
2487
+ disabled: f || T,
2488
+ ref: N,
2489
+ tabIndex: -1
2490
+ }), C ? /* @__PURE__ */ w(Ro, E({}, I, {
2491
+ className: o.labelInput
2492
+ })) : /* @__PURE__ */ w("div", E({
2493
+ className: o.label
2494
+ }, O && {
2495
+ onDoubleClick: W
2496
+ }, {
2497
+ children: p
2498
+ })), m && /* @__PURE__ */ w(So, E({}, m))]
2499
+ }))
2500
+ );
2501
+ });
2502
+ process.env.NODE_ENV !== "production" && (Xe.propTypes = {
2503
+ // ----------------------------- Warning --------------------------------
2504
+ // | These PropTypes are generated from the TypeScript type definitions |
2505
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
2506
+ // ----------------------------------------------------------------------
2507
+ /**
2508
+ * Override or extend the styles applied to the component.
2509
+ */
2510
+ classes: r.object.isRequired,
2511
+ className: r.string,
2512
+ /**
2513
+ * The icon to display next to the tree item's label. Either a parent or end icon.
2514
+ */
2515
+ displayIcon: r.node,
2516
+ dragAndDropOverlayProps: r.shape({
2517
+ action: r.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
2518
+ style: r.object
2519
+ }),
2520
+ /**
2521
+ * The icon to display next to the tree item's label. Either an expansion or collapse icon.
2522
+ */
2523
+ expansionIcon: r.node,
2524
+ /**
2525
+ * The icon to display next to the tree item's label.
2526
+ */
2527
+ icon: r.node,
2528
+ /**
2529
+ * The id of the item.
2530
+ */
2531
+ itemId: r.string.isRequired,
2532
+ /**
2533
+ * The tree item label.
2534
+ */
2535
+ label: r.node,
2536
+ labelInputProps: r.shape({
2537
+ autoFocus: r.oneOf([!0]),
2538
+ "data-element": r.oneOf(["labelInput"]),
2539
+ onBlur: r.func,
2540
+ onChange: r.func,
2541
+ onKeyDown: r.func,
2542
+ type: r.oneOf(["text"]),
2543
+ value: r.string
2544
+ })
2545
+ });
2546
+ function ko(e) {
2547
+ return fe("MuiTreeItem", e);
2548
+ }
2549
+ const J = me("MuiTreeItem", ["root", "groupTransition", "content", "expanded", "selected", "focused", "disabled", "iconContainer", "label", "checkbox", "labelInput", "editable", "editing", "dragAndDropOverlay"]), Po = te(/* @__PURE__ */ w("path", {
2550
+ d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
2551
+ }), "TreeViewExpandIcon"), Do = te(/* @__PURE__ */ w("path", {
2552
+ d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
2553
+ }), "TreeViewCollapseIcon");
2554
+ function Dt(e) {
2555
+ const {
2556
+ children: t,
2557
+ itemId: n
2558
+ } = e, {
2559
+ wrapItem: o,
2560
+ instance: s
2561
+ } = le();
2562
+ return o({
2563
+ children: t,
2564
+ itemId: n,
2565
+ instance: s
2566
+ });
2567
+ }
2568
+ Dt.propTypes = {
2569
+ // ----------------------------- Warning --------------------------------
2570
+ // | These PropTypes are generated from the TypeScript type definitions |
2571
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
2572
+ // ----------------------------------------------------------------------
2573
+ children: r.node,
2574
+ itemId: r.string.isRequired
2575
+ };
2576
+ const Vo = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"], $o = ["ownerState"], Ao = ["ownerState"], Fo = ["ownerState"], No = mt(), Lo = (e) => {
2577
+ const {
2578
+ classes: t
2579
+ } = e;
2580
+ return ge({
2581
+ root: ["root"],
2582
+ content: ["content"],
2583
+ expanded: ["expanded"],
2584
+ selected: ["selected"],
2585
+ focused: ["focused"],
2586
+ disabled: ["disabled"],
2587
+ iconContainer: ["iconContainer"],
2588
+ checkbox: ["checkbox"],
2589
+ label: ["label"],
2590
+ labelInput: ["labelInput"],
2591
+ editing: ["editing"],
2592
+ editable: ["editable"],
2593
+ groupTransition: ["groupTransition"]
2594
+ }, ko, t);
2595
+ }, jo = U("li", {
2596
+ name: "MuiTreeItem",
2597
+ slot: "Root",
2598
+ overridesResolver: (e, t) => t.root
2599
+ })({
2600
+ listStyle: "none",
2601
+ margin: 0,
2602
+ padding: 0,
2603
+ outline: 0
2604
+ }), _o = U(Xe, {
2605
+ name: "MuiTreeItem",
2606
+ slot: "Content",
2607
+ overridesResolver: (e, t) => [t.content, t.iconContainer && {
2608
+ [`& .${J.iconContainer}`]: t.iconContainer
2609
+ }, t.label && {
2610
+ [`& .${J.label}`]: t.label
2611
+ }],
2612
+ shouldForwardProp: (e) => dt(e) && e !== "indentationAtItemLevel"
2613
+ })(({
2614
+ theme: e
2615
+ }) => ({
2616
+ padding: e.spacing(0.5, 1),
2617
+ borderRadius: e.shape.borderRadius,
2618
+ width: "100%",
2619
+ boxSizing: "border-box",
2620
+ // prevent width + padding to overflow
2621
+ position: "relative",
2622
+ display: "flex",
2623
+ alignItems: "center",
2624
+ gap: e.spacing(1),
2625
+ cursor: "pointer",
2626
+ WebkitTapHighlightColor: "transparent",
2627
+ "&:hover": {
2628
+ backgroundColor: (e.vars || e).palette.action.hover,
2629
+ // Reset on touch devices, it doesn't add specificity
2630
+ "@media (hover: none)": {
2631
+ backgroundColor: "transparent"
2632
+ }
2633
+ },
2634
+ [`&.${J.disabled}`]: {
2635
+ opacity: (e.vars || e).palette.action.disabledOpacity,
2636
+ backgroundColor: "transparent"
2637
+ },
2638
+ [`&.${J.focused}`]: {
2639
+ backgroundColor: (e.vars || e).palette.action.focus
2640
+ },
2641
+ [`&.${J.selected}`]: {
2642
+ backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : X(e.palette.primary.main, e.palette.action.selectedOpacity),
2643
+ "&:hover": {
2644
+ backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : X(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
2645
+ // Reset on touch devices, it doesn't add specificity
2646
+ "@media (hover: none)": {
2647
+ backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : X(e.palette.primary.main, e.palette.action.selectedOpacity)
2648
+ }
2649
+ },
2650
+ [`&.${J.focused}`]: {
2651
+ backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : X(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
2652
+ }
2653
+ },
2654
+ [`& .${J.iconContainer}`]: {
2655
+ width: 16,
2656
+ display: "flex",
2657
+ flexShrink: 0,
2658
+ justifyContent: "center",
2659
+ "& svg": {
2660
+ fontSize: 18
2661
+ }
2662
+ },
2663
+ [`& .${J.label}`]: E({
2664
+ width: "100%",
2665
+ boxSizing: "border-box",
2666
+ // prevent width + padding to overflow
2667
+ // fixes overflow - see https://github.com/mui/material-ui/issues/27372
2668
+ minWidth: 0,
2669
+ position: "relative"
2670
+ }, e.typography.body1),
2671
+ [`& .${J.checkbox}`]: {
2672
+ padding: 0
2673
+ },
2674
+ variants: [{
2675
+ props: {
2676
+ indentationAtItemLevel: !0
2677
+ },
2678
+ style: {
2679
+ paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
2680
+ }
2681
+ }]
2682
+ })), Bo = U(Be, {
2683
+ name: "MuiTreeItem",
2684
+ slot: "GroupTransition",
2685
+ overridesResolver: (e, t) => t.groupTransition,
2686
+ shouldForwardProp: (e) => dt(e) && e !== "indentationAtItemLevel"
2687
+ })({
2688
+ margin: 0,
2689
+ padding: 0,
2690
+ paddingLeft: "var(--TreeView-itemChildrenIndentation)",
2691
+ variants: [{
2692
+ props: {
2693
+ indentationAtItemLevel: !0
2694
+ },
2695
+ style: {
2696
+ paddingLeft: 0
2697
+ }
2698
+ }]
2699
+ }), Vt = /* @__PURE__ */ x.forwardRef(function(t, n) {
2700
+ var Ge, He, Ye, Qe;
2701
+ const {
2702
+ icons: o,
2703
+ runItemPlugins: s,
2704
+ items: {
2705
+ disabledItemsFocusable: d,
2706
+ indentationAtItemLevel: c
2707
+ },
2708
+ selection: {
2709
+ multiSelect: i
2710
+ },
2711
+ expansion: {
2712
+ expansionTrigger: p
2713
+ },
2714
+ instance: u
2715
+ } = le(), l = x.useContext(se), a = No({
2716
+ props: t,
2717
+ name: "MuiTreeItem"
2718
+ }), {
2719
+ children: m,
2720
+ className: I,
2721
+ slots: h,
2722
+ slotProps: f,
2723
+ ContentComponent: g = Xe,
2724
+ ContentProps: b,
2725
+ itemId: y,
2726
+ id: C,
2727
+ label: O,
2728
+ onClick: T,
2729
+ onMouseDown: v,
2730
+ onBlur: R,
2731
+ onKeyDown: B
2732
+ } = a, K = Q(a, Vo), {
2733
+ expanded: V,
2734
+ focused: A,
2735
+ selected: z,
2736
+ disabled: j,
2737
+ editing: q,
2738
+ handleExpansion: N,
2739
+ handleCancelItemLabelEditing: H,
2740
+ handleSaveItemLabel: L
2741
+ } = Pt(y), {
2742
+ contentRef: W,
2743
+ rootRef: k,
2744
+ propsEnhancers: P
2745
+ } = s(a), ne = x.useRef(null), ye = x.useRef(null), Oe = de(n, k, ne), ke = de(b == null ? void 0 : b.ref, W, ye), oe = {
2746
+ expandIcon: (h == null ? void 0 : h.expandIcon) ?? o.slots.expandIcon ?? Po,
2747
+ collapseIcon: (h == null ? void 0 : h.collapseIcon) ?? o.slots.collapseIcon ?? Do,
2748
+ endIcon: (h == null ? void 0 : h.endIcon) ?? o.slots.endIcon,
2749
+ icon: h == null ? void 0 : h.icon,
2750
+ groupTransition: h == null ? void 0 : h.groupTransition
2751
+ }, M = (S) => Array.isArray(S) ? S.length > 0 && S.some(M) : !!S, F = M(m), _ = E({}, a, {
2752
+ expanded: V,
2753
+ focused: A,
2754
+ selected: z,
2755
+ disabled: j,
2756
+ indentationAtItemLevel: c
2757
+ }), $ = Lo(_), Y = oe.groupTransition ?? void 0, xe = ce({
2758
+ elementType: Y,
2759
+ ownerState: {},
2760
+ externalSlotProps: f == null ? void 0 : f.groupTransition,
2761
+ additionalProps: E({
2762
+ unmountOnExit: !0,
2763
+ in: V,
2764
+ component: "ul",
2765
+ role: "group"
2766
+ }, c ? {
2767
+ indentationAtItemLevel: !0
2768
+ } : {}),
2769
+ className: $.groupTransition
2770
+ }), At = (S) => {
2771
+ p === "iconContainer" && N(S);
2772
+ }, Pe = V ? oe.collapseIcon : oe.expandIcon, Ft = ce({
2773
+ elementType: Pe,
2774
+ ownerState: {},
2775
+ externalSlotProps: (S) => V ? E({}, ie(o.slotProps.collapseIcon, S), ie(f == null ? void 0 : f.collapseIcon, S)) : E({}, ie(o.slotProps.expandIcon, S), ie(f == null ? void 0 : f.expandIcon, S)),
2776
+ additionalProps: {
2777
+ onClick: At
2778
+ }
2779
+ }), Nt = Q(Ft, $o), Lt = F && Pe ? /* @__PURE__ */ w(Pe, E({}, Nt)) : null, De = F ? void 0 : oe.endIcon, jt = ce({
2780
+ elementType: De,
2781
+ ownerState: {},
2782
+ externalSlotProps: (S) => F ? {} : E({}, ie(o.slotProps.endIcon, S), ie(f == null ? void 0 : f.endIcon, S))
2783
+ }), _t = Q(jt, Ao), Bt = De ? /* @__PURE__ */ w(De, E({}, _t)) : null, Ve = oe.icon, zt = ce({
2784
+ elementType: Ve,
2785
+ ownerState: {},
2786
+ externalSlotProps: f == null ? void 0 : f.icon
2787
+ }), Ut = Q(zt, Fo), Kt = Ve ? /* @__PURE__ */ w(Ve, E({}, Ut)) : null;
2788
+ let $e;
2789
+ i ? $e = z : z && ($e = !0);
2790
+ function qt(S) {
2791
+ !A && (!j || d) && S.currentTarget === S.target && u.focusItem(S, y);
2792
+ }
2793
+ function Xt(S) {
2794
+ var re, ae, Ze, et;
2795
+ R == null || R(S), !(q || // we can exit the editing state by clicking outside the input (within the tree item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
2796
+ // we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
2797
+ S.relatedTarget && Ne(S.relatedTarget, ne.current) && (S.target && ((ae = (re = S.target) == null ? void 0 : re.dataset) == null ? void 0 : ae.element) === "labelInput" && Ne(S.target, ne.current) || ((et = (Ze = S.relatedTarget) == null ? void 0 : Ze.dataset) == null ? void 0 : et.element) === "labelInput")) && u.removeFocusedItem();
2798
+ }
2799
+ const Wt = (S) => {
2800
+ var re, ae;
2801
+ B == null || B(S), ((ae = (re = S.target) == null ? void 0 : re.dataset) == null ? void 0 : ae.element) !== "labelInput" && u.handleItemKeyDown(S, y);
2802
+ }, Jt = u.getTreeItemIdAttribute(y, C), Gt = u.canItemBeTabbed(y) ? 0 : -1, Ee = {
2803
+ rootRefObject: ne,
2804
+ contentRefObject: ye,
2805
+ interactions: {
2806
+ handleSaveItemLabel: L,
2807
+ handleCancelItemLabelEditing: H
2808
+ }
2809
+ }, Ht = ((Ge = P.root) == null ? void 0 : Ge.call(P, E({}, Ee, {
2810
+ externalEventHandlers: ot(K)
2811
+ }))) ?? {}, Yt = ((He = P.content) == null ? void 0 : He.call(P, E({}, Ee, {
2812
+ externalEventHandlers: ot(b)
2813
+ }))) ?? {}, We = ((Ye = P.dragAndDropOverlay) == null ? void 0 : Ye.call(P, E({}, Ee, {
2814
+ externalEventHandlers: {}
2815
+ }))) ?? {}, Je = ((Qe = P.labelInput) == null ? void 0 : Qe.call(P, E({}, Ee, {
2816
+ externalEventHandlers: {}
2817
+ }))) ?? {};
2818
+ return /* @__PURE__ */ w(Dt, {
2819
+ itemId: y,
2820
+ children: /* @__PURE__ */ ve(jo, E({
2821
+ className: Ie($.root, I),
2822
+ role: "treeitem",
2823
+ "aria-expanded": F ? V : void 0,
2824
+ "aria-selected": $e,
2825
+ "aria-disabled": j || void 0,
2826
+ id: Jt,
2827
+ tabIndex: Gt
2828
+ }, K, {
2829
+ ownerState: _,
2830
+ onFocus: qt,
2831
+ onBlur: Xt,
2832
+ onKeyDown: Wt,
2833
+ ref: Oe,
2834
+ style: c ? E({}, K.style, {
2835
+ "--TreeView-itemDepth": typeof l == "function" ? l(y) : l
2836
+ }) : K.style
2837
+ }, Ht, {
2838
+ children: [/* @__PURE__ */ w(_o, E({
2839
+ as: g,
2840
+ classes: {
2841
+ root: $.content,
2842
+ expanded: $.expanded,
2843
+ selected: $.selected,
2844
+ focused: $.focused,
2845
+ disabled: $.disabled,
2846
+ editable: $.editable,
2847
+ editing: $.editing,
2848
+ iconContainer: $.iconContainer,
2849
+ label: $.label,
2850
+ labelInput: $.labelInput,
2851
+ checkbox: $.checkbox
2852
+ },
2853
+ label: O,
2854
+ itemId: y,
2855
+ onClick: T,
2856
+ onMouseDown: v,
2857
+ icon: Kt,
2858
+ expansionIcon: Lt,
2859
+ displayIcon: Bt,
2860
+ ownerState: _
2861
+ }, b, Yt, We.action == null ? {} : {
2862
+ dragAndDropOverlayProps: We
2863
+ }, Je.value == null ? {} : {
2864
+ labelInputProps: Je
2865
+ }, {
2866
+ ref: ke
2867
+ })), m && /* @__PURE__ */ w(Bo, E({
2868
+ as: Y
2869
+ }, xe, {
2870
+ children: m
2871
+ }))]
2872
+ }))
2873
+ });
2874
+ });
2875
+ process.env.NODE_ENV !== "production" && (Vt.propTypes = {
2876
+ // ----------------------------- Warning --------------------------------
2877
+ // | These PropTypes are generated from the TypeScript type definitions |
2878
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
2879
+ // ----------------------------------------------------------------------
2880
+ /**
2881
+ * The content of the component.
2882
+ */
2883
+ children: r.node,
2884
+ /**
2885
+ * Override or extend the styles applied to the component.
2886
+ */
2887
+ classes: r.object,
2888
+ className: r.string,
2889
+ /**
2890
+ * The component used to render the content of the item.
2891
+ * @default TreeItemContent
2892
+ */
2893
+ ContentComponent: lt,
2894
+ /**
2895
+ * Props applied to ContentComponent.
2896
+ */
2897
+ ContentProps: r.object,
2898
+ /**
2899
+ * If `true`, the item is disabled.
2900
+ * @default false
2901
+ */
2902
+ disabled: r.bool,
2903
+ /**
2904
+ * The id of the item.
2905
+ */
2906
+ itemId: r.string.isRequired,
2907
+ /**
2908
+ * The tree item label.
2909
+ */
2910
+ label: r.node,
2911
+ /**
2912
+ * This prop isn't supported.
2913
+ * Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
2914
+ */
2915
+ onFocus: gn,
2916
+ /**
2917
+ * Callback fired when a key of the keyboard is pressed on the item.
2918
+ */
2919
+ onKeyDown: r.func,
2920
+ /**
2921
+ * The props used for each component slot.
2922
+ * @default {}
2923
+ */
2924
+ slotProps: r.object,
2925
+ /**
2926
+ * Overridable component slots.
2927
+ * @default {}
2928
+ */
2929
+ slots: r.object,
2930
+ /**
2931
+ * The system prop that allows defining system overrides as well as additional CSS styles.
2932
+ */
2933
+ sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object])
2934
+ });
2935
+ const Jo = ({
2936
+ items: e,
2937
+ handleCheck: t,
2938
+ width: n = "250px",
2939
+ height: o = "350px",
2940
+ expanded: s
2941
+ }) => /* @__PURE__ */ w(hn, { width: n, height: o, children: /* @__PURE__ */ w(kt, { expandedItems: s, children: $t(e, t) }) }), $t = (e, t) => e.map((n) => /* @__PURE__ */ Qt(zo, { ...n, key: n.id, handleCheck: t })), zo = ({
2942
+ id: e,
2943
+ checked: t,
2944
+ children: n,
2945
+ label: o,
2946
+ handleCheck: s
2947
+ }) => /* @__PURE__ */ w(
2948
+ Vt,
2949
+ {
2950
+ itemId: e,
2951
+ label: /* @__PURE__ */ ve(bn, { flexDirection: "row", alignItems: "center", children: [
2952
+ /* @__PURE__ */ w(yn, { children: o }),
2953
+ s && /* @__PURE__ */ w(
2954
+ xn,
2955
+ {
2956
+ disableRipple: !0,
2957
+ sx: { marginLeft: "auto" },
2958
+ onClick: (d) => {
2959
+ d.stopPropagation(), s(e, !t);
2960
+ },
2961
+ "data-testid": `toggle-visibility-${e}`,
2962
+ children: t ? /* @__PURE__ */ w(qn, { "data-testid": `visibility-icon-${e}` }) : /* @__PURE__ */ w(Xn, { "data-testid": `visibility-off-icon-${e}` })
2963
+ }
2964
+ )
2965
+ ] }),
2966
+ children: n.length > 0 && $t(n, s)
2967
+ }
2968
+ );
2969
+ export {
2970
+ Be as C,
2971
+ ut as F,
2972
+ Jo as T,
2973
+ X as a,
2974
+ Cn as b,
2975
+ Xo as c,
2976
+ Me as d,
2977
+ ft as e,
2978
+ Wo as l,
2979
+ _e as r,
2980
+ On as u
2981
+ };