@efficiency-point/design-system 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { cloneElement as r, forwardRef as i, isValidElement as a, useCallback as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
3
- import { createSortedRowModel as f, rowSortingFeature as p, tableFeatures as m, useTable as h } from "@tanstack/react-table";
4
- import { createPortal as g } from "react-dom";
5
- import { create as _ } from "zustand";
6
- var v = {
2
+ import { cloneElement as r, forwardRef as i, isValidElement as a, useCallback as o, useEffect as s, useId as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
3
+ import { createPortal as p } from "react-dom";
4
+ import { createSortedRowModel as m, rowSortingFeature as h, tableFeatures as g, useTable as _ } from "@tanstack/react-table";
5
+ import { create as v } from "zustand";
6
+ var y = {
7
7
  badge: "_badge_1pk53_1",
8
8
  sm: "_sm_1pk53_3",
9
9
  md: "_md_1pk53_5",
@@ -15,36 +15,36 @@ var v = {
15
15
  dot: "_dot_1pk53_17",
16
16
  icon: "_icon_1pk53_19",
17
17
  label: "_label_1pk53_21"
18
- }, y = ({ children: e, variant: r = "neutral", size: i = "md", dot: a = !1, icon: o, className: s = "" }) => /* @__PURE__ */ n("span", {
19
- className: `${v.badge} ${v[r]} ${v[i]} ${s}`,
18
+ }, b = ({ children: e, variant: r = "neutral", size: i = "md", dot: a = !1, icon: o, className: s = "" }) => /* @__PURE__ */ n("span", {
19
+ className: `${y.badge} ${y[r]} ${y[i]} ${s}`,
20
20
  children: [
21
21
  a && /* @__PURE__ */ t("span", {
22
- className: v.dot,
22
+ className: y.dot,
23
23
  "aria-hidden": "true"
24
24
  }),
25
25
  o && /* @__PURE__ */ t("span", {
26
- className: v.icon,
26
+ className: y.icon,
27
27
  "aria-hidden": "true",
28
28
  children: o
29
29
  }),
30
30
  /* @__PURE__ */ t("span", {
31
- className: v.label,
31
+ className: y.label,
32
32
  children: e
33
33
  })
34
34
  ]
35
- }), b = {
35
+ }), x = {
36
36
  loader: "_loader_1tjcf_1",
37
37
  "ds-spin": "_ds-spin_1tjcf_1",
38
38
  primary: "_primary_1tjcf_21",
39
39
  secondary: "_secondary_1tjcf_23",
40
40
  light: "_light_1tjcf_25",
41
41
  danger: "_danger_1tjcf_27"
42
- }, x = ({ variant: e = "primary", label: n = "Загрузка", className: r = "", decorative: i = !1 }) => /* @__PURE__ */ t("span", {
43
- className: `${b.loader} ${b[e]} ${r}`,
42
+ }, S = ({ variant: e = "primary", label: n = "Загрузка", className: r = "", decorative: i = !1 }) => /* @__PURE__ */ t("span", {
43
+ className: `${x.loader} ${x[e]} ${r}`,
44
44
  role: i ? void 0 : "status",
45
45
  "aria-label": i ? void 0 : n,
46
46
  "aria-hidden": i || void 0
47
- }), S = {
47
+ }), C = {
48
48
  button: "_button_1jisp_1",
49
49
  sm: "_sm_1jisp_31",
50
50
  md: "_md_1jisp_33",
@@ -56,20 +56,20 @@ var v = {
56
56
  empty: "_empty_1jisp_57",
57
57
  destructive: "_destructive_1jisp_67",
58
58
  destructiveOutline: "_destructiveOutline_1jisp_69"
59
- }, C = i(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, loadingLabel: a = "Загрузка", disabled: o, type: s = "button", className: c = "", ...l }, u) => /* @__PURE__ */ t("button", {
59
+ }, w = i(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, loadingLabel: a = "Загрузка", disabled: o, type: s = "button", className: c = "", ...l }, u) => /* @__PURE__ */ t("button", {
60
60
  ref: u,
61
- className: `${S.button} ${S[n]} ${S[r]} ${c}`,
61
+ className: `${C.button} ${C[n]} ${C[r]} ${c}`,
62
62
  disabled: o || i,
63
63
  "aria-busy": i || void 0,
64
64
  ...l,
65
65
  type: s,
66
- children: i ? /* @__PURE__ */ t(x, {
66
+ children: i ? /* @__PURE__ */ t(S, {
67
67
  variant: "light",
68
68
  label: a
69
69
  }) : e
70
70
  }));
71
- C.displayName = "DSButton";
72
- var w = {
71
+ w.displayName = "DSButton";
72
+ var T = {
73
73
  label: "_label_1lsqq_1",
74
74
  required: "_required_1lsqq_23",
75
75
  error: "_error_1lsqq_25",
@@ -78,43 +78,43 @@ var w = {
78
78
  disabled: "_disabled_1lsqq_47",
79
79
  message: "_message_1lsqq_55",
80
80
  success: "_success_1lsqq_71"
81
- }, T = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
82
- className: `${w.label} ${a ? w.disabled : ""} ${o}`,
81
+ }, E = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
82
+ className: `${T.label} ${a ? T.disabled : ""} ${o}`,
83
83
  ...s,
84
84
  children: [
85
85
  /* @__PURE__ */ t("span", { children: e }),
86
86
  r && /* @__PURE__ */ t("span", {
87
- className: w.required,
87
+ className: T.required,
88
88
  "aria-hidden": "true",
89
89
  children: "*"
90
90
  }),
91
91
  i && /* @__PURE__ */ t("span", {
92
- className: w.optional,
92
+ className: T.optional,
93
93
  children: i
94
94
  })
95
95
  ]
96
- }), E = ({ children: e, variant: n = "hint", id: r, live: i = !1, className: a = "" }) => /* @__PURE__ */ t("span", {
96
+ }), D = ({ children: e, variant: n = "hint", id: r, live: i = !1, className: a = "" }) => /* @__PURE__ */ t("span", {
97
97
  id: r,
98
- className: `${w.message} ${w[n]} ${a}`,
98
+ className: `${T.message} ${T[n]} ${a}`,
99
99
  role: i && n === "error" ? "alert" : void 0,
100
100
  "aria-live": i && n !== "error" ? "polite" : void 0,
101
101
  children: e
102
- }), D = {
102
+ }), O = {
103
103
  wrapper: "_wrapper_1gq36_1",
104
104
  label: "_label_1gq36_3",
105
105
  input: "_input_1gq36_5",
106
106
  control: "_control_1gq36_7",
107
107
  disabled: "_disabled_1gq36_13",
108
108
  controlError: "_controlError_1gq36_17"
109
- }, O = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: l = !1, readOnly: d = !1, className: f = "", name: p, id: m, indeterminate: h = !1, ...g }) => {
110
- let _ = c(), v = m ?? `ds-checkbox-${p ?? _}`, y = u(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
109
+ }, k = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: l = !1, readOnly: u = !1, className: f = "", name: p, id: m, indeterminate: h = !1, ...g }) => {
110
+ let _ = c(), v = m ?? `ds-checkbox-${p ?? _}`, y = d(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
111
111
  return s(() => {
112
112
  y.current && (y.current.indeterminate = h && !e);
113
113
  }, [e, h]), /* @__PURE__ */ n("div", {
114
- className: `${D.wrapper} ${f}`,
114
+ className: `${O.wrapper} ${f}`,
115
115
  children: [
116
116
  /* @__PURE__ */ n("label", {
117
- className: `${D.label} ${l ? D.disabled : ""}`,
117
+ className: `${O.label} ${l ? O.disabled : ""}`,
118
118
  htmlFor: v,
119
119
  children: [
120
120
  /* @__PURE__ */ t("input", {
@@ -124,53 +124,53 @@ var w = {
124
124
  type: "checkbox",
125
125
  checked: e,
126
126
  disabled: l,
127
- "aria-readonly": d || void 0,
127
+ "aria-readonly": u || void 0,
128
128
  "aria-invalid": !!o,
129
129
  "aria-describedby": [b, x].filter(Boolean).join(" ") || void 0,
130
- className: D.input,
130
+ className: O.input,
131
131
  onChange: (e) => {
132
- d || r?.(e.target.checked, e);
132
+ u || r?.(e.target.checked, e);
133
133
  },
134
134
  ...g
135
135
  }),
136
136
  /* @__PURE__ */ t("span", {
137
- className: `${D.control} ${o ? D.controlError : ""}`,
137
+ className: `${O.control} ${o ? O.controlError : ""}`,
138
138
  "aria-hidden": "true",
139
139
  children: h && !e ? "−" : e ? "✓" : ""
140
140
  }),
141
141
  i && /* @__PURE__ */ t("span", { children: i })
142
142
  ]
143
143
  }),
144
- a && !o && /* @__PURE__ */ t(E, {
144
+ a && !o && /* @__PURE__ */ t(D, {
145
145
  id: b,
146
146
  children: a
147
147
  }),
148
- o && /* @__PURE__ */ t(E, {
148
+ o && /* @__PURE__ */ t(D, {
149
149
  id: x,
150
150
  variant: "error",
151
151
  children: o
152
152
  })
153
153
  ]
154
154
  });
155
- }, k = {
156
- wrapper: "_wrapper_1528c_1",
157
- trigger: "_trigger_1528c_17",
158
- nav: "_nav_1528c_53",
159
- day: "_day_1528c_55",
160
- monthSelect: "_monthSelect_1528c_57",
161
- yearInput: "_yearInput_1528c_59",
162
- timeInput: "_timeInput_1528c_61",
163
- value: "_value_1528c_85",
164
- placeholder: "_placeholder_1528c_93",
165
- error: "_error_1528c_101",
166
- panel: "_panel_1528c_109",
167
- calendarHeader: "_calendarHeader_1528c_135",
168
- weekdays: "_weekdays_1528c_225",
169
- days: "_days_1528c_227",
170
- outside: "_outside_1528c_263",
171
- selected: "_selected_1528c_271",
172
- timeLabel: "_timeLabel_1528c_291"
173
- }, A = [
155
+ }, A = {
156
+ wrapper: "_wrapper_v84a4_1",
157
+ trigger: "_trigger_v84a4_17",
158
+ nav: "_nav_v84a4_53",
159
+ day: "_day_v84a4_55",
160
+ monthSelect: "_monthSelect_v84a4_57",
161
+ yearInput: "_yearInput_v84a4_59",
162
+ timeInput: "_timeInput_v84a4_61",
163
+ value: "_value_v84a4_85",
164
+ placeholder: "_placeholder_v84a4_93",
165
+ error: "_error_v84a4_101",
166
+ panel: "_panel_v84a4_109",
167
+ calendarHeader: "_calendarHeader_v84a4_135",
168
+ weekdays: "_weekdays_v84a4_225",
169
+ days: "_days_v84a4_227",
170
+ outside: "_outside_v84a4_263",
171
+ selected: "_selected_v84a4_271",
172
+ timeLabel: "_timeLabel_v84a4_291"
173
+ }, j = [
174
174
  "Пн",
175
175
  "Вт",
176
176
  "Ср",
@@ -178,7 +178,7 @@ var w = {
178
178
  "Пт",
179
179
  "Сб",
180
180
  "Вс"
181
- ], j = [
181
+ ], M = [
182
182
  "Январь",
183
183
  "Февраль",
184
184
  "Март",
@@ -191,11 +191,11 @@ var w = {
191
191
  "Октябрь",
192
192
  "Ноябрь",
193
193
  "Декабрь"
194
- ], M = (e) => String(e).padStart(2, "0"), N = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), P = (e, t) => {
194
+ ], N = (e) => String(e).padStart(2, "0"), P = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), F = (e, t) => {
195
195
  if (!e) return "";
196
- let n = `${e.getFullYear()}-${M(e.getMonth() + 1)}-${M(e.getDate())}`, r = `${M(e.getHours())}:${M(e.getMinutes())}`;
196
+ let n = `${e.getFullYear()}-${N(e.getMonth() + 1)}-${N(e.getDate())}`, r = `${N(e.getHours())}:${N(e.getMinutes())}`;
197
197
  return t === "date" ? n : t === "time" ? r : `${n}T${r}`;
198
- }, F = (e, t) => {
198
+ }, I = (e, t) => {
199
199
  if (!e) return null;
200
200
  if (t === "time") {
201
201
  let t = /^(\d{2}):(\d{2})$/.exec(e);
@@ -207,172 +207,208 @@ var w = {
207
207
  }
208
208
  let n = new Date(t === "date" ? `${e}T00:00` : e);
209
209
  return Number.isNaN(n.getTime()) ? null : n;
210
- }, I = (e, t) => {
210
+ }, L = (e, t) => {
211
211
  if (!e) return "";
212
- let n = `${M(e.getDate())}.${M(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${M(e.getHours())}:${M(e.getMinutes())}`;
212
+ let n = `${N(e.getDate())}.${N(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${N(e.getHours())}:${N(e.getMinutes())}`;
213
213
  return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
214
- }, L = (e) => {
214
+ }, R = (e) => {
215
215
  let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7, r = new Date(t);
216
216
  return r.setDate(t.getDate() - n), Array.from({ length: 42 }, (e, t) => {
217
217
  let n = new Date(r);
218
218
  return n.setDate(r.getDate() + t), n;
219
219
  });
220
- }, ee = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), te = (e, t, n) => {
221
- let r = N(e).getTime();
222
- return !!(t && r < N(t).getTime() || n && r > N(n).getTime());
223
- }, ne = ({ value: r, onChange: i, mode: a = "date", label: o, placeholder: f, hint: p, error: m, disabled: h = !1, readOnly: g = !1, required: _ = !1, min: v, max: y, id: b, name: x, className: S = "" }) => {
224
- let C = c(), w = b ?? `ds-date-time-${x ?? C}`, D = p ? `${w}-hint` : void 0, O = m ? `${w}-error` : void 0, M = u(null), N = u(null), [ne, R] = d(!1), [z, B] = d(r ?? /* @__PURE__ */ new Date()), [V, H] = d(P(r, "time")), U = l(() => L(z), [z]), re = a !== "time", ie = a !== "date";
220
+ }, ee = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), z = (e, t, n) => {
221
+ let r = P(e).getTime();
222
+ return !!(t && r < P(t).getTime() || n && r > P(n).getTime());
223
+ }, B = 8, te = 6, ne = ({ value: r, onChange: i, mode: a = "date", label: m, placeholder: h, hint: g, error: _, disabled: v = !1, readOnly: y = !1, required: b = !1, min: x, max: S, id: C, name: w, className: T = "" }) => {
224
+ let O = c(), k = C ?? `ds-date-time-${w ?? O}`, N = g ? `${k}-hint` : void 0, P = _ ? `${k}-error` : void 0, ne = d(null), re = d(null), ie = d(null), [V, H] = f(!1), [U, W] = f(r ?? /* @__PURE__ */ new Date()), [G, ae] = f(F(r, "time")), [oe, se] = f(null), ce = u(() => R(U), [U]), le = a !== "time", ue = a !== "date";
225
225
  s(() => {
226
- r && B(r), H(P(r, "time"));
227
- }, [r]), s(() => {
226
+ r && W(r), ae(F(r, "time"));
227
+ }, [r]);
228
+ let K = o(() => {
229
+ let e = re.current, t = ie.current;
230
+ if (!e || !t) return;
231
+ let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - B, o = n.top - B, s = a < r.height && o > a, c = Math.max(120, s ? o : a), l = s ? Math.max(B, n.top - r.height - te) : n.bottom + te, u = n.left, d = i - r.width - B;
232
+ se({
233
+ top: l,
234
+ left: Math.max(B, Math.min(u, d)),
235
+ maxHeight: c
236
+ });
237
+ }, []);
238
+ l(() => {
239
+ if (!V) {
240
+ se(null);
241
+ return;
242
+ }
243
+ return K(), window.addEventListener("resize", K), window.addEventListener("scroll", K, !0), () => {
244
+ window.removeEventListener("resize", K), window.removeEventListener("scroll", K, !0);
245
+ };
246
+ }, [
247
+ V,
248
+ K,
249
+ U,
250
+ G
251
+ ]), s(() => {
252
+ if (!V) return;
228
253
  let e = (e) => {
229
- M.current?.contains(e.target) || R(!1);
254
+ let t = e.target, n = ne.current?.contains(t), r = ie.current?.contains(t);
255
+ !n && !r && H(!1);
230
256
  }, t = (e) => {
231
- e.key === "Escape" && (R(!1), N.current?.focus());
257
+ e.key === "Escape" && (H(!1), re.current?.focus());
232
258
  };
233
- return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
234
- document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
259
+ return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
260
+ document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
235
261
  };
236
- }, []);
237
- let ae = (e) => {
238
- if (te(e, v, y)) return;
262
+ }, [V]);
263
+ let q = (e) => {
264
+ if (z(e, x, S)) return;
239
265
  let t = new Date(e);
240
- t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && R(!1);
241
- }, oe = (e) => {
242
- if (H(e), !e) {
266
+ t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && H(!1);
267
+ }, de = (e) => {
268
+ if (ae(e), !e) {
243
269
  i?.(null);
244
270
  return;
245
271
  }
246
- let t = F(e, "time");
272
+ let t = I(e, "time");
247
273
  if (!t) return;
248
- let n = new Date(a === "datetime" ? r ?? z : /* @__PURE__ */ new Date());
249
- n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(v && n < v || y && n > y) && i?.(n);
250
- }, W = f ?? (a === "date" ? "Выберите дату" : a === "time" ? "Введите время" : "Выберите дату и время"), se = [D, O].filter(Boolean).join(" ") || void 0;
274
+ let n = new Date(a === "datetime" ? r ?? U : /* @__PURE__ */ new Date());
275
+ n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(x && n < x || S && n > S) && i?.(n);
276
+ }, fe = h ?? (a === "date" ? "Выберите дату" : a === "time" ? "Введите время" : "Выберите дату и время"), pe = [N, P].filter(Boolean).join(" ") || void 0, me = V && !y ? /* @__PURE__ */ n("div", {
277
+ ref: ie,
278
+ className: A.panel,
279
+ role: "dialog",
280
+ "aria-label": m ?? fe,
281
+ style: oe ? {
282
+ top: oe.top,
283
+ left: oe.left,
284
+ maxHeight: oe.maxHeight
285
+ } : {
286
+ visibility: "hidden",
287
+ top: 0,
288
+ left: 0
289
+ },
290
+ children: [le && /* @__PURE__ */ n(e, { children: [
291
+ /* @__PURE__ */ n("div", {
292
+ className: A.calendarHeader,
293
+ children: [
294
+ /* @__PURE__ */ t("button", {
295
+ type: "button",
296
+ className: A.nav,
297
+ "aria-label": "Предыдущий месяц",
298
+ onClick: () => W(new Date(U.getFullYear(), U.getMonth() - 1, 1)),
299
+ children: "‹"
300
+ }),
301
+ /* @__PURE__ */ t("select", {
302
+ className: A.monthSelect,
303
+ "aria-label": "Месяц",
304
+ value: U.getMonth(),
305
+ onChange: (e) => W(new Date(U.getFullYear(), Number(e.target.value), 1)),
306
+ children: M.map((e, n) => /* @__PURE__ */ t("option", {
307
+ value: n,
308
+ children: e
309
+ }, e))
310
+ }),
311
+ /* @__PURE__ */ t("input", {
312
+ className: A.yearInput,
313
+ type: "number",
314
+ "aria-label": "Год",
315
+ value: U.getFullYear(),
316
+ onChange: (e) => W(new Date(Number(e.target.value), U.getMonth(), 1))
317
+ }),
318
+ /* @__PURE__ */ t("button", {
319
+ type: "button",
320
+ className: A.nav,
321
+ "aria-label": "Следующий месяц",
322
+ onClick: () => W(new Date(U.getFullYear(), U.getMonth() + 1, 1)),
323
+ children: "›"
324
+ })
325
+ ]
326
+ }),
327
+ /* @__PURE__ */ t("div", {
328
+ className: A.weekdays,
329
+ children: j.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
330
+ }),
331
+ /* @__PURE__ */ t("div", {
332
+ className: A.days,
333
+ children: ce.map((e) => {
334
+ let n = ee(r, e);
335
+ return /* @__PURE__ */ t("button", {
336
+ type: "button",
337
+ className: `${A.day} ${e.getMonth() === U.getMonth() ? "" : A.outside} ${n ? A.selected : ""}`,
338
+ disabled: z(e, x, S),
339
+ "aria-pressed": n,
340
+ onClick: () => q(e),
341
+ children: e.getDate()
342
+ }, e.toISOString());
343
+ })
344
+ })
345
+ ] }), ue && /* @__PURE__ */ n("label", {
346
+ className: A.timeLabel,
347
+ children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
348
+ className: A.timeInput,
349
+ type: "time",
350
+ value: G,
351
+ onChange: (e) => de(e.target.value)
352
+ })]
353
+ })]
354
+ }) : null;
251
355
  return /* @__PURE__ */ n("div", {
252
- ref: M,
253
- className: `${k.wrapper} ${S}`,
356
+ ref: ne,
357
+ className: `${A.wrapper} ${T}`,
254
358
  children: [
255
- o && /* @__PURE__ */ t(T, {
256
- htmlFor: w,
257
- required: _,
258
- disabled: h,
259
- children: o
359
+ m && /* @__PURE__ */ t(E, {
360
+ htmlFor: k,
361
+ required: b,
362
+ disabled: v,
363
+ children: m
260
364
  }),
261
365
  /* @__PURE__ */ n("button", {
262
- ref: N,
263
- id: w,
264
- name: x,
366
+ ref: re,
367
+ id: k,
368
+ name: w,
265
369
  type: "button",
266
- className: `${k.trigger} ${m ? k.error : ""}`,
267
- disabled: h,
268
- "aria-readonly": g || void 0,
269
- "aria-expanded": ne,
370
+ className: `${A.trigger} ${_ ? A.error : ""}`,
371
+ disabled: v,
372
+ "aria-readonly": y || void 0,
373
+ "aria-expanded": V,
270
374
  "aria-haspopup": "dialog",
271
- "aria-describedby": se,
375
+ "aria-describedby": pe,
272
376
  onClick: () => {
273
- g || R((e) => !e);
377
+ y || H((e) => !e);
274
378
  },
275
379
  children: [/* @__PURE__ */ t("span", {
276
- className: r ? k.value : k.placeholder,
277
- children: I(r, a) || W
380
+ className: r ? A.value : A.placeholder,
381
+ children: L(r, a) || fe
278
382
  }), /* @__PURE__ */ t("span", {
279
383
  "aria-hidden": "true",
280
384
  children: "▾"
281
385
  })]
282
386
  }),
283
- ne && !g && /* @__PURE__ */ n("div", {
284
- className: k.panel,
285
- role: "dialog",
286
- "aria-label": o ?? W,
287
- children: [re && /* @__PURE__ */ n(e, { children: [
288
- /* @__PURE__ */ n("div", {
289
- className: k.calendarHeader,
290
- children: [
291
- /* @__PURE__ */ t("button", {
292
- type: "button",
293
- className: k.nav,
294
- "aria-label": "Предыдущий месяц",
295
- onClick: () => B(new Date(z.getFullYear(), z.getMonth() - 1, 1)),
296
- children: "‹"
297
- }),
298
- /* @__PURE__ */ t("select", {
299
- className: k.monthSelect,
300
- "aria-label": "Месяц",
301
- value: z.getMonth(),
302
- onChange: (e) => B(new Date(z.getFullYear(), Number(e.target.value), 1)),
303
- children: j.map((e, n) => /* @__PURE__ */ t("option", {
304
- value: n,
305
- children: e
306
- }, e))
307
- }),
308
- /* @__PURE__ */ t("input", {
309
- className: k.yearInput,
310
- type: "number",
311
- "aria-label": "Год",
312
- value: z.getFullYear(),
313
- onChange: (e) => B(new Date(Number(e.target.value), z.getMonth(), 1))
314
- }),
315
- /* @__PURE__ */ t("button", {
316
- type: "button",
317
- className: k.nav,
318
- "aria-label": "Следующий месяц",
319
- onClick: () => B(new Date(z.getFullYear(), z.getMonth() + 1, 1)),
320
- children: "›"
321
- })
322
- ]
323
- }),
324
- /* @__PURE__ */ t("div", {
325
- className: k.weekdays,
326
- children: A.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
327
- }),
328
- /* @__PURE__ */ t("div", {
329
- className: k.days,
330
- children: U.map((e) => {
331
- let n = ee(r, e);
332
- return /* @__PURE__ */ t("button", {
333
- type: "button",
334
- className: `${k.day} ${e.getMonth() === z.getMonth() ? "" : k.outside} ${n ? k.selected : ""}`,
335
- disabled: te(e, v, y),
336
- "aria-pressed": n,
337
- onClick: () => ae(e),
338
- children: e.getDate()
339
- }, e.toISOString());
340
- })
341
- })
342
- ] }), ie && /* @__PURE__ */ n("label", {
343
- className: k.timeLabel,
344
- children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
345
- className: k.timeInput,
346
- type: "time",
347
- value: V,
348
- onChange: (e) => oe(e.target.value)
349
- })]
350
- })]
351
- }),
352
- p && !m && /* @__PURE__ */ t(E, {
353
- id: D,
354
- children: p
387
+ me && p(me, document.body),
388
+ g && !_ && /* @__PURE__ */ t(D, {
389
+ id: N,
390
+ children: g
355
391
  }),
356
- m && /* @__PURE__ */ t(E, {
357
- id: O,
392
+ _ && /* @__PURE__ */ t(D, {
393
+ id: P,
358
394
  variant: "error",
359
- children: m
395
+ children: _
360
396
  })
361
397
  ]
362
398
  });
363
- }, R = {
399
+ }, re = {
364
400
  root: "_root_1q42e_1",
365
401
  legend: "_legend_1q42e_3",
366
402
  range: "_range_1q42e_5"
367
- }, z = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), B = ({ value: e, onChange: r, onDraftChange: i, mode: a = "date", fromLabel: o = "От", toLabel: s = "До", hint: c, error: l, min: u, max: d, disabled: f = !1, readOnly: p = !1, required: m = !1, className: h = "" }) => {
403
+ }, ie = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), V = ({ value: e, onChange: r, onDraftChange: i, mode: a = "date", fromLabel: o = "От", toLabel: s = "До", hint: c, error: l, min: u, max: d, disabled: f = !1, readOnly: p = !1, required: m = !1, className: h = "" }) => {
368
404
  let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
369
- i?.(e), z(e) && r?.(e);
405
+ i?.(e), ie(e) && r?.(e);
370
406
  };
371
407
  return /* @__PURE__ */ n("fieldset", {
372
- className: `${R.root} ${h}`,
408
+ className: `${re.root} ${h}`,
373
409
  disabled: f,
374
410
  children: [/* @__PURE__ */ n("div", {
375
- className: R.range,
411
+ className: re.range,
376
412
  children: [/* @__PURE__ */ t(ne, {
377
413
  value: e.from,
378
414
  mode: a === "datetime" ? "datetime" : a,
@@ -402,9 +438,9 @@ var w = {
402
438
  to: t
403
439
  })
404
440
  })]
405
- }), c && !g && /* @__PURE__ */ t(E, { children: c })]
441
+ }), c && !g && /* @__PURE__ */ t(D, { children: c })]
406
442
  });
