a.options.callbacks.onToggleSwitch&&a.options.callbacks.onToggleSwitch.call(this,a),this},e.prototype.dropdownOver=function(a,c){var d;return a.focusOnHover&&(d=b(this),clearTimeout(c),d.addClass("focus").siblings().removeClass("opened").each(a.dropdownUnfocus),a.options.callbacks.onDropdownOver&&a.options.callbacks.onDropdownOver.call(this,a)),this},e.prototype.dropdownTouch=function(a,c){var d,e;if(d=b(this),clearTimeout(c),a.focusOnHover){if(e=!1,d.hasClass("focus")&&(e=!0),!e)return d.addClass("focus").siblings().removeClass("opened").each(a.dropdownUnfocus),!1;a.options.callbacks.onDropdownOver&&a.options.callbacks.onDropdownOver.call(this,a)}return this},e.prototype.dropdownOut=function(a,c){var d;return a.focusOnHover&&(d=b(this),d.one("mouseenter.navbar",function(){return clearTimeout(c)}),clearTimeout(c),c=setTimeout(b.proxy(a.dropdownUnfocus,this,a),a.options.focusOnHoverTimeout),a.options.callbacks.onDropdownOut&&a.options.callbacks.onDropdownOut.call(this,a)),this},e.prototype.dropdownUnfocus=function(a){var c;return c=b(this),c.find("li.focus").add(this).removeClass("focus"),this},e.prototype.dropdownClose=function(a,c){var d;return c.target===this||b(c.target).parents(".rd-navbar-submenu").length||(d=b(this),d.find("li.focus").add(this).removeClass("focus").removeClass("opened"),a.options.callbacks.onDropdownClose&&a.options.callbacks.onDropdownClose.call(this,a)),this},e.prototype.dropdownToggle=function(a){return b(this).toggleClass("opened").siblings().removeClass("opened"),a.options.callbacks.onDropdownToggle&&a.options.callbacks.onDropdownToggle.call(this,a),this},e.prototype.goToAnchor=function(a,c){var d,e;return e=this.hash,d=b(e),d.length&&(c.preventDefault(),b("html, body").stop().animate({scrollTop:d.offset().top+a.getOption("anchorNavOffset")+1},a.getOption("anchorNavSpeed"),a.getOption("anchorNavEasing"),function(){return a.changeAnchor(e)})),this},e.prototype.activateAnchor=function(a){var c,d,e,f,g,h,i,j,k,l,m,n;if(f=this,m=f.$doc.scrollTop(),n=f.$win.height(),g=f.$doc.height(),l=f.getOption("anchorNavOffset"),m+n>g-50)return c=b('[data-type="anchor"]').last(),c.length&&c.offset().top>=m&&(h="#"+c.attr("id"),d=b('.rd-navbar-nav a[href^="'+h+'"]').parent(),d.hasClass("active")||(d.addClass("active").siblings().removeClass("active"),f.options.callbacks.onAnchorChange&&f.options.callbacks.onAnchorChange.call(c[0],f))),c;k=b('.rd-navbar-nav a[href^="#"]').get();for(i in k)j=k[i],e=b(j),h=e.attr("href"),c=b(h),c.length&&c.offset().top+l<=m&&c.offset().top+c.outerHeight()>m&&(e.parent().addClass("active").siblings().removeClass("active"),f.options.callbacks.onAnchorChange&&f.options.callbacks.onAnchorChange.call(c[0],f));return null},e.prototype.getAnchor=function(){return history&&history.state?history.state.id:null},e.prototype.changeAnchor=function(a){return history&&(history.state&&history.state.id!==a?history.replaceState({anchorId:a},null,a):history.pushState({anchorId:a},null,a)),this},e.prototype.applyHandlers=function(a){return null!=a.options.responsive&&a.$win.on("resize.navbar",b.proxy(a.resize,a.$win[0],a)).on("resize.navbar",b.proxy(a.resizeWrap,a)).on("resize.navbar",b.proxy(a.stickUp,null!=a.$clone?a.$clone:a.$element,a)).on("orientationchange.navbar",b.proxy(a.resize,a.$win[0],a)).trigger("resize.navbar"),a.$doc.on("scroll.navbar",b.proxy(a.stickUp,null!=a.$clone?a.$clone:a.$element,a)).on("scroll.navbar",b.proxy(a.activateAnchor,a)),a.$element.add(a.$clone).find("[data-rd-navbar-toggle]").each(function(){var c;return c=b(this),c.on("click",b.proxy(a.switchToggle,this,a)),c.parents("body").on("click",b.proxy(a.closeToggle,this,a))}),a.$element.add(a.$clone).find(".rd-navbar-submenu").each(function(){var c,d;return c=b(this),d=c.parents(".rd-navbar--is-clone").length?a.cloneTimer:a.focusTimer,c.on("mouseleave.navbar",b.proxy(a.dropdownOut,this,a,d)),c.find("> a").on("mouseenter.navbar",b.proxy(a.dropdownOver,this,a,d)),c.find("> a").on("touchstart.navbar",b.proxy(a.dropdownTouch,this,a,d)),c.find("> .rd-navbar-submenu-toggle").on("click",b.proxy(a.dropdownToggle,this,a)),c.parents("body").on("click",b.proxy(a.dropdownClose,this,a))}),
a.$element.add(a.$clone).find('.rd-navbar-nav a[href^="#"]').each(function(){return b(this).on("click",b.proxy(a.goToAnchor,this,a))}),a},e.prototype.switchClass=function(a,c,d){var e;return e=a instanceof jQuery?a:b(a),e.addClass("rd-navbar--no-transition").removeClass(c).addClass(d),e[0].offsetHeight,e.removeClass("rd-navbar--no-transition")},e.prototype.setDataAPI=function(a){var b,c,d,e,f,g;for(b=["-","-xs-","-sm-","-md-","-lg-","-xl-"],g=[0,480,768,992,1200,1800],c=d=0,e=g.length;d<e;c=++d)f=g[c],this.$element.attr("data"+b[c]+"layout")&&(this.options.responsive[g[c]]||(this.options.responsive[g[c]]={}),this.options.responsive[g[c]].layout=this.$element.attr("data"+b[c]+"layout")),this.$element.attr("data"+b[c]+"device-layout")&&(this.options.responsive[g[c]]||(this.options.responsive[g[c]]={}),this.options.responsive[g[c]].deviceLayout=this.$element.attr("data"+b[c]+"device-layout")),this.$element.attr("data"+b[c]+"hover-on")&&(this.options.responsive[g[c]]||(this.options.responsive[g[c]]={}),this.options.responsive[g[c]].focusOnHover="true"===this.$element.attr("data"+b[c]+"hover-on")),this.$element.attr("data"+b[c]+"auto-height")&&(this.options.responsive[g[c]]||(this.options.responsive[g[c]]={}),this.options.responsive[g[c]].autoHeight="true"===this.$element.attr("data"+b[c]+"auto-height")),this.$element.attr("data"+b[c]+"stick-up-offset")&&(this.options.responsive[g[c]]||(this.options.responsive[g[c]]={}),this.options.responsive[g[c]].stickUpOffset=this.$element.attr("data"+b[c]+"stick-up-offset"))},e.prototype.getOption=function(a){var b,c;for(b in this.options.responsive)b<=d.innerWidth&&(c=b);return null!=this.options.responsive&&null!=this.options.responsive[c][a]?this.options.responsive[c][a]:this.options[a]},e.prototype.addAdditionalClassToToggles=function(a,c,d){return b(a).find("[data-rd-navbar-toggle]").each(function(){var e;return b(this).addClass(c),e=this.getAttribute("data-rd-navbar-toggle"),b(this).parents("body").find(a).find(e).addClass(d)})},e}(),b.fn.extend({RDNavbar:function(a){var c;if(c=b(this),!c.data("RDNavbar"))return c.data("RDNavbar",new e(this,a))}}),d.RDNavbar=e}(window.jQuery,document,window),"undefined"!=typeof module&&null!==module?module.exports=window.RDNavbar:"function"==typeof define&&define.amd&&define(["jquery"],function(){"use strict";return window.RDNavbar})}).call(this);