!function(t){"use strict";function s(e,i){this.processWithBind=t.proxy(this.process,this),this.$body=t("body"),this.$scrollElement=t(e).is("body")?t(window):t(e),this.options=t.extend({},s.DEFAULTS,i),this.selector=(this.options.target||"")+" li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",this.processWithBind),this.refresh(),this.process()}function e(e){return this.each((function(){var i=t(this),o=i.data("bs.scrollspy"),r="object"==typeof e&&e;o||i.data("bs.scrollspy",o=new s(this,r)),"string"==typeof e&&o[e]()}))}s.VERSION="3.3.2",s.DEFAULTS={offset:10},s.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},s.prototype.refresh=function(){var s="offset",e=0;fusion.isWindow(this.$scrollElement[0])||(s="position",e=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var i=this;this.$body.find(this.selector).map((function(){var i=t(this),o=i.data("target")||i.attr("href"),r=/^#./.test(o)&&t(o);return r&&r.length&&r.is(":visible")&&[[r[s]().top+e,o]]||null})).sort((function(t,s){return t[0]-s[0]})).each((function(){i.offsets.push(this[0]),i.targets.push(this[1])}))},s.prototype.process=function(){var t,s=this.$scrollElement.scrollTop()+this.options.offset,e=this.getScrollHeight(),i=this.options.offset+e-this.$scrollElement.height(),o=this.offsets,r=this.targets,l=this.activeTarget;if(this.scrollHeight!=e&&this.refresh(),s>=i)return l!=(t=r[r.length-1])&&this.activate(t);if(l&&s<o[0])return this.activeTarget=null,this.clear();for(t=o.length;t--;)l!=r[t]&&s>=o[t]&&(!o[t+1]||s<=o[t+1])&&this.activate(r[t])},s.prototype.activate=function(s){this.activeTarget=s,this.clear();var e=this.options.currentItemClass?this.options.currentItemClass:"current-menu-item",i=window.location.href.split("#"),o="/"==i[0].charAt(i[0].length-1)?i[0]:i[0]+"/",r=this.selector+'[data-target="'+s+'"],'+this.selector+'[href="'+s+'"],'+this.selector+'[href="'+o+s+'"]',l=t(r).parents("li").addClass(e);l.parent(".sub-menu").length&&(l=l.closest("li.fusion-dropdown-menu").addClass(e)),l.trigger("activate.bs.scrollspy"),l&&t(this.selector).blur()},s.prototype.clear=function(){var s=this.options.currentItemClass?this.options.currentItemClass:"current-menu-item";t(this.selector).parentsUntil(this.options.target,"."+s).removeClass(s),t(this.selector).parentsUntil(this.options.target,".current-menu-parent").removeClass("current-menu-parent")},s.prototype.stopListening=function(){this.$scrollElement.off("scroll.bs.scrollspy",this.processWithBind)},window.awbScrollSpy=s;var i=t.fn.scrollspy;t.fn.scrollspy=e,t.fn.scrollspy.Constructor=s,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=i,this},t(window).on("load.bs.scrollspy.data-api",(function(){t('[data-spy="scroll"]').each((function(){var s=t(this);e.call(s,s.data())}))}))}(jQuery);