@geotrekce/geotrek-rando-widget 0.0.13 → 0.0.14

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 (94) hide show
  1. package/dist/cjs/{css-shim-6f592941.js → css-shim-06c204c1.js} +1 -1
  2. package/dist/cjs/{dom-d5e52c7e.js → dom-874a1e39.js} +1 -1
  3. package/dist/cjs/geotrek-rando-widget.cjs.js +4 -4
  4. package/dist/cjs/grw-app.cjs.entry.js +4 -3
  5. package/dist/cjs/grw-filter_6.cjs.entry.js +14447 -14156
  6. package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +2 -2
  7. package/dist/cjs/grw-trek-card.cjs.entry.js +15 -7
  8. package/dist/cjs/{index-66d58516.js → index-c3fb4999.js} +219 -66
  9. package/dist/cjs/loader.cjs.js +4 -4
  10. package/dist/cjs/{shadow-css-cf936b02.js → shadow-css-a33dc836.js} +1 -1
  11. package/dist/cjs/{store-d301af22.js → store-5183d8f8.js} +4 -2
  12. package/dist/collection/collection-manifest.json +2 -2
  13. package/dist/collection/components/grw-app/grw-app.js +432 -450
  14. package/dist/collection/components/grw-filter/grw-filter.js +65 -61
  15. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +35 -44
  16. package/dist/collection/components/grw-map/grw-map.css +5 -4
  17. package/dist/collection/components/grw-map/grw-map.js +251 -217
  18. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +33 -32
  19. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +42 -47
  20. package/dist/collection/components/grw-trek-card/grw-trek-card.js +142 -129
  21. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +135 -208
  22. package/dist/collection/components/grw-treks-list/grw-treks-list.js +95 -65
  23. package/dist/collection/store/grw-trek-provider.js +61 -55
  24. package/dist/collection/store/grw-treks-provider.js +181 -177
  25. package/dist/collection/store/store.js +3 -2
  26. package/dist/components/grw-app.js +3 -2
  27. package/dist/components/grw-map2.js +14405 -14129
  28. package/dist/components/grw-trek-card2.js +17 -7
  29. package/dist/components/grw-trek-detail2.js +10 -3
  30. package/dist/components/grw-trek-provider2.js +6 -2
  31. package/dist/components/grw-treks-list2.js +7 -2
  32. package/dist/components/grw-treks-provider2.js +5 -3
  33. package/dist/components/store.js +3 -2
  34. package/dist/esm/{css-shim-2d0a698c.js → css-shim-bfa379cd.js} +1 -1
  35. package/dist/esm/{dom-9794f747.js → dom-104fb833.js} +1 -1
  36. package/dist/esm/geotrek-rando-widget.js +4 -4
  37. package/dist/esm/grw-app.entry.js +4 -3
  38. package/dist/esm/grw-filter_6.entry.js +14427 -14136
  39. package/dist/esm/grw-information-desk-detail_3.entry.js +2 -2
  40. package/dist/esm/grw-trek-card.entry.js +15 -7
  41. package/dist/esm/{index-899307bb.js → index-e834943f.js} +219 -66
  42. package/dist/esm/loader.js +4 -4
  43. package/dist/esm/{shadow-css-4cd4480f.js → shadow-css-4261c637.js} +1 -1
  44. package/dist/esm/{store-70461a28.js → store-c6ccb3db.js} +4 -3
  45. package/dist/esm-es5/{css-shim-2d0a698c.js → css-shim-bfa379cd.js} +0 -0
  46. package/dist/esm-es5/{dom-9794f747.js → dom-104fb833.js} +0 -0
  47. package/dist/esm-es5/geotrek-rando-widget.js +1 -1
  48. package/dist/esm-es5/grw-app.entry.js +1 -1
  49. package/dist/esm-es5/grw-filter_6.entry.js +4 -5
  50. package/dist/esm-es5/grw-information-desk-detail_3.entry.js +1 -1
  51. package/dist/esm-es5/grw-trek-card.entry.js +1 -1
  52. package/dist/esm-es5/{index-899307bb.js → index-e834943f.js} +1 -1
  53. package/dist/esm-es5/loader.js +1 -1
  54. package/dist/esm-es5/{shadow-css-4cd4480f.js → shadow-css-4261c637.js} +0 -0
  55. package/dist/esm-es5/{store-70461a28.js → store-c6ccb3db.js} +1 -1
  56. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  57. package/dist/geotrek-rando-widget/geotrek-rando-widget.js +1 -1
  58. package/dist/geotrek-rando-widget/p-392538a1.system.entry.js +1 -0
  59. package/dist/geotrek-rando-widget/{p-d1582cff.js → p-4c61dcad.js} +0 -0
  60. package/dist/geotrek-rando-widget/p-4e0fcbe6.js +1 -0
  61. package/dist/geotrek-rando-widget/p-6469fc8a.system.js +1 -0
  62. package/dist/geotrek-rando-widget/{p-c8c96517.system.js → p-6523a23b.system.js} +0 -0
  63. package/dist/geotrek-rando-widget/{p-32d97a4f.system.js → p-70ecdd1b.system.js} +0 -0
  64. package/dist/geotrek-rando-widget/{p-0c5b047c.js → p-88046639.js} +0 -0
  65. package/dist/geotrek-rando-widget/p-88e55e13.entry.js +1 -0
  66. package/dist/geotrek-rando-widget/p-93d51eaa.entry.js +1 -0
  67. package/dist/geotrek-rando-widget/p-95932d69.system.entry.js +5 -0
  68. package/dist/geotrek-rando-widget/{p-4690907e.js → p-9c0d229f.js} +1 -1
  69. package/dist/geotrek-rando-widget/{p-b1530d9c.system.js → p-a8de6293.system.js} +0 -0
  70. package/dist/geotrek-rando-widget/p-d56c1888.system.entry.js +1 -0
  71. package/dist/geotrek-rando-widget/{p-533fc2bb.entry.js → p-dce99cef.entry.js} +1 -1
  72. package/dist/geotrek-rando-widget/{p-8f9914f4.system.js → p-e2d589f8.system.js} +1 -1
  73. package/dist/geotrek-rando-widget/{p-82ca029f.system.js → p-e3c13365.system.js} +1 -1
  74. package/dist/geotrek-rando-widget/{p-2bd0278f.system.entry.js → p-e9f13f25.system.entry.js} +1 -1
  75. package/dist/geotrek-rando-widget/{p-4eaf20b7.js → p-ef5d4167.js} +0 -0
  76. package/dist/geotrek-rando-widget/p-fce69064.entry.js +1 -0
  77. package/dist/types/components/grw-map/grw-map.d.ts +3 -1
  78. package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +4 -1
  79. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +3 -1
  80. package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +1 -0
  81. package/dist/types/components.d.ts +8 -0
  82. package/dist/types/store/store.d.ts +5 -3
  83. package/dist/types/types/types.d.ts +6 -0
  84. package/loader/package.json +1 -0
  85. package/package.json +12 -12
  86. package/readme.md +4 -6
  87. package/dist/geotrek-rando-widget/p-067c02c4.system.js +0 -1
  88. package/dist/geotrek-rando-widget/p-18038011.js +0 -1
  89. package/dist/geotrek-rando-widget/p-2712caa8.system.entry.js +0 -6
  90. package/dist/geotrek-rando-widget/p-3ed52659.entry.js +0 -1
  91. package/dist/geotrek-rando-widget/p-48d5dde7.entry.js +0 -1
  92. package/dist/geotrek-rando-widget/p-e1431f36.system.entry.js +0 -1
  93. package/dist/geotrek-rando-widget/p-e38f4ff4.system.entry.js +0 -1
  94. package/dist/geotrek-rando-widget/p-f5d98aae.entry.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { s as state, o as onChange } from './store.js';
