(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[292],{0:function(t,e){},1:function(t,e){},ubwv:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tb-w-event-detail-map"},[a("div",{staticClass:"tb-w-map-and-controls-wrapper relative"},[t.geoCoordinates?a("tb-w-mapbox-map",{attrs:{article:t.article,"related-markers":t.relatedMarkers,"disable-location-link":t.article.isExperienceMeetingPoint},on:{updatedMapBounds:function(e){return t.updateMapBounds(e)},mapInitialIdle:function(e){t.toggleRelatedMarkers(Object.keys(t.toggles))}}}):t._e(),t._v(" "),a("tb-w-mapbox-custom-controls",[t._l(Object.keys(t.toggles),(function(e){var i,o,s;return[null!==(i=t.toggles[e])&&void 0!==i&&i.isDataAvailable?a("tb-w-mapbox-custom-control",{key:e,staticClass:"mb-2",attrs:{"is-active":!!t.toggles[e].active},nativeOn:{click:function(a){return t.toggleMarkersHandler(e)}}},[t._v("\n                    "+t._s(t.$t("message."+e))+"\n                    "),t.toggles[e].active&&void 0!==t.relatedMarkers[e]?a("span",{staticClass:"font-normal"},[t._v("\n                        ("+t._s(null===(o=t.relatedMarkers[e])||void 0===o?void 0:o.length)+")\n                    ")]):t._e(),t._v(" "),null!==(s=t.toggles[e])&&void 0!==s&&s.loading?a("tb-w-loader",{staticClass:"ml-1",attrs:{color:"white",inline:""}}):t._e()],1):t._e()]}))],2)],1)])};i._withStripped=!0;var o=a("UjeN"),s=a("L2JU"),l=a("PxIQ"),r={name:"TbWEventDetailMap",props:{article:{type:Object,required:!0}},data:()=>({publicTransportLocations:[],publicTransportActualDataTimeoutId:null,publicTransportActualDataTimeout:!1,displayPublicTransport:!1,mapBounds:{},relatedMarkers:{},toggles:{}}),watch:{article:{handler(){this.setToggles()},immediate:!0,deep:!0}},computed:{...Object(s.e)("displayConfig",["activeMapMarkersInitial"])},methods:{geoCoordinates(){return this.article.geocoordinates||this.article.latitude&&this.article.longitude?{latitude:this.article.latitude,longitude:this.article.longitude}:null},async togglePublicTransportHandler(){var t;this.toggles.publicTransport.loading=!0,null!==(t=this.publicTransportLocations)&&void 0!==t&&t.length&&(this.publicTransportLocations=[]);const e=()=>{this.publicTransportActualDataTimeout=!0,this.publicTransportActualDataTimeoutId=setTimeout(()=>{this.publicTransportActualDataTimeout=!1,clearTimeout(this.publicTransportActualDataTimeoutId)},6e4)};await(()=>{var t,e,a;return Object(o.a)(null===(t=this.mapBounds)||void 0===t?void 0:t.latitude,null===(e=this.mapBounds)||void 0===e?void 0:e.longitude,null===(a=this.mapBounds)||void 0===a?void 0:a.radiusMeters,100).then(t=>{const e=t.Trias.ServiceDelivery.DeliveryPayload.LocationInformationResponse.Location,a=[...this.publicTransportLocations||[],...e||[]];this.publicTransportLocations=a.reduce((t,e)=>(t.some(t=>t.Location.StopPoint.StopPointRef._text===e.Location.StopPoint.StopPointRef._text)||t.push(e),t),[])}).catch(t=>console.warn(t))})(),this.$set(this.relatedMarkers,"publicTransport",this.publicTransportLocations),this.toggles.publicTransport.loading=!1,this.publicTransportActualDataTimeout||e()},relatedArticlesWithGeocoordinates(t){var e,a;return null===(e=(null===(a=this.article.relatedArticles)||void 0===a?void 0:a[t])||[])||void 0===e?void 0:e.filter(t=>t.geocoordinates)},toggleMarkersHandler(t){this.toggles[t].active=!this.toggles[t].active,this.toggleRelatedMarkers([t])},toggleRelatedMarkers(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(t=>{if(this.toggles[t].active)switch(t){case"publicTransport":this.togglePublicTransportHandler();break;default:this.$set(this.relatedMarkers,t,this.relatedArticlesWithGeocoordinates(t))}else this.$set(this.relatedMarkers,t,[])})},setToggles(){this.toggles={publicTransport:{isDataAvailable:!0,active:this.activeMapMarkersInitial.includes("publicTransport"),loading:!1},pointGettingThereParking:{isDataAvailable:this.relatedArticlesWithGeocoordinates("pointGettingThereParking").length,active:this.activeMapMarkersInitial.includes("pointGettingThereParking"),loading:!1}}},updateMapBounds(t){this.mapBounds=t}},i18n:{fallbackLocale:"de",silentFallbackWarn:"undefined"==typeof window,messages:l.a}},n=a("KHd+"),c=Object(n.a)(r,i,[],!1,null,null,null);c.options.__file="node_modules/@newland/toubiz-widget/src/components/tb-w-event-detail-map.vue";e.default=c.exports}}]);