@rededor/cura 0.5.4 → 1.0.0-alpha.0

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 (640) hide show
  1. package/dist/assets/icons/iconset-default-list.ts +1 -1
  2. package/dist/assets/icons/iconset-default-tmp.svg +8 -0
  3. package/dist/assets/icons/iconset-default.svg +1 -1
  4. package/dist/cjs/app-globals-bcffd819.js +511 -0
  5. package/dist/cjs/app-globals-bcffd819.js.map +1 -0
  6. package/dist/cjs/cura-accordion_9.cjs.entry.js +544 -0
  7. package/dist/cjs/cura-accordion_9.cjs.entry.js.map +1 -0
  8. package/dist/cjs/cura-alert.cjs.entry.js +57 -55
  9. package/dist/cjs/cura-alert.cjs.entry.js.map +1 -1
  10. package/dist/cjs/cura-avatar.cjs.entry.js +68 -0
  11. package/dist/cjs/cura-avatar.cjs.entry.js.map +1 -0
  12. package/dist/cjs/cura-button-outline.cjs.entry.js +102 -71
  13. package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
  14. package/dist/cjs/cura-button-select.cjs.entry.js +91 -85
  15. package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
  16. package/dist/cjs/cura-button-transparent_2.cjs.entry.js +4055 -0
  17. package/dist/cjs/cura-button-transparent_2.cjs.entry.js.map +1 -0
  18. package/dist/cjs/cura-calendar.cjs.entry.js +3913 -0
  19. package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -0
  20. package/dist/cjs/cura-card.cjs.entry.js +53 -0
  21. package/dist/cjs/cura-card.cjs.entry.js.map +1 -0
  22. package/dist/cjs/cura-checkbox.cjs.entry.js +168 -131
  23. package/dist/cjs/cura-checkbox.cjs.entry.js.map +1 -1
  24. package/dist/cjs/cura-display.cjs.entry.js +63 -62
  25. package/dist/cjs/cura-display.cjs.entry.js.map +1 -1
  26. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +22 -0
  27. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js.map +1 -0
  28. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +55 -0
  29. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +1 -0
  30. package/dist/cjs/cura-dropdown-search.cjs.entry.js +209 -0
  31. package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -0
  32. package/dist/cjs/cura-forms.definitions-c164f1b8.js +20 -0
  33. package/dist/cjs/cura-forms.definitions-c164f1b8.js.map +1 -0
  34. package/dist/cjs/cura-icon.definitions-8d714f6a.js +21 -0
  35. package/dist/cjs/cura-icon.definitions-8d714f6a.js.map +1 -0
  36. package/dist/cjs/cura-icons-view.cjs.entry.js +24 -23
  37. package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
  38. package/dist/cjs/cura-radio.cjs.entry.js +142 -103
  39. package/dist/cjs/cura-radio.cjs.entry.js.map +1 -1
  40. package/dist/cjs/cura-select_2.cjs.entry.js +325 -0
  41. package/dist/cjs/cura-select_2.cjs.entry.js.map +1 -0
  42. package/dist/cjs/cura-switch.cjs.entry.js +113 -78
  43. package/dist/cjs/cura-switch.cjs.entry.js.map +1 -1
  44. package/dist/cjs/cura.cjs.js +13 -22
  45. package/dist/cjs/cura.cjs.js.map +1 -1
  46. package/dist/cjs/index-5b63ff7a.js +1529 -0
  47. package/dist/cjs/index-5b63ff7a.js.map +1 -0
  48. package/dist/cjs/index.cjs.js +1 -1
  49. package/dist/cjs/index.cjs.js.map +1 -1
  50. package/dist/cjs/loader.cjs.js +6 -31
  51. package/dist/cjs/loader.cjs.js.map +1 -1
  52. package/dist/collection/api/cura-api.js +30 -30
  53. package/dist/collection/api/cura-api.js.map +1 -1
  54. package/dist/collection/api/cura-api.type.js +2 -2
  55. package/dist/collection/api/cura-api.type.js.map +1 -1
  56. package/dist/collection/api/modules/cura-theme-breakpoints-module.js +10 -10
  57. package/dist/collection/api/modules/cura-theme-breakpoints-module.js.map +1 -1
  58. package/dist/collection/api/modules/cura-theme-colors-module.js +72 -72
  59. package/dist/collection/api/modules/cura-theme-colors-module.js.map +1 -1
  60. package/dist/collection/api/modules/cura-theme-fonts-module.js +28 -28
  61. package/dist/collection/api/modules/cura-theme-fonts-module.js.map +1 -1
  62. package/dist/collection/api/modules/cura-theme-module.js +66 -66
  63. package/dist/collection/api/modules/cura-theme-module.js.map +1 -1
  64. package/dist/collection/api/modules/cura-theme-spacing-module.js +9 -9
  65. package/dist/collection/api/modules/cura-theme-spacing-module.js.map +1 -1
  66. package/dist/collection/api/theme-presets/static.js +63 -63
  67. package/dist/collection/api/theme-presets/static.js.map +1 -1
  68. package/dist/collection/api/theme-presets/theme-default.js +41 -41
  69. package/dist/collection/api/theme-presets/theme-default.js.map +1 -1
  70. package/dist/collection/api/theme-presets/theme-legacy-default.js +24 -24
  71. package/dist/collection/api/theme-presets/theme-legacy-default.js.map +1 -1
  72. package/dist/collection/api/theme-presets/theme-maternity.js +38 -38
  73. package/dist/collection/api/theme-presets/theme-maternity.js.map +1 -1
  74. package/dist/collection/api/theme-presets/theme-oncology.js +46 -46
  75. package/dist/collection/api/theme-presets/theme-oncology.js.map +1 -1
  76. package/dist/collection/api/theme-presets/theme-presets.js +8 -8
  77. package/dist/collection/api/theme-presets/theme-presets.js.map +1 -1
  78. package/dist/collection/assets/icons/iconset-default-list.js +1 -1
  79. package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
  80. package/dist/collection/assets/icons/iconset-default-tmp.svg +8 -0
  81. package/dist/collection/assets/icons/iconset-default.svg +1 -1
  82. package/dist/collection/assets/images/avatar/doctor-default.svg +8 -0
  83. package/dist/collection/assets/images/avatar/dora-default.svg +5 -0
  84. package/dist/collection/assets/images/avatar/patient-default.svg +12 -0
  85. package/dist/collection/assets/images/avatar/unit-default.svg +9 -0
  86. package/dist/collection/assets/images/logoCura.svg +15 -0
  87. package/dist/collection/assets-raw/icons/default/contacts.svg +3 -0
  88. package/dist/collection/assets-raw/icons/default/scheduleCancel.svg +3 -0
  89. package/dist/collection/collection-manifest.json +29 -21
  90. package/dist/collection/components/accordion/cura-accordion/cura-accordion.js +267 -267
  91. package/dist/collection/components/accordion/cura-accordion/cura-accordion.js.map +1 -1
  92. package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js +127 -127
  93. package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js.map +1 -1
  94. package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js +196 -196
  95. package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js.map +1 -1
  96. package/dist/collection/components/buttons/cura-button/cura-button.css +112 -46
  97. package/dist/collection/components/buttons/cura-button/cura-button.js +368 -306
  98. package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
  99. package/dist/collection/components/buttons/cura-button/cura-button.stories.js +184 -159
  100. package/dist/collection/components/buttons/cura-button/cura-button.stories.js.map +1 -1
  101. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.css +37 -64
  102. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +374 -306
  103. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
  104. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js +184 -159
  105. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map +1 -1
  106. package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +36 -23
  107. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +265 -260
  108. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
  109. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +32 -50
  110. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +339 -306
  111. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
  112. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js +172 -159
  113. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js.map +1 -1
  114. package/dist/collection/components/cura-alert/cura-alert.js +182 -164
  115. package/dist/collection/components/cura-alert/cura-alert.js.map +1 -1
  116. package/dist/collection/components/cura-alert/cura-alert.stories.js +90 -77
  117. package/dist/collection/components/cura-alert/cura-alert.stories.js.map +1 -1
  118. package/dist/collection/components/cura-avatar/cura-avatar.css +24 -0
  119. package/dist/collection/components/cura-avatar/cura-avatar.definitions.js +7 -0
  120. package/dist/collection/components/cura-avatar/cura-avatar.definitions.js.map +1 -0
  121. package/dist/collection/components/cura-avatar/cura-avatar.js +231 -0
  122. package/dist/collection/components/cura-avatar/cura-avatar.js.map +1 -0
  123. package/dist/collection/components/cura-avatar/cura-avatar.stories.js +198 -0
  124. package/dist/collection/components/cura-avatar/cura-avatar.stories.js.map +1 -0
  125. package/dist/collection/components/cura-calendar/cura-calendar.css +181 -0
  126. package/dist/collection/components/cura-calendar/cura-calendar.js +681 -0
  127. package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -0
  128. package/dist/collection/components/cura-calendar/cura-calendar.stories.js +126 -0
  129. package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +1 -0
  130. package/dist/collection/components/cura-card/cura-card.css +175 -0
  131. package/dist/collection/components/cura-card/cura-card.js +201 -0
  132. package/dist/collection/components/cura-card/cura-card.js.map +1 -0
  133. package/dist/collection/components/cura-card/cura-card.stories.js +127 -0
  134. package/dist/collection/components/cura-card/cura-card.stories.js.map +1 -0
  135. package/dist/collection/components/cura-icon/cura-icon.definitions.js +11 -11
  136. package/dist/collection/components/cura-icon/cura-icon.definitions.js.map +1 -1
  137. package/dist/collection/components/cura-icon/cura-icon.js +151 -151
  138. package/dist/collection/components/cura-icon/cura-icon.js.map +1 -1
  139. package/dist/collection/components/cura-icon/cura-icon.stories.js +60 -60
  140. package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -1
  141. package/dist/collection/components/cura-icons-view/cura-icons-view.js +37 -37
  142. package/dist/collection/components/cura-icons-view/cura-icons-view.js.map +1 -1
  143. package/dist/collection/components/cura-icons-view/cura-icons-view.stories.js +7 -7
  144. package/dist/collection/components/cura-icons-view/cura-icons-view.stories.js.map +1 -1
  145. package/dist/collection/components/cura-page-template/cura-page-template.js +52 -52
  146. package/dist/collection/components/cura-page-template/cura-page-template.js.map +1 -1
  147. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.css +19 -11
  148. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +457 -427
  149. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js.map +1 -1
  150. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.stories.js +170 -170
  151. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.stories.js.map +1 -1
  152. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +50 -0
  153. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +136 -0
  154. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -0
  155. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js +56 -0
  156. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +1 -0
  157. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.css +10 -0
  158. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +19 -0
  159. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js.map +1 -0
  160. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +149 -0
  161. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +384 -0
  162. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -0
  163. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +181 -0
  164. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -0
  165. package/dist/collection/components/forms/cura-forms.definitions.js +12 -12
  166. package/dist/collection/components/forms/cura-forms.definitions.js.map +1 -1
  167. package/dist/collection/components/forms/cura-input-text/cura-input-text.css +849 -139
  168. package/dist/collection/components/forms/cura-input-text/cura-input-text.js +732 -641
  169. package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
  170. package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js +217 -196
  171. package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js.map +1 -1
  172. package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js +40 -40
  173. package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js.map +1 -1
  174. package/dist/collection/components/forms/cura-label/cura-label.js +187 -187
  175. package/dist/collection/components/forms/cura-label/cura-label.js.map +1 -1
  176. package/dist/collection/components/forms/cura-label/cura-label.stories.js +108 -108
  177. package/dist/collection/components/forms/cura-label/cura-label.stories.js.map +1 -1
  178. package/dist/collection/components/forms/cura-radio/cura-radio.js +395 -363
  179. package/dist/collection/components/forms/cura-radio/cura-radio.js.map +1 -1
  180. package/dist/collection/components/forms/cura-radio/cura-radio.stories.js +150 -150
  181. package/dist/collection/components/forms/cura-radio/cura-radio.stories.js.map +1 -1
  182. package/dist/collection/components/forms/cura-select/cura-select.css +519 -0
  183. package/dist/collection/components/forms/cura-select/cura-select.js +444 -0
  184. package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -0
  185. package/dist/collection/components/forms/cura-select/cura-select.stories.js +144 -0
  186. package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -0
  187. package/dist/collection/components/forms/cura-select-options/cura-select-option.css +28 -0
  188. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +138 -0
  189. package/dist/collection/components/forms/cura-select-options/cura-select-option.js.map +1 -0
  190. package/dist/collection/components/forms/cura-switch/cura-switch.css +88 -24
  191. package/dist/collection/components/forms/cura-switch/cura-switch.js +292 -264
  192. package/dist/collection/components/forms/cura-switch/cura-switch.js.map +1 -1
  193. package/dist/collection/components/forms/cura-switch/cura-switch.stories.js +115 -115
  194. package/dist/collection/components/forms/cura-switch/cura-switch.stories.js.map +1 -1
  195. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +74 -74
  196. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js.map +1 -1
  197. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js +41 -41
  198. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js.map +1 -1
  199. package/dist/collection/components/text/cura-display/cura-display.js +174 -174
  200. package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
  201. package/dist/collection/components/text/cura-display/cura-display.stories.js +97 -97
  202. package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
  203. package/dist/collection/components/text/cura-heading/cura-heading.js +220 -220
  204. package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
  205. package/dist/collection/components/text/cura-heading/cura-heading.stories.js +117 -117
  206. package/dist/collection/components/text/cura-heading/cura-heading.stories.js.map +1 -1
  207. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +168 -168
  208. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
  209. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +98 -98
  210. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
  211. package/dist/collection/index.js +1 -1
  212. package/dist/collection/index.js.map +1 -1
  213. package/dist/collection/rededor-cura-start.js +7 -7
  214. package/dist/collection/rededor-cura-start.js.map +1 -1
  215. package/dist/collection/utils/utils.js +11 -11
  216. package/dist/collection/utils/utils.js.map +1 -1
  217. package/dist/components/cura-accordion-item.d.ts +2 -2
  218. package/dist/components/cura-accordion-item.js +62 -61
  219. package/dist/components/cura-accordion-item.js.map +1 -1
  220. package/dist/components/cura-accordion.d.ts +2 -2
  221. package/dist/components/cura-accordion.js +108 -104
  222. package/dist/components/cura-accordion.js.map +1 -1
  223. package/dist/components/cura-alert.d.ts +2 -2
  224. package/dist/components/cura-alert.js +93 -88
  225. package/dist/components/cura-alert.js.map +1 -1
  226. package/dist/components/cura-avatar.d.ts +11 -0
  227. package/dist/components/cura-avatar.js +95 -0
  228. package/dist/components/cura-avatar.js.map +1 -0
  229. package/dist/components/cura-button-outline.d.ts +2 -2
  230. package/dist/components/cura-button-outline.js +147 -109
  231. package/dist/components/cura-button-outline.js.map +1 -1
  232. package/dist/components/cura-button-select.d.ts +2 -2
  233. package/dist/components/cura-button-select.js +129 -113
  234. package/dist/components/cura-button-select.js.map +1 -1
  235. package/dist/components/cura-button-transparent.d.ts +2 -2
  236. package/dist/components/cura-button-transparent.js +1 -116
  237. package/dist/components/cura-button-transparent.js.map +1 -1
  238. package/dist/components/cura-button-transparent2.js +144 -0
  239. package/dist/components/cura-button-transparent2.js.map +1 -0
  240. package/dist/components/cura-button.d.ts +2 -2
  241. package/dist/components/cura-button.js +145 -109
  242. package/dist/components/cura-button.js.map +1 -1
  243. package/dist/components/cura-calendar.d.ts +11 -0
  244. package/dist/components/cura-calendar.js +3969 -0
  245. package/dist/components/cura-calendar.js.map +1 -0
  246. package/dist/components/cura-card.d.ts +11 -0
  247. package/dist/components/cura-card.js +75 -0
  248. package/dist/components/cura-card.js.map +1 -0
  249. package/dist/components/cura-checkbox.d.ts +2 -2
  250. package/dist/components/cura-checkbox.js +210 -174
  251. package/dist/components/cura-checkbox.js.map +1 -1
  252. package/dist/components/cura-display.d.ts +2 -2
  253. package/dist/components/cura-display.js +85 -81
  254. package/dist/components/cura-display.js.map +1 -1
  255. package/dist/components/cura-dropdown-search-option-title.d.ts +11 -0
  256. package/dist/components/cura-dropdown-search-option-title.js +42 -0
  257. package/dist/components/cura-dropdown-search-option-title.js.map +1 -0
  258. package/dist/components/cura-dropdown-search-option.d.ts +11 -0
  259. package/dist/components/cura-dropdown-search-option.js +82 -0
  260. package/dist/components/cura-dropdown-search-option.js.map +1 -0
  261. package/dist/components/cura-dropdown-search.d.ts +11 -0
  262. package/dist/components/cura-dropdown-search.js +272 -0
  263. package/dist/components/cura-dropdown-search.js.map +1 -0
  264. package/dist/components/cura-forms.definitions.js +12 -12
  265. package/dist/components/cura-forms.definitions.js.map +1 -1
  266. package/dist/components/cura-heading.d.ts +2 -2
  267. package/dist/components/cura-heading2.js +97 -93
  268. package/dist/components/cura-heading2.js.map +1 -1
  269. package/dist/components/cura-icon.d.ts +2 -2
  270. package/dist/components/cura-icon2.js +74 -69
  271. package/dist/components/cura-icon2.js.map +1 -1
  272. package/dist/components/cura-icons-view.d.ts +2 -2
  273. package/dist/components/cura-icons-view.js +57 -56
  274. package/dist/components/cura-icons-view.js.map +1 -1
  275. package/dist/components/cura-input-text.d.ts +2 -2
  276. package/dist/components/cura-input-text.js +1 -3954
  277. package/dist/components/cura-input-text.js.map +1 -1
  278. package/dist/{cjs/cura-input-text.cjs.entry.js → components/cura-input-text2.js} +393 -283
  279. package/dist/components/cura-input-text2.js.map +1 -0
  280. package/dist/components/cura-label.d.ts +2 -2
  281. package/dist/components/cura-label2.js +81 -77
  282. package/dist/components/cura-label2.js.map +1 -1
  283. package/dist/components/cura-loader-circle.d.ts +2 -2
  284. package/dist/components/cura-loader-circle2.js +41 -40
  285. package/dist/components/cura-loader-circle2.js.map +1 -1
  286. package/dist/components/cura-page-template.d.ts +2 -2
  287. package/dist/components/cura-page-template.js +36 -35
  288. package/dist/components/cura-page-template.js.map +1 -1
  289. package/dist/components/cura-paragraph.d.ts +2 -2
  290. package/dist/components/cura-paragraph2.js +79 -75
  291. package/dist/components/cura-paragraph2.js.map +1 -1
  292. package/dist/components/cura-radio.d.ts +2 -2
  293. package/dist/components/cura-radio.js +176 -139
  294. package/dist/components/cura-radio.js.map +1 -1
  295. package/dist/components/cura-select-option.d.ts +11 -0
  296. package/dist/components/cura-select-option.js +8 -0
  297. package/dist/components/cura-select-option.js.map +1 -0
  298. package/dist/components/cura-select-option2.js +87 -0
  299. package/dist/components/cura-select-option2.js.map +1 -0
  300. package/dist/components/cura-select.d.ts +11 -0
  301. package/dist/components/cura-select.js +8 -0
  302. package/dist/components/cura-select.js.map +1 -0
  303. package/dist/components/cura-select2.js +308 -0
  304. package/dist/components/cura-select2.js.map +1 -0
  305. package/dist/components/cura-switch.d.ts +2 -2
  306. package/dist/components/cura-switch.js +138 -105
  307. package/dist/components/cura-switch.js.map +1 -1
  308. package/dist/components/index.d.ts +6 -0
  309. package/dist/components/index.js +482 -466
  310. package/dist/components/index.js.map +1 -1
  311. package/dist/cura/cura.esm.js +1 -1
  312. package/dist/cura/cura.esm.js.map +1 -1
  313. package/dist/cura/index.esm.js.map +1 -1
  314. package/dist/cura/p-12d75346.entry.js +2 -0
  315. package/dist/cura/p-12d75346.entry.js.map +1 -0
  316. package/dist/cura/p-2176f253.entry.js +2 -0
  317. package/dist/cura/p-2176f253.entry.js.map +1 -0
  318. package/dist/cura/p-22292bfa.entry.js +2 -0
  319. package/dist/cura/p-22292bfa.entry.js.map +1 -0
  320. package/dist/cura/p-2a8be665.entry.js +2 -0
  321. package/dist/cura/p-2a8be665.entry.js.map +1 -0
  322. package/dist/cura/p-2d70b515.entry.js +2 -0
  323. package/dist/cura/p-2d70b515.entry.js.map +1 -0
  324. package/dist/cura/p-3c2ebc3a.entry.js +2 -0
  325. package/dist/cura/p-3c2ebc3a.entry.js.map +1 -0
  326. package/dist/cura/p-45a0a5e8.entry.js +2 -0
  327. package/dist/cura/p-45a0a5e8.entry.js.map +1 -0
  328. package/dist/cura/p-586bbe43.js +3 -0
  329. package/dist/cura/p-586bbe43.js.map +1 -0
  330. package/dist/cura/p-5d8e3ee3.entry.js +2 -0
  331. package/dist/cura/p-5d8e3ee3.entry.js.map +1 -0
  332. package/dist/cura/{p-f8fffdc1.js → p-70c369b1.js} +1 -1
  333. package/dist/cura/p-70c369b1.js.map +1 -0
  334. package/dist/cura/p-7c41f034.entry.js +2 -0
  335. package/dist/cura/p-7c41f034.entry.js.map +1 -0
  336. package/dist/cura/p-8cecf9e5.entry.js +2 -0
  337. package/dist/cura/p-8cecf9e5.entry.js.map +1 -0
  338. package/dist/cura/p-94b5c3b3.entry.js +2 -0
  339. package/dist/cura/p-94b5c3b3.entry.js.map +1 -0
  340. package/dist/cura/p-a5456007.entry.js +2 -0
  341. package/dist/cura/p-a5456007.entry.js.map +1 -0
  342. package/dist/cura/{p-c791725b.js → p-a7221f0c.js} +1 -1
  343. package/dist/{esm-es5/cura-icon.definitions-a63d1862.js.map → cura/p-a7221f0c.js.map} +1 -1
  344. package/dist/cura/p-cd757625.entry.js +2 -0
  345. package/dist/cura/p-cd757625.entry.js.map +1 -0
  346. package/dist/cura/p-de870781.entry.js +2 -0
  347. package/dist/cura/p-de870781.entry.js.map +1 -0
  348. package/dist/cura/p-e661bcca.entry.js +2 -0
  349. package/dist/cura/p-e661bcca.entry.js.map +1 -0
  350. package/dist/cura/p-ee7388a5.entry.js +2 -0
  351. package/dist/cura/p-ee7388a5.entry.js.map +1 -0
  352. package/dist/cura/{p-3688570d.js → p-f9b8f665.js} +1 -1
  353. package/dist/{esm-es5/cura-forms.definitions-0f774253.js.map → cura/p-f9b8f665.js.map} +1 -1
  354. package/dist/cura/p-fb9bece3.entry.js +2 -0
  355. package/dist/cura/p-fb9bece3.entry.js.map +1 -0
  356. package/dist/esm/app-globals-f2da2b14.js +509 -0
  357. package/dist/esm/app-globals-f2da2b14.js.map +1 -0
  358. package/dist/esm/cura-accordion_9.entry.js +532 -0
  359. package/dist/esm/cura-accordion_9.entry.js.map +1 -0
  360. package/dist/esm/cura-alert.entry.js +57 -55
  361. package/dist/esm/cura-alert.entry.js.map +1 -1
  362. package/dist/esm/cura-avatar.entry.js +64 -0
  363. package/dist/esm/cura-avatar.entry.js.map +1 -0
  364. package/dist/esm/cura-button-outline.entry.js +102 -71
  365. package/dist/esm/cura-button-outline.entry.js.map +1 -1
  366. package/dist/esm/cura-button-select.entry.js +91 -85
  367. package/dist/esm/cura-button-select.entry.js.map +1 -1
  368. package/dist/esm/{cura-input-text.entry.js → cura-button-transparent_2.entry.js} +423 -276
  369. package/dist/esm/cura-button-transparent_2.entry.js.map +1 -0
  370. package/dist/esm/cura-calendar.entry.js +3909 -0
  371. package/dist/esm/cura-calendar.entry.js.map +1 -0
  372. package/dist/esm/cura-card.entry.js +49 -0
  373. package/dist/esm/cura-card.entry.js.map +1 -0
  374. package/dist/esm/cura-checkbox.entry.js +168 -131
  375. package/dist/esm/cura-checkbox.entry.js.map +1 -1
  376. package/dist/esm/cura-display.entry.js +63 -62
  377. package/dist/esm/cura-display.entry.js.map +1 -1
  378. package/dist/esm/cura-dropdown-search-option-title.entry.js +18 -0
  379. package/dist/esm/cura-dropdown-search-option-title.entry.js.map +1 -0
  380. package/dist/esm/cura-dropdown-search-option.entry.js +51 -0
  381. package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -0
  382. package/dist/esm/cura-dropdown-search.entry.js +205 -0
  383. package/dist/esm/cura-dropdown-search.entry.js.map +1 -0
  384. package/dist/esm/cura-forms.definitions-2f963167.js +18 -0
  385. package/dist/esm/cura-forms.definitions-2f963167.js.map +1 -0
  386. package/dist/esm/cura-icon.definitions-aaa4e80f.js +18 -0
  387. package/dist/esm/cura-icon.definitions-aaa4e80f.js.map +1 -0
  388. package/dist/esm/cura-icons-view.entry.js +24 -23
  389. package/dist/esm/cura-icons-view.entry.js.map +1 -1
  390. package/dist/esm/cura-radio.entry.js +142 -103
  391. package/dist/esm/cura-radio.entry.js.map +1 -1
  392. package/dist/esm/cura-select_2.entry.js +320 -0
  393. package/dist/esm/cura-select_2.entry.js.map +1 -0
  394. package/dist/esm/cura-switch.entry.js +113 -78
  395. package/dist/esm/cura-switch.entry.js.map +1 -1
  396. package/dist/esm/cura.js +14 -23
  397. package/dist/esm/cura.js.map +1 -1
  398. package/dist/esm/index-b6c443d5.js +1500 -0
  399. package/dist/esm/index-b6c443d5.js.map +1 -0
  400. package/dist/esm/index.js +1 -1
  401. package/dist/esm/index.js.map +1 -1
  402. package/dist/esm/loader.js +8 -33
  403. package/dist/esm/loader.js.map +1 -1
  404. package/dist/index.js +1 -1
  405. package/dist/loader/cdn.js +1 -3
  406. package/dist/loader/index.cjs.js +1 -3
  407. package/dist/loader/index.d.ts +4 -1
  408. package/dist/loader/index.es2017.js +1 -3
  409. package/dist/loader/index.js +1 -3
  410. package/dist/types/api/cura-api.d.ts +3 -3
  411. package/dist/types/api/cura-api.type.d.ts +44 -44
  412. package/dist/types/api/modules/cura-theme-breakpoints-module.d.ts +3 -3
  413. package/dist/types/api/modules/cura-theme-colors-module.d.ts +46 -46
  414. package/dist/types/api/modules/cura-theme-fonts-module.d.ts +22 -22
  415. package/dist/types/api/modules/cura-theme-module.d.ts +25 -25
  416. package/dist/types/api/modules/cura-theme-spacing-module.d.ts +4 -4
  417. package/dist/types/api/theme-presets/static.d.ts +62 -62
  418. package/dist/types/api/theme-presets/theme-default.d.ts +38 -38
  419. package/dist/types/api/theme-presets/theme-legacy-default.d.ts +38 -38
  420. package/dist/types/api/theme-presets/theme-maternity.d.ts +38 -38
  421. package/dist/types/api/theme-presets/theme-oncology.d.ts +45 -45
  422. package/dist/types/api/theme-presets/theme-presets.d.ts +175 -175
  423. package/dist/types/components/accordion/cura-accordion/cura-accordion.d.ts +37 -37
  424. package/dist/types/components/accordion/cura-accordion/cura-accordion.stories.d.ts +140 -140
  425. package/dist/types/components/accordion/cura-accordion-item/cura-accordion-item.d.ts +27 -27
  426. package/dist/types/components/buttons/cura-button/cura-button.d.ts +70 -59
  427. package/dist/types/components/buttons/cura-button/cura-button.stories.d.ts +184 -155
  428. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +70 -59
  429. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.stories.d.ts +184 -155
  430. package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +48 -47
  431. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +65 -59
  432. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.stories.d.ts +169 -155
  433. package/dist/types/components/cura-alert/cura-alert.d.ts +14 -13
  434. package/dist/types/components/cura-alert/cura-alert.stories.d.ts +85 -70
  435. package/dist/types/components/cura-avatar/cura-avatar.d.ts +24 -0
  436. package/dist/types/components/cura-avatar/cura-avatar.definitions.d.ts +14 -0
  437. package/dist/types/components/cura-avatar/cura-avatar.stories.d.ts +167 -0
  438. package/dist/types/components/cura-calendar/cura-calendar.d.ts +323 -0
  439. package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +128 -0
  440. package/dist/types/components/cura-card/cura-card.d.ts +48 -0
  441. package/dist/types/components/cura-card/cura-card.stories.d.ts +98 -0
  442. package/dist/types/components/cura-icon/cura-icon.d.ts +12 -12
  443. package/dist/types/components/cura-icon/cura-icon.definitions.d.ts +44 -44
  444. package/dist/types/components/cura-icon/cura-icon.stories.d.ts +56 -56
  445. package/dist/types/components/cura-icons-view/cura-icons-view.d.ts +6 -6
  446. package/dist/types/components/cura-icons-view/cura-icons-view.stories.d.ts +3 -3
  447. package/dist/types/components/cura-page-template/cura-page-template.d.ts +6 -6
  448. package/dist/types/components/forms/cura-checkbox/cura-checkbox.d.ts +111 -95
  449. package/dist/types/components/forms/cura-checkbox/cura-checkbox.stories.d.ts +193 -193
  450. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts +27 -0
  451. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts +44 -0
  452. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.d.ts +3 -0
  453. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +103 -0
  454. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +112 -0
  455. package/dist/types/components/forms/cura-forms.definitions.d.ts +12 -12
  456. package/dist/types/components/forms/cura-input-text/cura-input-text.d.ts +169 -132
  457. package/dist/types/components/forms/cura-input-text/cura-input-text.stories.d.ts +241 -218
  458. package/dist/types/components/forms/cura-input-text/mask-presets/input-mask-presets.d.ts +1 -2
  459. package/dist/types/components/forms/cura-label/cura-label.d.ts +52 -52
  460. package/dist/types/components/forms/cura-label/cura-label.stories.d.ts +112 -112
  461. package/dist/types/components/forms/cura-radio/cura-radio.d.ts +96 -74
  462. package/dist/types/components/forms/cura-radio/cura-radio.stories.d.ts +162 -162
  463. package/dist/types/components/forms/cura-select/cura-select.d.ts +176 -0
  464. package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +156 -0
  465. package/dist/types/components/forms/cura-select-options/cura-select-option.d.ts +17 -0
  466. package/dist/types/components/forms/cura-switch/cura-switch.d.ts +78 -57
  467. package/dist/types/components/forms/cura-switch/cura-switch.stories.d.ts +121 -121
  468. package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.d.ts +21 -21
  469. package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.stories.d.ts +35 -35
  470. package/dist/types/components/text/cura-display/cura-display.d.ts +47 -47
  471. package/dist/types/components/text/cura-display/cura-display.stories.d.ts +101 -101
  472. package/dist/types/components/text/cura-heading/cura-heading.d.ts +58 -58
  473. package/dist/types/components/text/cura-heading/cura-heading.stories.d.ts +127 -127
  474. package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +47 -47
  475. package/dist/types/components/text/cura-paragraph/cura-paragraph.stories.d.ts +99 -99
  476. package/dist/types/components.d.ts +689 -13
  477. package/dist/types/index.d.ts +4 -4
  478. package/dist/types/rededor-cura-start.d.ts +4 -4
  479. package/dist/types/stencil-public-runtime.d.ts +51 -15
  480. package/package.json +5 -5
  481. package/dist/cjs/app-globals-2988084b.js +0 -511
  482. package/dist/cjs/app-globals-2988084b.js.map +0 -1
  483. package/dist/cjs/css-shim-83cf0349.js +0 -8
  484. package/dist/cjs/css-shim-83cf0349.js.map +0 -1
  485. package/dist/cjs/cura-accordion_8.cjs.entry.js +0 -445
  486. package/dist/cjs/cura-accordion_8.cjs.entry.js.map +0 -1
  487. package/dist/cjs/cura-button-transparent.cjs.entry.js +0 -83
  488. package/dist/cjs/cura-button-transparent.cjs.entry.js.map +0 -1
  489. package/dist/cjs/cura-forms.definitions-11be2ebd.js +0 -20
  490. package/dist/cjs/cura-forms.definitions-11be2ebd.js.map +0 -1
  491. package/dist/cjs/cura-icon.definitions-b73b0178.js +0 -21
  492. package/dist/cjs/cura-icon.definitions-b73b0178.js.map +0 -1
  493. package/dist/cjs/cura-input-text.cjs.entry.js.map +0 -1
  494. package/dist/cjs/cura-label.cjs.entry.js +0 -69
  495. package/dist/cjs/cura-label.cjs.entry.js.map +0 -1
  496. package/dist/cjs/index-7616f620.js +0 -2281
  497. package/dist/cjs/index-7616f620.js.map +0 -1
  498. package/dist/cjs/shadow-css-8baae635.js +0 -391
  499. package/dist/cjs/shadow-css-8baae635.js.map +0 -1
  500. package/dist/collection/utils/utils.spec.js +0 -16
  501. package/dist/collection/utils/utils.spec.js.map +0 -1
  502. package/dist/cura/cura.js +0 -133
  503. package/dist/cura/p-118112e5.system.js +0 -14
  504. package/dist/cura/p-118112e5.system.js.map +0 -1
  505. package/dist/cura/p-120926c5.system.js +0 -2
  506. package/dist/cura/p-120926c5.system.js.map +0 -1
  507. package/dist/cura/p-1228e771.entry.js +0 -2
  508. package/dist/cura/p-1228e771.entry.js.map +0 -1
  509. package/dist/cura/p-183305c3.js +0 -2
  510. package/dist/cura/p-183305c3.js.map +0 -1
  511. package/dist/cura/p-2d42ccf4.entry.js +0 -2
  512. package/dist/cura/p-2d42ccf4.entry.js.map +0 -1
  513. package/dist/cura/p-3688570d.js.map +0 -1
  514. package/dist/cura/p-36a83bc7.system.js +0 -3
  515. package/dist/cura/p-36a83bc7.system.js.map +0 -1
  516. package/dist/cura/p-3f3355f3.system.entry.js +0 -2
  517. package/dist/cura/p-3f3355f3.system.entry.js.map +0 -1
  518. package/dist/cura/p-3f5de5e2.entry.js +0 -2
  519. package/dist/cura/p-3f5de5e2.entry.js.map +0 -1
  520. package/dist/cura/p-3f6aaefc.system.js +0 -2
  521. package/dist/cura/p-3f6aaefc.system.js.map +0 -1
  522. package/dist/cura/p-48426f60.system.js +0 -2
  523. package/dist/cura/p-48426f60.system.js.map +0 -1
  524. package/dist/cura/p-4db87e8d.system.entry.js +0 -2
  525. package/dist/cura/p-4db87e8d.system.entry.js.map +0 -1
  526. package/dist/cura/p-51e00a16.entry.js +0 -2
  527. package/dist/cura/p-51e00a16.entry.js.map +0 -1
  528. package/dist/cura/p-72a9ed55.entry.js +0 -2
  529. package/dist/cura/p-72a9ed55.entry.js.map +0 -1
  530. package/dist/cura/p-75b2e4d1.system.entry.js +0 -2
  531. package/dist/cura/p-75b2e4d1.system.entry.js.map +0 -1
  532. package/dist/cura/p-880917c1.entry.js +0 -2
  533. package/dist/cura/p-880917c1.entry.js.map +0 -1
  534. package/dist/cura/p-8d959fb2.entry.js +0 -2
  535. package/dist/cura/p-8d959fb2.entry.js.map +0 -1
  536. package/dist/cura/p-9471c93e.system.entry.js +0 -2
  537. package/dist/cura/p-9471c93e.system.entry.js.map +0 -1
  538. package/dist/cura/p-98014544.entry.js +0 -2
  539. package/dist/cura/p-98014544.entry.js.map +0 -1
  540. package/dist/cura/p-98352c92.system.entry.js +0 -2
  541. package/dist/cura/p-98352c92.system.entry.js.map +0 -1
  542. package/dist/cura/p-a32889a4.system.js +0 -2
  543. package/dist/cura/p-a32889a4.system.js.map +0 -1
  544. package/dist/cura/p-ab8c9a8f.system.entry.js +0 -2
  545. package/dist/cura/p-ab8c9a8f.system.entry.js.map +0 -1
  546. package/dist/cura/p-ad194144.entry.js +0 -2
  547. package/dist/cura/p-ad194144.entry.js.map +0 -1
  548. package/dist/cura/p-b0e13882.system.entry.js +0 -2
  549. package/dist/cura/p-b0e13882.system.entry.js.map +0 -1
  550. package/dist/cura/p-ba66d7be.js +0 -3
  551. package/dist/cura/p-ba66d7be.js.map +0 -1
  552. package/dist/cura/p-bb3f9d05.entry.js +0 -2
  553. package/dist/cura/p-bb3f9d05.entry.js.map +0 -1
  554. package/dist/cura/p-beab48cd.js +0 -13
  555. package/dist/cura/p-beab48cd.js.map +0 -1
  556. package/dist/cura/p-c791725b.js.map +0 -1
  557. package/dist/cura/p-cb4e2a0c.system.entry.js +0 -2
  558. package/dist/cura/p-cb4e2a0c.system.entry.js.map +0 -1
  559. package/dist/cura/p-d3f9c888.system.js +0 -2
  560. package/dist/cura/p-d3f9c888.system.js.map +0 -1
  561. package/dist/cura/p-e5e259fd.system.entry.js +0 -2
  562. package/dist/cura/p-e5e259fd.system.entry.js.map +0 -1
  563. package/dist/cura/p-edeffbfc.entry.js +0 -2
  564. package/dist/cura/p-edeffbfc.entry.js.map +0 -1
  565. package/dist/cura/p-f51705c2.system.entry.js +0 -2
  566. package/dist/cura/p-f51705c2.system.entry.js.map +0 -1
  567. package/dist/cura/p-f89f2ecc.system.entry.js +0 -2
  568. package/dist/cura/p-f89f2ecc.system.entry.js.map +0 -1
  569. package/dist/cura/p-f8fffdc1.js.map +0 -1
  570. package/dist/cura/p-fc4ba4ce.system.js +0 -2
  571. package/dist/cura/p-fc4ba4ce.system.js.map +0 -1
  572. package/dist/cura/p-fef52079.entry.js +0 -2
  573. package/dist/cura/p-fef52079.entry.js.map +0 -1
  574. package/dist/cura/p-ffd41520.system.entry.js +0 -2
  575. package/dist/cura/p-ffd41520.system.entry.js.map +0 -1
  576. package/dist/esm/app-globals-29001758.js +0 -509
  577. package/dist/esm/app-globals-29001758.js.map +0 -1
  578. package/dist/esm/css-shim-d13f0738.js +0 -6
  579. package/dist/esm/css-shim-d13f0738.js.map +0 -1
  580. package/dist/esm/cura-accordion_8.entry.js +0 -434
  581. package/dist/esm/cura-accordion_8.entry.js.map +0 -1
  582. package/dist/esm/cura-button-transparent.entry.js +0 -79
  583. package/dist/esm/cura-button-transparent.entry.js.map +0 -1
  584. package/dist/esm/cura-forms.definitions-0f774253.js +0 -18
  585. package/dist/esm/cura-forms.definitions-0f774253.js.map +0 -1
  586. package/dist/esm/cura-icon.definitions-a63d1862.js +0 -18
  587. package/dist/esm/cura-icon.definitions-a63d1862.js.map +0 -1
  588. package/dist/esm/cura-input-text.entry.js.map +0 -1
  589. package/dist/esm/cura-label.entry.js +0 -65
  590. package/dist/esm/cura-label.entry.js.map +0 -1
  591. package/dist/esm/index-81f1a268.js +0 -2249
  592. package/dist/esm/index-81f1a268.js.map +0 -1
  593. package/dist/esm/polyfills/core-js.js +0 -11
  594. package/dist/esm/polyfills/css-shim.js +0 -1
  595. package/dist/esm/polyfills/dom.js +0 -79
  596. package/dist/esm/polyfills/es5-html-element.js +0 -1
  597. package/dist/esm/polyfills/index.js +0 -34
  598. package/dist/esm/polyfills/system.js +0 -6
  599. package/dist/esm/shadow-css-07b0c8c8.js +0 -389
  600. package/dist/esm/shadow-css-07b0c8c8.js.map +0 -1
  601. package/dist/esm-es5/app-globals-29001758.js +0 -2
  602. package/dist/esm-es5/app-globals-29001758.js.map +0 -1
  603. package/dist/esm-es5/css-shim-d13f0738.js +0 -2
  604. package/dist/esm-es5/css-shim-d13f0738.js.map +0 -1
  605. package/dist/esm-es5/cura-accordion_8.entry.js +0 -2
  606. package/dist/esm-es5/cura-accordion_8.entry.js.map +0 -1
  607. package/dist/esm-es5/cura-alert.entry.js +0 -2
  608. package/dist/esm-es5/cura-alert.entry.js.map +0 -1
  609. package/dist/esm-es5/cura-button-outline.entry.js +0 -2
  610. package/dist/esm-es5/cura-button-outline.entry.js.map +0 -1
  611. package/dist/esm-es5/cura-button-select.entry.js +0 -2
  612. package/dist/esm-es5/cura-button-select.entry.js.map +0 -1
  613. package/dist/esm-es5/cura-button-transparent.entry.js +0 -2
  614. package/dist/esm-es5/cura-button-transparent.entry.js.map +0 -1
  615. package/dist/esm-es5/cura-checkbox.entry.js +0 -2
  616. package/dist/esm-es5/cura-checkbox.entry.js.map +0 -1
  617. package/dist/esm-es5/cura-display.entry.js +0 -2
  618. package/dist/esm-es5/cura-display.entry.js.map +0 -1
  619. package/dist/esm-es5/cura-forms.definitions-0f774253.js +0 -2
  620. package/dist/esm-es5/cura-icon.definitions-a63d1862.js +0 -2
  621. package/dist/esm-es5/cura-icons-view.entry.js +0 -2
  622. package/dist/esm-es5/cura-icons-view.entry.js.map +0 -1
  623. package/dist/esm-es5/cura-input-text.entry.js +0 -2
  624. package/dist/esm-es5/cura-input-text.entry.js.map +0 -1
  625. package/dist/esm-es5/cura-label.entry.js +0 -2
  626. package/dist/esm-es5/cura-label.entry.js.map +0 -1
  627. package/dist/esm-es5/cura-radio.entry.js +0 -2
  628. package/dist/esm-es5/cura-radio.entry.js.map +0 -1
  629. package/dist/esm-es5/cura-switch.entry.js +0 -2
  630. package/dist/esm-es5/cura-switch.entry.js.map +0 -1
  631. package/dist/esm-es5/cura.js +0 -2
  632. package/dist/esm-es5/cura.js.map +0 -1
  633. package/dist/esm-es5/index-81f1a268.js +0 -3
  634. package/dist/esm-es5/index-81f1a268.js.map +0 -1
  635. package/dist/esm-es5/index.js +0 -2
  636. package/dist/esm-es5/index.js.map +0 -1
  637. package/dist/esm-es5/loader.js +0 -2
  638. package/dist/esm-es5/loader.js.map +0 -1
  639. package/dist/esm-es5/shadow-css-07b0c8c8.js +0 -13
  640. package/dist/esm-es5/shadow-css-07b0c8c8.js.map +0 -1
