@blateral/b.kit 2.4.2 → 2.5.0-beta.1.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 (845) hide show
  1. package/cjs/Actions-c7b16449.js +2 -0
  2. package/cjs/Actions-c7b16449.js.map +1 -0
  3. package/cjs/Bdot-5f8e0450.js +2 -0
  4. package/cjs/Bdot-5f8e0450.js.map +1 -0
  5. package/cjs/Button-51ea72b7.js +2 -0
  6. package/cjs/Button-51ea72b7.js.map +1 -0
  7. package/cjs/ButtonGhost-628bbd60.js +2 -0
  8. package/cjs/ButtonGhost-628bbd60.js.map +1 -0
  9. package/cjs/Callout-5dd16679.js +2 -0
  10. package/cjs/Callout-5dd16679.js.map +1 -0
  11. package/cjs/Checkbox-1c34c7e6.js +2 -0
  12. package/cjs/Checkbox-1c34c7e6.js.map +1 -0
  13. package/cjs/ClockFilled-2483aa4a.js +2 -0
  14. package/cjs/ClockFilled-2483aa4a.js.map +1 -0
  15. package/cjs/Control-08d09950.js +2 -0
  16. package/cjs/Control-08d09950.js.map +1 -0
  17. package/cjs/Copy-ea6ab025.js +2 -0
  18. package/cjs/Copy-ea6ab025.js.map +1 -0
  19. package/cjs/EventBlock-d191a8ae.js +2 -0
  20. package/cjs/EventBlock-d191a8ae.js.map +1 -0
  21. package/cjs/Filter-d6d90b8b.js +2 -0
  22. package/cjs/Filter-d6d90b8b.js.map +1 -0
  23. package/cjs/FilterField-b1547fb4.js +2 -0
  24. package/cjs/FilterField-b1547fb4.js.map +1 -0
  25. package/cjs/Grid-6f4f99bc.js +2 -0
  26. package/cjs/Grid-6f4f99bc.js.map +1 -0
  27. package/cjs/Image-c72f7a80.js +2 -0
  28. package/cjs/Image-c72f7a80.js.map +1 -0
  29. package/cjs/InfoList-71d3388a.js +2 -0
  30. package/cjs/InfoList-71d3388a.js.map +1 -0
  31. package/cjs/LanguageSwitcher-8fdd22ba.js +2 -0
  32. package/cjs/LanguageSwitcher-8fdd22ba.js.map +1 -0
  33. package/cjs/LibThemeProvider-4823de57.js +2 -0
  34. package/cjs/LibThemeProvider-4823de57.js.map +1 -0
  35. package/cjs/Link-5a6f1633.js +2 -0
  36. package/cjs/Link-5a6f1633.js.map +1 -0
  37. package/cjs/Navigation-ca78100c.js +2 -0
  38. package/cjs/Navigation-ca78100c.js.map +1 -0
  39. package/cjs/POICard-e46f9041.js +2 -0
  40. package/cjs/POICard-e46f9041.js.map +1 -0
  41. package/cjs/Pointer-fde7b548.js +2 -0
  42. package/cjs/Pointer-fde7b548.js.map +1 -0
  43. package/cjs/Section-e8e8cf81.js +2 -0
  44. package/cjs/Section-e8e8cf81.js.map +1 -0
  45. package/cjs/SocialList-1d5f75a8.js +2 -0
  46. package/cjs/SocialList-1d5f75a8.js.map +1 -0
  47. package/cjs/TableBlock-007f8e34.js +2 -0
  48. package/cjs/TableBlock-007f8e34.js.map +1 -0
  49. package/cjs/Tag-9238cf0c.js +2 -0
  50. package/cjs/Tag-9238cf0c.js.map +1 -0
  51. package/cjs/Textarea-485efa2d.js +2 -0
  52. package/cjs/Textarea-485efa2d.js.map +1 -0
  53. package/cjs/Textfield-56996c98.js +2 -0
  54. package/cjs/Textfield-56996c98.js.map +1 -0
  55. package/cjs/VideoBlock-a7d6ff7d.js +2 -0
  56. package/cjs/VideoBlock-a7d6ff7d.js.map +1 -0
  57. package/cjs/VideoCard-d48a37fe.js +2 -0
  58. package/cjs/VideoCard-d48a37fe.js.map +1 -0
  59. package/cjs/Wrapper-ff6854d7.js +2 -0
  60. package/cjs/Wrapper-ff6854d7.js.map +1 -0
  61. package/cjs/arrays-c272ed59.js +2 -0
  62. package/cjs/arrays-c272ed59.js.map +1 -0
  63. package/cjs/base.js +2 -0
  64. package/cjs/base.js.map +1 -0
  65. package/cjs/blocks.js +2 -0
  66. package/cjs/blocks.js.map +1 -0
  67. package/cjs/buttons.js +2 -0
  68. package/cjs/buttons.js.map +1 -0
  69. package/cjs/clamp-bd21d587.js +2 -0
  70. package/cjs/clamp-bd21d587.js.map +1 -0
  71. package/cjs/concat-f387d848.js +2 -0
  72. package/cjs/concat-f387d848.js.map +1 -0
  73. package/cjs/cookies.js +2 -0
  74. package/cjs/cookies.js.map +1 -0
  75. package/cjs/escape-1ef8dd83.js +2 -0
  76. package/cjs/escape-1ef8dd83.js.map +1 -0
  77. package/cjs/fields.js +2 -0
  78. package/cjs/fields.js.map +1 -0
  79. package/cjs/footer.js +2 -0
  80. package/cjs/footer.js.map +1 -0
  81. package/cjs/headers.js +2 -0
  82. package/cjs/headers.js.map +1 -0
  83. package/cjs/hexRgbConverter-91b28aea.js +2 -0
  84. package/cjs/hexRgbConverter-91b28aea.js.map +1 -0
  85. package/cjs/hooks.js +2 -0
  86. package/cjs/hooks.js.map +1 -0
  87. package/cjs/icons.js +2 -0
  88. package/cjs/icons.js.map +1 -0
  89. package/cjs/index.js +2 -0
  90. package/cjs/index.js.map +1 -0
  91. package/cjs/navigation-389b22e2.js +2 -0
  92. package/cjs/navigation-389b22e2.js.map +1 -0
  93. package/cjs/navigation.js +2 -0
  94. package/cjs/navigation.js.map +1 -0
  95. package/cjs/sections.dynamicform.js +2 -0
  96. package/cjs/sections.dynamicform.js.map +1 -0
  97. package/cjs/sections.events.js +2 -0
  98. package/cjs/sections.events.js.map +1 -0
  99. package/cjs/sections.forms.js +2 -0
  100. package/cjs/sections.forms.js.map +1 -0
  101. package/cjs/sections.jobs.js +2 -0
  102. package/cjs/sections.jobs.js.map +1 -0
  103. package/cjs/sections.js +2 -0
  104. package/cjs/sections.js.map +1 -0
  105. package/cjs/sections.news.js +2 -0
  106. package/cjs/sections.news.js.map +1 -0
  107. package/cjs/sections.pois.js +2 -0
  108. package/cjs/sections.pois.js.map +1 -0
  109. package/cjs/statusFormatter-0393122b.js +2 -0
  110. package/cjs/statusFormatter-0393122b.js.map +1 -0
  111. package/cjs/structuredData-0b1278a9.js +2 -0
  112. package/cjs/structuredData-0b1278a9.js.map +1 -0
  113. package/cjs/styles-3a495a2d.js +2 -0
  114. package/cjs/styles-3a495a2d.js.map +1 -0
  115. package/cjs/typography.js +2 -0
  116. package/cjs/typography.js.map +1 -0
  117. package/cjs/urlParams-7525f638.js +2 -0
  118. package/cjs/urlParams-7525f638.js.map +1 -0
  119. package/cjs/useCookieConsent-1af2af74.js +2 -0
  120. package/cjs/useCookieConsent-1af2af74.js.map +1 -0
  121. package/cjs/useEqualSheetHeight-8f92c912.js +2 -0
  122. package/cjs/useEqualSheetHeight-8f92c912.js.map +1 -0
  123. package/cjs/useGeolocation-d8946470.js +2 -0
  124. package/cjs/useGeolocation-d8946470.js.map +1 -0
  125. package/cjs/useLazyInput-0b912584.js +2 -0
  126. package/cjs/useLazyInput-0b912584.js.map +1 -0
  127. package/cjs/useLeafletMap-2e608b01.js +2 -0
  128. package/cjs/useLeafletMap-2e608b01.js.map +1 -0
  129. package/cjs/useMediaQuery-0bd70e6a.js +2 -0
  130. package/cjs/useMediaQuery-0bd70e6a.js.map +1 -0
  131. package/cjs/useMounted-0bba9869.js +2 -0
  132. package/cjs/useMounted-0bba9869.js.map +1 -0
  133. package/cjs/useObserverSupport-5ab320dd.js +2 -0
  134. package/cjs/useObserverSupport-5ab320dd.js.map +1 -0
  135. package/cjs/useScrollTo-fdd665da.js +2 -0
  136. package/cjs/useScrollTo-fdd665da.js.map +1 -0
  137. package/cjs/useUpdateEffect-4d233e2c.js +2 -0
  138. package/cjs/useUpdateEffect-4d233e2c.js.map +1 -0
  139. package/esm/Actions-21372b3a.js +57 -0
  140. package/esm/Actions-21372b3a.js.map +1 -0
  141. package/esm/Bdot-4db38753.js +24 -0
  142. package/esm/Bdot-4db38753.js.map +1 -0
  143. package/esm/Button-f9279013.js +115 -0
  144. package/esm/Button-f9279013.js.map +1 -0
  145. package/esm/ButtonGhost-ae2e97a2.js +112 -0
  146. package/esm/ButtonGhost-ae2e97a2.js.map +1 -0
  147. package/esm/Callout-a926194d.js +99 -0
  148. package/esm/Callout-a926194d.js.map +1 -0
  149. package/esm/Checkbox-dd12facd.js +135 -0
  150. package/esm/Checkbox-dd12facd.js.map +1 -0
  151. package/esm/ClockFilled-62515a8f.js +1793 -0
  152. package/esm/ClockFilled-62515a8f.js.map +1 -0
  153. package/esm/Control-2d605e12.js +52 -0
  154. package/esm/Control-2d605e12.js.map +1 -0
  155. package/esm/Copy-a28aeb61.js +270 -0
  156. package/esm/Copy-a28aeb61.js.map +1 -0
  157. package/esm/EventBlock-41d68d0a.js +136 -0
  158. package/esm/EventBlock-41d68d0a.js.map +1 -0
  159. package/esm/Filter-2b5f5e53.js +32 -0
  160. package/esm/Filter-2b5f5e53.js.map +1 -0
  161. package/esm/FilterField-7805bdb4.js +129 -0
  162. package/esm/FilterField-7805bdb4.js.map +1 -0
  163. package/esm/Grid-5eec127f.js +203 -0
  164. package/esm/Grid-5eec127f.js.map +1 -0
  165. package/esm/Image-dc2b33c1.js +193 -0
  166. package/esm/Image-dc2b33c1.js.map +1 -0
  167. package/esm/InfoList-5c4586ed.js +74 -0
  168. package/esm/InfoList-5c4586ed.js.map +1 -0
  169. package/esm/LanguageSwitcher-3fa20077.js +70 -0
  170. package/esm/LanguageSwitcher-3fa20077.js.map +1 -0
  171. package/esm/LibThemeProvider-52555ac9.js +115 -0
  172. package/esm/LibThemeProvider-52555ac9.js.map +1 -0
  173. package/esm/Link-3fd9c9b8.js +60 -0
  174. package/esm/Link-3fd9c9b8.js.map +1 -0
  175. package/esm/Navigation-3ded0cfc.js +1713 -0
  176. package/esm/Navigation-3ded0cfc.js.map +1 -0
  177. package/esm/POICard-96ec71d8.js +116 -0
  178. package/esm/POICard-96ec71d8.js.map +1 -0
  179. package/esm/Pointer-5c77b1f1.js +111 -0
  180. package/esm/Pointer-5c77b1f1.js.map +1 -0
  181. package/esm/Section-b76e6909.js +185 -0
  182. package/esm/Section-b76e6909.js.map +1 -0
  183. package/esm/SocialList-402b8f20.js +61 -0
  184. package/esm/SocialList-402b8f20.js.map +1 -0
  185. package/esm/TableBlock-cc49e089.js +159 -0
  186. package/esm/TableBlock-cc49e089.js.map +1 -0
  187. package/esm/Tag-ac51e916.js +67 -0
  188. package/esm/Tag-ac51e916.js.map +1 -0
  189. package/esm/Textarea-380665db.js +4598 -0
  190. package/esm/Textarea-380665db.js.map +1 -0
  191. package/esm/Textfield-d2f201a9.js +202 -0
  192. package/esm/Textfield-d2f201a9.js.map +1 -0
  193. package/esm/VideoBlock-5fe94711.js +260 -0
  194. package/esm/VideoBlock-5fe94711.js.map +1 -0
  195. package/esm/VideoCard-784c2a51.js +160 -0
  196. package/esm/VideoCard-784c2a51.js.map +1 -0
  197. package/esm/Wrapper-90dccc89.js +45 -0
  198. package/esm/Wrapper-90dccc89.js.map +1 -0
  199. package/esm/arrays-65b644ef.js +17 -0
  200. package/esm/arrays-65b644ef.js.map +1 -0
  201. package/esm/base.js +12 -0
  202. package/esm/base.js.map +1 -0
  203. package/esm/blocks.js +23 -0
  204. package/esm/blocks.js.map +1 -0
  205. package/esm/buttons.js +12 -0
  206. package/esm/buttons.js.map +1 -0
  207. package/esm/clamp-12d37b65.js +10 -0
  208. package/esm/clamp-12d37b65.js.map +1 -0
  209. package/esm/concat-ab3c66f2.js +40 -0
  210. package/esm/concat-ab3c66f2.js.map +1 -0
  211. package/esm/cookies.js +269 -0
  212. package/esm/cookies.js.map +1 -0
  213. package/esm/escape-cbff9c25.js +6 -0
  214. package/esm/escape-cbff9c25.js.map +1 -0
  215. package/esm/fields.js +191 -0
  216. package/esm/fields.js.map +1 -0
  217. package/esm/footer.js +302 -0
  218. package/esm/footer.js.map +1 -0
  219. package/esm/headers.js +639 -0
  220. package/esm/headers.js.map +1 -0
  221. package/esm/hexRgbConverter-edb91624.js +36 -0
  222. package/esm/hexRgbConverter-edb91624.js.map +1 -0
  223. package/esm/hooks.js +372 -0
  224. package/esm/hooks.js.map +1 -0
  225. package/esm/icons.js +70 -0
  226. package/esm/icons.js.map +1 -0
  227. package/esm/index.js +7 -0
  228. package/esm/index.js.map +1 -0
  229. package/esm/navigation-ada7fd84.js +82 -0
  230. package/esm/navigation-ada7fd84.js.map +1 -0
  231. package/esm/navigation.js +159 -0
  232. package/esm/navigation.js.map +1 -0
  233. package/esm/sections.dynamicform.js +1144 -0
  234. package/esm/sections.dynamicform.js.map +1 -0
  235. package/esm/sections.events.js +623 -0
  236. package/esm/sections.events.js.map +1 -0
  237. package/esm/sections.forms.js +283 -0
  238. package/esm/sections.forms.js.map +1 -0
  239. package/esm/sections.jobs.js +509 -0
  240. package/esm/sections.jobs.js.map +1 -0
  241. package/esm/sections.js +3740 -0
  242. package/esm/sections.js.map +1 -0
  243. package/esm/sections.news.js +1024 -0
  244. package/esm/sections.news.js.map +1 -0
  245. package/esm/sections.pois.js +720 -0
  246. package/esm/sections.pois.js.map +1 -0
  247. package/esm/statusFormatter-9be0fbff.js +255 -0
  248. package/esm/statusFormatter-9be0fbff.js.map +1 -0
  249. package/esm/structuredData-abf610d8.js +117 -0
  250. package/esm/structuredData-abf610d8.js.map +1 -0
  251. package/esm/styles-da982973.js +467 -0
  252. package/esm/styles-da982973.js.map +1 -0
  253. package/esm/typography.js +11 -0
  254. package/esm/typography.js.map +1 -0
  255. package/esm/urlParams-9cfdaf71.js +51 -0
  256. package/esm/urlParams-9cfdaf71.js.map +1 -0
  257. package/esm/useCookieConsent-0fc8667c.js +339 -0
  258. package/esm/useCookieConsent-0fc8667c.js.map +1 -0
  259. package/esm/useEqualSheetHeight-4030635e.js +199 -0
  260. package/esm/useEqualSheetHeight-4030635e.js.map +1 -0
  261. package/esm/useGeolocation-f9f073cc.js +95 -0
  262. package/esm/useGeolocation-f9f073cc.js.map +1 -0
  263. package/esm/useLazyInput-16a0b633.js +85 -0
  264. package/esm/useLazyInput-16a0b633.js.map +1 -0
  265. package/esm/useLeafletMap-84170d32.js +300 -0
  266. package/esm/useLeafletMap-84170d32.js.map +1 -0
  267. package/esm/useMediaQuery-b08dda62.js +159 -0
  268. package/esm/useMediaQuery-b08dda62.js.map +1 -0
  269. package/esm/useMounted-1e4cc87b.js +12 -0
  270. package/esm/useMounted-1e4cc87b.js.map +1 -0
  271. package/esm/useObserverSupport-02bce7f5.js +19 -0
  272. package/esm/useObserverSupport-02bce7f5.js.map +1 -0
  273. package/esm/useScrollTo-70af34bf.js +57 -0
  274. package/esm/useScrollTo-70af34bf.js.map +1 -0
  275. package/esm/useUpdateEffect-824c0c84.js +18 -0
  276. package/esm/useUpdateEffect-824c0c84.js.map +1 -0
  277. package/lib/base/package.json +7 -0
  278. package/lib/blocks/package.json +7 -0
  279. package/lib/buttons/package.json +7 -0
  280. package/lib/cookies/package.json +7 -0
  281. package/lib/fields/package.json +7 -0
  282. package/lib/footer/package.json +7 -0
  283. package/lib/headers/package.json +7 -0
  284. package/lib/hooks/package.json +7 -0
  285. package/lib/icons/package.json +7 -0
  286. package/lib/navigation/package.json +7 -0
  287. package/lib/sections/package.json +7 -0
  288. package/lib/sections.dynamicform/package.json +7 -0
  289. package/lib/sections.events/package.json +7 -0
  290. package/lib/sections.forms/package.json +7 -0
  291. package/lib/sections.jobs/package.json +7 -0
  292. package/lib/sections.news/package.json +7 -0
  293. package/lib/sections.pois/package.json +7 -0
  294. package/lib/typography/package.json +7 -0
  295. package/package.json +10 -6
  296. package/types/base.d.ts +5 -0
  297. package/types/base.d.ts.map +1 -0
  298. package/types/blocks.d.ts +16 -0
  299. package/types/blocks.d.ts.map +1 -0
  300. package/types/buttons.d.ts +6 -0
  301. package/types/buttons.d.ts.map +1 -0
  302. package/types/components/sections/navigation/menu/variations/MenuFlyout.d.ts.map +1 -0
  303. package/types/components/sections/navigation/menu/variations/MenuLarge.d.ts.map +1 -0
  304. package/types/cookies.d.ts +2 -0
  305. package/types/cookies.d.ts.map +1 -0
  306. package/types/fields.d.ts +14 -0
  307. package/types/fields.d.ts.map +1 -0
  308. package/types/footer.d.ts +5 -0
  309. package/types/footer.d.ts.map +1 -0
  310. package/types/headers.d.ts +5 -0
  311. package/types/headers.d.ts.map +1 -0
  312. package/types/hooks.d.ts +37 -0
  313. package/types/hooks.d.ts.map +1 -0
  314. package/types/icons.d.ts +3 -0
  315. package/types/icons.d.ts.map +1 -0
  316. package/types/index.d.ts +18 -0
  317. package/types/index.d.ts.map +1 -0
  318. package/types/navigation.d.ts +10 -0
  319. package/types/navigation.d.ts.map +1 -0
  320. package/types/sections.d.ts +32 -0
  321. package/types/sections.d.ts.map +1 -0
  322. package/types/sections.dynamicform.d.ts +2 -0
  323. package/types/sections.dynamicform.d.ts.map +1 -0
  324. package/types/sections.events.d.ts +4 -0
  325. package/types/sections.events.d.ts.map +1 -0
  326. package/types/sections.forms.d.ts +2 -0
  327. package/types/sections.forms.d.ts.map +1 -0
  328. package/types/sections.jobs.d.ts +3 -0
  329. package/types/sections.jobs.d.ts.map +1 -0
  330. package/types/sections.news.d.ts +10 -0
  331. package/types/sections.news.d.ts.map +1 -0
  332. package/types/sections.pois.d.ts +4 -0
  333. package/types/sections.pois.d.ts.map +1 -0
  334. package/types/typography.d.ts +6 -0
  335. package/types/typography.d.ts.map +1 -0
  336. package/lib/components/sections/navigation/menu/variations/MenuFlyout.d.ts.map +0 -1
  337. package/lib/components/sections/navigation/menu/variations/MenuLarge.d.ts.map +0 -1
  338. package/lib/index.d.ts +0 -158
  339. package/lib/index.d.ts.map +0 -1
  340. package/lib/index.es.js +0 -2
  341. package/lib/index.es.js.map +0 -1
  342. package/lib/index.js +0 -2
  343. package/lib/index.js.map +0 -1
  344. /package/{lib → types}/components/base/Grid.d.ts +0 -0
  345. /package/{lib → types}/components/base/Grid.d.ts.map +0 -0
  346. /package/{lib → types}/components/base/Section.d.ts +0 -0
  347. /package/{lib → types}/components/base/Section.d.ts.map +0 -0
  348. /package/{lib → types}/components/base/Wrapper.d.ts +0 -0
  349. /package/{lib → types}/components/base/Wrapper.d.ts.map +0 -0
  350. /package/{lib → types}/components/base/icons/AngleDown.d.ts +0 -0
  351. /package/{lib → types}/components/base/icons/AngleDown.d.ts.map +0 -0
  352. /package/{lib → types}/components/base/icons/AngleLeft.d.ts +0 -0
  353. /package/{lib → types}/components/base/icons/AngleLeft.d.ts.map +0 -0
  354. /package/{lib → types}/components/base/icons/AngleRight.d.ts +0 -0
  355. /package/{lib → types}/components/base/icons/AngleRight.d.ts.map +0 -0
  356. /package/{lib → types}/components/base/icons/AngleUp.d.ts +0 -0
  357. /package/{lib → types}/components/base/icons/AngleUp.d.ts.map +0 -0
  358. /package/{lib → types}/components/base/icons/ArrowDown.d.ts +0 -0
  359. /package/{lib → types}/components/base/icons/ArrowDown.d.ts.map +0 -0
  360. /package/{lib → types}/components/base/icons/ArrowLeft.d.ts +0 -0
  361. /package/{lib → types}/components/base/icons/ArrowLeft.d.ts.map +0 -0
  362. /package/{lib → types}/components/base/icons/ArrowLeftGhost.d.ts +0 -0
  363. /package/{lib → types}/components/base/icons/ArrowLeftGhost.d.ts.map +0 -0
  364. /package/{lib → types}/components/base/icons/ArrowLeftRight.d.ts +0 -0
  365. /package/{lib → types}/components/base/icons/ArrowLeftRight.d.ts.map +0 -0
  366. /package/{lib → types}/components/base/icons/ArrowRight.d.ts +0 -0
  367. /package/{lib → types}/components/base/icons/ArrowRight.d.ts.map +0 -0
  368. /package/{lib → types}/components/base/icons/ArrowRightGhost.d.ts +0 -0
  369. /package/{lib → types}/components/base/icons/ArrowRightGhost.d.ts.map +0 -0
  370. /package/{lib → types}/components/base/icons/ArrowUp.d.ts +0 -0
  371. /package/{lib → types}/components/base/icons/ArrowUp.d.ts.map +0 -0
  372. /package/{lib → types}/components/base/icons/BoxArrowUpRight.d.ts +0 -0
  373. /package/{lib → types}/components/base/icons/BoxArrowUpRight.d.ts.map +0 -0
  374. /package/{lib → types}/components/base/icons/CalendarToday.d.ts +0 -0
  375. /package/{lib → types}/components/base/icons/CalendarToday.d.ts.map +0 -0
  376. /package/{lib → types}/components/base/icons/Category.d.ts +0 -0
  377. /package/{lib → types}/components/base/icons/Category.d.ts.map +0 -0
  378. /package/{lib → types}/components/base/icons/Check.d.ts +0 -0
  379. /package/{lib → types}/components/base/icons/Check.d.ts.map +0 -0
  380. /package/{lib → types}/components/base/icons/Clock.d.ts +0 -0
  381. /package/{lib → types}/components/base/icons/Clock.d.ts.map +0 -0
  382. /package/{lib → types}/components/base/icons/ClockFilled.d.ts +0 -0
  383. /package/{lib → types}/components/base/icons/ClockFilled.d.ts.map +0 -0
  384. /package/{lib → types}/components/base/icons/Computer.d.ts +0 -0
  385. /package/{lib → types}/components/base/icons/Computer.d.ts.map +0 -0
  386. /package/{lib → types}/components/base/icons/Cross.d.ts +0 -0
  387. /package/{lib → types}/components/base/icons/Cross.d.ts.map +0 -0
  388. /package/{lib → types}/components/base/icons/CrossSmall.d.ts +0 -0
  389. /package/{lib → types}/components/base/icons/CrossSmall.d.ts.map +0 -0
  390. /package/{lib → types}/components/base/icons/CurrentLocation.d.ts +0 -0
  391. /package/{lib → types}/components/base/icons/CurrentLocation.d.ts.map +0 -0
  392. /package/{lib → types}/components/base/icons/DateRange.d.ts +0 -0
  393. /package/{lib → types}/components/base/icons/DateRange.d.ts.map +0 -0
  394. /package/{lib → types}/components/base/icons/DeleteForever.d.ts +0 -0
  395. /package/{lib → types}/components/base/icons/DeleteForever.d.ts.map +0 -0
  396. /package/{lib → types}/components/base/icons/External.d.ts +0 -0
  397. /package/{lib → types}/components/base/icons/External.d.ts.map +0 -0
  398. /package/{lib → types}/components/base/icons/Filter.d.ts +0 -0
  399. /package/{lib → types}/components/base/icons/Filter.d.ts.map +0 -0
  400. /package/{lib → types}/components/base/icons/FlyTo.d.ts +0 -0
  401. /package/{lib → types}/components/base/icons/FlyTo.d.ts.map +0 -0
  402. /package/{lib → types}/components/base/icons/Icons.d.ts +0 -0
  403. /package/{lib → types}/components/base/icons/Icons.d.ts.map +0 -0
  404. /package/{lib → types}/components/base/icons/Info.d.ts +0 -0
  405. /package/{lib → types}/components/base/icons/Info.d.ts.map +0 -0
  406. /package/{lib → types}/components/base/icons/Language.d.ts +0 -0
  407. /package/{lib → types}/components/base/icons/Language.d.ts.map +0 -0
  408. /package/{lib → types}/components/base/icons/LocationPin.d.ts +0 -0
  409. /package/{lib → types}/components/base/icons/LocationPin.d.ts.map +0 -0
  410. /package/{lib → types}/components/base/icons/LocationSearch.d.ts +0 -0
  411. /package/{lib → types}/components/base/icons/LocationSearch.d.ts.map +0 -0
  412. /package/{lib → types}/components/base/icons/Magnifier.d.ts +0 -0
  413. /package/{lib → types}/components/base/icons/Magnifier.d.ts.map +0 -0
  414. /package/{lib → types}/components/base/icons/Mail.d.ts +0 -0
  415. /package/{lib → types}/components/base/icons/Mail.d.ts.map +0 -0
  416. /package/{lib → types}/components/base/icons/Map.d.ts +0 -0
  417. /package/{lib → types}/components/base/icons/Map.d.ts.map +0 -0
  418. /package/{lib → types}/components/base/icons/MenuBurger.d.ts +0 -0
  419. /package/{lib → types}/components/base/icons/MenuBurger.d.ts.map +0 -0
  420. /package/{lib → types}/components/base/icons/Minus.d.ts +0 -0
  421. /package/{lib → types}/components/base/icons/Minus.d.ts.map +0 -0
  422. /package/{lib → types}/components/base/icons/Money.d.ts +0 -0
  423. /package/{lib → types}/components/base/icons/Money.d.ts.map +0 -0
  424. /package/{lib → types}/components/base/icons/MyLocation.d.ts +0 -0
  425. /package/{lib → types}/components/base/icons/MyLocation.d.ts.map +0 -0
  426. /package/{lib → types}/components/base/icons/Person.d.ts +0 -0
  427. /package/{lib → types}/components/base/icons/Person.d.ts.map +0 -0
  428. /package/{lib → types}/components/base/icons/Phone.d.ts +0 -0
  429. /package/{lib → types}/components/base/icons/Phone.d.ts.map +0 -0
  430. /package/{lib → types}/components/base/icons/Place.d.ts +0 -0
  431. /package/{lib → types}/components/base/icons/Place.d.ts.map +0 -0
  432. /package/{lib → types}/components/base/icons/Play.d.ts +0 -0
  433. /package/{lib → types}/components/base/icons/Play.d.ts.map +0 -0
  434. /package/{lib → types}/components/base/icons/Plus.d.ts +0 -0
  435. /package/{lib → types}/components/base/icons/Plus.d.ts.map +0 -0
  436. /package/{lib → types}/components/base/icons/Route.d.ts +0 -0
  437. /package/{lib → types}/components/base/icons/Route.d.ts.map +0 -0
  438. /package/{lib → types}/components/base/icons/Star.d.ts +0 -0
  439. /package/{lib → types}/components/base/icons/Star.d.ts.map +0 -0
  440. /package/{lib → types}/components/base/icons/ToggleOff.d.ts +0 -0
  441. /package/{lib → types}/components/base/icons/ToggleOff.d.ts.map +0 -0
  442. /package/{lib → types}/components/base/icons/ToggleOn.d.ts +0 -0
  443. /package/{lib → types}/components/base/icons/ToggleOn.d.ts.map +0 -0
  444. /package/{lib → types}/components/base/icons/UnfoldMore.d.ts +0 -0
  445. /package/{lib → types}/components/base/icons/UnfoldMore.d.ts.map +0 -0
  446. /package/{lib → types}/components/base/icons/files/Excel.d.ts +0 -0
  447. /package/{lib → types}/components/base/icons/files/Excel.d.ts.map +0 -0
  448. /package/{lib → types}/components/base/icons/files/Image.d.ts +0 -0
  449. /package/{lib → types}/components/base/icons/files/Image.d.ts.map +0 -0
  450. /package/{lib → types}/components/base/icons/files/Pdf.d.ts +0 -0
  451. /package/{lib → types}/components/base/icons/files/Pdf.d.ts.map +0 -0
  452. /package/{lib → types}/components/base/icons/files/PowerPoint.d.ts +0 -0
  453. /package/{lib → types}/components/base/icons/files/PowerPoint.d.ts.map +0 -0
  454. /package/{lib → types}/components/base/icons/files/UploadFile.d.ts +0 -0
  455. /package/{lib → types}/components/base/icons/files/UploadFile.d.ts.map +0 -0
  456. /package/{lib → types}/components/base/icons/files/Word.d.ts +0 -0
  457. /package/{lib → types}/components/base/icons/files/Word.d.ts.map +0 -0
  458. /package/{lib → types}/components/base/icons/files/Zip.d.ts +0 -0
  459. /package/{lib → types}/components/base/icons/files/Zip.d.ts.map +0 -0
  460. /package/{lib → types}/components/base/icons/socials/Facebook.d.ts +0 -0
  461. /package/{lib → types}/components/base/icons/socials/Facebook.d.ts.map +0 -0
  462. /package/{lib → types}/components/base/icons/socials/Instagram.d.ts +0 -0
  463. /package/{lib → types}/components/base/icons/socials/Instagram.d.ts.map +0 -0
  464. /package/{lib → types}/components/base/icons/socials/LinkedIn.d.ts +0 -0
  465. /package/{lib → types}/components/base/icons/socials/LinkedIn.d.ts.map +0 -0
  466. /package/{lib → types}/components/base/icons/socials/Twitter.d.ts +0 -0
  467. /package/{lib → types}/components/base/icons/socials/Twitter.d.ts.map +0 -0
  468. /package/{lib → types}/components/base/icons/socials/Xing.d.ts +0 -0
  469. /package/{lib → types}/components/base/icons/socials/Xing.d.ts.map +0 -0
  470. /package/{lib → types}/components/base/icons/socials/Youtube.d.ts +0 -0
  471. /package/{lib → types}/components/base/icons/socials/Youtube.d.ts.map +0 -0
  472. /package/{lib → types}/components/base/nl2br.d.ts +0 -0
  473. /package/{lib → types}/components/base/nl2br.d.ts.map +0 -0
  474. /package/{lib → types}/components/blocks/Actions.d.ts +0 -0
  475. /package/{lib → types}/components/blocks/Actions.d.ts.map +0 -0
  476. /package/{lib → types}/components/blocks/Alert.d.ts +0 -0
  477. /package/{lib → types}/components/blocks/Alert.d.ts.map +0 -0
  478. /package/{lib → types}/components/blocks/Bdot.d.ts +0 -0
  479. /package/{lib → types}/components/blocks/Bdot.d.ts.map +0 -0
  480. /package/{lib → types}/components/blocks/CookieConsent.d.ts +0 -0
  481. /package/{lib → types}/components/blocks/CookieConsent.d.ts.map +0 -0
  482. /package/{lib → types}/components/blocks/EventBlock.d.ts +0 -0
  483. /package/{lib → types}/components/blocks/EventBlock.d.ts.map +0 -0
  484. /package/{lib → types}/components/blocks/Fact.d.ts +0 -0
  485. /package/{lib → types}/components/blocks/Fact.d.ts.map +0 -0
  486. /package/{lib → types}/components/blocks/Feature.d.ts +0 -0
  487. /package/{lib → types}/components/blocks/Feature.d.ts.map +0 -0
  488. /package/{lib → types}/components/blocks/Image.d.ts +0 -0
  489. /package/{lib → types}/components/blocks/Image.d.ts.map +0 -0
  490. /package/{lib → types}/components/blocks/InfoList.d.ts +0 -0
  491. /package/{lib → types}/components/blocks/InfoList.d.ts.map +0 -0
  492. /package/{lib → types}/components/blocks/IntroBlock.d.ts +0 -0
  493. /package/{lib → types}/components/blocks/IntroBlock.d.ts.map +0 -0
  494. /package/{lib → types}/components/blocks/JobCard.d.ts +0 -0
  495. /package/{lib → types}/components/blocks/JobCard.d.ts.map +0 -0
  496. /package/{lib → types}/components/blocks/LanguageSwitcher.d.ts +0 -0
  497. /package/{lib → types}/components/blocks/LanguageSwitcher.d.ts.map +0 -0
  498. /package/{lib → types}/components/blocks/NavBlock.d.ts +0 -0
  499. /package/{lib → types}/components/blocks/NavBlock.d.ts.map +0 -0
  500. /package/{lib → types}/components/blocks/NewsCard.d.ts +0 -0
  501. /package/{lib → types}/components/blocks/NewsCard.d.ts.map +0 -0
  502. /package/{lib → types}/components/blocks/POICard.d.ts +0 -0
  503. /package/{lib → types}/components/blocks/POICard.d.ts.map +0 -0
  504. /package/{lib → types}/components/blocks/POIFacts.d.ts +0 -0
  505. /package/{lib → types}/components/blocks/POIFacts.d.ts.map +0 -0
  506. /package/{lib → types}/components/blocks/PriceTag.d.ts +0 -0
  507. /package/{lib → types}/components/blocks/PriceTag.d.ts.map +0 -0
  508. /package/{lib → types}/components/blocks/PromotionCard.d.ts +0 -0
  509. /package/{lib → types}/components/blocks/PromotionCard.d.ts.map +0 -0
  510. /package/{lib → types}/components/blocks/SocialList.d.ts +0 -0
  511. /package/{lib → types}/components/blocks/SocialList.d.ts.map +0 -0
  512. /package/{lib → types}/components/blocks/TableBlock.d.ts +0 -0
  513. /package/{lib → types}/components/blocks/TableBlock.d.ts.map +0 -0
  514. /package/{lib → types}/components/blocks/Tag.d.ts +0 -0
  515. /package/{lib → types}/components/blocks/Tag.d.ts.map +0 -0
  516. /package/{lib → types}/components/blocks/Title.d.ts +0 -0
  517. /package/{lib → types}/components/blocks/Title.d.ts.map +0 -0
  518. /package/{lib → types}/components/blocks/VideoBlock.d.ts +0 -0
  519. /package/{lib → types}/components/blocks/VideoBlock.d.ts.map +0 -0
  520. /package/{lib → types}/components/blocks/VideoCard.d.ts +0 -0
  521. /package/{lib → types}/components/blocks/VideoCard.d.ts.map +0 -0
  522. /package/{lib → types}/components/buttons/Button.d.ts +0 -0
  523. /package/{lib → types}/components/buttons/Button.d.ts.map +0 -0
  524. /package/{lib → types}/components/buttons/ButtonGhost.d.ts +0 -0
  525. /package/{lib → types}/components/buttons/ButtonGhost.d.ts.map +0 -0
  526. /package/{lib → types}/components/buttons/Control.d.ts +0 -0
  527. /package/{lib → types}/components/buttons/Control.d.ts.map +0 -0
  528. /package/{lib → types}/components/buttons/Pointer.d.ts +0 -0
  529. /package/{lib → types}/components/buttons/Pointer.d.ts.map +0 -0
  530. /package/{lib → types}/components/debug/DebugLines.d.ts +0 -0
  531. /package/{lib → types}/components/debug/DebugLines.d.ts.map +0 -0
  532. /package/{lib → types}/components/examples/hooks/ArrayHookExample.d.ts +0 -0
  533. /package/{lib → types}/components/examples/hooks/ArrayHookExample.d.ts.map +0 -0
  534. /package/{lib → types}/components/examples/hooks/IntervalHookExample.d.ts +0 -0
  535. /package/{lib → types}/components/examples/hooks/IntervalHookExample.d.ts.map +0 -0
  536. /package/{lib → types}/components/fields/Checkbox.d.ts +0 -0
  537. /package/{lib → types}/components/fields/Checkbox.d.ts.map +0 -0
  538. /package/{lib → types}/components/fields/CompactForm.d.ts +0 -0
  539. /package/{lib → types}/components/fields/CompactForm.d.ts.map +0 -0
  540. /package/{lib → types}/components/fields/Datepicker.d.ts +0 -0
  541. /package/{lib → types}/components/fields/Datepicker.d.ts.map +0 -0
  542. /package/{lib → types}/components/fields/FileUpload.d.ts +0 -0
  543. /package/{lib → types}/components/fields/FileUpload.d.ts.map +0 -0
  544. /package/{lib → types}/components/fields/FilterField.d.ts +0 -0
  545. /package/{lib → types}/components/fields/FilterField.d.ts.map +0 -0
  546. /package/{lib → types}/components/fields/FormField.d.ts +0 -0
  547. /package/{lib → types}/components/fields/FormField.d.ts.map +0 -0
  548. /package/{lib → types}/components/fields/LocationField.d.ts +0 -0
  549. /package/{lib → types}/components/fields/LocationField.d.ts.map +0 -0
  550. /package/{lib → types}/components/fields/Radio.d.ts +0 -0
  551. /package/{lib → types}/components/fields/Radio.d.ts.map +0 -0
  552. /package/{lib → types}/components/fields/SearchInput.d.ts +0 -0
  553. /package/{lib → types}/components/fields/SearchInput.d.ts.map +0 -0
  554. /package/{lib → types}/components/fields/SelectDropdown.d.ts +0 -0
  555. /package/{lib → types}/components/fields/SelectDropdown.d.ts.map +0 -0
  556. /package/{lib → types}/components/fields/Textarea.d.ts +0 -0
  557. /package/{lib → types}/components/fields/Textarea.d.ts.map +0 -0
  558. /package/{lib → types}/components/fields/Textfield.d.ts +0 -0
  559. /package/{lib → types}/components/fields/Textfield.d.ts.map +0 -0
  560. /package/{lib → types}/components/sections/Accordion.d.ts +0 -0
  561. /package/{lib → types}/components/sections/Accordion.d.ts.map +0 -0
  562. /package/{lib → types}/components/sections/AlertList.d.ts +0 -0
  563. /package/{lib → types}/components/sections/AlertList.d.ts.map +0 -0
  564. /package/{lib → types}/components/sections/Article.d.ts +0 -0
  565. /package/{lib → types}/components/sections/Article.d.ts.map +0 -0
  566. /package/{lib → types}/components/sections/CallToAction.d.ts +0 -0
  567. /package/{lib → types}/components/sections/CallToAction.d.ts.map +0 -0
  568. /package/{lib → types}/components/sections/CardList.d.ts +0 -0
  569. /package/{lib → types}/components/sections/CardList.d.ts.map +0 -0
  570. /package/{lib → types}/components/sections/ComparisonSlider.d.ts +0 -0
  571. /package/{lib → types}/components/sections/ComparisonSlider.d.ts.map +0 -0
  572. /package/{lib → types}/components/sections/CrossPromotion.d.ts +0 -0
  573. /package/{lib → types}/components/sections/CrossPromotion.d.ts.map +0 -0
  574. /package/{lib → types}/components/sections/FactGrid.d.ts +0 -0
  575. /package/{lib → types}/components/sections/FactGrid.d.ts.map +0 -0
  576. /package/{lib → types}/components/sections/FactList.d.ts +0 -0
  577. /package/{lib → types}/components/sections/FactList.d.ts.map +0 -0
  578. /package/{lib → types}/components/sections/FeatureList.d.ts +0 -0
  579. /package/{lib → types}/components/sections/FeatureList.d.ts.map +0 -0
  580. /package/{lib → types}/components/sections/Gallery.d.ts +0 -0
  581. /package/{lib → types}/components/sections/Gallery.d.ts.map +0 -0
  582. /package/{lib → types}/components/sections/IconList.d.ts +0 -0
  583. /package/{lib → types}/components/sections/IconList.d.ts.map +0 -0
  584. /package/{lib → types}/components/sections/IndexList.d.ts +0 -0
  585. /package/{lib → types}/components/sections/IndexList.d.ts.map +0 -0
  586. /package/{lib → types}/components/sections/Intro.d.ts +0 -0
  587. /package/{lib → types}/components/sections/Intro.d.ts.map +0 -0
  588. /package/{lib → types}/components/sections/Map.d.ts +0 -0
  589. /package/{lib → types}/components/sections/Map.d.ts.map +0 -0
  590. /package/{lib → types}/components/sections/NavList.d.ts +0 -0
  591. /package/{lib → types}/components/sections/NavList.d.ts.map +0 -0
  592. /package/{lib → types}/components/sections/NewsletterForm.d.ts +0 -0
  593. /package/{lib → types}/components/sections/NewsletterForm.d.ts.map +0 -0
  594. /package/{lib → types}/components/sections/NumberList.d.ts +0 -0
  595. /package/{lib → types}/components/sections/NumberList.d.ts.map +0 -0
  596. /package/{lib → types}/components/sections/ParallaxBackground.d.ts +0 -0
  597. /package/{lib → types}/components/sections/ParallaxBackground.d.ts.map +0 -0
  598. /package/{lib → types}/components/sections/Poster.d.ts +0 -0
  599. /package/{lib → types}/components/sections/Poster.d.ts.map +0 -0
  600. /package/{lib → types}/components/sections/PriceList.d.ts +0 -0
  601. /package/{lib → types}/components/sections/PriceList.d.ts.map +0 -0
  602. /package/{lib → types}/components/sections/PriceTable.d.ts +0 -0
  603. /package/{lib → types}/components/sections/PriceTable.d.ts.map +0 -0
  604. /package/{lib → types}/components/sections/Quote.d.ts +0 -0
  605. /package/{lib → types}/components/sections/Quote.d.ts.map +0 -0
  606. /package/{lib → types}/components/sections/RawVideo.d.ts +0 -0
  607. /package/{lib → types}/components/sections/RawVideo.d.ts.map +0 -0
  608. /package/{lib → types}/components/sections/SimpleImage.d.ts +0 -0
  609. /package/{lib → types}/components/sections/SimpleImage.d.ts.map +0 -0
  610. /package/{lib → types}/components/sections/SocialWall.d.ts +0 -0
  611. /package/{lib → types}/components/sections/SocialWall.d.ts.map +0 -0
  612. /package/{lib → types}/components/sections/Table.d.ts +0 -0
  613. /package/{lib → types}/components/sections/Table.d.ts.map +0 -0
  614. /package/{lib → types}/components/sections/Teaser.d.ts +0 -0
  615. /package/{lib → types}/components/sections/Teaser.d.ts.map +0 -0
  616. /package/{lib → types}/components/sections/TeaserWide.d.ts +0 -0
  617. /package/{lib → types}/components/sections/TeaserWide.d.ts.map +0 -0
  618. /package/{lib → types}/components/sections/Timeline.d.ts +0 -0
  619. /package/{lib → types}/components/sections/Timeline.d.ts.map +0 -0
  620. /package/{lib → types}/components/sections/Video.d.ts +0 -0
  621. /package/{lib → types}/components/sections/Video.d.ts.map +0 -0
  622. /package/{lib → types}/components/sections/events/EventDetail.d.ts +0 -0
  623. /package/{lib → types}/components/sections/events/EventDetail.d.ts.map +0 -0
  624. /package/{lib → types}/components/sections/events/EventList.d.ts +0 -0
  625. /package/{lib → types}/components/sections/events/EventList.d.ts.map +0 -0
  626. /package/{lib → types}/components/sections/events/EventOverview.d.ts +0 -0
  627. /package/{lib → types}/components/sections/events/EventOverview.d.ts.map +0 -0
  628. /package/{lib → types}/components/sections/footer/Footer.d.ts +0 -0
  629. /package/{lib → types}/components/sections/footer/Footer.d.ts.map +0 -0
  630. /package/{lib → types}/components/sections/footer/partials/FooterBottomBar.d.ts +0 -0
  631. /package/{lib → types}/components/sections/footer/partials/FooterBottomBar.d.ts.map +0 -0
  632. /package/{lib → types}/components/sections/footer/partials/FooterColumn.d.ts +0 -0
  633. /package/{lib → types}/components/sections/footer/partials/FooterColumn.d.ts.map +0 -0
  634. /package/{lib → types}/components/sections/footer/partials/index.d.ts +0 -0
  635. /package/{lib → types}/components/sections/footer/partials/index.d.ts.map +0 -0
  636. /package/{lib → types}/components/sections/footer/skeletons/FooterArticle.d.ts +0 -0
  637. /package/{lib → types}/components/sections/footer/skeletons/FooterArticle.d.ts.map +0 -0
  638. /package/{lib → types}/components/sections/footer/skeletons/FooterBottomGrid.d.ts +0 -0
  639. /package/{lib → types}/components/sections/footer/skeletons/FooterBottomGrid.d.ts.map +0 -0
  640. /package/{lib → types}/components/sections/footer/skeletons/index.d.ts +0 -0
  641. /package/{lib → types}/components/sections/footer/skeletons/index.d.ts.map +0 -0
  642. /package/{lib → types}/components/sections/form/DynamicForm.d.ts +0 -0
  643. /package/{lib → types}/components/sections/form/DynamicForm.d.ts.map +0 -0
  644. /package/{lib → types}/components/sections/form/renderer/areaRenderer.d.ts +0 -0
  645. /package/{lib → types}/components/sections/form/renderer/areaRenderer.d.ts.map +0 -0
  646. /package/{lib → types}/components/sections/form/renderer/datepickerRenderer.d.ts +0 -0
  647. /package/{lib → types}/components/sections/form/renderer/datepickerRenderer.d.ts.map +0 -0
  648. /package/{lib → types}/components/sections/form/renderer/fieldGroupRenderer.d.ts +0 -0
  649. /package/{lib → types}/components/sections/form/renderer/fieldGroupRenderer.d.ts.map +0 -0
  650. /package/{lib → types}/components/sections/form/renderer/fieldRenderer.d.ts +0 -0
  651. /package/{lib → types}/components/sections/form/renderer/fieldRenderer.d.ts.map +0 -0
  652. /package/{lib → types}/components/sections/form/renderer/locationRenderer.d.ts +0 -0
  653. /package/{lib → types}/components/sections/form/renderer/locationRenderer.d.ts.map +0 -0
  654. /package/{lib → types}/components/sections/form/renderer/selectRenderer.d.ts +0 -0
  655. /package/{lib → types}/components/sections/form/renderer/selectRenderer.d.ts.map +0 -0
  656. /package/{lib → types}/components/sections/form/renderer/uploadRenderer.d.ts +0 -0
  657. /package/{lib → types}/components/sections/form/renderer/uploadRenderer.d.ts.map +0 -0
  658. /package/{lib → types}/components/sections/form/validators/areaValidator.d.ts +0 -0
  659. /package/{lib → types}/components/sections/form/validators/areaValidator.d.ts.map +0 -0
  660. /package/{lib → types}/components/sections/form/validators/datepickerValidator.d.ts +0 -0
  661. /package/{lib → types}/components/sections/form/validators/datepickerValidator.d.ts.map +0 -0
  662. /package/{lib → types}/components/sections/form/validators/fieldGroupValidator.d.ts +0 -0
  663. /package/{lib → types}/components/sections/form/validators/fieldGroupValidator.d.ts.map +0 -0
  664. /package/{lib → types}/components/sections/form/validators/fieldValidator.d.ts +0 -0
  665. /package/{lib → types}/components/sections/form/validators/fieldValidator.d.ts.map +0 -0
  666. /package/{lib → types}/components/sections/form/validators/locationValidator.d.ts +0 -0
  667. /package/{lib → types}/components/sections/form/validators/locationValidator.d.ts.map +0 -0
  668. /package/{lib → types}/components/sections/form/validators/selectValidator.d.ts +0 -0
  669. /package/{lib → types}/components/sections/form/validators/selectValidator.d.ts.map +0 -0
  670. /package/{lib → types}/components/sections/form/validators/uploadValidator.d.ts +0 -0
  671. /package/{lib → types}/components/sections/form/validators/uploadValidator.d.ts.map +0 -0
  672. /package/{lib → types}/components/sections/header/Header.d.ts +0 -0
  673. /package/{lib → types}/components/sections/header/Header.d.ts.map +0 -0
  674. /package/{lib → types}/components/sections/header/HeaderKenBurns.d.ts +0 -0
  675. /package/{lib → types}/components/sections/header/HeaderKenBurns.d.ts.map +0 -0
  676. /package/{lib → types}/components/sections/header/HeaderPoster.d.ts +0 -0
  677. /package/{lib → types}/components/sections/header/HeaderPoster.d.ts.map +0 -0
  678. /package/{lib → types}/components/sections/header/HeaderVideo.d.ts +0 -0
  679. /package/{lib → types}/components/sections/header/HeaderVideo.d.ts.map +0 -0
  680. /package/{lib → types}/components/sections/jobs/JobArticle.d.ts +0 -0
  681. /package/{lib → types}/components/sections/jobs/JobArticle.d.ts.map +0 -0
  682. /package/{lib → types}/components/sections/jobs/JobList.d.ts +0 -0
  683. /package/{lib → types}/components/sections/jobs/JobList.d.ts.map +0 -0
  684. /package/{lib → types}/components/sections/navigation/NavBar.d.ts +0 -0
  685. /package/{lib → types}/components/sections/navigation/NavBar.d.ts.map +0 -0
  686. /package/{lib → types}/components/sections/navigation/Navigation.d.ts +0 -0
  687. /package/{lib → types}/components/sections/navigation/Navigation.d.ts.map +0 -0
  688. /package/{lib → types}/components/sections/navigation/menu/Menu.d.ts +0 -0
  689. /package/{lib → types}/components/sections/navigation/menu/Menu.d.ts.map +0 -0
  690. /package/{lib → types}/components/sections/navigation/menu/variations/MenuFlyout.d.ts +0 -0
  691. /package/{lib → types}/components/sections/navigation/menu/variations/MenuLarge.d.ts +0 -0
  692. /package/{lib → types}/components/sections/navigation/partials/MenuFooter.d.ts +0 -0
  693. /package/{lib → types}/components/sections/navigation/partials/MenuFooter.d.ts.map +0 -0
  694. /package/{lib → types}/components/sections/navigation/partials/MenuHeader.d.ts +0 -0
  695. /package/{lib → types}/components/sections/navigation/partials/MenuHeader.d.ts.map +0 -0
  696. /package/{lib → types}/components/sections/navigation/partials/NavBarBottom.d.ts +0 -0
  697. /package/{lib → types}/components/sections/navigation/partials/NavBarBottom.d.ts.map +0 -0
  698. /package/{lib → types}/components/sections/navigation/partials/NavBarMain.d.ts +0 -0
  699. /package/{lib → types}/components/sections/navigation/partials/NavBarMain.d.ts.map +0 -0
  700. /package/{lib → types}/components/sections/navigation/partials/NavBarTop.d.ts +0 -0
  701. /package/{lib → types}/components/sections/navigation/partials/NavBarTop.d.ts.map +0 -0
  702. /package/{lib → types}/components/sections/navigation/partials/index.d.ts +0 -0
  703. /package/{lib → types}/components/sections/navigation/partials/index.d.ts.map +0 -0
  704. /package/{lib → types}/components/sections/navigation/skeletons/BarBreadCrumbs.d.ts +0 -0
  705. /package/{lib → types}/components/sections/navigation/skeletons/BarBreadCrumbs.d.ts.map +0 -0
  706. /package/{lib → types}/components/sections/navigation/skeletons/BarColumn.d.ts +0 -0
  707. /package/{lib → types}/components/sections/navigation/skeletons/BarColumn.d.ts.map +0 -0
  708. /package/{lib → types}/components/sections/navigation/skeletons/BarLogo.d.ts +0 -0
  709. /package/{lib → types}/components/sections/navigation/skeletons/BarLogo.d.ts.map +0 -0
  710. /package/{lib → types}/components/sections/navigation/skeletons/BarMenuToggle.d.ts +0 -0
  711. /package/{lib → types}/components/sections/navigation/skeletons/BarMenuToggle.d.ts.map +0 -0
  712. /package/{lib → types}/components/sections/navigation/skeletons/BarNavList.d.ts +0 -0
  713. /package/{lib → types}/components/sections/navigation/skeletons/BarNavList.d.ts.map +0 -0
  714. /package/{lib → types}/components/sections/navigation/skeletons/index.d.ts +0 -0
  715. /package/{lib → types}/components/sections/navigation/skeletons/index.d.ts.map +0 -0
  716. /package/{lib → types}/components/sections/news/NewsAuthorCard.d.ts +0 -0
  717. /package/{lib → types}/components/sections/news/NewsAuthorCard.d.ts.map +0 -0
  718. /package/{lib → types}/components/sections/news/NewsFooter.d.ts +0 -0
  719. /package/{lib → types}/components/sections/news/NewsFooter.d.ts.map +0 -0
  720. /package/{lib → types}/components/sections/news/NewsImages.d.ts +0 -0
  721. /package/{lib → types}/components/sections/news/NewsImages.d.ts.map +0 -0
  722. /package/{lib → types}/components/sections/news/NewsIntro.d.ts +0 -0
  723. /package/{lib → types}/components/sections/news/NewsIntro.d.ts.map +0 -0
  724. /package/{lib → types}/components/sections/news/NewsList.d.ts +0 -0
  725. /package/{lib → types}/components/sections/news/NewsList.d.ts.map +0 -0
  726. /package/{lib → types}/components/sections/news/NewsOverview.d.ts +0 -0
  727. /package/{lib → types}/components/sections/news/NewsOverview.d.ts.map +0 -0
  728. /package/{lib → types}/components/sections/news/NewsTable.d.ts +0 -0
  729. /package/{lib → types}/components/sections/news/NewsTable.d.ts.map +0 -0
  730. /package/{lib → types}/components/sections/news/NewsText.d.ts +0 -0
  731. /package/{lib → types}/components/sections/news/NewsText.d.ts.map +0 -0
  732. /package/{lib → types}/components/sections/news/NewsVideo.d.ts +0 -0
  733. /package/{lib → types}/components/sections/news/NewsVideo.d.ts.map +0 -0
  734. /package/{lib → types}/components/sections/pois/PointOfInterestDetail.d.ts +0 -0
  735. /package/{lib → types}/components/sections/pois/PointOfInterestDetail.d.ts.map +0 -0
  736. /package/{lib → types}/components/sections/pois/PointOfInterestMap.d.ts +0 -0
  737. /package/{lib → types}/components/sections/pois/PointOfInterestMap.d.ts.map +0 -0
  738. /package/{lib → types}/components/sections/pois/PointOfInterestOverview.d.ts +0 -0
  739. /package/{lib → types}/components/sections/pois/PointOfInterestOverview.d.ts.map +0 -0
  740. /package/{lib → types}/components/typography/Callout.d.ts +0 -0
  741. /package/{lib → types}/components/typography/Callout.d.ts.map +0 -0
  742. /package/{lib → types}/components/typography/Copy.d.ts +0 -0
  743. /package/{lib → types}/components/typography/Copy.d.ts.map +0 -0
  744. /package/{lib → types}/components/typography/Heading.d.ts +0 -0
  745. /package/{lib → types}/components/typography/Heading.d.ts.map +0 -0
  746. /package/{lib → types}/components/typography/Link.d.ts +0 -0
  747. /package/{lib → types}/components/typography/Link.d.ts.map +0 -0
  748. /package/{lib → types}/utils/LibThemeProvider.d.ts +0 -0
  749. /package/{lib → types}/utils/LibThemeProvider.d.ts.map +0 -0
  750. /package/{lib → types}/utils/arrays.d.ts +0 -0
  751. /package/{lib → types}/utils/arrays.d.ts.map +0 -0
  752. /package/{lib → types}/utils/backgroundImage.d.ts +0 -0
  753. /package/{lib → types}/utils/backgroundImage.d.ts.map +0 -0
  754. /package/{lib → types}/utils/clamp.d.ts +0 -0
  755. /package/{lib → types}/utils/clamp.d.ts.map +0 -0
  756. /package/{lib → types}/utils/concat.d.ts +0 -0
  757. /package/{lib → types}/utils/concat.d.ts.map +0 -0
  758. /package/{lib → types}/utils/cookie-consent/cookie.d.ts +0 -0
  759. /package/{lib → types}/utils/cookie-consent/cookie.d.ts.map +0 -0
  760. /package/{lib → types}/utils/cookie-consent/mutations.d.ts +0 -0
  761. /package/{lib → types}/utils/cookie-consent/mutations.d.ts.map +0 -0
  762. /package/{lib → types}/utils/cookie-consent/useCookieConsent.d.ts +0 -0
  763. /package/{lib → types}/utils/cookie-consent/useCookieConsent.d.ts.map +0 -0
  764. /package/{lib → types}/utils/dataURI.d.ts +0 -0
  765. /package/{lib → types}/utils/dataURI.d.ts.map +0 -0
  766. /package/{lib → types}/utils/escape.d.ts +0 -0
  767. /package/{lib → types}/utils/escape.d.ts.map +0 -0
  768. /package/{lib → types}/utils/filters.d.ts +0 -0
  769. /package/{lib → types}/utils/filters.d.ts.map +0 -0
  770. /package/{lib → types}/utils/fontLoading.d.ts +0 -0
  771. /package/{lib → types}/utils/fontLoading.d.ts.map +0 -0
  772. /package/{lib → types}/utils/formFieldText.d.ts +0 -0
  773. /package/{lib → types}/utils/formFieldText.d.ts.map +0 -0
  774. /package/{lib → types}/utils/getLinkIcon.d.ts +0 -0
  775. /package/{lib → types}/utils/getLinkIcon.d.ts.map +0 -0
  776. /package/{lib → types}/utils/hexRgbConverter.d.ts +0 -0
  777. /package/{lib → types}/utils/hexRgbConverter.d.ts.map +0 -0
  778. /package/{lib → types}/utils/menuHooks.d.ts +0 -0
  779. /package/{lib → types}/utils/menuHooks.d.ts.map +0 -0
  780. /package/{lib → types}/utils/navigation.d.ts +0 -0
  781. /package/{lib → types}/utils/navigation.d.ts.map +0 -0
  782. /package/{lib → types}/utils/statusFormatter.d.ts +0 -0
  783. /package/{lib → types}/utils/statusFormatter.d.ts.map +0 -0
  784. /package/{lib → types}/utils/storyHelpers.d.ts +0 -0
  785. /package/{lib → types}/utils/storyHelpers.d.ts.map +0 -0
  786. /package/{lib → types}/utils/structuredData.d.ts +0 -0
  787. /package/{lib → types}/utils/structuredData.d.ts.map +0 -0
  788. /package/{lib → types}/utils/styles.d.ts +0 -0
  789. /package/{lib → types}/utils/styles.d.ts.map +0 -0
  790. /package/{lib → types}/utils/types.d.ts +0 -0
  791. /package/{lib → types}/utils/types.d.ts.map +0 -0
  792. /package/{lib → types}/utils/urlParams.d.ts +0 -0
  793. /package/{lib → types}/utils/urlParams.d.ts.map +0 -0
  794. /package/{lib → types}/utils/useArray.d.ts +0 -0
  795. /package/{lib → types}/utils/useArray.d.ts.map +0 -0
  796. /package/{lib → types}/utils/useDebounce.d.ts +0 -0
  797. /package/{lib → types}/utils/useDebounce.d.ts.map +0 -0
  798. /package/{lib → types}/utils/useEqualSheetHeight.d.ts +0 -0
  799. /package/{lib → types}/utils/useEqualSheetHeight.d.ts.map +0 -0
  800. /package/{lib → types}/utils/useFontsLoaded.d.ts +0 -0
  801. /package/{lib → types}/utils/useFontsLoaded.d.ts.map +0 -0
  802. /package/{lib → types}/utils/useGeolocation.d.ts +0 -0
  803. /package/{lib → types}/utils/useGeolocation.d.ts.map +0 -0
  804. /package/{lib → types}/utils/useIE.d.ts +0 -0
  805. /package/{lib → types}/utils/useIE.d.ts.map +0 -0
  806. /package/{lib → types}/utils/useImgPreload.d.ts +0 -0
  807. /package/{lib → types}/utils/useImgPreload.d.ts.map +0 -0
  808. /package/{lib → types}/utils/useInterval.d.ts +0 -0
  809. /package/{lib → types}/utils/useInterval.d.ts.map +0 -0
  810. /package/{lib → types}/utils/useItemHeight.d.ts +0 -0
  811. /package/{lib → types}/utils/useItemHeight.d.ts.map +0 -0
  812. /package/{lib → types}/utils/useLazyInput.d.ts +0 -0
  813. /package/{lib → types}/utils/useLazyInput.d.ts.map +0 -0
  814. /package/{lib → types}/utils/useLeafletMap.d.ts +0 -0
  815. /package/{lib → types}/utils/useLeafletMap.d.ts.map +0 -0
  816. /package/{lib → types}/utils/useMediaQuery.d.ts +0 -0
  817. /package/{lib → types}/utils/useMediaQuery.d.ts.map +0 -0
  818. /package/{lib → types}/utils/useMounted.d.ts +0 -0
  819. /package/{lib → types}/utils/useMounted.d.ts.map +0 -0
  820. /package/{lib → types}/utils/useObserverSupport.d.ts +0 -0
  821. /package/{lib → types}/utils/useObserverSupport.d.ts.map +0 -0
  822. /package/{lib → types}/utils/usePageScroll.d.ts +0 -0
  823. /package/{lib → types}/utils/usePageScroll.d.ts.map +0 -0
  824. /package/{lib → types}/utils/useParams.d.ts +0 -0
  825. /package/{lib → types}/utils/useParams.d.ts.map +0 -0
  826. /package/{lib → types}/utils/usePoster.d.ts +0 -0
  827. /package/{lib → types}/utils/usePoster.d.ts.map +0 -0
  828. /package/{lib → types}/utils/usePrevious.d.ts +0 -0
  829. /package/{lib → types}/utils/usePrevious.d.ts.map +0 -0
  830. /package/{lib → types}/utils/useResizeThrottle.d.ts +0 -0
  831. /package/{lib → types}/utils/useResizeThrottle.d.ts.map +0 -0
  832. /package/{lib → types}/utils/useScroll.d.ts +0 -0
  833. /package/{lib → types}/utils/useScroll.d.ts.map +0 -0
  834. /package/{lib → types}/utils/useScrollIntoView.d.ts +0 -0
  835. /package/{lib → types}/utils/useScrollIntoView.d.ts.map +0 -0
  836. /package/{lib → types}/utils/useScrollThrottle.d.ts +0 -0
  837. /package/{lib → types}/utils/useScrollThrottle.d.ts.map +0 -0
  838. /package/{lib → types}/utils/useScrollTo.d.ts +0 -0
  839. /package/{lib → types}/utils/useScrollTo.d.ts.map +0 -0
  840. /package/{lib → types}/utils/useTimeout.d.ts +0 -0
  841. /package/{lib → types}/utils/useTimeout.d.ts.map +0 -0
  842. /package/{lib → types}/utils/useTouch.d.ts +0 -0
  843. /package/{lib → types}/utils/useTouch.d.ts.map +0 -0
  844. /package/{lib → types}/utils/useUpdateEffect.d.ts +0 -0
  845. /package/{lib → types}/utils/useUpdateEffect.d.ts.map +0 -0