2
+ import { s as state, o as onChange, r as reset } from './store.js';
3
3
  import { d as durationImage, f as formatDuration, l as lengthImage, a as formatLength, b as ascentImage, c as formatAscent } from './length.js';
4
4
 
5
5
  const grwTrekCardCss = ".trek-card-container,.trek-card-large-view-container{font-family:\"Roboto\";border-radius:8px;-webkit-box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{-o-object-fit:cover;object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;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:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;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:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row,.trek-card-large-view-container .sub-container .icons-labels-container .row{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;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:-ms-flexbox;display:flex;-ms-flex-align:center;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:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.trek-card-large-view-container .image{width:250px}";
@@ -13,6 +13,7 @@ const GrwTrekCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
13
13
  this.colorPrimary = '#6b0030';
14
14
  this.colorPrimaryTint = '#974c6e';
15
15
  this.isLargeView = false;
16
+ this.resetStoreOnDisconnected = true;
16
17
  }
17
18
  connectedCallback() {
18
19
  this.currentTrek = this.trek ? this.trek : state.currentTrek;
@@ -21,6 +22,7 @@ const GrwTrekCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
21
22
  this.route = state.routes.find(route => route.id === this.currentTrek.route);
22
23
  this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
23
24
  this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
25
+ this.departureCity = state.cities.find(city => city.id === this.currentTrek.departure_city);
24
26
  }
