text: /*
   * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
   *
   * WSO2 Inc. licenses this file to you under the Apache License,
   * Version 2.0 (the "License"); you may not use this file except
   * in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing,
   * software distributed under the License is distributed on an
   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   * KIND, either express or implied. See the License for the
   * specific language governing permissions and limitations
   * under the License.
   */
  
  (function(){
      // Back to Top - by CodyHouse.co
  	var backTop = document.getElementsByClassName('js-cd-top')[0],
  		offset = 300, // browser window scroll (in pixels) after which the "back to top" link is shown
  		offsetOpacity = 1200, //browser window scroll (in pixels) after which the "back to top" link opacity is reduced
  		scrollDuration = 700,
  		scrolling = false;
  
  	if( backTop ) {
  		//update back to top visibility on scrolling
  		window.addEventListener("scroll", function(event) {
  			if( !scrolling ) {
  				scrolling = true;
  				(!window.requestAnimationFrame) ? setTimeout(checkBackToTop, 250) : window.requestAnimationFrame(checkBackToTop);
  			}
  		});
  
  		//smooth scroll to top
  		backTop.addEventListener('click', function(event) {
  			event.preventDefault();
  			(!window.requestAnimationFrame) ? window.scrollTo(0, 0) : Util.scrollTo(0, scrollDuration);
  		});
  	}
  
  	function checkBackToTop() {
  		var windowTop = window.scrollY || document.documentElement.scrollTop;
  		( windowTop > offset ) ? Util.addClass(backTop, 'cd-top--is-visible') : Util.removeClass(backTop, 'cd-top--is-visible cd-top--fade-out');
  		( windowTop > offsetOpacity ) && Util.addClass(backTop, 'cd-top--fade-out');
  		scrolling = false;
  	}
  })();