@geotrekce/geotrek-rando-widget 0.0.2 → 0.0.5

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 (98) hide show
  1. package/dist/cjs/geotrek-rando-widget.cjs.js +2 -2
  2. package/dist/cjs/grw-app.cjs.entry.js +93 -0
  3. package/dist/cjs/{grw-app_7.cjs.entry.js → grw-filter_6.cjs.entry.js} +424 -384
  4. package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +52 -0
  5. package/dist/cjs/grw-trek-card.cjs.entry.js +47 -0
  6. package/dist/cjs/{index-c6f73e30.js → index-c2c4531d.js} +46 -1
  7. package/dist/cjs/length-d315d156.js +34 -0
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/store-972b8d2a.js +209 -0
  10. package/dist/collection/collection-manifest.json +4 -0
  11. package/dist/collection/components/grw-app/grw-app.css +70 -5
  12. package/dist/collection/components/grw-app/grw-app.js +139 -33
  13. package/dist/collection/components/grw-filter/grw-filter.css +29 -0
  14. package/dist/collection/components/grw-filter/grw-filter.js +132 -0
  15. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css +31 -0
  16. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +53 -0
  17. package/dist/collection/components/grw-map/grw-map.css +99 -0
  18. package/dist/collection/components/grw-map/grw-map.js +315 -42
  19. package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +31 -0
  20. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +41 -0
  21. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +39 -0
  22. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +52 -0
  23. package/dist/collection/components/grw-trek-card/grw-trek-card.css +67 -30
  24. package/dist/collection/components/grw-trek-card/grw-trek-card.js +37 -13
  25. package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +160 -1
  26. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +123 -8
  27. package/dist/collection/components/grw-treks-list/grw-treks-list.css +17 -3
  28. package/dist/collection/components/grw-treks-list/grw-treks-list.js +29 -7
  29. package/dist/collection/store/grw-trek-provider.js +36 -8
  30. package/dist/collection/store/grw-treks-provider.js +16 -7
  31. package/dist/collection/store/store.js +10 -0
  32. package/dist/collection/stories/App.js +22 -16
  33. package/dist/collection/stories/App.stories.js +14 -9
  34. package/dist/collection/stories/TrekCard.js +2 -1
  35. package/dist/collection/stories/TrekCard.stories.js +4 -3
  36. package/dist/collection/stories/TrekDetail.js +3 -1
  37. package/dist/collection/stories/TrekDetail.stories.js +5 -3
  38. package/dist/collection/stories/TrekMap.js +6 -4
  39. package/dist/collection/stories/TrekMap.stories.js +10 -7
  40. package/dist/collection/stories/TreksList.js +10 -9
  41. package/dist/collection/stories/TreksList.stories.js +4 -3
  42. package/dist/collection/stories/TreksMap.stories.js +6 -5
  43. package/dist/collection/utils/utils.js +2 -2
  44. package/dist/components/grw-app.js +76 -11
  45. package/dist/components/grw-filter.d.ts +11 -0
  46. package/dist/components/grw-filter.js +6 -0
  47. package/dist/components/grw-filter2.js +95 -0
  48. package/dist/components/grw-information-desk-detail.d.ts +11 -0
  49. package/dist/components/grw-information-desk-detail.js +6 -0
  50. package/dist/components/grw-information-desk-detail2.js +34 -0
  51. package/dist/components/grw-map2.js +263 -39
  52. package/dist/components/grw-poi-detail.d.ts +11 -0
  53. package/dist/components/grw-poi-detail.js +6 -0
  54. package/dist/components/grw-poi-detail2.js +32 -0
  55. package/dist/components/grw-sensitive-area-detail.d.ts +11 -0
  56. package/dist/components/grw-sensitive-area-detail.js +6 -0
  57. package/dist/components/grw-sensitive-area-detail2.js +37 -0
  58. package/dist/components/grw-trek-card2.js +11 -6
  59. package/dist/components/grw-trek-detail2.js +40 -7
  60. package/dist/components/grw-trek-provider2.js +36 -8
  61. package/dist/components/grw-treks-list2.js +10 -7
  62. package/dist/components/grw-treks-provider2.js +16 -7
  63. package/dist/components/length.js +2 -2
  64. package/dist/components/store.js +10 -0
  65. package/dist/esm/geotrek-rando-widget.js +2 -2
  66. package/dist/esm/grw-app.entry.js +89 -0
  67. package/dist/esm/{grw-app_7.entry.js → grw-filter_6.entry.js} +398 -357
  68. package/dist/esm/grw-information-desk-detail_3.entry.js +46 -0
  69. package/dist/esm/grw-trek-card.entry.js +43 -0
  70. package/dist/esm/{index-7aa9e822.js → index-192d910f.js} +47 -2
  71. package/dist/esm/length-d82189db.js +27 -0
  72. package/dist/esm/loader.js +2 -2
  73. package/dist/esm/store-5a42b5d8.js +206 -0
  74. package/dist/geotrek-rando-widget/geotrek-rando-widget.css +1 -1
  75. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  76. package/dist/geotrek-rando-widget/p-206a52d9.entry.js +1 -0
  77. package/dist/geotrek-rando-widget/p-2d9ae918.entry.js +1 -0
  78. package/dist/geotrek-rando-widget/p-6dce5e6c.js +2 -0
  79. package/dist/geotrek-rando-widget/p-8cfa03c0.entry.js +1 -0
  80. package/dist/geotrek-rando-widget/p-d3aa9819.entry.js +1 -0
  81. package/dist/geotrek-rando-widget/p-e63213a9.js +1 -0
  82. package/dist/geotrek-rando-widget/p-f3f7d6be.js +1 -0
  83. package/dist/types/components/grw-app/grw-app.d.ts +13 -2
  84. package/dist/types/components/grw-filter/grw-filter.d.ts +9 -0
  85. package/dist/types/components/grw-information-desk-detail/grw-information-desk-detail.d.ts +5 -0
  86. package/dist/types/components/grw-map/grw-map.d.ts +14 -4
  87. package/dist/types/components/grw-poi-detail/grw-poi-detail.d.ts +5 -0
  88. package/dist/types/components/grw-sensitive-area-detail/grw-sensitive-area-detail.d.ts +5 -0
  89. package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +6 -4
  90. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +10 -4
  91. package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +1 -0
  92. package/dist/types/components.d.ts +88 -3
  93. package/dist/types/store/store.d.ts +21 -1
  94. package/dist/types/types/types.d.ts +119 -3
  95. package/package.json +9 -10
  96. package/readme.md +19 -1
  97. package/dist/geotrek-rando-widget/p-332ba9ab.js +0 -2
  98. package/dist/geotrek-rando-widget/p-b7c66d2d.entry.js +0 -1
@@ -2,249 +2,81 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-c6f73e30.js');
5
+ const index = require('./index-c2c4531d.js');
6
+ const store = require('./store-972b8d2a.js');
7
+ const length = require('./length-d315d156.js');
6
8
 
7
- const appendToMap = (map, propName, value) => {
8
- const items = map.get(propName);
9
- if (!items) {
10
- map.set(propName, [value]);
11
- }
12
- else if (!items.includes(value)) {
13
- items.push(value);
14
- }
15
- };
16
- const debounce = (fn, ms) => {
17
- let timeoutId;
18
- return (...args) => {
19
- if (timeoutId) {
20
- clearTimeout(timeoutId);
21
- }
22
- timeoutId = setTimeout(() => {
23
- timeoutId = 0;
24
- fn(...args);
25
- }, ms);
26
- };
27
- };
9
+ const grwFilterCss = ".filter-name{margin-left:8px;color:var(--color-primary);font-size:24px;font-weight:bold}.filter-button-container{display:flex;flex-direction:row;flex-wrap:wrap}.filter-button-container .filter-button,.filter-button-container .selected-filter-button{user-select:none;cursor:pointer;border:1px var(--color-primary) solid;border-radius:8px;margin:8px 0px 0px 8px;padding:8px}.filter-button-container .filter-button{color:var(--color-primary);background-color:#ffffff}.filter-button-container .selected-filter-button{color:#ffffff;background-color:var(--color-primary)}";
28
10
 
