dhx-react-suite 1.1.6 → 1.1.7

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.
@@ -1,6 +1,6 @@
1
- import { jsxs as g, jsx as t, Fragment as Ne } from "react/jsx-runtime";
2
- import { useEffect as K, useRef as U, useCallback as Z, useState as T, useMemo as ue, createContext as Pe, useContext as je } from "react";
3
- import { Tooltip as Oe, Legend as Ye, CartesianGrid as Fe, XAxis as Se, YAxis as we, BarChart as Ke, Bar as Ve, LineChart as _e, Line as Xe, AreaChart as qe, Area as Ge, PieChart as Je, Pie as Ue, Cell as Qe, RadarChart as Ze, PolarGrid as et, PolarAngleAxis as tt, PolarRadiusAxis as nt, Radar as rt, ScatterChart as ot, Scatter as it, ResponsiveContainer as lt, Treemap as st } from "recharts";
1
+ import { jsxs as y, jsx as t, Fragment as Oe } from "react/jsx-runtime";
2
+ import { useEffect as O, useRef as ne, useCallback as oe, useState as I, useMemo as le, createContext as Qe, useContext as Ze } from "react";
3
+ import { Tooltip as et, Legend as tt, CartesianGrid as nt, XAxis as Ne, YAxis as Ee, BarChart as rt, Bar as ot, LineChart as it, Line as lt, AreaChart as st, Area as at, PieChart as dt, Pie as ct, Cell as ut, RadarChart as pt, PolarGrid as ht, PolarAngleAxis as ft, PolarRadiusAxis as xt, Radar as gt, ScatterChart as yt, Scatter as bt, ResponsiveContainer as mt, Treemap as vt } from "recharts";
4
4
  const e = {
5
5
  primary: "#0288d1",
6
6
  primaryDk: "#01579b",
@@ -20,11 +20,11 @@ const e = {
20
20
  r: "4px",
21
21
  rMd: "8px",
22
22
  font: "'Segoe UI', system-ui, -apple-system, sans-serif"
23
- }, ze = "dhx-react-styles";
23
+ }, Re = "dhx-react-styles";
24
24
  function _() {
25
- if (typeof document > "u" || document.getElementById(ze)) return;
25
+ if (typeof document > "u" || document.getElementById(Re)) return;
26
26
  const n = document.createElement("style");
27
- n.id = ze, n.textContent = `
27
+ n.id = Re, n.textContent = `
28
28
  *,*::before,*::after{box-sizing:border-box}
29
29
  .dhx{font-family:${e.font};font-size:14px;color:${e.text}}
30
30
  .dhx *{box-sizing:border-box}
@@ -66,26 +66,26 @@ function _() {
66
66
  .dhx-tag-warning{background:#fff3e0;color:#e65100}
67
67
  `, document.head.appendChild(n);
68
68
  }
69
- const at = {
69
+ const kt = {
70
70
  sm: { height: 24, padding: "0 8px", fontSize: 12 },
71
71
  md: {},
72
72
  lg: { height: 38, padding: "0 18px", fontSize: 14 }
73
73
  };
74
- function Mt({
74
+ function Ot({
75
75
  children: n,
76
- variant: i = "primary",
77
- size: p = "md",
76
+ variant: o = "primary",
77
+ size: d = "md",
78
78
  icon: s,
79
79
  disabled: f,
80
80
  onClick: a,
81
81
  style: h,
82
- className: d = ""
82
+ className: u = ""
83
83
  }) {
84
- return K(_, []), /* @__PURE__ */ g(
84
+ return O(_, []), /* @__PURE__ */ y(
85
85
  "button",
86
86
  {
87
- className: `dhx dhx-btn dhx-btn-${i} ${d}`,
88
- style: { ...at[p], ...h },
87
+ className: `dhx dhx-btn dhx-btn-${o} ${u}`,
88
+ style: { ...kt[d], ...h },
89
89
  disabled: f,
90
90
  onClick: a,
91
91
  children: [
@@ -95,83 +95,83 @@ function Mt({
95
95
  }
96
96
  );
97
97
  }
98
- function he(n, i) {
99
- K(() => {
100
- const p = (s) => {
101
- n.current && !n.current.contains(s.target) && i(s);
98
+ function fe(n, o) {
99
+ O(() => {
100
+ const d = (s) => {
101
+ n.current && !n.current.contains(s.target) && o(s);
102
102
  };
103
- return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
104
- }, [n, i]);
103
+ return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
104
+ }, [n, o]);
105
105
  }
106
- function dt(n) {
107
- const i = U(!1), p = U({ x: 0, y: 0, ox: 0, oy: 0 });
108
- return Z(
106
+ function St(n) {
107
+ const o = ne(!1), d = ne({ x: 0, y: 0, ox: 0, oy: 0 });
108
+ return oe(
109
109
  (s, f = 0, a = 0) => {
110
- i.current = !0, p.current = { x: s.clientX, y: s.clientY, ox: f, oy: a };
111
- const h = (y) => {
112
- if (!i.current) return;
113
- const { x: w, y: r, ox: l, oy: c } = p.current;
114
- n(l + y.clientX - w, c + y.clientY - r);
115
- }, d = () => {
116
- i.current = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", d);
110
+ o.current = !0, d.current = { x: s.clientX, y: s.clientY, ox: f, oy: a };
111
+ const h = (g) => {
112
+ if (!o.current) return;
113
+ const { x: S, y: r, ox: i, oy: c } = d.current;
114
+ n(i + g.clientX - S, c + g.clientY - r);
115
+ }, u = () => {
116
+ o.current = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", u);
117
117
  };
118
- document.addEventListener("mousemove", h), document.addEventListener("mouseup", d), s.preventDefault();
118
+ document.addEventListener("mousemove", h), document.addEventListener("mouseup", u), s.preventDefault();
119
119
  },
120
120
  [n]
121
121
  );
122
122
  }
123
- function fe({ items: n, onSelect: i, style: p }) {
124
- const [s, f] = T(null);
125
- return /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", top: "calc(100% + 4px)", left: 0, minWidth: 180, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, zIndex: 200, padding: "4px 0", ...p }, children: n.map((a, h) => {
126
- var y, w;
123
+ function ge({ items: n, onSelect: o, style: d }) {
124
+ const [s, f] = I(null);
125
+ return /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", top: "calc(100% + 4px)", left: 0, minWidth: 180, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, zIndex: 200, padding: "4px 0", ...d }, children: n.map((a, h) => {
126
+ var g, S;
127
127
  if (a.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "4px 0" } }, h);
128
- const d = s === h;
129
- return /* @__PURE__ */ g("div", { style: { position: "relative" }, onMouseEnter: () => f(h), onMouseLeave: () => f(null), children: [
130
- /* @__PURE__ */ g(
128
+ const u = s === h;
129
+ return /* @__PURE__ */ y("div", { style: { position: "relative" }, onMouseEnter: () => f(h), onMouseLeave: () => f(null), children: [
130
+ /* @__PURE__ */ y(
131
131
  "div",
132
132
  {
133
133
  onClick: () => {
134
134
  var r;
135
- return !a.disabled && !((r = a.items) != null && r.length) && i(a);
135
+ return !a.disabled && !((r = a.items) != null && r.length) && o(a);
136
136
  },
137
- style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: a.disabled ? "not-allowed" : "pointer", fontSize: 13, color: a.disabled ? e.textMut : e.text, background: d && !a.disabled ? e.bg : "transparent", opacity: a.disabled ? 0.5 : 1 },
137
+ style: { display: "flex", alignItems: "center", gap: 8, padding: "8px 14px", cursor: a.disabled ? "not-allowed" : "pointer", fontSize: 13, color: a.disabled ? e.textMut : e.text, background: u && !a.disabled ? e.bg : "transparent", opacity: a.disabled ? 0.5 : 1 },
138
138
  children: [
139
139
  a.icon && /* @__PURE__ */ t("span", { style: { fontSize: 15, width: 18, textAlign: "center" }, children: a.icon }),
140
140
  /* @__PURE__ */ t("span", { style: { flex: 1 }, children: a.value || a.id }),
141
141
  a.hotkey && /* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textMut }, children: a.hotkey }),
142
- (y = a.items) != null && y.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
142
+ (g = a.items) != null && g.length ? /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: "▶" }) : null
143
143
  ]
144
144
  }
145
145
  ),
146
- d && ((w = a.items) != null && w.length) ? /* @__PURE__ */ t(fe, { items: a.items, onSelect: i, style: { position: "absolute", left: "100%", top: -4 } }) : null
146
+ u && ((S = a.items) != null && S.length) ? /* @__PURE__ */ t(ge, { items: a.items, onSelect: o, style: { position: "absolute", left: "100%", top: -4 } }) : null
147
147
  ] }, a.id || h);
148
148
  }) });
149
149
  }
150
- function $t({ items: n = [], label: i = "Menu", onSelect: p, style: s }) {
151
- const [f, a] = T(!1), h = U(null);
152
- return K(_, []), he(h, Z(() => a(!1), [])), /* @__PURE__ */ g("div", { ref: h, className: "dhx", style: { position: "relative", display: "inline-block", ...s }, children: [
153
- /* @__PURE__ */ g("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => a((d) => !d), children: [
154
- i,
150
+ function Yt({ items: n = [], label: o = "Menu", onSelect: d, style: s }) {
151
+ const [f, a] = I(!1), h = ne(null);
152
+ return O(_, []), fe(h, oe(() => a(!1), [])), /* @__PURE__ */ y("div", { ref: h, className: "dhx", style: { position: "relative", display: "inline-block", ...s }, children: [
153
+ /* @__PURE__ */ y("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => a((u) => !u), children: [
154
+ o,
155
155
  " ",
156
156
  /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: f ? "▲" : "▼" })
157
157
  ] }),
158
- f && /* @__PURE__ */ t(fe, { items: n, onSelect: (d) => {
159
- p == null || p(d), a(!1);
158
+ f && /* @__PURE__ */ t(ge, { items: n, onSelect: (u) => {
159
+ d == null || d(u), a(!1);
160
160
  } })
161
161
  ] });
162
162
  }
163
- function Dt({ items: n = [], onSelect: i, children: p }) {
164
- const [s, f] = T(null), a = U(null);
165
- return K(_, []), he(a, Z(() => f(null), [])), /* @__PURE__ */ g("div", { ref: a, onContextMenu: (d) => {
166
- d.preventDefault(), f({ x: d.clientX, y: d.clientY });
163
+ function Kt({ items: n = [], onSelect: o, children: d }) {
164
+ const [s, f] = I(null), a = ne(null);
165
+ return O(_, []), fe(a, oe(() => f(null), [])), /* @__PURE__ */ y("div", { ref: a, onContextMenu: (u) => {
166
+ u.preventDefault(), f({ x: u.clientX, y: u.clientY });
167
167
  }, style: { position: "relative", display: "contents" }, children: [
168
- p,
169
- s && /* @__PURE__ */ t("div", { style: { position: "fixed", left: s.x, top: s.y, zIndex: 9999 }, children: /* @__PURE__ */ t(fe, { items: n, onSelect: (d) => {
170
- i == null || i(d), f(null);
168
+ d,
169
+ s && /* @__PURE__ */ t("div", { style: { position: "fixed", left: s.x, top: s.y, zIndex: 9999 }, children: /* @__PURE__ */ t(ge, { items: n, onSelect: (u) => {
170
+ o == null || o(u), f(null);
171
171
  } }) })
172
172
  ] });
173
173
  }
174
- function Me({ count: n }) {
174
+ function We({ count: n }) {
175
175
  return /* @__PURE__ */ t("span", { style: {
176
176
  position: "absolute",
177
177
  top: 2,
@@ -191,36 +191,36 @@ function Me({ count: n }) {
191
191
  pointerEvents: "none"
192
192
  }, children: n });
193
193
  }
194
- function Ct({ items: n = [], onAction: i, style: p }) {
195
- const [s, f] = T(null), [a, h] = T(() => {
194
+ function _t({ items: n = [], onAction: o, style: d }) {
195
+ const [s, f] = I(null), [a, h] = I(() => {
196
196
  const r = {};
197
- return n.forEach((l) => {
198
- l.id && (l.twoState || l.group) && l.active && (r[l.id] = !0);
197
+ return n.forEach((i) => {
198
+ i.id && (i.twoState || i.group) && i.active && (r[i.id] = !0);
199
199
  }), r;
200
- }), d = U(null);
201
- K(_, []), he(d, Z(() => f(null), []));
202
- const y = (r, l) => {
203
- var c, b;
200
+ }), u = ne(null);
201
+ O(_, []), fe(u, oe(() => f(null), []));
202
+ const g = (r, i) => {
203
+ var c, m;
204
204
  if (!r.disabled) {
205
- if (r.twoState && r.id && h((S) => ({ ...S, [r.id]: !S[r.id] })), r.group && r.id && h((S) => {
206
- const o = { ...S };
205
+ if (r.twoState && r.id && h((v) => ({ ...v, [r.id]: !v[r.id] })), r.group && r.id && h((v) => {
206
+ const l = { ...v };
207
207
  return n.forEach((x) => {
208
- x.group === r.group && x.id && (o[x.id] = !1);
209
- }), o[r.id] = !0, o;
208
+ x.group === r.group && x.id && (l[x.id] = !1);
209
+ }), l[r.id] = !0, l;
210
210
  }), (c = r.items) != null && c.length) {
211
- f((S) => S === l ? null : l);
211
+ f((v) => v === i ? null : i);
212
212
  return;
213
213
  }
214
- (b = r.onClick) == null || b.call(r, r.id || ""), i == null || i(r.id || "");
214
+ (m = r.onClick) == null || m.call(r, r.id || ""), o == null || o(r.id || "");
215
215
  }
216
- }, w = (r, l) => {
217
- var o, x;
216
+ }, S = (r, i) => {
217
+ var l, x;
218
218
  if (r.hidden) return null;
219
- if (r.type === "separator") return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, l);
220
- if (r.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, l);
221
- if (r.type === "input") return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
219
+ if (r.type === "separator") return /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "6px 4px", alignSelf: "stretch" } }, i);
220
+ if (r.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, i);
221
+ if (r.type === "input") return /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
222
222
  r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
223
- /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
223
+ /* @__PURE__ */ y("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
224
224
  r.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: r.icon }),
225
225
  /* @__PURE__ */ t(
226
226
  "input",
@@ -229,15 +229,15 @@ function Ct({ items: n = [], onAction: i, style: p }) {
229
229
  style: { width: r.width || 140, height: 28, paddingLeft: r.icon ? 30 : void 0 },
230
230
  placeholder: r.placeholder,
231
231
  defaultValue: r.value,
232
- onChange: (k) => {
233
- var $;
234
- return ($ = r.onChange) == null ? void 0 : $.call(r, k.target.value);
232
+ onChange: (w) => {
233
+ var z;
234
+ return (z = r.onChange) == null ? void 0 : z.call(r, w.target.value);
235
235
  }
236
236
  }
237
237
  )
238
238
  ] })
239
- ] }, l);
240
- if (r.type === "select") return /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
239
+ ] }, i);
240
+ if (r.type === "select") return /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
241
241
  r.label && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontWeight: 500 }, children: r.label }),
242
242
  /* @__PURE__ */ t(
243
243
  "select",
@@ -245,15 +245,15 @@ function Ct({ items: n = [], onAction: i, style: p }) {
245
245
  className: "dhx dhx-input",
246
246
  style: { width: r.width || 100, height: 28, cursor: "pointer" },
247
247
  defaultValue: r.value,
248
- onChange: (k) => {
249
- var $;
250
- return ($ = r.onChange) == null ? void 0 : $.call(r, k.target.value);
248
+ onChange: (w) => {
249
+ var z;
250
+ return (z = r.onChange) == null ? void 0 : z.call(r, w.target.value);
251
251
  },
252
- children: (o = r.options) == null ? void 0 : o.map((k) => /* @__PURE__ */ t("option", { value: k.value, children: k.label }, k.value))
252
+ children: (l = r.options) == null ? void 0 : l.map((w) => /* @__PURE__ */ t("option", { value: w.value, children: w.label }, w.value))
253
253
  }
254
254
  )
255
- ] }, l);
256
- if (r.type === "imageButton") return /* @__PURE__ */ g(
255
+ ] }, i);
256
+ if (r.type === "imageButton") return /* @__PURE__ */ y(
257
257
  "button",
258
258
  {
259
259
  title: r.tooltip,
@@ -270,17 +270,17 @@ function Ct({ items: n = [], onAction: i, style: p }) {
270
270
  background: "transparent",
271
271
  flexShrink: 0
272
272
  },
273
- onClick: () => y(r, l),
273
+ onClick: () => g(r, i),
274
274
  children: [
275
275
  r.src && /* @__PURE__ */ t("img", { src: r.src, alt: r.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
276
- r.count !== void 0 && /* @__PURE__ */ t(Me, { count: r.count })
276
+ r.count !== void 0 && /* @__PURE__ */ t(We, { count: r.count })
277
277
  ]
278
278
  },
279
- l
279
+ i
280
280
  );
281
- const c = !!(r.id && a[r.id]), b = r.value ?? r.text, S = !!((x = r.items) != null && x.length);
282
- return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
283
- /* @__PURE__ */ g(
281
+ const c = !!(r.id && a[r.id]), m = r.value ?? r.text, v = !!((x = r.items) != null && x.length);
282
+ return /* @__PURE__ */ y("div", { style: { position: "relative" }, children: [
283
+ /* @__PURE__ */ y(
284
284
  "button",
285
285
  {
286
286
  className: "dhx dhx-btn dhx-btn-ghost",
@@ -295,29 +295,29 @@ function Ct({ items: n = [], onAction: i, style: p }) {
295
295
  opacity: r.disabled ? 0.55 : 1,
296
296
  cursor: r.disabled ? "not-allowed" : "pointer"
297
297
  },
298
- onClick: () => y(r, l),
298
+ onClick: () => g(r, i),
299
299
  children: [
300
300
  r.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: r.icon }),
301
- b && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: b }),
302
- S && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
303
- r.count !== void 0 && /* @__PURE__ */ t(Me, { count: r.count })
301
+ m && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: m }),
302
+ v && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
303
+ r.count !== void 0 && /* @__PURE__ */ t(We, { count: r.count })
304
304
  ]
305
305
  }
306
306
  ),
307
- S && s === l && /* @__PURE__ */ t(
308
- fe,
307
+ v && s === i && /* @__PURE__ */ t(
308
+ ge,
309
309
  {
310
310
  items: r.items,
311
311
  onSelect: () => f(null),
312
312
  style: { top: "100%", left: 0 }
313
313
  }
314
314
  )
315
- ] }, l);
315
+ ] }, i);
316
316
  };
317
317
  return /* @__PURE__ */ t(
318
318
  "div",
319
319
  {
320
- ref: d,
320
+ ref: u,
321
321
  className: "dhx",
322
322
  style: {
323
323
  display: "flex",
@@ -328,52 +328,52 @@ function Ct({ items: n = [], onAction: i, style: p }) {
328
328
  borderBottom: `1px solid ${e.border}`,
329
329
  minHeight: 44,
330
330
  flexWrap: "wrap",
331
- ...p
331
+ ...d
332
332
  },
333
- children: n.map(w)
333
+ children: n.map(S)
334
334
  }
335
335
  );
336
336
  }
337
- function It({ items: n = [], width: i = 240, collapsed: p, onSelect: s, header: f, footer: a, style: h }) {
338
- const [d, y] = T(p ?? !1), [w, r] = T(null), [l, c] = T({});
339
- K(_, []);
340
- const b = d ? 56 : i, S = (x) => {
337
+ function Vt({ items: n = [], width: o = 240, collapsed: d, onSelect: s, header: f, footer: a, style: h }) {
338
+ const [u, g] = I(d ?? !1), [S, r] = I(null), [i, c] = I({});
339
+ O(_, []);
340
+ const m = u ? 56 : o, v = (x) => {
341
341
  r(x.id), s == null || s(x);
342
- }, o = (x, k = 0) => {
343
- var M;
342
+ }, l = (x, w = 0) => {
343
+ var $;
344
344
  if (x.type === "separator") return /* @__PURE__ */ t("div", { style: { height: 1, background: e.border, margin: "6px 8px" } }, x.id);
345
345
  if (x.type === "customHTML") return /* @__PURE__ */ t("div", { style: { padding: "8px 12px" }, dangerouslySetInnerHTML: { __html: x.html || "" } }, x.id);
346
- const $ = (((M = x.items) == null ? void 0 : M.length) ?? 0) > 0, L = l[x.id], m = w === x.id;
347
- return /* @__PURE__ */ g("div", { children: [
348
- /* @__PURE__ */ g(
346
+ const z = ((($ = x.items) == null ? void 0 : $.length) ?? 0) > 0, N = i[x.id], k = S === x.id;
347
+ return /* @__PURE__ */ y("div", { children: [
348
+ /* @__PURE__ */ y(
349
349
  "div",
350
350
  {
351
351
  onClick: () => {
352
- $ && c((A) => ({ ...A, [x.id]: !A[x.id] })), S(x);
352
+ z && c((W) => ({ ...W, [x.id]: !W[x.id] })), v(x);
353
353
  },
354
- style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${d ? "0px" : `${12 + k * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: d ? "center" : "flex-start", transition: "all .15s", background: m ? e.primaryLt : "transparent", color: m ? e.primary : e.text, userSelect: "none" },
355
- onMouseEnter: (A) => !m && (A.currentTarget.style.background = e.bg),
356
- onMouseLeave: (A) => !m && (A.currentTarget.style.background = "transparent"),
354
+ style: { display: "flex", alignItems: "center", gap: 10, padding: `8px ${u ? "0px" : `${12 + w * 16}px`}`, cursor: "pointer", borderRadius: e.r, margin: "1px 6px", justifyContent: u ? "center" : "flex-start", transition: "all .15s", background: k ? e.primaryLt : "transparent", color: k ? e.primary : e.text, userSelect: "none" },
355
+ onMouseEnter: (W) => !k && (W.currentTarget.style.background = e.bg),
356
+ onMouseLeave: (W) => !k && (W.currentTarget.style.background = "transparent"),
357
357
  children: [
358
358
  x.icon && /* @__PURE__ */ t("span", { style: { fontSize: 18, minWidth: 22, textAlign: "center" }, children: x.icon }),
359
- !d && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: m ? 600 : 400 }, children: x.value }),
360
- !d && x.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: x.count }),
361
- !d && $ && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: L ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
359
+ !u && /* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 13, fontWeight: k ? 600 : 400 }, children: x.value }),
360
+ !u && x.count !== void 0 && /* @__PURE__ */ t("span", { style: { background: e.primary, color: "#fff", borderRadius: 10, padding: "1px 6px", fontSize: 11, fontWeight: 700 }, children: x.count }),
361
+ !u && z && /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textMut, transition: "transform .15s", transform: N ? "rotate(90deg)" : "rotate(0deg)" }, children: "▶" })
362
362
  ]
363
363
  }
364
364
  ),
365
- $ && L && !d && x.items.map((A) => o(A, k + 1))
365
+ z && N && !u && x.items.map((W) => l(W, w + 1))
366
366
  ] }, x.id);
367
367
  };
368
- return /* @__PURE__ */ g("div", { className: "dhx", style: { width: b, minWidth: b, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...h }, children: [
369
- f && !d && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: f }),
370
- /* @__PURE__ */ t("button", { onClick: () => y((x) => !x), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: d ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: d ? "☰" : "✕" }) }),
371
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((x) => o(x)) }),
372
- a && !d && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: a })
368
+ return /* @__PURE__ */ y("div", { className: "dhx", style: { width: m, minWidth: m, background: e.surface, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", transition: "width .2s ease", overflow: "hidden", ...h }, children: [
369
+ f && !u && /* @__PURE__ */ t("div", { style: { padding: "12px 14px", borderBottom: `1px solid ${e.border}`, fontWeight: 700, fontSize: 15 }, children: f }),
370
+ /* @__PURE__ */ t("button", { onClick: () => g((x) => !x), style: { margin: "8px 6px", background: "transparent", border: "none", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: u ? "center" : "flex-end", padding: "4px 6px", borderRadius: e.r, color: e.textSec }, children: /* @__PURE__ */ t("span", { style: { fontSize: 18 }, children: u ? "☰" : "✕" }) }),
371
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", overflowX: "hidden" }, children: n.map((x) => l(x)) }),
372
+ a && !u && /* @__PURE__ */ t("div", { style: { padding: "10px 14px", borderTop: `1px solid ${e.border}` }, children: a })
373
373
  ] });
374
374
  }
