!function(){"use strict";var e=angular.module("smoothScroll",[]),t=function(e,t){t=t||{};var n=t.duration||800,o=t.offset||0,a=t.easing||"easeInOutQuart",c=t.callbackBefore||function(){},r=t.callbackAfter||function(){},f=function(){return window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop};setTimeout(function(){var t,l,u=f(),i=0,s=function(e,t){return"easeInQuad"==e?t*t:"easeOutQuad"==e?t*(2-t):"easeInOutQuad"==e?.5>t?2*t*t:-1+(4-2*t)*t:"easeInCubic"==e?t*t*t:"easeOutCubic"==e?--t*t*t+1:"easeInOutCubic"==e?.5>t?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1:"easeInQuart"==e?t*t*t*t:"easeOutQuart"==e?1- --t*t*t*t:"easeInOutQuart"==e?.5>t?8*t*t*t*t:1-8*--t*t*t*t:"easeInQuint"==e?t*t*t*t*t:"easeOutQuint"==e?1+--t*t*t*t*t:"easeInOutQuint"==e?.5>t?16*t*t*t*t*t:1+16*--t*t*t*t*t:t},d=function(e){var t=0;if(e.offsetParent)do t+=e.offsetTop,e=e.offsetParent;while(e);return t=Math.max(t-o,0)},b=d(e),k=b-u,m=function(){var t=f();l!=b&&t!=b&&window.innerHeight+t1?1:t,l=u+k*s(a,t),window.scrollTo(0,l),m()};c(e);var I=setInterval(v,16)},0)};e.factory("smoothScroll",function(){return t}),e.directive("smoothScroll",["smoothScroll",function(e){return{restrict:"A",scope:{callbackBefore:"&",callbackAfter:"&"},link:function(t,n,o){(void 0===o.scrollIf||"true"===o.scrollIf)&&setTimeout(function(){var a=function(e){if(o.callbackBefore){var n=t.callbackBefore({element:e});"function"==typeof n&&n(e)}},c=function(e){if(o.callbackAfter){var n=t.callbackAfter({element:e});"function"==typeof n&&n(e)}};e(n[0],{duration:o.duration,offset:o.offset,easing:o.easing,callbackBefore:a,callbackAfter:c})},0)}}}]),e.directive("scrollTo",["smoothScroll",function(e){return{restrict:"A",scope:{callbackBefore:"&",callbackAfter:"&"},link:function(t,n,o){var a;n.on("click",function(n){if(n.preventDefault(),a=document.getElementById(o.scrollTo)){var c=function(e){if(o.callbackBefore){var n=t.callbackBefore({element:e});"function"==typeof n&&n(e)}},r=function(e){if(o.callbackAfter){var n=t.callbackAfter({element:e});"function"==typeof n&&n(e)}};return e(a,{duration:o.duration,offset:o.offset,easing:o.easing,callbackBefore:c,callbackAfter:r}),!1}})}}}])}();