-
Notifications
You must be signed in to change notification settings - Fork 63
/
agile.min.js
11 lines (11 loc) Β· 62.5 KB
/
agile.min.js
1
2
3
4
5
6
7
8
9
10
11
/*!
* Agile v2.2.0
* https://github.com/drawcall/Agile
*
* Copyright 2012-2021, drawcall
* Licensed under the MIT license
* http://www.opensource.org/licenses/mit-license
*
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Agile=e()}(this,function(){"use strict";var t={GROUP_LOADED:"groupLoaded",SINGLE_LOADED:"singleLoaded",LOAD_ERROR:"loadError",IMAGE_LOADED:"imageLoaded",_avatar:{mode:"2d",support3d:!0,backface:!0},keywordArr:["x","y","z","width","height","color","regX","regY","alpha","rotation","rotationX","rotationY","rotationZ","scaleX","scaleY","scaleZ","skewX","skewY","zIndex","round","radius","radiusX","radiusY","originalWidth","originalHeight"],perspective:500,DEFAULT_DEPTH:100,agileObjs:{},containers:[],getEleById:function(t){return this.agileObjs[t]},get keyword(){return this._avatar.keyword||(this._avatar.keyword="_"+this.keywordArr.join("_")+"_"),this._avatar.keyword},get transform(){return this._avatar.transform||(this._avatar.transform=this.Css.getPrefix(2)+"transform"),this._avatar.transform},get transformOrigin(){return this._avatar.transformOrigin||(this._avatar.transformOrigin=this.Css.getPrefix(2)+"transform-origin"),this._avatar.transformOrigin},get mode(){return this._avatar.mode},set mode(t){this.support3d?this._avatar.mode=t:this._avatar.mode="2d"},get support3d(){return this._avatar.support3d||(this._avatar.support3d=this.Css.support3d()),this._avatar.support3d},get backface(){return this._avatar.backface},set backface(t){for(var e in this._avatar.backface=t,this.agileObjs){this.agileObjs[e].backface=t}}},e="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},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}}(),s=function t(e,i,a){null===e&&(e=Function.prototype);var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,i,a)}if("value"in s)return s.value;var n=s.get;return void 0!==n?n.call(a):void 0},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},o={select:function(t){return/^(#|\.).*/g.test(t)||"body"===t?document.querySelector(t):document.getElementById(t)},createElement:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div";return document.createElement(t)},attr:function(t,e,i){if(void 0===i)return t.getAttribute(e);t.setAttribute(e,i)},css:function(t,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if("object"===(void 0===i?"undefined":e(i))){for(var s in i)2===a?this.css2(t,s,i[s]):this.css3(t,s,i[s]);return null}return this.css2(t,i,a)},css2:function(t,e,i){if(void 0!==i)return t.style[""+e]=i,i;var a=getComputedStyle(t,"");return t.style[""+e]||a.getPropertyValue(""+e)},css3j:function(t,e,i){t.style[e]="-webkit-"+i,t.style[e]="-moz-"+i,t.style[e]="-ms-"+i,t.style[e]="-o-"+i,t.style[e]=""+i},css3:function(t,e,i){var a=e.charAt(0).toUpperCase()+e.substr(1);if(void 0===i)return this.getCss3(t,e);t.style["Webkit"+a]=i,t.style["Moz"+a]=i,t.style["ms"+a]=i,t.style["O"+a]=i,t.style[""+e]=i},getCss3:function(t,e){var i=getComputedStyle(t,""),a=t.style[""+e]||t.style["-webkit-"+e]||t.style["-o-"+e]||t.style["-ms-"+e]||t.style["-moz-"+e],s=i.getPropertyValue(""+e)||i.getPropertyValue("-webkit- "+e)||i.getPropertyValue("-o-"+e)||i.getPropertyValue("-ms-"+e)||i.getPropertyValue("-moz-"+e);return a||s},bakCss3:function(t,e,i){if(void 0!==i)return t.style["-webkit-"+e]=i,t.style["-moz-"+e]=i,t.style["-ms-"+e]=i,t.style["-o-"+e]=i,t.style[""+e]=i,i;var a=getComputedStyle(t,""),s=t.style[""+e]||t.style["-webkit-"+e]||t.style["-o-"+e]||t.style["-ms-"+e]||t.style["-moz-"+e],r=a.getPropertyValue(""+e)||a.getPropertyValue("-webkit- "+e)||a.getPropertyValue("-o-"+e)||a.getPropertyValue("-ms-"+e)||a.getPropertyValue("-moz-"+e);return s||r},addClass:function(t,e){var i=t.className,a=""!==i?" ":"";this.hasClass(t,e)||(t.className=i+a+e)},removeClass:function(t,e){if(this.hasClass(t,e)){var i=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(i,"")}},hasClass:function(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))},getDynamicSheet:function(){if(!this.dynamicSheet){var t=document.createElement("style");t.rel="stylesheet",t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t),this.dynamicSheet=t.sheet}return this.dynamicSheet},getTestElement:function(){return this.testElement||(this.testElement=document.createElement("div")),this.testElement},getPrefix:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e="",i=["Moz","Webkit","ms","O",""],a=0,s=i.length;a<s;a++){var r=i[a];if(r+"Transition"in this.getTestElement().style)return 1!==t?""!==(e=r.toLocaleLowerCase())&&(e="-"+e+"-"):e=r,e}return e},support3d:function(){var t=void 0,e=document.createElement("p"),i={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};for(var a in document.body.insertBefore(e,null),i)void 0!==e.style[a]&&(e.style[a]="translate3d(1px,1px,1px)",t=window.getComputedStyle(e).getPropertyValue(i[a]));return document.body.removeChild(e),void 0!==t&&t.length>0&&"none"!==t}},h={keys:function(t){return Object.keys(t)},isNumber:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isEmpty:function(t){if(!t)return!0;for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},isMobile:function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(window.navigator.userAgent.toLowerCase())},arrayRemove:function(t,e){var i=t.indexOf(e);return i>-1&&t.splice(i,1),i},destroyObject:function(t){for(var e in t)delete t[e]},objectforkey:function(t,e){for(var i in t){var a=t[i].indexOf(e);if(0===a&&" "===t[i].charAt(a+e.length))return i}return null},initValue:function(t,e){return void 0===t||null===t?e:t},getCssValue:function(t,e,i,a){var s=void 0;return(s=3===a?this.getStyleBySpace(t.css3(e),i):this.getStyleBySpace(t.css2(e),i))?this.otherToFloat(s):null},getStyleBySpace:function(t,e){if(!t)return null;var i=t.split(" ");return e>=i.lenght?null:i[e]},replace:function(t,e,i){var a="";if(this.isArray(e))for(var s=0;s<e.length;s++)a+=e[s]+"|";else a=e;return t.replace(new RegExp(a,"gm"),i)},browser:function(){return{isOpera:window.opr&&window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,isFirefox:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isSafari:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),isIE:!!navigator.userAgent.match(/Trident/g)||!!navigator.userAgent.match(/MSIE/g),isChrome:!!window.chrome&&!!window.chrome.webstore}},getMouseEvent:function(t){var e=this.isMobile();switch(t){case"down":case"mousedown":return e?"touchstart":"mousedown";case"move":case"mousemove":return e?"touchmove":"mousemove";case"up":case"mouseup":return e?"touchend":"mouseup"}}},l={gradient:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"linear",e=void 0,i=arguments.length,a=Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if("linear"===t||"line"===t){e="linear-gradient(";for(var r=0,n=a.length;r<n;r++)0===r&&h.isNumber(a[r])?e+=this.getDirection(a[r]):e+=r===n-1?a[r]+")":a[r]+",";return e}if("radial"===t||"rad"===t){e="radial-gradient(";for(var o=0,l=a.length;o<l;o++)e+=o===l-1?a[o]+")":a[o]+",";return e}},getDirection:function(t){return 0===t?"to bottom,":180===t?t+"to up,":90===t?t+"to right,":270===t?t+"to left,":t+"deg,"},rgba:function(t,e,i,a){return"rbga("+t+","+e+","+i+","+(a=h.initValue(a,1))+")"},hsl:function(t){return"hsl("+t+", "+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:100)+"%, "+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:100)+"%, a)"},randomColor:function(){return"#"+("00000"+(16777216*Math.random()<<0).toString(16)).slice(-6)},alpha0:"transparent"},c={},u={generateID:function(t){return c[t]||(c[t]=0),t+"_"+c[t]++}},d=function(){function e(){i(this,e),this._avatar={id:"",x:0,y:0,z:0,regX:.5,regY:.5,width:0,height:0,alpha:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,zIndex:0,rotationX:0,rotationY:0,rotationZ:0,visible:!0,position:"absolute",color:null,backgroundImage:null,originalWidth:null,originalHeight:null,realWidth:null,realHeight:null,backface:!0,maxChildrenDepth:0},this.numChildren=0,this.childrens=[],this.filters=[],this.animations={},this.transitions={},this.parent=null,this.createElement(),this.position="absolute",this.zIndex=t.DEFAULT_DEPTH,""!==this.id&&(t.agileObjs[this.id]=this),this.x=0,this.y=0}return a(e,[{key:"createElement",value:function(){this._avatar.id=u.generateID(this.toString()),this.element=o.createElement(),o.attr(this.element,"id",this._avatar.id)}},{key:"background",value:function(t){t.indexOf(".")>0?this.backgroundImage=t:this.color=t}},{key:"getRealWidth",value:function(){return this._avatar.realWidth||(this._avatar.realWidth=this.originalWidth),this._avatar.realWidth*this.scaleX}},{key:"getRealHeight",value:function(){return this._avatar.realHeight||(this._avatar.realHeight=this.originalHeight),this._avatar.realHeight*this.scaleY}},{key:"css",value:function(t,e){if(this.element)return o.css(this.element,t,e)}},{key:"css2",value:function(t,e){if(this.element)return o.css2(this.element,t,e)}},{key:"css3",value:function(t,e){if(this.element)return o.css3(this.element,t,e)}},{key:"css3j",value:function(t,e){this.element&&o.css3j(this.element,t,e)}},{key:"addClass",value:function(t){this.element&&o.addClass(this.element,t)}},{key:"removeClass",value:function(t){this.element&&o.removeClass(this.element,t)}},{key:"addFrame",value:function(e,i,a){return t.Timeline.addFrame(this,e,i,a)}},{key:"removeFrame",value:function(e,i){return t.Timeline.removeFrame(this,e,i)}},{key:"removeFrameAfter",value:function(e,i,a){t.Timeline.removeFrameAfter(this,e,i,a)}},{key:"pause",value:function(){t.Timeline.pause(this)}},{key:"resume",value:function(){t.Timeline.resume(this)}},{key:"addChild",value:function(e){if(this._avatar.maxChildrenDepth++,e.zIndex=t.DEFAULT_DEPTH+this._avatar.maxChildrenDepth,e.parent!==this){this.element.appendChild(e.element),this.numChildren++,this.childrens.push(e),e.parent=this,e.transform(),this._avatar.realWidth||(this._avatar.realWidth=this.originalWidth);var i=Math.min(e.x-e.width*e.regX,-this.width*this.regX);this._avatar.realWidth+=Math.abs(i+this.width*this.regX);var a=Math.max(e.x+e.width*(1-e.regX),this.width*(1-this.regX));this._avatar.realWidth+=a-this.width*(1-this.regX),this._avatar.realHeight||(this._avatar.realHeight=this.originalHeight);var s=Math.min(e.y-e.height*e.regY,-this.height*this.regY);this._avatar.realHeight+=Math.abs(s+this.height*this.regY);var r=Math.max(e.y+e.height*(1-e.regY),this.height*(1-this.regY));this._avatar.realHeight+=r-this.height*(1-this.regY)}return e}},{key:"addChildAt",value:function(t,e){this.addChild(t),t.zIndex=e}},{key:"removeChild",value:function(e){e.parent===this&&(this.element.removeChild(e.element),this.numChildren--,h.arrayRemove(this.childrens,e),e.zIndex=t.DEFAULT_DEPTH,e.parent=null,e.transform())}},{key:"addFilter",value:function(t){this.filters.push(t),t.apply(this)}},{key:"removeFilter",value:function(t){h.arrayRemove(this.filters,t),t.erase(this)}},{key:"addEventListener",value:function(t,e,i){this.element.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){this.element.removeEventListener(t,e,i)}},{key:"transform",value:function(){var e,i,a,s,r=void 0,n=void 0,o=void 0,h=void 0;e=this.parent?this.parent.regX*this.parent.originalWidth:0,i=this.parent?this.parent.regY*this.parent.originalHeight:0,a=this.regX*this.originalWidth,s=this.regY*this.originalHeight;var l=this.x-a+e,c=this.y-s+i,u=this.z;"3d"===t.mode&&t.support3d?(r="translate3d("+l+"px,"+c+"px,"+u+"px) ",n="rotateX("+this.rotationX+"deg) rotateY("+this.rotationY+"deg) rotateZ("+this.rotationZ+"deg) ",o="scale3d("+this.scaleX+","+this.scaleY+","+this.scaleZ+") ",h="skew("+this.skewX+"deg,"+this.skewY+"deg)",this.css3("transform",r+n+o+h)):(r="translate("+l+"px,"+c+"px) ",n="rotate("+this.rotationZ+"deg) ",o="scale("+this.scaleX+","+this.scaleY+") ",h="skew("+this.skewX+"deg,"+this.skewY+"deg)",this.css3("transform",r+n+o+h))}},{key:"touchStart",value:function(t){this.touchStartHandler=function(e){var i=e.targetTouches,a=i?i[0].pageX:e.pageX,s=i?i[0].pageY:e.pageY;t(a,s,e)};var e=h.getMouseEvent("mousedown");this.element.addEventListener(e,this.touchStartHandler)}},{key:"stopTouchStart",value:function(){if(this.touchStartHandler){var t=h.getMouseEvent("mousedown");this.element.removeEventListener(t,this.touchStartHandler),this.touchStartHandle=null}}},{key:"touchMove",value:function(t){this.touchMoveHandler=function(e){var i=e.targetTouches,a=i?i[0].pageX:e.pageX,s=i?i[0].pageY:e.pageY;t(a,s,e)};var e=h.getMouseEvent("mousemove");this.element.addEventListener(e,this.touchMoveHandler)}},{key:"stopTouchMove",value:function(){if(this.touchMoveHandler){var t=h.getMouseEvent("mousemove");this.element.removeEventListener(t,this.touchMoveHandler),this.touchMoveHandler=null}}},{key:"touchEnd",value:function(t){this.touchEndHandler=function(e){t(e)};var e=h.getMouseEvent("mouseup");this.element.addEventListener(e,this.touchEndHandler)}},{key:"stopTouchEnd",value:function(){if(this.touchEndHandler){var t=h.getMouseEvent("mouseup");this.element.removeEventListener(t,this.touchEndHandler),this.touchEndHandler=null}}},{key:"destroy",value:function(){for(var e=0;e<this.childrens.length;e++)this.childrens[e].destroy();h.destroyObject(this.childrens),delete t.agileObjs[this.id],this.parent=null,this.filters=null,t.Timeline.kill(this),t.Tween.killTweensOf(this)}},{key:"toString",value:function(){return"DisplayObject"}},{key:"id",set:function(t){this._avatar.id=t,o.attr(this.element,"id",this._avatar.id)},get:function(){return this._avatar.id}},{key:"x",set:function(t){this._avatar.x=t,this.transform()},get:function(){return this._avatar.x}},{key:"y",set:function(t){this._avatar.y=t,this.transform()},get:function(){return this._avatar.y}},{key:"z",set:function(t){this._avatar.z=t,this.transform()},get:function(){return this._avatar.z}},{key:"scaleX",set:function(t){this._avatar.scaleX=t,this._avatar.width=t*this.originalWidth,this.transform()},get:function(){return this._avatar.scaleX}},{key:"scaleY",set:function(t){this._avatar.scaleY=t,this._avatar.height=t*this.originalHeight,this.transform()},get:function(){return this._avatar.scaleY}},{key:"scaleZ",set:function(t){this._avatar.scaleZ=t,this.transform()},get:function(){return this._avatar.scaleZ}},{key:"skewX",set:function(t){this._avatar.skewX=t,this.transform()},get:function(){return this._avatar.skewX}},{key:"skewY",set:function(t){this._avatar.skewY=t,this.transform()},get:function(){return this._avatar.skewY}},{key:"rotationX",set:function(t){this._avatar.rotationX=t,this.transform()},get:function(){return this._avatar.rotationX}},{key:"rotationY",set:function(t){this._avatar.rotationY=t,this.transform()},get:function(){return this._avatar.rotationY}},{key:"rotationZ",set:function(t){this._avatar.rotationZ=t,this.transform()},get:function(){return this._avatar.rotationZ}},{key:"rotation",set:function(t){this._avatar.rotationZ=t,this.transform()},get:function(){return this._avatar.rotationZ}},{key:"regX",set:function(t){this._avatar.regX=t;var e=100*parseFloat(this.regX)+"%",i=100*parseFloat(this.regY)+"%";this.css3("transformOrigin",e+" "+i),this.transform()},get:function(){return this._avatar.regX}},{key:"regY",set:function(t){this._avatar.regY=t;var e=100*parseFloat(this.regX)+"%",i=100*parseFloat(this.regY)+"%";this.css3("transformOrigin",e+" "+i),this.transform()},get:function(){return this._avatar.regY}},{key:"regZ",set:function(t){this._avatar.regZ=t;var e=100*parseFloat(this.regX)+"%",i=100*parseFloat(this.regY)+"%",a=100*parseFloat(this.regZ)+"%";this.css3("transformOrigin",e+" "+i+" "+a),this.transform()},get:function(){return this._avatar.regZ}},{key:"originalWidth",set:function(t){this._avatar.originalWidth=t,this.css2("width",this.originalWidth+"px")},get:function(){return this._avatar.originalWidth}},{key:"originalHeight",set:function(t){this._avatar.originalHeight=t,this.css2("height",this.originalHeight+"px")},get:function(){return this._avatar.originalHeight}},{key:"width",set:function(t){this.originalWidth?this.scaleX=t/this.originalWidth:(this._avatar.width=t,this.originalWidth=t)},get:function(){return this._avatar.width}},{key:"height",set:function(t){this.originalHeight?this.scaleY=t/this.originalHeight:(this._avatar.height=t,this.originalHeight=t)},get:function(){return this._avatar.height}},{key:"visible",set:function(t){this._avatar.visible=t;var e=t?"block":"none";this.css2("display",e)},get:function(){return this._avatar.visible}},{key:"alpha",set:function(t){this._avatar.alpha=t,this.css2("opacity",this.alpha)},get:function(){return this._avatar.alpha}},{key:"color",set:function(t){"random"!==t&&"#random"!==t||(t=l.randomColor()),this._avatar.color=t,t.indexOf("gradient")>-1?this.css3j("background",this.color):this.css2("backgroundColor",this.color)},get:function(){return this._avatar.color}},{key:"backgroundImage",set:function(t){this._avatar.backgroundImage=t;var e=null!==t||void 0!==t?"url("+this.backgroundImage+")":null;this.css2("backgroundImage",e)},get:function(){return this._avatar.backgroundImage}},{key:"position",set:function(t){this._avatar.position=t,this.css2("position",this.position)},get:function(){return this._avatar.position}},{key:"zIndex",set:function(t){this._avatar.zIndex=t,this.css2("zIndex",this.zIndex)},get:function(){return this._avatar.zIndex}},{key:"mask",set:function(t){(t+"").indexOf("gradient")>-1?this.css3("maskImage",t):(t=t?"url("+t+")":null,this.css3("maskImage",t))}},{key:"select",set:function(t){t=!1===t||null===t?"none":"auto",this.css3("userSelect",t)}},{key:"cursor",set:function(t){t=!0===t||"hand"===t||"pointer"===t?"pointer":"auto",this.css2("cursor",t)},get:function(){return this.css2("cursor")}},{key:"backface",set:function(t){this._avatar.backface=t;var e=t?"visible":"hidden";this.css3("backfaceVisibility",e)},get:function(){return this._avatar.backface}}]),e}(),g=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"purple";i(this,e);var s=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return s.radius=t,s.background(a),s}return r(e,d),a(e,[{key:"toString",value:function(){return"Circle"}},{key:"radius",get:function(){return this._avatar.radius},set:function(t){this._avatar.radius=t,this.width=this.height=2*this.radius,this.css3("borderRadius","50%")}}]),e}(),v=function(e){function s(e,a){i(this,s);var r=n(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));if("3d"===e||"2d"===e)return n(r);"string"==typeof e?r.element=o.select(e):e.jquery?r.element=e[0]:r.element=e;var h=o.attr(r.element,"id");return r._avatar.id=h||u.generateID(r.toString()),r._avatar.width=parseFloat(r.css2("width"))||0,r._avatar.height=parseFloat(r.css2("height"))||0,r._avatar.position=r.css2("position")||"absolute",r._avatar.zIndex=r.css2("zIndex")||0,r._avatar.display=r.css2("display")||"block",r._avatar.color=r.css2("backgroundColor"),r._avatar.backgroundImage=r.css2("backgroundImage"),r._avatar.alpha=""===r.css2("opacity")||void 0===r.css2("opacity")?1:r.css2("opacity"),"none"!==r._avatar.display&&(r._avatar.defalutDisplay=r._avatar.display),r.transform(),t.agileObjs[r.id]=r,a&&r.resetPosition(),r}return r(s,d),a(s,[{key:"createElement",value:function(){}},{key:"resetPosition",value:function(){this.originalWidth=this.width,this.originalHeight=this.height}},{key:"toString",value:function(){return"Dom"}},{key:"visible",get:function(){return this._avatar.visible},set:function(t){this._avatar.visible=t;var e=this._avatar.defalutDisplay?this._avatar.defalutDisplay:"block",i=t?e:"none";this.css2("display",i)}}]),s}(),f=function(e){function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"2d",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2d";i(this,l);var s=n(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,e));return e&&"3d"!==e&&"2d"!==e&&(s._avatar.dom=e),s._avatar.mode="2d",s._avatar.regX=h.getCssValue(s,"transformOrigin",0,3)||.5,s._avatar.regY=h.getCssValue(s,"transformOrigin",1,3)||.5,s._avatar.perspectiveOriginX=.5,s._avatar.perspectiveOriginY=.5,s._avatar.perspectiveOriginZ=0,s.mode="3d"===e||"3d"===a?"3d":"2d",t.containers.push(s),s}return r(l,v),a(l,[{key:"createElement",value:function(){if(this.dom)return this.dom;this._avatar.id=u.generateID(this.toString()),this.element=o.createElement(),o.attr(this.element,"id",this._avatar.id)}},{key:"addChild",value:function(e){s(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"addChild",this).call(this,e),e.backface=this.backface,!1===t.backface&&(e.backface=!1)}},{key:"toString",value:function(){return"Container"}},{key:"destroy",value:function(){s(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"destroy",this).call(this),h.arrayRemove(t.containers,this)}},{key:"mode",get:function(){return this._avatar.mode},set:function(t){this._avatar.mode=t,t="2d"===t?"flat":"preserve-3d",this.css3("transformStyle",t)}},{key:"perspective",get:function(){return this._avatar.perspective},set:function(t){this._avatar.perspective=t,this.css3("perspective",t+"px")}},{key:"perspectiveOriginX",get:function(){return this._avatar.perspectiveOriginX},set:function(t){this._avatar.perspectiveOriginX=t;var e=100*this.perspectiveOriginX+"%",i=100*this.perspectiveOriginY+"%";this.css3("perspectiveOrigin",e+" "+i)}},{key:"perspectiveOriginY",get:function(){return this._avatar.perspectiveOriginY},set:function(t){this._avatar.perspectiveOriginY=t;var e=100*this.perspectiveOriginX+"%",i=100*this.perspectiveOriginY+"%";this.css3("perspectiveOrigin",e+" "+i)}},{key:"perspectiveOriginZ",get:function(){return this._avatar.perspectiveOriginZ},set:function(t){this._avatar.perspectiveOriginZ=t;var e=100*this.perspectiveOriginX+"%",i=100*this.perspectiveOriginY+"%",a=this.perspectiveOriginZ+"px";this.css3("perspectiveOrigin",e+" "+i+" "+a)}}]),l}(),m=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"purple";i(this,e);var r=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.radiusX=t,r.radiusY=a,r.background(s),r.x=r.y=0,r}return r(e,d),a(e,[{key:"toString",value:function(){return"Ellipse"}},{key:"radiusX",get:function(){return this._avatar.radiusX},set:function(t){this._avatar.radiusX=t,this.width=2*this.radiusX,this.css3("borderRadius",this.radiusX+"px / "+this.radiusY+"px")}},{key:"radiusY",get:function(){return this._avatar.radiusY},set:function(t){this._avatar.radiusY=t,this.height=2*this.radiusY,this.css3("borderRadius",this.radiusX+"px / "+this.radiusY+"px")}}]),e}(),p=[],y=function(){function t(){i(this,t),this._listeners=null}return a(t,[{key:"addEventListener",value:function(t,e){this._listeners||(this._listeners={}),void 0===this._listeners[t]&&(this._listeners[t]=[]),-1===this._listeners[t].indexOf(e)&&this._listeners[t].push(e)}},{key:"removeEventListener",value:function(t,e){if(this._listeners){var i=this._listeners[t];if(void 0!==i){var a=i.indexOf(e);-1!==a&&i.splice(a,1)}}}},{key:"dispatchEvent",value:function(t){if(this._listeners){p.length=0;var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=0;i<e.length;i++)p[i]=e[i];for(var a=0;a<e.length;a++)p[a].call(this,t)}}}}]),t}(),b={},k=function(s){function l(){i(this,l);var t=n(this,(l.__proto__||Object.getPrototypeOf(l)).call(this));return t._urls=[],t._loaderList=[],t._targetList={},t._fileSize=[],t._totalSize=0,t.index=0,t.loadIndex=0,t.loaded=!1,t.baseURL="",t.parallel=4,t.completeHandler=t.completeHandler.bind(t),t.ioErrorHandler=t.ioErrorHandler.bind(t),t}return r(l,y),a(l,[{key:"ioErrorHandler",value:function(e){this.loadIndex++,this._targetList.push(null),this.dispatchEvent({type:t.LOAD_ERROR}),this.checkLoaded(),this.singleLoad()}},{key:"completeHandler",value:function(e){var i=o.attr(e.target,"data-index"),a=this._targetList,s=this._loaderList[i];for(var r in a)o.attr(s,"data-url")===a[r]&&(a[r]=s);this.loadIndex++,this.dispatchEvent({type:t.SINGLE_LOADED}),this.checkLoaded(),this.singleLoad()}},{key:"checkLoaded",value:function(){this.loadIndex>=this._urls.length&&!this.loaded&&(this.loaded=!0,this.dispatchEvent({type:t.GROUP_LOADED}))}},{key:"load",value:function(){for(var t=0,e=arguments.length,i=Array(e),a=0;a<e;a++)i[a]=arguments[a];for(var s=0;s<i.length;s++){var r=i[s];if("string"==typeof r)this._targetList[""+t]=r,this._urls.push(r),t++;else if(h.isArray(r))for(var n=0;n<r.length;n++)this._targetList[""+t]=r[n],this._urls.push(r[n]),t++;else for(var o in r)this._targetList[o]=r[o],this._urls.push(r[o])}for(var l=Math.min(this.parallel,this._urls.length),c=0;c<l;c++)this.singleLoad()}},{key:"singleLoad",value:function(){if(!(this.loaded||this.index>=this._urls.length)){var t=String(this._urls[this.index]),e=new Image;e.onerror=this.ioErrorHandler,e.onload=this.completeHandler,e.src=this.baseURL+t,o.attr(e,"data-url",t),o.attr(e,"data-index",this.index),this.index++,this._loaderList.push(e)}}},{key:"loadScale",get:function(){return this.loadIndex/this._urls.length}},{key:"targetList",get:function(){return this._targetList}},{key:"loaderList",get:function(){return this._loaderList}},{key:"fileSize",set:function(t){this._fileSize=t,this._totalSize=0;for(var e=0;e<this._fileSize.length;e++)this._totalSize+=this._fileSize[e]}}],[{key:"getImage",value:function(t,i){if("string"==typeof t){if(b[t])i(b[t]);else{var a=new Image;a.onload=function(e){b[t]=a,i(b[t])},a.src=t}return t}if("object"===(void 0===t?"undefined":e(t)))return b[t.src]=t,i(b[t.src]),t.src}}]),l}(),_=function(e){function s(t,e,a){i(this,s);var r=n(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return r.x=0,r.y=0,r.delayEventTime=5,t&&("string"==typeof t?/ftp|http|png|jpg|jpeg|gif/gi.test(t)?r.image=t:r.setClassImage(t):r.image=t),e&&(r.width=e),a&&(r.height=a),r}return r(s,d),a(s,[{key:"setClassImage",value:function(t){var e=this;this.addClass(t),this.dispatchImageLoadedEvent(function(){e.width=parseFloat(e.css2("width"))||0,e.height=parseFloat(e.css2("height"))||0,e._avatar.backgroundImage=e.css2("backgroundImage")})}},{key:"dispatchImageLoadedEvent",value:function(e){var i=this;setTimeout(function(){e&&e();var a=void 0;try{(a=document.createEvent("CustomEvent")).initCustomEvent(t.IMAGE_LOADED,!1,!1),i.element.dispatchEvent(a)}catch(e){(a=document.createEvent("HTMLEvents")).initEvent(t.IMAGE_LOADED,!1,!1),i.element.dispatchEvent(a)}i.loaded=!0},this.delayEventTime)}},{key:"toString",value:function(){return"AgileImage"}},{key:"originalWidth",get:function(){return this._avatar.originalWidth},set:function(t){this._avatar.originalWidth=t,this.css2("width",this.originalWidth+"px"),this.widthSize=!0}},{key:"originalHeight",get:function(){return this._avatar.originalHeight},set:function(t){this._avatar.originalHeight=t,this.css2("height",this.originalHeight+"px"),this.widthSize=!0}},{key:"image",get:function(){return this._avatar.image},set:function(t){var e=this;this.loaded=!1,this._avatar.image=k.getImage(t,function(t){e.widthSize||(e._avatar.width=t.width,e._avatar.originalWidth=t.width,e.css2("width",t.width+"px")),e.heightSize||(e._avatar.height=t.height,e._avatar.originalHeight=t.height,e.css2("height",t.height+"px")),e.backgroundImage=t.src,e.transform(),e.dispatchImageLoadedEvent()})}}]),s}(),x=function(e){function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"blue";i(this,s);var a=n(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return a.regX=0,a.regY=0,a._avatar.fromX=0,a._avatar.fromY=0,a.size=t,a.color=e,a.x=a.y=0,a.lines=[],a}return r(s,d),a(s,[{key:"moveTo",value:function(t,e){this._avatar.fromX=t,this._avatar.fromY=e}},{key:"lineTo",value:function(e,i){var a=this._avatar.fromX,s=this._avatar.fromY,r=Math.sqrt((a-e)*(a-e)+(s-i)*(s-i)),n=180*Math.atan2(i-s,e-a)/Math.PI,h=o.createElement();o.css(h,{backgroundColor:this.color,width:r+"px",height:this.size+"px",position:"absolute"});var l=void 0,c=void 0;return"3d"===t.mode?(l="translate3d("+this._avatar.fromX+"px,"+this._avatar.fromY+"px,0px) ",c="rotateZ("+n+"deg)"):(l="translate("+this._avatar.fromX+"px,"+this._avatar.fromY+"px) ",c="rotate("+n+"deg)"),o.css3(h,"transformOrigin","left center"),o.css3(h,"transform",l+c),this.element.appendChild(h),this._avatar.fromX=e,this._avatar.fromY=i,this._avatar.width=Math.max(e,this._avatar.width),this._avatar.height=Math.max(i,this._avatar.height),this.css2("width",this.width+"px"),this.css2("height",this.height+"px"),this.lines.push(h),h}},{key:"curveTo",value:function(e,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,s=this._avatar.fromX,r=this._avatar.fromY,n=Math.sqrt((s-e)*(s-e)+(r-i)*(r-i)),h=Math.PI/4;n/=.707,n-=4*this.size;var l=180*Math.atan2(i-r,e-s)/Math.PI,c=o.createElement(),u=n,d=n,g=Math.max(Math.abs(this.size/a),1);o.css(c,{width:u+"px",height:d+"px",position:"absolute"}),o.css(c,{borderStyle:"solid",borderTopColor:this.color,borderRightColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent",borderWidth:g+"px"},3);var v=u/2*(1-Math.cos(h)),f=d/2*(1-Math.sin(h)),m=void 0,p=void 0,y=void 0;return"3d"===t.mode?(m="translate3d("+(this._avatar.fromX-v)+"px,"+(this._avatar.fromY-f)+"px,0px) ",p="rotateZ("+l+"deg) ",y="scale3d(1,"+a+",1)"):(m="translate("+(this._avatar.fromX-v)+"px,"+(this._avatar.fromY-f)+"px) ",p="rotate("+l+"deg)",y="scale(1,"+a+")"),o.css3(c,"transformOrigin",100*v/u+"% "+100*f/u+"%"),o.css3(c,"transform",m+p+y),o.css3(c,"borderRadius","50% 50%"),this.element.appendChild(c),this._avatar.fromX=e,this._avatar.fromY=i,this._avatar.width=Math.max(e,this._avatar.width),this._avatar.height=Math.max(i,this._avatar.height),this.css2("width",this.width+"px"),this.css2("height",this.height+"px"),this.lines.push(c),c}},{key:"clear",value:function(){for(var t=0,e=this.lines.length;t<e;t++)this.element.removeChild(this.lines[t]),this.lines[t]=null;this.lines.length=0}},{key:"toString",value:function(){return"Line"}},{key:"color",get:function(){return this._avatar.color},set:function(t){this._avatar.color=t}},{key:"size",get:function(){return this._avatar.size},set:function(t){this._avatar.size=t}}]),s}(),w={object2Json:function(t){var i=void 0===t?"undefined":e(t);if("object"!==i||null===t)return"string"===i&&(t=""+t),String(t);var a=void 0,s=void 0,r=[],n=h.isArray(t);for(a in t)"string"===(i=void 0===(s=t[a])?"undefined":e(s))||"object"===i&&null!==s&&(s=this.object2Json(s)),r.push((n?"":a+":")+String(s));var o=r.join("; ");return(n?"[":"{")+o+(n?"]":"}")},object2String:function(t){var e="";for(var i in t)e+=t[i]+", ";return e=e.substr(0,e.length-2)},replaceChart:function(t){return t.replace(new RegExp("%:","g"),"%").replace(new RegExp("};","g"),"}")}},O=function(){function t(){i(this,t),this.keyframes={"100%":{}},this.label=u.generateID(this.toString());for(var e=arguments.length,a=Array(e),s=0;s<e;s++)a[s]=arguments[s];this.add.apply(this,a)}return a(t,[{key:"add",value:function(){if(arguments.length){if("object"===e(arguments.length<=0?void 0:arguments[0])){var t=arguments.length<=0?void 0:arguments[0];for(var i in t){var a=t[i],s=void 0;s=h.isNumber(i)?i+"%":i.indexOf("%")>-1?i:i+"%",delete t[""+i],t[s]=a,this.setColor(t[s])}Object.assign(this.keyframes,t)}else{var r=h.isNumber(arguments.length<=0?void 0:arguments[0])?(arguments.length<=0?void 0:arguments[0])+"%":arguments.length<=0?void 0:arguments[0],n={},o=void 0,l=void 0;3===arguments.length?(o=arguments.length<=1?void 0:arguments[1],l=arguments.length<=2?void 0:arguments[2],n[r]={},n[r][o]=l):(l=arguments.length<=1?void 0:arguments[1],n[r]=l),this.setColor(n[r]),Object.assign(this.keyframes,n)}this.fill()}}},{key:"get",value:function(t){return h.isNumber(t)&&(t+="%"),this.keyframes[t]}},{key:"remove",value:function(t){(t=h.isNumber(t)?t+"%":t)?delete this.keyframes[t]:this.destroy()}},{key:"fill",value:function(){this.sort();var t=void 0;for(var e in this.keyframes){var i=this.keyframes[e];for(var a in t)void 0===i[a]&&(i[a]=t[a]);t=i}}},{key:"sort",value:function(){var t={},e=h.keys(this.keyframes);e.sort(function(t,e){return parseFloat(t)-parseFloat(e)});for(var i=0,a=e.length;i<a;i++){var s=e[i];t[s]=this.keyframes[s]}return this.keyframes=t,this.keyframes}},{key:"merge",value:function(){var t={};for(var e in this.keyframes)for(var i in this.keyframes[e])t[i]=this.keyframes[e][i];return t}},{key:"setColor",value:function(t){t.color&&"random"===t.color&&(t.color=l.randomColor())}},{key:"destroy",value:function(){h.destroyObject(this.keyframes)}},{key:"toString",value:function(){return"Keyframes"}}]),t}(),E=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,a=arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"blur";i(this,e);var r=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.width=t,r.height=a||r.width,r.background(s),r.x=r.y=0,r.parent={originalWidth:0,originalHeight:0,regX:0,regY:0},r}return r(e,d),a(e,[{key:"clearStyle",value:function(){this.css3("transform",""),this.element.style.cssText="",this.element.style=""}},{key:"copyParent",value:function(t){this.parent.regX=t.regX,this.parent.regY=t.regY,this.parent.originalWidth=t.originalWidth,this.parent.originalHeight=t.originalHeight}},{key:"copySelf",value:function(t,e){this.regX=t.regX,this.regY=t.regY,this.originalWidth=t.originalWidth,this.originalHeight=t.originalHeight,t.parent&&this.copyParent(t.parent),e&&(this.x=t.x,this.y=t.y,this.z=t.z,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.scaleZ=t.scaleZ,this.rotation=t.rotation,this.rotationX=t.rotationX,this.rotationY=t.rotationY,this.rotationZ=t.rotationZ,this.skewX=t.skewX,this.skewY=t.skewY)}},{key:"toString",value:function(){return"Avatar"}}]),e}(),S=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:18,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#000";i(this,e);var o=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.text=t,o.size=a,o.color=r,o.align=s,o.x=o.y=0,o.regX=o.regY=0,o}return r(e,d),a(e,[{key:"toString",value:function(){return"Text"}},{key:"height",get:function(){return parseFloat(this.css2("height"))||0},set:function(t){this._avatar.height=t,this.originalHeight?this.scaleY=this.height/this.originalHeight:this.originalHeight=t}},{key:"width",get:function(){return parseFloat(this.css2("width"))||0},set:function(t){this._avatar.width=t,this.originalWidth?this.scaleX=this.width/this.originalWidth:this.originalWidth=t}},{key:"text",set:function(t){this._avatar.text=t,"string"==typeof this.element.textContent?this.element.textContent=this.text:this.element.innerText=this.text},get:function(){return this._avatar.text}},{key:"htmlText",set:function(t){this._avatar.text=t,this.element.innerHTML=this.htmlText},get:function(){return this._avatar.text}},{key:"align",set:function(t){this._avatar.align=t,this.css2("textAlign",this.align)},get:function(){return this._avatar.align}},{key:"color",set:function(t){this._avatar.color=t,this.css2("color",this.color)},get:function(){return this._avatar.color}},{key:"size",set:function(t){this._avatar.size=t,this.css2("fontSize",this.size+"px")},get:function(){return this._avatar.size}},{key:"font",set:function(t){this._avatar.font=t,this.css2("fontFamily",this.font)},get:function(){return this._avatar.font}},{key:"weight",set:function(t){this._avatar.weight=t,this.css2("fontWeight",this.weight)},get:function(){return this._avatar.weight}},{key:"smooth",set:function(t){t?this.css3("fontSmoothing","antialiased !important"):this.css3("fontSmoothing",null)}}]),e}(),C={index:0,callbacks:{},currentTime:0,nextTween:[],replace:!1,remove:!0,get avatar(){return this.avatarmc||(this.avatarmc=new E(1,1)),this.avatarmc},addFrame:function(t,i,a,s){var r=void 0;return a instanceof O?(s||(s={}),this.insertKeyframes(t,a,s.replace),this.apply(t,i,a,s)):"object"===(void 0===a?"undefined":e(a))&&(r=a.hasOwnProperty("frame")?a.frame:s,this.insertKeyframes(t,r,a.replace),this.apply(t,i,r,a)),this.index++},playFrame:function(t,i,a,s){var r=void 0;return a instanceof O?(s||(s={}),this.apply(t,i,a,s)):"object"===(void 0===a?"undefined":e(a))&&(r=a.hasOwnProperty("frame")?a.frame:s,this.apply(t,i,r,a)),this.index++},insertKeyframes:function(e,i,a){(a||this.replace)&&this.removeKeyframes(e.id+"_"+i.label);var s=o.getPrefix(2);this.avatar.clearStyle(),this.avatar.copySelf(e,"all");var r={};for(var n in i.keyframes){var h=i.keyframes[n];for(var l in r[n]={},h){var c="_"+l+"_";if(t.keyword.search(new RegExp(c,"i"))<=-1)if(l.indexOf("-")>-1){for(var u=l.split("-"),d=0;d<u.length;d++)0!==d&&(u[d]=u[d].charAt(0).toUpperCase()+u[d].substr(1));this.avatar.css2(u.join(""),h[l])}else this.avatar.css2(l,h[l]);else this.avatar[l]=h[l];switch(l){case"alpha":r[n].opacity=this.avatar[l];break;case"color":e instanceof S||(r[n]["background-color"]=this.avatar[l]);break;case"x":case"y":case"z":case"scaleX":case"scaleY":case"scaleZ":case"rotation":case"rotationX":case"rotationY":case"rotationZ":case"skewX":case"skewY":case"width":case"height":r[n][s+"transform"]=this.avatar.css3("transform");break;case"regX":case"regY":r[n][s+"transform-origin"]=this.avatar.css3("transformOrigin");break;case"originalWidth":r[n].width=this.avatar.css2("width");break;case"originalHeight":r[n].height=this.avatar.css2("height");break;case"round":r[n]["border-radius"]=this.avatar[l]+"px";break;default:r[n][l]=this.avatar.css2(l)}}}var g="@"+s+"keyframes",v=o.getDynamicSheet(),f=w.object2Json(r);f=w.replaceChart(f);var m=g+" "+e.id+"_"+i.label+f;v.insertRule(m,v.cssRules.length),v=null},apply:function(t,e,i,a){var s="",r="string"==typeof i?i:i.label;s+=t.id+"_"+r+" ",s+=e+"s ",a.ease&&(s+=a.ease+" "),a.delay&&(s+=a.delay+"s "),a.loop?(a.loop<=0&&(a.loop="infinite"),s+=a.loop+" "):a.repeat&&(a.repeat<=0&&(a.repeat="infinite"),s+=a.repeat+" "),a.yoyo&&(!0===a.yoyo&&(a.yoyo="alternate"),!1===a.yoyo&&(a.yoyo="normal"),s+=a.yoyo+" "),s+="forwards";var n=h.isEmpty(t.animations)?"":o.css3(t.element,"animation")+", ";t.animations[""+this.index]=s,s=n+s,t.css3("animation",s),this.addCallback(t);var l=this.callbacks[t.id];l.sets[""+this.index]=i.merge(),l.removes[""+this.index]=a.remove||this.remove,a.onComplete&&(a.onCompleteParams?l.completes[""+this.index]=[a.onComplete,a.onCompleteParams]:l.completes[""+this.index]=[a.onComplete])},removeKeyframes:function(t){var e="string"==typeof t?t:t.label;this.eachStyles(function(t,i,a){t.name===e&&a.deleteRule(i)})},indexOf:function(t){var e=-100,i="string"==typeof t?t:t.label;return this.eachStyles(function(t,a){t.name===i&&(e=100)}),e},eachStyles:function(t){for(var e=o.getDynamicSheet(),i=e.cssRules||e.rules||[],a=0;a<i.length;a++){var s=i[a];s.type!==CSSRule.KEYFRAMES_RULE&&s.type!==CSSRule.MOZ_KEYFRAMES_RULE&&s.type!==CSSRule.WEBKIT_KEYFRAMES_RULE&&s.type!==CSSRule.O_KEYFRAMES_RULE&&s.type!==CSSRule.MS_KEYFRAMES_RULE||t(s,a,e,i)}},pause:function(t){o.css3(t.element,"animationPlayState","paused")},resume:function(t){o.css3(t.element,"animationPlayState","running")},toggle:function(t){"running"===o.css3(t.element,"animationPlayState")?this.pause(t):this.resume(t)},removeFrameByIndex:function(t,e){e+="";var i=t.animations[e];if(i){t.animations[e]="0";var a=w.object2String(t.animations);""===h.replace(a,["0,","0"," "],"")?this.removeAllFrames(t):t.css3("animation",a)}return i},removeFrame:function(t,e,i){var a=void 0,s=void 0;return h.isNumber(e)?(a=e,s=t.animations[a+""]):"string"==typeof e?(s=e.indexOf(t.id)>-1?e:t.id+"_"+e,a=h.objectforkey(t.animations,s)):(s=t.id+"_"+e.label,a=h.objectforkey(t.animations,s)),i&&this.removeKeyframes(s),this.removeFrameByIndex(t,a)},removeFrameAfter:function(t,e,i,a){this.getPrefixEvent(),t.element.addEventListener(this.animationiteration,function s(r){this.removeFrame(t,e,a);t.element.removeEventListener(this.animationiteration,s);i&&i()},!1)},removeAllFrames:function(t){for(var e in t.animations)delete t.animations[e];o.css3(t.element,"animation","")},kill:function(t){this.removeAllFrames(t),this.callbacks[t.id]&&(this.getPrefixEvent(),t.element.removeEventListener(this.animationend,this.callbacks[t.id].fun),delete this.callbacks[t.id])},set:function(e,i){if(i)for(var a in i){var s="_"+a+"_";if(t.keyword.search(new RegExp(s,"i"))>-1)e[a]=i[a];else if(a.indexOf("-")>-1){for(var r=a.split("-"),n=0;n<r.length;n++)0!==n&&(r[n]=r[n].charAt(0).toUpperCase()+r[n].substr(1));e.css2(r.join(""),i[a])}else e.css2(a,i[a])}},addCallback:function(t){var e=this;return this.callbacks[t.id]?this.callbacks[t.id]:(this.callbacks[t.id]={fun:function(i){var a=e.callbacks[t.id];for(var s in t.animations)if(0===t.animations[s].indexOf(i.animationName)&&(e.removeFrame(t,s,a.removes[s]),delete a.removes[s],e.set(t,a.sets[s]),delete a.sets[s],a.completes[s])){1===a.completes[s].length?a.completes[s][0].apply(t):a.completes[s][0].apply(t,a.completes[s][1]);try{delete a.completes[s]}catch(i){}}},completes:{},removes:{},sets:{}},this.getPrefixEvent(),t.element.addEventListener(this.animationend,this.callbacks[t.id].fun,!1),this.callbacks[t.id])},getPrefixEvent:function(){if(this.animationend)return this.animationend;switch(o.getPrefix()){case"Webkit":this.animationend="webkitAnimationEnd",this.animationiteration="webkitAnimationIteration";break;case"ms":this.animationend="MSAnimationEnd",this.animationiteration="MSAnimationIteration";break;case"O":this.animationend="oanimationend",this.animationiteration="oanimationiteration";break;case"Moz":this.animationend="animationend",this.animationiteration="animationiteration";break;default:this.animationend="animationend",this.animationiteration="animationiteration"}return this.animationend}},Y=function(t){function s(t,e,a,r,o){i(this,s);var h=n(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t,e,a));return h.widthSize=!0,h.heightSize=!0,h._avatar.originalHeight=a,h._avatar.originalWidth=e,h._avatar.currentFrame=1,r&&h.setLabel(r),h.labels={},h.speed=o||.6,h.loop=!0,h.stop(),h}return r(s,_),a(s,[{key:"stop",value:function(){this.playing=!1,this.pause()}},{key:"play",value:function(t){if(this.recordLabel){this.animations[this.recordLabel.index]=this.recordLabel.frame;var e=w.object2String(this.animations);this.css3("animation",e)}this.playing=!0,this.resume()}},{key:"gotoAndPlay",value:function(t){if("string"==typeof t)this.label=t;else{t--;var e=this.labels[this.label],i=e.to,a=e.totalframes,s=e.width,r=e.height,n=void 0,o=void 0;0===r?o=-(n=s*t/a)+"px "+-i.y+"px":(n=r*t/a,o=-i.x+"px "+-n+"px"),this.css2("backgroundPosition",o);var h=w.object2String(this.animations);this.css3("animation",h),this.play()}}},{key:"gotoAndStop",value:function(t){if("string"==typeof t)this.label=t;else{t--;var e=this.labels[this.label],i=e.to,a=e.totalframes,s=e.width,r=e.height,n=void 0,o=void 0;0===r?o=-(n=s*t/a)+"px "+-i.y+"px":(n=r*t/a,o=-i.x+"px "+-n+"px"),this.css2("backgroundPosition",o);var h=C.removeFrameByIndex(this,this.currentTimelineIndex);this.recordLabel={frame:h,index:this.currentTimelineIndex}}}},{key:"setLabel",value:function(t,i,a,s){if("object"===(void 0===t?"undefined":e(t))){var r=void 0,n=void 0,o=void 0,h=void 0;if(t.from&&t.to)return r=t.from,n=t.to,h=t.label,o=t.totalframes,this.setLabel(h,r,n,o);for(var l in t)return r=t[l].from,n=t[l].to,o=t[l].totalframes,this.setLabel(l,r,n,o)}else this.labels[t]=this.makeFrame(i,a,s),this.label=t;return this.labels[t]}},{key:"makeFrame",value:function(t,e,i){t=t||{x:"0px",y:"0px"},e=e||{x:"-200%",y:"0px"};var a=Math.abs(parseFloat(e.x-t.x)),s=Math.abs(parseFloat(e.y-t.y)),r=new O,n=-t.x,o=-t.y,h=-e.x,l=-e.y;return r.add(0,{"background-position":n+"px "+o+"px"}),r.add(100,{"background-position":h+"px "+l+"px"}),{frame:r,totalframes:i,width:a,height:s,from:t,to:e}}},{key:"toString",value:function(){return"MovieClip"}},{key:"currentFrame",get:function(){var t=this.labels[this.label],e=t.totalframes,i=t.width,a=t.height,s=void 0;return 0===a?(s=h.getCssValue(this,"backgroundPosition",0,2),this._avatar.currentFrame=s*e/i):(s=h.getCssValue(this,"backgroundPosition",1,2),this._avatar.currentFrame=s*e/a),this._avatar.currentFrame}},{key:"label",get:function(){return this._avatar.label},set:function(t){if(this.labels[t]){this._avatar.label=t;var e=this.labels[t].frame,i=this.labels[t].totalframes;C.indexOf(e)<=-1&&C.insertKeyframes(this,e);var a=this.loop?-1:0;C.removeFrameByIndex(this,this.currentTimelineIndex),this.currentTimelineIndex=C.playFrame(this,this.speed,e,{loop:a,ease:"steps("+i+")"}),this.totalframes=i,this.play()}}},{key:"speed",get:function(){return this._avatar.speed},set:function(t){if(this._avatar.speed=t,this.labels[this.label]){C.removeFrameByIndex(this,this.currentTimelineIndex);var e=this.loop?-1:0,i=this.labels[this.label].frame,a=this.labels[this.label].totalframes;C.removeFrameByIndex(this,this.currentTimelineIndex),this.currentTimelineIndex=C.playFrame(this,this.speed,i,{loop:e,ease:"steps("+a+")"})}this.play()}}]),s}(),I=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,a=arguments[1],s=arguments[2];i(this,e);var r=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.x=r.y=0,r.width=t,r.height=a||r.width,s=s||"blue",r.background(s),r}return r(e,d),a(e,[{key:"toString",value:function(){return"Rect"}},{key:"round",get:function(){return this._avatar.round},set:function(t){this._avatar.round=t,this.css3("borderRadius",this.round+"px")}}]),e}(),X=void 0,j=function(t){function e(t,a,s,r){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],h=arguments.length>5&&void 0!==arguments[5]&&arguments[5];i(this,e);var l=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return X=-1,l.imgArr=t,"boolean"==typeof r?(l.speed=30,l.useCssSprite=l.speed):(l.speed=r||30,l.useCssSprite=h),l.useIntervl=o,l.state="stop",l.originalHeight=s,l.originalWidth=a,l.currentFrame=1,l.prevFrame=l.currentFrame,l.totalFrames=t.length,l.setBackgroundImage(),l.loop=!0,l.prvePlay=!1,l.elapsed=0,l.stop(),l}return r(e,d),a(e,[{key:"setBackgroundImage",value:function(){this.useCssSprite?(this.removeClass(this.imgArr[this.prevFrame-1]),this.addClass(this.imgArr[this.currentFrame-1])):this.backgroundImage=this.imgArr[this.currentFrame-1]}},{key:"play",value:function(){var t=this;this.useIntervl&&X<0&&(X=setInterval(function(){return t.update()},1e3/this.speed)),this.state="play"}},{key:"stop",value:function(t){this.useIntervl&&t&&(clearInterval(X),X=-1),this.state="stop"}},{key:"gotoAndPlay",value:function(t){this.currentFrame=t,this.setBackgroundImage(),this.play(),this.state="play"}},{key:"gotoAndStop",value:function(t){this.currentFrame=t,this.setBackgroundImage(),this.stop(),this.state="stop"}},{key:"update",value:function(){if("stop"!==this.state){if(!this.useIntervl){this.oldTime||(this.oldTime=(new Date).getTime());var t=(new Date).getTime();if(this.elapsed+=t-this.oldTime,this.oldTime=t,!(this.elapsed>=1e3/this.speed))return;this.elapsed=this.elapsed%(1e3/this.speed)}this.render()}}},{key:"render",value:function(){"stop"!==this.state&&(this.prevFrame=this.currentFrame,this.prvePlay?this.currentFrame--:this.currentFrame++,this.prvePlay?this.loop?this.currentFrame<1&&(this.currentFrame=this.totalFrames):this.currentFrame<=1&&(this.currentFrame=1,this.stop()):this.loop?this.currentFrame>this.totalFrames&&(this.currentFrame=1):this.currentFrame>=this.totalFrames&&(this.currentFrame=this.totalFrames,this.stop()),this.setBackgroundImage())}},{key:"toString",value:function(){return"SpriteSheet"}}]),e}(),F=function(e){function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:173.2,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#00cc22";i(this,s);var r=n(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return r.css({width:"0px",height:"0px"}),r.css({borderStyle:"solid",borderTopColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"},3),r._avatar.ox=0,r.width=t,r.height=e,r.color=a,r.x=r.y=0,r}return r(s,d),a(s,[{key:"transform",value:function(){var e=void 0,i=void 0,a=void 0,s=void 0,r=void 0,n=void 0,o=void 0,h=void 0;"3d"===t.mode&&t.support3d?(e=this.parent?this.parent.regX*this.parent.originalWidth:0,i=this.parent?this.parent.regY*this.parent.originalHeight:0,a=this.regX*this.originalWidth,s=this.regY*this.originalHeight,r="translate3d("+(this._avatar.x-a+e)+"px,"+(this.y-s+i)+"px,"+this.z+"px) ",n="rotateX("+this.rotationX+"deg) rotateY("+this.rotationY+"deg) rotateZ("+this.rotationZ+"deg) ",o="scale3d("+this.scaleX+","+this.scaleY+","+this.scaleZ+") ",h="skew("+this.skewX+"deg,"+this.skewY+"deg)",this.css3("transform",r+n+o+h)):(e=this.parent?this.parent.regX*this.parent.originalWidth:0,i=this.parent?this.parent.regY*this.parent.originalHeight:0,a=this.regX*this.originalWidth,s=this.regY*this.originalHeight,r="translate("+(this._avatar.x-a+e)+"px,"+(this.y-s+i)+"px) ",n="rotate("+this.rotationZ+"deg) ",o="scale("+this.scaleX+","+this.scaleY+") ",h="skew("+this.skewX+"deg,"+this.skewY+"deg)",this.css3("transform",r+n+o+h))}},{key:"getCirumRadius",value:function(){var t=2*Math.atan2(this.height,this.width);return this.width/Math.sin(t)}},{key:"regCircumcenter",value:function(){this.regY=this.getCirumRadius()/this.height}},{key:"toString",value:function(){return"Triangle"}},{key:"color",get:function(){return this._avatar.color},set:function(t){"random"!==t&&"#random"!==t||(t=l.randomColor()),this._avatar.color=t,this.css3("borderBottomColor",this.color)}},{key:"originalWidth",get:function(){return this._avatar.originalWidth},set:function(t){this._avatar.originalWidth=t}},{key:"originalHeight",get:function(){return this._avatar.originalHeight},set:function(t){this._avatar.originalHeight=t}},{key:"width",get:function(){return this._avatar.width},set:function(t){this._avatar.width=t,this.originalWidth?this.scaleX=this.width/this.originalWidth:(this.originalWidth=t,this.css({borderWidth:"0px",borderRightWidth:t+"px",borderLeftWidth:t+"px"},3),this._avatar.ox=t/2)}},{key:"height",get:function(){return this._avatar.height},set:function(t){this._avatar.height=t,this.originalHeight?this.scaleY=this.height/this.originalHeight:(this.originalHeight=t,this.css({borderTopWidth:"0px",borderBottomWidth:t+"px"},3))}},{key:"x",get:function(){return this._avatar.x+this._avatar.ox},set:function(t){this._avatar.x=t-this._avatar.ox,this.transform()}}]),s}(),A={linear:"linear",easeBasic:"ease",easeInBasic:"ease-in",easeOutBasic:"ease-out",easeInOutBasic:"ease-in-out",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)",stepStart:"step-start",stepStop:"step-stop"},H=function(t){function e(t,a,s){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"left",h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;i(this,e);var c=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,a,s));return c.widthSize=!0,c.heightSize=!0,c.speed=r,c.direction=o,c.backgroundWidth=h,c.backgroundHeight=l,c.originalHeight=s,c.originalWidth=a,c.scrolling(),c}return r(e,_),a(e,[{key:"scrolling",value:function(t,e){if(t=t||this.speed,e=e||A.linear,this.scrollframes&&(this.removeFrame(this.scrollframes),this.scrollframes.destroy()),this.scrollframes=new O,this.scrollframes.add(0,{"background-position":"0% 0%"}),"left"===this.direction){var i=this.backgroundWidth?1*this.backgroundWidth+"px":"200%";this.scrollframes.add(100,{"background-position":i+" 0%"})}else if("right"===this.direction){var a=this.backgroundWidth?-1*this.backgroundWidth+"px":"-200%";this.scrollframes.add(100,{"background-position":a+" 0%"})}else if("up"===this.direction){var s=this.backgroundHeight?-1*this.backgroundHeight+"px":"0%";this.scrollframes.add(100,{"background-position":"0% "+s})}else if("down"===this.direction||"bottom"===this.direction){var r=this.backgroundHeight?1*this.backgroundHeight+"px":"0%";this.scrollframes.add(100,{"background-position":"0% "+r})}this.addFrame(t,this.scrollframes,{loop:-1,ease:e})}},{key:"toString",value:function(){return"ScrollingBg"}},{key:"backgroundWidth",get:function(){return this._avatar.backgroundWidth},set:function(t){this._avatar.backgroundWidth=t,this.scrolling()}},{key:"backgroundHeight",get:function(){return this._avatar.backgroundHeight},set:function(t){this._avatar.backgroundHeight=t,this.scrolling()}},{key:"speed",get:function(){return this._avatar.speed},set:function(t){this._avatar.speed=t,this.scrolling()}},{key:"direction",get:function(){return this._avatar.direction},set:function(t){this._avatar.direction=t,this.scrolling()}}]),e}(),z=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"purple";i(this,e);var s=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return s.radius=t,s.background(a),s.x=s.y=0,s}return r(e,d),a(e,[{key:"toString",value:function(){return"Semicircle"}},{key:"radius",get:function(){return this._avatar.radius},set:function(t){this._avatar.radius=t,this.width=2*this.radius,this.height=this.radius,this.css3("borderRadius",this.radius+"px "+this.radius+"px 0 0")}}]),e}(),L=function(){function t(e){i(this,t),this.type=e,this.elements=[],this.styleObj={},this.arguments=arguments,this.a=this.b=this.c=this.d=this.e=this.f=this.g=null}return a(t,[{key:"apply",value:function(t){switch(this.elements.push(t),this.styleObj[t.id]={style:"",value:""},this.type){case"stroke":case"blur":this.a=this.arguments.length>1?this.arguments[1]:5,this.b=this.arguments.length>2?this.arguments[2]:"#000";break;case"shadow":this.a=this.arguments.length>1?this.arguments[1]:3,this.b=this.arguments.length>2?this.arguments[2]:3,this.c=this.arguments.length>3?this.arguments[3]:5,this.d=this.arguments.length>4?this.arguments[4]:"#000";break;case"glow":this.a=this.arguments.length>1?this.arguments[1]:5,this.b=this.arguments.length>2?this.arguments[2]:"#000";break;case"insetglow":case"insetGlow":case"inset-glow":this.a=this.arguments.length>1?this.arguments[1]:5,this.b=this.arguments.length>2?this.arguments[2]:"#000";break;case"3d":this.a=this.arguments.length>1?this.arguments[1]:6,this.b=this.arguments.length>2?this.arguments[2]:"#000"}this.reset(t)}},{key:"reset",value:function(t){for(var e=void 0===t?this.elements:[t],i=0,a=e.length;i<a;i++){var s=e[i];switch(this.styleObj[s.id].value="",this.type){case"stroke":if(s instanceof S){var r=-this.a+"px "+-this.a+"px 0 "+this.b,n=this.a+"px "+-this.a+"px 0 "+this.b,h=-this.a+"px "+this.a+"px 0 "+this.b,c=this.a+"px "+this.a+"px 0 "+this.b;this.styleObj[s.id].value=r+","+n+","+h+","+c}else this.styleObj[s.id].value="0 0 0 "+this.a+"px "+this.b;break;case"blur":o.css2(s.element,"color",l.alpha0),o.css3(s.element,"background",l.alpha0),this.styleObj[s.id].value="0 0 "+this.a+"px "+this.b;break;case"shadow":this.styleObj[s.id].value=this.a+"px "+this.b+"px "+this.c+"px "+this.d;break;case"glow":this.styleObj[s.id].value="0 0 "+this.a+"px "+this.b;break;case"insetglow":case"insetGlow":case"inset-glow":this.styleObj[s.id].value="inset 0 0 "+this.a+"px "+this.b;break;case"3d":for(var u=1,d=this.a;u<=d;u++)this.styleObj[s.id].value+=u===d?u+"px "+u+"px "+this.b:u+"px "+u+"px "+this.b+","}this.styleObj[s.id].style=s instanceof S?"textShadow":"boxShadow",o.css3(s.element,this.styleObj[s.id].style,this.styleObj[s.id].value)}}},{key:"erase",value:function(t){h.arrayRemove(this.elements,t),o.css3(t.element,this.styleObj[t.id].style,null),delete this.styleObj[t.id]}}]),t}(),T=function(){function t(a,s,r,n,o){var h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;i(this,t),"object"===(void 0===s?"undefined":e(s))?(this.from=s.from,this.to=s.to,this.label=a,this.totalframes=s.totalframes||1):(this.label=a,this.from={x:s,y:r},this.to={x:n,y:o},this.totalframes=h)}return a(t,[{key:"toString",value:function(){return"MovieClipLabel"}}]),t}(),P={keyword:["ease","delay","yoyo","all","loop","repeat","frame","onStart","onUpdate","onComplete","onCompleteParams","overwrite","setTimeout"],callbacks:{},arguments:{},oldAttribute:{},setTimeout:!0,timeoutDelay:30,index:0,to:function(t,e,i){for(var a=this,s=i.all?["all"]:this.apply(t,i,this.index),r="",n=0;n<s.length;n++)n>0&&(r+=", "),r+=s[n],r+=" "+e+"s",i.ease&&(r+=" "+i.ease),i.delay&&(r+=" "+i.delay+"s");var o=-999;return this.useSetTimeout()?o=setTimeout(function(t,e,i,s){a.start(t,e,i,s),o=-999},this.timeoutDelay,t,r,i,this.index):this.start(t,r,i,this.index),this.arguments[this.index+""]=[t,e,i,o],this.index++},useSetTimeout:function(){return void 0!==this.setTimeout?this.setTimeout:!(!h.browser().isFirefox&&!h.browser().isIE)},start:function(t,e,i,a){if(i.overwrite)this.killTweensOf(t),h.destroyObject(t.transitions),t.transitions[""+a]=e;else{var s=h.isEmpty(t.transitions)||"none"===w.object2String(t.transitions)?"":o.css3(t.element,"transition")+", ";t.transitions[""+a]=e,e=s+e}if(o.css3(t.element,"transition",e),this.set(t,i),this.addCallback(t),i.onStart){var r=i.delay||0;setTimeout(i.onStart,1e3*r)}i.onComplete&&(i.onCompleteParams?this.callbacks[t.id].completes[""+a]=[i.onComplete,i.onCompleteParams]:this.callbacks[t.id].completes[""+a]=[i.onComplete])},from:function(t,e,i){var a={};for(var s in i){var r="_"+s+"_";-1===this.getKeywordString().search(new RegExp(r,"i"))?(a[s]=t[s],t[s]=i[s]):a[s]=i[s]}return this.to(t,e,a)},fromTo:function(t,e,i,a){for(var s in i){var r="_"+s+"_";-1===this.getKeywordString().search(new RegExp(r,"i"))&&(t[s]=i[s])}return this.to(t,e,a)},apply:function(e,i,a){var s=[];for(var r in i){var n="_"+r+"_";this.getKeywordString().search(new RegExp(n,"i"))<=-1&&(this.getOldAttribute(e,a)[r]=e[r],"alpha"===r?r="opacity":"color"!==r||e instanceof S?"x"===r||"y"===r||"z"===r?r=t.transform:"scaleX"===r||"scaleY"===r||"scaleZ"===r?r=t.transform:"rotationX"===r||"rotation"===r||"rotationY"===r||"rotationZ"===r?r=t.transform:"skewX"===r||"skewY"===r?r=t.transform:"regX"===r||"regY"===r?r=this.Agile.transformOrigin:"width"===r||"height"===r?r=t.transform:"originalWidth"===r?r="width":"originalHeight"===r&&(r="height"):r="background-color",s.indexOf(r)<0&&s.push(r))}return s},killTweensOf:function(t,e){if(h.isNumber(t)){if(this.arguments[""+t]){var i=this.arguments[""+t][0],a=this.arguments[""+t][2],s=this.arguments[""+t][3];s>0&&(clearTimeout(s),s=-999),e&&this.set(i,a),o.css3(i.element,"transition","none !important"),o.css3(i.element,"transition","none"),this.removeCallback(i),delete this.arguments[""+t],delete i.transitions[""+t]}}else{for(var r in this.arguments){var n=this.arguments[r];if(n[0]===t){var l=n[3];l>0&&(clearTimeout(l),l=-999),delete this.arguments[r]}}if(e&&this.oldAttribute[t.id])for(var c in this.oldAttribute[t.id]){for(var u in this.oldAttribute[t.id][c])t[u]=this.oldAttribute[t.id][c][u];delete this.oldAttribute[t.id][c]}h.destroyObject(t.transitions),delete this.oldAttribute[t.id],this.removeCallback(t),o.css3(t.element,"transition","none !important"),o.css3(t.element,"transition","none")}},killAll:function(e){for(var i in this.oldAttribute){var a=t.getEleById(i);this.killTweensOf(a,e)}},set:function(e,i){for(var a in e.css3("transition"),i){var s="_"+a+"_";if(this.getKeywordString().search(new RegExp(s,"i"))<=-1)if(t.keyword.search(new RegExp(s,"i"))<=-1)if(a.indexOf("-")>-1){for(var r=a.split("-"),n=0;n<r.length;n++)0!==n&&(r[n]=r[n].charAt(0).toUpperCase()+r[n].substr(1));e.css2(r.join(""),i[a])}else e.css2(a,i[a]);else e[a]=i[a]}},remove:function(t,e){delete t.transitions[""+e];var i=w.object2String(t.transitions);o.css3(t.element,"transition",i)},getKeywordString:function(){return this.keywordString||(this.keywordString="_"+this.keyword.join("_")+"_"),this.keywordString},addCallback:function(t){var e=this;return this.callbacks[t.id]?this.callbacks[t.id]:(this.callbacks[t.id]={fun:function(i){var a=e.callbacks[t.id];for(var s in t.transitions)if(t.transitions[s].indexOf(i.propertyName)>-1&&(e.remove(t,s),e.deleteOldAttribute(t,s),a.completes[s])){var r=a.completes[s];1===r.length?r[0].apply(t):r[0].apply(t,r[1]);try{delete a.completes[s]}catch(i){}}},completes:{}},this.getPrefixEvent(),t.element.addEventListener(this.transitionend,this.callbacks[t.id].fun,!1),this.callbacks[t.id])},removeCallback:function(t){if(this.callbacks[t.id]){var e=this.callbacks[t.id];this.getPrefixEvent(),t.element.removeEventListener(this.transitionend,e.fun,!1),e.completes&&h.destroyObject(e.completes),h.destroyObject(e),delete this.callbacks[t.id]}},getPrefixEvent:function(){if(!this.transitionend)switch(o.getPrefix()){case"Webkit":this.transitionend="webkitTransitionEnd";break;case"ms":this.transitionend="MSTransitionEnd";break;case"O":this.transitionend="oTransitionEnd";break;case"Moz":this.transitionend="transitionend";break;default:this.transitionend="transitionend"}},getOldAttribute:function(t,e){return this.oldAttribute[t.id]||(this.oldAttribute[t.id]={}),this.oldAttribute[t.id][e]||(this.oldAttribute[t.id][e]={}),this.oldAttribute[t.id][e]},deleteOldAttribute:function(t,e){this.oldAttribute[t.id]&&(delete this.oldAttribute[t.id][e],h.isEmpty(this.oldAttribute[t.id])&&delete this.oldAttribute[t.id])}};return t.Css=o,t.DisplayObject=d,t.Container=f,t.Circle=g,t.Dom=v,t.Ellipse=m,t.Image=_,t.Line=x,t.MovieClip=Y,t.Rect=I,t.SpriteSheet=j,t.Text=S,t.Triangle=F,t.ScrollingBg=H,t.Semicircle=z,t.Color=l,t.Filter=L,t.Utils=h,t.LoadManager=k,t.MovieClipLabel=T,t.Keyframes=O,t.Timeline=C,t.Tween=P,t.ease=A,t.gradient=l.gradient.bind(l),Object.assign(t,A),t});
//# sourceMappingURL=agile.min.js.map