1(self.webpackChunklib=self.webpackChunklib||[]).push([[4143],{4143:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>v});var a=i(9755);var s=new class{constructor(){this.cache={},this.init()}init(){this.initializeCache()}initializeCache(){this.cache.body=a("body"),this.cache.loader=a(".js-loader")}showLoader(){this.cache.body.addClass("is-disabled-scroll"),this.cache.loader.css("display","flex")}hideLoader(){this.cache.body.removeClass("is-disabled-scroll"),this.cache.loader.css("display","none")}},l=travel.options.availableParams.use===String(1),r={wasSent:!1};const n=t=>{var e,i,a,s,n,o,d;null!==(e=travel.events)&&void 0!==e&&e.kpi||console.error("Failed to send event: [check-avail|avail|not-avail]"),l&&!r.wasSent&&(null===(i=travel.events)||void 0===i||null===(a=i.kpi)||void 0===a||a.send("check-avail"),null!=t&&(t>0&&(null===(s=travel.events)||void 0===s||null===(n=s.kpi)||void 0===n||n.send("avail")),0===t&&(null===(o=travel.events)||void 0===o||null===(d=o.kpi)||void 0===d||d.send("not-avail")),r.wasSent=!0))};var o=i(9785),d=i(9755);function h(t,e,i,a,s,l,r){try{var n=t[l](r),o=n.value}catch(t){return void i(t)}n.done?e(o):Promise.resolve(o).then(a,s)}function c(t){return function(){var e=this,i=arguments;return new Promise((function(a,s){var l=t.apply(e,i);function r(t){h(l,a,s,r,n,"next",t)}function n(t){h(l,a,s,r,n,"throw",t)}r(void 0)}))}}class v{constructor(t){this.options=t||{},this.cache={},this.init()}init(){this.initializeCache(),this.initializeEvents()}initializeCache(){this.cache.filtersForm=".js-hotel-list-filters",this.cache.destinationMap=null,this.cache.isMapReady=!1}initializeEvents(){var t=travel.options;"hotel_list"!==t.page&&"map"!==t.page||1!=+t.availableParams.use||!t.cityID||this.initAvail(),this.initHistory(),"map"===t.page&&(this.loadListMap(),this.initMap())}availCityRequest(t,e,i){var a=this.searchParamsInUrl("jid");if(a)return this.availCityGet(a),!1;var l=d.extend(e,{page:"search",dest_id:t,lang:i,t:1,r:Math.random(),ui:travel.options.uuid});d.ajax({type:"GET",url:"/check/",data:l,dataType:"json",success:a=>{var l=a.jid,r=a.bot;""!=l?this.availCityGet(l):""!=r?(d("#bot").val(1),this.availCityResult()):a.bad_id?(s.hideLoader(),window.scrollTo(0,0),alert("Can't process request")):a.error?(s.hideLoader(),window.scrollTo(0,0)):setTimeout((()=>{this.availCityRequest(t,e,i)}),3e3)},error:(a,s,l)=>{(0,o.O)("AvailError (avcity1)",s),setTimeout((()=>{this.availCityRequest(t,e,i)}),3e3)}})}availCityGet(t){d.ajax({type:"GET",url:"/check/",data:{page:"search",jid:t,t:1,r:Math.random(),ui:travel.options.uuid},dataType:"json",success:e=>{console.info("response",e),e.done?("yes"===e.finished&&n(e.count),this.availCityResult()):e.bad_id?(s.hideLoader(),window.scrollTo(0,0),alert("Can't process request")):setTimeout((()=>{this.availCityGet(t)}),3e3)},error:(e,i,a)=>{(0,o.O)("AvailError (avcity2)",i),setTimeout((()=>{this.availCityGet(t)}),3e3)}})}availCityResult(){this.loadList()}loadListMap(){var t=d(this.cache.filtersForm),e=t.serialize(),a=t.attr("action")+"?"+e;a=a.replace("/search/","/map/"),d.ajax({url:a+"&use_avail="+travel.options.availableParams.use+"&ui="+travel.options.uuid,type:"GET"}).done((t=>{var e=d(t);if(d(".js-need-avail",e).length)this.initAvail();else{var a=d(".js-hotel-list-filters",e),l=d(".js-hotels",e),r=a.html(),n=l.text();this.updateMapList(n),d(".js-hotel-list-filters").html(r),i.e(3262).then(i.bind(i,3262)).then((t=>{var{default:e}=t;new e})),travel.isMobile()&&this.hideFiltersOnMobile(),d(".js-filters-wrap").hide(0),setTimeout((()=>{s.hideLoader()}),100)}})).fail((t=>{travel.log("error",t),setTimeout((()=>{this.loadList()}),2e3)}))}updateMapList(t){this.cache.isMapReady?(travel.log("updateMapList2"),this.updateMapListReal(t)):d(document).on("destmap-ready",(()=>{travel.log("updateMapList1"),this.updateMapListReal(t)}))}updateMapListReal(t){return c((function*(){for(var e=d.parseJSON(t),a=[],s=[],l=0;l<e.length;++l){var r=e[l];0!==r.lat||0!==r.lng?(a[r.id]=r,s.push(r.id)):travel.log("skip",r)}yield Promise.all([i.e(1322),i.e(4580)]).then(i.bind(i,4580)).then((t=>{var{mapObject:e}=t;e.clearAll(),e.cache.hotels.list=a,e.cache.hotels.cids=s,e.updateMarkers(),e.fitView()}))}))()}loadList(){"hotel_list"===travel.options.page?this.loadListHotels():"map"===travel.options.page&&this.loadListMap()}loadListHotels(){var t=d(this.cache.filtersForm),e=t.serialize(),i=t.attr("action")+"?"+e;d.ajax({url:i+"&use_avail="+travel.options.availableParams.use+"&r="+Math.random()+"&ui="+travel.options.uuid,type:"GET"}).done((e=>{var a=d(e);if(d(".js-need-avail",a).length)this.initAvail();else{var l=d(".js-content",a),r=d("h1",a),n=l.html(),o=r.html();this.updateHistory(i,{content:n,title:o}),"destination"===travel.options.typeObject&&this.updateLangCurLinks(t.attr("action"));var h=d(".js-content");
1h.html(n),o&&(document.title=o),this.reInitHotellist(h),travel.isMobile()&&this.hideFiltersOnMobile(),setTimeout((()=>{s.hideLoader()}),100),d(window).width()<992&&d("body, html").animate({scrollTop:d(".js-hotellist-hotels",h).offset().top},800)}})).fail((t=>{travel.log("error",t),setTimeout((()=>{this.loadList()}),2e3)}))}hideFiltersOnMobile(){d(".js-hotel-list-filters .js-filter-toggle").each((function(){d(this).find(".js-filter-toggle-title").removeClass("active"),d(this).find(".js-another-toggle-content").hide()}))}searchParamsInUrl(t){var e=window.location.search,i=e.indexOf(t);if(-1===i)return!1;var a=e.substr(i).indexOf("&"),s=(-1!==a?e.substr(i,a):e.substr(i)).split("=")[1];return!(!s||""===s)&&("/"===s.slice(-1)&&(s=s.slice(0,-1)),s)}initAvail(){var t=travel.options;s.showLoader(),this.availCityRequest(t.cityID,t.availableParams,t.languageId)}updateHistory(t,e){window.history&&window.history.replaceState&&window.history.replaceState(e,"",t)}updateLangCurLinks(t){d("#currency-dropdown-menu .js-link-item, #language-dropdown-menu .js-link-item").map(((e,i)=>{var a=d(i);if(a.attr("data-link-item")){var s=atob(a.attr("data-link-item"));-1===s.indexOf(t)&&(s=s.replace("/search/",t),s=btoa(s),a.attr("data-link-item",s))}}))}initHistory(){if(!window.history||!window.history.pushState)return!1;window.onpopstate=t=>{t.state&&(d(".js.filters-cont").html(t.state.filters),d(".js-hotellist-hotels").html(t.state.hotels),t.state.title&&(document.title=t.state.title))}}reInitHotellist(t){return c((function*(){yield i.e(3524).then(i.bind(i,3524)).then((t=>{var{modals:e}=t;e.init()})),yield i.e(7863).then(i.bind(i,7863)).then((e=>{var{calendarRunner:i}
1=e;i.init(t)})),yield i.e(9532).then(i.bind(i,9532)).then((t=>{var{default:e}=t;new e})),yield i.e(3262).then(i.bind(i,3262)).then((t=>{var{default:e}=t;new e}))}))()}initMap(){var t=this;return c((function*(){yield Promise.all([i.e(1322),i.e(4580)]).then(i.bind(i,4580)).then((e=>{var{mapObject:i}=e;i.run(),i.initializeEvents(),i.updateMarkers(),i.fitView(),t.cache.destinationMap=i})),t.cache.isMapReady=!0,d(document).trigger("destmap-ready")}))()}}}}]);
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.