@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
@@ -0,0 +1,46 @@
1
+ import { r as registerInstance, h, H as Host } from './index-192d910f.js';
2
+ import { s as state } from './store-5a42b5d8.js';
3
+
4
+ const grwInformationDeskDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.information-desk-img{width:180px}.information-desk-img img{width:180px;border-radius:8px}.information-desk-sub-container{display:flex;flex-direction:column}.information-desk-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.information-desk-description{font-size:16px}";
5
+
6
+ const GrwInformationDeskDetail = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ }
10
+ render() {
11
+ return (h(Host, null, this.informationDesk.photo_url && (h("div", { class: "information-desk-img" }, h("img", { src: this.informationDesk.photo_url, loading: "lazy" }))), h("div", { class: "information-desk-sub-container" }, this.informationDesk.name && h("div", { class: "information-desk-name" }, this.informationDesk.name), this.informationDesk.description && h("div", { class: "information-desk-description", innerHTML: this.informationDesk.description }), this.informationDesk.postal_code ||
12
+ this.informationDesk.municipality ||
13
+ (this.informationDesk.street && (h("div", null, this.informationDesk.postal_code, ` ${this.informationDesk.municipality}`, ` ${this.informationDesk.street}`))), this.informationDesk.phone && (h("div", null, h("a", { href: `tel:${this.informationDesk.phone}` }, this.informationDesk.phone))), this.informationDesk.email && (h("div", null, h("a", { href: `mailto:${this.informationDesk.email}` }, this.informationDesk.email))), this.informationDesk.website && (h("div", null, h("a", { href: `${this.informationDesk.website}` }, this.informationDesk.website))))));
14
+ }
15
+ };
16
+ GrwInformationDeskDetail.style = grwInformationDeskDetailCss;
17
+
18
+ const grwPoiDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.poi-img{width:180px}.poi-img img{width:180px;border-radius:8px}.poi-sub-container{display:flex;flex-direction:column}.poi-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.poi-description{font-size:16px}";
19
+
20
+ const GrwPoiDetail = class {
21
+ constructor(hostRef) {
22
+ registerInstance(this, hostRef);
23
+ }
24
+ render() {
25
+ return (h(Host, null, this.poi.attachments && this.poi.attachments[0] && this.poi.attachments[0].thumbnail && (h("div", { class: "poi-img" }, h("img", { src: this.poi.attachments[0].thumbnail, loading: "lazy" }))), h("div", { class: "poi-sub-container" }, h("div", { class: "poi-name" }, this.poi.name), h("div", { class: "poi-description", innerHTML: this.poi.description }))));
26
+ }
27
+ };
28
+ GrwPoiDetail.style = grwPoiDetailCss;
29
+
30
+ const grwSensitiveAreaDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.sensitive-area-title{color:var(--color-primary);font-size:24px;padding:12px 0px}.sensitive-area-description{font-size:16px}.sensitive-area-period-container .sensitive-area-period-title,.sensitive-area-period-container .sensitive-area-practice-title,.sensitive-area-period-container .sensitive-area-contact-title,.sensitive-area-practice-container .sensitive-area-period-title,.sensitive-area-practice-container .sensitive-area-practice-title,.sensitive-area-practice-container .sensitive-area-contact-title,.sensitive-area-contact-container .sensitive-area-period-title,.sensitive-area-contact-container .sensitive-area-practice-title,.sensitive-area-contact-container .sensitive-area-contact-title{color:var(--color-primary);font-size:24px;padding:12px 0px}.sensitive-area-period-container .sensitive-area-period-values,.sensitive-area-period-container .sensitive-area-practice-values,.sensitive-area-practice-container .sensitive-area-period-values,.sensitive-area-practice-container .sensitive-area-practice-values,.sensitive-area-contact-container .sensitive-area-period-values,.sensitive-area-contact-container .sensitive-area-practice-values{display:flex}";
31
+
32
+ const GrwSensitiveAreaDetail = class {
33
+ constructor(hostRef) {
34
+ registerInstance(this, hostRef);
35
+ }
36
+ render() {
37
+ return (h(Host, null, h("div", { class: "sensitive-area-title" }, this.sensitiveArea.name), h("div", { class: "sensitive-area-description", innerHTML: this.sensitiveArea.description }), this.sensitiveArea.practices && this.sensitiveArea.practices.length > 0 && (h("div", { class: "sensitive-area-practice-container" }, h("div", { class: "sensitive-area-practice-title" }, "Domaines d'activit\u00E9s concern\u00E9s :"), h("div", { class: "sensitive-area-practice-values" }, this.sensitiveArea.practices.map((practice, index) => (h("div", { innerHTML: `${state.practices.find(statePractice => statePractice.id === practice).name.toUpperCase()}${index + 1 !== this.sensitiveArea.practices.length ? ' - ' : ''}` })))))), this.sensitiveArea.period && this.sensitiveArea.period.length > 0 && (h("div", { class: "sensitive-area-period-container" }, h("div", { class: "sensitive-area-period-title" }, "P\u00E9riodes de sensibilit\u00E9"), h("div", { class: "sensitive-area-period-values" }, this.sensitiveArea.period.map((month, index) => {
38
+ if (month) {
39
+ return (h("div", { innerHTML: `${new Date(0, index + 1, 0).toLocaleDateString('fr', { month: 'long' }).toUpperCase()}${this.sensitiveArea.period.slice(index + 1).find(month => month) ? ' - ' : ''}` }));
40
+ }
41
+ })))), h("div", { class: "sensitive-area-contact-container" }, h("div", { class: "sensitive-area-contact-title" }, "Contact"), h("div", { innerHTML: this.sensitiveArea.contact, class: "sensitive-area-contact-value" }))));
42
+ }
43
+ };
44
+ GrwSensitiveAreaDetail.style = grwSensitiveAreaDetailCss;
45
+
46
+ export { GrwInformationDeskDetail as grw_information_desk_detail, GrwPoiDetail as grw_poi_detail, GrwSensitiveAreaDetail as grw_sensitive_area_detail };
@@ -0,0 +1,43 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-192d910f.js';
2
+ import { s as state, o as onChange } from './store-5a42b5d8.js';
3
+ import { d as durationImage, f as formatDuration, l as lengthImage, a as formatLength, b as ascentImage, c as formatAscent } from './length-d82189db.js';
4
+
5
+ const grwTrekCardCss = ".trek-card-container,.trek-card-large-view-container{font-family:\"Roboto\";border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:flex;flex-direction:column;justify-content:center;padding:12px}.trek-card-container .sub-container .name,.trek-card-large-view-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:8px}.trek-card-container .sub-container .departure,.trek-card-large-view-container .sub-container .departure{color:rgba(0, 0, 0, 0.7);font-size:16px;margin:4px 0px}.trek-card-container .sub-container .themes-container,.trek-card-large-view-container .sub-container .themes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .themes-container .theme,.trek-card-large-view-container .sub-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-card-container .sub-container .icons-labels-container,.trek-card-large-view-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,.trek-card-large-view-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),.trek-card-large-view-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label{display:flex;align-items:center;width:50%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2),.trek-card-large-view-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,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:8px}.trek-card-container .sub-container .icons-labels-container .row .practice img,.trek-card-large-view-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-card-container{width:350px;height:auto}.trek-card-container .image{width:100%}.trek-card-large-view-container{height:auto;display:flex;flex-direction:row}.trek-card-large-view-container .image{width:250px}";
6
+
7
+ const GrwTrekCard = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.trekCardPress = createEvent(this, "trekCardPress", 7);
11
+ this.colorPrimary = '#6b0030';
12
+ this.colorPrimaryTint = '#974c6e';
13
+ this.isLargeView = false;
14
+ }
15
+ componentWillLoad() {
16
+ this.currentTrek = this.trek ? this.trek : state.currentTrek;
17
+ if (this.currentTrek) {
18
+ this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
19
+ this.route = state.routes.find(route => route.id === this.currentTrek.route);
20
+ this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
21
+ this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
22
+ }
23
+ onChange('currentTrek', () => {
24
+ this.currentTrek = this.trek ? this.trek : state.currentTrek;
25
+ if (this.currentTrek) {
26
+ this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
27
+ this.route = state.routes.find(route => route.id === this.currentTrek.route);
28
+ this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
29
+ this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
30
+ }
31
+ });
32
+ }
33
+ render() {
34
+ var _a, _b, _c, _d, _e, _f, _g, _h;
35
+ return (h(Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id), style: { 'width': this.isLargeView ? '100%' : 'auto', '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: this.isLargeView ? 'trek-card-large-view-container' : 'trek-card-container' }, this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].thumbnail && (h("img", { class: "image", src: `${this.currentTrek.attachments[0].thumbnail}`, loading: "lazy" })), h("div", { class: "sub-container" }, h("div", { class: "departure" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.departure), h("div", { class: "name" }, (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.name), h("div", { class: "themes-container" }, this.themes.map(theme => (h("div", { class: "theme" }, theme.label)))), h("div", { class: "icons-labels-container" }, h("div", { class: "row" }, h("div", { class: "icon-label difficulty" }, ((_c = this.difficulty) === null || _c === void 0 ? void 0 : _c.pictogram) && h("img", { src: this.difficulty.pictogram }), (_d = this.difficulty) === null || _d === void 0 ? void 0 :
36
+ _d.label), h("div", { class: "icon-label duration" }, h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration(this.currentTrek.duration))), h("div", { class: "row" }, h("div", { class: "icon-label length" }, h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), h("div", { class: "icon-label ascent" }, h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent))), h("div", { class: "row" }, h("div", { class: "icon-label route" }, ((_e = this.route) === null || _e === void 0 ? void 0 : _e.pictogram) && h("img", { src: this.route.pictogram }), (_f = this.route) === null || _f === void 0 ? void 0 :
37
+ _f.route), h("div", { class: "icon-label practice" }, ((_g = this.practice) === null || _g === void 0 ? void 0 : _g.pictogram) && h("img", { src: this.practice.pictogram }), (_h = this.practice) === null || _h === void 0 ? void 0 :
38
+ _h.name))))))));
39
+ }
40
+ };
41
+ GrwTrekCard.style = grwTrekCardCss;
42
+
43
+ export { GrwTrekCard as grw_trek_card };
@@ -167,6 +167,7 @@ const isComplexType = (o) => {
167
167
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
168
168
  const h = (nodeName, vnodeData, ...children) => {
169
169
  let child = null;
170
+ let key = null;
170
171
  let simple = false;
171
172
  let lastSimple = false;
172
173
  const vNodeChildren = [];
@@ -194,6 +195,10 @@ const h = (nodeName, vnodeData, ...children) => {
194
195
  };
195
196
  walk(children);
196
197
  if (vnodeData) {
198
+ // normalize class / classname attributes
199
+ if (vnodeData.key) {
200
+ key = vnodeData.key;
201
+ }
197
202
  {
198
203
  const classData = vnodeData.className || vnodeData.class;
199
204
  if (classData) {
@@ -211,6 +216,9 @@ const h = (nodeName, vnodeData, ...children) => {
211
216
  if (vNodeChildren.length > 0) {
212
217
  vnode.$children$ = vNodeChildren;
213
218
  }
219
+ {
220
+ vnode.$key$ = key;
221
+ }
214
222
  return vnode;
215
223
  };
216
224
  const newVNode = (tag, text) => {
@@ -224,6 +232,9 @@ const newVNode = (tag, text) => {
224
232
  {
225
233
  vnode.$attrs$ = null;
226
234
  }
235
+ {
236
+ vnode.$key$ = null;
237
+ }
227
238
  return vnode;
228
239
  };
229
240
  const Host = {};
@@ -272,6 +283,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
272
283
  }
273
284
  }
274
285
  }
286
+ else if (memberName === 'key')
287
+ ;
275
288
  else if ((!isProp ) &&
276
289
  memberName[0] === 'o' &&
277
290
  memberName[1] === 'n') {
@@ -436,6 +449,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
436
449
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
437
450
  let oldStartIdx = 0;
438
451
  let newStartIdx = 0;
452
+ let idxInOld = 0;
453
+ let i = 0;
439
454
  let oldEndIdx = oldCh.length - 1;
440
455
  let oldStartVnode = oldCh[0];
441
456
  let oldEndVnode = oldCh[oldEndIdx];
@@ -443,6 +458,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
443
458
  let newStartVnode = newCh[0];
444
459
  let newEndVnode = newCh[newEndIdx];
445
460
  let node;
461
+ let elmToMove;
446
462
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
447
463
  if (oldStartVnode == null) {
448
464
  // Vnode might have been moved left
@@ -480,7 +496,29 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
480
496
  newStartVnode = newCh[++newStartIdx];
481
497
  }
482
498
  else {
499
+ // createKeyToOldIdx
500
+ idxInOld = -1;
483
501
  {
502
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
503
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
504
+ idxInOld = i;
505
+ break;
506
+ }
507
+ }
508
+ }
509
+ if (idxInOld >= 0) {
510
+ elmToMove = oldCh[idxInOld];
511
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
512
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
513
+ }
514
+ else {
515
+ patch(elmToMove, newStartVnode);
516
+ oldCh[idxInOld] = undefined;
517
+ node = elmToMove.$elm$;
518
+ }
519
+ newStartVnode = newCh[++newStartIdx];
520
+ }
521
+ else {
484
522
  // new element
485
523
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
486
524
  newStartVnode = newCh[++newStartIdx];
@@ -503,7 +541,9 @@ const isSameVnode = (vnode1, vnode2) => {
503
541
  // compare if two vnode to see if they're "technically" the same
504
542
  // need to have the same element tag, and same key to be the same
505
543
  if (vnode1.$tag$ === vnode2.$tag$) {
506
- return true;
544
+ {
545
+ return vnode1.$key$ === vnode2.$key$;
546
+ }
507
547
  }
508
548
  return false;
509
549
  };
@@ -793,6 +833,11 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
793
833
  const parsePropertyValue = (propValue, propType) => {
794
834
  // ensure this value is of the correct prop type
795
835
  if (propValue != null && !isComplexType(propValue)) {
836
+ if (propType & 4 /* Boolean */) {
837
+ // per the HTML spec, any string value means it is a boolean true value
838
+ // but we'll cheat here and say that the string "false" is the boolean false
839
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
840
+ }
796
841
  if (propType & 2 /* Number */) {
797
842
  // force it to be a number
798
843
  return parseFloat(propValue);
@@ -1265,4 +1310,4 @@ const flush = () => {
1265
1310
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1266
1311
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1267
1312
 
1268
- export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getRenderingRef as g, h, promiseResolve as p, registerInstance as r };
1313
+ export { Host as H, getRenderingRef as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r };
@@ -0,0 +1,27 @@
1
+ function formatDuration(duration) {
2
+ let formattedDuration;
3
+ if (duration < 24) {
4
+ formattedDuration = `${Math.floor(duration)}h`;
5
+ if (duration % 1 > 0) {
6
+ formattedDuration += `${Math.round(60 * (duration % 1))}min`;
7
+ }
8
+ }
9
+ else {
10
+ formattedDuration = `${duration / 24}j`;
11
+ }
12
+ return formattedDuration;
13
+ }
14
+ function formatLength(length) {
15
+ return `${Math.round(length / 1000)}km`;
16
+ }
17
+ function formatAscent(ascent) {
18
+ return `${ascent}m`;
19
+ }
20
+
21
+ 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>`;
22
+
23
+ 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>`;
24
+
25
+ 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>`;
26
+
27
+ export { formatLength as a, ascentImage as b, formatAscent as c, durationImage as d, formatDuration as f, lengthImage as l };
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-7aa9e822.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-192d910f.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["grw-app_7",[[1,"grw-app",{"api":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1],"appName":[1,"app-name"],"urlLayer":[1,"url-layer"],"center":[1],"zoom":[8],"attribution":[1],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"showTrek":[32],"showMap":[32],"isLargeView":[32],"currentTrekId":[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]],[1,"grw-treks-list",{"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"treksToDisplay":[32]}],[0,"grw-map",{"urlLayer":[1,"url-layer"],"attribution":[1],"center":[1],"zoom":[2],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"mapIsReady":[32]}],[1,"grw-trek-detail",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32]}],[1,"grw-trek-provider",{"language":[1],"api":[1],"trekId":[1,"trek-id"]}],[1,"grw-treks-provider",{"language":[1],"api":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1]}],[1,"grw-trek-card",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32]}]]]], options);
13
+ return bootstrapLazy([["grw-trek-card",[[1,"grw-trek-card",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"isLargeView":[4,"is-large-view"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32],"themes":[32]}]]],["grw-information-desk-detail_3",[[1,"grw-information-desk-detail",{"informationDesk":[16]}],[1,"grw-poi-detail",{"poi":[16]}],[1,"grw-sensitive-area-detail",{"sensitiveArea":[16]}]]],["grw-filter_6",[[1,"grw-trek-detail",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryShade":[1,"color-primary-shade"],"colorPrimaryTint":[1,"color-primary-tint"],"difficulty":[32],"route":[32],"practice":[32],"themes":[32],"labels":[32],"sources":[32],"accessibilities":[32],"accessibilityLevel":[32],"currentTrek":[32]}],[1,"grw-treks-list",{"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"isLargeView":[4,"is-large-view"],"treksToDisplay":[32]}],[1,"grw-filter",{"filterType":[1,"filter-type"],"filterName":[1,"filter-name"],"filterNameProperty":[1,"filter-name-property"]}],[0,"grw-map",{"urlLayer":[1,"url-layer"],"attribution":[1],"center":[1],"zoom":[2],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"colorSensitiveArea":[1,"color-sensitive-area"],"colorPoiIcon":[1,"color-poi-icon"],"mapIsReady":[32]}],[1,"grw-trek-provider",{"language":[1],"api":[1],"trekId":[1,"trek-id"]}],[1,"grw-treks-provider",{"language":[1],"api":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1]}]]],["grw-app",[[1,"grw-app",{"api":[1],"language":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1],"urlLayer":[1,"url-layer"],"center":[1],"zoom":[8],"attribution":[1],"colorPrimary":[1,"color-primary"],"colorPrimaryShade":[1,"color-primary-shade"],"colorPrimaryTint":[1,"color-primary-tint"],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"colorSensitiveArea":[1,"color-sensitive-area"],"colorPoiIcon":[1,"color-poi-icon"],"showTrek":[32],"showTreksMap":[32],"showTrekMap":[32],"showFilters":[32],"isLargeView":[32],"currentTrekId":[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -0,0 +1,206 @@
1
+ import { a as getRenderingRef, f as forceUpdate } from './index-192d910f.js';
2
+
3
+ const appendToMap = (map, propName, value) => {
4
+ const items = map.get(propName);
5
+ if (!items) {
6
+ map.set(propName, [value]);
7
+ }
8
+ else if (!items.includes(value)) {
9
+ items.push(value);
10
+ }
11
+ };
12
+ const debounce = (fn, ms) => {
13
+ let timeoutId;
14
+ return (...args) => {
15
+ if (timeoutId) {
16
+ clearTimeout(timeoutId);
17
+ }
18
+ timeoutId = setTimeout(() => {
19
+ timeoutId = 0;
20
+ fn(...args);
21
+ }, ms);
22
+ };
23
+ };
24
+
25
+ /**
26
+ * Check if a possible element isConnected.
27
+ * The property might not be there, so we check for it.
28
+ *
29
+ * We want it to return true if isConnected is not a property,
30
+ * otherwise we would remove these elements and would not update.
31
+ *
32
+ * Better leak in Edge than to be useless.
33
+ */
34
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
35
+ const cleanupElements = debounce((map) => {
36
+ for (let key of map.keys()) {
37
+ map.set(key, map.get(key).filter(isConnected));
38
+ }
39
+ }, 2000);
40
+ const stencilSubscription = () => {
41
+ if (typeof getRenderingRef !== 'function') {
42
+ // If we are not in a stencil project, we do nothing.
43
+ // This function is not really exported by @stencil/core.
44
+ return {};
45
+ }
46
+ const elmsToUpdate = new Map();
47
+ return {
48
+ dispose: () => elmsToUpdate.clear(),
49
+ get: (propName) => {
50
+ const elm = getRenderingRef();
51
+ if (elm) {
52
+ appendToMap(elmsToUpdate, propName, elm);
53
+ }
54
+ },
55
+ set: (propName) => {
56
+ const elements = elmsToUpdate.get(propName);
57
+ if (elements) {
58
+ elmsToUpdate.set(propName, elements.filter(forceUpdate));
59
+ }
60
+ cleanupElements(elmsToUpdate);
61
+ },
62
+ reset: () => {
63
+ elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
64
+ cleanupElements(elmsToUpdate);
65
+ },
66
+ };
67
+ };
68
+
69
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
70
+ let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
71
+ const handlers = {
72
+ dispose: [],
73
+ get: [],
74
+ set: [],
75
+ reset: [],
76
+ };
77
+ const reset = () => {
78
+ states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
79
+ handlers.reset.forEach((cb) => cb());
80
+ };
81
+ const dispose = () => {
82
+ // Call first dispose as resetting the state would
83
+ // cause less updates ;)
84
+ handlers.dispose.forEach((cb) => cb());
85
+ reset();
86
+ };
87
+ const get = (propName) => {
88
+ handlers.get.forEach((cb) => cb(propName));
89
+ return states.get(propName);
90
+ };
91
+ const set = (propName, value) => {
92
+ const oldValue = states.get(propName);
93
+ if (shouldUpdate(value, oldValue, propName)) {
94
+ states.set(propName, value);
95
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
96
+ }
97
+ };
98
+ const state = (typeof Proxy === 'undefined'
99
+ ? {}
100
+ : new Proxy(defaultState, {
101
+ get(_, propName) {
102
+ return get(propName);
103
+ },
104
+ ownKeys(_) {
105
+ return Array.from(states.keys());
106
+ },
107
+ getOwnPropertyDescriptor() {
108
+ return {
109
+ enumerable: true,
110
+ configurable: true,
111
+ };
112
+ },
113
+ has(_, propName) {
114
+ return states.has(propName);
115
+ },
116
+ set(_, propName, value) {
117
+ set(propName, value);
118
+ return true;
119
+ },
120
+ }));
121
+ const on = (eventName, callback) => {
122
+ handlers[eventName].push(callback);
123
+ return () => {
124
+ removeFromArray(handlers[eventName], callback);
125
+ };
126
+ };
127
+ const onChange = (propName, cb) => {
128
+ const unSet = on('set', (key, newValue) => {
129
+ if (key === propName) {
130
+ cb(newValue);
131
+ }
132
+ });
133
+ const unReset = on('reset', () => cb(defaultState[propName]));
134
+ return () => {
135
+ unSet();
136
+ unReset();
137
+ };
138
+ };
139
+ const use = (...subscriptions) => {
140
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
141
+ if (subscription.set) {
142
+ unsubs.push(on('set', subscription.set));
143
+ }
144
+ if (subscription.get) {
145
+ unsubs.push(on('get', subscription.get));
146
+ }
147
+ if (subscription.reset) {
148
+ unsubs.push(on('reset', subscription.reset));
149
+ }
150
+ if (subscription.dispose) {
151
+ unsubs.push(on('dispose', subscription.dispose));
152
+ }
153
+ return unsubs;
154
+ }, []);
155
+ return () => unsubs.forEach((unsub) => unsub());
156
+ };
157
+ const forceUpdate = (key) => {
158
+ const oldValue = states.get(key);
159
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
160
+ };
161
+ return {
162
+ state,
163
+ get,
164
+ set,
165
+ on,
166
+ onChange,
167
+ use,
168
+ dispose,
169
+ reset,
170
+ forceUpdate,
171
+ };
172
+ };
173
+ const removeFromArray = (array, item) => {
174
+ const index = array.indexOf(item);
175
+ if (index >= 0) {
176
+ array[index] = array[array.length - 1];
177
+ array.length--;
178
+ }
179
+ };
180
+
181
+ const createStore = (defaultState, shouldUpdate) => {
182
+ const map = createObservableMap(defaultState, shouldUpdate);
183
+ map.use(stencilSubscription());
184
+ return map;
185
+ };
186
+
187
+ const { state, onChange } = createStore({
188
+ api: '',
189
+ treks: [],
190
+ currentTreks: [],
191
+ difficulties: [],
192
+ routes: [],
193
+ practices: [],
194
+ themes: [],
195
+ durations: [],
196
+ currentSensitiveAreas: null,
197
+ labels: null,
198
+ sources: null,
199
+ accessibilities: null,
200
+ accessibilitiesLevel: null,
201
+ currentTrek: null,
202
+ currentPois: null,
203
+ currentInformationDesks: null,
204
+ });
205
+
206
+ export { onChange as o, state as s };
@@ -1 +1 @@
1
- @import url("https://fonts.googleapis.com/css2?family=Roboto");:root{--color-primary:#6b0030;--color-primary-tint:#d2b2c0;--color-departure-icon:#006b3b;--color-arrival-icon:#85003b}body{font-family:"Roboto"}
1
+ @import url("https://fonts.googleapis.com/css2?family=Roboto");
@@ -1 +1 @@
1
- import{p as r,b as o}from"./p-332ba9ab.js";(()=>{const o=import.meta.url,i={};return""!==o&&(i.resourcesUrl=new URL(".",o).href),r(i)})().then((r=>o([["p-b7c66d2d",[[1,"grw-app",{api:[1],inBbox:[1,"in-bbox"],cities:[1],districts:[1],structures:[1],themes:[1],portals:[1],routes:[1],practices:[1],appName:[1,"app-name"],urlLayer:[1,"url-layer"],center:[1],zoom:[8],attribution:[1],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],colorTrekLine:[1,"color-trek-line"],colorDepartureIcon:[1,"color-departure-icon"],colorArrivalIcon:[1,"color-arrival-icon"],showTrek:[32],showMap:[32],isLargeView:[32],currentTrekId:[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]],[1,"grw-treks-list",{colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],treksToDisplay:[32]}],[0,"grw-map",{urlLayer:[1,"url-layer"],attribution:[1],center:[1],zoom:[2],colorTrekLine:[1,"color-trek-line"],colorDepartureIcon:[1,"color-departure-icon"],colorArrivalIcon:[1,"color-arrival-icon"],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],mapIsReady:[32]}],[1,"grw-trek-detail",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],currentTrek:[32],difficulty:[32],route:[32],practice:[32]}],[1,"grw-trek-provider",{language:[1],api:[1],trekId:[1,"trek-id"]}],[1,"grw-treks-provider",{language:[1],api:[1],inBbox:[1,"in-bbox"],cities:[1],districts:[1],structures:[1],themes:[1],portals:[1],routes:[1],practices:[1]}],[1,"grw-trek-card",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],currentTrek:[32],difficulty:[32],route:[32],practice:[32]}]]]],r)));
1
+ import{p as r,b as e}from"./p-6dce5e6c.js";(()=>{const e=import.meta.url,o={};return""!==e&&(o.resourcesUrl=new URL(".",e).href),r(o)})().then((r=>e([["p-2d9ae918",[[1,"grw-trek-card",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],isLargeView:[4,"is-large-view"],currentTrek:[32],difficulty:[32],route:[32],practice:[32],themes:[32]}]]],["p-d3aa9819",[[1,"grw-information-desk-detail",{informationDesk:[16]}],[1,"grw-poi-detail",{poi:[16]}],[1,"grw-sensitive-area-detail",{sensitiveArea:[16]}]]],["p-206a52d9",[[1,"grw-trek-detail",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryShade:[1,"color-primary-shade"],colorPrimaryTint:[1,"color-primary-tint"],difficulty:[32],route:[32],practice:[32],themes:[32],labels:[32],sources:[32],accessibilities:[32],accessibilityLevel:[32],currentTrek:[32]}],[1,"grw-treks-list",{colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],isLargeView:[4,"is-large-view"],treksToDisplay:[32]}],[1,"grw-filter",{filterType:[1,"filter-type"],filterName:[1,"filter-name"],filterNameProperty:[1,"filter-name-property"]}],[0,"grw-map",{urlLayer:[1,"url-layer"],attribution:[1],center:[1],zoom:[2],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],colorTrekLine:[1,"color-trek-line"],colorDepartureIcon:[1,"color-departure-icon"],colorArrivalIcon:[1,"color-arrival-icon"],colorSensitiveArea:[1,"color-sensitive-area"],colorPoiIcon:[1,"color-poi-icon"],mapIsReady:[32]}],[1,"grw-trek-provider",{language:[1],api:[1],trekId:[1,"trek-id"]}],[1,"grw-treks-provider",{language:[1],api:[1],inBbox:[1,"in-bbox"],cities:[1],districts:[1],structures:[1],themes:[1],portals:[1],routes:[1],practices:[1]}]]],["p-8cfa03c0",[[1,"grw-app",{api:[1],language:[1],inBbox:[1,"in-bbox"],cities:[1],districts:[1],structures:[1],themes:[1],portals:[1],routes:[1],practices:[1],urlLayer:[1,"url-layer"],center:[1],zoom:[8],attribution:[1],colorPrimary:[1,"color-primary"],colorPrimaryShade:[1,"color-primary-shade"],colorPrimaryTint:[1,"color-primary-tint"],colorTrekLine:[1,"color-trek-line"],colorDepartureIcon:[1,"color-departure-icon"],colorArrivalIcon:[1,"color-arrival-icon"],colorSensitiveArea:[1,"color-sensitive-area"],colorPoiIcon:[1,"color-poi-icon"],showTrek:[32],showTreksMap:[32],showTrekMap:[32],showFilters:[32],isLargeView:[32],currentTrekId:[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]]]]],r)));