PageSourceSearch

https://www.jet2holidays.com/dist/search-villas-components.efca70628b73ae31fa67.js

js jet2holidays.com collected 2026-10-01 12:40:14 UTC 317,152 bytes, 1 lines download raw bytes

1(self.webpackChunkjet2holidays=self.webpackChunkjet2holidays||[]).push([[876],{80071:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var i=r(97479);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}const s=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"setItem",value:function(e,t){i.Ay.setItem(e,t)}},{key:"getItem",value:function(e){return i.Ay.getItem(e)}},{key:"removeItem",value:function(e){return i.Ay.removeItem(e)}},{key:"getAllItem",value:function(){return Object.keys(i.Ay)}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}())},1906:(e,t,r)=>{"use strict";r.d(t,{V:()=>h});var i=r(40599);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.queue=[]},(t=[{key:"length",get:function(){return this.queue.length}},{key:"peek",get:function(){return this.queue[0]}},{key:"push",value:function(e){var t=function(){var e={};return e.promise=new Promise((function(t,r){e.resolve=t,e.reject=r})),e}();return e.deferred=t,this.queue.push(e),t.promise}},{key:"dequeue",value:function(){var e=this.peek;return this._remove(e),e}},{key:"dequeueAll",value:function(e){var t=this.queue.filter(e);return this._removeAll(t),t}},{key:"_remove",value:function(e){var t=this.queue.indexOf(e);this.queue.splice(t,1)}},{key:"_removeAll",value:function(e){var t=this;e.forEach((function(e){return t._remove(e)}))}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}(),l=r(72005);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},c.apply(null,arguments)}function d(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,p(i.key),i)}}function p(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}var h=function(){return e=function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.queue=new s,this.beingProcessed=[],this.combineRequestsToSameUrl=t,this.ajaxOptions=null},(t=[{key:"push",value:function(e){var t=this.queue.push(e);return this.beingProcessed.length||this.process(),t}},{key:"resolveAll",value:function(e){this.beingProcessed.forEach((function(t){return t.deferred.resolve(e)}))}},{key:"rejectAll",value:function(e){this.beingProcessed.forEach((function(t){return t.deferred.reject(e)}))}},{key:"process",value:function(){var e=this;if(this.queue.length){var t=this.combineRequestsToSameUrl?this.queue.dequeueAll((function(t){return t.url===e.queue.peek.url})):[this.queue.dequeue()];this.beingProcessed=t;var r=this.beingProcessed[this.beingProcessed.length-1],n={beforeSend:l.y},o=null===r.ajaxOptions?n:c({},n,r.ajaxOptions);void 0!==r.useGetMethod&&null!==r.useGetMethod&&r.useGetMethod?i.Ay.getJson(r.url,o).then((function(t){return e.resolveAll(t)}
1)).catch((function(t){return e.rejectAll(t)})).then((function(){e.beingProcessed=[],e.process()})):i.Ay.postJson(r.url,r.request,o).then((function(t){return e.resolveAll(t)})).catch((function(t){return e.rejectAll(t)})).then((function(){e.beingProcessed=[],e.process()}))}}}])&&d(e.prototype,t),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},72005:(e,t,r)=>{"use strict";r.d(t,{y:()=>i});var i=function(e){e.setRequestHeader("X-Ajax-Referer",window.location.pathname+window.location.search)}},37126:(e,t,r)=>{"use strict";r.d(t,{G:()=>i});var i=function(e){return JSON.parse(JSON.stringify(e))}},19763:(e,t,r)=>{"use strict";r.d(t,{A:()=>p});var i=r(62662),n=r.n(i),o=r(54587);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},u.apply(null,arguments)}function c(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function d(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var p=function(){return e=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.props=u({},e.defaults(),r),this.$form=t},t=[{key:"createErrorMessage",value:function(e){return n()("<div>").addClass(this.props.errorMessageCssClass).html(e)}},{key:"getDefaultOptions",value:function(){return{showFirstErrorOnly:!1}}},{key:"loadValidationMessages",value:function(){var e={};return this.$form.find("input[name], select[name]").each((function(t,r){s(r.attributes).filter((function(e){return/^data-msg-/.test(e.name)})).forEach((function(t){var i,n=t.name.replace("data-msg-",""),a="required"===(i=(0,o.xQ)(n))?"presence":i,s=t.value;e[r.name]=e[r.name]||{},e[r.name][a]={message:s}}))})),e}},{key:"clearValidationErrors",value:function(){this.showValidationResults(null)}},{key:"showValidationResults",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getDefaultOptions(),r=this,i=0,o=[];return this.$form.find("input[name], select[name]").each((function(a,s){var l=e&&e[s.name],u=n()(s).closest(r.props.fieldGroupSelector),c=u.parent().find("."+r.props.errorMessageCssClass);if(!l||s.disabled||0!==i&&t.showFirstErrorOnly)c.length>0&&c.remove();else{i++;var d=e[s.name];1===d.length&&1===c.length?(c.html(d[0]).show(),o.push(d[0])):(c.remove(),d.forEach((function(e){var t=r.createErrorMessage(e);u.after(t),t.show(),o.push(e)})))}})),o}}],r=[{key:"defaults",value:function(){return{errorMessageCssClass:"search-box-group__error-message",fieldGroupSelector:".search-box-group__field"}}}],t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},97893:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>c});var i=r(62662),n=r.n(i),o=r(45159);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function l(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var c=l((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.$element=n()(t),this.$element.find(".js-dropdown").each((function(){new o.default(n()(this))}))}))},86565:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SearchPanels:()=>i});var i={FCPSearchPanel:"FCP",VillasSearchPanel:"Villas",BrandSearchPanel:"Brand"}},14580:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>g});var i=r(62662),n=r.n(i),o=r(93060),a=r(77768),s=r(6861),l=r(8988),u=r(40599),c=r(28556),d=r(79833),p=r.n(d),h=r(69231),f=r.n(h);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},v.apply(null,arguments)}function y(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,b(i.key),i)}}function b(e){var t=function(e,t){if("object"!=m(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=m(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==m(t)?t:t+""}var g=function(){return e=function e(t,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$element=n()(t),this.property=r.property,this.calendar=this.loadChildComponent("Availability-Calendar",a),this.searchCriteria=null,this.searchApiUrl="/api/jet2/availabilitycalendar/property",s.A.on("ShowPropertyPageAvailabilityCalendar:trigger",(function(e){return i.triggerShowAvailabilityCalendarContainer(e)})),s.A.on("AvailabilityCalendarEvent:optionSelected",(function(e){return i.redirectToVillaDetails(e)})),s.A.on("villaAvailabilitySearch:complete",(function(){return i.scrollToElem()})),s.A.on("applyPromoDiscount",(function(e){!0===e&&i.scrollToElem()})),s.A.on("promoToggleModal:closed",(function(){return i.scrollToElem()}))},(t=[{key:"scrollToElem",value:function(){f()(this.$element,"scroll",{duration:800})}},{key:"loadChildComponent",value:function(e,t){var r=this.$element.find('[data-childcomponent="'.concat(e,'"]'))[0];return o.A.initComponent(t,r).viewModel}},{key:"getSearchResults",value:function(e,t){e.propertyId=this.property.id;var r=(0,c.A)(e,"guests","destinations");return u.Ay.getJson(t,{data:v({},r,(0,u.zy)(e.guests))})}},{key:"redirectToVillaDetails",value:function(e){this.calendar.vue.$data.loaderIsVisible=!0;var t=location.protocol.concat("//").concat(window.location.hostname)+"/villas/search/details?",r=p()(e.outboundFlight.departureDateTime,"dd-mm-yyyy"),i=t+("property=".concat(this.property.id,"&date=").concat(r,"&duration=").concat(this.searchCriteria.duration,"&occupancy=").concat(this.createOccupancyUrlParameter())+"&airport=".concat(e.outboundFlight.departureAirportId,"&gtmSearchType=Property Search"));window.location.href=i}},{key:"createOccupancyUrlParameter",value:function(){return"r"+this.searchCriteria.guests.adults+"c"+this.searchCriteria.guests.children.join("_")}},{key:"triggerShowAvailabilityCalendarContainer",value:function(e){var t=this;this.searchCriteria=e.searchCriteria;var r=e.searchCriteria.departureDate.substring(0,4),i=e.searchCriteria.departureDate.substring(4,6),n=new Date(r,i-1,1),o={propertyId:this.property.id,selectedOption:null,showPricePerPerson:!0,selectedMonth:n,selectedBoardTypeId:null,propertyName:this.property.name,resort:this.property.resort,isSearchPanelButtonClicked:e.isSearchPanelButtonClicked};this.calendar.init(o,(function(r){return e.searchCriteria.departureDate=p()(r.selectedMonth,"yyyymm"),t.getSearchResults(e.searchCriteria,t.searchApiUrl)})),l.A.removeComponent("Content/TabbedContent"),this.$element.show()}}])&&y(e.prototype,t),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},33128:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>y,ViewModel:()=>a.default});var i=r(62662),n=r.n(i),o=r(51760),a=r(58913),s=r(93060),l=r(77768);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function d(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}function p(e,t,r){return t=m(t),function(e,t){if(t&&("object"==u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,r||[],m(e).constructor):t.apply(e,r))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=m(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},f.apply(null,arguments)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}var y=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=p(this,t,[e])).$element=n()(e),r.$element.find(".availability-calendar").addClass("availability-calendar--modal-view"),r.$element.addClass("modal--availability"),r.calendar=r.loadChildComponent("Availability-Calendar",l),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(t,e),r=t,i=[{key:"loadChildComponent",value:function(e,t){var r=this.$element.find('[data-childcomponent="'.concat(e,'"]'))[0];return s.A.initComponent(t,r).viewModel}},{key:"openAvailabilityCalendarModal",value:function(){this.open()}},{key:"close",value:function(){var e,r,i,n,o;this.calendar.close(),(e=t,r="close",i=this,o=f(m(1&(n=3)?e.prototype:e),r,i),2&n?function(e){return o.apply(i,e)}:o)([])}}],i&&c(r.prototype,i),o&&c(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,o}(o.default)},58913:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var i=r(6861),n=r(62662),o=r.n(n);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function l(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var u=function(){return e=function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.view=t,this.props=r,this.settings=this.props.settings,this.calendar=this.view.calendar,this.searchApiUrl="/api/jet2/availabilitycalendar/searchresults",i.A.on("ShowAvailabilityCalendar:clicked",(function(e){return n.triggerOpenAvailabilityCalendarModal(e)}))},(t=[{key:"getSearchResults",value:function(e,t){return new Promise((function(r){return o().ajax({type:"GET",url:t+"?propertyId="+e,traditional:!0,success:function(e){r(e)},error:function(){r({})}})}))}},{key:"triggerOpenAvailabilityCalendarModal",value:function(e){var t=this;this.calendar.init(e,(function(){return t.getSearchResults(e.propertyId,t.searchApiUrl)})),this.view.openAvailabilityCalendarModal()}}])&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},77768:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>c,ViewModel:()=>i.default});var i=r(7713),n=r(29606),o=r(80887);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},s.apply(null,arguments)}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var c=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.props=r},(t=[{key:"initialiseModel",value:function(e){return new o.Ay(s({el:this.element,name:"AvailabilityCalendar",propsData:this.props,components:{"promo-toggle":n.PromoToggleViewModel}},e))}}])&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},7713:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var i=r(6861),n=r(79833),o=r.n(n),a=r(15133),s=r(57992),l=r(54587),u=r(54512);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,p(i.key),i)}}function p(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}function h(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=m(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw n}}return s}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return v(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},y.apply(null,arguments)}var b={props:{isPromoApplied:{type:Boolean,required:!0}},data:{showPricePerPerson:null,selectedAirportTab:null,selectedBoardTypeId:null,selectedOption:null,selectedMonth:null,airports:null,allAirports:null,propertyId:null,searchResults:[],calendarBoxes:[],getSearchResults:null,selectedData:null,loaderIsVisible:!0,applyDiscount:!1},created:function(){var e=this;this.applyDiscount=this.isPromoApplied,i.A.on("applyPromoDiscount",(function(t){e.applyDiscount=t}))},methods:{handleAirportClick:function(e){this.changeAirportSelection(e)},handleDateSelection:function(e){!e.blank&&e.selectedOption&&(this.selectedOption=e.selectedOption,i.A.emit("AvailabilityCalendarEvent:optionSelected",this.selectedOption))},handleAirportSelection:function(e){this.changeAirportSelection(JSON.parse(e.target.value))},handlePrevMonth:function(){var e=new Date(this.selectedMonth.getFullYear(),this.selectedMonth.getMonth()-1,1);this.selectedData.selectedMonth=e,this.loadCalendarWithData(this.selectedData,this.get
1SearchResults)},handleNextMonth:function(){var e=new Date(this.selectedMonth.getFullYear(),this.selectedMonth.getMonth()+1,1);this.selectedData.selectedMonth=e,this.loadCalendarWithData(this.selectedData,this.getSearchResults)},changeAirportSelection:function(e){this.selectedAirportTab=e,this.calendarBoxes=[],this.buildCalendar()},loadCalendarWithData:function(e,t){var r=this;y(this.$data,{showPricePerPerson:null,selectedAirportTab:null,selectedBoardTypeId:null,selectedOption:null,selectedMonth:null,airports:null,allAirports:null,propertyId:null,searchResults:[],calendarBoxes:[],getSearchResults:null,selectedData:null,loaderIsVisible:!0,applyDiscount:!1},{selectedAirportTab:this.selectedAirportTab,applyDiscount:this.applyDiscount}),this.selectedData=e,this.getSearchResults=t;var n=t(e),o=(0,a.getResources)();Promise.all([n,o]).then((function(t){var n=f(t,2),o=n[0],a=n[1];if(r.allAirports=a.airports,Object.keys(r.allAirports).length>0){r.searchResults=r.convertToUTC(o),r.propertyId=e.propertyId,r.selectedOption=e.selectedOption,r.selectedOption?r.selectedMonth=r.currentDateSelection():r.selectedMonth=e.selectedMonth,r.showPricePerPerson=e.showPricePerPerson,r.selectedBoardTypeId=e.selectedBoardTypeId;var s=Array.from(new Set(r.searchResults.map((function(e){return e.outboundFlight.departureAirportCode}))));r.airports=s.map((function(e){return{name:r.allAirports[e].name,code:e}})),r.selectedAirportTab&&r.airports.some((function(e){return e.code===r.selectedAirportTab.code}))||(r.selectedAirportTab=r.getSelectedAirportTab()),r.airports.sort((function(e,t){var r=e.name.toLowerCase(),i=t.name.toLowerCase();return r<i?-1:r>i?1:0})),r.buildCalendar(),r.selectedAirportTab&&e&&(0,u.raiseAvailabilityCalendarBuilt)({airport:r.selectedAirportTab.name,departureDate:e.selectedMonth,searchResultsCount:r.searchResults.length,propertyName:e.propertyName,resort:e.resort,resources:a})}e.isSearchPanelButtonClicked&&(i.A.emit("villaAvailabilitySearch:complete"),e.isSearchPanelButtonClicked=!1),i.A.emit("updatePromoAvailable",o.some((function(e){return e.promoAvailable})))}))},convertToUTC:function(e){return e.map((function(e){return e.outboundFlight.departureDateTime=(0,s.HB)(e.outboundFlight.departureDateTime),e}))},getSelectedAirportTab:function(){var e;if(this.selectedOption)e={name:this.allAirports[this.selectedOption.outboundFlight.departureAirportCode],code:this.selectedOption.outboundFlight.departureAirportCode};else{var t=this.getCheapestOption();e=t?{name:this.allAirports[t.outboundFlight.departureAirportCode],code:t.outboundFlight.departureAirportCode}:this.selectedAirportTab}return e},buildCalendar:function(){for(var e=this,t=this.selectedMonth.getFullYear(),r=this.selectedMonth.getMonth(),i=new Date(t,r,1).getDay(),n=this.getDayFromIndex(i)-1,o=0;o<n;o++)this.calendarBoxes.push({blank:!0,date:void 0,selectedOption:void 0});for(var a=new Date(t,r+1,0).getDate(),s=1;s<=a;s++){var l=this.searchResults.find((function(t){return new Date(t.outboundFlight.departureDateTime).getDate()===s&&new Date(t.outboundFlight.departureDateTime).getMonth()===r&&t.outboundFlight.departureAirportCode===e.selectedAirportTab.code&&e.boardTypeCheck(t.boardOptions)}));this.calendarBoxes.push({blank:!1,date:new Date(t,r,s),selectedOption:l})}this.loaderIsVisible=!1},boardTypeCheck:function(e){var t=this;return!this.selectedBoardTypeId||e.some((function(e){return e.boardId===t.selectedBoardTypeId}))},getDayFromIndex:function(e){return 0===e?7:e},isActive:function(e){if(e.blank||!e.selectedOption)return!1;var t=this.currentDateSelection();return!!t&&(t.getTime()===new Date(e.selectedOption.outboundFlight.departureDateTime).getTime()&&this.selectedOption.outboundFlight.departureAirportCode===this.selectedAirportTab.code)},isBlank:function(e){return!!e.blank},isUnavailable:function(e){return!e.blank&&!e.selectedOption},isCheapest:function(e){var t,r=this;if(e.blank||!e.selectedOption)return!1;t=this.selectedBoardTypeId?e.selectedOption.boardOptions.find((function(e){return e.boardId===r.selectedBoardTypeId})).totalPrice:this.getCheapestBoard(e.selectedOption.boardOptions).totalPrice;var i,n=h(this.searchResults);try{for(n.s();!(i=n.n()).done;){var o=i.value;if(o.boardOptions.find((function(e){return e.totalPrice<t&&e.boardId===r.selectedBoardTypeId}))&&o.outboundFlight.departureAirportCode===this.selectedAirportTab.code)return!1}}catch(e){n.e(e)}finally{n.f()}return!0},getCheapestOption:function(){var e,t=this.searchResults[0],r=h(this.searchResults);try{for(r.s();!(e=r.n()).done;){var i=e.value;this.getCheapestBoard(i.boardOptions).totalPrice<this.getCheapestBoard(t.boardOptions).totalPrice&&(t=i)}}catch(e){r.e(e)}finally{r.f()}return t},getCheapestBoard:function(e){var t,r=e[0],i=h(e);try{for(i.s();!(t=i.n()).done;){var n=t.value;n.totalPrice<r.totalPrice&&(r=n)}}catch(e){i.e(e)}finally{i.f()}return r},displayDay:function(e){return e.blank?"":o()(e.date,"dd")}
1,displayMonth:function(e){return e.blank?"":o()(e.date,"mmm")},displayMonthYear:function(){return this.selectedMonth?o()(this.selectedMonth,"mmmm yy"):""},displayDayOfWeek:function(e){return e.blank?"":o()(e.date,"ddd")},displayPrice:function(e){var t,r=this;if(!e.selectedOption)return"";if(t=this.selectedBoardTypeId?e.selectedOption.boardOptions.find((function(e){return e.boardId===r.selectedBoardTypeId})):this.getCheapestBoard(e.selectedOption.boardOptions)){var i,n,o,a,s,u,c,d,p=this.selectedData.disabledTouristTax?t.basePrice:t.basePrice+(null!==(i=null===(n=t.touristTax)||void 0===n?void 0:n.totalCostInGBP)&&void 0!==i?i:0),h=this.selectedData.disabledTouristTax?t.basePricePerPerson:t.basePricePerPerson+(null!==(o=null===(a=t.touristTax)||void 0===a?void 0:a.perPayingPersonCostInGBP)&&void 0!==o?o:0),f=this.selectedData.disabledTouristTax?t.pricePerPerson:t.pricePerPerson+(null!==(s=null===(u=t.touristTax)||void 0===u?void 0:u.perPayingPersonCostInGBP)&&void 0!==s?s:0),m=this.selectedData.disabledTouristTax?t.totalPrice:t.totalPrice+(null!==(c=null===(d=t.touristTax)||void 0===d?void 0:d.totalCostInGBP)&&void 0!==c?c:0);return this.showPricePerPerson?(0,l.vv)(this.applyDiscount?f:h)+"pp":(0,l.vv)(this.applyDiscount?m:p)}return""},currentDateSelection:function(){return this.selectedOption?new Date(this.selectedOption.outboundFlight.departureDateTime):null}},computed:{isPrevMonthDisabled:function(){if(this.selectedMonth){var e=new Date;return new Date(this.selectedMonth.getFullYear(),this.selectedMonth.getMonth()-1,1)<new Date(e.getFullYear(),e.getMonth(),1)}return!1}}},g=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.view=t,this.vue=this.view.initialiseModel(b)},(t=[{key:"init",value:function(e,t){this.vue.loadCalendarWithData(e,t)}},{key:"close",value:function(){var e={propertyId:this.vue.$data.propertyId,selectedOption:this.vue.$data.selectedOption,showPricePerPerson:this.vue.$data.showPricePerPerson};null!==e.selectedOption&&null!==e.showPricePerPerson&&i.A.emit("AvailabilityCalendarEvent:optionChanged",e)}}])&&d(e.prototype,t),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},64223:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>p,ViewModel:()=>o.default});var i=r(62662),n=r.n(i),o=r(15934),a=r(69231),s=r.n(a),l=r(89159);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function d(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}var p=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.$element=n()(t),this.$search=this.$element.find(".search-box"),this.$btn=this.$element.find(".js-button"),this.scrollTop=n()(window).scrollTop(),this.elementOffset=this.$element.offset().top,this.fixedClass="dropdown-search-panel-container--fixed",this.searchVisibleClass="dropdown-search-panel-container--search-visible",this.animating=!1,this.init()},t=[{key:"init",value:function(){var e=this;l.A.isMobile()||(this.checkScrollPosition(),n()(window).on("scroll",(function(t){var r=n()(t.currentTarget);e.scrollTop=r.scrollTop(),e.checkScrollPosition()}))),this.onButtonClick()}},{key:"checkScrollPosition",value:function(){this.elementOffset>this.scrollTop?this.unsetFixed():this.setFixed()}},{key:"setFixed",value:function(){this.$element.addClass(this.fixedClass)}},{key:"unsetFixed",value:function(){this.$element.removeClass(this.fixedClass)}},{key:"onButtonClick",value:function(){var e=this;this.$btn.on("click",(function(){if(!e.animating){e.animating=!0;var t=e.$element.hasClass(e.searchVisibleClass)?"slideUp":"slideDown";e.animateSearchPanel(t),e.animating=!1}}))}},{key:"animateSearchPanel",value:function(e){var t=this,r=l.A.isMobile()?500:300;s()(this.$search,e,{duration:r,complete:function(){t.$element.toggleClass(t.searchVisibleClass)}})}}],t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},15934:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}r.r(t),r.d(t,{default:()=>a});var a=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.view=t,this.props=r,this.subscribeToEvents()},(t=[{key:"subscribeToEvents",value:function(){}},{key:"runSomeLogic",value:function(){alert("non view logic")}}])&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},33971:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>p});var i=r(80887),n=r(17650);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function c(e,t,r){return t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var p=c((function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.vm=new i.Ay(s(s({},n.FlexiblePaymentDropDownButtonDepositViewModel),{},{propsData:r,name:"FlexiblePaymentDropDownButtonDeposit",el:t}))}))},17650:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FlexiblePaymentDropDownButtonDepositViewModel:()=>i});var i={props:{totalDeposit:{type:Number,required:!0}}}},79487:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>p});var i=r(80887),n=r(31454);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function c(e,t,r){return t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var p=c((function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.vm=new i.Ay(s(s({},n.FlexiblePaymentDropDownContentViewModel),{},{propsData:r,name:"FlexiblePaymentDropDownContent",el:t}))}))},31454:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FlexiblePaymentDropDownContentViewModel:()=>n});var i=r(6861),n={data:function(){return{isPromoApplied:!1}}
1,props:{viewModel:{type:Object,required:!0}},mounted:function(){var e=this;this.isPromoApplied=this.viewModel.isPromoApplied,i.A.on("applyPromoDiscount",(function(t){e.isPromoApplied=t}))},computed:{totalDeposit:function(){return this.viewModel.minDepositAmount},balanceDueDate:function(){return this.viewModel.balanceDueDate},remainingBalance:function(){return this.isPromoApplied?this.viewModel.totalCost-this.viewModel.minDepositAmount:this.viewModel.baseCost-this.viewModel.minDepositAmount}}}},63834:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>c});var i=r(62662),n=r.n(i),o=r(45159);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function l(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var c=l((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.$element=n()(t),this.$element.find(".js-dropdown").each((function(){new o.default(n()(this))}))}))},9819:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createBedroomsFilter:()=>o,default:()=>a});var i=r(80887),n=r(32906),o=function(e){return new n.SingleChoiceFilter(e,e+" bedrooms","bedrooms")};const a=i.Ay.component("bedrooms-filter",{props:{filters:{type:Array,required:!0},availableFilters:{type:Array,required:!0}},methods:{handleChange:function(e){var t,r,i=parseInt(e.target.value);i?(t="filter-selected",r=o(i)):(t="filter-deselected",r=this.filters[0]),this.$emit(t,r)}},computed:{bedroomsOptions:function(){var e=this.filters[0]?parseInt(this.filters[0].id):0;return this.availableFilters.map((function(t){return{bedrooms:t,selected:e===t}}))}}})},67584:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var i=r(80887),n=r(1187);const o=i.Ay.component("clear-filters",{props:{category:{type:String,required:!0},groupIndex:{type:String,required:!0}},data:function(){return{state:n.default.state}},methods:{handleClearTheseFiltersClick:function(){n.default.removeFilters(this.category,this.groupIndexNumeric)}},computed:{categoryHasFilters:function(){var e=this;if("facilities"===this.category){if(this.state.filters.facilities.filter((function(t){return t.groupIndex===e.groupIndexNumeric})).length>0)return!0}else if(this.category){if(this.state.filters[this.category].length>0)return!0}return!1},groupIndexNumeric:function(){return parseInt(this.groupIndex)}}})},22245:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var i=r(80887),n=r(32906),o=r(15133);const a=i.Ay.component("departure-airport-filter",{props:{filters:{type:Array,required:!0},availableFilters:{type:Array,required:!0},departureAirports:{type:Array,required:!0}},data:function(){return{airports:[]}},created:function(){var e=this;(0,o.getResources)().then((function(t){e.airports=t.airports}))},methods:{handleChange:function(e,t){var r,i=e.code,o=e.name,a=t.target.checked,s=a?"filter-selected":"filter-deselected";r=a?new n.Filter(i,o,"departureAirports"):this.filters.find((function(e){return e.id===i})),this.$emit(s,r)}},computed:{airportOptions:function(){var e=this;return Object.keys(this.airports).length>0&&this.availableFilters.length>0?this.departureAirports.map((function(t){return{code:t,name:e.airports[t].name,isDisabled:!e.availableFilters.includes(t),selected:e.filters.some((function(e){return e.id===t}))}})).sort((function(e,t){return e.name.localeCompare(t.name)})):[]}}})},36240:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createDepartureDateFilter:()=>l,default:()=>u});var i=r(80887),n=r(79833),o=r.n(n),a=r(57992),s=r(32906),l=function(e){var t=e.getDate();return new s.Filter(t,o()(e,"ddd dd mmm yy"),"departureDates")};const u=i.Ay.component("departure-date-filter",{props:{departureMonth:{type:Date,required:!0},filters:{type:Array,required:!0},availableFilters:{type:Array,required:!0}},methods:{handleChange:function(e,t){var r,i=e.value,n=t.target.checked,a=n?"filter-selected":"filter-deselected",l=i.getDate();r=n?new s.Filter(l,o()(i,"ddd dd mmm yy"),"departureDates"):this.filters.find((function(e){return e.id===l})),this.$emit(a,r)}},computed:{departureMonthLabel:function(){return o()(this.departureMonth,"mmmm yyyy")},days:function(){var e=this,t=(0,a.PK)(this.departureMonth).map((function(t){return{value:t,id:"date_"+t.getDate(),label:o()(t,"dd/mm/yyyy"),day:o()(t,"dd"),dayOfWeek:o()(t,"ddd"),disabled:!e.availableFilters.includes(t.getDate()),selected:e.filters.some((function(e){return e.id===t.getDate()}))}}));return t}}})},76220:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var i=r(80887),n=r(32906),o=r(15133);const a=i.Ay.component("destination-filter",{props:{destinations:{type:Array,required:!0},availableFilters:{type:Array,required:!0},filters:{type:Array,required:!0}},data:function(){return{regions:[]}},created:function(){var e=this;(0,o.getResources)().then((function(t){e.regions=t.regions}))},methods:{handleChange:function(e,t){var r,i=t.target.checked,o=i?"filter-selected":"filter-deselected";
1r=i?new n.Filter(e.value,e.name,"destination"):this.filters.find((function(t){return t.id===e.value})),this.$emit(o,r)}},computed:{destinationOptions:function(){var e=this;return Object.keys(this.regions).length>0&&null!==this.availableFilters&&this.availableFilters.length>0?this.destinations.map((function(t){return{value:t,name:e.regions[t].name,disabled:!e.availableFilters.includes(t),selected:e.filters.some((function(e){return e.id===t}))}})).sort((function(e,t){return e.name.localeCompare(t.name)})):[]}}})},7308:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var i=r(80887),n=r(32906);const o=i.Ay.component("facilities-group-filter",{props:{facilities:{type:Array,required:!0},filters:{type:Array,required:!0},availableFilters:{type:Array,required:!0},groupIndex:{type:Number,required:!0}},methods:{handleChange:function(e,t){var r,i=e.value,o=t.target.checked,a=o?"filter-selected":"filter-deselected";r=o?new n.Filter(i.id,i.name,"facilities",null,this.groupIndex):this.filters.find((function(e){return e.id===i.id})),this.$emit(a,r)}},computed:{facilityOptions:function(){var e=this;return this.facilities.map((function(t){return{value:t,id:"facility_"+t.id,label:t.name,disabled:!e.availableFilters.includes(t.id),selected:e.filters.some((function(e){return e.id===t.id}))}}))}}})},32906:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t,r){return t=a(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}
1function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function u(e,t,r){return t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.r(t),r.d(t,{Filter:()=>p,SingleChoiceFilter:()=>h});var p=u((function e(t,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;d(this,e),this.id=t,this.label=r,this.category=i,this.value=n,this.dateCreated=new Date,this.groupIndex=o})),h=function(e){function t(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return d(this,t),(o=n(this,t,[e,r,i,a])).isSingleChoice=!0,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(t,e),u(t)}(p)},85492:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var i=r(80887),n=r(32906),o=r(1187);const a=i.Ay.component("price-range-filter",{props:{availableFilters:{type:Array,required:!0},filters:{type:Array,required:!0}},methods:{handleChange:function(e,t){var r,i=t.target.checked,o=i?"filter-selected":"filter-deselected",a=e.value;r=i?new n.Filter(a.id,e.name,"priceRanges",a):this.filters.find((function(e){return e.id===a.id})),this.$emit(o,r)},isLastRange:function(e){return e===this.availableRanges.length-1}},computed:{availableRanges:function(){return this.availableFilters.filter((function(e){return e.isTotal!==o.default.state.showPricePerPerson}))},priceRangeOptions:function(){var e=this;return this.availableRanges.map((function(t,r){return{id:t.id,value:t,name:"£".concat(t.min)+(e.isLastRange(r)?"+":" - £".concat(t.max)),selected:e.filters.some((function(e){return e.id===t.id})),disabled:!t.enabled}}))}}})},24225:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>D,ViewModel:()=>o.default});var i=r(89463),n=r(51760),o=r(4948),a=r(54587),s=r(34763),l=r(80887),u=r(7308),c=r(36240),d=r(22245),p=r(76220),h=r(9819),f=r(85492),m=r(67584),v=r(96892),y=r(97893);function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},g.apply(null,arguments)}function k(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,w(i.key),i)}}function w(e){var t=function(e,t){if("object"!=b(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=b(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==b(t)?t:t+""}function S(e,t,r){return t=O(t),function(e,t){if(t&&("object"==b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,C()?Reflect.construct(t,r||[],O(e).constructor):t.apply(e,r))}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(C=function(){return!!e})()}
1function T(e,t,r,i){var n=P(O(1&i?e.prototype:e),t,r);return 2&i?function(e){return n.apply(r,e)}:n}function P(){return P="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},P.apply(null,arguments)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}var j=i.Ay.create("searchFilters"),M="show-loader",D=function(e){function t(e,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=S(this,t,[e])).initialiseOnLoad=r.initialiseOnLoad||!1,i.$element.addClass("modal--wide"),i.titleTemplate=i.title,i.initialised=!1,i.handleSearchResultsTotalChanged(0),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(t,e),r=t,(i=[{key:"showLoadingSpinner",value:function(){this.$element.addClass(M)}},{key:"hideLoadingSpinner",value:function(){this.$element.removeClass(M)}},{key:"getModalTitle",value:function(e){var t={resultscount:e};return(0,a.GP)(this.titleTemplate,t)}},{key:"handleSearchResultsTotalChanged",value:function(e){this.title=this.getModalTitle(e)}},{key:"subscribeToEvents",value:function(){T(t,"subscribeToEvents",this,3)([]),(0,s.onSeachResultsTotalChanged)(this.handleSearchResultsTotalChanged.bind(this))}},{key:"init",value:function(e){j.info("Initialising searchResultsOptions component");var t=this.element.querySelector(".filter-modal"),r=this.initialiseOnLoad,i=this.initialise.bind(this);return this.vueComponent=new l.Ay(g({},{name:"SearchFilters",el:t,propsData:{filterCountLabelTemplate:t.getAttribute("data-applied-filters-count-label")},components:{FacilitiesGroupFilterComponent:u.default,DepartureDateFilterComponent:c.default,DepartureAirportFilterComponent:d.default,DestinationFilterComponent:p.default,BedroomsFilterComponent:h.default,PriceRangeFilterComponent:f.default,ClearFiltersComponent:m.default},mounted:function(){r&&i(this.$el)}},e)),this.vueComponent}},{key:"open",value:function(){T(t,"open",this,3)([]),this.initialise(this.vueComponent.$el)}},{key:"initialise",value:function(e){this.initialised||(this.initialised=!0,new y.View(e.querySelector(".accordion-container")),new v.default(e,!1))}}])&&k(r.prototype,i),n&&k(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,n}(n.default)},4948:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>f});var i=r(89463),n=r(54587),o=r(1187),a=r(4973),s=r(34763),l=r(3291);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function d(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}var p=i.Ay.create("searchFiltersVm"),h={props:{filterCountLabelTemplate:{type:String,required:!0}},data:function(){return{searchOptions:o.default.state}},methods:{getFilters:function(e,t){return this.searchOptions.filters[e].filter((function(e){return e.groupIndex===t}))},getFilterCount:function(e,t){return this.getFilters(e,t).length},hasFilters:function(e,t){return this.getFilterCount(e,t)>0},appliedFilters:function(e,t){var r=this.getFilterCount(e,t);return(0,n.GP)(this.filterCountLabelTemplate,{count:r})},isDisabled:function(e,t){return!!this.searchOptions.searchCriteria&&("departureAirports"===e&&this.searchOptions.searchCriteria.departureAirports.length<2||("destination"===e&&this.searchOptions.searchCriteria.destinations.length<2||"bedrooms"===e&&0===this.searchOptions.availableFilters.bedrooms.length))},handleFilterSelected:function(e){o.default.addFilter(e)},handleFilterDeselected:function(e){o.default.removeFilter(e)},handleClearAllFiltersClick:function(){o.default.removeAllFilters()},handleFilterPriceOptionChange:function(e){o.default.changePriceOption(JSON.parse(e.target.value))},handlePriceModeClick:function(e){(e.target.htmlFor===this.pricePerPersonId&&this.showPricePerPerson||e.target.htmlFor===this.priceTotalId&&!this.showPricePerPerson)&&(e.preventDefault(),e.stopPropagation())}},computed:{showPricePerPerson:function(){return this.searchOptions.showPricePerPerson},showDepartureDateFilter:function(){return null!==this.departureMonth},departureMonth:function(){if(!this.searchOptions.searchCriteria)return null;var e=this.searchOptions.searchCriteria.departureDate;return new Date("".concat(e.substring(0,4),"-").concat(e.substring(4,6),"-01T00:00:00"))},departureAirports:function(){if(!this.searchOptions.searchCriteria)return[];var e=this.searchOptions.searchCriteria.departureAirports;return e},destinations:function(){if(!this.searchOptions.searchCriteria)return[];var e=this.searchOptions.searchCriteria.destinations.map(Number);return e},allFilters:function(){return Object.values(this.searchOptions.filters).reduce((function(e,t){return e.concat(t)}),[])},hasAnyFilters:function(){for(var e=0,t=Object.values(this.searchOptions.filters);e<t.length;e++){if(t[e].length>0)return!0}return!1},pricePerPersonId:function(){return"".concat(this._uid,"_filter-per-person")},priceTotalId:function(){return"".concat(this._uid,"_filter-total")}},components:{PriceSwitch:l.PriceSwitchViewModel}},f=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.view=t,this.vueComponent=t.init(h),this.view.onModalClosed(this.onModalClosed.bind(this)),this.subscribeToEvents()},(t=[{key:"openModal",value:function(e){this.callback=e,p.debug("opening modal..."),this.view.open()}},{key:"onModalClosed",value:function(){this.callback()}},{key:"handleSearchFiltersChanged",value:function(){this.view.showLoadingSpinner()}},{key:"handleSearchResponseProcessed",value:function(){this.view.hideLoadingSpinner()}},{key:"subscribeToEvents",value:function(){(0,a.onSearchFiltersChanged)(this.handleSearchFiltersChanged.bind(this)),(0,s.onSearchResponseProcessedEvent)(this.handleSearchResponseProcessed.bind(this))}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},36896:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});r(62662);var i=r(20041),n=r.n(i);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function s(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}Modernizr.mq("only screen and (max-width:767px)");var u=s((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);new(n())(t)}))},96892:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var i=r(62662),n=r.n(i),o=r(89159),a=r(20041),s=r.n(a),l=r(69231),u=r.n(l),c=r(77144);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return h(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function f(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,m(i.key),i)}}function m(e){var t=function(e,t){if("object"!=d(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=d(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==d(t)?t:t+""}var v=function(){return e=function e(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.el=n()(t),this.container=this.el.find(".js-search-filter-container"),this.searchPanel=n()(".js-search-filter"),this.optionsPanel=this.el.find(".js-options-panel"),this.optionsArea=this.el.find(".js-options-area"),this.optionsAreaInner=this.el.find(".js-options-area-inner"),this.optionsTotal=this.el.find(".js-options-total"),this.panelExpandButton=this.el.find(".js-option-panel-opener"),this.filterPanels=this.el.find(".js-accordion-content"),this.filterTabs=this.el.find(".js-filter-tabs"),this.filterTabsNav=this.el.find(".js-tabs-nav"),this.nav=this.el.find(".js-filter-tabs-nav"),this.mobileNav=this.el.find(".js-accordion-trigger"),this.panels=this.el.find(".js-filter-tabs-panel"),this.accordionContent=this.panels.find(".js-accordion-content"),this.isMobile=o.A.isMobile(),this.isPanelExpanded=!1,this.tagsArray=[],this.init(r)},t=[{key:"init",value:function(e){e&&(this.addEventListeners(),this.initClearAll(),this.initClearTab(),this.initPriceSwitchBox(),this.initCheckboxes(),this.initSelects(),this.initDropdown()),this.initTabs(),this.initAccordion(),this.initResize(),this.initSticky()}},{key:"addEventListeners",value:function(){n()(document).on("filter:add",this.onFilterAdd.bind(this)),n()(document).on("filter:remove",this.onFilterRemove.bind(this))}},{key:"initTabs",value:function(){new(s())(".js-filter-tabs")}},{key:"initCheckboxes",value:function(){n()(".js-filter-checkbox").on("click",this.onCheckboxClicked.bind(this))}},{key:"onCheckboxClicked",value:function(e){var t=n()(e.target),r=t.val();t.is(":checked")?this.dispatchAddEvent(r):this.dispatchRemoveEvent(r),this.dispatchMapUpdate()}},{key:"dispatchAddEvent",value:function(e){n().event.trigger({type:"filter:add",filterName:e})}},{key:"dispatchRemoveEvent",value:function(e){n().event.trigger({type:"filter:remove",filterName:e})}},{key:"dispatchMapUpdate",value:function(){n()(document).trigger("map-explorer",{customEvent:"filterChanged",filterParams:this.tagsArray}
1)}},{key:"onFilterAdd",value:function(e){var t=e.filterName;this.addToArray(t),this.addToPanel(t),this.addSync(t),this.updateTabNote(),this.updateTotal(),this.toggleDropdownBtn()}},{key:"addSync",value:function(e){var t,r=n()('.js-filter-checkbox[value="'+e+'"]:not(:checked)'),i=n()('.js-filter-select:has(option[value="'+e+'"]:not(:selected))'),o=p(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;n()(a).prop("checked",!0)}}catch(e){o.e(e)}finally{o.f()}var s,l=p(i);try{for(l.s();!(s=l.n()).done;){var u=s.value,c=n()(u);c.val(e),c.attr("data-value",e)}}catch(e){l.e(e)}finally{l.f()}}},{key:"addToArray",value:function(e){this.tagsArray.unshift(e)}},{key:"addToPanel",value:function(e){var t=n()(this.createFilterTag(e));this.optionsAreaInner.prepend(t),t.find(".js-filter-tag-button").on("click",this.onTagButtonClicked.bind(this)),this.optionsPanel.hasClass("is-active")||(this.optionsPanel.addClass("is-active"),this.el.addClass("is-opened"))}},{key:"createFilterTag",value:function(e){c.A.load(["icon-cancel"]);var t=document.createElement("div"),r=document.createElement("span");return t.className="filter-tag js-filter-tag",r.className="filter-tag__name js-filter-tag-name",r.innerHTML=e,t.appendChild(r),t.innerHTML+='<button class="filter-tag__close js-filter-tag-button" type="button"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--cancel" width="10" height="10"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-cancel"></use></svg></button>',t}},{key:"onTagButtonClicked",value:function(e){var t,r=n()(e.currentTarget).closest(".js-filter-tag").find(".js-filter-tag-name").html(),i=n()('.js-filter-checkbox[value="'+r+'"]:checked'),o=n()('.js-filter-select:has(option[value="'+r+'"]:selected)'),a=p(i);try{for(a.s();!(t=a.n()).done;){var s=t.value,l=n()(s);l.is(":checked")&&l.prop("checked",!1)}}catch(e){a.e(e)}finally{a.f()}var u,c=p(o);try{for(c.s();!(u=c.n()).done;){var d=u.value,h=n()(d);h.prop("selectedIndex",0),h.attr("data-value","")}}catch(e){c.e(e)}finally{c.f()}this.removeFromArray(r),this.removeFromPanel(r),this.updateTabNote(),this.dispatchMapUpdate(),this.updateTotal()}},{key:"onFilterRemove",value:function(e){var t=e.filterName;this.removeFromArray(t),this.removeFromPanel(t),this.removeSync(t),this.updateTabNote(),this.updateTotal(),this.toggleDropdownBtn()}},{key:"removeSync",value:function(e){var t,r=n()('.js-filter-checkbox[value="'+e+'"]:checked'),i=n()('.js-filter-select:has(option[value="'+e+'"]:selected)'),o=p(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;n()(a).prop("checked",!1)}}catch(e){o.e(e)}finally{o.f()}var s,l=p(i);try{for(l.s();!(s=l.n()).done;){var u=s.value,c=n()(u);c.prop("selectedIndex",0),c.attr("data-value","")}}catch(e){l.e(e)}finally{l.f()}}},{key:"removeFromArray",value:function(e){var t=this.tagsArray.indexOf(e);t>=0&&this.tagsArray.splice(t,1)}},{key:"removeFromPanel",value:function(e){var t,r=p(this.optionsAreaInner.find(".js-filter-tag-name"));try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.innerHTML===e){var o=n()(i).parent();this.filterTagFadeOut(o)}}}catch(e){r.e(e)}finally{r.f()}this.tagsArray.length||(this.optionsPanel.removeClass("is-active"),this.el.removeClass("is-opened"))}},{key:"filterTagFadeOut",value:function(e){}},{key:"remove",value:function(e){n()(e).remove(),58===this.optionsArea.prop("scrollHeight")&&(this.panelExpandButton.removeClass("is-active"),this.optionsArea.css("max-height","58px"),this.isPanelExpanded=!1),this.toggleDropdownBtn()}},{key:"updateTabNote",value:function(){var e,t=p(this.filterPanels);try{for(t.s();!(e=t.n()).done;){var r=e.value,i=n()(r),o=i.find(".js-filter-checkbox:checked"),a=i.find('.js-filter-select:not(:has(option[value=""]:selected))'),s=o.length+a.length,l=i.parent().prev(".js-accordion-trigger").find(".js-filter-tabs-note");s?(i.attr("data-applied-filters",s),l.html(s+" filters applied")):(i.attr("data-applied-filters",""),l.html(""))}}catch(e){t.e(e)}finally{t.f()}var u,c=this.filterTabs.find("[data-applied-filters]"),d=(this.filterTabs.filter(c),p(c));try{for(d.s();!(u=d.n()).done;){var h=u.value,f=n()(h),m=f.attr("data-applied-filters"),v=f.closest(".
1js-filter-tabs-panel").attr("id"),y=this.filterTabsNav.find('.js-filter-tabs-nav[href="#'+v+'"]').find(".js-filter-tabs-note");m?y.html(m+" filters applied"):y.html("")}}catch(e){d.e(e)}finally{d.f()}}},{key:"initSelects",value:function(){n()(".js-filter-select").on("change",this.onSelectChanged.bind(this))}},{key:"onSelectChanged",value:function(e){var t=n()(e.target),r=t.val(),i=t.attr("data-value");r?r!==i&&""!==i?(this.dispatchRemoveEvent(i),this.dispatchAddEvent(r)):this.dispatchAddEvent(r):this.dispatchRemoveEvent(i),t.attr("data-value",r),this.dispatchMapUpdate()}},{key:"initClearTab",value:function(){this.clearTabButtons=n()(".js-clear-tab-button"),this.clearTabButtons.on("click",this.onClearTabClicked.bind(this))}},{key:"onClearTabClicked",value:function(e){var t,r=n()(e.target).closest(".js-accordion-content"),i=r.find(".js-filter-checkbox:checked"),o=r.find('.js-filter-select:not(:has(option[value=""]:selected))'),a=p(i);try{for(a.s();!(t=a.n()).done;){var s=t.value,l=n()(s).val();this.removeFromArray(l),this.removeFromPanel(l),this.removeSync(l)}}catch(e){a.e(e)}finally{a.f()}var u,c=p(o);try{for(c.s();!(u=c.n()).done;){var d=u.value,h=n()(d).val();this.removeFromArray(h),this.removeFromPanel(h),this.removeSync(h)}}catch(e){c.e(e)}finally{c.f()}this.updateTabNote(),this.dispatchMapUpdate()}},{key:"initClearAll",value:function(){this.clearAllButtons=n()(".js-clear-all-tabs-button"),this.clearAllButtons.on("click",this.onClearAllClicked.bind(this))}},{key:"onClearAllClicked",value:function(e){var t,r=p(this.tagsArray);try{for(r.s();!(t=r.n()).done;){var i=t.value;this.removeSync(i)}}catch(e){r.e(e)}finally{r.f()}this.tagsArray=[],this.optionsAreaInner.empty(),this.optionsPanel.removeClass("is-active"),this.optionsArea.css("max-height","58px"),this.panelExpandButton.removeClass("is-active"),this.isPanelExpanded=!1,this.el.removeClass("is-opened"),this.updateTabNote(),this.dispatchMapUpdate()}},{key:"initResize",value:function(){o.A.onBreakpointChange(this.onBreakpointChange.bind(this))}},{key:"onBreakpointChange",value:function(e){var t=this.isMobile,r="mobile"===e;this.isMobile=r,r&&!t?(n()(document).off("scroll",this.bindedScroll),this.el.removeClass("is-fixed"),this.el.css("height","auto"),this.resetAccordion()):!r&&t&&(this.initSticky(),this.resetAccordion())}},{key:"initSticky",value:function(){this.isMobile||(this.onScroll(),n()(document).on("scroll",this.bindedScroll=this.onScroll.bind(this)))}},{key:"onScroll",value:function(){this.isMobile||(window.pageYOffset>=this.searchPanel.offset().top?(this.searchPanel.outerHeight()>0&&this.searchPanel.height(this.el.outerHeight()),this.searchPanel.addClass("is-fixed")):(this.searchPanel.css("height","auto"),this.searchPanel.removeClass("is-fixed")))}},{key:"initDropdown",value:function(){this.el.find(".js-option-panel-opener").on("click",this.dropdownHandler.bind(this))}},{key:"dropdownHandler",value:function(e){var t=n()(e.currentTarget);58!==this.optionsArea.prop("scrollHeight")&&(this[this.isPanelExpanded?"closeDropdown":"openDropdown"](),this.isPanelExpanded?t.addClass("is-active"):t.removeClass("is-active"))}},{key:"openDropdown",value:function(){this.isPanelExpanded=!0,u()(this.optionsArea,"slideDown",{duration:400})}},{key:"closeDropdown",value:function(){this.isPanelExpanded=!1,u()(this.optionsArea,"slideUp",{duration:400})}},{key:"initAccordion",value:function(){var e=this.el.find(".js-accordion-trigger");e.length&&(e.on("click",this.accordionHandler.bind(this)),this.isMobile&&this.resetAccordion())}},{key:"resetAccordion",value:function(){if(this.isMobile=o.A.isMobile(),this.isMobile){this.el.find(".js-filter-tabs-panel").css("display","block"),this.accordionContent.attr("style",""),this.mobileNav.removeClass("is-active");var e=this.nav.filter(".is-active");if(e.length){var t=e.attr("href").replace(/^#/,""),r=this.panels.filter("#"+t).find(".js-accordion-trigger"),i=r.next();r.addClass("is-active"),i.css("max-height","initial")}}else{this.el.find(".js-filter-tabs-panel").css("display","none");var n=(this.mobileNav.filter(".is-active").length?this.mobileNav.filter(".is-active").first():this.mobileNav.first()).attr("href");this.nav.filter('[href="'+n+'"]').trigger("click")}}}
1,{key:"accordionHandler",value:function(e){var t=this,r=n()(e.currentTarget),i=r.closest(".js-filter-tabs-panel"),o=r.next();e.preventDefault(),i.length||(i=r.closest(".js-dropdown"));var a="false"===i.attr("aria-hidden");a?u()(o,"slideUp",{duration:400,begin:function(){r.removeClass("is-active"),i.attr("aria-hidden","true")},complete:function(){t.animationComplete(o,a)}}):(o.css({"max-height":"none",overflow:"hidden"}),u()(o,"slideDown",{duration:400,begin:function(){r.addClass("is-active"),i.attr("aria-hidden","false")},complete:function(){t.animationComplete(o,a)}}))}},{key:"animationComplete",value:function(e,t){t&&e.css({"max-height":"none",overflow:"visible"})}},{key:"initPriceSwitchBox",value:function(){var e=n()(".js-sb-price");if(!e.length)return!1;var t=n()(e).find(".js-sb-price__radio");n()(t).on("click",(function(e){t.filter('[data-id="'+n()(e.target).data("id")+'"]').prop("checked",!0)}))}},{key:"updateTotal",value:function(){this.optionsTotal.text(this.tagsArray.length)}},{key:"toggleDropdownBtn",value:function(){if(this.isMobile)return!1;this.optionsArea.prop("scrollHeight")>60?this.optionsPanel.addClass("has-dropdown"):this.optionsPanel.removeClass("has-dropdown")}}],t&&f(e.prototype,t),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},4973:(e,t,r)=>{"use strict";r.r(t),r.d(t,{onSearchFiltersChanged:()=>a,searchFiltersChanged:()=>o});var i=r(6861),n="SearchResultsOptions:searchFiltersChanged";function o(e){i.A.emit(n,e)}function a(e){i.A.on(n,e)}},1187:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var i=r(9819),n=r(36240),o=r(4973),a=r(37126);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var l=function(e){return"object"===s(e)},u={state:{searchCriteria:null,showPricePerPerson:!0,sortOrder:3,filters:{bedrooms:[],departureAirports:[],destination:[],departureDates:[],priceRanges:[],facilities:[]},filterWatcher:0,availableFilters:{bedrooms:[],departureAirports:[],destination:[],departureDates:[],priceRanges:[],facilities:[]},searchResults:[]},changePriceOption:function(e){this.state.showPricePerPerson=e,this.state.filters.priceRanges.length&&this.removeFilters("priceRanges",0)},changeSortOrder:function(e){this.state.sortOrder=e},addFilter:function(e){e.isSingleChoice?this.state.filters[e.category]=[e]:this.state.filters[e.category].push(e),this.triggerSearchUpdate()},addMinBedroomsFilter:function(e){var t=(0,i.createBedroomsFilter)(e);this.addFilter(t),this.triggerSearchUpdate()},addDepartureDateFilter:function(e){var t=(0,n.createDepartureDateFilter)(e);this.addFilter(t),this.triggerSearchUpdate()},removeFilter:function(e){this.state.filters[e.category]=this.state.filters[e.category].filter((function(t){return t.id!==e.id||t.groupIndex!==e.groupIndex})),this.triggerSearchUpdate()},removeFilters:function(e,t){var r=this;this.state.filters[e].filter((function(e){return e.groupIndex===t})).forEach((function(e){return r.removeFilter(e)})),this.triggerSearchUpdate()},removeAllFilters:function(){var e=this;Object.values(this.state.filters).reduce((function(e,t){return e.concat(t)}),[]).forEach((function(t){return e.removeFilter(t)})),this.triggerSearchUpdate()},triggerSearchUpdate:function(){(0,o.searchFiltersChanged)((0,a.G)(this.state.filters)),this.state.filterWatcher+=1,this.saveState()},removeUnavailableFilters:function(){var e=this,t={},r=!1;Object.keys(this.state.filters).forEach((function(i){var n=e.state.filters[i].filter((function(t){return(r=e.state.availableFilters[i],r.filter((function(e){return!l(e)||e.enabled})).map((function(e){return l(e)?e.id:e}))).includes(t.id);var r}));r||n.length===e.state.filters[i].length||(r=!0),t[i]=n})),r&&(this.state.filters=t),this.saveState()},loadState:function(){var e=sessionStorage.getItem("storeState");e&&(this.state=JSON.parse(e))},saveState:function(){sessionStorage.setItem("storeState",JSON.stringify(this.state))}};u.loadState();const c=u},21955:(e,t,r)=>{"use strict";r.r(t);var i=r(14423),n=r(96892);new i.A({className:"js-search-filter.delete",origClass:n.default})},34208:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>f,ViewModel:()=>o.default});var i=r(80887),n=r(89463),o=r(3561),a=r(59430),s=r(24225),l=r(93060);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},c.apply(null,arguments)}function d(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,p(i.key),i)}}function p(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}var h=n.Ay.create("searchResultsOptions"),f=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.props=r,this.element.querySelector('input[name="prices"][checked]').removeAttribute("checked")},(t=[{key:"init",value:function(e){return h.info("Initialising searchResultsOptions component"),new i.Ay(c({},{name:"SearchResultsOptions",el:this.element.querySelector(".js-search-filter"),propsData:{filterButtonLabelTemplate:this.props.filterButtonLabel,showPerPersonPriceByDefault:this.props.showPerPersonPriceByDefault,defaultSortOrder:parseInt(this.element.querySelector('select[name="sortOrder"]').value),searchFiltersModal:null},components:{TagPanelComponent:a.default},mounted:function(){this.searchFiltersModal=l.A.initChildComponent(this.$el.parentNode,"SearchFilters",s)}},e))}}])&&d(e.prototype,t),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},3561:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var i=r(34763),n=r(1187),o=r(54587),a=r(89463),s=r(80071),l=r(31094),u=r(6861);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,h(i.key),i)}}function p(e,t,r){return t&&d(e.prototype,t),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}var f=a.Ay.create("searchResultsOptionsVm"),m="View_Price_Selected_Filter",v={props:["filterButtonLabelTemplate","showPerPersonPriceByDefault","defaultSortOrder","searchFiltersModal","isPromoApplied"],created:function(){var e=this;(0,i.onSeachResultsTotalChanged)((function(t){e.showFilterButton=!0,e.filterButtonLabel=(0,o.GP)(e.filterButtonLabelTemplate,{resultscount:t})})),this.applyDiscount=this.isPromoApplied,u.A.on("applyPromoDiscount",(function(t){e.applyDiscount=t}))},data:function(){var e=s.A.getItem(m);return n.default.state.showPricePerPerson=e?JSON.parse(e):this.showPerPersonPriceByDefault,n.default.state.sortOrder=this.defaultSortOrder,{state:n.default.state,showFilterButton:!1,filterButtonLabel:"",selectedSortOption:n.default.state.sortOrder,isTagPanelExpanded:!1,canToggleTagPanel:!1,appliedFilterCountTemplate:"",applyDiscount:!1}},methods:{handlePriceOptionChange:function(e){s.A.setItem(m,e),n.default.changePriceOption(e)},handleSortOrderChange:function(e){var t=parseInt(e.target.value);f.debug("handleSortOrderChange",t),n.default.changeSortOrder(t)},handleFilterButtonClick:function(){this.searchFiltersModal.openModal((function(){f.debug("filter modal closed")}))},handleDeleteTag:function(e){n.default.removeFilter(e.filter)},handleClearAllFiltersClick:function(){n.default.removeAllFilters()},handleTagPanelHeightChange:function(e){this.canToggleTagPanel=e.canBeToggled},handleTagPanelStateChange:function(e){this.isTagPanelExpanded=e.isExpanded},toggleTagPanel:function(){this.canToggleTagPanel&&this.$refs.tagPanel.toggle()},handleMapButtonClick:function(){f.info("map button clicked"),(0,l.searchResultsMapOpened)({applyDiscount:this.applyDiscount}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"search_results_interactions",category:"View on Map",action:"Click",label:"Main Map"})}},computed:{hasAvailableFilters:function(){return Object.values(this.state.availableFilters).reduce((function(e,t){return e.concat(t)}),[]).length>0},selectedFilters:function(){return Object.values(this.state.filters).reduce((function(e,t){return e.concat(t)}),[])},appliedFilterCount:function(){return this.selectedFilters.length},appliedFilterCountFormatted:function(){return(0,o.GP)(this.appliedFilterCountTemplate,{count:this.appliedFilterCount})},showTags:function(){return this.tags.length>0&&this.hasAvailableFilters},tags:function(){var e=this.selectedFilters.sort((function(e,t){return t.dateCreated-e.dateCreated})).map((function(e){return{id:e.id,label:e.label,filter:e}}));return e}}},y=p((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.init(v)}))},59430:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var i=r(80887),n=r(9966),o=r(8988);const a=i.Ay.component("tag-panel",{props:{cssClass:{type:String,required:!0}},template:'\n            <div v-bind:class="cssClass" v-bind:css="false">\n                <transition-group name="tagList" ref="tagList" v-bind:css="false" class="option-
1panel__options-inner" tag="div" v-on:leave="onBeforeTagRemoved" v-on:after-enter="onAfterTagAdded">\n                    <slot></slot>\n                </transition-group>\n            </div>\n            ',created:function(){var e=this;o.A.onResizeFinished((function(){e.checkPanelState()}))},data:function(){return{isExpanded:!1,defaultHeight:58,scrollHeight:58,canBeToggled:!1}},methods:{checkPanelState:function(){this.checkIfCanBeToggled(),this.isExpanded&&(this.canBeToggled?this.expand():this.collapse())},onAfterTagAdded:function(){var e=this;this.$nextTick((function(){e.checkPanelState()}))},onBeforeTagRemoved:function(e,t){var r=this;(0,n.filterTagFadeOut)(e,(function(){t(),r.checkPanelState()}))},getCurrentScrollHeight:function(){return this.$el.scrollHeight},checkIfCanBeToggled:function(){var e=this.canBeToggled;this.canBeToggled=this.getCurrentScrollHeight()>this.defaultHeight,e!==this.canBeToggled&&this.$emit("tag-panel-height-changed",{canBeToggled:this.canBeToggled})},animate:function(e,t){var r=this;(0,n.animatePanel)(this.$el,e,t,(function(){r.checkIfCanBeToggled(),r.$emit("tag-panel-state-changed",{isExpanded:r.isExpanded})}))},toggle:function(){this.isExpanded?this.collapse():this.expand()},collapse:function(){this.isExpanded=!1;var e=this.scrollHeight;this.scrollHeight=this.defaultHeight,this.animate(e,this.scrollHeight)},expand:function(){this.isExpanded=!0;var e=this.scrollHeight;this.scrollHeight=this.getCurrentScrollHeight(),this.animate(e,this.scrollHeight)}}})},9966:(e,t,r)=>{"use strict";r.r(t),r.d(t,{animatePanel:()=>l,filterTagFadeOut:()=>s});var i=r(62662),n=r.n(i),o=r(69231),a=r.n(o),s=function(e,t){var r="-".concat(n()(e).outerWidth(!0),"px");a()(e,"fadeOut",{duration:250,complete:function(){a()(e,{translateX:r},{delay:150,duration:250,complete:function(){t(e)}})}})},l=function(e,t,r,i){t!==r?a()(e,{maxHeight:[r,t]},{duration:400,complete:function(){i(e)}}):e.style.maxHeight=r}},83971:()=>{},89408:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>d,ViewModel:()=>a.default});var i=r(62662),n=r.n(i),o=r(89463),a=r(169);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=o.Ay.create("searchResultsPageTitle"),d=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c.info("Initialising searchResultsPageTitle component"),this.$element=n()(t),this.$title=this.$element.find(".js-title")},(t=[{key:"title",set:function(e){this.$title.html(e)}}])&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},169:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var i=r(54587),n=r(34763);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l=function(){return e=function e(t,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.searchingText=r.searching,this.completeText=r.complete,(0,n.onSeachResultsTotalChanged)((function(e){t.title=i.getPageTitle(e)}
1))},(t=[{key:"getPageTitle",value:function(e){var t={resultscount:e};return(0,i.GP)(this.completeText,t)}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},5541:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var i=r(62662),n=r.n(i),o=r(95773),a=r.n(o),s=r(67518),l=r(29970),u=r(77144);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}var d={markerSquare:r(80044),markerDest:r(28655),markerChild:r(30689),poiShort:r(84284),poiDetails:r(36161),villaShort:r(84628),villaDetails:r(71753),loadMore:r(88918)};function p(e,t){this.$el=n()(e),this.state={externalConf:!1,filter:{curLevel:this.$el.data("level")||0,curTab:null,airportId:null,holidayType:"Villas"},pinTypes:{airport:0,destination:1,pointOfInterest:2,hotel:3,childDestination:4,fake:5,villas:6,complexVilla:7},tabs:this.buildInitialTabs(),ajax:this.buildInitialAjax(),curLocation:{id:this.$el.data("location-id")||0},prevLocationList:[],mapOptions:null,markers:[],activeMarker:null,ajaxGetExtConfigWorking:!1,ajaxMarkersWorking:!1,ajaxMarkersDetailsWorking:!1,isMobile:n()("body").hasClass("is-mobile"),mobileWidth:768,isDetailsOpened:!1,clusters:[],hideOverviewTab:this.$el.data("hide-overview-tab"),hidePoiTab:this.$el.data("hide-poi-tab"),defaultHolidayType:"Villas",filterParams:[],villaCardList:[],type:this.$el.data("type"),isVisible:!1,modalId:this.$el.data("modal-id")},this.checkElements(),this.bindEvents(),"ready to init"===this.status&&(this.init(),this.status="gmap inited")}p.prototype.buildInitialTabs=function(){return{1:{id:1,hasMarkers:!1,hasMoreDetails:!1,loadMoreView:null,page:0,isVisible:!1},2:{id:2,hasMarkers:!1,hasMoreDetails:!1,loadMoreView:null,page:0,isVisible:!1},3:{id:3,hasMarkers:!1,hasMoreDetails:!1,loadMoreView:null,page:0,isVisible:!1},4:{id:4,hasMarkers:!1,hasMoreDetails:!1,loadMoreView:null,page:0,isVisible:!1}}},p.prototype.buildInitialAjax=function(){return{getMapInitJson:{xhr:null,isWorking:!1},getMap:{xhr:null,isWorking:!1},getDetailsForPage:{xhr:null,isWorking:!1}
1,getPinDetails:{xhr:null,isWorking:!1}}},p.prototype.checkElements=function(){this.$gmapContainer=this.$el.find(".js-map-explorer-gmap");var e=this.$el.find(".js-me-tabs"),t=this.$el.find(".js-map-explorer-details__content"),r=this.$el.find(".js-map-explorer-details");if(!(this.$gmapContainer.length&&t.length&&e.length&&r.length))return this.status="init errors",window.console&&window.console.warn("Some elements have not been found."),!1;this.mapTabsElem=new s.default(e),this.mapTabsElem.hideElem(),this.$detailsView=t,this.$detailsOpenerBtn=r,this.status="ready to init"},p.prototype.init=function(){this.checkGoogleMapsApi(),n()(document).on("modal:is-hidden",this.clearMap.bind(this))},p.prototype.checkGoogleMapsApi=function(){"object"===("undefined"==typeof google?"undefined":c(google))&&"object"===c(google.maps)?this.afterMapsApiLoaded():this.loadMapsApi()},p.prototype.loadMapsApi=function(){var e=document.createElement("script");e.async=!0,e.src="https://maps.googleapis.com/maps/api/js?v=3&client=gme-jet2&channel=holidaystestd&callback=loadCallback",window.loadCallback=this.afterMapsApiLoaded.bind(this),document.body.appendChild(e)},p.prototype.afterMapsApiLoaded=function(){this.preventLoadFonts(),a()(["/assets/Destinations/app/vendors/richmarker.js","/assets/Destinations/app/vendors/markerclusterer.js"],function(){n()(document).on("modal:is-visible",this.initMap.bind(this))}.bind(this))},p.prototype.preventLoadFonts=function(){var e=document.getElementsByTagName("head")[0],t=e.insertBefore;e.insertBefore=function(r,i){r.href&&0===r.href.indexOf("https://fonts.googleapis.com/css?family=Roboto")||t.call(e,r,i)}},p.prototype.initMap=function(e){if(e&&"modal:is-visible"===e.type){if(e.modalId!==this.state.modalId)return!1;e.dataTargetId&&(r=e.dataTargetId),e.dataTargetType&&(i=e.dataTargetType||1)}var t=this.state.pinTypes,r=this.state.curLocation.id,i=t.destination;this.state.isVisible=!0,this.getExtConfig(r,i),this.status="inited"},p.prototype.clearMap=function(e){if(e&&"modal:is-visible"===e.type&&e.modalId!==this.state.modalId)return!1;this.clearLevel(),this.state.filter.curLevel=null,this.state.filter.holidayType=this.state.defaultHolidayType,this.state.curLocation={id:this.$el.data("location-id")||0},this.state.prevLocationList=[],this.state.isVisible=!1,this.status="gmap inited"},p.prototype.getMapBounds=function(){var e=this.gmap.getBounds().getNorthEast(),t=this.gmap.getBounds().getSouthWest
1();this.state.bounds={topLeft:{latitude:e.lat(),longitude:t.lng()},bottomRight:{latitude:t.lat(),longitude:e.lng()}}},p.prototype.controller=function(){var e=this.state.filter.curLevel,t=this.state.filter.curTab,r=this.state.markers,i=this.state.pinTypes,n={},o=[];switch(e){case 0:if(n={pinTypes:[i.airport]},o=this.filterMarkers(r,n),this.hideMarkers(o),1===t)this.drawMarkers(o),n={pinTypes:[i.destination]},o=this.filterMarkers(r,n),this.drawMarkers(o);break;case 1:switch(n={pinTypes:[i.airport,i.destination]},o=this.filterMarkers(r,n),this.hideMarkers(o),this.hideClusters(),t){case 1:this.drawMarkers(o),this.showClusters(r,[i.childDestination]);break;case 2:this.strategyForPinType(i.pointOfInterest);break;case 3:this.strategyForPinType(i.hotel);break;case 4:this.strategyForPinType(i.villas)}break;case 2:switch(n={pinTypes:[i.airport]},o=this.filterMarkers(r,n),this.hideMarkers(o),this.hideClusters(),t){case 1:this.drawMarkers(o),this.showClusters(r,[i.destination]);break;case 2:this.strategyForPinType(i.pointOfInterest);break;case 3:this.strategyForPinType(i.hotel);break;case 4:this.strategyForPinType(i.villas)}break;case 3:switch(n={pinTypes:[i.airport]},o=this.filterMarkers(r,n),this.hideMarkers(o),this.hideClusters(),t){case 1:this.drawMarkers(o),"Villas"===this.state.curLocation.holidayType?this.showClusters(r,[i.pointOfInterest,i.villas]):this.showClusters(r,[i.pointOfInterest,i.hotel]);break;case 2:this.strategyForPinType(i.pointOfInterest);break;case 3:this.strategyForPinType(i.hotel);break;case 4:this.strategyForPinType(i.villas)}}},p.prototype.strategyForPinType=function(e){var t,r,i,n=this.state.pinTypes,o=this.state.markers;if(t=this.getTab({pinType:e}),r={pinTypes:[e]},e===n.villas&&(r.pinTypes=[n.villas,n.complexVilla]),i=this.filterMarkers(o,r),(3===this.state.filter.curLevel||this.state.isMobile&&2===this.state.filter.curLevel&&"City Break"===this.state.filter.holidayType)&&(this.state.tabs[t].hasMarkers=!0),!this.state.tabs[t].hasMarkers)return this.getMarkers(e),!1;if(i.length&&(this.showClusters(i,[e]),this.$el.removeClass("is-map-overlayed")),e===n.villas){var a=this.countTotalPins(e)+" villas in this area";this.mapTabsElem.fillTab(a,t,"total",!0)}var s=this.state.tabs[t].page;0===s&&this.getMarkersDetails(e,s)},p.prototype.observer=function(e,t){var r=this.state.pinTypes;if(t){switch(t.customEvent){case"tabChanged":this.state.activeMarker&&this.state.activeMarker.pinType===r.complexVilla&&this.onClickBtnComplexBack(),this.state.filter.curTab=t.tabId?t.tabId:null;break;case"filterChanged":this.state.filterParams=t.filterParams?t.filterParams:[],this.state.isVisible&&(this.clearLevel(),this.getMarkers());break;case"tabbedContentChanged":if(t.tabHash&&"#location"===t.tabHash&&"inited"!==this.status)return this.initMap(),!1}this.controller()}},p.prototype.initLevel=function(){var e=this.state.filter.curLevel;if(this.$el.attr("data-level",e),this.state.prevLocationList.length?this.$el.addClass("is-level-back-visible"):this.$el.removeClass("is-level-back-visible"),!this.state.isMobile&&0===e){var t={customEvent:"holidayTypeChanged",holidayType:this.state.filter.holidayType};n()(document).trigger("map-filter-type",t)}this.initMapOptions(),this.gmap&&(google.maps.event.clearListeners(this.gmap,"bounds_changed"),google.maps.event.clearListeners(this.gmap,"idle"),google.maps.event.clearListeners(this.gmap,"clusteringend")),this.gmap=new google.maps.Map(this.$gmapContainer[0],this.state.mapOptions),this.gmap.addListener("bounds_changed",this.getMapBounds.bind(this)),this.gmap.addListener("idle",this.onMapIdle.bind(this)),this.gmap.addListener("clusteringend",this.onCluseringEnd.bind(this))},p.prototype.clearLevel=function(){this.resetAllAjax(),this.hideClusters(),this.removeMarkers(),this.state.tabs=this.buildInitialTabs(),this.state.filter.curTab=null,this.state.filter.airportId=null,this.mapTabsElem.clearTabs(),this.mapTabsElem.hideElem(),this.mapTabsElem.setActiveTab(1),this.destroyClasses(),this.state.markers=[],this.state.activeMarker=null,this.state.clusters=[],this.$el.removeClass("is-details"),this.$el.removeClass("is-map-overlayed"),this.$el.removeClass("is-aside-overlayed")}
1,p.prototype.destroyClasses=function(e){for(var t=0,r=(e=e||this.state.markers).length;t<r;t++)e[t].linkedClass&&"object"===c(e[t].linkedClass)&&(e[t].linkedClass.destroy(),e[t].linkedClass=null)},p.prototype.onMapIdle=function(){if(this.state.markers.length)return!1;this.getMarkers()},p.prototype.onCluseringEnd=function(){if(this.state.toGenerateClustersLeft--,!this.state.toGenerateClustersLeft&&this.state.markers.length&&this.state.curLocation.pinId){var e=this.findMarker(this.state.curLocation.pinId);if(this.state.curLocation.pinId=null,!e)return!1;this.getClusterWithActiveMarkerInside(e),this.showMarkerDetails(e),this.state.isMobile||(this.mapTabsElem.setActiveTab(this.state.filter.curTab),this.controller())}},p.prototype.initMapOptions=function(){var e=this.state.curLocation.zoomLevel||this.$el.data("zoom");this.state.isMobile&&e--,this.state.mapOptions={center:{lat:this.state.curLocation.latitude||this.$el.data("latitude"),lng:this.state.curLocation.longitude||this.$el.data("longitude")},zoom:e,disableDefaultUI:!0,zoomControl:!0,styles:this.getMapStyles()}},p.prototype.getMapStyles=function(){return{0:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.country",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.locality",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.province",stylers:[{visibility:"off"}]},{featureType:"road",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit.station",stylers:[{visibility:"off"}]}],1:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.country",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.locality",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.province",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit.station",stylers:[{visibility:"off"}]}],2:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit.station",stylers:[{visibility:"off"}]}],3:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit.station",stylers:[{visibility:"off"}]}]}[this.state.filter.curLevel]},p.prototype.filterMarkers=function(e,t){for(var r=[],i=0,n=e.length;i<n;i++){var o=this.complexFiltering(e[i],t);o&&r.push(o)}return r},p.prototype.complexFiltering=function(e,t){var r=this.state.pinTypes,i=t.pinTypes,o=t.holidayType,a=t.airportId;if(!e||"object"!==c(e))return null;if(n().isArray(i)&&-1===i.indexOf(e.pinType))return null;if(o&&(e.pinType===r.destination||e.pinType===r.fake)&&(e.holidayType||(e.holidayType="Beach Holiday"),e.holidayType!==o))return null;if(a&&(e.pinType===r.destination||e.pinType===r.fake)&&n().isArray(e.departucheAirports)){for(var s=0,l=!1,u=e.departucheAirports.length;s<u;s++)if(e.departucheAirports[s]===a){l=!0;break}return l?e:null}return t.ignoreGroupId&&e.villaGroupId?null:e},p.prototype.getClusterWithActiveMarkerInside=function(e){var t=!1,r=e.pinType;if(!this.state.clusters[r])return!1;for(var i=this.state.clusters[r].getClusters(),n=0,o=i.length;n<o;n++)for(var a=i[n].getMarkers(),s=0,l=a.length;s<l;s++)if(a[s].id===e.id)return t=!0,this.gmap.setZoom(this.state.isMobile?17:20),this.gmap.panTo(a[s].getPosition()),void(this.state.isMobile&&this.gmap.panBy(0,85));!t&&e.richMarker&&this.gmap.panTo(e.richMarker.getPosition())},p.prototype.hideClusters=function(){for(var e=this.state.clusters,t=0,r=e.length;t<r;t++)e[t].markerClusterer.clearMarkers()},p.prototype.showClusters=function(e,t){if(!(e||n().isArray(e)||t||n().isArray(t)))return!1;var r=0,i=t.length,o=this.state.pinTypes;for(this.state.toGenerateClustersLeft=i;r<i;r++){var a=t[r],s="",l={pinTypes:[a]};a!==o.destination&&a!==o.childDestination||(s=this.state.filter.holidayType,l.holidayType=this.state.filter.holidayType),a===o.villas&&(l.pinTypes.push(o.complexVilla),l.ignoreGroupId=!0);for(var u=this.filterMarkers(e,l),c=[],d=0,p=u.length;d<p;
1d++)u[d].richMarker||this.generateRichMarker(u[d],!1),c.push(u[d].richMarker);if(c.length){var h=this.findCluster(a,s);h&&h.markerClusterer?h.markerClusterer.addMarkers(c):this.generateCluster(c,a,s)}}},p.prototype.generateCluster=function(e,t,r){var i;this.state.pinTypes;if(!e&&!n().isArray(e)&&!t)return!1;i=3===this.state.filter.curLevel?this.state.isMobile?this.state.curLocation.zoomLevel-2:this.state.curLocation.zoomLevel-1:19;var o=[{cssClass:this.getClusterCssClass(t,r)}],a={pinType:t,holidayType:r,markerClusterer:new MarkerClusterer(this.gmap,e,{styles:o,clusterClass:"marker",ignoreHidden:!0,maxZoom:i,averageCenter:!0,anchor:RichMarkerPosition.BOTTOM,anchorOffset:{width:0,height:-10},batchSizeIE:100,gridSize:50})};this.state.clusters.push(a)},p.prototype.findCluster=function(e,t){for(var r=this.state.clusters,i=0,n=r.length;i<n;i++)if(r[i].pinType===e){if(t&&r[i].holidayType===t)return r[i];if(!t)return r[i]}return null},p.prototype.drawMarkers=function(e){if(!e&&!n().isArray(e))return!1;for(var t=0,r=e.length;t<r;t++)e[t].richMarker?this.showMarker(e[t]):this.generateRichMarker(e[t],!0);this.$el.removeClass("is-map-overlayed")},p.prototype.generateRichMarker=function(e,t){var r=this.state.pinTypes,i=e.latitude,n=e.longitude;if(!e&&"object"!==c(e))return!1;void 0===t&&(t=!0);var o="",a="",s="";e.pinType===r.destination&&(o=this.getMarkerCssClass(e),a=d.markerDest({marker:e,cssClass:o})),e.pinType!==r.airport&&e.pinType!==r.pointOfInterest&&e.pinType!==r.hotel&&e.pinType!==r.villas&&e.pinType!==r.complexVilla||(s=this.getMarkerIconName(e),o=this.getMarkerCssClass(e),a=d.markerSquare({marker:e,cssClass:o,iconClass:s})),e.pinType===r.childDestination&&(o=this.getMarkerCssClass(e),a=d.markerChild({marker:e,cssClass:o})),e.pinType===r.fake&&(i=e.fakeLatitude,n=e.fakeLongitude,o=this.getMarkerCssClass(e),a=d.markerDest({marker:e,cssClass:o})),e.richMarker=new RichMarker({map:t?this.gmap:null,position:new google.maps.LatLng(i,n),flat:!0,content:a,anchor:RichMarkerPosition.BOTTOM,type:e.pinType,id:e.id})},p.prototype.hideMarkers=function(e){if(!(e=e||this.state.markers)&&!n().isArray(e))return!1;for(var t=0,r=e.length;t<r;t++)this.hideMarker(e[t])},p.prototype.hideMarker=function(e){if(!e||"object"!==c(e)||!e.richMarker)return!1;e.richMarker.setVisible(!1)},p.prototype.showMarker=function(e){if(!e||"object"!==c(e)||!e.richMarker)return!1;e.richMarker.setVisible(!0)},p.prototype.removeMarkers=function(e){for(var t=0,r=(e=e||this.state.markers).length;t<r;t++){var i=e[t];i.richMarker&&i.richMarker.setMap(null)}},p.prototype.getMarkerCssClass=function(e){var t=this.state.pinTypes;switch(e.pinType){case t.airport:return"marker--square marker--grey marker--airport";case t.pointOfInterest:return"marker--square marker--poi";case t.hotel:return"marker--square marker--hotel";case t.villas:return"marker--square marker--villas";case t.complexVilla:return"marker--square marker--villas marker--complex";case t.childDestination:return"Villas"===e.holidayType?"marker-child--villas":"marker-child--beach";case t.destination:return"City Break"===e.holidayType?"marker-dest--city":"Villas"===e.holidayType?"marker-dest--villas":"marker-dest--beach";default:return"marker-dest--beach"}},p.prototype.getClusterCssClass=function(e,t){var r=this.state.pinTypes;switch(e){case r.pointOfInterest:return"marker--cluster marker--square marker--poi";case r.hotel:return"marker--cluster marker--square marker--hotel";case r.villas:return"marker--cluster marker--square marker marker--villas";case r.childDestination:return"Villas"===t?"marker--cluster marker-dest marker-dest--villas":"marker--cluster marker-dest marker-dest--beach";case r.destination:return"City Break"===t?"marker--cluster marker-dest marker-dest--city":"Villas"===t?"marker--cluster marker-dest marker-dest--villas":"marker--cluster marker-dest marker-dest--beach";default:return"marker--cluster marker-dest marker-dest--beach"}},p.prototype.getMarkerIconName=function(e){var t=this.state.pinTypes;switch(e.pinType){case t.airport:return"plane";case t.hotel:return"hotel";case t.pointOfInterest:return e.icon;case t.villas:case t.complexVilla:return"villa";default:return"beaches"}},p.prototype.getTemplateName=function(e,t){var r=this.state.pinTypes;
1switch(e){case r.pointOfInterest:return t?"poiDetails":"poiShort";case r.hotel:return t?"hotelDetails":"hotelShort";case r.villas:return t?"villaDetails":"villaShort";case r.destination:return"destCard";case"location":return"locOverview";default:return""}},p.prototype.generateItem=function(e){var t=this.state.pinTypes;if(!e&&"object"!==c(e))return!1;var r=this.getTemplateName(e.isLocation?"location":e.pinType),i="beaches";return e.pinType&&e.pinType===t.destination&&("City Break"===e.holidayType&&(i="cities"),"Villas"===e.holidayType&&(i="villas")),r?d[r]({marker:e,modClass:i}):null},p.prototype.hideViews=function(e){if(!e||!n().isArray(e))return!1;for(var t=0,r=e.length;t<r;t++)e[t].linkedView&&n()(e[t].linkedView).removeClass("is-visible")},p.prototype.showViews=function(e){if(!e||!n().isArray(e))return!1;for(var t=0,r=e.length;t<r;t++)e[t].linkedView&&n()(e[t].linkedView).addClass("is-visible")},p.prototype.fillTab=function(e,t,r,i,o){var a=this.state.pinTypes;if(e&&r){for(var s=0,u=[],c=e.length,d=null;s<c;s++){var p=e[s];p.pinType===t&&(p.linkedView||(d=this.generateItem(p))&&(p.linkedView=n()(d)),u.push(e[s].linkedView),p.pinType!==a.villas&&p.pinType!==a.complexVilla||(p.linkedClass=new l.default(e[s].linkedView)))}this.mapTabsElem.fillTab(u,r,i,o),this.state.tabs[r].hasMoreDetails?this.showLoadMore(r):this.hideLoadMore(r)}},p.prototype.findMarker=function(e,t,r){if(!e)return null;e=String(e);for(var i=0,n=(r=r||this.state.markers).length;i<n;i++)if(r[i].id===e&&(!t||t&&r[i].pinType===t))return r[i];return null},p.prototype.bindEvents=function(){if(n()(document).on("map-explorer",this.observer.bind(this)),"single-villa"===this.state.type&&this.state.isMobile)return!1;this.$el.on("mouseover",".js-map-explorer__dest-card",this.onMouseOverViewHandler.bind(this)),this.$el.on("mouseout",".js-map-explorer__dest-card",this.onMouseOutViewHandler.bind(this)),this.$el.on("click",".js-map-explorer__dest-card",this.onClickViewHandler.bind(this)),this.$el.on("mouseover",".js-map-explorer__marker",this.onMouseOverMarkerHandler.bind(this)),this.$el.on("mouseout",".js-map-explorer__marker",this.onMouseOutMarkerHandler.bind(this)),this.$el.on("click",".js-map-explorer__marker",this.onClickMarkerHandler.bind(this)),this.$el.on("click",".js-map-explorer-details__back",this.onClickBtnBackHandler.bind(this)),this.$el.on("click",".js-map-explorer-details-opener",this.onClickBtnDetailsOpener.bind(this)),this.$el.on("click",".js-map-explorer-details__complex-back",this.onClickBtnComplexBack.bind(this)),this.$el.on("click",".js-map-explorer__view-link",this.onClickViewLinkHandler.bind(this)),this.$el.on("click",".js-map-explorer__load-more",this.onClickBtnLoadMoreHandler.bind(this)),this.$el.on("click",".js-map-explorer-level-back",this.onClickBtnLevelBackHandler.bind(this))},p.prototype.onMouseOverMarkerHandler=function(e){var t=n()(e.currentTarget),r=t.data("id"),i=t.data("pin-type"),o=this.state.pinTypes;if(this.state.isMobile||!r)return!1;t.addClass("is-hover");var a=this.findMarker(r,i);if(!a)return!1;var s=a.latitude,l=a.longitude;a.pinType===o.fake&&(s=a.fakeLatitude,l=a.fakeLongitude),a.richMarker&&a.richMarker.setPosition(new google.maps.LatLng(s,l)),a.linkedView&&n()(a.linkedView).addClass("is-hover")},p.prototype.onMouseOutMarkerHandler=function(e){var t=n()(e.currentTarget),r=t.data("id"),i=t.data("pin-type"),o=this.state.pinTypes;if(this.state.isMobile||!r)return!1;var a=this.findMarker(r,i);if(t.removeClass("is-hover"),!a)return!1;var s=a.latitude,l=a.longitude;a.pinType===o.fake&&(s=a.fakeLatitude,l=a.fakeLongitude),a.richMarker&&a.richMarker.setPosition(new google.maps.LatLng(s,l)),a.linkedView&&n()(a.linkedView).removeClass("is-hover")},p.prototype.onClickMarkerHandler=function(e){var t=n()(e.currentTarget).data("id");if(!t)return!1;var r=this.findMarker(t),i=this.state,o=i.pinTypes,a=i.filter.curLevel+1;return!!r&&(r.pinType===o.airport?(this.state.isMobile||0!==i.filter.curLevel||(i.filter.airportId=Number(r.id),n()(document).trigger("map-filter-air",{customEvent:"airportChanged",airportId:Number(r.id)}),this.controller()),!1):r.pinType===o.pointOfInterest||r.pinType===o.hotel||r.pinType===o.villas?(this.showMarkerDetails(r),!1):r.pinType===o.complexVilla?(this.showComplexVillaDetail
1s(r),!1):("City Break"===r.holidayType&&(a=3),r.pinType===o.childDestination&&a++,this.state.prevLocationList.push(this.state.curLocation),this.state.filter.curLevel=a,this.state.curLocation=r,this.state.curLocation.isLocation=!0,this.state.curLocation.linkedView=null,this.state.curLocation.level=a,this.clearLevel(),void this.initLevel()))},p.prototype.onMouseOverViewHandler=function(e){var t=n()(e.currentTarget),r=t.data("id");if(t.addClass("is-hover"),!r)return!1;var i=this.findMarker(r);i&&i.richMarker&&i.richMarker.ready_&&n()(i.richMarker.markerContent_.firstChild).addClass("is-hover")},p.prototype.onMouseOutViewHandler=function(e){var t=n()(e.currentTarget),r=t.data("id");if(t.removeClass("is-hover"),!r)return!1;var i=this.findMarker(r);i&&i.richMarker&&i.richMarker.ready_&&n()(i.richMarker.markerContent_.firstChild).removeClass("is-hover")},p.prototype.onClickViewHandler=function(e){var t=this.state.pinTypes,r=n()(e.currentTarget),i=r.data("id"),o=this.state.filter.curLevel+1;if(r.addClass("is-hover"),!i)return!1;var a=this.findMarker(i);(a&&a.pinType===t.destination||a&&a.pinType===t.fake)&&(o="City Break"===a.holidayType?2:o,this.state.prevLocationList.push(this.state.curLocation),this.state.filter.curLevel=o,this.state.curLocation=a,this.state.curLocation.isLocation=!0,this.state.curLocation.linkedView=null,this.state.curLocation.level=o,this.clearLevel(),this.initLevel())},p.prototype.onClickBtnBackHandler=function(e){this.removeActiveMarker(),this.$el.removeClass("is-details"),this.$el.removeClass("is-aside-overlayed")},p.prototype.onClickBtnDetailsOpener=function(e){this.$detailsOpenerBtn.hasClass("is-opened")?this.$detailsOpenerBtn.removeClass("is-opened"):this.$detailsOpenerBtn.addClass("is-opened")},p.prototype.onClickViewLinkHandler=function(e){var t=n()(e.currentTarget).data("id");if(!t)return!1;var r=this.findMarker(t);if(r){this.gmap.panTo(new google.maps.LatLng(r.latitude,r.longitude));var i=this.state.isMobile?19:20;this.gmap.getZoom()!==i&&this.gmap.setZoom(i)}},p.prototype.onClickBtnLoadMoreHandler=function(e){var t=this.state.filter.curTab,r=this.state.pinTypes;if(2===t)r.pointOfInterest;3===t&&(pinType=r.hotel),this.getMarkersDetails(pinType,this.state.tabs[t].page)},p.prototype.onClickBtnLevelBackHandler=function(e){this.state.curLocation=this.state.prevLocationList.pop(),this.state.curLocation.linkedView=null,this.state.filter.curLevel=this.state.curLocation.level,this.clearLevel(),this.initLevel()},p.prototype.onClickBtnComplexBack=function(){this.removeActiveMarker();var e=this.countTotalPins(this.state.pinTypes.villas)+" villas in this area";this.mapTabsElem.fillTab(e,this.state.filter.curTab,"total",!0),this.mapTabsElem.fillTab(" ",this.state.filter.curTab,"complex",!0),this.$el.removeClass("is-complex"),this.$el.removeClass("is-aside-overlayed")},p.prototype.getExtConfig=function(e,t){var r;if(null===this.getTab({pinType:t}))return!1;if(this.state.ajax.getMapInitJson.isWorking)return!1;this.$el.addClass("is-map-overlayed"),"single-villa"===this.state.type&&(r="/assets/SRData/GetMapInitializationJson.json");var i=n().ajax({context:this,url:r||"/api/jet2/MapExplorer/GetMapInitializationJson",method:"GET",data:{targetPinId:e,requestedType:t},dataType:"json"});this.state.ajax.getMapInitJson.xhr=i,this.state.ajax.getMapInitJson.isWorking=!0,i.done((function(e){void 0!==e&&(this.state.filter.curTab=e.requestedType,this.state.filter.curLevel=e.viewLevel,this.state.curLocation.id=e.targetLocation,this.state.curLocation.latitude=e.latitude,this.state.curLocation.longitude=e.longitude,this.state.curLocation.zoomLevel=e.zoomLevel,this.state.curLocation.title=e.targetLocationTitle,this.state.curLocation.summary=e.targetLocationSummary,this.state.curLocation.destinationUrl=e.targetLocationUrl,this.state.curLocation.isLocation=!0,this.state.curLocation.level=this.state.filter.curLevel,this.state.curLocation.holidayType=e.holidayType||this.state.defaultHolidayType,n()("body").hasClass("city-breaks")&&(this.state.filter.holidayType="City Break"),e.pinId&&(this.state.curLocation.pinId=e.pinId),this.initLevel())})),i.fail((function(e){window.console})),i.always((function(){this.state.ajax.getMapInitJson.isWorking=!1,this.$el.removeClass("is-map-overlayed")}))},p.prototype.getMarkers=function(e,t){var r,i,o=this.state.filter.curLevel,a=this.state.curLocation.id,s=this.state.pinTypes,l=this.state.bounds;if(e=e||s.destination,null===(r=this.getTab({pinType:e})))return!1;this.state.ajax.getMap.isWorking&&this.state.ajax.getMap.xhr.abort(),this.$el.addClass("is-map-overlayed"),this.state.filterParams.length&&(i="/assets/SRData/GetMapFilteredByAirport.json"),"single-villa"===this.state.type&&(i="/assets/SRData/GetMapSingle.json");var u=n().ajax({context:this,url:i||"/assets/SRData/GetMap"+o+".json",method:"GET",data:{viewLevel:o,targetL
1ocation:a,requestedType:e,region:JSON.stringify(l),filterParams:JSON.stringify(this.state.filterParams)},dataType:"json"});this.state.ajax.getMap.xhr=u,this.state.ajax.getMap.isWorking=!0,u.done((function(e){e.targetLocation&&!e.targetLocation.childPins.length&&this.$el.removeClass("is-map-overlayed"),this.state.markers=this.state.markers.concat(e.targetLocation.childPins),this.state.tabs[r].hasMarkers=!0,this.state.tabs[2].hasMarkers=!0,this.state.tabs[3].hasMarkers=!0,this.state.tabs[4].hasMarkers=!0,this.state.hideOverviewTab=e.hideOverviewTab,this.state.hidePoiTab=e.hidePoiTab,this.setTabsVisibility(),this.generateComplexMarkers(),this.controller()})),u.fail((function(e){this.$el.removeClass("is-map-overlayed"),window.console})),u.always((function(){this.state.ajax.getMap.isWorking=!1}))},p.prototype.getMarkersDetails=function(e,t){var r,i=this.state.filter.curLevel,o=this.state.curLocation.id;if(null===(r=this.getTab({pinType:e})))return!1;t=t||this.state.tabs[r].page,this.state.ajax.getDetailsForPage.isWorking&&this.state.ajax.getDetailsForPage.xhr.abort(),this.$el.addClass("is-aside-overlayed");var a=n().ajax({context:this,url:"/assets/SRData/GetDetailsForPage.json",method:"GET",data:{viewLevel:i,targetL
1ocation:o,requestedType:e,page:t},dataType:"json"});this.state.ajax.getDetailsForPage.xhr=a,this.state.ajax.getDetailsForPage.isWorking=!0,a.done((function(t){if(!t||!t.items)return!1;for(var i=0,o=[],a=t.items.length;i<a;i++){var s=t.items[i],l=this.findMarker(s.id);l&&(n().extend(l,s),l.hasDetails=!0,l.ie7StarRating&&(l.ie7StarRating=l.ie7StarRating.split("")),o.push(l))}this.state.tabs[r].page++,this.state.tabs[r].hasMoreDetails=this.state.tabs[r].page<t.pagesCount,this.fillTab(o,e,r,"cards")})),a.fail((function(e){window.console})),a.always((function(){this.state.ajax.getDetailsForPage.isWorking=!1,this.state.ajax.getPinDetails.isWorking||this.$el.removeClass("is-aside-overlayed")}))},p.prototype.getMarkerDetails=function(e,t,r){var i=this.state.filter.curLevel,o=this.state.curLocation.id,a=e.pinType;this.state.ajax.getPinDetails.isWorking&&this.state.ajax.getPinDetails.xhr.abort(),this.$el.addClass("is-aside-overlayed");var s=n().ajax({context:this,url:"/assets/SRData/GetPinDetails.json",method:"GET",data:{viewLevel:i,targetL
1ocation:o,requestedType:a,pinId:t},dataType:"json"});this.state.ajax.getPinDetails.xhr=s,this.state.ajax.getPinDetails.isWorking=!0,s.done((function(t){var i=null;if(t){for(var o=0,a=t.length;o<a;o++)(i=this.findMarker(t[o].id))&&(n().extend(i,t[o]),i.hasDetails=!0);r(e)}})),s.fail((function(e){"abort"!==e.statusText&&this.$el.removeClass("is-details"),window.console})),s.always((function(){this.$el.removeClass("is-aside-overlayed"),this.state.ajax.getPinDetails.isWorking=!1}))},p.prototype.resetAllAjax=function(){var e=this.state.ajax;for(var t in e)e.hasOwnProperty(t)&&(e[t].isWorking&&(e[t].xhr.abort(),e[t].isWorking=!1),e[t].xhr=null)},p.prototype.showMarkerDetails=function(e){if(!e)return!1;if(this.$detailsView.empty(),this.$el.addClass("is-details"),this.$el.hasClass("is-complex")){var t=this.countTotalPins(this.state.pinTypes.villas)+" villas in this area";this.mapTabsElem.fillTab(t,this.state.filter.curTab,"total",!0),this.mapTabsElem.fillTab(" ",this.state.filter.curTab,"complex",!0),this.$el.removeClass("is-complex")}if(n()(window).width()<this.state.mobileWidth&&this.$detailsOpenerBtn.addClass("is-opened"),this.state.activeMarker&&this.state.activeMarker.id!==e.id&&this.removeActiveMarker(),e&&!this.state.activeMarker&&e.richMarker&&e.richMarker.ready_&&(this.state.activeMarker=e,u.A.load(["icon-villas-selected"]),n()(e.richMarker.markerContent_.firstChild).addClass("is-active"),n()(e.richMarker.markerContent_.firstChild).hasClass("marker--villas")&&n()(e.richMarker.markerContent._firstChild).find("marker__inner").html('<svg class="marker__icon icon icon--villas-selected" xmlns="http://www.w3.org/2000/svg" width="30" height="30" pointer-events="none"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-villas-selected"></use></svg>'),e.richMarker.setPosition(new google.maps.LatLng(e.latitude,e.longitude))),!e||!e.hasDetails)return this.getMarkerDetails(e,[e.id],this.showMarkerDetails.bind(this)),!1;var r=this.getTemplateName(e.pinType,!0),i=n()(d[r]({marker:e}));this.$detailsView.empty().append(i),this.$el.removeClass("is-aside-overlayed")},p.prototype.showComplexVillaDetails=function(e){var t=this.state.pinTypes;if(!e)return!1;this.$el.removeClass("is-details").addClass("is-complex"),this.state.filter.curTab=this.getTab(e),this.mapTabsElem.setActiveTab(this.getTab(e)),n()(window).width()<this.state.mobileWidth&&this.$detailsOpenerBtn.addClass("is-opened"),this.state.activeMarker&&this.state.activeMarker.id!==e.id&&this.removeActiveMarker(),e&&!this.state.activeMarker&&e.richMarker&&e.richMarker.ready_&&(this.state.activeMarker=e,n()(e.richMarker.markerContent_.firstChild).addClass("is-active"),e.richMarker.setPosition(new google.maps.LatLng(e.latitude,e.longitude)));var r=[];if(!e.itemsHasDetails){for(var i=0,o=e.items.length;i<o;i++)e.items[i].hasDetails||r.push(e.items[i].id);r.length||(e.itemsHasDetails=!0)}if(!e||!e.itemsHasDetails)return this.getMarkerDetails(e,r,this.showComplexVillaDetails.bind(this)),!1;this.fillTab(e.items,6,this.state.filter.curTab,"complex",!0);var a=e.items.length+" villas in this complex";this.mapTabsElem.fillTab(a,this.state.filter.curTab,"total",!0),this.$el.removeClass("is-aside-overlayed");var s=this.getTab(e),l=this.state.tabs[s].page;0===l&&this.getMarkersDetails(t.villas,l)},p.prototype.showLoadMore=function(e){if(this.state.tabs[e].loadMoreView)this.state.tabs[e].loadMoreView.find(".js-map-explorer__load-more").removeClass("is-working");else{var t=n()(d.loadMore());this.state.tabs[e].loadMoreView=t,this.mapTabsElem.fillTab(t,e,"loadmore")}},p.prototype.hideLoadMore=function(e){var t=this.state.tabs[e].loadMoreView;t&&t.remove()},p.prototype.getTab=function(e){var t=this.state.pinTypes;if(!e)return null;if(e.pinType)switch(e.pinType){case t.destination:return 1;case t.pointOfInterest:return 2;case t.hotel:return 3;case t.villas:case t.complexVilla:return 4}return null},p.prototype.setTabsVisibility=function(){var e=[];for(var t in this.state.hideOverviewTab||(this.state.tabs[1].isVisible=!0),this.state.hidePoiTab||(this.state.tabs[2].isVisible=!0),this.state.curLocation.holidayType&&"Beach Holiday"!==this.state.curLocation.holidayType||(this.state.tabs[3].isVisible=!0),"Villas"===this.state.curLocation.holidayType&&(this.state.tabs[4].isVisible=!0),this.state.tabs)this.state.tabs.hasOwnProperty(t)&&this.state.tabs[t].isVisible&&e.push(this.state.tabs[t].id);this.mapTabsElem.setTabsVisibility(e),this.state.filter.curTab||(this.mapTabsElem.setActiveTab(e[0]),this.state.filter.curTab=e[0])},p.prototype.generateComplexMarkers=function(){for(var e=this.state.pinTypes,t={},r=0,i=this.state.markers.length;r<i;r++){var n=this.state.markers[r];n.pinType===e.villas&&(n.villaGroupId&&(t[n.villaGroupId]||(t[n.villaGroupId]={id:n.villaGroupId,latitude:n.latitude,longitude:n.longitude,pinType:7,items:[],itemsHasDetail
1s:!1}),t[n.villaGroupId].items.push(n)))}for(var o in t)t.hasOwnProperty(o)&&this.state.markers.push(t[o])},p.prototype.countTotalPins=function(e){var t=this.state.markers,r=this.state.pinTypes,i={pinTypes:[e],ignoreGroupId:!0};return e===r.villas&&i.pinTypes.push(r.complexVilla),this.filterMarkers(t,i).length},p.prototype.removeActiveMarker=function(){var e=this.state.activeMarker,t=this.state.pinTypes;if(!e)return!1;e.richMarker&&e.richMarker.ready_&&(n()(e.richMarker.markerContent_.firstChild).removeClass("is-active"),e.richMarker.setPosition(new google.maps.LatLng(e.latitude,e.longitude)),this.state.activeMarker=null),e.pinType===t.complexVilla&&this.destroyClasses(e.items)}},65953:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>j});var i=r(62662),n=r.n(i),o=r(95773),a=r.n(o),s=r(67518),l=r(40599),u=r(37126),c=r(4973),d=r(1187),p=r(86394),h=r(31094),f=r(94336),m=r(64140),v=r(49199),y=r(62866),b=r(77945),g=r(52189);function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function w(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,S(i.key),i)}}function S(e){var t=function(e,t){if("object"!=k(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=k(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==k(t)?t:t+""}var C=r(89463).Ay.create("mapExplorerPlus"),T={},P={poiShort:r(84284),poiDetails:r(36161),loadMore:r(88918)},O={filters:1,pointOfInterest:2,villas:4},A=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$elem=t},(t=[{key:"isVisible",value:function(){return this.$elem.hasClass("is-opened")}},{key:"show",value:function(){this.$elem.addClass("is-opened")}},{key:"hide",value:function(){this.$elem.removeClass("is-opened")}}])&&w(e.prototype,t),r&&w(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function j(e){var t=this;this.$el=n()(e);var r=(0,u.G)(d.default.state.searchCriteria),i=(0,u.G)(d.default.state.filters);(0,c.onSearchFiltersChanged)((function(e){C.info("onSearchFiltersChanged",e),t.state.api.searchFilters=e,t.state.isVisible&&(t.clearLevel(),t.getMarkers())})),(0,h.onMoreVillasRequested)((function(){var e=t.getVillasTab().page,r=t.state.curLocation.id;t.loadFilteredVillas(r,e+1)})),this.state={filter:{curLevel:this.$el.data("level")||0},currentTabId:O.filters,tabs:this.buildInitialTabs(),curLocation:{id:this.$el.data("location-id")||0},prevLocationList:[],isMobile:n()("body").hasClass("is-mobile"),type:this.$el.data("type"),isVisible:!1,api:{searchCriteria:r,searchFilters:i}},this.$el.data("villa-id")&&(this.state.selectedVillaId=this.$el.data("villa-id")),this.checkElements(),this.bindEvents(),"ready to init"===this.status&&(this.checkGoogleMapsApi(),this.status="gmap inited")}j.prototype.buildInitialTabs=function(){var e={};return e[O.filters]={},e[O.pointOfInterest]={hasMoreDetails:!1,loadMoreView:null,page:0},e[O.villas]={page:0},e},j.prototype.checkElements=function(){this.$gmapContainer=this.$el.find(".js-map-explorer-gmap");var e=this.$el.find(".js-me-tabs"),t=this.$el.find(".js-map-explorer-details__content"),r=this.$el.find(".js-map-explorer-details");return this.$gmapContainer.length&&t.length&&e.length&&r.length?(this.mapTabsElem=new s.default(e),this.mapTabsElem.hideElem(),this.$detailsView=t,this.tabPanel=new A(r),this.status="ready to init",!0):(this.status="init errors",window.console&&window.console.warn("Some elements have not been found."),!1)},j.prototype.checkGoogleMapsApi=function(){"object"===("undefined"==typeof google?"undefined":k(google))&&"object"===k(google.maps)?this.afterMapsApiLoaded():this.loadMapsApi()},j.prototype.loadMapsApi=function(){var e=document.createElement("script");e.async=!0;var t=this.$el.data("google-maps-api-key"),r=this.$el.data("use-google-maps-api-key");
1e.src=r?"https://maps.googleapis.com/maps/api/js?v=3&key="+t+"&channel=holidaystestd&callback=loadCallback":"https://maps.googleapis.com/maps/api/js?v=3&client=gme-jet2&channel=holidaystestd&callback=loadCallback",window.loadCallback=this.afterMapsApiLoaded.bind(this),document.body.appendChild(e)},j.prototype.afterMapsApiLoaded=function(){var e=this;this.preventLoadFonts(),a()(["/assets/Destinations/app/vendors/richmarker.js","/assets/Destinations/app/vendors/markerclusterer.js"],(function(){e.map=new g.default(e.$gmapContainer[0]),n()(document).trigger("map:loaded")}))},j.prototype.preventLoadFonts=function(){var e=document.getElementsByTagName("head")[0],t=e.insertBefore;e.insertBefore=function(r,i){r.href&&0===r.href.indexOf("https://fonts.googleapis.com/css?family=Roboto")||t.call(e,r,i)}},j.prototype.initMap=function(e){var t=e.propertyId||this.state.curLocation.id;this.state.isVisible=!0,this.state.selectedVillaId=e.propertyId||null,this.getExtConfig(t),this.status="inited"},j.prototype.handleMapEvents=function(){var e=this;this.map.onIdle(this.onMapIdle.bind(this)),this.map.onClusteringEnd(this.onCluseringEnd.bind(this)),this.map.onResize((function(){var t=e.map.center;e.map.height=null,e.state.isMobile?e.tabPanel.isVisible()?e.map.height=e.map.height/2:e.map.height=e.map.height-e.getTabsHeightIfVisible():e.map.height=e.map.height,e.map.center=t}))},j.prototype.clearMap=function(){this.map.destroy(),this.clearLevel(),this.state.curLocation={id:this.$el.data("location-id")||0},this.state.prevLocationList=[],this.state.isVisible=!1,this.status="gmap inited"},j.prototype.controller=function(){var e=this.state.filter.curLevel,t=this.state.currentTabId,r=this.map.findMarkersByType(v.pinTypes.airport),i=this.map.findMarkersByType(v.pinTypes.destination);if(this.isSingleVillaMode())return this.map.showMarkers(r),void this.showClusters(this.map.markers,[v.pinTypes.pointOfInterest,v.pinTypes.villas]);switch(e){case 0:this.map.hideMarkers(this.map.markers),this.map.showMarkers(i),this.map.fitBounds(5);break;case 1:switch(this.map.hideMarkers(r.concat(i)),this.map.hideClusters(),t){case O.f
1ilters:this.map.showMarkers(r.concat(i)),this.showClusters(this.map.markers,[v.pinTypes.childDestination]);break;case O.pointOfInterest:this.strategyForPinType(v.pinTypes.pointOfInterest);break;case O.villas:this.strategyForPinType(v.pinTypes.villas)}break;case 2:switch(this.map.hideMarkers(r),this.map.hideClusters(),t){case O.filters:this.map.showMarkers(r),this.showClusters(this.map.markers,[v.pinTypes.destination]);break;case O.pointOfInterest:this.strategyForPinType(v.pinTypes.pointOfInterest);break;case O.villas:this.strategyForPinType(v.pinTypes.villas)}break;case 3:switch(this.map.hideMarkers(r),this.map.hideClusters(),t){case O.filters:this.map.showMarkers(r),this.showClusters(this.map.markers,[v.pinTypes.pointOfInterest,v.pinTypes.villas]);break;case O.pointOfInterest:this.strategyForPinType(v.pinTypes.pointOfInterest);break;case O.villas:this.strategyForPinType(v.pinTypes.villas)}}},j.prototype.strategyForPinType=function(e){var t=this.getTab({pinType:e}),r={pinTypes:[e]};e===v.pinTypes.villas&&(r.pinTypes=[v.pinTypes.villas,v.pinTypes.complexVilla]);var i=this.filterMarkers(this.map.markers,r);i.length&&this.showClusters(i,[e]);var n=this.state.tabs[t].page;if(e!==v.pinTypes.villas||this.state.selectedVillaId)e===v.pinTypes.pointOfInterest&&0===n&&this.loadPointsOfInterest();else{var o=this.state.curLocation.id;this.loadFilteredVillas(o,n+1)}},j.prototype.observer=function(e,t){if(!t)return!1;if("tabChanged"===t.customEvent&&this.isSingleVillaMode())return!1;switch(t.customEvent){case"tabChanged":this.resetVillasTabPaging(),this.deselectComplexVillaMode(),this.state.selectedVillaId=null,this.map.removeActiveMarker(),this.state.currentTabId=t.tabId?t.tabId:O.filters;break;case"tabbedContentChanged":if(t.tabHash&&"#tab-location"===t.tabHash&&"inited"!==this.status)return this.initMap({propertyId:this.$el.data("villa-id")}),!1}return this.controller(),!0},j.prototype.initLevel=function(e){this.$el.attr("data-level",e),this.state.prevLocationList.length?this.$el.addClass("is-level-back-visible"):this.$el.removeClass("is-level-back-visible");var t=this.getMapOptions(this.state.curLocation,e);this.gmap=this.map.init(t),this.handleMapEvents(),this.resetVillasTabPaging();var r=this.state.filter.curLevel;this.state.filter.curLevel=e;var i=this.map.height;this.state.isMobile&&!this.tabPanel.isVisible()&&(0===e&&r>0?(this.map.height=i+75,this.map.panBy(-75)):e>0&&0===r&&(this.map.height=i-75,this.map.panBy(75)))},j.prototype.clearLevel=function(){this.map.clear(),this.state.tabs=this.buildInitialTabs(),this.mapTabsElem.clearTabs(),this.mapTabsElem.hideElem(),this.selectTab(O.filters),this.hidePointOfInterestDetails(),this.hideTabSpinner()},j.prototype.onMapIdle=function(){return C.info("map idle"),!this.map.hasMarkers&&(this.getMarkers(),!0)},j.prototype.onCluseringEnd=function(e){var t=this.map.activeMarker;t&&e.getMarkers().some((function(e){return e.id===t.id}))&&setTimeout((function(){C.info("onCluseringEnd setTimeout"),t.isActive=!0,t.redraw()}),0)},j.prototype.getMapOptions=function(e,t){var r=this.state.isMobile?e.zoomLevel-1:e.zoomLevel;return{center:{lat:e.latitude,lng:e.longitude},zoom:r,styles:this.getMapStyles(t)}},j.prototype.getMapStyles=function(e){var t=[{visibility:"off"}],r={featureType:"poi",elementType:"labels",stylers:t},i={featureType:"administrative.country",elementType:"labels",stylers:t},n={featureType:"administrative.locality",elementType:"labels",stylers:t},o={featureType:"transit.station",stylers:t},a={featureType:"administrative.province",stylers:t};return{0:[r,i,n,a,r,o,{featureType:"road",stylers:t}],1:[r,i,n,a,r,o],2:[r,o],3:[r,o]}[e]},j.prototype.filterMarkers=function(e,t){var r=this;return e.map((function(e){return r.complexFiltering(e,t)})).filter((function(e){return e}))},j.prototype.complexFiltering=function(e,t){var r=t.pinTypes;return e&&"object"===k(e)?n().isArray(r)&&-1===r.indexOf(e.pinType)||t.ignoreGroupId&&e.villaGroupId?null:e:null},j.prototype.showClusters=function(e,t){if(!(e||n().isArray(e)||t||n().isArray(t)))return!1;var r;r=3===this.state.filter.curLevel?this.state.isMobile?this.state.curLocation.zoomLevel-2:this.state.curLocation.zoomLevel-1:19;for(var i=0;i<t.length;i++){var o=t[i],a={pinTypes:[o]};o===v.pinTypes.villas&&(a.pinTypes.push(v.pinTypes.complexVilla),a.ignoreGroupId=!0);var s=this.filterMarkers(e,a);s.filter((function(e){return!e.richMarker}
1)).forEach((function(e){e.richMarker=y.default.createRichMarker(e,null)}));var l=s.map((function(e){return e.richMarker}));if(l.length){var u=this.map.findCluster(o);u&&u.markerClusterer?u.markerClusterer.addMarkers(l):this.map.createCluster(s,r)}}return!0},j.prototype.getTemplateName=function(e,t){switch(e){case v.pinTypes.pointOfInterest:return t?"poiDetails":"poiShort";case"location":return"locOverview";default:return""}},j.prototype.generatePoiTabListItem=function(e){var t=this.getTemplateName(e.pinType);return P[t]({marker:e,modClass:"villas"})},j.prototype.fillPointOfInterestTab=function(e){var t=this;e.filter((function(e){return!e.linkedView})).forEach((function(e){var r=t.generatePoiTabListItem(e);e.linkedView=n()(r)}));var r=e.map((function(e){return e.linkedView}));this.mapTabsElem.fillTab(r,O.pointOfInterest,"cards"),this.state.tabs[O.pointOfInterest].hasMoreDetails?this.poiTabShowLoadMore(O.pointOfInterest):this.poiTabHideLoadMore(O.pointOfInterest)},j.prototype.isSingleVillaMode=function(){return"single-villa"===this.state.type},j.prototype.bindEvents=function(){return n()(document).on("map-explorer",this.observer.bind(this)),this.isSingleVillaMode()?(!this.$el.is(".is-modal")&&this.state.isMobile||(this.$el.on("mouseover",".js-map-explorer__marker",this.onMouseOverMarkerHandler.bind(this)),this.$el.on("mouseout",".js-map-explorer__marker",this.onMouseOutMarkerHandler.bind(this)),this.$el.on("click",".js-map-explorer__view-link",this.onClickViewLinkHandler.bind(this)),this.$el.on("click",".js-map-explorer__marker",this.onClickMarkerHandler.bind(this)),this.$el.on("click",".js-map-explorer-details__back",this.onBackToPoiListButtonClick.bind(this)),this.$el.on("click",".js-map-explorer__load-more",this.onClickBtnLoadMoreHandler.bind(this)),this.$el.on("click",".js-map-explorer-details-opener",this.onClickBtnDetailsOpener.bind(this))),!1):(this.$el.on("mouseover",".js-map-explorer__dest-card",this.onMouseOverViewHandler.bind(this)),this.$el.on("mouseout",".js-map-explorer__dest-card",this.onMouseOutViewHandler.bind(this)),this.$el.on("click",".js-map-explorer__dest-card",this.onClickViewHandler.bind(this)),this.state.isMobile||(this.$el.on("mouseover",".js-map-explorer__marker",this.onMouseOverMarkerHandler.bind(this)),this.$el.on("mouseout",".js-map-explorer__marker",this.onMouseOutMarkerHandler.bind(this))),this.$el.on("click",".js-map-explorer__marker",this.onClickMarkerHandler.bind(this)),this.$el.on("click",".js-map-explorer-details__back",this.onBackToPoiListButtonClick.bind(this)),this.$el.on("click",".js-map-explorer-details-opener",this.onClickBtnDetailsOpener.bind(this)),this.$el.on("click",".js-map-explorer-details__complex-back",this.onClickBtnComplexBack.bind(this)),this.$el.on("click",".js-map-explorer__view-link",this.onClickViewLinkHandler.bind(this)),this.$el.on("click",".js-map-explorer__load-more",this.onClickBtnLoadMoreHandler.bind(this)),this.$el.on("click",".js-map-explorer-level-back",this.onClickBtnLevelBackHandler.bind(this)),!0)},j.prototype.onMouseOverMarkerHandler=function(e){var t=n()(e.currentTarget),r=t.data("id");t.addClass("is-hover");var i=this.map.findMarker(r);if(!i)return!1;var o=i.latitude,a=i.longitude;return i.pinType===v.pinTypes.fake&&(o=i.fakeLatitude,a=i.fakeLongitude),i.richMarker&&i.richMarker.setPosition(new google.maps.LatLng(o,a)),i.linkedView&&n()(i.linkedView).addClass("is-hover"),!0},j.prototype.onMouseOutMarkerHandler=function(e){var t=n()(e.currentTarget),r=t.data("id"),i=this.map.findMarker(r);if(t.removeClass("is-hover"),!i)return!1;var o=i.latitude,a=i.longitude;return i.pinType===v.pinTypes.fake&&(o=i.fakeLatitude,a=i.fakeLongitude),i.richMarker&&i.richMarker.setPosition(new google.maps.LatLng(o,a)),i.linkedView&&n()(i.linkedView).removeClass("is-hover"),!0},j.prototype.onClickMarkerHandler=function(e){var t=n()(e.currentTarget).data("id"),r=this.map.findMarker(t);if(!r)return!1;if(this.hidePointOfInterestDetails(),r.pinType===v.pinTypes.destination||r.pinType===v.pinTypes.childDestination){var i=this.state.filter.curLevel+1;r.pinType===v.pinTypes.childDestination&&i++,this.state.prevLocationList.push(this.state.curLocation),this.state.curLocation=r,this.state.curLocation.isLocation=!0,this.state.curLocation.linkedView=null,this.state.curLocation.level=i,this.clearLevel(),this.initLevel(i)}else r.pinType===v.pinTypes.pointOfInterest?this.showMarkerDetails(r):this.isSingleVillaMode()||r.pinType!==v.pinTypes.villas?this.isSingleVillaMode()||r.pinType!==v.pinTypes.complexVilla||this.showComplexVillaDetail
1s(r):this.showMarkerDetails(r);return!1},j.prototype.onMouseOverViewHandler=function(e){var t=n()(e.currentTarget),r=t.data("id");t.addClass("is-hover");var i=this.map.findMarker(r);i&&i.richMarker&&i.richMarker.ready_&&n()(i.richMarker.markerContent_.firstChild).addClass("is-hover")},j.prototype.onMouseOutViewHandler=function(e){var t=n()(e.currentTarget),r=t.data("id");t.removeClass("is-hover");var i=this.findMarker(r);i&&i.richMarker&&i.richMarker.ready_&&n()(i.richMarker.markerContent_.firstChild).removeClass("is-hover")},j.prototype.onClickViewHandler=function(e){var t=n()(e.currentTarget),r=t.data("id");t.addClass("is-hover");var i=this.map.findMarker(r);if(i&&i.pinType===v.pinTypes.destination||i&&i.pinType===v.pinTypes.fake){var o=this.state.filter.curLevel+1;this.state.prevLocationList.push(this.state.curLocation),this.state.curLocation=i,this.state.curLocation.isLocation=!0,this.state.curLocation.linkedView=null,this.state.curLocation.level=o,this.clearLevel(),this.initLevel(o)}},j.prototype.onBackToPoiListButtonClick=function(){this.map.removeActiveMarker(),this.hidePointOfInterestDetails()},j.prototype.getTabsHeightIfVisible=function(){return this.state.filter.curLevel>0?75:0},j.prototype.openTabs=function(){if(!this.tabPanel.isVisible()){this.tabPanel.show();var e=this.map.height,t=this.getTabsHeightIfVisible();this.map.height=(e+t)/2;var r=.25*e;this.map.panBy(r)}},j.prototype.closeTabs=function(){if(this.tabPanel.isVisible()){this.hidePointOfInterestDetails(),this.tabPanel.hide();var e=this.map.height,t=this.getTabsHeightIfVisible();this.map.height=2*e-t;var r=.5*e;this.map.panBy(-r)}},j.prototype.onClickBtnDetailsOpener=function(){this.tabPanel.isVisible()?this.closeTabs():this.openTabs()},j.prototype.onClickViewLinkHandler=function(e){var t=n()(e.currentTarget).data("id"),r=this.map.findMarker(t);if(r){this.gmap.panTo(new google.maps.LatLng(r.latitude,r.longitude));var i=this.state.isMobile?19:20;this.map.zoom!==i&&(this.map.zoom=i)}},j.prototype.onClickBtnLoadMoreHandler=function(){this.loadPointsOfInterest()},j.prototype.onClickBtnLevelBackHandler=function(){this.state.curLocation=this.state.prevLocationList.pop(),this.state.curLocation.linkedView=null,this.clearLevel(),this.initLevel(this.state.curLocation.level)},j.prototype.onClickBtnComplexBack=function(){this.map.removeActiveMarker(),this.deselectComplexVillaMode()},j.prototype.getExtConfig=function(e){var t=this,r={id:"b1ad70e1-6137-427e-8010-3de759792db6",zoomLevel:4,level:0,latitude:49.35476,longitude:7.325875};this.isSingleVillaMode()||e?(this.showMapSpinner(),l.Ay.postJson("/api/jet2/map/init",{villaId:e}).then((function(r){t.state.curLocation.zoomLevel=15,t.state.curLocation.latitude=r.latitude,t.state.curLocation.longitude=r.longitude,t.state.curLocation.id=r.parentLocationId,t.state.selectedVilla={id:e,latitude:r.latitude,longitude:r.longitude,pinType:v.pinTypes.villas},t.initLevel(3)})).catch((function(e){C.error(e),t.state.curLocation=r,t.state.selectedVillaId=null,t.state.selectedVilla=null,t.initLevel(0)})).then((function(){t.hideMapSpinner()}))):setTimeout((function(){t.state.curLocation=r,t.initLevel(0)}),100)},j.prototype.getMarkersForSingleVilla=function(){var e=this;this.showMapSpinner();var t={viewLevel:this.state.filter.curLevel,targetLocation:this.state.curLocation.id};l.Ay.getJson("/api/jet2/map/explorepoi",{data:t}).then((function(t){var r=e.state.selectedVillaId&&e.state.selectedVilla?[e.state.selectedVilla]:[],i=t.targetLocation.childPins.concat(r).map((function(e){return new b.default(e)}));e.map.addMarkers(i),e.mapTabsElem.setTabsVisibility([O.pointOfInterest]),e.selectTab(O.pointOfInterest),e.controller()})).catch((function(e){C.error(e)})).then((function(){e.hideMapSpinner()}))},j.prototype.getMarkers=function(){var e=this;if(this.isSingleVillaMode())this.getMarkersForSingleVilla();else{this.showMapSpinner();var t=(0,p.convertFiltersToRequestParams)(this.state.api.searchFilters),r={viewLevel:this.state.filter.curLevel,targetLocation:this.state.curLocation.id,searchFilters:t,searchCriteria:this.state.api.searchCriteria};
1l.Ay.postJson("/api/jet2/map/explore",r).then((function(t){var r=t.targetLocation.childPins.map((function(e){return e.isVilla&&(e.pinType=v.pinTypes.villas),new b.default(e)}));if(e.map.addMarkers(r),e.state.selectedVillaId){var i=e.map.findMarker(e.state.selectedVillaId);i.richMarker=y.default.createRichMarker(i,e.gmap),google.maps.event.addListenerOnce(i.richMarker,"ready",(function(){e.showMarkerDetails(i)}))}e.state.selectedVillaId?(e.mapTabsElem.setTabsVisibility([O.pointOfInterest,O.villas]),e.selectTab(O.villas)):(e.mapTabsElem.setTabsVisibility([O.filters,O.pointOfInterest,O.villas]),e.selectTab(O.filters)),e.generateComplexMarkers(),e.controller()})).catch((function(e){C.error(e)})).then((function(){e.hideMapSpinner()}))}},j.prototype.showMapSpinner=function(){this.$el.addClass("is-map-overlayed")},j.prototype.hideMapSpinner=function(){this.$el.removeClass("is-map-overlayed")},j.prototype.showTabSpinner=function(){this.$el.addClass("is-aside-overlayed")},j.prototype.hideTabSpinner=function(){this.$el.removeClass("is-aside-overlayed")},j.prototype.getVillasTab=function(){var e=this.getTab({pinType:v.pinTypes.villas});return this.state.tabs[e]},j.prototype.showPointOfInterestDetails=function(){this.$el.addClass("is-details")},j.prototype.hidePointOfInterestDetails=function(){this.$el.removeClass("is-details")},j.prototype.resetVillasTabPaging=function(){this.getVillasTab().page=0},j.prototype.loadFilteredVillas=function(e,t){var r=this;this.showTabSpinner();var i=(0,p.convertFiltersToRequestParams)(this.state.api.searchFilters),n={pageNumber:t,pageSize:this.state.isMobile?3:10,sortOrder:"Recommended",filters:i},o=this.state.filter.curLevel;(0,f.searchInRegion)(this.state.api.searchCriteria,n,e,o).then((function(e){C.info("searchInRegion response",e),r.getVillasTab().page=t,1===n.pageNumber?(0,h.villaListLoaded)(e):(0,h.moreVillasLoaded)(e)})).catch((function(e){C.error("searchInRegion error",e)})).then((function(){r.hideTabSpinner()}))},j.prototype.loadVillaDetails=function(e){var t=this;this.showTabSpinner(),(0,f.getProperties)(e,this.state.api.searchCriteria).then((function(e){C.info("getProperties response",e),(0,h.villaDetailsLoaded)(e)})).catch((function(e){C.error("getProperties error",e)})).then((function(){t.hideTabSpinner()}))},j.prototype.loadPointsOfInterest=function(){var e=this;this.showTabSpinner();var t=this.state.tabs[O.pointOfInterest],r=t.page,i={viewLevel:this.state.filter.curLevel,targetLocation:this.state.curLocation.id,page:r};l.Ay.postJson("/api/jet2/map/pointsofinterest",i).then((function(r){C.info("loadPointsOfInterest response",r);var i=r.items.map((function(t){var r=e.map.findMarker(t.id);return T[t.id]=t,r&&n().extend(r,t),r})).filter((function(e){return e}));t.page+=1,t.hasMoreDetails=t.page<r.pagesCount,e.fillPointOfInterestTab(i)})).catch((function(e){C.error("loadPointsOfInterest error",e)})).then((function(){e.hideTabSpinner()}))};j.prototype.loadPointOfInterest=function(e){var t=this;this.showTabSpinner(),this.$detailsView.empty(),this.showPointOfInterestDetails(),function(e){return T[e]?Promise.resolve(T[e]):l.Ay.postJson("/api/jet2/map/pointofinterest",{id:e}).then((function(t){return T[e]=t,t}))}(e).then((function(e){C.info("loadPointOfInterest response",e);var r=t.map.findMarker(e.id),i=t.getTemplateName(r.pinType,!0),o=n()(P[i]({marker:e}));t.$detailsView.append(o)})).catch((function(e){C.error("loadPointOfInterest error",e),t.hidePointOfInterestDetails()})).then((function(){t.hideTabSpinner()}))},j.prototype.selectMarker=function(e){this.map.setActiveMarker(e),this.state.isMobile&&this.openTabs();var t=this.getTab(e);this.state.currentTabId!==t&&this.selectTab(t)},j.prototype.deselectComplexVillaMode=function(){this.$el.hasClass("is-complex")&&(this.$el.removeClass("is-complex"),(0,h.villasTabModeChanged)(m.tabModes.list))},j.prototype.selectComplexVillaMode=function(){this.$el.hasClass("is-complex")||(this.$el.addClass("is-complex"),(0,h.villasTabModeChanged)(m.tabModes.details))},j.prototype.showMarkerDetails=function(e){e&&(this.deselectComplexVillaMode(),this.selectMarker(e),e.pinType===v.pinTypes.villas?this.loadVillaDetail
1s([e.id]):e.pinType===v.pinTypes.pointOfInterest&&this.loadPointOfInterest(e.id))},j.prototype.showComplexVillaDetails=function(e){if(e){this.hidePointOfInterestDetails(),this.selectComplexVillaMode(),this.selectMarker(e);var t=e.items.map((function(e){return e.id}));this.loadVillaDetails(t)}},j.prototype.poiTabShowLoadMore=function(e){if(this.state.tabs[e].loadMoreView)this.state.tabs[e].loadMoreView.find(".js-map-explorer__load-more").removeClass("is-working");else{var t=n()(P.loadMore());this.state.tabs[e].loadMoreView=t,this.mapTabsElem.fillTab(t,e,"loadmore")}},j.prototype.poiTabHideLoadMore=function(e){var t=this.state.tabs[e].loadMoreView;t&&t.remove()},j.prototype.getTab=function(e){if(e&&e.pinType)switch(e.pinType){case v.pinTypes.destination:return O.filters;case v.pinTypes.pointOfInterest:return O.pointOfInterest;case v.pinTypes.villas:case v.pinTypes.complexVilla:return O.villas}return null},j.prototype.selectTab=function(e){(this.mapTabsElem.setActiveTab(e),this.state.currentTabId=e,e===O.pointOfInterest)&&(0===this.state.tabs[O.pointOfInterest].page&&this.loadPointsOfInterest())},j.prototype.generateComplexMarkers=function(){var e={};this.map.findMarkersByType(v.pinTypes.villas).filter((function(e){return e.villaGroupId})).forEach((function(t){e[t.villaGroupId]||(e[t.villaGroupId]={id:t.villaGroupId,latitude:t.latitude,longitude:t.longitude,pinType:v.pinTypes.complexVilla,items:[]}),e[t.villaGroupId].items.push(t)}));var t=Object.values(e).map((function(e){return new b.default(e)}));this.map.addMarkers(t)}},67518:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var i=r(62662),n=r.n(i);function o(e,t){this.$el=n()(e),this.settings=n().extend({},this._settings,void 0===t?{}:t),this.tabs={},this.activeTabId=null,this.init(),this._bindEvents()}o.prototype.init=function(){this.$nav=this.$el.find(".js-me-tabs-nav"),this.$tabNodes=this.$nav.find(".js-me-tabs-trigger");for(var e=0,t=this.$tabNodes.length;e<t;e++){var r=this.$tabNodes.eq(e),i=r.data("id");this.tabs[i]={trigger:r,content:this.$el.find(".js-me-tabs-content[data-id="+i+"]"),isStatic:"static"===r.data("content-type")};var n=this.tabs[i].content.find("[data-container]");n.length&&(this.tabs[i].containerList=n),r.hasClass("is-active")&&(this.activeTabId=i)}},o.prototype.setActiveTab=function(e){e&&this.tabs[e]&&(this.activeTabId&&(this.tabs[this.activeTabId].trigger.removeClass("is-active"),this.tabs[this.activeTabId].content.removeClass("is-active")),this.activeTabId=e,this.tabs[e].trigger.addClass("is-active"),this.tabs[e].content.addClass("is-active"))},o.prototype.clearTabs=function(){for(var e in this.tabs)this.tabs.hasOwnProperty(e)&&this.clearTab(this.tabs[e])},o.prototype.clearTab=function(e){e&&!e.isStatic&&(e.containerList&&e.containerList.length?e.containerList.each((function(e,t){n()(t).empty()})):e.content.empty())},o.prototype.fillTab=function(e,t,r,i){if(e&&t&&this.tabs[t]){var n=this.tabs[t];if(r){var o=n.containerList.filter("[data-container="+r+"]");if(!o.length)return!1;i&&o.empty(),o.append(e)}else i&&n.content.empty(),n.content.append(e)}},o.prototype.setTabsVisibility=function(e){this.hideElem(),this.hideAllTabs(),this.showTabs(e),this.showElem()},o.prototype.showTabs=function(e){e&&n().isArray(e)&&e.forEach((function(e){this.tabs[e].trigger.removeClass("is-hidden")}),this)},o.prototype.hideAllTabs=function(){for(var e in this.tabs)this.tabs.hasOwnProperty(e)&&this.tabs[e].trigger.addClass("is-hidden")},o.prototype.hideElem=function(){this.$el.addClass("is-hidden")},o.prototype.showElem=function(){this.$el.removeClass("is-hidden")},o.prototype._bindEvents=function(){this.$tabNodes.length&&this.$el.on("click",".js-me-tabs-trigger",this._onClickTabTriggerHandler.bind(this))},o.prototype._onClickTabTriggerHandler=function(e){e.preventDefault();var t=n()(e.currentTarget).data("id");this.setActiveTab(t),n()(document).trigger("map-explorer",{customEvent:"tabChanged",tabId:t})}},29970:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var i=r(62662),n=r.n(i),o=r(31349),a=r(45159);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=t,this.tooltipList=[],this.dropdownList=[],this.init()},(t=[{key:"init",value:function(){var e=this.elem.find(".js-tooltip");e.length&&e.each(function(e,t){this.tooltipList.push(new o.default(t))}.bind(this));var t=this.elem.find(".js-dropdown");t.length&&t.each(function(e,t){this.dropdownList.push(new a.default(t))}.bind(this)),this.boardRadioNodes=this.elem.find(".js-villa-card-board-radio"),this.boardRadioNodes.length&&this.boardRadioNodes.on("click",(function(e){var t=n()(this).parents(".js-tooltip").find(".js-tooltip-title"),r=n()(this).siblings("label").text();t.text(r),n()(e.target).parents(".js-villa-card-board").trigger("tooltip:hide")}))}},{key:"destroy",value:function(){for(var e=0,t=this.tooltipList.length;e<t;e++)this.tooltipList[e].destroy();for(var r=0,i=this.dropdownList.length;r<i;r++)this.dropdownList[r].destroy();this.boardRadioNodes.off()}}])&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},89322:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var i=r(49199);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}const s=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"createCluster",value:function(e,t,r,i){var n=[{cssClass:this.getClusterCssClass(r)}],o=e.map((function(e){return e.richMarker}));return new MarkerClusterer(t,o,{styles:n,clusterClass:"marker",ignoreHidden:!0,maxZoom:i,averageCenter:!0,anchor:RichMarkerPosition.BOTTOM,anchorOffset:{width:0,height:-10},batchSizeIE:100,gridSize:50})}},{key:"getClusterCssClass",value:function(e){switch(e){case i.pinTypes.pointOfInterest:return"marker--cluster marker--square marker--poi";case i.pinTypes.villas:return"marker--cluster marker--square marker marker--villas";case i.pinTypes.childDestination:case i.pinTypes.destination:return"marker--cluster marker-dest marker-dest--villas";default:return"marker--cluster marker-dest marker--hotel"}}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}())},31094:(e,t,r)=>{"use strict";r.r(t),r.d(t,{moreVillasLoaded:()=>S,moreVillasRequested:()=>T,onMoreVillasLoaded:()=>w,onMoreVillasRequested:()=>C,onPoisLoaded:()=>f,onSearchResultsMapOpened:()=>p,onVillaDetailsLoaded:()=>y,onVillaListLoaded:()=>m,onVillasTabModeChanged:()=>g,poisLoaded:()=>h,searchResultsMapOpened:()=>d,villaDetailsLoaded:()=>b,villaListLoaded:()=>v,villasTabModeChanged:()=>k});var i=r(6861),n="SearchResultsMap:open",o="SearchResultsMap:POIsLoaded",a="SearchResultsMap:villaListLoaded",s="SearchResultsMap:villaListMoreItemsLoadedEvent",l="SearchResultsMap:moreVillasRequestedEvent",u="SearchResultsMap:villaDetailsLoaded",c="SearchResultsMap:villasTabModeChanged";function d(e){i.A.emit(n,e||{})}function p(e){i.A.on(n,e)}function h(e){i.A.emit(o,e)}function f(e){i.A.on(o,e)}function m(e){i.A.on(a,e)}function v(e){i.A.emit(a,e)}function y(e){i.A.on(u,e)}function b(e){i.A.emit(u,e)}function g(e){i.A.on(c,e)}function k(e){i.A.emit(c,e)}function w(e){i.A.on(s,e)}function S(e){i.A.emit(s,e)}function C(e){i.A.on(l,e)}function T(e){i.A.emit(l,e)}},52189:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var i=r(89463),n=r(62866),o=r(89322);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},s.apply(null,arguments)}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var c=i.Ay.create("map"),d={boundsChanged:"bounds_changed",idle:"idle",clusteringEnd:"clusteringend",clusteringBegin:"clusteringbegin",resize:"resize"},p=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t,this.gmap=null,this.markers=[],this.clusters=[],this.onResizeCallbacks=[],this.activeMarker=null},(t=[{key:"init",value:function(e){this.gmap&&this.clear();var t=s({},{disableDefaultUI:!0,zoomControl:!0},e);return this.gmap=new google.maps.Map(this.container,t),this.triggerResize(),this.gmap}},{key:"setOptions",value:function(e){this.gmap.setOptions(e),this.triggerResize()}},{key:"destroy",value:function(){this._clearListeners()}},{key:"clear",value:function(){this.removeActiveMarker(),this.removeClusters(),this.removeMarkers()}},{key:"triggerResize",value:function(){google.maps.event.trigger(this.gmap,"resize")}},{key:"isLoaded",value:function(){return"object"===("undefined"==typeof google?"undefined":a(google))&&"object"===a(google.maps)}},{key:"_clearListeners",value:function(){google.maps.event.clearListeners(this.gmap,d.boundsChanged),google.maps.event.clearListeners(this.gmap,d.idle),google.maps.event.clearListeners(this.gmap,d.clusteringEnd),google.maps.event.clearListeners(this.gmap,d.cluseringBegin),this.onResizeCallbacks.forEach((function(e){window.removeEventListener(d.resize,e)})),this.onResizeCallbacks=[]}},{key:"onResize",value:function(e){this.onResizeCallbacks.push(e),google.maps.event.addDomListener(window,d.resize,e)}},{key:"onIdle",value:function(e){this.gmap.addListener(d.idle,e)}},{key:"onClusteringEnd",value:function(e){this.gmap.addListener(d.clusteringEnd,e)}},{key:"onClusteringBegin",value:function(e){this.gmap.addListener(d.clusteringBegin,e)}},{key:"onIdleOnce",value:function(e){google.maps.event.addListenerOnce(this.gmap,d.idle,e)}},{key:"onBoundsChangedOnce",value:function(e){google.maps.event.addListenerOnce(this.gmap,d.boundsChanged,e)}},{key:"hasMarkers",get:function(){return this.markers.length>0}},{key:"height",get:function(){return this.gmap.getDiv().clientHeight},set:function(e){var t=this.gmap.getDiv();t.style.height=null===e?null:"".concat(e,"px"),google.maps.event.trigger(this.gmap,"resize")}},{key:"center",get:function(){return this.gmap.getCenter()},set:function(e){this.gmap.setCenter(e)}},{key:"zoom",get:function(){return this.gmap.getZoom()},set:function(e){this.gmap.setZoom(e)}},{key:"_calculateBounds",value:function(){var e=this.markers.map((function(e){return e.richMarker})),t=new google.maps.LatLngBounds;return e.forEach((function(e){t.extend(e.getPosition())})),t}}
1,{key:"fitBounds",value:function(e){var t=this;this.onBoundsChangedOnce((function(){t.zoom>e&&(t.zoom=e)}));var r=this._calculateBounds();1===this.markers.map((function(e){return e.richMarker})).length&&(this.center=r.getCenter()),this.gmap.fitBounds(r)}},{key:"panBy",value:function(e){this.gmap.panBy(0,e)}},{key:"hasActiveMarker",get:function(){return null!==this.activeMarker}},{key:"setActiveMarker",value:function(e){this.hasActiveMarker&&this.activeMarker.id!==e.id&&this.removeActiveMarker(),this.hasActiveMarker||(c.debug("setActiveMarker",e.id),this.activeMarker=e,e.isActive=!0)}},{key:"removeActiveMarker",value:function(){this.activeMarker&&(c.debug("removeActiveMarker",this.activeMarker.id),this.activeMarker.isActive=!1,this.activeMarker=null)}},{key:"addMarkers",value:function(e){c.debug("addMarkers",e),this.markers=this.markers.concat(e)}},{key:"showMarkers",value:function(e){var t=this;c.debug("showMarkers",e),e.forEach((function(e){if(e.richMarker)e.show();else{var r=n.default.createRichMarker(e,t.gmap);e.setRichMarker(r)}}))}},{key:"hideMarkers",value:function(e){c.debug("hideMarkers",e),e.forEach((function(e){return e.hide()}))}},{key:"removeMarkers",value:function(){c.debug("removeMarkers"),this.markers.forEach((function(e){return e.remove&&e.remove()})),this.markers=[]}},{key:"findMarker",value:function(e){return e?this.markers.find((function(t){return t.id===String(e)}))||null:(c.warn("findMarker called with invalid marker id"),null)}},{key:"findMarkersByType",value:function(e){return this.markers.filter((function(t){return t.pinType===e}))}},{key:"findCluster",value:function(e){return this.clusters.find((function(t){return t.pinType===e}))||null}},{key:"createCluster",value:function(e,t){var r=e[0].pinType,i={pinType:r,markerClusterer:o.default.createCluster(e,this.gmap,r,t)};this.clusters.push(i)}},{key:"hideClusters",value:function(){this.clusters.forEach((function(e){e.markerClusterer.clearMarkers()}))}},{key:"removeClusters",value:function(){this.hideClusters(),this.clusters=[]}}])&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},77945:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var i=r(62662),n=r.n(i);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},a.apply(null,arguments)}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function l(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var u=function(){return e=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.richMarker=r,a(this,t),this._isActive=!1},(t=[{key:"setRichMarker",value:function(e){this.richMarker=e}},{key:"_updatePosition",value:function(){this.richMarker.setPosition(new google.maps.LatLng(this.latitude,this.longitude))}},{key:"redraw",value:function(){this.richMarker&&this.richMarker.draw()}},{key:"show",value:function(){this.richMarker&&this.richMarker.setVisible(!0)}},{key:"hide",value:function(){this.richMarker&&this.richMarker.setVisible(!1)}},{key:"remove",value:function(){this.richMarker&&this.richMarker.setMap(null)}},{key:"isActive",get:function(){return this._isActive},set:function(e){this._isActive=e;var t=n()(this.richMarker.markerContent_.firstChild);e?t.addClass("is-active"):t.removeClass("is-active"),this._updatePosition()}}])&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},62866:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var i=r(49199),n=r(77144);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l={markerSquare:r(80044),markerDest:r(28655),markerChild:r(30689)};const u=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"createRichMarker",value:function(e,t){var r=e.latitude,n=e.longitude;e.pinType===i.pinTypes.fake&&(r=e.fakeLatitude,n=e.fakeLongitude);var o=this.getMarkerDivContent(e);return new RichMarker({map:t,position:new google.maps.LatLng(r,n),flat:!0,content:o,anchor:RichMarkerPosition.BOTTOM,type:e.pinType,id:e.id})}},{key:"getMarkerDivContent",value:function(e){var t=this.getMarkerCssClass(e),r="";if(e.pinType===i.pinTypes.destination)r=l.markerDest({marker:e,cssClass:t});else if(e.pinType===i.pinTypes.childDestination)r=l.markerChild({marker:e,cssClass:t});else if(e.pinType===i.pinTypes.fake)r=l.markerDest({marker:e,cssClass:t});else if(e.pinType===i.pinTypes.airport||e.pinType===i.pinTypes.pointOfInterest||e.pinType===i.pinTypes.villas||e.pinType===i.pinTypes.complexVilla){var o=this.getMarkerIconName(e);n.A.load(["icon-"+o]),r=l.markerSquare({marker:e,cssClass:t,iconClass:o})}return r}},{key:"getMarkerCssClass",value:function(e){switch(e.pinType){case i.pinTypes.airport:return"marker--square marker--airport";case i.pinTypes.pointOfInterest:return"marker--square marker--poi";case i.pinTypes.villas:return"marker--square marker--villas";case i.pinTypes.complexVilla:return"marker--square marker--villas marker--complex";case i.pinTypes.childDestination:return"marker-child--villas";case i.pinTypes.destination:return"marker-dest--villas";default:return"marker-dest--hotel"}}},{key:"getMarkerIconName",value:function(e){switch(e.pinType){case i.pinTypes.airport:return"plane";case i.pinTypes.hotel:return"hotel";case i.pinTypes.pointOfInterest:return e.icon;case i.pinTypes.villas:case i.pinTypes.complexVilla:return"villa";default:return"beaches"}}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}())},49199:(e,t,r)=>{"use strict";r.r(t),r.d(t,{pinTypes:()=>i});var i={airport:0,destination:1,pointOfInterest:2,childDestination:4,fake:5,villas:6,complexVilla:7}},26998:(e,t,r)=>{"use strict";r.r(t);var i=r(5541);new(r(14423).A)({className:"js-map-explorer.delete",origClass:i.default})},86031:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>w});var i=r(65953),n=r(89463),o=r(51760),a=r(62662),s=r.n(a),l=r(31094),u=r(80887),c=r(64140),d=r(6861);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e,t){if("object"!=p(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=p(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==p(t)?t:t+""}function m(e,t,r){return t=b(t),function(e,t){if(t&&("object"==p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,v()?Reflect.construct(t,r||[],b(e).constructor):t.apply(e,r))}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function y(){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=b(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},y.apply(null,arguments)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}var k=n.Ay.create("searchResultsMap"),w=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=m(this,t,[e])).initialised=!1,k.info("initialising SearchResultsMapView"),(0,l.onSearchResultsMapOpened)((function(e){k.info("search results map open");var t={propertyId:e.propertyId};if(r.initialised)r.map.initMap(t);else{r.map=new i.default(r.element.querySelector(".js-map-explorer"));var n=r.element.querySelector('.search-results-tabs .js-me-tabs-content[data-id="4"] .js-vue');new u.Ay({name:"SearchResultsMap",el:n,components:{VillasTab:c.default},mounted:function(){k.info("search results map mounted")}});s()(document).one("map:loaded",(function(){r.initialised=!0,r.map.initMap(t),d.A.emit("VillaMapModal:discountToggled",e.applyDiscount)}))}r.open()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(t,e),r=t,n=[{key:"close",value:function(){var e,r,i,n,o;(e=t,r="close",i=this,o=y(b(1&(n=3)?e.prototype:e),r,i),2&n?function(e){return o.apply(i,e)}:o)([]),this.map.clearMap()}}
1],n&&h(r.prototype,n),o&&h(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(o.default)},8949:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var i=r(80887),n=r(31094);const o=i.Ay.component("poi-tab",{created:function(){(0,n.onPoisLoaded)((function(e){}))},data:function(){return{title:"POI TAB",pois:[{id:"b8828faf-c225-485e-97d3-3d79b0393676",imageUrl:"/-/media/destinations/poi/majorca/general/pmi0156_campanet_coves_de_campanet_0516_01.jpg",title:"Coves de Campanet",locationPath:"Puerto Alcudia, Majorca",url:"/poi/majorca/coves-de-campanet"},{id:"97dd9408-0b0b-4393-a522-8533e0da71f0",imageUrl:"/-/media/destinations/poi/majorca/alcudia/pmi0011_hydropark_0616_03.jpg",title:"Hidropark Waterpark",locationPath:"Alcudia, Majorca",url:"/poi/majorca/hidropark-waterpark"}]}},props:{},computed:{}})},64140:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c,tabModes:()=>u});var i=r(80887),n=(r(54587),r(1187)),o=r(15133),a=r(5424),s=r(35200),l=r(31094),u={list:"list",details:"details"};const c=i.Ay.component("villas-tab",{name:"VillasTab",created:function(){var e=this;this.loadResources(),(0,l.onVillaListLoaded)((function(){e.isListMode=!0})),(0,l.onVillasTabModeChanged)((function(t){e.isListMode=t===u.list}
1)),(0,l.onVillaDetailsLoaded)((function(t){e.villaDetailsItems=[],e.$nextTick((function(){e.isListMode=!1,e.villaDetailsItems=t.items}))}))},data:function(){return{searchOptions:n.default.state,resourcesLoaded:!1,resources:{airports:null,boardTypes:null,villaTypes:null,includedItemIcons:null,destinations:null,brands:null},duration:n.default.state.searchCriteria.duration,isListMode:!0,villaDetailsItems:[]}},methods:{loadResources:function(){var e=this;return(0,o.getResources)().then((function(t){e.resources.airports=t.airports,e.resources.boardTypes=t.boardTypes,e.resources.villaTypes=t.villaTypes,e.resources.includedItemIcons=t.includedItemIcons,e.resources.destinations=t.regions,e.resources.brands=t.brands,e.resources.childMinAge=t.childMinAge,e.resourcesLoaded=!0}))}},components:{"villa-details":a.VillaDetails,"villa-list":s.VillaList}})},5424:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VillaDetails:()=>a});var i=r(54587),n=(r(31094),r(6861)),o=r(85548),a={name:"VillaDetails",props:{resources:{type:Object,required:!0},showPricePerPerson:{type:Boolean,required:!0},duration:{type:Number,required:!0},items:{type:Array,required:!0},shouldApplyDiscount:{type:Boolean,required:!0},searchCriteria:{type:Object,required:!0}},data:function(){return{complexVillaCountLabelTemplate:"",applyDiscount:!1}},created:function(){var e=this;this.applyDiscount=this.shouldApplyDiscount,n.A.on("applyPromoDiscount",(function(t){e.applyDiscount=t})),n.A.on("VillaMapModal:discountToggled",(function(t){e.applyDiscount=t}))},computed:{complexVillaCountLabelFormatted:function(){var e={count:this.items.length};return(0,i.GP)(this.complexVillaCountLabelTemplate,e)},showComplexVillaCount:function(){return this.items.length>1}},components:{"villa-card":o.SearchResultItem}}},35200:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VillaList:()=>u});var i=r(54587),n=r(6861),o=r(31094),a=r(85548),s=r(33023),l=r(77144),u={name:"VillaList",props:{resources:{type:Object,required:!0},showPricePerPerson:{type:Boolean,required:!0},duration:{type:Number,required:!0},searchCriteria:{type:Object,required:!0},shouldApplyDiscount:{type:Boolean,required:!0}},created:function(){var e=this;(0,o.onVillaListLoaded)((function(t){e.resetSearch(),e.currentPage=1,e.processSearchResponse(t)})),(0,o.onMoreVillasLoaded)((function(t){e.currentPage+=1,e.processSearchResponse(t)})),this.applyDiscount=this.shouldApplyDiscount,n.A.on("applyPromoDiscount",(function(t){e.applyDiscount=t})),n.A.on("VillaMapModal:discountToggled",(function(t){e.applyDiscount=t}))},updated:function(){l.A.load(s.A.findAll(this.$el))},data:function(){return{items:[],isLoadingMore:!1,reachedTotal:!0,totalResults:null,currentPage:0,villaCountLabelTemplate:"",applyDiscount:!1}},methods:{resetSearch:function(){this.items=[],this.currentPage=0,this.reachedTotal=!1},processSearchResponse:function(e){var t=this;this.$nextTick((function(){t.totalResults=e.totalResults,t.items=t.items.concat(e.items),t.items.length>=t.totalResults&&(t.reachedTotal=!0)}))},handleLoadMoreClick:function(){(0,o.moreVillasRequested)()}},computed:{villaCountLabelFormatted:function(){if(!this.totalResults)return"";var e={count:this.totalResults};return(0,i.GP)(this.villaCountLabelTemplate,e)},showLoadMoreButton:function(){return!this.reachedTotal}},components:{"villa-card":a.SearchResultItem}}},86394:(e,t,r)=>{"use strict";r.r(t),r.d(t,{convertFiltersToRequestParams:()=>i});var i=function(e){return Object.keys(e).reduce((function(t,r){var i=e[r];return i.some((function(e){return e.isSingleChoice}))?t[r]=i.length>0?i[0].id:null:t[r]=i.map((function(e){return e.value||e.id})),t}),{})}},10491:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});const i=r(80887).Ay.component("load-more",{name:"LoadMoreButton",props:{isWorking:{type:Boolean,required:!0}},methods:{handleButtonClick:function(){this.$emit("button-click")}}})},94336:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getProperties:()=>m,search:()=>h,searchInRegion:()=>f});var i=r(40599),n=r(89463),o=r(57992),a=r(69316),s=r(66447);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},l.apply(null,arguments)}var u=n.Ay.create("searchApi"),c={searchApiUrl:"/api/jet2/villassearch/search",searchFilterApiUrl:"/api/jet2/villassearchfilter/applyfilters",searchFilterInReg
1ionApiUrl:"/api/jet2/villassearchfilter/region",getPropertiesApiUrl:"/api/jet2/villassearchfilter/getproperties"},d=!0,p=function(e){return e.items.forEach((function(e){e.selectedOption.outboundFlight.departureDateTime=(0,o.HB)(e.selectedOption.outboundFlight.departureDateTime),e.selectedOption.outboundFlight.arrivalDateTime=(0,o.HB)(e.selectedOption.outboundFlight.arrivalDateTime),e.selectedOption.inboundFlight.departureDateTime=(0,o.HB)(e.selectedOption.inboundFlight.departureDateTime),e.selectedOption.inboundFlight.arrivalDateTime=(0,o.HB)(e.selectedOption.inboundFlight.arrivalDateTime)})),e};function h(e,t){var r=d?c.searchApiUrl:c.searchFilterApiUrl;d=!1;var n=l({},e,(0,i.zy)(t));return u.time("search"),i.Ay.getJson(r,{data:n}).then((function(e){return u.timeEnd("search"),s.A.SendHotelNames(e.items),e})).then(p)}function f(e,t,r,n){u.time("search in region");var o=l({},e,(0,i.zy)(t),{regionId:r,viewLevel:n});return i.Ay.getJson(c.searchFilterInRegionApiUrl,{data:o}).then((function(e){return u.timeEnd("search in region"),e})).then(p)}var m=(0,a.A)((function(e,t){u.time("getProperties");var r=l({},t,{propertyIds:e});return i.Ay.getJson(c.getPropertiesApiUrl,{data:r}).then((function(e){return u.timeEnd("getProperties"),e})).then(p)}))},15133:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getResources:()=>s});var i=r(40599),n=r(89463).Ay.create("searchResourcesApi"),o={apiUrl:"/api/jet2/searchresources/get"},a=null;function s(){return a||(n.time("search resources"),a=i.Ay.getJson(o.apiUrl,{cache:!0}).then((function(e){return n.timeEnd("search resources"),e}))),a}},60317:(e,t,r)=>{"use strict";r.r(t);var i=r(14423),n=r(9309);new i.A({className:"js-villa-card",origClass:n.default})},85586:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>f,ViewModel:()=>o.default});var i=r(80887),n=r(89463),o=r(21311),a=r(85548),s=r(29606),l=r(10491);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},c.apply(null,arguments)}function d(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,p(i.key),i)}}function p(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}var h=n.Ay.create("searchResults"),f=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.props=r;var i=this.element.querySelector(".js-load-more-button.is-working"),n="is-working";i.classList?i.classList.remove(n):i.className=i.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," ")},(t=[{key:"init",value:function(e){return h.info("Initialising searchResults component"),new i.Ay(c({},{name:"SearchResults",el:this.element,propsData:{settings:this.props.settings},components:{LoadMoreComponent:l.default,"search-result-item":a.SearchResultItem,PromoToggle:s.PromoToggleViewModel}},e))}}])&&d(e.prototype,t),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},21311:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>C});var i=r(89463),n=r(94336),o=r(15133),a=r(34763),s=r(31094),l=r(53921),u=r(1187),c=r(37126),d=r(86394),p=r(6861);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,v(i.key),i)}}function m(e,t,r){return t&&f(e.prototype,t),r&&f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e){var t=function(e,t){if("object"!=h(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=h(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==h(t)?t:t+""}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,n=e}
1finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},g.apply(null,arguments)}var k=i.Ay.create("searchResultsVm"),w=!1,S={props:["settings"],created:function(){var e=this;k.debug("search-results component created"),k.info("Getting search results..."),this.applyDiscount=this.settings.applyDiscount,this.disableTouristTax=this.settings.disableTouristTax,p.A.on("applyPromoDiscount",(function(t){e.applyDiscount=t})),(0,a.onAvailabilityCalendarChangeOption)((function(t){u.default.changePriceOption(t.showPricePerPerson),e.updateProperty(t.propertyId,t.selectedOption)})),(0,a.raiseSearchResultsLoaded)(),this.executeSearch(),"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual"),window.scrollTo(0,0)},data:function(){var e=this.convertQueryStringToSearchCriteria();if(e.rooms&&u.default.addMinBedroomsFilter(e.rooms),e.preferredDate){var t=this.parseDate(e.preferredDate);null!=t&&this.getPreferredDateYearMonth(e.preferredDate)==e.departureDate?u.default.addDepartureDateFilter(t):e.preferredDate=null}return{isLoading:!1,reachedTotal:!1,searchOptions:u.default.state,searchCriteria:e,searchResults:[],totalResults:0,currentPage:0,resourcesLoaded:!1,resources:{airports:null,boardTypes:null,villaTypes:null,includedItemIcons:null,destinations:null,brands:null},filters:null,applyDiscount:!1,disableTouristTax:!1}},watch:{"searchOptions.sortOrder":function(e){k.info("watch new value: ",e),this.resetSearch(),this.executeSearch()},"searchOptions.filterWatcher":function(){this.updateFilters()}},methods:{updateFilters:function(){this.resetSearch(),this.executeSearch()},resetSearch:function(){this.searchResults=[],this.currentPage=0,this.reachedTotal=!1},updateProperty:function(e,t){g(this.searchResults.find((function(t){return t.id===e})).selectedOption,t)},convertQueryStringToSearchCriteria:function(){var e=l.default.searchQueryStringToObject(window.location.search.substring(1));return{departureAirports:e.from,destinations:e.to,departureDate:e.leaving,duration:e.nights,adults:e.adults,children:e.children,rooms:e.rooms,preferredDate:e.preferredDate,oflight:e.oflight,iflight:e.iflight}},parseDate:function(e){var t=e.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/);return t?new Date(t[3],t[2]-1,t[1]):null},getPreferredDateYearMonth:function(e){var t=e.split("-");return t[2]+t[1]},loadResources:function(){var e=this;return this.resourcesLoaded?Promise.resolve():(0,o.getResources)().then((function(t){e.resources.airports=t.airports,e.resources.boardTypes=t.boardTypes,e.resources.villaTypes=t.villaTypes,e.resources.includedItemIcons=t.includedItemIcons,e.resources.destinations=t.regions,e.resources.brands=t.brands,e.resources.childMinAge=t.childMinAge,e.resources.subBrands=t.subBrands,e.resources.transferTypes=t.transferTypes,e.resources.regions={},e.resourcesLoaded=!0}))},executeSearch:function(){var e=this;if(!this.isLoading){this.isLoading=!0;var t=this.currentPage+1,r=(0,d.convertFiltersToRequestParams)(this.searchOptions.filters),i={pageNumber:t,pageSize:this.settings.pageSize,sortOrder:this.searchOptions.sortOrder,filters:r,gtmSearchType:this.settings.gtmSearchType};Promise.all([this.loadResources(),(0,n.search)(this.searchCriteria,i)]).then((function(r){var i=y(r,2),n=(i[0],i[1]);e.processSearchResponse(n),u.default.removeUnavailableFilters(),e.currentPage=t,e.isLoading=!1})).catch((function(t){e.isLoading=!1,t.response?k.error(t.statusCode,t.statusDescription,t.response):k.error(t)}))}},processSearchResponse:function(e){if(k.info("Search results loaded",e),e.totalResults){if(this.searchResults=this.searchResults.concat(e.items),this.searchOptions.searchResults=this.searchOptions.searchResults.concat(e.items),this.searchOptions.availableFilters=(0,c.G)(e.availableFilters),this.searchOptions.searchCriteria=this.searchCriteria,this.totalResults!==e.totalResults&&(this.totalResults=e.totalResults,(0,a.seachResultsTotalChanged)(this.totalResults)),this.searchResults.length>=this.totalResults&&(this.reachedTotal=!0),(0,a.raiseSearchResponseProcessed)({totalResults:e.totalResults,items:e.items,resources:this.resources,searchCriteria:this.searchCriteria,filters:this.searchOptions.filters,sortOrder:this.searchOptions.sortOrder}),e.items.length>0){if(p.A.emit("updatePromoAvailable",e.promoAvailable),null!=e.items[0].selectedOption&&null!=e.items[0].selectedOption.boardOptions){var t={tokenDiscount:e.items[0].selectedOption.boardOptions[0].discount};p.A.emit("accordionSummaryUpdate",t);var r={perPersonDiscount:e.items[0].selectedOption.boardOptions[0].perPersonDiscount,totalDiscount:e.items[0].selectedOption.boardOptions[0].discount,promoCode:e.items[0].selectedOption.promoCode};p.A.emit("updatePromoTokens",r)}!this.disableTouristTax&&this.searchResultsHasTouristTax(e.items)&&this.triggerTouristTaxGtmImpressionEvent()}}else window.location=this.settings.noResultsPageUrl},handleLoadMoreClick:function(){this.executeSearch()},handleShowMap:function(e){k.info("handleShowMap",e),(0,s.searchResultsMapOpened)(e)},handleShowGallery:function(e){k.info("handleShowGallery",e),(0,a.showGalleryClicked)(e)},handleShareVilla:function(e){k.info("handleShareVilla",e),(0,a.shareLinkByEmailClicked)(e)},handleShowAvailabilityCalendar:function(e){k.info("handleShareVilla",e),(0,a.showAvailabilityCalendar)(e)},triggerTouristTaxGtmImpressionEvent:function(){w||(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"basket",category:"Tourist tax message in search result card",action:"Impression",label:"At least one of the search results cards displayed contain a tourist tax message."}),w=!0)},searchResultsHasTouristTax:function(e){return e.some((function(e){var t;return null===(t=e.selectedOption)||void 0===t||null===(t=t.boardOptions)||void 0===t?void 0:t.some((function(e){var t,r;return(null!==(t=null===(r=e.touristTax)||void 0===r?void 0:r.totalCostInGBP)&&void 0!==t?t:0)>0}))}))}},computed:{showMoreButton:function(){return!this.reachedTotal||this.isLoading}}},C=m((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.init(S)}))},99718:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var i=r(62662),n=r.n(i);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}const l=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.$element=n()(t),this.$label=this.$element.find(".checkbox-button-group__label");var r=this.$label.find("> span").text(),i=this.$element.attr("data-airport-code"),o=this.$element.attr("data-airport-id");this.airport={name:r,code:i,id:o},this.checkbox=t.querySelector("input"),this._visible=!0},(t=[{key:"onClick",value:function(e){var t=this;this.$label.on("click",(function(r){r.preventDefault(),e(t.airport)}))}},{key:"checked",get:function(){return this.checkbox.checked},set:function(e){this.checkbox.checked!==e&&(this.checkbox.checked=e,this.$element.toggleClass("is-active",e))}},{key:"visible",get:function(){return this._visible},set:function(e){this.$element.toggle(e),this._visible=e}},{key:"enabled",set:function(e){this.$element.toggleClass("is-disabled",!e)}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},44999:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>h,ViewModel:()=>n.default});var i=r(51760),n=r(92726),o=r(99718);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function l(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}function u(e,t,r){return t=d(t),function(e,t){if(t&&("object"==a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}var h=function(e){function t(e){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=(r=u(this,t,[e])).$element.find(".checkbox-button-group--list .checkbox-button-group__item");return r.checkboxGroupItems=i.toArray().map((function(e){return new o.default(e)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),r=t,(i=[{key:"onAirportSelectionChanged",value:function(e){this.checkboxGroupItems.forEach((function(t){return t.onClick(e)}))}}])&&s(r.prototype,i),n&&s(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,n}(i.default)},92726:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}r.r(t),r.d(t,{default:()=>s});var a=r(89463).Ay.create("departureAirportSelectorVm"),s=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.view=t,this.props=r,this.selectedAirports=[],this.subscribeToEvents()},(t=[{key:"setMaxAirportsSelectable",value:function(e){this.maxAirportsSelectable=e}},{key:"subscribeToEvents",value:function(){var e=this;this.view.checkboxGroupItems.forEach((function(t){return t.onClick(e.onAirportSelectionChanged.bind(e))})),this.view.onModalClosed(this.onModalClosed.bind(this))}},{key:"onAirportSelectionChanged",value:function(e){this.selectedAirports.some((function(t){return t.code===e.code}))?this.onAirportDeselected(e):this.onAirportSelected(e),this.render()}},{key:"onAirportSelected",value:function(e){this.selectedAirports.length<this.maxAirportsSelectable&&(a.debug("onAirportSelected",e),this.selectedAirports.push(e))}},{key:"onAirportDeselected",value:function(e){a.debug("onAirportDeselected",e),this.selectedAirports=this.selectedAirports.filter((function(t){return t.code!==e.code}))}},{key:"openModal",value:function(e,t){a.debug("opening modal..."),this.selectedAirports=e,this.callback=t,this.render(),this.view.open()}},{key:"onModalClosed",value:function(){a.debug("selectedAirports",this.selectedAirports),this.callback(this.selectedAirports)}},{key:"allDepartureAirports",value:function(){return this.view.checkboxGroupItems.map((function(e){return e.airport}))}},{key:"render",value:function(){var e=this,t=this.selectedAirports.map((function(e){return e.code}));this.view.checkboxGroupItems.forEach((function(r){var i=t.includes(r.airport.code);i&&!r.checked?r.checked=!0:r.checked&&!i&&(r.checked=!1),i||(r.enabled=e.selectedAirports.length<e.maxAirportsSelectable)}))}},{key:"init",value:function(e){a.debug("init",e,this.view.checkboxGroupItems),this.view.checkboxGroupItems.forEach((function(t){t.visible=e.includes(t.airport.code),t.checked=t.visible&&t.checked}))}}])&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},15907:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>b,ViewModel:()=>s.default});var i=r(62662),n=r.n(i),o=r(89463),a=r(51760),s=r(21570),l=r(86970),u=r.n(l);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,p(i.key),i)}}function p(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}function h(e,t,r){return t=m(t),function(e,t){if(t&&("object"==c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,r||[],m(e).constructor):t.apply(e,r))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}var y=o.Ay.create("departureDateSelector"),b=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=h(this,t,[e]),y.debug("DepartureDateSelectorView"),r.$dates=r.$element.find(".js-dates"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(t,e),r=t,(i=[{key:"onMonthSelected",value:function(e){var t=this;this.$dates.on("click",".month-box.is-available",(function(r){var i=n()(r.currentTarget).attr("data-value");return e(i),setTimeout((function(){t.close()}),200),!1}))}},{key:"updateDates",value:function(e){var t=u()({dates:e});this.$dates.html(t)}}
1])&&d(r.prototype,i),o&&d(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,o}(a.default)},21570:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var i=r(79833),n=r.n(i),o=r(89463),a=r(28597);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var c=o.Ay.create("departureDateSelectorVm"),d=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.view=t,this.props=r,this.subscribeToEvents(),this.selectedMonth=null,this.availableMonths=[]},(t=[{key:"subscribeToEvents",value:function(){var e=this;this.view.onModalClosed(this.onModalClosed.bind(this)),this.view.onMonthSelected((function(t){e.selectedMonth=t,e.render()}))}},{key:"openModal",value:function(e,t){c.debug("opening modal..."),this.callback=t,this.selectedMonth=e,this.render(),this.view.open()}},{key:"onModalClosed",value:function(){c.debug("closing modal..."),this.callback(this.selectedMonth)}},{key:"getMonth",value:function(e,t){var r=n()(e,"yyyymm01"),i=t.includes(r),o=this.selectedMonth===r,a=i?"is-available"+(o?" is-current":""):"";return{name:n()(e,"mmmm"),cssClass:a,value:r}}},{key:"setAvailableMonths",value:function(e){this.availableMonths=e,this.render()}},{key:"init",value:function(e){var t=(0,a.A)(e,(function(e){return e.getFullYear()}));this.calendar=t}},{key:"render",value:function(){var e=this,t=Object.keys(this.calendar).map((function(t){return{year:t,months:e.calendar[t].map((function(t){return e.getMonth(t,e.availableMonths)}))}}));this.view.updateDates(t)}}])&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},72834:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var i=r(62662),n=r.n(i),o=r(83789),a=r(30130);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}const c=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.$element=n()(t);var r=this.$element.find(".checkbox-button-group__item");this.groupItem=new a.default(r[0]),this.items=r.slice(1).toArray().map((function(e){return new o.default(e)})),this._visible=!0},(t=[{key:"onClick",value:function(e){var t=this;this.groupItem.onClick((function(){e(t)}))}},{key:"onItemClicked",value:function(e){this.items.forEach((function(t){return t.onClick(e)}))}},{key:"visible",get:function(){return this._visible},set:function(e){this.$element.toggle(e),this._visible=e}},{key:"checked",get:function(){return this.groupItem.checked},set:function(e){this.groupItem.checked=e}},{key:"indeterminate",get:function(){return this.groupItem.indeterminate},set:function(e){this.groupItem.indeterminate=e}}])&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},83789:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var i=r(62662),n=r.n(i);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}const l=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.$element=n()(t),this.id=this.$element.attr("data-id"),this.airportCode=this.$element.attr("data-airport"),this.$label=this.$element.find(".checkbox-button-group__label"),this.name=this.$label.text(),this.checkbox=t.querySelector("input"),this._visible=!0},(t=[{key:"onClick",value:function(e){var t=this;this.$label.on("click",(function(r){r.preventDefault(),e(t)}))}},{key:"visible",get:function(){return this._visible},set:function(e){this.$element.toggle(e),this._visible=e}},{key:"checked",get:function(){return this.checkbox.checked},set:function(e){this.checkbox.checked=e}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},79731:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>C,ViewModel:()=>l.default});var i=r(62662),n=r.n(i),o=r(55029),a=r(89463),s=r(51760),l=r(882),u=r(72834),c=r(83789),d=r(73893),p=r(72090),h=r.n(p),f=r(46401);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function v(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function y(e){var t=function(e,t){if("object"!=m(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=m(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==m(t)?t:t+""}function b(e,t,r){return t=k(t),function(e,t){if(t&&("object"==m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,g()?Reflect.construct(t,r||[],k(e).constructor):t.apply(e,r))}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(g=function(){return!!e})()}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}var S=a.Ay.create("destinationSelector"),C=function(e){function t(e){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=b(this,t,[e]),new f.default(e.querySelector(".js-tabs")).init(),S.debug("DestinationSelectorView"),r.$destinations=r.$element.find(".js-destinations");var i=r.$element.find(".js-bycountry .checkbox-button-group:not(:has(.js-all-destinations))");return r.checboxGroups=i.toArray().map((function(e){return new u.default(e)})),r.atozGroups=r.$element.find(".js-atoz .sbm-destination__list-item").toArray().map((function(e){return new d.default(e)})),r.allItems=r.getItems(r.checboxGroups),r.atozItems=r.getItems(r.atozGroups),r.allDestinationsCheckbox=new c.default(r.element.querySelector(".js-all-destinations")),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(t,e),r=t,(i=[{key:"getItems",value:function(e){return e.reduce((function(e,t){return e.concat(t.items)}),[])}},{key:"onAllDestinationsClicked",value:function(e){this.allDestinationsCheckbox.onClick((function(t){e(t)}))}},{key:"onAtoZGroupItemClicked",value:function(e){this.atozItems.forEac
1h((function(t){return t.onClick(e)}))}},{key:"reorganiseGroups",value:function(e){var t=(0,o.A)(e,2);this.checboxGroups.forEach((function(e){e.$element=e.$element.detach()})),this.$destinations.html(h()({rows:t})),this.$destinations.find(".sbm-destination__row").each((function(e,r){var i=n()(r);i.find(".sbm-destination__col1").append(t[e][0].$element.detach()),t[e].length>1&&i.find(".sbm-destination__col2").append(t[e][1].$element)}))}}])&&v(r.prototype,i),a&&v(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,a}(s.default)},882:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}r.r(t),r.d(t,{default:()=>s});var a=r(89463).Ay.create("destinationSelectorVm"),s=function(){return e=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.view=t,this.props=r,this.subscribeToEvents()},(t=[{key:"subscribeToEvents",value:function(){var e=this;this.view.onModalClosed(this.onModalClosed.bind(this)),this.view.onAllDestinationsClicked((function(t){a.debug("onAllDestinationsClicked",t);var r=!t.checked;e.view.checboxGroups.forEach((function(e){return e.items.forEach((function(e){return e.checked=r}))})),e.render()})),this.view.checboxGroups.forEach((function(t){t.onClick((function(t){var r=!t.indeterminate&&!t.checked;t.items.forEach((function(e){return e.checked=e.visible&&r})),e.render()})),t.onItemClicked((function(t){t.checked=!t.checked,e.render()}))})),this.view.onAtoZGroupItemClicked((function(t){a.info("item",t);var r=e.findById(t.id);r.checked=!r.checked,e.render()}))}},{key:"findById",value:function(e){return this.view.allItems.find((function(t){return t.id===e}))}},{key:"render",value:function(){var e=this,t=this.view.checboxGroups.filter((function(e){return e.visible}));t.forEach((function(e){e.checked=e.items.every((function(e){return!e.visible||e.checked})),e.indeterminate=!e.checked&&e.items.some((function(e){return e.visible&&e.checked}))})),this.view.atozItems.forEach((function(t){return t.checked=e.findById(t.id).checked})),this.view.allDestinationsCheckbox.checked=t.every((function(e){return e.checked&&!e.indeterminate}))}},{key:"init",value:function(e){var t=this;a.debug("init",e),this.view.allItems.forEach((function(t){t.visible=e.includes(t.airportCode),t.checked=t.visible&&t.checked})),this.view.checboxGroups.forEach((function(e){e.visible=e.items.some((function(e){return e.visible}))})),this.view.atozItems.forEach((function(e){return e.visible=t.findById(e.id).visible})),this.view.atozGroups.forEach((function(e){e.visible=e.items.some((function(e){return e.visible}))}));var r=this.view.checboxGroups.filter((function(e){return e.visible}));this.view.reorganiseGroups(r),this.render()}},{key:"isDestinationAvailable",value:function(e){return this.findById(e).visible}},{key:"getSelectedDestinations",value:function(){return this.view.allItems.filter((function(e){return e.visible&&e.checked})).map((function(e){return{id:e.id,name:e.name,airport:e.airportCode}}))}},{key:"allDestinations",value:function(){return this.view.allItems.map((function(e){return{id:e.id,name:e.name,airport:e.airportCode}}))}},{key:"selectDestinations",value:function(e){var t=this,r=this.getSelectedDestinations().map((function(e){return e.id})),i=e.map((function(e){return e.id}));r.filter((function(e){return!i.includes(e)})).forEach((function(e){return t.findById(e).checked=!1})),i.filter((function(e){return!r.includes(e)}
1)).forEach((function(e){return t.findById(e).checked=!0}))}},{key:"openModal",value:function(e,t){a.debug("opening modal..."),this.callback=t,this.selectDestinations(e),this.render(),this.view.open()}},{key:"onModalClosed",value:function(){a.debug("closing modal..."),this.callback(this.getSelectedDestinations())}}])&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},73893:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var i=r(62662),n=r.n(i),o=r(83789);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function l(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}const u=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.$element=n()(t);var r=this.$element.find(".checkbox-button-group__item");this.items=r.toArray().map((function(e){return new o.default(e)})),this._visible=!0},(t=[{key:"visible",get:function(){return this._visible},set:function(e){this.$element.toggle(e),this._visible=e}}])&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},30130:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function a(e,t,r){return t=l(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,r||[],l(e).constructor):t.apply(e,r))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}r.r(t),r.d(t,{default:()=>c});const c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),r=t,(i=[{key:"indeterminate",get:function(){return this.checkbox.indeterminate},set:function(e){this.checkbox.indeterminate=e}}])&&n(r.prototype,i),o&&n(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,o}(r(83789).default)},42080:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>v,ViewModel:()=>a.default});var i=r(62662),n=r.n(i),o=r(51760),a=r(23538),s=r(14685),l=r.n(s);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function d(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}function p(e,t,r){return t=f(t),function(e,t){if(t&&("object"==u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var v=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=p(this,t,[e])).$addAdultButton=r.$element.find(".js-plus-adult-btn"),r.$removeAdultButton=r.$element.find(".js-minus-adult-btn"),r.$addChildButton=r.$element.find(".js-plus-child-btn"),r.$removeChildButton=r.$element.find(".js-minus-child-btn"),r.$addRoomButton=r.$element.find(".js-plus-room-btn"),r.$removeRoomButton=r.$element.find(".js-minus-room-btn"),r.$adultCount=r.$element.find(".js-adult-count"),r.$childCount=r.$element.find(".js-child-count"),r.$roomCount=r.$element.find(".js-room-count"),r.$childAgesPanel=r.$element.find(".js-child-ages-panel"),r.$childAgeBoxContainer=r.$element.find(".js-child-box-container"),r.settings=JSON.parse(r.$element.attr("data-settings")),r.childAgeBoxTemplate=l(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),r=t,i=[{key:"childAgeChanged",value:function(e){this.$element.on("change",".js-child-age-selected",(function(t){var r=parseInt(n()(t.target).parent().parent().index()),i=parseInt(n()(t.target).val());return e(r,i),!1}))}},{key:"onAddAdultButtonClicked",value:function(e){this.$addAdultButton.on("click",(function(){return e(),!1}))}},{key:"onRemoveAdultButtonClicked",value:function(e){this.$removeAdultButton.on("click",(function(){return e(),!1}))}},{key:"onAddChildButtonClicked",value:function(e){this.$addChildButton.on("click",(function(){return e(),!1}))}},{key:"onRemoveChildButtonClicked",value:function(e){this.$removeChildButton.on("click",(function(){return e(),!1}))}},{key:"onAddRoomButtonClicked",value:function(e){this.$addRoomButton.on("click",(function(){return e(),!1}))}},{key:"onRemoveRoomButtonClicked",value:function(e){this.$removeRoomButton.on("click",(function(){return e(),!1}))}},{key:"changeAdultCounter",value:function(e){this.$adultCount.val(e)}},{key:"changeChildCounter",value:function(e){this.$childCount.val(e)}},{key:"changeRoomCounter",value:function(e){this.$roomCount.val(e)}},{key:"addChildAgeBox",value:function(e,t){for(var r=this,i=[],n=this.settings.minimumChildAge;n<=this.settings.maximumChildAge;n++)i.push(n);var o=!1;t&&(o=!0);var a={value:e+1,defaultChildAgeDefined:o,childLabel:this.settings.childLabel,ageLabel:this.settings.ageLabel,childAges:i.map((function(e){return{value:e,isSelected:parseInt(e)===parseInt(t),isInfant:1===parseInt(e),infantLabel:r.settings.infantLabel}}))};this.$childAgeBoxContainer.append(this.childAgeBoxTemplate(a))}},{key:"removeChildAgeBoxes",value:function(){this.$childAgeBoxContainer.empty()}},{key:"enableRemoveAdultButton",value:function(){this.$removeAdultButton.removeClass("is-disabled")}},{key:"disableRemoveAdultButton",value:function(){this.$removeAdultButton.addClass("is-disabled")}},{key:"enableAddAdultButton",value:function(){this.$addAdultButton.removeClass("is-disabled")}},{key:"disableAddAdultButton",value:function(){this.$addAdultButton.addClass("is-disabled")}},{key:"enableRemoveChildButton",value:function(){this.$removeChildButton.removeClass("is-disabled")}},{key:"disableRemoveChildButton",value:function(){this.$removeChildButton.addClass("is-disabled")}},{key:"enableAddChildButton",value:function(){this.$addChildButton.removeClass("is-disabled")}},{key:"disableAddChildButton",value:function(){this.$addChildButton.addClass("is-disabled")}},{key:"enableRemoveRoomButton",value:function(){this.$removeRoomButton.removeClass("is-disabled")}},{key:"disableRemoveRoomButton",value:function(){this.$removeRoomButton.addClass("is-disabled")}},{key:"enableAddRoomButton",value:function(){this.$addRoomButton.removeClass("is-disabled")}},{key:"disableAddRoomButton",value:function(){this.$addRoomButton.addClass("is-disabled")}},{key:"hideChildAgesPanel",value:function(){this.$childAgesPanel.hide()}},{key:"showChildAgesPanel",value:function(){this.$childAgesPanel.show()}}
1],i&&c(r.prototype,i),o&&c(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,o}(o.default)},23538:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},n.apply(null,arguments)}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}r.r(t),r.d(t,{default:()=>l});var s=r(89463).Ay.create("guestSelectorVm");const l=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.view=t,this.settings=this.view.settings,this.subscribeToEvents(),this.selectedGuests={adults:0,children:[],rooms:0},this.minRooms=0,this.minAdults=1,this.minChildren=0,this.maxNumOfAdults=this.settings.maxNumOfAdults,this.maxNumOfChildren=this.settings.maxNumOfChildren,this.maxNumOfRooms=this.settings.maxNumOfRooms,this.maxNumberOfAdultsAndChildren=this.settings.maxNumberOfAdultsAndChildren},(t=[{key:"subscribeToEvents",value:function(){var e=this;this.view.onModalClosed(this.onModalClosed.bind(this)),this.view.childAgeChanged((function(t,r){e.selectedGuests.children[t]=r})),this.view.onAddAdultButtonClicked((function(){e.addAdult()})),this.view.onRemoveAdultButtonClicked((function(){e.removeAdult()})),this.view.onAddChildButtonClicked((function(){e.addChild()})),this.view.onRemoveChildButtonClicked((function(){e.removeChild()})),this.view.onAddRoomButtonClicked((function(){e.addRoom()})),this.view.onRemoveRoomButtonClicked((function(){e.removeRoom()}))}},{key:"openModal",value:function(e,t){s.debug("opening modal..."),this.selectedGuests=n({},e),this.callback=t,this.view.open(),this.render()}},{key:"onModalClosed",value:function(){s.debug("closing modal..."),this.callback(this.selectedGuests)}},{key:"addAdult",value:function(){this.validateAdults(this.selectedGuests.adults+1)&&(this.selectedGuests.adults+=1,this.render())}},{key:"removeAdult",value:function(){this.validateAdults(this.selectedGuests.adults-1)&&(this.selectedGuests.adults+=-1,this.render())}},{key:"addChild",value:function(){this.validateChildren(this.selectedGuests.children.length+1)&&(this.selectedGuests.children.push(null),this.render())}},{key:"removeChild",value:function(){this.validateChildren(this.selectedGuests.children.length-1)&&(this.selectedGuests.children.pop(),this.render())}},{key:"addRoom",value:function(){this.validateRooms(this.selectedGuests.rooms+1)&&(this.selectedGuests.rooms+=1,this.render())}},{key:"removeRoom",value:function(){this.validateRooms(this.selectedGuests.rooms-1)&&(this.selectedGuests.rooms+=-1,this.render())}},{key:"validateAdults",value:function(e){return!(e<this.minAdults||e>this.maxNumOfAdults||e+this.selectedGuests.children.length>this.maxNumberOfAdultsAndChildren)}},{key:"validateChildren",value:function(e){return!(e<this.minChildren||e>this.maxNumOfChildren||e+this.selectedGuests.adults>this.maxNumberOfAdultsAndChildren)}},{key:"validateRooms",value:function(e){return!(e<this.minRooms||e>this.maxNumOfRooms)}},{key:"render",value:function(){var e=this;this.view.changeAdultCounter(this.selectedGuests.adults),this.view.changeChildCounter(this.selectedGuests.children.length),this.view.changeRoomCounter(this.selectedGuests.rooms),this.view.disableRemoveAdultButton(),this.view.disableAddAdultButton(),this.view.disableRemoveChildButton(),this.view.disableAddChildButton(),this.view.disableRemoveRoomButton(),this.view.disableAddRoomButton(),this.view.hideChildAgesPanel(),this.view.removeChildAgeBoxes(),this.selectedGuests.children.length>0&&this.view.showChildAgesPanel(),this.selectedGuests.adults-1>=this.minAdults&&this.view.enableRemoveAdultButton(),this.selectedGuests.adults+1<=this.maxNumOfAdults&&this.selectedGuests.adults+this.selectedGuests.children.length+1<=this.maxNumberOfAdultsAndChildren&&this.view.enableAddAdultButton(),this.selectedGuests.children.length-1>=this.minChildren&&this.view.enableRemoveChildButton(),this.selectedGuests.children.length+1<=this.maxNumOfChildren&&this.selectedGuests.adults+this.selectedGuests.children.length+1<=this.maxNumberOfAdultsAndChildren&&this.view.enableAddChildButton(),this.selectedGuests.rooms-1>=this.minRooms&&this.view.enableRemoveRoomButton(),this.selectedGuests.rooms+1<=this.maxNumOfRooms&&this.view.enableAddRoomButton(),this.selectedGuests.children.forEac
1h((function(t,r){e.view.addChildAgeBox(r,t)}))}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},44336:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>f,ViewModel:()=>o.default});var i=r(89463),n=r(79253),o=r(19234);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function l(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}function u(e,t,r){return t=d(t),function(e,t){if(t&&("object"==a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}var h=i.Ay.create("villaSearchPanel"),f=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=u(this,t,[e]),h.debug("initialising VillaAvailabilitySearchPanelView... "),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),r=t,i&&s(r.prototype,i),n&&s(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,n}(n.default)},19234:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var i=r(89463),n=r(3928),o=r(29427);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function l(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}function u(e,t,r){return t=h(t),function(e,t){if(t&&("object"==a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function d(e,t,r,i){var n=p(h(1&i?e.prototype:e),t,r);return 2&i?function(e){return n.apply(r,e)}:n}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},p.apply(null,arguments)}
1function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var m=i.Ay.create("villaAvailabilitySearchPanelVm");const v=function(e){function t(e,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=u(this,t,[e,r]),m.debug("villaAvailabilitySearchPanelVm"),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),r=t,(i=[{key:"maxAirportsSelectable",get:function(){return 2}},{key:"onFlightScheduleLoaded",value:function(){var e=this.settings.destinationInfo.airport,r=this.flightSchedule.getDeparturesTo([e]);this.view.departureAirportSelector.init(r),d(t,"onFlightScheduleLoaded",this,3)([])}},{key:"allAvailableDepartureAirports",get:function(){var e=this.settings.destinationInfo.airport,t=this.flightSchedule.getDeparturesTo([e]);return this.view.departureAirportSelector.allDepartureAirports().filter((function(e){return t.includes(e.code)}))}},{key:"allAvailableDestinations",get:function(){return[this.settings.destinationInfo]}},{key:"updateAvailableDestinations",value:function(e){}},{key:"isDestinationAvailable",value:function(e){return this.settings.destinationInfo.id===e}},{key:"defaultState",get:function(){var e=d(t,"defaultState",this,1);return e.destinations.push(this.settings.destinationInfo),e}},{key:"proceedWithSearch",value:function(){m.debug("proceedWithSearch");var e={searchCriteria:this.searchCriteria,isSearchPanelButtonClicked:!0};(0,o.raisePropertyPageAvailabilityCalendarTriggered)(e)}},{key:"toggleDisabledFields",value:function(){this.validator.isValid(this.state.departureAirports,"departureAirports")?this.view.enableDepartureDateSelection():(this.view.disableDepartureDateSelection(),this.view.disableDurationSelection()),this.validator.isValid(this.state.departureDate,"departureDate")?this.view.enableDurationSelection():this.view.disableDurationSelection()}},{key:"getPersistedState",value:function(){var e=d(t,"getPersistedState",this,3)([]);return e.destinations=this.allAvailableDestinations,e}}])&&s(r.prototype,i),n&&s(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,n}(n.default)},79253:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>b});var i=r(62662),n=r.n(i),o=r(89463),a=r(3857),s=r(69641),l=r(44999),u=r(15907),c=r(42080),d=r(93060),p=r(19763),h=r(1187);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function m(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,v(i.key),i)}}function v(e){var t=function(e,t){if("object"!=f(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=f(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==f(t)?t:t+""}var y=o.Ay.create("baseVillaSearchPanel");const b=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),y.debug("initialising BaseVillaSearchPanelView... "),this.element=t,this.$element=n()(t),this.selectors={validationErrorMessage:".search-box-group__error-message",disabledInput:"js-disabled",disabledInputCssClass:".js-disabled"},this.departureAirportSelector=this.loadChildComponent("DepartureAirportSelector",l),this.departureDateSelector=this.loadChildComponent("DepartureDateSelector",u),this.guestSelector=this.loadChildComponent("GuestSelector",c),this.formGroups={departureAirports:new a.default(this.$element,".search-box-group--from","#search-box-from",this.selectors),departureDate:new a.default(this.$element,".search-box-group--leaving","#search-box-leaving",this.selectors),duration:new s.default(this.$element,".search-box-group--nights","#search-box-nights",this.selectors),guests:new a.default(this.$element,".search-box-group--guests","#search-box-guests",this.selectors)},this.$submitButton=this.$element.find(".js-srch-box__submit"),this.formValidator=new p.A(this.$element)},(t=[{key:"loadChildComponent",value:function(e,t){var r=this.$element.find('[data-childcomponent="'.concat(e,'"]'))[0];return d.A.initComponent(t,r).viewModel}},{key:"departureAirport",set:function(e){this.formGroups.departureAirports.value=e}},{key:"departureDate",set:function(e){this.formGroups.departureDate.value=e}},{key:"duration",set:function(e){this.formGroups.duration.value=e}},{key:"durations",set:function(e){this.formGroups.duration.values=e}},{key:"guests",set:function(e){this.formGroups.guests.value=e}},{key:"disableDepartureDateSelection",value:function(){this.formGroups.departureDate.disable()}},{key:"enableDepartureDateSelection",value:function(){this.formGroups.departureDate.enable()}},{key:"disableDurationSelection",value:function(){this.formGroups.duration.disable()}},{key:"enableDurationSelection",value:function(){this.formGroups.duration.enable()}},{key:"onDepartureGroupClick",value:function(e){this.formGroups.departureAirports.onClick(e)}},{key:"onDepartureDateGroupClick",value:function(e){this.formGroups.departureDate.onClick(e)}},{key:"onGuestGroupClick",value:function(e){this.formGroups.guests.onClick(e)}},{key:"onDurationSelectionChanged",value:function(e){this.formGroups.duration.$input.on("change",(function(t){var r=t.currentTarget.value,i=r?parseInt(r,10):null;e(i)}))}},{key:"onFormSubmit",value:function(e){this.$submitButton.on("click",(function(){return e(),h.default.removeAllFilters(),!1}))}},{key:"showValidationResults",value:function(e,t){return this.formValidator.showValidationResults(e,t)}},{key:"clearValidationErrors",value:function(){this.formValidator.clearValidationErrors()}},{key:"loadValidationMessages",value:function(){return this.formValidator.loadValidationMessages()}}])&&m(e.prototype,t),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},3928:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>T,numberToken:()=>C});var i=r(89463),n=r(67922),o=r(37126),a=r(42405),s=r(79833),l=r.n(s),u=r(95142),c=r(9868),d=r(29427),p=r(66447),h=r(86565),f=r(6861),m=r(8988);function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},y.apply(null,arguments)}function b(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function k(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,w(i.key),i)}}function w(e){var t=function(e,t){if("object"!=v(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=v(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==v(t)?t:t+""}var S=i.Ay.create("baseVillaSearchPanelVm"),C="$number";const T=function(){return e=function e(t,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),S.debug("baseVillaSearchPanelVm"),this.view=t,this.props=r,this.settings=this.props.settings,this.validator=new n.default(this.view.loadValidationMessages()),this.validateGuestAdults=function(e){return i.view.guestSelector.validateAdults(e)},this.validateGuestChildren=function(e){return i.view.guestSelector.validateChildren(e)},this.validateGuestRooms=function(e){return i.view.guestSelector.validateRooms(e)},this.getDepartureAirportCodes=function(e){return e.map((function(e){return e.code})).sort()},this.getDestinationAirportCodes=function(e){return b(new Set(e.map((function(e){return e.airport})))).sort()},this.state=(0,o.G)(this.defaultState),this.flightSchedule=new a.default({minDuration:this.settings.minDuration,maxDuration:this.settings.maxDuration,brandId:this.settings.brandId}),this.flightSchedule.load().then(this.onFlightScheduleLoaded.bind(this)),this.subscribeToEvents(),this.render(),f.A.on("SearchContainer:mobileanchor",(function(){m.A.scrollToElement(i.view.$element,300,-70)}))},(t=[{key:"openDepartureSelectorModal",value:function(){S.info("openDepartureSelectorModal");var e=this.state.departureAirports.slice(0);this.view.departureAirportSelector.openModal(e,this.onDepartureAirportSelectionChanged.bind(this))}},{key:"openDepartureDateSelectorModal",value:function(){S.info("openDepartureDateSelectorModal"),this.view.departureDateSelector.openModal(this.state.departureDate,this.onDepartureDateSelectionChanged.bind(this))}},{key:"openGuestSelectorModal",value:function(){S.info("openGuestSelectorModal"),this.view.guestSelector.openModal(this.state.guests,this.onGuestSelectionChanged.bind(this))}},{key:"onDepartureAirportSelectionChanged",value:function(e){var t=this;S.info("onDepartureAirportSelectionChanged",e),this.flightSchedule.isLoaded?(this.selectionChanged(y({},this.state,{departureAirports:e})),this.render()):(this.state.departureAirports=e,this.render(),this.flightSchedule.load().then((function(){t.state.departureAirports=[],t.selectionChanged(y({},t.state,{departureAirports:e})),t.render()})))}},{key:"onDepartureDateSelectionChanged",value:function(e){S.info("onDepartureDateSelectionChanged",e),this.selectionChanged(y({},this.state,{departureDate:e})),this.render()}},{key:"onDurationSelectionChanged",value:function(e){S.info("onDurationSelectionChanged",e),this.selectionChanged(y({},this.state,{duration:e})),this.render()}},{key:"onGuestSelectionChanged",value:function(e){S.info("onGuestSelectionChanged",e),this.state.guests=e,this.render()}},{key:"updateAvailableDestinations",value:function(e){throw"updateAvailableDestinations is abstract. Please provide implementation in subclass."}},{key:"isDestinationAvailable",value:function(e){throw"isDestinationAvailable is abstract. Please provide implementation in subclass."}},{key:"handleDepartureAirportSelection",value:function(e,t){var r=this,i=this.getDepartureAirportCodes(e.departureAirports);if(!(0,u.A)(this.getDepartureAirportCodes(t.departureAirports),i)){S.debug("departure airports changed",e.destinations);var n=this.flightSchedule.getDestinationsFrom(i);this.updateAvailableDestinations(n),this.view.departureDateSelector.init(this.flightSchedule.dateRange),t.destinations.map((function(e){return e.id})).every((function(e){return r.isDestinationAvailable(e)}))||(e.destinations=[],e.departureDate=null,e.duration=null),e.reloadCalendar=!0}return e}},{key:"handleDestinationSelection",value:function(e,t){if(e.reloadCalendar||!(0,u.A)(t.destinations.map((function(e){return e.id})),e.destinations.map((function(e){return e.id})))){S.debug("destinations changed",e.destinations);var r=this.getDepartureAirportCodes(e.departureAirports),i=this.getDestinationAirportCodes(e.destinations);if(!e.destinations.length)return e.departureDate=null,e.duration=null,e;var n=this.flightSchedule.getMonthAvailability(r,i);this.view.departureDateSelector.setAvailableMonths(n),t.departureDate&&!n.includes(t.departureDate)&&(S.debug("departureDate",t.departureDate),e.departureDate=null,e.duration=null),e.reloadDurations=!0}return e}},{key:"handleDepartureDateSelection",value:function(e,t){if(e.reloadCalendar||e.reloadDurations||!(0,u.A)(t.departureDate,e.departureDate)){if(S.debug("departureDate changed",e.departureDate),!e.departureDate)return e.duration=null,e;var r=this.getDepartureAirportCodes(e.departureAirports),i=this.getDestinationAirportCodes(e.destinations);e.durations=this.flightSchedule.getDurations(r,i,e.departureDate),null!==t.duration&&e.durations.includes(e.duration)||e.durations.includes(e.duration)||(e.durations.includes(this.settings.defaultDuration)?e.duration=this.settings.defaultDuration:e.duration=e.durations[0])}return e}},{key:"handleDurationSelection",value:function(e,t){return(0,u.A)(t.duration,e.duration)||S.debug("duration changed",e.duration),e}}
1,{key:"getSelectionChangedHandlers",value:function(){throw"getSelectionChangedHandlers is abstract. Please provide implementation in subclass."}},{key:"selectionChanged",value:function(e){var t=this,r=[this.handleDepartureAirportSelection.bind(this),this.handleDestinationSelection.bind(this),this.handleDepartureDateSelection.bind(this),this.handleDurationSelection.bind(this)].reduce((function(e,r){return r(e,t.state)}),y({},e));this.state=y({},this.state,r),f.A.emit("baseVillaSearchPanelVm:selectionChanged",this.state.departureAirports),S.debug("selection",e,"result",r)}},{key:"parseDefaultChildAges",value:function(e){return e?e.split(",").filter((function(e){return""!==e&&parseInt(e)>0})).map((function(e){return parseInt(e)})):[]}},{key:"formatDate",value:function(e){var t=new Date("".concat(e.substring(0,4),"-").concat(e.substring(4,6),"-01T00:00:00"));return l()(t,"mmm yyyy")}},{key:"formatGuests",value:function(e){var t=e.children.length;return[0===e.adults?"":e.adults+(1===e.adults?" Adult":" Adults"),0===t?"":t+(1===t?" Child":" Children")].filter((function(e){return e})).join(", ")}},{key:"formatDepartureAirports",value:function(e){return 0===e.length?"":1===e.length?e[0].name:this.settings.airportSelectionText.replace(C,e.length)}},{key:"toggleDisabledFields",value:function(){throw"toggleDisabledFields is abstract. Please provide implementation in subclass."}},{key:"render",value:function(){var e=this.state;this.view.departureAirport=this.formatDepartureAirports(e.departureAirports),this.view.departureDate=this.state.departureDate?this.formatDate(e.departureDate):"",this.view.durations=e.durations,this.view.duration=e.duration,this.view.guests=this.formatGuests(e.guests),this.view.clearValidationErrors(),this.toggleDisabledFields()}},{key:"validate",value:function(){S.debug("validating...");var e=this.validator.validate(this.searchCriteria);S.debug("result",e.errors);var t=this.view.showValidationResults(e.errors,{showFirstErrorOnly:!0});return t&&t.length>0&&this.raiseErrorShownEvent(t[0]),e.isValid}},{key:"raiseErrorShownEvent",value:function(e){(0,d.raiseValidationErrorShown)(e)}},{key:"searchCriteria",get:function(){var e=this.state;return{departureAirports:this.getDepartureAirportCodes(e.departureAirports),destinations:e.destinations.map((function(e){return e.id})),departureDate:e.departureDate?e.departureDate.substring(0,6):e.departureDate,duration:e.duration,guests:e.guests}}},{key:"defaultState",get:function(){return{departureAirports:[],destinations:[],departureDate:null,duration:null,durations:[],guests:{adults:this.settings.defaultNumberOfAdults,children:this.parseDefaultChildAges(this.settings.defaultChildren),rooms:this.settings.defaultNumberOfRooms}}}},{key:"onFormSubmit",value:function(){S.info("form submit",this.searchCriteria);var e=this.validate();S.info("isValid",e),e?(p.A.SearchMade(h.SearchPanels.VillasSearchPanel,!0),this.proceedWithSearch()):p.A.SearchMade(h.SearchPanels.VillasSearchPanel,!1)}},{key:"proceedWithSearch",value:function(){throw"proceedWithSearch is abstract. Please provide implementation in subclass."}},{key:"subscribeToEvents",value:function(){this.view.onDepartureGroupClick(this.openDepartureSelectorModal.bind(this)),this.view.onDepartureDateGroupClick(this.openDepartureDateSelectorModal.bind(this)),this.view.onGuestGroupClick(this.openGuestSelectorModal.bind(this)),this.view.onDurationSelectionChanged(this.onDurationSelectionChanged.bind(this)),this.view.onFormSubmit(this.onFormSubmit.bind(this))}},{key:"allAvailableDepartureAirports",get:function(){throw"allAvailableDepartureAirports is abstract. Please provide implementation in subclass."}},{key:"allAvailableDestinations",get:function(){throw"allAvailableDestinations is abstract. Please provide implementation in subclass."}},{key:"onFlightScheduleLoaded",value:function(){var e=this.getPersistedState(),t=this.validatePersistedState(e);this.selectionChanged(t),this.view.departureAirportSelector.setMaxAirportsSelectable(this.maxAirportsSelectable),this.render()}},{key:"getPersistedState",value:function(){return c.default.getState(this.defaultState,this.allAvailableDepartureAirports,this.allAvailableDestinations)}},{key:"validatePersistedState",value:function(e){var t=this,r=(0,o.G)(this.defaultState);return this.validateGuestAdults(e.guests.adults)&&(r.guests.adults=e.guests.adults),this.validateGuestChildren(e.guests.children.length)&&(r.guests.children=e.guests.children),this.validateGuestRooms(e.guests.rooms
1)&&(r.guests.rooms=e.guests.rooms),0===e.departureAirports.length||this.maxAirportsSelectable&&e.departureAirports.length>this.maxAirportsSelectable?r:(r.departureAirports=e.departureAirports,e.destinations.every((function(e){return t.flightSchedule.getDestinationsFrom(r.departureAirports.map((function(e){return e.code}))).includes(e.airport)}))?(r.destinations=e.destinations,this.flightSchedule.getMonthAvailability(r.departureAirports.map((function(e){return e.code})),r.destinations.map((function(e){return e.airport}))).includes(e.departureDate)?(r.departureDate=e.departureDate,this.flightSchedule.getDurations(r.departureAirports.map((function(e){return e.code})),r.destinations.map((function(e){return e.airport})),r.departureDate).includes(e.duration)?(r.duration=e.duration,r):r):r):r)}}])&&k(e.prototype,t),r&&k(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},42405:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var i=r(89463),n=r(40599),o=r(67029);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function u(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var d=i.Ay.create("flightSchedule");const p=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.settings=t,this.data=null,this.promise=null,this.isLoaded=!1},(t=[{key:"load",value:function(){var e=this;if(this.promise)return this.promise;var t=this.settings.brandId;return this.promise=new Promise((function(r){e.data||(d.time("fetch data"),n.Ay.getJson("/api/jet2/flightschedule/getvillasbymonths?base64=true",{cache:!0,data:{brandId:t}}).then((function(t){d.debug("data received",Object.keys(t)),d.timeEnd("fetch data"),o.default.expandDurationsForSingleDataSet(t),e.data=t,e.dateRange=e.getDateRange(),e.isLoaded=!0,r(t)})))})),this.promise}},{key:"getDestinationsFrom",value:function(e){var t=this;return s(new Set(e.reduce((function(e,r){return e.concat(t.data.hasOwnProperty(r.toLowerCase())?Object.keys(t.data[r.toLowerCase()]).map((function(e){return e.toUpperCase()})):[])}),[]))).sort()}},{key:"getDeparturesTo",value:function(e){var t=this,r=e.map((function(e){return e.toLowerCase()})),i=Object.keys(this.data),n=function(e,r){return r.some((function(r){return(i=e,Object.keys(t.data[i]).map((function(e){return e.toLowerCase()}))).includes(r);var i}))};return i.filter((function(e){return n(e,r)})).map((function(e){return e.toUpperCase()}))}},{key:"getMonthAvailability",value:function(e,t){var r=this,i=function(e,t){var i,n=r.data[e][t]||{};return Object.keys(n)&&(i=n,Object.keys(i).filter((function(e){return i[e].length>2})))},n=this.getSectors(e,t).reduce((function(e,t){return e.concat(i(t.from,t.to))}),[]);return s(new Set(n)).map((function(e){return e+"01"})).sort()}},{key:"getDurations",value:function(e,t,r){var i=this,n=r.substring(0,6),o=this.getSectors(e,t).reduce((function(e,t){return e.concat((r=t.from,o=t.to,i.data[r][o]&&i.data[r][o][n]?i.data[r][o][n]:[]));var r,o}),[]);return s(new Set(o)).filter((function(e){return e>=i.settings.minDuration&&e<=i.settings.maxDuration})).sort((function(e,t){return e-t}))}},{key:"getDateRange",value:function(){return s(new Set(Object.values(this.data).reduce((function(e,t){return e.concat(Object.values(t).reduce((function(e,t){return e.concat(Object.keys(t))}),[]))}),[]))).map((function(e){return new Date("".concat(e.substring(0,4),"-").concat(e.substring(4,6),"-01"))})).sort((function(e,t){return e-t}))}},{key:"getSectors",value:function(e,t){return e.reduce((function(e,r){return e.concat(t.map((function(e){return{from:r.toLowerCase(),to:e.toLowerCase()}})))}),[])}}])&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},3857:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}r.r(t),r.d(t,{default:()=>a});const a=function(){return e=function e(t,r,i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$form=t,this.props=n,this.groupSelector=r,this.$group=t.find(r),this.$input=t.find(i)},(t=[{key:"onClick",value:function(e){var t=this;this.$form.on("click","".concat(this.groupSelector,":not('").concat(this.props.disabledInputCssClass,"')"),(function(r){return t.$input.blur(),e.call(t,r),!1}))}},{key:"enable",value:function(){this.$input.removeAttr("disabled"),this.$group.removeClass(this.props.disabledInput)}},{key:"disable",value:function(){this.$input.attr("disabled","disabled"),this.$group.addClass(this.props.disabledInput)}},{key:"value",set:function(e){this.$input.val(e)}}])&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},9868:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var i=r(37126),n=r(18987),o=r(5370),a=r(79833),s=r.n(a),l=r(57992),u=r(647),c="VILLAS_SC";const d={getState:function(e,t,r){var a=window.location.search.substring(1),d=o.default.searchQueryStringToObject(a);d||(a=n.A.get(c),d=o.default.searchQueryStringToObject(a)),d&&n.A.set(c,a);var p=function(e,t,r,n){var a=(0,i.G)(t),c=o.default.searchQueryStringParams;if(e){var d=a.guests.adults,p=a.guests.children;if(e[c.occupancy]){var h=(0,u.t)(e[c.occupancy]);d=h[0].Adults,p=h[0].Children}if(a.guests.adults=d,a.guests.children=p,a.guests.rooms=void 0===e[c.rooms]?0:e[c.rooms],a.departureAirports=r.filter((function(t){return e[c.from].map((function(e){return e.toString()})).includes(t.id.toString())})),a.destinations=n.filter((function(t){return e[c.to].map((function(e){return e.toString()})).includes(t.id.toString())})),e[c.leaving]){var f=e[c.leaving],m=(0,l.zF)(f);isNaN(m)||(a.departureDate=s()(m,"yyyymmdd"))}a.duration=e[c.nights]}return a}(d,e,t,r);return p}}},53921:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var i={from:"from",to:"to",leaving:"leaving",nights:"nights",adults:"adults",children:"children",rooms:"rooms",preferredDate:"preferredDate",oflight:"oflight",iflight:"iflight"},n={from:"Array",to:"Array",leaving:"String",nights:"Number",adults:"Number",children:"Array",rooms:"Number",preferredDate:"String",oflight:"Number",iflight:"Number"};const o={searchQueryStringParams:i,searchQueryStringToObject:function(e){if(!e)return null;var t={};e.split("&").map((function(e){return e.split("=")})).forEach((function(e){var r=decodeURIComponent(e[0]),o=decodeURIComponent(e[1]).split(","),a=o.length>1?o:function(e,t){var r=n[e];return"Array"===r?t?[t]:[]:"Number"===r?parseInt(t):t}(r,o[0]);Object.keys(i).find((function(e){return i[e]===r}))&&(t[r]=a)}));var r=Object.keys(t);return["from","to","leaving","nights","adults"].every((function(e){return r.includes(e)}))?t:null}}},89165:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var i=r(5370);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var s=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.baseUrl=t},(t=[{key:"build",value:function(e){var t=i.default.searchQueryStringParams,r=e.departureAirports.join("_"),n=e.destinations.join("_"),o=e.departureDate,a=e.duration,s=e.guests.adults,l=e.guests.children.join("_"),u=Number(e.guests.rooms
1)>0?"&".concat(t.rooms,"=").concat(e.guests.rooms):"",c="&".concat(t.occupancy,"=r").concat(s).concat(l?"c"+l:"c");return"".concat(this.baseUrl,"?").concat(t.from,"=").concat(r,"&").concat(t.to,"=").concat(n,"&").concat(t.leaving,"=").concat(o,"&").concat(t.nights,"=").concat(a).concat(c).concat(u)}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},69641:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var i=r(62662),n=r.n(i);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function l(e,t,r){return t=c(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,r||[],c(e).constructor):t.apply(e,r))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}const p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(t,e),r=t,(i=[{key:"createOption",value:function(e){return n()("<option></option>").attr("value",e).text(e)}},{key:"values",set:function(e){var t=this;this.$input.empty(),e.forEach((function(e){return t.$input.append(t.createOption(e))}))}}])&&a(r.prototype,i),o&&a(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,o}(r(3857).default)},47502:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>T,numberToken:()=>C});var i=r(89463),n=r(67922),o=r(37126),a=r(42405),s=r(79833),l=r.n(s),u=r(95142),c=r(9868),d=r(29427),p=r(66447),h=r(86565),f=r(6861),m=r(8988);function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},y.apply(null,arguments)}function b(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function k(e,t){for(var r=0;r<t.length;r++){var i=t[r];
1i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,w(i.key),i)}}function w(e){var t=function(e,t){if("object"!=v(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=v(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==v(t)?t:t+""}var S=i.Ay.create("smartVillaSearchPanelVm"),C="$number";const T=function(){return e=function e(t,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),S.debug("smartVillaSearchPanelVm"),this.view=t,this.props=r,this.settings=this.props.settings,this.validator=new n.default(this.view.loadValidationMessages()),this.validateGuestAdults=function(e){return i.view.guestSelector.validateAdults(e)},this.validateGuestChildren=function(e){return i.view.guestSelector.validateChildren(e)},this.validateGuestRooms=function(e){return i.view.guestSelector.validateRooms(e)},this.getDepartureAirportCodes=function(e){return e.map((function(e){return e.code})).sort()},this.getDepartureAirportIds=function(e){return e.map((function(e){return e.id})).sort()},this.getDestinationAirportCodes=function(e){return b(new Set(e.map((function(e){return e.airport})))).sort()},this.state=(0,o.G)(this.defaultState),this.flightSchedule=new a.default({minDuration:this.settings.minDuration,maxDuration:this.settings.maxDuration,brandId:this.settings.brandId}),this.flightSchedule.load().then(this.onFlightScheduleLoaded.bind(this)),this.subscribeToEvents(),this.render(),f.A.on("SearchContainer:mobileanchor",(function(){m.A.scrollToElement(i.view.$element,300,-70)}))},(t=[{key:"openDepartureSelectorModal",value:function(){S.info("openDepartureSelectorModal");var e=this.state.departureAirports.slice(0);this.view.departureAirportSelector.openModal(e,this.onDepartureAirportSelectionChanged.bind(this))}},{key:"openDepartureDateSelectorModal",value:function(){S.info("openDepartureDateSelectorModal"),this.view.departureDateSelector.openModal(this.state.departureDate,this.onDepartureDateSelectionChanged.bind(this))}},{key:"openGuestSelectorModal",value:function(){S.info("openGuestSelectorModal"),this.view.guestSelector.openModal(this.state.guests,this.onGuestSelectionChanged.bind(this))}},{key:"onDepartureAirportSelectionChanged",value:function(e){var t=this;S.info("onDepartureAirportSelectionChanged",e),this.flightSchedule.isLoaded?(this.selectionChanged(y({},this.state,{departureAirports:e})),this.render()):(this.state.departureAirports=e,this.render(),this.flightSchedule.load().then((function(){t.state.departureAirports=[],t.selectionChanged(y({},t.state,{departureAirports:e})),t.render()})))}},{key:"onDepartureDateSelectionChanged",value:function(e){S.info("onDepartureDateSelectionChanged",e),this.selectionChanged(y({},this.state,{departureDate:e})),this.render()}},{key:"onDurationSelectionChanged",value:function(e){S.info("onDurationSelectionChanged",e),this.selectionChanged(y({},this.state,{duration:e})),this.render()}},{key:"onGuestSelectionChanged",value:function(e){S.info("onGuestSelectionChanged",e),this.state.guests=e,this.render()}},{key:"updateAvailableDestinations",value:function(e){throw"updateAvailableDestinations is abstract. Please provide implementation in subclass."}},{key:"isDestinationAvailable",value:function(e){throw"isDestinationAvailable is abstract. Please provide implementation in subclass."}},{key:"handleDepartureAirportSelection",value:function(e,t){var r=this,i=this.getDepartureAirportCodes(e.departureAirports);if(!(0,u.A)(this.getDepartureAirportCodes(t.departureAirports),i)){S.debug("departure airports changed",e.destinations);var n=this.flightSchedule.getDestinationsFrom(i);this.updateAvailableDestinations(n),this.view.departureDateSelector.init(this.flightSchedule.dateRange),t.destinations.map((function(e){return e.id})).every((function(e){return r.isDestinationAvailable(e)}))||(e.destinations=[],e.departureDate=null,e.duration=null),e.reloadCalendar=!0}return e}},{key:"handleDestinationSelection",value:function(e,t){if(e.reloadCalendar||!(0,u.A)(t.destinations.map((function(e){return e.id})),e.destinations.map((function(e){return e.id})))){S.debug("destinations changed",e.destinations);var r=this.getDepartureAirportCodes(e.departureAirports),i=this.getDestinationAirportCodes(e.destinations);if(!e.destinations.length)return e.departureDate=null,e.duration=null,e;var n=this.flightSchedule.getMonthAvailability(r,i);this.view.departureDateSelector.setAvailableMonths(n),t.departureDate&&!n.includes(t.departureDate)&&(S.debug("departureDate",t.departureDate),e.departureDate=null,e.duration=null),e.reloadDurations=!0}return e}},{key:"handleDepartureDateSelection",value:function(e,t){if(e.reloadCalendar||e.reloadDurations||!(0,u.A)(t.departureDate,e.departureDate)){if(S.debug("departureDate changed",e.departureDate),!e.departureDate)return e.duration=null,e;var r=this.getDepartureAirportCodes(e.departureAirports),i=this.getDestinationAirportCodes(e.destinations);e.durations=this.flightSchedule.getDurations(r,i,e.departureDate),null!==t.duration&&e.durations.includes(e.duration)||e.durations.includes(e.duration)||(e.durations.includes(this.settings.defaultDuration)?e.duration=this.settings.defaultDuration:e.duration=e.durations[0])}return e}},{key:"handleDurationSelection",value:function(e,t){return(0,u.A)(t.duration,e.duration)||S.debug("duration changed",e.duration),e}}
1,{key:"getSelectionChangedHandlers",value:function(){throw"getSelectionChangedHandlers is abstract. Please provide implementation in subclass."}},{key:"selectionChanged",value:function(e){var t=this,r=[this.handleDepartureAirportSelection.bind(this),this.handleDestinationSelection.bind(this),this.handleDepartureDateSelection.bind(this),this.handleDurationSelection.bind(this)].reduce((function(e,r){return r(e,t.state)}),y({},e));this.state=y({},this.state,r),f.A.emit("smartVillaSearchPanelVm:selectionChanged",this.state.departureAirports),S.debug("selection",e,"result",r)}},{key:"parseDefaultChildAges",value:function(e){return e?e.split(",").filter((function(e){return""!==e&&parseInt(e)>0})).map((function(e){return parseInt(e)})):[]}},{key:"formatDate",value:function(e){var t=new Date("".concat(e.substring(0,4),"-").concat(e.substring(4,6),"-01T00:00:00"));return l()(t,"mmm yyyy")}},{key:"formatGuests",value:function(e){var t=e.children.length;return[0===e.adults?"":e.adults+(1===e.adults?" Adult":" Adults"),0===t?"":t+(1===t?" Child":" Children")].filter((function(e){return e})).join(", ")}},{key:"formatDepartureAirports",value:function(e){return 0===e.length?"":1===e.length?e[0].name:this.settings.airportSelectionText.replace(C,e.length)}},{key:"toggleDisabledFields",value:function(){throw"toggleDisabledFields is abstract. Please provide implementation in subclass."}},{key:"render",value:function(){var e=this.state;this.view.departureAirport=this.formatDepartureAirports(e.departureAirports),this.view.departureDate=this.state.departureDate?this.formatDate(e.departureDate):"",this.view.durations=e.durations,this.view.duration=e.duration,this.view.guests=this.formatGuests(e.guests),this.view.clearValidationErrors(),this.toggleDisabledFields()}},{key:"validate",value:function(){S.debug("validating...");var e=this.validator.validate(this.searchCriteria);S.debug("result",e.errors);var t=this.view.showValidationResults(e.errors,{showFirstErrorOnly:!0});return t&&t.length>0&&this.raiseErrorShownEvent(t[0]),e.isValid}},{key:"raiseErrorShownEvent",value:function(e){(0,d.raiseValidationErrorShown)(e)}},{key:"searchCriteria",get:function(){var e=this.state;return{departureAirports:this.getDepartureAirportIds(e.departureAirports),destinations:e.destinations.map((function(e){return e.id})),departureDate:e.departureDate?"".concat(e.departureDate.substring(6,8),"-").concat(e.departureDate.substring(4,6),"-").concat(e.departureDate.substring(0,4)):e.departureDate,duration:e.duration,guests:e.guests}}},{key:"defaultState",get:function(){return{departureAirports:[],destinations:[],departureDate:null,duration:null,durations:[],guests:{adults:this.settings.defaultNumberOfAdults,children:this.parseDefaultChildAges(this.settings.defaultChildren),rooms:this.settings.defaultNumberOfRooms}}}},{key:"onFormSubmit",value:function(){S.info("form submit",this.searchCriteria);var e=this.validate();S.info("isValid",e),e?(p.A.SearchMade(h.SearchPanels.VillasSearchPanel,!0),this.proceedWithSearch()):p.A.SearchMade(h.SearchPanels.VillasSearchPanel,!1)}},{key:"proceedWithSearch",value:function(){throw"proceedWithSearch is abstract. Please provide implementation in subclass."}},{key:"subscribeToEvents",value:function(){this.view.onDepartureGroupClick(this.openDepartureSelectorModal.bind(this)),this.view.onDepartureDateGroupClick(this.openDepartureDateSelectorModal.bind(this)),this.view.onGuestGroupClick(this.openGuestSelectorModal.bind(this)),this.view.onDurationSelectionChanged(this.onDurationSelectionChanged.bind(this)),this.view.onFormSubmit(this.onFormSubmit.bind(this))}},{key:"allAvailableDepartureAirports",get:function(){throw"allAvailableDepartureAirports is abstract. Please provide implementation in subclass."}},{key:"allAvailableDestinations",get:function(){throw"allAvailableDestinations is abstract. Please provide implementation in subclass."}},{key:"onFlightScheduleLoaded",value:function(){var e=this.getPersistedState(),t=this.validatePersistedState(e);this.selectionChanged(t),this.view.departureAirportSelector.setMaxAirportsSelectable(this.maxAirportsSelectable),t.destinations.length>0&&t.departureAirports.length>0&&f.A.emit("SearchContainer:updateState",{state:this.buildRichState(t)}),this.render()}},{key:"getPersistedState",value:function(){return c.default.getState(this.defaultState,this.allAvailableDepartureAirports,this.allAvailableDestinations)}},{key:"validatePersistedState",value:function(e){var t=this,r=(0,o.G)(this.defaultState);return this.validateGuestAdults(e.guests.adults)&&(r.guests.adults=e.guests.adults),this.validateGuestChildren(e.guests.children.length)&&(r.guests.children=e.guests.children),this.validateGuestRooms(e.guests.rooms
1)&&(r.guests.rooms=e.guests.rooms),0===e.departureAirports.length?r:(r.departureAirports=e.departureAirports,e.destinations.every((function(e){return t.flightSchedule.getDestinationsFrom(r.departureAirports.map((function(e){return e.code}))).includes(e.airport)}))?(r.destinations=e.destinations,this.flightSchedule.getMonthAvailability(r.departureAirports.map((function(e){return e.code})),r.destinations.map((function(e){return e.airport}))).includes(e.departureDate)?(r.departureDate=e.departureDate,this.flightSchedule.getDurations(r.departureAirports.map((function(e){return e.code})),r.destinations.map((function(e){return e.airport})),r.departureDate).includes(e.duration)?(r.duration=e.duration,r):r):r):r)}},{key:"buildRichState",value:function(e){return{airportNames:e.departureAirports.map((function(e){return e.name})),destinationNames:e.destinations.map((function(e){return e.name})),departureDate:e.departureDate?this.formatDate(e.departureDate):null,duration:e.duration,occupancyAdults:e.guests.adults,occupancyChildren:e.guests.children.length}}}])&&k(e.prototype,t),r&&k(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},5370:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var i={from:"airport",to:"destination",leaving:"date",nights:"duration",rooms:"numberofbedrooms",preferredDate:"preferredDate",oflight:"oflight",iflight:"iflight",occupancy:"occupancy"},n={airport:"Array",destination:"Array",date:"String",duration:"Number",numberofbedrooms:"Number",preferredDate:"String",oflight:"Number",iflight:"Number",occupancy:"String"};const o={searchQueryStringParams:i,searchQueryStringToObject:function(e){if(!e)return null;var t={};e.split("&").map((function(e){return e.split("=")})).forEach((function(e){var r=decodeURIComponent(e[0]),o=r===i.from||r===i.to?decodeURIComponent(e[1]).split("_"):decodeURIComponent(e[1]).split(","),a=o.length>1?o:function(e,t){var r=n[e];return"Array"===r?t?[t]:[]:"Number"===r?parseInt(t):t}(r,o[0]);Object.keys(i).find((function(e){return i[e]===r}))&&(t[r]=a)}));var r=Object.keys(t);return["airport","destination","date","duration","occupancy"].every((function(e){return r.includes(e)}))?t:null}}},14936:(e,t,r)=>{"use strict";r.r(t),r.d(t,{View:()=>v,ViewModel:()=>o.default});var i=r(89463),n=r(79253),o=r(88529),a=r(3857),s=r(79731);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,c(i.key),i)}}function c(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=l(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}function d(e,t,r){return t=h(t),function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var m=i.Ay.create("villaSearchPanel"),v=function(e){function t(e,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=d(this,t,[e]),m.debug("initialising VillaSearchPanelView... "),i.destinationSelector=i.loadChildComponent("DestinationSelector",s),i.formGroups.destinations=new a.default(i.$element,".search-box-group--to","#search-box-to",i.selectors),i.dockedHandler(r.desktopDocked),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),r=t,(i=[{key:"destination",set:function(e){this.formGroups.destinations.value=e}},{key:"disableDestinationSelection",value:function(){this.formGroups.destinations.disable()}},{key:"enableDestinationSelection",value:function(){this.formGroups.destinations.enable()}},{key:"onDestinationGroupClick",value:function(e){this.formGroups.destinations.onClick(e)}},{key:"dockedHandler",value:function(e){e&&document.body.classList.add("sticky-search")}}
1])&&u(r.prototype,i),n&&u(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,n}(n.default)},67922:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var i=r(30826),n=r.n(i),o=function(e,t){n().validators[e]=function(e,r,i,n){return t(e)?null:r.message}};function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=l(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},u.apply(null,arguments)}var c=function(e,t){var r=u({},e);for(var i in t)t.hasOwnProperty(i)&&("object"!=l(r[i])?r[i]=t[i]:"object"==l(t[i])&&(r[i]=c(r[i],t[i])));return r};const d=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o("guestsRequired",(function(e){return e.adults+e.children.length>0})),o("childAgesRequired",(function(e){return e.children.every((function(e){return null!=e}))})),o("oneInfantPerAdult",(function(e){return e.children.filter((function(e){return 1===e})).length<=e.adults})),this.rules=this.mergeRules(this.defaults,t)},(t=[{key:"mergeRules",value:function(e,t){var r=c(e,t);return r.duration.numericality.notGreaterThan=r.duration.presence.message,r}},{key:"defaults",get:function(){return{departureAirports:{presence:{message:"Please select a departure airport"}},departureDate:{presence:{message:"Please select a departure date"}},duration:{presence:{message:"Please select a duration"},numericality:{greaterThan:0,notGreaterThan:"Please select a duration"}},guests:{guestsRequired:{message:"Please select the number of guests"},childAgesRequired:{message:"Please provide ages for all children"},oneInfantPerAdult:{message:"Only one infant per adult allowed"}}}}},{key:"isValid",value:function(e,t){return n().isEmpty(n().single(e,this.rules[t])||{})}},{key:"validate",value:function(e){var t=n()(e,this.rules,{fullMessages:!1})||{};return{isValid:n().isEmpty(t),errors:t}}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},88529:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var i=r(89463),n=r(47502),o=r(89165);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},s.apply(null,arguments)}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=a(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}function c(e,t,r){return t=f(t),function(e,t){if(t&&("object"==a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}function p(e,t,r,i){var n=h(f(1&i?e.prototype:e),t,r);return 2&i?function(e){return n.apply(r,e)}:n}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},h.apply(null,arguments)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var v=i.Ay.create("villaSearchPanelVm");const y=function(e){function t(e,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=c(this,t,[e,r]),v.debug("villaSearchPanelVm"),i.urlBuilder=new o.default(i.props.settings.searchResultsPageUrl),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),r=t,(i=[{key:"maxAirportsSelectable",get:function(){return this.allAvailableDepartureAirports.length}},{key:"allAvailableDepartureAirports",get:function(){return this.view.departureAirportSelector.allDepartureAirports()}},{key:"allAvailableDestinations",get:function(){return this.view.destinationSelector.allDestinations()}}
1,{key:"onFlightScheduleLoaded",value:function(){p(t,"onFlightScheduleLoaded",this,3)([])}},{key:"openDestinationSelectorModal",value:function(){var e=this;v.info("openDestinationSelectorModal"),this.flightSchedule.load().then((function(){var t=e.state.destinations.slice(0);e.view.destinationSelector.openModal(t,e.onDestinationSelectionChanged.bind(e))}))}},{key:"onDestinationSelectionChanged",value:function(e){v.info("onDestinationSelectionChanged",e),this.selectionChanged(s({},this.state,{destinations:e})),this.render()}},{key:"updateAvailableDestinations",value:function(e){this.view.destinationSelector.init(e)}},{key:"isDestinationAvailable",value:function(e){return this.view.destinationSelector.isDestinationAvailable(e)}},{key:"subscribeToEvents",value:function(){p(t,"subscribeToEvents",this,3)([]),this.view.onDestinationGroupClick(this.openDestinationSelectorModal.bind(this))}},{key:"formatDestinations",value:function(e){return 0===e.length?"":1===e.length?e[0].name:this.settings.destinationSelectionText.replace(n.numberToken,e.length)}},{key:"toggleDisabledFields",value:function(){this.validator.isValid(this.state.departureAirports,"departureAirports")?this.view.enableDestinationSelection():(this.view.disableDestinationSelection(),this.view.disableDepartureDateSelection(),this.view.disableDurationSelection()),this.validator.isValid(this.state.destinations,"destinations")?this.view.enableDepartureDateSelection():(this.view.disableDepartureDateSelection(),this.view.disableDurationSelection()),this.validator.isValid(this.state.departureDate,"departureDate")?this.view.enableDurationSelection():this.view.disableDurationSelection()}},{key:"render",value:function(){var e=this.state;this.view.destination=this.formatDestinations(e.destinations),p(t,"render",this,3)([])}},{key:"proceedWithSearch",value:function(){this.captureAnalyticsEventOnDoSearch();var e=this.urlBuilder.build(this.searchCriteria);window.location.href=e}},{key:"captureAnalyticsEventOnDoSearch",value:function(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Streamlined_homepage",category:"Search Panel",action:"Click",label:"Submit Search"})}}])&&l(r.prototype,i),a&&l(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i,a}(n.default)},87594:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});const i={adult:"Adult",adults:"Adults",child:"Child",children:"Children",infant:"Infant",infants:"Infants",night:"Night",nights:"Nights"}},647:(e,t,r)=>{"use strict";r.d(t,{b:()=>s,t:()=>a});var i=r(87594);function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}var a=function(e){var t=[];if(e){var r,i=n(e.substr(1).split("r"));try{for(i.s();!(r=i.n()).done;){var o=r.value.split("c"),a=o[1]&&o[1].length?o[1].split("_").filter((function(e){return e&&!isNaN(e)})).map((function(e){return parseInt(e)})):[];isNaN(o[0])||t.push({Adults:parseInt(o[0]),Children:a})}}catch(e){i.e(e)}finally{i.f()}}return t},s=function(e,t,r){var n=["".concat(e," ").concat(1===e?i.A.adult:i.A.adults)];return t&&(n=n.concat(["".concat(t," ").concat(1===t?i.A.child:i.A.children)])),r&&(n=n.concat(["".concat(r," ").concat(1===r?i.A.infant:i.A.
1infants)])),n.join(", ")}},70573:(e,t,r)=>{"use strict";r.r(t),r.d(t,{hasFiredGtmEventTracking:()=>s,hasFiredTouristTaxEventTracking:()=>o,setGtmEventTrackingAsFired:()=>l,setTouristTaxEventTrackingAsFired:()=>a,unsetTouristTaxEventTrackingAsFired:()=>u});var i=!1,n=!1;function o(){return i}function a(){i=!0}function s(){return n}function l(){n=!0}function u(){i=!1}},88918:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){return'<div class="load-more margin-top">\r\n    <button class="btn-load-more js-map-explorer__load-more button--base button--flat" type="button">\r\n        <span class="btn-load-more__content">Load more\r\n            <svg xmlns="http://www.w3.org/2000/svg" class="btn-load-more__icon icon icon--arrow-down-darkblue" width="20" height="20">\r\n                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-down"></use>\r\n            </svg>\r\n        </span>\r\n        <span class="btn-load-more__loader">loading</span>\r\n    </button>\r\n</div>\r\n'},useData:!0})},30689:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a,s=e.escapeExpression,l=e.lambda,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="marker-child '+s("function"==typeof(a=null!=(a=u(r,"cssClass")||(null!=t?u(t,"cssClass"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"cssClass",hash:{},data:n,loc:{start:{line:1,column:25},end:{line:1,column:39}}}):a)+' js-map-explorer__marker" data-id="'+s(l(null!=(o=null!=t?u(t,"marker"):t)?u(o,"id"):o,t))+'">\r\n    <div class="marker-child__heading">'+s(l(null!=(o=null!=t?u(t,"marker"):t)?u(o,"title"):o,t))+'</div>\r\n    <div class="marker-child__pin"></div>\r\n    <div class="marker-child__triangle triangle"></div>\r\n</div>\r\n'},useData:!0})},28655:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a,s=e.escapeExpression,l=e.lambda,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="marker-dest '+s("function"==typeof(a=null!=(a=u(r,"cssClass")||(null!=t?u(t,"cssClass"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"cssClass",hash:{},data:n,loc:{start:{line:1,column:24},end:{line:1,column:38}}}):a)+' js-map-explorer__marker" data-id="'+s(l(null!=(o=null!=t?u(t,"marker"):t)?u(o,"id"):o,t))+'">\r\n        <div class="marker-dest__heading">'+s(l(null!=(o=null!=t?u(t,"marker"):t)?u(o,"title"):o,t))+" ("+s(l(null!=(o=null!=t?u(t,"marker"):t)?u(o,"totalVillas"):o,t))+')</div>\r\n        <div class="marker-dest__price">From &pound;'+s(l(null!=(o=null!=t?u(t,"marker"):t)?u(o,"minPrice"):o,t))+'pp</div>\r\n    <div class="marker-dest__triangle triangle"></div>\r\n</div>\r\n'},useData:!0})},80044:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a,s=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,u="function",c=e.escapeExpression,d=e.lambda,p=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="marker '+c(typeof(a=null!=(a=p(r,"cssClass")||(null!=t?p(t,"cssClass"):t))?a:l)===u?a.call(s,{name:"cssClass",hash:{},data:n,loc:{start:{line:1,column:19},end:{line:1,column:33}}}):a)+' js-map-explorer__marker" data-id="'+c(d(null!=(o=null!=t?p(t,"marker"):t)?p(o,"id"):o,t))+'" data-pin-type="'+c(d(null!=(o=null!=t?p(t,"marker"):t)?p(o,"pinType"):o,t))+'">\r\n    <div class="marker__inner">\r\n        <svg class="marker__icon icon icon--'+c(typeof(a=null!=(a=p(r,"iconClass")||(null!=t?p(t,"iconClass"):t))?a:l)===u?a.call(s,{name:"iconClass",hash:{},data:n,loc:{start:{line:3,column:44},end:{line:3,column:59}}}):a)+'" xmlns="http://www.w3.org/2000/svg" width="30" height="30" pointer-events="none">\r\n            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-'+c(typeof(a=null!=(a=p(r,"iconClass")||(null!=t?p(t,"iconClass"):t))?a:l)===u?a.call(s,{name:"iconClass",hash:{},data:n,loc:{start:{line:4,column:78},end:{line:4,column:93}}}):a)+'"></use>\r\n        </svg>\r\n        <div class="marker__items">'+c(d(null!=(o=null!=(o=null!=t?p(t,"marker"):t)?p(o,"items"):o)?p(o,"length"):o,t))+'</div>\r\n        <div class="marker__title">'+c(d(null!=(o=null!=t?p(t,"marker"):t)?p(o,"title"):o,t))+'</div>\r\n    </div>\r\n    <div class="marker__triangle triangle "></div>\r\n</div>\r\n\r\n'},useData:!0}
1)},36161:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="poi-overview">\r\n    <figure class="poi-overview__figure">\r\n        <img class="poi-overview__figure-img" src="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"imageUrl"):o,t))+'" alt="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"title"):o,t))+'">\r\n    </figure>\r\n    <div class="poi-overview__content">\r\n\r\n        <h3 class="poi-overview__heading">'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"title"):o,t))+'</h3>\r\n\r\n        <div class="poi-overview__summary">'+(null!=(o=a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"summary"):o,t))?o:"")+'</div>\r\n\r\n        <a class="poi-overview__more-details bttn bttn--primary bttn--full-width" href="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"url"):o,t))+'" target="_blank">More details</a>\r\n    </div>\r\n    <button class="modal-map-details-back button button--tiny js-map-explorer-details__back" type="button" data-id="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"id"):o,t))+'">\r\n        <span><svg class="modal-map-details-back__icon icon icon--arrow-left-blue button__icon" xmlns="http://www.w3.org/2000/svg" width="6"\r\n             height="12">\r\n            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-left"></use>\r\n        </svg>Back to list</span>\r\n    </button>\r\n</div>\r\n'},useData:!0})},84284:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="poi-card is-visible" data-id="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"id"):o,t))+'">\r\n    <figure class="poi-card__figure js-map-explorer__view-link" data-id="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"id"):o,t))+'">\r\n        <img class="poi-card__figure-img" src="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"imageUrl"):o,t))+'" alt="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"title"):o,t))+'">\r\n    </figure>\r\n    <div class="poi-card__content">\r\n        <h4 class="poi-card__title">\r\n            <a href="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"url"):o,t))+'" target="_blank">'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"title"):o,t))+'</a>\r\n        </h4>\r\n        <p class="poi-card__location">'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"locationPath"):o,t))+'</p>\r\n    </div>\r\n\t<div class="poi-card__footer">\r\n\t\t<a class="poi-card__footer-cell poi-card__footer-cell--view-link js-map-explorer__view-link" data-id="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"id"):o,t))+'">\r\n\t\t\t<svg class="icon icon--pin-blue" xmlns="http://www.w3.org/2000/svg" width="11" height="13">\r\n\t\t\t\t<use xlink:href="#icon-pin"></use>\r\n\t\t\t</svg>\r\n\t\t\tView on map\r\n\t\t</a>\r\n\t\t<a class="poi-card__footer-cell poi-card__footer-cell--details-link" href="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"url"):o,t))+'" target="_blank">\r\n\t\t\tDetails\r\n\t\t\t<svg xmlns="http://www.w3.org/2000/svg" class="icon icon--arrow-right" width="5" height="9">\r\n\t\t\t\t<use xlink:href="#icon-arrow-right"></use>\r\n\t\t\t</svg>\r\n\t\t</a>\r\n\t</div>\r\n</div>\r\n'},useData:!0})},71753:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({0:function(e,t,r,i,n){return"                <li>"+e.escapeExpression(e.lambda(t,t))+"</li>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<button class="modal-map-details-back button button--tiny js-map-explorer-details__back" type="button" data-id="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"id"):o,t))+'">\r\n    <span><svg class="modal-map-details-back__icon icon icon--arrow-left-blue button__icon" xmlns="http://www.w3.org/2000/svg" width="6"\r\n         height="12">\r\n        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-left"></use>\r\n    </svg>Back to list</span>\r\n</button>
1\r\n\r\n<div class="map-villa-card map-villa-card--details is-visible" data-id="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"id"):o,t))+'">\r\n    <div class="map-villa-card__figure">\r\n        <img class="map-villa-card__image lazyload" data-src="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"imageUrl"):o,t))+'" alt="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"title"):o,t))+'">\r\n    </div>\r\n    <div class="map-villa-card__header">\r\n        <div class="map-villa-card__title">'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"title"):o,t))+'</div>\r\n        <span class="map-villa-card__subtitle">'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"locationPath"):o,t))+'</span>\r\n    </div>\r\n    <div class="map-villa-card__content">\r\n        <p class="map-villa-card__summary">'+(null!=(o=a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"summary"):o,t))?o:"")+'</p>\r\n        <ul class="map-villa-card__list">\r\n'+(null!=(o=l(r,"each").call(null!=t?t:e.nullContext||{},null!=(o=null!=t?l(t,"marker"):t)?l(o,"keySellingPoints"):o,{name:"each",hash:{},fn:e.program(0,n,0),inverse:e.noop,data:n,loc:{start:{line:19,column:12},end:{line:21,column:21}}}))?o:"")+'        </ul>\r\n    </div>\r\n    <div class="map-villa-card__footer">\r\n        <a class="button button--base button--3d button--fullwidth" href="'+s(a(null!=(o=null!=t?l(t,"marker"):t)?l(o,"url"):o,t))+'" target="_blank">Villa details</a>\r\n    </div>\r\n</div>\r\n'},useData:!0})},84628:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({0:function(e,t,r,i,n){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t\t<div class="tooltip js-tooltip">\r\n\t\t\t\t<h3 class="title-m tooltip__heading js-tooltip-trigger">\r\n\t\t\t\t\t\t'+s(a(null!=(o=null!=(o=null!=t?l(t,"marker"):t)?l(o,"villaType"):o)?l(o,"heading"):o,t))+'\x3c!--\r\n\t\t\t\t --\x3e<svg class="tooltip__icon-arrow icon" width="13" height="13" xmlns="http://www.w3.org/2000/svg">\r\n\t\t\t\t\t<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-down-bold"></use>\r\n\t\t\t\t</svg>\r\n\t\t\t\t</h3>\r\n\t\t\t\t<div class="tooltip__content">\r\n\t\t\t\t\t<p>'+s(a(null!=(o=null!=(o=null!=t?l(t,"marker"):t)?l(o,"villaType"):o)?l(o,"content"):o,t))+'</p>\r\n\t\t\t\t\t<button class="tooltip__close js-tooltip-close" type="button">close</button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n'},1:function(e,t,r,i,n){var o,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t\t<h3 class="title-m">\r\n\t\t\t\t'+e.escapeExpression(e.lambda(null!=(o=null!=(o=null!=t?a(t,"marker"):t)?a(o,"villaType"):o)?a(o,"heading"):o,t))+"\r\n\t\t\t</h3>\r\n"},2:function(e,t,r,i,n){var o,a,s=null!=t?t:e.nullContext||{},l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t\t<div class="holiday-dropdown holiday-dropdown--map-view js-dropdown">\r\n\t\t\t\t<div class="holiday-dropdown__top js-dropdown-trigger">\r\n\t\t\t\t\t'+e.escapeExpression("function"==typeof(a=null!=(a=l(r,"heading")||(null!=t?l(t,"heading"):t))?a:e.hooks.helperMissing)?a.call(s,{name:"heading",hash:{},data:n,loc:{start:{line:33,column:5},end:{line:33,column:16}}}):a)+'\r\n\t\t\t\t\t<button class="holiday-dropdown__button">\r\n\t\t\t\t\t\t<svg class="holiday-dropdown__icon-arrow icon" width="13" height="13" xmlns="http://www.w3.org/2000/svg">\r\n\t\t\t\t\t\t\t<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-down-bold"></use>\r\n\t\t\t\t\t\t</svg>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class="holiday-dropdown__bottom js-dropdown-content">\r\n\t\t\t\t\t<div class="holiday-dropdown__content">\r\n'+(null!=(o=l(r,"each").call(s,null!=t?l(t,"content"):t,{name:"each",hash:{},fn:e.program(3,n,0),inverse:e.noop,data:n,loc:{start:{line:42,column:6},end:{line:140,column:15}}}))?o:"")+"\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n"},3:function(e,t,r,i,n){var o,a=null!=t?t:e.nullContext||{},s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return(null!=(o=s(r,"if").call(a,null!=t?s(t,"features"):t,{name:"if",hash:{},fn:e.program(4,n,0),inverse:e.noop,data:n,loc:{start:{line:43,column:7},end:{line:58,column:14}}}))?o:"")+(null!=(o=s(r,"if").call(a,null!=t?s(t,"includes"):t,{name:"if",hash:{},fn:e.program(6,n,0),inverse:e.noop,data:n,loc:{start:{line:59,column:7},end:{line:139,column:14}}}))?o:"")},4:function(e,t,r,i,n){var o,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t\t\t\t\t\t\t<div class="villa-features villa-features--results villa-features--map-view">\r\n\t\t\t\t\t\t\t\t\t<ul class="villa-features__list">\r\n'+(null!=(o=a(r,"each").call(null!=t?t:e.nullContext||{},null!=t?a(t,"features"):t,{name:"each",hash:{},fn:e.program(5,n,0),inverse:e.noop,data:n,loc:{start:{line:46,column:10},end:{line:55,column:19}}}))?o:"")+"\t\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t\t</div>\r\n"},5:function(e,t,r,i,n){var o,a=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,l="function",u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t\t\t\t\t\t\t\t\t\t<li class="villa-features__row">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="villa-features__item">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'+u(typeof(o=null!=(o=c(r,"heading")||(null!=t?c(t,"heading"):t))?o:s)===l?o.call(a,{name:"heading",hash:{},data:n,loc:{start:{line:49,column:13},end:{line:49,column:24}}}):o)+'\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="villa-features__value">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'+u(typeof(o=null!=(o=c(r,"value")||(null!=t?c(t,"value"):t))?o:s)===l?o.call(a,{name:"value",hash:{},data:n,loc:{start:{line:52,column:13},end:{line:52,column:22}}}):o)+"\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t</li>\r\n"},6:function(e,t,r,i,n){var o,a=null!=t?t:e.nullContext||{},s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t\t\t\t\t\t\t<div class="holiday-includes">\r\n\r\n'+(null!=(o=s(r,"if").call(a,null!=t?s(t,"flightTimes"):t,{name:"if",hash:{},fn:e.program(7,n,0),inverse:e.noop,data:n,loc:{start:{line:62,column:36},end:{line:80,column:43}}}))?o:"")+"\r\n"+(null!=(o=s(r,"if").call(a,null!=t?s(t,"boardType"):t,{name:"if",hash:{},fn:e.program(8,n,0),inverse:e.noop,data:n,loc:{start:{line:82,column:36},end:{line:106,column:43}}}))?o:"")+'\r\n                                    <div class="villa-card__group">\r\n                                        <ul class="holiday-includes__list">\r\n'+(null!=(o=s(r,"each").call(a,null!=t?s(t,"includes"):t,{name:"each",hash:{},fn:e.program(11,n,0),inverse:e.noop,data:n,loc:{start:{line:110,column:44}
vendor: 9,734 bytes, line 1
1,end:{line:135,column:53}}}))?o:"")+"                                        </ul>\r\n                                    </div>\r\n\t\t\t\t\t\t\t\t</div>\r\n"},7:function(e,t,r,i,n){var o,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'                                    <div class="villa-card__group">\r\n                                        <h3 class="villa-card__subtitle">Flight times</h3>\r\n                                        <div class="tooltip tooltip--droptip js-tooltip" data-group="holiday-info">\r\n                                            <div class="tooltip__heading js-tooltip-trigger">\r\n                                                Show flight times\r\n                                                <button class="tooltip__button">\r\n                                                    <svg class="tooltip__icon-arrow icon" width="13" height="13" xmlns="http://www.w3.org/2000/svg">\r\n                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-down"></use>\r\n                                                    </svg>\r\n                                                </button>\r\n                                            </div>\r\n                                            <div class="tooltip__content holiday-dropdown__droptip-content">\r\n                                                '+(null!=(o=e.lambda(null!=(o=null!=t?a(t,"flightTimes"):t)?a(o,"content"):o,t))?o:"")+'\r\n                                                <button class="tooltip__close js-tooltip-close" type="button">close</button>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n'},8:function(e,t,r,i,n){var o,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'                                    <div class="villa-card__group">\r\n                                        <h3 class="villa-card__subtitle">Board type</h3>\r\n                                        <div class="tooltip tooltip--droptip js-tooltip js-villa-card-board" data-group="holiday-info">\r\n                                            <div class="tooltip__heading js-tooltip-trigger">\r\n                                                <span class="js-tooltip-title">Self catering</span>\r\n                                                <button class="tooltip__button">\r\n                                                    <svg class="tooltip__icon-arrow icon" width="13" height="13" xmlns="http://www.w3.org/2000/svg">\r\n                                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-down"></use>\r\n                                                    </svg>\r\n                                                </button>\r\n                                            </div>\r\n                                            <div class="tooltip__content holiday-dropdown__droptip-content">\r\n                                                <b>Board basis</b>\r\n'+(null!=(o=a(r,"each").call(null!=t?t:e.nullContext||{},null!=(o=null!=t?a(t,"boardType"):t)?a(o,"options"):o,{name:"each",hash:{},fn:e.program(9,n,0),inverse:e.noop,data:n,loc:{start:{line:96,column:48},end:{line:101,column:57}}}))?o:"")+'                                                <button class="tooltip__close js-tooltip-close" type="button">close</button>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n'},9:function(e,t,r,i,n){var o,a,s=e.lambda,l=e.escapeExpression,u=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing,d="function",p=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'                                                <div class="form-radio">\r\n                                                    <input class="form-radio__input js-villa-card-board-radio" type="radio" name="'+l(s((o=(o=n&&p(n,"root"))&&p(o,"marker"))&&p(o,"id"),t))+'-board" value="'+l(typeof(a=null!=(a=p(r,"title")||(null!=t?p(t,"title"):t))?a:c)===d?a.call(u,{name:"title",hash:{},data:n,loc:{start:{line:98,column:164},end:{line:98,column:173}}}):a)+'" id="'+l(s((o=(o=n&&p(n,"root"))&&p(o,"marker"))&&p(o,"id"),t))+"-board-"+l(typeof(a=null!=(a=p(r,"index")||n&&p(n,"index"))?a:c)===d?a.call(u,{name:"index",hash:{},data:n,loc:{start:{line:98,column:205},end:{line:98,column:215}}}):a)+'" '+(null!=(o=p(r,"if").call(u,null!=t?p(t,"checked"):t,{name:"if",hash:{},fn:e.program(10,n,0),inverse:e.noop,data:n,loc:{start:{line:98,column:217},end:{line:98,column:246}}}))?o:"")+'>\r\n                                                    <label class="form-radio__label" for="'+l(s((o=(o=n&&p(n,"root"))&&p(o,"marker"))&&p(o,"id"),t))+"-board-"+l(typeof(a=null!=(a=p(r,"index")||n&&p(n,"index"))?a:c)===d?a.call(u,{name:"index",hash:{},data:n,loc:{start:{line:99,column:116},end:{line:99,column:126}}}):a)+'">'+l(typeof(a=null!=(a=p(r,"title")||(null!=t?p(t,"title"):t))?a:c)===d?a.call(u,{name:"title",hash:{},data:n,loc:{start:{line:99,column:128},end:{line:99,column:137}}}):a)+"</label>\r\n                                                </div>\r\n"},10:function(e,t,r,i,n){return"checked"},11:function(e,t,r,i,n){var o,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(o=a(r,"if").call(null!=t?t:e.nullContext||{},null!=t?a(t,"isCarHire"):t,{name:"if",hash:{},fn:e.program(12,n,0),inverse:e.program(13,n,0),data:n,loc:{start:{line:111,column:48},end:{line:134,column:55}}}))?o:""},12:function(e,t,r,i,n){var o,a=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,l="function",u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'                                                    <li class="holiday-includes__li tooltip js-tooltip">\r\n                                                        <svg class="holiday-includes__icon icon" width="12" height="12" xmlns="http://www.w3.org/2000/svg">\r\n                                                            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#'+u(typeof(o=null!=(o=c(r,"icon")||(null!=t?c(t,"icon"):t))?o:s)===l?o.call(a,{name:"icon",hash:{},data:n,loc:{start:{line:114,column:121},end:{line:114,column:129}}}):o)+'"></use>\r\n                                                        </svg>\r\n                                                        <p class="tooltip__heading title-link js-tooltip-trigger">\r\n                                                            Car hire\x3c!--\r\n                                                 --\x3e<svg class="tooltip__icon-arrow icon" width="13" height="13" xmlns="http://www.w3.org/2000/svg">\r\n                                                            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow-down"></use>\r\n                                                        </svg>\r\n                                                        </p>\r\n                                                        <div class="tooltip__content">\r\n                                                            <p>'+u(typeof(o=null!=(o=c(r,"text")||(null!=t?c(t,"text"):t))?o:s)===l?o.call(a,{name:"text",hash:{},data:n,loc:{start:{line:123,column:63},end:{line:123,column:71}}}):o)+'</p>\r\n                                                            <button class="tooltip__close js-tooltip-close" type="button">close</button>\r\n                                                        </div>\r\n                                                    </li>\r\n'},13:function(e,t,r,i,n){var o,a=null!=t?t:e.nullContext||{},s=e.hooks.helperMissing,l="function",u=e.escapeExpression,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'                                                    <li class="holiday-includes__li">\r\n                                                        <svg class="holiday-includes__icon icon" width="12" height="12" xmlns="http://www.w3.org/2000/svg">\r\n                                                            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#'+u(typeof(o=null!=(o=c(r,"icon")||(null!=t?c(t,"icon"):t))?o:s)===l?o.call(a,{name:"icon",hash:{},data:n,loc:{start:{line:130,column:121},end:{line:130,column:129}}}):o)+'"></use>\r\n                                                        </svg>\r\n                                                        '+u(typeof(o=null!=(o=c(r,"text")||(null!=t?c(t,"text"):t))?o:s)===l?o.call(a,{name:"text",hash:{},data:n,loc:{start:{line:132,column:56},end:{line:132,column:64}}}):o)+"\r\n                                                    </li>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a=e.lambda,s=e.escapeExpression,l=null!=t?t:e.nullContext||{},u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<div class="map-villa-card is-visible" data-id="'+s(a(null!=(o=null!=t?u(t,"marker"):t)?u(o,"id"):o,t))+'">\r\n    <div class="map-villa-card__figure">\r\n        <img class="map-villa-card__image lazyload" data-src="'+s(a(null!=(o=null!=t?u(t,"marker"):t)?u(o,"imageUrl"):o,t))+'" alt="'+s(a(null!=(o=null!=t?u(t,"marker"):t)?u(o,"title"):o,t))+'">\r\n    </div>\r\n    <div class="map-villa-card__header">\r\n        <div class="map-villa-card__title">'+s(a(null!=(o=null!=t?u(t,"marker"):t)?u(o,"title"):o,t))+'</div>
1\r\n        <span class="map-villa-card__subtitle">'+s(a(null!=(o=null!=t?u(t,"marker"):t)?u(o,"locationPath"):o,t))+'</span>\r\n    </div>\r\n\t<div class="map-villa-card__villa-type">\r\n'+(null!=(o=u(r,"if").call(l,null!=(o=null!=t?u(t,"marker"):t)?u(o,"villaGroupId"):o,{name:"if",hash:{},fn:e.program(0,n,0),inverse:e.program(1,n,0),data:n,loc:{start:{line:10,column:2},end:{line:27,column:9}}}))?o:"")+'\t</div>\r\n\t<div class="map-villa-card__content">\r\n'+(null!=(o=u(r,"each").call(l,null!=(o=null!=t?u(t,"marker"):t)?u(o,"dropdowns"):o,{name:"each",hash:{},fn:e.program(2,n,0),inverse:e.noop,data:n,loc:{start:{line:30,column:2},end:{line:144,column:11}}}))?o:"")+'\t\t<div class="map-villa-card__cost">\r\n\t\t\t<div class="map-villa-card__discount center-align">\r\n\t\t\t\t<div class="discount-flag discount-flag--green">\r\n\t\t\t\t\t<div class="discount-flag__heading">'+s(a(null!=(o=null!=(o=null!=t?u(t,"marker"):t)?u(o,"price"):o)?u(o,"discountTitle"):o,t))+'</div>\r\n\t\t\t\t\t<div class="discount-flag__summary">-£'+s(a(null!=(o=null!=(o=null!=t?u(t,"marker"):t)?u(o,"price"):o)?u(o,"discount"):o,t))+'</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class="map-villa-card__price">\r\n\t\t\t\t<div class="map-villa-card__price-row-1">From <span class="map-villa-card__price-value">£'+s(a(null!=(o=null!=(o=null!=t?u(t,"marker"):t)?u(o,"price"):o)?u(o,"priceValue"):o,t))+'</span>pp</div>\r\n\t\t\t\t<div class="map-villa-card__price-row-2">Holiday price from £'+s(a(null!=(o=null!=(o=null!=t?u(t,"marker"):t)?u(o,"price"):o)?u(o,"priceValueTotal"):o,t))+'</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n    <div class="map-villa-card__footer">\r\n        <a class="map-villa-card__footer-cell map-villa-card__footer-cell--view-link js-map-explorer__view-link" data-id="'+s(a(null!=(o=null!=t?u(t,"marker"):t)?u(o,"id"):o,t))+'">\r\n            <svg class="icon icon--pin-blue" xmlns="http://www.w3.org/2000/svg" width="11" height="13">\r\n                <use xlink:href="#icon-pin"></use>\r\n            </svg>\r\n            View on map\r\n        </a>\r\n        <a class="map-villa-card__footer-cell map-villa-card__footer-cell--details-link" href="'+s(a(null!=(o=null!=t?u(t,"marker"):t)?u(o,"url"):o,t))+'" target="_blank">\r\n            Details\r\n            <svg xmlns="http://www.w3.org/2000/svg" class="icon icon--arrow-right" width="5" height="9">\r\n                <use xlink:href="#icon-arrow-right"></use>\r\n            </svg>\r\n        </a>\r\n    </div>\r\n</div>\r\n'},useData:!0})},86970:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({0:function(e,t,r,i,n,o,a){var s,l,u,c=null!=t?t:e.nullContext||{},d=e.hooks.helperMissing,p="function",h=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},f='<div class="sbm-leaving__heading title-m">'+e.escapeExpression(typeof(l=null!=(l=h(r,"year")||(null!=t?h(t,"year"):t))?l:d)===p?l.call(c,{name:"year",hash:{},data:n,loc:{start:{line:2,column:42},end:{line:2,column:50}}}):l)+'</div>\r\n<div class="sbm-leaving__row">\r\n';return l=null!=(l=h(r,"months")||(null!=t?h(t,"months"):t))?l:d,u={name:"months",hash:{},fn:e.program(1,n,0,o,a),inverse:e.noop,data:n,loc:{start:{line:4,column:4},end:{line:11,column:15}}},s=typeof l===p?l.call(c,u):l,h(r,"months")||(s=e.hooks.blockHelperMissing.call(t,s,u)),null!=s&&(f+=s),f+"</div>\r\n"},1:function(e,t,r,i,n,o,a){var s,l=null!=t?t:e.nullContext||{},u=e.hooks.helperMissing,c="function",d=e.escapeExpression,p=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'    <div class="sbm-leaving__cell">    \r\n        <div class="month-box '+d(typeof(s=null!=(s=p(r,"cssClass")||(null!=t?p(t,"cssClass"):t))?s:u)===c?s.call(l,{name:"cssClass",hash:{},data:n,loc:{start:{line:6,column:30},end:{line:6,column:44}}}):s)+'" data-value="'+d(typeof(s=null!=(s=p(r,"value")||(null!=t?p(t,"value"):t))?s:u)===c?s.call(l,{name:"value",hash:{},data:n,loc:{start:{line:6,column:58},end:{line:6,column:69}}}):s)+'">\r\n            <div class="month-box__month">
1'+d(typeof(s=null!=(s=p(r,"name")||(null!=t?p(t,"name"):t))?s:u)===c?s.call(l,{name:"name",hash:{},data:n,loc:{start:{line:7,column:42},end:{line:7,column:52}}}):s)+'</div>\r\n            <div class="month-box__year">'+d(e.lambda(null!=a[1]?p(a[1],"year"):a[1],t))+"</div>\r\n        </div>    \r\n    </div>\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n,o,a){var s,l,u,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return l=null!=(l=c(r,"dates")||(null!=t?c(t,"dates"):t))?l:e.hooks.helperMissing,u={name:"dates",hash:{},fn:e.program(0,n,0,o,a),inverse:e.noop,data:n,loc:{start:{line:1,column:0},end:{line:13,column:10}}},s="function"==typeof l?l.call(null!=t?t:e.nullContext||{},u):l,c(r,"dates")||(s=e.hooks.blockHelperMissing.call(t,s,u)),null!=s?s:""},useData:!0,useDepths:!0})},72090:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({0:function(e,t,r,i,n){return'<div class="sbm-destination__row">\r\n    <div class="sbm-destination__col1">\r\n    </div>            \r\n    <div class="sbm-destination__col2">\r\n    </div>    \r\n</div>\r\n'},compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a,s,l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return a=null!=(a=l(r,"rows")||(null!=t?l(t,"rows"):t))?a:e.hooks.helperMissing,s={name:"rows",hash:{},fn:e.program(0,n,0),inverse:e.noop,data:n,loc:{start:{line:1,column:0},end:{line:8,column:9}}},o="function"==typeof a?a.call(null!=t?t:e.nullContext||{},s):a,l(r,"rows")||(o=e.hooks.blockHelperMissing.call(t,o,s)),null!=o?o:""},useData:!0})},14685:(e,t,r)=>{var i=r(21083);e.exports=(i.default||i).template({0:function(e,t,r,i,n){return'disabled="disabled"'},1:function(e,t,r,i,n){return'selected="selected"'},2:function(e,t,r,i,n){var o,a,s=null!=t?t:e.nullContext||{},l=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t\t<option value="'+e.escapeExpression("function"==typeof(a=null!=(a=l(r,"value")||(null!=t?l(t,"value"):t))?a:e.hooks.helperMissing)?a.call(s,{name:"value",hash:{},data:n,loc:{start:{line:6,column:18},end:{line:6,column:27}}}):a)+'" '+(null!=(o=l(r,"if").call(s,null!=t?l(t,"isSelected"):t,{name:"if",hash:{},fn:e.program(1,n,0),inverse:e.noop,data:n,loc:{start:{line:6,column:29},end:{line:6,column:73}}}))?o:"")+">\r\n"+(null!=(o=l(r,"if").call(s,null!=t?l(t,"isInfant"):t,{name:"if",hash:{},fn:e.program(3,n,0),inverse:e.program(4,n,0),data:n,loc:{start:{line:7,column:16},end:{line:11,column:23}}}))?o:"")+"            </option>\r\n"},3:function(e,t,r,i,n){var o,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"                    "+e.escapeExpression("function"==typeof(o=null!=(o=a(r,"infantLabel")||(null!=t?a(t,"infantLabel"):t))?o:e.hooks.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"infantLabel",hash:{},data:n,loc:{start:{line:8,column:20},end:{line:8,column:35}}}):o)+"\r\n"},4:function(e,t,r,i,n){var o,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return"                    "+e.escapeExpression("function"==typeof(o=null!=(o=a(r,"value")||(null!=t?a(t,"value"):t))?o:e.hooks.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"value",hash:{},data:n,loc:{start:{line:10,column:20},end:{line:10,column:29}}}):o)+"\r\n"},compiler:[8,">= 4.3.0"],main:function(e,t,r,i,n){var o,a,s,l=null!=t?t:e.nullContext||{},u=e.hooks.helperMissing,c="function",d=e.escapeExpression,p=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},h='<div class="sbm-guests-child-box">'+d(typeof(a=null!=(a=p(r,"childLabel")||(null!=t?p(t,"childLabel"):t))?a:u)===c?a.call(l,{name:"childLabel",hash:{},data:n,loc:{start:{line:1,column:34},end:{line:1,column:48}}}):a)+" <span>"+d(typeof(a=null!=(a=p(r,"value")||(null!=t?p(t,"value"):t))?a:u)===c?a.call(l,{name:"value",hash:{},data:n,loc:{start:{line:1,column:55},end:{line:1,column:64}}}):a)+'</span>\r\n\t<div class="form-select form-select--light form-select--bordered">\r\n\t\t<select class="form-select__origin js-child-age-selected">\r\n\t\t\t<option value="0" '+(null!=(o=p(r,"unless").call(l,null!=t?p(t,"defaultChildAgeDefined"):t,{name:"unless",hash:{},fn:e.program(0,n,0),inverse:e.noop,data:n,loc:{start:{line:4,column:21},end:{line:4,column:85}}}))?o:"")+" "+(null!=(o=p(r,"unless").call(l,null!=t?p(t,"defaultChildAgeDefined"):t,{name:"unless",hash:{},fn:e.program(1,n,0),inverse:e.noop,data:n,loc:{start:{line:4,column:86},end:{line:4,column:150}}}))?o:"")+' style="display:none;">'+d(typeof(a=null!=(a=p(r,"ageLabel")||(null!=t?p(t,"ageLabel"):t))?a:u)===c?a.call(l,{name:"ageLabel",hash:{},data:n,loc:{start:{line:4,column:173},end:{line:4,column:185}}}):a)+"</option>\r\n";return a=null!=(a=p(r,"childAges")||(null!=t?p(t,"childAges"):t))?a:u,s={name:"childAges",hash:{},fn:e.program(2,n,0),inverse:e.noop,data:n,loc:{start:{line:5,column:8},end:{line:13,column:22}}},o=typeof a===c?a.call(l,s):a,p(r,"childAges")||(o=e.hooks.blockHelperMissing.call(t,o,s)),null!=o&&(h+=o),h+"\t\t</select>\r\n\t</div>\r\n</div>"},useData:!0}
1)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.