PageSourceSearch

https://www.greyhound.com.au/wp-content/themes/greyhound/assets/js/site.min.js?ver=1790300016

js greyhound.com.au collected 2026-10-02 04:35:16 UTC 73,239 bytes, 1 lines download raw bytes

1$=jQuery.noConflict();let vh=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${vh}px`),window.addEventListener("resize",()=>{let vh=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${vh}px`)}),resizeItems=function(){},$(window).on("load",function(){resizeItems(),setTimeout(function(){$("body a, body input[type='submit'], button").addClass("loaded")},1e3)}),$(document).ready(function(){resizeItems(),initStickyHeader(),initMegaMenus(),initMobileMenu(),initCartPlacement(),initSiteSearch(),initCustomSelects(),initStopScheduleMenus(),initDestinationsModule(),initStopsModule(),initTravelPassesModule(),initPackagesModule(),initInspirationModule(),initSearchRoutesModule(),initCoachTabs(),initLatestDealsCarousel(),initOurStoryTimeline(),initTravelCardsCarousel(),initTravelPassesMegaSlider(),initGuidesCardsCarousel(),initInspirationCardsCarousel(),initTextImageVideos(),initHeroVideos(),initFaqAccordions(),initResponsiveVideos(),initFooterAccordions()});var w=$(window).width();function initCoachTabs(){var tabGroups=document.querySelectorAll(".coach-tabs");Array.prototype.forEach.call(tabGroups,function(group){var tabs=Array.prototype.slice.call(group.querySelectorAll("[role='tab'][data-tab-target]")),panels=Array.prototype.slice.call(group.querySelectorAll("[role='tabpanel']")),select=group.querySelector(".coach-tabs__select");function activateTab(tab,shouldFocus){var panelId=tab.getAttribute("data-tab-target"),panel=panelId?document.getElementById(panelId):null;panel&&(tabs.forEach(function(item){var isActive=item===tab;item.classList.toggle("coach-tabs__tab--active",isActive),item.setAttribute("aria-selected",isActive?"true":"false"),item.setAttribute("tabindex",isActive?"0":"-1")}),panels.forEach(function(item){var isActive=item===panel;item.classList.toggle("is-active",isActive),item.hidden=!isActive}),select&&select.value!==panelId&&(select.value=panelId),shouldFocus&&tab.focus())}function findTabByHash(hash){var match=null;return tabs.forEach(function(tab){!match&&function(tab,hash){return!!hash&&(tab.getAttribute("data-tab-slug")===hash||tab.getAttribute("data-tab-target")===hash||tab.id===hash)}(tab,hash)&&(match=tab)}),match}function updateHash(tab){var slug=tab.getAttribute("data-tab-slug");if(slug&&window.history&&window.history.replaceState)try{window.history.replaceState(null,"","#"+slug)}catch(error){return}}function scrollGroupIntoView(){var container=group.closest&&group.closest(".coach-tabs-container")||group;if(container){var reduceMotion=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,rootStyles=window.getComputedStyle(document.documentElement),headerOffset=parseInt(rootStyles.getPropertyValue("--site-header-offset"),10)||0,top=container.getBoundingClientRect().top+window.pageYOffset-headerOffset-20;window.scrollTo({top:Math.max(0,top),behavior:reduceMotion?"auto":"smooth"})}}function selectTabFromHash(deferScroll){var target=findTabByHash((window.location.hash||"").replace(/^#/,""));target&&(activateTab(target,!1),deferScroll?window.setTimeout(scrollGroupIntoView,100):scrollGroupIntoView())}tabs.length&&panels.length&&"true"!==group.getAttribute("data-tabs-ready")&&(group.setAttribute("data-tabs-ready","true"),tabs.forEac
1h(function(tab,index){tab.setAttribute("tabindex","true"===tab.getAttribute("aria-selected")?"0":"-1"),tab.addEventListener("click",function(){activateTab(tab,!1),updateHash(tab)}),tab.addEventListener("keydown",function(event){var nextIndex=index;if("ArrowRight"===event.key||"ArrowDown"===event.key)nextIndex=(index+1)%tabs.length;else if("ArrowLeft"===event.key||"ArrowUp"===event.key)nextIndex=(index-1+tabs.length)%tabs.length;else if("Home"===event.key)nextIndex=0;else{if("End"!==event.key)return;nextIndex=tabs.length-1}event.preventDefault(),activateTab(tabs[nextIndex],!0)})}),select&&select.addEventListener("change",function(){var target=findTabByHash(select.value);target&&(activateTab(target,!1),updateHash(target))}),selectTabFromHash(!0),window.addEventListener("hashchange",function(){selectTabFromHash(!1)}))})}function initTextImageVideos(){var mediaItems=document.querySelectorAll(".text-image__video-media");function setMediaState(media,isPlaying){var button=media.querySelector(".text-image__play");media.classList.toggle("is-playing",isPlaying),button&&(button.setAttribute("aria-hidden",isPlaying?"true":"false"),button.setAttribute("tabindex",isPlaying?"-1":"0"))}function pauseOtherVideos(activeVideo){Array.prototype.forEach.call(mediaItems,function(media){var video=media.querySelector(".text-image__video");video&&video!==activeVideo&&!video.paused&&video.pause()})}mediaItems.length&&Array.prototype.forEach.call(mediaItems,function(media){if("true"!==media.getAttribute("data-video-ready")){var video=media.querySelector(".text-image__video"),button=media.querySelector(".text-image__play");video&&button&&(media.setAttribute("data-video-ready","true"),video.removeAttribute("controls"),button.setAttribute("aria-hidden","false"),button.addEventListener("click",function(){pauseOtherVideos(video),video.setAttribute("controls","controls");var playRequest=video.play();playRequest&&"function"==typeof playRequest.catch&&playRequest.catch(function(){video.removeAttribute("controls"),setMediaState(media,!1)})}),video.addEventListener("play",function(){pauseOtherVideos(video),setMediaState(media,!0)}),video.addEventListener("pause",function(){video.ended||(video.removeAttribute("controls"),video.load(),setMediaState(media,!1))}),video.addEventListener("ended",function(){video.removeAttribute("controls"),video.load(),setMediaState(media,!1)}))}})}function initHeroVideos(){var videos=document.querySelectorAll(".hero__video[data-embed-url]");if(videos.length){var desktopQuery=window.matchMedia("(min-width: 768px)");loadVideos(),desktopQuery.addEventListener?desktopQuery.addEventListener("change",loadVideos):desktopQuery.addListener(loadVideos)}function loadVideos(){desktopQuery.matches&&Array.prototype.forEach.call(videos,function(wrapper){if(!wrapper.querySelector("iframe")){var iframe=document.createElement("iframe");iframe.src=wrapper.getAttribute("data-embed-url"),iframe.setAttribute("allow","autoplay; fullscreen; picture-in-picture"),iframe.setAttribute("allowfullscreen",""),iframe.setAttribute("tabindex","-1"),iframe.setAttribute("title","Background video"),wrapper.appendChild(iframe)}})}}function initCustomSelects(){var selects=document.querySelectorAll("[data-custom-select], [data-explore-pass-duration]"),mobileQuery=window.matchMedia("(max-width: 767px)");function syncSelect(select,selectIndex){mobileQuery.matches?select.customSelectDestroy&&select.customSelectDestroy():function(select,selectIndex){if(!select.customSelectDestroy&&"true"!==select.getAttribute("data-custom-select-ready")&&select.options.length){var field=select.closest(".explore-cards__filter")||select.parentElement,label=select.getAttribute("aria-label")||"Select an option",baseId=select.id||"custom-select-"+(selectIndex+1),listId=baseId+"-listbox",customSelect=document.createElement("div"),button=document.createElement("button"),value=document.createElement("span"),list=document.createElement("ul");if(field){select.selectedIndex<0&&(select.selectedIndex=0),select.setAttribute("data-custom-select-ready","true"),select.setAttribute("aria-hidden","true"),select.setAttribute("tabindex","-1"),select.classList.add("custom-select__native"),field.classList.add("explore-cards__filter--enhanced"),customSelect.className="
1custom-select",button.className="custom-select__button",button.type="button",button.setAttribute("aria-haspopup","listbox"),button.setAttribute("aria-expanded","false"),button.setAttribute("aria-controls",listId),value.className="custom-select__value",button.appendChild(value),list.className="custom-select__list",list.id=listId,list.hidden=!0,list.setAttribute("role","listbox"),list.setAttribute("aria-label",label),Array.prototype.forEach.call(select.options,function(option,optionIndex){var item=document.createElement("li");item.className="custom-select__option",item.id=baseId+"-option-"+optionIndex,item.setAttribute("role","option"),item.setAttribute("tabindex","-1"),item.setAttribute("data-index",optionIndex),item.textContent=option.text,option.disabled&&item.setAttribute("aria-disabled","true"),list.appendChild(item)}),customSelect.appendChild(button),customSelect.appendChild(list),select.insertAdjacentElement("afterend",customSelect);var customOptions=Array.prototype.slice.call(list.querySelectorAll(".custom-select__option"));updateButtonLabel(),button.addEventListener("click",function(){setDropdownOpen(!customSelect.classList.contains("is-open"),!1)}),button.addEventListener("keydown",function(event){"ArrowDown"!==event.key&&"ArrowUp"!==event.key&&"Enter"!==event.key&&" "!==event.key&&"Spacebar"!==event.key||(event.preventDefault(),setDropdownOpen(!0,!0),"ArrowUp"===event.key&&setActiveOption(customOptions.length-1,!0))}),list.addEventListener("click",function(event){var option=event.target.closest(".custom-select__option");option&&"true"!==option.getAttribute("aria-disabled")&&selectOption(parseInt(option.getAttribute("data-index"),10))}),list.addEventListener("keydown",function(event){"ArrowDown"===event.key?(event.preventDefault(),moveActiveOption(1)):"ArrowUp"===event.key?(event.preventDefault(),moveActiveOption(-1)):"Home"===event.key?(event.preventDefault(),setActiveOption(0,!0)):"End"===event.key?(event.preventDefault(),setActiveOption(customOptions.length-1,!0)):"Enter"===event.key||" "===event.key||"Spacebar"===event.key?(event.preventDefault(),selectOption(getActiveIndex())):"Escape"===event.key?(event.preventDefault(),setDropdownOpen(!1,!0)):"Tab"===event.key&&setDropdownOpen(!1,!1)}),select.addEventListener("change",handleSelectChange),document.addEventListener("click",handleDocumentClick),select.customSelectDestroy=function(){setDropdownOpen(!1,!1),document.removeEventListener("click",handleDocumentClick),select.removeEventListener("change",handleSelectChange),customSelect.remove(),select.removeAttribute("data-custom-select-ready"),select.removeAttribute("aria-hidden"),select.removeAttribute("tabindex"),select.classList.remove("custom-select__native"),field.classList.remove("explore-cards__filter--enhanced","is-open"),delete select.customSelectDestroy}}}function updateButtonLabel(){var selectedOption=select.options[select.selectedIndex],selectedText=selectedOption?selectedOption.text:"";value.textContent=selectedText,button.setAttribute("aria-label",label+": "+selectedText),customOptions.forEach(function(option,optionIndex){var isSelected=optionIndex===select.selectedIndex;option.setAttribute("aria-selected",isSelected?"true":"false"),option.classList.toggle("is-selected",isSelected)})}function setActiveOption(index,shouldFocus){var option=customOptions[index];option&&"true"!==option.getAttribute("aria-disabled")&&(customOptions.forEach(function(item){item.classList.remove("is-active"),item.setAttribute("tabindex","-1")}),option.classList.add("is-active"),option.setAttribute("tabindex","0"),list.setAttribute("aria-activedescendant",option.id),shouldFocus&&option.focus())}function getActiveIndex(){var activeElement=document.activeElement,activeIndex=customOptions.indexOf(activeElement);return activeIndex>=0?activeIndex:Math.max(select.selectedIndex,0)}function moveActiveOption(direction){var nextIndex=getActiveIndex(),attempts=0;do{nextIndex=(nextIndex+direction+customOptions.length)%customOptions.length,attempts++}while("true"===customOptions[nextIndex].getAttribute("aria-disabled")&&attempts<customOptions.length);setActiveOption(nextIndex,!0)}function setDropdownOpen(isOpen,returnFocus){field.classList.toggle("is-open",isOpen),customSelect.classList.toggle("is-open",isOpen),button.setAttribute("aria-expanded",isOpen?"true":"false"),list.hidden=!isOpen,isOpen?setActiveOption(Math.max(select.selectedIndex,0),!0):(customOptions.forEach(function(option){option.classList.remove("is-active"),option.setAttribute("tabindex","-1")}),returnFocus&&button.focus())}function selectOption(index){select.options[index]&&!select.options[index].disabled&&(select.selectedIndex=index,updateButtonLabel(),select.dispatchEvent(new Event("change",{bubbles:!0})),setDropdownOpen(!1,!0))}function handleSelectChange(){updateButtonLabel()}function handleDocumentClick(event){field.contains(event.target)||setDropdownOpen(!1,!1)}}(select,selectIndex)}selects.length&&Array.prototype.forEach.call(selects,function(select,selectIndex){function handleBreakpointChange(){syncSelect(select,selectIndex)}syncSelect(select,selectIndex),"true"!==select.getAttribute("data-custom-select-breakpoint-ready")&&(select.setAttribute("data-custom-select-breakpoint-ready","true"),mobileQuery.addEventListener?mobileQuery.addEventListener("change",handleBreakpointChange):mobileQuery.addListener(handleBreakpointChange))})}function initStopScheduleMenus(){var menus=document.querySelectorAll("[data-stop-schedule]");if(menus.length){var allMenus=[];Array.prototype.forEach.call(menus,function(menu){if("true"!==menu.getAttribute("data-stop-schedule-ready")){var button=menu.querySelector(".stop-card__schedule"),list=menu.querySelector(".stop-card__schedule-list");if(button&&list){menu.setAttribute("data-stop-schedule-ready","true"),allMenus.push(menu);var links=Array.prototype.slice.call(list.querySelectorAll(".stop-card__schedule-link"));button.addEventListener("click",function(){menu.classList.contains("is-open")?closeMenu(menu,!1):openMenu(!1)}),button.addEventListener("keydown",function(event){"ArrowDown"===event.key?(event.preventDefault(),openMenu(!0)):"ArrowUp"===event.key&&(event.preventDefault(),openMenu(!1),links.length&&links[links.length-1].focus())}),list.addEventListener("keydown",function(event){var currentIndex=links.indexOf(document.activeElement);"ArrowDown"===event.key?(event.preventDefault(),links[(currentIndex+1+links.length)%links.length].focus()):"ArrowUp"===event.key?(event.preventDefault(),links[(currentIndex-1+links.length)%links.length].focus()):"Home"===event.key?(event.preventDefault(),links[0].focus()):"End"===event.key?(event.preventDefault(),links[links.length-1].focus()):"Escape"===event.key?(event.preventDefault(),closeMenu(menu,!0)):"Tab"===event.key&&closeMenu(menu,!1)})}}function openMenu(focusFirst){closeAllMenus(menu),menu.classList.add("is-open"),button.setAttribute("aria-expanded","true"),list.hidden=!1,focusFirst&&links.length&&links[0].focus()}}),document.addEventListener("click",function(event){allMenus.forEac
1h(function(menu){menu.contains(event.target)||closeMenu(menu,!1)})}),document.addEventListener("keydown",function(event){"Escape"===event.key&&closeAllMenus(null)})}function closeMenu(menu,returnFocus){if(menu.classList.contains("is-open")){menu.classList.remove("is-open");var button=menu.querySelector(".stop-card__schedule"),list=menu.querySelector(".stop-card__schedule-list");button&&(button.setAttribute("aria-expanded","false"),returnFocus&&button.focus()),list&&(list.hidden=!0)}}function closeAllMenus(except){allMenus.forEach(function(menu){menu!==except&&closeMenu(menu,!1)})}}function initDestinationsModule(){var $modules=$("[data-destinations-module]");$modules.length&&$modules.each(function(){var $module=$(this);if("true"!==$module.attr("data-destinations-ready")){var $list=$module.find("[data-destinations-list]").first(),$stateSelect=$module.find("[data-destinations-state]").first(),$message=$module.find("[data-destinations-message]").first(),isSlider="true"===$module.attr("data-destinations-slider"),maxCards=parseInt($module.attr("data-destinations-max-cards"),10)||0,$allCards=$();$list.length&&($module.attr("data-destinations-ready","true"),isSlider&&($allCards=$list.find(".travel-card").filter(function(){return!$(this).closest(".slick-slide").hasClass("slick-cloned")}).clone(!0,!0)),$stateSelect.length&&$stateSelect.on("change",applyFilter),applyFilter())}function getSelectedState(){return $stateSelect.length?$stateSelect.val():""}function cardMatches($card,selectedState){return!selectedState||-1!==($card.attr("data-state-ids")||"").split(",").indexOf(selectedState)}function setMessage(isEmpty){$message.length&&($message.text(isEmpty?"No destinations found.":""),isEmpty?$message.removeAttr("hidden"):$message.attr("hidden",!0))}function applySliderFilter(){var selectedState=getSelectedState(),$matches=$(),visibleCount=0;isSlider&&($.fn.slick&&$list.hasClass("slick-initialized")&&$list.slick("unslick"),$list.closest(".explore-cards__slider-wrap").children(".explore-cards__arrow").remove()),$allCards.each(function(){var $card=$(this);if(cardMatches($card,selectedState)&&!(maxCards&&visibleCount>=maxCards)){var $clone=$card.clone(!0,!0);$clone.removeAttr("hidden"),$matches=$matches.add($clone),visibleCount++}}),$list.empty().append($matches),setMessage(0===visibleCount),visibleCount&&initExploreCardsCarousel()}function applyFilter(){var selectedState,visibleCount;isSlider?applySliderFilter():(selectedState=getSelectedState(),visibleCount=0,$list.children(".travel-card").each(function(){var $card=$(this);cardMatches($card,selectedState)?($card.removeAttr("hidden"),visibleCount++):$card.attr("hidden",!0)}),setMessage(0===visibleCount))}})}function initStopsModule(){var $modules=$("[data-stops-module]");$modules.length&&$modules.each(function(){var $module=$(this);if("true"!==$module.attr("data-stops-ready")){var $list=$module.find("[data-stops-list]").first(),$stateSelect=$module.find("[data-stops-state]").first(),$searchInput=$module.find("[data-stops-search]").first(),$filterForm=$module.find("[data-stops-filter-form]").first(),$message=$module.find("[data-stops-message]").first();$list.length&&($module.attr("data-stops-ready","true"),$stateSelect.length&&$stateSelect.on("change",applyFilter),$searchInput.length&&$searchInput.on("input",applyFilter),$filterForm.length&&$filterForm.on("submit",function(event){event.preventDefault(),applyFilter()}),applyFilter())}function applyFilter(){var isEmpty,selectedState=$stateSelect.length?$stateSelect.val():"",search=$searchInput.length?$.trim($searchInput.val()).toLowerCase():"",visibleCount=0;$list.children(".stop-card").each(function(){var $card=$(this);!function($card,selectedState,search){return(!selectedState||-1!==($card.attr("data-state-ids")||"").split(",").indexOf(selectedState))&&(!search||-1!==($card.attr("data-stop-search")||"").toLowerCase().indexOf(search))}($card,selectedState,search)?$card.attr("hidden",!0):($card.removeAttr("hidden"),visibleCount++)}),isEmpty=0===visibleCount,$message.length&&($message.text(isEmpty?"No stops found.":""),isEmpty?$message.removeAttr("hidden"):$message.attr("hidden",!0))}})}function initTravelPassesModule(){var $modules=$("[data-travel-passes-module]");$modules.length&&$modules.each(function(){var $module=$(this);if("true"!==$module.attr("data-travel-passes-ready")){var parsedMaxCards=parseInt($module.attr("data-travel-passes-max-cards"),
110),maxCards=isNaN(parsedMaxCards)?0:Math.max(0,parsedMaxCards),$list=$module.find("[data-travel-passes-list]").first(),$durationSelect=$module.find("[data-travel-passes-duration]").first(),$filterForm=$module.find("[data-travel-passes-filter-form]").first(),$message=$module.find("[data-travel-passes-message]").first(),$afterCardTemplate=$module.find("[data-travel-passes-after-card-template]").first(),$initialAfterCard=$list.find("[data-travel-passes-after-card]").first(),afterCardHtml=$afterCardTemplate.length?$.trim($afterCardTemplate.html()):$initialAfterCard.length?$initialAfterCard.prop("outerHTML"):"";if($list.length){$module.attr("data-travel-passes-ready","true"),$initialAfterCard.remove();var $allCards=$list.children(".travel-card").clone(!0,!0);$durationSelect.length&&$durationSelect.on("change",function(){applyFilter()}),$filterForm.length&&$filterForm.on("submit",function(event){event.preventDefault(),applyFilter()}),applyFilter(!0)}}function cardMatches($card,threshold){if(!threshold)return!0;var matched=!1;return $.each(function($card){var raw=($card.attr("data-duration-days")||"").toString().split(","),days=[];return $.each(raw,function(index,value){var day=parseInt($.trim(value),10);isNaN(day)||days.push(day)}),days}($card),function(index,day){if(day>=threshold)return matched=!0,!1}),matched}function setMessage(isEmpty){$message.length&&($message.text(isEmpty?"No travel passes found.":""),$message.prop("hidden",!isEmpty))}function insertAfterCard(){var $afterCard,$visibleCards,insertIndex;$list.find("[data-travel-passes-after-card]").remove(),afterCardHtml&&($visibleCards=$list.children(".travel-card")).length&&($afterCard=function(){var $html=$($.parseHTML(afterCardHtml||"",document,!0)),$afterCard=$html.filter("[data-travel-passes-after-card]").first();return $afterCard.length||($afterCard=$html.find("[data-travel-passes-after-card]").first()),$afterCard}()).length&&(insertIndex=Math.min(2,$visibleCards.length-1),$visibleCards.eq(insertIndex).after($afterCard))}function applyFilter(isInitial){var threshold=$durationSelect.length&&parseInt($durationSelect.val(),10)||0,$matches=$(),count=0;if(isInitial&&!threshold&&!(maxCards&&$allCards.length>maxCards))return setMessage(0===$allCards.length),void insertAfterCard();$allCards.each(function(){var $card=$(this);cardMatches($card,threshold)&&(maxCards&&count>=maxCards||($matches=$matches.add($card.clone(!0,!0)),count++))}),$list.empty().append($matches),setMessage(0===count),insertAfterCard()}})}function initPackagesModule(){var $modules=$("[data-packages-module]");$modules.length&&$modules.each(function(){var $module=$(this);if("true"!==$module.attr("data-packages-ready")){var $list=$module.find("[data-packages-list]").first(),$stateSelect=$module.find("[data-packages-state]").first(),$filters=$module.find("[data-packages-filter]"),$filterForm=$module.find("[data-packages-filter-form]").first(),$message=$module.find("[data-packages-message]").first(),maxCards=parseInt($module.attr("data-packages-max-cards"),10)||0;if($list.length){$module.attr("data-packages-ready","true");var $allCards=$list.children(".travel-card").clone(!0,!0);$stateSelect.length&&$stateSelect.on("change",applyFilter),$module.on("click","[data-packages-filter]",function(event){event.preventDefault();var id=normalizeId($(this).attr("data-packages-type")),types=getSelectedTypes();if(id){var index=$.inArray(id,types);-1===index?types.push(id):types.splice(index,1)}else types=[];!function(types){$filters.each(function(){var $pill=$(this),id=normalizeId($pill.attr("data-packages-type")),isActive=id?-1!==$.inArray(id,types):!types.length;$pill.toggleClass("is-active",isActive),isActive?$pill.attr("aria-current","true"):$pill.removeAttr("aria-current")})}(types),applyFilter()}),$filterForm.length&&$filterForm.on("submit",function(event){event.preventDefault(),applyFilter()}),applyFilter(!0)}}function normalizeId(value){return value=$.trim((value||"").toString()),/^\d+$/.test(value)?String(parseInt(value,10)):""}function getCardIds($card,attr){var raw=($card.attr(attr)||"").toString().split(","),ids=[];return $.each(raw,function(index,value){var id=normalizeId(value);id&&ids.push(id)}),ids}function getSelectedTypes(){var types=[];return $filters.filter(".is-active").each(function(){var id=normalizeId($(this).attr("data-packages-type"));id&&-1===$.inArray(id,types)&&types.push(id)}),types}function setMessage(isEmpty){$message.length&&($message.text(isEmpty?"No packages found.":""),$message.prop("hidden",!isEmpty))}function applyFilter(isInitial){var state=$stateSelect.length?normalizeId($stateSelect.val()):"",types=getSelectedTypes(),$matches=$(),count=0;!isInitial||state||types.length||maxCards&&$allCards.length>maxCards?($allCards.each(function(){var $card=$(this);(function($card,state,types){if(state&&-1===$.inArray(state,getCardIds($card,"data-state-ids")))return!1;if(types.length){var cardTypes=getCardIds($card,"data-type-ids"),matched=!1;if($.each(types,function(index,typeId){if(-1!==$.inArray(typeId,cardTypes))return matched=!0,!1}),!matched)return!1}return!0})($card,state,types)&&(maxCards&&count>=maxCards||($matches=$matches.add($card.clone(!0,!0)),count++))}),$list.empty().append($matches),setMessage(0===count)):setMessage(0===$allCards.length)}})}
1function initInspirationModule(){var $modules=$("[data-inspiration-module]");$modules.length&&$modules.each(function(){var $module=$(this),$list=$module.find("[data-inspiration-list]").first(),$filters=$module.find("[data-inspiration-filter]"),$message=$module.find("[data-inspiration-message]").first(),activeRequest=null,requestToken=0,lastRequestKey="";function getAjaxConfig(){return"undefined"!=typeof php?php:{}}function getBaseUrl(){return $module.attr("data-inspiration-base-url")||window.location.href}function normalizeCategories(categoryIds){var values=Array.isArray(categoryIds)?categoryIds:(categoryIds||"").toString().split(","),seen={},normalized=[];return $.each(values,function(index,value){value=$.trim(value.toString()),/^\d+$/.test(value)&&(value=String(parseInt(value,10)),seen[value]||(seen[value]=!0,normalized.push(value)))}),normalized}function serializeCategories(categoryIds){return normalizeCategories(categoryIds).join(",")}function getSelectedCategories(){var selectedCategories=[];return $filters.filter(".is-active").each(function(){var categoryId=$(this).attr("data-inspiration-category")||"";categoryId&&selectedCategories.push(categoryId)}),serializeCategories(selectedCategories)}function buildCategoryUrl(categoryIds,page){var selectedCategories=serializeCategories(categoryIds);if("undefined"==typeof URL)return getBaseUrl();try{var url=new URL(getBaseUrl(),window.location.href);return url.searchParams.delete("inspiration_category"),url.searchParams.delete("pg_inspiration"),url.searchParams.delete("paged"),url.searchParams.delete("page"),selectedCategories&&url.searchParams.set("inspiration_category",selectedCategories),(page=parseInt(page,10)||1)>1&&url.searchParams.set("pg_inspiration",page),url.toString()}catch(error){return getBaseUrl()}}function updateLoadMore(loadMoreHtml){var $currentLoadMore=$module.find("[data-inspiration-load-more]").first(),$newLoadMore=function(loadMoreHtml){var $html=$($.parseHTML(loadMoreHtml||"",document,!0)),$loadMore=$html.filter("[data-inspiration-load-more]").first();return $loadMore.length||($loadMore=$html.find("[data-inspiration-load-more]").first()),$loadMore}(loadMoreHtml);$newLoadMore.length?$currentLoadMore.length?$currentLoadMore.replaceWith($newLoadMore):$message.length?$message.after($newLoadMore):$list.after($newLoadMore):$currentLoadMore.remove()}function setLoading($button,isLoading){$module.toggleClass("is-loading",isLoading),$button&&$button.length&&(isLoading?($button.data("inspiration-label")||$button.data("inspiration-label",$.trim($button.text())),$button.addClass("pagination-loading").text("Please wait..."),$button.attr("aria-disabled","true")):($button.removeClass("pagination-loading").text($button.data("inspiration-label")||"Load more"),$button.removeAttr("aria-disabled")))}function renderInspiration(data,shouldAppend){var message,isVisible,cardsHtml=data.cards_html||"";$.fn.slick&&$list.hasClass("slick-initialized")&&$list.slick("unslick"),shouldAppend?cardsHtml&&$list.append(cardsHtml):$list.html(cardsHtml),updateLoadMore(data.load_more_html||""),message=data.message||"No inspiration posts found.",isVisible=!$list.children(".inspiration-cards__slide").length,$message.length&&($message.text(message||""),$message.prop("hidden",!isVisible)),initInspirationCardsCarousel()}function requestInspiration(page,shouldAppend,categoryIds,$button){var requestKey,currentToken,ajaxUrl=getAjaxConfig().ajax_url||"",nonce=getAjaxConfig().inspiration_nonce||"";if(page=Math.max(1,parseInt(page,10)||1),categoryIds=serializeCategories(categoryIds),ajaxUrl&&nonce){if(!($button&&$button.length&&$button.hasClass("pagination-loading"))){if(requestKey=function(page,categoryIds,shouldAppend){return[page,serializeCategories(categoryIds),getBaseUrl(),shouldAppend?"append":"replace"].join("|")}(page,categoryIds,shouldAppend),activeRequest&&4!==activeRequest.readyState){if(lastRequestKey===requestKey)return;activeRequest.abort()}requestToken++,currentToken=requestToken,lastRequestKey=requestKey,setLoading($button,!0),activeRequest=$.ajax({url:ajaxUrl,method:"POST",dataType:"json",data:{action:"greyhound_filter_inspiration",nonce:nonce,page:page,inspiration_category:categoryIds,base_url:getBaseUrl()}}).done(function(response){response&&response.success&&response.data?currentToken===requestToken&&
1(renderInspiration(response.data,shouldAppend),shouldAppend||function(categoryIds){if(window.history&&window.history.replaceState)try{window.history.replaceState({},"",buildCategoryUrl(categoryIds,1))}catch(error){return}}(categoryIds)):window.location.href=buildCategoryUrl(categoryIds,page)}).fail(function(xhr,status){"abort"!==status&&(window.location.href=buildCategoryUrl(categoryIds,page))}).always(function(){currentToken===requestToken&&(setLoading($button,!1),activeRequest=null)})}}else window.location.href=buildCategoryUrl(categoryIds,page)}$list.length&&"true"!==$module.attr("data-inspiration-ready")&&($module.attr("data-inspiration-ready","true"),$module.on("click","[data-inspiration-filter]",function(event){var categoryId=$(this).attr("data-inspiration-category")||"",selectedCategories=categoryId?function(categoryId){var categoryIndex,selectedCategories=normalizeCategories(getSelectedCategories());return(categoryId=serializeCategories([categoryId]))?(-1===(categoryIndex=$.inArray(categoryId,selectedCategories))?selectedCategories.push(categoryId):selectedCategories.splice(categoryIndex,1),serializeCategories(selectedCategories)):""}(categoryId):"";event.preventDefault(),function(categoryIds){var selectedCategories=normalizeCategories(categoryIds);$filters.each(function(){var $filter=$(this),categoryId=$filter.attr("data-inspiration-category")||"",isActive=categoryId?-1!==$.inArray(categoryId,selectedCategories):!selectedCategories.length;$filter.toggleClass("is-active",isActive),isActive?$filter.attr("aria-current","true"):$filter.removeAttr("aria-current")})}(selectedCategories),requestInspiration(1,!1,selectedCategories,null)}),$module.on("click","[data-inspiration-load-more] a",function(event){var $button=$(this),selectedCategories=$button.attr("data-inspiration-category")||getSelectedCategories();event.preventDefault(),requestInspiration(function($button){var href,url,nextPage=parseInt($button.attr("data-inspiration-next-page"),10);if(nextPage)return nextPage;if(href=$button.attr("href"),"undefined"==typeof URL||!href)return 1;try{return url=new URL(href,window.location.href),parseInt(url.searchParams.get("pg_inspiration"),10)||1}catch(error){return 1}}($button),!0,selectedCategories,$button)}))})}function initSearchRoutesModule(){var modules=document.querySelectorAll("[data-search-routes-module]");function normalizeText(value){var text=(value||"").toString().toLowerCase();return text.normalize&&(text=text.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),text.trim()}modules.length&&Array.prototype.forEach.call(modules,function(module){if("true"!==module.getAttribute("data-search-routes-ready")){var list=module.querySelector("[data-search-routes-list]"),items=list?Array.prototype.slice.call(list.querySelectorAll("[data-search-routes-item]")):[],queryInput=module.querySelector("[data-search-routes-query]"),stateSelect=module.querySelector("[data-search-routes-state]"),loadMore=module.querySelector("[data-search-routes-load-more]"),message=module.querySelector("[data-search-routes-message]"),initialCount=parseInt(module.getAttribute("data-search-routes-initial-count"),10)||9,visibleLimit=Math.max(1,initialCount);list&&(module.setAttribute("data-search-routes-ready","true"),queryInput&&queryInput.addEventListener("input",resetRoutes),stateSelect&&stateSelect.addEventListener("change",resetRoutes),loadMore&&loadMore.addEventListener("click",function(){visibleLimit+=Math.max(1,initialCount),updateRoutes()}),updateRoutes())}function updateRoutes(){var isVisible,query=queryInput?normalizeText(queryInput.value):"",selectedState=stateSelect?stateSelect.value:"",matchedCount=0,visibleCount=0;items.forEach(function(item){var matches=function(item,query,selectedState){var searchableText=normalizeText(item.getAttribute("data-route-search")),stateIds=(item.getAttribute("data-route-state-ids")||"").split(","),matchesQuery=!query||-1!==searchableText.indexOf(query),matchesState=!selectedState||-1!==stateIds.indexOf(selectedState);return matchesQuery&&matchesState}(item,query,selectedState),isVisible=!1;matches&&(matchedCount++,visibleCount<visibleLimit&&(isVisible=!0,visibleCount++)),item.hidden=!isVisible}),isVisible=0===matchedCount,message&&(message.textContent=isVisible?"No routes found.":"",message.hidden=!isVisible),loadMore&&(loadMore.hidden=matchedCount<=visibleCount)}function resetRoutes(){visibleLimit=Math.max(1,initialCount),updateRoutes()}})}$(window).resize(function(){$(window).width()!=w&&(w=$(window).width(),resizeItems(),initExploreCardsCarousel(),initLatestDealsCarousel(),initOurStoryTimeline(),initTravelCardsCarousel(),initTravelPassesMegaSlider(),initGuidesCardsCarousel(),initInspirationCardsCarousel())}),$.fn.adjustHeight=function(){var maxHeightFound=0;this.css("min-height","1px"),this.is("a")&&this.removeClass("loaded"),this.each(function(){$(this).height()>maxHeightFound&&(maxHeightFound=$(this).height())}),this.css("min-height",maxHeightFound),this.is("a")&&this.addClass("loaded")},$.fn.adjustOuterHeight=function(){var maxHeightFound=0;this.is("a")&&this.removeClass("loaded"),this.css("min-height","1px"),this.each(function(){$(this).outerHeight(!0)>maxHeightFound&&(maxHeightFound=$(this).outerHeight(!0))}),this.css("min-height",maxHeightFound),this.is("a")&&this.addClass("loaded")},$.fn.setMinHeight=function(setCount){$this=this,this.css("min-height","1px"),this.find("a").removeClass("loaded");for(var i=0;i<this.length;i+=setCount){var curSet=this.slice(i,i+setCount),height=0;curSet.each(function(){height=Math.max(height,$(this).height())}
1).css("min-height",height)}return setTimeout(function(){$this.find("a").addClass("loaded")},200),this},$.fn.setMinOuterHeight=function(setCount,$boolean){void 0===$boolean&&($boolean=!1),$this=this,this.css("min-height","1px"),this.find("a").removeClass("loaded");for(var i=0;i<this.length;i+=setCount){var curSet=this.slice(i,i+setCount),height=0;curSet.each(function(){height=Math.max(height,$(this).outerHeight($boolean))}).css("min-height",height)}return setTimeout(function(){$this.find("a").addClass("loaded")},200),this},$.fn.isInViewport=function(){var elementTop=$(this).offset().top-70,elementBottom=elementTop+$(this).outerHeight(),viewportTop=$(window).scrollTop(),viewportBottom=viewportTop+$(window).height();return elementBottom>viewportTop&&elementTop<viewportBottom};var exploreCardsCarouselRetryTimer=null,exploreCardsCarouselRetryCount=0;function scheduleExploreCardsCarouselInit(){exploreCardsCarouselRetryTimer||exploreCardsCarouselRetryCount>=20||(exploreCardsCarouselRetryCount++,exploreCardsCarouselRetryTimer=setTimeout(function(){exploreCardsCarouselRetryTimer=null,initExploreCardsCarousel()},150))}function initExploreCardsCarousel(){var $destinationCarousel=$(".explore-cards-container--destination-slider .explore-cards__grid");if($destinationCarousel.length)if($.fn.slick){exploreCardsCarouselRetryCount=0;var arrowIcon='<svg width="29" height="20" viewBox="0 0 29 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M1.25 8.75C0.559644 8.75 0 9.30964 0 10C0 10.6904 0.559644 11.25 1.25 11.25V8.75ZM28.1339 10.8839C28.622 10.3957 28.622 9.60427 28.1339 9.11612L20.1789 1.16117C19.6908 0.67301 18.8993 0.67301 18.4112 1.16117C17.923 1.64932 17.923 2.44078 18.4112 2.92893L25.4822 10L18.4112 17.0711C17.923 17.5592 17.923 18.3507 18.4112 18.8388C18.8993 19.327 19.6908 19.327 20.1789 18.8388L28.1339 10.8839ZM1.25 10V11.25H27.25V10V8.75H1.25V10Z" fill="currentColor"/></svg>';$destinationCarousel.each(function(){var $this=$(this),$wrap=$this.closest(".explore-cards__slider-wrap"),isInitialized=$this.hasClass("slick-initialized");if(!($this.find(".travel-card").filter(function(){return!$(this).closest(".slick-slide").hasClass("slick-cloned")}).length>0))return isInitialized&&$this.slick("unslick"),void $wrap.children(".explore-cards__arrow").remove();isInitialized?$this.slick("setPosition"):$this.slick({arrows:!0,dots:!1,infinite:!1,slidesToShow:3,slidesToScroll:1,draggable:!0,swipeToSlide:!0,touchMove:!0,touchThreshold:8,waitForAnimate:!1,appendArrows:$wrap,prevArrow:'<button type="button" class="explore-cards__arrow explore-cards__arrow--prev" aria-label="Previous destination">'+arrowIcon+"</button>",nextArrow:'<button type="button" class="explore-cards__arrow explore-cards__arrow--next" aria-label="Next destination">'+arrowIcon+"</button>",responsive:[{breakpoint:1199,settings:{slidesToShow:2}},{breakpoint:767,settings:{arrows:!1,slidesToShow:1,slidesToScroll:1,variableWidth:!0}}]})})}else scheduleExploreCardsCarouselInit()}function resetOurStoryTimelineLayout($timeline){var $wrap=$timeline.closest(".our-story__timeline"),$items=$timeline.find(".our-story-timeline__item").not(".slick-cloned");$wrap.css("min-height",""),$wrap.find(".our-story__timeline-line, .our-story__arrow").css("top",""),$timeline.add($timeline.find(".slick-list, .slick-track")).css({height:"","min-height":""}),$timeline.find(".slick-slide").css({height:"","min-height":""}),$items.css({height:"","min-height":""}),$items.children(".our-story-timeline__content").css({top:"",height:""}),$items.children(".our-story-timeline__stem").css({top:"",bottom:"",height:""}),$items.children(".our-story-timeline__marker").css("top","")}function setOurStoryTimelineLayout($timeline){var $wrap=$timeline.closest(".our-story__timeline"),$items=$timeline.find(".our-story-timeline__item").not(".slick-cloned"),isCompact=window.matchMedia("(max-width: 1200px)").matches,minimumHeight=isCompact?650:760,fallbackLineY=isCompact?330:390,topGap=isCompact?32:40,bottomGap=isCompact?34:41,maxTopHeight=0,maxBottomHeight=0;if($wrap.length&&$items.length){resetOurStoryTimelineLayout($timeline),$items.children(".our-story-timeline__content").css("height",""),$items.each(function(){var $item=$(this),$content=$item.children(".our-story-timeline__content"),contentHeight=0;$content.length&&($item.hasClass("our-story-timeline__item--bottom")?(contentHeight=Math.ceil($content.outerHeight(!0)),maxBottomHeight=Math.max(maxBottomHeight,contentHeight)):($content.css("top","0"),contentHeight=Math.ceil($content.outerHeight(!0)),maxTopHeight=Math.max(maxTopHeight,contentHeight)))});var lineY=Math.max(fallbackLineY,maxTopHeight+topGap),bottomTop=lineY+bottomGap,timelineHeight=Math.max(minimumHeight,bottomTop+maxBottomHeight);$wrap.css("min-height",timelineHeight+"px"),$wrap.find(".our-story__timeline-line").css("top",lineY+"px"),$wrap.find(".our-story__arrow").css("top",lineY+"px"),$timeline.add($timeline.find(".slick-list, .slick-track")).css("min-height",timelineHeight+"px"),$timeline.find(".slick-slide").css({height:timelineHeight+"px","min-height":timelineHeight+"px"}),$items.each(function(){var $item=$(this),$content=$item.children(".our-story-timeline__content"),$stem=$item.children(".our-story-timeline__stem"),$marker=$item.children(".our-story-timeline__marker"),contentHeight=Math.ceil($content.outerHeight(!0));$item.css({height:timelineHeight+"px","min-height":timelineHeight+"px"}),$marker.css("top",lineY+"px"),$item.hasClass("our-story-timeline__item--bottom")?($content.css("top",bottomTop+"px"),$stem.css({top:lineY+"px",bottom:"",height:bottomGap+contentHeight+"px"})):($content.css("top",lineY-contentHeight-topGap+"px"),$stem.css({top:lineY-contentHeight-topGap+"px",bottom:"",height:topGap+contentHeight+"px"}))})}}function initOurStoryTimeline(){var $timeline=$("[data-our-story-timeline]");if($timeline.length){var isPhone=window.matchMedia("(max-width: 767px)").matches,arrowIcon='<svg width="29" height="20" viewBox="0 0 29 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M1.25 8.75C0.559644 8.75 0 9.30964 0 10C0 10.6904 0.559644 11.25 1.25 11.25V8.75ZM28.1339 10.8839C28.622 10.3957 28.622 9.60427 28.1339 9.11612L20.1789 1.16117C19.6908 0.67301 18.8993 0.67301 18.4112 1.16117C17.923 1.64932 17.923 2.44078 18.4112 2.92893L25.4822 10L18.4112 17.0711C17.923 17.5592 17.923 18.3507 18.4112 18.8388C18.8993 19.327 19.6908 19.327 20.1789 18.8388L28.1339 10.8839ZM1.25 10V11.25H27.25V10V8.75H1.25V10Z" fill="currentColor"/></svg>';$timeline.each(function(){var $this=$(this),$wrap=$this.closest(".our-story__timeline");if(isPhone)return $this.off(".ourStoryTimeline"),$.fn.slick&&$this.hasClass("slick-initialized")&&$this.slick("unslick"),void resetOurStoryTimelineLayout($this);if($.fn.slick){if($this.hasClass("slick-initialized"))return setOurStoryTimelineLayout($this),void $this.slick("setPosition");$this.off(".ourStoryTimeline").on("init.ourStoryTimeline reInit.ourStoryTimeline setPosition.ourStoryTimeline afterChange.ourStoryTimeline",function(){setOurStoryTimelineLayout($this)}),$this.slick({arrows:!0,dots:!1,infinite:!1,slidesToScroll:1,draggable:!0,swipeToSlide:!0,touchMove:!0,touchThreshold:8,waitForAnimate:!1,variableWidth:!0,appendArrows:$wrap,prevArrow:'<button type="button" class="our-story__arrow our-story__arrow--prev" aria-label="Previous story item">'+arrowIcon+"</button>",nextArrow:'<button type="button" class="our-story__arrow our-story__arrow--next" aria-label="Next story item">'+arrowIcon+"</button>"}),$this.find("img").each(function(){this.complete||$(this).one("load.ourStoryTimeline error.ourStoryTimeline",function(){setOurStoryTimelineLayout($this),$this.slick("setPosition")})}),setOurStoryTimelineLayout($this)}})}}function setLatestDealsArrowPosition($carousel){var $wrap=$carousel.closest(".latest-deals__slider-wrap"),$media=$carousel.find(".slick-current .travel-card__media").first();if($media.length||($media=$carousel.find(".slick-active .travel-card__media").first()),$wrap.length&&$media.length&&$media.outerHeight()){var arrowTop=$media.offset().top-$wrap.offset().top+$media.outerHeight()/2;$wrap[0].style.setProperty("--latest-deals-arrow-top",Math.round(arrowTop)+"px")}}function initLatestDealsCarousel(){var $carousel=$(".latest-deals__slider");if($carousel.length&&$.fn.slick){var arrowIcon='<svg width="29" height="20" viewBox="0 0 29 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M1.25 8.75C0.559644 8.75 0 9.30964 0 10C0 10.6904 0.559644 11.25 1.25 11.25V8.75ZM28.1339 10.8839C28.622 10.3957 28.622 9.60427 28.1339 9.11612L20.1789 1.16117C19.6908 0.67301 18.8993 0.67301 18.4112 1.16117C17.923 1.64932 17.923 2.44078 18.4112 2.92893L25.4822 10L18.4112 17.0711C17.923 17.5592 17.923 18.3507 18.4112 18.8388C18.8993 19.327 19.6908 19.327 20.1789 18.8388L28.1339 10.8839ZM1.25 10V11.25H27.25V10V8.75H1.25V10Z" fill="currentColor"/></svg>';$carousel.each(function(){var $this=$(this);$this.hasClass("slick-initialized")||($this.off(".latestDeals").on("init.latestDeals reInit.latestDeals setPosition.latestDeals breakpoint.latestDeals afterChange.latestDeals",function(){setLatestDealsArrowPosition($this)}),$this.slick({arrows:!0,dots:!1,infinite:!1,slidesToShow:3,slidesToScroll:1,swipeToSlide:!0,appendArrows:$this.closest(".latest-deals__slider-wrap"),prevArrow:'<button type="button" class="latest-deals__arrow latest-deals__arrow--prev" aria-label="Previous deal">'+arrowIcon+"</button>",nextArrow:'<button type="button" class="latest-deals__arrow latest-deals__arrow--next" aria-label="Next deal">
1'+arrowIcon+"</button>",responsive:[{breakpoint:1199,settings:{slidesToShow:2}},{breakpoint:767,settings:{arrows:!1,dots:!1,slidesToShow:1,slidesToScroll:1,swipeToSlide:!0,variableWidth:!0}}]})),setLatestDealsArrowPosition($this)})}}function initTravelCardsCarousel(){var $carousel=$(".travel-cards__slider");if($carousel.length&&$.fn.slick){var arrowIcon='<svg width="29" height="20" viewBox="0 0 29 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M1.25 8.75C0.559644 8.75 0 9.30964 0 10C0 10.6904 0.559644 11.25 1.25 11.25V8.75ZM28.1339 10.8839C28.622 10.3957 28.622 9.60427 28.1339 9.11612L20.1789 1.16117C19.6908 0.67301 18.8993 0.67301 18.4112 1.16117C17.923 1.64932 17.923 2.44078 18.4112 2.92893L25.4822 10L18.4112 17.0711C17.923 17.5592 17.923 18.3507 18.4112 18.8388C18.8993 19.327 19.6908 19.327 20.1789 18.8388L28.1339 10.8839ZM1.25 10V11.25H27.25V10V8.75H1.25V10Z" fill="currentColor"/></svg>';$carousel.each(function(){var $this=$(this),$controls=$this.closest(".travel-cards__group").find(".travel-cards__controls").first();$this.hasClass("slick-initialized")||$this.slick({arrows:!0,dots:!1,infinite:!1,slidesToShow:1,slidesToScroll:1,draggable:!0,swipeToSlide:!0,touchMove:!0,touchThreshold:8,waitForAnimate:!1,variableWidth:!0,appendArrows:$controls,prevArrow:'<button type="button" class="travel-cards__arrow travel-cards__arrow--prev" aria-label="Previous route">'+arrowIcon+"</button>",nextArrow:'<button type="button" class="travel-cards__arrow travel-cards__arrow--next" aria-label="Next route">'+arrowIcon+"</button>",responsive:[{breakpoint:1199,settings:{slidesToShow:1}},{breakpoint:991,settings:{slidesToShow:1}},{breakpoint:767,settings:{slidesToShow:1,slidesToScroll:1,variableWidth:!0}}]})})}}function initTravelPassesMegaSlider(){var $carousel=$(".mega-menu__pass-slider");if($carousel.length&&$.fn.slick){var arrowIcon='<svg width="17" height="12" viewBox="0 0 17 12" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M0.75 4.77295C0.335786 4.77295 0 5.10874 0 5.52295C0 5.93716 0.335786 6.27295 0.75 6.27295L0.75 5.52295L0.75 4.77295ZM16.2803 6.05328C16.5732 5.76039 16.5732 5.28551 16.2803 4.99262L11.5074 0.219648C11.2145 -0.073245 10.7396 -0.073245 10.4467 0.219648C10.1538 0.512542 10.1538 0.987415 10.4467 1.28031L14.6893 5.52295L10.4467 9.76559C10.1538 10.0585 10.1538 10.5334 10.4467 10.8263C10.7396 11.1191 11.2145 11.1191 11.5074 10.8263L16.2803 6.05328ZM0.75 5.52295L0.75 6.27295L15.75 6.27295V5.52295V4.77295L0.75 4.77295L0.75 5.52295Z" fill="currentColor"/></svg>';$carousel.each(function(){var $this=$(this),$wrap=$this.closest(".mega-menu__pass-slider-wrap");$this.hasClass("slick-initialized")?$this.slick("setPosition"):$this.slick({arrows:!0,dots:!1,infinite:!1,slidesToShow:1,slidesToScroll:1,draggable:!0,swipeToSlide:!0,touchThreshold:8,waitForAnimate:!1,appendArrows:$wrap,prevArrow:'<button type="button" class="mega-menu__pass-arrow mega-menu__pass-arrow--prev" aria-label="Previous pass">'+arrowIcon+"</button>",nextArrow:'<button type="button" class="mega-menu__pass-arrow mega-menu__pass-arrow--next" aria-label="Next pass">'+arrowIcon+"</button>"})})}}function initGuidesCardsCarousel(){var $carousel=$(".guides-cards__slider");$carousel.length&&$.fn.slick&&$carousel.each(function(){var $this=$(this);$this.hasClass("slick-initialized")?$this.slick("setPosition"):$this.slick({arrows:!1,dots:!1,infinite:!1,slidesToShow:1,slidesToScroll:1,draggable:!0,swipeToSlide:!0,touchMove:!0,waitForAnimate:!1,variableWidth:!0})})}function initInspirationCardsCarousel(){var $carousel=$(".inspiration-cards__slider"),isPhone=window.matchMedia("(max-width: 767px)").matches;$carousel.length&&$.fn.slick&&$carousel.each(function(){var $this=$(this),isInitialized=$this.hasClass("slick-initialized");$this.closest(".inspiration-cards-container--mobile-stack").length>0?isInitialized&&$this.slick("unslick"):isPhone&&!isInitialized?$this.slick({arrows:!1,dots:!1,infinite:!1,slidesToShow:1,slidesToScroll:1,swipeToSlide:!0,variableWidth:!0}):!isPhone&&isInitialized&&$this.slick("unslick")})}function initFaqAccordions(){var faqItems=document.querySelectorAll(".faq__item");function getAnswer(item){return item.querySelector(".faq__answer")}function getSummary(item){return item.querySelector(".faq__summary")}
1function setSummaryState(item,isOpen){var summary=getSummary(item);summary&&summary.setAttribute("aria-expanded",isOpen?"true":"false")}function closeItem(item){var answer=getAnswer(item);answer&&item.open&&(clearTimeout(item.faqCloseTimer),item.classList.remove("is-opening"),item.classList.add("is-closing"),setSummaryState(item,!1),answer.style.marginTop=window.getComputedStyle(answer).marginTop,answer.style.maxHeight=answer.scrollHeight+"px",answer.style.opacity="1",answer.offsetHeight,answer.style.maxHeight="0px",answer.style.opacity="0",answer.style.marginTop="0px",item.faqCloseTimer=setTimeout(function(){item.classList.contains("is-closing")&&(item.open=!1,item.classList.remove("is-closing"),answer.style.marginTop="")},360))}faqItems.length&&(faqItems.forEach(function(item){if("true"!==item.getAttribute("data-faq-ready")){var summary=getSummary(item),answer=getAnswer(item);summary&&answer&&(item.setAttribute("data-faq-ready","true"),function(item){var answer=getAnswer(item);answer&&(item.open?(answer.style.maxHeight=answer.scrollHeight+"px",answer.style.opacity="1",answer.style.marginTop=""):(answer.style.maxHeight="0px",answer.style.opacity="0",answer.style.marginTop="0px"),setSummaryState(item,item.open))}(item),summary.addEventListener("click",function(event){event.preventDefault(),item.open?closeItem(item):function(item){var answer=getAnswer(item);!answer||item.open&&!item.classList.contains("is-closing")||(clearTimeout(item.faqCloseTimer),faqItems.forEach(function(otherItem){otherItem!==item&&closeItem(otherItem)}),item.open=!0,item.classList.remove("is-closing"),item.classList.add("is-opening"),setSummaryState(item,!0),answer.style.maxHeight="0px",answer.style.opacity="0",answer.style.marginTop="0px",answer.offsetHeight,answer.style.maxHeight=answer.scrollHeight+"px",answer.style.opacity="1",answer.style.marginTop="")}(item)}),answer.addEventListener("transitionend",function(event){"max-height"===event.propertyName&&item.classList.contains("is-closing")&&(item.open=!1,item.classList.remove("is-closing"),clearTimeout(item.faqCloseTimer),answer.style.marginTop="")}))}}),window.addEventListener("resize",function(){faqItems.forEach(function(item){var answer=getAnswer(item);answer&&item.open&&!item.classList.contains("is-closing")&&(answer.style.maxHeight=answer.scrollHeight+"px")})}))}function initFooterAccordions(){var footerDetails=document.querySelectorAll(".site-footer__section");if(footerDetails.length){var mobileQuery=window.matchMedia("(max-width: 767px)");syncFooterDetails(),mobileQuery.addEventListener?mobileQuery.addEventListener("change",syncFooterDetails):mobileQuery.addListener(syncFooterDetails)}function syncFooterDetails(){footerDetails.forEach(function(detail){mobileQuery.matches?detail.removeAttribute("open"):detail.setAttribute("open","")})}}function initResponsiveVideos(container=document){const $container=$(container),videoSelector=['iframe[src*="youtube.com"]','iframe[src*="youtu.be"]','iframe[src*="vimeo.com"]'].join(", ");$container.find(videoSelector).each(function(){const $iframe=$(this);if($iframe.closest(".responsive-video").length)return;const $parent=$iframe.parent(),isEmptyParagraph=$parent.is("p")&&1===$parent.children().length&&""===$.trim($parent.clone().children().remove().end().text());if($iframe.removeAttr("width height"),isEmptyParagraph){const $wrapper=$('<div class="responsive-video"></div>');$parent.replaceWith($wrapper),$wrapper.append($iframe)}else $iframe.wrap('<div class="responsive-video"></div>')})}function initStickyHeader(){var header=document.querySelector(".site-header"),navigation=header?header.querySelector(".site-header__navigation"):null,root=document.documentElement,isCompact=!1,isTicking=!1,isMeasuring=!1;function setHeaderMeasurements(){var wasCompact=header.classList.contains("site-header--compact");header.classList.add("site-header--measuring"),wasCompact&&header.classList.remove("site-header--compact");var headerRect=header.getBoundingClientRect(),navigationRect=navigation.getBoundingClientRect(),headerHeight=Math.ceil(headerRect.height),navigationTop=Math.max(0,Math.round(navigationRect.top-headerRect.top)),navigationHeight=Math.ceil(navigationRect.height);root.style.setProperty("--site-header-offset",headerHeight+"px"),header.style.setProperty("--site-header-compact-shift",navigationTop+"px"),header.style.setProperty("--site-header-navigation-height",navigationHeight+"px"),wasCompact&&header.classList.add("site-header--compact"),header.classList.remove("site-header--measuring")}function syncHeaderState(){var scrollY=window.scrollY||window.pageYOffset||0;!function(shouldCompact){shouldCompact!==isCompact&&(isCompact=shouldCompact,header.classList.toggle("site-header--compact",isCompact))}(isCompact?scrollY>80:scrollY>100),isTicking=!1}function requestHeaderMeasurements(){isMeasuring||(window.requestAnimationFrame(function(){setHeaderMeasurements(),syncHeaderState(),isMeasuring=!1}),isMeasuring=!0)}header&&navigation&&(setHeaderMeasurements(),syncHeaderState(),window.addEventListener("scroll",function(){isTicking||(window.requestAnimationFrame(syncHeaderState),isTicking=!0)},{passive:!0}),window.addEventListener("resize",requestHeaderMeasurements),window.addEventListener("load",requestHeaderMeasurements))}function linkTargetsCurrentPage(link){if(!link||!link.getAttribute)return!1;var url,href=link.getAttribute("href");if(!href)return!1;if("#"===href.charAt(0))return href.length>1;if("undefined"==typeof URL)return!1;
1try{url=new URL(link.href,window.location.href)}catch(error){return!1}return url.origin===window.location.origin&&url.pathname.replace(/\/+$/,"")===window.location.pathname.replace(/\/+$/,"")}function initMobileMenu(){var menu=document.getElementById("mobile-menu"),toggle=document.querySelector(".mobile-header__menu-toggle"),closeButton=menu?menu.querySelector(".mobile-menu__close"):null,track=menu?menu.querySelector("[data-mobile-menu-track]"):null,viewport=menu?menu.querySelector(".mobile-menu__viewport"):null,panels=track?Array.prototype.slice.call(track.querySelectorAll("[data-mobile-menu-panel]")):[],rootPanel=panels.length?panels[0]:null,activePanel=rootPanel,desktopQuery=window.matchMedia("(min-width: 1201px)"),focusableSelector="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]";function syncViewportHeight(){viewport&&activePanel&&(viewport.style.height=activePanel.offsetHeight+"px")}function setActivePanel(panel,shouldFocus){var panelIndex=function(panel){return panels.indexOf(panel)}(panel);if(panel&&!(panelIndex<0)&&(activePanel=panel,track&&(track.style.transform="translateX(-"+100*panelIndex+"%)"),panels.forEach(function(item){var toggleButton=menu.querySelector("[data-mobile-menu-target='"+item.id+"']");toggleButton&&toggleButton.setAttribute("aria-expanded",item===activePanel?"true":"false")}),panels.forEach(function(panel){var isActive=panel===activePanel;panel.classList.toggle("is-active",isActive),panel.setAttribute("aria-hidden",isActive?"false":"true"),Array.prototype.forEach.call(panel.querySelectorAll(focusableSelector),function(element){!function(element,isAvailable){if(isAvailable)return""===element.getAttribute("data-mobile-menu-original-tabindex")?element.removeAttribute("tabindex"):element.hasAttribute("data-mobile-menu-original-tabindex")&&element.setAttribute("tabindex",element.getAttribute("data-mobile-menu-original-tabindex")),void element.removeAttribute("data-mobile-menu-original-tabindex");element.hasAttribute("data-mobile-menu-original-tabindex")||element.setAttribute("data-mobile-menu-original-tabindex",element.hasAttribute("tabindex")?element.getAttribute("tabindex"):""),element.setAttribute("tabindex","-1")}(element,isActive)})}),syncViewportHeight(),shouldFocus)){var focusTarget=panel.querySelector("[data-mobile-menu-back]")||panel.querySelector(focusableSelector);focusTarget&&focusTarget.focus()}}function resetPanels(){rootPanel&&setActivePanel(rootPanel,!1)}function setMenuOpen(isOpen,returnFocus){menu.classList.toggle("is-open",isOpen),document.body.classList.toggle("mobile-menu-open",isOpen),menu.setAttribute("aria-hidden",isOpen?"false":"true"),toggle.setAttribute("aria-expanded",isOpen?"true":"false"),toggle.setAttribute("aria-label",isOpen?"Close menu":"Open menu"),window.closeSiteSearch&&window.closeSiteSearch(isOpen?"mobile-header":"mobile-menu"),isOpen?(resetPanels(),window.setTimeout(function(){closeButton.focus(),syncViewportHeight()},40)):(resetPanels(),returnFocus&&toggle.focus())}function closeMenuOnDesktop(){desktopQuery.matches&&setMenuOpen(!1,!1)}menu&&toggle&&closeButton&&(window.closeMobileMenu=function(returnFocus){setMenuOpen(!1,returnFocus)},toggle.addEventListener("click",function(){setMenuOpen(!menu.classList.contains("is-open"),!1)}),closeButton.addEventListener("click",function(){setMenuOpen(!1,!0)}),Array.prototype.forEach.call(menu.querySelectorAll("[data-mobile-menu-target]"),function(submenuToggle){submenuToggle.addEventListener("click",function(){setActivePanel(document.getElementById(submenuToggle.getAttribute("data-mobile-menu-target")),!0)})}),Array.prototype.forEach.call(menu.querySelectorAll("[data-mobile-menu-back]"),function(backButton){backButton.addEventListener("click",function(){var parentPanelId=activePanel?activePanel.getAttribute("data-mobile-menu-parent"):"";setActivePanel((parentPanelId?document.getElementById(parentPanelId):rootPanel)||rootPanel,!0)})}),menu.addEventListener("click",function(event){if(event.target!==menu)if(event.target.closest("a[href='#']"))event.preventDefault();else{var navLink=event.target.closest("a[href]");navLink&&linkTargetsCurrentPage(navLink)&&setMenuOpen(!1,!1)}else setMenuOpen(!1,!0)}),document.addEventListener("keydown",function(event){"Escape"===event.key&&menu.classList.contains("is-open")&&setMenuOpen(!1,!0)}),desktopQuery.addEventListener?desktopQuery.addEventListener("change",closeMenuOnDesktop):desktopQuery.addListener(closeMenuOnDesktop),window.addEventListener("resize",syncViewportHe
1ight),resetPanels(),closeMenuOnDesktop())}function initCartPlacement(){var desktopSlot=document.getElementById("cart-placeholder-desktop"),mobileSlot=document.getElementById("cart-placeholder-mobile");if(desktopSlot&&mobileSlot){var desktopQuery=window.matchMedia("(min-width: 1201px)"),currentMode=null;placeCart(),desktopQuery.addEventListener?desktopQuery.addEventListener("change",placeCart):desktopQuery.addListener(placeCart)}function placeCart(){var mode=desktopQuery.matches?"desktop":"mobile";if(mode!==currentMode){currentMode=mode;var target="desktop"===mode?desktopSlot:mobileSlot,widget=document.querySelector("ga-add-to-cart");if(widget){if(widget.parentNode===target)return;var extras=document.querySelectorAll("ga-add-to-cart");return Array.prototype.forEach.call(extras,function(node){node!==widget&&node.parentNode&&node.parentNode.removeChild(node)}),void target.appendChild(widget)}var fresh=document.createElement("ga-add-to-cart");fresh.textContent="Loading Cart",target.appendChild(fresh)}}}function initSiteSearch(){var forms=document.querySelectorAll(".site-search-form"),mobileHeaderToggle=document.querySelector(".mobile-header__search-toggle"),desktopQuery=window.matchMedia("(min-width: 1201px)");function getInput(form){return form?form.querySelector("input[name='s']"):null}function getPanel(form){return form?form.closest(".mobile-header-search"):null}function focusInput(form){var input=getInput(form);input&&window.setTimeout(function(){input.focus()},80)}function setSearchOpen(form,isOpen,returnFocus){var panel=getPanel(form),trigger=function(form){var panel=getPanel(form);return panel&&panel.id?document.querySelector("[data-search-toggle][data-search-target='"+panel.id+"']"):form?form.querySelector("[data-search-toggle]"):null}(form);form&&(form.classList.toggle("is-open",isOpen),panel&&(panel.classList.toggle("is-open",isOpen),panel.setAttribute("aria-hidden",isOpen?"false":"true")),trigger&&trigger.setAttribute("aria-expanded",isOpen?"true":"false"),isOpen?focusInput(form):returnFocus&&trigger&&trigger.focus())}function closeSearch(form,returnFocus){setSearchOpen(form,!1,returnFocus)}function closeSearches(context,returnFocus){Array.prototype.forEach.call(forms,function(form){context&&form.getAttribute("data-search-context")!==context||closeSearch(form,returnFocus)})}function openSearch(form){var context=form.getAttribute("data-search-context");Array.prototype.forEach.call(forms,function(otherForm){otherForm!==form&&closeSearch(otherForm,!1)}),setSearchOpen(form,!0,!1),"mobile-header"===context&&window.closeMobileMenu&&window.closeMobileMenu(!1)}function closeSearchesOnBreakpointChange(){closeSearches(null,!1)}forms.length&&(Array.prototype.forEach.call(forms,function(form){form.addEventListener("submit",function(event){!function(form,event){var input=getInput(form),action=form.getAttribute("action");if(!form.classList.contains("is-open"))return event.preventDefault(),void openSearch(form);input&&input.value.trim()&&"#"!==action||(event.preventDefault(),focusInput(form))}(form,event)})}),mobileHeaderToggle&&mobileHeaderToggle.addEventListener("click",function(){var panelId=mobileHeaderToggle.getAttribute("data-search-target"),panel=panelId?document.getElementById(panelId):null,form=panel?panel.querySelector(".site-search-form"):null;form&&(form.classList.contains("is-open")?closeSearch(form,!0):openSearch(form))}),Array.prototype.forEach.call(document.querySelectorAll("[data-search-close]"),function(button){button.addEventListener("click",function(){var form=button.closest(".site-search-form");form&&closeSearch(form,!0)})}),document.addEventListener("keydown",function(event){var openForm=function(){var openForm=null;return Array.prototype.some.call(forms,function(form){return!!form.classList.contains("is-open")&&(openForm=form,!0)}),openForm}();"Escape"===event.key&&openForm&&(closeSearch(openForm,!0),event.preventDefault(),event.stopImmediatePropagation())},!0),desktopQuery.addEventListener?desktopQuery.addEventListener("change",closeSearchesOnBreakpointChange):desktopQuery.addListener(closeSearchesOnBreakpointChange),window.closeSiteSearch=function(context){closeSearches(context,!1)})}function initMegaMenus(){var $megaItems=$(".main-nav__item--mega"),suppressFocusOpen=!1,supportsHover=window.matchMedia("(hover: hover) and (pointer: fine)").matches,usingKeyboard=!1,pointerDownTarget=null;function getMegaMenu($trigger){var menuId=$trigger.attr("aria-controls");return menuId?$(document.getElementById(menuId)):$()}function setMegaMenuCaret($trigger,$menu){if($trigger.length&&$menu.length&&"static"!==$menu.css("position")){var menuLeft=$menu.offset().left,menuWidth=$menu.outerWidth(),triggerCenter=$trigger.offset().left+$trigger.outerWidth()/2,caretLeft=Math.max(24,Math.min(menuWidth-24,triggerCenter-menuLeft));$menu[0].style.setProperty("--mega-menu-caret-left",caretLeft+"px")}}function openMegaMenu($item){var $trigger=$item.children(".main-nav__link"),$menu=getMegaMenu($trigger);$megaItems.not($item).removeClass("is-open").children(".main-nav__link").attr("aria-expanded","fal
1se"),$(".mega-menu.is-open").not($menu).removeClass("is-open"),$item.addClass("is-open"),$trigger.attr("aria-expanded","true"),$menu.addClass("is-open"),setMegaMenuCaret($trigger,$menu),$menu.find(".mega-menu__pass-slider.slick-initialized").slick("setPosition")}function closeMegaMenu($item){var $trigger=$item.children(".main-nav__link"),$menu=getMegaMenu($trigger);$item.removeClass("is-open"),$trigger.attr("aria-expanded","false"),$menu.removeClass("is-open")}function closeMegaMenus(){$megaItems.removeClass("is-open").children(".main-nav__link").attr("aria-expanded","false"),$(".mega-menu.is-open").removeClass("is-open")}$megaItems.length&&($(document).on("keydown",function(event){"Tab"===event.key&&(usingKeyboard=!0)}),$(document).on("pointerdown mousedown touchstart",function(event){usingKeyboard=!1,"number"==typeof event.button&&event.button>0||(pointerDownTarget=event.target)}),$megaItems.each(function(){var closeTimer,$item=$(this),$trigger=$item.children(".main-nav__link"),$menu=getMegaMenu($trigger),isHovered=!1,lastFocusedInMenu=null;if($menu.length){$(document).on("focusin",function(event){lastFocusedInMenu=isInside(event.target)?event.target:null}),supportsHover&&($item.on("mouseenter",function(){isHovered=!0,cancelClose(),openMegaMenu($item)}),$menu.on("mouseenter",function(){isHovered=!0,cancelClose()}),$item.add($menu).on("mouseleave",function(){isHovered=!1,scheduleClose()}),$(window).on("focus",function(){isHovered||!$item.hasClass("is-open")||formFieldHoldsMenuOpen()||scheduleClose()})),$item.on("focusin",function(){suppressFocusOpen?suppressFocusOpen=!1:(cancelClose(),usingKeyboard&&openMegaMenu($item))}),$item.on("focusout",function(){setTimeout(function(){!pointerStartedInsideMenu()&&focusHasLeftMenu()&&closeMegaMenu($item)},0)}),$menu.on("focusin",function(){cancelClose(),usingKeyboard&&openMegaMenu($item)}),$menu.on("focusout",function(){setTimeout(function(){!pointerStartedInsideMenu()&&focusHasLeftMenu()&&closeMegaMenu($item)},0)});var wasOpenOnPointerDown=!1;$trigger.on("pointerdown",function(){wasOpenOnPointerDown=$item.hasClass("is-open")}),$trigger.on("click",function(event){event.preventDefault(),supportsHover?openMegaMenu($item):wasOpenOnPointerDown?closeMegaMenu($item):openMegaMenu($item)})}function isInside(el){return!!el&&($item[0].contains(el)||$menu[0].contains(el))}function isFormField(el){return!!el&&$(el).is("input, select, textarea")}function cancelClose(){clearTimeout(closeTimer)}function scheduleClose(){closeTimer=setTimeout(function(){formFieldHoldsMenuOpen()||closeMegaMenu($item)},160)}function formFieldHoldsMenuOpen(){return document.hasFocus()?isInside(document.activeElement)&&isFormField(document.activeElement):isFormField(lastFocusedInMenu)}function focusHasLeftMenu(){return!!document.hasFocus()&&(!$item[0].contains(document.activeElement)&&!$menu[0].contains(document.activeElement))}function pointerStartedInsideMenu(){return!!pointerDownTarget&&($item[0].contains(pointerDownTarget)||$menu[0].contains(pointerDownTarget))}}),$(".mega-menu__password-toggle").on("click",function(){var $button=$(this),$input=$button.siblings("input"),isHidden="password"===$input.attr("type");$input.attr("type",isHidden?"text":"password"),$button.attr("aria-label",isHidden?"Hide password":"Show password")}),$(document).on("click",function(event){$(event.target).closest(".main-nav__item--mega, .mega-menu").length||closeMegaMenus()}),$(document).on("click",".mega-menu a[href]",function(){linkTargetsCurrentPage(this)&&closeMegaMenus()}),$(document).on("keydown",function(event){if("Escape"===event.key){var $openTrigger=$megaItems.filter(".is-open").children(".main-nav__link").first();closeMegaMenus(),$openTrigger.length&&(suppressFocusOpen=!0,$openTrigger.trigger("focus"),setTimeout(function(){suppressFocusOpen=!1},0))}}),$(window).on("resize",function(){$megaItems.filter(".is-open").each(function(){var $trigger=$(this).children(".main-nav__link");setMegaMenuCaret($trigger,getMegaMenu($trigger))})}))}function gaCartAdd(btn,item){if(!btn.classList.contains("is-loading")){try{window.GACartWidget&&window.GACartWidget.addItem(item)}catch(e){console.error(e)}var label=btn.querySelector(".js-add-to-cart-label"),cartLink=btn.parentNode?btn.parentNode.querySelector(".js-cart-link"):null;btn.classList.add("is-loading"),btn.disabled=!0,setTimeout(function(){btn.classList.remove("is-loading"),btn.disabled=!1,label&&(label.textContent="Added to cart"),cartLink&&(cartLink.hidden=!1)},1e3)}}!function(){"use strict";function readCart(){if(!window.GACartWidget||"function"!=typeof window.GACartWidget.getCart)return null;try{return window.GACartWidget.getCart()}catch(e){return null}}function hasPopularRoute(items){return items.some(function(i){return"popular-route"===i.cartType})}function goToCheckout(btn){var base=(btn.getAttribute("data-v2-base")||"").replace(/\/+$/,"");if(base){var cart=readCart();if(cart)if("travel"===cart.kind&&cart.checkoutUrl)window.location.assign(cart.checkoutUrl);else{var items="products"===cart.kind&&cart.items?cart.items:[];if(items.length){btn.disabled=!0,btn.setAttribute("aria-busy","true"),btn.textContent="Redirecting";var payload=function(items){return{items:items.map(function(item){var line={productC
1ode:item.productId,quantity:item.quantity,name:item.name};return"number"==typeof item.unitPrice&&(line.unitPrice=item.unitPrice),item.sku&&(line.sku=item.sku),line}),currency:"AUD"}}(items),sessionId=function(){try{var existing=window.localStorage.getItem("greyhound:cart-session-id");if(existing&&0===existing.indexOf("cart_"))return existing}catch(e){}var id="cart_"+(window.crypto&&window.crypto.randomUUID?window.crypto.randomUUID():String(Date.now())+"-"+Math.floor(1e9*Math.random()));try{window.localStorage.setItem("greyhound:cart-session-id",id)}catch(e){}return id}(),cartType=hasPopularRoute(items)?"popular-route":"travel-pass",fallback=base+"/cart/checkout-loading?cartData="+encodeURIComponent(JSON.stringify(payload))+"&cartType="+encodeURIComponent(cartType)+"&session="+encodeURIComponent(sessionId);fetch(base+"/api/cart/from-products",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(payload)}).then(function(res){if(!res.ok)throw new Error("HTTP "+res.status);return res.json()}).then(function(data){if(!data||!data.cartSession)throw new Error("no cartSession in response");try{window.localStorage.setItem("greyhound.v2CartSession.v1",JSON.stringify({cartSessionId:data.cartSession,expiresAt:data.expiresAt,cartType:cartType,v2Base:base}))}catch(e){}window.location.assign(function(base,items,cartSession,sessionId){var cartType=hasPopularRoute(items)?"popular-route":"travel-pass";if("popular-route"===cartType){var route=items.filter(function(i){return"popular-route"===i.cartType})[0],parts=String(route.name||"").split(" to ");return base+"/book-a-ticket/availability?cartSession="+encodeURIComponent(cartSession)+"&origin="+encodeURIComponent(parts[0]||"")+"&destination="+encodeURIComponent(parts.slice(1).join(" to "))+"&source=static-cart&session="+encodeURIComponent(sessionId)}return base+"/cart/checkout-loading?cartSession="+encodeURIComponent(cartSession)+"&cartType="+encodeURIComponent(cartType)+"&session="+encodeURIComponent(sessionId)}(base,items,data.cartSession,sessionId))}).catch(function(err){console.warn("[view-cart] handoff failed, using cartData fallback:",err.message),window.location.assign(fallback)})}else console.warn("[view-cart] cart is empty - nothing to check out.")}else console.error("[view-cart] window.GACartWidget is not available - is the cart element on the page?")}else console.error("[view-cart] data-v2-base is missing - set it to the book.<env> URL matching this page.")}function syncEnabled(){for(var cart=readCart(),empty=!cart||"travel"!==cart.kind&&!("products"===cart.kind&&cart.items&&cart.items.length),list=document.querySelectorAll(".gh-view-cart"),i=0;i<list.length;i++)"true"!==list[i].getAttribute("aria-busy")&&(list[i].disabled=empty)}function init(){!function(){for(var list=document.querySelectorAll(".gh-view-cart"),i=0;i<list.length;i++)null===list[i].getAttribute("data-cart-label")&&list[i].setAttribute("data-cart-label",list[i].textContent.trim())}(),syncEnabled()}document.addEventListener("click",function(e){var btn=e.target.closest?e.target.closest(".gh-view-cart"):null;btn&&goToCheckout(btn)}),window.addEventListener("ga:cart:ready",syncEnabled),window.addEventListener("ga:cart:changed",syncEnabled),window.addEventListener("pageshow",function(){for(var list=document.querySelectorAll(".gh-view-cart"),i=0;i<list.length;i++){var b=list[i];if("true"===b.getAttribute("aria-busy")){b.removeAttribute("aria-busy"),b.disabled=!1;var label=b.getAttribute("data-cart-label");null!==label&&(b.textContent=label)}}syncEnabled()}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",init):init()}(),function(){var MARKER="gh-timetables-cta-hidden",css="html."+MARKER+" body.page-id-2539 .end-page-cta-container{display:none !important;}";function injectStyle(){var head=document.head||document.getElementsByTagName("head")[0];if(!head)return!1;if(document.getElementById("gh-timetables-cta-style"))return!0;var style=document.createElement("style");return style.id="gh-timetables-cta-style",style.appendChild(document.createTextNode(css)),head.appendChild(style),!0}var lastHref=null;function apply(){lastHref=window.location.href;var root=document.documentElement;root&&(window.location.search&&"?"!==window.location.search?root.classList.add(MARKER):root.classList.remove(MARKER)
1)}injectStyle()||document.addEventListener("DOMContentLoaded",injectStyle),apply(),window.addEventListener("popstate",apply),window.addEventListener("hashchange",apply);for(var methods=["pushState","replaceState"],i=0;i<methods.length;i++)(function(name){var original=history[name];"function"==typeof original&&(history[name]=function(){var result=original.apply(this,arguments);return apply(),result})})(methods[i]);setInterval(function(){document.hidden||window.location.href!==lastHref&&apply()},300)}();

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