@@ -0,0 +1,3913 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-5b63ff7a.js');
6
+
7
+ function _typeof(o) {
8
+ "@babel/helpers - typeof";
9
+
10
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
11
+ return typeof o;
12
+ } : function (o) {
13
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
14
+ }, _typeof(o);
15
+ }
16
+
17
+ function toInteger(dirtyNumber) {
18
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
19
+ return NaN;
20
+ }
21
+ var number = Number(dirtyNumber);
22
+ if (isNaN(number)) {
23
+ return number;
24
+ }
25
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
26
+ }
27
+
28
+ function requiredArgs(required, args) {
29
+ if (args.length < required) {
30
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
31
+ }
32
+ }
33
+
34
+ /**
35
+ * @name toDate
36
+ * @category Common Helpers
37
+ * @summary Convert the given argument to an instance of Date.
38
+ *
39
+ * @description
40
+ * Convert the given argument to an instance of Date.
41
+ *
42
+ * If the argument is an instance of Date, the function returns its clone.
43
+ *
44
+ * If the argument is a number, it is treated as a timestamp.
45
+ *
46
+ * If the argument is none of the above, the function returns Invalid Date.
47
+ *
48
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
49
+ *
50
+ * @param {Date|Number} argument - the value to convert
51
+ * @returns {Date} the parsed date in the local time zone
52
+ * @throws {TypeError} 1 argument required
53
+ *
54
+ * @example
55
+ * // Clone the date:
56
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
57
+ * //=> Tue Feb 11 2014 11:30:30
58
+ *
59
+ * @example
60
+ * // Convert the timestamp to date:
61
+ * const result = toDate(1392098430000)
62
+ * //=> Tue Feb 11 2014 11:30:30
63
+ */
64
+ function toDate(argument) {
65
+ requiredArgs(1, arguments);
66
+ var argStr = Object.prototype.toString.call(argument);
67
+
68
+ // Clone the date
69
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
70
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
71
+ return new Date(argument.getTime());
72
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
73
+ return new Date(argument);
74
+ } else {
75
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
76
+ // eslint-disable-next-line no-console
77
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
78
+ // eslint-disable-next-line no-console
79
+ console.warn(new Error().stack);
80
+ }
81
+ return new Date(NaN);
82
+ }
83
+ }
84
+
85
+ /**
86
+ * @name addDays
87
+ * @category Day Helpers
88
+ * @summary Add the specified number of days to the given date.
89
+ *
90
+ * @description
91
+ * Add the specified number of days to the given date.
92
+ *
93
+ * @param {Date|Number} date - the date to be changed
94
+ * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
95
+ * @returns {Date} - the new date with the days added
96
+ * @throws {TypeError} - 2 arguments required
97
+ *
98
+ * @example
99
+ * // Add 10 days to 1 September 2014:
100
+ * const result = addDays(new Date(2014, 8, 1), 10)
101
+ * //=> Thu Sep 11 2014 00:00:00
102
+ */
103
+ function addDays(dirtyDate, dirtyAmount) {
104
+ requiredArgs(2, arguments);
105
+ var date = toDate(dirtyDate);
106
+ var amount = toInteger(dirtyAmount);
107
+ if (isNaN(amount)) {
108
+ return new Date(NaN);
109
+ }
110
+ if (!amount) {
111
+ // If 0 days, no-op to avoid changing times in the hour before end of DST
112
+ return date;
113
+ }
114
+ date.setDate(date.getDate() + amount);
115
+ return date;
116
+ }
117
+
118
+ /**
119
+ * @name addMonths
120
+ * @category Month Helpers
121
+ * @summary Add the specified number of months to the given date.
122
+ *
123
+ * @description
124
+ * Add the specified number of months to the given date.
125
+ *
126
+ * @param {Date|Number} date - the date to be changed
127
+ * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
128
+ * @returns {Date} the new date with the months added
129
+ * @throws {TypeError} 2 arguments required
130
+ *
131
+ * @example
132
+ * // Add 5 months to 1 September 2014:
133
+ * const result = addMonths(new Date(2014, 8, 1), 5)
134
+ * //=> Sun Feb 01 2015 00:00:00
135
+ */
136
+ function addMonths(dirtyDate, dirtyAmount) {
137
+ requiredArgs(2, arguments);
138
+ var date = toDate(dirtyDate);
139
+ var amount = toInteger(dirtyAmount);
140
+ if (isNaN(amount)) {
141
+ return new Date(NaN);
142
+ }
143
+ if (!amount) {
144
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
145
+ return date;
146
+ }
147
+ var dayOfMonth = date.getDate();
148
+
149
+ // The JS Date object supports date math by accepting out-of-bounds values for
150
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
151
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
152
+ // want except that dates will wrap around the end of a month, meaning that
153
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
154
+ // we'll default to the end of the desired month by adding 1 to the desired
155
+ // month and using a date of 0 to back up one day to the end of the desired
156
+ // month.
157
+ var endOfDesiredMonth = new Date(date.getTime());
158
+ endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
159
+ var daysInMonth = endOfDesiredMonth.getDate();
160
+ if (dayOfMonth >= daysInMonth) {
161
+ // If we're already at the end of the month, then this is the correct date
162
+ // and we're done.
163
+ return endOfDesiredMonth;
164
+ } else {
165
+ // Otherwise, we now know that setting the original day-of-month value won't
166
+ // cause an overflow, so set the desired day-of-month. Note that we can't
167
+ // just set the date of `endOfDesiredMonth` because that object may have had
168
+ // its time changed in the unusual case where where a DST transition was on
169
+ // the last day of the month and its local time was in the hour skipped or
170
+ // repeated next to a DST transition. So we use `date` instead which is
171
+ // guaranteed to still have the original time.
172
+ date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
173
+ return date;
174
+ }
175
+ }
176
+
177
+ /**
178
+ * @name addMilliseconds
179
+ * @category Millisecond Helpers
180
+ * @summary Add the specified number of milliseconds to the given date.
181
+ *
182
+ * @description
183
+ * Add the specified number of milliseconds to the given date.
184
+ *
185
+ * @param {Date|Number} date - the date to be changed
186
+ * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
187
+ * @returns {Date} the new date with the milliseconds added
188
+ * @throws {TypeError} 2 arguments required
189
+ *
190
+ * @example
191
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
192
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
193
+ * //=> Thu Jul 10 2014 12:45:30.750
194
+ */
195
+ function addMilliseconds(dirtyDate, dirtyAmount) {
196
+ requiredArgs(2, arguments);
197
+ var timestamp = toDate(dirtyDate).getTime();
198
+ var amount = toInteger(dirtyAmount);
199
+ return new Date(timestamp + amount);
200
+ }
201
+
202
+ var defaultOptions = {};
203
+ function getDefaultOptions() {
204
+ return defaultOptions;
205
+ }
206
+
207
+ /**
208
+ * @name startOfWeek
209
+ * @category Week Helpers
210
+ * @summary Return the start of a week for the given date.
211
+ *
212
+ * @description
213
+ * Return the start of a week for the given date.
214
+ * The result will be in the local timezone.
215
+ *
216
+ * @param {Date|Number} date - the original date
217
+ * @param {Object} [options] - an object with options.
218
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
219
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
220
+ * @returns {Date} the start of a week
221
+ * @throws {TypeError} 1 argument required
222
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
223
+ *
224
+ * @example
225
+ * // The start of a week for 2 September 2014 11:55:00:
226
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
227
+ * //=> Sun Aug 31 2014 00:00:00
228
+ *
229
+ * @example
230
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
231
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
232
+ * //=> Mon Sep 01 2014 00:00:00
233
+ */
234
+ function startOfWeek(dirtyDate, options) {
235
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
236
+ requiredArgs(1, arguments);
237
+ var defaultOptions = getDefaultOptions();
238
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
239
+
240
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
241
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
242
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
243
+ }
244
+ var date = toDate(dirtyDate);
245
+ var day = date.getDay();
246
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
247
+ date.setDate(date.getDate() - diff);
248
+ date.setHours(0, 0, 0, 0);
249
+ return date;
250
+ }
251
+
252
+ /**
253
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
254
+ * They usually appear for dates that denote time before the timezones were introduced
255
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
256
+ * and GMT+01:00:00 after that date)
257
+ *
258
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
259
+ * which would lead to incorrect calculations.
260
+ *
261
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
262
+ */
263
+ function getTimezoneOffsetInMilliseconds(date) {
264
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
265
+ utcDate.setUTCFullYear(date.getFullYear());
266
+ return date.getTime() - utcDate.getTime();
267
+ }
268
+
269
+ /**
270
+ * @name startOfDay
271
+ * @category Day Helpers
272
+ * @summary Return the start of a day for the given date.
273
+ *
274
+ * @description
275
+ * Return the start of a day for the given date.
276
+ * The result will be in the local timezone.
277
+ *
278
+ * @param {Date|Number} date - the original date
279
+ * @returns {Date} the start of a day
280
+ * @throws {TypeError} 1 argument required
281
+ *
282
+ * @example
283
+ * // The start of a day for 2 September 2014 11:55:00:
284
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
285
+ * //=> Tue Sep 02 2014 00:00:00
286
+ */
287
+ function startOfDay(dirtyDate) {
288
+ requiredArgs(1, arguments);
289
+ var date = toDate(dirtyDate);
290
+ date.setHours(0, 0, 0, 0);
291
+ return date;
292
+ }
293
+
294
+ /**
295
+ * Days in 1 week.
296
+ *
297
+ * @name daysInWeek
298
+ * @constant
299
+ * @type {number}
300
+ * @default
301
+ */
302
+
303
+ /**
304
+ * Milliseconds in 1 minute
305
+ *
306
+ * @name millisecondsInMinute
307
+ * @constant
308
+ * @type {number}
309
+ * @default
310
+ */
311
+ var millisecondsInMinute = 60000;
312
+
313
+ /**
314
+ * Milliseconds in 1 hour
315
+ *
316
+ * @name millisecondsInHour
317
+ * @constant
318
+ * @type {number}
319
+ * @default
320
+ */
321
+ var millisecondsInHour = 3600000;
322
+
323
+ /**
324
+ * @name isSameDay
325
+ * @category Day Helpers
326
+ * @summary Are the given dates in the same day (and year and month)?
327
+ *
328
+ * @description
329
+ * Are the given dates in the same day (and year and month)?
330
+ *
331
+ * @param {Date|Number} dateLeft - the first date to check
332
+ * @param {Date|Number} dateRight - the second date to check
333
+ * @returns {Boolean} the dates are in the same day (and year and month)
334
+ * @throws {TypeError} 2 arguments required
335
+ *
336
+ * @example
337
+ * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
338
+ * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
339
+ * //=> true
340
+ *
341
+ * @example
342
+ * // Are 4 September and 4 October in the same day?
343
+ * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
344
+ * //=> false
345
+ *
346
+ * @example
347
+ * // Are 4 September, 2014 and 4 September, 2015 in the same day?
348
+ * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
349
+ * //=> false
350
+ */
351
+ function isSameDay(dirtyDateLeft, dirtyDateRight) {
352
+ requiredArgs(2, arguments);
353
+ var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
354
+ var dateRightStartOfDay = startOfDay(dirtyDateRight);
355
+ return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
356
+ }
357
+
358
+ /**
359
+ * @name isDate
360
+ * @category Common Helpers
361
+ * @summary Is the given value a date?
362
+ *
363
+ * @description
364
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
365
+ *
366
+ * @param {*} value - the value to check
367
+ * @returns {boolean} true if the given value is a date
368
+ * @throws {TypeError} 1 arguments required
369
+ *
370
+ * @example
371
+ * // For a valid date:
372
+ * const result = isDate(new Date())
373
+ * //=> true
374
+ *
375
+ * @example
376
+ * // For an invalid date:
377
+ * const result = isDate(new Date(NaN))
378
+ * //=> true
379
+ *
380
+ * @example
381
+ * // For some value:
382
+ * const result = isDate('2014-02-31')
383
+ * //=> false
384
+ *
385
+ * @example
386
+ * // For an object:
387
+ * const result = isDate({})
388
+ * //=> false
389
+ */
390
+ function isDate(value) {
391
+ requiredArgs(1, arguments);
392
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
393
+ }
394
+
395
+ /**
396
+ * @name isValid
397
+ * @category Common Helpers
398
+ * @summary Is the given date valid?
399
+ *
400
+ * @description
401
+ * Returns false if argument is Invalid Date and true otherwise.
402
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
403
+ * Invalid Date is a Date, whose time value is NaN.
404
+ *
405
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
406
+ *
407
+ * @param {*} date - the date to check
408
+ * @returns {Boolean} the date is valid
409
+ * @throws {TypeError} 1 argument required
410
+ *
411
+ * @example
412
+ * // For the valid date:
413
+ * const result = isValid(new Date(2014, 1, 31))
414
+ * //=> true
415
+ *
416
+ * @example
417
+ * // For the value, convertable into a date:
418
+ * const result = isValid(1393804800000)
419
+ * //=> true
420
+ *
421
+ * @example
422
+ * // For the invalid date:
423
+ * const result = isValid(new Date(''))
424
+ * //=> false
425
+ */
426
+ function isValid(dirtyDate) {
427
+ requiredArgs(1, arguments);
428
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
429
+ return false;
430
+ }
431
+ var date = toDate(dirtyDate);
432
+ return !isNaN(Number(date));
433
+ }
434
+
435
+ /**
436
+ * @name endOfMonth
437
+ * @category Month Helpers
438
+ * @summary Return the end of a month for the given date.
439
+ *
440
+ * @description
441
+ * Return the end of a month for the given date.
442
+ * The result will be in the local timezone.
443
+ *
444
+ * @param {Date|Number} date - the original date
445
+ * @returns {Date} the end of a month
446
+ * @throws {TypeError} 1 argument required
447
+ *
448
+ * @example
449
+ * // The end of a month for 2 September 2014 11:55:00:
450
+ * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
451
+ * //=> Tue Sep 30 2014 23:59:59.999
452
+ */
453
+ function endOfMonth(dirtyDate) {
454
+ requiredArgs(1, arguments);
455
+ var date = toDate(dirtyDate);
456
+ var month = date.getMonth();
457
+ date.setFullYear(date.getFullYear(), month + 1, 0);
458
+ date.setHours(23, 59, 59, 999);
459
+ return date;
460
+ }
461
+
462
+ /**
463
+ * @name eachDayOfInterval
464
+ * @category Interval Helpers
465
+ * @summary Return the array of dates within the specified time interval.
466
+ *
467
+ * @description
468
+ * Return the array of dates within the specified time interval.
469
+ *
470
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
471
+ * @param {Object} [options] - an object with options.
472
+ * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1.
473
+ * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end
474
+ * @throws {TypeError} 1 argument required
475
+ * @throws {RangeError} `options.step` must be a number greater than 1
476
+ * @throws {RangeError} The start of an interval cannot be after its end
477
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
478
+ *
479
+ * @example
480
+ * // Each day between 6 October 2014 and 10 October 2014:
481
+ * const result = eachDayOfInterval({
482
+ * start: new Date(2014, 9, 6),
483
+ * end: new Date(2014, 9, 10)
484
+ * })
485
+ * //=> [
486
+ * // Mon Oct 06 2014 00:00:00,
487
+ * // Tue Oct 07 2014 00:00:00,
488
+ * // Wed Oct 08 2014 00:00:00,
489
+ * // Thu Oct 09 2014 00:00:00,
490
+ * // Fri Oct 10 2014 00:00:00
491
+ * // ]
492
+ */
493
+ function eachDayOfInterval(dirtyInterval, options) {
494
+ var _options$step;
495
+ requiredArgs(1, arguments);
496
+ var interval = dirtyInterval || {};
497
+ var startDate = toDate(interval.start);
498
+ var endDate = toDate(interval.end);
499
+ var endTime = endDate.getTime();
500
+
501
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
502
+ if (!(startDate.getTime() <= endTime)) {
503
+ throw new RangeError('Invalid interval');
504
+ }
505
+ var dates = [];
506
+ var currentDate = startDate;
507
+ currentDate.setHours(0, 0, 0, 0);
508
+ var step = Number((_options$step = options === null || options === void 0 ? void 0 : options.step) !== null && _options$step !== void 0 ? _options$step : 1);
509
+ if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1');
510
+ while (currentDate.getTime() <= endTime) {
511
+ dates.push(toDate(currentDate));
512
+ currentDate.setDate(currentDate.getDate() + step);
513
+ currentDate.setHours(0, 0, 0, 0);
514
+ }
515
+ return dates;
516
+ }
517
+
518
+ /**
519
+ * @name eachMonthOfInterval
520
+ * @category Interval Helpers
521
+ * @summary Return the array of months within the specified time interval.
522
+ *
523
+ * @description
524
+ * Return the array of months within the specified time interval.
525
+ *
526
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
527
+ * @returns {Date[]} the array with starts of months from the month of the interval start to the month of the interval end
528
+ * @throws {TypeError} 1 argument required
529
+ * @throws {RangeError} The start of an interval cannot be after its end
530
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
531
+ *
532
+ * @example
533
+ * // Each month between 6 February 2014 and 10 August 2014:
534
+ * const result = eachMonthOfInterval({
535
+ * start: new Date(2014, 1, 6),
536
+ * end: new Date(2014, 7, 10)
537
+ * })
538
+ * //=> [
539
+ * // Sat Feb 01 2014 00:00:00,
540
+ * // Sat Mar 01 2014 00:00:00,
541
+ * // Tue Apr 01 2014 00:00:00,
542
+ * // Thu May 01 2014 00:00:00,
543
+ * // Sun Jun 01 2014 00:00:00,
544
+ * // Tue Jul 01 2014 00:00:00,
545
+ * // Fri Aug 01 2014 00:00:00
546
+ * // ]
547
+ */
548
+ function eachMonthOfInterval(dirtyInterval) {
549
+ requiredArgs(1, arguments);
550
+ var interval = dirtyInterval || {};
551
+ var startDate = toDate(interval.start);
552
+ var endDate = toDate(interval.end);
553
+ var endTime = endDate.getTime();
554
+ var dates = [];
555
+
556
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
557
+ if (!(startDate.getTime() <= endTime)) {
558
+ throw new RangeError('Invalid interval');
559
+ }
560
+ var currentDate = startDate;
561
+ currentDate.setHours(0, 0, 0, 0);
562
+ currentDate.setDate(1);
563
+ while (currentDate.getTime() <= endTime) {
564
+ dates.push(toDate(currentDate));
565
+ currentDate.setMonth(currentDate.getMonth() + 1);
566
+ }
567
+ return dates;
568
+ }
569
+
570
+ /**
571
+ * @name startOfMonth
572
+ * @category Month Helpers
573
+ * @summary Return the start of a month for the given date.
574
+ *
575
+ * @description
576
+ * Return the start of a month for the given date.
577
+ * The result will be in the local timezone.
578
+ *
579
+ * @param {Date|Number} date - the original date
580
+ * @returns {Date} the start of a month
581
+ * @throws {TypeError} 1 argument required
582
+ *
583
+ * @example
584
+ * // The start of a month for 2 September 2014 11:55:00:
585
+ * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
586
+ * //=> Mon Sep 01 2014 00:00:00
587
+ */
588
+ function startOfMonth(dirtyDate) {
589
+ requiredArgs(1, arguments);
590
+ var date = toDate(dirtyDate);
591
+ date.setDate(1);
592
+ date.setHours(0, 0, 0, 0);
593
+ return date;
594
+ }
595
+
596
+ /**
597
+ * @name startOfYear
598
+ * @category Year Helpers
599
+ * @summary Return the start of a year for the given date.
600
+ *
601
+ * @description
602
+ * Return the start of a year for the given date.
603
+ * The result will be in the local timezone.
604
+ *
605
+ * @param {Date|Number} date - the original date
606
+ * @returns {Date} the start of a year
607
+ * @throws {TypeError} 1 argument required
608
+ *
609
+ * @example
610
+ * // The start of a year for 2 September 2014 11:55:00:
611
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
612
+ * //=> Wed Jan 01 2014 00:00:00
613
+ */
614
+ function startOfYear(dirtyDate) {
615
+ requiredArgs(1, arguments);
616
+ var cleanDate = toDate(dirtyDate);
617
+ var date = new Date(0);
618
+ date.setFullYear(cleanDate.getFullYear(), 0, 1);
619
+ date.setHours(0, 0, 0, 0);
620
+ return date;
621
+ }
622
+
623
+ /**
624
+ * @name endOfWeek
625
+ * @category Week Helpers
626
+ * @summary Return the end of a week for the given date.
627
+ *
628
+ * @description
629
+ * Return the end of a week for the given date.
630
+ * The result will be in the local timezone.
631
+ *
632
+ * @param {Date|Number} date - the original date
633
+ * @param {Object} [options] - an object with options.
634
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
635
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
636
+ * @returns {Date} the end of a week
637
+ * @throws {TypeError} 1 argument required
638
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
639
+ *
640
+ * @example
641
+ * // The end of a week for 2 September 2014 11:55:00:
642
+ * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
643
+ * //=> Sat Sep 06 2014 23:59:59.999
644
+ *
645
+ * @example
646
+ * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
647
+ * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
648
+ * //=> Sun Sep 07 2014 23:59:59.999
649
+ */
650
+ function endOfWeek(dirtyDate, options) {
651
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
652
+ requiredArgs(1, arguments);
653
+ var defaultOptions = getDefaultOptions();
654
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
655
+
656
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
657
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
658
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
659
+ }
660
+ var date = toDate(dirtyDate);
661
+ var day = date.getDay();
662
+ var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
663
+ date.setDate(date.getDate() + diff);
664
+ date.setHours(23, 59, 59, 999);
665
+ return date;
666
+ }
667
+
668
+ /**
669
+ * @name subMilliseconds
670
+ * @category Millisecond Helpers
671
+ * @summary Subtract the specified number of milliseconds from the given date.
672
+ *
673
+ * @description
674
+ * Subtract the specified number of milliseconds from the given date.
675
+ *
676
+ * @param {Date|Number} date - the date to be changed
677
+ * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
678
+ * @returns {Date} the new date with the milliseconds subtracted
679
+ * @throws {TypeError} 2 arguments required
680
+ *
681
+ * @example
682
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
683
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
684
+ * //=> Thu Jul 10 2014 12:45:29.250
685
+ */
686
+ function subMilliseconds(dirtyDate, dirtyAmount) {
687
+ requiredArgs(2, arguments);
688
+ var amount = toInteger(dirtyAmount);
689
+ return addMilliseconds(dirtyDate, -amount);
690
+ }
691
+
692
+ var MILLISECONDS_IN_DAY = 86400000;
693
+ function getUTCDayOfYear(dirtyDate) {
694
+ requiredArgs(1, arguments);
695
+ var date = toDate(dirtyDate);
696
+ var timestamp = date.getTime();
697
+ date.setUTCMonth(0, 1);
698
+ date.setUTCHours(0, 0, 0, 0);
699
+ var startOfYearTimestamp = date.getTime();
700
+ var difference = timestamp - startOfYearTimestamp;
701
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
702
+ }
703
+
704
+ function startOfUTCISOWeek(dirtyDate) {
705
+ requiredArgs(1, arguments);
706
+ var weekStartsOn = 1;
707
+ var date = toDate(dirtyDate);
708
+ var day = date.getUTCDay();
709
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
710
+ date.setUTCDate(date.getUTCDate() - diff);
711
+ date.setUTCHours(0, 0, 0, 0);
712
+ return date;
713
+ }
714
+
715
+ function getUTCISOWeekYear(dirtyDate) {
716
+ requiredArgs(1, arguments);
717
+ var date = toDate(dirtyDate);
718
+ var year = date.getUTCFullYear();
719
+ var fourthOfJanuaryOfNextYear = new Date(0);
720
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
721
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
722
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
723
+ var fourthOfJanuaryOfThisYear = new Date(0);
724
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
725
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
726
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
727
+ if (date.getTime() >= startOfNextYear.getTime()) {
728
+ return year + 1;
729
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
730
+ return year;
731
+ } else {
732
+ return year - 1;
733
+ }
734
+ }
735
+
736
+ function startOfUTCISOWeekYear(dirtyDate) {
737
+ requiredArgs(1, arguments);
738
+ var year = getUTCISOWeekYear(dirtyDate);
739
+ var fourthOfJanuary = new Date(0);
740
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
741
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
742
+ var date = startOfUTCISOWeek(fourthOfJanuary);
743
+ return date;
744
+ }
745
+
746
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
747
+ function getUTCISOWeek(dirtyDate) {
748
+ requiredArgs(1, arguments);
749
+ var date = toDate(dirtyDate);
750
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
751
+
752
+ // Round the number of days to the nearest integer
753
+ // because the number of milliseconds in a week is not constant
754
+ // (e.g. it's different in the week of the daylight saving time clock shift)
755
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
756
+ }
757
+
758
+ function startOfUTCWeek(dirtyDate, options) {
759
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
760
+ requiredArgs(1, arguments);
761
+ var defaultOptions = getDefaultOptions();
762
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
763
+
764
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
765
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
766
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
767
+ }
768
+ var date = toDate(dirtyDate);
769
+ var day = date.getUTCDay();
770
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
771
+ date.setUTCDate(date.getUTCDate() - diff);
772
+ date.setUTCHours(0, 0, 0, 0);
773
+ return date;
774
+ }
775
+
776
+ function getUTCWeekYear(dirtyDate, options) {
777
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
778
+ requiredArgs(1, arguments);
779
+ var date = toDate(dirtyDate);
780
+ var year = date.getUTCFullYear();
781
+ var defaultOptions = getDefaultOptions();
782
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
783
+
784
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
785
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
786
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
787
+ }
788
+ var firstWeekOfNextYear = new Date(0);
789
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
790
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
791
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
792
+ var firstWeekOfThisYear = new Date(0);
793
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
794
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
795
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
796
+ if (date.getTime() >= startOfNextYear.getTime()) {
797
+ return year + 1;
798
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
799
+ return year;
800
+ } else {
801
+ return year - 1;
802
+ }
803
+ }
804
+
805
+ function startOfUTCWeekYear(dirtyDate, options) {
806
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
807
+ requiredArgs(1, arguments);
808
+ var defaultOptions = getDefaultOptions();
809
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
810
+ var year = getUTCWeekYear(dirtyDate, options);
811
+ var firstWeek = new Date(0);
812
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
813
+ firstWeek.setUTCHours(0, 0, 0, 0);
814
+ var date = startOfUTCWeek(firstWeek, options);
815
+ return date;
816
+ }
817
+
818
+ var MILLISECONDS_IN_WEEK = 604800000;
819
+ function getUTCWeek(dirtyDate, options) {
820
+ requiredArgs(1, arguments);
821
+ var date = toDate(dirtyDate);
822
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
823
+
824
+ // Round the number of days to the nearest integer
825
+ // because the number of milliseconds in a week is not constant
826
+ // (e.g. it's different in the week of the daylight saving time clock shift)
827
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
828
+ }
829
+
830
+ function addLeadingZeros(number, targetLength) {
831
+ var sign = number < 0 ? '-' : '';
832
+ var output = Math.abs(number).toString();
833
+ while (output.length < targetLength) {
834
+ output = '0' + output;
835
+ }
836
+ return sign + output;
837
+ }
838
+
839
+ /*
840
+ * | | Unit | | Unit |
841
+ * |-----|--------------------------------|-----|--------------------------------|
842
+ * | a | AM, PM | A* | |
843
+ * | d | Day of month | D | |
844
+ * | h | Hour [1-12] | H | Hour [0-23] |
845
+ * | m | Minute | M | Month |
846
+ * | s | Second | S | Fraction of second |
847
+ * | y | Year (abs) | Y | |
848
+ *
849
+ * Letters marked by * are not implemented but reserved by Unicode standard.
850
+ */
851
+ var formatters$2 = {
852
+ // Year
853
+ y: function y(date, token) {
854
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
855
+ // | Year | y | yy | yyy | yyyy | yyyyy |
856
+ // |----------|-------|----|-------|-------|-------|
857
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
858
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
859
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
860
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
861
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
862
+
863
+ var signedYear = date.getUTCFullYear();
864
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
865
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
866
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
867
+ },
868
+ // Month
869
+ M: function M(date, token) {
870
+ var month = date.getUTCMonth();
871
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
872
+ },
873
+ // Day of the month
874
+ d: function d(date, token) {
875
+ return addLeadingZeros(date.getUTCDate(), token.length);
876
+ },
877
+ // AM or PM
878
+ a: function a(date, token) {
879
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
880
+ switch (token) {
881
+ case 'a':
882
+ case 'aa':
883
+ return dayPeriodEnumValue.toUpperCase();
884
+ case 'aaa':
885
+ return dayPeriodEnumValue;
886
+ case 'aaaaa':
887
+ return dayPeriodEnumValue[0];
888
+ case 'aaaa':
889
+ default:
890
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
891
+ }
892
+ },
893
+ // Hour [1-12]
894
+ h: function h(date, token) {
895
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
896
+ },
897
+ // Hour [0-23]
898
+ H: function H(date, token) {
899
+ return addLeadingZeros(date.getUTCHours(), token.length);
900
+ },
901
+ // Minute
902
+ m: function m(date, token) {
903
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
904
+ },
905
+ // Second
906
+ s: function s(date, token) {
907
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
908
+ },
909
+ // Fraction of second
910
+ S: function S(date, token) {
911
+ var numberOfDigits = token.length;
912
+ var milliseconds = date.getUTCMilliseconds();
913
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
914
+ return addLeadingZeros(fractionalSeconds, token.length);
915
+ }
916
+ };
917
+ const formatters$3 = formatters$2;
918
+
919
+ var dayPeriodEnum = {
920
+ am: 'am',
921
+ pm: 'pm',
922
+ midnight: 'midnight',
923
+ noon: 'noon',
924
+ morning: 'morning',
925
+ afternoon: 'afternoon',
926
+ evening: 'evening',
927
+ night: 'night'
928
+ };
929
+ /*
930
+ * | | Unit | | Unit |
931
+ * |-----|--------------------------------|-----|--------------------------------|
932
+ * | a | AM, PM | A* | Milliseconds in day |
933
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
934
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
935
+ * | d | Day of month | D | Day of year |
936
+ * | e | Local day of week | E | Day of week |
937
+ * | f | | F* | Day of week in month |
938
+ * | g* | Modified Julian day | G | Era |
939
+ * | h | Hour [1-12] | H | Hour [0-23] |
940
+ * | i! | ISO day of week | I! | ISO week of year |
941
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
942
+ * | k | Hour [1-24] | K | Hour [0-11] |
943
+ * | l* | (deprecated) | L | Stand-alone month |
944
+ * | m | Minute | M | Month |
945
+ * | n | | N | |
946
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
947
+ * | p! | Long localized time | P! | Long localized date |
948
+ * | q | Stand-alone quarter | Q | Quarter |
949
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
950
+ * | s | Second | S | Fraction of second |
951
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
952
+ * | u | Extended year | U* | Cyclic year |
953
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
954
+ * | w | Local week of year | W* | Week of month |
955
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
956
+ * | y | Year (abs) | Y | Local week-numbering year |
957
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
958
+ *
959
+ * Letters marked by * are not implemented but reserved by Unicode standard.
960
+ *
961
+ * Letters marked by ! are non-standard, but implemented by date-fns:
962
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
963
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
964
+ * i.e. 7 for Sunday, 1 for Monday, etc.
965
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
966
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
967
+ * `R` is supposed to be used in conjunction with `I` and `i`
968
+ * for universal ISO week-numbering date, whereas
969
+ * `Y` is supposed to be used in conjunction with `w` and `e`
970
+ * for week-numbering date specific to the locale.
971
+ * - `P` is long localized date format
972
+ * - `p` is long localized time format
973
+ */
974
+
975
+ var formatters = {
976
+ // Era
977
+ G: function G(date, token, localize) {
978
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
979
+ switch (token) {
980
+ // AD, BC
981
+ case 'G':
982
+ case 'GG':
983
+ case 'GGG':
984
+ return localize.era(era, {
985
+ width: 'abbreviated'
986
+ });
987
+ // A, B
988
+ case 'GGGGG':
989
+ return localize.era(era, {
990
+ width: 'narrow'
991
+ });
992
+ // Anno Domini, Before Christ
993
+ case 'GGGG':
994
+ default:
995
+ return localize.era(era, {
996
+ width: 'wide'
997
+ });
998
+ }
999
+ },
1000
+ // Year
1001
+ y: function y(date, token, localize) {
1002
+ // Ordinal number
1003
+ if (token === 'yo') {
1004
+ var signedYear = date.getUTCFullYear();
1005
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1006
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
1007
+ return localize.ordinalNumber(year, {
1008
+ unit: 'year'
1009
+ });
1010
+ }
1011
+ return formatters$3.y(date, token);
1012
+ },
1013
+ // Local week-numbering year
1014
+ Y: function Y(date, token, localize, options) {
1015
+ var signedWeekYear = getUTCWeekYear(date, options);
1016
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1017
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1018
+
1019
+ // Two digit year
1020
+ if (token === 'YY') {
1021
+ var twoDigitYear = weekYear % 100;
1022
+ return addLeadingZeros(twoDigitYear, 2);
1023
+ }
1024
+
1025
+ // Ordinal number
1026
+ if (token === 'Yo') {
1027
+ return localize.ordinalNumber(weekYear, {
1028
+ unit: 'year'
1029
+ });
1030
+ }
1031
+
1032
+ // Padding
1033
+ return addLeadingZeros(weekYear, token.length);
1034
+ },
1035
+ // ISO week-numbering year
1036
+ R: function R(date, token) {
1037
+ var isoWeekYear = getUTCISOWeekYear(date);
1038
+
1039
+ // Padding
1040
+ return addLeadingZeros(isoWeekYear, token.length);
1041
+ },
1042
+ // Extended year. This is a single number designating the year of this calendar system.
1043
+ // The main difference between `y` and `u` localizers are B.C. years:
1044
+ // | Year | `y` | `u` |
1045
+ // |------|-----|-----|
1046
+ // | AC 1 | 1 | 1 |
1047
+ // | BC 1 | 1 | 0 |
1048
+ // | BC 2 | 2 | -1 |
1049
+ // Also `yy` always returns the last two digits of a year,
1050
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1051
+ u: function u(date, token) {
1052
+ var year = date.getUTCFullYear();
1053
+ return addLeadingZeros(year, token.length);
1054
+ },
1055
+ // Quarter
1056
+ Q: function Q(date, token, localize) {
1057
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1058
+ switch (token) {
1059
+ // 1, 2, 3, 4
1060
+ case 'Q':
1061
+ return String(quarter);
1062
+ // 01, 02, 03, 04
1063
+ case 'QQ':
1064
+ return addLeadingZeros(quarter, 2);
1065
+ // 1st, 2nd, 3rd, 4th
1066
+ case 'Qo':
1067
+ return localize.ordinalNumber(quarter, {
1068
+ unit: 'quarter'
1069
+ });
1070
+ // Q1, Q2, Q3, Q4
1071
+ case 'QQQ':
1072
+ return localize.quarter(quarter, {
1073
+ width: 'abbreviated',
1074
+ context: 'formatting'
1075
+ });
1076
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1077
+ case 'QQQQQ':
1078
+ return localize.quarter(quarter, {
1079
+ width: 'narrow',
1080
+ context: 'formatting'
1081
+ });
1082
+ // 1st quarter, 2nd quarter, ...
1083
+ case 'QQQQ':
1084
+ default:
1085
+ return localize.quarter(quarter, {
1086
+ width: 'wide',
1087
+ context: 'formatting'
1088
+ });
1089
+ }
1090
+ },
1091
+ // Stand-alone quarter
1092
+ q: function q(date, token, localize) {
1093
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1094
+ switch (token) {
1095
+ // 1, 2, 3, 4
1096
+ case 'q':
1097
+ return String(quarter);
1098
+ // 01, 02, 03, 04
1099
+ case 'qq':
1100
+ return addLeadingZeros(quarter, 2);
1101
+ // 1st, 2nd, 3rd, 4th
1102
+ case 'qo':
1103
+ return localize.ordinalNumber(quarter, {
1104
+ unit: 'quarter'
1105
+ });
1106
+ // Q1, Q2, Q3, Q4
1107
+ case 'qqq':
1108
+ return localize.quarter(quarter, {
1109
+ width: 'abbreviated',
1110
+ context: 'standalone'
1111
+ });
1112
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1113
+ case 'qqqqq':
1114
+ return localize.quarter(quarter, {
1115
+ width: 'narrow',
1116
+ context: 'standalone'
1117
+ });
1118
+ // 1st quarter, 2nd quarter, ...
1119
+ case 'qqqq':
1120
+ default:
1121
+ return localize.quarter(quarter, {
1122
+ width: 'wide',
1123
+ context: 'standalone'
1124
+ });
1125
+ }
1126
+ },
1127
+ // Month
1128
+ M: function M(date, token, localize) {
1129
+ var month = date.getUTCMonth();
1130
+ switch (token) {
1131
+ case 'M':
1132
+ case 'MM':
1133
+ return formatters$3.M(date, token);
1134
+ // 1st, 2nd, ..., 12th
1135
+ case 'Mo':
1136
+ return localize.ordinalNumber(month + 1, {
1137
+ unit: 'month'
1138
+ });
1139
+ // Jan, Feb, ..., Dec
1140
+ case 'MMM':
1141
+ return localize.month(month, {
1142
+ width: 'abbreviated',
1143
+ context: 'formatting'
1144
+ });
1145
+ // J, F, ..., D
1146
+ case 'MMMMM':
1147
+ return localize.month(month, {
1148
+ width: 'narrow',
1149
+ context: 'formatting'
1150
+ });
1151
+ // January, February, ..., December
1152
+ case 'MMMM':
1153
+ default:
1154
+ return localize.month(month, {
1155
+ width: 'wide',
1156
+ context: 'formatting'
1157
+ });
1158
+ }
1159
+ },
1160
+ // Stand-alone month
1161
+ L: function L(date, token, localize) {
1162
+ var month = date.getUTCMonth();
1163
+ switch (token) {
1164
+ // 1, 2, ..., 12
1165
+ case 'L':
1166
+ return String(month + 1);
1167
+ // 01, 02, ..., 12
1168
+ case 'LL':
1169
+ return addLeadingZeros(month + 1, 2);
1170
+ // 1st, 2nd, ..., 12th
1171
+ case 'Lo':
1172
+ return localize.ordinalNumber(month + 1, {
1173
+ unit: 'month'
1174
+ });
1175
+ // Jan, Feb, ..., Dec
1176
+ case 'LLL':
1177
+ return localize.month(month, {
1178
+ width: 'abbreviated',
1179
+ context: 'standalone'
1180
+ });
1181
+ // J, F, ..., D
1182
+ case 'LLLLL':
1183
+ return localize.month(month, {
1184
+ width: 'narrow',
1185
+ context: 'standalone'
1186
+ });
1187
+ // January, February, ..., December
1188
+ case 'LLLL':
1189
+ default:
1190
+ return localize.month(month, {
1191
+ width: 'wide',
1192
+ context: 'standalone'
1193
+ });
1194
+ }
1195
+ },
1196
+ // Local week of year
1197
+ w: function w(date, token, localize, options) {
1198
+ var week = getUTCWeek(date, options);
1199
+ if (token === 'wo') {
1200
+ return localize.ordinalNumber(week, {
1201
+ unit: 'week'
1202
+ });
1203
+ }
1204
+ return addLeadingZeros(week, token.length);
1205
+ },
1206
+ // ISO week of year
1207
+ I: function I(date, token, localize) {
1208
+ var isoWeek = getUTCISOWeek(date);
1209
+ if (token === 'Io') {
1210
+ return localize.ordinalNumber(isoWeek, {
1211
+ unit: 'week'
1212
+ });
1213
+ }
1214
+ return addLeadingZeros(isoWeek, token.length);
1215
+ },
1216
+ // Day of the month
1217
+ d: function d(date, token, localize) {
1218
+ if (token === 'do') {
1219
+ return localize.ordinalNumber(date.getUTCDate(), {
1220
+ unit: 'date'
1221
+ });
1222
+ }
1223
+ return formatters$3.d(date, token);
1224
+ },
1225
+ // Day of year
1226
+ D: function D(date, token, localize) {
1227
+ var dayOfYear = getUTCDayOfYear(date);
1228
+ if (token === 'Do') {
1229
+ return localize.ordinalNumber(dayOfYear, {
1230
+ unit: 'dayOfYear'
1231
+ });
1232
+ }
1233
+ return addLeadingZeros(dayOfYear, token.length);
1234
+ },
1235
+ // Day of week
1236
+ E: function E(date, token, localize) {
1237
+ var dayOfWeek = date.getUTCDay();
1238
+ switch (token) {
1239
+ // Tue
1240
+ case 'E':
1241
+ case 'EE':
1242
+ case 'EEE':
1243
+ return localize.day(dayOfWeek, {
1244
+ width: 'abbreviated',
1245
+ context: 'formatting'
1246
+ });
1247
+ // T
1248
+ case 'EEEEE':
1249
+ return localize.day(dayOfWeek, {
1250
+ width: 'narrow',
1251
+ context: 'formatting'
1252
+ });
1253
+ // Tu
1254
+ case 'EEEEEE':
1255
+ return localize.day(dayOfWeek, {
1256
+ width: 'short',
1257
+ context: 'formatting'
1258
+ });
1259
+ // Tuesday
1260
+ case 'EEEE':
1261
+ default:
1262
+ return localize.day(dayOfWeek, {
1263
+ width: 'wide',
1264
+ context: 'formatting'
1265
+ });
1266
+ }
1267
+ },
1268
+ // Local day of week
1269
+ e: function e(date, token, localize, options) {
1270
+ var dayOfWeek = date.getUTCDay();
1271
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1272
+ switch (token) {
1273
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1274
+ case 'e':
1275
+ return String(localDayOfWeek);
1276
+ // Padded numerical value
1277
+ case 'ee':
1278
+ return addLeadingZeros(localDayOfWeek, 2);
1279
+ // 1st, 2nd, ..., 7th
1280
+ case 'eo':
1281
+ return localize.ordinalNumber(localDayOfWeek, {
1282
+ unit: 'day'
1283
+ });
1284
+ case 'eee':
1285
+ return localize.day(dayOfWeek, {
1286
+ width: 'abbreviated',
1287
+ context: 'formatting'
1288
+ });
1289
+ // T
1290
+ case 'eeeee':
1291
+ return localize.day(dayOfWeek, {
1292
+ width: 'narrow',
1293
+ context: 'formatting'
1294
+ });
1295
+ // Tu
1296
+ case 'eeeeee':
1297
+ return localize.day(dayOfWeek, {
1298
+ width: 'short',
1299
+ context: 'formatting'
1300
+ });
1301
+ // Tuesday
1302
+ case 'eeee':
1303
+ default:
1304
+ return localize.day(dayOfWeek, {
1305
+ width: 'wide',
1306
+ context: 'formatting'
1307
+ });
1308
+ }
1309
+ },
1310
+ // Stand-alone local day of week
1311
+ c: function c(date, token, localize, options) {
1312
+ var dayOfWeek = date.getUTCDay();
1313
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1314
+ switch (token) {
1315
+ // Numerical value (same as in `e`)
1316
+ case 'c':
1317
+ return String(localDayOfWeek);
1318
+ // Padded numerical value
1319
+ case 'cc':
1320
+ return addLeadingZeros(localDayOfWeek, token.length);
1321
+ // 1st, 2nd, ..., 7th
1322
+ case 'co':
1323
+ return localize.ordinalNumber(localDayOfWeek, {
1324
+ unit: 'day'
1325
+ });
1326
+ case 'ccc':
1327
+ return localize.day(dayOfWeek, {
1328
+ width: 'abbreviated',
1329
+ context: 'standalone'
1330
+ });
1331
+ // T
1332
+ case 'ccccc':
1333
+ return localize.day(dayOfWeek, {
1334
+ width: 'narrow',
1335
+ context: 'standalone'
1336
+ });
1337
+ // Tu
1338
+ case 'cccccc':
1339
+ return localize.day(dayOfWeek, {
1340
+ width: 'short',
1341
+ context: 'standalone'
1342
+ });
1343
+ // Tuesday
1344
+ case 'cccc':
1345
+ default:
1346
+ return localize.day(dayOfWeek, {
1347
+ width: 'wide',
1348
+ context: 'standalone'
1349
+ });
1350
+ }
1351
+ },
1352
+ // ISO day of week
1353
+ i: function i(date, token, localize) {
1354
+ var dayOfWeek = date.getUTCDay();
1355
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1356
+ switch (token) {
1357
+ // 2
1358
+ case 'i':
1359
+ return String(isoDayOfWeek);
1360
+ // 02
1361
+ case 'ii':
1362
+ return addLeadingZeros(isoDayOfWeek, token.length);
1363
+ // 2nd
1364
+ case 'io':
1365
+ return localize.ordinalNumber(isoDayOfWeek, {
1366
+ unit: 'day'
1367
+ });
1368
+ // Tue
1369
+ case 'iii':
1370
+ return localize.day(dayOfWeek, {
1371
+ width: 'abbreviated',
1372
+ context: 'formatting'
1373
+ });
1374
+ // T
1375
+ case 'iiiii':
1376
+ return localize.day(dayOfWeek, {
1377
+ width: 'narrow',
1378
+ context: 'formatting'
1379
+ });
1380
+ // Tu
1381
+ case 'iiiiii':
1382
+ return localize.day(dayOfWeek, {
1383
+ width: 'short',
1384
+ context: 'formatting'
1385
+ });
1386
+ // Tuesday
1387
+ case 'iiii':
1388
+ default:
1389
+ return localize.day(dayOfWeek, {
1390
+ width: 'wide',
1391
+ context: 'formatting'
1392
+ });
1393
+ }
1394
+ },
1395
+ // AM or PM
1396
+ a: function a(date, token, localize) {
1397
+ var hours = date.getUTCHours();
1398
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1399
+ switch (token) {
1400
+ case 'a':
1401
+ case 'aa':
1402
+ return localize.dayPeriod(dayPeriodEnumValue, {
1403
+ width: 'abbreviated',
1404
+ context: 'formatting'
1405
+ });
1406
+ case 'aaa':
1407
+ return localize.dayPeriod(dayPeriodEnumValue, {
1408
+ width: 'abbreviated',
1409
+ context: 'formatting'
1410
+ }).toLowerCase();
1411
+ case 'aaaaa':
1412
+ return localize.dayPeriod(dayPeriodEnumValue, {
1413
+ width: 'narrow',
1414
+ context: 'formatting'
1415
+ });
1416
+ case 'aaaa':
1417
+ default:
1418
+ return localize.dayPeriod(dayPeriodEnumValue, {
1419
+ width: 'wide',
1420
+ context: 'formatting'
1421
+ });
1422
+ }
1423
+ },
1424
+ // AM, PM, midnight, noon
1425
+ b: function b(date, token, localize) {
1426
+ var hours = date.getUTCHours();
1427
+ var dayPeriodEnumValue;
1428
+ if (hours === 12) {
1429
+ dayPeriodEnumValue = dayPeriodEnum.noon;
1430
+ } else if (hours === 0) {
1431
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
1432
+ } else {
1433
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1434
+ }
1435
+ switch (token) {
1436
+ case 'b':
1437
+ case 'bb':
1438
+ return localize.dayPeriod(dayPeriodEnumValue, {
1439
+ width: 'abbreviated',
1440
+ context: 'formatting'
1441
+ });
1442
+ case 'bbb':
1443
+ return localize.dayPeriod(dayPeriodEnumValue, {
1444
+ width: 'abbreviated',
1445
+ context: 'formatting'
1446
+ }).toLowerCase();
1447
+ case 'bbbbb':
1448
+ return localize.dayPeriod(dayPeriodEnumValue, {
1449
+ width: 'narrow',
1450
+ context: 'formatting'
1451
+ });
1452
+ case 'bbbb':
1453
+ default:
1454
+ return localize.dayPeriod(dayPeriodEnumValue, {
1455
+ width: 'wide',
1456
+ context: 'formatting'
1457
+ });
1458
+ }
1459
+ },
1460
+ // in the morning, in the afternoon, in the evening, at night
1461
+ B: function B(date, token, localize) {
1462
+ var hours = date.getUTCHours();
1463
+ var dayPeriodEnumValue;
1464
+ if (hours >= 17) {
1465
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1466
+ } else if (hours >= 12) {
1467
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1468
+ } else if (hours >= 4) {
1469
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1470
+ } else {
1471
+ dayPeriodEnumValue = dayPeriodEnum.night;
1472
+ }
1473
+ switch (token) {
1474
+ case 'B':
1475
+ case 'BB':
1476
+ case 'BBB':
1477
+ return localize.dayPeriod(dayPeriodEnumValue, {
1478
+ width: 'abbreviated',
1479
+ context: 'formatting'
1480
+ });
1481
+ case 'BBBBB':
1482
+ return localize.dayPeriod(dayPeriodEnumValue, {
1483
+ width: 'narrow',
1484
+ context: 'formatting'
1485
+ });
1486
+ case 'BBBB':
1487
+ default:
1488
+ return localize.dayPeriod(dayPeriodEnumValue, {
1489
+ width: 'wide',
1490
+ context: 'formatting'
1491
+ });
1492
+ }
1493
+ },
1494
+ // Hour [1-12]
1495
+ h: function h(date, token, localize) {
1496
+ if (token === 'ho') {
1497
+ var hours = date.getUTCHours() % 12;
1498
+ if (hours === 0) hours = 12;
1499
+ return localize.ordinalNumber(hours, {
1500
+ unit: 'hour'
1501
+ });
1502
+ }
1503
+ return formatters$3.h(date, token);
1504
+ },
1505
+ // Hour [0-23]
1506
+ H: function H(date, token, localize) {
1507
+ if (token === 'Ho') {
1508
+ return localize.ordinalNumber(date.getUTCHours(), {
1509
+ unit: 'hour'
1510
+ });
1511
+ }
1512
+ return formatters$3.H(date, token);
1513
+ },
1514
+ // Hour [0-11]
1515
+ K: function K(date, token, localize) {
1516
+ var hours = date.getUTCHours() % 12;
1517
+ if (token === 'Ko') {
1518
+ return localize.ordinalNumber(hours, {
1519
+ unit: 'hour'
1520
+ });
1521
+ }
1522
+ return addLeadingZeros(hours, token.length);
1523
+ },
1524
+ // Hour [1-24]
1525
+ k: function k(date, token, localize) {
1526
+ var hours = date.getUTCHours();
1527
+ if (hours === 0) hours = 24;
1528
+ if (token === 'ko') {
1529
+ return localize.ordinalNumber(hours, {
1530
+ unit: 'hour'
1531
+ });
1532
+ }
1533
+ return addLeadingZeros(hours, token.length);
1534
+ },
1535
+ // Minute
1536
+ m: function m(date, token, localize) {
1537
+ if (token === 'mo') {
1538
+ return localize.ordinalNumber(date.getUTCMinutes(), {
1539
+ unit: 'minute'
1540
+ });
1541
+ }
1542
+ return formatters$3.m(date, token);
1543
+ },
1544
+ // Second
1545
+ s: function s(date, token, localize) {
1546
+ if (token === 'so') {
1547
+ return localize.ordinalNumber(date.getUTCSeconds(), {
1548
+ unit: 'second'
1549
+ });
1550
+ }
1551
+ return formatters$3.s(date, token);
1552
+ },
1553
+ // Fraction of second
1554
+ S: function S(date, token) {
1555
+ return formatters$3.S(date, token);
1556
+ },
1557
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1558
+ X: function X(date, token, _localize, options) {
1559
+ var originalDate = options._originalDate || date;
1560
+ var timezoneOffset = originalDate.getTimezoneOffset();
1561
+ if (timezoneOffset === 0) {
1562
+ return 'Z';
1563
+ }
1564
+ switch (token) {
1565
+ // Hours and optional minutes
1566
+ case 'X':
1567
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1568
+
1569
+ // Hours, minutes and optional seconds without `:` delimiter
1570
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1571
+ // so this token always has the same output as `XX`
1572
+ case 'XXXX':
1573
+ case 'XX':
1574
+ // Hours and minutes without `:` delimiter
1575
+ return formatTimezone(timezoneOffset);
1576
+
1577
+ // Hours, minutes and optional seconds with `:` delimiter
1578
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1579
+ // so this token always has the same output as `XXX`
1580
+ case 'XXXXX':
1581
+ case 'XXX': // Hours and minutes with `:` delimiter
1582
+ default:
1583
+ return formatTimezone(timezoneOffset, ':');
1584
+ }
1585
+ },
1586
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1587
+ x: function x(date, token, _localize, options) {
1588
+ var originalDate = options._originalDate || date;
1589
+ var timezoneOffset = originalDate.getTimezoneOffset();
1590
+ switch (token) {
1591
+ // Hours and optional minutes
1592
+ case 'x':
1593
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1594
+
1595
+ // Hours, minutes and optional seconds without `:` delimiter
1596
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1597
+ // so this token always has the same output as `xx`
1598
+ case 'xxxx':
1599
+ case 'xx':
1600
+ // Hours and minutes without `:` delimiter
1601
+ return formatTimezone(timezoneOffset);
1602
+
1603
+ // Hours, minutes and optional seconds with `:` delimiter
1604
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1605
+ // so this token always has the same output as `xxx`
1606
+ case 'xxxxx':
1607
+ case 'xxx': // Hours and minutes with `:` delimiter
1608
+ default:
1609
+ return formatTimezone(timezoneOffset, ':');
1610
+ }
1611
+ },
1612
+ // Timezone (GMT)
1613
+ O: function O(date, token, _localize, options) {
1614
+ var originalDate = options._originalDate || date;
1615
+ var timezoneOffset = originalDate.getTimezoneOffset();
1616
+ switch (token) {
1617
+ // Short
1618
+ case 'O':
1619
+ case 'OO':
1620
+ case 'OOO':
1621
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1622
+ // Long
1623
+ case 'OOOO':
1624
+ default:
1625
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1626
+ }
1627
+ },
1628
+ // Timezone (specific non-location)
1629
+ z: function z(date, token, _localize, options) {
1630
+ var originalDate = options._originalDate || date;
1631
+ var timezoneOffset = originalDate.getTimezoneOffset();
1632
+ switch (token) {
1633
+ // Short
1634
+ case 'z':
1635
+ case 'zz':
1636
+ case 'zzz':
1637
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1638
+ // Long
1639
+ case 'zzzz':
1640
+ default:
1641
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1642
+ }
1643
+ },
1644
+ // Seconds timestamp
1645
+ t: function t(date, token, _localize, options) {
1646
+ var originalDate = options._originalDate || date;
1647
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
1648
+ return addLeadingZeros(timestamp, token.length);
1649
+ },
1650
+ // Milliseconds timestamp
1651
+ T: function T(date, token, _localize, options) {
1652
+ var originalDate = options._originalDate || date;
1653
+ var timestamp = originalDate.getTime();
1654
+ return addLeadingZeros(timestamp, token.length);
1655
+ }
1656
+ };
1657
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1658
+ var sign = offset > 0 ? '-' : '+';
1659
+ var absOffset = Math.abs(offset);
1660
+ var hours = Math.floor(absOffset / 60);
1661
+ var minutes = absOffset % 60;
1662
+ if (minutes === 0) {
1663
+ return sign + String(hours);
1664
+ }
1665
+ var delimiter = dirtyDelimiter || '';
1666
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1667
+ }
1668
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1669
+ if (offset % 60 === 0) {
1670
+ var sign = offset > 0 ? '-' : '+';
1671
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1672
+ }
1673
+ return formatTimezone(offset, dirtyDelimiter);
1674
+ }
1675
+ function formatTimezone(offset, dirtyDelimiter) {
1676
+ var delimiter = dirtyDelimiter || '';
1677
+ var sign = offset > 0 ? '-' : '+';
1678
+ var absOffset = Math.abs(offset);
1679
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1680
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1681
+ return sign + hours + delimiter + minutes;
1682
+ }
1683
+ const formatters$1 = formatters;
1684
+
1685
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1686
+ switch (pattern) {
1687
+ case 'P':
1688
+ return formatLong.date({
1689
+ width: 'short'
1690
+ });
1691
+ case 'PP':
1692
+ return formatLong.date({
1693
+ width: 'medium'
1694
+ });
1695
+ case 'PPP':
1696
+ return formatLong.date({
1697
+ width: 'long'
1698
+ });
1699
+ case 'PPPP':
1700
+ default:
1701
+ return formatLong.date({
1702
+ width: 'full'
1703
+ });
1704
+ }
1705
+ };
1706
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1707
+ switch (pattern) {
1708
+ case 'p':
1709
+ return formatLong.time({
1710
+ width: 'short'
1711
+ });
1712
+ case 'pp':
1713
+ return formatLong.time({
1714
+ width: 'medium'
1715
+ });
1716
+ case 'ppp':
1717
+ return formatLong.time({
1718
+ width: 'long'
1719
+ });
1720
+ case 'pppp':
1721
+ default:
1722
+ return formatLong.time({
1723
+ width: 'full'
1724
+ });
1725
+ }
1726
+ };
1727
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1728
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1729
+ var datePattern = matchResult[1];
1730
+ var timePattern = matchResult[2];
1731
+ if (!timePattern) {
1732
+ return dateLongFormatter(pattern, formatLong);
1733
+ }
1734
+ var dateTimeFormat;
1735
+ switch (datePattern) {
1736
+ case 'P':
1737
+ dateTimeFormat = formatLong.dateTime({
1738
+ width: 'short'
1739
+ });
1740
+ break;
1741
+ case 'PP':
1742
+ dateTimeFormat = formatLong.dateTime({
1743
+ width: 'medium'
1744
+ });
1745
+ break;
1746
+ case 'PPP':
1747
+ dateTimeFormat = formatLong.dateTime({
1748
+ width: 'long'
1749
+ });
1750
+ break;
1751
+ case 'PPPP':
1752
+ default:
1753
+ dateTimeFormat = formatLong.dateTime({
1754
+ width: 'full'
1755
+ });
1756
+ break;
1757
+ }
1758
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1759
+ };
1760
+ var longFormatters = {
1761
+ p: timeLongFormatter,
1762
+ P: dateTimeLongFormatter
1763
+ };
1764
+ const longFormatters$1 = longFormatters;
1765
+
1766
+ var protectedDayOfYearTokens = ['D', 'DD'];
1767
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1768
+ function isProtectedDayOfYearToken(token) {
1769
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1770
+ }
1771
+ function isProtectedWeekYearToken(token) {
1772
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1773
+ }
1774
+ function throwProtectedError(token, format, input) {
1775
+ if (token === 'YYYY') {
1776
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1777
+ } else if (token === 'YY') {
1778
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1779
+ } else if (token === 'D') {
1780
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1781
+ } else if (token === 'DD') {
1782
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1783
+ }
1784
+ }
1785
+
1786
+ var formatDistanceLocale$1 = {
1787
+ lessThanXSeconds: {
1788
+ one: 'less than a second',
1789
+ other: 'less than {{count}} seconds'
1790
+ },
1791
+ xSeconds: {
1792
+ one: '1 second',
1793
+ other: '{{count}} seconds'
1794
+ },
1795
+ halfAMinute: 'half a minute',
1796
+ lessThanXMinutes: {
1797
+ one: 'less than a minute',
1798
+ other: 'less than {{count}} minutes'
1799
+ },
1800
+ xMinutes: {
1801
+ one: '1 minute',
1802
+ other: '{{count}} minutes'
1803
+ },
1804
+ aboutXHours: {
1805
+ one: 'about 1 hour',
1806
+ other: 'about {{count}} hours'
1807
+ },
1808
+ xHours: {
1809
+ one: '1 hour',
1810
+ other: '{{count}} hours'
1811
+ },
1812
+ xDays: {
1813
+ one: '1 day',
1814
+ other: '{{count}} days'
1815
+ },
1816
+ aboutXWeeks: {
1817
+ one: 'about 1 week',
1818
+ other: 'about {{count}} weeks'
1819
+ },
1820
+ xWeeks: {
1821
+ one: '1 week',
1822
+ other: '{{count}} weeks'
1823
+ },
1824
+ aboutXMonths: {
1825
+ one: 'about 1 month',
1826
+ other: 'about {{count}} months'
1827
+ },
1828
+ xMonths: {
1829
+ one: '1 month',
1830
+ other: '{{count}} months'
1831
+ },
1832
+ aboutXYears: {
1833
+ one: 'about 1 year',
1834
+ other: 'about {{count}} years'
1835
+ },
1836
+ xYears: {
1837
+ one: '1 year',
1838
+ other: '{{count}} years'
1839
+ },
1840
+ overXYears: {
1841
+ one: 'over 1 year',
1842
+ other: 'over {{count}} years'
1843
+ },
1844
+ almostXYears: {
1845
+ one: 'almost 1 year',
1846
+ other: 'almost {{count}} years'
1847
+ }
1848
+ };
1849
+ var formatDistance$2 = function formatDistance(token, count, options) {
1850
+ var result;
1851
+ var tokenValue = formatDistanceLocale$1[token];
1852
+ if (typeof tokenValue === 'string') {
1853
+ result = tokenValue;
1854
+ } else if (count === 1) {
1855
+ result = tokenValue.one;
1856
+ } else {
1857
+ result = tokenValue.other.replace('{{count}}', count.toString());
1858
+ }
1859
+ if (options !== null && options !== void 0 && options.addSuffix) {
1860
+ if (options.comparison && options.comparison > 0) {
1861
+ return 'in ' + result;
1862
+ } else {
1863
+ return result + ' ago';
1864
+ }
1865
+ }
1866
+ return result;
1867
+ };
1868
+ const formatDistance$3 = formatDistance$2;
1869
+
1870
+ function buildFormatLongFn(args) {
1871
+ return function () {
1872
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1873
+ // TODO: Remove String()
1874
+ var width = options.width ? String(options.width) : args.defaultWidth;
1875
+ var format = args.formats[width] || args.formats[args.defaultWidth];
1876
+ return format;
1877
+ };
1878
+ }
1879
+
1880
+ var dateFormats$2 = {
1881
+ full: 'EEEE, MMMM do, y',
1882
+ long: 'MMMM do, y',
1883
+ medium: 'MMM d, y',
1884
+ short: 'MM/dd/yyyy'
1885
+ };
1886
+ var timeFormats$2 = {
1887
+ full: 'h:mm:ss a zzzz',
1888
+ long: 'h:mm:ss a z',
1889
+ medium: 'h:mm:ss a',
1890
+ short: 'h:mm a'
1891
+ };
1892
+ var dateTimeFormats$2 = {
1893
+ full: "{{date}} 'at' {{time}}",
1894
+ long: "{{date}} 'at' {{time}}",
1895
+ medium: '{{date}}, {{time}}',
1896
+ short: '{{date}}, {{time}}'
1897
+ };
1898
+ var formatLong$4 = {
1899
+ date: buildFormatLongFn({
1900
+ formats: dateFormats$2,
1901
+ defaultWidth: 'full'
1902
+ }),
1903
+ time: buildFormatLongFn({
1904
+ formats: timeFormats$2,
1905
+ defaultWidth: 'full'
1906
+ }),
1907
+ dateTime: buildFormatLongFn({
1908
+ formats: dateTimeFormats$2,
1909
+ defaultWidth: 'full'
1910
+ })
1911
+ };
1912
+ const formatLong$5 = formatLong$4;
1913
+
1914
+ var formatRelativeLocale$1 = {
1915
+ lastWeek: "'last' eeee 'at' p",
1916
+ yesterday: "'yesterday at' p",
1917
+ today: "'today at' p",
1918
+ tomorrow: "'tomorrow at' p",
1919
+ nextWeek: "eeee 'at' p",
1920
+ other: 'P'
1921
+ };
1922
+ var formatRelative$2 = function formatRelative(token, _date, _baseDate, _options) {
1923
+ return formatRelativeLocale$1[token];
1924
+ };
1925
+ const formatRelative$3 = formatRelative$2;
1926
+
1927
+ function buildLocalizeFn(args) {
1928
+ return function (dirtyIndex, options) {
1929
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1930
+ var valuesArray;
1931
+ if (context === 'formatting' && args.formattingValues) {
1932
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1933
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1934
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1935
+ } else {
1936
+ var _defaultWidth = args.defaultWidth;
1937
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1938
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
1939
+ }
1940
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1941
+ // @ts-ignore: 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!
1942
+ return valuesArray[index];
1943
+ };
1944
+ }
1945
+
1946
+ var eraValues$1 = {
1947
+ narrow: ['B', 'A'],
1948
+ abbreviated: ['BC', 'AD'],
1949
+ wide: ['Before Christ', 'Anno Domini']
1950
+ };
1951
+ var quarterValues$1 = {
1952
+ narrow: ['1', '2', '3', '4'],
1953
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1954
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1955
+ };
1956
+
1957
+ // Note: in English, the names of days of the week and months are capitalized.
1958
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1959
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1960
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1961
+ var monthValues$1 = {
1962
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1963
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1964
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1965
+ };
1966
+ var dayValues$1 = {
1967
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1968
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1969
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1970
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1971
+ };
1972
+ var dayPeriodValues$1 = {
1973
+ narrow: {
1974
+ am: 'a',
1975
+ pm: 'p',
1976
+ midnight: 'mi',
1977
+ noon: 'n',
1978
+ morning: 'morning',
1979
+ afternoon: 'afternoon',
1980
+ evening: 'evening',
1981
+ night: 'night'
1982
+ },
1983
+ abbreviated: {
1984
+ am: 'AM',
1985
+ pm: 'PM',
1986
+ midnight: 'midnight',
1987
+ noon: 'noon',
1988
+ morning: 'morning',
1989
+ afternoon: 'afternoon',
1990
+ evening: 'evening',
1991
+ night: 'night'
1992
+ },
1993
+ wide: {
1994
+ am: 'a.m.',
1995
+ pm: 'p.m.',
1996
+ midnight: 'midnight',
1997
+ noon: 'noon',
1998
+ morning: 'morning',
1999
+ afternoon: 'afternoon',
2000
+ evening: 'evening',
2001
+ night: 'night'
2002
+ }
2003
+ };
2004
+ var formattingDayPeriodValues$1 = {
2005
+ narrow: {
2006
+ am: 'a',
2007
+ pm: 'p',
2008
+ midnight: 'mi',
2009
+ noon: 'n',
2010
+ morning: 'in the morning',
2011
+ afternoon: 'in the afternoon',
2012
+ evening: 'in the evening',
2013
+ night: 'at night'
2014
+ },
2015
+ abbreviated: {
2016
+ am: 'AM',
2017
+ pm: 'PM',
2018
+ midnight: 'midnight',
2019
+ noon: 'noon',
2020
+ morning: 'in the morning',
2021
+ afternoon: 'in the afternoon',
2022
+ evening: 'in the evening',
2023
+ night: 'at night'
2024
+ },
2025
+ wide: {
2026
+ am: 'a.m.',
2027
+ pm: 'p.m.',
2028
+ midnight: 'midnight',
2029
+ noon: 'noon',
2030
+ morning: 'in the morning',
2031
+ afternoon: 'in the afternoon',
2032
+ evening: 'in the evening',
2033
+ night: 'at night'
2034
+ }
2035
+ };
2036
+ var ordinalNumber$1 = function ordinalNumber(dirtyNumber, _options) {
2037
+ var number = Number(dirtyNumber);
2038
+
2039
+ // If ordinal numbers depend on context, for example,
2040
+ // if they are different for different grammatical genders,
2041
+ // use `options.unit`.
2042
+ //
2043
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
2044
+ // 'day', 'hour', 'minute', 'second'.
2045
+
2046
+ var rem100 = number % 100;
2047
+ if (rem100 > 20 || rem100 < 10) {
2048
+ switch (rem100 % 10) {
2049
+ case 1:
2050
+ return number + 'st';
2051
+ case 2:
2052
+ return number + 'nd';
2053
+ case 3:
2054
+ return number + 'rd';
2055
+ }
2056
+ }
2057
+ return number + 'th';
2058
+ };
2059
+ var localize$2 = {
2060
+ ordinalNumber: ordinalNumber$1,
2061
+ era: buildLocalizeFn({
2062
+ values: eraValues$1,
2063
+ defaultWidth: 'wide'
2064
+ }),
2065
+ quarter: buildLocalizeFn({
2066
+ values: quarterValues$1,
2067
+ defaultWidth: 'wide',
2068
+ argumentCallback: function argumentCallback(quarter) {
2069
+ return quarter - 1;
2070
+ }
2071
+ }),
2072
+ month: buildLocalizeFn({
2073
+ values: monthValues$1,
2074
+ defaultWidth: 'wide'
2075
+ }),
2076
+ day: buildLocalizeFn({
2077
+ values: dayValues$1,
2078
+ defaultWidth: 'wide'
2079
+ }),
2080
+ dayPeriod: buildLocalizeFn({
2081
+ values: dayPeriodValues$1,
2082
+ defaultWidth: 'wide',
2083
+ formattingValues: formattingDayPeriodValues$1,
2084
+ defaultFormattingWidth: 'wide'
2085
+ })
2086
+ };
2087
+ const localize$3 = localize$2;
2088
+
2089
+ function buildMatchFn(args) {
2090
+ return function (string) {
2091
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2092
+ var width = options.width;
2093
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
2094
+ var matchResult = string.match(matchPattern);
2095
+ if (!matchResult) {
2096
+ return null;
2097
+ }
2098
+ var matchedString = matchResult[0];
2099
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
2100
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
2101
+ return pattern.test(matchedString);
2102
+ }) : findKey(parsePatterns, function (pattern) {
2103
+ return pattern.test(matchedString);
2104
+ });
2105
+ var value;
2106
+ value = args.valueCallback ? args.valueCallback(key) : key;
2107
+ value = options.valueCallback ? options.valueCallback(value) : value;
2108
+ var rest = string.slice(matchedString.length);
2109
+ return {
2110
+ value: value,
2111
+ rest: rest
2112
+ };
2113
+ };
2114
+ }
2115
+ function findKey(object, predicate) {
2116
+ for (var key in object) {
2117
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
2118
+ return key;
2119
+ }
2120
+ }
2121
+ return undefined;
2122
+ }
2123
+ function findIndex(array, predicate) {
2124
+ for (var key = 0; key < array.length; key++) {
2125
+ if (predicate(array[key])) {
2126
+ return key;
2127
+ }
2128
+ }
2129
+ return undefined;
2130
+ }
2131
+
2132
+ function buildMatchPatternFn(args) {
2133
+ return function (string) {
2134
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2135
+ var matchResult = string.match(args.matchPattern);
2136
+ if (!matchResult) return null;
2137
+ var matchedString = matchResult[0];
2138
+ var parseResult = string.match(args.parsePattern);
2139
+ if (!parseResult) return null;
2140
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
2141
+ value = options.valueCallback ? options.valueCallback(value) : value;
2142
+ var rest = string.slice(matchedString.length);
2143
+ return {
2144
+ value: value,
2145
+ rest: rest
2146
+ };
2147
+ };
2148
+ }
2149
+
2150
+ var matchOrdinalNumberPattern$1 = /^(\d+)(th|st|nd|rd)?/i;
2151
+ var parseOrdinalNumberPattern$1 = /\d+/i;
2152
+ var matchEraPatterns$1 = {
2153
+ narrow: /^(b|a)/i,
2154
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
2155
+ wide: /^(before christ|before common era|anno domini|common era)/i
2156
+ };
2157
+ var parseEraPatterns$1 = {
2158
+ any: [/^b/i, /^(a|c)/i]
2159
+ };
2160
+ var matchQuarterPatterns$1 = {
2161
+ narrow: /^[1234]/i,
2162
+ abbreviated: /^q[1234]/i,
2163
+ wide: /^[1234](th|st|nd|rd)? quarter/i
2164
+ };
2165
+ var parseQuarterPatterns$1 = {
2166
+ any: [/1/i, /2/i, /3/i, /4/i]
2167
+ };
2168
+ var matchMonthPatterns$1 = {
2169
+ narrow: /^[jfmasond]/i,
2170
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
2171
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
2172
+ };
2173
+ var parseMonthPatterns$1 = {
2174
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
2175
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
2176
+ };
2177
+ var matchDayPatterns$1 = {
2178
+ narrow: /^[smtwf]/i,
2179
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
2180
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
2181
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
2182
+ };
2183
+ var parseDayPatterns$1 = {
2184
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
2185
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
2186
+ };
2187
+ var matchDayPeriodPatterns$1 = {
2188
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
2189
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
2190
+ };
2191
+ var parseDayPeriodPatterns$1 = {
2192
+ any: {
2193
+ am: /^a/i,
2194
+ pm: /^p/i,
2195
+ midnight: /^mi/i,
2196
+ noon: /^no/i,
2197
+ morning: /morning/i,
2198
+ afternoon: /afternoon/i,
2199
+ evening: /evening/i,
2200
+ night: /night/i
2201
+ }
2202
+ };
2203
+ var match$2 = {
2204
+ ordinalNumber: buildMatchPatternFn({
2205
+ matchPattern: matchOrdinalNumberPattern$1,
2206
+ parsePattern: parseOrdinalNumberPattern$1,
2207
+ valueCallback: function valueCallback(value) {
2208
+ return parseInt(value, 10);
2209
+ }
2210
+ }),
2211
+ era: buildMatchFn({
2212
+ matchPatterns: matchEraPatterns$1,
2213
+ defaultMatchWidth: 'wide',
2214
+ parsePatterns: parseEraPatterns$1,
2215
+ defaultParseWidth: 'any'
2216
+ }),
2217
+ quarter: buildMatchFn({
2218
+ matchPatterns: matchQuarterPatterns$1,
2219
+ defaultMatchWidth: 'wide',
2220
+ parsePatterns: parseQuarterPatterns$1,
2221
+ defaultParseWidth: 'any',
2222
+ valueCallback: function valueCallback(index) {
2223
+ return index + 1;
2224
+ }
2225
+ }),
2226
+ month: buildMatchFn({
2227
+ matchPatterns: matchMonthPatterns$1,
2228
+ defaultMatchWidth: 'wide',
2229
+ parsePatterns: parseMonthPatterns$1,
2230
+ defaultParseWidth: 'any'
2231
+ }),
2232
+ day: buildMatchFn({
2233
+ matchPatterns: matchDayPatterns$1,
2234
+ defaultMatchWidth: 'wide',
2235
+ parsePatterns: parseDayPatterns$1,
2236
+ defaultParseWidth: 'any'
2237
+ }),
2238
+ dayPeriod: buildMatchFn({
2239
+ matchPatterns: matchDayPeriodPatterns$1,
2240
+ defaultMatchWidth: 'any',
2241
+ parsePatterns: parseDayPeriodPatterns$1,
2242
+ defaultParseWidth: 'any'
2243
+ })
2244
+ };
2245
+ const match$3 = match$2;
2246
+
2247
+ /**
2248
+ * @type {Locale}
2249
+ * @category Locales
2250
+ * @summary English locale (United States).
2251
+ * @language English
2252
+ * @iso-639-2 eng
2253
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
2254
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
2255
+ */
2256
+ var locale$2 = {
2257
+ code: 'en-US',
2258
+ formatDistance: formatDistance$3,
2259
+ formatLong: formatLong$5,
2260
+ formatRelative: formatRelative$3,
2261
+ localize: localize$3,
2262
+ match: match$3,
2263
+ options: {
2264
+ weekStartsOn: 0 /* Sunday */,
2265
+ firstWeekContainsDate: 1
2266
+ }
2267
+ };
2268
+ const defaultLocale = locale$2;
2269
+
2270
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2271
+ // (one of the certain letters followed by `o`)
2272
+ // - (\w)\1* matches any sequences of the same letter
2273
+ // - '' matches two quote characters in a row
2274
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
2275
+ // except a single quote symbol, which ends the sequence.
2276
+ // Two quote characters do not end the sequence.
2277
+ // If there is no matching single quote
2278
+ // then the sequence will continue until the end of the string.
2279
+ // - . matches any single character unmatched by previous parts of the RegExps
2280
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2281
+
2282
+ // This RegExp catches symbols escaped by quotes, and also
2283
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2284
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2285
+ var escapedStringRegExp = /^'([^]*?)'?$/;
2286
+ var doubleQuoteRegExp = /''/g;
2287
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2288
+
2289
+ /**
2290
+ * @name format
2291
+ * @category Common Helpers
2292
+ * @summary Format the date.
2293
+ *
2294
+ * @description
2295
+ * Return the formatted date string in the given format. The result may vary by locale.
2296
+ *
2297
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2298
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2299
+ *
2300
+ * The characters wrapped between two single quotes characters (') are escaped.
2301
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
2302
+ * (see the last example)
2303
+ *
2304
+ * Format of the string is based on Unicode Technical Standard #35:
2305
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
2306
+ * with a few additions (see note 7 below the table).
2307
+ *
2308
+ * Accepted patterns:
2309
+ * | Unit | Pattern | Result examples | Notes |
2310
+ * |---------------------------------|---------|-----------------------------------|-------|
2311
+ * | Era | G..GGG | AD, BC | |
2312
+ * | | GGGG | Anno Domini, Before Christ | 2 |
2313
+ * | | GGGGG | A, B | |
2314
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
2315
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
2316
+ * | | yy | 44, 01, 00, 17 | 5 |
2317
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
2318
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
2319
+ * | | yyyyy | ... | 3,5 |
2320
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
2321
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
2322
+ * | | YY | 44, 01, 00, 17 | 5,8 |
2323
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
2324
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
2325
+ * | | YYYYY | ... | 3,5 |
2326
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
2327
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
2328
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
2329
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
2330
+ * | | RRRRR | ... | 3,5,7 |
2331
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
2332
+ * | | uu | -43, 01, 1900, 2017 | 5 |
2333
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
2334
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
2335
+ * | | uuuuu | ... | 3,5 |
2336
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
2337
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
2338
+ * | | QQ | 01, 02, 03, 04 | |
2339
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
2340
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
2341
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
2342
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
2343
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
2344
+ * | | qq | 01, 02, 03, 04 | |
2345
+ * | | qqq | Q1, Q2, Q3, Q4 | |
2346
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
2347
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
2348
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
2349
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
2350
+ * | | MM | 01, 02, ..., 12 | |
2351
+ * | | MMM | Jan, Feb, ..., Dec | |
2352
+ * | | MMMM | January, February, ..., December | 2 |
2353
+ * | | MMMMM | J, F, ..., D | |
2354
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2355
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2356
+ * | | LL | 01, 02, ..., 12 | |
2357
+ * | | LLL | Jan, Feb, ..., Dec | |
2358
+ * | | LLLL | January, February, ..., December | 2 |
2359
+ * | | LLLLL | J, F, ..., D | |
2360
+ * | Local week of year | w | 1, 2, ..., 53 | |
2361
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2362
+ * | | ww | 01, 02, ..., 53 | |
2363
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2364
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2365
+ * | | II | 01, 02, ..., 53 | 7 |
2366
+ * | Day of month | d | 1, 2, ..., 31 | |
2367
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2368
+ * | | dd | 01, 02, ..., 31 | |
2369
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2370
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2371
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2372
+ * | | DDD | 001, 002, ..., 365, 366 | |
2373
+ * | | DDDD | ... | 3 |
2374
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2375
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2376
+ * | | EEEEE | M, T, W, T, F, S, S | |
2377
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2378
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2379
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2380
+ * | | ii | 01, 02, ..., 07 | 7 |
2381
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2382
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2383
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2384
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2385
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2386
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2387
+ * | | ee | 02, 03, ..., 01 | |
2388
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2389
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2390
+ * | | eeeee | M, T, W, T, F, S, S | |
2391
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2392
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2393
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2394
+ * | | cc | 02, 03, ..., 01 | |
2395
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2396
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2397
+ * | | ccccc | M, T, W, T, F, S, S | |
2398
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2399
+ * | AM, PM | a..aa | AM, PM | |
2400
+ * | | aaa | am, pm | |
2401
+ * | | aaaa | a.m., p.m. | 2 |
2402
+ * | | aaaaa | a, p | |
2403
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2404
+ * | | bbb | am, pm, noon, midnight | |
2405
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2406
+ * | | bbbbb | a, p, n, mi | |
2407
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2408
+ * | | BBBB | at night, in the morning, ... | 2 |
2409
+ * | | BBBBB | at night, in the morning, ... | |
2410
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2411
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2412
+ * | | hh | 01, 02, ..., 11, 12 | |
2413
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2414
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2415
+ * | | HH | 00, 01, 02, ..., 23 | |
2416
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2417
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2418
+ * | | KK | 01, 02, ..., 11, 00 | |
2419
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2420
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2421
+ * | | kk | 24, 01, 02, ..., 23 | |
2422
+ * | Minute | m | 0, 1, ..., 59 | |
2423
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2424
+ * | | mm | 00, 01, ..., 59 | |
2425
+ * | Second | s | 0, 1, ..., 59 | |
2426
+ * | | so | 0th, 1st, ..., 59th | 7 |
2427
+ * | | ss | 00, 01, ..., 59 | |
2428
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2429
+ * | | SS | 00, 01, ..., 99 | |
2430
+ * | | SSS | 000, 001, ..., 999 | |
2431
+ * | | SSSS | ... | 3 |
2432
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2433
+ * | | XX | -0800, +0530, Z | |
2434
+ * | | XXX | -08:00, +05:30, Z | |
2435
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2436
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2437
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2438
+ * | | xx | -0800, +0530, +0000 | |
2439
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2440
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2441
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2442
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2443
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2444
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2445
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2446
+ * | Seconds timestamp | t | 512969520 | 7 |
2447
+ * | | tt | ... | 3,7 |
2448
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2449
+ * | | TT | ... | 3,7 |
2450
+ * | Long localized date | P | 04/29/1453 | 7 |
2451
+ * | | PP | Apr 29, 1453 | 7 |
2452
+ * | | PPP | April 29th, 1453 | 7 |
2453
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2454
+ * | Long localized time | p | 12:00 AM | 7 |
2455
+ * | | pp | 12:00:00 AM | 7 |
2456
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2457
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2458
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2459
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2460
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2461
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2462
+ * Notes:
2463
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2464
+ * are the same as "stand-alone" units, but are different in some languages.
2465
+ * "Formatting" units are declined according to the rules of the language
2466
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2467
+ *
2468
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2469
+ *
2470
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2471
+ *
2472
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2473
+ * the single quote characters (see below).
2474
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2475
+ * the output will be the same as default pattern for this unit, usually
2476
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2477
+ * are marked with "2" in the last column of the table.
2478
+ *
2479
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2480
+ *
2481
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2482
+ *
2483
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2484
+ *
2485
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2486
+ *
2487
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2488
+ *
2489
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2490
+ * The output will be padded with zeros to match the length of the pattern.
2491
+ *
2492
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2493
+ *
2494
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2495
+ * These tokens represent the shortest form of the quarter.
2496
+ *
2497
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2498
+ *
2499
+ * | Year | `y` | `u` |
2500
+ * |------|-----|-----|
2501
+ * | AC 1 | 1 | 1 |
2502
+ * | BC 1 | 1 | 0 |
2503
+ * | BC 2 | 2 | -1 |
2504
+ *
2505
+ * Also `yy` always returns the last two digits of a year,
2506
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2507
+ *
2508
+ * | Year | `yy` | `uu` |
2509
+ * |------|------|------|
2510
+ * | 1 | 01 | 01 |
2511
+ * | 14 | 14 | 14 |
2512
+ * | 376 | 76 | 376 |
2513
+ * | 1453 | 53 | 1453 |
2514
+ *
2515
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2516
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2517
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2518
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2519
+ *
2520
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2521
+ * so right now these tokens fall back to GMT timezones.
2522
+ *
2523
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2524
+ * - `i`: ISO day of week
2525
+ * - `I`: ISO week of year
2526
+ * - `R`: ISO week-numbering year
2527
+ * - `t`: seconds timestamp
2528
+ * - `T`: milliseconds timestamp
2529
+ * - `o`: ordinal number modifier
2530
+ * - `P`: long localized date
2531
+ * - `p`: long localized time
2532
+ *
2533
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2534
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2535
+ *
2536
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2537
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2538
+ *
2539
+ * @param {Date|Number} date - the original date
2540
+ * @param {String} format - the string of tokens
2541
+ * @param {Object} [options] - an object with options.
2542
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2543
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2544
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2545
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2546
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2547
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2548
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2549
+ * @returns {String} the formatted date string
2550
+ * @throws {TypeError} 2 arguments required
2551
+ * @throws {RangeError} `date` must not be Invalid Date
2552
+ * @throws {RangeError} `options.locale` must contain `localize` property
2553
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2554
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2555
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2556
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2557
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2558
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2559
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2560
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2561
+ *
2562
+ * @example
2563
+ * // Represent 11 February 2014 in middle-endian format:
2564
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2565
+ * //=> '02/11/2014'
2566
+ *
2567
+ * @example
2568
+ * // Represent 2 July 2014 in Esperanto:
2569
+ * import { eoLocale } from 'date-fns/locale/eo'
2570
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2571
+ * locale: eoLocale
2572
+ * })
2573
+ * //=> '2-a de julio 2014'
2574
+ *
2575
+ * @example
2576
+ * // Escape string by single quote characters:
2577
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2578
+ * //=> "3 o'clock"
2579
+ */
2580
+
2581
+ function format(dirtyDate, dirtyFormatStr, options) {
2582
+ var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
2583
+ requiredArgs(2, arguments);
2584
+ var formatStr = String(dirtyFormatStr);
2585
+ var defaultOptions = getDefaultOptions();
2586
+ var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;
2587
+ var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
2588
+
2589
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2590
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2591
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2592
+ }
2593
+ var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
2594
+
2595
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2596
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2597
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2598
+ }
2599
+ if (!locale.localize) {
2600
+ throw new RangeError('locale must contain localize property');
2601
+ }
2602
+ if (!locale.formatLong) {
2603
+ throw new RangeError('locale must contain formatLong property');
2604
+ }
2605
+ var originalDate = toDate(dirtyDate);
2606
+ if (!isValid(originalDate)) {
2607
+ throw new RangeError('Invalid time value');
2608
+ }
2609
+
2610
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2611
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2612
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2613
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2614
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2615
+ var formatterOptions = {
2616
+ firstWeekContainsDate: firstWeekContainsDate,
2617
+ weekStartsOn: weekStartsOn,
2618
+ locale: locale,
2619
+ _originalDate: originalDate
2620
+ };
2621
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2622
+ var firstCharacter = substring[0];
2623
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2624
+ var longFormatter = longFormatters$1[firstCharacter];
2625
+ return longFormatter(substring, locale.formatLong);
2626
+ }
2627
+ return substring;
2628
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2629
+ // Replace two single quote characters with one single quote character
2630
+ if (substring === "''") {
2631
+ return "'";
2632
+ }
2633
+ var firstCharacter = substring[0];
2634
+ if (firstCharacter === "'") {
2635
+ return cleanEscapedString(substring);
2636
+ }
2637
+ var formatter = formatters$1[firstCharacter];
2638
+ if (formatter) {
2639
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2640
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2641
+ }
2642
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2643
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2644
+ }
2645
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2646
+ }
2647
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2648
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2649
+ }
2650
+ return substring;
2651
+ }).join('');
2652
+ return result;
2653
+ }
2654
+ function cleanEscapedString(input) {
2655
+ var matched = input.match(escapedStringRegExp);
2656
+ if (!matched) {
2657
+ return input;
2658
+ }
2659
+ return matched[1].replace(doubleQuoteRegExp, "'");
2660
+ }
2661
+
2662
+ /**
2663
+ * @name getDay
2664
+ * @category Weekday Helpers
2665
+ * @summary Get the day of the week of the given date.
2666
+ *
2667
+ * @description
2668
+ * Get the day of the week of the given date.
2669
+ *
2670
+ * @param {Date|Number} date - the given date
2671
+ * @returns {0|1|2|3|4|5|6} the day of week, 0 represents Sunday
2672
+ * @throws {TypeError} 1 argument required
2673
+ *
2674
+ * @example
2675
+ * // Which day of the week is 29 February 2012?
2676
+ * const result = getDay(new Date(2012, 1, 29))
2677
+ * //=> 3
2678
+ */
2679
+ function getDay(dirtyDate) {
2680
+ requiredArgs(1, arguments);
2681
+ var date = toDate(dirtyDate);
2682
+ var day = date.getDay();
2683
+ return day;
2684
+ }
2685
+
2686
+ /**
2687
+ * @name getMonth
2688
+ * @category Month Helpers
2689
+ * @summary Get the month of the given date.
2690
+ *
2691
+ * @description
2692
+ * Get the month of the given date.
2693
+ *
2694
+ * @param {Date|Number} date - the given date
2695
+ * @returns {Number} the month
2696
+ * @throws {TypeError} 1 argument required
2697
+ *
2698
+ * @example
2699
+ * // Which month is 29 February 2012?
2700
+ * const result = getMonth(new Date(2012, 1, 29))
2701
+ * //=> 1
2702
+ */
2703
+ function getMonth(dirtyDate) {
2704
+ requiredArgs(1, arguments);
2705
+ var date = toDate(dirtyDate);
2706
+ var month = date.getMonth();
2707
+ return month;
2708
+ }
2709
+
2710
+ /**
2711
+ * @name getYear
2712
+ * @category Year Helpers
2713
+ * @summary Get the year of the given date.
2714
+ *
2715
+ * @description
2716
+ * Get the year of the given date.
2717
+ *
2718
+ * @param {Date|Number} date - the given date
2719
+ * @returns {Number} the year
2720
+ * @throws {TypeError} 1 argument required
2721
+ *
2722
+ * @example
2723
+ * // Which year is 2 July 2014?
2724
+ * const result = getYear(new Date(2014, 6, 2))
2725
+ * //=> 2014
2726
+ */
2727
+ function getYear(dirtyDate) {
2728
+ requiredArgs(1, arguments);
2729
+ return toDate(dirtyDate).getFullYear();
2730
+ }
2731
+
2732
+ /**
2733
+ * @name isAfter
2734
+ * @category Common Helpers
2735
+ * @summary Is the first date after the second one?
2736
+ *
2737
+ * @description
2738
+ * Is the first date after the second one?
2739
+ *
2740
+ * @param {Date|Number} date - the date that should be after the other one to return true
2741
+ * @param {Date|Number} dateToCompare - the date to compare with
2742
+ * @returns {Boolean} the first date is after the second date
2743
+ * @throws {TypeError} 2 arguments required
2744
+ *
2745
+ * @example
2746
+ * // Is 10 July 1989 after 11 February 1987?
2747
+ * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
2748
+ * //=> true
2749
+ */
2750
+ function isAfter(dirtyDate, dirtyDateToCompare) {
2751
+ requiredArgs(2, arguments);
2752
+ var date = toDate(dirtyDate);
2753
+ var dateToCompare = toDate(dirtyDateToCompare);
2754
+ return date.getTime() > dateToCompare.getTime();
2755
+ }
2756
+
2757
+ /**
2758
+ * @name isBefore
2759
+ * @category Common Helpers
2760
+ * @summary Is the first date before the second one?
2761
+ *
2762
+ * @description
2763
+ * Is the first date before the second one?
2764
+ *
2765
+ * @param {Date|Number} date - the date that should be before the other one to return true
2766
+ * @param {Date|Number} dateToCompare - the date to compare with
2767
+ * @returns {Boolean} the first date is before the second date
2768
+ * @throws {TypeError} 2 arguments required
2769
+ *
2770
+ * @example
2771
+ * // Is 10 July 1989 before 11 February 1987?
2772
+ * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
2773
+ * //=> false
2774
+ */
2775
+ function isBefore(dirtyDate, dirtyDateToCompare) {
2776
+ requiredArgs(2, arguments);
2777
+ var date = toDate(dirtyDate);
2778
+ var dateToCompare = toDate(dirtyDateToCompare);
2779
+ return date.getTime() < dateToCompare.getTime();
2780
+ }
2781
+
2782
+ /**
2783
+ * @name isToday
2784
+ * @category Day Helpers
2785
+ * @summary Is the given date today?
2786
+ * @pure false
2787
+ *
2788
+ * @description
2789
+ * Is the given date today?
2790
+ *
2791
+ * > ⚠️ Please note that this function is not present in the FP submodule as
2792
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
2793
+ *
2794
+ * @param {Date|Number} date - the date to check
2795
+ * @returns {Boolean} the date is today
2796
+ * @throws {TypeError} 1 argument required
2797
+ *
2798
+ * @example
2799
+ * // If today is 6 October 2014, is 6 October 14:00:00 today?
2800
+ * const result = isToday(new Date(2014, 9, 6, 14, 0))
2801
+ * //=> true
2802
+ */
2803
+ function isToday(dirtyDate) {
2804
+ requiredArgs(1, arguments);
2805
+ return isSameDay(dirtyDate, Date.now());
2806
+ }
2807
+
2808
+ /**
2809
+ * @name subDays
2810
+ * @category Day Helpers
2811
+ * @summary Subtract the specified number of days from the given date.
2812
+ *
2813
+ * @description
2814
+ * Subtract the specified number of days from the given date.
2815
+ *
2816
+ * @param {Date|Number} date - the date to be changed
2817
+ * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
2818
+ * @returns {Date} the new date with the days subtracted
2819
+ * @throws {TypeError} 2 arguments required
2820
+ *
2821
+ * @example
2822
+ * // Subtract 10 days from 1 September 2014:
2823
+ * const result = subDays(new Date(2014, 8, 1), 10)
2824
+ * //=> Fri Aug 22 2014 00:00:00
2825
+ */
2826
+ function subDays(dirtyDate, dirtyAmount) {
2827
+ requiredArgs(2, arguments);
2828
+ var amount = toInteger(dirtyAmount);
2829
+ return addDays(dirtyDate, -amount);
2830
+ }
2831
+
2832
+ /**
2833
+ * @name parseISO
2834
+ * @category Common Helpers
2835
+ * @summary Parse ISO string
2836
+ *
2837
+ * @description
2838
+ * Parse the given string in ISO 8601 format and return an instance of Date.
2839
+ *
2840
+ * Function accepts complete ISO 8601 formats as well as partial implementations.
2841
+ * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
2842
+ *
2843
+ * If the argument isn't a string, the function cannot parse the string or
2844
+ * the values are invalid, it returns Invalid Date.
2845
+ *
2846
+ * @param {String} argument - the value to convert
2847
+ * @param {Object} [options] - an object with options.
2848
+ * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format
2849
+ * @returns {Date} the parsed date in the local time zone
2850
+ * @throws {TypeError} 1 argument required
2851
+ * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
2852
+ *
2853
+ * @example
2854
+ * // Convert string '2014-02-11T11:30:30' to date:
2855
+ * const result = parseISO('2014-02-11T11:30:30')
2856
+ * //=> Tue Feb 11 2014 11:30:30
2857
+ *
2858
+ * @example
2859
+ * // Convert string '+02014101' to date,
2860
+ * // if the additional number of digits in the extended year format is 1:
2861
+ * const result = parseISO('+02014101', { additionalDigits: 1 })
2862
+ * //=> Fri Apr 11 2014 00:00:00
2863
+ */
2864
+ function parseISO(argument, options) {
2865
+ var _options$additionalDi;
2866
+ requiredArgs(1, arguments);
2867
+ var additionalDigits = toInteger((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
2868
+ if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
2869
+ throw new RangeError('additionalDigits must be 0, 1 or 2');
2870
+ }
2871
+ if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {
2872
+ return new Date(NaN);
2873
+ }
2874
+ var dateStrings = splitDateString(argument);
2875
+ var date;
2876
+ if (dateStrings.date) {
2877
+ var parseYearResult = parseYear(dateStrings.date, additionalDigits);
2878
+ date = parseDate(parseYearResult.restDateString, parseYearResult.year);
2879
+ }
2880
+ if (!date || isNaN(date.getTime())) {
2881
+ return new Date(NaN);
2882
+ }
2883
+ var timestamp = date.getTime();
2884
+ var time = 0;
2885
+ var offset;
2886
+ if (dateStrings.time) {
2887
+ time = parseTime(dateStrings.time);
2888
+ if (isNaN(time)) {
2889
+ return new Date(NaN);
2890
+ }
2891
+ }
2892
+ if (dateStrings.timezone) {
2893
+ offset = parseTimezone(dateStrings.timezone);
2894
+ if (isNaN(offset)) {
2895
+ return new Date(NaN);
2896
+ }
2897
+ } else {
2898
+ var dirtyDate = new Date(timestamp + time);
2899
+ // js parsed string assuming it's in UTC timezone
2900
+ // but we need it to be parsed in our timezone
2901
+ // so we use utc values to build date in our timezone.
2902
+ // Year values from 0 to 99 map to the years 1900 to 1999
2903
+ // so set year explicitly with setFullYear.
2904
+ var result = new Date(0);
2905
+ result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
2906
+ result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
2907
+ return result;
2908
+ }
2909
+ return new Date(timestamp + time + offset);
2910
+ }
2911
+ var patterns = {
2912
+ dateTimeDelimiter: /[T ]/,
2913
+ timeZoneDelimiter: /[Z ]/i,
2914
+ timezone: /([Z+-].*)$/
2915
+ };
2916
+ var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
2917
+ var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
2918
+ var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
2919
+ function splitDateString(dateString) {
2920
+ var dateStrings = {};
2921
+ var array = dateString.split(patterns.dateTimeDelimiter);
2922
+ var timeString;
2923
+
2924
+ // The regex match should only return at maximum two array elements.
2925
+ // [date], [time], or [date, time].
2926
+ if (array.length > 2) {
2927
+ return dateStrings;
2928
+ }
2929
+ if (/:/.test(array[0])) {
2930
+ timeString = array[0];
2931
+ } else {
2932
+ dateStrings.date = array[0];
2933
+ timeString = array[1];
2934
+ if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
2935
+ dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
2936
+ timeString = dateString.substr(dateStrings.date.length, dateString.length);
2937
+ }
2938
+ }
2939
+ if (timeString) {
2940
+ var token = patterns.timezone.exec(timeString);
2941
+ if (token) {
2942
+ dateStrings.time = timeString.replace(token[1], '');
2943
+ dateStrings.timezone = token[1];
2944
+ } else {
2945
+ dateStrings.time = timeString;
2946
+ }
2947
+ }
2948
+ return dateStrings;
2949
+ }
2950
+ function parseYear(dateString, additionalDigits) {
2951
+ var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)');
2952
+ var captures = dateString.match(regex);
2953
+ // Invalid ISO-formatted year
2954
+ if (!captures) return {
2955
+ year: NaN,
2956
+ restDateString: ''
2957
+ };
2958
+ var year = captures[1] ? parseInt(captures[1]) : null;
2959
+ var century = captures[2] ? parseInt(captures[2]) : null;
2960
+
2961
+ // either year or century is null, not both
2962
+ return {
2963
+ year: century === null ? year : century * 100,
2964
+ restDateString: dateString.slice((captures[1] || captures[2]).length)
2965
+ };
2966
+ }
2967
+ function parseDate(dateString, year) {
2968
+ // Invalid ISO-formatted year
2969
+ if (year === null) return new Date(NaN);
2970
+ var captures = dateString.match(dateRegex);
2971
+ // Invalid ISO-formatted string
2972
+ if (!captures) return new Date(NaN);
2973
+ var isWeekDate = !!captures[4];
2974
+ var dayOfYear = parseDateUnit(captures[1]);
2975
+ var month = parseDateUnit(captures[2]) - 1;
2976
+ var day = parseDateUnit(captures[3]);
2977
+ var week = parseDateUnit(captures[4]);
2978
+ var dayOfWeek = parseDateUnit(captures[5]) - 1;
2979
+ if (isWeekDate) {
2980
+ if (!validateWeekDate(year, week, dayOfWeek)) {
2981
+ return new Date(NaN);
2982
+ }
2983
+ return dayOfISOWeekYear(year, week, dayOfWeek);
2984
+ } else {
2985
+ var date = new Date(0);
2986
+ if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
2987
+ return new Date(NaN);
2988
+ }
2989
+ date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
2990
+ return date;
2991
+ }
2992
+ }
2993
+ function parseDateUnit(value) {
2994
+ return value ? parseInt(value) : 1;
2995
+ }
2996
+ function parseTime(timeString) {
2997
+ var captures = timeString.match(timeRegex);
2998
+ if (!captures) return NaN; // Invalid ISO-formatted time
2999
+
3000
+ var hours = parseTimeUnit(captures[1]);
3001
+ var minutes = parseTimeUnit(captures[2]);
3002
+ var seconds = parseTimeUnit(captures[3]);
3003
+ if (!validateTime(hours, minutes, seconds)) {
3004
+ return NaN;
3005
+ }
3006
+ return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;
3007
+ }
3008
+ function parseTimeUnit(value) {
3009
+ return value && parseFloat(value.replace(',', '.')) || 0;
3010
+ }
3011
+ function parseTimezone(timezoneString) {
3012
+ if (timezoneString === 'Z') return 0;
3013
+ var captures = timezoneString.match(timezoneRegex);
3014
+ if (!captures) return 0;
3015
+ var sign = captures[1] === '+' ? -1 : 1;
3016
+ var hours = parseInt(captures[2]);
3017
+ var minutes = captures[3] && parseInt(captures[3]) || 0;
3018
+ if (!validateTimezone(hours, minutes)) {
3019
+ return NaN;
3020
+ }
3021
+ return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
3022
+ }
3023
+ function dayOfISOWeekYear(isoWeekYear, week, day) {
3024
+ var date = new Date(0);
3025
+ date.setUTCFullYear(isoWeekYear, 0, 4);
3026
+ var fourthOfJanuaryDay = date.getUTCDay() || 7;
3027
+ var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
3028
+ date.setUTCDate(date.getUTCDate() + diff);
3029
+ return date;
3030
+ }
3031
+
3032
+ // Validation functions
3033
+
3034
+ // February is null to handle the leap year (using ||)
3035
+ var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
3036
+ function isLeapYearIndex(year) {
3037
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
3038
+ }
3039
+ function validateDate(year, month, date) {
3040
+ return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
3041
+ }
3042
+ function validateDayOfYearDate(year, dayOfYear) {
3043
+ return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
3044
+ }
3045
+ function validateWeekDate(_year, week, day) {
3046
+ return week >= 1 && week <= 53 && day >= 0 && day <= 6;
3047
+ }
3048
+ function validateTime(hours, minutes, seconds) {
3049
+ if (hours === 24) {
3050
+ return minutes === 0 && seconds === 0;
3051
+ }
3052
+ return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
3053
+ }
3054
+ function validateTimezone(_hours, minutes) {
3055
+ return minutes >= 0 && minutes <= 59;
3056
+ }
3057
+
3058
+ /**
3059
+ * @name subMonths
3060
+ * @category Month Helpers
3061
+ * @summary Subtract the specified number of months from the given date.
3062
+ *
3063
+ * @description
3064
+ * Subtract the specified number of months from the given date.
3065
+ *
3066
+ * @param {Date|Number} date - the date to be changed
3067
+ * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
3068
+ * @returns {Date} the new date with the months subtracted
3069
+ * @throws {TypeError} 2 arguments required
3070
+ *
3071
+ * @example
3072
+ * // Subtract 5 months from 1 February 2015:
3073
+ * const result = subMonths(new Date(2015, 1, 1), 5)
3074
+ * //=> Mon Sep 01 2014 00:00:00
3075
+ */
3076
+ function subMonths(dirtyDate, dirtyAmount) {
3077
+ requiredArgs(2, arguments);
3078
+ var amount = toInteger(dirtyAmount);
3079
+ return addMonths(dirtyDate, -amount);
3080
+ }
3081
+
3082
+ var dateFormats$1 = {
3083
+ full: 'EEEE, d MMMM yyyy',
3084
+ long: 'd MMMM yyyy',
3085
+ medium: 'd MMM yyyy',
3086
+ short: 'dd/MM/yyyy'
3087
+ };
3088
+ var timeFormats$1 = {
3089
+ full: 'h:mm:ss a zzzz',
3090
+ long: 'h:mm:ss a z',
3091
+ medium: 'h:mm:ss a',
3092
+ short: 'h:mm a'
3093
+ };
3094
+ var dateTimeFormats$1 = {
3095
+ full: "{{date}} 'at' {{time}}",
3096
+ long: "{{date}} 'at' {{time}}",
3097
+ medium: '{{date}}, {{time}}',
3098
+ short: '{{date}}, {{time}}'
3099
+ };
3100
+ var formatLong$2 = {
3101
+ date: buildFormatLongFn({
3102
+ formats: dateFormats$1,
3103
+ defaultWidth: 'full'
3104
+ }),
3105
+ time: buildFormatLongFn({
3106
+ formats: timeFormats$1,
3107
+ defaultWidth: 'full'
3108
+ }),
3109
+ dateTime: buildFormatLongFn({
3110
+ formats: dateTimeFormats$1,
3111
+ defaultWidth: 'full'
3112
+ })
3113
+ };
3114
+ const formatLong$3 = formatLong$2;
3115
+
3116
+ /**
3117
+ * @type {Locale}
3118
+ * @category Locales
3119
+ * @summary English locale (Australia).
3120
+ * @language English
3121
+ * @iso-639-2 eng
3122
+ * @author Julien Malige [@JulienMalige]{@link https://github.com/JulienMalige}
3123
+ */
3124
+ var locale$1 = {
3125
+ code: 'en-AU',
3126
+ formatDistance: formatDistance$3,
3127
+ formatLong: formatLong$3,
3128
+ formatRelative: formatRelative$3,
3129
+ localize: localize$3,
3130
+ match: match$3,
3131
+ options: {
3132
+ weekStartsOn: 1 /* Monday */,
3133
+ firstWeekContainsDate: 4
3134
+ }
3135
+ };
3136
+ const enAU = locale$1;
3137
+
3138
+ var formatDistanceLocale = {
3139
+ lessThanXSeconds: {
3140
+ one: 'menos de um segundo',
3141
+ other: 'menos de {{count}} segundos'
3142
+ },
3143
+ xSeconds: {
3144
+ one: '1 segundo',
3145
+ other: '{{count}} segundos'
3146
+ },
3147
+ halfAMinute: 'meio minuto',
3148
+ lessThanXMinutes: {
3149
+ one: 'menos de um minuto',
3150
+ other: 'menos de {{count}} minutos'
3151
+ },
3152
+ xMinutes: {
3153
+ one: '1 minuto',
3154
+ other: '{{count}} minutos'
3155
+ },
3156
+ aboutXHours: {
3157
+ one: 'cerca de 1 hora',
3158
+ other: 'cerca de {{count}} horas'
3159
+ },
3160
+ xHours: {
3161
+ one: '1 hora',
3162
+ other: '{{count}} horas'
3163
+ },
3164
+ xDays: {
3165
+ one: '1 dia',
3166
+ other: '{{count}} dias'
3167
+ },
3168
+ aboutXWeeks: {
3169
+ one: 'cerca de 1 semana',
3170
+ other: 'cerca de {{count}} semanas'
3171
+ },
3172
+ xWeeks: {
3173
+ one: '1 semana',
3174
+ other: '{{count}} semanas'
3175
+ },
3176
+ aboutXMonths: {
3177
+ one: 'cerca de 1 mês',
3178
+ other: 'cerca de {{count}} meses'
3179
+ },
3180
+ xMonths: {
3181
+ one: '1 mês',
3182
+ other: '{{count}} meses'
3183
+ },
3184
+ aboutXYears: {
3185
+ one: 'cerca de 1 ano',
3186
+ other: 'cerca de {{count}} anos'
3187
+ },
3188
+ xYears: {
3189
+ one: '1 ano',
3190
+ other: '{{count}} anos'
3191
+ },
3192
+ overXYears: {
3193
+ one: 'mais de 1 ano',
3194
+ other: 'mais de {{count}} anos'
3195
+ },
3196
+ almostXYears: {
3197
+ one: 'quase 1 ano',
3198
+ other: 'quase {{count}} anos'
3199
+ }
3200
+ };
3201
+ var formatDistance = function formatDistance(token, count, options) {
3202
+ var result;
3203
+ var tokenValue = formatDistanceLocale[token];
3204
+ if (typeof tokenValue === 'string') {
3205
+ result = tokenValue;
3206
+ } else if (count === 1) {
3207
+ result = tokenValue.one;
3208
+ } else {
3209
+ result = tokenValue.other.replace('{{count}}', String(count));
3210
+ }
3211
+ if (options !== null && options !== void 0 && options.addSuffix) {
3212
+ if (options.comparison && options.comparison > 0) {
3213
+ return 'em ' + result;
3214
+ } else {
3215
+ return 'há ' + result;
3216
+ }
3217
+ }
3218
+ return result;
3219
+ };
3220
+ const formatDistance$1 = formatDistance;
3221
+
3222
+ var dateFormats = {
3223
+ full: "EEEE, d 'de' MMMM 'de' y",
3224
+ long: "d 'de' MMMM 'de' y",
3225
+ medium: 'd MMM y',
3226
+ short: 'dd/MM/yyyy'
3227
+ };
3228
+ var timeFormats = {
3229
+ full: 'HH:mm:ss zzzz',
3230
+ long: 'HH:mm:ss z',
3231
+ medium: 'HH:mm:ss',
3232
+ short: 'HH:mm'
3233
+ };
3234
+ var dateTimeFormats = {
3235
+ full: "{{date}} 'às' {{time}}",
3236
+ long: "{{date}} 'às' {{time}}",
3237
+ medium: '{{date}}, {{time}}',
3238
+ short: '{{date}}, {{time}}'
3239
+ };
3240
+ var formatLong = {
3241
+ date: buildFormatLongFn({
3242
+ formats: dateFormats,
3243
+ defaultWidth: 'full'
3244
+ }),
3245
+ time: buildFormatLongFn({
3246
+ formats: timeFormats,
3247
+ defaultWidth: 'full'
3248
+ }),
3249
+ dateTime: buildFormatLongFn({
3250
+ formats: dateTimeFormats,
3251
+ defaultWidth: 'full'
3252
+ })
3253
+ };
3254
+ const formatLong$1 = formatLong;
3255
+
3256
+ var formatRelativeLocale = {
3257
+ lastWeek: function lastWeek(date) {
3258
+ var weekday = date.getUTCDay();
3259
+ var last = weekday === 0 || weekday === 6 ? 'último' : 'última';
3260
+ return "'" + last + "' eeee 'às' p";
3261
+ },
3262
+ yesterday: "'ontem às' p",
3263
+ today: "'hoje às' p",
3264
+ tomorrow: "'amanhã às' p",
3265
+ nextWeek: "eeee 'às' p",
3266
+ other: 'P'
3267
+ };
3268
+ var formatRelative = function formatRelative(token, date, _baseDate, _options) {
3269
+ var format = formatRelativeLocale[token];
3270
+ if (typeof format === 'function') {
3271
+ return format(date);
3272
+ }
3273
+ return format;
3274
+ };
3275
+ const formatRelative$1 = formatRelative;
3276
+
3277
+ var eraValues = {
3278
+ narrow: ['AC', 'DC'],
3279
+ abbreviated: ['AC', 'DC'],
3280
+ wide: ['antes de cristo', 'depois de cristo']
3281
+ };
3282
+ var quarterValues = {
3283
+ narrow: ['1', '2', '3', '4'],
3284
+ abbreviated: ['T1', 'T2', 'T3', 'T4'],
3285
+ wide: ['1º trimestre', '2º trimestre', '3º trimestre', '4º trimestre']
3286
+ };
3287
+ var monthValues = {
3288
+ narrow: ['j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
3289
+ abbreviated: ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'],
3290
+ wide: ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro']
3291
+ };
3292
+ var dayValues = {
3293
+ narrow: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],
3294
+ short: ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sab'],
3295
+ abbreviated: ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado'],
3296
+ wide: ['domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado']
3297
+ };
3298
+ var dayPeriodValues = {
3299
+ narrow: {
3300
+ am: 'a',
3301
+ pm: 'p',
3302
+ midnight: 'mn',
3303
+ noon: 'md',
3304
+ morning: 'manhã',
3305
+ afternoon: 'tarde',
3306
+ evening: 'tarde',
3307
+ night: 'noite'
3308
+ },
3309
+ abbreviated: {
3310
+ am: 'AM',
3311
+ pm: 'PM',
3312
+ midnight: 'meia-noite',
3313
+ noon: 'meio-dia',
3314
+ morning: 'manhã',
3315
+ afternoon: 'tarde',
3316
+ evening: 'tarde',
3317
+ night: 'noite'
3318
+ },
3319
+ wide: {
3320
+ am: 'a.m.',
3321
+ pm: 'p.m.',
3322
+ midnight: 'meia-noite',
3323
+ noon: 'meio-dia',
3324
+ morning: 'manhã',
3325
+ afternoon: 'tarde',
3326
+ evening: 'tarde',
3327
+ night: 'noite'
3328
+ }
3329
+ };
3330
+ var formattingDayPeriodValues = {
3331
+ narrow: {
3332
+ am: 'a',
3333
+ pm: 'p',
3334
+ midnight: 'mn',
3335
+ noon: 'md',
3336
+ morning: 'da manhã',
3337
+ afternoon: 'da tarde',
3338
+ evening: 'da tarde',
3339
+ night: 'da noite'
3340
+ },
3341
+ abbreviated: {
3342
+ am: 'AM',
3343
+ pm: 'PM',
3344
+ midnight: 'meia-noite',
3345
+ noon: 'meio-dia',
3346
+ morning: 'da manhã',
3347
+ afternoon: 'da tarde',
3348
+ evening: 'da tarde',
3349
+ night: 'da noite'
3350
+ },
3351
+ wide: {
3352
+ am: 'a.m.',
3353
+ pm: 'p.m.',
3354
+ midnight: 'meia-noite',
3355
+ noon: 'meio-dia',
3356
+ morning: 'da manhã',
3357
+ afternoon: 'da tarde',
3358
+ evening: 'da tarde',
3359
+ night: 'da noite'
3360
+ }
3361
+ };
3362
+ var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
3363
+ var number = Number(dirtyNumber);
3364
+ if ((options === null || options === void 0 ? void 0 : options.unit) === 'week') {
3365
+ return number + 'ª';
3366
+ }
3367
+ return number + 'º';
3368
+ };
3369
+ var localize = {
3370
+ ordinalNumber: ordinalNumber,
3371
+ era: buildLocalizeFn({
3372
+ values: eraValues,
3373
+ defaultWidth: 'wide'
3374
+ }),
3375
+ quarter: buildLocalizeFn({
3376
+ values: quarterValues,
3377
+ defaultWidth: 'wide',
3378
+ argumentCallback: function argumentCallback(quarter) {
3379
+ return quarter - 1;
3380
+ }
3381
+ }),
3382
+ month: buildLocalizeFn({
3383
+ values: monthValues,
3384
+ defaultWidth: 'wide'
3385
+ }),
3386
+ day: buildLocalizeFn({
3387
+ values: dayValues,
3388
+ defaultWidth: 'wide'
3389
+ }),
3390
+ dayPeriod: buildLocalizeFn({
3391
+ values: dayPeriodValues,
3392
+ defaultWidth: 'wide',
3393
+ formattingValues: formattingDayPeriodValues,
3394
+ defaultFormattingWidth: 'wide'
3395
+ })
3396
+ };
3397
+ const localize$1 = localize;
3398
+
3399
+ var matchOrdinalNumberPattern = /^(\d+)[ºªo]?/i;
3400
+ var parseOrdinalNumberPattern = /\d+/i;
3401
+ var matchEraPatterns = {
3402
+ narrow: /^(ac|dc|a|d)/i,
3403
+ abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
3404
+ wide: /^(antes de cristo|depois de cristo)/i
3405
+ };
3406
+ var parseEraPatterns = {
3407
+ any: [/^ac/i, /^dc/i],
3408
+ wide: [/^antes de cristo/i, /^depois de cristo/i]
3409
+ };
3410
+ var matchQuarterPatterns = {
3411
+ narrow: /^[1234]/i,
3412
+ abbreviated: /^T[1234]/i,
3413
+ wide: /^[1234](º)? trimestre/i
3414
+ };
3415
+ var parseQuarterPatterns = {
3416
+ any: [/1/i, /2/i, /3/i, /4/i]
3417
+ };
3418
+ var matchMonthPatterns = {
3419
+ narrow: /^[jfmajsond]/i,
3420
+ abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
3421
+ wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
3422
+ };
3423
+ var parseMonthPatterns = {
3424
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
3425
+ any: [/^ja/i, /^fev/i, /^mar/i, /^abr/i, /^mai/i, /^jun/i, /^jul/i, /^ago/i, /^set/i, /^out/i, /^nov/i, /^dez/i]
3426
+ };
3427
+ var matchDayPatterns = {
3428
+ narrow: /^(dom|[23456]ª?|s[aá]b)/i,
3429
+ short: /^(dom|[23456]ª?|s[aá]b)/i,
3430
+ abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,
3431
+ wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i
3432
+ };
3433
+ var parseDayPatterns = {
3434
+ short: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
3435
+ narrow: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
3436
+ any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[aá]b/i]
3437
+ };
3438
+ var matchDayPeriodPatterns = {
3439
+ narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
3440
+ any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
3441
+ };
3442
+ var parseDayPeriodPatterns = {
3443
+ any: {
3444
+ am: /^a/i,
3445
+ pm: /^p/i,
3446
+ midnight: /^mn|^meia[-\s]noite/i,
3447
+ noon: /^md|^meio[-\s]dia/i,
3448
+ morning: /manhã/i,
3449
+ afternoon: /tarde/i,
3450
+ evening: /tarde/i,
3451
+ night: /noite/i
3452
+ }
3453
+ };
3454
+ var match = {
3455
+ ordinalNumber: buildMatchPatternFn({
3456
+ matchPattern: matchOrdinalNumberPattern,
3457
+ parsePattern: parseOrdinalNumberPattern,
3458
+ valueCallback: function valueCallback(value) {
3459
+ return parseInt(value, 10);
3460
+ }
3461
+ }),
3462
+ era: buildMatchFn({
3463
+ matchPatterns: matchEraPatterns,
3464
+ defaultMatchWidth: 'wide',
3465
+ parsePatterns: parseEraPatterns,
3466
+ defaultParseWidth: 'any'
3467
+ }),
3468
+ quarter: buildMatchFn({
3469
+ matchPatterns: matchQuarterPatterns,
3470
+ defaultMatchWidth: 'wide',
3471
+ parsePatterns: parseQuarterPatterns,
3472
+ defaultParseWidth: 'any',
3473
+ valueCallback: function valueCallback(index) {
3474
+ return index + 1;
3475
+ }
3476
+ }),
3477
+ month: buildMatchFn({
3478
+ matchPatterns: matchMonthPatterns,
3479
+ defaultMatchWidth: 'wide',
3480
+ parsePatterns: parseMonthPatterns,
3481
+ defaultParseWidth: 'any'
3482
+ }),
3483
+ day: buildMatchFn({
3484
+ matchPatterns: matchDayPatterns,
3485
+ defaultMatchWidth: 'wide',
3486
+ parsePatterns: parseDayPatterns,
3487
+ defaultParseWidth: 'any'
3488
+ }),
3489
+ dayPeriod: buildMatchFn({
3490
+ matchPatterns: matchDayPeriodPatterns,
3491
+ defaultMatchWidth: 'any',
3492
+ parsePatterns: parseDayPeriodPatterns,
3493
+ defaultParseWidth: 'any'
3494
+ })
3495
+ };
3496
+ const match$1 = match;
3497
+
3498
+ /**
3499
+ * @type {Locale}
3500
+ * @category Locales
3501
+ * @summary Portuguese locale (Brazil).
3502
+ * @language Portuguese
3503
+ * @iso-639-2 por
3504
+ * @author Lucas Duailibe [@duailibe]{@link https://github.com/duailibe}
3505
+ * @author Yago Carballo [@yagocarballo]{@link https://github.com/YagoCarballo}
3506
+ */
3507
+ var locale = {
3508
+ code: 'pt-BR',
3509
+ formatDistance: formatDistance$1,
3510
+ formatLong: formatLong$1,
3511
+ formatRelative: formatRelative$1,
3512
+ localize: localize$1,
3513
+ match: match$1,
3514
+ options: {
3515
+ weekStartsOn: 0 /* Sunday */,
3516
+ firstWeekContainsDate: 1
3517
+ }
3518
+ };
3519
+ const ptBR = locale;
3520
+
3521
+ const curaCalendarCss = ":host{display:block;width:var(--width)}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);padding:0 12px 12px 12px;min-width:300px;border:1px solid var(--neutral-light);border-radius:4px;overflow:hidden;background:#fff;box-shadow:0 4px 8px var(--neutral-light);font-family:var(--font-family)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:0px 12px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--accent-base);transform:translate(-50%, -50%) scale(0);transition:transform 0.2s ease}:host .icon:active::before{transform:translate(-50%, -50%) scale(1)}:host .icon:active{transform:scale(1)}:host .date{display:flex;justify-content:center;align-items:center;height:auto;width:14.2857142857%;aspect-ratio:1;font-size:14px;cursor:pointer;position:relative;box-sizing:border-box;text-align:center;flex-shrink:0}:host .date.today{border:2px solid var(--primary-darker);border-radius:50%;color:var(--primary-darker)}:host .date.selected,:host .date.default-dates{color:var(--neutral-black) !important;background:var(--accent-base);border-radius:50%;border:none}:host .date.invalid{color:var(--neutral-dark) !important;cursor:not-allowed}:host .date.invalid:hover{background:none;box-shadow:none}:host .date.valid{color:var(--primary-darker);font-weight:var(--font-weight-bold)}:host .date.range.start{border-radius:50% 0 0 50%;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date.range.interval{border-radius:0;background-color:var(--accent-light);color:var(--neutral-black)}:host .date.range.interval.today{border:none}:host .date.range.end{border-radius:0 50% 50% 0;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date:hover{background:var(--accent-light);border-radius:50%;color:var(--neutral-black)}:host select,:host input{width:60px;font-size:16px;box-shadow:0 2px 2px var(--neutral-black);padding:5px;border-radius:4px;border:1px solid #ccc;background:#f7f7f7}";
3522
+ const CuraCalendarStyle0 = curaCalendarCss;
3523
+
3524
+ const CuraCalendar = class {
3525
+ constructor(hostRef) {
3526
+ index.registerInstance(this, hostRef);
3527
+ this.onchangeday = index.createEvent(this, "onchangeday", 7);
3528
+ this.theme = window.CuraAPI.theme;
3529
+ this.weights = this.theme.fonts.getWeights();
3530
+ this.optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };
3531
+ this.period = [];
3532
+ this.width = '300px';
3533
+ this.mode = 'single';
3534
+ this.dateFormat = 'yyyy-MM-dd';
3535
+ this.locale = 'pt-BR';
3536
+ this.type = 'dropdown';
3537
+ this.disable = [];
3538
+ this.enable = [];
3539
+ this.defaultDate = [];
3540
+ this.limitRange = null;
3541
+ this.currentDate = new Date();
3542
+ this.selectedDates = [];
3543
+ this.rangeStart = null;
3544
+ this.defaultDates = [];
3545
+ this.selectMonth = '';
3546
+ this.selectYear = '';
3547
+ this.styles = {};
3548
+ }
3549
+ connectedCallback() {
3550
+ this.initializeDefaultDates();
3551
+ this.setFontProperties();
3552
+ const colors = [
3553
+ { name: '--accent-base', theme: 'accent-base' },
3554
+ { name: '--accent-light', theme: 'accent-light' },
3555
+ { name: '--neutral-black', theme: 'neutral-black' },
3556
+ { name: '--primary-darker', theme: 'primary-darker' },
3557
+ { name: '--neutral-dark', theme: 'neutral-dark' },
3558
+ { name: '--neutral-light', theme: 'neutral-light' },
3559
+ ];
3560
+ colors.forEach(color => this.styles = Object.assign(Object.assign({}, this.styles), { [color.name]: this.theme.colors.getColor(color.theme) }));
3561
+ }
3562
+ setFontProperties() {
3563
+ this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
3564
+ this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
3565
+ this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();
3566
+ this.styles['--font-weight-medium'] = this.weights.medium;
3567
+ this.styles['--font-weight-bold'] = this.weights.bold;
3568
+ this.styles['--font-weight-regular'] = this.weights.regular;
3569
+ }
3570
+ /**
3571
+ * Initialize the selected dates based on defaultDate and mode.
3572
+ */
3573
+ initializeDefaultDates() {
3574
+ this.defaultDates = this.expandDateRanges(this.defaultDate);
3575
+ }
3576
+ /**
3577
+ * Get the locale for the calendar.
3578
+ *
3579
+ * @returns {Locale} The locale object.
3580
+ */
3581
+ determineLocale() {
3582
+ return this.optionsLocale[this.locale] || this.locale;
3583
+ }
3584
+ /**
3585
+ * Check if a date is within the valid period.
3586
+ *
3587
+ * @param {Date} date - The date to check.
3588
+ * @returns {boolean} Whether the date is valid.
3589
+ */
3590
+ isDateInValidPeriod(date) {
3591
+ return this.period.includes(format(date, this.dateFormat));
3592
+ }
3593
+ /**
3594
+ * Check if a date is selected.
3595
+ *
3596
+ * @param {Date} date - The date to check.
3597
+ * @returns {boolean} Whether the date is selected.
3598
+ */
3599
+ isDateSelected(date) {
3600
+ return this.isDateInList(this.selectedDates, date);
3601
+ }
3602
+ /**
3603
+ * Check if has date in defaultDates.
3604
+ *
3605
+ * @param {Date} date - The date to check.
3606
+ * @returns {boolean} Whether the date is selected.
3607
+ */
3608
+ isDateInDefaultSelection(date) {
3609
+ return this.isDateInList(this.defaultDates, date);
3610
+ }
3611
+ /**
3612
+ * Check if a date is within a disabled period.
3613
+ *
3614
+ * @param {Date} date - The date to check.
3615
+ * @returns {boolean} Whether the date is disabled.
3616
+ */
3617
+ isDateInDisabledPeriod(date) {
3618
+ return this.isDateInList(this.expandDateRanges(this.disable), date);
3619
+ }
3620
+ /**
3621
+ * Check if a date is within an enabled period.
3622
+ *
3623
+ * @param {Date} date - The date to check.
3624
+ * @returns {boolean} Whether the date is enabled.
3625
+ */
3626
+ isDateInEnabledPeriod(date) {
3627
+ if (this.enable.length === 0)
3628
+ return true;
3629
+ return this.isDateInList(this.expandDateRanges(this.enable), date);
3630
+ }
3631
+ /**
3632
+ * Checks if a date is in the provided list of dates.
3633
+ *
3634
+ * @param {Date[]} dates - The list of dates to check against.
3635
+ * @param {Date} date - The date to check.
3636
+ * @returns {boolean} Whether the date is in the list.
3637
+ */
3638
+ isDateInList(dates, date) {
3639
+ return dates.some(d => isSameDay(d, date));
3640
+ }
3641
+ /**
3642
+ * Removes a specific date from a list of dates.
3643
+ *
3644
+ * @param {Date[]} dates - The array of dates to filter.
3645
+ * @param {Date} dateToRemove - The date to remove from the array.
3646
+ * @returns {Date[]} A new array with the specified date removed.
3647
+ */
3648
+ removeDateFromSelection(dates, dateToRemove) {
3649
+ return dates.filter(d => !isSameDay(d, dateToRemove));
3650
+ }
3651
+ /**
3652
+ * Change the current month.
3653
+ *
3654
+ * @param {string} direction - 'prev' | 'next'
3655
+ */
3656
+ updateCurrentMonth(direction) {
3657
+ let newMonth = new Date(this.currentDate);
3658
+ if (direction === 'prev')
3659
+ newMonth = subMonths(this.currentDate, 1);
3660
+ if (direction === 'next')
3661
+ newMonth = addMonths(this.currentDate, 1);
3662
+ this.currentDate = newMonth;
3663
+ }
3664
+ /**
3665
+ * Handle the month dropdown change.
3666
+ *
3667
+ * @param {CustomEvent} event - The change event.
3668
+ */
3669
+ onMonthDropdownChange(event) {
3670
+ const { months } = this.fetchMonthNames();
3671
+ const newMonth = event.detail.value;
3672
+ this.selectMonth = newMonth;
3673
+ this.currentDate = new Date(getYear(this.currentDate), months.indexOf(newMonth), 1);
3674
+ }
3675
+ /**
3676
+ * Handle the year input change.
3677
+ *
3678
+ * @param {CustomEvent} event - The change event.
3679
+ */
3680
+ onYearDropdownChange(event) {
3681
+ const newYear = event.detail.value;
3682
+ this.selectYear = newYear;
3683
+ this.currentDate = new Date(newYear, getMonth(this.currentDate), 1);
3684
+ }
3685
+ /**
3686
+ * Flatten date ranges into individual dates.
3687
+ *
3688
+ * @param {({ from: string; to: string } | string)[]} dates - An array of date ranges or individual dates.
3689
+ * @returns {Date[]} An array of individual dates.
3690
+ */
3691
+ expandDateRanges(dates) {
3692
+ return dates.flatMap(date => {
3693
+ if (typeof date === 'string')
3694
+ return isValid(parseISO(date)) ? [parseISO(date)] : [];
3695
+ const start = parseISO(date.from);
3696
+ const end = parseISO(date.to);
3697
+ if (isValid(start) && isValid(end) && start <= end)
3698
+ return eachDayOfInterval({ start, end });
3699
+ return [];
3700
+ });
3701
+ }
3702
+ /**
3703
+ * Handle single date selection.
3704
+ *
3705
+ * @param {Date} date - The date to select.
3706
+ */
3707
+ selectSingleDate(date) {
3708
+ this.defaultDates = [];
3709
+ this.selectedDates = [date];
3710
+ }
3711
+ /**
3712
+ * Handle multiple date selection.
3713
+ *
3714
+ * @param {Date} date - The date to select or deselect.
3715
+ */
3716
+ selectMultiplesDate(date) {
3717
+ if (!this.isDateSelected(date) || !this.isDateInDefaultSelection(date))
3718
+ return this.selectedDates = [...this.selectedDates, date];
3719
+ this.selectedDates = this.removeDateFromSelection(this.selectedDates, date);
3720
+ this.defaultDates = this.removeDateFromSelection(this.defaultDates, date);
3721
+ }
3722
+ /**
3723
+ * Handle range date selection.
3724
+ *
3725
+ * @param {Date} date - The date to select.
3726
+ */
3727
+ selectDateRange(date) {
3728
+ this.defaultDates = [];
3729
+ const start = isBefore(this.rangeStart, date) ? this.rangeStart : date;
3730
+ const end = isAfter(this.rangeStart, date) ? this.rangeStart : date;
3731
+ const range = eachDayOfInterval({ start, end });
3732
+ if (!this.rangeStart || this.selectedDates.length === 2) {
3733
+ this.rangeStart = date;
3734
+ this.selectedDates = [date];
3735
+ return;
3736
+ }
3737
+ if (this.limitRange === null || range.length <= this.limitRange) {
3738
+ this.selectedDates = range;
3739
+ this.rangeStart = null;
3740
+ }
3741
+ }
3742
+ /**
3743
+ * Handle a click on a date.
3744
+ *
3745
+ * @param {Date} date - The date that was clicked.
3746
+ */
3747
+ onDateClick(date) {
3748
+ if (!this.isDateInValidPeriod(date) || this.isDateInDisabledPeriod(date) || !this.isDateInEnabledPeriod(date))
3749
+ return;
3750
+ const selectionHandlers = {
3751
+ single: this.selectSingleDate.bind(this),
3752
+ multiple: this.selectMultiplesDate.bind(this),
3753
+ range: this.selectDateRange.bind(this)
3754
+ };
3755
+ selectionHandlers[this.mode](date);
3756
+ this.onchangeday.emit({ days: [...this.defaultDates, ...this.selectedDates].filter(d => this.isDateInValidPeriod(d)) });
3757
+ }
3758
+ /**
3759
+ * Get the days of the week.
3760
+ *
3761
+ * @returns {string[]} An array of abbreviated day names.
3762
+ */
3763
+ fetchWeekDays() {
3764
+ const start = startOfWeek(new Date(2021, 0, 3), { locale: this.determineLocale() });
3765
+ const end = endOfWeek(new Date(2021, 0, 3), { locale: this.determineLocale() });
3766
+ return eachDayOfInterval({ start, end }).map(day => format(day, 'EEEEEE', { locale: this.determineLocale() }));
3767
+ }
3768
+ /**
3769
+ * Get the days of the current month, including leading nulls for alignment.
3770
+ *
3771
+ * @returns {(Date | null)[]} An array of dates and nulls for the current month view.
3772
+ */
3773
+ fetchDaysOfMonth() {
3774
+ const start = startOfMonth(this.currentDate);
3775
+ const end = endOfMonth(this.currentDate);
3776
+ const WEEKS_IN_CALENDAR_VIEW = 6;
3777
+ const DAYS_IN_CALENDAR_VIEW = 42;
3778
+ const daysIncurrentDate = eachDayOfInterval({ start, end });
3779
+ const prevMonthStart = startOfMonth(addMonths(start, -1));
3780
+ const prevMonthEnd = endOfMonth(prevMonthStart);
3781
+ const daysInPrevMonth = eachDayOfInterval({
3782
+ start: subDays(prevMonthEnd, getDay(start)),
3783
+ end: prevMonthEnd
3784
+ });
3785
+ const nextMonthStart = startOfMonth(addMonths(end, 1));
3786
+ const nextMonthEnd = endOfMonth(nextMonthStart);
3787
+ const remainingDays = WEEKS_IN_CALENDAR_VIEW - getDay(end);
3788
+ const daysInNextMonth = eachDayOfInterval({
3789
+ start: nextMonthStart,
3790
+ end: addDays(nextMonthEnd, remainingDays)
3791
+ });
3792
+ const totalDays = [
3793
+ ...daysInPrevMonth.slice(-getDay(start)),
3794
+ ...daysIncurrentDate,
3795
+ ...daysInNextMonth
3796
+ ];
3797
+ return totalDays.slice(0, DAYS_IN_CALENDAR_VIEW);
3798
+ }
3799
+ /**
3800
+ * Get the names of all months in the current year.
3801
+ *
3802
+ * @returns {{ months: string[], currentMonth: string }} An object containing an array of month names and the name of the current month.
3803
+ */
3804
+ fetchMonthNames() {
3805
+ const currentYear = getYear(this.currentDate);
3806
+ const locale = this.determineLocale();
3807
+ const months = eachMonthOfInterval({
3808
+ start: startOfYear(new Date(currentYear, 0, 1)),
3809
+ end: new Date(currentYear, 11, 31)
3810
+ }).map(month => format(month, 'MMMM', { locale }));
3811
+ const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
3812
+ return {
3813
+ months: months.map(capitalize),
3814
+ };
3815
+ }
3816
+ /**
3817
+ * Get a list of years in descending order from the current year to a specified limit.
3818
+ *
3819
+ * @returns {number[]} An array of years.
3820
+ */
3821
+ fetchYearList() {
3822
+ const currentYear = getYear(new Date());
3823
+ return Array.from({ length: 100 }, (_, i) => currentYear - i);
3824
+ }
3825
+ /**
3826
+ * Get the color for the previous button.
3827
+ *
3828
+ * @returns {string} The color name for the previous button.
3829
+ */
3830
+ determinePrevButtonColor() {
3831
+ const isPrevDisabled = isBefore(new Date(getYear(this.currentDate), getMonth(this.currentDate) - 1, 1), startOfMonth(new Date()));
3832
+ return isPrevDisabled ? 'neutral-light' : 'primary-base';
3833
+ }
3834
+ /**
3835
+ * Get the status of a given date, determining its position and interval status.
3836
+ *
3837
+ * @param {Date | null} date - The date to evaluate.
3838
+ * @returns {Object} An object containing the status flags for the date.
3839
+ */
3840
+ getDateStatus(date) {
3841
+ const [startSelected, endSelected] = [this.selectedDates[0], this.selectedDates[this.selectedDates.length - 1]];
3842
+ const [startDefault, endDefault] = [this.defaultDates[0], this.defaultDates[this.defaultDates.length - 1]];
3843
+ const hasSelectedDates = this.selectedDates.length > 1;
3844
+ const isDateInDefaultSelection = this.defaultDates.length > 1;
3845
+ const isStartSelected = this.isDateSelected(date) && isSameDay(date, startSelected);
3846
+ const isStartDefault = this.isDateInDefaultSelection(date) && isSameDay(date, startDefault);
3847
+ const isEndSelected = this.isDateSelected(date) && isSameDay(date, endSelected);
3848
+ const isEndDefault = this.isDateInDefaultSelection(date) && isSameDay(date, endDefault);
3849
+ const isStart = isStartSelected || isStartDefault;
3850
+ const isEnd = isEndSelected || isEndDefault;
3851
+ const selectedIntervals = this.expandDateRanges([{ from: startSelected === null || startSelected === void 0 ? void 0 : startSelected.toISOString(), to: endSelected === null || endSelected === void 0 ? void 0 : endSelected.toISOString() }]);
3852
+ const defaultIntervals = this.expandDateRanges([{ from: startDefault === null || startDefault === void 0 ? void 0 : startDefault.toISOString(), to: endDefault === null || endDefault === void 0 ? void 0 : endDefault.toISOString() }]);
3853
+ const intervalSelected = hasSelectedDates && this.isDateInList(selectedIntervals, date);
3854
+ const intervalDefault = isDateInDefaultSelection && this.isDateInList(defaultIntervals, date);
3855
+ const isValid = this.isDateInValidPeriod(date);
3856
+ const isInvalid = !isValid || this.isDateInDisabledPeriod(date) || !this.isDateInEnabledPeriod(date);
3857
+ const isSelected = this.isDateSelected(date);
3858
+ const isRange = this.mode === 'range' && (hasSelectedDates || isDateInDefaultSelection);
3859
+ const isDefault = this.mode !== 'range' && this.isDateInDefaultSelection(date);
3860
+ const isInterval = (intervalSelected || intervalDefault) && !isStart && !isEnd;
3861
+ return {
3862
+ isStart,
3863
+ isEnd,
3864
+ isValid,
3865
+ isInvalid,
3866
+ isSelected,
3867
+ isRange,
3868
+ isDefault,
3869
+ isInterval
3870
+ };
3871
+ }
3872
+ /**
3873
+ * Get the CSS classes for a given date based on its status.
3874
+ *
3875
+ * @param {Date | null} date - The date to evaluate.
3876
+ * @returns {Object} An object containing the CSS classes for the date.
3877
+ */
3878
+ getClasses(date) {
3879
+ const classes = { 'date': true };
3880
+ if (date === null)
3881
+ return classes;
3882
+ const dateStatus = this.getDateStatus(date);
3883
+ classes['today'] = isToday(date);
3884
+ classes['valid'] = dateStatus.isValid;
3885
+ classes['invalid'] = dateStatus.isInvalid;
3886
+ classes['selected'] = dateStatus.isSelected;
3887
+ classes['range'] = dateStatus.isRange;
3888
+ classes['default-dates'] = dateStatus.isDefault;
3889
+ classes['start'] = dateStatus.isStart;
3890
+ classes['interval'] = dateStatus.isInterval;
3891
+ classes['end'] = dateStatus.isEnd;
3892
+ return classes;
3893
+ }
3894
+ /**
3895
+ * Get custom CSS properties for the host element.
3896
+ *
3897
+ * @returns {Object} An object containing CSS properties and their values.
3898
+ */
3899
+ getHostCSSProperties() {
3900
+ return {
3901
+ '--width': this.width,
3902
+ };
3903
+ }
3904
+ render() {
3905
+ const { months } = this.fetchMonthNames();
3906
+ return (index.h(index.Host, { key: '7219f5c7370d5f51eaca3893ee5d9378b3bb9cf5', style: this.getHostCSSProperties() }, index.h("div", { key: 'c1a1a5f3af3c1f782e8db1b768e4d2c3d00e7cfe', class: "calendar", style: this.styles }, index.h("header", { key: 'a31b15cb3c58a952476370fe10fd546083e3de13', class: "header" }, index.h("div", { key: '0f4f3113996c4d43477ef9dbed3f94b54f0f1e18', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, index.h("cura-icon", { key: '1aab96a34d0265cf18d54c77d0f874e11e1ebbfc', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: () => this.updateCurrentMonth('prev') }), this.type === 'dropdown' ? (index.h("div", { class: "select" }, index.h("cura-select", { class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: (e) => this.onMonthDropdownChange(e) }, months.map((month, index$1) => (index.h("cura-select-option", { key: index$1, value: month }, month)))), index.h("cura-select", { class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: (e) => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index$1) => (index.h("cura-select-option", { key: index$1, value: year.toString() }, year.toString())))))) : (index.h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), index.h("cura-icon", { key: 'bbf1cabd623f27736c1acb29479f8bd3e4d9d465', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: () => this.updateCurrentMonth('next') }))), index.h("span", { key: '05eb9071b488607a2e6a40b687a074150382e81e', class: "days-of-week" }, this.fetchWeekDays().map((day, index$1) => (index.h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: 'bold', key: index$1 }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), index.h("div", { key: '1a107295063579356f75ee714b712cb265e408eb', class: "dates" }, this.fetchDaysOfMonth().map((day, index$1) => (index.h("div", { key: index$1, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))))));
3907
+ }
3908
+ };
3909
+ CuraCalendar.style = CuraCalendarStyle0;
3910
+
3911
+ exports.cura_calendar = CuraCalendar;
3912
+
3913
+ //# sourceMappingURL=cura-calendar.cjs.entry.js.map