intelicoreact 2.0.4 → 2.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.
Files changed (39) hide show
  1. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.interface.d.ts +2 -1
  2. package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.interface.d.ts +3 -3
  3. package/dist/Atomic/FormElements/Switcher/Switcher.interface.d.ts +2 -1
  4. package/dist/Atomic/UI/AccordionText/AccordionText.interface.d.ts +13 -0
  5. package/dist/Atomic/UI/Alert/Alert.interface.d.ts +1 -1
  6. package/dist/Atomic/UI/Modal/index.d.ts +3 -0
  7. package/dist/Functions/sdk/runtime-sdk/client.d.ts +19 -0
  8. package/dist/Functions/sdk/runtime-sdk/config.d.ts +32 -0
  9. package/dist/Functions/sdk/runtime-sdk/index.d.ts +3 -0
  10. package/dist/Functions/sdk/runtime-sdk/queue.d.ts +70 -0
  11. package/dist/Functions/sdk/runtime-sdk/transport.d.ts +41 -0
  12. package/dist/Functions/sdk/runtime-sdk/types.d.ts +84 -0
  13. package/dist/Molecular/FormElement/FormElement.interface.d.ts +1 -1
  14. package/dist/Molecular/FormWithDependOn/FormWithDependOn.interface.d.ts +99 -0
  15. package/dist/classes.cjs +10 -8
  16. package/dist/classes.cjs.map +2 -2
  17. package/dist/classes.js +10 -8
  18. package/dist/classes.js.map +2 -2
  19. package/dist/form.cjs +1853 -1779
  20. package/dist/form.cjs.map +4 -4
  21. package/dist/form.d.ts +42 -17
  22. package/dist/form.js +1848 -1774
  23. package/dist/form.js.map +4 -4
  24. package/dist/index.cjs +2229 -2139
  25. package/dist/index.cjs.map +4 -4
  26. package/dist/index.js +2041 -1951
  27. package/dist/index.js.map +4 -4
  28. package/dist/sdk.cjs +451 -0
  29. package/dist/sdk.cjs.map +7 -0
  30. package/dist/sdk.d.ts +5 -0
  31. package/dist/sdk.js +429 -0
  32. package/dist/sdk.js.map +7 -0
  33. package/dist/ui.cjs +398 -366
  34. package/dist/ui.cjs.map +4 -4
  35. package/dist/ui.d.ts +11 -7
  36. package/dist/ui.js +270 -238
  37. package/dist/ui.js.map +4 -4
  38. package/package.json +11 -1
  39. package/sdk/package.json +5 -0
package/dist/form.cjs CHANGED
@@ -30,6 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var form_exports = {};
31
31
  __export(form_exports, {
32
32
  ALL_TIME_KEY: () => ALL_TIME_KEY,
33
+ ANDROID_CHROME_TEXT_CODE: () => ANDROID_CHROME_TEXT_CODE,
34
+ AccordionWithCheckbox: () => AccordionWithCheckbox_default,
33
35
  ActionAlert: () => ActionAlert_default2,
34
36
  AdvancedStatus: () => AdvancedStatus_default2,
35
37
  CUSTOM_INTERVAL_KEY: () => CUSTOM_INTERVAL_KEY,
@@ -37,69 +39,93 @@ __export(form_exports, {
37
39
  Calendar: () => Calendar_default,
38
40
  CheckboxInput: () => CheckboxInput_default2,
39
41
  CheckboxesLine: () => CheckboxesLine_default2,
42
+ DEFAULT_ERRORS: () => DEFAULT_ERRORS,
43
+ DIGIT_MASK_CHAR: () => DIGIT_MASK_CHAR,
44
+ DateInput: () => DateInput_default,
40
45
  Datepicker: () => Datepicker_default,
41
- Dropdown: () => Dropdown_default,
46
+ DatepickerCalendar: () => DatepickerCalendar_default,
47
+ Dropdown: () => Dropdown_default2,
42
48
  DropdownLiveSearch: () => DropdownLiveSearch_default,
49
+ EXCLUDED_KEYS: () => EXCLUDED_KEYS,
43
50
  FileLoader: () => FileLoader_default,
44
51
  FileLoaderDescription: () => FileLoaderDescription_default,
45
52
  FileLoaderLocal: () => FileLoaderLocal_default,
46
53
  FileLoaderLocalGroup: () => FileLoaderLocalGroup_default,
47
54
  FormElement: () => FormElement_default,
48
55
  FormWithDependOn: () => FormWithDependOn_default,
49
- FormattedRawSSN: () => FormattedRawSSN_default,
56
+ FormattedRawSSN: () => FormattedRawSSN_default2,
50
57
  INTERVALS: () => INTERVALS,
51
- Input: () => Input_default,
58
+ Input: () => Input_default2,
52
59
  InputAddress: () => InputAddress_default,
53
60
  InputCalendar: () => InputCalendar_default,
54
- InputColor: () => InputColor_default,
61
+ InputColor: () => InputColor_default2,
55
62
  InputCurrency: () => InputCurrency_default,
56
63
  InputCustomFetch: () => InputCustomFetch_default,
57
64
  InputDateRange: () => InputDateRange_default,
58
- InputLink: () => InputLink_default,
65
+ InputDateRangeDatepicker: () => Datepicker_default2,
66
+ InputLink: () => InputLink_default2,
59
67
  InputMask: () => InputMask_default,
60
68
  InputMask3: () => InputMask3_default,
61
69
  InputPassword: () => InputPassword_default,
62
- InputWithAction: () => InputWithAction_default,
63
- InputsRow: () => InputsRow_default,
70
+ InputWithAction: () => InputWithAction_default2,
71
+ InputsRow: () => InputsRow_default2,
72
+ LOWERCASE_LETTER_MASK_CHAR: () => LOWERCASE_LETTER_MASK_CHAR,
64
73
  Label: () => Label_default2,
74
+ LoadZone: () => LoadZone_default,
75
+ LoadedContent: () => LoadedContent_default,
65
76
  MAIN_DATE_FORMAT: () => MAIN_DATE_FORMAT,
66
77
  MAIN_FORMAT: () => MAIN_FORMAT,
67
78
  MAIN_TIME_FORMAT: () => MAIN_TIME_FORMAT,
68
- MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH: () => MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH,
69
79
  MobileCalendar: () => MobileCalendar_default,
70
80
  MultiSelect: () => MultiSelect_default,
71
81
  NumericInput: () => NumericInput_default,
82
+ OpenedPart: () => OpenedPart_default,
72
83
  RadioGroup: () => RadioGroup_default,
73
84
  RadioGroupWithInput: () => RadioGroupWithInput_default,
74
- RadioInput: () => RadioInput_default,
85
+ RadioInput: () => RadioInput_default2,
75
86
  RadioRowSwitcher: () => RadioRowSwitcher_default,
76
87
  RangeCalendar: () => RangeCalendar_default,
77
- RangeInputs: () => RangeInputs_default,
78
- RangeList: () => RangeList_default,
88
+ RangeInputs: () => RangeInputs_default2,
89
+ RangeList: () => RangeList_default2,
90
+ RangeListRow: () => RangeListRow_default,
79
91
  RangeSlider: () => RangeSlider,
80
92
  RangeSlider2: () => RangeSlider2_default,
93
+ SPACE_CHAR: () => SPACE_CHAR,
94
+ SelectItem: () => SelectItem_default,
81
95
  SwitchableRow: () => SwitchableRow_default,
82
- Switcher: () => Switcher_default,
96
+ Switcher: () => Switcher_default2,
83
97
  SwitcherCheckbox: () => SwitcherCheckbox_default,
84
- SwitcherHide: () => SwitcherHide_default,
85
- SwitcherRadio: () => SwitcherRadio_default,
86
- SwitcherRange: () => SwitcherRange_default,
98
+ SwitcherHide: () => SwitcherHide_default2,
99
+ SwitcherRadio: () => SwitcherRadio_default2,
100
+ SwitcherRange: () => SwitcherRange_default2,
87
101
  SwitcherRangeList: () => SwitcherRangeList_default,
88
102
  SwitcherTagsDropdown: () => SwitcherTagsDropdown_default,
89
103
  SwitcherTextarea: () => SwitcherTextarea_default,
90
104
  TagListToDropdown: () => TagListToDropdown_default,
91
105
  TagsDropdown: () => TagsDropdown_default,
92
- Text: () => Text_default,
106
+ Text: () => Text_default2,
93
107
  TextSwitcher: () => TextSwitcher_default,
94
108
  Textarea: () => Textarea_default,
95
- TieredCheckboxes: () => TieredCheckboxes_default,
109
+ TieredCheckboxes: () => TieredCheckboxes_default2,
96
110
  TimeRange: () => TimeRange_default2,
111
+ UPPERCASE_LETTER_MASK_CHAR: () => UPPERCASE_LETTER_MASK_CHAR,
97
112
  UserContacts: () => UserContacts_default2,
98
113
  VariantsListRadio: () => VariantsListRadio_default,
99
114
  WidgetPseudoTable: () => WidgetPseudoTable_default,
100
115
  WidgetWithSwitchableRows: () => WidgetWithSwitchableRows_default,
116
+ copyToClipboard: () => copyToClipboard,
101
117
  getActualDateRange: () => getActualDateRange,
102
- getIsDateValid: () => getIsDateValid
118
+ getIsDateValid: () => getIsDateValid,
119
+ getSelectionText: () => getSelectionText,
120
+ isDigit: () => isDigit,
121
+ isDigitMaskChar: () => isDigitMaskChar,
122
+ isLetter: () => isLetter,
123
+ isLetterMaskChar: () => isLetterMaskChar,
124
+ isLowerCaseLetter: () => isLowerCaseLetter,
125
+ isUpperCaseLetter: () => isUpperCaseLetter,
126
+ resetSelectionText: () => resetSelectionText,
127
+ selectElementContents: () => selectElementContents,
128
+ voidFn: () => voidFn
103
129
  });
104
130
  module.exports = __toCommonJS(form_exports);
105
131
 
@@ -596,6 +622,95 @@ var CheckboxesLine_default2 = CheckboxesLine_default;
596
622
  // src/Atomic/FormElements/CheckboxInput/index.ts
597
623
  var CheckboxInput_default2 = CheckboxInput_default;
598
624
 
625
+ // src/Atomic/FormElements/Datepicker/components/DatepickerCalendar.tsx
626
+ var import_jsx_runtime9 = require("react/jsx-runtime");
627
+ var import_classnames9 = __toESM(require("classnames"), 1);
628
+ var import_moment2 = __toESM(require("moment"), 1);
629
+ var import_react9 = require("react");
630
+ var Icon = __toESM(require("react-feather"), 1);
631
+ var DatepickerCalendar = ({
632
+ date,
633
+ setDate,
634
+ startDate,
635
+ endDate,
636
+ allowPrev = true,
637
+ allowNext = true,
638
+ onClick,
639
+ onHover,
640
+ startPrevDate,
641
+ endPrevDate,
642
+ limitRange
643
+ }) => {
644
+ const [days, setDays] = (0, import_react9.useState)({});
645
+ const title = (0, import_react9.useMemo)(() => `${(0, import_moment2.default)(date).format("MMM")} ${(0, import_moment2.default)(date).format("YYYY")}`, [date]);
646
+ (0, import_react9.useEffect)(() => {
647
+ const result = {};
648
+ const day = (0, import_moment2.default)(date).startOf("month");
649
+ const daysInMonth = day.daysInMonth();
650
+ for (let d = 0; d < daysInMonth; d++) {
651
+ let week = day.week();
652
+ if (day.month() === 11 && week === 1) week = 53;
653
+ if (day.month() === 0 && week === 53) week = 0;
654
+ if (!result[week]) result[week] = {};
655
+ result[week][day.weekday()] = { date: day.toDate() };
656
+ day.add(1, "d");
657
+ }
658
+ setDays(result);
659
+ }, [date]);
660
+ const renderDay = (week, dayOfWeek) => {
661
+ const day = days[+week]?.[dayOfWeek];
662
+ const isFutureDay = day && (0, import_moment2.default)(day.date).isAfter((0, import_moment2.default)(), "day");
663
+ const isPastDay = limitRange ? day && (0, import_moment2.default)(day.date).isBefore((0, import_moment2.default)().subtract(limitRange, "days"), "day") : null;
664
+ const isRangeEnd = day && ((0, import_moment2.default)(day.date).isSame(startDate, "day") || (0, import_moment2.default)(day.date).isSame((0, import_moment2.default)(endDate).subtract(1, "hour"), "day"));
665
+ const isRangeInside = day && startDate && endDate && (0, import_moment2.default)(day.date).isAfter(startDate, "day") && (0, import_moment2.default)(day.date).isBefore((0, import_moment2.default)(endDate).subtract(1, "hour"), "day");
666
+ const isPrevRangeEnd = day && ((0, import_moment2.default)(day.date).isSame(startPrevDate, "day") || (0, import_moment2.default)(day.date).isSame((0, import_moment2.default)(endPrevDate).subtract(1, "day"), "day"));
667
+ const isPrevRangeInside = day && startPrevDate && endPrevDate && (0, import_moment2.default)(day.date).isAfter(startPrevDate, "day") && (0, import_moment2.default)(day.date).isBefore((0, import_moment2.default)(endPrevDate).subtract(1, "day"), "day");
668
+ const classNames2 = (0, import_classnames9.default)(
669
+ "calendar__day",
670
+ { "calendar__day--clickable": day },
671
+ { "calendar__day--disabled": isFutureDay || isPastDay },
672
+ { "calendar__day--range-end": isRangeEnd },
673
+ { "calendar__day--range-inside": isRangeInside },
674
+ { "calendar__day--prev-range-end": isPrevRangeEnd },
675
+ { "calendar__day--prev-range-inside": isPrevRangeInside }
676
+ );
677
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
678
+ "div",
679
+ {
680
+ className: classNames2,
681
+ onClick: day && !isFutureDay ? () => onClick(day.date) : void 0,
682
+ onMouseOver: day && !isFutureDay ? () => onHover(day.date) : void 0,
683
+ onMouseLeave: () => onHover(null),
684
+ children: day && day.date.getDate()
685
+ },
686
+ `${week}_${dayOfWeek}`
687
+ );
688
+ };
689
+ const handlePrev = () => {
690
+ setDate((0, import_moment2.default)(date).subtract(1, "month").toDate());
691
+ };
692
+ const handleNext = () => {
693
+ setDate((0, import_moment2.default)(date).add(1, "month").toDate());
694
+ };
695
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "calendar", children: [
696
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "calendar-header", children: [
697
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "calendar-header__prev", children: allowPrev && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", "data-testid": "datepicker-calendar-prev", onClick: handlePrev, "aria-label": "Previous month", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon.ChevronLeft, { size: 16 }) }) }),
698
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "calendar-header__title", children: title }),
699
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "calendar-header__next", children: allowNext && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", "data-testid": "datepicker-calendar-next", onClick: handleNext, "aria-label": "Next month", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon.ChevronRight, { size: 16 }) }) })
700
+ ] }),
701
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "calendar__week", children: Array.from({ length: 7 }, (_, dayOfWeek) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
702
+ "div",
703
+ {
704
+ className: "calendar__day calendar__day--title",
705
+ children: (0, import_moment2.default)().weekday(dayOfWeek).format("dd").charAt(0)
706
+ },
707
+ `day-of-week_${dayOfWeek}`
708
+ )) }),
709
+ Object.keys(days).map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "calendar__week", children: Array.from({ length: 7 }, (_, dayOfWeek) => renderDay(week, dayOfWeek)) }, `week_${index}`))
710
+ ] });
711
+ };
712
+ var DatepickerCalendar_default = DatepickerCalendar;
713
+
599
714
  // src/Atomic/FormElements/Datepicker/Datepicker.tsx
600
715
  var import_jsx_runtime22 = require("react/jsx-runtime");
601
716
 
