!function(z,T,w){"use strict";T=void0!==T&&T.Math===Math?T:globalThis,z.fn.sticky=function(p){varb,e=z(this),v=(z(w),Date.now()),x=[],C=p,S="string"==typeofC,y=[].slice.call(arguments,1),k=function(e,t){varo;return0<=[T,w].indexOf(e)?o=z(e):0===(o=z(t.document).find(e)).length&&(o=t.frameElement?k(e,t.parent):T),o};returne.each(function(){vart,n,e,o,c=z.isPlainObject(p)?z.extend(!0,{},z.fn.sticky.settings,p):z.extend({},z.fn.sticky.settings),i=c.className,s=c.namespace,l=c.error,r="."+s,a="module-"+s,f=z(this),m=z(T),d=k(c.scrollContext,T),u=f.data(a),h=this,g={initialize:function(){g.determineContainer(),g.determineContext(),g.verbose("Initializing sticky",c,t),g.save.positions(),g.checkErrors(),g.bind.events(),c.observeChanges&&g.observeChanges(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),u=g,f.data(a,g)},destroy:function(){g.verbose("Destroying previous instance"),g.reset(),e&&e.disconnect(),o&&o.disconnect(),m.off("load"+r,g.event.load).off("resize"+r,g.event.resize),d.off("scrollchange"+r,g.event.scrollchange),f.removeData(a)},observeChanges:function(){"MutationObserver"inT&&(e=newMutationObserver(g.event.documentChanged),o=newMutationObserver(g.event.changed),e.observe(w,{childList:!0,subtree:!0}),o.observe(h,{childList:!0,subtree:!0}),o.observe(n[0],{childList:!0,subtree:!0}),g.debug("Setting up mutation observer",o))},determineContainer:function(){t=c.container?k(c.container,T):f.offsetParent()},determineContext:function(){0===(n=c.context?k(c.context,T):t).length&&g.error(l.invalidContext,c.context,f)},checkErrors:function(){g.is.hidden()&&g.error(l.visible,f),g.cache.element.height>g.cache.context.height&&(g.reset(),g.error(l.elementSize,f))},bind:{events:function(){m.on("load"+r,g.event.load).on("resize"+r,g.event.resize),d.off("scroll"+r).on("scroll"+r,g.event.scroll).on("scrollchange"+r,g.event.scrollchange)}},event:{changed:function(e){clearTimeout(g.timer),g.timer=setTimeout(function(){g.verbose("DOM tree modified, updating sticky menu",e),g.refresh()},100)},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===h||0<z(e).find(h).length)&&(g.debug("Element removed from DOM, tearing down events"),g.destroy())})})},load:function(){g.verbose("Page contents finished loading"),requestAnimationFrame(g.refresh)},resize:function(){g.verbose("Window resized"),requestAnimationFrame(g.refresh)},scroll:function(){requestAnimationFrame(function(){d.triggerHandler("scrollchange"+r,d.scrollTop())})},scrollchange:function(e,t){g.stick(t),c.onScroll.call(h)}},refresh:function(e){g.reset(),c.context||g.determineContext(),e&&g.determineContainer(),g.save.positions(),g.stick(),c.onReposition.call(h)},supports:{sticky:function(){vare=z("<div/>");returne.addClass(i.supported),e.css("position").match("sticky")}},save:{lastScroll:function(e){g.lastScroll=e},elementScroll:function(e){g.elementScroll=e},positions:function(){vare={height:d.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()};g.is.standardScroll()||(g.debug("Non-standard scroll. Removing scroll offset from element offset"),e.top=d.scrollTop(),e.left=d.scrollLeft(),t.offset.top+=e.top,o.offset.top+=e.top,t.offset.left+=e.left,o.offset.left+=e.left),g.cache={fits:t.height+c.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}},g.set.containerSize(),g.stick(),g.debug("Caching element positions",g.cache)}},get:{direction:function(e){vart="down";returne=e||d.scrollTop(),t=g.lastScroll&&g.lastScroll>e?"up":t},scrollChange:function(e){returne=e||d.scrollTop(),g.lastScroll?e-g.lastScroll:0},currentElementScroll:function(){returng.elementScroll||(g.is.top()?Math.abs(parse