(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[361,433],{2:function(t,e){},3:function(t,e){},ubwv:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"tb-w-event-detail-map"},[i("div",{staticClass:"tb-w-map-and-controls-wrapper relative"},[t.geoCoordinates?i("tb-w-mapbox-map",{attrs:{article:t.article,"related-markers":t.relatedMarkers,"has-main-popup":t.hasPopupInfo,"spaced-controls":""},on:{updatedMapBounds:function(e){return t.updateMapBounds(e)},mapInitialIdle:function(e){t.toggleRelatedMarkers(Object.keys(t.toggles))}}}):t._e(),t._v(" "),i("tb-w-mapbox-custom-controls",{attrs:{"horizontally-scrollable":!0}},[t._l(Object.keys(t.toggles),(function(e){var a,o,s;return[null!==(a=t.toggles[e])&&void 0!==a&&a.isDataAvailable?i("tb-w-mapbox-custom-control",{key:e,attrs:{"is-active":!!t.toggles[e].active},nativeOn:{click:function(i){return t.toggleMarkersHandler(e)}}},[t._v("\n                    "+t._s(t.$t("message."+e))+"\n                    "),t.toggles[e].active&&void 0!==t.relatedMarkers[e]?i("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?i("tb-w-loader",{staticClass:"ml-1",attrs:{color:"white",inline:""}}):t._e()],1):t._e()]}))],2)],1)])};a._withStripped=!0;var o=i("UjeN"),s=i("xBaG"),l=i("PxIQ"),r={name:"TbWEventDetailMap",props:{article:{type:Object,required:!0},meetingPoint:{type:Object,default:null}},data:()=>({publicTransportLocations:[],publicTransportActualDataTimeoutId:null,publicTransportActualDataTimeout:!1,displayPublicTransport:!1,mapBounds:{},relatedMarkers:{},toggles:{}}),watch:{article:{handler(){this.setToggles()},immediate:!0,deep:!0},meetingPoint:{handler(){this.setMeetingPointMarker()},immediate:!0,deep:!0}},computed:{...Object(s.e)("displayConfig",["activeMapMarkersInitial","displayMapPublicTransport"]),geoCoordinates(){return this.article.geocoordinates||this.article.latitude&&this.article.longitude?{latitude:this.article.latitude,longitude:this.article.longitude}:null},hasPopupInfo(){var t,e,i,a,o;return!(null===(t=this.article)||void 0===t||!t.name)||!(null===(e=this.article)||void 0===e||null===(i=e.text)||void 0===i||!i.name)||!(null===(a=this.article)||void 0===a||null===(o=a.address)||void 0===o||!o.name)}},methods:{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,i;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===(i=this.mapBounds)||void 0===i?void 0:i.radiusMeters,100).then(t=>{const e=t.Trias.ServiceDelivery.DeliveryPayload.LocationInformationResponse.Location,i=[...this.publicTransportLocations||[],...e||[]];this.publicTransportLocations=i.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()},setMeetingPointMarker(){this.meetingPoint&&this.$set(this.relatedMarkers,"meetingPoint",[this.meetingPoint])},relatedArticlesWithGeocoordinates(t){var e,i;return null===(e=(null===(i=this.article.relatedArticles)||void 0===i?void 0:i[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(t=[]){t.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:this.displayMapPublicTransport,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=i("KHd+"),c=Object(n.a)(r,a,[],!1,null,null,null);e.default=c.exports}}]);