es6-tween
Advanced tools
Comparing version 5.5.1 to 5.5.2
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).TWEEN={})}(this,function(t){"use strict";var o,e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this||(void 0!==t?t:{}),r=e.requestAnimationFrame||function(t){return e.setTimeout(t,50/3)},s=e.cancelAnimationFrame||function(t){return e.clearTimeout(t)},F=function(){if("undefined"==typeof process||void 0===process.hrtime||process.versions&&void 0!==process.versions.electron){if(void 0!==e.performance&&void 0!==e.performance.now)return e.performance.now.bind(e.performance);var t=e.performance&&e.performance.timing&&e.performance.timing.navigationStart?e.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}}(),a=[],u=!1,f=!1,l=[],h=r,c=0,p=120,d=function(t){var e=a.indexOf(t);-1<e&&a.splice(e,1),a.push(t),c=0,f&&!u&&(o=h(i),u=!0)},n=function(t){for(var e=0;e<a.length;e++)if(t===a[e])return a[e];return null},x=function(t){var e=a.indexOf(t);-1!==e&&a.splice(e,1),0===a.length&&(s(o),u=!1)},i=function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:F(),r=1<arguments.length?arguments[1]:void 0;if(p<=c)return u=!1,c=0,s(o),!1;f&&u?o=h(t):function(){for(var t=0;t<l.length;t++)l[t]()}(),a.length||c++;for(var n=0,i=a.length;n<i;)a[n++].update(e,r),i>a.length&&n--,i=a.length;return!0},C=function(){return u},N={},v={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return--t*t*(2.70158*t+1.70158)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-v.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*v.Bounce.In(2*t):.5*v.Bounce.Out(2*t-1)+.5}},Stepped:{steps:function(e){return function(t){return(t*e|0)/e}}}};function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function g(t,e,r){return e&&_(t.prototype,e),r&&_(t,r),t}function b(i){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},e=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),e.forEach(function(t){var e,r,n;e=i,n=o[r=t],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return i}function T(t){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function k(t,e){return(k=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?w(t):e}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var q=50/3,D="_chainedTweens",j="Callback",U="update",V="complete",B="start",G="repeat",z="reverse",A="restart",S="STRING_PROP",P=/\s+|([A-Za-z?().,{}:""[\]#%]+)|([-+]=+)?([-+]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]=?\d+)?/g;function R(t){if(t&&t.nodeType||void 0===t||"object"!==m(t))return t;if(Array.isArray(t))return[].concat(t);if("object"!==m(t))return t;var e={};for(var r in t)e[r]=R(t[r]);return e}var M=function(t){return isNaN(+t)||("+"===t[0]||"-"===t[0])&&"="===t[1]||""===t||" "===t},I=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,L=function(t,e){var r,n,i;3===e.length&&(e=(r=e[0])+r+(n=e[1])+n+(i=e[2])+i);var o=parseInt(e,16);return"rgb("+(r=o>>16&255)+","+(n=o>>8&255)+","+(i=255&o)+")"};function Q(t){return"string"!=typeof t?t:t.replace(I,L).match(P).map(function(t){return M(t)?t:+t})}function X(r,n,t,e,i){var o=t[r],s=e[r];if("string"==typeof o||"string"==typeof s){for(var a=Array.isArray(o)&&o[0]===S?o:Q(o),u=Array.isArray(s)&&s[0]===S?s:Q(s),f=1;f<a.length;)a[f]===u[f]&&"string"==typeof a[f-1]?(a.splice(f-1,2,a[f-1]+a[f]),u.splice(f-1,2,u[f-1]+u[f])):f++;a[f=0]===S&&a.shift(),u[0]===S&&u.shift();for(var l={isString:!0,length:a.length},h={isString:!0,length:u.length};f<l.length;)l[f]=a[f],h[f]=u[f],f++;return t[r]=l,e[r]=h,!0}if("object"!==m(o)||"object"!==m(s))return!1;if(Array.isArray(o))return o.map(function(t,e){return X(e,n[r],o,s)});for(var c in s)X(c,n[r],o,s);return!0}var H="rgba(",K=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"rgb(";return"number"==typeof t[e]&&(t[e-1]===r||t[e-3]===r||t[e-5]===r)};function W(t,e,r,n,i,o,s){var a=s?r:r[t],u=s?n:n[t];if(void 0===u)return a;if(void 0===a||"string"==typeof a||a===u)return u;if("object"===m(a)&&"object"===m(u)){if(!a||!u)return e[t];if("object"===m(a)&&a&&a.isString){for(var f="",l=0,h=a.length;l<h;l++){var c="number"==typeof a[l]&&"string"==typeof u[l]&&"="===u[l][1],p="number"!=typeof a[l]?a[l]:c?a[l]+parseFloat(u[l][0]+u[l].substr(2))*i:a[l]+(u[l]-a[l])*i;(K(a,l)||K(a,l,H))&&(p|=0),f+=p,c&&1===o&&(a[l]=a[l]+parseFloat(u[l][0]+u[l].substr(2)))}return s||(e[t]=f),f}if(Array.isArray(a)&&a[0]!==S)for(var d=0,v=a.length;d<v;d++)a[d]!==u[d]&&W(d,e[t],a,u,i,o);else if("object"===m(a)&&a&&!a.isString)for(var y in a)a[y]!==u[y]&&W(y,e[t],a,u,i,o)}else if("number"==typeof a){var _="string"==typeof u;e[t]=_?a+parseFloat(u[0]+u.substr(2))*i:a+(u-a)*i,_&&1===o&&(r[t]=e[t])}else"function"==typeof u&&(e[t]=u(i));return e[t]}var $,Y=/([.[])/g,Z=/\]/g,J=function(t,e){var i=t[e],o=e.replace(Z,"").split(Y),s=o.length-1,a=Array.isArray(t),u="object"===m(t)&&!a;return u?(t[e]=null,delete t[e]):a&&t.splice(e,1),o.reduce(function(t,e,r){a&&"."!==e&&"["!==e&&(e*=1);var n="["===o[r+1];if("."===e||"["===e)return"."===e?a=!(u=!0):"["===e&&(a=!(u=!1)),t;if(void 0===t[e]){if(a||u)return t[e]=r===s?i:a||n?[]:u?{}:null,u=a=!1,t[e]}else if(void 0!==t[e])return r===s&&(t[e]=i),t[e];return t},t)},tt=function(t){if("object"===m(t)&&t)for(var e in t)if(-1!==e.indexOf(".")||-1!==e.indexOf("["))J(t,e);else if("object"===m(t[e])&&t[e]){var r=t[e];for(var n in r)if(-1!==n.indexOf(".")||-1!==n.indexOf("["))J(r,n);else if("object"===m(r[n])&&r[n]){var i=r[n];for(var o in i)-1===o.indexOf(".")&&-1===o.indexOf("[")||J(i,o)}}return t},et=Object.freeze({FRAME_MS:q,TOO_LONG_FRAME_MS:250,CHAINED_TWEENS:D,EVENT_CALLBACK:j,EVENT_UPDATE:U,EVENT_COMPLETE:V,EVENT_START:B,EVENT_REPEAT:G,EVENT_REVERSE:z,EVENT_PAUSE:"pause",EVENT_PLAY:"play",EVENT_RESTART:A,EVENT_STOP:"stop",EVENT_SEEK:"seek",STRING_PROP:S,NUM_REGEX:P,HEXC_REGEX:/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,deepCopy:R,decomposeString:Q,decompose:X,RGB:"rgb(",RGBA:H,isRGBColor:K,recompose:W,SET_NESTED:tt}),rt={Linear:function(t,e,r){var n=t.length-1,i=n*e,o=Math.floor(i),s=rt.Utils.Linear;return e<0?s(t[0],t[1],i,r):1<e?s(t[n],t[n-1],n-i,r):s(t[o],t[n<o+1?n:o+1],i-o,r)},Bezier:function(t,e,r){for(var n=rt.Utils.Reset(r),i=t.length-1,o=Math.pow,s=rt.Utils.Bernstein,a=Array.isArray(n),u=0;u<=i;u++)if("number"==typeof n)n+=o(1-e,i-u)*o(e,u)*t[u]*s(i,u);else if(a)for(var f=0,l=n.length;f<l;f++)"number"==typeof n[f]?n[f]+=o(1-e,i-u)*o(e,u)*t[u][f]*s(i,u):n[f]=t[u][f];else if("object"===m(n))for(var h in n)"number"==typeof n[h]?n[h]+=o(1-e,i-u)*o(e,u)*t[u][h]*s(i,u):n[h]=t[u][h];else if("string"==typeof n){for(var c="",p=t[Math.round(i*e)],d=1,v=p.length;d<v;d++)c+=p[d];return c}return n},CatmullRom:function(t,e,r){var n=t.length-1,i=n*e,o=Math.floor(i),s=rt.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(i=n*(1+e))),s(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],i-o,r)):e<0?s(t[1],t[1],t[0],t[0],-e,r):1<e?s(t[n-1],t[n-1],t[n],t[n],(0|e)-e,r):s(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],i-o,r)},Utils:{Linear:function(t,e,r,n){if("string"==typeof t)return e;if("number"==typeof t)return"function"==typeof t?t(r):t+(e-t)*r;if("object"===m(t)){if(void 0!==t.length){if(t[0]===S){for(var i="",o=1,s=t.length;o<s;o++){var a="number"==typeof t[o]?t[o]+(e[o]-t[o])*r:e[o];(K(t,o)||K(t,o,H))&&(a|=0),i+=a}return i}for(var u=0,f=n.length;u<f;u++)n[u]=rt.Utils.Linear(t[u],e[u],r,n[u])}else for(var l in n)n[l]=rt.Utils.Linear(t[l],e[l],r,n[l]);return n}},Reset:function(t){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;e++)t[e]=rt.Utils.Reset(t[e]);return t}if("object"!==m(t))return"number"==typeof t?0:t;for(var n in t)t[n]=rt.Utils.Reset(t[n]);return t},Bernstein:function(t,e){var r=rt.Utils.Factorial;return r(t)/r(e)/r(t-e)},Factorial:($=[1],function(t){var e=1;if($[t])return $[t];for(var r=t;1<r;r--)e*=r;return $[t]=e}),CatmullRom:function(t,e,r,n,i,o){if("string"==typeof t)return e;if("number"==typeof t){var s=.5*(r-t),a=.5*(n-e),u=i*i;return(2*e-2*r+s+a)*(i*u)+(-3*e+3*r-2*s-a)*u+s*i+e}if("object"===m(t)){if(void 0!==t.length){if(t[0]===S){for(var f="",l=1,h=t.length;l<h;l++){var c="number"==typeof t[l]?rt.Utils.CatmullRom(t[l],e[l],r[l],n[l],i):n[l];(K(t,l)||K(t,l,H))&&(c|=0),f+=c}return f}for(var p=0,d=o.length;p<d;p++)o[p]=rt.Utils.CatmullRom(t[p],e[p],r[p],n[p],i,o[p])}else for(var v in o)o[v]=rt.Utils.CatmullRom(t[v],e[v],r[v],n[v],i,o[v]);return o}}}},nt={};function it(t,e,r){if(!t||!t.nodeType)return e;var n=t.queueID||"q_"+Date.now();t.queueID||(t.queueID=n);var i=nt[n];if(i){if(i.object===e&&t===i.tween.node&&r._startTime===i.tween._startTime)x(i.tween);else if("object"===m(e)&&e&&i.object){for(var o in e)o in i.object&&(r._startTime===i.tween._startTime?delete i.object[o]:i.propNormaliseRequired=!0);i.object=b({},i.object,e)}return i.object}return"object"===m(e)&&e?(nt[n]={tween:r,object:e,propNormaliseRequired:!1},nt[n].object):e}function ot(t,e,r){return e?t?"undefined"!=typeof window&&t===window||"undefined"!=typeof document&&t===document?[t]:"string"==typeof t?!!document.querySelectorAll&&document.querySelectorAll(t):Array.isArray(t)?t:t.nodeType?[t]:r?t:[]:null:t?"undefined"!=typeof window&&t===window||"undefined"!=typeof document&&t===document?t:"string"==typeof t?!!document.querySelector&&document.querySelector(t):Array.isArray(t)?t[0]:t.nodeType?t:r?t:null:null}var st=0,at=v.Linear.None,ut=function(){function L(t,e){return y(this,L),this.id=st++,!t||"object"!==m(t)||e||t.nodeType?t&&(t.nodeType||t.length||"string"==typeof t)&&(t=this.node=ot(t),e=this.object=it(t,e,this)):(e=this.object=t,t=null),this._valuesEnd=null,this._valuesStart=Array.isArray(e)?[]:{},this._duration=1e3,this._easingFunction=at,this._easingReverse=at,this._interpolationFunction=rt.Linear,this._startTime=0,this._initTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._pausedTime=null,this._isFinite=!0,this._maxListener=15,this._chainedTweensCount=0,this._prevTime=null,this}return g(L,null,[{key:"fromTo",value:function(t,e,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};n.quickRender=n.quickRender?n.quickRender:!r;var i=new L(t,e).to(r,n);return n.quickRender&&(i.render().update(i._startTime),i._rendered=!1,i._onStartCallbackFired=!1),i}},{key:"to",value:function(t,e,r){return L.fromTo(t,null,e,r)}},{key:"from",value:function(t,e,r){return L.fromTo(t,e,null,r)}}]),g(L,[{key:"setMaxListener",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:15;return this._maxListener=t,this}},{key:"on",value:function(t,e){for(var r=this._maxListener,n=t+j,i=0;i<r;i++){var o=n+i;if(!this[o]){this[o]=e;break}}return this}},{key:"once",value:function(t,i){for(var o=this,e=this._maxListener,r=t+j,n=function(t){var n=r+t;if(!o[n])return o[n]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.apply(o,e),o[n]=null},"break"},s=0;s<e;s++){if("break"===n(s))break}return this}},{key:"off",value:function(t,e){for(var r=this._maxListener,n=t+j,i=0;i<r;i++){var o=n+i;this[o]===e&&(this[o]=null)}return this}},{key:"emit",value:function(t,e,r,n,i){var o=this._maxListener,s=t+j;if(!this[s+0])return this;for(var a=0;a<o;a++){var u=s+a;this[u]&&this[u](e,r,n,i)}return this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(t){var e=this._reversed;return this._reversed=void 0!==t?t:!e,this}},{key:"reversed",value:function(){return this._reversed}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,x(this),this._pausedTime=F(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=F()-this._pausedTime,this._initTime=this._startTime,d(this),this._pausedTime=F(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this.reassignValues(),d(this),this.emit(A,this.object)}},{key:"seek",value:function(t,e){var r=this._duration,n=this._initTime,i=this._startTime,o=this._reversed,s=n+t;return this._isPlaying=!0,s<i&&n<=i&&(this._startTime-=r,this._reversed=!o),this.update(t,!1),this.emit("seek",t,this.object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration="function"==typeof t?t(this._duration):t,this}},{key:"to",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1e3;if(this._valuesEnd=t,"number"==typeof e||"function"==typeof e)this._duration="function"==typeof e?e(this._duration):e;else if("object"===m(e))for(var r in e)if("function"==typeof this[r]){var n=E(Array.isArray(e[r])?e[r]:[e[r]],4),i=n[0],o=void 0===i?null:i,s=n[1],a=void 0===s?null:s,u=n[2],f=void 0===u?null:u,l=n[3],h=void 0===l?null:l;this[r](o,a,f,h)}return this}},{key:"render",value:function(){if(this._rendered)return this;var t=this._valuesStart,e=this._valuesEnd,r=this.object,n=this.node,i=this.InitialValues;if(tt(r),tt(e),n&&n.queueID&&nt[n.queueID]){var o=nt[n.queueID];if(o.propNormaliseRequired&&o.tween!==this){for(var s in e)o.tween._valuesEnd[s];o.normalisedProp=!0,o.propNormaliseRequired=!1}}for(var a in n&&i&&(r&&0!==Object.keys(r).length?e&&0!==Object.keys(e).length||(e=this._valuesEnd=i(n,r)):r=this.object=it(n,i(n,e),this)),e){var u=r&&r[a]&&R(r[a]),f=e[a];if(!(N[a]&&N[a].init&&(N[a].init.call(this,u,f,a,r),void 0===u&&t[a]&&(u=t[a]),N[a].skipProcess))&&!("number"==typeof u&&isNaN(u)||null===u||null===f||!1===u||!1===f||void 0===u||void 0===f||u===f)){if(Array.isArray(f)&&!Array.isArray(u)){f.unshift(u);for(var l=0,h=f.length;l<h;l++)if("string"==typeof f[l]){for(var c=Q(f[l]),p={length:c.length,isString:!0},d=0,v=c.length;d<v;d++)p[d]=c[d];f[l]=p}}"number"==typeof(t[a]=u)&&"string"==typeof f&&"="===f[1]||X(a,r,t,e)}}return L.Renderer&&this.node&&L.Renderer.init&&(L.Renderer.init.call(this,r,t,e),this.__render=!0),this}},{key:"start",value:function(t){return this._startTime=void 0!==t?"string"==typeof t?F()+parseFloat(t):t:F(),this._startTime+=this._delayTime,this._initTime=this._prevTime=this._startTime,this._onStartCallbackFired=!1,this._rendered=!1,this._isPlaying=!0,d(this),this}},{key:"stop",value:function(){var t=this._isPlaying,e=this._isFinite,r=this.object,n=this._startTime,i=this._duration,o=this._r,s=this._yoyo,a=this._reversed;if(!t)return this;var u=e?(o+1)%2==1:!a;return this._reversed=!1,s&&u?this.update(n):this.update(n+i),x(this),this.emit("stop",r)}},{key:"delay",value:function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this}},{key:"chainedTweens",value:function(){if(this._chainedTweensCount=arguments.length,!this._chainedTweensCount)return this;for(var t=0,e=this._chainedTweensCount;t<e;t++)this[D+t]=arguments[t];return this}},{key:"repeat",value:function(t){return this._repeat=this._duration?"function"==typeof t?t(this._repeat):t:0,this._r=this._repeat,this._isFinite=isFinite(t),this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this}},{key:"yoyo",value:function(t,e){return this._yoyo="function"==typeof t?t(this._yoyo):null===t?this._yoyo:t,t||(this._reversed=!1),this._easingReverse=e||null,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return"function"==typeof t&&(this._interpolationFunction=t),this}},{key:"reassignValues",value:function(t){var e=this._valuesStart,r=this.object,n=this._delayTime;for(var i in this._isPlaying=!0,this._startTime=void 0!==t?t:F(),this._startTime+=n,this._reversed=!1,d(this),e){var o=e[i];r[i]=o}return this}},{key:"update",value:function(t,e,r){var n,i,o,s=this._onStartCallbackFired,a=this._easingFunction,u=this._interpolationFunction,f=this._easingReverse,l=this._repeat,h=this._delayTime,c=this._reverseDelayTime,p=this._yoyo,d=this._reversed,v=this._startTime,y=this._prevTime,_=this._duration,m=this._valuesStart,g=this._valuesEnd,b=this.object,T=this._isFinite,k=this._isPlaying,w=this.__render,O=this._chainedTweensCount,E=0;if(_){var j=(t=void 0!==t?t:F())-y;if(this._prevTime=t,250<j&&C()&&(t-=j-q),!k||t<v&&!r)return!0;n=1<(n=(t-v)/_)?1:n,n=d?1-n:n}else n=1,l=0;if(s||(this._rendered||(this.render(),this._rendered=!0),this.emit(B,b),this._onStartCallbackFired=!0),i=d&&f||a,!b)return!0;for(o in g){var A=m[o];if(null!=A||N[o]&&N[o].update){var S=g[o],P=i[o]?i[o](n):"function"==typeof i?i(n):at(n),R=u[o]?u[o]:"function"==typeof u?u:rt.Linear;"number"==typeof S?b[o]=A+(S-A)*P:Array.isArray(S)&&!Array.isArray(A)?b[o]=R(S,P,b[o]):S&&S.update?S.update(P):"function"==typeof S?b[o]=S(P):"string"==typeof S&&"number"==typeof A?b[o]=A+parseFloat(S[0]+S.substr(2))*P:W(o,b,m,g,P,n),N[o]&&N[o].update&&N[o].update.call(this,b[o],A,S,P,n,o),E++}}if(!E)return x(this),!1;if(w&&L.Renderer&&L.Renderer.update&&L.Renderer.update.call(this,b,n),this.emit(U,b,n,t),1===n||d&&0===n){if(0<l&&0<_){if(T&&this._repeat--,p)this._reversed=!d;else for(o in g){var M=g[o];"string"==typeof M&&"number"==typeof m[o]&&(m[o]+=parseFloat(M[0]+M.substr(2)))}return this.emit(p&&!d?z:G,b),this._startTime=d&&c?t-c:t+h,!0}if(e||(this._isPlaying=!1,x(this),st--),this.emit(V,b),this._repeat=this._r,O)for(var I=0;I<O;I++)this[D+I].start(t+_);return!1}return!0}}]),L}(),ft=function(){function t(){y(this,t),this.totalTime=0,this.labels=[],this.offsets=[]}return g(t,[{key:"parseLabel",value:function(t,e){var r=this.offsets,n=this.labels,i=n.indexOf(t);if("string"==typeof t&&-1!==t.indexOf("=")&&!e&&-1===i){var o=t.substr(t.indexOf("=")-1,2),s=t.split(o);e=2===s.length?o+s[1]:null,t=s[0],i=n.indexOf(t)}if(-1!==i&&t){var a=r[i]||0;if("number"==typeof e)a=e;else if("string"==typeof e&&-1!==e.indexOf("=")){var u=e.charAt(0);e=Number(e.substr(2)),"+"===u||"-"===u?a+=parseFloat(u+e):"*"===u?a*=e:"/"===u?a/=e:"%"===u&&(a*=e/100)}return a}return"number"==typeof e?e:0}},{key:"addLabel",value:function(t,e){return this.labels.push(t),this.offsets.push(this.parseLabel(t,e)),this}},{key:"setLabel",value:function(t,e){var r=this.labels.indexOf(t);return-1!==r&&this.offsets.splice(r,1,this.parseLabel(t,e)),this}},{key:"eraseLabel",value:function(t){var e=this.labels.indexOf(t);return-1!==e&&(this.labels.splice(e,1),this.offsets.splice(e,1)),this}}]),t}(),lt=0,ht=function(t){function r(t){var e;return y(this,r),(e=O(this,T(r).call(this)))._duration=0,e._startTime=void 0!==t.startTime?t.startTime:F(),e._tweens=[],e.elapsed=0,e._id=lt++,e._defaultParams=t,e.position=new ft,e.position.addLabel("afterLast",e._duration),e.position.addLabel("afterInit",e._startTime),e._onStartCallbackFired=!1,O(e,w(e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&k(t,e)}(r,ut),g(r,[{key:"mapTotal",value:function(t){return t.call(this,this._tweens),this}},{key:"timingOrder",value:function(t){var r=t(this._tweens.map(function(t){return t._startTime}));return this._tweens.map(function(t,e){t._startTime=r[e]}),this}},{key:"getTiming",value:function(t,e,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;if("reverse"===t){var i=r.stagger,o=(i||0)*(e.length-1);return e.map(function(t,e){return o-(i||0)*e+n})}if("async"===t)return e.map(function(t){return n});if("sequence"===t||"delayed"===t){var s=r.stagger;return s||(s=(r.duration||1e3)/(e.length-1)),e.map(function(t,e){return s*e+n})}if("oneByOne"===t)return e.map(function(t){return r.duration});if("shuffle"===t){var a=r.stagger;return function(t){var e,r,n;for(n=t.length;n;n-=1)e=Math.floor(Math.random()*n),r=t[n-1],t[n-1]=t[e],t[e]=r;return t}(e.map(function(t,e){return(a||0)*e+n}))}var u=r.stagger;return e.map(function(t,e){return(u||0)*e+n})}},{key:"fromTo",value:function(t,e,r,n){if((t=ot(t,!0,!0))&&t.length){this._defaultParams&&(n=n?b({},this._defaultParams,n):this._defaultParams);for(var i,o=n.label,s="number"==typeof o?o:this.position.parseLabel(void 0!==o?o:"afterLast",null),a=this.getTiming(n.mode,t,n,s),u=0,f=t.length;u<f;u++)i=t[u],this.add(ut.fromTo(i,"function"==typeof e?e(u,t.length):"object"===m(e)&&e?b({},e):null,"function"==typeof r?r(u,t.length):r,"function"==typeof n?n(u,t.length):n),a[u])}return this.start()}},{key:"from",value:function(t,e,r){return this.fromTo(t,e,null,r)}},{key:"to",value:function(t,e,r){return this.fromTo(t,null,e,r)}},{key:"addLabel",value:function(t,e){return this.position.addLabel(t,e),this}},{key:"map",value:function(t){for(var e=0,r=this._tweens.length;e<r;e++){var n=this._tweens[e];t(n,e),this._duration=Math.max(this._duration,n._duration+n._startTime)}return this}},{key:"add",value:function(t,e){var r=this;if(Array.isArray(t))return t.map(function(t){r.add(t,e)}),this;"object"!==m(t)||t instanceof ut||(t=new ut(t.from).to(t.to,t));var n=this._defaultParams,i=this._duration;if(n)for(var o in n)"function"==typeof t[o]&&t[o](n[o]);var s="number"==typeof e?e:this.position.parseLabel(void 0!==e?e:"afterLast",null);return t._startTime=Math.max(this._startTime,t._delayTime,s),t._delayTime=s,t._isPlaying=!0,this._duration=Math.max(i,Math.max(t._startTime+t._delayTime,t._duration)),this._tweens.push(t),this.position.setLabel("afterLast",this._duration),this}},{key:"restart",value:function(){return this._startTime+=F(),d(this),this.emit(A)}},{key:"easing",value:function(e){return this.map(function(t){return t.easing(e)})}},{key:"interpolation",value:function(e){return this.map(function(t){return t.interpolation(e)})}},{key:"update",value:function(t){var e,r=this._tweens,n=this._duration,i=this._reverseDelayTime,o=this._startTime,s=this._reversed,a=this._yoyo,u=this._repeat,f=this._isFinite,l=this._isPlaying,h=this._prevTime,c=this._onStartCallbackFired,p=(t=void 0!==t?t:F())-h;if(this._prevTime=t,250<p&&C()&&(t-=p-q),!l||t<o)return!0;e=1<(e=(t-o)/n)?1:e,e=s?1-e:e,this.elapsed=e,c||(this.emit(B),this._onStartCallbackFired=!0);for(var d=t-o,v=s?n-d:d,y=0;y<r.length;)r[y].update(v),y++;if(this.emit(U,e,d),1===e||s&&0===e){if(u){for(f&&this._repeat--,this.emit(s?z:G),a&&(this._reversed=!s,this.timingOrder(function(t){return t.reverse()})),this._startTime=s&&i?t+i:t,y=0;y<r.length;)r[y].reassignValues(t),y++;return!0}return this.emit(V),this._repeat=this._r,x(this),this._isPlaying=!1}return!0}},{key:"progress",value:function(t){return void 0!==t?this.update(t*this._duration):this.elapsed}}]),r}();t.Plugins=N,t.Selector=ot,t.Interpolator=function(i,o){var s=Array.isArray(i),a="string"==typeof i?i:s?i.slice():b({},i);if(s)for(var t=0,e=i.length;t<e;t++)X(t,a,i,o);else if("object"===m(i))for(var r in i)X(r,a,i,o);else if("string"==typeof i){i=Q(i),o=Q(o);for(var n=1;n<i.length;)i[n]===o[n]&&"string"==typeof i[n-1]?(i.splice(n-1,2,i[n-1]+i[n]),o.splice(n-1,2,o[n-1]+o[n])):n++;for(var u={isString:!0,length:i.length},f={isString:!0,length:o.length};n<u.length;)u[n]=i[n],f[n]=o[n],n++}return function(t){if(s)for(var e=0,r=i.length;e<r;e++)W(e,a,i,o,t);else if("object"===m(a))for(var n in i)W(n,a,i,o,t);else"string"==typeof a&&(a=W(0,0,i,o,t,t,!0));return a}},t.onTick=function(t){return a.push({update:t})},t.has=function(t){return null!==n(t)},t.get=n,t.getAll=function(){return a},t.removeAll=function(){a.length=0,s(o),u=!1},t.remove=x,t.add=d,t.now=F,t.update=i,t.autoPlay=function(t){f=t},t.isRunning=C,t.onRequestTick=function(t){l.push(t)},t.FrameThrottle=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:120;p=1.05*t},t.Tween=ut,t.Timeline=ht,t.Easing=v,t.Interpolation=rt,t.utils=et,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).TWEEN={})}(this,function(t){"use strict";var o,e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this||(void 0!==t?t:{}),r=e.requestAnimationFrame||function(t){return e.setTimeout(t,50/3)},s=e.cancelAnimationFrame||function(t){return e.clearTimeout(t)},F=function(){if("undefined"==typeof process||void 0===process.hrtime||process.versions&&void 0!==process.versions.electron){if(void 0!==e.performance&&void 0!==e.performance.now)return e.performance.now.bind(e.performance);var t=e.performance&&e.performance.timing&&e.performance.timing.navigationStart?e.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}}(),a=[],u=!1,f=!1,l=[],h=r,c=0,p=120,d=!0,v=function(t){var e=a.indexOf(t);-1<e&&a.splice(e,1),a.push(t),c=0,f&&!u&&(o=h(i),u=!0)},n=function(t){for(var e=0;e<a.length;e++)if(t===a[e])return a[e];return null},x=function(t){var e=a.indexOf(t);-1!==e&&a.splice(e,1),0===a.length&&(s(o),u=!1)},i=function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:F(),r=1<arguments.length?arguments[1]:void 0;if(p<=c&&d)return u=!1,c=0,s(o),!1;f&&u?o=h(t):function(){for(var t=0;t<l.length;t++)l[t]()}(),a.length||c++;for(var n=0,i=a.length;n<i;)a[n++].update(e,r),i>a.length&&n--,i=a.length;return!0},C=function(){return u},N=function(){return d},q={},y={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return--t*t*(2.70158*t+1.70158)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-y.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*y.Bounce.In(2*t):.5*y.Bounce.Out(2*t-1)+.5}},Stepped:{steps:function(e){return function(t){return(t*e|0)/e}}}};function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),t}function T(i){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},e=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),e.forEach(function(t){var e,r,n;e=i,n=o[r=t],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return i}function k(t){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function w(t,e){return(w=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function E(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?O(t):e}function j(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var D=50/3,U="_chainedTweens",A="Callback",V="update",B="complete",G="start",z="repeat",Q="reverse",S="restart",P="STRING_PROP",R=/\s+|([A-Za-z?().,{}:""[\]#%]+)|([-+]=+)?([-+]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]=?\d+)?/g;function M(t){if(t&&t.nodeType||void 0===t||"object"!==m(t))return t;if(Array.isArray(t))return[].concat(t);if("object"!==m(t))return t;var e={};for(var r in t)e[r]=M(t[r]);return e}var I=function(t){return isNaN(+t)||("+"===t[0]||"-"===t[0])&&"="===t[1]||""===t||" "===t},L=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,X=function(t,e){var r,n,i;3===e.length&&(e=(r=e[0])+r+(n=e[1])+n+(i=e[2])+i);var o=parseInt(e,16);return"rgb("+(r=o>>16&255)+","+(n=o>>8&255)+","+(i=255&o)+")"};function H(t){return"string"!=typeof t?t:t.replace(L,X).match(R).map(function(t){return I(t)?t:+t})}function K(r,n,t,e,i){var o=t[r],s=e[r];if("string"==typeof o||"string"==typeof s){for(var a=Array.isArray(o)&&o[0]===P?o:H(o),u=Array.isArray(s)&&s[0]===P?s:H(s),f=1;f<a.length;)a[f]===u[f]&&"string"==typeof a[f-1]?(a.splice(f-1,2,a[f-1]+a[f]),u.splice(f-1,2,u[f-1]+u[f])):f++;a[f=0]===P&&a.shift(),u[0]===P&&u.shift();for(var l={isString:!0,length:a.length},h={isString:!0,length:u.length};f<l.length;)l[f]=a[f],h[f]=u[f],f++;return t[r]=l,e[r]=h,!0}if("object"!==m(o)||"object"!==m(s))return!1;if(Array.isArray(o))return o.map(function(t,e){return K(e,n[r],o,s)});for(var c in s)K(c,n[r],o,s);return!0}var W="rgba(",$=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"rgb(";return"number"==typeof t[e]&&(t[e-1]===r||t[e-3]===r||t[e-5]===r)};function Y(t,e,r,n,i,o,s){var a=s?r:r[t],u=s?n:n[t];if(void 0===u)return a;if(void 0===a||"string"==typeof a||a===u)return u;if("object"===m(a)&&"object"===m(u)){if(!a||!u)return e[t];if("object"===m(a)&&a&&a.isString){for(var f="",l=0,h=a.length;l<h;l++){var c="number"==typeof a[l]&&"string"==typeof u[l]&&"="===u[l][1],p="number"!=typeof a[l]?a[l]:c?a[l]+parseFloat(u[l][0]+u[l].substr(2))*i:a[l]+(u[l]-a[l])*i;($(a,l)||$(a,l,W))&&(p|=0),f+=p,c&&1===o&&(a[l]=a[l]+parseFloat(u[l][0]+u[l].substr(2)))}return s||(e[t]=f),f}if(Array.isArray(a)&&a[0]!==P)for(var d=0,v=a.length;d<v;d++)a[d]!==u[d]&&Y(d,e[t],a,u,i,o);else if("object"===m(a)&&a&&!a.isString)for(var y in a)a[y]!==u[y]&&Y(y,e[t],a,u,i,o)}else if("number"==typeof a){var _="string"==typeof u;e[t]=_?a+parseFloat(u[0]+u.substr(2))*i:a+(u-a)*i,_&&1===o&&(r[t]=e[t])}else"function"==typeof u&&(e[t]=u(i));return e[t]}var Z,J=/([.[])/g,tt=/\]/g,et=function(t,e){var i=t[e],o=e.replace(tt,"").split(J),s=o.length-1,a=Array.isArray(t),u="object"===m(t)&&!a;return u?(t[e]=null,delete t[e]):a&&t.splice(e,1),o.reduce(function(t,e,r){a&&"."!==e&&"["!==e&&(e*=1);var n="["===o[r+1];if("."===e||"["===e)return"."===e?a=!(u=!0):"["===e&&(a=!(u=!1)),t;if(void 0===t[e]){if(a||u)return t[e]=r===s?i:a||n?[]:u?{}:null,u=a=!1,t[e]}else if(void 0!==t[e])return r===s&&(t[e]=i),t[e];return t},t)},rt=function(t){if("object"===m(t)&&t)for(var e in t)if(-1!==e.indexOf(".")||-1!==e.indexOf("["))et(t,e);else if("object"===m(t[e])&&t[e]){var r=t[e];for(var n in r)if(-1!==n.indexOf(".")||-1!==n.indexOf("["))et(r,n);else if("object"===m(r[n])&&r[n]){var i=r[n];for(var o in i)-1===o.indexOf(".")&&-1===o.indexOf("[")||et(i,o)}}return t},nt=Object.freeze({FRAME_MS:D,TOO_LONG_FRAME_MS:250,CHAINED_TWEENS:U,EVENT_CALLBACK:A,EVENT_UPDATE:V,EVENT_COMPLETE:B,EVENT_START:G,EVENT_REPEAT:z,EVENT_REVERSE:Q,EVENT_PAUSE:"pause",EVENT_PLAY:"play",EVENT_RESTART:S,EVENT_STOP:"stop",EVENT_SEEK:"seek",STRING_PROP:P,NUM_REGEX:R,HEXC_REGEX:/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,deepCopy:M,decomposeString:H,decompose:K,RGB:"rgb(",RGBA:W,isRGBColor:$,recompose:Y,SET_NESTED:rt}),it={Linear:function(t,e,r){var n=t.length-1,i=n*e,o=Math.floor(i),s=it.Utils.Linear;return e<0?s(t[0],t[1],i,r):1<e?s(t[n],t[n-1],n-i,r):s(t[o],t[n<o+1?n:o+1],i-o,r)},Bezier:function(t,e,r){for(var n=it.Utils.Reset(r),i=t.length-1,o=Math.pow,s=it.Utils.Bernstein,a=Array.isArray(n),u=0;u<=i;u++)if("number"==typeof n)n+=o(1-e,i-u)*o(e,u)*t[u]*s(i,u);else if(a)for(var f=0,l=n.length;f<l;f++)"number"==typeof n[f]?n[f]+=o(1-e,i-u)*o(e,u)*t[u][f]*s(i,u):n[f]=t[u][f];else if("object"===m(n))for(var h in n)"number"==typeof n[h]?n[h]+=o(1-e,i-u)*o(e,u)*t[u][h]*s(i,u):n[h]=t[u][h];else if("string"==typeof n){for(var c="",p=t[Math.round(i*e)],d=1,v=p.length;d<v;d++)c+=p[d];return c}return n},CatmullRom:function(t,e,r){var n=t.length-1,i=n*e,o=Math.floor(i),s=it.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(i=n*(1+e))),s(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],i-o,r)):e<0?s(t[1],t[1],t[0],t[0],-e,r):1<e?s(t[n-1],t[n-1],t[n],t[n],(0|e)-e,r):s(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],i-o,r)},Utils:{Linear:function(t,e,r,n){if("string"==typeof t)return e;if("number"==typeof t)return"function"==typeof t?t(r):t+(e-t)*r;if("object"===m(t)){if(void 0!==t.length){if(t[0]===P){for(var i="",o=1,s=t.length;o<s;o++){var a="number"==typeof t[o]?t[o]+(e[o]-t[o])*r:e[o];($(t,o)||$(t,o,W))&&(a|=0),i+=a}return i}for(var u=0,f=n.length;u<f;u++)n[u]=it.Utils.Linear(t[u],e[u],r,n[u])}else for(var l in n)n[l]=it.Utils.Linear(t[l],e[l],r,n[l]);return n}},Reset:function(t){if(Array.isArray(t)){for(var e=0,r=t.length;e<r;e++)t[e]=it.Utils.Reset(t[e]);return t}if("object"!==m(t))return"number"==typeof t?0:t;for(var n in t)t[n]=it.Utils.Reset(t[n]);return t},Bernstein:function(t,e){var r=it.Utils.Factorial;return r(t)/r(e)/r(t-e)},Factorial:(Z=[1],function(t){var e=1;if(Z[t])return Z[t];for(var r=t;1<r;r--)e*=r;return Z[t]=e}),CatmullRom:function(t,e,r,n,i,o){if("string"==typeof t)return e;if("number"==typeof t){var s=.5*(r-t),a=.5*(n-e),u=i*i;return(2*e-2*r+s+a)*(i*u)+(-3*e+3*r-2*s-a)*u+s*i+e}if("object"===m(t)){if(void 0!==t.length){if(t[0]===P){for(var f="",l=1,h=t.length;l<h;l++){var c="number"==typeof t[l]?it.Utils.CatmullRom(t[l],e[l],r[l],n[l],i):n[l];($(t,l)||$(t,l,W))&&(c|=0),f+=c}return f}for(var p=0,d=o.length;p<d;p++)o[p]=it.Utils.CatmullRom(t[p],e[p],r[p],n[p],i,o[p])}else for(var v in o)o[v]=it.Utils.CatmullRom(t[v],e[v],r[v],n[v],i,o[v]);return o}}}},ot={};function st(t,e,r){if(!t||!t.nodeType)return e;var n=t.queueID||"q_"+Date.now();t.queueID||(t.queueID=n);var i=ot[n];if(i){if(i.object===e&&t===i.tween.node&&r._startTime===i.tween._startTime)x(i.tween);else if("object"===m(e)&&e&&i.object){for(var o in e)o in i.object&&(r._startTime===i.tween._startTime?delete i.object[o]:i.propNormaliseRequired=!0);i.object=T({},i.object,e)}return i.object}return"object"===m(e)&&e?(ot[n]={tween:r,object:e,propNormaliseRequired:!1},ot[n].object):e}function at(t,e,r){return e?t?"undefined"!=typeof window&&t===window||"undefined"!=typeof document&&t===document?[t]:"string"==typeof t?!!document.querySelectorAll&&document.querySelectorAll(t):Array.isArray(t)?t:t.nodeType?[t]:r?t:[]:null:t?"undefined"!=typeof window&&t===window||"undefined"!=typeof document&&t===document?t:"string"==typeof t?!!document.querySelector&&document.querySelector(t):Array.isArray(t)?t[0]:t.nodeType?t:r?t:null:null}var ut=0,ft=y.Linear.None,lt=function(){function L(t,e){return _(this,L),this.id=ut++,!t||"object"!==m(t)||e||t.nodeType?t&&(t.nodeType||t.length||"string"==typeof t)&&(t=this.node=at(t),e=this.object=st(t,e,this)):(e=this.object=t,t=null),this._valuesEnd=null,this._valuesStart=Array.isArray(e)?[]:{},this._duration=1e3,this._easingFunction=ft,this._easingReverse=ft,this._interpolationFunction=it.Linear,this._startTime=0,this._initTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._pausedTime=null,this._isFinite=!0,this._maxListener=15,this._chainedTweensCount=0,this._prevTime=null,this}return b(L,null,[{key:"fromTo",value:function(t,e,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};n.quickRender=n.quickRender?n.quickRender:!r;var i=new L(t,e).to(r,n);return n.quickRender&&(i.render().update(i._startTime),i._rendered=!1,i._onStartCallbackFired=!1),i}},{key:"to",value:function(t,e,r){return L.fromTo(t,null,e,r)}},{key:"from",value:function(t,e,r){return L.fromTo(t,e,null,r)}}]),b(L,[{key:"setMaxListener",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:15;return this._maxListener=t,this}},{key:"on",value:function(t,e){for(var r=this._maxListener,n=t+A,i=0;i<r;i++){var o=n+i;if(!this[o]){this[o]=e;break}}return this}},{key:"once",value:function(t,i){for(var o=this,e=this._maxListener,r=t+A,n=function(t){var n=r+t;if(!o[n])return o[n]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.apply(o,e),o[n]=null},"break"},s=0;s<e;s++){if("break"===n(s))break}return this}},{key:"off",value:function(t,e){for(var r=this._maxListener,n=t+A,i=0;i<r;i++){var o=n+i;this[o]===e&&(this[o]=null)}return this}},{key:"emit",value:function(t,e,r,n,i){var o=this._maxListener,s=t+A;if(!this[s+0])return this;for(var a=0;a<o;a++){var u=s+a;this[u]&&this[u](e,r,n,i)}return this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(t){var e=this._reversed;return this._reversed=void 0!==t?t:!e,this}},{key:"reversed",value:function(){return this._reversed}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,x(this),this._pausedTime=F(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=F()-this._pausedTime,this._initTime=this._startTime,v(this),this._pausedTime=F(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this.reassignValues(),v(this),this.emit(S,this.object)}},{key:"seek",value:function(t,e){var r=this._duration,n=this._initTime,i=this._startTime,o=this._reversed,s=n+t;return this._isPlaying=!0,s<i&&n<=i&&(this._startTime-=r,this._reversed=!o),this.update(t,!1),this.emit("seek",t,this.object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration="function"==typeof t?t(this._duration):t,this}},{key:"to",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1e3;if(this._valuesEnd=t,"number"==typeof e||"function"==typeof e)this._duration="function"==typeof e?e(this._duration):e;else if("object"===m(e))for(var r in e)if("function"==typeof this[r]){var n=j(Array.isArray(e[r])?e[r]:[e[r]],4),i=n[0],o=void 0===i?null:i,s=n[1],a=void 0===s?null:s,u=n[2],f=void 0===u?null:u,l=n[3],h=void 0===l?null:l;this[r](o,a,f,h)}return this}},{key:"render",value:function(){if(this._rendered)return this;var t=this._valuesStart,e=this._valuesEnd,r=this.object,n=this.node,i=this.InitialValues;if(rt(r),rt(e),n&&n.queueID&&ot[n.queueID]){var o=ot[n.queueID];if(o.propNormaliseRequired&&o.tween!==this){for(var s in e)o.tween._valuesEnd[s];o.normalisedProp=!0,o.propNormaliseRequired=!1}}for(var a in n&&i&&(r&&0!==Object.keys(r).length?e&&0!==Object.keys(e).length||(e=this._valuesEnd=i(n,r)):r=this.object=st(n,i(n,e),this)),e){var u=r&&r[a]&&M(r[a]),f=e[a];if(!(q[a]&&q[a].init&&(q[a].init.call(this,u,f,a,r),void 0===u&&t[a]&&(u=t[a]),q[a].skipProcess))&&!("number"==typeof u&&isNaN(u)||null===u||null===f||!1===u||!1===f||void 0===u||void 0===f||u===f)){if(Array.isArray(f)&&!Array.isArray(u)){f.unshift(u);for(var l=0,h=f.length;l<h;l++)if("string"==typeof f[l]){for(var c=H(f[l]),p={length:c.length,isString:!0},d=0,v=c.length;d<v;d++)p[d]=c[d];f[l]=p}}"number"==typeof(t[a]=u)&&"string"==typeof f&&"="===f[1]||K(a,r,t,e)}}return L.Renderer&&this.node&&L.Renderer.init&&(L.Renderer.init.call(this,r,t,e),this.__render=!0),this}},{key:"start",value:function(t){return this._startTime=void 0!==t?"string"==typeof t?F()+parseFloat(t):t:F(),this._startTime+=this._delayTime,this._initTime=this._prevTime=this._startTime,this._onStartCallbackFired=!1,this._rendered=!1,this._isPlaying=!0,v(this),this}},{key:"stop",value:function(){var t=this._isPlaying,e=this._isFinite,r=this.object,n=this._startTime,i=this._duration,o=this._r,s=this._yoyo,a=this._reversed;if(!t)return this;var u=e?(o+1)%2==1:!a;return this._reversed=!1,s&&u?this.update(n):this.update(n+i),x(this),this.emit("stop",r)}},{key:"delay",value:function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this}},{key:"chainedTweens",value:function(){if(this._chainedTweensCount=arguments.length,!this._chainedTweensCount)return this;for(var t=0,e=this._chainedTweensCount;t<e;t++)this[U+t]=arguments[t];return this}},{key:"repeat",value:function(t){return this._repeat=this._duration?"function"==typeof t?t(this._repeat):t:0,this._r=this._repeat,this._isFinite=isFinite(t),this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this}},{key:"yoyo",value:function(t,e){return this._yoyo="function"==typeof t?t(this._yoyo):null===t?this._yoyo:t,t||(this._reversed=!1),this._easingReverse=e||null,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return"function"==typeof t&&(this._interpolationFunction=t),this}},{key:"reassignValues",value:function(t){var e=this._valuesStart,r=this.object,n=this._delayTime;for(var i in this._isPlaying=!0,this._startTime=void 0!==t?t:F(),this._startTime+=n,this._reversed=!1,v(this),e){var o=e[i];r[i]=o}return this}},{key:"update",value:function(t,e,r){var n,i,o,s=this._onStartCallbackFired,a=this._easingFunction,u=this._interpolationFunction,f=this._easingReverse,l=this._repeat,h=this._delayTime,c=this._reverseDelayTime,p=this._yoyo,d=this._reversed,v=this._startTime,y=this._prevTime,_=this._duration,m=this._valuesStart,g=this._valuesEnd,b=this.object,T=this._isFinite,k=this._isPlaying,w=this.__render,O=this._chainedTweensCount,E=0;if(_){var j=(t=void 0!==t?t:F())-y;if(this._prevTime=t,250<j&&C()&&N()&&(t-=j-D),!k||t<v&&!r)return!0;n=1<(n=(t-v)/_)?1:n,n=d?1-n:n}else n=1,l=0;if(s||(this._rendered||(this.render(),this._rendered=!0),this.emit(G,b),this._onStartCallbackFired=!0),i=d&&f||a,!b)return!0;for(o in g){var A=m[o];if(null!=A||q[o]&&q[o].update){var S=g[o],P=i[o]?i[o](n):"function"==typeof i?i(n):ft(n),R=u[o]?u[o]:"function"==typeof u?u:it.Linear;"number"==typeof S?b[o]=A+(S-A)*P:Array.isArray(S)&&!Array.isArray(A)?b[o]=R(S,P,b[o]):S&&S.update?S.update(P):"function"==typeof S?b[o]=S(P):"string"==typeof S&&"number"==typeof A?b[o]=A+parseFloat(S[0]+S.substr(2))*P:Y(o,b,m,g,P,n),q[o]&&q[o].update&&q[o].update.call(this,b[o],A,S,P,n,o),E++}}if(!E)return x(this),!1;if(w&&L.Renderer&&L.Renderer.update&&L.Renderer.update.call(this,b,n),this.emit(V,b,n,t),1===n||d&&0===n){if(0<l&&0<_){if(T&&this._repeat--,p)this._reversed=!d;else for(o in g){var M=g[o];"string"==typeof M&&"number"==typeof m[o]&&(m[o]+=parseFloat(M[0]+M.substr(2)))}return this.emit(p&&!d?Q:z,b),this._startTime=d&&c?t-c:t+h,!0}if(e||(this._isPlaying=!1,x(this),ut--),this.emit(B,b),this._repeat=this._r,O)for(var I=0;I<O;I++)this[U+I].start(t+_);return!1}return!0}}]),L}(),ht=function(){function t(){_(this,t),this.totalTime=0,this.labels=[],this.offsets=[]}return b(t,[{key:"parseLabel",value:function(t,e){var r=this.offsets,n=this.labels,i=n.indexOf(t);if("string"==typeof t&&-1!==t.indexOf("=")&&!e&&-1===i){var o=t.substr(t.indexOf("=")-1,2),s=t.split(o);e=2===s.length?o+s[1]:null,t=s[0],i=n.indexOf(t)}if(-1!==i&&t){var a=r[i]||0;if("number"==typeof e)a=e;else if("string"==typeof e&&-1!==e.indexOf("=")){var u=e.charAt(0);e=Number(e.substr(2)),"+"===u||"-"===u?a+=parseFloat(u+e):"*"===u?a*=e:"/"===u?a/=e:"%"===u&&(a*=e/100)}return a}return"number"==typeof e?e:0}},{key:"addLabel",value:function(t,e){return this.labels.push(t),this.offsets.push(this.parseLabel(t,e)),this}},{key:"setLabel",value:function(t,e){var r=this.labels.indexOf(t);return-1!==r&&this.offsets.splice(r,1,this.parseLabel(t,e)),this}},{key:"eraseLabel",value:function(t){var e=this.labels.indexOf(t);return-1!==e&&(this.labels.splice(e,1),this.offsets.splice(e,1)),this}}]),t}(),ct=0,pt=function(t){function r(t){var e;return _(this,r),(e=E(this,k(r).call(this)))._duration=0,e._startTime=void 0!==t.startTime?t.startTime:F(),e._tweens=[],e.elapsed=0,e._id=ct++,e._defaultParams=t,e.position=new ht,e.position.addLabel("afterLast",e._duration),e.position.addLabel("afterInit",e._startTime),e._onStartCallbackFired=!1,E(e,O(e))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&w(t,e)}(r,lt),b(r,[{key:"mapTotal",value:function(t){return t.call(this,this._tweens),this}},{key:"timingOrder",value:function(t){var r=t(this._tweens.map(function(t){return t._startTime}));return this._tweens.map(function(t,e){t._startTime=r[e]}),this}},{key:"getTiming",value:function(t,e,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;if("reverse"===t){var i=r.stagger,o=(i||0)*(e.length-1);return e.map(function(t,e){return o-(i||0)*e+n})}if("async"===t)return e.map(function(t){return n});if("sequence"===t||"delayed"===t){var s=r.stagger;return s||(s=(r.duration||1e3)/(e.length-1)),e.map(function(t,e){return s*e+n})}if("oneByOne"===t)return e.map(function(t){return r.duration});if("shuffle"===t){var a=r.stagger;return function(t){var e,r,n;for(n=t.length;n;n-=1)e=Math.floor(Math.random()*n),r=t[n-1],t[n-1]=t[e],t[e]=r;return t}(e.map(function(t,e){return(a||0)*e+n}))}var u=r.stagger;return e.map(function(t,e){return(u||0)*e+n})}},{key:"fromTo",value:function(t,e,r,n){if((t=at(t,!0,!0))&&t.length){this._defaultParams&&(n=n?T({},this._defaultParams,n):this._defaultParams);for(var i,o=n.label,s="number"==typeof o?o:this.position.parseLabel(void 0!==o?o:"afterLast",null),a=this.getTiming(n.mode,t,n,s),u=0,f=t.length;u<f;u++)i=t[u],this.add(lt.fromTo(i,"function"==typeof e?e(u,t.length):"object"===m(e)&&e?T({},e):null,"function"==typeof r?r(u,t.length):r,"function"==typeof n?n(u,t.length):n),a[u])}return this.start()}},{key:"from",value:function(t,e,r){return this.fromTo(t,e,null,r)}},{key:"to",value:function(t,e,r){return this.fromTo(t,null,e,r)}},{key:"addLabel",value:function(t,e){return this.position.addLabel(t,e),this}},{key:"map",value:function(t){for(var e=0,r=this._tweens.length;e<r;e++){var n=this._tweens[e];t(n,e),this._duration=Math.max(this._duration,n._duration+n._startTime)}return this}},{key:"add",value:function(t,e){var r=this;if(Array.isArray(t))return t.map(function(t){r.add(t,e)}),this;"object"!==m(t)||t instanceof lt||(t=new lt(t.from).to(t.to,t));var n=this._defaultParams,i=this._duration;if(n)for(var o in n)"function"==typeof t[o]&&t[o](n[o]);var s="number"==typeof e?e:this.position.parseLabel(void 0!==e?e:"afterLast",null);return t._startTime=Math.max(this._startTime,t._delayTime,s),t._delayTime=s,t._isPlaying=!0,this._duration=Math.max(i,Math.max(t._startTime+t._delayTime,t._duration)),this._tweens.push(t),this.position.setLabel("afterLast",this._duration),this}},{key:"restart",value:function(){return this._startTime+=F(),v(this),this.emit(S)}},{key:"easing",value:function(e){return this.map(function(t){return t.easing(e)})}},{key:"interpolation",value:function(e){return this.map(function(t){return t.interpolation(e)})}},{key:"update",value:function(t){var e,r=this._tweens,n=this._duration,i=this._reverseDelayTime,o=this._startTime,s=this._reversed,a=this._yoyo,u=this._repeat,f=this._isFinite,l=this._isPlaying,h=this._prevTime,c=this._onStartCallbackFired,p=(t=void 0!==t?t:F())-h;if(this._prevTime=t,250<p&&C()&&N()&&(t-=p-D),!l||t<o)return!0;e=1<(e=(t-o)/n)?1:e,e=s?1-e:e,this.elapsed=e,c||(this.emit(G),this._onStartCallbackFired=!0);for(var d=t-o,v=s?n-d:d,y=0;y<r.length;)r[y].update(v),y++;if(this.emit(V,e,d),1===e||s&&0===e){if(u){for(f&&this._repeat--,this.emit(s?Q:z),a&&(this._reversed=!s,this.timingOrder(function(t){return t.reverse()})),this._startTime=s&&i?t+i:t,y=0;y<r.length;)r[y].reassignValues(t),y++;return!0}return this.emit(B),this._repeat=this._r,x(this),this._isPlaying=!1}return!0}},{key:"progress",value:function(t){return void 0!==t?this.update(t*this._duration):this.elapsed}}]),r}();t.Plugins=q,t.Selector=at,t.Interpolator=function(i,o){var s=Array.isArray(i),a="string"==typeof i?i:s?i.slice():T({},i);if(s)for(var t=0,e=i.length;t<e;t++)K(t,a,i,o);else if("object"===m(i))for(var r in i)K(r,a,i,o);else if("string"==typeof i){i=H(i),o=H(o);for(var n=1;n<i.length;)i[n]===o[n]&&"string"==typeof i[n-1]?(i.splice(n-1,2,i[n-1]+i[n]),o.splice(n-1,2,o[n-1]+o[n])):n++;for(var u={isString:!0,length:i.length},f={isString:!0,length:o.length};n<u.length;)u[n]=i[n],f[n]=o[n],n++}return function(t){if(s)for(var e=0,r=i.length;e<r;e++)Y(e,a,i,o,t);else if("object"===m(a))for(var n in i)Y(n,a,i,o,t);else"string"==typeof a&&(a=Y(0,0,i,o,t,t,!0));return a}},t.onTick=function(t){return a.push({update:t})},t.has=function(t){return null!==n(t)},t.get=n,t.getAll=function(){return a},t.removeAll=function(){a.length=0,s(o),u=!1},t.remove=x,t.add=v,t.now=F,t.update=i,t.autoPlay=function(t){f=t},t.isRunning=C,t.onRequestTick=function(t){l.push(t)},t.FrameThrottle=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:120;p=1.05*t},t.ToggleLagSmoothing=function(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];d=t},t.Tween=lt,t.Timeline=pt,t.Easing=y,t.Interpolation=it,t.utils=nt,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "es6-tween", | ||
"version": "5.5.1", | ||
"version": "5.5.2", | ||
"description": "ES6 implementation of amazing tween.js", | ||
@@ -5,0 +5,0 @@ "browser": "bundled/Tween.min.js", |
@@ -12,2 +12,3 @@ import { | ||
FrameThrottle, | ||
ToggleLagSmoothing, | ||
Plugins, | ||
@@ -43,2 +44,3 @@ remove, | ||
FrameThrottle, | ||
ToggleLagSmoothing, | ||
Tween, | ||
@@ -45,0 +47,0 @@ Timeline, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
370939
5023