!function(t){"use strict";var s,i=300;t.widget("apex.stickyWidget",{version:"5.1",widgetEventPrefix:"stickyWidget",options:{zIndexStart:-1,toggleHeight:!1,toggleWidth:!1,top:null,bottom:null,stickToEnd:!1,useWindow:!0,isFooter:!1,stick:null,unstick:null,stickEnd:null,unstickEnd:null},reStick:function(t){(this.stuck&&!this.stuckToEnd||t)&&(this.options.isFooter?this.element.css("position","fixed").css("bottom",this.options.bottom(this)):this.element.css("position","fixed").css("top",this.options.top(this)))},forceScrollParent:function(t){this._destroy(),s=t&&t.length>0?t:null,this.stuck=!1,this._create()},_stickToEnd:function(){var t,s,i;this.stuckToEnd||(this.stuckToEnd=!0,s=this.element,this.options.isFooter?(t=this.options.top.call(this),i="bottom"):(t=this.options.bottom.call(this)-s.outerHeight(),i="top"),s.css("bottom",""),s.css("position","absolute"),s.css("top",t-s.offsetParent().offset().top),this._trigger("stickEnd",null,{where:i,offset:t}))},_unstickFromEnd:function(){this.stuckToEnd&&(this.stuckToEnd=!1,this.options.isFooter&&this.element.css("top",""),this.stuck?(this.stuck=!1,this._stick()):(this.stuck=!0,this._unstick()),this._trigger("unstickEnd",null,{where:this.options.isFooter?"bottom":"top"}))},_stick:function(){if(!this.stuck){var t=this.element;t.addClass("is-stuck"),this.reStick(!0),this.stuck=!0,this.options.toggleHeight&&t.css("height",this.unstuckHeight),this.options.toggleWidth&&t.css("width",this.unstuckWidth),this.options.isFooter?this._trigger("stick",null,{where:"bottom",offset:this.element.css("bottom")}):this._trigger("stick",null,{where:"top",offset:this.element.css("top")})}},_unstick:function(){if(this.stuck){var t=this.element;t.removeClass("is-stuck"),t.css("position","absolute"),t.css(this.options.isFooter?"bottom":"top","auto"),this.stuck=!1,this._revertToCssWidthAndHeight(),this._recalculateFixedStuckDimensions(),this._trigger("unstick",null,{where:this.options.isFooter?"bottom":"top"})}},_revertToCssWidthAndHeight:function(){this.options.toggleHeight&&this.element.css("height",this.cssHeight),this.options.toggleWidth&&this.element.css("width",this.cssWidth)},_recalculateFixedStuckDimensions:function(){this.stuck||(this.unstuckWidth=this.element.outerWidth(),this.unstuckHeight=this.element.outerHeight())},_setupDimensions:function(){this._revertToCssWidthAndHeight(),this.replacement.css("width",this.element.outerWidth()).css("height",this.element.outerHeight())},refresh:function(){},handler:null,replacement:null,_getDefaultOffset:function(){return this.options.top?this.options.top.call(this):null},_storedTopOffset:null,_deferCreate:function(){let e,o=this.options,n=this.replacement=t('<div class="js-stickyWidget-placeholder"></div>'),h=this.element,r=null;s?this.scrollParent$=s:(this.scrollParent$=h.scrollParent(),o.useWindow&&(this.scrollParent$=t(window)));var c=this.isWindow=this.scrollParent$[0]===window,l=this.scrollParent$;h.addClass("js-stickyWidget-toggle"),-1===o.zIndexStart?(this.zIndex=i,i+=1):this.zIndex=o.zIndexStart,h.css("z-index",this.zIndex),n.insertAfter(h);var u=this;this._recalculateFixedStuckDimensions(),this.cssHeight=h.css("height"),this.cssWidth=h.css("width"),this._setupDimensions(),e=o.isFooter?function(){var t,s=l.scrollTop()+l.height()-o.bottom.call(u);if(o.stickToEnd){if(s-h.outerHeight()<o.top.call(u))return void u._stickToEnd();u._unstickFromEnd()}t=n.offset().top+n.outerHeight(),c||(t+=l.scrollTop()),s<t?u._stick():u._unstick()}:function(){var t,s=l.scrollTop()+o.top.call(u);if(o.stickToEnd){if(s+h.outerHeight()>=o.bottom.call(u))return void u._stickToEnd();u._unstickFromEnd()}t=n.offset().top,c||(t+=l.scrollTop()),s>=t?u._stick():u._unstick()},this.scrollHandler=function(){r||(r=apex.util.invokeAfterPaint((function(){r=null,e()})))},this.refresh=this.resizeHandler=function(){var t=h.parent(),s=t.width(),i=t.height();u._storedTopOffset!==u._getDefaultOffset()&&u.reStick(),u.cssWidth=s,u.cssHeight=i,u.unstuckWidth=s,u.unstuckHeight=i,u._setupDimensions(),u.scrollHandler()},l.on("scroll",this.scrollHandler),t(window).on("apexwindowresized",this.resizeHandler),h.on("forceresize",this.resizeHandler).css("position","absolute").css(o.isFooter?"bottom":"top","auto"),this.scrollHandler()},_create:function(){var s=this.options;this.stuck=!1,this.stuckToEnd=!1,this.cssWidth=0,this.cssHeight=0,this.unstuckWidth=0,this.unstuckHeight=0,this._storedTopOffset=this._getDefaultOffset(),s.isFooter?(s.top||(s.top=function(){var s=t(this.element).parent().offset().top;return this.isWindow||(s-=this.scrollParent$.offset().top-this.scrollParent$.scrollTop()),s}),s.bottom||(s.bottom=function(){return 0})):(s.top||(s.top=function(){return apex.theme.defaultStickyTop()}),s.bottom||(s.bottom=function(){var s=t(this.element).parent(),i=s.offset().top;return this.isWindow||(i-=this.scrollParent$.offset().top-this.scrollParent$.scrollTop()),i+s.outerHeight()})),this._deferCreate()},_destroy:function(){t(window).off("apexwindowresized",this.resizeHandler),this.scrollParent$.off("scroll",this.scrollHandler),this.replacement.remove(),this.element.removeAttr("style").removeClass("js-stickyWidget-toggle is-stuck").off("forceresize",this.resizeHandler).trigger("apexstickyWidgetdestroyed")}})}(apex.jQuery);