(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[137],{"7yoQ":function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return a}));var r=n("6dQ1");function s(t){return Object(r.a)()?e.from(t,"utf-8").toString("base64"):btoa(t)}function a(t){return Object(r.a)()?e.from(t,"base64").toString("utf-8"):atob(t)}}).call(this,n("tjlA").Buffer)},VjoN:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return a}));var r=n("7yoQ");function s(e){return encodeURIComponent(Object(r.b)(JSON.stringify(e)))}const a={created(){for(const e of this.$options.urlState)this.restoreStateFromUrl(e),this.$watch(e,t=>this.saveStateToUrl(e,t),{deep:!0})},methods:{saveStateToUrl(e,t=this[e]){const n=Object.assign({},this.$route.query);n[e]=s(t),this.$router.push({name:this.$route.name,query:n}).catch(e=>{if(!(""+e.message).includes("redundant navigation"))throw e})},restoreStateFromUrl(e){if(!this.$route.query[e])return null;try{const t=function(e){return JSON.parse(Object(r.a)(decodeURIComponent(e)))}(this.$route.query[e]);return this.$set(this,e,t),t}catch(t){return console.warn(`Could not restore state ${e} from URL parameter ${e}`,t),null}}}}},ouaV:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n("ZoCn"),s=n("N8I4"),a=n("sdSa");function o(e,t){Object(a.a)(2,arguments);var n=Object(s.a)(e),o=Object(r.a)(t);if(isNaN(o))return new Date(NaN);if(!o)return n;var i=n.getDate(),l=new Date(n.getTime());l.setMonth(n.getMonth()+o+1,0);var u=l.getDate();return i>=u?l:(n.setFullYear(l.getFullYear(),l.getMonth(),i),n)}},rTFI:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tb-w-nearby-events"},[e.loading?n("tb-w-loader"):e.nearbyEvents.length?n("tb-w-section",{attrs:{wide:""},scopedSlots:e._u([{key:"content",fn:function(){return[n("tb-w-slider",[e._l(e.nearbyEvents.slice(0,6),(function(e){return n("tb-w-slider-item",{key:e.id},[n("tb-w-teaser-card-event",{attrs:{event:e,"display-info-slot":""}})],1)})),e._v(" "),e.showMoreLink?n("tb-w-show-all",{attrs:{href:e.buildUrl({name:"event.list",query:{params:e.getLocationFilterParams()}})}},[e._v("\n                    "+e._s(e.$t("message.showAll"))+"\n                ")]):e._e()],2)]},proxy:!0}])},[e._v("\n        "+e._s(e.$t("message.eventsNearby"))+"\n\n        ")]):e._e()],1)};r._withStripped=!0;var s=n("VjoN"),a=n("g8pp"),o=n("ouaV"),i=n("6dQ1"),l={name:"TbWNearbyEvents",props:{article:{type:Object,required:!0}},data:()=>({loading:!0,nearbyEvents:[],params:{},inOneMonth:Object(a.a)(Object(o.a)(new Date,1),"y-M-d"),showMoreLink:!1}),async created(){var e,t,n,r,s;if(!Object(i.a)()){const e=await this.articleRepository.fetch(this.article.id+"/nearbyEvents",{filter:{clientIncludingManaged:"current"},language:this.$store.state.language});this.nearbyEvents=e.payload,this.loading=!1}(null===(e=this.nearbyEvents)||void 0===e?void 0:e.length)>6&&null!==(t=this.article.geocoordinates)&&void 0!==t&&t.latitude&&null!==(n=this.article.geocoordinates)&&void 0!==n&&n.longitude&&(this.showMoreLink=!0);const a={sorting:{property:"date"},filter:{distanceFrom:{latitude:null===(r=this.article.geocoordinates)||void 0===r?void 0:r.latitude,longitude:null===(s=this.article.geocoordinates)||void 0===s?void 0:s.longitude},date:{before:this.inOneMonth}}};this.params=a},methods:{getLocationFilterParams(){return Object(s.b)(this.params)}},i18n:{fallbackLocale:"de",silentFallbackWarn:"undefined"==typeof window,messages:{de:{message:{eventsNearby:"Events in der Nähe",showAll:"Alle anzeigen"}},en:{message:{eventsNearby:"Events nearby",showAll:"Show all"}},fr:{message:{eventsNearby:"Événements à proximité",showAll:"Montre tout"}},it:{message:{eventsNearby:"Eventi nelle vicinanze",showAll:"Mostra tutto"}},es:{message:{eventsNearby:"Eventos cercanos",showAll:"Mostrar todos"}},nl:{message:{eventsNearby:"Evenementen in de buurt",showAll:"Toon alles"}},cz:{message:{eventsNearby:"Události v okolí",showAll:"Ukázat vše"}}}}},u=n("KHd+"),c=Object(u.a)(l,r,[],!1,null,null,null);c.options.__file="node_modules/@newland/toubiz-widget/src/components/tb-w-nearby-events.vue";t.default=c.exports}}]);