@@ -768,7 +883,7 @@ var Langs = {
768
883
  var Langs_default = Langs;
769
884
 
770
885
  // src/Atomic/FormElements/Dropdown/Dropdown.tsx
771
- var import_jsx_runtime14 = require("react/jsx-runtime");
886
+ var import_jsx_runtime15 = require("react/jsx-runtime");
772
887
 
773
888
  // src/Constants/index.constants.js
774
889
  var KEYBOARD_SERVICE_KEYS = [
@@ -846,7 +961,7 @@ var OS = {
846
961
  };
847
962
 
848
963
  // src/Functions/utils.js
849
- var import_react9 = require("react");
964
+ var import_react10 = require("react");
850
965
  var import_moment_timezone = __toESM(require("moment-timezone"), 1);
851
966
  var uuid = () => Date.now().toString(36) + Math.random().toString(36).substring(2);
852
967
  var getIsOnlyAnObject = (input) => {
@@ -876,7 +991,7 @@ var useOutsideToggle = (ref, setOut, open) => {
876
991
  setOut(open);
877
992
  }
878
993
  }
879
- (0, import_react9.useEffect)(() => {
994
+ (0, import_react10.useEffect)(() => {
880
995
  document.addEventListener("mouseup", handleClickOutside);
881
996
  return () => {
882
997
  document.removeEventListener("mouseup", handleClickOutside);
@@ -1407,21 +1522,21 @@ var formatToHideValuePartially = (value, settings) => {
1407
1522
  };
1408
1523
 
1409
1524
  // src/Atomic/FormElements/Input/Input.tsx
1410
- var import_jsx_runtime11 = require("react/jsx-runtime");
1525
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1411
1526
 
1412
1527
  // src/Atomic/Layout/Spinner/Spinner.tsx
1413
- var import_jsx_runtime9 = require("react/jsx-runtime");
1414
- var import_classnames9 = __toESM(require("classnames"), 1);
1528
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1529
+ var import_classnames10 = __toESM(require("classnames"), 1);
1415
1530
  var CN2 = "loader-box";
1416
1531
  var Spinner = ({ size = null, className, testId = CN2 }) => {
1417
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1532
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1418
1533
  "div",
1419
1534
  {
1420
1535
  role: "status",
1421
1536
  "aria-live": "polite",
1422
1537
  "aria-busy": "true",
1423
1538
  "data-testid": testId,
1424
- className: (0, import_classnames9.default)(
1539
+ className: (0, import_classnames10.default)(
1425
1540
  CN2,
1426
1541
  {
1427
1542
  j5: size !== "small",
@@ -1429,11 +1544,11 @@ var Spinner = ({ size = null, className, testId = CN2 }) => {
1429
1544
  },
1430
1545
  className
1431
1546
  ),
1432
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_classnames9.default)("lds-ring", { [`lds-ring_${size}`]: size }), children: [
1433
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", {}),
1434
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", {}),
1435
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", {}),
1436
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", {})
1547
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: (0, import_classnames10.default)("lds-ring", { [`lds-ring_${size}`]: size }), children: [
1548
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {}),
1549
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {}),
1550
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {}),
1551
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {})
1437
1552
  ] })
1438
1553
  }
1439
1554
  );
@@ -1441,11 +1556,11 @@ var Spinner = ({ size = null, className, testId = CN2 }) => {
1441
1556
  var Spinner_default = Spinner;
1442
1557
 
1443
1558
  // src/Atomic/UI/DynamicIcon/DynamicIcon.tsx
1444
- var import_jsx_runtime10 = require("react/jsx-runtime");
1445
- var import_react11 = require("react");
1559
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1560
+ var import_react12 = require("react");
1446
1561
  var DynamicIcon = ({ iconKey, ...props }) => {
1447
- const [Icon2, setIcon] = (0, import_react11.useState)(null);
1448
- (0, import_react11.useEffect)(() => {
1562
+ const [Icon2, setIcon] = (0, import_react12.useState)(null);
1563
+ (0, import_react12.useEffect)(() => {
1449
1564
  const fetchData = async () => {
1450
1565
  const FeatherIcons = await import("react-feather");
1451
1566
  const iconComponent = FeatherIcons[iconKey];
@@ -1453,21 +1568,21 @@ var DynamicIcon = ({ iconKey, ...props }) => {
1453
1568
  };
1454
1569
  fetchData();
1455
1570
  }, [iconKey]);
1456
- return Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon2, { ...props }) : null;
1571
+ return Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon2, { ...props }) : null;
1457
1572
  };
1458
1573
  var DynamicIcon_default = DynamicIcon;
1459
1574
 
1460
1575
  // src/Atomic/FormElements/Input/hooks/useErrorBlink.ts
1461
- var import_react12 = require("react");
1576
+ var import_react13 = require("react");
1462
1577
  var DEFAULT_BLINK_TIME = 100;
1463
1578
  function useErrorBlink({
1464
1579
  isUseErrorsBlink,
1465
1580
  blinkTime = DEFAULT_BLINK_TIME
1466
1581
  }) {
1467
- const [isAttemptToChange, setIsAttemptToChange] = (0, import_react12.useState)(false);
1468
- const [isToHighlightError, setIsToHighlightError] = (0, import_react12.useState)(false);
1469
- const [prevValue, setPreviousValue] = (0, import_react12.useState)("");
1470
- (0, import_react12.useEffect)(() => {
1582
+ const [isAttemptToChange, setIsAttemptToChange] = (0, import_react13.useState)(false);
1583
+ const [isToHighlightError, setIsToHighlightError] = (0, import_react13.useState)(false);
1584
+ const [prevValue, setPreviousValue] = (0, import_react13.useState)("");
1585
+ (0, import_react13.useEffect)(() => {
1471
1586
  if (!isAttemptToChange) return;
1472
1587
  let timerId = null;
1473
1588
  setIsToHighlightError(true);
@@ -1516,19 +1631,19 @@ function useErrorBlink({
1516
1631
  }
1517
1632
 
1518
1633
  // src/Atomic/FormElements/Input/hooks/useInputFocus.ts
1519
- var import_react13 = require("react");
1634
+ var import_react14 = require("react");
1520
1635
  function useInputFocus({
1521
1636
  isSelect,
1522
1637
  isFocusDefault = false,
1523
1638
  onFocus = () => {
1524
1639
  }
1525
1640
  }) {
1526
- const [isFocused, setIsFocused] = (0, import_react13.useState)(false);
1527
- const [isEditing, setEditing] = (0, import_react13.useState)(false);
1528
- (0, import_react13.useEffect)(() => {
1641
+ const [isFocused, setIsFocused] = (0, import_react14.useState)(false);
1642
+ const [isEditing, setEditing] = (0, import_react14.useState)(false);
1643
+ (0, import_react14.useEffect)(() => {
1529
1644
  setEditing(isSelect ?? false);
1530
1645
  }, [isSelect]);
1531
- (0, import_react13.useEffect)(() => {
1646
+ (0, import_react14.useEffect)(() => {
1532
1647
  if (typeof isFocusDefault === "boolean") {
1533
1648
  setIsFocused(isFocusDefault);
1534
1649
  setEditing(isFocusDefault);
@@ -1552,9 +1667,9 @@ function useInputFocus({
1552
1667
  }
1553
1668
 
1554
1669
  // src/Atomic/FormElements/Input/hooks/useInputHover.ts
1555
- var import_react14 = require("react");
1670
+ var import_react15 = require("react");
1556
1671
  function useInputHover() {
1557
- const [onInputHover, setOnInputHover] = (0, import_react14.useState)(false);
1672
+ const [onInputHover, setOnInputHover] = (0, import_react15.useState)(false);
1558
1673
  const handleMouseEnter = () => setOnInputHover(true);
1559
1674
  const handleMouseLeave = () => setOnInputHover(false);
1560
1675
  return {
@@ -1718,7 +1833,7 @@ function useInputValueProcessing({
1718
1833
  }
1719
1834
 
1720
1835
  // src/Atomic/FormElements/Input/hooks/useKeyboardHandling.ts
1721
- var import_react15 = require("react");
1836
+ var import_react16 = require("react");
1722
1837
  function useKeyboardHandling({
1723
1838
  onKeyDown,
1724
1839
  onKeyUp,
@@ -1726,7 +1841,7 @@ function useKeyboardHandling({
1726
1841
  setPreviousValue,
1727
1842
  value
1728
1843
  }) {
1729
- const [keyDownData, setKeyDownData] = (0, import_react15.useState)({
1844
+ const [keyDownData, setKeyDownData] = (0, import_react16.useState)({
1730
1845
  start: null,
1731
1846
  end: null,
1732
1847
  keyCode: null
@@ -1753,14 +1868,14 @@ function useKeyboardHandling({
1753
1868
  }
1754
1869
 
1755
1870
  // src/Atomic/FormElements/Input/Input.tsx
1756
- var import_classnames10 = __toESM(require("classnames"), 1);
1757
- var import_react16 = require("react");
1871
+ var import_classnames11 = __toESM(require("classnames"), 1);
1872
+ var import_react17 = require("react");
1758
1873
  function defaultCallback() {
1759
1874
  }
1760
1875
  function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defaultCallback, onBlur = defaultCallback, onFocus = defaultCallback, onKeyUp = defaultCallback, onKeyDown = defaultCallback, isNotBlinkErrors, isPriceInput, onlyNumbers, disabled, withDelete, value, placeholder, className, type = "text", mask, maskChar, formatChars, error, icon, iconDynamicKey, iconDynamicProps = {}, symbolsLimit, blinkTime, isFocusDefault = false, isNotValidateASCII = false, isNumericMobileKeyboard = false, isCropFirstNool = false, testId = "input", action, isUseAutoSelect = true, isReadOnly = false, isLoading = false, name, fieldKey, id, attributesOfNativeInput = {} }) {
1761
- const DynamicIconComponent = iconDynamicKey && !icon ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DynamicIcon_default, { iconKey: iconDynamicKey, ...iconDynamicProps }) : null;
1762
- const inputInnerRef = (0, import_react16.useRef)(null);
1763
- const inputRef = (0, import_react16.useMemo)(() => ref || inputInnerRef, [ref]);
1876
+ const DynamicIconComponent = iconDynamicKey && !icon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DynamicIcon_default, { iconKey: iconDynamicKey, ...iconDynamicProps }) : null;
1877
+ const inputInnerRef = (0, import_react17.useRef)(null);
1878
+ const inputRef = (0, import_react17.useMemo)(() => ref || inputInnerRef, [ref]);
1764
1879
  const isUseErrorsBlink = !isNotBlinkErrors && !mask;
1765
1880
  const inputName = name || fieldKey || id;
1766
1881
  const {
@@ -1825,7 +1940,7 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
1825
1940
  setIsFocused(false);
1826
1941
  setEditing(false);
1827
1942
  };
1828
- (0, import_react16.useEffect)(() => {
1943
+ (0, import_react17.useEffect)(() => {
1829
1944
  if (isEditing) inputRef?.current?.focus?.();
1830
1945
  }, [isEditing, isFocused]);
1831
1946
  const getInputType = () => {
@@ -1834,7 +1949,7 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
1834
1949
  };
1835
1950
  const uniProps = {
1836
1951
  name: inputName,
1837
- className: (0, import_classnames10.default)("input", className, {
1952
+ className: (0, import_classnames11.default)("input", className, {
1838
1953
  "input--with-icon": icon,
1839
1954
  "input--with-delete": withDelete
1840
1955
  }),
@@ -1850,11 +1965,11 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
1850
1965
  ...maskChar ? { maskChar } : {},
1851
1966
  ...formatChars ? { formatChars } : {}
1852
1967
  };
1853
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1968
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1854
1969
  "div",
1855
1970
  {
1856
1971
  "data-testid": testId,
1857
- className: (0, import_classnames10.default)(
1972
+ className: (0, import_classnames11.default)(
1858
1973
  `input__wrap`,
1859
1974
  { [`input__wrap_focus`]: isFocused },
1860
1975
  { [`input__wrap_error`]: error || isToHighlightError },
@@ -1863,7 +1978,7 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
1863
1978
  onMouseEnter: handleMouseEnter,
1864
1979
  onMouseLeave: handleMouseLeave,
1865
1980
  children: [
1866
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1981
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1867
1982
  "input",
1868
1983
  {
1869
1984
  readOnly: isReadOnly,
@@ -1885,14 +2000,14 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
1885
2000
  ),
1886
2001
  DynamicIconComponent ?? icon,
1887
2002
  action,
1888
- withDelete && onInputHover && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2003
+ withDelete && onInputHover && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1889
2004
  "span",
1890
2005
  {
1891
- className: (0, import_classnames10.default)(`input__close`, { hidden: !getSafelyValue(value) }),
2006
+ className: (0, import_classnames11.default)(`input__close`, { hidden: !getSafelyValue(value) }),
1892
2007
  onClick: handleToggleWithClear
1893
2008
  }
1894
2009
  ),
1895
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Spinner_default, { size: "small" })
2010
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner_default, { size: "small" })
1896
2011
  ]
1897
2012
  }
1898
2013
  );
@@ -1900,8 +2015,8 @@ function Input({ ref, blurTrim, autocomplete = "off", isSelect, onChange = defau
1900
2015
  var Input_default = Input;
1901
2016
 
1902
2017
  // src/Atomic/FormElements/RadioInput/RadioInput.tsx
1903
- var import_jsx_runtime12 = require("react/jsx-runtime");
1904
- var import_classnames11 = __toESM(require("classnames"), 1);
2018
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2019
+ var import_classnames12 = __toESM(require("classnames"), 1);
1905
2020
  var RC6 = "radio-input";
1906
2021
  var RadioInput = ({
1907
2022
  label,
@@ -1915,21 +2030,21 @@ var RadioInput = ({
1915
2030
  onChange,
1916
2031
  attributesOfNativeInput
1917
2032
  }) => {
1918
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2033
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1919
2034
  "label",
1920
2035
  {
1921
2036
  "data-testid": testId,
1922
- className: (0, import_classnames11.default)(RC6, className, { [`${RC6}_disabled`]: disabled }),
2037
+ className: (0, import_classnames12.default)(RC6, className, { [`${RC6}_disabled`]: disabled }),
1923
2038
  htmlFor: id,
1924
2039
  children: [
1925
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2040
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1926
2041
  "div",
1927
2042
  {
1928
- className: (0, import_classnames11.default)(`${RC6}__input`, {
2043
+ className: (0, import_classnames12.default)(`${RC6}__input`, {
1929
2044
  [`${RC6}__input--checked`]: checked === value
1930
2045
  }),
1931
2046
  children: [
1932
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2047
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1933
2048
  "input",
1934
2049
  {
1935
2050
  id,
@@ -1943,11 +2058,11 @@ var RadioInput = ({
1943
2058
  ...attributesOfNativeInput
1944
2059
  }
1945
2060
  ),
1946
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${RC6}__mark` })
2061
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `${RC6}__mark` })
1947
2062
  ]
1948
2063
  }
1949
2064
  ),
1950
- label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${RC6}__label`, children: label })
2065
+ label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `${RC6}__label`, children: label })
1951
2066
  ]
1952
2067
  }
1953
2068
  );
@@ -1955,18 +2070,18 @@ var RadioInput = ({
1955
2070
  var RadioInput_default = RadioInput;
1956
2071
 
1957
2072
  // src/Atomic/FormElements/Dropdown/components/DropdownLoader.js
1958
- var import_jsx_runtime13 = require("react/jsx-runtime");
1959
- var import_react18 = __toESM(require("react"), 1);
2073
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2074
+ var import_react19 = __toESM(require("react"), 1);
1960
2075
  var DropdownLoader = function({ variant = "" }) {
1961
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dropdown-loader-box j5", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2076
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dropdown-loader-box j5", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1962
2077
  "div",
1963
2078
  {
1964
2079
  className: `lds-ring${variant === "little" ? " lds-ring_little" : ""}`,
1965
2080
  children: [
1966
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", {}),
1967
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", {}),
1968
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", {}),
1969
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", {})
2081
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", {}),
2082
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", {}),
2083
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", {}),
2084
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", {})
1970
2085
  ]
1971
2086
  }
1972
2087
  ) });
@@ -1974,7 +2089,7 @@ var DropdownLoader = function({ variant = "" }) {
1974
2089
  var DropdownLoader_default = DropdownLoader;
1975
2090
 
1976
2091
  // src/Functions/useIsMobile/useIsMobile.ts
1977
- var import_react19 = require("react");
2092
+ var import_react20 = require("react");
1978
2093
  function useIsMobile({ isWithoutWidthCheck = false } = {}) {
1979
2094
  const isIPad = () => {
1980
2095
  const ua = navigator.userAgent || navigator.vendor || window.opera;
@@ -1985,8 +2100,8 @@ function useIsMobile({ isWithoutWidthCheck = false } = {}) {
1985
2100
  const getIsMobile = () => {
1986
2101
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || isIPad();
1987
2102
  };
1988
- const [isMobile, setIsMobile] = (0, import_react19.useState)(getIsMobile());
1989
- (0, import_react19.useEffect)(() => {
2103
+ const [isMobile, setIsMobile] = (0, import_react20.useState)(getIsMobile());
2104
+ (0, import_react20.useEffect)(() => {
1990
2105
  if (getIsMobile()) {
1991
2106
  setIsMobile(true);
1992
2107
  }
@@ -2074,59 +2189,59 @@ function getSortedOptions(data, sortAlphabetical = false) {
2074
2189
  }
2075
2190
 
2076
2191
  // src/Atomic/FormElements/Dropdown/useDropdown.tsx
2077
- var import_react20 = require("react");
2192
+ var import_react21 = require("react");
2078
2193
  function useDropdown({ id, fieldKey, value, sortAlphabetical, withMobileLogic, options, minItemsForShowMobileSearch, isSearchable: isSearchableProp, isDoNotPullOutListOfMainContainer } = {}) {
2079
2194
  const { isMobile: isMobileProp } = useIsMobile_default2();
2080
2195
  const isMobile = isMobileProp && withMobileLogic;
2081
- const [dropdownId] = (0, import_react20.useState)(
2196
+ const [dropdownId] = (0, import_react21.useState)(
2082
2197
  (id || fieldKey || Math.random().toString(16).slice(2)).toString()
2083
2198
  );
2084
- const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
2085
- const [valueToApply, setValueToApplyState] = (0, import_react20.useState)(null);
2086
- const valueToApplyRef = (0, import_react20.useRef)(null);
2199
+ const [isOpen, setIsOpen] = (0, import_react21.useState)(false);
2200
+ const [valueToApply, setValueToApplyState] = (0, import_react21.useState)(null);
2201
+ const valueToApplyRef = (0, import_react21.useRef)(null);
2087
2202
  const setValueToApply = (value2) => {
2088
2203
  valueToApplyRef.current = value2;
2089
2204
  setValueToApplyState(value2);
2090
2205
  };
2091
- const [searchValue, setSearchValue] = (0, import_react20.useState)();
2092
- const dropdownRef = (0, import_react20.useRef)(null);
2093
- const dropdownListRef = (0, import_react20.useRef)(null);
2094
- const dropdownFooterRef = (0, import_react20.useRef)(null);
2095
- const dropdownListWrapperRef = (0, import_react20.useRef)(null);
2096
- const searchInputRef = (0, import_react20.useRef)(null);
2097
- const wrapperRef = (0, import_react20.useRef)(null);
2098
- const [initListHeight, setInitListHeight] = (0, import_react20.useState)(null);
2099
- const [isSearchChanged, setIsSearchChanged] = (0, import_react20.useState)(false);
2100
- const [isSearchInputFocused, setIsSearchInputFocused] = (0, import_react20.useState)(false);
2101
- const [isScrollableList, setIsScrollableList] = (0, import_react20.useState)(false);
2102
- const [isFixedMaxHeight, setIsFixedMaxHeight] = (0, import_react20.useState)(false);
2103
- const [scrollTop, setScrollTop] = (0, import_react20.useState)(0);
2104
- const [scrollHeight, setScrollHeight] = (0, import_react20.useState)(1);
2105
- const [maxListContainerHeight, setMaxListContainerHeight] = (0, import_react20.useState)(0);
2106
- const totalOptionsLength = (0, import_react20.useMemo)(() => options ? getTotalOptions(options) : 0, [options]);
2107
- const isSearchable = (0, import_react20.useMemo)(() => {
2206
+ const [searchValue, setSearchValue] = (0, import_react21.useState)();
2207
+ const dropdownRef = (0, import_react21.useRef)(null);
2208
+ const dropdownListRef = (0, import_react21.useRef)(null);
2209
+ const dropdownFooterRef = (0, import_react21.useRef)(null);
2210
+ const dropdownListWrapperRef = (0, import_react21.useRef)(null);
2211
+ const searchInputRef = (0, import_react21.useRef)(null);
2212
+ const wrapperRef = (0, import_react21.useRef)(null);
2213
+ const [initListHeight, setInitListHeight] = (0, import_react21.useState)(null);
2214
+ const [isSearchChanged, setIsSearchChanged] = (0, import_react21.useState)(false);
2215
+ const [isSearchInputFocused, setIsSearchInputFocused] = (0, import_react21.useState)(false);
2216
+ const [isScrollableList, setIsScrollableList] = (0, import_react21.useState)(false);
2217
+ const [isFixedMaxHeight, setIsFixedMaxHeight] = (0, import_react21.useState)(false);
2218
+ const [scrollTop, setScrollTop] = (0, import_react21.useState)(0);
2219
+ const [scrollHeight, setScrollHeight] = (0, import_react21.useState)(1);
2220
+ const [maxListContainerHeight, setMaxListContainerHeight] = (0, import_react21.useState)(0);
2221
+ const totalOptionsLength = (0, import_react21.useMemo)(() => options ? getTotalOptions(options) : 0, [options]);
2222
+ const isSearchable = (0, import_react21.useMemo)(() => {
2108
2223
  return isMobile ? totalOptionsLength > (minItemsForShowMobileSearch || MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH) : isSearchableProp;
2109
2224
  }, [isMobile, isSearchableProp, totalOptionsLength, minItemsForShowMobileSearch, MIN_ITEMS_FOR_SHOW_MOBILE_SEARCH]);
2110
- const optionsWithOtherAtTheEnd = (0, import_react20.useMemo)(() => moveOtherToEnd(options ?? []), [options]);
2111
- const filteredGroups = (0, import_react20.useMemo)(() => optionsWithOtherAtTheEnd.map((item) => ({
2225
+ const optionsWithOtherAtTheEnd = (0, import_react21.useMemo)(() => moveOtherToEnd(options ?? []), [options]);
2226
+ const filteredGroups = (0, import_react21.useMemo)(() => optionsWithOtherAtTheEnd.map((item) => ({
2112
2227
  ...item,
2113
2228
  items: !isSearchable || !isSearchChanged ? item?.items : item.items?.slice().filter(
2114
2229
  (el) => el?.label?.toLowerCase().includes(searchValue?.toString()?.toLowerCase() || "") || !el?.value || el?.value === ""
2115
2230
  )
2116
2231
  })).filter((item) => (item.items?.length ?? 0) > 0), [optionsWithOtherAtTheEnd, searchValue, isSearchable, isSearchChanged]);
2117
- const filteredItems = (0, import_react20.useMemo)(() => optionsWithOtherAtTheEnd.filter((item) => !item.items?.length).filter((item) => {
2232
+ const filteredItems = (0, import_react21.useMemo)(() => optionsWithOtherAtTheEnd.filter((item) => !item.items?.length).filter((item) => {
2118
2233
  if (!isSearchable || !isSearchChanged) return true;
2119
2234
  return item?.label?.toLowerCase().includes(searchValue?.toString()?.toLowerCase() || "") || !item?.value || item?.value === "";
2120
2235
  }), [optionsWithOtherAtTheEnd, searchValue, isSearchable, isSearchChanged]);
2121
- const filteredOptions = (0, import_react20.useMemo)(() => [...filteredItems, ...filteredGroups], [filteredItems, filteredGroups]);
2122
- const selectedLabel = (0, import_react20.useMemo)(() => options?.find((el) => el.value === value)?.label ?? options?.reduce(
2236
+ const filteredOptions = (0, import_react21.useMemo)(() => [...filteredItems, ...filteredGroups], [filteredItems, filteredGroups]);
2237
+ const selectedLabel = (0, import_react21.useMemo)(() => options?.find((el) => el.value === value)?.label ?? options?.reduce(
2123
2238
  (acc, item) => {
2124
2239
  if (!acc?.length) return item.items?.find((el) => el.value === value)?.label ?? "";
2125
2240
  return acc;
2126
2241
  },
2127
2242
  ""
2128
2243
  ), [options, value]);
2129
- const postfixText = (0, import_react20.useMemo)(() => selectedLabel && filteredOptions.find((option) => option.value === value)?.postfix || null, [selectedLabel, filteredOptions, value]);
2244
+ const postfixText = (0, import_react21.useMemo)(() => selectedLabel && filteredOptions.find((option) => option.value === value)?.postfix || null, [selectedLabel, filteredOptions, value]);
2130
2245
  return {
2131
2246
  isMobile,
2132
2247
  dropdownId,
@@ -2176,8 +2291,8 @@ function useDropdown({ id, fieldKey, value, sortAlphabetical, withMobileLogic, o
2176
2291
  var useDropdown_default = useDropdown;
2177
2292
 
2178
2293
  // src/Atomic/FormElements/Dropdown/Dropdown.tsx
2179
- var import_classnames12 = __toESM(require("classnames"), 1);
2180
- var import_react21 = require("react");
2294
+ var import_classnames13 = __toESM(require("classnames"), 1);
2295
+ var import_react22 = require("react");
2181
2296
  var import_react_dom = require("react-dom");
2182
2297
  var import_react_feather2 = require("react-feather");
2183
2298
  var RC7 = "dropdown";
@@ -2315,7 +2430,7 @@ function Dropdown({
2315
2430
  onCancelClick();
2316
2431
  }
2317
2432
  };
2318
- const doScrollCallback = (0, import_react21.useCallback)(
2433
+ const doScrollCallback = (0, import_react22.useCallback)(
2319
2434
  (e) => {
2320
2435
  const {
2321
2436
  callback,
@@ -2428,16 +2543,16 @@ function Dropdown({
2428
2543
  options: getDependsTrigger ? newOptions : options
2429
2544
  };
2430
2545
  };
2431
- const modalBtnTrigger = (0, import_react21.useMemo)(() => entity && entity !== "" && typeof entity === "string", [entity]);
2432
- const depend = (0, import_react21.useMemo)(() => getDepends(modalBtnTrigger), [modalBtnTrigger, filteredOptions]);
2546
+ const modalBtnTrigger = (0, import_react22.useMemo)(() => entity && entity !== "" && typeof entity === "string", [entity]);
2547
+ const depend = (0, import_react22.useMemo)(() => getDepends(modalBtnTrigger), [modalBtnTrigger, filteredOptions]);
2433
2548
  const getMarkupForElement = (item, _index, optTestId) => {
2434
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2549
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2435
2550
  "button",
2436
2551
  {
2437
2552
  type: "button",
2438
2553
  "data-testid": `${testId}-${optTestId}-option`,
2439
2554
  onMouseDown: () => depend.onChange(item),
2440
- className: (0, import_classnames12.default)(
2555
+ className: (0, import_classnames13.default)(
2441
2556
  `${RC7}__list-item`,
2442
2557
  {
2443
2558
  [`${RC7}__list-item_active`]: item.value === (valueToApply ?? value),
@@ -2447,19 +2562,19 @@ function Dropdown({
2447
2562
  ),
2448
2563
  value: item?.value,
2449
2564
  children: [
2450
- !isMobile && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2565
+ !isMobile && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2451
2566
  "span",
2452
2567
  {
2453
- className: (0, import_classnames12.default)(`${RC7}__active-icon`, {
2568
+ className: (0, import_classnames13.default)(`${RC7}__active-icon`, {
2454
2569
  [`${RC7}__active-icon_active`]: item.value === value
2455
2570
  }),
2456
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_feather2.Check, {})
2571
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_feather2.Check, {})
2457
2572
  }
2458
2573
  ),
2459
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2574
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2460
2575
  "div",
2461
2576
  {
2462
- className: (0, import_classnames12.default)(`${RC7}__list-item-label`, item.labelClassName || ""),
2577
+ className: (0, import_classnames13.default)(`${RC7}__list-item-label`, item.labelClassName || ""),
2463
2578
  dangerouslySetInnerHTML: {
2464
2579
  __html: getPreparedOptionLabel2(
2465
2580
  item.label,
@@ -2470,19 +2585,19 @@ function Dropdown({
2470
2585
  }
2471
2586
  ),
2472
2587
  item?.icon || "",
2473
- isMobile ? item?.customMobileIcon ?? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RadioInput_default, { value: item.value, checked: valueToApply ?? value }) : ""
2588
+ isMobile ? item?.customMobileIcon ?? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadioInput_default, { value: item.value, checked: valueToApply ?? value }) : ""
2474
2589
  ]
2475
2590
  },
2476
2591
  item.value?.toString()?.replace(/ /g, "_")
2477
2592
  );
2478
2593
  };
2479
2594
  const filteredOptionList = (filteredOption) => {
2480
- return (filteredOption.items?.length ?? 0) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2595
+ return (filteredOption.items?.length ?? 0) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2481
2596
  "div",
2482
2597
  {
2483
- className: (0, import_classnames12.default)(`${RC7}-group`, filteredOption.className),
2598
+ className: (0, import_classnames13.default)(`${RC7}-group`, filteredOption.className),
2484
2599
  children: [
2485
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `${RC7}-group__name`, children: filteredOption.label }),
2600
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `${RC7}-group__name`, children: filteredOption.label }),
2486
2601
  filteredOption.items?.map(
2487
2602
  (el, index) => getMarkupForElement(el, index, (el?.testId || index)?.toString())
2488
2603
  )
@@ -2492,44 +2607,44 @@ function Dropdown({
2492
2607
  ) : null;
2493
2608
  };
2494
2609
  const getListMarkUp = () => {
2495
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2610
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2496
2611
  "div",
2497
2612
  {
2498
2613
  "data-testid": `${testId}-container-wrapper`,
2499
- className: (0, import_classnames12.default)(`${RC7}__container-wrapper`),
2614
+ className: (0, import_classnames13.default)(`${RC7}__container-wrapper`),
2500
2615
  ref: wrapperRef,
2501
2616
  onClick: isMobile ? onWrapperClick : () => {
2502
2617
  },
2503
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2618
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2504
2619
  "div",
2505
2620
  {
2506
- className: (0, import_classnames12.default)(`${RC7}__list-wrapper`, {
2621
+ className: (0, import_classnames13.default)(`${RC7}__list-wrapper`, {
2507
2622
  [`${RC7}__list-wrapper--fixed-height`]: isFixedMaxHeight,
2508
2623
  [`${RC7}__list-wrapper--with-bottom-shadow`]: isScrollableList && isMobile && !footerContent,
2509
2624
  [`${RC7}__list-wrapper--with-bottom-shadow-hidden`]: scrollTop === scrollHeight && !footerContent
2510
2625
  }),
2511
2626
  ref: dropdownListWrapperRef,
2512
2627
  children: [
2513
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2628
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2514
2629
  "div",
2515
2630
  {
2516
- className: (0, import_classnames12.default)(`${RC7}__list-header`, {
2631
+ className: (0, import_classnames13.default)(`${RC7}__list-header`, {
2517
2632
  [`${RC7}__list-header-with-shadow`]: isScrollableList && isMobile,
2518
2633
  [`${RC7}__list-header-with-shadow-hidden`]: scrollTop === 0
2519
2634
  }),
2520
2635
  children: [
2521
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: (0, import_classnames12.default)(`${RC7}__list-header-row`), children: [
2522
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_classnames12.default)(`${RC7}__list-label`), children: label }),
2523
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2636
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_classnames13.default)(`${RC7}__list-header-row`), children: [
2637
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)(`${RC7}__list-label`), children: label }),
2638
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2524
2639
  "div",
2525
2640
  {
2526
- className: (0, import_classnames12.default)(`${RC7}__list-close-icon`),
2641
+ className: (0, import_classnames13.default)(`${RC7}__list-close-icon`),
2527
2642
  onClick: onCancelClick,
2528
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_feather2.X, { onClick: onCancelClick })
2643
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_feather2.X, { onClick: onCancelClick })
2529
2644
  }
2530
2645
  )
2531
2646
  ] }),
2532
- isSearchable && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_classnames12.default)(`${RC7}__list-header-row`), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2647
+ isSearchable && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)(`${RC7}__list-header-row`), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2533
2648
  Input_default,
2534
2649
  {
2535
2650
  ref: searchInputRef,
@@ -2545,10 +2660,10 @@ function Dropdown({
2545
2660
  ]
2546
2661
  }
2547
2662
  ),
2548
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2663
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2549
2664
  "div",
2550
2665
  {
2551
- className: (0, import_classnames12.default)(`${RC7}__list`, {
2666
+ className: (0, import_classnames13.default)(`${RC7}__list`, {
2552
2667
  [`${RC7}__list-top`]: isListTop,
2553
2668
  [`${RC7}__list--with-footer`]: footerContent
2554
2669
  }),
@@ -2571,16 +2686,16 @@ function Dropdown({
2571
2686
  }
2572
2687
  return null;
2573
2688
  }),
2574
- !filteredItems?.length && !filteredGroups?.length && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `${RC7}__list-item ${RC7}__list-item--no-options`, children: noOptionsText }),
2575
- disabled && isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownLoader_default, {})
2689
+ !filteredItems?.length && !filteredGroups?.length && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `${RC7}__list-item ${RC7}__list-item--no-options`, children: noOptionsText }),
2690
+ disabled && isOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownLoader_default, {})
2576
2691
  ]
2577
2692
  }
2578
2693
  ),
2579
- footerContent && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2694
+ footerContent && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2580
2695
  "div",
2581
2696
  {
2582
2697
  ref: dropdownFooterRef,
2583
- className: (0, import_classnames12.default)(`${RC7}__footer`, {
2698
+ className: (0, import_classnames13.default)(`${RC7}__footer`, {
2584
2699
  [`${RC7}__footer-with-shadow`]: isMobile && isScrollableList,
2585
2700
  [`${RC7}__footer-with-shadow-hidden`]: scrollTop === scrollHeight
2586
2701
  }),
@@ -2598,7 +2713,7 @@ function Dropdown({
2598
2713
  if (!lc) return null;
2599
2714
  return (0, import_react_dom.createPortal)(getListMarkUp(), lc);
2600
2715
  };
2601
- (0, import_react21.useEffect)(() => {
2716
+ (0, import_react22.useEffect)(() => {
2602
2717
  document.addEventListener("click", handleClickOutside, true);
2603
2718
  return () => {
2604
2719
  getListContainer2()?.remove();
@@ -2606,13 +2721,13 @@ function Dropdown({
2606
2721
  document.removeEventListener("click", handleClickOutside, true);
2607
2722
  };
2608
2723
  }, []);
2609
- (0, import_react21.useEffect)(() => {
2724
+ (0, import_react22.useEffect)(() => {
2610
2725
  if (!isDoNotPullOutListOfMainContainer || dropdownRef.current) {
2611
2726
  initListContainer();
2612
2727
  if (isDefaultOpened && !isMobile || isDefaultOpenedMobile) setIsOpen(true);
2613
2728
  }
2614
2729
  }, [isDoNotPullOutListOfMainContainer, dropdownRef.current]);
2615
- (0, import_react21.useLayoutEffect)(() => {
2730
+ (0, import_react22.useLayoutEffect)(() => {
2616
2731
  if (!isMobile) {
2617
2732
  window.addEventListener("resize", setListContainerStyles);
2618
2733
  window.addEventListener("mousewheel", closeList);
@@ -2633,7 +2748,7 @@ function Dropdown({
2633
2748
  getListContainer2()?.removeEventListener("click", closeList);
2634
2749
  };
2635
2750
  }, [getListContainer2]);
2636
- (0, import_react21.useLayoutEffect)(() => {
2751
+ (0, import_react22.useLayoutEffect)(() => {
2637
2752
  setListContainerStyles();
2638
2753
  }, [
2639
2754
  maxListContainerHeight,
@@ -2643,7 +2758,7 @@ function Dropdown({
2643
2758
  isFixedMaxHeight,
2644
2759
  options
2645
2760
  ]);
2646
- (0, import_react21.useEffect)(() => {
2761
+ (0, import_react22.useEffect)(() => {
2647
2762
  const fn = isOpen ? "addEventListener" : "removeEventListener";
2648
2763
  cancelButtonRef?.current?.[fn]("click", onCancelClick, true);
2649
2764
  applyButtonRef?.current?.[fn]("click", onApplyClick, true);
@@ -2659,7 +2774,7 @@ function Dropdown({
2659
2774
  removeEventListener("scroll", doScrollCallback);
2660
2775
  };
2661
2776
  }, [isOpen, dropdownListRef]);
2662
- (0, import_react21.useEffect)(() => {
2777
+ (0, import_react22.useEffect)(() => {
2663
2778
  let timeout;
2664
2779
  if (!searchValue && isSearchInputFocused && !isMobile) {
2665
2780
  setSearchValue(selectedLabel);
@@ -2672,7 +2787,7 @@ function Dropdown({
2672
2787
  clearTimeout(timeout);
2673
2788
  };
2674
2789
  }, [isSearchInputFocused]);
2675
- (0, import_react21.useEffect)(() => {
2790
+ (0, import_react22.useEffect)(() => {
2676
2791
  if (isOpen && !isSearchInputFocused && searchInputRef?.current && !isMobile)
2677
2792
  searchInputRef.current?.focus();
2678
2793
  if (isOpen) {
@@ -2689,7 +2804,7 @@ function Dropdown({
2689
2804
  setSearchValue(null);
2690
2805
  }
2691
2806
  }, [isOpen]);
2692
- (0, import_react21.useEffect)(() => {
2807
+ (0, import_react22.useEffect)(() => {
2693
2808
  const dropdownListEl = getListContainer2()?.getElementsByClassName("dropdown__list")[0];
2694
2809
  if (!isMobile && dropdownListEl) {
2695
2810
  const handleWheel = (e) => {
@@ -2714,7 +2829,7 @@ function Dropdown({
2714
2829
  return () => {
2715
2830
  };
2716
2831
  }, [isOpen, isMobile, getListContainer2()]);
2717
- (0, import_react21.useEffect)(() => {
2832
+ (0, import_react22.useEffect)(() => {
2718
2833
  if (isOpen && isMobile && dropdownListRef?.current && !searchValue) {
2719
2834
  setIsScrollableList(
2720
2835
  dropdownListRef?.current?.scrollHeight > dropdownListRef?.current?.clientHeight
@@ -2731,7 +2846,7 @@ function Dropdown({
2731
2846
  dropdownListRef?.current?.scrollHeight,
2732
2847
  dropdownListRef?.current?.clientHeight
2733
2848
  ]);
2734
- (0, import_react21.useEffect)(() => {
2849
+ (0, import_react22.useEffect)(() => {
2735
2850
  const setScrollTopValue = (e) => {
2736
2851
  setScrollTop(Number.parseInt(e?.target?.scrollTop?.toString(), 10));
2737
2852
  };
@@ -2747,7 +2862,7 @@ function Dropdown({
2747
2862
  }
2748
2863
  };
2749
2864
  }, [isOpen, isMobile, dropdownListRef?.current]);
2750
- (0, import_react21.useEffect)(() => {
2865
+ (0, import_react22.useEffect)(() => {
2751
2866
  if (dropdownListRef?.current) {
2752
2867
  setScrollHeight(
2753
2868
  Number.parseInt(
@@ -2758,10 +2873,10 @@ function Dropdown({
2758
2873
  }
2759
2874
  }, [scrollTop, dropdownListRef?.current]);
2760
2875
  if (!options) return null;
2761
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2876
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2762
2877
  "div",
2763
2878
  {
2764
- className: (0, import_classnames12.default)(RC7, className, {
2879
+ className: (0, import_classnames13.default)(RC7, className, {
2765
2880
  disabled,
2766
2881
  [`${RC7}-mobile`]: isMobile,
2767
2882
  [`${RC7}--focused`]: isOpen && !isMobile,
@@ -2771,12 +2886,12 @@ function Dropdown({
2771
2886
  onKeyDown,
2772
2887
  onKeyUp,
2773
2888
  children: [
2774
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2889
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2775
2890
  "button",
2776
2891
  {
2777
2892
  type: "button",
2778
2893
  "data-testid": testId,
2779
- className: (0, import_classnames12.default)(`${RC7}__trigger`, "input__wrap", {
2894
+ className: (0, import_classnames13.default)(`${RC7}__trigger`, "input__wrap", {
2780
2895
  [`${RC7}__trigger--with-actions`]: withActions,
2781
2896
  placeholder: value === null || value === void 0 || value === "",
2782
2897
  error
@@ -2785,8 +2900,8 @@ function Dropdown({
2785
2900
  onKeyDown,
2786
2901
  onKeyUp,
2787
2902
  tabIndex,
2788
- children: customTrigger || /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2789
- isSearchable && !isMobile ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2903
+ children: customTrigger || /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2904
+ isSearchable && !isMobile ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2790
2905
  "input",
2791
2906
  {
2792
2907
  ref: searchInputRef,
@@ -2797,38 +2912,38 @@ function Dropdown({
2797
2912
  onFocus: () => setIsSearchInputFocused(true),
2798
2913
  onBlur: () => setIsSearchInputFocused(false)
2799
2914
  }
2800
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2801
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text", children: selectedLabel || placeholder || "" }),
2802
- postfixText && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "dropdown__list-item-postfix", children: postfixText })
2915
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2916
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text", children: selectedLabel || placeholder || "" }),
2917
+ postfixText && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dropdown__list-item-postfix", children: postfixText })
2803
2918
  ] }),
2804
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2919
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2805
2920
  "span",
2806
2921
  {
2807
- className: (0, import_classnames12.default)(`${RC7}__arrow`, {
2922
+ className: (0, import_classnames13.default)(`${RC7}__arrow`, {
2808
2923
  [`${RC7}__arrow_active`]: isOpen
2809
2924
  }),
2810
2925
  onClick: toggleList,
2811
- children: isMobile ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_feather2.Code, { className: "mobile-icon" }) : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_feather2.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_feather2.ChevronDown, {})
2926
+ children: isMobile ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_feather2.Code, { className: "mobile-icon" }) : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_feather2.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_feather2.ChevronDown, {})
2812
2927
  }
2813
2928
  )
2814
2929
  ] })
2815
2930
  }
2816
2931
  ),
2817
- withActions && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: (0, import_classnames12.default)(`${RC7}__actions`), children: [
2818
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2932
+ withActions && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_classnames13.default)(`${RC7}__actions`), children: [
2933
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2819
2934
  "div",
2820
2935
  {
2821
- className: (0, import_classnames12.default)(`${RC7}__actions-item`),
2936
+ className: (0, import_classnames13.default)(`${RC7}__actions-item`),
2822
2937
  onClick: onActionConfirmClick,
2823
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_feather2.Check, {})
2938
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_feather2.Check, {})
2824
2939
  }
2825
2940
  ),
2826
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2941
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2827
2942
  "div",
2828
2943
  {
2829
- className: (0, import_classnames12.default)(`${RC7}__actions-item`),
2944
+ className: (0, import_classnames13.default)(`${RC7}__actions-item`),
2830
2945
  onClick: onActionCancelClick,
2831
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_feather2.X, {})
2946
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_feather2.X, {})
2832
2947
  }
2833
2948
  )
2834
2949
  ] }),
@@ -2840,15 +2955,15 @@ function Dropdown({
2840
2955
  var Dropdown_default = Dropdown;
2841
2956
 
2842
2957
  // src/Atomic/FormElements/Switcher/Switcher.tsx
2843
- var import_jsx_runtime20 = require("react/jsx-runtime");
2958
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2844
2959
 
2845
2960
  // src/Atomic/UI/Hint/Hint.tsx
2846
- var import_jsx_runtime19 = require("react/jsx-runtime");
2961
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2847
2962
 
2848
2963
  // src/Molecular/CustomIcons/components/Check2.tsx
2849
- var import_jsx_runtime15 = require("react/jsx-runtime");
2964
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2850
2965
  function Check2(props) {
2851
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2966
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2852
2967
  "svg",
2853
2968
  {
2854
2969
  xmlns: "http://www.w3.org/2000/svg",
@@ -2856,15 +2971,15 @@ function Check2(props) {
2856
2971
  height: 16,
2857
2972
  fill: "none",
2858
2973
  ...props,
2859
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { stroke: "#000", d: "M13.333 4 6 11.333 2.667 8" })
2974
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { stroke: "#000", d: "M13.333 4 6 11.333 2.667 8" })
2860
2975
  }
2861
2976
  );
2862
2977
  }
2863
2978
 
2864
2979
  // src/Molecular/CustomIcons/components/Email.tsx
2865
- var import_jsx_runtime16 = require("react/jsx-runtime");
2980
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2866
2981
  function Email(props) {
2867
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2982
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2868
2983
  "svg",
2869
2984
  {
2870
2985
  xmlns: "http://www.w3.org/2000/svg",
@@ -2873,7 +2988,7 @@ function Email(props) {
2873
2988
  fill: "none",
2874
2989
  ...props,
2875
2990
  children: [
2876
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2991
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2877
2992
  "mask",
2878
2993
  {
2879
2994
  id: "a",
@@ -2883,27 +2998,27 @@ function Email(props) {
2883
2998
  y: 0,
2884
2999
  maskUnits: "userSpaceOnUse",
2885
3000
  children: [
2886
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3001
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2887
3002
  "path",
2888
3003
  {
2889
3004
  stroke: "#000",
2890
3005
  d: "M2.667 2.667h10.666c.734 0 1.334.6 1.334 1.333v8c0 .733-.6 1.333-1.334 1.333H2.667c-.734 0-1.334-.6-1.334-1.333V4c0-.733.6-1.333 1.334-1.333Z"
2891
3006
  }
2892
3007
  ),
2893
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { stroke: "#000", d: "M14.667 4 8 8.667 1.333 4" })
3008
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { stroke: "#000", d: "M14.667 4 8 8.667 1.333 4" })
2894
3009
  ]
2895
3010
  }
2896
3011
  ),
2897
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { mask: "url(#a)", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { fill: "#1F7499", d: "M0 0h16v16H0z" }) })
3012
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("g", { mask: "url(#a)", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { fill: "#1F7499", d: "M0 0h16v16H0z" }) })
2898
3013
  ]
2899
3014
  }
2900
3015
  );
2901
3016
  }
2902
3017
 
2903
3018
  // src/Molecular/CustomIcons/components/HelpCircleFilled.tsx
2904
- var import_jsx_runtime17 = require("react/jsx-runtime");
3019
+ var import_jsx_runtime18 = require("react/jsx-runtime");
2905
3020
  function HelpCircleFilled(props) {
2906
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3021
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2907
3022
  "svg",
2908
3023
  {
2909
3024
  xmlns: "http://www.w3.org/2000/svg",
@@ -2912,14 +3027,14 @@ function HelpCircleFilled(props) {
2912
3027
  fill: "none",
2913
3028
  ...props,
2914
3029
  children: [
2915
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3030
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2916
3031
  "path",
2917
3032
  {
2918
3033
  fill: "#9AA0B9",
2919
3034
  d: "M8 14.667A6.667 6.667 0 1 0 8 1.333a6.667 6.667 0 0 0 0 13.334Z"
2920
3035
  }
2921
3036
  ),
2922
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3037
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2923
3038
  "path",
2924
3039
  {
2925
3040
  stroke: "#fff",
@@ -2932,9 +3047,9 @@ function HelpCircleFilled(props) {
2932
3047
  }
2933
3048
 
2934
3049
  // src/Molecular/CustomIcons/components/Phone.tsx
2935
- var import_jsx_runtime18 = require("react/jsx-runtime");
3050
+ var import_jsx_runtime19 = require("react/jsx-runtime");
2936
3051
  function Phone(props) {
2937
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3052
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2938
3053
  "svg",
2939
3054
  {
2940
3055
  xmlns: "http://www.w3.org/2000/svg",
@@ -2943,7 +3058,7 @@ function Phone(props) {
2943
3058
  fill: "none",
2944
3059
  ...props,
2945
3060
  children: [
2946
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3061
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2947
3062
  "mask",
2948
3063
  {
2949
3064
  id: "a",
@@ -2952,7 +3067,7 @@ function Phone(props) {
2952
3067
  x: 0,
2953
3068
  y: 0,
2954
3069
  maskUnits: "userSpaceOnUse",
2955
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3070
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2956
3071
  "path",
2957
3072
  {
2958
3073
  stroke: "#000",
@@ -2961,7 +3076,7 @@ function Phone(props) {
2961
3076
  )
2962
3077
  }
2963
3078
  ),
2964
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("g", { mask: "url(#a)", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#1F7499", d: "M0 0h16v16H0z" }) })
3079
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { mask: "url(#a)", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { fill: "#1F7499", d: "M0 0h16v16H0z" }) })
2965
3080
  ]
2966
3081
  }
2967
3082
  );
@@ -3010,8 +3125,8 @@ function HandleClickOutsideObj(id, setIsOpen) {
3010
3125
  }
3011
3126
 
3012
3127
  // src/Atomic/UI/Hint/Hint.tsx
3013
- var import_classnames13 = __toESM(require("classnames"), 1);
3014
- var import_react22 = require("react");
3128
+ var import_classnames14 = __toESM(require("classnames"), 1);
3129
+ var import_react23 = require("react");
3015
3130
  var import_react_dom2 = require("react-dom");
3016
3131
  var import_react_feather3 = require("react-feather");
3017
3132
  var hintTimeoutMap = /* @__PURE__ */ new Map();
@@ -3039,13 +3154,13 @@ var Hint = ({
3039
3154
  isLoading,
3040
3155
  isCloseOnChildrenClick = false
3041
3156
  }) => {
3042
- const hintRef = (0, import_react22.useRef)(null);
3043
- const [hintId] = (0, import_react22.useState)(id ?? key ?? Math.random().toString(16).slice(2));
3044
- const [iAmOpenedOptions] = (0, import_react22.useState)({ ...I_AM_OPENED_EVENT_OPTIONS, detail: { hintId } });
3045
- const [isOpen, setIsOpen] = (0, import_react22.useState)(false);
3046
- const [isStyleComputed, setIsStyleComputed] = (0, import_react22.useState)(false);
3047
- const [handleScroll] = (0, import_react22.useState)(new HandleScrollObj(setIsOpen));
3048
- const [handleClickOutside] = (0, import_react22.useState)(new HandleClickOutsideObj(hintId, setIsOpen));
3157
+ const hintRef = (0, import_react23.useRef)(null);
3158
+ const [hintId] = (0, import_react23.useState)(id ?? key ?? Math.random().toString(16).slice(2));
3159
+ const [iAmOpenedOptions] = (0, import_react23.useState)({ ...I_AM_OPENED_EVENT_OPTIONS, detail: { hintId } });
3160
+ const [isOpen, setIsOpen] = (0, import_react23.useState)(false);
3161
+ const [isStyleComputed, setIsStyleComputed] = (0, import_react23.useState)(false);
3162
+ const [handleScroll] = (0, import_react23.useState)(new HandleScrollObj(setIsOpen));
3163
+ const [handleClickOutside] = (0, import_react23.useState)(new HandleClickOutsideObj(hintId, setIsOpen));
3049
3164
  const isCallbackExist = typeof onClickCallback === "function";
3050
3165
  const handle = {
3051
3166
  onMouseEnter: () => {
@@ -3095,11 +3210,11 @@ var Hint = ({
3095
3210
  }
3096
3211
  };
3097
3212
  const getHintMarkUp = (className2) => {
3098
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3213
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3099
3214
  "div",
3100
3215
  {
3101
3216
  "data-testid": "test-hint-text",
3102
- className: (0, import_classnames13.default)("hint__text", `hint__text_${side}`, `hint--${className2}__text`),
3217
+ className: (0, import_classnames14.default)("hint__text", `hint__text_${side}`, `hint--${className2}__text`),
3103
3218
  onMouseEnter: () => {
3104
3219
  if (isHoverableContent) isContentHoveredOuter = true;
3105
3220
  },
@@ -3107,7 +3222,7 @@ var Hint = ({
3107
3222
  onClick: handle.onClick,
3108
3223
  style: { visibility: isStyleComputed ? "visible" : "hidden" },
3109
3224
  children: [
3110
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Spinner_default, { size: "small" }),
3225
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Spinner_default, { size: "small" }),
3111
3226
  hint,
3112
3227
  children
3113
3228
  ]
@@ -3164,7 +3279,7 @@ var Hint = ({
3164
3279
  if (!hc) return null;
3165
3280
  return (0, import_react_dom2.createPortal)(getHintMarkUp(className2), hc);
3166
3281
  };
3167
- (0, import_react22.useEffect)(() => {
3282
+ (0, import_react23.useEffect)(() => {
3168
3283
  initHintContainer(hintId, hintContainer);
3169
3284
  const iAmOpenedCallback = (ev) => {
3170
3285
  const event = ev;
@@ -3190,7 +3305,7 @@ var Hint = ({
3190
3305
  }
3191
3306
  };
3192
3307
  }, []);
3193
- (0, import_react22.useEffect)(() => {
3308
+ (0, import_react23.useEffect)(() => {
3194
3309
  setIsStyleComputed(false);
3195
3310
  setHintContainerStyles();
3196
3311
  onOpenChange?.(isOpen);
@@ -3209,8 +3324,8 @@ var Hint = ({
3209
3324
  }
3210
3325
  };
3211
3326
  }, [isOpen]);
3212
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { "data-testid": testId, className: (0, import_classnames13.default)("hint", className), ref: hintRef, children: [
3213
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3327
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "data-testid": testId, className: (0, import_classnames14.default)("hint", className), ref: hintRef, children: [
3328
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3214
3329
  "button",
3215
3330
  {
3216
3331
  tabIndex: isAccessability ? 0 : -1,
@@ -3219,14 +3334,14 @@ var Hint = ({
3219
3334
  onClick: () => handleOpenType === "click" && (isCallbackExist ? onClickCallback?.() : setIsOpen(!isOpen)),
3220
3335
  onMouseEnter: handle.onMouseEnter,
3221
3336
  onMouseLeave: handle.onMouseLeave,
3222
- className: (0, import_classnames13.default)("hint__button", { hint__button_active: isOpen }),
3337
+ className: (0, import_classnames14.default)("hint__button", { hint__button_active: isOpen }),
3223
3338
  children: [
3224
- icon || icon === null || /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
3225
- variant === "outlined" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_feather3.HelpCircle, { width: 16, height: 16, className: "hint__icon outlined" }),
3226
- variant === "filled" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HelpCircleFilled, { className: "hint__icon filled" }),
3227
- variant === "warning" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_feather3.AlertTriangle, { className: "hint__icon", color: "#F06D8D", width: 16, height: 16 })
3339
+ icon || icon === null || /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
3340
+ variant === "outlined" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_feather3.HelpCircle, { width: 16, height: 16, className: "hint__icon outlined" }),
3341
+ variant === "filled" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(HelpCircleFilled, { className: "hint__icon filled" }),
3342
+ variant === "warning" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_feather3.AlertTriangle, { className: "hint__icon", color: "#F06D8D", width: 16, height: 16 })
3228
3343
  ] }),
3229
- label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: (0, import_classnames13.default)("hint__label", { "color--primary": isOpen }), children: typeof label === "string" ? capitalized(label) : label })
3344
+ label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: (0, import_classnames14.default)("hint__label", { "color--primary": isOpen }), children: typeof label === "string" ? capitalized(label) : label })
3230
3345
  ]
3231
3346
  }
3232
3347
  ),
@@ -3236,7 +3351,7 @@ var Hint = ({
3236
3351
  var Hint_default = Hint;
3237
3352
 
3238
3353
  // src/Atomic/FormElements/Switcher/Switcher.tsx
3239
- var import_classnames14 = __toESM(require("classnames"), 1);
3354
+ var import_classnames15 = __toESM(require("classnames"), 1);
3240
3355
  var RC8 = "switcher";
3241
3356
  var Switcher = ({
3242
3357
  label,
@@ -3249,34 +3364,34 @@ var Switcher = ({
3249
3364
  hintSide,
3250
3365
  testId = "switcher"
3251
3366
  }) => {
3252
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3367
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
3253
3368
  "div",
3254
3369
  {
3255
3370
  "data-testid": testId,
3256
- className: (0, import_classnames14.default)(RC8, className, { [`${RC8}_disabled`]: disabled }),
3371
+ className: (0, import_classnames15.default)(RC8, className, { [`${RC8}_disabled`]: disabled }),
3257
3372
  children: [
3258
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3373
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
3259
3374
  "button",
3260
3375
  {
3261
3376
  type: "button",
3262
3377
  "data-testid": `${testId}-button`,
3263
- className: (0, import_classnames14.default)(`${RC8}__button`),
3378
+ className: (0, import_classnames15.default)(`${RC8}__button`),
3264
3379
  disabled,
3265
3380
  onClick: (e) => onChange(!isActive, e),
3266
3381
  children: [
3267
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3382
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3268
3383
  "div",
3269
3384
  {
3270
- className: (0, import_classnames14.default)(`${RC8}__button-content`, {
3385
+ className: (0, import_classnames15.default)(`${RC8}__button-content`, {
3271
3386
  [`${RC8}__button-content_active`]: isActive
3272
3387
  }),
3273
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `${RC8}__ball` })
3388
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `${RC8}__ball` })
3274
3389
  }
3275
3390
  ),
3276
- label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3391
+ label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3277
3392
  "span",
3278
3393
  {
3279
- className: (0, import_classnames14.default)(`${RC8}__label`, {
3394
+ className: (0, import_classnames15.default)(`${RC8}__label`, {
3280
3395
  [`${RC8}__label_bold`]: isLabelBold
3281
3396
  }),
3282
3397
  children: label
@@ -3285,102 +3400,13 @@ var Switcher = ({
3285
3400
  ]
3286
3401
  }
3287
3402
  ),
3288
- hint && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Hint_default, { className: `${RC8}__hint`, hint, side: hintSide })
3403
+ hint && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Hint_default, { className: `${RC8}__hint`, hint, side: hintSide })
3289
3404
  ]
3290
3405
  }
3291
3406
  );
3292
3407
  };
3293
3408
  var Switcher_default = Switcher;
3294
3409
 
3295
- // src/Atomic/FormElements/Datepicker/components/DatepickerCalendar.tsx
3296
- var import_jsx_runtime21 = require("react/jsx-runtime");
3297
- var import_classnames15 = __toESM(require("classnames"), 1);
3298
- var import_moment2 = __toESM(require("moment"), 1);
3299
- var import_react24 = require("react");
3300
- var Icon = __toESM(require("react-feather"), 1);
3301
- var DatepickerCalendar = ({
3302
- date,
3303
- setDate,
3304
- startDate,
3305
- endDate,
3306
- allowPrev = true,
3307
- allowNext = true,
3308
- onClick,
3309
- onHover,
3310
- startPrevDate,
3311
- endPrevDate,
3312
- limitRange
3313
- }) => {
3314
- const [days, setDays] = (0, import_react24.useState)({});
3315
- const title = (0, import_react24.useMemo)(() => `${(0, import_moment2.default)(date).format("MMM")} ${(0, import_moment2.default)(date).format("YYYY")}`, [date]);
3316
- (0, import_react24.useEffect)(() => {
3317
- const result = {};
3318
- const day = (0, import_moment2.default)(date).startOf("month");
3319
- const daysInMonth = day.daysInMonth();
3320
- for (let d = 0; d < daysInMonth; d++) {
3321
- let week = day.week();
3322
- if (day.month() === 11 && week === 1) week = 53;
3323
- if (day.month() === 0 && week === 53) week = 0;
3324
- if (!result[week]) result[week] = {};
3325
- result[week][day.weekday()] = { date: day.toDate() };
3326
- day.add(1, "d");
3327
- }
3328
- setDays(result);
3329
- }, [date]);
3330
- const renderDay = (week, dayOfWeek) => {
3331
- const day = days[+week]?.[dayOfWeek];
3332
- const isFutureDay = day && (0, import_moment2.default)(day.date).isAfter((0, import_moment2.default)(), "day");
3333
- const isPastDay = limitRange ? day && (0, import_moment2.default)(day.date).isBefore((0, import_moment2.default)().subtract(limitRange, "days"), "day") : null;
3334
- const isRangeEnd = day && ((0, import_moment2.default)(day.date).isSame(startDate, "day") || (0, import_moment2.default)(day.date).isSame((0, import_moment2.default)(endDate).subtract(1, "hour"), "day"));
3335
- const isRangeInside = day && startDate && endDate && (0, import_moment2.default)(day.date).isAfter(startDate, "day") && (0, import_moment2.default)(day.date).isBefore((0, import_moment2.default)(endDate).subtract(1, "hour"), "day");
3336
- const isPrevRangeEnd = day && ((0, import_moment2.default)(day.date).isSame(startPrevDate, "day") || (0, import_moment2.default)(day.date).isSame((0, import_moment2.default)(endPrevDate).subtract(1, "day"), "day"));
3337
- const isPrevRangeInside = day && startPrevDate && endPrevDate && (0, import_moment2.default)(day.date).isAfter(startPrevDate, "day") && (0, import_moment2.default)(day.date).isBefore((0, import_moment2.default)(endPrevDate).subtract(1, "day"), "day");
3338
- const classNames2 = (0, import_classnames15.default)(
3339
- "calendar__day",
3340
- { "calendar__day--clickable": day },
3341
- { "calendar__day--disabled": isFutureDay || isPastDay },
3342
- { "calendar__day--range-end": isRangeEnd },
3343
- { "calendar__day--range-inside": isRangeInside },
3344
- { "calendar__day--prev-range-end": isPrevRangeEnd },
3345
- { "calendar__day--prev-range-inside": isPrevRangeInside }
3346
- );
3347
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3348
- "div",
3349
- {
3350
- className: classNames2,
3351
- onClick: day && !isFutureDay ? () => onClick(day.date) : void 0,
3352
- onMouseOver: day && !isFutureDay ? () => onHover(day.date) : void 0,
3353
- onMouseLeave: () => onHover(null),
3354
- children: day && day.date.getDate()
3355
- },
3356
- `${week}_${dayOfWeek}`
3357
- );
3358
- };
3359
- const handlePrev = () => {
3360
- setDate((0, import_moment2.default)(date).subtract(1, "month").toDate());
3361
- };
3362
- const handleNext = () => {
3363
- setDate((0, import_moment2.default)(date).add(1, "month").toDate());
3364
- };
3365
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "calendar", children: [
3366
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "calendar-header", children: [
3367
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "calendar-header__prev", children: allowPrev && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", "data-testid": "datepicker-calendar-prev", onClick: handlePrev, "aria-label": "Previous month", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon.ChevronLeft, { size: 16 }) }) }),
3368
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "calendar-header__title", children: title }),
3369
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "calendar-header__next", children: allowNext && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", "data-testid": "datepicker-calendar-next", onClick: handleNext, "aria-label": "Next month", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon.ChevronRight, { size: 16 }) }) })
3370
- ] }),
3371
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "calendar__week", children: Array.from({ length: 7 }, (_, dayOfWeek) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3372
- "div",
3373
- {
3374
- className: "calendar__day calendar__day--title",
3375
- children: (0, import_moment2.default)().weekday(dayOfWeek).format("dd").charAt(0)
3376
- },
3377
- `day-of-week_${dayOfWeek}`
3378
- )) }),
3379
- Object.keys(days).map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "calendar__week", children: Array.from({ length: 7 }, (_, dayOfWeek) => renderDay(week, dayOfWeek)) }, `week_${index}`))
3380
- ] });
3381
- };
3382
- var DatepickerCalendar_default = DatepickerCalendar;
3383
-
3384
3410
  // src/Atomic/FormElements/Datepicker/Datepicker.tsx
3385
3411
  var import_classnames16 = __toESM(require("classnames"), 1);
3386
3412
  var import_moment3 = __toESM(require("moment"), 1);
@@ -3708,6 +3734,9 @@ var Datepicker = ({
3708
3734
  };
3709
3735
  var Datepicker_default = Datepicker;
3710
3736
 
3737
+ // src/Atomic/FormElements/Dropdown/index.ts
3738
+ var Dropdown_default2 = Dropdown_default;
3739
+
3711
3740
  // src/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.tsx
3712
3741
  var import_jsx_runtime23 = require("react/jsx-runtime");
3713
3742
 
@@ -5833,6 +5862,12 @@ var FormattedRawSSN = ({
5833
5862
  };
5834
5863
  var FormattedRawSSN_default = FormattedRawSSN;
5835
5864
 
5865
+ // src/Atomic/FormElements/FormattedRawSSN/index.ts
5866
+ var FormattedRawSSN_default2 = FormattedRawSSN_default;
5867
+
5868
+ // src/Atomic/FormElements/Input/index.ts
5869
+ var Input_default2 = Input_default;
5870
+
5836
5871
  // src/Atomic/FormElements/InputCalendar/InputCalendar.tsx
5837
5872
  var import_jsx_runtime34 = require("react/jsx-runtime");
5838
5873
 
@@ -6034,6 +6069,9 @@ var InputColor = ({
6034
6069
  };
6035
6070
  var InputColor_default = InputColor;
6036
6071
 
6072
+ // src/Atomic/FormElements/InputColor/index.ts
6073
+ var InputColor_default2 = InputColor_default;
6074
+
6037
6075
  // src/Atomic/FormElements/InputCurrency/InputCurrency.tsx
6038
6076
  var import_jsx_runtime36 = require("react/jsx-runtime");
6039
6077
  var import_classnames29 = __toESM(require("classnames"), 1);
@@ -6187,191 +6225,87 @@ var InputCurrency = ({
6187
6225
  InputCurrency.displayName = "InputCurrency";
6188
6226
  var InputCurrency_default = InputCurrency;
6189
6227
 
6190
- // src/Atomic/FormElements/InputDateRange/dependencies.ts
6191
- var import_moment_timezone3 = __toESM(require("moment-timezone"), 1);
6192
- var import_react43 = require("react");
6193
- var getIsDateValid = (date) => (0, import_moment_timezone3.default)(date).isValid();
6194
- function useClickOutside2(hideComponent, additionalComponent, onlyGetRef) {
6195
- const ref = (0, import_react43.useRef)(null);
6196
- const checkCondition = (target) => {
6197
- if (additionalComponent && additionalComponent?.length) {
6198
- return !ref.current?.contains(target) && !Array.from(additionalComponent)?.some((item) => item?.contains(target));
6199
- } else {
6200
- return !ref.current?.contains(target);
6201
- }
6202
- };
6203
- const handleClickOutside = (0, import_react43.useCallback)(
6204
- (e) => {
6205
- const target = e.target;
6206
- if (checkCondition(target)) hideComponent();
6207
- },
6208
- [hideComponent]
6209
- );
6210
- (0, import_react43.useEffect)(() => {
6211
- if (!onlyGetRef) {
6212
- document.addEventListener("mousedown", handleClickOutside, true);
6213
- return () => {
6214
- document.removeEventListener("mousedown", handleClickOutside, true);
6215
- };
6216
- }
6217
- return () => {
6218
- };
6219
- }, []);
6220
- return ref;
6221
- }
6222
- function useToggle(initialState) {
6223
- const [isToggled, setToggle] = (0, import_react43.useState)(Boolean(initialState));
6224
- const toggle = (0, import_react43.useCallback)(() => setToggle((isOn) => !isOn), []);
6225
- const toggleOn = (0, import_react43.useCallback)(() => setToggle(true), []);
6226
- const toggleOff = (0, import_react43.useCallback)(() => setToggle(false), []);
6227
- return {
6228
- isToggled,
6229
- toggle,
6230
- toggleOn,
6231
- toggleOff
6232
- };
6233
- }
6234
- var INTERVALS = {
6235
- today: {
6236
- label: "today",
6237
- start: () => (0, import_moment_timezone3.default)().startOf("day"),
6238
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6239
- },
6240
- yesterday: {
6241
- label: "yesterday",
6242
- start: () => (0, import_moment_timezone3.default)().subtract(1, "day").startOf("day"),
6243
- end: () => (0, import_moment_timezone3.default)().startOf("day")
6244
- },
6245
- thisWeek: {
6246
- label: "This Week",
6247
- start: () => (0, import_moment_timezone3.default)().startOf("week"),
6248
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6249
- },
6250
- lastWeek: {
6251
- label: "Last Week",
6252
- start: () => (0, import_moment_timezone3.default)().subtract(1, "week").startOf("week"),
6253
- end: () => (0, import_moment_timezone3.default)().startOf("week")
6254
- },
6255
- last7Days: {
6256
- label: "Last 7 Days",
6257
- start: () => (0, import_moment_timezone3.default)().subtract(6, "day").startOf("day"),
6258
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6259
- },
6260
- last14Days: {
6261
- label: "Last 14 Days",
6262
- start: () => (0, import_moment_timezone3.default)().subtract(13, "day").startOf("day"),
6263
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6264
- },
6265
- last30Days: {
6266
- label: "Last 30 Days",
6267
- start: () => (0, import_moment_timezone3.default)().subtract(29, "day").startOf("day"),
6268
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6269
- },
6270
- thisMonth: {
6271
- label: "This Month",
6272
- start: () => (0, import_moment_timezone3.default)().startOf("month"),
6273
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6274
- },
6275
- lastMonth: {
6276
- label: "Last Month",
6277
- start: () => (0, import_moment_timezone3.default)().subtract(1, "month").startOf("month"),
6278
- end: () => (0, import_moment_timezone3.default)().startOf("month")
6279
- },
6280
- last3Months: {
6281
- label: "Last 3 Months",
6282
- start: () => (0, import_moment_timezone3.default)().subtract(3, "month").startOf("month"),
6283
- end: () => (0, import_moment_timezone3.default)().startOf("month")
6284
- },
6285
- last6Months: {
6286
- label: "Last 6 Months",
6287
- start: () => (0, import_moment_timezone3.default)().subtract(6, "month").startOf("month"),
6288
- end: () => (0, import_moment_timezone3.default)().startOf("month")
6289
- },
6290
- sixMonths: {
6291
- label: "6 Months",
6292
- isHidden: true,
6293
- start: () => (0, import_moment_timezone3.default)().subtract(6, "month"),
6294
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6295
- },
6296
- thisYear: {
6297
- label: "This Year",
6298
- start: () => (0, import_moment_timezone3.default)().startOf("year"),
6299
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6300
- },
6301
- year: {
6302
- label: "Year",
6303
- isHidden: true,
6304
- start: () => (0, import_moment_timezone3.default)().subtract(1, "year"),
6305
- end: () => (0, import_moment_timezone3.default)().add(1, "day").startOf("day")
6306
- },
6307
- lastYear: {
6308
- label: "Last Year",
6309
- start: () => (0, import_moment_timezone3.default)().subtract(1, "year").startOf("year"),
6310
- end: () => (0, import_moment_timezone3.default)().startOf("year")
6311
- },
6312
- allTime: {
6313
- label: "All Time",
6314
- start: () => (0, import_moment_timezone3.default)("2022-01-01T00:00:00"),
6315
- end: () => (0, import_moment_timezone3.default)()
6316
- // start: () => null,
6317
- // end: () => null,
6318
- }
6228
+ // src/Atomic/FormElements/InputDateRange/components/DateInput.tsx
6229
+ var import_jsx_runtime37 = require("react/jsx-runtime");
6230
+
6231
+ // src/Functions/presets/mobileKeyboardTypesPresets.js
6232
+ var ALL_KEYBOARD_TYPES = {
6233
+ numeric: { inputMode: "decimal" },
6234
+ email: { inputMode: "email" }
6319
6235
  };
6320
- var ALL_TIME_KEY = "allTime";
6321
- var CUSTOM_INTERVAL_KEY = "customDate";
6322
- var CUSTOM_INTERVAL_KEY_TEXT = "Custom Date";
6323
- var MAIN_FORMAT = "YYYY-MM-DDTHH:mm";
6324
- var MAIN_DATE_FORMAT = "YYYY-MM-DD";
6325
- var MAIN_TIME_FORMAT = "HH:mm";
6326
- function getActualDateRange(inputDateRange) {
6327
- const getActualIntervalKey = () => {
6328
- if (inputDateRange?.intervalKey && Object.keys(INTERVALS).includes(inputDateRange.intervalKey)) {
6329
- return inputDateRange.intervalKey;
6330
- } else if (inputDateRange?.start && inputDateRange?.end) {
6331
- for (const [key, interval2] of Object.entries(INTERVALS)) {
6332
- if ((0, import_moment_timezone3.default)(inputDateRange.start).isSame(interval2.start()) && (0, import_moment_timezone3.default)(inputDateRange.end).isSame(interval2.end())) {
6333
- return key;
6334
- }
6335
- }
6336
- return CUSTOM_INTERVAL_KEY;
6337
- }
6338
- return ALL_TIME_KEY;
6339
- };
6340
- const getIntervalDate = (intervalKey) => {
6341
- if (intervalKey === ALL_TIME_KEY || intervalKey === CUSTOM_INTERVAL_KEY) {
6342
- return {
6343
- start: null,
6344
- end: null,
6345
- compare: inputDateRange?.compare,
6346
- startPrevDate: null,
6347
- endPrevDate: null
6348
- };
6236
+ var NUMERIC_KEYBOARD = {
6237
+ attributesOfNativeInput: ALL_KEYBOARD_TYPES.numeric
6238
+ };
6239
+ var EMAIL_KEYBOARD = {
6240
+ attributesOfNativeInput: ALL_KEYBOARD_TYPES.email
6241
+ };
6242
+
6243
+ // src/Atomic/FormElements/InputDateRange/components/DateInput.tsx
6244
+ var import_classnames30 = __toESM(require("classnames"), 1);
6245
+ var import_moment_timezone3 = __toESM(require("moment-timezone"), 1);
6246
+ function handleDateInputOnChange(value) {
6247
+ const replace = (val) => val?.replace(/[^0-9/]/g, "");
6248
+ const input = replace(value);
6249
+ const lastSymbol = input ? input.slice(-1) : "";
6250
+ const previousValue = input ? input.slice(0, input.length - 1) : "";
6251
+ if (value.length > 10 || lastSymbol === "/") return previousValue;
6252
+ return previousValue.length === 2 || previousValue.length === 5 ? `${previousValue}/${lastSymbol}` : input;
6253
+ }
6254
+ function DateInput({ ref, ...props }) {
6255
+ const {
6256
+ RC: RC36,
6257
+ className,
6258
+ testId,
6259
+ isFocused,
6260
+ disabled,
6261
+ value,
6262
+ date,
6263
+ prepareDate,
6264
+ onChange,
6265
+ onFocus,
6266
+ onBlur,
6267
+ onKeyUp
6268
+ } = props;
6269
+ const preparedDate = (() => {
6270
+ const prepareDateDefault = (date2) => (0, import_moment_timezone3.default)(date2).format("MM/DD/YYYY");
6271
+ const output = prepareDate?.(date) ?? prepareDateDefault(date);
6272
+ return (output?.toString?.().toLowerCase() || "") !== "invalid date" ? output : "";
6273
+ })();
6274
+ return isFocused ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6275
+ Input_default,
6276
+ {
6277
+ ref,
6278
+ testId,
6279
+ className: (0, import_classnames30.default)(className, `${RC36}-interactive`),
6280
+ value,
6281
+ disabled,
6282
+ onChange: (value2) => onChange(handleDateInputOnChange(value2)),
6283
+ onBlur,
6284
+ onKeyUp,
6285
+ ...NUMERIC_KEYBOARD
6349
6286
  }
6350
- const actualValues = {
6351
- start: INTERVALS[intervalKey]?.start()?.format(MAIN_FORMAT),
6352
- end: INTERVALS[intervalKey]?.end()?.format(MAIN_FORMAT),
6353
- compare: inputDateRange?.compare
6354
- };
6355
- if (actualValues.compare) {
6356
- const intervalHoursCount = (0, import_moment_timezone3.default)(actualValues.end).diff(
6357
- actualValues.start,
6358
- "hours"
6359
- );
6360
- actualValues.startPrevDate = (0, import_moment_timezone3.default)(actualValues.start).subtract(intervalHoursCount, "hours").toDate();
6361
- actualValues.endPrevDate = actualValues.start;
6287
+ ) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6288
+ "div",
6289
+ {
6290
+ className: (0, import_classnames30.default)(className, `${RC36}-emulation`, {
6291
+ [`${RC36}-emulation_disabled`]: disabled
6292
+ }),
6293
+ onClick: disabled ? void 0 : onFocus,
6294
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: (0, import_classnames30.default)(""), children: preparedDate })
6362
6295
  }
6363
- return actualValues;
6364
- };
6365
- const interval = getActualIntervalKey();
6366
- return interval !== CUSTOM_INTERVAL_KEY && interval !== ALL_TIME_KEY ? { intervalKey: interval, ...getIntervalDate(interval) } : { ...inputDateRange, intervalKey: interval };
6296
+ );
6367
6297
  }
6298
+ var DateInput_default = DateInput;
6368
6299
 
6369
- // src/Atomic/FormElements/InputDateRange/InputDateRange.tsx
6370
- var import_jsx_runtime47 = require("react/jsx-runtime");
6300
+ // src/Atomic/FormElements/InputDateRange/components/Datepicker.tsx
6301
+ var import_jsx_runtime40 = require("react/jsx-runtime");
6302
+
6303
+ // src/Atomic/FormElements/RangeCalendar/RangeCalendar.js
6304
+ var import_jsx_runtime39 = require("react/jsx-runtime");
6371
6305
 
6372
6306
  // src/Atomic/UI/Arrow/Arrow.tsx
6373
- var import_jsx_runtime37 = require("react/jsx-runtime");
6374
- var import_classnames30 = __toESM(require("classnames"), 1);
6307
+ var import_jsx_runtime38 = require("react/jsx-runtime");
6308
+ var import_classnames31 = __toESM(require("classnames"), 1);
6375
6309
  var import_react44 = require("react");
6376
6310
  function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6377
6311
  const ref = (0, import_react44.useRef)(null);
@@ -6385,7 +6319,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6385
6319
  function renderSVG() {
6386
6320
  if (type === "left") {
6387
6321
  if (isAlt) {
6388
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
6322
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
6389
6323
  "svg",
6390
6324
  {
6391
6325
  "data-testid": testId,
@@ -6396,7 +6330,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6396
6330
  height: "16",
6397
6331
  viewBox: "0 0 16 16",
6398
6332
  children: [
6399
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6333
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6400
6334
  "path",
6401
6335
  {
6402
6336
  d: "M12.7,8H3.3",
@@ -6407,7 +6341,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6407
6341
  strokeLinejoin: "round"
6408
6342
  }
6409
6343
  ),
6410
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6344
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6411
6345
  "path",
6412
6346
  {
6413
6347
  d: "M8,3.3L3.3,8L8,12.7",
@@ -6422,7 +6356,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6422
6356
  }
6423
6357
  );
6424
6358
  }
6425
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6359
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6426
6360
  "svg",
6427
6361
  {
6428
6362
  "data-testid": testId,
@@ -6431,7 +6365,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6431
6365
  viewBox: "0 0 24 24",
6432
6366
  fill: "none",
6433
6367
  xmlns: "http://www.w3.org/2000/svg",
6434
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6368
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6435
6369
  "path",
6436
6370
  {
6437
6371
  d: "M15 18L9 12L15 6",
@@ -6445,7 +6379,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6445
6379
  );
6446
6380
  }
6447
6381
  if (isAlt) {
6448
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
6382
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
6449
6383
  "svg",
6450
6384
  {
6451
6385
  "data-testid": testId,
@@ -6455,7 +6389,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6455
6389
  height: "16",
6456
6390
  viewBox: "0 0 16 16",
6457
6391
  children: [
6458
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6392
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6459
6393
  "path",
6460
6394
  {
6461
6395
  d: "M3.3,8h9.3",
@@ -6466,7 +6400,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6466
6400
  strokeLinejoin: "round"
6467
6401
  }
6468
6402
  ),
6469
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6403
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6470
6404
  "path",
6471
6405
  {
6472
6406
  d: "M8,3.3L12.7,8L8,12.7",
@@ -6481,7 +6415,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6481
6415
  }
6482
6416
  );
6483
6417
  }
6484
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6418
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6485
6419
  "svg",
6486
6420
  {
6487
6421
  "data-testid": testId,
@@ -6490,7 +6424,7 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6490
6424
  viewBox: "0 0 24 24",
6491
6425
  fill: "none",
6492
6426
  xmlns: "http://www.w3.org/2000/svg",
6493
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6427
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6494
6428
  "path",
6495
6429
  {
6496
6430
  d: "M9 18L15 12L9 6",
@@ -6503,12 +6437,12 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6503
6437
  }
6504
6438
  );
6505
6439
  }
6506
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6440
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6507
6441
  "div",
6508
6442
  {
6509
6443
  "data-testid": `arrow--key-${testId}--type-${type}`,
6510
6444
  ref,
6511
- className: (0, import_classnames30.default)("arrow", `arrow_${type}`, className, {
6445
+ className: (0, import_classnames31.default)("arrow", `arrow_${type}`, className, {
6512
6446
  arrow_disabled: disabled
6513
6447
  }),
6514
6448
  onClick,
@@ -6518,1353 +6452,1456 @@ function Arrow({ type, className, onClick, disabled, testId, isAlt }) {
6518
6452
  }
6519
6453
  var Arrow_default = Arrow;
6520
6454
 
6521
- // src/Atomic/FormElements/InputDateRange/components/OpenedPart.tsx
6522
- var import_jsx_runtime46 = require("react/jsx-runtime");
6523
-
6524
- // src/Functions/useResize.js
6525
- var import_react45 = require("react");
6526
- var useResize = (element) => {
6527
- const [elemPosition, setElemPosition] = (0, import_react45.useState)("");
6528
- const onResize = (elemRightPosition) => {
6529
- if (elemRightPosition > document.documentElement.clientWidth) {
6530
- return setElemPosition("left");
6531
- } else setElemPosition("");
6532
- };
6533
- (0, import_react45.useEffect)(() => {
6534
- const elemRightPosition = element?.current?.getBoundingClientRect().right + 20;
6535
- window.addEventListener("resize", () => onResize(elemRightPosition));
6536
- return () => {
6537
- window.removeEventListener("resize", () => setElemPosition(""));
6538
- };
6539
- }, []);
6540
- (0, import_react45.useLayoutEffect)(() => {
6541
- const elemRightPosition = element?.current?.getBoundingClientRect().right + 20;
6542
- if (elemRightPosition > document.documentElement.clientWidth) {
6543
- return setElemPosition("left");
6544
- }
6545
- }, []);
6546
- return { elemPosition };
6547
- };
6548
-
6549
- // src/Atomic/UI/Modal/Modal.tsx
6550
- var import_jsx_runtime41 = require("react/jsx-runtime");
6551
-
6552
- // src/Functions/useKeyPress/useKeyPress.ts
6553
- var import_react46 = require("react");
6554
- function isISuspendProcessing(x) {
6555
- return getIsOnlyAnObject(x) && Object.values(x).every((v) => typeof v === "function");
6556
- }
6557
- function useKeyPress(targetKey, clamping = true, isForbidden, suspendProcessing) {
6558
- const [keyPressed, setKeyPressed] = (0, import_react46.useState)(false);
6559
- const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
6560
- const downHandler = (0, import_react46.useCallback)(
6561
- (event) => {
6562
- const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
6563
- const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
6564
- if (key === targetKey && isPressingWithoutAuxiliaryKeys && !safelySuspendProcessing[key]?.(event)) {
6565
- if (!clamping && repeat) return;
6566
- setKeyPressed(true);
6567
- }
6455
+ // src/Atomic/FormElements/RangeCalendar/RangeCalendar.js
6456
+ var import_react45 = __toESM(require("react"), 1);
6457
+ var import_classnames32 = __toESM(require("classnames"), 1);
6458
+ var import_moment_timezone4 = __toESM(require("moment-timezone"), 1);
6459
+ var RangeCalendar = (props) => {
6460
+ const {
6461
+ className,
6462
+ date,
6463
+ setDate,
6464
+ startDate,
6465
+ endDate,
6466
+ allowPrev = true,
6467
+ allowNext = true,
6468
+ onClick = () => {
6568
6469
  },
6569
- // ? Намерянно в зависимостях используем именно входной suspendProcessing,
6570
- // ? хоть в коде используем "безопасный"
6571
- [clamping, targetKey, suspendProcessing]
6572
- );
6573
- const upHandler = (0, import_react46.useCallback)(
6574
- (event) => {
6575
- const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
6576
- const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
6577
- if (key === targetKey && isPressingWithoutAuxiliaryKeys && !safelySuspendProcessing[key]?.(event)) {
6578
- if (!clamping && repeat) return;
6579
- setKeyPressed(false);
6580
- }
6470
+ onHover = () => {
6581
6471
  },
6582
- // ? Намерянно в зависимостях используем именно входной suspendProcessing,
6583
- // ? хоть в коде используем "безопасный"
6584
- [clamping, targetKey, suspendProcessing]
6472
+ startPrevDate,
6473
+ endPrevDate,
6474
+ limitRange,
6475
+ isShortWeekNames,
6476
+ minDate,
6477
+ maxDate,
6478
+ momentMinDate,
6479
+ momentMaxDate,
6480
+ isDontLimitFuture,
6481
+ testId = "range-calendar"
6482
+ } = props;
6483
+ const [days, setDays] = (0, import_react45.useState)({});
6484
+ const title = (0, import_react45.useMemo)(
6485
+ () => `${(0, import_moment_timezone4.default)(date).format("MMM")} ${(0, import_moment_timezone4.default)(date).format("YYYY")}`,
6486
+ [date]
6585
6487
  );
6586
- (0, import_react46.useEffect)(
6587
- () => {
6588
- const handleDown = (event) => downHandler(event);
6589
- const handleUp = (event) => upHandler(event);
6590
- if (!isForbidden) {
6591
- window.addEventListener("keydown", handleDown);
6592
- window.addEventListener("keyup", handleUp);
6488
+ (0, import_react45.useEffect)(() => {
6489
+ const result = {};
6490
+ const day = (0, import_moment_timezone4.default)(date).startOf("month");
6491
+ const daysInMonth = day.daysInMonth();
6492
+ for (let d = 0; d < daysInMonth; d += 1) {
6493
+ let week = day.week();
6494
+ if (day.month() === 11 && week === 1) week = 53;
6495
+ if (day.month() === 0 && week === 53) week = 0;
6496
+ if (!Object.prototype.hasOwnProperty.call(result, week)) {
6497
+ result[week] = {};
6593
6498
  }
6594
- return () => {
6595
- window.removeEventListener("keydown", handleDown);
6596
- window.removeEventListener("keyup", handleUp);
6597
- };
6598
- },
6599
- // ? Намерянно в зависимостях используем именно входной suspendProcessing,
6600
- // ? хоть в коде используем "безопасный"
6601
- [downHandler, upHandler, isForbidden, suspendProcessing]
6602
- );
6603
- return keyPressed;
6604
- }
6605
- var useKeyPress_default = useKeyPress;
6606
-
6607
- // src/Functions/useKeyPress/useHandleKeyPress.ts
6608
- var import_react47 = require("react");
6609
- function useHandleKeyPress({
6610
- escCallback,
6611
- enterCallback,
6612
- withClamping = true,
6613
- withEventManagementStructure,
6614
- suspendProcessing = null
6615
- }) {
6616
- const { isWithSubmitAndCloseManagement } = withEventManagementStructure || {};
6617
- const isPressEnter = useKeyPress_default("Enter", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
6618
- const isPressEscape = useKeyPress_default("Escape", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
6619
- (0, import_react47.useEffect)(() => {
6620
- if (!isWithSubmitAndCloseManagement && isPressEscape && typeof escCallback === "function") {
6621
- escCallback();
6622
- }
6623
- }, [isPressEscape, escCallback]);
6624
- (0, import_react47.useEffect)(() => {
6625
- if (!isWithSubmitAndCloseManagement && isPressEnter && typeof enterCallback === "function") {
6626
- enterCallback();
6499
+ result[week][day.weekday()] = { date: day.toDate() };
6500
+ day.add(1, "d");
6627
6501
  }
6628
- }, [isPressEnter, enterCallback]);
6629
- }
6630
- var useHandleKeyPress_default = useHandleKeyPress;
6631
-
6632
- // src/Atomic/UI/Modal/partials/_constants.ts
6633
- var DEFAULT_EVENT_OPTIONS = Object.freeze({
6634
- bubbles: true,
6635
- cancelable: true,
6636
- composed: false
6637
- });
6638
- var ModalEventsInnerKeys = /* @__PURE__ */ ((ModalEventsInnerKeys2) => {
6639
- ModalEventsInnerKeys2["iGotAnEnterKeyPress"] = "iGotAnEnterKeyPress";
6640
- ModalEventsInnerKeys2["iGotAnEscKeyPress"] = "iGotAnEscKeyPress";
6641
- return ModalEventsInnerKeys2;
6642
- })(ModalEventsInnerKeys || {});
6643
- var EVENTS = Object.freeze({
6644
- ["iGotAnEnterKeyPress" /* iGotAnEnterKeyPress */]: {
6645
- innerKey: "iGotAnEnterKeyPress" /* iGotAnEnterKeyPress */,
6646
- name: "modal:i-got-an-enter-key-press",
6647
- shortName: "enterIsPressed",
6648
- middlewareKey: "Enter",
6649
- options: DEFAULT_EVENT_OPTIONS
6650
- },
6651
- ["iGotAnEscKeyPress" /* iGotAnEscKeyPress */]: {
6652
- innerKey: "iGotAnEscKeyPress" /* iGotAnEscKeyPress */,
6653
- name: "modal:i-got-an-esc-key-press",
6654
- shortName: "escIsPressed",
6655
- middlewareKey: "Escape",
6656
- options: DEFAULT_EVENT_OPTIONS
6657
- }
6658
- });
6659
-
6660
- // src/Atomic/UI/Modal/partials/_utils.ts
6661
- function getWithEventManagementStructure(modalId, withEventManagement) {
6662
- const output = {
6663
- isWithSubmitAndCloseManagement: false
6502
+ setDays(result);
6503
+ }, [date]);
6504
+ const renderDay = (week, dayOfWeek) => {
6505
+ const day = days[week][dayOfWeek];
6506
+ const isFutureDay = day && (0, import_moment_timezone4.default)(day.date).isAfter((0, import_moment_timezone4.default)(), "day");
6507
+ const isPastDay = limitRange ? day && (0, import_moment_timezone4.default)(day.date).isBefore((0, import_moment_timezone4.default)().subtract(limitRange, "days"), "day") : null;
6508
+ const isRangeStart = day && (0, import_moment_timezone4.default)(day.date).isSame(startDate, "day");
6509
+ const isRangeEnd = day && (0, import_moment_timezone4.default)(day.date).isSame((0, import_moment_timezone4.default)(endDate).subtract(1, "hour"), "day");
6510
+ const isRangeInside = day && startDate && endDate && (0, import_moment_timezone4.default)(day.date).isAfter(startDate, "day") && (0, import_moment_timezone4.default)(day.date).isBefore((0, import_moment_timezone4.default)(endDate).subtract(1, "hour"), "day");
6511
+ const isPrevRangeEnd = day && ((0, import_moment_timezone4.default)(day.date).isSame(startPrevDate, "day") || (0, import_moment_timezone4.default)(day.date).isSame((0, import_moment_timezone4.default)(endPrevDate).subtract(1, "day"), "day"));
6512
+ const isPrevRangeInside = day && startPrevDate && endPrevDate && (0, import_moment_timezone4.default)(day.date).isAfter(startPrevDate, "day") && (0, import_moment_timezone4.default)(day.date).isBefore((0, import_moment_timezone4.default)(endPrevDate).subtract(1, "day"), "day");
6513
+ const classNames2 = (0, import_classnames32.default)(
6514
+ "range-calendar__day",
6515
+ { "range-calendar__day--clickable": day },
6516
+ {
6517
+ "range-calendar__day--disabled": isPastDay || minDate && (0, import_moment_timezone4.default)(day?.date).isBefore(momentMinDate, "day") || !isDontLimitFuture && (maxDate ? (0, import_moment_timezone4.default)(day?.date).isAfter(momentMaxDate) : isFutureDay)
6518
+ },
6519
+ { "range-calendar__day--range-start": isRangeStart },
6520
+ { "range-calendar__day--range-end": isRangeEnd },
6521
+ { "range-calendar__day--range-inside": isRangeInside },
6522
+ { "range-calendar__day--prev-range-end": isPrevRangeEnd },
6523
+ { "range-calendar__day--prev-range-inside": isPrevRangeInside }
6524
+ );
6525
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6526
+ "div",
6527
+ {
6528
+ className: classNames2,
6529
+ onClick: day ? (e) => onClick(day.date, e) : null,
6530
+ onMouseOver: day ? () => onHover(day.date) : null,
6531
+ onMouseLeave: () => onHover(null),
6532
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "calendar__day-num", children: day && day.date.getDate() })
6533
+ },
6534
+ `${week}_${dayOfWeek}`
6535
+ );
6664
6536
  };
6665
- for (const key in output) {
6666
- if (!modalId) {
6667
- output[key] = false;
6668
- } else {
6669
- output[key] = getIsOnlyAnObject(withEventManagement) ? withEventManagement[key] ?? false : !!withEventManagement;
6670
- }
6671
- }
6672
- return output;
6673
- }
6674
- function getOnKeyPress({
6675
- id: modalId,
6676
- onSubmit,
6677
- onClose,
6678
- suspendProcessing
6679
- }) {
6680
- if (!modalId) return null;
6681
- return function onKeyPress(ev) {
6682
- const customEvent = ev;
6683
- const { id: eventId, realEvent } = customEvent.detail || {};
6684
- const constantInfoAboutCustomEvent = Object.values(EVENTS).find((ev2) => ev2.name === customEvent.type || ev2.shortName === customEvent.type) || {};
6685
- const middlewareKey = constantInfoAboutCustomEvent.middlewareKey || "incorrectKey";
6686
- const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
6687
- if (modalId && eventId && eventId === modalId && !safelySuspendProcessing[middlewareKey]?.(realEvent)) {
6688
- switch (customEvent.type) {
6689
- case EVENTS.iGotAnEnterKeyPress.name: {
6690
- onSubmit?.();
6691
- break;
6692
- }
6693
- case EVENTS.iGotAnEscKeyPress.name: {
6694
- onClose?.();
6695
- break;
6537
+ const handlePrev = () => {
6538
+ setDate((0, import_moment_timezone4.default)(date).subtract(1, "month").toDate());
6539
+ };
6540
+ const handleNext = () => {
6541
+ setDate((0, import_moment_timezone4.default)(date).add(1, "month").toDate());
6542
+ };
6543
+ const getFormatedWeekName = (input) => isShortWeekNames ? input.charAt(0) : input;
6544
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: (0, import_classnames32.default)("range-calendar", className), "data-testid": testId, children: [
6545
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "range-calendar-header", children: [
6546
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6547
+ Arrow_default,
6548
+ {
6549
+ type: "left",
6550
+ disabled: !allowPrev || minDate && (0, import_moment_timezone4.default)(date).startOf("month").isSameOrBefore(momentMinDate, "months"),
6551
+ onClick: handlePrev,
6552
+ className: "range-calendar-header__prev"
6696
6553
  }
6697
- default: {
6698
- break;
6554
+ ),
6555
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "range-calendar-header__title", children: title }),
6556
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6557
+ Arrow_default,
6558
+ {
6559
+ type: "right",
6560
+ disabled: !allowNext || !isDontLimitFuture && (0, import_moment_timezone4.default)(date).startOf("month").isSameOrAfter(
6561
+ maxDate ? momentMaxDate : (0, import_moment_timezone4.default)().add(1, "day").startOf("day"),
6562
+ "months"
6563
+ ),
6564
+ onClick: handleNext,
6565
+ className: "range-calendar-header__next"
6699
6566
  }
6700
- }
6567
+ )
6568
+ ] }),
6569
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "range-calendar__week range-calendar__week-title", children: [...Array(7).keys()].map((dayOfWeek) => {
6570
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6571
+ "div",
6572
+ {
6573
+ className: "range-calendar__day range-calendar__day--title",
6574
+ children: getFormatedWeekName((0, import_moment_timezone4.default)().weekday(dayOfWeek).format("dd"))
6575
+ },
6576
+ `day-of-week_${dayOfWeek}`
6577
+ );
6578
+ }) }),
6579
+ Object.keys(days).map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "range-calendar__week", children: [...Array(7).keys()].map((dayOfWeek) => renderDay(week, dayOfWeek)) }, `week_${index}`))
6580
+ ] });
6581
+ };
6582
+ var RangeCalendar_default = RangeCalendar;
6583
+
6584
+ // src/Atomic/FormElements/InputDateRange/dependencies.ts
6585
+ var import_moment_timezone5 = __toESM(require("moment-timezone"), 1);
6586
+ var import_react46 = require("react");
6587
+ var getIsDateValid = (date) => (0, import_moment_timezone5.default)(date).isValid();
6588
+ function useClickOutside2(hideComponent, additionalComponent, onlyGetRef) {
6589
+ const ref = (0, import_react46.useRef)(null);
6590
+ const checkCondition = (target) => {
6591
+ if (additionalComponent && additionalComponent?.length) {
6592
+ return !ref.current?.contains(target) && !Array.from(additionalComponent)?.some((item) => item?.contains(target));
6593
+ } else {
6594
+ return !ref.current?.contains(target);
6701
6595
  }
6702
6596
  };
6703
- }
6704
- function dispatchEventForModalManagement(realEvent, nameOfCustomEvent, uniqueIdOfRecipient, target) {
6705
- const { repeat, altKey, ctrlKey, shiftKey, metaKey } = realEvent;
6706
- const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
6707
- if (!repeat && isPressingWithoutAuxiliaryKeys) {
6708
- const event = Object.values(EVENTS).find((ev) => ev.name === nameOfCustomEvent || ev.shortName === nameOfCustomEvent);
6709
- if (event && uniqueIdOfRecipient) {
6710
- (target ?? document).dispatchEvent(new CustomEvent(event.name, { ...event.options, detail: { id: uniqueIdOfRecipient, realEvent } }));
6597
+ const handleClickOutside = (0, import_react46.useCallback)(
6598
+ (e) => {
6599
+ const target = e.target;
6600
+ if (checkCondition(target)) hideComponent();
6601
+ },
6602
+ [hideComponent]
6603
+ );
6604
+ (0, import_react46.useEffect)(() => {
6605
+ if (!onlyGetRef) {
6606
+ document.addEventListener("mousedown", handleClickOutside, true);
6607
+ return () => {
6608
+ document.removeEventListener("mousedown", handleClickOutside, true);
6609
+ };
6711
6610
  }
6712
- }
6611
+ return () => {
6612
+ };
6613
+ }, []);
6614
+ return ref;
6713
6615
  }
6714
-
6715
- // src/Atomic/UI/Modal/partials/ModalFooter.tsx
6716
- var import_jsx_runtime38 = require("react/jsx-runtime");
6717
- var import_classnames31 = __toESM(require("classnames"), 1);
6718
- var import_react48 = require("react");
6719
- var ModalFooter = (0, import_react48.memo)(
6720
- ({ className = "", children, wrapperRef, testId = "modal-footer" }) => {
6721
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
6722
- "footer",
6723
- {
6724
- "data-testid": testId,
6725
- ref: wrapperRef,
6726
- className: (0, import_classnames31.default)("modal__footer", className),
6727
- role: "contentinfo",
6728
- "aria-label": "Modal footer",
6729
- children
6730
- }
6731
- );
6732
- }
6733
- );
6734
- ModalFooter.displayName = "ModalFooter";
6735
- var ModalFooter_default = ModalFooter;
6736
-
6737
- // src/Atomic/UI/Modal/partials/ModalTitle.tsx
6738
- var import_jsx_runtime39 = require("react/jsx-runtime");
6739
- var import_classnames32 = __toESM(require("classnames"), 1);
6740
- var import_react49 = require("react");
6741
- var import_react_feather11 = require("react-feather");
6742
- var ModalTitle = (0, import_react49.memo)(
6743
- ({
6744
- variant = "primary",
6745
- children,
6746
- isForced = false,
6747
- onClose,
6748
- closeBtnDisable,
6749
- noHeaderCloseBtn = false,
6750
- className,
6751
- wrapperRef,
6752
- testId = "modal-title"
6753
- }) => {
6754
- const closeModalRef = (0, import_react49.useRef)(onClose);
6755
- const handleClick = (0, import_react49.useMemo)(() => () => closeModalRef.current?.(), []);
6756
- (0, import_react49.useLayoutEffect)(() => {
6757
- closeModalRef.current = closeBtnDisable ? void 0 : onClose;
6758
- }, [onClose, closeBtnDisable]);
6759
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
6760
- "header",
6761
- {
6762
- "data-testid": testId,
6763
- ref: wrapperRef,
6764
- className: (0, import_classnames32.default)("modal__header", className, {
6765
- [`modal__header-${variant}`]: variant
6766
- }),
6767
- role: "banner",
6768
- "aria-label": "Modal header",
6769
- children: [
6770
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6771
- "span",
6772
- {
6773
- className: (0, import_classnames32.default)("modal__header-title", {
6774
- [`modal__header-${variant}-title`]: variant
6775
- }),
6776
- id: `${testId}-heading`,
6777
- children
6778
- }
6779
- ),
6780
- !isForced && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6781
- "button",
6782
- {
6783
- type: "button",
6784
- onClick: handleClick,
6785
- className: (0, import_classnames32.default)("modal-close-icon-box", {
6786
- "modal-close-icon-box-primary": variant === "primary",
6787
- "modal-close-icon-box--hidden": noHeaderCloseBtn
6788
- }),
6789
- "aria-label": "Close modal",
6790
- title: "Close modal",
6791
- children: !noHeaderCloseBtn && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_feather11.X, { className: "modal-close-icon", role: "img", "aria-hidden": "true" })
6792
- }
6793
- )
6794
- ]
6795
- }
6796
- );
6797
- }
6798
- );
6799
- ModalTitle.displayName = "ModalTitle";
6800
- var ModalTitle_default = ModalTitle;
6801
-
6802
- // src/Atomic/UI/Modal/partials/useMobileModal.tsx
6803
- var import_jsx_runtime40 = require("react/jsx-runtime");
6804
- var import_react50 = require("react");
6805
- var SCROLL_DIRECTION = {
6806
- UP: "up",
6807
- DOWN: "down"
6808
- };
6809
- function useMobileModal({
6810
- modalRef,
6811
- withMobileLogic = false,
6812
- withFixedFooter = false,
6813
- isOpen = false
6814
- }) {
6815
- const modalMobileContainerRef = (0, import_react50.useRef)(null);
6816
- const modalMobileHeaderRef = (0, import_react50.useRef)(null);
6817
- const modalMobileFooterRef = (0, import_react50.useRef)(null);
6818
- const modalMobileBodyRef = (0, import_react50.useRef)(null);
6819
- const { isMobile } = useIsMobile_default();
6820
- const [modalHeight, setModalHeight] = (0, import_react50.useState)(0);
6821
- const [modalsLogic, setModalsLogic] = (0, import_react50.useState)({
6822
- IS_HEADER_HIDDEN: false,
6823
- IS_HEADER_STICKY: false,
6824
- IS_FOOTER_HIDDEN: false,
6825
- IS_FOOTER_STICKY: withFixedFooter
6826
- });
6827
- const [modalsLogicProps, setModalsLogicProps] = (0, import_react50.useState)({
6828
- headerHeight: 0,
6829
- footerHeight: 0
6830
- });
6831
- const [scrollDirection, setScrollDirection] = (0, import_react50.useState)(SCROLL_DIRECTION.UP);
6832
- const [scrollTopPrev, setScrollTopPrev] = (0, import_react50.useState)(0);
6833
- const [scrollTop, setScrollTop] = (0, import_react50.useState)(0);
6834
- const [scrollHeight, setScrollHeight] = (0, import_react50.useState)(1);
6835
- const [, setContainerScrollHeight] = (0, import_react50.useState)(1);
6836
- (0, import_react50.useLayoutEffect)(() => {
6837
- const el = modalMobileContainerRef?.current;
6838
- if (el) {
6839
- el.addEventListener("scroll", () => {
6840
- setScrollTop((scrollTop2) => {
6841
- if (scrollTop2 !== el.scrollTop) setScrollTopPrev(scrollTop2);
6842
- return el.scrollTop;
6843
- });
6844
- });
6845
- }
6846
- }, [modalMobileContainerRef?.current]);
6847
- (0, import_react50.useEffect)(() => {
6848
- setScrollDirection(
6849
- (prevScrollDirection) => scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : scrollTop > scrollTopPrev ? SCROLL_DIRECTION.DOWN : prevScrollDirection
6850
- );
6851
- }, [scrollTop, scrollTopPrev]);
6852
- (0, import_react50.useLayoutEffect)(() => {
6853
- if (isOpen) {
6854
- const modalStyle = modalRef?.current ? modalRef?.current.style || window.getComputedStyle(modalRef?.current) : {};
6855
- const computedModalHeight = modalRef?.current ? modalHeight + Number.parseFloat(modalStyle?.marginTop || "0") : 0;
6856
- const windowHeight = document.documentElement.clientHeight || window.screen.availHeight || window.screen.height;
6857
- if (modalMobileContainerRef?.current) {
6858
- if (computedModalHeight <= windowHeight) {
6859
- modalMobileContainerRef.current.style.display = "flex";
6860
- modalMobileContainerRef.current.style.alignItems = "flex-end";
6861
- } else {
6862
- modalMobileContainerRef.current?.style?.removeProperty("display");
6863
- modalMobileContainerRef.current?.style?.removeProperty("align-items");
6864
- }
6865
- }
6866
- }
6867
- }, [modalsLogicProps, isOpen, isMobile, modalHeight]);
6868
- (0, import_react50.useLayoutEffect)(() => {
6869
- if (isMobile && isOpen) {
6870
- const newModalHeight = modalRef?.current?.getBoundingClientRect()?.height;
6871
- if (newModalHeight && modalHeight !== newModalHeight) {
6872
- setModalHeight(newModalHeight);
6873
- }
6874
- }
6875
- });
6876
- (0, import_react50.useEffect)(() => {
6877
- if (isMobile && withMobileLogic) {
6878
- const { footerHeight, headerHeight } = modalsLogicProps;
6879
- setModalsLogic((prevStickyLogic) => ({
6880
- IS_HEADER_HIDDEN: scrollDirection === SCROLL_DIRECTION.DOWN || scrollTop === 0,
6881
- IS_HEADER_STICKY: scrollDirection === SCROLL_DIRECTION.UP && scrollTop !== 0 && (scrollTop >= headerHeight || prevStickyLogic.IS_HEADER_STICKY),
6882
- IS_FOOTER_HIDDEN: !withFixedFooter && (scrollDirection === SCROLL_DIRECTION.UP || scrollHeight === Math.round(scrollTop)),
6883
- IS_FOOTER_STICKY: withFixedFooter && scrollHeight > 1 || scrollDirection === SCROLL_DIRECTION.DOWN && (scrollHeight - Math.round(scrollTop) >= footerHeight || prevStickyLogic.IS_FOOTER_STICKY)
6884
- }));
6885
- }
6886
- }, [
6887
- scrollTop,
6888
- scrollHeight,
6889
- isMobile,
6890
- withMobileLogic,
6891
- scrollDirection,
6892
- modalsLogicProps,
6893
- modalHeight,
6894
- window.innerHeight
6895
- ]);
6896
- (0, import_react50.useLayoutEffect)(() => {
6897
- if (modalMobileHeaderRef?.current?.getBoundingClientRect()?.height !== void 0) {
6898
- setModalsLogicProps((state) => ({
6899
- ...state,
6900
- headerHeight: modalMobileHeaderRef?.current?.getBoundingClientRect()?.height ?? 0
6901
- }));
6902
- }
6903
- }, [modalMobileHeaderRef?.current?.getBoundingClientRect()?.height]);
6904
- (0, import_react50.useLayoutEffect)(() => {
6905
- if (modalMobileFooterRef?.current?.getBoundingClientRect()?.height !== void 0) {
6906
- setModalsLogicProps((state) => ({
6907
- ...state,
6908
- footerHeight: modalMobileFooterRef?.current?.getBoundingClientRect()?.height ?? 0
6909
- }));
6910
- }
6911
- }, [modalMobileFooterRef?.current?.getBoundingClientRect()?.height]);
6912
- (0, import_react50.useEffect)(() => {
6913
- if (modalMobileContainerRef?.current) {
6914
- setContainerScrollHeight(modalMobileContainerRef?.current?.scrollHeight);
6915
- setScrollHeight(
6916
- modalMobileContainerRef?.current?.scrollHeight - window.innerHeight
6917
- );
6918
- }
6919
- }, [scrollTop, modalMobileContainerRef?.current, window.innerHeight]);
6920
- (0, import_react50.useEffect)(() => {
6921
- window.addEventListener("resize", () => {
6922
- setContainerScrollHeight((containerScrollHeight) => {
6923
- setScrollHeight(containerScrollHeight - window.innerHeight);
6924
- return containerScrollHeight;
6925
- });
6926
- });
6927
- }, []);
6928
- const renderModal = (0, import_react50.useCallback)(
6929
- (modal) => {
6930
- if (!isMobile || !withMobileLogic) return modal;
6931
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "modal-mobile-container", ref: modalMobileContainerRef, children: modal });
6932
- },
6933
- [isMobile, withMobileLogic]
6934
- );
6616
+ function useToggle(initialState) {
6617
+ const [isToggled, setToggle] = (0, import_react46.useState)(Boolean(initialState));
6618
+ const toggle = (0, import_react46.useCallback)(() => setToggle((isOn) => !isOn), []);
6619
+ const toggleOn = (0, import_react46.useCallback)(() => setToggle(true), []);
6620
+ const toggleOff = (0, import_react46.useCallback)(() => setToggle(false), []);
6935
6621
  return {
6936
- modalMobileContainerRef,
6937
- modalMobileHeaderRef,
6938
- modalMobileBodyRef,
6939
- modalMobileFooterRef,
6940
- MODALS_LOGIC: modalsLogic,
6941
- SCROLL_DIRECTION,
6942
- scrollTop,
6943
- scrollHeight,
6944
- renderModal,
6945
- isMobile
6622
+ isToggled,
6623
+ toggle,
6624
+ toggleOn,
6625
+ toggleOff
6946
6626
  };
6947
6627
  }
6948
-
6949
- // src/Atomic/UI/Modal/Modal.tsx
6950
- var import_classnames33 = __toESM(require("classnames"), 1);
6951
- var import_react51 = require("react");
6952
- var attrsForModalBodyDefault = {};
6953
- var KEY_CODE = Object.freeze({
6954
- ENTER: 13,
6955
- ESC: 27
6956
- });
6957
- function renderModalTitle({
6958
- mode,
6959
- title,
6960
- onlyTitle
6961
- }) {
6962
- if (mode && mode !== "default" && !onlyTitle) {
6963
- return `${mode[0].toUpperCase()}${mode.slice(1)} ${title}`;
6628
+ var INTERVALS = {
6629
+ today: {
6630
+ label: "today",
6631
+ start: () => (0, import_moment_timezone5.default)().startOf("day"),
6632
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6633
+ },
6634
+ yesterday: {
6635
+ label: "yesterday",
6636
+ start: () => (0, import_moment_timezone5.default)().subtract(1, "day").startOf("day"),
6637
+ end: () => (0, import_moment_timezone5.default)().startOf("day")
6638
+ },
6639
+ thisWeek: {
6640
+ label: "This Week",
6641
+ start: () => (0, import_moment_timezone5.default)().startOf("week"),
6642
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6643
+ },
6644
+ lastWeek: {
6645
+ label: "Last Week",
6646
+ start: () => (0, import_moment_timezone5.default)().subtract(1, "week").startOf("week"),
6647
+ end: () => (0, import_moment_timezone5.default)().startOf("week")
6648
+ },
6649
+ last7Days: {
6650
+ label: "Last 7 Days",
6651
+ start: () => (0, import_moment_timezone5.default)().subtract(6, "day").startOf("day"),
6652
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6653
+ },
6654
+ last14Days: {
6655
+ label: "Last 14 Days",
6656
+ start: () => (0, import_moment_timezone5.default)().subtract(13, "day").startOf("day"),
6657
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6658
+ },
6659
+ last30Days: {
6660
+ label: "Last 30 Days",
6661
+ start: () => (0, import_moment_timezone5.default)().subtract(29, "day").startOf("day"),
6662
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6663
+ },
6664
+ thisMonth: {
6665
+ label: "This Month",
6666
+ start: () => (0, import_moment_timezone5.default)().startOf("month"),
6667
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6668
+ },
6669
+ lastMonth: {
6670
+ label: "Last Month",
6671
+ start: () => (0, import_moment_timezone5.default)().subtract(1, "month").startOf("month"),
6672
+ end: () => (0, import_moment_timezone5.default)().startOf("month")
6673
+ },
6674
+ last3Months: {
6675
+ label: "Last 3 Months",
6676
+ start: () => (0, import_moment_timezone5.default)().subtract(3, "month").startOf("month"),
6677
+ end: () => (0, import_moment_timezone5.default)().startOf("month")
6678
+ },
6679
+ last6Months: {
6680
+ label: "Last 6 Months",
6681
+ start: () => (0, import_moment_timezone5.default)().subtract(6, "month").startOf("month"),
6682
+ end: () => (0, import_moment_timezone5.default)().startOf("month")
6683
+ },
6684
+ sixMonths: {
6685
+ label: "6 Months",
6686
+ isHidden: true,
6687
+ start: () => (0, import_moment_timezone5.default)().subtract(6, "month"),
6688
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6689
+ },
6690
+ thisYear: {
6691
+ label: "This Year",
6692
+ start: () => (0, import_moment_timezone5.default)().startOf("year"),
6693
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6694
+ },
6695
+ year: {
6696
+ label: "Year",
6697
+ isHidden: true,
6698
+ start: () => (0, import_moment_timezone5.default)().subtract(1, "year"),
6699
+ end: () => (0, import_moment_timezone5.default)().add(1, "day").startOf("day")
6700
+ },
6701
+ lastYear: {
6702
+ label: "Last Year",
6703
+ start: () => (0, import_moment_timezone5.default)().subtract(1, "year").startOf("year"),
6704
+ end: () => (0, import_moment_timezone5.default)().startOf("year")
6705
+ },
6706
+ allTime: {
6707
+ label: "All Time",
6708
+ start: () => (0, import_moment_timezone5.default)("2022-01-01T00:00:00"),
6709
+ end: () => (0, import_moment_timezone5.default)()
6710
+ // start: () => null,
6711
+ // end: () => null,
6964
6712
  }
6965
- return title;
6966
- }
6967
- function Modal({
6968
- ref,
6969
- id,
6970
- testId = "modal",
6971
- zIndex = 100,
6972
- isOpen,
6973
- onConfirm,
6974
- onDecline,
6975
- closeModal,
6976
- className,
6977
- variant = "primary",
6978
- size,
6979
- mode,
6980
- title,
6981
- onlyTitle,
6982
- atributesForModalBody = attrsForModalBodyDefault,
6983
- confirmBtnClassName,
6984
- confirmBtnLabel,
6985
- confirmBtnVariant = "primary",
6986
- confirmBtnDisable,
6987
- confirmBtnIcon,
6988
- isConfirmBtnIconPositionRight,
6989
- noConfirmBtn,
6990
- forced,
6991
- closeBtnClassName,
6992
- closeBtnText,
6993
- closeBtnVariant,
6994
- closeBtnDisable,
6995
- closeBtnIcon,
6996
- btnClassNames,
6997
- isCloseBtnIconPositionRight,
6998
- noCloseBtn,
6999
- noHeader,
7000
- noHeaderCloseBtn,
7001
- customHeader,
7002
- declineBtnDisable,
7003
- noFooter,
7004
- customFooter,
7005
- withFixedFooter,
7006
- leftContentOfFooter,
7007
- isSubmittingByEnter: isSubmittingByEnterOuter = true,
7008
- isClosingByEsc: isClosingByEscOuter = true,
7009
- withEventManagement = false,
7010
- submitOnEnter,
7011
- closeOnEsc,
7012
- withMobileLogic,
7013
- children
7014
- }) {
7015
- const internalRef = (0, import_react51.useRef)(null);
7016
- const modalRef = ref || internalRef;
7017
- const onConfirmRef = (0, import_react51.useRef)(onConfirm);
7018
- const closeModalRef = (0, import_react51.useRef)(closeModal);
7019
- const onDeclineRef = (0, import_react51.useRef)(onDecline);
7020
- const isSubmittingByEnter = submitOnEnter === false ? false : isSubmittingByEnterOuter;
7021
- const isClosingByEsc = closeOnEsc === false ? false : isClosingByEscOuter;
7022
- const withEventManagementStructure = getWithEventManagementStructure(id, withEventManagement);
7023
- const isUseAutoBlockingForHandlers = withEventManagementStructure.isWithSubmitAndCloseManagement;
7024
- const isOnConfirmBlocked = typeof onConfirm === "function" && isUseAutoBlockingForHandlers && confirmBtnDisable;
7025
- const isCloseModalBlocked = typeof closeModal === "function" && isUseAutoBlockingForHandlers && closeBtnDisable;
7026
- const isOnDeclineBlocked = typeof onDecline === "function" && isUseAutoBlockingForHandlers && declineBtnDisable;
7027
- const {
7028
- modalMobileHeaderRef,
7029
- modalMobileBodyRef,
7030
- modalMobileFooterRef,
7031
- MODALS_LOGIC,
7032
- renderModal,
7033
- isMobile,
7034
- scrollTop,
7035
- scrollHeight
7036
- } = useMobileModal({
7037
- withMobileLogic,
7038
- withFixedFooter,
7039
- isOpen
7040
- });
7041
- const handle = (0, import_react51.useMemo)(() => ({
7042
- confirm: () => onConfirmRef.current?.(),
7043
- close: () => closeModalRef.current?.(),
7044
- decline: () => {
7045
- if (typeof onDeclineRef.current === "function") onDeclineRef.current();
7046
- else closeModalRef.current?.();
7047
- }
7048
- }), []);
7049
- const suspendProcessing = {
7050
- // FIN-12482
7051
- // ? Чтобы НЕ замыкать рефку на модалку в логике, чтобы потом поискать в контенте все текстэриа,
7052
- // ? чтобы оценить есть ли среди них сфокусированная - делаем элеГАнтно:
7053
- // ? оцениваем ev.target, и если target это текстэриа, то вот сейчас то она и сфокусирована,
7054
- // ? т.е нужно приостановить процессы связанные с нажатием enter.
7055
- Enter: (ev) => ev?.target?.nodeName === "TEXTAREA"
7056
- // ? Колбеки опциональны, можно передавать только нужные
7057
- // Escape: (ev: globalThis.KeyboardEvent) => false,
7058
- };
7059
- useHandleKeyPress_default({
7060
- enterCallback: isSubmittingByEnter && typeof onConfirm === "function" && !confirmBtnDisable ? handle.confirm : void 0,
7061
- escCallback: isClosingByEsc && typeof closeModal === "function" ? handle.close : void 0,
7062
- withClamping: false,
7063
- withEventManagementStructure: {
7064
- isWithSubmitAndCloseManagement: confirmBtnDisable || withEventManagementStructure.isWithSubmitAndCloseManagement
7065
- },
7066
- suspendProcessing
7067
- });
7068
- (0, import_react51.useLayoutEffect)(() => {
7069
- onConfirmRef.current = isOnConfirmBlocked ? void 0 : onConfirm;
7070
- }, [onConfirm, isOnConfirmBlocked]);
7071
- (0, import_react51.useLayoutEffect)(() => {
7072
- closeModalRef.current = isCloseModalBlocked ? void 0 : closeModal;
7073
- }, [closeModal, isCloseModalBlocked]);
7074
- (0, import_react51.useLayoutEffect)(() => {
7075
- onDeclineRef.current = isOnDeclineBlocked ? () => {
7076
- } : onDecline;
7077
- }, [onDecline, isOnDeclineBlocked]);
7078
- (0, import_react51.useEffect)(() => {
7079
- const outerTarget = getIsOnlyAnObject(withEventManagement) ? withEventManagement.listenersTarget : void 0;
7080
- const target = outerTarget ?? document;
7081
- const onKeyPress = getOnKeyPress({ id, onSubmit: handle.confirm, onClose: handle.close, suspendProcessing });
7082
- if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
7083
- if (isSubmittingByEnter) target.addEventListener(EVENTS.iGotAnEnterKeyPress.name, onKeyPress);
7084
- if (isClosingByEsc) target.addEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
7085
- }
7086
- return () => {
7087
- if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
7088
- if (isSubmittingByEnter) target.removeEventListener(EVENTS.iGotAnEnterKeyPress.name, onKeyPress);
7089
- if (isClosingByEsc) target.removeEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
7090
- }
7091
- };
7092
- }, []);
7093
- if (!isOpen) return null;
7094
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
7095
- "div",
7096
- {
7097
- id: `${id}`,
7098
- style: { zIndex },
7099
- "data-testid": testId,
7100
- className: "modal-box j5",
7101
- role: "dialog",
7102
- "aria-modal": "true",
7103
- "aria-labelledby": `${testId}-title`,
7104
- children: renderModal(
7105
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
7106
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
7107
- "div",
7108
- {
7109
- "data-testid": `${testId}-overlay`,
7110
- className: isOpen ? "modal-overlay" : "hidden",
7111
- onClick: handle.close,
7112
- role: "presentation"
7113
- }
7114
- ),
7115
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
7116
- "div",
7117
- {
7118
- ref: modalRef,
7119
- style: { width: typeof size === "number" ? `${size}px` : `${size?.replace("px", "")}px` },
7120
- className: (0, import_classnames33.default)(className, {
7121
- "modal": isOpen,
7122
- "modal--no-header": isOpen && noHeader && !customHeader,
7123
- "modal-mobile": isOpen && isMobile,
7124
- "hidden": !isOpen
7125
- }),
7126
- children: [
7127
- customHeader || !noHeader && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
7128
- ModalTitle_default,
7129
- {
7130
- wrapperRef: modalMobileHeaderRef,
7131
- className: (0, import_classnames33.default)({
7132
- "modal__header--hidden": MODALS_LOGIC.IS_HEADER_HIDDEN,
7133
- "modal__header--sticky": !MODALS_LOGIC.IS_HEADER_HIDDEN && MODALS_LOGIC.IS_HEADER_STICKY
7134
- }),
7135
- variant,
7136
- isForced: forced,
7137
- onClose: handle.close,
7138
- noHeaderCloseBtn,
7139
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { id: `${testId}-title`, children: renderModalTitle({ mode, title, onlyTitle }) })
7140
- }
7141
- ),
7142
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
7143
- "div",
7144
- {
7145
- ...atributesForModalBody,
7146
- ref: modalMobileBodyRef,
7147
- className: (0, import_classnames33.default)("modal__body", {
7148
- "modal__body--no-footer": noFooter
7149
- }),
7150
- role: "document",
7151
- children
7152
- }
7153
- ),
7154
- (!noFooter || customFooter) && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
7155
- ModalFooter_default,
7156
- {
7157
- wrapperRef: modalMobileFooterRef,
7158
- className: (0, import_classnames33.default)({
7159
- "modal__footer--hidden": MODALS_LOGIC.IS_FOOTER_HIDDEN,
7160
- "modal__footer--sticky": !MODALS_LOGIC.IS_FOOTER_HIDDEN && MODALS_LOGIC.IS_FOOTER_STICKY && scrollTop !== scrollHeight,
7161
- "modal__footer_with-left-content": leftContentOfFooter
7162
- }),
7163
- children: customFooter || /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
7164
- leftContentOfFooter,
7165
- (!noCloseBtn || !noConfirmBtn) && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "modal__buttons-block", children: [
7166
- !noCloseBtn && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
7167
- Button_default,
7168
- {
7169
- testId: "modal",
7170
- className: (0, import_classnames33.default)(closeBtnClassName, btnClassNames),
7171
- variant: closeBtnVariant || "dark-outline",
7172
- onClick: handle.decline,
7173
- label: closeBtnText || "Cancel",
7174
- disabled: typeof onDecline === "function" ? declineBtnDisable : closeBtnDisable,
7175
- icon: closeBtnIcon,
7176
- isIconRight: isCloseBtnIconPositionRight,
7177
- tabIndex: 1,
7178
- "aria-label": "Close modal"
7179
- }
7180
- ),
7181
- !noConfirmBtn && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
7182
- Button_default,
7183
- {
7184
- testId: "modal",
7185
- onClick: handle.confirm,
7186
- label: confirmBtnLabel || mode && mode?.[0].toUpperCase() + mode?.slice(1) || "Apply",
7187
- className: (0, import_classnames33.default)("ml5", confirmBtnClassName, btnClassNames),
7188
- variant: confirmBtnVariant,
7189
- disabled: confirmBtnDisable,
7190
- icon: confirmBtnIcon,
7191
- isIconRight: isConfirmBtnIconPositionRight,
7192
- "aria-label": "Confirm modal"
7193
- }
7194
- )
7195
- ] })
7196
- ] })
7197
- }
7198
- )
7199
- ]
7200
- }
7201
- )
7202
- ] })
7203
- )
6713
+ };
6714
+ var ALL_TIME_KEY = "allTime";
6715
+ var CUSTOM_INTERVAL_KEY = "customDate";
6716
+ var CUSTOM_INTERVAL_KEY_TEXT = "Custom Date";
6717
+ var MAIN_FORMAT = "YYYY-MM-DDTHH:mm";
6718
+ var MAIN_DATE_FORMAT = "YYYY-MM-DD";
6719
+ var MAIN_TIME_FORMAT = "HH:mm";
6720
+ function getActualDateRange(inputDateRange) {
6721
+ const getActualIntervalKey = () => {
6722
+ if (inputDateRange?.intervalKey && Object.keys(INTERVALS).includes(inputDateRange.intervalKey)) {
6723
+ return inputDateRange.intervalKey;
6724
+ } else if (inputDateRange?.start && inputDateRange?.end) {
6725
+ for (const [key, interval2] of Object.entries(INTERVALS)) {
6726
+ if ((0, import_moment_timezone5.default)(inputDateRange.start).isSame(interval2.start()) && (0, import_moment_timezone5.default)(inputDateRange.end).isSame(interval2.end())) {
6727
+ return key;
6728
+ }
6729
+ }
6730
+ return CUSTOM_INTERVAL_KEY;
7204
6731
  }
7205
- );
6732
+ return ALL_TIME_KEY;
6733
+ };
6734
+ const getIntervalDate = (intervalKey) => {
6735
+ if (intervalKey === ALL_TIME_KEY || intervalKey === CUSTOM_INTERVAL_KEY) {
6736
+ return {
6737
+ start: null,
6738
+ end: null,
6739
+ compare: inputDateRange?.compare,
6740
+ startPrevDate: null,
6741
+ endPrevDate: null
6742
+ };
6743
+ }
6744
+ const actualValues = {
6745
+ start: INTERVALS[intervalKey]?.start()?.format(MAIN_FORMAT),
6746
+ end: INTERVALS[intervalKey]?.end()?.format(MAIN_FORMAT),
6747
+ compare: inputDateRange?.compare
6748
+ };
6749
+ if (actualValues.compare) {
6750
+ const intervalHoursCount = (0, import_moment_timezone5.default)(actualValues.end).diff(
6751
+ actualValues.start,
6752
+ "hours"
6753
+ );
6754
+ actualValues.startPrevDate = (0, import_moment_timezone5.default)(actualValues.start).subtract(intervalHoursCount, "hours").toDate();
6755
+ actualValues.endPrevDate = actualValues.start;
6756
+ }
6757
+ return actualValues;
6758
+ };
6759
+ const interval = getActualIntervalKey();
6760
+ return interval !== CUSTOM_INTERVAL_KEY && interval !== ALL_TIME_KEY ? { intervalKey: interval, ...getIntervalDate(interval) } : { ...inputDateRange, intervalKey: interval };
7206
6761
  }
7207
- Modal.displayName = "Modal";
7208
- var Modal_default = Modal;
7209
6762
 
7210
6763
  // src/Atomic/FormElements/InputDateRange/components/Datepicker.tsx
7211
- var import_jsx_runtime44 = require("react/jsx-runtime");
7212
-
7213
- // src/Atomic/FormElements/RangeCalendar/RangeCalendar.js
7214
- var import_jsx_runtime42 = require("react/jsx-runtime");
7215
- var import_react52 = __toESM(require("react"), 1);
7216
- var import_classnames34 = __toESM(require("classnames"), 1);
7217
- var import_moment_timezone4 = __toESM(require("moment-timezone"), 1);
7218
- var RangeCalendar = (props) => {
6764
+ var import_classnames33 = __toESM(require("classnames"), 1);
6765
+ var import_moment_timezone6 = __toESM(require("moment-timezone"), 1);
6766
+ var import_react47 = require("react");
6767
+ var DATE_INPUT_FORMAT = "MM/DD/YYYY";
6768
+ function padTime2(time) {
6769
+ return `${time.toString().padStart(2, "0")}:00`;
6770
+ }
6771
+ var Datepicker2 = (props) => {
7219
6772
  const {
6773
+ txt,
7220
6774
  className,
7221
- date,
7222
- setDate,
7223
- startDate,
7224
- endDate,
7225
- allowPrev = true,
7226
- allowNext = true,
7227
- onClick = () => {
7228
- },
7229
- onHover = () => {
7230
- },
7231
- startPrevDate,
7232
- endPrevDate,
6775
+ buttonsTypes = {},
6776
+ values = {},
6777
+ onChange,
6778
+ onChangeMobile,
6779
+ onChangeCompare,
6780
+ onCancel,
6781
+ getSelectedMode,
6782
+ onChangeInterval,
6783
+ isCompareHidden,
7233
6784
  limitRange,
6785
+ setActiveInterval,
7234
6786
  isShortWeekNames,
7235
6787
  minDate,
7236
6788
  maxDate,
7237
6789
  momentMinDate,
7238
6790
  momentMaxDate,
7239
6791
  isDontLimitFuture,
7240
- testId = "range-calendar"
6792
+ testId,
6793
+ mainId,
6794
+ withMobileLogic,
6795
+ isDoNotPullOutListOfMainContainer
7241
6796
  } = props;
7242
- const [days, setDays] = (0, import_react52.useState)({});
7243
- const title = (0, import_react52.useMemo)(
7244
- () => `${(0, import_moment_timezone4.default)(date).format("MMM")} ${(0, import_moment_timezone4.default)(date).format("YYYY")}`,
7245
- [date]
6797
+ const { start = null, end = null, compare: compare2 = false } = values;
6798
+ const startDateInputRef = (0, import_react47.useRef)(null);
6799
+ const endDateInputRef = (0, import_react47.useRef)(null);
6800
+ const [startDate, setStartDate] = (0, import_react47.useState)(
6801
+ getIsDateValid(start) ? (0, import_moment_timezone6.default)(start) : ""
7246
6802
  );
7247
- (0, import_react52.useEffect)(() => {
7248
- const result = {};
7249
- const day = (0, import_moment_timezone4.default)(date).startOf("month");
7250
- const daysInMonth = day.daysInMonth();
7251
- for (let d = 0; d < daysInMonth; d += 1) {
7252
- let week = day.week();
7253
- if (day.month() === 11 && week === 1) week = 53;
7254
- if (day.month() === 0 && week === 53) week = 0;
7255
- if (!Object.prototype.hasOwnProperty.call(result, week)) {
7256
- result[week] = {};
6803
+ const [endDate, setEndDate] = (0, import_react47.useState)(
6804
+ getIsDateValid(end) ? (0, import_moment_timezone6.default)(end) : ""
6805
+ );
6806
+ const dateInterval = getSelectedMode({ start: startDate, end: endDate });
6807
+ const [startDateInput, setStartDateInput] = (0, import_react47.useState)(null);
6808
+ const [endDateInput, setEndDateInput] = (0, import_react47.useState)(null);
6809
+ const [isStartFocused, setIsStartFocused] = (0, import_react47.useState)(false);
6810
+ const [isEndFocused, setIsEndFocused] = (0, import_react47.useState)(false);
6811
+ const [startHour, setStartHour] = (0, import_react47.useState)(start ? (0, import_moment_timezone6.default)(start).hour() : 0);
6812
+ const [endHour, setEndHour] = (0, import_react47.useState)(end ? (0, import_moment_timezone6.default)(end).hour() : 0);
6813
+ const [isCompare, setIsCompare] = (0, import_react47.useState)(compare2);
6814
+ const [date1, setDate1] = (0, import_react47.useState)(
6815
+ start ? (0, import_moment_timezone6.default)(start) : (0, import_moment_timezone6.default)().subtract(1, "month")
6816
+ );
6817
+ const [date2, setDate2] = (0, import_react47.useState)(end ? (0, import_moment_timezone6.default)(end) : (0, import_moment_timezone6.default)());
6818
+ const isNearby = (0, import_react47.useMemo)(
6819
+ () => (0, import_moment_timezone6.default)(date2).subtract(1, "month").isSame((0, import_moment_timezone6.default)(date1), "month"),
6820
+ [date1, date2]
6821
+ );
6822
+ const isPreviousPeriodShowed = (0, import_react47.useMemo)(
6823
+ () => isCompare && !isCompareHidden && startDate && endDate,
6824
+ [startDate, endDate, isCompare]
6825
+ );
6826
+ const prevEndHour = (0, import_react47.useRef)(endHour);
6827
+ const startPrevDate = (0, import_react47.useMemo)(() => {
6828
+ if (isPreviousPeriodShowed) {
6829
+ const intervalHoursCount = (0, import_moment_timezone6.default)(endDate).diff(startDate, "hours");
6830
+ return (0, import_moment_timezone6.default)(startDate).subtract(intervalHoursCount, "hours").toDate();
6831
+ } else {
6832
+ return null;
6833
+ }
6834
+ }, [startDate, endDate, isCompare]);
6835
+ const endPrevDate = (0, import_react47.useMemo)(() => {
6836
+ if (isPreviousPeriodShowed) {
6837
+ return startDate;
6838
+ } else {
6839
+ return null;
6840
+ }
6841
+ }, [startDate, endDate, isCompare]);
6842
+ const title = (0, import_react47.useMemo)(() => {
6843
+ if (isCompare && !isCompareHidden && startDate && endDate) {
6844
+ return `${(0, import_moment_timezone6.default)(startPrevDate).format("ll")} (${(0, import_moment_timezone6.default)(startPrevDate).format(MAIN_TIME_FORMAT)}) - ${(0, import_moment_timezone6.default)(
6845
+ endPrevDate
6846
+ ).format("ll")} (${(0, import_moment_timezone6.default)(endPrevDate).format(MAIN_TIME_FORMAT)})`;
6847
+ } else {
6848
+ return "";
6849
+ }
6850
+ }, [startDate, endDate, isCompare]);
6851
+ const subtractDay = (date) => endHour === 0 ? (0, import_moment_timezone6.default)(date).subtract(1, "days") : (0, import_moment_timezone6.default)(date);
6852
+ const addDay = (date) => endHour === 0 ? (0, import_moment_timezone6.default)(date).add(1, "days") : (0, import_moment_timezone6.default)(date);
6853
+ const getCorrectedDateForDateInput = (key, date) => {
6854
+ if (key === "startDateInput") return (0, import_moment_timezone6.default)(date);
6855
+ return subtractDay((0, import_moment_timezone6.default)(date));
6856
+ };
6857
+ const setInterval2 = () => {
6858
+ setActiveInterval?.(
6859
+ getActualDateRange({ start: startDate, end: endDate }).intervalKey
6860
+ );
6861
+ };
6862
+ const handleClick = (date) => {
6863
+ prevEndHour.current = 0;
6864
+ if (!startDate || startDate && endDate && !((0, import_moment_timezone6.default)(startDate).add(1, "d").isSame(endDate, "day") && endHour === 0)) {
6865
+ setStartDate((0, import_moment_timezone6.default)(date).startOf("day"));
6866
+ setEndDate((0, import_moment_timezone6.default)(date).add(1, "d").startOf("day"));
6867
+ setStartHour(0);
6868
+ setEndHour(0);
6869
+ } else if ((0, import_moment_timezone6.default)(date).isBefore((0, import_moment_timezone6.default)(startDate), "day")) {
6870
+ setEndDate((0, import_moment_timezone6.default)(startDate).add(1, "d").startOf("day"));
6871
+ setStartDate((0, import_moment_timezone6.default)(date).set("hour", Number.parseInt(startHour.toString(), 10)));
6872
+ } else if ((0, import_moment_timezone6.default)(date).isAfter((0, import_moment_timezone6.default)(startDate), "day")) {
6873
+ setEndDate((0, import_moment_timezone6.default)(date).add(1, "d").startOf("day"));
6874
+ }
6875
+ };
6876
+ const handleChangeStartHour = (val) => {
6877
+ setStartHour(Number(val));
6878
+ setStartDate((0, import_moment_timezone6.default)(startDate || (0, import_moment_timezone6.default)()).set("hour", Number(val)));
6879
+ };
6880
+ const handleChangeEndHour = (val) => {
6881
+ const newHour = Number(val);
6882
+ setEndHour(newHour);
6883
+ let newEndDate = (0, import_moment_timezone6.default)();
6884
+ if (endDate) {
6885
+ if (prevEndHour.current === 0 && newHour !== 0) {
6886
+ newEndDate = (0, import_moment_timezone6.default)(endDate).subtract(1, "days");
6887
+ } else if (prevEndHour.current !== 0 && newHour === 0) {
6888
+ newEndDate = (0, import_moment_timezone6.default)(endDate).add(1, "days");
7257
6889
  }
7258
- result[week][day.weekday()] = { date: day.toDate() };
7259
- day.add(1, "d");
7260
6890
  }
7261
- setDays(result);
7262
- }, [date]);
7263
- const renderDay = (week, dayOfWeek) => {
7264
- const day = days[week][dayOfWeek];
7265
- const isFutureDay = day && (0, import_moment_timezone4.default)(day.date).isAfter((0, import_moment_timezone4.default)(), "day");
7266
- const isPastDay = limitRange ? day && (0, import_moment_timezone4.default)(day.date).isBefore((0, import_moment_timezone4.default)().subtract(limitRange, "days"), "day") : null;
7267
- const isRangeStart = day && (0, import_moment_timezone4.default)(day.date).isSame(startDate, "day");
7268
- const isRangeEnd = day && (0, import_moment_timezone4.default)(day.date).isSame((0, import_moment_timezone4.default)(endDate).subtract(1, "hour"), "day");
7269
- const isRangeInside = day && startDate && endDate && (0, import_moment_timezone4.default)(day.date).isAfter(startDate, "day") && (0, import_moment_timezone4.default)(day.date).isBefore((0, import_moment_timezone4.default)(endDate).subtract(1, "hour"), "day");
7270
- const isPrevRangeEnd = day && ((0, import_moment_timezone4.default)(day.date).isSame(startPrevDate, "day") || (0, import_moment_timezone4.default)(day.date).isSame((0, import_moment_timezone4.default)(endPrevDate).subtract(1, "day"), "day"));
7271
- const isPrevRangeInside = day && startPrevDate && endPrevDate && (0, import_moment_timezone4.default)(day.date).isAfter(startPrevDate, "day") && (0, import_moment_timezone4.default)(day.date).isBefore((0, import_moment_timezone4.default)(endPrevDate).subtract(1, "day"), "day");
7272
- const classNames2 = (0, import_classnames34.default)(
7273
- "range-calendar__day",
7274
- { "range-calendar__day--clickable": day },
6891
+ prevEndHour.current = newHour;
6892
+ setEndDate((0, import_moment_timezone6.default)(newEndDate).set("hour", newHour));
6893
+ };
6894
+ const handleDateInputFocus = (key, e) => {
6895
+ const changeFlag = key === "startDateInput" ? setIsStartFocused : setIsEndFocused;
6896
+ const set = key === "startDateInput" ? setStartDateInput : setEndDateInput;
6897
+ const date = key === "startDateInput" ? startDate : endDate;
6898
+ changeFlag(true);
6899
+ set(date ? getCorrectedDateForDateInput(key, date).format("L") : "");
6900
+ setTimeout(() => {
6901
+ const defaultTarget = key === "startDateInput" ? startDateInputRef.current : endDateInputRef.current;
6902
+ const target = e?.target ?? defaultTarget;
6903
+ target.select?.();
6904
+ }, 0);
6905
+ };
6906
+ const doBlur = (type, e) => {
6907
+ const executor = type === "startDateInput" ? setIsStartFocused : setIsEndFocused;
6908
+ e.target.blur();
6909
+ executor(false);
6910
+ };
6911
+ const processOverflow = (newDateAsString, valueForRollback, key) => {
6912
+ const newDateAsMomentObj = (0, import_moment_timezone6.default)(newDateAsString, DATE_INPUT_FORMAT);
6913
+ if (!newDateAsMomentObj.isValid()) {
6914
+ return valueForRollback;
6915
+ } else {
6916
+ const beforeOfFuture = (0, import_moment_timezone6.default)().endOf("day");
6917
+ const hour = key === "startDateInput" ? startHour : endHour;
6918
+ let output;
6919
+ if (minDate && newDateAsMomentObj.isBefore(momentMinDate)) {
6920
+ output = momentMinDate;
6921
+ } else if (maxDate && newDateAsMomentObj.isAfter(momentMaxDate)) {
6922
+ output = momentMaxDate;
6923
+ } else if (!isDontLimitFuture && newDateAsMomentObj.isAfter(beforeOfFuture)) {
6924
+ output = beforeOfFuture.startOf("day");
6925
+ } else {
6926
+ output = newDateAsMomentObj;
6927
+ }
6928
+ if (key === "endDateInput") {
6929
+ output = addDay(output);
6930
+ }
6931
+ return output.set("hour", Number.parseInt(hour.toString(), 10));
6932
+ }
6933
+ };
6934
+ const handleDateInputBlur = (key, e) => {
6935
+ const reserveValue = key === "startDateInput" ? startDateInput : endDateInput;
6936
+ const valueForRollback = key === "startDateInput" ? startDate : endDate;
6937
+ const execute = key === "startDateInput" ? setStartDate : setEndDate;
6938
+ const executeForCalendar = key === "startDateInput" ? setDate1 : setDate2;
6939
+ const prepareValueForCalendar = (newDate) => {
6940
+ if (key === "endDateInput") return newDate;
6941
+ return (0, import_moment_timezone6.default)(newDate).isSameOrAfter((0, import_moment_timezone6.default)(date2), "month") ? (0, import_moment_timezone6.default)(date2).subtract(1, "month") : (0, import_moment_timezone6.default)(newDate);
6942
+ };
6943
+ const newDateValue = e?.target?.value ?? reserveValue;
6944
+ const processedNewDate = processOverflow(
6945
+ newDateValue,
6946
+ valueForRollback,
6947
+ key
6948
+ );
6949
+ execute(processedNewDate);
6950
+ executeForCalendar(prepareValueForCalendar(processedNewDate));
6951
+ doBlur(key, e);
6952
+ };
6953
+ const handleKeyPressed = (code, e, type) => {
6954
+ if (code === 13) {
6955
+ const syntheticEvent = {
6956
+ target: e.target,
6957
+ relatedTarget: null
6958
+ };
6959
+ handleDateInputBlur(type, syntheticEvent);
6960
+ }
6961
+ if (code === 27) doBlur(type, e);
6962
+ };
6963
+ const getStartHourItems = () => [...Array.from({ length: 24 }).keys()].map((hour) => ({
6964
+ label: padTime2(hour),
6965
+ value: hour,
6966
+ disabled: (0, import_moment_timezone6.default)(startDate).isSame(endDate, "day") && endHour <= hour
6967
+ }));
6968
+ const getEndHourItems = () => [...Array.from({ length: 24 }).keys()].map((hour) => ({
6969
+ label: padTime2(hour + 1),
6970
+ value: hour === 23 ? 0 : hour + 1,
6971
+ disabled: ((0, import_moment_timezone6.default)(startDate).isSame(endDate, "day") || (0, import_moment_timezone6.default)(startDate).isSame(
6972
+ (0, import_moment_timezone6.default)(endDate).subtract(1, "days"),
6973
+ "day"
6974
+ ) && endHour === 0) && hour < startHour
6975
+ }));
6976
+ const renderButtons = () => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
6977
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6978
+ Button_default,
7275
6979
  {
7276
- "range-calendar__day--disabled": isPastDay || minDate && (0, import_moment_timezone4.default)(day?.date).isBefore(momentMinDate, "day") || !isDontLimitFuture && (maxDate ? (0, import_moment_timezone4.default)(day?.date).isAfter(momentMaxDate) : isFutureDay)
7277
- },
7278
- { "range-calendar__day--range-start": isRangeStart },
7279
- { "range-calendar__day--range-end": isRangeEnd },
7280
- { "range-calendar__day--range-inside": isRangeInside },
7281
- { "range-calendar__day--prev-range-end": isPrevRangeEnd },
7282
- { "range-calendar__day--prev-range-inside": isPrevRangeInside }
7283
- );
7284
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
7285
- "div",
6980
+ className: "date-picker__button",
6981
+ onClick: () => onCancel?.(),
6982
+ variant: buttonsTypes?.cancel,
6983
+ children: txt?.buttons?.cancel || "Cancel"
6984
+ }
6985
+ ),
6986
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6987
+ Button_default,
7286
6988
  {
7287
- className: classNames2,
7288
- onClick: day ? (e) => onClick(day.date, e) : null,
7289
- onMouseOver: day ? () => onHover(day.date) : null,
7290
- onMouseLeave: () => onHover(null),
7291
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "calendar__day-num", children: day && day.date.getDate() })
7292
- },
7293
- `${week}_${dayOfWeek}`
7294
- );
7295
- };
7296
- const handlePrev = () => {
7297
- setDate((0, import_moment_timezone4.default)(date).subtract(1, "month").toDate());
7298
- };
7299
- const handleNext = () => {
7300
- setDate((0, import_moment_timezone4.default)(date).add(1, "month").toDate());
6989
+ className: "date-picker__button",
6990
+ variant: buttonsTypes?.apply,
6991
+ disabled: !startDate || !endDate,
6992
+ onClick: () => onChange?.({
6993
+ start: (0, import_moment_timezone6.default)(startDate).format(MAIN_FORMAT),
6994
+ end: (0, import_moment_timezone6.default)(endDate).format(MAIN_FORMAT),
6995
+ startPrevDate: (0, import_moment_timezone6.default)(startPrevDate).format(MAIN_FORMAT),
6996
+ endPrevDate: (0, import_moment_timezone6.default)(endPrevDate).format(MAIN_FORMAT),
6997
+ compare: isCompare
6998
+ }),
6999
+ children: txt?.buttons?.apply || "apply"
7000
+ }
7001
+ )
7002
+ ] });
7003
+ const renderPreviousPeriod = () => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
7004
+ txt?.labels?.previousPeriod || "",
7005
+ ":",
7006
+ " ",
7007
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "date-picker__previous-period-interval", children: title })
7008
+ ] });
7009
+ (0, import_react47.useEffect)(() => {
7010
+ if ((0, import_moment_timezone6.default)(startDate).isSameOrAfter(endDate)) {
7011
+ setStartDate((0, import_moment_timezone6.default)(endDate).subtract(1, "d"));
7012
+ setDate1((0, import_moment_timezone6.default)(endDate).subtract(1, "d"));
7013
+ }
7014
+ }, [startDate]);
7015
+ (0, import_react47.useEffect)(() => {
7016
+ if ((0, import_moment_timezone6.default)(endDate).isSameOrBefore(startDate)) {
7017
+ setEndDate((0, import_moment_timezone6.default)(startDate).add(1, "d"));
7018
+ setDate2((0, import_moment_timezone6.default)(startDate).add(1, "d"));
7019
+ }
7020
+ }, [endDate]);
7021
+ (0, import_react47.useEffect)(() => {
7022
+ if ((0, import_moment_timezone6.default)(startDate).isBefore((0, import_moment_timezone6.default)(endDate), "month")) {
7023
+ setDate1((0, import_moment_timezone6.default)(startDate));
7024
+ setDate2((0, import_moment_timezone6.default)(endDate));
7025
+ }
7026
+ setInterval2();
7027
+ }, [startDate, endDate]);
7028
+ (0, import_react47.useEffect)(() => {
7029
+ if ((0, import_moment_timezone6.default)(date1).isSameOrAfter((0, import_moment_timezone6.default)(date2), "month") && !withMobileLogic) {
7030
+ setDate1((0, import_moment_timezone6.default)(date2).subtract(1, "month"));
7031
+ }
7032
+ }, [date1, date2]);
7033
+ (0, import_react47.useEffect)(() => {
7034
+ onChangeInterval(dateInterval);
7035
+ }, [dateInterval]);
7036
+ (0, import_react47.useEffect)(() => {
7037
+ if (typeof onChangeMobile === "function") {
7038
+ onChangeMobile({
7039
+ start: (0, import_moment_timezone6.default)(startDate).format(MAIN_FORMAT),
7040
+ end: (0, import_moment_timezone6.default)(endDate).format(MAIN_FORMAT),
7041
+ startPrevDate: (0, import_moment_timezone6.default)(startPrevDate).format(MAIN_FORMAT),
7042
+ endPrevDate: (0, import_moment_timezone6.default)(endPrevDate).format(MAIN_FORMAT),
7043
+ compare: isCompare
7044
+ });
7045
+ }
7046
+ }, [startDate, endDate, startPrevDate, endPrevDate, isCompare]);
7047
+ const renderRowStart = () => {
7048
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "date-picker__date-row", children: [
7049
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
7050
+ DateInput_default,
7051
+ {
7052
+ ref: startDateInputRef,
7053
+ testId: `datepicker-${testId}_start-date-input`,
7054
+ RC: "date-picker__date-input",
7055
+ className: (0, import_classnames33.default)("date-picker__date-input"),
7056
+ isFocused: isStartFocused,
7057
+ value: startDateInput,
7058
+ date: getCorrectedDateForDateInput("startDateInput", startDate),
7059
+ disabled: !startDate,
7060
+ onChange: setStartDateInput,
7061
+ onFocus: (e) => handleDateInputFocus("startDateInput", e),
7062
+ onBlur: (e) => handleDateInputBlur("startDateInput", e),
7063
+ onKeyUp: (code, e) => handleKeyPressed(+code, e, "startDateInput")
7064
+ }
7065
+ ),
7066
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
7067
+ Dropdown_default,
7068
+ {
7069
+ testId,
7070
+ id: `datepicker-id-${mainId}_start-hour-select-input`,
7071
+ className: (0, import_classnames33.default)("date-picker__hour-select-input"),
7072
+ onChange: (value) => handleChangeStartHour(value),
7073
+ value: startHour,
7074
+ options: getStartHourItems(),
7075
+ disabled: !startDate,
7076
+ isDoNotPullOutListOfMainContainer,
7077
+ withMobileLogic
7078
+ }
7079
+ )
7080
+ ] });
7301
7081
  };
7302
- const getFormatedWeekName = (input) => isShortWeekNames ? input.charAt(0) : input;
7303
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: (0, import_classnames34.default)("range-calendar", className), "data-testid": testId, children: [
7304
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "range-calendar-header", children: [
7305
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
7306
- Arrow_default,
7082
+ const renderRowEnd = () => {
7083
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "date-picker__date-row", children: [
7084
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
7085
+ DateInput_default,
7307
7086
  {
7308
- type: "left",
7309
- disabled: !allowPrev || minDate && (0, import_moment_timezone4.default)(date).startOf("month").isSameOrBefore(momentMinDate, "months"),
7310
- onClick: handlePrev,
7311
- className: "range-calendar-header__prev"
7087
+ ref: endDateInputRef,
7088
+ testId: `datepicker-${testId}_start-date-input`,
7089
+ RC: "date-picker__date-input",
7090
+ className: (0, import_classnames33.default)("date-picker__date-input"),
7091
+ isFocused: isEndFocused,
7092
+ value: endDateInput,
7093
+ date: getCorrectedDateForDateInput("endDateInput", endDate),
7094
+ disabled: !endDate,
7095
+ onChange: setEndDateInput,
7096
+ onFocus: (e) => handleDateInputFocus("endDateInput", e),
7097
+ onBlur: (e) => handleDateInputBlur("endDateInput", e),
7098
+ onKeyUp: (code, e) => handleKeyPressed(+code, e, "endDateInput")
7312
7099
  }
7313
7100
  ),
7314
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "range-calendar-header__title", children: title }),
7315
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
7316
- Arrow_default,
7101
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
7102
+ Dropdown_default,
7317
7103
  {
7318
- type: "right",
7319
- disabled: !allowNext || !isDontLimitFuture && (0, import_moment_timezone4.default)(date).startOf("month").isSameOrAfter(
7320
- maxDate ? momentMaxDate : (0, import_moment_timezone4.default)().add(1, "day").startOf("day"),
7321
- "months"
7322
- ),
7323
- onClick: handleNext,
7324
- className: "range-calendar-header__next"
7104
+ testId,
7105
+ id: `datepicker-id-${mainId}_end-hour-select-input`,
7106
+ className: (0, import_classnames33.default)("date-picker__hour-select-input"),
7107
+ onChange: (value) => handleChangeEndHour(value),
7108
+ value: endHour,
7109
+ options: getEndHourItems(),
7110
+ disabled: !endDate,
7111
+ isDoNotPullOutListOfMainContainer,
7112
+ withMobileLogic
7325
7113
  }
7326
7114
  )
7327
- ] }),
7328
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "range-calendar__week range-calendar__week-title", children: [...Array(7).keys()].map((dayOfWeek) => {
7329
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
7115
+ ] });
7116
+ };
7117
+ const renderCalendarStart = () => {
7118
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
7119
+ RangeCalendar_default,
7120
+ {
7121
+ testId,
7122
+ className: "date-picker__calendar",
7123
+ date: date1,
7124
+ setDate: setDate1,
7125
+ allowNext: withMobileLogic ? !(0, import_moment_timezone6.default)(date1).startOf("month").isSameOrAfter((0, import_moment_timezone6.default)().startOf("day"), "months") : !isNearby,
7126
+ startDate,
7127
+ endDate,
7128
+ startPrevDate,
7129
+ endPrevDate,
7130
+ onClick: handleClick,
7131
+ limitRange,
7132
+ isShortWeekNames,
7133
+ minDate,
7134
+ maxDate,
7135
+ momentMinDate,
7136
+ momentMaxDate
7137
+ }
7138
+ );
7139
+ };
7140
+ const renderCalendarEnd = () => {
7141
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
7142
+ RangeCalendar_default,
7143
+ {
7144
+ className: "date-picker__calendar",
7145
+ date: date2,
7146
+ setDate: setDate2,
7147
+ allowPrev: !isNearby,
7148
+ startDate,
7149
+ endDate,
7150
+ startPrevDate,
7151
+ endPrevDate,
7152
+ onClick: handleClick,
7153
+ isShortWeekNames,
7154
+ minDate,
7155
+ maxDate,
7156
+ momentMinDate,
7157
+ momentMaxDate,
7158
+ isDontLimitFuture
7159
+ }
7160
+ );
7161
+ };
7162
+ const render = () => {
7163
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: (0, import_classnames33.default)("date-picker", className), children: [
7164
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "date-picker__header", children: [
7165
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "date-picker__inputs-block", children: [
7166
+ renderRowStart(),
7167
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__inputs-separator date-picker__header--gray", children: "\u2014" }),
7168
+ renderRowEnd()
7169
+ ] }),
7170
+ isCompare && !isCompareHidden && startDate && endDate && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__previous-period", children: renderPreviousPeriod() })
7171
+ ] }),
7172
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__calendars", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "date-picker__calendars-wrapper", children: [
7173
+ renderCalendarStart(),
7174
+ renderCalendarEnd()
7175
+ ] }) }),
7176
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
7330
7177
  "div",
7331
7178
  {
7332
- className: "range-calendar__day range-calendar__day--title",
7333
- children: getFormatedWeekName((0, import_moment_timezone4.default)().weekday(dayOfWeek).format("dd"))
7334
- },
7335
- `day-of-week_${dayOfWeek}`
7336
- );
7337
- }) }),
7338
- Object.keys(days).map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "range-calendar__week", children: [...Array(7).keys()].map((dayOfWeek) => renderDay(week, dayOfWeek)) }, `week_${index}`))
7339
- ] });
7179
+ className: (0, import_classnames33.default)("date-picker__footer", {
7180
+ "date-picker__footer_once-element": isCompareHidden
7181
+ }),
7182
+ children: [
7183
+ !isCompareHidden ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__compare-block", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mr5", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
7184
+ Switcher_default,
7185
+ {
7186
+ label: txt?.labels?.compare || "Compare",
7187
+ isActive: isCompare,
7188
+ onChange: () => {
7189
+ onChangeCompare?.(!isCompare);
7190
+ setIsCompare((state) => !state);
7191
+ }
7192
+ }
7193
+ ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", {}),
7194
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__buttons-block", children: renderButtons() })
7195
+ ]
7196
+ }
7197
+ )
7198
+ ] });
7199
+ };
7200
+ const renderMobile = () => {
7201
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: (0, import_classnames33.default)("date-picker", className), children: [
7202
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "date-picker__header", children: [
7203
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "date-picker__inputs-block", children: [
7204
+ renderRowStart(),
7205
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__inputs-separator date-picker__header--gray", children: "\u2014" }),
7206
+ renderRowEnd()
7207
+ ] }),
7208
+ isCompare && !isCompareHidden && startDate && endDate && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__previous-period", children: renderPreviousPeriod() })
7209
+ ] }),
7210
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__calendars", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "date-picker__calendars-wrapper", children: renderCalendarStart() }) })
7211
+ ] });
7212
+ };
7213
+ return withMobileLogic ? renderMobile() : render();
7340
7214
  };
7341
- var RangeCalendar_default = RangeCalendar;
7342
-
7343
- // src/Atomic/FormElements/InputDateRange/components/DateInput.tsx
7344
- var import_jsx_runtime43 = require("react/jsx-runtime");
7215
+ var Datepicker_default2 = Datepicker2;
7345
7216
 
7346
- // src/Functions/presets/mobileKeyboardTypesPresets.js
7347
- var ALL_KEYBOARD_TYPES = {
7348
- numeric: { inputMode: "decimal" },
7349
- email: { inputMode: "email" }
7350
- };
7351
- var NUMERIC_KEYBOARD = {
7352
- attributesOfNativeInput: ALL_KEYBOARD_TYPES.numeric
7353
- };
7354
- var EMAIL_KEYBOARD = {
7355
- attributesOfNativeInput: ALL_KEYBOARD_TYPES.email
7356
- };
7217
+ // src/Atomic/FormElements/InputDateRange/components/OpenedPart.tsx
7218
+ var import_jsx_runtime46 = require("react/jsx-runtime");
7357
7219
 
7358
- // src/Atomic/FormElements/InputDateRange/components/DateInput.tsx
7359
- var import_classnames35 = __toESM(require("classnames"), 1);
7360
- var import_moment_timezone5 = __toESM(require("moment-timezone"), 1);
7361
- function handleDateInputOnChange(value) {
7362
- const replace = (val) => val?.replace(/[^0-9/]/g, "");
7363
- const input = replace(value);
7364
- const lastSymbol = input ? input.slice(-1) : "";
7365
- const previousValue = input ? input.slice(0, input.length - 1) : "";
7366
- if (value.length > 10 || lastSymbol === "/") return previousValue;
7367
- return previousValue.length === 2 || previousValue.length === 5 ? `${previousValue}/${lastSymbol}` : input;
7368
- }
7369
- function DateInput({ ref, ...props }) {
7370
- const {
7371
- RC: RC36,
7372
- className,
7373
- testId,
7374
- isFocused,
7375
- disabled,
7376
- value,
7377
- date,
7378
- prepareDate,
7379
- onChange,
7380
- onFocus,
7381
- onBlur,
7382
- onKeyUp
7383
- } = props;
7384
- const preparedDate = (() => {
7385
- const prepareDateDefault = (date2) => (0, import_moment_timezone5.default)(date2).format("MM/DD/YYYY");
7386
- const output = prepareDate?.(date) ?? prepareDateDefault(date);
7387
- return (output?.toString?.().toLowerCase() || "") !== "invalid date" ? output : "";
7388
- })();
7389
- return isFocused ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
7390
- Input_default,
7391
- {
7392
- ref,
7393
- testId,
7394
- className: (0, import_classnames35.default)(className, `${RC36}-interactive`),
7395
- value,
7396
- disabled,
7397
- onChange: (value2) => onChange(handleDateInputOnChange(value2)),
7398
- onBlur,
7399
- onKeyUp,
7400
- ...NUMERIC_KEYBOARD
7401
- }
7402
- ) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
7403
- "div",
7404
- {
7405
- className: (0, import_classnames35.default)(className, `${RC36}-emulation`, {
7406
- [`${RC36}-emulation_disabled`]: disabled
7407
- }),
7408
- onClick: disabled ? void 0 : onFocus,
7409
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: (0, import_classnames35.default)(""), children: preparedDate })
7220
+ // src/Functions/useResize.js
7221
+ var import_react48 = require("react");
7222
+ var useResize = (element) => {
7223
+ const [elemPosition, setElemPosition] = (0, import_react48.useState)("");
7224
+ const onResize = (elemRightPosition) => {
7225
+ if (elemRightPosition > document.documentElement.clientWidth) {
7226
+ return setElemPosition("left");
7227
+ } else setElemPosition("");
7228
+ };
7229
+ (0, import_react48.useEffect)(() => {
7230
+ const elemRightPosition = element?.current?.getBoundingClientRect().right + 20;
7231
+ window.addEventListener("resize", () => onResize(elemRightPosition));
7232
+ return () => {
7233
+ window.removeEventListener("resize", () => setElemPosition(""));
7234
+ };
7235
+ }, []);
7236
+ (0, import_react48.useLayoutEffect)(() => {
7237
+ const elemRightPosition = element?.current?.getBoundingClientRect().right + 20;
7238
+ if (elemRightPosition > document.documentElement.clientWidth) {
7239
+ return setElemPosition("left");
7410
7240
  }
7411
- );
7412
- }
7413
- var DateInput_default = DateInput;
7241
+ }, []);
7242
+ return { elemPosition };
7243
+ };
7414
7244
 
7415
- // src/Atomic/FormElements/InputDateRange/components/Datepicker.tsx
7416
- var import_classnames36 = __toESM(require("classnames"), 1);
7417
- var import_moment_timezone6 = __toESM(require("moment-timezone"), 1);
7418
- var import_react54 = require("react");
7419
- var DATE_INPUT_FORMAT = "MM/DD/YYYY";
7420
- function padTime2(time) {
7421
- return `${time.toString().padStart(2, "0")}:00`;
7245
+ // src/Atomic/UI/Modal/Modal.tsx
7246
+ var import_jsx_runtime44 = require("react/jsx-runtime");
7247
+
7248
+ // src/Functions/useKeyPress/useKeyPress.ts
7249
+ var import_react49 = require("react");
7250
+ function isISuspendProcessing(x) {
7251
+ return getIsOnlyAnObject(x) && Object.values(x).every((v) => typeof v === "function");
7422
7252
  }
7423
- var Datepicker2 = (props) => {
7424
- const {
7425
- txt,
7426
- className,
7427
- buttonsTypes = {},
7428
- values = {},
7429
- onChange,
7430
- onChangeMobile,
7431
- onChangeCompare,
7432
- onCancel,
7433
- getSelectedMode,
7434
- onChangeInterval,
7435
- isCompareHidden,
7436
- limitRange,
7437
- setActiveInterval,
7438
- isShortWeekNames,
7439
- minDate,
7440
- maxDate,
7441
- momentMinDate,
7442
- momentMaxDate,
7443
- isDontLimitFuture,
7444
- testId,
7445
- mainId,
7446
- withMobileLogic,
7447
- isDoNotPullOutListOfMainContainer
7448
- } = props;
7449
- const { start = null, end = null, compare: compare2 = false } = values;
7450
- const startDateInputRef = (0, import_react54.useRef)(null);
7451
- const endDateInputRef = (0, import_react54.useRef)(null);
7452
- const [startDate, setStartDate] = (0, import_react54.useState)(
7453
- getIsDateValid(start) ? (0, import_moment_timezone6.default)(start) : ""
7454
- );
7455
- const [endDate, setEndDate] = (0, import_react54.useState)(
7456
- getIsDateValid(end) ? (0, import_moment_timezone6.default)(end) : ""
7457
- );
7458
- const dateInterval = getSelectedMode({ start: startDate, end: endDate });
7459
- const [startDateInput, setStartDateInput] = (0, import_react54.useState)(null);
7460
- const [endDateInput, setEndDateInput] = (0, import_react54.useState)(null);
7461
- const [isStartFocused, setIsStartFocused] = (0, import_react54.useState)(false);
7462
- const [isEndFocused, setIsEndFocused] = (0, import_react54.useState)(false);
7463
- const [startHour, setStartHour] = (0, import_react54.useState)(start ? (0, import_moment_timezone6.default)(start).hour() : 0);
7464
- const [endHour, setEndHour] = (0, import_react54.useState)(end ? (0, import_moment_timezone6.default)(end).hour() : 0);
7465
- const [isCompare, setIsCompare] = (0, import_react54.useState)(compare2);
7466
- const [date1, setDate1] = (0, import_react54.useState)(
7467
- start ? (0, import_moment_timezone6.default)(start) : (0, import_moment_timezone6.default)().subtract(1, "month")
7253
+ function useKeyPress(targetKey, clamping = true, isForbidden, suspendProcessing) {
7254
+ const [keyPressed, setKeyPressed] = (0, import_react49.useState)(false);
7255
+ const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
7256
+ const downHandler = (0, import_react49.useCallback)(
7257
+ (event) => {
7258
+ const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
7259
+ const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
7260
+ if (key === targetKey && isPressingWithoutAuxiliaryKeys && !safelySuspendProcessing[key]?.(event)) {
7261
+ if (!clamping && repeat) return;
7262
+ setKeyPressed(true);
7263
+ }
7264
+ },
7265
+ // ? Намерянно в зависимостях используем именно входной suspendProcessing,
7266
+ // ? хоть в коде используем "безопасный"
7267
+ [clamping, targetKey, suspendProcessing]
7468
7268
  );
7469
- const [date2, setDate2] = (0, import_react54.useState)(end ? (0, import_moment_timezone6.default)(end) : (0, import_moment_timezone6.default)());
7470
- const isNearby = (0, import_react54.useMemo)(
7471
- () => (0, import_moment_timezone6.default)(date2).subtract(1, "month").isSame((0, import_moment_timezone6.default)(date1), "month"),
7472
- [date1, date2]
7269
+ const upHandler = (0, import_react49.useCallback)(
7270
+ (event) => {
7271
+ const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
7272
+ const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
7273
+ if (key === targetKey && isPressingWithoutAuxiliaryKeys && !safelySuspendProcessing[key]?.(event)) {
7274
+ if (!clamping && repeat) return;
7275
+ setKeyPressed(false);
7276
+ }
7277
+ },
7278
+ // ? Намерянно в зависимостях используем именно входной suspendProcessing,
7279
+ // ? хоть в коде используем "безопасный"
7280
+ [clamping, targetKey, suspendProcessing]
7473
7281
  );
7474
- const isPreviousPeriodShowed = (0, import_react54.useMemo)(
7475
- () => isCompare && !isCompareHidden && startDate && endDate,
7476
- [startDate, endDate, isCompare]
7282
+ (0, import_react49.useEffect)(
7283
+ () => {
7284
+ const handleDown = (event) => downHandler(event);
7285
+ const handleUp = (event) => upHandler(event);
7286
+ if (!isForbidden) {
7287
+ window.addEventListener("keydown", handleDown);
7288
+ window.addEventListener("keyup", handleUp);
7289
+ }
7290
+ return () => {
7291
+ window.removeEventListener("keydown", handleDown);
7292
+ window.removeEventListener("keyup", handleUp);
7293
+ };
7294
+ },
7295
+ // ? Намерянно в зависимостях используем именно входной suspendProcessing,
7296
+ // ? хоть в коде используем "безопасный"
7297
+ [downHandler, upHandler, isForbidden, suspendProcessing]
7477
7298
  );
7478
- const prevEndHour = (0, import_react54.useRef)(endHour);
7479
- const startPrevDate = (0, import_react54.useMemo)(() => {
7480
- if (isPreviousPeriodShowed) {
7481
- const intervalHoursCount = (0, import_moment_timezone6.default)(endDate).diff(startDate, "hours");
7482
- return (0, import_moment_timezone6.default)(startDate).subtract(intervalHoursCount, "hours").toDate();
7483
- } else {
7484
- return null;
7485
- }
7486
- }, [startDate, endDate, isCompare]);
7487
- const endPrevDate = (0, import_react54.useMemo)(() => {
7488
- if (isPreviousPeriodShowed) {
7489
- return startDate;
7490
- } else {
7491
- return null;
7492
- }
7493
- }, [startDate, endDate, isCompare]);
7494
- const title = (0, import_react54.useMemo)(() => {
7495
- if (isCompare && !isCompareHidden && startDate && endDate) {
7496
- return `${(0, import_moment_timezone6.default)(startPrevDate).format("ll")} (${(0, import_moment_timezone6.default)(startPrevDate).format(MAIN_TIME_FORMAT)}) - ${(0, import_moment_timezone6.default)(
7497
- endPrevDate
7498
- ).format("ll")} (${(0, import_moment_timezone6.default)(endPrevDate).format(MAIN_TIME_FORMAT)})`;
7499
- } else {
7500
- return "";
7299
+ return keyPressed;
7300
+ }
7301
+ var useKeyPress_default = useKeyPress;
7302
+
7303
+ // src/Functions/useKeyPress/useHandleKeyPress.ts
7304
+ var import_react50 = require("react");
7305
+ function useHandleKeyPress({
7306
+ escCallback,
7307
+ enterCallback,
7308
+ withClamping = true,
7309
+ withEventManagementStructure,
7310
+ suspendProcessing = null
7311
+ }) {
7312
+ const { isWithSubmitAndCloseManagement } = withEventManagementStructure || {};
7313
+ const isPressEnter = useKeyPress_default("Enter", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
7314
+ const isPressEscape = useKeyPress_default("Escape", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
7315
+ (0, import_react50.useEffect)(() => {
7316
+ if (!isWithSubmitAndCloseManagement && isPressEscape && typeof escCallback === "function") {
7317
+ escCallback();
7501
7318
  }
7502
- }, [startDate, endDate, isCompare]);
7503
- const subtractDay = (date) => endHour === 0 ? (0, import_moment_timezone6.default)(date).subtract(1, "days") : (0, import_moment_timezone6.default)(date);
7504
- const addDay = (date) => endHour === 0 ? (0, import_moment_timezone6.default)(date).add(1, "days") : (0, import_moment_timezone6.default)(date);
7505
- const getCorrectedDateForDateInput = (key, date) => {
7506
- if (key === "startDateInput") return (0, import_moment_timezone6.default)(date);
7507
- return subtractDay((0, import_moment_timezone6.default)(date));
7508
- };
7509
- const setInterval2 = () => {
7510
- setActiveInterval?.(
7511
- getActualDateRange({ start: startDate, end: endDate }).intervalKey
7512
- );
7513
- };
7514
- const handleClick = (date) => {
7515
- prevEndHour.current = 0;
7516
- if (!startDate || startDate && endDate && !((0, import_moment_timezone6.default)(startDate).add(1, "d").isSame(endDate, "day") && endHour === 0)) {
7517
- setStartDate((0, import_moment_timezone6.default)(date).startOf("day"));
7518
- setEndDate((0, import_moment_timezone6.default)(date).add(1, "d").startOf("day"));
7519
- setStartHour(0);
7520
- setEndHour(0);
7521
- } else if ((0, import_moment_timezone6.default)(date).isBefore((0, import_moment_timezone6.default)(startDate), "day")) {
7522
- setEndDate((0, import_moment_timezone6.default)(startDate).add(1, "d").startOf("day"));
7523
- setStartDate((0, import_moment_timezone6.default)(date).set("hour", Number.parseInt(startHour.toString(), 10)));
7524
- } else if ((0, import_moment_timezone6.default)(date).isAfter((0, import_moment_timezone6.default)(startDate), "day")) {
7525
- setEndDate((0, import_moment_timezone6.default)(date).add(1, "d").startOf("day"));
7319
+ }, [isPressEscape, escCallback]);
7320
+ (0, import_react50.useEffect)(() => {
7321
+ if (!isWithSubmitAndCloseManagement && isPressEnter && typeof enterCallback === "function") {
7322
+ enterCallback();
7526
7323
  }
7324
+ }, [isPressEnter, enterCallback]);
7325
+ }
7326
+ var useHandleKeyPress_default = useHandleKeyPress;
7327
+
7328
+ // src/Atomic/UI/Modal/partials/_constants.ts
7329
+ var DEFAULT_EVENT_OPTIONS = Object.freeze({
7330
+ bubbles: true,
7331
+ cancelable: true,
7332
+ composed: false
7333
+ });
7334
+ var ModalEventsInnerKeys = /* @__PURE__ */ ((ModalEventsInnerKeys2) => {
7335
+ ModalEventsInnerKeys2["iGotAnEnterKeyPress"] = "iGotAnEnterKeyPress";
7336
+ ModalEventsInnerKeys2["iGotAnEscKeyPress"] = "iGotAnEscKeyPress";
7337
+ return ModalEventsInnerKeys2;
7338
+ })(ModalEventsInnerKeys || {});
7339
+ var EVENTS = Object.freeze({
7340
+ ["iGotAnEnterKeyPress" /* iGotAnEnterKeyPress */]: {
7341
+ innerKey: "iGotAnEnterKeyPress" /* iGotAnEnterKeyPress */,
7342
+ name: "modal:i-got-an-enter-key-press",
7343
+ shortName: "enterIsPressed",
7344
+ middlewareKey: "Enter",
7345
+ options: DEFAULT_EVENT_OPTIONS
7346
+ },
7347
+ ["iGotAnEscKeyPress" /* iGotAnEscKeyPress */]: {
7348
+ innerKey: "iGotAnEscKeyPress" /* iGotAnEscKeyPress */,
7349
+ name: "modal:i-got-an-esc-key-press",
7350
+ shortName: "escIsPressed",
7351
+ middlewareKey: "Escape",
7352
+ options: DEFAULT_EVENT_OPTIONS
7353
+ }
7354
+ });
7355
+
7356
+ // src/Atomic/UI/Modal/partials/_utils.ts
7357
+ function getWithEventManagementStructure(modalId, withEventManagement) {
7358
+ const output = {
7359
+ isWithSubmitAndCloseManagement: false
7527
7360
  };
7528
- const handleChangeStartHour = (val) => {
7529
- setStartHour(Number(val));
7530
- setStartDate((0, import_moment_timezone6.default)(startDate || (0, import_moment_timezone6.default)()).set("hour", Number(val)));
7531
- };
7532
- const handleChangeEndHour = (val) => {
7533
- const newHour = Number(val);
7534
- setEndHour(newHour);
7535
- let newEndDate = (0, import_moment_timezone6.default)();
7536
- if (endDate) {
7537
- if (prevEndHour.current === 0 && newHour !== 0) {
7538
- newEndDate = (0, import_moment_timezone6.default)(endDate).subtract(1, "days");
7539
- } else if (prevEndHour.current !== 0 && newHour === 0) {
7540
- newEndDate = (0, import_moment_timezone6.default)(endDate).add(1, "days");
7361
+ for (const key in output) {
7362
+ if (!modalId) {
7363
+ output[key] = false;
7364
+ } else {
7365
+ output[key] = getIsOnlyAnObject(withEventManagement) ? withEventManagement[key] ?? false : !!withEventManagement;
7366
+ }
7367
+ }
7368
+ return output;
7369
+ }
7370
+ function getOnKeyPress({
7371
+ id: modalId,
7372
+ onSubmit,
7373
+ onClose,
7374
+ suspendProcessing
7375
+ }) {
7376
+ if (!modalId) return null;
7377
+ return function onKeyPress(ev) {
7378
+ const customEvent = ev;
7379
+ const { id: eventId, realEvent } = customEvent.detail || {};
7380
+ const constantInfoAboutCustomEvent = Object.values(EVENTS).find((ev2) => ev2.name === customEvent.type || ev2.shortName === customEvent.type) || {};
7381
+ const middlewareKey = constantInfoAboutCustomEvent.middlewareKey || "incorrectKey";
7382
+ const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
7383
+ if (modalId && eventId && eventId === modalId && !safelySuspendProcessing[middlewareKey]?.(realEvent)) {
7384
+ switch (customEvent.type) {
7385
+ case EVENTS.iGotAnEnterKeyPress.name: {
7386
+ onSubmit?.();
7387
+ break;
7388
+ }
7389
+ case EVENTS.iGotAnEscKeyPress.name: {
7390
+ onClose?.();
7391
+ break;
7392
+ }
7393
+ default: {
7394
+ break;
7395
+ }
7541
7396
  }
7542
7397
  }
7543
- prevEndHour.current = newHour;
7544
- setEndDate((0, import_moment_timezone6.default)(newEndDate).set("hour", newHour));
7545
- };
7546
- const handleDateInputFocus = (key, e) => {
7547
- const changeFlag = key === "startDateInput" ? setIsStartFocused : setIsEndFocused;
7548
- const set = key === "startDateInput" ? setStartDateInput : setEndDateInput;
7549
- const date = key === "startDateInput" ? startDate : endDate;
7550
- changeFlag(true);
7551
- set(date ? getCorrectedDateForDateInput(key, date).format("L") : "");
7552
- setTimeout(() => {
7553
- const defaultTarget = key === "startDateInput" ? startDateInputRef.current : endDateInputRef.current;
7554
- const target = e?.target ?? defaultTarget;
7555
- target.select?.();
7556
- }, 0);
7557
- };
7558
- const doBlur = (type, e) => {
7559
- const executor = type === "startDateInput" ? setIsStartFocused : setIsEndFocused;
7560
- e.target.blur();
7561
- executor(false);
7562
7398
  };
7563
- const processOverflow = (newDateAsString, valueForRollback, key) => {
7564
- const newDateAsMomentObj = (0, import_moment_timezone6.default)(newDateAsString, DATE_INPUT_FORMAT);
7565
- if (!newDateAsMomentObj.isValid()) {
7566
- return valueForRollback;
7567
- } else {
7568
- const beforeOfFuture = (0, import_moment_timezone6.default)().endOf("day");
7569
- const hour = key === "startDateInput" ? startHour : endHour;
7570
- let output;
7571
- if (minDate && newDateAsMomentObj.isBefore(momentMinDate)) {
7572
- output = momentMinDate;
7573
- } else if (maxDate && newDateAsMomentObj.isAfter(momentMaxDate)) {
7574
- output = momentMaxDate;
7575
- } else if (!isDontLimitFuture && newDateAsMomentObj.isAfter(beforeOfFuture)) {
7576
- output = beforeOfFuture.startOf("day");
7577
- } else {
7578
- output = newDateAsMomentObj;
7399
+ }
7400
+ function dispatchEventForModalManagement(realEvent, nameOfCustomEvent, uniqueIdOfRecipient, target) {
7401
+ const { repeat, altKey, ctrlKey, shiftKey, metaKey } = realEvent;
7402
+ const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
7403
+ if (!repeat && isPressingWithoutAuxiliaryKeys) {
7404
+ const event = Object.values(EVENTS).find((ev) => ev.name === nameOfCustomEvent || ev.shortName === nameOfCustomEvent);
7405
+ if (event && uniqueIdOfRecipient) {
7406
+ (target ?? document).dispatchEvent(new CustomEvent(event.name, { ...event.options, detail: { id: uniqueIdOfRecipient, realEvent } }));
7407
+ }
7408
+ }
7409
+ }
7410
+
7411
+ // src/Atomic/UI/Modal/partials/ModalFooter.tsx
7412
+ var import_jsx_runtime41 = require("react/jsx-runtime");
7413
+ var import_classnames34 = __toESM(require("classnames"), 1);
7414
+ var import_react51 = require("react");
7415
+ var ModalFooter = (0, import_react51.memo)(
7416
+ ({ className = "", children, wrapperRef, testId = "modal-footer" }) => {
7417
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
7418
+ "footer",
7419
+ {
7420
+ "data-testid": testId,
7421
+ ref: wrapperRef,
7422
+ className: (0, import_classnames34.default)("modal__footer", className),
7423
+ role: "contentinfo",
7424
+ "aria-label": "Modal footer",
7425
+ children
7579
7426
  }
7580
- if (key === "endDateInput") {
7581
- output = addDay(output);
7427
+ );
7428
+ }
7429
+ );
7430
+ ModalFooter.displayName = "ModalFooter";
7431
+ var ModalFooter_default = ModalFooter;
7432
+
7433
+ // src/Atomic/UI/Modal/partials/ModalTitle.tsx
7434
+ var import_jsx_runtime42 = require("react/jsx-runtime");
7435
+ var import_classnames35 = __toESM(require("classnames"), 1);
7436
+ var import_react52 = require("react");
7437
+ var import_react_feather11 = require("react-feather");
7438
+ var ModalTitle = (0, import_react52.memo)(
7439
+ ({
7440
+ variant = "primary",
7441
+ children,
7442
+ isForced = false,
7443
+ onClose,
7444
+ closeBtnDisable,
7445
+ noHeaderCloseBtn = false,
7446
+ className,
7447
+ wrapperRef,
7448
+ testId = "modal-title"
7449
+ }) => {
7450
+ const closeModalRef = (0, import_react52.useRef)(onClose);
7451
+ const handleClick = (0, import_react52.useMemo)(() => () => closeModalRef.current?.(), []);
7452
+ (0, import_react52.useLayoutEffect)(() => {
7453
+ closeModalRef.current = closeBtnDisable ? void 0 : onClose;
7454
+ }, [onClose, closeBtnDisable]);
7455
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
7456
+ "header",
7457
+ {
7458
+ "data-testid": testId,
7459
+ ref: wrapperRef,
7460
+ className: (0, import_classnames35.default)("modal__header", className, {
7461
+ [`modal__header-${variant}`]: variant
7462
+ }),
7463
+ role: "banner",
7464
+ "aria-label": "Modal header",
7465
+ children: [
7466
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
7467
+ "span",
7468
+ {
7469
+ className: (0, import_classnames35.default)("modal__header-title", {
7470
+ [`modal__header-${variant}-title`]: variant
7471
+ }),
7472
+ id: `${testId}-heading`,
7473
+ children
7474
+ }
7475
+ ),
7476
+ !isForced && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
7477
+ "button",
7478
+ {
7479
+ type: "button",
7480
+ onClick: handleClick,
7481
+ className: (0, import_classnames35.default)("modal-close-icon-box", {
7482
+ "modal-close-icon-box-primary": variant === "primary",
7483
+ "modal-close-icon-box--hidden": noHeaderCloseBtn
7484
+ }),
7485
+ "aria-label": "Close modal",
7486
+ title: "Close modal",
7487
+ children: !noHeaderCloseBtn && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_feather11.X, { className: "modal-close-icon", role: "img", "aria-hidden": "true" })
7488
+ }
7489
+ )
7490
+ ]
7582
7491
  }
7583
- return output.set("hour", Number.parseInt(hour.toString(), 10));
7584
- }
7585
- };
7586
- const handleDateInputBlur = (key, e) => {
7587
- const reserveValue = key === "startDateInput" ? startDateInput : endDateInput;
7588
- const valueForRollback = key === "startDateInput" ? startDate : endDate;
7589
- const execute = key === "startDateInput" ? setStartDate : setEndDate;
7590
- const executeForCalendar = key === "startDateInput" ? setDate1 : setDate2;
7591
- const prepareValueForCalendar = (newDate) => {
7592
- if (key === "endDateInput") return newDate;
7593
- return (0, import_moment_timezone6.default)(newDate).isSameOrAfter((0, import_moment_timezone6.default)(date2), "month") ? (0, import_moment_timezone6.default)(date2).subtract(1, "month") : (0, import_moment_timezone6.default)(newDate);
7594
- };
7595
- const newDateValue = e?.target?.value ?? reserveValue;
7596
- const processedNewDate = processOverflow(
7597
- newDateValue,
7598
- valueForRollback,
7599
- key
7600
7492
  );
7601
- execute(processedNewDate);
7602
- executeForCalendar(prepareValueForCalendar(processedNewDate));
7603
- doBlur(key, e);
7604
- };
7605
- const handleKeyPressed = (code, e, type) => {
7606
- if (code === 13) {
7607
- const syntheticEvent = {
7608
- target: e.target,
7609
- relatedTarget: null
7610
- };
7611
- handleDateInputBlur(type, syntheticEvent);
7493
+ }
7494
+ );
7495
+ ModalTitle.displayName = "ModalTitle";
7496
+ var ModalTitle_default = ModalTitle;
7497
+
7498
+ // src/Atomic/UI/Modal/partials/useMobileModal.tsx
7499
+ var import_jsx_runtime43 = require("react/jsx-runtime");
7500
+ var import_react53 = require("react");
7501
+ var SCROLL_DIRECTION = {
7502
+ UP: "up",
7503
+ DOWN: "down"
7504
+ };
7505
+ function useMobileModal({
7506
+ modalRef,
7507
+ withMobileLogic = false,
7508
+ withFixedFooter = false,
7509
+ isOpen = false
7510
+ }) {
7511
+ const modalMobileContainerRef = (0, import_react53.useRef)(null);
7512
+ const modalMobileHeaderRef = (0, import_react53.useRef)(null);
7513
+ const modalMobileFooterRef = (0, import_react53.useRef)(null);
7514
+ const modalMobileBodyRef = (0, import_react53.useRef)(null);
7515
+ const { isMobile } = useIsMobile_default();
7516
+ const [modalHeight, setModalHeight] = (0, import_react53.useState)(0);
7517
+ const [modalsLogic, setModalsLogic] = (0, import_react53.useState)({
7518
+ IS_HEADER_HIDDEN: false,
7519
+ IS_HEADER_STICKY: false,
7520
+ IS_FOOTER_HIDDEN: false,
7521
+ IS_FOOTER_STICKY: withFixedFooter
7522
+ });
7523
+ const [modalsLogicProps, setModalsLogicProps] = (0, import_react53.useState)({
7524
+ headerHeight: 0,
7525
+ footerHeight: 0
7526
+ });
7527
+ const [scrollDirection, setScrollDirection] = (0, import_react53.useState)(SCROLL_DIRECTION.UP);
7528
+ const [scrollTopPrev, setScrollTopPrev] = (0, import_react53.useState)(0);
7529
+ const [scrollTop, setScrollTop] = (0, import_react53.useState)(0);
7530
+ const [scrollHeight, setScrollHeight] = (0, import_react53.useState)(1);
7531
+ const [, setContainerScrollHeight] = (0, import_react53.useState)(1);
7532
+ (0, import_react53.useLayoutEffect)(() => {
7533
+ const el = modalMobileContainerRef?.current;
7534
+ if (el) {
7535
+ el.addEventListener("scroll", () => {
7536
+ setScrollTop((scrollTop2) => {
7537
+ if (scrollTop2 !== el.scrollTop) setScrollTopPrev(scrollTop2);
7538
+ return el.scrollTop;
7539
+ });
7540
+ });
7612
7541
  }
7613
- if (code === 27) doBlur(type, e);
7614
- };
7615
- const getStartHourItems = () => [...Array.from({ length: 24 }).keys()].map((hour) => ({
7616
- label: padTime2(hour),
7617
- value: hour,
7618
- disabled: (0, import_moment_timezone6.default)(startDate).isSame(endDate, "day") && endHour <= hour
7619
- }));
7620
- const getEndHourItems = () => [...Array.from({ length: 24 }).keys()].map((hour) => ({
7621
- label: padTime2(hour + 1),
7622
- value: hour === 23 ? 0 : hour + 1,
7623
- disabled: ((0, import_moment_timezone6.default)(startDate).isSame(endDate, "day") || (0, import_moment_timezone6.default)(startDate).isSame(
7624
- (0, import_moment_timezone6.default)(endDate).subtract(1, "days"),
7625
- "day"
7626
- ) && endHour === 0) && hour < startHour
7627
- }));
7628
- const renderButtons = () => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
7629
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7630
- Button_default,
7631
- {
7632
- className: "date-picker__button",
7633
- onClick: () => onCancel?.(),
7634
- variant: buttonsTypes?.cancel,
7635
- children: txt?.buttons?.cancel || "Cancel"
7542
+ }, [modalMobileContainerRef?.current]);
7543
+ (0, import_react53.useEffect)(() => {
7544
+ setScrollDirection(
7545
+ (prevScrollDirection) => scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : scrollTop > scrollTopPrev ? SCROLL_DIRECTION.DOWN : prevScrollDirection
7546
+ );
7547
+ }, [scrollTop, scrollTopPrev]);
7548
+ (0, import_react53.useLayoutEffect)(() => {
7549
+ if (isOpen) {
7550
+ const modalStyle = modalRef?.current ? modalRef?.current.style || window.getComputedStyle(modalRef?.current) : {};
7551
+ const computedModalHeight = modalRef?.current ? modalHeight + Number.parseFloat(modalStyle?.marginTop || "0") : 0;
7552
+ const windowHeight = document.documentElement.clientHeight || window.screen.availHeight || window.screen.height;
7553
+ if (modalMobileContainerRef?.current) {
7554
+ if (computedModalHeight <= windowHeight) {
7555
+ modalMobileContainerRef.current.style.display = "flex";
7556
+ modalMobileContainerRef.current.style.alignItems = "flex-end";
7557
+ } else {
7558
+ modalMobileContainerRef.current?.style?.removeProperty("display");
7559
+ modalMobileContainerRef.current?.style?.removeProperty("align-items");
7560
+ }
7636
7561
  }
7637
- ),
7638
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7639
- Button_default,
7640
- {
7641
- className: "date-picker__button",
7642
- variant: buttonsTypes?.apply,
7643
- disabled: !startDate || !endDate,
7644
- onClick: () => onChange?.({
7645
- start: (0, import_moment_timezone6.default)(startDate).format(MAIN_FORMAT),
7646
- end: (0, import_moment_timezone6.default)(endDate).format(MAIN_FORMAT),
7647
- startPrevDate: (0, import_moment_timezone6.default)(startPrevDate).format(MAIN_FORMAT),
7648
- endPrevDate: (0, import_moment_timezone6.default)(endPrevDate).format(MAIN_FORMAT),
7649
- compare: isCompare
7650
- }),
7651
- children: txt?.buttons?.apply || "apply"
7562
+ }
7563
+ }, [modalsLogicProps, isOpen, isMobile, modalHeight]);
7564
+ (0, import_react53.useLayoutEffect)(() => {
7565
+ if (isMobile && isOpen) {
7566
+ const newModalHeight = modalRef?.current?.getBoundingClientRect()?.height;
7567
+ if (newModalHeight && modalHeight !== newModalHeight) {
7568
+ setModalHeight(newModalHeight);
7652
7569
  }
7653
- )
7654
- ] });
7655
- const renderPreviousPeriod = () => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
7656
- txt?.labels?.previousPeriod || "",
7657
- ":",
7658
- " ",
7659
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "date-picker__previous-period-interval", children: title })
7660
- ] });
7661
- (0, import_react54.useEffect)(() => {
7662
- if ((0, import_moment_timezone6.default)(startDate).isSameOrAfter(endDate)) {
7663
- setStartDate((0, import_moment_timezone6.default)(endDate).subtract(1, "d"));
7664
- setDate1((0, import_moment_timezone6.default)(endDate).subtract(1, "d"));
7665
7570
  }
7666
- }, [startDate]);
7667
- (0, import_react54.useEffect)(() => {
7668
- if ((0, import_moment_timezone6.default)(endDate).isSameOrBefore(startDate)) {
7669
- setEndDate((0, import_moment_timezone6.default)(startDate).add(1, "d"));
7670
- setDate2((0, import_moment_timezone6.default)(startDate).add(1, "d"));
7571
+ });
7572
+ (0, import_react53.useEffect)(() => {
7573
+ if (isMobile && withMobileLogic) {
7574
+ const { footerHeight, headerHeight } = modalsLogicProps;
7575
+ setModalsLogic((prevStickyLogic) => ({
7576
+ IS_HEADER_HIDDEN: scrollDirection === SCROLL_DIRECTION.DOWN || scrollTop === 0,
7577
+ IS_HEADER_STICKY: scrollDirection === SCROLL_DIRECTION.UP && scrollTop !== 0 && (scrollTop >= headerHeight || prevStickyLogic.IS_HEADER_STICKY),
7578
+ IS_FOOTER_HIDDEN: !withFixedFooter && (scrollDirection === SCROLL_DIRECTION.UP || scrollHeight === Math.round(scrollTop)),
7579
+ IS_FOOTER_STICKY: withFixedFooter && scrollHeight > 1 || scrollDirection === SCROLL_DIRECTION.DOWN && (scrollHeight - Math.round(scrollTop) >= footerHeight || prevStickyLogic.IS_FOOTER_STICKY)
7580
+ }));
7671
7581
  }
7672
- }, [endDate]);
7673
- (0, import_react54.useEffect)(() => {
7674
- if ((0, import_moment_timezone6.default)(startDate).isBefore((0, import_moment_timezone6.default)(endDate), "month")) {
7675
- setDate1((0, import_moment_timezone6.default)(startDate));
7676
- setDate2((0, import_moment_timezone6.default)(endDate));
7582
+ }, [
7583
+ scrollTop,
7584
+ scrollHeight,
7585
+ isMobile,
7586
+ withMobileLogic,
7587
+ scrollDirection,
7588
+ modalsLogicProps,
7589
+ modalHeight,
7590
+ window.innerHeight
7591
+ ]);
7592
+ (0, import_react53.useLayoutEffect)(() => {
7593
+ if (modalMobileHeaderRef?.current?.getBoundingClientRect()?.height !== void 0) {
7594
+ setModalsLogicProps((state) => ({
7595
+ ...state,
7596
+ headerHeight: modalMobileHeaderRef?.current?.getBoundingClientRect()?.height ?? 0
7597
+ }));
7677
7598
  }
7678
- setInterval2();
7679
- }, [startDate, endDate]);
7680
- (0, import_react54.useEffect)(() => {
7681
- if ((0, import_moment_timezone6.default)(date1).isSameOrAfter((0, import_moment_timezone6.default)(date2), "month") && !withMobileLogic) {
7682
- setDate1((0, import_moment_timezone6.default)(date2).subtract(1, "month"));
7599
+ }, [modalMobileHeaderRef?.current?.getBoundingClientRect()?.height]);
7600
+ (0, import_react53.useLayoutEffect)(() => {
7601
+ if (modalMobileFooterRef?.current?.getBoundingClientRect()?.height !== void 0) {
7602
+ setModalsLogicProps((state) => ({
7603
+ ...state,
7604
+ footerHeight: modalMobileFooterRef?.current?.getBoundingClientRect()?.height ?? 0
7605
+ }));
7683
7606
  }
7684
- }, [date1, date2]);
7685
- (0, import_react54.useEffect)(() => {
7686
- onChangeInterval(dateInterval);
7687
- }, [dateInterval]);
7688
- (0, import_react54.useEffect)(() => {
7689
- if (typeof onChangeMobile === "function") {
7690
- onChangeMobile({
7691
- start: (0, import_moment_timezone6.default)(startDate).format(MAIN_FORMAT),
7692
- end: (0, import_moment_timezone6.default)(endDate).format(MAIN_FORMAT),
7693
- startPrevDate: (0, import_moment_timezone6.default)(startPrevDate).format(MAIN_FORMAT),
7694
- endPrevDate: (0, import_moment_timezone6.default)(endPrevDate).format(MAIN_FORMAT),
7695
- compare: isCompare
7696
- });
7607
+ }, [modalMobileFooterRef?.current?.getBoundingClientRect()?.height]);
7608
+ (0, import_react53.useEffect)(() => {
7609
+ if (modalMobileContainerRef?.current) {
7610
+ setContainerScrollHeight(modalMobileContainerRef?.current?.scrollHeight);
7611
+ setScrollHeight(
7612
+ modalMobileContainerRef?.current?.scrollHeight - window.innerHeight
7613
+ );
7697
7614
  }
7698
- }, [startDate, endDate, startPrevDate, endPrevDate, isCompare]);
7699
- const renderRowStart = () => {
7700
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "date-picker__date-row", children: [
7701
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7702
- DateInput_default,
7703
- {
7704
- ref: startDateInputRef,
7705
- testId: `datepicker-${testId}_start-date-input`,
7706
- RC: "date-picker__date-input",
7707
- className: (0, import_classnames36.default)("date-picker__date-input"),
7708
- isFocused: isStartFocused,
7709
- value: startDateInput,
7710
- date: getCorrectedDateForDateInput("startDateInput", startDate),
7711
- disabled: !startDate,
7712
- onChange: setStartDateInput,
7713
- onFocus: (e) => handleDateInputFocus("startDateInput", e),
7714
- onBlur: (e) => handleDateInputBlur("startDateInput", e),
7715
- onKeyUp: (code, e) => handleKeyPressed(+code, e, "startDateInput")
7716
- }
7717
- ),
7718
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7719
- Dropdown_default,
7720
- {
7721
- testId,
7722
- id: `datepicker-id-${mainId}_start-hour-select-input`,
7723
- className: (0, import_classnames36.default)("date-picker__hour-select-input"),
7724
- onChange: (value) => handleChangeStartHour(value),
7725
- value: startHour,
7726
- options: getStartHourItems(),
7727
- disabled: !startDate,
7728
- isDoNotPullOutListOfMainContainer,
7729
- withMobileLogic
7730
- }
7731
- )
7732
- ] });
7733
- };
7734
- const renderRowEnd = () => {
7735
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "date-picker__date-row", children: [
7736
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7737
- DateInput_default,
7738
- {
7739
- ref: endDateInputRef,
7740
- testId: `datepicker-${testId}_start-date-input`,
7741
- RC: "date-picker__date-input",
7742
- className: (0, import_classnames36.default)("date-picker__date-input"),
7743
- isFocused: isEndFocused,
7744
- value: endDateInput,
7745
- date: getCorrectedDateForDateInput("endDateInput", endDate),
7746
- disabled: !endDate,
7747
- onChange: setEndDateInput,
7748
- onFocus: (e) => handleDateInputFocus("endDateInput", e),
7749
- onBlur: (e) => handleDateInputBlur("endDateInput", e),
7750
- onKeyUp: (code, e) => handleKeyPressed(+code, e, "endDateInput")
7751
- }
7752
- ),
7753
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7754
- Dropdown_default,
7755
- {
7756
- testId,
7757
- id: `datepicker-id-${mainId}_end-hour-select-input`,
7758
- className: (0, import_classnames36.default)("date-picker__hour-select-input"),
7759
- onChange: (value) => handleChangeEndHour(value),
7760
- value: endHour,
7761
- options: getEndHourItems(),
7762
- disabled: !endDate,
7763
- isDoNotPullOutListOfMainContainer,
7764
- withMobileLogic
7765
- }
7766
- )
7767
- ] });
7615
+ }, [scrollTop, modalMobileContainerRef?.current, window.innerHeight]);
7616
+ (0, import_react53.useEffect)(() => {
7617
+ window.addEventListener("resize", () => {
7618
+ setContainerScrollHeight((containerScrollHeight) => {
7619
+ setScrollHeight(containerScrollHeight - window.innerHeight);
7620
+ return containerScrollHeight;
7621
+ });
7622
+ });
7623
+ }, []);
7624
+ const renderModal = (0, import_react53.useCallback)(
7625
+ (modal) => {
7626
+ if (!isMobile || !withMobileLogic) return modal;
7627
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "modal-mobile-container", ref: modalMobileContainerRef, children: modal });
7628
+ },
7629
+ [isMobile, withMobileLogic]
7630
+ );
7631
+ return {
7632
+ modalMobileContainerRef,
7633
+ modalMobileHeaderRef,
7634
+ modalMobileBodyRef,
7635
+ modalMobileFooterRef,
7636
+ MODALS_LOGIC: modalsLogic,
7637
+ SCROLL_DIRECTION,
7638
+ scrollTop,
7639
+ scrollHeight,
7640
+ renderModal,
7641
+ isMobile
7768
7642
  };
7769
- const renderCalendarStart = () => {
7770
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7771
- RangeCalendar_default,
7772
- {
7773
- testId,
7774
- className: "date-picker__calendar",
7775
- date: date1,
7776
- setDate: setDate1,
7777
- allowNext: withMobileLogic ? !(0, import_moment_timezone6.default)(date1).startOf("month").isSameOrAfter((0, import_moment_timezone6.default)().startOf("day"), "months") : !isNearby,
7778
- startDate,
7779
- endDate,
7780
- startPrevDate,
7781
- endPrevDate,
7782
- onClick: handleClick,
7783
- limitRange,
7784
- isShortWeekNames,
7785
- minDate,
7786
- maxDate,
7787
- momentMinDate,
7788
- momentMaxDate
7789
- }
7790
- );
7643
+ }
7644
+
7645
+ // src/Atomic/UI/Modal/Modal.tsx
7646
+ var import_classnames36 = __toESM(require("classnames"), 1);
7647
+ var import_react54 = require("react");
7648
+ var attrsForModalBodyDefault = {};
7649
+ var KEY_CODE = Object.freeze({
7650
+ ENTER: 13,
7651
+ ESC: 27
7652
+ });
7653
+ function renderModalTitle({
7654
+ mode,
7655
+ title,
7656
+ onlyTitle
7657
+ }) {
7658
+ if (mode && mode !== "default" && !onlyTitle) {
7659
+ return `${mode[0].toUpperCase()}${mode.slice(1)} ${title}`;
7660
+ }
7661
+ return title;
7662
+ }
7663
+ function Modal({
7664
+ ref,
7665
+ id,
7666
+ testId = "modal",
7667
+ zIndex = 100,
7668
+ isOpen,
7669
+ onConfirm,
7670
+ onDecline,
7671
+ closeModal,
7672
+ className,
7673
+ variant = "primary",
7674
+ size,
7675
+ mode,
7676
+ title,
7677
+ onlyTitle,
7678
+ atributesForModalBody = attrsForModalBodyDefault,
7679
+ confirmBtnClassName,
7680
+ confirmBtnLabel,
7681
+ confirmBtnVariant = "primary",
7682
+ confirmBtnDisable,
7683
+ confirmBtnIcon,
7684
+ isConfirmBtnIconPositionRight,
7685
+ noConfirmBtn,
7686
+ forced,
7687
+ closeBtnClassName,
7688
+ closeBtnText,
7689
+ closeBtnVariant,
7690
+ closeBtnDisable,
7691
+ closeBtnIcon,
7692
+ btnClassNames,
7693
+ isCloseBtnIconPositionRight,
7694
+ noCloseBtn,
7695
+ noHeader,
7696
+ noHeaderCloseBtn,
7697
+ customHeader,
7698
+ declineBtnDisable,
7699
+ noFooter,
7700
+ customFooter,
7701
+ withFixedFooter,
7702
+ leftContentOfFooter,
7703
+ isSubmittingByEnter: isSubmittingByEnterOuter = true,
7704
+ isClosingByEsc: isClosingByEscOuter = true,
7705
+ withEventManagement = false,
7706
+ submitOnEnter,
7707
+ closeOnEsc,
7708
+ withMobileLogic,
7709
+ children
7710
+ }) {
7711
+ const internalRef = (0, import_react54.useRef)(null);
7712
+ const modalRef = ref || internalRef;
7713
+ const onConfirmRef = (0, import_react54.useRef)(onConfirm);
7714
+ const closeModalRef = (0, import_react54.useRef)(closeModal);
7715
+ const onDeclineRef = (0, import_react54.useRef)(onDecline);
7716
+ const isSubmittingByEnter = submitOnEnter === false ? false : isSubmittingByEnterOuter;
7717
+ const isClosingByEsc = closeOnEsc === false ? false : isClosingByEscOuter;
7718
+ const withEventManagementStructure = getWithEventManagementStructure(id, withEventManagement);
7719
+ const isUseAutoBlockingForHandlers = withEventManagementStructure.isWithSubmitAndCloseManagement;
7720
+ const isOnConfirmBlocked = typeof onConfirm === "function" && isUseAutoBlockingForHandlers && confirmBtnDisable;
7721
+ const isCloseModalBlocked = typeof closeModal === "function" && isUseAutoBlockingForHandlers && closeBtnDisable;
7722
+ const isOnDeclineBlocked = typeof onDecline === "function" && isUseAutoBlockingForHandlers && declineBtnDisable;
7723
+ const {
7724
+ modalMobileHeaderRef,
7725
+ modalMobileBodyRef,
7726
+ modalMobileFooterRef,
7727
+ MODALS_LOGIC,
7728
+ renderModal,
7729
+ isMobile,
7730
+ scrollTop,
7731
+ scrollHeight
7732
+ } = useMobileModal({
7733
+ withMobileLogic,
7734
+ withFixedFooter,
7735
+ isOpen
7736
+ });
7737
+ const handle = (0, import_react54.useMemo)(() => ({
7738
+ confirm: () => onConfirmRef.current?.(),
7739
+ close: () => closeModalRef.current?.(),
7740
+ decline: () => {
7741
+ if (typeof onDeclineRef.current === "function") onDeclineRef.current();
7742
+ else closeModalRef.current?.();
7743
+ }
7744
+ }), []);
7745
+ const suspendProcessing = {
7746
+ // FIN-12482
7747
+ // ? Чтобы НЕ замыкать рефку на модалку в логике, чтобы потом поискать в контенте все текстэриа,
7748
+ // ? чтобы оценить есть ли среди них сфокусированная - делаем элеГАнтно:
7749
+ // ? оцениваем ev.target, и если target это текстэриа, то вот сейчас то она и сфокусирована,
7750
+ // ? т.е нужно приостановить процессы связанные с нажатием enter.
7751
+ Enter: (ev) => ev?.target?.nodeName === "TEXTAREA"
7752
+ // ? Колбеки опциональны, можно передавать только нужные
7753
+ // Escape: (ev: globalThis.KeyboardEvent) => false,
7791
7754
  };
7792
- const renderCalendarEnd = () => {
7793
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7794
- RangeCalendar_default,
7795
- {
7796
- className: "date-picker__calendar",
7797
- date: date2,
7798
- setDate: setDate2,
7799
- allowPrev: !isNearby,
7800
- startDate,
7801
- endDate,
7802
- startPrevDate,
7803
- endPrevDate,
7804
- onClick: handleClick,
7805
- isShortWeekNames,
7806
- minDate,
7807
- maxDate,
7808
- momentMinDate,
7809
- momentMaxDate,
7810
- isDontLimitFuture
7755
+ useHandleKeyPress_default({
7756
+ enterCallback: isSubmittingByEnter && typeof onConfirm === "function" && !confirmBtnDisable ? handle.confirm : void 0,
7757
+ escCallback: isClosingByEsc && typeof closeModal === "function" ? handle.close : void 0,
7758
+ withClamping: false,
7759
+ withEventManagementStructure: {
7760
+ isWithSubmitAndCloseManagement: confirmBtnDisable || withEventManagementStructure.isWithSubmitAndCloseManagement
7761
+ },
7762
+ suspendProcessing
7763
+ });
7764
+ (0, import_react54.useLayoutEffect)(() => {
7765
+ onConfirmRef.current = isOnConfirmBlocked ? void 0 : onConfirm;
7766
+ }, [onConfirm, isOnConfirmBlocked]);
7767
+ (0, import_react54.useLayoutEffect)(() => {
7768
+ closeModalRef.current = isCloseModalBlocked ? void 0 : closeModal;
7769
+ }, [closeModal, isCloseModalBlocked]);
7770
+ (0, import_react54.useLayoutEffect)(() => {
7771
+ onDeclineRef.current = isOnDeclineBlocked ? () => {
7772
+ } : onDecline;
7773
+ }, [onDecline, isOnDeclineBlocked]);
7774
+ (0, import_react54.useEffect)(() => {
7775
+ const outerTarget = getIsOnlyAnObject(withEventManagement) ? withEventManagement.listenersTarget : void 0;
7776
+ const target = outerTarget ?? document;
7777
+ const onKeyPress = getOnKeyPress({ id, onSubmit: handle.confirm, onClose: handle.close, suspendProcessing });
7778
+ if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
7779
+ if (isSubmittingByEnter) target.addEventListener(EVENTS.iGotAnEnterKeyPress.name, onKeyPress);
7780
+ if (isClosingByEsc) target.addEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
7781
+ }
7782
+ return () => {
7783
+ if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
7784
+ if (isSubmittingByEnter) target.removeEventListener(EVENTS.iGotAnEnterKeyPress.name, onKeyPress);
7785
+ if (isClosingByEsc) target.removeEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
7811
7786
  }
7812
- );
7813
- };
7814
- const render = () => {
7815
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: (0, import_classnames36.default)("date-picker", className), children: [
7816
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "date-picker__header", children: [
7817
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "date-picker__inputs-block", children: [
7818
- renderRowStart(),
7819
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__inputs-separator date-picker__header--gray", children: "\u2014" }),
7820
- renderRowEnd()
7821
- ] }),
7822
- isCompare && !isCompareHidden && startDate && endDate && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__previous-period", children: renderPreviousPeriod() })
7823
- ] }),
7824
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__calendars", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "date-picker__calendars-wrapper", children: [
7825
- renderCalendarStart(),
7826
- renderCalendarEnd()
7827
- ] }) }),
7828
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7829
- "div",
7830
- {
7831
- className: (0, import_classnames36.default)("date-picker__footer", {
7832
- "date-picker__footer_once-element": isCompareHidden
7833
- }),
7834
- children: [
7835
- !isCompareHidden ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__compare-block", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "mr5", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7836
- Switcher_default,
7837
- {
7838
- label: txt?.labels?.compare || "Compare",
7839
- isActive: isCompare,
7840
- onChange: () => {
7841
- onChangeCompare?.(!isCompare);
7842
- setIsCompare((state) => !state);
7843
- }
7844
- }
7845
- ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", {}),
7846
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__buttons-block", children: renderButtons() })
7847
- ]
7848
- }
7787
+ };
7788
+ }, []);
7789
+ if (!isOpen) return null;
7790
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7791
+ "div",
7792
+ {
7793
+ id: `${id}`,
7794
+ style: { zIndex },
7795
+ "data-testid": testId,
7796
+ className: "modal-box j5",
7797
+ role: "dialog",
7798
+ "aria-modal": "true",
7799
+ "aria-labelledby": `${testId}-title`,
7800
+ children: renderModal(
7801
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
7802
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7803
+ "div",
7804
+ {
7805
+ "data-testid": `${testId}-overlay`,
7806
+ className: isOpen ? "modal-overlay" : "hidden",
7807
+ onClick: handle.close,
7808
+ role: "presentation"
7809
+ }
7810
+ ),
7811
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7812
+ "div",
7813
+ {
7814
+ ref: modalRef,
7815
+ style: { width: typeof size === "number" ? `${size}px` : `${size?.replace("px", "")}px` },
7816
+ className: (0, import_classnames36.default)(className, {
7817
+ "modal": isOpen,
7818
+ "modal--no-header": isOpen && noHeader && !customHeader,
7819
+ "modal-mobile": isOpen && isMobile,
7820
+ "hidden": !isOpen
7821
+ }),
7822
+ children: [
7823
+ customHeader || !noHeader && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7824
+ ModalTitle_default,
7825
+ {
7826
+ wrapperRef: modalMobileHeaderRef,
7827
+ className: (0, import_classnames36.default)({
7828
+ "modal__header--hidden": MODALS_LOGIC.IS_HEADER_HIDDEN,
7829
+ "modal__header--sticky": !MODALS_LOGIC.IS_HEADER_HIDDEN && MODALS_LOGIC.IS_HEADER_STICKY
7830
+ }),
7831
+ variant,
7832
+ isForced: forced,
7833
+ onClose: handle.close,
7834
+ noHeaderCloseBtn,
7835
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { id: `${testId}-title`, children: renderModalTitle({ mode, title, onlyTitle }) })
7836
+ }
7837
+ ),
7838
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7839
+ "div",
7840
+ {
7841
+ ...atributesForModalBody,
7842
+ ref: modalMobileBodyRef,
7843
+ className: (0, import_classnames36.default)("modal__body", {
7844
+ "modal__body--no-footer": noFooter
7845
+ }),
7846
+ role: "document",
7847
+ children
7848
+ }
7849
+ ),
7850
+ (!noFooter || customFooter) && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7851
+ ModalFooter_default,
7852
+ {
7853
+ wrapperRef: modalMobileFooterRef,
7854
+ className: (0, import_classnames36.default)({
7855
+ "modal__footer--hidden": MODALS_LOGIC.IS_FOOTER_HIDDEN,
7856
+ "modal__footer--sticky": !MODALS_LOGIC.IS_FOOTER_HIDDEN && MODALS_LOGIC.IS_FOOTER_STICKY && scrollTop !== scrollHeight,
7857
+ "modal__footer_with-left-content": leftContentOfFooter
7858
+ }),
7859
+ children: customFooter || /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
7860
+ leftContentOfFooter,
7861
+ (!noCloseBtn || !noConfirmBtn) && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "modal__buttons-block", children: [
7862
+ !noCloseBtn && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7863
+ Button_default,
7864
+ {
7865
+ testId: "modal",
7866
+ className: (0, import_classnames36.default)(closeBtnClassName, btnClassNames),
7867
+ variant: closeBtnVariant || "dark-outline",
7868
+ onClick: handle.decline,
7869
+ label: closeBtnText || "Cancel",
7870
+ disabled: typeof onDecline === "function" ? declineBtnDisable : closeBtnDisable,
7871
+ icon: closeBtnIcon,
7872
+ isIconRight: isCloseBtnIconPositionRight,
7873
+ tabIndex: 1,
7874
+ "aria-label": "Close modal"
7875
+ }
7876
+ ),
7877
+ !noConfirmBtn && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7878
+ Button_default,
7879
+ {
7880
+ testId: "modal",
7881
+ onClick: handle.confirm,
7882
+ label: confirmBtnLabel || mode && mode?.[0].toUpperCase() + mode?.slice(1) || "Apply",
7883
+ className: (0, import_classnames36.default)("ml5", confirmBtnClassName, btnClassNames),
7884
+ variant: confirmBtnVariant,
7885
+ disabled: confirmBtnDisable,
7886
+ icon: confirmBtnIcon,
7887
+ isIconRight: isConfirmBtnIconPositionRight,
7888
+ "aria-label": "Confirm modal"
7889
+ }
7890
+ )
7891
+ ] })
7892
+ ] })
7893
+ }
7894
+ )
7895
+ ]
7896
+ }
7897
+ )
7898
+ ] })
7849
7899
  )