375
- function ct({ config: n }) {
376
- const [i, p] = T(!1), s = {
375
+ function wt({ config: n }) {
376
+ const [o, d] = I(!1), s = {
377
377
  position: "relative",
378
378
  background: e.surface,
379
379
  border: `1px solid ${e.border}`,
@@ -381,556 +381,734 @@ function ct({ config: n }) {
381
381
  overflow: "hidden",
382
382
  ...n.width ? { width: n.width, minWidth: n.width } : { flex: 1 },
383
383
  ...n.height ? { height: n.height, minHeight: n.height } : { minHeight: 40 },
384
- ...i ? { flex: "0 0 auto" } : {}
384
+ ...o ? { flex: "0 0 auto" } : {}
385
385
  };
386
- return /* @__PURE__ */ g("div", { style: s, children: [
387
- n.header && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "6px 12px", background: e.bg, borderBottom: `1px solid ${e.border}`, fontSize: 12, fontWeight: 600, color: e.textSec, userSelect: "none" }, children: [
386
+ return /* @__PURE__ */ y("div", { style: s, children: [
387
+ n.header && /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "6px 12px", background: e.bg, borderBottom: `1px solid ${e.border}`, fontSize: 12, fontWeight: 600, color: e.textSec, userSelect: "none" }, children: [
388
388
  /* @__PURE__ */ t("span", { children: n.header }),
389
- n.collapsable && /* @__PURE__ */ t("button", { onClick: () => p((f) => !f), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: i ? "▼" : "▲" })
389
+ n.collapsable && /* @__PURE__ */ t("button", { onClick: () => d((f) => !f), style: { background: "none", border: "none", cursor: "pointer", color: e.textMut, fontSize: 16, lineHeight: 1 }, children: o ? "▼" : "▲" })
390
390
  ] }),
391
- !i && /* @__PURE__ */ g("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
391
+ !o && /* @__PURE__ */ y("div", { style: { padding: n.padding || 0, height: n.header ? "calc(100% - 33px)" : "100%", overflow: "auto" }, children: [
392
392
  n.html ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: n.html } }) : n.content,
393
- (n.rows || n.cols) && /* @__PURE__ */ t(pt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
393
+ (n.rows || n.cols) && /* @__PURE__ */ t(zt, { rows: n.rows, cols: n.cols, style: { height: "100%" } })
394
394
  ] })
395
395
  ] });
396
396
  }
397
- function pt({ rows: n, cols: i, type: p = "line", style: s, children: f }) {
398
- K(_, []);
399
- const a = p === "space" ? 12 : p === "wide" ? 8 : 1, h = n || i, d = !!n;
400
- return h ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: d ? "column" : "row", gap: a, width: "100%", height: "100%", ...s }, children: h.map((y, w) => /* @__PURE__ */ t(ct, { config: y }, y.id || w)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...s }, children: f });
397
+ function zt({ rows: n, cols: o, type: d = "line", style: s, children: f }) {
398
+ O(_, []);
399
+ const a = d === "space" ? 12 : d === "wide" ? 8 : 1, h = n || o, u = !!n;
400
+ return h ? /* @__PURE__ */ t("div", { className: "dhx", style: { display: "flex", flexDirection: u ? "column" : "row", gap: a, width: "100%", height: "100%", ...s }, children: h.map((g, S) => /* @__PURE__ */ t(wt, { config: g }, g.id || S)) }) : /* @__PURE__ */ t("div", { className: "dhx", style: { width: "100%", height: "100%", ...s }, children: f });
401
401
  }
402
- function Lt({ views: n = [], mode: i = "top", tabAlign: p = "left", closable: s = [], disabled: f = [], defaultActive: a, onBeforeChange: h, onChange: d, style: y }) {
403
- var m;
404
- const [w, r] = T(a || ((m = n[0]) == null ? void 0 : m.id)), [l, c] = T(n.map((M) => M.id));
405
- K(_, []);
406
- const b = (M, A) => {
407
- M.stopPropagation(), c((u) => u.filter((I) => I !== A)), w === A && r(l.find((u) => u !== A) ?? "");
408
- }, S = (M) => {
409
- f.includes(M) || h && h(M) === !1 || (r(M), d == null || d(M));
410
- }, o = i === "left" || i === "right", x = n.filter((M) => l.includes(M.id)), k = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: o ? "column" : "row", justifyContent: p === "center" ? "center" : p === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !o && i !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: i === "bottom" ? `2px solid ${e.border}` : "none", borderRight: i === "left" ? `2px solid ${e.border}` : "none", borderLeft: i === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: x.map((M) => {
411
- const A = w === M.id, u = f.includes(M.id), I = i === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : o ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [i === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
412
- return /* @__PURE__ */ g(
402
+ function Xt({ views: n = [], mode: o = "top", tabAlign: d = "left", closable: s = [], disabled: f = [], defaultActive: a, onBeforeChange: h, onChange: u, style: g }) {
403
+ var k;
404
+ const [S, r] = I(a || ((k = n[0]) == null ? void 0 : k.id)), [i, c] = I(n.map(($) => $.id));
405
+ O(_, []);
406
+ const m = ($, W) => {
407
+ $.stopPropagation(), c((p) => p.filter((T) => T !== W)), S === W && r(i.find((p) => p !== W) ?? "");
408
+ }, v = ($) => {
409
+ f.includes($) || h && h($) === !1 || (r($), u == null || u($));
410
+ }, l = o === "left" || o === "right", x = n.filter(($) => i.includes($.id)), w = /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: l ? "column" : "row", justifyContent: d === "center" ? "center" : d === "right" ? "flex-end" : "flex-start", background: e.surface, borderBottom: !l && o !== "bottom" ? `2px solid ${e.border}` : "none", borderTop: o === "bottom" ? `2px solid ${e.border}` : "none", borderRight: o === "left" ? `2px solid ${e.border}` : "none", borderLeft: o === "right" ? `2px solid ${e.border}` : "none", overflowX: "auto", flexShrink: 0 }, children: x.map(($) => {
411
+ const W = S === $.id, p = f.includes($.id), T = o === "bottom" ? { borderTop: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 } : l ? { color: e.primary, fontWeight: 600, background: e.primaryLt, [o === "left" ? "borderRight" : "borderLeft"]: `2px solid ${e.primary}` } : { borderBottom: `2px solid ${e.primary}`, color: e.primary, fontWeight: 600 };
412
+ return /* @__PURE__ */ y(
413
413
  "div",
414
414
  {
415
- onClick: () => S(M.id),
416
- style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: u ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: o ? 120 : "auto", ...A ? I : { color: u ? e.textMut : e.textSec } },
415
+ onClick: () => v($.id),
416
+ style: { display: "flex", alignItems: "center", gap: 6, padding: "10px 16px", cursor: p ? "not-allowed" : "pointer", whiteSpace: "nowrap", fontSize: 13, transition: "color .15s", userSelect: "none", minWidth: l ? 120 : "auto", ...W ? T : { color: p ? e.textMut : e.textSec } },
417
417
  children: [
418
- M.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: M.icon }),
419
- /* @__PURE__ */ t("span", { children: M.tab }),
420
- s.includes(M.id) && /* @__PURE__ */ t("span", { onClick: (R) => b(R, M.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
418
+ $.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: $.icon }),
419
+ /* @__PURE__ */ t("span", { children: $.tab }),
420
+ s.includes($.id) && /* @__PURE__ */ t("span", { onClick: (R) => m(R, $.id), style: { marginLeft: 4, opacity: 0.6, fontSize: 12, cursor: "pointer" }, children: "✕" })
421
421
  ]
422
422
  },
423
- M.id
423
+ $.id
424
424
  );
425
- }) }), $ = x.find((M) => M.id === w), L = /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
426
- $ == null ? void 0 : $.content,
427
- ($ == null ? void 0 : $.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: $.html }, style: { padding: 16 } })
425
+ }) }), z = x.find(($) => $.id === S), N = /* @__PURE__ */ y("div", { className: "dhx-scroll", style: { flex: 1, overflow: "auto" }, children: [
426
+ z == null ? void 0 : z.content,
427
+ (z == null ? void 0 : z.html) && /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: z.html }, style: { padding: 16 } })
428
428
  ] });
429
- return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", flexDirection: i === "top" ? "column" : i === "bottom" ? "column-reverse" : i === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...y }, children: [
430
- k,
431
- L
429
+ return /* @__PURE__ */ y("div", { className: "dhx", style: { display: "flex", flexDirection: o === "top" ? "column" : o === "bottom" ? "column-reverse" : o === "left" ? "row" : "row-reverse", width: "100%", height: "100%", background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden", ...g }, children: [
430
+ w,
431
+ N
432
432
  ] });
433
433
  }
434
- const se = `1px solid ${e.border}`;
435
- function ut({ active: n, dir: i }) {
436
- return /* @__PURE__ */ g("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
437
- /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill: n && i === "asc" ? e.primary : e.borderDk }) }),
438
- /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill: n && i === "desc" ? e.primary : e.borderDk }) })
434
+ const ce = `1px solid ${e.border}`;
435
+ function Mt({ active: n, dir: o }) {
436
+ return /* @__PURE__ */ y("span", { style: { display: "inline-flex", flexDirection: "column", gap: 1, flexShrink: 0, marginLeft: 4 }, children: [
437
+ /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 0L7 4H0z", fill: n && o === "asc" ? e.primary : e.borderDk }) }),
438
+ /* @__PURE__ */ t("svg", { width: "7", height: "4", viewBox: "0 0 7 4", children: /* @__PURE__ */ t("path", { d: "M3.5 4L0 0H7z", fill: n && o === "desc" ? e.primary : e.borderDk }) })
439
439
  ] });
440
440
  }
