(self.webpackChunklib=self.webpackChunklib||[]).push([[7714],{7714:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Rooms:()=>d});var o=a(3494),r=a(9755);function s(e,t,a,o,r,s,i){try{var l=e[s](i),n=l.value}catch(e){return void a(e)}l.done?t(n):Promise.resolve(n).then(o,r)}function i(e){return function(){var t=this,a=arguments;return new Promise((function(o,r){var i=e.apply(t,a);function l(e){s(i,o,r,l,n,"next",e)}function n(e){s(i,o,r,l,n,"throw",e)}l(void 0)}))}}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function n(e){for(var t=1;t4&&void 0!==arguments[4]?arguments[4]:{},l=travel.options,c=e;a&&(c+=", text: "+a),o&&(c+=", error: "+o),t&&(void 0!==t.status&&(c+=", status: "+t.status),void 0!==t.statusText&&(c+=", statustext: "+t.statusText),void 0!==t.responseText&&(c+=", response: "+t.responseText));try{var h=n(n({},{error_source_url:window.location.href,error_data:null,error_url:null}),i);s=JSON.stringify(h)}catch(e){s="Error. Fail to generate additional_data."}s&&(c+=", additional_data: ".concat(btoa(s))),r.ajax({method:"post",url:"/",data:{page:"stat",id:l.logId,t:"ev",c:"Error",a:c,r:Math.floor(1e5*Math.random()),w:travel.options.logId}})}xhrStop(){this.xhr&&(this.xhr.abort(),this.xhr=null)}checkAvail(e){this.params=e;var t=this.cache.roomsContent.empty();this.cache.vLoaderProcess.show();var a=travel.isTablet()?20:96;r("html, body").animate({scrollTop:r("#detail-content-sticky-nav-05").offset().top-a},800),this.avHotelReq(e,t)}getAvailMappedParams(e){var t={dataFrom:"from",dataTo:"to",guestsAdults:"adults",guestsChildren:"children"};if((e=e||{}).guestsChildren)for(var a=1;a<=e.guestsChildren;a++)t["guestsChildAge"+a]="childAge"+a;var o={};return r.each(e,((e,a)=>{var r=t[e]||e;o[r]=a})),o}loadRooms(){if(this.isLoaded)return!1;var e=this,t=travel.options;if("hotel"===t.typeObject){if(!r(".js-err-dates-limit").length)if(0!==parseInt(t.availableParams.use||0))setTimeout((function(){var a=e.getAvailMappedParams(t.availableParams);e.checkAvail(a)}),500);else{var a={adults:t.availableParams.guestsAdults};e.cache.vLoaderProcess.show(),e.getRoomsWoDates(a)}this.isLoaded=!0}}getRoomsWoDates(e){var t=this,a=travel.options;this.xhrStop(),this.xhr=r.ajax({type:"GET",url:"/check_avail.php",data:r.extend({page:"rooms",hotel_id:a.objectId,from:"",to:"",currency:a.currencyId||1,lang_id:a.languageId,use_dates:0,r:Math.random(),w:travel.options.logId},e||{}),success:function(a){if(a.length<16)setTimeout((function(){t.getRoomsWoDates(e)}),3e3);else{var o=t.cache.roomsContent;o.html(a),t.initRoomsScripts(o),t.cache.vLoaderProcess.hide(),t.initCalendar()}},error:function(){setTimeout((function(){t.getRoomsWoDates(e)}),3e3)}})}avHotelReq(e,t,a){var o=this,s=travel.options;999===(a=a||0)&&(a=0),0===a&&r.ajax({type:"GET",url:"/check_avail.php",data:{page:"check",w:travel.options.logId},dataType:"xml",success:function(e){},error:function(e,t,a){o.ajaxErrorCallback("AvailErrorCheck (xml)",e,t,a)}}),this.xhrStop(),this.xhr=r.ajax({type:"GET",url:"/check/",data:r.extend({page:"search",hotel_id:s.objectId,lang:s.languageId,t:2,r:Math.random(),cnt:a,w:travel.options.logId},e),dataType:"json",success:function(a){var r=a.jid||"";""!==r?o.avHotelGet(r,t):a.bad_id?o.cache.vLoaderProcess.hide():a.bot||a.error?o.avHotelResult(r,t):setTimeout((function(){o.avHotelReq(e,t,999)}),3e3)},error:function(r,s,i){o.ajaxErrorCallback("AvailError (json)",r,s,i),setTimeout((function(){o.avHotelReq(e,t,a+1)}),3e3)}})}avHotelGet(e,t){var a=this;this.xhrStop(),this.xhr=r.ajax({type:"GET",url:"/check/",data:{page:"search",jid:e,t:2,r:Math.random(),w:travel.options.logId},dataType:"json",success:function(o){o.done||o.bot||o.error?a.avHotelResult(e,t):o.bad_id?a.cache.vLoaderProcess.hide():(o.progress,setTimeout((function(){a.avHotelGet(e,t)}),1e3))},error:function(o,r,s){a.ajaxErrorCallback("AvailError (avhotel)",o,r,s),setTimeout((function(){a.avHotelGet(e,t)}),3e3)}})}hotelListReq(){var e=this,t=travel.options,a={};if(t.availableParams.guestsChildren)for(var o=t.availableParams.guestsChildren,s=1;s<=o;s++){var i="childAge"+s,l=t.availableParams["guestsChildAge".concat(s)];a[i]=l||null}r.ajax({type:"GET",url:"/check/",data:n(n({page:"search",from:t.availableParams.dataFrom,to:t.availableParams.dataTo,adults:t.availableParams.guestsAdults,children:t.availableParams.guestsChildren||null},a),{},{dest_id:t.hotelDestinationId,lang:t.languageId,t:1,use:1,r:Math.random(),w:travel.options.logId}),dataType:"json",success:function(a){setTimeout((function(){e.cache.vLoaderProcessHotelNearby.show()}),500);var o=r(".js-hotel-list-redirect").attr("href");a.jid&&(o+="&jid="+a.jid),setTimeout((function(){"book"!==t.page&&(r.cookie("redirect","1"),window.location.href=o)}),2e3)},error:function(e,t,a){}})}avHotelResult(e,t){var a=this,o=travel.options;this.xhrStop(),this.xhr=r.ajax({type:"GET",url:"/check/",data:{page:"search_list",h:o.objectId,lang:o.languageId,currency:o.currencyId,jid:e,t:2,r:Math.random(),w:travel.options.logId},dataType:"html"}).done((function(e){t.html(e),a.initRoomsScripts(t),a.cache.vLoaderProcess.hide(),"1"===r.cookie("redirect")||r.cookie("click-price-calendar")||(r(".js-show-calendar:not(.js-show-fixed-btn)").hide(),-1!==e.search("unavailable")&&a.hotelListReq()),a.cache.vLoaderProcess.hide(),a.initCalendar(),a.emit("rates-added")})).fail((function(){setTimeout((function(){a.avHotelResult(e,t)}),3e3)}))}altHotelReq(e){var t=this,a=travel.options;this.xhrStop(),this.cache.vLoaderProcessHotelNearby.show(),this.xhr=r.ajax({type:"GET",url:"/check/",data:r.extend({page:"search_alt",hotel_id:a.objectId,lang:a.languageId,t:1,r:Math.random(),w:travel.options.logId},this.params),dataType:"json",success:function(a){var o=a.jid||"";""!==o?t.altHotelGet(o,e):a.bad_id?t.cache.vLoaderProcessHotelNearby.hide():a.bot||a.error||a.no_hotels?t.altHotelResult(o,e):setTimeout((function(){t.altHotelReq(e)}),3e3)},error:function(a,o,r){t.ajaxErrorCallback("AvailError (althotel)",a,o,r),setTimeout((function(){t.altHotelReq(e)}),3e3)}})}altHotelGet(e,t){var a=this;this.xhrStop(),this.xhr=r.ajax({type:"GET",url:"/check/",data:{page:"search_alt",jid:e,t:1,r:Math.random(),w:travel.options.logId},dataType:"json",success:function(o){o.done||o.bot||o.error||o.no_hotels?(a.cache.vLoaderProcessHotelNearby.show(),a.altHotelResult(e,t)):o.bad_id?a.cache.vLoaderProcessHotelNearby.hide():(o.progress&&a.cache.vLoaderProcessHotelNearby.show(),setTimeout((function(){a.altHotelGet(e,t)}),3e3))},error:function(o,r,s){a.ajaxErrorCallback("AvailError (althotel2)",o,r,s),setTimeout((function(){a.altHotelGet(e,t)}),3e3)}})}altHotelResult(e,t){var a=this,o=travel.options;this.xhrStop(),this.xhr=r.get("/check/",{page:"search_list",hotel_id:o.objectId,lang:o.languageId,currency:o.currencyId,d:o.hotelDestinationId||"",na:1,jid:e,t:1,r:Math.random(),w:travel.options.logId},(function(e){t.html(e),a.cache.vLoaderProcessHotelNearby.hide()})).fail((function(){setTimeout((function(){a.altHotelResult(e,t)}),3e3)}))}initRoomsScripts(e){var t=e[0].querySelectorAll(".js-room-gallery");t.length&&this.initGalleries(t),this.showMoreRates(),this.initDetailsHint(),travel.isMobile()&&(this.showMoreGuestInfoOnMobile(),this.hideRoomAmenities(),this.changeTooptilWidthOnMobile())}changeTooptilWidthOnMobile(){var e=".js-rate-tooltip-desc";r("body").on("click",".js-tooltip-title",(function(){var t=r(this).closest(".js-rate-item").width(),a=r(this).find(".js-rate-tooltip").position().left;r(this).find(e).css("width","".concat(t-20,"px")),r(this).find(e).css("left","-".concat(a+3,"px"))}))}initDetailsHint(){var e=r(".js-hint-btn"),t=r(".js-hint-close"),a=r(".js-rate-details"),o=r(".js-hint-block");this.cache.HTML.hasClass("is-notouch")?a.each(((e,t)=>{r(t).on("mouseenter",(e=>{r(e.currentTarget).find(o).stop().fadeIn()})),r(t).on("mouseleave",(e=>{r(e.currentTarget).find(o).fadeOut()}))})):(e.each(((e,t)=>{r(t).on("click",(e=>{var t=r(e.currentTarget).closest(a).find(o),s=a.find(o).not(t);t.is(":visible")?t.hide():(s.hide(),t.show(),travel.isSmallMobile()&&this.cache.BODY.addClass("is-disable-scroll"))}))})),this.cache.BODY.on("click",(e=>{0==r(e.target).closest(a).length&&(o.hide(),travel.isSmallMobile()&&this.cache.BODY.removeClass("is-disable-scroll"))})),t.on("click",(e=>{r(e.currentTarget).closest(a).find(o).hide(),travel.isSmallMobile()&&this.cache.BODY.removeClass("is-disable-scroll")})))}showMoreRates(){r(".js-toggle-rates").on("click",(function(e){var t=r(e.currentTarget);t.closest(".js-rate-container").find(".js-rate-hidden").toggleClass("is-hidden"),t.toggleClass("is-active")}))}hideRoomAmenities(){r(this.cache.wrapper).each(((e,t)=>{var a=r(t);a.hasClass("ís-close")||a.addClass("is-close")})),r("body").on("click",".js-amenity-title",(function(){r(this).closest(".js-amenity-item").toggleClass("is-open-amenity")}))}showMoreGuestInfoOnMobile(){var e=r(".js-rate-item");r("body").on("click",".js-show-more-guest-info",(function(){r(this).closest(e).toggleClass("is-show-guest-info")}))}initGalleries(e){return i((function*(){if(e.length){var{default:t}=yield Promise.all([a.e(9843),a.e(8238)]).then(a.bind(a,8238));e.forEach((e=>{t({container:e,place:"rooms"})}))}}))()}initCalendar(){return i((function*(){var{CalendarRunner:e}=yield a.e(454).then(a.bind(a,454));e.initCalendar()}))()}}var d=new h},3494:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});class o{constructor(){var e;this.emiter={all:e=e||new Map,on:function(t,a){var o=e.get(t);o?o.push(a):e.set(t,[a])},off:function(t,a){var o=e.get(t);o&&(a?o.splice(o.indexOf(a)>>>0,1):e.set(t,[]))},emit:function(t,a){var o=e.get(t);o&&o.slice().map((function(e){e(a)})),(o=e.get("*"))&&o.slice().map((function(e){e(t,a)}))}}}emit(e,t){this.emiter.emit(e,t)}on(e,t){this.emiter.on(e,t)}off(e,t){this.emiter.off(e,t)}}}}]);