hrm_ui_lib 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (240) hide show
  1. package/{Alert-w8FkRd9I.js → Alert--0rz5XL1.js} +22 -14
  2. package/assets/images/under-construction.svg +9 -0
  3. package/assets/styles/styles.css +4459 -4533
  4. package/assets/styles/styles.scss +1 -3
  5. package/components/Alert/Alert.js +12 -10
  6. package/components/Alert/index.js +6 -4
  7. package/components/Avatar/Avatar.js +7 -5
  8. package/components/Avatar/AvatarGroup.js +6 -4
  9. package/components/Avatar/index.js +6 -4
  10. package/components/BadgeV2/BadgeV2.d.ts +2 -2
  11. package/components/BadgeV2/BadgeV2.js +20 -8
  12. package/components/BadgeV2/types.d.ts +5 -2
  13. package/components/Button/Button.js +6 -4
  14. package/components/Button/index.js +6 -4
  15. package/components/ButtonGroup/ButtonGroup.d.ts +2 -0
  16. package/components/ButtonGroup/ButtonGroup.js +46 -0
  17. package/components/ButtonGroup/ButtonGroupItem.d.ts +2 -0
  18. package/components/ButtonGroup/ButtonGroupItem.js +52 -0
  19. package/components/ButtonGroup/consts.d.ts +8 -0
  20. package/components/ButtonGroup/consts.js +12 -0
  21. package/components/ButtonGroup/index.d.ts +1 -0
  22. package/components/ButtonGroup/index.js +10 -0
  23. package/components/ButtonGroup/types.d.ts +23 -0
  24. package/components/ButtonGroup/types.js +1 -0
  25. package/components/Card/Card.d.ts +5 -2
  26. package/components/Card/Card.js +58 -7
  27. package/components/Card/CardComponent/Card.js +4 -3
  28. package/components/Card/CardComponent/CardBody.d.ts +1 -1
  29. package/components/Card/CardComponent/CardBody.js +5 -5
  30. package/components/Card/CardComponent/CardFooter.d.ts +4 -0
  31. package/components/Card/CardComponent/CardFooter.js +13 -0
  32. package/components/Card/CardComponent/CardHead.js +67 -5
  33. package/components/Card/index.js +48 -2
  34. package/components/Card/types.d.ts +3 -0
  35. package/components/CardGroup/CardGroup.d.ts +10 -0
  36. package/components/CardGroup/CardGroup.js +27 -0
  37. package/components/CardGroup/CardGroupComponent/CardBody.d.ts +4 -0
  38. package/components/CardGroup/CardGroupComponent/CardBody.js +19 -0
  39. package/components/CardGroup/CardGroupComponent/CardGroup.d.ts +4 -0
  40. package/components/CardGroup/CardGroupComponent/CardGroup.js +28 -0
  41. package/components/CardGroup/CardGroupComponent/CardHead.d.ts +4 -0
  42. package/components/CardGroup/CardGroupComponent/CardHead.js +19 -0
  43. package/components/CardGroup/CardGroupContext.d.ts +6 -0
  44. package/components/CardGroup/CardGroupContext.js +8 -0
  45. package/components/CardGroup/index.d.ts +1 -0
  46. package/components/CardGroup/index.js +11 -0
  47. package/components/CardGroup/types.d.ts +14 -0
  48. package/components/CardGroup/types.js +1 -0
  49. package/components/Checkbox/Checkbox.js +11 -9
  50. package/components/Checkbox/index.js +6 -4
  51. package/components/Checkbox/types.d.ts +1 -0
  52. package/components/Collapse/Collapse/Collapse.js +2 -2
  53. package/components/Collapse/CollapseGroup/CollapseGroup.js +1 -1
  54. package/components/Collapse/CollapseItem/CollapseItem.js +1 -1
  55. package/components/Collapse/index.js +1 -1
  56. package/components/Collapse/types.d.ts +1 -1
  57. package/components/Copy/Copy.js +6 -4
  58. package/components/Copy/index.js +6 -4
  59. package/components/Counter/Counter.js +6 -4
  60. package/components/Counter/index.js +6 -4
  61. package/components/DatePicker/CustomHeader/CustomHeader.js +7 -5
  62. package/components/DatePicker/RangeDatePicker/RangeDatePicker.js +12 -4
  63. package/components/DatePicker/RangeDatePicker/RangeDatePickerDesktop.js +12 -4
  64. package/components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js +12 -4
  65. package/components/DatePicker/RangeDatePicker/index.js +12 -4
  66. package/components/DatePicker/SimpleDatePicker/SimpleDatePicker.js +12 -4
  67. package/components/DatePicker/SimpleDatePicker/SimpleDatePickerDesktop.js +12 -4
  68. package/components/DatePicker/SimpleDatePicker/SimpleDatePickerMobile.js +12 -4
  69. package/components/DatePicker/SimpleDatePicker/index.js +12 -4
  70. package/components/DatePicker/TimePicker/MobileModalContent.js +7 -4
  71. package/components/DatePicker/TimePicker/TimePicker.js +14 -5
  72. package/components/DatePicker/TimePicker/TimePickerDesktop.js +13 -7
  73. package/components/DatePicker/TimePicker/TimePickerMobile.js +8 -5
  74. package/components/DatePicker/TimePicker/index.js +14 -5
  75. package/components/DatePicker/hooks.js +8 -2139
  76. package/components/DatePicker/index.js +14 -5
  77. package/components/Divider/Divider.js +6 -3
  78. package/components/Divider/types.d.ts +1 -0
  79. package/components/Empty/Empty.js +6 -4
  80. package/components/Empty/index.js +6 -4
  81. package/components/FileUpload/DropzoneFileUpload/DropzoneFileUpload.js +6 -4
  82. package/components/FileUpload/DropzoneFileUpload/ErrorItem.js +6 -4
  83. package/components/FileUpload/DropzoneFileUpload/PreviewItem.js +14 -12
  84. package/components/FileUpload/DropzoneFileUpload/helpers.js +6 -4
  85. package/components/FileUpload/DropzoneFileUpload/index.js +6 -4
  86. package/components/FileUpload/FileUpload.js +7 -5
  87. package/components/FileUpload/UploadItems.js +7 -5
  88. package/components/FileUpload/index.js +7 -5
  89. package/components/FormContainer/FormContainer.js +22 -12
  90. package/components/FormContainer/index.js +7 -5
  91. package/components/FormContainer/types.d.ts +1 -0
  92. package/components/FormField/FormField.js +6 -4
  93. package/components/FormField/index.js +7 -5
  94. package/components/IconDynamicComponent/IconDynamicComponent.d.ts +8 -0
  95. package/components/IconDynamicComponent/IconDynamicComponent.js +39 -0
  96. package/{helperComponents → components}/IconDynamicComponent/index.js +1 -1
  97. package/components/Input/Input.js +6 -4
  98. package/components/Input/index.js +6 -4
  99. package/components/Menu/Menu.js +7 -5
  100. package/components/Menu/NestedMenu.js +7 -5
  101. package/components/Menu/index.js +7 -5
  102. package/components/Modal/Modal.js +6 -4
  103. package/components/Modal/ModalConfirmation.js +6 -4
  104. package/components/Modal/ModalContent.js +6 -4
  105. package/components/Modal/index.js +6 -4
  106. package/components/More/More.js +6 -4
  107. package/components/More/index.js +6 -4
  108. package/components/Popover/Popover.js +6 -4
  109. package/components/Popover/PopoverDesktop.js +1 -1
  110. package/components/Popover/PopoverMobile.js +6 -4
  111. package/components/Popover/index.js +6 -4
  112. package/components/Popover/types.d.ts +2 -1
  113. package/components/Radio/RadioGroup.js +7 -5
  114. package/components/Radio/index.js +7 -5
  115. package/components/SVGIcons/IconAirplaneTakeOff.d.ts +4 -0
  116. package/components/SVGIcons/IconAirplaneTakeOff.js +29 -0
  117. package/components/SVGIcons/IconAirplaneTakeOffFilled.d.ts +4 -0
  118. package/components/SVGIcons/IconAirplaneTakeOffFilled.js +29 -0
  119. package/components/SVGIcons/IconChartPerson.d.ts +4 -0
  120. package/components/SVGIcons/IconChartPerson.js +29 -0
  121. package/components/SVGIcons/IconChartPersonFilled.d.ts +4 -0
  122. package/components/SVGIcons/IconChartPersonFilled.js +29 -0
  123. package/components/SVGIcons/IconFastAcceleration.d.ts +4 -0
  124. package/components/SVGIcons/IconFastAcceleration.js +29 -0
  125. package/components/SVGIcons/IconFastAccelerationFilled.d.ts +4 -0
  126. package/components/SVGIcons/IconFastAccelerationFilled.js +29 -0
  127. package/components/SVGIcons/IconFeed.d.ts +4 -0
  128. package/components/SVGIcons/IconFeed.js +29 -0
  129. package/components/SVGIcons/IconFeedFilled.d.ts +4 -0
  130. package/components/SVGIcons/IconFeedFilled.js +29 -0
  131. package/components/SVGIcons/IconLibrary.d.ts +4 -0
  132. package/components/SVGIcons/IconLibrary.js +29 -0
  133. package/components/SVGIcons/IconLibraryFilled.d.ts +4 -0
  134. package/components/SVGIcons/IconLibraryFilled.js +29 -0
  135. package/components/SVGIcons/IconPeopleList.d.ts +4 -0
  136. package/components/SVGIcons/IconPeopleList.js +29 -0
  137. package/components/SVGIcons/IconPeopleListFilled.d.ts +4 -0
  138. package/components/SVGIcons/IconPeopleListFilled.js +29 -0
  139. package/components/SVGIcons/IconPeopleTeam.d.ts +4 -0
  140. package/components/SVGIcons/IconPeopleTeam.js +29 -0
  141. package/components/SVGIcons/IconPeopleTeamFilled.d.ts +4 -0
  142. package/components/SVGIcons/IconPeopleTeamFilled.js +29 -0
  143. package/components/SVGIcons/IconTrophy.d.ts +4 -0
  144. package/components/SVGIcons/IconTrophy.js +29 -0
  145. package/components/SVGIcons/IconTrophyFilled.d.ts +4 -0
  146. package/components/SVGIcons/IconTrophyFilled.js +29 -0
  147. package/components/SVGIcons/IconUs.d.ts +4 -0
  148. package/components/SVGIcons/IconUs.js +72 -0
  149. package/components/SVGIcons/icon-names.d.ts +2 -0
  150. package/components/SVGIcons/icon-names.js +3 -0
  151. package/components/SVGIcons/index.d.ts +19 -2
  152. package/components/SVGIcons/index.js +19 -2
  153. package/components/Select/ButtonSelect/ButtonSelect.js +7 -5
  154. package/components/Select/FilterSelect/FilterDropdown.js +7 -5
  155. package/components/Select/FilterSelect/FilterGroupDropdown.js +6 -4
  156. package/components/Select/FilterSelect/FilterSelect.js +6 -4
  157. package/components/Select/MultiSelect/MobileWrapper.js +6 -4
  158. package/components/Select/MultiSelect/MultiBase/MultiBase.js +7 -5
  159. package/components/Select/MultiSelect/MultiSelect.js +6 -4
  160. package/components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js +7 -5
  161. package/components/Select/MultiSelect/MultiSelectWithTabs/MultiSelectWithTabs.js +7 -5
  162. package/components/Select/MultiSelect/OptionsWrapper.js +6 -4
  163. package/components/Select/NestedSelect/NestedSelect.js +7 -5
  164. package/components/Select/Select/Select.js +6 -4
  165. package/components/Select/Select/SelectDesktop/index.js +7 -5
  166. package/components/Select/Select/SelectMobile/MobileTopContent.js +6 -4
  167. package/components/Select/Select/SelectMobile/index.js +7 -5
  168. package/components/Select/SharedComponents/Actions.js +7 -5
  169. package/components/Select/SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js +8 -6
  170. package/components/Select/SharedComponents/ContentTop.js +6 -4
  171. package/components/Select/SharedComponents/Footer.js +6 -4
  172. package/components/Select/SharedComponents/InputSelectWrapper/InputSelectWrapper.js +6 -4
  173. package/components/Select/SharedComponents/index.js +6 -4
  174. package/components/Select/index.js +6 -4
  175. package/components/SideSheet/Footer/Footer.js +6 -4
  176. package/components/SideSheet/SideSheet.js +6 -4
  177. package/components/SideSheet/index.js +6 -4
  178. package/components/Snackbar/Snackbar.js +14 -12
  179. package/components/Snackbar/index.js +6 -4
  180. package/components/Switcher/Switcher.js +27 -19
  181. package/components/Switcher/index.js +7 -6
  182. package/components/Switcher/types.d.ts +2 -0
  183. package/components/Tab/Tab.js +4 -2
  184. package/components/Table/Header.d.ts +2 -1
  185. package/components/Table/Header.js +19 -8
  186. package/components/Table/IndeterminateCheckbox.d.ts +1 -0
  187. package/components/Table/IndeterminateCheckbox.js +12 -6
  188. package/components/Table/Row.d.ts +2 -1
  189. package/components/Table/Row.js +24 -9
  190. package/components/Table/Table.d.ts +1 -1
  191. package/components/Table/Table.js +60 -17
  192. package/components/Table/index.js +8 -4
  193. package/components/Table/localization.d.ts +5 -0
  194. package/components/Table/localization.js +13 -0
  195. package/components/Table/types.d.ts +6 -0
  196. package/components/Table/utils.js +36 -8
  197. package/components/TableV2/AdvancedPagination.js +9 -7
  198. package/components/TableV2/ColumnSettings.js +8 -6
  199. package/components/TableV2/IndeterminateCheckbox.js +6 -4
  200. package/components/TableV2/Table.js +7 -4
  201. package/components/TableV2/hooks/useTableControl.js +20 -15
  202. package/components/TableV2/index.js +8 -5
  203. package/components/Text/types.d.ts +1 -1
  204. package/components/Textarea/Textarea.js +6 -4
  205. package/components/Textarea/index.js +6 -4
  206. package/components/Tooltip/types.d.ts +0 -1
  207. package/components/UnderConstruction/UnderConstruction.d.ts +3 -0
  208. package/components/UnderConstruction/UnderConstruction.js +38 -0
  209. package/components/UnderConstruction/index.d.ts +1 -0
  210. package/components/UnderConstruction/index.js +8 -0
  211. package/components/UnderConstruction/localization.d.ts +4 -0
  212. package/components/UnderConstruction/localization.js +16 -0
  213. package/components/UnderConstruction/types.d.ts +12 -0
  214. package/components/UnderConstruction/types.js +1 -0
  215. package/helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js +1 -1
  216. package/helperComponents/AnimatePresenceWrapper/index.js +1 -1
  217. package/helperComponents/CodeBlock/CodeBlock.js +1 -154
  218. package/helperComponents/CodeBlock/index.js +1 -0
  219. package/helperComponents/ErrorMessage/ErrorMessage.js +2 -2
  220. package/helperComponents/ErrorMessage/index.js +2 -2
  221. package/helperComponents/GoToWebPage/GoToWebPage.js +6 -4
  222. package/helperComponents/OptionItem/OptionItem.js +7 -5
  223. package/helperComponents/OptionItem/index.js +6 -4
  224. package/helperComponents/index.d.ts +0 -1
  225. package/helperComponents/index.js +7 -5
  226. package/helpers/check-authorization.js +8 -6
  227. package/helpers/format-date.js +1 -22
  228. package/helpers/index.js +6 -4
  229. package/hooks/useHideOnScroll.d.ts +1 -1
  230. package/hooks/useHideOnScroll.js +5 -4
  231. package/i18n.d.ts +4 -0
  232. package/i18n.js +50 -0
  233. package/index.d.ts +3 -0
  234. package/index.js +46 -7
  235. package/package.json +6 -5
  236. package/helperComponents/IconDynamicComponent/IconDynamicComponent.d.ts +0 -9
  237. package/helperComponents/IconDynamicComponent/IconDynamicComponent.js +0 -26
  238. package/helperComponents/IconDynamicComponent/constants.d.ts +0 -3
  239. package/helperComponents/IconDynamicComponent/constants.js +0 -33
  240. /package/{helperComponents → components}/IconDynamicComponent/index.d.ts +0 -0
