@blateral/b.kit 2.3.0-beta.1.3 → 2.3.0-beta.1.4

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 (206) hide show
  1. package/cjs/EventBlock-10b9d78d.js +2 -0
  2. package/cjs/EventBlock-10b9d78d.js.map +1 -0
  3. package/cjs/FileUpload-ece8bb07.js +2 -0
  4. package/cjs/FileUpload-ece8bb07.js.map +1 -0
  5. package/cjs/Filter-d6d90b8b.js +2 -0
  6. package/cjs/Filter-d6d90b8b.js.map +1 -0
  7. package/cjs/FilterField-cf9e2f16.js +2 -0
  8. package/cjs/FilterField-cf9e2f16.js.map +1 -0
  9. package/cjs/Grid-39b12e21.js +2 -0
  10. package/cjs/Grid-39b12e21.js.map +1 -0
  11. package/cjs/InfoList-577f3c57.js +2 -0
  12. package/cjs/InfoList-577f3c57.js.map +1 -0
  13. package/cjs/POICard-492bf8d0.js +2 -0
  14. package/cjs/POICard-492bf8d0.js.map +1 -0
  15. package/cjs/TableBlock-a5b16e8f.js +2 -0
  16. package/cjs/TableBlock-a5b16e8f.js.map +1 -0
  17. package/cjs/Tag-5c72cc0d.js +2 -0
  18. package/cjs/Tag-5c72cc0d.js.map +1 -0
  19. package/cjs/VideoBlock-301997a9.js +2 -0
  20. package/cjs/VideoBlock-301997a9.js.map +1 -0
  21. package/cjs/VideoCard-405b518a.js +2 -0
  22. package/cjs/VideoCard-405b518a.js.map +1 -0
  23. package/cjs/Wrapper-91748bdb.js +2 -0
  24. package/cjs/Wrapper-91748bdb.js.map +1 -0
  25. package/cjs/base.js +1 -1
  26. package/cjs/blocks.js +1 -1
  27. package/cjs/escape-1ef8dd83.js +2 -0
  28. package/cjs/escape-1ef8dd83.js.map +1 -0
  29. package/cjs/fields.js +1 -1
  30. package/cjs/fields.js.map +1 -1
  31. package/cjs/footer.js +1 -1
  32. package/cjs/footer.js.map +1 -1
  33. package/cjs/hooks.js +1 -1
  34. package/cjs/hooks.js.map +1 -1
  35. package/cjs/sections.js +1 -1
  36. package/cjs/sections.js.map +1 -1
  37. package/cjs/sections_events.js +2 -0
  38. package/cjs/sections_events.js.map +1 -0
  39. package/cjs/sections_forms.js +2 -0
  40. package/cjs/sections_forms.js.map +1 -0
  41. package/cjs/sections_jobs.js +2 -0
  42. package/cjs/sections_jobs.js.map +1 -0
  43. package/cjs/sections_news.js +1 -1
  44. package/cjs/sections_news.js.map +1 -1
  45. package/cjs/sections_pois.js +2 -0
  46. package/cjs/sections_pois.js.map +1 -0
  47. package/cjs/structuredData-0b1278a9.js +2 -0
  48. package/cjs/structuredData-0b1278a9.js.map +1 -0
  49. package/cjs/urlParams-7525f638.js +2 -0
  50. package/cjs/urlParams-7525f638.js.map +1 -0
  51. package/cjs/useEqualSheetHeight-cfd4176e.js +2 -0
  52. package/cjs/useEqualSheetHeight-cfd4176e.js.map +1 -0
  53. package/cjs/useGeolocation-d8946470.js +2 -0
  54. package/cjs/useGeolocation-d8946470.js.map +1 -0
  55. package/cjs/useLazyInput-f71c221b.js +2 -0
  56. package/cjs/useLazyInput-f71c221b.js.map +1 -0
  57. package/cjs/useLeafletMap-2e608b01.js +2 -0
  58. package/cjs/useLeafletMap-2e608b01.js.map +1 -0
  59. package/cjs/useScrollTo-fdd665da.js +2 -0
  60. package/cjs/useScrollTo-fdd665da.js.map +1 -0
  61. package/esm/{Actions-73e13c48.js → Actions-3f06c2e9.js} +3 -3
  62. package/esm/{Actions-73e13c48.js.map → Actions-3f06c2e9.js.map} +1 -1
  63. package/esm/{Bdot-30b047cc.js → Bdot-fae262fc.js} +3 -3
  64. package/esm/{Bdot-30b047cc.js.map → Bdot-fae262fc.js.map} +1 -1
  65. package/esm/{Button-678be396.js → Button-ab1a4e79.js} +3 -3
  66. package/esm/{Button-678be396.js.map → Button-ab1a4e79.js.map} +1 -1
  67. package/esm/{ButtonGhost-6673a07e.js → ButtonGhost-5b498dba.js} +3 -3
  68. package/esm/{ButtonGhost-6673a07e.js.map → ButtonGhost-5b498dba.js.map} +1 -1
  69. package/esm/{Callout-439308f6.js → Callout-389fed95.js} +4 -4
  70. package/esm/{Callout-439308f6.js.map → Callout-389fed95.js.map} +1 -1
  71. package/esm/{Checkbox-a365d733.js → Checkbox-957d8f33.js} +5 -5
  72. package/esm/{Checkbox-a365d733.js.map → Checkbox-957d8f33.js.map} +1 -1
  73. package/esm/{ClockFilled-8784ddac.js → ClockFilled-6bae80dc.js} +2 -2
  74. package/esm/{ClockFilled-8784ddac.js.map → ClockFilled-6bae80dc.js.map} +1 -1
  75. package/esm/{Control-e61c9395.js → Control-57a287dc.js} +3 -3
  76. package/esm/{Control-e61c9395.js.map → Control-57a287dc.js.map} +1 -1
  77. package/esm/{Copy-3444d005.js → Copy-fb124972.js} +4 -4
  78. package/esm/{Copy-3444d005.js.map → Copy-fb124972.js.map} +1 -1
  79. package/esm/EventBlock-0109da13.js +132 -0
  80. package/esm/EventBlock-0109da13.js.map +1 -0
  81. package/esm/{FilterField-f423b4d1.js → FileUpload-4ba0a672.js} +48 -165
  82. package/esm/FileUpload-4ba0a672.js.map +1 -0
  83. package/esm/Filter-fec6dc5c.js +32 -0
  84. package/esm/Filter-fec6dc5c.js.map +1 -0
  85. package/esm/FilterField-03097694.js +129 -0
  86. package/esm/FilterField-03097694.js.map +1 -0
  87. package/esm/{Wrapper-f4a70e30.js → Grid-151498da.js} +7 -224
  88. package/esm/Grid-151498da.js.map +1 -0
  89. package/esm/{Image-82417953.js → Image-b538f659.js} +5 -5
  90. package/esm/{Image-82417953.js.map → Image-b538f659.js.map} +1 -1
  91. package/esm/InfoList-616d17fd.js +74 -0
  92. package/esm/InfoList-616d17fd.js.map +1 -0
  93. package/esm/{LanguageSwitcher-a53094d3.js → LanguageSwitcher-058e0145.js} +5 -5
  94. package/esm/{LanguageSwitcher-a53094d3.js.map → LanguageSwitcher-058e0145.js.map} +1 -1
  95. package/esm/{LibThemeProvider-90a5375f.js → LibThemeProvider-a38c5bf1.js} +3 -3
  96. package/esm/{LibThemeProvider-90a5375f.js.map → LibThemeProvider-a38c5bf1.js.map} +1 -1
  97. package/esm/{Link-ee8a48ed.js → Link-0a1e35d6.js} +3 -3
  98. package/esm/{Link-ee8a48ed.js.map → Link-0a1e35d6.js.map} +1 -1
  99. package/esm/{Navigation-ece0ff0d.js → Navigation-13dce48c.js} +10 -10
  100. package/esm/{Navigation-ece0ff0d.js.map → Navigation-13dce48c.js.map} +1 -1
  101. package/esm/POICard-392a2c3a.js +116 -0
  102. package/esm/POICard-392a2c3a.js.map +1 -0
  103. package/esm/{Pointer-da4d0977.js → Pointer-bc68154f.js} +3 -3
  104. package/esm/{Pointer-da4d0977.js.map → Pointer-bc68154f.js.map} +1 -1
  105. package/esm/{SocialList-7c00c70e.js → SocialList-4396cad9.js} +5 -5
  106. package/esm/{SocialList-7c00c70e.js.map → SocialList-4396cad9.js.map} +1 -1
  107. package/esm/{TableBlock-0bbde956.js → TableBlock-26530c71.js} +11 -70
  108. package/esm/TableBlock-26530c71.js.map +1 -0
  109. package/esm/Tag-72424779.js +67 -0
  110. package/esm/Tag-72424779.js.map +1 -0
  111. package/esm/{POICard-d8832988.js → VideoBlock-b3f4ae27.js} +39 -332
  112. package/esm/VideoBlock-b3f4ae27.js.map +1 -0
  113. package/esm/{VideoCard-2557407b.js → VideoCard-3fd368ef.js} +8 -35
  114. package/esm/VideoCard-3fd368ef.js.map +1 -0
  115. package/esm/Wrapper-29347885.js +224 -0
  116. package/esm/Wrapper-29347885.js.map +1 -0
  117. package/esm/base.js +4 -3
  118. package/esm/base.js.map +1 -1
  119. package/esm/blocks.js +19 -15
  120. package/esm/blocks.js.map +1 -1
  121. package/esm/buttons.js +6 -6
  122. package/esm/cookies.js +8 -8
  123. package/esm/escape-cbff9c25.js +6 -0
  124. package/esm/escape-cbff9c25.js.map +1 -0
  125. package/esm/fields.js +12 -9
  126. package/esm/fields.js.map +1 -1
  127. package/esm/footer.js +10 -9
  128. package/esm/footer.js.map +1 -1
  129. package/esm/hooks.js +13 -9
  130. package/esm/hooks.js.map +1 -1
  131. package/esm/icons.js +1 -1
  132. package/esm/index.js +3 -3
  133. package/esm/{navigation-49280321.js → navigation-a2998143.js} +2 -2
  134. package/esm/{navigation-49280321.js.map → navigation-a2998143.js.map} +1 -1
  135. package/esm/navigation.js +12 -12
  136. package/esm/sections.js +2595 -5807
  137. package/esm/sections.js.map +1 -1
  138. package/esm/sections_events.js +573 -0
  139. package/esm/sections_events.js.map +1 -0
  140. package/esm/sections_forms.js +1405 -0
  141. package/esm/sections_forms.js.map +1 -0
  142. package/esm/sections_jobs.js +508 -0
  143. package/esm/sections_jobs.js.map +1 -0
  144. package/esm/sections_news.js +102 -97
  145. package/esm/sections_news.js.map +1 -1
  146. package/esm/sections_pois.js +719 -0
  147. package/esm/sections_pois.js.map +1 -0
  148. package/esm/structuredData-87423414.js +117 -0
  149. package/esm/structuredData-87423414.js.map +1 -0
  150. package/esm/{styles-5f78e59d.js → styles-f6c54818.js} +2 -2
  151. package/esm/{styles-5f78e59d.js.map → styles-f6c54818.js.map} +1 -1
  152. package/esm/typography.js +6 -6
  153. package/esm/urlParams-9cfdaf71.js +51 -0
  154. package/esm/urlParams-9cfdaf71.js.map +1 -0
  155. package/esm/{useCookieConsent-db86e5cb.js → useCookieConsent-8caef116.js} +2 -2
  156. package/esm/{useCookieConsent-db86e5cb.js.map → useCookieConsent-8caef116.js.map} +1 -1
  157. package/esm/{urlParams-882563ce.js → useEqualSheetHeight-c18cebd3.js} +4 -105
  158. package/esm/useEqualSheetHeight-c18cebd3.js.map +1 -0
  159. package/esm/useGeolocation-f9f073cc.js +95 -0
  160. package/esm/useGeolocation-f9f073cc.js.map +1 -0
  161. package/esm/useLazyInput-e66fc5be.js +85 -0
  162. package/esm/useLazyInput-e66fc5be.js.map +1 -0
  163. package/esm/{useGeolocation-c81e3efc.js → useLeafletMap-6dea7a8e.js} +4 -175
  164. package/esm/useLeafletMap-6dea7a8e.js.map +1 -0
  165. package/esm/{useMediaQuery-43629cbb.js → useMediaQuery-0d473a9c.js} +2 -2
  166. package/esm/{useMediaQuery-43629cbb.js.map → useMediaQuery-0d473a9c.js.map} +1 -1
  167. package/esm/useScrollTo-70af34bf.js +57 -0
  168. package/esm/useScrollTo-70af34bf.js.map +1 -0
  169. package/package.json +1 -1
  170. package/sections/events/package.json +7 -0
  171. package/sections/forms/package.json +7 -0
  172. package/sections/jobs/package.json +7 -0
  173. package/sections/pois/package.json +7 -0
  174. package/types/sections.d.ts +0 -10
  175. package/types/sections.d.ts.map +1 -1
  176. package/types/sections_events.d.ts +4 -0
  177. package/types/sections_events.d.ts.map +1 -0
  178. package/types/sections_forms.d.ts +3 -0
  179. package/types/sections_forms.d.ts.map +1 -0
  180. package/types/sections_jobs.d.ts +3 -0
  181. package/types/sections_jobs.d.ts.map +1 -0
  182. package/types/sections_news.d.ts +2 -2
  183. package/types/sections_news.d.ts.map +1 -1
  184. package/types/sections_pois.d.ts +4 -0
  185. package/types/sections_pois.d.ts.map +1 -0
  186. package/cjs/FilterField-497e998f.js +0 -2
  187. package/cjs/FilterField-497e998f.js.map +0 -1
  188. package/cjs/POICard-9911980e.js +0 -2
  189. package/cjs/POICard-9911980e.js.map +0 -1
  190. package/cjs/TableBlock-080c9c2e.js +0 -2
  191. package/cjs/TableBlock-080c9c2e.js.map +0 -1
  192. package/cjs/VideoCard-1fa209fc.js +0 -2
  193. package/cjs/VideoCard-1fa209fc.js.map +0 -1
  194. package/cjs/Wrapper-3b9c9e89.js +0 -2
  195. package/cjs/Wrapper-3b9c9e89.js.map +0 -1
  196. package/cjs/urlParams-1d03b5a6.js +0 -2
  197. package/cjs/urlParams-1d03b5a6.js.map +0 -1
  198. package/cjs/useGeolocation-4d38150b.js +0 -2
  199. package/cjs/useGeolocation-4d38150b.js.map +0 -1
  200. package/esm/FilterField-f423b4d1.js.map +0 -1
  201. package/esm/POICard-d8832988.js.map +0 -1
  202. package/esm/TableBlock-0bbde956.js.map +0 -1
  203. package/esm/VideoCard-2557407b.js.map +0 -1
  204. package/esm/Wrapper-f4a70e30.js.map +0 -1
  205. package/esm/urlParams-882563ce.js.map +0 -1
  206. package/esm/useGeolocation-c81e3efc.js.map +0 -1