29
- /**
30
- * Check if a possible element isConnected.
31
- * The property might not be there, so we check for it.
32
- *
33
- * We want it to return true if isConnected is not a property,
34
- * otherwise we would remove these elements and would not update.
35
- *
36
- * Better leak in Edge than to be useless.
37
- */
38
- const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
39
- const cleanupElements = debounce((map) => {
40
- for (let key of map.keys()) {
41
- map.set(key, map.get(key).filter(isConnected));
42
- }
43
- }, 2000);
44
- const stencilSubscription = () => {
45
- if (typeof index.getRenderingRef !== 'function') {
46
- // If we are not in a stencil project, we do nothing.
47
- // This function is not really exported by @stencil/core.
48
- return {};
49
- }
50
- const elmsToUpdate = new Map();
51
- return {
52
- dispose: () => elmsToUpdate.clear(),
53
- get: (propName) => {
54
- const elm = index.getRenderingRef();
55
- if (elm) {
56
- appendToMap(elmsToUpdate, propName, elm);
57
- }
58
- },
59
- set: (propName) => {
60
- const elements = elmsToUpdate.get(propName);
61
- if (elements) {
62
- elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
11
+ const GrwFilter = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.filters = [
15
+ { property: 'practices', trekProperty: 'practice', type: 'include' },
16
+ { property: 'difficulties', trekProperty: 'difficulty', type: 'include' },
17
+ { property: 'durations', trekProperty: 'duration', type: 'interval' },
18
+ ];
19
+ }
20
+ handleFilter(_event, filterToHandle) {
21
+ const filterFromState = [...store.state[this.filterType]];
22
+ filterFromState.find(currentFilter => currentFilter.id === filterToHandle.id).selected = !filterFromState.find(currentFilter => currentFilter.id === filterToHandle.id)
23
+ .selected;
24
+ store.state[this.filterType] = filterFromState;
25
+ let isUsingFilter = false;
26
+ let filtersTreks = [];
27
+ for (const filter of this.filters) {
28
+ const currentFiltersId = store.state[filter.property].filter(currentFilter => currentFilter.selected).map(currentFilter => currentFilter.id);
29
+ if (currentFiltersId.length > 0) {
30
+ if (filtersTreks.length > 0) {
31
+ if (filter.type === 'include') {
32
+ filtersTreks = [...filtersTreks.filter(trek => currentFiltersId.includes(trek[filter.trekProperty]))];
33
+ }
34
+ else if (filter.type === 'interval') {
35
+ let minValue;
36
+ let maxValue;
37
+ for (const currentFilterId of currentFiltersId) {
38
+ const currentFilter = store.state[filter.property].find(property => property.id === currentFilterId);
39
+ if (isNaN(minValue) || currentFilter.minValue < minValue) {
40
+ minValue = currentFilter.minValue;
41
+ }
42
+ if (isNaN(maxValue) || currentFilter.maxValue > maxValue) {
43
+ maxValue = currentFilter.maxValue;
44
+ }
63
45
  }
64
- cleanupElements(elmsToUpdate);
65
- },
66
- reset: () => {
67
- elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
68
- cleanupElements(elmsToUpdate);
69
- },
70
- };
71
- };
72
-
73
- const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
74
- let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
75
- const handlers = {
76
- dispose: [],
77
- get: [],
78
- set: [],
79
- reset: [],
80
- };
81
- const reset = () => {
82
- states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
83
- handlers.reset.forEach((cb) => cb());
84
- };
85
- const dispose = () => {
86
- // Call first dispose as resetting the state would
87
- // cause less updates ;)
88
- handlers.dispose.forEach((cb) => cb());
89
- reset();
90
- };
91
- const get = (propName) => {
92
- handlers.get.forEach((cb) => cb(propName));
93
- return states.get(propName);
94
- };
95
- const set = (propName, value) => {
96
- const oldValue = states.get(propName);
97
- if (shouldUpdate(value, oldValue, propName)) {
98
- states.set(propName, value);
99
- handlers.set.forEach((cb) => cb(propName, value, oldValue));
46
+ filtersTreks = [...filtersTreks.filter(trek => trek[filter.trekProperty] >= minValue && trek[filter.trekProperty] <= maxValue)];
47
+ }
100
48
  }
101
- };
102
- const state = (typeof Proxy === 'undefined'
103
- ? {}
104
- : new Proxy(defaultState, {
105
- get(_, propName) {
106
- return get(propName);
107
- },
108
- ownKeys(_) {
109
- return Array.from(states.keys());
110
- },
111
- getOwnPropertyDescriptor() {
112
- return {
113
- enumerable: true,
114
- configurable: true,
115
- };
116
- },
117
- has(_, propName) {
118
- return states.has(propName);
119
- },
120
- set(_, propName, value) {
121
- set(propName, value);
122
- return true;
123
- },
124
- }));
125
- const on = (eventName, callback) => {
126
- handlers[eventName].push(callback);
127
- return () => {
128
- removeFromArray(handlers[eventName], callback);
129
- };
130
- };
131
- const onChange = (propName, cb) => {
132
- const unSet = on('set', (key, newValue) => {
133
- if (key === propName) {
134
- cb(newValue);
49
+ else {
50
+ if (!isUsingFilter) {
51
+ isUsingFilter = true;
52
+ }
53
+ if (filter.type === 'include') {
54
+ filtersTreks = [...store.state.treks.filter(trek => currentFiltersId.includes(trek[filter.trekProperty]))];
55
+ }
56
+ else if (filter.type === 'interval') {
57
+ let minValue;
58
+ let maxValue;
59
+ for (const currentFilterId of currentFiltersId) {
60
+ const currentFilter = store.state[filter.property].find(property => property.id === currentFilterId);
61
+ if (isNaN(minValue) || currentFilter.minValue < minValue) {
62
+ minValue = currentFilter.minValue;
63
+ }
64
+ if (isNaN(maxValue) || currentFilter.maxValue > maxValue) {
65
+ maxValue = currentFilter.maxValue;
66
+ }
135
67
  }
136
- });
137
- const unReset = on('reset', () => cb(defaultState[propName]));
138
- return () => {
139
- unSet();
140
- unReset();
141
- };
142
- };
143
- const use = (...subscriptions) => {
144
- const unsubs = subscriptions.reduce((unsubs, subscription) => {
145
- if (subscription.set) {
146
- unsubs.push(on('set', subscription.set));
147
- }
148
- if (subscription.get) {
149
- unsubs.push(on('get', subscription.get));
150
- }
151
- if (subscription.reset) {
152
- unsubs.push(on('reset', subscription.reset));
153
- }
154
- if (subscription.dispose) {
155
- unsubs.push(on('dispose', subscription.dispose));
156
- }
157
- return unsubs;
158
- }, []);
159
- return () => unsubs.forEach((unsub) => unsub());
160
- };
161
- const forceUpdate = (key) => {
162
- const oldValue = states.get(key);
163
- handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
164
- };
165
- return {
166
- state,
167
- get,
168
- set,
169
- on,
170
- onChange,
171
- use,
172
- dispose,
173
- reset,
174
- forceUpdate,
175
- };
176
- };
177
- const removeFromArray = (array, item) => {
178
- const index = array.indexOf(item);
179
- if (index >= 0) {
180
- array[index] = array[array.length - 1];
181
- array.length--;
68
+ filtersTreks = [...store.state.treks.filter(trek => trek[filter.trekProperty] >= minValue && trek[filter.trekProperty] <= maxValue)];
69
+ }
70
+ }
71
+ }
182
72
  }
183
- };
184
-
185
- const createStore = (defaultState, shouldUpdate) => {
186
- const map = createObservableMap(defaultState, shouldUpdate);
187
- map.use(stencilSubscription());
188
- return map;
189
- };
190
-
191
- const { state, onChange } = createStore({
192
- api: '',
193
- treks: [],
194
- difficulties: [],
195
- routes: [],
196
- practices: [],
197
- currentTrek: null,
198
- });
199
-
200
- const arrowBackImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="244 400 100 256 244 112" style="fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px"/><line x1="120" y1="256" x2="412" y2="256" style="fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px"/></svg>`;
201
-
202
- const grwAppCss = ".app-container{position:relative;height:100%;max-height:100vh}.header-container,.large-view-header-container{display:flex;align-items:center;background-color:var(--color-primary);height:64px}.header-container .title,.large-view-header-container .title{color:#ffffff;margin-left:24px}.header-container .arrow-back-icon,.large-view-header-container .arrow-back-icon{width:48px;height:auto;margin-left:24px}.header-container .arrow-back-icon svg,.large-view-header-container .arrow-back-icon svg{cursor:pointer;width:48px;height:auto}.loader-container,.large-view-loader-container{display:flex;justify-content:center;align-items:center;height:100%}.loader-container .loader,.large-view-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.content-container{position:relative;display:flex;height:calc(100% - 64px)}.app-treks-list-container,.app-trek-detail-container,.large-view-app-treks-list-container,.large-view-app-trek-detail-container{height:100%}.app-map-container,.large-view-app-map-container{width:100%;height:100%}.map-visibility-button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:absolute;bottom:24px;width:100%;z-index:400;user-select:none}.map-visibility-button div{background-color:var(--color-primary);color:#ffffff;padding:12px;border-radius:24px;width:120px;text-align:center}.header-container .title{font-size:24px}.loader-container{position:absolute;width:100%}.app-treks-list-container,.app-trek-detail-container{width:100%}.app-map-container{position:relative;width:100%;position:absolute}.large-view-header-container .title{font-size:32px}.large-view-loader-container{position:relative;width:50%}.large-view-app-treks-list-container,.large-view-app-trek-detail-container{width:50%}.large-view-app-map-container{position:relative;width:50%}";
203
-
204
- const GrwApp = class {
205
- constructor(hostRef) {
206
- index.registerInstance(this, hostRef);
207
- this.showTrek = false;
208
- this.showMap = false;
209
- this.isLargeView = false;
210
- this.appName = 'Geotrek Rando Widget';
211
- this.colorPrimary = '#6b0030';
212
- this.colorPrimaryTint = '#d2b2c0';
213
- this.colorTrekLine = '#6b0030';
214
- this.colorDepartureIcon = '#006b3b';
215
- this.colorArrivalIcon = '#85003b';
216
- this.largeViewSize = 664;
217
- }
218
- onTrekCardPress(event) {
219
- this.currentTrekId = event.detail;
220
- this.showTrek = !this.showTrek;
221
- }
222
- onWindowResize() {
223
- this.handleView();
224
- }
225
- watchPropHandler() {
226
- window.dispatchEvent(new window.Event('resize'));
227
- }
228
- componentDidLoad() {
229
- this.handleView();
230
- }
231
- onTrekDetailsClose() {
232
- this.currentTrekId = null;
233
- this.showTrek = !this.showTrek;
234
- }
235
- handleView() {
236
- this.isLargeView = this.element.getBoundingClientRect().width >= this.largeViewSize;
237
- this.showMap = this.isLargeView;
73
+ store.state.currentTreks = isUsingFilter ? filtersTreks : store.state.treks;
238
74
  }
239
75
  render() {
240
- return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, index.h("grw-treks-provider", { api: this.api, "in-bbox": this.inBbox, cities: this.cities, districts: this.districts, structures: this.structures, themes: this.themes, portals: this.portals, routes: this.routes, practices: this.practices }), this.showTrek && this.currentTrekId && index.h("grw-trek-provider", { api: state.api, "trek-id": this.currentTrekId }), index.h("div", { class: "app-container" }, index.h("div", { class: this.isLargeView ? 'large-view-header-container' : 'header-container' }, this.showTrek ? index.h("div", { onClick: () => this.onTrekDetailsClose(), class: "arrow-back-icon", innerHTML: arrowBackImage }) : index.h("div", { class: "title" }, this.appName)), index.h("div", { class: "content-container" }, index.h("div", { class: this.isLargeView ? 'large-view-app-treks-list-container' : 'app-treks-list-container', style: { display: this.showTrek ? 'none' : 'flex', position: this.showTrek ? 'absolute' : 'relative' } }, index.h("grw-treks-list", { "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })), this.showTrek && !state.currentTrek && (index.h("div", { class: this.isLargeView ? 'large-view-loader-container' : 'loader-container' }, index.h("span", { class: "loader" }))), state.currentTrek && (index.h("div", { class: this.isLargeView ? 'large-view-app-trek-detail-container' : 'app-trek-detail-container' }, index.h("grw-trek-detail", { "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint }))), index.h("grw-map", { class: this.isLargeView ? 'large-view-app-map-container' : 'app-map-container', style: { visibility: this.showMap ? 'visible' : 'hidden' }, "url-layer": this.urlLayer, center: this.center, zoom: this.zoom, attribution: this.attribution, "color-trek-line": this.colorTrekLine, "color-departure-icon": this.colorDepartureIcon, "color-arrival-icon": this.colorArrivalIcon })), index.h("div", { class: "map-visibility-button", style: { display: this.isLargeView ? 'none' : 'flex' } }, index.h("div", { onClick: () => (this.showMap = !this.showMap) }, this.showMap ? (this.showTrek ? 'Voir la fiche' : 'Voir la liste') : 'Voir la carte')))));
76
+ return (index.h(index.Host, null, index.h("div", { class: "filter-name" }, this.filterName), index.h("div", { class: "filter-button-container" }, store.state[this.filterType].map(currentFilter => (index.h("div", { onClick: event => this.handleFilter(event, currentFilter), class: currentFilter.selected ? 'selected-filter-button' : 'filter-button' }, currentFilter[this.filterNameProperty]))))));
241
77
  }
242
- get element() { return index.getElement(this); }
243
- static get watchers() { return {
244
- "isLargeView": ["watchPropHandler"]
245
- }; }
246
78
  };
247
- GrwApp.style = grwAppCss;
79
+ GrwFilter.style = grwFilterCss;
248
80
 
249
81
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
250
82
 
@@ -14387,45 +14219,49 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
14387
14219
 
14388
14220
  const departureArrivalImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M80,464V68.14a8,8,0,0,1,4-6.9C91.81,56.66,112.92,48,160,48c64,0,145,48,192,48a199.53,199.53,0,0,0,77.23-15.77A2,2,0,0,1,432,82.08V301.44a4,4,0,0,1-2.39,3.65C421.37,308.7,392.33,320,352,320c-48,0-128-32-192-32s-80,16-80,16" style=";fill:#ffffff;stroke:currentColor;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`;
14389
14221
 
14390
- const grwMapCss = ".leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-control-attribution svg{display:inline !important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:\"\"}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;color-adjust:exact}}grw-map{display:block;height:100%;max-height:100vh}.departure-icon svg,.arrival-icon svg{width:48px;height:48px}.departure-icon svg path,.arrival-icon svg path{fill:currentColor;stroke:currentColor}.departure-icon{color:var(--color-departure-icon)}.arrival-icon{color:var(--color-arrival-icon)}.trek-marker{background-color:var(--color-primary);border-radius:50%;display:flex;justify-content:center;align-items:center}.trek-marker img{width:36px !important}.map-loader-container{position:absolute;z-index:500;width:100%;height:100%;background:rgba(255, 255, 255, 0.5);display:flex;justify-content:center;align-items:center}.map-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
14222
+ const grwMapCss = ".leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-control-attribution svg{display:inline !important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:\"\"}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;color-adjust:exact}}grw-map{font-family:\"Roboto\";display:block;height:100%;max-height:100vh}.departure-icon svg,.arrival-icon svg{width:48px;height:48px}.departure-icon svg path,.arrival-icon svg path{fill:currentColor;stroke:currentColor}.departure-icon{color:var(--color-departure-icon)}.arrival-icon{color:var(--color-arrival-icon)}.trek-marker{background-color:var(--color-primary);border-radius:50%;display:flex;justify-content:center;align-items:center}.trek-marker img{width:36px !important}.map-loader-container{position:absolute;z-index:500;width:100%;height:100%;background:rgba(255, 255, 255, 0.5);display:flex;justify-content:center;align-items:center}.map-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.leaflet-popup-content{width:144px;margin:0}.trek-departure-popup{position:relative;display:flex;flex-direction:column;width:100px;height:auto;padding:24px}.trek-departure-popup img{border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25)}.trek-departure-popup .trek-name{color:var(--color-primary);font-weight:bold;font-size:12px}.trek-departure-popup .trek-name-margin-top{margin-top:12px}.poi-tooltip .poi-name,.poi-tooltip .information-desks-name,.poi-tooltip .sensitive-area-name,.information-desks-tooltip .poi-name,.information-desks-tooltip .information-desks-name,.information-desks-tooltip .sensitive-area-name,.sensitive-area-tooltip .poi-name,.sensitive-area-tooltip .information-desks-name,.sensitive-area-tooltip .sensitive-area-name{color:var(--color-primary);font-weight:bold;font-size:12px}.sensitiveAreasCheckboxContainer{display:flex;justify-content:center;align-items:center;background-color:#ffffff;padding:8px;border-radius:8px;user-select:none}.sensitiveAreasCheckboxContainer input,.sensitiveAreasCheckboxContainer label{cursor:pointer}.sensitiveAreasCheckboxContainer input{margin:0}.sensitiveAreasCheckboxContainer label{padding-left:8px}.poi-icon,.information-desks-icon{background-color:var(--color-poi-icon);border-radius:50%;display:flex;justify-content:center;align-items:center}.poi-icon img,.information-desks-icon img{width:36px !important}.parking-icon{background-color:#0000ff;border-radius:50%;display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:#ffffff}.point-reference-icon{background-color:#ff0000;border:1px solid #ffffff;border-radius:50%;display:flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:18px;color:#ffffff}";
14391
14223
 
14392
14224
  const GrwMap = class {
14393
14225
  constructor(hostRef) {
14394
14226
  index.registerInstance(this, hostRef);
14227
+ this.trekCardPress = index.createEvent(this, "trekCardPress", 7);
14395
14228
  this.mapIsReady = false;
14396
14229
  this.center = '1, 1';
14397
14230
  this.zoom = 10;
14231
+ this.colorPrimary = '#6b0030';
14232
+ this.colorPrimaryTint = '#974c6e';
14398
14233
  this.colorTrekLine = '#6b0030';
14399
14234
  this.colorDepartureIcon = '#006b3b';
14400
14235
  this.colorArrivalIcon = '#85003b';
14401
- this.colorPrimary = '#6b0030';
14402
- this.colorPrimaryTint = '#d2b2c0';
14236
+ this.colorSensitiveArea = ' #4974a5';
14237
+ this.colorPoiIcon = '#974c6e';
14403
14238
  }
14404
14239
  componentDidLoad() {
14405
14240
  this.map = leafletSrc.map(this.element, {
14406
14241
  center: this.center.split(',').map(Number),
14407
14242
  zoom: this.zoom,
14408
14243
  });
14244
+ leafletSrc.control.scale().addTo(this.map);
14409
14245
  leafletSrc.tileLayer(this.urlLayer, {
14410
14246
  maxZoom: 19,
14411
14247
  attribution: this.attribution,
14412
14248
  }).addTo(this.map);
14413
- if (state.currentTrek) {
14249
+ if (store.state.currentTrek) {
14414
14250
  this.addTrek();
14415
14251
  }
14416
- else if (state.currentTrek) {
14252
+ else if (store.state.currentTrek) {
14417
14253
  this.addTreks();
14418
14254
  }
14419
- onChange('treks', () => {
14420
- if (state.currentTrek) {
14255
+ store.onChange('currentTreks', () => {
14256
+ if (store.state.currentTrek) {
14421
14257
  this.addTrek();
14422
14258
  }
14423
- else if (state.treks) {
14259
+ else if (store.state.currentTreks) {
14424
14260
  this.addTreks();
14425
14261
  }
14426
14262
  });
14427
- onChange('currentTrek', () => {
14428
- if (state.currentTrek) {
14263
+ store.onChange('currentTrek', () => {
14264
+ if (store.state.currentTrek) {
14429
14265
  this.removeTreks();
14430
14266
  this.addTrek();
14431
14267
  }
@@ -14437,34 +14273,63 @@ const GrwMap = class {
14437
14273
  }
14438
14274
  addTreks() {
14439
14275
  var _a;
14440
- const treksDepartureCoordinates = [];
14276
+ const trekscurrentDepartureCoordinates = [];
14441
14277
  const treksFeatureCollection = {
14442
14278
  type: 'FeatureCollection',
14443
14279
  features: [],
14444
14280
  };
14445
- for (const trek of state.treks) {
14446
- treksDepartureCoordinates.push(trek.departure_geom);
14281
+ for (const trek of store.state.currentTreks) {
14282
+ trekscurrentDepartureCoordinates.push(trek.departure_geom);
14447
14283
  treksFeatureCollection.features.push({
14448
14284
  type: 'Feature',
14449
- properties: { practice: (_a = state.practices.find(practice => practice.id === trek.practice)) === null || _a === void 0 ? void 0 : _a.pictogram },
14450
14285
  geometry: { type: 'Point', coordinates: trek.departure_geom },
14286
+ properties: {
14287
+ id: trek.id,
14288
+ name: trek.name,
14289
+ practice: (_a = store.state.practices.find(practice => practice.id === trek.practice)) === null || _a === void 0 ? void 0 : _a.pictogram,
14290
+ imgSrc: trek.attachments && trek.attachments.length > 0 && trek.attachments[0].thumbnail,
14291
+ },
14451
14292
  });
14452
14293
  }
14453
- if (treksDepartureCoordinates.length > 0) {
14454
- const bounds = leafletSrc.latLngBounds(treksDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
14294
+ if (trekscurrentDepartureCoordinates.length > 0) {
14295
+ const bounds = leafletSrc.latLngBounds(trekscurrentDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
14455
14296
  this.currentBounds = bounds;
14456
14297
  this.map.fitBounds(this.currentBounds);
14457
14298
  }
14458
- this.treksLayer = leafletSrc.geoJSON(treksFeatureCollection, {
14459
- pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14460
- icon: leafletSrc.divIcon({
14461
- className: 'trek-marker',
14462
- iconSize: 48,
14463
- html: geoJsonPoint.properties.practice ? `<img src=${geoJsonPoint.properties.practice} />` : '',
14299
+ if (!this.treksLayer) {
14300
+ this.treksLayer = leafletSrc.geoJSON(treksFeatureCollection, {
14301
+ pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14302
+ icon: leafletSrc.divIcon({
14303
+ html: geoJsonPoint.properties.practice && `<img src=${geoJsonPoint.properties.practice} />`,
14304
+ className: 'trek-marker',
14305
+ iconSize: 48,
14306
+ }),
14307
+ autoPanOnFocus: false,
14464
14308
  }),
14465
- autoPanOnFocus: false,
14466
- }),
14467
- }).addTo(this.map);
14309
+ onEachFeature: (geoJsonPoint, layer) => {
14310
+ layer.once('click', () => {
14311
+ const trekDeparturePopup = leafletSrc.DomUtil.create('div');
14312
+ trekDeparturePopup.className = 'trek-departure-popup';
14313
+ trekDeparturePopup.onclick = () => this.trekCardPress.emit(geoJsonPoint.properties.id);
14314
+ const trekName = leafletSrc.DomUtil.create('div');
14315
+ trekName.innerHTML = geoJsonPoint.properties.name;
14316
+ trekName.className = 'trek-name';
14317
+ if (geoJsonPoint.properties.imgSrc) {
14318
+ trekName.className += ' trek-name-margin-top';
14319
+ const trekImg = leafletSrc.DomUtil.create('img');
14320
+ trekImg.src = geoJsonPoint.properties.imgSrc;
14321
+ trekDeparturePopup.appendChild(trekImg);
14322
+ }
14323
+ trekDeparturePopup.appendChild(trekName);
14324
+ layer.bindPopup(trekDeparturePopup, { interactive: true, autoPan: false, closeButton: false }).openPopup();
14325
+ });
14326
+ },
14327
+ }).addTo(this.map);
14328
+ }
14329
+ else {
14330
+ this.treksLayer.clearLayers();
14331
+ this.treksLayer.addData(treksFeatureCollection);
14332
+ }
14468
14333
  !this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
14469
14334
  }
14470
14335
  removeTreks() {
@@ -14474,39 +14339,40 @@ const GrwMap = class {
14474
14339
  }
14475
14340
  }
14476
14341
  addTrek() {
14477
- const trekFeature = {
14342
+ const currentTrekFeature = {
14478
14343
  type: 'Feature',
14479
- geometry: state.currentTrek.geometry,
14344
+ geometry: store.state.currentTrek.geometry,
14480
14345
  properties: {},
14481
14346
  };
14482
- this.trekLayer = leafletSrc.geoJSON(trekFeature, {
14347
+ this.currentTrekLayer = leafletSrc.geoJSON(currentTrekFeature, {
14483
14348
  style: () => ({
14484
14349
  color: this.colorTrekLine,
14485
14350
  }),
14351
+ interactive: false,
14486
14352
  }).addTo(this.map);
14487
- const bounds = leafletSrc.latLngBounds(state.currentTrek.geometry.coordinates.map(coordinate => [coordinate[1], coordinate[0]]));
14353
+ const bounds = leafletSrc.latLngBounds(store.state.currentTrek.geometry.coordinates.map(coordinate => [coordinate[1], coordinate[0]]));
14488
14354
  this.currentBounds = bounds;
14489
14355
  this.map.fitBounds(this.currentBounds);
14490
- const departureCoordinates = [state.currentTrek.geometry.coordinates.at(0)[0], state.currentTrek.geometry.coordinates.at(0)[1]];
14491
- const arrivalCoordinates = [state.currentTrek.geometry.coordinates.at(-1)[0], state.currentTrek.geometry.coordinates.at(-1)[1]];
14492
- const departureArrivalFeatureCollection = {
14356
+ const currentDepartureCoordinates = [store.state.currentTrek.geometry.coordinates.at(0)[0], store.state.currentTrek.geometry.coordinates.at(0)[1]];
14357
+ const currentArrivalCoordinates = [store.state.currentTrek.geometry.coordinates.at(-1)[0], store.state.currentTrek.geometry.coordinates.at(-1)[1]];
14358
+ const currentDepartureArrivalFeatureCollection = {
14493
14359
  type: 'FeatureCollection',
14494
14360
  features: [
14495
14361
  {
14496
14362
  type: 'Feature',
14497
14363
  properties: { type: 'departure' },
14498
- geometry: { type: 'Point', coordinates: departureCoordinates },
14364
+ geometry: { type: 'Point', coordinates: currentDepartureCoordinates },
14499
14365
  },
14500
14366
  ],
14501
14367
  };
14502
- if (departureCoordinates[0] !== arrivalCoordinates[0] || departureCoordinates[1] !== arrivalCoordinates[1]) {
14503
- departureArrivalFeatureCollection.features.push({
14368
+ if (currentDepartureCoordinates[0] !== currentArrivalCoordinates[0] || currentDepartureCoordinates[1] !== currentArrivalCoordinates[1]) {
14369
+ currentDepartureArrivalFeatureCollection.features.push({
14504
14370
  type: 'Feature',
14505
14371
  properties: { type: 'arrival' },
14506
- geometry: { type: 'Point', coordinates: arrivalCoordinates },
14372
+ geometry: { type: 'Point', coordinates: currentArrivalCoordinates },
14507
14373
  });
14508
14374
  }
14509
- this.departureArrivalLayer = leafletSrc.geoJSON(departureArrivalFeatureCollection, {
14375
+ this.currentDepartureArrivalLayer = leafletSrc.geoJSON(currentDepartureArrivalFeatureCollection, {
14510
14376
  pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14511
14377
  icon: leafletSrc.divIcon({
14512
14378
  html: departureArrivalImage,
@@ -14515,18 +14381,205 @@ const GrwMap = class {
14515
14381
  iconAnchor: [0, 48],
14516
14382
  }),
14517
14383
  autoPanOnFocus: false,
14384
+ interactive: false,
14518
14385
  }),
14519
14386
  }).addTo(this.map);
14387
+ if (store.state.currentTrek.parking_location) {
14388
+ const currentParking = {
14389
+ type: 'Feature',
14390
+ properties: {},
14391
+ geometry: { type: 'Point', coordinates: store.state.currentTrek.parking_location },
14392
+ };
14393
+ this.currentParkingLayer = leafletSrc.geoJSON(currentParking, {
14394
+ pointToLayer: (_geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14395
+ icon: leafletSrc.divIcon({
14396
+ html: '<div>P</div>',
14397
+ className: 'parking-icon',
14398
+ iconSize: 48,
14399
+ iconAnchor: [0, 48],
14400
+ }),
14401
+ autoPanOnFocus: false,
14402
+ interactive: false,
14403
+ }),
14404
+ }).addTo(this.map);
14405
+ }
14406
+ if (store.state.currentSensitiveAreas && store.state.currentSensitiveAreas.length > 0) {
14407
+ const currentSensitiveAreasFeatureCollection = {
14408
+ type: 'FeatureCollection',
14409
+ features: [],
14410
+ };
14411
+ for (const sensitiveArea of store.state.currentSensitiveAreas) {
14412
+ currentSensitiveAreasFeatureCollection.features.push({
14413
+ type: 'Feature',
14414
+ properties: { name: sensitiveArea.name },
14415
+ geometry: sensitiveArea.geometry,
14416
+ });
14417
+ }
14418
+ this.currentSensitiveAreasLayer = leafletSrc.geoJSON(currentSensitiveAreasFeatureCollection, {
14419
+ onEachFeature: (geoJsonPoint, layer) => {
14420
+ layer.once('mouseover', () => {
14421
+ const sensitiveAreaTooltip = leafletSrc.DomUtil.create('div');
14422
+ sensitiveAreaTooltip.className = 'sensitive-area-tooltip';
14423
+ const sensitiveAreaName = leafletSrc.DomUtil.create('div');
14424
+ sensitiveAreaName.innerHTML = geoJsonPoint.properties.name;
14425
+ sensitiveAreaName.className = 'sensitive-area-name';
14426
+ sensitiveAreaTooltip.appendChild(sensitiveAreaName);
14427
+ layer.bindTooltip(sensitiveAreaTooltip).openTooltip();
14428
+ });
14429
+ },
14430
+ style: () => ({ color: this.colorSensitiveArea }),
14431
+ }).addTo(this.map);
14432
+ leafletSrc.Control.SensitiveAreasCheckboxContainer = leafletSrc.Control.extend({
14433
+ onAdd: () => {
14434
+ const sensitiveAreasCheckboxContainer = leafletSrc.DomUtil.create('div');
14435
+ sensitiveAreasCheckboxContainer.className = 'sensitiveAreasCheckboxContainer';
14436
+ const sensitiveAreasCheckbox = leafletSrc.DomUtil.create('input');
14437
+ sensitiveAreasCheckbox.setAttribute('id', 'sensitiveAreasCheckbox');
14438
+ sensitiveAreasCheckbox.setAttribute('type', 'checkbox');
14439
+ sensitiveAreasCheckbox.setAttribute('checked', 'true');
14440
+ sensitiveAreasCheckbox.onclick = value => value.composedPath()[0].checked ? this.map.addLayer(this.currentSensitiveAreasLayer) : this.map.removeLayer(this.currentSensitiveAreasLayer);
14441
+ const sensitiveAreasLabel = leafletSrc.DomUtil.create('label');
14442
+ sensitiveAreasLabel.setAttribute('for', 'sensitiveAreasCheckbox');
14443
+ sensitiveAreasLabel.innerHTML =
14444
+ currentSensitiveAreasFeatureCollection.features.length > 1 || currentSensitiveAreasFeatureCollection.features[0].geometry.type === 'MultiPolygon'
14445
+ ? 'Afficher les zones sensibles'
14446
+ : 'Afficher la zone sensible';
14447
+ sensitiveAreasCheckboxContainer.appendChild(sensitiveAreasCheckbox);
14448
+ sensitiveAreasCheckboxContainer.appendChild(sensitiveAreasLabel);
14449
+ return sensitiveAreasCheckboxContainer;
14450
+ },
14451
+ });
14452
+ leafletSrc.control.sensitiveAreasCheckboxContainer = () => {
14453
+ return new leafletSrc.Control.SensitiveAreasCheckboxContainer();
14454
+ };
14455
+ this.sensitiveAreasControl = leafletSrc.control.sensitiveAreasCheckboxContainer({ position: 'topright' }).addTo(this.map);
14456
+ }
14457
+ if (store.state.currentPois && store.state.currentPois.length > 0) {
14458
+ const currentPoisFeatureCollection = {
14459
+ type: 'FeatureCollection',
14460
+ features: [],
14461
+ };
14462
+ for (const currentPoi of store.state.currentPois) {
14463
+ currentPoisFeatureCollection.features.push({
14464
+ type: 'Feature',
14465
+ properties: { name: currentPoi.name, type_pictogram: currentPoi.type_pictogram },
14466
+ geometry: currentPoi.geometry,
14467
+ });
14468
+ }
14469
+ this.currentPoisLayer = leafletSrc.geoJSON(currentPoisFeatureCollection, {
14470
+ pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14471
+ icon: leafletSrc.divIcon({
14472
+ html: geoJsonPoint.properties.type_pictogram && `<img src=${geoJsonPoint.properties.type_pictogram} />`,
14473
+ className: 'poi-icon',
14474
+ iconSize: 48,
14475
+ }),
14476
+ autoPanOnFocus: false,
14477
+ }),
14478
+ onEachFeature: (geoJsonPoint, layer) => {
14479
+ layer.once('mouseover', () => {
14480
+ const poiTooltip = leafletSrc.DomUtil.create('div');
14481
+ poiTooltip.className = 'poi-tooltip';
14482
+ const poiName = leafletSrc.DomUtil.create('div');
14483
+ poiName.innerHTML = geoJsonPoint.properties.name;
14484
+ poiName.className = 'poi-name';
14485
+ poiTooltip.appendChild(poiName);
14486
+ layer.bindTooltip(poiTooltip).openTooltip();
14487
+ });
14488
+ },
14489
+ }).addTo(this.map);
14490
+ }
14491
+ if (store.state.currentInformationDesks && store.state.currentInformationDesks.length > 0) {
14492
+ const currentInformationDesksFeatureCollection = {
14493
+ type: 'FeatureCollection',
14494
+ features: [],
14495
+ };
14496
+ for (const currentInformationDesk of store.state.currentInformationDesks) {
14497
+ currentInformationDesksFeatureCollection.features.push({
14498
+ type: 'Feature',
14499
+ properties: { name: currentInformationDesk.name, type_pictogram: currentInformationDesk.type.pictogram },
14500
+ geometry: { type: 'Point', coordinates: [Number(currentInformationDesk.longitude), Number(currentInformationDesk.latitude)] },
14501
+ });
14502
+ }
14503
+ this.currentInformationDesksLayer = leafletSrc.geoJSON(currentInformationDesksFeatureCollection, {
14504
+ pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
14505
+ icon: leafletSrc.divIcon({
14506
+ html: geoJsonPoint.properties.type_pictogram && `<img src=${geoJsonPoint.properties.type_pictogram} />`,
14507
+ className: 'information-desks-icon',
14508
+ iconSize: 48,
14509
+ }),
14510
+ autoPanOnFocus: false,
14511
+ }),
14512
+ onEachFeature: (geoJsonPoint, layer) => {
14513
+ layer.once('mouseover', () => {
14514
+ const informationDesksTooltip = leafletSrc.DomUtil.create('div');
14515
+ informationDesksTooltip.className = 'information-desks-tooltip';
14516
+ const informationDesksName = leafletSrc.DomUtil.create('div');
14517
+ informationDesksName.innerHTML = geoJsonPoint.properties.name;
14518
+ informationDesksName.className = 'information-desks-name';
14519
+ informationDesksTooltip.appendChild(informationDesksName);
14520
+ layer.bindTooltip(informationDesksTooltip).openTooltip();
14521
+ });
14522
+ },
14523
+ }).addTo(this.map);
14524
+ }
14525
+ if (store.state.currentTrek.points_reference) {
14526
+ const currentPointsReferenceFeatureCollection = {
14527
+ type: 'FeatureCollection',
14528
+ features: [],
14529
+ };
14530
+ currentPointsReferenceFeatureCollection.features.push({
14531
+ type: 'Feature',
14532
+ properties: {},
14533
+ geometry: store.state.currentTrek.points_reference,
14534
+ });
14535
+ let index = 0;
14536
+ this.currentPointsReferenceLayer = leafletSrc.geoJSON(currentPointsReferenceFeatureCollection, {
14537
+ pointToLayer: (_geoJsonPoint, latlng) => {
14538
+ index += 1;
14539
+ return leafletSrc.marker(latlng, {
14540
+ icon: leafletSrc.divIcon({
14541
+ html: index,
14542
+ className: 'point-reference-icon',
14543
+ iconSize: 24,
14544
+ }),
14545
+ autoPanOnFocus: false,
14546
+ interactive: false,
14547
+ });
14548
+ },
14549
+ }).addTo(this.map);
14550
+ }
14520
14551
  !this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
14521
14552
  }
14522
14553
  removeTrek() {
14523
- if (this.trekLayer) {
14524
- this.map.removeLayer(this.trekLayer);
14525
- this.trekLayer = null;
14554
+ if (this.currentTrekLayer) {
14555
+ this.map.removeLayer(this.currentTrekLayer);
14556
+ this.currentTrekLayer = null;
14557
+ }
14558
+ if (this.currentDepartureArrivalLayer) {
14559
+ this.map.removeLayer(this.currentDepartureArrivalLayer);
14560
+ this.currentDepartureArrivalLayer = null;
14561
+ }
14562
+ if (this.currentParkingLayer) {
14563
+ this.map.removeLayer(this.currentParkingLayer);
14564
+ this.currentParkingLayer = null;
14565
+ }
14566
+ if (this.currentSensitiveAreasLayer) {
14567
+ this.map.removeLayer(this.currentSensitiveAreasLayer);
14568
+ this.currentSensitiveAreasLayer = null;
14569
+ this.map.removeControl(this.sensitiveAreasControl);
14570
+ this.sensitiveAreasControl = null;
14571
+ }
14572
+ if (this.currentPoisLayer) {
14573
+ this.map.removeLayer(this.currentPoisLayer);
14574
+ this.currentPoisLayer = null;
14526
14575
  }
14527
- if (this.departureArrivalLayer) {
14528
- this.map.removeLayer(this.departureArrivalLayer);
14529
- this.departureArrivalLayer = null;
14576
+ if (this.currentInformationDesksLayer) {
14577
+ this.map.removeLayer(this.currentInformationDesksLayer);
14578
+ this.currentInformationDesksLayer = null;
14579
+ }
14580
+ if (this.currentPointsReferenceLayer) {
14581
+ this.map.removeLayer(this.currentPointsReferenceLayer);
14582
+ this.currentPointsReferenceLayer = null;
14530
14583
  }
14531
14584
  }
14532
14585
  render() {
@@ -14535,103 +14588,52 @@ const GrwMap = class {
14535
14588
  '--color-primary-tint': this.colorPrimaryTint,
14536
14589
  '--color-departure-icon': this.colorDepartureIcon,
14537
14590
  '--color-arrival-icon': this.colorArrivalIcon,
14591
+ '--color-poi-icon': this.colorPoiIcon,
14538
14592
  } }, !this.mapIsReady && (index.h("div", { class: "map-loader-container" }, index.h("span", { class: "loader" })))));
14539
14593
  }
14540
14594
  get element() { return index.getElement(this); }
14541
14595
  };
14542
14596
  GrwMap.style = grwMapCss;
14543
14597
 
14544
- function formatDuration(duration) {
14545
- let formattedDuration;
14546
- if (duration < 24) {
14547
- formattedDuration = `${Math.floor(duration)}h`;
14548
- if (duration % 1 > 0) {
14549
- formattedDuration += `${Math.round(60 * (duration % 1))}min`;
14550
- }
14551
- }
14552
- else {
14553
- formattedDuration = `${duration / 24}j`;
14554
- }
14555
- return formattedDuration;
14556
- }
14557
- function formatLength(length) {
14558
- return `${Math.round(length / 1000)} km`;
14559
- }
14560
- function formatAscent(ascent) {
14561
- return `${ascent} m`;
14562
- }
14563
-
14564
- const ascentImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="352 144 464 144 464 256" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M48,368,169.37,246.63a32,32,0,0,1,45.26,0l50.74,50.74a32,32,0,0,0,45.26,0L448,160" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`;
14565
-
14566
- const durationImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M145.61,464H366.39c19.8,0,35.55-16.29,33.42-35.06C386.06,308,304,310,304,256s83.11-51,95.8-172.94c2-18.78-13.61-35.06-33.41-35.06H145.61c-19.8,0-35.37,16.28-33.41,35.06C124.89,205,208,201,208,256s-82.06,52-95.8,172.94C110.06,447.71,125.81,464,145.61,464Z" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M343.3,432H169.13c-15.6,0-20-18-9.06-29.16C186.55,376,240,356.78,240,326V224c0-19.85-38-35-61.51-67.2-3.88-5.31-3.49-12.8,6.37-12.8H327.59c8.41,0,10.23,7.43,6.4,12.75C310.82,189,272,204.05,272,224V326c0,30.53,55.71,47,80.4,76.87C362.35,414.91,358.87,432,343.3,432Z"/></svg>`;
14567
-
14568
- const lengthImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="304 96 416 96 416 208" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="405.77" y1="106.2" x2="111.98" y2="400.02" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><polyline points="208 416 96 416 96 304" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`;
14569
-
14570
- const grwTrekCardCss = ".trek-card-container{width:350px;height:auto;border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image{width:100%;height:auto}.trek-card-container .sub-container{padding:12px}.trek-card-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:12px}.trek-card-container .sub-container .description{max-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px}.trek-card-container .sub-container .description p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}.trek-card-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-card-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}";
14571
-
14572
- const GrwTrekCard = class {
14573
- constructor(hostRef) {
14574
- index.registerInstance(this, hostRef);
14575
- this.trekCardPress = index.createEvent(this, "trekCardPress", 7);
14576
- this.colorPrimary = '#6b0030';
14577
- this.colorPrimaryTint = '#d2b2c0';
14578
- }
14579
- componentWillLoad() {
14580
- this.currentTrek = this.trek ? this.trek : state.currentTrek;
14581
- if (this.currentTrek) {
14582
- this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14583
- this.route = state.routes.find(route => route.id === this.currentTrek.route);
14584
- this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14585
- }
14586
- onChange('currentTrek', () => {
14587
- this.currentTrek = this.trek ? this.trek : state.currentTrek;
14588
- if (this.currentTrek) {
14589
- this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14590
- this.route = state.routes.find(route => route.id === this.currentTrek.route);
14591
- this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14592
- }
14593
- });
14594
- }
14595
- render() {
14596
- var _a, _b, _c, _d, _e, _f, _g, _h;
14597
- return (index.h(index.Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id), style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (index.h("div", { class: "trek-card-container" }, this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].url && (index.h("img", { class: "image", src: `${this.currentTrek.attachments[0].url}.400x0_q85.${this.currentTrek.attachments[0].url.slice(-3).toLowerCase()}`, loading: "lazy" })), index.h("div", { class: "sub-container" }, index.h("div", { class: "name" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.name), index.h("div", { class: "description", innerHTML: (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.description_teaser }), index.h("div", { class: "icons-labels-container" }, index.h("div", { class: "row" }, index.h("div", { class: "icon-label difficulty" }, ((_c = this.difficulty) === null || _c === void 0 ? void 0 : _c.pictogram) && index.h("img", { src: this.difficulty.pictogram }), (_d = this.difficulty) === null || _d === void 0 ? void 0 :
14598
- _d.label), index.h("div", { class: "icon-label duration" }, index.h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration(this.currentTrek.duration)), index.h("div", { class: "icon-label route" }, ((_e = this.route) === null || _e === void 0 ? void 0 : _e.pictogram) && index.h("img", { src: this.route.pictogram }), (_f = this.route) === null || _f === void 0 ? void 0 :
14599
- _f.route)), index.h("div", { class: "row" }, index.h("div", { class: "icon-label length" }, index.h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), index.h("div", { class: "icon-label ascent" }, index.h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent)), index.h("div", { class: "icon-label practice" }, ((_g = this.practice) === null || _g === void 0 ? void 0 : _g.pictogram) && index.h("img", { src: this.practice.pictogram }), (_h = this.practice) === null || _h === void 0 ? void 0 :
14600
- _h.name))))))));
14601
- }
14602
- };
14603
- GrwTrekCard.style = grwTrekCardCss;
14604
-
14605
- const grwTrekDetailCss = ".trek-detail-container{display:flex;flex-direction:column;height:100%;overflow-y:auto}.trek-detail-container .name{color:var(--color-primary);font-size:48px;font-weight:bold;padding:24px}.trek-detail-container .image{align-self:center;width:100%;max-width:700px;height:auto;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25)}.trek-detail-container .sub-container{padding:24px}.trek-detail-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-detail-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-detail-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:24px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-detail-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 8px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label img,.trek-detail-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-detail-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-detail-container .description{padding:0px 24px 24px 24px}";
14598
+ const grwTrekDetailCss = ".trek-detail-container{font-family:\"Roboto\";display:flex;flex-direction:column;height:100%;overflow-y:auto}.trek-detail-container .name{color:var(--color-primary);font-size:48px;font-weight:bold;padding:24px}.trek-detail-container .image{border-radius:8px;align-self:center;width:100%;max-width:700px;height:auto;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25)}.trek-detail-container .sub-container{padding:24px}.trek-detail-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-detail-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-detail-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:24px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-detail-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 8px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label img,.trek-detail-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-detail-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-detail-container .downloads-container{padding:0px 24px 24px 24px;display:flex;flex-direction:column;justify-content:center;align-items:center}.trek-detail-container .downloads-container .download-title{color:var(--color-primary);font-size:18px;margin-bottom:12px}.trek-detail-container .downloads-container .links-container{display:flex}.trek-detail-container .downloads-container .links-container a{background-color:var(--color-primary);padding:8px;color:#ffffff;text-decoration:none;border-radius:8px}.trek-detail-container .downloads-container .links-container a:nth-child(2){margin:0px 12px}.trek-detail-container .downloads-container .links-container a:hover{background-color:var(--color-primary-shade)}.trek-detail-container .themes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap;padding:0px 24px 24px 24px}.trek-detail-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-detail-container .ambiance,.trek-detail-container .description-teaser,.trek-detail-container .description-container,.trek-detail-container .altimetric-profile-container,.trek-detail-container .access-container,.trek-detail-container .public-transport-container,.trek-detail-container .advice-container,.trek-detail-container .advised-parking-container,.trek-detail-container .gear-container,.trek-detail-container .pois-container,.trek-detail-container .sensitive-areas-container,.trek-detail-container .information-desks-container,.trek-detail-container .source-container,.trek-detail-container .accessibilities-container{padding:0px 24px 24px 24px}.trek-detail-container .ambiance a,.trek-detail-container .description-teaser a,.trek-detail-container .description-container a,.trek-detail-container .altimetric-profile-container a,.trek-detail-container .access-container a,.trek-detail-container .public-transport-container a,.trek-detail-container .advice-container a,.trek-detail-container .advised-parking-container a,.trek-detail-container .gear-container a,.trek-detail-container .pois-container a,.trek-detail-container .sensitive-areas-container a,.trek-detail-container .information-desks-container a,.trek-detail-container .source-container a,.trek-detail-container .accessibilities-container a{color:var(--color-primary)}.trek-detail-container .description-title,.trek-detail-container .altimetric-profile-title,.trek-detail-container .access-title,.trek-detail-container .public-transport-title,.trek-detail-container .advice-title,.trek-detail-container .advised-parking-title,.trek-detail-container .gear-title,.trek-detail-container .pois-title,.trek-detail-container .sensitive-areas-title,.trek-detail-container .information-desks-title,.trek-detail-container .source-title,.trek-detail-container .accessibilities-title{color:var(--color-primary);font-size:36px;font-weight:bold;margin:12px 0px}.label-container .label-sub-container{display:flex;align-items:center}.label-container .label-sub-container img{width:26px;margin-right:16px}.label-container .label-sub-container .label-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.source-container .source-sub-container{display:flex;align-items:center}.source-container .source-sub-container img{width:26px;margin-right:16px}.source-container .source-sub-container .source-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.departure-container,.arrival-container{display:flex;align-items:center;padding:0px 24px 24px 24px}.departure-container .departure-title,.departure-container .arrival-title,.arrival-container .departure-title,.arrival-container .arrival-title{color:var(--color-primary);font-weight:bold}.accessibilities-container .accessibilities-content-container{padding:12px 0px 0px 0px;display:flex}.accessibilities-container .accessibilities-content-container .accessibility-content-container{display:flex;align-items:center;margin:0px 8px 8px 0px}.accessibilities-container .accessibilities-content-container .accessibility-content-container img{margin-right:16px;width:26px}.accessibilities-container .accessibility-level-title,.accessibilities-container .accessibility-slope-title,.accessibilities-container .accessibility-width-title,.accessibilities-container .accessibility-signage-title,.accessibilities-container .accessibility-covering-title,.accessibilities-container .accessibility-exposure-title,.accessibilities-container .accessibility-advice-title{color:var(--color-primary);font-size:24px;padding:12px 0px}";
14606
14599
 
14607
14600
  const GrwTrekDetail = class {
14608
14601
  constructor(hostRef) {
14609
14602
  index.registerInstance(this, hostRef);
14610
14603
  this.colorPrimary = '#6b0030';
14611
- this.colorPrimaryTint = '#d2b2c0';
14604
+ this.colorPrimaryShade = '#4a0021';
14605
+ this.colorPrimaryTint = '#974c6e';
14612
14606
  }
14613
14607
  componentWillLoad() {
14614
- this.currentTrek = this.trek ? this.trek : state.currentTrek;
14608
+ this.currentTrek = this.trek ? this.trek : store.state.currentTrek;
14615
14609
  if (this.currentTrek) {
14616
- this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14617
- this.route = state.routes.find(route => route.id === this.currentTrek.route);
14618
- this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14610
+ this.difficulty = store.state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14611
+ this.route = store.state.routes.find(route => route.id === this.currentTrek.route);
14612
+ this.practice = store.state.practices.find(practice => practice.id === this.currentTrek.practice);
14613
+ this.themes = store.state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
14614
+ this.labels = store.state.labels.filter(label => this.currentTrek.labels.includes(label.id));
14615
+ this.sources = store.state.sources.filter(source => this.currentTrek.source.includes(source.id));
14616
+ this.accessibilities = store.state.accessibilities.filter(accessibility => this.currentTrek.accessibilities.includes(accessibility.id));
14617
+ this.accessibilityLevel = store.state.accessibilitiesLevel.find(accessibilityLevel => this.currentTrek.accessibility_level === accessibilityLevel.id);
14619
14618
  }
14620
- onChange('currentTrek', () => {
14621
- this.currentTrek = this.trek ? this.trek : state.currentTrek;
14619
+ store.onChange('currentTrek', () => {
14620
+ this.currentTrek = this.trek ? this.trek : store.state.currentTrek;
14622
14621
  if (this.currentTrek) {
14623
- this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14624
- this.route = state.routes.find(route => route.id === this.currentTrek.route);
14625
- this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
14622
+ this.difficulty = store.state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
14623
+ this.route = store.state.routes.find(route => route.id === this.currentTrek.route);
14624
+ this.practice = store.state.practices.find(practice => practice.id === this.currentTrek.practice);
14625
+ this.themes = store.state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
14626
+ this.labels = store.state.labels.filter(label => this.currentTrek.labels.includes(label.id));
14627
+ this.sources = store.state.sources.filter(source => this.currentTrek.source.includes(source.id));
14626
14628
  }
14627
14629
  });
14628
14630
  }
14629
14631
  render() {
14630
14632
  var _a, _b, _c, _d, _e, _f, _g;
14631
- return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (index.h("div", { class: "trek-detail-container" }, index.h("div", { class: "name" }, this.currentTrek.name), this.currentTrek.attachments && this.currentTrek.attachments[0] && index.h("img", { class: "image", src: this.currentTrek.attachments[0].url, loading: "lazy" }), index.h("div", { class: "sub-container" }, index.h("div", { class: "icons-labels-container" }, index.h("div", { class: "row" }, index.h("div", { class: "icon-label difficulty" }, ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && index.h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
14632
- _b.label), index.h("div", { class: "icon-label duration" }, index.h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration((_c = this.currentTrek) === null || _c === void 0 ? void 0 : _c.duration)), index.h("div", { class: "icon-label route" }, ((_d = this.route) === null || _d === void 0 ? void 0 : _d.pictogram) && index.h("img", { src: this.route.pictogram }), (_e = this.route) === null || _e === void 0 ? void 0 :
14633
- _e.route)), index.h("div", { class: "row" }, index.h("div", { class: "icon-label length" }, index.h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), index.h("div", { class: "icon-label ascent" }, index.h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent)), index.h("div", { class: "icon-label practice" }, ((_f = this.practice) === null || _f === void 0 ? void 0 : _f.pictogram) && index.h("img", { src: this.practice.pictogram }), (_g = this.practice) === null || _g === void 0 ? void 0 :
14634
- _g.name)))), index.h("div", { class: "description", innerHTML: this.currentTrek.description ? this.currentTrek.description : this.currentTrek.description_teaser })))));
14633
+ return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-shade': this.colorPrimaryShade, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (index.h("div", { class: "trek-detail-container" }, index.h("div", { class: "name" }, this.currentTrek.name), this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].thumbnail && (index.h("img", { class: "image", src: this.currentTrek.attachments[0].thumbnail, loading: "lazy" })), index.h("div", { class: "sub-container" }, index.h("div", { class: "icons-labels-container" }, index.h("div", { class: "row" }, index.h("div", { class: "icon-label difficulty" }, ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && index.h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
14634
+ _b.label), index.h("div", { class: "icon-label duration" }, index.h("div", { class: "svg-icon", innerHTML: length.durationImage }), length.formatDuration((_c = this.currentTrek) === null || _c === void 0 ? void 0 : _c.duration)), index.h("div", { class: "icon-label route" }, ((_d = this.route) === null || _d === void 0 ? void 0 : _d.pictogram) && index.h("img", { src: this.route.pictogram }), (_e = this.route) === null || _e === void 0 ? void 0 :
14635
+ _e.route)), index.h("div", { class: "row" }, index.h("div", { class: "icon-label length" }, index.h("div", { class: "svg-icon", innerHTML: length.lengthImage }), length.formatLength(this.currentTrek.length_2d)), index.h("div", { class: "icon-label ascent" }, index.h("div", { class: "svg-icon", innerHTML: length.ascentImage }), length.formatAscent(this.currentTrek.ascent)), index.h("div", { class: "icon-label practice" }, ((_f = this.practice) === null || _f === void 0 ? void 0 : _f.pictogram) && index.h("img", { src: this.practice.pictogram }), (_g = this.practice) === null || _g === void 0 ? void 0 :
14636
+ _g.name)))), index.h("div", { class: "downloads-container" }, index.h("div", { class: "download-title" }, "T\u00E9l\u00E9chargements"), index.h("div", { class: "links-container" }, index.h("a", { href: `${this.currentTrek.gpx}` }, "GPX"), index.h("a", { href: `${this.currentTrek.kml}` }, "KML"), index.h("a", { href: `${this.currentTrek.pdf}` }, "PDF"))), this.themes.length > 0 && (index.h("div", { class: "themes-container" }, this.themes.map(theme => (index.h("div", { class: "theme" }, theme.label))))), this.currentTrek.description_teaser && index.h("div", { class: "description-teaser", innerHTML: this.currentTrek.description_teaser }), this.currentTrek.ambiance && index.h("div", { class: "ambiance", innerHTML: this.currentTrek.ambiance }), this.currentTrek.description && (index.h("div", { class: "description-container" }, index.h("div", { class: "description-title" }, "Description"), index.h("div", { class: "description", innerHTML: this.currentTrek.description }))), this.currentTrek.departure && (index.h("div", { class: "departure-container" }, index.h("div", { class: "departure-title" }, "D\u00E9part :\u00A0"), index.h("div", { innerHTML: this.currentTrek.departure }))), this.currentTrek.arrival && (index.h("div", { class: "arrival-container" }, index.h("div", { class: "arrival-title" }, "Arriv\u00E9e :\u00A0"), index.h("div", { innerHTML: this.currentTrek.arrival }))), this.currentTrek.altimetric_profile && (index.h("div", { class: "altimetric-profile-container" }, index.h("div", { class: "altimetric-profile-title" }, "Profil altim\u00E9trique"), index.h("img", { src: this.currentTrek.altimetric_profile }))), this.currentTrek.access && (index.h("div", { class: "access-container" }, index.h("div", { class: "access-title" }, "Acc\u00E8s routier"), index.h("div", { class: "access", innerHTML: this.currentTrek.access }))), this.currentTrek.public_transport && (index.h("div", { class: "public-transport-container" }, index.h("div", { class: "public-transport-title" }, "Transport"), index.h("div", { class: "public-transport", innerHTML: this.currentTrek.public_transport }))), (this.currentTrek.advice || this.labels.length > 0) && (index.h("div", { class: "advice-container" }, index.h("div", { class: "advice-title" }, "Recommandations"), this.currentTrek.advice && index.h("div", { class: "advice", innerHTML: this.currentTrek.advice }), this.labels.map(label => (index.h("div", { class: "label-container" }, index.h("div", { class: "label-sub-container" }, label.pictogram && index.h("img", { src: label.pictogram }), index.h("div", { class: "label-name", innerHTML: label.name })), index.h("div", { class: "label-advice", innerHTML: label.advice })))))), this.currentTrek.advised_parking && (index.h("div", { class: "advised-parking-container" }, index.h("div", { class: "advised-parking-title" }, "Parking conseill\u00E9"), index.h("div", { class: "advised_parking", innerHTML: this.currentTrek.advised_parking }))), this.currentTrek.gear && (index.h("div", { class: "gear-container" }, index.h("div", { class: "gear-title" }, "\u00C9quipements"), index.h("div", { class: "gear", innerHTML: this.currentTrek.gear }))), store.state.currentSensitiveAreas && store.state.currentSensitiveAreas.length > 0 && (index.h("div", { class: "sensitive-areas-container" }, index.h("div", { class: "sensitive-areas-title" }, "Zones de sensibilit\u00E9 environnementale"), store.state.currentSensitiveAreas.map(sensitiveArea => (index.h("grw-sensitive-area-detail", { sensitiveArea: sensitiveArea }))))), store.state.currentInformationDesks && store.state.currentInformationDesks.length > 0 && (index.h("div", { class: "information-desks-container" }, index.h("div", { class: "information-desks-title" }, "Lieux de renseignement"), store.state.currentInformationDesks.map(informationDesk => (index.h("grw-information-desk-detail", { informationDesk: informationDesk }))))), index.h("div", { class: "accessibilities-container" }, index.h("div", { class: "accessibilities-title" }, "Accessibilit\u00E9"), this.currentTrek.disabled_infrastructure && index.h("div", { innerHTML: this.currentTrek.disabled_infrastructure }), index.h("div", { class: "accessibilities-content-container" }, this.accessibilities.map(accessibility => (index.h("div", { class: "accessibility-content-container" }, index.h("img", { src: accessibility.pictogram }), index.h("div", { innerHTML: accessibility.name }))))), this.currentTrek.accessibility_level && (index.h("div", { class: "accessibility-level-container" }, index.h("div", { class: "accessibility-level-title" }, "Niveau d'accessibilit\u00E9"), index.h("div", { innerHTML: this.accessibilityLevel.name }))), this.currentTrek.accessibility_slope && (index.h("div", { class: "accessibility-slope-container" }, index.h("div", { class: "accessibility-slope-title" }, "Pente"), index.h("div", { innerHTML: this.currentTrek.accessibility_slope }))), this.currentTrek.accessibility_width && (index.h("div", { class: "accessibility-width-container" }, index.h("div", { class: "accessibility-width-title" }, "Largeur"), index.h("div", { innerHTML: this.currentTrek.accessibility_width }))), this.currentTrek.accessibility_signage && (index.h("div", { class: "accessibility-signage-container" }, index.h("div", { class: "accessibility-signage-title" }, "Pente"), index.h("div", { innerHTML: this.currentTrek.accessibility_signage }))), this.currentTrek.accessibility_covering && (index.h("div", { class: "accessibility-covering-container" }, index.h("div", { class: "accessibility-covering-title" }, "Rev\u00EAtement"), index.h("div", { innerHTML: this.currentTrek.accessibility_covering }))), this.currentTrek.accessibility_exposure && (index.h("div", { class: "accessibility-exposure-container" }, index.h("div", { class: "accessibility-exposure-title" }, "Exposition"), index.h("div", { innerHTML: this.currentTrek.accessibility_exposure }))), this.currentTrek.accessibility_advice && (index.h("div", { class: "accessibility-advice-container" }, index.h("div", { class: "accessibility-advice-title" }, "Conseils"), index.h("div", { innerHTML: this.currentTrek.accessibility_advice })))), store.state.currentPois && store.state.currentPois.length > 0 && (index.h("div", { class: "pois-container" }, index.h("div", { class: "pois-title" }, "Points d'int\u00E9r\u00EAts"), store.state.currentPois.map(poi => (index.h("grw-poi-detail", { poi: poi }))))), this.currentTrek.source && this.currentTrek.source.length > 0 && (index.h("div", { class: "source-container" }, index.h("div", { class: "source-title" }, "Sources"), this.sources.map(source => (index.h("div", { class: "source-sub-container" }, source.pictogram && index.h("img", { src: source.pictogram }), index.h("div", null, index.h("div", { class: "source-name", innerHTML: source.name }), index.h("a", { class: "source-advice", innerHTML: source.website })))))))))));
14635
14637
  }
14636
14638
  };
14637
14639
  GrwTrekDetail.style = grwTrekDetailCss;
@@ -14642,50 +14644,80 @@ const GrwTrekProvider = class {
14642
14644
  this.language = 'fr';
14643
14645
  }
14644
14646
  componentWillLoad() {
14645
- state.api = this.api;
14647
+ store.state.api = this.api;
14648
+ const requests = [];
14649
+ requests.push(!store.state.difficulties ? fetch(`${this.api}trek_difficulty/?language=${this.language}&fields=id,label,pictogram`) : new Response('null'));
14650
+ requests.push(!store.state.routes ? fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`) : new Response('null'));
14651
+ requests.push(!store.state.practices ? fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`) : new Response('null'));
14652
+ requests.push(!store.state.themes ? fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`) : new Response('null'));
14646
14653
  return Promise.all([
14647
- fetch(`${this.api}trek_difficulty/?language=${this.language}`),
14648
- fetch(`${this.api}trek_route/?language=${this.language}`),
14649
- fetch(`${this.api}trek_practice/?language=${this.language}`),
14650
- fetch(`${this.api}trek/${this.trekId}/?language=${this.language}&fields=id,name,attachments,description,description_teaser,difficulty,duration,ascent,length_2d,practice,route,geometry`),
14654
+ ...requests,
14655
+ fetch(`${this.api}sensitivearea/?language=${this.language}&published=true&trek=${this.trekId}&fields=id,geometry,name,description,contact,info_url,period,practices`).catch(() => new Response('null')),
14656
+ fetch(`${this.api}label/?language=${this.language}&fields=id,name,advice,pictogram`),
14657
+ fetch(`${this.api}source/?language=${this.language}&fields=id,name,website,pictogram`),
14658
+ fetch(`${this.api}trek_accessibility/?language=${this.language}&fields=id,name,pictogram`),
14659
+ fetch(`${this.api}trek_accessibility_level/?language=${this.language}&fields=id,name`),
14660
+ fetch(`${this.api}poi/?language=${this.language}&trek=${this.trekId}&published=true&fields=id,name,description,attachments,type,type_label,type_pictogram,url,published,geometry&page_size=999`),
14661
+ fetch(`${this.api}informationdesk/?language=${this.language}&near_trek=${this.trekId}&fields=id,name,description,type,phone,email,website,municipality,postal_code,street,photo_url,latitude,longitude&page_size=999`),
14662
+ fetch(`${this.api}trek/${this.trekId}/?language=${this.language}&published=true&fields=id,name,attachments,description,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,geometry,gpx,kml,pdf,parking_location,departure,arrival,altimetric_profile,ambiance,access,public_transport,advice,advised_parking,gear,labels,source,points_reference,disabled_infrastructure,accessibility_level,accessibility_slope,accessibility_width,accessibility_signage,accessibility_covering,accessibility_exposure,accessibility_advice,accessibilities`),
14651
14663
  ])
14652
14664
  .then(responses => Promise.all(responses.map(response => response.json())))
14653
- .then(([difficulties, routes, practices, trek]) => {
14654
- state.difficulties = difficulties.results;
14655
- state.routes = routes.results;
14656
- state.practices = practices.results;
14657
- state.currentTrek = trek;
14665
+ .then(([difficulties, routes, practices, themes, sensitiveAreas, labels, sources, accessibilities, accessibilitiesLevel, pois, informationDesks, trek]) => {
14666
+ if (difficulties) {
14667
+ store.state.difficulties = difficulties.results;
14668
+ }
14669
+ if (routes) {
14670
+ store.state.routes = routes.results;
14671
+ }
14672
+ if (practices) {
14673
+ store.state.practices = practices.results.map(practice => (Object.assign(Object.assign({}, practice), { selected: false })));
14674
+ }
14675
+ if (themes) {
14676
+ store.state.themes = themes.results;
14677
+ }
14678
+ if (sensitiveAreas) {
14679
+ store.state.currentSensitiveAreas = sensitiveAreas.results;
14680
+ }
14681
+ store.state.labels = labels.results;
14682
+ store.state.sources = sources.results;
14683
+ store.state.accessibilities = accessibilities.results;
14684
+ store.state.accessibilitiesLevel = accessibilitiesLevel.results;
14685
+ store.state.currentPois = pois.results;
14686
+ store.state.currentInformationDesks = informationDesks.results;
14687
+ store.state.currentTrek = trek;
14658
14688
  });
14659
14689
  }
14660
14690
  disconnectedCallback() {
14661
- state.currentTrek = null;
14691
+ store.state.currentTrek = null;
14662
14692
  }
14663
14693
  render() {
14664
14694
  return index.h(index.Host, null);
14665
14695
  }
14666
14696
  };
14667
14697
 
14668
- const grwTreksListCss = ":host{display:flex;flex-wrap:wrap;justify-content:space-around;height:100%;max-height:100vh;overflow-y:auto}grw-trek-card{margin:6px}";
14698
+ const grwTreksListCss = ":host{font-family:\"Roboto\";width:100%;height:100%;max-height:100vh;overflow-y:auto}.current-treks-length{width:100%;text-align:center;padding:32px 0px;color:var(--color-primary);font-size:24px;font-weight:bold}.current-treks-container{display:flex;flex-wrap:wrap;justify-content:space-around}grw-trek-card{margin:6px}";
14669
14699
 
14670
14700
  const GrwTreksList = class {
14671
14701
  constructor(hostRef) {
14672
14702
  index.registerInstance(this, hostRef);
14673
14703
  this.treksToDisplay = [];
14674
14704
  this.colorPrimary = '#6b0030';
14675
- this.colorPrimaryTint = '#d2b2c0';
14705
+ this.colorPrimaryTint = '#974c6e';
14706
+ this.isLargeView = false;
14676
14707
  this.handleInfiniteScrollBind = this.handleInfiniteScroll.bind(this);
14677
14708
  this.step = 10;
14678
14709
  }
14679
14710
  componentWillLoad() {
14680
- this.element.addEventListener('scroll', this.handleInfiniteScrollBind);
14681
- onChange('treks', () => {
14682
- this.treksToDisplay = state.treks.slice(0, this.step);
14711
+ store.onChange('currentTreks', () => {
14712
+ this.element.addEventListener('scroll', this.handleInfiniteScrollBind);
14713
+ this.element.scroll({ top: 0 });
14714
+ this.treksToDisplay = [...store.state.currentTreks.slice(0, this.step)];
14683
14715
  });
14684
14716
  }
14685
14717
  handleInfiniteScroll(event) {
14686
14718
  if (event.composedPath()[0].scrollTop + event.composedPath()[0].scrollHeight / 2 >= event.composedPath()[0].scrollHeight) {
14687
- if (this.treksToDisplay.length < state.treks.length) {
14688
- this.treksToDisplay = state.treks.slice(0, this.treksToDisplay.length + this.step >= state.treks.length ? state.treks.length : this.treksToDisplay.length + this.step);
14719
+ if (this.treksToDisplay.length < store.state.treks.length) {
14720
+ this.treksToDisplay = store.state.currentTreks.slice(0, this.treksToDisplay.length + this.step >= store.state.currentTreks.length ? store.state.currentTreks.length : this.treksToDisplay.length + this.step);
14689
14721
  }
14690
14722
  else {
14691
14723
  this.element.removeEventListener('scroll', this.handleInfiniteScrollBind);
@@ -14693,7 +14725,7 @@ const GrwTreksList = class {
14693
14725
  }
14694
14726
  }
14695
14727
  render() {
14696
- return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (index.h("grw-trek-card", { trek: trek, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
14728
+ return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, index.h("div", { class: "current-treks-length" }, `${store.state.currentTreks.length} résultat${store.state.currentTreks.length > 1 ? 's' : ''}`), index.h("div", { class: "current-treks-container" }, this.treksToDisplay.map(trek => (index.h("grw-trek-card", { key: `trek-${trek.id}`, trek: trek, "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint }))))));
14697
14729
  }
14698
14730
  get element() { return index.getElement(this); }
14699
14731
  };
@@ -14705,8 +14737,8 @@ const GrwTreksProvider = class {
14705
14737
  this.language = 'fr';
14706
14738
  }
14707
14739
  componentWillLoad() {
14708
- state.api = this.api;
14709
- let treksRequest = `${this.api}trek/?language=${this.language}`;
14740
+ store.state.api = this.api;
14741
+ let treksRequest = `${this.api}trek/?language=${this.language}&published=true`;
14710
14742
  this.inBbox && (treksRequest += `&in_bbox=${this.inBbox}`);
14711
14743
  this.cities && (treksRequest += `&cities=${this.cities}`);
14712
14744
  this.districts && (treksRequest += `&districts=${this.districts}`);
@@ -14715,19 +14747,28 @@ const GrwTreksProvider = class {
14715
14747
  this.portals && (treksRequest += `&portals=${this.portals}`);
14716
14748
  this.routes && (treksRequest += `&routes=${this.routes}`);
14717
14749
  this.practices && (treksRequest += `&practices=${this.practices}`);
14718
- treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,route,departure_geom&page_size=999`;
14750
+ treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,departure,departure_geom&page_size=999`;
14719
14751
  return Promise.all([
14720
- fetch(`${this.api}trek_difficulty/?language=${this.language}`),
14721
- fetch(`${this.api}trek_route/?language=${this.language}`),
14722
- fetch(`${this.api}trek_practice/?language=${this.language}`),
14752
+ fetch(`${this.api}trek_difficulty/?language=${this.language}&fields=id,label,pictogram`),
14753
+ fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`),
14754
+ fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`),
14755
+ fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`),
14723
14756
  fetch(treksRequest),
14724
14757
  ])
14725
14758
  .then(responses => Promise.all(responses.map(response => response.json())))
14726
- .then(([difficulties, routes, practices, treks]) => {
14727
- state.difficulties = difficulties.results;
14728
- state.routes = routes.results;
14729
- state.practices = practices.results;
14730
- state.treks = treks.results;
14759
+ .then(([difficulties, routes, practices, themes, treks]) => {
14760
+ store.state.difficulties = difficulties.results;
14761
+ store.state.routes = routes.results;
14762
+ store.state.practices = practices.results.map(practice => (Object.assign(Object.assign({}, practice), { selected: false })));
14763
+ store.state.themes = themes.results;
14764
+ store.state.durations = [
14765
+ { id: 1, name: '0 - 1h', minValue: 0, maxValue: 1, selected: false },
14766
+ { id: 2, name: '1 - 2h', minValue: 1, maxValue: 2, selected: false },
14767
+ { id: 3, name: '2 - 5h', minValue: 2, maxValue: 5, selected: false },
14768
+ { id: 4, name: '5 - 10h', minValue: 5, maxValue: 10, selected: false },
14769
+ ];
14770
+ store.state.treks = treks.results;
14771
+ store.state.currentTreks = treks.results;
14731
14772
  });
14732
14773
  }
14733
14774
  render() {
@@ -14735,9 +14776,8 @@ const GrwTreksProvider = class {
14735
14776
  }
14736
14777
  };
14737
14778
 
14738
- exports.grw_app = GrwApp;
14779
+ exports.grw_filter = GrwFilter;
14739
14780
  exports.grw_map = GrwMap;
14740
- exports.grw_trek_card = GrwTrekCard;
14741
14781
  exports.grw_trek_detail = GrwTrekDetail;
14742
14782
  exports.grw_trek_provider = GrwTrekProvider;
14743
14783
  exports.grw_treks_list = GrwTreksList;