25
27
  onChange('currentTrek', () => {
26
28
  this.currentTrek = this.trek ? this.trek : state.currentTrek;
@@ -29,15 +31,21 @@ const GrwTrekCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
29
31
  this.route = state.routes.find(route => route.id === this.currentTrek.route);
30
32
  this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
31
33
  this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
34
+ this.departureCity = state.cities.find(city => city.id === this.currentTrek.departure_city);
32
35
  }
33
36
  });
34
37
  }
38
+ disconnectedCallback() {
39
+ if (this.resetStoreOnDisconnected) {
40
+ reset();
41
+ }
42
+ }
35
43
  render() {
36
- var _a, _b, _c, _d, _e, _f, _g, _h;
37
- 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 :
38
- _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 :
39
- _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 :
40
- _h.name))))))));
44
+ var _a, _b, _c, _d, _e, _f, _g;
45
+ 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" }, this.departureCity && h("div", { class: "departure" }, this.departureCity.name), h("div", { class: "name" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.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" }, ((_b = this.difficulty) === null || _b === void 0 ? void 0 : _b.pictogram) && h("img", { src: this.difficulty.pictogram }), (_c = this.difficulty) === null || _c === void 0 ? void 0 :
46
+ _c.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" }, ((_d = this.route) === null || _d === void 0 ? void 0 : _d.pictogram) && h("img", { src: this.route.pictogram }), (_e = this.route) === null || _e === void 0 ? void 0 :
47
+ _e.route), h("div", { class: "icon-label practice" }, ((_f = this.practice) === null || _f === void 0 ? void 0 : _f.pictogram) && h("img", { src: this.practice.pictogram }), (_g = this.practice) === null || _g === void 0 ? void 0 :
48
+ _g.name))))))));
41
49
  }
42
50
  static get style() { return grwTrekCardCss; }
43
51
  }, [1, "grw-trek-card", {
@@ -45,11 +53,13 @@ const GrwTrekCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
45
53
  "colorPrimary": [1, "color-primary"],
46
54
  "colorPrimaryTint": [1, "color-primary-tint"],
47
55
  "isLargeView": [4, "is-large-view"],
56
+ "resetStoreOnDisconnected": [4, "reset-store-on-disconnected"],
48
57
  "currentTrek": [32],
49
58
  "difficulty": [32],
50
59
  "route": [32],
51
60
  "practice": [32],
52
- "themes": [32]
61
+ "themes": [32],
62
+ "departureCity": [32]
53
63
  }]);
