var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
( function () {
	'use strict';

	var menuToggle;
	var searchToggle;
	var search;
	var menu;

	var pendingTransition;

	function cleanUp( el ) {
		el.style.removeProperty( 'display' );
		el.style.removeProperty( 'height' );
		el.style.removeProperty( 'margin-top' );
		el.style.removeProperty( 'overflow' );
		el.style.removeProperty( 'transition' );
	}

	function slideDown( el ) {
		// Start by cancelling any ongoing transitions and displaying the element.
		// Note that this won't actually render on screen, as we won't give the
		// browser a chance to do that.
		cleanUp( el );
		pendingTransition = null;
		el.style.display = 'block';

		// Take measurements.
		var styles = getComputedStyle( el );
		var height = styles.height;
		var marginTop = styles.marginTop;

		// Re-hide the element by setting the height to 0, before the browser has a
		// chance to render. Also, set up animation parameters for the next step.
		el.style.height = 0;
		el.style.overflow = 'hidden';
		el.style.transition = 'height 400ms, margin-top 400ms';

		// Now that we have our end numbers and the stage is set, trigger animation.
		// Sadly, we must use a non-performant height/margin animation, as we need
		// to push all the other page content down while resizing the element.
		// We use a double rAF to ensure browser compatibility.
		requestAnimationFrame( function () {
			requestAnimationFrame( function () {
				el.style.height = height;
				el.style.marginTop = marginTop;
			} );
		} );
	}

	function slideUp( el ) {
		// Trigger animation.
		el.style.height = 0;
		el.style.marginTop = 0;

		var whenFinished = function ( e ) {
			if ( e.target === el && e.propertyName === 'height' ) {
				if ( pendingTransition === whenFinished ) {
					cleanUp( el );
					pendingTransition = null;
				}
				el.removeEventListener( 'transitionend', whenFinished );
				el.removeEventListener( 'transitioncancel', whenFinished );
			}
		};

		// Listen for animation end, so that we can clean up.
		el.addEventListener( 'transitionend', whenFinished );
		el.addEventListener( 'transitioncancel', whenFinished );
		pendingTransition = whenFinished;
	}

	function toggleSlider( button, slider ) {
		if ( button.classList.contains( 'active' ) ) {
			button.classList.remove( 'active' );
			document.body.classList.remove( 'toggle-active' );
			slideUp( slider );
		} else {
			button.classList.add( 'active' );
			document.body.classList.add( 'toggle-active' );
			slideDown( slider );
		}
	}

	function init() {
		menuToggle = document.querySelector( '.menu-toggle' );
		searchToggle = document.querySelector( '.search-toggle' );
		search = document.querySelector( '.mobile-search' );
		menu = document.querySelector( '.main-navigation' );

		if ( ! menuToggle || ! searchToggle || ! search || ! menu ) {
			return;
		}

		// Toggle mobile-menu.
		menuToggle.addEventListener( 'click', function ( e ) {
			e.preventDefault();
			toggleSlider( menuToggle, menu );

			if ( searchToggle.classList.contains( 'active' ) ) {
				toggleSlider( searchToggle, search );
			}
		} );

		// Toggle mobile-search.
		searchToggle.addEventListener( 'click', function ( e ) {
			e.preventDefault();
			toggleSlider( searchToggle, search );

			if ( menuToggle.classList.contains( 'active' ) ) {
				toggleSlider( menuToggle, menu );
			}
		} );

		// Hide/show mobile menu/search block > 1000.
		window.addEventListener( 'resize', function () {
			if ( window.innerWidth > 1000 ) {
				document.body.classList.remove( 'toggle-active' );
				menuToggle.classList.remove( 'active' );
				searchToggle.classList.remove( 'active' );
				search.style.removeProperty( 'display' );
				cleanUp( search );
				cleanUp( menu );
			}
		} );
	}

	if ( document.readyState !== 'loading' ) {
		init();
	} else {
		document.addEventListener( 'DOMContentLoaded', init );
	}
} )();

}