/*! scrollmagic v2.0.6 | (c) 2018 jan paepke (@janpaepke) | license & info: http://scrollmagic.io */ !function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.scrollmagic=t()}(this,function(){"use strict";var e=function(){};e.version="2.0.6",window.addeventlistener("mousewheel",function(){});var t="data-scrollmagic-pin-spacer";e.controller=function(r){var o,s,a="scrollmagic.controller",l="forward",c="reverse",f="paused",u=n.defaults,d=this,h=i.extend({},u,r),g=[],p=!1,v=0,m=f,w=!0,y=0,s=!0,b=function(){for(var e in h)u.hasownproperty(e)||delete h[e];if(h.container=i.get.elements(h.container)[0],!h.container)throw a+" init failed.";w=h.container===window||h.container===document.body||!document.body.contains(h.container),w&&(h.container=window),y=z(),h.container.addeventlistener("resize",t),h.container.addeventlistener("scroll",t);var t=parseint(h.refreshinterval,10);h.refreshinterval=i.type.number(t)?t:u.refreshinterval,e()},e=function(){h.refreshinterval>0&&(s=window.settimeout(a,h.refreshinterval))},x=function(){return h.vertical?i.get.scrolltop(h.container):i.get.scrollleft(h.container)},z=function(){return h.vertical?i.get.height(h.container):i.get.width(h.container)},c=this._setscrollpos=function(e){h.vertical?w?window.scrollto(i.get.scrollleft(),e):h.container.scrolltop=e:w?window.scrollto(e,i.get.scrolltop()):h.container.scrollleft=e},f=function(){if(s&&p){var e=i.type.array(p)?p:g.slice(0);p=!1;var t=v;v=d.scrollpos();var n=v-t;0!==n&&(m=n>0?l:c),m===c&&e.reverse(),e.foreach(function(e){e.update(!0)})}},l=function(){o=i.raf(f)},t=function(e){"resize"==e.type&&(y=z(),m=f),p!==!0&&(p=!0,l())},a=function(){if(!w&&y!=z()){var e;try{e=new event("resize",{bubbles:!1,cancelable:!1})}catch(t){e=document.createevent("event"),e.initevent("resize",!1,!1)}h.container.dispatchevent(e)}g.foreach(function(e){e.refresh()}),e()};this._options=h;var n=function(e){if(e.length<=1)return e;var t=e.slice(0);return t.sort(function(e,t){return e.scrolloffset()>t.scrolloffset()?1:-1}),t};return this.addscene=function(t){if(i.type.array(t))t.foreach(function(e){d.addscene(e)});else if(t instanceof e.scene)if(t.controller()!==d)t.addto(d);else if(g.indexof(t)<0){g.push(t),g=n(g),t.on("shift.controller_sort",function(){g=n(g)});for(var n in h.globalsceneoptions)t[n]&&t[n].call(t,h.globalsceneoptions[n])}return d},this.removescene=function(e){if(i.type.array(e))e.foreach(function(e){d.removescene(e)});else{var t=g.indexof(e);t>-1&&(e.off("shift.controller_sort"),g.splice(t,1),e.remove())}return d},this.updatescene=function(t,n){return i.type.array(t)?t.foreach(function(e){d.updatescene(e,n)}):n?t.update(!0):p!==!0&&t instanceof e.scene&&(p=p||[],-1==p.indexof(t)&&p.push(t),p=n(p),l()),d},this.update=function(e){return t({type:"resize"}),e&&f(),d},this.scrollto=function(n,r){if(i.type.number(n))c.call(h.container,n,r);else if(n instanceof e.scene)n.controller()===d&&d.scrollto(n.scrolloffset(),r);else if(i.type.function(n))c=n;else{var o=i.get.elements(n)[0];if(o){for(;o.parentnode.hasattribute(t);)o=o.parentnode;var s=h.vertical?"top":"left",a=i.get.offset(h.container),l=i.get.offset(o);w||(a[s]-=d.scrollpos()),d.scrollto(l[s]-a[s],r)}}return d},this.scrollpos=function(e){return arguments.length?(i.type.function(e)&&(x=e),d):x.call(d)},this.info=function(e){var t={size:y,vertical:h.vertical,scrollpos:v,scrolldirection:m,container:h.container,isdocument:w};return arguments.length?void 0!==t[e]?t[e]:void 0:t},this.loglevel=function(){return d},this.enabled=function(e){return arguments.length?(s!=e&&(s=!!e,d.updatescene(g,!0)),d):s},this.destroy=function(e){window.cleartimeout(s);for(var t=g.length;t--;)g[t].destroy(e);return h.container.removeeventlistener("resize",t),h.container.removeeventlistener("scroll",t),i.caf(o),null},b(),d};var n={defaults:{container:window,vertical:!0,globalsceneoptions:{},loglevel:2,refreshinterval:100}};e.controller.addoption=function(e,t){n.defaults[e]=t},e.controller.extend=function(t){var n=this;e.controller=function(){return n.apply(this,arguments),this.$super=i.extend({},this),t.apply(this,arguments)||this},i.extend(e.controller,n),e.controller.prototype=n.prototype,e.controller.prototype.constructor=e.controller},e.scene=function(n){var o,s,a="before",l="during",c="after",f=r.defaults,u=this,d=i.extend({},f,n),h=a,g=0,p={start:0,end:0},v=0,m=!0,w=function(){for(var e in d)f.hasownproperty(e)||delete d[e];for(var t in f)l(t);c()},y={};this.on=function(e,t){return i.type.function(t)&&(e=e.trim().split(" "),e.foreach(function(e){var n=e.split("."),r=n[0],i=n[1];"*"!=r&&(y[r]||(y[r]=[]),y[r].push({namespace:i||"",callback:t}))})),u},this.off=function(e,t){return e?(e=e.trim().split(" "),e.foreach(function(e){var n=e.split("."),r=n[0],i=n[1]||"",o="*"===r?object.keys(y):[r];o.foreach(function(e){for(var n=y[e]||[],r=n.length;r--;){var o=n[r];!o||i!==o.namespace&&"*"!==i||t&&t!=o.callback||n.splice(r,1)}n.length||delete y[e]})}),u):u},this.trigger=function(t,n){if(t){var r=t.trim().split("."),i=r[0],o=r[1],s=y[i];s&&s.foreach(function(t){o&&o!==t.namespace||t.callback.call(u,new e.event(i,t.namespace,u,n))})}return u},u.on("change.internal",function(e){"loglevel"!==e.what&&"tweenchanges"!==e.what&&("triggerelement"===e.what?e():"reverse"===e.what&&u.update())}).on("shift.internal",function(){s(),u.update()}),this.addto=function(t){return t instanceof e.controller&&s!=t&&(s&&s.removescene(u),s=t,c(),b(!0),e(!0),s(),s.info("container").addeventlistener("resize",x),t.addscene(u),u.trigger("add",{controller:s}),u.update()),u},this.enabled=function(e){return arguments.length?(m!=e&&(m=!!e,u.update(!0)),u):m},this.remove=function(){if(s){s.info("container").removeeventlistener("resize",x);var e=s;s=void 0,e.removescene(u),u.trigger("remove")}return u},this.destroy=function(e){return u.trigger("destroy",{reset:e}),u.remove(),u.off("*.*"),null},this.update=function(e){if(s)if(e)if(s.enabled()&&m){var t,n=s.info("scrollpos");t=d.duration>0?(n-p.start)/(p.end-p.start):n>=p.start?1:0,u.trigger("update",{startpos:p.start,endpos:p.end,scrollpos:n}),u.progress(t)}else t&&h===l&&n(!0);else s.updatescene(u,!1);return u},this.refresh=function(){return b(),e(),u},this.progress=function(e){if(arguments.length){var t=!1,n=h,r=s?s.info("scrolldirection"):"paused",i=d.reverse||e>=g;if(0===d.duration?(t=g!=e,g=1>e&&i?0:1,h=0===g?a:l):0>e&&h!==a&&i?(g=0,h=a,t=!0):e>=0&&1>e&&i?(g=e,h=l,t=!0):e>=1&&h!==c?(g=1,h=c,t=!0):h!==l||i||n(),t){var o={progress:g,state:h,scrolldirection:r},f=h!=n,p=function(e){u.trigger(e,o)};f&&n!==l&&(p("enter"),p(n===a?"start":"end")),p("progress"),f&&h!==l&&(p(h===a?"start":"end"),p("leave"))}return u}return g};var s=function(){p={start:v+d.offset},s&&d.triggerelement&&(p.start-=s.info("size")*d.triggerhook),p.end=p.start+d.duration},b=function(e){if(o){var t="duration";f(t,o.call(u))&&!e&&(u.trigger("change",{what:t,newval:d[t]}),u.trigger("shift",{reason:t}))}},e=function(e){var n=0,r=d.triggerelement;if(s&&(r||v>0)){if(r)if(r.parentnode){for(var o=s.info(),a=i.get.offset(o.container),l=o.vertical?"top":"left";r.parentnode.hasattribute(t);)r=r.parentnode;var c=i.get.offset(r);o.isdocument||(a[l]-=s.scrollpos()),n=c[l]-a[l]}else u.triggerelement(void 0);var f=n!=v;v=n,f&&!e&&u.trigger("shift",{reason:"triggerelementposition"})}},x=function(){d.triggerhook>0&&u.trigger("shift",{reason:"containerresize"})},z=i.extend(r.validate,{duration:function(e){if(i.type.string(e)&&e.match(/^(\.|\d)*\d+%$/)){var t=parsefloat(e)/100;e=function(){return s?s.info("size")*t:0}}if(i.type.function(e)){o=e;try{e=parsefloat(o())}catch(n){e=-1}}if(e=parsefloat(e),!i.type.number(e)||0>e)throw o?(o=void 0,0):0;return e}}),c=function(e){e=arguments.length?[e]:object.keys(z),e.foreach(function(e){var t;if(z[e])try{t=z[e](d[e])}catch(n){t=f[e]}finally{d[e]=t}})},f=function(e,t){var n=!1,r=d[e];return d[e]!=t&&(d[e]=t,c(e),n=r!=d[e]),n},l=function(e){u[e]||(u[e]=function(t){return arguments.length?("duration"===e&&(o=void 0),f(e,t)&&(u.trigger("change",{what:e,newval:d[e]}),r.shifts.indexof(e)>-1&&u.trigger("shift",{reason:e})),u):d[e]})};this.controller=function(){return s},this.state=function(){return h},this.scrolloffset=function(){return p.start},this.triggerposition=function(){var e=d.offset;return s&&(e+=d.triggerelement?v:s.info("size")*u.triggerhook()),e};var t,a;u.on("shift.internal",function(e){var t="duration"===e.reason;(h===c&&t||h===l&&0===d.duration)&&n(),t&&o()}).on("progress.internal",function(){n()}).on("add.internal",function(){o()}).on("destroy.internal",function(e){u.removepin(e.reset)});var n=function(e){if(t&&s){var t=s.info(),n=a.spacer.firstchild;if(e||h!==l){var r={position:a.inflow?"relative":"absolute",top:0,left:0},o=i.css(n,"position")!=r.position;a.pushfollowers?d.duration>0&&(h===c&&0===parsefloat(i.css(a.spacer,"padding-top"))?o=!0:h===a&&0===parsefloat(i.css(a.spacer,"padding-bottom"))&&(o=!0)):r[t.vertical?"top":"left"]=d.duration*g,i.css(n,r),o&&o()}else{"fixed"!=i.css(n,"position")&&(i.css(n,{position:"fixed"}),o());var f=i.get.offset(a.spacer,!0),u=d.reverse||0===d.duration?t.scrollpos-p.start:math.round(g*d.duration*10)/10;f[t.vertical?"top":"left"]+=u,i.css(a.spacer.firstchild,{top:f.top,left:f.left})}}},o=function(){if(t&&s&&a.inflow){var e=h===l,t=s.info("vertical"),n=a.spacer.firstchild,r=i.ismargincollapsetype(i.css(a.spacer,"display")),o={};a.relsize.width||a.relsize.autofullwidth?e?i.css(t,{width:i.get.width(a.spacer)}):i.css(t,{width:"100%"}):(o["min-width"]=i.get.width(t?t:n,!0,!0),o.width=e?o["min-width"]:"auto"),a.relsize.height?e?i.css(t,{height:i.get.height(a.spacer)-(a.pushfollowers?d.duration:0)}):i.css(t,{height:"100%"}):(o["min-height"]=i.get.height(t?n:t,!0,!r),o.height=e?o["min-height"]:"auto"),a.pushfollowers&&(o["padding"+(t?"top":"left")]=d.duration*g,o["padding"+(t?"bottom":"right")]=d.duration*(1-g)),i.css(a.spacer,o)}},_=function(){s&&t&&h===l&&!s.info("isdocument")&&n()},p=function(){s&&t&&h===l&&((a.relsize.width||a.relsize.autofullwidth)&&i.get.width(window)!=i.get.width(a.spacer.parentnode)||a.relsize.height&&i.get.height(window)!=i.get.height(a.spacer.parentnode))&&o()},d=function(e){s&&t&&h===l&&!s.info("isdocument")&&(e.preventdefault(),s._setscrollpos(s.info("scrollpos")-((e.wheeldelta||e[s.info("vertical")?"wheeldeltay":"wheeldeltax"])/3||30*-e.detail)))};this.setpin=function(e,n){var r={pushfollowers:!0,spacerclass:"scrollmagic-pin-spacer"};if(n=i.extend({},r,n),e=i.get.elements(e)[0],!e)return u;if("fixed"===i.css(e,"position"))return u;if(t){if(t===e)return u;u.removepin()}t=e;var o=t.parentnode.style.display,s=["top","left","bottom","right","margin","marginleft","marginright","margintop","marginbottom"];t.parentnode.style.display="none";var a="absolute"!=i.css(t,"position"),l=i.css(t,s.concat(["display"])),c=i.css(t,["width","height"]);t.parentnode.style.display=o,!a&&n.pushfollowers&&(n.pushfollowers=!1);var f=t.parentnode.insertbefore(document.createelement("div"),t),d=i.extend(l,{position:a?"relative":"absolute",boxsizing:"content-box",mozboxsizing:"content-box",webkitboxsizing:"content-box"});if(a||i.extend(d,i.css(t,["width","height"])),i.css(f,d),f.setattribute(t,""),i.addclass(f,n.spacerclass),a={spacer:f,relsize:{width:"%"===c.width.slice(-1),height:"%"===c.height.slice(-1),autofullwidth:"auto"===c.width&&a&&i.ismargincollapsetype(l.display)},pushfollowers:n.pushfollowers,inflow:a},!t.___origstyle){t.___origstyle={};var h=t.style,g=s.concat(["width","height","position","boxsizing","mozboxsizing","webkitboxsizing"]);g.foreach(function(e){t.___origstyle[e]=h[e]||""})}return a.relsize.width&&i.css(f,{width:c.width}),a.relsize.height&&i.css(f,{height:c.height}),f.appendchild(t),i.css(t,{position:a?"relative":"absolute",margin:"auto",top:"auto",left:"auto",bottom:"auto",right:"auto"}),(a.relsize.width||a.relsize.autofullwidth)&&i.css(t,{boxsizing:"border-box",mozboxsizing:"border-box",webkitboxsizing:"border-box"}),window.addeventlistener("scroll",_),window.addeventlistener("resize",_),window.addeventlistener("resize",p),t.addeventlistener("mousewheel",d),t.addeventlistener("dommousescroll",d),n(),u},this.removepin=function(e){if(t){if(h===l&&n(!0),e||!s){var n=a.spacer.firstchild;if(n.hasattribute(t)){var r=a.spacer.style,o=["margin","marginleft","marginright","margintop","marginbottom"],a={};o.foreach(function(e){a[e]=r[e]||""}),i.css(n,a)}a.spacer.parentnode.insertbefore(n,a.spacer),a.spacer.parentnode.removechild(a.spacer),t.parentnode.hasattribute(t)||(i.css(t,t.___origstyle),delete t.___origstyle)}window.removeeventlistener("scroll",_),window.removeeventlistener("resize",_),window.removeeventlistener("resize",p),t.removeeventlistener("mousewheel",d),t.removeeventlistener("dommousescroll",d),t=void 0}return u};var r,k=[];return u.on("destroy.internal",function(e){u.removeclasstoggle(e.reset)}),this.setclasstoggle=function(e,t){var n=i.get.elements(e);return 0!==n.length&&i.type.string(t)?(k.length>0&&u.removeclasstoggle(),r=t,k=n,u.on("enter.internal_class leave.internal_class",function(e){var t="enter"===e.type?i.addclass:i.removeclass;k.foreach(function(e){t(e,r)})}),u):u},this.removeclasstoggle=function(e){return e&&k.foreach(function(e){i.removeclass(e,r)}),u.off("start.internal_class end.internal_class"),r=void 0,k=[],u},w(),u};var r={defaults:{duration:0,offset:0,triggerelement:void 0,triggerhook:.5,reverse:!0,loglevel:2},validate:{offset:function(e){if(e=parsefloat(e),!i.type.number(e))throw 0;return e},triggerelement:function(e){if(e=e||void 0){var t=i.get.elements(e)[0];if(!t||!t.parentnode)throw 0;e=t}return e},triggerhook:function(e){var t={oncenter:.5,onenter:1,onleave:0};if(i.type.number(e))e=math.max(0,math.min(parsefloat(e),1));else{if(!(e in t))throw 0;e=t[e]}return e},reverse:function(e){return!!e}},shifts:["duration","offset","triggerhook"]};e.scene.addoption=function(e,t,n,i){e in r.defaults||(r.defaults[e]=t,r.validate[e]=n,i&&r.shifts.push(e))},e.scene.extend=function(t){var n=this;e.scene=function(){return n.apply(this,arguments),this.$super=i.extend({},this),t.apply(this,arguments)||this},i.extend(e.scene,n),e.scene.prototype=n.prototype,e.scene.prototype.constructor=e.scene},e.event=function(e,t,n,r){r=r||{};for(var i in r)this[i]=r[i];return this.type=e,this.target=this.currenttarget=n,this.namespace=t||"",this.timestamp=this.timestamp=date.now(),this};var i=e._util=function(e){var t,n={},r=function(e){return parsefloat(e)||0},i=function(t){return t.currentstyle?t.currentstyle:e.getcomputedstyle(t)},o=function(t,n,o,s){if(n=n===document?e:n,n===e)s=!1;else if(!u.domelement(n))return 0;t=t.charat(0).touppercase()+t.substr(1).tolowercase();var a=(o?n["offset"+t]||n["outer"+t]:n["client"+t]||n["inner"+t])||0;if(o&&s){var l=i(n);a+="height"===t?r(l.margintop)+r(l.marginbottom):r(l.marginleft)+r(l.marginright)}return a},s=function(e){return e.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(e){return e[1].touppercase()})};n.extend=function(e){for(e=e||{},t=1;t-1};var a=0,l=["ms","moz","webkit","o"],c=e.requestanimationframe,f=e.cancelanimationframe;for(t=0;!c&&t=0},u.domelement=function(e){return"object"==typeof htmlelement?e instanceof htmlelement:e&&"object"==typeof e&&null!==e&&1===e.nodetype&&"string"==typeof e.nodename};var d=n.get={};return d.elements=function(t){var n=[];if(u.string(t))try{t=document.queryselectorall(t)}catch(r){return n}if("nodelist"===u(t)||u.array(t))for(var i=0,o=n.length=t.length;o>i;i++){var s=t[i];n[i]=u.domelement(s)?s:d.elements(s)}else(u.domelement(t)||t===document||t===e)&&(n=[t]);return n},d.scrolltop=function(t){return t&&"number"==typeof t.scrolltop?t.scrolltop:e.pageyoffset||0},d.scrollleft=function(t){return t&&"number"==typeof t.scrollleft?t.scrollleft:e.pagexoffset||0},d.width=function(e,t,n){return o("width",e,t,n)},d.height=function(e,t,n){return o("height",e,t,n)},d.offset=function(e,t){var n={top:0,left:0};if(e&&e.getboundingclientrect){var r=e.getboundingclientrect();n.top=r.top,n.left=r.left,t||(n.top+=d.scrolltop(),n.left+=d.scrollleft())}return n},n.addclass=function(e,t){t&&(e.classlist?e.classlist.add(t):e.classname+=" "+t)},n.removeclass=function(e,t){t&&(e.classlist?e.classlist.remove(t):e.classname=e.classname.replace(regexp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))},n.css=function(e,t){if(u.string(t))return i(e)[s(t)];if(u.array(t)){var n={},r=i(e);return t.foreach(function(e){n[e]=r[s(e)]}),n}for(var o in t){var a=t[o];a==parsefloat(a)&&(a+="px"),e.style[s(o)]=a}},n}(window||{});return e});