@@ -0,0 +1,719 @@
1
+ import { a as __makeTemplateObject, _ as __assign, L as LocationPin, s as CurrentLocation, t as MyLocation, C as Cross, f as __awaiter, g as __generator } from './ClockFilled-6bae80dc.js';
2
+ import React__default, { useMemo, useState, useCallback, useEffect } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { S as Section, m as mapToBgMode, W as Wrapper } from './Wrapper-29347885.js';
5
+ import { I as Image } from './Image-b538f659.js';
6
+ import { H as Heading, C as Copy } from './Copy-fb124972.js';
7
+ import { s as spacings, m as mq, w as withRange, g as getColors, e as getSVGDataImg } from './styles-f6c54818.js';
8
+ import { w as withLibTheme, u as useLibTheme } from './LibThemeProvider-a38c5bf1.js';
9
+ import { G as Grid } from './Grid-151498da.js';
10
+ import { I as InfoList } from './InfoList-616d17fd.js';
11
+ import { P as POIFacts, a as POICard } from './POICard-392a2c3a.js';
12
+ import { i as isValidArray } from './arrays-65b644ef.js';
13
+ import { F as FilterField } from './FilterField-03097694.js';
14
+ import { u as useUpdateEffect } from './useUpdateEffect-824c0c84.js';
15
+ import { e as escapeRegExp } from './escape-cbff9c25.js';
16
+ import { u as useMounted } from './useMounted-1e4cc87b.js';
17
+ import { g as getUrlParams, s as setUrlParam, d as deleteUrlParam } from './urlParams-9cfdaf71.js';
18
+ import { u as useLeafletMap } from './useLeafletMap-6dea7a8e.js';
19
+ import { g as generateNavbarIdent, a as getFullNavbarHeights } from './Navigation-13dce48c.js';
20
+ import { u as useGeolocation } from './useGeolocation-f9f073cc.js';
21
+ import './concat-ab3c66f2.js';
22
+ import './clamp-12d37b65.js';
23
+ import 'react-dom/server';
24
+ import './useLazyInput-e66fc5be.js';
25
+ import './useMediaQuery-0d473a9c.js';
26
+ import './navigation-a2998143.js';
27
+ import './Link-0a1e35d6.js';
28
+ import './LanguageSwitcher-058e0145.js';
29
+
30
+ var StyledImage = styled(Image).withConfig({
31
+ displayName: "PointOfInterestDetail__StyledImage",
32
+ componentId: "sc-hksryh-0"
33
+ })(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n &:not(:last-child) {\n margin-bottom: ", "px;\n }\n"], ["\n &:not(:last-child) {\n margin-bottom: ", "px;\n }\n"])), spacings.spacer);
34
+ var Facts = styled(POIFacts).withConfig({
35
+ displayName: "PointOfInterestDetail__Facts",
36
+ componentId: "sc-hksryh-1"
37
+ })(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n max-width: 880px;\n"], ["\n max-width: 880px;\n"])));
38
+ var PoiTitle = styled(Heading).withConfig({
39
+ displayName: "PointOfInterestDetail__PoiTitle",
40
+ componentId: "sc-hksryh-2"
41
+ })(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n max-width: 880px;\n\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2; /* number of lines to show */\n line-clamp: 2;\n -webkit-box-orient: vertical;\n\n &:not(:first-child) {\n margin-top: ", "px;\n }\n"], ["\n max-width: 880px;\n\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2; /* number of lines to show */\n line-clamp: 2;\n -webkit-box-orient: vertical;\n\n &:not(:first-child) {\n margin-top: ", "px;\n }\n"])), spacings.nudge * 3);
42
+ var PoiText = styled(Copy).withConfig({
43
+ displayName: "PointOfInterestDetail__PoiText",
44
+ componentId: "sc-hksryh-3"
45
+ })(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject(["\n max-width: 880px;\n\n &:not(:first-child) {\n margin-top: ", "px;\n }\n"], ["\n max-width: 880px;\n\n &:not(:first-child) {\n margin-top: ", "px;\n }\n"])), spacings.nudge * 3);
46
+
47
+ var PointOfInterestDetail = function (_a) {
48
+ var anchorId = _a.anchorId,
49
+ image = _a.image,
50
+ title = _a.title,
51
+ intro = _a.intro,
52
+ text = _a.text,
53
+ facts = _a.facts,
54
+ infos = _a.infos,
55
+ bgMode = _a.bgMode,
56
+ customFact = _a.customFact;
57
+ var colors = useLibTheme().colors;
58
+ var isInverted = bgMode === 'inverted';
59
+ var hasBg = bgMode === 'full';
60
+ var hasInfos = useMemo(function () {
61
+ return isValidArray(infos === null || infos === void 0 ? void 0 : infos.filter(function (info) {
62
+ return isValidArray(info.items, false);
63
+ }), false);
64
+ }, [infos]);
65
+ return React__default.createElement(Section, {
66
+ addSeperation: true,
67
+ anchorId: anchorId,
68
+ bgColor: isInverted ? colors.sectionBg.dark : hasBg ? colors.sectionBg.medium : colors.sectionBg.light,
69
+ bgMode: mapToBgMode(bgMode, true)
70
+ }, React__default.createElement(Wrapper, {
71
+ addWhitespace: true
72
+ }, (image === null || image === void 0 ? void 0 : image.small) && React__default.createElement(StyledImage, __assign({}, image, {
73
+ coverSpace: true,
74
+ allowEdgeRadius: true,
75
+ isInverted: isInverted
76
+ })), React__default.createElement(Grid.Row, {
77
+ gutter: spacings.nudge * 5,
78
+ semilarge: {
79
+ gutter: spacings.spacer
80
+ }
81
+ }, React__default.createElement(Grid.Col, {
82
+ semilarge: {
83
+ span: hasInfos ? 5.7 / 8 : 1
84
+ }
85
+ }, title && React__default.createElement(PoiTitle, {
86
+ size: "heading-2",
87
+ isInverted: isInverted
88
+ }, title), isValidArray(facts, false) && React__default.createElement(Facts, {
89
+ isInverted: isInverted,
90
+ facts: facts,
91
+ customFact: customFact
92
+ }), intro && React__default.createElement(PoiText, {
93
+ size: "medium",
94
+ type: "copy-b",
95
+ isInverted: isInverted,
96
+ innerHTML: intro
97
+ }), text && React__default.createElement(PoiText, {
98
+ size: "medium",
99
+ isInverted: isInverted,
100
+ innerHTML: text
101
+ })), hasInfos && React__default.createElement(Grid.Col, {
102
+ semilarge: {
103
+ span: 2.3 / 8
104
+ }
105
+ }, React__default.createElement(InfoList, {
106
+ isInverted: isInverted,
107
+ items: infos
108
+ })))));
109
+ };
110
+ var PointOfInterestDetail$1 = withLibTheme(PointOfInterestDetail);
111
+ var templateObject_1$2, templateObject_2$2, templateObject_3$1, templateObject_4$1;
112
+
113
+ var Content = styled.div.withConfig({
114
+ displayName: "PointOfInterestOverview__Content",
115
+ componentId: "sc-epctuk-0"
116
+ })(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n & > * + * {\n margin-top: ", "px;\n }\n\n @media ", " {\n & > * + * {\n margin-top: ", "px;\n }\n }\n"], ["\n & > * + * {\n margin-top: ", "px;\n }\n\n @media ", " {\n & > * + * {\n margin-top: ", "px;\n }\n }\n"])), spacings.nudge * 5, mq.large, spacings.nudge * 3);
117
+ var Filter = styled(FilterField).withConfig({
118
+ displayName: "PointOfInterestOverview__Filter",
119
+ componentId: "sc-epctuk-1"
120
+ })(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n // margin to show prevent section overflow outline\n margin-top: 2px;\n\n &:not(:last-child) {\n margin-bottom: ", "px;\n }\n"], ["\n // margin to show prevent section overflow outline\n margin-top: 2px;\n\n &:not(:last-child) {\n margin-bottom: ", "px;\n }\n"])), spacings.nudge * 5);
121
+
122
+ var poiExactNameFilter = function (filterQuery) {
123
+ return function (value) {
124
+ var regex = new RegExp(filterQuery);
125
+ return regex.test(value.name);
126
+ };
127
+ };
128
+
129
+ var poiSoftNameFilter = function (filterQuery) {
130
+ return function (value) {
131
+ var preparedQuery = filterQuery.toLowerCase().replace(/\s/g, '');
132
+ var preparedName = value.name.toLowerCase().replace(/\s/g, '');
133
+ var regex = new RegExp(preparedQuery);
134
+ return regex.test(preparedName);
135
+ };
136
+ };
137
+
138
+ var poiFactFilter = function (filterQuery) {
139
+ return function (value) {
140
+ if (!isValidArray(value.facts, false)) return false;
141
+ var preparedQuery = filterQuery.toLowerCase().replace(/\s/g, '');
142
+ var regex = new RegExp(preparedQuery);
143
+ var result = value.facts.find(function (fact) {
144
+ var preparedFact = fact.toLowerCase().replace(/\s/g, '');
145
+ return regex.test(preparedFact);
146
+ });
147
+ return !!result;
148
+ };
149
+ };
150
+
151
+ var poiInfoFilter = function (filterQuery) {
152
+ return function (value) {
153
+ if (!isValidArray(value === null || value === void 0 ? void 0 : value.infos, false)) return false;
154
+ var preparedQuery = filterQuery.toLowerCase().replace(/\s/g, '');
155
+ var regex = new RegExp(preparedQuery);
156
+ return !!value.infos.find(function (info) {
157
+ if (!info.text) return false;
158
+ var preparedText = info.text.toLowerCase().replace(/\s/g, '');
159
+ return regex.test(preparedText);
160
+ });
161
+ };
162
+ };
163
+
164
+ var poiDescriptionFilter = function (filterQuery) {
165
+ return function (value) {
166
+ if (!value.shortDescription) return false;
167
+ var preparedQuery = filterQuery.toLowerCase().replace(/\s/g, '');
168
+ var preparedDesc = value.shortDescription.toLowerCase().replace(/\s/g, '');
169
+ var regex = new RegExp(preparedQuery);
170
+ return regex.test(preparedDesc);
171
+ };
172
+ };
173
+
174
+ var removeMatchIntersections = function (array, item) {
175
+ if (!item) return [];
176
+ return item === null || item === void 0 ? void 0 : item.filter(function (m) {
177
+ return !array.find(function (prioItem) {
178
+ return prioItem.item.id === m.id;
179
+ });
180
+ });
181
+ };
182
+
183
+ var filterPois = function (filterQuery, pois) {
184
+ var prioList = [];
185
+
186
+ if (!isValidArray(pois === null || pois === void 0 ? void 0 : pois.filter(function (poi) {
187
+ return poi.id !== undefined;
188
+ }), false)) {
189
+ return prioList;
190
+ } // PRIO 1 Filter: Exact name
191
+
192
+
193
+ var exactNameMatches = pois === null || pois === void 0 ? void 0 : pois.filter(poiExactNameFilter(filterQuery));
194
+
195
+ if (isValidArray(exactNameMatches, false)) {
196
+ prioList.push.apply(prioList, exactNameMatches.map(function (match) {
197
+ return {
198
+ item: match,
199
+ priority: 1
200
+ };
201
+ }));
202
+ } // PRIO 2 Filter: Name
203
+
204
+
205
+ var nameMatches = removeMatchIntersections(prioList, pois === null || pois === void 0 ? void 0 : pois.filter(poiSoftNameFilter(filterQuery)));
206
+
207
+ if (isValidArray(nameMatches, false)) {
208
+ prioList.push.apply(prioList, nameMatches.map(function (match) {
209
+ return {
210
+ item: match,
211
+ priority: 2
212
+ };
213
+ }));
214
+ } // PRIO 3 Filter: Facts
215
+
216
+
217
+ var factMatches = removeMatchIntersections(prioList, pois === null || pois === void 0 ? void 0 : pois.filter(poiFactFilter(filterQuery)));
218
+
219
+ if (isValidArray(factMatches, false)) {
220
+ prioList.push.apply(prioList, factMatches.map(function (match) {
221
+ return {
222
+ item: match,
223
+ priority: 3
224
+ };
225
+ }));
226
+ } // PRIO 4 Filter: Description
227
+
228
+
229
+ var infoMatches = removeMatchIntersections(prioList, pois === null || pois === void 0 ? void 0 : pois.filter(poiInfoFilter(filterQuery)));
230
+
231
+ if (isValidArray(infoMatches, false)) {
232
+ prioList.push.apply(prioList, infoMatches.map(function (match) {
233
+ return {
234
+ item: match,
235
+ priority: 4
236
+ };
237
+ }));
238
+ } // PRIO 5 Filter: Description
239
+
240
+
241
+ var descMatches = removeMatchIntersections(prioList, pois === null || pois === void 0 ? void 0 : pois.filter(poiDescriptionFilter(filterQuery)));
242
+
243
+ if (isValidArray(descMatches, false)) {
244
+ prioList.push.apply(prioList, descMatches.map(function (match) {
245
+ return {
246
+ item: match,
247
+ priority: 5
248
+ };
249
+ }));
250
+ }
251
+
252
+ return prioList;
253
+ };
254
+
255
+ var PointOfInterestOverview = function (_a) {
256
+ var _b;
257
+
258
+ var anchorId = _a.anchorId,
259
+ bgMode = _a.bgMode,
260
+ pois = _a.pois,
261
+ enableFiltering = _a.enableFiltering,
262
+ initialFilterQuery = _a.initialFilterQuery,
263
+ _c = _a.filterPlaceholder,
264
+ filterPlaceholder = _c === void 0 ? 'Filter' : _c,
265
+ filterSubmitIcon = _a.filterSubmitIcon,
266
+ filterClearIcon = _a.filterClearIcon;
267
+
268
+ var _d = useLibTheme(),
269
+ colors = _d.colors,
270
+ globals = _d.globals;
271
+
272
+ var filterName = globals.sections.poiFilterName;
273
+ var isInverted = bgMode === 'inverted';
274
+ var hasBg = bgMode === 'full';
275
+
276
+ var _e = useState(initialFilterQuery || ''),
277
+ filterQuery = _e[0],
278
+ setFilterQuery = _e[1];
279
+
280
+ var isMounted = useMounted();
281
+ var poiMatches = React__default.useMemo(function () {
282
+ var queryParts = filterQuery.split(' ').map(function (part) {
283
+ return part.trim();
284
+ });
285
+ var searchMatches = []; // tracking matches of each query part
286
+
287
+ for (var _i = 0, queryParts_1 = queryParts; _i < queryParts_1.length; _i++) {
288
+ var part = queryParts_1[_i];
289
+ var matches = filterPois(escapeRegExp(part), pois || []);
290
+
291
+ var _loop_1 = function (match) {
292
+ var intersectionIndex = searchMatches.findIndex(function (sItem) {
293
+ return sItem.match.item.id === match.item.id;
294
+ });
295
+
296
+ if (intersectionIndex !== -1) {
297
+ searchMatches[intersectionIndex].intersections += 1;
298
+ } else {
299
+ searchMatches.push({
300
+ match: match,
301
+ intersections: 1
302
+ });
303
+ }
304
+ };
305
+
306
+ for (var _a = 0, matches_1 = matches; _a < matches_1.length; _a++) {
307
+ var match = matches_1[_a];
308
+
309
+ _loop_1(match);
310
+ }
311
+ } // filter search matches by intersections so only matches with results for all search parts are shown
312
+
313
+
314
+ return searchMatches.filter(function (m) {
315
+ return m.intersections >= queryParts.length;
316
+ }).map(function (m) {
317
+ return __assign({}, m.match);
318
+ });
319
+ }, [filterQuery, pois]);
320
+ var getFilter = useCallback(function () {
321
+ return getUrlParams()[filterName];
322
+ }, [filterName]);
323
+ useEffect(function () {
324
+ var urlFilter = getFilter();
325
+
326
+ if (urlFilter !== undefined && urlFilter !== null && typeof urlFilter === 'string') {
327
+ setFilterQuery(urlFilter);
328
+ }
329
+ }, [getFilter]);
330
+ useEffect(function () {
331
+ if (isMounted) return; // set inital data into URL
332
+
333
+ if (filterQuery) {
334
+ setUrlParam(filterName, filterQuery);
335
+ } else {
336
+ deleteUrlParam(filterName);
337
+ }
338
+ }, [filterName, filterQuery, isMounted]);
339
+ useUpdateEffect(function () {
340
+ // set filters to URL params
341
+ if (filterQuery) {
342
+ setUrlParam(filterName, filterQuery);
343
+ } else {
344
+ deleteUrlParam(filterName);
345
+ }
346
+ }, [filterQuery]);
347
+ return React__default.createElement(Section, {
348
+ addSeperation: true,
349
+ anchorId: anchorId,
350
+ bgColor: isInverted ? colors.sectionBg.dark : hasBg ? colors.sectionBg.medium : colors.sectionBg.light,
351
+ bgMode: mapToBgMode(bgMode, true)
352
+ }, React__default.createElement(Wrapper, {
353
+ addWhitespace: true
354
+ }, enableFiltering && React__default.createElement(Filter, {
355
+ value: filterQuery,
356
+ initialValue: initialFilterQuery,
357
+ placeholder: filterPlaceholder,
358
+ onSubmit: setFilterQuery,
359
+ submitIcon: filterSubmitIcon,
360
+ clearIcon: filterClearIcon,
361
+ isInverted: isInverted
362
+ }), React__default.createElement(Content, null, (_b = poiMatches === null || poiMatches === void 0 ? void 0 : poiMatches.sort(function (a, b) {
363
+ return a.priority - b.priority;
364
+ })) === null || _b === void 0 ? void 0 : _b.map(function (poi, i) {
365
+ return React__default.createElement(POICard, __assign({
366
+ key: i
367
+ }, poi.item, {
368
+ isInverted: isInverted
369
+ }));
370
+ }))));
371
+ };
372
+ var PointOfInterestOverview$1 = withLibTheme(PointOfInterestOverview);
373
+ var templateObject_1$1, templateObject_2$1;
374
+
375
+ var genHeightStyles = function () {
376
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Doing some crazy shit to calculate curent navbar height in CSS\n ", "\n"], ["\n // Doing some crazy shit to calculate curent navbar height in CSS\n ", "\n"])), function (_a) {
377
+ var theme = _a.theme; // navbar main only
378
+
379
+ var mainIdent = generateNavbarIdent({
380
+ pageFlow: 'beforeContent',
381
+ hasMain: true
382
+ }); // navbar main and top
383
+
384
+ var mainTopIdent = generateNavbarIdent({
385
+ pageFlow: 'beforeContent',
386
+ hasMain: true,
387
+ hasTop: true
388
+ }); // navbar main and bottom
389
+
390
+ var mainBottomIdent = generateNavbarIdent({
391
+ pageFlow: 'beforeContent',
392
+ hasMain: true,
393
+ hasBottom: true
394
+ }); // full navbar with all bars
395
+
396
+ var fullIdent = generateNavbarIdent({
397
+ pageFlow: 'beforeContent',
398
+ hasTop: true,
399
+ hasMain: true,
400
+ hasBottom: true
401
+ });
402
+ var navMainHeight = getFullNavbarHeights(theme, mainIdent).large;
403
+ var navMainTopHeight = getFullNavbarHeights(theme, mainTopIdent).large;
404
+ var navMainBottomHeight = getFullNavbarHeights(theme, mainBottomIdent).large;
405
+ var navFullHeight = getFullNavbarHeights(theme, fullIdent).large;
406
+
407
+ var mapToSelector = function (idents) {
408
+ return idents.map(function (id) {
409
+ return "[data-navbar-ident*='".concat(id, "']");
410
+ }).join('');
411
+ };
412
+
413
+ var refHeight = '100vh';
414
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", " {\n height: ", ";\n }\n\n // with main navbar element\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with main and top navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with main and bottom navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with all navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n @media ", " {\n // with main navbar element\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with main and top navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with main and bottom navbar elements\n header", " ~ & {\n ", " {\n height: calc(\n ", " - ", "px\n );\n }\n }\n\n // with all navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n }\n "], ["\n ", " {\n height: ", ";\n }\n\n // with main navbar element\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with main and top navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with main and bottom navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with all navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n @media ", " {\n // with main navbar element\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with main and top navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n\n // with main and bottom navbar elements\n header", " ~ & {\n ", " {\n height: calc(\n ", " - ", "px\n );\n }\n }\n\n // with all navbar elements\n header", " ~ & {\n ", " {\n height: calc(", " - ", "px);\n }\n }\n }\n "])), Map, refHeight, mapToSelector(mainIdent.split('-')), Map, refHeight, navMainHeight[0], mapToSelector(mainTopIdent.split('-')), Map, refHeight, navMainTopHeight[0], mapToSelector(mainBottomIdent.split('-')), Map, refHeight, navMainBottomHeight[0], mapToSelector(fullIdent.split('-')), Map, refHeight, navFullHeight[0], mq.semilarge, mapToSelector(mainIdent.split('-')), Map, refHeight, navMainHeight[1], mapToSelector(mainTopIdent.split('-')), Map, refHeight, navMainTopHeight[1], mapToSelector(mainBottomIdent.split('-')), Map, refHeight, navMainBottomHeight[1], mapToSelector(fullIdent.split('-')), Map, refHeight, navFullHeight[1]);
415
+ });
416
+ };
417
+
418
+ var PoiMapSection = styled(Section).withConfig({
419
+ displayName: "PointOfInterestMap__PoiMapSection",
420
+ componentId: "sc-1ke8oz0-0"
421
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n ", "\n\n header + & {\n ", "\n ", "\n }\n"], ["\n position: relative;\n ", "\n\n header + & {\n ", "\n ", "\n }\n"])), function (_a) {
422
+ var isLarge = _a.isLarge;
423
+ return isLarge && genHeightStyles();
424
+ }, withRange([0], 'padding-top'), withRange([0], 'margin-top'));
425
+ var MapContainer = styled.div.withConfig({
426
+ displayName: "PointOfInterestMap__MapContainer",
427
+ componentId: "sc-1ke8oz0-1"
428
+ })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
429
+ var Map = styled.div.withConfig({
430
+ displayName: "PointOfInterestMap__Map",
431
+ componentId: "sc-1ke8oz0-2"
432
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n min-height: 360px;\n height: 360px;\n max-height: 1300px;\n z-index: 0;\n\n @media ", " {\n height: 600px;\n min-height: 600px;\n }\n"], ["\n min-height: 360px;\n height: 360px;\n max-height: 1300px;\n z-index: 0;\n\n @media ", " {\n height: 600px;\n min-height: 600px;\n }\n"])), mq.medium);
433
+ var RequestGeolocationBtn = styled.button.withConfig({
434
+ displayName: "PointOfInterestMap__RequestGeolocationBtn",
435
+ componentId: "sc-1ke8oz0-3"
436
+ })(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n top: ", "px;\n left: ", "px;\n\n background-color: transparent;\n border: none;\n padding: ", "px;\n cursor: pointer;\n\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n opacity: 0.6;\n }\n }\n\n &:focus {\n outline: 2px solid ", ";\n transform: scale(1.012);\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &:active {\n transform: scale(0.95);\n }\n\n & > * {\n width: 30px;\n height: 30px;\n }\n"], ["\n position: absolute;\n top: ", "px;\n left: ", "px;\n\n background-color: transparent;\n border: none;\n padding: ", "px;\n cursor: pointer;\n\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n opacity: 0.6;\n }\n }\n\n &:focus {\n outline: 2px solid ", ";\n transform: scale(1.012);\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &:active {\n transform: scale(0.95);\n }\n\n & > * {\n width: 30px;\n height: 30px;\n }\n"])), spacings.nudge * 2, spacings.nudge * 2, spacings.nudge, function (_a) {
437
+ var theme = _a.theme;
438
+ return getColors(theme).primary.default;
439
+ });
440
+ var CardStage = styled.div.withConfig({
441
+ displayName: "PointOfInterestMap__CardStage",
442
+ componentId: "sc-1ke8oz0-4"
443
+ })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 10;\n\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n\n pointer-events: all;\n background-color: rgba(255, 255, 255, 0.8);\n\n @media ", " {\n position: absolute;\n background-color: transparent;\n padding: ", "px;\n padding-bottom: ", "px;\n\n pointer-events: none;\n }\n"], ["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 10;\n\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n\n pointer-events: all;\n background-color: rgba(255, 255, 255, 0.8);\n\n @media ", " {\n position: absolute;\n background-color: transparent;\n padding: ", "px;\n padding-bottom: ", "px;\n\n pointer-events: none;\n }\n"])), mq.medium, spacings.nudge * 2, spacings.nudge * 3);
444
+ var MapCardView = styled.div.withConfig({
445
+ displayName: "PointOfInterestMap__MapCardView",
446
+ componentId: "sc-1ke8oz0-5"
447
+ })(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n max-height: 100%;\n width: 100%;\n padding: ", "px;\n overflow: auto;\n\n background: ", ";\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);\n pointer-events: all;\n border-radius: 8px;\n\n & > * + * {\n margin-top: ", "px;\n }\n\n @media ", " {\n max-width: 400px;\n }\n"], ["\n max-height: 100%;\n width: 100%;\n padding: ", "px;\n overflow: auto;\n\n background: ", ";\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);\n pointer-events: all;\n border-radius: 8px;\n\n & > * + * {\n margin-top: ", "px;\n }\n\n @media ", " {\n max-width: 400px;\n }\n"])), spacings.nudge * 2, function (_a) {
448
+ var theme = _a.theme;
449
+ return getColors(theme).elementBg.light;
450
+ }, spacings.nudge * 3, mq.medium);
451
+ var MapCardHeader = styled.header.withConfig({
452
+ displayName: "PointOfInterestMap__MapCardHeader",
453
+ componentId: "sc-1ke8oz0-6"
454
+ })(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
455
+ var CloseBtn = styled.button.withConfig({
456
+ displayName: "PointOfInterestMap__CloseBtn",
457
+ componentId: "sc-1ke8oz0-7"
458
+ })(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: inline-block;\n border: none;\n background-color: transparent;\n cursor: pointer;\n margin-left: auto;\n padding: ", "px;\n\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n opacity: 0.6;\n }\n }\n\n &:focus {\n outline: 2px solid ", ";\n transform: scale(1.012);\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &:active {\n transform: scale(0.95);\n }\n"], ["\n display: inline-block;\n border: none;\n background-color: transparent;\n cursor: pointer;\n margin-left: auto;\n padding: ", "px;\n\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n opacity: 0.6;\n }\n }\n\n &:focus {\n outline: 2px solid ", ";\n transform: scale(1.012);\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &:active {\n transform: scale(0.95);\n }\n"])), spacings.nudge, function (_a) {
459
+ var theme = _a.theme;
460
+ return getColors(theme).primary.default;
461
+ });
462
+
463
+ var MapCard = function (_a) {
464
+ var name = _a.name,
465
+ facts = _a.facts,
466
+ description = _a.description,
467
+ infos = _a.infos,
468
+ action = _a.action,
469
+ customFact = _a.customFact,
470
+ customClose = _a.customClose,
471
+ onClose = _a.onClose,
472
+ className = _a.className;
473
+ var colors = useLibTheme().colors;
474
+ return React__default.createElement(MapCardView, {
475
+ className: className
476
+ }, React__default.createElement(MapCardHeader, null, name && React__default.createElement(Copy, {
477
+ type: "copy-b",
478
+ size: "big"
479
+ }, name), React__default.createElement(CloseBtn, {
480
+ onClick: onClose
481
+ }, customClose || React__default.createElement(Cross, {
482
+ iconColor: colors.text.default
483
+ }))), isValidArray(facts, false) && React__default.createElement(POIFacts, {
484
+ facts: facts,
485
+ customFact: customFact
486
+ }), description && React__default.createElement(Copy, {
487
+ type: "copy",
488
+ size: "small",
489
+ innerHTML: description
490
+ }), isValidArray(infos, false) && React__default.createElement(InfoList, {
491
+ items: [{
492
+ items: infos
493
+ }]
494
+ }), action && action);
495
+ };
496
+
497
+ var PointOfInterestMap = function (_a) {
498
+ var anchorId = _a.anchorId,
499
+ size = _a.size,
500
+ pois = _a.pois,
501
+ _b = _a.initialPointOfInterest,
502
+ initialPointOfInterest = _b === void 0 ? '' : _b,
503
+ provider = _a.provider,
504
+ attribution = _a.attribution,
505
+ _c = _a.center,
506
+ center = _c === void 0 ? [51.505, -0.09] : _c,
507
+ _d = _a.zoom,
508
+ zoom = _d === void 0 ? 5 : _d,
509
+ fitBoundsPadding = _a.fitBoundsPadding,
510
+ _e = _a.allMarkersOnInit,
511
+ allMarkersOnInit = _e === void 0 ? false : _e,
512
+ _f = _a.restrictToMarkersArea,
513
+ restrictToMarkersArea = _f === void 0 ? true : _f,
514
+ showOwnPosition = _a.showOwnPosition,
515
+ flyToZoom = _a.flyToZoom,
516
+ customFact = _a.customFact,
517
+ currentPosMarker = _a.currentPosMarker,
518
+ customCardClose = _a.customCardClose,
519
+ customLocationRequest = _a.customLocationRequest;
520
+ var isLarge = size === 'large';
521
+ var colors = useLibTheme().colors;
522
+
523
+ var _g = useState(initialPointOfInterest || ''),
524
+ activePoiId = _g[0],
525
+ setActivePoiId = _g[1];
526
+
527
+ var _h = useState(false),
528
+ isDirty = _h[0],
529
+ setIsDirty = _h[1];
530
+
531
+ var activePOI = useMemo(function () {
532
+ return pois === null || pois === void 0 ? void 0 : pois.find(function (poi) {
533
+ return poi.id === activePoiId;
534
+ });
535
+ }, [activePoiId, pois]);
536
+
537
+ var _j = useGeolocation(true, false),
538
+ isGeolocationSupported = _j.isSupported,
539
+ location = _j.location,
540
+ resetGeolocation = _j.reset;
541
+
542
+ var mapMarkers = useMemo(function () {
543
+ var _a;
544
+
545
+ var defaultMarker = {
546
+ size: [28, 28],
547
+ anchor: [14, 28],
548
+ sizeActive: [70, 70],
549
+ anchorActive: [35, 70],
550
+ url: getSVGDataImg(React__default.createElement(LocationPin, null))
551
+ }; // marker of own position
552
+
553
+ var defaultPosMarker = {
554
+ size: [24, 24],
555
+ anchor: [12, 12],
556
+ sizeActive: [24, 24],
557
+ anchorActive: [12, 12],
558
+ url: getSVGDataImg(React__default.createElement(CurrentLocation, {
559
+ iconColor: "#5383EC"
560
+ }))
561
+ };
562
+ var markers = ((_a = pois === null || pois === void 0 ? void 0 : pois.filter(function (poi) {
563
+ return poi.id !== undefined;
564
+ })) === null || _a === void 0 ? void 0 : _a.map(function (_a) {
565
+ var id = _a.id,
566
+ position = _a.position,
567
+ icon = _a.icon;
568
+ return {
569
+ id: id,
570
+ position: position,
571
+ icon: icon || defaultMarker,
572
+ isInteractive: true
573
+ };
574
+ })) || [];
575
+
576
+ if (isGeolocationSupported && (location === null || location === void 0 ? void 0 : location.coords.latitude) && (location === null || location === void 0 ? void 0 : location.coords.longitude)) {
577
+ markers.push({
578
+ id: 'my-current-position-123456789',
579
+ position: [location.coords.latitude, location.coords.longitude],
580
+ icon: currentPosMarker || defaultPosMarker
581
+ });
582
+ }
583
+
584
+ return markers;
585
+ }, [currentPosMarker, isGeolocationSupported, location === null || location === void 0 ? void 0 : location.coords.latitude, location === null || location === void 0 ? void 0 : location.coords.longitude, pois]);
586
+
587
+ var _k = useLeafletMap({
588
+ url: provider,
589
+ attribution: attribution,
590
+ center: center,
591
+ zoom: zoom,
592
+ activeMarkerId: activePoiId,
593
+ markers: mapMarkers,
594
+ fitBoundsPadding: fitBoundsPadding,
595
+ restrictToMarkersArea: restrictToMarkersArea,
596
+ showZoomControls: true,
597
+ zoomControlPosition: 'bottomleft',
598
+ onMarkerClick: function (markerId) {
599
+ setActivePoiId(function (prev) {
600
+ if (prev === markerId) {
601
+ return '';
602
+ }
603
+
604
+ return markerId;
605
+ });
606
+ }
607
+ }),
608
+ isLoaded = _k.isLoaded,
609
+ setMapContainer = _k.setContainer,
610
+ flyToActive = _k.flyToActive,
611
+ showAllMarkers = _k.showAllMarkers,
612
+ flyToPosition = _k.flyToPosition,
613
+ getCurrentZoom = _k.getCurrentZoom;
614
+
615
+ useEffect(function () {
616
+ if (isLoaded && !isDirty) {
617
+ if (allMarkersOnInit) showAllMarkers();
618
+ } else {
619
+ var currentZoom = getCurrentZoom();
620
+ var zoom_1 = flyToZoom;
621
+
622
+ if (flyToZoom !== undefined && currentZoom > flyToZoom) {
623
+ zoom_1 = currentZoom;
624
+ }
625
+
626
+ flyToActive(zoom_1);
627
+ }
628
+ }, [activePoiId, allMarkersOnInit, flyToActive, flyToZoom, getCurrentZoom, initialPointOfInterest, isDirty, isLoaded, showAllMarkers]);
629
+ useEffect(function () {
630
+ if (!isDirty && activePoiId !== initialPointOfInterest) {
631
+ setIsDirty(true);
632
+ }
633
+ }, [activePoiId, initialPointOfInterest, isDirty]);
634
+
635
+ var handleLocationRequest = function () {
636
+ return __awaiter(void 0, void 0, void 0, function () {
637
+ var currentZoom, zoom_2, position;
638
+
639
+ var _a, _b;
640
+
641
+ return __generator(this, function (_c) {
642
+ switch (_c.label) {
643
+ case 0:
644
+ if (!(((_a = location === null || location === void 0 ? void 0 : location.coords) === null || _a === void 0 ? void 0 : _a.latitude) && ((_b = location === null || location === void 0 ? void 0 : location.coords) === null || _b === void 0 ? void 0 : _b.longitude))) return [3
645
+ /*break*/
646
+ , 1];
647
+ currentZoom = getCurrentZoom();
648
+ zoom_2 = flyToZoom;
649
+
650
+ if (flyToZoom !== undefined && currentZoom > flyToZoom) {
651
+ zoom_2 = currentZoom;
652
+ }
653
+
654
+ flyToPosition([location.coords.latitude, location.coords.longitude], zoom_2);
655
+ return [3
656
+ /*break*/
657
+ , 4];
658
+
659
+ case 1:
660
+ _c.trys.push([1, 3,, 4]);
661
+
662
+ return [4
663
+ /*yield*/
664
+ , resetGeolocation()];
665
+
666
+ case 2:
667
+ position = _c.sent();
668
+ if (position) showAllMarkers();
669
+ return [3
670
+ /*break*/
671
+ , 4];
672
+
673
+ case 3:
674
+ _c.sent();
675
+ return [3
676
+ /*break*/
677
+ , 4];
678
+
679
+ case 4:
680
+ return [2
681
+ /*return*/
682
+ ];
683
+ }
684
+ });
685
+ });
686
+ };
687
+
688
+ return React__default.createElement(PoiMapSection, {
689
+ anchorId: anchorId,
690
+ bgColor: "image",
691
+ bgMode: "full",
692
+ isLarge: isLarge
693
+ }, React__default.createElement(Wrapper, {
694
+ clampWidth: isLarge ? 'large' : 'normal'
695
+ }, React__default.createElement(MapContainer, null, React__default.createElement(Map, {
696
+ ref: setMapContainer,
697
+ isLarge: size === 'large'
698
+ }), showOwnPosition && React__default.createElement(RequestGeolocationBtn, {
699
+ onClick: handleLocationRequest
700
+ }, customLocationRequest || React__default.createElement(MyLocation, {
701
+ iconColor: colors.text.default
702
+ })), activePOI && activePOI.name && React__default.createElement(CardStage, {
703
+ onClick: function (ev) {
704
+ if (ev.target !== ev.currentTarget) return;
705
+ setActivePoiId('');
706
+ }
707
+ }, React__default.createElement(MapCard, __assign({}, activePOI, {
708
+ onClose: function () {
709
+ return setActivePoiId('');
710
+ },
711
+ customFact: customFact,
712
+ customClose: customCardClose
713
+ }))))));
714
+ };
715
+ var PointOfInterestMap$1 = withLibTheme(PointOfInterestMap);
716
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
717
+
718
+ export { PointOfInterestDetail$1 as PointOfInterestDetail, PointOfInterestMap$1 as PointOfInterestMap, PointOfInterestOverview$1 as PointOfInterestOverview };
719
+ //# sourceMappingURL=sections_pois.js.map