@geotrekce/geotrek-rando-widget 0.0.1 → 0.0.2
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.
- package/dist/cjs/geotrek-rando-widget.cjs.js +2 -2
- package/dist/cjs/grw-app_7.cjs.entry.js +137 -55
- package/dist/cjs/{index-31255e29.js → index-c6f73e30.js} +36 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/departure-arrival.svg +1 -1
- package/dist/collection/components/grw-app/grw-app.css +60 -37
- package/dist/collection/components/grw-app/grw-app.js +277 -15
- package/dist/collection/components/grw-map/grw-map.css +36 -0
- package/dist/collection/components/grw-map/grw-map.js +157 -18
- package/dist/collection/components/grw-trek-card/grw-trek-card.js +87 -32
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +1 -1
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +87 -32
- package/dist/collection/components/grw-treks-list/grw-treks-list.css +3 -12
- package/dist/collection/components/grw-treks-list/grw-treks-list.js +46 -4
- package/dist/collection/store/grw-trek-provider.js +28 -6
- package/dist/collection/store/grw-treks-provider.js +155 -9
- package/dist/collection/stories/App.js +31 -1
- package/dist/collection/stories/App.stories.js +21 -1
- package/dist/collection/stories/TrekCard.js +8 -3
- package/dist/collection/stories/TrekCard.stories.js +2 -0
- package/dist/collection/stories/TrekDetail.js +8 -3
- package/dist/collection/stories/TrekDetail.stories.js +2 -0
- package/dist/collection/stories/TrekMap.js +10 -3
- package/dist/collection/stories/TrekMap.stories.js +13 -1
- package/dist/collection/stories/TreksList.js +16 -3
- package/dist/collection/stories/TreksList.stories.js +10 -0
- package/dist/collection/stories/TreksMap.js +12 -3
- package/dist/collection/stories/TreksMap.stories.js +15 -1
- package/dist/components/grw-app.js +39 -6
- package/dist/components/grw-map2.js +56 -20
- package/dist/components/grw-trek-card2.js +25 -7
- package/dist/components/grw-trek-detail2.js +26 -8
- package/dist/components/grw-trek-provider2.js +10 -7
- package/dist/components/grw-treks-list2.js +10 -4
- package/dist/components/grw-treks-provider2.js +26 -11
- package/dist/esm/geotrek-rando-widget.js +2 -2
- package/dist/esm/grw-app_7.entry.js +137 -55
- package/dist/esm/{index-b36f38f5.js → index-7aa9e822.js} +36 -0
- package/dist/esm/loader.js +2 -2
- package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
- package/dist/geotrek-rando-widget/p-332ba9ab.js +2 -0
- package/dist/geotrek-rando-widget/p-b7c66d2d.entry.js +1 -0
- package/dist/types/components/grw-app/grw-app.d.ts +21 -2
- package/dist/types/components/grw-map/grw-map.d.ts +8 -0
- package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +3 -1
- package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +2 -0
- package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +2 -0
- package/dist/types/components.d.ts +70 -0
- package/dist/types/store/grw-trek-provider.d.ts +1 -0
- package/dist/types/store/grw-treks-provider.d.ts +8 -0
- package/package.json +1 -1
- package/dist/geotrek-rando-widget/p-f721481d.js +0 -2
- package/dist/geotrek-rando-widget/p-fe788eaa.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getRenderingRef, f as forceUpdate, r as registerInstance, h, H as Host, a as getElement, c as createEvent } from './index-
|
|
1
|
+
import { g as getRenderingRef, f as forceUpdate, r as registerInstance, h, H as Host, a as getElement, c as createEvent } from './index-7aa9e822.js';
|
|
2
2
|
|
|
3
3
|
const appendToMap = (map, propName, value) => {
|
|
4
4
|
const items = map.get(propName);
|
|
@@ -195,32 +195,50 @@ const { state, onChange } = createStore({
|
|
|
195
195
|
|
|
196
196
|
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>`;
|
|
197
197
|
|
|
198
|
-
const grwAppCss = ".header-container{display:flex;align-items:center;background-color:var(--color-primary);height:64px}.header-container .title{color:#ffffff;
|
|
198
|
+
const grwAppCss = ".app-container{position:relative;height:100%;max-height:100vh}.header-container,.large-view-header-container{display:flex;align-items:center;background-color:var(--color-primary);height:64px}.header-container .title,.large-view-header-container .title{color:#ffffff;margin-left:24px}.header-container .arrow-back-icon,.large-view-header-container .arrow-back-icon{width:48px;height:auto;margin-left:24px}.header-container .arrow-back-icon svg,.large-view-header-container .arrow-back-icon svg{cursor:pointer;width:48px;height:auto}.loader-container,.large-view-loader-container{display:flex;justify-content:center;align-items:center;height:100%}.loader-container .loader,.large-view-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.content-container{position:relative;display:flex;height:calc(100% - 64px)}.app-treks-list-container,.app-trek-detail-container,.large-view-app-treks-list-container,.large-view-app-trek-detail-container{height:100%}.app-map-container,.large-view-app-map-container{width:100%;height:100%}.map-visibility-button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:absolute;bottom:24px;width:100%;z-index:400;user-select:none}.map-visibility-button div{background-color:var(--color-primary);color:#ffffff;padding:12px;border-radius:24px;width:120px;text-align:center}.header-container .title{font-size:24px}.loader-container{position:absolute;width:100%}.app-treks-list-container,.app-trek-detail-container{width:100%}.app-map-container{position:relative;width:100%;position:absolute}.large-view-header-container .title{font-size:32px}.large-view-loader-container{position:relative;width:50%}.large-view-app-treks-list-container,.large-view-app-trek-detail-container{width:50%}.large-view-app-map-container{position:relative;width:50%}";
|
|
199
199
|
|
|
200
200
|
const GrwApp = class {
|
|
201
201
|
constructor(hostRef) {
|
|
202
202
|
registerInstance(this, hostRef);
|
|
203
|
+
this.showTrek = false;
|
|
204
|
+
this.showMap = false;
|
|
205
|
+
this.isLargeView = false;
|
|
203
206
|
this.appName = 'Geotrek Rando Widget';
|
|
204
207
|
this.colorPrimary = '#6b0030';
|
|
205
208
|
this.colorPrimaryTint = '#d2b2c0';
|
|
209
|
+
this.colorTrekLine = '#6b0030';
|
|
210
|
+
this.colorDepartureIcon = '#006b3b';
|
|
211
|
+
this.colorArrivalIcon = '#85003b';
|
|
212
|
+
this.largeViewSize = 664;
|
|
206
213
|
}
|
|
207
214
|
onTrekCardPress(event) {
|
|
208
215
|
this.currentTrekId = event.detail;
|
|
209
216
|
this.showTrek = !this.showTrek;
|
|
210
217
|
}
|
|
211
|
-
onWindowResize(
|
|
212
|
-
this.
|
|
218
|
+
onWindowResize() {
|
|
219
|
+
this.handleView();
|
|
220
|
+
}
|
|
221
|
+
watchPropHandler() {
|
|
222
|
+
window.dispatchEvent(new window.Event('resize'));
|
|
223
|
+
}
|
|
224
|
+
componentDidLoad() {
|
|
225
|
+
this.handleView();
|
|
213
226
|
}
|
|
214
227
|
onTrekDetailsClose() {
|
|
215
228
|
this.currentTrekId = null;
|
|
216
229
|
this.showTrek = !this.showTrek;
|
|
217
230
|
}
|
|
218
|
-
|
|
219
|
-
this.
|
|
231
|
+
handleView() {
|
|
232
|
+
this.isLargeView = this.element.getBoundingClientRect().width >= this.largeViewSize;
|
|
233
|
+
this.showMap = this.isLargeView;
|
|
220
234
|
}
|
|
221
235
|
render() {
|
|
222
|
-
return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, h("grw-treks-provider", { api: this.api, portals: this.portals }, h("div", { class: "
|
|
236
|
+
return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, h("grw-treks-provider", { api: this.api, "in-bbox": this.inBbox, cities: this.cities, districts: this.districts, structures: this.structures, themes: this.themes, portals: this.portals, routes: this.routes, practices: this.practices }), this.showTrek && this.currentTrekId && h("grw-trek-provider", { api: state.api, "trek-id": this.currentTrekId }), h("div", { class: "app-container" }, h("div", { class: this.isLargeView ? 'large-view-header-container' : 'header-container' }, this.showTrek ? h("div", { onClick: () => this.onTrekDetailsClose(), class: "arrow-back-icon", innerHTML: arrowBackImage }) : h("div", { class: "title" }, this.appName)), 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", { "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-tint": this.colorPrimaryTint }))), h("grw-map", { class: this.isLargeView ? 'large-view-app-map-container' : 'app-map-container', style: { visibility: this.showMap ? 'visible' : 'hidden' }, "url-layer": this.urlLayer, center: this.center, zoom: this.zoom, attribution: this.attribution, "color-trek-line": this.colorTrekLine, "color-departure-icon": this.colorDepartureIcon, "color-arrival-icon": this.colorArrivalIcon })), h("div", { class: "map-visibility-button", style: { display: this.isLargeView ? 'none' : 'flex' } }, h("div", { onClick: () => (this.showMap = !this.showMap) }, this.showMap ? (this.showTrek ? 'Voir la fiche' : 'Voir la liste') : 'Voir la carte')))));
|
|
223
237
|
}
|
|
238
|
+
get element() { return getElement(this); }
|
|
239
|
+
static get watchers() { return {
|
|
240
|
+
"isLargeView": ["watchPropHandler"]
|
|
241
|
+
}; }
|
|
224
242
|
};
|
|
225
243
|
GrwApp.style = grwAppCss;
|
|
226
244
|
|
|
@@ -14363,32 +14381,45 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
|
|
|
14363
14381
|
//# sourceMappingURL=leaflet-src.js.map
|
|
14364
14382
|
});
|
|
14365
14383
|
|
|
14366
|
-
const departureArrivalImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M80,464V68.14a8,8,0,0,1,4-6.9C91.81,56.66,112.92,48,160,48c64,0,145,48,192,48a199.53,199.53,0,0,0,77.23-15.77A2,2,0,0,1,432,82.08V301.44a4,4,0,0,1-2.39,3.65C421.37,308.7,392.33,320,352,320c-48,0-128-32-192-32s-80,16-80,16" style=";fill
|
|
14384
|
+
const departureArrivalImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M80,464V68.14a8,8,0,0,1,4-6.9C91.81,56.66,112.92,48,160,48c64,0,145,48,192,48a199.53,199.53,0,0,0,77.23-15.77A2,2,0,0,1,432,82.08V301.44a4,4,0,0,1-2.39,3.65C421.37,308.7,392.33,320,352,320c-48,0-128-32-192-32s-80,16-80,16" style=";fill:#ffffff;stroke:currentColor;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`;
|
|
14367
14385
|
|
|
14368
|
-
const grwMapCss = ".leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-control-attribution svg{display:inline !important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:\"\"}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;color-adjust:exact}}grw-map{display:block;height:100%}.departure-icon svg,.arrival-icon svg{width:48px;height:48px}.departure-icon svg path,.arrival-icon svg path{fill:currentColor;stroke:currentColor}.departure-icon{color:var(--color-departure-icon)}.arrival-icon{color:var(--color-arrival-icon)}.trek-marker{background-color:var(--color-primary);border-radius:50%}";
|
|
14386
|
+
const grwMapCss = ".leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-control-attribution svg{display:inline !important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:\"\"}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;color-adjust:exact}}grw-map{display:block;height:100%;max-height:100vh}.departure-icon svg,.arrival-icon svg{width:48px;height:48px}.departure-icon svg path,.arrival-icon svg path{fill:currentColor;stroke:currentColor}.departure-icon{color:var(--color-departure-icon)}.arrival-icon{color:var(--color-arrival-icon)}.trek-marker{background-color:var(--color-primary);border-radius:50%;display:flex;justify-content:center;align-items:center}.trek-marker img{width:36px !important}.map-loader-container{position:absolute;z-index:500;width:100%;height:100%;background:rgba(255, 255, 255, 0.5);display:flex;justify-content:center;align-items:center}.map-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
14369
14387
|
|
|
14370
14388
|
const GrwMap = class {
|
|
14371
14389
|
constructor(hostRef) {
|
|
14372
14390
|
registerInstance(this, hostRef);
|
|
14391
|
+
this.mapIsReady = false;
|
|
14392
|
+
this.center = '1, 1';
|
|
14393
|
+
this.zoom = 10;
|
|
14373
14394
|
this.colorTrekLine = '#6b0030';
|
|
14374
14395
|
this.colorDepartureIcon = '#006b3b';
|
|
14375
14396
|
this.colorArrivalIcon = '#85003b';
|
|
14397
|
+
this.colorPrimary = '#6b0030';
|
|
14398
|
+
this.colorPrimaryTint = '#d2b2c0';
|
|
14376
14399
|
}
|
|
14377
14400
|
componentDidLoad() {
|
|
14378
14401
|
this.map = leafletSrc.map(this.element, {
|
|
14379
|
-
center:
|
|
14380
|
-
zoom:
|
|
14402
|
+
center: this.center.split(',').map(Number),
|
|
14403
|
+
zoom: this.zoom,
|
|
14381
14404
|
});
|
|
14382
|
-
leafletSrc.tileLayer(
|
|
14405
|
+
leafletSrc.tileLayer(this.urlLayer, {
|
|
14383
14406
|
maxZoom: 19,
|
|
14384
|
-
attribution:
|
|
14407
|
+
attribution: this.attribution,
|
|
14385
14408
|
}).addTo(this.map);
|
|
14386
14409
|
if (state.currentTrek) {
|
|
14387
14410
|
this.addTrek();
|
|
14388
14411
|
}
|
|
14389
|
-
else {
|
|
14412
|
+
else if (state.currentTrek) {
|
|
14390
14413
|
this.addTreks();
|
|
14391
14414
|
}
|
|
14415
|
+
onChange('treks', () => {
|
|
14416
|
+
if (state.currentTrek) {
|
|
14417
|
+
this.addTrek();
|
|
14418
|
+
}
|
|
14419
|
+
else if (state.treks) {
|
|
14420
|
+
this.addTreks();
|
|
14421
|
+
}
|
|
14422
|
+
});
|
|
14392
14423
|
onChange('currentTrek', () => {
|
|
14393
14424
|
if (state.currentTrek) {
|
|
14394
14425
|
this.removeTreks();
|
|
@@ -14401,6 +14432,7 @@ const GrwMap = class {
|
|
|
14401
14432
|
});
|
|
14402
14433
|
}
|
|
14403
14434
|
addTreks() {
|
|
14435
|
+
var _a;
|
|
14404
14436
|
const treksDepartureCoordinates = [];
|
|
14405
14437
|
const treksFeatureCollection = {
|
|
14406
14438
|
type: 'FeatureCollection',
|
|
@@ -14410,28 +14442,32 @@ const GrwMap = class {
|
|
|
14410
14442
|
treksDepartureCoordinates.push(trek.departure_geom);
|
|
14411
14443
|
treksFeatureCollection.features.push({
|
|
14412
14444
|
type: 'Feature',
|
|
14413
|
-
properties: {},
|
|
14445
|
+
properties: { practice: (_a = state.practices.find(practice => practice.id === trek.practice)) === null || _a === void 0 ? void 0 : _a.pictogram },
|
|
14414
14446
|
geometry: { type: 'Point', coordinates: trek.departure_geom },
|
|
14415
14447
|
});
|
|
14416
14448
|
}
|
|
14417
14449
|
if (treksDepartureCoordinates.length > 0) {
|
|
14418
14450
|
const bounds = leafletSrc.latLngBounds(treksDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
|
|
14419
|
-
this.
|
|
14451
|
+
this.currentBounds = bounds;
|
|
14452
|
+
this.map.fitBounds(this.currentBounds);
|
|
14420
14453
|
}
|
|
14421
14454
|
this.treksLayer = leafletSrc.geoJSON(treksFeatureCollection, {
|
|
14422
|
-
pointToLayer: (
|
|
14455
|
+
pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
|
|
14423
14456
|
icon: leafletSrc.divIcon({
|
|
14424
14457
|
className: 'trek-marker',
|
|
14425
14458
|
iconSize: 48,
|
|
14426
|
-
|
|
14459
|
+
html: geoJsonPoint.properties.practice ? `<img src=${geoJsonPoint.properties.practice} />` : '',
|
|
14427
14460
|
}),
|
|
14428
14461
|
autoPanOnFocus: false,
|
|
14429
14462
|
}),
|
|
14430
14463
|
}).addTo(this.map);
|
|
14464
|
+
!this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
|
|
14431
14465
|
}
|
|
14432
14466
|
removeTreks() {
|
|
14433
|
-
|
|
14434
|
-
|
|
14467
|
+
if (this.treksLayer) {
|
|
14468
|
+
this.map.removeLayer(this.treksLayer);
|
|
14469
|
+
this.treksLayer = null;
|
|
14470
|
+
}
|
|
14435
14471
|
}
|
|
14436
14472
|
addTrek() {
|
|
14437
14473
|
const trekFeature = {
|
|
@@ -14445,7 +14481,8 @@ const GrwMap = class {
|
|
|
14445
14481
|
}),
|
|
14446
14482
|
}).addTo(this.map);
|
|
14447
14483
|
const bounds = leafletSrc.latLngBounds(state.currentTrek.geometry.coordinates.map(coordinate => [coordinate[1], coordinate[0]]));
|
|
14448
|
-
this.
|
|
14484
|
+
this.currentBounds = bounds;
|
|
14485
|
+
this.map.fitBounds(this.currentBounds);
|
|
14449
14486
|
const departureCoordinates = [state.currentTrek.geometry.coordinates.at(0)[0], state.currentTrek.geometry.coordinates.at(0)[1]];
|
|
14450
14487
|
const arrivalCoordinates = [state.currentTrek.geometry.coordinates.at(-1)[0], state.currentTrek.geometry.coordinates.at(-1)[1]];
|
|
14451
14488
|
const departureArrivalFeatureCollection = {
|
|
@@ -14476,15 +14513,25 @@ const GrwMap = class {
|
|
|
14476
14513
|
autoPanOnFocus: false,
|
|
14477
14514
|
}),
|
|
14478
14515
|
}).addTo(this.map);
|
|
14516
|
+
!this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
|
|
14479
14517
|
}
|
|
14480
14518
|
removeTrek() {
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14519
|
+
if (this.trekLayer) {
|
|
14520
|
+
this.map.removeLayer(this.trekLayer);
|
|
14521
|
+
this.trekLayer = null;
|
|
14522
|
+
}
|
|
14523
|
+
if (this.departureArrivalLayer) {
|
|
14524
|
+
this.map.removeLayer(this.departureArrivalLayer);
|
|
14525
|
+
this.departureArrivalLayer = null;
|
|
14526
|
+
}
|
|
14485
14527
|
}
|
|
14486
14528
|
render() {
|
|
14487
|
-
return h(Host, { style: {
|
|
14529
|
+
return (h(Host, { style: {
|
|
14530
|
+
'--color-primary': this.colorPrimary,
|
|
14531
|
+
'--color-primary-tint': this.colorPrimaryTint,
|
|
14532
|
+
'--color-departure-icon': this.colorDepartureIcon,
|
|
14533
|
+
'--color-arrival-icon': this.colorArrivalIcon,
|
|
14534
|
+
} }, !this.mapIsReady && (h("div", { class: "map-loader-container" }, h("span", { class: "loader" })))));
|
|
14488
14535
|
}
|
|
14489
14536
|
get element() { return getElement(this); }
|
|
14490
14537
|
};
|
|
@@ -14522,41 +14569,65 @@ const GrwTrekCard = class {
|
|
|
14522
14569
|
constructor(hostRef) {
|
|
14523
14570
|
registerInstance(this, hostRef);
|
|
14524
14571
|
this.trekCardPress = createEvent(this, "trekCardPress", 7);
|
|
14572
|
+
this.colorPrimary = '#6b0030';
|
|
14573
|
+
this.colorPrimaryTint = '#d2b2c0';
|
|
14525
14574
|
}
|
|
14526
14575
|
componentWillLoad() {
|
|
14527
14576
|
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
14528
|
-
|
|
14529
|
-
|
|
14530
|
-
|
|
14577
|
+
if (this.currentTrek) {
|
|
14578
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
14579
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
14580
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
14581
|
+
}
|
|
14582
|
+
onChange('currentTrek', () => {
|
|
14583
|
+
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
14584
|
+
if (this.currentTrek) {
|
|
14585
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
14586
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
14587
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
14588
|
+
}
|
|
14589
|
+
});
|
|
14531
14590
|
}
|
|
14532
14591
|
render() {
|
|
14533
14592
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14534
|
-
return (h(Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id) }, h("div", { class: "trek-card-container" }, this.currentTrek.attachments[0] && h("img", { class: "image", src: this.currentTrek.attachments[0].url
|
|
14593
|
+
return (h(Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id), style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: "trek-card-container" }, this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].url && (h("img", { class: "image", src: `${this.currentTrek.attachments[0].url}.400x0_q85.${this.currentTrek.attachments[0].url.slice(-3).toLowerCase()}`, loading: "lazy" })), h("div", { class: "sub-container" }, h("div", { class: "name" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.name), h("div", { class: "description", innerHTML: (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.description_teaser }), 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 :
|
|
14535
14594
|
_d.label), h("div", { class: "icon-label duration" }, h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration(this.currentTrek.duration)), 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 :
|
|
14536
14595
|
_f.route)), 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: "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 :
|
|
14537
|
-
_h.name)))))));
|
|
14596
|
+
_h.name))))))));
|
|
14538
14597
|
}
|
|
14539
14598
|
};
|
|
14540
14599
|
GrwTrekCard.style = grwTrekCardCss;
|
|
14541
14600
|
|
|
14542
|
-
const grwTrekDetailCss = ".trek-detail-container{display:flex;flex-direction:column;
|
|
14601
|
+
const grwTrekDetailCss = ".trek-detail-container{display:flex;flex-direction:column;height:100%;overflow-y:auto}.trek-detail-container .name{color:var(--color-primary);font-size:48px;font-weight:bold;padding:24px}.trek-detail-container .image{align-self:center;width:100%;max-width:700px;height:auto;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25)}.trek-detail-container .sub-container{padding:24px}.trek-detail-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-detail-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-detail-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:24px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-detail-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 8px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label img,.trek-detail-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-detail-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-detail-container .description{padding:0px 24px 24px 24px}";
|
|
14543
14602
|
|
|
14544
14603
|
const GrwTrekDetail = class {
|
|
14545
14604
|
constructor(hostRef) {
|
|
14546
14605
|
registerInstance(this, hostRef);
|
|
14606
|
+
this.colorPrimary = '#6b0030';
|
|
14607
|
+
this.colorPrimaryTint = '#d2b2c0';
|
|
14547
14608
|
}
|
|
14548
14609
|
componentWillLoad() {
|
|
14549
14610
|
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14611
|
+
if (this.currentTrek) {
|
|
14612
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
14613
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
14614
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
14615
|
+
}
|
|
14616
|
+
onChange('currentTrek', () => {
|
|
14617
|
+
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
14618
|
+
if (this.currentTrek) {
|
|
14619
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
14620
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
14621
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
14622
|
+
}
|
|
14623
|
+
});
|
|
14553
14624
|
}
|
|
14554
14625
|
render() {
|
|
14555
14626
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
14556
|
-
return (h(Host,
|
|
14627
|
+
return (h(Host, { style: { '--color-primary': this.colorPrimary, '--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] && 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 :
|
|
14557
14628
|
_b.label), h("div", { class: "icon-label duration" }, h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration((_c = this.currentTrek) === null || _c === void 0 ? void 0 : _c.duration)), 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 :
|
|
14558
14629
|
_e.route)), 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: "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 :
|
|
14559
|
-
_g.name)))), h("div", { class: "description", innerHTML: this.currentTrek.description ? this.currentTrek.description : this.currentTrek.description_teaser }))));
|
|
14630
|
+
_g.name)))), h("div", { class: "description", innerHTML: this.currentTrek.description ? this.currentTrek.description : this.currentTrek.description_teaser })))));
|
|
14560
14631
|
}
|
|
14561
14632
|
};
|
|
14562
14633
|
GrwTrekDetail.style = grwTrekDetailCss;
|
|
@@ -14564,21 +14635,22 @@ GrwTrekDetail.style = grwTrekDetailCss;
|
|
|
14564
14635
|
const GrwTrekProvider = class {
|
|
14565
14636
|
constructor(hostRef) {
|
|
14566
14637
|
registerInstance(this, hostRef);
|
|
14638
|
+
this.language = 'fr';
|
|
14567
14639
|
}
|
|
14568
14640
|
componentWillLoad() {
|
|
14569
14641
|
state.api = this.api;
|
|
14570
14642
|
return Promise.all([
|
|
14571
|
-
fetch(`${this.api}
|
|
14572
|
-
fetch(`${this.api}
|
|
14573
|
-
fetch(`${this.api}
|
|
14574
|
-
fetch(`${this.api}
|
|
14643
|
+
fetch(`${this.api}trek_difficulty/?language=${this.language}`),
|
|
14644
|
+
fetch(`${this.api}trek_route/?language=${this.language}`),
|
|
14645
|
+
fetch(`${this.api}trek_practice/?language=${this.language}`),
|
|
14646
|
+
fetch(`${this.api}trek/${this.trekId}/?language=${this.language}&fields=id,name,attachments,description,description_teaser,difficulty,duration,ascent,length_2d,practice,route,geometry`),
|
|
14575
14647
|
])
|
|
14576
14648
|
.then(responses => Promise.all(responses.map(response => response.json())))
|
|
14577
|
-
.then(([
|
|
14578
|
-
state.currentTrek = trek;
|
|
14649
|
+
.then(([difficulties, routes, practices, trek]) => {
|
|
14579
14650
|
state.difficulties = difficulties.results;
|
|
14580
14651
|
state.routes = routes.results;
|
|
14581
14652
|
state.practices = practices.results;
|
|
14653
|
+
state.currentTrek = trek;
|
|
14582
14654
|
});
|
|
14583
14655
|
}
|
|
14584
14656
|
disconnectedCallback() {
|
|
@@ -14589,18 +14661,22 @@ const GrwTrekProvider = class {
|
|
|
14589
14661
|
}
|
|
14590
14662
|
};
|
|
14591
14663
|
|
|
14592
|
-
const grwTreksListCss = ":host{display:flex;flex-wrap:wrap;justify-content:
|
|
14664
|
+
const grwTreksListCss = ":host{display:flex;flex-wrap:wrap;justify-content:space-around;height:100%;max-height:100vh;overflow-y:auto}grw-trek-card{margin:6px}";
|
|
14593
14665
|
|
|
14594
14666
|
const GrwTreksList = class {
|
|
14595
14667
|
constructor(hostRef) {
|
|
14596
14668
|
registerInstance(this, hostRef);
|
|
14597
14669
|
this.treksToDisplay = [];
|
|
14670
|
+
this.colorPrimary = '#6b0030';
|
|
14671
|
+
this.colorPrimaryTint = '#d2b2c0';
|
|
14598
14672
|
this.handleInfiniteScrollBind = this.handleInfiniteScroll.bind(this);
|
|
14599
14673
|
this.step = 10;
|
|
14600
14674
|
}
|
|
14601
14675
|
componentWillLoad() {
|
|
14602
|
-
this.treksToDisplay = state.treks.slice(0, this.step);
|
|
14603
14676
|
this.element.addEventListener('scroll', this.handleInfiniteScrollBind);
|
|
14677
|
+
onChange('treks', () => {
|
|
14678
|
+
this.treksToDisplay = state.treks.slice(0, this.step);
|
|
14679
|
+
});
|
|
14604
14680
|
}
|
|
14605
14681
|
handleInfiniteScroll(event) {
|
|
14606
14682
|
if (event.composedPath()[0].scrollTop + event.composedPath()[0].scrollHeight / 2 >= event.composedPath()[0].scrollHeight) {
|
|
@@ -14613,7 +14689,7 @@ const GrwTreksList = class {
|
|
|
14613
14689
|
}
|
|
14614
14690
|
}
|
|
14615
14691
|
render() {
|
|
14616
|
-
return (h(Host, {
|
|
14692
|
+
return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (h("grw-trek-card", { trek: trek, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
|
|
14617
14693
|
}
|
|
14618
14694
|
get element() { return getElement(this); }
|
|
14619
14695
|
};
|
|
@@ -14622,26 +14698,32 @@ GrwTreksList.style = grwTreksListCss;
|
|
|
14622
14698
|
const GrwTreksProvider = class {
|
|
14623
14699
|
constructor(hostRef) {
|
|
14624
14700
|
registerInstance(this, hostRef);
|
|
14701
|
+
this.language = 'fr';
|
|
14625
14702
|
}
|
|
14626
14703
|
componentWillLoad() {
|
|
14627
14704
|
state.api = this.api;
|
|
14628
|
-
let treksRequest = `${this.api}trek/?language
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
}
|
|
14705
|
+
let treksRequest = `${this.api}trek/?language=${this.language}`;
|
|
14706
|
+
this.inBbox && (treksRequest += `&in_bbox=${this.inBbox}`);
|
|
14707
|
+
this.cities && (treksRequest += `&cities=${this.cities}`);
|
|
14708
|
+
this.districts && (treksRequest += `&districts=${this.districts}`);
|
|
14709
|
+
this.structures && (treksRequest += `&structures=${this.structures}`);
|
|
14710
|
+
this.themes && (treksRequest += `&themes=${this.themes}`);
|
|
14711
|
+
this.portals && (treksRequest += `&portals=${this.portals}`);
|
|
14712
|
+
this.routes && (treksRequest += `&routes=${this.routes}`);
|
|
14713
|
+
this.practices && (treksRequest += `&practices=${this.practices}`);
|
|
14632
14714
|
treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,route,departure_geom&page_size=999`;
|
|
14633
14715
|
return Promise.all([
|
|
14716
|
+
fetch(`${this.api}trek_difficulty/?language=${this.language}`),
|
|
14717
|
+
fetch(`${this.api}trek_route/?language=${this.language}`),
|
|
14718
|
+
fetch(`${this.api}trek_practice/?language=${this.language}`),
|
|
14634
14719
|
fetch(treksRequest),
|
|
14635
|
-
fetch(`${this.api}trek_difficulty/?language=fr`),
|
|
14636
|
-
fetch(`${this.api}trek_route/?language=fr`),
|
|
14637
|
-
fetch(`${this.api}trek_practice/?language=fr`),
|
|
14638
14720
|
])
|
|
14639
14721
|
.then(responses => Promise.all(responses.map(response => response.json())))
|
|
14640
|
-
.then(([
|
|
14641
|
-
state.treks = treks.results;
|
|
14722
|
+
.then(([difficulties, routes, practices, treks]) => {
|
|
14642
14723
|
state.difficulties = difficulties.results;
|
|
14643
14724
|
state.routes = routes.results;
|
|
14644
14725
|
state.practices = practices.results;
|
|
14726
|
+
state.treks = treks.results;
|
|
14645
14727
|
});
|
|
14646
14728
|
}
|
|
14647
14729
|
render() {
|
|
@@ -793,6 +793,10 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
793
793
|
const parsePropertyValue = (propValue, propType) => {
|
|
794
794
|
// ensure this value is of the correct prop type
|
|
795
795
|
if (propValue != null && !isComplexType(propValue)) {
|
|
796
|
+
if (propType & 2 /* Number */) {
|
|
797
|
+
// force it to be a number
|
|
798
|
+
return parseFloat(propValue);
|
|
799
|
+
}
|
|
796
800
|
if (propType & 1 /* String */) {
|
|
797
801
|
// could have been passed as a number or boolean
|
|
798
802
|
// but we still want it as a string
|
|
@@ -809,6 +813,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
809
813
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
810
814
|
// check our new property value against our internal value
|
|
811
815
|
const hostRef = getHostRef(ref);
|
|
816
|
+
const elm = hostRef.$hostElement$ ;
|
|
812
817
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
813
818
|
const flags = hostRef.$flags$;
|
|
814
819
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -821,6 +826,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
821
826
|
// set our new value!
|
|
822
827
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
823
828
|
if (instance) {
|
|
829
|
+
// get an array of method names of watch functions to call
|
|
830
|
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
831
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
832
|
+
if (watchMethods) {
|
|
833
|
+
// this instance is watching for when this property changed
|
|
834
|
+
watchMethods.map((watchMethodName) => {
|
|
835
|
+
try {
|
|
836
|
+
// fire off each of the watch methods that are watching this property
|
|
837
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
838
|
+
}
|
|
839
|
+
catch (e) {
|
|
840
|
+
consoleError(e, elm);
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
}
|
|
824
845
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
825
846
|
// looks like this value actually changed, so we've got work to do!
|
|
826
847
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -833,6 +854,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
833
854
|
};
|
|
834
855
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
835
856
|
if (cmpMeta.$members$) {
|
|
857
|
+
if (Cstr.watchers) {
|
|
858
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
859
|
+
}
|
|
836
860
|
// It's better to have a const than two Object.entries()
|
|
837
861
|
const members = Object.entries(cmpMeta.$members$);
|
|
838
862
|
const prototype = Cstr.prototype;
|
|
@@ -937,6 +961,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
937
961
|
endLoad();
|
|
938
962
|
}
|
|
939
963
|
if (!Cstr.isProxied) {
|
|
964
|
+
// we've never proxied this Constructor before
|
|
965
|
+
// let's add the getters/setters to its prototype before
|
|
966
|
+
// the first time we create an instance of the implementation
|
|
967
|
+
{
|
|
968
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
969
|
+
}
|
|
940
970
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
941
971
|
Cstr.isProxied = true;
|
|
942
972
|
}
|
|
@@ -960,6 +990,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
960
990
|
{
|
|
961
991
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
962
992
|
}
|
|
993
|
+
{
|
|
994
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
995
|
+
}
|
|
963
996
|
endNewInstance();
|
|
964
997
|
}
|
|
965
998
|
if (Cstr.style) {
|
|
@@ -1078,6 +1111,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1078
1111
|
{
|
|
1079
1112
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1080
1113
|
}
|
|
1114
|
+
{
|
|
1115
|
+
cmpMeta.$watchers$ = {};
|
|
1116
|
+
}
|
|
1081
1117
|
const tagName = cmpMeta.$tagName$;
|
|
1082
1118
|
const HostElement = class extends HTMLElement {
|
|
1083
1119
|
// StencilLazyHost
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-7aa9e822.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],"portals":[1],"appName":[1,"app-name"],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"showTrek":[32],"showMap":[32],"currentTrekId":[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]],[1,"grw-treks-list",{"treksToDisplay":[32]}],[0,"grw-map",{"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"]}],[1,"grw-trek-detail",{"trek":[16]}],[
|
|
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);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r,b as
|
|
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)));
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e,t,n=null,l=!1;const s="undefined"!=typeof window?window:{},o=s.document||{head:{}},c={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),a=(e,t,n)=>{n&&n.map((([n,l,s])=>{const o=f(e,n),r=u(t,s),i=d(n);c.ael(o,l,r,i),(t.o=t.o||[]).push((()=>c.rel(o,l,r,i)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){X(e)}},f=(e,t)=>8&t?s:e,d=e=>0!=(2&e),h=new WeakMap,y=e=>"sc-"+e.h,$={},m=e=>"object"==(e=typeof e)||"function"===e,p=(e,t,...n)=>{let l=null,s=!1,o=!1;const c=[],r=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!m(l))&&(l+=""),s&&o?c[c.length-1].$+=l:c.push(s?b(null,l):l),o=s)};if(r(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=b(e,null);return i.m=t,c.length>0&&(i.p=c),i},b=(e,t)=>({t:0,g:e,$:t,S:null,p:null,m:null}),w={},g=(e,t,n,l,o,r)=>{if(n!==l){let i=Q(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,s=j(n),o=j(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if(i||"o"!==t[0]||"n"!==t[1]){const s=m(l);if((i||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const s=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||o)&&!s&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):Q(s,a)?a.slice(2):a[2]+t.slice(3),n&&c.rel(e,t,n,!1),l&&c.ael(e,t,l,!1)}},S=/\s/,j=e=>e?e.split(S):[],k=(e,t,n,l)=>{const s=11===t.S.nodeType&&t.S.host?t.S.host:t.S,o=e&&e.m||$,c=t.m||$;for(l in o)l in c||g(s,l,o[l],void 0,n,t.t);for(l in c)g(s,l,o[l],c[l],n,t.t)},v=(t,n,l)=>{const s=n.p[l];let c,r,i=0;if(null!==s.$)c=s.S=o.createTextNode(s.$);else if(c=s.S=o.createElement(s.g),k(null,s,!1),null!=e&&c["s-si"]!==e&&c.classList.add(c["s-si"]=e),s.p)for(i=0;i<s.p.length;++i)r=v(t,s,i),r&&c.appendChild(r);return c},M=(e,n,l,s,o,c)=>{let r,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=c;++o)s[o]&&(r=v(null,l,o),r&&(s[o].S=r,i.insertBefore(r,n)))},C=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.S.remove()},O=(e,t)=>e.g===t.g,L=(e,t)=>{const n=t.S=e.S,l=e.p,s=t.p,o=t.$;null===o?(k(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,r=t.length-1,i=t[0],a=t[r],u=l.length-1,f=l[0],d=l[u];for(;o<=r&&c<=u;)null==i?i=t[++o]:null==a?a=t[--r]:null==f?f=l[++c]:null==d?d=l[--u]:O(i,f)?(L(i,f),i=t[++o],f=l[++c]):O(a,d)?(L(a,d),a=t[--r],d=l[--u]):O(i,d)?(L(i,d),e.insertBefore(i.S,a.S.nextSibling),i=t[++o],d=l[--u]):O(a,f)?(L(a,f),e.insertBefore(a.S,i.S),a=t[--r],f=l[++c]):(s=v(t&&t[c],n,c),f=l[++c],s&&i.S.parentNode.insertBefore(s,i.S));o>r?M(e,null==l[u+1]?null:l[u+1].S,n,l,c,u):c>u&&C(t,o,r)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),M(n,null,t,s,0,s.length-1)):null!==l&&C(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=e=>I(e).j,x=(e,t,n)=>{const l=P(e);return{emit:e=>E(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},E=(e,t,n)=>{const l=c.ce(t,n);return e.dispatchEvent(l),l},N=(e,t)=>{t&&!e.k&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.k=t)))},T=(e,t)=>{if(e.t|=16,!(4&e.t))return N(e,e.v),re((()=>W(e,t)));e.t|=512},W=(e,t)=>{const n=e.i;let l;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>D(n,e,t))),e.u=null),l=D(n,"componentWillLoad")),V(l,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.j,s=l["s-rc"];n&&(e=>{const t=e.M,n=e.j,l=t.t,s=((e,t)=>{let n=y(t);const l=ee.get(n);if(e=11===e.nodeType?e:o,l)if("string"==typeof l){let t,s=h.get(e=e.head||e);s||h.set(e,s=new Set),s.has(n)||(t=o.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);F(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>R(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},F=(l,s)=>{try{n=s,s=s.render(),l.t&=-17,l.t|=2,((n,l)=>{const s=n.j,o=n.C||b(null,null),c=(e=>e&&e.g===w)(l)?l:p(null,null,l);t=s.tagName,c.g=null,c.t|=4,n.C=c,c.S=o.S=s.shadowRoot||s,e=s["s-sc"],L(o,c)})(l,s)}catch(e){X(e,l.j)}return n=null,null},H=()=>n,R=e=>{const t=e.j,n=e.i,l=e.v;64&e.t||(e.t|=64,_(t),D(n,"componentDidLoad"),e.O(t),l||q()),e.k&&(e.k(),e.k=void 0),512&e.t&&ce((()=>T(e,!1))),e.t&=-517},U=e=>{{const t=I(e),n=t.j.isConnected;return n&&2==(18&t.t)&&T(t,!1),n}},q=()=>{_(o.documentElement),ce((()=>E(s,"appload",{detail:{namespace:"geotrek-rando-widget"}})))},D=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){X(e)}},V=(e,t)=>e&&e.then?e.then(t):t(),_=e=>e.classList.add("hydrated"),z=(e,t,n)=>{if(t.L){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.L),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>I(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=I(e),o=s.j,c=s.N.get(t),r=s.t,i=s.i;if(n=((e,t)=>null==e||m(e)?e:2&t?parseFloat(e):1&t?e+"":e)(n,l.L[t][0]),(!(8&r)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.N.set(t,n),i)){if(l.P&&128&r){const e=l.P[t];e&&e.map((e=>{try{i[e](n,c,t)}catch(e){X(e,o)}}))}2==(18&r)&&T(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){c.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},B=(e,t={})=>{const n=[],l=t.exclude||[],r=s.customElements,u=o.head,f=u.querySelector("meta[charset]"),d=o.createElement("style"),h=[];let $,m=!0;Object.assign(c,t),c.l=new URL(t.resourcesUrl||"./",o.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],h:t[1],L:t[2],T:t[3]};s.L=t[2],s.T=t[3],s.P={};const o=s.h,u=class extends HTMLElement{constructor(e){super(e),K(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){$&&(clearTimeout($),$=null),m?h.push(this):c.jmp((()=>(e=>{if(0==(1&c.t)){const t=I(e),n=t.M,l=()=>{};if(1&t.t)a(e,t,n.T);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){N(t,t.v=n);break}}n.L&&Object.entries(n.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Z(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.P=s.watchers,z(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){X(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=y(n);if(!ee.has(t)){const l=()=>{};((e,t,n)=>{let l=ee.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,ee.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.v,c=()=>T(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){c.jmp((()=>(()=>{if(0==(1&c.t)){const e=I(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),D(t,"disconnectedCallback")}})()))}componentOnReady(){return I(this).W}};s.A=e[0],l.includes(o)||r.get(o)||(n.push(o),r.define(o,z(u,s,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),u.insertBefore(d,f?f.nextSibling:u.firstChild),m=!1,h.length?h.map((e=>e.connectedCallback())):c.jmp((()=>$=setTimeout(q,30)))},G=new WeakMap,I=e=>G.get(e),J=(e,t)=>G.set(t.i=e,t),K=(e,t)=>{const n={t:0,j:e,M:t,N:new Map};return n.W=new Promise((e=>n.O=e)),e["s-p"]=[],e["s-rc"]=[],a(e,n,t.T),G.set(e,n)},Q=(e,t)=>t in e,X=(e,t)=>(0,console.error)(e,t),Y=new Map,Z=e=>{const t=e.h.replace(/-/g,"_"),n=e.A,l=Y.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(Y.set(n,e),e[t])),X)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},ee=new Map,te=[],ne=[],le=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&c.t?ce(oe):c.raf(oe))},se=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){X(e)}e.length=0},oe=()=>{se(te),se(ne),(l=te.length>0)&&c.raf(oe)},ce=e=>r().then(e),re=le(ne,!0);export{w as H,P as a,B as b,x as c,U as f,H as g,p as h,r as p,J as r}
|