54
64
  function defineCustomElement() {
55
65
  if (typeof customElements === "undefined") {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { s as state, o as onChange } from './store.js';
2
+ import { s as state, o as onChange, r as reset } from './store.js';
3
3
  import { d as durationImage, f as formatDuration, l as lengthImage, a as formatLength, b as ascentImage, c as formatAscent } from './length.js';
4
4
  import { d as defineCustomElement$3 } from './grw-information-desk-detail2.js';
5
5
  import { d as defineCustomElement$2 } from './grw-poi-detail2.js';
@@ -15,6 +15,7 @@ const GrwTrekDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
15
15
  this.colorPrimary = '#6b0030';
16
16
  this.colorPrimaryShade = '#4a0021';
17
17
  this.colorPrimaryTint = '#974c6e';
18
+ this.resetStoreOnDisconnected = true;
18
19
  }
19
20
  connectedCallback() {
20
21
  this.currentTrek = this.trek ? this.trek : state.currentTrek;
@@ -46,6 +47,11 @@ const GrwTrekDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
46
47
  }
47
48
  });
48
49
  }
50
+ disconnectedCallback() {
51
+ if (this.resetStoreOnDisconnected) {
52
+ reset();
53
+ }
54
+ }
49
55
  render() {
50
56
  var _a, _b, _c, _d, _e, _f, _g;
51
57
  return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-shade': this.colorPrimaryShade, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: "trek-detail-container" }, h("div", { class: "name" }, this.currentTrek.name), this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].url && (h("img", { class: "image", src: this.currentTrek.attachments[0].url, loading: "lazy" })), h("div", { class: "sub-container" }, h("div", { class: "icons-labels-container" }, h("div", { class: "row" }, h("div", { class: "icon-label difficulty" }, ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
@@ -69,6 +75,8 @@ const GrwTrekDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
69
75
  "colorPrimary": [1, "color-primary"],
70
76
  "colorPrimaryShade": [1, "color-primary-shade"],
71
77
  "colorPrimaryTint": [1, "color-primary-tint"],
78
+ "resetStoreOnDisconnected": [4, "reset-store-on-disconnected"],
79
+ "currentTrek": [32],
72
80
  "difficulty": [32],
73
81
  "route": [32],
74
82
  "practice": [32],
@@ -76,8 +84,7 @@ const GrwTrekDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
76
84
  "labels": [32],
77
85
  "sources": [32],
78
86
  "accessibilities": [32],
79
- "accessibilityLevel": [32],
80
- "currentTrek": [32]
87
+ "accessibilityLevel": [32]
81
88
  }]);
82
89
  function defineCustomElement() {
83
90
  if (typeof customElements === "undefined") {
@@ -17,6 +17,7 @@ const GrwTrekProvider = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
17
17
  requests.push(!state.routes ? fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`, { signal: this.signal }) : new Response('null'));
18
18
  requests.push(!state.practices ? fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`, { signal: this.signal }) : new Response('null'));
19
19
  requests.push(!state.themes ? fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }) : new Response('null'));