@@ -0,0 +1,4598 @@
1
+ import { a as __makeTemplateObject, g as CalendarToday, D as DateRange, h as __awaiter, i as __generator, e as __spreadArray, j as DeleteForever, k as UploadFile, L as LocationPin, T as ToggleOn, l as ToggleOff, m as LocationSearch, A as AngleUp, n as AngleDown } from './ClockFilled-62515a8f.js';
2
+ import * as React from 'react';
3
+ import React__default, { forwardRef, useRef, useState, useEffect, useCallback, useMemo } from 'react';
4
+ import styled, { css } from 'styled-components';
5
+ import { s as spacings, m as mq, g as getColors, c as getGlobals, a as getFonts, w as withRange, f as getSVGDataImg } from './styles-da982973.js';
6
+ import { B as ButtonGhost } from './ButtonGhost-ae2e97a2.js';
7
+ import { B as Button } from './Button-f9279013.js';
8
+ import { c as copyStyle, C as Copy } from './Copy-a28aeb61.js';
9
+ import ReactDatePicker from 'react-datepicker';
10
+ import { h as hexToRgba } from './hexRgbConverter-edb91624.js';
11
+ import { g as getFormFieldTextSize, F as FieldWrapper } from './Textfield-d2f201a9.js';
12
+ import { u as useLibTheme } from './LibThemeProvider-52555ac9.js';
13
+ import { u as useLeafletMap } from './useLeafletMap-84170d32.js';
14
+ import { u as useLazyInput } from './useLazyInput-16a0b633.js';
15
+ import { u as useUpdateEffect } from './useUpdateEffect-824c0c84.js';
16
+ import { u as useGeolocation } from './useGeolocation-f9f073cc.js';
17
+ import { u as useMounted } from './useMounted-1e4cc87b.js';
18
+ import { i as isValidArray } from './arrays-65b644ef.js';
19
+
20
+ function toInteger(dirtyNumber) {
21
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
22
+ return NaN;
23
+ }
24
+
25
+ var number = Number(dirtyNumber);
26
+
27
+ if (isNaN(number)) {
28
+ return number;
29
+ }
30
+
31
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
32
+ }
33
+
34
+ function requiredArgs(required, args) {
35
+ if (args.length < required) {
36
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
37
+ }
38
+ }
39
+
40
+ /**
41
+ * @name toDate
42
+ * @category Common Helpers
43
+ * @summary Convert the given argument to an instance of Date.
44
+ *
45
+ * @description
46
+ * Convert the given argument to an instance of Date.
47
+ *
48
+ * If the argument is an instance of Date, the function returns its clone.
49
+ *
50
+ * If the argument is a number, it is treated as a timestamp.
51
+ *
52
+ * If the argument is none of the above, the function returns Invalid Date.
53
+ *
54
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
55
+ *
56
+ * @param {Date|Number} argument - the value to convert
57
+ * @returns {Date} the parsed date in the local time zone
58
+ * @throws {TypeError} 1 argument required
59
+ *
60
+ * @example
61
+ * // Clone the date:
62
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
63
+ * //=> Tue Feb 11 2014 11:30:30
64
+ *
65
+ * @example
66
+ * // Convert the timestamp to date:
67
+ * const result = toDate(1392098430000)
68
+ * //=> Tue Feb 11 2014 11:30:30
69
+ */
70
+
71
+ function toDate(argument) {
72
+ requiredArgs(1, arguments);
73
+ var argStr = Object.prototype.toString.call(argument); // Clone the date
74
+
75
+ if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
76
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
77
+ return new Date(argument.getTime());
78
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
79
+ return new Date(argument);
80
+ } else {
81
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
82
+ // eslint-disable-next-line no-console
83
+ 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://git.io/fjule"); // eslint-disable-next-line no-console
84
+
85
+ console.warn(new Error().stack);
86
+ }
87
+
88
+ return new Date(NaN);
89
+ }
90
+ }
91
+
92
+ /**
93
+ * @name addMilliseconds
94
+ * @category Millisecond Helpers
95
+ * @summary Add the specified number of milliseconds to the given date.
96
+ *
97
+ * @description
98
+ * Add the specified number of milliseconds to the given date.
99
+ *
100
+ * ### v2.0.0 breaking changes:
101
+ *
102
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
103
+ *
104
+ * @param {Date|Number} date - the date to be changed
105
+ * @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`.
106
+ * @returns {Date} the new date with the milliseconds added
107
+ * @throws {TypeError} 2 arguments required
108
+ *
109
+ * @example
110
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
111
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
112
+ * //=> Thu Jul 10 2014 12:45:30.750
113
+ */
114
+
115
+ function addMilliseconds(dirtyDate, dirtyAmount) {
116
+ requiredArgs(2, arguments);
117
+ var timestamp = toDate(dirtyDate).getTime();
118
+ var amount = toInteger(dirtyAmount);
119
+ return new Date(timestamp + amount);
120
+ }
121
+
122
+ /**
123
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
124
+ * They usually appear for dates that denote time before the timezones were introduced
125
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
126
+ * and GMT+01:00:00 after that date)
127
+ *
128
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
129
+ * which would lead to incorrect calculations.
130
+ *
131
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
132
+ */
133
+ function getTimezoneOffsetInMilliseconds(date) {
134
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
135
+ utcDate.setUTCFullYear(date.getFullYear());
136
+ return date.getTime() - utcDate.getTime();
137
+ }
138
+
139
+ /**
140
+ * @name isDate
141
+ * @category Common Helpers
142
+ * @summary Is the given value a date?
143
+ *
144
+ * @description
145
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
146
+ *
147
+ * ### v2.0.0 breaking changes:
148
+ *
149
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
150
+ *
151
+ * @param {*} value - the value to check
152
+ * @returns {boolean} true if the given value is a date
153
+ * @throws {TypeError} 1 arguments required
154
+ *
155
+ * @example
156
+ * // For a valid date:
157
+ * const result = isDate(new Date())
158
+ * //=> true
159
+ *
160
+ * @example
161
+ * // For an invalid date:
162
+ * const result = isDate(new Date(NaN))
163
+ * //=> true
164
+ *
165
+ * @example
166
+ * // For some value:
167
+ * const result = isDate('2014-02-31')
168
+ * //=> false
169
+ *
170
+ * @example
171
+ * // For an object:
172
+ * const result = isDate({})
173
+ * //=> false
174
+ */
175
+
176
+ function isDate(value) {
177
+ requiredArgs(1, arguments);
178
+ return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
179
+ }
180
+
181
+ /**
182
+ * @name isValid
183
+ * @category Common Helpers
184
+ * @summary Is the given date valid?
185
+ *
186
+ * @description
187
+ * Returns false if argument is Invalid Date and true otherwise.
188
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
189
+ * Invalid Date is a Date, whose time value is NaN.
190
+ *
191
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
192
+ *
193
+ * ### v2.0.0 breaking changes:
194
+ *
195
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
196
+ *
197
+ * - Now `isValid` doesn't throw an exception
198
+ * if the first argument is not an instance of Date.
199
+ * Instead, argument is converted beforehand using `toDate`.
200
+ *
201
+ * Examples:
202
+ *
203
+ * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
204
+ * |---------------------------|---------------|---------------|
205
+ * | `new Date()` | `true` | `true` |
206
+ * | `new Date('2016-01-01')` | `true` | `true` |
207
+ * | `new Date('')` | `false` | `false` |
208
+ * | `new Date(1488370835081)` | `true` | `true` |
209
+ * | `new Date(NaN)` | `false` | `false` |
210
+ * | `'2016-01-01'` | `TypeError` | `false` |
211
+ * | `''` | `TypeError` | `false` |
212
+ * | `1488370835081` | `TypeError` | `true` |
213
+ * | `NaN` | `TypeError` | `false` |
214
+ *
215
+ * We introduce this change to make *date-fns* consistent with ECMAScript behavior
216
+ * that try to coerce arguments to the expected type
217
+ * (which is also the case with other *date-fns* functions).
218
+ *
219
+ * @param {*} date - the date to check
220
+ * @returns {Boolean} the date is valid
221
+ * @throws {TypeError} 1 argument required
222
+ *
223
+ * @example
224
+ * // For the valid date:
225
+ * const result = isValid(new Date(2014, 1, 31))
226
+ * //=> true
227
+ *
228
+ * @example
229
+ * // For the value, convertable into a date:
230
+ * const result = isValid(1393804800000)
231
+ * //=> true
232
+ *
233
+ * @example
234
+ * // For the invalid date:
235
+ * const result = isValid(new Date(''))
236
+ * //=> false
237
+ */
238
+
239
+ function isValid(dirtyDate) {
240
+ requiredArgs(1, arguments);
241
+
242
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
243
+ return false;
244
+ }
245
+
246
+ var date = toDate(dirtyDate);
247
+ return !isNaN(Number(date));
248
+ }
249
+
250
+ var formatDistanceLocale$1 = {
251
+ lessThanXSeconds: {
252
+ one: 'less than a second',
253
+ other: 'less than {{count}} seconds'
254
+ },
255
+ xSeconds: {
256
+ one: '1 second',
257
+ other: '{{count}} seconds'
258
+ },
259
+ halfAMinute: 'half a minute',
260
+ lessThanXMinutes: {
261
+ one: 'less than a minute',
262
+ other: 'less than {{count}} minutes'
263
+ },
264
+ xMinutes: {
265
+ one: '1 minute',
266
+ other: '{{count}} minutes'
267
+ },
268
+ aboutXHours: {
269
+ one: 'about 1 hour',
270
+ other: 'about {{count}} hours'
271
+ },
272
+ xHours: {
273
+ one: '1 hour',
274
+ other: '{{count}} hours'
275
+ },
276
+ xDays: {
277
+ one: '1 day',
278
+ other: '{{count}} days'
279
+ },
280
+ aboutXWeeks: {
281
+ one: 'about 1 week',
282
+ other: 'about {{count}} weeks'
283
+ },
284
+ xWeeks: {
285
+ one: '1 week',
286
+ other: '{{count}} weeks'
287
+ },
288
+ aboutXMonths: {
289
+ one: 'about 1 month',
290
+ other: 'about {{count}} months'
291
+ },
292
+ xMonths: {
293
+ one: '1 month',
294
+ other: '{{count}} months'
295
+ },
296
+ aboutXYears: {
297
+ one: 'about 1 year',
298
+ other: 'about {{count}} years'
299
+ },
300
+ xYears: {
301
+ one: '1 year',
302
+ other: '{{count}} years'
303
+ },
304
+ overXYears: {
305
+ one: 'over 1 year',
306
+ other: 'over {{count}} years'
307
+ },
308
+ almostXYears: {
309
+ one: 'almost 1 year',
310
+ other: 'almost {{count}} years'
311
+ }
312
+ };
313
+
314
+ var formatDistance$1 = function (token, count, options) {
315
+ var result;
316
+ var tokenValue = formatDistanceLocale$1[token];
317
+
318
+ if (typeof tokenValue === 'string') {
319
+ result = tokenValue;
320
+ } else if (count === 1) {
321
+ result = tokenValue.one;
322
+ } else {
323
+ result = tokenValue.other.replace('{{count}}', count.toString());
324
+ }
325
+
326
+ if (options !== null && options !== void 0 && options.addSuffix) {
327
+ if (options.comparison && options.comparison > 0) {
328
+ return 'in ' + result;
329
+ } else {
330
+ return result + ' ago';
331
+ }
332
+ }
333
+
334
+ return result;
335
+ };
336
+
337
+ function buildFormatLongFn(args) {
338
+ return function () {
339
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; // TODO: Remove String()
340
+
341
+ var width = options.width ? String(options.width) : args.defaultWidth;
342
+ var format = args.formats[width] || args.formats[args.defaultWidth];
343
+ return format;
344
+ };
345
+ }
346
+
347
+ var dateFormats$1 = {
348
+ full: 'EEEE, MMMM do, y',
349
+ long: 'MMMM do, y',
350
+ medium: 'MMM d, y',
351
+ short: 'MM/dd/yyyy'
352
+ };
353
+ var timeFormats$1 = {
354
+ full: 'h:mm:ss a zzzz',
355
+ long: 'h:mm:ss a z',
356
+ medium: 'h:mm:ss a',
357
+ short: 'h:mm a'
358
+ };
359
+ var dateTimeFormats$1 = {
360
+ full: "{{date}} 'at' {{time}}",
361
+ long: "{{date}} 'at' {{time}}",
362
+ medium: '{{date}}, {{time}}',
363
+ short: '{{date}}, {{time}}'
364
+ };
365
+ var formatLong$1 = {
366
+ date: buildFormatLongFn({
367
+ formats: dateFormats$1,
368
+ defaultWidth: 'full'
369
+ }),
370
+ time: buildFormatLongFn({
371
+ formats: timeFormats$1,
372
+ defaultWidth: 'full'
373
+ }),
374
+ dateTime: buildFormatLongFn({
375
+ formats: dateTimeFormats$1,
376
+ defaultWidth: 'full'
377
+ })
378
+ };
379
+
380
+ var formatRelativeLocale$1 = {
381
+ lastWeek: "'last' eeee 'at' p",
382
+ yesterday: "'yesterday at' p",
383
+ today: "'today at' p",
384
+ tomorrow: "'tomorrow at' p",
385
+ nextWeek: "eeee 'at' p",
386
+ other: 'P'
387
+ };
388
+
389
+ var formatRelative$1 = function (token, _date, _baseDate, _options) {
390
+ return formatRelativeLocale$1[token];
391
+ };
392
+
393
+ function buildLocalizeFn(args) {
394
+ return function (dirtyIndex, dirtyOptions) {
395
+ var options = dirtyOptions || {};
396
+ var context = options.context ? String(options.context) : 'standalone';
397
+ var valuesArray;
398
+
399
+ if (context === 'formatting' && args.formattingValues) {
400
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
401
+ var width = options.width ? String(options.width) : defaultWidth;
402
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
403
+ } else {
404
+ var _defaultWidth = args.defaultWidth;
405
+
406
+ var _width = options.width ? String(options.width) : args.defaultWidth;
407
+
408
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
409
+ }
410
+
411
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @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!
412
+
413
+ return valuesArray[index];
414
+ };
415
+ }
416
+
417
+ var eraValues$1 = {
418
+ narrow: ['B', 'A'],
419
+ abbreviated: ['BC', 'AD'],
420
+ wide: ['Before Christ', 'Anno Domini']
421
+ };
422
+ var quarterValues$1 = {
423
+ narrow: ['1', '2', '3', '4'],
424
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
425
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
426
+ }; // Note: in English, the names of days of the week and months are capitalized.
427
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
428
+ // Generally, formatted dates should look like they are in the middle of a sentence,
429
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
430
+
431
+ var monthValues$1 = {
432
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
433
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
434
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
435
+ };
436
+ var dayValues$1 = {
437
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
438
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
439
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
440
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
441
+ };
442
+ var dayPeriodValues$1 = {
443
+ narrow: {
444
+ am: 'a',
445
+ pm: 'p',
446
+ midnight: 'mi',
447
+ noon: 'n',
448
+ morning: 'morning',
449
+ afternoon: 'afternoon',
450
+ evening: 'evening',
451
+ night: 'night'
452
+ },
453
+ abbreviated: {
454
+ am: 'AM',
455
+ pm: 'PM',
456
+ midnight: 'midnight',
457
+ noon: 'noon',
458
+ morning: 'morning',
459
+ afternoon: 'afternoon',
460
+ evening: 'evening',
461
+ night: 'night'
462
+ },
463
+ wide: {
464
+ am: 'a.m.',
465
+ pm: 'p.m.',
466
+ midnight: 'midnight',
467
+ noon: 'noon',
468
+ morning: 'morning',
469
+ afternoon: 'afternoon',
470
+ evening: 'evening',
471
+ night: 'night'
472
+ }
473
+ };
474
+ var formattingDayPeriodValues$1 = {
475
+ narrow: {
476
+ am: 'a',
477
+ pm: 'p',
478
+ midnight: 'mi',
479
+ noon: 'n',
480
+ morning: 'in the morning',
481
+ afternoon: 'in the afternoon',
482
+ evening: 'in the evening',
483
+ night: 'at night'
484
+ },
485
+ abbreviated: {
486
+ am: 'AM',
487
+ pm: 'PM',
488
+ midnight: 'midnight',
489
+ noon: 'noon',
490
+ morning: 'in the morning',
491
+ afternoon: 'in the afternoon',
492
+ evening: 'in the evening',
493
+ night: 'at night'
494
+ },
495
+ wide: {
496
+ am: 'a.m.',
497
+ pm: 'p.m.',
498
+ midnight: 'midnight',
499
+ noon: 'noon',
500
+ morning: 'in the morning',
501
+ afternoon: 'in the afternoon',
502
+ evening: 'in the evening',
503
+ night: 'at night'
504
+ }
505
+ };
506
+
507
+ var ordinalNumber$1 = function (dirtyNumber, _options) {
508
+ var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
509
+ // if they are different for different grammatical genders,
510
+ // use `options.unit`.
511
+ //
512
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
513
+ // 'day', 'hour', 'minute', 'second'.
514
+
515
+ var rem100 = number % 100;
516
+
517
+ if (rem100 > 20 || rem100 < 10) {
518
+ switch (rem100 % 10) {
519
+ case 1:
520
+ return number + 'st';
521
+
522
+ case 2:
523
+ return number + 'nd';
524
+
525
+ case 3:
526
+ return number + 'rd';
527
+ }
528
+ }
529
+
530
+ return number + 'th';
531
+ };
532
+
533
+ var localize$1 = {
534
+ ordinalNumber: ordinalNumber$1,
535
+ era: buildLocalizeFn({
536
+ values: eraValues$1,
537
+ defaultWidth: 'wide'
538
+ }),
539
+ quarter: buildLocalizeFn({
540
+ values: quarterValues$1,
541
+ defaultWidth: 'wide',
542
+ argumentCallback: function (quarter) {
543
+ return quarter - 1;
544
+ }
545
+ }),
546
+ month: buildLocalizeFn({
547
+ values: monthValues$1,
548
+ defaultWidth: 'wide'
549
+ }),
550
+ day: buildLocalizeFn({
551
+ values: dayValues$1,
552
+ defaultWidth: 'wide'
553
+ }),
554
+ dayPeriod: buildLocalizeFn({
555
+ values: dayPeriodValues$1,
556
+ defaultWidth: 'wide',
557
+ formattingValues: formattingDayPeriodValues$1,
558
+ defaultFormattingWidth: 'wide'
559
+ })
560
+ };
561
+
562
+ function buildMatchFn(args) {
563
+ return function (string) {
564
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
565
+ var width = options.width;
566
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
567
+ var matchResult = string.match(matchPattern);
568
+
569
+ if (!matchResult) {
570
+ return null;
571
+ }
572
+
573
+ var matchedString = matchResult[0];
574
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
575
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
576
+ return pattern.test(matchedString);
577
+ }) : findKey(parsePatterns, function (pattern) {
578
+ return pattern.test(matchedString);
579
+ });
580
+ var value;
581
+ value = args.valueCallback ? args.valueCallback(key) : key;
582
+ value = options.valueCallback ? options.valueCallback(value) : value;
583
+ var rest = string.slice(matchedString.length);
584
+ return {
585
+ value: value,
586
+ rest: rest
587
+ };
588
+ };
589
+ }
590
+
591
+ function findKey(object, predicate) {
592
+ for (var key in object) {
593
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
594
+ return key;
595
+ }
596
+ }
597
+
598
+ return undefined;
599
+ }
600
+
601
+ function findIndex(array, predicate) {
602
+ for (var key = 0; key < array.length; key++) {
603
+ if (predicate(array[key])) {
604
+ return key;
605
+ }
606
+ }
607
+
608
+ return undefined;
609
+ }
610
+
611
+ function buildMatchPatternFn(args) {
612
+ return function (string) {
613
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
614
+ var matchResult = string.match(args.matchPattern);
615
+ if (!matchResult) return null;
616
+ var matchedString = matchResult[0];
617
+ var parseResult = string.match(args.parsePattern);
618
+ if (!parseResult) return null;
619
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
620
+ value = options.valueCallback ? options.valueCallback(value) : value;
621
+ var rest = string.slice(matchedString.length);
622
+ return {
623
+ value: value,
624
+ rest: rest
625
+ };
626
+ };
627
+ }
628
+
629
+ var matchOrdinalNumberPattern$1 = /^(\d+)(th|st|nd|rd)?/i;
630
+ var parseOrdinalNumberPattern$1 = /\d+/i;
631
+ var matchEraPatterns$1 = {
632
+ narrow: /^(b|a)/i,
633
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
634
+ wide: /^(before christ|before common era|anno domini|common era)/i
635
+ };
636
+ var parseEraPatterns$1 = {
637
+ any: [/^b/i, /^(a|c)/i]
638
+ };
639
+ var matchQuarterPatterns$1 = {
640
+ narrow: /^[1234]/i,
641
+ abbreviated: /^q[1234]/i,
642
+ wide: /^[1234](th|st|nd|rd)? quarter/i
643
+ };
644
+ var parseQuarterPatterns$1 = {
645
+ any: [/1/i, /2/i, /3/i, /4/i]
646
+ };
647
+ var matchMonthPatterns$1 = {
648
+ narrow: /^[jfmasond]/i,
649
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
650
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
651
+ };
652
+ var parseMonthPatterns$1 = {
653
+ 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],
654
+ 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]
655
+ };
656
+ var matchDayPatterns$1 = {
657
+ narrow: /^[smtwf]/i,
658
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
659
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
660
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
661
+ };
662
+ var parseDayPatterns$1 = {
663
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
664
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
665
+ };
666
+ var matchDayPeriodPatterns$1 = {
667
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
668
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
669
+ };
670
+ var parseDayPeriodPatterns$1 = {
671
+ any: {
672
+ am: /^a/i,
673
+ pm: /^p/i,
674
+ midnight: /^mi/i,
675
+ noon: /^no/i,
676
+ morning: /morning/i,
677
+ afternoon: /afternoon/i,
678
+ evening: /evening/i,
679
+ night: /night/i
680
+ }
681
+ };
682
+ var match$1 = {
683
+ ordinalNumber: buildMatchPatternFn({
684
+ matchPattern: matchOrdinalNumberPattern$1,
685
+ parsePattern: parseOrdinalNumberPattern$1,
686
+ valueCallback: function (value) {
687
+ return parseInt(value, 10);
688
+ }
689
+ }),
690
+ era: buildMatchFn({
691
+ matchPatterns: matchEraPatterns$1,
692
+ defaultMatchWidth: 'wide',
693
+ parsePatterns: parseEraPatterns$1,
694
+ defaultParseWidth: 'any'
695
+ }),
696
+ quarter: buildMatchFn({
697
+ matchPatterns: matchQuarterPatterns$1,
698
+ defaultMatchWidth: 'wide',
699
+ parsePatterns: parseQuarterPatterns$1,
700
+ defaultParseWidth: 'any',
701
+ valueCallback: function (index) {
702
+ return index + 1;
703
+ }
704
+ }),
705
+ month: buildMatchFn({
706
+ matchPatterns: matchMonthPatterns$1,
707
+ defaultMatchWidth: 'wide',
708
+ parsePatterns: parseMonthPatterns$1,
709
+ defaultParseWidth: 'any'
710
+ }),
711
+ day: buildMatchFn({
712
+ matchPatterns: matchDayPatterns$1,
713
+ defaultMatchWidth: 'wide',
714
+ parsePatterns: parseDayPatterns$1,
715
+ defaultParseWidth: 'any'
716
+ }),
717
+ dayPeriod: buildMatchFn({
718
+ matchPatterns: matchDayPeriodPatterns$1,
719
+ defaultMatchWidth: 'any',
720
+ parsePatterns: parseDayPeriodPatterns$1,
721
+ defaultParseWidth: 'any'
722
+ })
723
+ };
724
+
725
+ /**
726
+ * @type {Locale}
727
+ * @category Locales
728
+ * @summary English locale (United States).
729
+ * @language English
730
+ * @iso-639-2 eng
731
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
732
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
733
+ */
734
+
735
+ var locale$1 = {
736
+ code: 'en-US',
737
+ formatDistance: formatDistance$1,
738
+ formatLong: formatLong$1,
739
+ formatRelative: formatRelative$1,
740
+ localize: localize$1,
741
+ match: match$1,
742
+ options: {
743
+ weekStartsOn: 0
744
+ /* Sunday */
745
+ ,
746
+ firstWeekContainsDate: 1
747
+ }
748
+ };
749
+
750
+ /**
751
+ * @name subMilliseconds
752
+ * @category Millisecond Helpers
753
+ * @summary Subtract the specified number of milliseconds from the given date.
754
+ *
755
+ * @description
756
+ * Subtract the specified number of milliseconds from the given date.
757
+ *
758
+ * ### v2.0.0 breaking changes:
759
+ *
760
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
761
+ *
762
+ * @param {Date|Number} date - the date to be changed
763
+ * @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`.
764
+ * @returns {Date} the new date with the milliseconds subtracted
765
+ * @throws {TypeError} 2 arguments required
766
+ *
767
+ * @example
768
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
769
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
770
+ * //=> Thu Jul 10 2014 12:45:29.250
771
+ */
772
+
773
+ function subMilliseconds(dirtyDate, dirtyAmount) {
774
+ requiredArgs(2, arguments);
775
+ var amount = toInteger(dirtyAmount);
776
+ return addMilliseconds(dirtyDate, -amount);
777
+ }
778
+
779
+ var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
780
+ // See issue: https://github.com/date-fns/date-fns/issues/376
781
+
782
+ function getUTCDayOfYear(dirtyDate) {
783
+ requiredArgs(1, arguments);
784
+ var date = toDate(dirtyDate);
785
+ var timestamp = date.getTime();
786
+ date.setUTCMonth(0, 1);
787
+ date.setUTCHours(0, 0, 0, 0);
788
+ var startOfYearTimestamp = date.getTime();
789
+ var difference = timestamp - startOfYearTimestamp;
790
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
791
+ }
792
+
793
+ // See issue: https://github.com/date-fns/date-fns/issues/376
794
+
795
+ function startOfUTCISOWeek(dirtyDate) {
796
+ requiredArgs(1, arguments);
797
+ var weekStartsOn = 1;
798
+ var date = toDate(dirtyDate);
799
+ var day = date.getUTCDay();
800
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
801
+ date.setUTCDate(date.getUTCDate() - diff);
802
+ date.setUTCHours(0, 0, 0, 0);
803
+ return date;
804
+ }
805
+
806
+ // See issue: https://github.com/date-fns/date-fns/issues/376
807
+
808
+ function getUTCISOWeekYear(dirtyDate) {
809
+ requiredArgs(1, arguments);
810
+ var date = toDate(dirtyDate);
811
+ var year = date.getUTCFullYear();
812
+ var fourthOfJanuaryOfNextYear = new Date(0);
813
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
814
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
815
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
816
+ var fourthOfJanuaryOfThisYear = new Date(0);
817
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
818
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
819
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
820
+
821
+ if (date.getTime() >= startOfNextYear.getTime()) {
822
+ return year + 1;
823
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
824
+ return year;
825
+ } else {
826
+ return year - 1;
827
+ }
828
+ }
829
+
830
+ // See issue: https://github.com/date-fns/date-fns/issues/376
831
+
832
+ function startOfUTCISOWeekYear(dirtyDate) {
833
+ requiredArgs(1, arguments);
834
+ var year = getUTCISOWeekYear(dirtyDate);
835
+ var fourthOfJanuary = new Date(0);
836
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
837
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
838
+ var date = startOfUTCISOWeek(fourthOfJanuary);
839
+ return date;
840
+ }
841
+
842
+ var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
843
+ // See issue: https://github.com/date-fns/date-fns/issues/376
844
+
845
+ function getUTCISOWeek(dirtyDate) {
846
+ requiredArgs(1, arguments);
847
+ var date = toDate(dirtyDate);
848
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
849
+ // because the number of milliseconds in a week is not constant
850
+ // (e.g. it's different in the week of the daylight saving time clock shift)
851
+
852
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
853
+ }
854
+
855
+ // See issue: https://github.com/date-fns/date-fns/issues/376
856
+
857
+ function startOfUTCWeek(dirtyDate, dirtyOptions) {
858
+ requiredArgs(1, arguments);
859
+ var options = dirtyOptions || {};
860
+ var locale = options.locale;
861
+ var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
862
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
863
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
864
+
865
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
866
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
867
+ }
868
+
869
+ var date = toDate(dirtyDate);
870
+ var day = date.getUTCDay();
871
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
872
+ date.setUTCDate(date.getUTCDate() - diff);
873
+ date.setUTCHours(0, 0, 0, 0);
874
+ return date;
875
+ }
876
+
877
+ // See issue: https://github.com/date-fns/date-fns/issues/376
878
+
879
+ function getUTCWeekYear(dirtyDate, dirtyOptions) {
880
+ requiredArgs(1, arguments);
881
+ var date = toDate(dirtyDate);
882
+ var year = date.getUTCFullYear();
883
+ var options = dirtyOptions || {};
884
+ var locale = options.locale;
885
+ var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
886
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
887
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
888
+
889
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
890
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
891
+ }
892
+
893
+ var firstWeekOfNextYear = new Date(0);
894
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
895
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
896
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
897
+ var firstWeekOfThisYear = new Date(0);
898
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
899
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
900
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
901
+
902
+ if (date.getTime() >= startOfNextYear.getTime()) {
903
+ return year + 1;
904
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
905
+ return year;
906
+ } else {
907
+ return year - 1;
908
+ }
909
+ }
910
+
911
+ // See issue: https://github.com/date-fns/date-fns/issues/376
912
+
913
+ function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
914
+ requiredArgs(1, arguments);
915
+ var options = dirtyOptions || {};
916
+ var locale = options.locale;
917
+ var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
918
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
919
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
920
+ var year = getUTCWeekYear(dirtyDate, dirtyOptions);
921
+ var firstWeek = new Date(0);
922
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
923
+ firstWeek.setUTCHours(0, 0, 0, 0);
924
+ var date = startOfUTCWeek(firstWeek, dirtyOptions);
925
+ return date;
926
+ }
927
+
928
+ var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
929
+ // See issue: https://github.com/date-fns/date-fns/issues/376
930
+
931
+ function getUTCWeek(dirtyDate, options) {
932
+ requiredArgs(1, arguments);
933
+ var date = toDate(dirtyDate);
934
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
935
+ // because the number of milliseconds in a week is not constant
936
+ // (e.g. it's different in the week of the daylight saving time clock shift)
937
+
938
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
939
+ }
940
+
941
+ function addLeadingZeros(number, targetLength) {
942
+ var sign = number < 0 ? '-' : '';
943
+ var output = Math.abs(number).toString();
944
+
945
+ while (output.length < targetLength) {
946
+ output = '0' + output;
947
+ }
948
+
949
+ return sign + output;
950
+ }
951
+
952
+ /*
953
+ * | | Unit | | Unit |
954
+ * |-----|--------------------------------|-----|--------------------------------|
955
+ * | a | AM, PM | A* | |
956
+ * | d | Day of month | D | |
957
+ * | h | Hour [1-12] | H | Hour [0-23] |
958
+ * | m | Minute | M | Month |
959
+ * | s | Second | S | Fraction of second |
960
+ * | y | Year (abs) | Y | |
961
+ *
962
+ * Letters marked by * are not implemented but reserved by Unicode standard.
963
+ */
964
+
965
+ var formatters$1 = {
966
+ // Year
967
+ y: function (date, token) {
968
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
969
+ // | Year | y | yy | yyy | yyyy | yyyyy |
970
+ // |----------|-------|----|-------|-------|-------|
971
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
972
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
973
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
974
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
975
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
976
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
977
+
978
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
979
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
980
+ },
981
+ // Month
982
+ M: function (date, token) {
983
+ var month = date.getUTCMonth();
984
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
985
+ },
986
+ // Day of the month
987
+ d: function (date, token) {
988
+ return addLeadingZeros(date.getUTCDate(), token.length);
989
+ },
990
+ // AM or PM
991
+ a: function (date, token) {
992
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
993
+
994
+ switch (token) {
995
+ case 'a':
996
+ case 'aa':
997
+ return dayPeriodEnumValue.toUpperCase();
998
+
999
+ case 'aaa':
1000
+ return dayPeriodEnumValue;
1001
+
1002
+ case 'aaaaa':
1003
+ return dayPeriodEnumValue[0];
1004
+
1005
+ case 'aaaa':
1006
+ default:
1007
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
1008
+ }
1009
+ },
1010
+ // Hour [1-12]
1011
+ h: function (date, token) {
1012
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
1013
+ },
1014
+ // Hour [0-23]
1015
+ H: function (date, token) {
1016
+ return addLeadingZeros(date.getUTCHours(), token.length);
1017
+ },
1018
+ // Minute
1019
+ m: function (date, token) {
1020
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
1021
+ },
1022
+ // Second
1023
+ s: function (date, token) {
1024
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
1025
+ },
1026
+ // Fraction of second
1027
+ S: function (date, token) {
1028
+ var numberOfDigits = token.length;
1029
+ var milliseconds = date.getUTCMilliseconds();
1030
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
1031
+ return addLeadingZeros(fractionalSeconds, token.length);
1032
+ }
1033
+ };
1034
+
1035
+ var dayPeriodEnum = {
1036
+ am: 'am',
1037
+ pm: 'pm',
1038
+ midnight: 'midnight',
1039
+ noon: 'noon',
1040
+ morning: 'morning',
1041
+ afternoon: 'afternoon',
1042
+ evening: 'evening',
1043
+ night: 'night'
1044
+ };
1045
+ /*
1046
+ * | | Unit | | Unit |
1047
+ * |-----|--------------------------------|-----|--------------------------------|
1048
+ * | a | AM, PM | A* | Milliseconds in day |
1049
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
1050
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
1051
+ * | d | Day of month | D | Day of year |
1052
+ * | e | Local day of week | E | Day of week |
1053
+ * | f | | F* | Day of week in month |
1054
+ * | g* | Modified Julian day | G | Era |
1055
+ * | h | Hour [1-12] | H | Hour [0-23] |
1056
+ * | i! | ISO day of week | I! | ISO week of year |
1057
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
1058
+ * | k | Hour [1-24] | K | Hour [0-11] |
1059
+ * | l* | (deprecated) | L | Stand-alone month |
1060
+ * | m | Minute | M | Month |
1061
+ * | n | | N | |
1062
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
1063
+ * | p! | Long localized time | P! | Long localized date |
1064
+ * | q | Stand-alone quarter | Q | Quarter |
1065
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
1066
+ * | s | Second | S | Fraction of second |
1067
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
1068
+ * | u | Extended year | U* | Cyclic year |
1069
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
1070
+ * | w | Local week of year | W* | Week of month |
1071
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
1072
+ * | y | Year (abs) | Y | Local week-numbering year |
1073
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
1074
+ *
1075
+ * Letters marked by * are not implemented but reserved by Unicode standard.
1076
+ *
1077
+ * Letters marked by ! are non-standard, but implemented by date-fns:
1078
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
1079
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
1080
+ * i.e. 7 for Sunday, 1 for Monday, etc.
1081
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
1082
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
1083
+ * `R` is supposed to be used in conjunction with `I` and `i`
1084
+ * for universal ISO week-numbering date, whereas
1085
+ * `Y` is supposed to be used in conjunction with `w` and `e`
1086
+ * for week-numbering date specific to the locale.
1087
+ * - `P` is long localized date format
1088
+ * - `p` is long localized time format
1089
+ */
1090
+
1091
+ var formatters = {
1092
+ // Era
1093
+ G: function (date, token, localize) {
1094
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
1095
+
1096
+ switch (token) {
1097
+ // AD, BC
1098
+ case 'G':
1099
+ case 'GG':
1100
+ case 'GGG':
1101
+ return localize.era(era, {
1102
+ width: 'abbreviated'
1103
+ });
1104
+ // A, B
1105
+
1106
+ case 'GGGGG':
1107
+ return localize.era(era, {
1108
+ width: 'narrow'
1109
+ });
1110
+ // Anno Domini, Before Christ
1111
+
1112
+ case 'GGGG':
1113
+ default:
1114
+ return localize.era(era, {
1115
+ width: 'wide'
1116
+ });
1117
+ }
1118
+ },
1119
+ // Year
1120
+ y: function (date, token, localize) {
1121
+ // Ordinal number
1122
+ if (token === 'yo') {
1123
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1124
+
1125
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
1126
+ return localize.ordinalNumber(year, {
1127
+ unit: 'year'
1128
+ });
1129
+ }
1130
+
1131
+ return formatters$1.y(date, token);
1132
+ },
1133
+ // Local week-numbering year
1134
+ Y: function (date, token, localize, options) {
1135
+ var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1136
+
1137
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
1138
+
1139
+ if (token === 'YY') {
1140
+ var twoDigitYear = weekYear % 100;
1141
+ return addLeadingZeros(twoDigitYear, 2);
1142
+ } // Ordinal number
1143
+
1144
+
1145
+ if (token === 'Yo') {
1146
+ return localize.ordinalNumber(weekYear, {
1147
+ unit: 'year'
1148
+ });
1149
+ } // Padding
1150
+
1151
+
1152
+ return addLeadingZeros(weekYear, token.length);
1153
+ },
1154
+ // ISO week-numbering year
1155
+ R: function (date, token) {
1156
+ var isoWeekYear = getUTCISOWeekYear(date); // Padding
1157
+
1158
+ return addLeadingZeros(isoWeekYear, token.length);
1159
+ },
1160
+ // Extended year. This is a single number designating the year of this calendar system.
1161
+ // The main difference between `y` and `u` localizers are B.C. years:
1162
+ // | Year | `y` | `u` |
1163
+ // |------|-----|-----|
1164
+ // | AC 1 | 1 | 1 |
1165
+ // | BC 1 | 1 | 0 |
1166
+ // | BC 2 | 2 | -1 |
1167
+ // Also `yy` always returns the last two digits of a year,
1168
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1169
+ u: function (date, token) {
1170
+ var year = date.getUTCFullYear();
1171
+ return addLeadingZeros(year, token.length);
1172
+ },
1173
+ // Quarter
1174
+ Q: function (date, token, localize) {
1175
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1176
+
1177
+ switch (token) {
1178
+ // 1, 2, 3, 4
1179
+ case 'Q':
1180
+ return String(quarter);
1181
+ // 01, 02, 03, 04
1182
+
1183
+ case 'QQ':
1184
+ return addLeadingZeros(quarter, 2);
1185
+ // 1st, 2nd, 3rd, 4th
1186
+
1187
+ case 'Qo':
1188
+ return localize.ordinalNumber(quarter, {
1189
+ unit: 'quarter'
1190
+ });
1191
+ // Q1, Q2, Q3, Q4
1192
+
1193
+ case 'QQQ':
1194
+ return localize.quarter(quarter, {
1195
+ width: 'abbreviated',
1196
+ context: 'formatting'
1197
+ });
1198
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1199
+
1200
+ case 'QQQQQ':
1201
+ return localize.quarter(quarter, {
1202
+ width: 'narrow',
1203
+ context: 'formatting'
1204
+ });
1205
+ // 1st quarter, 2nd quarter, ...
1206
+
1207
+ case 'QQQQ':
1208
+ default:
1209
+ return localize.quarter(quarter, {
1210
+ width: 'wide',
1211
+ context: 'formatting'
1212
+ });
1213
+ }
1214
+ },
1215
+ // Stand-alone quarter
1216
+ q: function (date, token, localize) {
1217
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1218
+
1219
+ switch (token) {
1220
+ // 1, 2, 3, 4
1221
+ case 'q':
1222
+ return String(quarter);
1223
+ // 01, 02, 03, 04
1224
+
1225
+ case 'qq':
1226
+ return addLeadingZeros(quarter, 2);
1227
+ // 1st, 2nd, 3rd, 4th
1228
+
1229
+ case 'qo':
1230
+ return localize.ordinalNumber(quarter, {
1231
+ unit: 'quarter'
1232
+ });
1233
+ // Q1, Q2, Q3, Q4
1234
+
1235
+ case 'qqq':
1236
+ return localize.quarter(quarter, {
1237
+ width: 'abbreviated',
1238
+ context: 'standalone'
1239
+ });
1240
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1241
+
1242
+ case 'qqqqq':
1243
+ return localize.quarter(quarter, {
1244
+ width: 'narrow',
1245
+ context: 'standalone'
1246
+ });
1247
+ // 1st quarter, 2nd quarter, ...
1248
+
1249
+ case 'qqqq':
1250
+ default:
1251
+ return localize.quarter(quarter, {
1252
+ width: 'wide',
1253
+ context: 'standalone'
1254
+ });
1255
+ }
1256
+ },
1257
+ // Month
1258
+ M: function (date, token, localize) {
1259
+ var month = date.getUTCMonth();
1260
+
1261
+ switch (token) {
1262
+ case 'M':
1263
+ case 'MM':
1264
+ return formatters$1.M(date, token);
1265
+ // 1st, 2nd, ..., 12th
1266
+
1267
+ case 'Mo':
1268
+ return localize.ordinalNumber(month + 1, {
1269
+ unit: 'month'
1270
+ });
1271
+ // Jan, Feb, ..., Dec
1272
+
1273
+ case 'MMM':
1274
+ return localize.month(month, {
1275
+ width: 'abbreviated',
1276
+ context: 'formatting'
1277
+ });
1278
+ // J, F, ..., D
1279
+
1280
+ case 'MMMMM':
1281
+ return localize.month(month, {
1282
+ width: 'narrow',
1283
+ context: 'formatting'
1284
+ });
1285
+ // January, February, ..., December
1286
+
1287
+ case 'MMMM':
1288
+ default:
1289
+ return localize.month(month, {
1290
+ width: 'wide',
1291
+ context: 'formatting'
1292
+ });
1293
+ }
1294
+ },
1295
+ // Stand-alone month
1296
+ L: function (date, token, localize) {
1297
+ var month = date.getUTCMonth();
1298
+
1299
+ switch (token) {
1300
+ // 1, 2, ..., 12
1301
+ case 'L':
1302
+ return String(month + 1);
1303
+ // 01, 02, ..., 12
1304
+
1305
+ case 'LL':
1306
+ return addLeadingZeros(month + 1, 2);
1307
+ // 1st, 2nd, ..., 12th
1308
+
1309
+ case 'Lo':
1310
+ return localize.ordinalNumber(month + 1, {
1311
+ unit: 'month'
1312
+ });
1313
+ // Jan, Feb, ..., Dec
1314
+
1315
+ case 'LLL':
1316
+ return localize.month(month, {
1317
+ width: 'abbreviated',
1318
+ context: 'standalone'
1319
+ });
1320
+ // J, F, ..., D
1321
+
1322
+ case 'LLLLL':
1323
+ return localize.month(month, {
1324
+ width: 'narrow',
1325
+ context: 'standalone'
1326
+ });
1327
+ // January, February, ..., December
1328
+
1329
+ case 'LLLL':
1330
+ default:
1331
+ return localize.month(month, {
1332
+ width: 'wide',
1333
+ context: 'standalone'
1334
+ });
1335
+ }
1336
+ },
1337
+ // Local week of year
1338
+ w: function (date, token, localize, options) {
1339
+ var week = getUTCWeek(date, options);
1340
+
1341
+ if (token === 'wo') {
1342
+ return localize.ordinalNumber(week, {
1343
+ unit: 'week'
1344
+ });
1345
+ }
1346
+
1347
+ return addLeadingZeros(week, token.length);
1348
+ },
1349
+ // ISO week of year
1350
+ I: function (date, token, localize) {
1351
+ var isoWeek = getUTCISOWeek(date);
1352
+
1353
+ if (token === 'Io') {
1354
+ return localize.ordinalNumber(isoWeek, {
1355
+ unit: 'week'
1356
+ });
1357
+ }
1358
+
1359
+ return addLeadingZeros(isoWeek, token.length);
1360
+ },
1361
+ // Day of the month
1362
+ d: function (date, token, localize) {
1363
+ if (token === 'do') {
1364
+ return localize.ordinalNumber(date.getUTCDate(), {
1365
+ unit: 'date'
1366
+ });
1367
+ }
1368
+
1369
+ return formatters$1.d(date, token);
1370
+ },
1371
+ // Day of year
1372
+ D: function (date, token, localize) {
1373
+ var dayOfYear = getUTCDayOfYear(date);
1374
+
1375
+ if (token === 'Do') {
1376
+ return localize.ordinalNumber(dayOfYear, {
1377
+ unit: 'dayOfYear'
1378
+ });
1379
+ }
1380
+
1381
+ return addLeadingZeros(dayOfYear, token.length);
1382
+ },
1383
+ // Day of week
1384
+ E: function (date, token, localize) {
1385
+ var dayOfWeek = date.getUTCDay();
1386
+
1387
+ switch (token) {
1388
+ // Tue
1389
+ case 'E':
1390
+ case 'EE':
1391
+ case 'EEE':
1392
+ return localize.day(dayOfWeek, {
1393
+ width: 'abbreviated',
1394
+ context: 'formatting'
1395
+ });
1396
+ // T
1397
+
1398
+ case 'EEEEE':
1399
+ return localize.day(dayOfWeek, {
1400
+ width: 'narrow',
1401
+ context: 'formatting'
1402
+ });
1403
+ // Tu
1404
+
1405
+ case 'EEEEEE':
1406
+ return localize.day(dayOfWeek, {
1407
+ width: 'short',
1408
+ context: 'formatting'
1409
+ });
1410
+ // Tuesday
1411
+
1412
+ case 'EEEE':
1413
+ default:
1414
+ return localize.day(dayOfWeek, {
1415
+ width: 'wide',
1416
+ context: 'formatting'
1417
+ });
1418
+ }
1419
+ },
1420
+ // Local day of week
1421
+ e: function (date, token, localize, options) {
1422
+ var dayOfWeek = date.getUTCDay();
1423
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1424
+
1425
+ switch (token) {
1426
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1427
+ case 'e':
1428
+ return String(localDayOfWeek);
1429
+ // Padded numerical value
1430
+
1431
+ case 'ee':
1432
+ return addLeadingZeros(localDayOfWeek, 2);
1433
+ // 1st, 2nd, ..., 7th
1434
+
1435
+ case 'eo':
1436
+ return localize.ordinalNumber(localDayOfWeek, {
1437
+ unit: 'day'
1438
+ });
1439
+
1440
+ case 'eee':
1441
+ return localize.day(dayOfWeek, {
1442
+ width: 'abbreviated',
1443
+ context: 'formatting'
1444
+ });
1445
+ // T
1446
+
1447
+ case 'eeeee':
1448
+ return localize.day(dayOfWeek, {
1449
+ width: 'narrow',
1450
+ context: 'formatting'
1451
+ });
1452
+ // Tu
1453
+
1454
+ case 'eeeeee':
1455
+ return localize.day(dayOfWeek, {
1456
+ width: 'short',
1457
+ context: 'formatting'
1458
+ });
1459
+ // Tuesday
1460
+
1461
+ case 'eeee':
1462
+ default:
1463
+ return localize.day(dayOfWeek, {
1464
+ width: 'wide',
1465
+ context: 'formatting'
1466
+ });
1467
+ }
1468
+ },
1469
+ // Stand-alone local day of week
1470
+ c: function (date, token, localize, options) {
1471
+ var dayOfWeek = date.getUTCDay();
1472
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1473
+
1474
+ switch (token) {
1475
+ // Numerical value (same as in `e`)
1476
+ case 'c':
1477
+ return String(localDayOfWeek);
1478
+ // Padded numerical value
1479
+
1480
+ case 'cc':
1481
+ return addLeadingZeros(localDayOfWeek, token.length);
1482
+ // 1st, 2nd, ..., 7th
1483
+
1484
+ case 'co':
1485
+ return localize.ordinalNumber(localDayOfWeek, {
1486
+ unit: 'day'
1487
+ });
1488
+
1489
+ case 'ccc':
1490
+ return localize.day(dayOfWeek, {
1491
+ width: 'abbreviated',
1492
+ context: 'standalone'
1493
+ });
1494
+ // T
1495
+
1496
+ case 'ccccc':
1497
+ return localize.day(dayOfWeek, {
1498
+ width: 'narrow',
1499
+ context: 'standalone'
1500
+ });
1501
+ // Tu
1502
+
1503
+ case 'cccccc':
1504
+ return localize.day(dayOfWeek, {
1505
+ width: 'short',
1506
+ context: 'standalone'
1507
+ });
1508
+ // Tuesday
1509
+
1510
+ case 'cccc':
1511
+ default:
1512
+ return localize.day(dayOfWeek, {
1513
+ width: 'wide',
1514
+ context: 'standalone'
1515
+ });
1516
+ }
1517
+ },
1518
+ // ISO day of week
1519
+ i: function (date, token, localize) {
1520
+ var dayOfWeek = date.getUTCDay();
1521
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1522
+
1523
+ switch (token) {
1524
+ // 2
1525
+ case 'i':
1526
+ return String(isoDayOfWeek);
1527
+ // 02
1528
+
1529
+ case 'ii':
1530
+ return addLeadingZeros(isoDayOfWeek, token.length);
1531
+ // 2nd
1532
+
1533
+ case 'io':
1534
+ return localize.ordinalNumber(isoDayOfWeek, {
1535
+ unit: 'day'
1536
+ });
1537
+ // Tue
1538
+
1539
+ case 'iii':
1540
+ return localize.day(dayOfWeek, {
1541
+ width: 'abbreviated',
1542
+ context: 'formatting'
1543
+ });
1544
+ // T
1545
+
1546
+ case 'iiiii':
1547
+ return localize.day(dayOfWeek, {
1548
+ width: 'narrow',
1549
+ context: 'formatting'
1550
+ });
1551
+ // Tu
1552
+
1553
+ case 'iiiiii':
1554
+ return localize.day(dayOfWeek, {
1555
+ width: 'short',
1556
+ context: 'formatting'
1557
+ });
1558
+ // Tuesday
1559
+
1560
+ case 'iiii':
1561
+ default:
1562
+ return localize.day(dayOfWeek, {
1563
+ width: 'wide',
1564
+ context: 'formatting'
1565
+ });
1566
+ }
1567
+ },
1568
+ // AM or PM
1569
+ a: function (date, token, localize) {
1570
+ var hours = date.getUTCHours();
1571
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1572
+
1573
+ switch (token) {
1574
+ case 'a':
1575
+ case 'aa':
1576
+ return localize.dayPeriod(dayPeriodEnumValue, {
1577
+ width: 'abbreviated',
1578
+ context: 'formatting'
1579
+ });
1580
+
1581
+ case 'aaa':
1582
+ return localize.dayPeriod(dayPeriodEnumValue, {
1583
+ width: 'abbreviated',
1584
+ context: 'formatting'
1585
+ }).toLowerCase();
1586
+
1587
+ case 'aaaaa':
1588
+ return localize.dayPeriod(dayPeriodEnumValue, {
1589
+ width: 'narrow',
1590
+ context: 'formatting'
1591
+ });
1592
+
1593
+ case 'aaaa':
1594
+ default:
1595
+ return localize.dayPeriod(dayPeriodEnumValue, {
1596
+ width: 'wide',
1597
+ context: 'formatting'
1598
+ });
1599
+ }
1600
+ },
1601
+ // AM, PM, midnight, noon
1602
+ b: function (date, token, localize) {
1603
+ var hours = date.getUTCHours();
1604
+ var dayPeriodEnumValue;
1605
+
1606
+ if (hours === 12) {
1607
+ dayPeriodEnumValue = dayPeriodEnum.noon;
1608
+ } else if (hours === 0) {
1609
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
1610
+ } else {
1611
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1612
+ }
1613
+
1614
+ switch (token) {
1615
+ case 'b':
1616
+ case 'bb':
1617
+ return localize.dayPeriod(dayPeriodEnumValue, {
1618
+ width: 'abbreviated',
1619
+ context: 'formatting'
1620
+ });
1621
+
1622
+ case 'bbb':
1623
+ return localize.dayPeriod(dayPeriodEnumValue, {
1624
+ width: 'abbreviated',
1625
+ context: 'formatting'
1626
+ }).toLowerCase();
1627
+
1628
+ case 'bbbbb':
1629
+ return localize.dayPeriod(dayPeriodEnumValue, {
1630
+ width: 'narrow',
1631
+ context: 'formatting'
1632
+ });
1633
+
1634
+ case 'bbbb':
1635
+ default:
1636
+ return localize.dayPeriod(dayPeriodEnumValue, {
1637
+ width: 'wide',
1638
+ context: 'formatting'
1639
+ });
1640
+ }
1641
+ },
1642
+ // in the morning, in the afternoon, in the evening, at night
1643
+ B: function (date, token, localize) {
1644
+ var hours = date.getUTCHours();
1645
+ var dayPeriodEnumValue;
1646
+
1647
+ if (hours >= 17) {
1648
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1649
+ } else if (hours >= 12) {
1650
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1651
+ } else if (hours >= 4) {
1652
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1653
+ } else {
1654
+ dayPeriodEnumValue = dayPeriodEnum.night;
1655
+ }
1656
+
1657
+ switch (token) {
1658
+ case 'B':
1659
+ case 'BB':
1660
+ case 'BBB':
1661
+ return localize.dayPeriod(dayPeriodEnumValue, {
1662
+ width: 'abbreviated',
1663
+ context: 'formatting'
1664
+ });
1665
+
1666
+ case 'BBBBB':
1667
+ return localize.dayPeriod(dayPeriodEnumValue, {
1668
+ width: 'narrow',
1669
+ context: 'formatting'
1670
+ });
1671
+
1672
+ case 'BBBB':
1673
+ default:
1674
+ return localize.dayPeriod(dayPeriodEnumValue, {
1675
+ width: 'wide',
1676
+ context: 'formatting'
1677
+ });
1678
+ }
1679
+ },
1680
+ // Hour [1-12]
1681
+ h: function (date, token, localize) {
1682
+ if (token === 'ho') {
1683
+ var hours = date.getUTCHours() % 12;
1684
+ if (hours === 0) hours = 12;
1685
+ return localize.ordinalNumber(hours, {
1686
+ unit: 'hour'
1687
+ });
1688
+ }
1689
+
1690
+ return formatters$1.h(date, token);
1691
+ },
1692
+ // Hour [0-23]
1693
+ H: function (date, token, localize) {
1694
+ if (token === 'Ho') {
1695
+ return localize.ordinalNumber(date.getUTCHours(), {
1696
+ unit: 'hour'
1697
+ });
1698
+ }
1699
+
1700
+ return formatters$1.H(date, token);
1701
+ },
1702
+ // Hour [0-11]
1703
+ K: function (date, token, localize) {
1704
+ var hours = date.getUTCHours() % 12;
1705
+
1706
+ if (token === 'Ko') {
1707
+ return localize.ordinalNumber(hours, {
1708
+ unit: 'hour'
1709
+ });
1710
+ }
1711
+
1712
+ return addLeadingZeros(hours, token.length);
1713
+ },
1714
+ // Hour [1-24]
1715
+ k: function (date, token, localize) {
1716
+ var hours = date.getUTCHours();
1717
+ if (hours === 0) hours = 24;
1718
+
1719
+ if (token === 'ko') {
1720
+ return localize.ordinalNumber(hours, {
1721
+ unit: 'hour'
1722
+ });
1723
+ }
1724
+
1725
+ return addLeadingZeros(hours, token.length);
1726
+ },
1727
+ // Minute
1728
+ m: function (date, token, localize) {
1729
+ if (token === 'mo') {
1730
+ return localize.ordinalNumber(date.getUTCMinutes(), {
1731
+ unit: 'minute'
1732
+ });
1733
+ }
1734
+
1735
+ return formatters$1.m(date, token);
1736
+ },
1737
+ // Second
1738
+ s: function (date, token, localize) {
1739
+ if (token === 'so') {
1740
+ return localize.ordinalNumber(date.getUTCSeconds(), {
1741
+ unit: 'second'
1742
+ });
1743
+ }
1744
+
1745
+ return formatters$1.s(date, token);
1746
+ },
1747
+ // Fraction of second
1748
+ S: function (date, token) {
1749
+ return formatters$1.S(date, token);
1750
+ },
1751
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1752
+ X: function (date, token, _localize, options) {
1753
+ var originalDate = options._originalDate || date;
1754
+ var timezoneOffset = originalDate.getTimezoneOffset();
1755
+
1756
+ if (timezoneOffset === 0) {
1757
+ return 'Z';
1758
+ }
1759
+
1760
+ switch (token) {
1761
+ // Hours and optional minutes
1762
+ case 'X':
1763
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1764
+ // Hours, minutes and optional seconds without `:` delimiter
1765
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1766
+ // so this token always has the same output as `XX`
1767
+
1768
+ case 'XXXX':
1769
+ case 'XX':
1770
+ // Hours and minutes without `:` delimiter
1771
+ return formatTimezone(timezoneOffset);
1772
+ // Hours, minutes and optional seconds with `:` delimiter
1773
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1774
+ // so this token always has the same output as `XXX`
1775
+
1776
+ case 'XXXXX':
1777
+ case 'XXX': // Hours and minutes with `:` delimiter
1778
+
1779
+ default:
1780
+ return formatTimezone(timezoneOffset, ':');
1781
+ }
1782
+ },
1783
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1784
+ x: function (date, token, _localize, options) {
1785
+ var originalDate = options._originalDate || date;
1786
+ var timezoneOffset = originalDate.getTimezoneOffset();
1787
+
1788
+ switch (token) {
1789
+ // Hours and optional minutes
1790
+ case 'x':
1791
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1792
+ // Hours, minutes and optional seconds without `:` delimiter
1793
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1794
+ // so this token always has the same output as `xx`
1795
+
1796
+ case 'xxxx':
1797
+ case 'xx':
1798
+ // Hours and minutes without `:` delimiter
1799
+ return formatTimezone(timezoneOffset);
1800
+ // Hours, minutes and optional seconds with `:` delimiter
1801
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1802
+ // so this token always has the same output as `xxx`
1803
+
1804
+ case 'xxxxx':
1805
+ case 'xxx': // Hours and minutes with `:` delimiter
1806
+
1807
+ default:
1808
+ return formatTimezone(timezoneOffset, ':');
1809
+ }
1810
+ },
1811
+ // Timezone (GMT)
1812
+ O: function (date, token, _localize, options) {
1813
+ var originalDate = options._originalDate || date;
1814
+ var timezoneOffset = originalDate.getTimezoneOffset();
1815
+
1816
+ switch (token) {
1817
+ // Short
1818
+ case 'O':
1819
+ case 'OO':
1820
+ case 'OOO':
1821
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1822
+ // Long
1823
+
1824
+ case 'OOOO':
1825
+ default:
1826
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1827
+ }
1828
+ },
1829
+ // Timezone (specific non-location)
1830
+ z: function (date, token, _localize, options) {
1831
+ var originalDate = options._originalDate || date;
1832
+ var timezoneOffset = originalDate.getTimezoneOffset();
1833
+
1834
+ switch (token) {
1835
+ // Short
1836
+ case 'z':
1837
+ case 'zz':
1838
+ case 'zzz':
1839
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1840
+ // Long
1841
+
1842
+ case 'zzzz':
1843
+ default:
1844
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1845
+ }
1846
+ },
1847
+ // Seconds timestamp
1848
+ t: function (date, token, _localize, options) {
1849
+ var originalDate = options._originalDate || date;
1850
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
1851
+ return addLeadingZeros(timestamp, token.length);
1852
+ },
1853
+ // Milliseconds timestamp
1854
+ T: function (date, token, _localize, options) {
1855
+ var originalDate = options._originalDate || date;
1856
+ var timestamp = originalDate.getTime();
1857
+ return addLeadingZeros(timestamp, token.length);
1858
+ }
1859
+ };
1860
+
1861
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1862
+ var sign = offset > 0 ? '-' : '+';
1863
+ var absOffset = Math.abs(offset);
1864
+ var hours = Math.floor(absOffset / 60);
1865
+ var minutes = absOffset % 60;
1866
+
1867
+ if (minutes === 0) {
1868
+ return sign + String(hours);
1869
+ }
1870
+
1871
+ var delimiter = dirtyDelimiter || '';
1872
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1873
+ }
1874
+
1875
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1876
+ if (offset % 60 === 0) {
1877
+ var sign = offset > 0 ? '-' : '+';
1878
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1879
+ }
1880
+
1881
+ return formatTimezone(offset, dirtyDelimiter);
1882
+ }
1883
+
1884
+ function formatTimezone(offset, dirtyDelimiter) {
1885
+ var delimiter = dirtyDelimiter || '';
1886
+ var sign = offset > 0 ? '-' : '+';
1887
+ var absOffset = Math.abs(offset);
1888
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1889
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1890
+ return sign + hours + delimiter + minutes;
1891
+ }
1892
+
1893
+ function dateLongFormatter(pattern, formatLong) {
1894
+ switch (pattern) {
1895
+ case 'P':
1896
+ return formatLong.date({
1897
+ width: 'short'
1898
+ });
1899
+
1900
+ case 'PP':
1901
+ return formatLong.date({
1902
+ width: 'medium'
1903
+ });
1904
+
1905
+ case 'PPP':
1906
+ return formatLong.date({
1907
+ width: 'long'
1908
+ });
1909
+
1910
+ case 'PPPP':
1911
+ default:
1912
+ return formatLong.date({
1913
+ width: 'full'
1914
+ });
1915
+ }
1916
+ }
1917
+
1918
+ function timeLongFormatter(pattern, formatLong) {
1919
+ switch (pattern) {
1920
+ case 'p':
1921
+ return formatLong.time({
1922
+ width: 'short'
1923
+ });
1924
+
1925
+ case 'pp':
1926
+ return formatLong.time({
1927
+ width: 'medium'
1928
+ });
1929
+
1930
+ case 'ppp':
1931
+ return formatLong.time({
1932
+ width: 'long'
1933
+ });
1934
+
1935
+ case 'pppp':
1936
+ default:
1937
+ return formatLong.time({
1938
+ width: 'full'
1939
+ });
1940
+ }
1941
+ }
1942
+
1943
+ function dateTimeLongFormatter(pattern, formatLong) {
1944
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1945
+ var datePattern = matchResult[1];
1946
+ var timePattern = matchResult[2];
1947
+
1948
+ if (!timePattern) {
1949
+ return dateLongFormatter(pattern, formatLong);
1950
+ }
1951
+
1952
+ var dateTimeFormat;
1953
+
1954
+ switch (datePattern) {
1955
+ case 'P':
1956
+ dateTimeFormat = formatLong.dateTime({
1957
+ width: 'short'
1958
+ });
1959
+ break;
1960
+
1961
+ case 'PP':
1962
+ dateTimeFormat = formatLong.dateTime({
1963
+ width: 'medium'
1964
+ });
1965
+ break;
1966
+
1967
+ case 'PPP':
1968
+ dateTimeFormat = formatLong.dateTime({
1969
+ width: 'long'
1970
+ });
1971
+ break;
1972
+
1973
+ case 'PPPP':
1974
+ default:
1975
+ dateTimeFormat = formatLong.dateTime({
1976
+ width: 'full'
1977
+ });
1978
+ break;
1979
+ }
1980
+
1981
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1982
+ }
1983
+
1984
+ var longFormatters = {
1985
+ p: timeLongFormatter,
1986
+ P: dateTimeLongFormatter
1987
+ };
1988
+
1989
+ var protectedDayOfYearTokens = ['D', 'DD'];
1990
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1991
+ function isProtectedDayOfYearToken(token) {
1992
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1993
+ }
1994
+ function isProtectedWeekYearToken(token) {
1995
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1996
+ }
1997
+ function throwProtectedError(token, format, input) {
1998
+ if (token === 'YYYY') {
1999
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2000
+ } else if (token === 'YY') {
2001
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2002
+ } else if (token === 'D') {
2003
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2004
+ } else if (token === 'DD') {
2005
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2006
+ }
2007
+ }
2008
+
2009
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2010
+ // (one of the certain letters followed by `o`)
2011
+ // - (\w)\1* matches any sequences of the same letter
2012
+ // - '' matches two quote characters in a row
2013
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
2014
+ // except a single quote symbol, which ends the sequence.
2015
+ // Two quote characters do not end the sequence.
2016
+ // If there is no matching single quote
2017
+ // then the sequence will continue until the end of the string.
2018
+ // - . matches any single character unmatched by previous parts of the RegExps
2019
+
2020
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
2021
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2022
+
2023
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2024
+ var escapedStringRegExp = /^'([^]*?)'?$/;
2025
+ var doubleQuoteRegExp = /''/g;
2026
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2027
+ /**
2028
+ * @name format
2029
+ * @category Common Helpers
2030
+ * @summary Format the date.
2031
+ *
2032
+ * @description
2033
+ * Return the formatted date string in the given format. The result may vary by locale.
2034
+ *
2035
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2036
+ * > See: https://git.io/fxCyr
2037
+ *
2038
+ * The characters wrapped between two single quotes characters (') are escaped.
2039
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
2040
+ * (see the last example)
2041
+ *
2042
+ * Format of the string is based on Unicode Technical Standard #35:
2043
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
2044
+ * with a few additions (see note 7 below the table).
2045
+ *
2046
+ * Accepted patterns:
2047
+ * | Unit | Pattern | Result examples | Notes |
2048
+ * |---------------------------------|---------|-----------------------------------|-------|
2049
+ * | Era | G..GGG | AD, BC | |
2050
+ * | | GGGG | Anno Domini, Before Christ | 2 |
2051
+ * | | GGGGG | A, B | |
2052
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
2053
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
2054
+ * | | yy | 44, 01, 00, 17 | 5 |
2055
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
2056
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
2057
+ * | | yyyyy | ... | 3,5 |
2058
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
2059
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
2060
+ * | | YY | 44, 01, 00, 17 | 5,8 |
2061
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
2062
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
2063
+ * | | YYYYY | ... | 3,5 |
2064
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
2065
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
2066
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
2067
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
2068
+ * | | RRRRR | ... | 3,5,7 |
2069
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
2070
+ * | | uu | -43, 01, 1900, 2017 | 5 |
2071
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
2072
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
2073
+ * | | uuuuu | ... | 3,5 |
2074
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
2075
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
2076
+ * | | QQ | 01, 02, 03, 04 | |
2077
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
2078
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
2079
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
2080
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
2081
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
2082
+ * | | qq | 01, 02, 03, 04 | |
2083
+ * | | qqq | Q1, Q2, Q3, Q4 | |
2084
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
2085
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
2086
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
2087
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
2088
+ * | | MM | 01, 02, ..., 12 | |
2089
+ * | | MMM | Jan, Feb, ..., Dec | |
2090
+ * | | MMMM | January, February, ..., December | 2 |
2091
+ * | | MMMMM | J, F, ..., D | |
2092
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2093
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2094
+ * | | LL | 01, 02, ..., 12 | |
2095
+ * | | LLL | Jan, Feb, ..., Dec | |
2096
+ * | | LLLL | January, February, ..., December | 2 |
2097
+ * | | LLLLL | J, F, ..., D | |
2098
+ * | Local week of year | w | 1, 2, ..., 53 | |
2099
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2100
+ * | | ww | 01, 02, ..., 53 | |
2101
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2102
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2103
+ * | | II | 01, 02, ..., 53 | 7 |
2104
+ * | Day of month | d | 1, 2, ..., 31 | |
2105
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2106
+ * | | dd | 01, 02, ..., 31 | |
2107
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2108
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2109
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2110
+ * | | DDD | 001, 002, ..., 365, 366 | |
2111
+ * | | DDDD | ... | 3 |
2112
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2113
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2114
+ * | | EEEEE | M, T, W, T, F, S, S | |
2115
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2116
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2117
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2118
+ * | | ii | 01, 02, ..., 07 | 7 |
2119
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2120
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2121
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2122
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2123
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2124
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2125
+ * | | ee | 02, 03, ..., 01 | |
2126
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2127
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2128
+ * | | eeeee | M, T, W, T, F, S, S | |
2129
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2130
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2131
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2132
+ * | | cc | 02, 03, ..., 01 | |
2133
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2134
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2135
+ * | | ccccc | M, T, W, T, F, S, S | |
2136
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2137
+ * | AM, PM | a..aa | AM, PM | |
2138
+ * | | aaa | am, pm | |
2139
+ * | | aaaa | a.m., p.m. | 2 |
2140
+ * | | aaaaa | a, p | |
2141
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2142
+ * | | bbb | am, pm, noon, midnight | |
2143
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2144
+ * | | bbbbb | a, p, n, mi | |
2145
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2146
+ * | | BBBB | at night, in the morning, ... | 2 |
2147
+ * | | BBBBB | at night, in the morning, ... | |
2148
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2149
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2150
+ * | | hh | 01, 02, ..., 11, 12 | |
2151
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2152
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2153
+ * | | HH | 00, 01, 02, ..., 23 | |
2154
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2155
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2156
+ * | | KK | 01, 02, ..., 11, 00 | |
2157
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2158
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2159
+ * | | kk | 24, 01, 02, ..., 23 | |
2160
+ * | Minute | m | 0, 1, ..., 59 | |
2161
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2162
+ * | | mm | 00, 01, ..., 59 | |
2163
+ * | Second | s | 0, 1, ..., 59 | |
2164
+ * | | so | 0th, 1st, ..., 59th | 7 |
2165
+ * | | ss | 00, 01, ..., 59 | |
2166
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2167
+ * | | SS | 00, 01, ..., 99 | |
2168
+ * | | SSS | 000, 001, ..., 999 | |
2169
+ * | | SSSS | ... | 3 |
2170
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2171
+ * | | XX | -0800, +0530, Z | |
2172
+ * | | XXX | -08:00, +05:30, Z | |
2173
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2174
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2175
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2176
+ * | | xx | -0800, +0530, +0000 | |
2177
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2178
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2179
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2180
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2181
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2182
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2183
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2184
+ * | Seconds timestamp | t | 512969520 | 7 |
2185
+ * | | tt | ... | 3,7 |
2186
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2187
+ * | | TT | ... | 3,7 |
2188
+ * | Long localized date | P | 04/29/1453 | 7 |
2189
+ * | | PP | Apr 29, 1453 | 7 |
2190
+ * | | PPP | April 29th, 1453 | 7 |
2191
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2192
+ * | Long localized time | p | 12:00 AM | 7 |
2193
+ * | | pp | 12:00:00 AM | 7 |
2194
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2195
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2196
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2197
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2198
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2199
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2200
+ * Notes:
2201
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2202
+ * are the same as "stand-alone" units, but are different in some languages.
2203
+ * "Formatting" units are declined according to the rules of the language
2204
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2205
+ *
2206
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2207
+ *
2208
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2209
+ *
2210
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2211
+ * the single quote characters (see below).
2212
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2213
+ * the output will be the same as default pattern for this unit, usually
2214
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2215
+ * are marked with "2" in the last column of the table.
2216
+ *
2217
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2218
+ *
2219
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2220
+ *
2221
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2222
+ *
2223
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2224
+ *
2225
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2226
+ *
2227
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2228
+ * The output will be padded with zeros to match the length of the pattern.
2229
+ *
2230
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2231
+ *
2232
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2233
+ * These tokens represent the shortest form of the quarter.
2234
+ *
2235
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2236
+ *
2237
+ * | Year | `y` | `u` |
2238
+ * |------|-----|-----|
2239
+ * | AC 1 | 1 | 1 |
2240
+ * | BC 1 | 1 | 0 |
2241
+ * | BC 2 | 2 | -1 |
2242
+ *
2243
+ * Also `yy` always returns the last two digits of a year,
2244
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2245
+ *
2246
+ * | Year | `yy` | `uu` |
2247
+ * |------|------|------|
2248
+ * | 1 | 01 | 01 |
2249
+ * | 14 | 14 | 14 |
2250
+ * | 376 | 76 | 376 |
2251
+ * | 1453 | 53 | 1453 |
2252
+ *
2253
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2254
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2255
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2256
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2257
+ *
2258
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2259
+ * so right now these tokens fall back to GMT timezones.
2260
+ *
2261
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2262
+ * - `i`: ISO day of week
2263
+ * - `I`: ISO week of year
2264
+ * - `R`: ISO week-numbering year
2265
+ * - `t`: seconds timestamp
2266
+ * - `T`: milliseconds timestamp
2267
+ * - `o`: ordinal number modifier
2268
+ * - `P`: long localized date
2269
+ * - `p`: long localized time
2270
+ *
2271
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2272
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
2273
+ *
2274
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2275
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
2276
+ *
2277
+ * ### v2.0.0 breaking changes:
2278
+ *
2279
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
2280
+ *
2281
+ * - The second argument is now required for the sake of explicitness.
2282
+ *
2283
+ * ```javascript
2284
+ * // Before v2.0.0
2285
+ * format(new Date(2016, 0, 1))
2286
+ *
2287
+ * // v2.0.0 onward
2288
+ * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
2289
+ * ```
2290
+ *
2291
+ * - New format string API for `format` function
2292
+ * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
2293
+ * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
2294
+ *
2295
+ * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
2296
+ *
2297
+ * @param {Date|Number} date - the original date
2298
+ * @param {String} format - the string of tokens
2299
+ * @param {Object} [options] - an object with options.
2300
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2301
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2302
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2303
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2304
+ * see: https://git.io/fxCyr
2305
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2306
+ * see: https://git.io/fxCyr
2307
+ * @returns {String} the formatted date string
2308
+ * @throws {TypeError} 2 arguments required
2309
+ * @throws {RangeError} `date` must not be Invalid Date
2310
+ * @throws {RangeError} `options.locale` must contain `localize` property
2311
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2312
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2313
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2314
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2315
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2316
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2317
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2318
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2319
+ *
2320
+ * @example
2321
+ * // Represent 11 February 2014 in middle-endian format:
2322
+ * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2323
+ * //=> '02/11/2014'
2324
+ *
2325
+ * @example
2326
+ * // Represent 2 July 2014 in Esperanto:
2327
+ * import { eoLocale } from 'date-fns/locale/eo'
2328
+ * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2329
+ * locale: eoLocale
2330
+ * })
2331
+ * //=> '2-a de julio 2014'
2332
+ *
2333
+ * @example
2334
+ * // Escape string by single quote characters:
2335
+ * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2336
+ * //=> "3 o'clock"
2337
+ */
2338
+
2339
+ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
2340
+ requiredArgs(2, arguments);
2341
+ var formatStr = String(dirtyFormatStr);
2342
+ var options = dirtyOptions || {};
2343
+ var locale = options.locale || locale$1;
2344
+ var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
2345
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
2346
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2347
+
2348
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2349
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2350
+ }
2351
+
2352
+ var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
2353
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
2354
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2355
+
2356
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2357
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2358
+ }
2359
+
2360
+ if (!locale.localize) {
2361
+ throw new RangeError('locale must contain localize property');
2362
+ }
2363
+
2364
+ if (!locale.formatLong) {
2365
+ throw new RangeError('locale must contain formatLong property');
2366
+ }
2367
+
2368
+ var originalDate = toDate(dirtyDate);
2369
+
2370
+ if (!isValid(originalDate)) {
2371
+ throw new RangeError('Invalid time value');
2372
+ } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2373
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2374
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2375
+
2376
+
2377
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2378
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2379
+ var formatterOptions = {
2380
+ firstWeekContainsDate: firstWeekContainsDate,
2381
+ weekStartsOn: weekStartsOn,
2382
+ locale: locale,
2383
+ _originalDate: originalDate
2384
+ };
2385
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2386
+ var firstCharacter = substring[0];
2387
+
2388
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2389
+ var longFormatter = longFormatters[firstCharacter];
2390
+ return longFormatter(substring, locale.formatLong, formatterOptions);
2391
+ }
2392
+
2393
+ return substring;
2394
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2395
+ // Replace two single quote characters with one single quote character
2396
+ if (substring === "''") {
2397
+ return "'";
2398
+ }
2399
+
2400
+ var firstCharacter = substring[0];
2401
+
2402
+ if (firstCharacter === "'") {
2403
+ return cleanEscapedString(substring);
2404
+ }
2405
+
2406
+ var formatter = formatters[firstCharacter];
2407
+
2408
+ if (formatter) {
2409
+ if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
2410
+ throwProtectedError(substring, dirtyFormatStr, dirtyDate);
2411
+ }
2412
+
2413
+ if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
2414
+ throwProtectedError(substring, dirtyFormatStr, dirtyDate);
2415
+ }
2416
+
2417
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2418
+ }
2419
+
2420
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2421
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2422
+ }
2423
+
2424
+ return substring;
2425
+ }).join('');
2426
+ return result;
2427
+ }
2428
+
2429
+ function cleanEscapedString(input) {
2430
+ return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
2431
+ }
2432
+
2433
+ /**
2434
+ * @name isBefore
2435
+ * @category Common Helpers
2436
+ * @summary Is the first date before the second one?
2437
+ *
2438
+ * @description
2439
+ * Is the first date before the second one?
2440
+ *
2441
+ * ### v2.0.0 breaking changes:
2442
+ *
2443
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
2444
+ *
2445
+ * @param {Date|Number} date - the date that should be before the other one to return true
2446
+ * @param {Date|Number} dateToCompare - the date to compare with
2447
+ * @returns {Boolean} the first date is before the second date
2448
+ * @throws {TypeError} 2 arguments required
2449
+ *
2450
+ * @example
2451
+ * // Is 10 July 1989 before 11 February 1987?
2452
+ * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
2453
+ * //=> false
2454
+ */
2455
+
2456
+ function isBefore(dirtyDate, dirtyDateToCompare) {
2457
+ requiredArgs(2, arguments);
2458
+ var date = toDate(dirtyDate);
2459
+ var dateToCompare = toDate(dirtyDateToCompare);
2460
+ return date.getTime() < dateToCompare.getTime();
2461
+ }
2462
+
2463
+ /**
2464
+ * @name isEqual
2465
+ * @category Common Helpers
2466
+ * @summary Are the given dates equal?
2467
+ *
2468
+ * @description
2469
+ * Are the given dates equal?
2470
+ *
2471
+ * ### v2.0.0 breaking changes:
2472
+ *
2473
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
2474
+ *
2475
+ * @param {Date|Number} dateLeft - the first date to compare
2476
+ * @param {Date|Number} dateRight - the second date to compare
2477
+ * @returns {Boolean} the dates are equal
2478
+ * @throws {TypeError} 2 arguments required
2479
+ *
2480
+ * @example
2481
+ * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?
2482
+ * var result = isEqual(
2483
+ * new Date(2014, 6, 2, 6, 30, 45, 0),
2484
+ * new Date(2014, 6, 2, 6, 30, 45, 500)
2485
+ * )
2486
+ * //=> false
2487
+ */
2488
+
2489
+ function isEqual(dirtyLeftDate, dirtyRightDate) {
2490
+ requiredArgs(2, arguments);
2491
+ var dateLeft = toDate(dirtyLeftDate);
2492
+ var dateRight = toDate(dirtyRightDate);
2493
+ return dateLeft.getTime() === dateRight.getTime();
2494
+ }
2495
+
2496
+ var formatDistanceLocale = {
2497
+ lessThanXSeconds: {
2498
+ standalone: {
2499
+ one: 'weniger als 1 Sekunde',
2500
+ other: 'weniger als {{count}} Sekunden'
2501
+ },
2502
+ withPreposition: {
2503
+ one: 'weniger als 1 Sekunde',
2504
+ other: 'weniger als {{count}} Sekunden'
2505
+ }
2506
+ },
2507
+ xSeconds: {
2508
+ standalone: {
2509
+ one: '1 Sekunde',
2510
+ other: '{{count}} Sekunden'
2511
+ },
2512
+ withPreposition: {
2513
+ one: '1 Sekunde',
2514
+ other: '{{count}} Sekunden'
2515
+ }
2516
+ },
2517
+ halfAMinute: {
2518
+ standalone: 'halbe Minute',
2519
+ withPreposition: 'halben Minute'
2520
+ },
2521
+ lessThanXMinutes: {
2522
+ standalone: {
2523
+ one: 'weniger als 1 Minute',
2524
+ other: 'weniger als {{count}} Minuten'
2525
+ },
2526
+ withPreposition: {
2527
+ one: 'weniger als 1 Minute',
2528
+ other: 'weniger als {{count}} Minuten'
2529
+ }
2530
+ },
2531
+ xMinutes: {
2532
+ standalone: {
2533
+ one: '1 Minute',
2534
+ other: '{{count}} Minuten'
2535
+ },
2536
+ withPreposition: {
2537
+ one: '1 Minute',
2538
+ other: '{{count}} Minuten'
2539
+ }
2540
+ },
2541
+ aboutXHours: {
2542
+ standalone: {
2543
+ one: 'etwa 1 Stunde',
2544
+ other: 'etwa {{count}} Stunden'
2545
+ },
2546
+ withPreposition: {
2547
+ one: 'etwa 1 Stunde',
2548
+ other: 'etwa {{count}} Stunden'
2549
+ }
2550
+ },
2551
+ xHours: {
2552
+ standalone: {
2553
+ one: '1 Stunde',
2554
+ other: '{{count}} Stunden'
2555
+ },
2556
+ withPreposition: {
2557
+ one: '1 Stunde',
2558
+ other: '{{count}} Stunden'
2559
+ }
2560
+ },
2561
+ xDays: {
2562
+ standalone: {
2563
+ one: '1 Tag',
2564
+ other: '{{count}} Tage'
2565
+ },
2566
+ withPreposition: {
2567
+ one: '1 Tag',
2568
+ other: '{{count}} Tagen'
2569
+ }
2570
+ },
2571
+ aboutXWeeks: {
2572
+ standalone: {
2573
+ one: 'etwa 1 Woche',
2574
+ other: 'etwa {{count}} Wochen'
2575
+ },
2576
+ withPreposition: {
2577
+ one: 'etwa 1 Woche',
2578
+ other: 'etwa {{count}} Wochen'
2579
+ }
2580
+ },
2581
+ xWeeks: {
2582
+ standalone: {
2583
+ one: '1 Woche',
2584
+ other: '{{count}} Wochen'
2585
+ },
2586
+ withPreposition: {
2587
+ one: '1 Woche',
2588
+ other: '{{count}} Wochen'
2589
+ }
2590
+ },
2591
+ aboutXMonths: {
2592
+ standalone: {
2593
+ one: 'etwa 1 Monat',
2594
+ other: 'etwa {{count}} Monate'
2595
+ },
2596
+ withPreposition: {
2597
+ one: 'etwa 1 Monat',
2598
+ other: 'etwa {{count}} Monaten'
2599
+ }
2600
+ },
2601
+ xMonths: {
2602
+ standalone: {
2603
+ one: '1 Monat',
2604
+ other: '{{count}} Monate'
2605
+ },
2606
+ withPreposition: {
2607
+ one: '1 Monat',
2608
+ other: '{{count}} Monaten'
2609
+ }
2610
+ },
2611
+ aboutXYears: {
2612
+ standalone: {
2613
+ one: 'etwa 1 Jahr',
2614
+ other: 'etwa {{count}} Jahre'
2615
+ },
2616
+ withPreposition: {
2617
+ one: 'etwa 1 Jahr',
2618
+ other: 'etwa {{count}} Jahren'
2619
+ }
2620
+ },
2621
+ xYears: {
2622
+ standalone: {
2623
+ one: '1 Jahr',
2624
+ other: '{{count}} Jahre'
2625
+ },
2626
+ withPreposition: {
2627
+ one: '1 Jahr',
2628
+ other: '{{count}} Jahren'
2629
+ }
2630
+ },
2631
+ overXYears: {
2632
+ standalone: {
2633
+ one: 'mehr als 1 Jahr',
2634
+ other: 'mehr als {{count}} Jahre'
2635
+ },
2636
+ withPreposition: {
2637
+ one: 'mehr als 1 Jahr',
2638
+ other: 'mehr als {{count}} Jahren'
2639
+ }
2640
+ },
2641
+ almostXYears: {
2642
+ standalone: {
2643
+ one: 'fast 1 Jahr',
2644
+ other: 'fast {{count}} Jahre'
2645
+ },
2646
+ withPreposition: {
2647
+ one: 'fast 1 Jahr',
2648
+ other: 'fast {{count}} Jahren'
2649
+ }
2650
+ }
2651
+ };
2652
+
2653
+ var formatDistance = function (token, count, options) {
2654
+ var result;
2655
+ var tokenValue = options !== null && options !== void 0 && options.addSuffix ? formatDistanceLocale[token].withPreposition : formatDistanceLocale[token].standalone;
2656
+
2657
+ if (typeof tokenValue === 'string') {
2658
+ result = tokenValue;
2659
+ } else if (count === 1) {
2660
+ result = tokenValue.one;
2661
+ } else {
2662
+ result = tokenValue.other.replace('{{count}}', String(count));
2663
+ }
2664
+
2665
+ if (options !== null && options !== void 0 && options.addSuffix) {
2666
+ if (options.comparison && options.comparison > 0) {
2667
+ return 'in ' + result;
2668
+ } else {
2669
+ return 'vor ' + result;
2670
+ }
2671
+ }
2672
+
2673
+ return result;
2674
+ };
2675
+
2676
+ var dateFormats = {
2677
+ full: 'EEEE, do MMMM y',
2678
+ // Montag, 7. Januar 2018
2679
+ long: 'do MMMM y',
2680
+ // 7. Januar 2018
2681
+ medium: 'do MMM y',
2682
+ // 7. Jan. 2018
2683
+ short: 'dd.MM.y' // 07.01.2018
2684
+
2685
+ };
2686
+ var timeFormats = {
2687
+ full: 'HH:mm:ss zzzz',
2688
+ long: 'HH:mm:ss z',
2689
+ medium: 'HH:mm:ss',
2690
+ short: 'HH:mm'
2691
+ };
2692
+ var dateTimeFormats = {
2693
+ full: "{{date}} 'um' {{time}}",
2694
+ long: "{{date}} 'um' {{time}}",
2695
+ medium: '{{date}} {{time}}',
2696
+ short: '{{date}} {{time}}'
2697
+ };
2698
+ var formatLong = {
2699
+ date: buildFormatLongFn({
2700
+ formats: dateFormats,
2701
+ defaultWidth: 'full'
2702
+ }),
2703
+ time: buildFormatLongFn({
2704
+ formats: timeFormats,
2705
+ defaultWidth: 'full'
2706
+ }),
2707
+ dateTime: buildFormatLongFn({
2708
+ formats: dateTimeFormats,
2709
+ defaultWidth: 'full'
2710
+ })
2711
+ };
2712
+
2713
+ var formatRelativeLocale = {
2714
+ lastWeek: "'letzten' eeee 'um' p",
2715
+ yesterday: "'gestern um' p",
2716
+ today: "'heute um' p",
2717
+ tomorrow: "'morgen um' p",
2718
+ nextWeek: "eeee 'um' p",
2719
+ other: 'P'
2720
+ };
2721
+
2722
+ var formatRelative = function (token, _date, _baseDate, _options) {
2723
+ return formatRelativeLocale[token];
2724
+ };
2725
+
2726
+ var eraValues = {
2727
+ narrow: ['v.Chr.', 'n.Chr.'],
2728
+ abbreviated: ['v.Chr.', 'n.Chr.'],
2729
+ wide: ['vor Christus', 'nach Christus']
2730
+ };
2731
+ var quarterValues = {
2732
+ narrow: ['1', '2', '3', '4'],
2733
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
2734
+ wide: ['1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal']
2735
+ }; // Note: in German, the names of days of the week and months are capitalized.
2736
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
2737
+ // Generally, formatted dates should look like they are in the middle of a sentence,
2738
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
2739
+
2740
+ var monthValues = {
2741
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
2742
+ abbreviated: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
2743
+ wide: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
2744
+ }; // https://st.unicode.org/cldr-apps/v#/de/Gregorian/
2745
+
2746
+ var formattingMonthValues = {
2747
+ narrow: monthValues.narrow,
2748
+ abbreviated: ['Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Dez.'],
2749
+ wide: monthValues.wide
2750
+ };
2751
+ var dayValues = {
2752
+ narrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
2753
+ short: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
2754
+ abbreviated: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
2755
+ wide: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag']
2756
+ }; // https://www.unicode.org/cldr/charts/32/summary/de.html#1881
2757
+
2758
+ var dayPeriodValues = {
2759
+ narrow: {
2760
+ am: 'vm.',
2761
+ pm: 'nm.',
2762
+ midnight: 'Mitternacht',
2763
+ noon: 'Mittag',
2764
+ morning: 'Morgen',
2765
+ afternoon: 'Nachm.',
2766
+ evening: 'Abend',
2767
+ night: 'Nacht'
2768
+ },
2769
+ abbreviated: {
2770
+ am: 'vorm.',
2771
+ pm: 'nachm.',
2772
+ midnight: 'Mitternacht',
2773
+ noon: 'Mittag',
2774
+ morning: 'Morgen',
2775
+ afternoon: 'Nachmittag',
2776
+ evening: 'Abend',
2777
+ night: 'Nacht'
2778
+ },
2779
+ wide: {
2780
+ am: 'vormittags',
2781
+ pm: 'nachmittags',
2782
+ midnight: 'Mitternacht',
2783
+ noon: 'Mittag',
2784
+ morning: 'Morgen',
2785
+ afternoon: 'Nachmittag',
2786
+ evening: 'Abend',
2787
+ night: 'Nacht'
2788
+ }
2789
+ };
2790
+ var formattingDayPeriodValues = {
2791
+ narrow: {
2792
+ am: 'vm.',
2793
+ pm: 'nm.',
2794
+ midnight: 'Mitternacht',
2795
+ noon: 'Mittag',
2796
+ morning: 'morgens',
2797
+ afternoon: 'nachm.',
2798
+ evening: 'abends',
2799
+ night: 'nachts'
2800
+ },
2801
+ abbreviated: {
2802
+ am: 'vorm.',
2803
+ pm: 'nachm.',
2804
+ midnight: 'Mitternacht',
2805
+ noon: 'Mittag',
2806
+ morning: 'morgens',
2807
+ afternoon: 'nachmittags',
2808
+ evening: 'abends',
2809
+ night: 'nachts'
2810
+ },
2811
+ wide: {
2812
+ am: 'vormittags',
2813
+ pm: 'nachmittags',
2814
+ midnight: 'Mitternacht',
2815
+ noon: 'Mittag',
2816
+ morning: 'morgens',
2817
+ afternoon: 'nachmittags',
2818
+ evening: 'abends',
2819
+ night: 'nachts'
2820
+ }
2821
+ };
2822
+
2823
+ var ordinalNumber = function (dirtyNumber) {
2824
+ var number = Number(dirtyNumber);
2825
+ return number + '.';
2826
+ };
2827
+
2828
+ var localize = {
2829
+ ordinalNumber: ordinalNumber,
2830
+ era: buildLocalizeFn({
2831
+ values: eraValues,
2832
+ defaultWidth: 'wide'
2833
+ }),
2834
+ quarter: buildLocalizeFn({
2835
+ values: quarterValues,
2836
+ defaultWidth: 'wide',
2837
+ argumentCallback: function (quarter) {
2838
+ return quarter - 1;
2839
+ }
2840
+ }),
2841
+ month: buildLocalizeFn({
2842
+ values: monthValues,
2843
+ formattingValues: formattingMonthValues,
2844
+ defaultWidth: 'wide'
2845
+ }),
2846
+ day: buildLocalizeFn({
2847
+ values: dayValues,
2848
+ defaultWidth: 'wide'
2849
+ }),
2850
+ dayPeriod: buildLocalizeFn({
2851
+ values: dayPeriodValues,
2852
+ defaultWidth: 'wide',
2853
+ formattingValues: formattingDayPeriodValues,
2854
+ defaultFormattingWidth: 'wide'
2855
+ })
2856
+ };
2857
+
2858
+ var matchOrdinalNumberPattern = /^(\d+)(\.)?/i;
2859
+ var parseOrdinalNumberPattern = /\d+/i;
2860
+ var matchEraPatterns = {
2861
+ narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
2862
+ abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
2863
+ wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
2864
+ };
2865
+ var parseEraPatterns = {
2866
+ any: [/^v/i, /^n/i]
2867
+ };
2868
+ var matchQuarterPatterns = {
2869
+ narrow: /^[1234]/i,
2870
+ abbreviated: /^q[1234]/i,
2871
+ wide: /^[1234](\.)? Quartal/i
2872
+ };
2873
+ var parseQuarterPatterns = {
2874
+ any: [/1/i, /2/i, /3/i, /4/i]
2875
+ };
2876
+ var matchMonthPatterns = {
2877
+ narrow: /^[jfmasond]/i,
2878
+ abbreviated: /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,
2879
+ wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
2880
+ };
2881
+ var parseMonthPatterns = {
2882
+ 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],
2883
+ any: [/^j[aä]/i, /^f/i, /^mär/i, /^ap/i, /^mai/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
2884
+ };
2885
+ var matchDayPatterns = {
2886
+ narrow: /^[smdmf]/i,
2887
+ short: /^(so|mo|di|mi|do|fr|sa)/i,
2888
+ abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,
2889
+ wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i
2890
+ };
2891
+ var parseDayPatterns = {
2892
+ any: [/^so/i, /^mo/i, /^di/i, /^mi/i, /^do/i, /^f/i, /^sa/i]
2893
+ };
2894
+ var matchDayPeriodPatterns = {
2895
+ narrow: /^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
2896
+ abbreviated: /^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
2897
+ wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i
2898
+ };
2899
+ var parseDayPeriodPatterns = {
2900
+ any: {
2901
+ am: /^v/i,
2902
+ pm: /^n/i,
2903
+ midnight: /^Mitte/i,
2904
+ noon: /^Mitta/i,
2905
+ morning: /morgens/i,
2906
+ afternoon: /nachmittags/i,
2907
+ // will never be matched. Afternoon is matched by `pm`
2908
+ evening: /abends/i,
2909
+ night: /nachts/i // will never be matched. Night is matched by `pm`
2910
+
2911
+ }
2912
+ };
2913
+ var match = {
2914
+ ordinalNumber: buildMatchPatternFn({
2915
+ matchPattern: matchOrdinalNumberPattern,
2916
+ parsePattern: parseOrdinalNumberPattern,
2917
+ valueCallback: function (value) {
2918
+ return parseInt(value);
2919
+ }
2920
+ }),
2921
+ era: buildMatchFn({
2922
+ matchPatterns: matchEraPatterns,
2923
+ defaultMatchWidth: 'wide',
2924
+ parsePatterns: parseEraPatterns,
2925
+ defaultParseWidth: 'any'
2926
+ }),
2927
+ quarter: buildMatchFn({
2928
+ matchPatterns: matchQuarterPatterns,
2929
+ defaultMatchWidth: 'wide',
2930
+ parsePatterns: parseQuarterPatterns,
2931
+ defaultParseWidth: 'any',
2932
+ valueCallback: function (index) {
2933
+ return index + 1;
2934
+ }
2935
+ }),
2936
+ month: buildMatchFn({
2937
+ matchPatterns: matchMonthPatterns,
2938
+ defaultMatchWidth: 'wide',
2939
+ parsePatterns: parseMonthPatterns,
2940
+ defaultParseWidth: 'any'
2941
+ }),
2942
+ day: buildMatchFn({
2943
+ matchPatterns: matchDayPatterns,
2944
+ defaultMatchWidth: 'wide',
2945
+ parsePatterns: parseDayPatterns,
2946
+ defaultParseWidth: 'any'
2947
+ }),
2948
+ dayPeriod: buildMatchFn({
2949
+ matchPatterns: matchDayPeriodPatterns,
2950
+ defaultMatchWidth: 'wide',
2951
+ parsePatterns: parseDayPeriodPatterns,
2952
+ defaultParseWidth: 'any'
2953
+ })
2954
+ };
2955
+
2956
+ /**
2957
+ * @type {Locale}
2958
+ * @category Locales
2959
+ * @summary German locale.
2960
+ * @language German
2961
+ * @iso-639-2 deu
2962
+ * @author Thomas Eilmsteiner [@DeMuu]{@link https://github.com/DeMuu}
2963
+ * @author Asia [@asia-t]{@link https://github.com/asia-t}
2964
+ * @author Van Vuong Ngo [@vanvuongngo]{@link https://github.com/vanvuongngo}
2965
+ * @author RomanErnst [@pex]{@link https://github.com/pex}
2966
+ * @author Philipp Keck [@Philipp91]{@link https://github.com/Philipp91}
2967
+ */
2968
+
2969
+ var locale = {
2970
+ code: 'de',
2971
+ formatDistance: formatDistance,
2972
+ formatLong: formatLong,
2973
+ formatRelative: formatRelative,
2974
+ localize: localize,
2975
+ match: match,
2976
+ options: {
2977
+ weekStartsOn: 1
2978
+ /* Monday */
2979
+ ,
2980
+ firstWeekContainsDate: 4
2981
+ }
2982
+ };
2983
+
2984
+ var PickerView = styled.div.withConfig({
2985
+ displayName: "Datepicker__PickerView",
2986
+ componentId: "sc-1h58zop-0"
2987
+ })(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n text-align: left;\n\n .react-datepicker-popper {\n right: ", "px;\n z-index: 9 !important;\n width: 100%;\n }\n\n @media ", " {\n .react-datepicker-popper {\n right: auto;\n width: auto;\n }\n }\n\n .react-datepicker {\n display: flex;\n flex-wrap: wrap;\n font-family: 'Roboto', sans-serif;\n border: 1px solid\n ", " !important;\n border-radius: ", " !important;\n padding: ", "px;\n width: 100%;\n\n box-shadow: 0px 3px 9px rgba(0, 0, 0, 0.15);\n }\n\n .react-datepicker-wrapper {\n width: 100% !important;\n }\n\n .react-datepicker__header {\n border: none !important;\n background-color: transparent !important;\n margin: 0 ", "px;\n }\n\n /* Month */\n .react-datepicker__month-container {\n width: 100%;\n margin-bottom: ", "px;\n }\n\n @media ", " {\n .react-datepicker__month-container {\n max-width: 50%;\n }\n }\n\n .react-datepicker__month {\n margin-left: ", "px;\n margin-right: ", "px;\n }\n\n .react-datepicker__current-month {\n font-family: 'Roboto', sans-serif;\n font-weight: 600;\n font-size: 17px;\n line-height: 1.3;\n text-transform: uppercase;\n background-color: ", ";\n padding: 10px 15px;\n color: ", " !important;\n width: max-content;\n margin: 0 auto;\n }\n\n /* Day styles */\n\n .react-datepicker__day-names {\n display: flex;\n font-size: 11px;\n line-height: 1.25;\n background: transparent;\n }\n\n @media ", " {\n .react-datepicker__day-names {\n display: block;\n }\n }\n\n .react-datepicker__day-name {\n flex: 1 0 auto;\n }\n\n .react-datepicker__week {\n display: flex;\n margin: -2px !important;\n }\n\n @media ", " {\n .react-datepicker__week {\n display: block;\n }\n }\n\n .react-datepicker__day {\n flex: 1 0 auto;\n background-color: ", ";\n border-radius: 0 !important;\n font-weight: 600;\n\n margin: 2px !important;\n }\n\n @media ", " {\n .react-datepicker__day:hover {\n background-color: ", " !important;\n border-radius: 0 !important;\n color: ", ";\n }\n }\n\n .react-datepicker__day--outside-month {\n color: ", " !important;\n cursor: default;\n }\n\n .react-datepicker__day--selected {\n background-color: ", " !important;\n border-radius: 0 !important;\n color: ", ";\n }\n\n .react-datepicker__day--today {\n border: 1px solid\n ", " !important;\n border-radius: 0 !important;\n }\n\n /* Triangle Styles */\n\n .react-datepicker__triangle:before {\n border-bottom-color: ", " !important;\n }\n\n .react-datepicker__triangle:after {\n border-bottom-color: ", " !important;\n }\n\n /* Day Ranges */\n\n .react-datepicker__day--in-range {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--in-range:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--range-start {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--range-start:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--range-end {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--range-end:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--in-selecting-range {\n background-color: ", " !important;\n }\n\n /* Next-/Prev-Arrow */\n .react-datepicker__close-icon {\n display: none !important;\n }\n\n .react-datepicker__navigation {\n top: ", "px !important;\n }\n\n .react-datepicker__navigation-icon--next::before {\n left: 0 !important;\n }\n\n .react-datepicker__navigation-icon--previous::before {\n left: 0 !important;\n }\n\n .react-datepicker__navigation:focus {\n outline: 1px solid ", ";\n }\n\n /* Keyboard selection */\n .react-datepicker__day--keyboard-selected {\n outline: none;\n background: ", ";\n }\n"], ["\n position: relative;\n width: 100%;\n text-align: left;\n\n .react-datepicker-popper {\n right: ", "px;\n z-index: 9 !important;\n width: 100%;\n }\n\n @media ", " {\n .react-datepicker-popper {\n right: auto;\n width: auto;\n }\n }\n\n .react-datepicker {\n display: flex;\n flex-wrap: wrap;\n font-family: 'Roboto', sans-serif;\n border: 1px solid\n ", " !important;\n border-radius: ", " !important;\n padding: ", "px;\n width: 100%;\n\n box-shadow: 0px 3px 9px rgba(0, 0, 0, 0.15);\n }\n\n .react-datepicker-wrapper {\n width: 100% !important;\n }\n\n .react-datepicker__header {\n border: none !important;\n background-color: transparent !important;\n margin: 0 ", "px;\n }\n\n /* Month */\n .react-datepicker__month-container {\n width: 100%;\n margin-bottom: ", "px;\n }\n\n @media ", " {\n .react-datepicker__month-container {\n max-width: 50%;\n }\n }\n\n .react-datepicker__month {\n margin-left: ", "px;\n margin-right: ", "px;\n }\n\n .react-datepicker__current-month {\n font-family: 'Roboto', sans-serif;\n font-weight: 600;\n font-size: 17px;\n line-height: 1.3;\n text-transform: uppercase;\n background-color: ", ";\n padding: 10px 15px;\n color: ", " !important;\n width: max-content;\n margin: 0 auto;\n }\n\n /* Day styles */\n\n .react-datepicker__day-names {\n display: flex;\n font-size: 11px;\n line-height: 1.25;\n background: transparent;\n }\n\n @media ", " {\n .react-datepicker__day-names {\n display: block;\n }\n }\n\n .react-datepicker__day-name {\n flex: 1 0 auto;\n }\n\n .react-datepicker__week {\n display: flex;\n margin: -2px !important;\n }\n\n @media ", " {\n .react-datepicker__week {\n display: block;\n }\n }\n\n .react-datepicker__day {\n flex: 1 0 auto;\n background-color: ", ";\n border-radius: 0 !important;\n font-weight: 600;\n\n margin: 2px !important;\n }\n\n @media ", " {\n .react-datepicker__day:hover {\n background-color: ", " !important;\n border-radius: 0 !important;\n color: ", ";\n }\n }\n\n .react-datepicker__day--outside-month {\n color: ", " !important;\n cursor: default;\n }\n\n .react-datepicker__day--selected {\n background-color: ", " !important;\n border-radius: 0 !important;\n color: ", ";\n }\n\n .react-datepicker__day--today {\n border: 1px solid\n ", " !important;\n border-radius: 0 !important;\n }\n\n /* Triangle Styles */\n\n .react-datepicker__triangle:before {\n border-bottom-color: ", " !important;\n }\n\n .react-datepicker__triangle:after {\n border-bottom-color: ", " !important;\n }\n\n /* Day Ranges */\n\n .react-datepicker__day--in-range {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--in-range:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--range-start {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--range-start:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--range-end {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--range-end:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--in-selecting-range {\n background-color: ", " !important;\n }\n\n /* Next-/Prev-Arrow */\n .react-datepicker__close-icon {\n display: none !important;\n }\n\n .react-datepicker__navigation {\n top: ", "px !important;\n }\n\n .react-datepicker__navigation-icon--next::before {\n left: 0 !important;\n }\n\n .react-datepicker__navigation-icon--previous::before {\n left: 0 !important;\n }\n\n .react-datepicker__navigation:focus {\n outline: 1px solid ", ";\n }\n\n /* Keyboard selection */\n .react-datepicker__day--keyboard-selected {\n outline: none;\n background: ", ";\n }\n"])), spacings.spacer * 2, mq.medium, function (_a) {
2988
+ var theme = _a.theme;
2989
+ return hexToRgba(getColors(theme).elementBg.dark, 0.2);
2990
+ }, function (_a) {
2991
+ var theme = _a.theme;
2992
+ return getGlobals(theme).sections.edgeRadius || '0px';
2993
+ }, spacings.nudge * 2, spacings.nudge * 3, spacings.nudge * 3, mq.medium, spacings.nudge * 2, spacings.nudge * 2, function (_a) {
2994
+ var theme = _a.theme;
2995
+ return getColors(theme).primary.default;
2996
+ }, function (_a) {
2997
+ var theme = _a.theme;
2998
+ return getColors(theme).text.inverted;
2999
+ }, mq.medium, mq.medium, function (_a) {
3000
+ var theme = _a.theme;
3001
+ return getColors(theme).elementBg.light;
3002
+ }, mq.medium, function (_a) {
3003
+ var theme = _a.theme;
3004
+ return getColors(theme).elementBg.dark;
3005
+ }, function (_a) {
3006
+ var theme = _a.theme;
3007
+ return getColors(theme).text.inverted;
3008
+ }, function (_a) {
3009
+ var theme = _a.theme;
3010
+ return getColors(theme).elementBg.medium;
3011
+ }, function (_a) {
3012
+ var theme = _a.theme;
3013
+ return getColors(theme).primary.default;
3014
+ }, function (_a) {
3015
+ var theme = _a.theme;
3016
+ return getColors(theme).text.inverted;
3017
+ }, function (_a) {
3018
+ var theme = _a.theme;
3019
+ return hexToRgba(getColors(theme).elementBg.dark, 0.6);
3020
+ }, function (_a) {
3021
+ var theme = _a.theme;
3022
+ return hexToRgba(getColors(theme).elementBg.dark, 0.2);
3023
+ }, function (_a) {
3024
+ var theme = _a.theme;
3025
+ return getColors(theme).elementBg.light;
3026
+ }, function (_a) {
3027
+ var theme = _a.theme;
3028
+ return hexToRgba(getColors(theme).primary.default, 0.7);
3029
+ }, mq.medium, function (_a) {
3030
+ var theme = _a.theme;
3031
+ return hexToRgba(getColors(theme).primary.default, 0.25);
3032
+ }, function (_a) {
3033
+ var theme = _a.theme;
3034
+ return getColors(theme).primary.default;
3035
+ }, mq.medium, function (_a) {
3036
+ var theme = _a.theme;
3037
+ return hexToRgba(getColors(theme).primary.default, 0.25);
3038
+ }, function (_a) {
3039
+ var theme = _a.theme;
3040
+ return getColors(theme).primary.default;
3041
+ }, mq.medium, function (_a) {
3042
+ var theme = _a.theme;
3043
+ return hexToRgba(getColors(theme).primary.default, 0.25);
3044
+ }, function (_a) {
3045
+ var theme = _a.theme;
3046
+ return hexToRgba(getColors(theme).primary.default, 0.7);
3047
+ }, spacings.nudge, function (_a) {
3048
+ var theme = _a.theme;
3049
+ return getColors(theme).primary.default;
3050
+ }, function (_a) {
3051
+ var theme = _a.theme;
3052
+ return getColors(theme).elementBg.dark;
3053
+ });
3054
+ var Icon$1 = styled.div.withConfig({
3055
+ displayName: "Datepicker__Icon",
3056
+ componentId: "sc-1h58zop-1"
3057
+ })(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n height: 100%;\n min-width: 24px;\n color: ", ";\n\n & > * {\n height: 20px;\n }\n"], ["\n height: 100%;\n min-width: 24px;\n color: ", ";\n\n & > * {\n height: 20px;\n }\n"])), function (_a) {
3058
+ var theme = _a.theme,
3059
+ isInverted = _a.isInverted;
3060
+ return isInverted ? getFonts(theme).copy.small.colorInverted : getFonts(theme).copy.small.color;
3061
+ });
3062
+ var DatepickerButton = styled.button.withConfig({
3063
+ displayName: "Datepicker__DatepickerButton",
3064
+ componentId: "sc-1h58zop-2"
3065
+ })(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 40px;\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: none;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n outline: none;\n pointer-events: ", ";\n\n position: relative;\n\n border: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 40px;\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: none;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n outline: none;\n pointer-events: ", ";\n\n position: relative;\n\n border: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"])), spacings.nudge, function (_a) {
3066
+ var theme = _a.theme,
3067
+ isInverted = _a.isInverted,
3068
+ hasError = _a.hasError;
3069
+
3070
+ if (isInverted) {
3071
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
3072
+ }
3073
+
3074
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
3075
+ }, function (_a) {
3076
+ var theme = _a.theme;
3077
+ return getGlobals(theme).sections.edgeRadius;
3078
+ }, copyStyle('copy', 'small'), function (_a) {
3079
+ var theme = _a.theme;
3080
+ return withRange(getFormFieldTextSize(theme), 'font-size');
3081
+ }, function (_a) {
3082
+ var theme = _a.theme,
3083
+ isInverted = _a.isInverted,
3084
+ hasError = _a.hasError,
3085
+ hasDateValue = _a.hasDateValue;
3086
+
3087
+ if (isInverted) {
3088
+ return hasError ? getColors(theme).text.errorInverted : !hasDateValue ? getColors(theme).text.subtileInverted : getFonts(theme).copy.small.colorInverted;
3089
+ }
3090
+
3091
+ return hasError ? getColors(theme).text.error : !hasDateValue ? getColors(theme).text.subtile : getFonts(theme).copy.small.color;
3092
+ }, function (_a) {
3093
+ var isActive = _a.isActive;
3094
+ return isActive ? 'none' : 'all';
3095
+ }, function (_a) {
3096
+ var theme = _a.theme,
3097
+ isInverted = _a.isInverted,
3098
+ isActive = _a.isActive;
3099
+ return isActive && "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3100
+ }, function (_a) {
3101
+ var theme = _a.theme,
3102
+ isInverted = _a.isInverted;
3103
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3104
+ }, function (_a) {
3105
+ var theme = _a.theme,
3106
+ isInverted = _a.isInverted;
3107
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3108
+ });
3109
+ var DatepickerButtonMain = styled.div.withConfig({
3110
+ displayName: "Datepicker__DatepickerButtonMain",
3111
+ componentId: "sc-1h58zop-3"
3112
+ })(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.spacer);
3113
+ var DatepickerFoot = styled.div.withConfig({
3114
+ displayName: "Datepicker__DatepickerFoot",
3115
+ componentId: "sc-1h58zop-4"
3116
+ })(templateObject_5$4 || (templateObject_5$4 = __makeTemplateObject(["\n display: block;\n width: 100%;\n\n /* margin-top: ", "px; */\n"], ["\n display: block;\n width: 100%;\n\n /* margin-top: ", "px; */\n"])), spacings.spacer * 14);
3117
+ var FootFlex = styled.div.withConfig({
3118
+ displayName: "Datepicker__FootFlex",
3119
+ componentId: "sc-1h58zop-5"
3120
+ })(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject(["\n clear: both;\n display: flex;\n flex-direction: column;\n\n & > * {\n width: 100%;\n }\n\n & > * + * {\n margin-top: ", "px;\n }\n\n @media ", " {\n align-items: center;\n flex-direction: row;\n\n & > * {\n width: auto;\n }\n\n & > * + * {\n margin-top: 0;\n margin-left: ", "px;\n }\n }\n"], ["\n clear: both;\n display: flex;\n flex-direction: column;\n\n & > * {\n width: 100%;\n }\n\n & > * + * {\n margin-top: ", "px;\n }\n\n @media ", " {\n align-items: center;\n flex-direction: row;\n\n & > * {\n width: auto;\n }\n\n & > * + * {\n margin-top: 0;\n margin-left: ", "px;\n }\n }\n"])), spacings.spacer * 0.5, mq.medium, spacings.spacer * 0.5);
3121
+ var ButtonLabel = styled(Button.Label).withConfig({
3122
+ displayName: "Datepicker__ButtonLabel",
3123
+ componentId: "sc-1h58zop-6"
3124
+ })(templateObject_7$3 || (templateObject_7$3 = __makeTemplateObject(["\n font-size: 12px;\n"], ["\n font-size: 12px;\n"])));
3125
+ var ButtonGhostLabel = styled(ButtonGhost.Label).withConfig({
3126
+ displayName: "Datepicker__ButtonGhostLabel",
3127
+ componentId: "sc-1h58zop-7"
3128
+ })(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject(["\n font-size: 12px;\n"], ["\n font-size: 12px;\n"])));
3129
+ var PickerButton = forwardRef(function (_a, ref) {
3130
+ var label = _a.label,
3131
+ errorMessage = _a.errorMessage,
3132
+ infoMessage = _a.infoMessage,
3133
+ isRequired = _a.isRequired,
3134
+ isInverted = _a.isInverted,
3135
+ isDisabled = _a.isDisabled,
3136
+ isFocused = _a.isFocused,
3137
+ name = _a.name,
3138
+ altText = _a.altText,
3139
+ startDate = _a.startDate,
3140
+ endDate = _a.endDate,
3141
+ setFocused = _a.setFocused,
3142
+ onClick = _a.onClick,
3143
+ _b = _a.dateFormat,
3144
+ dateFormat = _b === void 0 ? 'dd.MM.yyyy' : _b,
3145
+ customIcon = _a.customIcon,
3146
+ singleSelect = _a.singleSelect;
3147
+ return React__default.createElement(FieldWrapper.View, {
3148
+ isDisabled: isDisabled
3149
+ }, React__default.createElement(FieldWrapper.Head, {
3150
+ label: label,
3151
+ isRequired: isRequired,
3152
+ isInverted: isInverted
3153
+ }), React__default.createElement(FieldWrapper.Content, null, React__default.createElement(DatepickerButton, {
3154
+ ref: ref,
3155
+ type: "button",
3156
+ onClick: function (e) {
3157
+ setFocused && setFocused(true);
3158
+ onClick && onClick(e);
3159
+ },
3160
+ isActive: isFocused,
3161
+ hasDateValue: !!startDate,
3162
+ isInverted: isInverted,
3163
+ hasError: !!errorMessage,
3164
+ className: "myPickerButton"
3165
+ }, React__default.createElement(DatepickerButtonMain, null, startDate ? "".concat(format(startDate, dateFormat)).concat(endDate ? " \u2013 ".concat(format(endDate, dateFormat)) : '') : altText), React__default.createElement(Icon$1, {
3166
+ isInverted: isInverted
3167
+ }, customIcon ? customIcon({
3168
+ isInverted: isInverted,
3169
+ singleSelect: singleSelect
3170
+ }) : singleSelect ? React__default.createElement(CalendarToday, null) : React__default.createElement(DateRange, null))), name && React__default.createElement(React__default.Fragment, null, React__default.createElement("input", {
3171
+ type: "hidden",
3172
+ name: "".concat(name, "[\"start\"]"),
3173
+ value: startDate === null || startDate === void 0 ? void 0 : startDate.toString()
3174
+ }), React__default.createElement("input", {
3175
+ type: "hidden",
3176
+ name: "".concat(name, "[\"end\"]"),
3177
+ value: endDate === null || endDate === void 0 ? void 0 : endDate.toString()
3178
+ }))), React__default.createElement(FieldWrapper.Messages, {
3179
+ infoMessage: infoMessage,
3180
+ errorMessage: errorMessage,
3181
+ isInverted: isInverted
3182
+ }));
3183
+ });
3184
+ PickerButton.displayName = 'PickerButton';
3185
+ var PickerHeader = styled.div.withConfig({
3186
+ displayName: "Datepicker__PickerHeader",
3187
+ componentId: "sc-1h58zop-8"
3188
+ })(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), spacings.nudge * 3);
3189
+
3190
+ var getPickerHeader = function (locale$1, prevMonthAction, nextMonthAction) {
3191
+ // eslint-disable-next-line react/display-name
3192
+ return function (_a) {
3193
+ var monthDate = _a.monthDate,
3194
+ customHeaderCount = _a.customHeaderCount,
3195
+ decreaseMonth = _a.decreaseMonth,
3196
+ increaseMonth = _a.increaseMonth;
3197
+ return React__default.createElement(PickerHeader, null, React__default.createElement("button", {
3198
+ "aria-label": "Previous Month",
3199
+ className: 'react-datepicker__navigation react-datepicker__navigation--previous',
3200
+ style: customHeaderCount === 1 ? {
3201
+ visibility: 'hidden'
3202
+ } : undefined,
3203
+ onClick: function (ev) {
3204
+ ev.preventDefault();
3205
+ decreaseMonth();
3206
+ }
3207
+ }, prevMonthAction ? typeof prevMonthAction === 'string' ? React__default.createElement("img", {
3208
+ src: prevMonthAction
3209
+ }) : prevMonthAction : React__default.createElement("span", {
3210
+ className: 'react-datepicker__navigation-icon react-datepicker__navigation-icon--previous'
3211
+ }, '<')), React__default.createElement("span", {
3212
+ className: "react-datepicker__current-month"
3213
+ }, format(monthDate, 'LLLL', {
3214
+ locale: locale
3215
+ })), React__default.createElement("button", {
3216
+ "aria-label": "Next Month",
3217
+ className: 'react-datepicker__navigation react-datepicker__navigation--next',
3218
+ style: customHeaderCount === 0 ? {
3219
+ visibility: 'hidden'
3220
+ } : undefined,
3221
+ onClick: function (ev) {
3222
+ ev.preventDefault();
3223
+ increaseMonth();
3224
+ }
3225
+ }, nextMonthAction ? typeof nextMonthAction === 'string' ? React__default.createElement("img", {
3226
+ src: nextMonthAction
3227
+ }) : nextMonthAction : React__default.createElement("span", {
3228
+ className: 'react-datepicker__navigation-icon react-datepicker__navigation-icon--next'
3229
+ }, '>')));
3230
+ };
3231
+ };
3232
+
3233
+ var Datepicker = function (_a) {
3234
+ var label = _a.label,
3235
+ errorMessage = _a.errorMessage,
3236
+ infoMessage = _a.infoMessage,
3237
+ isRequired = _a.isRequired,
3238
+ isDisabled = _a.isDisabled,
3239
+ isInverted = _a.isInverted,
3240
+ name = _a.name,
3241
+ dateSubmitLabel = _a.dateSubmitLabel,
3242
+ dateDeleteLabel = _a.dateDeleteLabel,
3243
+ placeholder = _a.placeholder,
3244
+ _b = _a.singleSelect,
3245
+ singleSelect = _b === void 0 ? false : _b,
3246
+ values = _a.values,
3247
+ _c = _a.minDate,
3248
+ minDate = _c === void 0 ? new Date() : _c,
3249
+ maxDate = _a.maxDate,
3250
+ onDataChange = _a.onDataChange,
3251
+ onSubmit = _a.onSubmit,
3252
+ deleteAction = _a.deleteAction,
3253
+ submitAction = _a.submitAction,
3254
+ customIcon = _a.customIcon,
3255
+ nextCtrlUrl = _a.nextCtrlUrl,
3256
+ prevCtrlUrl = _a.prevCtrlUrl;
3257
+ var globals = useLibTheme().globals;
3258
+ var locale$1 = globals.sections.datepickerLocaleKey;
3259
+ var dateFormat = globals.sections.datepickerDateFormat;
3260
+ var pickerRef = useRef(null);
3261
+ var pickerBtnRef = useRef(null);
3262
+
3263
+ var _d = useState(false),
3264
+ isSmall = _d[0],
3265
+ setIsSmall = _d[1];
3266
+
3267
+ var _e = useState(),
3268
+ startDate = _e[0],
3269
+ setStartDate = _e[1];
3270
+
3271
+ var _f = useState(),
3272
+ endDate = _f[0],
3273
+ setEndDate = _f[1];
3274
+
3275
+ var _g = useState(),
3276
+ focused = _g[0],
3277
+ setFocused = _g[1];
3278
+
3279
+ useEffect(function () {
3280
+ var x = function () {
3281
+ return __awaiter(void 0, void 0, void 0, function () {
3282
+ return __generator(this, function (_a) {
3283
+ switch (_a.label) {
3284
+ case 0:
3285
+ return [4
3286
+ /*yield*/
3287
+ , import('react-datepicker')];
3288
+
3289
+ case 1:
3290
+ _a.sent();
3291
+
3292
+ return [2
3293
+ /*return*/
3294
+ ];
3295
+ }
3296
+ });
3297
+ });
3298
+ };
3299
+
3300
+ if (!singleSelect) setIsSmall(!window.matchMedia(mq.medium).matches);
3301
+ x();
3302
+ }, [locale$1, singleSelect]);
3303
+ useEffect(function () {
3304
+ if (values) {
3305
+ if (values[0] && isValid(values[0])) {
3306
+ setStartDate(values[0]);
3307
+ }
3308
+
3309
+ if (values[1] && isValid(values[1])) {
3310
+ setEndDate(values[1]);
3311
+ }
3312
+ }
3313
+ }, [values]);
3314
+ useEffect(function () {
3315
+ var handleResize = function () {
3316
+ var shouldBeSmall = !window.matchMedia(mq.medium).matches;
3317
+
3318
+ if (shouldBeSmall !== isSmall) {
3319
+ setIsSmall(shouldBeSmall);
3320
+ }
3321
+ };
3322
+
3323
+ window.addEventListener('resize', handleResize);
3324
+ return function () {
3325
+ window.removeEventListener('resize', handleResize);
3326
+ };
3327
+ }, [isSmall]);
3328
+ useEffect(function () {
3329
+ var _a;
3330
+
3331
+ if (pickerRef.current && focused !== undefined) {
3332
+ (_a = pickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(focused);
3333
+ }
3334
+ }, [focused]);
3335
+ var handleSubmit = useCallback(function (ev) {
3336
+ ev.preventDefault();
3337
+ setFocused(false);
3338
+ onSubmit && onSubmit(startDate, endDate);
3339
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
3340
+ [endDate, startDate]);
3341
+ var handleReset = useCallback(function (ev) {
3342
+ ev.preventDefault();
3343
+ setStartDate(undefined);
3344
+ setEndDate(undefined);
3345
+ }, []);
3346
+ return React__default.createElement(PickerView, null, React__default.createElement(ReactDatePicker, {
3347
+ locale: locale$1 === 'de' ? locale : undefined,
3348
+ ref: pickerRef,
3349
+ dateFormat: dateFormat,
3350
+ onChange: function (date) {
3351
+ if (date) {
3352
+ if (singleSelect) {
3353
+ setStartDate(date);
3354
+ setFocused(false);
3355
+ onDataChange && onDataChange(date, null);
3356
+ } else if (startDate) {
3357
+ if (endDate) {
3358
+ setStartDate(date);
3359
+ setEndDate(null);
3360
+ onDataChange && onDataChange(date, null);
3361
+ } else if (isBefore(date, startDate)) {
3362
+ setEndDate(startDate);
3363
+ setStartDate(date);
3364
+ onDataChange && onDataChange(date, startDate);
3365
+ } else {
3366
+ setEndDate(date);
3367
+ onDataChange && onDataChange(startDate, date);
3368
+ }
3369
+ } else {
3370
+ setStartDate(date);
3371
+ onDataChange && onDataChange(date, endDate || null);
3372
+ }
3373
+ } else {
3374
+ setStartDate(undefined);
3375
+ onDataChange && onDataChange(null, null);
3376
+ }
3377
+ },
3378
+ selected: startDate,
3379
+ startDate: startDate,
3380
+ endDate: endDate,
3381
+ monthsShown: isSmall ? 1 : 2,
3382
+ shouldCloseOnSelect: singleSelect,
3383
+ customInput: React__default.createElement(PickerButton, {
3384
+ label: label,
3385
+ isInverted: isInverted,
3386
+ isDisabled: isDisabled,
3387
+ infoMessage: infoMessage,
3388
+ errorMessage: errorMessage,
3389
+ isRequired: isRequired,
3390
+ ref: pickerBtnRef,
3391
+ name: name,
3392
+ altText: placeholder,
3393
+ startDate: startDate,
3394
+ endDate: endDate,
3395
+ isFocused: focused,
3396
+ setFocused: setFocused,
3397
+ dateFormat: dateFormat,
3398
+ customIcon: customIcon,
3399
+ singleSelect: singleSelect
3400
+ }),
3401
+ showPopperArrow: true,
3402
+ minDate: minDate,
3403
+ maxDate: maxDate,
3404
+ disabledKeyboardNavigation: false,
3405
+ isClearable: true,
3406
+ onClickOutside: function (ev) {
3407
+ ev.stopPropagation();
3408
+ setFocused(false);
3409
+ onSubmit && onSubmit(startDate, endDate);
3410
+ },
3411
+ renderCustomHeader: getPickerHeader(locale$1, prevCtrlUrl, nextCtrlUrl)
3412
+ }, React__default.createElement(DatepickerFoot, null, React__default.createElement(FootFlex, null, deleteAction ? deleteAction(handleReset) : React__default.createElement(ButtonGhost.View, {
3413
+ as: "button",
3414
+ onClick: handleReset
3415
+ }, React__default.createElement(ButtonGhostLabel, null, dateDeleteLabel || 'Delete')), submitAction ? submitAction(handleSubmit) : React__default.createElement(Button.View, {
3416
+ as: "button",
3417
+ onClick: handleSubmit
3418
+ }, React__default.createElement(ButtonLabel, null, dateSubmitLabel || 'Submit'))))));
3419
+ };
3420
+ /**
3421
+ * Function to compare both field prop states
3422
+ * @param prev Previous props
3423
+ * @param next Next props
3424
+ * @returns
3425
+ */
3426
+
3427
+
3428
+ var areEqual$5 = function (prev, next) {
3429
+ var _a, _b, _c, _d; // only apply logic if memo functionality is enabled
3430
+
3431
+
3432
+ if (!prev.enableMemo) return false;
3433
+ if (prev.infoMessage !== next.infoMessage) return false;
3434
+ if (prev.errorMessage !== next.errorMessage) return false;
3435
+ if (prev.dateDeleteLabel !== next.dateDeleteLabel) return false;
3436
+ if (prev.dateSubmitLabel !== next.dateSubmitLabel) return false;
3437
+ if (prev.label !== next.label) return false;
3438
+ if (prev.placeholder !== next.placeholder) return false; // compare date values
3439
+
3440
+ var prevDateStart = (_a = prev.values) === null || _a === void 0 ? void 0 : _a[0];
3441
+ var prevDateEnd = (_b = prev.values) === null || _b === void 0 ? void 0 : _b[1];
3442
+ var nextDateStart = (_c = prev.values) === null || _c === void 0 ? void 0 : _c[0];
3443
+ var nextDateEnd = (_d = prev.values) === null || _d === void 0 ? void 0 : _d[1];
3444
+
3445
+ if (prevDateStart !== nextDateStart || !isEqual(prevDateStart || -1, nextDateStart || -1) || prevDateEnd !== nextDateEnd || !isEqual(prevDateEnd || -1, nextDateEnd || -1)) {
3446
+ return false;
3447
+ }
3448
+
3449
+ return true;
3450
+ };
3451
+
3452
+ var DatepickerCmp = React__default.memo(Datepicker, areEqual$5);
3453
+ var templateObject_1$5, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$4, templateObject_6$4, templateObject_7$3, templateObject_8$2, templateObject_9$2;
3454
+
3455
+ var View = styled.label.withConfig({
3456
+ displayName: "Radio__View",
3457
+ componentId: "sc-1h5e0q8-0"
3458
+ })(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.nudge * 2);
3459
+ var RadioContainer = styled.div.withConfig({
3460
+ displayName: "Radio__RadioContainer",
3461
+ componentId: "sc-1h5e0q8-1"
3462
+ })(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n cursor: ", ";\n pointer-events: ", ";\n\n border: 2px solid transparent;\n border-radius: 50%;\n\n &:focus-within {\n outline: 1px solid ", ";\n outline-offset: 0;\n }\n"], ["\n cursor: ", ";\n pointer-events: ", ";\n\n border: 2px solid transparent;\n border-radius: 50%;\n\n &:focus-within {\n outline: 1px solid ", ";\n outline-offset: 0;\n }\n"])), function (_a) {
3463
+ var isDisabled = _a.isDisabled;
3464
+ return isDisabled ? 'default' : 'pointer';
3465
+ }, function (_a) {
3466
+ var isDisabled = _a.isDisabled;
3467
+ return isDisabled ? 'none' : 'all';
3468
+ }, function (_a) {
3469
+ var theme = _a.theme;
3470
+ return getColors(theme).primary.default;
3471
+ });
3472
+ var Original$1 = styled.input.withConfig({
3473
+ displayName: "Radio__Original",
3474
+ componentId: "sc-1h5e0q8-2"
3475
+ })(templateObject_3$3 || (templateObject_3$3 = __makeTemplateObject(["\n position: absolute;\n left: -9999px;\n opacity: 0;\n"], ["\n position: absolute;\n left: -9999px;\n opacity: 0;\n"])));
3476
+ var StyledRadioButton = styled.span.withConfig({
3477
+ displayName: "Radio__StyledRadioButton",
3478
+ componentId: "sc-1h5e0q8-3"
3479
+ })(templateObject_5$3 || (templateObject_5$3 = __makeTemplateObject(["\n background: transparent;\n border-radius: 50%;\n\n position: relative;\n\n width: 20px;\n height: 20px;\n display: block;\n\n border: 2px solid\n ", ";\n\n ", "\n"], ["\n background: transparent;\n border-radius: 50%;\n\n position: relative;\n\n width: 20px;\n height: 20px;\n display: block;\n\n border: 2px solid\n ", ";\n\n ", "\n"])), function (_a) {
3480
+ var isInverted = _a.isInverted,
3481
+ theme = _a.theme,
3482
+ isSelected = _a.isSelected;
3483
+ return isSelected ? getColors(theme).primary.default : isInverted ? getColors(theme).elementBg.light : getColors(theme).elementBg.medium;
3484
+ }, function (_a) {
3485
+ var isSelected = _a.isSelected,
3486
+ theme = _a.theme;
3487
+ return isSelected ? css(templateObject_4$3 || (templateObject_4$3 = __makeTemplateObject(["\n background-color: ", ";\n\n &:before {\n content: '';\n position: absolute;\n display: block;\n height: 8px;\n width: 8px;\n background-color: ", ";\n border-radius: 50%;\n top: 50%;\n left: 50%;\n\n transform: translate(-50%, -50%);\n }\n "], ["\n background-color: ", ";\n\n &:before {\n content: '';\n position: absolute;\n display: block;\n height: 8px;\n width: 8px;\n background-color: ", ";\n border-radius: 50%;\n top: 50%;\n left: 50%;\n\n transform: translate(-50%, -50%);\n }\n "])), getColors(theme).primary.default, getColors(theme).elementBg.light) : 'none';
3488
+ });
3489
+ var Label = styled(Copy).withConfig({
3490
+ displayName: "Radio__Label",
3491
+ componentId: "sc-1h5e0q8-4"
3492
+ })(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject(["\n padding-top: 2px;\n text-align: left;\n user-select: none;\n\n & > * {\n margin: 0;\n }\n"], ["\n padding-top: 2px;\n text-align: left;\n user-select: none;\n\n & > * {\n margin: 0;\n }\n"])));
3493
+
3494
+ var RadioButton = function (_a) {
3495
+ var isDisabled = _a.isDisabled,
3496
+ isSelected = _a.isSelected,
3497
+ isInverted = _a.isInverted,
3498
+ onChange = _a.onChange,
3499
+ label = _a.label,
3500
+ id = _a.id,
3501
+ name = _a.name,
3502
+ value = _a.value;
3503
+ var colors = useLibTheme().colors;
3504
+ return React.createElement(View, null, React.createElement(RadioContainer, {
3505
+ isDisabled: isDisabled
3506
+ }, React.createElement(StyledRadioButton, {
3507
+ isSelected: isSelected,
3508
+ isInverted: isInverted
3509
+ }), React.createElement(Original$1, {
3510
+ type: "radio",
3511
+ name: name,
3512
+ id: id,
3513
+ value: value,
3514
+ checked: isSelected,
3515
+ onChange: onChange
3516
+ })), label && React.createElement(Label, {
3517
+ renderAs: "span",
3518
+ size: "small",
3519
+ type: "copy-b",
3520
+ textColor: isDisabled ? colors.elementBg.medium : isInverted ? colors.text.inverted : colors.text.default,
3521
+ innerHTML: label,
3522
+ isInverted: isInverted
3523
+ }));
3524
+ };
3525
+ /**
3526
+ * Function to compare both field prop states
3527
+ * @param prev Previous props
3528
+ * @param next Next props
3529
+ * @returns
3530
+ */
3531
+
3532
+
3533
+ var areEqual$4 = function (prev, next) {
3534
+ // only apply logic if memo functionality is enabled
3535
+ if (!prev.enableMemo) return false;
3536
+ if (prev.isSelected !== next.isSelected) return false;
3537
+ if (prev.label !== next.label) return false;
3538
+ if (prev.value !== next.value) return false;
3539
+ return true;
3540
+ };
3541
+
3542
+ var RadioButton$1 = React.memo(RadioButton, areEqual$4);
3543
+ var templateObject_1$4, templateObject_2$3, templateObject_3$3, templateObject_4$3, templateObject_5$3, templateObject_6$3;
3544
+
3545
+ var FieldView$1 = styled(FieldWrapper.View).withConfig({
3546
+ displayName: "FileUpload__FieldView",
3547
+ componentId: "sc-8g38v4-0"
3548
+ })(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
3549
+ var FieldMain = styled.div.withConfig({
3550
+ displayName: "FileUpload__FieldMain",
3551
+ componentId: "sc-8g38v4-1"
3552
+ })(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n outline: none;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n\n border-radius: 0px;\n -webkit-appearance: none;\n background: none;\n\n padding: 0 ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n color: ", ";\n\n &:focus-within {\n outline: ", ";\n outline-offset: 0;\n }\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n outline: none;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n\n border-radius: 0px;\n -webkit-appearance: none;\n background: none;\n\n padding: 0 ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n color: ", ";\n\n &:focus-within {\n outline: ", ";\n outline-offset: 0;\n }\n"])), spacings.nudge, function (_a) {
3553
+ var theme = _a.theme,
3554
+ isInverted = _a.isInverted,
3555
+ hasError = _a.hasError;
3556
+
3557
+ if (isInverted) {
3558
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
3559
+ }
3560
+
3561
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
3562
+ }, function (_a) {
3563
+ var theme = _a.theme;
3564
+ return getGlobals(theme).sections.edgeRadius;
3565
+ }, copyStyle('copy', 'small'), function (_a) {
3566
+ var theme = _a.theme;
3567
+ return withRange(getFormFieldTextSize(theme), 'font-size');
3568
+ }, function (_a) {
3569
+ var theme = _a.theme,
3570
+ isInverted = _a.isInverted;
3571
+ return isInverted ? getFonts(theme).copy.small.colorInverted : getFonts(theme).copy.small.color;
3572
+ }, function (_a) {
3573
+ var theme = _a.theme,
3574
+ isInverted = _a.isInverted;
3575
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3576
+ });
3577
+ var FileItem = styled.div.withConfig({
3578
+ displayName: "FileUpload__FileItem",
3579
+ componentId: "sc-8g38v4-2"
3580
+ })(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n padding: ", "px 0;\n width: 100%;\n\n * + & {\n border-top: 1px dashed\n ", ";\n }\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n padding: ", "px 0;\n width: 100%;\n\n * + & {\n border-top: 1px dashed\n ", ";\n }\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])), copyStyle('copy', 'small'), function (_a) {
3581
+ var theme = _a.theme;
3582
+ return withRange(getFormFieldTextSize(theme), 'font-size');
3583
+ }, spacings.nudge, function (_a) {
3584
+ var theme = _a.theme,
3585
+ isInverted = _a.isInverted;
3586
+ return isInverted ? getColors(theme).elementBg.light : getColors(theme).elementBg.dark;
3587
+ });
3588
+ var UploadItem = styled.button.withConfig({
3589
+ displayName: "FileUpload__UploadItem",
3590
+ componentId: "sc-8g38v4-3"
3591
+ })(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n padding: ", "px 0;\n background: none;\n outline: none;\n border: none;\n\n width: 100%;\n cursor: pointer;\n pointer-events: all;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n * + & {\n border-top: 1px dashed\n ", ";\n }\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &:focus {\n text-decoration: underline;\n }\n\n &:focus:not(:focus-visible) {\n text-decoration: none;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n padding: ", "px 0;\n background: none;\n outline: none;\n border: none;\n\n width: 100%;\n cursor: pointer;\n pointer-events: all;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n * + & {\n border-top: 1px dashed\n ", ";\n }\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &:focus {\n text-decoration: underline;\n }\n\n &:focus:not(:focus-visible) {\n text-decoration: none;\n }\n"])), spacings.nudge, copyStyle('copy', 'small'), function (_a) {
3592
+ var theme = _a.theme;
3593
+ return withRange(getFormFieldTextSize(theme), 'font-size');
3594
+ }, function (_a) {
3595
+ var theme = _a.theme,
3596
+ isInverted = _a.isInverted;
3597
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
3598
+ }, function (_a) {
3599
+ var theme = _a.theme,
3600
+ isInverted = _a.isInverted;
3601
+ return isInverted ? getColors(theme).elementBg.light : getColors(theme).elementBg.dark;
3602
+ });
3603
+ var Icon = styled.span.withConfig({
3604
+ displayName: "FileUpload__Icon",
3605
+ componentId: "sc-8g38v4-4"
3606
+ })(templateObject_5$2 || (templateObject_5$2 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n height: 100%;\n min-width: 24px;\n margin-left: auto;\n\n color: ", ";\n\n pointer-events: none;\n\n & > * {\n height: 20px;\n }\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n\n height: 100%;\n min-width: 24px;\n margin-left: auto;\n\n color: ", ";\n\n pointer-events: none;\n\n & > * {\n height: 20px;\n }\n"])), function (_a) {
3607
+ var theme = _a.theme,
3608
+ isInverted = _a.isInverted;
3609
+ return isInverted ? getFonts(theme).copy.small.colorInverted : getFonts(theme).copy.small.color;
3610
+ });
3611
+ var DeleteIcon = styled.button.withConfig({
3612
+ displayName: "FileUpload__DeleteIcon",
3613
+ componentId: "sc-8g38v4-5"
3614
+ })(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n height: 100%;\n min-width: 24px;\n margin-left: auto;\n\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n pointer-events: all;\n\n color: ", ";\n\n transition: opacity 0.2s ease-in-out;\n\n & > * {\n height: 20px;\n }\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n opacity: 0.8;\n }\n }\n\n &:focus {\n outline: solid 2px\n ", ";\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n\n height: 100%;\n min-width: 24px;\n margin-left: auto;\n\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n pointer-events: all;\n\n color: ", ";\n\n transition: opacity 0.2s ease-in-out;\n\n & > * {\n height: 20px;\n }\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n opacity: 0.8;\n }\n }\n\n &:focus {\n outline: solid 2px\n ", ";\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"])), function (_a) {
3615
+ var theme = _a.theme,
3616
+ isInverted = _a.isInverted;
3617
+ return isInverted ? getFonts(theme).copy.small.colorInverted : getFonts(theme).copy.small.color;
3618
+ }, function (_a) {
3619
+ var theme = _a.theme,
3620
+ isInverted = _a.isInverted;
3621
+ return isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default;
3622
+ });
3623
+ var Original = styled.input.withConfig({
3624
+ displayName: "FileUpload__Original",
3625
+ componentId: "sc-8g38v4-6"
3626
+ })(templateObject_7$2 || (templateObject_7$2 = __makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
3627
+
3628
+ var readFileAsync = function (file, uid) {
3629
+ return new Promise(function (resolve) {
3630
+ resolve({
3631
+ uid: uid,
3632
+ type: file.type,
3633
+ url: file.name,
3634
+ isUploading: true
3635
+ });
3636
+ var reader = new FileReader();
3637
+
3638
+ reader.onload = function () {
3639
+ resolve({
3640
+ uid: uid,
3641
+ type: file.type,
3642
+ url: file.name,
3643
+ isUploading: true
3644
+ });
3645
+ };
3646
+
3647
+ reader.readAsDataURL(file);
3648
+ });
3649
+ };
3650
+
3651
+ var FileUpload = function (_a) {
3652
+ var onUploadFiles = _a.onUploadFiles,
3653
+ label = _a.label,
3654
+ isInverted = _a.isInverted,
3655
+ isDisabled = _a.isDisabled,
3656
+ isRequired = _a.isRequired,
3657
+ infoMessage = _a.infoMessage,
3658
+ errorMessage = _a.errorMessage,
3659
+ acceptedFormats = _a.acceptedFormats,
3660
+ uploadLabel = _a.uploadLabel,
3661
+ customDeleteIcon = _a.customDeleteIcon,
3662
+ customUploadIcon = _a.customUploadIcon;
3663
+
3664
+ var _b = useState([]),
3665
+ selectedFiles = _b[0],
3666
+ setSelectedFiles = _b[1];
3667
+
3668
+ var fileInputRef = useRef(null);
3669
+
3670
+ var _c = useState([]),
3671
+ previews = _c[0],
3672
+ setPreviews = _c[1];
3673
+
3674
+ if (isDisabled) {
3675
+ errorMessage = '';
3676
+ }
3677
+
3678
+ useEffect(function () {
3679
+ if (selectedFiles) {
3680
+ onUploadFiles && onUploadFiles(selectedFiles.map(function (f) {
3681
+ return f.data;
3682
+ }));
3683
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
3684
+
3685
+ }, [selectedFiles]);
3686
+
3687
+ var handleClick = function (ev) {
3688
+ var _a;
3689
+
3690
+ ev.preventDefault();
3691
+ (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
3692
+ };
3693
+
3694
+ var handleChange = function (e) {
3695
+ if (!e.currentTarget.files) return;
3696
+ var newFiles = Array.from(e.currentTarget.files).map(function (f, i) {
3697
+ return {
3698
+ uid: "".concat(new Date().getTime().toString(), "_").concat(i),
3699
+ data: f
3700
+ };
3701
+ });
3702
+ var promises = newFiles.map(function (file) {
3703
+ return readFileAsync(file.data, file.uid);
3704
+ });
3705
+ Promise.all(promises).then(function (p) {
3706
+ setPreviews(function (prev) {
3707
+ return __spreadArray(__spreadArray([], prev, true), p, true);
3708
+ });
3709
+ });
3710
+ setSelectedFiles(function (prev) {
3711
+ return __spreadArray(__spreadArray([], prev, true), newFiles, true);
3712
+ });
3713
+ };
3714
+
3715
+ var handleDelete = function (preview) {
3716
+ return function (ev) {
3717
+ ev.preventDefault();
3718
+ ev.stopPropagation();
3719
+ if (!fileInputRef.current) return;
3720
+ fileInputRef.current.value = ''; // remove element from previews
3721
+
3722
+ setPreviews(function (prev) {
3723
+ var index = prev.findIndex(function (p) {
3724
+ return p.uid === preview.uid;
3725
+ });
3726
+ if (index < 0) return prev;
3727
+
3728
+ var copy = __spreadArray([], prev, true);
3729
+
3730
+ copy.splice(index, 1);
3731
+ return copy;
3732
+ }); // remove alement from selected files
3733
+
3734
+ setSelectedFiles(function (prev) {
3735
+ var index = prev.findIndex(function (p) {
3736
+ return p.uid === preview.uid;
3737
+ });
3738
+ if (index < 0) return prev;
3739
+
3740
+ var copy = __spreadArray([], prev, true);
3741
+
3742
+ copy.splice(index, 1);
3743
+ return copy;
3744
+ });
3745
+ };
3746
+ };
3747
+
3748
+ return React__default.createElement(FieldView$1, {
3749
+ isDisabled: isDisabled
3750
+ }, React__default.createElement(FieldWrapper.Head, {
3751
+ label: label,
3752
+ isRequired: isRequired,
3753
+ isInverted: isInverted
3754
+ }), React__default.createElement(FieldWrapper.Content, null, React__default.createElement(FieldMain, {
3755
+ isInverted: isInverted,
3756
+ isDisabled: isDisabled,
3757
+ hasError: !!errorMessage
3758
+ }, previews.map(function (file) {
3759
+ var fileName = file.url && file.url.split('/') || [];
3760
+ return React__default.createElement(FileItem, {
3761
+ key: file.uid,
3762
+ isInverted: isInverted
3763
+ }, React__default.createElement("span", null, fileName), React__default.createElement(DeleteIcon, {
3764
+ "aria-label": "remove file",
3765
+ type: "button",
3766
+ isInverted: isInverted,
3767
+ onClick: handleDelete(file)
3768
+ }, customDeleteIcon ? customDeleteIcon(isInverted) : React__default.createElement(DeleteForever, null)));
3769
+ }), React__default.createElement(UploadItem, {
3770
+ type: "button",
3771
+ isInverted: isInverted,
3772
+ onClick: handleClick
3773
+ }, uploadLabel && React__default.createElement("span", null, uploadLabel), React__default.createElement(Icon, {
3774
+ isInverted: isInverted
3775
+ }, customUploadIcon ? customUploadIcon(isInverted) : React__default.createElement(UploadFile, null)))), React__default.createElement(Original, {
3776
+ type: "file",
3777
+ onChange: handleChange,
3778
+ ref: fileInputRef,
3779
+ multiple: true,
3780
+ required: isRequired,
3781
+ disabled: isDisabled,
3782
+ accept: acceptedFormats
3783
+ })), React__default.createElement(FieldWrapper.Messages, {
3784
+ infoMessage: infoMessage,
3785
+ errorMessage: errorMessage,
3786
+ isInverted: isInverted
3787
+ }));
3788
+ };
3789
+ /**
3790
+ * Function to compare both field prop states
3791
+ * @param prev Previous props
3792
+ * @param next Next props
3793
+ * @returns
3794
+ */
3795
+
3796
+
3797
+ var areEqual$3 = function (prev, next) {
3798
+ // only apply logic if memo functionality is enabled
3799
+ if (!prev.enableMemo) return false;
3800
+ if (prev.errorMessage !== next.errorMessage) return false;
3801
+ if (prev.infoMessage !== next.infoMessage) return false;
3802
+ if (prev.label !== next.label) return false;
3803
+ return true;
3804
+ };
3805
+
3806
+ var FileUploadCmp = React__default.memo(FileUpload, areEqual$3);
3807
+ var templateObject_1$3, templateObject_2$2, templateObject_3$2, templateObject_4$2, templateObject_5$2, templateObject_6$2, templateObject_7$2;
3808
+
3809
+ var MapWrapper = styled.div.withConfig({
3810
+ displayName: "LocationField__MapWrapper",
3811
+ componentId: "sc-ipn926-0"
3812
+ })(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n display: ", ";\n position: relative;\n"], ["\n display: ", ";\n position: relative;\n"])), function (_a) {
3813
+ var isVisible = _a.isVisible;
3814
+ return isVisible ? 'block' : 'none';
3815
+ });
3816
+ var MapContainer = styled.div.withConfig({
3817
+ displayName: "LocationField__MapContainer",
3818
+ componentId: "sc-ipn926-1"
3819
+ })(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n height: 290px;\n z-index: 0;\n outline: none;\n"], ["\n position: relative;\n width: 100%;\n height: 290px;\n z-index: 0;\n outline: none;\n"])));
3820
+ var ViewToggle = styled.button.withConfig({
3821
+ displayName: "LocationField__ViewToggle",
3822
+ componentId: "sc-ipn926-2"
3823
+ })(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n background: none;\n border: none;\n padding: ", "px 0;\n padding-bottom: ", "px;\n\n cursor: pointer;\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n background: none;\n border: none;\n padding: ", "px 0;\n padding-bottom: ", "px;\n\n cursor: pointer;\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.nudge, spacings.nudge * 2, spacings.nudge * 2);
3824
+ var ToggleText = styled(Copy).withConfig({
3825
+ displayName: "LocationField__ToggleText",
3826
+ componentId: "sc-ipn926-3"
3827
+ })(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject(["\n line-height: 1;\n"], ["\n line-height: 1;\n"])));
3828
+ var ResetMap = styled.div.withConfig({
3829
+ displayName: "LocationField__ResetMap",
3830
+ componentId: "sc-ipn926-4"
3831
+ })(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n position: absolute;\n top: ", "px;\n right: ", "px;\n"], ["\n position: absolute;\n top: ", "px;\n right: ", "px;\n"])), spacings.nudge, spacings.nudge);
3832
+ var ResetMapControl = styled.button.withConfig({
3833
+ displayName: "LocationField__ResetMapControl",
3834
+ componentId: "sc-ipn926-5"
3835
+ })(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: none;\n border: 0;\n padding: ", "px;\n margin-top: -", "px;\n margin-right: -", "px;\n\n cursor: pointer;\n transition: color 0.2s ease-in-out;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n color: ", ";\n }\n }\n\n &:focus {\n outline: 1px solid ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: none;\n border: 0;\n padding: ", "px;\n margin-top: -", "px;\n margin-right: -", "px;\n\n cursor: pointer;\n transition: color 0.2s ease-in-out;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n color: ", ";\n }\n }\n\n &:focus {\n outline: 1px solid ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"])), spacings.nudge, spacings.nudge, spacings.nudge, function (_a) {
3836
+ var theme = _a.theme;
3837
+ return getColors(theme).primary.default;
3838
+ }, function (_a) {
3839
+ var theme = _a.theme;
3840
+ return getColors(theme).primary.default;
3841
+ });
3842
+ var TrackLocation = styled.div.withConfig({
3843
+ displayName: "LocationField__TrackLocation",
3844
+ componentId: "sc-ipn926-6"
3845
+ })(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject(["\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"], ["\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"])), spacings.nudge * 2, spacings.nudge);
3846
+ var TrackLocationControl = styled.button.withConfig({
3847
+ displayName: "LocationField__TrackLocationControl",
3848
+ componentId: "sc-ipn926-7"
3849
+ })(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: ", ";\n border: none;\n padding: 0.7em;\n min-height: 40px;\n\n ", "\n color: ", ";\n cursor: pointer;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);\n }\n }\n\n &:focus {\n text-decoration: underline;\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);\n }\n\n &:focus:not(:focus-visible) {\n text-decoration: none;\n outline: none;\n box-shadow: none;\n }\n\n &:active {\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3);\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: ", ";\n border: none;\n padding: 0.7em;\n min-height: 40px;\n\n ", "\n color: ", ";\n cursor: pointer;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);\n }\n }\n\n &:focus {\n text-decoration: underline;\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);\n }\n\n &:focus:not(:focus-visible) {\n text-decoration: none;\n outline: none;\n box-shadow: none;\n }\n\n &:active {\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3);\n }\n"])), function (_a) {
3850
+ var theme = _a.theme;
3851
+ return getColors(theme).elementBg.dark;
3852
+ }, copyStyle('copy', 'small'), function (_a) {
3853
+ var theme = _a.theme;
3854
+ return getFonts(theme).copy.small.colorInverted;
3855
+ });
3856
+ var FieldView = styled.div.withConfig({
3857
+ displayName: "LocationField__FieldView",
3858
+ componentId: "sc-ipn926-8"
3859
+ })(templateObject_9$1 || (templateObject_9$1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n & > * + * {\n margin-left: 16px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n & > * + * {\n margin-left: 16px;\n }\n"])));
3860
+ var Area$1 = styled.textarea.withConfig({
3861
+ displayName: "LocationField__Area",
3862
+ componentId: "sc-ipn926-9"
3863
+ })(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: block;\n outline: none;\n width: 100%;\n min-height: 100px;\n box-shadow: none;\n border-radius: 0px;\n -webkit-appearance: none;\n\n resize: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"], ["\n display: block;\n outline: none;\n width: 100%;\n min-height: 100px;\n box-shadow: none;\n border-radius: 0px;\n -webkit-appearance: none;\n\n resize: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"])), spacings.nudge, function (_a) {
3864
+ var theme = _a.theme,
3865
+ isInverted = _a.isInverted,
3866
+ hasError = _a.hasError;
3867
+
3868
+ if (isInverted) {
3869
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
3870
+ }
3871
+
3872
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
3873
+ }, function (_a) {
3874
+ var theme = _a.theme;
3875
+ return getGlobals(theme).sections.edgeRadius;
3876
+ }, copyStyle('copy', 'small'), function (_a) {
3877
+ var theme = _a.theme;
3878
+ return withRange(getFormFieldTextSize(theme), 'font-size');
3879
+ }, function (_a) {
3880
+ var theme = _a.theme,
3881
+ isInverted = _a.isInverted,
3882
+ hasError = _a.hasError;
3883
+
3884
+ if (isInverted) {
3885
+ return hasError ? getColors(theme).text.errorInverted : getFonts(theme).copy.small.colorInverted;
3886
+ }
3887
+
3888
+ return hasError ? getColors(theme).text.error : getFonts(theme).copy.small.color;
3889
+ }, function (_a) {
3890
+ var theme = _a.theme,
3891
+ isInverted = _a.isInverted;
3892
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3893
+ }, function (_a) {
3894
+ var theme = _a.theme,
3895
+ isInverted = _a.isInverted;
3896
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3897
+ }, function (_a) {
3898
+ var theme = _a.theme,
3899
+ isInverted = _a.isInverted;
3900
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
3901
+ });
3902
+
3903
+ var LocationField = function (_a) {
3904
+ var _b, _c;
3905
+
3906
+ var label = _a.label,
3907
+ errorMessage = _a.errorMessage,
3908
+ infoMessage = _a.infoMessage,
3909
+ isRequired = _a.isRequired,
3910
+ isDisabled = _a.isDisabled,
3911
+ isInverted = _a.isInverted,
3912
+ placeholder = _a.placeholder,
3913
+ value = _a.value,
3914
+ name = _a.name,
3915
+ marker = _a.marker,
3916
+ initialMapCenter = _a.initialMapCenter,
3917
+ _d = _a.zoom,
3918
+ zoom = _d === void 0 ? 10 : _d,
3919
+ onChange = _a.onChange,
3920
+ onBlur = _a.onBlur,
3921
+ customToggle = _a.customToggle,
3922
+ customLocationControl = _a.customLocationControl,
3923
+ customResetControl = _a.customResetControl,
3924
+ _e = _a.toggleLabel,
3925
+ toggleLabel = _e === void 0 ? 'Select location on map' : _e,
3926
+ _f = _a.trackLocationLabel,
3927
+ trackLocationLabel = _f === void 0 ? 'My location' : _f;
3928
+
3929
+ if (isDisabled) {
3930
+ errorMessage = '';
3931
+ }
3932
+
3933
+ var _g = useLibTheme(),
3934
+ colors = _g.colors,
3935
+ fonts = _g.fonts;
3936
+
3937
+ var _h = useState(false),
3938
+ useMapView = _h[0],
3939
+ setUseMapView = _h[1];
3940
+
3941
+ var _j = useState(value || {
3942
+ description: ''
3943
+ }),
3944
+ getValue = _j[0],
3945
+ setValue = _j[1];
3946
+
3947
+ var prevValue = useRef(null);
3948
+
3949
+ var _k = useState([]),
3950
+ markers = _k[0],
3951
+ setMarkers = _k[1];
3952
+
3953
+ var _l = useLazyInput(function (value) {
3954
+ setValue({
3955
+ description: value,
3956
+ position: undefined
3957
+ });
3958
+ }, (value === null || value === void 0 ? void 0 : value.description) || ''),
3959
+ descValue = _l.value,
3960
+ setDescValue = _l.update,
3961
+ forceUpdate = _l.forceUpdate;
3962
+
3963
+ var getMarkersFromPositions = useCallback(function (positions) {
3964
+ /** Markers */
3965
+ var defaultMarker = {
3966
+ size: [28, 28],
3967
+ anchor: [14, 28],
3968
+ sizeActive: [70, 70],
3969
+ anchorActive: [35, 70],
3970
+ url: getSVGDataImg(React__default.createElement(LocationPin, null))
3971
+ };
3972
+ var markerList = [];
3973
+
3974
+ for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
3975
+ var position = positions_1[_i];
3976
+ markerList.push({
3977
+ id: 'location',
3978
+ position: position,
3979
+ icon: marker || defaultMarker
3980
+ });
3981
+ }
3982
+
3983
+ return markerList;
3984
+ }, [marker]);
3985
+
3986
+ var _m = useLeafletMap({
3987
+ activeMarkerId: 'location',
3988
+ markers: markers,
3989
+ center: initialMapCenter,
3990
+ zoom: zoom,
3991
+ onClick: function (ev) {
3992
+ mapClickHandler(ev);
3993
+ }
3994
+ }),
3995
+ setMapContainer = _m.setContainer,
3996
+ flyToPosition = _m.flyToPosition,
3997
+ recalculateMapSize = _m.recalculateMapSize; // double click fix
3998
+
3999
+
4000
+ var doubleClickTimerRef = useRef(null);
4001
+
4002
+ var _o = useGeolocation(true, false),
4003
+ isGeolocationSupported = _o.isSupported,
4004
+ isEnabled = _o.isEnabled,
4005
+ location = _o.location,
4006
+ error = _o.error,
4007
+ resetLocationTracking = _o.reset,
4008
+ cancelGeolocation = _o.cancel;
4009
+
4010
+ var setMapToInitial = useCallback(function () {
4011
+ flyToPosition(initialMapCenter, zoom);
4012
+ cancelGeolocation();
4013
+ }, [cancelGeolocation, flyToPosition, initialMapCenter, zoom]);
4014
+
4015
+ var handleMapClick = function (newPos) {
4016
+ cancelGeolocation(); // set marker
4017
+
4018
+ var markers = getMarkersFromPositions([newPos]);
4019
+ setMarkers(markers);
4020
+ setValue({
4021
+ description: '',
4022
+ position: newPos
4023
+ });
4024
+ };
4025
+
4026
+ var handleTrackClick = function () {
4027
+ // if we have old location set marker, map and value
4028
+ setToCurrentLocation();
4029
+ resetLocationTracking();
4030
+ };
4031
+
4032
+ var mapClickHandler = function (ev) {
4033
+ var newPos = [ev.latlng.lat, ev.latlng.lng];
4034
+
4035
+ if (doubleClickTimerRef.current === null) {
4036
+ doubleClickTimerRef.current = window.setTimeout(function () {
4037
+ handleMapClick(newPos);
4038
+ doubleClickTimerRef.current = null;
4039
+ }, 300);
4040
+ } else {
4041
+ window.clearTimeout(doubleClickTimerRef.current);
4042
+ doubleClickTimerRef.current = null;
4043
+ }
4044
+ };
4045
+
4046
+ var setToCurrentLocation = useCallback(function () {
4047
+ if (!location) return;
4048
+ var newPos = [location.coords.latitude, location.coords.longitude];
4049
+ var marker = getMarkersFromPositions([newPos]);
4050
+ setMarkers(marker);
4051
+ flyToPosition(newPos, 14);
4052
+ setValue({
4053
+ description: '',
4054
+ position: newPos
4055
+ });
4056
+ }, [flyToPosition, getMarkersFromPositions, location]);
4057
+
4058
+ var toggleViewState = function () {
4059
+ setUseMapView(function (prev) {
4060
+ return !prev;
4061
+ });
4062
+ };
4063
+
4064
+ useEffect(function () {
4065
+ if (isEnabled && location && !error) {
4066
+ setToCurrentLocation();
4067
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4068
+
4069
+ }, [error, location, isEnabled]);
4070
+ useEffect(function () {
4071
+ setValue({
4072
+ description: '',
4073
+ position: undefined
4074
+ }); // recalculate map on view change
4075
+
4076
+ if (useMapView) {
4077
+ recalculateMapSize();
4078
+ setDescValue('');
4079
+ } else {
4080
+ setMarkers([]);
4081
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4082
+
4083
+ }, [useMapView, recalculateMapSize, descValue]);
4084
+ useUpdateEffect(function () {
4085
+ var _a, _b, _c, _d;
4086
+
4087
+ var prev = prevValue.current;
4088
+
4089
+ if (!prev || prev.description !== getValue.description || ((_a = prev.position) === null || _a === void 0 ? void 0 : _a[0]) !== ((_b = getValue.position) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = prev.position) === null || _c === void 0 ? void 0 : _c[1]) !== ((_d = getValue.position) === null || _d === void 0 ? void 0 : _d[1])) {
4090
+ prevValue.current = getValue;
4091
+ onChange === null || onChange === void 0 ? void 0 : onChange(getValue);
4092
+ }
4093
+ }, [getValue]);
4094
+ return React__default.createElement(React__default.Fragment, null, name && React__default.createElement("input", {
4095
+ type: "hidden",
4096
+ name: "".concat(name, "[\"location\"]"),
4097
+ value: "".concat((_b = getValue === null || getValue === void 0 ? void 0 : getValue.position) === null || _b === void 0 ? void 0 : _b[0], ",").concat((_c = getValue === null || getValue === void 0 ? void 0 : getValue.position) === null || _c === void 0 ? void 0 : _c[1])
4098
+ }), React__default.createElement(FieldWrapper.View, {
4099
+ isDisabled: isDisabled,
4100
+ onClick: function (ev) {
4101
+ return ev.preventDefault();
4102
+ }
4103
+ }, React__default.createElement(FieldWrapper.Head, {
4104
+ label: label,
4105
+ isRequired: isRequired,
4106
+ isInverted: isInverted
4107
+ }), customToggle ? customToggle({
4108
+ isInverted: isInverted,
4109
+ viewState: useMapView ? 'map' : 'desc',
4110
+ handleClick: toggleViewState
4111
+ }) : React__default.createElement(ViewToggle, {
4112
+ type: "button",
4113
+ onClick: toggleViewState
4114
+ }, useMapView ? React__default.createElement(ToggleOn, {
4115
+ iconColor: isInverted ? colors.primary.inverted : colors.primary.default
4116
+ }) : React__default.createElement(ToggleOff, {
4117
+ iconColor: isInverted ? fonts.copy.small.colorInverted : fonts.copy.small.color
4118
+ }), React__default.createElement(ToggleText, {
4119
+ size: "small",
4120
+ renderAs: "span",
4121
+ isInverted: isInverted
4122
+ }, toggleLabel)), React__default.createElement(MapWrapper, {
4123
+ isVisible: useMapView
4124
+ }, React__default.createElement(MapContainer, {
4125
+ ref: setMapContainer,
4126
+ tabIndex: 0,
4127
+ onClick: function () {
4128
+ forceUpdate();
4129
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(getValue);
4130
+ }
4131
+ }), React__default.createElement(ResetMap, null, customResetControl ? customResetControl({
4132
+ isInverted: isInverted,
4133
+ handleClick: setMapToInitial
4134
+ }) : React__default.createElement(ResetMapControl, {
4135
+ onClick: setMapToInitial
4136
+ }, React__default.createElement(LocationSearch, null))), isGeolocationSupported && React__default.createElement(TrackLocation, null, customLocationControl ? customLocationControl({
4137
+ isInverted: isInverted,
4138
+ handleClick: handleTrackClick
4139
+ }) : React__default.createElement(TrackLocationControl, {
4140
+ onClick: handleTrackClick
4141
+ }, trackLocationLabel))), !useMapView && React__default.createElement(React__default.Fragment, null, React__default.createElement(FieldView, null, React__default.createElement(FieldWrapper.Content, null, React__default.createElement(Area$1, {
4142
+ placeholder: placeholder,
4143
+ hasError: !!errorMessage,
4144
+ isInverted: isInverted,
4145
+ name: "".concat(name, "[\"description\"]"),
4146
+ value: descValue,
4147
+ required: isRequired,
4148
+ onChange: function (ev) {
4149
+ var value = ev.currentTarget.value;
4150
+ setDescValue(value);
4151
+ },
4152
+ onBlur: function () {
4153
+ forceUpdate();
4154
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(getValue);
4155
+ }
4156
+ })))), React__default.createElement(FieldWrapper.Messages, {
4157
+ infoMessage: infoMessage,
4158
+ errorMessage: errorMessage,
4159
+ isInverted: isInverted
4160
+ })));
4161
+ };
4162
+ /**
4163
+ * Function to compare both field prop states
4164
+ * @param prev Previous props
4165
+ * @param next Next props
4166
+ * @returns
4167
+ */
4168
+
4169
+
4170
+ var areEqual$2 = function (prev, next) {
4171
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; // only apply logic if memo functionality is enabled
4172
+
4173
+
4174
+ if (!prev.enableMemo) return false;
4175
+ if (prev.errorMessage !== next.errorMessage) return false;
4176
+ if (prev.infoMessage !== next.infoMessage) return false;
4177
+ if (prev.label !== next.label) return false;
4178
+ if (prev.toggleLabel !== next.toggleLabel) return false;
4179
+ if (prev.placeholder !== next.placeholder) return false;
4180
+ if (((_a = prev.value) === null || _a === void 0 ? void 0 : _a.description) !== ((_b = next.value) === null || _b === void 0 ? void 0 : _b.description)) return false;
4181
+
4182
+ if (((_d = (_c = prev.value) === null || _c === void 0 ? void 0 : _c.position) === null || _d === void 0 ? void 0 : _d[0]) !== ((_f = (_e = next.value) === null || _e === void 0 ? void 0 : _e.position) === null || _f === void 0 ? void 0 : _f[0]) || ((_h = (_g = prev.value) === null || _g === void 0 ? void 0 : _g.position) === null || _h === void 0 ? void 0 : _h[1]) !== ((_k = (_j = next.value) === null || _j === void 0 ? void 0 : _j.position) === null || _k === void 0 ? void 0 : _k[1])) {
4183
+ return false;
4184
+ }
4185
+
4186
+ return true;
4187
+ };
4188
+
4189
+ var LocationField$1 = React__default.memo(LocationField, areEqual$2);
4190
+ var templateObject_1$2, templateObject_2$1, templateObject_3$1, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10;
4191
+
4192
+ var Select = styled.button.withConfig({
4193
+ displayName: "SelectDropdown__Select",
4194
+ componentId: "sc-hnkdye-0"
4195
+ })(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n position: relative;\n\n -webkit-appearance: none;\n outline: none;\n cursor: pointer;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n position: relative;\n\n -webkit-appearance: none;\n outline: none;\n cursor: pointer;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.nudge, function (_a) {
4196
+ var theme = _a.theme,
4197
+ isInverted = _a.isInverted,
4198
+ hasError = _a.hasError,
4199
+ isOpen = _a.isOpen;
4200
+ if (isOpen) return 'transparent';
4201
+
4202
+ if (isInverted) {
4203
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
4204
+ }
4205
+
4206
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
4207
+ }, function (_a) {
4208
+ var theme = _a.theme;
4209
+ return getGlobals(theme).sections.edgeRadius;
4210
+ }, copyStyle('copy', 'small'), function (_a) {
4211
+ var theme = _a.theme;
4212
+ return withRange(getFormFieldTextSize(theme), 'font-size');
4213
+ }, function (_a) {
4214
+ var theme = _a.theme,
4215
+ isInverted = _a.isInverted,
4216
+ hasError = _a.hasError,
4217
+ isSelected = _a.isSelected;
4218
+
4219
+ if (!isSelected) {
4220
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
4221
+ }
4222
+
4223
+ if (isInverted) {
4224
+ return hasError ? getColors(theme).text.errorInverted : getFonts(theme).copy.small.colorInverted;
4225
+ }
4226
+
4227
+ return hasError ? getColors(theme).text.error : getFonts(theme).copy.small.color;
4228
+ }, function (_a) {
4229
+ var theme = _a.theme,
4230
+ isInverted = _a.isInverted,
4231
+ isOpen = _a.isOpen;
4232
+ return "1px solid ".concat(isOpen ? 'transparent' : isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4233
+ }, function (_a) {
4234
+ var theme = _a.theme,
4235
+ isInverted = _a.isInverted,
4236
+ isOpen = _a.isOpen;
4237
+ return "1px solid ".concat(isOpen ? 'transparent' : isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4238
+ }, spacings.nudge);
4239
+ var SelectMain = styled.span.withConfig({
4240
+ displayName: "SelectDropdown__SelectMain",
4241
+ componentId: "sc-hnkdye-1"
4242
+ })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n user-select: none;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: block;\n user-select: none;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.nudge);
4243
+ var Indicator = styled.span.withConfig({
4244
+ displayName: "SelectDropdown__Indicator",
4245
+ componentId: "sc-hnkdye-2"
4246
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: block;\n pointer-events: none;\n"], ["\n display: block;\n pointer-events: none;\n"])));
4247
+ var Flyout = styled.ul.withConfig({
4248
+ displayName: "SelectDropdown__Flyout",
4249
+ componentId: "sc-hnkdye-3"
4250
+ })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n list-style: none;\n padding: 0 !important;\n margin: 0 !important;\n\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 2;\n\n display: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n max-height: 300px;\n overflow-y: auto;\n scrollbar-width: none;\n\n outline: ", ";\n outline-offset: 0;\n\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 14px;\n }\n\n ::-webkit-scrollbar-thumb {\n border-radius: 8px;\n background-color: ", ";\n border: 4px solid rgba(0, 0, 0, 0);\n background-clip: padding-box;\n }\n"], ["\n list-style: none;\n padding: 0 !important;\n margin: 0 !important;\n\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 2;\n\n display: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n max-height: 300px;\n overflow-y: auto;\n scrollbar-width: none;\n\n outline: ", ";\n outline-offset: 0;\n\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 14px;\n }\n\n ::-webkit-scrollbar-thumb {\n border-radius: 8px;\n background-color: ", ";\n border: 4px solid rgba(0, 0, 0, 0);\n background-clip: padding-box;\n }\n"])), function (_a) {
4251
+ var isVisible = _a.isVisible;
4252
+ return isVisible ? 'block' : 'none';
4253
+ }, function (_a) {
4254
+ var theme = _a.theme;
4255
+ return getColors(theme).elementBg.light;
4256
+ }, function (_a) {
4257
+ var theme = _a.theme,
4258
+ isInverted = _a.isInverted;
4259
+ return isInverted ? getColors(theme).elementBg.light : getColors(theme).elementBg.dark;
4260
+ }, function (_a) {
4261
+ var theme = _a.theme;
4262
+ return getGlobals(theme).sections.edgeRadius;
4263
+ }, function (_a) {
4264
+ var theme = _a.theme,
4265
+ isInverted = _a.isInverted;
4266
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4267
+ }, function (_a) {
4268
+ var theme = _a.theme;
4269
+ return getColors(theme).elementBg.medium;
4270
+ });
4271
+ var ItemStyle = styled.li.withConfig({
4272
+ displayName: "SelectDropdown__ItemStyle",
4273
+ componentId: "sc-hnkdye-4"
4274
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: ", "px;\n width: 100%;\n cursor: pointer;\n position: relative;\n"], ["\n padding: ", "px;\n width: 100%;\n cursor: pointer;\n position: relative;\n"])), spacings.nudge);
4275
+ var Item = styled(Copy).withConfig({
4276
+ displayName: "SelectDropdown__Item",
4277
+ componentId: "sc-hnkdye-5"
4278
+ })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n z-index: 0;\n\n @media (hover: hover) and (pointer: fine) {\n ", ":hover & {\n &:before {\n content: '';\n background: ", ";\n opacity: 0.25;\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: -1;\n }\n }\n }\n\n ", "\n"], ["\n z-index: 0;\n\n @media (hover: hover) and (pointer: fine) {\n ", ":hover & {\n &:before {\n content: '';\n background: ", ";\n opacity: 0.25;\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: -1;\n }\n }\n }\n\n ", "\n"])), ItemStyle, function (_a) {
4279
+ var theme = _a.theme;
4280
+ return getColors(theme).primary.hover;
4281
+ }, function (_a) {
4282
+ var isSelected = _a.isSelected;
4283
+ return isSelected && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n &:before {\n content: '';\n background: ", ";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n z-index: -1;\n }\n "], ["\n &:before {\n content: '';\n background: ", ";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n z-index: -1;\n }\n "])), function (_a) {
4284
+ var theme = _a.theme;
4285
+ return getColors(theme).primary.default;
4286
+ });
4287
+ });
4288
+ var ClearItem = styled(Item).withConfig({
4289
+ displayName: "SelectDropdown__ClearItem",
4290
+ componentId: "sc-hnkdye-6"
4291
+ })(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: transparent;\n"], ["\n color: transparent;\n"])));
4292
+ var Container = styled.div.withConfig({
4293
+ displayName: "SelectDropdown__Container",
4294
+ componentId: "sc-hnkdye-7"
4295
+ })(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: relative;\n outline: none;\n"], ["\n position: relative;\n outline: none;\n"])));
4296
+
4297
+ var SelectDropdown = function (_a) {
4298
+ var label = _a.label,
4299
+ isRequired = _a.isRequired,
4300
+ errorMessage = _a.errorMessage,
4301
+ infoMessage = _a.infoMessage,
4302
+ isDisabled = _a.isDisabled,
4303
+ isInverted = _a.isInverted,
4304
+ items = _a.items,
4305
+ name = _a.name,
4306
+ selectedItem = _a.selectedItem,
4307
+ placeholder = _a.placeholder,
4308
+ onChange = _a.onChange,
4309
+ onBlur = _a.onBlur,
4310
+ indicator = _a.indicator;
4311
+ var colors = useLibTheme().colors;
4312
+
4313
+ var _b = useState(false),
4314
+ isOpen = _b[0],
4315
+ setIsOpen = _b[1];
4316
+
4317
+ var _c = useState((items === null || items === void 0 ? void 0 : items.findIndex(function (item) {
4318
+ return item.label === selectedItem;
4319
+ })) || -1),
4320
+ activeItemIndex = _c[0],
4321
+ setActiveItemIndex = _c[1];
4322
+
4323
+ var _d = useState(items || []),
4324
+ selectItems = _d[0],
4325
+ setSelectItems = _d[1];
4326
+
4327
+ var selectBtnRef = useRef(null);
4328
+ var isMounted = useMounted();
4329
+ var itemHasBeenClicked = useRef(false);
4330
+ useEffect(function () {
4331
+ var index = items === null || items === void 0 ? void 0 : items.findIndex(function (item) {
4332
+ return item.label === selectedItem;
4333
+ });
4334
+ if (index !== -1) setActiveItemIndex(index);
4335
+ setSelectItems(items || []);
4336
+ }, [items, selectedItem]);
4337
+ useEffect(function () {
4338
+ var newItem = selectItems[activeItemIndex];
4339
+
4340
+ if (isMounted) {
4341
+ onChange && onChange(newItem === null || newItem === void 0 ? void 0 : newItem.label, newItem === null || newItem === void 0 ? void 0 : newItem.value);
4342
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4343
+
4344
+ }, [selectItems, activeItemIndex, selectedItem]);
4345
+
4346
+ if (isDisabled) {
4347
+ errorMessage = '';
4348
+ }
4349
+
4350
+ var activeItem = useMemo(function () {
4351
+ return activeItemIndex >= 0 && activeItemIndex < selectItems.length ? selectItems[activeItemIndex] : undefined;
4352
+ }, [activeItemIndex, selectItems]);
4353
+ return React__default.createElement(FieldWrapper.View, {
4354
+ isDisabled: isDisabled
4355
+ }, React__default.createElement(FieldWrapper.Head, {
4356
+ label: label,
4357
+ isRequired: isRequired,
4358
+ isInverted: isInverted
4359
+ }), React__default.createElement(FieldWrapper.Content, null, React__default.createElement(Container, null, React__default.createElement(Select, {
4360
+ ref: selectBtnRef,
4361
+ type: "button",
4362
+ "aria-label": (activeItem === null || activeItem === void 0 ? void 0 : activeItem.label) || placeholder || 'Select item',
4363
+ isOpen: isOpen,
4364
+ isInverted: isInverted,
4365
+ isSelected: !!activeItem,
4366
+ hasError: !!errorMessage,
4367
+ onClick: function () {
4368
+ setIsOpen(function (prev) {
4369
+ return !prev;
4370
+ });
4371
+ },
4372
+ onBlur: function () {
4373
+ if (!itemHasBeenClicked.current) {
4374
+ setIsOpen(false);
4375
+ onBlur && onBlur();
4376
+ }
4377
+ },
4378
+ onKeyDown: function (ev) {
4379
+ if (ev.key === 'ArrowDown') {
4380
+ ev.preventDefault();
4381
+ setIsOpen(true);
4382
+
4383
+ if (isOpen && selectItems[activeItemIndex + 1]) {
4384
+ setActiveItemIndex(function (prev) {
4385
+ return prev + 1;
4386
+ });
4387
+ }
4388
+ } else if (ev.key === 'ArrowUp') {
4389
+ ev.preventDefault();
4390
+ setIsOpen(true);
4391
+
4392
+ if (isOpen && selectItems[activeItemIndex - 1]) {
4393
+ setActiveItemIndex(function (prev) {
4394
+ return prev - 1;
4395
+ });
4396
+ }
4397
+ }
4398
+ }
4399
+ }, React__default.createElement(SelectMain, null, (activeItem === null || activeItem === void 0 ? void 0 : activeItem.label) || placeholder), React__default.createElement(Indicator, null, indicator && indicator({
4400
+ isOpen: isOpen,
4401
+ isDisabled: isDisabled
4402
+ }), !indicator && (isOpen ? React__default.createElement(AngleUp, {
4403
+ iconColor: isDisabled ? colors.elementBg.medium : colors.elementBg.dark
4404
+ }) : React__default.createElement(AngleDown, {
4405
+ iconColor: isDisabled ? colors.elementBg.medium : colors.elementBg.dark
4406
+ })))), React__default.createElement(Flyout, {
4407
+ isVisible: isOpen
4408
+ }, isValidArray(items, false) && React__default.createElement(ItemStyle, {
4409
+ key: "key_0",
4410
+ onMouseDown: function () {
4411
+ itemHasBeenClicked.current = true;
4412
+ },
4413
+ onClick: function (ev) {
4414
+ var _a;
4415
+
4416
+ ev.preventDefault(); // set new item
4417
+
4418
+ setActiveItemIndex(-1); // set focus back to toggle
4419
+
4420
+ (_a = selectBtnRef.current) === null || _a === void 0 ? void 0 : _a.focus(); // close flyout
4421
+
4422
+ setIsOpen(false);
4423
+ itemHasBeenClicked.current = false;
4424
+ }
4425
+ }, React__default.createElement(ClearItem, {
4426
+ renderAs: "span",
4427
+ size: "small"
4428
+ }, "Clear")), items.map(function (item, i) {
4429
+ return React__default.createElement(ItemStyle, {
4430
+ key: "key_".concat(i + 1),
4431
+ onMouseDown: function () {
4432
+ itemHasBeenClicked.current = true;
4433
+ },
4434
+ onClick: function (ev) {
4435
+ var _a;
4436
+
4437
+ ev.preventDefault(); // set new item
4438
+
4439
+ setActiveItemIndex(i); // set focus back to toggle
4440
+
4441
+ (_a = selectBtnRef.current) === null || _a === void 0 ? void 0 : _a.focus(); // close flyout
4442
+
4443
+ setIsOpen(false);
4444
+ itemHasBeenClicked.current = false;
4445
+ }
4446
+ }, React__default.createElement(Item, {
4447
+ renderAs: "span",
4448
+ isSelected: i === activeItemIndex,
4449
+ size: "small",
4450
+ textColor: i === activeItemIndex ? colors.elementBg.light : colors.elementBg.dark
4451
+ }, item.label));
4452
+ }))), activeItem && React__default.createElement("input", {
4453
+ type: "hidden",
4454
+ name: name,
4455
+ value: JSON.stringify(activeItem.value)
4456
+ })), React__default.createElement(FieldWrapper.Messages, {
4457
+ infoMessage: infoMessage,
4458
+ errorMessage: errorMessage,
4459
+ isInverted: isInverted
4460
+ }));
4461
+ };
4462
+ /**
4463
+ * Function to compare both field prop states
4464
+ * @param prev Previous props
4465
+ * @param next Next props
4466
+ * @returns
4467
+ */
4468
+
4469
+
4470
+ var areEqual$1 = function (prev, next) {
4471
+ // only apply logic if memo functionality is enabled
4472
+ if (!prev.enableMemo) return false;
4473
+ if (prev.selectedItem !== next.selectedItem) return false;
4474
+ if (prev.errorMessage !== next.errorMessage) return false;
4475
+ if (prev.infoMessage !== next.infoMessage) return false;
4476
+ if (prev.label !== next.label) return false;
4477
+ if (prev.placeholder !== next.placeholder) return false; // compare items
4478
+
4479
+ if (prev.items.length !== next.items.length) return false;
4480
+
4481
+ for (var i = 0; i < prev.items.length; i++) {
4482
+ if (prev.items[i].label !== next.items[i].label || prev.items[i].value !== next.items[i].value) {
4483
+ return false;
4484
+ }
4485
+ }
4486
+
4487
+ return true;
4488
+ };
4489
+
4490
+ var SelectDropdown$1 = React__default.memo(SelectDropdown, areEqual$1);
4491
+ var templateObject_1$1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
4492
+
4493
+ var Area = styled.textarea.withConfig({
4494
+ displayName: "Textarea__Area",
4495
+ componentId: "sc-1hq47t-0"
4496
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: block;\n outline: none;\n width: 100%;\n min-height: 100px;\n box-shadow: none;\n border-radius: 0px;\n -webkit-appearance: none;\n\n resize: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"], ["\n display: block;\n outline: none;\n width: 100%;\n min-height: 100px;\n box-shadow: none;\n border-radius: 0px;\n -webkit-appearance: none;\n\n resize: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"])), spacings.nudge, function (_a) {
4497
+ var theme = _a.theme,
4498
+ isInverted = _a.isInverted,
4499
+ hasError = _a.hasError;
4500
+
4501
+ if (isInverted) {
4502
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
4503
+ }
4504
+
4505
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
4506
+ }, function (_a) {
4507
+ var theme = _a.theme;
4508
+ return getGlobals(theme).sections.edgeRadius;
4509
+ }, copyStyle('copy', 'small'), function (_a) {
4510
+ var theme = _a.theme;
4511
+ return withRange(getFormFieldTextSize(theme), 'font-size');
4512
+ }, function (_a) {
4513
+ var theme = _a.theme,
4514
+ isInverted = _a.isInverted,
4515
+ hasError = _a.hasError;
4516
+
4517
+ if (isInverted) {
4518
+ return hasError ? getColors(theme).text.errorInverted : getFonts(theme).copy.small.colorInverted;
4519
+ }
4520
+
4521
+ return hasError ? getColors(theme).text.error : getFonts(theme).copy.small.color;
4522
+ }, function (_a) {
4523
+ var theme = _a.theme,
4524
+ isInverted = _a.isInverted;
4525
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4526
+ }, function (_a) {
4527
+ var theme = _a.theme,
4528
+ isInverted = _a.isInverted;
4529
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4530
+ }, function (_a) {
4531
+ var theme = _a.theme,
4532
+ isInverted = _a.isInverted;
4533
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
4534
+ });
4535
+
4536
+ var Textarea = function (_a) {
4537
+ var label = _a.label,
4538
+ isRequired = _a.isRequired,
4539
+ errorMessage = _a.errorMessage,
4540
+ infoMessage = _a.infoMessage,
4541
+ isDisabled = _a.isDisabled,
4542
+ isInverted = _a.isInverted,
4543
+ placeholder = _a.placeholder,
4544
+ value = _a.value,
4545
+ name = _a.name,
4546
+ onChange = _a.onChange,
4547
+ onBlur = _a.onBlur;
4548
+
4549
+ if (isDisabled) {
4550
+ errorMessage = '';
4551
+ }
4552
+
4553
+ return React__default.createElement(FieldWrapper.View, {
4554
+ isDisabled: isDisabled
4555
+ }, React__default.createElement(FieldWrapper.Head, {
4556
+ label: label,
4557
+ isRequired: isRequired,
4558
+ isInverted: isInverted
4559
+ }), React__default.createElement(FieldWrapper.Content, null, React__default.createElement(Area, {
4560
+ value: value,
4561
+ name: name,
4562
+ placeholder: placeholder,
4563
+ hasError: !!errorMessage,
4564
+ isDisabled: isDisabled,
4565
+ isInverted: isInverted,
4566
+ required: isRequired,
4567
+ onChange: onChange,
4568
+ onBlur: onBlur
4569
+ })), React__default.createElement(FieldWrapper.Messages, {
4570
+ infoMessage: infoMessage,
4571
+ errorMessage: errorMessage,
4572
+ isInverted: isInverted
4573
+ }));
4574
+ };
4575
+ /**
4576
+ * Function to compare both field prop states
4577
+ * @param prev Previous props
4578
+ * @param next Next props
4579
+ * @returns
4580
+ */
4581
+
4582
+
4583
+ var areEqual = function (prev, next) {
4584
+ // only apply logic if memo functionality is enabled
4585
+ if (!prev.enableMemo) return false;
4586
+ if (prev.value !== next.value) return false;
4587
+ if (prev.errorMessage !== next.errorMessage) return false;
4588
+ if (prev.infoMessage !== next.infoMessage) return false;
4589
+ if (prev.label !== next.label) return false;
4590
+ if (prev.placeholder !== next.placeholder) return false;
4591
+ return true;
4592
+ };
4593
+
4594
+ var Textarea$1 = React__default.memo(Textarea, areEqual);
4595
+ var templateObject_1;
4596
+
4597
+ export { DatepickerCmp as D, FileUploadCmp as F, LocationField$1 as L, RadioButton$1 as R, SelectDropdown$1 as S, Textarea$1 as T };
4598
+ //# sourceMappingURL=Textarea-380665db.js.map