!function(T,w,B,F){"use strict";T.isFunction=T.isFunction||function(e){return"function"==typeofe&&"number"!=typeofe.nodeType},w=void0!==w&&w.Math==Math?w:"undefined"!=typeofself&&self.Math==Math?self:Function("return this")(),T.fn.sticky=function(b){varv,e=T(this),x=e.selector||"",C=(newDate).getTime(),S=[],y=b,k="string"==typeofy,z=[].slice.call(arguments,1);returne.each(function(){vart,n,e,o,l=T.isPlainObject(b)?T.extend(!0,{},T.fn.sticky.settings,b):T.extend({},T.fn.sticky.settings),i=l.className,s=l.namespace,r=l.error,c="."+s,a="module-"+s,f=T(this),m=T(w),u=[w,B].indexOf(l.scrollContext)<0?T(B).find(l.scrollContext):T(l.scrollContext),d=f.data(a),h=w.requestAnimationFrame||w.mozRequestAnimationFrame||w.webkitRequestAnimationFrame||w.msRequestAnimationFrame||function(e){setTimeout(e,0)},g=this,p={initialize:function(){p.determineContainer(),p.determineContext(),p.verbose("Initializing sticky",l,t),p.save.positions(),p.checkErrors(),p.bind.events(),l.observeChanges&&p.observeChanges(),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),d=p,f.data(a,p)},destroy:function(){p.verbose("Destroying previous instance"),p.reset(),e&&e.disconnect(),o&&o.disconnect(),m.off("load"+c,p.event.load).off("resize"+c,p.event.resize),u.off("scrollchange"+c,p.event.scrollchange),f.removeData(a)},observeChanges:function(){"MutationObserver"inw&&(e=newMutationObserver(p.event.documentChanged),o=newMutationObserver(p.event.changed),e.observe(B,{childList:!0,subtree:!0}),o.observe(g,{childList:!0,subtree:!0}),o.observe(n[0],{childList:!0,subtree:!0}),p.debug("Setting up mutation observer",o))},determineContainer:function(){t=l.container?[w,B].indexOf(l.container)<0?T(B).find(l.container):T(l.container):f.offsetParent()},determineContext:function(){0===(n=l.context?[w,B].indexOf(l.context)<0?T(B).find(l.context):T(l.context):t).length&&p.error(r.invalidContext,l.context,f)},checkErrors:function(){p.is.hidden()&&p.error(r.visible,f),p.cache.element.height>p.cache.context.height&&(p.reset(),p.error(r.elementSize,f))},bind:{events:function(){m.on("load"+c,p.event.load).on("resize"+c,p.event.resize),u.off("scroll"+c).on("scroll"+c,p.event.scroll).on("scrollchange"+c,p.event.scrollchange)}},event:{changed:function(e){clearTimeout(p.timer),p.timer=setTimeout(function(){p.verbose("DOM tree modified, updating sticky menu",e),p.refresh()},100)},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==g||0<T(e).find(g).length)&&(p.debug("Element removed from DOM, tearing down events"),p.destroy())})})},load:function(){p.verbose("Page contents finished loading"),h(p.refresh)},resize:function(){p.verbose("Window resized"),h(p.refresh)},scroll:function(){h(function(){u.triggerHandler("scrollchange"+c,u.scrollTop())})},scrollchange:function(e,t){p.stick(t),l.onScroll.call(g)}},refresh:function(e){p.reset(),l.context||p.determineContext(),e&&p.determineContainer(),p.save.positions(),p.stick(),l.onReposition.call(g)},supports:{sticky:function(){vare=T("<div/>");returne.addClass(i.supported),e.css("position").match("sticky")}},save:{lastScroll:function(e){p.lastScroll=e},elementScroll:function(e){p.elementScroll=e},positions:function(){vare={height:u.height()},t={margin:{top:parseInt(f.css("margin-top"),10),bottom:parseInt(f.css("margin-bottom"),10)},offset:f.offset(),width:f.outerWidth(),height:f.outerHeight()},o={offset:n.offset(),height:n.outerHeight()};p.is.standardScroll()||(p.debug("Non-standard scroll. Removing scroll offset from element offset"),e.top=u.scrollTop(),e.left=u.scrollLeft(),t.offset.top+=e.top,o.offset.top+=e.top,t.offset.left+=e.left,o.offset.left+=e.left),p.cache={fits:t.height+l.offset<=e.height,sameHeight:t.height==o.height,scrollContext:{height:e.height},element:{margin:t.margin,top:t.offset.top-t.margin.top,left:t.offset.left,width:t.width,height:t.height,bottom:t.offset.top+t.height},context:{top:o.offset.top,height:o.height,bottom:o.offset.top+o.height}},p.set.containerSize(),p.stick(),p.debug("Caching element positions"