20
+ requests.push(!state.cities ? fetch(`${this.api}city/?language=${this.language}&fields=id,name&published=true`, { signal: this.signal }) : new Response('null'));
20
21
  Promise.all([
21
22
  ...requests,
22
23
  fetch(`${this.api}sensitivearea/?language=${this.language}&published=true&trek=${this.trekId}&fields=id,geometry,name,description,contact,info_url,period,practices`, {
@@ -31,10 +32,10 @@ const GrwTrekProvider = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
31
32
  }),
32
33
  fetch(`${this.api}poi_type/?language=${this.language}&fields=id,pictogram`, { signal: this.signal }),
33
34
  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`, { signal: this.signal }),
34
- 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`, { signal: this.signal }),
35
+ 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,departure_city,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`, { signal: this.signal }),
35
36
  ])
36
37
  .then(responses => Promise.all(responses.map(response => response.json())))
37
- .then(([difficulties, routes, practices, themes, sensitiveAreas, labels, sources, accessibilities, accessibilitiesLevel, pois, poiTypes, informationDesks, trek]) => {
38
+ .then(([difficulties, routes, practices, themes, cities, sensitiveAreas, labels, sources, accessibilities, accessibilitiesLevel, pois, poiTypes, informationDesks, trek]) => {
38
39
  state.trekNetworkError = false;
39
40
  if (difficulties) {
40
41
  state.difficulties = difficulties.results;
@@ -48,6 +49,9 @@ const GrwTrekProvider = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
48
49
  if (themes) {
49
50
  state.themes = themes.results;
50
51
  }
52
+ if (cities) {
53
+ state.cities = cities.results;
54
+ }
51
55
  if (sensitiveAreas) {
52
56
  state.currentSensitiveAreas = sensitiveAreas.results;
53
57
  }
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { s as state, o as onChange } from './store.js';
2
+ import { s as state, o as onChange, r as reset } from './store.js';
3
3
  import { d as defineCustomElement$1 } from './grw-trek-card2.js';
4
4
 
5
5
  const grwTreksListCss = ":host{font-family:\"Roboto\";width:100%;height:100%;max-height:100vh;overflow-y:auto;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:distribute;justify-content:space-around}grw-trek-card{margin:6px}";
@@ -13,6 +13,7 @@ const GrwTreksList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
13
13
  this.colorPrimary = '#6b0030';
14
14
  this.colorPrimaryTint = '#974c6e';
15
15
  this.isLargeView = false;
16
+ this.resetStoreOnDisconnected = true;
16
17
  this.step = 10;
17
18
  this.handleInfiniteScrollBind = this.handleInfiniteScroll.bind(this);
18
19
  this.shouldAddInfiniteScrollEvent = true;
@@ -60,10 +61,13 @@ const GrwTreksList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
60
61
  }
61
62
  }
62
63
  disconnectedCallback() {
64
+ if (this.resetStoreOnDisconnected) {
65
+ reset();
66
+ }
63
67
  this.handleInfiniteScrollEvent(false);
64
68
  }
65
69
  render() {
66
- return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (h("grw-trek-card", { key: `trek-${trek.id}`, trek: trek, "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
70
+ return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (h("grw-trek-card", { "reset-store-on-disconnected": "false", key: `trek-${trek.id}`, trek: trek, "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
67
71
  }
68
72
  get element() { return this; }
69
73
  static get style() { return grwTreksListCss; }
@@ -71,6 +75,7 @@ const GrwTreksList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
71
75
  "colorPrimary": [1, "color-primary"],
72
76
  "colorPrimaryTint": [1, "color-primary-tint"],
73
77
  "isLargeView": [4, "is-large-view"],
78
+ "resetStoreOnDisconnected": [4, "reset-store-on-disconnected"],
74
79
  "treksToDisplay": [32]
75
80
  }]);
76
81
  function defineCustomElement() {
@@ -21,30 +21,32 @@ const GrwTreksProvider = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
21
21
  this.portals && (treksRequest += `&portals=${this.portals}`);
22
22
  this.routes && (treksRequest += `&routes=${this.routes}`);
23
23
  this.practices && (treksRequest += `&practices=${this.practices}`);
24
- treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,departure,departure_geom&page_size=999`;
24
+ treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,themes,route,departure,departure_city,departure_geom&page_size=999`;
25
25
  Promise.all([
26
26
  fetch(`${this.api}trek_difficulty/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }),
27
27
  fetch(`${this.api}trek_route/?language=${this.language}&fields=id,route,pictogram`, { signal: this.signal }),
28
28
  fetch(`${this.api}trek_practice/?language=${this.language}&fields=id,name,pictogram`, { signal: this.signal }),
29
29
  fetch(`${this.api}theme/?language=${this.language}&fields=id,label,pictogram`, { signal: this.signal }),
30
+ fetch(`${this.api}city/?language=${this.language}&fields=id,name&published=true`, { signal: this.signal }),
30
31
  fetch(treksRequest, { signal: this.signal }),
31
32
  ])
32
33
  .then(responses => Promise.all(responses.map(response => response.json())))
