!function(T){T.fn.theiaStickySidebar=function(i){var t,e,o,a,n,s;function d(i,t){return!0===i.initialized||!(T("body").width().theiaStickySidebar:after {content: ""; display: table; clear: both;}'));i.each(function(){var i={};if(i.sidebar=T(this),i.options=v||{},i.container=T(i.options.containerSelector),0==i.container.length&&(i.container=i.sidebar.parent()),i.sidebar.parents(":not(.theia-exception)").css("-webkit-transform","none"),i.sidebar.css({position:i.options.defaultPosition,overflow:"visible","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),i.stickySidebar=i.sidebar.find(".theiaStickySidebar"),0==i.stickySidebar.length){var e=/(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i;i.sidebar.find("script").filter(function(i,t){return 0===t.type.length||t.type.match(e)}).remove(),i.stickySidebar=T("
").addClass("theiaStickySidebar").append(i.sidebar.children()),i.sidebar.append(i.stickySidebar)}i.marginBottom=parseInt(i.sidebar.css("margin-bottom")),i.paddingTop=parseInt(i.sidebar.css("padding-top")),i.paddingBottom=parseInt(i.sidebar.css("padding-bottom"));var t,o,a,n=i.stickySidebar.offset().top,s=i.stickySidebar.outerHeight();function k(){i.fixedScrollTop=0,i.sidebar.css({"min-height":"1px"}),i.stickySidebar.css({position:"static",width:"",transform:"none"})}i.stickySidebar.css("padding-top",1),i.stickySidebar.css("padding-bottom",1),n-=i.stickySidebar.offset().top,s=i.stickySidebar.outerHeight()-s-n,0==n?(i.stickySidebar.css("padding-top",0),i.stickySidebarPaddingTop=0):i.stickySidebarPaddingTop=1,0==s?(i.stickySidebar.css("padding-bottom",0),i.stickySidebarPaddingBottom=0):i.stickySidebarPaddingBottom=1,i.previousScrollTop=null,i.fixedScrollTop=0,k(),i.onScroll=function(i){if(i.stickySidebar.is(":visible"))if(T("body").width()i.container.width())return void k()}var e,o,a=T(document).scrollTop(),n="static";if(a>=i.sidebar.offset().top+(i.paddingTop-i.options.additionalMarginTop)){var s,d=i.paddingTop+v.additionalMarginTop,r=i.paddingBottom+i.marginBottom+v.additionalMarginBottom,c=i.sidebar.offset().top,p=i.sidebar.offset().top+(e=i.container,o=e.height(),e.children().each(function(){o=Math.max(o,T(this).height())}),o),b=0+v.additionalMarginTop,l=i.stickySidebar.outerHeight()+d+r