@@ -3,2149 +3,18 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
3
  import _regeneratorRuntime from '@babel/runtime/regenerator';
4
4
  import { useState, useEffect } from 'react';
5
5
  import { registerLocale } from 'react-datepicker';
6
- import dayjs, { locale } from 'dayjs';
6
+ import { locale } from 'dayjs';
7
+ import { hy } from 'date-fns/locale/hy';
8
+ import { enGB } from 'date-fns/locale/en-GB';
9
+ import { ru } from 'date-fns/locale/ru';
10
+ import 'dayjs/locale/hy-am';
11
+ import 'dayjs/locale/ru';
12
+ import 'dayjs/locale/en';
7
13
  import { DayJSLocale } from '../../type/locale.js';
8
14
 
9
- const formatDistanceLocale$2 = {
10
- lessThanXSeconds: {
11
- one: "ավելի քիչ քան 1 վայրկյան",
12
- other: "ավելի քիչ քան {{count}} վայրկյան",
13
- },
14
-
15
- xSeconds: {
16
- one: "1 վայրկյան",
17
- other: "{{count}} վայրկյան",
18
- },
19
-
20
- halfAMinute: "կես րոպե",
21
-
22
- lessThanXMinutes: {
23
- one: "ավելի քիչ քան 1 րոպե",
24
- other: "ավելի քիչ քան {{count}} րոպե",
25
- },
26
-
27
- xMinutes: {
28
- one: "1 րոպե",
29
- other: "{{count}} րոպե",
30
- },
31
-
32
- aboutXHours: {
33
- one: "մոտ 1 ժամ",
34
- other: "մոտ {{count}} ժամ",
35
- },
36
-
37
- xHours: {
38
- one: "1 ժամ",
39
- other: "{{count}} ժամ",
40
- },
41
-
42
- xDays: {
43
- one: "1 օր",
44
- other: "{{count}} օր",
45
- },
46
-
47
- aboutXWeeks: {
48
- one: "մոտ 1 շաբաթ",
49
- other: "մոտ {{count}} շաբաթ",
50
- },
51
-
52
- xWeeks: {
53
- one: "1 շաբաթ",
54
- other: "{{count}} շաբաթ",
55
- },
56
-
57
- aboutXMonths: {
58
- one: "մոտ 1 ամիս",
59
- other: "մոտ {{count}} ամիս",
60
- },
61
-
62
- xMonths: {
63
- one: "1 ամիս",
64
- other: "{{count}} ամիս",
65
- },
66
-
67
- aboutXYears: {
68
- one: "մոտ 1 տարի",
69
- other: "մոտ {{count}} տարի",
70
- },
71
-
72
- xYears: {
73
- one: "1 տարի",
74
- other: "{{count}} տարի",
75
- },
76
-
77
- overXYears: {
78
- one: "ավելի քան 1 տարի",
79
- other: "ավելի քան {{count}} տարի",
80
- },
81
-
82
- almostXYears: {
83
- one: "համարյա 1 տարի",
84
- other: "համարյա {{count}} տարի",
85
- },
86
- };
87
-
88
- const formatDistance$2 = (token, count, options) => {
89
- let result;
90
-
91
- const tokenValue = formatDistanceLocale$2[token];
92
- if (typeof tokenValue === "string") {
93
- result = tokenValue;
94
- } else if (count === 1) {
95
- result = tokenValue.one;
96
- } else {
97
- result = tokenValue.other.replace("{{count}}", String(count));
98
- }
99
-
100
- if (options?.addSuffix) {
101
- if (options.comparison && options.comparison > 0) {
102
- return result + " հետո";
103
- } else {
104
- return result + " առաջ";
105
- }
106
- }
107
-
108
- return result;
109
- };
110
-
111
- function buildFormatLongFn(args) {
112
- return (options = {}) => {
113
- // TODO: Remove String()
114
- const width = options.width ? String(options.width) : args.defaultWidth;
115
- const format = args.formats[width] || args.formats[args.defaultWidth];
116
- return format;
117
- };
118
- }
119
-
120
- const dateFormats$2 = {
121
- full: "d MMMM, y, EEEE",
122
- long: "d MMMM, y",
123
- medium: "d MMM, y",
124
- short: "dd.MM.yyyy",
125
- };
126
-
127
- const timeFormats$2 = {
128
- full: "HH:mm:ss zzzz",
129
- long: "HH:mm:ss z",
130
- medium: "HH:mm:ss",
131
- short: "HH:mm",
132
- };
133
-
134
- const dateTimeFormats$2 = {
135
- full: "{{date}} 'ժ․'{{time}}",
136
- long: "{{date}} 'ժ․'{{time}}",
137
- medium: "{{date}}, {{time}}",
138
- short: "{{date}}, {{time}}",
139
- };
140
-
141
- const formatLong$2 = {
142
- date: buildFormatLongFn({
143
- formats: dateFormats$2,
144
- defaultWidth: "full",
145
- }),
146
-
147
- time: buildFormatLongFn({
148
- formats: timeFormats$2,
149
- defaultWidth: "full",
150
- }),
151
-
152
- dateTime: buildFormatLongFn({
153
- formats: dateTimeFormats$2,
154
- defaultWidth: "full",
155
- }),
156
- };
157
-
158
- const formatRelativeLocale$2 = {
159
- lastWeek: "'նախորդ' eeee p'֊ին'",
160
- yesterday: "'երեկ' p'֊ին'",
161
- today: "'այսօր' p'֊ին'",
162
- tomorrow: "'վաղը' p'֊ին'",
163
- nextWeek: "'հաջորդ' eeee p'֊ին'",
164
- other: "P",
165
- };
166
-
167
- const formatRelative$2 = (token, _date, _baseDate, _options) =>
168
- formatRelativeLocale$2[token];
169
-
170
- /**
171
- * The localize function argument callback which allows to convert raw value to
172
- * the actual type.
173
- *
174
- * @param value - The value to convert
175
- *
176
- * @returns The converted value
177
- */
178
-
179
- /**
180
- * The map of localized values for each width.
181
- */
182
-
183
- /**
184
- * The index type of the locale unit value. It types conversion of units of
185
- * values that don't start at 0 (i.e. quarters).
186
- */
187
-
188
- /**
189
- * Converts the unit value to the tuple of values.
190
- */
191
-
192
- /**
193
- * The tuple of localized era values. The first element represents BC,
194
- * the second element represents AD.
195
- */
196
-
197
- /**
198
- * The tuple of localized quarter values. The first element represents Q1.
199
- */
200
-
201
- /**
202
- * The tuple of localized day values. The first element represents Sunday.
203
- */
204
-
205
- /**
206
- * The tuple of localized month values. The first element represents January.
207
- */
208
-
209
- function buildLocalizeFn(args) {
210
- return (value, options) => {
211
- const context = options?.context ? String(options.context) : "standalone";
212
-
213
- let valuesArray;
214
- if (context === "formatting" && args.formattingValues) {
215
- const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
216
- const width = options?.width ? String(options.width) : defaultWidth;
217
-
218
- valuesArray =
219
- args.formattingValues[width] || args.formattingValues[defaultWidth];
220
- } else {
221
- const defaultWidth = args.defaultWidth;
222
- const width = options?.width ? String(options.width) : args.defaultWidth;
223
-
224
- valuesArray = args.values[width] || args.values[defaultWidth];
225
- }
226
- const index = args.argumentCallback ? args.argumentCallback(value) : value;
227
-
228
- // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
229
- return valuesArray[index];
230
- };
231
- }
232
-
233
- const eraValues$2 = {
234
- narrow: ["Ք", "Մ"],
235
- abbreviated: ["ՔԱ", "ՄԹ"],
236
- wide: ["Քրիստոսից առաջ", "Մեր թվարկության"],
237
- };
238
-
239
- const quarterValues$2 = {
240
- narrow: ["1", "2", "3", "4"],
241
- abbreviated: ["Ք1", "Ք2", "Ք3", "Ք4"],
242
- wide: ["1֊ին քառորդ", "2֊րդ քառորդ", "3֊րդ քառորդ", "4֊րդ քառորդ"],
243
- };
244
-
245
- const monthValues$2 = {
246
- narrow: ["Հ", "Փ", "Մ", "Ա", "Մ", "Հ", "Հ", "Օ", "Ս", "Հ", "Ն", "Դ"],
247
- abbreviated: [
248
- "հուն",
249
- "փետ",
250
- "մար",
251
- "ապր",
252
- "մայ",
253
- "հուն",
254
- "հուլ",
255
- "օգս",
256
- "սեպ",
257
- "հոկ",
258
- "նոյ",
259
- "դեկ",
260
- ],
261
-
262
- wide: [
263
- "հունվար",
264
- "փետրվար",
265
- "մարտ",
266
- "ապրիլ",
267
- "մայիս",
268
- "հունիս",
269
- "հուլիս",
270
- "օգոստոս",
271
- "սեպտեմբեր",
272
- "հոկտեմբեր",
273
- "նոյեմբեր",
274
- "դեկտեմբեր",
275
- ],
276
- };
277
-
278
- const dayValues$2 = {
279
- narrow: ["Կ", "Ե", "Ե", "Չ", "Հ", "Ո", "Շ"],
280
- short: ["կր", "եր", "եք", "չք", "հգ", "ուր", "շբ"],
281
- abbreviated: ["կիր", "երկ", "երք", "չոր", "հնգ", "ուրբ", "շաբ"],
282
- wide: [
283
- "կիրակի",
284
- "երկուշաբթի",
285
- "երեքշաբթի",
286
- "չորեքշաբթի",
287
- "հինգշաբթի",
288
- "ուրբաթ",
289
- "շաբաթ",
290
- ],
291
- };
292
-
293
- const dayPeriodValues$2 = {
294
- narrow: {
295
- am: "a",
296
- pm: "p",
297
- midnight: "կեսգշ",
298
- noon: "կեսօր",
299
- morning: "առավոտ",
300
- afternoon: "ցերեկ",
301
- evening: "երեկո",
302
- night: "գիշեր",
303
- },
304
- abbreviated: {
305
- am: "AM",
306
- pm: "PM",
307
- midnight: "կեսգիշեր",
308
- noon: "կեսօր",
309
- morning: "առավոտ",
310
- afternoon: "ցերեկ",
311
- evening: "երեկո",
312
- night: "գիշեր",
313
- },
314
- wide: {
315
- am: "a.m.",
316
- pm: "p.m.",
317
- midnight: "կեսգիշեր",
318
- noon: "կեսօր",
319
- morning: "առավոտ",
320
- afternoon: "ցերեկ",
321
- evening: "երեկո",
322
- night: "գիշեր",
323
- },
324
- };
325
-
326
- const formattingDayPeriodValues$2 = {
327
- narrow: {
328
- am: "a",
329
- pm: "p",
330
- midnight: "կեսգշ",
331
- noon: "կեսօր",
332
- morning: "առավոտը",
333
- afternoon: "ցերեկը",
334
- evening: "երեկոյան",
335
- night: "գիշերը",
336
- },
337
- abbreviated: {
338
- am: "AM",
339
- pm: "PM",
340
- midnight: "կեսգիշերին",
341
- noon: "կեսօրին",
342
- morning: "առավոտը",
343
- afternoon: "ցերեկը",
344
- evening: "երեկոյան",
345
- night: "գիշերը",
346
- },
347
- wide: {
348
- am: "a.m.",
349
- pm: "p.m.",
350
- midnight: "կեսգիշերին",
351
- noon: "կեսօրին",
352
- morning: "առավոտը",
353
- afternoon: "ցերեկը",
354
- evening: "երեկոյան",
355
- night: "գիշերը",
356
- },
357
- };
358
-
359
- const ordinalNumber$2 = (dirtyNumber, _options) => {
360
- const number = Number(dirtyNumber);
361
-
362
- // If ordinal numbers depend on context, for example,
363
- // if they are different for different grammatical genders,
364
- // use `options.unit`.
365
- //
366
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
367
- // 'day', 'hour', 'minute', 'second'.
368
-
369
- const rem100 = number % 100;
370
- if (rem100 < 10) {
371
- if (rem100 % 10 === 1) {
372
- return number + "֊ին";
373
- }
374
- }
375
- return number + "֊րդ";
376
- };
377
-
378
- const localize$2 = {
379
- ordinalNumber: ordinalNumber$2,
380
-
381
- era: buildLocalizeFn({
382
- values: eraValues$2,
383
- defaultWidth: "wide",
384
- }),
385
-
386
- quarter: buildLocalizeFn({
387
- values: quarterValues$2,
388
- defaultWidth: "wide",
389
- argumentCallback: (quarter) => quarter - 1,
390
- }),
391
-
392
- month: buildLocalizeFn({
393
- values: monthValues$2,
394
- defaultWidth: "wide",
395
- }),
396
-
397
- day: buildLocalizeFn({
398
- values: dayValues$2,
399
- defaultWidth: "wide",
400
- }),
401
-
402
- dayPeriod: buildLocalizeFn({
403
- values: dayPeriodValues$2,
404
- defaultWidth: "wide",
405
- formattingValues: formattingDayPeriodValues$2,
406
- defaultFormattingWidth: "wide",
407
- }),
408
- };
409
-
410
- function buildMatchFn(args) {
411
- return (string, options = {}) => {
412
- const width = options.width;
413
-
414
- const matchPattern =
415
- (width && args.matchPatterns[width]) ||
416
- args.matchPatterns[args.defaultMatchWidth];
417
- const matchResult = string.match(matchPattern);
418
-
419
- if (!matchResult) {
420
- return null;
421
- }
422
- const matchedString = matchResult[0];
423
-
424
- const parsePatterns =
425
- (width && args.parsePatterns[width]) ||
426
- args.parsePatterns[args.defaultParseWidth];
427
-
428
- const key = Array.isArray(parsePatterns)
429
- ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
430
- : // [TODO] -- I challenge you to fix the type
431
- findKey(parsePatterns, (pattern) => pattern.test(matchedString));
432
-
433
- let value;
434
-
435
- value = args.valueCallback ? args.valueCallback(key) : key;
436
- value = options.valueCallback
437
- ? // [TODO] -- I challenge you to fix the type
438
- options.valueCallback(value)
439
- : value;
440
-
441
- const rest = string.slice(matchedString.length);
442
-
443
- return { value, rest };
444
- };
445
- }
446
-
447
- function findKey(object, predicate) {
448
- for (const key in object) {
449
- if (
450
- Object.prototype.hasOwnProperty.call(object, key) &&
451
- predicate(object[key])
452
- ) {
453
- return key;
454
- }
455
- }
456
- return undefined;
457
- }
458
-
459
- function findIndex(array, predicate) {
460
- for (let key = 0; key < array.length; key++) {
461
- if (predicate(array[key])) {
462
- return key;
463
- }
464
- }
465
- return undefined;
466
- }
467
-
468
- function buildMatchPatternFn(args) {
469
- return (string, options = {}) => {
470
- const matchResult = string.match(args.matchPattern);
471
- if (!matchResult) return null;
472
- const matchedString = matchResult[0];
473
-
474
- const parseResult = string.match(args.parsePattern);
475
- if (!parseResult) return null;
476
- let value = args.valueCallback
477
- ? args.valueCallback(parseResult[0])
478
- : parseResult[0];
479
-
480
- // [TODO] I challenge you to fix the type
481
- value = options.valueCallback ? options.valueCallback(value) : value;
482
-
483
- const rest = string.slice(matchedString.length);
484
-
485
- return { value, rest };
486
- };
487
- }
488
-
489
- const matchOrdinalNumberPattern$2 = /^(\d+)((-|֊)?(ին|րդ))?/i;
490
- const parseOrdinalNumberPattern$2 = /\d+/i;
491
-
492
- const matchEraPatterns$2 = {
493
- narrow: /^(Ք|Մ)/i,
494
- abbreviated: /^(Ք\.?\s?Ա\.?|Մ\.?\s?Թ\.?\s?Ա\.?|Մ\.?\s?Թ\.?|Ք\.?\s?Հ\.?)/i,
495
- wide: /^(քրիստոսից առաջ|մեր թվարկությունից առաջ|մեր թվարկության|քրիստոսից հետո)/i,
496
- };
497
- const parseEraPatterns$2 = {
498
- any: [/^ք/i, /^մ/i],
499
- };
500
-
501
- const matchQuarterPatterns$2 = {
502
- narrow: /^[1234]/i,
503
- abbreviated: /^ք[1234]/i,
504
- wide: /^[1234]((-|֊)?(ին|րդ)) քառորդ/i,
505
- };
506
- const parseQuarterPatterns$2 = {
507
- any: [/1/i, /2/i, /3/i, /4/i],
508
- };
509
-
510
- const matchMonthPatterns$2 = {
511
- narrow: /^[հփմաօսնդ]/i,
512
- abbreviated: /^(հուն|փետ|մար|ապր|մայ|հուն|հուլ|օգս|սեպ|հոկ|նոյ|դեկ)/i,
513
- wide: /^(հունվար|փետրվար|մարտ|ապրիլ|մայիս|հունիս|հուլիս|օգոստոս|սեպտեմբեր|հոկտեմբեր|նոյեմբեր|դեկտեմբեր)/i,
514
- };
515
- const parseMonthPatterns$2 = {
516
- narrow: [
517
- /^հ/i,
518
- /^փ/i,
519
- /^մ/i,
520
- /^ա/i,
521
- /^մ/i,
522
- /^հ/i,
523
- /^հ/i,
524
- /^օ/i,
525
- /^ս/i,
526
- /^հ/i,
527
- /^ն/i,
528
- /^դ/i,
529
- ],
530
-
531
- any: [
532
- /^հու/i,
533
- /^փ/i,
534
- /^մար/i,
535
- /^ա/i,
536
- /^մայ/i,
537
- /^հուն/i,
538
- /^հուլ/i,
539
- /^օ/i,
540
- /^ս/i,
541
- /^հոկ/i,
542
- /^ն/i,
543
- /^դ/i,
544
- ],
545
- };
546
-
547
- const matchDayPatterns$2 = {
548
- narrow: /^[եչհոշկ]/i,
549
- short: /^(կր|եր|եք|չք|հգ|ուր|շբ)/i,
550
- abbreviated: /^(կիր|երկ|երք|չոր|հնգ|ուրբ|շաբ)/i,
551
- wide: /^(կիրակի|երկուշաբթի|երեքշաբթի|չորեքշաբթի|հինգշաբթի|ուրբաթ|շաբաթ)/i,
552
- };
553
- const parseDayPatterns$2 = {
554
- narrow: [/^կ/i, /^ե/i, /^ե/i, /^չ/i, /^հ/i, /^(ո|Ո)/, /^շ/i],
555
- short: [/^կ/i, /^եր/i, /^եք/i, /^չ/i, /^հ/i, /^(ո|Ո)/, /^շ/i],
556
- abbreviated: [/^կ/i, /^երկ/i, /^երք/i, /^չ/i, /^հ/i, /^(ո|Ո)/, /^շ/i],
557
-
558
- wide: [/^կ/i, /^երկ/i, /^երե/i, /^չ/i, /^հ/i, /^(ո|Ո)/, /^շ/i],
559
- };
560
-
561
- const matchDayPeriodPatterns$2 = {
562
- narrow: /^([ap]|կեսգշ|կեսօր|(առավոտը?|ցերեկը?|երեկո(յան)?|գիշերը?))/i,
563
- any: /^([ap]\.?\s?m\.?|կեսգիշեր(ին)?|կեսօր(ին)?|(առավոտը?|ցերեկը?|երեկո(յան)?|գիշերը?))/i,
564
- };
565
- const parseDayPeriodPatterns$2 = {
566
- any: {
567
- am: /^a/i,
568
- pm: /^p/i,
569
- midnight: /կեսգիշեր/i,
570
- noon: /կեսօր/i,
571
- morning: /առավոտ/i,
572
- afternoon: /ցերեկ/i,
573
- evening: /երեկո/i,
574
- night: /գիշեր/i,
575
- },
576
- };
577
-
578
- const match$2 = {
579
- ordinalNumber: buildMatchPatternFn({
580
- matchPattern: matchOrdinalNumberPattern$2,
581
- parsePattern: parseOrdinalNumberPattern$2,
582
- valueCallback: (value) => parseInt(value, 10),
583
- }),
584
-
585
- era: buildMatchFn({
586
- matchPatterns: matchEraPatterns$2,
587
- defaultMatchWidth: "wide",
588
- parsePatterns: parseEraPatterns$2,
589
- defaultParseWidth: "any",
590
- }),
591
-
592
- quarter: buildMatchFn({
593
- matchPatterns: matchQuarterPatterns$2,
594
- defaultMatchWidth: "wide",
595
- parsePatterns: parseQuarterPatterns$2,
596
- defaultParseWidth: "any",
597
- valueCallback: (index) => index + 1,
598
- }),
599
-
600
- month: buildMatchFn({
601
- matchPatterns: matchMonthPatterns$2,
602
- defaultMatchWidth: "wide",
603
- parsePatterns: parseMonthPatterns$2,
604
- defaultParseWidth: "any",
605
- }),
606
-
607
- day: buildMatchFn({
608
- matchPatterns: matchDayPatterns$2,
609
- defaultMatchWidth: "wide",
610
- parsePatterns: parseDayPatterns$2,
611
- defaultParseWidth: "wide",
612
- }),
613
-
614
- dayPeriod: buildMatchFn({
615
- matchPatterns: matchDayPeriodPatterns$2,
616
- defaultMatchWidth: "any",
617
- parsePatterns: parseDayPeriodPatterns$2,
618
- defaultParseWidth: "any",
619
- }),
620
- };
621
-
622
- /**
623
- * @category Locales
624
- * @summary Armenian locale
625
- * @language Armenian
626
- * @iso-639-2 arm
627
- * @author Alex Igityan [@alexigityan](https://github.com/alexigityan)
628
- */
629
- const hy = {
630
- code: "hy",
631
- formatDistance: formatDistance$2,
632
- formatLong: formatLong$2,
633
- formatRelative: formatRelative$2,
634
- localize: localize$2,
635
- match: match$2,
636
- options: {
637
- weekStartsOn: 1 /* Monday */,
638
- firstWeekContainsDate: 1,
639
- },
640
- };
641
-
642
- const formatDistanceLocale$1 = {
643
- lessThanXSeconds: {
644
- one: "less than a second",
645
- other: "less than {{count}} seconds",
646
- },
647
-
648
- xSeconds: {
649
- one: "1 second",
650
- other: "{{count}} seconds",
651
- },
652
-
653
- halfAMinute: "half a minute",
654
-
655
- lessThanXMinutes: {
656
- one: "less than a minute",
657
- other: "less than {{count}} minutes",
658
- },
659
-
660
- xMinutes: {
661
- one: "1 minute",
662
- other: "{{count}} minutes",
663
- },
664
-
665
- aboutXHours: {
666
- one: "about 1 hour",
667
- other: "about {{count}} hours",
668
- },
669
-
670
- xHours: {
671
- one: "1 hour",
672
- other: "{{count}} hours",
673
- },
674
-
675
- xDays: {
676
- one: "1 day",
677
- other: "{{count}} days",
678
- },
679
-
680
- aboutXWeeks: {
681
- one: "about 1 week",
682
- other: "about {{count}} weeks",
683
- },
684
-
685
- xWeeks: {
686
- one: "1 week",
687
- other: "{{count}} weeks",
688
- },
689
-
690
- aboutXMonths: {
691
- one: "about 1 month",
692
- other: "about {{count}} months",
693
- },
694
-
695
- xMonths: {
696
- one: "1 month",
697
- other: "{{count}} months",
698
- },
699
-
700
- aboutXYears: {
701
- one: "about 1 year",
702
- other: "about {{count}} years",
703
- },
704
-
705
- xYears: {
706
- one: "1 year",
707
- other: "{{count}} years",
708
- },
709
-
710
- overXYears: {
711
- one: "over 1 year",
712
- other: "over {{count}} years",
713
- },
714
-
715
- almostXYears: {
716
- one: "almost 1 year",
717
- other: "almost {{count}} years",
718
- },
719
- };
720
-
721
- const formatDistance$1 = (token, count, options) => {
722
- let result;
723
-
724
- const tokenValue = formatDistanceLocale$1[token];
725
- if (typeof tokenValue === "string") {
726
- result = tokenValue;
727
- } else if (count === 1) {
728
- result = tokenValue.one;
729
- } else {
730
- result = tokenValue.other.replace("{{count}}", count.toString());
731
- }
732
-
733
- if (options?.addSuffix) {
734
- if (options.comparison && options.comparison > 0) {
735
- return "in " + result;
736
- } else {
737
- return result + " ago";
738
- }
739
- }
740
-
741
- return result;
742
- };
743
-
744
- const formatRelativeLocale$1 = {
745
- lastWeek: "'last' eeee 'at' p",
746
- yesterday: "'yesterday at' p",
747
- today: "'today at' p",
748
- tomorrow: "'tomorrow at' p",
749
- nextWeek: "eeee 'at' p",
750
- other: "P",
751
- };
752
-
753
- const formatRelative$1 = (token, _date, _baseDate, _options) =>
754
- formatRelativeLocale$1[token];
755
-
756
- const eraValues$1 = {
757
- narrow: ["B", "A"],
758
- abbreviated: ["BC", "AD"],
759
- wide: ["Before Christ", "Anno Domini"],
760
- };
761
-
762
- const quarterValues$1 = {
763
- narrow: ["1", "2", "3", "4"],
764
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
765
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
766
- };
767
-
768
- // Note: in English, the names of days of the week and months are capitalized.
769
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
770
- // Generally, formatted dates should look like they are in the middle of a sentence,
771
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
772
- const monthValues$1 = {
773
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
774
- abbreviated: [
775
- "Jan",
776
- "Feb",
777
- "Mar",
778
- "Apr",
779
- "May",
780
- "Jun",
781
- "Jul",
782
- "Aug",
783
- "Sep",
784
- "Oct",
785
- "Nov",
786
- "Dec",
787
- ],
788
-
789
- wide: [
790
- "January",
791
- "February",
792
- "March",
793
- "April",
794
- "May",
795
- "June",
796
- "July",
797
- "August",
798
- "September",
799
- "October",
800
- "November",
801
- "December",
802
- ],
803
- };
804
-
805
- const dayValues$1 = {
806
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
807
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
808
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
809
- wide: [
810
- "Sunday",
811
- "Monday",
812
- "Tuesday",
813
- "Wednesday",
814
- "Thursday",
815
- "Friday",
816
- "Saturday",
817
- ],
818
- };
819
-
820
- const dayPeriodValues$1 = {
821
- narrow: {
822
- am: "a",
823
- pm: "p",
824
- midnight: "mi",
825
- noon: "n",
826
- morning: "morning",
827
- afternoon: "afternoon",
828
- evening: "evening",
829
- night: "night",
830
- },
831
- abbreviated: {
832
- am: "AM",
833
- pm: "PM",
834
- midnight: "midnight",
835
- noon: "noon",
836
- morning: "morning",
837
- afternoon: "afternoon",
838
- evening: "evening",
839
- night: "night",
840
- },
841
- wide: {
842
- am: "a.m.",
843
- pm: "p.m.",
844
- midnight: "midnight",
845
- noon: "noon",
846
- morning: "morning",
847
- afternoon: "afternoon",
848
- evening: "evening",
849
- night: "night",
850
- },
851
- };
852
-
853
- const formattingDayPeriodValues$1 = {
854
- narrow: {
855
- am: "a",
856
- pm: "p",
857
- midnight: "mi",
858
- noon: "n",
859
- morning: "in the morning",
860
- afternoon: "in the afternoon",
861
- evening: "in the evening",
862
- night: "at night",
863
- },
864
- abbreviated: {
865
- am: "AM",
866
- pm: "PM",
867
- midnight: "midnight",
868
- noon: "noon",
869
- morning: "in the morning",
870
- afternoon: "in the afternoon",
871
- evening: "in the evening",
872
- night: "at night",
873
- },
874
- wide: {
875
- am: "a.m.",
876
- pm: "p.m.",
877
- midnight: "midnight",
878
- noon: "noon",
879
- morning: "in the morning",
880
- afternoon: "in the afternoon",
881
- evening: "in the evening",
882
- night: "at night",
883
- },
884
- };
885
-
886
- const ordinalNumber$1 = (dirtyNumber, _options) => {
887
- const number = Number(dirtyNumber);
888
-
889
- // If ordinal numbers depend on context, for example,
890
- // if they are different for different grammatical genders,
891
- // use `options.unit`.
892
- //
893
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
894
- // 'day', 'hour', 'minute', 'second'.
895
-
896
- const rem100 = number % 100;
897
- if (rem100 > 20 || rem100 < 10) {
898
- switch (rem100 % 10) {
899
- case 1:
900
- return number + "st";
901
- case 2:
902
- return number + "nd";
903
- case 3:
904
- return number + "rd";
905
- }
906
- }
907
- return number + "th";
908
- };
909
-
910
- const localize$1 = {
911
- ordinalNumber: ordinalNumber$1,
912
-
913
- era: buildLocalizeFn({
914
- values: eraValues$1,
915
- defaultWidth: "wide",
916
- }),
917
-
918
- quarter: buildLocalizeFn({
919
- values: quarterValues$1,
920
- defaultWidth: "wide",
921
- argumentCallback: (quarter) => quarter - 1,
922
- }),
923
-
924
- month: buildLocalizeFn({
925
- values: monthValues$1,
926
- defaultWidth: "wide",
927
- }),
928
-
929
- day: buildLocalizeFn({
930
- values: dayValues$1,
931
- defaultWidth: "wide",
932
- }),
933
-
934
- dayPeriod: buildLocalizeFn({
935
- values: dayPeriodValues$1,
936
- defaultWidth: "wide",
937
- formattingValues: formattingDayPeriodValues$1,
938
- defaultFormattingWidth: "wide",
939
- }),
940
- };
941
-
942
- const matchOrdinalNumberPattern$1 = /^(\d+)(th|st|nd|rd)?/i;
943
- const parseOrdinalNumberPattern$1 = /\d+/i;
944
-
945
- const matchEraPatterns$1 = {
946
- narrow: /^(b|a)/i,
947
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
948
- wide: /^(before christ|before common era|anno domini|common era)/i,
949
- };
950
- const parseEraPatterns$1 = {
951
- any: [/^b/i, /^(a|c)/i],
952
- };
953
-
954
- const matchQuarterPatterns$1 = {
955
- narrow: /^[1234]/i,
956
- abbreviated: /^q[1234]/i,
957
- wide: /^[1234](th|st|nd|rd)? quarter/i,
958
- };
959
- const parseQuarterPatterns$1 = {
960
- any: [/1/i, /2/i, /3/i, /4/i],
961
- };
962
-
963
- const matchMonthPatterns$1 = {
964
- narrow: /^[jfmasond]/i,
965
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
966
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
967
- };
968
- const parseMonthPatterns$1 = {
969
- narrow: [
970
- /^j/i,
971
- /^f/i,
972
- /^m/i,
973
- /^a/i,
974
- /^m/i,
975
- /^j/i,
976
- /^j/i,
977
- /^a/i,
978
- /^s/i,
979
- /^o/i,
980
- /^n/i,
981
- /^d/i,
982
- ],
983
-
984
- any: [
985
- /^ja/i,
986
- /^f/i,
987
- /^mar/i,
988
- /^ap/i,
989
- /^may/i,
990
- /^jun/i,
991
- /^jul/i,
992
- /^au/i,
993
- /^s/i,
994
- /^o/i,
995
- /^n/i,
996
- /^d/i,
997
- ],
998
- };
999
-
1000
- const matchDayPatterns$1 = {
1001
- narrow: /^[smtwf]/i,
1002
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1003
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1004
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
1005
- };
1006
- const parseDayPatterns$1 = {
1007
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1008
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
1009
- };
1010
-
1011
- const matchDayPeriodPatterns$1 = {
1012
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1013
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
1014
- };
1015
- const parseDayPeriodPatterns$1 = {
1016
- any: {
1017
- am: /^a/i,
1018
- pm: /^p/i,
1019
- midnight: /^mi/i,
1020
- noon: /^no/i,
1021
- morning: /morning/i,
1022
- afternoon: /afternoon/i,
1023
- evening: /evening/i,
1024
- night: /night/i,
1025
- },
1026
- };
1027
-
1028
- const match$1 = {
1029
- ordinalNumber: buildMatchPatternFn({
1030
- matchPattern: matchOrdinalNumberPattern$1,
1031
- parsePattern: parseOrdinalNumberPattern$1,
1032
- valueCallback: (value) => parseInt(value, 10),
1033
- }),
1034
-
1035
- era: buildMatchFn({
1036
- matchPatterns: matchEraPatterns$1,
1037
- defaultMatchWidth: "wide",
1038
- parsePatterns: parseEraPatterns$1,
1039
- defaultParseWidth: "any",
1040
- }),
1041
-
1042
- quarter: buildMatchFn({
1043
- matchPatterns: matchQuarterPatterns$1,
1044
- defaultMatchWidth: "wide",
1045
- parsePatterns: parseQuarterPatterns$1,
1046
- defaultParseWidth: "any",
1047
- valueCallback: (index) => index + 1,
1048
- }),
1049
-
1050
- month: buildMatchFn({
1051
- matchPatterns: matchMonthPatterns$1,
1052
- defaultMatchWidth: "wide",
1053
- parsePatterns: parseMonthPatterns$1,
1054
- defaultParseWidth: "any",
1055
- }),
1056
-
1057
- day: buildMatchFn({
1058
- matchPatterns: matchDayPatterns$1,
1059
- defaultMatchWidth: "wide",
1060
- parsePatterns: parseDayPatterns$1,
1061
- defaultParseWidth: "any",
1062
- }),
1063
-
1064
- dayPeriod: buildMatchFn({
1065
- matchPatterns: matchDayPeriodPatterns$1,
1066
- defaultMatchWidth: "any",
1067
- parsePatterns: parseDayPeriodPatterns$1,
1068
- defaultParseWidth: "any",
1069
- }),
1070
- };
1071
-
1072
- const dateFormats$1 = {
1073
- full: "EEEE, d MMMM yyyy",
1074
- long: "d MMMM yyyy",
1075
- medium: "d MMM yyyy",
1076
- short: "dd/MM/yyyy",
1077
- };
1078
-
1079
- const timeFormats$1 = {
1080
- full: "HH:mm:ss zzzz",
1081
- long: "HH:mm:ss z",
1082
- medium: "HH:mm:ss",
1083
- short: "HH:mm",
1084
- };
1085
-
1086
- const dateTimeFormats$1 = {
1087
- full: "{{date}} 'at' {{time}}",
1088
- long: "{{date}} 'at' {{time}}",
1089
- medium: "{{date}}, {{time}}",
1090
- short: "{{date}}, {{time}}",
1091
- };
1092
-
1093
- const formatLong$1 = {
1094
- date: buildFormatLongFn({
1095
- formats: dateFormats$1,
1096
- defaultWidth: "full",
1097
- }),
1098
-
1099
- time: buildFormatLongFn({
1100
- formats: timeFormats$1,
1101
- defaultWidth: "full",
1102
- }),
1103
-
1104
- dateTime: buildFormatLongFn({
1105
- formats: dateTimeFormats$1,
1106
- defaultWidth: "full",
1107
- }),
1108
- };
1109
-
1110
- /**
1111
- * @category Locales
1112
- * @summary English locale (United Kingdom).
1113
- * @language English
1114
- * @iso-639-2 eng
1115
- * @author Alex [@glintik](https://github.com/glintik)
1116
- */
1117
- const enGB = {
1118
- code: "en-GB",
1119
- formatDistance: formatDistance$1,
1120
- formatLong: formatLong$1,
1121
- formatRelative: formatRelative$1,
1122
- localize: localize$1,
1123
- match: match$1,
1124
- options: {
1125
- weekStartsOn: 1 /* Monday */,
1126
- firstWeekContainsDate: 4,
1127
- },
1128
- };
1129
-
1130
- function declension(scheme, count) {
1131
- // scheme for count=1 exists
1132
- if (scheme.one !== undefined && count === 1) {
1133
- return scheme.one;
1134
- }
1135
-
1136
- const rem10 = count % 10;
1137
- const rem100 = count % 100;
1138
-
1139
- // 1, 21, 31, ...
1140
- if (rem10 === 1 && rem100 !== 11) {
1141
- return scheme.singularNominative.replace("{{count}}", String(count));
1142
-
1143
- // 2, 3, 4, 22, 23, 24, 32 ...
1144
- } else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
1145
- return scheme.singularGenitive.replace("{{count}}", String(count));
1146
-
1147
- // 5, 6, 7, 8, 9, 10, 11, ...
1148
- } else {
1149
- return scheme.pluralGenitive.replace("{{count}}", String(count));
1150
- }
1151
- }
1152
-
1153
- function buildLocalizeTokenFn(scheme) {
1154
- return (count, options) => {
1155
- if (options?.addSuffix) {
1156
- if (options.comparison && options.comparison > 0) {
1157
- if (scheme.future) {
1158
- return declension(scheme.future, count);
1159
- } else {
1160
- return "через " + declension(scheme.regular, count);
1161
- }
1162
- } else {
1163
- if (scheme.past) {
1164
- return declension(scheme.past, count);
1165
- } else {
1166
- return declension(scheme.regular, count) + " назад";
1167
- }
1168
- }
1169
- } else {
1170
- return declension(scheme.regular, count);
1171
- }
1172
- };
1173
- }
1174
-
1175
- const formatDistanceLocale = {
1176
- lessThanXSeconds: buildLocalizeTokenFn({
1177
- regular: {
1178
- one: "меньше секунды",
1179
- singularNominative: "меньше {{count}} секунды",
1180
- singularGenitive: "меньше {{count}} секунд",
1181
- pluralGenitive: "меньше {{count}} секунд",
1182
- },
1183
- future: {
1184
- one: "меньше, чем через секунду",
1185
- singularNominative: "меньше, чем через {{count}} секунду",
1186
- singularGenitive: "меньше, чем через {{count}} секунды",
1187
- pluralGenitive: "меньше, чем через {{count}} секунд",
1188
- },
1189
- }),
1190
-
1191
- xSeconds: buildLocalizeTokenFn({
1192
- regular: {
1193
- singularNominative: "{{count}} секунда",
1194
- singularGenitive: "{{count}} секунды",
1195
- pluralGenitive: "{{count}} секунд",
1196
- },
1197
- past: {
1198
- singularNominative: "{{count}} секунду назад",
1199
- singularGenitive: "{{count}} секунды назад",
1200
- pluralGenitive: "{{count}} секунд назад",
1201
- },
1202
- future: {
1203
- singularNominative: "через {{count}} секунду",
1204
- singularGenitive: "через {{count}} секунды",
1205
- pluralGenitive: "через {{count}} секунд",
1206
- },
1207
- }),
1208
-
1209
- halfAMinute: (_count, options) => {
1210
- if (options?.addSuffix) {
1211
- if (options.comparison && options.comparison > 0) {
1212
- return "через полминуты";
1213
- } else {
1214
- return "полминуты назад";
1215
- }
1216
- }
1217
-
1218
- return "полминуты";
1219
- },
1220
-
1221
- lessThanXMinutes: buildLocalizeTokenFn({
1222
- regular: {
1223
- one: "меньше минуты",
1224
- singularNominative: "меньше {{count}} минуты",
1225
- singularGenitive: "меньше {{count}} минут",
1226
- pluralGenitive: "меньше {{count}} минут",
1227
- },
1228
- future: {
1229
- one: "меньше, чем через минуту",
1230
- singularNominative: "меньше, чем через {{count}} минуту",
1231
- singularGenitive: "меньше, чем через {{count}} минуты",
1232
- pluralGenitive: "меньше, чем через {{count}} минут",
1233
- },
1234
- }),
1235
-
1236
- xMinutes: buildLocalizeTokenFn({
1237
- regular: {
1238
- singularNominative: "{{count}} минута",
1239
- singularGenitive: "{{count}} минуты",
1240
- pluralGenitive: "{{count}} минут",
1241
- },
1242
- past: {
1243
- singularNominative: "{{count}} минуту назад",
1244
- singularGenitive: "{{count}} минуты назад",
1245
- pluralGenitive: "{{count}} минут назад",
1246
- },
1247
- future: {
1248
- singularNominative: "через {{count}} минуту",
1249
- singularGenitive: "через {{count}} минуты",
1250
- pluralGenitive: "через {{count}} минут",
1251
- },
1252
- }),
1253
-
1254
- aboutXHours: buildLocalizeTokenFn({
1255
- regular: {
1256
- singularNominative: "около {{count}} часа",
1257
- singularGenitive: "около {{count}} часов",
1258
- pluralGenitive: "около {{count}} часов",
1259
- },
1260
- future: {
1261
- singularNominative: "приблизительно через {{count}} час",
1262
- singularGenitive: "приблизительно через {{count}} часа",
1263
- pluralGenitive: "приблизительно через {{count}} часов",
1264
- },
1265
- }),
1266
-
1267
- xHours: buildLocalizeTokenFn({
1268
- regular: {
1269
- singularNominative: "{{count}} час",
1270
- singularGenitive: "{{count}} часа",
1271
- pluralGenitive: "{{count}} часов",
1272
- },
1273
- }),
1274
-
1275
- xDays: buildLocalizeTokenFn({
1276
- regular: {
1277
- singularNominative: "{{count}} день",
1278
- singularGenitive: "{{count}} дня",
1279
- pluralGenitive: "{{count}} дней",
1280
- },
1281
- }),
1282
-
1283
- aboutXWeeks: buildLocalizeTokenFn({
1284
- regular: {
1285
- singularNominative: "около {{count}} недели",
1286
- singularGenitive: "около {{count}} недель",
1287
- pluralGenitive: "около {{count}} недель",
1288
- },
1289
- future: {
1290
- singularNominative: "приблизительно через {{count}} неделю",
1291
- singularGenitive: "приблизительно через {{count}} недели",
1292
- pluralGenitive: "приблизительно через {{count}} недель",
1293
- },
1294
- }),
1295
-
1296
- xWeeks: buildLocalizeTokenFn({
1297
- regular: {
1298
- singularNominative: "{{count}} неделя",
1299
- singularGenitive: "{{count}} недели",
1300
- pluralGenitive: "{{count}} недель",
1301
- },
1302
- }),
1303
-
1304
- aboutXMonths: buildLocalizeTokenFn({
1305
- regular: {
1306
- singularNominative: "около {{count}} месяца",
1307
- singularGenitive: "около {{count}} месяцев",
1308
- pluralGenitive: "около {{count}} месяцев",
1309
- },
1310
- future: {
1311
- singularNominative: "приблизительно через {{count}} месяц",
1312
- singularGenitive: "приблизительно через {{count}} месяца",
1313
- pluralGenitive: "приблизительно через {{count}} месяцев",
1314
- },
1315
- }),
1316
-
1317
- xMonths: buildLocalizeTokenFn({
1318
- regular: {
1319
- singularNominative: "{{count}} месяц",
1320
- singularGenitive: "{{count}} месяца",
1321
- pluralGenitive: "{{count}} месяцев",
1322
- },
1323
- }),
1324
-
1325
- aboutXYears: buildLocalizeTokenFn({
1326
- regular: {
1327
- singularNominative: "около {{count}} года",
1328
- singularGenitive: "около {{count}} лет",
1329
- pluralGenitive: "около {{count}} лет",
1330
- },
1331
- future: {
1332
- singularNominative: "приблизительно через {{count}} год",
1333
- singularGenitive: "приблизительно через {{count}} года",
1334
- pluralGenitive: "приблизительно через {{count}} лет",
1335
- },
1336
- }),
1337
-
1338
- xYears: buildLocalizeTokenFn({
1339
- regular: {
1340
- singularNominative: "{{count}} год",
1341
- singularGenitive: "{{count}} года",
1342
- pluralGenitive: "{{count}} лет",
1343
- },
1344
- }),
1345
-
1346
- overXYears: buildLocalizeTokenFn({
1347
- regular: {
1348
- singularNominative: "больше {{count}} года",
1349
- singularGenitive: "больше {{count}} лет",
1350
- pluralGenitive: "больше {{count}} лет",
1351
- },
1352
- future: {
1353
- singularNominative: "больше, чем через {{count}} год",
1354
- singularGenitive: "больше, чем через {{count}} года",
1355
- pluralGenitive: "больше, чем через {{count}} лет",
1356
- },
1357
- }),
1358
-
1359
- almostXYears: buildLocalizeTokenFn({
1360
- regular: {
1361
- singularNominative: "почти {{count}} год",
1362
- singularGenitive: "почти {{count}} года",
1363
- pluralGenitive: "почти {{count}} лет",
1364
- },
1365
- future: {
1366
- singularNominative: "почти через {{count}} год",
1367
- singularGenitive: "почти через {{count}} года",
1368
- pluralGenitive: "почти через {{count}} лет",
1369
- },
1370
- }),
1371
- };
1372
-
1373
- const formatDistance = (token, count, options) => {
1374
- return formatDistanceLocale[token](count, options);
1375
- };
1376
-
1377
- const dateFormats = {
1378
- full: "EEEE, d MMMM y 'г.'",
1379
- long: "d MMMM y 'г.'",
1380
- medium: "d MMM y 'г.'",
1381
- short: "dd.MM.y",
1382
- };
1383
-
1384
- const timeFormats = {
1385
- full: "H:mm:ss zzzz",
1386
- long: "H:mm:ss z",
1387
- medium: "H:mm:ss",
1388
- short: "H:mm",
1389
- };
1390
-
1391
- const dateTimeFormats = {
1392
- any: "{{date}}, {{time}}",
1393
- };
1394
-
1395
- const formatLong = {
1396
- date: buildFormatLongFn({
1397
- formats: dateFormats,
1398
- defaultWidth: "full",
1399
- }),
1400
-
1401
- time: buildFormatLongFn({
1402
- formats: timeFormats,
1403
- defaultWidth: "full",
1404
- }),
1405
-
1406
- dateTime: buildFormatLongFn({
1407
- formats: dateTimeFormats,
1408
- defaultWidth: "any",
1409
- }),
1410
- };
1411
-
1412
- /**
1413
- * @module constants
1414
- * @summary Useful constants
1415
- * @description
1416
- * Collection of useful date constants.
1417
- *
1418
- * The constants could be imported from `date-fns/constants`:
1419
- *
1420
- * ```ts
1421
- * import { maxTime, minTime } from "./constants/date-fns/constants";
1422
- *
1423
- * function isAllowedTime(time) {
1424
- * return time <= maxTime && time >= minTime;
1425
- * }
1426
- * ```
1427
- */
1428
-
1429
-
1430
- /**
1431
- * @constant
1432
- * @name constructFromSymbol
1433
- * @summary Symbol enabling Date extensions to inherit properties from the reference date.
1434
- *
1435
- * The symbol is used to enable the `constructFrom` function to construct a date
1436
- * using a reference date and a value. It allows to transfer extra properties
1437
- * from the reference date to the new date. It's useful for extensions like
1438
- * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
1439
- * a constructor argument.
1440
- */
1441
- const constructFromSymbol = Symbol.for("constructDateFrom");
1442
-
1443
- /**
1444
- * @name constructFrom
1445
- * @category Generic Helpers
1446
- * @summary Constructs a date using the reference date and the value
1447
- *
1448
- * @description
1449
- * The function constructs a new date using the constructor from the reference
1450
- * date and the given value. It helps to build generic functions that accept
1451
- * date extensions.
1452
- *
1453
- * It defaults to `Date` if the passed reference date is a number or a string.
1454
- *
1455
- * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
1456
- * enabling to transfer extra properties from the reference date to the new date.
1457
- * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
1458
- * that accept a time zone as a constructor argument.
1459
- *
1460
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1461
- *
1462
- * @param date - The reference date to take constructor from
1463
- * @param value - The value to create the date
1464
- *
1465
- * @returns Date initialized using the given date and value
1466
- *
1467
- * @example
1468
- * import { constructFrom } from "./constructFrom/date-fns";
1469
- *
1470
- * // A function that clones a date preserving the original type
1471
- * function cloneDate<DateType extends Date>(date: DateType): DateType {
1472
- * return constructFrom(
1473
- * date, // Use constructor from the given date
1474
- * date.getTime() // Use the date value to create a new date
1475
- * );
1476
- * }
1477
- */
1478
- function constructFrom(date, value) {
1479
- if (typeof date === "function") return date(value);
1480
-
1481
- if (date && typeof date === "object" && constructFromSymbol in date)
1482
- return date[constructFromSymbol](value);
1483
-
1484
- if (date instanceof Date) return new date.constructor(value);
1485
-
1486
- return new Date(value);
1487
- }
1488
-
1489
- function normalizeDates(context, ...dates) {
1490
- const normalize = constructFrom.bind(
1491
- null,
1492
- context || dates.find((date) => typeof date === "object"),
1493
- );
1494
- return dates.map(normalize);
1495
- }
1496
-
1497
- let defaultOptions = {};
1498
-
1499
- function getDefaultOptions() {
1500
- return defaultOptions;
1501
- }
1502
-
1503
- /**
1504
- * @name toDate
1505
- * @category Common Helpers
1506
- * @summary Convert the given argument to an instance of Date.
1507
- *
1508
- * @description
1509
- * Convert the given argument to an instance of Date.
1510
- *
1511
- * If the argument is an instance of Date, the function returns its clone.
1512
- *
1513
- * If the argument is a number, it is treated as a timestamp.
1514
- *
1515
- * If the argument is none of the above, the function returns Invalid Date.
1516
- *
1517
- * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
1518
- * enabling to transfer extra properties from the reference date to the new date.
1519
- * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
1520
- * that accept a time zone as a constructor argument.
1521
- *
1522
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
1523
- *
1524
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1525
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1526
- *
1527
- * @param argument - The value to convert
1528
- *
1529
- * @returns The parsed date in the local time zone
1530
- *
1531
- * @example
1532
- * // Clone the date:
1533
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
1534
- * //=> Tue Feb 11 2014 11:30:30
1535
- *
1536
- * @example
1537
- * // Convert the timestamp to date:
1538
- * const result = toDate(1392098430000)
1539
- * //=> Tue Feb 11 2014 11:30:30
1540
- */
1541
- function toDate(argument, context) {
1542
- // [TODO] Get rid of `toDate` or `constructFrom`?
1543
- return constructFrom(context || argument, argument);
1544
- }
1545
-
1546
- /**
1547
- * The {@link startOfWeek} function options.
1548
- */
1549
-
1550
- /**
1551
- * @name startOfWeek
1552
- * @category Week Helpers
1553
- * @summary Return the start of a week for the given date.
1554
- *
1555
- * @description
1556
- * Return the start of a week for the given date.
1557
- * The result will be in the local timezone.
1558
- *
1559
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1560
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1561
- *
1562
- * @param date - The original date
1563
- * @param options - An object with options
1564
- *
1565
- * @returns The start of a week
1566
- *
1567
- * @example
1568
- * // The start of a week for 2 September 2014 11:55:00:
1569
- * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
1570
- * //=> Sun Aug 31 2014 00:00:00
1571
- *
1572
- * @example
1573
- * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
1574
- * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
1575
- * //=> Mon Sep 01 2014 00:00:00
1576
- */
1577
- function startOfWeek(date, options) {
1578
- const defaultOptions = getDefaultOptions();
1579
- const weekStartsOn =
1580
- options?.weekStartsOn ??
1581
- options?.locale?.options?.weekStartsOn ??
1582
- defaultOptions.weekStartsOn ??
1583
- defaultOptions.locale?.options?.weekStartsOn ??
1584
- 0;
1585
-
1586
- const _date = toDate(date, options?.in);
1587
- const day = _date.getDay();
1588
- const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
1589
-
1590
- _date.setDate(_date.getDate() - diff);
1591
- _date.setHours(0, 0, 0, 0);
1592
- return _date;
1593
- }
1594
-
1595
- /**
1596
- * The {@link isSameWeek} function options.
1597
- */
1598
-
1599
- /**
1600
- * @name isSameWeek
1601
- * @category Week Helpers
1602
- * @summary Are the given dates in the same week (and month and year)?
1603
- *
1604
- * @description
1605
- * Are the given dates in the same week (and month and year)?
1606
- *
1607
- * @param laterDate - The first date to check
1608
- * @param earlierDate - The second date to check
1609
- * @param options - An object with options
1610
- *
1611
- * @returns The dates are in the same week (and month and year)
1612
- *
1613
- * @example
1614
- * // Are 31 August 2014 and 4 September 2014 in the same week?
1615
- * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))
1616
- * //=> true
1617
- *
1618
- * @example
1619
- * // If week starts with Monday,
1620
- * // are 31 August 2014 and 4 September 2014 in the same week?
1621
- * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {
1622
- * weekStartsOn: 1
1623
- * })
1624
- * //=> false
1625
- *
1626
- * @example
1627
- * // Are 1 January 2014 and 1 January 2015 in the same week?
1628
- * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))
1629
- * //=> false
1630
- */
1631
- function isSameWeek(laterDate, earlierDate, options) {
1632
- const [laterDate_, earlierDate_] = normalizeDates(
1633
- options?.in,
1634
- laterDate,
1635
- earlierDate,
1636
- );
1637
- return (
1638
- +startOfWeek(laterDate_, options) === +startOfWeek(earlierDate_, options)
1639
- );
1640
- }
1641
-
1642
- const accusativeWeekdays = [
1643
- "воскресенье",
1644
- "понедельник",
1645
- "вторник",
1646
- "среду",
1647
- "четверг",
1648
- "пятницу",
1649
- "субботу",
1650
- ];
1651
-
1652
- function lastWeek(day) {
1653
- const weekday = accusativeWeekdays[day];
1654
-
1655
- switch (day) {
1656
- case 0:
1657
- return "'в прошлое " + weekday + " в' p";
1658
- case 1:
1659
- case 2:
1660
- case 4:
1661
- return "'в прошлый " + weekday + " в' p";
1662
- case 3:
1663
- case 5:
1664
- case 6:
1665
- return "'в прошлую " + weekday + " в' p";
1666
- }
1667
- }
1668
-
1669
- function thisWeek(day) {
1670
- const weekday = accusativeWeekdays[day];
1671
-
1672
- if (day === 2 /* Tue */) {
1673
- return "'во " + weekday + " в' p";
1674
- } else {
1675
- return "'в " + weekday + " в' p";
1676
- }
1677
- }
1678
-
1679
- function nextWeek(day) {
1680
- const weekday = accusativeWeekdays[day];
1681
-
1682
- switch (day) {
1683
- case 0:
1684
- return "'в следующее " + weekday + " в' p";
1685
- case 1:
1686
- case 2:
1687
- case 4:
1688
- return "'в следующий " + weekday + " в' p";
1689
- case 3:
1690
- case 5:
1691
- case 6:
1692
- return "'в следующую " + weekday + " в' p";
1693
- }
1694
- }
1695
-
1696
- const formatRelativeLocale = {
1697
- lastWeek: (date, baseDate, options) => {
1698
- const day = date.getDay();
1699
- if (isSameWeek(date, baseDate, options)) {
1700
- return thisWeek(day);
1701
- } else {
1702
- return lastWeek(day);
1703
- }
1704
- },
1705
- yesterday: "'вчера в' p",
1706
- today: "'сегодня в' p",
1707
- tomorrow: "'завтра в' p",
1708
- nextWeek: (date, baseDate, options) => {
1709
- const day = date.getDay();
1710
- if (isSameWeek(date, baseDate, options)) {
1711
- return thisWeek(day);
1712
- } else {
1713
- return nextWeek(day);
1714
- }
1715
- },
1716
- other: "P",
1717
- };
1718
-
1719
- const formatRelative = (token, date, baseDate, options) => {
1720
- const format = formatRelativeLocale[token];
1721
-
1722
- if (typeof format === "function") {
1723
- return format(date, baseDate, options);
1724
- }
1725
-
1726
- return format;
1727
- };
1728
-
1729
- const eraValues = {
1730
- narrow: ["до н.э.", "н.э."],
1731
- abbreviated: ["до н. э.", "н. э."],
1732
- wide: ["до нашей эры", "нашей эры"],
1733
- };
1734
-
1735
- const quarterValues = {
1736
- narrow: ["1", "2", "3", "4"],
1737
- abbreviated: ["1-й кв.", "2-й кв.", "3-й кв.", "4-й кв."],
1738
- wide: ["1-й квартал", "2-й квартал", "3-й квартал", "4-й квартал"],
1739
- };
1740
-
1741
- const monthValues = {
1742
- narrow: ["Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"],
1743
- abbreviated: [
1744
- "янв.",
1745
- "фев.",
1746
- "март",
1747
- "апр.",
1748
- "май",
1749
- "июнь",
1750
- "июль",
1751
- "авг.",
1752
- "сент.",
1753
- "окт.",
1754
- "нояб.",
1755
- "дек.",
1756
- ],
1757
-
1758
- wide: [
1759
- "январь",
1760
- "февраль",
1761
- "март",
1762
- "апрель",
1763
- "май",
1764
- "июнь",
1765
- "июль",
1766
- "август",
1767
- "сентябрь",
1768
- "октябрь",
1769
- "ноябрь",
1770
- "декабрь",
1771
- ],
1772
- };
1773
-
1774
- const formattingMonthValues = {
1775
- narrow: ["Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"],
1776
- abbreviated: [
1777
- "янв.",
1778
- "фев.",
1779
- "мар.",
1780
- "апр.",
1781
- "мая",
1782
- "июн.",
1783
- "июл.",
1784
- "авг.",
1785
- "сент.",
1786
- "окт.",
1787
- "нояб.",
1788
- "дек.",
1789
- ],
1790
-
1791
- wide: [
1792
- "января",
1793
- "февраля",
1794
- "марта",
1795
- "апреля",
1796
- "мая",
1797
- "июня",
1798
- "июля",
1799
- "августа",
1800
- "сентября",
1801
- "октября",
1802
- "ноября",
1803
- "декабря",
1804
- ],
1805
- };
1806
-
1807
- const dayValues = {
1808
- narrow: ["В", "П", "В", "С", "Ч", "П", "С"],
1809
- short: ["вс", "пн", "вт", "ср", "чт", "пт", "сб"],
1810
- abbreviated: ["вск", "пнд", "втр", "срд", "чтв", "птн", "суб"],
1811
- wide: [
1812
- "воскресенье",
1813
- "понедельник",
1814
- "вторник",
1815
- "среда",
1816
- "четверг",
1817
- "пятница",
1818
- "суббота",
1819
- ],
1820
- };
1821
-
1822
- const dayPeriodValues = {
1823
- narrow: {
1824
- am: "ДП",
1825
- pm: "ПП",
1826
- midnight: "полн.",
1827
- noon: "полд.",
1828
- morning: "утро",
1829
- afternoon: "день",
1830
- evening: "веч.",
1831
- night: "ночь",
1832
- },
1833
- abbreviated: {
1834
- am: "ДП",
1835
- pm: "ПП",
1836
- midnight: "полн.",
1837
- noon: "полд.",
1838
- morning: "утро",
1839
- afternoon: "день",
1840
- evening: "веч.",
1841
- night: "ночь",
1842
- },
1843
- wide: {
1844
- am: "ДП",
1845
- pm: "ПП",
1846
- midnight: "полночь",
1847
- noon: "полдень",
1848
- morning: "утро",
1849
- afternoon: "день",
1850
- evening: "вечер",
1851
- night: "ночь",
1852
- },
1853
- };
1854
-
1855
- const formattingDayPeriodValues = {
1856
- narrow: {
1857
- am: "ДП",
1858
- pm: "ПП",
1859
- midnight: "полн.",
1860
- noon: "полд.",
1861
- morning: "утра",
1862
- afternoon: "дня",
1863
- evening: "веч.",
1864
- night: "ночи",
1865
- },
1866
- abbreviated: {
1867
- am: "ДП",
1868
- pm: "ПП",
1869
- midnight: "полн.",
1870
- noon: "полд.",
1871
- morning: "утра",
1872
- afternoon: "дня",
1873
- evening: "веч.",
1874
- night: "ночи",
1875
- },
1876
- wide: {
1877
- am: "ДП",
1878
- pm: "ПП",
1879
- midnight: "полночь",
1880
- noon: "полдень",
1881
- morning: "утра",
1882
- afternoon: "дня",
1883
- evening: "вечера",
1884
- night: "ночи",
1885
- },
1886
- };
1887
-
1888
- const ordinalNumber = (dirtyNumber, options) => {
1889
- const number = Number(dirtyNumber);
1890
- const unit = options?.unit;
1891
-
1892
- let suffix;
1893
- if (unit === "date") {
1894
- suffix = "-е";
1895
- } else if (unit === "week" || unit === "minute" || unit === "second") {
1896
- suffix = "-я";
1897
- } else {
1898
- suffix = "-й";
1899
- }
1900
-
1901
- return number + suffix;
1902
- };
1903
-
1904
- const localize = {
1905
- ordinalNumber,
1906
-
1907
- era: buildLocalizeFn({
1908
- values: eraValues,
1909
- defaultWidth: "wide",
1910
- }),
1911
-
1912
- quarter: buildLocalizeFn({
1913
- values: quarterValues,
1914
- defaultWidth: "wide",
1915
- argumentCallback: (quarter) => quarter - 1,
1916
- }),
1917
-
1918
- month: buildLocalizeFn({
1919
- values: monthValues,
1920
- defaultWidth: "wide",
1921
- formattingValues: formattingMonthValues,
1922
- defaultFormattingWidth: "wide",
1923
- }),
1924
-
1925
- day: buildLocalizeFn({
1926
- values: dayValues,
1927
- defaultWidth: "wide",
1928
- }),
1929
-
1930
- dayPeriod: buildLocalizeFn({
1931
- values: dayPeriodValues,
1932
- defaultWidth: "any",
1933
- formattingValues: formattingDayPeriodValues,
1934
- defaultFormattingWidth: "wide",
1935
- }),
1936
- };
1937
-
1938
- const matchOrdinalNumberPattern = /^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i;
1939
- const parseOrdinalNumberPattern = /\d+/i;
1940
-
1941
- const matchEraPatterns = {
1942
- narrow: /^((до )?н\.?\s?э\.?)/i,
1943
- abbreviated: /^((до )?н\.?\s?э\.?)/i,
1944
- wide: /^(до нашей эры|нашей эры|наша эра)/i,
1945
- };
1946
- const parseEraPatterns = {
1947
- any: [/^д/i, /^н/i],
1948
- };
1949
-
1950
- const matchQuarterPatterns = {
1951
- narrow: /^[1234]/i,
1952
- abbreviated: /^[1234](-?[ыои]?й?)? кв.?/i,
1953
- wide: /^[1234](-?[ыои]?й?)? квартал/i,
1954
- };
1955
-
1956
- const parseQuarterPatterns = {
1957
- any: [/1/i, /2/i, /3/i, /4/i],
1958
- };
1959
-
1960
- const matchMonthPatterns = {
1961
- narrow: /^[яфмаисонд]/i,
1962
- abbreviated:
1963
- /^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,
1964
- wide: /^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i,
1965
- };
1966
-
1967
- const parseMonthPatterns = {
1968
- narrow: [
1969
- /^я/i,
1970
- /^ф/i,
1971
- /^м/i,
1972
- /^а/i,
1973
- /^м/i,
1974
- /^и/i,
1975
- /^и/i,
1976
- /^а/i,
1977
- /^с/i,
1978
- /^о/i,
1979
- /^н/i,
1980
- /^я/i,
1981
- ],
1982
-
1983
- any: [
1984
- /^я/i,
1985
- /^ф/i,
1986
- /^мар/i,
1987
- /^ап/i,
1988
- /^ма[йя]/i,
1989
- /^июн/i,
1990
- /^июл/i,
1991
- /^ав/i,
1992
- /^с/i,
1993
- /^о/i,
1994
- /^н/i,
1995
- /^д/i,
1996
- ],
1997
- };
1998
-
1999
- const matchDayPatterns = {
2000
- narrow: /^[впсч]/i,
2001
- short: /^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,
2002
- abbreviated: /^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,
2003
- wide: /^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i,
2004
- };
2005
-
2006
- const parseDayPatterns = {
2007
- narrow: [/^в/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
2008
- any: [/^в[ос]/i, /^п[он]/i, /^в/i, /^ср/i, /^ч/i, /^п[ят]/i, /^с[уб]/i],
2009
- };
2010
-
2011
- const matchDayPeriodPatterns = {
2012
- narrow: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
2013
- abbreviated: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
2014
- wide: /^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i,
2015
- };
2016
-
2017
- const parseDayPeriodPatterns = {
2018
- any: {
2019
- am: /^дп/i,
2020
- pm: /^пп/i,
2021
- midnight: /^полн/i,
2022
- noon: /^полд/i,
2023
- morning: /^у/i,
2024
- afternoon: /^д[ен]/i,
2025
- evening: /^в/i,
2026
- night: /^н/i,
2027
- },
2028
- };
2029
-
2030
- const match = {
2031
- ordinalNumber: buildMatchPatternFn({
2032
- matchPattern: matchOrdinalNumberPattern,
2033
- parsePattern: parseOrdinalNumberPattern,
2034
- valueCallback: (value) => parseInt(value, 10),
2035
- }),
2036
-
2037
- era: buildMatchFn({
2038
- matchPatterns: matchEraPatterns,
2039
- defaultMatchWidth: "wide",
2040
- parsePatterns: parseEraPatterns,
2041
- defaultParseWidth: "any",
2042
- }),
2043
-
2044
- quarter: buildMatchFn({
2045
- matchPatterns: matchQuarterPatterns,
2046
- defaultMatchWidth: "wide",
2047
- parsePatterns: parseQuarterPatterns,
2048
- defaultParseWidth: "any",
2049
- valueCallback: (index) => index + 1,
2050
- }),
2051
-
2052
- month: buildMatchFn({
2053
- matchPatterns: matchMonthPatterns,
2054
- defaultMatchWidth: "wide",
2055
- parsePatterns: parseMonthPatterns,
2056
- defaultParseWidth: "any",
2057
- }),
2058
-
2059
- day: buildMatchFn({
2060
- matchPatterns: matchDayPatterns,
2061
- defaultMatchWidth: "wide",
2062
- parsePatterns: parseDayPatterns,
2063
- defaultParseWidth: "any",
2064
- }),
2065
-
2066
- dayPeriod: buildMatchFn({
2067
- matchPatterns: matchDayPeriodPatterns,
2068
- defaultMatchWidth: "wide",
2069
- parsePatterns: parseDayPeriodPatterns,
2070
- defaultParseWidth: "any",
2071
- }),
2072
- };
2073
-
2074
- /**
2075
- * @category Locales
2076
- * @summary Russian locale.
2077
- * @language Russian
2078
- * @iso-639-2 rus
2079
- * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
2080
- * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
2081
- */
2082
- const ru$2 = {
2083
- code: "ru",
2084
- formatDistance: formatDistance,
2085
- formatLong: formatLong,
2086
- formatRelative: formatRelative,
2087
- localize: localize,
2088
- match: match,
2089
- options: {
2090
- weekStartsOn: 1 /* Monday */,
2091
- firstWeekContainsDate: 1,
2092
- },
2093
- };
2094
-
2095
- var hyAm$1 = {exports: {}};
2096
-
2097
- var hyAm = hyAm$1.exports;
2098
-
2099
- var hasRequiredHyAm;
2100
-
2101
- function requireHyAm () {
2102
- if (hasRequiredHyAm) return hyAm$1.exports;
2103
- hasRequiredHyAm = 1;
2104
- (function (module, exports) {
2105
- !function(_,e){module.exports=e(dayjs);}(hyAm,(function(_){function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"hy-am",weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),months:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),weekStart:1,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"}};return t.default.locale(d,null,true),d}));
2106
- } (hyAm$1));
2107
- return hyAm$1.exports;
2108
- }
2109
-
2110
- requireHyAm();
2111
-
2112
- var ru$1 = {exports: {}};
2113
-
2114
- var ru = ru$1.exports;
2115
-
2116
- var hasRequiredRu;
2117
-
2118
- function requireRu () {
2119
- if (hasRequiredRu) return ru$1.exports;
2120
- hasRequiredRu = 1;
2121
- (function (module, exports) {
2122
- !function(_,t){module.exports=t(dayjs);}(ru,(function(_){function t(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var e=t(_),n="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),s="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),r="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),o="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),i=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function d(_,t,e){var n,s;return "m"===e?t?"минута":"минуту":_+" "+(n=+_,s={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[e].split("_"),n%10==1&&n%100!=11?s[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}var u=function(_,t){return i.test(t)?n[_.month()]:s[_.month()]};u.s=s,u.f=n;var a=function(_,t){return i.test(t)?r[_.month()]:o[_.month()]};a.s=o,a.f=r;var m={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:u,monthsShort:a,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:d,mm:d,h:"час",hh:d,d:"день",dd:d,M:"месяц",MM:d,y:"год",yy:d},ordinal:function(_){return _},meridiem:function(_){return _<4?"ночи":_<12?"утра":_<17?"дня":"вечера"}};return e.default.locale(m,null,true),m}));
2123
- } (ru$1));
2124
- return ru$1.exports;
2125
- }
2126
-
2127
- requireRu();
2128
-
2129
- var en$1 = {exports: {}};
2130
-
2131
- var en = en$1.exports;
2132
-
2133
- var hasRequiredEn;
2134
-
2135
- function requireEn () {
2136
- if (hasRequiredEn) return en$1.exports;
2137
- hasRequiredEn = 1;
2138
- (function (module, exports) {
2139
- !function(e,n){module.exports=n();}(en,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
2140
- } (en$1));
2141
- return en$1.exports;
2142
- }
2143
-
2144
- requireEn();
2145
-
2146
15
  registerLocale('hy', hy);
2147
16
  registerLocale('en', enGB);
2148
- registerLocale('ru', ru$2);
17
+ registerLocale('ru', ru);
2149
18
  function useImportFilesDynamically(dayjsLocale) {
2150
19
  var _useState = useState(false),
2151
20
  _useState2 = _slicedToArray(_useState, 2);