441
- function Tt({
441
+ function $t({ options: n, value: o, onChange: d, onCommit: s, onCancel: f }) {
442
+ const [a, h] = I(o), [u, g] = I(!0), S = ne(null);
443
+ O(() => {
444
+ const i = (c) => {
445
+ S.current && !S.current.contains(c.target) && s();
446
+ };
447
+ return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
448
+ }, [s]);
449
+ const r = n.filter((i) => !a || i.toLowerCase().includes(a.toLowerCase()));
450
+ return /* @__PURE__ */ y("div", { ref: S, style: { width: "100%", position: "relative" }, children: [
451
+ /* @__PURE__ */ t(
452
+ "input",
453
+ {
454
+ autoFocus: !0,
455
+ value: a,
456
+ onChange: (i) => {
457
+ h(i.target.value), d(i.target.value), g(!0);
458
+ },
459
+ onKeyDown: (i) => {
460
+ i.key === "Enter" && s(), i.key === "Escape" && f();
461
+ },
462
+ onClick: (i) => i.stopPropagation(),
463
+ style: { width: "100%", border: "none", outline: `2px solid ${e.primary}`, borderRadius: 2, fontSize: 13, padding: "2px 4px", background: e.surface, color: e.text }
464
+ }
465
+ ),
466
+ u && r.length > 0 && /* @__PURE__ */ t("div", { style: { position: "absolute", top: "100%", left: 0, right: 0, zIndex: 50, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.r, boxShadow: e.shadowLg, maxHeight: 160, overflowY: "auto" }, children: r.map((i) => /* @__PURE__ */ t(
467
+ "div",
468
+ {
469
+ onMouseDown: (c) => {
470
+ c.preventDefault(), d(i), h(i), g(!1), s();
471
+ },
472
+ style: { padding: "6px 10px", cursor: "pointer", fontSize: 13, color: e.text },
473
+ onMouseEnter: (c) => c.currentTarget.style.background = e.bg,
474
+ onMouseLeave: (c) => c.currentTarget.style.background = e.surface,
475
+ children: i
476
+ },
477
+ i
478
+ )) })
479
+ ] });
480
+ }
481
+ function Dt(n, o) {
482
+ if (n == null) return "";
483
+ if (o === "number") return typeof n == "number" ? n.toLocaleString() : String(n);
484
+ if (o === "date") {
485
+ const d = n instanceof Date ? n : new Date(String(n));
486
+ return isNaN(d.getTime()) ? String(n) : d.toLocaleDateString();
487
+ }
488
+ return String(n);
489
+ }
490
+ function Ct(n, o, d) {
491
+ return n == null ? 1 : o == null ? -1 : d === "date" ? new Date(String(n)).getTime() - new Date(String(o)).getTime() : d === "number" ? Number(n) - Number(o) : String(n) < String(o) ? -1 : String(n) > String(o) ? 1 : 0;
492
+ }
493
+ function ve(n) {
494
+ var o;
495
+ return Array.isArray(n.header) && ((o = n.header[1]) == null ? void 0 : o.content) != null ? n.header[1].content : n.filterable ? n.filterType === "select" ? "selectFilter" : "inputFilter" : null;
496
+ }
497
+ function Lt(n, o, d, s, f) {
498
+ const a = {
499
+ width: "100%",
500
+ border: "none",
501
+ outline: `2px solid ${e.primary}`,
502
+ borderRadius: 2,
503
+ fontSize: 13,
504
+ padding: "2px 4px",
505
+ background: e.surface,
506
+ color: e.text
507
+ }, h = n.editorType ?? "input";
508
+ if (h === "select") return /* @__PURE__ */ t(
509
+ "select",
510
+ {
511
+ autoFocus: !0,
512
+ value: o,
513
+ onChange: (g) => d(g.target.value),
514
+ onBlur: s,
515
+ onKeyDown: (g) => {
516
+ g.key === "Enter" && s(), g.key === "Escape" && f();
517
+ },
518
+ onClick: (g) => g.stopPropagation(),
519
+ style: { ...a, cursor: "pointer" },
520
+ children: (n.options ?? []).map((g) => /* @__PURE__ */ t("option", { value: g, children: g }, g))
521
+ }
522
+ );
523
+ if (h === "combobox") return /* @__PURE__ */ t(
524
+ $t,
525
+ {
526
+ options: n.options ?? [],
527
+ value: o,
528
+ onChange: d,
529
+ onCommit: s,
530
+ onCancel: f
531
+ }
532
+ );
533
+ const u = n.type === "number" ? "number" : n.type === "date" ? "date" : "text";
534
+ return /* @__PURE__ */ t(
535
+ "input",
536
+ {
537
+ autoFocus: !0,
538
+ type: u,
539
+ value: o,
540
+ onChange: (g) => d(g.target.value),
541
+ onBlur: s,
542
+ onKeyDown: (g) => {
543
+ g.key === "Enter" && s(), g.key === "Escape" && f();
544
+ },
545
+ onClick: (g) => g.stopPropagation(),
546
+ style: a
547
+ }
548
+ );
549
+ }
550
+ function qt({
442
551
  columns: n,
443
- data: i = [],
444
- height: p = 400,
552
+ data: o = [],
553
+ height: d = 400,
445
554
  rowHeight: s = 40,
446
- sortable: f = !0,
447
- resizable: a = !0,
448
- editable: h = !1,
449
- stripe: d = !1,
450
- autoWidth: y = !1,
451
- keyNavigation: w = !1,
452
- selection: r,
453
- multiselect: l,
454
- onSelect: c,
455
- onChange: b,
456
- style: S
555
+ headerRowHeight: f = 40,
556
+ footerRowHeight: a = 40,
557
+ sortable: h = !0,
558
+ resizable: u = !0,
559
+ editable: g = !1,
560
+ stripe: S = !1,
561
+ autoWidth: r = !1,
562
+ keyNavigation: i = !1,
563
+ selection: c,
564
+ multiselect: m,
565
+ leftSplit: v = 0,
566
+ onSelect: l,
567
+ onChange: x,
568
+ style: w
457
569
  }) {
458
- const [o, x] = T(null), [k, $] = T("asc"), [L, m] = T({}), [M, A] = T(/* @__PURE__ */ new Set()), [u, I] = T(-1), [R, C] = T(() => n.map((v) => v.width ?? v.minWidth ?? 150)), [P, q] = T(null), [Q, ee] = T(""), [te, N] = T({}), z = U(null), [B, j] = T(0);
459
- K(_, []), K(() => {
460
- if (!y || !z.current) return;
461
- const v = new ResizeObserver(() => {
570
+ var De;
571
+ const [z, N] = I(null), [k, $] = I("asc"), [W, p] = I({}), [T, R] = I(/* @__PURE__ */ new Set()), [C, X] = I(-1), [G, se] = I(
572
+ () => Object.fromEntries(n.map((b) => [b.id, b.width ?? b.minWidth ?? 150]))
573
+ ), [Q, ie] = I(null), [E, M] = I(""), [H, P] = I({}), Y = ne(null), [K, re] = I(0);
574
+ O(_, []), O(() => {
575
+ if (!r || !Y.current) return;
576
+ const b = new ResizeObserver(() => {
462
577
  var D;
463
- return j(((D = z.current) == null ? void 0 : D.offsetWidth) ?? 0);
578
+ return re(((D = Y.current) == null ? void 0 : D.offsetWidth) ?? 0);
464
579
  });
465
- return v.observe(z.current), () => v.disconnect();
466
- }, [y]);
467
- const Y = ue(() => {
468
- if (!y || B === 0) return R;
469
- const v = R.reduce((W, E) => W + E, 0);
470
- if (B <= v) return R;
471
- const D = (B - v) / n.length;
472
- return R.map((W) => W + D);
473
- }, [y, B, R, n.length]), O = ue(() => {
474
- let v = i.map((D, W) => {
475
- const E = String(D.id ?? W);
476
- return te[E] ? { ...D, ...te[E] } : D;
580
+ return b.observe(Y.current), () => b.disconnect();
581
+ }, [r]);
582
+ const V = le(
583
+ () => n.map(
584
+ (b) => b.summary && (!b.footer || b.footer.length === 0) ? { ...b, footer: [{ summary: b.summary }] } : b
585
+ ),
586
+ [n]
587
+ ), q = le(
588
+ () => V.filter((b) => !b.hidden),
589
+ [V]
590
+ ), ee = le(() => {
591
+ if (!r || K === 0) return G;
592
+ const b = q.reduce((L, A) => L + (G[A.id] ?? 150), 0);
593
+ if (K <= b) return G;
594
+ const D = (K - b) / q.length;
595
+ return Object.fromEntries(q.map((L) => [L.id, (G[L.id] ?? 150) + D]));
596
+ }, [r, K, G, q]), Z = le(() => {
597
+ let b = o.map((D, L) => {
598
+ const A = String(D.id ?? L);
599
+ return H[A] ? { ...D, ...H[A] } : D;
477
600
  }).filter(
478
- (D) => Object.entries(L).every(([W, E]) => !E || String(D[W] ?? "").toLowerCase().includes(E.toLowerCase()))
601
+ (D) => Object.entries(W).every(
602
+ ([L, A]) => !A || String(D[L] ?? "").toLowerCase().includes(A.toLowerCase())
603
+ )
479
604
  );
480
- return o && (v = [...v].sort((D, W) => {
481
- const E = D[o], V = W[o];
482
- if (E == null) return 1;
483
- if (V == null) return -1;
484
- const F = E < V ? -1 : E > V ? 1 : 0;
485
- return k === "asc" ? F : -F;
486
- })), v;
487
- }, [i, o, k, L, te]), J = ue(() => {
488
- const v = {};
489
- return n.forEach((D) => {
490
- var W;
491
- if ((W = D.footer) != null && W.some((E) => E.summary)) {
492
- const E = O.map((F) => Number(F[D.id])).filter((F) => !isNaN(F)), V = E.reduce((F, de) => F + de, 0);
493
- v[D.id] = { sum: V, avg: E.length ? V / E.length : 0, count: O.length, min: E.length ? Math.min(...E) : 0, max: E.length ? Math.max(...E) : 0 };
605
+ if (z) {
606
+ const D = V.find((L) => L.id === z);
607
+ b = [...b].sort((L, A) => {
608
+ const j = Ct(L[z], A[z], D == null ? void 0 : D.type);
609
+ return k === "asc" ? j : -j;
610
+ });
611
+ }
612
+ return b;
613
+ }, [o, z, k, W, H, V]), xe = le(() => {
614
+ const b = {};
615
+ return V.forEach((D) => {
616
+ var L;
617
+ if ((L = D.footer) != null && L.some((A) => A.summary)) {
618
+ const A = Z.map((B) => Number(B[D.id])).filter((B) => !isNaN(B)), j = A.reduce((B, J) => B + J, 0);
619
+ b[D.id] = { sum: j, avg: A.length ? j / A.length : 0, count: Z.length, min: A.length ? Math.min(...A) : 0, max: A.length ? Math.max(...A) : 0 };
494
620
  }
495
- }), v;
496
- }, [O, n]), X = ue(() => {
497
- const v = {};
498
- return n.filter((D) => D.filterType === "select").forEach((D) => {
499
- v[D.id] = [...new Set(i.map((W) => String(W[D.id] ?? "")))].sort();
500
- }), v;
501
- }, [i, n]), oe = n.some((v) => v.filterable), ne = n.some((v) => {
621
+ }), b;
622
+ }, [Z, V]), ue = le(() => {
623
+ const b = {};
624
+ return q.filter((D) => {
625
+ const L = ve(D);
626
+ return L === "selectFilter" || L === "comboFilter";
627
+ }).forEach((D) => {
628
+ b[D.id] = [...new Set(o.map((L) => String(L[D.id] ?? "")))].sort();
629
+ }), b;
630
+ }, [o, q]), F = q.some((b) => ve(b) !== null), de = V.some((b) => {
502
631
  var D;
503
- return (D = v.footer) == null ? void 0 : D.length;
504
- }), ie = Y.reduce((v, D) => v + D, 0), le = (v, D) => v.id ?? D, ae = (v) => {
505
- !f || v.sortable === !1 || ($((D) => o === v.id && D === "asc" ? "desc" : "asc"), x(v.id));
506
- }, H = (v, D) => {
507
- if (!r) return;
508
- const W = le(v, D);
509
- I(D), A((E) => {
510
- const V = l ? new Set(E) : /* @__PURE__ */ new Set();
511
- return V.has(W) ? V.delete(W) : V.add(W), V;
512
- }), c == null || c(v);
513
- }, re = () => {
514
- if (!P) return;
515
- const { key: v, colId: D } = P;
516
- N((E) => ({ ...E, [String(v)]: { ...E[String(v)] || {}, [D]: Q } }));
517
- const W = O.find((E, V) => le(E, V) === v);
518
- W && (b == null || b(W, D, Q)), q(null);
519
- }, Ae = (v) => {
520
- if (P && v.key === "Escape") {
521
- q(null);
632
+ return (D = b.footer) == null ? void 0 : D.length;
633
+ }), Ve = q.reduce((b, D) => b + (ee[D.id] ?? 150), 0), pe = le(() => {
634
+ if (!v) return {};
635
+ let b = 0;
636
+ const D = {};
637
+ return q.forEach((L, A) => {
638
+ A < v && (D[L.id] = b, b += ee[L.id] ?? 150);
639
+ }), D;
640
+ }, [v, q, ee]), $e = v > 0 ? (De = q[v - 1]) == null ? void 0 : De.id : null, ye = (b, D) => b.id ?? D, Xe = (b) => {
641
+ !h || b.sortable === !1 || ($((D) => z === b.id && D === "asc" ? "desc" : "asc"), N(b.id));
642
+ }, be = (b, D) => {
643
+ if (!c) return;
644
+ const L = ye(b, D);
645
+ X(D), R((A) => {
646
+ const j = m ? new Set(A) : /* @__PURE__ */ new Set();
647
+ return j.has(L) ? j.delete(L) : j.add(L), j;
648
+ }), l == null || l(b);
649
+ }, qe = () => {
650
+ if (!Q) return;
651
+ const { key: b, colId: D } = Q;
652
+ P((A) => ({ ...A, [String(b)]: { ...A[String(b)] || {}, [D]: E } }));
653
+ const L = Z.find((A, j) => ye(A, j) === b);
654
+ L && (x == null || x(L, D, E)), ie(null);
655
+ }, Ge = (b) => {
656
+ if (Q && b.key === "Escape") {
657
+ ie(null);
522
658
  return;
523
659
  }
524
- if (!(!w || !r)) {
525
- if (v.key === "ArrowDown") {
526
- v.preventDefault();
527
- const D = Math.min(u + 1, O.length - 1);
528
- D >= 0 && H(O[D], D);
529
- } else if (v.key === "ArrowUp") {
530
- v.preventDefault();
531
- const D = Math.max(u - 1, 0);
532
- D >= 0 && H(O[D], D);
660
+ if (!(!i || !c)) {
661
+ if (b.key === "ArrowDown") {
662
+ b.preventDefault();
663
+ const D = Math.min(C + 1, Z.length - 1);
664
+ D >= 0 && be(Z[D], D);
665
+ } else if (b.key === "ArrowUp") {
666
+ b.preventDefault();
667
+ const D = Math.max(C - 1, 0);
668
+ D >= 0 && be(Z[D], D);
533
669
  }
534
670
  }
535
- }, Be = (v, D) => {
536
- v.preventDefault(), v.stopPropagation();
537
- const W = v.clientX, E = R[D], V = (de) => C((ge) => {
538
- const ce = [...ge];
539
- return ce[D] = Math.max(n[D].minWidth || 50, E + de.clientX - W), ce;
540
- }), F = () => {
541
- document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", F);
671
+ }, Je = (b, D) => {
672
+ b.preventDefault(), b.stopPropagation();
673
+ const L = b.clientX, A = G[D] ?? 150, j = n.find((U) => U.id === D), B = (U) => se((ae) => ({
674
+ ...ae,
675
+ [D]: Math.max((j == null ? void 0 : j.minWidth) || 50, A + U.clientX - L)
676
+ })), J = () => {
677
+ document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", J);
542
678
  };
543
- document.addEventListener("mousemove", V), document.addEventListener("mouseup", F);
544
- }, xe = (v, D, W, E) => ({
545
- width: v,
546
- minWidth: v,
547
- flexShrink: 0,
548
- boxSizing: "border-box",
549
- padding: "0 12px",
550
- height: E,
551
- display: "flex",
552
- alignItems: "center",
553
- overflow: "hidden",
554
- textOverflow: "ellipsis",
555
- whiteSpace: "nowrap",
556
- fontSize: 13,
557
- textAlign: D.align,
558
- justifyContent: D.align === "center" ? "center" : D.align === "right" ? "flex-end" : "flex-start",
559
- borderLeft: W ? "none" : se
560
- });
679
+ document.addEventListener("mousemove", B), document.addEventListener("mouseup", J);
680
+ }, me = (b, D, L, A, j, B = "hidden") => {
681
+ const J = b in pe;
682
+ return {
683
+ width: D,
684
+ minWidth: D,
685
+ flexShrink: 0,
686
+ boxSizing: "border-box",
687
+ padding: "0 12px",
688
+ height: j,
689
+ display: "flex",
690
+ alignItems: "center",
691
+ overflow: B,
692
+ textOverflow: "ellipsis",
693
+ whiteSpace: "nowrap",
694
+ fontSize: 13,
695
+ textAlign: L,
696
+ justifyContent: L === "center" ? "center" : L === "right" ? "flex-end" : "flex-start",
697
+ borderLeft: A ? "none" : ce,
698
+ position: J ? "sticky" : "relative",
699
+ ...J ? {
700
+ left: pe[b],
701
+ zIndex: 1,
702
+ boxShadow: b === $e ? "2px 0 6px rgba(0,0,0,0.1)" : void 0
703
+ } : {}
704
+ };
705
+ };
561
706
  return /* @__PURE__ */ t(
562
707
  "div",
563
708
  {
564
- ref: z,
709
+ ref: Y,
565
710
  className: "dhx",
566
- tabIndex: w ? 0 : void 0,
567
- onKeyDown: Ae,
568
- style: { width: "100%", height: p, display: "flex", flexDirection: "column", border: se, borderRadius: e.r, overflow: "hidden", outline: "none", ...S },
569
- children: /* @__PURE__ */ t("div", { style: { overflowX: "auto", flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ g("div", { style: { minWidth: ie, display: "flex", flexDirection: "column", height: "100%" }, children: [
570
- /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: se, flexShrink: 0, position: "sticky", top: 0, zIndex: 2 }, children: n.map((v, D) => {
571
- var W;
572
- return /* @__PURE__ */ g(
711
+ tabIndex: i ? 0 : void 0,
712
+ onKeyDown: Ge,
713
+ style: { width: "100%", height: d, display: "flex", flexDirection: "column", border: ce, borderRadius: e.r, overflow: "hidden", outline: "none", ...w },
714
+ children: /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { overflow: "auto", flex: 1 }, children: /* @__PURE__ */ y("div", { style: { minWidth: Ve, display: "flex", flexDirection: "column", minHeight: "100%" }, children: [
715
+ /* @__PURE__ */ t("div", { style: { display: "flex", background: e.bg, borderBottom: ce, flexShrink: 0, position: "sticky", top: 0, zIndex: 3 }, children: q.map((b, D) => {
716
+ const L = Array.isArray(b.header) ? b.header[0] : null, A = (L == null ? void 0 : L.text) ?? (typeof b.header == "string" ? b.header : b.id), j = (L == null ? void 0 : L.align) ?? b.align, B = ee[b.id] ?? 150, J = b.id in pe;
717
+ return /* @__PURE__ */ y(
573
718
  "div",
574
719
  {
575
- onClick: () => ae(v),
720
+ onClick: () => Xe(b),
576
721
  style: {
577
- ...xe(Y[D], v, D === 0, 40),
578
- position: "relative",
722
+ ...me(b.id, B, j, D === 0, f),
579
723
  fontWeight: 500,
580
724
  color: e.text,
581
- cursor: f && v.sortable !== !1 ? "pointer" : "default",
582
- userSelect: "none"
725
+ background: e.bg,
726
+ cursor: h && b.sortable !== !1 ? "pointer" : "default",
727
+ userSelect: "none",
728
+ ...J ? { zIndex: 4 } : {}
583
729
  },
584
730
  children: [
585
- /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: Array.isArray(v.header) ? (W = v.header[0]) == null ? void 0 : W.text : v.header || v.id }),
586
- f && v.sortable !== !1 && /* @__PURE__ */ t(ut, { active: o === v.id, dir: k }),
587
- a && v.resizable !== !1 && D < n.length - 1 && /* @__PURE__ */ t(
731
+ L != null && L.htmlEnable ? /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden" }, dangerouslySetInnerHTML: { __html: A } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: A }),
732
+ h && b.sortable !== !1 && /* @__PURE__ */ t(Mt, { active: z === b.id, dir: k }),
733
+ u && b.resizable !== !1 && D < q.length - 1 && /* @__PURE__ */ t(
588
734
  "div",
589
735
  {
590
- onMouseDown: (E) => Be(E, D),
591
- onClick: (E) => E.stopPropagation(),
736
+ onMouseDown: (U) => Je(U, b.id),
737
+ onClick: (U) => U.stopPropagation(),
592
738
  style: { position: "absolute", right: 0, top: 0, bottom: 0, width: 4, cursor: "col-resize", zIndex: 1 },
593
- onMouseEnter: (E) => E.currentTarget.style.background = e.primary + "55",
594
- onMouseLeave: (E) => E.currentTarget.style.background = "transparent"
739
+ onMouseEnter: (U) => U.currentTarget.style.background = e.primary + "55",
740
+ onMouseLeave: (U) => U.currentTarget.style.background = "transparent"
595
741
  }
596
742
  )
597
743
  ]
598
744
  },
599
- v.id
745
+ b.id
600
746
  );
601
747
  }) }),
602
- oe && /* @__PURE__ */ t("div", { style: { display: "flex", borderBottom: se, background: e.surface, flexShrink: 0 }, children: n.map((v, D) => /* @__PURE__ */ t("div", { style: { width: Y[D], minWidth: Y[D], flexShrink: 0, padding: "4px 6px", boxSizing: "border-box", borderLeft: D === 0 ? "none" : se }, children: v.filterable && v.filterType === "select" ? /* @__PURE__ */ g(
603
- "select",
604
- {
605
- className: "dhx dhx-input",
606
- style: { height: 26, fontSize: 12, padding: "0 4px" },
607
- value: L[v.id] || "",
608
- onChange: (W) => m((E) => ({ ...E, [v.id]: W.target.value })),
609
- children: [
610
- /* @__PURE__ */ t("option", { value: "", children: "All" }),
611
- (X[v.id] || []).map((W) => /* @__PURE__ */ t("option", { value: W, children: W }, W))
612
- ]
613
- }
614
- ) : v.filterable ? /* @__PURE__ */ t(
615
- "input",
616
- {
617
- className: "dhx dhx-input",
618
- style: { height: 26, fontSize: 12 },
619
- placeholder: "Filter...",
620
- value: L[v.id] || "",
621
- onChange: (W) => m((E) => ({ ...E, [v.id]: W.target.value }))
622
- }
623
- ) : null }, v.id)) }),
624
- /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: [
625
- O.map((v, D) => {
626
- const W = le(v, D), E = M.has(W), V = E ? e.primaryLt : d && D % 2 !== 0 ? e.bg : e.surface;
748
+ F && /* @__PURE__ */ t("div", { style: {
749
+ display: "flex",
750
+ borderBottom: ce,
751
+ background: e.surface,
752
+ flexShrink: 0,
753
+ ...v ? { position: "sticky", top: f, zIndex: 3 } : {}
754
+ }, children: q.map((b, D) => {
755
+ const L = ve(b), A = ee[b.id] ?? 150, j = b.id in pe;
756
+ return /* @__PURE__ */ t("div", { style: {
757
+ width: A,
758
+ minWidth: A,
759
+ flexShrink: 0,
760
+ padding: "4px 6px",
761
+ boxSizing: "border-box",
762
+ borderLeft: D === 0 ? "none" : ce,
763
+ background: e.surface,
764
+ ...j ? {
765
+ position: "sticky",
766
+ left: pe[b.id],
767
+ zIndex: 4,
768
+ boxShadow: b.id === $e ? "2px 0 6px rgba(0,0,0,0.1)" : void 0
769
+ } : {}
770
+ }, children: L === "selectFilter" || L === "comboFilter" ? /* @__PURE__ */ y(
771
+ "select",
772
+ {
773
+ className: "dhx dhx-input",
774
+ style: { height: 26, fontSize: 12, padding: "0 4px" },
775
+ value: W[b.id] || "",
776
+ onChange: (B) => p((J) => ({ ...J, [b.id]: B.target.value })),
777
+ children: [
778
+ /* @__PURE__ */ t("option", { value: "", children: "All" }),
779
+ (ue[b.id] || []).map((B) => /* @__PURE__ */ t("option", { value: B, children: B }, B))
780
+ ]
781
+ }
782
+ ) : L === "inputFilter" ? /* @__PURE__ */ t(
783
+ "input",
784
+ {
785
+ className: "dhx dhx-input",
786
+ style: { height: 26, fontSize: 12 },
787
+ placeholder: "Filter...",
788
+ value: W[b.id] || "",
789
+ onChange: (B) => p((J) => ({ ...J, [b.id]: B.target.value }))
790
+ }
791
+ ) : null }, b.id);
792
+ }) }),
793
+ /* @__PURE__ */ y("div", { style: { flex: 1 }, children: [
794
+ Z.map((b, D) => {
795
+ const L = ye(b, D), A = T.has(L), j = A ? e.primaryLt : S && D % 2 !== 0 ? e.bg : e.surface;
627
796
  return /* @__PURE__ */ t(
628
797
  "div",
629
798
  {
630
- style: { display: "flex", height: s, borderBottom: se, flexShrink: 0, background: V, transition: "background .1s", cursor: r ? "pointer" : "default" },
631
- onMouseEnter: (F) => !E && (F.currentTarget.style.background = e.primaryLt + "80"),
632
- onMouseLeave: (F) => !E && (F.currentTarget.style.background = V),
633
- children: n.map((F, de) => {
634
- const ge = (P == null ? void 0 : P.key) === W && (P == null ? void 0 : P.colId) === F.id, ce = v[F.id], He = F.template ? F.template(ce, v) : String(ce ?? "");
635
- return /* @__PURE__ */ t(
799
+ style: { display: "flex", height: s, borderBottom: ce, flexShrink: 0, background: j, transition: "background .1s", cursor: c ? "pointer" : "default" },
800
+ onMouseEnter: (B) => !A && (B.currentTarget.style.background = e.primaryLt + "80"),
801
+ onMouseLeave: (B) => !A && (B.currentTarget.style.background = j),
802
+ children: q.map((B, J) => {
803
+ const U = (Q == null ? void 0 : Q.key) === L && (Q == null ? void 0 : Q.colId) === B.id, ae = b[B.id], Ue = ee[B.id] ?? 150, Ce = (g || B.editable) && B.editable !== !1;
804
+ let he;
805
+ return U ? he = Lt(B, E, M, qe, () => ie(null)) : B.template ? he = B.template(ae, b) : B.htmlEnable ? he = /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: String(ae ?? "") } }) : B.type === "boolean" ? he = /* @__PURE__ */ t(
806
+ "input",
807
+ {
808
+ type: "checkbox",
809
+ readOnly: !0,
810
+ checked: !!ae,
811
+ style: { width: 16, height: 16, accentColor: e.primary, cursor: Ce ? "pointer" : "default" }
812
+ }
813
+ ) : he = Dt(ae, B.type), /* @__PURE__ */ t(
636
814
  "div",
637
815
  {
638
816
  onClick: () => {
639
- H(v, D), h && F.editable !== !1 && (q({ key: W, colId: F.id }), ee(String(ce ?? "")));
817
+ if (be(b, D), !!Ce)
818
+ if (B.type === "boolean") {
819
+ const Le = !ae, Ie = String(L);
820
+ P((Te) => ({ ...Te, [Ie]: { ...Te[Ie] || {}, [B.id]: Le } })), x == null || x(b, B.id, Le);
821
+ } else
822
+ ie({ key: L, colId: B.id }), M(String(ae ?? ""));
640
823
  },
641
- style: xe(Y[de], F, de === 0, s),
642
- children: ge ? /* @__PURE__ */ t(
643
- "input",
644
- {
645
- autoFocus: !0,
646
- value: Q,
647
- onChange: (pe) => ee(pe.target.value),
648
- onBlur: re,
649
- onKeyDown: (pe) => {
650
- pe.key === "Enter" && re(), pe.key === "Escape" && q(null);
651
- },
652
- onClick: (pe) => pe.stopPropagation(),
653
- style: { width: "100%", border: "none", outline: `2px solid ${e.primary}`, borderRadius: 2, fontSize: 13, padding: "2px 4px", background: e.surface, color: e.text }
654
- }
655
- ) : He
824
+ style: { ...me(B.id, Ue, B.align, J === 0, s, U ? "visible" : "hidden"), background: j },
825
+ children: he
656
826
  },
657
- F.id
827
+ B.id
658
828
  );
659
829
  })
660
830
  },
661
- String(W)
831
+ String(L)
662
832
  );
663
833
  }),
664
- O.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
834
+ Z.length === 0 && /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: 40, color: e.textMut, fontSize: 13 }, children: "No data" })
665
835
  ] }),
666
- ne && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: se, background: e.bg, flexShrink: 0 }, children: n.map((v, D) => {
667
- var F;
668
- const W = (F = v.footer) == null ? void 0 : F[0], E = J[v.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
669
- let V = "";
670
- return W && (typeof W.text == "function" ? V = W.text(E) : W.text ? V = W.text : W.summary && (V = String(Math.round(E[W.summary] * 100) / 100))), /* @__PURE__ */ t("div", { style: { ...xe(Y[D], v, D === 0, 40), fontWeight: 600, color: e.text }, children: V }, v.id);
836
+ de && /* @__PURE__ */ t("div", { style: { display: "flex", borderTop: ce, background: e.bg, flexShrink: 0, position: "sticky", bottom: 0, zIndex: 2 }, children: q.map((b, D) => {
837
+ var U;
838
+ const L = (U = b.footer) == null ? void 0 : U[0], A = xe[b.id] ?? { sum: 0, avg: 0, count: 0, min: 0, max: 0 };
839
+ let j = "";
840
+ L && (typeof L.text == "function" ? j = L.text(A) : L.text ? j = L.text : L.summary && (j = String(Math.round(A[L.summary] * 100) / 100)));
841
+ const B = ee[b.id] ?? 150, J = b.id in pe;
842
+ return /* @__PURE__ */ t("div", { style: {
843
+ ...me(b.id, B, b.align, D === 0, a),
844
+ fontWeight: 600,
845
+ color: e.text,
846
+ background: e.bg,
847
+ ...J ? { zIndex: 3 } : {}
848
+ }, children: j }, b.id);
671
849
  }) })
672
850
  ] }) })
673
851
  }
674
852
  );
675
853
  }
676
- const G = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
677
- function ht(n, i, p) {
854
+ const te = ["#0288d1", "#43a047", "#f57c00", "#e53935", "#8e24aa", "#00838f", "#ef6c00", "#2e7d32"];
855
+ function It(n, o, d) {
678
856
  const s = n.filter((a) => !a.parent), f = n.filter((a) => !!a.parent);
679
857
  return s.map((a) => ({
680
- name: a[p],
681
- children: f.filter((h) => h.parent === a.id).map((h) => ({ name: h[p], value: Number(h[i] ?? 0) }))
858
+ name: a[d],
859
+ children: f.filter((h) => h.parent === a.id).map((h) => ({ name: h[d], value: Number(h[o] ?? 0) }))
682
860
  }));
683
861
  }
684
- function Nt({
862
+ function Gt({
685
863
  type: n = "bar",
686
- data: i = [],
687
- series: p = [],
864
+ data: o = [],
865
+ series: d = [],
688
866
  scales: s = {},
689
867
  legend: f,
690
868
  height: a = 280,
691
869
  style: h
692
870
  }) {
693
- var x, k, $, L, m, M, A, u, I, R, C, P, q, Q, ee, te;
694
- K(_, []);
695
- const d = ((x = s.bottom) == null ? void 0 : x.text) || i[0] && Object.keys(i[0])[0] || "x", y = /* @__PURE__ */ t(
696
- Oe,
871
+ var x, w, z, N, k, $, W, p, T, R, C, X, G, se, Q, ie;
872
+ O(_, []);
873
+ const u = ((x = s.bottom) == null ? void 0 : x.text) || o[0] && Object.keys(o[0])[0] || "x", g = /* @__PURE__ */ t(
874
+ et,
697
875
  {
698
876
  contentStyle: { fontSize: 12, borderRadius: e.r, border: `1px solid ${e.border}` }
699
877
  }
700
- ), w = f ? /* @__PURE__ */ t(
701
- Ye,
878
+ ), S = f ? /* @__PURE__ */ t(
879
+ tt,
702
880
  {
703
881
  iconSize: 10,
704
882
  wrapperStyle: { fontSize: 12 },
705
883
  verticalAlign: f.valign === "bottom" ? "bottom" : f.valign === "middle" ? "middle" : "top",
706
884
  align: f.halign ?? "center"
707
885
  }
708
- ) : null, r = /* @__PURE__ */ t(Fe, { strokeDasharray: "3 3", stroke: e.border }), l = /* @__PURE__ */ t(
709
- Se,
886
+ ) : null, r = /* @__PURE__ */ t(nt, { strokeDasharray: "3 3", stroke: e.border }), i = /* @__PURE__ */ t(
887
+ Ne,
710
888
  {
711
- dataKey: d,
889
+ dataKey: u,
712
890
  tick: { fontSize: 11, fill: e.textSec },
713
891
  axisLine: { stroke: e.border },
714
892
  tickLine: !1,
715
- label: (k = s.bottom) != null && k.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
893
+ label: (w = s.bottom) != null && w.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
716
894
  }
717
895
  ), c = /* @__PURE__ */ t(
718
- we,
896
+ Ee,
719
897
  {
720
898
  tick: { fontSize: 11, fill: e.textSec },
721
899
  axisLine: !1,
722
900
  tickLine: !1,
723
- domain: [(($ = s.left) == null ? void 0 : $.min) ?? "auto", ((L = s.left) == null ? void 0 : L.max) ?? "auto"],
724
- tickCount: (m = s.left) == null ? void 0 : m.maxTicks,
725
- label: (M = s.left) != null && M.title ? { value: s.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
901
+ domain: [((z = s.left) == null ? void 0 : z.min) ?? "auto", ((N = s.left) == null ? void 0 : N.max) ?? "auto"],
902
+ tickCount: (k = s.left) == null ? void 0 : k.maxTicks,
903
+ label: ($ = s.left) != null && $.title ? { value: s.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
726
904
  }
727
- ), b = {
905
+ ), m = {
728
906
  top: 10,
729
907
  right: 20,
730
908
  left: 0,
731
- bottom: (A = s.bottom) != null && A.title ? 20 : 0
732
- }, S = { data: i, margin: b };
733
- let o;
909
+ bottom: (W = s.bottom) != null && W.title ? 20 : 0
910
+ }, v = { data: o, margin: m };
911
+ let l;
734
912
  if (n === "bar")
735
- o = /* @__PURE__ */ g(Ke, { ...S, children: [
913
+ l = /* @__PURE__ */ y(rt, { ...v, children: [
736
914
  r,
737
- l,
915
+ i,
738
916
  c,
739
- y,
740
- w,
741
- p.map((N, z) => /* @__PURE__ */ t(
742
- Ve,
917
+ g,
918
+ S,
919
+ d.map((E, M) => /* @__PURE__ */ t(
920
+ ot,
743
921
  {
744
- dataKey: N.value || N.id || "",
745
- name: N.label || N.id,
746
- fill: N.fill || N.color || G[z % G.length],
922
+ dataKey: E.value || E.id || "",
923
+ name: E.label || E.id,
924
+ fill: E.fill || E.color || te[M % te.length],
747
925
  radius: [3, 3, 0, 0]
748
926
  },
749
- N.id ?? z
927
+ E.id ?? M
750
928
  ))
751
929
  ] });
752
930
  else if (n === "line")
753
- o = /* @__PURE__ */ g(_e, { ...S, children: [
931
+ l = /* @__PURE__ */ y(it, { ...v, children: [
754
932
  r,
755
- l,
933
+ i,
756
934
  c,
757
- y,
758
- w,
759
- p.map((N, z) => {
760
- const B = N.color || G[z % G.length];
935
+ g,
936
+ S,
937
+ d.map((E, M) => {
938
+ const H = E.color || te[M % te.length];
761
939
  return /* @__PURE__ */ t(
762
- Xe,
940
+ lt,
763
941
  {
764
942
  type: "monotone",
765
- dataKey: N.value || N.id || "",
766
- name: N.label || N.id,
767
- stroke: B,
768
- strokeWidth: N.strokeWidth ?? 2,
769
- dot: { r: 3, fill: B }
943
+ dataKey: E.value || E.id || "",
944
+ name: E.label || E.id,
945
+ stroke: H,
946
+ strokeWidth: E.strokeWidth ?? 2,
947
+ dot: { r: 3, fill: H }
770
948
  },
771
- N.id ?? z
949
+ E.id ?? M
772
950
  );
773
951
  })
774
952
  ] });
775
953
  else if (n === "area")
776
- o = /* @__PURE__ */ g(qe, { ...S, children: [
954
+ l = /* @__PURE__ */ y(st, { ...v, children: [
777
955
  r,
778
- l,
956
+ i,
779
957
  c,
780
- y,
781
- w,
782
- p.map((N, z) => {
783
- const B = N.color || G[z % G.length];
958
+ g,
959
+ S,
960
+ d.map((E, M) => {
961
+ const H = E.color || te[M % te.length];
784
962
  return /* @__PURE__ */ t(
785
- Ge,
963
+ at,
786
964
  {
787
965
  type: "monotone",
788
- dataKey: N.value || N.id || "",
789
- name: N.label || N.id,
790
- stroke: B,
791
- fill: (N.fill || B) + "33",
792
- strokeWidth: N.strokeWidth ?? 2
966
+ dataKey: E.value || E.id || "",
967
+ name: E.label || E.id,
968
+ stroke: H,
969
+ fill: (E.fill || H) + "33",
970
+ strokeWidth: E.strokeWidth ?? 2
793
971
  },
794
- N.id ?? z
972
+ E.id ?? M
795
973
  );
796
974
  })
797
975
  ] });
798
976
  else if (n === "pie" || n === "donut") {
799
- const N = p[0] || {}, z = N.value || "value", B = N.text || "name", j = N.color && i[0] && N.color in i[0] ? N.color : null;
800
- o = /* @__PURE__ */ g(Je, { children: [
977
+ const E = d[0] || {}, M = E.value || "value", H = E.text || "name", P = E.color && o[0] && E.color in o[0] ? E.color : null;
978
+ l = /* @__PURE__ */ y(dt, { children: [
801
979
  /* @__PURE__ */ t(
802
- Ue,
980
+ ct,
803
981
  {
804
- data: i,
982
+ data: o,
805
983
  cx: "50%",
806
984
  cy: "50%",
807
985
  outerRadius: n === "donut" ? "70%" : "80%",
808
986
  innerRadius: n === "donut" ? "40%" : 0,
809
- dataKey: z,
810
- nameKey: B,
811
- stroke: N.stroke || "none",
812
- strokeWidth: N.strokeWidth ?? 0,
813
- label: ({ name: Y, percent: O }) => `${Y ?? ""} ${((O ?? 0) * 100).toFixed(0)}%`,
987
+ dataKey: M,
988
+ nameKey: H,
989
+ stroke: E.stroke || "none",
990
+ strokeWidth: E.strokeWidth ?? 0,
991
+ label: ({ name: Y, percent: K }) => `${Y ?? ""} ${((K ?? 0) * 100).toFixed(0)}%`,
814
992
  labelLine: !0,
815
993
  paddingAngle: 2,
816
- children: i.map((Y, O) => /* @__PURE__ */ t(
817
- Qe,
994
+ children: o.map((Y, K) => /* @__PURE__ */ t(
995
+ ut,
818
996
  {
819
- fill: j ? Y[j] : G[O % G.length]
997
+ fill: P ? Y[P] : te[K % te.length]
820
998
  },
821
- O
999
+ K
822
1000
  ))
823
1001
  }
824
1002
  ),
825
- y,
826
- w
1003
+ g,
1004
+ S
827
1005
  ] });
828
1006
  } else if (n === "radar") {
829
- const N = ((u = s.radial) == null ? void 0 : u.value) || d;
830
- o = /* @__PURE__ */ g(Ze, { ...S, cx: "50%", cy: "50%", children: [
831
- /* @__PURE__ */ t(et, {}),
832
- /* @__PURE__ */ t(tt, { dataKey: N, tick: { fontSize: 11 } }),
833
- /* @__PURE__ */ t(nt, { tick: { fontSize: 9, fill: e.textMut }, axisLine: !1 }),
834
- p.map((z, B) => {
835
- const j = z.color || z.pointColor || G[B % G.length];
1007
+ const E = ((p = s.radial) == null ? void 0 : p.value) || u;
1008
+ l = /* @__PURE__ */ y(pt, { ...v, cx: "50%", cy: "50%", children: [
1009
+ /* @__PURE__ */ t(ht, {}),
1010
+ /* @__PURE__ */ t(ft, { dataKey: E, tick: { fontSize: 11 } }),
1011
+ /* @__PURE__ */ t(xt, { tick: { fontSize: 9, fill: e.textMut }, axisLine: !1 }),
1012
+ d.map((M, H) => {
1013
+ const P = M.color || M.pointColor || te[H % te.length];
836
1014
  return /* @__PURE__ */ t(
837
- rt,
1015
+ gt,
838
1016
  {
839
- dataKey: z.value || z.id || "",
840
- name: z.label || z.id,
841
- stroke: j,
842
- fill: j + "44"
1017
+ dataKey: M.value || M.id || "",
1018
+ name: M.label || M.id,
1019
+ stroke: P,
1020
+ fill: P + "44"
843
1021
  },
844
- z.id ?? B
1022
+ M.id ?? H
845
1023
  );
846
1024
  }),
847
- y,
848
- w
1025
+ g,
1026
+ S
849
1027
  ] });
850
1028
  } else if (n === "scatter")
851
- o = /* @__PURE__ */ g(ot, { margin: b, children: [
1029
+ l = /* @__PURE__ */ y(yt, { margin: m, children: [
852
1030
  r,
853
1031
  /* @__PURE__ */ t(
854
- Se,
1032
+ Ne,
855
1033
  {
856
1034
  type: "number",
857
1035
  dataKey: "x",
858
- name: ((I = s.bottom) == null ? void 0 : I.title) || "x",
1036
+ name: ((T = s.bottom) == null ? void 0 : T.title) || "x",
859
1037
  tick: { fontSize: 11, fill: e.textSec },
860
1038
  tickLine: !1,
861
1039
  domain: [((R = s.bottom) == null ? void 0 : R.min) ?? "auto", ((C = s.bottom) == null ? void 0 : C.max) ?? "auto"],
862
- label: (P = s.bottom) != null && P.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
1040
+ label: (X = s.bottom) != null && X.title ? { value: s.bottom.title, position: "insideBottom", offset: -4, fontSize: 11 } : void 0
863
1041
  }
864
1042
  ),
865
1043
  /* @__PURE__ */ t(
866
- we,
1044
+ Ee,
867
1045
  {
868
1046
  type: "number",
869
1047
  dataKey: "y",
870
- name: ((q = s.left) == null ? void 0 : q.title) || "y",
1048
+ name: ((G = s.left) == null ? void 0 : G.title) || "y",
871
1049
  tick: { fontSize: 11, fill: e.textSec },
872
1050
  tickLine: !1,
873
1051
  axisLine: !1,
874
- domain: [((Q = s.left) == null ? void 0 : Q.min) ?? "auto", ((ee = s.left) == null ? void 0 : ee.max) ?? "auto"],
875
- label: (te = s.left) != null && te.title ? { value: s.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
1052
+ domain: [((se = s.left) == null ? void 0 : se.min) ?? "auto", ((Q = s.left) == null ? void 0 : Q.max) ?? "auto"],
1053
+ label: (ie = s.left) != null && ie.title ? { value: s.left.title, angle: -90, position: "insideLeft", fontSize: 11 } : void 0
876
1054
  }
877
1055
  ),
878
- y,
879
- w,
880
- p.map((N, z) => {
881
- const B = N.value || "x", j = N.valueY || "y", Y = (N.data || i).map((O) => ({
882
- x: O[B],
883
- y: O[j]
1056
+ g,
1057
+ S,
1058
+ d.map((E, M) => {
1059
+ const H = E.value || "x", P = E.valueY || "y", Y = (E.data || o).map((K) => ({
1060
+ x: K[H],
1061
+ y: K[P]
884
1062
  }));
885
1063
  return /* @__PURE__ */ t(
886
- it,
1064
+ bt,
887
1065
  {
888
1066
  data: Y,
889
- name: N.label || N.id,
890
- fill: N.color || G[z % G.length]
1067
+ name: E.label || E.id,
1068
+ fill: E.color || te[M % te.length]
891
1069
  },
892
- N.id ?? z
1070
+ E.id ?? M
893
1071
  );
894
1072
  })
895
1073
  ] });
896
1074
  else if (n === "treeMap") {
897
- const N = p[0] || {}, z = N.value || "value", B = N.text || "name", j = ht(i, z, B), Y = N.stroke || e.surface, O = N.strokeWidth ?? 2;
898
- o = /* @__PURE__ */ t(
899
- st,
1075
+ const E = d[0] || {}, M = E.value || "value", H = E.text || "name", P = It(o, M, H), Y = E.stroke || e.surface, K = E.strokeWidth ?? 2;
1076
+ l = /* @__PURE__ */ t(
1077
+ vt,
900
1078
  {
901
- data: j,
1079
+ data: P,
902
1080
  dataKey: "value",
903
1081
  aspectRatio: 4 / 3,
904
1082
  stroke: Y,
905
- content: (J) => {
906
- const { x: X, y: oe, width: ne, height: ie, depth: le, index: ae, name: H } = J;
907
- if (le === 0) return null;
908
- const re = G[ae % G.length];
909
- return /* @__PURE__ */ g("g", { children: [
1083
+ content: (re) => {
1084
+ const { x: V, y: q, width: ee, height: Z, depth: xe, index: ue, name: F } = re;
1085
+ if (xe === 0) return null;
1086
+ const de = te[ue % te.length];
1087
+ return /* @__PURE__ */ y("g", { children: [
910
1088
  /* @__PURE__ */ t(
911
1089
  "rect",
912
1090
  {
913
- x: X,
914
- y: oe,
915
- width: ne,
916
- height: ie,
917
- fill: re,
1091
+ x: V,
1092
+ y: q,
1093
+ width: ee,
1094
+ height: Z,
1095
+ fill: de,
918
1096
  stroke: Y,
919
- strokeWidth: O,
1097
+ strokeWidth: K,
920
1098
  style: { borderRadius: 3 }
921
1099
  }
922
1100
  ),
923
- ne > 40 && ie > 20 && /* @__PURE__ */ t(
1101
+ ee > 40 && Z > 20 && /* @__PURE__ */ t(
924
1102
  "text",
925
1103
  {
926
- x: X + ne / 2,
927
- y: oe + ie / 2,
1104
+ x: V + ee / 2,
1105
+ y: q + Z / 2,
928
1106
  textAnchor: "middle",
929
1107
  dominantBaseline: "middle",
930
1108
  fill: "#fff",
931
1109
  fontSize: 11,
932
1110
  pointerEvents: "none",
933
- children: H
1111
+ children: F
934
1112
  }
935
1113
  )
936
1114
  ] });
@@ -943,194 +1121,194 @@ function Nt({
943
1121
  {
944
1122
  className: "dhx",
945
1123
  style: { width: "100%", height: a, padding: 12, background: e.surface, borderRadius: e.rMd, ...h },
946
- children: /* @__PURE__ */ t(lt, { width: "100%", height: "100%", children: o })
1124
+ children: /* @__PURE__ */ t(mt, { width: "100%", height: "100%", children: l })
947
1125
  }
948
1126
  );
949
1127
  }
950
- const ft = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], xt = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
951
- function Rt({ value: n, range: i = !1, timepicker: p = !1, onChange: s, style: f }) {
952
- const a = /* @__PURE__ */ new Date(), h = n ? new Date(Array.isArray(n) ? n[0] : n) : a, [d, y] = T(h), [w, r] = T(n ?? (i ? [null, null] : null)), [l, c] = T(null), [b, S] = T({ h: 0, m: 0 });
953
- K(_, []);
954
- const o = d.getFullYear(), x = d.getMonth(), k = new Date(o, x, 1).getDay(), $ = new Date(o, x + 1, 0).getDate(), L = [];
955
- for (let u = 0; u < k; u++) L.push(null);
956
- for (let u = 1; u <= $; u++) L.push(new Date(o, x, u));
957
- const m = (u) => u.toDateString() === a.toDateString(), M = (u) => {
958
- if (!w) return !1;
959
- if (i && Array.isArray(w)) {
960
- const [I, R] = w;
961
- if (!I) return !1;
962
- const C = u.getTime();
963
- return R ? C >= I.getTime() && C <= R.getTime() : u.toDateString() === I.toDateString();
1128
+ const Tt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], Nt = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
1129
+ function Jt({ value: n, range: o = !1, timepicker: d = !1, onChange: s, style: f }) {
1130
+ const a = /* @__PURE__ */ new Date(), h = n ? new Date(Array.isArray(n) ? n[0] : n) : a, [u, g] = I(h), [S, r] = I(n ?? (o ? [null, null] : null)), [i, c] = I(null), [m, v] = I({ h: 0, m: 0 });
1131
+ O(_, []);
1132
+ const l = u.getFullYear(), x = u.getMonth(), w = new Date(l, x, 1).getDay(), z = new Date(l, x + 1, 0).getDate(), N = [];
1133
+ for (let p = 0; p < w; p++) N.push(null);
1134
+ for (let p = 1; p <= z; p++) N.push(new Date(l, x, p));
1135
+ const k = (p) => p.toDateString() === a.toDateString(), $ = (p) => {
1136
+ if (!S) return !1;
1137
+ if (o && Array.isArray(S)) {
1138
+ const [T, R] = S;
1139
+ if (!T) return !1;
1140
+ const C = p.getTime();
1141
+ return R ? C >= T.getTime() && C <= R.getTime() : p.toDateString() === T.toDateString();
964
1142
  }
965
- return u.toDateString() === w.toDateString();
966
- }, A = (u) => {
967
- if (i) {
968
- const [I, R] = Array.isArray(w) ? w : [null, null];
969
- if (!I || R)
970
- r([u, null]);
1143
+ return p.toDateString() === S.toDateString();
1144
+ }, W = (p) => {
1145
+ if (o) {
1146
+ const [T, R] = Array.isArray(S) ? S : [null, null];
1147
+ if (!T || R)
1148
+ r([p, null]);
971
1149
  else {
972
- const C = u < I ? [u, I] : [I, u];
1150
+ const C = p < T ? [p, T] : [T, p];
973
1151
  r(C), s == null || s(C);
974
1152
  }
975
1153
  } else
976
- r(u), s == null || s(u);
1154
+ r(p), s == null || s(p);
977
1155
  };
978
- return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...f }, children: [
979
- /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
980
- /* @__PURE__ */ t("button", { onClick: () => y((u) => new Date(u.getFullYear(), u.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
981
- /* @__PURE__ */ g("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
982
- ft[x],
1156
+ return /* @__PURE__ */ y("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...f }, children: [
1157
+ /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 12 }, children: [
1158
+ /* @__PURE__ */ t("button", { onClick: () => g((p) => new Date(p.getFullYear(), p.getMonth() - 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "‹" }),
1159
+ /* @__PURE__ */ y("div", { style: { fontWeight: 700, fontSize: 14 }, children: [
1160
+ Tt[x],
983
1161
  " ",
984
- o
1162
+ l
985
1163
  ] }),
986
- /* @__PURE__ */ t("button", { onClick: () => y((u) => new Date(u.getFullYear(), u.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
1164
+ /* @__PURE__ */ t("button", { onClick: () => g((p) => new Date(p.getFullYear(), p.getMonth() + 1, 1)), className: "dhx dhx-btn dhx-btn-ghost", style: { height: 28, padding: "0 8px", fontSize: 16 }, children: "›" })
987
1165
  ] }),
988
- /* @__PURE__ */ g("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
989
- xt.map((u) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: u }, u)),
990
- L.map((u, I) => {
991
- const R = u ? M(u) : !1, C = u && l && u.toDateString() === l.toDateString();
1166
+ /* @__PURE__ */ y("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 32px)", gap: 2 }, children: [
1167
+ Nt.map((p) => /* @__PURE__ */ t("div", { style: { textAlign: "center", fontSize: 11, fontWeight: 600, color: e.textMut, paddingBottom: 4 }, children: p }, p)),
1168
+ N.map((p, T) => {
1169
+ const R = p ? $(p) : !1, C = p && i && p.toDateString() === i.toDateString();
992
1170
  return /* @__PURE__ */ t(
993
1171
  "div",
994
1172
  {
995
- onClick: () => u && A(u),
996
- onMouseEnter: () => u && c(u),
1173
+ onClick: () => p && W(p),
1174
+ onMouseEnter: () => p && c(p),
997
1175
  onMouseLeave: () => c(null),
998
- style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: u ? "pointer" : "default", fontSize: 12, fontWeight: u && m(u) ? 700 : 400, background: R ? e.primary : C ? e.bg : "transparent", color: R ? "#fff" : u && m(u) ? e.primary : u ? e.text : "transparent", border: u && m(u) && !R ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
999
- children: u == null ? void 0 : u.getDate()
1176
+ style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: e.r, cursor: p ? "pointer" : "default", fontSize: 12, fontWeight: p && k(p) ? 700 : 400, background: R ? e.primary : C ? e.bg : "transparent", color: R ? "#fff" : p && k(p) ? e.primary : p ? e.text : "transparent", border: p && k(p) && !R ? `1px solid ${e.primary}` : "1px solid transparent", transition: "all .1s" },
1177
+ children: p == null ? void 0 : p.getDate()
1000
1178
  },
1001
- I
1179
+ T
1002
1180
  );
1003
1181
  })
1004
1182
  ] }),
1005
- p && /* @__PURE__ */ g("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
1006
- /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: b.h, onChange: (u) => S((I) => ({ ...I, h: +u.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
1183
+ d && /* @__PURE__ */ y("div", { style: { borderTop: `1px solid ${e.border}`, marginTop: 12, paddingTop: 12, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
1184
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 23, value: m.h, onChange: (p) => v((T) => ({ ...T, h: +p.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } }),
1007
1185
  /* @__PURE__ */ t("span", { style: { fontWeight: 700, color: e.textSec }, children: ":" }),
1008
- /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: b.m, onChange: (u) => S((I) => ({ ...I, m: +u.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
1186
+ /* @__PURE__ */ t("input", { type: "number", min: 0, max: 59, value: m.m, onChange: (p) => v((T) => ({ ...T, m: +p.target.value })), className: "dhx dhx-input", style: { width: 50, textAlign: "center" } })
1009
1187
  ] })
1010
1188
  ] });
1011
1189
  }
1012
- function gt({ value: n, onChange: i, timeFormat: p = 12, controls: s = !1, minuteStep: f = 5, style: a }) {
1013
- const [h, d] = T((n == null ? void 0 : n.h) ?? (p === 24 ? 0 : 12)), [y, w] = T((n == null ? void 0 : n.m) ?? 0), [r, l] = T((n == null ? void 0 : n.ampm) ?? "AM"), [c, b] = T(null);
1014
- K(_, []);
1015
- const S = p === 24 ? Array.from({ length: 24 }, (m, M) => M) : Array.from({ length: 12 }, (m, M) => M + 1), o = Array.from({ length: Math.ceil(60 / f) }, (m, M) => M * f), x = (m, M, A) => {
1016
- const u = p === 24 ? { h: m, m: M } : { h: m, m: M, ampm: A };
1017
- s ? b(u) : i == null || i(u);
1018
- }, k = () => {
1019
- b(null), d((n == null ? void 0 : n.h) ?? (p === 24 ? 0 : 12)), w((n == null ? void 0 : n.m) ?? 0), l((n == null ? void 0 : n.ampm) ?? "AM");
1020
- }, $ = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, L = (m) => ({
1190
+ function Et({ value: n, onChange: o, timeFormat: d = 12, controls: s = !1, minuteStep: f = 5, style: a }) {
1191
+ const [h, u] = I((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)), [g, S] = I((n == null ? void 0 : n.m) ?? 0), [r, i] = I((n == null ? void 0 : n.ampm) ?? "AM"), [c, m] = I(null);
1192
+ O(_, []);
1193
+ const v = d === 24 ? Array.from({ length: 24 }, (k, $) => $) : Array.from({ length: 12 }, (k, $) => $ + 1), l = Array.from({ length: Math.ceil(60 / f) }, (k, $) => $ * f), x = (k, $, W) => {
1194
+ const p = d === 24 ? { h: k, m: $ } : { h: k, m: $, ampm: W };
1195
+ s ? m(p) : o == null || o(p);
1196
+ }, w = () => {
1197
+ m(null), u((n == null ? void 0 : n.h) ?? (d === 24 ? 0 : 12)), S((n == null ? void 0 : n.m) ?? 0), i((n == null ? void 0 : n.ampm) ?? "AM");
1198
+ }, z = { display: "flex", flexDirection: "column", alignItems: "center", gap: 4 }, N = (k) => ({
1021
1199
  height: 32,
1022
1200
  display: "flex",
1023
1201
  alignItems: "center",
1024
1202
  justifyContent: "center",
1025
1203
  cursor: "pointer",
1026
1204
  fontSize: 13,
1027
- fontWeight: m ? 700 : 400,
1028
- background: m ? e.primaryLt : "transparent",
1029
- color: m ? e.primary : e.text
1205
+ fontWeight: k ? 700 : 400,
1206
+ background: k ? e.primaryLt : "transparent",
1207
+ color: k ? e.primary : e.text
1030
1208
  });
1031
- return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...a }, children: [
1032
- /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
1033
- /* @__PURE__ */ g("div", { style: $, children: [
1209
+ return /* @__PURE__ */ y("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...a }, children: [
1210
+ /* @__PURE__ */ y("div", { style: { display: "flex", gap: 8, alignItems: "stretch" }, children: [
1211
+ /* @__PURE__ */ y("div", { style: z, children: [
1034
1212
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Hours" }),
1035
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: S.map((m) => /* @__PURE__ */ t(
1213
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: v.map((k) => /* @__PURE__ */ t(
1036
1214
  "div",
1037
1215
  {
1038
1216
  onClick: () => {
1039
- d(m), x(m, y, r);
1217
+ u(k), x(k, g, r);
1040
1218
  },
1041
- style: L(h === m),
1042
- onMouseEnter: (M) => h !== m && (M.currentTarget.style.background = e.bg),
1043
- onMouseLeave: (M) => h !== m && (M.currentTarget.style.background = "transparent"),
1044
- children: String(m).padStart(2, "0")
1219
+ style: N(h === k),
1220
+ onMouseEnter: ($) => h !== k && ($.currentTarget.style.background = e.bg),
1221
+ onMouseLeave: ($) => h !== k && ($.currentTarget.style.background = "transparent"),
1222
+ children: String(k).padStart(2, "0")
1045
1223
  },
1046
- m
1224
+ k
1047
1225
  )) })
1048
1226
  ] }),
1049
- /* @__PURE__ */ g("div", { style: $, children: [
1227
+ /* @__PURE__ */ y("div", { style: z, children: [
1050
1228
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "Minutes" }),
1051
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: o.map((m) => /* @__PURE__ */ t(
1229
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { height: 160, overflowY: "auto", width: 48, border: `1px solid ${e.border}`, borderRadius: e.r }, children: l.map((k) => /* @__PURE__ */ t(
1052
1230
  "div",
1053
1231
  {
1054
1232
  onClick: () => {
1055
- w(m), x(h, m, r);
1233
+ S(k), x(h, k, r);
1056
1234
  },
1057
- style: L(y === m),
1058
- onMouseEnter: (M) => y !== m && (M.currentTarget.style.background = e.bg),
1059
- onMouseLeave: (M) => y !== m && (M.currentTarget.style.background = "transparent"),
1060
- children: String(m).padStart(2, "0")
1235
+ style: N(g === k),
1236
+ onMouseEnter: ($) => g !== k && ($.currentTarget.style.background = e.bg),
1237
+ onMouseLeave: ($) => g !== k && ($.currentTarget.style.background = "transparent"),
1238
+ children: String(k).padStart(2, "0")
1061
1239
  },
1062
- m
1240
+ k
1063
1241
  )) })
1064
1242
  ] }),
1065
- p === 12 && /* @__PURE__ */ g("div", { style: $, children: [
1243
+ d === 12 && /* @__PURE__ */ y("div", { style: z, children: [
1066
1244
  /* @__PURE__ */ t("span", { style: { fontSize: 11, fontWeight: 600, color: e.textMut }, children: "AM/PM" }),
1067
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((m) => /* @__PURE__ */ t(
1245
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", border: `1px solid ${e.border}`, borderRadius: e.r, overflow: "hidden" }, children: ["AM", "PM"].map((k) => /* @__PURE__ */ t(
1068
1246
  "div",
1069
1247
  {
1070
1248
  onClick: () => {
1071
- l(m), x(h, y, m);
1249
+ i(k), x(h, g, k);
1072
1250
  },
1073
- style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r === m ? 700 : 400, background: r === m ? e.primary : e.surface, color: r === m ? "#fff" : e.text },
1074
- children: m
1251
+ style: { height: 40, display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", padding: "0 12px", fontSize: 13, fontWeight: r === k ? 700 : 400, background: r === k ? e.primary : e.surface, color: r === k ? "#fff" : e.text },
1252
+ children: k
1075
1253
  },
1076
- m
1254
+ k
1077
1255
  )) })
1078
1256
  ] })
1079
1257
  ] }),
1080
- /* @__PURE__ */ g("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
1258
+ /* @__PURE__ */ y("div", { style: { textAlign: "center", marginTop: 12, fontSize: 22, fontWeight: 700, color: e.primary, letterSpacing: 2 }, children: [
1081
1259
  String(h).padStart(2, "0"),
1082
1260
  ":",
1083
- String(y).padStart(2, "0"),
1084
- p === 12 ? ` ${r}` : ""
1261
+ String(g).padStart(2, "0"),
1262
+ d === 12 ? ` ${r}` : ""
1085
1263
  ] }),
1086
- s && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
1087
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: k, children: "Cancel" }),
1264
+ s && /* @__PURE__ */ y("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
1265
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: w, children: "Cancel" }),
1088
1266
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => {
1089
- const m = c ?? (p === 24 ? { h, m: y } : { h, m: y, ampm: r });
1090
- i == null || i(m);
1267
+ const k = c ?? (d === 24 ? { h, m: g } : { h, m: g, ampm: r });
1268
+ o == null || o(k);
1091
1269
  }, children: "Apply" })
1092
1270
  ] })
1093
1271
  ] });
1094
1272
  }
1095
- const yt = ({ open: n }) => /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", style: { flexShrink: 0, transition: "transform .15s", transform: n ? "rotate(180deg)" : "rotate(0deg)" }, children: /* @__PURE__ */ t("path", { d: "M2 4l4 4 4-4", stroke: e.textMut, strokeWidth: "1.5", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) });
1096
- function $e({ data: n = [], value: i, placeholder: p = "Select or type...", multiselection: s = !1, label: f, onChange: a, style: h }) {
1097
- var A;
1098
- const [d, y] = T(!1), [w, r] = T(""), [l, c] = T(
1099
- s ? i ? [].concat(i) : [] : i || null
1100
- ), b = U(null), S = U(null);
1101
- K(_, []), he(b, Z(() => {
1102
- y(!1), r("");
1273
+ const Rt = ({ open: n }) => /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", style: { flexShrink: 0, transition: "transform .15s", transform: n ? "rotate(180deg)" : "rotate(0deg)" }, children: /* @__PURE__ */ t("path", { d: "M2 4l4 4 4-4", stroke: e.textMut, strokeWidth: "1.5", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) });
1274
+ function Ae({ data: n = [], value: o, placeholder: d = "Select or type...", multiselection: s = !1, label: f, onChange: a, style: h }) {
1275
+ var W;
1276
+ const [u, g] = I(!1), [S, r] = I(""), [i, c] = I(
1277
+ s ? o ? [].concat(o) : [] : o || null
1278
+ ), m = ne(null), v = ne(null);
1279
+ O(_, []), fe(m, oe(() => {
1280
+ g(!1), r("");
1103
1281
  }, []));
1104
- const o = ue(
1105
- () => n.filter((u) => !w || u.value.toLowerCase().includes(w.toLowerCase())),
1106
- [n, w]
1107
- ), x = (u) => s ? (l || []).includes(u) : l === u, k = (u) => {
1108
- const I = u.id || u.value;
1282
+ const l = le(
1283
+ () => n.filter((p) => !S || p.value.toLowerCase().includes(S.toLowerCase())),
1284
+ [n, S]
1285
+ ), x = (p) => s ? (i || []).includes(p) : i === p, w = (p) => {
1286
+ const T = p.id || p.value;
1109
1287
  if (s) {
1110
- const R = x(I) ? l.filter((C) => C !== I) : [...l || [], I];
1288
+ const R = x(T) ? i.filter((C) => C !== T) : [...i || [], T];
1111
1289
  c(R), a == null || a(R);
1112
1290
  } else
1113
- c(I), r(""), y(!1), a == null || a(I);
1114
- }, $ = (u) => {
1115
- const I = l.filter((R) => R !== u);
1116
- c(I), a == null || a(I);
1117
- }, L = () => {
1118
- y(!0), setTimeout(() => {
1119
- var u;
1120
- return (u = S.current) == null ? void 0 : u.focus();
1291
+ c(T), r(""), g(!1), a == null || a(T);
1292
+ }, z = (p) => {
1293
+ const T = i.filter((R) => R !== p);
1294
+ c(T), a == null || a(T);
1295
+ }, N = () => {
1296
+ g(!0), setTimeout(() => {
1297
+ var p;
1298
+ return (p = v.current) == null ? void 0 : p.focus();
1121
1299
  }, 0);
1122
- }, m = ((A = n.find((u) => (u.id || u.value) === l)) == null ? void 0 : A.value) || "", M = s ? l || [] : [];
1123
- return /* @__PURE__ */ g("div", { ref: b, className: "dhx", style: { position: "relative", ...h }, children: [
1300
+ }, k = ((W = n.find((p) => (p.id || p.value) === i)) == null ? void 0 : W.value) || "", $ = s ? i || [] : [];
1301
+ return /* @__PURE__ */ y("div", { ref: m, className: "dhx", style: { position: "relative", ...h }, children: [
1124
1302
  f && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: f }),
1125
- /* @__PURE__ */ g(
1303
+ /* @__PURE__ */ y(
1126
1304
  "div",
1127
1305
  {
1128
- onClick: L,
1306
+ onClick: N,
1129
1307
  style: {
1130
1308
  display: "flex",
1131
1309
  alignItems: "center",
1132
1310
  flexWrap: s ? "wrap" : "nowrap",
1133
- border: `1px solid ${d ? e.primary : e.border}`,
1311
+ border: `1px solid ${u ? e.primary : e.border}`,
1134
1312
  borderRadius: e.r,
1135
1313
  minHeight: 34,
1136
1314
  padding: "4px 8px",
@@ -1138,13 +1316,13 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1138
1316
  background: e.surface,
1139
1317
  gap: 4,
1140
1318
  transition: "border-color .15s",
1141
- boxShadow: d ? `0 0 0 3px ${e.primary}22` : "none"
1319
+ boxShadow: u ? `0 0 0 3px ${e.primary}22` : "none"
1142
1320
  },
1143
1321
  children: [
1144
- s && /* @__PURE__ */ g(Ne, { children: [
1145
- M.map((u) => {
1146
- var I;
1147
- return /* @__PURE__ */ g("span", { style: {
1322
+ s && /* @__PURE__ */ y(Oe, { children: [
1323
+ $.map((p) => {
1324
+ var T;
1325
+ return /* @__PURE__ */ y("span", { style: {
1148
1326
  display: "inline-flex",
1149
1327
  alignItems: "center",
1150
1328
  gap: 4,
@@ -1156,30 +1334,30 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1156
1334
  lineHeight: 1.5,
1157
1335
  whiteSpace: "nowrap"
1158
1336
  }, children: [
1159
- ((I = n.find((R) => (R.id || R.value) === u)) == null ? void 0 : I.value) || u,
1337
+ ((T = n.find((R) => (R.id || R.value) === p)) == null ? void 0 : T.value) || p,
1160
1338
  /* @__PURE__ */ t(
1161
1339
  "span",
1162
1340
  {
1163
1341
  onClick: (R) => {
1164
- R.stopPropagation(), $(u);
1342
+ R.stopPropagation(), z(p);
1165
1343
  },
1166
1344
  style: { cursor: "pointer", fontSize: 15, lineHeight: 1, opacity: 0.75, marginLeft: 2 },
1167
1345
  children: "×"
1168
1346
  }
1169
1347
  )
1170
- ] }, u);
1348
+ ] }, p);
1171
1349
  }),
1172
1350
  /* @__PURE__ */ t(
1173
1351
  "input",
1174
1352
  {
1175
- ref: S,
1176
- value: w,
1177
- onChange: (u) => {
1178
- r(u.target.value), y(!0);
1353
+ ref: v,
1354
+ value: S,
1355
+ onChange: (p) => {
1356
+ r(p.target.value), g(!0);
1179
1357
  },
1180
- onFocus: () => y(!0),
1181
- onClick: (u) => u.stopPropagation(),
1182
- placeholder: M.length ? "" : p,
1358
+ onFocus: () => g(!0),
1359
+ onClick: (p) => p.stopPropagation(),
1360
+ placeholder: $.length ? "" : d,
1183
1361
  style: { flex: 1, minWidth: 60, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
1184
1362
  }
1185
1363
  )
@@ -1187,24 +1365,24 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1187
1365
  !s && /* @__PURE__ */ t(
1188
1366
  "input",
1189
1367
  {
1190
- ref: S,
1191
- value: d ? w : m,
1192
- onChange: (u) => {
1193
- r(u.target.value), y(!0);
1368
+ ref: v,
1369
+ value: u ? S : k,
1370
+ onChange: (p) => {
1371
+ r(p.target.value), g(!0);
1194
1372
  },
1195
1373
  onFocus: () => {
1196
- y(!0), r("");
1374
+ g(!0), r("");
1197
1375
  },
1198
- onClick: (u) => u.stopPropagation(),
1199
- placeholder: p,
1376
+ onClick: (p) => p.stopPropagation(),
1377
+ placeholder: d,
1200
1378
  style: { flex: 1, border: "none", outline: "none", fontSize: 13, background: "transparent", color: e.text, padding: 0 }
1201
1379
  }
1202
1380
  ),
1203
- /* @__PURE__ */ t(yt, { open: d })
1381
+ /* @__PURE__ */ t(Rt, { open: u })
1204
1382
  ]
1205
1383
  }
1206
1384
  ),
1207
- d && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: {
1385
+ u && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: {
1208
1386
  position: "absolute",
1209
1387
  top: "calc(100% + 4px)",
1210
1388
  left: 0,
@@ -1214,13 +1392,13 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1214
1392
  borderRadius: e.r,
1215
1393
  boxShadow: e.shadowLg,
1216
1394
  zIndex: 100
1217
- }, children: /* @__PURE__ */ g("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
1218
- o.map((u) => {
1219
- const I = u.id || u.value, R = x(I);
1220
- return /* @__PURE__ */ g(
1395
+ }, children: /* @__PURE__ */ y("div", { className: "dhx-scroll", style: { maxHeight: 220, overflowY: "auto" }, children: [
1396
+ l.map((p) => {
1397
+ const T = p.id || p.value, R = x(T);
1398
+ return /* @__PURE__ */ y(
1221
1399
  "div",
1222
1400
  {
1223
- onClick: () => k(u),
1401
+ onClick: () => w(p),
1224
1402
  style: {
1225
1403
  padding: "8px 12px",
1226
1404
  cursor: "pointer",
@@ -1245,97 +1423,97 @@ function $e({ data: n = [], value: i, placeholder: p = "Select or type...", mult
1245
1423
  justifyContent: "center",
1246
1424
  background: R ? e.primary : "transparent"
1247
1425
  }, children: R && /* @__PURE__ */ t("span", { style: { color: "#fff", fontSize: 9, lineHeight: 1 }, children: "✓" }) }),
1248
- /* @__PURE__ */ t("span", { style: { flex: 1 }, children: u.value }),
1426
+ /* @__PURE__ */ t("span", { style: { flex: 1 }, children: p.value }),
1249
1427
  !s && R && /* @__PURE__ */ t("span", { style: { color: e.primary, fontSize: 12, fontWeight: 700 }, children: "✓" }),
1250
- u.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
1428
+ p.count !== void 0 && /* @__PURE__ */ y("span", { style: { fontSize: 11, color: e.textMut }, children: [
1251
1429
  "(",
1252
- u.count,
1430
+ p.count,
1253
1431
  ")"
1254
1432
  ] })
1255
1433
  ]
1256
1434
  },
1257
- I
1435
+ T
1258
1436
  );
1259
1437
  }),
1260
- o.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
1438
+ l.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 16, textAlign: "center", color: e.textMut, fontSize: 13 }, children: "No matches" })
1261
1439
  ] }) })
1262
1440
  ] });
1263
1441
  }
1264
- function De({ min: n = 0, max: i = 100, step: p = 1, value: s, range: f = !1, label: a, tick: h, disabled: d = !1, onChange: y, style: w }) {
1265
- const [r, l] = T(s ?? (f ? [n, i] : n));
1266
- K(_, []);
1267
- const c = (k, $) => {
1268
- if (!d)
1442
+ function Be({ min: n = 0, max: o = 100, step: d = 1, value: s, range: f = !1, label: a, tick: h, disabled: u = !1, onChange: g, style: S }) {
1443
+ const [r, i] = I(s ?? (f ? [n, o] : n));
1444
+ O(_, []);
1445
+ const c = (w, z) => {
1446
+ if (!u)
1269
1447
  if (f) {
1270
- const L = [...r];
1271
- L[k] = $, l(L), y == null || y(L);
1448
+ const N = [...r];
1449
+ N[w] = z, i(N), g == null || g(N);
1272
1450
  } else
1273
- l($), y == null || y($);
1274
- }, b = (k) => (k - n) / (i - n) * 100, S = f ? r : [r], o = f ? { left: `${b(S[0])}%`, width: `${b(S[1]) - b(S[0])}%` } : { left: 0, width: `${b(S[0])}%` }, x = d ? e.border : e.primary;
1275
- return /* @__PURE__ */ g("div", { className: "dhx", style: { width: "100%", opacity: d ? 0.5 : 1, ...w }, children: [
1451
+ i(z), g == null || g(z);
1452
+ }, m = (w) => (w - n) / (o - n) * 100, v = f ? r : [r], l = f ? { left: `${m(v[0])}%`, width: `${m(v[1]) - m(v[0])}%` } : { left: 0, width: `${m(v[0])}%` }, x = u ? e.border : e.primary;
1453
+ return /* @__PURE__ */ y("div", { className: "dhx", style: { width: "100%", opacity: u ? 0.5 : 1, ...S }, children: [
1276
1454
  a && /* @__PURE__ */ t("label", { className: "dhx dhx-label", children: a }),
1277
- /* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ g("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
1278
- /* @__PURE__ */ t("div", { style: { position: "absolute", ...o, height: "100%", background: x, borderRadius: 2 } }),
1279
- S.map((k, $) => /* @__PURE__ */ t(
1455
+ /* @__PURE__ */ t("div", { style: { position: "relative", height: 36, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ y("div", { style: { position: "relative", flex: 1, height: 4, background: e.border, borderRadius: 2 }, children: [
1456
+ /* @__PURE__ */ t("div", { style: { position: "absolute", ...l, height: "100%", background: x, borderRadius: 2 } }),
1457
+ v.map((w, z) => /* @__PURE__ */ t(
1280
1458
  "input",
1281
1459
  {
1282
1460
  type: "range",
1283
1461
  min: n,
1284
- max: i,
1285
- step: p,
1286
- value: k,
1287
- disabled: d,
1288
- onChange: (L) => {
1289
- const m = +L.target.value;
1290
- f && $ === 0 && m >= r[1] || f && $ === 1 && m <= r[0] || c($, m);
1462
+ max: o,
1463
+ step: d,
1464
+ value: w,
1465
+ disabled: u,
1466
+ onChange: (N) => {
1467
+ const k = +N.target.value;
1468
+ f && z === 0 && k >= r[1] || f && z === 1 && k <= r[0] || c(z, k);
1291
1469
  },
1292
- style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: d ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
1470
+ style: { position: "absolute", width: "100%", height: "100%", opacity: 0, cursor: u ? "not-allowed" : "pointer", top: 0, left: 0, margin: 0 }
1293
1471
  },
1294
- $
1472
+ z
1295
1473
  )),
1296
- S.map((k, $) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${b(k)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${x}`, boxShadow: "0 1px 4px rgba(0,0,0,.2)", pointerEvents: "none" }, children: /* @__PURE__ */ t("div", { style: { position: "absolute", bottom: "calc(100% + 6px)", left: "50%", transform: "translateX(-50%)", background: d ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: k }) }, $))
1474
+ v.map((w, z) => /* @__PURE__ */ t("div", { style: { position: "absolute", left: `${m(w)}%`, top: "50%", transform: "translate(-50%, -50%)", width: 16, height: 16, borderRadius: "50%", background: e.surface, border: `2px solid ${x}`, boxShadow: "0 1px 4px rgba(0,0,0,.2)", pointerEvents: "none" }, children: /* @__PURE__ */ t("div", { style: { position: "absolute", bottom: "calc(100% + 6px)", left: "50%", transform: "translateX(-50%)", background: u ? e.textMut : e.primaryDk, color: "#fff", padding: "2px 6px", borderRadius: e.r, fontSize: 11, fontWeight: 700, whiteSpace: "nowrap" }, children: w }) }, z))
1297
1475
  ] }) }),
1298
- h && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((i + n) / 2), i].map((k) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: k }, k)) })
1476
+ h && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", marginTop: 2 }, children: [n, Math.round((o + n) / 2), o].map((w) => /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: w }, w)) })
1299
1477
  ] });
1300
1478
  }
1301
- const bt = ["#f44336", "#e91e63", "#9c27b0", "#673ab7", "#3f51b5", "#2196f3", "#03a9f4", "#00bcd4", "#009688", "#4caf50", "#8bc34a", "#cddc39", "#ffeb3b", "#ffc107", "#ff9800", "#ff5722", "#795548", "#607d8b", "#9e9e9e", "#000000", "#ffffff", "#0288d1", "#01579b", "#43a047", "#e53935", "#f57c00"];
1302
- function ye(n) {
1303
- const i = parseInt(n.slice(1, 3), 16) / 255, p = parseInt(n.slice(3, 5), 16) / 255, s = parseInt(n.slice(5, 7), 16) / 255, f = Math.max(i, p, s), a = Math.min(i, p, s);
1304
- let h = 0, d = 0;
1305
- const y = (f + a) / 2;
1479
+ const Wt = ["#f44336", "#e91e63", "#9c27b0", "#673ab7", "#3f51b5", "#2196f3", "#03a9f4", "#00bcd4", "#009688", "#4caf50", "#8bc34a", "#cddc39", "#ffeb3b", "#ffc107", "#ff9800", "#ff5722", "#795548", "#607d8b", "#9e9e9e", "#000000", "#ffffff", "#0288d1", "#01579b", "#43a047", "#e53935", "#f57c00"];
1480
+ function ke(n) {
1481
+ const o = parseInt(n.slice(1, 3), 16) / 255, d = parseInt(n.slice(3, 5), 16) / 255, s = parseInt(n.slice(5, 7), 16) / 255, f = Math.max(o, d, s), a = Math.min(o, d, s);
1482
+ let h = 0, u = 0;
1483
+ const g = (f + a) / 2;
1306
1484
  if (f !== a) {
1307
- const w = f - a;
1308
- d = y > 0.5 ? w / (2 - f - a) : w / (f + a), h = f === i ? ((p - s) / w + (p < s ? 6 : 0)) / 6 : f === p ? ((s - i) / w + 2) / 6 : ((i - p) / w + 4) / 6;
1485
+ const S = f - a;
1486
+ u = g > 0.5 ? S / (2 - f - a) : S / (f + a), h = f === o ? ((d - s) / S + (d < s ? 6 : 0)) / 6 : f === d ? ((s - o) / S + 2) / 6 : ((o - d) / S + 4) / 6;
1309
1487
  }
1310
- return [Math.round(h * 360), Math.round(d * 100), Math.round(y * 100)];
1488
+ return [Math.round(h * 360), Math.round(u * 100), Math.round(g * 100)];
1311
1489
  }
1312
- function Ce(n, i, p) {
1313
- i /= 100, p /= 100;
1314
- const s = i * Math.min(p, 1 - p), f = (a) => {
1315
- const h = (a + n / 30) % 12, d = p - s * Math.max(Math.min(h - 3, 9 - h, 1), -1);
1316
- return Math.round(255 * d).toString(16).padStart(2, "0");
1490
+ function He(n, o, d) {
1491
+ o /= 100, d /= 100;
1492
+ const s = o * Math.min(d, 1 - d), f = (a) => {
1493
+ const h = (a + n / 30) % 12, u = d - s * Math.max(Math.min(h - 3, 9 - h, 1), -1);
1494
+ return Math.round(255 * u).toString(16).padStart(2, "0");
1317
1495
  };
1318
1496
  return "#" + f(0) + f(8) + f(4);
1319
1497
  }
1320
- function Et({ value: n = "#0288d1", onChange: i, style: p }) {
1321
- const [s, f] = T(() => ye(n)), a = Ce(...s);
1322
- K(_, []);
1323
- const h = (d) => {
1324
- f(d), i == null || i(Ce(...d));
1498
+ function Ut({ value: n = "#0288d1", onChange: o, style: d }) {
1499
+ const [s, f] = I(() => ke(n)), a = He(...s);
1500
+ O(_, []);
1501
+ const h = (u) => {
1502
+ f(u), o == null || o(He(...u));
1325
1503
  };
1326
- return /* @__PURE__ */ g("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...p }, children: [
1504
+ return /* @__PURE__ */ y("div", { className: "dhx", style: { background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, padding: 16, display: "inline-block", boxShadow: e.shadow, ...d }, children: [
1327
1505
  /* @__PURE__ */ t("div", { style: { width: 200, height: 120, borderRadius: e.r, marginBottom: 12, background: `linear-gradient(to bottom, transparent, black), linear-gradient(to right, white, hsl(${s[0]},100%,50%))`, cursor: "crosshair" } }),
1328
- [["Hue", 0, 360, s[0]], ["Saturation", 0, 100, s[1]], ["Lightness", 0, 100, s[2]]].map(([d, y, w, r], l) => /* @__PURE__ */ g("div", { style: { marginBottom: l < 2 ? 8 : 12 }, children: [
1329
- /* @__PURE__ */ g("div", { className: "dhx dhx-label", children: [
1330
- d,
1331
- l > 0 ? ` (${r}%)` : ""
1506
+ [["Hue", 0, 360, s[0]], ["Saturation", 0, 100, s[1]], ["Lightness", 0, 100, s[2]]].map(([u, g, S, r], i) => /* @__PURE__ */ y("div", { style: { marginBottom: i < 2 ? 8 : 12 }, children: [
1507
+ /* @__PURE__ */ y("div", { className: "dhx dhx-label", children: [
1508
+ u,
1509
+ i > 0 ? ` (${r}%)` : ""
1332
1510
  ] }),
1333
- /* @__PURE__ */ t("input", { type: "range", min: y, max: w, value: r, onChange: (c) => {
1334
- const b = [...s];
1335
- b[l] = +c.target.value, h(b);
1511
+ /* @__PURE__ */ t("input", { type: "range", min: g, max: S, value: r, onChange: (c) => {
1512
+ const m = [...s];
1513
+ m[i] = +c.target.value, h(m);
1336
1514
  }, style: { width: "100%", accentColor: e.primary } })
1337
- ] }, d)),
1338
- /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
1515
+ ] }, u)),
1516
+ /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
1339
1517
  /* @__PURE__ */ t("div", { style: { width: 36, height: 36, borderRadius: e.r, background: a, border: `1px solid ${e.border}`, flexShrink: 0 } }),
1340
1518
  /* @__PURE__ */ t(
1341
1519
  "input",
@@ -1343,97 +1521,97 @@ function Et({ value: n = "#0288d1", onChange: i, style: p }) {
1343
1521
  className: "dhx dhx-input",
1344
1522
  style: { flex: 1, fontFamily: "monospace", fontSize: 12 },
1345
1523
  value: a,
1346
- onChange: (d) => {
1524
+ onChange: (u) => {
1347
1525
  try {
1348
- h(ye(d.target.value)), i == null || i(d.target.value);
1526
+ h(ke(u.target.value)), o == null || o(u.target.value);
1349
1527
  } catch {
1350
1528
  }
1351
1529
  }
1352
1530
  }
1353
1531
  )
1354
1532
  ] }),
1355
- /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: bt.map((d) => /* @__PURE__ */ t(
1533
+ /* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "repeat(13, 1fr)", gap: 3 }, children: Wt.map((u) => /* @__PURE__ */ t(
1356
1534
  "div",
1357
1535
  {
1358
1536
  onClick: () => {
1359
- f(ye(d)), i == null || i(d);
1537
+ f(ke(u)), o == null || o(u);
1360
1538
  },
1361
- style: { width: 14, height: 14, borderRadius: 2, background: d, cursor: "pointer", border: a === d ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
1362
- onMouseEnter: (y) => y.currentTarget.style.transform = "scale(1.3)",
1363
- onMouseLeave: (y) => y.currentTarget.style.transform = "scale(1)"
1539
+ style: { width: 14, height: 14, borderRadius: 2, background: u, cursor: "pointer", border: a === u ? `2px solid ${e.text}` : "1px solid rgba(0,0,0,.15)", transition: "transform .1s" },
1540
+ onMouseEnter: (g) => g.currentTarget.style.transform = "scale(1.3)",
1541
+ onMouseLeave: (g) => g.currentTarget.style.transform = "scale(1)"
1364
1542
  },
1365
- d
1543
+ u
1366
1544
  )) })
1367
1545
  ] });
1368
1546
  }
1369
- function Wt({ trigger: n, children: i, placement: p = "bottom-start", style: s }) {
1370
- const [f, a] = T(!1), [h, d] = T({ top: "100%", left: 0 }), y = U(null), w = U(null);
1371
- return K(_, []), he(y, Z(() => a(!1), [])), /* @__PURE__ */ g("div", { ref: y, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
1372
- /* @__PURE__ */ t("div", { ref: w, onClick: () => {
1373
- a((l) => {
1374
- if (!l && w.current) {
1375
- const c = w.current.getBoundingClientRect(), b = {
1547
+ function Qt({ trigger: n, children: o, placement: d = "bottom-start", style: s }) {
1548
+ const [f, a] = I(!1), [h, u] = I({ top: "100%", left: 0 }), g = ne(null), S = ne(null);
1549
+ return O(_, []), fe(g, oe(() => a(!1), [])), /* @__PURE__ */ y("div", { ref: g, className: "dhx", style: { position: "relative", display: "inline-block" }, children: [
1550
+ /* @__PURE__ */ t("div", { ref: S, onClick: () => {
1551
+ a((i) => {
1552
+ if (!i && S.current) {
1553
+ const c = S.current.getBoundingClientRect(), m = {
1376
1554
  "bottom-start": { top: c.height + 4, left: 0 },
1377
1555
  "bottom-end": { top: c.height + 4, right: 0, left: "auto" },
1378
1556
  "top-start": { bottom: c.height + 4, top: "auto", left: 0 }
1379
1557
  };
1380
- d(b[p] || b["bottom-start"]);
1558
+ u(m[d] || m["bottom-start"]);
1381
1559
  }
1382
- return !l;
1560
+ return !i;
1383
1561
  });
1384
1562
  }, children: n }),
1385
- f && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...h, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...s }, children: i })
1563
+ f && /* @__PURE__ */ t("div", { className: "dhx dhx-anim-fade", style: { position: "absolute", ...h, zIndex: 200, background: e.surface, border: `1px solid ${e.border}`, borderRadius: e.rMd, boxShadow: e.shadowLg, ...s }, children: o })
1386
1564
  ] });
1387
1565
  }
1388
- function At({ title: n, children: i, width: p = 480, height: s, closable: f = !0, movable: a = !0, modal: h = !1, defaultOpen: d = !0, footer: y, onClose: w, style: r }) {
1389
- const [l, c] = T(d), [b, S] = T({ x: 0, y: 0 });
1390
- K(_, []);
1391
- const o = dt(Z((k, $) => a && S({ x: k, y: $ }), [a])), x = () => {
1392
- c(!1), w == null || w();
1566
+ function Zt({ title: n, children: o, width: d = 480, height: s, closable: f = !0, movable: a = !0, modal: h = !1, defaultOpen: u = !0, footer: g, onClose: S, style: r }) {
1567
+ const [i, c] = I(u), [m, v] = I({ x: 0, y: 0 });
1568
+ O(_, []);
1569
+ const l = St(oe((w, z) => a && v({ x: w, y: z }), [a])), x = () => {
1570
+ c(!1), S == null || S();
1393
1571
  };
1394
- return l ? /* @__PURE__ */ g(Ne, { children: [
1572
+ return i ? /* @__PURE__ */ y(Oe, { children: [
1395
1573
  h && /* @__PURE__ */ t("div", { style: { position: "fixed", inset: 0, background: "rgba(0,0,0,.45)", zIndex: 900 }, onClick: f ? x : void 0 }),
1396
- /* @__PURE__ */ g("div", { className: "dhx", style: { position: h ? "fixed" : "absolute", left: "50%", top: "50%", transform: `translate(calc(-50% + ${b.x}px), calc(-50% + ${b.y}px))`, width: p, ...s ? { height: s } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...r }, children: [
1397
- /* @__PURE__ */ g("div", { onMouseDown: (k) => o(k, b.x, b.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: a ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
1574
+ /* @__PURE__ */ y("div", { className: "dhx", style: { position: h ? "fixed" : "absolute", left: "50%", top: "50%", transform: `translate(calc(-50% + ${m.x}px), calc(-50% + ${m.y}px))`, width: d, ...s ? { height: s } : {}, background: e.surface, borderRadius: e.rMd, boxShadow: e.shadowLg, zIndex: 901, display: "flex", flexDirection: "column", overflow: "hidden", ...r }, children: [
1575
+ /* @__PURE__ */ y("div", { onMouseDown: (w) => l(w, m.x, m.y), style: { display: "flex", alignItems: "center", padding: "12px 16px", borderBottom: `1px solid ${e.border}`, cursor: a ? "grab" : "default", background: e.bg, gap: 8, userSelect: "none" }, children: [
1398
1576
  /* @__PURE__ */ t("span", { style: { flex: 1, fontWeight: 700, fontSize: 15 }, children: n }),
1399
1577
  f && /* @__PURE__ */ t(
1400
1578
  "button",
1401
1579
  {
1402
1580
  onClick: x,
1403
1581
  style: { background: "none", border: "none", cursor: "pointer", width: 28, height: 28, borderRadius: e.r, display: "flex", alignItems: "center", justifyContent: "center", fontSize: 18, color: e.textSec },
1404
- onMouseEnter: (k) => k.currentTarget.style.background = e.border,
1405
- onMouseLeave: (k) => k.currentTarget.style.background = "none",
1582
+ onMouseEnter: (w) => w.currentTarget.style.background = e.border,
1583
+ onMouseLeave: (w) => w.currentTarget.style.background = "none",
1406
1584
  children: "×"
1407
1585
  }
1408
1586
  )
1409
1587
  ] }),
1410
- /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: i }),
1411
- y && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: y })
1588
+ /* @__PURE__ */ t("div", { className: "dhx-scroll", style: { flex: 1, minHeight: 0, padding: 20, overflowY: "auto" }, children: o }),
1589
+ g && /* @__PURE__ */ t("div", { style: { padding: "12px 16px", borderTop: `1px solid ${e.border}`, display: "flex", justifyContent: "flex-end", gap: 8, background: e.bg }, children: g })
1412
1590
  ] })
1413
1591
  ] }) : null;
1414
1592
  }
1415
- const Re = Pe(null), mt = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, Ie = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
1416
- function Bt({ children: n }) {
1417
- const [i, p] = T([]);
1418
- K(_, []);
1419
- const s = Z((h) => p((d) => d.filter((y) => y.id !== h)), []), f = Z((h) => {
1420
- const d = Date.now();
1421
- return p((y) => [...y, { id: d, ...h }]), h.duration !== 0 && setTimeout(() => s(d), h.duration || 4e3), d;
1593
+ const Ye = Qe(null), At = { success: "✓", error: "✕", warning: "⚠", info: "ℹ" }, Fe = { success: e.success, error: e.danger, warning: e.warning, info: e.primary };
1594
+ function en({ children: n }) {
1595
+ const [o, d] = I([]);
1596
+ O(_, []);
1597
+ const s = oe((h) => d((u) => u.filter((g) => g.id !== h)), []), f = oe((h) => {
1598
+ const u = Date.now();
1599
+ return d((g) => [...g, { id: u, ...h }]), h.duration !== 0 && setTimeout(() => s(u), h.duration || 4e3), u;
1422
1600
  }, [s]), a = {
1423
1601
  message: f,
1424
- alert: (h, d) => f({ type: "info", title: h, ...d }),
1425
- confirm: (h, d, y) => f({ type: "warning", title: h, confirm: d, ...y })
1602
+ alert: (h, u) => f({ type: "info", title: h, ...u }),
1603
+ confirm: (h, u, g) => f({ type: "warning", title: h, confirm: u, ...g })
1426
1604
  };
1427
- return /* @__PURE__ */ g(Re.Provider, { value: a, children: [
1605
+ return /* @__PURE__ */ y(Ye.Provider, { value: a, children: [
1428
1606
  n,
1429
- /* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: i.map((h) => {
1430
- const d = h.type || "info";
1431
- return /* @__PURE__ */ g("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${Ie[d]}`, borderRadius: e.r, boxShadow: e.shadowLg, padding: "12px 16px", minWidth: 280, maxWidth: 380, pointerEvents: "all", display: "flex", gap: 10, alignItems: "flex-start", animation: "dhx-toast .3s ease" }, children: [
1432
- /* @__PURE__ */ t("span", { style: { fontSize: 18, color: Ie[d], lineHeight: 1 }, children: mt[d] }),
1433
- /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
1607
+ /* @__PURE__ */ t("div", { style: { position: "fixed", top: 20, right: 20, zIndex: 9999, display: "flex", flexDirection: "column", gap: 8, pointerEvents: "none" }, children: o.map((h) => {
1608
+ const u = h.type || "info";
1609
+ return /* @__PURE__ */ y("div", { style: { background: e.surface, border: `1px solid ${e.border}`, borderLeft: `4px solid ${Fe[u]}`, borderRadius: e.r, boxShadow: e.shadowLg, padding: "12px 16px", minWidth: 280, maxWidth: 380, pointerEvents: "all", display: "flex", gap: 10, alignItems: "flex-start", animation: "dhx-toast .3s ease" }, children: [
1610
+ /* @__PURE__ */ t("span", { style: { fontSize: 18, color: Fe[u], lineHeight: 1 }, children: At[u] }),
1611
+ /* @__PURE__ */ y("div", { style: { flex: 1 }, children: [
1434
1612
  h.title && /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 13, marginBottom: h.text ? 3 : 0 }, children: h.title }),
1435
1613
  h.text && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec, lineHeight: 1.5 }, children: h.text }),
1436
- h.confirm && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
1614
+ h.confirm && /* @__PURE__ */ y("div", { style: { display: "flex", gap: 6, marginTop: 8 }, children: [
1437
1615
  /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", style: { height: 26, fontSize: 12 }, onClick: () => {
1438
1616
  h.confirm(!0), s(h.id);
1439
1617
  }, children: "Confirm" }),
@@ -1447,58 +1625,58 @@ function Bt({ children: n }) {
1447
1625
  }) })
1448
1626
  ] });
1449
1627
  }
1450
- function Ht() {
1451
- const n = je(Re);
1628
+ function tn() {
1629
+ const n = Ze(Ye);
1452
1630
  if (!n) throw new Error("useMessage must be used inside <MessageProvider>");
1453
1631
  return n;
1454
1632
  }
1455
- function Pt({ data: n = [], template: i, keyNavigation: p = !0, multiselection: s = !1, editable: f = !1, height: a = 400, onSelect: h, onEdit: d, style: y }) {
1456
- const [w, r] = T(/* @__PURE__ */ new Set()), [l, c] = T(null), [b, S] = T(""), [o, x] = T(null);
1457
- K(_, []);
1458
- const k = (L, m) => {
1459
- const M = L.id ?? m;
1460
- r((A) => {
1461
- const u = s ? new Set(A) : /* @__PURE__ */ new Set();
1462
- return u.has(M) ? u.delete(M) : u.add(M), u;
1463
- }), x(m), h == null || h(L);
1464
- }, $ = (L, m) => {
1465
- d == null || d({ ...L, value: b }, m), c(null);
1633
+ function nn({ data: n = [], template: o, keyNavigation: d = !0, multiselection: s = !1, editable: f = !1, height: a = 400, onSelect: h, onEdit: u, style: g }) {
1634
+ const [S, r] = I(/* @__PURE__ */ new Set()), [i, c] = I(null), [m, v] = I(""), [l, x] = I(null);
1635
+ O(_, []);
1636
+ const w = (N, k) => {
1637
+ const $ = N.id ?? k;
1638
+ r((W) => {
1639
+ const p = s ? new Set(W) : /* @__PURE__ */ new Set();
1640
+ return p.has($) ? p.delete($) : p.add($), p;
1641
+ }), x(k), h == null || h(N);
1642
+ }, z = (N, k) => {
1643
+ u == null || u({ ...N, value: m }, k), c(null);
1466
1644
  };
1467
- return /* @__PURE__ */ g(
1645
+ return /* @__PURE__ */ y(
1468
1646
  "div",
1469
1647
  {
1470
1648
  className: "dhx dhx-scroll",
1471
- style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...y },
1649
+ style: { height: a, overflowY: "auto", border: `1px solid ${e.border}`, borderRadius: e.r, background: e.surface, ...g },
1472
1650
  tabIndex: 0,
1473
- onKeyDown: (L) => {
1474
- p && (L.key === "ArrowDown" && x((m) => Math.min((m ?? -1) + 1, n.length - 1)), L.key === "ArrowUp" && x((m) => Math.max((m ?? 1) - 1, 0)));
1651
+ onKeyDown: (N) => {
1652
+ d && (N.key === "ArrowDown" && x((k) => Math.min((k ?? -1) + 1, n.length - 1)), N.key === "ArrowUp" && x((k) => Math.max((k ?? 1) - 1, 0)));
1475
1653
  },
1476
1654
  children: [
1477
- n.map((L, m) => {
1478
- const M = L.id ?? m, A = w.has(M), u = o === m;
1655
+ n.map((N, k) => {
1656
+ const $ = N.id ?? k, W = S.has($), p = l === k;
1479
1657
  return /* @__PURE__ */ t(
1480
1658
  "div",
1481
1659
  {
1482
- onClick: () => k(L, m),
1483
- onDoubleClick: () => f && (c(m), S(String(L.value || ""))),
1484
- style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: A ? e.primaryLt : u ? e.bg : e.surface, color: A ? e.primary : e.text, outline: u ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
1485
- children: l === m ? /* @__PURE__ */ t(
1660
+ onClick: () => w(N, k),
1661
+ onDoubleClick: () => f && (c(k), v(String(N.value || ""))),
1662
+ style: { display: "flex", alignItems: "center", padding: "0 12px", height: 40, cursor: "pointer", fontSize: 13, borderBottom: `1px solid ${e.border}`, background: W ? e.primaryLt : p ? e.bg : e.surface, color: W ? e.primary : e.text, outline: p ? `2px solid ${e.primary}44` : "none", transition: "background .1s" },
1663
+ children: i === k ? /* @__PURE__ */ t(
1486
1664
  "input",
1487
1665
  {
1488
1666
  autoFocus: !0,
1489
1667
  className: "dhx dhx-input",
1490
1668
  style: { height: 28, flex: 1 },
1491
- value: b,
1492
- onChange: (I) => S(I.target.value),
1493
- onBlur: () => $(L, m),
1494
- onKeyDown: (I) => {
1495
- I.key === "Enter" && $(L, m), I.key === "Escape" && c(null);
1669
+ value: m,
1670
+ onChange: (T) => v(T.target.value),
1671
+ onBlur: () => z(N, k),
1672
+ onKeyDown: (T) => {
1673
+ T.key === "Enter" && z(N, k), T.key === "Escape" && c(null);
1496
1674
  },
1497
- onClick: (I) => I.stopPropagation()
1675
+ onClick: (T) => T.stopPropagation()
1498
1676
  }
1499
- ) : i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(L) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(L.value ?? "") })
1677
+ ) : o ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: o(N) }, style: { flex: 1 } }) : /* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: String(N.value ?? "") })
1500
1678
  },
1501
- String(M)
1679
+ String($)
1502
1680
  );
1503
1681
  }),
1504
1682
  n.length === 0 && /* @__PURE__ */ t("div", { style: { padding: 24, textAlign: "center", color: e.textMut }, children: "No items" })
@@ -1506,30 +1684,30 @@ function Pt({ data: n = [], template: i, keyNavigation: p = !0, multiselection:
1506
1684
  }
1507
1685
  );
1508
1686
  }
1509
- function jt({ data: n = [], template: i, itemsInRow: p = 3, gap: s = 12, multiselection: f = !1, onSelect: a, style: h }) {
1510
- const [d, y] = T(/* @__PURE__ */ new Set());
1511
- K(_, []);
1512
- const w = (r) => {
1513
- const l = r.id ?? String(r.title);
1514
- y((c) => {
1515
- const b = f ? new Set(c) : /* @__PURE__ */ new Set();
1516
- return b.has(l) ? b.delete(l) : b.add(l), b;
1687
+ function rn({ data: n = [], template: o, itemsInRow: d = 3, gap: s = 12, multiselection: f = !1, onSelect: a, style: h }) {
1688
+ const [u, g] = I(/* @__PURE__ */ new Set());
1689
+ O(_, []);
1690
+ const S = (r) => {
1691
+ const i = r.id ?? String(r.title);
1692
+ g((c) => {
1693
+ const m = f ? new Set(c) : /* @__PURE__ */ new Set();
1694
+ return m.has(i) ? m.delete(i) : m.add(i), m;
1517
1695
  }), a == null || a(r);
1518
1696
  };
1519
- return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${p}, 1fr)`, gap: s, padding: s, ...h }, children: n.map((r, l) => {
1520
- const c = r.id ?? l, b = d.has(c);
1697
+ return /* @__PURE__ */ t("div", { className: "dhx", style: { display: "grid", gridTemplateColumns: `repeat(${d}, 1fr)`, gap: s, padding: s, ...h }, children: n.map((r, i) => {
1698
+ const c = r.id ?? i, m = u.has(c);
1521
1699
  return /* @__PURE__ */ t(
1522
1700
  "div",
1523
1701
  {
1524
- onClick: () => w(r),
1525
- style: { background: e.surface, border: `2px solid ${b ? e.primary : e.border}`, borderRadius: e.rMd, overflow: "hidden", cursor: "pointer", transition: "all .15s", boxShadow: b ? `0 0 0 3px ${e.primary}33` : e.shadow, transform: b ? "translateY(-2px)" : "none" },
1526
- onMouseEnter: (S) => {
1527
- S.currentTarget.style.boxShadow = e.shadowLg, S.currentTarget.style.transform = "translateY(-2px)";
1702
+ onClick: () => S(r),
1703
+ style: { background: e.surface, border: `2px solid ${m ? e.primary : e.border}`, borderRadius: e.rMd, overflow: "hidden", cursor: "pointer", transition: "all .15s", boxShadow: m ? `0 0 0 3px ${e.primary}33` : e.shadow, transform: m ? "translateY(-2px)" : "none" },
1704
+ onMouseEnter: (v) => {
1705
+ v.currentTarget.style.boxShadow = e.shadowLg, v.currentTarget.style.transform = "translateY(-2px)";
1528
1706
  },
1529
- onMouseLeave: (S) => {
1530
- S.currentTarget.style.boxShadow = b ? `0 0 0 3px ${e.primary}33` : e.shadow, S.currentTarget.style.transform = b ? "translateY(-2px)" : "none";
1707
+ onMouseLeave: (v) => {
1708
+ v.currentTarget.style.boxShadow = m ? `0 0 0 3px ${e.primary}33` : e.shadow, v.currentTarget.style.transform = m ? "translateY(-2px)" : "none";
1531
1709
  },
1532
- children: i ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: i(r) } }) : /* @__PURE__ */ g("div", { style: { padding: 16 }, children: [
1710
+ children: o ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: o(r) } }) : /* @__PURE__ */ y("div", { style: { padding: 16 }, children: [
1533
1711
  r.img && /* @__PURE__ */ t("img", { src: r.img, alt: r.title || "", style: { width: "100%", borderRadius: e.r, marginBottom: 8, display: "block" } }),
1534
1712
  /* @__PURE__ */ t("div", { style: { fontWeight: 600, fontSize: 14, marginBottom: 4 }, children: r.title || r.value }),
1535
1713
  r.subtitle && /* @__PURE__ */ t("div", { style: { fontSize: 12, color: e.textSec }, children: r.subtitle })
@@ -1539,579 +1717,579 @@ function jt({ data: n = [], template: i, itemsInRow: p = 3, gap: s = 12, multise
1539
1717
  );
1540
1718
  }) });
1541
1719
  }
1542
- function be(n) {
1543
- return n.map((i) => ({ ...i, items: i.items ? be(i.items) : void 0 }));
1720
+ function Se(n) {
1721
+ return n.map((o) => ({ ...o, items: o.items ? Se(o.items) : void 0 }));
1544
1722
  }
1545
- function me(n, i = {}) {
1546
- return n.forEach((p) => {
1547
- p.opened && (i[p.id] = !0), p.items && me(p.items, i);
1548
- }), i;
1723
+ function we(n, o = {}) {
1724
+ return n.forEach((d) => {
1725
+ d.opened && (o[d.id] = !0), d.items && we(d.items, o);
1726
+ }), o;
1549
1727
  }
1550
- function Ee(n, i) {
1551
- let p = null;
1552
- return [n.filter((f) => f.id === i ? (p = f, !1) : !0).map((f) => {
1728
+ function Ke(n, o) {
1729
+ let d = null;
1730
+ return [n.filter((f) => f.id === o ? (d = f, !1) : !0).map((f) => {
1553
1731
  if (f.items) {
1554
- const [a, h] = Ee(f.items, i);
1555
- return h && (p = h), { ...f, items: a };
1732
+ const [a, h] = Ke(f.items, o);
1733
+ return h && (d = h), { ...f, items: a };
1556
1734
  }
1557
1735
  return f;
1558
- }), p];
1736
+ }), d];
1559
1737
  }
1560
- function ve(n, i, p, s) {
1738
+ function ze(n, o, d, s) {
1561
1739
  if (s === "inside")
1562
- return n.map((a) => a.id === i ? { ...a, items: [...a.items || [], p] } : a.items ? { ...a, items: ve(a.items, i, p, s) } : a);
1563
- if (n.some((a) => a.id === i)) {
1740
+ return n.map((a) => a.id === o ? { ...a, items: [...a.items || [], d] } : a.items ? { ...a, items: ze(a.items, o, d, s) } : a);
1741
+ if (n.some((a) => a.id === o)) {
1564
1742
  const a = [];
1565
1743
  for (const h of n)
1566
- h.id === i ? s === "before" ? (a.push(p), a.push(h)) : (a.push(h), a.push(p)) : a.push(h);
1744
+ h.id === o ? s === "before" ? (a.push(d), a.push(h)) : (a.push(h), a.push(d)) : a.push(h);
1567
1745
  return a;
1568
1746
  }
1569
- return n.map((a) => a.items ? { ...a, items: ve(a.items, i, p, s) } : a);
1747
+ return n.map((a) => a.items ? { ...a, items: ze(a.items, o, d, s) } : a);
1570
1748
  }
1571
- function vt(n, i, p) {
1749
+ function Bt(n, o, d) {
1572
1750
  function s(f) {
1573
1751
  var a, h;
1574
- if (f.id === i) {
1575
- const d = (y) => {
1576
- var w;
1577
- return y.id === p || (((w = y.items) == null ? void 0 : w.some(d)) ?? !1);
1752
+ if (f.id === o) {
1753
+ const u = (g) => {
1754
+ var S;
1755
+ return g.id === d || (((S = g.items) == null ? void 0 : S.some(u)) ?? !1);
1578
1756
  };
1579
- return ((a = f.items) == null ? void 0 : a.some(d)) ?? !1;
1757
+ return ((a = f.items) == null ? void 0 : a.some(u)) ?? !1;
1580
1758
  }
1581
1759
  return ((h = f.items) == null ? void 0 : h.some(s)) ?? !1;
1582
1760
  }
1583
1761
  return n.some(s);
1584
1762
  }
1585
- function We(n, i, p) {
1763
+ function _e(n, o, d) {
1586
1764
  return n.map(
1587
- (s) => s.id === i ? { ...s, value: p } : { ...s, items: s.items ? We(s.items, i, p) : void 0 }
1765
+ (s) => s.id === o ? { ...s, value: d } : { ...s, items: s.items ? _e(s.items, o, d) : void 0 }
1588
1766
  );
1589
1767
  }
1590
- function kt(n, i) {
1768
+ function Ht(n, o) {
1591
1769
  var a;
1592
- let p = 0, s = 0;
1770
+ let d = 0, s = 0;
1593
1771
  const f = (h) => {
1594
- var d;
1595
- p++, i[h.id] && s++, (d = h.items) == null || d.forEach(f);
1772
+ var u;
1773
+ d++, o[h.id] && s++, (u = h.items) == null || u.forEach(f);
1596
1774
  };
1597
- return (a = n.items) == null || a.forEach(f), { total: p, checkedCount: s };
1775
+ return (a = n.items) == null || a.forEach(f), { total: d, checkedCount: s };
1598
1776
  }
1599
- function Ot({
1777
+ function on({
1600
1778
  data: n = [],
1601
- checkbox: i = !1,
1602
- editable: p = !1,
1779
+ checkbox: o = !1,
1780
+ editable: d = !1,
1603
1781
  dragMode: s,
1604
1782
  tooltip: f,
1605
1783
  onSelect: a,
1606
1784
  onCheck: h,
1607
- onChange: d,
1608
- style: y
1785
+ onChange: u,
1786
+ style: g
1609
1787
  }) {
1610
- const [w, r] = T(() => be(n)), [l, c] = T(() => me(n)), [b, S] = T(null), [o, x] = T({}), [k, $] = T(null), [L, m] = T(""), [M, A] = T(null), [u, I] = T(null);
1611
- K(_, []), K(() => {
1612
- r(be(n)), c((z) => ({ ...me(n), ...z }));
1788
+ const [S, r] = I(() => Se(n)), [i, c] = I(() => we(n)), [m, v] = I(null), [l, x] = I({}), [w, z] = I(null), [N, k] = I(""), [$, W] = I(null), [p, T] = I(null);
1789
+ O(_, []), O(() => {
1790
+ r(Se(n)), c((M) => ({ ...we(n), ...M }));
1613
1791
  }, [n]);
1614
- const R = (z) => c((B) => ({ ...B, [z]: !B[z] })), C = (z, B) => {
1615
- x((j) => ({ ...j, [z]: B })), h == null || h(z, B);
1616
- }, P = () => {
1617
- if (!k) return;
1618
- const z = k, B = L;
1619
- $(null), r((j) => {
1620
- const Y = We(j, z, B);
1621
- return d == null || d(Y), Y;
1792
+ const R = (M) => c((H) => ({ ...H, [M]: !H[M] })), C = (M, H) => {
1793
+ x((P) => ({ ...P, [M]: H })), h == null || h(M, H);
1794
+ }, X = () => {
1795
+ if (!w) return;
1796
+ const M = w, H = N;
1797
+ z(null), r((P) => {
1798
+ const Y = _e(P, M, H);
1799
+ return u == null || u(Y), Y;
1622
1800
  });
1623
- }, q = (z, B) => {
1624
- z.dataTransfer.effectAllowed = "move", A(B);
1625
- }, Q = (z, B) => {
1626
- if (!M || M === B || vt(w, M, B)) return;
1627
- z.preventDefault();
1628
- const j = z.currentTarget.getBoundingClientRect(), Y = z.clientY - j.top, O = j.height, J = Y < O * 0.25 ? "before" : Y > O * 0.75 ? "after" : "inside";
1629
- I((X) => (X == null ? void 0 : X.id) === B && (X == null ? void 0 : X.pos) === J ? X : { id: B, pos: J });
1630
- }, ee = (z, B) => {
1631
- if (z.preventDefault(), !M || !u || M === B) {
1632
- I(null), A(null);
1801
+ }, G = (M, H) => {
1802
+ M.dataTransfer.effectAllowed = "move", W(H);
1803
+ }, se = (M, H) => {
1804
+ if (!$ || $ === H || Bt(S, $, H)) return;
1805
+ M.preventDefault();
1806
+ const P = M.currentTarget.getBoundingClientRect(), Y = M.clientY - P.top, K = P.height, re = Y < K * 0.25 ? "before" : Y > K * 0.75 ? "after" : "inside";
1807
+ T((V) => (V == null ? void 0 : V.id) === H && (V == null ? void 0 : V.pos) === re ? V : { id: H, pos: re });
1808
+ }, Q = (M, H) => {
1809
+ if (M.preventDefault(), !$ || !p || $ === H) {
1810
+ T(null), W(null);
1633
1811
  return;
1634
1812
  }
1635
- r((j) => {
1636
- const [Y, O] = Ee(j, M);
1637
- if (!O) return j;
1638
- const J = ve(Y, B, O, u.pos);
1639
- return d == null || d(J), J;
1640
- }), u.pos === "inside" && c((j) => ({ ...j, [B]: !0 })), I(null), A(null);
1641
- }, te = () => {
1642
- A(null), I(null);
1643
- }, N = (z, B = 0) => {
1644
- var ae;
1645
- const j = (((ae = z.items) == null ? void 0 : ae.length) ?? 0) > 0, Y = l[z.id], O = b === z.id, J = M === z.id, X = (u == null ? void 0 : u.id) === z.id;
1646
- let oe = !!o[z.id], ne = !1;
1647
- if (i && j) {
1648
- const { total: H, checkedCount: re } = kt(z, o);
1649
- re > 0 && re < H ? ne = !0 : H > 0 && re === H && (oe = !0);
1813
+ r((P) => {
1814
+ const [Y, K] = Ke(P, $);
1815
+ if (!K) return P;
1816
+ const re = ze(Y, H, K, p.pos);
1817
+ return u == null || u(re), re;
1818
+ }), p.pos === "inside" && c((P) => ({ ...P, [H]: !0 })), T(null), W(null);
1819
+ }, ie = () => {
1820
+ W(null), T(null);
1821
+ }, E = (M, H = 0) => {
1822
+ var ue;
1823
+ const P = (((ue = M.items) == null ? void 0 : ue.length) ?? 0) > 0, Y = i[M.id], K = m === M.id, re = $ === M.id, V = (p == null ? void 0 : p.id) === M.id;
1824
+ let q = !!l[M.id], ee = !1;
1825
+ if (o && P) {
1826
+ const { total: F, checkedCount: de } = Ht(M, l);
1827
+ de > 0 && de < F ? ee = !0 : F > 0 && de === F && (q = !0);
1650
1828
  }
1651
- const ie = X && u.pos !== "inside" ? { boxShadow: u.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, le = X && u.pos === "inside" || O ? e.primaryLt : "transparent";
1652
- return /* @__PURE__ */ g("div", { style: { opacity: J ? 0.4 : 1 }, children: [
1653
- /* @__PURE__ */ g(
1829
+ const Z = V && p.pos !== "inside" ? { boxShadow: p.pos === "before" ? `inset 0 2px 0 0 ${e.primary}` : `inset 0 -2px 0 0 ${e.primary}` } : {}, xe = V && p.pos === "inside" || K ? e.primaryLt : "transparent";
1830
+ return /* @__PURE__ */ y("div", { style: { opacity: re ? 0.4 : 1 }, children: [
1831
+ /* @__PURE__ */ y(
1654
1832
  "div",
1655
1833
  {
1656
1834
  draggable: !!s,
1657
- onDragStart: s ? (H) => q(H, z.id) : void 0,
1658
- onDragOver: s ? (H) => Q(H, z.id) : void 0,
1659
- onDrop: s ? (H) => ee(H, z.id) : void 0,
1660
- onDragEnd: s ? te : void 0,
1661
- title: f == null ? void 0 : f(z),
1835
+ onDragStart: s ? (F) => G(F, M.id) : void 0,
1836
+ onDragOver: s ? (F) => se(F, M.id) : void 0,
1837
+ onDrop: s ? (F) => Q(F, M.id) : void 0,
1838
+ onDragEnd: s ? ie : void 0,
1839
+ title: f == null ? void 0 : f(M),
1662
1840
  onClick: () => {
1663
- S(z.id), a == null || a(z), j && R(z.id);
1841
+ v(M.id), a == null || a(M), P && R(M.id);
1664
1842
  },
1665
1843
  onDoubleClick: () => {
1666
- p && ($(z.id), m(z.value || ""));
1844
+ d && (z(M.id), k(M.value || ""));
1667
1845
  },
1668
1846
  style: {
1669
1847
  display: "flex",
1670
1848
  alignItems: "center",
1671
1849
  gap: 4,
1672
- padding: `5px 8px 5px ${12 + B * 18}px`,
1850
+ padding: `5px 8px 5px ${12 + H * 18}px`,
1673
1851
  cursor: s ? "grab" : "pointer",
1674
1852
  borderRadius: e.r,
1675
1853
  margin: "1px 4px",
1676
- background: le,
1677
- color: O ? e.primary : e.text,
1854
+ background: xe,
1855
+ color: K ? e.primary : e.text,
1678
1856
  userSelect: "none",
1679
1857
  fontSize: 13,
1680
- ...ie
1858
+ ...Z
1681
1859
  },
1682
- onMouseEnter: (H) => !O && !X && (H.currentTarget.style.background = e.bg),
1683
- onMouseLeave: (H) => !O && !X && (H.currentTarget.style.background = "transparent"),
1860
+ onMouseEnter: (F) => !K && !V && (F.currentTarget.style.background = e.bg),
1861
+ onMouseLeave: (F) => !K && !V && (F.currentTarget.style.background = "transparent"),
1684
1862
  children: [
1685
1863
  /* @__PURE__ */ t(
1686
1864
  "span",
1687
1865
  {
1688
1866
  style: { width: 16, textAlign: "center", fontSize: 11, color: e.textMut, flexShrink: 0 },
1689
- onClick: (H) => {
1690
- H.stopPropagation(), j && R(z.id);
1867
+ onClick: (F) => {
1868
+ F.stopPropagation(), P && R(M.id);
1691
1869
  },
1692
- children: j ? Y ? "▾" : "▸" : ""
1870
+ children: P ? Y ? "▾" : "▸" : ""
1693
1871
  }
1694
1872
  ),
1695
- /* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: j ? Y ? "📂" : "📁" : "📄" }),
1696
- i && /* @__PURE__ */ t(
1873
+ /* @__PURE__ */ t("span", { style: { fontSize: 15, flexShrink: 0 }, children: P ? Y ? "📂" : "📁" : "📄" }),
1874
+ o && /* @__PURE__ */ t(
1697
1875
  "input",
1698
1876
  {
1699
- ref: (H) => {
1700
- H && (H.indeterminate = ne);
1877
+ ref: (F) => {
1878
+ F && (F.indeterminate = ee);
1701
1879
  },
1702
1880
  type: "checkbox",
1703
- checked: oe,
1704
- onChange: (H) => {
1705
- H.stopPropagation(), C(z.id, H.target.checked);
1881
+ checked: q,
1882
+ onChange: (F) => {
1883
+ F.stopPropagation(), C(M.id, F.target.checked);
1706
1884
  },
1707
1885
  style: { cursor: "pointer", accentColor: e.primary, flexShrink: 0 },
1708
- onClick: (H) => H.stopPropagation()
1886
+ onClick: (F) => F.stopPropagation()
1709
1887
  }
1710
1888
  ),
1711
- k === z.id ? /* @__PURE__ */ t(
1889
+ w === M.id ? /* @__PURE__ */ t(
1712
1890
  "input",
1713
1891
  {
1714
1892
  autoFocus: !0,
1715
1893
  className: "dhx dhx-input",
1716
1894
  style: { height: 24, fontSize: 12, flex: 1 },
1717
- value: L,
1718
- onChange: (H) => m(H.target.value),
1719
- onBlur: P,
1720
- onKeyDown: (H) => {
1721
- H.key === "Enter" && P(), H.key === "Escape" && $(null);
1895
+ value: N,
1896
+ onChange: (F) => k(F.target.value),
1897
+ onBlur: X,
1898
+ onKeyDown: (F) => {
1899
+ F.key === "Enter" && X(), F.key === "Escape" && z(null);
1722
1900
  },
1723
- onClick: (H) => H.stopPropagation()
1901
+ onClick: (F) => F.stopPropagation()
1724
1902
  }
1725
- ) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: z.value }),
1726
- z.count !== void 0 && /* @__PURE__ */ g("span", { style: { fontSize: 11, color: e.textMut }, children: [
1903
+ ) : /* @__PURE__ */ t("span", { style: { flex: 1 }, children: M.value }),
1904
+ M.count !== void 0 && /* @__PURE__ */ y("span", { style: { fontSize: 11, color: e.textMut }, children: [
1727
1905
  "(",
1728
- z.count,
1906
+ M.count,
1729
1907
  ")"
1730
1908
  ] })
1731
1909
  ]
1732
1910
  }
1733
1911
  ),
1734
- j && Y && /* @__PURE__ */ t("div", { children: z.items.map((H) => N(H, B + 1)) })
1735
- ] }, z.id);
1912
+ P && Y && /* @__PURE__ */ t("div", { children: M.items.map((F) => E(F, H + 1)) })
1913
+ ] }, M.id);
1736
1914
  };
1737
1915
  return /* @__PURE__ */ t(
1738
1916
  "div",
1739
1917
  {
1740
1918
  className: "dhx dhx-scroll",
1741
- style: { overflowY: "auto", ...y },
1742
- onDragOver: s ? (z) => z.preventDefault() : void 0,
1743
- onDrop: s ? (z) => {
1744
- z.preventDefault(), I(null), A(null);
1919
+ style: { overflowY: "auto", ...g },
1920
+ onDragOver: s ? (M) => M.preventDefault() : void 0,
1921
+ onDrop: s ? (M) => {
1922
+ M.preventDefault(), T(null), W(null);
1745
1923
  } : void 0,
1746
- children: w.map((z) => N(z))
1924
+ children: S.map((M) => E(M))
1747
1925
  }
1748
1926
  );
1749
1927
  }
1750
- function Yt({ total: n, pageSize: i = 10, page: p, onChange: s, style: f }) {
1751
- const [a, h] = T(p || 1), d = Math.ceil(n / i);
1752
- K(_, []);
1753
- const y = (r) => {
1754
- const l = Math.min(Math.max(1, r), d);
1755
- h(l), s == null || s(l);
1756
- }, w = ue(() => {
1928
+ function ln({ total: n, pageSize: o = 10, page: d, onChange: s, style: f }) {
1929
+ const [a, h] = I(d || 1), u = Math.ceil(n / o);
1930
+ O(_, []);
1931
+ const g = (r) => {
1932
+ const i = Math.min(Math.max(1, r), u);
1933
+ h(i), s == null || s(i);
1934
+ }, S = le(() => {
1757
1935
  const r = [];
1758
- for (let c = Math.max(1, a - 2); c <= Math.min(d, a + 2); c++) r.push(c);
1759
- return r[0] > 1 && (r[0] > 2 && r.unshift("..."), r.unshift(1)), r[r.length - 1] < d && (r[r.length - 1] < d - 1 && r.push("..."), r.push(d)), r;
1760
- }, [a, d]);
1761
- return /* @__PURE__ */ g("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...f }, children: [
1762
- /* @__PURE__ */ g("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
1763
- (a - 1) * i + 1,
1936
+ for (let c = Math.max(1, a - 2); c <= Math.min(u, a + 2); c++) r.push(c);
1937
+ return r[0] > 1 && (r[0] > 2 && r.unshift("..."), r.unshift(1)), r[r.length - 1] < u && (r[r.length - 1] < u - 1 && r.push("..."), r.push(u)), r;
1938
+ }, [a, u]);
1939
+ return /* @__PURE__ */ y("div", { className: "dhx", style: { display: "flex", alignItems: "center", gap: 4, padding: "8px 12px", ...f }, children: [
1940
+ /* @__PURE__ */ y("span", { style: { fontSize: 12, color: e.textSec, marginRight: 8 }, children: [
1941
+ (a - 1) * o + 1,
1764
1942
  "–",
1765
- Math.min(a * i, n),
1943
+ Math.min(a * o, n),
1766
1944
  " of ",
1767
1945
  n
1768
1946
  ] }),
1769
- [["«", 1], ["‹", a - 1]].map(([r, l]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === 1, onClick: () => y(l), children: r }, r)),
1770
- w.map((r, l) => /* @__PURE__ */ t("button", { onClick: () => typeof r == "number" && y(r), className: `dhx dhx-btn ${r === a ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: r === "...", children: r }, l)),
1771
- [["›", a + 1], ["»", d]].map(([r, l]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === d, onClick: () => y(l), children: r }, r))
1947
+ [["«", 1], ["‹", a - 1]].map(([r, i]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === 1, onClick: () => g(i), children: r }, r)),
1948
+ S.map((r, i) => /* @__PURE__ */ t("button", { onClick: () => typeof r == "number" && g(r), className: `dhx dhx-btn ${r === a ? "dhx-btn-primary" : "dhx-btn-ghost"}`, style: { height: 30, minWidth: 30, padding: "0 8px", fontSize: 13 }, disabled: r === "...", children: r }, i)),
1949
+ [["›", a + 1], ["»", u]].map(([r, i]) => /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-ghost", style: { height: 30, padding: "0 8px", fontSize: 14 }, disabled: a === u, onClick: () => g(i), children: r }, r))
1772
1950
  ] });
1773
1951
  }
1774
- function Ft({ config: n = {}, defaultValues: i = {}, onSubmit: p, style: s }) {
1775
- const [f, a] = T(i), [h, d] = T({}), [y, w] = T(null);
1776
- K(_, []);
1777
- const r = (o, x) => {
1778
- a((k) => ({ ...k, [o]: x })), d((k) => ({ ...k, [o]: null }));
1779
- }, l = (o) => {
1952
+ function sn({ config: n = {}, defaultValues: o = {}, onSubmit: d, style: s }) {
1953
+ const [f, a] = I(o), [h, u] = I({}), [g, S] = I(null);
1954
+ O(_, []);
1955
+ const r = (l, x) => {
1956
+ a((w) => ({ ...w, [l]: x })), u((w) => ({ ...w, [l]: null }));
1957
+ }, i = (l) => {
1780
1958
  const x = [];
1781
- return o.flat().forEach((k) => {
1782
- !k || typeof k != "object" || !("name" in k) || (x.push(k), k.type === "fieldset" && k.rows && x.push(...l(k.rows)));
1959
+ return l.flat().forEach((w) => {
1960
+ !w || typeof w != "object" || !("name" in w) || (x.push(w), w.type === "fieldset" && w.rows && x.push(...i(w.rows)));
1783
1961
  }), x;
1784
1962
  }, c = () => {
1785
- const o = {};
1786
- return l(n.rows || []).forEach((x) => {
1787
- x.required && !f[x.name] && (o[x.name] = `${x.label || x.name} is required`);
1788
- }), d(o), Object.keys(o).length === 0;
1789
- }, b = (o) => {
1790
- const x = f[o.name] ?? o.value ?? "", k = h[o.name], $ = o.labelWidth ?? n.labelWidth, L = $ !== void 0 || o.labelPosition === "left";
1791
- if (o.type === "fieldset") return /* @__PURE__ */ g("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
1792
- /* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: o.label }),
1793
- (o.rows || []).map((C) => b(C))
1794
- ] }, o.name);
1795
- if (o.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: o.height || 16 } }, o.name);
1796
- const m = $ ? { minWidth: $, width: $, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, M = o.label ? /* @__PURE__ */ g("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...m }, children: [
1797
- o.label,
1798
- o.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
1799
- ] }, "lbl") : null, A = k ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: k }) : null, u = o.helpMessage ? /* @__PURE__ */ g("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1963
+ const l = {};
1964
+ return i(n.rows || []).forEach((x) => {
1965
+ x.required && !f[x.name] && (l[x.name] = `${x.label || x.name} is required`);
1966
+ }), u(l), Object.keys(l).length === 0;
1967
+ }, m = (l) => {
1968
+ const x = f[l.name] ?? l.value ?? "", w = h[l.name], z = l.labelWidth ?? n.labelWidth, N = z !== void 0 || l.labelPosition === "left";
1969
+ if (l.type === "fieldset") return /* @__PURE__ */ y("fieldset", { style: { border: `1px solid ${e.border}`, borderRadius: e.r, padding: "12px 16px", marginBottom: 14 }, children: [
1970
+ /* @__PURE__ */ t("legend", { style: { fontSize: 12, fontWeight: 700, color: e.textSec, padding: "0 6px" }, children: l.label }),
1971
+ (l.rows || []).map((C) => m(C))
1972
+ ] }, l.name);
1973
+ if (l.type === "spacer") return /* @__PURE__ */ t("div", { style: { height: l.height || 16 } }, l.name);
1974
+ const k = z ? { minWidth: z, width: z, flexShrink: 0, paddingTop: 8, boxSizing: "border-box" } : {}, $ = l.label ? /* @__PURE__ */ y("label", { className: "dhx dhx-label", style: { display: "flex", gap: 4, ...k }, children: [
1975
+ l.label,
1976
+ l.required && /* @__PURE__ */ t("span", { style: { color: e.danger }, children: "*" })
1977
+ ] }, "lbl") : null, W = w ? /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.danger, marginTop: 3 }, children: w }) : null, p = l.helpMessage ? /* @__PURE__ */ y("div", { style: { fontSize: 11, color: e.textMut, marginTop: 3 }, children: [
1800
1978
  "ⓘ ",
1801
- o.helpMessage
1802
- ] }) : null, I = { key: o.name, className: "dhx-form-group" }, R = (C) => L ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1803
- M,
1804
- /* @__PURE__ */ g("div", { style: { flex: 1, minWidth: 0 }, children: [
1979
+ l.helpMessage
1980
+ ] }) : null, T = { key: l.name, className: "dhx-form-group" }, R = (C) => N ? /* @__PURE__ */ y("div", { ...T, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1981
+ $,
1982
+ /* @__PURE__ */ y("div", { style: { flex: 1, minWidth: 0 }, children: [
1805
1983
  C,
1806
- A,
1807
- u
1984
+ W,
1985
+ p
1808
1986
  ] })
1809
- ] }) : /* @__PURE__ */ g("div", { ...I, children: [
1810
- M,
1987
+ ] }) : /* @__PURE__ */ y("div", { ...T, children: [
1988
+ $,
1811
1989
  C,
1812
- A,
1813
- u
1990
+ W,
1991
+ p
1814
1992
  ] });
1815
- if (!o.type || o.type === "input") return R(
1816
- /* @__PURE__ */ g("div", { className: "dhx-input-wrap", children: [
1817
- o.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: o.icon }),
1993
+ if (!l.type || l.type === "input") return R(
1994
+ /* @__PURE__ */ y("div", { className: "dhx-input-wrap", children: [
1995
+ l.icon && /* @__PURE__ */ t("span", { className: "dhx-input-icon", children: l.icon }),
1818
1996
  /* @__PURE__ */ t(
1819
1997
  "input",
1820
1998
  {
1821
- className: `dhx dhx-input${o.icon ? " dhx-input--with-icon" : ""}`,
1822
- style: { borderColor: k ? e.danger : void 0 },
1823
- type: o.inputType || "text",
1824
- placeholder: o.placeholder,
1999
+ className: `dhx dhx-input${l.icon ? " dhx-input--with-icon" : ""}`,
2000
+ style: { borderColor: w ? e.danger : void 0 },
2001
+ type: l.inputType || "text",
2002
+ placeholder: l.placeholder,
1825
2003
  value: x,
1826
- onChange: (C) => r(o.name, C.target.value),
1827
- disabled: o.disabled
2004
+ onChange: (C) => r(l.name, C.target.value),
2005
+ disabled: l.disabled
1828
2006
  }
1829
2007
  )
1830
2008
  ] })
1831
2009
  );
1832
- if (o.type === "textarea") return R(
2010
+ if (l.type === "textarea") return R(
1833
2011
  /* @__PURE__ */ t(
1834
2012
  "textarea",
1835
2013
  {
1836
2014
  className: "dhx dhx-input",
1837
2015
  style: { height: 80, resize: "vertical", padding: "8px 10px" },
1838
- placeholder: o.placeholder,
2016
+ placeholder: l.placeholder,
1839
2017
  value: x,
1840
- onChange: (C) => r(o.name, C.target.value)
2018
+ onChange: (C) => r(l.name, C.target.value)
1841
2019
  }
1842
2020
  )
1843
2021
  );
1844
- if (o.type === "select") return R(
1845
- /* @__PURE__ */ g("select", { className: "dhx dhx-input", value: x, onChange: (C) => r(o.name, C.target.value), style: { cursor: "pointer" }, children: [
2022
+ if (l.type === "select") return R(
2023
+ /* @__PURE__ */ y("select", { className: "dhx dhx-input", value: x, onChange: (C) => r(l.name, C.target.value), style: { cursor: "pointer" }, children: [
1846
2024
  /* @__PURE__ */ t("option", { value: "", children: "— Select —" }),
1847
- (o.options || []).map((C) => /* @__PURE__ */ t("option", { value: C.value, children: C.label || C.value }, C.value))
2025
+ (l.options || []).map((C) => /* @__PURE__ */ t("option", { value: C.value, children: C.label || C.value }, C.value))
1848
2026
  ] })
1849
2027
  );
1850
- if (o.type === "datepicker") return R(
1851
- /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: x, onChange: (C) => r(o.name, C.target.value) })
2028
+ if (l.type === "datepicker") return R(
2029
+ /* @__PURE__ */ t("input", { type: "date", className: "dhx dhx-input", value: x, onChange: (C) => r(l.name, C.target.value) })
1852
2030
  );
1853
- if (o.type === "timepicker") {
1854
- const C = f[o.name] ?? { h: 12, m: 0, ampm: "AM" }, P = !!f[o.name], q = P ? `${String(C.h).padStart(2, "0")}:${String(C.m).padStart(2, "0")}${C.ampm ? " " + C.ampm : ""}` : o.placeholder || "Click to select", Q = /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
1855
- /* @__PURE__ */ g(
2031
+ if (l.type === "timepicker") {
2032
+ const C = f[l.name] ?? { h: 12, m: 0, ampm: "AM" }, X = !!f[l.name], G = X ? `${String(C.h).padStart(2, "0")}:${String(C.m).padStart(2, "0")}${C.ampm ? " " + C.ampm : ""}` : l.placeholder || "Click to select", se = /* @__PURE__ */ y("div", { style: { position: "relative" }, children: [
2033
+ /* @__PURE__ */ y(
1856
2034
  "div",
1857
2035
  {
1858
2036
  className: "dhx dhx-input",
1859
2037
  style: { cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between" },
1860
- onClick: () => w(y === o.name ? null : o.name),
2038
+ onClick: () => S(g === l.name ? null : l.name),
1861
2039
  children: [
1862
- /* @__PURE__ */ t("span", { style: { color: P ? e.text : e.textMut }, children: q }),
2040
+ /* @__PURE__ */ t("span", { style: { color: X ? e.text : e.textMut }, children: G }),
1863
2041
  /* @__PURE__ */ t("span", { style: { fontSize: 13, color: e.textSec }, children: "🕐" })
1864
2042
  ]
1865
2043
  }
1866
2044
  ),
1867
- y === o.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(gt, { value: C, controls: !0, onChange: (ee) => {
1868
- r(o.name, ee), w(null);
2045
+ g === l.name && /* @__PURE__ */ t("div", { style: { position: "absolute", zIndex: 100, top: "calc(100% + 4px)", left: 0 }, children: /* @__PURE__ */ t(Et, { value: C, controls: !0, onChange: (Q) => {
2046
+ r(l.name, Q), S(null);
1869
2047
  } }) })
1870
2048
  ] });
1871
- return R(Q);
2049
+ return R(se);
1872
2050
  }
1873
- if (o.type === "colorpicker") return R(
1874
- /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
2051
+ if (l.type === "colorpicker") return R(
2052
+ /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1875
2053
  /* @__PURE__ */ t(
1876
2054
  "input",
1877
2055
  {
1878
2056
  type: "color",
1879
2057
  value: x || "#000000",
1880
- onChange: (C) => r(o.name, C.target.value),
2058
+ onChange: (C) => r(l.name, C.target.value),
1881
2059
  style: { width: 36, height: 36, padding: 2, border: `1px solid ${e.border}`, borderRadius: e.r, cursor: "pointer", background: "none" }
1882
2060
  }
1883
2061
  ),
1884
2062
  /* @__PURE__ */ t("span", { style: { fontSize: 12, color: e.textSec, fontFamily: "monospace" }, children: x || "#000000" })
1885
2063
  ] })
1886
2064
  );
1887
- if (o.type === "text") return R(
1888
- /* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: o.value })
2065
+ if (l.type === "text") return R(
2066
+ /* @__PURE__ */ t("p", { style: { margin: "6px 0", fontSize: 13, color: e.text }, children: l.value })
1889
2067
  );
1890
- if (o.type === "checkbox") return /* @__PURE__ */ g("div", { ...I, children: [
1891
- L ? /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1892
- $ && /* @__PURE__ */ t("div", { style: { width: $, flexShrink: 0 } }),
1893
- /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1894
- /* @__PURE__ */ t("input", { type: "checkbox", checked: !!x, onChange: (C) => r(o.name, C.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1895
- /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
2068
+ if (l.type === "checkbox") return /* @__PURE__ */ y("div", { ...T, children: [
2069
+ N ? /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
2070
+ z && /* @__PURE__ */ t("div", { style: { width: z, flexShrink: 0 } }),
2071
+ /* @__PURE__ */ y("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
2072
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!x, onChange: (C) => r(l.name, C.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
2073
+ /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: l.label })
1896
2074
  ] })
1897
- ] }) : /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1898
- /* @__PURE__ */ t("input", { type: "checkbox", checked: !!x, onChange: (C) => r(o.name, C.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
1899
- /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: o.label })
2075
+ ] }) : /* @__PURE__ */ y("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
2076
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!x, onChange: (C) => r(l.name, C.target.checked), style: { width: 16, height: 16, accentColor: e.primary, cursor: "pointer" } }),
2077
+ /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: l.label })
1900
2078
  ] }),
1901
- u
2079
+ p
1902
2080
  ] });
1903
- if (o.type === "radio") {
1904
- const C = (o.options || []).map((P) => /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
2081
+ if (l.type === "radio") {
2082
+ const C = (l.options || []).map((X) => /* @__PURE__ */ y("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer", fontSize: 13 }, children: [
1905
2083
  /* @__PURE__ */ t(
1906
2084
  "input",
1907
2085
  {
1908
2086
  type: "radio",
1909
- name: o.name,
1910
- value: P.value,
1911
- checked: x === P.value,
1912
- onChange: () => r(o.name, P.value),
2087
+ name: l.name,
2088
+ value: X.value,
2089
+ checked: x === X.value,
2090
+ onChange: () => r(l.name, X.value),
1913
2091
  style: { accentColor: e.primary, cursor: "pointer" }
1914
2092
  }
1915
2093
  ),
1916
- P.label || P.value
1917
- ] }, P.value));
2094
+ X.label || X.value
2095
+ ] }, X.value));
1918
2096
  return R(
1919
2097
  /* @__PURE__ */ t("div", { style: { display: "flex", gap: 16, flexWrap: "wrap", paddingTop: 8 }, children: C })
1920
2098
  );
1921
2099
  }
1922
- if (o.type === "slider") return L ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1923
- M,
1924
- /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
2100
+ if (l.type === "slider") return N ? /* @__PURE__ */ y("div", { ...T, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
2101
+ $,
2102
+ /* @__PURE__ */ y("div", { style: { flex: 1 }, children: [
1925
2103
  /* @__PURE__ */ t(
1926
- De,
2104
+ Be,
1927
2105
  {
1928
- min: o.min,
1929
- max: o.max,
1930
- step: o.step,
1931
- value: x || o.min,
1932
- range: o.range,
1933
- onChange: (C) => r(o.name, C)
2106
+ min: l.min,
2107
+ max: l.max,
2108
+ step: l.step,
2109
+ value: x || l.min,
2110
+ range: l.range,
2111
+ onChange: (C) => r(l.name, C)
1934
2112
  }
1935
2113
  ),
1936
- u
2114
+ p
1937
2115
  ] })
1938
- ] }) : /* @__PURE__ */ g("div", { ...I, children: [
2116
+ ] }) : /* @__PURE__ */ y("div", { ...T, children: [
1939
2117
  /* @__PURE__ */ t(
1940
- De,
2118
+ Be,
1941
2119
  {
1942
- label: o.label,
1943
- min: o.min,
1944
- max: o.max,
1945
- step: o.step,
1946
- value: x || o.min,
1947
- range: o.range,
1948
- onChange: (C) => r(o.name, C)
2120
+ label: l.label,
2121
+ min: l.min,
2122
+ max: l.max,
2123
+ step: l.step,
2124
+ value: x || l.min,
2125
+ range: l.range,
2126
+ onChange: (C) => r(l.name, C)
1949
2127
  }
1950
2128
  ),
1951
- u
2129
+ p
1952
2130
  ] });
1953
- if (o.type === "combo") return L ? /* @__PURE__ */ g("div", { ...I, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
1954
- M,
1955
- /* @__PURE__ */ g("div", { style: { flex: 1 }, children: [
2131
+ if (l.type === "combo") return N ? /* @__PURE__ */ y("div", { ...T, style: { display: "flex", alignItems: "flex-start", gap: 8 }, children: [
2132
+ $,
2133
+ /* @__PURE__ */ y("div", { style: { flex: 1 }, children: [
1956
2134
  /* @__PURE__ */ t(
1957
- $e,
2135
+ Ae,
1958
2136
  {
1959
- data: o.data || [],
1960
- multiselection: o.multiselection,
1961
- placeholder: o.placeholder || "Select...",
1962
- value: x || (o.multiselection ? [] : null),
1963
- onChange: (C) => r(o.name, C)
2137
+ data: l.data || [],
2138
+ multiselection: l.multiselection,
2139
+ placeholder: l.placeholder || "Select...",
2140
+ value: x || (l.multiselection ? [] : null),
2141
+ onChange: (C) => r(l.name, C)
1964
2142
  }
1965
2143
  ),
1966
- A,
1967
- u
2144
+ W,
2145
+ p
1968
2146
  ] })
1969
- ] }) : /* @__PURE__ */ g("div", { ...I, children: [
2147
+ ] }) : /* @__PURE__ */ y("div", { ...T, children: [
1970
2148
  /* @__PURE__ */ t(
1971
- $e,
2149
+ Ae,
1972
2150
  {
1973
- label: o.label,
1974
- data: o.data || [],
1975
- multiselection: o.multiselection,
1976
- placeholder: o.placeholder || "Select...",
1977
- value: x || (o.multiselection ? [] : null),
1978
- onChange: (C) => r(o.name, C)
2151
+ label: l.label,
2152
+ data: l.data || [],
2153
+ multiselection: l.multiselection,
2154
+ placeholder: l.placeholder || "Select...",
2155
+ value: x || (l.multiselection ? [] : null),
2156
+ onChange: (C) => r(l.name, C)
1979
2157
  }
1980
2158
  ),
1981
- A,
1982
- u
2159
+ W,
2160
+ p
1983
2161
  ] });
1984
- if (o.type === "toggle") {
1985
- const C = !!x, P = C ? o.icon : o.offIcon || o.icon, q = C ? o.text || o.label : o.offText || o.text || o.label;
1986
- return /* @__PURE__ */ g("div", { ...I, children: [
1987
- L && $ && /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
1988
- /* @__PURE__ */ t("div", { style: { width: $, flexShrink: 0 } }),
1989
- /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
1990
- /* @__PURE__ */ t(Le, { on: C, onClick: () => r(o.name, !x) }),
1991
- P && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: P }),
1992
- q && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: q })
2162
+ if (l.type === "toggle") {
2163
+ const C = !!x, X = C ? l.icon : l.offIcon || l.icon, G = C ? l.text || l.label : l.offText || l.text || l.label;
2164
+ return /* @__PURE__ */ y("div", { ...T, children: [
2165
+ N && z && /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
2166
+ /* @__PURE__ */ t("div", { style: { width: z, flexShrink: 0 } }),
2167
+ /* @__PURE__ */ y("label", { style: { display: "flex", alignItems: "center", gap: 8, cursor: "pointer" }, children: [
2168
+ /* @__PURE__ */ t(Pe, { on: C, onClick: () => r(l.name, !x) }),
2169
+ X && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: X }),
2170
+ G && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: G })
1993
2171
  ] })
1994
2172
  ] }),
1995
- !L && /* @__PURE__ */ g("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
1996
- /* @__PURE__ */ t(Le, { on: C, onClick: () => r(o.name, !x) }),
1997
- P && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: P }),
1998
- q && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: q })
2173
+ !N && /* @__PURE__ */ y("label", { style: { display: "flex", alignItems: "center", gap: 10, cursor: "pointer" }, children: [
2174
+ /* @__PURE__ */ t(Pe, { on: C, onClick: () => r(l.name, !x) }),
2175
+ X && /* @__PURE__ */ t("span", { style: { fontSize: 16 }, children: X }),
2176
+ G && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: G })
1999
2177
  ] }),
2000
- u
2178
+ p
2001
2179
  ] });
2002
2180
  }
2003
2181
  return null;
2004
- }, S = (o) => o.map(
2005
- (x, k) => Array.isArray(x) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: x.map(b) }, k) : b(x)
2182
+ }, v = (l) => l.map(
2183
+ (x, w) => Array.isArray(x) ? /* @__PURE__ */ t("div", { style: { display: "flex", gap: 12, alignItems: "flex-start" }, children: x.map(m) }, w) : m(x)
2006
2184
  );
2007
- return /* @__PURE__ */ g("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...s }, children: [
2008
- S(n.rows || []),
2009
- (n.buttons || p) && /* @__PURE__ */ g("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
2010
- /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => c() && (p == null ? void 0 : p(f)), children: n.submitText || "Submit" }),
2185
+ return /* @__PURE__ */ y("div", { className: "dhx", style: { padding: n.padding || 0, width: n.width || "100%", ...s }, children: [
2186
+ v(n.rows || []),
2187
+ (n.buttons || d) && /* @__PURE__ */ y("div", { style: { display: "flex", gap: 8, justifyContent: n.buttonAlign || "flex-start", marginTop: 8 }, children: [
2188
+ /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-primary", onClick: () => c() && (d == null ? void 0 : d(f)), children: n.submitText || "Submit" }),
2011
2189
  n.resetButton !== !1 && /* @__PURE__ */ t("button", { className: "dhx dhx-btn dhx-btn-secondary", onClick: () => {
2012
- a(i), d({});
2190
+ a(o), u({});
2013
2191
  }, children: n.resetText || "Reset" })
2014
2192
  ] })
2015
2193
  ] });
2016
2194
  }
2017
- function Le({ on: n, onClick: i }) {
2018
- return /* @__PURE__ */ g("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: i, children: [
2195
+ function Pe({ on: n, onClick: o }) {
2196
+ return /* @__PURE__ */ y("div", { style: { position: "relative", width: 40, height: 22, flexShrink: 0 }, onClick: o, children: [
2019
2197
  /* @__PURE__ */ t("div", { style: { width: 40, height: 22, borderRadius: 11, background: n ? e.primary : e.border, transition: "background 0.2s" } }),
2020
2198
  /* @__PURE__ */ t("div", { style: { position: "absolute", top: 3, left: n ? 21 : 3, width: 16, height: 16, borderRadius: "50%", background: "#fff", transition: "left 0.2s", boxShadow: "0 1px 3px rgba(0,0,0,.3)" } })
2021
2199
  ] });
2022
2200
  }
2023
- function ke(n) {
2024
- const i = [];
2025
- for (const p of n)
2026
- p.type === "block" ? i.push(...ke(p.items || [])) : i.push(p);
2027
- return i;
2201
+ function Me(n) {
2202
+ const o = [];
2203
+ for (const d of n)
2204
+ d.type === "block" ? o.push(...Me(d.items || [])) : o.push(d);
2205
+ return o;
2028
2206
  }
2029
- function Kt({ items: n = [], onAction: i, style: p }) {
2030
- K(_, []);
2031
- const [s, f] = T(() => {
2032
- const l = {};
2033
- for (const c of ke(n))
2034
- c.id && (l[c.id] = !!c.active);
2035
- return l;
2036
- }), a = ke(n), h = (l) => {
2207
+ function an({ items: n = [], onAction: o, style: d }) {
2208
+ O(_, []);
2209
+ const [s, f] = I(() => {
2210
+ const i = {};
2211
+ for (const c of Me(n))
2212
+ c.id && (i[c.id] = !!c.active);
2213
+ return i;
2214
+ }), a = Me(n), h = (i) => {
2037
2215
  var c;
2038
- if (!l.disabled) {
2039
- if (l.id)
2040
- if (l.group) {
2041
- const b = a.filter((S) => S.group === l.group && S.id);
2042
- f((S) => {
2043
- const o = { ...S };
2044
- for (const x of b) o[x.id] = !1;
2045
- return o[l.id] = !0, o;
2216
+ if (!i.disabled) {
2217
+ if (i.id)
2218
+ if (i.group) {
2219
+ const m = a.filter((v) => v.group === i.group && v.id);
2220
+ f((v) => {
2221
+ const l = { ...v };
2222
+ for (const x of m) l[x.id] = !1;
2223
+ return l[i.id] = !0, l;
2046
2224
  });
2047
- } else l.twoState && f((b) => ({ ...b, [l.id]: !b[l.id] }));
2048
- (c = l.onClick) == null || c.call(l, l), l.id && (i == null || i(l.id, l));
2225
+ } else i.twoState && f((m) => ({ ...m, [i.id]: !m[i.id] }));
2226
+ (c = i.onClick) == null || c.call(i, i), i.id && (o == null || o(i.id, i));
2049
2227
  }
2050
- }, d = (l, c) => {
2228
+ }, u = (i, c) => {
2051
2229
  var x;
2052
- if (l.hidden) return null;
2053
- const b = l.value ?? l.text, S = l.size === "auto", o = l.id !== void 0 ? s[l.id] ?? !!l.active : !!l.active;
2054
- return l.type === "separator" || l.type === "sep" ? /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "4px 2px", alignSelf: "stretch" } }, c) : l.type === "input" ? /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", padding: "2px 4px", gap: 2 }, children: [
2055
- l.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: l.label }),
2056
- /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
2057
- l.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 6, fontSize: 13, color: e.textMut, pointerEvents: "none", zIndex: 1 }, children: l.icon }),
2230
+ if (i.hidden) return null;
2231
+ const m = i.value ?? i.text, v = i.size === "auto", l = i.id !== void 0 ? s[i.id] ?? !!i.active : !!i.active;
2232
+ return i.type === "separator" || i.type === "sep" ? /* @__PURE__ */ t("div", { style: { width: 1, background: e.border, margin: "4px 2px", alignSelf: "stretch" } }, c) : i.type === "input" ? /* @__PURE__ */ y("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", padding: "2px 4px", gap: 2 }, children: [
2233
+ i.label && /* @__PURE__ */ t("span", { style: { fontSize: 10, color: e.textMut }, children: i.label }),
2234
+ /* @__PURE__ */ y("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
2235
+ i.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 6, fontSize: 13, color: e.textMut, pointerEvents: "none", zIndex: 1 }, children: i.icon }),
2058
2236
  /* @__PURE__ */ t(
2059
2237
  "input",
2060
2238
  {
2061
2239
  className: "dhx dhx-input",
2062
- style: { width: l.width || 110, height: 26, fontSize: 12, paddingLeft: l.icon ? 24 : void 0 },
2063
- placeholder: l.placeholder,
2064
- defaultValue: l.value,
2065
- onChange: (k) => {
2066
- var $;
2067
- return ($ = l.onChange) == null ? void 0 : $.call(l, k.target.value);
2240
+ style: { width: i.width || 110, height: 26, fontSize: 12, paddingLeft: i.icon ? 24 : void 0 },
2241
+ placeholder: i.placeholder,
2242
+ defaultValue: i.value,
2243
+ onChange: (w) => {
2244
+ var z;
2245
+ return (z = i.onChange) == null ? void 0 : z.call(i, w.target.value);
2068
2246
  }
2069
2247
  }
2070
2248
  )
2071
2249
  ] })
2072
- ] }, c) : l.type === "selectButton" ? /* @__PURE__ */ t(
2250
+ ] }, c) : i.type === "selectButton" ? /* @__PURE__ */ t(
2073
2251
  "select",
2074
2252
  {
2075
2253
  className: "dhx dhx-input",
2076
- style: { height: 26, fontSize: 12, cursor: "pointer", margin: 2, width: l.width },
2077
- defaultValue: l.value,
2078
- onChange: (k) => {
2079
- var $;
2080
- return ($ = l.onChange) == null ? void 0 : $.call(l, k.target.value);
2254
+ style: { height: 26, fontSize: 12, cursor: "pointer", margin: 2, width: i.width },
2255
+ defaultValue: i.value,
2256
+ onChange: (w) => {
2257
+ var z;
2258
+ return (z = i.onChange) == null ? void 0 : z.call(i, w.target.value);
2081
2259
  },
2082
- children: (x = l.items) == null ? void 0 : x.map((k) => /* @__PURE__ */ t("option", { value: k.value, children: k.value }, k.value))
2260
+ children: (x = i.items) == null ? void 0 : x.map((w) => /* @__PURE__ */ t("option", { value: w.value, children: w.value }, w.value))
2083
2261
  },
2084
2262
  c
2085
- ) : /* @__PURE__ */ g(
2263
+ ) : /* @__PURE__ */ y(
2086
2264
  "button",
2087
2265
  {
2088
- title: l.tooltip,
2089
- disabled: l.disabled,
2266
+ title: i.tooltip,
2267
+ disabled: i.disabled,
2090
2268
  className: "dhx dhx-btn dhx-btn-ghost",
2091
2269
  style: {
2092
- flexDirection: S ? "column" : "row",
2093
- alignSelf: S ? "stretch" : "center",
2270
+ flexDirection: v ? "column" : "row",
2271
+ alignSelf: v ? "stretch" : "center",
2094
2272
  justifyContent: "center",
2095
- minHeight: S ? 48 : 26,
2096
- padding: S ? "6px 10px" : "0 8px",
2097
- gap: S ? 4 : 5,
2273
+ minHeight: v ? 48 : 26,
2274
+ padding: v ? "6px 10px" : "0 8px",
2275
+ gap: v ? 4 : 5,
2098
2276
  position: "relative",
2099
- background: o ? e.primaryLt : "transparent",
2100
- color: o ? e.primary : l.disabled ? e.textMut : e.text,
2101
- opacity: l.disabled ? 0.55 : 1,
2102
- cursor: l.disabled ? "not-allowed" : "pointer"
2277
+ background: l ? e.primaryLt : "transparent",
2278
+ color: l ? e.primary : i.disabled ? e.textMut : e.text,
2279
+ opacity: i.disabled ? 0.55 : 1,
2280
+ cursor: i.disabled ? "not-allowed" : "pointer"
2103
2281
  },
2104
- onClick: () => h(l),
2282
+ onClick: () => h(i),
2105
2283
  children: [
2106
- l.icon && /* @__PURE__ */ t("span", { style: { fontSize: S ? 22 : 15, lineHeight: 1, flexShrink: 0 }, children: l.icon }),
2107
- b && /* @__PURE__ */ t("span", { style: {
2284
+ i.icon && /* @__PURE__ */ t("span", { style: { fontSize: v ? 22 : 15, lineHeight: 1, flexShrink: 0 }, children: i.icon }),
2285
+ m && /* @__PURE__ */ t("span", { style: {
2108
2286
  fontSize: 10,
2109
- maxWidth: S ? 64 : void 0,
2110
- textAlign: S ? "center" : "left",
2287
+ maxWidth: v ? 64 : void 0,
2288
+ textAlign: v ? "center" : "left",
2111
2289
  lineHeight: 1.2,
2112
- whiteSpace: S ? "normal" : "nowrap"
2113
- }, children: b }),
2114
- l.count !== void 0 && /* @__PURE__ */ t("span", { style: {
2290
+ whiteSpace: v ? "normal" : "nowrap"
2291
+ }, children: m }),
2292
+ i.count !== void 0 && /* @__PURE__ */ t("span", { style: {
2115
2293
  position: "absolute",
2116
2294
  top: 2,
2117
2295
  right: 2,
@@ -2127,25 +2305,25 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2127
2305
  justifyContent: "center",
2128
2306
  padding: "0 2px",
2129
2307
  pointerEvents: "none"
2130
- }, children: l.count })
2308
+ }, children: i.count })
2131
2309
  ]
2132
2310
  },
2133
2311
  c
2134
2312
  );
2135
- }, y = (l, c) => {
2136
- var b;
2313
+ }, g = (i, c) => {
2314
+ var m;
2137
2315
  return /* @__PURE__ */ t("div", { style: {
2138
2316
  display: "flex",
2139
- flexDirection: l.direction === "col" ? "column" : "row",
2140
- alignItems: l.direction === "col" ? "flex-start" : "center",
2317
+ flexDirection: i.direction === "col" ? "column" : "row",
2318
+ alignItems: i.direction === "col" ? "flex-start" : "center",
2141
2319
  gap: 2
2142
- }, children: (b = l.items) == null ? void 0 : b.map(
2143
- (S, o) => S.type === "block" ? y(S, `${c}-${o}`) : d(S, `${c}-${o}`)
2320
+ }, children: (m = i.items) == null ? void 0 : m.map(
2321
+ (v, l) => v.type === "block" ? g(v, `${c}-${l}`) : u(v, `${c}-${l}`)
2144
2322
  ) }, c);
2145
- }, w = (l, c) => {
2146
- var S;
2147
- const b = l.title || l.label;
2148
- return /* @__PURE__ */ g("div", { style: {
2323
+ }, S = (i, c) => {
2324
+ var v;
2325
+ const m = i.title || i.label;
2326
+ return /* @__PURE__ */ y("div", { style: {
2149
2327
  display: "flex",
2150
2328
  flexDirection: "column",
2151
2329
  alignItems: "stretch",
@@ -2155,23 +2333,23 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2155
2333
  }, children: [
2156
2334
  /* @__PURE__ */ t("div", { style: {
2157
2335
  display: "flex",
2158
- flexDirection: l.direction === "col" ? "column" : "row",
2159
- alignItems: l.direction === "col" ? "stretch" : "center",
2336
+ flexDirection: i.direction === "col" ? "column" : "row",
2337
+ alignItems: i.direction === "col" ? "stretch" : "center",
2160
2338
  gap: 2,
2161
2339
  flex: 1
2162
- }, children: (S = l.items) == null ? void 0 : S.map(
2163
- (o, x) => o.type === "block" ? y(o, x) : d(o, x)
2340
+ }, children: (v = i.items) == null ? void 0 : v.map(
2341
+ (l, x) => l.type === "block" ? g(l, x) : u(l, x)
2164
2342
  ) }),
2165
- b && /* @__PURE__ */ t("div", { style: {
2343
+ m && /* @__PURE__ */ t("div", { style: {
2166
2344
  fontSize: 10,
2167
2345
  color: e.textMut,
2168
2346
  textAlign: "center",
2169
2347
  padding: "3px 0 4px",
2170
2348
  marginTop: 2,
2171
2349
  borderTop: `1px solid ${e.border}`
2172
- }, children: b })
2350
+ }, children: m })
2173
2351
  ] }, c);
2174
- }, r = (l, c) => l.type === "block" ? w(l, c) : d(l, c);
2352
+ }, r = (i, c) => i.type === "block" ? S(i, c) : u(i, c);
2175
2353
  return /* @__PURE__ */ t("div", { className: "dhx", style: {
2176
2354
  display: "flex",
2177
2355
  alignItems: "stretch",
@@ -2180,10 +2358,10 @@ function Kt({ items: n = [], onAction: i, style: p }) {
2180
2358
  overflowX: "auto",
2181
2359
  gap: 0,
2182
2360
  minHeight: 72,
2183
- ...p
2361
+ ...d
2184
2362
  }, children: n.map(r) });
2185
2363
  }
2186
- function Te({ count: n }) {
2364
+ function je({ count: n }) {
2187
2365
  return /* @__PURE__ */ t("span", { style: {
2188
2366
  position: "absolute",
2189
2367
  top: 3,
@@ -2203,34 +2381,34 @@ function Te({ count: n }) {
2203
2381
  pointerEvents: "none"
2204
2382
  }, children: n });
2205
2383
  }
2206
- function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f }) {
2207
- const [a, h] = T(null), [d, y] = T(() => {
2384
+ function dn({ logo: n, items: o = [], vertical: d = !1, onAction: s, style: f }) {
2385
+ const [a, h] = I(null), [u, g] = I(() => {
2208
2386
  const c = {};
2209
- return i.forEach((b) => {
2210
- b.id && b.twoState && b.active && (c[b.id] = !0);
2387
+ return o.forEach((m) => {
2388
+ m.id && m.twoState && m.active && (c[m.id] = !0);
2211
2389
  }), c;
2212
- }), w = U(null);
2213
- K(_, []), he(w, Z(() => h(null), []));
2214
- const r = (c, b) => {
2215
- var S, o;
2390
+ }), S = ne(null);
2391
+ O(_, []), fe(S, oe(() => h(null), []));
2392
+ const r = (c, m) => {
2393
+ var v, l;
2216
2394
  if (!c.disabled) {
2217
- if (c.twoState && c.id && y((x) => ({ ...x, [c.id]: !x[c.id] })), (S = c.items) != null && S.length) {
2218
- h((x) => x === b ? null : b);
2395
+ if (c.twoState && c.id && g((x) => ({ ...x, [c.id]: !x[c.id] })), (v = c.items) != null && v.length) {
2396
+ h((x) => x === m ? null : m);
2219
2397
  return;
2220
2398
  }
2221
- (o = c.onClick) == null || o.call(c, c.id || ""), s == null || s(c.id || "");
2399
+ (l = c.onClick) == null || l.call(c, c.id || ""), s == null || s(c.id || "");
2222
2400
  }
2223
- }, l = (c, b) => {
2224
- var k;
2401
+ }, i = (c, m) => {
2402
+ var w;
2225
2403
  if (c.hidden) return null;
2226
2404
  if (c.type === "separator") return /* @__PURE__ */ t("div", { style: {
2227
- [p ? "height" : "width"]: 1,
2405
+ [d ? "height" : "width"]: 1,
2228
2406
  background: e.border,
2229
- margin: p ? "4px 8px" : "0 6px",
2407
+ margin: d ? "4px 8px" : "0 6px",
2230
2408
  alignSelf: "stretch"
2231
- } }, b);
2232
- if (c.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, b);
2233
- if (c.type === "input") return /* @__PURE__ */ g("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
2409
+ } }, m);
2410
+ if (c.type === "spacer") return /* @__PURE__ */ t("div", { style: { flex: 1 } }, m);
2411
+ if (c.type === "input") return /* @__PURE__ */ y("div", { style: { position: "relative", display: "flex", alignItems: "center", margin: "0 4px" }, children: [
2234
2412
  c.icon && /* @__PURE__ */ t("span", { style: { position: "absolute", left: 8, color: e.textMut, fontSize: 15, pointerEvents: "none", zIndex: 1 }, children: c.icon }),
2235
2413
  /* @__PURE__ */ t(
2236
2414
  "input",
@@ -2238,14 +2416,14 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2238
2416
  className: "dhx dhx-input",
2239
2417
  style: { width: c.width || 200, height: 28, paddingLeft: c.icon ? 30 : void 0 },
2240
2418
  placeholder: c.placeholder,
2241
- onChange: ($) => {
2242
- var L;
2243
- return (L = c.onChange) == null ? void 0 : L.call(c, $.target.value);
2419
+ onChange: (z) => {
2420
+ var N;
2421
+ return (N = c.onChange) == null ? void 0 : N.call(c, z.target.value);
2244
2422
  }
2245
2423
  }
2246
2424
  )
2247
- ] }, b);
2248
- if (c.type === "imageButton") return /* @__PURE__ */ g(
2425
+ ] }, m);
2426
+ if (c.type === "imageButton") return /* @__PURE__ */ y(
2249
2427
  "button",
2250
2428
  {
2251
2429
  title: c.tooltip,
@@ -2262,73 +2440,73 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2262
2440
  background: "transparent",
2263
2441
  flexShrink: 0
2264
2442
  },
2265
- onClick: () => r(c, b),
2443
+ onClick: () => r(c, m),
2266
2444
  children: [
2267
2445
  c.src && /* @__PURE__ */ t("img", { src: c.src, alt: c.value || "", style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "50%" } }),
2268
- c.count !== void 0 && /* @__PURE__ */ t(Te, { count: c.count })
2446
+ c.count !== void 0 && /* @__PURE__ */ t(je, { count: c.count })
2269
2447
  ]
2270
2448
  },
2271
- b
2449
+ m
2272
2450
  );
2273
- const S = !!(c.twoState && c.id && d[c.id]), o = !!((k = c.items) != null && k.length), x = {
2451
+ const v = !!(c.twoState && c.id && u[c.id]), l = !!((w = c.items) != null && w.length), x = {
2274
2452
  position: "relative",
2275
- height: p ? 40 : 36,
2453
+ height: d ? 40 : 36,
2276
2454
  gap: 6,
2277
- background: S ? e.primaryLt : "transparent",
2278
- color: S ? e.primary : c.disabled ? e.textMut : e.text,
2455
+ background: v ? e.primaryLt : "transparent",
2456
+ color: v ? e.primary : c.disabled ? e.textMut : e.text,
2279
2457
  opacity: c.disabled ? 0.55 : 1,
2280
2458
  cursor: c.disabled ? "not-allowed" : "pointer",
2281
- ...p ? {
2459
+ ...d ? {
2282
2460
  width: "100%",
2283
2461
  justifyContent: "flex-start",
2284
2462
  padding: "0 16px",
2285
2463
  borderRadius: 0
2286
2464
  } : {}
2287
2465
  };
2288
- return /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
2289
- /* @__PURE__ */ g(
2466
+ return /* @__PURE__ */ y("div", { style: { position: "relative" }, children: [
2467
+ /* @__PURE__ */ y(
2290
2468
  "button",
2291
2469
  {
2292
2470
  className: "dhx dhx-btn dhx-btn-ghost",
2293
2471
  title: c.tooltip,
2294
2472
  disabled: c.disabled,
2295
2473
  style: x,
2296
- onClick: () => r(c, b),
2474
+ onClick: () => r(c, m),
2297
2475
  children: [
2298
2476
  c.icon && /* @__PURE__ */ t("span", { style: { fontSize: 16, flexShrink: 0 }, children: c.icon }),
2299
2477
  c.value && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: c.value }),
2300
- o && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
2301
- c.count !== void 0 && /* @__PURE__ */ t(Te, { count: c.count })
2478
+ l && /* @__PURE__ */ t("span", { style: { fontSize: 9, opacity: 0.55, marginLeft: 2 }, children: "▼" }),
2479
+ c.count !== void 0 && /* @__PURE__ */ t(je, { count: c.count })
2302
2480
  ]
2303
2481
  }
2304
2482
  ),
2305
- o && a === b && /* @__PURE__ */ t(
2306
- fe,
2483
+ l && a === m && /* @__PURE__ */ t(
2484
+ ge,
2307
2485
  {
2308
2486
  items: c.items,
2309
- onSelect: ($) => {
2310
- var L;
2311
- h(null), $.id && ((L = c.onClick) == null || L.call(c, $.id), s == null || s($.id));
2487
+ onSelect: (z) => {
2488
+ var N;
2489
+ h(null), z.id && ((N = c.onClick) == null || N.call(c, z.id), s == null || s(z.id));
2312
2490
  },
2313
- style: p ? { left: "100%", top: 0 } : { top: "100%" }
2491
+ style: d ? { left: "100%", top: 0 } : { top: "100%" }
2314
2492
  }
2315
2493
  )
2316
- ] }, b);
2494
+ ] }, m);
2317
2495
  };
2318
- return /* @__PURE__ */ g(
2496
+ return /* @__PURE__ */ y(
2319
2497
  "nav",
2320
2498
  {
2321
- ref: w,
2499
+ ref: S,
2322
2500
  className: "dhx",
2323
2501
  style: {
2324
2502
  display: "flex",
2325
- flexDirection: p ? "column" : "row",
2326
- alignItems: p ? "stretch" : "center",
2503
+ flexDirection: d ? "column" : "row",
2504
+ alignItems: d ? "stretch" : "center",
2327
2505
  background: e.surface,
2328
- borderBottom: p ? "none" : `1px solid ${e.border}`,
2329
- borderRight: p ? `1px solid ${e.border}` : "none",
2330
- padding: p ? "8px 0" : "0 12px",
2331
- minHeight: p ? void 0 : 48,
2506
+ borderBottom: d ? "none" : `1px solid ${e.border}`,
2507
+ borderRight: d ? `1px solid ${e.border}` : "none",
2508
+ padding: d ? "8px 0" : "0 12px",
2509
+ minHeight: d ? void 0 : 48,
2332
2510
  gap: 2,
2333
2511
  ...f
2334
2512
  },
@@ -2337,48 +2515,48 @@ function Vt({ logo: n, items: i = [], vertical: p = !1, onAction: s, style: f })
2337
2515
  color: e.text,
2338
2516
  fontWeight: 800,
2339
2517
  fontSize: 16,
2340
- padding: p ? "8px 16px 12px" : "0 12px 0 4px",
2341
- borderBottom: p ? `1px solid ${e.border}` : "none",
2342
- borderRight: p ? "none" : `1px solid ${e.border}`,
2343
- marginRight: p ? 0 : 8,
2344
- marginBottom: p ? 4 : 0,
2518
+ padding: d ? "8px 16px 12px" : "0 12px 0 4px",
2519
+ borderBottom: d ? `1px solid ${e.border}` : "none",
2520
+ borderRight: d ? "none" : `1px solid ${e.border}`,
2521
+ marginRight: d ? 0 : 8,
2522
+ marginBottom: d ? 4 : 0,
2345
2523
  flexShrink: 0
2346
2524
  }, children: n }),
2347
- i.map(l)
2525
+ o.map(i)
2348
2526
  ]
2349
2527
  }
2350
2528
  );
2351
2529
  }
2352
2530
  export {
2353
- Mt as Button,
2354
- Rt as Calendar,
2355
- Nt as Chart,
2356
- Et as Colorpicker,
2357
- $e as Combobox,
2358
- Dt as ContextMenu,
2359
- jt as DataView,
2360
- Ft as Form,
2361
- Tt as Grid,
2362
- pt as Layout,
2363
- Pt as List,
2364
- $t as Menu,
2365
- fe as MenuDropdown,
2366
- Re as MessageContext,
2367
- Bt as MessageProvider,
2368
- Vt as Navbar,
2369
- Yt as Pagination,
2370
- Wt as Popup,
2371
- Kt as Ribbon,
2372
- It as Sidebar,
2373
- De as Slider,
2374
- Lt as Tabbar,
2375
- gt as Timepicker,
2376
- Ct as Toolbar,
2377
- Ot as Tree,
2378
- At as Window,
2531
+ Ot as Button,
2532
+ Jt as Calendar,
2533
+ Gt as Chart,
2534
+ Ut as Colorpicker,
2535
+ Ae as Combobox,
2536
+ Kt as ContextMenu,
2537
+ rn as DataView,
2538
+ sn as Form,
2539
+ qt as Grid,
2540
+ zt as Layout,
2541
+ nn as List,
2542
+ Yt as Menu,
2543
+ ge as MenuDropdown,
2544
+ Ye as MessageContext,
2545
+ en as MessageProvider,
2546
+ dn as Navbar,
2547
+ ln as Pagination,
2548
+ Qt as Popup,
2549
+ an as Ribbon,
2550
+ Vt as Sidebar,
2551
+ Be as Slider,
2552
+ Xt as Tabbar,
2553
+ Et as Timepicker,
2554
+ _t as Toolbar,
2555
+ on as Tree,
2556
+ Zt as Window,
2379
2557
  e as tokens,
2380
- he as useClickOutside,
2381
- dt as useDrag,
2382
- Ht as useMessage
2558
+ fe as useClickOutside,
2559
+ St as useDrag,
2560
+ tn as useMessage
2383
2561
  };
2384
2562
  //# sourceMappingURL=dhx-react-suite.js.map