!function(T,O,A){"use strict";functionz(e){return"function"==typeofe&&"number"!=typeofe.nodeType}O=void0!==O&&O.Math===Math?O:globalThis,T.fn.visibility=function(p){varh,e=T(this),P=Date.now(),x=[],y=p,C="string"==typeofy,S=[].slice.call(arguments,1),V=function(e,o){varn;return0<=[O,A].indexOf(e)?n=T(e):0===(n=T(o.document).find(e)).length&&(n=o.frameElement?V(e,o.parent):O),n},R=e.length,k=0;returne.each(function(){vare,o,n,i=T.isPlainObject(p)?T.extend(!0,{},T.fn.visibility.settings,p):T.extend({},T.fn.visibility.settings),t=i.className,s=i.namespace,r=i.error,c=i.metadata,a="."+s,l="module-"+s,d=T(O),u=T(this),f=V(i.context,O),v=u.data(l),b=this,g=!1,m={initialize:function(){m.debug("Initializing",i),m.setup.cache(),m.should.trackChanges()&&("image"===i.type&&m.setup.image(),"fixed"===i.type&&m.setup.fixed(),i.observeChanges&&m.observeChanges(),m.bind.events()),m.save.position(),m.is.visible()||m.error(r.visible,u),i.initialCheck&&m.checkVisibility(),m.instantiate()},instantiate:function(){m.debug("Storing instance",m),u.data(l,m),v=m},destroy:function(){m.verbose("Destroying previous module"),n&&n.disconnect(),o&&o.disconnect(),d.off("load"+a,m.event.load).off("resize"+a,m.event.resize),f.off("scroll"+a,m.event.scroll).off("scrollchange"+a,m.event.scrollchange),"fixed"===i.type&&(m.resetFixed(),m.remove.placeholder()),u.off(a).removeData(l)},observeChanges:function(){"MutationObserver"inO&&(o=newMutationObserver(m.event.contextChanged),n=newMutationObserver(m.event.changed),o.observe(A,{childList:!0,subtree:!0}),n.observe(b,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",n))},bind:{events:function(){m.verbose("Binding visibility events to scroll and resize"),i.refreshOnLoad&&d.on("load"+a,m.event.load),d.on("resize"+a,m.event.resize),f.off("scroll"+a).on("scroll"+a,m.event.scroll).on("scrollchange"+a,m.event.scrollchange)}},event:{changed:function(e){m.verbose("DOM tree modified, updating visibility calculations"),m.timer=setTimeout(function(){m.verbose("DOM tree modified, updating sticky menu"),m.refresh()},100)},contextChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===b||0<T(e).find(b).length)&&(m.debug("Element removed from DOM, tearing down events"),m.destroy())})})},resize:function(){m.debug("Window resized"),i.refreshOnResize&&requestAnimationFrame(m.refresh)},load:function(){m.debug("Page finished loading"),requestAnimationFrame(m.refresh)},scroll:function(){i.throttle?(clearTimeout(m.timer),m.timer=setTimeout(function(){f.triggerHandler("scrollchange"+a,[f.scrollTop()])},i.throttle)):requestAnimationFrame(function(){f.triggerHandler("scrollchange"+a,[f.scrollTop()])})},scrollchange:function(e,o){m.checkVisibility(o)}},precache:function(e,o){for(varn=(e=Array.isArray(e)?e:[e]).length,t=0,i=[],s=A.createElement("img"),c=function(){++t>=e.length&&z(o)&&o()};n--;)(s=A.createElement("img")).addEventListener("load",c),s.addEventListener("error",c),s.src=e[n],i.push(s)},enableCallbacks:function(){m.debug("Allowing callbacks to occur"),g=!1},disableCallbacks:function(){m.debug("Disabling all callbacks temporarily"),g=!0},should:{trackChanges:function(){returnC?(m.debug("One time query, no need to bind events"),!1):(m.debug("Callbacks being attached"),!0)}},setup:{cache:function(){m.cache={occurred:{},screen:{},element:{}}},image:function(){vare=u.data(c.src);e&&(m.verbose("Lazy loading image",e),i.once=!0,i.observeChanges=!1,i.onOnScreen=function(){m.debug("Image on screen",b),m.precache(e,function(){m.set.image(e,function(){++k===R&&i.onAllLoaded.call(this),i.onLoad.call(this)})})})},fixed:function(){m.debug("Setting up fixed"),i.once=!1,i.observeChanges=!1,i.initialCheck=!0,i.refreshOnLoad=!0,p.transition||(i.transition=!1),m.create.placeholder(),m.debug("Added placeholder",e),i.onTopPassed=function(){m.debug("Element passed, adding fixed position",u),m.show.placeholder(),m.set.fixed(),i.transition&&void0!==T.fn.transition&&u.transition(i.transition,i.duration)},i.onTopPassedReverse=function(){m.debug("Elementreturn