@epam/statgpt-ui-components 0.3.0-rc.9 → 0.3.1

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, C = 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
- C === p.getFullYear() && z.classList.add(F), C === i.getFullYear() && X.classList.add(F), (C === i.getFullYear() || C === p.getFullYear()) && V.forEach((O) => {
169
- O.classList.remove(F);
170
- const w = new Date(O.getAttribute("aria-label")), Z = w.getFullYear() === i.getFullYear() && w.getMonth() === i.getMonth(), J = w.getFullYear() === p.getFullYear() && w.getMonth() === p.getMonth();
171
- Z || J || (w < i || w > 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,33 +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, onClick: n }) => /* @__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: "tag flex items-center justify-center",
422
- onClick: () => n?.(t || e),
441
+ className: f(
442
+ "tag flex items-center justify-center",
443
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-neutrals-100"
444
+ ),
445
+ disabled: n,
446
+ onClick: () => s?.(t || e),
423
447
  "aria-label": "button",
424
448
  children: /* @__PURE__ */ r("h4", { children: e })
425
449
  }
426
- ), We = ({
450
+ ), wt = ({
427
451
  label: e,
428
452
  id: t,
429
453
  checked: n,
430
- radioIcon: l,
431
- description: s,
454
+ radioIcon: s,
455
+ description: l,
432
456
  onChange: a
433
457
  }) => {
434
- const c = L(
458
+ const d = _(
435
459
  (u) => {
436
460
  u.stopPropagation(), a?.(t, u.target.checked);
437
461
  },
@@ -447,12 +471,12 @@ const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
447
471
  /* @__PURE__ */ r(
448
472
  "span",
449
473
  {
450
- className: m(
474
+ className: f(
451
475
  "flex justify-center items-center w-4 h-4 mr-2 relative",
452
476
  "radio-button",
453
477
  n ? "radio-button-active" : ""
454
478
  ),
455
- children: n && l
479
+ children: n && s
456
480
  }
457
481
  ),
458
482
  e && /* @__PURE__ */ r(
@@ -464,19 +488,19 @@ const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
464
488
  }
465
489
  )
466
490
  ] }),
467
- s && /* @__PURE__ */ r(
491
+ l && /* @__PURE__ */ r(
468
492
  "span",
469
493
  {
470
494
  className: "radio-description ml-6 text-neutrals-800 body-2 w-auto flex items-center",
471
- title: s,
472
- children: s
495
+ title: l,
496
+ children: l
473
497
  }
474
498
  ),
475
499
  /* @__PURE__ */ r(
476
500
  "input",
477
501
  {
478
502
  type: "radio",
479
- onChange: c,
503
+ onChange: d,
480
504
  id: t,
481
505
  checked: n,
482
506
  className: "hidden"
@@ -486,142 +510,142 @@ const Pe = 24, De = 24, M = 1e3, xe = 24, Me = ({
486
510
  }
487
511
  );
488
512
  };
489
- var S = /* @__PURE__ */ ((e) => (e.Closed = "Closed", e.Opened = "Opened", e))(S || {}), T = /* @__PURE__ */ ((e) => (e.LG = "Large", e.SM = "Small", e))(T || {});
490
- 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 = ({
491
515
  portalId: e,
492
- state: t = S.Opened,
516
+ state: t = A.Opened,
493
517
  heading: n,
494
- size: l,
495
- onClose: s,
518
+ size: s,
519
+ onClose: l,
496
520
  children: a,
497
- overlayClassName: c,
521
+ overlayClassName: d,
498
522
  containerClassName: u,
499
- dividers: d = !0,
500
- closeButtonTitle: h
523
+ dividers: h = !0,
524
+ closeButtonTitle: m
501
525
  }) => {
502
- const { refs: f, context: g } = $({
503
- open: t !== S.Closed && !!t,
504
- onOpenChange: s
505
- }), N = le(g, { role: "dialog" }), x = H(g, { outsidePress: !0 }), { getFloatingProps: E } = B([N, x]), b = L(
506
- (i) => {
507
- 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();
508
532
  },
509
- [s]
533
+ [l]
510
534
  );
511
- return /* @__PURE__ */ r(se, { id: e, children: t !== S.Closed && /* @__PURE__ */ r(
512
- ae,
535
+ return /* @__PURE__ */ r(be, { id: e, children: t !== A.Closed && /* @__PURE__ */ r(
536
+ Ne,
513
537
  {
514
- className: m(
538
+ className: f(
515
539
  "z-modal flex items-center justify-center bg-blackout p-4",
516
- c
540
+ d
517
541
  ),
518
- children: /* @__PURE__ */ r(oe, { context: g, children: /* @__PURE__ */ o(
542
+ children: /* @__PURE__ */ r(Ce, { context: x, children: /* @__PURE__ */ o(
519
543
  "div",
520
544
  {
521
- className: m(
545
+ className: f(
522
546
  "relative max-h-full modal rounded bg-white flex flex-col shadow w-full",
523
- l === T.LG && "max-w-[65%]",
524
- l === T.SM && "max-w-[30%]",
525
- 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",
526
550
  u,
527
551
  "sm:w-full sm:max-w-full sm:px-4 sm:py-6"
528
552
  ),
529
- ref: f.setFloating,
530
- ...E({
531
- onClick(i) {
532
- i.stopPropagation();
553
+ ref: p.setFloating,
554
+ ...N({
555
+ onClick(c) {
556
+ c.stopPropagation();
533
557
  }
534
558
  }),
535
559
  children: [
536
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: [
537
561
  n && (typeof n == "string" ? /* @__PURE__ */ r("h2", { className: "flex-1 min-w-0 mr-3 modal-heading-title sm:h3", children: n }) : n),
538
562
  /* @__PURE__ */ r(
539
- W,
563
+ te,
540
564
  {
541
- title: h,
542
- onClick: b,
565
+ title: m,
566
+ onClick: g,
543
567
  btnClassNames: "sm:h-[24px] sm:w-[24px] sm:top-4"
544
568
  }
545
569
  )
546
570
  ] }),
547
- a.map((i) => i)
571
+ a.map((c) => c)
548
572
  ]
549
573
  }
550
574
  ) })
551
575
  }
552
576
  ) });
553
- }, 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 = ({
554
578
  triggerButton: e,
555
579
  options: t,
556
580
  content: n,
557
- selectedOption: l,
558
- disabled: s,
581
+ selectedOption: s,
582
+ disabled: l,
559
583
  containerClassName: a,
560
- openedClassName: c,
584
+ openedClassName: d,
561
585
  onOptionSelect: u
562
586
  }) => {
563
- const [d, h] = A(!1), { refs: f, floatingStyles: g, context: N } = $({
564
- open: d,
565
- 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,
566
590
  placement: "bottom-end",
567
- middleware: [ie(8), de(), ue()],
568
- whileElementsMounted: ce
569
- }), x = me(N), E = H(N, { outsidePress: !0 }), { getReferenceProps: b, getFloatingProps: i } = B([
570
- x,
571
- 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
572
596
  ]);
573
- return /* @__PURE__ */ o(Y, { children: [
597
+ return /* @__PURE__ */ o(H, { children: [
574
598
  /* @__PURE__ */ r(
575
599
  "div",
576
600
  {
577
- ref: f.setReference,
578
- ...b({
579
- onClick(p) {
580
- p.stopPropagation();
601
+ ref: p.setReference,
602
+ ...g({
603
+ onClick(i) {
604
+ i.stopPropagation();
581
605
  }
582
606
  }),
583
- className: m(a, d && c),
607
+ className: f(a, h && d),
584
608
  children: e
585
609
  }
586
610
  ),
587
- d && /* @__PURE__ */ o(
611
+ h && /* @__PURE__ */ o(
588
612
  "div",
589
613
  {
590
- ref: f.setFloating,
591
- style: g,
614
+ ref: p.setFloating,
615
+ style: x,
592
616
  className: "flex flex-col z-10 dropdown-menu-shadow bg-white dropdown-container rounded",
593
- ...i(),
617
+ ...c(),
594
618
  children: [
595
619
  n && n,
596
- t && t.map((p) => /* @__PURE__ */ r(
620
+ t && t.map((i) => /* @__PURE__ */ r(
597
621
  "div",
598
622
  {
599
- onClick: (C) => {
600
- C.stopPropagation(), u?.(p.key), h(!1);
623
+ onClick: (v) => {
624
+ v.stopPropagation(), u?.(i.key), m(!1);
601
625
  },
602
- className: m(
626
+ className: f(
603
627
  "text-neutrals-900 body-3 cursor-pointer dropdown-item min-w-[200px]",
604
- l === p.key && "bg-hues-100"
628
+ s === i.key && "bg-hues-100"
605
629
  ),
606
630
  children: /* @__PURE__ */ o(
607
631
  "div",
608
632
  {
609
633
  className: "p-2 hover:bg-hues-100 h-full dropdown-item-text flex items-center gap-x-2",
610
- title: p.title,
634
+ title: i.title,
611
635
  children: [
612
- p.icon ? p.icon : null,
613
- /* @__PURE__ */ r("p", { children: p?.title })
636
+ i.icon ? i.icon : null,
637
+ /* @__PURE__ */ r("p", { children: i?.title })
614
638
  ]
615
639
  }
616
640
  )
617
641
  },
618
- p.key
642
+ i.key
619
643
  ))
620
644
  ]
621
645
  }
622
646
  )
623
647
  ] });
624
- }, 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: [
625
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: [
626
650
  /* @__PURE__ */ o("span", { className: "text-primary h5", children: [
627
651
  e?.excelFormatTitle,
@@ -633,16 +657,16 @@ const be = ({
633
657
  e?.dataExplorerIcon,
634
658
  e?.dataExplorer
635
659
  ] }) })
636
- ] }), ze = ({
660
+ ] }), kt = ({
637
661
  limitMessages: e,
638
662
  isDownload: t,
639
663
  showAdvancedViewButton: n,
640
- onAdvancedViewClick: l,
641
- query: s
664
+ onAdvancedViewClick: s,
665
+ query: l
642
666
  }) => /* @__PURE__ */ o(
643
667
  "div",
644
668
  {
645
- className: m(
669
+ className: f(
646
670
  "bg-semantic-warning-light px-2 py-1 flex justify-between flex-wrap items-center",
647
671
  e?.containerClassName
648
672
  ),
@@ -654,7 +678,7 @@ const be = ({
654
678
  /* @__PURE__ */ o(
655
679
  "span",
656
680
  {
657
- className: m(
681
+ className: f(
658
682
  "text-primary h5",
659
683
  e?.largeQueryClassName
660
684
  ),
@@ -668,18 +692,18 @@ const be = ({
668
692
  /* @__PURE__ */ r(
669
693
  "span",
670
694
  {
671
- className: m(
695
+ className: f(
672
696
  "text-neutrals-800 body-3",
673
697
  e?.limitMessageClassName
674
698
  ),
675
- children: t ? e?.downloadMessage?.(M) : e?.showingLimit?.(M)
699
+ children: t ? e?.downloadMessage?.(q) : e?.showingLimit?.(q)
676
700
  }
677
701
  )
678
702
  ] }),
679
703
  t && /* @__PURE__ */ r(
680
704
  "span",
681
705
  {
682
- className: m(
706
+ className: f(
683
707
  "text-neutrals-800 body-3",
684
708
  e?.limitMessageClassName
685
709
  ),
@@ -691,7 +715,7 @@ const be = ({
691
715
  n && /* @__PURE__ */ o(
692
716
  "span",
693
717
  {
694
- onClick: () => l?.(),
718
+ onClick: () => s?.(),
695
719
  className: "flex gap-x-[4px] h4 cursor-pointer items-center text-primary",
696
720
  children: [
697
721
  e?.editIcon,
@@ -699,93 +723,465 @@ const be = ({
699
723
  ]
700
724
  }
701
725
  ),
702
- 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: [
703
727
  e?.dataExplorerIcon,
704
728
  e?.dataExplorer
705
729
  ] }) })
706
730
  ]
707
731
  }
708
- ), q = j(null);
709
- function Xe({
732
+ ), re = U(null);
733
+ function Dt({
710
734
  value: e,
711
735
  children: t
712
736
  }) {
713
- const n = D(() => e ?? {}, [e]);
714
- 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 });
715
739
  }
716
- function Ne() {
717
- return G(q);
740
+ function Be() {
741
+ return V(re);
718
742
  }
719
- var I = /* @__PURE__ */ ((e) => (e.Info = "info", e.Error = "error", e.Warning = "warning", e))(I || {});
720
- const Ce = {
721
- [I.Info]: "border-neutrals-800 bg-neutrals-300 text-neutrals-1000",
722
- [I.Error]: "border-semantic-error bg-semantic-error-light text-neutrals-1000",
723
- [I.Warning]: "border-semantic-warning bg-semantic-warning-light text-neutrals-1000"
724
- }, we = "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";
725
- 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({
726
750
  type: e,
727
751
  icon: t,
728
752
  children: n,
729
- className: l,
730
- contentClassName: s
753
+ className: s,
754
+ contentClassName: l
731
755
  }) {
732
- const a = Ne(), c = t ?? a?.icons?.[e], u = a?.classes?.container ?? ve, d = a?.classes?.types?.[e] ?? Ce[e], h = v(u, d, l), f = v(we, a?.classes?.icon), g = v(
733
- 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,
734
758
  a?.classes?.content,
735
- s
759
+ l
736
760
  );
737
- return /* @__PURE__ */ o("div", { "data-type": e, className: h, children: [
738
- c ? /* @__PURE__ */ r("span", { className: f, children: c }) : null,
739
- 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
740
764
  ] });
741
765
  }
742
- const Je = ({
766
+ const Rt = ({
743
767
  title: e,
744
768
  copiedTitle: t,
745
769
  tooltip: n,
746
- icon: l,
747
- copiedIcon: s,
770
+ icon: s,
771
+ copiedIcon: l,
748
772
  className: a,
749
- buttonTextClassName: c,
773
+ buttonTextClassName: d,
750
774
  onClick: u
751
775
  }) => {
752
- const [d, h] = A(!1), f = P(null), g = () => {
753
- u(), h(!0), f.current && clearTimeout(f.current), f.current = setTimeout(() => {
754
- 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);
755
779
  }, 1e3);
756
780
  };
757
- return _(() => () => {
758
- f.current && clearTimeout(f.current);
781
+ return M(() => () => {
782
+ p.current && clearTimeout(p.current);
759
783
  }, []), /* @__PURE__ */ o("div", { className: "relative w-fit", children: [
760
784
  /* @__PURE__ */ r(
761
- pe,
785
+ je,
762
786
  {
763
- title: d ? t : e,
787
+ title: h ? t : e,
764
788
  isSmallButton: !0,
765
- disabled: d,
766
- buttonClassName: v([
789
+ disabled: h,
790
+ buttonClassName: L([
767
791
  "text-button-tertiary small-icon-button !h-6 !p-0",
768
792
  a
769
793
  ]),
770
- textClassName: v(["ml-1", c]),
771
- onClick: g,
772
- iconBefore: d ? s : l
794
+ textClassName: L(["ml-1", d]),
795
+ onClick: x,
796
+ iconBefore: h ? l : s
773
797
  }
774
798
  ),
775
- 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 })
776
800
  ] });
777
801
  };
778
- var Ee = /* @__PURE__ */ ((e) => (e.Enter = "Enter", e))(Ee || {});
779
- 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
+ }
780
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({
781
1177
  children: e,
782
1178
  isAgentAvailable: t
783
1179
  }) {
784
- const n = D(() => ({ isAgentAvailable: t }), [t]);
785
- 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 });
786
1182
  }
787
- function et() {
788
- const e = G(Q);
1183
+ function _t() {
1184
+ const e = V(ce);
789
1185
  if (!e)
790
1186
  throw new Error(
791
1187
  "useAgentAvailability must be used within AgentAvailabilityProvider"
@@ -793,38 +1189,40 @@ function et() {
793
1189
  return e;
794
1190
  }
795
1191
  export {
796
- Ke as AgentAvailabilityProvider,
797
- Oe as Alert,
798
- y as AlertType,
799
- pe as Button,
800
- xe as CALENDAR_MOBILE_PADDING,
801
- Me as Calendar,
802
- Ye as Checkbox,
803
- W as CloseButton,
804
- je as CollapsibleBlock,
805
- Je as CopyButton,
806
- Ve as DownloadFormatMessage,
807
- Qe as Dropdown,
808
- Ge as HighlightText,
809
- $e as IconButton,
810
- Ze as InlineAlert,
811
- Xe as InlineAlertProvider,
812
- I as InlineAlertType,
813
- ge as Input,
814
- He as InputWithIcon,
815
- Ee as KeyboardKey,
816
- Be as Link,
817
- U as Loader,
818
- T as PopUpSize,
819
- S as PopUpState,
820
- qe as Popup,
821
- We as Radio,
822
- ze as RequestLimitMessage,
823
- M as SERIES_LIMIT,
824
- Pe as TREE_NODE_ARROW_SIZE,
825
- De as TREE_NODE_PADDING,
826
- Ue as Tag,
827
- et as useAgentAvailability,
828
- Te as useDebounce,
829
- 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
830
1228
  };