33
- .then(([difficulties, routes, practices, themes, treks]) => {
34
+ .then(([difficulties, routes, practices, themes, cities, treks]) => {
34
35
  state.treksNetworkError = false;
35
36
  state.difficulties = difficulties.results;
36
37
  state.routes = routes.results;
37
38
  state.practices = practices.results.map(practice => (Object.assign(Object.assign({}, practice), { selected: false })));
38
39
  state.themes = themes.results;
40
+ state.cities = cities.results;
39
41
  state.durations = [
40
42
  { id: 1, name: '0 - 1h', minValue: 0, maxValue: 1, selected: false },
41
43
  { id: 2, name: '1 - 2h', minValue: 1, maxValue: 2, selected: false },
42
44
  { id: 3, name: '2 - 5h', minValue: 2, maxValue: 5, selected: false },
43
45
  { id: 4, name: '5 - 10h', minValue: 5, maxValue: 10, selected: false },
44
46
  ];
45
- state.treks = treks.results;
46
47
  state.currentTreks = treks.results;
47
48
  state.treksWithinBounds = treks.results;
49
+ state.treks = treks.results;
48
50
  })
49
51
  .catch(() => (state.treksNetworkError = true));
50
52
  }
@@ -191,7 +191,7 @@ const createStore = (defaultState, shouldUpdate) => {
191
191
  return map;
192
192
  };
193
193
 
194
- const { state, onChange } = createStore({
194
+ const { state, onChange, reset } = createStore({
195
195
  api: '',
196
196
  treks: null,
197
197
  currentTreks: null,
@@ -201,6 +201,7 @@ const { state, onChange } = createStore({
201
201
  routes: [],
202
202
  practices: [],
203
203
  themes: [],
204
+ cities: [],
204
205
  durations: [],
205
206
  currentSensitiveAreas: null,
206
207
  labels: null,
@@ -215,4 +216,4 @@ const { state, onChange } = createStore({
215
216
  trekNetworkError: false,
216
217
  });
217
218
 
218
- export { onChange as o, state as s };
219
+ export { onChange as o, reset as r, state as s };
@@ -1,4 +1,4 @@
1
1
  /*
2
- Stencil Client Patch Esm v2.17.4 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Esm v2.18.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector="";};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r);}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE;}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return "\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return {start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return {start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t);}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else {if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s);}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value;}));}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0);})),!t)return "break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return [];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t});})),t++;})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o});}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement;}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors);})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return ":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return {original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return !1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t));}));}function reScope(e,t){var r=e.template.map((function(r){return "string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t);}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t);})).observe(document.head,{childList:!0});}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove();}})).catch((function(e){console.error(e);}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1;}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}));}));})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal();}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal();},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e);},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n);}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes);},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document));}("undefined"!=typeof window&&window);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v2.17.4 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v2.18.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  (function(){
5
5
  var aa=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function g(a){var b=aa.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return !b&&a}function l(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return !(!a||!(a.__CE_isImportDocument||a instanceof Document))}
@@ -1,7 +1,7 @@
1
- import { p as plt, w as win, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-899307bb.js';
1
+ import { p as plt, w as win, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-e834943f.js';
2
2
 
3
3
  /*
4
- Stencil Client Patch Browser v2.17.4 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Browser v2.18.0 | MIT Licensed | https://stenciljs.com
5
5
  */
6
6
  const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
7
7
  const patchBrowser = () => {
@@ -36,7 +36,7 @@ const patchBrowser = () => {
36
36
  if (!win.customElements) {
37
37
  // module support, but no custom elements support (Old Edge)
38
38
  // @ts-ignore
39
- return import(/* webpackChunkName: "polyfills-dom" */ './dom-9794f747.js').then(() => opts);
39
+ return import(/* webpackChunkName: "polyfills-dom" */ './dom-104fb833.js').then(() => opts);
40
40
  }
41
41
  }
42
42
  return promiseResolve(opts);
@@ -80,5 +80,5 @@ const patchDynamicImport = (base, orgScriptElm) => {
80
80
  };
81
81
 
82
82
  patchBrowser().then(options => {
83
- 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":[2],"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);
83
+ 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"],"resetStoreOnDisconnected":[4,"reset-store-on-disconnected"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32],"themes":[32],"departureCity":[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"],"resetStoreOnDisconnected":[4,"reset-store-on-disconnected"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32],"themes":[32],"labels":[32],"sources":[32],"accessibilities":[32],"accessibilityLevel":[32]}],[1,"grw-treks-list",{"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"isLargeView":[4,"is-large-view"],"resetStoreOnDisconnected":[4,"reset-store-on-disconnected"],"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"],"resetStoreOnDisconnected":[4,"reset-store-on-disconnected"],"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":[2],"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);
84
84
  });
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-899307bb.js';
2
- import { o as onChange, s as state } from './store-70461a28.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-e834943f.js';
2
+ import { o as onChange, s as state, r as reset } from './store-c6ccb3db.js';
3
3
 
4
4
  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>`;
5
5
 
@@ -103,10 +103,11 @@ const GrwApp = class {
103
103
  }
104
104
  }
105
105
  disconnectedCallback() {
106
+ reset();
106
107
  window.removeEventListener('popstate', this.handlePopStateBind);
107
108
  }
108
109
  render() {
109
- return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint, '--color-primary-shade': this.colorPrimaryShade } }, !state.currentTreks && !state.currentTrek && (h("div", { class: "init-loader-container" }, h("span", { class: "loader" }))), !this.showTrek && !state.treks && (h("grw-treks-provider", { api: this.api, language: this.language, "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 && h("grw-trek-provider", { api: this.api, language: this.language, "trek-id": this.currentTrekId }), (state.currentTreks || state.currentTrek) && (h("div", { class: "app-container" }, h("div", { class: this.isLargeView ? 'large-view-header-container' : 'header-container' }, this.showTrek ? (h("div", { onClick: () => this.handleBackButton(), class: "arrow-back-icon", innerHTML: arrowBackImage })) : (h("div", { class: "handle-filters-container" }, h("div", { onClick: () => this.handleFilters(), class: "handle-filters-button" }, "FILTRER"), state.treksWithinBounds && (h("div", { class: "current-treks-within-bounds-length" }, `${state.treksWithinBounds.length} randonnée${state.treksWithinBounds.length > 1 ? 's' : ''}`)))), !this.showTrek && this.showFilters && (h("div", { class: "options-container" }, h("div", { class: "filters-container" }, h("div", { onClick: () => this.handleFilters(), class: "close-filters-button" }, "X"), h("div", null, h("grw-filter", { filterName: "Pratique", filterType: "practices", filterNameProperty: "name" })), h("div", { class: "filter-margin-top" }, h("grw-filter", { filterName: "Difficult\u00E9", filterType: "difficulties", filterNameProperty: "label" })), h("div", { class: "filter-margin-top" }, h("grw-filter", { filterName: "Dur\u00E9e", filterType: "durations", filterNameProperty: "name" }))), h("div", { onClick: () => this.handleFilters(), class: "back-filters-container" }))), h("div", { class: "attribution-container" }, h("a", { target: "_blank", href: "https://geotrek.fr" }, "GEOTREK"))), h("div", { class: "content-container" }, 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' } }, h("grw-treks-list", { "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })), this.showTrek && !state.currentTrek && (h("div", { class: this.isLargeView ? 'large-view-loader-container' : 'loader-container' }, h("span", { class: "loader" }))), state.currentTrek && (h("div", { class: this.isLargeView ? 'large-view-app-trek-detail-container' : 'app-trek-detail-container' }, h("grw-trek-detail", { "color-primary": this.colorPrimary, "color-primary-shade": this.colorPrimaryShade, "color-primary-tint": this.colorPrimaryTint }))), h("grw-map", { class: this.isLargeView ? 'large-view-app-map-container' : 'app-map-container', style: { visibility: (this.showTreksMap && !this.showTrek) || (this.showTrekMap && this.showTrek) ? 'visible' : 'hidden' }, "url-layer": this.urlLayer, center: this.center, zoom: this.zoom, attribution: this.attribution, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint, "color-trek-line": this.colorTrekLine, "color-departure-icon": this.colorDepartureIcon, "color-arrival-icon": this.colorArrivalIcon, "color-sensitive-area": this.colorSensitiveArea, "color-poi-icon": this.colorPoiIcon })), h("div", { class: "map-visibility-button", style: { display: this.isLargeView ? 'none' : 'flex' } }, h("div", { onClick: () => this.handleShowMap() }, this.showTrek ? (this.showTrekMap ? 'Voir la fiche' : 'Voir la carte') : this.showTreksMap ? 'Voir la liste' : 'Voir la carte'))))));
110
+ return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint, '--color-primary-shade': this.colorPrimaryShade } }, !state.currentTreks && !state.currentTrek && (h("div", { class: "init-loader-container" }, h("span", { class: "loader" }))), !this.showTrek && !state.treks && (h("grw-treks-provider", { api: this.api, language: this.language, "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 && h("grw-trek-provider", { api: this.api, language: this.language, "trek-id": this.currentTrekId }), (state.currentTreks || state.currentTrek) && (h("div", { class: "app-container" }, h("div", { class: this.isLargeView ? 'large-view-header-container' : 'header-container' }, this.showTrek ? (h("div", { onClick: () => this.handleBackButton(), class: "arrow-back-icon", innerHTML: arrowBackImage })) : (h("div", { class: "handle-filters-container" }, h("div", { onClick: () => this.handleFilters(), class: "handle-filters-button" }, "FILTRER"), state.treksWithinBounds && (h("div", { class: "current-treks-within-bounds-length" }, `${state.treksWithinBounds.length} randonnée${state.treksWithinBounds.length > 1 ? 's' : ''}`)))), !this.showTrek && this.showFilters && (h("div", { class: "options-container" }, h("div", { class: "filters-container" }, h("div", { onClick: () => this.handleFilters(), class: "close-filters-button" }, "X"), h("div", null, h("grw-filter", { filterName: "Pratique", filterType: "practices", filterNameProperty: "name" })), h("div", { class: "filter-margin-top" }, h("grw-filter", { filterName: "Difficult\u00E9", filterType: "difficulties", filterNameProperty: "label" })), h("div", { class: "filter-margin-top" }, h("grw-filter", { filterName: "Dur\u00E9e", filterType: "durations", filterNameProperty: "name" }))), h("div", { onClick: () => this.handleFilters(), class: "back-filters-container" }))), h("div", { class: "attribution-container" }, h("a", { target: "_blank", href: "https://geotrek.fr" }, "GEOTREK"))), h("div", { class: "content-container" }, 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' } }, h("grw-treks-list", { "reset-store-on-disconnected": "false", "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })), this.showTrek && !state.currentTrek && (h("div", { class: this.isLargeView ? 'large-view-loader-container' : 'loader-container' }, h("span", { class: "loader" }))), state.currentTrek && (h("div", { class: this.isLargeView ? 'large-view-app-trek-detail-container' : 'app-trek-detail-container' }, h("grw-trek-detail", { "reset-store-on-disconnected": "false", "color-primary": this.colorPrimary, "color-primary-shade": this.colorPrimaryShade, "color-primary-tint": this.colorPrimaryTint }))), h("grw-map", { "reset-store-on-disconnected": "false", class: this.isLargeView ? 'large-view-app-map-container' : 'app-map-container', style: { visibility: (this.showTreksMap && !this.showTrek) || (this.showTrekMap && this.showTrek) ? 'visible' : 'hidden' }, "url-layer": this.urlLayer, center: this.center, zoom: this.zoom, attribution: this.attribution, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint, "color-trek-line": this.colorTrekLine, "color-departure-icon": this.colorDepartureIcon, "color-arrival-icon": this.colorArrivalIcon, "color-sensitive-area": this.colorSensitiveArea, "color-poi-icon": this.colorPoiIcon })), h("div", { class: "map-visibility-button", style: { display: this.isLargeView ? 'none' : 'flex' } }, h("div", { onClick: () => this.handleShowMap() }, this.showTrek ? (this.showTrekMap ? 'Voir la fiche' : 'Voir la carte') : this.showTreksMap ? 'Voir la liste' : 'Voir la carte'))))));
110
111
  }
111
112
  get element() { return getElement(this); }
112
113
  static get watchers() { return {