@epam/statgpt-ui-components 0.3.0-rc.13 → 0.3.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,17 +1,21 @@
1
- import { jsx as r, jsxs as o, Fragment as Y } from "react/jsx-runtime";
2
- import { useEffect as _, useState as A, useRef as P, useCallback as L, useMemo as D, createContext as j, useContext as G } from "react";
3
- import m from "classnames";
4
- import { IconX as K, IconCalendarEvent as ee, IconChevronDown as te } from "@tabler/icons-react";
5
- import { extendTailwindMerge as ne } from "tailwind-merge";
6
- import re from "react-flatpickr";
7
- import { CalendarResolution as k } from "@epam/statgpt-shared-toolkit";
8
- import { useFloating as $, useRole as le, useDismiss as H, useInteractions as B, FloatingPortal as se, FloatingOverlay as ae, FloatingFocusManager as oe, autoUpdate as ce, offset as ie, flip as de, shift as ue, useClick as me } from "@floating-ui/react";
9
- const U = () => /* @__PURE__ */ r("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ r("div", { className: "loader" }) }), W = ({
1
+ import { jsx as r, jsxs as o, Fragment as H } from "react/jsx-runtime";
2
+ import * as oe from "react";
3
+ import { useEffect as M, useState as j, useRef as B, useCallback as _, useMemo as W, createContext as U, useContext as V } from "react";
4
+ import f from "classnames";
5
+ import { IconX as de, IconCalendarEvent as ue, IconSquareCheckFilled as me, IconChevronDown as he, IconGripVertical as Q, IconChevronRight as K, IconDatabase as fe } from "@tabler/icons-react";
6
+ import { extendTailwindMerge as pe } from "tailwind-merge";
7
+ import ge from "react-flatpickr";
8
+ import { CalendarResolution as O } from "@epam/statgpt-shared-toolkit";
9
+ import { useFloating as X, useRole as xe, useDismiss as Z, useInteractions as J, FloatingPortal as be, FloatingOverlay as Ne, FloatingFocusManager as Ce, autoUpdate as ve, offset as ye, flip as we, shift as Ee, useClick as Se } from "@floating-ui/react";
10
+ import { useSensors as Ie, useSensor as ke, PointerSensor as De, DndContext as Le, closestCenter as Re, DragOverlay as Fe } from "@dnd-kit/core";
11
+ import { useSortable as Oe, SortableContext as Ae, verticalListSortingStrategy as _e, arrayMove as Pe } from "@dnd-kit/sortable";
12
+ import { CSS as Te } from "@dnd-kit/utilities";
13
+ const ee = () => /* @__PURE__ */ r("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ r("div", { className: "loader" }) }), te = ({
10
14
  title: e,
11
15
  btnClassNames: t,
12
16
  iconWidth: n,
13
- iconHeight: l,
14
- onClick: s
17
+ iconHeight: s,
18
+ onClick: l
15
19
  }) => /* @__PURE__ */ r(
16
20
  "button",
17
21
  {
@@ -19,41 +23,41 @@ const U = () => /* @__PURE__ */ r("div", { className: "flex items-center justify
19
23
  "aria-label": "button",
20
24
  className: t,
21
25
  title: e,
22
- onClick: s,
23
- children: /* @__PURE__ */ r(K, { height: l || 20, width: n || 20 })
26
+ onClick: l,
27
+ children: /* @__PURE__ */ r(de, { height: s || 20, width: n || 20 })
24
28
  }
25
29
  );
26
- var y = /* @__PURE__ */ ((e) => (e.ERROR = "error", e.SUCCESS = "success", e.IN_PROGRESS = "in_progress", e))(y || {});
27
- const Oe = ({
30
+ var F = /* @__PURE__ */ ((e) => (e.ERROR = "error", e.SUCCESS = "success", e.IN_PROGRESS = "in_progress", e))(F || {});
31
+ const mt = ({
28
32
  alertDetails: e,
29
33
  successIcon: t,
30
34
  errorIcon: n,
31
- onClose: l,
32
- closeButtonTitle: s
35
+ onClose: s,
36
+ closeButtonTitle: l
33
37
  }) => {
34
- const a = () => e?.type === y.IN_PROGRESS ? "alert-in-progress" : e?.type === y.SUCCESS ? "alert-success" : "alert-error";
35
- return _(() => {
36
- e?.type !== y.IN_PROGRESS && setTimeout(() => {
37
- l?.();
38
+ const a = () => e?.type === F.IN_PROGRESS ? "alert-in-progress" : e?.type === F.SUCCESS ? "alert-success" : "alert-error";
39
+ return M(() => {
40
+ e?.type !== F.IN_PROGRESS && setTimeout(() => {
41
+ s?.();
38
42
  }, 5e3);
39
- }, [e?.type, l]), /* @__PURE__ */ r(
43
+ }, [e?.type, s]), /* @__PURE__ */ r(
40
44
  "div",
41
45
  {
42
- className: m(
46
+ className: f(
43
47
  "alert alert-shadow fixed bottom-3 right-3 z-10",
44
48
  a()
45
49
  ),
46
50
  children: /* @__PURE__ */ o("div", { className: "alert-content flex items-start", children: [
47
- /* @__PURE__ */ r("div", { className: "alert-icon", children: e?.type === y.IN_PROGRESS ? /* @__PURE__ */ r(U, {}) : e?.type === y.SUCCESS ? t : n }),
51
+ /* @__PURE__ */ r("div", { className: "alert-icon", children: e?.type === F.IN_PROGRESS ? /* @__PURE__ */ r(ee, {}) : e?.type === F.SUCCESS ? t : n }),
48
52
  /* @__PURE__ */ o("div", { className: "flex flex-col gap-2 max-w-[300px]", children: [
49
53
  /* @__PURE__ */ r("h3", { className: "truncate", children: e?.title }),
50
54
  e?.text && /* @__PURE__ */ r("div", { className: "alert-text truncate", title: e?.text, children: e?.text })
51
55
  ] }),
52
- /* @__PURE__ */ r(W, { title: s, onClick: l })
56
+ /* @__PURE__ */ r(te, { title: l, onClick: s })
53
57
  ] })
54
58
  }
55
59
  );
56
- }, he = ne({
60
+ }, Me = pe({
57
61
  extend: {
58
62
  classGroups: {
59
63
  typography: [
@@ -70,236 +74,252 @@ const Oe = ({
70
74
  }
71
75
  }
72
76
  });
73
- function v(...e) {
74
- return he(m(...e));
77
+ function L(...e) {
78
+ return Me(f(...e));
75
79
  }
76
- const pe = ({
80
+ const je = ({
77
81
  buttonClassName: e,
78
82
  textClassName: t,
79
83
  isLoading: n = !1,
80
- title: l,
81
- disabled: s,
84
+ title: s,
85
+ disabled: l,
82
86
  iconAfter: a,
83
- iconBefore: c,
87
+ iconBefore: d,
84
88
  onClick: u,
85
- isSmallButton: d
89
+ isSmallButton: h
86
90
  }) => {
87
- const h = v([
88
- d ? "font-semibold" : "",
91
+ const m = L([
92
+ h ? "font-semibold" : "",
89
93
  a ? "mr-2" : "",
90
- c ? "ml-2" : "",
94
+ d ? "ml-2" : "",
91
95
  t
92
96
  ]);
93
97
  return /* @__PURE__ */ o(
94
98
  "button",
95
99
  {
96
100
  type: "button",
97
- className: m(
101
+ className: f(
98
102
  "base-button",
99
103
  e,
100
- d ? "small-button" : ""
104
+ h ? "small-button" : ""
101
105
  ),
102
- disabled: s || n,
106
+ disabled: l || n,
103
107
  "aria-label": "button",
104
- onClick: (f) => u?.(f),
105
- title: l,
108
+ onClick: (p) => u?.(p),
109
+ title: s,
106
110
  children: [
107
- c,
108
- n && /* @__PURE__ */ r(U, {}),
109
- l ? d ? /* @__PURE__ */ r("h4", { className: h, children: l }) : /* @__PURE__ */ r("h3", { className: h, children: l }) : null,
111
+ d,
112
+ n && /* @__PURE__ */ r(ee, {}),
113
+ s ? h ? /* @__PURE__ */ r("h4", { className: m, children: s }) : /* @__PURE__ */ r("h3", { className: m, children: s }) : null,
110
114
  a
111
115
  ]
112
116
  }
113
117
  );
114
118
  };
115
- function fe(e = 719) {
116
- const [t, n] = A(
119
+ function Ye(e = 719) {
120
+ const [t, n] = j(
117
121
  () => typeof window < "u" ? window.innerWidth < e : !1
118
122
  );
119
- return _(() => {
120
- const l = window.matchMedia(`(max-width: ${e}px)`), s = (a) => {
123
+ return M(() => {
124
+ const s = window.matchMedia(`(max-width: ${e}px)`), l = (a) => {
121
125
  n(a.matches);
122
126
  };
123
- return n(l.matches), l.addEventListener("change", s), () => l.removeEventListener("change", s);
127
+ return n(s.matches), s.addEventListener("change", l), () => s.removeEventListener("change", l);
124
128
  }, [e]), t;
125
129
  }
126
- function Te(e, t) {
127
- const n = P(null);
128
- return L(
129
- (...s) => {
130
+ function ht(e, t) {
131
+ const n = B(null);
132
+ return _(
133
+ (...l) => {
130
134
  n.current && clearTimeout(n.current), n.current = setTimeout(() => {
131
- e(...s);
135
+ e(...l);
132
136
  }, t);
133
137
  },
134
138
  [e, t]
135
139
  );
136
140
  }
137
- const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
141
+ const ft = 24, pt = 24, q = 1e3, Ge = 24, gt = ({
138
142
  label: e,
139
143
  onChange: t,
140
144
  value: n,
141
- options: l,
142
- calendarResolution: s = k.DAY,
145
+ options: s,
146
+ calendarResolution: l = O.DAY,
143
147
  id: a,
144
- icon: c,
148
+ icon: d,
145
149
  isEndDate: u
146
150
  }) => {
147
- const d = P(null), h = fe();
148
- _(() => {
149
- const x = d?.current;
150
- x && x.querySelector("input")?.setAttribute("aria-label", e);
151
+ const h = B(null), m = Ye();
152
+ M(() => {
153
+ const b = h?.current;
154
+ b && b.querySelector("input")?.setAttribute("aria-label", e);
151
155
  }, [e]);
152
- const f = {
153
- ...l,
156
+ const p = {
157
+ ...s,
154
158
  disableMobile: !0,
155
- defaultDate: s === k.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n
156
- }, g = (x, E, b) => {
157
- const i = `calendar__${s === k.MONTH ? "month" : "day"}`;
158
- b.calendarContainer && b.calendarContainer.classList.add(i);
159
- }, N = (x, E, b) => {
160
- if (s === k.MONTH && x.length > 0) {
161
- const i = l.minDate, p = l.maxDate, w = x[0].getFullYear(), R = b.calendarContainer, F = "flatpickr-disabled", V = R.querySelectorAll(
159
+ defaultDate: l === O.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n
160
+ }, x = (b, N, g) => {
161
+ const c = `calendar__${l === O.MONTH ? "month" : "day"}`;
162
+ g.calendarContainer && g.calendarContainer.classList.add(c);
163
+ }, w = (b, N, g) => {
164
+ if (l === O.MONTH && b.length > 0) {
165
+ const c = s.minDate, i = s.maxDate, v = b[0].getFullYear(), S = g.calendarContainer, E = "flatpickr-disabled", y = S.querySelectorAll(
162
166
  ".flatpickr-monthSelect-month"
163
- ), z = R.querySelectorAll(
167
+ ), C = S.querySelectorAll(
164
168
  ".flatpickr-next-month"
165
- )[0], X = R.querySelectorAll(
169
+ )[0], k = S.querySelectorAll(
166
170
  ".flatpickr-prev-month"
167
171
  )[0];
168
- w === p.getFullYear() && z.classList.add(F), w === i.getFullYear() && X.classList.add(F), (w === i.getFullYear() || w === p.getFullYear()) && V.forEach((O) => {
169
- O.classList.remove(F);
170
- const C = new Date(O.getAttribute("aria-label")), Z = C.getFullYear() === i.getFullYear() && C.getMonth() === i.getMonth(), J = C.getFullYear() === p.getFullYear() && C.getMonth() === p.getMonth();
171
- Z || J || (C < i || C > p) && O.classList.add(F);
172
+ v === i.getFullYear() && C.classList.add(E), v === c.getFullYear() && k.classList.add(E), (v === c.getFullYear() || v === i.getFullYear()) && y.forEach((D) => {
173
+ D.classList.remove(E);
174
+ const I = new Date(D.getAttribute("aria-label")), R = I.getFullYear() === c.getFullYear() && I.getMonth() === c.getMonth(), Y = I.getFullYear() === i.getFullYear() && I.getMonth() === i.getMonth();
175
+ R || Y || (I < c || I > i) && D.classList.add(E);
172
176
  });
173
177
  }
174
178
  setTimeout(() => {
175
- const i = b.calendarContainer, p = b._input?.getBoundingClientRect();
176
- i && (i.style.top = `${p.top - i.offsetHeight - 8}px`, i.style.width = `${i.style.width}px`, u ? (i.style.right = `${window.innerWidth - p.right - (h ? xe : 0)}px`, i.style.left = "auto") : i.style.left = `${p.left}px`);
179
+ const c = g.calendarContainer, i = g._input?.getBoundingClientRect();
180
+ c && (c.style.top = `${i.top - c.offsetHeight - 8}px`, c.style.width = `${c.style.width}px`, u ? (c.style.right = `${window.innerWidth - i.right - (m ? Ge : 0)}px`, c.style.left = "auto") : c.style.left = `${i.left}px`);
177
181
  }, 0);
178
182
  };
179
- return /* @__PURE__ */ o("div", { className: "relative calendar", ref: d, children: [
183
+ return /* @__PURE__ */ o("div", { className: "relative calendar", ref: h, children: [
180
184
  /* @__PURE__ */ r("div", { className: "mb-1 calendar-title", children: e }),
181
185
  /* @__PURE__ */ r(
182
186
  "label",
183
187
  {
184
188
  htmlFor: a,
185
189
  className: "absolute cursor-pointer right-[11px] top-[29px]",
186
- children: c || /* @__PURE__ */ r(ee, {})
190
+ children: d || /* @__PURE__ */ r(ue, {})
187
191
  }
188
192
  ),
189
193
  /* @__PURE__ */ r(
190
- re,
194
+ ge,
191
195
  {
192
- defaultValue: (s === k.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n)?.toDateString(),
193
- options: f,
194
- onChange: (x) => {
195
- t(x[0]);
196
+ defaultValue: (l === O.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n)?.toDateString(),
197
+ options: p,
198
+ onChange: (b) => {
199
+ t(b[0]);
196
200
  },
197
- onOpen: [N],
198
- onReady: [g],
201
+ onOpen: [w],
202
+ onReady: [x],
199
203
  id: a
200
204
  }
201
205
  )
202
206
  ] });
203
- }, Ye = ({
207
+ }, ne = ({
204
208
  label: e,
205
209
  id: t,
206
210
  checked: n,
207
- checkboxIcon: l,
208
- onChange: s
211
+ checkboxIcon: s,
212
+ onChange: l,
213
+ disabled: a = !1,
214
+ className: d,
215
+ stopPropagation: u = !0
209
216
  }) => {
210
- const a = L(
211
- (c) => {
212
- c.stopPropagation(), s?.(t, c.target.checked);
217
+ const h = _(
218
+ (x) => {
219
+ u && x.stopPropagation();
213
220
  },
214
- [s, t]
215
- );
221
+ [u]
222
+ ), m = _(
223
+ (x) => {
224
+ u && x.stopPropagation(), l?.(t, x.target.checked);
225
+ },
226
+ [l, t, u]
227
+ ), p = () => {
228
+ if (n)
229
+ return s || /* @__PURE__ */ r(me, { className: "absolute size-4" });
230
+ };
216
231
  return /* @__PURE__ */ o(
217
232
  "label",
218
233
  {
219
- className: "flex items-center cursor-pointer min-w-0 py-1",
220
234
  htmlFor: t,
235
+ onClick: h,
236
+ className: L(
237
+ "flex min-w-0 items-center py-1",
238
+ a ? "cursor-not-allowed opacity-50" : "cursor-pointer",
239
+ d
240
+ ),
221
241
  children: [
222
242
  /* @__PURE__ */ r(
223
243
  "span",
224
244
  {
225
- className: m(
226
- "flex justify-center items-center w-4 h-4 mr-2 relative",
227
- "checkbox-button"
245
+ className: f(
246
+ "checkbox-button relative flex size-[14px] items-center justify-center"
228
247
  ),
229
- children: n && l
248
+ "aria-hidden": !0,
249
+ children: p()
230
250
  }
231
251
  ),
232
- e && /* @__PURE__ */ r(
252
+ e ? /* @__PURE__ */ r(
233
253
  "p",
234
254
  {
235
- className: m(
236
- "text-neutrals-1000 flex-1 min-w-0 truncate pr-2",
237
- "checkbox-button-text"
255
+ className: f(
256
+ "checkbox-button-text text-neutrals-1000 min-w-0 ml-2 flex-1 truncate pr-2"
238
257
  ),
239
258
  title: e,
240
259
  children: e
241
260
  }
242
- ),
261
+ ) : null,
243
262
  /* @__PURE__ */ r(
244
263
  "input",
245
264
  {
246
- type: "checkbox",
247
- onChange: a,
248
265
  id: t,
266
+ type: "checkbox",
249
267
  checked: n,
268
+ disabled: a,
269
+ onChange: m,
250
270
  className: "hidden"
251
271
  }
252
272
  )
253
273
  ]
254
274
  }
255
275
  );
256
- }, je = ({
276
+ }, xt = ({
257
277
  title: e,
258
278
  icon: t,
259
279
  children: n,
260
- value: l
280
+ value: s
261
281
  }) => {
262
- const [s, a] = A(!1);
282
+ const [l, a] = j(!1);
263
283
  return /* @__PURE__ */ o(
264
284
  "div",
265
285
  {
266
- className: `collapsible-block flex flex-col border-t-2 border-neutrals-600 ${s ? "collapsible-block-open" : ""}`,
286
+ className: `collapsible-block flex flex-col border-t-2 border-neutrals-600 ${l ? "collapsible-block-open" : ""}`,
267
287
  children: [
268
288
  /* @__PURE__ */ o(
269
289
  "div",
270
290
  {
271
291
  className: "collapsible-block-title flex cursor-pointer items-center py-4",
272
- onClick: () => a(!s),
292
+ onClick: () => a(!l),
273
293
  children: [
274
- /* @__PURE__ */ r("div", { className: `${s ? "rotate-180" : ""} transition-transform`, children: t || /* @__PURE__ */ r(te, { className: "w-5 h-5 mr-3" }) }),
294
+ /* @__PURE__ */ r("div", { className: `${l ? "rotate-180" : ""} transition-transform`, children: t || /* @__PURE__ */ r(he, { className: "w-5 h-5 mr-3" }) }),
275
295
  /* @__PURE__ */ o("div", { className: "flex flex-1 items-center justify-between", children: [
276
296
  /* @__PURE__ */ r("span", { children: e }),
277
- l && /* @__PURE__ */ r("p", { className: "body-1 text-neutrals-800", children: l })
297
+ s && /* @__PURE__ */ r("p", { className: "body-1 text-neutrals-800", children: s })
278
298
  ] })
279
299
  ]
280
300
  }
281
301
  ),
282
- s && /* @__PURE__ */ r("div", { className: "collapsible-block-content pb-4", children: n })
302
+ l && /* @__PURE__ */ r("div", { className: "collapsible-block-content pb-4", children: n })
283
303
  ]
284
304
  }
285
305
  );
286
- }, Ge = ({ text: e, highlightText: t }) => {
287
- const n = D(() => {
288
- const l = [];
306
+ }, bt = ({ text: e, highlightText: t }) => {
307
+ const n = W(() => {
308
+ const s = [];
289
309
  if (!t)
290
310
  return [{ id: 0, text: e, highlight: !1 }];
291
- const s = t?.toLowerCase() || "", a = e?.toLowerCase()?.split(s) || "";
292
- for (let c = 0, u = 0; c < a?.length; c++) {
293
- const d = a?.[c], h = d.length;
294
- d !== "" && l.push({
295
- id: l.length,
311
+ const l = t?.toLowerCase() || "", a = e?.toLowerCase()?.split(l) || "";
312
+ for (let d = 0, u = 0; d < a?.length; d++) {
313
+ const h = a?.[d], m = h.length;
314
+ h !== "" && s.push({
315
+ id: s.length,
296
316
  highlight: !1,
297
317
  text: e?.substring(
298
318
  u,
299
- u + h
319
+ u + m
300
320
  )
301
- }), u += h, c !== a?.length - 1 && (l.push({
302
- id: l.length,
321
+ }), u += m, d !== a?.length - 1 && (s.push({
322
+ id: s.length,
303
323
  highlight: !0,
304
324
  text: e?.substring(
305
325
  u,
@@ -307,97 +327,97 @@ const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
307
327
  )
308
328
  }), u += t.length);
309
329
  }
310
- return l;
330
+ return s;
311
331
  }, [t, e]);
312
- return /* @__PURE__ */ r(Y, { children: n.map((l) => /* @__PURE__ */ r(
332
+ return /* @__PURE__ */ r(H, { children: n.map((s) => /* @__PURE__ */ r(
313
333
  "span",
314
334
  {
315
- className: m(l?.highlight && "bg-highlight"),
316
- children: l?.text
335
+ className: f(s?.highlight && "bg-highlight"),
336
+ children: s?.text
317
337
  },
318
- l?.id
338
+ s?.id
319
339
  )) });
320
- }, $e = ({
340
+ }, Nt = ({
321
341
  icon: e,
322
342
  onClick: t,
323
343
  buttonClassName: n,
324
- disabled: l,
325
- title: s,
344
+ disabled: s,
345
+ title: l,
326
346
  isBaseIconStyles: a = !0
327
347
  }) => /* @__PURE__ */ r(
328
348
  "button",
329
349
  {
330
350
  type: "button",
331
- className: m(
351
+ className: f(
332
352
  a && "base-icon-button",
333
353
  n
334
354
  ),
335
- onClick: (c) => t?.(c),
336
- disabled: l,
337
- title: s,
355
+ onClick: (d) => t?.(d),
356
+ disabled: s,
357
+ title: l,
338
358
  "aria-label": "button",
339
359
  children: e
340
360
  }
341
- ), ge = ({
361
+ ), $e = ({
342
362
  value: e,
343
363
  inputId: t,
344
364
  placeholder: n = "",
345
- cssClass: l = "",
346
- type: s = "text",
365
+ cssClass: s = "",
366
+ type: l = "text",
347
367
  disabled: a,
348
- readonly: c,
368
+ readonly: d,
349
369
  onChange: u,
350
- onKeyDown: d
370
+ onKeyDown: h
351
371
  }) => {
352
- const h = m(
372
+ const m = f(
353
373
  "truncate outline-none shadow-none body-1",
354
- l,
355
- c ? "pointer-events-none" : ""
374
+ s,
375
+ d ? "pointer-events-none" : ""
356
376
  );
357
377
  return /* @__PURE__ */ r(
358
378
  "input",
359
379
  {
360
- type: s,
380
+ type: l,
361
381
  autoComplete: "off",
362
382
  id: t,
363
383
  placeholder: n,
364
384
  value: e || "",
365
385
  title: e ? String(e) : "",
366
386
  disabled: a,
367
- className: h,
368
- onKeyDown: d,
369
- onChange: (f) => u?.(f.currentTarget.value)
387
+ className: m,
388
+ onKeyDown: h,
389
+ onChange: (p) => u?.(p.currentTarget.value)
370
390
  }
371
391
  );
372
- }, He = ({
392
+ }, Ct = ({
373
393
  iconBeforeInput: e,
374
394
  iconAfterInput: t,
375
395
  containerClasses: n,
376
- cssClass: l,
377
- ...s
378
- }) => /* @__PURE__ */ o("div", { className: m("input w-full flex flex-row", n), children: [
396
+ cssClass: s,
397
+ ...l
398
+ }) => /* @__PURE__ */ o("div", { className: f("input w-full flex flex-row", n), children: [
379
399
  e,
380
400
  /* @__PURE__ */ r(
381
- ge,
401
+ $e,
382
402
  {
383
- cssClass: m(
403
+ cssClass: f(
384
404
  "border-0 bg-transparent p-0 h-full shadow-none flex-1 min-w-0 rounded-none",
385
- l
405
+ s
386
406
  ),
387
- ...s
407
+ ...l
388
408
  }
389
409
  ),
390
410
  t
391
- ] }), Be = ({
411
+ ] }), vt = ({
392
412
  url: e,
393
413
  title: t,
394
414
  linkClassName: n = "",
395
- iconBefore: l,
396
- iconAfter: s
415
+ iconBefore: s,
416
+ iconAfter: l
397
417
  }) => {
398
- const a = m(
399
- s ? "mr-2" : "",
400
- l ? "ml-2" : ""
418
+ const a = f(
419
+ l ? "mr-2" : "",
420
+ s ? "ml-2" : ""
401
421
  );
402
422
  return /* @__PURE__ */ o(
403
423
  "a",
@@ -405,37 +425,37 @@ const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
405
425
  href: e,
406
426
  target: "_blank",
407
427
  rel: "noopener noreferrer",
408
- className: m("base-link", n),
428
+ className: f("base-link", n),
409
429
  title: t,
410
430
  children: [
411
- l,
431
+ s,
412
432
  /* @__PURE__ */ r("span", { className: a, children: t }),
413
- s
433
+ l
414
434
  ]
415
435
  }
416
436
  );
417
- }, Ue = ({ title: e, text: t, disabled: n, onClick: l }) => /* @__PURE__ */ r(
437
+ }, yt = ({ title: e, text: t, disabled: n, onClick: s }) => /* @__PURE__ */ r(
418
438
  "button",
419
439
  {
420
440
  type: "button",
421
- className: m(
441
+ className: f(
422
442
  "tag flex items-center justify-center",
423
443
  "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-neutrals-100"
424
444
  ),
425
445
  disabled: n,
426
- onClick: () => l?.(t || e),
446
+ onClick: () => s?.(t || e),
427
447
  "aria-label": "button",
428
448
  children: /* @__PURE__ */ r("h4", { children: e })
429
449
  }
430
- ), We = ({
450
+ ), wt = ({
431
451
  label: e,
432
452
  id: t,
433
453
  checked: n,
434
- radioIcon: l,
435
- description: s,
454
+ radioIcon: s,
455
+ description: l,
436
456
  onChange: a
437
457
  }) => {
438
- const c = L(
458
+ const d = _(
439
459
  (u) => {
440
460
  u.stopPropagation(), a?.(t, u.target.checked);
441
461
  },
@@ -451,12 +471,12 @@ const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
451
471
  /* @__PURE__ */ r(
452
472
  "span",
453
473
  {
454
- className: m(
474
+ className: f(
455
475
  "flex justify-center items-center w-4 h-4 mr-2 relative",
456
476
  "radio-button",
457
477
  n ? "radio-button-active" : ""
458
478
  ),
459
- children: n && l
479
+ children: n && s
460
480
  }
461
481
  ),
462
482
  e && /* @__PURE__ */ r(
@@ -468,19 +488,19 @@ const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
468
488
  }
469
489
  )
470
490
  ] }),
471
- s && /* @__PURE__ */ r(
491
+ l && /* @__PURE__ */ r(
472
492
  "span",
473
493
  {
474
494
  className: "radio-description ml-6 text-neutrals-800 body-2 w-auto flex items-center",
475
- title: s,
476
- children: s
495
+ title: l,
496
+ children: l
477
497
  }
478
498
  ),
479
499
  /* @__PURE__ */ r(
480
500
  "input",
481
501
  {
482
502
  type: "radio",
483
- onChange: c,
503
+ onChange: d,
484
504
  id: t,
485
505
  checked: n,
486
506
  className: "hidden"
@@ -490,142 +510,142 @@ const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
490
510
  }
491
511
  );
492
512
  };
493
- var S = /* @__PURE__ */ ((e) => (e.Closed = "Closed", e.Opened = "Opened", e))(S || {}), T = /* @__PURE__ */ ((e) => (e.LG = "Large", e.SM = "Small", e))(T || {});
494
- const be = ({
513
+ var A = /* @__PURE__ */ ((e) => (e.Closed = "Closed", e.Opened = "Opened", e))(A || {}), $ = /* @__PURE__ */ ((e) => (e.LG = "Large", e.SM = "Small", e))($ || {});
514
+ const ze = ({
495
515
  portalId: e,
496
- state: t = S.Opened,
516
+ state: t = A.Opened,
497
517
  heading: n,
498
- size: l,
499
- onClose: s,
518
+ size: s,
519
+ onClose: l,
500
520
  children: a,
501
- overlayClassName: c,
521
+ overlayClassName: d,
502
522
  containerClassName: u,
503
- dividers: d = !0,
504
- closeButtonTitle: h
523
+ dividers: h = !0,
524
+ closeButtonTitle: m
505
525
  }) => {
506
- const { refs: f, context: g } = $({
507
- open: t !== S.Closed && !!t,
508
- onOpenChange: s
509
- }), N = le(g, { role: "dialog" }), x = H(g, { outsidePress: !0 }), { getFloatingProps: E } = B([N, x]), b = L(
510
- (i) => {
511
- i?.preventDefault(), i?.stopPropagation(), s();
526
+ const { refs: p, context: x } = X({
527
+ open: t !== A.Closed && !!t,
528
+ onOpenChange: l
529
+ }), w = xe(x, { role: "dialog" }), b = Z(x, { outsidePress: !0 }), { getFloatingProps: N } = J([w, b]), g = _(
530
+ (c) => {
531
+ c?.preventDefault(), c?.stopPropagation(), l();
512
532
  },
513
- [s]
533
+ [l]
514
534
  );
515
- return /* @__PURE__ */ r(se, { id: e, children: t !== S.Closed && /* @__PURE__ */ r(
516
- ae,
535
+ return /* @__PURE__ */ r(be, { id: e, children: t !== A.Closed && /* @__PURE__ */ r(
536
+ Ne,
517
537
  {
518
- className: m(
538
+ className: f(
519
539
  "z-modal flex items-center justify-center bg-blackout p-4",
520
- c
540
+ d
521
541
  ),
522
- children: /* @__PURE__ */ r(oe, { context: g, children: /* @__PURE__ */ o(
542
+ children: /* @__PURE__ */ r(Ce, { context: x, children: /* @__PURE__ */ o(
523
543
  "div",
524
544
  {
525
- className: m(
545
+ className: f(
526
546
  "relative max-h-full modal rounded bg-white flex flex-col shadow w-full",
527
- l === T.LG && "max-w-[65%]",
528
- l === T.SM && "max-w-[30%]",
529
- d && "divide-neutrals-400 divide-y",
547
+ s === $.LG && "max-w-[65%]",
548
+ s === $.SM && "max-w-[30%]",
549
+ h && "divide-neutrals-400 divide-y",
530
550
  u,
531
551
  "sm:w-full sm:max-w-full sm:px-4 sm:py-6"
532
552
  ),
533
- ref: f.setFloating,
534
- ...E({
535
- onClick(i) {
536
- i.stopPropagation();
553
+ ref: p.setFloating,
554
+ ...N({
555
+ onClick(c) {
556
+ c.stopPropagation();
537
557
  }
538
558
  }),
539
559
  children: [
540
560
  /* @__PURE__ */ o("div", { className: "flex flex-row justify-between py-3 px-6 items-center mb-2 modal-heading sm:p-0 sm:pb-2", children: [
541
561
  n && (typeof n == "string" ? /* @__PURE__ */ r("h2", { className: "flex-1 min-w-0 mr-3 modal-heading-title sm:h3", children: n }) : n),
542
562
  /* @__PURE__ */ r(
543
- W,
563
+ te,
544
564
  {
545
- title: h,
546
- onClick: b,
565
+ title: m,
566
+ onClick: g,
547
567
  btnClassNames: "sm:h-[24px] sm:w-[24px] sm:top-4"
548
568
  }
549
569
  )
550
570
  ] }),
551
- a.map((i) => i)
571
+ a.map((c) => c)
552
572
  ]
553
573
  }
554
574
  ) })
555
575
  }
556
576
  ) });
557
- }, qe = (e) => e.state === S.Closed ? null : /* @__PURE__ */ r(be, { ...e }), Qe = ({
577
+ }, Et = (e) => e.state === A.Closed ? null : /* @__PURE__ */ r(ze, { ...e }), St = ({
558
578
  triggerButton: e,
559
579
  options: t,
560
580
  content: n,
561
- selectedOption: l,
562
- disabled: s,
581
+ selectedOption: s,
582
+ disabled: l,
563
583
  containerClassName: a,
564
- openedClassName: c,
584
+ openedClassName: d,
565
585
  onOptionSelect: u
566
586
  }) => {
567
- const [d, h] = A(!1), { refs: f, floatingStyles: g, context: N } = $({
568
- open: d,
569
- onOpenChange: s ? void 0 : h,
587
+ const [h, m] = j(!1), { refs: p, floatingStyles: x, context: w } = X({
588
+ open: h,
589
+ onOpenChange: l ? void 0 : m,
570
590
  placement: "bottom-end",
571
- middleware: [ie(8), de(), ue()],
572
- whileElementsMounted: ce
573
- }), x = me(N), E = H(N, { outsidePress: !0 }), { getReferenceProps: b, getFloatingProps: i } = B([
574
- x,
575
- E
591
+ middleware: [ye(8), we(), Ee()],
592
+ whileElementsMounted: ve
593
+ }), b = Se(w), N = Z(w, { outsidePress: !0 }), { getReferenceProps: g, getFloatingProps: c } = J([
594
+ b,
595
+ N
576
596
  ]);
577
- return /* @__PURE__ */ o(Y, { children: [
597
+ return /* @__PURE__ */ o(H, { children: [
578
598
  /* @__PURE__ */ r(
579
599
  "div",
580
600
  {
581
- ref: f.setReference,
582
- ...b({
583
- onClick(p) {
584
- p.stopPropagation();
601
+ ref: p.setReference,
602
+ ...g({
603
+ onClick(i) {
604
+ i.stopPropagation();
585
605
  }
586
606
  }),
587
- className: m(a, d && c),
607
+ className: f(a, h && d),
588
608
  children: e
589
609
  }
590
610
  ),
591
- d && /* @__PURE__ */ o(
611
+ h && /* @__PURE__ */ o(
592
612
  "div",
593
613
  {
594
- ref: f.setFloating,
595
- style: g,
614
+ ref: p.setFloating,
615
+ style: x,
596
616
  className: "flex flex-col z-10 dropdown-menu-shadow bg-white dropdown-container rounded",
597
- ...i(),
617
+ ...c(),
598
618
  children: [
599
619
  n && n,
600
- t && t.map((p) => /* @__PURE__ */ r(
620
+ t && t.map((i) => /* @__PURE__ */ r(
601
621
  "div",
602
622
  {
603
- onClick: (w) => {
604
- w.stopPropagation(), u?.(p.key), h(!1);
623
+ onClick: (v) => {
624
+ v.stopPropagation(), u?.(i.key), m(!1);
605
625
  },
606
- className: m(
626
+ className: f(
607
627
  "text-neutrals-900 body-3 cursor-pointer dropdown-item min-w-[200px]",
608
- l === p.key && "bg-hues-100"
628
+ s === i.key && "bg-hues-100"
609
629
  ),
610
630
  children: /* @__PURE__ */ o(
611
631
  "div",
612
632
  {
613
633
  className: "p-2 hover:bg-hues-100 h-full dropdown-item-text flex items-center gap-x-2",
614
- title: p.title,
634
+ title: i.title,
615
635
  children: [
616
- p.icon ? p.icon : null,
617
- /* @__PURE__ */ r("p", { children: p?.title })
636
+ i.icon ? i.icon : null,
637
+ /* @__PURE__ */ r("p", { children: i?.title })
618
638
  ]
619
639
  }
620
640
  )
621
641
  },
622
- p.key
642
+ i.key
623
643
  ))
624
644
  ]
625
645
  }
626
646
  )
627
647
  ] });
628
- }, Ve = ({ limitMessages: e, query: t }) => /* @__PURE__ */ o("div", { className: "bg-hues-100 px-2 py-1 flex justify-between flex-wrap items-center", children: [
648
+ }, It = ({ limitMessages: e, query: t }) => /* @__PURE__ */ o("div", { className: "bg-hues-100 px-2 py-1 flex justify-between flex-wrap items-center", children: [
629
649
  /* @__PURE__ */ r("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ r("div", { className: "flex flex-col", children: /* @__PURE__ */ o("div", { className: "flex gap-x-[4px]", children: [
630
650
  /* @__PURE__ */ o("span", { className: "text-primary h5", children: [
631
651
  e?.excelFormatTitle,
@@ -637,16 +657,16 @@ const be = ({
637
657
  e?.dataExplorerIcon,
638
658
  e?.dataExplorer
639
659
  ] }) })
640
- ] }), ze = ({
660
+ ] }), kt = ({
641
661
  limitMessages: e,
642
662
  isDownload: t,
643
663
  showAdvancedViewButton: n,
644
- onAdvancedViewClick: l,
645
- query: s
664
+ onAdvancedViewClick: s,
665
+ query: l
646
666
  }) => /* @__PURE__ */ o(
647
667
  "div",
648
668
  {
649
- className: m(
669
+ className: f(
650
670
  "bg-semantic-warning-light px-2 py-1 flex justify-between flex-wrap items-center",
651
671
  e?.containerClassName
652
672
  ),
@@ -658,7 +678,7 @@ const be = ({
658
678
  /* @__PURE__ */ o(
659
679
  "span",
660
680
  {
661
- className: m(
681
+ className: f(
662
682
  "text-primary h5",
663
683
  e?.largeQueryClassName
664
684
  ),
@@ -672,18 +692,18 @@ const be = ({
672
692
  /* @__PURE__ */ r(
673
693
  "span",
674
694
  {
675
- className: m(
695
+ className: f(
676
696
  "text-neutrals-800 body-3",
677
697
  e?.limitMessageClassName
678
698
  ),
679
- children: t ? e?.downloadMessage?.(M) : e?.showingLimit?.(M)
699
+ children: t ? e?.downloadMessage?.(q) : e?.showingLimit?.(q)
680
700
  }
681
701
  )
682
702
  ] }),
683
703
  t && /* @__PURE__ */ r(
684
704
  "span",
685
705
  {
686
- className: m(
706
+ className: f(
687
707
  "text-neutrals-800 body-3",
688
708
  e?.limitMessageClassName
689
709
  ),
@@ -695,7 +715,7 @@ const be = ({
695
715
  n && /* @__PURE__ */ o(
696
716
  "span",
697
717
  {
698
- onClick: () => l?.(),
718
+ onClick: () => s?.(),
699
719
  className: "flex gap-x-[4px] h4 cursor-pointer items-center text-primary",
700
720
  children: [
701
721
  e?.editIcon,
@@ -703,93 +723,465 @@ const be = ({
703
723
  ]
704
724
  }
705
725
  ),
706
- t && /* @__PURE__ */ r("a", { href: s || "", target: "_blank", children: /* @__PURE__ */ o("span", { className: "flex gap-x-[4px] body-3 cursor-pointer items-center", children: [
726
+ t && /* @__PURE__ */ r("a", { href: l || "", target: "_blank", children: /* @__PURE__ */ o("span", { className: "flex gap-x-[4px] body-3 cursor-pointer items-center", children: [
707
727
  e?.dataExplorerIcon,
708
728
  e?.dataExplorer
709
729
  ] }) })
710
730
  ]
711
731
  }
712
- ), q = j(null);
713
- function Xe({
732
+ ), re = U(null);
733
+ function Dt({
714
734
  value: e,
715
735
  children: t
716
736
  }) {
717
- const n = D(() => e ?? {}, [e]);
718
- return /* @__PURE__ */ r(q.Provider, { value: n, children: t });
737
+ const n = W(() => e ?? {}, [e]);
738
+ return /* @__PURE__ */ r(re.Provider, { value: n, children: t });
719
739
  }
720
- function Ne() {
721
- return G(q);
740
+ function Be() {
741
+ return V(re);
722
742
  }
723
- var I = /* @__PURE__ */ ((e) => (e.Info = "info", e.Error = "error", e.Warning = "warning", e))(I || {});
724
- const we = {
725
- [I.Info]: "border-neutrals-800 bg-neutrals-300 text-neutrals-1000",
726
- [I.Error]: "border-semantic-error bg-semantic-error-light text-neutrals-1000",
727
- [I.Warning]: "border-semantic-warning bg-semantic-warning-light text-neutrals-1000"
728
- }, Ce = "shrink-0", ye = "min-w-0 body-2", ve = "flex items-start gap-2 min-w-0 border-l-2 rounded py-2 px-4 items-center";
729
- function Ze({
743
+ var P = /* @__PURE__ */ ((e) => (e.Info = "info", e.Error = "error", e.Warning = "warning", e))(P || {});
744
+ const We = {
745
+ [P.Info]: "border-neutrals-800 bg-neutrals-300 text-neutrals-1000",
746
+ [P.Error]: "border-semantic-error bg-semantic-error-light text-neutrals-1000",
747
+ [P.Warning]: "border-semantic-warning bg-semantic-warning-light text-neutrals-1000"
748
+ }, qe = "shrink-0", He = "min-w-0 body-2", Ue = "flex items-start gap-2 min-w-0 border-l-2 rounded py-2 px-4 items-center";
749
+ function Lt({
730
750
  type: e,
731
751
  icon: t,
732
752
  children: n,
733
- className: l,
734
- contentClassName: s
753
+ className: s,
754
+ contentClassName: l
735
755
  }) {
736
- const a = Ne(), c = t ?? a?.icons?.[e], u = a?.classes?.container ?? ve, d = a?.classes?.types?.[e] ?? we[e], h = v(u, d, l), f = v(Ce, a?.classes?.icon), g = v(
737
- ye,
756
+ const a = Be(), d = t ?? a?.icons?.[e], u = a?.classes?.container ?? Ue, h = a?.classes?.types?.[e] ?? We[e], m = L(u, h, s), p = L(qe, a?.classes?.icon), x = L(
757
+ He,
738
758
  a?.classes?.content,
739
- s
759
+ l
740
760
  );
741
- return /* @__PURE__ */ o("div", { "data-type": e, className: h, children: [
742
- c ? /* @__PURE__ */ r("span", { className: f, children: c }) : null,
743
- n ? /* @__PURE__ */ r("div", { className: g, children: n }) : null
761
+ return /* @__PURE__ */ o("div", { "data-type": e, className: m, children: [
762
+ d ? /* @__PURE__ */ r("span", { className: p, children: d }) : null,
763
+ n ? /* @__PURE__ */ r("div", { className: x, children: n }) : null
744
764
  ] });
745
765
  }
746
- const Je = ({
766
+ const Rt = ({
747
767
  title: e,
748
768
  copiedTitle: t,
749
769
  tooltip: n,
750
- icon: l,
751
- copiedIcon: s,
770
+ icon: s,
771
+ copiedIcon: l,
752
772
  className: a,
753
- buttonTextClassName: c,
773
+ buttonTextClassName: d,
754
774
  onClick: u
755
775
  }) => {
756
- const [d, h] = A(!1), f = P(null), g = () => {
757
- u(), h(!0), f.current && clearTimeout(f.current), f.current = setTimeout(() => {
758
- h(!1);
776
+ const [h, m] = j(!1), p = B(null), x = () => {
777
+ u(), m(!0), p.current && clearTimeout(p.current), p.current = setTimeout(() => {
778
+ m(!1);
759
779
  }, 1e3);
760
780
  };
761
- return _(() => () => {
762
- f.current && clearTimeout(f.current);
781
+ return M(() => () => {
782
+ p.current && clearTimeout(p.current);
763
783
  }, []), /* @__PURE__ */ o("div", { className: "relative w-fit", children: [
764
784
  /* @__PURE__ */ r(
765
- pe,
785
+ je,
766
786
  {
767
- title: d ? t : e,
787
+ title: h ? t : e,
768
788
  isSmallButton: !0,
769
- disabled: d,
770
- buttonClassName: v([
789
+ disabled: h,
790
+ buttonClassName: L([
771
791
  "text-button-tertiary small-icon-button !h-6 !p-0",
772
792
  a
773
793
  ]),
774
- textClassName: v(["ml-1", c]),
775
- onClick: g,
776
- iconBefore: d ? s : l
794
+ textClassName: L(["ml-1", d]),
795
+ onClick: x,
796
+ iconBefore: h ? l : s
777
797
  }
778
798
  ),
779
- n && d && /* @__PURE__ */ r("div", { className: "absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2 whitespace-nowrap rounded border border-neutrals-400 bg-white px-3 py-4 text-neutrals-900 h4 shadow", children: n })
799
+ n && h && /* @__PURE__ */ r("div", { className: "absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2 whitespace-nowrap rounded border border-neutrals-400 bg-white px-3 py-4 text-neutrals-900 h4 shadow", children: n })
780
800
  ] });
781
801
  };
782
- var Ee = /* @__PURE__ */ ((e) => (e.Enter = "Enter", e))(Ee || {});
783
- const Q = j(null);
802
+ function Ve({
803
+ id: e,
804
+ label: t,
805
+ hasChildren: n,
806
+ showDragHandle: s,
807
+ showCheckbox: l,
808
+ isChecked: a,
809
+ isExpanded: d
810
+ }) {
811
+ return /* @__PURE__ */ o("div", { className: "rounded bg-neutrals-200 shadow cursor-grabbing relative", children: [
812
+ /* @__PURE__ */ r("div", { className: "absolute -left-[0.5px] top-0.5 w-0.5 h-5 rounded-full bg-gradients-light" }),
813
+ /* @__PURE__ */ o("div", { className: "flex items-stretch overflow-hidden rounded", children: [
814
+ s ? /* @__PURE__ */ r("div", { className: "flex w-6 items-center justify-center", children: /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "rounded p-1", children: /* @__PURE__ */ r(Q, { size: 16 }) }) }) : null,
815
+ /* @__PURE__ */ o("div", { className: "flex min-w-0 flex-1 items-center gap-2 p-1", children: [
816
+ l ? /* @__PURE__ */ r(ne, { id: e, checked: !!a, className: "p-0" }) : null,
817
+ /* @__PURE__ */ r("span", { className: "truncate body-3", children: t })
818
+ ] }),
819
+ n ? /* @__PURE__ */ r("div", { className: "flex w-8 items-center justify-center", children: /* @__PURE__ */ r(
820
+ "span",
821
+ {
822
+ "aria-hidden": !0,
823
+ className: f(
824
+ "transition-transform",
825
+ d ? "rotate-90" : "rotate-0"
826
+ ),
827
+ children: /* @__PURE__ */ r(K, { size: 16 })
828
+ }
829
+ ) }) : null
830
+ ] })
831
+ ] });
832
+ }
833
+ function se(e, t) {
834
+ return `i:${[...e, t].join("/")}`;
835
+ }
836
+ function G(e) {
837
+ if (!e.startsWith("i:")) return null;
838
+ const n = e.slice(2).split("/").filter(Boolean);
839
+ return n.length ? {
840
+ parentPath: n.slice(0, -1),
841
+ itemId: n[n.length - 1]
842
+ } : null;
843
+ }
844
+ function Qe(e, t, n) {
845
+ const s = ae(e, t);
846
+ return s ? s.find((l) => l.id === n) ?? null : null;
847
+ }
848
+ function le(e, t) {
849
+ if (t.length === 0) return e;
850
+ const [n, ...s] = t, l = e.find((a) => a.id === n);
851
+ return l?.items ? le(l.items, s) : null;
852
+ }
853
+ function ae(e, t) {
854
+ const n = le(e, t);
855
+ return n ? n.filter(
856
+ (s) => s.type === "item"
857
+ ) : null;
858
+ }
859
+ function ie(e, t, n) {
860
+ if (t.length === 0)
861
+ return n(e);
862
+ const [s, ...l] = t;
863
+ return e.map((a) => a.id !== s || !a.items ? a : {
864
+ ...a,
865
+ items: ie(a.items, l, n)
866
+ });
867
+ }
784
868
  function Ke({
869
+ parentPath: e,
870
+ item: t,
871
+ showDragHandle: n,
872
+ showCheckbox: s,
873
+ renderLabel: l,
874
+ onItemClick: a,
875
+ onToggleExpanded: d,
876
+ onToggleChecked: u
877
+ }) {
878
+ const h = !!t.items?.length, m = !!t.isExpanded, p = t.isDisabled ? !1 : t.draggable ?? !0, x = t.isDisabled ? !1 : t.checkable ?? !0, w = se(e, t.id), {
879
+ attributes: b,
880
+ listeners: N,
881
+ setNodeRef: g,
882
+ setActivatorNodeRef: c,
883
+ transform: i,
884
+ transition: v,
885
+ isDragging: S
886
+ } = Oe({ id: w, disabled: !p }), E = {
887
+ transform: Te.Transform.toString(i),
888
+ transition: v,
889
+ opacity: S ? 0.6 : void 0
890
+ }, y = !!t.isDisabled, C = [...e, t.id];
891
+ return /* @__PURE__ */ o(
892
+ "div",
893
+ {
894
+ ref: g,
895
+ style: E,
896
+ className: f([
897
+ "group flex items-stretch overflow-hidden rounded bg-white",
898
+ "select-none",
899
+ y ? "opacity-50" : ""
900
+ ]),
901
+ children: [
902
+ n ? /* @__PURE__ */ r(
903
+ "div",
904
+ {
905
+ className: f([
906
+ "group/drag-handle flex w-6 items-center justify-center rounded",
907
+ y ? "" : "hover:bg-neutrals-100 cursor-grab"
908
+ ]),
909
+ children: /* @__PURE__ */ r(
910
+ "span",
911
+ {
912
+ ref: c,
913
+ "aria-hidden": !0,
914
+ className: f([
915
+ "rounded p-1",
916
+ p ? "cursor-grab" : "cursor-default",
917
+ "transition-opacity"
918
+ ]),
919
+ ...p ? N : {},
920
+ ...p ? b : {},
921
+ children: /* @__PURE__ */ r(
922
+ Q,
923
+ {
924
+ size: 16,
925
+ className: "text-neutrals-800 group-hover/drag-handle:text-primary"
926
+ }
927
+ )
928
+ }
929
+ )
930
+ }
931
+ ) : null,
932
+ /* @__PURE__ */ o(
933
+ "button",
934
+ {
935
+ type: "button",
936
+ disabled: y,
937
+ onClick: (k) => a?.({
938
+ itemId: t.id,
939
+ path: C,
940
+ nativeEvent: k
941
+ }),
942
+ className: f([
943
+ "flex min-w-0 flex-1 items-center gap-2 p-1 text-left rounded",
944
+ y ? "" : "hover:bg-neutrals-100",
945
+ y ? "" : "hover:text-blue-700",
946
+ "focus:outline-none"
947
+ ]),
948
+ children: [
949
+ s ? /* @__PURE__ */ r(
950
+ ne,
951
+ {
952
+ id: `draggable-list-${C.join("-")}`,
953
+ checked: !!t.isChecked,
954
+ disabled: !x,
955
+ className: "p-0",
956
+ stopPropagation: !0,
957
+ onChange: (k, D) => u?.({
958
+ itemId: t.id,
959
+ path: C,
960
+ nextChecked: !!D
961
+ })
962
+ }
963
+ ) : null,
964
+ /* @__PURE__ */ r("span", { className: "truncate body-3 text-neutrals-800", children: l ? l(t) : t.label })
965
+ ]
966
+ }
967
+ ),
968
+ h ? /* @__PURE__ */ r(
969
+ "button",
970
+ {
971
+ type: "button",
972
+ disabled: y,
973
+ onClick: (k) => {
974
+ k.stopPropagation(), d?.({
975
+ itemId: t.id,
976
+ path: C,
977
+ nextExpanded: !m
978
+ });
979
+ },
980
+ "aria-label": m ? "Collapse" : "Expand",
981
+ className: f([
982
+ "flex w-8 items-center justify-center rounded",
983
+ y ? "" : "hover:bg-neutrals-100",
984
+ "focus:outline-none"
985
+ ]),
986
+ children: /* @__PURE__ */ r(
987
+ "span",
988
+ {
989
+ "aria-hidden": !0,
990
+ className: f(
991
+ "transition-transform duration-150 ease-out",
992
+ m ? "rotate-90" : "rotate-0"
993
+ ),
994
+ children: /* @__PURE__ */ r(K, { size: 16 })
995
+ }
996
+ )
997
+ }
998
+ ) : null
999
+ ]
1000
+ }
1001
+ );
1002
+ }
1003
+ function Ft({
1004
+ items: e,
1005
+ showDragHandle: t = !0,
1006
+ showCheckbox: n = !0,
1007
+ onItemsChange: s,
1008
+ onToggleExpanded: l,
1009
+ onToggleChecked: a,
1010
+ onItemClick: d,
1011
+ renderLabel: u
1012
+ }) {
1013
+ const h = Ie(
1014
+ ke(De, { activationConstraint: { distance: 6 } })
1015
+ ), [m, p] = oe.useState(null), x = (N) => {
1016
+ const g = String(N.active.id), c = G(g);
1017
+ if (!c) return;
1018
+ const i = Qe(e, c.parentPath, c.itemId);
1019
+ !i || i.type !== "item" || p({
1020
+ id: g,
1021
+ label: i.label,
1022
+ hasChildren: !!i.items?.length,
1023
+ isChecked: i.isChecked,
1024
+ isExpanded: i.isExpanded
1025
+ });
1026
+ }, w = (N) => {
1027
+ p(null);
1028
+ const g = N.over;
1029
+ if (!g) return;
1030
+ const c = G(String(N.active.id)), i = G(String(g.id));
1031
+ if (!c || !i || c.parentPath.join("/") !== i.parentPath.join("/")) return;
1032
+ const v = ae(e, c.parentPath);
1033
+ if (!v) return;
1034
+ const S = v.findIndex((C) => C.id === c.itemId), E = v.findIndex((C) => C.id === i.itemId);
1035
+ if (S === -1 || E === -1 || S === E) return;
1036
+ const y = ie(e, c.parentPath, (C) => {
1037
+ const k = C.filter(
1038
+ (R) => R.type === "item"
1039
+ ), D = Pe(k, S, E);
1040
+ let I = 0;
1041
+ return C.map((R) => {
1042
+ if (R.type !== "item") return R;
1043
+ const Y = D[I];
1044
+ return I += 1, Y;
1045
+ });
1046
+ });
1047
+ s(y);
1048
+ }, b = (N, g = []) => {
1049
+ const c = N.filter((i) => i.type === "item").map((i) => se(g, i.id));
1050
+ return /* @__PURE__ */ r(
1051
+ Ae,
1052
+ {
1053
+ items: c,
1054
+ strategy: _e,
1055
+ children: /* @__PURE__ */ r("ul", { className: "m-0 flex list-none flex-col gap-2 p-0", children: N.map((i) => i.type === "group" ? /* @__PURE__ */ o(
1056
+ "li",
1057
+ {
1058
+ className: "m-0 mt-2 first:mt-0 flex flex-col gap-2 p-0",
1059
+ children: [
1060
+ /* @__PURE__ */ o("div", { className: "text-neutrals-1000 h5 flex items-center gap-2 py-1", children: [
1061
+ /* @__PURE__ */ r(fe, { size: 12, className: "shrink-0" }),
1062
+ i.label
1063
+ ] }),
1064
+ /* @__PURE__ */ r("div", { className: "pl-2 border-l border-neutrals-600", children: b(i.items, [...g, i.id]) })
1065
+ ]
1066
+ },
1067
+ i.id
1068
+ ) : /* @__PURE__ */ o("li", { className: "m-0 flex flex-col gap-2 p-0", children: [
1069
+ /* @__PURE__ */ r(
1070
+ Ke,
1071
+ {
1072
+ parentPath: g,
1073
+ item: i,
1074
+ showDragHandle: t,
1075
+ showCheckbox: n,
1076
+ renderLabel: u,
1077
+ onItemClick: d,
1078
+ onToggleExpanded: l,
1079
+ onToggleChecked: a
1080
+ }
1081
+ ),
1082
+ i.items?.length && i.isExpanded ? /* @__PURE__ */ r("div", { className: "pl-7", children: b(i.items, [...g, i.id]) }) : null
1083
+ ] }, i.id)) })
1084
+ }
1085
+ );
1086
+ };
1087
+ return /* @__PURE__ */ o(
1088
+ Le,
1089
+ {
1090
+ sensors: h,
1091
+ collisionDetection: Re,
1092
+ onDragStart: x,
1093
+ onDragEnd: w,
1094
+ children: [
1095
+ /* @__PURE__ */ r("div", { className: "flex flex-col", children: b(e) }),
1096
+ /* @__PURE__ */ r(Fe, { children: m ? /* @__PURE__ */ r(
1097
+ Ve,
1098
+ {
1099
+ id: m.id,
1100
+ label: m.label,
1101
+ hasChildren: m.hasChildren,
1102
+ showDragHandle: t,
1103
+ showCheckbox: n,
1104
+ isChecked: m.isChecked,
1105
+ isExpanded: m.isExpanded
1106
+ }
1107
+ ) : null })
1108
+ ]
1109
+ }
1110
+ );
1111
+ }
1112
+ const Xe = (e, t) => e.label.toLowerCase().includes(t);
1113
+ function Ot(e, t, n = {}) {
1114
+ const s = Je(t);
1115
+ if (!s)
1116
+ return e;
1117
+ const {
1118
+ expandMatchedBranches: l = !0,
1119
+ includeGroupDescendantsOnMatch: a = !0,
1120
+ includeItemDescendantsOnMatch: d = !1,
1121
+ match: u = Xe
1122
+ } = n;
1123
+ return z(e, s, {
1124
+ expandMatchedBranches: l,
1125
+ includeGroupDescendantsOnMatch: a,
1126
+ includeItemDescendantsOnMatch: d,
1127
+ match: u
1128
+ }) ?? [];
1129
+ }
1130
+ function z(e, t, n) {
1131
+ const s = [];
1132
+ for (const l of e) {
1133
+ const a = Ze(l, t, n);
1134
+ a && s.push(a);
1135
+ }
1136
+ return s.length ? s : null;
1137
+ }
1138
+ function Ze(e, t, n) {
1139
+ const s = n.match(e, t);
1140
+ if (e.type === "group") {
1141
+ if (s && n.includeGroupDescendantsOnMatch)
1142
+ return T(e, n.expandMatchedBranches);
1143
+ const d = e.items?.length ? z(e.items, t, n) : null;
1144
+ return !s && !d ? null : {
1145
+ ...e,
1146
+ items: d ?? []
1147
+ };
1148
+ }
1149
+ const l = e.items?.length ? z(e.items, t, n) : null;
1150
+ if (s && n.includeItemDescendantsOnMatch)
1151
+ return T(e, n.expandMatchedBranches);
1152
+ if (!s && !l)
1153
+ return null;
1154
+ const a = {
1155
+ ...e
1156
+ };
1157
+ return l ? (a.items = l, n.expandMatchedBranches && (a.isExpanded = !0)) : delete a.items, a;
1158
+ }
1159
+ function T(e, t) {
1160
+ return e.type === "group" ? {
1161
+ ...e,
1162
+ items: e.items.map(
1163
+ (n) => T(n, t)
1164
+ )
1165
+ } : {
1166
+ ...e,
1167
+ isExpanded: t && e.items?.length ? !0 : e.isExpanded,
1168
+ items: e.items?.map((n) => T(n, t))
1169
+ };
1170
+ }
1171
+ function Je(e) {
1172
+ return e.trim().toLowerCase();
1173
+ }
1174
+ var et = /* @__PURE__ */ ((e) => (e.Enter = "Enter", e))(et || {});
1175
+ const ce = U(null);
1176
+ function At({
785
1177
  children: e,
786
1178
  isAgentAvailable: t
787
1179
  }) {
788
- const n = D(() => ({ isAgentAvailable: t }), [t]);
789
- return /* @__PURE__ */ r(Q.Provider, { value: n, children: e });
1180
+ const n = W(() => ({ isAgentAvailable: t }), [t]);
1181
+ return /* @__PURE__ */ r(ce.Provider, { value: n, children: e });
790
1182
  }
791
- function et() {
792
- const e = G(Q);
1183
+ function _t() {
1184
+ const e = V(ce);
793
1185
  if (!e)
794
1186
  throw new Error(
795
1187
  "useAgentAvailability must be used within AgentAvailabilityProvider"
@@ -797,38 +1189,40 @@ function et() {
797
1189
  return e;
798
1190
  }
799
1191
  export {
800
- Ke as AgentAvailabilityProvider,
801
- Oe as Alert,
802
- y as AlertType,
803
- pe as Button,
804
- xe as CALENDAR_MOBILE_PADDING,
805
- Me as Calendar,
806
- Ye as Checkbox,
807
- W as CloseButton,
808
- je as CollapsibleBlock,
809
- Je as CopyButton,
810
- Ve as DownloadFormatMessage,
811
- Qe as Dropdown,
812
- Ge as HighlightText,
813
- $e as IconButton,
814
- Ze as InlineAlert,
815
- Xe as InlineAlertProvider,
816
- I as InlineAlertType,
817
- ge as Input,
818
- He as InputWithIcon,
819
- Ee as KeyboardKey,
820
- Be as Link,
821
- U as Loader,
822
- T as PopUpSize,
823
- S as PopUpState,
824
- qe as Popup,
825
- We as Radio,
826
- ze as RequestLimitMessage,
827
- M as SERIES_LIMIT,
828
- Pe as TREE_NODE_ARROW_SIZE,
829
- De as TREE_NODE_PADDING,
830
- Ue as Tag,
831
- et as useAgentAvailability,
832
- Te as useDebounce,
833
- fe as useIsMobile
1192
+ At as AgentAvailabilityProvider,
1193
+ mt as Alert,
1194
+ F as AlertType,
1195
+ je as Button,
1196
+ Ge as CALENDAR_MOBILE_PADDING,
1197
+ gt as Calendar,
1198
+ ne as Checkbox,
1199
+ te as CloseButton,
1200
+ xt as CollapsibleBlock,
1201
+ Rt as CopyButton,
1202
+ It as DownloadFormatMessage,
1203
+ Ft as DraggableList,
1204
+ St as Dropdown,
1205
+ bt as HighlightText,
1206
+ Nt as IconButton,
1207
+ Lt as InlineAlert,
1208
+ Dt as InlineAlertProvider,
1209
+ P as InlineAlertType,
1210
+ $e as Input,
1211
+ Ct as InputWithIcon,
1212
+ et as KeyboardKey,
1213
+ vt as Link,
1214
+ ee as Loader,
1215
+ $ as PopUpSize,
1216
+ A as PopUpState,
1217
+ Et as Popup,
1218
+ wt as Radio,
1219
+ kt as RequestLimitMessage,
1220
+ q as SERIES_LIMIT,
1221
+ ft as TREE_NODE_ARROW_SIZE,
1222
+ pt as TREE_NODE_PADDING,
1223
+ yt as Tag,
1224
+ Ot as filterDraggableListNodes,
1225
+ _t as useAgentAvailability,
1226
+ ht as useDebounce,
1227
+ Ye as useIsMobile
834
1228
  };