UNPKG

amis

Version:

一种MIS页面生成工具

16 lines (14 loc) 1.25 MB
;/*!node_modules/zrender/dist/zrender.js*/ amis.define("2b3ec31",(function(t,e,r,i){var n,o;n=this,o=function(t){"use strict";var e=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},r=new function(){this.browser=new e,this.node=!1,this.wxa=!1,this.worker=!1,this.canvasSupported=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(r.wxa=!0,r.canvasSupported=!0,r.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?(r.worker=!0,r.canvasSupported=!0):"undefined"==typeof navigator?(r.node=!0,r.canvasSupported=!0,r.svgSupported=!0):function(t,e){var r=e.browser,i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(r.firefox=!0,r.version=i[1]),n&&(r.ie=!0,r.version=n[1]),o&&(r.edge=!0,r.version=o[1],r.newEdge=+o[1].split(".")[0]>18),a&&(r.weChat=!0),e.canvasSupported=!!document.createElement("canvas").getContext,e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}(navigator.userAgent,r);var i={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},n={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},o=Object.prototype.toString,a=Array.prototype,s=a.forEach,h=a.filter,l=a.slice,u=a.map,c=function(){}.constructor,p=c?c.prototype:null,f={},d=2311;function v(){return d++}function y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];"undefined"!=typeof console&&console.error.apply(console,t)}function g(t){if(null==t||"object"!=typeof t)return t;var e=t,r=o.call(t);if("[object Array]"===r){if(!Y(t)){e=[];for(var a=0,s=t.length;a<s;a++)e[a]=g(t[a])}}else if(n[r]){if(!Y(t)){var h=t.constructor;if(h.from)e=h.from(t);else for(e=new h(t.length),a=0,s=t.length;a<s;a++)e[a]=g(t[a])}}else if(!i[r]&&!Y(t)&&!B(t))for(var l in e={},t)t.hasOwnProperty(l)&&(e[l]=g(t[l]));return e}function _(t,e,r){if(!I(e)||!I(t))return r?g(e):t;for(var i in e)if(e.hasOwnProperty(i)){var n=t[i],o=e[i];!I(o)||!I(n)||M(o)||M(n)||B(o)||B(n)||O(o)||O(n)||Y(o)||Y(n)?!r&&i in t||(t[i]=g(e[i])):_(n,o,r)}return t}function m(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function x(t,e,r){for(var i=P(e),n=0;n<i.length;n++){var o=i[n];(r?null!=e[o]:null==t[o])&&(t[o]=e[o])}return t}var w=function(){return f.createCanvas()};function b(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r}return-1}function S(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),n=0;n<i.length;n++){var o=i[n];"constructor"!==o&&(r?null!=e[o]:null==t[o])&&(t[o]=e[o])}else x(t,e,r)}function k(t){return!!t&&"string"!=typeof t&&"number"==typeof t.length}function T(t,e,r){if(t&&e)if(t.forEach&&t.forEach===s)t.forEach(e,r);else if(t.length===+t.length)for(var i=0,n=t.length;i<n;i++)e.call(r,t[i],i,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(r,t[o],o,t)}function C(t,e,r){if(!t)return[];if(!e)return U(t);if(t.map&&t.map===u)return t.map(e,r);for(var i=[],n=0,o=t.length;n<o;n++)i.push(e.call(r,t[n],n,t));return i}function A(t,e,r,i){if(t&&e){for(var n=0,o=t.length;n<o;n++)r=e.call(i,r,t[n],n,t);return r}}function P(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}f.createCanvas=function(){return document.createElement("canvas")};var D=p&&L(p.bind)?p.call.bind(p.bind):function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return function(){return t.apply(e,r.concat(l.call(arguments)))}};function M(t){return Array.isArray?Array.isArray(t):"[object Array]"===o.call(t)}function L(t){return"function"==typeof t}function R(t){return"string"==typeof t}function z(t){return"number"==typeof t}function I(t){var e=typeof t;return"function"===e||!!t&&"object"===e}function O(t){return!!i[o.call(t)]}function E(t){return!!n[o.call(t)]}function B(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function F(t){return null!=t.colorStops}function H(t){return null!=t.image}function N(t,e){return null!=t?t:e}function W(t,e,r){return null!=t?t:null!=e?e:r}function U(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return l.apply(t,e)}function X(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function j(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var G="__ec_primitive__";function Y(t){return t[G]}var q=function(){function t(e){this.data={};var r=M(e);this.data={};var i=this;function n(t,e){r?i.set(t,e):i.set(e,t)}e instanceof t?e.each(n):e&&T(e,n)}return t.prototype.get=function(t){return this.data.hasOwnProperty(t)?this.data[t]:null},t.prototype.set=function(t,e){return this.data[t]=e},t.prototype.each=function(t,e){for(var r in this.data)this.data.hasOwnProperty(r)&&t.call(e,this.data[r],r)},t.prototype.keys=function(){return P(this.data)},t.prototype.removeKey=function(t){delete this.data[t]},t}();function V(t,e){var r;if(Object.create)r=Object.create(t);else{var i=function(){};i.prototype=t,r=new i}return e&&m(r,e),r}function Z(t,e){return t.hasOwnProperty(e)}function K(){}var Q=Object.freeze({__proto__:null,$override:function(t,e){f[t]=e},guid:v,logError:y,clone:g,merge:_,mergeAll:function(t,e){for(var r=t[0],i=1,n=t.length;i<n;i++)r=_(r,t[i],e);return r},extend:m,defaults:x,createCanvas:w,indexOf:b,inherits:function(t,e){var r=t.prototype;function i(){}for(var n in i.prototype=e.prototype,t.prototype=new i,r)r.hasOwnProperty(n)&&(t.prototype[n]=r[n]);t.prototype.constructor=t,t.superClass=e},mixin:S,isArrayLike:k,each:T,map:C,reduce:A,filter:function(t,e,r){if(!t)return[];if(!e)return U(t);if(t.filter&&t.filter===h)return t.filter(e,r);for(var i=[],n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)&&i.push(t[n]);return i},find:function(t,e,r){if(t&&e)for(var i=0,n=t.length;i<n;i++)if(e.call(r,t[i],i,t))return t[i]},keys:P,bind:D,curry:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(l.call(arguments)))}},isArray:M,isFunction:L,isString:R,isStringSafe:function(t){return"[object String]"===o.call(t)},isNumber:z,isObject:I,isBuiltInObject:O,isTypedArray:E,isDom:B,isGradientObject:F,isPatternObject:H,isRegExp:function(t){return"[object RegExp]"===o.call(t)},eqNaN:function(t){return t!=t},retrieve:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,i=t.length;r<i;r++)if(null!=t[r])return t[r]},retrieve2:N,retrieve3:W,slice:U,normalizeCssArray:X,assert:function(t,e){if(!t)throw new Error(e)},trim:j,setAsPrimitive:function(t){t[G]=!0},isPrimitive:Y,HashMap:q,createHashMap:function(t){return new q(t)},concatArray:function(t,e){for(var r=new t.constructor(t.length+e.length),i=0;i<t.length;i++)r[i]=t[i];var n=t.length;for(i=0;i<e.length;i++)r[i+n]=e[i];return r},createObject:V,hasOwn:Z,noop:K}),$=function(t,e){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)}; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function J(t,e){function r(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function tt(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function et(t){return[t[0],t[1]]}function rt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function it(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function nt(t){return Math.sqrt(at(t))}var ot=nt;function at(t){return t[0]*t[0]+t[1]*t[1]}var st=at;function ht(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function lt(t,e){var r=nt(e);return 0===r?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function ut(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var ct=ut;function pt(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var ft=pt;function dt(t,e,r,i){return t[0]=e[0]+i*(r[0]-e[0]),t[1]=e[1]+i*(r[1]-e[1]),t}function vt(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}function yt(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function gt(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var _t=Object.freeze({__proto__:null,create:tt,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},clone:et,set:function(t,e,r){return t[0]=e,t[1]=r,t},add:rt,scaleAndAdd:function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t},sub:it,len:nt,length:ot,lenSquare:at,lengthSquare:st,mul:function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},div:function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},scale:ht,normalize:lt,distance:ut,dist:ct,distanceSquare:pt,distSquare:ft,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},lerp:dt,applyTransform:vt,min:yt,max:gt}),mt=function(t,e){this.target=t,this.topTarget=e&&e.topTarget},xt=function(){function t(t){this.handler=t,t.on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent;e&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new mt(e,t),"dragstart",t.event))},t.prototype._drag=function(t){var e=this._draggingTarget;if(e){var r=t.offsetX,i=t.offsetY,n=r-this._x,o=i-this._y;this._x=r,this._y=i,e.drift(n,o,t),this.handler.dispatchToElement(new mt(e,t),"drag",t.event);var a=this.handler.findHover(r,i,e).target,s=this._dropTarget;this._dropTarget=a,e!==a&&(s&&a!==s&&this.handler.dispatchToElement(new mt(s,t),"dragleave",t.event),a&&a!==s&&this.handler.dispatchToElement(new mt(a,t),"dragenter",t.event))}},t.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new mt(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new mt(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},t}(),wt=function(){function t(t){t&&(this._$eventProcessor=t)}return t.prototype.on=function(t,e,r,i){this._$handlers||(this._$handlers={});var n=this._$handlers;if("function"==typeof e&&(i=r,r=e,e=null),!r||!t)return this;var o=this._$eventProcessor;null!=e&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),n[t]||(n[t]=[]);for(var a=0;a<n[t].length;a++)if(n[t][a].h===r)return this;var s={h:r,query:e,ctx:i||this,callAtLast:r.zrEventfulCallAtLast},h=n[t].length-1,l=n[t][h];return l&&l.callAtLast?n[t].splice(h,0,s):n[t].push(s),this},t.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},t.prototype.off=function(t,e){var r=this._$handlers;if(!r)return this;if(!t)return this._$handlers={},this;if(e){if(r[t]){for(var i=[],n=0,o=r[t].length;n<o;n++)r[t][n].h!==e&&i.push(r[t][n]);r[t]=i}r[t]&&0===r[t].length&&delete r[t]}else delete r[t];return this},t.prototype.trigger=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[t],n=this._$eventProcessor;if(i)for(var o=e.length,a=i.length,s=0;s<a;s++){var h=i[s];if(!n||!n.filter||null==h.query||n.filter(t,h.query))switch(o){case 0:h.h.call(h.ctx);break;case 1:h.h.call(h.ctx,e[0]);break;case 2:h.h.call(h.ctx,e[0],e[1]);break;default:h.h.apply(h.ctx,e)}}return n&&n.afterTrigger&&n.afterTrigger(t),this},t.prototype.triggerWithContext=function(t){if(!this._$handlers)return this;var e=this._$handlers[t],r=this._$eventProcessor;if(e)for(var i=arguments,n=i.length,o=i[n-1],a=e.length,s=0;s<a;s++){var h=e[s];if(!r||!r.filter||null==h.query||r.filter(t,h.query))switch(n){case 0:h.h.call(o);break;case 1:h.h.call(o,i[0]);break;case 2:h.h.call(o,i[0],i[1]);break;default:h.h.apply(o,i.slice(1,n-1))}}return r&&r.afterTrigger&&r.afterTrigger(t),this},t}(),bt=Math.log(2);function St(t,e,r,i,n,o){var a=i+"-"+n,s=t.length;if(o.hasOwnProperty(a))return o[a];if(1===e){var h=Math.round(Math.log((1<<s)-1&~n)/bt);return t[r][h]}for(var l=i|1<<r,u=r+1;i&1<<u;)u++;for(var c=0,p=0,f=0;p<s;p++){var d=1<<p;d&n||(c+=(f%2?-1:1)*t[r][p]*St(t,e-1,u,l,n|d,o),f++)}return o[a]=c,c}function kt(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],i={},n=St(r,8,0,0,0,i);if(0!==n){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*St(r,7,0===a?1:0,1<<a,1<<s,i)/n*e[a];return function(t,e,r){var i=e*o[6]+r*o[7]+1;t[0]=(e*o[0]+r*o[1]+o[2])/i,t[1]=(e*o[3]+r*o[4]+o[5])/i}}}function Tt(t,e,i,n,o){if(e.getBoundingClientRect&&r.domSupported&&!Ct(e)){var a=e.___zrEVENTSAVED||(e.___zrEVENTSAVED={}),s=function(t,e,r){for(var i=r?"invTrans":"trans",n=e[i],o=e.srcCoords,a=[],s=[],h=!0,l=0;l<4;l++){var u=t[l].getBoundingClientRect(),c=2*l,p=u.left,f=u.top;a.push(p,f),h=h&&o&&p===o[c]&&f===o[c+1],s.push(t[l].offsetLeft,t[l].offsetTop)}return h&&n?n:(e.srcCoords=a,e[i]=r?kt(s,a):kt(a,s))}(function(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var i=["left","right"],n=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=o%2,h=(o>>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",n[h]+":0",i[1-s]+":auto",n[1-h]+":auto",""].join("!important;"),t.appendChild(a),r.push(a)}return r}(e,a),a,o);if(s)return s(t,i,n),!0}return!1}function Ct(t){return"CANVAS"===t.nodeName.toUpperCase()}var At="undefined"!=typeof window&&!!window.addEventListener,Pt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Dt=[];function Mt(t,e,i,n){return i=i||{},n||!r.canvasSupported?Lt(t,e,i):r.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):Lt(t,e,i),i}function Lt(t,e,i){if(r.domSupported&&t.getBoundingClientRect){var n=e.clientX,o=e.clientY;if(Ct(t)){var a=t.getBoundingClientRect();return i.zrX=n-a.left,void(i.zrY=o-a.top)}if(Tt(Dt,t,n,o))return i.zrX=Dt[0],void(i.zrY=Dt[1])}i.zrX=i.zrY=0}function Rt(t){return t||window.event}function zt(t,e,r){if(null!=(e=Rt(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var n="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];n&&Mt(t,n,e,r)}else{Mt(t,e,e,r);var o=function(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,i=t.deltaY;return null==r||null==i?e:3*(0!==i?Math.abs(i):Math.abs(r))*(i>0?-1:i<0?1:r>0?-1:1)}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Pt.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}var It=At?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},Ot=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,r){return this._doTrack(t,e,r),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,r){var i=t.touches;if(i){for(var n={points:[],touches:[],target:e,event:t},o=0,a=i.length;o<a;o++){var s=i[o],h=Mt(r,s,{});n.points.push([h.zrX,h.zrY]),n.touches.push(s)}this._track.push(n)}},t.prototype._recognize=function(t){for(var e in Bt)if(Bt.hasOwnProperty(e)){var r=Bt[e](this._track,t);if(r)return r}},t}();function Et(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}var Bt={pinch:function(t,e){var r=t.length;if(r){var i,n=(t[r-1]||{}).points,o=(t[r-2]||{}).points||n;if(o&&o.length>1&&n&&n.length>1){var a=Et(n)/Et(o);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=n)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}},Ft="silent";function Ht(){It(this.event)}var Nt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return J(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(wt),Wt=function(t,e){this.x=t,this.y=e},Ut=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Xt=function(t){function e(e,r,i,n){var o=t.call(this)||this;return o._hovered=new Wt(0,0),o.storage=e,o.painter=r,o.painterRoot=n,i=i||new Nt,o.proxy=null,o.setHandlerProxy(i),o._draggingMgr=new xt(o),o}return J(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(T(Ut,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,r=t.zrY,i=Gt(this,e,r),n=this._hovered,o=n.target;o&&!o.__zr&&(o=(n=this.findHover(n.x,n.y)).target);var a=this._hovered=i?new Wt(e,r):this.findHover(e,r),s=a.target,h=this.proxy;h.setCursor&&h.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Wt(0,0)},e.prototype.dispatch=function(t,e){var r=this[t];r&&r.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,r){var i=(t=t||{}).target;if(!i||!i.silent){for(var n="on"+e,o=function(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:Ht}}(e,t,r);i&&(i[n]&&(o.cancelBubble=!!i[n].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"==typeof t[n]&&t[n].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,r){for(var i=this.storage.getDisplayList(),n=new Wt(t,e),o=i.length-1;o>=0;o--){var a=void 0;if(i[o]!==r&&!i[o].ignore&&(a=jt(i[o],t,e))&&(!n.topTarget&&(n.topTarget=i[o]),a!==Ft)){n.target=i[o];break}}return n},e.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new Ot);var r=this._gestureMgr;"start"===e&&r.clear();var i=r.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&r.clear(),i){var n=i.type;t.gestureEvent=n;var o=new Wt;o.target=i.target,this.dispatchToElement(o,n,i.event)}},e}(wt);function jt(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var i=t,n=void 0,o=!1;i;){if(i.ignoreClip&&(o=!0),!o){var a=i.getClipPath();if(a&&!a.contain(e,r))return!1;i.silent&&(n=!0)}var s=i.__hostTarget;i=s||i.parent}return!n||Ft}return!1}function Gt(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}function Yt(){return[1,0,0,1,0,0]}function qt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Zt(t,e,r){var i=e[0]*r[0]+e[2]*r[1],n=e[1]*r[0]+e[3]*r[1],o=e[0]*r[2]+e[2]*r[3],a=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],h=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=h,t}function Kt(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Qt(t,e,r){var i=e[0],n=e[2],o=e[4],a=e[1],s=e[3],h=e[5],l=Math.sin(r),u=Math.cos(r);return t[0]=i*u+a*l,t[1]=-i*l+a*u,t[2]=n*u+s*l,t[3]=-n*l+u*s,t[4]=u*o+l*h,t[5]=u*h-l*o,t}function $t(t,e,r){var i=r[0],n=r[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function Jt(t,e){var r=e[0],i=e[2],n=e[4],o=e[1],a=e[3],s=e[5],h=r*a-o*i;return h?(h=1/h,t[0]=a*h,t[1]=-o*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*s-a*n)*h,t[5]=(o*n-r*s)*h,t):null}T(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){Xt.prototype[t]=function(e){var r,i,n=e.zrX,o=e.zrY,a=Gt(this,n,o);if("mouseup"===t&&a||(i=(r=this.findHover(n,o)).target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||ct(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(r,t,e)}}));var te=Object.freeze({__proto__:null,create:Yt,identity:qt,copy:Vt,mul:Zt,translate:Kt,rotate:Qt,scale:$t,invert:Jt,clone:function(t){var e=[1,0,0,1,0,0];return Vt(e,t),e}}),ee=qt,re=5e-5;function ie(t){return t>re||t<-5e-5}var ne=[],oe=[],ae=[1,0,0,1,0,0],se=Math.abs,he=function(){function t(){}var e;return t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return ie(this.rotation)||ie(this.x)||ie(this.y)||ie(this.scaleX-1)||ie(this.scaleY-1)},t.prototype.updateTransform=function(){var t=this.parent,e=t&&t.transform,r=this.needLocalTransform(),i=this.transform;r||e?(i=i||[1,0,0,1,0,0],r?this.getLocalTransform(i):ee(i),e&&(r?Zt(i,t.transform,i):Vt(i,t.transform)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&ee(i)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(ne);var r=ne[0]<0?-1:1,i=ne[1]<0?-1:1,n=((ne[0]-r)*e+r)/ne[0]||0,o=((ne[1]-i)*e+i)/ne[1]||0;t[0]*=n,t[1]*=n,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],Jt(this.invTransform,t)},t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3];ie(e-1)&&(e=Math.sqrt(e)),ie(r-1)&&(r=Math.sqrt(r)),t[0]<0&&(e=-e),t[3]<0&&(r=-r),this.rotation=Math.atan2(-t[1]/r,t[0]/e),e<0&&r<0&&(this.rotation+=Math.PI,e=-e,r=-r),this.x=t[4],this.y=t[5],this.scaleX=e,this.scaleY=r}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Zt(oe,t.invTransform,e),e=oe);var r=this.originX,i=this.originY;(r||i)&&(ae[4]=r,ae[5]=i,Zt(oe,e,ae),oe[4]-=r,oe[5]-=i,e=oe),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var r=[t,e],i=this.invTransform;return i&&vt(r,r,i),r},t.prototype.transformCoordToGlobal=function(t,e){var r=[t,e],i=this.transform;return i&&vt(r,r,i),r},t.prototype.getLineScale=function(){var t=this.transform;return t&&se(t[0]-1)>1e-10&&se(t[3]-1)>1e-10?Math.sqrt(se(t[0]*t[3]-t[2]*t[1])):1},t.getLocalTransform=function(t,e){ee(e=e||[]);var r=t.originX||0,i=t.originY||0,n=t.scaleX,o=t.scaleY,a=t.rotation||0,s=t.x,h=t.y;return e[4]-=r,e[5]-=i,e[0]*=n,e[1]*=o,e[2]*=n,e[3]*=o,e[4]*=n,e[5]*=o,a&&Qt(e,e,a),e[4]+=r,e[5]+=i,e[4]+=s,e[5]+=h,e},t.initDefaultProps=((e=t.prototype).x=0,e.y=0,e.scaleX=1,e.scaleY=1,e.originX=0,e.originY=0,e.rotation=0,void(e.globalScaleRatio=1)),t}(),le={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut: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)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,r=.1,i=.4;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=i*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut: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)},bounceIn:function(t){return 1-le.bounceOut(1-t)},bounceOut: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},bounceInOut:function(t){return t<.5?.5*le.bounceIn(2*t):.5*le.bounceOut(2*t-1)+.5}},ue=function(){function t(t){this._initialized=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart}return t.prototype.step=function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),!this._paused){var r=(t-this._startTime-this._pausedTime)/this._life;r<0&&(r=0),r=Math.min(r,1);var i=this.easing,n="string"==typeof i?le[i]:i,o="function"==typeof n?n(r):r;if(this.onframe&&this.onframe(o),1===r){if(!this.loop)return!0;this._restart(t),this.onrestart&&this.onrestart()}return!1}this._pausedTime+=e},t.prototype._restart=function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t}(),ce=function(t){this.value=t},pe=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new ce(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),fe=function(){function t(t){this._list=new pe,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var r=this._list,i=this._map,n=null;if(null==i[t]){var o=r.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=r.head;r.remove(s),delete i[s.key],n=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new ce(e),a.key=t,r.insertEntry(a),i[t]=a}return n},t.prototype.get=function(t){var e=this._map[t],r=this._list;if(null!=e)return e!==r.tail&&(r.remove(e),r.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),de={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ve(t){return(t=Math.round(t))<0?0:t>255?255:t}function ye(t){return t<0?0:t>1?1:t}function ge(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?ve(parseFloat(e)/100*255):ve(parseInt(e,10))}function _e(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?ye(parseFloat(e)/100):ye(parseFloat(e))}function me(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function xe(t,e,r){return t+(e-t)*r}function we(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function be(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Se=new fe(20),ke=null;function Te(t,e){ke&&be(ke,e),ke=Se.put(t,ke||e.slice())}function Ce(t,e){if(t){e=e||[];var r=Se.get(t);if(r)return be(e,r);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in de)return be(e,de[i]),Te(t,e),e;var n,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(n=parseInt(i.slice(1,4),16))>=0&&n<=4095?(we(e,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,5===o?parseInt(i.slice(4),16)/15:1),Te(t,e),e):void we(e,0,0,0,1):7===o||9===o?(n=parseInt(i.slice(1,7),16))>=0&&n<=16777215?(we(e,(16711680&n)>>16,(65280&n)>>8,255&n,9===o?parseInt(i.slice(7),16)/255:1),Te(t,e),e):void we(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var h=i.substr(0,a),l=i.substr(a+1,s-(a+1)).split(","),u=1;switch(h){case"rgba":if(4!==l.length)return 3===l.length?we(e,+l[0],+l[1],+l[2],1):we(e,0,0,0,1);u=_e(l.pop());case"rgb":return 3!==l.length?void we(e,0,0,0,1):(we(e,ge(l[0]),ge(l[1]),ge(l[2]),u),Te(t,e),e);case"hsla":return 4!==l.length?void we(e,0,0,0,1):(l[3]=_e(l[3]),Ae(l,e),Te(t,e),e);case"hsl":return 3!==l.length?void we(e,0,0,0,1):(Ae(l,e),Te(t,e),e);default:return}}we(e,0,0,0,1)}}function Ae(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=_e(t[1]),n=_e(t[2]),o=n<=.5?n*(i+1):n+i-n*i,a=2*n-o;return we(e=e||[],ve(255*me(a,o,r+1/3)),ve(255*me(a,o,r)),ve(255*me(a,o,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Pe(t){var e=Ce(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function De(t,e,r){if(e&&e.length&&t>=0&&t<=1){r=r||[];var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=e[n],s=e[o],h=i-n;return r[0]=ve(xe(a[0],s[0],h)),r[1]=ve(xe(a[1],s[1],h)),r[2]=ve(xe(a[2],s[2],h)),r[3]=ye(xe(a[3],s[3],h)),r}}var Me=De;function Le(t,e,r){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=Ce(e[n]),s=Ce(e[o]),h=i-n,l=ze([ve(xe(a[0],s[0],h)),ve(xe(a[1],s[1],h)),ve(xe(a[2],s[2],h)),ye(xe(a[3],s[3],h))],"rgba");return r?{color:l,leftIndex:n,rightIndex:o,value:i}:l}}var Re=Le;function ze(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}function Ie(t,e){var r=Ce(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Oe=Object.freeze({__proto__:null,parse:Ce,lift:function(t,e){var r=Ce(t);if(r){for(var i=0;i<3;i++)r[i]=e<0?r[i]*(1-e)|0:(255-r[i])*e+r[i]|0,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return ze(r,4===r.length?"rgba":"rgb")}},toHex:Pe,fastLerp:De,fastMapToColor:Me,lerp:Le,mapToColor:Re,modifyHSL:function(t,e,r,i){var n,o=Ce(t);if(t)return o=function(t){if(t){var e,r,i=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.min(i,n,o),s=Math.max(i,n,o),h=s-a,l=(s+a)/2;if(0===h)e=0,r=0;else{r=l<.5?h/(s+a):h/(2-s-a);var u=((s-i)/6+h/2)/h,c=((s-n)/6+h/2)/h,p=((s-o)/6+h/2)/h;i===s?e=p-c:n===s?e=1/3+u-p:o===s&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,r,l];return null!=t[3]&&f.push(t[3]),f}}(o),null!=e&&(o[0]=(n=e,(n=Math.round(n))<0?0:n>360?360:n)),null!=r&&(o[1]=_e(r)),null!=i&&(o[2]=_e(i)),ze(Ae(o),"rgba")},modifyAlpha:function(t,e){var r=Ce(t);if(r&&null!=e)return r[3]=ye(e),ze(r,"rgba")},stringify:ze,lum:Ie,random:function(){return"rgb("+Math.round(255*Math.random())+","+Math.round(255*Math.random())+","+Math.round(255*Math.random())+")"}}),Ee=Array.prototype.slice;function Be(t,e,r){return(e-t)*r+t}function Fe(t,e,r,i){for(var n=e.length,o=0;o<n;o++)t[o]=Be(e[o],r[o],i)}function He(t,e,r,i){for(var n=e.length,o=0;o<n;o++)t[o]=e[o]+r[o]*i;return t}function Ne(t,e,r,i){for(var n=e.length,o=n&&e[0].length,a=0;a<n;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=e[a][s]+r[a][s]*i}return t}function We(t,e,r){var i=t,n=e;if(i.push&&n.push){var o=i.length,a=n.length;if(o!==a)if(o>a)i.length=a;else for(var s=o;s<a;s++)i.push(1===r?n[s]:Ee.call(n[s]));var h=i[0]&&i[0].length;for(s=0;s<i.length;s++)if(1===r)isNaN(i[s])&&(i[s]=n[s]);else for(var l=0;l<h;l++)isNaN(i[s][l])&&(i[s][l]=n[s][l])}}function Ue(t,e){var r=t.length;if(r!==e.length)return!1;for(var i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}function Xe(t,e,r,i,n,o,a){var s=.5*(r-t),h=.5*(i-e);return(2*(e-r)+s+h)*a+(-3*(e-r)-2*s-h)*o+s*n+e}function je(t,e,r,i,n,o,a,s){for(var h=e.length,l=0;l<h;l++)t[l]=Xe(e[l],r[l],i[l],n[l],o,a,s)}function Ge(t){if(k(t)){var e=t.length;if(k(t[0])){for(var r=[],i=0;i<e;i++)r.push(Ee.call(t[i]));return r}return Ee.call(t)}return t}function Ye(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}var qe,Ve,Ze=[0,0,0,0],Ke=function(){function t(t){this.keyframes=[],this.maxTime=0,this.arrDim=0,this.interpolable=!0,this._needsSort=!1,this._isAllValueEqual=!0,this._lastFrame=0,this._lastFramePercent=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return!this._isAllValueEqual&&this.keyframes.length>=2&&this.interpolable},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e){t>=this.maxTime?this.maxTime=t:this._needsSort=!0;var r=this.keyframes,i=r.length;if(this.interpolable)if(k(e)){var n=function(t){return k(t&&t[0])?2:1}(e);if(i>0&&this.arrDim!==n)return void(this.interpolable=!1);if(1===n&&"number"!=typeof e[0]||2===n&&"number"!=typeof e[0][0])return void(this.interpolable=!1);if(i>0){var o=r[i-1];this._isAllValueEqual&&(1===n&&Ue(e,o.value)||(this._isAllValueEqual=!1))}this.arrDim=n}else{if(this.arrDim>0)return void(this.interpolable=!1);if("string"==typeof e){var a=Ce(e);a?(e=a,this.isValueColor=!0):this.interpolable=!1}else if("number"!=typeof e||isNaN(e))return void(this.interpolable=!1);this._isAllValueEqual&&i>0&&(o=r[i-1],(this.isValueColor&&!Ue(o.value,e)||o.value!==e)&&(this._isAllValueEqual=!1))}var s={time:t,value:e,percent:0};return this.keyframes.push(s),s},t.prototype.prepare=function(t){var e=this.keyframes;this._needsSort&&e.sort((function(t,e){return t.time-e.time}));for(var r=this.arrDim,i=e.length,n=e[i-1],o=0;o<i;o++)e[o].percent=e[o].time/this.maxTime,r>0&&o!==i-1&&We(e[o].value,n.value,r);if(t&&this.needsAnimate()&&t.needsAnimate()&&r===t.arrDim&&this.isValueColor===t.isValueColor&&!t._finished){this._additiveTrack=t;var a=e[0].value;for(o=0;o<i;o++)0===r?this.isValueColor?e[o].additiveValue=He([],e[o].value,a,-1):e[o].additiveValue=e[o].value-a:1===r?e[o].additiveValue=He([],e[o].value,a,-1):2===r&&(e[o].additiveValue=Ne([],e[o].value,a,-1))}},t.prototype.step=function(t,e){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var r,i=null!=this._additiveTrack,n=i?"additiveValue":"value",o=this.keyframes,a=this.keyframes.length,s=this.propName,h=this.arrDim,l=this.isValueColor;if(e<0)r=0;else if(e<this._lastFramePercent){for(r=Math.min(this._lastFrame+1,a-1);r>=0&&!(o[r].percent<=e);r--);r=Math.min(r,a-2)}else{for(r=this._lastFrame;r<a&&!(o[r].percent>e);r++);r=Math.min(r-1,a-2)}var u=o[r+1],c=o[r];if(c&&u){this._lastFrame=r,this._lastFramePercent=e;var p=u.percent-c.percent;if(0!==p){var f=(e-c.percent)/p,d=i?this._additiveValue:l?Ze:t[s];if((h>0||l)&&!d&&(d=this._additiveValue=[]),this.useSpline){var v=o[r][n],y=o[0===r?r:r-1][n],g=o[r>a-2?a-1:r+1][n],_=o[r>a-3?a-1:r+2][n];if(h>0)1===h?je(d,y,v,g,_,f,f*f,f*f*f):function(t,e,r,i,n,o,a,s){for(var h=e.length,l=e[0].length,u=0;u<h;u++){t[u]||(t[1]=[]);for(var c=0;c<l;c++)t[u][c]=Xe(e[u][c],r[u][c],i[u][c],n[u][c],o,a,s)}}(d,y,v,g,_,f,f*f,f*f*f);else if(l)je(d,y,v,g,_,f,f*f,f*f*f),i||(t[s]=Ye(d));else{var m=void 0;m=this.interpolable?Xe(y,v,g,_,f,f*f,f*f*f):g,i?this._additiveValue=m:t[s]=m}}else h>0?1===h?Fe(d,c[n],u[n],f):function(t,e,r,i){for(var n=e.length,o=n&&e[0].length,a=0;a<n;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=Be(e[a][s],r[a][s],i)}}(d,c[n],u[n],f):l?(Fe(d,c[n],u[n],f),i||(t[s]=Ye(d))):(m=void 0,m=this.interpolable?Be(c[n],u[n],f):function(t,e,r){return r>.5?e:t}(c[n],u[n],f),i?this._additiveValue=m:t[s]=m);i&&this._addToTarget(t)}}}},t.prototype._addToTarget=function(t){var e=this.arrDim,r=this.propName,i=this._additiveValue;0===e?this.isValueColor?(Ce(t[r],Ze),He(Ze,Ze,i,1),t[r]=Ye(Ze)):t[r]=t[r]+i:1===e?He(t[r],t[r],i,1):2===e&&Ne(t[r],t[r],i,1)},t}(),Qe=function(){function t(t,e,r){this._tracks={},this._trackKeys=[],this._delay=0,this._maxTime=0,this._paused=!1,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&r?y("Can' use additive animation on looped animation."):this._additiveAnimators=r}return t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(t){this._target=t},t.prototype.when=function(t,e){return this.whenWithKeys(t,e,P(e))},t.prototype.whenWithKeys=function(t,e,r){for(var i=this._tracks,n=0;n<r.length;n++){var o=r[n],a=i[o];if(!a){a=i[o]=new Ke(o);var s=void 0,h=this._getAdditiveTrack(o);if(h){var l=h.keyframes[h.keyframes.length-1];s=l&&l.value,h.isValueColor&&s&&(s=Ye(s))}else s=this._target[o];if(null==s)continue;0!==t&&a.addKeyframe(0,Ge(s)),this._trackKeys.push(o)}a.addKeyframe(t,Ge(e[o]))}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneList;if(t)for(var e=t.length,r=0;r<e;r++)t[r].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var t=this.animation,e=this._abortedList;if(t&&t.removeClip(this._clip),this._clip=null,e)for(var r=0;r<e.length;r++)e[r].call(this)},t.prototype._setTracksFinished=function(){for(var t=this._tracks,e=this._trackKeys,r=0;r<e.length;r++)t[e[r]].setFinished()},t.prototype._getAdditiveTrack=function(t){var e,r=this._additiveAnimators;if(r)for(var i=0;i<r.length;i++){var n=r[i].getTrack(t);n&&(e=n)}return e},t.prototype.start=function(t,e){if(!(this._started>0)){this._started=1;for(var r=this,i=[],n=0;n<this._trackKeys.length;n++){var o=this._trackKeys[n],a=this._tracks[o],s=this._getAdditiveTrack(o),h=a.keyframes;if(a.prepare(s),a.needsAnimate())i.push(a);else if(!a.interpolable){var l=h[h.length-1];l&&(r._target[a.propName]=l.value)}}if(i.length||e){var u=new ue({life:this._maxTime,loop:this._loop,delay:this._delay,onframe:function(t){r._started=2;var e=r._additiveAnimators;if(e){for(var n=!1,o=0;o<e.length;o++)if(e[o]._clip){n=!0;break}n||(r._additiveAnimators=null)}for(o=0;o<i.length;o++)i[o].step(r._target,t);var a=r._onframeList;if(a)for(o=0;o<a.length;o++)a[o](r._target,t)},ondestroy:function(){r._doneCallback()}});this._clip=u,this.animation&&this.animation.addClip(u),t&&"spline"!==t&&(u.easing=t)}else this._doneCallback();return this}},t.prototype.stop=function(t){if(this._clip){var e=this._clip;t&&e.onframe(1),this._abortedCallback()}},t.prototype.delay=function(t){return this._delay=t,this},t.prototype.during=function(t){return t&&(this._onframeList||(this._onframeList=[]),this._onframeList.push(t)),this},t.prototype.done=function(t){return t&&(this._doneList||(this._doneList=[]),this._doneList.push(t)),this},t.prototype.aborted=function(t){return t&&(this._abortedList||(this._abortedList=[]),this._abortedList.push(t)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(t){return this._tracks[t]},t.prototype.stopTracks=function(t,e){if(!t.length||!this._clip)return!0;for(var r=this._tracks,i=this._trackKeys,n=0;n<t.length;n++){var o=r[t[n]];o&&(e?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}var a=!0;for(n=0;n<i.length;n++)if(!r[i[n]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},t.prototype.saveFinalToTarget=function(t,e){if(t){e=e||this._trackKeys;for(var r=0;r<e.length;r++){var i=e[r],n=this._tracks[i];if(n&&!n.isFinished()){var o=n.keyframes,a=o[o.length-1];if(a){var s=Ge(a.value);n.isValueColor&&(s=Ye(s)),t[i]=s}}}}},t.prototype.__changeFinalValue=function(t,e){e=e||P(t);for(var r=0;r<e.length;r++){var i=e[r],n=this._tracks[i];if(n){var o=n.keyframes;if(o.length>1){var a=o.pop();n.addKeyframe(a.time,t[i]),n.prepare(n.getAdditiveTrack())}}}},t}(),$e=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,r=this.y;return this.x=t[0]*e+t[2]*r+t[4],this.y=t[1]*e+t[3]*r+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,r){t.x=e,t.y=r},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,r){t.x=e.x+r.x,t.y=e.y+r.y},t.sub=function(t,e,r){t.x=e.x-r.x,t.y=e.y-r.y},t.scale=function(t,e,r){t.x=e.x*r,t.y=e.y*r},t.scaleAndAdd=function(t,e,r,i){t.x=e.x+r.x*i,t.y=e.y+r.y*i},t.lerp=function(t,e,r,i){var n=1-i;t.x=n*e.x+i*r.x,t.y=n*e.y+i*r.y},t}(),Je=Math.min,tr=Math.max,er=new $e,rr=new $e,ir=new $e,nr=new $e,or=new $e,ar=new $e,sr=function(){function t(t,e,r,i){r<0&&isFinite(r)&&(t+=r,r=-r),i<0&&isFinite(i)&&(e+=i,i=-i),this.x=t,this.y=e,this.width=r,this.height=i}return t.prototype.union=function(t){var e=Je(t.x,this.x),r=Je(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=tr(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=tr(t.y+t.height,this.y+this.height)-r:this.height=t.height,this.x=e,this.y=r},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,r=t.width/e.width,i=t.height/e.height,n=[1,0,0,1,0,0];return Kt(n,n,[-e.x,-e.y]),$t(n,n,[r,i]),Kt(n,n,[t.x,t.y]),n},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,n=i.x,o=i.x+i.width,a=i.y,s=i.y+i.height,h=e.x,l=e.x+e.width,u=e.y,c=e.y+e.height,p=!(o<h||l<n||s<u||c<a);if(r){var f=1/0,d=0,v=Math.abs(o-h),y=Math.abs(l-n),g=Math.abs(s-u),_=Math.abs(c-a),m=Math.min(v,y),x=Math.min(g,_);o<h||l<n?m>d&&(d=m,v<y?$e.set(ar,-v,0):$e.set(ar,y,0)):m<f&&(f=m,v<y?$e.set(or,v,0):$e.set(or,-y,0)),s<u||c<a?x>d&&(d=x,g<_?$e.set(ar,0,-g):$e.set(ar,0,_)):m<f&&(f=m,g<_?$e.set(or,0,g):$e.set(or,0,-_))}return r&&$e.copy(r,p?or:ar),p},t.prototype.contain=function(t,e){var r=this;return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&is