@efficiency-point/design-system 0.0.4 → 0.0.6
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/components/DSDateTimePicker/DSDateTimePicker.d.ts +2 -1
- package/dist/components/DSDateTimePicker/DSDateTimePicker.d.ts.map +1 -1
- package/dist/components/DSFilters/DSFilters.d.ts.map +1 -1
- package/dist/components/DSInput/DSInput.d.ts +21 -7
- package/dist/components/DSInput/DSInput.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +420 -249
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ export type DSDateTimePickerProps = {
|
|
|
4
4
|
onChange?: (value: Date | null) => void;
|
|
5
5
|
mode?: DSDateTimePickerMode;
|
|
6
6
|
label?: string;
|
|
7
|
+
placeholder?: string;
|
|
7
8
|
hint?: string;
|
|
8
9
|
error?: string;
|
|
9
10
|
disabled?: boolean;
|
|
@@ -17,5 +18,5 @@ export type DSDateTimePickerProps = {
|
|
|
17
18
|
};
|
|
18
19
|
export declare const formatDateTimeLocalValue: (value: Date | null, mode: DSDateTimePickerMode) => string;
|
|
19
20
|
export declare const parseDateTimeLocalValue: (value: string, mode: DSDateTimePickerMode) => Date | null;
|
|
20
|
-
export declare const DSDateTimePicker: ({ value, onChange, mode, label, hint, error, disabled, readOnly, required, min, max, id, name, className, }: DSDateTimePickerProps) => import("react").JSX.Element;
|
|
21
|
+
export declare const DSDateTimePicker: ({ value, onChange, mode, label, placeholder, hint, error, disabled, readOnly, required, min, max, id, name, className, }: DSDateTimePickerProps) => import("react").JSX.Element;
|
|
21
22
|
//# sourceMappingURL=DSDateTimePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSDateTimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DSDateTimePicker/DSDateTimePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DSDateTimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DSDateTimePicker/DSDateTimePicker.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG;IAChC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAUF,eAAO,MAAM,wBAAwB,GAAI,OAAO,IAAI,GAAG,IAAI,EAAE,MAAM,oBAAoB,WAOtF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,EAAE,MAAM,oBAAoB,gBAchF,CAAC;AAsCF,eAAO,MAAM,gBAAgB,GAAI,0HAgB9B,qBAAqB,gCAoJvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSFilters.d.ts","sourceRoot":"","sources":["../../../src/components/DSFilters/DSFilters.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIhE,KAAK,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvG,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAC;AAClH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACpH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACpH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAClI,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAC5I,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,MAAM,EAAE,GAAG,OAAO,GAAG,gBAAgB,CAAC;AACjF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE3D,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,IAAI;IAC1E,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,cAAc,EAAE,2FAUvD,cAAc,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"DSFilters.d.ts","sourceRoot":"","sources":["../../../src/components/DSFilters/DSFilters.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIhE,KAAK,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvG,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAC;AAClH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACpH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACpH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAClI,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAC5I,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,MAAM,EAAE,GAAG,OAAO,GAAG,gBAAgB,CAAC;AACjF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE3D,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,IAAI;IAC1E,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,cAAc,EAAE,2FAUvD,cAAc,CAAC,OAAO,CAAC,gCA4CzB,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { FocusEventHandler, HTMLInputTypeAttribute } from 'react';
|
|
2
2
|
export type DSInputValue = string | number;
|
|
3
|
-
|
|
4
|
-
value: DSInputValue;
|
|
5
|
-
onChange?: (value: DSInputValue, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
-
type?: HTMLInputTypeAttribute;
|
|
3
|
+
type DSInputBaseProps = {
|
|
7
4
|
placeholder?: string;
|
|
8
5
|
disabled?: boolean;
|
|
9
6
|
readOnly?: boolean;
|
|
@@ -16,13 +13,30 @@ export type DSInputProps = {
|
|
|
16
13
|
id?: string;
|
|
17
14
|
clearable?: boolean;
|
|
18
15
|
required?: boolean;
|
|
16
|
+
autoFocus?: boolean;
|
|
19
17
|
autoComplete?: string;
|
|
20
18
|
maxLength?: number;
|
|
19
|
+
selectTextOnFocus?: boolean;
|
|
20
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
21
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
22
|
+
};
|
|
23
|
+
export type DSInputStringProps = DSInputBaseProps & {
|
|
24
|
+
value: string;
|
|
25
|
+
onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
26
|
+
type?: Exclude<HTMLInputTypeAttribute, 'number'>;
|
|
27
|
+
};
|
|
28
|
+
export type DSInputNumberProps = DSInputBaseProps & {
|
|
29
|
+
value: number | string;
|
|
30
|
+
onChange?: (value: number | string, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
31
|
+
type: 'number';
|
|
21
32
|
min?: number;
|
|
22
33
|
max?: number;
|
|
23
34
|
step?: number;
|
|
24
|
-
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
25
|
-
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
26
35
|
};
|
|
27
|
-
export
|
|
36
|
+
export type DSInputProps = DSInputStringProps | DSInputNumberProps;
|
|
37
|
+
export declare const DSInput: {
|
|
38
|
+
(props: DSInputNumberProps): React.ReactElement;
|
|
39
|
+
(props: DSInputStringProps): React.ReactElement;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
28
42
|
//# sourceMappingURL=DSInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSInput.d.ts","sourceRoot":"","sources":["../../../src/components/DSInput/DSInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAI3F,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C,
|
|
1
|
+
{"version":3,"file":"DSInput.d.ts","sourceRoot":"","sources":["../../../src/components/DSInput/DSInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAI3F,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C,KAAK,gBAAgB,GAAG;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG;IAChD,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACxF,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAmHnE,eAAO,MAAM,OAAO,EAAuB;IACvC,CAAC,KAAK,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC;IAChD,CAAC,KAAK,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC;CACnD,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("@tanstack/react-table"),r=require("react-dom"),i=require("zustand");var a={badge:`_badge_l4qbw_1`,sm:`_sm_l4qbw_2`,md:`_md_l4qbw_3`,neutral:`_neutral_l4qbw_4`,info:`_info_l4qbw_5`,success:`_success_l4qbw_6`,warning:`_warning_l4qbw_7`,error:`_error_l4qbw_8`,dot:`_dot_l4qbw_9`,icon:`_icon_l4qbw_10`,label:`_label_l4qbw_11`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={loader:`_loader_pslm9_1`,"ds-spin":`_ds-spin_pslm9_1`,primary:`_primary_pslm9_11`,secondary:`_secondary_pslm9_12`,light:`_light_pslm9_13`,danger:`_danger_pslm9_14`},c=({variant:t=`primary`,label:n=`Загрузка`,className:r=``,decorative:i=!1})=>(0,e.jsx)(`span`,{className:`${s.loader} ${s[t]} ${r}`,role:i?void 0:`status`,"aria-label":i?void 0:n,"aria-hidden":i||void 0}),l={button:`_button_3nz3z_1`,sm:`_sm_3nz3z_16`,md:`_md_3nz3z_17`,lg:`_lg_3nz3z_18`,primary:`_primary_3nz3z_19`,secondary:`_secondary_3nz3z_20`,outline:`_outline_3nz3z_21`,ghost:`_ghost_3nz3z_22`,empty:`_empty_3nz3z_22`,destructive:`_destructive_3nz3z_23`,destructiveOutline:`_destructiveOutline_3nz3z_24`},u=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,loadingLabel:a=`Загрузка`,disabled:o,type:s=`button`,className:u=``,...d},f)=>(0,e.jsx)(`button`,{ref:f,type:s,className:`${l.button} ${l[n]} ${l[r]} ${u}`,disabled:o||i,"aria-busy":i||void 0,...d,children:i?(0,e.jsx)(c,{variant:`light`,label:a}):t}));u.displayName=`DSButton`;var d={label:`_label_5v0ym_1`,required:`_required_5v0ym_12`,error:`_error_5v0ym_13`,optional:`_optional_5v0ym_17`,hint:`_hint_5v0ym_18`,disabled:`_disabled_5v0ym_24`,message:`_message_5v0ym_28`,success:`_success_5v0ym_36`},f=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${d.label} ${i?d.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:d.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:d.optional,children:r})]}),p=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${d.message} ${d[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),m={wrapper:`_wrapper_1l5cg_1`,label:`_label_1l5cg_2`,input:`_input_1l5cg_3`,control:`_control_1l5cg_4`,disabled:`_disabled_1l5cg_7`,controlError:`_controlError_1l5cg_9`},h=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,...h})=>{let g=(0,t.useId)(),_=d??`ds-checkbox-${u??g}`,v=(0,t.useRef)(null),y=a?`${_}-hint`:void 0,b=o?`${_}-error`:void 0;return(0,t.useEffect)(()=>{v.current&&(v.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${m.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${m.label} ${s?m.disabled:``}`,htmlFor:_,children:[(0,e.jsx)(`input`,{ref:v,id:_,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[y,b].filter(Boolean).join(` `)||void 0,className:m.input,onChange:e=>{c||r?.(e.target.checked,e)},...h}),(0,e.jsx)(`span`,{className:`${m.control} ${o?m.controlError:``}`,"aria-hidden":`true`,children:f&&!n?`−`:n?`✓`:``}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(p,{id:y,children:a}),o&&(0,e.jsx)(p,{id:b,variant:`error`,children:o})]})},g={wrapper:`_wrapper_1kr9x_1`,input:`_input_1kr9x_2`,error:`_error_1kr9x_5`},_=e=>String(e).padStart(2,`0`),v=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${_(e.getMonth()+1)}-${_(e.getDate())}`,r=`${_(e.getHours())}:${_(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},y=(e,t)=>{if(!e)return null;if(t===`time`){let[t,n]=e.split(`:`).map(Number),r=new Date;return r.setHours(t??0,n??0,0,0),r}let n=new Date(t===`date`?`${e}T00:00`:e);return Number.isNaN(n.getTime())?null:n},b=({value:n,onChange:r,mode:i=`date`,label:a,hint:o,error:s,disabled:c=!1,readOnly:l=!1,required:u=!1,min:d,max:m,id:h,name:_,className:b=``})=>{let x=(0,t.useId)(),S=h??`ds-date-time-${_??x}`,C=o?`${S}-hint`:void 0,w=s?`${S}-error`:void 0,T=i===`datetime`?`datetime-local`:i;return(0,e.jsxs)(`div`,{className:`${g.wrapper} ${b}`,children:[a&&(0,e.jsx)(f,{htmlFor:S,required:u,disabled:c,children:a}),(0,e.jsx)(`input`,{id:S,name:_,type:T,value:v(n,i),min:v(d??null,i)||void 0,max:v(m??null,i)||void 0,disabled:c,readOnly:l,required:u,"aria-invalid":!!s,"aria-describedby":[C,w].filter(Boolean).join(` `)||void 0,className:`${g.input} ${s?g.error:``}`,onChange:e=>r?.(y(e.target.value,i)),onKeyDown:e=>{e.key===`Escape`&&e.currentTarget.blur()}}),o&&!s&&(0,e.jsx)(p,{id:C,children:o}),s&&(0,e.jsx)(p,{id:w,variant:`error`,children:s})]})},x={root:`_root_9h2e2_1`,legend:`_legend_9h2e2_2`,range:`_range_9h2e2_3`},S=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),C=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:m=!1,className:h=``})=>{let g=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),S(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${x.root} ${h}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:x.range,children:[(0,e.jsx)(b,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,from:e})}),(0,e.jsx)(b,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,to:e})})]}),s&&!g&&(0,e.jsx)(p,{children:s})]})},w={group:`_group_1st6r_1`,skeleton:`_skeleton_1st6r_2`,text:`_text_1st6r_3`,rectangular:`_rectangular_1st6r_4`,circular:`_circular_1st6r_5`,animated:`_animated_1st6r_6`,"ds-skeleton":`_ds-skeleton_1st6r_1`},T=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${w.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(o,s)=>(0,e.jsx)(`span`,{className:`${w.skeleton} ${w[t]} ${a?w.animated:``}`,style:{width:s===i-1&&i>1?`70%`:n,height:r}},s))}),E={wrapper:`_wrapper_dkn63_1`,label:`_label_dkn63_17`,container:`_container_dkn63_29`,trigger:`_trigger_dkn63_37`,disabledText:`_disabledText_dkn63_39`,value:`_value_dkn63_109`,placeholder:`_placeholder_dkn63_111`,chevron:`_chevron_dkn63_137`,chevronOpen:`_chevronOpen_dkn63_163`,menu:`_menu_dkn63_171`,option:`_option_dkn63_207`,selected:`_selected_dkn63_245`,message:`_message_dkn63_265`,error:`_error_dkn63_267`,errorState:`_errorState_dkn63_293`},D=(e,t,n)=>{for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},O=({options:n,value:r,onChange:i,placeholder:a=`Выберите опцию`,disabled:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:f,id:p,needMark:m=!0,maxMenuHeight:h})=>{let g=(0,t.useId)(),_=p??`ds-dropdown-${f??g}`,[v,y]=(0,t.useState)(!1),b=(0,t.useRef)(null),x=(0,t.useRef)(null),S=(0,t.useRef)([]),C=(0,t.useMemo)(()=>n.find(e=>e.value===r),[n,r]),w=u?`${_}-hint`:void 0,T=l?`${_}-error`:void 0,O=[w,T].filter(Boolean).join(` `)||void 0,k=o&&s;(0,t.useEffect)(()=>{let e=e=>{b.current?.contains(e.target)||y(!1)},t=e=>{e.key===`Escape`&&v&&(y(!1),x.current?.focus())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[v]);let A=(e,t)=>{let r=D(n,e,t);S.current[r]?.focus(),S.current[r]?.scrollIntoView({block:`nearest`})},j=e=>{e.disabled||(i?.(e.value,e),y(!1),x.current?.focus())};return(0,e.jsxs)(`div`,{ref:b,className:[E.wrapper,l?E.errorState:``,d].filter(Boolean).join(` `),children:[c&&(0,e.jsx)(`label`,{htmlFor:k?void 0:_,className:E.label,children:c}),(0,e.jsx)(`div`,{className:E.container,children:k?(0,e.jsx)(`div`,{id:_,className:E.disabledText,"aria-describedby":O,children:C?.label??a}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`button`,{ref:x,id:_,type:`button`,name:f,className:E.trigger,disabled:o,"aria-haspopup":`listbox`,"aria-expanded":v,"aria-controls":`${_}-listbox`,"aria-describedby":O,"aria-invalid":!!l,onClick:()=>y(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),y(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>A(e.key===`ArrowDown`?0:n.length-1,t))}},children:[(0,e.jsx)(`span`,{className:C?E.value:E.placeholder,children:C?.label??a}),(0,e.jsx)(`span`,{className:`${E.chevron} ${v?E.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),v&&(0,e.jsx)(`ul`,{id:`${_}-listbox`,className:E.menu,role:`listbox`,"aria-label":c,style:{maxHeight:h},children:n.map((t,i)=>{let a=t.value===r;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{S.current[i]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:`${E.option} ${a?E.selected:``}`,onClick:()=>j(t),onKeyDown:e=>{if((e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),A(i+(e.key===`ArrowDown`?1:-1),e.key===`ArrowDown`?1:-1)),e.key===`Tab`&&y(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;A(e.key===`Home`?0:n.length-1,t)}},children:[(0,e.jsx)(`span`,{children:t.label}),a&&m&&(0,e.jsx)(`span`,{"aria-hidden":`true`,children:`✓`})]})},t.value)})})]})}),u&&!l&&(0,e.jsx)(`span`,{id:w,className:E.message,children:u}),l&&(0,e.jsx)(`span`,{id:T,className:E.error,children:l})]})},k=e=>`${e.id}:${e.direction}`,A=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:k({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:k({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(O,{options:c,value:n?k(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},j={root:`_root_i4d62_1`,tableWrap:`_tableWrap_i4d62_2`,table:`_table_i4d62_2`,sticky:`_sticky_i4d62_8`,sortButton:`_sortButton_i4d62_9`,state:`_state_i4d62_11`,cards:`_cards_i4d62_12`,mobileSort:`_mobileSort_i4d62_12`,card:`_card_i4d62_12`,spanTwo:`_spanTwo_i4d62_19`,default:`_default_i4d62_21`,tableOnMobile:`_tableOnMobile_i4d62_21`,wide:`_wide_i4d62_23`},ee=(0,n.tableFeatures)({rowSortingFeature:n.rowSortingFeature,sortedRowModel:(0,n.createSortedRowModel)()}),M=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1)for(let r of e)if(typeof r.accessor==`string`&&!(r.accessor in t[n]))return`В строке ${n+1} отсутствует колонка «${r.id}»`;return null},N=({columns:r,data:i,tableOnMobile:a=!1,breakpoint:o=`default`,sorting:s,onSortingChange:c,renderMobileCard:l,getRowId:u,caption:d,ariaLabel:f,loading:p=!1,error:m,emptyState:h=`Нет данных`,stickyHeader:g=!1,maxHeight:_,className:v=``})=>{let[y,b]=(0,t.useState)([]),x=s??y,S=(0,t.useMemo)(()=>M(r,i),[r,i]),C=(0,t.useMemo)(()=>(0,n.createColumnHelper)(),[]),w=(0,t.useMemo)(()=>C.columns(r.map(e=>{let t=e.accessor;return C.accessor(typeof t==`function`?t:e=>e[t],{id:e.id,header:()=>e.header,cell:t=>e.cell?.(t.row.original,t.getValue())??String(t.getValue()??``),enableSorting:!0,sortDescFirst:e.sortDescFirst})})),[r,C]),E=(0,n.useTable)({features:ee,columns:w,data:i,state:{sorting:x},onSortingChange:e=>{let t=typeof e==`function`?e(x):e;s===void 0&&b(t),c?.(t)},getRowId:u}),D=E.getRowModel().rows,O=r.map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),k=[j.root,o===`wide`?j.wide:j.default,a?j.tableOnMobile:``,v].filter(Boolean).join(` `),N=S??m;return(0,e.jsxs)(`section`,{className:k,"aria-busy":p,children:[!a&&!p&&!N&&D.length>0&&(0,e.jsx)(A,{className:j.mobileSort,options:O,value:x[0]?{id:x[0].id,direction:x[0].desc?`desc`:`asc`}:null,onChange:e=>E.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:j.tableWrap,style:{maxHeight:_},children:(0,e.jsxs)(`table`,{className:j.table,"aria-label":f,children:[d&&(0,e.jsx)(`caption`,{children:d}),(0,e.jsx)(`thead`,{className:g?j.sticky:``,children:E.getHeaderGroups().map(t=>(0,e.jsx)(`tr`,{children:t.headers.map(t=>{let n=t.column.getIsSorted();return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,children:(0,e.jsxs)(`button`,{type:`button`,className:j.sortButton,onClick:t.column.getToggleSortingHandler(),children:[(0,e.jsx)(E.FlexRender,{header:t}),(0,e.jsx)(`span`,{"aria-hidden":`true`,children:n===`asc`?`↑`:n===`desc`?`↓`:`↕`})]})},t.id)})},t.id))}),(0,e.jsx)(`tbody`,{children:p?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:r.length,children:(0,e.jsx)(T,{lines:3})})}):N?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:j.state,colSpan:r.length,children:N})}):D.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:j.state,colSpan:r.length,children:h})}):D.map(t=>(0,e.jsx)(`tr`,{children:t.getAllCells().map(t=>(0,e.jsx)(`td`,{children:(0,e.jsx)(E.FlexRender,{cell:t})},t.id))},t.id))})]})}),!a&&(0,e.jsx)(`div`,{className:j.cards,role:`list`,"aria-label":f??d,children:p?(0,e.jsx)(T,{lines:4}):N?(0,e.jsx)(`div`,{className:j.state,children:N}):D.length===0?(0,e.jsx)(`div`,{className:j.state,children:h}):D.map(t=>{if(l)return(0,e.jsx)(`div`,{role:`listitem`,children:l({row:t.original,columns:r})},t.id);let n=r.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),i=n.find(e=>e.mobile?.primary)??n.find(e=>e.mobile?.mobileVariant!==`actions`),a=e=>typeof e.accessor==`function`?e.accessor(t.original):t.original[e.accessor],o=e=>e.mobile?.renderMobile?.(t.original,a(e))??e.cell?.(t.original,a(e))??String(a(e)??``);return(0,e.jsxs)(`article`,{role:`listitem`,className:j.card,children:[(0,e.jsx)(`h3`,{children:i?o(i):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:n.filter(e=>e!==i&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?j.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:o(t)})]},t.id))}),n.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:o(t)},t.id))]},t.id)})})]})},P=({options:n,value:r,onChange:i,placeholder:a=`Выберите опции`,disabled:o=!1,label:s,error:c,hint:l,className:u=``,name:d,id:f,closeOnSelect:p=!1,maxMenuHeight:m})=>{let h=(0,t.useId)(),g=f??`ds-dropdown-multiple-${d??h}`,[_,v]=(0,t.useState)(!1),y=(0,t.useRef)(null),b=(0,t.useRef)(null),x=(0,t.useRef)([]),S=(0,t.useMemo)(()=>n.filter(e=>r.includes(e.value)),[n,r]),C=S.map(e=>e.label).join(`, `),w=l?`${g}-hint`:void 0,T=c?`${g}-error`:void 0;(0,t.useEffect)(()=>{let e=e=>{y.current?.contains(e.target)||v(!1)},t=e=>{e.key===`Escape`&&_&&(v(!1),b.current?.focus())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[_]);let O=e=>{if(e.disabled)return;let t=r.includes(e.value)?r.filter(t=>t!==e.value):[...r,e.value];i?.(t,n.filter(e=>t.includes(e.value))),p&&(v(!1),b.current?.focus())},k=(e,t)=>{let r=D(n,e,t);x.current[r]?.focus(),x.current[r]?.scrollIntoView({block:`nearest`})};return(0,e.jsxs)(`div`,{ref:y,className:[E.wrapper,c?E.errorState:``,u].filter(Boolean).join(` `),children:[s&&(0,e.jsx)(`label`,{htmlFor:g,className:E.label,children:s}),(0,e.jsxs)(`div`,{className:E.container,children:[(0,e.jsxs)(`button`,{ref:b,id:g,type:`button`,name:d,className:E.trigger,disabled:o,"aria-haspopup":`listbox`,"aria-expanded":_,"aria-controls":`${g}-listbox`,"aria-describedby":[w,T].filter(Boolean).join(` `)||void 0,"aria-invalid":!!c,onClick:()=>v(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),v(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>k(e.key===`ArrowDown`?0:n.length-1,t))}},children:[(0,e.jsx)(`span`,{className:S.length?E.value:E.placeholder,children:C||a}),(0,e.jsx)(`span`,{className:`${E.chevron} ${_?E.chevronOpen:``}`,"aria-hidden":`true`,children:`⌄`})]}),_&&(0,e.jsx)(`ul`,{id:`${g}-listbox`,className:E.menu,role:`listbox`,"aria-label":s,"aria-multiselectable":`true`,style:{maxHeight:m},children:n.map((t,i)=>{let a=r.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{x.current[i]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:`${E.option} ${a?E.selected:``}`,onClick:()=>O(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;k(i+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;k(e.key===`Home`?0:n.length-1,t)}e.key===`Tab`&&v(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),(0,e.jsx)(`span`,{"aria-hidden":`true`,children:a?`✓`:``})]})},t.value)})})]}),l&&!c&&(0,e.jsx)(`span`,{id:w,className:E.message,children:l}),c&&(0,e.jsx)(`span`,{id:T,className:E.error,children:c})]})},te={approve:`M4 12l5 5L20 6`,reject:`M5 5l14 14M19 5L5 19`,edit:`M4 20h4L19 9l-4-4L4 16v4z`,cross:`M5 5l14 14M19 5L5 19`,chevron:`M6 9l6 6 6-6`,basket:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`,info:`M12 10v7m0-10v.01`,warning:`M12 4L3 20h18L12 4zm0 5v5m0 3v.01`},ne=({name:t,title:n,width:r=24,height:i=24,...a})=>(0,e.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:r,height:i,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:n?`img`:void 0,"aria-hidden":!n||void 0,focusable:`false`,...a,children:[n&&(0,e.jsx)(`title`,{children:n}),(0,e.jsx)(`path`,{d:te[t]})]}),F={root:`_root_1897l_1`,header:`_header_1897l_11`,title:`_title_1897l_21`,dismiss:`_dismiss_1897l_28`,content:`_content_1897l_57`},re=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${F.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:F.header,children:[(0,e.jsx)(s,{id:l,className:F.title,children:n}),i&&(0,e.jsx)(`button`,{type:`button`,className:F.dismiss,onClick:a,"aria-label":o,children:(0,e.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M5 5L15 15M15 5L5 15`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})})})]}),(0,e.jsx)(`div`,{className:F.content,children:r})]})},I={wrapper:`_wrapper_1bpdz_1`,control:`_control_1bpdz_3`,input:`_input_1bpdz_5`,disabledText:`_disabledText_1bpdz_5`,inputError:`_inputError_1bpdz_11`,clear:`_clear_1bpdz_13`},L=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:m=``,name:h,id:g,clearable:_=!0,required:v=!1,...y})=>{let b=(0,t.useId)(),x=g??`ds-input-${h??b}`,S=(0,t.useRef)(null),C=d?`${x}-hint`:void 0,w=u?`${x}-error`:void 0,T=String(n??``),E=[C,w].filter(Boolean).join(` `)||void 0;return(0,e.jsxs)(`div`,{className:`${I.wrapper} ${m}`,children:[l&&(0,e.jsx)(f,{htmlFor:x,required:v,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:x,className:I.disabledText,"aria-describedby":E,children:T||a}):(0,e.jsxs)(`div`,{className:I.control,children:[(0,e.jsx)(`input`,{ref:S,id:x,name:h,type:i,value:T,placeholder:a,disabled:o,readOnly:s,required:v,"aria-invalid":!!u,"aria-describedby":E,className:`${I.input} ${u?I.inputError:``}`,onChange:e=>{i===`number`&&e.target.value!==``?r?.(Number(e.target.value),e):r?.(e.target.value,e)},...y}),_&&T&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:I.clear,"aria-label":`Очистить поле`,onClick:()=>{let e=S.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:`×`})]}),d&&!u&&(0,e.jsx)(p,{id:C,children:d}),u&&(0,e.jsx)(p,{id:w,variant:`error`,children:u})]})},R={wrapper:`_wrapper_8srjz_1`,input:`_input_8srjz_11`,switch:`_switch_8srjz_18`,thumb:`_thumb_8srjz_34`,label:`_label_8srjz_56`,disabled:`_disabled_8srjz_62`},z=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${R.wrapper} ${a?R.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:R.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:R.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:R.thumb})}),i&&(0,e.jsx)(`span`,{className:R.label,children:i})]})},B={root:`_root_kepgo_1`,grid:`_grid_kepgo_3`,actions:`_actions_kepgo_5`},ie=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let d=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${B.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:B.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`)return(0,e.jsx)(L,{label:t.label,hint:t.hint,placeholder:t.placeholder,type:t.inputType,value:i??``,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`dropdown`)return(0,e.jsx)(O,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(P,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(h,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(z,{label:t.label,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(C,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>d(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:B.actions,children:[a&&(0,e.jsx)(u,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(u,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},ae=0,V=(0,i.create)(e=>({modals:[],openModal:(t,n={},r={})=>{ae+=1;let i=`ds-modal-${ae}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0}]})),i},closeModal:t=>e(e=>({modals:e.modals.filter(e=>e.id!==t)})),closeTopModal:()=>e(e=>({modals:e.modals.slice(0,-1)})),closeAllModals:()=>e({modals:[]})})),oe=()=>V.setState({modals:[]}),H={layer:`_layer_bl99k_1`,backdrop:`_backdrop_bl99k_2`,panel:`_panel_bl99k_3`,header:`_header_bl99k_5`,title:`_title_bl99k_6`,description:`_description_bl99k_7`,content:`_content_bl99k_8`},U=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,W=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useId)(),d=(0,t.useId)(),f=(0,t.useRef)(null),p=V(e=>e.closeModal);return(0,t.useEffect)(()=>{let e=document.activeElement,t=f.current;return(t?.querySelector(U)??t)?.focus(),()=>e?.focus()},[]),(0,e.jsxs)(`div`,{ref:f,className:`${H.panel} ${s}`,role:c,"aria-modal":`true`,"aria-labelledby":r?l:void 0,"aria-describedby":i?d:void 0,tabIndex:-1,onKeyDown:e=>{if(e.key!==`Tab`)return;let t=Array.from(f.current?.querySelectorAll(U)??[]);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},children:[(r||o)&&(0,e.jsxs)(`header`,{className:H.header,children:[r&&(0,e.jsx)(`h2`,{id:l,className:H.title,children:r}),(0,e.jsx)(u,{variant:`ghost`,size:`sm`,"aria-label":o,onClick:()=>p(a),children:`×`})]}),i&&(0,e.jsx)(`p`,{id:d,className:H.description,children:i}),(0,e.jsx)(`div`,{className:H.content,children:n})]})},G=({registry:n})=>{let i=V(e=>e.modals),a=V(e=>e.closeModal),o=V(e=>e.closeAllModals);return(0,t.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=V.getState().modals.at(-1);t?.closeOnEscape&&a(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),!i.length||typeof document>`u`?null:(0,r.createPortal)((0,e.jsx)(`div`,{className:H.layer,"aria-label":`Модальные окна`,children:i.map((t,r)=>{let s=n[t.name];return s?(0,e.jsx)(`div`,{className:H.backdrop,"aria-hidden":r!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&a(t.id)},children:(0,e.jsx)(s,{...t.payload,modalId:t.id,close:()=>a(t.id),closeAll:o})},t.id):null})}),document.body)},se=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=V(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)(G,{registry:n})]})},K=e=>e,q={message:`_message_187g8_1`,actions:`_actions_187g8_2`},J=new Map,ce=0,le=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{J.get(c)?.(e),J.delete(c),n()};return(0,e.jsxs)(W,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:q.message,children:i}),(0,e.jsxs)(`div`,{className:q.actions,children:[(0,e.jsx)(u,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(u,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},ue=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)(W,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:q.message,children:i}),(0,e.jsx)(`div`,{className:q.actions,children:(0,e.jsx)(u,{onClick:n,children:a})})]}),de=K({ConfirmModal:le,ErrorModal:ue}),fe=()=>{let e=V(e=>e.openModal);return(t={})=>new Promise(n=>{ce+=1;let r=`confirm-${ce}`;J.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1})})},pe=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,me=()=>{let e=V(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:pe(t)})}},he=(0,i.create)(()=>({})),ge=(0,i.create)(()=>({})),_e=()=>{let e=V(e=>e.modals),t=V(e=>e.openModal);return{openModal:(e,n={},r)=>t(e,n,r),closeModal:V(e=>e.closeModal),closeTopModal:V(e=>e.closeTopModal),closeAllModals:V(e=>e.closeAllModals),isOpen:t=>e.some(e=>e.name===t),count:e.length}},ve={root:`_root_1j70j_1`},ye=({label:t=`Загрузка страницы`,className:n=``})=>(0,e.jsxs)(`div`,{className:`${ve.root} ${n}`,role:`status`,"aria-label":t,children:[(0,e.jsx)(c,{decorative:!0}),(0,e.jsx)(`span`,{children:t})]}),Y={root:`_root_ig8lp_1`,legend:`_legend_ig8lp_2`,range:`_range_ig8lp_3`},be=[{value:`1`,label:`День`},{value:`2`,label:`Неделя`},{value:`3`,label:`Месяц`}],xe={day:1,week:2,month:3},Se=({value:t,onChange:n,label:r,hint:i,error:a,disabled:o=!1,min:s,max:c,className:l=``,periodTypeOptions:u=be})=>(0,e.jsxs)(`fieldset`,{className:`${Y.root} ${l}`,disabled:o,children:[r&&(0,e.jsx)(`legend`,{className:Y.legend,children:r}),(0,e.jsx)(O,{options:u,value:String(t.periodType),disabled:o,onChange:e=>n?.({...t,periodType:Number(e)}),label:`Тип периода`}),(0,e.jsxs)(`div`,{className:Y.range,children:[(0,e.jsx)(b,{value:t.startDate,onChange:e=>n?.({...t,startDate:e}),label:`Начало`,min:s,max:c,disabled:o}),(0,e.jsx)(b,{value:t.endDate,onChange:e=>n?.({...t,endDate:e}),label:`Окончание`,min:t.startDate??s,max:c,disabled:o})]}),i&&!a&&(0,e.jsx)(p,{children:i}),a&&(0,e.jsx)(p,{variant:`error`,children:a})]}),X={viewport:`_viewport_v7rog_1`,"top-right":`_top-right_v7rog_2`,"top-left":`_top-left_v7rog_3`,"bottom-right":`_bottom-right_v7rog_4`,"bottom-left":`_bottom-left_v7rog_5`,toast:`_toast_v7rog_6`,body:`_body_v7rog_7`,icon:`_icon_v7rog_8`,info:`_info_v7rog_9`,success:`_success_v7rog_10`,warning:`_warning_v7rog_11`,error:`_error_v7rog_12`},Ce=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),o=(0,t.useRef)(n.duration),s=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||n.duration<=0)return;s.current=Date.now();let e=setTimeout(()=>r(n.id),o.current);return()=>{clearTimeout(e),o.current=Math.max(0,o.current-(Date.now()-s.current))}},[r,i,n.duration,n.id]),(0,e.jsxs)(`article`,{className:`${X.toast} ${X[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(ne,{name:n.variant===`warning`?`warning`:`info`,className:X.icon}),(0,e.jsxs)(`div`,{className:X.body,children:[n.title&&(0,e.jsx)(`strong`,{children:n.title}),(0,e.jsx)(`div`,{children:n.message}),n.action&&(0,e.jsx)(u,{variant:`ghost`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(u,{variant:`ghost`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:`×`})]})},we=0,Z=(0,i.create)(e=>({toasts:[],showToast:t=>{we+=1;let n=`ds-toast-${we}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...t,id:n}]})),n},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),Te=()=>Z.setState({toasts:[]}),Ee=({position:t=`top-right`})=>{let n=Z(e=>e.toasts),r=Z(e=>e.removeToast);return(0,e.jsx)(`div`,{className:`${X.viewport} ${X[t]}`,"aria-label":`Уведомления`,children:n.map(t=>(0,e.jsx)(Ce,{toast:t,onClose:r},t.id))})},De=()=>{let e=Z(e=>e.showToast),t=Z(e=>e.removeToast),n=Z(e=>e.clearToasts),r=t=>n=>e({...n,variant:t});return{showToast:e,infoToast:r(`info`),successToast:r(`success`),warningToast:r(`warning`),errorToast:r(`error`),removeToast:t,clearToasts:n}},Q={root:`_root_2bxal_1`,tooltip:`_tooltip_2bxal_2`,"ds-tooltip-in":`_ds-tooltip-in_2bxal_1`,top:`_top_2bxal_3`,bottom:`_bottom_2bxal_4`,left:`_left_2bxal_5`,right:`_right_2bxal_6`},Oe=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=()=>{o||!n||(f.current=setTimeout(()=>d(!0),a))},m=()=>{f.current&&clearTimeout(f.current),d(!1)};if((0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),f.current&&clearTimeout(f.current)}},[]),!(0,t.isValidElement)(r))return r;let h=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m});return(0,e.jsxs)(`span`,{className:`${Q.root} ${c}`,onPointerDown:u?m:p,children:[h,u&&(0,e.jsx)(`span`,{id:l,role:`tooltip`,className:`${Q.tooltip} ${Q[i]}`,style:{maxWidth:s},children:n})]})},$={root:`_root_tgni1_1`,frame:`_frame_tgni1_2`,video:`_video_tgni1_3`,overlay:`_overlay_tgni1_4`,error:`_error_tgni1_4`,caption:`_caption_tgni1_7`},ke=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:l,fallback:u,className:d=``,controls:f=!0,playsInline:p=!0,...m})=>{let[h,g]=(0,t.useState)(!1),_=l??(h?`Не удалось воспроизвести видео`:void 0);return(0,e.jsxs)(`figure`,{className:`${$.root} ${d}`,children:[(0,e.jsxs)(`div`,{className:$.frame,style:{aspectRatio:a},children:[!_&&n.length>0&&(0,e.jsxs)(`video`,{...m,"aria-label":i,controls:f,playsInline:p,className:$.video,style:{objectFit:o},onError:e=>{g(!0),m.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),s&&(0,e.jsx)(`div`,{className:$.overlay,children:(0,e.jsx)(c,{label:`Загрузка видео`})}),(_||n.length===0)&&(0,e.jsx)(`div`,{className:$.error,role:`alert`,children:u??_??`Источник видео не указан`})]}),(0,e.jsx)(`figcaption`,{className:$.caption,children:i})]})};exports.ConfirmModal=le,exports.DSBadge=o,exports.DSButton=u,exports.DSCheckbox=h,exports.DSDataTable=N,exports.DSDateRange=C,exports.DSDateTimePicker=b,exports.DSDropDown=O,exports.DSDropDownMultiple=P,exports.DSFieldLabel=f,exports.DSFieldMessage=p,exports.DSFilters=ie,exports.DSIcon=ne,exports.DSInfoBlock=re,exports.DSInput=L,exports.DSLoader=c,exports.DSModal=G,exports.DSModalFrame=W,exports.DSPageLoader=ye,exports.DSRadioButton=z,exports.DSSkeleton=T,exports.DSSort=A,exports.DSTimePeriodPicker=Se,exports.DSToast=Ce,exports.DSToastProvider=Ee,exports.DSTooltip=Oe,exports.DSVideoPlayerFrame=ke,exports.DS_PERIOD_TYPE_CODES=xe,exports.ErrorModal=ue,exports.ModalSystemProvider=se,exports.builtInModalRegistry=de,exports.defineModalRegistry=K,exports.formatDateTimeLocalValue=v,exports.getErrorMessage=pe,exports.getNextEnabledOptionIndex=D,exports.isValidDateRange=S,exports.parseDateTimeLocalValue=y,exports.resetModalStore=oe,exports.resetToastStore=Te,exports.useConfirmModal=fe,exports.useConfirmModalStore=he,exports.useErrorModal=me,exports.useErrorModalStore=ge,exports.useModals=_e,exports.useModalsStore=V,exports.useToast=De,exports.useToastStore=Z,exports.validateDSDataTableData=M;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("@tanstack/react-table"),r=require("react-dom"),i=require("zustand");var a={badge:`_badge_l4qbw_1`,sm:`_sm_l4qbw_2`,md:`_md_l4qbw_3`,neutral:`_neutral_l4qbw_4`,info:`_info_l4qbw_5`,success:`_success_l4qbw_6`,warning:`_warning_l4qbw_7`,error:`_error_l4qbw_8`,dot:`_dot_l4qbw_9`,icon:`_icon_l4qbw_10`,label:`_label_l4qbw_11`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={loader:`_loader_pslm9_1`,"ds-spin":`_ds-spin_pslm9_1`,primary:`_primary_pslm9_11`,secondary:`_secondary_pslm9_12`,light:`_light_pslm9_13`,danger:`_danger_pslm9_14`},c=({variant:t=`primary`,label:n=`Загрузка`,className:r=``,decorative:i=!1})=>(0,e.jsx)(`span`,{className:`${s.loader} ${s[t]} ${r}`,role:i?void 0:`status`,"aria-label":i?void 0:n,"aria-hidden":i||void 0}),l={button:`_button_higub_1`,sm:`_sm_higub_16`,md:`_md_higub_17`,lg:`_lg_higub_18`,primary:`_primary_higub_19`,secondary:`_secondary_higub_20`,outline:`_outline_higub_21`,ghost:`_ghost_higub_23`,empty:`_empty_higub_29`,destructive:`_destructive_higub_34`,destructiveOutline:`_destructiveOutline_higub_35`},u=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,loadingLabel:a=`Загрузка`,disabled:o,type:s=`button`,className:u=``,...d},f)=>(0,e.jsx)(`button`,{ref:f,type:s,className:`${l.button} ${l[n]} ${l[r]} ${u}`,disabled:o||i,"aria-busy":i||void 0,...d,children:i?(0,e.jsx)(c,{variant:`light`,label:a}):t}));u.displayName=`DSButton`;var d={label:`_label_5v0ym_1`,required:`_required_5v0ym_12`,error:`_error_5v0ym_13`,optional:`_optional_5v0ym_17`,hint:`_hint_5v0ym_18`,disabled:`_disabled_5v0ym_24`,message:`_message_5v0ym_28`,success:`_success_5v0ym_36`},f=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${d.label} ${i?d.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:d.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:d.optional,children:r})]}),p=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${d.message} ${d[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),m={wrapper:`_wrapper_1l5cg_1`,label:`_label_1l5cg_2`,input:`_input_1l5cg_3`,control:`_control_1l5cg_4`,disabled:`_disabled_1l5cg_7`,controlError:`_controlError_1l5cg_9`},h=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,...h})=>{let g=(0,t.useId)(),_=d??`ds-checkbox-${u??g}`,v=(0,t.useRef)(null),y=a?`${_}-hint`:void 0,b=o?`${_}-error`:void 0;return(0,t.useEffect)(()=>{v.current&&(v.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${m.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${m.label} ${s?m.disabled:``}`,htmlFor:_,children:[(0,e.jsx)(`input`,{ref:v,id:_,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[y,b].filter(Boolean).join(` `)||void 0,className:m.input,onChange:e=>{c||r?.(e.target.checked,e)},...h}),(0,e.jsx)(`span`,{className:`${m.control} ${o?m.controlError:``}`,"aria-hidden":`true`,children:f&&!n?`−`:n?`✓`:``}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(p,{id:y,children:a}),o&&(0,e.jsx)(p,{id:b,variant:`error`,children:o})]})},g={wrapper:`_wrapper_phf7i_1`,trigger:`_trigger_phf7i_9`,nav:`_nav_phf7i_27`,day:`_day_phf7i_28`,monthSelect:`_monthSelect_phf7i_29`,yearInput:`_yearInput_phf7i_30`,timeInput:`_timeInput_phf7i_31`,value:`_value_phf7i_43`,placeholder:`_placeholder_phf7i_47`,error:`_error_phf7i_51`,panel:`_panel_phf7i_55`,calendarHeader:`_calendarHeader_phf7i_68`,weekdays:`_weekdays_phf7i_113`,days:`_days_phf7i_114`,outside:`_outside_phf7i_132`,selected:`_selected_phf7i_136`,timeLabel:`_timeLabel_phf7i_146`},_=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],v=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],y=e=>String(e).padStart(2,`0`),b=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),x=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${y(e.getMonth()+1)}-${y(e.getDate())}`,r=`${y(e.getHours())}:${y(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},S=(e,t)=>{if(!e)return null;if(t===`time`){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);if(n>23||r>59)return null;let i=new Date;return i.setHours(n,r,0,0),i}let n=new Date(t===`date`?`${e}T00:00`:e);return Number.isNaN(n.getTime())?null:n},C=(e,t)=>{if(!e)return``;let n=`${y(e.getDate())}.${y(e.getMonth()+1)}.${e.getFullYear()}`,r=`${y(e.getHours())}:${y(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n} ${r}`},w=e=>{let t=new Date(e.getFullYear(),e.getMonth(),1),n=(t.getDay()+6)%7,r=new Date(t);return r.setDate(t.getDate()-n),Array.from({length:42},(e,t)=>{let n=new Date(r);return n.setDate(r.getDate()+t),n})},T=(e,t)=>!!(e&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()),E=(e,t,n)=>{let r=b(e).getTime();return!!(t&&r<b(t).getTime()||n&&r>b(n).getTime())},D=({value:n,onChange:r,mode:i=`date`,label:a,placeholder:o,hint:s,error:c,disabled:l=!1,readOnly:u=!1,required:d=!1,min:m,max:h,id:y,name:b,className:D=``})=>{let O=(0,t.useId)(),k=y??`ds-date-time-${b??O}`,A=s?`${k}-hint`:void 0,j=c?`${k}-error`:void 0,M=(0,t.useRef)(null),N=(0,t.useRef)(null),[P,F]=(0,t.useState)(!1),[I,L]=(0,t.useState)(n??new Date),[R,z]=(0,t.useState)(x(n,`time`)),ee=(0,t.useMemo)(()=>w(I),[I]),te=i!==`time`,ne=i!==`date`;(0,t.useEffect)(()=>{n&&L(n),z(x(n,`time`))},[n]),(0,t.useEffect)(()=>{let e=e=>{M.current?.contains(e.target)||F(!1)},t=e=>{e.key===`Escape`&&(F(!1),N.current?.focus())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[]);let re=e=>{if(E(e,m,h))return;let t=new Date(e);t.setHours(n?.getHours()??0,n?.getMinutes()??0,0,0),r?.(t),i===`date`&&F(!1)},B=e=>{if(z(e),!e){r?.(null);return}let t=S(e,`time`);if(!t)return;let a=new Date(i===`datetime`?n??I:new Date);a.setHours(t.getHours(),t.getMinutes(),0,0),!(m&&a<m||h&&a>h)&&r?.(a)},V=o??(i===`date`?`Выберите дату`:i===`time`?`Введите время`:`Выберите дату и время`),ie=[A,j].filter(Boolean).join(` `)||void 0;return(0,e.jsxs)(`div`,{ref:M,className:`${g.wrapper} ${D}`,children:[a&&(0,e.jsx)(f,{htmlFor:k,required:d,disabled:l,children:a}),(0,e.jsxs)(`button`,{ref:N,id:k,name:b,type:`button`,className:`${g.trigger} ${c?g.error:``}`,disabled:l,"aria-readonly":u||void 0,"aria-expanded":P,"aria-haspopup":`dialog`,"aria-describedby":ie,onClick:()=>{u||F(e=>!e)},children:[(0,e.jsx)(`span`,{className:n?g.value:g.placeholder,children:C(n,i)||V}),(0,e.jsx)(`span`,{"aria-hidden":`true`,children:`▾`})]}),P&&!u&&(0,e.jsxs)(`div`,{className:g.panel,role:`dialog`,"aria-label":a??V,children:[te&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`div`,{className:g.calendarHeader,children:[(0,e.jsx)(`button`,{type:`button`,className:g.nav,"aria-label":`Предыдущий месяц`,onClick:()=>L(new Date(I.getFullYear(),I.getMonth()-1,1)),children:`‹`}),(0,e.jsx)(`select`,{className:g.monthSelect,"aria-label":`Месяц`,value:I.getMonth(),onChange:e=>L(new Date(I.getFullYear(),Number(e.target.value),1)),children:v.map((t,n)=>(0,e.jsx)(`option`,{value:n,children:t},t))}),(0,e.jsx)(`input`,{className:g.yearInput,type:`number`,"aria-label":`Год`,value:I.getFullYear(),onChange:e=>L(new Date(Number(e.target.value),I.getMonth(),1))}),(0,e.jsx)(`button`,{type:`button`,className:g.nav,"aria-label":`Следующий месяц`,onClick:()=>L(new Date(I.getFullYear(),I.getMonth()+1,1)),children:`›`})]}),(0,e.jsx)(`div`,{className:g.weekdays,children:_.map(t=>(0,e.jsx)(`span`,{children:t},t))}),(0,e.jsx)(`div`,{className:g.days,children:ee.map(t=>{let r=T(n,t);return(0,e.jsx)(`button`,{type:`button`,className:`${g.day} ${t.getMonth()===I.getMonth()?``:g.outside} ${r?g.selected:``}`,disabled:E(t,m,h),"aria-pressed":r,onClick:()=>re(t),children:t.getDate()},t.toISOString())})})]}),ne&&(0,e.jsxs)(`label`,{className:g.timeLabel,children:[(0,e.jsx)(`span`,{children:`Время`}),(0,e.jsx)(`input`,{className:g.timeInput,type:`time`,value:R,onChange:e=>B(e.target.value)})]})]}),s&&!c&&(0,e.jsx)(p,{id:A,children:s}),c&&(0,e.jsx)(p,{id:j,variant:`error`,children:c})]})},O={root:`_root_9h2e2_1`,legend:`_legend_9h2e2_2`,range:`_range_9h2e2_3`},k=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),A=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:m=!1,className:h=``})=>{let g=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),k(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${O.root} ${h}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:O.range,children:[(0,e.jsx)(D,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,from:e})}),(0,e.jsx)(D,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,to:e})})]}),s&&!g&&(0,e.jsx)(p,{children:s})]})},j={group:`_group_1st6r_1`,skeleton:`_skeleton_1st6r_2`,text:`_text_1st6r_3`,rectangular:`_rectangular_1st6r_4`,circular:`_circular_1st6r_5`,animated:`_animated_1st6r_6`,"ds-skeleton":`_ds-skeleton_1st6r_1`},M=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${j.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(o,s)=>(0,e.jsx)(`span`,{className:`${j.skeleton} ${j[t]} ${a?j.animated:``}`,style:{width:s===i-1&&i>1?`70%`:n,height:r}},s))}),N={wrapper:`_wrapper_dkn63_1`,label:`_label_dkn63_17`,container:`_container_dkn63_29`,trigger:`_trigger_dkn63_37`,disabledText:`_disabledText_dkn63_39`,value:`_value_dkn63_109`,placeholder:`_placeholder_dkn63_111`,chevron:`_chevron_dkn63_137`,chevronOpen:`_chevronOpen_dkn63_163`,menu:`_menu_dkn63_171`,option:`_option_dkn63_207`,selected:`_selected_dkn63_245`,message:`_message_dkn63_265`,error:`_error_dkn63_267`,errorState:`_errorState_dkn63_293`},P=(e,t,n)=>{for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},F=({options:n,value:r,onChange:i,placeholder:a=`Выберите опцию`,disabled:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:f,id:p,needMark:m=!0,maxMenuHeight:h})=>{let g=(0,t.useId)(),_=p??`ds-dropdown-${f??g}`,[v,y]=(0,t.useState)(!1),b=(0,t.useRef)(null),x=(0,t.useRef)(null),S=(0,t.useRef)([]),C=(0,t.useMemo)(()=>n.find(e=>e.value===r),[n,r]),w=u?`${_}-hint`:void 0,T=l?`${_}-error`:void 0,E=[w,T].filter(Boolean).join(` `)||void 0,D=o&&s;(0,t.useEffect)(()=>{let e=e=>{b.current?.contains(e.target)||y(!1)},t=e=>{e.key===`Escape`&&v&&(y(!1),x.current?.focus())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[v]);let O=(e,t)=>{let r=P(n,e,t);S.current[r]?.focus(),S.current[r]?.scrollIntoView({block:`nearest`})},k=e=>{e.disabled||(i?.(e.value,e),y(!1),x.current?.focus())};return(0,e.jsxs)(`div`,{ref:b,className:[N.wrapper,l?N.errorState:``,d].filter(Boolean).join(` `),children:[c&&(0,e.jsx)(`label`,{htmlFor:D?void 0:_,className:N.label,children:c}),(0,e.jsx)(`div`,{className:N.container,children:D?(0,e.jsx)(`div`,{id:_,className:N.disabledText,"aria-describedby":E,children:C?.label??a}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`button`,{ref:x,id:_,type:`button`,name:f,className:N.trigger,disabled:o,"aria-haspopup":`listbox`,"aria-expanded":v,"aria-controls":`${_}-listbox`,"aria-describedby":E,"aria-invalid":!!l,onClick:()=>y(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),y(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>O(e.key===`ArrowDown`?0:n.length-1,t))}},children:[(0,e.jsx)(`span`,{className:C?N.value:N.placeholder,children:C?.label??a}),(0,e.jsx)(`span`,{className:`${N.chevron} ${v?N.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),v&&(0,e.jsx)(`ul`,{id:`${_}-listbox`,className:N.menu,role:`listbox`,"aria-label":c,style:{maxHeight:h},children:n.map((t,i)=>{let a=t.value===r;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{S.current[i]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:`${N.option} ${a?N.selected:``}`,onClick:()=>k(t),onKeyDown:e=>{if((e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),O(i+(e.key===`ArrowDown`?1:-1),e.key===`ArrowDown`?1:-1)),e.key===`Tab`&&y(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;O(e.key===`Home`?0:n.length-1,t)}},children:[(0,e.jsx)(`span`,{children:t.label}),a&&m&&(0,e.jsx)(`span`,{"aria-hidden":`true`,children:`✓`})]})},t.value)})})]})}),u&&!l&&(0,e.jsx)(`span`,{id:w,className:N.message,children:u}),l&&(0,e.jsx)(`span`,{id:T,className:N.error,children:l})]})},I=e=>`${e.id}:${e.direction}`,L=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:I({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:I({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(F,{options:c,value:n?I(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},R={root:`_root_i4d62_1`,tableWrap:`_tableWrap_i4d62_2`,table:`_table_i4d62_2`,sticky:`_sticky_i4d62_8`,sortButton:`_sortButton_i4d62_9`,state:`_state_i4d62_11`,cards:`_cards_i4d62_12`,mobileSort:`_mobileSort_i4d62_12`,card:`_card_i4d62_12`,spanTwo:`_spanTwo_i4d62_19`,default:`_default_i4d62_21`,tableOnMobile:`_tableOnMobile_i4d62_21`,wide:`_wide_i4d62_23`},z=(0,n.tableFeatures)({rowSortingFeature:n.rowSortingFeature,sortedRowModel:(0,n.createSortedRowModel)()}),ee=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1)for(let r of e)if(typeof r.accessor==`string`&&!(r.accessor in t[n]))return`В строке ${n+1} отсутствует колонка «${r.id}»`;return null},te=({columns:r,data:i,tableOnMobile:a=!1,breakpoint:o=`default`,sorting:s,onSortingChange:c,renderMobileCard:l,getRowId:u,caption:d,ariaLabel:f,loading:p=!1,error:m,emptyState:h=`Нет данных`,stickyHeader:g=!1,maxHeight:_,className:v=``})=>{let[y,b]=(0,t.useState)([]),x=s??y,S=(0,t.useMemo)(()=>ee(r,i),[r,i]),C=(0,t.useMemo)(()=>(0,n.createColumnHelper)(),[]),w=(0,t.useMemo)(()=>C.columns(r.map(e=>{let t=e.accessor;return C.accessor(typeof t==`function`?t:e=>e[t],{id:e.id,header:()=>e.header,cell:t=>e.cell?.(t.row.original,t.getValue())??String(t.getValue()??``),enableSorting:!0,sortDescFirst:e.sortDescFirst})})),[r,C]),T=(0,n.useTable)({features:z,columns:w,data:i,state:{sorting:x},onSortingChange:e=>{let t=typeof e==`function`?e(x):e;s===void 0&&b(t),c?.(t)},getRowId:u}),E=T.getRowModel().rows,D=r.map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),O=[R.root,o===`wide`?R.wide:R.default,a?R.tableOnMobile:``,v].filter(Boolean).join(` `),k=S??m;return(0,e.jsxs)(`section`,{className:O,"aria-busy":p,children:[!a&&!p&&!k&&E.length>0&&(0,e.jsx)(L,{className:R.mobileSort,options:D,value:x[0]?{id:x[0].id,direction:x[0].desc?`desc`:`asc`}:null,onChange:e=>T.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:R.tableWrap,style:{maxHeight:_},children:(0,e.jsxs)(`table`,{className:R.table,"aria-label":f,children:[d&&(0,e.jsx)(`caption`,{children:d}),(0,e.jsx)(`thead`,{className:g?R.sticky:``,children:T.getHeaderGroups().map(t=>(0,e.jsx)(`tr`,{children:t.headers.map(t=>{let n=t.column.getIsSorted();return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,children:(0,e.jsxs)(`button`,{type:`button`,className:R.sortButton,onClick:t.column.getToggleSortingHandler(),children:[(0,e.jsx)(T.FlexRender,{header:t}),(0,e.jsx)(`span`,{"aria-hidden":`true`,children:n===`asc`?`↑`:n===`desc`?`↓`:`↕`})]})},t.id)})},t.id))}),(0,e.jsx)(`tbody`,{children:p?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:r.length,children:(0,e.jsx)(M,{lines:3})})}):k?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:R.state,colSpan:r.length,children:k})}):E.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:R.state,colSpan:r.length,children:h})}):E.map(t=>(0,e.jsx)(`tr`,{children:t.getAllCells().map(t=>(0,e.jsx)(`td`,{children:(0,e.jsx)(T.FlexRender,{cell:t})},t.id))},t.id))})]})}),!a&&(0,e.jsx)(`div`,{className:R.cards,role:`list`,"aria-label":f??d,children:p?(0,e.jsx)(M,{lines:4}):k?(0,e.jsx)(`div`,{className:R.state,children:k}):E.length===0?(0,e.jsx)(`div`,{className:R.state,children:h}):E.map(t=>{if(l)return(0,e.jsx)(`div`,{role:`listitem`,children:l({row:t.original,columns:r})},t.id);let n=r.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),i=n.find(e=>e.mobile?.primary)??n.find(e=>e.mobile?.mobileVariant!==`actions`),a=e=>typeof e.accessor==`function`?e.accessor(t.original):t.original[e.accessor],o=e=>e.mobile?.renderMobile?.(t.original,a(e))??e.cell?.(t.original,a(e))??String(a(e)??``);return(0,e.jsxs)(`article`,{role:`listitem`,className:R.card,children:[(0,e.jsx)(`h3`,{children:i?o(i):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:n.filter(e=>e!==i&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?R.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:o(t)})]},t.id))}),n.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:o(t)},t.id))]},t.id)})})]})},ne=({options:n,value:r,onChange:i,placeholder:a=`Выберите опции`,disabled:o=!1,label:s,error:c,hint:l,className:u=``,name:d,id:f,closeOnSelect:p=!1,maxMenuHeight:m})=>{let h=(0,t.useId)(),g=f??`ds-dropdown-multiple-${d??h}`,[_,v]=(0,t.useState)(!1),y=(0,t.useRef)(null),b=(0,t.useRef)(null),x=(0,t.useRef)([]),S=(0,t.useMemo)(()=>n.filter(e=>r.includes(e.value)),[n,r]),C=S.map(e=>e.label).join(`, `),w=l?`${g}-hint`:void 0,T=c?`${g}-error`:void 0;(0,t.useEffect)(()=>{let e=e=>{y.current?.contains(e.target)||v(!1)},t=e=>{e.key===`Escape`&&_&&(v(!1),b.current?.focus())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[_]);let E=e=>{if(e.disabled)return;let t=r.includes(e.value)?r.filter(t=>t!==e.value):[...r,e.value];i?.(t,n.filter(e=>t.includes(e.value))),p&&(v(!1),b.current?.focus())},D=(e,t)=>{let r=P(n,e,t);x.current[r]?.focus(),x.current[r]?.scrollIntoView({block:`nearest`})};return(0,e.jsxs)(`div`,{ref:y,className:[N.wrapper,c?N.errorState:``,u].filter(Boolean).join(` `),children:[s&&(0,e.jsx)(`label`,{htmlFor:g,className:N.label,children:s}),(0,e.jsxs)(`div`,{className:N.container,children:[(0,e.jsxs)(`button`,{ref:b,id:g,type:`button`,name:d,className:N.trigger,disabled:o,"aria-haspopup":`listbox`,"aria-expanded":_,"aria-controls":`${g}-listbox`,"aria-describedby":[w,T].filter(Boolean).join(` `)||void 0,"aria-invalid":!!c,onClick:()=>v(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),v(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>D(e.key===`ArrowDown`?0:n.length-1,t))}},children:[(0,e.jsx)(`span`,{className:S.length?N.value:N.placeholder,children:C||a}),(0,e.jsx)(`span`,{className:`${N.chevron} ${_?N.chevronOpen:``}`,"aria-hidden":`true`,children:`⌄`})]}),_&&(0,e.jsx)(`ul`,{id:`${g}-listbox`,className:N.menu,role:`listbox`,"aria-label":s,"aria-multiselectable":`true`,style:{maxHeight:m},children:n.map((t,i)=>{let a=r.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{x.current[i]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:`${N.option} ${a?N.selected:``}`,onClick:()=>E(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;D(i+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;D(e.key===`Home`?0:n.length-1,t)}e.key===`Tab`&&v(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),(0,e.jsx)(`span`,{"aria-hidden":`true`,children:a?`✓`:``})]})},t.value)})})]}),l&&!c&&(0,e.jsx)(`span`,{id:w,className:N.message,children:l}),c&&(0,e.jsx)(`span`,{id:T,className:N.error,children:c})]})},re={approve:`M4 12l5 5L20 6`,reject:`M5 5l14 14M19 5L5 19`,edit:`M4 20h4L19 9l-4-4L4 16v4z`,cross:`M5 5l14 14M19 5L5 19`,chevron:`M6 9l6 6 6-6`,basket:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`,info:`M12 10v7m0-10v.01`,warning:`M12 4L3 20h18L12 4zm0 5v5m0 3v.01`},B=({name:t,title:n,width:r=24,height:i=24,...a})=>(0,e.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:r,height:i,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:n?`img`:void 0,"aria-hidden":!n||void 0,focusable:`false`,...a,children:[n&&(0,e.jsx)(`title`,{children:n}),(0,e.jsx)(`path`,{d:re[t]})]}),V={root:`_root_1897l_1`,header:`_header_1897l_11`,title:`_title_1897l_21`,dismiss:`_dismiss_1897l_28`,content:`_content_1897l_57`},ie=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${V.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:V.header,children:[(0,e.jsx)(s,{id:l,className:V.title,children:n}),i&&(0,e.jsx)(`button`,{type:`button`,className:V.dismiss,onClick:a,"aria-label":o,children:(0,e.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M5 5L15 15M15 5L5 15`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})})})]}),(0,e.jsx)(`div`,{className:V.content,children:r})]})},H={wrapper:`_wrapper_1bpdz_1`,control:`_control_1bpdz_3`,input:`_input_1bpdz_5`,disabledText:`_disabledText_1bpdz_5`,inputError:`_inputError_1bpdz_11`,clear:`_clear_1bpdz_13`},U=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:m=``,name:h,id:g,clearable:_=!0,required:v=!1,selectTextOnFocus:y=!1,onFocus:b,...x})=>{let S=(0,t.useId)(),C=g??`ds-input-${h??S}`,w=(0,t.useRef)(null),T=d?`${C}-hint`:void 0,E=u?`${C}-error`:void 0,D=String(n??``),O=[T,E].filter(Boolean).join(` `)||void 0;return(0,e.jsxs)(`div`,{className:`${H.wrapper} ${m}`,children:[l&&(0,e.jsx)(f,{htmlFor:C,required:v,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:C,className:H.disabledText,"aria-describedby":O,children:D||a}):(0,e.jsxs)(`div`,{className:H.control,children:[(0,e.jsx)(`input`,{ref:w,id:C,name:h,type:i,value:D,placeholder:a,disabled:o,readOnly:s,required:v,"aria-invalid":!!u,"aria-describedby":O,className:`${H.input} ${u?H.inputError:``}`,onChange:e=>{if(i===`number`){let t=e.target.value===``?``:Number(e.target.value);r?.(t,e);return}r?.(e.target.value,e)},onFocus:e=>{y&&e.currentTarget.value&&e.currentTarget.select(),b?.(e)},...x}),_&&D&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:H.clear,"aria-label":`Очистить поле`,onClick:()=>{let e=w.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:`×`})]}),d&&!u&&(0,e.jsx)(p,{id:T,children:d}),u&&(0,e.jsx)(p,{id:E,variant:`error`,children:u})]})},W={wrapper:`_wrapper_8srjz_1`,input:`_input_8srjz_11`,switch:`_switch_8srjz_18`,thumb:`_thumb_8srjz_34`,label:`_label_8srjz_56`,disabled:`_disabled_8srjz_62`},ae=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${W.wrapper} ${a?W.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:W.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:W.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:W.thumb})}),i&&(0,e.jsx)(`span`,{className:W.label,children:i})]})},G={root:`_root_kepgo_1`,grid:`_grid_kepgo_3`,actions:`_actions_kepgo_5`},oe=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let d=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${G.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:G.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`){let n={key:t.id,label:t.label,hint:t.hint,placeholder:t.placeholder,disabled:r};return t.inputType===`number`?(0,e.jsx)(U,{...n,type:`number`,value:i??``,onChange:e=>d(t.id,e)}):(0,e.jsx)(U,{...n,type:`text`,value:String(i??``),onChange:e=>d(t.id,e)})}if(t.type===`dropdown`)return(0,e.jsx)(F,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(ne,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(h,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(ae,{label:t.label,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(A,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>d(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:G.actions,children:[a&&(0,e.jsx)(u,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(u,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},se=0,K=(0,i.create)(e=>({modals:[],openModal:(t,n={},r={})=>{se+=1;let i=`ds-modal-${se}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0}]})),i},closeModal:t=>e(e=>({modals:e.modals.filter(e=>e.id!==t)})),closeTopModal:()=>e(e=>({modals:e.modals.slice(0,-1)})),closeAllModals:()=>e({modals:[]})})),ce=()=>K.setState({modals:[]}),q={layer:`_layer_bl99k_1`,backdrop:`_backdrop_bl99k_2`,panel:`_panel_bl99k_3`,header:`_header_bl99k_5`,title:`_title_bl99k_6`,description:`_description_bl99k_7`,content:`_content_bl99k_8`},le=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,J=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useId)(),d=(0,t.useId)(),f=(0,t.useRef)(null),p=K(e=>e.closeModal);return(0,t.useEffect)(()=>{let e=document.activeElement,t=f.current;return(t?.querySelector(le)??t)?.focus(),()=>e?.focus()},[]),(0,e.jsxs)(`div`,{ref:f,className:`${q.panel} ${s}`,role:c,"aria-modal":`true`,"aria-labelledby":r?l:void 0,"aria-describedby":i?d:void 0,tabIndex:-1,onKeyDown:e=>{if(e.key!==`Tab`)return;let t=Array.from(f.current?.querySelectorAll(le)??[]);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},children:[(r||o)&&(0,e.jsxs)(`header`,{className:q.header,children:[r&&(0,e.jsx)(`h2`,{id:l,className:q.title,children:r}),(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":o,onClick:()=>p(a),children:`×`})]}),i&&(0,e.jsx)(`p`,{id:d,className:q.description,children:i}),(0,e.jsx)(`div`,{className:q.content,children:n})]})},ue=({registry:n})=>{let i=K(e=>e.modals),a=K(e=>e.closeModal),o=K(e=>e.closeAllModals);return(0,t.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=K.getState().modals.at(-1);t?.closeOnEscape&&a(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),!i.length||typeof document>`u`?null:(0,r.createPortal)((0,e.jsx)(`div`,{className:q.layer,"aria-label":`Модальные окна`,children:i.map((t,r)=>{let s=n[t.name];return s?(0,e.jsx)(`div`,{className:q.backdrop,"aria-hidden":r!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&a(t.id)},children:(0,e.jsx)(s,{...t.payload,modalId:t.id,close:()=>a(t.id),closeAll:o})},t.id):null})}),document.body)},de=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=K(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)(ue,{registry:n})]})},fe=e=>e,Y={message:`_message_187g8_1`,actions:`_actions_187g8_2`},pe=new Map,me=0,he=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{pe.get(c)?.(e),pe.delete(c),n()};return(0,e.jsxs)(J,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:Y.message,children:i}),(0,e.jsxs)(`div`,{className:Y.actions,children:[(0,e.jsx)(u,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(u,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},ge=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)(J,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:Y.message,children:i}),(0,e.jsx)(`div`,{className:Y.actions,children:(0,e.jsx)(u,{onClick:n,children:a})})]}),_e=fe({ConfirmModal:he,ErrorModal:ge}),ve=()=>{let e=K(e=>e.openModal);return(t={})=>new Promise(n=>{me+=1;let r=`confirm-${me}`;pe.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1})})},ye=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,be=()=>{let e=K(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:ye(t)})}},xe=(0,i.create)(()=>({})),Se=(0,i.create)(()=>({})),Ce=()=>{let e=K(e=>e.modals),t=K(e=>e.openModal);return{openModal:(e,n={},r)=>t(e,n,r),closeModal:K(e=>e.closeModal),closeTopModal:K(e=>e.closeTopModal),closeAllModals:K(e=>e.closeAllModals),isOpen:t=>e.some(e=>e.name===t),count:e.length}},we={root:`_root_1j70j_1`},Te=({label:t=`Загрузка страницы`,className:n=``})=>(0,e.jsxs)(`div`,{className:`${we.root} ${n}`,role:`status`,"aria-label":t,children:[(0,e.jsx)(c,{decorative:!0}),(0,e.jsx)(`span`,{children:t})]}),Ee={root:`_root_ig8lp_1`,legend:`_legend_ig8lp_2`,range:`_range_ig8lp_3`},De=[{value:`1`,label:`День`},{value:`2`,label:`Неделя`},{value:`3`,label:`Месяц`}],Oe={day:1,week:2,month:3},ke=({value:t,onChange:n,label:r,hint:i,error:a,disabled:o=!1,min:s,max:c,className:l=``,periodTypeOptions:u=De})=>(0,e.jsxs)(`fieldset`,{className:`${Ee.root} ${l}`,disabled:o,children:[r&&(0,e.jsx)(`legend`,{className:Ee.legend,children:r}),(0,e.jsx)(F,{options:u,value:String(t.periodType),disabled:o,onChange:e=>n?.({...t,periodType:Number(e)}),label:`Тип периода`}),(0,e.jsxs)(`div`,{className:Ee.range,children:[(0,e.jsx)(D,{value:t.startDate,onChange:e=>n?.({...t,startDate:e}),label:`Начало`,min:s,max:c,disabled:o}),(0,e.jsx)(D,{value:t.endDate,onChange:e=>n?.({...t,endDate:e}),label:`Окончание`,min:t.startDate??s,max:c,disabled:o})]}),i&&!a&&(0,e.jsx)(p,{children:i}),a&&(0,e.jsx)(p,{variant:`error`,children:a})]}),X={viewport:`_viewport_v7rog_1`,"top-right":`_top-right_v7rog_2`,"top-left":`_top-left_v7rog_3`,"bottom-right":`_bottom-right_v7rog_4`,"bottom-left":`_bottom-left_v7rog_5`,toast:`_toast_v7rog_6`,body:`_body_v7rog_7`,icon:`_icon_v7rog_8`,info:`_info_v7rog_9`,success:`_success_v7rog_10`,warning:`_warning_v7rog_11`,error:`_error_v7rog_12`},Ae=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),o=(0,t.useRef)(n.duration),s=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||n.duration<=0)return;s.current=Date.now();let e=setTimeout(()=>r(n.id),o.current);return()=>{clearTimeout(e),o.current=Math.max(0,o.current-(Date.now()-s.current))}},[r,i,n.duration,n.id]),(0,e.jsxs)(`article`,{className:`${X.toast} ${X[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(B,{name:n.variant===`warning`?`warning`:`info`,className:X.icon}),(0,e.jsxs)(`div`,{className:X.body,children:[n.title&&(0,e.jsx)(`strong`,{children:n.title}),(0,e.jsx)(`div`,{children:n.message}),n.action&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:`×`})]})},je=0,Z=(0,i.create)(e=>({toasts:[],showToast:t=>{je+=1;let n=`ds-toast-${je}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...t,id:n}]})),n},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),Me=()=>Z.setState({toasts:[]}),Ne=({position:t=`top-right`})=>{let n=Z(e=>e.toasts),r=Z(e=>e.removeToast);return(0,e.jsx)(`div`,{className:`${X.viewport} ${X[t]}`,"aria-label":`Уведомления`,children:n.map(t=>(0,e.jsx)(Ae,{toast:t,onClose:r},t.id))})},Pe=()=>{let e=Z(e=>e.showToast),t=Z(e=>e.removeToast),n=Z(e=>e.clearToasts),r=t=>n=>e({...n,variant:t});return{showToast:e,infoToast:r(`info`),successToast:r(`success`),warningToast:r(`warning`),errorToast:r(`error`),removeToast:t,clearToasts:n}},Q={root:`_root_2bxal_1`,tooltip:`_tooltip_2bxal_2`,"ds-tooltip-in":`_ds-tooltip-in_2bxal_1`,top:`_top_2bxal_3`,bottom:`_bottom_2bxal_4`,left:`_left_2bxal_5`,right:`_right_2bxal_6`},Fe=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=()=>{o||!n||(f.current=setTimeout(()=>d(!0),a))},m=()=>{f.current&&clearTimeout(f.current),d(!1)};if((0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),f.current&&clearTimeout(f.current)}},[]),!(0,t.isValidElement)(r))return r;let h=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m});return(0,e.jsxs)(`span`,{className:`${Q.root} ${c}`,onPointerDown:u?m:p,children:[h,u&&(0,e.jsx)(`span`,{id:l,role:`tooltip`,className:`${Q.tooltip} ${Q[i]}`,style:{maxWidth:s},children:n})]})},$={root:`_root_tgni1_1`,frame:`_frame_tgni1_2`,video:`_video_tgni1_3`,overlay:`_overlay_tgni1_4`,error:`_error_tgni1_4`,caption:`_caption_tgni1_7`},Ie=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:l,fallback:u,className:d=``,controls:f=!0,playsInline:p=!0,...m})=>{let[h,g]=(0,t.useState)(!1),_=l??(h?`Не удалось воспроизвести видео`:void 0);return(0,e.jsxs)(`figure`,{className:`${$.root} ${d}`,children:[(0,e.jsxs)(`div`,{className:$.frame,style:{aspectRatio:a},children:[!_&&n.length>0&&(0,e.jsxs)(`video`,{...m,"aria-label":i,controls:f,playsInline:p,className:$.video,style:{objectFit:o},onError:e=>{g(!0),m.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),s&&(0,e.jsx)(`div`,{className:$.overlay,children:(0,e.jsx)(c,{label:`Загрузка видео`})}),(_||n.length===0)&&(0,e.jsx)(`div`,{className:$.error,role:`alert`,children:u??_??`Источник видео не указан`})]}),(0,e.jsx)(`figcaption`,{className:$.caption,children:i})]})};exports.ConfirmModal=he,exports.DSBadge=o,exports.DSButton=u,exports.DSCheckbox=h,exports.DSDataTable=te,exports.DSDateRange=A,exports.DSDateTimePicker=D,exports.DSDropDown=F,exports.DSDropDownMultiple=ne,exports.DSFieldLabel=f,exports.DSFieldMessage=p,exports.DSFilters=oe,exports.DSIcon=B,exports.DSInfoBlock=ie,exports.DSInput=U,exports.DSLoader=c,exports.DSModal=ue,exports.DSModalFrame=J,exports.DSPageLoader=Te,exports.DSRadioButton=ae,exports.DSSkeleton=M,exports.DSSort=L,exports.DSTimePeriodPicker=ke,exports.DSToast=Ae,exports.DSToastProvider=Ne,exports.DSTooltip=Fe,exports.DSVideoPlayerFrame=Ie,exports.DS_PERIOD_TYPE_CODES=Oe,exports.ErrorModal=ge,exports.ModalSystemProvider=de,exports.builtInModalRegistry=_e,exports.defineModalRegistry=fe,exports.formatDateTimeLocalValue=x,exports.getErrorMessage=ye,exports.getNextEnabledOptionIndex=P,exports.isValidDateRange=k,exports.parseDateTimeLocalValue=S,exports.resetModalStore=ce,exports.resetToastStore=Me,exports.useConfirmModal=ve,exports.useConfirmModalStore=xe,exports.useErrorModal=be,exports.useErrorModalStore=Se,exports.useModals=Ce,exports.useModalsStore=K,exports.useToast=Pe,exports.useToastStore=Z,exports.validateDSDataTableData=ee;
|