407
- }, V = {
443
+ }, H = {
408
444
  group: "_group_1fs9e_1",
409
445
  skeleton: "_skeleton_1fs9e_3",
410
446
  text: "_text_1fs9e_5",
@@ -412,101 +448,195 @@ var w = {
412
448
  circular: "_circular_1fs9e_9",
413
449
  animated: "_animated_1fs9e_11",
414
450
  "ds-skeleton": "_ds-skeleton_1fs9e_1"
415
- }, H = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
416
- className: `${V.group} ${o}`,
451
+ }, U = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
452
+ className: `${H.group} ${o}`,
417
453
  "aria-hidden": "true",
418
454
  children: Array.from({ length: Math.max(1, i) }, (o, s) => /* @__PURE__ */ t("span", {
419
- className: `${V.skeleton} ${V[e]} ${a ? V.animated : ""}`,
455
+ className: `${H.skeleton} ${H[e]} ${a ? H.animated : ""}`,
420
456
  style: {
421
457
  width: s === i - 1 && i > 1 ? "70%" : n,
422
458
  height: r
423
459
  }
424
460
  }, s))
425
- }), U = {
426
- wrapper: "_wrapper_dkn63_1",
427
- label: "_label_dkn63_17",
428
- container: "_container_dkn63_29",
429
- trigger: "_trigger_dkn63_37",
430
- disabledText: "_disabledText_dkn63_39",
431
- value: "_value_dkn63_109",
432
- placeholder: "_placeholder_dkn63_111",
433
- chevron: "_chevron_dkn63_137",
434
- chevronOpen: "_chevronOpen_dkn63_163",
435
- menu: "_menu_dkn63_171",
436
- option: "_option_dkn63_207",
437
- selected: "_selected_dkn63_245",
438
- message: "_message_dkn63_265",
439
- error: "_error_dkn63_267",
440
- errorState: "_errorState_dkn63_293"
441
- }, re = (e, t, n) => {
461
+ }), W = {
462
+ wrapper: "_wrapper_hotrv_1",
463
+ label: "_label_hotrv_17",
464
+ container: "_container_hotrv_29",
465
+ trigger: "_trigger_hotrv_37",
466
+ disabledText: "_disabledText_hotrv_39",
467
+ value: "_value_hotrv_109",
468
+ placeholder: "_placeholder_hotrv_111",
469
+ chevron: "_chevron_hotrv_137",
470
+ chevronOpen: "_chevronOpen_hotrv_163",
471
+ menu: "_menu_hotrv_171",
472
+ option: "_option_hotrv_201",
473
+ selected: "_selected_hotrv_239",
474
+ message: "_message_hotrv_259",
475
+ error: "_error_hotrv_261",
476
+ errorState: "_errorState_hotrv_287"
477
+ }, G = 8, ae = 6, oe = 120, se = (e, t, n) => {
478
+ if (!e.length) return -1;
442
479
  for (let r = 0; r < e.length; r += 1) {
443
480
  let i = (t + r * n + e.length) % e.length;
444
481
  if (!e[i]?.disabled) return i;
445
482
  }
446
483
  return -1;
447
- }, ie = ({ options: r, value: i, onChange: a, placeholder: o = "Выберите опцию", disabled: f = !1, stringWhileDisabled: p = !1, label: m, error: h, hint: g, className: _ = "", name: v, id: y, needMark: b = !0, maxMenuHeight: x }) => {
448
- let S = c(), C = y ?? `ds-dropdown-${v ?? S}`, [w, T] = d(!1), E = u(null), D = u(null), O = u([]), k = l(() => r.find((e) => e.value === i), [r, i]), A = g ? `${C}-hint` : void 0, j = h ? `${C}-error` : void 0, M = [A, j].filter(Boolean).join(" ") || void 0, N = f && p;
449
- s(() => {
484
+ }, ce = (e) => {
485
+ if (typeof e == "number") return e;
486
+ if (typeof e == "string") {
487
+ let t = Number.parseFloat(e);
488
+ if (Number.isFinite(t)) return t;
489
+ }
490
+ return Infinity;
491
+ }, le = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опцию", disabled: m = !1, stringWhileDisabled: h = !1, label: g, error: _, hint: v, className: y = "", name: b, id: x, needMark: S = !0, maxMenuHeight: C }) => {
492
+ let w = c(), T = x ?? `ds-dropdown-${b ?? w}`, E = `${T}-listbox`, [D, O] = f(!1), [k, A] = f(null), j = d(null), M = d(null), N = d(null), P = d([]), F = u(() => e.find((e) => e.value === r), [e, r]), I = v ? `${T}-hint` : void 0, L = _ ? `${T}-error` : void 0, R = [I, L].filter(Boolean).join(" ") || void 0, ee = m && h, z = o(() => {
493
+ let e = M.current, t = N.current;
494
+ if (!e || !t) return;
495
+ let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - G, o = n.top - G, s = a < r.height && o > a, c = Math.max(oe, s ? o : a), l = ce(C), u = Math.min(c, l), d = n.left, f = i - n.width - G, p = Math.max(G, Math.min(d, f)), m = s ? Math.max(G, n.top - r.height - ae) : n.bottom + ae;
496
+ A({
497
+ top: m,
498
+ left: p,
499
+ width: n.width,
500
+ maxHeight: u
501
+ });
502
+ }, [C]);
503
+ l(() => {
504
+ if (!D) {
505
+ A(null);
506
+ return;
507
+ }
508
+ return z(), window.addEventListener("resize", z), window.addEventListener("scroll", z, !0), () => {
509
+ window.removeEventListener("resize", z), window.removeEventListener("scroll", z, !0);
510
+ };
511
+ }, [
512
+ D,
513
+ z,
514
+ e.length
515
+ ]), s(() => {
516
+ if (!D) return;
450
517
  let e = (e) => {
451
- E.current?.contains(e.target) || T(!1);
518
+ let t = e.target, n = j.current?.contains(t), r = N.current?.contains(t);
519
+ !n && !r && O(!1);
452
520
  }, t = (e) => {
453
- e.key === "Escape" && w && (T(!1), D.current?.focus());
521
+ e.key === "Escape" && (O(!1), M.current?.focus());
454
522
  };
455
- return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
456
- document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
523
+ return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
524
+ document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
457
525
  };
458
- }, [w]);
459
- let P = (e, t) => {
460
- let n = re(r, e, t);
461
- O.current[n]?.focus(), O.current[n]?.scrollIntoView({ block: "nearest" });
462
- }, F = (e) => {
463
- e.disabled || (a?.(e.value, e), T(!1), D.current?.focus());
464
- };
526
+ }, [D]);
527
+ let B = (t, n) => {
528
+ let r = se(e, t, n);
529
+ if (r === -1) return;
530
+ let i = P.current[r];
531
+ i?.focus(), i?.scrollIntoView({ block: "nearest" });
532
+ }, te = (e) => {
533
+ e.disabled || (i?.(e.value, e), O(!1), M.current?.focus());
534
+ }, ne = D ? /* @__PURE__ */ t("ul", {
535
+ ref: N,
536
+ id: E,
537
+ className: W.menu,
538
+ role: "listbox",
539
+ "aria-label": g,
540
+ style: k ? {
541
+ position: "fixed",
542
+ top: k.top,
543
+ left: k.left,
544
+ width: k.width,
545
+ maxHeight: k.maxHeight
546
+ } : {
547
+ position: "fixed",
548
+ top: 0,
549
+ left: 0,
550
+ visibility: "hidden",
551
+ maxHeight: 0
552
+ },
553
+ children: e.map((i, a) => {
554
+ let o = i.value === r;
555
+ return /* @__PURE__ */ t("li", {
556
+ role: "presentation",
557
+ children: /* @__PURE__ */ n("button", {
558
+ ref: (e) => {
559
+ P.current[a] = e;
560
+ },
561
+ type: "button",
562
+ role: "option",
563
+ "aria-selected": o,
564
+ disabled: i.disabled,
565
+ className: [W.option, o ? W.selected : ""].filter(Boolean).join(" "),
566
+ onClick: () => te(i),
567
+ onKeyDown: (t) => {
568
+ if (t.key === "ArrowDown" || t.key === "ArrowUp") {
569
+ t.preventDefault();
570
+ let e = t.key === "ArrowDown" ? 1 : -1;
571
+ B(a + e, e);
572
+ }
573
+ if (t.key === "Tab" && O(!1), t.key === "Home" || t.key === "End") {
574
+ t.preventDefault();
575
+ let n = t.key === "Home" ? 1 : -1;
576
+ B(t.key === "Home" ? 0 : e.length - 1, n);
577
+ }
578
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), te(i));
579
+ },
580
+ children: [/* @__PURE__ */ t("span", { children: i.label }), o && S && /* @__PURE__ */ t("span", {
581
+ "aria-hidden": "true",
582
+ children: "✓"
583
+ })]
584
+ })
585
+ }, i.value);
586
+ })
587
+ }) : null;
465
588
  return /* @__PURE__ */ n("div", {
466
- ref: E,
589
+ ref: j,
467
590
  className: [
468
- U.wrapper,
469
- h ? U.errorState : "",
470
- _
591
+ W.wrapper,
592
+ _ ? W.errorState : "",
593
+ y
471
594
  ].filter(Boolean).join(" "),
472
595
  children: [
473
- m && /* @__PURE__ */ t("label", {
474
- htmlFor: N ? void 0 : C,
475
- className: U.label,
476
- children: m
596
+ g && /* @__PURE__ */ t("label", {
597
+ htmlFor: ee ? void 0 : T,
598
+ className: W.label,
599
+ children: g
477
600
  }),
478
601
  /* @__PURE__ */ t("div", {
479
- className: U.container,
480
- children: N ? /* @__PURE__ */ t("div", {
481
- id: C,
482
- className: U.disabledText,
483
- "aria-describedby": M,
484
- children: k?.label ?? o
485
- }) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("button", {
486
- ref: D,
487
- id: C,
602
+ className: W.container,
603
+ children: ee ? /* @__PURE__ */ t("div", {
604
+ id: T,
605
+ className: W.disabledText,
606
+ "aria-describedby": R,
607
+ children: F?.label ?? a
608
+ }) : /* @__PURE__ */ n("button", {
609
+ ref: M,
610
+ id: T,
488
611
  type: "button",
489
- name: v,
490
- className: U.trigger,
491
- disabled: f,
612
+ name: b,
613
+ className: W.trigger,
614
+ disabled: m,
492
615
  "aria-haspopup": "listbox",
493
- "aria-expanded": w,
494
- "aria-controls": `${C}-listbox`,
495
- "aria-describedby": M,
496
- "aria-invalid": !!h,
497
- onClick: () => T((e) => !e),
498
- onKeyDown: (e) => {
499
- if (e.key === "ArrowDown" || e.key === "ArrowUp") {
500
- e.preventDefault(), T(!0);
501
- let t = e.key === "ArrowDown" ? 1 : -1;
502
- requestAnimationFrame(() => P(e.key === "ArrowDown" ? 0 : r.length - 1, t));
616
+ "aria-expanded": D,
617
+ "aria-controls": E,
618
+ "aria-describedby": R,
619
+ "aria-invalid": !!_,
620
+ onClick: () => O((e) => !e),
621
+ onKeyDown: (t) => {
622
+ if (t.key === "ArrowDown" || t.key === "ArrowUp") {
623
+ t.preventDefault(), O(!0);
624
+ let n = t.key === "ArrowDown" ? 1 : -1;
625
+ requestAnimationFrame(() => {
626
+ B(t.key === "ArrowDown" ? 0 : e.length - 1, n);
627
+ });
628
+ }
629
+ if (t.key === "Enter" && D) {
630
+ t.preventDefault();
631
+ let n = e.findIndex((e) => e.value === r);
632
+ B(n >= 0 ? n : 0, 1);
503
633
  }
504
634
  },
505
635
  children: [/* @__PURE__ */ t("span", {
506
- className: k ? U.value : U.placeholder,
507
- children: k?.label ?? o
636
+ className: F ? W.value : W.placeholder,
637
+ children: F?.label ?? a
508
638
  }), /* @__PURE__ */ t("span", {
509
- className: `${U.chevron} ${w ? U.chevronOpen : ""}`,
639
+ className: [W.chevron, D ? W.chevronOpen : ""].filter(Boolean).join(" "),
510
640
  "aria-hidden": "true",
511
641
  children: /* @__PURE__ */ t("svg", {
512
642
  viewBox: "0 0 20 20",
@@ -520,73 +650,40 @@ var w = {
520
650
  })
521
651
  })
522
652
  })]
523
- }), w && /* @__PURE__ */ t("ul", {
524
- id: `${C}-listbox`,
525
- className: U.menu,
526
- role: "listbox",
527
- "aria-label": m,
528
- style: { maxHeight: x },
529
- children: r.map((e, a) => {
530
- let o = e.value === i;
531
- return /* @__PURE__ */ t("li", {
532
- role: "presentation",
533
- children: /* @__PURE__ */ n("button", {
534
- ref: (e) => {
535
- O.current[a] = e;
536
- },
537
- type: "button",
538
- role: "option",
539
- "aria-selected": o,
540
- disabled: e.disabled,
541
- className: `${U.option} ${o ? U.selected : ""}`,
542
- onClick: () => F(e),
543
- onKeyDown: (e) => {
544
- if ((e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), P(a + (e.key === "ArrowDown" ? 1 : -1), e.key === "ArrowDown" ? 1 : -1)), e.key === "Tab" && T(!1), e.key === "Home" || e.key === "End") {
545
- e.preventDefault();
546
- let t = e.key === "Home" ? 1 : -1;
547
- P(e.key === "Home" ? 0 : r.length - 1, t);
548
- }
549
- },
550
- children: [/* @__PURE__ */ t("span", { children: e.label }), o && b && /* @__PURE__ */ t("span", {
551
- "aria-hidden": "true",
552
- children: "✓"
553
- })]
554
- })
555
- }, e.value);
556
- })
557
- })] })
653
+ })
558
654
  }),
559
- g && !h && /* @__PURE__ */ t("span", {
560
- id: A,
561
- className: U.message,
562
- children: g
655
+ D && p(ne, document.body),
656
+ v && !_ && /* @__PURE__ */ t("span", {
657
+ id: I,
658
+ className: W.message,
659
+ children: v
563
660
  }),
564
- h && /* @__PURE__ */ t("span", {
565
- id: j,
566
- className: U.error,
567
- children: h
661
+ _ && /* @__PURE__ */ t("span", {
662
+ id: L,
663
+ className: W.error,
664
+ children: _
568
665
  })
569
666
  ]
570
667
  });
571
- }, ae = (e) => `${e.id}:${e.direction}`, oe = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
668
+ }, ue = (e) => `${e.id}:${e.direction}`, K = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
572
669
  let c = e.flatMap((e) => [{
573
- value: ae({
670
+ value: ue({
574
671
  id: e.id,
575
672
  direction: "asc"
576
673
  }),
577
674
  label: e.ascLabel ?? `${e.label} · по возрастанию`,
578
675
  disabled: e.disabled
579
676
  }, {
580
- value: ae({
677
+ value: ue({
581
678
  id: e.id,
582
679
  direction: "desc"
583
680
  }),
584
681
  label: e.descLabel ?? `${e.label} · по убыванию`,
585
682
  disabled: e.disabled
586
683
  }]);
587
- return /* @__PURE__ */ t(ie, {
684
+ return /* @__PURE__ */ t(le, {
588
685
  options: c,
589
- value: n ? ae(n) : "",
686
+ value: n ? ue(n) : "",
590
687
  label: i,
591
688
  placeholder: a,
592
689
  disabled: o,
@@ -599,7 +696,7 @@ var w = {
599
696
  });
600
697
  }
601
698
  });
602
- }, W = {
699
+ }, q = {
603
700
  root: "_root_epm0h_1",
604
701
  tableWrap: "_tableWrap_epm0h_3",
605
702
  table: "_table_epm0h_3",
@@ -614,10 +711,10 @@ var w = {
614
711
  default: "_default_epm0h_47",
615
712
  tableOnMobile: "_tableOnMobile_epm0h_47",
616
713
  wide: "_wide_epm0h_51"
617
- }, se = m({
618
- rowSortingFeature: p,
619
- sortedRowModel: f()
620
- }), ce = (e, t) => {
714
+ }, de = g({
715
+ rowSortingFeature: h,
716
+ sortedRowModel: m()
717
+ }), fe = (e, t) => {
621
718
  let n = /* @__PURE__ */ new Set();
622
719
  for (let t of e) {
623
720
  if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
@@ -629,36 +726,36 @@ var w = {
629
726
  for (let t of e) if (typeof t.accessor == "string" && !(t.accessor in r)) return `В строке ${n + 1} отсутствует колонка «${t.id}»`;
630
727
  }
631
728
  return null;
632
- }, le = (e, t) => typeof e == "function" ? e(t) : t[e], ue = (e) => {
729
+ }, pe = (e, t) => typeof e == "function" ? e(t) : t[e], me = (e) => {
633
730
  if (e == null || e === "") return null;
634
731
  let t = Date.parse(String(e));
635
732
  return Number.isNaN(t) ? null : t;
636
- }, de = (e, t, n) => {
637
- let r = ue(e.getValue(n)), i = ue(t.getValue(n));
733
+ }, he = (e, t, n) => {
734
+ let r = me(e.getValue(n)), i = me(t.getValue(n));
638
735
  return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
639
- }, fe = (e, t, n) => {
736
+ }, ge = (e, t, n) => {
640
737
  let r = e.getValue(n), i = t.getValue(n);
641
738
  return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(r) - Number(i);
642
- }, pe = (e, t, n) => {
739
+ }, _e = (e, t, n) => {
643
740
  let r = e.getValue(n), i = t.getValue(n);
644
741
  return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(!!r) - Number(!!i);
645
- }, me = (e, t, n) => {
742
+ }, ve = (e, t, n) => {
646
743
  let r = String(e.getValue(n) ?? ""), i = String(t.getValue(n) ?? "");
647
744
  return r.localeCompare(i, void 0, {
648
745
  numeric: !0,
649
746
  sensitivity: "base"
650
747
  });
651
- }, he = (e) => {
748
+ }, ye = (e) => {
652
749
  switch (e) {
653
- case "date": return de;
654
- case "number": return fe;
655
- case "boolean": return pe;
750
+ case "date": return he;
751
+ case "number": return ge;
752
+ case "boolean": return _e;
656
753
  case "text":
657
- case void 0: return me;
754
+ case void 0: return ve;
658
755
  case "custom": return;
659
756
  }
660
- }, ge = (e) => {
661
- let t = (t) => le(e.accessor, t), n = e.sortFn ?? he(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
757
+ }, be = (e) => {
758
+ let t = (t) => pe(e.accessor, t), n = e.sortFn ?? ye(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
662
759
  id: e.id,
663
760
  accessorFn: t,
664
761
  header: () => e.header,
@@ -670,9 +767,9 @@ var w = {
670
767
  sortDescFirst: e.sortDescFirst
671
768
  };
672
769
  return n !== void 0 && (i.sortFn = n), i;
673
- }, _e = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: s, renderMobileCard: c, getRowId: u, caption: f, ariaLabel: p, loading: m = !1, error: g, emptyState: _ = "Нет данных", stickyHeader: v = !1, maxHeight: y, className: b = "", onRowClick: x }) => {
674
- let [S, C] = d([]), w = o ?? S, T = l(() => ce(e, r), [e, r]), E = l(() => e.map(ge), [e]), D = h({
675
- features: se,
770
+ }, xe = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: s, renderMobileCard: c, getRowId: l, caption: d, ariaLabel: p, loading: m = !1, error: h, emptyState: g = "Нет данных", stickyHeader: v = !1, maxHeight: y, className: b = "", onRowClick: x }) => {
771
+ let [S, C] = f([]), w = o ?? S, T = u(() => fe(e, r), [e, r]), E = u(() => e.map(be), [e]), D = _({
772
+ features: de,
676
773
  columns: E,
677
774
  data: r,
678
775
  state: { sorting: w },
@@ -680,22 +777,22 @@ var w = {
680
777
  let t = typeof e == "function" ? e(w) : e;
681
778
  o === void 0 && C(t), s?.(t);
682
779
  },
683
- getRowId: u
780
+ getRowId: l
684
781
  }), O = D.getRowModel().rows, k = e.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
685
782
  id: e.id,
686
783
  label: typeof e.header == "string" ? e.header : e.id
687
784
  })), A = [
688
- W.root,
689
- a === "wide" ? W.wide : W.default,
690
- i ? W.tableOnMobile : "",
785
+ q.root,
786
+ a === "wide" ? q.wide : q.default,
787
+ i ? q.tableOnMobile : "",
691
788
  b
692
- ].filter(Boolean).join(" "), j = T ?? g;
789
+ ].filter(Boolean).join(" "), j = T ?? h;
693
790
  return /* @__PURE__ */ n("section", {
694
791
  className: A,
695
792
  "aria-busy": m,
696
793
  children: [
697
- !i && !m && !j && O.length > 0 && k.length > 0 && /* @__PURE__ */ t(oe, {
698
- className: W.mobileSort,
794
+ !i && !m && !j && O.length > 0 && k.length > 0 && /* @__PURE__ */ t(K, {
795
+ className: q.mobileSort,
699
796
  options: k,
700
797
  value: w[0] ? {
701
798
  id: w[0].id,
@@ -707,15 +804,15 @@ var w = {
707
804
  }])
708
805
  }),
709
806
  /* @__PURE__ */ t("div", {
710
- className: W.tableWrap,
807
+ className: q.tableWrap,
711
808
  style: { maxHeight: y },
712
809
  children: /* @__PURE__ */ n("table", {
713
- className: W.table,
810
+ className: q.table,
714
811
  "aria-label": p,
715
812
  children: [
716
- f && /* @__PURE__ */ t("caption", { children: f }),
813
+ d && /* @__PURE__ */ t("caption", { children: d }),
717
814
  /* @__PURE__ */ t("thead", {
718
- className: v ? W.sticky : "",
815
+ className: v ? q.sticky : "",
719
816
  children: D.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
720
817
  let r = e.column.getIsSorted(), i = e.column.getCanSort(), a = e.column.getToggleSortingHandler();
721
818
  return /* @__PURE__ */ t("th", {
@@ -723,7 +820,7 @@ var w = {
723
820
  "aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : "none",
724
821
  children: /* @__PURE__ */ n("button", {
725
822
  type: "button",
726
- className: W.sortButton,
823
+ className: q.sortButton,
727
824
  disabled: !i,
728
825
  onClick: a,
729
826
  children: [/* @__PURE__ */ t(D.FlexRender, { header: e }), /* @__PURE__ */ t("span", {
@@ -736,17 +833,17 @@ var w = {
736
833
  }),
737
834
  /* @__PURE__ */ t("tbody", { children: m ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
738
835
  colSpan: e.length,
739
- children: /* @__PURE__ */ t(H, { lines: 3 })
836
+ children: /* @__PURE__ */ t(U, { lines: 3 })
740
837
  }) }) : j ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
741
- className: W.state,
838
+ className: q.state,
742
839
  colSpan: e.length,
743
840
  children: j
744
841
  }) }) : O.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
745
- className: W.state,
842
+ className: q.state,
746
843
  colSpan: e.length,
747
- children: _
844
+ children: g
748
845
  }) }) : O.map((e) => /* @__PURE__ */ t("tr", {
749
- className: x ? W.clickableRow : void 0,
846
+ className: x ? q.clickableRow : void 0,
750
847
  onClick: () => x?.(e.original),
751
848
  onKeyDown: (t) => {
752
849
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), x?.(e.original));
@@ -759,15 +856,15 @@ var w = {
759
856
  })
760
857
  }),
761
858
  !i && /* @__PURE__ */ t("div", {
762
- className: W.cards,
859
+ className: q.cards,
763
860
  role: "list",
764
- "aria-label": p ?? f,
765
- children: m ? /* @__PURE__ */ t(H, { lines: 4 }) : j ? /* @__PURE__ */ t("div", {
766
- className: W.state,
861
+ "aria-label": p ?? d,
862
+ children: m ? /* @__PURE__ */ t(U, { lines: 4 }) : j ? /* @__PURE__ */ t("div", {
863
+ className: q.state,
767
864
  children: j
768
865
  }) : O.length === 0 ? /* @__PURE__ */ t("div", {
769
- className: W.state,
770
- children: _
866
+ className: q.state,
867
+ children: g
771
868
  }) : O.map((r) => {
772
869
  if (c) return /* @__PURE__ */ t("div", {
773
870
  role: "listitem",
@@ -776,14 +873,14 @@ var w = {
776
873
  columns: e
777
874
  })
778
875
  }, r.id);
779
- let i = e.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), a = i.find((e) => e.mobile?.primary) ?? i.find((e) => e.mobile?.mobileVariant !== "actions"), o = (e) => le(e.accessor, r.original), s = (e) => e.mobile?.renderMobile?.(r.original, o(e)) ?? e.cell?.(r.original, o(e)) ?? String(o(e) ?? "");
876
+ let i = e.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), a = i.find((e) => e.mobile?.primary) ?? i.find((e) => e.mobile?.mobileVariant !== "actions"), o = (e) => pe(e.accessor, r.original), s = (e) => e.mobile?.renderMobile?.(r.original, o(e)) ?? e.cell?.(r.original, o(e)) ?? String(o(e) ?? "");
780
877
  return /* @__PURE__ */ n("article", {
781
878
  role: "listitem",
782
- className: W.card,
879
+ className: q.card,
783
880
  children: [
784
881
  /* @__PURE__ */ t("h3", { children: a ? s(a) : `Строка ${r.index + 1}` }),
785
882
  /* @__PURE__ */ t("dl", { children: i.filter((e) => e !== a && e.mobile?.mobileVariant !== "actions").map((e) => /* @__PURE__ */ n("div", {
786
- className: e.mobile?.mobileSpan === 2 ? W.spanTwo : "",
883
+ className: e.mobile?.mobileSpan === 2 ? q.spanTwo : "",
787
884
  children: [/* @__PURE__ */ t("dt", { children: e.mobile?.mobileLabel ?? e.header }), /* @__PURE__ */ t("dd", { children: s(e) })]
788
885
  }, e.id)) }),
789
886
  i.filter((e) => e.mobile?.mobileVariant === "actions").map((e) => /* @__PURE__ */ t("footer", { children: s(e) }, e.id))
@@ -793,8 +890,8 @@ var w = {
793
890
  })
794
891
  ]
795
892
  });
796
- }, ve = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: o = !1, label: f, error: p, hint: m, className: h = "", name: g, id: _, closeOnSelect: v = !1, maxMenuHeight: y }) => {
797
- let b = c(), x = _ ?? `ds-dropdown-multiple-${g ?? b}`, [S, C] = d(!1), w = u(null), T = u(null), E = u([]), D = l(() => e.filter((e) => r.includes(e.value)), [e, r]), O = D.map((e) => e.label).join(", "), k = m ? `${x}-hint` : void 0, A = p ? `${x}-error` : void 0;
893
+ }, Se = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: o = !1, label: l, error: p, hint: m, className: h = "", name: g, id: _, closeOnSelect: v = !1, maxMenuHeight: y }) => {
894
+ let b = c(), x = _ ?? `ds-dropdown-multiple-${g ?? b}`, [S, C] = f(!1), w = d(null), T = d(null), E = d([]), D = u(() => e.filter((e) => r.includes(e.value)), [e, r]), O = D.map((e) => e.label).join(", "), k = m ? `${x}-hint` : void 0, A = p ? `${x}-error` : void 0;
798
895
  s(() => {
799
896
  let e = (e) => {
800
897
  w.current?.contains(e.target) || C(!1);
@@ -810,30 +907,30 @@ var w = {
810
907
  let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
811
908
  i?.(n, e.filter((e) => n.includes(e.value))), v && (C(!1), T.current?.focus());
812
909
  }, M = (t, n) => {
813
- let r = re(e, t, n);
910
+ let r = se(e, t, n);
814
911
  E.current[r]?.focus(), E.current[r]?.scrollIntoView({ block: "nearest" });
815
912
  };
816
913
  return /* @__PURE__ */ n("div", {
817
914
  ref: w,
818
915
  className: [
819
- U.wrapper,
820
- p ? U.errorState : "",
916
+ W.wrapper,
917
+ p ? W.errorState : "",
821
918
  h
822
919
  ].filter(Boolean).join(" "),
823
920
  children: [
824
- f && /* @__PURE__ */ t("label", {
921
+ l && /* @__PURE__ */ t("label", {
825
922
  htmlFor: x,
826
- className: U.label,
827
- children: f
923
+ className: W.label,
924
+ children: l
828
925
  }),
829
926
  /* @__PURE__ */ n("div", {
830
- className: U.container,
927
+ className: W.container,
831
928
  children: [/* @__PURE__ */ n("button", {
832
929
  ref: T,
833
930
  id: x,
834
931
  type: "button",
835
932
  name: g,
836
- className: U.trigger,
933
+ className: W.trigger,
837
934
  disabled: o,
838
935
  "aria-haspopup": "listbox",
839
936
  "aria-expanded": S,
@@ -849,18 +946,18 @@ var w = {
849
946
  }
850
947
  },
851
948
  children: [/* @__PURE__ */ t("span", {
852
- className: D.length ? U.value : U.placeholder,
949
+ className: D.length ? W.value : W.placeholder,
853
950
  children: O || a
854
951
  }), /* @__PURE__ */ t("span", {
855
- className: `${U.chevron} ${S ? U.chevronOpen : ""}`,
952
+ className: `${W.chevron} ${S ? W.chevronOpen : ""}`,
856
953
  "aria-hidden": "true",
857
954
  children: "⌄"
858
955
  })]
859
956
  }), S && /* @__PURE__ */ t("ul", {
860
957
  id: `${x}-listbox`,
861
- className: U.menu,
958
+ className: W.menu,
862
959
  role: "listbox",
863
- "aria-label": f,
960
+ "aria-label": l,
864
961
  "aria-multiselectable": "true",
865
962
  style: { maxHeight: y },
866
963
  children: e.map((i, a) => {
@@ -875,7 +972,7 @@ var w = {
875
972
  role: "option",
876
973
  "aria-selected": o,
877
974
  disabled: i.disabled,
878
- className: `${U.option} ${o ? U.selected : ""}`,
975
+ className: `${W.option} ${o ? W.selected : ""}`,
879
976
  onClick: () => j(i),
880
977
  onKeyDown: (t) => {
881
978
  if (t.key === "ArrowDown" || t.key === "ArrowUp") {
@@ -901,17 +998,17 @@ var w = {
901
998
  }),
902
999
  m && !p && /* @__PURE__ */ t("span", {
903
1000
  id: k,
904
- className: U.message,
1001
+ className: W.message,
905
1002
  children: m
906
1003
  }),
907
1004
  p && /* @__PURE__ */ t("span", {
908
1005
  id: A,
909
- className: U.error,
1006
+ className: W.error,
910
1007
  children: p
911
1008
  })
912
1009
  ]
913
1010
  });
914
- }, ye = {
1011
+ }, Ce = {
915
1012
  approve: "M4 12l5 5L20 6",
916
1013
  reject: "M5 5l14 14M19 5L5 19",
917
1014
  edit: "M4 20h4L19 9l-4-4L4 16v4z",
@@ -920,7 +1017,7 @@ var w = {
920
1017
  basket: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3",
921
1018
  info: "M12 10v7m0-10v.01",
922
1019
  warning: "M12 4L3 20h18L12 4zm0 5v5m0 3v.01"
923
- }, be = ({ name: e, title: r, width: i = 24, height: a = 24, ...o }) => /* @__PURE__ */ n("svg", {
1020
+ }, we = ({ name: e, title: r, width: i = 24, height: a = 24, ...o }) => /* @__PURE__ */ n("svg", {
924
1021
  viewBox: "0 0 24 24",
925
1022
  width: i,
926
1023
  height: a,
@@ -933,27 +1030,27 @@ var w = {
933
1030
  "aria-hidden": !r || void 0,
934
1031
  focusable: "false",
935
1032
  ...o,
936
- children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: ye[e] })]
937
- }), G = {
1033
+ children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: Ce[e] })]
1034
+ }), Te = {
938
1035
  root: "_root_1y2s8_1",
939
1036
  header: "_header_1y2s8_21",
940
1037
  title: "_title_1y2s8_41",
941
1038
  dismiss: "_dismiss_1y2s8_55",
942
1039
  content: "_content_1y2s8_113"
943
- }, xe = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
1040
+ }, Ee = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
944
1041
  let u = `ds-info-block-${c()}`;
945
1042
  return /* @__PURE__ */ n("section", {
946
- className: `${G.root} ${l}`,
1043
+ className: `${Te.root} ${l}`,
947
1044
  "aria-labelledby": u,
948
1045
  children: [/* @__PURE__ */ n("header", {
949
- className: G.header,
1046
+ className: Te.header,
950
1047
  children: [/* @__PURE__ */ t(s, {
951
1048
  id: u,
952
- className: G.title,
1049
+ className: Te.title,
953
1050
  children: e
954
1051
  }), i && /* @__PURE__ */ t("button", {
955
1052
  type: "button",
956
- className: G.dismiss,
1053
+ className: Te.dismiss,
957
1054
  onClick: a,
958
1055
  "aria-label": o,
959
1056
  children: /* @__PURE__ */ t("svg", {
@@ -969,43 +1066,43 @@ var w = {
969
1066
  })
970
1067
  })]
971
1068
  }), /* @__PURE__ */ t("div", {
972
- className: G.content,
1069
+ className: Te.content,
973
1070
  children: r
974
1071
  })]
975
1072
  });
976
- }, K = {
1073
+ }, J = {
977
1074
  wrapper: "_wrapper_ip6vf_1",
978
1075
  control: "_control_ip6vf_3",
979
1076
  input: "_input_ip6vf_5",
980
1077
  disabledText: "_disabledText_ip6vf_5",
981
1078
  inputError: "_inputError_ip6vf_39",
982
1079
  trailingAction: "_trailingAction_ip6vf_41"
983
- }, Se = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: l = !1, stringWhileDisabled: f = !1, label: p, error: m, hint: h, className: g = "", name: _, id: v, clearable: y = !0, required: b = !1, selectTextOnFocus: x = !1, isPassword: S = !1, passwordVisibleLabel: C = "Скрыть пароль", passwordHiddenLabel: w = "Показать пароль", onFocus: D, ...O }) => {
984
- let k = c(), A = v ?? `ds-input-${_ ?? k}`, j = u(null), [M, N] = d(!1), P = h ? `${A}-hint` : void 0, F = m ? `${A}-error` : void 0, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, ee = S ? M ? "text" : "password" : i;
1080
+ }, De = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: l = !1, stringWhileDisabled: u = !1, label: p, error: m, hint: h, className: g = "", name: _, id: v, clearable: y = !0, required: b = !1, selectTextOnFocus: x = !1, isPassword: S = !1, passwordVisibleLabel: C = "Скрыть пароль", passwordHiddenLabel: w = "Показать пароль", onFocus: T, ...O }) => {
1081
+ let k = c(), A = v ?? `ds-input-${_ ?? k}`, j = d(null), [M, N] = f(!1), P = h ? `${A}-hint` : void 0, F = m ? `${A}-error` : void 0, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, R = S ? M ? "text" : "password" : i;
985
1082
  return s(() => {
986
1083
  S || N(!1);
987
1084
  }, [S]), /* @__PURE__ */ n("div", {
988
- className: `${K.wrapper} ${g}`,
1085
+ className: `${J.wrapper} ${g}`,
989
1086
  children: [
990
- p && /* @__PURE__ */ t(T, {
1087
+ p && /* @__PURE__ */ t(E, {
991
1088
  htmlFor: A,
992
1089
  required: b,
993
1090
  disabled: o,
994
1091
  children: p
995
1092
  }),
996
- o && f ? /* @__PURE__ */ t("div", {
1093
+ o && u ? /* @__PURE__ */ t("div", {
997
1094
  id: A,
998
- className: K.disabledText,
1095
+ className: J.disabledText,
999
1096
  "aria-describedby": L,
1000
1097
  children: I || a
1001
1098
  }) : /* @__PURE__ */ n("div", {
1002
- className: K.control,
1099
+ className: J.control,
1003
1100
  children: [
1004
1101
  /* @__PURE__ */ t("input", {
1005
1102
  ref: j,
1006
1103
  id: A,
1007
1104
  name: _,
1008
- type: ee,
1105
+ type: R,
1009
1106
  value: I,
1010
1107
  placeholder: a,
1011
1108
  disabled: o,
@@ -1013,7 +1110,7 @@ var w = {
1013
1110
  required: b,
1014
1111
  "aria-invalid": !!m,
1015
1112
  "aria-describedby": L,
1016
- className: `${K.input} ${m ? K.inputError : ""}`,
1113
+ className: `${J.input} ${m ? J.inputError : ""}`,
1017
1114
  onChange: (e) => {
1018
1115
  if (i === "number" && !S) {
1019
1116
  let t = e.target.value === "" ? "" : Number(e.target.value);
@@ -1023,13 +1120,13 @@ var w = {
1023
1120
  r?.(e.target.value, e);
1024
1121
  },
1025
1122
  onFocus: (e) => {
1026
- x && e.currentTarget.value && e.currentTarget.select(), D?.(e);
1123
+ x && e.currentTarget.value && e.currentTarget.select(), T?.(e);
1027
1124
  },
1028
1125
  ...O
1029
1126
  }),
1030
1127
  S && /* @__PURE__ */ t("button", {
1031
1128
  type: "button",
1032
- className: K.trailingAction,
1129
+ className: J.trailingAction,
1033
1130
  disabled: o,
1034
1131
  "aria-label": M ? C : w,
1035
1132
  "aria-pressed": M,
@@ -1050,7 +1147,7 @@ var w = {
1050
1147
  }),
1051
1148
  !S && y && I && !o && !l && /* @__PURE__ */ t("button", {
1052
1149
  type: "button",
1053
- className: K.trailingAction,
1150
+ className: J.trailingAction,
1054
1151
  "aria-label": "Очистить поле",
1055
1152
  onClick: () => {
1056
1153
  let e = j.current;
@@ -1060,33 +1157,33 @@ var w = {
1060
1157
  })
1061
1158
  ]
1062
1159
  }),
1063
- h && !m && /* @__PURE__ */ t(E, {
1160
+ h && !m && /* @__PURE__ */ t(D, {
1064
1161
  id: P,
1065
1162
  children: h
1066
1163
  }),
1067
- m && /* @__PURE__ */ t(E, {
1164
+ m && /* @__PURE__ */ t(D, {
1068
1165
  id: F,
1069
1166
  variant: "error",
1070
1167
  children: m
1071
1168
  })
1072
1169
  ]
1073
1170
  });
1074
- }, q = {
1171
+ }, Oe = {
1075
1172
  wrapper: "_wrapper_vu1ob_1",
1076
1173
  input: "_input_vu1ob_21",
1077
1174
  switch: "_switch_vu1ob_35",
1078
1175
  thumb: "_thumb_vu1ob_67",
1079
1176
  label: "_label_vu1ob_111",
1080
1177
  disabled: "_disabled_vu1ob_123"
1081
- }, Ce = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: l, id: u, value: d }) => {
1178
+ }, ke = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: l, id: u, value: d }) => {
1082
1179
  let f = c(), p = u ?? `ds-radio-button-${l ?? f}`;
1083
1180
  return /* @__PURE__ */ n("label", {
1084
1181
  htmlFor: p,
1085
- className: `${q.wrapper} ${a ? q.disabled : ""} ${s}`,
1182
+ className: `${Oe.wrapper} ${a ? Oe.disabled : ""} ${s}`,
1086
1183
  children: [
1087
1184
  /* @__PURE__ */ t("input", {
1088
1185
  id: p,
1089
- className: q.input,
1186
+ className: Oe.input,
1090
1187
  type: "checkbox",
1091
1188
  role: "switch",
1092
1189
  name: l,
@@ -1099,21 +1196,21 @@ var w = {
1099
1196
  }
1100
1197
  }),
1101
1198
  /* @__PURE__ */ t("span", {
1102
- className: q.switch,
1199
+ className: Oe.switch,
1103
1200
  "aria-hidden": "true",
1104
- children: /* @__PURE__ */ t("span", { className: q.thumb })
1201
+ children: /* @__PURE__ */ t("span", { className: Oe.thumb })
1105
1202
  }),
1106
1203
  i && /* @__PURE__ */ t("span", {
1107
- className: q.label,
1204
+ className: Oe.label,
1108
1205
  children: i
1109
1206
  })
1110
1207
  ]
1111
1208
  });
1112
- }, we = {
1209
+ }, Ae = {
1113
1210
  root: "_root_kepgo_1",
1114
1211
  grid: "_grid_kepgo_3",
1115
1212
  actions: "_actions_kepgo_5"
1116
- }, Te = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
1213
+ }, je = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
1117
1214
  let d = (e, t) => {
1118
1215
  let n = {
1119
1216
  ...r,
@@ -1122,11 +1219,11 @@ var w = {
1122
1219
  i?.(n, e), s === "instant" && a?.(n);
1123
1220
  };
1124
1221
  return /* @__PURE__ */ n("section", {
1125
- className: `${we.root} ${u}`,
1222
+ className: `${Ae.root} ${u}`,
1126
1223
  "aria-label": "Фильтры",
1127
1224
  "aria-busy": c,
1128
1225
  children: [/* @__PURE__ */ t("div", {
1129
- className: we.grid,
1226
+ className: Ae.grid,
1130
1227
  children: e.filter((e) => !e.hidden).map((e) => {
1131
1228
  let n = l || c || e.disabled, i = r[e.id];
1132
1229
  if (e.type === "input") {
@@ -1136,19 +1233,19 @@ var w = {
1136
1233
  placeholder: e.placeholder,
1137
1234
  disabled: n
1138
1235
  };
1139
- return e.inputType === "number" ? /* @__PURE__ */ t(Se, {
1236
+ return e.inputType === "number" ? /* @__PURE__ */ t(De, {
1140
1237
  ...r,
1141
1238
  type: "number",
1142
1239
  value: i ?? "",
1143
1240
  onChange: (t) => d(e.id, t)
1144
- }, e.id) : /* @__PURE__ */ t(Se, {
1241
+ }, e.id) : /* @__PURE__ */ t(De, {
1145
1242
  ...r,
1146
1243
  type: "text",
1147
1244
  value: String(i ?? ""),
1148
1245
  onChange: (t) => d(e.id, t)
1149
1246
  }, e.id);
1150
1247
  }
1151
- if (e.type === "dropdown") return /* @__PURE__ */ t(ie, {
1248
+ if (e.type === "dropdown") return /* @__PURE__ */ t(le, {
1152
1249
  label: e.label,
1153
1250
  hint: e.hint,
1154
1251
  placeholder: e.placeholder,
@@ -1157,7 +1254,7 @@ var w = {
1157
1254
  disabled: n,
1158
1255
  onChange: (t) => d(e.id, t)
1159
1256
  }, e.id);
1160
- if (e.type === "multiple") return /* @__PURE__ */ t(ve, {
1257
+ if (e.type === "multiple") return /* @__PURE__ */ t(Se, {
1161
1258
  label: e.label,
1162
1259
  hint: e.hint,
1163
1260
  placeholder: e.placeholder,
@@ -1166,14 +1263,14 @@ var w = {
1166
1263
  disabled: n,
1167
1264
  onChange: (t) => d(e.id, t)
1168
1265
  }, e.id);
1169
- if (e.type === "checkbox") return /* @__PURE__ */ t(O, {
1266
+ if (e.type === "checkbox") return /* @__PURE__ */ t(k, {
1170
1267
  label: e.label,
1171
1268
  hint: e.hint,
1172
1269
  checked: !!i,
1173
1270
  disabled: n,
1174
1271
  onChange: (t) => d(e.id, t)
1175
1272
  }, e.id);
1176
- if (e.type === "radio") return /* @__PURE__ */ t(Ce, {
1273
+ if (e.type === "radio") return /* @__PURE__ */ t(ke, {
1177
1274
  label: e.label,
1178
1275
  checked: !!i,
1179
1276
  disabled: n,
@@ -1183,7 +1280,7 @@ var w = {
1183
1280
  from: null,
1184
1281
  to: null
1185
1282
  };
1186
- return /* @__PURE__ */ t(B, {
1283
+ return /* @__PURE__ */ t(V, {
1187
1284
  hint: e.hint,
1188
1285
  mode: e.mode,
1189
1286
  min: e.min,
@@ -1194,13 +1291,13 @@ var w = {
1194
1291
  }, e.id);
1195
1292
  })
1196
1293
  }), (o || s === "manual") && /* @__PURE__ */ n("div", {
1197
- className: we.actions,
1198
- children: [o && /* @__PURE__ */ t(C, {
1294
+ className: Ae.actions,
1295
+ children: [o && /* @__PURE__ */ t(w, {
1199
1296
  variant: "destructiveOutline",
1200
1297
  disabled: l || c,
1201
1298
  onClick: o,
1202
1299
  children: "Сбросить"
1203
- }), s === "manual" && /* @__PURE__ */ t(C, {
1300
+ }), s === "manual" && /* @__PURE__ */ t(w, {
1204
1301
  isLoading: c,
1205
1302
  disabled: l,
1206
1303
  onClick: () => a?.(r),
@@ -1208,7 +1305,7 @@ var w = {
1208
1305
  })]
1209
1306
  })]
1210
1307
  });
1211
- }, J = {
1308
+ }, Y = {
1212
1309
  wrapper: "_wrapper_1ymdr_1",
1213
1310
  dropzone: "_dropzone_1ymdr_3",
1214
1311
  dragActive: "_dragActive_1ymdr_5",
@@ -1222,31 +1319,31 @@ var w = {
1222
1319
  file: "_file_1ymdr_19",
1223
1320
  fileName: "_fileName_1ymdr_23",
1224
1321
  fileSize: "_fileSize_1ymdr_25"
1225
- }, Ee = (e) => `${e.name}:${e.size}:${e.lastModified}`, De = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, Oe = (e, t) => !t || t.split(",").map((e) => e.trim().toLowerCase()).some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type.toLowerCase() === t), ke = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: l, label: f, hint: p, error: m, required: h = !1, disabled: g = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: w = "Добавить ещё", onReject: D }) => {
1226
- let O = c(), k = y ?? `ds-file-input-${v ?? O}`, A = u(null), j = u(0), [M, N] = d(!1), P = p ? `${k}-hint` : void 0, F = m ? `${k}-error` : void 0, I = [P, F].filter(Boolean).join(" ") || void 0, L = !g && !_, ee = (e) => {
1227
- let t = [], n = new Set(r.map(Ee)), c = e.filter((e) => Oe(e, o) ? s !== void 0 && e.size > s ? (t.push({
1322
+ }, Me = (e) => `${e.name}:${e.size}:${e.lastModified}`, Ne = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, Pe = (e, t) => !t || t.split(",").map((e) => e.trim().toLowerCase()).some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type.toLowerCase() === t), Fe = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: l, label: u, hint: p, error: m, required: h = !1, disabled: g = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: C = "Добавить ещё", onReject: T }) => {
1323
+ let O = c(), k = y ?? `ds-file-input-${v ?? O}`, A = d(null), j = d(0), [M, N] = f(!1), P = p ? `${k}-hint` : void 0, F = m ? `${k}-error` : void 0, I = [P, F].filter(Boolean).join(" ") || void 0, L = !g && !_, R = (e) => {
1324
+ let t = [], n = new Set(r.map(Me)), c = e.filter((e) => Pe(e, o) ? s !== void 0 && e.size > s ? (t.push({
1228
1325
  file: e,
1229
1326
  reason: "maxSize"
1230
- }), !1) : !n.has(Ee(e)) && (n.add(Ee(e)), !0) : (t.push({
1327
+ }), !1) : !n.has(Me(e)) && (n.add(Me(e)), !0) : (t.push({
1231
1328
  file: e,
1232
1329
  reason: "accept"
1233
1330
  }), !1)), u = a ? l : 1, d = a ? [...r, ...c] : c.slice(-1);
1234
1331
  u !== void 0 && d.length > u && (d.slice(u).forEach((e) => t.push({
1235
1332
  file: e,
1236
1333
  reason: "maxFiles"
1237
- })), d = d.slice(0, u)), t.length && D?.(t), c.length && i?.(d), A.current && (A.current.value = "");
1334
+ })), d = d.slice(0, u)), t.length && T?.(t), c.length && i?.(d), A.current && (A.current.value = "");
1238
1335
  };
1239
1336
  return /* @__PURE__ */ n("div", {
1240
- className: `${J.wrapper} ${b}`,
1337
+ className: `${Y.wrapper} ${b}`,
1241
1338
  children: [
1242
- f && /* @__PURE__ */ t(T, {
1339
+ u && /* @__PURE__ */ t(E, {
1243
1340
  htmlFor: k,
1244
1341
  required: h,
1245
1342
  disabled: g,
1246
- children: f
1343
+ children: u
1247
1344
  }),
1248
1345
  /* @__PURE__ */ n("div", {
1249
- className: `${J.dropzone} ${M ? J.dragActive : ""} ${g ? J.disabled : ""} ${m ? J.error : ""}`,
1346
+ className: `${Y.dropzone} ${M ? Y.dragActive : ""} ${g ? Y.disabled : ""} ${m ? Y.error : ""}`,
1250
1347
  onDragEnter: (e) => {
1251
1348
  e.preventDefault(), L && ++j.current === 1 && N(!0);
1252
1349
  },
@@ -1255,13 +1352,13 @@ var w = {
1255
1352
  e.preventDefault(), --j.current <= 0 && (j.current = 0, N(!1));
1256
1353
  },
1257
1354
  onDrop: (e) => {
1258
- e.preventDefault(), j.current = 0, N(!1), L && ee(Array.from(e.dataTransfer.files));
1355
+ e.preventDefault(), j.current = 0, N(!1), L && R(Array.from(e.dataTransfer.files));
1259
1356
  },
1260
1357
  children: [/* @__PURE__ */ t("input", {
1261
1358
  ref: A,
1262
1359
  id: k,
1263
1360
  name: v,
1264
- className: J.nativeInput,
1361
+ className: Y.nativeInput,
1265
1362
  type: "file",
1266
1363
  multiple: a,
1267
1364
  accept: o,
@@ -1269,24 +1366,24 @@ var w = {
1269
1366
  disabled: !L,
1270
1367
  "aria-describedby": I,
1271
1368
  "aria-invalid": !!m,
1272
- onChange: (e) => ee(Array.from(e.target.files ?? []))
1369
+ onChange: (e) => R(Array.from(e.target.files ?? []))
1273
1370
  }), r.length ? /* @__PURE__ */ n(e, { children: [
1274
1371
  /* @__PURE__ */ t("ul", {
1275
- className: J.files,
1372
+ className: Y.files,
1276
1373
  "aria-live": "polite",
1277
1374
  children: r.map((e, a) => /* @__PURE__ */ n("li", {
1278
- className: J.file,
1375
+ className: Y.file,
1279
1376
  children: [
1280
1377
  /* @__PURE__ */ t("span", {
1281
- className: J.fileName,
1378
+ className: Y.fileName,
1282
1379
  title: e.name,
1283
1380
  children: e.name
1284
1381
  }),
1285
1382
  /* @__PURE__ */ t("span", {
1286
- className: J.fileSize,
1287
- children: De(e.size)
1383
+ className: Y.fileSize,
1384
+ children: Ne(e.size)
1288
1385
  }),
1289
- L && /* @__PURE__ */ t(C, {
1386
+ L && /* @__PURE__ */ t(w, {
1290
1387
  variant: "empty",
1291
1388
  size: "sm",
1292
1389
  "aria-label": `Удалить файл ${e.name}`,
@@ -1294,42 +1391,42 @@ var w = {
1294
1391
  children: "×"
1295
1392
  })
1296
1393
  ]
1297
- }, Ee(e)))
1394
+ }, Me(e)))
1298
1395
  }),
1299
- L && (a || r.length === 0) && /* @__PURE__ */ t(C, {
1300
- className: J.browseButton,
1396
+ L && (a || r.length === 0) && /* @__PURE__ */ t(w, {
1397
+ className: Y.browseButton,
1301
1398
  size: "sm",
1302
1399
  onClick: () => A.current?.click(),
1303
- children: w
1400
+ children: C
1304
1401
  }),
1305
- L && !a && /* @__PURE__ */ t(C, {
1306
- className: J.browseButton,
1402
+ L && !a && /* @__PURE__ */ t(w, {
1403
+ className: Y.browseButton,
1307
1404
  size: "sm",
1308
1405
  onClick: () => A.current?.click(),
1309
1406
  children: S
1310
1407
  })
1311
1408
  ] }) : /* @__PURE__ */ n("div", {
1312
- className: J.empty,
1409
+ className: Y.empty,
1313
1410
  children: [
1314
1411
  /* @__PURE__ */ t("span", {
1315
- className: J.uploadIcon,
1412
+ className: Y.uploadIcon,
1316
1413
  "aria-hidden": "true",
1317
1414
  children: "↑"
1318
1415
  }),
1319
1416
  /* @__PURE__ */ t("strong", { children: M ? "Отпустите файлы здесь" : x }),
1320
- !M && L && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(C, {
1321
- className: J.browseButton,
1417
+ !M && L && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(w, {
1418
+ className: Y.browseButton,
1322
1419
  onClick: () => A.current?.click(),
1323
1420
  children: S
1324
1421
  })] })
1325
1422
  ]
1326
1423
  })]
1327
1424
  }),
1328
- p && !m && /* @__PURE__ */ t(E, {
1425
+ p && !m && /* @__PURE__ */ t(D, {
1329
1426
  id: P,
1330
1427
  children: p
1331
1428
  }),
1332
- m && /* @__PURE__ */ t(E, {
1429
+ m && /* @__PURE__ */ t(D, {
1333
1430
  id: F,
1334
1431
  variant: "error",
1335
1432
  live: !0,
@@ -1337,11 +1434,11 @@ var w = {
1337
1434
  })
1338
1435
  ]
1339
1436
  });
1340
- }, Ae = 0, Y = _((e) => ({
1437
+ }, Ie = 0, X = v((e) => ({
1341
1438
  modals: [],
1342
1439
  openModal: (t, n = {}, r = {}) => {
1343
- Ae += 1;
1344
- let i = `ds-modal-${Ae}`;
1440
+ Ie += 1;
1441
+ let i = `ds-modal-${Ie}`;
1345
1442
  return e((e) => ({ modals: [...e.modals, {
1346
1443
  id: i,
1347
1444
  name: t,
@@ -1353,7 +1450,7 @@ var w = {
1353
1450
  closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
1354
1451
  closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
1355
1452
  closeAllModals: () => e({ modals: [] })
1356
- })), je = () => Y.setState({ modals: [] }), X = {
1453
+ })), Le = () => X.setState({ modals: [] }), Z = {
1357
1454
  layer: "_layer_1nb2z_1",
1358
1455
  backdrop: "_backdrop_1nb2z_3",
1359
1456
  panel: "_panel_1nb2z_5",
@@ -1361,22 +1458,22 @@ var w = {
1361
1458
  title: "_title_1nb2z_11",
1362
1459
  description: "_description_1nb2z_13",
1363
1460
  content: "_content_1nb2z_15"
1364
- }, Me = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", Ne = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: d = "dialog" }) => {
1365
- let f = c(), p = c(), m = u(null), h = Y((e) => e.closeModal);
1461
+ }, Re = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", ze = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: u = "dialog" }) => {
1462
+ let f = c(), p = c(), m = d(null), h = X((e) => e.closeModal);
1366
1463
  return s(() => {
1367
1464
  let e = document.activeElement, t = m.current;
1368
- return (t?.querySelector(Me) ?? t)?.focus(), () => e?.focus();
1465
+ return (t?.querySelector(Re) ?? t)?.focus(), () => e?.focus();
1369
1466
  }, []), /* @__PURE__ */ n("div", {
1370
1467
  ref: m,
1371
- className: `${X.panel} ${l}`,
1372
- role: d,
1468
+ className: `${Z.panel} ${l}`,
1469
+ role: u,
1373
1470
  "aria-modal": "true",
1374
1471
  "aria-labelledby": r ? f : void 0,
1375
1472
  "aria-describedby": i ? p : void 0,
1376
1473
  tabIndex: -1,
1377
1474
  onKeyDown: (e) => {
1378
1475
  if (e.key !== "Tab") return;
1379
- let t = Array.from(m.current?.querySelectorAll(Me) ?? []);
1476
+ let t = Array.from(m.current?.querySelectorAll(Re) ?? []);
1380
1477
  if (!t.length) {
1381
1478
  e.preventDefault();
1382
1479
  return;
@@ -1386,12 +1483,12 @@ var w = {
1386
1483
  },
1387
1484
  children: [
1388
1485
  (r || o) && /* @__PURE__ */ n("header", {
1389
- className: X.header,
1486
+ className: Z.header,
1390
1487
  children: [r && /* @__PURE__ */ t("h2", {
1391
1488
  id: f,
1392
- className: X.title,
1489
+ className: Z.title,
1393
1490
  children: r
1394
- }), /* @__PURE__ */ t(C, {
1491
+ }), /* @__PURE__ */ t(w, {
1395
1492
  variant: "empty",
1396
1493
  size: "sm",
1397
1494
  "aria-label": o,
@@ -1412,31 +1509,31 @@ var w = {
1412
1509
  }),
1413
1510
  i && /* @__PURE__ */ t("p", {
1414
1511
  id: p,
1415
- className: X.description,
1512
+ className: Z.description,
1416
1513
  children: i
1417
1514
  }),
1418
1515
  /* @__PURE__ */ t("div", {
1419
- className: X.content,
1516
+ className: Z.content,
1420
1517
  children: e
1421
1518
  })
1422
1519
  ]
1423
1520
  });
1424
- }, Pe = ({ registry: e }) => {
1425
- let n = Y((e) => e.modals), r = Y((e) => e.closeModal), i = Y((e) => e.closeAllModals);
1521
+ }, Be = ({ registry: e }) => {
1522
+ let n = X((e) => e.modals), r = X((e) => e.closeModal), i = X((e) => e.closeAllModals);
1426
1523
  return s(() => {
1427
1524
  let e = (e) => {
1428
1525
  if (e.key !== "Escape") return;
1429
- let t = Y.getState().modals.at(-1);
1526
+ let t = X.getState().modals.at(-1);
1430
1527
  t?.closeOnEscape && r(t.id);
1431
1528
  };
1432
1529
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1433
- }, [r]), !n.length || typeof document > "u" ? null : g(/* @__PURE__ */ t("div", {
1434
- className: X.layer,
1530
+ }, [r]), !n.length || typeof document > "u" ? null : p(/* @__PURE__ */ t("div", {
1531
+ className: Z.layer,
1435
1532
  "aria-label": "Модальные окна",
1436
1533
  children: n.map((a, o) => {
1437
1534
  let s = e[a.name];
1438
1535
  return s ? /* @__PURE__ */ t("div", {
1439
- className: X.backdrop,
1536
+ className: Z.backdrop,
1440
1537
  "aria-hidden": o !== n.length - 1 || void 0,
1441
1538
  onMouseDown: (e) => {
1442
1539
  e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
@@ -1450,91 +1547,91 @@ var w = {
1450
1547
  }, a.id) : null;
1451
1548
  })
1452
1549
  }), document.body);
1453
- }, Fe = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
1454
- let o = Y((e) => e.modals.length);
1550
+ }, Ve = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
1551
+ let o = X((e) => e.modals.length);
1455
1552
  return s(() => {
1456
1553
  if (!a || o === 0) return;
1457
1554
  let e = document.body.style.overflow;
1458
1555
  return document.body.style.overflow = "hidden", () => {
1459
1556
  document.body.style.overflow = e;
1460
1557
  };
1461
- }, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(Pe, { registry: r })] });
1462
- }, Ie = (e) => e, Le = {
1558
+ }, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(Be, { registry: r })] });
1559
+ }, He = (e) => e, Ue = {
1463
1560
  message: "_message_1vtru_1",
1464
1561
  actions: "_actions_1vtru_3"
1465
- }, Re = /* @__PURE__ */ new Map(), ze = 0, Be = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
1562
+ }, We = /* @__PURE__ */ new Map(), Ge = 0, Ke = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
1466
1563
  let u = (e) => {
1467
- Re.get(l)?.(e), Re.delete(l), r();
1564
+ We.get(l)?.(e), We.delete(l), r();
1468
1565
  };
1469
- return /* @__PURE__ */ n(Ne, {
1566
+ return /* @__PURE__ */ n(ze, {
1470
1567
  modalId: e,
1471
1568
  title: i,
1472
1569
  role: "alertdialog",
1473
1570
  children: [/* @__PURE__ */ t("p", {
1474
- className: Le.message,
1571
+ className: Ue.message,
1475
1572
  children: a
1476
1573
  }), /* @__PURE__ */ n("div", {
1477
- className: Le.actions,
1478
- children: [/* @__PURE__ */ t(C, {
1574
+ className: Ue.actions,
1575
+ children: [/* @__PURE__ */ t(w, {
1479
1576
  variant: "outline",
1480
1577
  onClick: () => u(!1),
1481
1578
  children: s
1482
- }), /* @__PURE__ */ t(C, {
1579
+ }), /* @__PURE__ */ t(w, {
1483
1580
  variant: c === "danger" ? "destructive" : "primary",
1484
1581
  onClick: () => u(!0),
1485
1582
  children: o
1486
1583
  })]
1487
1584
  })]
1488
1585
  });
1489
- }, Ve = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(Ne, {
1586
+ }, qe = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(ze, {
1490
1587
  modalId: e,
1491
1588
  title: i,
1492
1589
  role: "alertdialog",
1493
1590
  children: [/* @__PURE__ */ t("p", {
1494
- className: Le.message,
1591
+ className: Ue.message,
1495
1592
  children: a
1496
1593
  }), /* @__PURE__ */ t("div", {
1497
- className: Le.actions,
1498
- children: /* @__PURE__ */ t(C, {
1594
+ className: Ue.actions,
1595
+ children: /* @__PURE__ */ t(w, {
1499
1596
  onClick: r,
1500
1597
  children: o
1501
1598
  })
1502
1599
  })]
1503
- }), He = Ie({
1504
- ConfirmModal: Be,
1505
- ErrorModal: Ve
1506
- }), Ue = () => {
1507
- let e = Y((e) => e.openModal);
1600
+ }), Je = He({
1601
+ ConfirmModal: Ke,
1602
+ ErrorModal: qe
1603
+ }), Ye = () => {
1604
+ let e = X((e) => e.openModal);
1508
1605
  return (t = {}) => new Promise((n) => {
1509
- ze += 1;
1510
- let r = `confirm-${ze}`;
1511
- Re.set(r, n), e("ConfirmModal", {
1606
+ Ge += 1;
1607
+ let r = `confirm-${Ge}`;
1608
+ We.set(r, n), e("ConfirmModal", {
1512
1609
  ...t,
1513
1610
  requestId: r
1514
1611
  }, { closeOnEscape: !1 });
1515
1612
  });
1516
- }, We = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Ge = () => {
1517
- let e = Y((e) => e.openModal);
1613
+ }, Xe = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Ze = () => {
1614
+ let e = X((e) => e.openModal);
1518
1615
  return { showError: (t, n) => e("ErrorModal", {
1519
1616
  title: n,
1520
- message: We(t)
1617
+ message: Xe(t)
1521
1618
  }) };
1522
- }, Ke = _(() => ({})), qe = _(() => ({})), Je = () => {
1523
- let e = Y((e) => e.modals), t = Y((e) => e.openModal);
1619
+ }, Qe = v(() => ({})), $e = v(() => ({})), et = () => {
1620
+ let e = X((e) => e.modals), t = X((e) => e.openModal);
1524
1621
  return {
1525
1622
  openModal: (e, n = {}, r) => t(e, n, r),
1526
- closeModal: Y((e) => e.closeModal),
1527
- closeTopModal: Y((e) => e.closeTopModal),
1528
- closeAllModals: Y((e) => e.closeAllModals),
1623
+ closeModal: X((e) => e.closeModal),
1624
+ closeTopModal: X((e) => e.closeTopModal),
1625
+ closeAllModals: X((e) => e.closeAllModals),
1529
1626
  isOpen: (t) => e.some((e) => e.name === t),
1530
1627
  count: e.length
1531
1628
  };
1532
- }, Ye = { root: "_root_1x7h7_1" }, Xe = ({ label: e = "Загрузка страницы", className: r = "" }) => /* @__PURE__ */ n("div", {
1533
- className: `${Ye.root} ${r}`,
1629
+ }, tt = { root: "_root_1x7h7_1" }, nt = ({ label: e = "Загрузка страницы", className: r = "" }) => /* @__PURE__ */ n("div", {
1630
+ className: `${tt.root} ${r}`,
1534
1631
  role: "status",
1535
1632
  "aria-label": e,
1536
- children: [/* @__PURE__ */ t(x, { decorative: !0 }), /* @__PURE__ */ t("span", { children: e })]
1537
- }), Ze = {
1633
+ children: [/* @__PURE__ */ t(S, { decorative: !0 }), /* @__PURE__ */ t("span", { children: e })]
1634
+ }), rt = {
1538
1635
  viewport: "_viewport_15mi5_1",
1539
1636
  "top-right": "_top-right_15mi5_3",
1540
1637
  "top-left": "_top-left_15mi5_5",
@@ -1547,7 +1644,7 @@ var w = {
1547
1644
  success: "_success_15mi5_19",
1548
1645
  warning: "_warning_15mi5_21",
1549
1646
  error: "_error_15mi5_23"
1550
- }, Qe = (e) => {
1647
+ }, it = (e) => {
1551
1648
  let r;
1552
1649
  return r = e === "info" ? /* @__PURE__ */ n("svg", {
1553
1650
  xmlns: "http://www.w3.org/2000/svg",
@@ -1633,8 +1730,8 @@ var w = {
1633
1730
  /* @__PURE__ */ t("path", { d: "m9 9 6 6" })
1634
1731
  ]
1635
1732
  }), r;
1636
- }, $e = ({ toast: e, onClose: r }) => {
1637
- let [i, a] = d(!1), o = u(e.duration), c = u(Date.now());
1733
+ }, at = ({ toast: e, onClose: r }) => {
1734
+ let [i, a] = f(!1), o = d(e.duration), c = d(Date.now());
1638
1735
  return s(() => {
1639
1736
  if (i || e.duration <= 0) return;
1640
1737
  c.current = Date.now();
@@ -1648,7 +1745,7 @@ var w = {
1648
1745
  e.duration,
1649
1746
  e.id
1650
1747
  ]), /* @__PURE__ */ n("article", {
1651
- className: `${Ze.toast} ${Ze[e.variant]}`,
1748
+ className: `${rt.toast} ${rt[e.variant]}`,
1652
1749
  role: e.variant === "error" ? "alert" : "status",
1653
1750
  "aria-live": e.variant === "error" ? "assertive" : "polite",
1654
1751
  onMouseEnter: () => a(!0),
@@ -1656,13 +1753,13 @@ var w = {
1656
1753
  onFocus: () => a(!0),
1657
1754
  onBlur: () => a(!1),
1658
1755
  children: [
1659
- /* @__PURE__ */ t("div", { children: Qe(e.variant) }),
1756
+ /* @__PURE__ */ t("div", { children: it(e.variant) }),
1660
1757
  /* @__PURE__ */ n("div", {
1661
- className: Ze.body,
1758
+ className: rt.body,
1662
1759
  children: [
1663
1760
  e.title && /* @__PURE__ */ t("strong", { children: e.title }),
1664
1761
  /* @__PURE__ */ t("div", { children: e.message }),
1665
- e.action && /* @__PURE__ */ t(C, {
1762
+ e.action && /* @__PURE__ */ t(w, {
1666
1763
  variant: "empty",
1667
1764
  size: "sm",
1668
1765
  onClick: () => {
@@ -1672,7 +1769,7 @@ var w = {
1672
1769
  })
1673
1770
  ]
1674
1771
  }),
1675
- e.closable && /* @__PURE__ */ t(C, {
1772
+ e.closable && /* @__PURE__ */ t(w, {
1676
1773
  variant: "empty",
1677
1774
  size: "sm",
1678
1775
  "aria-label": "Закрыть уведомление",
@@ -1692,11 +1789,11 @@ var w = {
1692
1789
  })
1693
1790
  ]
1694
1791
  });
1695
- }, et = 0, Z = _((e) => ({
1792
+ }, ot = 0, Q = v((e) => ({
1696
1793
  toasts: [],
1697
1794
  showToast: (t) => {
1698
- et += 1;
1699
- let n = `ds-toast-${et}`;
1795
+ ot += 1;
1796
+ let n = `ds-toast-${ot}`;
1700
1797
  return e((e) => ({ toasts: [...e.toasts, {
1701
1798
  variant: "info",
1702
1799
  duration: 5e3,
@@ -1707,18 +1804,18 @@ var w = {
1707
1804
  },
1708
1805
  removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
1709
1806
  clearToasts: () => e({ toasts: [] })
1710
- })), tt = () => Z.setState({ toasts: [] }), nt = ({ position: e = "top-right" }) => {
1711
- let n = Z((e) => e.toasts), r = Z((e) => e.removeToast);
1807
+ })), st = () => Q.setState({ toasts: [] }), ct = ({ position: e = "top-right" }) => {
1808
+ let n = Q((e) => e.toasts), r = Q((e) => e.removeToast);
1712
1809
  return /* @__PURE__ */ t("div", {
1713
- className: `${Ze.viewport} ${Ze[e]}`,
1810
+ className: `${rt.viewport} ${rt[e]}`,
1714
1811
  "aria-label": "Уведомления",
1715
- children: n.map((e) => /* @__PURE__ */ t($e, {
1812
+ children: n.map((e) => /* @__PURE__ */ t(at, {
1716
1813
  toast: e,
1717
1814
  onClose: r
1718
1815
  }, e.id))
1719
1816
  });
1720
- }, rt = () => {
1721
- let e = Z((e) => e.showToast), t = Z((e) => e.removeToast), n = Z((e) => e.clearToasts), r = o((t) => e({
1817
+ }, lt = () => {
1818
+ let e = Q((e) => e.showToast), t = Q((e) => e.removeToast), n = Q((e) => e.clearToasts), r = o((t) => e({
1722
1819
  ...t,
1723
1820
  variant: "info"
1724
1821
  }), [e]), i = o((t) => e({
@@ -1731,7 +1828,7 @@ var w = {
1731
1828
  ...t,
1732
1829
  variant: "error"
1733
1830
  }), [e]);
1734
- return l(() => ({
1831
+ return u(() => ({
1735
1832
  showToast: e,
1736
1833
  infoToast: r,
1737
1834
  successToast: i,
@@ -1748,7 +1845,7 @@ var w = {
1748
1845
  i,
1749
1846
  a
1750
1847
  ]);
1751
- }, it = {
1848
+ }, ut = {
1752
1849
  root: "_root_s9o0g_1",
1753
1850
  tooltip: "_tooltip_s9o0g_3",
1754
1851
  "ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
@@ -1756,9 +1853,9 @@ var w = {
1756
1853
  bottom: "_bottom_s9o0g_7",
1757
1854
  left: "_left_s9o0g_9",
1758
1855
  right: "_right_s9o0g_11"
1759
- }, at = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: f = !1, maxWidth: p = 280, className: m = "" }) => {
1760
- let h = c(), [g, _] = d(!1), v = u(null), y = () => {
1761
- f || !e || (v.current = setTimeout(() => _(!0), l));
1856
+ }, dt = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: u = !1, maxWidth: p = 280, className: m = "" }) => {
1857
+ let h = c(), [g, _] = f(!1), v = d(null), y = () => {
1858
+ u || !e || (v.current = setTimeout(() => _(!0), l));
1762
1859
  }, b = () => {
1763
1860
  v.current && clearTimeout(v.current), _(!1);
1764
1861
  };
@@ -1778,37 +1875,37 @@ var w = {
1778
1875
  onBlur: b
1779
1876
  });
1780
1877
  return /* @__PURE__ */ n("span", {
1781
- className: `${it.root} ${m}`,
1878
+ className: `${ut.root} ${m}`,
1782
1879
  onPointerDown: g ? b : y,
1783
1880
  children: [x, g && /* @__PURE__ */ t("span", {
1784
1881
  id: h,
1785
1882
  role: "tooltip",
1786
- className: `${it.tooltip} ${it[o]}`,
1883
+ className: `${ut.tooltip} ${ut[o]}`,
1787
1884
  style: { maxWidth: p },
1788
1885
  children: e
1789
1886
  })]
1790
1887
  });
1791
- }, Q = {
1888
+ }, ft = {
1792
1889
  root: "_root_1ue3g_1",
1793
1890
  frame: "_frame_1ue3g_3",
1794
1891
  video: "_video_1ue3g_5",
1795
1892
  overlay: "_overlay_1ue3g_7",
1796
1893
  error: "_error_1ue3g_7",
1797
1894
  caption: "_caption_1ue3g_13"
1798
- }, ot = ({ sources: e, tracks: r = [], title: i, aspectRatio: a = "16 / 9", objectFit: o = "contain", loading: s = !1, error: c, fallback: l, className: u = "", controls: f = !0, playsInline: p = !0, ...m }) => {
1799
- let [h, g] = d(!1), _ = c ?? (h ? "Не удалось воспроизвести видео" : void 0);
1895
+ }, pt = ({ sources: e, tracks: r = [], title: i, aspectRatio: a = "16 / 9", objectFit: o = "contain", loading: s = !1, error: c, fallback: l, className: u = "", controls: d = !0, playsInline: p = !0, ...m }) => {
1896
+ let [h, g] = f(!1), _ = c ?? (h ? "Не удалось воспроизвести видео" : void 0);
1800
1897
  return /* @__PURE__ */ n("figure", {
1801
- className: `${Q.root} ${u}`,
1898
+ className: `${ft.root} ${u}`,
1802
1899
  children: [/* @__PURE__ */ n("div", {
1803
- className: Q.frame,
1900
+ className: ft.frame,
1804
1901
  style: { aspectRatio: a },
1805
1902
  children: [
1806
1903
  !_ && e.length > 0 && /* @__PURE__ */ n("video", {
1807
1904
  ...m,
1808
1905
  "aria-label": i,
1809
- controls: f,
1906
+ controls: d,
1810
1907
  playsInline: p,
1811
- className: Q.video,
1908
+ className: ft.video,
1812
1909
  style: { objectFit: o },
1813
1910
  onError: (e) => {
1814
1911
  g(!0), m.onError?.(e);
@@ -1816,21 +1913,21 @@ var w = {
1816
1913
  children: [e.map((e) => /* @__PURE__ */ t("source", { ...e }, `${e.src}-${e.type}`)), r.map((e) => /* @__PURE__ */ t("track", { ...e }, `${e.src}-${e.srcLang}`))]
1817
1914
  }),
1818
1915
  s && /* @__PURE__ */ t("div", {
1819
- className: Q.overlay,
1820
- children: /* @__PURE__ */ t(x, { label: "Загрузка видео" })
1916
+ className: ft.overlay,
1917
+ children: /* @__PURE__ */ t(S, { label: "Загрузка видео" })
1821
1918
  }),
1822
1919
  (_ || e.length === 0) && /* @__PURE__ */ t("div", {
1823
- className: Q.error,
1920
+ className: ft.error,
1824
1921
  role: "alert",
1825
1922
  children: l ?? _ ?? "Источник видео не указан"
1826
1923
  })
1827
1924
  ]
1828
1925
  }), /* @__PURE__ */ t("figcaption", {
1829
- className: Q.caption,
1926
+ className: ft.caption,
1830
1927
  children: i
1831
1928
  })]
1832
1929
  });
1833
- }, st = {
1930
+ }, mt = {
1834
1931
  popup: "_popup_15ovj_1",
1835
1932
  trigger: "_trigger_15ovj_15",
1836
1933
  content: "_content_15ovj_23",
@@ -1838,13 +1935,13 @@ var w = {
1838
1935
  right: "_right_15ovj_141",
1839
1936
  bottom: "_bottom_15ovj_175",
1840
1937
  left: "_left_15ovj_209"
1841
- }, ct = ({ content: r, children: i, placement: a = "top", disabled: o = !1 }) => o ? /* @__PURE__ */ t(e, { children: i }) : /* @__PURE__ */ n("span", {
1842
- className: `${st.popup} ${st[a]}`,
1938
+ }, ht = ({ content: r, children: i, placement: a = "top", disabled: o = !1 }) => o ? /* @__PURE__ */ t(e, { children: i }) : /* @__PURE__ */ n("span", {
1939
+ className: `${mt.popup} ${mt[a]}`,
1843
1940
  children: [/* @__PURE__ */ t("span", {
1844
- className: st.trigger,
1941
+ className: mt.trigger,
1845
1942
  children: i
1846
1943
  }), /* @__PURE__ */ t("span", {
1847
- className: st.content,
1944
+ className: mt.content,
1848
1945
  role: "tooltip",
1849
1946
  children: r
1850
1947
  })]
@@ -1858,8 +1955,8 @@ var w = {
1858
1955
  open: "_open_1tdda_91",
1859
1956
  content: "_content_1tdda_99",
1860
1957
  contentInner: "_contentInner_1tdda_119"
1861
- }, lt = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: s, className: l = "" }) => {
1862
- let u = c(), [f, p] = d(a), m = o ?? f;
1958
+ }, gt = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: s, className: l = "" }) => {
1959
+ let u = c(), [d, p] = f(a), m = o ?? d;
1863
1960
  return /* @__PURE__ */ n("section", {
1864
1961
  className: `${$.root} ${m ? $.open : ""} ${l}`,
1865
1962
  children: [/* @__PURE__ */ n("button", {
@@ -1905,6 +2002,19 @@ var w = {
1905
2002
  })
1906
2003
  })]
1907
2004
  });
2005
+ }, _t = ({ children: e, containerId: t = "overlay-root" }) => {
2006
+ let [n, r] = f(null);
2007
+ return s(() => {
2008
+ let e = document.getElementById(t);
2009
+ if (e) {
2010
+ r(e);
2011
+ return;
2012
+ }
2013
+ let n = document.createElement("div");
2014
+ return n.id = t, document.body.appendChild(n), r(n), () => {
2015
+ n.childElementCount === 0 && n.parentElement && n.remove();
2016
+ };
2017
+ }, [t]), n ? p(e, n) : null;
1908
2018
  };
1909
2019
  //#endregion
1910
- export { Be as ConfirmModal, lt as DSAccordion, y as DSBadge, C as DSButton, O as DSCheckbox, _e as DSDataTable, B as DSDateRange, ne as DSDateTimePicker, ie as DSDropDown, ve as DSDropDownMultiple, T as DSFieldLabel, E as DSFieldMessage, ke as DSFileInput, Te as DSFilters, be as DSIcon, xe as DSInfoBlock, Se as DSInput, x as DSLoader, Pe as DSModal, Ne as DSModalFrame, Xe as DSPageLoader, ct as DSPopup, Ce as DSRadioButton, H as DSSkeleton, oe as DSSort, $e as DSToast, nt as DSToastProvider, at as DSTooltip, ot as DSVideoPlayerFrame, Ve as ErrorModal, Fe as ModalSystemProvider, He as builtInModalRegistry, Ie as defineModalRegistry, P as formatDateTimeLocalValue, We as getErrorMessage, re as getNextEnabledOptionIndex, z as isValidDateRange, F as parseDateTimeLocalValue, je as resetModalStore, tt as resetToastStore, Ue as useConfirmModal, Ke as useConfirmModalStore, Ge as useErrorModal, qe as useErrorModalStore, Je as useModals, Y as useModalsStore, rt as useToast, Z as useToastStore, ce as validateDSDataTableData };
2020
+ export { Ke as ConfirmModal, gt as DSAccordion, b as DSBadge, w as DSButton, k as DSCheckbox, xe as DSDataTable, V as DSDateRange, ne as DSDateTimePicker, le as DSDropDown, Se as DSDropDownMultiple, E as DSFieldLabel, D as DSFieldMessage, Fe as DSFileInput, je as DSFilters, we as DSIcon, Ee as DSInfoBlock, De as DSInput, S as DSLoader, Be as DSModal, ze as DSModalFrame, nt as DSPageLoader, ht as DSPopup, _t as DSPortal, ke as DSRadioButton, U as DSSkeleton, K as DSSort, at as DSToast, ct as DSToastProvider, dt as DSTooltip, pt as DSVideoPlayerFrame, qe as ErrorModal, Ve as ModalSystemProvider, Je as builtInModalRegistry, He as defineModalRegistry, F as formatDateTimeLocalValue, Xe as getErrorMessage, se as getNextEnabledOptionIndex, ie as isValidDateRange, I as parseDateTimeLocalValue, Le as resetModalStore, st as resetToastStore, Ye as useConfirmModal, Qe as useConfirmModalStore, Ze as useErrorModal, $e as useErrorModalStore, et as useModals, X as useModalsStore, lt as useToast, Q as useToastStore, fe as validateDSDataTableData };