(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[5],{10:function(e,n,i){"use strict";i.r(n);var t=function(){var e=this,n=e.$createElement,i=e._self._c||n;return i("span",[e.resolvedOpeningTimes?e._t("render",[e.resolvedOpeningTimes?i("button",{staticClass:"tb-hours-now text-grey-darkest",attrs:{type:"button"},on:{click:function(n){return e.$emit("click",n)}}},[e._t("label_"+e.view,[e.languageLabels[e.view]?[e._v("\n                    "+e._s(e.languageLabels[e.view])+"\n                ")]:[e._v("\n                    either language label "),i("code",[e._v(e._s(e.view))]),e._v(" or one of the following slots must be implemented:\n                    "),i("ul",[e._m(0),e._v(" "),i("li",[i("code",[e._v("label_"+e._s(e.view))])])])]],{openingTimes:e.resolvedOpeningTimes}),e._v(" "),e._t("additional_label")],2):e._e()],{openingTimes:e.resolvedOpeningTimes,view:e.view}):e._e(),e._v(" "),e._t("additional_information",null,{openingTimes:e.openingTimes,upcomingOpeningTimes:e.upcomingOpeningTimes})],2)};t._withStripped=!0;var o=i(6),s=Object.freeze({NONE:"none",OPEN:"open",OPEN_CLOSING_SOON_REOPENS_TODAY:"open_closing_soon_reopens_today",OPEN_CLOSING_SOON:"open_closing_soon",OPEN_REOPENS_TODAY:"open_reopens_today",CLOSED_OPENS_SOON:"closed_opens_soon",CLOSED_OPENS_TODAY:"closed_opens_today",CLOSED_OPENS_TOMORROW:"closed_opens_tomorrow",CLOSED_OPENS_DAY_AFTER_TOMORROW:"closed_opens_day_after_tomorrow",CLOSED_OPENS_WITHIN_NEXT_WEEK:"closed_opens_within_next_week",CLOSED_OPENS_ON_DATE:"closed_opens_on_date",CLOSED:"closed"}),r={legacy:o.f,toubizV1:o.g},_={props:{openingTimesDefinition:{type:Object,required:!0},openingTimesFormat:{type:String,required:!0,validator:function(e){return-1!==Object.keys(r).indexOf(e)||(console.warn("openingTimesFormat must be one of ".concat(Object.keys(r).join(", "),". ").concat(e," is not allowed.")),!1)}},languageLabels:{type:Object,default:function(){return{}}}},data:function(){return{openingTimes:null,resolvedOpeningTimes:null}},mounted:function(){this.update()},methods:{getNextDates:function(e){for(var n=[],i=0;i<e;i++){var t=new Date;t.setDate(t.getDate()+i),n.push(t)}return n},update:function(){var e=this.parse(this.openingTimesDefinition,this.openingTimesFormat);if(e){this.openingTimes=e,this.resolvedOpeningTimes=e.timesAt(new Date);var n=new Date(this.resolvedOpeningTimes.nextOpenDate);this.resolvedOpeningTimes.nextOpenWeekday=n.getDay()}},parse:function(){if(!this.openingTimesDefinition)return null;var e=(new(0,r[this.openingTimesFormat])).parse(this.openingTimesDefinition);return e&&0!==e.times.length?e:null}},computed:{upcomingOpeningTimes:function(){var e=[],n=!0,i=!1,t=void 0;try{for(var o,s=this.getNextDates(7)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var r=o.value;e.push({weekday:r.getDay(),times:this.openingTimes?this.openingTimes.openingTimesForDate(r):null})}}catch(e){i=!0,t=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw t}}return e},view:function(){var e=this.resolvedOpeningTimes;if(!e)return s.NONE;if(e.isOpen)return e.minutesUntilClosing<=60?0===e.daysUntilNextOpen?s.OPEN_CLOSING_SOON_REOPENS_TODAY:s.OPEN_CLOSING_SOON:0===e.daysUntilNextOpen?s.OPEN_REOPENS_TODAY:s.OPEN;if(e.minutesUntilNextOpen<=60)return s.CLOSED_OPENS_SOON;switch(e.daysUntilNextOpen){case 0:return s.CLOSED_OPENS_TODAY;case 1:return s.CLOSED_OPENS_TOMORROW;case 2:return s.CLOSED_OPENS_DAY_AFTER_TOMORROW;case 3:case 4:case 5:case 6:case 7:return s.CLOSED_OPENS_WITHIN_NEXT_WEEK}return e.daysUntilNextOpen?s.CLOSED_OPENS_ON_DATE:s.CLOSED}}},O=i(2),a=Object(O.a)(_,t,[function(){var e=this.$createElement,n=this._self._c||e;return n("li",[n("code",[this._v("render")])])}],!1,null,null,null);a.options.__file="Resources/Private/Scripts/components/opening-times-line-preview.vue";n.default=a.exports}}]);