function SetNavScrollObj(){return new function(){if($("#why-viking-left-nav").length){var n=this;n.lastScrollTop=$(window).scrollTop();n.scrollDelta=0;n.$sidebar=$("#why-viking-left-nav");n.sidebarHeight=n.$sidebar.outerHeight(!0);n.maxScrollBtm=headerOffset-parseInt(n.sidebarHeight-$(window).height()-headerOffset);n.maxScrollTop=headerOffset;n.sidebarTop=n.$sidebar.position().top}}}function SetFlexSlider(n,t){$(n).flexslider({controlNav:!1,slideshow:t,start:function(n){var t=$(n[0]).find(".flex-direction-nav .flex-prev"),i=$(n[0]).find(".flex-direction-nav .flex-next");$(n[0]).find(".max-slides").html($(n[0]).find(".slides > li").length);$(n[0]).find(".slides > li:not(.flex-active-slide)").css("display","none");$(n[0]).find(".current-slide").html($(n[0]).find(".slides > li").index($(n[0]).find(".flex-active-slide"))+1);t.attr("aria-label","View the previous slide");i.attr("aria-label","View the next slide");$(n[0]).find(".custom-numbered-controls .prev").on("click",function(){$(n[0]).flexslider("prev")});t.off("keyup");t.on("keypress",function(n){n.preventDefault();n.keyCode==32&&$(this).click()});i.off("keyup");i.on("keypress",function(n){n.preventDefault();n.keyCode==32&&$(this).click()});$(n[0]).find(".custom-numbered-controls .next").on("click",function(){$(n[0]).flexslider("next")});$(n[0]).find(".aria-announcer").html($(n[0]).find(".flex-active-slide").html());$(".why-viking-card-template").length&&(setCardTemplateHeight(),adjustCardTemplateFlexNavs())},before:function(n){$(n[0]).find(".slides > li").css("display","block")},after:function(n){$(n[0]).find(".slides > li:not(.flex-active-slide)").css("display","none");$(n[0]).find(".current-slide").html($(n[0]).find(".slides > li").index($(n[0]).find(".flex-active-slide"))+1);$(n[0]).find(".aria-announcer").html($(n[0]).find(".flex-active-slide").html())}})}function WVRunAfterResize(){screenXs.matches&&$(".why-viking-content-carousel-template").length&&setComp4Height();$(".why-viking-card-template").length&&(setCardTemplateHeight(),adjustCardTemplateFlexNavs());$(".why-viking .component-6.tables").length>0&&(setComponent6Height(),updateComponent6TableScrollMessage());$(".why-viking .component-7.numeric-list").length>0&&setComponent7Height();$(".why-viking .component-5").length>0&&setComp5Height();$(".why-viking .component-11.gallery").length>0&&setComponent11Height()}function setHeightAfterResize(){clearTimeout(doneResizing);doneResizing=setTimeout(WVRunAfterResize,500)}function setHeroContainerHeight(){$(".hero-container").each(function(){var n=$(this);n.css({marginTop:"",marginBottom:""});var t=n.find(".hero-copy").outerHeight(!0),i=Math.ceil((t-n.height())/2)+30;t&&(screenMd.matches||screenLg.matches?n.height()<t&&n.css({marginTop:i,marginBottom:i}):n.css({marginTop:"",marginBottom:""}))})}function setCardTemplateHeight(){$(".why-viking-card-template:not(.explorer-sale-lading-page)").each(function(){var n=$(this).find(".copy-block");$(this).find(".flex-container").length||(screenXs.matches||screenSm.matches||screenMd.matches?n.css("height",""):n.css("height",$(this).find(".flexslider .slides").outerHeight(!0)));n.addClass("fadeIn")})}function reduceJQueryElements(n,t,i,r){var u=i;return n.each(function(){if(r&&r(u,this))return!1;u=t(u,this)}),u}function adjustCardTemplateFlexNav(n){var t=reduceJQueryElements($(n).find(".flex-active-slide img"),function(n,t){return $(t).height()>0?$(t).height():n},0,function(n){return n>0}),i=$(n).find(".flex-direction-nav a").outerHeight();$(n).find(".flex-direction-nav a").css({"margin-top":-(i/2),top:t/2})}function adjustCardTemplateFlexNavs(){$(".why-viking-card-template .flexslider").each(function(){adjustCardTemplateFlexNav(this)})}function setComp4Height(){$(".why-viking-content-carousel-template").each(function(){var n=$(this).find(".mobile-content .mobile-overflow-container"),i=n.find("section:first").outerHeight(),r=0,t;n.css("height","");n.find("section").each(function(){r+=$(this).outerHeight(!0)});n.attr({"data-min-height":i,"data-max-height":r});n.css("height",i).addClass("collapsed");t=n.siblings("footer:first").find(".btn-cta");t.attr("aria-label").startsWith("Collapse ")&&t.attr("aria-label","See more about "+t.attr("aria-label").substring(9));t.html("SEE MORE");n.children().slice(1).css("display","none")})}function setComp5Height(){$(".why-viking .component-5.one-up").length>0&&$(".why-viking .component-5.one-up").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".article");n.hasClass("has-hidden")&&setStackedMaxHeight(3,t,i,$(this).find("footer .cta"),!0,!1)});$(".why-viking .component-5.three-up:not(.use-natural-height), .why-viking .component-5.itinerary:not(.use-natural-height)").length>0&&$(".why-viking .component-5.three-up:not(.use-natural-height), .why-viking .component-5.itinerary:not(.use-natural-height)").each(function(){var n=$(this),t=n.find("section"),r=$(t).find(".thumbnail"),f=n.find(".thumbnail-wrapper"),i,u;setComponentItemMaxHeight(f,r);$(t).hasClass("collapsed")?setComponentContentHeight(t,r):$(t).css("height","");n.hasClass("has-hidden")&&(r.each(function(){i!==null&&$(this).offset().top>i?(i=$(this).offset().top,u=!0):i=$(this).offset().top}),u?n.find("footer").show():u||n.find("footer").hide())});$(".why-viking .component-5.thumbnail-only").length>0&&$(".why-viking .component-5.thumbnail-only").each(function(){var n=$(this),t=n.find("section"),u=n.find(".thumbnail-img > div"),f=n.find(".container-fluid"),i,r;n.closest("#partnerLogos").length||(setComponentItemMaxHeight(f,u),$(t).hasClass("collapsed")?setComponentContentHeight(t,u):$(t).css("height",""),n.hasClass("has-hidden")&&(t.find(".thumbnail-wrapper > div").each(function(){i!==null&&$(this).offset().top>i?(i=$(this).offset().top,r=!0):i=$(this).offset().top}),r?n.find("footer").show():r||n.find("footer").hide()))})}function setComponent6Height(){$(".why-viking .component-6.news-strip").each(function(){var n=$(this),t=n.find(".slides"),i=$(t).find(".item");n.hasClass("has-hidden")&&setStackedMaxHeight(1,t,i,$(this).find("footer .cta"),!0,!1)});$(".why-viking .component-6.tables").each(function(){var t=$(this),n=t.find("section");$(n).hasClass("collapsed")?setTableMaxHeight(n):$(n).css("height","")})}function hasOverflow(n){return n.offsetHeight<n.scrollHeight||n.offsetWidth<n.scrollWidth}function updateComponent6TableScrollMessage(){$(".why-viking .component-6.tables-scroll").each(function(){var n=$(this).find(".scroll-content").get(0);hasOverflow(n)?$(this).find(".table-scroll-message").show():$(this).find(".table-scroll-message").hide()})}function setComponent7Height(){$(".why-viking .component-7.numeric-list").each(function(){var t=$(this),n=t.find("section"),u=$(n).find(".article-text"),i,r;t.hasClass("has-hidden")&&(equalizeHeightOnRow(u),$(n).hasClass("collapsed")?setComponentContentHeight(n,u):$(n).css("height",""),n.find(".row > div").each(function(){i!==null&&$(this).offset().top>i?(i=$(this).offset().top,r=!0):i=$(this).offset().top}),r?t.find("footer").show():r||t.find("footer").hide())})}function setComponent11Height(){$(".why-viking .component-11.gallery").each(function(){var t=$(this),n=t.find("section"),u=$(n).find(".item"),i,r;t.hasClass("has-hidden")&&($(n).hasClass("collapsed")?setComponentContentHeight(n,u):$(n).css("height",""),n.find(".row > div").each(function(){i!==null&&$(this).offset().top>i?(i=$(this).offset().top,r=!0):i=$(this).offset().top}),r?t.find("footer").show():r||t.find("footer").hide())})}function WhyVikingSelectLeftNavItem(n){$(".why-viking-left-navigation a").parent().removeClass("active");$('.why-viking-left-navigation a[href="#'+n+'"]').parent().addClass("active");$('.why-viking-left-navigation a[href="#'+n+'"]').parent().is(":hidden")&&window.matchMedia("(min-width:768px)").matches&&$('.why-viking-left-navigation a[href="#'+n+'"]').parent().parents("ul:first").collapse("show")}function setComponentContentHeight(n,t){var i=$(t).outerHeight(!0);$(n).outerHeight(i)}function resizeComponentContentHeight(n,t,i,r){var f=$(n).find(".row").outerHeight(!0),e=$(t).outerHeight(!0),o=$(n).offset().top-$(".hdr-canvas").outerHeight(!0),u=$(i).attr("aria-label");$(n).hasClass("collapsed")?($(n).removeClass("collapsed"),$(t).removeClass("off-screen"),$(i).html("Show Less"),typeof u!=typeof undefined&&u!==!1?$(i).attr("aria-label",u.replace("Show More","Show Less")):$(i).attr("aria-label","Show Less"),r&&(typeof u!=typeof undefined&&u!==!1?i.next(".show-toggle").text("Showing More"+u.replace("Show More","")+" on the page"):i.next(".show-toggle").text("Showing More items on the page")),$(n).animate({height:f},500)):($(n).addClass("collapsed"),$(i).html("Show More"),typeof u!=typeof undefined&&u!==!1?$(i).attr("aria-label",u.replace("Show Less","Show More")):$(i).attr("aria-label","Show More"),r&&(typeof u!=typeof undefined&&u!==!1?i.next(".show-toggle").text("Showing Less"+u.replace("Show Less","")+" on the page"):i.next(".show-toggle").text("Showing Less items on the page")),$(n).animate({height:e},500,function(){setComponentContentHeight(n,t)}),r&&$("html, body").animate({scrollTop:o}))}function setHeightForGroup(n,t){for(var i=0;i<n.length;i++)$(n[i]).css("height",t)}function setComponentItemMaxHeight(n,t){var u=0,i=0,r=[];(t.each(function(){$(this).css("height","")}),screenXXs.matches)||(t.each(function(){var t=$(this),f=t.outerHeight(!1),e=t.offset(),n=Math.floor(e.top);i==0&&(i=n);i<=n+30&&i>=n-30?(f>u&&(u=f),i=n,r.push(t)):(setHeightForGroup(r,u),u=f,i=n,r=[],r.push(t))}),r.length>0&&setHeightForGroup(r,u))}function equalizeHeightOnRow(n){var t=[],r=[],u=0,f=0,i;for($(n).each(function(n){var i=$(this),s=i.offset(),o=s.top,e;n==0&&(f=o);i.css("height","");f==o||u||(u=n);e=0;u&&(e=Math.floor(n/u));t.length<e+1&&t.push(0);r.push({y:e,toResize:i,h:i.outerHeight()});i.outerHeight()>t[e]&&(t[e]=i.outerHeight())}),i=0;i<r.length;i++)r[i].toResize.css("height",t[r[i].y])}function setTableMaxHeight(n){var r=$(".reference-table tr").length,t=15,i=0;return r<=t?($(".tables footer .cta").hide(),$(".tables footer").css("paddingBottom",30)):r>t&&($(".reference-table tr:lt("+t+")").each(function(){i+=$(this).outerHeight()}),$(n).height(i+1)),$(".reference-table.opacity-0").animate({opacity:1},300,function(){$(this).toggleClass("opacity-0")}),i+1}function setStackedMaxHeight(n,t,i,r,u,f){var c=n,s=0,h=0,e=0,o=$(r),l=$(t).offset().top-$(".hdr-canvas").outerHeight(!0);$(i).each(function(n){h+=$(this).outerHeight(!0);n<c&&(s+=$(this).outerHeight(!0)-1)});u?e=$(t).hasClass("collapsed")?s:h:$(t).hasClass("collapsed")?(o.html("Show Less"),o.attr("aria-label","Show Less"),$(t).removeClass("collapsed"),e=h):(o.html("Show More"),o.attr("aria-label","Show More"),$(t).addClass("collapsed"),e=s,f&&$("html, body").animate({scrollTop:l}));u?$(t).css("height",e):$(t).animate({height:e},500)}function setSidebarPos(){var t=$(window),i=t.height()-headerOffset,n=t.scrollTop();navScrollObj.sidebarHeight=navScrollObj.$sidebar.outerHeight(!0);navScrollObj.maxScrollBtm=headerOffset-parseInt(navScrollObj.sidebarHeight-i);navScrollObj.maxScrollTop=headerOffset;navScrollObj.sidebarTop=navScrollObj.$sidebar.position().top;navScrollObj.scrollDelta=navScrollObj.lastScrollTop-n;var u=i>navScrollObj.sidebarHeight,r=n+headerOffset+navScrollObj.sidebarHeight-$(".trd-footer-canvas,.mobile-footer-canvas").offset().top,f=n+headerOffset+navScrollObj.sidebarHeight>=$(".trd-footer-canvas,.mobile-footer-canvas").offset().top;f?(console.log("else if"),(Math.floor(navScrollObj.sidebarTop)>=Math.floor(headerOffset-r)||navScrollObj.scrollDelta>0||vrcIsMobile.any())&&navScrollObj.$sidebar.css("top",headerOffset-r)):(console.log("else"),u?navScrollObj.$sidebar.css("top",headerOffset):n+headerOffset<=navScrollObj.maxScrollTop&&navScrollObj.scrollDelta>0||navScrollObj.sidebarTop>=navScrollObj.maxScrollTop&&navScrollObj.scrollDelta>0?navScrollObj.$sidebar.css("top",navScrollObj.maxScrollTop):navScrollObj.sidebarTop<=navScrollObj.maxScrollBtm&&navScrollObj.scrollDelta<0?navScrollObj.$sidebar.css("top",navScrollObj.maxScrollBtm):navScrollObj.$sidebar.css("top",navScrollObj.sidebarTop+navScrollObj.scrollDelta));navScrollObj.lastScrollTop=n}function scrollToLocation(n,t){n.size()!=0&&(t?setTimeout(function(){$("body,html").animate({scrollTop:$("#cruise-hdr").length?n.offset().top-($("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight()):n.offset().top-$("#trd-header").outerHeight()},600)},550):$("body,html").animate({scrollTop:$("#cruise-hdr").length?n.offset().top-($("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight()):n.offset().top-$("#trd-header").outerHeight()},600))}function loadImages(n,t){var i=$(t).find(".responsive-thumbnail.ratio-2by1"),r;i!=null&&i.data("image")!==undefined&&(r="url("+i.data("image")+") no-repeat 50% 0",i.css("background",r).css("background-size","cover").removeAttr("data-image"))}function disableOnlineBooking(){$(".book-now-link").hide();$(".book-now-btn").hide();$(".request-quote-btn").removeClass("hidden-sm hidden-md hidden-lg");$(".request-quote-btn.btn-clear-dark").removeClass("btn-clear-dark").addClass("btn-red");$(".request-quote-btn.btn-clear-white").removeClass("btn-clear-white").addClass("btn-red")}function initSlideshow(){var n=$(".related-panel.activated").data("related-count");if(!slideShowRunning&&$(".related-panel.activated").children().size()>1){$(".related-panel.activated").on("cycle-post-initialize",function(){$(".cycle-carousel-wrap").css("left","0");$(this).css("marginLeft","36px")});$(".related-panel.activated").cycle({fx:"carousel",speed:400,slides:".actions",carousel:!0,carouselFluid:!1,carouselVisible:n,allowWrap:!0,pager:"#pager",pagerTemplate:"<span><\/span>",timeout:0,next:".flex-next",prev:".flex-prev",pauseOnHover:!0,continueAuto:!0,swipe:!0,log:!1});slideShowRunning=!0}}function destroySlideshow(){$(".related-panel.activated").cycle("destroy");$(".cycle-sentinel").remove();$("#pager").html("");slideShowRunning=!1}function buildSlideShow(){window.matchMedia("(max-width: 1023px)").matches&&initSlideshow()}function setRelatedHeader(){$(".related-panel.activated").data("related-count")<1?($(".related-header").addClass("hide"),$(".related-container").addClass("collapsed")):($(".related-header").removeClass("hide"),$(".related-container").removeClass("collapsed"))}function videoCallback(){}function setSidebarHeight(){if($(".thumbnails").length>0)if(window.matchMedia("(max-width: 1023px)").matches)$(".thumbnails").css("maxHeight","100%");else{var n=window.matchMedia("(max-width: 1365px)").matches?144:160,t=$(".videos-page-container > section").height()-n;$(".thumbnails").css("maxHeight",t)}}function setRelatedItineraries(n,t,i,r,u){var f=JSON.stringify({videoId:t,title:i,shipCode:r,cities:u});document.getElementById("related-Itin-container").style="display:none";window.matchMedia("(max-width: 1023px)").matches&&destroySlideshow();$.ajax({url:n+"VideoPlay/GetVideoRelatedItineraries",type:"POST",data:f,contentType:"application/json; charset=utf-8",traditional:!0,success:function(n){document.getElementById("related-Itin-container").innerHTML=n;document.getElementById("related-Itin-container").style="display:block";destroySlideshow();buildSlideShow();setSidebarHeight()}})}function setVideoRelatedItineraries(n,t,i){var r=$("#related_"+t).attr("data-cruises"),u=JSON.stringify({videoId:t,title:i,cruises:r});document.getElementById("related-Itin-container").style="display:none";window.matchMedia("(max-width: 1023px)").matches&&destroySlideshow();$.ajax({url:n+"VideoPlay/GetRelatedItinerariesByVideo",type:"POST",data:u,contentType:"application/json; charset=utf-8",traditional:!0,success:function(n){document.getElementById("related-Itin-container").innerHTML=n;document.getElementById("related-Itin-container").style="display:block";destroySlideshow();buildSlideShow();setSidebarHeight()}})}var screenXXs=window.matchMedia("(max-width:479px)"),screenXs=window.matchMedia("(max-width:767px)"),screenSm=window.matchMedia("(min-width:768px) and (max-width:1023px)"),screenMd=window.matchMedia("(min-width:1024px) and (max-width:1365px)"),screenLg=window.matchMedia("(min-width:1366px)"),headerOffset=0,alertOffset=0,navScrollObj=null,vcDisableBookNowButtons=!1,doneResizing;$(document).ready(function(){alertOffset=$(".page-alert").is(":visible")?$(".page-alert").outerHeight(!0):0;headerOffset=$("#cruise-hdr").length?$("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight()+alertOffset:$("#trd-header").outerHeight()+alertOffset;navScrollObj=SetNavScrollObj();$(".inline-video-trigger").each(function(){var n=new InlineVideo(this);n.init()});$(".film-group").on("show.bs.collapse",function(n){var r=$(this),t,i;n&&n.target&&(t=$(n.target),t.size()>0&&(i="#"+t.attr("id").replace("content-panel-","panel-"),i!=window.location.hash&&(window.location.hash=i)))})});$(window).on("load",function(){var t=window.location&&window.location.hash,n=t.replace(/[^a-zA-Z0-9-_]/g,"");n.indexOf("panel-")==0&&($("#"+n.replace("panel-","content-panel-")).collapse("show"),window.setTimeout(function(){window.scrollTo(0,$("#"+n.replace("panel-","title-panel-")).offset().top-350)},100));$(".progressive-image").length>0&&$(".progressive-image").each(function(){var n=$(this).find(".loadingImage"),t;n.size()>0&&typeof n.data("image")!="undefined"&&n.data("image").length>0&&(t=new Image,t.onload=function(){newImage=n.after('<img src="'+t.src+'" class="overlay" />');$(".overlay").animate({opacity:1},200,function(){})},t.src=n.data("image"))})});$(document).ready(function(){$(".why-viking-content-carousel-template").on("click",".mobile-content .btn-cta",function(){var n=$(this),t=n.parents(".mobile-content:first").find(".mobile-overflow-container"),i=$("#cruise-hdr").length?$("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight():$("#trd-header").outerHeight(),r=n.parents(".why-viking-content-carousel-template:first").offset().top-i-15;t.hasClass("collapsed")?(t.removeClass("collapsed"),t.children().slice(1).css("display",""),t.css("height",t.data("max-height")),n.attr("aria-expanded","true"),n.attr("aria-label","Collapse "+n.attr("aria-label").substring(15)),n.html("COLLAPSE")):(t.addClass("collapsed"),t.css("height",t.data("min-height")),n.attr("aria-expanded","false"),n.attr("aria-label","See more about "+n.attr("aria-label").substring(9)),n.html("SEE MORE"),$("html, body").animate({scrollTop:r},500),t.children().slice(1).css("display","none"))});screenXs.matches&&$(".why-viking-content-carousel-template").length&&setComp4Height()});$(window).on("load resize",function(){alertOffset=$(".page-alert").is(":visible")?$(".page-alert").outerHeight(!0):0;headerOffset=$("#cruise-hdr").length?$("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight()+alertOffset:$("#trd-header").outerHeight()+alertOffset;navScrollObj!=null&&typeof navScrollObj.$sidebar!="undefined"&&navScrollObj.$sidebar!==null&&navScrollObj.$sidebar.length&&(screenXs.matches||(navScrollObj.$sidebar.css("width",navScrollObj.$sidebar.parent().width()),setSidebarPos(),navScrollObj.sidebarHeight=$("#why-viking-left-nav").outerHeight(!0)),screenXs.matches?(navScrollObj.$sidebar.hasClass("in")&&navScrollObj.$sidebar.collapse("hide"),navScrollObj.$sidebar.css({top:"",width:""})):navScrollObj.$sidebar.hasClass("in")||navScrollObj.$sidebar.collapse("show"));$(".hero-container").length>0&&setHeroContainerHeight();$(".why-viking-fullscreen-carousel-template").length>0&&$(".why-viking-fullscreen-carousel-template").each(function(){var n=$(this),t=n.find(".copy-block-container"),r=n.find(".flexslider").height(),u=n.find(".flexslider img:first").height(),i;screenXs.matches&&n.css("height","");(screenSm.matches||screenMd.matches||screenLg.matches)&&(t.length>0?t.outerHeight()<r?(t.css({top:(r-t.outerHeight())/2,bottom:"auto"}),n.css("height","")):(t.css({top:"",bottom:""}),n.css("height",u*.66+t.outerHeight(!0))):n.css("height",""));n.hasClass("layout-copy-center")&&n.find(".head-line").length>0&&(i=n.find(".head-line"),i.css("top",u-i.outerHeight(!0)))});$(".why-viking-card-template").length&&setCardTemplateHeight()});$(window).on("resize",function(){setHeightAfterResize()});$(function(){$(".why-viking .component-6.tables").length>0&&(setComponent6Height(),updateComponent6TableScrollMessage());$(".why-viking .component-7.numeric-list").length>0&&setComponent7Height();$(".why-viking .component-5").length>0&&setComp5Height();$(".why-viking .component-11.gallery").length>0&&setComponent11Height()});$(window).on("load",function(){var r=!1,u,n,t,f,i;typeof navScrollObj.$sidebar!="undefined"&&navScrollObj.$sidebar!==null&&navScrollObj.$sidebar.length>0&&(setTimeout(function(){$("#why-viking-left-nav").on("shown.bs.collapse",function(){var t=$("#why-viking-left-nav").outerHeight(!0)-navScrollObj.sidebarHeight,n=$(window).scrollTop(),i=n+headerOffset+navScrollObj.sidebarHeight>=$(".trd-footer-canvas,.mobile-footer-canvas").offset().top;i&&!screenXs.matches&&$("html,body").scrollTop(n-t)})},500),$("#why-viking-left-nav").hasClass("recipe")||$("#why-viking-left-nav a:first").parent().addClass("active"),$("#why-viking-left-nav").hasClass("htmx-swap")&&(r=!0));u=location.hash;n=u.replace(/[^a-zA-Z0-9-_]/g,"");n.length&&n.indexOf("-section")>=0&&(t=n.split("-section")[0],r?(f=document.getElementById("button-"+t),htmx.trigger(f,"click"),WhyVikingSelectLeftNavItem(t)):(i=$("#"+t),i.length>0&&scrollToLocation(i,!0)));$("body").on("click",'.animate-link-transitions a[href^="#"]:not([data-toggle=collapse]), #trd-header a[href^="#"]:not([data-toggle=collapse])',function(n){n.preventDefault();var t=$(this.hash.split("-section")[0]);window.history.replaceState({},this.hash+"-section",this.hash+"-section");scrollToLocation(t,!1)});$("body").on("click",'#trd-header a[href*="#"]:not([href="#"]):not([href*="#noscroll"]):not([data-toggle=collapse])',function(n){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){n.preventDefault();var t=$(this.hash.split("-section")[0]);window.history.replaceState({},t+"-section",t+"-section");scrollToLocation(t,!1)}});$(".why-viking .component-5.one-up").length>0&&$(".why-viking .component-5.one-up").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".article");if(n.hasClass("has-hidden")&&n.find("footer .cta").length>0){setStackedMaxHeight(3,t,i,n.find("footer .cta"),!1,!1);n.find("footer .cta").on("click",function(){setStackedMaxHeight(3,t,i,$(this),!1,!0)})}});$(".why-viking .component-5.three-up").length>0&&$(".why-viking .component-5.three-up").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".thumbnail");if(n.hasClass("has-hidden")&&n.find("footer .cta").length>0){n.find("footer .cta").on("click",function(){$(i).each(loadImages);resizeComponentContentHeight(t,i,$(this),!0)});resizeComponentContentHeight(t,i,n.find("footer .cta"),!1)}});$(".why-viking .component-5.thumbnail-only").length>0&&$(".why-viking .component-5.thumbnail-only").each(function(){var n=$(this),t=n.find("section"),i=n.find(".thumbnail-img");if(!n.closest("#partnerLogos").length&&n.hasClass("has-hidden"))n.find("footer .cta").on("click",function(){resizeComponentContentHeight(t,i,$(this),!0)})});$(".why-viking .component-5").length>0&&setComp5Height();$(".why-viking .component-6.news-strip").length>0&&$(".why-viking .component-6.news-strip").each(function(){var n=$(this),t=n.find(".slides"),i=$(t).find(".item");if(n.hasClass("has-hidden")&&n.find("footer .cta").length>0){setStackedMaxHeight(1,t,i,n.find("footer .cta"),!1,!1);n.find("footer .cta").on("click",function(){setStackedMaxHeight(1,t,i,$(this),!1,!0)})}});$(".why-viking .component-6.tables").length>0&&$(".why-viking .component-6.tables").each(function(){var n=$(this),t=n.find("section"),r=setTableMaxHeight(t),u=$(t).offset().top-$(".hdr-canvas").outerHeight(!0),i=n.hasClass("cruise-dbd-itinerary");n.find("footer .cta").on("click",function(){var n=$(this),f=n.parents(".component-6.tables:first"),e=f.find("section .row").outerHeight(),t=f.find("section");$(t).hasClass("collapsed")?($(t).toggleClass("collapsed"),$(t).animate({height:e},500),n.html("Show Less"),i?(n.attr("aria-label","Show less itinerary day."),n.attr("aria-expanded",!0)):n.attr("aria-label","Show Less.")):($(t).toggleClass("collapsed"),$(t).animate({height:r},500),n.html("Show More"),i?(n.attr("aria-label","Show more itinerary day."),n.attr("aria-expanded",!1)):n.attr("aria-label","Show more."),$("html, body").animate({scrollTop:u}))});n.find("table.opacity-0").animate({opacity:1},500,function(){$(this).toggleClass("opacity-0")})});$(".why-viking .component-7.numeric-list").length>0&&$(".why-viking .component-7.numeric-list").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".article-text");if(n.hasClass("has-hidden"))n.find("footer .cta").on("click",function(){resizeComponentContentHeight(t,i,$(this),!0)})});$(".why-viking .component-11.gallery").length>0&&$(".why-viking .component-11.gallery").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".item");if(n.hasClass("has-hidden"))n.find("footer .cta").on("click",function(){resizeComponentContentHeight(t,i,$(this),!0)})})});const scrollHandler=vcDebounce(function(){var n=$("#cruise-hdr").length?$("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight():$("#trd-header").outerHeight();$(".content-section").each(function(){if($(window).scrollTop()>=$(this).offset().top-n-25&&$(window).scrollTop()<=$(this).offset().top-n-25+$(this).outerHeight(!0)){var t=$(this).attr("id");typeof t=="undefined"&&(t=$(this).children().attr("id"));typeof t!="undefined"&&window.location.hash!=="#"+t&&($(".why-viking-left-navigation a").parent().removeClass("active"),$('.why-viking-left-navigation a[href="#'+t+'"]').parent().addClass("active"),$('.why-viking-left-navigation a[href="#'+t+'"]').parent().is(":hidden")&&window.matchMedia("(min-width:768px)").matches&&$('.why-viking-left-navigation a[href="#'+t+'"]').parent().parents("ul:first").collapse("show"))}});typeof navScrollObj!="undefined"&&navScrollObj!=null&&typeof navScrollObj.$sidebar!="undefined"&&navScrollObj.$sidebar!=null&&navScrollObj.$sidebar.length>0&&!screenXs.matches&&setSidebarPos()},250,!1);$(window).on("scroll",scrollHandler);$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip({html:!0})});var updateQueryStringParam=function(n,t){var o=[location.protocol,"//",location.host,location.pathname].join(""),r=document.location.search,u=n+"="+t,i="?"+u,f,e;r&&(f=new RegExp("([?&])"+n+"[^&]*"),e=new RegExp("([?&])"+n+"=[^&;]+[&;]?"),typeof t=="undefined"||t==null||t==""?(i=r.replace(e,"$1"),i=i.replace(/[&;]$/,"")):i=r.match(f)!==null?r.replace(f,"$1"+u):r+"&"+u);i=i=="?"?"":i;window.history.replaceState({},"",o+i)},muteHandler=function(){var t=$("#wvInlineVideoContainer").find("iframe").attr("id"),n=YT.get(t);n&&(n.unMute(),$(".video-controls-display").css("display","none"))},InlineVideo=function(n){var t=this;t.element=n;t.player=null;t.isSinglePlayer=!1;t.isMediaCapable=!1;t.playerInteraction=!1;t.done=!1;t.playerHasStarted=!1;t.isPaused=!1;t.isFirstRun=!0;t.mediaPlayerName="YouTubePlayer";t.videoPlayedPage="";t.mediaName="";t.firstPlay=!1;t.milestones=[];t.hasEnded=!1;t.videoPlayerInterval=null;t.updateSeoVideoParam=function(n,t,i,r,u,f){var s,e,h,o;$("#seoVideoDatablock").length>0&&(s=$("#seoVideoDatablock").html(),e=JSON.parse(s),e.name=n,h=new RegExp("(\r\n|\r|\n)+"),e.description=t.replace(h,"").trim(),e.thumbnailUrl=[location.protocol,"//",location.host,i].join(""),e.contentUrl=r,u.length>0&&(o=convertDurationToISO8601(u.trim()),o!=null&&(e.duration=o)),e.uploadDate=f,document.getElementById("seoVideoDatablock").innerHTML=JSON.stringify(e))};t.isPlayerInited=function(){return typeof t.player!="undefined"&&t.player!==null};t.stopVideo=function(){t.isPlayerInited()&&t.player.stopVideo&&!t.isSinglePlayer&&t.player.stopVideo()};t.pauseVideo=function(){t.player&&t.isPlayerInited()&&t.player.pauseVideo&&!t.isSinglePlayer&&t.player.pauseVideo()};t.replayVideo=function(){t.player&&t.isPlayerInited()&&t.player.seekTo&&(t.player.seekTo(0,!0),t.player.playVideo())};t.closeVideo=function(){t.stopVideo()};t.initVideo=function(n,i){var s,h,w;t.firstPlay=!1;var u=$(t.element),v=u.attr("data-video-id"),c=u.attr("data-target-id"),f=u.attr("data-video-title"),y=u.attr("data-video-type"),e=u.attr("data-vimeo-id"),l=!0,a=u.attr("data-has-image-placeholder");if(typeof a!="undefined"&&a==="false"&&(l=!1),e||(e=u.attr("data-vimeo2-id")),y==="vimeo"&&e){t.videoPlayedPage=f;var p=$("#"+c),r=new Vimeo.Player(p[0]),o=!1;r.off("play");r.off("ended");r.off("pause");r.on("play",function(){console&&console.log("vimeo ||| player PLAY event");t.trackVimeoMilestones(r);t.firstPlay||t.hasEnded||(t.firstPlay=!0,r.getDuration().then(function(n){tealium.fireLinkEvent({event_name:"video_start",video_name:tealium.codify(f),video_length:n.toString(),video_playhead:"0"})}))});r.on("pause",function(){if(!o){o=!0;return}console&&console.log("vimeo ||| player PAUSE event");t.hasEnded||(clearInterval(t.videoPlayerInterval),tealium.fireLinkEvent({event_name:"video_pause",video_name:tealium.codify(f)}))});r.on("ended",function(){console&&console.log("vimeo ||| player ENDED event");t.hasEnded||(t.hasEnded=!0,o=!1,r.getDuration().then(function(n){tealium.fireLinkEvent({event_name:"video_100",video_name:tealium.codify(f),video_length:n.toString(),video_playhead:n.toString()})}))});r.getVideoId().then(function(n){if(e==n){if(l||!IsiOS())try{r.play()}catch(t){console&&console.log(t)}}else r.loadVideo(e).then(function(){try{r.play()}catch(n){console&&console.log(n)}}).catch(function(n){switch(n.name){}})})}else i&&(s=document.createElement("script"),s.src="https://www.youtube.com/iframe_api",h=document.getElementsByTagName("script")[0],h.parentNode.insertBefore(s,h)),w=!1,t.player=new YT.Player(c,{height:"100%",width:"100%",host:"https://www.youtube-nocookie.com",type:"movie",videoId:v,playerVars:{showinfo:1,modestbranding:1,playsinline:1,rel:0,wmode:"opaque",autoplay:1,origin:"//"+document.domain},events:{onReady:function(i){t.setIsMediaCapable();t.isSinglePlayer=n;t.playerHasStarted=!1;t.videoPlayedPage=f;t.mediaName=f;t.componentIndex=InlineVideo.all.length;InlineVideo.all.push(t);n?(window.matchMedia("(max-width: 1024px)").matches&&(i.target.mute(),$(".video-controls-display").css("display","block"),document.getElementById("mute").addEventListener("click",muteHandler),document.getElementById("mute").addEventListener("touchstart",muteHandler,!1)),i.target.playVideo(),t.onPlay()):t.onPlay();$(window).trigger("resize")},onStateChange:t.onPlayerStateChange}})};t.initHandlers=function(){var i=$(t.element).attr("data-target-wrapper-id"),n=$(t.element).attr("data-placeholder-id");$(t.element).on("click",function(){var r=n?$("#"+n):$(this);r.hide();$("#"+i).show();t.initVideo();intervalDaemon(t,t.player).trackVideoProgress()})};t.initSingleHandlers=function(n){var i=$(t.element).attr("data-target-id");$(t.element).on("click",function(){var l;document.getElementById("mute").removeEventListener("click",muteHandler);document.getElementById("mute").removeEventListener("touchstart",muteHandler,!1);$(".inline-video").removeClass("now-playing");$("html, body").animate({scrollTop:0},"fast");$(this).closest(".inline-video").addClass("now-playing");var e=$(this).attr("data-video-id"),a=$(this).attr("data-tcmid"),v=$(this).attr("data-id"),o=$(this).attr("data-video-image-url"),y=$(this).attr("data-video-duration"),p=$(this).attr("data-video-upload-date"),s=document.createElement("div"),u=$(this).closest(".thumbnail").find(".text-column h3,.text-column h4").html(),r=u.replace(/<[^>]+>/g,""),f=$(this).closest(".thumbnail").find(".text-column p").html(),h=f.replace(/<[^>]+>/g,""),c=$("#wvInlineVideoContainer").find(".caption"),w=$(this).attr("data-video-type");s.setAttribute("id",i);$("#wvInlineVideoWrapper").children().children().html(s);c.find("h1,h2").find("span.video-title").html(u);c.find("p").html(f);var b=[location.protocol,"//",location.host,location.pathname].join(""),k=location.pathname.split("/"),d=location.pathname.split("/")[k.length-2];history.pushState(null,r+" | Videos | Viking Cruises",b.replace(d,v));t.updateSeoVideoParam(u,f,o,"https://youtu.be/"+e,y,p);$('link[rel="canonical"]').attr("href",window.location.href);document.title=r+" | Videos | Viking Cruises";$('meta[name="description"]').attr("content",h);$('meta[property="og:description"]').attr("content",h);$('meta[property="og:title"]').attr("content",r+" | Videos | Viking Cruises");$('meta[property="og:image"]').attr("content",o);$('meta[name="pageuri"]').attr("content",a);w==="vimeo"&&(l=$(this).attr("data-vimeo2-id"),l&&$("#vimeoInlineVideoContainer").attr("title",r));t.initVideo(!0);typeof n=="function"&&n(e)})};t.initSingleVideoHandlers=function(){var i=$(t.element).attr("data-target-id"),n=document.createElement("div");n.setAttribute("id",i);$("#wvInlineVideoWrapper").children().children().html(n);t.initVideo(!0,!0)};t.initSingleVideo=function(){t.initSingleVideoHandlers()};t.init=function(n){typeof n=="function"?t.initSingleHandlers(n):t.initHandlers()};t.onPlay=function(){typeof InlineVideo.activeIndex!="undefined"&&InlineVideo.activeIndex!==-1&&InlineVideo.all[InlineVideo.activeIndex].pauseVideo();InlineVideo.activeIndex=t.componentIndex};t.onNotPlay=function(){InlineVideo.activeIndex===t.componentIndex&&(InlineVideo.activeIndex=-1)};t.setIsMediaCapable=function(){typeof s!="undefined"&&typeof s.Media!="undefined"&&typeof s.Media.open=="function"&&typeof s.Media.play=="function"&&typeof s.Media.stop=="function"&&typeof s.Media.close=="function"&&(t.isMediaCapable=!0)};t.setOmniture=function(n){if(typeof s!="undefined")if(n){var t=n.replace(/<[^>]+>/g,"");typeof s.channel!="undefined"&&(s.pageName=s.channel+":"+t);s.eVar16=t;s.prop36=t;s.eVar51=t}else s.eVar16="[No MediaName Set]"};t.pauseAll=function(){};t.onPlayerStateChange=function(n){var i,r;if(t.initTealiumTracking(n),n.data===YT.PlayerState.ENDED&&n.target.playVideo(),n.data!==YT.PlayerState.PLAYING&&t.onNotPlay(),n.data===YT.PlayerState.UNSTARTED&&t.playerHasStarted&&t.isMediaCapable&&t.isPlayerInited()&&typeof t.player.getCurrentTime=="function"&&(t.playerHasStarted=!1,s.Media.stop(t.mediaName,t.player.getCurrentTime()),modalsLogger.log("GA EVENT: STOP"),typeof ga!="undefined"&&ga("send","event","Video","stop",t.mediaName),t.isPaused=!0),n.data===YT.PlayerState.PLAYING&&(t.isFirstRun?t.isFirstRun=!1:t.onPlay(),t.playerInteraction=!0),n.data!==!YT.PlayerState.PLAYING||t.done||(t.stopVideo(),modalsLogger.log("GA EVENT: STOP"),typeof ga!="undefined"&&ga("send","event","Video","stop",t.mediaName)),n.data===YT.PlayerState.CUED&&(console.log("CUED"),modalsLogger.log("GA EVENT: OPEN"),typeof ga!="undefined"&&ga("send","event","Video","open",t.mediaName)),n.data===YT.PlayerState.PLAYING){if(t.isMediaCapable===!1||t.isPlayerInited()===!1||typeof t.player.getCurrentTime!="function"||typeof t.player.getDuration!="function")return null;t.playerHasStarted===!1?(i=t.player.getDuration(),i>0&&(t.pauseAll(),t.setOmniture(t.mediaName,"from playing 2"),s.Media.open(t.mediaName,i,t.mediaPlayerName),modalsLogger.log("GA EVENT: OPEN"),typeof ga!="undefined"&&(ga("send","event","Video","open",t.mediaName),ga("set","dimension5",t.mediaName)),s.Media.play(t.mediaName,0),t.playerHasStarted=!0)):(t.pauseAll(),r=t.player.getCurrentTime(),s.Media.play(t.mediaName,r),modalsLogger.log("GA EVENT: PLAY"),typeof ga!="undefined"&&ga("send","event","Video","play",t.mediaName,Math.round(r)),t.isPaused=!1)}return n.data===YT.PlayerState.BUFFERING,n.data===YT.PlayerState.PAUSED&&t.playerHasStarted&&t.isMediaCapable&&t.isPlayerInited()&&typeof t.player.getCurrentTime=="function"&&(s.Media.stop(t.mediaName,t.player.getCurrentTime()),modalsLogger.log("GA EVENT: PAUSE"),typeof ga!="undefined"&&ga("send","event","Video","pause",t.mediaName,Math.round(t.player.getCurrentTime())),t.isPaused=!0),n.data===YT.PlayerState.ENDED&&t.playerHasStarted&&t.isMediaCapable&&t.isPlayerInited()&&(typeof t.player.getCurrentTime=="function"&&(s.Media.stop(t.mediaName,t.player.getCurrentTime()),typeof ga!="undefined"&&(ga("send","event","Video","end",t.mediaName),modalsLogger.log("GA EVENT: END"),ga("send","event","Video","watchedtime",t.mediaName,Math.round(t.player.getCurrentTime()))),s.Media.close(t.mediaName)),t.playerHasStarted=!1),!1};t.initTealiumTracking=function(n){var i=tealium.codify(t.videoPlayedPage),r=t.player.getDuration().toString();switch(n.data){case YT.PlayerState.PLAYING:t.trackMilestones();t.firstPlay||t.hasEnded||(t.firstPlay=!0,tealium.fireLinkEvent({event_name:"video_start",video_name:i,video_length:r,video_playhead:"0"}));break;case YT.PlayerState.PAUSED:t.hasEnded||(clearInterval(t.videoPlayerInterval),tealium.fireLinkEvent({event_name:"video_pause",video_name:i}));break;case YT.PlayerState.ENDED:t.hasEnded||(t.hasEnded=!0,tealium.fireLinkEvent({event_name:"video_100",video_name:i,video_length:r,video_playhead:r}))}};t.trackMilestones=function(){t.hasEnded||(t.videoPlayerInterval=setInterval(function(){var n=t.player.getCurrentTime(),i=t.player.getDuration(),r=parseInt((n/i*100).toFixed());t.parseMilestone(r,i.toString(),n.toString())},1e3))};t.trackVimeoMilestones=function(n){t.hasEnded||(t.videoPlayerInterval=setInterval(function(){n.getDuration().then(function(i){n.getCurrentTime().then(function(n){var r=parseInt(n/i*100).toFixed();t.parseMilestone(r,i.toString(),n.toString())})})},2e3))};t.parseMilestone=function(n,i,r){var u=t.milestones;n>=25&&u.indexOf("video_25")===-1?(u.push("video_25"),tealium.fireLinkEvent({event_name:"video_25",video_name:tealium.codify(t.videoPlayedPage),video_length:i,video_playhead:r})):n>=50&&u.indexOf("video_50")===-1?(u.push("video_50"),tealium.fireLinkEvent({event_name:"video_50",video_name:tealium.codify(t.videoPlayedPage),video_length:i,video_playhead:r})):n>=75&&u.indexOf("video_75")===-1&&(u.push("video_75"),tealium.fireLinkEvent({event_name:"video_75",video_name:tealium.codify(t.videoPlayedPage),video_length:i,video_playhead:r}))}};InlineVideo.all=[];InlineVideo.activeIndex=-1;var intervalDaemon=function(n,t){function o(n){return n&&{}.toString.call(n)==="[object Function]"}var r=0,u=0,f,i=[];i.push(75);i.push(50);i.push(25);i.push(10);var s=function(n){return n/u*100},e=function(){r!==0&&(modalsLogger.log("Interval Cleared"),window.clearInterval(r))},h=function(){var h,a,r,c,l;typeof t!="undefined"&&t!==null&&o(t.getPlayerState)&&(h=n.mediaName,typeof h=="undefined"&&(h=n.MediaName),a=t.getPlayerState(),r=t.getCurrentTime(),u=t.getDuration(),a===YT.PlayerState.PLAYING)&&(r===f&&e(),f=r,c=s(r),modalsLogger.log(c),c>=i[i.length-1]&&(l=i.pop(),modalsLogger.log("GA PROGRESS EVENT: "+l),typeof ga!="undefined"&&ga("send","event","Video","video_progress_"+l+"perc",h,Math.round(r))))},c=function(){e();r=window.setInterval(h,2e3)};return{trackVideoProgress:c}},convertDurationToISO8601=function(n){try{var t=n.split(":"),i=t.length>0?parseInt(t[t.length-1]):0,r=t.length>1?parseInt(t[t.length-2]):0,u=t.length>2?parseInt(t[t.length-3]):0;return"PT"+(u>0?u+"H":"")+(r>0?r+"M":"")+(i>0?i+"S":"")}catch(f){return null}},resizeTimer,slideShowRunning=!1,videoStarted=!1;$(window).on("load",function(){window.matchMedia("(max-width: 1023px)").matches&&initSlideshow();$(".inline-single-video").each(function(){var n=new InlineVideo(this);n.initSingleVideo()});setSidebarHeight();$(".inline-single-video-trigger").each(function(){var n=new InlineVideo(this);n.init(videoCallback)});setRelatedHeader()});$(window).on("resize",function(){clearTimeout(resizeTimer);resizeTimer=setTimeout(function(){if(destroySlideshow(),window.matchMedia("(max-width: 1023px)").matches)initSlideshow(),$(".thumbnails").css("maxHeight","100%");else if($(".thumbnails").length>0){var n=window.matchMedia("(max-width: 1365px)").matches?144:160,t=$(".videos-page-container > section").height()-n;$(".thumbnails").css("maxHeight",t)}},150)});(function(n){"use strict";function t(n){return(n||"").toLowerCase()}var i="2.1.6";n.fn.cycle=function(i){var r;return this.length===0&&!n.isReady?(r={s:this.selector,c:this.context},n.fn.cycle.log("requeuing slideshow (dom not ready)"),n(function(){n(r.s,r.c).cycle(i)}),this):this.each(function(){var f,r,h,o,u=n(this),s=n.fn.cycle.log,e;if(!u.data("cycle.opts")){(u.data("cycle-log")===!1||i&&i.log===!1||r&&r.log===!1)&&(s=n.noop);s("--c2 init--");f=u.data();for(e in f)f.hasOwnProperty(e)&&/^cycle[A-Z]+/.test(e)&&(o=f[e],h=e.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),s(h+":",o,"("+typeof o+")"),f[h]=o);r=n.extend({},n.fn.cycle.defaults,f,i||{});r.timeoutId=0;r.paused=r.paused||!1;r.container=u;r._maxZ=r.maxZ;r.API=n.extend({_container:u},n.fn.cycle.API);r.API.log=s;r.API.trigger=function(n,t){return r.container.trigger(n,t),r.API};u.data("cycle.opts",r);u.data("cycle.API",r.API);r.API.trigger("cycle-bootstrap",[r,r.API]);r.API.addInitialSlides();r.API.preInitSlideshow();r.slides.length&&r.API.initSlideshow()}})};n.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var t=this.opts(),i=t.slides;t.slideCount=0;t.slides=n();i=i.jquery?i:t.container.find(i);t.random&&i.sort(function(){return Math.random()-.5});t.API.add(i)},preInitSlideshow:function(){var t=this.opts(),i;t.API.trigger("cycle-pre-initialize",[t]);i=n.fn.cycle.transitions[t.fx];i&&n.isFunction(i.preInit)&&i.preInit(t);t._preInitialized=!0},postInitSlideshow:function(){var t=this.opts(),i;t.API.trigger("cycle-post-initialize",[t]);i=n.fn.cycle.transitions[t.fx];i&&n.isFunction(i.postInit)&&i.postInit(t)},initSlideshow:function(){var t=this.opts(),r=t.container,i;t.API.calcFirstSlide();t.container.css("position")=="static"&&t.container.css("position","relative");n(t.slides[t.currSlide]).css({opacity:1,display:"block",visibility:"visible"});t.API.stackSlides(t.slides[t.currSlide],t.slides[t.nextSlide],!t.reverse);t.pauseOnHover&&(t.pauseOnHover!==!0&&(r=n(t.pauseOnHover)),r.hover(function(){t.API.pause(!0)},function(){t.API.resume(!0)}));t.timeout&&(i=t.API.getSlideOpts(t.currSlide),t.API.queueTransition(i,i.timeout+t.delay));t._initialized=!0;t.API.updateView(!0);t.API.trigger("cycle-initialized",[t]);t.API.postInitSlideshow()},pause:function(t){var i=this.opts(),r=i.API.getSlideOpts(),u=i.hoverPaused||i.paused;t?i.hoverPaused=!0:i.paused=!0;u||(i.container.addClass("cycle-paused"),i.API.trigger("cycle-paused",[i]).log("cycle-paused"),r.timeout&&(clearTimeout(i.timeoutId),i.timeoutId=0,i._remainingTimeout-=n.now()-i._lastQueue,(i._remainingTimeout<0||isNaN(i._remainingTimeout))&&(i._remainingTimeout=undefined)))},resume:function(n){var t=this.opts(),i=!t.hoverPaused&&!t.paused;n?t.hoverPaused=!1:t.paused=!1;i||(t.container.removeClass("cycle-paused"),t.slides.filter(":animated").length===0&&t.API.queueTransition(t.API.getSlideOpts(),t._remainingTimeout),t.API.trigger("cycle-resumed",[t,t._remainingTimeout]).log("cycle-resumed"))},add:function(t,i){var r=this.opts(),e=r.slideCount,u=!1,f;n.type(t)=="string"&&(t=n.trim(t));n(t).each(function(){var u,t=n(this);i?r.container.prepend(t):r.container.append(t);r.slideCount++;u=r.API.buildSlideOpts(t);r.slides=i?n(t).add(r.slides):r.slides.add(t);r.API.initSlide(u,t,--r._maxZ);t.data("cycle.opts",u);r.API.trigger("cycle-slide-added",[r,u,t])});r.API.updateView(!0);u=r._preInitialized&&e<2&&r.slideCount>=1;u&&(r._initialized?r.timeout&&(f=r.slides.length,r.nextSlide=r.reverse?f-1:1,r.timeoutId||r.API.queueTransition(r)):r.API.initSlideshow())},calcFirstSlide:function(){var n=this.opts(),t;t=parseInt(n.startingSlide||0,10);(t>=n.slides.length||t<0)&&(t=0);n.currSlide=t;n.reverse?(n.nextSlide=t-1,n.nextSlide<0&&(n.nextSlide=n.slides.length-1)):(n.nextSlide=t+1,n.nextSlide==n.slides.length&&(n.nextSlide=0))},calcNextSlide:function(){var n=this.opts(),t;n.reverse?(t=n.nextSlide-1<0,n.nextSlide=t?n.slideCount-1:n.nextSlide-1,n.currSlide=t?0:n.nextSlide+1):(t=n.nextSlide+1==n.slides.length,n.nextSlide=t?0:n.nextSlide+1,n.currSlide=t?n.slides.length-1:n.nextSlide-1)},calcTx:function(t,i){var r=t,u;return r._tempFx?u=n.fn.cycle.transitions[r._tempFx]:i&&r.manualFx&&(u=n.fn.cycle.transitions[r.manualFx]),u||(u=n.fn.cycle.transitions[r.fx]),r._tempFx=null,this.opts()._tempFx=null,u||(u=n.fn.cycle.transitions.fade,r.API.log('Transition "'+r.fx+'" not found.  Using fade.')),u},prepareTx:function(n,t){var i=this.opts(),o,f,e,r,u;if(i.slideCount<2){i.timeoutId=0;return}(n&&(!i.busy||i.manualTrump)&&(i.API.stopTransition(),i.busy=!1,clearTimeout(i.timeoutId),i.timeoutId=0),i.busy)||(i.timeoutId!==0||n)&&(f=i.slides[i.currSlide],e=i.slides[i.nextSlide],r=i.API.getSlideOpts(i.nextSlide),u=i.API.calcTx(r,n),i._tx=u,n&&r.manualSpeed!==undefined&&(r.speed=r.manualSpeed),i.nextSlide!=i.currSlide&&(n||!i.paused&&!i.hoverPaused&&i.timeout)?(i.API.trigger("cycle-before",[r,f,e,t]),u.before&&u.before(r,f,e,t),o=function(){(i.busy=!1,i.container.data("cycle.opts"))&&(u.after&&u.after(r,f,e,t),i.API.trigger("cycle-after",[r,f,e,t]),i.API.queueTransition(r),i.API.updateView(!0))},i.busy=!0,u.transition?u.transition(r,f,e,t,o):i.API.doTransition(r,f,e,t,o),i.API.calcNextSlide(),i.API.updateView()):i.API.queueTransition(r))},doTransition:function(t,i,r,u,f){var e=t,o=n(i),s=n(r),h=function(){s.animate(e.animIn||{opacity:1},e.speed,e.easeIn||e.easing,f)};s.css(e.cssBefore||{});o.animate(e.animOut||{},e.speed,e.easeOut||e.easing,function(){o.css(e.cssAfter||{});e.sync||h()});e.sync&&h()},queueTransition:function(t,i){var r=this.opts(),u=i!==undefined?i:t.timeout;if(r.nextSlide===0&&--r.loop==0){r.API.log("terminating; loop=0");r.timeout=0;u?setTimeout(function(){r.API.trigger("cycle-finished",[r])},u):r.API.trigger("cycle-finished",[r]);r.nextSlide=r.currSlide;return}if(r.continueAuto!==undefined&&(r.continueAuto===!1||n.isFunction(r.continueAuto)&&r.continueAuto()===!1)){r.API.log("terminating automatic transitions");r.timeout=0;r.timeoutId&&clearTimeout(r.timeoutId);return}u&&(r._lastQueue=n.now(),i===undefined&&(r._remainingTimeout=t.timeout),r.paused||r.hoverPaused||(r.timeoutId=setTimeout(function(){r.API.prepareTx(!1,!r.reverse)},u)))},stopTransition:function(){var n=this.opts();n.slides.filter(":animated").length&&(n.slides.stop(!1,!0),n.API.trigger("cycle-transition-stopped",[n]));n._tx&&n._tx.stopTransition&&n._tx.stopTransition(n)},advanceSlide:function(n){var t=this.opts();return clearTimeout(t.timeoutId),t.timeoutId=0,t.nextSlide=t.currSlide+n,t.nextSlide<0?t.nextSlide=t.slides.length-1:t.nextSlide>=t.slides.length&&(t.nextSlide=0),t.API.prepareTx(!0,n>=0),!1},buildSlideOpts:function(i){var u=this.opts(),f,o,r=i.data()||{};for(var e in r)r.hasOwnProperty(e)&&/^cycle[A-Z]+/.test(e)&&(f=r[e],o=e.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),u.API.log("["+(u.slideCount-1)+"]",o+":",f,"("+typeof f+")"),r[o]=f);r=n.extend({},n.fn.cycle.defaults,u,r);r.slideNum=u.slideCount;try{delete r.API;delete r.slideCount;delete r.currSlide;delete r.nextSlide;delete r.slides}catch(s){}return r},getSlideOpts:function(t){var i=this.opts(),r,u;return t===undefined&&(t=i.currSlide),r=i.slides[t],u=n(r).data("cycle.opts"),n.extend({},i,u)},initSlide:function(t,i,r){var u=this.opts();i.css(t.slideCss||{});r>0&&i.css("zIndex",r);isNaN(t.speed)&&(t.speed=n.fx.speeds[t.speed]||n.fx.speeds._default);t.sync||(t.speed=t.speed/2);i.addClass(u.slideClass)},updateView:function(n,t){var i=this.opts(),r,u;i._initialized&&((r=i.API.getSlideOpts(),u=i.slides[i.currSlide],!n&&t!==!0&&(i.API.trigger("cycle-update-view-before",[i,r,u]),i.updateView<0))||(i.slideActiveClass&&i.slides.removeClass(i.slideActiveClass).eq(i.currSlide).addClass(i.slideActiveClass),n&&i.hideNonActive&&i.slides.filter(":not(."+i.slideActiveClass+")").css("visibility","hidden"),i.updateView===0&&setTimeout(function(){i.API.trigger("cycle-update-view",[i,r,u,n])},r.speed/(i.sync?2:1)),i.updateView!==0&&i.API.trigger("cycle-update-view",[i,r,u,n]),n&&i.API.trigger("cycle-update-view-after",[i,r,u])))},getComponent:function(t){var r=this.opts(),i=r[t];return typeof i=="string"?/^\s*[\>|\+|~]/.test(i)?r.container.find(i):n(i):i.jquery?i:n(i)},stackSlides:function(t,i,r){var u=this.opts(),f,e,o;if(t||(t=u.slides[u.currSlide],i=u.slides[u.nextSlide],r=!u.reverse),n(t).css("zIndex",u.maxZ),e=u.maxZ-2,o=u.slideCount,r){for(f=u.currSlide+1;f<o;f++)n(u.slides[f]).css("zIndex",e--);for(f=0;f<u.currSlide;f++)n(u.slides[f]).css("zIndex",e--)}else{for(f=u.currSlide-1;f>=0;f--)n(u.slides[f]).css("zIndex",e--);for(f=o-1;f>u.currSlide;f--)n(u.slides[f]).css("zIndex",e--)}n(i).css("zIndex",u.maxZ-1)},getSlideIndex:function(n){return this.opts().slides.index(n)}};n.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))};n.fn.cycle.version=function(){return"Cycle2: "+i};n.fn.cycle.transitions={custom:{},none:{before:function(n,t,i,r){n.API.stackSlides(i,t,r);n.cssBefore={opacity:1,visibility:"visible",display:"block"}}},fade:{before:function(t,i,r,u){var f=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,r,u);t.cssBefore=n.extend(f,{opacity:0,visibility:"visible",display:"block"});t.animIn={opacity:1};t.animOut={opacity:0}}},fadeout:{before:function(t,i,r,u){var f=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,r,u);t.cssBefore=n.extend(f,{opacity:1,visibility:"visible",display:"block"});t.animOut={opacity:0}}},scrollHorz:{before:function(n,t,i,r){n.API.stackSlides(t,i,r);var u=n.container.css("overflow","hidden").width();n.cssBefore={left:r?u:-u,top:0,opacity:1,visibility:"visible",display:"block"};n.cssAfter={zIndex:n._maxZ-2,left:0};n.animIn={left:0};n.animOut={left:r?-u:u}}}};n.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:undefined,manualSpeed:undefined,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0};n(document).ready(function(){n(n.fn.cycle.defaults.autoSelector).cycle()})})(jQuery),function(n){"use strict";function t(t,i){var f,o,e,r=i.autoHeight;if(r=="container")o=n(i.slides[i.currSlide]).outerHeight(),i.container.height(o);else if(i._autoHeightRatio)i.container.height(i.container.width()/i._autoHeightRatio);else if(r==="calc"||n.type(r)=="number"&&r>=0){if(e=r==="calc"?u(t,i):r>=i.slides.length?0:r,e==i._sentinelIndex)return;i._sentinelIndex=e;i._sentinel&&i._sentinel.remove();f=n(i.slides[e].cloneNode(!0));f.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel");f.css({position:"static",visibility:"hidden",display:"block"}).prependTo(i.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active");f.find("*").css("visibility","hidden");i._sentinel=f}}function u(t,i){var r=0,u=-1;return i.slides.each(function(t){var i=n(this).height();i>u&&(u=i,r=t)}),r}function i(t,i,r,u){var f=n(u).outerHeight();i.container.animate({height:f},i.autoHeightSpeed,i.autoHeightEasing)}function r(u,f){f._autoHeightOnResize&&(n(window).off("resize orientationchange",f._autoHeightOnResize),f._autoHeightOnResize=null);f.container.off("cycle-slide-added cycle-slide-removed",t);f.container.off("cycle-destroyed",r);f.container.off("cycle-before",i);f._sentinel&&(f._sentinel.remove(),f._sentinel=null)}n.extend(n.fn.cycle.defaults,{autoHeight:0,autoHeightSpeed:250,autoHeightEasing:null});n(document).on("cycle-initialized",function(u,f){function c(){t(u,f)}var o=f.autoHeight,s=n.type(o),h=null,e;if(s==="string"||s==="number"){f.container.on("cycle-slide-added cycle-slide-removed",t);f.container.on("cycle-destroyed",r);if(o=="container")f.container.on("cycle-before",i);else s==="string"&&/\d+\:\d+/.test(o)&&(e=o.match(/(\d+)\:(\d+)/),e=e[1]/e[2],f._autoHeightRatio=e);if(s!=="number"){f._autoHeightOnResize=function(){clearTimeout(h);h=setTimeout(c,50)};n(window).on("resize orientationchange",f._autoHeightOnResize)}setTimeout(c,30)}})}(jQuery),function(n){"use strict";n.extend(n.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}<\/div><div>{{desc}}<\/div>",captionModule:"caption"});n(document).on("cycle-update-view",function(t,i,r,u){if(i.captionModule==="caption")n.each(["caption","overlay"],function(){var t=this,f=r[t+"Template"],n=i.API.getComponent(t);n.length&&f?(n.html(i.API.tmpl(f,r,i,u)),n.show()):n.hide()})});n(document).on("cycle-destroyed",function(t,i){var r;n.each(["caption","overlay"],function(){var n=this,t=i[n+"Template"];i[n]&&t&&(r=i.API.getComponent("caption"),r.empty())})})}(jQuery),function(n){"use strict";var t=n.fn.cycle;n.fn.cycle=function(i){var r,f,u,e=n.makeArray(arguments);return n.type(i)=="number"?this.cycle("goto",i):n.type(i)=="string"?this.each(function(){var o;if(r=i,u=n(this).data("cycle.opts"),u===undefined){t.log('slideshow must be initialized before sending commands; "'+r+'" ignored');return}if(r=r=="goto"?"jump":r,f=u.API[r],n.isFunction(f))return o=n.makeArray(e),o.shift(),f.apply(u.API,o);t.log("unknown command: ",r)}):t.apply(this,arguments)};n.extend(n.fn.cycle,t);n.extend(t.API,{next:function(){var n=this.opts(),t;(!n.busy||n.manualTrump)&&((t=n.reverse?-1:1,n.allowWrap===!1&&n.currSlide+t>=n.slideCount)||(n.API.advanceSlide(t),n.API.trigger("cycle-next",[n]).log("cycle-next")))},prev:function(){var n=this.opts(),t;(!n.busy||n.manualTrump)&&((t=n.reverse?1:-1,n.allowWrap===!1&&n.currSlide+t<0)||(n.API.advanceSlide(t),n.API.trigger("cycle-prev",[n]).log("cycle-prev")))},destroy:function(){this.stop();var t=this.opts(),i=n.isFunction(n._data)?n._data:n.noop;clearTimeout(t.timeoutId);t.timeoutId=0;t.API.stop();t.API.trigger("cycle-destroyed",[t]).log("cycle-destroyed");t.container.removeData();i(t.container[0],"parsedAttrs",!1);t.retainStylesOnDestroy||(t.container.removeAttr("style"),t.slides.removeAttr("style"),t.slides.removeClass(t.slideActiveClass));t.slides.each(function(){var r=n(this);r.removeData();r.removeClass(t.slideClass);i(this,"parsedAttrs",!1)})},jump:function(n,t){var u,i=this.opts(),r;if(!i.busy||i.manualTrump){if(r=parseInt(n,10),isNaN(r)||r<0||r>=i.slides.length){i.API.log("goto: invalid slide index: "+r);return}if(r==i.currSlide){i.API.log("goto: skipping, already on slide",r);return}i.nextSlide=r;clearTimeout(i.timeoutId);i.timeoutId=0;i.API.log("goto: ",r," (zero-index)");u=i.currSlide<i.nextSlide;i._tempFx=t;i.API.prepareTx(!0,u)}},stop:function(){var t=this.opts(),i=t.container;clearTimeout(t.timeoutId);t.timeoutId=0;t.API.stopTransition();t.pauseOnHover&&(t.pauseOnHover!==!0&&(i=n(t.pauseOnHover)),i.off("mouseenter mouseleave"));t.API.trigger("cycle-stopped",[t]).log("cycle-stopped")},reinit:function(){var n=this.opts();n.API.destroy();n.container.cycle()},remove:function(t){for(var i=this.opts(),r,u,e=[],o=1,f=0;f<i.slides.length;f++)r=i.slides[f],f==t?u=r:(e.push(r),n(r).data("cycle.opts").slideNum=o,o++);u&&(i.slides=n(e),i.slideCount--,n(u).remove(),t==i.currSlide?i.API.advanceSlide(1):t<i.currSlide?i.currSlide--:i.currSlide++,i.API.trigger("cycle-slide-removed",[i,t,u]).log("cycle-slide-removed"),i.API.updateView())}});n(document).on("click.cycle","[data-cycle-cmd]",function(t){t.preventDefault();var i=n(this),r=i.data("cycle-cmd"),u=i.data("cycle-context")||".cycle-slideshow";n(u).cycle(r,i.data("cycle-arg"))})}(jQuery),function(n){"use strict";function t(t,i){var r;if(t._hashFence){t._hashFence=!1;return}r=window.location.hash.substring(1);t.slides.each(function(u){if(n(this).data("cycle-hash")==r){if(i===!0)t.startingSlide=u;else{var f=t.currSlide<u;t.nextSlide=u;t.API.prepareTx(!0,f)}return!1}})}n(document).on("cycle-pre-initialize",function(i,r){t(r,!0);r._onHashChange=function(){t(r,!1)};n(window).on("hashchange",r._onHashChange)});n(document).on("cycle-update-view",function(n,t,i){i.hash&&"#"+i.hash!=window.location.hash&&(t._hashFence=!0,window.location.hash=i.hash)});n(document).on("cycle-destroyed",function(t,i){i._onHashChange&&n(window).off("hashchange",i._onHashChange)})}(jQuery),function(n){"use strict";n.extend(n.fn.cycle.defaults,{loader:!1});n(document).on("cycle-bootstrap",function(t,i){function u(t,u){function s(t){var o;i.loader=="wait"?(e.push(t),f===0&&(e.sort(h),r.apply(i.API,[e,u]),i.container.removeClass("cycle-loading"))):(o=n(i.slides[i.currSlide]),r.apply(i.API,[t,u]),o.show(),i.container.removeClass("cycle-loading"))}function h(n,t){return n.data("index")-t.data("index")}var e=[],o,f;if(n.type(t)=="string")t=n.trim(t);else if(n.type(t)==="array")for(o=0;o<t.length;o++)t[o]=n(t[o])[0];(t=n(t),f=t.length,f)&&(t.css("visibility","hidden").appendTo("body").each(function(t){function l(){--c==0&&(--f,s(o))}var c=0,o=n(this),h=o.is("img")?o:o.find("img");if(o.data("index",t),h=h.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])'),!h.length){--f;e.push(o);return}c=h.length;h.each(function(){if(this.complete)l();else n(this).load(function(){l()}).on("error",function(){--c==0&&(i.API.log("slide skipped; img not loaded:",this.src),--f==0&&i.loader=="wait"&&r.apply(i.API,[e,u]))})})}),f&&i.container.addClass("cycle-loading"))}var r;i.loader&&(r=i.API.add,i.API.add=u)})}(jQuery),function(n){"use strict";function t(t,i,r){var u,f=t.API.getComponent("pager");f.each(function(){var f=n(this),e;i.pagerTemplate?(e=t.API.tmpl(i.pagerTemplate,i,t,r[0]),u=n(e).appendTo(f)):u=f.children().eq(t.slideCount-1);u.on(t.pagerEvent,function(n){t.pagerEventBubble||n.preventDefault();t.API.page(f,n.currentTarget)})})}function i(n,t){var i=this.opts();if(!i.busy||i.manualTrump){var u=n.children().index(t),r=u,f=i.currSlide<r;i.currSlide!=r&&(i.nextSlide=r,i._tempFx=i.pagerFx,i.API.prepareTx(!0,f),i.API.trigger("cycle-pager-activated",[i,n,t]))}}n.extend(n.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerEventBubble:undefined,pagerTemplate:"<span>&bull;<\/span>"});n(document).on("cycle-bootstrap",function(n,i,r){r.buildPagerLink=t});n(document).on("cycle-slide-added",function(n,t,r,u){t.pager&&(t.API.buildPagerLink(t,r,u),t.API.page=i)});n(document).on("cycle-slide-removed",function(t,i,r){if(i.pager){var u=i.API.getComponent("pager");u.each(function(){var t=n(this);n(t.children()[r]).remove()})}});n(document).on("cycle-update-view",function(t,i){var r;i.pager&&(r=i.API.getComponent("pager"),r.each(function(){n(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass)}))});n(document).on("cycle-destroyed",function(n,t){var i=t.API.getComponent("pager");i&&(i.children().off(t.pagerEvent),t.pagerTemplate&&i.empty())})}(jQuery),function(n){"use strict";n.extend(n.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1});n(document).on("cycle-initialized",function(n,t){t.API.getComponent("next").on(t.nextEvent,function(n){n.preventDefault();t.API.next()});t.API.getComponent("prev").on(t.prevEvent,function(n){n.preventDefault();t.API.prev()});if(t.swipe){var i=t.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",r=t.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";t.container.on(i,function(){t._tempFx=t.swipeFx;t.API.next()});t.container.on(r,function(){t._tempFx=t.swipeFx;t.API.prev()})}});n(document).on("cycle-update-view",function(n,t){if(!t.allowWrap){var i=t.disabledClass,r=t.API.getComponent("next"),u=t.API.getComponent("prev"),f=t._prevBoundry||0,e=t._nextBoundry!==undefined?t._nextBoundry:t.slideCount-1;t.currSlide==e?r.addClass(i).prop("disabled",!0):r.removeClass(i).prop("disabled",!1);t.currSlide===f?u.addClass(i).prop("disabled",!0):u.removeClass(i).prop("disabled",!1)}});n(document).on("cycle-destroyed",function(n,t){t.API.getComponent("prev").off(t.nextEvent);t.API.getComponent("next").off(t.prevEvent);t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),function(n){"use strict";n.extend(n.fn.cycle.defaults,{progressive:!1});n(document).on("cycle-pre-initialize",function(t,i){if(i.progressive){var u=i.API,f=u.next,s=u.prev,e=u.prepareTx,h=n.type(i.progressive),r,o;if(h=="array")r=i.progressive;else if(n.isFunction(i.progressive))r=i.progressive(i);else if(h=="string"){if(o=n(i.progressive),r=n.trim(o.html()),!r)return;if(/^(\[)/.test(r))try{r=n.parseJSON(r)}catch(c){u.log("error parsing progressive slides",c);return}else r=r.split(new RegExp(o.data("cycle-split")||"\n")),r[r.length-1]||r.pop()}e&&(u.prepareTx=function(n,t){var f,u;if(n||r.length===0){e.apply(i.API,[n,t]);return}if(t&&i.currSlide==i.slideCount-1){u=r[0];r=r.slice(1);i.container.one("cycle-slide-added",function(n,t){setTimeout(function(){t.API.advanceSlide(1)},50)});i.API.add(u)}else if(t||i.currSlide!==0)e.apply(i.API,[n,t]);else{f=r.length-1;u=r[f];r=r.slice(0,f);i.container.one("cycle-slide-added",function(n,t){setTimeout(function(){t.currSlide=1;t.API.advanceSlide(-1)},50)});i.API.add(u,!0)}});f&&(u.next=function(){var n=this.opts(),t;if(r.length&&n.currSlide==n.slideCount-1){t=r[0];r=r.slice(1);n.container.one("cycle-slide-added",function(n,t){f.apply(t.API);t.container.removeClass("cycle-loading")});n.container.addClass("cycle-loading");n.API.add(t)}else f.apply(n.API)});s&&(u.prev=function(){var n=this.opts(),t,i;if(r.length&&n.currSlide===0){t=r.length-1;i=r[t];r=r.slice(0,t);n.container.one("cycle-slide-added",function(n,t){t.currSlide=1;t.API.advanceSlide(-1);t.container.removeClass("cycle-loading")});n.container.addClass("cycle-loading");n.API.add(i,!0)}else s.apply(n.API)})}})}(jQuery),function(n){"use strict";n.extend(n.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"});n.extend(n.fn.cycle.API,{tmpl:function(t,i){var u=new RegExp(i.tmplRegex||n.fn.cycle.defaults.tmplRegex,"g"),r=n.makeArray(arguments);return r.shift(),t.replace(u,function(t,i){for(var o,f,u,s=i.split("."),e=0;e<r.length;e++)if(f=r[e],f){if(s.length>1)for(u=f,o=0;o<s.length;o++)f=u,u=u[s[o]]||i;else u=f[i];if(n.isFunction(u))return u.apply(f,r);if(u!==undefined&&u!==null&&u!=i)return u}return i})}})}(jQuery);!function(n){"use strict";n.event.special.swipe=n.event.special.swipe||{scrollSupressionThreshold:10,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:75,setup:function(){var t=n(this);t.bind("touchstart",function(i){function f(t){if(r){var i=t.originalEvent.touches?t.originalEvent.touches[0]:t;u={time:(new Date).getTime(),coords:[i.pageX,i.pageY]};Math.abs(r.coords[0]-u.coords[0])>n.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()}}var u,e=i.originalEvent.touches?i.originalEvent.touches[0]:i,r={time:(new Date).getTime(),coords:[e.pageX,e.pageY],origin:n(i.target)};t.bind("touchmove",f).one("touchend",function(){t.unbind("touchmove",f);r&&u&&u.time-r.time<n.event.special.swipe.durationThreshold&&Math.abs(r.coords[0]-u.coords[0])>n.event.special.swipe.horizontalDistanceThreshold&&Math.abs(r.coords[1]-u.coords[1])<n.event.special.swipe.verticalDistanceThreshold&&r.origin.trigger("swipe").trigger(r.coords[0]>u.coords[0]?"swipeleft":"swiperight");r=u=void 0})})}};n.event.special.swipeleft=n.event.special.swipeleft||{setup:function(){n(this).bind("swipe",n.noop)}};n.event.special.swiperight=n.event.special.swiperight||n.event.special.swipeleft}(jQuery);!function(n){"use strict";n(document).on("cycle-bootstrap",function(n,t,i){"carousel"===t.fx&&(i.getSlideIndex=function(n){var t=this.opts()._carouselWrap.children(),i=t.index(n);return i%t.length},i.next=function(){var n=t.reverse?-1:1;t.allowWrap===!1&&t.currSlide+n>t.slideCount-t.carouselVisible||(t.API.advanceSlide(n),t.API.trigger("cycle-next",[t]).log("cycle-next"))})});n.fn.cycle.transitions.carousel={preInit:function(t){t.hideNonActive=!1;t.container.on("cycle-destroyed",n.proxy(this.onDestroy,t.API));t.API.stopTransition=this.stopTransition;for(var i=0;i<t.startingSlide;i++)t.container.append(t.slides[0])},postInit:function(t){var i,u,f,r,e=t.carouselVertical,o,s;if(t.carouselVisible&&t.carouselVisible>t.slideCount&&(t.carouselVisible=t.slideCount-1),o=t.carouselVisible||t.slides.length,s={display:e?"block":"inline-block",position:"static"},t.container.css({position:"relative",overflow:"hidden"}),t.slides.css(s),t._currSlide=t.currSlide,r=n('<div class="cycle-carousel-wrap"><\/div>').prependTo(t.container).css({margin:0,padding:0,top:0,left:0,position:"absolute"}).append(t.slides),t._carouselWrap=r,e||r.css("white-space","nowrap"),t.allowWrap!==!1){for(u=0;u<(void 0===t.carouselVisible?2:1);u++){for(i=0;i<t.slideCount;i++)r.append(t.slides[i].cloneNode(!0));for(i=t.slideCount;i--;)r.prepend(t.slides[i].cloneNode(!0))}r.find(".cycle-slide-active").removeClass("cycle-slide-active");t.slides.eq(t.startingSlide).addClass("cycle-slide-active")}t.pager&&t.allowWrap===!1&&(f=t.slideCount-o,n(t.pager).children().filter(":gt("+f+")").hide());t._nextBoundry=t.slideCount-t.carouselVisible;this.prepareDimensions(t)},prepareDimensions:function(t){var r,u,e,f,i=t.carouselVertical,o=t.carouselVisible||t.slides.length;if(t.carouselFluid&&t.carouselVisible?t._carouselResizeThrottle||this.fluidSlides(t):t.carouselVisible&&t.carouselSlideDimension?(r=o*t.carouselSlideDimension,t.container[i?"height":"width"](r)):t.carouselVisible&&(r=o*n(t.slides[0])[i?"outerHeight":"outerWidth"](!0),t.container[i?"height":"width"](r)),u=t.carouselOffset||0,t.allowWrap!==!1)if(t.carouselSlideDimension)u-=(t.slideCount+t.currSlide)*t.carouselSlideDimension;else for(e=t._carouselWrap.children(),f=0;f<t.slideCount+t.currSlide;f++)u-=n(e[f])[i?"outerHeight":"outerWidth"](!0);t._carouselWrap.css(i?"top":"left",u)},fluidSlides:function(t){function i(){clearTimeout(u);u=setTimeout(r,20)}function r(){t._carouselWrap.stop(!1,!0);var n=t.container.width()/t.carouselVisible;n=Math.ceil(n-e);t._carouselWrap.children().width(n);t._sentinel&&t._sentinel.width(n);o(t)}var u,f=t.slides.eq(0),e=f.outerWidth()-f.width(),o=this.prepareDimensions;n(window).on("resize",i);t._carouselResizeThrottle=i;r()},transition:function(t,i,r,u,f){var h,l={},e=t.nextSlide-t.currSlide,s=t.carouselVertical,a=t.speed,c,o;t.allowWrap===!1?(u=e>0,c=t._currSlide,o=t.slideCount-t.carouselVisible,e>0&&t.nextSlide>o&&c==o?e=0:e>0&&t.nextSlide>o?e=t.nextSlide-c-(t.nextSlide-o):0>e&&t.currSlide>o&&t.nextSlide>o?e=0:0>e&&t.currSlide>o?e+=t.currSlide-o:c=t.currSlide,h=this.getScroll(t,s,c,e),t.API.opts()._currSlide=t.nextSlide>o?o:t.nextSlide):u&&0===t.nextSlide?(h=this.getDim(t,t.currSlide,s),f=this.genCallback(t,u,s,f)):u||t.nextSlide!=t.slideCount-1?h=this.getScroll(t,s,t.currSlide,e):(h=this.getDim(t,t.currSlide,s),f=this.genCallback(t,u,s,f));l[s?"top":"left"]=u?"-="+h:"+="+h;t.throttleSpeed&&(a=h/n(t.slides[0])[s?"height":"width"]()*t.speed);t._carouselWrap.animate(l,a,t.easing,f)},getDim:function(t,i,r){var u=n(t.slides[i]);return u[r?"outerHeight":"outerWidth"](!0)},getScroll:function(n,t,i,r){var u,f=0;if(r>0)for(u=i;i+r>u;u++)f+=this.getDim(n,u,t);else for(u=i;u>i+r;u--)f+=this.getDim(n,u,t);return f},genCallback:function(t,i,r,u){return function(){var i=n(t.slides[t.nextSlide]).position(),f=0-i[r?"top":"left"]+(t.carouselOffset||0);t._carouselWrap.css(t.carouselVertical?"top":"left",f);u()}},stopTransition:function(){var n=this.opts();n.slides.stop(!1,!0);n._carouselWrap.stop(!1,!0)},onDestroy:function(){var t=this.opts();t._carouselResizeThrottle&&n(window).off("resize",t._carouselResizeThrottle);t.slides.prependTo(t.container);t._carouselWrap.remove()}}}(jQuery);!function(n,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(n)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(n.jQuery)}(this,function(n){!function(n){"use strict";function f(t){return n.each([{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}],function(){t=t?t.replace(this.re,this.ch):""}),t}function y(i,r){var f,e=arguments,u=i,s=r,o;return[].shift.apply(e),o=this.each(function(){var o=n(this),i,r,h,c;if(o.is("select")){if(i=o.data("selectpicker"),r="object"==typeof u&&u,i){if(r)for(h in r)r.hasOwnProperty(h)&&(i.options[h]=r[h])}else c=n.extend({},t.DEFAULTS,n.fn.selectpicker.defaults||{},o.data(),r),c.template=n.extend({},t.DEFAULTS.template,n.fn.selectpicker.defaults?n.fn.selectpicker.defaults.template:{},o.data().template,r.template),o.data("selectpicker",i=new t(this,c,s));"string"==typeof u&&(f=i[u]instanceof Function?i[u].apply(i,e):i.options[u])}}),void 0!==f?f:o}var l,e,a,o,s,v,h,i,u,c,r,t,p;String.prototype.includes||(l={}.toString,e=function(){try{var n={},t=Object.defineProperty,i=t(n,n,n)&&t}catch(r){}return i}(),a="".indexOf,o=function(n){var i;if(this==null)throw TypeError();if(i=String(this),n&&"[object RegExp]"==l.call(n))throw TypeError();var r=i.length,u=String(n),e=u.length,f=arguments.length>1?arguments[1]:void 0,t=f?Number(f):0;return t!=t&&(t=0),!(e+Math.min(Math.max(t,0),r)>r)&&-1!=a.call(i,u,t)},e?e(String.prototype,"includes",{value:o,configurable:!0,writable:!0}):String.prototype.includes=o);!String.prototype.startsWith&&(s=function(){try{var n={},t=Object.defineProperty,i=t(n,n,n)&&t}catch(r){}return i}(),v={}.toString,h=function(n){var r,u,i;if(this==null)throw TypeError();if(r=String(this),n&&"[object RegExp]"==v.call(n))throw TypeError();var f=r.length,e=String(n),o=e.length,s=arguments.length>1?arguments[1]:void 0,t=s?Number(s):0;if(t!=t&&(t=0),u=Math.min(Math.max(t,0),f),o+u>f)return!1;for(i=-1;++i<o;)if(r.charCodeAt(u+i)!=e.charCodeAt(i))return!1;return!0},s?s(String.prototype,"startsWith",{value:h,configurable:!0,writable:!0}):String.prototype.startsWith=h);Object.keys||(Object.keys=function(n,t,i){for(t in i=[],n)i.hasOwnProperty.call(n,t)&&i.push(t);return i});i={useDefault:!1,_set:n.valHooks.select.set};n.valHooks.select.set=function(t,r){return r&&!i.useDefault&&n(t).data("selected",!0),i._set.apply(this,arguments)};u=null;n.fn.triggerNative=function(n){var t,i=this[0];i.dispatchEvent?("function"==typeof Event?t=new Event(n,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(n,!0,!1),i.dispatchEvent(t)):i.fireEvent?((t=document.createEventObject()).eventType=n,i.fireEvent("on"+n,t)):this.trigger(n)};n.expr.pseudos.icontains=function(t,i,r){var u=n(t);return(u.data("tokens")||u.text()).toString().toUpperCase().includes(r[3].toUpperCase())};n.expr.pseudos.ibegins=function(t,i,r){var u=n(t);return(u.data("tokens")||u.text()).toString().toUpperCase().startsWith(r[3].toUpperCase())};n.expr.pseudos.aicontains=function(t,i,r){var u=n(t);return(u.data("tokens")||u.data("normalizedText")||u.text()).toString().toUpperCase().includes(r[3].toUpperCase())};n.expr.pseudos.aibegins=function(t,i,r){var u=n(t);return(u.data("tokens")||u.data("normalizedText")||u.text()).toString().toUpperCase().startsWith(r[3].toUpperCase())};c=function(n){var i=function(t){return n[t]},t="(?:"+Object.keys(n).join("|")+")",r=RegExp(t),u=RegExp(t,"g");return function(n){return n=null==n?"":""+n,r.test(n)?n.replace(u,i):n}};r=c({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"});c({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x60;":"`"});t=function(r,u,f){i.useDefault||(n.valHooks.select.set=i._set,i.useDefault=!0);f&&(f.stopPropagation(),f.preventDefault());this.$element=n(r);this.$newElement=null;this.$button=null;this.$menu=null;this.$lis=null;this.options=u;null===this.options.title&&(this.options.title=this.$element.attr("title"));var e=this.options.windowPadding;"number"==typeof e&&(this.options.windowPadding=[e,e,e,e]);this.val=t.prototype.val;this.render=t.prototype.render;this.refresh=t.prototype.refresh;this.setStyle=t.prototype.setStyle;this.selectAll=t.prototype.selectAll;this.deselectAll=t.prototype.deselectAll;this.destroy=t.prototype.destroy;this.remove=t.prototype.remove;this.show=t.prototype.show;this.hide=t.prototype.hide;this.init()};t.VERSION="1.12.0";t.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(n){return 1==n?"{0} item selected":"{0} items selected"},maxOptionsText:function(n,t){return[1==n?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==t?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:"glyphicon",tickIcon:"glyphicon-ok",showTick:!1,template:{caret:'<span class="caret"><\/span>'},maxOptions:!1,mobile:!1,selectOnTab:!0,dropdownAlignRight:!1,windowPadding:0};t.prototype={constructor:t,init:function(){var t=this,i=this.$element.attr("id");this.$element.addClass("bs-select-hidden");this.liObj={};this.multiple=this.$element.prop("multiple");this.autofocus=this.$element.prop("autofocus");this.$newElement=this.createView();this.$element.after(this.$newElement).appendTo(this.$newElement);this.$button=this.$newElement.children("button");this.$menu=this.$newElement.children(".dropdown-menu");this.$menuInner=this.$menu.children(".inner");this.$searchbox=this.$menu.find("input");this.$element.removeClass("bs-select-hidden");!0===this.options.dropdownAlignRight&&this.$menu.addClass("dropdown-menu-right");void 0!==i&&(this.$button.attr("data-id",i),this.$button.attr("id",i),this.$button.attr("aria-controls",i+"-listbox"),this.$menuInner.attr("id",i+"-listbox"),n('label[for="'+i+'"]').click(function(n){n.preventDefault();t.$button.focus()}));this.checkDisabled();this.clickListener();this.options.liveSearch&&this.liveSearchListener();this.render();this.setStyle();this.setWidth();this.options.container&&this.selectPosition();this.$menu.data("this",this);this.$newElement.data("this",this);this.options.mobile&&this.mobile();this.$newElement.on({"hide.bs.dropdown":function(n){t.$element.trigger("hide.bs.select",n)},"hidden.bs.dropdown":function(n){t.$element.trigger("hidden.bs.select",n);t.$button.focus()},"show.bs.dropdown":function(n){t.$element.trigger("show.bs.select",n)},"shown.bs.dropdown":function(n){t.$element.trigger("shown.bs.select",n);t.$menuInner.find(".selected [role=option]").focus()}});t.$element[0].hasAttribute("required")&&this.$element.on("invalid",function(){t.$button.addClass("bs-invalid").focus();t.$element.on({"focus.bs.select":function(){t.$button.focus();t.$element.off("focus.bs.select")},"shown.bs.select":function(){t.$element.val(t.$element.val()).off("shown.bs.select")},"rendered.bs.select":function(){this.validity.valid&&t.$button.removeClass("bs-invalid");t.$element.off("rendered.bs.select")}})});setTimeout(function(){t.$element.trigger("loaded.bs.select")})},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",i=this.$element.parent().hasClass("input-group")?" input-group-btn":"",u=this.autofocus?" autofocus":"",f=this.options.header?'<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;<\/button>'+this.options.header+"<\/div>":"",e=this.options.liveSearch?'<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+r(this.options.liveSearchPlaceholder)+'"')+' role="textbox" aria-label="Search"><\/div>':"",o=this.multiple&&this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn btn-default">'+this.options.selectAllText+'<\/button><button type="button" class="actions-btn bs-deselect-all btn btn-default">'+this.options.deselectAllText+"<\/button><\/div><\/div>":"",s=this.multiple&&this.options.doneButton?'<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm btn-default">'+this.options.doneButtonText+"<\/button><\/div><\/div>":"";return n('<div class="btn-group bootstrap-select'+t+i+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" data-toggle="dropdown"'+u+' role="combobox" aria-haspopup="listbox" aria-expanded="false"><span class="filter-option pull-left"><\/span>&nbsp;<span class="bs-caret" aria-hidden="true">'+this.options.template.caret+'<\/span><\/button><div class="dropdown-menu open" role="presentation">'+f+e+o+'<ul tabindex="-1" class="dropdown-menu inner" role="listbox"><\/ul>'+s+"<\/div><\/div>")},createView:function(){var n=this.createDropdown(),t=this.createLi();return n.find("ul")[0].innerHTML=t,n},reloadLi:function(){var n=this.createLi();this.$menuInner[0].innerHTML=n},createLi:function(){var t=this,i=[],o=0,s=document.createElement("option"),u=-1,e=function(n,t,i,r){return'<li role="presentation"'+(void 0!==i&""!==i?' class="'+i+'"':"")+(void 0!==t&null!==t?' data-original-index="'+t+'"':"")+(void 0!==r&null!==r?'data-optgroup="'+r+'"':"")+">"+n+"<\/li>"},c=function(i,u,e,o){return'<a role="option"'+(void 0!==u?' class="'+u+'"':"")+(e?' style="'+e+'"':"")+(t.options.liveSearchNormalize?' data-normalized-text="'+f(r(n(i).html()))+'"':"")+(i?' id="combo-'+f(r(n(i).html())).replaceAll(" ","-").toLowerCase()+'"':"")+(void 0!==o||null!==o?' data-tokens="'+o+'"':"")+">"+i+'<span class="'+t.options.iconBase+" "+t.options.tickIcon+' check-mark"><\/span><\/a>'},h;return!this.options.title||this.multiple||(u--,this.$element.find(".bs-title-option").length)||(h=this.$element[0],s.className="bs-title-option",s.innerHTML=this.options.title,s.value="",h.insertBefore(s,h.firstChild),void 0===n(h.options[h.selectedIndex]).attr("selected")&&void 0===this.$element.data("selected")&&(s.selected=!0)),this.$element.find("option").each(function(f){var s=n(this),it,rt,p,ot,w,b,l,ut,k,ft;if(u++,!s.hasClass("bs-title-option")){var d=this.className||"",g=this.style.cssText,a=s.data("content")?s.data("content"):s.html(),nt=s.data("tokens")?s.data("tokens"):null,st=void 0!==s.data("subtext")?'<small class="text-muted">'+s.data("subtext")+"<\/small>":"",v=void 0!==s.data("icon")?'<span class="'+t.options.iconBase+" "+s.data("icon")+'"><\/span> ':"",h=s.parent(),tt="OPTGROUP"===h[0].tagName,et=tt&&h[0].disabled,y=this.disabled||et;if(""!==v&&y&&(v="<span>"+v+"<\/span>"),t.options.hideDisabled&&(y&&!tt||et)){u--;return}if(s.data("content")||(a=v+'<span class="text">'+a+st+"<\/span>"),tt&&!0!==s.data("divider")){if(t.options.hideDisabled&&y&&(void 0===h.data("allOptionsDisabled")&&(it=h.children(),h.data("allOptionsDisabled",it.filter(":disabled").length===it.length)),h.data("allOptionsDisabled"))){u--;return}if(rt=" "+h[0].className,0===s.index()&&(o+=1,p=h[0].label,ot=void 0!==h.data("subtext")?'<small class="text-muted">'+h.data("subtext")+"<\/small>":"",p=(h.data("icon")?'<span class="'+t.options.iconBase+" "+h.data("icon")+'"><\/span> ':"")+'<span class="text">'+r(p)+ot+"<\/span>",0!==f&&i.length>0&&(u++,i.push(e("",null,"divider",o+"div"))),u++,i.push(e(p,null,"dropdown-header"+rt,o))),t.options.hideDisabled&&y){u--;return}i.push(e(c(a,"opt "+d+rt,g,nt),f,"",o))}else if(!0===s.data("divider"))i.push(e("",f,"divider"));else if(!0===s.data("hidden"))i.push(e(c(a,d,g,nt),f,"hidden is-hidden"));else{if(w=this.previousElementSibling&&"OPTGROUP"===this.previousElementSibling.tagName,!w&&t.options.hideDisabled)for(b=n(this).prevAll(),l=0;l<b.length;l++)if("OPTGROUP"===b[l].tagName){for(ut=0,k=0;k<l;k++)ft=b[k],(ft.disabled||!0===n(ft).data("hidden"))&&ut++;ut===l&&(w=!0);break}w&&(u++,i.push(e("",null,"divider",o+"div")));i.push(e(c(a,d,g,nt),f))}t.liObj[f]=u}}),this.multiple||0!==this.$element.find("option:selected").length||this.options.title||this.$element.find("option").eq(0).prop("selected",!0).attr("selected","selected"),i.join("")},findLis:function(){return null==this.$lis&&(this.$lis=this.$menu.find("li")),this.$lis},render:function(t){var o,i=this,r,u,f,e;!1!==t&&this.$element.find("option").each(function(n){var t=i.findLis().eq(i.liObj[n]);i.setDisabled(n,this.disabled||"OPTGROUP"===this.parentNode.tagName&&this.parentNode.disabled,t);i.setSelected(n,this.selected,t)});this.togglePlaceholder();this.tabIndex();r=this.$element.find("option").map(function(){if(this.selected&&(!i.options.hideDisabled||!this.disabled&&("OPTGROUP"!==this.parentNode.tagName||!this.parentNode.disabled))){var r,t=n(this),u=t.data("icon")&&i.options.showIcon?'<i class="'+i.options.iconBase+" "+t.data("icon")+'"><\/i> ':"";return(r=i.options.showSubtext&&t.data("subtext")&&!i.multiple?' <small class="text-muted">'+t.data("subtext")+"<\/small>":"",void 0!==t.attr("title"))?t.attr("title"):t.data("content")&&i.options.showContent?t.data("content").toString():u+t.html()+r}}).toArray();u=this.multiple?r.join(this.options.multipleSeparator):r[0];this.multiple&&this.options.selectedTextFormat.indexOf("count")>-1&&(f=this.options.selectedTextFormat.split(">"),(f.length>1&&r.length>f[1]||1==f.length&&r.length>=2)&&(o=this.options.hideDisabled?", [disabled]":"",e=this.$element.find("option").not('[data-divider="true"], [data-hidden="true"]'+o).length,u=("function"==typeof this.options.countSelectedText?this.options.countSelectedText(r.length,e):this.options.countSelectedText).replace("{0}",r.length.toString()).replace("{1}",e.toString())));void 0==this.options.title&&(this.options.title=this.$element.attr("title"));"static"==this.options.selectedTextFormat&&(u=this.options.title);u||(u=void 0!==this.options.title?this.options.title:this.options.noneSelectedText);this.$button.children(".filter-option").html(u);this.$element.trigger("rendered.bs.select")},setStyle:function(n,t){this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""));var i=n||this.options.style;"add"==t?this.$button.addClass(i):"remove"==t?this.$button.removeClass(i):(this.$button.removeClass(this.options.style),this.$button.addClass(i))},liHeight:function(t){var b,y;if(t||!1!==this.options.size&&!this.sizeInfo){var o=document.createElement("div"),u=document.createElement("div"),e=document.createElement("ul"),l=document.createElement("li"),w=document.createElement("li"),a=document.createElement("a"),v=document.createElement("span"),s=this.options.header&&this.$menu.find(".popover-title").length>0?this.$menu.find(".popover-title")[0].cloneNode(!0):null,f=this.options.liveSearch?document.createElement("div"):null,h=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,c=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null;v.className="text";o.className=this.$menu[0].parentNode.className+" open";u.className="dropdown-menu open";e.className="dropdown-menu inner";l.className="divider";b=this.$element.attr("id")+"-list";(e.id=b,v.appendChild(document.createTextNode("Inner text")),a.appendChild(v),w.appendChild(a),e.appendChild(w),e.appendChild(l),s&&u.appendChild(s),f)&&(y=document.createElement("span"),f.className="bs-searchbox",y.className="form-control",f.appendChild(y),u.appendChild(f));h&&u.appendChild(h);u.appendChild(e);c&&u.appendChild(c);o.appendChild(u);document.body.appendChild(o);var k=a.offsetHeight,d=s?s.offsetHeight:0,g=f?f.offsetHeight:0,nt=h?h.offsetHeight:0,tt=c?c.offsetHeight:0,it=n(l).outerHeight(!0),i="function"==typeof getComputedStyle&&getComputedStyle(u),r=i?null:n(u),p={vert:parseInt(i?i.paddingTop:r.css("paddingTop"))+parseInt(i?i.paddingBottom:r.css("paddingBottom"))+parseInt(i?i.borderTopWidth:r.css("borderTopWidth"))+parseInt(i?i.borderBottomWidth:r.css("borderBottomWidth")),horiz:parseInt(i?i.paddingLeft:r.css("paddingLeft"))+parseInt(i?i.paddingRight:r.css("paddingRight"))+parseInt(i?i.borderLeftWidth:r.css("borderLeftWidth"))+parseInt(i?i.borderRightWidth:r.css("borderRightWidth"))},rt={vert:p.vert+parseInt(i?i.marginTop:r.css("marginTop"))+parseInt(i?i.marginBottom:r.css("marginBottom"))+2,horiz:p.horiz+parseInt(i?i.marginLeft:r.css("marginLeft"))+parseInt(i?i.marginRight:r.css("marginRight"))+2};document.body.removeChild(o);this.sizeInfo={liHeight:k,headerHeight:d,searchHeight:g,actionsHeight:nt,doneButtonHeight:tt,dividerHeight:it,menuPadding:p,menuExtras:rt}}},setSize:function(){var l,rt,ut;if(this.findLis(),this.liHeight(),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var r,k,f,a,e,s,h,v,i=this,t=this.$menu,d=this.$menuInner,o=n(window),ft=this.$newElement[0].offsetHeight,g=this.$newElement[0].offsetWidth,nt=this.sizeInfo.liHeight,y=this.sizeInfo.headerHeight,p=this.sizeInfo.searchHeight,w=this.sizeInfo.actionsHeight,b=this.sizeInfo.doneButtonHeight,et=this.sizeInfo.dividerHeight,c=this.sizeInfo.menuPadding,u=this.sizeInfo.menuExtras,tt=this.options.hideDisabled?".disabled":"",it=function(){var t,f=i.$newElement.offset(),u=n(i.options.container),r;i.options.container&&!u.is("body")?(t=u.offset(),t.top+=parseInt(u.css("borderTopWidth")),t.left+=parseInt(u.css("borderLeftWidth"))):t={top:0,left:0};r=i.options.windowPadding;e=f.top-t.top-o.scrollTop();s=o.height()-e-ft-t.top-r[2];h=f.left-t.left-o.scrollLeft();v=o.width()-h-g-t.left-r[1];e-=r[0];h-=r[3]};(it(),"auto"===this.options.size)?(l=function(){var o,tt=function(t,i){return function(r){return i?r.classList?r.classList.contains(t):n(r).hasClass(t):!(r.classList?r.classList.contains(t):n(r).hasClass(t))}},rt=i.$menuInner[0].getElementsByTagName("li"),l=Array.prototype.filter?Array.prototype.filter.call(rt,tt("hidden",!1)):i.$lis.not(".hidden"),ut=Array.prototype.filter?Array.prototype.filter.call(l,tt("dropdown-header",!0)):l.filter(".dropdown-header");it();r=s-u.vert;k=v-u.horiz;i.options.container?(t.data("height")||t.data("height",t.height()),f=t.data("height"),t.data("width")||t.data("width",t.width()),a=t.data("width")):(f=t.height(),a=t.width());i.options.dropupAuto&&i.$newElement.toggleClass("dropup",e>s&&r-u.vert<f);i.$newElement.hasClass("dropup")&&(r=e-u.vert);"auto"===i.options.dropdownAlignRight&&t.toggleClass("dropdown-menu-right",h>v&&k-u.horiz<a-g);o=l.length+ut.length>3?3*nt+u.vert-2:0;t.css({"max-height":r+"px",overflow:"hidden","min-height":o+y+p+w+b+"px"});d.css({"max-height":r-y-p-w-b-c.vert+"px","overflow-y":"auto","min-height":Math.max(o-c.vert,0)+"px"})},l(),this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize",l),o.off("resize.getSize scroll.getSize").on("resize.getSize scroll.getSize",l)):this.options.size&&"auto"!=this.options.size&&this.$lis.not(tt).length>this.options.size&&(rt=this.$lis.not(".divider").not(tt).children().slice(0,this.options.size).last().parent().index(),ut=this.$lis.slice(0,rt+1).filter(".divider").length,r=nt*this.options.size+ut*et+c.vert,i.options.container?(t.data("height")||t.data("height",t.height()),f=t.data("height")):f=t.height(),i.options.dropupAuto&&this.$newElement.toggleClass("dropup",e>s&&r-u.vert<f),t.css({"max-height":r+y+p+w+b+"px",overflow:"hidden","min-height":""}),d.css({"max-height":r-c.vert+"px","overflow-y":"auto","min-height":""}))}},setWidth:function(){if("auto"===this.options.width){this.$menu.css("min-width","0");var n=this.$menu.parent().clone().appendTo("body"),t=this.options.container?this.$newElement.clone().appendTo("body"):n,i=n.children(".dropdown-menu").outerWidth(),r=t.css("width","auto").children("button").outerWidth();n.remove();t.remove();this.$newElement.css("width",Math.max(i,r)+"px")}else"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width",""));this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement.removeClass("fit-width")},selectPosition:function(){this.$bsContainer=n('<div class="bs-container" />');var u,i,f,t=this,r=n(this.options.container),e=function(n){t.$bsContainer.addClass(n.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass("dropup",n.hasClass("dropup"));u=n.offset();r.is("body")?i={top:0,left:0}:(i=r.offset(),i.top+=parseInt(r.css("borderTopWidth"))-r.scrollTop(),i.left+=parseInt(r.css("borderLeftWidth"))-r.scrollLeft());f=n.hasClass("dropup")?0:n[0].offsetHeight;t.$bsContainer.css({top:u.top-i.top+f,left:u.left-i.left,width:n[0].offsetWidth})};this.$button.on("click",function(){var i=n(this);t.isDisabled()||(e(t.$newElement),t.$bsContainer.appendTo(t.options.container).toggleClass("open",!i.hasClass("open")).append(t.$menu))});n(window).on("resize scroll",function(){e(t.$newElement)});this.$element.on("hide.bs.select",function(){t.$menu.data("height",t.$menu.height());t.$bsContainer.detach()})},setSelected:function(n,t,i){i||(this.togglePlaceholder(),i=this.findLis().eq(this.liObj[n]));i.toggleClass("selected",t);i.children("a").attr("aria-selected",t)},setDisabled:function(n,t,i){i||(i=this.findLis().eq(this.liObj[n]));t?i.addClass("disabled").children("a").attr("href","#noscroll").attr("tabindex",-1):i.removeClass("disabled").children("a").attr("href","#noscroll").attr("tabindex",0).attr("aria-selected",!1)},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){var n=this;this.isDisabled()?(this.$newElement.addClass("disabled"),this.$button.addClass("disabled").attr("tabindex",-1)):(this.$button.hasClass("disabled")&&(this.$newElement.removeClass("disabled"),this.$button.removeClass("disabled")),-1!=this.$button.attr("tabindex")||this.$element.data("tabindex")||this.$button.removeAttr("tabindex"));this.$button.click(function(){return!n.isDisabled()})},togglePlaceholder:function(){var n=this.$element.val();this.$button.toggleClass("bs-placeholder",null===n||""===n||n.constructor===Array&&0===n.length)},tabIndex:function(){this.$element.data("tabindex")!==this.$element.attr("tabindex")&&-98!==this.$element.attr("tabindex")&&"-98"!==this.$element.attr("tabindex")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex")));this.$element.attr("tabindex",-98)},clickListener:function(){var t=this,i=n(document);i.data("spaceSelect",!1);this.$button.on("keyup",function(n){/(32)/.test(n.keyCode.toString(10))&&i.data("spaceSelect")&&(n.preventDefault(),i.data("spaceSelect",!1))});this.$button.on("click",function(){t.setSize()});this.$element.on("shown.bs.select",function(){var i,n;if(t.options.liveSearch||t.multiple){if(!t.multiple){if(i=t.liObj[t.$element[0].selectedIndex],"number"!=typeof i||!1===t.options.size)return;n=t.$lis.eq(i)[0].offsetTop-t.$menuInner[0].offsetTop;n=n-t.$menuInner[0].offsetHeight/2+t.sizeInfo.liHeight/2;t.$menuInner[0].scrollTop=n}}else t.$menuInner.find(".selected a").focus()});this.$menuInner.on("click","li a",function(i){var h=n(this),o=h.parent().data("originalIndex"),nt=t.$element.val(),tt=t.$element.prop("selectedIndex"),a=!0,p,w,g;if(t.multiple&&1!==t.options.maxOptions&&i.stopPropagation(),i.preventDefault(),!t.isDisabled()&&!h.parent().hasClass("disabled")){var c=t.$element.find("option"),e=c.eq(o),v=e.prop("selected"),y=e.parent("optgroup"),r=t.options.maxOptions,f=y.data("maxOptions")||!1;if(t.multiple){if((e.prop("selected",!v),t.setSelected(o,!v),h.blur(),!1!==r||!1!==f)&&(p=r<c.filter(":selected").length,w=f<y.find("option:selected").length,r&&p||f&&w))if(r&&1==r)c.prop("selected",!1),e.prop("selected",!0),t.$menuInner.find(".selected").removeClass("selected"),t.setSelected(o,!0);else if(f&&1==f)y.find("option:selected").prop("selected",!1),e.prop("selected",!0),g=h.parent().data("optgroup"),t.$menuInner.find('[data-optgroup="'+g+'"]').removeClass("selected"),t.setSelected(o,!0);else{var b="string"==typeof t.options.maxOptionsText?[t.options.maxOptionsText,t.options.maxOptionsText]:t.options.maxOptionsText,s="function"==typeof b?b(r,f):b,k=s[0].replace("{n}",r),d=s[1].replace("{n}",f),l=n('<div class="notify"><\/div>');s[2]&&(k=k.replace("{var}",s[2][r>1?0:1]),d=d.replace("{var}",s[2][f>1?0:1]));e.prop("selected",!1);t.$menu.append(l);r&&p&&(l.append(n("<div>"+k+"<\/div>")),a=!1,t.$element.trigger("maxReached.bs.select"));f&&w&&(l.append(n("<div>"+d+"<\/div>")),a=!1,t.$element.trigger("maxReachedGrp.bs.select"));setTimeout(function(){t.setSelected(o,!1)},10);l.delay(750).fadeOut(300,function(){n(this).remove()})}}else c.prop("selected",!1),e.prop("selected",!0),t.$menuInner.find(".selected").removeClass("selected").find("a").attr("aria-selected",!1),t.setSelected(o,!0);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.focus():t.options.liveSearch&&t.$searchbox.focus();a&&(nt!=t.$element.val()&&t.multiple||tt!=t.$element.prop("selectedIndex")&&!t.multiple)&&(u=[o,e.prop("selected"),v],t.$element.triggerNative("change"))}});this.$menu.on("click","li.disabled a, .popover-title, .popover-title :not(.close)",function(i){i.currentTarget==this&&(i.preventDefault(),i.stopPropagation(),t.options.liveSearch&&!n(i.target).hasClass("close")?t.$searchbox.focus():t.$button.focus())});this.$menuInner.on("click",".divider, .dropdown-header",function(n){n.preventDefault();n.stopPropagation();t.options.liveSearch?t.$searchbox.focus():t.$button.focus()});this.$menu.on("click",".popover-title .close",function(){t.$button.click()});this.$searchbox.on("click",function(n){n.stopPropagation()});this.$menu.on("click",".actions-btn",function(i){t.options.liveSearch?t.$searchbox.focus():t.$button.focus();i.preventDefault();i.stopPropagation();n(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()});this.$element.change(function(){t.render(!1);t.$element.trigger("changed.bs.select",u);u=null})},liveSearchListener:function(){var t=this,i=n('<li class="no-results"><\/li>');this.$button.on("click.dropdown.data-api",function(){t.$menuInner.find(".active").removeClass("active");t.$searchbox.val()&&(t.$searchbox.val(""),t.$lis.not(".is-hidden").removeClass("hidden"),i.parent().length&&i.remove());t.multiple||t.$menuInner.find(".selected").addClass("active");setTimeout(function(){t.$searchbox.focus()},10)});this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api",function(n){n.stopPropagation()});this.$searchbox.on("input propertychange",function(){var s,e,u,o;(t.$lis.not(".is-hidden").removeClass("hidden"),t.$lis.filter(".active").removeClass("active"),i.remove(),t.$searchbox.val())&&(e=t.$lis.not(".is-hidden, .divider, .dropdown-header"),(s=t.options.liveSearchNormalize?e.not(":a"+t._searchStyle()+'("'+f(t.$searchbox.val())+'")'):e.not(":"+t._searchStyle()+'("'+t.$searchbox.val()+'")')).length===e.length?(i.html(t.options.noneResultsText.replace("{0}",'"'+r(t.$searchbox.val())+'"')),t.$menuInner.append(i),t.$lis.addClass("hidden")):(s.addClass("hidden"),o=t.$lis.not(".hidden"),o.each(function(t){var i=n(this);i.hasClass("divider")?void 0===u?i.addClass("hidden"):(u&&u.addClass("hidden"),u=i):i.hasClass("dropdown-header")&&o.eq(t+1).data("optgroup")!==i.data("optgroup")?i.addClass("hidden"):u=null}),u&&u.addClass("hidden"),e.not(".hidden").first().addClass("active")))})},_searchStyle:function(){return{begins:"ibegins",startsWith:"ibegins"}[this.options.liveSearchStyle]||"icontains"},val:function(n){return void 0!==n?(this.$element.val(n),this.render(),this.$element):this.$element.val()},changeAll:function(t){var r,f;if(this.multiple){void 0===t&&(t=!0);this.findLis();var e=this.$element.find("option"),i=this.$lis.not(".divider, .dropdown-header, .disabled, .hidden"),o=i.length,u=[];if(t){if(i.filter(".selected").length===i.length)return}else if(0===i.filter(".selected").length)return;for(i.toggleClass("selected",t),r=0;r<o;r++)f=i[r].getAttribute("data-original-index"),u[u.length]=e.eq(f)[0];n(u).prop("selected",t);this.render(!1);this.togglePlaceholder();this.$element.triggerNative("change")}},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(n){(n=n||window.event)&&n.stopPropagation();this.$button.trigger("click")},keydown:function(t){var u,i,s,c,h,l,a,k,v,e=n(this),p=e.is("input")?e.parent().parent():e.parent(),r=p.data("this"),y=":not(.disabled, .hidden, .dropdown-header, .divider)",b={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},o,g,w,d;if(r.options.liveSearch&&(p=e.parent().parent()),r.options.container&&(p=r.$menu),u=n('[role="listbox"] li',p),!(v=r.$newElement.hasClass("open"))&&(t.keyCode>=48&&t.keyCode<=57||t.keyCode>=96&&t.keyCode<=105||t.keyCode>=65&&t.keyCode<=90)){r.options.container?r.$button.trigger("click"):(r.setSize(),r.$menu.parent().addClass("open"),v=!0);r.$searchbox.focus();return}(!r.options.liveSearch||(/(^9$|27)/.test(t.keyCode.toString(10))&&v&&(t.preventDefault(),t.stopPropagation(),r.$menuInner.click(),r.$button.focus()),u=n('[role="listbox"] li'+y,p),e.val()||/(38|40)/.test(t.keyCode.toString(10))||0!==u.filter(".active").length||(u=r.$menuInner.find("li"),u=r.options.liveSearchNormalize?u.filter(":a"+r._searchStyle()+"("+f(b[t.keyCode])+")"):u.filter(":"+r._searchStyle()+"("+b[t.keyCode]+")"))),u.length)&&(/(38|40)/.test(t.keyCode.toString(10))?(i=u.index(u.find("a").filter(":focus").parent()),c=u.filter(y).first().index(),h=u.filter(y).last().index(),s=u.eq(i).nextAll(y).eq(0).index(),l=u.eq(i).prevAll(y).eq(0).index(),a=u.eq(s).prevAll(y).eq(0).index(),r.options.liveSearch&&(u.each(function(t){n(this).hasClass("disabled")||n(this).data("index",t)}),i=u.index(u.filter(".active")),c=u.first().data("index"),h=u.last().data("index"),s=u.eq(i).nextAll().eq(0).data("index"),l=u.eq(i).prevAll().eq(0).data("index"),a=u.eq(s).prevAll().eq(0).data("index")),38==t.keyCode?(--i!=a&&i>l&&(i=l),i<c&&(i=c),i==u.length-1&&(i=h),r.$menu.parent().find("button").attr("aria-activedescendant",u.eq(i).find("a").attr("id"))):40==t.keyCode&&(-1==++i&&(i=0),i!=a&&i<s&&(i=s),i>h&&(i=h),r.$menu.parent().find("button").attr("aria-activedescendant",u.eq(i).find("a").attr("id"))),k=e.data("prevIndex"),38==t.keyCode?(r.options.liveSearch&&i--,i!=a&&i>l&&(i=l),i<c&&(i=c),i==k&&(i=h)):40==t.keyCode&&(r.options.liveSearch&&i++,-1==i&&(i=0),i!=a&&i<s&&(i=s),i>h&&(i=h),i==k&&(i=c)),e.data("prevIndex",i),r.options.liveSearch?(t.preventDefault(),e.hasClass("dropdown-toggle")||(u.removeClass("active").eq(i).addClass("active").children("a").focus(),e.focus())):u.eq(i).children("a").focus()):e.is("input")||(w=[],u.each(function(){n(this).hasClass("disabled")||n.trim(n(this).children("a").text().toLowerCase()).substring(0,1)!=b[t.keyCode]||w.push(n(this).index())}),o=n(document).data("keycount"),o++,n(document).data("keycount",o),(g=n.trim(n(":focus").text().toLowerCase()).substring(0,1))!=b[t.keyCode]?(o=1,n(document).data("keycount",o)):o>=w.length&&(n(document).data("keycount",0),o>w.length&&(o=1)),u.eq(w[o-1]).children("a").focus()),(/(13|32)/.test(t.keyCode.toString(10))||/(^9$)/.test(t.keyCode.toString(10))&&r.options.selectOnTab)&&v&&(r.options.liveSearch?/(32)/.test(t.keyCode.toString(10))||(r.$menuInner.find(".active a").click(),e.focus()):(d=n(":focus"),d.click(),d.focus(),t.preventDefault(),n(document).data("spaceSelect",!0)),n(document).data("keycount",0)),(/(^9$|27)/.test(t.keyCode.toString(10))&&v&&(r.multiple||r.options.liveSearch)||/(27)/.test(t.keyCode.toString(10))&&!v)&&(r.$menu.parent().removeClass("open"),r.options.container&&r.$newElement.removeClass("open"),r.$button.focus()))},mobile:function(){this.$element.addClass("mobile-device")},refresh:function(){this.$lis=null;this.liObj={};this.reloadLi();this.render();this.checkDisabled();this.liHeight(!0);this.setStyle();this.setWidth();this.$lis&&this.$searchbox.trigger("propertychange");this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove();this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove();this.$bsContainer?this.$bsContainer.remove():this.$menu.remove();this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker")}};p=n.fn.selectpicker;n.fn.selectpicker=y;n.fn.selectpicker.Constructor=t;n.fn.selectpicker.noConflict=function(){return n.fn.selectpicker=p,this};n(document).data("keycount",0).on("keydown.bs.select",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input',t.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input',function(n){n.stopPropagation()});n(window).on("load.bs.select.data-api",function(){n(".selectpicker").each(function(){var t=n(this);y.call(t,t.data())})})}(n)})