(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{90:function(t,e,i){"use strict";i.r(e);var a=i(0),o=i(7),n=i(5),r=i.n(n);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,(o=a.key,n=void 0,n=function(t,e){if("object"!==l(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!==l(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===l(n)?n:String(n)),a)}var o,n}var d=null,c=function(){function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),d||(d=this),this.CivAPP=e,this.first=!0,window.isGuidesCarouselInit=!1,d}var e,i,o;return e=t,(i=[{key:"initTransfersHeader",value:function(){if($("#o-header__carousel").length){var t={items:1,nav:!0,loop:!0,animateOut:"fadeOut",animateIn:"fadeIn",mouseDrag:!1,touchDrag:!1,onInitialized:function(){$("#o-header__carousel").addClass("js-initialized")}};$("#o-header__carousel").owlCarousel(t)}}},{key:"prepareActivityPrint",value:function(){var t=a.a.$(".o-slider--image-detail .owl-carousel").find(".owl-item.active"),e=t.find(".b-lazy"),i=t.next().find(".b-lazy");this.CivAPP.BlazyController.loadElement(e,!0),this.CivAPP.BlazyController.loadElement(i,!0)}},{key:"initActivityDetail",value:function(){var t=this,e=a.a.isMobile(),i=e?$("#new-slider-container_mobile"):$("#new-slider-container"),o=e?1:2;if(0!==a.a.$(".o-slider--image-detail").length){if(0!==i.length){var n=$(".o-slider--image-detail .owl-carousel"),r=$('<div id="bGallery" class="new-slider-activity-detail owl-carousel">'),l=n.find(".swiper-slide").clone().slice(0,6),s=n.find(".swiper-slide").length,d=s+window.activityData.reviewImages,c=!e&&s>2;r.append(l),r.children().each((function(t){$(this).attr("data-position",t)})),i.append(r);var u={nav:!0,video:!0,loop:c,items:o,responsive:!1,touchDrag:!0,mouseDrag:!1};r.owlCarousel(u).on("changed.owl.carousel",(function(e){if(e.item){var i=e.item.index-2,a=e.item.count;1===i?$(".owl-prev").addClass("disabled"):$(".owl-prev").removeClass("disabled"),i===a-1?($(".owl-next").addClass("disabled"),$(".owl-nav span").removeClass("disabled")):($(".owl-next").removeClass("disabled"),$(".owl-nav span").addClass("disabled"))}setTimeout((function(){t.CivAPP.refreshBlazy()}),150)}));var f=$("#js-activity-price-wrapper").find(".o-activity-header__rating").clone();if(f.find(".o-rating--header__top").remove(),r.append(f),d>6||window.activityData.reviewImages>0){var h="".concat(a.a.tr("seeMorePhotos")," (").concat(d,")");e?l.last().append('<span id="view-more-img">'.concat(h,"</span>")):$(".owl-nav").append('<span id="view-more-img" class="disabled">'.concat(h,"</span>"))}return void $(".owl-prev").addClass("disabled")}var m=new Waypoint.Inview({element:document.getElementById("o-slider--image-detail"),enter:function(e){m.options.enter=Function.prototype,m.destroy();var i=$(".o-slider--image-detail .owl-carousel"),a=$(".o-slider--thumbs .owl-carousel");if($(".o-slider--image-detail .swiper-slide").length<=1)return $(".o-slider--thumbs").hide(),$(".swiper-button-prev").hide(),$(".swiper-button-next").hide(),$(".o-slider--image-detail").addClass("o-slider--image-detail--one"),i.removeClass("owl-carousel"),void t.CivAPP.refreshBlazy();i.children().each((function(t){$(this).attr("data-position",t)}));var o={video:!0,loop:!0,items:1,nav:!0,onTranslated:function(e){t.CivAPP.refreshBlazy(),i.find(".owl-item").eq(e.item.index).find(".owl-video-play-icon").trigger("click")},onInitialize:function(){window.setTimeout((function(){i.trigger("refresh.owl.carousel"),t.CivAPP.refreshBlazy()}),500)}};i.owlCarousel(o).on("changed.owl.carousel",(function(e){t.syncedSecondary=!1;var i=e.page.index;a.find(".owl-item").find(".swiper-slide").removeClass("is-active"),a.find(".owl-item").eq(i).find(".swiper-slide").addClass("is-active");var o=a.find(".owl-item.active").length-1,n=a.find(".owl-item.active").first().index();i>a.find(".owl-item.active").last().index()&&a.data("owl.carousel").to(i,100,!0),i<n&&a.data("owl.carousel").to(i-o,100,!0),window.setTimeout((function(){t.syncedSecondary=!0}),200)}));var n="function"==typeof window.onbeforeprint?window.onbeforeprint:Function.prototype;window.onbeforeprint=function(){t.prepareActivityPrint(),n()},t.initActivityThumbs(),$(".o-slider__video-trigger").on("click",(function(t){t.preventDefault();var e=$("#".concat($(this).data("target"))),i=$(e).closest(".owl-item").index(),a=$(e).closest(".owl-carousel").data("owl.carousel");a.to(a.relative(i))}))}})}else if(0!==a.a.$(".o-activity-photos-optimized > .carousel-optimized").length){var v=document.getElementById("images-carousel-optimized"),y=document.querySelector("#js-activity-price-wrapper .o-activity-header__rating");if(null!=y&&!y.classList.contains("no-opinion")){var g=y.cloneNode(!0),w=g.querySelector(".o-rating--header__top");null!=w&&w.remove(),v.appendChild(g)}if("undefined"==typeof newImageLayout||e){var p=v.querySelector(".__slides"),b=v.querySelectorAll(".__slide")[0],C=v.querySelectorAll(".__slide._show"),_=(v.querySelectorAll(".__slide._clone"),v.querySelectorAll(".__slide._clone._prev")),A=(v.querySelectorAll(".__slide._clone._next"),v.querySelector(".__nav .__arrows .__prev")),P=v.querySelector(".__nav .__arrows .__next"),S=v.querySelectorAll(".__dots .__dot"),T=b.offsetWidth,k=0,z=0,x=0;null!==A&&A.addEventListener("click",(function(){return I("backward")})),null!==P&&P.addEventListener("click",(function(){return I("forward")})),S.forEach((function(t,e){t.addEventListener("click",(function(){return I(e)}))})),document.addEventListener("keydown",(function(t){"ArrowLeft"===t.code?I("backward"):"ArrowRight"===t.code&&I("forward")})),window.addEventListener("resize",(function(){T=b.offsetWidth,I(z)}));var I=function(t){var e=function(t){var e,i,o=a.a.isMobile()?0:6,n=C.length;if("forward"===t){var r=z+1;r<=n?(e=(r+x)*(T+o),i=r):(e=k,i=z)}else if("backward"===t){var l=z-1;l>=0?(e=(l+x)*(T+o),i=l):(e=k,i=z)}else"number"==typeof t&&(e=(z+x)*(T+o),i=t);return{left:e,slide:i}}(t),i=e.left,o=e.slide;p.scrollLeft=i,b.style.marginLeft=-1*i+"px",k=i,z=o};null!=_&&_.length>0&&(x=_.length,I(0));var F=new IntersectionObserver((function(e,i){e.forEach((function(e){if(e.isIntersecting){var i=a.a.isMobile()?0:6,o=e.target.dataset.slideindex,n=v.querySelector(".__dots .__dot._active"),r=S[o];null!=n&&n.classList.remove("_active"),null!=r&&r.classList.add("_active"),null!==A&&(k==x*(T+i)?A.classList.add("_disabled"):A.classList.remove("_disabled")),null!==P&&(o>=C.length-1?P.classList.add("_disabled"):P.classList.remove("_disabled"))}t.CivAPP.refreshBlazy()}))}),{root:p,threshold:.1});v.querySelectorAll(".__slide").forEach((function(t){F.observe(t)}))}}}},{key:"initActivityThumbs",value:function(){if(0!==a.a.$(".o-slider--image-detail").length){var t=this,e=(t.sliderCounter,a.a.$(".o-slider--thumbs .swiper-wrapper")),i=e.find(".owl-stage"),o=a.a.$(".o-slider--image-detail .swiper-wrapper"),n=($('<div class="owl-item traveler-thumb">Fotos de viajeros</div>'),window.activityData.reviewImages,function(o){if(a.a.isMobile())return!1;0===i.length&&(i=e.find(".owl-stage")),o=void 0!==o?o:500,i.addClass("is-loading"),window.setTimeout((function(){e.trigger("refresh.owl.carousel"),t.fixCarouselWidth(e),i.removeClass("is-loading")}),o)});window.fix=n,e.on("initialized.owl.carousel",(function(){e.find(".owl-item").eq(0).find(".swiper-slide").addClass("is-active")})).owlCarousel({autoWidth:!0,smartSpeed:200,slideSpeed:500,slideBy:1,responsiveRefreshRate:100,onInitialized:function(){var i=new Waypoint({element:e[0],handler:function(t){"down"===t&&(n(),a.destroy(),this.destroy())},offset:"100%"}),a=new Waypoint({element:e[0],handler:function(t){"up"===t&&(n(),i.destroy(),this.destroy())}});t.CivAPP.refreshBlazy(),n(),$(window).load(n)}}),e.on("click",".owl-item",(function(t){t.preventDefault();var e=$(this).index();o.data("owl.carousel").to(e,300,!0)})),$(window).on("resize",r()((function(){n(250)}),250))}}},{key:"initSuggestedActivities",value:function(){var t=$(".o-cart-suggested-activities._new .__list.owl-carousel");t.length&&t.owlCarousel({items:2,slideBy:2,autoWidth:!1,loop:!1,stagePadding:50,margin:15,responsive:{480:{stagePadding:65,margin:20},768:{items:3,stagePadding:0}}})}},{key:"initSuggestedActivitiesFull",value:function(){var t=this,e=$(".o-cart-suggested-activities.--full:not(._new) .__list.owl-carousel");e.length&&e.owlCarousel({items:2,slideBy:2,autoWidth:!1,loop:!1,stagePadding:50,margin:15,responsive:{480:{stagePadding:65,margin:20},768:{items:3,stagePadding:0},1024:{items:4,stagePadding:0},1300:{autoWidth:!0,items:5,stagePadding:0}}}).on("translated.owl.carousel",(function(){t.CivAPP.refreshBlazy()})).on("initialize.owl.carousel",(function(){t.fixCarouselWidth(e),window.setTimeout((function(){e.trigger("refresh.owl.carousel"),t.CivAPP.refreshBlazy()}),500)})).on("refreshed.owl.carousel",(function(){t.fixCarouselWidth(e)}))}},{key:"fixCarouselWidth",value:function(t){var e=t.find(".owl-stage"),i=t.find(".owl-item"),o=0,n=a.a.isFirefox()?5:1;a.a.isIphone()&&(n+=2),i.each((function(t){var e=parseFloat($(this).css("margin-right").slice(0,-2)),i=2*parseFloat($(this).css("border-right-width").slice(0,-2));o+=$(this).width()+e+i})),e.css("width",o+n+"px"),e.css("min-width",o+n+"px"),this.CivAPP.refreshBlazy(),e.removeClass("is-loading")}},{key:"initGuides",value:function(){if(!window.isGuidesCarouselInit){window.isGuidesCarouselInit=!0;var t,e,i=this,a=$(".o-slider--guides");if(0!==a.length){if(e=a.find(".swiper-slide"),t=a.find(".owl-carousel"),e.length<2)return a.addClass("js-disabled"),!1;e.length<=4&&a.addClass("js-disabled-large");var o=new Waypoint.Inview({element:t,enter:function(e){o.destroy(),t.owlCarousel({autoWidth:!0,margin:20,responsive:{0:{items:1},768:{autoWidth:!1,stagePadding:0,items:4,slideBy:4}},onTranslated:function(){i.CivAPP.refreshBlazy()},onInitialize:function(){window.setTimeout((function(){var e=0,a=t.find(".owl-stage");a.find(".owl-item").each((function(){e+=$(this).width()+20})),a.width(e+1),i.CivAPP.refreshBlazy()}),500)}})}})}}}},{key:"initJobCarousel",value:function(){var t=this,e=$(".o-job-carousel");if(e.length){var i={items:1,slideBy:1,loop:!0,nav:!0,dots:!1,autoplay:!0,autoplayTimeout:5e3,autoplayHoverPause:!0,responsive:{768:{items:3,stagePadding:0,autoWidth:!0,center:!0}},onTranslated:function(e){t.CivAPP.refreshBlazy()},onInitialize:function(){t.fixCarouselWidth(e),window.setTimeout((function(){e.trigger("refresh.owl.carousel"),t.CivAPP.refreshBlazy()}),500)},onInitialized:function(t){e.find(".owl-prev, .owl-next").wrapAll($('<div class="row"></div>'))},onRefreshed:function(){t.fixCarouselWidth(e)}};e.owlCarousel(i)}}},{key:"initTestimonials",value:function(){var t=this,e=$(".o-affiliate-testimonials");if(e.length){var i={items:1,nav:!0,dots:!1,onTranslated:function(e){t.CivAPP.refreshBlazy()},onInitialize:function(){t.fixCarouselWidth(e),window.setTimeout((function(){e.trigger("refresh.owl.carousel"),t.CivAPP.refreshBlazy()}),500)},onInitialized:function(t){e.find(".owl-prev, .owl-next").wrapAll($('<div class="row"></div>'))},onRefreshed:function(){t.fixCarouselWidth(e)}};e.owlCarousel(i)}}},{key:"initPressCarousel",value:function(){var t=this,e=$(".o-press-carousel");if(e.length){var i={items:1,nav:!1,dots:!0,onTranslated:function(e){t.CivAPP.refreshBlazy()},onInitialize:function(){t.fixCarouselWidth(e),window.setTimeout((function(){e.trigger("refresh.owl.carousel"),t.CivAPP.refreshBlazy()}),500)},onRefreshed:function(){t.fixCarouselWidth(e)}};e.owlCarousel(i)}}}])&&s(e.prototype,i),o&&s(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return h(t,e)}(t)||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 h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}function m(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,(o=a.key,n=void 0,n=function(t,e){if("object"!==u(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!==u(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===u(n)?n:String(n)),a)}var o,n}var v=null,y=function(){function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),v||(v=this),this.CivAPP=e,this.init=this.init.bind(this),this.activityFlag=!1,this.duration=300,this.galleries={},this.gallerieSyncs={},this.roundedCreated=!1,this.syncedSecondary=!0,this.init(),v}var e,i,n;return e=t,(i=[{key:"init",value:function(t){t=void 0!==t?t:a.a.$("body"),this.commonSlider=new c(this.CivAPP),this.commonSlider.initActivityDetail(),this.initGallery(t),this.buildContentGallery(t),this.initRoundedSliders(t),this.initDarkSlider(t),this.initCompactSliders(t),this.initGuidesSliders(t),this.commonSlider.initTransfersHeader(),this.commonSlider.initSuggestedActivities(),this.commonSlider.initSuggestedActivitiesFull(),this.commonSlider.initJobCarousel()}},{key:"prepareActivityPrint",value:function(){this.commonSlider.prepareActivityPrint()}},{key:"fetchTravelerGallery",value:function(t){var e="/newApi/activities/".concat(window.activityData.activityId,"/imageOpinions");$.ajax({url:e,type:"POST",data:JSON.stringify({lang:a.a.getLocale()}),async:!0}).done((function(e,i,a){t(e.data)})).fail((function(t,e,i){}))}},{key:"buildActivityGallery",value:function(t,e){a.a.l("---\x3ebuildActivityGallery");var i=this,o=window.activityData.reviewImages;t.each((function(){var t=$(this),n=t.find(".o-gallery-thumbs__item"),r=t.find(".swiper-slide.item-video"),l=t.find(".traveler-thumb"),s=t.find(".swiper-slide").not(".o-gallery-thumbs__item"),d=e.find(".a-opinion-image"),c=a.a.setIdIfNotId(t),u=[],h=c+"__container";0!==r.length&&(n=$.merge(n,r));var m,v=$('<div id="'.concat(h,'" class="js-modal-content">')+'<ul class="tabs-gallery">'+'<li><a href="#civGallery"><span class="__inner">'.concat(a.a.tr("civitatisPhotos")," (").concat(n.length,")</span></a></li>")+'<li><a href="#travelerGallery"><span class="__inner">'.concat(a.a.tr("travelerPhotos")," (").concat(o,")</span></a></li>")+'</ul><div id="civGallery" class="panel _new-gallery _civ-gallery"></div><div id="travelerGallery" class="panel _new-gallery _traveler-gallery"></div></div>');a.a.$("body").append(v),o||$(".tabs-gallery").hide();var y=function(t,e){e="function"==typeof e?e:Function.prototype,t=void 0!==t?t:0,CivAPP.ConfirmUtil.showDiv({id:h,extraClass:"reveal--opacity-dark _new-gallery-reveal",callback:function(){void 0===m?i.createActivityGallery(v,n,(function(i){null!=(m=i)&&(window.setTimeout((function(){m.resize()}),150),window.setTimeout((function(){m.show(t),e()}),250))})):null!=m&&(window.setTimeout((function(){m.resize()}),150),window.setTimeout((function(){m.show(t),e()}),250))}})};$(".tabs-gallery a").click((function(){var t=$(this).attr("href");return u.length||"#travelerGallery"!==t||i.fetchTravelerGallery((function(t){u=t.reduce((function(t,e){var i=f(e.attachments);delete e.attachments;var a=i.map((function(t){return Object.assign(t,e)}));return t.concat(a)}),[]),i.createTravelerGallery(v,u)})),$(".panel").hide(),$(".tabs-gallery a.active").removeClass("active"),$(this).addClass("active"),$(t).show(),!1})),s.each((function(){$(this).off("click.images"),$(this).on("click.images",(function(t){$(t.target).hasClass("owl-video-play-icon")||($(".tabs-gallery li:first a").click(),y($(this).attr("data-position")))}))})),l.each((function(){$(this).off("click.images"),$(this).on("click.images",(function(t){$(".tabs-gallery li:first a").click(),y(0,(function(){$(".tabs-gallery li:last a").click()}))}))})),d.each((function(){$(this).off("click.images"),$(this).on("click.images",(function(t){var e=i.getUserReviewImagePosition($(this).attr("data-attachment-id")),a=$(this).attr("data-attachment-id");$(".tabs-gallery li:first a").click(),y(0,(function(){$(".tabs-gallery li:last a").attr("data-position",e),$("body").attr("data-user-image-id",a),$(".tabs-gallery li:last a").click(),void 0!==i.travellerGalleryDiv&&void 0!==i.travellerGalleryDiv.data("fotorama")&&i.travellerGalleryDiv.data("fotorama").show(e)}))}))}))}))}},{key:"buildCommonGallery",value:function(t,e){a.a.l("---\x3ebuildCommonGallery");var i=this;t.each((function(){var t,e=$(this),o=e.find(".o-gallery-thumbs__item"),n=a.a.setIdIfNotId(e)+"__container",r=$('<div id="'+n+'" class="js-modal-content"></div>'),l=e.find(".o-gallery-thumbs__counter");a.a.$("body").append(r);var s=function(e){CivAPP.ConfirmUtil.showDiv({id:n,extraClass:"reveal--full-dark",callback:function(){void 0===t?i.createGallery(r,o,(function(i){a.a.l("se ejecuta el callback en buildCommonGallery"),a.a.l(i),null!=(t=i)&&(window.setTimeout((function(){t.resize()}),150),window.setTimeout((function(){t.show(e)}),250))}),Function.prototype,"commonGallery"):null!=t&&(window.setTimeout((function(){t.resize()}),150),window.setTimeout((function(){t.show(e)}),250))}})};o.each((function(t){$(this).off("click.thumbs"),$(this).on("click.thumbs",(function(){s(t)}))})),l.each((function(t){$(this).off("click.thumbsCounter"),$(this).on("click.thumbsCounter",(function(){s(0)}))}))}))}},{key:"initGallery",value:function(t){a.a.l("---\x3einitGallery");var e=$(t).find(".o-gallery-thumbs, .is-photos");if(a.a.l("galleryThumbsContainer"),a.a.l(e),0!==e.length&&"o-slider"===e[0].classList[0]){var i=e.filter((function(t){return"o-slider"===e[t].classList[0]}));this.buildActivityGallery(i,e)}else this.buildCommonGallery(e);$(t).find("#boton").on("click",(function(){o.a.showDiv({id:"fotogallery",extraClass:"reveal--full-dark"})}))}},{key:"buildContentGallery",value:function(t){a.a.l("---\x3ebuildContentGallery");var e=$(t).find(".l-guide-section__inner .o-content .imagenDerecha, .l-guide-section__inner .o-content .imagenPopup"),i=this;e.each((function(){var t,e=$(this),n=a.a.setIdIfNotId(e)+"__container",r=$('<div id="'+n+'" class="js-modal-content"></div>');a.a.$("body").append(r),$(this).off("click.buildContentGallery"),$(this).on("click.buildContentGallery",(function(l){var s;l.preventDefault(),s=0,o.a.showDiv({id:n,extraClass:"reveal--full-dark",callback:function(){void 0===t?i.createGallery(r,e,(function(e){a.a.l("se ejecuta el callback en buildContentGallery"),a.a.l(e),null!=(t=e)&&(window.setTimeout((function(){t.resize()}),150),window.setTimeout((function(){t.show(s)}),250))}),Function.prototype,"contentGallery"):null!=t&&(window.setTimeout((function(){t.resize()}),150),window.setTimeout((function(){t.show(s)}),250))}})}))})),$(t).find("#boton").on("click",(function(){o.a.showDiv({id:"fotogallery",extraClass:"reveal--full-dark"})}))}},{key:"getFotoramaThumbSize",value:function(){Foundation.MediaQuery.current;var t={height:70,width:93};return $(window).height()>=500&&Foundation.MediaQuery.atLeast("large")&&(t={height:100,width:133}),t}},{key:"getFotoramaHeight",value:function(){var t=$(window).height();return 100*(t-this.getFotoramaThumbSize().height)/t}},{key:"createGallery",value:function(t,e,i,o,n){a.a.l("---\x3ecreateGallery"),n=void 0!==n?n:"commonGallery";var r=this,l=a.a.setIdIfNotId(t),s=$('<div id="'.concat(l,'-fotorama" class="AAA-fotorama" style="opacity: 0;transition:opacity .5s;">')),d=[],c=[],f={},h=this.getFotoramaHeight();a.a.l("fotoramaHeight"),a.a.l(h);var m=this.getFotoramaThumbSize(),v=m.height,y=m.width;t.append(s),e.each((function(){var t,e=$(this),i=e.find("img"),a=e.find(".o-gallery-thumbs__caption").text(),o=void 0!==i.attr("data-src")?i.attr("data-src"):i.attr("src"),r=o.replace("/thumbs","");e.hasClass("imagenPopup")&&(a=i.attr("longdesc"));var l=i.attr("alt");"contentGallery"===n&&(e.hasClass("imagenDerecha")||e.hasClass("imagenPopup"))&&(r=e.find("a").attr("href")),t=$('<div class="gallery-item _activity _content-gallery-item" style="display:flex; justify-content: center;" data-thumb="'.concat(o,'">')+'<div class="fotorama_img">'+'<img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="lazyload" alt="'.concat(l,'" data-src="').concat(r,'" />')+'</div><div class="fotorama__caption">'+'<div class="fotorama__caption__wrap">'.concat(a,"</div>")+"</div></div>"),c.push(l),d.push(t)})),f={arrows:"always",nav:"thumbs",width:"100%",maxwidth:"100%",fit:"contain",thumbfit:"contain",thumbmargin:10,thumbborderwidth:5,maxheight:h+"%",minheight:h+"%",thumbheight:v,thumbwidth:y,imgalttexts:c},"contentGallery"===n&&(f.ratio=1.3297872340425532),s.html(d);var g=a.a.getStaticPath()+"/js/vendor/fotorama/fotorama.js",w=a.a.getStaticPath()+"/js/vendor/fotorama/fotorama.css";null!=u(r.isLoadedFotorama)&&null!=r.isLoadedFotorama||(r.isLoadedFotorama=!1);var p=null;1==r.isLoadedFotorama?setTimeout((function(){p=r.loadedScriptFotorama(s,f)})):(null!=u(r.isLoadedFotorama)&&null!=r.isLoadedFotorama&&0!=r.isLoadedFotorama||(r.isLoadedFotorama=!0),a.a.loadScript(g,w,(function(){setTimeout((function(){p=r.loadedScriptFotorama(s,f)}))})));var b=0,C=setInterval((function(){b<5e4?null!=p?(clearInterval(C),"function"==typeof i&&i(p.data("fotorama"))):b+=100:(clearInterval(C),"function"==typeof o&&o(p.data("fotorama")))}))}},{key:"createActivityGallery",value:function(t,e,i,o){a.a.l("---\x3ecreateActivityGallery");var n,r=this,l=a.a.setIdIfNotId(t),s=$('<div id="'+l+'-fotorama" class="fotorama">'),d=[],c=this.getFotoramaHeight()-6,f=this.getFotoramaThumbSize(),h=f.height,m=f.width;t.find("#civGallery").html(""),t.find("#civGallery").append(s),e.each((function(){var t=$(this),e=t.find("img"),i=void 0!==e.attr("data-src")?e.attr("data-src"):e.attr("src"),a=i.replace("/galeria/thumbs/","/galeria/big/");if(t.hasClass("imagenDerecha")||t.hasClass("imagenPopup"))var o={img:$(this).find("a").attr("href"),thumb:i,caption:e.attr("alt")};else o=t.hasClass("item-video")?{video:t.find(".owl-video").attr("href")}:{img:a,thumb:i,caption:e.attr("alt")};d.push(o)})),n={data:d,arrows:"always",nav:"thumbs",width:"100%",maxwidth:"100%",fit:"contain",thumbfit:"contain",thumbmargin:10,thumbborderwidth:5,maxheight:c+"%",minheight:c+"%",thumbheight:h,thumbwidth:m};var v=a.a.getStaticPath()+"/js/vendor/fotorama/fotorama.js",y=a.a.getStaticPath()+"/js/vendor/fotorama/fotorama.css";null!=u(r.isLoadedFotorama)&&null!=r.isLoadedFotorama||(r.isLoadedFotorama=!1);var g=null;1==r.isLoadedFotorama?setTimeout((function(){g=r.loadedScriptFotorama(s,n)})):(null!=u(r.isLoadedFotorama)&&null!=r.isLoadedFotorama&&0!=r.isLoadedFotorama||(r.isLoadedFotorama=!0),a.a.loadScript(v,y,(function(){setTimeout((function(){g=r.loadedScriptFotorama(s,n)}))})));var w=0,p=setInterval((function(){w<5e4?null!=g?(clearInterval(p),"function"==typeof i&&i(g.data("fotorama"))):w+=100:(clearInterval(p),"function"==typeof o&&o(g.data("fotorama")))}))}},{key:"getUserReviewImagePosition",value:function(t){var e="object"===u(this.userReviewsThumbs)?this.userReviewsThumbs:[],i=0;return e.forEach((function(e,a){e.id===t&&(i=a)})),i}},{key:"createTravelerGallery",value:function(t,e){var i=this,o=a.a.setIdIfNotId(t),n=$('<div id="'.concat(o,'-fotorama-travellers" class="fotorama"></div'));t.attr("id",o),this.userReviewsThumbs=e,this.travellerGalleryDiv=n;var r=this.getFotoramaHeight(),l=this.getFotoramaThumbSize(),s=l.height,d=l.width;t.find("#travelerGallery").html(""),t.find("#travelerGallery").append(n),n.attr("data-arrows","always"),n.attr("is-lazy","true"),n.attr("data-nav","thumbs"),n.attr("data-width","100%"),n.attr("data-maxwidth","100%"),n.attr("data-fit","contain"),n.attr("data-thumbfit","contain"),n.attr("data-thumbmargin",10),n.attr("data-thumbborderwidth",5),n.attr("data-height","".concat(r,"%")),n.attr("data-maxheight","".concat(r,"%")),n.attr("data-minheight","".concat(r,"%")),n.attr("data-thumbheight",s),n.attr("data-thumbwidth",d),e.forEach((function(t){var e=t.downloadUrl,i=e.substring(0,e.lastIndexOf("/")+1)+"thumbs/"+e.split("/").pop(),a=t.rating,o=$('<div class="traveler-gallery--wrapper" data-thumb="'.concat(i,'">')+'<div class="traveler-gallery--image blazy-container">'+'<img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="b-lazy" data-src='.concat(t.downloadUrl," />")+'</div><div class="traveler-gallery--info"><div class="traveler-info">'+'<div class="traveler-avatar">'.concat(t.name.charAt(0),"</div>")+'<div class="traveler-data">'+'<p class="traveler-name">'.concat(t.name,"</p>")+"<p>".concat(t.city?"".concat(t.city,", "):"").concat(t.countryName,"</p>")+'<div class="traveler-metadata"><span class="m-rating__stars"><span class="m-rating__stars__empty"></span>'+'<span class="m-rating__stars__full" style="width: '.concat(20*a+"%",'">').concat(a,"</span>")+"</span>"+"<p>".concat(t.date.split("-").reverse().join(" / "),"</p>")+"</div></div></div>"+'<div class="traveler-comment">'.concat(t.comment,"</div>")+"</div></div>");n.append(o)})),a.a.initRatingStars();var c=a.a.getStaticPath()+"/js/vendor/fotorama/fotorama.js",f=a.a.getStaticPath()+"/js/vendor/fotorama/fotorama.css";null!=u(i.isLoadedFotorama)&&null!=i.isLoadedFotorama||(i.isLoadedFotorama=!1);var h=null;1==i.isLoadedFotorama?setTimeout((function(){h=i.loadedScriptFotorama(n);var t=0,e=$("body").attr("data-user-image-id");void 0!==e&&(t=i.getUserReviewImagePosition(e)),h.data("fotorama").show(t)})):(null!=u(i.isLoadedFotorama)&&null!=i.isLoadedFotorama&&0!=i.isLoadedFotorama||(i.isLoadedFotorama=!0),a.a.loadScript(c,f,(function(){setTimeout((function(){h=i.loadedScriptFotorama(n);var t=0,e=$("body").attr("data-user-image-id");void 0!==e&&(t=i.getUserReviewImagePosition(e)),h.data("fotorama").show(t)}))})))}},{key:"loadedScriptFotorama",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a.a.l("---\x3eloadedScriptFotorama");var i=this;if(t.is("[is-lazy]")){var o=function(e,i,a){var o=t.find(".fotorama__active"),n=o.find(".blazy-container:not(.blazy-container_loaded)"),r=o.find(".b-lazy");r.on("load",(function(){r.addClass("b-loaded"),n.addClass("blazy-container_loaded")})),r.attr("src",r.attr("data-src"))};a.a.l("is-lazy"),t.on("fotorama:showend",o),o()}t.on("fotorama:ready",(function(e,o,n){a.a.l("fotorama:ready"),t.css("opacity",1);var r=t[0].getElementsByClassName("fotorama__nav--thumbs");0!==r.length&&(r[0].addEventListener("touchend",(function(t){i.setThumbnailsAltTexts(o)})),r[0].addEventListener("mouseup",(function(t){i.setThumbnailsAltTexts(o)}))),i.setThumbnailsAltTexts(o)})),t.on("fotorama:showend",(function(t,e,a){i.setThumbnailsAltTexts(e)}));var n=t.fotorama(e);return void 0!==n.data("fotorama")&&null!==n.data("fotorama")&&$(window).on("resize",r()((function(){var t=i.getFotoramaThumbSize(),e=i.getFotoramaHeight();void 0!==n.data("fotorama")&&null!==n.data("fotorama")&&n.data("fotorama").setOptions({thumbwidth:t.width,thumbheight:t.height,maxheight:e+"%",minheight:e+"%"})}),400)),n}},{key:"initRoundedSlider",value:function(t){var e=this;if(0===t.children().length)return!1;$(t).owlCarousel({margin:20,autoWidth:!0,responsive:{0:{stagePadding:0},767:{items:3,slideBy:3,autoWidth:!0}},onTranslated:function(){CivAPP.refreshBlazy()},onInitialize:function(){e.commonSlider.fixCarouselWidth(t),window.setTimeout((function(){t.trigger("refresh.owl.carousel"),CivAPP.refreshBlazy()}),500)},onRefreshed:function(){e.commonSlider.fixCarouselWidth(t)}})}},{key:"initRoundedSliders",value:function(t){if(!a.a.isPhoneDevice()){var e=this;$(t).find(".o-related .__list.owl-carousel, .o-related__slider.owl-carousel").each((function(){var t=$(this),i=new Waypoint.Inview({element:t,enter:function(a){Foundation.MediaQuery.atLeast("xxlarge")||(null!=i?i.destroy():null!=this&&"function"==typeof this.destroy&&this.destroy(),setTimeout((function(){e.initRoundedSlider(t)})))}})}))}}},{key:"initDarkSlider",value:function(t){var e,i=$(t).find(".o-dark .__list.owl-carousel"),a=i.find(".column");0!==i.length&&(a.length<=3?i.addClass("_no-slider"):e=new Waypoint.Inview({element:i,enter:function(t){e.destroy(),i.owlCarousel({autoWidth:!0,stagePadding:40,loop:!0,margin:20,responsive:{0:{autoWidth:!1,items:2.25,stagePadding:0},480:{items:2.75,autoWidth:!1,slideBy:2,stagePadding:0},767:{stagePadding:50,slideBy:2},900:{stagePadding:50,items:3,slideBy:3},1120:{stagePadding:50,items:4,slideBy:4,nav:!0},1300:{stagePadding:50,items:5,slideBy:5,nav:!0},1600:{stagePadding:60,items:6,slideBy:6,nav:!0}},onTranslated:function(){CivAPP.refreshBlazy()}})}}))}},{key:"setCompactNavVisibility",value:function(t,e){if(a.a.isMobile())return!1;var i=t.width(),o=0;(e?t.children():t.find(".owl-item")).each((function(t){var e=parseFloat($(this).css("margin-right").slice(0,-2)),i=2*parseFloat($(this).css("border-width").slice(0,-2));o+=$(this).width()+e+i})),i>=o?t.addClass("js-no-nav"):t.removeClass("js-no-nav")}},{key:"initCompactSlider",value:function(t){if(!a.a.isPhoneDevice()){var e=t.children().length,i=this;if(0===e)return!1;$(window).on("resize",r()((function(){i.setCompactNavVisibility(t)}),400)),t.owlCarousel({loop:!1,autoWidth:!0,margin:20,responsive:{0:{items:1,slideBy:1,autoWidth:!1,stagePadding:30},480:{items:1,slideBy:1,autoWidth:!1,stagePadding:90},767:{slideBy:4,nav:!0,stagePadding:0},1600:{margin:22.5,slideBy:5,nav:!0,stagePadding:0}},onTranslated:function(){CivAPP.refreshBlazy()},onInitialize:function(){i.setCompactNavVisibility(t,!0)}})}}},{key:"initCompactSliders",value:function(t){var e=this;$(t).find(".o-compact .__list.owl-carousel, .o-compact__slider.owl-carousel").each((function(){var t=$(this),i=new Waypoint.Inview({element:t,enter:function(a){i.destroy(),e.initCompactSlider(t)}})}))}},{key:"initGuidesSlider",value:function(t){var e=this;t.owlCarousel({autoWidth:!0,margin:20,responsive:{0:{items:1},767:{autoWidth:!1,stagePadding:0,items:4,slideBy:4}},onTranslated:function(){CivAPP.refreshBlazy()},onInitialize:function(){e.commonSlider.fixCarouselWidth(t),window.setTimeout((function(){t.trigger("refresh.owl.carousel"),CivAPP.refreshBlazy()}),500)},onRefreshed:function(){e.commonSlider.fixCarouselWidth(t)}})}},{key:"initGuidesSliders",value:function(t){var e=this,i=$(t).find(".o-slider--guides"),a=i.find(".swiper-slide");if(a.length<2)return i.addClass("js-disabled"),!1;a.length<=4&&i.addClass("js-disabled-large"),$(t).find(".o-slider--guides").find(".owl-carousel").each((function(){var t=$(this),i=new Waypoint.Inview({element:t,enter:function(a){i.destroy(),e.initGuidesSlider(t)}})}))}},{key:"setThumbnailsAltTexts",value:function(t){console.log("---\x3esetThumbnailsAltTexts"),setTimeout((function(){t.data.forEach((function(e,i){if(!e.isAltSet&&e.$navThumbFrame){var a=e.$navThumbFrame.find("img");console.log("$navThumbImage.length"),console.log(a.length),a.length>0&&!a.attr("alt")&&(console.log("setting alt"),a.attr("alt",t.options.imgalttexts[i]),e.isAltSet=!0)}}))}),1500)}}])&&m(e.prototype,i),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.default=y}}]);