UNPKG

220 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).F2={})}(this,(function(t){"use strict";function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var r=n((function(t){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports})),i=e(r),a=n((function(t){function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}t.exports=function(t){for(var n=1;arguments.length>n;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t},t.exports.__esModule=!0,t.exports.default=t.exports})),o=e(a),u=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},s=function(t,e){if(!u(t))return t;for(var n=[],r=0;t.length>r;r++){var i=t[r];e(i,r)&&n.push(i)}return n},l={}.toString,c=function(t,e){return l.call(t)==="[object "+e+"]"},h=function(t){return c(t,"Function")},f=function(t){return null==t},p=function(t){return Array.isArray?Array.isArray(t):c(t,"Array")},d=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function y(t,e){if(t)if(p(t))for(var n=0,r=t.length;r>n&&!1!==e(t[n],n);n++);else if(d(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var v=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return y(t,(function(n,r){h(t)&&"prototype"===r||e.push(r)})),e};var g=function(t){if(!function(t){return"object"==typeof t&&null!==t}(t)||!c(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function m(t,e){if(!p(t))return null;var n;if(h(e)&&(n=e),g(e)&&(n=function(t){return function(t,e){var n=v(e),r=n.length;if(f(t))return!r;for(var i=0;r>i;i+=1){var a=n[i];if(e[a]!==t[a]||!(a in t))return!1}return!0}(t,e)}),n)for(var r=0;t.length>r;r+=1)if(n(t[r]))return t[r];return null}var x=function(t){if(!p(t))return[];for(var e=[],n=0;t.length>n;n++)e=e.concat(t[n]);return e},k=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(p(t[0])){for(var n=[],r=0;t.length>r;r++)n=n.concat(t[r]);e=n}var i=function(t){if(p(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])}(e);return{min:function(t){if(p(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])}(e),max:i}},w=function(t){return c(t,"String")},b=function(t,e){for(var n=[],r={},i=0;t.length>i;i++){var a=t[i][e];if(!f(a)){p(a)||(a=[a]);for(var o=0;a.length>o;o++){var u=a[o];r[u]||(n.push(u),r[u]=!0)}}}return n};function M(t){if(u(t))return t[0]}function _(t){if(u(t)){return t[t.length-1]}}var S=Object.prototype.hasOwnProperty;function P(t,e){if(!e||!p(t))return{};for(var n,r={},i=h(e)?e:function(t){return t[e]},a=0;t.length>a;a++){var o=t[a];n=i(o),S.call(r,n)?r[n].push(o):r[n]=[o]}return r}function O(t,e){if(!e)return{0:t};if(!h(e)){var n=p(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;i>r;r++)e+=t[n[r]]&&""+t[n[r]];return e}}return P(t,e)}var C=function(t,e){var n=""+e,r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},A=function(t){return c(t,"Number")};var T=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return y(t,(function(n,r){h(t)&&"prototype"===r||e.push(n)})),e};var D=function(t){var e=function(t){return f(t)?"":""+t}(t);return e.charAt(0).toUpperCase()+e.substring(1)},E={}.toString,j=function(t){return c(t,"Boolean")},Y=function(t){return c(t,"Date")},I=Object.prototype,N=function(t){return void 0===t};function L(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function R(t,e,n,r){return e&&L(t,e),n&&L(t,n),r&&L(t,r),t}var F=function(t){if("object"!=typeof t||null===t)return t;var e;if(p(t)){e=[];for(var n=0,r=t.length;r>n;n++)e[n]="object"==typeof t[n]&&null!=t[n]?F(t[n]):t[n]}else for(var i in e={},t)e[i]="object"==typeof t[i]&&null!=t[i]?F(t[i]):t[i];return e};function B(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var a=e[i];null!==a&&g(a)?(g(t[i])||(t[i]={}),r>n?B(t[i],a,n+1,r):t[i]=e[i]):p(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var X=function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];for(var r=0;e.length>r;r+=1)B(t,e[r]);return t},z=function(t,e){if(!u(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;t.length>i;i++)if(t[i]===e){r=i;break}return r},W=Object.prototype.hasOwnProperty;function H(t){if(f(t))return!0;if(u(t))return!t.length;var e=function(t){return E.call(t).replace(/^\[object /,"").replace(/]$/,"")}(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||I)}(t))return!Object.keys(t).length;for(var n in t)if(W.call(t,n))return!1;return!0}var V=function(t,e){if(!u(t))return t;for(var n=[],r=0;t.length>r;r++){n.push(e(t[r],r))}return n},G=function(t){return t},q=function(t,e,n){for(var r=0,i=w(e)?e.split("."):e;t&&i.length>r;)t=t[i[r++]];return void 0===t||i.length>r?n:t},U=Object.prototype.hasOwnProperty,Z=function(t,e){return function(t,e,n){if(!p(t)&&!g(t))return t;var r=n;return y(t,(function(t,n){r=e(r,t,n)})),r}(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})};function $(t){return f(t)?0:u(t)?t.length:Object.keys(t).length}var J=function(t,e){return J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},J(t,e)};function K(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function n(){this.constructor=t}J(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Q,tt=function(){return tt=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},tt.apply(this,arguments)};function et(){for(var t=0,e=0,n=arguments.length;n>e;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;n>e;e++)for(var a=arguments[e],o=0,u=a.length;u>o;o++,i++)r[i]=a[o];return r}!function(t,e){if(!h(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var a=e?e.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var u=t.apply(this,r);return o.set(a,u),u};n.cache=new Map}((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return Q||(Q=document.createElement("canvas").getContext("2d")),Q.font=[a,o,i,n+"px",r].join(" "),Q.measureText(w(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),et([t],T(e)).join("")}));var nt=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}();function rt(t,e,n){t&&e?p(t)||p(e)?function(t,e,n){for(var r={},i=t.length,a=e.length,o=0,u=a;u>o;o++){var s=e[o];s&&!f(s.key)&&(r[s.key]=s)}for(var l=0,c=Math.max(i,a);c>l;l++){var h=t[l];if(h){var p=h.key;if(f(h.key))rt(h,e[l],n);else{var d=r[p];d&&delete r[p],rt(h,d,n)}}else rt(h,e[l],n)}Object.keys(r).forEach((function(t){rt(null,r[t],n)}))}(p(t)?t:[t],p(e)?e:[e],n):n(t,e):n(t,e)}var it={cloneElement:function(t,e){return t?o(o({},t),{},{props:o(o({},t.props),e)}):t},map:function t(e,n){return e&&p(e)?e.map((function(e){return t(e,n)})):n(e)},toArray:function t(e){if(!e)return e;if(!p(e))return[e];for(var n=[],r=0,i=e.length;i>r;r++){var a=e[r];p(a)?n=n.concat(t(a)):n.push(a)}return n},compare:rt},at=e(n((function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports}))),ot=n((function(t){function e(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports})),ut=e(ot),st=function(){function t(e,n,r){at(this,t),this.destroyed=!1,this.props=e,this.state={},this.context=n,this.updater=r}return ut(t,[{key:"willMount",value:function(){}},{key:"didMount",value:function(){}},{key:"willReceiveProps",value:function(t,e){}},{key:"willUpdate",value:function(){}},{key:"didUpdate",value:function(){}},{key:"render",value:function(){return null}},{key:"didUnmount",value:function(){}},{key:"setState",value:function(t,e){this.updater.enqueueSetState(this,t,e)}},{key:"forceUpdate",value:function(t){this.updater.enqueueForceUpdate(this,{},t)}},{key:"setAnimate",value:function(t){this.animate=t}},{key:"destroy",value:function(){this.destroyed=!0}}]),t}();st.prototype.isF2Component=!0;var lt=n((function(t){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports})),ct=e(lt),ht=n((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),ft=e(n((function(t){t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ht(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports}))),pt=n((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),dt=e(pt),yt=n((function(t){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports})),vt=n((function(t){function e(n){return t.exports=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},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),gt=e(vt),mt=n((function(t){var e=vt.default;t.exports=function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return lt(t)},t.exports.__esModule=!0,t.exports.default=t.exports})),xt=e(mt),kt=n((function(t){t.exports=function(t){var e=yt();return function(){var n,r=pt(t);if(e){var i=pt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return mt(this,n)}},t.exports.__esModule=!0,t.exports.default=t.exports})),wt=e(kt),bt=function(t){ft(n,t);var e=wt(n);function n(t){var r;at(this,n),(r=e.call(this,t)).next=function(){var t=ct(r),e=t.state,n=e.index,i=e.count,a=t.props.loop?(n+1)%i:n+1;i>a&&setTimeout((function(){r.setState({index:a})}),e.delay||0)};var i=t.delay,a=t.start,o=void 0===a?0:a,u=it.toArray(t.children).length;return r.state={delay:i,count:u,index:o},r}return ut(n,[{key:"didMount",value:function(){this.context.root.on("animationEnd",this.next)}},{key:"didUnmount",value:function(){this.context.root.off("animationEnd",this.next)}},{key:"render",value:function(){var t=this.state.index;return it.toArray(this.props.children)[t]}}]),n}(st),Mt={generateDefault:function(){return[1,0,0,1,0,0]},isChanged:function(t){return 1!==t[0]||0!==t[1]||0!==t[2]||1!==t[3]||0!==t[4]||0!==t[5]},multiply:function(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]},scale:function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[0],t[2]=e[2]*n[1],t[3]=e[3]*n[1],t[4]=e[4],t[5]=e[5],t},rotate:function(t,e,n){var r=Math.cos(n),i=Math.sin(n),a=e[1]*r+e[3]*i,o=e[0]*-i+e[2]*r,u=e[1]*-i+e[3]*r;return t[0]=e[0]*r+e[2]*i,t[1]=a,t[2]=o,t[3]=u,t[4]=e[4],t[5]=e[5],t},translate:function(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+e[0]*n[0]+e[2]*n[1],t[5]=e[5]+e[1]*n[0]+e[3]*n[1],t},transform:function(t,e){for(var n=[].concat(t),r=0,i=e.length;i>r;r++){var a=e[r];switch(a[0]){case"t":Mt.translate(n,n,[a[1],a[2]]);break;case"s":Mt.scale(n,n,[a[1],a[2]]);break;case"r":Mt.rotate(n,n,a[1])}}return n}},_t={create:function(){return[0,0]},length:function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},normalize:function(t,e){var n=this.length(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},sub:function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},scale:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},direction:function(t,e){return t[0]*e[1]-e[0]*t[1]},angle:function(t,e){var n=this.dot(t,e)/(this.length(t)*this.length(e));return Math.acos(n)},angleTo:function(t,e,n){var r=this.angle(t,e),i=this.direction(t,e)>=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r},zero:function(t){return 0===t[0]&&0===t[1]},distance:function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)},clone:function(t){return[t[0],t[1]]},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},transformMat2d:function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}};function St(t){return[t.x,t.y]}function Pt(t,e,n){for(var r,i,a,o=!!e,u=function(t,e,n,r){var i,a,o,u,s,l,c,h,f=[],p=!!r;if(p){for(o=[1/0,1/0],u=[-1/0,-1/0],h=0,c=t.length;c>h;h++)s=St(t[h]),_t.min(o,o,s),_t.max(u,u,s);_t.min(o,o,r[0]),_t.max(u,u,r[1])}for(h=0,l=t.length;l>h;h++){if(s=St(t[h]),n)i=St(t[h?h-1:l-1]),a=St(t[(h+1)%l]);else{if(0===h||h===l-1){f.push([s[0],s[1]]);continue}i=St(t[h-1]),a=St(t[h+1])}var d=_t.sub([],a,i);_t.scale(d,d,e);var y=_t.distance(s,i),v=_t.distance(s,a),g=y+v;0!==g&&(y/=g,v/=g);var m=_t.scale([],d,-y),x=_t.scale([],d,v),k=_t.add([],s,m),w=_t.add([],s,x);p&&(_t.max(k,k,o),_t.min(k,k,u),_t.max(w,w,o),_t.min(w,w,u)),f.push([k[0],k[1]]),f.push([w[0],w[1]])}return n&&f.push(f.shift()),f}(t,.4,o,n),s=t.length,l=[],c=0;s-1>c;c++)l.push(["C",(r=u[2*c])[0],r[1],(i=u[2*c+1])[0],i[1],(a=t[c+1]).x,a.y]);return o&&l.push(["C",(r=u[s])[0],r[1],(i=u[s+1])[0],i[1],(a=t[0]).x,a.y]),l}var Ot=_t.create(),Ct=_t.create(),At=_t.create();function Tt(t,e,n,r,i){var a=t*t;return e+(3*-e+t*(3*e-e*t))*t+(3*n+t*(-6*n+3*n*t))*t+(3*r-3*r*t)*a+i*(a*t)}function Dt(t){for(var e,n,r,i,a,o=1/0,u=-1/0,s=1/0,l=-1/0,c={x:t[0],y:t[1]},h={x:t[2],y:t[3]},f={x:t[4],y:t[5]},p={x:t[6],y:t[7]},d=0;100>d;d++){var y={x:Tt(a=d/100,(e=c).x,(n=h).x,(r=f).x,(i=p).x),y:Tt(a,e.y,n.y,r.y,i.y)};o>y.x&&(o=y.x),y.x>u&&(u=y.x),s>y.y&&(s=y.y),y.y>l&&(l=y.y)}return{minX:o,minY:s,maxX:u,maxY:l}}function Et(t,e){if(0!==t.length){for(var n=t[0],r=n.x,i=n.x,a=n.y,o=n.y,u=t.length,s=1;u>s;s++)r=Math.min(r,(n=t[s]).x),i=Math.max(i,n.x),a=Math.min(a,n.y),o=Math.max(o,n.y);return{minX:r-(e=e/2||0),minY:a-e,maxX:i+e,maxY:o+e}}}function jt(t,e,n,r,i,a){var o=Math.abs(r-i);if(1e-4>o%(2*Math.PI)&&o>1e-4)return{minX:t-n,minY:e-n,maxX:t+n,maxY:e+n};Ot[0]=Math.cos(r)*n+t,Ot[1]=Math.sin(r)*n+e,Ct[0]=Math.cos(i)*n+t,Ct[1]=Math.sin(i)*n+e;var u=[0,0],s=[0,0];if(_t.min(u,Ot,Ct),_t.max(s,Ot,Ct),0>(r%=2*Math.PI)&&(r+=2*Math.PI),0>(i%=2*Math.PI)&&(i+=2*Math.PI),r>i&&!a?i+=2*Math.PI:i>r&&a&&(r+=2*Math.PI),a){var l=i;i=r,r=l}for(var c=0;i>c;c+=Math.PI/2)c>r&&(At[0]=Math.cos(c)*n+t,At[1]=Math.sin(c)*n+e,_t.min(u,At,u),_t.max(s,At,s));return{minX:u[0],minY:u[1],maxX:s[0],maxY:s[1]}}function Yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function It(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Nt(t,e,n){return e&&It(t.prototype,e),n&&It(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lt(t,e){return Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lt(t,e)}function Rt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lt(t,e)}function Ft(t){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ft(t)}function Bt(t){return Bt="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},Bt(t)}function Xt(t,e){if(e&&("object"===Bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function zt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ft(t);if(e){var i=Ft(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Xt(this,n)}}var Wt=function(){function t(){Yt(this,t),this.__events={}}return Nt(t,[{key:"on",value:function(t,e){if(t&&e){var n=this.__events[t]||[];n.push(e),this.__events[t]=n}}},{key:"emit",value:function(t,e){var n=this;if(d(t)&&(t=(e=t)&&e.type),t){var r=this.__events[t];r&&r.length&&r.forEach((function(t){t.call(n,e)}))}}},{key:"off",value:function(t,e){var n=this.__events,r=n[t];if(r&&r.length)if(e)for(var i=0,a=r.length;a>i;i++)r[i]===e&&(r.splice(i,1),i--);else delete n[t]}}]),t}();(function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}})(),"object"===("undefined"==typeof wx?"undefined":Bt(wx))&&wx,"object"===("undefined"==typeof my?"undefined":Bt(my))&&my,("undefined"==typeof global?"undefined":Bt(global))&&("undefined"==typeof window||Bt(window));function Ht(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function Vt(t,e){var n=e.get("el");if(!n)return t;var r=n.getBoundingClientRect(),i=r.top,a=r.left,o=parseFloat(Ht(n,"padding-left")),u=parseFloat(Ht(n,"padding-top"));return{x:t.x-a-o,y:t.y-i-u}}function Gt(t,e){var n=e.get("landscape");if(!n)return t;if(h(n))return n(t,e);var r=e.get("height");return{x:t.y,y:r-t.x}}var qt=function(t,e){var n=t.touches;if(!n)return[Gt(Vt({x:t.clientX,y:t.clientY},e),e)];n.length||(n=t.changedTouches||[]);for(var r=[],i=0,a=n.length;a>i;i++){var o=n[i],u=o.x,s=o.y,l=o.clientX,c=o.clientY,h=void 0;h=A(u)||A(s)?{x:u,y:s}:Vt({x:l,y:c},e),r.push(Gt(h,e))}return r},Ut=function(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.abs(n)>Math.abs(r)?n>0?"right":"left":r>0?"down":"up"},Zt=function(t,e){var n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return Math.sqrt(n*n+r*r)},$t=function(){function t(e){var n=this,r=e.canvas,i=e.el;Yt(this,t),this._click=function(t){var e=qt(t,n.canvas);t.points=e,n.emitEvent("click",t)},this._start=function(t){var e,r,i=qt(t,n.canvas);i&&(t.points=i,n.emitEvent("touchstart",t),n.reset(),n.startTime=Date.now(),n.startPoints=i,i.length>1?(n.startDistance=Zt(i[0],i[1]),n.center={x:(e=i[0]).x+((r=i[1]).x-e.x)/2,y:e.y+(r.y-e.y)/2}):n.pressTimeout=setTimeout((function(){var e="press",r="none";t.direction=r,n.emitStart(e,t),n.emitEvent(e,t),n.eventType=e,n.direction=r}),250))},this._move=function(t){var e=qt(t,n.canvas);if(e){n.clearPressTimeout(),t.points=e,n.emitEvent("touchmove",t);var r=n.startPoints;if(r)if(e.length>1){var i=n.startDistance,a=Zt(e[0],e[1]);t.zoom=a/i,t.center=n.center,n.emitStart("pinch",t),n.emitEvent("pinch",t)}else{var o=e[0].x-r[0].x,u=e[0].y-r[0].y,s=n.direction||Ut(r[0],e[0]);n.direction=s;var l=n.getEventType(e);t.direction=s,t.deltaX=o,t.deltaY=u,n.emitStart(l,t),n.emitEvent(l,t);var c=n.lastMoveTime,h=Date.now();h-c>0&&(n.prevMoveTime=c,n.prevMovePoints=n.lastMovePoints,n.lastMoveTime=h,n.lastMovePoints=e)}}},this._end=function(t){var e=qt(t,n.canvas);t.points=e,n.emitEnd(t),n.emitEvent("touchend",t);var r=n.lastMoveTime;if(100>Date.now()-r){var i=r-(n.prevMoveTime||n.startTime);if(i>0){var a=n.prevMovePoints||n.startPoints,o=n.lastMovePoints,u=Zt(a[0],o[0])/i;u>.3&&(t.velocity=u,t.direction=Ut(a[0],o[0]),t.velocityX=(o[0].x-a[0].x)/i,t.velocityY=(o[0].y-a[0].y)/i,n.emitEvent("swipe",t))}}n.reset();var s=t.touches;s&&s.length>0&&n._start(t)},this._cancel=function(t){n.emitEvent("touchcancel",t),n.reset()},this.canvas=r,this.delegateEvent(i),this.processEvent={}}return Nt(t,[{key:"delegateEvent",value:function(t){t.addEventListener("click",this._click),t.addEventListener("touchstart",this._start),t.addEventListener("touchmove",this._move),t.addEventListener("touchend",this._end),t.addEventListener("touchcancel",this._cancel)}},{key:"emitEvent",value:function(t,e){this.canvas.emit(t,e)}},{key:"getEventType",value:function(t){var e,n=this.eventType,r=this.startTime,i=this.startPoints;if(n)return n;var a=this.canvas.__events.pan;a&&a.length?e=Date.now()-r>250&&10>Zt(i[0],t[0])?"press":"pan":e="press";return this.eventType=e,e}},{key:"enable",value:function(t){this.processEvent[t]=!0}},{key:"isProcess",value:function(t){return this.processEvent[t]}},{key:"emitStart",value:function(t,e){this.isProcess(t)||(this.enable(t),this.emitEvent("".concat(t,"start"),e))}},{key:"emitEnd",value:function(t){var e=this,n=this.processEvent;Object.keys(n).forEach((function(r){e.emitEvent("".concat(r,"end"),t),delete n[r]}))}},{key:"clearPressTimeout",value:function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}},{key:"reset",value:function(){this.clearPressTimeout(),this.startTime=0,this.startPoints=null,this.startDistance=0,this.direction=null,this.eventType=null,this.pinch=!1,this.prevMoveTime=0,this.prevMovePoints=null,this.lastMoveTime=0,this.lastMovePoints=null}}]),t}(),Jt=function(t){Rt(n,t);var e=zt(n);function n(t){var r;Yt(this,n),(r=e.call(this)).context=t;var i=t.canvas||{};return r.width=i.width||0,r.height=i.height||0,r.style={},r.currentStyle={},r.attrs={},r.isCanvasElement=!0,r}return Nt(n,[{key:"getContext",value:function(){return this.context}},{key:"getBoundingClientRect",value:function(){return{top:0,right:this.width,bottom:this.height,left:0}}},{key:"setAttribute",value:function(t,e){this.attrs[t]=e}},{key:"addEventListener",value:function(t,e){this.on(t,e)}},{key:"removeEventListener",value:function(t,e){this.off(t,e)}},{key:"dispatchEvent",value:function(t,e){this.emit(t,e)}}]),n}(Wt);var Kt=function(t){return t?function(t){if(!t)return!1;if(1!==t.nodeType||!t.nodeName||"canvas"!==t.nodeName.toLowerCase())return!1;var e=!1;try{t.addEventListener("eventTest",(function(){e=!0})),t.dispatchEvent(new Event("eventTest"))}catch(t){e=!1}return e}(t.canvas)?t.canvas:new Jt(t):null};function Qt(t,e){if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}}function te(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ee(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ne(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ee(Object(n),!0).forEach((function(e){te(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function re(t,e){y(t,(function(t){t=t.split(":"),e.addColorStop(Number(t[0]),t[1])}))}function ie(t,e,n){if("("===t[1])try{var r=t[0];if("l"===r)return function(t,e,n){var r,i=t.split(" "),a=i[0].slice(2,i[0].length-1);a=(parseFloat(a)*Math.PI/180%(r=2*Math.PI)+r)%r;var o,u,s=i.slice(1),l=e.getBBox(),c=l.minX,h=l.minY,f=l.maxX,p=l.maxY;a>=0&&.5*Math.PI>a?(o={x:c,y:h},u={x:f,y:p}):a>=.5*Math.PI&&Math.PI>a?(o={x:f,y:h},u={x:c,y:p}):a>=Math.PI&&1.5*Math.PI>a?(o={x:f,y:p},u={x:c,y:h}):(o={x:c,y:p},u={x:f,y:h});var d=Math.tan(a),y=d*d,v=n.createLinearGradient(o.x,o.y,(u.x-o.x+d*(u.y-o.y))/(y+1)+o.x,d*(u.x-o.x+d*(u.y-o.y))/(y+1)+o.y);return re(s,v),v}(t,e,n);if("r"===r)return function(t,e,n){var r=t.split(" "),i=r[0].slice(2,r[0].length-1);i=i.split(",");var a=parseFloat(i[0]),o=parseFloat(i[1]),u=parseFloat(i[2]),s=r.slice(1);if(0===u)return s[s.length-1].split(":")[1];var l=e.getBBox(),c=l.width,h=l.height,f=l.minX,p=l.minY,d=Math.sqrt(c*c+h*h)/2,y=n.createRadialGradient(f+c*a,p+h*o,u*d,f+c/2,p+h/2,d);return re(s,y),y}(t,e,n)}catch(t){console.error("error in parsing gradient string, please check if there are any extra whitespaces."),console.error(t)}return t}var ae={stroke:"strokeStyle",fill:"fillStyle",opacity:"globalAlpha"},oe=["fillStyle","font","globalAlpha","lineCap","lineWidth","lineJoin","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","lineDash","shadow"],ue=["circle","sector","polygon","rect","polyline","custom"],se=function(){function t(e){Yt(this,t),this._initProperties(),R(this._attrs,e);var n=this._attrs.attrs;n&&this.initAttrs(n),this.initTransform()}return Nt(t,[{key:"_initProperties",value:function(){this._attrs=ne(ne({},this._attrs),{},{zIndex:0,visible:!0,destroyed:!1})}},{key:"get",value:function(t){return this._attrs[t]}},{key:"set",value:function(t,e){this._attrs[t]=e}},{key:"isGroup",value:function(){return this.get("isGroup")}},{key:"isShape",value:function(){return this.get("isShape")}},{key:"initAttrs",value:function(t){this.attr(R(this.getDefaultAttrs(),t))}},{key:"getDefaultAttrs",value:function(){return{}}},{key:"_setAttr",value:function(t,e){var n=this._attrs.attrs;if("clip"===t)e=this._setAttrClip(e);else{var r=ae[t];r&&(n[r]=e)}n[t]=e}},{key:"_getAttr",value:function(t){var e,n;return null===(e=this._attrs)||void 0===e||null===(n=e.attrs)||void 0===n?void 0:n[t]}},{key:"_afterAttrsSet",value:function(){}},{key:"_setAttrClip",value:function(t){return t&&ue.indexOf(t._attrs.type)>-1?(null===t.get("canvas")&&(t=ne({},t)),t.set("parent",this.get("parent")),t.set("context",this.get("context")),t):null}},{key:"attr",value:function(t,e){if(this.get("destroyed"))return null;var n=arguments.length;if(0===n)return this._attrs.attrs;if(d(t)){for(var r in this._attrs.bbox=null,t)this._setAttr(r,t[r]);return this._afterAttrsSet&&this._afterAttrsSet(),this}return 2===n?(this._attrs.bbox=null,this._setAttr(t,e),this._afterAttrsSet&&this._afterAttrsSet(),this):this._getAttr(t)}},{key:"getParent",value:function(){return this.get("parent")}},{key:"draw",value:function(t){this.get("destroyed")||this.get("visible")&&(this.setContext(t),this.drawInner(t),this.restoreContext(t))}},{key:"setContext",value:function(t){var e=this._attrs.attrs.clip;t.save(),e&&!e._attrs.destroyed&&(e.resetTransform(t),e.createPath(t),t.clip()),this.resetContext(t),this.resetTransform(t)}},{key:"restoreContext",value:function(t){t.restore()}},{key:"resetContext",value:function(t){var e=this._attrs.attrs;for(var n in e)if(oe.indexOf(n)>-1){var r=e[n];"fillStyle"!==n&&"strokeStyle"!==n||!r||(r=ie(r,this,t)),"lineDash"===n&&t.setLineDash&&p(r)?t.setLineDash(r):t[n]=r}}},{key:"hasFill",value:function(){return this.get("canFill")&&this._attrs.attrs.fillStyle}},{key:"hasStroke",value:function(){return this.get("canStroke")&&this._attrs.attrs.strokeStyle}},{key:"drawInner",value:function(t){}},{key:"show",value:function(){return this.set("visible",!0),this}},{key:"hide",value:function(){return this.set("visible",!1),this}},{key:"isVisible",value:function(){return this.get("visible")}},{key:"getAriaLabel",value:function(){var t=this._attrs;if(!t.destroyed&&t.visible&&(!t.isShape||t.aria))return this._getAriaLabel()}},{key:"_getAriaLabel",value:function(){return this._attrs.ariaLabel}},{key:"_removeFromParent",value:function(){var t=this.get("parent");t&&Qt(t.get("children"),this);return this}},{key:"remove",value:function(t){t?this.destroy():this._removeFromParent()}},{key:"destroy",value:function(){if(this.get("destroyed"))return null;this._removeFromParent(),this._attrs={},this.set("destroyed",!0)}},{key:"getBBox",value:function(){return{minX:0,maxX:0,minY:0,maxY:0,width:0,height:0}}},{key:"initTransform",value:function(){var t=this._attrs.attrs;t||(t={}),t.matrix||(t.matrix=[1,0,0,1,0,0]),this._attrs.attrs=t}},{key:"getMatrix",value:function(){return this._attrs.attrs.matrix}},{key:"setMatrix",value:function(t){this._attrs.attrs.matrix=[t[0],t[1],t[2],t[3],t[4],t[5]]}},{key:"transform",value:function(t){return this._attrs.attrs.matrix=Mt.transform(this._attrs.attrs.matrix,t),this}},{key:"setTransform",value:function(t){return this._attrs.attrs.matrix=[1,0,0,1,0,0],this.transform(t)}},{key:"translate",value:function(t,e){var n=this._attrs.attrs.matrix;Mt.translate(n,n,[t,e])}},{key:"rotate",value:function(t){var e=this._attrs.attrs.matrix;Mt.rotate(e,e,t)}},{key:"scale",value:function(t,e){var n=this._attrs.attrs.matrix;Mt.scale(n,n,[t,e])}},{key:"moveTo",value:function(t,e){this.translate(t-(this._attrs.x||0),e-(this._attrs.y||0)),this.set("x",t),this.set("y",e)}},{key:"apply",value:function(t){return _t.transformMat2d(t,t,this._attrs.attrs.matrix),this}},{key:"resetTransform",value:function(t){var e=this._attrs.attrs.matrix;Mt.isChanged(e)&&t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}},{key:"isDestroyed",value:function(){return this.get("destroyed")}}]),t}(),le=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){this._attrs=ne(ne({},this._attrs),{},{zIndex:0,visible:!0,destroyed:!1,isShape:!0,attrs:{}})}},{key:"getType",value:function(){return this._attrs.type}},{key:"drawInner",value:function(t){var e=this.get("attrs");this.createPath(t);var n=t.globalAlpha;if(this.hasFill()){var r=e.fillOpacity;f(r)||1===r?t.fill():(t.globalAlpha=r,t.fill(),t.globalAlpha=n)}if(this.hasStroke()&&e.lineWidth>0){var i=e.strokeOpacity;f(i)||1===i||(t.globalAlpha=i),t.stroke()}}},{key:"getBBox",value:function(){var t=this._attrs.bbox;return t||((t=this.calculateBox())&&(t.x=t.minX,t.y=t.minY,t.width=t.maxX-t.minX,t.height=t.maxY-t.minY),this._attrs.bbox=t),t}},{key:"calculateBox",value:function(){return null}},{key:"createPath",value:function(t){}}]),n}(se);function ce(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ft(t)););return t}function he(){return he="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=ce(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(3>arguments.length?t:n):i.value}},he.apply(this,arguments)}function fe(t,e,n){var r,i,a,o,u;if(i=0,a=0,o=0,u=0,A(r=t)?i=o=u=a=r:p(r)&&(i=r[0],a=f(r[1])?r[0]:r[1],o=f(r[2])?r[0]:r[2],u=f(r[3])?a:r[3]),!((t=[i,a,o,u])[0]||t[1]||t[2]||t[3]))return t;var s=Math.min(e/Math.max(t[0]+t[1],t[2]+t[3]),n/Math.max(t[0]+t[3],t[1]+t[2]));return 1>s?t.map((function(t){return t*s})):t}var pe=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="rect"}},{key:"getDefaultAttrs",value:function(){return{x:0,y:0,width:0,height:0,radius:0,lineWidth:0}}},{key:"createRadiusPath",value:function(t,e,n,r,i,a){a=fe(a,r,i),t.moveTo(e+a[0],n),t.lineTo(e+r-a[1],n),t.arc(e+r-a[1],n+a[1],a[1],-Math.PI/2,0,!1),t.lineTo(e+r,n+i-a[2]),t.arc(e+r-a[2],n+i-a[2],a[2],0,Math.PI/2,!1),t.lineTo(e+a[3],n+i),t.arc(e+a[3],n+i-a[3],a[3],Math.PI/2,Math.PI,!1),t.lineTo(e,n+a[0]),t.arc(e+a[0],n+a[0],a[0],Math.PI,3*Math.PI/2,!1),t.closePath()}},{key:"createPath",value:function(t){var e=this.get("attrs"),n=e.x,r=e.y,i=e.width,a=e.height,o=e.radius;t.beginPath(),o&&i*a?this.createRadiusPath(t,n,r,i,a,o):t.rect(n,r,i,a)}},{key:"calculateBox",value:function(){var t=this.get("attrs"),e=t.x,n=t.y;return{minX:e,minY:n,maxX:e+t.width,maxY:n+t.height}}}]),n}(le),de={},ye=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!1,this._attrs.canStroke=!1,this._attrs.loading=!1,this._attrs.image=null,this._attrs.type="image"}},{key:"draw",value:function(t){var e=this;if(!this.get("loading"))if(this.get("image"))he(Ft(n.prototype),"draw",this).call(this,t);else{var r=this.get("attrs").src;if(r){var i=this.get("cacheImage");if(i&&de[r])return this.set("image",de[r]),void this.draw(t);var a=null,o=this.get("canvas");if(o&&o.get("createImage")){var u=o.get("createImage");a=u()}else window.Image&&(a=new Image);a&&(this.set("loading",!0),a.crossOrigin="",a.onload=function(){e.set("loading",!1),e.set("image",a),o.draw()},a.src=r,i&&(de[r]=a))}}}},{key:"createPath",value:function(t){var e=this.get("image");this.drawImage(t,e)}},{key:"drawImage",value:function(t,e){var n=this._attrs,r=n.attrs;if(!n.destroyed){var i=r.x,a=r.y,o=r.width,u=r.height,s=r.sx,l=r.sy,c=r.swidth,h=r.sheight,p=r.radius,d=r.fillOpacity;p&&(t.save(),this.createRadiusPath(t,i,a,o,u,p),t.clip());var y=t.globalAlpha;f(d)||(t.globalAlpha=d),f(s)||f(l)||f(c)||f(h)?t.drawImage(e,i,a,o,u):t.drawImage(e,s,l,c,h,i,a,o,u),t.globalAlpha=y,p&&t.restore()}}}]),n}(pe),ve=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="circle"}},{key:"getDefaultAttrs",value:function(){return{x:0,y:0,r:0,lineWidth:0}}},{key:"createPath",value:function(t){var e=this.get("attrs"),n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()}},{key:"calculateBox",value:function(){var t=this.get("attrs"),e=t.x,n=t.y,r=t.r;return{minX:e-r,maxX:e+r,minY:n-r,maxY:n+r}}}]),n}(le),ge=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canStroke=!0,this._attrs.type="line"}},{key:"getDefaultAttrs",value:function(){return{x1:0,y1:0,x2:0,y2:0,lineWidth:1}}},{key:"createPath",value:function(t){var e=this.get("attrs"),n=e.x1,r=e.y1,i=e.x2,a=e.y2;t.beginPath(),t.moveTo(n,r),t.lineTo(i,a)}},{key:"calculateBox",value:function(){var t=this.get("attrs");return function(t,e,n,r,i){return i=i/2||0,{minX:Math.min(t,n)-i,minY:Math.min(e,r)-i,maxX:Math.max(t,n)+i,maxY:Math.max(e,r)+i}}(t.x1,t.y1,t.x2,t.y2,t.lineWidth)}}]),n}(le),me=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="polygon"}},{key:"getDefaultAttrs",value:function(){return{points:null,lineWidth:0}}},{key:"createPath",value:function(t){var e=this.get("attrs").points;t.beginPath();for(var n=0,r=e.length;r>n;n++){var i=e[n];0===n?t.moveTo(i.x,i.y):t.lineTo(i.x,i.y)}t.closePath()}},{key:"calculateBox",value:function(){return Et(this.get("attrs").points)}}]),n}(le);function xe(t){for(var e=[],n=0,r=t.length;r>n;n++){var i=t[n];isNaN(i.x)||isNaN(i.y)||e.push(i)}return e}var ke=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="polyline"}},{key:"getDefaultAttrs",value:function(){return{points:null,lineWidth:1,smooth:!1}}},{key:"createPath",value:function(t){var e=this.get("attrs"),n=e.smooth,r=xe(e.points);if(t.beginPath(),r.length)if(t.moveTo(r[0].x,r[0].y),n)for(var i=Pt(r,!1,[[0,0],[1,1]]),a=0,o=i.length;o>a;a++){var u=i[a];t.bezierCurveTo(u[1],u[2],u[3],u[4],u[5],u[6])}else{var s,l;for(s=1,l=r.length-1;l>s;s++)t.lineTo(r[s].x,r[s].y);t.lineTo(r[l].x,r[l].y)}}},{key:"calculateBox",value:function(){var t=this.get("attrs"),e=t.smooth,n=t.lineWidth,r=xe(t.points);if(e){for(var i=[],a=Pt(r,!1,[[0,0],[1,1]]),o=0,u=a.length;u>o;o++){var s=a[o];if(0===o)i.push([r[0].x,r[0].y,s[1],s[2],s[3],s[4],s[5],s[6]]);else{var l=a[o-1];i.push([l[5],l[6],s[1],s[2],s[3],s[4],s[5],s[6]])}}return function(t,e){for(var n=1/0,r=-1/0,i=1/0,a=-1/0,o=0,u=t.length;u>o;o++){var s=Dt(t[o]);n>s.minX&&(n=s.minX),s.maxX>r&&(r=s.maxX),i>s.minY&&(i=s.minY),s.maxY>a&&(a=s.maxY)}return{minX:n-(e=e/2||0),minY:i-e,maxX:r+e,maxY:a+e}}(i,n)}return Et(r,n)}}]),n}(le),we=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canStroke=!0,this._attrs.canFill=!0,this._attrs.type="arc"}},{key:"getDefaultAttrs",value:function(){return{x:0,y:0,r:0,startAngle:0,endAngle:2*Math.PI,anticlockwise:!1,lineWidth:1}}},{key:"createPath",value:function(t){var e=this.get("attrs"),n=e.x,r=e.y,i=e.r,a=e.startAngle,o=e.endAngle,u=e.anticlockwise;t.beginPath(),a!==o&&t.arc(n,r,i,a,o,u)}},{key:"calculateBox",value:function(){var t=this.get("attrs");return jt(t.x,t.y,t.r,t.startAngle,t.endAngle,t.anticlockwise)}}]),n}(le),be=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="sector"}},{key:"getDefaultAttrs",value:function(){return{x:0,y:0,lineWidth:0,r:0,r0:0,startAngle:0,endAngle:2*Math.PI,anticlockwise:!1}}},{key:"createPath",value:function(t){var e=this.get("attrs"),n=e.x,r=e.y,i=e.startAngle,a=e.r,o=e.r0,u=e.anticlockwise,s=Math.min(e.endAngle,i+2*Math.PI);t.beginPath();var l=Math.cos(i),c=Math.sin(i);t.moveTo(l*o+n,c*o+r),t.lineTo(l*a+n,c*a+r),(Math.abs(s-i)>1e-4||0===i&&0>s)&&(t.arc(n,r,a,i,s,u),t.lineTo(Math.cos(s)*o+n,Math.sin(s)*o+r),0!==o&&t.arc(n,r,o,s,i,!u)),t.closePath()}},{key:"calculateBox",value:function(){var t=this.get("attrs"),e=t.x,n=t.y,r=t.r0,i=t.startAngle,a=t.endAngle,o=t.anticlockwise,u=jt(e,n,t.r,i,a,o),s=jt(e,n,r,i,a,o);return{minX:Math.min(u.minX,s.minX),minY:Math.min(u.minY,s.minY),maxX:Math.max(u.maxX,s.maxX),maxY:Math.max(u.maxY,s.maxY)}}}]),n}(le),Me=function(t){var e=t.width,n=t.height,r=Math.abs(t.rotate);return{width:Math.abs(e*Math.cos(r)+n*Math.sin(r)),height:Math.abs(n*Math.cos(r)+e*Math.sin(r))}},_e=function(t,e,n){return n||(n=document.createElement("canvas").getContext("2d")),n.font=e||"12px sans-serif",n.measureText(t)},Se=0,Pe={},Oe=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="text"}},{key:"getDefaultAttrs",value:function(){return{lineWidth:0,lineCount:1,fontSize:12,fontFamily:"",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom",lineHeight:null,textArr:null}}},{key:"_getFontStyle",value:function(){var t=this._attrs.attrs,e=t.fontSize,n=t.fontFamily,r=t.fontWeight,i=t.fontVariant;return"".concat(t.fontStyle," ").concat(i," ").concat(r," ").concat(e,"px ").concat(n)}},{key:"_afterAttrsSet",value:function(){var t=this._attrs.attrs;if(t.font=this._getFontStyle(),t.text){var e=t.text,n=null,r=1;w(e)&&-1!==e.indexOf("\n")&&(r=(n=e.split("\n")).length),t.lineCount=r,t.textArr=n}this.set("attrs",t)}},{key:"_getTextHeight",value:function(){var t=this._attrs.attrs;if(t.height)return t.height;var e=t.lineCount,n=1*t.fontSize;return e>1?n*e+this._getSpaceingY()*(e-1):n}},{key:"_getSpaceingY",value:function(){var t=this._attrs.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n}},{key:"drawInner",value:function(t){var e=this._attrs.attrs,n=e.text,r=e.x,i=e.y;if(!(f(n)||isNaN(r)||isNaN(i))){var a=e.textArr,o=1*e.fontSize,u=this._getSpaceingY();e.rotate&&(t.translate(r,i),t.rotate(e.rotate),r=0,i=0);var s,l,c=e.textBaseline;if(a&&(s=this._getTextHeight()),this.hasFill()){var h=e.fillOpacity;if(f(h)||1===h||(t.globalAlpha=h),a)for(var p=0,d=a.length;d>p;p++){l=i+p*(u+o)-s+o,"middle"===c&&(l+=s-o-(s-o)/2),"top"===c&&(l+=s-o),t.fillText(a[p],r,l)}else t.fillText(n,r,i)}if(this.hasStroke())if(a)for(var y=0,v=a.length;v>y;y++){l=i+y*(u+o)-s+o,"middle"===c&&(l+=s-o-(s-o)/2),"top"===c&&(l+=s-o),t.strokeText(a[y],r,l)}else t.strokeText(n,r,i)}}},{key:"_getAriaLabel",value:function(){return this._attrs.attrs.text}},{key:"calculateBox",value:function(){var t=this._attrs.attrs,e=t.x,n=t.y,r=t.textAlign,i=t.textBaseline,a=this._getTextWidth();if(!a)return{minX:e,minY:n,maxX:e,maxY:n};var o=this._getTextHeight();if(t.rotate){var u=Me({width:a,height:o,rotate:t.rotate});a=u.width,o=u.height}var s={x:e,y:n-o};return r&&("end"===r||"right"===r?s.x-=a:"center"===r&&(s.x-=a/2)),i&&("top"===i?s.y+=o:"middle"===i&&(s.y+=o/2)),{minX:s.x,minY:s.y,maxX:s.x+a,maxY:s.y+o}}},{key:"_getTextWidth",value:function(){var t=this._attrs.attrs;if(t.width)return t.width;var e=t.text,n=this.get("context");if(!f(e)){var r=t.font,i=t.textArr,a=e+""+r;if(Pe[a])return Pe[a];var o=0;if(i)for(var u=0,s=i.length;s>u;u++){o=Math.max(o,_e(i[u],r,n).width)}else o=_e(e,r,n).width;return Se>5e3&&(Se=0,Pe={}),Se++,Pe[a]=o,o}}}]),n}(le),Ce=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.createPath=null,this._attrs.type="custom"}},{key:"createPath",value:function(t){var e=this.get("createPath");e&&e.call(this,t)}},{key:"calculateBox",value:function(){var t=this.get("calculateBox");return t&&t.call(this)}}]),n}(le),Ae={circle:function(t,e,n,r){r.arc(t,e,n,0,2*Math.PI,!1)},square:function(t,e,n,r){r.moveTo(t-n,e-n),r.lineTo(t+n,e-n),r.lineTo(t+n,e+n),r.lineTo(t-n,e+n),r.closePath()}},Te=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){he(Ft(n.prototype),"_initProperties",this).call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="marker"}},{key:"getDefaultAttrs",value:function(){return{x:0,y:0,lineWidth:0}}},{key:"createPath",value:function(t){var e,n=this.get("attrs"),r=n.x,i=n.y,a=n.radius,o=n.symbol||"circle";e=h(o)?o:Ae[o],t.beginPath(),e(r,i,a,t,this)}},{key:"calculateBox",value:function(){var t=this.get("attrs"),e=t.x,n=t.y,r=t.radius;return{minX:e-r,minY:n-r,maxX:e+r,maxY:n+r}}}]),n}(le);le.Rect=pe,le.Image=ye,le.Circle=ve,le.Line=ge,le.Polygon=me,le.Polyline=ke,le.Arc=we,le.Sector=be,le.Text=Oe,le.Custom=Ce,le.Marker=Te;var De={};var Ee={getGroupClass:function(){},getChildren:function(){return this.get("children")},addShape:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=De[t];n||(n=D(t),De[t]=n);var r=new le[n](e);return this.add(r),r},addGroup:function(t){var e=new(this.getGroupClass())(t);return this.add(e),e},contain:function(t){return this.get("children").indexOf(t)>-1},sort:function(){for(var t=this.get("children"),e=0,n=t.length;n>e;e++){t[e]._INDEX=e}return t.sort(function(t){return function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r}}((function(t,e){return t.get("zIndex")-e.get("zIndex")}))),this},drawChildren:function(t){this.sort();for(var e=this.get("children"),n=0,r=e.length;r>n;n++){e[n].draw(t)}return this},clear:function(){for(var t=this.get("children")||[];0!==t.length;)t[t.length-1].remove(!0);return this},add:function(t){var e=this.get("children");e||this.set("children",e=[]),p(t)||(t=[t]);for(var n=0,r=t.length;r>n;n++){var i=t[n],a=i.get("parent");if(a)Qt(a.get("children"),i);this._setEvn(i),e.push(i)}return this},_setEvn:function(t){var e=this._attrs,n=e.context,r=e.canvas,i=e.aria,a=t._attrs,o=a.isGroup,u=a.type;t._attrs.parent=this,t._attrs.context=n,t._attrs.canvas=r,i&&!1!==t._attrs.aria&&(t._attrs.aria=i),"text"===u&&r&&r.get("fontFamily")&&!t._attrs.attrs.fontFamily&&t.attr("fontFamily",r.get("fontFamily"));var s=t._attrs.attrs.clip;if(s&&(s._attrs.parent=this,s._attrs.context=n,s._attrs.canvas=r),o)for(var l=t._attrs.children,c=0,h=l.length;h>c;c++)t._setEvn(l[c])},_getAriaLabel:function(){var t=this._attrs,e=t.ariaLabel,n=t.children;if(t.aria){var r=[];if(n&&n.length)for(var i=0,a=n.length;a>i;i++){var o=n[i].getAriaLabel();o&&r.push(o)}var u=r.join(" ");return e&&u?"".concat(e," ").concat(u," "):e||u}}},je=function(t){Rt(n,t);var e=zt(n);function n(){return Yt(this,n),e.apply(this,arguments)}return Nt(n,[{key:"_initProperties",value:function(){this._attrs={type:"group",zIndex:0,visible:!0,destroyed:!1,isGroup:!0,canFill:!0,canStroke:!0,children:[],attrs:{x:0,y:0,width:0,height:0,radius:0,lineWidth:0}}}},{key:"getBBox",value:function(){for(var t=1/0,e=-1/0,n=1/0,r=-1/0,i=this.get("children"),a=0,o=i.length;o>a;a++){var u=i[a];if(u.get("visible")){var s=u.getBBox();if(!s)continue;var l=[s.minX,s.minY],c=[s.minX,s.maxY],h=[s.maxX,s.minY],f=[s.maxX,s.maxY],p=u.attr("matrix");_t.transformMat2d(l,l,p),_t.transformMat2d(c,c,p),_t.transformMat2d(h,h,p),_t.transformMat2d(f,f,p),t=Math.min(l[0],c[0],h[0],f[0],t),e=Math.max(l[0],c[0],h[0],f[0],e),n=Math.min(l[1],c[1],h[1],f[1],n),r=Math.max(l[1],c[1],h[1],f[1],r)}}return{minX:t,minY:n,maxX:e,maxY:r,x:t,y:n,width:e-t,height:r-n}}},{key:"createPath",value:function(t){var e=this.get("attrs");(e.fillStyle||e.strokeStyle)&&he(Ft(n.prototype),"createPath",this).call(this,t)}},{key:"drawInner",value:function(t){he(Ft(n.prototype),"drawInner",this).call(this,t),this.drawChildren(t)}},{key:"destroy",value:function(){this.get("destroyed")||(this.clear(),he(Ft(n.prototype),"destroy",this).call(this))}}]),n}(pe);R(je.prototype,Ee,{getGroupClass:function(){return je}});var Ye="object"===("undefined"==typeof window?"undefined":Bt(window))&&window.requestAnimationFrame?window.requestAnimationFrame:function(t){return setTimeout(t,16)},Ie={title:"这是一个图表,",withTitle:"这是一个关于“{title}”的图表。"},Ne=function(){return window&&window.devicePixelRatio||1},Le=function(t){return t?document.getElementById(t):null},Re=function(t){var e=Ht(t,"width");return"auto"===e&&(e=t.offsetWidth),parseFloat(e)},Fe=function(t){var e=Ht(t,"height");return"auto"===e&&(e=t.offsetHeight),parseFloat(e)},Be=function(t){return!(!t||"object"!==Bt(t))&&(!(1!==t.nodeType||!t.nodeName)||!!t.isCanvasElement)},Xe=function(t){Rt(n,t);var e=zt(n);function n(t){var r;Yt(this,n),r=e.call(this);var i,a,o=t.title,u=o?(a={title:o},(i=Ie.withTitle)&&a?i.replace(/\\?\{([^{}]+)\}/g,(function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===a[e]?"":a[e]})):i):Ie.title;return r._attrs=R({type:"canvas",children:[],ariaLabel:u},t),r._initPixelRatio(),r._initCanvas(),r}return Nt(n,[{key:"get",value:function(t){return this._attrs[t]}},{key:"set",value:function(t,e){this._attrs[t]=e}},{key:"_initPixelRatio",value:function(){this.get("pixelRatio")||this.set("pixelRatio",Ne())}},{key:"beforeDraw",value:function(){var t=this._attrs.context,e=this._attrs.el;t&&t.clearRect&&t.clearRect(0,0,e.width,e.height)}},{key:"_initCanvas",value:function(){var t,e=this.get("el"),n=this.get("context");if(!e&&!n)throw Error("Please specify the id, el or context of the chart!");t=e?w(e)?Le(e):e:Kt(n),n&&t&&!t.getContext&&(t.getContext=function(){return n});var r=this.get("width")||Re(t)||t.width,i=this.get("height")||Fe(t)||t.height;this.set("canvas",this),this.set("el",t),this.set("context",n||t.getContext("2d")),this.changeSize(r,i);var a=new $t({canvas:this,el:t});this.set("eventController",a)}},{key:"changeSize",value:function(t,e){var n=this.get("pixelRatio"),r=this.get("el");(r.style&&(r.style.width=t+"px",r.style.height=e+"px"),Be(r))&&(r.width=t*n,r.height=e*n,1!==n&&this.get("context").scale(n,n));this.set("width",t),this.set("height",e)}},{key:"getWidth",value:function(){var t=this.get("pixelRatio");return this.get("width")*t}},{key:"getHeight",value:function(){var t=this.get("pixelRatio");return this.get("height")*t}},{key:"getPointByClient",value:function(t,e){var n=this.get("el"),r=n.getBoundingClientRect();return{x:n.width/(r.right-r.left)*(t-r.left),y:n.height/(r.bottom-r.top)*(e-r.top)}}},{key:"_beginDraw",value:function(){this._attrs.toDraw=!0}},{key:"_endDraw",value:function(){this._attrs.toDraw=!1}},{key:"draw",value:function(){var t=this;this.get("destroyed")||(this.get("animateHandler")?this._beginDraw():function e(){t.set("animateHandler",Ye((function(){t.set("animateHandler",void 0),t.get("toDraw")&&e()}))),t.beforeDraw();try{var n=t._attrs.context;t.drawChildren(n),n.draw&&n.draw(),t.setAriaLabel()}catch(e){console.warn("error in draw canvas, detail as:"),console.warn(e),t._endDraw()}t._endDraw()}())}},{key:"setAriaLabel",value:function(){var t=this._attrs.el,e=this._getAriaLabel();e&&t.setAttribute&&t.setAttribute("aria-label",e)}},{key:"destroy",value:function(){if(!this.get("destroyed")){var t=this.get("el");t.width=0,t.height=0,this.clear(),this._attrs={},this.set("destroyed",!0)}}},{key:"isDestroyed",value:function(){return this.get("destroyed")}}]),n}(Wt);R(Xe.prototype,Ee,{getGroupClass:function(){return je}});var ze={};function We(t){return new(ze[t.renderer]||{Canvas:Xe,Group:je,Shape:le}).Canvas(t)}var He=n((function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports})),Ve=n((function(t){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a=[],o=!0,u=!1;try{for(n=n.call(t);!(o=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);o=!0);}catch(t){u=!0,i=t}finally{try{o||null==n.return||n.return()}finally{if(u)throw i}}return a}},t.exports.__esModule=!0,t.exports.default=t.exports})),Ge=n((function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports})),qe=n((function(t){t.exports=function(t,e){if(t){if("string"==typeof t)return Ge(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ge(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports})),Ue=n((function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports})),Ze=e(n((function(t){t.exports=function(t,e){return He(t)||Ve(t,e)||qe(t,e)||Ue()},t.exports.__esModule=!0,t.exports.default=t.exports}))),$e=function(){function t(e){at(this,t),this.left=0,this.top=0,this.width=0,this.height=0,this.update(e)}return ut(t,[{key:"update",value:function(t){R(this,t);var e=this.top,n=this.height;return this.right=this.left+this.width,this.bottom=e+n,this}},{key:"padding",value:function(t){if(!t)return this;var e=t.top,n=t.right,r=void 0===n?0:n,i=t.bottom,a=void 0===i?0:i,o=t.left,u=void 0===o?0:o,s=this.right,l=this.bottom,c=this.left;return this.top=this.top+(void 0===e?0:e),this.right=s-r,this.bottom=l-a,this.left=c+u,this.width=this.right-this.left,this.height=this.bottom-this.top,this}},{key:"clone",value:function(){return new t({left:this.left,top:this.top,width:this.width,height:this.height})}}],[{key:"fromStyle",value:function(e){var n=e.left,r=e.top,i=e.width,a=e.height,o=Ze(e.padding,4),u=o[0],s=o[3];return new t({left:n+s,top:r+u,width:i-s-o[1],height:a-u-o[2]})}}]),t}();function Je(t){return Object.prototype.toString.call(t)}function Ke(t){return Object.keys(t)}function Qe(t,e){if(t===e)return!0;if(gt(t)!==gt(e))return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(Je(t)!==Je(e))return!1;if(h(t))return!0;if("object"!==gt(t))return!1;if(p(t)){if(t.length!==e.length)return!1;for(var n=t.length-1;n>=0;n--)if(!Qe(t[n],e[n]))return!1;return!0}if(!g(t))return!1;var r=Ke(t),i=Ke(e);if(r.length!==i.length)return!1;r.sort(),i.sort();for(var a=r.length-1;a>=0;a--)if(r[a]!=i[a])return!1;for(var o=r.length-1;o>=0;o--){var u=r[o];if(!Qe(t[u],e[u]))return!1}return!0}var tn="object"===("undefined"==typeof window?"undefined":gt(window))&&window.requestAnimationFrame?window.requestAnimationFrame:function(t){return setTimeout(t,16)},en="object"===("undefined"==typeof window?"undefined":gt(window))&&window.cancelAnimationFrame?window.cancelAnimationFrame:function(t){return clearTimeout(t)},nn="object"===("undefined"==typeof performance?"undefined":gt(performance))&&performance.now?performance:Date,rn=function(){function t(){at(this,t),this.playing=!1,this.paused=!1,this.pausedTime=0}return ut(t,[{key:"play",value:function(t,e,n){var r=this;if(t>0){if(!this.playing){this.duration=t,this.onUpdate=e,this.onEnd=n;var i=this.paused,a=this.pausedTime;this.playing=!0;var o=nn.now();i&&a&&(o-=a,this.paused=!1,this.pausedTime=0);var u=function i(){var a=nn.now()-o;return t>a?r.paused?(e(a),r.pausedTime=a,void(r.playing=!1)):(e(a),void(r.animationFrameNumber=tn(i))):(e(t),n(),void(r.playing=!1))};this.animationFrameNumber=tn(u)}}else n()}},{key:"pause",value:function(){this.paused=!0}},{key:"stop",value:function(){this.playing=!1}},{key:"end",value:function(){this.playing&&(this.abort(),this.onUpdate(this.duration),this.onEnd())}},{key:"abort",value:function(){this.animationFrameNumber&&(en(this.animationFrameNumber),this.playing=!1,this.animationFrameNumber=null)}}]),t}();function an(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function on(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function un(){}var sn=.7,ln=1/sn,cn=/^#([0-9a-f]{3,8})$/,hn=/^rgb\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*\)$/,fn=/^rgb\(\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*\)$/,pn=/^rgba\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*\)$/,dn=/^rgba\(\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*\)$/,yn=/^hsl\(\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*\)$/,vn=/^hsla\(\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*\)$/,gn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function mn(){return this.rgb().formatHex()}function xn(){return this.rgb().formatRgb()}function kn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=cn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?wn(e):3===n?new Sn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?bn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?bn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=hn.exec(t))?new Sn(e[1],e[2],e[3],1):(e=fn.exec(t))?new Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=pn.exec(t))?bn(e[1],e[2],e[3],e[4]):(e=dn.exec(t))?bn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=yn.exec(t))?An(e[1],e[2]/100,e[3]/100,1):(e=vn.exec(t))?An(e[1],e[2]/100,e[3]/100,e[4]):gn.hasOwnProperty(t)?wn(gn[t]):"transparent"===t?new Sn(NaN,NaN,NaN,0):null}function wn(t){return new Sn(t>>16&255,t>>8&255,255&t,1)}function bn(t,e,n,r){return r>0||(t=e=n=NaN),new Sn(t,e,n,r)}function Mn(t){return t instanceof un||(t=kn(t)),t?new Sn((t=t.rgb()).r,t.g,t.b,t.opacity):new Sn}function _n(t,e,n,r){return 1===arguments.length?Mn(t):new Sn(t,e,n,null==r?1:r)}function Sn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Pn(){return"#"+Cn(this.r)+Cn(this.g)+Cn(this.b)}function On(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Cn(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function An(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Dn(t,e,n,r)}function Tn(t){if(t instanceof Dn)return new Dn(t.h,t.s,t.l,t.opacity);if(t instanceof un||(t=kn(t)),!t)return new Dn;if(t instanceof Dn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;return u?(o=e===a?(n-r)/u+6*(r>n):n===a?(r-e)/u+2:(e-n)/u+4,u/=.5>s?a+i:2-a-i,o*=60):u=s>0&&1>s?0:o,new Dn(o,u,s,t.opacity)}function Dn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function En(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}an(un,kn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:mn,formatHex:mn,formatHsl:function(){return Tn(this).formatHsl()},formatRgb:xn,toString:xn}),an(Sn,_n,on(un,{brighter:function(t){return new Sn(this.r*(t=null==t?ln:Math.pow(ln,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Sn(this.r*(t=null==t?sn:Math.pow(sn,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Pn,formatHex:Pn,formatRgb:On,toString:On})),an(Dn,(function(t,e,n,r){return 1===arguments.length?Tn(t):new Dn(t,e,n,null==r?1:r)}),on(un,{brighter:function(t){return new Dn(this.h,this.s,this.l*(t=null==t?ln:Math.pow(ln,t)),this.opacity)},darker:function(t){return new Dn(this.h,this.s,this.l*(t=null==t?sn:Math.pow(sn,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Sn(En(240>t?t+120:t-240,r,n),En(t,r,n),En(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var jn=function(t){return function(){return t}};function Yn(t){return 1==(t=+t)?In:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):jn(isNaN(e)?n:e)}}function In(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):jn(isNaN(t)?e:t)}var Nn=function t(e){var n=Yn(e);function r(t,e){var r=n((t=_n(t)).r,(e=_n(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=In(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function Ln(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;r>n;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}}function Rn(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=Array(i),o=Array(r);for(n=0;i>n;++n)a[n]=Vn(t[n],e[n]);for(;r>n;++n)o[n]=e[n];return function(t){for(n=0;i>n;++n)o[n]=a[n](t);return o}}function Fn(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Bn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Xn(t,e){var n,r={},i={};for(n in null!==t&&"object"===gt(t)||(t={}),null!==e&&"object"===gt(e)||(e={}),e)n in t?r[n]=Vn(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var zn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wn=RegExp(zn.source,"g");function Hn(t,e){var n,r,i,a=zn.lastIndex=Wn.lastIndex=0,o=-1,u=[],s=[];for(t+="",e+="";(n=zn.exec(t))&&(r=Wn.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),u[o]?u[o]+=i:u[++o]=i),(n=n[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,s.push({i:o,x:Bn(n,r)})),a=Wn.lastIndex;return e.length>a&&(i=e.slice(a),u[o]?u[o]+=i:u[++o]=i),2>u.length?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;e>r;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})}function Vn(t,e){var n,r,i=gt(e);return null==e||"boolean"===i?jn(e):("number"===i?Bn:"string"===i?(n=kn(e))?(e=n,Nn):Hn:e instanceof kn?Nn:e instanceof Date?Fn:(r=e,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(e)?Rn:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Xn:Bn:Ln))(t,e)}var Gn=function(t,e){return"string"==typeof e?Nn(t,e):Array.isArray(e)?"number"!=typeof e[0]?function(t,e){var n,r=t?t.length:0,i=e?e.length:0,a=Math.max(i,r),o=Array(a),u=Array(a);for(n=0;a>n;n++)u[n]=Xn(r>n?(t||[])[n]:(t||[])[r-1],i>n?(e||[])[n]:(e||[])[i-1]);return function(t){if(t>=1)return e;for(n=0;a>n;++n)o[n]=u[n](t);return o}}(t,e):Ln(t,e):Bn(t,e)};function qn(t){return t}function Un(t){return 1-Zn(1-t)}function Zn(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}var $n=Object.freeze({__proto__:null,linear:qn,quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return 1>(t*=2)?.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 1>(t*=2)?.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 1>(t*=2)?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||1>n?(n=1,e=.1):e=.4/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(t-=1))*Math.sin(2*Math.PI*(t-e)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||1>n?(n=1,e=.1):e=.4/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin(2*Math.PI*(t-e)/.4)+1)},elasticInOut:function(t){var e,n=.1,r=.4;return 0===t?0:1===t?1:(!n||1>n?(n=1,e=.1):e=r/(2*Math.PI)*Math.asin(1/n),1>(t*=2)?n*Math.pow(2,10*(t-=1))*Math.sin(2*Math.PI*(t-e)/r)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin(2*Math.PI*(t-e)/r)*.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-=1)*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return 1>(t*=2)?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:Un,bounceOut:Zn,bounceInOut:function(t){return.5>t?.5*Un(2*t):.5*Zn(2*t-1)+.5},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)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return 1>(t*=2)?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Jn=n((function(t){t.exports=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;a.length>r;r++)0>e.indexOf(n=a[r])&&(i[n]=t[n]);return i},t.exports.__esModule=!0,t.exports.default=t.exports})),Kn=e(n((function(t){t.exports=function(t,e){if(null==t)return{};var n,r,i=Jn(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)0>e.indexOf(n=a[r])&&Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i},t.exports.__esModule=!0,t.exports.default=t.exports}))),Qn=["key","ref"];function tr(t,e){for(var n=e||{},r=n.key,i=n.ref,a=Kn(n,Qn),o=arguments.length,u=Array(o>2?o-2:0),s=2;o>s;s++)u[s-2]=arguments[s];return u.length&&(a.children=1===u.length?u[0]:u),{key:r,ref:i,type:t,props:a,_cache:{}}}var er;try{er=parseInt(document.documentElement.style.fontSize,10)||50}catch(t){er=50}var nr=er/100;function rr(t){if(A(t))return[t,t,t,t];var e=t[0],n=A(t[1])?t[1]:t[0];return[e,n,A(t[2])?t[2]:e,A(t[3])?t[3]:n]}function ir(t){return function e(n){if(w(n)&&/^-?\d+px$/.test(n)){var r=n.substr(0,n.length-2);return t(Number(r))}if(p(n))return n.map((function(t){return e(t)}));if(g(n)){var i={};for(var a in n)if(n.hasOwnProperty(a)){var o=e(n[a]);if(!o){i[a]=o;continue}if("padding"===a||"margin"===a){var u=rr(o);i[a]=u,i["".concat(a,"Top")]=u[0],i["".concat(a,"Right")]=u[1],i["".concat(a,"Bottom")]=u[2],i["".concat(a,"Left")]=u[3];continue}i[a]=o}return i}return n}}function ar(t,e){if(!t)return t;if(!p(t))return[e(t)];for(var n=[],r=0;t.length>r;r++){var i=t[r];p(i)?n=n.concat(ar(i,e)):i&&n.push(e(i))}return n}function or(t){return w(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Y(t)&&(t=t.getTime()),t}function ur(t,e){var n=e.x,r=e.y;return!(t.minX>n||n>t.maxX||t.minY>r||r>t.maxY)}function sr(t,e){if(!e||!t)return[];var n=[];e.get("className")===t&&n.push(e);var r=e.get("children");if(r&&r.length)for(var i=0;r.length>i;i++){n=n.concat(sr(t,r[i]))}return n}var lr,cr=ir((function(t){return t?Number((t*nr).toFixed(1)):0})),hr="inherit",fr="row",pr="row-reverse",dr="column",yr="column-reverse",vr="flex-start",gr="center",mr="flex-start",xr="center",kr="flex-end",wr="stretch",br="relative",Mr="absolute",_r={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},Sr={row:"right","row-reverse":"left",column:"bottom","column-reverse":"top"},Pr={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},Or={row:"width","row-reverse":"width",column:"height","column-reverse":"height"};function Cr(t){return t.layout&&!t.isDirty||(t.layout={width:void 0,height:void 0,top:0,left:0,right:0,bottom:0}),t.style||(t.style={}),t.children||(t.children=[]),t.children.forEach(Cr),t}function Ar(t){return void 0===t}function Tr(t){return t===fr||t===pr}function Dr(t,e){if(void 0!==t.style.marginStart&&Tr(e))return t.style.marginStart;var n=null;switch(e){case"row":n=t.style.marginLeft;break;case"row-reverse":n=t.style.marginRight;break;case"column":n=t.style.marginTop;break;case"column-reverse":n=t.style.marginBottom}return void 0!==n?n:void 0!==t.style.margin?t.style.margin:0}function Er(t,e){if(void 0!==t.style.marginEnd&&Tr(e))return t.style.marginEnd;var n=null;switch(e){case"row":n=t.style.marginRight;break;case"row-reverse":n=t.style.marginLeft;break;case"column":n=t.style.marginBottom;break;case"column-reverse":n=t.style.marginTop}return null!=n?n:void 0!==t.style.margin?t.style.margin:0}function jr(t,e){if(void 0!==t.style.borderStartWidth&&t.style.borderStartWidth>=0&&Tr(e))return t.style.borderStartWidth;var n=null;switch(e){case"row":n=t.style.borderLeftWidth;break;case"row-reverse":n=t.style.borderRightWidth;break;case"column":n=t.style.borderTopWidth;break;case"column-reverse":n=t.style.borderBottomWidth}return null==n||0>n?void 0===t.style.borderWidth||0>t.style.borderWidth?0:t.style.borderWidth:n}function Yr(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&Tr(e))return t.style.borderEndWidth;var n=null;switch(e){case"row":n=t.style.borderRightWidth;break;case"row-reverse":n=t.style.borderLeftWidth;break;case"column":n=t.style.borderBottomWidth;break;case"column-reverse":n=t.style.borderTopWidth}return null==n||0>n?void 0===t.style.borderWidth||0>t.style.borderWidth?0:t.style.borderWidth:n}function Ir(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&Tr(e))return t.style.paddingStart;var n=null;switch(e){case"row":n=t.style.paddingLeft;break;case"row-reverse":n=t.style.paddingRight;break;case"column":n=t.style.paddingTop;break;case"column-reverse":n=t.style.paddingBottom}return null==n||0>n?void 0===t.style.padding||0>t.style.padding?0:t.style.padding:n}(t,e)+jr(t,e)}function Nr(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&Tr(e))return t.style.paddingEnd;var n=null;switch(e){case"row":n=t.style.paddingRight;break;case"row-reverse":n=t.style.paddingLeft;break;case"column":n=t.style.paddingBottom;break;case"column-reverse":n=t.style.paddingTop}return null==n||0>n?void 0===t.style.padding||0>t.style.padding?0:t.style.padding:n}(t,e)+Yr(t,e)}function Lr(t,e){return jr(t,e)+Yr(t,e)}function Rr(t,e){return Dr(t,e)+Er(t,e)}function Fr(t,e){return Ir(t,e)+Nr(t,e)}function Br(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:"stretch"}function Xr(t,e){if("rtl"===e){if(t===fr)return pr;if(t===pr)return fr}return t}function zr(t,e){return function(t){return t===dr||t===yr}(t)?Xr(fr,e):dr}function Wr(t){return t.style.position?t.style.position:"relative"}function Hr(t){return Wr(t)===br&&t.style.flex>0}function Vr(t,e){return t.layout[Or[e]]+Rr(t,e)}function Gr(t,e){return void 0!==t.style[Or[e]]&&t.style[Or[e]]>=0}function qr(t,e){return void 0!==t.style[e]}function Ur(t,e){return void 0!==t.style[e]?t.style[e]:0}function Zr(t,e,n){var r={row:t.style.minWidth,"row-reverse":t.style.minWidth,column:t.style.minHeight,"column-reverse":t.style.minHeight}[e],i={row:t.style.maxWidth,"row-reverse":t.style.maxWidth,column:t.style.maxHeight,"column-reverse":t.style.maxHeight}[e],a=n;return void 0!==i&&i>=0&&a>i&&(a=i),void 0!==r&&r>=0&&r>a&&(a=r),a}function $r(t,e){return t>e?t:e}function Jr(t,e){void 0===t.layout[Or[e]]&&Gr(t,e)&&(t.layout[Or[e]]=$r(Zr(t,e,t.style[Or[e]]),Fr(t,e)))}function Kr(t,e,n){e.layout[Sr[n]]=t.layout[Or[n]]-e.layout[Or[n]]-e.layout[Pr[n]]}function Qr(t,e){return void 0!==t.style[_r[e]]?Ur(t,_r[e]):-Ur(t,Sr[e])}function ti(t,e,n){var r=function(t,e){var n;return(n=t.style.direction?t.style.direction:hr)===hr&&(n=void 0===e?"ltr":e),n}(t,n),i=Xr(function(t){return t.style.flexDirection?t.style.flexDirection:dr}(t),r),a=zr(i,r),o=Xr(fr,r);Jr(t,i),Jr(t,a),t.layout.direction=r,t.layout[_r[i]]+=Dr(t,i)+Qr(t,i),t.layout[Sr[i]]+=Er(t,i)+Qr(t,i),t.layout[_r[a]]+=Dr(t,a)+Qr(t,a),t.layout[Sr[a]]+=Er(t,a)+Qr(t,a);var u=t.children.length,s=Fr(t,o);if(function(t){return void 0!==t.style.measure}(t)){var l=!Ar(t.layout[Or[o]]),c=lr;c=Gr(t,o)?t.style.width:l?t.layout[Or[o]]:e-Rr(t,o),c-=s;var h=!Gr(t,o)&&!l,f=!Gr(t,dr)&&Ar(t.layout.height);if(h||f){var p=t.style.measure(c);h&&(t.layout.width=p.width+s),f&&(t.layout.height=p.height+Fr(t,dr))}if(0===u)return}var d,y,v,g,m=function(t){return"wrap"===t.style.flexWrap}(t),x=function(t){return t.style.justifyContent?t.style.justifyContent:"flex-start"}(t),k=Ir(t,i),w=Ir(t,a),b=Fr(t,i),M=Fr(t,a),_=!Ar(t.layout[Or[i]]),S=!Ar(t.layout[Or[a]]),P=Tr(i),O=null,C=null,A=lr;_&&(A=t.layout[Or[i]]-b);for(var T=0,D=0,E=0,j=0,Y=0,I=0;u>D;){var N,L=0,R=0,F=0,B=0,X=_&&x===vr||!_&&x!==gr,z=X?u:T,W=!0,H=u,V=null,G=null,q=k,U=0;for(d=T;u>d;++d){if((v=t.children[d]).lineIndex=I,v.nextAbsoluteChild=null,v.nextFlexChild=null,(rt=Br(t,v))===wr&&Wr(v)===br&&S&&!Gr(v,a))v.layout[Or[a]]=$r(Zr(v,a,t.layout[Or[a]]-M-Rr(v,a)),Fr(v,a));else if(Wr(v)===Mr)for(null===O&&(O=v),null!==C&&(C.nextAbsoluteChild=v),C=v,y=0;2>y;y++)!Ar(t.layout[Or[g=0!==y?fr:dr]])&&!Gr(v,g)&&qr(v,_r[g])&&qr(v,Sr[g])&&(v.layout[Or[g]]=$r(Zr(v,g,t.layout[Or[g]]-Fr(t,g)-Rr(v,g)-Ur(v,_r[g])-Ur(v,Sr[g])),Fr(v,g)));var Z=0;if(_&&Hr(v)?(R++,F+=v.style.flex,null===V&&(V=v),null!==G&&(G.nextFlexChild=v),G=v,Z=Fr(v,i)+Rr(v,i)):(N=lr,P||(N=Gr(t,o)?t.layout[Or[o]]-s:e-Rr(t,o)-s),0===E&&ni(v,N,r),Wr(v)===br&&(B++,Z=Vr(v,i))),m&&_&&L+Z>A&&d!==T){B--,E=1;break}X&&(Wr(v)!==br||Hr(v))&&(X=!1,z=d),W&&(Wr(v)!==br||rt!==wr&&rt!==mr||Ar(v.layout[Or[a]]))&&(W=!1,H=d),X&&(v.layout[Pr[i]]+=q,_&&Kr(t,v,i),q+=Vr(v,i),U=$r(U,Zr(v,a,Vr(v,a)))),W&&(v.layout[Pr[a]]+=j+w,S&&Kr(t,v,a)),E=0,L+=Z,D=d+1}var $=0,J=0,K=0;if(K=_?A-L:$r(L,0)-L,0!==R){var Q,tt,et=K/F;for(G=V;null!==G;)(Q=et*G.style.flex+Fr(G,i))!==(tt=Zr(G,i,Q))&&(K-=tt,F-=G.style.flex),G=G.nextFlexChild;for(0>(et=K/F)&&(et=0),G=V;null!==G;)G.layout[Or[i]]=Zr(G,i,et*G.style.flex+Fr(G,i)),N=lr,Gr(t,o)?N=t.layout[Or[o]]-s:P||(N=e-Rr(t,o)-s),ni(G,N,r),v=G,G=G.nextFlexChild,v.nextFlexChild=null}else x!==vr&&(x===gr?$=K/2:"flex-end"===x?$=K:"space-between"===x?(K=$r(K,0),J=R+B-1!=0?K/(R+B-1):0):"space-around"===x&&($=(J=K/(R+B))/2));for(q+=$,d=z;D>d;++d)Wr(v=t.children[d])===Mr&&qr(v,_r[i])?v.layout[Pr[i]]=Ur(v,_r[i])+jr(t,i)+Dr(v,i):(v.layout[Pr[i]]+=q,_&&Kr(t,v,i),Wr(v)===br&&(q+=J+Vr(v,i),U=$r(U,Zr(v,a,Vr(v,a)))));var nt=t.layout[Or[a]];for(S||(nt=$r(Zr(t,a,U+M),M)),d=H;D>d;++d)if(Wr(v=t.children[d])===Mr&&qr(v,_r[a]))v.layout[Pr[a]]=Ur(v,_r[a])+jr(t,a)+Dr(v,a);else{var rt,it=w;if(Wr(v)===br)if((rt=Br(t,v))===wr)Ar(v.layout[Or[a]])&&(v.layout[Or[a]]=$r(Zr(v,a,nt-M-Rr(v,a)),Fr(v,a)));else if(rt!==mr){var at=nt-M-Vr(v,a);it+=rt===xr?at/2:at}v.layout[Pr[a]]+=j+it,S&&Kr(t,v,a)}j+=U,Y=$r(Y,q),I+=1,T=D}if(I>1&&S){var ot=t.layout[Or[a]]-M,ut=ot-j,st=0,lt=w,ct=function(t){return t.style.alignContent?t.style.alignContent:"flex-start"}(t);ct===kr?lt+=ut:ct===xr?lt+=ut/2:ct===wr&&ot>j&&(st=ut/I);var ht=0;for(d=0;I>d;++d){var ft=ht,pt=0;for(y=ft;u>y;++y)if(Wr(v=t.children[y])===br){if(v.lineIndex!==d)break;Ar(v.layout[Or[a]])||(pt=$r(pt,v.layout[Or[a]]+Rr(v,a)))}for(ht=y,pt+=st,y=ft;ht>y;++y)if(Wr(v=t.children[y])===br){var dt=Br(t,v);if(dt===mr)v.layout[Pr[a]]=lt+Dr(v,a);else if(dt===kr)v.layout[Pr[a]]=lt+pt-Er(v,a)-v.layout[Or[a]];else if(dt===xr){v.layout[Pr[a]]=lt+(pt-v.layout[Or[a]])/2}else dt===wr&&(v.layout[Pr[a]]=lt+Dr(v,a))}lt+=pt}}var yt=!1,vt=!1;if(_||(t.layout[Or[i]]=$r(Zr(t,i,Y+Nr(t,i)),b),i!==pr&&i!==yr||(yt=!0)),S||(t.layout[Or[a]]=$r(Zr(t,a,j+M),M),a!==pr&&a!==yr||(vt=!0)),yt||vt)for(d=0;u>d;++d)v=t.children[d],yt&&Kr(t,v,i),vt&&Kr(t,v,a);for(C=O;null!==C;){for(y=0;2>y;y++)!Ar(t.layout[Or[g=0!==y?fr:dr]])&&!Gr(C,g)&&qr(C,_r[g])&&qr(C,Sr[g])&&(C.layout[Or[g]]=$r(Zr(C,g,t.layout[Or[g]]-Lr(t,g)-Rr(C,g)-Ur(C,_r[g])-Ur(C,Sr[g])),Fr(C,g))),qr(C,Sr[g])&&!qr(C,_r[g])&&(C.layout[_r[g]]=t.layout[Or[g]]-C.layout[Or[g]]-Ur(C,Sr[g]));v=C,C=C.nextAbsoluteChild,v.nextAbsoluteChild=null}}function ei(t){var e=t.margin,n=t.layout;Object.keys(e).forEach((function(t){var r,i=Number((r=e[t]).substr(0,r.length-1))/100;"marginLeft"!==t&&"marginRight"!==t||!n.width?"marginTop"!==t&&"marginBottom"!==t||!n.height||(n.top+=n.height*i):n.left+=n.width*i}))}function ni(t,e,n){t.shouldUpdate=!0,function(t){var e=t.style,n={};["marginTop","marginRight","marginBottom","marginLeft"].forEach((function(t){var r=e[t];r&&/^-?\d+%$/.test(r)&&(n[t]=r,e[t]=0)})),t.margin=n}(t);var r=t.style.direction||"ltr";!t.isDirty&&t.lastLayout&&t.lastLayout.requestedHeight===t.layout.height&&t.lastLayout.requestedWidth===t.layout.width&&t.lastLayout.parentMaxWidth===e&&t.lastLayout.direction===r?(t.layout.width=t.lastLayout.width,t.layout.height=t.lastLayout.height,t.layout.top=t.lastLayout.top,t.layout.left=t.lastLayout.left):(t.lastLayout||(t.lastLayout={}),t.lastLayout.requestedWidth=t.layout.width,t.lastLayout.requestedHeight=t.layout.height,t.lastLayout.parentMaxWidth=e,t.lastLayout.direction=r,t.children.forEach((function(t){t.layout.width=void 0,t.layout.height=void 0,t.layout.top=0,t.layout.left=0})),ti(t,e,n),t.lastLayout.width=t.layout.width,t.lastLayout.height=t.layout.height,t.lastLayout.top=t.layout.top,t.lastLayout.left=t.layout.left),ei(t)}function ri(t){if(!t)return t;var e=t.children;if(t.style)return Cr(t),ni(t,null,null),t;if(e&&e.length)for(var n=0,r=e.length;r>n;n++)ri(e[n]);return t}var ii=function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},ai={rect:ii,line:function(t){var e=t.left,n=t.top;return{x1:e,y1:n,x2:e+t.width,y2:n+t.height}},text:function(t){return{x:t.left,y:t.top+t.height/2,textBaseline:"middle"}},circle:function(t){var e=t.width/2;return{x:t.left+e,y:t.top+e,r:e}},marker:function(t){var e=t.width/2;return{x:t.left+e,y:t.top,radius:e}},group:ii},oi="update",ui="delete";function si(t,e){return new(le[D(t)])(e)}function li(t,e,n){var r=t.key,i=t.ref,a=t._cache,u=t.type,s=t.props,l=t.status,c=t.animation,h=ar(s.children,(function(t){return li(t,e,n)})),f=n(s.style),p=n(s.attrs);if("text"===u){var d=e.addShape(u,{attrs:o({x:0,y:0},p)}),y=d.getBBox();f=o({width:y.width,height:y.height},f),d.remove(!0)}return{key:r,ref:i,_cache:a,type:u,props:s,children:h,status:l,animation:c,style:f,attrs:p}}function ci(t,e,n,r){var i,a=t._cache,u=void 0===a?{}:a,s=t.ref,l=t.type,c=t.props,f=t.attrs,p=t.renderChildren,d=t.children,y=t.status,v=t.animation,g=function(t,e){if(!t||!e)return e;var n=t.left,r=t.top,i=e.left,a=e.top;return o(o({},e),{},{left:n+i,top:r+a})}(n,t.layout),m=u.attrs,x=o(o(o({},function(t,e){return e?(ai[t]||ii)(e):null}(l,g)),y===ui?m:null),f);if(u.attrs=x,x.clip){var k=x.clip,w=h(k)?k(x):k;x.clip=si(w.type,w)}if("group"===l){i=e.addGroup(o(o({},Z(c,["children"])),{},{status:y,attrs:x}));var b=p||d;if(b&&b.length)for(var M=0,_=b.length;_>M;M++)ci(b[M],i,g,r)}else i=e.addShape(l,o(o({},c),{},{status:y,attrs:x}));return!1!==r&&i.set("animation",function(t,e,n,r){if(!e)return null;var i=t.get("status"),a=e.clip,u=e.start,s=e.end,l=e.easing,c=e.delay,f=e.duration,p=h(a)?a(t._attrs.attrs):a;if(p){var d=p.start,y=si(p.type,{attrs:o(o({},p.attrs),d)});p.easing=p.easing||l,p.delay="number"==typeof p.delay?p.delay:c,p.duration=p.duration||f,p.element=y}var v=t.getDefaultAttrs();return o(o({},e),{},{clip:p,start:o(o(o({},v),r),u),end:o(o({},i===ui?null:n),s)})}(i,v,x,m)),s&&(s.current=i),i}function hi(t){var e=t.children;if(t.status===ui)return null;if(!e||!e.length)return t;var n=e.filter((function(t){return!!hi(t)}));return t.children=n,t.renderChildren=e,t}function fi(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:cr;if(t){var i=li(t,e,r),a=hi(i);return ri(a),ci(i,e,null,n)}}function pi(t,e,n){if(!t)return t;var r=t.type,i=t.key,a=t.ref,u=t.props,s=t._cache,l=void 0===s?{}:s,c=it.map(u.children,(function(t){return pi(t,e,n)}));if(t={type:r,key:i,ref:a,_cache:l,props:o(o({},u),{},{children:c})},"function"==typeof r){var h=r(t.props,e,n);return h?pi(o(o({},h),{},{key:void 0!==i?i:h.key,ref:void 0!==a?a:h.ref}),e,n):h}return t}var di=function(t,e,n){return pi(t,e,n)},yi=["children","animation"],vi=["children","animation"],gi=["children","animation"],mi=["animation"],xi=["animation"];function ki(t){var e=!1,n=it.map(t,(function(t){if(!t)return t;var n=t.ref,r=t.key,i=t.type,a=t.props,u=t._cache,s=a.children,l=a.animation,c=Kn(a,yi),h=l&&l.leave,f=ki(s);return f||h?(e=!0,{ref:n,key:r,type:i,props:o(o({},c),{},{children:f}),_cache:u,animation:h,status:"delete"}):null}));return e?n:null}function wi(t){return it.map(t,(function(t){if(!t)return t;var e=t.ref,n=t.key,r=t.type,i=t.props,a=t._cache,u=i.children,s=i.animation,l=Kn(i,vi),c=s&&s.appear,h=wi(u);return{ref:e,key:n,type:r,props:o(o({},l),{},{children:h}),_cache:a,animation:c,status:"appear"}}))}function bi(t,e){return[ki(e),wi(t)]}function Mi(t,e){var n=e.type;return"group"===t.type?function(t,e){var n=t.key,r=t.type,i=t.ref,a=t.props,u=t._cache,s=e.type,l=e._cache,c=it.map(a.children,(function(t){if(!t)return t;var n=t.key,r=t.ref,i=t.type,a=t.props,o=t._cache;if(i!==s)return bi(t,e);var u=a.animation,c=Kn(a,mi),h=u&&u.update;return{ref:r,key:n,type:i,props:c,_cache:R(o,l),animation:h,status:oi}}));return{key:n,type:r,ref:i,props:o(o({},a),{},{children:c}),_cache:u,status:oi}}(t,e):"group"===n?function(t,e){var n=t.ref,r=t.key,i=t.type,a=t.props,u=t._cache,s=e.type,l=e.props,c=a.animation,h=Kn(a,xi),f=l.children,p=c&&c.update;if(!p)return[ki(e),wi[t]];var d=null,y=it.map(f,(function(t){if(!t)return t;var e=t._cache;return t.type!==i?ki(t):(d||(d=t),{type:i,props:a,_cache:e,animation:p,status:oi})}));if(!d)return[ki(e),wi(t)];var v={ref:n,key:r,type:i,props:h,_cache:R(u,d._cache),animation:p,status:oi};return[{type:s,props:o(o({},l),{},{children:y}),status:ui},v]}(t,e):bi(t,e)}function _i(t,e){if(!t&&!e)return null;if(!e)return wi(t);if(!t)return ki(e);if(p(t)||p(e))return function(t,e){for(var n={},r=t.length,i=e.length,a=0;i>a;a++){var o=e[a];o&&!f(o.key)&&(n[o.key]=o)}for(var u=Math.max(r,i),s=[],l=0;u>l;l++){var c=t[l];if(c){var h=c.key;if(f(h))s.push(_i(c,e[l]));else{var p=n[h];p&&delete n[h],s.push(_i(c,p))}}else s.push(_i(c,e[l]))}return Object.keys(n).forEach((function(t){s.push(_i(null,n[t]))})),s}(p(t)?t:[t],p(e)?e:[e]);var n=t.key,r=t.type,i=e.key,a=e.type;return f(n)||n===i?r!==a?Mi(t,e):function(t,e){var n=t.ref,r=t.key,i=t.type,a=t._cache,u=t.props,s=e._cache,l=e.props,c=u.children,h=u.animation,f=Kn(u,gi),p=_i(c,l.children),d=R(a,s),y=h&&h.update;return{ref:n,key:r,type:i,props:o(o({},f),{},{children:p}),_cache:d,animation:y,status:oi}}(t,e):[ki(e),wi(t)]}var Si=function(){function t(e,n){at(this,t),this.isClip=!1,this.end=!1,this.element=e,this.animation=n;var r=n.property,i=void 0===r?[]:r,a=n.easing,o=n.duration,u=n.delay,s=void 0===u?0:u,l=n.start,c=n.end,h=n.onFrame,f=n.isClip,p=i.map((function(t){return w(t)?Gn(l[t],c[t]):t.interpolate?t.interpolate(l,c):void 0}));this.easing="function"==typeof a?a:$n[a]||qn,this.property=i,this.interpolates=p,this.duration=o,this.delay=s,this.onFrame=h,this.totalDuration=o+s,this.isClip=f,this.update(0,0)}return ut(t,[{key:"to",value:function(t){var e=this.duration,n=this.delay;if(!this.end&&t>n&&e){var r=this.totalDuration>t?(t-n)/e:1;this.update((0,this.easing)(r),t),1===r&&this.onEnd()}}},{key:"update",value:function(t,e){for(var n=this.element,r=this.interpolates,i=this.property,a=this.onFrame,u={},s=i.length-1;s>=0;s--){var l=i[s];w(l)?u[l]=r[s](t):u[l.name]=r[s](t)}a&&(u=o(o({},u),this.onFrame(t,e))),n.attr(u)}},{key:"onEnd",value:function(){var t=this.isClip,e=this.element,n=this.animation.onEnd;n&&n.call(this),t&&e.remove(!0),e._attrs.status===ui&&e.remove(!0),e.set("animation",null),this.end=!0}}]),t}();function Pi(t,e){e(t);var n=t.get("children");if(n&&n.length)for(var r=0,i=n.length;i>r;r++){Pi(n[r],e)}}var Oi=function(){function t(e){at(this,t),this.timeline=new rn,this.canvas=e}return ut(t,[{key:"createAnimator",value:function(t,e){var n=e.property;if(e.duration&&(n&&n.length||e.onFrame))return new Si(t,e)}},{key:"play",value:function(t,e){var n=this,r=this.canvas,i=[],a=0,o=[];Pi(t,(function(t){var e=t._attrs,r=e.animation,u=e.status;if(r){var s=n.createAnimator(t,r);s&&(a=Math.max(a,s.totalDuration),i.push(s));var l=r.clip;if(l){l.isClip=!0;var c=l.element,h=n.createAnimator(c,l);h&&(a=Math.max(a,h.totalDuration),t.attr("clip",c),i.push(h))}}else u===ui&&o.push(t)}));for(var u=0,s=o.length;s>u;u++){var l=o[u],c=l._attrs.children;c&&c.length||l.remove(!0)}this.timeline.play(a,(function(t){for(var e=0,n=i.length;n>e;e++){i[e].to(t)}a>t&&r.draw()}),(function(){for(var t=0,n=o.length;n>t;t++){o[t].remove(!0)}r.draw(),e&&e()}))}},{key:"end",value:function(){this.timeline.end()}},{key:"abort",value:function(){this.timeline.abort()}}]),t}();function Ci(t){var e=[],n=[],r=[];function i(){for(var i;i=e.shift();){var a=i.state,o=i.component,u=i.callback;o.destroyed||(o.prevState||(o.prevState=Object.assign({},o.state)),Object.assign(o.state,"function"==typeof a?a(o.prevState,o.props):a),o.prevState=o.state,"function"==typeof u&&r.push({callback:u,component:o}))}var s=[].concat(n);t.renderComponents(s),function(){for(var t=0;r.length>t;t++){var e=r[t];e.callback.call(e.component)}}(),n.length=0,r.length=0}function a(t,r,a){0===e.length&&setTimeout(i,0),e.push({component:t,state:r,callback:a}),0>n.indexOf(t)&&n.push(t)}return{enqueueForceUpdate:a,enqueueSetState:a}}var Ai={fontFamily:'"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif',pixelRatio:1,padding:[0,0,0,0],chart:{padding:["30px","30px","30px","30px"]},colors:["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],shapes:{line:["line","dash","smooth"],point:["circle","hollowCircle","rect"],area:["area","smooth"],interval:["rect","pyramid","funnel"]},sizes:["4px","6px","8px","10px","12px"],shape:{line:{default:{lineWidth:"4px",lineJoin:"round",lineCap:"round"},smooth:{smooth:!0},dash:{lineDash:["8px","8px"]}},point:{default:{size:"6px"},hollowCircle:{lineWidth:"2px"}},area:{default:{fillOpacity:.1}},interval:{default:{}}},axis:{labelOffset:"15px",line:{stroke:"#E8E8E8",lineWidth:"1px"},label:{fill:"#808080",fontSize:"20px"},grid:{stroke:"#E8E8E8",lineWidth:"1px",lineDash:["4px"]}},guide:{line:{style:{stroke:"#a3a3a3",lineWidth:1},offsetX:0,offsetY:0},text:{style:{fill:"#787878",textBaseline:"middle"},offsetX:0,offsetY:0},rect:{style:{fill:"#fafafa"}},arc:{style:{stroke:"#a3a3a3"}},html:{offsetX:0,offsetY:0,alignX:"center",alignY:"middle"},tag:{offsetX:0,offsetY:0,side:4,background:{padding:5,radius:2,fill:"#1890FF"},textStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"}},point:{offsetX:0,offsetY:0,style:{fill:"#fff",r:3,lineWidth:2,stroke:"#1890ff"}}}},Ti=["transformFrom"];function Di(t){return t?it.map(t,(function(t){return t?function(t,e){if(null===t||!g(t))return{};var n={};return y(e,(function(e){U.call(t,e)&&(n[e]=t[e])})),n}(t,["key","ref","type","props"]):t})):t}function Ei(t,e,n){var r=t.container,i=t.context,a=t.updater,o=t.__lastElement,u=t.transformFrom,s=t.animate;r.clear(),n=j(n)?n:s;var l=i.px2hd,c=o||u&&u.__lastElement,h=di(e,i,a);t.__lastElement=h;var f=!1!==n?_i(h,c):h;return f?p(f)?f.map((function(t){return fi(t,r,n,l)})):fi(f,r,n,l):null}function ji(t){if(!t)return null;var e=t.children;if(t.__lastElement)return t;if(!e)return null;var n=null;return it.map(e,(function(t){if(!n&&t){var e=ji(t.component);e&&(n=e)}})),n}function Yi(t){return t&&t.current?ji(t.current):null}function Ii(t){it.map(t,(function(t){N(t.children)?t.willMount&&t.willMount():t.willUpdate&&t.willUpdate()})),it.map(t,(function(t){var e=t.children,n=N(e),r=t.render();Fi(t,r,e),n?t.didMount&&t.didMount():t.didUpdate&&t.didUpdate()}))}function Ni(t){it.map(t,(function(t){if(t){var e=t.component;if(e)e.willUnmount&&e.willUnmount(),Ni(e.children),e.container.remove(!0),e.didUnmount&&e.didUnmount(),e.destroy()}}))}function Li(t,e,n){var r=[];it.compare(e,n,(function(e,n){var i=function(t,e,n){if(!e&&!n)return null;if(!e&&n)return Ni(n),null;if(e&&!n)return e;var r=e.props,i=n.props,a=n.component;return e.type!==n.type?(Ni(n),e):(e.component=a,Qe(r,i)&&a.context===t.context?null:e)}(t,e,n);i&&(r=r.concat(it.toArray(i).filter(Boolean)))}));var i=r.filter((function(t){var e=t.component;return!e||(!e.shouldUpdate||!1!==e.shouldUpdate(t.props))})).map((function(e){var n=e.component;if(n){var r=e.props;n.willReceiveProps&&n.willReceiveProps(r,t.context),n.container.set("zIndex",r.zIndex),n.props=r,n.context=t.context}else n=function(t,e){var n,r=e.type,i=e.props,a=e.ref,o=t.container,u=t.context,s=t.updater,l=t.transformFrom,c=i.transformFrom,h=Kn(i,Ti);if(r.prototype&&r.prototype.isF2Component?n=new r(h,u,s):(n=new st(h,u,s)).render=function(){return r(this.props,u,s)},a&&(a.current=n),l&&(n.transformFrom=l),c){var f=c?Yi(c):null;n.transformFrom=f}return n.container=o.addGroup({zIndex:i.zIndex}),n.context=u,n.updater=s,n}(t,e);return e.component=n,function(t,e){var n=e.animate;if(!1!==n){var r=t.props.animate;t.animate=j(r)?r:n}else t.animate=!1}(n,t),n}));return Ii(i),r.forEach((function(e){t.container.add(e.component.container)})),e}function Ri(t){if(!t)return!1;if(!p(t))return"function"==typeof t.type;for(var e=0,n=t.length;n>e;e++)if(Ri(t[e]))return!0;return!1}function Fi(t,e,n){return e=Di(e),t.children=e,Ri(e)?e=Li(t,e,n):Ei(t,e),e}var Bi=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;arguments.length>r;r++)n[r-1]=arguments[r];var i=this._events[t]||[],a=this._events["*"]||[],o=function(r){for(var i=r.length,a=0;i>a;a++)if(r[a]){var o=r[a],u=o.callback;o.once&&(r.splice(a,1),0===r.length&&delete e._events[t],i--,a--),u.apply(e,n)}};o(i),o(a)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;r>i;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}();function Xi(t,e){return function(n,r){var i=r||{},a=i.fontFamily,o=i.fontStyle,u=i.fontWeight,s=i.fontVariant,l=t.addShape("text",{attrs:{x:0,y:0,fontSize:e(i.fontSize),fontFamily:a,fontStyle:o,fontWeight:u,fontVariant:s,text:n}}),c=l.getBBox(),h=c.width,f=c.height;return l.remove(!0),{width:h,height:f}}}var zi=function(t){ft(n,t);var e=wt(n);function n(t){var r;at(this,n),r=e.call(this,t);var i=t.context,a=t.pixelRatio,o=t.width,u=t.height,s=t.animate,l=void 0===s||s,c=t.px2hd,f=t.theme,p=t.createImage,d=t.landscape,y=h(c)?ir(c):cr,v=y(X({},Ai,f)),g=We({context:i,pixelRatio:a,fontFamily:v.fontFamily,width:o,height:u,createImage:p,landscape:d}),m=Ci(ct(r)),x={root:ct(r),canvas:g,theme:v,px2hd:y,measureText:Xi(g,y)},k=new Oi(g);return r.canvas=g,r.container=g,r.context=x,r.updater=m,r.animate=l,r.animation=k,r.theme=v,r._ee=new Bi,r.updateLayout(t),r}return ut(n,[{key:"renderComponents",value:function(t){t&&t.length&&(Ii(t),this.draw())}},{key:"update",value:function(t){Qe(t,this.props)||(this.props=t,this.render())}},{key:"resize",value:function(t,e){var n=this.canvas._attrs;this.canvas.changeSize(t||n.width,e||n.height),this.updateLayout(o(o({},this.props),{},{width:t,height:e})),this.render()}},{key:"updateLayout",value:function(t){var e=this.canvas._attrs,n=this.context.px2hd(o({left:0,top:0,width:(null==t?void 0:t.width)||e.width,height:(null==t?void 0:t.height)||e.height,padding:this.theme.padding},t.style));this.layout=$e.fromStyle(n),this.context=o(o({},this.context),{},{left:this.layout.left,top:this.layout.top,width:this.layout.width,height:this.layout.height})}},{key:"draw",value:function(){var t=this.canvas;!1!==this.animate?this.play():t.draw()}},{key:"play",value:function(){var t=this,e=this.canvas,n=this.animation;n.abort(),n.play(e,(function(){t.emit("animationEnd")}))}},{key:"render",value:function(){return Fi(this,this.props.children,this.children),this.draw(),null}},{key:"destroy",value:function(){this.canvas.destroy()}},{key:"on",value:function(t,e){this._ee.on(t,e)}},{key:"emit",value:function(t,e){this._ee.emit(t,e)}},{key:"off",value:function(t,e){this._ee.off(t,e)}}]),n}(st),Wi=function(){function t(){at(this,t)}return ut(t,[{key:"getRectRange",value:function(t){var e=t.left,n=t.top,r=t.width,i=t.height,a=Ze(t.padding,4),o=a[0],u=a[3];return{left:e+u,top:n+o,width:r-u-a[1],height:i-o-a[2]}}},{key:"create",value:function(t){var e=this.getRectRange(t),n=new $e(e);return this.layout=n,n}},{key:"update",value:function(t){var e=this.getRectRange(t),n=this.layout;return n.update(e),n}}]),t}(),Hi=n((function(t){t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=pt(t)););return t},t.exports.__esModule=!0,t.exports.default=t.exports})),Vi=n((function(t){function e(){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=e=Reflect.get.bind(),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=e=function(t,e,n){var r=Hi(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(3>arguments.length?t:n):i.value}},t.exports.__esModule=!0,t.exports.default=t.exports),e.apply(this,arguments)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),Gi=e(Vi);function qi(t){return{xMin:t.yMin,xMax:t.yMax,yMin:t.xMin,yMax:t.xMax}}function Ui(t){var e,n,r,i,a=t.x,o=t.y,u=t.size,s=t.y0;return p(a)?(e=a[0],n=a[1]):(e=a-u/2,n=a+u/2),p(o)?(r=o[0],i=o[1]):(r=Math.min(s,o),i=Math.max(s,o)),{xMin:e,xMax:n,yMin:r,yMax:i}}var Zi=function(t){ft(n,t);var e=wt(n);function n(t){var r;return at(this,n),(r=e.call(this,t)).transposed=!1,r.x=[0,1],r.y=[0,1],r.update(t),r}return ut(n,[{key:"update",value:function(t){return Gi(dt(n.prototype),"update",this).call(this,t),this.center={x:this.left+this.width/2,y:this.top+this.height/2},this}},{key:"isCyclic",value:function(){return!1}},{key:"_zoomVal",value:function(t,e){return p(t)?t.map((function(t){return e(t)})):e(t)}},{key:"convert",value:function(t){var e=this.transposed,n=this.x,r=this.y,i=e?"y":"x",a=e?"x":"y",o=t[i],u=t[a];return 0>o||o>1||0>u||u>1?{x:NaN,y:NaN}:{x:this._zoomVal(t[i],(function(t){return n[0]+(n[1]-n[0])*t})),y:this._zoomVal(t[a],(function(t){return r[0]+(r[1]-r[0])*t}))}}},{key:"invert",value:function(t){var e,n=this.transposed,r=this.x,a=this.y,o=n?"x":"y";return i(e={},n?"y":"x",this._zoomVal(t.x,(function(t){return(t-r[0])/(r[1]-r[0])}))),i(e,o,this._zoomVal(t.y,(function(t){return(t-a[0])/(a[1]-a[0])}))),e}},{key:"convertPoint",value:function(t){return this.convert(t)}},{key:"invertPoint",value:function(t){return this.invert(t)}},{key:"convertRect",value:function(t){var e=this.y,n=this.transposed,r=Ze(this.x,2),i=r[0],a=r[1],o=Ze(e,2),u=o[0],s=o[1],l=Ui(t),c=n?qi(l):l,h=i+(a-i)*c.xMin,f=i+(a-i)*c.xMax,p=u+(s-u)*c.yMin,d=u+(s-u)*c.yMax;return{xMin:Math.min(h,f),xMax:Math.max(h,f),yMin:Math.min(p,d),yMax:Math.max(p,d)}}},{key:"transformToRect",value:function(t){var e=t.x,n=t.y,r=t.size,i=this.convertPoint({x:0,y:t.y0}),a=this.transposed,o=Ui({size:r,x:a?n:e,y:a?e:n,y0:a?i.x:i.y}),u=a?qi(o):o;return{xMin:u.xMin,xMax:u.xMax,yMin:u.yMin,yMax:u.yMax}}}]),n}($e),$i=function(t){ft(n,t);var e=wt(n);function n(){var t;return at(this,n),(t=e.apply(this,arguments)).type="rect",t}return ut(n,[{key:"update",value:function(t){Gi(dt(n.prototype),"update",this).call(this,t);var e=[this.bottom,this.top];return this.x=[this.left,this.right],this.y=e,this}}]),n}(Zi),Ji=function(t){ft(n,t);var e=wt(n);function n(){var t;return at(this,n),(t=e.apply(this,arguments)).type="polar",t.isPolar=!0,t}return ut(n,[{key:"update",value:function(t){Gi(dt(n.prototype),"update",this).call(this,t),this.option||(this.option=t);var e=this.option,r=e.radius,i=e.innerRadius,a=void 0===i?0:i,o=this.startAngle,u=void 0===o?-Math.PI/2:o,s=this.endAngle,l=void 0===s?3*Math.PI/2:s,c=(void 0===r?1:r)*(Math.min(this.width,this.height)/2),h=[a*c,c];return this.x=[u,l],this.y=h,this.startAngle=u,this.endAngle=l,this.radius=c,this.innnerRadius=a*c,this}},{key:"isCyclic",value:function(){return 2*Math.PI<=this.endAngle-this.startAngle}},{key:"convertPoint",value:function(t){var e=this.center,n=this.transposed,r=this.y,i=n?"y":"x",a=n?"x":"y",o=Ze(this.x,2),u=o[0],s=o[1],l=Ze(r,2),c=l[0],h=u+(s-u)*t[i],f=c+(l[1]-c)*t[a];return{x:e.x+Math.cos(h)*f,y:e.y+Math.sin(h)*f}}},{key:"invertPoint",value:function(t){var e=this.center,n=this.transposed,r=this.y,i=n?"y":"x",a=n?"x":"y",o=Ze(this.x,2),u=o[0],s=o[1],l=Ze(r,2),c=l[0],h=l[1],f=[1,0,0,1,0,0];Mt.rotate(f,f,u);var p=[1,0];_t.transformMat2d(p,p,f),p=[p[0],p[1]];var d=[t.x-e.x,t.y-e.y];if(_t.zero(d))return{x:0,y:0};var y=_t.angleTo(p,d,u>s);.001>Math.abs(y-2*Math.PI)&&(y=0);var v=y/(s-u),g=(_t.length(d)-c)/(h-c),m={};return m[i]=v=s-u>0?v:-v,m[a]=g,m}}]),n}(Zi),Ki={rect:$i,polar:Ji},Qi=function(){function t(){at(this,t)}return ut(t,[{key:"getOption",value:function(t){if(w(t))return{type:Ki[t]||$i};if(h(t))return{type:t};var e=(t||{}).type;return o(o({},t),{},{type:h(e)?e:Ki[e]||$i})}},{key:"create",value:function(t,e){var n=this.getOption(t),r=new(0,n.type)(o(o({},n),e));return this.coord=r,r}},{key:"updateLayout",value:function(t){this.coord.update(t)}},{key:"update",value:function(){}}]),t}(),ta={};function ea(t){return ta[t]}function na(t,e){ta[t]=e}var ra=function(){function t(t){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=t,this.initCfg(),this.init()}return t.prototype.translate=function(t){return t},t.prototype.change=function(t){R(this.__cfg__,t),this.init()},t.prototype.clone=function(){return this.constructor(this.__cfg__)},t.prototype.getTicks=function(){var t=this;return V(this.ticks,(function(e,n){return d(e)?e:{text:t.getText(e,n),tickValue:e,value:t.scale(e)}}))},t.prototype.getText=function(t,e){var n=this.formatter,r=n?n(t,e):t;return f(r)||!h(r.toString)?"":""+r},t.prototype.getConfig=function(t){return this.__cfg__[t]},t.prototype.init=function(){R(this,this.__cfg__),this.setDomain(),H(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},t.prototype.initCfg=function(){},t.prototype.setDomain=function(){},t.prototype.calculateTicks=function(){var t=this.tickMethod,e=[];if(w(t)){var n=ea(t);if(!n)throw Error("There is no method to to calculate ticks!");e=n(this)}else h(t)&&(e=t(this));return e},t.prototype.rangeMin=function(){return this.range[0]},t.prototype.rangeMax=function(){return this.range[1]},t.prototype.calcPercent=function(t,e,n){return A(t)?(t-e)/(n-e):NaN},t.prototype.calcValue=function(t,e,n){return e+t*(n-e)},t}(),ia=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cat",e.isCategory=!0,e}return K(e,t),e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;this.values.length>t;t++)this.translateIndexMap.set(this.values[t],t)}},e.prototype.translate=function(t){this.buildIndexMap();var e=this.translateIndexMap.get(t);return void 0===e&&(e=A(t)?t:NaN),e},e.prototype.scale=function(t){var e=this.translate(t),n=this.calcPercent(e,this.min,this.max);return this.calcValue(n,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var e=this.max-this.min,n=this.calcPercent(t,this.rangeMin(),this.rangeMax()),r=Math.round(e*n)+this.min;return this.min>r||r>this.max?NaN:this.values[r]},e.prototype.getText=function(e){for(var n=[],r=1;arguments.length>r;r++)n[r-1]=arguments[r];var i=e;return A(e)&&!this.values.includes(e)&&(i=this.values[i]),t.prototype.getText.apply(this,et([i],n))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if(f(this.getConfig("min"))&&(this.min=0),f(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(ra),aa=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,oa="\\d\\d?",ua="\\d\\d",sa="[^\\s]+",la=/\[([^]*?)\]/gm;function ca(t,e){for(var n=[],r=0,i=t.length;i>r;r++)n.push(t[r].substr(0,e));return n}var ha=function(t){return function(e,n){var r=n[t].map((function(t){return t.toLowerCase()})),i=r.indexOf(e.toLowerCase());return i>-1?i:null}};function fa(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];for(var r=0,i=e;i.length>r;r++){var a=i[r];for(var o in a)t[o]=a[o]}return t}var pa=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],da=["January","February","March","April","May","June","July","August","September","October","November","December"],ya=ca(da,3),va={dayNamesShort:ca(pa,3),dayNames:pa,monthNamesShort:ya,monthNames:da,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}},ga=fa({},va),ma=function(t){return ga=fa(ga,t)},xa=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},ka=function(t,e){for(void 0===e&&(e=2),t+="";e>t.length;)t="0"+t;return t},wa={D:function(t){return t.getDate()+""},DD:function(t){return ka(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()+""},dd:function(t){return ka(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1+""},MM:function(t){return ka(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return ka(t.getFullYear()+"",4).substr(2)},YYYY:function(t){return ka(t.getFullYear(),4)},h:function(t){return(t.getHours()%12||12)+""},hh:function(t){return ka(t.getHours()%12||12)},H:function(t){return t.getHours()+""},HH:function(t){return ka(t.getHours())},m:function(t){return t.getMinutes()+""},mm:function(t){return ka(t.getMinutes())},s:function(t){return t.getSeconds()+""},ss:function(t){return ka(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)+""},SS:function(t){return ka(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return ka(t.getMilliseconds(),3)},a:function(t,e){return 12>t.getHours()?e.amPm[0]:e.amPm[1]},A:function(t,e){return 12>t.getHours()?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ka(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ka(Math.floor(Math.abs(e)/60),2)+":"+ka(Math.abs(e)%60,2)}},ba=function(t){return+t-1},Ma=[null,oa],_a=[null,sa],Sa=["isPm",sa,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],Pa=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?n:-n}return 0}],Oa={D:["day",oa],DD:["day",ua],Do:["day","\\d\\d?[^\\s]+",function(t){return parseInt(t,10)}],M:["month",oa,ba],MM:["month",ua,ba],YY:["year",ua,function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour",oa,void 0,"isPm"],hh:["hour",ua,void 0,"isPm"],H:["hour",oa],HH:["hour",ua],m:["minute",oa],mm:["minute",ua],s:["second",oa],ss:["second",ua],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond",ua,function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:Ma,dd:Ma,ddd:_a,dddd:_a,MMM:["month",sa,ha("monthNamesShort")],MMMM:["month",sa,ha("monthNames")],a:Sa,A:Sa,ZZ:Pa,Z:Pa},Ca={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Aa=function(t){return fa(Ca,t)},Ta=function(t,e,n){if(void 0===e&&(e=Ca.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw Error("Invalid Date pass to format");var r=[];e=(e=Ca[e]||e).replace(la,(function(t,e){return r.push(e),"@@@"}));var i=fa(fa({},ga),n);return(e=e.replace(aa,(function(e){return wa[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))};function Da(t,e,n){if(void 0===n&&(n={}),"string"!=typeof e)throw Error("Invalid format in fecha parse");if(e=Ca[e]||e,t.length>1e3)return null;var r={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],a=[],o=e.replace(la,(function(t,e){return a.push(xa(e)),"@@@"})),u={},s={};o=xa(o).replace(aa,(function(t){var e=Oa[t],n=e[0],r=e[1],a=e[3];if(u[n])throw Error("Invalid format. "+n+" specified twice in format");return u[n]=!0,a&&(s[a]=!0),i.push(e),"("+r+")"})),Object.keys(s).forEach((function(t){if(!u[t])throw Error("Invalid format. "+t+" is required in specified format")})),o=o.replace(/@@@/g,(function(){return a.shift()}));var l=t.match(RegExp(o,"i"));if(!l)return null;for(var c,h=fa(fa({},ga),n),f=1;l.length>f;f++){var p=i[f-1],d=p[0],y=p[2],v=y?y(l[f],h):+l[f];if(null==v)return null;r[d]=v}if(1===r.isPm&&null!=r.hour&&12!=+r.hour?r.hour=+r.hour+12:0===r.isPm&&12==+r.hour&&(r.hour=0),null==r.timezoneOffset){c=new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond);var g=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]];for(f=0;5>f;f++)if(u[g[f][0]]&&r[g[f][0]]!==c[g[f][1]]())return null}else if(c=new Date(Date.UTC(r.year,r.month,r.day,r.hour,r.minute-r.timezoneOffset,r.second,r.millisecond)),r.month>11||0>r.month||r.day>31||1>r.day||r.hour>23||0>r.hour||r.minute>59||0>r.minute||r.second>59||0>r.second)return null;return c}var Ea={format:Ta,parse:Da,defaultI18n:va,setGlobalDateI18n:ma,setGlobalDateMasks:Aa},ja=Object.freeze({__proto__:null,default:Ea,assign:fa,format:Ta,parse:Da,defaultI18n:va,setGlobalDateI18n:ma,setGlobalDateMasks:Aa});function Ya(t,e){return(ja.format||Ea.format)(t,e)}function Ia(t){return w(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Y(t)&&(t=t.getTime()),t}var Na=1e3,La=6e4,Ra=36e5,Fa=24*Ra,Ba=31*Fa,Xa=365*Fa,za=[["HH:mm:ss",Na],["HH:mm:ss",1e4],["HH:mm:ss",3e4],["HH:mm",La],["HH:mm",6e5],["HH:mm",18e5],["HH",Ra],["HH",6*Ra],["HH",12*Ra],["YYYY-MM-DD",Fa],["YYYY-MM-DD",4*Fa],["YYYY-WW",7*Fa],["YYYY-MM",Ba],["YYYY-MM",4*Ba],["YYYY-MM",6*Ba],["YYYY",380*Fa]];function Wa(t,e,n){var r,i=(r=function(t){return t[1]},function(t,e,n,i){for(var a=f(n)?0:n,o=f(i)?t.length:i;o>a;){var u=a+o>>>1;r(t[u])>e?o=u:a=u+1}return a})(za,(e-t)/n)-1,a=za[i];return 0>i?a=za[0]:za.length>i||(a=_(za)),a}var Ha=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return K(e,t),e.prototype.translate=function(t){t=Ia(t);var e=this.values.indexOf(t);return-1===e&&(e=A(t)&&this.values.length>t?t:NaN),e},e.prototype.getText=function(t,e){var n=this.translate(t);if(n>-1){var r=this.values[n],i=this.formatter;return r=i?i(r,e):Ya(r,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;y(e,(function(t,n){e[n]=Ia(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(ia),Va=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return K(e,t),e.prototype.scale=function(t){if(f(t))return NaN;var e=this.rangeMin(),n=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(n-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,n=M(e),r=_(e);this.min>n&&(this.min=n),r>this.max&&(this.max=r),f(this.minLimit)||(this.min=n),f(this.maxLimit)||(this.max=r)},e.prototype.setDomain=function(){var t=k(this.values),e=t.min,n=t.max;f(this.min)&&(this.min=e),f(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=s(n,(function(t){return t>=e.min&&e.max>=t}))),n},e.prototype.getScalePercent=function(t){var e=this.min;return(t-e)/(this.max-e)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(ra),Ga=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return K(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(Va);function qa(t,e){var n=Math.E;return 0>e?-1*Math.pow(n,Math.log(-e)/t):Math.pow(n,Math.log(e)/t)}function Ua(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function Za(t,e,n){f(n)&&(n=Math.max.apply(null,t));var r=n;return y(t,(function(t){t>0&&r>t&&(r=t)})),r===n&&(r=n/e),r>1&&(r=1),r}var $a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return K(e,t),e.prototype.invert=function(t){var e,n=this.base,r=Ua(n,this.max),i=this.rangeMin(),a=this.rangeMax()-i,o=this.positiveMin;if(o){if(0===t)return 0;var u=1/(r-(e=Ua(n,o/n)))*a;if(u>t)return t/u*o}else e=Ua(n,this.min);return Math.pow(n,(t-i)/a*(r-e)+e)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){t.prototype.setDomain.call(this);var e=this.min;if(0>e)throw Error("When you use log scale, the minimum value must be greater than zero!");0===e&&(this.positiveMin=Za(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;if(0>=t)return 0;var r=this.base,i=this.positiveMin;return i&&(n=1*i/r),i>t?t/i/(Ua(r,e)-Ua(r,n)):(Ua(r,t)-Ua(r,n))/(Ua(r,e)-Ua(r,n))},e}(Va),Ja=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="pow",e}return K(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t),n=this.exponent,r=qa(n,this.max),i=qa(n,this.min),a=e*(r-i)+i,o=0>a?-1:1;return Math.pow(a,n)*o},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var r=this.exponent;return(qa(r,t)-qa(r,n))/(qa(r,e)-qa(r,n))},e}(Va),Ka=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return K(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),r=this.formatter;return r?r(n,e):Ya(n,this.mask)},e.prototype.scale=function(e){var n=e;return(w(n)||Y(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return Ia(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if(f(e)&&A(e)||(this.min=this.translate(this.min)),f(n)&&A(n)||(this.max=this.translate(this.max)),t&&t.length){var r=[],i=1/0,a=i,o=0;y(t,(function(t){var e=Ia(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(a=i,i=e):a>e&&(a=e),e>o&&(o=e),r.push(e)})),t.length>1&&(this.minTickInterval=a-i),f(e)&&(this.min=i),f(n)&&(this.max=o)}},e}(Ga),Qa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return K(e,t),e.prototype.invert=function(t){var e=this.ticks,n=e.length,r=this.getInvertPercent(t),i=Math.floor(r*(n-1));if(i>=n-1)return _(e);if(0>i)return M(e);var a=e[i],o=i/(n-1);return a+(r-o)/((i+1)/(n-1)-o)*(e[i+1]-a)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||(_(e)!==this.max&&e.push(this.max),M(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<M(e))return 0;if(t>_(e))return 1;var n=0;return y(e,(function(e,r){if(e>t)return!1;n=r})),n/(e.length-1)},e}(Va),to=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return K(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(Qa),eo={};function no(t){return eo[t]}function ro(t,e){if(no(t))throw Error("type '"+t+"' existed.");eo[t]=e}var io=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return K(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&A(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return e[0]>t||t>e[1]?NaN:this.values[0]},e}(ra);function ao(t){var e=t.values,n=t.tickInterval,r=t.tickCount,i=t.showLast;if(A(n)){var a=s(e,(function(t,e){return e%n==0})),o=_(e);return i&&_(a)!==o&&a.push(o),a}var u=e.length,l=t.min,c=t.max;if(f(l)&&(l=0),f(c)&&(c=e.length-1),!A(r)||r>=u)return e.slice(l,c+1);if(0>=r||0>=c)return[];for(var h=1===r?u:Math.floor(u/(r-1)),p=[],d=l,y=0;r>y&&d<c;y++)d=Math.min(l+y*h,c),p.push(y===r-1&&i?e[c]:e[d]);return p}var oo=Math.sqrt(50),uo=Math.sqrt(10),so=Math.sqrt(2),lo=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,n;void 0===t&&(t=5);var r,i=this._domain.slice(),a=0,o=this._domain.length-1,u=this._domain[a],s=this._domain[o];return u>s&&(u=(e=[s,u])[0],s=e[1],a=(n=[o,a])[0],o=n[1]),(r=co(u,s,t))>0?r=co(u=Math.floor(u/r)*r,s=Math.ceil(s/r)*r,t):0>r&&(r=co(u=Math.ceil(u*r)/r,s=Math.floor(s*r)/r,t)),r>0?(i[a]=Math.floor(u/r)*r,i[o]=Math.ceil(s/r)*r,this.domain(i)):0>r&&(i[a]=Math.ceil(u*r)/r,i[o]=Math.floor(s*r)/r,this.domain(i)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,n){var r,i,a,o,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];(r=t>e)&&(i=t,t=e,e=i);if(0===(o=co(t,e,n))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),a=Array(i=Math.ceil((e=Math.floor(e/o))-t+1));++u<i;)a[u]=(t+u)*o;else for(a=Array(i=Math.ceil((t=Math.floor(t*o))-(e=Math.ceil(e*o))+1));++u<i;)a[u]=(t-u)/o;r&&a.reverse();return a}(this._domain[0],this._domain[this._domain.length-1],t||5)},t}();function co(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return 0>i?-Math.pow(10,-i)/(oo>a?uo>a?so>a?1:2:5:10):(oo>a?uo>a?so>a?1:2:5:10)*Math.pow(10,i)}function ho(t,e,n){return("ceil"===n?Math.ceil(t/e):"floor"===n?Math.floor(t/e):Math.round(t/e))*e}function fo(t,e,n){var r=ho(t,n,"floor"),i=ho(e,n,"ceil");r=C(r,n),i=C(i,n);for(var a=[],o=Math.max((i-r)/4095,n),u=r;i>=u;u+=o){var s=C(u,o);a.push(s)}return{min:r,max:i,ticks:a}}function po(t,e,n){var r,i=t.minLimit,a=t.maxLimit,o=t.min,u=t.max,s=t.tickCount,l=void 0===s?5:s,c=f(i)?f(e)?o:e:i,h=f(a)?f(n)?u:n:a;if(c>h&&(h=(r=[c,h])[0],c=r[1]),2>=l)return[c,h];for(var p=(h-c)/(l-1),d=[],y=0;l>y;y++)d.push(c+p*y);return d}function yo(t){return 1e-15>Math.abs(t)?t:parseFloat(t.toFixed(15))}var vo=[1,5,2,2.5,4,3],go=100*Number.EPSILON;function mo(t,e,n,r,i,a){var o=$(e),u=z(e,t),s=0,l=function(t,e){return(t%e+e)%e}(r,a);return l>=go&&a-l>=go||r>0||0>i||(s=1),1-u/(o-1)-n+s}function xo(t,e,n){var r=$(e);return 1-z(e,t)/(r-1)-n+1}function ko(t,e,n,r,i,a){var o=(t-1)/(a-i),u=(e-1)/(Math.max(a,r)-Math.min(n,i));return 2-Math.max(o/u,u/o)}function wo(t,e){return e>t?1:2-(t-1)/(e-1)}function bo(t,e,n,r){var i=e-t;return 1-.5*(Math.pow(e-r,2)+Math.pow(t-n,2))/Math.pow(.1*i,2)}function Mo(t,e,n){var r=e-t;return n>r?1-Math.pow((n-r)/2,2)/Math.pow(.1*r,2):1}function _o(t,e,n,r,i,a){void 0===n&&(n=5),void 0===r&&(r=!0),void 0===i&&(i=vo),void 0===a&&(a=[.25,.2,.5,.05]);var o=0>n?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!o)return{min:0,max:0,ticks:[]};if(1e-15>e-t||1===o)return{min:t,max:e,ticks:[t]};if(e-t>1e148){var u=(e-t)/(k=n||5);return{min:t,max:e,ticks:Array(k).fill(null).map((function(e,n){return yo(t+u*n)}))}}for(var s={score:-2,lmin:0,lmax:0,lstep:0},l=1;1/0>l;){for(var c=0;i.length>c;c+=1){var h=i[c],f=xo(h,i,l);if(s.score>a[0]*f+a[1]+a[2]+a[3]){l=1/0;break}for(var p=2;1/0>p;){var d=wo(p,o);if(s.score>a[0]*f+a[1]+a[2]*d+a[3])break;for(var y=Math.ceil(Math.log10((e-t)/(p+1)/l/h));1/0>y;){var v=l*h*Math.pow(10,y),g=Mo(t,e,v*(p-1));if(s.score>a[0]*f+a[1]*g+a[2]*d+a[3])break;var m=Math.floor(e/v)*l-(p-1)*l,x=Math.ceil(t/v)*l;if(x>=m)for(var k=x-m,w=0;k>=w;w+=1){var b=(m+w)*(v/l),S=b+v*(p-1),P=v,O=mo(h,i,l,b,S,P),C=bo(t,e,b,S),A=ko(p,o,t,e,b,S),T=a[0]*O+a[1]*C+a[2]*A+1*a[3];s.score>=T||r&&(b>t||e>S)||(s.lmin=b,s.lmax=S,s.lstep=P,s.score=T)}y+=1}p+=1}}l+=1}var D=yo(s.lmax),E=yo(s.lmin),j=yo(s.lstep),Y=Math.floor(function(t){return Math.round(1e12*t)/1e12}((D-E)/j))+1,I=Array(Y);I[0]=yo(E);for(c=1;Y>c;c++)I[c]=yo(I[c-1]+j);return{min:Math.min(t,M(I)),max:Math.max(e,_(I)),ticks:I}}function So(t,e,n){if(void 0===n&&(n=5),t===e)return{max:e,min:t,ticks:[t]};var r=0>n?0:Math.round(n);if(0===r)return{max:e,min:t,ticks:[]};var i=(e-t)/r,a=Math.pow(10,Math.floor(Math.log10(i))),o=a;1.5*(i-o)>2*a-i&&2.75*(i-(o=2*a))>5*a-i&&1.5*(i-(o=5*a))>10*a-i&&(o=10*a);for(var u=Math.ceil(e/o),s=Math.floor(t/o),l=Math.max(u*o,e),c=Math.min(s*o,t),h=Math.floor((l-c)/o)+1,f=Array(h),p=0;h>p;p++)f[p]=yo(c+p*o);return{min:c,max:l,ticks:f}}function Po(t,e){var n=t.length*e;return 1===e?t[t.length-1]:0===e?t[0]:n%1!=0?t[Math.ceil(n)-1]:t.length%2==0?(t[n-1]+t[n])/2:t[n]}function Oo(t){return new Date(t).getFullYear()}function Co(t){return new Date(t,0,1).getTime()}function Ao(t){return new Date(t).getMonth()}function To(t,e){return new Date(t,e,1).getTime()}na("cat",ao),na("time-cat",(function(t){return ao(tt({showLast:!0},t))})),na("wilkinson-extended",(function(t){var e=t.min,n=t.max,r=t.tickInterval,i=t.minLimit,a=t.maxLimit,o=_o(e,n,t.tickCount,t.nice).ticks;return f(i)&&f(a)?r?fo(e,n,r).ticks:o:po(t,M(o),_(o))})),na("r-pretty",(function(t){var e=t.min,n=t.max,r=t.tickInterval,i=t.minLimit,a=t.maxLimit,o=So(e,n,t.tickCount).ticks;return f(i)&&f(a)?r?fo(e,n,r).ticks:o:po(t,M(o),_(o))})),na("time",(function(t){var e=t.min,n=t.max,r=t.minTickInterval,i=t.tickInterval,a=t.tickCount;if(i)a=Math.ceil((n-e)/i);else{var o=(n-e)/(i=Wa(e,n,a)[1])/a;o>1&&(i*=Math.ceil(o)),r&&r>i&&(i=r)}i=Math.max(Math.floor((n-e)/4095),i);for(var u=[],s=e;n+i>s;s+=i)u.push(s);return u})),na("time-pretty",(function(t){var e=t.min,n=t.max,r=t.minTickInterval,i=t.tickInterval,a=[];i||(i=(n-e)/t.tickCount,r&&r>i&&(i=r)),i=Math.max(Math.floor((n-e)/4095),i);var o=Oo(e);if(i>Xa)for(var u=Oo(n),s=Math.ceil(i/Xa),l=o;u+s>=l;l+=s)a.push(Co(l));else if(i>Ba){var c=Math.ceil(i/Ba),h=Ao(e),f=function(t,e){var n=Oo(t),r=Oo(e),i=Ao(t);return 12*(r-n)+(Ao(e)-i)%12}(e,n);for(l=0;f+c>=l;l+=c)a.push(To(o,l+h))}else if(i>Fa){var p=(m=new Date(e)).getFullYear(),d=m.getMonth(),y=m.getDate(),v=Math.ceil(i/Fa),g=function(t,e){return Math.ceil((e-t)/Fa)}(e,n);for(l=0;g+v>l;l+=v)a.push(new Date(p,d,y+l).getTime())}else if(i>Ra){p=(m=new Date(e)).getFullYear(),d=m.getMonth(),v=m.getDate();var m,x=m.getHours(),k=Math.ceil(i/Ra),w=function(t,e){return Math.ceil((e-t)/Ra)}(e,n);for(l=0;w+k>=l;l+=k)a.push(new Date(p,d,v,x+l).getTime())}else if(i>La){var b=function(t,e){return Math.ceil((e-t)/6e4)}(e,n),M=Math.ceil(i/La);for(l=0;b+M>=l;l+=M)a.push(e+l*La)}else{var _=i;Na>_&&(_=Na);var S=Math.floor(e/Na)*Na,P=Math.ceil((n-e)/Na),O=Math.ceil(_/Na);for(l=0;P+O>l;l+=O)a.push(S+l*Na)}return 512>a.length||console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+i+") is too small, increase the value to solve the problem!"),a})),na("log",(function(t){var e,n=t.base,r=t.tickCount,i=t.min,a=t.max,o=t.values,u=Ua(n,a);if(i>0)e=Math.floor(Ua(n,i));else{var s=Za(o,n,a);e=Math.floor(Ua(n,s))}for(var l=Math.ceil((u-e)/r),c=[],h=e;u+l>h;h+=l)c.push(Math.pow(n,h));return i>0||c.unshift(0),c})),na("pow",(function(t){var e=t.exponent,n=t.tickCount,r=Math.ceil(qa(e,t.max));return So(Math.floor(qa(e,t.min)),r,n).ticks.map((function(t){var n=0>t?-1:1;return Math.pow(t,e)*n}))})),na("quantile",(function(t){var e=t.tickCount,n=t.values;if(!n||!n.length)return[];for(var r=n.slice().sort((function(t,e){return t-e})),i=[],a=0;e>a;a++){i.push(Po(r,a/(e-1)))}return i})),na("d3-linear",(function(t){var e=t.min,n=t.max,r=t.tickInterval,i=t.minLimit,a=t.maxLimit,o=function(t){var e=t.min,n=t.max,r=t.nice,i=t.tickCount,a=new lo;return a.domain([e,n]),r&&a.nice(i),a.ticks(i)}(t);return f(i)&&f(a)?r?fo(e,n,r).ticks:o:po(t,M(o),_(o))})),ro("cat",ia),ro("category",ia),ro("identity",io),ro("linear",Ga),ro("log",$a),ro("pow",Ja),ro("time",Ka),ro("timeCat",Ha),ro("quantize",Qa),ro("quantile",to);var Do=function(t){var e=t.values,n=t.tickCount;if(!n)return e;if(1>=e.length)return e;for(var r=Math.floor(e.length/(n-1))||1,i=[],a=0;e.length>a;a+=r)i.push(e[a]);var o=e[e.length-1];return i[i.length-1]!==o&&(n>i.length?i.push(o):i[i.length-1]=o),i},Eo=[1,1.2,1.5,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10];function jo(t){var e=1;if(0===(t=Math.abs(t)))return e;if(1>t){for(var n=0;1>t;)e/=10,t*=10,n++;return(""+e).length>12&&(e=parseFloat(e.toFixed(n))),e}for(;t>10;)e*=10,t/=10;return e}function Yo(t,e,n,r){for(var i=!1,a=Eo[t],o=t;Eo.length>o;o++)if(Io({interval:Eo[o],tickCount:e,max:r,min:n})){a=Eo[o],i=!0;break}return i?a:10*Yo(0,e,n/10,r/10)}function Io(t){var e=t.interval,n=t.tickCount;return t.max<=Math.floor(t.min/e)*e+(n-1)*e}function No(t){var e=""+t,n=e.indexOf("."),r=e.indexOf("e-"),i=0>r?e.substr(n+1).length:parseInt(e.substr(r+2),10);return i>20&&(i=20),i}function Lo(t,e){return parseFloat(t.toFixed(e))}na("cat",Do),na("time-cat",Do),na("wilkinson-extended",(function(t){var e=t||{},n=e.tickCount,r=e.tickInterval,i=t||{},a=i.min,o=i.max;a=isNaN(a)?0:a,o=isNaN(o)?0:o;var u=n&&n>=2?n:5,s=r||function(t){var e=t.tickCount,n=t.min,r=t.max;if(n===r)return 1*jo(r);for(var i=(r-n)/(e-1),a=jo(i),o=i/a,u=r/a,s=n/a,l=0,c=0;Eo.length>c;c++){if(Eo[c]>=o){l=c;break}}var h=Yo(l,e,s,u),f=No(h)+No(a);return Lo(h*a,f)}({tickCount:u,max:o,min:a}),l=Math.floor(a/s)*s;r&&(u=Math.max(u,Math.abs(Math.ceil((o-l)/r))+1));for(var c=[],h=0,f=No(s);u>h;)c.push(Lo(l+h*s,f)),h++;return c}));var Ro=function(){function t(e){at(this,t),this.data=e,this.options={},this.scales={}}return ut(t,[{key:"_getType",value:function(t){var e=t.type,n=t.values,r=t.field;return e||(A(r)||f(n[0])&&r?"identity":"number"==typeof n[0]?"linear":"cat")}},{key:"_getOption",value:function(t){var e=t.values,n=t.field,r=t.justifyContent,i=this._getType(t);if(t.type=i,"identity"===i)return t.field=""+n,t.values=[n],t;if("linear"===i){"boolean"!=typeof t.nice&&(t.nice=!0);var a=k(e),o=a.min,u=a.max;return f(t.min)&&(t.min=o),f(t.max)&&(t.max=u),t.values=e.sort((function(t,e){return t-e})),t}if("cat"===i||"timeCat"===i){if(t.range)return t;var s=e.length,l=[0,1];if(1===s)l=[.5,1];else if(r){var c=1/s*.5;l=[c,1-c]}else{l=[0,1-1/s]}t.range=l}return t}},{key:"createScale",value:function(t){var e=t.type;return h(e)?new e(t):new(no(e))(t)}},{key:"setScale",value:function(t,e){var n=this.options,r=this.scales;n[t]=R({},n[t],e),r[t]&&delete r[t]}},{key:"create",value:function(t){this.update(t)}},{key:"update",value:function(t){var e=this;t&&(y(t,(function(t,n){e.setScale(n,t)})),this.scales=o({},this.scales))}},{key:"changeData",value:function(t){this.data=t,this.scales={}}},{key:"getData",value:function(){return this.data}},{key:"getScale",value:function(t){var e=this.scales,n=this.data,r=e[t];if(r)return r;var i=this.options[t];if(!i)return null;var a=i.values?i.values:n?b(n,t):[],u=this._getOption(o(o({},i),{},{field:t,values:a})),s=this.createScale(u);return e[t]=s,s}},{key:"getScales",value:function(){var t=this,e=this.scales;return y(this.options,(function(e,n){t.getScale(n)})),e}},{key:"adjustStartZero",value:function(t){var e=t.max,n=this.options[t.field];n&&n.min||(t.min>0?t.change({min:0}):0>e&&t.change({max:0}))}},{key:"adjustPieScale",value:function(t){var e=this.options[t.field];if(e&&!f(e.nice))return null;t.change({nice:!1})}},{key:"getZeroValue",value:function(t){var e=t.min,n=t.max;return t.scale(0>e?n>0?0:n:e)}}]),t}(),Fo=function(t){ft(n,t);var e=wt(n);function n(t,r,i){var a;at(this,n),(a=e.call(this,t,r,i)).componentsPosition=[];var o=t.data,u=t.coord,s=t.scale,l=void 0===s?[]:s;a.layoutController=new Wi,a.coordController=new Qi,a.scaleController=new Ro(o),a.scale=a.scaleController;var c=ct(a),h=c.layoutController,f=c.coordController,p=c.scaleController,d=a.getStyle(t,r);return a.layout=h.create(d),a.coord=f.create(u,a.layout),p.create(l),a.data=o,a.state={filters:{}},a}return ut(n,[{key:"willReceiveProps",value:function(t,e){var n=this.layoutController,r=this.coordController,i=this.scaleController,a=this.props,o=t.data,u=t.scale,s=a.data,l=a.scale;if(!Qe(t.style,a.style)||e!==this.context){var c=this.getStyle(t,e);this.layout=n.create(c),r.updateLayout(this.layout)}o!==s&&i.changeData(o),Qe(u,l)||i.update(u)}},{key:"willUpdate",value:function(){this.coord=this.coordController.create(this.props.coord,this.layout)}},{key:"getStyle",value:function(t,e){var n=t.style;return(0,e.px2hd)(o(o({left:e.left,top:e.top,width:e.width,height:e.height},e.theme.chart),n))}},{key:"layoutCoord",value:function(t){var e=this.coord,n=t.width,r=t.height,i=e.left,a=e.top,o=e.width,u=e.height;switch(t.position){case"left":i+=n,o=Math.max(0,o-n);break;case"right":o=Math.max(0,o-n);break;case"top":a+=r,u=Math.max(0,u-r);break;case"bottom":u=Math.max(0,u-r)}e.update({left:i,top:a,width:o,height:u})}},{key:"resetCoordLayout",value:function(){this.coord.update(this.layout)}},{key:"updateCoordLayout",value:function(t){var e=this;p(t)?t.forEach((function(t){e.layoutCoord(t)})):this.layoutCoord(t)}},{key:"updateCoordFor",value:function(t,e){var n=this;if(e){var r=this.componentsPosition,i={component:t,layout:e},a=function(t,e,n){void 0===n&&(n=0);for(var r=n;t.length>r;r++)if(e(t[r],r))return r;return-1}(r,(function(e){return e.component===t}));if(a>-1)return r.splice(a,1,i),this.resetCoordLayout(),void r.forEach((function(t){n.updateCoordLayout(t.layout)}));r.push(i),this.updateCoordLayout(e)}}},{key:"getGeometrys",value:function(){var t=[];return it.toArray(this.children).forEach((function(e){if(!e)return!1;var n=e.component;n&&n.isGeometry&&t.push(n)})),t}},{key:"getPosition",value:function(t){for(var e=this.getCoord(),n=this.getXScales()[0],r=n.field,i=this.getYScales(),a=i[0],o=a.field,u=0,s=i.length;s>u;u++){var l=i[u],c=l.field;if(t[c]){a=l,o=c;break}}var h=n.scale(t[r]),f=a.scale(t[o]);return e.convertPoint({x:h,y:f})}},{key:"getSnapRecords",value:function(t,e){var n=this.getGeometrys();if(n.length)return n[0].getSnapRecords(t,e)}},{key:"getLegendItems",value:function(t){var e=this.getGeometrys();if(e.length)return e[0].getLegendItems(t)}},{key:"setScale",value:function(t,e){this.scaleController.setScale(t,e)}},{key:"getScale",value:function(t){return this.scaleController.getScale(t)}},{key:"getScales",value:function(){return this.scaleController.getScales()}},{key:"getXScales",value:function(){return this.getGeometrys().map((function(t){return t.getXScale()}))}},{key:"getYScales",value:function(){return this.getGeometrys().map((function(t){return t.getYScale()}))}},{key:"getCoord",value:function(){return this.coord}},{key:"filter",value:function(t,e){this.setState({filters:o(o({},this.state.filters),{},i({},t,e))})}},{key:"_getRenderData",value:function(){var t=this.props.data,e=this.state.filters;if(!e||!Object.keys(e).length)return t;var n=t;return y(e,(function(t,e){t&&(n=n.filter((function(n){return t(n[e],n)})))})),n}},{key:"render",value:function(){var t=this,e=this.props,n=this.layout,r=this.coord,i=e.children;if(!e.data)return null;var a=this._getRenderData();return it.map(i,(function(e){return it.cloneElement(e,{chart:t,coord:r,data:a,layout:n})}))}}]),n}(st);function Bo(t,e,n){if(t===e)return!0;for(var r=0,i=n.length;i>r;r++){var a=n[r];if(t[a]!==e[a])return!1}return!0}var Xo=function(t){ft(n,t);var e=wt(n);function n(t,r){var i;at(this,n),i=e.call(this,t,r);var a=t.selection;return a?(i.state.selected=a.defaultSelected,i):xt(i)}return ut(n,[{key:"didMount",value:function(){var t=this,e=this.props,n=this.state,r=this.container.get("canvas"),i=e.selection,a=e.chart;if(i){var o=i.triggerOn;r.on(void 0===o?"click":o,(function(e){var r=t.getSnapRecords(e.points[0]),o=i.type,u=void 0===o?"single":o,s=i.cancelable,l=void 0===s||s;if(r&&r.length){var c=n.selected,h=r.map((function(t){return t.origin}));if(c&&c.length||t.setState({selected:h}),"single"===u){if(!l)return void t.setState({selected:h});var f=[];return r.forEach((function(e){t.isSelected(e)||f.push(e.origin)})),void t.setState({selected:f})}var p=a.getScales(),d=Object.keys(p),y={};c.forEach((function(t){var e=d.map((function(e){return t[e]})).join("-");y[e]=t})),r.forEach((function(t){var e=t.origin,n=d.map((function(t){return e[t]})).join("-");y[n]=y[n]?null:e}));var v=Object.keys(y).map((function(t){return y[t]})).filter(Boolean);t.setState({selected:v})}else l&&t.setState({selected:null})}))}}},{key:"willReceiveProps",value:function(t){var e=t.selection,n=this.props.selection;if(e&&n){var r=e.defaultSelected;Qe(r,n.defaultSelected)||(this.state.selected=r)}}},{key:"getSnapRecords",value:function(t){return null}},{key:"isSelected",value:function(t){var e=this.state.selected;if(!e||!e.length)return!1;for(var n=this.props.chart.getScales(),r=Object.keys(n),i=0,a=e.length;a>i;i++){if(Bo(t.origin,e[i],r))return!0}return!1}},{key:"getSelectionStyle",value:function(t){var e=this.state.selected;if(!e||!e.length)return null;var n=this.props.selection,r=n.selectedStyle,i=n.unSelectedStyle;return this.isSelected(t)?h(r)?r(t):r:h(i)?i(t):i}}]),n}(st),zo=function(){function t(t){var e=t.xField,n=t.yField,r=t.adjustNames,i=t.dimValuesMap;this.adjustNames=void 0===r?["x","y"]:r,this.xField=e,this.yField=n,this.dimValuesMap=i}return t.prototype.isAdjust=function(t){return this.adjustNames.indexOf(t)>=0},t.prototype.getAdjustRange=function(t,e,n){var r,i,a=this.yField,o=n.indexOf(e),u=n.length;return!a&&this.isAdjust("y")?(r=0,i=1):u>1?(r=n[0===o?0:o-1],i=n[o===u-1?u-1:o+1],0!==o?r+=(e-r)/2:r-=(i-e)/2,o!==u-1?i-=(i-e)/2:i+=(e-n[u-2])/2):(r=0===e?0:e-.5,i=0===e?1:e+.5),{pre:r,next:i}},t.prototype.adjustData=function(t,e){var n=this,r=this.getDimValues(e);y(t,(function(t,e){y(r,(function(r,i){n.adjustDim(i,r,t,e)}))}))},t.prototype.groupData=function(t,e){return y(t,(function(t){void 0===t[e]&&(t[e]=0)})),P(t,e)},t.prototype.adjustDim=function(t,e,n,r){},t.prototype.getDimValues=function(t){var e=this.xField,n=this.yField,r=R({},this.dimValuesMap),i=[];if(e&&this.isAdjust("x")&&i.push(e),n&&this.isAdjust("y")&&i.push(n),i.forEach((function(e){r&&r[e]||(r[e]=b(t,e).sort((function(t,e){return t-e})))})),!n&&this.isAdjust("y")){r.y=[0,1]}return r},t}(),Wo={},Ho=function(t){return Wo[t.toLowerCase()]},Vo=function(t,e){if(Ho(t))throw Error("Adjust type '"+t+"' existed.");Wo[t.toLowerCase()]=e},Go=function(t,e){return Go=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},Go(t,e)};function qo(t,e){function n(){this.constructor=t}Go(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Uo=function(){return Uo=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Uo.apply(this,arguments)},Zo=function(t){function e(e){var n=t.call(this,e)||this;n.cacheMap={},n.adjustDataArray=[],n.mergeData=[];var r=e.marginRatio,i=e.dodgeRatio,a=void 0===i?.5:i,o=e.dodgeBy,u=e.intervalPadding,s=e.dodgePadding,l=e.xDimensionLength,c=e.groupNum,h=e.defaultSize,f=e.maxColumnWidth,p=e.minColumnWidth,d=e.columnWidthRatio,y=e.customOffset;return n.marginRatio=void 0===r?.5:r,n.dodgeRatio=a,n.dodgeBy=o,n.intervalPadding=u,n.dodgePadding=s,n.xDimensionLegenth=l,n.groupNum=c,n.defaultSize=h,n.maxColumnWidth=f,n.minColumnWidth=p,n.columnWidthRatio=d,n.customOffset=y,n}return qo(e,t),e.prototype.process=function(t){var e=F(t),n=x(e),r=this.dodgeBy,i=r?function(t,e){if(!e)return[t];var n=O(t,e),r=[];for(var i in n)r.push(n[i]);return r}(n,r):e;return this.cacheMap={},this.adjustDataArray=i,this.mergeData=n,this.adjustData(i,n),this.adjustDataArray=[],this.mergeData=[],e},e.prototype.adjustDim=function(t,e,n,r){var i=this,a=this.customOffset,o=this.getDistribution(t);return y(this.groupData(n,t),(function(n,u){var s;s=1===e.length?{pre:e[0]-1,next:e[0]+1}:i.getAdjustRange(t,parseFloat(u),e),y(n,(function(e){var n=o[e[t]],u=n.indexOf(r);if(f(a))e[t]=i.getDodgeOffset(s,u,n.length);else{var l=s.pre,c=s.next;e[t]=h(a)?a(e,s):(l+c)/2+a}}))})),[]},e.prototype.getDodgeOffset=function(t,e,n){var r,i=this,a=i.dodgeRatio,o=i.marginRatio,u=i.intervalPadding,s=i.dodgePadding,l=t.pre,c=t.next,h=c-l;if(f(u)||!f(s)||0>u)if(f(s)||!f(u)||s<0)if(f(u)||f(s)||0>u||0>s){var p=h*a/n,d=o*p;r=(l+c)/2+(.5*(h-n*p-(n-1)*d)+((e+1)*p+e*d)-.5*p-.5*h)}else{r=l+this.getIntervalAndDodgeOffset(n,e)}else{r=l+this.getDodgeOnlyOffset(n,e)}else r=l+this.getIntervalOnlyOffset(n,e);return r},e.prototype.getIntervalOnlyOffset=function(t,e){var n=this,r=n.defaultSize,i=n.xDimensionLegenth,a=n.groupNum,o=n.maxColumnWidth,u=n.minColumnWidth,s=n.columnWidthRatio,l=n.intervalPadding/i,c=(1-(a-1)*l)/a*n.dodgeRatio/(t-1),h=((1-l*(a-1))/a-c*(t-1))/t;(h=f(s)?h:1/a/t*s,f(o))||(h=Math.min(h,o/i));f(u)||(h=Math.max(h,u/i));return((.5+e)*(h=r?r/i:h)+e*(c=((1-(a-1)*l)/a-t*h)/(t-1))+.5*l)*a-l/2},e.prototype.getDodgeOnlyOffset=function(t,e){var n=this,r=n.defaultSize,i=n.xDimensionLegenth,a=n.groupNum,o=n.maxColumnWidth,u=n.minColumnWidth,s=n.columnWidthRatio,l=n.dodgePadding/i,c=1*n.marginRatio/(a-1),h=((1-c*(a-1))/a-l*(t-1))/t;(h=s?1/a/t*s:h,f(o))||(h=Math.min(h,o/i));f(u)||(h=Math.max(h,u/i));return((.5+e)*(h=r?r/i:h)+e*l+.5*(c=(1-(h*t+l*(t-1))*a)/(a-1)))*a-c/2},e.prototype.getIntervalAndDodgeOffset=function(t,e){var n=this,r=n.xDimensionLegenth,i=n.groupNum,a=n.intervalPadding/r,o=n.dodgePadding/r;return((.5+e)*(((1-a*(i-1))/i-o*(t-1))/t)+e*o+.5*a)*i-a/2},e.prototype.getDistribution=function(t){var e=this.cacheMap,n=e[t];return n||(n={},y(this.adjustDataArray,(function(e,r){var i=b(e,t);i.length||i.push(0),y(i,(function(t){n[t]||(n[t]=[]),n[t].push(r)}))})),e[t]=n),n},e}(zo);var $o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qo(e,t),e.prototype.process=function(t){var e=F(t),n=x(e);return this.adjustData(e,n),e},e.prototype.adjustDim=function(t,e,n){var r=this;return y(this.groupData(n,t),(function(n,i){return r.adjustGroup(n,t,parseFloat(i),e)}))},e.prototype.getAdjustOffset=function(t){var e,n=t.pre,r=t.next,i=.05*(r-n);return(r-i-(e=n+i))*Math.random()+e},e.prototype.adjustGroup=function(t,e,n,r){var i=this,a=this.getAdjustRange(e,n,r);return y(t,(function(t){t[e]=i.getAdjustOffset(a)})),t},e}(zo),Jo=nt,Ko=function(t){function e(e){var n=t.call(this,e)||this,r=e.adjustNames,i=e.height,a=void 0===i?NaN:i,o=e.size,u=void 0===o?10:o,s=e.reverseOrder,l=void 0!==s&&s;return n.adjustNames=void 0===r?["y"]:r,n.height=a,n.size=u,n.reverseOrder=l,n}return qo(e,t),e.prototype.process=function(t){var e=this.reverseOrder,n=this.yField?this.processStack(t):this.processOneDimStack(t);return e?this.reverse(n):n},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var e=this,n=e.xField,r=e.yField,i=e.reverseOrder?this.reverse(t):t,a=new Jo,o=new Jo;return i.map((function(t){return t.map((function(t){var e,i=q(t,n,0),u=q(t,[r]),s=""+i;if(u=p(u)?u[1]:u,!f(u)){var l=0>u?o:a;l.has(s)||l.set(s,0);var c=l.get(s),h=u+c;return l.set(s,h),Uo(Uo({},t),((e={})[r]=[c,h],e))}return t}))}))},e.prototype.processOneDimStack=function(t){var e=this,n=this,r=n.xField,i=n.height,a=n.reverseOrder?this.reverse(t):t,o=new Jo;return a.map((function(t){return t.map((function(t){var n,a=t[r],u=2*e.size/i;o.has(a)||o.set(a,u/2);var s=o.get(a);return o.set(a,s+u),Uo(Uo({},t),((n={}).y=s,n))}))}))},e}(zo),Qo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qo(e,t),e.prototype.process=function(t){var e=x(t),n=this.xField,r=this.yField,i=this.getXValuesMaxMap(e),a=Math.max.apply(Math,Object.keys(i).map((function(t){return i[t]})));return V(t,(function(t){return V(t,(function(t){var e,o,u=t[r],s=t[n];if(p(u)){var l=(a-i[s])/2;return Uo(Uo({},t),((e={})[r]=V(u,(function(t){return l+t})),e))}var c=(a-u)/2;return Uo(Uo({},t),((o={})[r]=[c,u+c],o))}))}))},e.prototype.getXValuesMaxMap=function(t){var e=this,n=this.xField,r=this.yField;return function(t,e){void 0===e&&(e=G);var n={};return d(t)&&!f(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}(P(t,(function(t){return t[n]})),(function(t){return e.getDimMaxValue(t,r)}))},e.prototype.getDimMaxValue=function(t,e){var n=V(t,(function(t){return q(t,e,[])})),r=x(n);return Math.max.apply(Math,r)},e}(zo);Vo("Dodge",Zo),Vo("Jitter",$o),Vo("Stack",Ko),Vo("Symmetric",Qo);var tu=function(){function t(e){at(this,t),R(this,e);var n=this.field,r=this.data;if(!this.scale&&r){var i=b(r,n);this.scale=this.createScale({values:i,field:n})}}return ut(t,[{key:"createScale",value:function(t){return null}},{key:"_mapping",value:function(t){return t}},{key:"update",value:function(t){R(this,t)}},{key:"setRange",value:function(t){this.range=t}},{key:"normalize",value:function(t){var e=this.scale;return p(t)?t.map((function(t){return e.scale(t)})):e.scale(t)}},{key:"convert",value:function(t){return t}},{key:"mapping",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=h(this.callback)?this.callback(t,e):null;return f(n)?this._mapping(t):n}}]),t}(),eu=function(t){ft(n,t);var e=wt(n);function n(t){var r;return at(this,n),(r=e.call(this,t))._updateInterpolate(),r}return ut(n,[{key:"createScale",value:function(t){return new Ga(t)}},{key:"_updateInterpolate",value:function(){var t=Ze(this.range,2);this.interpolate=Vn(t[0],t[1])}},{key:"update",value:function(t){Gi(dt(n.prototype),"update",this).call(this,t),this._updateInterpolate()}},{key:"_mapping",value:function(t){var e=this.scale,n=this.interpolate;return p(t)?t.map((function(t){return n(e.scale(t))})):n(e.scale(t))}},{key:"normalize",value:function(t){var e=this.scale;return p(t)?t.map((function(t){return e.scale(t)})):e.scale(t)}},{key:"convert",value:function(t){var e=Ze(this.range,2),n=e[0],r=e[1];return p(t)?t.map((function(t){return n+(r-n)*t})):n+(r-n)*t}}]),n}(tu),nu=function(t){ft(n,t);var e=wt(n);function n(){return at(this,n),e.apply(this,arguments)}return ut(n,[{key:"createScale",value:function(t){return new ia(t)}},{key:"_mapping",value:function(t){var e=this.scale,n=this.range;if("cat"===e.type)return n[e.translate(t)%n.length];var r=e.scale(t);return n[Math.round(r*(n.length-1))]}}]),n}(tu),ru=function(t){ft(n,t);var e=wt(n);function n(){return at(this,n),e.apply(this,arguments)}return ut(n,[{key:"createScale",value:function(t){return new io(t)}},{key:"_mapping",value:function(){var t=this.range;return this.field||t&&t[0]}}]),n}(tu),iu=Object.freeze({__proto__:null,Attr:tu,Linear:eu,Category:nu,Identity:ru}),au=ru,ou=eu,uu=nu,su=["x","y","color","size","shape"],lu=["color","size","shape"];function cu(t,e){return new t.constructor(o(o({},t.__cfg__),e))}var hu=function(){function t(e,n){at(this,t),this.scaleController=e,this.attrsRange=n,this.options={},this.attrs={}}return ut(t,[{key:"parseOption",value:function(t,e){return t?w(t)?{field:t,type:"category"}:A(t)&&"size"===e?{type:"identity",field:t}:p(t)?{field:t[0],range:t[1]}:t:{type:"identity"}}},{key:"getAttrOptions",value:function(t,e){var n=this;if(!t.x||!t.y)throw Error("x, y are required !");var r={},i=this.attrsRange;su.forEach((function(e){if(t[e]){var a=n.parseOption(t[e],e);a.range||(a.range=i[e]),r[e]=a}}));var a=r.x,o=r.y;return a.justifyContent=e,a.type=ou,o.type=ou,r}},{key:"getDefaultAttrValues",value:function(){var t=this.attrsRange,e=t.shape;return{color:t.color[0],shape:e&&e[0]}}},{key:"getGroupScales",value:function(){var t=this.attrs,e=[];return y(lu,(function(n){var r=t[n];if(r){var i=r.scale;i&&i.isCategory&&-1===e.indexOf(i)&&e.push(i)}})),e}},{key:"createAttr",value:function(t){var e=t.type,n=t.field,r=t.scale;if(f(n)||e===au)return new au(t);var i=this.scaleController.getScale(n),a=o(o({},t),{},{data:this.scaleController.getData(),scale:r?cu(i,r):i});if(i&&"identity"===i.type)return new au(a);var u=i.isLinear?ou:uu;return h(e)&&(u=e),w(e)&&iu[D(e)]&&(u=iu[D(e)]),new u(a)}},{key:"create",value:function(t){this.update(t)}},{key:"update",value:function(t){var e=this.scaleController,n=this.options,r=this.attrs,i={};y(t,(function(t,a){Qe(t,n[a])&&(i[a]=r[a]);var o=t.field;o&&e.setScale(o,{justifyContent:t.justifyContent})})),this.options=t,this.attrs=i}},{key:"getAttr",value:function(t){var e=this.attrs,n=e[t];if(n)return n;var r=this.options[t];if(!r)return null;var i=this.createAttr(r);return e[t]=i,i}},{key:"getAttrs",value:function(){var t=this,e=this.attrs;return y(this.options,(function(e,n){t.getAttr(n)})),e}},{key:"isGroupAttr",value:function(t){return-1!==lu.indexOf(t)}},{key:"getAttrsByLinear",value:function(){var t=this.attrs,e=[],n=[];return Object.keys(t).forEach((function(r){if("x"!==r&&"y"!==r){var i=t[r].scale;i&&"linear"===i.type?e.push(r):n.push(r)}else e.push(r)})),{linearAttrs:e,nonlinearAttrs:n}}}]),t}(),fu=["field"],pu="origin",du=function(t){ft(n,t);var e=wt(n);function n(t,r){var i;at(this,n),(i=e.call(this,t,r)).isGeometry=!0,i.justifyContent=!1,i.startOnZero=!1,i.connectNulls=!1,i.sortable=!1,R(ct(i),i.getDefaultCfg());var a=t.chart,o=t.coord,u=i._getThemeAttrsRange();i.attrController=new hu(a.scale,u);var s=ct(i),l=s.attrController,c=s.justifyContent,h=l.getAttrOptions(t,!o.isCyclic()||c);return l.create(h),i}return ut(n,[{key:"getDefaultCfg",value:function(){return{}}},{key:"willReceiveProps",value:function(t){Gi(dt(n.prototype),"willReceiveProps",this).call(this,t);var e=this.props,r=this.attrController,i=this.justifyContent,a=t.data,o=t.adjust,u=t.zoomRange,s=e.data,l=e.adjust,c=e.zoomRange,h=!t.coord.isCyclic()||i,f=r.getAttrOptions(t,h);Qe(f,r.getAttrOptions(e,h))||(r.update(f),this.records=null),a!==s&&(this.records=null),o!==l&&(this.records=null),Qe(u,c)||(this.records=null)}},{key:"willMount",value:function(){this._createAttrs(),this.records||this._processData()}},{key:"willUpdate",value:function(){this._createAttrs(),this.records||this._processData()}},{key:"didMount",value:function(){Gi(dt(n.prototype),"didMount",this).call(this),this._initEvent()}},{key:"_createAttrs",value:function(){var t=this.attrController;t.attrs={},this.attrs=t.getAttrs()}},{key:"_getThemeAttrsRange",value:function(){var t=this.props.coord,e=this.context.theme;return{x:t.x,y:t.y,color:e.colors,size:e.sizes,shape:e.shapes[this.geomType]}}},{key:"_adjustScales",value:function(){var t=this.attrs,e=this.props,n=e.chart,r=e.startOnZero,i=e.coord,a=e.adjust,o=i.isPolar,u=i.transposed,s=t.y,l=s.field;(void 0===r?this.startOnZero:r)&&n.scale.adjustStartZero(t.y.scale);o&&u&&("stack"===a||"stack"===(null==a?void 0:a.type))&&n.scale.adjustPieScale(t.y.scale);"stack"!==a&&"stack"!==(null==a?void 0:a.type)||this._updateStackRange(l,s.scale,this.dataArray)}},{key:"_groupData",value:function(t){var e=this.attrController.getGroupScales();if(!e.length)return[{children:t}];var n=[];e.forEach((function(t){n.push(t.field)}));var r=O(t,n),i=[];for(var a in r)i.push({key:a.replace(/^_/,""),children:r[a]});return i}},{key:"_saveOrigin",value:function(t){for(var e=t.length,n=Array(e),r=0;e>r;r++){var a=t[r];n[r]=o(o({},a),{},i({},pu,a))}return n}},{key:"_numberic",value:function(t){for(var e=this.attrs,n=[e.x.scale,e.y.scale],r=0,i=t.length;i>r;r++)for(var a=t[r],o=n.length,u=0;o>u;u++){var s=n[u];if(s.isCategory){var l=s.field;a[l]=s.translate(a[l])}}}},{key:"_adjustData",value:function(t){var e=this.attrs,n=this.props.adjust,r=t.map((function(t){return t.children}));if(!n)return r;var i="string"==typeof n?{type:n}:n,a=D(i.type),o=Ho(a);if(!o)throw Error("not support such adjust : "+n);if("Dodge"===a){for(var u=0,s=r.length;s>u;u++)this._numberic(r[u]);i.adjustNames=["x"]}var l=e.y;i.xField=e.x.field,i.yField=l.field;var c=new o(i),h=c.process(r);return this.adjust={type:i.type,adjust:c},t.forEach((function(t,e){t.children=h[e]})),h}},{key:"_updateStackRange",value:function(t,e,n){for(var r=x(n),i=1/0,a=-1/0,o=0,u=r.length;u>o;o++){var s=r[o],l=Math.min.apply(null,s[t]),c=Math.max.apply(null,s[t]);i>l&&(i=l),c>a&&(a=c)}i===e.min&&a===e.max||e.change({min:i,max:a})}},{key:"_processData",value:function(){var t=this._saveOrigin(this.props.data),e=this._groupData(t),n=this._adjustData(e);this.dataArray=n,this._adjustScales(),this.sortable&&this._sortData(e),this.records=e}},{key:"_sortData",value:function(t){var e=this.getXScale(),n=e.field,r=e.type;"identity"!==r&&e.values.length>1&&y(t,(function(t){t.children.sort((function(t,i){return"timeCat"===r?or(t.origin[n])-or(i.origin[n]):e.translate(t.origin[n])-e.translate(i.origin[n])}))}))}},{key:"_initEvent",value:function(){var t=this,e=this.props,n=this.container.get("canvas");["onPressStart","onPress","onPressEnd","onPan","onPanStart","onPanEnd"].forEach((function(r){e[r]&&n.on(r.substr(2).toLowerCase(),(function(n){n.geometry=t,e[r](n)}))}))}},{key:"getY0Value",value:function(){var t=this.props.chart,e=t.getScale(this.attrs.y.field);return t.scale.getZeroValue(e)}},{key:"_getShapeStyle",value:function(t,e){var n=this.context.theme.shape[this.geomType]||{},r=n[t],i=this.props.style,a=o(o({},n.default),r);if(!i||!d(i))return a;var u=i.field,s=Kn(i,fu),l=u?e[u]:e;return y(s,(function(t,e){a[e]=h(t)?t(l):t})),a}},{key:"_mapping",value:function(t){for(var e=this.attrs,n=this.attrController,r=this.props.coord,i=n.getAttrsByLinear(),a=i.linearAttrs,u=i.nonlinearAttrs,s=n.getDefaultAttrValues(),l=0,c=t.length;c>l;l++){var h=t[l].children,f=o({},s),p=h[0];if(0!==h.length){for(var d=0,y=u.length;y>d;d++){var v=u[d],g=e[v];f[v]=g.mapping(p[g.field])}for(var m=0,x=h.length;x>m;m++){for(var k=h[m],w={},b=0;a.length>b;b++){var M=a[b],_=e[M];n.isGroupAttr(M)?f[M]=_.mapping(k[_.field],k):w[M]=_.normalize(k[_.field])}var S=r.convertPoint({x:w.x,y:w.y}),P=f.shape;R(k,f,{normalized:w,x:S.x,y:S.y,shapeName:P,shape:this._getShapeStyle(P,k.origin),selected:this.isSelected(k)})}}}return t}},{key:"mapping",value:function(){var t=this.records;return this._mapping(t),t}},{key:"getClip",value:function(){var t=this.props,e=t.coord;return t.viewClip?{type:"rect",attrs:{x:e.left,y:e.top,width:e.width,height:e.height}}:null}},{key:"getAttr",value:function(t){return this.attrController.getAttr(t)}},{key:"getXScale",value:function(){return this.getAttr("x").scale}},{key:"getYScale",value:function(){return this.getAttr("y").scale}},{key:"_getXSnap",value:function(t){var e=this.getXScale();if(e.isCategory)return e.invert(t);var n=e.invert(t),r=e.values,i=r.length;if(1===i)return r[0];if((r[0]+r[1])/2>n)return r[0];if(n>=(r[i-2]+r[i-1])/2)return r[i-1];for(var a=1;i>a;a++)if(n>=(r[a-1]+r[a])/2&&(r[a+1]+r[a])/2>n)return r[a];return null}},{key:"_getYSnapRecords",value:function(t,e){var n=this.getYScale(),r=n.field,i=n.invert(t);return e.filter(n.isCategory?function(t){return t.origin[r]===i}:function(t){var e=t[r];return i>=e[0]&&e[1]>=i})}},{key:"flatRecords",value:function(){return this.records.reduce((function(t,e){return t.concat(e.children)}),[])}},{key:"getSnapRecords",value:function(t,e){var n=this.props,r=n.coord,i=n.adjust,a=r.invertPoint(t),u=this.getXScale(),s=this.getYScale();if(e){var l=u.range,c=s.range;a.x=Math.min(Math.max(a.x,l[0]),l[1]),a.y=Math.min(Math.max(a.y,c[0]),c[1])}var h=this.flatRecords();if("stack"===i&&r.isPolar&&r.transposed&&(a.x>=0&&1>=a.x))return this._getYSnapRecords(a.y,h);var f=[],p=this._getXSnap(a.x);if(!p)return f;for(var d=u.field,y=s.field,v=0,g=h.length;g>v;v++){var m=o(o({},h[v]),{},{xField:d,yField:y}),x=m.origin[d];("timeCat"===u.type&&or(x)===p||x===p)&&f.push(m)}return f}},{key:"getLegendItems",value:function(){var t=this.attrController.getAttr("color");if(!t)return null;var e=t.scale;if(!e.isCategory)return null;var n=e.getTicks().map((function(n){var r=n.text,i=n.tickValue,a=t.mapping(i);return{field:e.field,color:a,name:r,tickValue:i}}));return n}}]),n}(Xo),yu=n((function(t){t.exports=function(t){if(Array.isArray(t))return Ge(t)},t.exports.__esModule=!0,t.exports.default=t.exports})),vu=n((function(t){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports})),gu=n((function(t){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports})),mu=e(n((function(t){t.exports=function(t){return yu(t)||vu(t)||qe(t)||gu()},t.exports.__esModule=!0,t.exports.default=t.exports}))),xu=function(t){return function(e){ft(r,e);var n=wt(r);function r(){return at(this,r),n.apply(this,arguments)}return ut(r,[{key:"getDefaultCfg",value:function(){return{geomType:"line",sortable:!0}}},{key:"splitPoints",value:function(t){for(var e=[],n=[],r=0,i=t.length;i>r;r++){var a=t[r],u=a.x,s=a.y;e.push(o(o({},a),{},{x:u,y:s[1]})),n.push(o(o({},a),{},{x:u,y:s[0]}))}return[e,n]}},{key:"splitNulls",value:function(t,e){if(e){for(var n=[],r=0,i=t.length;i>r;r++){var a=t[r],o=a.y;if(p(o)){if(isNaN(o[0]))continue;n.push(a)}else isNaN(o)||n.push(a)}return n.length?[n]:[]}for(var u=[],s=[],l=0,c=t.length;c>l;l++){var h=t[l],f=h.y;if(p(f)){if(isNaN(f[0])){s.length&&(u.push(s),s=[]);continue}s.push(h)}else isNaN(f)?s.length&&(u.push(s),s=[]):s.push(h)}return s.length&&u.push(s),u}},{key:"mapping",value:function(){var t=this,e=Gi(dt(r.prototype),"mapping",this).call(this),n=this.props,i=n.coord,a=n.connectNulls,u=void 0===a?this.connectNulls:a;return e.map((function(e){var n=e.children,r=n[0]||{},a=r.size,s=r.color,l=r.shape,c=r.y,h=i.isPolar?[].concat(mu(n),[n[0]]):n,f=t.splitNulls(h,u).map((function(e){var n=p(c)?t.splitPoints(e):[e,void 0],r=Ze(n,2);return{size:a,color:s,shape:l,points:r[0],bottomPoints:r[1]}}));return o(o({},e),{},{children:f})}))}},{key:"render",value:function(){var e=this.props,n=e.coord,r=this.mapping(),i=this.getClip();return tr(t,o(o({},e),{},{coord:n,records:r,clip:i}))}}]),r}(du)};function ku(t,e){for(var n=t.map((function(t){return function(t){var e=t.y;return{x:t.x,y:p(e)?e[1]:e}}(t)})),r=n[0],i=r.x+(n[n.length-1].x-r.x)*e,a=1;n.length>a;a++){var o=n[a],u=n[a-1];if(i>=u.x&&o.x>=i)return{x:i,y:u.y+(o.y-u.y)*((i-u.x)/(o.x-u.x))}}}function wu(t){var e=t.appear,n=t.EndView,r=function(t){for(var e=[],n=0;t.length>n;n++)e=e.concat(t[n].points);return e}(t.record.children);return tr("group",{animation:{appear:{easing:e.easing,duration:e.duration,onFrame:function(t){var e=this.element.get("children"),n=ku(r,t);e.forEach((function(t){t.moveTo(n.x,n.y)}))}}}},tr(n,{origin:r[0].origin}))}var bu=function(t){var e=t.coord,n=t.animation,r=t.endView,i=e.center,a=e.startAngle,u=e.isPolar?{easing:"quadraticOut",duration:450,clip:{type:"sector",property:["endAngle"],attrs:{x:i.x,y:i.y,startAngle:a,r:e.radius},start:{endAngle:a},end:{endAngle:e.endAngle}}}:{easing:"quadraticOut",duration:450,clip:{type:"rect",property:["width"],attrs:{x:e.left,y:e.top,height:e.height},start:{width:0},end:{width:e.width}}};return tr("group",{attrs:{clip:t.clip}},t.records.map((function(t){return tr("group",{key:t.key},t.children.map((function(t){var e=t.color,r=t.size,i=t.shape;return tr("polyline",{attrs:o(o({points:t.points.map((function(t){return{x:t.x,y:t.y}})),stroke:e},i),{},{lineWidth:r||i.lineWidth}),animation:X({update:{easing:"linear",duration:450,property:["points"]},appear:u},n)})})),r?tr(wu,{record:t,EndView:r,appear:u}):null)})))},Mu=xu(bu),_u=function(t){return function(t){ft(n,t);var e=wt(n);function n(){return at(this,n),e.apply(this,arguments)}return ut(n,[{key:"getDefaultCfg",value:function(){return{geomType:"area",startOnZero:!0,sortable:!0}}},{key:"mapping",value:function(){var t=Gi(dt(n.prototype),"mapping",this).call(this),e=this.getY0Value(),r=this.props,i=r.coord,a=r.startOnZero,o=i.y[0];(void 0===a?this.startOnZero:a)&&(o=i.convertPoint({x:0,y:e}).y);for(var u=0,s=t.length;s>u;u++)for(var l=t[u].children,c=0,h=l.length;h>c;c++){var f=l[c],p=f.points,d=f.bottomPoints;d&&d.length?(d.reverse(),f.points=p.concat(d)):(p.push({x:p[p.length-1].x,y:o}),p.push({x:p[0].x,y:o}))}return t}}]),n}(xu(t))},Su=function(t){var e=t.coord,n=t.animation,r="smooth"===t.shape,i=e.center,a=e.startAngle,u=e.isPolar?{easing:"quadraticOut",duration:450,clip:{type:"sector",property:["endAngle"],attrs:{x:i.x,y:i.y,startAngle:a,r:e.radius},start:{endAngle:a},end:{endAngle:e.endAngle}}}:{easing:"quadraticOut",duration:450,clip:{type:"rect",property:["width"],attrs:{x:e.left,y:e.top,height:e.height},start:{width:0},end:{width:e.width}}};return tr("group",null,t.records.map((function(t){return tr("group",{key:t.key},t.children.map((function(t){var e=t.points,i=t.bottomPoints,a=t.color,s=t.shape;return r?tr("custom",{attrs:o({points:e,lineWidth:"2px",fill:a},s),createPath:function(t){var n=[[0,0],[1,1]],r=(null==i?void 0:i.length)||0,a=e.slice(0,e.length-r),o=Pt(a,!1,n);t.beginPath(),t.moveTo(a[0].x,a[0].y);for(var u=0,s=o.length;s>u;u++){var l=o[u];t.bezierCurveTo(l[1],l[2],l[3],l[4],l[5],l[6])}if(r){var c=Pt(i,!1,n);t.lineTo(i[0].x,i[0].y);for(var h=0,f=c.length;f>h;h++){var p=c[h];t.bezierCurveTo(p[1],p[2],p[3],p[4],p[5],p[6])}}t.closePath()},calculateBox:function(){return Et(e)}}):tr("polygon",{attrs:o({points:e,lineWidth:"2px",fill:a},s),animation:X({appear:u,update:{easing:"linear",duration:450,property:["points"]}},n)})})))})))},Pu=_u(Su);function Ou(t,e){return{x:(e.x-t.x)/2+t.x,y:(e.y-t.y)/2+t.y}}var Cu={textBaseline:"middle",fill:"#808080"};function Au(t){var e,n,r=t.record,i=t.offsetX,a=t.offsetY,o=t.points,u=t.label,s=t.guide,l=r.origin,c=r.color;if(h(u)){var f=4===o.length?Ou(o[1],o[2]):Ou(o[0],o[1]);e=R({x:f.x+i,y:f.y+a},Cu,u(l,c))}if(h(s)){var p,d=Ou(4===o.length?Ou(o[0],o[1]):o[0],Ou(o[2],null!==(p=o[3])&&void 0!==p?p:o[1]));n=R({x:d.x,y:d.y,textBaseline:"middle",textAlign:"center"},Cu,s(l,c))}return tr("group",null,e&&tr("text",{attrs:e}),n&&tr("text",{attrs:n}))}var Tu=Object.freeze({__proto__:null,pyramid:Au,funnel:Au}),Du=function(t){return function(e){ft(r,e);var n=wt(r);function r(){return at(this,r),n.apply(this,arguments)}return ut(r,[{key:"getDefaultCfg",value:function(){return{geomType:"interval",justifyContent:!0,startOnZero:!0}}},{key:"getDefaultSize",value:function(){var t=this.props,e=this.adjust,n=t.coord,r=t.sizeRatio,i=this.attrs.x.scale.values;if(r)return 1/i.length*r;var a=1/i.length*(n.isPolar?n.transposed&&i.length>1?3/4:.999999:.5);return e&&"dodge"===e.type?a/this.records.length:a}},{key:"mapping",value:function(){for(var t=Gi(dt(r.prototype),"mapping",this).call(this),e=this.props.coord,n=this.getY0Value(),i=this.getDefaultSize(),a=0,o=t.length;o>a;a++)for(var u=t[a].children,s=0,l=u.length;l>s;s++){var c=u[s],h=c.normalized,p=c.size;if(f(p)){var d=h.size;R(c,e.convertRect({x:h.x,y:h.y,y0:n,size:void 0===d?i:d}))}else{R(c,e.transformToRect({size:p,x:c.x,y:c.y,y0:n}))}R(c.shape,this.getSelectionStyle(c))}return t}},{key:"getPointY0",value:function(){var t=this.props.coord,e=this.getY0Value(),n=t.convertPoint({y:e,x:0});return null==n?void 0:n.y}},{key:"render",value:function(){var e=this.props,n=this.state,r=e.coord,i=e.shape,a=void 0===i?"rect":i,o=e.animation,u=e.showLabel,s=e.labelCfg,l=h(t)?t:t[a],c=Tu[a],f=X({label:null,offsetX:0,offsetY:0},s);if(!l)return null;var p=n.selected;return tr(l,{coord:r,records:this.mapping(),selected:p,shape:a,animation:o,showLabel:u,labelCfg:f,LabelView:c,y0:this.getPointY0(),clip:this.getClip()})}}]),r}(du)},Eu=function(t){var e=t.animation,n=t.y0;return tr("group",{attrs:{clip:t.clip}},t.records.map((function(t){return tr("group",{key:t.key},t.children.map((function(t){var r=t.key,i=t.xMin,a=t.xMax,u=t.yMin,s=t.yMax,l=t.color,c=t.shape;return isNaN(i)||isNaN(a)||isNaN(u)||isNaN(s)?null:tr("rect",{key:r,attrs:o({x:i,y:u,width:a-i,height:s-u,fill:l},c),animation:X({appear:{easing:"linear",duration:450,property:["y","height"],start:{y:n,height:0}},update:{easing:"linear",duration:450,property:["x","y","width","height"]}},e)})})))})))},ju=function(t){var e=t.coord,n=t.records,r=t.animation,i=e.center,a=e.startAngle,u=e.endAngle,s=e.radius;return tr("group",{animation:{appear:o(o({easing:"quadraticOut",duration:450},r&&r.appear),{},{clip:{type:"sector",property:["endAngle"],attrs:{x:i.x,y:i.y,startAngle:a,r:s},start:{endAngle:a},end:{endAngle:u}}})}},n.map((function(t){return tr("group",{key:t.key},t.children.map((function(t){return tr("sector",{key:t.key,attrs:o({x:i.x,y:i.y,fill:t.color,startAngle:t.xMin,endAngle:t.xMax,r0:t.yMin,r:t.yMax},t.shape),animation:X({update:{easing:"linear",duration:450,property:["x","y","startAngle","endAngle","r0","r"]}},r)})})))})))},Yu=function(t){return tr("rect"===t.coord.type?Eu:ju,o({},t))};function Iu(t){var e=t.xMin,n=t.xMax,r=t.yMin,i=t.yMax;return[{x:e,y:r},{x:n,y:r},{x:n,y:i},{x:e,y:i}]}var Nu=function(t){var e=t.records,n=t.shape,r=t.showLabel,i=t.labelCfg,a=t.LabelView,u=!1;return tr("group",null,e.map((function(t,s){var l=t.key,c=t.children,h=s===e.length-1,f=(h?t:e[s+1]).children,p=Iu(f[0]),d=Iu(f[f.length-1]);return u||(u=f[0].yMax>c[0].yMax),u&&(p.reverse(),d.reverse()),tr("group",{key:l},c.map((function(t,e){var r=Iu(t);return u&&r.reverse(),h?"pyramid"===n&&(r=[Ou(r[0],r[1]),r[2],r[3]]):(0===e&&(r[0]=p[3]),e===c.length-1&&(r[1]=d[2])),o(o({},t),{},{points:r})})).map((function(t){var e=t.points;return tr("group",null,tr("polygon",{attrs:o({points:e,fill:t.color},t.shape)}),r&&a?tr(a,o({record:t,points:e},i)):null)})))})))},Lu=Du(Object.freeze({__proto__:null,rect:Yu,pyramid:Nu,funnel:Nu})),Ru=function(t){return function(e){ft(r,e);var n=wt(r);function r(){return at(this,r),n.apply(this,arguments)}return ut(r,[{key:"getDefaultCfg",value:function(){return{geomType:"point"}}},{key:"render",value:function(){var e=this.props,n=e.coord,r=this.mapping(),i=this.getClip();return tr(t,o(o({},e),{},{coord:n,records:r,clip:i}))}}]),r}(du)},Fu=function(t){var e=t.animation;return tr("group",{attrs:{clip:t.clip}},t.records.map((function(t){return tr("group",{key:t.key},t.children.map((function(t){var n=t.x,r=t.y,i=t.size,a=t.color,u=t.shapeName,s=t.shape;if(isNaN(n)||isNaN(r))return null;if("rect"===u){var l=f(i)?s.size:i;return tr("rect",{attrs:o(o({x:n-l,y:r-l,fill:a,stroke:a},s),{},{width:2*l,height:2*l}),animation:X({appear:{easing:"linear",duration:450},update:{easing:"linear",duration:450,property:["x","y","width","height","fill"]}},e)})}return tr("circle",{attrs:o(o({x:n,y:r,fill:"circle"===u?a:null,stroke:"hollowCircle"===u?a:null},s),{},{r:f(i)?s.size:i}),animation:X({appear:{easing:"linear",duration:450},update:{easing:"linear",duration:450,property:["x","y","r","fill"]}},e)})})))})))},Bu=Ru(Fu),Xu=function(t){return function(e){ft(r,e);var n=wt(r);function r(t){var e;at(this,r),(e=n.call(this,t)).style={};var i=e.props,a=i.chart,o=i.field,u=e.getScaleOption(t);return a.setScale(o,u),e}return ut(r,[{key:"willReceiveProps",value:function(t){var e=this.props,n=t.chart,r=t.field,i=this.getScaleOption(t);Qe(i,this.getScaleOption(e))||n.setScale(r,i)}},{key:"willMount",value:function(){this.updateCoord()}},{key:"willUpdate",value:function(){this.updateCoord()}},{key:"getScaleOption",value:function(t){return{type:t.type,tickCount:t.tickCount,range:t.range,mask:t.mask,formatter:t.formatter,min:t.min,max:t.max,nice:t.nice}}},{key:"_getDimType",value:function(){var t=this.props,e=t.field;return t.chart.getXScales().filter((function(t){return t.field===e})).length>0?"x":"y"}},{key:"getMaxBBox",value:function(t,e){var n=this.context.measureText,r=e.label,i=e.labelOffset,a=0,u=0;return t.forEach((function(t){if(r){var e=t.labelStyle,i=void 0===e?{}:e,s=n(i.text||t.text,o(o({},r),i));a=Math.max(a,s.width),u=Math.max(u,s.height)}})),a||u?{width:a+i,height:u+i}:{width:a,height:u}}},{key:"_getPosition",value:function(){var t=this.props,e=t.position,n=t.coord;if(e)return e;var r=this._getDimType();return n.transposed?"x"===r?"left":"bottom":"x"===r?"bottom":"left"}},{key:"getTicks",value:function(){var t=this.props,e=t.chart.getScale(t.field).getTicks();return e=this._setTicksStyle(e),e=this._generateGridPoints(e)}},{key:"_generateGridPoints",value:function(t){var e=this.props,n=e.chart,r=e.coord;if(!r.isPolar)return t;if("y"!==this._getDimType())return t;var i=n.getXScales()[0].getTicks();return t.forEach((function(t){var e=i.map((function(e){return r.convertPoint({x:e.value,y:t.value})}));e.push(e[0]),t.gridPoints=e})),t}},{key:"_setTicksStyle",value:function(t){var e=this,n=this.context,r=n.px2hd,i=this.props.style,a=void 0===i?{}:i,o=n.theme.axis;return y(o,(function(t,n){if(null!==a[n]){var i=h(a[n])?void 0:a[n];e.style[n]=w(t)||A(t)?r(i)||t:r(X(F(t),i))}})),t.map((function(e,n){var i=a.label,u=a.grid,s=o.label,l=o.grid;return h(i)&&(e.labelStyle=r(R({},s,i(e.text,n,t)))),h(u)&&(e.gridStyle=r(R({},l,u(e.text,n,t.length)))),e}))}},{key:"convertTicks",value:function(t){var e=this.props.coord,n=this._getDimType(),r="x"===n?"y":"x";return t.map((function(t){var a,u,s=e.convertPoint((i(a={},n,t.value),i(a,r,0),a)),l=e.convertPoint((i(u={},n,t.value),i(u,r,1),u));return o(o({},t),{},{points:[s,l]})}))}},{key:"measureLayout",value:function(){var t=this.props,e=t.coord;if(!1===t.visible)return null;var n=this.getTicks(),r=this.getMaxBBox(n,this.style),i=e.isPolar,a=this._getDimType(),o=r.width,u=r.height;return i?"y"===a?null:["top","right","bottom","left"].map((function(t){return{position:t,width:o,height:u}})):{position:this._getPosition(),width:o,height:u}}},{key:"updateCoord",value:function(){var t=this.props.chart,e=this.measureLayout();t.updateCoordFor(this,e)}},{key:"render",value:function(){var e=this.props,n=this.style,r=e.coord;if(!1===e.visible)return null;var i=this.getTicks(),a=this._getPosition(),u=this._getDimType();return tr(t,o(o({},e),{},{style:n,ticks:this.convertTicks(i),coord:r,position:a,dimType:u}))}}]),r}(st)};function zu(t,e,n){var r=e.x-t.x,i=e.y-t.y,a=_t.length([r,i]),o=a+n;return{x:t.x+r/a*o,y:t.y+i/a*o}}function Wu(t,e){var n=[e.x-t.x,e.y-t.y];return{textAlign:n[0]>0?"left":0>n[0]?"right":"center",textBaseline:n[1]>0?"top":0>n[1]?"bottom":"middle"}}var Hu=function(t){var e=t.line,n=t.center,r=t.ticks;if(!e)return null;if("line"!==t.gridType)return tr("arc",{attrs:o({x:n.x,y:n.y,r:t.radius},e)});var i=r.map((function(t){var e=t.points;return e[e.length-1]}));return i.push(i[0]),tr("polyline",{attrs:o({points:i},e)})},Vu=function(t){var e=t.ticks,n=t.style,r=t.grid,i=t.coord.center,a=n.grid,u=n.tickLine,s=n.line,l=n.labelOffset,c=n.label,h=e[0].points,f=h[h.length-1],p=_t.length([f.x-i.x,f.y-i.y]);return tr("group",null,a?e.map((function(t){var e=t.points,n=t.gridStyle,r=e[e.length-1];return tr("line",{attrs:o(o({x1:i.x,y1:i.y,x2:r.x,y2:r.y},a),n)})})):null,u&&u.length?e.map((function(t){var e=t.points,n=e[e.length-1],r=zu(i,n,u.length);return tr("line",{attrs:o({x1:n.x,y1:n.y,x2:r.x,y2:r.y},u)})})):null,tr(Hu,{line:s,gridType:r,center:i,radius:p,ticks:e}),c?e.map((function(t){var e=t.points,n=t.text,r=t.labelStyle,a=e[e.length-1],u=zu(i,a,l);return tr("text",{attrs:o(o(o({x:u.x,y:u.y,text:n},Wu(i,a)),c),r)})})):null)},Gu=function(t){var e=t.ticks,n=t.style,r=t.grid,i=t.coord.center,a=n.grid,u=n.tickLine,s=n.line,l=n.labelOffset,c=n.label;return tr("group",null,a?e.map((function(t){var e=t.points,n=t.gridStyle,u=t.gridPoints,s=e[e.length-1];return"line"!==r?tr("arc",{attrs:o(o({x:i.x,y:i.y,r:_t.length([s.x-i.x,s.y-i.y])},a),n)}):tr("polyline",{attrs:o(o({points:u},a),n)})})):null,u&&u.length?e.map((function(t){var e=t.points,n=e[e.length-1];return tr("line",{attrs:o({x1:n.x,y1:n.y,x2:n.x-u.length,y2:n.y},u)})})):null,s?tr("line",{attrs:o({x1:e[0].points[0].x,y1:e[0].points[0].y,x2:e[e.length-1].points[0].x,y2:e[e.length-1].points[0].y},s)}):null,c?e.map((function(t){var e=t.points,n=t.labelStyle,r=e[e.length-1];return tr("text",{attrs:o(o({x:r.x-l,y:r.y,text:t.text,textAlign:"right",textBaseline:"middle"},c),n)})})):null)},qu=function(t){var e=t.ticks,n=t.coord,r=t.style,i=n.left,a=n.top,u=n.right,s=r.grid,l=r.tickLine,c=r.line,h=r.labelOffset,f=r.label;return tr("group",null,s?e.map((function(t){var e=t.points,n=t.gridStyle,r=e[0],i=e[e.length-1];return tr("line",{attrs:o(o({x1:r.x,y1:r.y,x2:i.x,y2:i.y},s),n)})})):null,l&&l.length?e.map((function(t){var e=t.points,n=e[e.length-1];return tr("line",{attrs:o({x1:n.x,y1:n.y,x2:n.x,y2:n.y-l.length},l)})})):null,c?tr("line",{attrs:o({x1:i,y1:a,x2:u,y2:a},c)}):null,f?e.map((function(t,e){var n=t.points,r=t.labelStyle,i=n[n.length-1];return tr("text",{attrs:o(o({x:i.x,y:i.y-h,textAlign:"center",textBaseline:"bottom",text:t.text},f),r)})})):null)},Uu=function(t,e){var n=t.ticks,r=t.coord,i=t.style,a=t.animation,u=e.px2hd,s=r.left,l=r.right,c=r.bottom,h=i.grid,f=i.tickLine,p=i.line,d=i.labelOffset,y=i.label;return tr("group",null,h?n.map((function(t){var e=t.points,n=t.gridStyle,r=e[0],i=e[e.length-1];return tr("line",{key:t.tickValue,attrs:o(o({x1:r.x,y1:r.y,x2:i.x,y2:i.y},h),n)})})):null,f&&f.length?n.map((function(t){var e=t.points[0];return tr("line",{key:t.tickValue,attrs:o({x1:e.x,y1:e.y,x2:e.x,y2:e.y+u(f.length)},f)})})):null,p?tr("line",{attrs:o({x1:s,y1:c,x2:l,y2:c},p)}):null,y?n.map((function(t,e){var r=t.tickValue,i=t.labelStyle,u=t.points[0],s=(i||y||{}).align,l=void 0===s?"center":s,c=o(o({x:u.x,y:u.y+d,textBaseline:"top",text:t.text},y),i);return c.textAlign="between"===l?0===e?"start":e===n.length-1?"end":"center":l,tr("text",{key:r,attrs:c,animation:a||{appear:{easing:"linear",duration:300,delay:0,property:["fillOpacity"],start:{fillOpacity:0},end:{fillOpacity:1}},update:{easing:"linear",duration:450,delay:0,property:["x","y"]},leave:{easing:"linear",duration:450,delay:0,property:["fillOpacity"],start:{fillOpacity:1},end:{fillOpacity:0}}}})})):null)},Zu=function(t){var e=t.ticks,n=t.coord,r=t.style,i=n.top,a=n.right,u=n.bottom,s=r.grid,l=r.tickLine,c=r.line,h=r.labelOffset,f=r.label;return tr("group",null,s?e.map((function(t){var e=t.points,n=t.gridStyle,r=e[0],i=e[e.length-1];return tr("line",{attrs:o(o({x1:r.x,y1:r.y,x2:i.x,y2:i.y},s),n)})})):null,l&&l.length?e.map((function(t){var e=t.points,n=e[e.length-1];return tr("line",{attrs:o({x1:n.x,y1:n.y,x2:n.x+l.length,y2:n.y},l)})})):null,c?tr("line",{attrs:o({x1:a,y1:i,x2:a,y2:u},c)}):null,f?e.map((function(t,e){var n=t.points,r=t.labelStyle,i=n[n.length-1];return tr("text",{attrs:o(o({x:i.x+h,y:i.y,textAlign:"left",textBaseline:"middle",text:t.text},f),r)})})):null)},$u=function(t){var e=t.ticks,n=t.coord,r=t.style,i=t.animation,a=n.left,u=n.top,s=n.bottom,l=r.grid,c=r.tickLine,h=r.line,f=r.labelOffset,p=r.label;return tr("group",null,l?e.map((function(t){var e=t.points,n=t.gridStyle,r=e[0],i=e[e.length-1];return tr("line",{key:t.tickValue,attrs:o(o({x1:r.x,y1:r.y,x2:i.x,y2:i.y},l),n)})})):null,c&&c.length?e.map((function(t){var e=t.points[0];return tr("line",{key:t.tickValue,attrs:o({x1:e.x,y1:e.y,x2:e.x-c.length,y2:e.y},c)})})):null,h?tr("line",{attrs:o({x1:a,y1:u,x2:a,y2:s},h)}):null,p?e.map((function(t,e){var n=t.labelStyle,r=t.points[0];return tr("text",{key:t.tickValue,attrs:o(o({x:r.x-f,y:r.y,textAlign:"right",textBaseline:"middle",text:t.text},p),n),animation:i||{appear:{easing:"linear",duration:300,delay:0,property:["fillOpacity"],start:{fillOpacity:0},end:{fillOpacity:1}},update:{easing:"linear",duration:450,delay:0,property:["x","y"]},leave:{easing:"linear",duration:450,delay:0,property:["fillOpacity"],start:{fillOpacity:1},end:{fillOpacity:0}}}})})):null)};var Ju=function(t){if(function(t){return t.coord.isPolar}(t))return tr("x"===t.dimType?Vu:Gu,o({},t));var e=t.position;return tr("right"===e?Zu:"left"===e?$u:"top"===e?qu:Uu,o({},t))},Ku=Xu(Ju),Qu=function(t){return function(e){ft(r,e);var n=wt(r);function r(t){var e;return at(this,r),(e=n.call(this,t)).state={filtered:{},items:[]},e}return ut(r,[{key:"getOriginItems",value:function(){return this.props.chart.getLegendItems()}},{key:"getItems",value:function(){var t,e=this.props,n=this.state.filtered,r=(null===(t=e.items)||void 0===t?void 0:t.length)?e.items:this.getOriginItems();return r?r.map((function(t){var e=t.tickValue;return o(o({},t),{},{filtered:n[e]})})):null}},{key:"setItems",value:function(t){this.setState({items:t})}},{key:"getMaxItemBox",value:function(t){var e=0,n=0;return(t.get("children")||[]).forEach((function(t){var r=t.get("attrs"),i=r.height;e=Math.max(e,r.width),n=Math.max(n,i)})),{width:e,height:n}}},{key:"_init",value:function(){var t=this.props,e=this.context,n=t.layout,r=t.width,i=t.height,a=t.position,o=void 0===a?"top":a,u=this.getItems();if(u&&u.length){var s=n.left,l=n.top,c=n.right,h=n.bottom,f=n.width,p=n.height,d=e.px2hd(r)||f,y=Ei(this,this.render(),!1),v=this.getMaxItemBox(y),g=v.width,m=v.height,x=Math.floor(d/g),k=Math.ceil(u.length/x),w=d/x,b=m*k,M={left:s,top:l,width:d,height:void 0,flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-start"};1===k&&(M.justifyContent="space-between"),"top"===o&&(M.height=i||b),"left"===o&&(M.flexDirection="column",M.justifyContent="center",M.width=g,M.height=i||p),"right"===o&&(M.flexDirection="column",M.alignItems="flex-start",M.justifyContent="center",M.width=g,M.height=i||p,M.left=c-g),"bottom"===o&&(M.top=h-b,M.height=i||b),this.itemWidth=w,this.style=M,y.remove()}}},{key:"updateCoord",value:function(){var t=this.props,e=this.style,n=t.position,r=void 0===n?"top":n,i=t.margin,a=t.chart,o=e.width,u=e.height,s=this.context.px2hd(void 0===i?"30px":i);a.updateCoordFor(this,{position:r,width:o+s,height:u+s})}},{key:"willMount",value:function(){var t=this.getItems();t&&t.length&&(this._init(),this.updateCoord())}},{key:"didMount",value:function(){this._initEvent()}},{key:"willUpdate",value:function(){var t=this.getItems();t&&t.length&&this.updateCoord()}},{key:"_initEvent",value:function(){var t=this,e=this.props,n=this.container,r=e.chart,a=e.clickable,u=e.onClick;(void 0===a||a)&&this.context.canvas.on("click",(function(e){var a=e.points[0];if(ur(n.getBBox(),a)){var s=sr("legend-item",n);if(s.length){var l=m(s,(function(t){return ur(t.getBBox(),a)}));if(l){var c=l.get("data-item");if(c){h(u)&&u(c);var f=c.field,p=c.tickValue,d=t.state.filtered,y=o(o({},d),{},i({},p,!d[p]));t.setState({filtered:y}),r.filter(f,(function(t){return!y[t]}))}}}}}))}},{key:"render",value:function(){var e=this.props,n=this.itemWidth,r=this.style,i=this.getItems();return i&&i.length?tr(t,o(o({},e),{},{items:i,itemWidth:n,style:o(o({},r),e.style)})):null}}]),r}(st)},ts=function(t){var e=t.color;return tr("square"===t.type?"rect":"circle",{style:{width:"12px",height:"12px",marginRight:"10px"},attrs:{fill:e}})},es=function(t){var e=t.itemWidth,n=t.itemFormatter,r=t.marker,i=void 0===r?"circle":r,a=t.nameStyle,u=t.valueStyle,s=t.valuePrefix,l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:": ";return"".concat(e).concat(t)};return tr("group",{style:t.style},t.items.map((function(t){var r=t.color,c=t.name,f=t.value,p=t.filtered,d=t.tickValue,y=h(n)?n(f,d):f;return tr("group",{className:"legend-item",style:{width:e,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",padding:["6px","6px","6px",0]},"data-item":t},tr(ts,{color:p?"#bfbfbf":r,type:i}),tr("text",{attrs:o({fill:p?"#bfbfbf":"#808080",text:c},a)}),y?tr("text",{attrs:o({fill:"#808080",text:l(y,s)},u)}):null)})))},ns=Qu(es);var rs=function(t){return function(e){ft(r,e);var n=wt(r);function r(t){var e;return at(this,r),(e=n.call(this,t)).triggerRef={},e.state={},e}return ut(r,[{key:"willMount",value:function(){Gi(dt(r.prototype),"willMount",this).call(this),this.getGuideBBox()}},{key:"didMount",value:function(){var t=this,e=this.props.onClick;this.context.canvas.on("click",(function(n){var r=n.points,i=t.triggerRef.current;i&&!i.isDestroyed()&&(function(t,e){var n=e.x,r=e.y;return!(t.minX>n||n>t.maxX||t.minY>r||r>t.maxY)}(i.getBBox(),r[0])&&(n.shape=i,e&&e(n)))}))}},{key:"didUpdate",value:function(){Gi(dt(r.prototype),"didUpdate",this).call(this);var t=this.triggerRef.current;if(t&&!t.isDestroyed()){var e=t.get("attrs"),n=e.x,i=e.y,a=e.width,o=e.height;this.setState({guideBBox:{minX:n,minY:i,maxX:n+a,maxY:i+o,width:a,height:o}})}}},{key:"getGuideBBox",value:function(){var t=Ei(this,this.render(),!1),e=t.get("attrs"),n=e.x,r=e.y,i=e.width,a=e.height;this.setState({guideBBox:{minX:n,minY:r,maxX:n+i,maxY:r+a,width:i,height:a}}),t.destroy()}},{key:"parseReplaceStr",value:function(t,e){var n={min:0,max:1,median:.5};return f(n[t])?w(t)&&-1!=t.indexOf("%")&&!isNaN(Number(t.slice(0,-1)))?Number(t.slice(0,-1))/100:e.scale(t):n[t]}},{key:"parsePoint",value:function(t){var e=this.props,n=e.chart,r=e.coord,i=n.getXScales()[0],a=n.getYScales()[0],o=this.parseReplaceStr(t[i.field],i),u=this.parseReplaceStr(t[a.field],a);return r.convertPoint({x:o,y:u})}},{key:"convertPoints",value:function(t){var e=this;return t.map((function(t){return e.parsePoint(t)}))}},{key:"getGuideTheme",value:function(){return this.context.theme.guide}},{key:"render",value:function(){var e=this.props,n=this.context,r=e.coord,i=e.records,a=e.animation,u=e.chart,s=n.width,l=n.height,c=this.convertPoints(void 0===i?[]:i),f=this.getGuideTheme(),p=this.state.guideBBox,d=a;return h(a)&&(d=a(c,u)),tr(t,o(o({triggerRef:this.triggerRef,points:c,theme:f,coord:r},e),{},{canvasWidth:s,canvasHeight:l,guideBBox:p,animation:d}))}}]),r}(st)},is={offsetX:0,offsetY:0,points:[],src:""},as={height:"20px",width:"20px"},os={offsetX:0,offsetY:0,points:[],direct:"tl",side:6,autoAdjust:!0},us={container:{fill:"#1677FF",radius:2,padding:[3,5]},text:{fontSize:"22px",fill:"#fff"},arrow:{fill:"#1677FF"}},ss=rs((function(t,e){var n=t.theme,r=X(o({},(void 0===n?{}:n).text),t),i=r.style,a=r.offsetY,u=r.content,s=r.animation,l=r.points[0]||{},c=l.x,h=l.y,f=e.px2hd(r.offsetX),p=e.px2hd(a);return tr("text",{attrs:o({text:u,x:c+(f||0),y:h+(p||0)},i),animation:X({update:{easing:"linear",duration:450,property:["x","y"]}},s)})})),ls=rs((function(t,e){var n=X(o({},t.theme.point),t),r=n.style,i=n.offsetY,a=n.animation,u=n.points[0]||{},s=u.x,l=u.y,c=e.px2hd(n.offsetX),h=e.px2hd(i);return tr("group",null,tr("circle",{attrs:o({x:s+(c||0),y:l+(h||0)},r),animation:a}))})),cs=rs((function(t,e){var n=t.theme,r=X(o({},(void 0===n?{}:n).line),t),i=r.points,a=r.style,u=r.offsetY,s=r.animation,l=i[0]||{},c=l.x,h=l.y,f=i[1]||{},d=f.x,y=f.y,v=e.px2hd(r.offsetX),g=e.px2hd(u),m=c+(p(v)?v[0]||0:v||0),x=h+(p(g)?g[0]||0:g||0),k=d+(p(v)?v[1]||0:v||0),w=y+(p(g)?g[1]||0:g||0);return tr("group",null,tr("line",{attrs:o({x1:m,y1:x,x2:k,y2:w},a),animation:s}))})),hs=rs((function(t){var e=t.theme,n=X(o({},(void 0===e?{}:e).line),t),r=n.points,i=n.style,a=n.animation,u=r[0]||{},s=r[1]||{},l=n.coord.center;return tr("group",null,tr("arc",{attrs:o({x:l.x,y:l.y,r:Math.sqrt((u.x-l.x)*(u.x-l.x)+(u.y-l.y)*(u.y-l.y)),startAngle:Math.atan2(u.y-l.y,u.x-l.x),endAngle:Math.atan2(s.y-l.y,s.x-l.x)},i),animation:a}))})),fs=rs((function(t){var e=t.theme,n=X(o({},(void 0===e?{}:e).rect),t),r=n.points,i=n.style,a=n.animation,u=r[0]||{},s=r[1]||{};return tr("group",null,tr("rect",{attrs:o({x:Math.min(u.x,s.x),y:Math.min(u.y,s.y),width:Math.abs(s.x-u.x),height:Math.abs(u.y-s.y)},i),animation:a}))})),ps=rs((function(t,e){var n=X({},is,t),r=n.style,i=n.attrs,a=n.offsetX,u=n.offsetY,s=n.src,l=n.animation,c=n.points[0]||{},h=c.x,f=c.y,p=i.height,d=i.width,y=void 0===d?0:d,v=e.px2hd((void 0===p?0:p)+"px"),g=e.px2hd(y+"px"),m=h+(e.px2hd(a)||0)-v/2,x=f+(e.px2hd(u)||0)-g/2;return tr("group",{style:r},tr("image",{attrs:o(o(o({},as),i),{},{height:v,width:g,x:m,y:x,src:s}),animation:X({update:{easing:"linear",duration:450,property:["x","y"]}},l)}))})),ds=rs((function(t,e){var n=o(o({},os),t),r=n.points,i=n.content,a=n.offsetY,u=n.direct,s=n.side,l=n.autoAdjust,c=n.canvasWidth,h=n.canvasHeight,f=n.guideBBox,p=n.background,d=n.textStyle,y=n.triggerRef,v=r[0]||{},g=v.x,m=v.y,x=f||{},k=x.width,w=x.height,b=e.px2hd(n.offsetX),M=e.px2hd(a),_=g+(b||0),S=m+(M||0),P=l?function(t){var e=u,n=t.x,r=t.y,i=e[0],a=e[1];"t"===i&&0>r-s-w?i="b":"b"===i&&r+s+w>h&&(i="t");var o="c"===i?s:0;return"l"===a&&0>n-o-k?a="r":"r"===a&&n+o+k>c?a="l":"c"===a&&(k/2+n+o>c?a="l":0>n-k/2-o&&(a="r")),e=i+a}(r[0]):u,O=function(t){var e=[];return"tl"===t?(e=[{x:_,y:S-s-1},{x:_,y:S},{x:_-s,y:S-s-1}],_-=k||0,S=S-(w||0)-s):"cl"===t?(e=[{x:_-s-1,y:S-s},{x:_-s-1,y:S+s},{x:_,y:S}],_=_-(k||0)-s,S-=w/2||0):"bl"===t?(e=[{x:_,y:S},{x:_,y:S+s+1},{x:_-s,y:S+s+1}],_-=k||0,S+=s):"bc"===t?(e=[{x:_,y:S},{x:_-s,y:S+s+1},{x:_+s,y:S+s+1}],_-=k/2||0,S+=s):"br"===t?(e=[{x:_,y:S},{x:_,y:S+s+1},{x:_+s,y:S+s+1}],S+=s):"cr"===t?(e=[{x:_,y:S},{x:_+s,y:S-s},{x:_+s,y:S+s}],_+=s,S-=w/2||0):"tr"===t?(e=[{x:_,y:S},{x:_,y:S-s-1},{x:_+s,y:S-s-1}],S=S-(w||0)-s):"tc"===t&&(e=[{x:_,y:S},{x:_-s,y:S-s-1},{x:_+s,y:S-s-1}],_-=k/2||0,S=S-(w||0)-s),e}(P);return tr("group",{attrs:o({fill:us.container.fill,radius:us.container.radius},p),style:o({left:_,top:S,padding:us.container.padding},p),ref:y},tr("text",{attrs:o({text:i,fontSize:us.text.fontSize,fill:us.text.fill},d)}),f&&tr("polygon",{attrs:{points:O,fill:(null==p?void 0:p.fill)||us.arrow.fill}}))})),ys=rs((function(){return null})),vs=function(t){return function(e){ft(r,e);var n=wt(r);function r(t){var e;return at(this,r),(e=n.call(this,t))._triggerOn=function(t){e.show(t.points[0],t)},e._triggerOff=function(){var t=ct(e).props.alwaysShow;void 0!==t&&t||e.hide()},e.state={records:null},e}return ut(r,[{key:"updateCoord",value:function(){var t=this.props,e=t.padding;t.chart.updateCoordFor(this,{position:"top",width:0,height:this.context.px2hd(void 0===e?"10px":e)})}},{key:"willMount",value:function(){this.updateCoord()}},{key:"didMount",value:function(){this._initShow(),this._initEvent()}},{key:"willReceiveProps",value:function(t){var e=t.defaultItem,n=t.coord,r=this.props,i=r.coord;Qe(e,r.defaultItem)&&Qe(n,i)||this._showByData(e)}},{key:"_initShow",value:function(){this._showByData(this.props.defaultItem)}},{key:"_showByData",value:function(t){var e=this;if(t){var n=this.props.chart;setTimeout((function(){var r=n.getPosition(t);e.show(r)}),0)}}},{key:"_initEvent",value:function(){var t=this.props,e=this.context.canvas,n=t.triggerOn,r=t.triggerOff,i=void 0===r?"pressend":r;e.on(void 0===n?"press":n,this._triggerOn),e.on(i,this._triggerOff)}},{key:"didUnmount",value:function(){this._clearEvents()}},{key:"_clearEvents",value:function(){var t=this.props,e=this.context.canvas,n=t.triggerOn,r=t.triggerOff,i=void 0===r?"pressend":r;e.off(void 0===n?"press":n,this._triggerOn),e.off(i,this._triggerOff)}},{key:"show",value:function(t,e){var n=this.props,r=n.chart,i=n.onChange,a=r.getSnapRecords(t,!0);if(a&&a.length){var u=r.getLegendItems(),s=a[0],l=s.yField,c=r.getScale(s.xField),f=r.getScale(l),d=a.map((function(t){var e=t.origin,n=t.xField,r=f.getText(e[t.yField]),i=f.alias;if(!i&&(i=c.getText(e[n]),u&&u.length)){var a=m(u,(function(t){return e[t.field]===t.tickValue}));a&&a.name&&(i=a.name)}return o(o({},t),{},{name:i,value:r})}));p(d)&&d.length&&(this.setState({records:d}),h(i)&&i(d))}}},{key:"hide",value:function(){this.setState({records:null})}},{key:"render",value:function(){var e=this.props;if(!1===e.visible)return null;var n=this.state.records;return n&&n.length?tr(t,o(o({},e),{},{records:n})):null}}]),r}(st)};function gs(){return{current:null}}var ms={showTitle:!1,showCrosshairs:!1,crosshairsType:"y",crosshairsStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:"2px"},showTooltipMarker:!1,markerBackgroundStyle:{fill:"#CCD6EC",opacity:.3,padding:"6px"},tooltipMarkerStyle:{fill:"#fff",lineWidth:"3px"},background:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"]},titleStyle:{fontSize:"24px",fill:"#fff",textAlign:"start",textBaseline:"top"},nameStyle:{fontSize:"24px",fill:"rgba(255, 255, 255, 0.65)",textAlign:"start",textBaseline:"middle"},valueStyle:{fontSize:"24px",fill:"#fff",textAlign:"start",textBaseline:"middle"},joinString:": ",showItemMarker:!0,itemMarkerStyle:{width:"12px",radius:"6px",symbol:"circle",lineWidth:"2px",stroke:"#fff"},layout:"horizontal",snap:!1,xTipTextStyle:{fontSize:"24px",fill:"#fff"},yTipTextStyle:{fontSize:"24px",fill:"#fff"},xTipBackground:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"],marginLeft:"-50%",marginTop:"6px"},yTipBackground:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"],marginLeft:"-100%",marginTop:"-50%"}};function xs(t,e){return void 0===t||"string"==typeof t&&-1!==t.indexOf(e)}var ks=function(t){var e=t.records,n=t.coord,r=t.context,i=t.markerBackgroundStyle,a=n.convertPoint({x:1,y:1}),u=r.px2hd(i.padding||"6px"),s=[].concat(mu(e.map((function(t){return t.xMin}))),mu(e.map((function(t){return t.xMax})))),l=[].concat(mu(e.map((function(t){return t.yMin}))),mu(e.map((function(t){return t.yMax}))));n.transposed?s.push(a.x):l.push(a.y);var c=Math.min.apply(null,s),h=Math.max.apply(null,s),f=Math.min.apply(null,l),p=Math.max.apply(null,l);return tr("rect",{attrs:o({x:n.transposed?c:c-u,y:n.transposed?f-u:f,width:n.transposed?h-c:h-c+2*u,height:n.transposed?p-f+2*u:p-f},i)})},ws=function(t){var e=t.coord,n=t.crosshairsType,r=t.crosshairsStyle,i=e.left,a=e.top,u=e.right,s=e.bottom,l=e.center,c=t.records[0],h=c.x,f=c.y,p=c.origin,d=c.xField;if(e.isPolar){var y=m(t.chart.getScale(d).getTicks(),(function(t){return p[d]===t.tickValue})),v=e.convertPoint({x:y.value,y:1});return tr("line",{attrs:o({x1:l.x,y1:l.y,x2:v.x,y2:v.y},r)})}return tr("group",null,xs(n,"x")?tr("line",{attrs:o({x1:i,y1:f,x2:u,y2:f},r)}):null,xs(n,"y")?tr("line",{attrs:o({x1:h,y1:a,x2:h,y2:s},r)}):null)},bs=function(t){ft(n,t);var e=wt(n);function n(t){var r;return at(this,n),(r=e.call(this,t)).rootRef={current:null},r.arrowRef={current:null},r}return ut(n,[{key:"_position",value:function(){var t=this.props,e=this.arrowRef,n=this.rootRef.current;if(n){var r=t.records,i=t.coord,a=this.context.px2hd("6px"),o=r[0].x,u=i.left,s=i.width,l=n.get("attrs"),c=l.y,h=l.width,f=l.height,p=l.radius,d=Math.min(Math.max(o-u-h/2,-a-p),s-h+a+p),y=Math.min(c,f+a);n.moveTo(d,-y),e.current.moveTo(0,f-y)}}},{key:"didMount",value:function(){this._position()}},{key:"didUpdate",value:function(){this._position()}},{key:"render",value:function(){var t=this.props,e=this.context,n=t.records,r=t.coord,i=r.left,a=r.top,u=r.bottom,s=n[0],l=s.x,c=s.y,f=s.name,p=s.value,d=t.chart,y=t.background,v=t.showTooltipMarker,g=void 0===v?ms.showTooltipMarker:v,m=t.markerBackgroundStyle,x=void 0===m?ms.markerBackgroundStyle:m,k=t.showItemMarker,w=void 0===k?ms.showItemMarker:k,b=t.nameStyle,M=t.valueStyle,_=t.joinString,S=void 0===_?ms.joinString:_,P=t.showCrosshairs,O=void 0===P?ms.showCrosshairs:P,C=t.crosshairsStyle,A=t.crosshairsType,T=void 0===A?ms.crosshairsType:A,D=t.snap,E=void 0===D?ms.snap:D,j=t.tooltipMarkerStyle,Y=void 0===j?ms.tooltipMarkerStyle:j,I=t.showXTip,N=t.showYTip,L=t.xTip,R=t.yTip,F=t.xTipTextStyle,B=void 0===F?ms.xTipTextStyle:F,X=t.yTipTextStyle,z=void 0===X?ms.yTipTextStyle:X,W=t.xTipBackground,H=void 0===W?ms.xTipBackground:W,V=t.yTipBackground,G=void 0===V?ms.yTipBackground:V,q=t.custom,U=void 0!==q&&q,Z=t.customText,$=o(o({},t.itemMarkerStyle),ms.itemMarkerStyle),J=o(o({},ms.background),y),K=e.px2hd("6px");return tr("group",null,tr("group",{style:{left:i,top:a}},!U&&tr("group",null,tr("group",{ref:this.rootRef,style:J,attrs:J},tr("group",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",padding:[0,0,0,"6px"]}},n.map((function(t){var e=t.name,n=t.value;return tr("group",{style:{display:"flex",flexDirection:"row",alignItems:"center",padding:[0,"6px",0,0]}},w?tr("marker",{style:{width:$.width,marginRight:"6px"},attrs:o(o({},$),{},{fill:t.color})}):null,Z&&h(Z)?Z(t):tr("group",{style:{display:"flex",flexDirection:"row"}},tr("text",{attrs:o(o(o({},ms.nameStyle),b),{},{text:n?"".concat(e).concat(S):e})}),tr("text",{attrs:o(o(o({},ms.valueStyle),M),{},{text:n})})))})))),tr("polygon",{ref:this.arrowRef,attrs:{points:[{x:l-K,y:a},{x:l+K,y:a},{x:l,y:a+K}],fill:J.fill}})),g?tr(ks,{coord:r,context:e,records:n,markerBackgroundStyle:x}):null,O?tr(ws,{chart:d,coord:r,records:n,crosshairsType:T,crosshairsStyle:o(o({},ms.crosshairsStyle),C)}):null,E?n.map((function(t){var e=t.color;return tr("circle",{attrs:o(o({x:t.x,y:t.y,r:"6px",stroke:e,fill:e},t.shape),Y)})})):null),I&&tr("group",{style:o(o({left:l,top:u},ms.xTipBackground),H),attrs:o(o({},ms.xTipBackground),H)},tr("text",{attrs:o(o(o({},ms.xTipTextStyle),B),{},{text:h(L)?L(f):f})})),N&&tr("group",{style:o(o({left:i,top:c},ms.yTipBackground),G),attrs:o(o({},ms.yTipBackground),G)},tr("text",{attrs:o(o(o({},ms.yTipTextStyle),z),{},{text:h(R)?R(p):p})})))}}]),n}(st),Ms=vs(bs);function _s(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}var Ss=e(n((function(t){t.exports=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=qe(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}},t.exports.__esModule=!0,t.exports.default=t.exports})));var Ps=n((function(t){var e=vt.default;function n(){
2/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3t.exports=n=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var r={},i=Object.prototype,a=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var i=Object.create((e&&e.prototype instanceof d?e:d).prototype),a=new P(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return C()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var u=M(o,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=f(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,a),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var p={};function d(){}function y(){}function v(){}var g={};c(g,u,(function(){return this}));var m=Object.getPrototypeOf,x=m&&m(m(O([])));x&&x!==i&&a.call(x,u)&&(g=x);var k=v.prototype=d.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,n){function r(i,o,u,s){var l=f(t[i],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==e(h)&&a.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):n.resolve(h).then((function(t){c.value=t,u(c)}),(function(t){return r("throw",t,u,s)}))}s(l.arg)}var i;this._invoke=function(t,e){function a(){return new n((function(n,i){r(t,e,n,i)}))}return i=i?i.then(a,a):a()}}function M(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,M(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function O(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(a.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return y.prototype=v,c(k,"constructor",v),c(v,"constructor",y),y.displayName=c(v,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},r.awrap=function(t){return{__await:t}},w(b.prototype),c(b.prototype,s,(function(){return this})),r.AsyncIterator=b,r.async=function(t,e,n,i,a){void 0===a&&(a=Promise);var o=new b(h(t,e,n,i),a);return r.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},w(k),c(k,l,"Generator"),c(k,u,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},r.values=O,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return o.type="throw",o.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&a.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var i=r;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},r}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),Os=Ps(),Cs=Os;try{regeneratorRuntime=Os}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=Os:Function("r","regeneratorRuntime = r")(Os)}var As=Cs.mark(Ts);function Ts(){var t,e,n,r,i,a;return Cs.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:n=[t=this];case 1:e=n.reverse(),n=[];case 2:if(!(t=e.pop())){o.next=8;break}return o.next=5,t;case 5:if(r=t.children)for(i=0,a=r.length;a>i;++i)n.push(r[i]);o.next=2;break;case 8:if(n.length){o.next=1;break}case 9:case"end":return o.stop()}}),As,this)}function Ds(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=js)):void 0===e&&(e=Es);for(var n,r,i,a,o,u=new Ns(t),s=[u];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;a>=0;--a)s.push(r=i[a]=new Ns(i[a])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(Is)}function Es(t){return t.children}function js(t){return Array.isArray(t)?t[1]:null}function Ys(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Is(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Ns(t){this.data=t,this.depth=this.height=0,this.parent=null}function Ls(t){if("function"!=typeof t)throw Error();return t}function Rs(){return 0}function Fs(t){return function(){return t}}function Bs(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Xs(t,e,n,r,i){for(var a,o=t.children,u=-1,s=o.length,l=t.value&&(r-e)/t.value;++u<s;)(a=o[u]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*l}function zs(){var t=1,e=1,n=0,r=!1;function i(i){var a=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(r){r.children&&Xs(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,a=r.y0,o=r.x1-n,u=r.y1-n;i>o&&(i=o=(i+o)/2),a>u&&(a=u=(a+u)/2),r.x0=i,r.y0=a,r.x1=o,r.y1=u}}(e,a)),r&&i.eachBefore(Bs),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i}function Ws(t,e,n,r,i){for(var a,o=t.children,u=-1,s=o.length,l=t.value&&(i-n)/t.value;++u<s;)(a=o[u]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*l}Ns.prototype=Ds.prototype=i({constructor:Ns,count:function(){return this.eachAfter(_s)},each:function(t,e){var n,r=-1,i=Ss(this);try{for(i.s();!(n=i.n()).done;){t.call(e,n.value,++r,this)}}catch(t){i.e(t)}finally{i.f()}return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],u=[],s=-1;a=o.pop();)if(u.push(a),n=a.children)for(r=0,i=n.length;i>r;++r)o.push(n[r]);for(;a=u.pop();)t.call(e,a,++s,this);return this},eachBefore:function(t,e){for(var n,r,i=this,a=[i],o=-1;i=a.pop();)if(t.call(e,i,++o,this),n=i.children)for(r=n.length-1;r>=0;--r)a.push(n[r]);return this},find:function(t,e){var n,r=-1,i=Ss(this);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(t.call(e,a,++r,this))return a}}catch(t){i.e(t)}finally{i.f()}},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)r.push(e=e.parent);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Ds(this).eachBefore(Ys)}},Symbol.iterator,Ts);var Hs=function t(e){function n(t,n,r,i,a){!function(t,e,n,r,i,a){for(var o,u,s,l,c,h,f,p,d,y,v,g=[],m=e.children,x=0,k=0,w=m.length,b=e.value;w>x;){s=i-n,l=a-r;do{c=m[k++].value}while(!c&&w>k);for(h=f=c,d=Math.max(f/(v=c*c*(y=Math.max(l/s,s/l)/(b*t))),v/h);w>k;++k){if(c+=u=m[k].value,h>u&&(h=u),u>f&&(f=u),(p=Math.max(f/(v=c*c*y),v/h))>d){c-=u;break}d=p}g.push(o={value:c,dice:l>s,children:m.slice(x,k)}),o.dice?Xs(o,n,r,i,b?r+=l*c/b:a):Ws(o,n,r,b?n+=s*c/b:i,a),b-=c,x=k}}(e,t,n,r,i,a)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(1.618033988749895);function Vs(t,e,n,r,i){var a,o,u=t.children,s=u.length,l=Array(s+1);for(l[0]=o=a=0;s>a;++a)l[a+1]=o+=u[a].value;!function t(e,n,r,i,a,o,s){if(e>=n-1){var c=u[e];return c.x0=i,c.y0=a,c.x1=o,void(c.y1=s)}var h=l[e],f=r/2+h,p=e+1,d=n-1;for(;d>p;){var y=p+d>>>1;f>l[y]?p=y+1:d=y}l[p]-f>f-l[p-1]&&p>e+1&&--p;var v=l[p]-h,g=r-v;if(o-i>s-a){var m=r?(i*g+o*v)/r:o;t(e,p,v,i,a,m,s),t(p,n,g,m,a,o,s)}else{var x=r?(a*g+s*v)/r:s;t(e,p,v,i,a,o,x),t(p,n,g,i,x,o,s)}}(0,s,t.value,e,n,r,i)}var Gs=function(t){return function(e){ft(r,e);var n=wt(r);function r(t,e,i){var a;at(this,r),a=n.call(this,t,e,i);var u=t.coord,s=t.color,l=t.data,c=e.width,h=e.height,f=e.theme;a.coordController=new Qi;var p=ct(a);return a.coord=p.coordController.create(u,{width:c,height:h}),a.color=new nu(o(o({range:f.colors},s),{},{data:l})),a}return ut(r,[{key:"treemapLayout",value:function(){var t=this.props,e=this.coord,n=this.color,r=t.value,i=Ds({children:t.data}).sum((function(t){return t[r]})).sort((function(t,e){return e[r]-t[r]})),a=function(){var t=Hs,e=!1,n=1,r=1,i=[0],a=Rs,o=Rs,u=Rs,s=Rs,l=Rs;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(h),i=[0],e&&t.eachBefore(Bs),t}function h(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,h=e.x1-n,f=e.y1-n;r>h&&(r=h=(r+h)/2),c>f&&(c=f=(c+f)/2),e.x0=r,e.y0=c,e.x1=h,e.y1=f,e.children&&(n=i[e.depth+1]=a(e)/2,r+=l(e)-n,c+=o(e)-n,r>(h-=u(e)-n)&&(r=h=(r+h)/2),c>(f-=s(e)-n)&&(c=f=(c+f)/2),t(e,r,c,h,f))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=Ls(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:Fs(+t),c):a},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:Fs(+t),c):o},c.paddingRight=function(t){return arguments.length?(u="function"==typeof t?t:Fs(+t),c):u},c.paddingBottom=function(t){return arguments.length?(s="function"==typeof t?t:Fs(+t),c):s},c.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:Fs(+t),c):l},c}().tile(Vs).round(!1);return a(i).children.map((function(t){var r=t.data,i=t.x0,a=t.y0,u=t.x1,s=t.y1,l=n.mapping(r[n.field]),c=e.convertRect({x:[i,u],y:[a,s]});return o({key:r.key,origin:r,color:l},c)}))}},{key:"render",value:function(){var e=this.treemapLayout(),n=this.coord;return tr(t,o(o({nodes:e},this.props),{},{coord:n}))}}]),r}(st)},qs=function(t){var e=t.nodes,n=t.coord;if(n.isPolar){var r=n.center,i=r.x,a=r.y;return tr("group",null,e.map((function(t){return tr("sector",{attrs:{x:i,y:a,lineWidth:"1px",stroke:"#fff",startAngle:t.xMin,endAngle:t.xMax,r0:t.yMin,r:t.yMax,anticlockwise:!1,fill:t.color}})})))}return tr("group",null,e.map((function(t){var e=t.xMin,n=t.yMin;return tr("rect",{key:t.key,attrs:{x:e,y:n,width:t.xMax-e,height:t.yMax-n,fill:t.color,lineWidth:"4px",stroke:"#fff",radius:"8px"},animation:{appear:{easing:"linear",duration:450,property:["fillOpacity","strokeOpacity"],start:{fillOpacity:0,strokeOpacity:0},end:{fillOpacity:1,strokeOpacity:1}},update:{easing:"linear",duration:450,property:["x","y","width","height","radius","lineWidth"]}}})})))},Us=Gs(qs);function Zs(t){for(var e=t;e.depth>1;)e=e.parent;return e}var $s=function(t){return function(e){ft(r,e);var n=wt(r);function r(t,e){var i;at(this,r),i=n.call(this,t,e);var a=t.coord,u=t.color,s=t.data,l=e.width,c=e.height,h=e.theme;i.coordController=new Qi;var f=ct(i);return i.coord=f.coordController.create(a,{width:l,height:c}),i.color=new nu(o(o({range:h.colors},u),{},{data:s})),i}return ut(r,[{key:"didMount",value:function(){var t=this,e=this.props.onClick,n=this.container.get("canvas");this.triggerRef=[],n.on("click",(function(n){var r=n.points,i=t.triggerRef.find((function(t){return ur(t.current.getBBox(),r[0])}));i&&(n.shape=i,n.payload=i.payload,e&&e(n))}))}},{key:"_mapping",value:function(t){for(var e=this.color,n=this.coord,r=0,i=t.length;i>r;r++){var a=t[r],o=Zs(a),u=e.mapping(o.data[e.field]);a.color=u,R(a,n.convertRect({x:[a.x0,a.x1],y:[a.y0,a.y1]})),a.children&&a.children.length&&this._mapping(a.children)}}},{key:"sunburst",value:function(){var t=this.props,e=t.value,n=t.sort,r=void 0===n||n,i=Ds({children:t.data}).sum((function(t){return t[e]}));if(!0===r||h(r)){var a=h(r)?r:function(t,n){return n[e]-t[e]};i.sort(a)}var o=zs()(i);return this._mapping(o.children),o}},{key:"render",value:function(){var e=this.sunburst(),n=this.coord;return tr(t,o(o({},this.props),{},{coord:n,node:e,triggerRef:this.triggerRef}))}}]),r}(st)},Js=function(t){var e=t.coord.center,n=e.x,r=e.y;return function t(e){return tr("group",null,e.map((function(e){var i=e.children;return tr("group",null,tr("sector",{attrs:{x:n,y:r,lineWidth:"1px",stroke:"#fff",startAngle:e.xMin,endAngle:e.xMax,r0:e.yMin,r:e.yMax,anticlockwise:!1,fill:e.color}}),i&&i.length?t(i):null)})))}(t.node.children)},Ks=function(t){return function t(e){return tr("group",null,e.map((function(e){var n=e.xMin,r=e.yMin,i=e.children;return tr("group",null,tr("rect",{attrs:{x:n,y:r,width:e.xMax-n,height:e.yMax-r,lineWidth:"1px",stroke:"#fff",fill:e.color}}),i&&i.length?t(i):null)})))}(t.node.children)},Qs=$s((function(t){return tr("polar"===t.coord.type?Js:Ks,o({},t))})),tl={anchorOffset:"10px",inflectionOffset:"30px",sidePadding:"15px",height:"64px",adjustOffset:"30",triggerOn:"click",label1OffsetY:"-4px",label2OffsetY:"4px"};function el(t,e,n){return{x:t.x+n*Math.cos(e),y:t.y+n*Math.sin(e)}}function nl(t,e,n,r){var i=r.x,a=t.sort((function(t,e){var n=Math.abs(t.x-i);return Math.abs(e.x-i)-n}));return[a.slice(0,a.length-n),a.slice(a.length-n).concat(e)]}function rl(t){return t>=-Math.PI/2&&0>t}function il(t){return t>=0&&Math.PI/2>t}function al(t){return t>=Math.PI/2&&Math.PI>t}function ol(t){return t>=Math.PI&&3*Math.PI/2>t}var ul=function(t){return function(e){ft(r,e);var n=wt(r);function r(t){var e;return at(this,r),(e=n.call(this,t))._handleEvent=function(t){var n=e.props,r=n.chart,i=n.onClick,a=t.points[0],o=function(t,e,n){for(var r=sr(n,t),i=0,a=r.length;a>i;i++){var o=r[i];if(ur(o.getBBox(),e))return o}}(e.triggerRef.current,a,"click"),u=r.getSnapRecords(a);"function"==typeof i&&(o?i(o.get("data")):p(u)&&u.length>0&&i(u))},e.triggerRef={},e}return ut(r,[{key:"willMount",value:function(){}},{key:"didMount",value:function(){this._initEvent()}},{key:"getLabels",value:function(t){var e=t.chart,n=t.coord,r=t.anchorOffset,i=t.inflectionOffset,a=t.label1,o=t.label2,u=t.sidePadding,s=n.center,l=n.radius,c=n.width,f=n.height,p=n.left,d=n.right,y=n.top,v=Math.floor(f/t.height),g=2*v,m=e.getGeometrys()[0].flatRecords().sort((function(t,e){return e.xMax-e.xMin-(t.xMax-t.xMin)})).slice(0,g),x=[[],[]];if(m.forEach((function(t){var e,n,u=t.color,c=t.origin,f=((e=t.xMin)>(n=t.xMax)&&(n+=2*Math.PI),(n+e)/2),p=el(s,f,l+r),d=el(s,f,l+i),y=s.x>p.x?"left":"right",v={origin:c,angle:f,anchor:p,inflection:d,side:y,x:d.x,y:d.y,r:l+i,color:u,label1:h(a)?a(c,t):a,label2:h(o)?o(c,t):o};"left"===y?x[0].push(v):x[1].push(v)})),x[0].length>v)x=nl(x[0],x[1],x[0].length-v,s);else if(x[1].length>v){var k=nl(x[1],x[0],x[1].length-v,s),w=Ze(k,2);x=[w[1],w[0]]}var b=c/2-l-r-i-2*u,M=[];return x.forEach((function(t,e){var n=0===e?"left":"right";t.sort((function(t,e){var r=t.angle,i=e.angle;return"left"===n?(r=rl(r)?r+2*Math.PI:r,(i=rl(i)?i+2*Math.PI:i)-r):(r=ol(r)?r-2*Math.PI:r)-(i=ol(i)?i-2*Math.PI:i)}));var r=t.map((function(t){return t.y})),i=Math.max.apply(null,r),a=Math.min.apply(null,r),o=t.length,s=f/o,l=s/2;t.forEach("left"===n?function(t,e){var r=t.angle,c=t.x,h=t.y,f=[t.anchor,t.inflection],d=p+u,v=y+l+s*e,g={x:d+b+2*e,y:v},m={x:d,y:v};if(rl(r)){var x=a-2*(o-e);f.push({x:c,y:x}),f.push({x:g.x,y:x})}else if(al(r)||ol(r))f.push({x:g.x,y:h});else if(il(r)){var k=i+2*e;f.push({x:c,y:k}),f.push({x:g.x,y:k})}f.push(g),f.push(m),t.points=f,t.side=n,M.push(t)}:function(t,e){var r=t.angle,c=t.x,h=t.y,f=[t.anchor,t.inflection],p=d-u,v=y+l+s*e,g={x:p-b-2*e,y:v},m={x:p,y:v};if(ol(r)){var x=a-2*(o-e);f.push({x:c,y:x}),f.push({x:g.x,y:x})}else if(rl(r)||il(r))f.push({x:g.x,y:h});else if(al(r)){var k=i+2*e;f.push({x:c,y:k}),f.push({x:g.x,y:k})}f.push(g),f.push(m),t.points=f,t.side=n,M.push(t)})})),M}},{key:"_initEvent",value:function(){var t=this.props.triggerOn;this.context.canvas.on(void 0===t?tl.triggerOn:t,this._handleEvent)}},{key:"render",value:function(){var e=this.context.px2hd(X({},tl,this.props)),n=this.getLabels(e);return tr(t,o(o({labels:n},e),{},{triggerRef:this.triggerRef}))}}]),r}(st)},sl=function(t){var e=t.lineStyle,n=t.anchorStyle,r=t.label1OffsetY,i=t.label2OffsetY;return tr("group",{ref:t.triggerRef},t.labels.map((function(t){var a=t.origin,u=t.anchor,s=t.side,l=t.color,c=t.label1,h=t.label2,f=t.points,p=f[f.length-1];return tr("group",null,tr("circle",{attrs:o({r:"4px",x:u.x,y:u.y,fill:l},n)}),tr("polyline",{attrs:o({points:f,lineWidth:"2px",stroke:l},e)}),tr("text",{className:"click",attrs:o({x:p.x,y:p.y+r,fontSize:"24px",lineHeight:"24px",fill:l,textBaseline:"bottom",textAlign:"left"===s?"left":"right"},c),data:a}),tr("text",{className:"click",attrs:o({x:p.x,y:p.y+i,fontSize:"24px",lineHeight:"24px",fill:"#808080",textBaseline:"top",textAlign:"left"===s?"left":"right"},h),data:a}))})))},ll=ul(sl),cl=function(t,e,n){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},hl=function(t){return function(e){ft(r,e);var n=wt(r);function r(){return at(this,r),n.apply(this,arguments)}return ut(r,[{key:"render",value:function(){var e=this.props,n=this.context,r=e.tickOffset,i=e.tickLength,a=function(t,e,n,r,i,a,o){for(var u=[],s=e-t,l=0;n>=l;l++){var c=t+s*l/n,h=cl(r,c,i+a-o),f=cl(r,c,i+a);u.push({tickValue:c,start:h,end:f})}return u}(e.startAngle,e.endAngle,e.tickCount,e.center,n.px2hd(e.r),n.px2hd(r),n.px2hd(i));return tr(t,o(o({},e),{},{ticks:a}))}}]),r}(st)},fl=function(t){var e=t.center,n=t.startAngle,r=t.endAngle,i=t.r,a=t.percent,o=t.ticks,u=e.x,s=e.y,l=r-n;return tr("group",null,tr("arc",{attrs:{x:u,y:s,r:i,startAngle:n,endAngle:r,lineWidth:"20px",lineCap:"round",stroke:"#e7e7e7"}}),tr("arc",{attrs:{x:u,y:s,r:i,startAngle:n,endAngle:n,lineWidth:"40px",lineCap:"round",stroke:"#0075ff"},animation:{appear:{easing:"linear",duration:500,property:["endAngle"],start:{endAngle:n},end:{endAngle:n+l*a}}}}),o.map((function(t){var e=t.start,n=t.end;return tr("line",{attrs:{x1:e.x,y1:e.y,x2:n.x,y2:n.y,lineWidth:"6px",lineCap:"round",stroke:"#e7e7e7"}})})))},pl=hl(fl);function dl(t,e){if(t.length!==e.length)return!1;var n=t.length-1;return t[0]===e[0]&&t[n]===e[n]}function yl(t,e,n){var r=t.isLinear;return t.isCategory?function(t,e,n){var r=t.values,i=t.ticks,a=t.tickMethod,o=t.tickCount,u=e.values,s=Ze(n,2),l=u.length,c=s[0]*l,h=Math.round(s[1]*l-c),f=Math.round(c),p=u.slice(f,f+h),d=Math.round(o*u.length/p.length),y=ea(a)({tickCount:d,values:u});if(!dl(r,p)||!dl(i,y))return t.change({values:p,ticks:y}),t}(t,e,n):r?function(t,e,n){var r=e.min,i=e.max,a=Ze(n,2);t.change({min:r+(i-r)*a[0],max:r+(i-r)*a[1],nice:!1})}(t,e,n):void 0}function vl(t,e,n){var r=e.field,i=e.type,a={};return e.values.forEach((function(t){a[t]=!0})),t.map((function(t){var e=t.field,o=[];return n.forEach((function(t){var n="timeCat"===i?or(t[r]):t[r];a[n]&&o.push(t[e])})),function(t,e){if(t.isLinear){var n=k(e);return t.change({min:n.min,max:n.max,nice:!0})}}(t,o)}))}function gl(t,e,n){return(e-t)*n+t}function ml(t,e){for(var n in t)if(void 0===(r=void 0)&&(r=1e-5),r<=Math.abs(t[n]-e[n]))return!1;var r;return!0}var xl=function(t){ft(n,t);var e=wt(n);function n(t){var r;at(this,n);(r=e.call(this,o(o({},{onPanStart:function(){},onPinchStart:function(){},onPan:function(){},onPinch:function(){},onInit:function(){},onPanEnd:function(){},onPinchEnd:function(){},minCount:10}),t))).scale={},r.originScale={},r.swipeEnd={startX:0,startY:0,endX:0,endY:0},r.onStart=function(){var t=ct(r);r.startRange=t.state.range,r.loop&&cancelAnimationFrame(r.loop)},r.onPan=function(t){var e=ct(r),n={};y(e.dims,(function(e){"x"!==e?"y"!==e||(n.y=r._doYPan(t)):n.x=r._doXPan(t)})),ml(n,r.state.range)||r.setState({range:n})},r.onSwipe=function(t){if(r.props.mode.length>=2&&r.props.swipe){var e=t.velocityX,n=void 0===e?0:e,i=t.velocityY,a=void 0===i?0:i,o=r.state.range,u=t.points[0],s=u.x,l=u.y;5e-4>Math.abs((null==o?void 0:o.x[0])-0)&&n>0||5e-4>Math.abs((null==o?void 0:o.x[1])-1)&&0>n||5e-4>Math.abs((null==o?void 0:o.y[0])-0)&&0>a||5e-4>Math.abs((null==o?void 0:o.x[1])-1)&&a>0||(r.swipeEnd={startX:s,startY:l,endX:s+50*n,endY:l-50*a},r.onStart(),r.update())}},r.onPinch=function(t){var e=ct(r),n={};y(e.dims,(function(e){"x"!==e?"y"!==e||(n.y=r._doYPinch(t)):n.x=r._doXPinch(t)})),ml(n,r.state.range)||r.setState({range:n})},r.onEnd=function(){r.startRange=null};var i=t.mode;return r.dims=i instanceof Array?i:[i],r}return ut(n,[{key:"didMount",value:function(){this._bindEvents()}},{key:"willReceiveProps",value:function(t){var e=t.range;if(!Qe(e,this.props.range)){var n={};y(this.dims,(function(t){n[t]=e})),this.state={range:n}}}},{key:"willMount",value:function(){var t=this,e=this.props,n=e.minCount,r=e.range,i=5e-324,a={};y(this.dims,(function(e){var n=t._getScale(e),u=n.values;i=u.length>i?u.length:i,t.scale[e]=n,t.originScale[e]=function(t,e){return new t.constructor(o(o({},t.__cfg__),e))}(n),t.updateRange(r,e),a[e]=r})),this.minScale=n/i,this.state={range:a}}},{key:"didUnmount",value:function(){this._clearEvents()}},{key:"update",value:function(){var t=this,e=this.swipeEnd,n=e.startX,r=e.startY,i=e.endX,a=e.endY,o=gl(n,i,.05),u=gl(r,a,.05);this.swipeEnd={startX:o,startY:u,endX:i,endY:a};var s=this.props.coord,l=s.height,c={};c.x=this._doPan((o-n)/s.width,"x"),c.y=this._doPan((u-r)/l,"y"),this.setState({range:c}),this.startRange=c,this.loop=requestAnimationFrame((function(){return t.update()})),5e-4>Math.abs(o-i)&&5e-4>Math.abs(u-a)&&(this.onEnd(),cancelAnimationFrame(this.loop))}},{key:"_doXPan",value:function(t){var e=t.direction,n=t.deltaX;if(1===this.props.mode.length&&("up"===e||"down"===e))return this.state.range.x;t.preventDefault&&t.preventDefault();var r=this.props,i=r.panSensitive;return this._doPan(n/r.coord.width*(void 0===i?1:i),"x")}},{key:"_doYPan",value:function(t){var e=t.direction,n=t.deltaY;if(1===this.props.mode.length&&("left"===e||"right"===e))return this.state.range.y;t.preventDefault&&t.preventDefault();var r=this.props,i=r.panSensitive;return this._doPan(-n/r.coord.height*(void 0===i?1:i),"y")}},{key:"_doPan",value:function(t,e){var n=Ze(this.startRange[e],2),r=n[0],i=n[1],a=(i-r)*t;return this.updateRange([r-a,i-a],e)}},{key:"_doXPinch",value:function(t){t.preventDefault&&t.preventDefault();var e=t.zoom,n=t.center,r=this.props.coord,i=r.width,a=r.right;return this._doPinch(Math.abs(n.x-r.left)/i,Math.abs(a-n.x)/i,e,"x")}},{key:"_doYPinch",value:function(t){t.preventDefault&&t.preventDefault();var e=t.zoom,n=t.center,r=this.props.coord,i=r.height,a=r.bottom;return this._doPinch(Math.abs(n.y-r.top)/i,Math.abs(a-n.y)/i,e,"y")}},{key:"_doPinch",value:function(t,e,n,r){var i=this.minScale,a=this.props.pinchSensitive,o=void 0===a?1:a,u=Ze(this.startRange[r],2),s=u[0],l=u[1],c=(l-s)*(1>n?(1/n-1)*o:(1-n)*o),h=c*e,f=Math.max(0,s-c*t),p=Math.min(1,l+h);return i>p-f?this.state.range[r]:this.updateRange([f,p],r)}},{key:"updateRange",value:function(t,e){if(t){var n,r=Ze(t,2),i=r[0],a=r[1],o=a-i;n=0>i?[0,o]:a>1?[1-o,1]:t;var u=this.props,s=this.scale,l=this.originScale,c=u.chart,h=u.data,f=u.autoFit,p=this.state.range;if(p&&ml(n,p[e]))return n;if(yl(s[e],l[e],n),f){var d=this._getFollowScales(e);this.updateFollow(d,s[e],h)}var y=c.animate;return c.setAnimate(!1),c.forceUpdate((function(){c.setAnimate(y)})),n}}},{key:"updateFollow",value:function(t,e,n){vl(t,e,n)}},{key:"_getScale",value:function(t){var e=this.props,n=e.coord,r=e.chart;return"x"===t?n.transposed?r.getYScales()[0]:r.getXScales()[0]:n.transposed?r.getXScales()[0]:r.getYScales()[0]}},{key:"_getFollowScales",value:function(t){var e=this.props,n=e.coord,r=e.chart;return"x"===t?n.transposed?r.getXScales():r.getYScales():"y"===t?n.transposed?r.getYScales():r.getXScales():void 0}},{key:"_bindEvents",value:function(){var t=this,e=this.props,n=this.scale,r=this.context.canvas,i=e.onPinchStart,a=e.onPanStart,o=e.onPanEnd,u=e.pinch,s=e.swipe,l=e.onInit,c=e.onPan,h=e.onPinch,f=e.onPinchEnd;!1!==e.pan&&(r.on("panstart",(function(){t.onStart(),a({scale:n})})),r.on("pan",(function(e){t.onPan(e),c(e)})),r.on("panend",(function(){t.onEnd(),o({scale:n})}))),!1!==u&&(r.on("pinchstart",(function(){t.onStart(),i()})),r.on("pinch",(function(e){t.onPinch(e),h(e)})),r.on("pinchend",(function(){t.onEnd(),f({scale:n})}))),!1!==s&&r.on("swipe",this.onSwipe),l({scale:n})}},{key:"_clearEvents",value:function(){var t=this,e=this.props,n=this.scale,r=this.context.canvas,i=e.onPinchEnd,a=e.onPanEnd,o=e.onPinchStart,u=e.pinch,s=e.onPan,l=e.onPinch,c=e.swipe;!1!==e.pan&&(r.off("panstart",(function(){t.onStart(),o()})),r.off("pan",(function(e){t.onPan(e),s(e)})),r.off("panend",(function(){t.onEnd(),a({scale:n})}))),!1!==u&&(r.off("pinchstart",(function(){t.onStart(),o()})),r.off("pinch",(function(e){t.onPinch(e),l(e)})),r.off("pinchend",(function(){t.onEnd(),i({scale:n})}))),!1!==c&&r.off("swipe",this.onSwipe)}}]),n}(st),kl=function(t){return function(e){ft(r,e);var n=wt(r);function r(){return at(this,r),n.apply(this,arguments)}return ut(r,[{key:"willMount",value:function(){Gi(dt(r.prototype),"willMount",this).call(this);var t=this.props,e=t.visible,n=t.position,i=void 0===n?"bottom":n,a=t.margin,o=t.chart,u=this.context.px2hd(void 0===a?"16px":a);if(!1===e)return null;o.updateCoordFor(this,{position:i,width:"left"===i||"right"===i?u:0,height:"bottom"===i||"top"===i?u:0})}},{key:"render",value:function(){var e=this.props,n=this.state;return!1===e.visible?null:tr(t,o(o({position:"bottom"},e),n))}}]),r}(xl)},wl=function(t,e){var n=t.coord,r=t.range,i=t.position,a=t.layout,o=n.left,u=n.width,s=a.top,l=a.height,c=Ze((null==r?void 0:r.x)||(null==r?void 0:r.y),2),h=c[0],f=u*h,p=u*(c[1]-h);return tr("group",{style:{left:o,top:"top"===i?s-e.px2hd("8px"):s+l}},tr("line",{style:{position:"absolute",left:0,width:u,height:0},attrs:{stroke:"rgba(202, 215, 239, .2)",lineCap:"round",lineWidth:"8px"}}),tr("line",{style:{position:"absolute",left:f,width:p,height:0},attrs:{stroke:"rgba(202, 215, 239, .5)",lineCap:"round",lineWidth:"8px"}}))},bl=function(t,e){var n=t.coord,r=t.range,i=t.position,a=t.layout,o=n.top,u=n.height,s=a.left,l=a.width,c=Ze((null==r?void 0:r.y)||(null==r?void 0:r.x),2),h=c[0],f=u*h,p=u*(c[1]-h);return tr("group",{style:{top:o,left:"left"===i?s-e.px2hd("8px"):s+l}},tr("line",{style:{position:"absolute",top:0,left:0,width:0,height:u},attrs:{stroke:"rgba(202, 215, 239, .2)",lineCap:"round",lineWidth:"8px"}}),tr("line",{style:{position:"absolute",top:f,width:0,height:p},attrs:{stroke:"rgba(202, 215, 239, .5)",lineCap:"round",lineWidth:"8px"}}))},Ml=function(t){var e=t.position;return t.mode.length>1?tr("group",null,tr(bl,o({},t)),tr(wl,o({},t))):tr("left"===e||"right"===e?bl:wl,o({},t))},_l=kl(Ml);t.ArcGuide=hs,t.Area=Pu,t.AreaView=Su,t.Axis=Ku,t.AxisView=Ju,t.Canvas=zi,t.Chart=Fo,t.Children=it,t.Component=st,t.Fragment=function(t){return t.children},t.Gauge=pl,t.GaugeView=fl,t.Geometry=du,t.Guide=ys,t.ImageGuide=ps,t.Interval=Lu,t.IntervalView=Yu,t.Legend=ns,t.LegendView=es,t.Line=Mu,t.LineGuide=cs,t.LineView=bu,t.PieLabel=ll,t.PieLabelView=sl,t.Point=Bu,t.PointGuide=ls,t.PointView=Fu,t.RectGuide=fs,t.ScrollBar=_l,t.ScrollBarView=Ml,t.Sunburst=Qs,t.SunburstView=Js,t.TagGuide=ds,t.TextGuide=ss,t.Timeline=bt,t.Tooltip=Ms,t.TooltipView=bs,t.Treemap=Us,t.TreemapView=qs,t.Zoom=xl,t.createElement=tr,t.createRef=gs,t.jsx=tr,t.render=function(t,e,n){return fi(t,e,n)},t.renderShape=Ei,t.withArea=_u,t.withAxis=Xu,t.withGauge=hl,t.withGuide=rs,t.withInterval=Du,t.withLegend=Qu,t.withLine=xu,t.withPieLabel=ul,t.withPoint=Ru,t.withScrollBar=kl,t.withSunburst=$s,t.withTooltip=vs,t.withTreemap=Gs,Object.defineProperty(t,"__esModule",{value:!0})}));