7850
- ] });
7851
- };
7852
- const renderMobile = () => {
7853
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: (0, import_classnames36.default)("date-picker", className), children: [
7854
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "date-picker__header", children: [
7855
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "date-picker__inputs-block", children: [
7856
- renderRowStart(),
7857
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__inputs-separator date-picker__header--gray", children: "\u2014" }),
7858
- renderRowEnd()
7859
- ] }),
7860
- isCompare && !isCompareHidden && startDate && endDate && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__previous-period", children: renderPreviousPeriod() })
7861
- ] }),
7862
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__calendars", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "date-picker__calendars-wrapper", children: renderCalendarStart() }) })
7863
- ] });
7864
- };
7865
- return withMobileLogic ? renderMobile() : render();
7866
- };
7867
- var Datepicker_default2 = Datepicker2;
7900
+ }
7901
+ );
7902
+ }
7903
+ Modal.displayName = "Modal";
7904
+ var Modal_default = Modal;
7868
7905
 
7869
7906
  // src/Atomic/FormElements/InputDateRange/components/SelectItem.tsx
7870
7907
  var import_jsx_runtime45 = require("react/jsx-runtime");
@@ -8100,6 +8137,7 @@ var OpenedPart = (props) => {
8100
8137
  var OpenedPart_default = OpenedPart;
8101
8138
 
8102
8139
  // src/Atomic/FormElements/InputDateRange/InputDateRange.tsx
8140
+ var import_jsx_runtime47 = require("react/jsx-runtime");
8103
8141
  var import_classnames39 = __toESM(require("classnames"), 1);
8104
8142
  var import_moment_timezone8 = __toESM(require("moment-timezone"), 1);
8105
8143
  var import_react57 = __toESM(require("react"), 1);
@@ -8458,6 +8496,9 @@ var InputLink = ({
8458
8496
  };
8459
8497
  var InputLink_default = InputLink;
8460
8498
 
8499
+ // src/Atomic/FormElements/InputLink/index.ts
8500
+ var InputLink_default2 = InputLink_default;
8501
+
8461
8502
  // src/Atomic/FormElements/InputMask/InputMask.tsx
8462
8503
  var InputMask_default = InputMask3_default;
8463
8504
 
@@ -8632,6 +8673,9 @@ var InputsRow = ({
8632
8673
  };
8633
8674
  var InputsRow_default = InputsRow;
8634
8675
 
8676
+ // src/Atomic/FormElements/InputsRow/index.ts
8677
+ var InputsRow_default2 = InputsRow_default;
8678
+
8635
8679
  // src/Atomic/FormElements/InputWithAction/InputWithAction.tsx
8636
8680
  var import_jsx_runtime50 = require("react/jsx-runtime");
8637
8681
  var import_classnames41 = __toESM(require("classnames"), 1);
@@ -8731,6 +8775,9 @@ var InputWithAction = (props, ref) => {
8731
8775
  };
8732
8776
  var InputWithAction_default = import_react60.default.forwardRef(InputWithAction);
8733
8777
 
8778
+ // src/Atomic/FormElements/InputWithAction/index.ts
8779
+ var InputWithAction_default2 = InputWithAction_default;
8780
+
8734
8781
  // src/Atomic/FormElements/Label/Label.tsx
8735
8782
  var import_jsx_runtime51 = require("react/jsx-runtime");
8736
8783
  var import_classnames42 = __toESM(require("classnames"), 1);
@@ -9738,6 +9785,9 @@ function RadioGroupWithInput({
9738
9785
  }
9739
9786
  var RadioGroupWithInput_default = RadioGroupWithInput;
9740
9787
 
9788
+ // src/Atomic/FormElements/RadioInput/index.ts
9789
+ var RadioInput_default2 = RadioInput_default;
9790
+
9741
9791
  // src/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.tsx
9742
9792
  var import_jsx_runtime58 = require("react/jsx-runtime");
9743
9793
  var import_classnames47 = __toESM(require("classnames"), 1);
@@ -9915,6 +9965,9 @@ var RangeInputs = ({
9915
9965
  };
9916
9966
  var RangeInputs_default = RangeInputs;
9917
9967
 
9968
+ // src/Atomic/FormElements/RangeInputs/index.ts
9969
+ var RangeInputs_default2 = RangeInputs_default;
9970
+
9918
9971
  // src/Atomic/FormElements/RangeList/RangeList.tsx
9919
9972
  var import_jsx_runtime61 = require("react/jsx-runtime");
9920
9973
 
@@ -10203,6 +10256,9 @@ var RangeList = (props) => {
10203
10256
  };
10204
10257
  var RangeList_default = RangeList;
10205
10258
 
10259
+ // src/Atomic/FormElements/RangeList/index.ts
10260
+ var RangeList_default2 = RangeList_default;
10261
+
10206
10262
  // src/Atomic/FormElements/RangeSlider2/RangeSlider2.tsx
10207
10263
  var import_jsx_runtime62 = require("react/jsx-runtime");
10208
10264
  var import_classnames51 = __toESM(require("classnames"), 1);
@@ -11321,6 +11377,9 @@ var SwitchableRow = (props) => {
11321
11377
  };
11322
11378
  var SwitchableRow_default = SwitchableRow;
11323
11379
 
11380
+ // src/Atomic/FormElements/Switcher/index.ts
11381
+ var Switcher_default2 = Switcher_default;
11382
+
11324
11383
  // src/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.tsx
11325
11384
  var import_jsx_runtime65 = require("react/jsx-runtime");
11326
11385
  var import_classnames54 = __toESM(require("classnames"), 1);
@@ -11416,6 +11475,9 @@ var SwitcherHide = ({
11416
11475
  };
11417
11476
  var SwitcherHide_default = SwitcherHide;
11418
11477
 
11478
+ // src/Atomic/FormElements/SwitcherHide/index.ts
11479
+ var SwitcherHide_default2 = SwitcherHide_default;
11480
+
11419
11481
  // src/Atomic/FormElements/SwitcherRadio/SwitcherRadio.tsx
11420
11482
  var import_jsx_runtime67 = require("react/jsx-runtime");
11421
11483
  var import_react75 = (
@@ -11487,6 +11549,9 @@ var SwitcherRadio = ({
11487
11549
  };
11488
11550
  var SwitcherRadio_default = SwitcherRadio;
11489
11551
 
11552
+ // src/Atomic/FormElements/SwitcherRadio/index.ts
11553
+ var SwitcherRadio_default2 = SwitcherRadio_default;
11554
+
11490
11555
  // src/Atomic/FormElements/SwitcherRange/SwitcherRange.tsx
11491
11556
  var import_jsx_runtime68 = require("react/jsx-runtime");
11492
11557
  var RC20 = "switcher-range";
@@ -11536,6 +11601,9 @@ var SwitcherRange = ({
11536
11601
  };
11537
11602
  var SwitcherRange_default = SwitcherRange;
11538
11603
 
11604
+ // src/Atomic/FormElements/SwitcherRange/index.ts
11605
+ var SwitcherRange_default2 = SwitcherRange_default;
11606
+
11539
11607
  // src/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.tsx
11540
11608
  var import_jsx_runtime69 = require("react/jsx-runtime");
11541
11609
  var import_classnames57 = __toESM(require("classnames"), 1);
@@ -13464,6 +13532,9 @@ var Text = ({
13464
13532
  };
13465
13533
  var Text_default = Text;
13466
13534
 
13535
+ // src/Atomic/FormElements/Text/index.ts
13536
+ var Text_default2 = Text_default;
13537
+
13467
13538
  // src/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.tsx
13468
13539
  var import_jsx_runtime80 = require("react/jsx-runtime");
13469
13540
  var import_react88 = require("react");
@@ -13739,6 +13810,9 @@ var TieredCheckboxes = ({
13739
13810
  };
13740
13811
  var TieredCheckboxes_default = TieredCheckboxes;
13741
13812
 
13813
+ // src/Atomic/FormElements/TieredCheckboxes/index.ts
13814
+ var TieredCheckboxes_default2 = TieredCheckboxes_default;
13815
+
13742
13816
  // src/Atomic/FormElements/TimeRange/TimeRange.tsx
13743
13817
  var import_jsx_runtime81 = require("react/jsx-runtime");
13744
13818