function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(function(){var t,e;t=window.jQuery,e=t(window),t.fn.stick_in_parent=function(i){var o,n,r,s,a,c,l,u,p,f,d,h,g;for(null==i&&(i={}),g=i.sticky_class,c=i.inner_scrolling,h=i.recalc_every,d=i.parent,p=i.offset_top,u=i.spacer,r=i.bottoming,null==p&&(p=0),null==d&&(d=void 0),null==c&&(c=!0),null==g&&(g="is_stuck"),o=t(document),null==r&&(r=!0),f=function(t){var e,i;return window.getComputedStyle?(t[0],e=window.getComputedStyle(t[0]),i=parseFloat(e.getPropertyValue("width"))+parseFloat(e.getPropertyValue("margin-left"))+parseFloat(e.getPropertyValue("margin-right")),"border-box"!==e.getPropertyValue("box-sizing")&&(i+=parseFloat(e.getPropertyValue("border-left-width"))+parseFloat(e.getPropertyValue("border-right-width"))+parseFloat(e.getPropertyValue("padding-left"))+parseFloat(e.getPropertyValue("padding-right"))),i):t.outerWidth(!0)},s=function(i,n,s,a,l,y,k,m){var w,_,v,b,C,x,V,P,F,S,H,j;if(!i.data("sticky_kit")){if(i.data("sticky_kit",!0),C=o.height(),V=i.parent(),null!=d&&(V=V.closest(d)),!V.length)throw"failed to find stick parent";if(v=!1,w=!1,H=null!=u?u&&i.closest(u):t("<div />"),H&&H.css("position",i.css("position")),P=function(){var t,e,r;if(!m)return C=o.height(),t=parseInt(V.css("border-top-width"),10),e=parseInt(V.css("padding-top"),10),n=parseInt(V.css("padding-bottom"),10),s=V.offset().top+t+e,a=V.height(),v&&(v=!1,w=!1,null==u&&(i.insertAfter(H),H.detach()),i.css({position:"",top:"",width:"",bottom:""}).removeClass(g),r=!0),l=i.offset().top-(parseInt(i.css("margin-top"),10)||0)-p,y=i.outerHeight(!0),k=i.css("float"),H&&H.css({width:f(i),height:y,display:i.css("display"),"vertical-align":i.css("vertical-align"),float:k}),r?j():void 0},P(),y!==a)return b=void 0,x=p,S=h,j=function(){var t,f,d,_,F,j;if(!m)return d=!1,null!=S&&(S-=1)<=0&&(S=h,P(),d=!0),d||o.height()===C||(P(),d=!0),_=e.scrollTop(),null!=b&&(f=_-b),b=_,v?(r&&(F=_+y+x>a+s,w&&!F&&(w=!1,i.css({position:"fixed",bottom:"",top:x}).trigger("sticky_kit:unbottom"))),_<l&&(v=!1,x=p,null==u&&("left"!==k&&"right"!==k||i.insertAfter(H),H.detach()),t={position:"",width:"",top:""},i.css(t).removeClass(g).trigger("sticky_kit:unstick")),c&&(j=e.height(),y+p>j&&(w||(x-=f,x=Math.max(j-y,x),x=Math.min(p,x),v&&i.css({top:x+"px"}))))):_>l&&(v=!0,t={position:"fixed",top:x},t.width="border-box"===i.css("box-sizing")?i.outerWidth()+"px":i.width()+"px",i.css(t).addClass(g),null==u&&(i.after(H),"left"!==k&&"right"!==k||H.append(i)),i.trigger("sticky_kit:stick")),v&&r&&(null==F&&(F=_+y+x>a+s),!w&&F)?(w=!0,"static"===V.css("position")&&V.css({position:"relative"}),i.css({position:"absolute",bottom:n,top:"auto"}).trigger("sticky_kit:bottom")):void 0},F=function(){return P(),j()},_=function(){if(m=!0,e.off("touchmove",j),e.off("scroll",j),e.off("resize",F),t(document.body).off("sticky_kit:recalc",F),i.off("sticky_kit:detach",_),i.removeData("sticky_kit"),i.css({position:"",bottom:"",top:"",width:""}),V.position("position",""),v)return null==u&&("left"!==k&&"right"!==k||i.insertAfter(H),H.remove()),i.removeClass(g)},e.on("touchmove",j),e.on("scroll",j),e.on("resize",F),t(document.body).on("sticky_kit:recalc",F),i.on("sticky_kit:detach",_),setTimeout(j,0)}},a=0,l=this.length;a<l;a++)n=this[a],s(t(n));return this}}).call(this);var _createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}();!function(t){var e=function(){function e(){_classCallCheck(this,e),this.top=20,this.setupValue(),this.initSticky()}return _createClass(e,[{key:"setupValue",value:function(){if(t("#main").outerHeight()<t("#secondary").outerHeight)return!1;this.top=20;var e=t("#wpadminbar"),i=t(".osf-sticky-active");e.length>0&&(this.top+=e.height()),i.length>0&&(this.top+=i.outerHeight())}},{key:"initSticky",value:function(){var e=this,i=t(window).width();i<992?jQuery("#secondary > .inner, .woocommerce-single-style-3 .entry-summary .inner").trigger("sticky_kit:detach"):this._makeStickyKit(),t(window).resize(function(){i=t(window).width(),i<992?jQuery("#secondary > .inner, .woocommerce-single-style-3 .entry-summary .inner").trigger("sticky_kit:detach"):e._makeStickyKit()})}},{key:"_makeStickyKit",value:function(){if(t("#main").outerHeight()<t("#secondary .inner").outerHeight())return!1;t("#secondary > .inner").stick_in_parent({parent:"#content > .wrap",offset_top:20}),t("#portfolio-secondary > .inner").stick_in_parent({parent:".portfolio-wrap",offset_top:20}),t(".woocommerce-single-style-3 .entry-summary .inner").stick_in_parent({parent:".woocommerce-single-style-3 .site-main > .product",offset_top:20})}}]),e}();t(document).ready(function(){new e})}(jQuery);
//# sourceMappingURL=sticky-layout.js.map
