(F=>{function e(t,o){var e,n,s,r,a=!1,c=!1,i=!1,f={},p={to:"top",offset:0,effectsOffset:0,parent:!1,classes:{sticky:"sticky",stickyActive:"sticky-active",stickyEffects:"sticky-effects",spacer:"sticky-spacer"},isRTL:!1,handleScrollbarWidth:!1},l=function(t,o,i){var s={},e=t[0].style;i.forEach(function(t){s[t]=void 0!==e[t]?e[t]:""}),t.data("css-backup-"+o,s)},d=function(t,o){return t.data("css-backup-"+o)};let m=()=>{var t;r=w(e,"width"),s=e.offset().left,n.isRTL&&(t=n.handleScrollbarWidth?window.innerWidth:document.body.offsetWidth,s=Math.max(t-r-s,0))};var u=function(){f.$spacer=e.clone().addClass(n.classes.spacer).css({visibility:"hidden",transition:"none",animation:"none"}),e.after(f.$spacer)},h=function(){f.$spacer.remove()},y=function(){l(e,"unsticky",["position","width","margin-top","margin-bottom","top","bottom","inset-inline-start"]);var t={position:"fixed",width:r,marginTop:0,marginBottom:0};t[n.to]=n.offset,t["top"===n.to?"bottom":"top"]="",s&&(t["inset-inline-start"]=s+"px"),e.css(t).addClass(n.classes.stickyActive)},k=function(){e.css(d(e,"unsticky")).removeClass(n.classes.stickyActive)},b=function(){l(f.$parent,"childNotFollowing",["position"]),f.$parent.css("position","relative"),l(e,"notFollowing",["position","inset-inline-start","top","bottom"]);var t,o,i={position:"absolute"};s=f.$spacer.position().left,n.isRTL&&(t=e.parent().outerWidth(),o=f.$spacer.position().left,r=f.$spacer.outerWidth(),s=Math.max(t-r-o,0)),i["inset-inline-start"]=s+"px",i[n.to]="",i["top"===n.to?"bottom":"top"]=0,e.css(i),c=!0},v=function(){f.$parent.css(d(f.$parent,"childNotFollowing")),e.css(d(e,"notFollowing")),c=!1},w=function(t,o,i){var s=getComputedStyle(t[0]),e=parseFloat(s[o]),n="height"===o?["top","bottom"]:["left","right"],t=[];return"border-box"!==s.boxSizing&&t.push("border","padding"),i&&t.push("margin"),t.forEach(function(o){n.forEach(function(t){e+=parseFloat(s[o+"-"+t])})}),e},g=function(t){var o=f.$window.scrollTop(),i=w(t,"height"),s=innerHeight,t=t.offset().top-o,o=t-s;return{top:{fromTop:t,fromBottom:o},bottom:{fromTop:t+i,fromBottom:o+i}}},$=function(){m(),u(),y(),a=!0,e.trigger("sticky:stick")},T=function(){k(),h(),a=!1,e.trigger("sticky:unstick")},B=function(){var t,o,i=g(e),s="top"===n.to;c?(s?i.top.fromTop>n.offset:i.bottom.fromBottom<-n.offset)&&v():(o=g(f.$parent),t=getComputedStyle(f.$parent[0]),t=parseFloat(t[s?"borderBottomWidth":"borderTopWidth"]),o=s?o.bottom.fromTop-t:o.top.fromBottom+t,(s?o<=i.bottom.fromTop:o>=i.top.fromBottom)&&b())},C=function(t){i&&-t<n.effectsOffset?(e.removeClass(n.classes.stickyEffects),i=!1):!i&&-t>=n.effectsOffset&&(e.addClass(n.classes.stickyEffects),i=!0)},x=function(){var t,o,i=n.offset;a?(t=g(f.$spacer),t="top"===n.to?t.top.fromTop-i:-t.bottom.fromBottom-i,n.parent&&B(),0<t&&T()):(o=g(e),(t="top"===n.to?o.top.fromTop-i:-o.bottom.fromBottom-i)<=0&&($(),n.parent)&&B()),C(t)},E=function(){x()},W=function(){a&&(k(),h(),m(),u(),y(),n.parent)&&(c=!1,B())};this.destroy=function(){a&&T(),f.$window.off("scroll",E).off("resize",W),e.removeClass(n.classes.sticky)},n=jQuery.extend(!0,p,o),e=F(t).addClass(n.classes.sticky),f.$window=F(window),n.parent&&(f.$parent=e.parent(),"parent"!==n.parent)&&(f.$parent=f.$parent.closest(n.parent)),f.$window.on({scroll:E,resize:W}),x()}F.fn.sticky=function(i){var s="string"==typeof i;return this.each(function(){var t=F(this);if(s){var o=t.data("sticky");if(!o)throw Error("Trying to perform the `"+i+"` method prior to initialization");if(!o[i])throw ReferenceError("Method `"+i+"` not found in sticky instance");o[i].apply(o,Array.prototype.slice.call(arguments,1)),"destroy"===i&&t.removeData("sticky")}else t.data("sticky",new e(this,i))}),this},window.Sticky=e})(jQuery);