1 |
- import{U as e,V as t}from"./vendor.075d5207.js";var i={},n={},r={},a=2311;var o=function(){return a++};var s="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(e){var t={},i={},n=e.match(/Firefox\/([\d.]+)/),r=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(i.firefox=!0,i.version=n[1]);r&&(i.ie=!0,i.version=r[1]);a&&(i.edge=!0,i.version=a[1]);o&&(i.weChat=!0);return{browser:i,os:t,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!i.ie&&!i.edge,pointerEventsSupported:"onpointerdown"in window&&(i.edge||i.ie&&i.version>=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent),l={},u={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},h={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},c=Object.prototype.toString,d=Array.prototype,f=d.forEach,p=d.filter,g=d.slice,m=d.map,v=d.reduce,y={};function _(e){if(null==e||"object"!=typeof e)return e;var t=e,i=c.call(e);if("[object Array]"===i){if(!E(e)){t=[];for(var n=0,r=e.length;n<r;n++)t[n]=_(e[n])}}else if(h[i]){if(!E(e)){var a=e.constructor;if(e.constructor.from)t=a.from(e);else{t=new a(e.length);for(n=0,r=e.length;n<r;n++)t[n]=_(e[n])}}}else if(!u[i]&&!E(e)&&!D(e))for(var o in t={},e)e.hasOwnProperty(o)&&(t[o]=_(e[o]));return t}function x(e,t,i){if(!I(t)||!I(e))return i?_(t):e;for(var n in t)if(t.hasOwnProperty(n)){var r=e[n],a=t[n];!I(a)||!I(r)||A(a)||A(r)||D(a)||D(r)||C(a)||C(r)||E(a)||E(r)?!i&&n in e||(e[n]=_(t[n])):x(r,a,i)}return e}function b(e,t,i){for(var n in t)t.hasOwnProperty(n)&&(i?null!=t[n]:null==e[n])&&(e[n]=t[n]);return e}var w,T=function(){return y.createCanvas()};function S(e,t,i){if(e&&t)if(e.forEach&&e.forEach===f)e.forEach(t,i);else if(e.length===+e.length)for(var n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(i,e[a],a,e)}function M(e,t){var i=g.call(arguments,2);return function(){return e.apply(t,i.concat(g.call(arguments)))}}function A(e){return"[object Array]"===c.call(e)}function I(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function C(e){return!!u[c.call(e)]}function D(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}y.createCanvas=function(){return document.createElement("canvas")};function E(e){return e.__ec_primitive__}function L(e){var t=A(e);this.data={};var i=this;function n(e,n){t?i.set(e,n):i.set(n,e)}e instanceof L?e.each(n):e&&S(e,n)}L.prototype={constructor:L,get:function(e){return this.data.hasOwnProperty(e)?this.data[e]:null},set:function(e,t){return this.data[e]=t},each:function(e,t){for(var i in void 0!==t&&(e=M(e,t)),this.data)this.data.hasOwnProperty(i)&&e(this.data[i],i)},removeKey:function(e){delete this.data[e]}},l.$override=function(e,t){"createCanvas"===e&&(w=null),y[e]=t},l.clone=_,l.merge=x,l.mergeAll=function(e,t){for(var i=e[0],n=1,r=e.length;n<r;n++)i=x(i,e[n],t);return i},l.extend=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},l.defaults=b,l.createCanvas=T,l.getContext=function(){return w||(w=T().getContext("2d")),w},l.indexOf=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i}return-1},l.inherits=function(e,t){var i=e.prototype;function n(){}for(var r in n.prototype=t.prototype,e.prototype=new n,i)i.hasOwnProperty(r)&&(e.prototype[r]=i[r]);e.prototype.constructor=e,e.superClass=t},l.mixin=function(e,t,i){b(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,i)},l.isArrayLike=function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},l.each=S,l.map=function(e,t,i){if(e&&t){if(e.map&&e.map===m)return e.map(t,i);for(var n=[],r=0,a=e.length;r<a;r++)n.push(t.call(i,e[r],r,e));return n}},l.reduce=function(e,t,i,n){if(e&&t){if(e.reduce&&e.reduce===v)return e.reduce(t,i,n);for(var r=0,a=e.length;r<a;r++)i=t.call(n,i,e[r],r,e);return i}},l.filter=function(e,t,i){if(e&&t){if(e.filter&&e.filter===p)return e.filter(t,i);for(var n=[],r=0,a=e.length;r<a;r++)t.call(i,e[r],r,e)&&n.push(e[r]);return n}},l.find=function(e,t,i){if(e&&t)for(var n=0,r=e.length;n<r;n++)if(t.call(i,e[n],n,e))return e[n]},l.bind=M,l.curry=function(e){var t=g.call(arguments,1);return function(){return e.apply(this,t.concat(g.call(arguments)))}},l.isArray=A,l.isFunction=function(e){return"function"==typeof e},l.isString=function(e){return"[object String]"===c.call(e)},l.isObject=I,l.isBuiltInObject=C,l.isTypedArray=function(e){return!!h[c.call(e)]},l.isDom=D,l.eqNaN=function(e){return e!=e},l.retrieve=function(e){for(var t=0,i=arguments.length;t<i;t++)if(null!=arguments[t])return arguments[t]},l.retrieve2=function(e,t){return null!=e?e:t},l.retrieve3=function(e,t,i){return null!=e?e:null!=t?t:i},l.slice=function(){return Function.call.apply(g,arguments)},l.normalizeCssArray=function(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e},l.assert=function(e,t){if(!e)throw new Error(t)},l.trim=function(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},l.setAsPrimitive=function(e){e.__ec_primitive__=!0},l.isPrimitive=E,l.createHashMap=function(e){return new L(e)},l.concatArray=function(e,t){for(var i=new e.constructor(e.length+t.length),n=0;n<e.length;n++)i[n]=e[n];var r=e.length;for(n=0;n<t.length;n++)i[n+r]=t[n];return i},l.noop=function(){};var P={},N="undefined"==typeof Float32Array?Array:Float32Array;function R(e){return Math.sqrt(k(e))}var O=R;function k(e){return e[0]*e[0]+e[1]*e[1]}var z=k;function B(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var F=B;function V(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var G=V;function H(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}function U(e,t){return{target:e,topTarget:t&&t.topTarget}}P.create=function(e,t){var i=new N(2);return null==e&&(e=0),null==t&&(t=0),i[0]=e,i[1]=t,i},P.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},P.clone=function(e){var t=new N(2);return t[0]=e[0],t[1]=e[1],t},P.set=function(e,t,i){return e[0]=t,e[1]=i,e},P.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},P.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},P.sub=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},P.len=R,P.length=O,P.lenSquare=k,P.lengthSquare=z,P.mul=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},P.div=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},P.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},P.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},P.normalize=function(e,t){var i=R(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e},P.distance=B,P.dist=F,P.distanceSquare=V,P.distSquare=G,P.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},P.lerp=function(e,t,i,n){return e[0]=t[0]+n*(i[0]-t[0]),e[1]=t[1]+n*(i[1]-t[1]),e},P.applyTransform=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r+i[4],e[1]=i[1]*n+i[3]*r+i[5],e},P.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},P.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},H.prototype={constructor:H,_dragStart:function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.dispatchToElement(U(t,e),"dragstart",e.event))},_drag:function(e){var t=this._draggingTarget;if(t){var i=e.offsetX,n=e.offsetY,r=i-this._x,a=n-this._y;this._x=i,this._y=n,t.drift(r,a,e),this.dispatchToElement(U(t,e),"drag",e.event);var o=this.findHover(i,n,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.dispatchToElement(U(s,e),"dragleave",e.event),o&&o!==s&&this.dispatchToElement(U(o,e),"dragenter",e.event))}},_dragEnd:function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.dispatchToElement(U(t,e),"dragend",e.event),this._dropTarget&&this.dispatchToElement(U(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null}};var W=H,j=Array.prototype.slice,X=function(e){this._$handlers={},this._$eventProcessor=e};function Z(e,t,i,n,r,a){var o=e._$handlers;if("function"==typeof i&&(r=n,n=i,i=null),!n||!t)return e;i=function(e,t){var i=e._$eventProcessor;return null!=t&&i&&i.normalizeQuery&&(t=i.normalizeQuery(t)),t}(e,i),o[t]||(o[t]=[]);for(var s=0;s<o[t].length;s++)if(o[t][s].h===n)return e;var l={h:n,one:a,query:i,ctx:r||e,callAtLast:n.zrEventfulCallAtLast},u=o[t].length-1,h=o[t][u];return h&&h.callAtLast?o[t].splice(u,0,l):o[t].push(l),e}X.prototype={constructor:X,one:function(e,t,i,n){return Z(this,e,t,i,n,!0)},on:function(e,t,i,n){return Z(this,e,t,i,n,!1)},isSilent:function(e){var t=this._$handlers;return!t[e]||!t[e].length},off:function(e,t){var i=this._$handlers;if(!e)return this._$handlers={},this;if(t){if(i[e]){for(var n=[],r=0,a=i[e].length;r<a;r++)i[e][r].h!==t&&n.push(i[e][r]);i[e]=n}i[e]&&0===i[e].length&&delete i[e]}else delete i[e];return this},trigger:function(e){var t=this._$handlers[e],i=this._$eventProcessor;if(t){var n=arguments,r=n.length;r>3&&(n=j.call(n,1));for(var a=t.length,o=0;o<a;){var s=t[o];if(i&&i.filter&&null!=s.query&&!i.filter(e,s.query))o++;else{switch(r){case 1:s.h.call(s.ctx);break;case 2:s.h.call(s.ctx,n[1]);break;case 3:s.h.call(s.ctx,n[1],n[2]);break;default:s.h.apply(s.ctx,n)}s.one?(t.splice(o,1),a--):o++}}}return i&&i.afterTrigger&&i.afterTrigger(e),this},triggerWithContext:function(e){var t=this._$handlers[e],i=this._$eventProcessor;if(t){var n=arguments,r=n.length;r>4&&(n=j.call(n,1,n.length-1));for(var a=n[n.length-1],o=t.length,s=0;s<o;){var l=t[s];if(i&&i.filter&&null!=l.query&&!i.filter(e,l.query))s++;else{switch(r){case 1:l.h.call(a);break;case 2:l.h.call(a,n[1]);break;case 3:l.h.call(a,n[1],n[2]);break;default:l.h.apply(a,n)}l.one?(t.splice(s,1),o--):s++}}}return i&&i.afterTrigger&&i.afterTrigger(e),this}};var q=X,Y={},K={},Q={},J=Math.log(2);function $(e,t,i,n,r,a){var o=n+"-"+r,s=e.length;if(a.hasOwnProperty(o))return a[o];if(1===t){var l=Math.round(Math.log((1<<s)-1&~r)/J);return e[i][l]}for(var u=n|1<<i,h=i+1;n&1<<h;)h++;for(var c=0,d=0,f=0;d<s;d++){var p=1<<d;p&r||(c+=(f%2?-1:1)*e[i][d]*$(e,t-1,h,u,r|p,a),f++)}return a[o]=c,c}Q.buildTransformer=function(e,t){var i=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],n={},r=$(i,8,0,0,0,n);if(0!==r){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)null==a[s]&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*$(i,7,0===o?1:0,1<<o,1<<s,n)/r*t[o];return function(e,t,i){var n=t*a[6]+i*a[7]+1;e[0]=(t*a[0]+i*a[1]+a[2])/n,e[1]=(t*a[3]+i*a[4]+a[5])/n}}};var ee=s,te=Q.buildTransformer,ie=[];function ne(e,t,i,n,r){if(t.getBoundingClientRect&&ee.domSupported&&!re(t)){var a=t.___zrEVENTSAVED||(t.___zrEVENTSAVED={}),o=function(e,t){var i=t.markers;if(i)return i;i=t.markers=[];for(var n=["left","right"],r=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=a%2,l=(a>>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[s]+":0",r[l]+":0",n[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),e.appendChild(o),i.push(o)}return i}(t,a),s=function(e,t,i){for(var n=i?"invTrans":"trans",r=t[n],a=t.srcCoords,o=!0,s=[],l=[],u=0;u<4;u++){var h=e[u].getBoundingClientRect(),c=2*u,d=h.left,f=h.top;s.push(d,f),o=o&&a&&d===a[c]&&f===a[c+1],l.push(e[u].offsetLeft,e[u].offsetTop)}return o&&r?r:(t.srcCoords=s,t[n]=i?te(l,s):te(s,l))}(o,a,r);if(s)return s(e,i,n),!0}return!1}function re(e){return"CANVAS"===e.nodeName.toUpperCase()}K.transformLocalCoord=function(e,t,i,n,r){return ne(ie,t,n,r,!0)&&ne(e,i,ie[0],ie[1])},K.transformCoordWithViewport=ne,K.isCanvasEl=re;var ae=q;Y.Dispatcher=ae;var oe=s,se=K,le=se.isCanvasEl,ue=se.transformCoordWithViewport,he="undefined"!=typeof window&&!!window.addEventListener,ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,de=[];function fe(e,t,i,n){return i=i||{},n||!oe.canvasSupported?pe(e,t,i):oe.browser.firefox&&null!=t.layerX&&t.layerX!==t.offsetX?(i.zrX=t.layerX,i.zrY=t.layerY):null!=t.offsetX?(i.zrX=t.offsetX,i.zrY=t.offsetY):pe(e,t,i),i}function pe(e,t,i){if(oe.domSupported&&e.getBoundingClientRect){var n=t.clientX,r=t.clientY;if(le(e)){var a=e.getBoundingClientRect();return i.zrX=n-a.left,void(i.zrY=r-a.top)}if(ue(de,e,n,r))return i.zrX=de[0],void(i.zrY=de[1])}i.zrX=i.zrY=0}function ge(e){return e||window.event}var me=he?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};Y.clientToLocal=fe,Y.getNativeEvent=ge,Y.normalizeEvent=function(e,t,i){if(null!=(t=ge(t)).zrX)return t;var n=t.type;if(n&&n.indexOf("touch")>=0){var r="touchend"!==n?t.targetTouches[0]:t.changedTouches[0];r&&fe(e,r,t,i)}else fe(e,t,t,i),t.zrDelta=t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3;var a=t.button;return null==t.which&&void 0!==a&&ce.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t},Y.addEventListener=function(e,t,i,n){he?e.addEventListener(t,i,n):e.attachEvent("on"+t,i)},Y.removeEventListener=function(e,t,i,n){he?e.removeEventListener(t,i,n):e.detachEvent("on"+t,i)},Y.stop=me,Y.isMiddleOrRightButtonOnMouseUpDown=function(e){return 2===e.which||3===e.which},Y.notLeftMouse=function(e){return e.which>1};var ve=Y,ye=function(){this._track=[]};function _e(e){var t=e[1][0]-e[0][0],i=e[1][1]-e[0][1];return Math.sqrt(t*t+i*i)}ye.prototype={constructor:ye,recognize:function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},clear:function(){return this._track.length=0,this},_doTrack:function(e,t,i){var n=e.touches;if(n){for(var r={points:[],touches:[],target:t,event:e},a=0,o=n.length;a<o;a++){var s=n[a],l=ve.clientToLocal(i,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},_recognize:function(e){for(var t in xe)if(xe.hasOwnProperty(t)){var i=xe[t](this._track,e);if(i)return i}}};var xe={pinch:function(e,t){var i=e.length;if(i){var n,r=(e[i-1]||{}).points,a=(e[i-2]||{}).points||r;if(a&&a.length>1&&r&&r.length>1){var o=_e(r)/_e(a);!isFinite(o)&&(o=1),t.pinchScale=o;var s=[((n=r)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}},be=l,we=P,Te=W,Se=q,Me=Y,Ae=ye;function Ie(){Me.stop(this.event)}function Ce(){}Ce.prototype.dispose=function(){};var De=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Ee=function(e,t,i,n){Se.call(this),this.storage=e,this.painter=t,this.painterRoot=n,i=i||new Ce,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,Te.call(this),this.setHandlerProxy(i)};function Le(e,t,i){if(e[e.rectHover?"rectContain":"contain"](t,i)){for(var n,r=e;r;){if(r.clipPath&&!r.clipPath.contain(t,i))return!1;r.silent&&(n=!0),r=r.parent}return!n||"silent"}return!1}function Pe(e,t,i){var n=e.painter;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}Ee.prototype={constructor:Ee,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(be.each(De,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},mousemove:function(e){var t=e.zrX,i=e.zrY,n=Pe(this,t,i),r=this._hovered,a=r.target;a&&!a.__zr&&(a=(r=this.findHover(r.x,r.y)).target);var o=this._hovered=n?{x:t,y:i}:this.findHover(t,i),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(r,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==a&&this.dispatchToElement(o,"mouseover",e)},mouseout:function(e){var t=e.zrEventControl,i=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&!i&&this.trigger("globalout",{type:"globalout",event:e})},resize:function(e){this._hovered={}},dispatch:function(e,t){var i=this[e];i&&i.call(this,t)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},dispatchToElement:function(e,t,i){var n=(e=e||{}).target;if(!n||!n.silent){for(var r="on"+t,a=function(e,t,i){return{type:e,event:i,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:Ie}}(t,e,i);n&&(n[r]&&(a.cancelBubble=n[r].call(n,a)),n.trigger(t,a),n=n.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer((function(e){"function"==typeof e[r]&&e[r].call(e,a),e.trigger&&e.trigger(t,a)})))}},findHover:function(e,t,i){for(var n=this.storage.getDisplayList(),r={x:e,y:t},a=n.length-1;a>=0;a--){var o;if(n[a]!==i&&!n[a].ignore&&(o=Le(n[a],e,t))&&(!r.topTarget&&(r.topTarget=n[a]),"silent"!==o)){r.target=n[a];break}}return r},processGesture:function(e,t){this._gestureMgr||(this._gestureMgr=new Ae);var i=this._gestureMgr;"start"===t&&i.clear();var n=i.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&i.clear(),n){var r=n.type;e.gestureEvent=r,this.dispatchToElement({target:n.target},r,n.event)}}},be.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Ee.prototype[e]=function(t){var i,n,r=t.zrX,a=t.zrY,o=Pe(this,r,a);if("mouseup"===e&&o||(n=(i=this.findHover(r,a)).target),"mousedown"===e)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===e)this._upEl=n;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||we.dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,e,t)}})),be.mixin(Ee,Se),be.mixin(Ee,Te);var Ne=Ee,Re={},Oe="undefined"==typeof Float32Array?Array:Float32Array;function ke(){var e=new Oe(6);return ze(e),e}function ze(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Be(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}Re.create=ke,Re.identity=ze,Re.copy=Be,Re.mul=function(e,t,i){var n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],o=t[1]*i[2]+t[3]*i[3],s=t[0]*i[4]+t[2]*i[5]+t[4],l=t[1]*i[4]+t[3]*i[5]+t[5];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e},Re.translate=function(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e},Re.rotate=function(e,t,i){var n=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+o*u,e[1]=-n*u+o*h,e[2]=r*h+s*u,e[3]=-r*u+h*s,e[4]=h*a+u*l,e[5]=h*l-u*a,e},Re.scale=function(e,t,i){var n=i[0],r=i[1];return e[0]=t[0]*n,e[1]=t[1]*r,e[2]=t[2]*n,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*r,e},Re.invert=function(e,t){var i=t[0],n=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=i*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*r)*l,e[5]=(a*r-i*s)*l,e):null},Re.clone=function(e){var t=ke();return Be(t,e),t};var Fe=Re,Ve=P,Ge=Fe.identity;function He(e){return e>5e-5||e<-5e-5}var Ue=function(e){(e=e||{}).position||(this.position=[0,0]),null==e.rotation&&(this.rotation=0),e.scale||(this.scale=[1,1]),this.origin=this.origin||null},We=Ue.prototype;We.transform=null,We.needLocalTransform=function(){return He(this.rotation)||He(this.position[0])||He(this.position[1])||He(this.scale[0]-1)||He(this.scale[1]-1)};var je=[];We.updateTransform=function(){var e=this.parent,t=e&&e.transform,i=this.needLocalTransform(),n=this.transform;if(i||t){n=n||Fe.create(),i?this.getLocalTransform(n):Ge(n),t&&(i?Fe.mul(n,e.transform,n):Fe.copy(n,e.transform)),this.transform=n;var r=this.globalScaleRatio;if(null!=r&&1!==r){this.getGlobalScale(je);var a=je[0]<0?-1:1,o=je[1]<0?-1:1,s=((je[0]-a)*r+a)/je[0]||0,l=((je[1]-o)*r+o)/je[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||Fe.create(),Fe.invert(this.invTransform,n)}else n&&Ge(n)},We.getLocalTransform=function(e){return Ue.getLocalTransform(this,e)},We.setTransform=function(e){var t=this.transform,i=e.dpr||1;t?e.setTransform(i*t[0],i*t[1],i*t[2],i*t[3],i*t[4],i*t[5]):e.setTransform(i,0,0,i,0,0)},We.restoreTransform=function(e){var t=e.dpr||1;e.setTransform(t,0,0,t,0,0)};var Xe=[],Ze=Fe.create();We.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=this.position,r=this.scale;He(t-1)&&(t=Math.sqrt(t)),He(i-1)&&(i=Math.sqrt(i)),e[0]<0&&(t=-t),e[3]<0&&(i=-i),n[0]=e[4],n[1]=e[5],r[0]=t,r[1]=i,this.rotation=Math.atan2(-e[1]/i,e[0]/t)}},We.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(Fe.mul(Xe,e.invTransform,t),t=Xe);var i=this.origin;i&&(i[0]||i[1])&&(Ze[4]=i[0],Ze[5]=i[1],Fe.mul(Xe,t,Ze),Xe[4]-=i[0],Xe[5]-=i[1],t=Xe),this.setLocalTransform(t)}},We.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},We.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&Ve.applyTransform(i,i,n),i},We.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&Ve.applyTransform(i,i,n),i},Ue.getLocalTransform=function(e,t){Ge(t=t||[]);var i=e.origin,n=e.scale||[1,1],r=e.rotation||0,a=e.position||[0,0];return i&&(t[4]-=i[0],t[5]-=i[1]),Fe.scale(t,t,n),r&&Fe.rotate(t,t,r),i&&(t[4]+=i[0],t[5]+=i[1]),t[4]+=a[0],t[5]+=a[1],t};var qe=Ue,Ye={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=n*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-Ye.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*Ye.bounceIn(2*e):.5*Ye.bounceOut(2*e-1)+.5}},Ke=Ye;function Qe(e){this._target=e.target,this._life=e.life||1e3,this._delay=e.delay||0,this._initialized=!1,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this._pausedTime=0,this._paused=!1}Qe.prototype={constructor:Qe,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var i=(e-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,r="string"==typeof n?Ke[n]:n,a="function"==typeof r?r(i):i;return this.fire("frame",a),1===i?this.loop?(this.restart(e),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(e,t){this[e="on"+e]&&this[e](this._target,t)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var Je=Qe,$e={},et=function(){this.head=null,this.tail=null,this._len=0},tt=et.prototype;tt.insert=function(e){var t=new it(e);return this.insertEntry(t),t},tt.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},tt.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},tt.len=function(){return this._len},tt.clear=function(){this.head=this.tail=null,this._len=0};var it=function(e){this.value=e,this.next,this.prev},nt=function(e){this._list=new et,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},rt=nt.prototype;rt.put=function(e,t){var i=this._list,n=this._map,r=null;if(null==n[e]){var a=i.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=i.head;i.remove(s),delete n[s.key],r=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new it(t),o.key=e,i.insertEntry(o),n[e]=o}return r},rt.get=function(e){var t=this._map[e],i=this._list;if(null!=t)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},rt.clear=function(){this._list.clear(),this._map={}};var at=nt,ot={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function st(e){return(e=Math.round(e))<0?0:e>255?255:e}function lt(e){return e<0?0:e>1?1:e}function ut(e){return e.length&&"%"===e.charAt(e.length-1)?st(parseFloat(e)/100*255):st(parseInt(e,10))}function ht(e){return e.length&&"%"===e.charAt(e.length-1)?lt(parseFloat(e)/100):lt(parseFloat(e))}function ct(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function dt(e,t,i){return e+(t-e)*i}function ft(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}function pt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var gt=new at(20),mt=null;function vt(e,t){mt&&pt(mt,t),mt=gt.put(e,mt||t.slice())}function yt(e,t){if(e){t=t||[];var i=gt.get(e);if(i)return pt(t,i);var n,r=(e+="").replace(/ /g,"").toLowerCase();if(r in ot)return pt(t,ot[r]),vt(e,t),t;if("#"===r.charAt(0))return 4===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=4095?(ft(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),vt(e,t),t):void ft(t,0,0,0,1):7===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=16777215?(ft(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),vt(e,t),t):void ft(t,0,0,0,1):void 0;var a=r.indexOf("("),o=r.indexOf(")");if(-1!==a&&o+1===r.length){var s=r.substr(0,a),l=r.substr(a+1,o-(a+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void ft(t,0,0,0,1);u=ht(l.pop());case"rgb":return 3!==l.length?void ft(t,0,0,0,1):(ft(t,ut(l[0]),ut(l[1]),ut(l[2]),u),vt(e,t),t);case"hsla":return 4!==l.length?void ft(t,0,0,0,1):(l[3]=ht(l[3]),_t(l,t),vt(e,t),t);case"hsl":return 3!==l.length?void ft(t,0,0,0,1):(_t(l,t),vt(e,t),t);default:return}}ft(t,0,0,0,1)}}function _t(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=ht(e[1]),r=ht(e[2]),a=r<=.5?r*(n+1):r+n-r*n,o=2*r-a;return ft(t=t||[],st(255*ct(o,a,i+1/3)),st(255*ct(o,a,i)),st(255*ct(o,a,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function xt(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),o=t[r],s=t[a],l=n-r;return i[0]=st(dt(o[0],s[0],l)),i[1]=st(dt(o[1],s[1],l)),i[2]=st(dt(o[2],s[2],l)),i[3]=lt(dt(o[3],s[3],l)),i}}var bt=xt;function wt(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),o=yt(t[r]),s=yt(t[a]),l=n-r,u=St([st(dt(o[0],s[0],l)),st(dt(o[1],s[1],l)),st(dt(o[2],s[2],l)),lt(dt(o[3],s[3],l))],"rgba");return i?{color:u,leftIndex:r,rightIndex:a,value:n}:u}}var Tt=wt;function St(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}}$e.parse=yt,$e.lift=function(e,t){var i=yt(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0,i[n]>255?i[n]=255:e[n]<0&&(i[n]=0);return St(i,4===i.length?"rgba":"rgb")}},$e.toHex=function(e){var t=yt(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},$e.fastLerp=xt,$e.fastMapToColor=bt,$e.lerp=wt,$e.mapToColor=Tt,$e.modifyHSL=function(e,t,i,n){if(e=yt(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=ht(i)),null!=n&&(e[2]=ht(n)),St(_t(e),"rgba")},$e.modifyAlpha=function(e,t){if((e=yt(e))&&null!=t)return e[3]=lt(t),St(e,"rgba")},$e.stringify=St;var Mt=Je,At=$e,It=l.isArrayLike,Ct=Array.prototype.slice;function Dt(e,t){return e[t]}function Et(e,t,i){e[t]=i}function Lt(e,t,i){return(t-e)*i+e}function Pt(e,t,i){return i>.5?t:e}function Nt(e,t,i,n,r){var a=e.length;if(1===r)for(var o=0;o<a;o++)n[o]=Lt(e[o],t[o],i);else{var s=a&&e[0].length;for(o=0;o<a;o++)for(var l=0;l<s;l++)n[o][l]=Lt(e[o][l],t[o][l],i)}}function Rt(e,t,i){var n=e.length,r=t.length;if(n!==r)if(n>r)e.length=r;else for(var a=n;a<r;a++)e.push(1===i?t[a]:Ct.call(t[a]));var o=e[0]&&e[0].length;for(a=0;a<e.length;a++)if(1===i)isNaN(e[a])&&(e[a]=t[a]);else for(var s=0;s<o;s++)isNaN(e[a][s])&&(e[a][s]=t[a][s])}function Ot(e,t,i){if(e===t)return!0;var n=e.length;if(n!==t.length)return!1;if(1===i){for(var r=0;r<n;r++)if(e[r]!==t[r])return!1}else{var a=e[0].length;for(r=0;r<n;r++)for(var o=0;o<a;o++)if(e[r][o]!==t[r][o])return!1}return!0}function kt(e,t,i,n,r,a,o,s,l){var u=e.length;if(1===l)for(var h=0;h<u;h++)s[h]=zt(e[h],t[h],i[h],n[h],r,a,o);else{var c=e[0].length;for(h=0;h<u;h++)for(var d=0;d<c;d++)s[h][d]=zt(e[h][d],t[h][d],i[h][d],n[h][d],r,a,o)}}function zt(e,t,i,n,r,a,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*a+s*r+t}function Bt(e){if(It(e)){var t=e.length;if(It(e[0])){for(var i=[],n=0;n<t;n++)i.push(Ct.call(e[n]));return i}return Ct.call(e)}return e}function Ft(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function Vt(e,t,i,n,r,a){var o=e._getter,s=e._setter,l="spline"===t,u=n.length;if(u){var h,c=n[0].value,d=It(c),f=!1,p=!1,g=d?function(e){var t=e[e.length-1].value;return It(t&&t[0])?2:1}(n):0;n.sort((function(e,t){return e.time-t.time})),h=n[u-1].time;for(var m=[],v=[],y=n[0].value,_=!0,x=0;x<u;x++){m.push(n[x].time/h);var b=n[x].value;if(d&&Ot(b,y,g)||!d&&b===y||(_=!1),y=b,"string"==typeof b){var w=At.parse(b);w?(b=w,f=!0):p=!0}v.push(b)}if(a||!_){var T=v[u-1];for(x=0;x<u-1;x++)d?Rt(v[x],T,g):!isNaN(v[x])||isNaN(T)||p||f||(v[x]=T);d&&Rt(o(e._target,r),T,g);var S,M,A,I,C,D=0,E=0;if(f)var L=[0,0,0,0];var P=new Mt({target:e._target,life:h,loop:e._loop,delay:e._delay,onframe:function(e,t){var i;if(t<0)i=0;else if(t<E){for(i=Math.min(D+1,u-1);i>=0&&!(m[i]<=t);i--);i=Math.min(i,u-2)}else{for(i=D;i<u&&!(m[i]>t);i++);i=Math.min(i-1,u-2)}D=i,E=t;var n=m[i+1]-m[i];if(0!==n)if(S=(t-m[i])/n,l)if(A=v[i],M=v[0===i?i:i-1],I=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)kt(M,A,I,C,S,S*S,S*S*S,o(e,r),g);else{if(f)a=kt(M,A,I,C,S,S*S,S*S*S,L,1),a=Ft(L);else{if(p)return Pt(A,I,S);a=zt(M,A,I,C,S,S*S,S*S*S)}s(e,r,a)}else if(d)Nt(v[i],v[i+1],S,o(e,r),g);else{var a;if(f)Nt(v[i],v[i+1],S,L,1),a=Ft(L);else{if(p)return Pt(v[i],v[i+1],S);a=Lt(v[i],v[i+1],S)}s(e,r,a)}},ondestroy:i});return t&&"spline"!==t&&(P.easing=t),P}}}var Gt=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||Dt,this._setter=n||Et,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};Gt.prototype={when:function(e,t){var i=this._tracks;for(var n in t)if(t.hasOwnProperty(n)){if(!i[n]){i[n]=[];var r=this._getter(this._target,n);if(null==r)continue;0!==e&&i[n].push({time:0,value:Bt(r)})}i[n].push({time:e,value:t[n]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].pause();this._paused=!0},resume:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var e=this._doneList,t=e.length,i=0;i<t;i++)e[i].call(this)},start:function(e,t){var i,n=this,r=0,a=function(){--r||n._doneCallback()};for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=Vt(this,e,a,this._tracks[o],o,t);s&&(this._clipList.push(s),r++,this.animation&&this.animation.addClip(s),i=s)}if(i){var l=i.onframe;i.onframe=function(e,t){l(e,t);for(var i=0;i<n._onframeList.length;i++)n._onframeList[i](e,t)}}return r||this._doneCallback(),this},stop:function(e){for(var t=this._clipList,i=this.animation,n=0;n<t.length;n++){var r=t[n];e&&r.onframe(this._target,1),i&&i.removeClip(r)}t.length=0},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this},getClips:function(){return this._clipList}};var Ht=Gt,Ut={},Wt=1;"undefined"!=typeof window&&(Wt=Math.max(window.devicePixelRatio||1,1));var jt=Wt;Ut.debugMode=0,Ut.devicePixelRatio=jt;var Xt=function(){};1===Ut.debugMode&&(Xt=console.error);var Zt=Xt,qt=Ht,Yt=Zt,Kt=l,Qt=Kt.isString,Jt=Kt.isFunction,$t=Kt.isObject,ei=Kt.isArrayLike,ti=Kt.indexOf,ii=function(){this.animators=[]};function ni(e,t,i,n,r,a,o,s){Qt(n)?(a=r,r=n,n=0):Jt(r)?(a=r,r="linear",n=0):Jt(n)?(a=n,n=0):Jt(i)?(a=i,i=500):i||(i=500),e.stopAnimation(),ri(e,"",e,t,i,n,s);var l=e.animators.slice(),u=l.length;function h(){--u||a&&a()}u||a&&a();for(var c=0;c<l.length;c++)l[c].done(h).start(r,o)}function ri(e,t,i,n,r,a,o){var s={},l=0;for(var u in n)n.hasOwnProperty(u)&&(null!=i[u]?$t(n[u])&&!ei(n[u])?ri(e,t?t+"."+u:u,i[u],n[u],r,a,o):(o?(s[u]=i[u],ai(e,t,u,n[u])):s[u]=n[u],l++):null==n[u]||o||ai(e,t,u,n[u]));l>0&&e.animate(t,!1).when(null==r?500:r,s).delay(a||0)}function ai(e,t,i,n){if(t){var r={};r[t]={},r[t][i]=n,e.attr(r)}else e.attr(i,n)}ii.prototype={constructor:ii,animate:function(e,t){var i,n=!1,r=this,a=this.__zr;if(e){var o=e.split("."),s=r;n="shape"===o[0];for(var l=0,u=o.length;l<u;l++)s&&(s=s[o[l]]);s&&(i=s)}else i=r;if(i){var h=r.animators,c=new qt(i,t);return c.during((function(e){r.dirty(n)})).done((function(){h.splice(ti(h,c),1)})),h.push(c),a&&a.animation.addAnimator(c),c}Yt('Property "'+e+'" is not existed in element '+r.id)},stopAnimation:function(e){for(var t=this.animators,i=t.length,n=0;n<i;n++)t[n].stop(e);return t.length=0,this},animateTo:function(e,t,i,n,r,a){ni(this,e,t,i,n,r,a)},animateFrom:function(e,t,i,n,r,a){ni(this,e,t,i,n,r,a,!0)}};var oi=o,si=q,li=qe,ui=ii,hi=l,ci=function(e){li.call(this,e),si.call(this,e),ui.call(this,e),this.id=e.id||oi()};ci.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(e,t){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(e,t){},attrKV:function(e,t){if("position"===e||"scale"===e||"origin"===e){if(t){var i=this[e];i||(i=this[e]=[]),i[0]=t[0],i[1]=t[1]}}else this[e]=t},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(hi.isObject(e))for(var i in e)e.hasOwnProperty(i)&&this.attrKV(i,e[i]);return this.dirty(!1),this},setClipPath:function(e){var t=this.__zr;t&&e.addSelfToZr(t),this.clipPath&&this.clipPath!==e&&this.removeClipPath(),this.clipPath=e,e.__zr=t,e.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var e=this.clipPath;e&&(e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(e){this.__zr=e;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.addAnimator(t[i]);this.clipPath&&this.clipPath.addSelfToZr(e)},removeSelfFromZr:function(e){this.__zr=null;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.removeAnimator(t[i]);this.clipPath&&this.clipPath.removeSelfFromZr(e)}},hi.mixin(ci,ui),hi.mixin(ci,li),hi.mixin(ci,si);var di,fi,pi,gi,mi=ci,vi=Re,yi=P.applyTransform,_i=Math.min,xi=Math.max;function bi(e,t,i,n){i<0&&(e+=i,i=-i),n<0&&(t+=n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}bi.prototype={constructor:bi,union:function(e){var t=_i(e.x,this.x),i=_i(e.y,this.y);this.width=xi(e.x+e.width,this.x+this.width)-t,this.height=xi(e.y+e.height,this.y+this.height)-i,this.x=t,this.y=i},applyTransform:(di=[],fi=[],pi=[],gi=[],function(e){if(e){di[0]=pi[0]=this.x,di[1]=gi[1]=this.y,fi[0]=gi[0]=this.x+this.width,fi[1]=pi[1]=this.y+this.height,yi(di,di,e),yi(fi,fi,e),yi(pi,pi,e),yi(gi,gi,e),this.x=_i(di[0],fi[0],pi[0],gi[0]),this.y=_i(di[1],fi[1],pi[1],gi[1]);var t=xi(di[0],fi[0],pi[0],gi[0]),i=xi(di[1],fi[1],pi[1],gi[1]);this.width=t-this.x,this.height=i-this.y}}),calculateTransform:function(e){var t=this,i=e.width/t.width,n=e.height/t.height,r=vi.create();return vi.translate(r,r,[-t.x,-t.y]),vi.scale(r,r,[i,n]),vi.translate(r,r,[e.x,e.y]),r},intersect:function(e){if(!e)return!1;e instanceof bi||(e=bi.create(e));var t=this,i=t.x,n=t.x+t.width,r=t.y,a=t.y+t.height,o=e.x,s=e.x+e.width,l=e.y,u=e.y+e.height;return!(n<o||s<i||a<l||u<r)},contain:function(e,t){var i=this;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},clone:function(){return new bi(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},bi.create=function(e){return new bi(e.x,e.y,e.width,e.height)};var wi=bi,Ti=l,Si=mi,Mi=wi,Ai=function(e){for(var t in e=e||{},Si.call(this,e),e)e.hasOwnProperty(t)&&(this[t]=e[t]);this._children=[],this.__storage=null,this.__dirty=!0};Ai.prototype={constructor:Ai,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},childOfName:function(e){for(var t=this._children,i=0;i<t.length;i++)if(t[i].name===e)return t[i]},childCount:function(){return this._children.length},add:function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},addBefore:function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var i=this._children,n=i.indexOf(t);n>=0&&(i.splice(n,0,e),this._doAdd(e))}return this},_doAdd:function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__storage,i=this.__zr;t&&t!==e.__storage&&(t.addToStorage(e),e instanceof Ai&&e.addChildrenToStorage(t)),i&&i.refresh()},remove:function(e){var t=this.__zr,i=this.__storage,n=this._children,r=Ti.indexOf(n,e);return r<0||(n.splice(r,1),e.parent=null,i&&(i.delFromStorage(e),e instanceof Ai&&e.delChildrenFromStorage(i)),t&&t.refresh()),this},removeAll:function(){var e,t,i=this._children,n=this.__storage;for(t=0;t<i.length;t++)e=i[t],n&&(n.delFromStorage(e),e instanceof Ai&&e.delChildrenFromStorage(n)),e.parent=null;return i.length=0,this},eachChild:function(e,t){for(var i=this._children,n=0;n<i.length;n++){var r=i[n];e.call(t,r,n)}return this},traverse:function(e,t){for(var i=0;i<this._children.length;i++){var n=this._children[i];e.call(t,n),"group"===n.type&&n.traverse(e,t)}return this},addChildrenToStorage:function(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.addToStorage(i),i instanceof Ai&&i.addChildrenToStorage(e)}},delChildrenFromStorage:function(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.delFromStorage(i),i instanceof Ai&&i.delChildrenFromStorage(e)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(e){for(var t=null,i=new Mi(0,0,0,0),n=e||this._children,r=[],a=0;a<n.length;a++){var o=n[a];if(!o.ignore&&!o.invisible){var s=o.getBoundingRect(),l=o.getLocalTransform(r);l?(i.copy(s),i.applyTransform(l),(t=t||i.clone()).union(i)):(t=t||s.clone()).union(s)}}return t||i}},Ti.inherits(Ai,Si);var Ii=Ai;function Ci(e,t,i,n){var r=t+1;if(r===i)return 1;if(n(e[r++],e[t])<0){for(;r<i&&n(e[r],e[r-1])<0;)r++;!function(e,t,i){i--;for(;t<i;){var n=e[t];e[t++]=e[i],e[i--]=n}}(e,t,r)}else for(;r<i&&n(e[r],e[r-1])>=0;)r++;return r-t}function Di(e,t,i,n,r){for(n===t&&n++;n<i;n++){for(var a,o=e[n],s=t,l=n;s<l;)r(o,e[a=s+l>>>1])<0?l=a:s=a+1;var u=n-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=o}}function Ei(e,t,i,n,r,a){var o=0,s=0,l=1;if(a(e,t[i+r])>0){for(s=n-r;l<s&&a(e,t[i+r+l])>0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;l<s&&a(e,t[i+r-l])<=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=r-l,l=r-u}for(o++;o<l;){var h=o+(l-o>>>1);a(e,t[i+h])>0?o=h+1:l=h}return l}function Li(e,t,i,n,r,a){var o=0,s=0,l=1;if(a(e,t[i+r])<0){for(s=r+1;l<s&&a(e,t[i+r-l])<0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=n-r;l<s&&a(e,t[i+r+l])>=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;o<l;){var h=o+(l-o>>>1);a(e,t[i+h])<0?l=h:o=h+1}return l}function Pi(e,t){var i,n,r=7,a=0,o=[];function s(s){var l=i[s],u=n[s],h=i[s+1],c=n[s+1];n[s]=u+c,s===a-3&&(i[s+1]=i[s+2],n[s+1]=n[s+2]),a--;var d=Li(e[h],e,l,u,0,t);l+=d,0!==(u-=d)&&0!==(c=Ei(e[l+u-1],e,h,c,c-1,t))&&(u<=c?function(i,n,a,s){var l=0;for(l=0;l<n;l++)o[l]=e[i+l];var u=0,h=a,c=i;if(e[c++]=e[h++],0==--s){for(l=0;l<n;l++)e[c+l]=o[u+l];return}if(1===n){for(l=0;l<s;l++)e[c+l]=e[h+l];return void(e[c+s]=o[u])}var d,f,p,g=r;for(;;){d=0,f=0,p=!1;do{if(t(e[h],o[u])<0){if(e[c++]=e[h++],f++,d=0,0==--s){p=!0;break}}else if(e[c++]=o[u++],d++,f=0,1==--n){p=!0;break}}while((d|f)<g);if(p)break;do{if(0!==(d=Li(e[h],o,u,n,0,t))){for(l=0;l<d;l++)e[c+l]=o[u+l];if(c+=d,u+=d,(n-=d)<=1){p=!0;break}}if(e[c++]=e[h++],0==--s){p=!0;break}if(0!==(f=Ei(o[u],e,h,s,0,t))){for(l=0;l<f;l++)e[c+l]=e[h+l];if(c+=f,h+=f,0===(s-=f)){p=!0;break}}if(e[c++]=o[u++],1==--n){p=!0;break}g--}while(d>=7||f>=7);if(p)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===n){for(l=0;l<s;l++)e[c+l]=e[h+l];e[c+s]=o[u]}else{if(0===n)throw new Error;for(l=0;l<n;l++)e[c+l]=o[u+l]}}(l,u,h,c):function(i,n,a,s){var l=0;for(l=0;l<s;l++)o[l]=e[a+l];var u=i+n-1,h=s-1,c=a+s-1,d=0,f=0;if(e[c--]=e[u--],0==--n){for(d=c-(s-1),l=0;l<s;l++)e[d+l]=o[l];return}if(1===s){for(f=(c-=n)+1,d=(u-=n)+1,l=n-1;l>=0;l--)e[f+l]=e[d+l];return void(e[c]=o[h])}var p=r;for(;;){var g=0,m=0,v=!1;do{if(t(o[h],e[u])<0){if(e[c--]=e[u--],g++,m=0,0==--n){v=!0;break}}else if(e[c--]=o[h--],m++,g=0,1==--s){v=!0;break}}while((g|m)<p);if(v)break;do{if(0!==(g=n-Li(o[h],e,i,n,n-1,t))){for(n-=g,f=(c-=g)+1,d=(u-=g)+1,l=g-1;l>=0;l--)e[f+l]=e[d+l];if(0===n){v=!0;break}}if(e[c--]=o[h--],1==--s){v=!0;break}if(0!==(m=s-Ei(e[u],o,0,s,s-1,t))){for(s-=m,f=(c-=m)+1,d=(h-=m)+1,l=0;l<m;l++)e[f+l]=o[d+l];if(s<=1){v=!0;break}}if(e[c--]=e[u--],0==--n){v=!0;break}p--}while(g>=7||m>=7);if(v)break;p<0&&(p=0),p+=2}(r=p)<1&&(r=1);if(1===s){for(f=(c-=n)+1,d=(u-=n)+1,l=n-1;l>=0;l--)e[f+l]=e[d+l];e[c]=o[h]}else{if(0===s)throw new Error;for(d=c-(s-1),l=0;l<s;l++)e[d+l]=o[l]}}(l,u,h,c))}i=[],n=[],this.mergeRuns=function(){for(;a>1;){var e=a-2;if(e>=1&&n[e-1]<=n[e]+n[e+1]||e>=2&&n[e-2]<=n[e]+n[e-1])n[e-1]<n[e+1]&&e--;else if(n[e]>n[e+1])break;s(e)}},this.forceMergeRuns=function(){for(;a>1;){var e=a-2;e>0&&n[e-1]<n[e+1]&&e--,s(e)}},this.pushRun=function(e,t){i[a]=e,n[a]=t,a+=1}}var Ni=function(e,t,i,n){i||(i=0),n||(n=e.length);var r=n-i;if(!(r<2)){var a=0;if(r<32)Di(e,i,n,i+(a=Ci(e,i,n,t)),t);else{var o=new Pi(e,t),s=function(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}(r);do{if((a=Ci(e,i,n,t))<s){var l=r;l>s&&(l=s),Di(e,i,i+l,i+a,t),a=l}o.pushRun(i,a),o.mergeRuns(),r-=a,i+=a}while(0!==r);o.forceMergeRuns()}}},Ri=l,Oi=s,ki=Ii,zi=Ni;function Bi(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Fi=function(){this._roots=[],this._displayList=[],this._displayListLen=0};Fi.prototype={constructor:Fi,traverse:function(e,t){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,t)},getDisplayList:function(e,t){return t=t||!1,e&&this.updateDisplayList(t),this._displayList},updateDisplayList:function(e){this._displayListLen=0;for(var t=this._roots,i=this._displayList,n=0,r=t.length;n<r;n++)this._updateAndAddDisplayable(t[n],null,e);i.length=this._displayListLen,Oi.canvasSupported&&zi(i,Bi)},_updateAndAddDisplayable:function(e,t,i){if(!e.ignore||i){e.beforeUpdate(),e.__dirty&&e.update(),e.afterUpdate();var n=e.clipPath;if(n){t=t?t.slice():[];for(var r=n,a=e;r;)r.parent=a,r.updateTransform(),t.push(r),a=r,r=r.clipPath}if(e.isGroup){for(var o=e._children,s=0;s<o.length;s++){var l=o[s];e.__dirty&&(l.__dirty=!0),this._updateAndAddDisplayable(l,t,i)}e.__dirty=!1}else e.__clipPaths=t,this._displayList[this._displayListLen++]=e}},addRoot:function(e){e.__storage!==this&&(e instanceof ki&&e.addChildrenToStorage(this),this.addToStorage(e),this._roots.push(e))},delRoot:function(e){if(null==e){for(var t=0;t<this._roots.length;t++){var i=this._roots[t];i instanceof ki&&i.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(e instanceof Array){t=0;for(var n=e.length;t<n;t++)this.delRoot(e[t])}else{var r=Ri.indexOf(this._roots,e);r>=0&&(this.delFromStorage(e),this._roots.splice(r,1),e instanceof ki&&e.delChildrenFromStorage(this))}},addToStorage:function(e){return e&&(e.__storage=this,e.dirty(!1)),this},delFromStorage:function(e){return e&&(e.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:Bi};var Vi=Fi,Gi={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};var Hi=function(e,t,i){return Gi.hasOwnProperty(t)?i*e.dpr:i},Ui={};Ui.ContextCachedBy={NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},Ui.WILL_BE_RESTORED=9;var Wi=Hi,ji=Ui.ContextCachedBy,Xi=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],Zi=function(e){this.extendFrom(e,!1)};function qi(e,t,i){var n=null==t.x?0:t.x,r=null==t.x2?1:t.x2,a=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(n=n*i.width+i.x,r=r*i.width+i.x,a=a*i.height+i.y,o=o*i.height+i.y),n=isNaN(n)?0:n,r=isNaN(r)?1:r,a=isNaN(a)?0:a,o=isNaN(o)?0:o,e.createLinearGradient(n,a,r,o)}function Yi(e,t,i){var n=i.width,r=i.height,a=Math.min(n,r),o=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r;return t.global||(o=o*n+i.x,s=s*r+i.y,l*=a),e.createRadialGradient(o,s,0,o,s,l)}for(var Ki=Zi.prototype={constructor:Zi,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(e,t,i){var n=this,r=i&&i.style,a=!r||e.__attrCachedBy!==ji.STYLE_BIND;e.__attrCachedBy=ji.STYLE_BIND;for(var o=0;o<Xi.length;o++){var s=Xi[o],l=s[0];(a||n[l]!==r[l])&&(e[l]=Wi(e,l,n[l]||s[1]))}if((a||n.fill!==r.fill)&&(e.fillStyle=n.fill),(a||n.stroke!==r.stroke)&&(e.strokeStyle=n.stroke),(a||n.opacity!==r.opacity)&&(e.globalAlpha=null==n.opacity?1:n.opacity),(a||n.blend!==r.blend)&&(e.globalCompositeOperation=n.blend||"source-over"),this.hasStroke()){var u=n.lineWidth;e.lineWidth=u/(this.strokeNoScale&&t&&t.getLineScale?t.getLineScale():1)}},hasFill:function(){var e=this.fill;return null!=e&&"none"!==e},hasStroke:function(){var e=this.stroke;return null!=e&&"none"!==e&&this.lineWidth>0},extendFrom:function(e,t){if(e)for(var i in e)!e.hasOwnProperty(i)||!0!==t&&(!1===t?this.hasOwnProperty(i):null==e[i])||(this[i]=e[i])},set:function(e,t){"string"==typeof e?this[e]=t:this.extendFrom(e,!0)},clone:function(){var e=new this.constructor;return e.extendFrom(this,!0),e},getGradient:function(e,t,i){for(var n=("radial"===t.type?Yi:qi)(e,t,i),r=t.colorStops,a=0;a<r.length;a++)n.addColorStop(r[a].offset,r[a].color);return n}},Qi=0;Qi<Xi.length;Qi++){var Ji=Xi[Qi];Ji[0]in Ki||(Ki[Ji[0]]=Ji[1])}Zi.getGradient=Ki.getGradient;var $i=Zi,en=function(e,t){this.image=e,this.repeat=t,this.type="pattern"};en.prototype.getCanvasPattern=function(e){return e.createPattern(this.image,this.repeat||"repeat")};var tn=en,nn=l,rn=Ut.devicePixelRatio,an=$i,on=tn;function sn(){return!1}function ln(e,t,i){var n=nn.createCanvas(),r=t.getWidth(),a=t.getHeight(),o=n.style;return o&&(o.position="absolute",o.left=0,o.top=0,o.width=r+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",e)),n.width=r*i,n.height=a*i,n}var un=function(e,t,i){var n;i=i||rn,"string"==typeof e?n=ln(e,t,i):nn.isObject(e)&&(e=(n=e).id),this.id=e,this.dom=n;var r=n.style;r&&(n.onselectstart=sn,r["-webkit-user-select"]="none",r["user-select"]="none",r["-webkit-touch-callout"]="none",r["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",r.padding=0,r.margin=0,r["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=t,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=i};un.prototype={constructor:un,__dirty:!0,__used:!1,__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var e=this.dpr;this.domBack=ln("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},resize:function(e,t){var i=this.dpr,n=this.dom,r=n.style,a=this.domBack;r&&(r.width=e+"px",r.height=t+"px"),n.width=e*i,n.height=t*i,a&&(a.width=e*i,a.height=t*i,1!==i&&this.ctxBack.scale(i,i))},clear:function(e,t){var i,n=this.dom,r=this.ctx,a=n.width,o=n.height,s=(t=t||this.clearColor,this.motionBlur&&!e),l=this.lastFrameAlpha,u=this.dpr;(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(n,0,0,a/u,o/u)),r.clearRect(0,0,a,o),t&&"transparent"!==t)&&(t.colorStops?(i=t.__canvasGradient||an.getGradient(r,t,{x:0,y:0,width:a,height:o}),t.__canvasGradient=i):t.image&&(i=on.prototype.getCanvasPattern.call(t,r)),r.save(),r.fillStyle=i||t,r.fillRect(0,0,a,o),r.restore());if(s){var h=this.domBack;r.save(),r.globalAlpha=l,r.drawImage(h,0,0,a,o),r.restore()}}};var hn=un,cn="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)},dn={},fn={},pn={},gn=new at(50);function mn(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var i=e.pending[t],n=i.cb;n&&n(this,i.cbPayload),i.hostEl.dirty()}e.pending.length=0}function vn(e){return e&&e.width&&e.height}pn.findExistImage=function(e){if("string"==typeof e){var t=gn.get(e);return t&&t.image}return e},pn.createOrUpdateImage=function(e,t,i,n,r){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!i)return t;var a=gn.get(e),o={hostEl:i,cb:n,cbPayload:r};return a?!vn(t=a.image)&&a.pending.push(o):((t=new Image).onload=t.onerror=mn,gn.put(e,t.__cachedImgObj={image:t,pending:[o]}),t.src=t.__zrImageSrc=e),t}return e}return t},pn.isImageReady=vn;var yn=wi,_n=pn,xn=l,bn=xn.getContext,wn=xn.extend,Tn=xn.retrieve2,Sn=xn.retrieve3,Mn=xn.trim,An={},In=0,Cn=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,Dn={};function En(e,t){var i=e+":"+(t=t||"12px sans-serif");if(An[i])return An[i];for(var n=(e+"").split("\n"),r=0,a=0,o=n.length;a<o;a++)r=Math.max(Fn(n[a],t).width,r);return In>5e3&&(In=0,An={}),In++,An[i]=r,r}function Ln(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function Pn(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function Nn(e,t,i){var n=t.textPosition,r=t.textDistance,a=i.x,o=i.y;r=r||0;var s=i.height,l=i.width,u=s/2,h="left",c="top";switch(n){case"left":a-=r,o+=u,h="right",c="middle";break;case"right":a+=r+l,o+=u,c="middle";break;case"top":a+=l/2,o-=r,h="center",c="bottom";break;case"bottom":a+=l/2,o+=s+r,h="center";break;case"inside":a+=l/2,o+=u,h="center",c="middle";break;case"insideLeft":a+=r,o+=u,c="middle";break;case"insideRight":a+=l-r,o+=u,h="right",c="middle";break;case"insideTop":a+=l/2,o+=r,h="center";break;case"insideBottom":a+=l/2,o+=s-r,h="center",c="bottom";break;case"insideTopLeft":a+=r,o+=r;break;case"insideTopRight":a+=l-r,o+=r,h="right";break;case"insideBottomLeft":a+=r,o+=s-r,c="bottom";break;case"insideBottomRight":a+=l-r,o+=s-r,h="right",c="bottom"}return(e=e||{}).x=a,e.y=o,e.textAlign=h,e.textVerticalAlign=c,e}function Rn(e,t,i,n,r){if(!t)return"";var a=(e+"").split("\n");r=On(t,i,n,r);for(var o=0,s=a.length;o<s;o++)a[o]=kn(a[o],r);return a.join("\n")}function On(e,t,i,n){(n=wn({},n)).font=t;i=Tn(i,"...");n.maxIterations=Tn(n.maxIterations,2);var r=n.minChar=Tn(n.minChar,0);n.cnCharWidth=En("国",t);var a=n.ascCharWidth=En("a",t);n.placeholder=Tn(n.placeholder,"");for(var o=e=Math.max(0,e-1),s=0;s<r&&o>=a;s++)o-=a;var l=En(i,t);return l>o&&(i="",l=0),o=e-l,n.ellipsis=i,n.ellipsisWidth=l,n.contentWidth=o,n.containerWidth=e,n}function kn(e,t){var i=t.containerWidth,n=t.font,r=t.contentWidth;if(!i)return"";var a=En(e,n);if(a<=i)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?zn(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=En(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function zn(e,t,i,n){for(var r=0,a=0,o=e.length;a<o&&r<t;a++){var s=e.charCodeAt(a);r+=0<=s&&s<=127?i:n}return a}function Bn(e){return En("国",e)}function Fn(e,t){return Dn.measureText(e,t)}function Vn(e,t,i,n,r){null!=e&&(e+="");var a=Tn(n,Bn(t)),o=e?e.split("\n"):[],s=o.length*a,l=s,u=!0;if(i&&(l+=i[0]+i[2]),e&&r){u=!1;var h=r.outerHeight,c=r.outerWidth;if(null!=h&&l>h)e="",o=[];else if(null!=c)for(var d=On(c-(i?i[1]+i[3]:0),t,r.ellipsis,{minChar:r.minChar,placeholder:r.placeholder}),f=0,p=o.length;f<p;f++)o[f]=kn(o[f],d)}return{lines:o,height:s,outerHeight:l,lineHeight:a,canCacheByTextString:u}}function Gn(e,t){var i={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return i;for(var n,r=Cn.lastIndex=0;null!=(n=Cn.exec(e));){var a=n.index;a>r&&Hn(i,e.substring(r,a)),Hn(i,n[2],n[1]),r=Cn.lastIndex}r<e.length&&Hn(i,e.substring(r,e.length));var o=i.lines,s=0,l=0,u=[],h=t.textPadding,c=t.truncate,d=c&&c.outerWidth,f=c&&c.outerHeight;h&&(null!=d&&(d-=h[1]+h[3]),null!=f&&(f-=h[0]+h[2]));for(var p=0;p<o.length;p++){for(var g=o[p],m=0,v=0,y=0;y<g.tokens.length;y++){var _=(D=g.tokens[y]).styleName&&t.rich[D.styleName]||{},x=D.textPadding=_.textPadding,b=D.font=_.font||t.font,w=D.textHeight=Tn(_.textHeight,Bn(b));if(x&&(w+=x[0]+x[2]),D.height=w,D.lineHeight=Sn(_.textLineHeight,t.textLineHeight,w),D.textAlign=_&&_.textAlign||t.textAlign,D.textVerticalAlign=_&&_.textVerticalAlign||"middle",null!=f&&s+D.lineHeight>f)return{lines:[],width:0,height:0};D.textWidth=En(D.text,b);var T=_.textWidth,S=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))D.percentWidth=T,u.push(D),T=0;else{if(S){T=D.textWidth;var M=_.textBackgroundColor,A=M&&M.image;A&&(A=_n.findExistImage(A),_n.isImageReady(A)&&(T=Math.max(T,A.width*w/A.height)))}var I=x?x[1]+x[3]:0;T+=I;var C=null!=d?d-v:null;null!=C&&C<T&&(!S||C<I?(D.text="",D.textWidth=T=0):(D.text=Rn(D.text,C-I,b,c.ellipsis,{minChar:c.minChar}),D.textWidth=En(D.text,b),T=D.textWidth+I))}v+=D.width=T,_&&(m=Math.max(m,D.lineHeight))}g.width=v,g.lineHeight=m,s+=m,l=Math.max(l,v)}i.outerWidth=i.width=Tn(t.textWidth,l),i.outerHeight=i.height=Tn(t.textHeight,s),h&&(i.outerWidth+=h[1]+h[3],i.outerHeight+=h[0]+h[2]);for(p=0;p<u.length;p++){var D,E=(D=u[p]).percentWidth;D.width=parseInt(E,10)/100*l}return i}function Hn(e,t,i){for(var n=""===t,r=t.split("\n"),a=e.lines,o=0;o<r.length;o++){var s=r[o],l={styleName:i,text:s,isLineHolder:!s&&!n};if(o)a.push({tokens:[l]});else{var u=(a[a.length-1]||(a[0]={tokens:[]})).tokens,h=u.length;1===h&&u[0].isLineHolder?u[0]=l:(s||!h||n)&&u.push(l)}}}Dn.measureText=function(e,t){var i=bn();return i.font=t||"12px sans-serif",i.measureText(e)},fn.DEFAULT_FONT="12px sans-serif",fn.$override=function(e,t){Dn[e]=t},fn.getWidth=En,fn.getBoundingRect=function(e,t,i,n,r,a,o,s){return o?function(e,t,i,n,r,a,o,s){var l=Gn(e,{rich:o,truncate:s,font:t,textAlign:i,textPadding:r,textLineHeight:a}),u=l.outerWidth,h=l.outerHeight,c=Ln(0,u,i),d=Pn(0,h,n);return new yn(c,d,u,h)}(e,t,i,n,r,a,o,s):function(e,t,i,n,r,a,o){var s=Vn(e,t,r,a,o),l=En(e,t);r&&(l+=r[1]+r[3]);var u=s.outerHeight,h=Ln(0,l,i),c=Pn(0,u,n),d=new yn(h,c,l,u);return d.lineHeight=s.lineHeight,d}(e,t,i,n,r,a,s)},fn.adjustTextX=Ln,fn.adjustTextY=Pn,fn.calculateTextPosition=Nn,fn.adjustTextPositionOnRect=function(e,t,i){return Nn({},{textPosition:e,textDistance:i},t)},fn.truncateText=Rn,fn.getLineHeight=Bn,fn.measureText=Fn,fn.parsePlainText=Vn,fn.parseRichText=Gn,fn.makeFont=function(e){var t=(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ");return t&&Mn(t)||e.textFont||e.font};var Un={};Un.buildPath=function(e,t){var i,n,r,a,o,s=t.x,l=t.y,u=t.width,h=t.height,c=t.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?i=n=r=a=c:c instanceof Array?1===c.length?i=n=r=a=c[0]:2===c.length?(i=r=c[0],n=a=c[1]):3===c.length?(i=c[0],n=a=c[1],r=c[2]):(i=c[0],n=c[1],r=c[2],a=c[3]):i=n=r=a=0,i+n>u&&(i*=u/(o=i+n),n*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),n+r>h&&(n*=h/(o=n+r),r*=h/o),i+a>h&&(i*=h/(o=i+a),a*=h/o),e.moveTo(s+i,l),e.lineTo(s+u-n,l),0!==n&&e.arc(s+u-n,l+n,n,-Math.PI/2,0),e.lineTo(s+u,l+h-r),0!==r&&e.arc(s+u-r,l+h-r,r,0,Math.PI/2),e.lineTo(s+a,l+h),0!==a&&e.arc(s+a,l+h-a,a,Math.PI/2,Math.PI),e.lineTo(s,l+i),0!==i&&e.arc(s+i,l+i,i,Math.PI,1.5*Math.PI)};var Wn=l,jn=Wn.retrieve2,Xn=Wn.retrieve3,Zn=Wn.each,qn=Wn.normalizeCssArray,Yn=Wn.isString,Kn=Wn.isObject,Qn=fn,Jn=Un,$n=pn,er=Hi,tr=Ui,ir=tr.ContextCachedBy,nr=tr.WILL_BE_RESTORED,rr=Qn.DEFAULT_FONT,ar={left:1,right:1,center:1},or={top:1,bottom:1,middle:1},sr=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],lr={},ur={};function hr(e){if(e){e.font=Qn.makeFont(e);var t=e.textAlign;"middle"===t&&(t="center"),e.textAlign=null==t||ar[t]?t:"left";var i=e.textVerticalAlign||e.textBaseline;"center"===i&&(i="middle"),e.textVerticalAlign=null==i||or[i]?i:"top",e.textPadding&&(e.textPadding=qn(e.textPadding))}}function cr(e,t,i,n,r){if(i&&t.textRotation){var a=t.textOrigin;"center"===a?(n=i.width/2+i.x,r=i.height/2+i.y):a&&(n=a[0]+i.x,r=a[1]+i.y),e.translate(n,r),e.rotate(-t.textRotation),e.translate(-n,-r)}}function dr(e,t,i,n,r,a,o,s){var l=n.rich[i.styleName]||{};l.text=i.text;var u=i.textVerticalAlign,h=a+r/2;"top"===u?h=a+i.height/2:"bottom"===u&&(h=a+r-i.height/2),!i.isLineHolder&&fr(l)&&pr(e,t,l,"right"===s?o-i.width:"center"===s?o-i.width/2:o,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(o=br(o,s,c),h-=i.height/2-c[2]-i.textHeight/2),vr(t,"shadowBlur",Xn(l.textShadowBlur,n.textShadowBlur,0)),vr(t,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),vr(t,"shadowOffsetX",Xn(l.textShadowOffsetX,n.textShadowOffsetX,0)),vr(t,"shadowOffsetY",Xn(l.textShadowOffsetY,n.textShadowOffsetY,0)),vr(t,"textAlign",s),vr(t,"textBaseline","middle"),vr(t,"font",i.font||rr);var d=yr(l.textStroke||n.textStroke,p),f=_r(l.textFill||n.textFill),p=jn(l.textStrokeWidth,n.textStrokeWidth);d&&(vr(t,"lineWidth",p),vr(t,"strokeStyle",d),t.strokeText(i.text,o,h)),f&&(vr(t,"fillStyle",f),t.fillText(i.text,o,h))}function fr(e){return!!(e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor)}function pr(e,t,i,n,r,a,o){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=Yn(s);if(vr(t,"shadowBlur",i.textBoxShadowBlur||0),vr(t,"shadowColor",i.textBoxShadowColor||"transparent"),vr(t,"shadowOffsetX",i.textBoxShadowOffsetX||0),vr(t,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){t.beginPath();var c=i.textBorderRadius;c?Jn.buildPath(t,{x:n,y:r,width:a,height:o,r:c}):t.rect(n,r,a,o),t.closePath()}if(h)if(vr(t,"fillStyle",s),null!=i.fillOpacity){var d=t.globalAlpha;t.globalAlpha=i.fillOpacity*i.opacity,t.fill(),t.globalAlpha=d}else t.fill();else if(Kn(s)){var f=s.image;(f=$n.createOrUpdateImage(f,null,e,gr,s))&&$n.isImageReady(f)&&t.drawImage(f,n,r,a,o)}if(l&&u)if(vr(t,"lineWidth",l),vr(t,"strokeStyle",u),null!=i.strokeOpacity){d=t.globalAlpha;t.globalAlpha=i.strokeOpacity*i.opacity,t.stroke(),t.globalAlpha=d}else t.stroke()}function gr(e,t){t.image=e}function mr(e,t,i,n){var r=i.x||0,a=i.y||0,o=i.textAlign,s=i.textVerticalAlign;if(n){var l=i.textPosition;if(l instanceof Array)r=n.x+xr(l[0],n.width),a=n.y+xr(l[1],n.height);else{var u=t&&t.calculateTextPosition?t.calculateTextPosition(lr,i,n):Qn.calculateTextPosition(lr,i,n);r=u.x,a=u.y,o=o||u.textAlign,s=s||u.textVerticalAlign}var h=i.textOffset;h&&(r+=h[0],a+=h[1])}return(e=e||{}).baseX=r,e.baseY=a,e.textAlign=o,e.textVerticalAlign=s,e}function vr(e,t,i){return e[t]=er(e,t,i),e[t]}function yr(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function _r(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function xr(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function br(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}dn.normalizeTextStyle=function(e){return hr(e),Zn(e.rich,hr),e},dn.renderText=function(e,t,i,n,r,a){n.rich?function(e,t,i,n,r,a){a!==nr&&(t.__attrCachedBy=ir.NONE);var o=e.__textCotentBlock;o&&!e.__dirtyText||(o=e.__textCotentBlock=Qn.parseRichText(i,n));!function(e,t,i,n,r){var a=i.width,o=i.outerWidth,s=i.outerHeight,l=n.textPadding,u=mr(ur,e,n,r),h=u.baseX,c=u.baseY,d=u.textAlign,f=u.textVerticalAlign;cr(t,n,r,h,c);var p=Qn.adjustTextX(h,o,d),g=Qn.adjustTextY(c,s,f),m=p,v=g;l&&(m+=l[3],v+=l[0]);var y=m+a;fr(n)&&pr(e,t,n,p,g,o,s);for(var _=0;_<i.lines.length;_++){for(var x,b=i.lines[_],w=b.tokens,T=w.length,S=b.lineHeight,M=b.width,A=0,I=m,C=y,D=T-1;A<T&&(!(x=w[A]).textAlign||"left"===x.textAlign);)dr(e,t,x,n,S,v,I,"left"),M-=x.width,I+=x.width,A++;for(;D>=0&&"right"===(x=w[D]).textAlign;)dr(e,t,x,n,S,v,C,"right"),M-=x.width,C-=x.width,D--;for(I+=(a-(I-m)-(y-C)-M)/2;A<=D;)dr(e,t,x=w[A],n,S,v,I+x.width/2,"center"),I+=x.width,A++;v+=S}}(e,t,o,n,r)}(e,t,i,n,r,a):function(e,t,i,n,r,a){var o,s=fr(n),l=!1,u=t.__attrCachedBy===ir.PLAIN_TEXT;a!==nr?(a&&(o=a.style,l=!s&&u&&o),t.__attrCachedBy=s?ir.NONE:ir.PLAIN_TEXT):u&&(t.__attrCachedBy=ir.NONE);var h=n.font||rr;l&&h===(o.font||rr)||(t.font=h);var c=e.__computedFont;e.__styleFont!==h&&(e.__styleFont=h,c=e.__computedFont=t.font);var d=n.textPadding,f=n.textLineHeight,p=e.__textCotentBlock;p&&!e.__dirtyText||(p=e.__textCotentBlock=Qn.parsePlainText(i,c,d,f,n.truncate));var g=p.outerHeight,m=p.lines,v=p.lineHeight,y=mr(ur,e,n,r),_=y.baseX,x=y.baseY,b=y.textAlign||"left",w=y.textVerticalAlign;cr(t,n,r,_,x);var T=Qn.adjustTextY(x,g,w),S=_,M=T;if(s||d){var A=Qn.getWidth(i,c);d&&(A+=d[1]+d[3]);var I=Qn.adjustTextX(_,A,b);s&&pr(e,t,n,I,T,A,g),d&&(S=br(_,b,d),M+=d[0])}t.textAlign=b,t.textBaseline="middle",t.globalAlpha=n.opacity||1;for(var C=0;C<sr.length;C++){var D=sr[C],E=D[0],L=D[1],P=n[E];l&&P===o[E]||(t[L]=er(t,L,P||D[2]))}M+=v/2;var N=n.textStrokeWidth,R=l?o.textStrokeWidth:null,O=!l||N!==R,k=!l||O||n.textStroke!==o.textStroke,z=yr(n.textStroke,N),B=_r(n.textFill);z&&(O&&(t.lineWidth=N),k&&(t.strokeStyle=z));B&&(l&&n.textFill===o.textFill||(t.fillStyle=B));if(1===m.length)z&&t.strokeText(m[0],S,M),B&&t.fillText(m[0],S,M);else for(C=0;C<m.length;C++)z&&t.strokeText(m[C],S,M),B&&t.fillText(m[C],S,M),M+=v}(e,t,i,n,r,a)},dn.getBoxPosition=mr,dn.getStroke=yr,dn.getFill=_r,dn.parsePercent=xr,dn.needDrawText=function(e,t){return null!=e&&(e||t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor||t.textPadding)};var wr=dn,Tr=wi,Sr=Ui.WILL_BE_RESTORED,Mr=new Tr,Ar=function(){};Ar.prototype={constructor:Ar,drawRectText:function(e,t){var i=this.style;t=i.textRect||t,this.__dirty&&wr.normalizeTextStyle(i,!0);var n=i.text;if(null!=n&&(n+=""),wr.needDrawText(n,i)){e.save();var r=this.transform;i.transformText?this.setTransform(e):r&&(Mr.copy(t),Mr.applyTransform(r),t=Mr),wr.renderText(this,e,n,i,t,Sr),e.restore()}}};var Ir=Ar,Cr=l,Dr=$i,Er=mi,Lr=Ir;function Pr(e){for(var t in e=e||{},Er.call(this,e),e)e.hasOwnProperty(t)&&"style"!==t&&(this[t]=e[t]);this.style=new Dr(e.style,this),this._rect=null,this.__clipPaths=null}Pr.prototype={constructor:Pr,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(e){},afterBrush:function(e){},brush:function(e,t){},getBoundingRect:function(){},contain:function(e,t){return this.rectContain(e,t)},traverse:function(e,t){e.call(t,this)},rectContain:function(e,t){var i=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(i[0],i[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(e){return this.animate("style",e)},attrKV:function(e,t){"style"!==e?Er.prototype.attrKV.call(this,e,t):this.style.set(t)},setStyle:function(e,t){return this.style.set(e,t),this.dirty(!1),this},useStyle:function(e){return this.style=new Dr(e,this),this.dirty(!1),this},calculateTextPosition:null},Cr.inherits(Pr,Er),Cr.mixin(Pr,Lr);var Nr=Pr,Rr=Nr,Or=wi,kr=l,zr=pn;function Br(e){Rr.call(this,e)}Br.prototype={constructor:Br,type:"image",brush:function(e,t){var i=this.style,n=i.image;i.bind(e,this,t);var r=this._image=zr.createOrUpdateImage(n,this._image,this,this.onload);if(r&&zr.isImageReady(r)){var a=i.x||0,o=i.y||0,s=i.width,l=i.height,u=r.width/r.height;if(null==s&&null!=l?s=l*u:null==l&&null!=s?l=s/u:null==s&&null==l&&(s=r.width,l=r.height),this.setTransform(e),i.sWidth&&i.sHeight){var h=i.sx||0,c=i.sy||0;e.drawImage(r,h,c,i.sWidth,i.sHeight,a,o,s,l)}else if(i.sx&&i.sy){var d=s-(h=i.sx),f=l-(c=i.sy);e.drawImage(r,h,c,d,f,a,o,s,l)}else e.drawImage(r,a,o,s,l);null!=i.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))}},getBoundingRect:function(){var e=this.style;return this._rect||(this._rect=new Or(e.x||0,e.y||0,e.width||0,e.height||0)),this._rect}},kr.inherits(Br,Rr);var Fr=Br,Vr=Ut.devicePixelRatio,Gr=l,Hr=Zt,Ur=wi,Wr=Ni,jr=hn,Xr=cn,Zr=Fr,qr=s;function Yr(e){return parseInt(e,10)}var Kr=new Ur(0,0,0,0),Qr=new Ur(0,0,0,0);var Jr=function(e,t,i){this.type="canvas";var n=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=i=Gr.extend({},i||{}),this.dpr=i.devicePixelRatio||Vr,this._singleCanvas=n,this.root=e;var r=e.style;r&&(r["-webkit-tap-highlight-color"]="transparent",r["-webkit-user-select"]=r["user-select"]=r["-webkit-touch-callout"]="none",e.innerHTML=""),this.storage=t;var a=this._zlevelList=[],o=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,n){var s=e.width,l=e.height;null!=i.width&&(s=i.width),null!=i.height&&(l=i.height),this.dpr=i.devicePixelRatio||1,e.width=s*this.dpr,e.height=l*this.dpr,this._width=s,this._height=l;var u=new jr(e,this,this.dpr);u.__builtin__=!0,u.initContext(),o[314159]=u,u.zlevel=314159,a.push(314159),this._domRoot=e}else{this._width=this._getSize(0),this._height=this._getSize(1);var h=this._domRoot=function(e,t){var i=document.createElement("div");return i.style.cssText=["position:relative","width:"+e+"px","height:"+t+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}(this._width,this._height);e.appendChild(h)}this._hoverlayer=null,this._hoverElements=[]};Jr.prototype={constructor:Jr,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(e){var t=this.storage.getDisplayList(!0),i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,e,this._redrawId);for(var n=0;n<i.length;n++){var r=i[n],a=this._layers[r];if(!a.__builtin__&&a.refresh){var o=0===n?this._backgroundColor:null;a.refresh(o)}}return this.refreshHover(),this},addHover:function(e,t){if(!e.__hoverMir){var i=new e.constructor({style:e.style,shape:e.shape,z:e.z,z2:e.z2,silent:e.silent});return i.__from=e,e.__hoverMir=i,t&&i.setStyle(t),this._hoverElements.push(i),i}},removeHover:function(e){var t=e.__hoverMir,i=this._hoverElements,n=Gr.indexOf(i,t);n>=0&&i.splice(n,1),e.__hoverMir=null},clearHover:function(e){for(var t=this._hoverElements,i=0;i<t.length;i++){var n=t[i].__from;n&&(n.__hoverMir=null)}t.length=0},refreshHover:function(){var e=this._hoverElements,t=e.length,i=this._hoverlayer;if(i&&i.clear(),t){Wr(e,this.storage.displayableSortFunc),i||(i=this._hoverlayer=this.getLayer(1e5));var n={};i.ctx.save();for(var r=0;r<t;){var a=e[r],o=a.__from;o&&o.__zr?(r++,o.invisible||(a.transform=o.transform,a.invTransform=o.invTransform,a.__clipPaths=o.__clipPaths,this._doPaintEl(a,i,!0,n))):(e.splice(r,1),o.__hoverMir=null,t--)}i.ctx.restore()}},getHoverLayer:function(){return this.getLayer(1e5)},_paintList:function(e,t,i){if(this._redrawId===i){t=t||!1,this._updateLayerStatus(e);var n=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),!n){var r=this;Xr((function(){r._paintList(e,t,i)}))}}},_compositeManually:function(){var e=this.getLayer(314159).ctx,t=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,t,i),this.eachBuiltinLayer((function(n){n.virtual&&e.drawImage(n.dom,0,0,t,i)}))},_doPaintList:function(e,t){for(var i=[],n=0;n<this._zlevelList.length;n++){var r=this._zlevelList[n];(s=this._layers[r]).__builtin__&&s!==this._hoverlayer&&(s.__dirty||t)&&i.push(s)}for(var a=!0,o=0;o<i.length;o++){var s,l=(s=i[o]).ctx,u={};l.save();var h=t?s.__startIndex:s.__drawIndex,c=!t&&s.incremental&&Date.now,d=c&&Date.now(),f=s.zlevel===this._zlevelList[0]?this._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,f);else if(h===s.__startIndex){var p=e[h];p.incremental&&p.notClear&&!t||s.clear(!1,f)}-1===h&&(console.error("For some unknown reason. drawIndex is -1"),h=s.__startIndex);for(var g=h;g<s.__endIndex;g++){var m=e[g];if(this._doPaintEl(m,s,t,u),m.__dirty=m.__dirtyText=!1,c)if(Date.now()-d>15)break}s.__drawIndex=g,s.__drawIndex<s.__endIndex&&(a=!1),u.prevElClipPaths&&l.restore(),l.restore()}return qr.wxa&&Gr.each(this._layers,(function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()})),a},_doPaintEl:function(e,t,i,n){var r=t.ctx,a=e.transform;if((t.__dirty||i)&&!e.invisible&&0!==e.style.opacity&&(!a||a[0]||a[3])&&(!e.culling||!function(e,t,i){return Kr.copy(e.getBoundingRect()),e.transform&&Kr.applyTransform(e.transform),Qr.width=t,Qr.height=i,!Kr.intersect(Qr)}(e,this._width,this._height))){var o=e.__clipPaths,s=n.prevElClipPaths;s&&!function(e,t){if(e===t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!0;return!1}(o,s)||(s&&(r.restore(),n.prevElClipPaths=null,n.prevEl=null),o&&(r.save(),function(e,t){for(var i=0;i<e.length;i++){var n=e[i];n.setTransform(t),t.beginPath(),n.buildPath(t,n.shape),t.clip(),n.restoreTransform(t)}}(o,r),n.prevElClipPaths=o)),e.beforeBrush&&e.beforeBrush(r),e.brush(r,n.prevEl||null),n.prevEl=e,e.afterBrush&&e.afterBrush(r)}},getLayer:function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=314159);var i=this._layers[e];return i||((i=new jr("zr_"+e,this,this.dpr)).zlevel=e,i.__builtin__=!0,this._layerConfig[e]?Gr.merge(i,this._layerConfig[e],!0):this._layerConfig[e-.01]&&Gr.merge(i,this._layerConfig[e-.01],!0),t&&(i.virtual=t),this.insertLayer(e,i),i.initContext()),i},insertLayer:function(e,t){var i=this._layers,n=this._zlevelList,r=n.length,a=null,o=-1,s=this._domRoot;if(i[e])Hr("ZLevel "+e+" has been used already");else if(function(e){return!!e&&(!!e.__builtin__||"function"==typeof e.resize&&"function"==typeof e.refresh)}(t)){if(r>0&&e>n[0]){for(o=0;o<r-1&&!(n[o]<e&&n[o+1]>e);o++);a=i[n[o]]}if(n.splice(o+1,0,e),i[e]=t,!t.virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(t.dom,l.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom)}else Hr("Layer of zlevel "+e+" is not valid")},eachLayer:function(e,t){var i,n,r=this._zlevelList;for(n=0;n<r.length;n++)i=r[n],e.call(t,this._layers[i],i)},eachBuiltinLayer:function(e,t){var i,n,r,a=this._zlevelList;for(r=0;r<a.length;r++)n=a[r],(i=this._layers[n]).__builtin__&&e.call(t,i,n)},eachOtherLayer:function(e,t){var i,n,r,a=this._zlevelList;for(r=0;r<a.length;r++)n=a[r],(i=this._layers[n]).__builtin__||e.call(t,i,n)},getLayers:function(){return this._layers},_updateLayerStatus:function(e){function t(e){r&&(r.__endIndex!==e&&(r.__dirty=!0),r.__endIndex=e)}if(this.eachBuiltinLayer((function(e,t){e.__dirty=e.__used=!1})),this._singleCanvas)for(var i=1;i<e.length;i++){if((o=e[i]).zlevel!==e[i-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}}var n,r=null,a=0;for(i=0;i<e.length;i++){var o,s,l=(o=e[i]).zlevel;n!==l&&(n=l,a=0),o.incremental?((s=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,a=1):s=this.getLayer(l+(a>0?.01:0),this._needsManuallyCompositing),s.__builtin__||Hr("ZLevel "+l+" has been used by unkown layer "+s.id),s!==r&&(s.__used=!0,s.__startIndex!==i&&(s.__dirty=!0),s.__startIndex=i,s.incremental?s.__drawIndex=-1:s.__drawIndex=i,t(i),r=s),o.__dirty&&(s.__dirty=!0,s.incremental&&s.__drawIndex<0&&(s.__drawIndex=i))}t(i),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(e){e.clear()},setBackgroundColor:function(e){this._backgroundColor=e},configLayer:function(e,t){if(t){var i=this._layerConfig;i[e]?Gr.merge(i[e],t,!0):i[e]=t;for(var n=0;n<this._zlevelList.length;n++){var r=this._zlevelList[n];if(r===e||r===e+.01){var a=this._layers[r];Gr.merge(a,i[e],!0)}}}},delLayer:function(e){var t=this._layers,i=this._zlevelList,n=t[e];n&&(n.dom.parentNode.removeChild(n.dom),delete t[e],i.splice(Gr.indexOf(i,e),1))},resize:function(e,t){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||t!==this._height){for(var r in i.style.width=e+"px",i.style.height=t+"px",this._layers)this._layers.hasOwnProperty(r)&&this._layers[r].resize(e,t);Gr.each(this._progressiveLayers,(function(i){i.resize(e,t)})),this.refresh(!0)}this._width=e,this._height=t}else{if(null==e||null==t)return;this._width=e,this._height=t,this.getLayer(314159).resize(e,t)}return this},clearLayer:function(e){var t=this._layers[e];t&&t.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new jr("image",this,e.pixelRatio||this.dpr);if(t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor),e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,n=t.dom.height,r=t.ctx;this.eachLayer((function(e){e.__builtin__?r.drawImage(e.dom,0,0,i,n):e.renderToCanvas&&(t.ctx.save(),e.renderToCanvas(t.ctx),t.ctx.restore())}))}else for(var a={},o=this.storage.getDisplayList(!0),s=0;s<o.length;s++){var l=o[s];this._doPaintEl(l,t,!0,a)}return t.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||Yr(s[i])||Yr(o.style[i]))-(Yr(s[r])||0)-(Yr(s[a])||0)|0},pathToImage:function(e,t){t=t||this.dpr;var i=document.createElement("canvas"),n=i.getContext("2d"),r=e.getBoundingRect(),a=e.style,o=a.shadowBlur*t,s=a.shadowOffsetX*t,l=a.shadowOffsetY*t,u=a.hasStroke()?a.lineWidth:0,h=Math.max(u/2,-s+o),c=Math.max(u/2,s+o),d=Math.max(u/2,-l+o),f=Math.max(u/2,l+o),p=r.width+h+c,g=r.height+d+f;i.width=p*t,i.height=g*t,n.scale(t,t),n.clearRect(0,0,p,g),n.dpr=t;var m={position:e.position,rotation:e.rotation,scale:e.scale};e.position=[h-r.x,d-r.y],e.rotation=0,e.scale=[1,1],e.updateTransform(),e&&e.brush(n);var v=new Zr({style:{x:0,y:0,image:i}});return null!=m.position&&(v.position=e.position=m.position),null!=m.rotation&&(v.rotation=e.rotation=m.rotation),null!=m.scale&&(v.scale=e.scale=m.scale),v}};var $r=Jr,ea=l,ta=Y.Dispatcher,ia=cn,na=Ht,ra=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,ta.call(this)};ra.prototype={constructor:ra,addClip:function(e){this._clips.push(e)},addAnimator:function(e){e.animation=this;for(var t=e.getClips(),i=0;i<t.length;i++)this.addClip(t[i])},removeClip:function(e){var t=ea.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},removeAnimator:function(e){for(var t=e.getClips(),i=0;i<t.length;i++)this.removeClip(t[i]);e.animation=null},_update:function(){for(var e=(new Date).getTime()-this._pausedTime,t=e-this._time,i=this._clips,n=i.length,r=[],a=[],o=0;o<n;o++){var s=i[o],l=s.step(e,t);l&&(r.push(l),a.push(s))}for(o=0;o<n;)i[o]._needsRemove?(i[o]=i[n-1],i.pop(),n--):o++;n=r.length;for(o=0;o<n;o++)a[o].fire(r[o]);this._time=e,this.onframe(t),this.trigger("frame",t),this.stage.update&&this.stage.update()},_startLoop:function(){var e=this;this._running=!0,ia((function t(){e._running&&(ia(t),!e._paused&&e._update())}))},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(e,t){var i=new na(e,(t=t||{}).loop,t.getter,t.setter);return this.addAnimator(i),i}},ea.mixin(ra,ta);var aa,oa,sa=ra,la=Y,ua=la.addEventListener,ha=la.removeEventListener,ca=la.normalizeEvent,da=la.getNativeEvent,fa=l,pa=q,ga=s,ma=ga.domSupported,va=(oa={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:aa=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:fa.map(aa,(function(e){var t=e.replace("mouse","pointer");return oa.hasOwnProperty(t)?t:e}))}),ya=["mousemove","mouseup"],_a=["pointermove","pointerup"];function xa(e){return"mousewheel"===e&&ga.browser.firefox?"DOMMouseScroll":e}function ba(e){var t=e.pointerType;return"pen"===t||"touch"===t}function wa(e){e&&(e.zrByTouch=!0)}function Ta(e,t){for(var i=t,n=!1;i&&9!==i.nodeType&&!(n=i.domBelongToZr||i!==t&&i===e.painterRoot);)i=i.parentNode;return n}function Sa(e,t){this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}var Ma=Sa.prototype;Ma.stopPropagation=Ma.stopImmediatePropagation=Ma.preventDefault=fa.noop;var Aa={mousedown:function(e){e=ca(this.dom,e),this._mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=ca(this.dom,e);var t=this._mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||Pa(this,!0),this.trigger("mousemove",e)},mouseup:function(e){e=ca(this.dom,e),Pa(this,!1),this.trigger("mouseup",e)},mouseout:function(e){e=ca(this.dom,e),this._pointerCapturing&&(e.zrEventControl="no_globalout");var t=e.toElement||e.relatedTarget;e.zrIsToLocalDOM=Ta(this,t),this.trigger("mouseout",e)},touchstart:function(e){wa(e=ca(this.dom,e)),this._lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Aa.mousemove.call(this,e),Aa.mousedown.call(this,e)},touchmove:function(e){wa(e=ca(this.dom,e)),this.handler.processGesture(e,"change"),Aa.mousemove.call(this,e)},touchend:function(e){wa(e=ca(this.dom,e)),this.handler.processGesture(e,"end"),Aa.mouseup.call(this,e),+new Date-this._lastTouchMoment<300&&Aa.click.call(this,e)},pointerdown:function(e){Aa.mousedown.call(this,e)},pointermove:function(e){ba(e)||Aa.mousemove.call(this,e)},pointerup:function(e){Aa.mouseup.call(this,e)},pointerout:function(e){ba(e)||Aa.mouseout.call(this,e)}};fa.each(["click","mousewheel","dblclick","contextmenu"],(function(e){Aa[e]=function(t){t=ca(this.dom,t),this.trigger(e,t)}}));var Ia={pointermove:function(e){ba(e)||Ia.mousemove.call(this,e)},pointerup:function(e){Ia.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this._pointerCapturing;Pa(this,!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function Ca(e,t){var i=t.domHandlers;ga.pointerEventsSupported?fa.each(va.pointer,(function(n){Ea(t,n,(function(t){i[n].call(e,t)}))})):(ga.touchEventsSupported&&fa.each(va.touch,(function(n){Ea(t,n,(function(r){i[n].call(e,r),function(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}(t)}))})),fa.each(va.mouse,(function(n){Ea(t,n,(function(r){r=da(r),t.touching||i[n].call(e,r)}))})))}function Da(e,t){function i(i){Ea(t,i,(function(n){n=da(n),Ta(e,n.target)||(n=function(e,t){return ca(e.dom,new Sa(e,t),!0)}(e,n),t.domHandlers[i].call(e,n))}),{capture:!0})}ga.pointerEventsSupported?fa.each(_a,i):ga.touchEventsSupported||fa.each(ya,i)}function Ea(e,t,i,n){e.mounted[t]=i,e.listenerOpts[t]=n,ua(e.domTarget,xa(t),i,n)}function La(e){var t=e.mounted;for(var i in t)t.hasOwnProperty(i)&&ha(e.domTarget,xa(i),t[i],e.listenerOpts[i]);e.mounted={}}function Pa(e,t){if(e._mayPointerCapture=null,ma&&e._pointerCapturing^t){e._pointerCapturing=t;var i=e._globalHandlerScope;t?Da(e,i):La(i)}}function Na(e,t){this.domTarget=e,this.domHandlers=t,this.mounted={},this.listenerOpts={},this.touchTimer=null,this.touching=!1}function Ra(e,t){pa.call(this),this.dom=e,this.painterRoot=t,this._localHandlerScope=new Na(e,Aa),ma&&(this._globalHandlerScope=new Na(document,Ia)),this._pointerCapturing=!1,this._mayPointerCapture=null,Ca(this,this._localHandlerScope)}var Oa=Ra.prototype;Oa.dispose=function(){La(this._localHandlerScope),ma&&La(this._globalHandlerScope)},Oa.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},fa.mixin(Ra,pa);var ka=o,za=s,Ba=l,Fa=Ne,Va=Vi,Ga=$r,Ha=sa,Ua=Ra,Wa=!za.canvasSupported,ja={canvas:Ga},Xa={};var Za=function(e,t,i){i=i||{},this.dom=t,this.id=e;var n=this,r=new Va,a=i.renderer;if(Wa){if(!ja.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");a="vml"}else a&&ja[a]||(a="canvas");var o=new ja[a](t,r,i,e);this.storage=r,this.painter=o;var s=za.node||za.worker?null:new Ua(o.getViewportRoot(),o.root);this.handler=new Fa(r,o,s,o.root),this.animation=new Ha({stage:{update:Ba.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var l=r.delFromStorage,u=r.addToStorage;r.delFromStorage=function(e){l.call(r,e),e&&e.removeSelfFromZr(n)},r.addToStorage=function(e){u.call(r,e),e.addSelfToZr(n)}};Za.prototype={constructor:Za,getId:function(){return this.id},add:function(e){this.storage.addRoot(e),this._needsRefresh=!0},remove:function(e){this.storage.delRoot(e),this._needsRefresh=!0},configLayer:function(e,t){this.painter.configLayer&&this.painter.configLayer(e,t),this._needsRefresh=!0},setBackgroundColor:function(e){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var e;this._needsRefresh&&(e=!0,this.refreshImmediately()),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately()),e&&this.trigger("rendered")},addHover:function(e,t){if(this.painter.addHover){var i=this.painter.addHover(e,t);return this.refreshHover(),i}},removeHover:function(e){this.painter.removeHover&&(this.painter.removeHover(e),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(e,t){return this.painter.pathToImage(e,t)},setCursorStyle:function(e){this.handler.setCursorStyle(e)},findHover:function(e,t){return this.handler.findHover(e,t)},on:function(e,t,i){this.handler.on(e,t,i)},off:function(e,t){this.handler.off(e,t)},trigger:function(e,t){this.handler.trigger(e,t)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){var e;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,e=this.id,delete Xa[e]}},r.version="4.3.2",r.init=function(e,t){var i=new Za(ka(),e,t);return Xa[i.id]=i,i},r.dispose=function(e){if(e)e.dispose();else{for(var t in Xa)Xa.hasOwnProperty(t)&&Xa[t].dispose();Xa={}}return this},r.getInstance=function(e){return Xa[e]},r.registerPainter=function(e,t){ja[e]=t};var qa={},Ya=l,Ka=s,Qa=Ya.each,Ja=Ya.isObject,$a=Ya.isArray;function eo(e){return e instanceof Array?e:null==e?[]:[e]}function to(e){return Ja(e)&&e.id&&0===(e.id+"").indexOf("\0_ec_\0")}var io=0;function no(e,t){return e&&e.hasOwnProperty(t)}qa.normalizeToArray=eo,qa.defaultEmphasis=function(e,t,i){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var n=0,r=i.length;n<r;n++){var a=i[n];!e.emphasis[t].hasOwnProperty(a)&&e[t].hasOwnProperty(a)&&(e.emphasis[t][a]=e[t][a])}}},qa.TEXT_STYLE_OPTIONS=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"],qa.getDataItemValue=function(e){return!Ja(e)||$a(e)||e instanceof Date?e:e.value},qa.isDataItemOption=function(e){return Ja(e)&&!(e instanceof Array)},qa.mappingToExists=function(e,t){t=(t||[]).slice();var i=Ya.map(e||[],(function(e,t){return{exist:e}}));return Qa(t,(function(e,n){if(Ja(e)){for(var r=0;r<i.length;r++)if(!i[r].option&&null!=e.id&&i[r].exist.id===e.id+"")return i[r].option=e,void(t[n]=null);for(r=0;r<i.length;r++){var a=i[r].exist;if(!(i[r].option||null!=a.id&&null!=e.id||null==e.name||to(e)||to(a)||a.name!==e.name+""))return i[r].option=e,void(t[n]=null)}}})),Qa(t,(function(e,t){if(Ja(e)){for(var n=0;n<i.length;n++){var r=i[n].exist;if(!i[n].option&&!to(r)&&null==e.id){i[n].option=e;break}}n>=i.length&&i.push({option:e})}})),i},qa.makeIdAndName=function(e){var t=Ya.createHashMap();Qa(e,(function(e,i){var n=e.exist;n&&t.set(n.id,e)})),Qa(e,(function(e,i){var n=e.option;Ya.assert(!n||null==n.id||!t.get(n.id)||t.get(n.id)===e,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&t.set(n.id,e),!e.keyInfo&&(e.keyInfo={})})),Qa(e,(function(e,i){var n=e.exist,r=e.option,a=e.keyInfo;if(Ja(r)){if(a.name=null!=r.name?r.name+"":n?n.name:"series\0"+i,n)a.id=n.id;else if(null!=r.id)a.id=r.id+"";else{var o=0;do{a.id="\0"+a.name+"\0"+o++}while(t.get(a.id))}t.set(a.id,e)}}))},qa.isNameSpecified=function(e){var t=e.name;return!(!t||!t.indexOf("series\0"))},qa.isIdInner=to,qa.compressBatches=function(e,t){var i={},n={};return r(e||[],i),r(t||[],n,i),[a(i),a(n)];function r(e,t,i){for(var n=0,r=e.length;n<r;n++)for(var a=e[n].seriesId,o=eo(e[n].dataIndex),s=i&&i[a],l=0,u=o.length;l<u;l++){var h=o[l];s&&s[h]?s[h]=null:(t[a]||(t[a]={}))[h]=1}}function a(e,t){var i=[];for(var n in e)if(e.hasOwnProperty(n)&&null!=e[n])if(t)i.push(+n);else{var r=a(e[n],!0);r.length&&i.push({seriesId:n,dataIndex:r})}return i}},qa.queryDataIndex=function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?Ya.isArray(t.dataIndex)?Ya.map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?Ya.isArray(t.name)?Ya.map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0},qa.makeInner=function(){var e="__\0ec_inner_"+io+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}},qa.parseFinder=function(e,t,i){if(Ya.isString(t)){var n={};n[t+"Index"]=0,t=n}var r=i&&i.defaultMainType;!r||no(t,r+"Index")||no(t,r+"Id")||no(t,r+"Name")||(t[r+"Index"]=0);var a={};return Qa(t,(function(n,r){n=t[r];if("dataIndex"!==r&&"dataIndexInside"!==r){var o=r.match(/^(\w+)(Index|Id|Name)$/)||[],s=o[1],l=(o[2]||"").toLowerCase();if(!(!s||!l||null==n||"index"===l&&"none"===n||i&&i.includeMainTypes&&Ya.indexOf(i.includeMainTypes,s)<0)){var u={mainType:s};"index"===l&&"all"===n||(u[l]=n);var h=e.queryComponents(u);a[s+"Models"]=h,a[s+"Model"]=h[0]}}else a[r]=n})),a},qa.setAttribute=function(e,t,i){e.setAttribute?e.setAttribute(t,i):e[t]=i},qa.getAttribute=function(e,t){return e.getAttribute?e.getAttribute(t):e[t]},qa.getTooltipRenderMode=function(e){return"auto"===e?Ka.domSupported?"html":"richText":e||"html"},qa.groupData=function(e,t){var i=Ya.createHashMap(),n=[];return Ya.each(e,(function(e){var r=t(e);(i.get(r)||(n.push(r),i.set(r,[]))).push(e)})),{keys:n,buckets:i}};var ro={},ao=l,oo="___EC__COMPONENT__CONTAINER___";function so(e){var t={main:"",sub:""};return e&&(e=e.split("."),t.main=e[0]||"",t.sub=e[1]||""),t}var lo=0;function uo(e,t){var i=ao.slice(arguments,2);return this.superClass.prototype[t].apply(e,i)}function ho(e,t,i){return this.superClass.prototype[t].apply(e,i)}ro.parseClassType=so,ro.enableClassExtend=function(e,t){e.$constructor=e,e.extend=function(e){var t=this,i=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return ao.extend(i.prototype,e),i.extend=this.extend,i.superCall=uo,i.superApply=ho,ao.inherits(i,this),i.superClass=t,i}},ro.enableClassCheck=function(e){var t=["__\0is_clz",lo++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},ro.enableClassManagement=function(e,t){t=t||{};var i={};if(e.registerClass=function(e,t){if(t)if(function(e){ao.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=so(t)).sub){if(t.sub!==oo){var n=function(e){var t=i[e.main];t&&t[oo]||((t=i[e.main]={})[oo]=!0);return t}(t);n[t.sub]=e}}else i[t.main]=e;return e},e.getClass=function(e,t,n){var r=i[e];if(r&&r[oo]&&(r=t?r[t]:null),n&&!r)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return r},e.getClassesByMainType=function(e){e=so(e);var t=[],n=i[e.main];return n&&n[oo]?ao.each(n,(function(e,i){i!==oo&&t.push(e)})):t.push(n),t},e.hasClass=function(e){return e=so(e),!!i[e.main]},e.getAllClassMainTypes=function(){var e=[];return ao.each(i,(function(t,i){e.push(i)})),e},e.hasSubTypes=function(e){e=so(e);var t=i[e.main];return t&&t[oo]},e.parseClassType=so,t.registerWhenExtend){var n=e.extend;n&&(e.extend=function(t){var i=n.call(this,t);return e.registerClass(i,t.type)})}return e},ro.setReadOnly=function(e,t){};var co=l;var fo=function(e){for(var t=0;t<e.length;t++)e[t][1]||(e[t][1]=e[t][0]);return function(t,i,n){for(var r={},a=0;a<e.length;a++){var o=e[a][1];if(!(i&&co.indexOf(i,o)>=0||n&&co.indexOf(n,o)<0)){var s=t.getShallow(o);null!=s&&(r[e[a][0]]=s)}}return r}},po=fo([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),go={getLineStyle:function(e){var t=po(this,e);return t.lineDash=this.getLineDash(t.lineWidth),t},getLineDash:function(e){null==e&&(e=1);var t=this.get("type"),i=Math.max(e,2),n=4*e;return"solid"!==t&&null!=t&&("dashed"===t?[n,n]:[i,i])}},mo=fo([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),vo={getAreaStyle:function(e,t){return mo(this,e,t)}},yo={},_o={},xo={},bo=P,wo=bo.create,To=bo.distSquare,So=Math.pow,Mo=Math.sqrt,Ao=Mo(3),Io=1/3,Co=wo(),Do=wo(),Eo=wo();function Lo(e){return e>-1e-8&&e<1e-8}function Po(e){return e>1e-8||e<-1e-8}function No(e,t,i,n,r){var a=1-r;return a*a*(a*e+3*r*t)+r*r*(r*n+3*a*i)}function Ro(e,t,i,n){var r=1-n;return r*(r*e+2*n*t)+n*n*i}xo.cubicAt=No,xo.cubicDerivativeAt=function(e,t,i,n,r){var a=1-r;return 3*(((t-e)*a+2*(i-t)*r)*a+(n-i)*r*r)},xo.cubicRootAt=function(e,t,i,n,r,a){var o=n+3*(t-i)-e,s=3*(i-2*t+e),l=3*(t-e),u=e-r,h=s*s-3*o*l,c=s*l-9*o*u,d=l*l-3*s*u,f=0;if(Lo(h)&&Lo(c)){if(Lo(s))a[0]=0;else(S=-l/s)>=0&&S<=1&&(a[f++]=S)}else{var p=c*c-4*h*d;if(Lo(p)){var g=c/h,m=-g/2;(S=-s/o+g)>=0&&S<=1&&(a[f++]=S),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var v=Mo(p),y=h*s+1.5*o*(-c+v),_=h*s+1.5*o*(-c-v);(S=(-s-((y=y<0?-So(-y,Io):So(y,Io))+(_=_<0?-So(-_,Io):So(_,Io))))/(3*o))>=0&&S<=1&&(a[f++]=S)}else{var x=(2*h*s-3*o*c)/(2*Mo(h*h*h)),b=Math.acos(x)/3,w=Mo(h),T=Math.cos(b),S=(-s-2*w*T)/(3*o),M=(m=(-s+w*(T+Ao*Math.sin(b)))/(3*o),(-s+w*(T-Ao*Math.sin(b)))/(3*o));S>=0&&S<=1&&(a[f++]=S),m>=0&&m<=1&&(a[f++]=m),M>=0&&M<=1&&(a[f++]=M)}}return f},xo.cubicExtrema=function(e,t,i,n,r){var a=6*i-12*t+6*e,o=9*t+3*n-3*e-9*i,s=3*t-3*e,l=0;if(Lo(o)){if(Po(a))(h=-s/a)>=0&&h<=1&&(r[l++]=h)}else{var u=a*a-4*o*s;if(Lo(u))r[0]=-a/(2*o);else if(u>0){var h,c=Mo(u),d=(-a-c)/(2*o);(h=(-a+c)/(2*o))>=0&&h<=1&&(r[l++]=h),d>=0&&d<=1&&(r[l++]=d)}}return l},xo.cubicSubdivide=function(e,t,i,n,r,a){var o=(t-e)*r+e,s=(i-t)*r+t,l=(n-i)*r+i,u=(s-o)*r+o,h=(l-s)*r+s,c=(h-u)*r+u;a[0]=e,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=n},xo.cubicProjectPoint=function(e,t,i,n,r,a,o,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;Co[0]=l,Co[1]=u;for(var y=0;y<1;y+=.05)Do[0]=No(e,i,r,o,y),Do[1]=No(t,n,a,s,y),(p=To(Co,Do))<v&&(c=y,v=p);v=1/0;for(var _=0;_<32&&!(m<1e-4);_++)d=c-m,f=c+m,Do[0]=No(e,i,r,o,d),Do[1]=No(t,n,a,s,d),p=To(Do,Co),d>=0&&p<v?(c=d,v=p):(Eo[0]=No(e,i,r,o,f),Eo[1]=No(t,n,a,s,f),g=To(Eo,Co),f<=1&&g<v?(c=f,v=g):m*=.5);return h&&(h[0]=No(e,i,r,o,c),h[1]=No(t,n,a,s,c)),Mo(v)},xo.quadraticAt=Ro,xo.quadraticDerivativeAt=function(e,t,i,n){return 2*((1-n)*(t-e)+n*(i-t))},xo.quadraticRootAt=function(e,t,i,n,r){var a=e-2*t+i,o=2*(t-e),s=e-n,l=0;if(Lo(a)){if(Po(o))(h=-s/o)>=0&&h<=1&&(r[l++]=h)}else{var u=o*o-4*a*s;if(Lo(u))(h=-o/(2*a))>=0&&h<=1&&(r[l++]=h);else if(u>0){var h,c=Mo(u),d=(-o-c)/(2*a);(h=(-o+c)/(2*a))>=0&&h<=1&&(r[l++]=h),d>=0&&d<=1&&(r[l++]=d)}}return l},xo.quadraticExtremum=function(e,t,i){var n=e+i-2*t;return 0===n?.5:(e-t)/n},xo.quadraticSubdivide=function(e,t,i,n,r){var a=(t-e)*n+e,o=(i-t)*n+t,s=(o-a)*n+a;r[0]=e,r[1]=a,r[2]=s,r[3]=s,r[4]=o,r[5]=i},xo.quadraticProjectPoint=function(e,t,i,n,r,a,o,s,l){var u,h=.005,c=1/0;Co[0]=o,Co[1]=s;for(var d=0;d<1;d+=.05){Do[0]=Ro(e,i,r,d),Do[1]=Ro(t,n,a,d),(m=To(Co,Do))<c&&(u=d,c=m)}c=1/0;for(var f=0;f<32&&!(h<1e-4);f++){var p=u-h,g=u+h;Do[0]=Ro(e,i,r,p),Do[1]=Ro(t,n,a,p);var m=To(Do,Co);if(p>=0&&m<c)u=p,c=m;else{Eo[0]=Ro(e,i,r,g),Eo[1]=Ro(t,n,a,g);var v=To(Eo,Co);g<=1&&v<c?(u=g,c=v):h*=.5}}return l&&(l[0]=Ro(e,i,r,u),l[1]=Ro(t,n,a,u)),Mo(c)};var Oo={},ko=P,zo=xo,Bo=Math.min,Fo=Math.max,Vo=Math.sin,Go=Math.cos,Ho=2*Math.PI,Uo=ko.create(),Wo=ko.create(),jo=ko.create();var Xo=[],Zo=[];Oo.fromPoints=function(e,t,i){if(0!==e.length){var n,r=e[0],a=r[0],o=r[0],s=r[1],l=r[1];for(n=1;n<e.length;n++)r=e[n],a=Bo(a,r[0]),o=Fo(o,r[0]),s=Bo(s,r[1]),l=Fo(l,r[1]);t[0]=a,t[1]=s,i[0]=o,i[1]=l}},Oo.fromLine=function(e,t,i,n,r,a){r[0]=Bo(e,i),r[1]=Bo(t,n),a[0]=Fo(e,i),a[1]=Fo(t,n)},Oo.fromCubic=function(e,t,i,n,r,a,o,s,l,u){var h,c=zo.cubicExtrema,d=zo.cubicAt,f=c(e,i,r,o,Xo);for(l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0,h=0;h<f;h++){var p=d(e,i,r,o,Xo[h]);l[0]=Bo(p,l[0]),u[0]=Fo(p,u[0])}for(f=c(t,n,a,s,Zo),h=0;h<f;h++){var g=d(t,n,a,s,Zo[h]);l[1]=Bo(g,l[1]),u[1]=Fo(g,u[1])}l[0]=Bo(e,l[0]),u[0]=Fo(e,u[0]),l[0]=Bo(o,l[0]),u[0]=Fo(o,u[0]),l[1]=Bo(t,l[1]),u[1]=Fo(t,u[1]),l[1]=Bo(s,l[1]),u[1]=Fo(s,u[1])},Oo.fromQuadratic=function(e,t,i,n,r,a,o,s){var l=zo.quadraticExtremum,u=zo.quadraticAt,h=Fo(Bo(l(e,i,r),1),0),c=Fo(Bo(l(t,n,a),1),0),d=u(e,i,r,h),f=u(t,n,a,c);o[0]=Bo(e,r,d),o[1]=Bo(t,a,f),s[0]=Fo(e,r,d),s[1]=Fo(t,a,f)},Oo.fromArc=function(e,t,i,n,r,a,o,s,l){var u=ko.min,h=ko.max,c=Math.abs(r-a);if(c%Ho<1e-4&&c>1e-4)return s[0]=e-i,s[1]=t-n,l[0]=e+i,void(l[1]=t+n);if(Uo[0]=Go(r)*i+e,Uo[1]=Vo(r)*n+t,Wo[0]=Go(a)*i+e,Wo[1]=Vo(a)*n+t,u(s,Uo,Wo),h(l,Uo,Wo),(r%=Ho)<0&&(r+=Ho),(a%=Ho)<0&&(a+=Ho),r>a&&!o?a+=Ho:r<a&&o&&(r+=Ho),o){var d=a;a=r,r=d}for(var f=0;f<a;f+=Math.PI/2)f>r&&(jo[0]=Go(f)*i+e,jo[1]=Vo(f)*n+t,u(s,jo,s),h(l,jo,l))};var qo=xo,Yo=P,Ko=Oo,Qo=wi,Jo=Ut.devicePixelRatio,$o={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},es=[],ts=[],is=[],ns=[],rs=Math.min,as=Math.max,os=Math.cos,ss=Math.sin,ls=Math.sqrt,us=Math.abs,hs="undefined"!=typeof Float32Array,cs=function(e){this._saveData=!e,this._saveData&&(this.data=[]),this._ctx=null};cs.prototype={constructor:cs,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(e,t,i){i=i||0,this._ux=us(i/Jo/e)||0,this._uy=us(i/Jo/t)||0},getContext:function(){return this._ctx},beginPath:function(e){return this._ctx=e,e&&e.beginPath(),e&&(this.dpr=e.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(e,t){return this.addData($o.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},lineTo:function(e,t){var i=us(e-this._xi)>this._ux||us(t-this._yi)>this._uy||this._len<5;return this.addData($o.L,e,t),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),i&&(this._xi=e,this._yi=t),this},bezierCurveTo:function(e,t,i,n,r,a){return this.addData($o.C,e,t,i,n,r,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(e,t,i,n,r,a):this._ctx.bezierCurveTo(e,t,i,n,r,a)),this._xi=r,this._yi=a,this},quadraticCurveTo:function(e,t,i,n){return this.addData($o.Q,e,t,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(e,t,i,n):this._ctx.quadraticCurveTo(e,t,i,n)),this._xi=i,this._yi=n,this},arc:function(e,t,i,n,r,a){return this.addData($o.A,e,t,i,i,n,r-n,0,a?0:1),this._ctx&&this._ctx.arc(e,t,i,n,r,a),this._xi=os(r)*i+e,this._yi=ss(r)*i+t,this},arcTo:function(e,t,i,n,r){return this._ctx&&this._ctx.arcTo(e,t,i,n,r),this},rect:function(e,t,i,n){return this._ctx&&this._ctx.rect(e,t,i,n),this.addData($o.R,e,t,i,n),this},closePath:function(){this.addData($o.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&(this._needsDash()&&this._dashedLineTo(t,i),e.closePath()),this._xi=t,this._yi=i,this},fill:function(e){e&&e.fill(),this.toStatic()},stroke:function(e){e&&e.stroke(),this.toStatic()},setLineDash:function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var t=0,i=0;i<e.length;i++)t+=e[i];this._dashSum=t}return this},setLineDashOffset:function(e){return this._dashOffset=e,this},len:function(){return this._len},setData:function(e){var t=e.length;this.data&&this.data.length===t||!hs||(this.data=new Float32Array(t));for(var i=0;i<t;i++)this.data[i]=e[i];this._len=t},appendPath:function(e){e instanceof Array||(e=[e]);for(var t=e.length,i=0,n=this._len,r=0;r<t;r++)i+=e[r].len();hs&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(r=0;r<t;r++)for(var a=e[r].data,o=0;o<a.length;o++)this.data[n++]=a[o];this._len=n},addData:function(e){if(this._saveData){var t=this.data;this._len+arguments.length>t.length&&(this._expandData(),t=this.data);for(var i=0;i<arguments.length;i++)t[this._len++]=arguments[i];this._prevCmd=e}},_expandData:function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(e,t){var i,n,r=this._dashSum,a=this._dashOffset,o=this._lineDash,s=this._ctx,l=this._xi,u=this._yi,h=e-l,c=t-u,d=ls(h*h+c*c),f=l,p=u,g=o.length;for(a<0&&(a=r+a),f-=(a%=r)*(h/=d),p-=a*(c/=d);h>0&&f<=e||h<0&&f>=e||0===h&&(c>0&&p<=t||c<0&&p>=t);)f+=h*(i=o[n=this._dashIdx]),p+=c*i,this._dashIdx=(n+1)%g,h>0&&f<l||h<0&&f>l||c>0&&p<u||c<0&&p>u||s[n%2?"moveTo":"lineTo"](h>=0?rs(f,e):as(f,e),c>=0?rs(p,t):as(p,t));h=f-e,c=p-t,this._dashOffset=-ls(h*h+c*c)},_dashedBezierTo:function(e,t,i,n,r,a){var o,s,l,u,h,c=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=qo.cubicAt,y=0,_=this._dashIdx,x=f.length,b=0;for(d<0&&(d=c+d),d%=c,o=0;o<1;o+=.1)s=v(g,e,i,r,o+.1)-v(g,e,i,r,o),l=v(m,t,n,a,o+.1)-v(m,t,n,a,o),y+=ls(s*s+l*l);for(;_<x&&!((b+=f[_])>d);_++);for(o=(b-d)/y;o<=1;)u=v(g,e,i,r,o),h=v(m,t,n,a,o),_%2?p.moveTo(u,h):p.lineTo(u,h),o+=f[_]/y,_=(_+1)%x;_%2!=0&&p.lineTo(r,a),s=r-u,l=a-h,this._dashOffset=-ls(s*s+l*l)},_dashedQuadraticTo:function(e,t,i,n){var r=i,a=n;i=(i+2*e)/3,n=(n+2*t)/3,e=(this._xi+2*e)/3,t=(this._yi+2*t)/3,this._dashedBezierTo(e,t,i,n,r,a)},toStatic:function(){var e=this.data;e instanceof Array&&(e.length=this._len,hs&&(this.data=new Float32Array(e)))},getBoundingRect:function(){es[0]=es[1]=is[0]=is[1]=Number.MAX_VALUE,ts[0]=ts[1]=ns[0]=ns[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,i=0,n=0,r=0,a=0;a<e.length;){var o=e[a++];switch(1===a&&(n=t=e[a],r=i=e[a+1]),o){case $o.M:t=n=e[a++],i=r=e[a++],is[0]=n,is[1]=r,ns[0]=n,ns[1]=r;break;case $o.L:Ko.fromLine(t,i,e[a],e[a+1],is,ns),t=e[a++],i=e[a++];break;case $o.C:Ko.fromCubic(t,i,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1],is,ns),t=e[a++],i=e[a++];break;case $o.Q:Ko.fromQuadratic(t,i,e[a++],e[a++],e[a],e[a+1],is,ns),t=e[a++],i=e[a++];break;case $o.A:var s=e[a++],l=e[a++],u=e[a++],h=e[a++],c=e[a++],d=e[a++]+c;a+=1;var f=1-e[a++];1===a&&(n=os(c)*u+s,r=ss(c)*h+l),Ko.fromArc(s,l,u,h,c,d,f,is,ns),t=os(d)*u+s,i=ss(d)*h+l;break;case $o.R:n=t=e[a++],r=i=e[a++];var p=e[a++],g=e[a++];Ko.fromLine(n,r,n+p,r+g,is,ns);break;case $o.Z:t=n,i=r}Yo.min(es,es,is),Yo.max(ts,ts,ns)}return 0===a&&(es[0]=es[1]=ts[0]=ts[1]=0),new Qo(es[0],es[1],ts[0]-es[0],ts[1]-es[1])},rebuildPath:function(e){for(var t,i,n,r,a,o,s=this.data,l=this._ux,u=this._uy,h=this._len,c=0;c<h;){var d=s[c++];switch(1===c&&(t=n=s[c],i=r=s[c+1]),d){case $o.M:t=n=s[c++],i=r=s[c++],e.moveTo(n,r);break;case $o.L:a=s[c++],o=s[c++],(us(a-n)>l||us(o-r)>u||c===h-1)&&(e.lineTo(a,o),n=a,r=o);break;case $o.C:e.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],r=s[c-1];break;case $o.Q:e.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],r=s[c-1];break;case $o.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],_=s[c++],x=s[c++],b=g>m?g:m,w=g>m?1:g/m,T=g>m?m/g:1,S=v+y;Math.abs(g-m)>.001?(e.translate(f,p),e.rotate(_),e.scale(w,T),e.arc(0,0,b,v,S,1-x),e.scale(1/w,1/T),e.rotate(-_),e.translate(-f,-p)):e.arc(f,p,b,v,S,1-x),1===c&&(t=os(v)*g+f,i=ss(v)*m+p),n=os(S)*g+f,r=ss(S)*m+p;break;case $o.R:t=n=s[c],i=r=s[c+1],e.rect(s[c++],s[c++],s[c++],s[c++]);break;case $o.Z:e.closePath(),n=t,r=i}}}},cs.CMD=$o;var ds=cs,fs={},ps={};ps.containStroke=function(e,t,i,n,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>n+s||o<t-s&&o<n-s||a>e+s&&a>i+s||a<e-s&&a<i-s)return!1;if(e===i)return Math.abs(a-e)<=s/2;var u=(l=(t-n)/(e-i))*a-o+(e*n-i*t)/(e-i);return u*u/(l*l+1)<=s/2*s/2};var gs={},ms=xo;gs.containStroke=function(e,t,i,n,r,a,o,s,l,u,h){if(0===l)return!1;var c=l;return!(h>t+c&&h>n+c&&h>a+c&&h>s+c||h<t-c&&h<n-c&&h<a-c&&h<s-c||u>e+c&&u>i+c&&u>r+c&&u>o+c||u<e-c&&u<i-c&&u<r-c&&u<o-c)&&ms.cubicProjectPoint(e,t,i,n,r,a,o,s,u,h,null)<=c/2};var vs={},ys=xo.quadraticProjectPoint;vs.containStroke=function(e,t,i,n,r,a,o,s,l){if(0===o)return!1;var u=o;return!(l>t+u&&l>n+u&&l>a+u||l<t-u&&l<n-u&&l<a-u||s>e+u&&s>i+u&&s>r+u||s<e-u&&s<i-u&&s<r-u)&&ys(e,t,i,n,r,a,s,l,null)<=u/2};var _s={},xs={},bs=2*Math.PI;xs.normalizeRadian=function(e){return(e%=bs)<0&&(e+=bs),e};var ws=xs.normalizeRadian,Ts=2*Math.PI;_s.containStroke=function(e,t,i,n,r,a,o,s,l){if(0===o)return!1;var u=o;s-=e,l-=t;var h=Math.sqrt(s*s+l*l);if(h-u>i||h+u<i)return!1;if(Math.abs(n-r)%Ts<1e-4)return!0;if(a){var c=n;n=ws(r),r=ws(c)}else n=ws(n),r=ws(r);n>r&&(r+=Ts);var d=Math.atan2(l,s);return d<0&&(d+=Ts),d>=n&&d<=r||d+Ts>=n&&d+Ts<=r};var Ss=function(e,t,i,n,r,a){if(a>t&&a>n||a<t&&a<n)return 0;if(n===t)return 0;var o=n<t?1:-1,s=(a-t)/(n-t);1!==s&&0!==s||(o=n<t?.5:-.5);var l=s*(i-e)+e;return l===r?1/0:l>r?o:0},Ms=ds,As=ps,Is=gs,Cs=vs,Ds=_s,Es=xs.normalizeRadian,Ls=xo,Ps=Ss,Ns=Ms.CMD,Rs=2*Math.PI;var Os=[-1,-1,-1],ks=[-1,-1];function zs(e,t,i,n,r,a,o,s,l,u){if(u>t&&u>n&&u>a&&u>s||u<t&&u<n&&u<a&&u<s)return 0;var h,c=Ls.cubicRootAt(t,n,a,s,u,Os);if(0===c)return 0;for(var d,f,p=0,g=-1,m=0;m<c;m++){var v=Os[m],y=0===v||1===v?.5:1;Ls.cubicAt(e,i,r,o,v)<l||(g<0&&(g=Ls.cubicExtrema(t,n,a,s,ks),ks[1]<ks[0]&&g>1&&(h=void 0,h=ks[0],ks[0]=ks[1],ks[1]=h),d=Ls.cubicAt(t,n,a,s,ks[0]),g>1&&(f=Ls.cubicAt(t,n,a,s,ks[1]))),2===g?v<ks[0]?p+=d<t?y:-y:v<ks[1]?p+=f<d?y:-y:p+=s<f?y:-y:v<ks[0]?p+=d<t?y:-y:p+=s<d?y:-y)}return p}function Bs(e,t,i,n,r,a,o,s){if(s>t&&s>n&&s>a||s<t&&s<n&&s<a)return 0;var l=Ls.quadraticRootAt(t,n,a,s,Os);if(0===l)return 0;var u=Ls.quadraticExtremum(t,n,a);if(u>=0&&u<=1){for(var h=0,c=Ls.quadraticAt(t,n,a,u),d=0;d<l;d++){var f=0===Os[d]||1===Os[d]?.5:1;Ls.quadraticAt(e,i,r,Os[d])<o||(Os[d]<u?h+=c<t?f:-f:h+=a<c?f:-f)}return h}f=0===Os[0]||1===Os[0]?.5:1;return Ls.quadraticAt(e,i,r,Os[0])<o?0:a<t?f:-f}function Fs(e,t,i,n,r,a,o,s){if((s-=t)>i||s<-i)return 0;var l=Math.sqrt(i*i-s*s);Os[0]=-l,Os[1]=l;var u=Math.abs(n-r);if(u<1e-4)return 0;if(u%Rs<1e-4){n=0,r=Rs;var h=a?1:-1;return o>=Os[0]+e&&o<=Os[1]+e?h:0}if(a){l=n;n=Es(r),r=Es(l)}else n=Es(n),r=Es(r);n>r&&(r+=Rs);for(var c=0,d=0;d<2;d++){var f=Os[d];if(f+e>o){var p=Math.atan2(s,f);h=a?1:-1;p<0&&(p=Rs+p),(p>=n&&p<=r||p+Rs>=n&&p+Rs<=r)&&(p>Math.PI/2&&p<1.5*Math.PI&&(h=-h),c+=h)}}return c}function Vs(e,t,i,n,r){for(var a,o,s=0,l=0,u=0,h=0,c=0,d=0;d<e.length;){var f=e[d++];switch(f===Ns.M&&d>1&&(i||(s+=Ps(l,u,h,c,n,r))),1===d&&(h=l=e[d],c=u=e[d+1]),f){case Ns.M:l=h=e[d++],u=c=e[d++];break;case Ns.L:if(i){if(As.containStroke(l,u,e[d],e[d+1],t,n,r))return!0}else s+=Ps(l,u,e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ns.C:if(i){if(Is.containStroke(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],t,n,r))return!0}else s+=zs(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ns.Q:if(i){if(Cs.containStroke(l,u,e[d++],e[d++],e[d],e[d+1],t,n,r))return!0}else s+=Bs(l,u,e[d++],e[d++],e[d],e[d+1],n,r)||0;l=e[d++],u=e[d++];break;case Ns.A:var p=e[d++],g=e[d++],m=e[d++],v=e[d++],y=e[d++],_=e[d++];d+=1;var x=1-e[d++],b=Math.cos(y)*m+p,w=Math.sin(y)*v+g;d>1?s+=Ps(l,u,b,w,n,r):(h=b,c=w);var T=(n-p)*v/m+p;if(i){if(Ds.containStroke(p,g,v,y,y+_,x,t,T,r))return!0}else s+=Fs(p,g,v,y,y+_,x,T,r);l=Math.cos(y+_)*m+p,u=Math.sin(y+_)*v+g;break;case Ns.R:h=l=e[d++],c=u=e[d++];b=h+e[d++],w=c+e[d++];if(i){if(As.containStroke(h,c,b,c,t,n,r)||As.containStroke(b,c,b,w,t,n,r)||As.containStroke(b,w,h,w,t,n,r)||As.containStroke(h,w,h,c,t,n,r))return!0}else s+=Ps(b,c,b,w,n,r),s+=Ps(h,w,h,c,n,r);break;case Ns.Z:if(i){if(As.containStroke(l,u,h,c,t,n,r))return!0}else s+=Ps(l,u,h,c,n,r);l=h,u=c}}return i||(a=u,o=c,Math.abs(a-o)<1e-4)||(s+=Ps(l,u,h,c,n,r)||0),0!==s}fs.contain=function(e,t,i){return Vs(e,0,!1,t,i)},fs.containStroke=function(e,t,i,n){return Vs(e,t,!0,i,n)};var Gs=Nr,Hs=l,Us=ds,Ws=fs,js=tn.prototype.getCanvasPattern,Xs=Math.abs,Zs=new Us(!0);function qs(e){Gs.call(this,e),this.path=null}qs.prototype={constructor:qs,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(e,t){var i,n=this.style,r=this.path||Zs,a=n.hasStroke(),o=n.hasFill(),s=n.fill,l=n.stroke,u=o&&!!s.colorStops,h=a&&!!l.colorStops,c=o&&!!s.image,d=a&&!!l.image;(n.bind(e,this,t),this.setTransform(e),this.__dirty)&&(u&&(i=i||this.getBoundingRect(),this._fillGradient=n.getGradient(e,s,i)),h&&(i=i||this.getBoundingRect(),this._strokeGradient=n.getGradient(e,l,i)));u?e.fillStyle=this._fillGradient:c&&(e.fillStyle=js.call(s,e)),h?e.strokeStyle=this._strokeGradient:d&&(e.strokeStyle=js.call(l,e));var f=n.lineDash,p=n.lineDashOffset,g=!!e.setLineDash,m=this.getGlobalScale();if(r.setScale(m[0],m[1],this.segmentIgnoreThreshold),this.__dirtyPath||f&&!g&&a?(r.beginPath(e),f&&!g&&(r.setLineDash(f),r.setLineDashOffset(p)),this.buildPath(r,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(e.beginPath(),this.path.rebuildPath(e)),o)if(null!=n.fillOpacity){var v=e.globalAlpha;e.globalAlpha=n.fillOpacity*n.opacity,r.fill(e),e.globalAlpha=v}else r.fill(e);if(f&&g&&(e.setLineDash(f),e.lineDashOffset=p),a)if(null!=n.strokeOpacity){v=e.globalAlpha;e.globalAlpha=n.strokeOpacity*n.opacity,r.stroke(e),e.globalAlpha=v}else r.stroke(e);f&&g&&e.setLineDash([]),null!=n.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))},buildPath:function(e,t,i){},createPathProxy:function(){this.path=new Us},getBoundingRect:function(){var e=this._rect,t=this.style,i=!e;if(i){var n=this.path;n||(n=this.path=new Us),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),e=n.getBoundingRect()}if(this._rect=e,t.hasStroke()){var r=this._rectWithStroke||(this._rectWithStroke=e.clone());if(this.__dirty||i){r.copy(e);var a=t.lineWidth,o=t.strokeNoScale?this.getLineScale():1;t.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),o>1e-10&&(r.width+=a/o,r.height+=a/o,r.x-=a/o/2,r.y-=a/o/2)}return r}return e},contain:function(e,t){var i=this.transformCoordToLocal(e,t),n=this.getBoundingRect(),r=this.style;if(e=i[0],t=i[1],n.contain(e,t)){var a=this.path.data;if(r.hasStroke()){var o=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(r.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),Ws.containStroke(a,o/s,e,t)))return!0}if(r.hasFill())return Ws.contain(a,e,t)}return!1},dirty:function(e){null==e&&(e=!0),e&&(this.__dirtyPath=e,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(e){return this.animate("shape",e)},attrKV:function(e,t){"shape"===e?(this.setShape(t),this.__dirtyPath=!0,this._rect=null):Gs.prototype.attrKV.call(this,e,t)},setShape:function(e,t){var i=this.shape;if(i){if(Hs.isObject(e))for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);else i[e]=t;this.dirty(!0)}return this},getLineScale:function(){var e=this.transform;return e&&Xs(e[0]-1)>1e-10&&Xs(e[3]-1)>1e-10?Math.sqrt(Xs(e[0]*e[3]-e[2]*e[1])):1}},qs.extend=function(e){var t=function(t){qs.call(this,t),e.style&&this.style.extendFrom(e.style,!1);var i=e.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var r in i)!n.hasOwnProperty(r)&&i.hasOwnProperty(r)&&(n[r]=i[r])}e.init&&e.init.call(this,t)};for(var i in Hs.inherits(t,qs),e)"style"!==i&&"shape"!==i&&(t.prototype[i]=e[i]);return t},Hs.inherits(qs,Gs);var Ys=qs,Ks=ds,Qs=P.applyTransform,Js=Ks.CMD,$s=[[],[],[]],el=Math.sqrt,tl=Math.atan2;var il=function(e,t){var i,n,r,a,o,s=e.data,l=Js.M,u=Js.C,h=Js.L,c=Js.R,d=Js.A,f=Js.Q;for(r=0,a=0;r<s.length;){switch(i=s[r++],a=r,n=0,i){case l:case h:n=1;break;case u:n=3;break;case f:n=2;break;case d:var p=t[4],g=t[5],m=el(t[0]*t[0]+t[1]*t[1]),v=el(t[2]*t[2]+t[3]*t[3]),y=tl(-t[1]/v,t[0]/m);s[r]*=m,s[r++]+=p,s[r]*=v,s[r++]+=g,s[r++]*=m,s[r++]*=v,s[r++]+=y,s[r++]+=y,a=r+=2;break;case c:_[0]=s[r++],_[1]=s[r++],Qs(_,_,t),s[a++]=_[0],s[a++]=_[1],_[0]+=s[r++],_[1]+=s[r++],Qs(_,_,t),s[a++]=_[0],s[a++]=_[1]}for(o=0;o<n;o++){var _;(_=$s[o])[0]=s[r++],_[1]=s[r++],Qs(_,_,t),s[a++]=_[0],s[a++]=_[1]}}},nl=Ys,rl=ds,al=il,ol=Math.sqrt,sl=Math.sin,ll=Math.cos,ul=Math.PI,hl=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},cl=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(hl(e)*hl(t))},dl=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(cl(e,t))};function fl(e,t,i,n,r,a,o,s,l,u,h){var c=l*(ul/180),d=ll(c)*(e-i)/2+sl(c)*(t-n)/2,f=-1*sl(c)*(e-i)/2+ll(c)*(t-n)/2,p=d*d/(o*o)+f*f/(s*s);p>1&&(o*=ol(p),s*=ol(p));var g=(r===a?-1:1)*ol((o*o*(s*s)-o*o*(f*f)-s*s*(d*d))/(o*o*(f*f)+s*s*(d*d)))||0,m=g*o*f/s,v=g*-s*d/o,y=(e+i)/2+ll(c)*m-sl(c)*v,_=(t+n)/2+sl(c)*m+ll(c)*v,x=dl([1,0],[(d-m)/o,(f-v)/s]),b=[(d-m)/o,(f-v)/s],w=[(-1*d-m)/o,(-1*f-v)/s],T=dl(b,w);cl(b,w)<=-1&&(T=ul),cl(b,w)>=1&&(T=0),0===a&&T>0&&(T-=2*ul),1===a&&T<0&&(T+=2*ul),h.addData(u,y,_,o,s,x,T,c,a)}var pl=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,gl=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function ml(e,t){var i=function(e){if(!e)return new rl;for(var t,i=0,n=0,r=i,a=n,o=new rl,s=rl.CMD,l=e.match(pl),u=0;u<l.length;u++){for(var h,c=l[u],d=c.charAt(0),f=c.match(gl)||[],p=f.length,g=0;g<p;g++)f[g]=parseFloat(f[g]);for(var m=0;m<p;){var v,y,_,x,b,w,T,S=i,M=n;switch(d){case"l":i+=f[m++],n+=f[m++],h=s.L,o.addData(h,i,n);break;case"L":i=f[m++],n=f[m++],h=s.L,o.addData(h,i,n);break;case"m":i+=f[m++],n+=f[m++],h=s.M,o.addData(h,i,n),r=i,a=n,d="l";break;case"M":i=f[m++],n=f[m++],h=s.M,o.addData(h,i,n),r=i,a=n,d="L";break;case"h":i+=f[m++],h=s.L,o.addData(h,i,n);break;case"H":i=f[m++],h=s.L,o.addData(h,i,n);break;case"v":n+=f[m++],h=s.L,o.addData(h,i,n);break;case"V":n=f[m++],h=s.L,o.addData(h,i,n);break;case"C":h=s.C,o.addData(h,f[m++],f[m++],f[m++],f[m++],f[m++],f[m++]),i=f[m-2],n=f[m-1];break;case"c":h=s.C,o.addData(h,f[m++]+i,f[m++]+n,f[m++]+i,f[m++]+n,f[m++]+i,f[m++]+n),i+=f[m-2],n+=f[m-1];break;case"S":v=i,y=n;var A=o.len(),I=o.data;t===s.C&&(v+=i-I[A-4],y+=n-I[A-3]),h=s.C,S=f[m++],M=f[m++],i=f[m++],n=f[m++],o.addData(h,v,y,S,M,i,n);break;case"s":v=i,y=n,A=o.len(),I=o.data,t===s.C&&(v+=i-I[A-4],y+=n-I[A-3]),h=s.C,S=i+f[m++],M=n+f[m++],i+=f[m++],n+=f[m++],o.addData(h,v,y,S,M,i,n);break;case"Q":S=f[m++],M=f[m++],i=f[m++],n=f[m++],h=s.Q,o.addData(h,S,M,i,n);break;case"q":S=f[m++]+i,M=f[m++]+n,i+=f[m++],n+=f[m++],h=s.Q,o.addData(h,S,M,i,n);break;case"T":v=i,y=n,A=o.len(),I=o.data,t===s.Q&&(v+=i-I[A-4],y+=n-I[A-3]),i=f[m++],n=f[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"t":v=i,y=n,A=o.len(),I=o.data,t===s.Q&&(v+=i-I[A-4],y+=n-I[A-3]),i+=f[m++],n+=f[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"A":_=f[m++],x=f[m++],b=f[m++],w=f[m++],T=f[m++],fl(S=i,M=n,i=f[m++],n=f[m++],w,T,_,x,b,h=s.A,o);break;case"a":_=f[m++],x=f[m++],b=f[m++],w=f[m++],T=f[m++],fl(S=i,M=n,i+=f[m++],n+=f[m++],w,T,_,x,b,h=s.A,o)}}"z"!==d&&"Z"!==d||(h=s.Z,o.addData(h),i=r,n=a),t=h}return o.toStatic(),o}(e);return(t=t||{}).buildPath=function(e){if(e.setData){e.setData(i.data),(t=e.getContext())&&e.rebuildPath(t)}else{var t=e;i.rebuildPath(t)}},t.applyTransform=function(e){al(i,e),this.dirty(!0)},t}_o.createFromString=function(e,t){return new nl(ml(e,t))},_o.extendFromString=function(e,t){return nl.extend(ml(e,t))},_o.mergePath=function(e,t){for(var i=[],n=e.length,r=0;r<n;r++){var a=e[r];a.path||a.createPathProxy(),a.__dirtyPath&&a.buildPath(a.path,a.shape,!0),i.push(a.path)}var o=new nl(t);return o.createPathProxy(),o.buildPath=function(e){e.appendPath(i);var t=e.getContext();t&&e.rebuildPath(t)},o};var vl=Nr,yl=l,_l=fn,xl=dn,bl=Ui.ContextCachedBy,wl=function(e){vl.call(this,e)};wl.prototype={constructor:wl,type:"text",brush:function(e,t){var i=this.style;this.__dirty&&xl.normalizeTextStyle(i,!0),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var n=i.text;null!=n&&(n+=""),xl.needDrawText(n,i)?(this.setTransform(e),xl.renderText(this,e,n,i,null,t),this.restoreTransform(e)):e.__attrCachedBy=bl.NONE},getBoundingRect:function(){var e=this.style;if(this.__dirty&&xl.normalizeTextStyle(e,!0),!this._rect){e.text;var t=_l.getBoundingRect(e.text+"",e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich);if(t.x+=e.x||0,t.y+=e.y||0,xl.getStroke(e.textStroke,e.textStrokeWidth)){var i=e.textStrokeWidth;t.x-=i/2,t.y-=i/2,t.width+=i,t.height+=i}this._rect=t}return this._rect}},yl.inherits(wl,vl);var Tl=wl,Sl=Ys.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(e,t,i){i&&e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI,!0)}}),Ml=s,Al=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];var Il=function(e){return Ml.browser.ie&&Ml.browser.version>=11?function(){var t,i=this.__clipPaths,n=this.style;if(i)for(var r=0;r<i.length;r++){var a=i[r],o=a&&a.shape,s=a&&a.type;if(o&&("sector"===s&&o.startAngle===o.endAngle||"rect"===s&&(!o.width||!o.height))){for(var l=0;l<Al.length;l++)Al[l][2]=n[Al[l][0]],n[Al[l][0]]=Al[l][1];t=!0;break}}if(e.apply(this,arguments),t)for(l=0;l<Al.length;l++)n[Al[l][0]]=Al[l][2]}:e},Cl=Ys,Dl=Il,El=Cl.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:Dl(Cl.prototype.brush),buildPath:function(e,t){var i=t.cx,n=t.cy,r=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=t.startAngle,s=t.endAngle,l=t.clockwise,u=Math.cos(o),h=Math.sin(o);e.moveTo(u*r+i,h*r+n),e.lineTo(u*a+i,h*a+n),e.arc(i,n,a,o,s,!l),e.lineTo(Math.cos(s)*r+i,Math.sin(s)*r+n),0!==r&&e.arc(i,n,r,s,o,l),e.closePath()}}),Ll=Ys.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=2*Math.PI;e.moveTo(i+t.r,n),e.arc(i,n,t.r,0,r,!1),e.moveTo(i+t.r0,n),e.arc(i,n,t.r0,0,r,!0)}}),Pl={},Nl=P.distance;function Rl(e,t,i,n,r,a,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*a+s*r+t}var Ol=function(e,t){for(var i=e.length,n=[],r=0,a=1;a<i;a++)r+=Nl(e[a-1],e[a]);var o=r/2;for(o=o<i?i:o,a=0;a<o;a++){var s,l,u,h=a/(o-1)*(t?i:i-1),c=Math.floor(h),d=h-c,f=e[c%i];t?(s=e[(c-1+i)%i],l=e[(c+1)%i],u=e[(c+2)%i]):(s=e[0===c?c:c-1],l=e[c>i-2?i-1:c+1],u=e[c>i-3?i-1:c+2]);var p=d*d,g=d*p;n.push([Rl(s[0],f[0],l[0],u[0],d,p,g),Rl(s[1],f[1],l[1],u[1],d,p,g)])}return n},kl=P,zl=kl.min,Bl=kl.max,Fl=kl.scale,Vl=kl.distance,Gl=kl.add,Hl=kl.clone,Ul=kl.sub;var Wl=function(e,t,i,n){var r,a,o,s,l=[],u=[],h=[],c=[];if(n){o=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=e.length;d<f;d++)zl(o,o,e[d]),Bl(s,s,e[d]);zl(o,o,n[0]),Bl(s,s,n[1])}for(d=0,f=e.length;d<f;d++){var p=e[d];if(i)r=e[d?d-1:f-1],a=e[(d+1)%f];else{if(0===d||d===f-1){l.push(Hl(e[d]));continue}r=e[d-1],a=e[d+1]}Ul(u,a,r),Fl(u,u,t);var g=Vl(p,r),m=Vl(p,a),v=g+m;0!==v&&(g/=v,m/=v),Fl(h,u,-g),Fl(c,u,m);var y=Gl([],p,h),_=Gl([],p,c);n&&(Bl(y,y,o),zl(y,y,s),Bl(_,_,o),zl(_,_,s)),l.push(y),l.push(_)}return i&&l.push(l.shift()),l},jl=Ol,Xl=Wl;Pl.buildPath=function(e,t,i){var n=t.points,r=t.smooth;if(n&&n.length>=2){if(r&&"spline"!==r){var a=Xl(n,r,i,t.smoothConstraint);e.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(i?o:o-1);s++){var l=a[2*s],u=a[2*s+1],h=n[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===r&&(n=jl(n,i)),e.moveTo(n[0][0],n[0][1]);s=1;for(var c=n.length;s<c;s++)e.lineTo(n[s][0],n[s][1])}i&&e.closePath()}};var Zl=Pl,ql=Ys.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(e,t){Zl.buildPath(e,t,!0)}}),Yl=Pl,Kl=Ys.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(e,t){Yl.buildPath(e,t,!1)}}),Ql={},Jl=Math.round;function $l(e,t,i){if(!t)return e;var n=Jl(2*e);return(n+Jl(t))%2==0?n/2:(n+(i?1:-1))/2}Ql.subPixelOptimizeLine=function(e,t,i){if(t){var n=t.x1,r=t.x2,a=t.y1,o=t.y2;e.x1=n,e.x2=r,e.y1=a,e.y2=o;var s=i&&i.lineWidth;s&&(Jl(2*n)===Jl(2*r)&&(e.x1=e.x2=$l(n,s,!0)),Jl(2*a)===Jl(2*o)&&(e.y1=e.y2=$l(a,s,!0)))}},Ql.subPixelOptimizeRect=function(e,t,i){if(t){var n=t.x,r=t.y,a=t.width,o=t.height;e.x=n,e.y=r,e.width=a,e.height=o;var s=i&&i.lineWidth;s&&(e.x=$l(n,s,!0),e.y=$l(r,s,!0),e.width=Math.max($l(n+a,s,!1)-e.x,0===a?0:1),e.height=Math.max($l(r+o,s,!1)-e.y,0===o?0:1))}},Ql.subPixelOptimize=$l;var eu=Ys,tu=Un,iu=Ql.subPixelOptimizeRect,nu={},ru=eu.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(e,t){var i,n,r,a;this.subPixelOptimize?(iu(nu,t,this.style),i=nu.x,n=nu.y,r=nu.width,a=nu.height,nu.r=t.r,t=nu):(i=t.x,n=t.y,r=t.width,a=t.height),t.r?tu.buildPath(e,t):e.rect(i,n,r,a),e.closePath()}}),au=Ys,ou=Ql.subPixelOptimizeLine,su={},lu=au.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i,n,r,a;this.subPixelOptimize?(ou(su,t,this.style),i=su.x1,n=su.y1,r=su.x2,a=su.y2):(i=t.x1,n=t.y1,r=t.x2,a=t.y2);var o=t.percent;0!==o&&(e.moveTo(i,n),o<1&&(r=i*(1-o)+r*o,a=n*(1-o)+a*o),e.lineTo(r,a))},pointAt:function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]}}),uu=Ys,hu=P,cu=xo,du=cu.quadraticSubdivide,fu=cu.cubicSubdivide,pu=cu.quadraticAt,gu=cu.cubicAt,mu=cu.quadraticDerivativeAt,vu=cu.cubicDerivativeAt,yu=[];function _u(e,t,i){var n=e.cpx2,r=e.cpy2;return null===n||null===r?[(i?vu:gu)(e.x1,e.cpx1,e.cpx2,e.x2,t),(i?vu:gu)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(i?mu:pu)(e.x1,e.cpx1,e.x2,t),(i?mu:pu)(e.y1,e.cpy1,e.y2,t)]}var xu=uu.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.x1,n=t.y1,r=t.x2,a=t.y2,o=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,h=t.percent;0!==h&&(e.moveTo(i,n),null==l||null==u?(h<1&&(du(i,o,r,h,yu),o=yu[1],r=yu[2],du(n,s,a,h,yu),s=yu[1],a=yu[2]),e.quadraticCurveTo(o,s,r,a)):(h<1&&(fu(i,o,l,r,h,yu),o=yu[1],l=yu[2],r=yu[3],fu(n,s,u,a,h,yu),s=yu[1],u=yu[2],a=yu[3]),e.bezierCurveTo(o,s,l,u,r,a)))},pointAt:function(e){return _u(this.shape,e,!1)},tangentAt:function(e){var t=_u(this.shape,e,!0);return hu.normalize(t,t)}}),bu=Ys.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.cx,n=t.cy,r=Math.max(t.r,0),a=t.startAngle,o=t.endAngle,s=t.clockwise,l=Math.cos(a),u=Math.sin(a);e.moveTo(l*r+i,u*r+n),e.arc(i,n,r,a,o,!s)}}),wu=Ys,Tu=wu.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var e=this.__dirtyPath,t=this.shape.paths,i=0;i<t.length;i++)e=e||t[i].__dirtyPath;this.__dirtyPath=e,this.__dirty=this.__dirty||e},beforeBrush:function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),i=0;i<e.length;i++)e[i].path||e[i].createPathProxy(),e[i].path.setScale(t[0],t[1],e[i].segmentIgnoreThreshold)},buildPath:function(e,t){for(var i=t.paths||[],n=0;n<i.length;n++)i[n].buildPath(e,i[n].shape,!0)},afterBrush:function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),wu.prototype.getBoundingRect.call(this)}}),Su=Tu,Mu=function(e){this.colorStops=e||[]};Mu.prototype={constructor:Mu,addColorStop:function(e,t){this.colorStops.push({offset:e,color:t})}};var Au=Mu,Iu=l,Cu=Au,Du=function(e,t,i,n,r,a){this.x=null==e?0:e,this.y=null==t?0:t,this.x2=null==i?1:i,this.y2=null==n?0:n,this.type="linear",this.global=a||!1,Cu.call(this,r)};Du.prototype={constructor:Du},Iu.inherits(Du,Cu);var Eu=Du,Lu=l,Pu=Au,Nu=function(e,t,i,n,r){this.x=null==e?.5:e,this.y=null==t?.5:t,this.r=null==i?.5:i,this.type="radial",this.global=r||!1,Pu.call(this,n)};Nu.prototype={constructor:Nu},Lu.inherits(Nu,Pu);var Ru=Nu,Ou=l.inherits,ku=Nr,zu=wi;function Bu(e){ku.call(this,e),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}Bu.prototype.incremental=!0,Bu.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},Bu.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.dirty()},Bu.prototype.addDisplayables=function(e,t){t=t||!1;for(var i=0;i<e.length;i++)this.addDisplayable(e[i],t)},Bu.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},Bu.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){(t=this._displayables[e]).parent=this,t.update(),t.parent=null}for(e=0;e<this._temporaryDisplayables.length;e++){var t;(t=this._temporaryDisplayables[e]).parent=this,t.update(),t.parent=null}},Bu.prototype.brush=function(e,t){for(var i=this._cursor;i<this._displayables.length;i++){(n=this._displayables[i]).beforeBrush&&n.beforeBrush(e),n.brush(e,i===this._cursor?null:this._displayables[i-1]),n.afterBrush&&n.afterBrush(e)}this._cursor=i;for(i=0;i<this._temporaryDisplayables.length;i++){var n;(n=this._temporaryDisplayables[i]).beforeBrush&&n.beforeBrush(e),n.brush(e,0===i?null:this._temporaryDisplayables[i-1]),n.afterBrush&&n.afterBrush(e)}this._temporaryDisplayables=[],this.notClear=!0};var Fu=[];Bu.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new zu(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var i=this._displayables[t],n=i.getBoundingRect().clone();i.needLocalTransform()&&n.applyTransform(i.getLocalTransform(Fu)),e.union(n)}this._rect=e}return this._rect},Bu.prototype.contain=function(e,t){var i=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(i[0],i[1]))for(var n=0;n<this._displayables.length;n++){if(this._displayables[n].contain(e,t))return!0}return!1},Ou(Bu,ku);var Vu=Bu,Gu=l,Hu=_o,Uu=$e,Wu=Re,ju=P,Xu=Ys,Zu=qe,qu=Fr;yo.Image=qu;var Yu=Ii;yo.Group=Yu;var Ku=Tl;yo.Text=Ku;var Qu=Sl;yo.Circle=Qu;var Ju=El;yo.Sector=Ju;var $u=Ll;yo.Ring=$u;var eh=ql;yo.Polygon=eh;var th=Kl;yo.Polyline=th;var ih=ru;yo.Rect=ih;var nh=lu;yo.Line=nh;var rh=xu;yo.BezierCurve=rh;var ah=bu;yo.Arc=ah;var oh=Su;yo.CompoundPath=oh;var sh=Eu;yo.LinearGradient=sh;var lh=Ru;yo.RadialGradient=lh;var uh=wi;yo.BoundingRect=uh;var hh=Vu;yo.IncrementalDisplayable=hh;var ch=Ql,dh=Math.max,fh=Math.min,ph={},gh=1,mh={},vh={};function yh(e,t){vh[e]=t}function _h(e,t,i,n){var r=Hu.createFromString(e,t);return i&&("center"===n&&(i=xh(i,r.getBoundingRect())),wh(r,i)),r}function xh(e,t){var i,n=t.width/t.height,r=e.height*n;return i=r<=e.width?e.height:(r=e.width)/n,{x:e.x+e.width/2-r/2,y:e.y+e.height/2-i/2,width:r,height:i}}var bh=Hu.mergePath;function wh(e,t){if(e.applyTransform){var i=e.getBoundingRect().calculateTransform(t);e.applyTransform(i)}}var Th=ch.subPixelOptimize;function Sh(e){return null!=e&&"none"!==e}var Mh=Gu.createHashMap(),Ah=0;function Ih(e){var t=e.__hoverStl;if(t&&!e.__highlighted){var i=e.__zr,n=e.useHoverLayer&&i&&"canvas"===i.painter.type;if(e.__highlighted=n?"layer":"plain",!(e.isGroup||!i&&e.useHoverLayer)){var r=e,a=e.style;n&&(a=(r=i.addHover(e)).style),Uh(a),n||function(e){if(e.__hoverStlDirty){e.__hoverStlDirty=!1;var t=e.__hoverStl;if(t){var i=e.__cachedNormalStl={};e.__cachedNormalZ2=e.z2;var n=e.style;for(var r in t)null!=t[r]&&(i[r]=n[r]);i.fill=n.fill,i.stroke=n.stroke}else e.__cachedNormalStl=e.__cachedNormalZ2=null}}(r),a.extendFrom(t),Ch(a,t,"fill"),Ch(a,t,"stroke"),Hh(a),n||(e.dirty(!1),e.z2+=1)}}}function Ch(e,t,i){!Sh(t[i])&&Sh(e[i])&&(e[i]=function(e){if("string"!=typeof e)return e;var t=Mh.get(e);return t||(t=Uu.lift(e,-.1),Ah<1e4&&(Mh.set(e,t),Ah++)),t}(e[i]))}function Dh(e){var t=e.__highlighted;if(t&&(e.__highlighted=!1,!e.isGroup))if("layer"===t)e.__zr&&e.__zr.removeHover(e);else{var i=e.style,n=e.__cachedNormalStl;n&&(Uh(i),e.setStyle(n),Hh(i));var r=e.__cachedNormalZ2;null!=r&&e.z2-r==1&&(e.z2=r)}}function Eh(e,t,i){var n,r="normal",a="normal";e.__highlighted&&(r="emphasis",n=!0),t(e,i),e.__highlighted&&(a="emphasis",n=!0),e.isGroup&&e.traverse((function(e){!e.isGroup&&t(e,i)})),n&&e.__highDownOnUpdate&&e.__highDownOnUpdate(r,a)}function Lh(e,t){t=e.__hoverStl=!1!==t&&(e.hoverStyle||t||{}),e.__hoverStlDirty=!0,e.__highlighted&&(e.__cachedNormalStl=null,Dh(e),Ih(e))}function Ph(e){!kh(this,e)&&!this.__highByOuter&&Eh(this,Ih)}function Nh(e){!kh(this,e)&&!this.__highByOuter&&Eh(this,Dh)}function Rh(e){this.__highByOuter|=1<<(e||0),Eh(this,Ih)}function Oh(e){!(this.__highByOuter&=~(1<<(e||0)))&&Eh(this,Dh)}function kh(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function zh(e,t){var i=!1===t;if(e.__highDownSilentOnTouch=e.highDownSilentOnTouch,e.__highDownOnUpdate=e.highDownOnUpdate,!i||e.__highDownDispatcher){var n=i?"off":"on";e[n]("mouseover",Ph)[n]("mouseout",Nh),e[n]("emphasis",Rh)[n]("normal",Oh),e.__highByOuter=e.__highByOuter||0,e.__highDownDispatcher=!i}}function Bh(e,t,i,n,r){return Fh(e,t,n,r),i&&Gu.extend(e,i),e}function Fh(e,t,i,n){if((i=i||ph).isRectText){var r;i.getTextPosition?r=i.getTextPosition(t,n):"outside"===(r=t.getShallow("position")||(n?null:"inside"))&&(r="top"),e.textPosition=r,e.textOffset=t.getShallow("offset");var a=t.getShallow("rotate");null!=a&&(a*=Math.PI/180),e.textRotation=a,e.textDistance=Gu.retrieve2(t.getShallow("distance"),n?null:5)}var o,s=t.ecModel,l=s&&s.option.textStyle,u=function(e){var t;for(;e&&e!==e.ecModel;){var i=(e.option||ph).rich;if(i)for(var n in t=t||{},i)i.hasOwnProperty(n)&&(t[n]=1);e=e.parentModel}return t}(t);if(u)for(var h in o={},u)if(u.hasOwnProperty(h)){var c=t.getModel(["rich",h]);Vh(o[h]={},c,l,i,n)}return e.rich=o,Vh(e,t,l,i,n,!0),i.forceRich&&!i.textStyle&&(i.textStyle={}),e}function Vh(e,t,i,n,r,a){i=!r&&i||ph,e.textFill=Gh(t.getShallow("color"),n)||i.color,e.textStroke=Gh(t.getShallow("textBorderColor"),n)||i.textBorderColor,e.textStrokeWidth=Gu.retrieve2(t.getShallow("textBorderWidth"),i.textBorderWidth),r||(a&&(e.insideRollbackOpt=n,Hh(e)),null==e.textFill&&(e.textFill=n.autoColor)),e.fontStyle=t.getShallow("fontStyle")||i.fontStyle,e.fontWeight=t.getShallow("fontWeight")||i.fontWeight,e.fontSize=t.getShallow("fontSize")||i.fontSize,e.fontFamily=t.getShallow("fontFamily")||i.fontFamily,e.textAlign=t.getShallow("align"),e.textVerticalAlign=t.getShallow("verticalAlign")||t.getShallow("baseline"),e.textLineHeight=t.getShallow("lineHeight"),e.textWidth=t.getShallow("width"),e.textHeight=t.getShallow("height"),e.textTag=t.getShallow("tag"),a&&n.disableBox||(e.textBackgroundColor=Gh(t.getShallow("backgroundColor"),n),e.textPadding=t.getShallow("padding"),e.textBorderColor=Gh(t.getShallow("borderColor"),n),e.textBorderWidth=t.getShallow("borderWidth"),e.textBorderRadius=t.getShallow("borderRadius"),e.textBoxShadowColor=t.getShallow("shadowColor"),e.textBoxShadowBlur=t.getShallow("shadowBlur"),e.textBoxShadowOffsetX=t.getShallow("shadowOffsetX"),e.textBoxShadowOffsetY=t.getShallow("shadowOffsetY")),e.textShadowColor=t.getShallow("textShadowColor")||i.textShadowColor,e.textShadowBlur=t.getShallow("textShadowBlur")||i.textShadowBlur,e.textShadowOffsetX=t.getShallow("textShadowOffsetX")||i.textShadowOffsetX,e.textShadowOffsetY=t.getShallow("textShadowOffsetY")||i.textShadowOffsetY}function Gh(e,t){return"auto"!==e?e:t&&t.autoColor?t.autoColor:null}function Hh(e){var t,i=e.textPosition,n=e.insideRollbackOpt;if(n&&null==e.textFill){var r=n.autoColor,a=n.isRectText,o=n.useInsideStyle,s=!1!==o&&(!0===o||a&&i&&"string"==typeof i&&i.indexOf("inside")>=0),l=!s&&null!=r;(s||l)&&(t={textFill:e.textFill,textStroke:e.textStroke,textStrokeWidth:e.textStrokeWidth}),s&&(e.textFill="#fff",null==e.textStroke&&(e.textStroke=r,null==e.textStrokeWidth&&(e.textStrokeWidth=2))),l&&(e.textFill=r)}e.insideRollback=t}function Uh(e){var t=e.insideRollback;t&&(e.textFill=t.textFill,e.textStroke=t.textStroke,e.textStrokeWidth=t.textStrokeWidth,e.insideRollback=null)}function Wh(e,t,i,n,r,a){if("function"==typeof r&&(a=r,r=null),n&&n.isAnimationEnabled()){var o=e?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),u=n.getShallow("animationDelay"+o);"function"==typeof u&&(u=u(r,n.getAnimationDelayParams?n.getAnimationDelayParams(t,r):null)),"function"==typeof s&&(s=s(r)),s>0?t.animateTo(i,s,u||0,l,a,!!a):(t.stopAnimation(),t.attr(i),a&&a())}else t.stopAnimation(),t.attr(i),a&&a()}function jh(e,t,i,n,r){Wh(!0,e,t,i,n,r)}function Xh(e,t,i){return t&&!Gu.isArrayLike(t)&&(t=Zu.getLocalTransform(t)),i&&(t=Wu.invert([],t)),ju.applyTransform([],e,t)}function Zh(e,t,i,n,r,a,o,s){var l,u=i-e,h=n-t,c=o-r,d=s-a,f=qh(c,d,u,h);if((l=f)<=1e-6&&l>=-1e-6)return!1;var p=e-r,g=t-a,m=qh(p,g,u,h)/f;if(m<0||m>1)return!1;var v=qh(p,g,c,d)/f;return!(v<0||v>1)}function qh(e,t,i,n){return e*n-i*t}yh("circle",Qu),yh("sector",Ju),yh("ring",$u),yh("polygon",eh),yh("polyline",th),yh("rect",ih),yh("line",nh),yh("bezierCurve",rh),yh("arc",ah),yo.Z2_EMPHASIS_LIFT=1,yo.CACHED_LABEL_STYLE_PROPERTIES={color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},yo.extendShape=function(e){return Xu.extend(e)},yo.extendPath=function(e,t){return Hu.extendFromString(e,t)},yo.registerShape=yh,yo.getShapeClass=function(e){if(vh.hasOwnProperty(e))return vh[e]},yo.makePath=_h,yo.makeImage=function(e,t,i){var n=new qu({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===i){var r={width:e.width,height:e.height};n.setStyle(xh(t,r))}}});return n},yo.mergePath=bh,yo.resizePath=wh,yo.subPixelOptimizeLine=function(e){return ch.subPixelOptimizeLine(e.shape,e.shape,e.style),e},yo.subPixelOptimizeRect=function(e){return ch.subPixelOptimizeRect(e.shape,e.shape,e.style),e},yo.subPixelOptimize=Th,yo.setElementHoverStyle=Lh,yo.setHoverStyle=function(e,t){zh(e,!0),Eh(e,Lh,t)},yo.setAsHighDownDispatcher=zh,yo.isHighDownDispatcher=function(e){return!(!e||!e.__highDownDispatcher)},yo.getHighlightDigit=function(e){var t=mh[e];return null==t&&gh<=32&&(t=mh[e]=gh++),t},yo.setLabelStyle=function(e,t,i,n,r,a,o){var s,l=(r=r||ph).labelFetcher,u=r.labelDataIndex,h=r.labelDimIndex,c=r.labelProp,d=i.getShallow("show"),f=n.getShallow("show");(d||f)&&(l&&(s=l.getFormattedLabel(u,"normal",null,h,c)),null==s&&(s=Gu.isFunction(r.defaultText)?r.defaultText(u,r):r.defaultText));var p=d?s:null,g=f?Gu.retrieve2(l?l.getFormattedLabel(u,"emphasis",null,h,c):null,s):null;null==p&&null==g||(Bh(e,i,a,r),Bh(t,n,o,r,!0)),e.text=p,t.text=g},yo.modifyLabelStyle=function(e,t,i){var n=e.style;t&&(Uh(n),e.setStyle(t),Hh(n)),n=e.__hoverStl,i&&n&&(Uh(n),Gu.extend(n,i),Hh(n))},yo.setTextStyle=Bh,yo.setText=function(e,t,i){var n,r={isRectText:!0};!1===i?n=!0:r.autoColor=i,Fh(e,t,r,n)},yo.getFont=function(e,t){var i=t&&t.getModel("textStyle");return Gu.trim([e.fontStyle||i&&i.getShallow("fontStyle")||"",e.fontWeight||i&&i.getShallow("fontWeight")||"",(e.fontSize||i&&i.getShallow("fontSize")||12)+"px",e.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))},yo.updateProps=jh,yo.initProps=function(e,t,i,n,r){Wh(!1,e,t,i,n,r)},yo.getTransform=function(e,t){for(var i=Wu.identity([]);e&&e!==t;)Wu.mul(i,e.getLocalTransform(),i),e=e.parent;return i},yo.applyTransform=Xh,yo.transformDirection=function(e,t,i){var n=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),r=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),a=["left"===e?-n:"right"===e?n:0,"top"===e?-r:"bottom"===e?r:0];return a=Xh(a,t,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"},yo.groupTransition=function(e,t,i,n){if(e&&t){var r,a=(r={},e.traverse((function(e){!e.isGroup&&e.anid&&(r[e.anid]=e)})),r);t.traverse((function(e){if(!e.isGroup&&e.anid){var t=a[e.anid];if(t){var n=o(e);e.attr(o(t)),jh(e,n,i,e.dataIndex)}}}))}function o(e){var t={position:ju.clone(e.position),rotation:e.rotation};return e.shape&&(t.shape=Gu.extend({},e.shape)),t}},yo.clipPointsByRect=function(e,t){return Gu.map(e,(function(e){var i=e[0];i=dh(i,t.x),i=fh(i,t.x+t.width);var n=e[1];return n=dh(n,t.y),[i,n=fh(n,t.y+t.height)]}))},yo.clipRectByRect=function(e,t){var i=dh(e.x,t.x),n=fh(e.x+e.width,t.x+t.width),r=dh(e.y,t.y),a=fh(e.y+e.height,t.y+t.height);if(n>=i&&a>=r)return{x:i,y:r,width:n-i,height:a-r}},yo.createIcon=function(e,t,i){var n=(t=Gu.extend({rectHover:!0},t)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(n.image=e.slice(8),Gu.defaults(n,i),new qu(t)):_h(e.replace("path://",""),t,i,"center")},yo.linePolygonIntersect=function(e,t,i,n,r){for(var a=0,o=r[r.length-1];a<r.length;a++){var s=r[a];if(Zh(e,t,i,n,s[0],s[1],o[0],o[1]))return!0;o=s}},yo.lineLineIntersect=Zh;var Yh=fn,Kh=yo,Qh=["textStyle","color"],Jh={getTextColor:function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(Qh):null)},getFont:function(){return Kh.getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(e){return Yh.getBoundingRect(e,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("lineHeight"),this.getShallow("rich"),this.getShallow("truncateText"))}},$h=fo([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),ec={getItemStyle:function(e,t){var i=$h(this,e,t),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var e=this.get("borderType");return"solid"===e||null==e?null:"dashed"===e?[5,5]:[1,1]}},tc=l,ic=s,nc=qa.makeInner,rc=ro,ac=rc.enableClassExtend,oc=rc.enableClassCheck,sc=go,lc=vo,uc=Jh,hc=ec,cc=tc.mixin,dc=nc();function fc(e,t,i){this.parentModel=t,this.ecModel=i,this.option=e}function pc(e,t,i){for(var n=0;n<t.length&&(!t[n]||null!=(e=e&&"object"==typeof e?e[t[n]]:null));n++);return null==e&&i&&(e=i.get(t)),e}function gc(e,t){var i=dc(e).getParent;return i?i.call(e,t):e.parentModel}fc.prototype={constructor:fc,init:null,mergeOption:function(e){tc.merge(this.option,e,!0)},get:function(e,t){return null==e?this.option:pc(this.option,this.parsePath(e),!t&&gc(this,e))},getShallow:function(e,t){var i=this.option,n=null==i?i:i[e],r=!t&&gc(this,e);return null==n&&r&&(n=r.getShallow(e)),n},getModel:function(e,t){var i;return new fc(null==e?this.option:pc(this.option,e=this.parsePath(e)),t=t||(i=gc(this,e))&&i.getModel(e),this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(tc.clone(this.option))},setReadOnly:function(e){},parsePath:function(e){return"string"==typeof e&&(e=e.split(".")),e},customizeGetParent:function(e){dc(this).getParent=e},isAnimationEnabled:function(){if(!ic.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},ac(fc),oc(fc),cc(fc,sc),cc(fc,lc),cc(fc,uc),cc(fc,hc);var mc=fc,vc={},yc=l,_c=ro.parseClassType,xc=0;vc.getUID=function(e){return[e||"",xc++,Math.random().toFixed(5)].join("_")},vc.enableSubTypeDefaulter=function(e){var t={};return e.registerSubTypeDefaulter=function(e,i){e=_c(e),t[e.main]=i},e.determineSubType=function(i,n){var r=n.type;if(!r){var a=_c(i).main;e.hasSubTypes(i)&&t[a]&&(r=t[a](n))}return r},e},vc.enableTopologicalTravel=function(e,t){function i(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,n,r,a){if(e.length){var o=function(e){var n={},r=[];return yc.each(e,(function(a){var o=i(n,a),s=function(e,t){var i=[];return yc.each(e,(function(e){yc.indexOf(t,e)>=0&&i.push(e)})),i}(o.originalDeps=t(a),e);o.entryCount=s.length,0===o.entryCount&&r.push(a),yc.each(s,(function(e){yc.indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=i(n,e);yc.indexOf(t.successor,e)<0&&t.successor.push(a)}))})),{graph:n,noEntryList:r}}(n),s=o.graph,l=o.noEntryList,u={};for(yc.each(e,(function(e){u[e]=!0}));l.length;){var h=l.pop(),c=s[h],d=!!u[h];d&&(r.call(a,h,c.originalDeps.slice()),delete u[h]),yc.each(c.successor,d?p:f)}yc.each(u,(function(){throw new Error("Circle dependency may exists")}))}function f(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function p(e){u[e]=!0,f(e)}}};var bc={},wc={},Tc=l;var Sc=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Mc(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}wc.linearMap=function(e,t,i,n){var r=t[1]-t[0],a=i[1]-i[0];if(0===r)return 0===a?i[0]:(i[0]+i[1])/2;if(n)if(r>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/r*a+i[0]},wc.parsePercent=function(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return"string"==typeof e?(i=e,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var i},wc.round=function(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e},wc.asc=function(e){return e.sort((function(e,t){return e-t})),e},wc.getPrecision=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i},wc.getPrecisionSafe=function(e){var t=e.toString(),i=t.indexOf("e");if(i>0){var n=+t.slice(i+1);return n<0?-n:0}var r=t.indexOf(".");return r<0?0:t.length-1-r},wc.getPixelPrecision=function(e,t){var i=Math.log,n=Math.LN10,r=Math.floor(i(e[1]-e[0])/n),a=Math.round(i(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},wc.getPercentWithPrecision=function(e,t,i){if(!e[t])return 0;var n=Tc.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return 0;for(var r=Math.pow(10,i),a=Tc.map(e,(function(e){return(isNaN(e)?0:e)/n*r*100})),o=100*r,s=Tc.map(a,(function(e){return Math.floor(e)})),l=Tc.reduce(s,(function(e,t){return e+t}),0),u=Tc.map(a,(function(e,t){return e-s[t]}));l<o;){for(var h=Number.NEGATIVE_INFINITY,c=null,d=0,f=u.length;d<f;++d)u[d]>h&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[t]/r},wc.MAX_SAFE_INTEGER=9007199254740991,wc.remRadian=function(e){var t=2*Math.PI;return(e%t+t)%t},wc.isRadianAroundZero=function(e){return e>-1e-4&&e<1e-4},wc.parseDate=function(e){if(e instanceof Date)return e;if("string"==typeof e){var t=Sc.exec(e);if(!t)return new Date(NaN);if(t[8]){var i=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(i-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,i,+(t[5]||0),+t[6]||0,+t[7]||0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,+t[7]||0)}return null==e?new Date(NaN):new Date(Math.round(e))},wc.quantity=function(e){return Math.pow(10,Mc(e))},wc.quantityExponent=Mc,wc.nice=function(e,t){var i=Mc(e),n=Math.pow(10,i),r=e/n;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*n,i>=-20?+e.toFixed(i<0?-i:0):e},wc.quantile=function(e,t){var i=(e.length-1)*t+1,n=Math.floor(i),r=+e[n-1],a=i-n;return a?r+a*(e[n]-r):r},wc.reformIntervals=function(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,i=1,n=0;n<e.length;){for(var r=e[n].interval,a=e[n].close,o=0;o<2;o++)r[o]<=t&&(r[o]=t,a[o]=o?1:1-i),t=r[o],i=a[o];r[0]===r[1]&&a[0]*a[1]!=1?e.splice(n,1):n++}return e;function s(e,t,i){return e.interval[i]<t.interval[i]||e.interval[i]===t.interval[i]&&(e.close[i]-t.close[i]==(i?-1:1)||!i&&s(e,t,1))}},wc.isNumeric=function(e){return e-parseFloat(e)>=0};var Ac={},Ic=l,Cc=fn,Dc=wc;var Ec=Ic.normalizeCssArray,Lc=/([&<>"'])/g,Pc={"&":"&","<":"<",">":">",'"':""","'":"'"};function Nc(e){return null==e?"":(e+"").replace(Lc,(function(e,t){return Pc[t]}))}var Rc=["a","b","c","d","e","f","g"],Oc=function(e,t){return"{"+e+(null==t?"":t)+"}"};function kc(e,t){return"0000".substr(0,t-(e+="").length)+e}var zc=Cc.truncateText;Ac.addCommas=function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")},Ac.toCamelCase=function(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e},Ac.normalizeCssArray=Ec,Ac.encodeHTML=Nc,Ac.formatTpl=function(e,t,i){Ic.isArray(t)||(t=[t]);var n=t.length;if(!n)return"";for(var r=t[0].$vars||[],a=0;a<r.length;a++){var o=Rc[a];e=e.replace(Oc(o),Oc(o,0))}for(var s=0;s<n;s++)for(var l=0;l<r.length;l++){var u=t[s][r[l]];e=e.replace(Oc(Rc[l],s),i?Nc(u):u)}return e},Ac.formatTplSimple=function(e,t,i){return Ic.each(t,(function(t,n){e=e.replace("{"+n+"}",i?Nc(t):t)})),e},Ac.getTooltipMarker=function(e,t){var i=(e=Ic.isString(e)?{color:e,extraCssText:t}:e||{}).color,n=e.type,r=(t=e.extraCssText,e.renderMode||"html"),a=e.markerId||"X";return i?"html"===r?"subItem"===n?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Nc(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+Nc(i)+";"+(t||"")+'"></span>':{renderMode:r,content:"{marker"+a+"|} ",style:{color:i}}:""},Ac.formatTime=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=Dc.parseDate(t),r=i?"UTC":"",a=n["get"+r+"FullYear"](),o=n["get"+r+"Month"]()+1,s=n["get"+r+"Date"](),l=n["get"+r+"Hours"](),u=n["get"+r+"Minutes"](),h=n["get"+r+"Seconds"](),c=n["get"+r+"Milliseconds"]();return e=e.replace("MM",kc(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100).replace("dd",kc(s,2)).replace("d",s).replace("hh",kc(l,2)).replace("h",l).replace("mm",kc(u,2)).replace("m",u).replace("ss",kc(h,2)).replace("s",h).replace("SSS",kc(c,3))},Ac.capitalFirst=function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},Ac.truncateText=zc,Ac.getTextBoundingRect=function(e){return Cc.getBoundingRect(e.text,e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich,e.truncate)},Ac.getTextRect=function(e,t,i,n,r,a,o,s){return Cc.getBoundingRect(e,t,i,n,r,s,a,o)},Ac.windowOpen=function(e,t){if("_blank"===t||"blank"===t){var i=window.open();i.opener=null,i.location=e}else window.open(e,t)};var Bc=l,Fc=wi,Vc=wc.parsePercent,Gc=Ac,Hc=Bc.each,Uc=["left","right","top","bottom","width","height"],Wc=[["width","left","right"],["height","top","bottom"]];function jc(e,t,i,n,r){var a=0,o=0;null==n&&(n=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=t.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===e){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,o+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=o+v)>r||l.newline?(a+=s+i,o=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===e?a=h+i:o=c+i)}))}var Xc=jc,Zc=Bc.curry(jc,"vertical"),qc=Bc.curry(jc,"horizontal");function Yc(e,t,i){i=Gc.normalizeCssArray(i||0);var n=t.width,r=t.height,a=Vc(e.left,n),o=Vc(e.top,r),s=Vc(e.right,n),l=Vc(e.bottom,r),u=Vc(e.width,n),h=Vc(e.height,r),c=i[2]+i[0],d=i[1]+i[3],f=e.aspect;switch(isNaN(u)&&(u=n-s-d-a),isNaN(h)&&(h=r-l-c-o),null!=f&&(isNaN(u)&&isNaN(h)&&(f>n/r?u=.8*n:h=.8*r),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(a)&&(a=n-s-u-d),isNaN(o)&&(o=r-l-h-c),e.left||e.right){case"center":a=n/2-u/2-i[3];break;case"right":a=n-u-d}switch(e.top||e.bottom){case"middle":case"center":o=r/2-h/2-i[0];break;case"bottom":o=r-h-c}a=a||0,o=o||0,isNaN(u)&&(u=n-d-a-(s||0)),isNaN(h)&&(h=r-c-o-(l||0));var p=new Fc(a+i[3],o+i[0],u,h);return p.margin=i,p}function Kc(e,t){return t&&e&&Hc(Uc,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}bc.LOCATION_PARAMS=Uc,bc.HV_NAMES=Wc,bc.box=Xc,bc.vbox=Zc,bc.hbox=qc,bc.getAvailableSize=function(e,t,i){var n=t.width,r=t.height,a=Vc(e.x,n),o=Vc(e.y,r),s=Vc(e.x2,n),l=Vc(e.y2,r);return(isNaN(a)||isNaN(parseFloat(e.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.x2)))&&(s=n),(isNaN(o)||isNaN(parseFloat(e.y)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.y2)))&&(l=r),i=Gc.normalizeCssArray(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-o-i[0]-i[2],0)}},bc.getLayoutRect=Yc,bc.positionElement=function(e,t,i,n,r){var a=!r||!r.hv||r.hv[0],o=!r||!r.hv||r.hv[1],s=r&&r.boundingMode||"all";if(a||o){var l;if("raw"===s)l="group"===e.type?new Fc(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();(l=l.clone()).applyTransform(u)}t=Yc(Bc.defaults({width:l.width,height:l.height},t),i,n);var h=e.position,c=a?t.x-l.x:0,d=o?t.y-l.y:0;e.attr("position","raw"===s?[c,d]:[h[0]+c,h[1]+d])}},bc.sizeCalculable=function(e,t){return null!=e[Wc[t][0]]||null!=e[Wc[t][1]]&&null!=e[Wc[t][2]]},bc.mergeLayoutParam=function(e,t,i){!Bc.isObject(i)&&(i={});var n=i.ignoreSize;!Bc.isArray(n)&&(n=[n,n]);var r=o(Wc[0],0),a=o(Wc[1],1);function o(i,r){var a={},o=0,u={},h=0;if(Hc(i,(function(t){u[t]=e[t]})),Hc(i,(function(e){s(t,e)&&(a[e]=u[e]=t[e]),l(a,e)&&o++,l(u,e)&&h++})),n[r])return l(t,i[1])?u[i[2]]=null:l(t,i[2])&&(u[i[1]]=null),u;if(2!==h&&o){if(o>=2)return a;for(var c=0;c<i.length;c++){var d=i[c];if(!s(a,d)&&s(e,d)){a[d]=e[d];break}}return a}return u}function s(e,t){return e.hasOwnProperty(t)}function l(e,t){return null!=e[t]&&"auto"!==e[t]}function u(e,t,i){Hc(e,(function(e){t[e]=i[e]}))}u(Wc[0],e,r),u(Wc[1],e,a)},bc.getLayoutParams=function(e){return Kc({},e)},bc.copyLayoutParams=Kc;var Qc={getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}},Jc=l,$c=mc,ed=vc,td=ro,id=td.enableClassManagement,nd=td.parseClassType,rd=qa.makeInner,ad=bc,od=Qc,sd=rd(),ld=$c.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(e,t,i,n){$c.call(this,e,t,i,n),this.uid=ed.getUID("ec_cpt_model")},init:function(e,t,i,n){this.mergeDefaultAndTheme(e,i)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?ad.getLayoutParams(e):{},r=t.getTheme();Jc.merge(e,r.get(this.mainType)),Jc.merge(e,this.getDefaultOption()),i&&ad.mergeLayoutParam(e,n,i)},mergeOption:function(e,t){Jc.merge(this.option,e,!0);var i=this.layoutMode;i&&ad.mergeLayoutParam(this.option,e,i)},optionUpdated:function(e,t){},getDefaultOption:function(){var e=sd(this);if(!e.defaultOption){for(var t=[],i=this.constructor;i;){var n=i.prototype.defaultOption;n&&t.push(n),i=i.superClass}for(var r={},a=t.length-1;a>=0;a--)r=Jc.merge(r,t[a],!0);e.defaultOption=r}return e.defaultOption},getReferringComponents:function(e){return this.ecModel.queryComponents({mainType:e,index:this.get(e+"Index",!0),id:this.get(e+"Id",!0)})}});id(ld,{registerWhenExtend:!0}),ed.enableSubTypeDefaulter(ld),ed.enableTopologicalTravel(ld,(function(e){var t=[];Jc.each(ld.getClassesByMainType(e),(function(e){t=t.concat(e.prototype.dependencies||[])})),t=Jc.map(t,(function(e){return nd(e).main})),"dataset"!==e&&Jc.indexOf(t,"dataset")<=0&&t.unshift("dataset");return t})),Jc.mixin(ld,od);var ud=ld,hd="";"undefined"!=typeof navigator&&(hd=navigator.platform||"");var cd={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:hd.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},dd=qa,fd=dd.makeInner,pd=dd.normalizeToArray,gd=fd();var md={clearColorPalette:function(){gd(this).colorIdx=0,gd(this).colorNameMap={}},getColorFromPalette:function(e,t,i){var n=gd(t=t||this),r=n.colorIdx||0,a=n.colorNameMap=n.colorNameMap||{};if(a.hasOwnProperty(e))return a[e];var o=pd(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?function(e,t){for(var i=e.length,n=0;n<i;n++)if(e[n].length>t)return e[n];return e[i-1]}(s,i):o;if((l=l||o)&&l.length){var u=l[r];return e&&(a[e]=u),n.colorIdx=(r+1)%l.length,u}}},vd=md,yd={},_d={};_d.SOURCE_FORMAT_ORIGINAL="original",_d.SOURCE_FORMAT_ARRAY_ROWS="arrayRows",_d.SOURCE_FORMAT_OBJECT_ROWS="objectRows",_d.SOURCE_FORMAT_KEYED_COLUMNS="keyedColumns",_d.SOURCE_FORMAT_UNKNOWN="unknown",_d.SOURCE_FORMAT_TYPED_ARRAY="typedArray",_d.SERIES_LAYOUT_BY_COLUMN="column",_d.SERIES_LAYOUT_BY_ROW="row";var xd=l,bd=xd.createHashMap,wd=xd.isTypedArray,Td=ro.enableClassCheck,Sd=_d,Md=Sd.SOURCE_FORMAT_ORIGINAL,Ad=Sd.SERIES_LAYOUT_BY_COLUMN,Id=Sd.SOURCE_FORMAT_UNKNOWN,Cd=Sd.SOURCE_FORMAT_TYPED_ARRAY,Dd=Sd.SOURCE_FORMAT_KEYED_COLUMNS;function Ed(e){this.fromDataset=e.fromDataset,this.data=e.data||(e.sourceFormat===Dd?{}:[]),this.sourceFormat=e.sourceFormat||Id,this.seriesLayoutBy=e.seriesLayoutBy||Ad,this.dimensionsDefine=e.dimensionsDefine,this.encodeDefine=e.encodeDefine&&bd(e.encodeDefine),this.startIndex=e.startIndex||0,this.dimensionsDetectCount=e.dimensionsDetectCount}Ed.seriesDataToSource=function(e){return new Ed({data:e,sourceFormat:wd(e)?Cd:Md,fromDataset:!1})},Td(Ed);var Ld=Ed,Pd=qa,Nd=Pd.makeInner,Rd=Pd.getDataItemValue,Od=l,kd=Od.createHashMap,zd=Od.each,Bd=Od.map,Fd=Od.isArray,Vd=Od.isString,Gd=Od.isObject,Hd=Od.isTypedArray,Ud=Od.isArrayLike,Wd=Od.extend;Od.assert;var jd=Ld,Xd=_d,Zd=Xd.SOURCE_FORMAT_ORIGINAL,qd=Xd.SOURCE_FORMAT_ARRAY_ROWS,Yd=Xd.SOURCE_FORMAT_OBJECT_ROWS,Kd=Xd.SOURCE_FORMAT_KEYED_COLUMNS,Qd=Xd.SOURCE_FORMAT_UNKNOWN,Jd=Xd.SOURCE_FORMAT_TYPED_ARRAY,$d=Xd.SERIES_LAYOUT_BY_ROW,ef={Must:1,Might:2,Not:3},tf=Nd();function nf(e){if(e){var t=kd();return Bd(e,(function(e,i){if(null==(e=Wd({},Gd(e)?e:{name:e})).name)return e;e.name+="",null==e.displayName&&(e.displayName=e.name);var n=t.get(e.name);return n?e.name+="-"+n.count++:t.set(e.name,{count:1}),e}))}}function rf(e,t,i,n){if(null==n&&(n=1/0),t===$d)for(var r=0;r<i.length&&r<n;r++)e(i[r]?i[r][0]:null,r);else{var a=i[0]||[];for(r=0;r<a.length&&r<n;r++)e(a[r],r)}}function af(e){var t=e.option;if(!t.data)return e.ecModel.getComponent("dataset",t.datasetIndex||0)}function of(e,t,i,n,r,a){var o,s,l;if(Hd(e))return ef.Not;if(n){var u=n[a];Gd(u)?(s=u.name,l=u.type):Vd(u)&&(s=u)}if(null!=l)return"ordinal"===l?ef.Must:ef.Not;if(t===qd)if(i===$d){for(var h=e[a],c=0;c<(h||[]).length&&c<5;c++)if(null!=(o=g(h[r+c])))return o}else for(c=0;c<e.length&&c<5;c++){var d=e[r+c];if(d&&null!=(o=g(d[a])))return o}else if(t===Yd){if(!s)return ef.Not;for(c=0;c<e.length&&c<5;c++){if((f=e[c])&&null!=(o=g(f[s])))return o}}else if(t===Kd){if(!s)return ef.Not;if(!(h=e[s])||Hd(h))return ef.Not;for(c=0;c<h.length&&c<5;c++)if(null!=(o=g(h[c])))return o}else if(t===Zd)for(c=0;c<e.length&&c<5;c++){var f=e[c],p=Rd(f);if(!Fd(p))return ef.Not;if(null!=(o=g(p[a])))return o}function g(e){var t=Vd(e);return null!=e&&isFinite(e)&&""!==e?t?ef.Might:ef.Not:t&&"-"!==e?ef.Must:void 0}return ef.Not}yd.BE_ORDINAL=ef,yd.detectSourceFormat=function(e){var t=e.option.source,i=Qd;if(Hd(t))i=Jd;else if(Fd(t)){0===t.length&&(i=qd);for(var n=0,r=t.length;n<r;n++){var a=t[n];if(null!=a){if(Fd(a)){i=qd;break}if(Gd(a)){i=Yd;break}}}}else if(Gd(t)){for(var o in t)if(t.hasOwnProperty(o)&&Ud(t[o])){i=Kd;break}}else if(null!=t)throw new Error("Invalid data");tf(e).sourceFormat=i},yd.getSource=function(e){return tf(e).source},yd.resetSourceDefaulter=function(e){tf(e).datasetMap=kd()},yd.prepareSource=function(e){var t=e.option,i=t.data,n=Hd(i)?Jd:Zd,r=!1,a=t.seriesLayoutBy,o=t.sourceHeader,s=t.dimensions,l=af(e);if(l){var u=l.option;i=u.source,n=tf(l).sourceFormat,r=!0,a=a||u.seriesLayoutBy,null==o&&(o=u.sourceHeader),s=s||u.dimensions}var h=function(e,t,i,n,r){if(!e)return{dimensionsDefine:nf(r)};var a,o;if(t===qd)"auto"===n||null==n?rf((function(e){null!=e&&"-"!==e&&(Vd(e)?null==o&&(o=1):o=0)}),i,e,10):o=n?1:0,r||1!==o||(r=[],rf((function(e,t){r[t]=null!=e?e:""}),i,e)),a=r?r.length:i===$d?e.length:e[0]?e[0].length:null;else if(t===Yd)r||(r=function(e){var t,i=0;for(;i<e.length&&!(t=e[i++]););if(t){var n=[];return zd(t,(function(e,t){n.push(t)})),n}}(e));else if(t===Kd)r||(r=[],zd(e,(function(e,t){r.push(t)})));else if(t===Zd){var s=Rd(e[0]);a=Fd(s)&&s.length||1}return{startIndex:o,dimensionsDefine:nf(r),dimensionsDetectCount:a}}(i,n,a,o,s);tf(e).source=new jd({data:i,fromDataset:r,seriesLayoutBy:a,sourceFormat:n,dimensionsDefine:h.dimensionsDefine,startIndex:h.startIndex,dimensionsDetectCount:h.dimensionsDetectCount,encodeDefine:t.encode})},yd.makeSeriesEncodeForAxisCoordSys=function(e,t,i){var n={},r=af(t);if(!r||!e)return n;var a,o,s=[],l=[],u=t.ecModel,h=tf(u).datasetMap,c=r.uid+"_"+i.seriesLayoutBy;e=e.slice(),zd(e,(function(t,i){!Gd(t)&&(e[i]={name:t}),"ordinal"===t.type&&null==a&&(a=i,o=p(e[i])),n[t.name]=[]}));var d=h.get(c)||h.set(c,{categoryWayDim:o,valueWayDim:0});function f(e,t,i){for(var n=0;n<i;n++)e.push(t+n)}function p(e){var t=e.dimsDef;return t?t.length:1}return zd(e,(function(e,t){var i=e.name,r=p(e);if(null==a){var o=d.valueWayDim;f(n[i],o,r),f(l,o,r),d.valueWayDim+=r}else if(a===t)f(n[i],0,r),f(s,0,r);else{o=d.categoryWayDim;f(n[i],o,r),f(l,o,r),d.categoryWayDim+=r}})),s.length&&(n.itemName=s),l.length&&(n.seriesName=l),n},yd.makeSeriesEncodeForNameBased=function(e,t,i){var n={};if(!af(e))return n;var r,a=t.sourceFormat,o=t.dimensionsDefine;a!==Yd&&a!==Kd||zd(o,(function(e,t){"name"===(Gd(e)?e.name:e)&&(r=t)}));var s=function(){for(var e={},n={},s=[],l=0,u=Math.min(5,i);l<u;l++){var h=of(t.data,a,t.seriesLayoutBy,o,t.startIndex,l);s.push(h);var c=h===ef.Not;if(c&&null==e.v&&l!==r&&(e.v=l),(null==e.n||e.n===e.v||!c&&s[e.n]===ef.Not)&&(e.n=l),d(e)&&s[e.n]!==ef.Not)return e;c||(h===ef.Might&&null==n.v&&l!==r&&(n.v=l),null!=n.n&&n.n!==n.v||(n.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(n)?n:null}();if(s){n.value=s.v;var l=null!=r?r:s.n;n.itemName=[l],n.seriesName=[l]}return n},yd.guessOrdinal=function(e,t){return of(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)};var sf=l,lf=sf.each,uf=sf.filter,hf=sf.map,cf=sf.isArray,df=sf.indexOf,ff=sf.isObject,pf=sf.isString,gf=sf.createHashMap,mf=sf.assert,vf=sf.clone,yf=sf.merge,_f=sf.extend,xf=sf.mixin,bf=qa,wf=mc,Tf=ud,Sf=cd,Mf=vd,Af=yd.resetSourceDefaulter,If=wf.extend({init:function(e,t,i,n){i=i||{},this.option=null,this._theme=new wf(i),this._optionManager=n},setOption:function(e,t){mf(!("\0_ec_inner"in e),"please use chart.getOption()"),this._optionManager.setOption(e,t),this.resetOption(null)},resetOption:function(e){var t=!1,i=this._optionManager;if(!e||"recreate"===e){var n=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this.mergeOption(n)):Cf.call(this,n),t=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var r=i.getTimelineOption(this);r&&(this.mergeOption(r),t=!0)}if(!e||"recreate"===e||"media"===e){var a=i.getMediaOption(this,this._api);a.length&&lf(a,(function(e){this.mergeOption(e,t=!0)}),this)}return t},mergeOption:function(e){var t=this.option,i=this._componentsMap,n=[];Af(this),lf(e,(function(e,i){null!=e&&(Tf.hasClass(i)?i&&n.push(i):t[i]=null==t[i]?vf(e):yf(t[i],e,!0))})),Tf.topologicalTravel(n,Tf.getAllClassMainTypes(),(function(n,r){var a=bf.normalizeToArray(e[n]),o=bf.mappingToExists(i.get(n),a);bf.makeIdAndName(o),lf(o,(function(e,t){var i=e.option;ff(i)&&(e.keyInfo.mainType=n,e.keyInfo.subType=function(e,t,i){return t.type?t.type:i?i.subType:Tf.determineSubType(e,t)}(n,i,e.exist))}));var s=function(e,t){cf(t)||(t=t?[t]:[]);var i={};return lf(t,(function(t){i[t]=(e.get(t)||[]).slice()})),i}(i,r);t[n]=[],i.set(n,[]),lf(o,(function(e,r){var a=e.exist,o=e.option;if(mf(ff(o)||a,"Empty component definition"),o){var l=Tf.getClass(n,e.keyInfo.subType,!0);if(a&&a.constructor===l)a.name=e.keyInfo.name,a.mergeOption(o,this),a.optionUpdated(o,!1);else{var u=_f({dependentModels:s,componentIndex:r},e.keyInfo);a=new l(o,this,this,u),_f(a,u),a.init(o,this,this,u),a.optionUpdated(null,!0)}}else a.mergeOption({},this),a.optionUpdated({},!1);i.get(n)[r]=a,t[n][r]=a.option}),this),"series"===n&&Df(this,i.get("series"))}),this),this._seriesIndicesMap=gf(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var e=vf(this.option);return lf(e,(function(t,i){if(Tf.hasClass(i)){for(var n=(t=bf.normalizeToArray(t)).length-1;n>=0;n--)bf.isIdInner(t[n])&&t.splice(n,1);e[i]=t}})),delete e["\0_ec_inner"],e},getTheme:function(){return this._theme},getComponent:function(e,t){var i=this._componentsMap.get(e);if(i)return i[t||0]},queryComponents:function(e){var t=e.mainType;if(!t)return[];var i,n=e.index,r=e.id,a=e.name,o=this._componentsMap.get(t);if(!o||!o.length)return[];if(null!=n)cf(n)||(n=[n]),i=uf(hf(n,(function(e){return o[e]})),(function(e){return!!e}));else if(null!=r){var s=cf(r);i=uf(o,(function(e){return s&&df(r,e.id)>=0||!s&&e.id===r}))}else if(null!=a){var l=cf(a);i=uf(o,(function(e){return l&&df(a,e.name)>=0||!l&&e.name===a}))}else i=o.slice();return Ef(i,e)},findComponents:function(e){var t,i,n,r,a,o=e.query,s=e.mainType,l=(i=s+"Index",n=s+"Id",r=s+"Name",!(t=o)||null==t[i]&&null==t[n]&&null==t[r]?null:{mainType:s,index:t[i],id:t[n],name:t[r]}),u=l?this.queryComponents(l):this._componentsMap.get(s);return a=Ef(u,e),e.filter?uf(a,e.filter):a},eachComponent:function(e,t,i){var n=this._componentsMap;if("function"==typeof e)i=t,t=e,n.each((function(e,n){lf(e,(function(e,r){t.call(i,n,e,r)}))}));else if(pf(e))lf(n.get(e),t,i);else if(ff(e)){var r=this.findComponents(e);lf(r,t,i)}},getSeriesByName:function(e){var t=this._componentsMap.get("series");return uf(t,(function(t){return t.name===e}))},getSeriesByIndex:function(e){return this._componentsMap.get("series")[e]},getSeriesByType:function(e){var t=this._componentsMap.get("series");return uf(t,(function(t){return t.subType===e}))},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(e,t){lf(this._seriesIndices,(function(i){var n=this._componentsMap.get("series")[i];e.call(t,n,i)}),this)},eachRawSeries:function(e,t){lf(this._componentsMap.get("series"),e,t)},eachSeriesByType:function(e,t,i){lf(this._seriesIndices,(function(n){var r=this._componentsMap.get("series")[n];r.subType===e&&t.call(i,r,n)}),this)},eachRawSeriesByType:function(e,t,i){return lf(this.getSeriesByType(e),t,i)},isSeriesFiltered:function(e){return null==this._seriesIndicesMap.get(e.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(e,t){Df(this,uf(this._componentsMap.get("series"),e,t))},restoreData:function(e){var t=this._componentsMap;Df(this,t.get("series"));var i=[];t.each((function(e,t){i.push(t)})),Tf.topologicalTravel(i,Tf.getAllClassMainTypes(),(function(i,n){lf(t.get(i),(function(t){("series"!==i||!function(e,t){if(t){var i=t.seiresIndex,n=t.seriesId,r=t.seriesName;return null!=i&&e.componentIndex!==i||null!=n&&e.id!==n||null!=r&&e.name!==r}}(t,e))&&t.restoreData()}))}))}});function Cf(e){var t,i,n;e=e,this.option={},this.option["\0_ec_inner"]=1,this._componentsMap=gf({series:[]}),this._seriesIndices,this._seriesIndicesMap,t=e,i=this._theme.option,n=t.color&&!t.colorLayer,lf(i,(function(e,i){"colorLayer"===i&&n||Tf.hasClass(i)||("object"==typeof e?t[i]=t[i]?yf(t[i],e,!1):vf(e):null==t[i]&&(t[i]=e))})),yf(e,Sf,!1),this.mergeOption(e)}function Df(e,t){e._seriesIndicesMap=gf(e._seriesIndices=hf(t,(function(e){return e.componentIndex}))||[])}function Ef(e,t){return t.hasOwnProperty("subType")?uf(e,(function(e){return e.subType===t.subType})):e}xf(If,Mf);var Lf=If,Pf=l,Nf=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];var Rf=function(e){Pf.each(Nf,(function(t){this[t]=Pf.bind(e[t],e)}),this)},Of=l,kf={};function zf(){this._coordinateSystems=[]}zf.prototype={constructor:zf,create:function(e,t){var i=[];Of.each(kf,(function(n,r){var a=n.create(e,t);i=i.concat(a||[])})),this._coordinateSystems=i},update:function(e,t){Of.each(this._coordinateSystems,(function(i){i.update&&i.update(e,t)}))},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},zf.register=function(e,t){kf[e]=t},zf.get=function(e){return kf[e]};var Bf=zf,Ff=l,Vf=qa,Gf=ud,Hf=Ff.each,Uf=Ff.clone,Wf=Ff.map,jf=Ff.merge,Xf=/^(min|max)?(.+)$/;function Zf(e){this._api=e,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function qf(e,t,i){var n,r,a=[],o=[],s=e.timeline;if(e.baseOption&&(r=e.baseOption),(s||e.options)&&(r=r||{},a=(e.options||[]).slice()),e.media){r=r||{};var l=e.media;Hf(l,(function(e){e&&e.option&&(e.query?o.push(e):n||(n=e))}))}return r||(r=e),r.timeline||(r.timeline=s),Hf([r].concat(a).concat(Ff.map(o,(function(e){return e.option}))),(function(e){Hf(t,(function(t){t(e,i)}))})),{baseOption:r,timelineOptions:a,mediaDefault:n,mediaList:o}}function Yf(e,t,i){var n={width:t,height:i,aspectratio:t/i},r=!0;return Ff.each(e,(function(e,t){var i=t.match(Xf);if(i&&i[1]&&i[2]){var a=i[1],o=i[2].toLowerCase();(function(e,t,i){return"min"===i?e>=t:"max"===i?e<=t:e===t})(n[o],e,a)||(r=!1)}})),r}Zf.prototype={constructor:Zf,setOption:function(e,t){e&&Ff.each(Vf.normalizeToArray(e.series),(function(e){e&&e.data&&Ff.isTypedArray(e.data)&&Ff.setAsPrimitive(e.data)})),e=Uf(e);var i,n,r=this._optionBackup,a=qf.call(this,e,t,!r);this._newBaseOption=a.baseOption,r?(i=r.baseOption,n=a.baseOption,Hf(n=n||{},(function(e,t){if(null!=e){var n=i[t];if(Gf.hasClass(t)){e=Vf.normalizeToArray(e),n=Vf.normalizeToArray(n);var r=Vf.mappingToExists(n,e);i[t]=Wf(r,(function(e){return e.option&&e.exist?jf(e.exist,e.option,!0):e.exist||e.option}))}else i[t]=jf(n,e,!0)}})),a.timelineOptions.length&&(r.timelineOptions=a.timelineOptions),a.mediaList.length&&(r.mediaList=a.mediaList),a.mediaDefault&&(r.mediaDefault=a.mediaDefault)):this._optionBackup=a},mountOption:function(e){var t=this._optionBackup;return this._timelineOptions=Wf(t.timelineOptions,Uf),this._mediaList=Wf(t.mediaList,Uf),this._mediaDefault=Uf(t.mediaDefault),this._currentMediaIndices=[],Uf(e?t.baseOption:this._newBaseOption)},getTimelineOption:function(e){var t,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(t=Uf(i[n.getCurrentIndex()],!0))}return t},getMediaOption:function(e){var t,i,n=this._api.getWidth(),r=this._api.getHeight(),a=this._mediaList,o=this._mediaDefault,s=[],l=[];if(!a.length&&!o)return l;for(var u=0,h=a.length;u<h;u++)Yf(a[u].query,n,r)&&s.push(u);return!s.length&&o&&(s=[-1]),s.length&&(t=s,i=this._currentMediaIndices,t.join(",")!==i.join(","))&&(l=Wf(s,(function(e){return Uf(-1===e?o.option:a[e].option)}))),this._currentMediaIndices=s,l}};var Kf=Zf,Qf=l,Jf=qa,$f=Qf.each,ep=Qf.isObject,tp=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function ip(e){var t=e&&e.itemStyle;if(t)for(var i=0,n=tp.length;i<n;i++){var r=tp[i],a=t.normal,o=t.emphasis;a&&a[r]&&(e[r]=e[r]||{},e[r].normal?Qf.merge(e[r].normal,a[r]):e[r].normal=a[r],a[r]=null),o&&o[r]&&(e[r]=e[r]||{},e[r].emphasis?Qf.merge(e[r].emphasis,o[r]):e[r].emphasis=o[r],o[r]=null)}}function np(e,t,i){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var n=e[t].normal,r=e[t].emphasis;n&&(i?(e[t].normal=e[t].emphasis=null,Qf.defaults(e[t],n)):e[t]=n),r&&(e.emphasis=e.emphasis||{},e.emphasis[t]=r)}}function rp(e){np(e,"itemStyle"),np(e,"lineStyle"),np(e,"areaStyle"),np(e,"label"),np(e,"labelLine"),np(e,"upperLabel"),np(e,"edgeLabel")}function ap(e,t){var i=ep(e)&&e[t],n=ep(i)&&i.textStyle;if(n)for(var r=0,a=Jf.TEXT_STYLE_OPTIONS.length;r<a;r++){t=Jf.TEXT_STYLE_OPTIONS[r];n.hasOwnProperty(t)&&(i[t]=n[t])}}function op(e){e&&(rp(e),ap(e,"label"),e.emphasis&&ap(e.emphasis,"label"))}function sp(e){return Qf.isArray(e)?e:e?[e]:[]}function lp(e){return(Qf.isArray(e)?e[0]:e)||{}}var up=function(e,t){$f(sp(e.series),(function(e){ep(e)&&function(e){if(ep(e)){ip(e),rp(e),ap(e,"label"),ap(e,"upperLabel"),ap(e,"edgeLabel"),e.emphasis&&(ap(e.emphasis,"label"),ap(e.emphasis,"upperLabel"),ap(e.emphasis,"edgeLabel")),(i=e.markPoint)&&(ip(i),op(i)),(n=e.markLine)&&(ip(n),op(n));var t=e.markArea;t&&op(t);var i,n,r=e.data;if("graph"===e.type){r=r||e.nodes;var a=e.links||e.edges;if(a&&!Qf.isTypedArray(a))for(var o=0;o<a.length;o++)op(a[o]);Qf.each(e.categories,(function(e){rp(e)}))}if(r&&!Qf.isTypedArray(r))for(o=0;o<r.length;o++)op(r[o]);if((i=e.markPoint)&&i.data){var s=i.data;for(o=0;o<s.length;o++)op(s[o])}if((n=e.markLine)&&n.data){var l=n.data;for(o=0;o<l.length;o++)Qf.isArray(l[o])?(op(l[o][0]),op(l[o][1])):op(l[o])}"gauge"===e.type?(ap(e,"axisLabel"),ap(e,"title"),ap(e,"detail")):"treemap"===e.type?(np(e.breadcrumb,"itemStyle"),Qf.each(e.levels,(function(e){rp(e)}))):"tree"===e.type&&rp(e.leaves)}}(e)}));var i=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&i.push("valueAxis","categoryAxis","logAxis","timeAxis"),$f(i,(function(t){$f(sp(e[t]),(function(e){e&&(ap(e,"axisLabel"),ap(e.axisPointer,"label"))}))})),$f(sp(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;ap(t,"axisLabel"),ap(t&&t.axisPointer,"label")})),$f(sp(e.calendar),(function(e){np(e,"itemStyle"),ap(e,"dayLabel"),ap(e,"monthLabel"),ap(e,"yearLabel")})),$f(sp(e.radar),(function(e){ap(e,"name")})),$f(sp(e.geo),(function(e){ep(e)&&(op(e),$f(sp(e.regions),(function(e){op(e)})))})),$f(sp(e.timeline),(function(e){op(e),np(e,"label"),np(e,"itemStyle"),np(e,"controlStyle",!0);var t=e.data;Qf.isArray(t)&&Qf.each(t,(function(e){Qf.isObject(e)&&(np(e,"label"),np(e,"itemStyle"))}))})),$f(sp(e.toolbox),(function(e){np(e,"iconStyle"),$f(e.feature,(function(e){np(e,"iconStyle")}))})),ap(lp(e.axisPointer),"label"),ap(lp(e.tooltip).axisPointer,"label")},hp=l,cp=hp.each,dp=hp.isArray,fp=hp.isObject,pp=up,gp=qa.normalizeToArray;function mp(e){cp(vp,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var vp=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],yp=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"];var _p=function(e,t){pp(e,t),e.series=gp(e.series),cp(e.series,(function(e){if(fp(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow);else if("pie"===t||"gauge"===t)null!=e.clockWise&&(e.clockwise=e.clockWise);else if("gauge"===t){var i=function(e,t){t=t.split(",");for(var i=e,n=0;n<t.length&&null!=(i=i&&i[t[n]]);n++);return i}(e,"pointer.color");null!=i&&function(e,t,i,n){t=t.split(",");for(var r,a=e,o=0;o<t.length-1;o++)null==a[r=t[o]]&&(a[r]={}),a=a[r];(n||null==a[t[o]])&&(a[t[o]]=i)}(e,"itemStyle.color",i)}mp(e)}})),e.dataRange&&(e.visualMap=e.dataRange),cp(yp,(function(t){var i=e[t];i&&(dp(i)||(i=[i]),cp(i,(function(e){mp(e)})))}))},xp=l,bp=xp.createHashMap,wp=xp.each;function Tp(e){wp(e,(function(t,i){var n=[],r=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=o.map(a,(function(a,l,u){var h,c,d=o.get(t.stackedDimension,u);if(isNaN(d))return r;s?c=o.getRawIndex(u):h=o.get(t.stackedByDimension,u);for(var f=NaN,p=i-1;p>=0;p--){var g=e[p];if(s||(c=g.data.rawIndexOf(g.stackedByDimension,h)),c>=0){var m=g.data.getByRawIndex(g.stackResultDimension,c);if(d>=0&&m>0||d<=0&&m<0){d+=m,f=m;break}}}return n[0]=d,n[1]=f,n}));o.hostModel.setData(l),t.data=l}))}var Sp=function(e){var t=bp();e.eachSeries((function(e){var i=e.get("stack");if(i){var n=t.get(i)||t.set(i,[]),r=e.getData(),a={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:e};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;n.length&&r.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(a)}})),t.each(Tp)},Mp={},Ap=l;Ap.isTypedArray;var Ip=Ap.extend;Ap.assert;var Cp=Ap.each,Dp=Ap.isObject,Ep=qa,Lp=Ep.getDataItemValue,Pp=Ep.isDataItemOption,Np=wc.parseDate,Rp=Ld,Op=_d,kp=Op.SOURCE_FORMAT_TYPED_ARRAY,zp=Op.SOURCE_FORMAT_ARRAY_ROWS,Bp=Op.SOURCE_FORMAT_ORIGINAL,Fp=Op.SOURCE_FORMAT_OBJECT_ROWS;function Vp(e,t){Rp.isInstance(e)||(e=Rp.seriesDataToSource(e)),this._source=e;var i=this._data=e.data,n=e.sourceFormat;n===kp&&(this._offset=0,this._dimSize=t,this._data=i);var r=Hp[n===zp?n+"_"+e.seriesLayoutBy:n];Ip(this,r)}var Gp=Vp.prototype;Gp.pure=!1,Gp.persistent=!0,Gp.getSource=function(){return this._source};var Hp={arrayRows_column:{pure:!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(e){return this._data[e+this._source.startIndex]},appendData:jp},arrayRows_row:{pure:!0,count:function(){var e=this._data[0];return e?Math.max(0,e.length-this._source.startIndex):0},getItem:function(e){e+=this._source.startIndex;for(var t=[],i=this._data,n=0;n<i.length;n++){var r=i[n];t.push(r?r[e]:null)}return t},appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},objectRows:{pure:!0,count:Up,getItem:Wp,appendData:jp},keyedColumns:{pure:!0,count:function(){var e=this._source.dimensionsDefine[0].name,t=this._data[e];return t?t.length:0},getItem:function(e){for(var t=[],i=this._source.dimensionsDefine,n=0;n<i.length;n++){var r=this._data[i[n].name];t.push(r?r[e]:null)}return t},appendData:function(e){var t=this._data;Cp(e,(function(e,i){for(var n=t[i]||(t[i]=[]),r=0;r<(e||[]).length;r++)n.push(e[r])}))}},original:{count:Up,getItem:Wp,appendData:jp},typedArray:{persistent:!1,pure:!0,count:function(){return this._data?this._data.length/this._dimSize:0},getItem:function(e,t){e-=this._offset,t=t||[];for(var i=this._dimSize*e,n=0;n<this._dimSize;n++)t[n]=this._data[i+n];return t},appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}}};function Up(){return this._data.length}function Wp(e){return this._data[e]}function jp(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}var Xp={arrayRows:Zp,objectRows:function(e,t,i,n){return null!=i?e[n]:e},keyedColumns:Zp,original:function(e,t,i,n){var r=Lp(e);return null!=i&&r instanceof Array?r[i]:r},typedArray:Zp};function Zp(e,t,i,n){return null!=i?e[i]:e}var qp={arrayRows:Yp,objectRows:function(e,t,i,n){return Kp(e[t],this._dimensionInfos[t])},keyedColumns:Yp,original:function(e,t,i,n){var r=e&&(null==e.value?e:e.value);return!this._rawData.pure&&Pp(e)&&(this.hasItemOption=!0),Kp(r instanceof Array?r[n]:r,this._dimensionInfos[t])},typedArray:function(e,t,i,n){return e[n]}};function Yp(e,t,i,n){return Kp(e[n],this._dimensionInfos[t])}function Kp(e,t){var i=t&&t.type;if("ordinal"===i){var n=t&&t.ordinalMeta;return n?n.parseAndCollect(e):e}return"time"===i&&"number"!=typeof e&&null!=e&&"-"!==e&&(e=+Np(e)),null==e||""===e?NaN:+e}Mp.DefaultDataProvider=Vp,Mp.defaultDimValueGetters=qp,Mp.retrieveRawValue=function(e,t,i){if(e){var n=e.getRawDataItem(t);if(null!=n){var r,a,o=e.getProvider().getSource().sourceFormat,s=e.getDimensionInfo(i);return s&&(r=s.name,a=s.index),Xp[o](n,t,a,r)}}},Mp.retrieveRawAttr=function(e,t,i){if(e){var n=e.getProvider().getSource().sourceFormat;if(n===Bp||n===Fp){var r=e.getRawDataItem(t);return n!==Bp||Dp(r)||(r=null),r?r[i]:void 0}}};var Qp=Mp.retrieveRawValue,Jp=Ac,$p=Jp.getTooltipMarker,eg=Jp.formatTpl,tg=qa.getTooltipRenderMode,ig=/\{@(.+?)\}/g,ng={getDataParams:function(e,t){var i=this.getData(t),n=this.getRawValue(e,t),r=i.getRawIndex(e),a=i.getName(e),o=i.getRawDataItem(e),s=i.getItemVisual(e,"color"),l=i.getItemVisual(e,"borderColor"),u=this.ecModel.getComponent("tooltip"),h=u&&u.get("renderMode"),c=tg(h),d=this.mainType,f="series"===d,p=i.userOutput;return{componentType:d,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:f?this.subType:null,seriesIndex:this.seriesIndex,seriesId:f?this.id:null,seriesName:f?this.name:null,name:a,dataIndex:r,data:o,dataType:t,value:n,color:s,borderColor:l,dimensionNames:p?p.dimensionNames:null,encode:p?p.encode:null,marker:$p({color:s,renderMode:c}),$vars:["seriesName","name","value"]}},getFormattedLabel:function(e,t,i,n,r){t=t||"normal";var a=this.getData(i),o=a.getItemModel(e),s=this.getDataParams(e,i);null!=n&&s.value instanceof Array&&(s.value=s.value[n]);var l=o.get("normal"===t?[r||"label","formatter"]:[t,r||"label","formatter"]);return"function"==typeof l?(s.status=t,s.dimensionIndex=n,l(s)):"string"==typeof l?eg(l,s).replace(ig,(function(t,i){var n=i.length;return"["===i.charAt(0)&&"]"===i.charAt(n-1)&&(i=+i.slice(1,n-1)),Qp(a,e,i)})):void 0},getRawValue:function(e,t){return Qp(this.getData(t),e)},formatTooltip:function(){}},rg={},ag=l;ag.assert;var og=ag.isArray;function sg(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0,this.context}var lg=sg.prototype;lg.perform=function(e){var t,i=this._upstream,n=e&&e.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!n&&(t=this._plan(this.context));var a,o=h(this._modBy),s=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;function h(e){return!(e>=1)&&(e=1),e}o===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,a=function(e,t){var i,n;e._dueIndex=e._outputDueEnd=e._dueEnd=0,e._settedOutputEnd=null,!t&&e._reset&&((i=e._reset(e.context))&&i.progress&&(n=i.forceFirstProgress,i=i.progress),og(i)&&!i.length&&(i=null));e._progress=i,e._modBy=e._modDataCount=null;var r=e._downstream;return r&&r.dirty(),n}(this,n)),this._modBy=l,this._modDataCount=u;var c=e&&e.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,f=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!n&&(a||d<f)){var p=this._progress;if(og(p))for(var g=0;g<p.length;g++)hg(this,p[g],d,f,l,u);else hg(this,p,d,f,l,u)}this._dueIndex=f;var m=null!=this._settedOutputEnd?this._settedOutputEnd:f;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()};var ug=function(){var e,t,i,n,r,a={reset:function(l,u,h,c){t=l,e=u,i=h,n=c,r=Math.ceil(n/i),a.next=i>1&&n>0?s:o}};return a;function o(){return t<e?t++:null}function s(){var a=t%r*i+Math.ceil(t/r),o=t>=e?null:a<n?a:t;return t++,o}}();function hg(e,t,i,n,r,a){ug.reset(i,n,r,a),e._callingProgress=t,e._callingProgress({start:i,end:n,count:n-i,next:ug.next},e.context)}lg.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},lg.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},lg.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},lg.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},lg.getUpstream=function(){return this._upstream},lg.getDownstream=function(){return this._downstream},lg.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},rg.createTask=function(e){return new sg(e)};var cg=l,dg=s,fg=Ac,pg=fg.formatTime,gg=fg.encodeHTML,mg=fg.addCommas,vg=fg.getTooltipMarker,yg=qa,_g=ud,xg=vd,bg=ng,wg=bc,Tg=wg.getLayoutParams,Sg=wg.mergeLayoutParam,Mg=rg.createTask,Ag=yd,Ig=Ag.prepareSource,Cg=Ag.getSource,Dg=Mp.retrieveRawValue,Eg=yg.makeInner(),Lg=_g.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendVisualProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(e,t,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Mg({count:Ng,reset:Rg}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,i),Ig(this);var r=this.getInitialData(e,i);kg(r,this),this.dataTask.context.data=r,Eg(this).dataBeforeProcessed=r,Pg(this)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?Tg(e):{},r=this.subType;_g.hasClass(r)&&(r+="Series"),cg.merge(e,t.getTheme().get(this.subType)),cg.merge(e,this.getDefaultOption()),yg.defaultEmphasis(e,"label",["show"]),this.fillDataTextStyle(e.data),i&&Sg(e,n,i)},mergeOption:function(e,t){e=cg.merge(this.option,e,!0),this.fillDataTextStyle(e.data);var i=this.layoutMode;i&&Sg(this.option,e,i),Ig(this);var n=this.getInitialData(e,t);kg(n,this),this.dataTask.dirty(),this.dataTask.context.data=n,Eg(this).dataBeforeProcessed=n,Pg(this)},fillDataTextStyle:function(e){if(e&&!cg.isTypedArray(e))for(var t=["show"],i=0;i<e.length;i++)e[i]&&e[i].label&&yg.defaultEmphasis(e[i],"label",t)},getInitialData:function(){},appendData:function(e){this.getRawData().appendData(e.data)},getData:function(e){var t=Bg(this);if(t){var i=t.context.data;return null==e?i:i.getLinkedData(e)}return Eg(this).data},setData:function(e){var t=Bg(this);if(t){var i=t.context;i.data!==e&&t.modifyOutputEnd&&t.setOutputEnd(e.count()),i.outputData=e,t!==this.dataTask&&(i.data=e)}Eg(this).data=e},getSource:function(){return Cg(this)},getRawData:function(){return Eg(this).dataBeforeProcessed},getBaseAxis:function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},formatTooltip:function(e,t,i,n){var r=this,a="html"===(n=n||"html")?"<br/>":"\n",o="richText"===n,s={},l=0;function u(e){return{renderMode:n,content:gg(mg(e)),style:s}}var h=this.getData(),c=h.mapDimension("defaultedTooltip",!0),d=c.length,f=this.getRawValue(e),p=cg.isArray(f),g=h.getItemVisual(e,"color");cg.isObject(g)&&g.colorStops&&(g=(g.colorStops[0]||{}).color),g=g||"transparent";var m=(d>1||p&&!d?function(i){var a=cg.reduce(i,(function(e,t,i){var n=h.getDimensionInfo(i);return e|(n&&!1!==n.tooltip&&null!=n.displayName)}),0),u=[];function d(e,i){var c=h.getDimensionInfo(i);if(c&&!1!==c.otherDims.tooltip){var d=c.type,f="sub"+r.seriesIndex+"at"+l,p=vg({color:g,type:"subItem",renderMode:n,markerId:f}),m="string"==typeof p?p:p.content,v=(a?m+gg(c.displayName||"-")+": ":"")+gg("ordinal"===d?e+"":"time"===d?t?"":pg("yyyy/MM/dd hh:mm:ss",e):mg(e));v&&u.push(v),o&&(s[f]=g,++l)}}c.length?cg.each(c,(function(t){d(Dg(h,e,t),t)})):cg.each(i,d);var f=a?o?"\n":"<br/>":"",p=f+u.join(f||", ");return{renderMode:n,content:p,style:s}}(f):u(d?Dg(h,e,c[0]):p?f[0]:f)).content,v=r.seriesIndex+"at"+l,y=vg({color:g,type:"item",renderMode:n,markerId:v});s[v]=g,++l;var _=h.getName(e),x=this.name;yg.isNameSpecified(this)||(x=""),x=x?gg(x)+(t?": ":a):"";var b="string"==typeof y?y:y.content;return{html:t?b+x+m:x+b+(_?gg(_)+": "+m:m),markers:s}},isAnimationEnabled:function(){if(dg.node)return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),e},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(e,t,i){var n=this.ecModel,r=xg.getColorFromPalette.call(this,e,t,i);return r||(r=n.getColorFromPalette(e,t,i)),r},coordDimToDataDim:function(e){return this.getRawData().mapDimension(e,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function Pg(e){var t=e.name;yg.isNameSpecified(e)||(e.name=function(e){var t=e.getRawData(),i=t.mapDimension("seriesName",!0),n=[];return cg.each(i,(function(e){var i=t.getDimensionInfo(e);i.displayName&&n.push(i.displayName)})),n.join(" ")}(e)||t)}function Ng(e){return e.model.getRawData().count()}function Rg(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),Og}function Og(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function kg(e,t){cg.each(e.CHANGABLE_METHODS,(function(i){e.wrapMethod(i,cg.curry(zg,t))}))}function zg(e){var t=Bg(e);t&&t.setOutputEnd(this.count())}function Bg(e){var t=(e.ecModel||{}).scheduler,i=t&&t.getPipeline(e.uid);if(i){var n=i.currentTask;if(n){var r=n.agentStubMap;r&&(n=r.get(e.uid))}return n}}cg.mixin(Lg,bg),cg.mixin(Lg,xg);var Fg=Lg,Vg=Ii,Gg=vc,Hg=ro,Ug=function(){this.group=new Vg,this.uid=Gg.getUID("viewComponent")},Wg=Ug.prototype={constructor:Ug,init:function(e,t){},render:function(e,t,i,n){},dispose:function(){},filterForExposedEvent:null};Wg.updateView=Wg.updateLayout=Wg.updateVisual=function(e,t,i,n){},Hg.enableClassExtend(Ug),Hg.enableClassManagement(Ug,{registerWhenExtend:!0});var jg=Ug,Xg=qa.makeInner;var Zg=function(){var e=Xg();return function(t){var i=e(t),n=t.pipelineContext,r=i.large,a=i.progressiveRender,o=i.large=n&&n.large,s=i.progressiveRender=n&&n.progressiveRender;return!!(r^o||a^s)&&"reset"}},qg=l.each,Yg=Ii,Kg=vc,Qg=ro,Jg=qa,$g=yo,em=rg.createTask,tm=Zg,im=Jg.makeInner(),nm=tm();function rm(){this.group=new Yg,this.uid=Kg.getUID("viewChart"),this.renderTask=em({plan:lm,reset:um}),this.renderTask.context={view:this}}rm.prototype={type:"chart",init:function(e,t){},render:function(e,t,i,n){},highlight:function(e,t,i,n){sm(e.getData(),n,"emphasis")},downplay:function(e,t,i,n){sm(e.getData(),n,"normal")},remove:function(e,t){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var am=rm.prototype;function om(e,t,i){if(e&&(e.trigger(t,i),e.isGroup&&!$g.isHighDownDispatcher(e)))for(var n=0,r=e.childCount();n<r;n++)om(e.childAt(n),t,i)}function sm(e,t,i){var n=Jg.queryDataIndex(e,t),r=t&&null!=t.highlightKey?$g.getHighlightDigit(t.highlightKey):null;null!=n?qg(Jg.normalizeToArray(n),(function(t){om(e.getItemGraphicEl(t),i,r)})):e.eachItemGraphicEl((function(e){om(e,i,r)}))}function lm(e){return nm(e.model)}function um(e){var t=e.model,i=e.ecModel,n=e.api,r=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=r&&im(r).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,i,n,r),hm[l]}am.updateView=am.updateLayout=am.updateVisual=function(e,t,i,n){this.render(e,t,i,n)},Qg.enableClassExtend(rm,["dispose"]),Qg.enableClassManagement(rm,{registerWhenExtend:!0}),rm.markUpdateMethod=function(e,t){im(e).updateMethod=t};var hm={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},cm=rm,dm={},fm="\0__throttleOriginMethod",pm="\0__throttleRate";function gm(e,t,i){var n,r,a,o,s,l=0,u=0,h=null;function c(){u=(new Date).getTime(),h=null,e.apply(a,o||[])}t=t||0;var d=function(){n=(new Date).getTime(),a=this,o=arguments;var e=s||t,d=s||i;s=null,r=n-(d?l:u)-e,clearTimeout(h),d?h=setTimeout(c,e):r>=0?c():h=setTimeout(c,-r),l=n};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(e){s=e},d}dm.throttle=gm,dm.createOrUpdate=function(e,t,i,n){var r=e[t];if(r){var a=r[fm]||r,o=r["\0__throttleType"];if(r[pm]!==i||o!==n){if(null==i||!n)return e[t]=a;(r=e[t]=gm(a,i,"debounce"===n))[fm]=a,r["\0__throttleType"]=n,r[pm]=i}return r}},dm.clear=function(e,t){var i=e[t];i&&i[fm]&&(e[t]=i[fm])};var mm=Au,vm=l.isFunction,ym={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var i=e.getData(),n=(e.visualColorAccessPath||"itemStyle.color").split("."),r=e.get(n),a=!vm(r)||r instanceof mm?null:r;r&&!a||(r=e.getColorFromPalette(e.name,null,t.getSeriesCount())),i.setVisual("color",r);var o=(e.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),s=e.get(o);if(i.setVisual("borderColor",s),!t.isSeriesFiltered(e)){a&&i.each((function(t){i.setItemVisual(t,"color",a(e.getDataParams(t)))}));return{dataEach:i.hasItemOption?function(e,t){var i=e.getItemModel(t),r=i.get(n,!0),a=i.get(o,!0);null!=r&&e.setItemVisual(t,"color",r),null!=a&&e.setItemVisual(t,"borderColor",a)}:null}}}},_m={legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},xm=l,bm=_m,wm=Mp.retrieveRawValue;var Tm=function(e,t){var i=t.getModel("aria");if(i.get("show"))if(i.get("description"))e.setAttribute("aria-label",i.get("description"));else{var n=0;t.eachSeries((function(e,t){++n}),this);var r,a=i.get("data.maxCount")||10,o=i.get("series.maxCount")||10,s=Math.min(n,o);if(!(n<1)){var l=function(){var e=t.getModel("title").option;e&&e.length&&(e=e[0]);return e&&e.text}();r=l?h(c("general.withTitle"),{title:l}):c("general.withoutTitle");var u=[];r+=h(c(n>1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:n}),t.eachSeries((function(e,t){if(t<s){var i,r=e.get("name"),o="series."+(n>1?"multiple":"single")+".";i=h(i=c(r?o+"withName":o+"withoutName"),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(m=e.subType,bm.series.typeNames[m]||"自定义图")});var l=e.getData();window.data=l,l.count()>a?i+=h(c("data.partialData"),{displayCnt:a}):i+=c("data.allData");for(var d=[],f=0;f<l.count();f++)if(f<a){var p=l.getName(f),g=wm(l,f);d.push(h(c(p?"data.withName":"data.withoutName"),{name:p,value:g}))}i+=d.join(c("data.separator.middle"))+c("data.separator.end"),u.push(i)}var m})),r+=u.join(c("series.multiple.separator.middle"))+c("series.multiple.separator.end"),e.setAttribute("aria-label",r)}}function h(e,t){if("string"!=typeof e)return e;var i=e;return xm.each(t,(function(e,t){i=i.replace(new RegExp("\\{\\s*"+t+"\\s*\\}","g"),e)})),i}function c(e){var t=i.get(e);if(null==t){for(var n=e.split("."),r=bm.aria,a=0;a<n.length;++a)r=r[n[a]];return r}return t}},Sm=l,Mm=yo,Am=fn,Im=Math.PI;var Cm=function(e,t){t=t||{},Sm.defaults(t,{text:"loading",textColor:"#000",fontSize:"12px",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#c23531",spinnerRadius:10,lineWidth:5,zlevel:0});var i=new Mm.Group,n=new Mm.Rect({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});i.add(n);var r=t.fontSize+" sans-serif",a=new Mm.Rect({style:{fill:"none",text:t.text,font:r,textPosition:"right",textDistance:10,textFill:t.textColor},zlevel:t.zlevel,z:10001});if(i.add(a),t.showSpinner){var o=new Mm.Arc({shape:{startAngle:-Im/2,endAngle:-Im/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001});o.animateShape(!0).when(1e3,{endAngle:3*Im/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*Im/2}).delay(300).start("circularInOut"),i.add(o)}return i.resize=function(){var i=Am.getWidth(t.text,r),s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&i?10:0)-i)/2-(t.showSpinner?0:i/2),u=e.getHeight()/2;t.showSpinner&&o.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},i.resize(),i},Dm=l,Em=Dm.each,Lm=Dm.map,Pm=Dm.isFunction,Nm=Dm.createHashMap,Rm=Dm.noop,Om=rg.createTask,km=vc.getUID,zm=Lf,Bm=Rf,Fm=qa.normalizeToArray;function Vm(e,t,i,n){this.ecInstance=e,this.api=t,this.unfinished;i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice();this._allHandlers=i.concat(n),this._stageTaskMap=Nm()}var Gm=Vm.prototype;function Hm(e,t,i,n,r){var a;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}r=r||{},Em(t,(function(t,s){if(!r.visualType||r.visualType===t.visualType){var l=e._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each((function(e){o(r,e)&&(e.dirty(),c=!0)})),c&&h.dirty(),Um(h,n);var f=e.getPerformArgs(h,r.block);d.each((function(e){e.perform(f)})),a|=h.perform(f)}else u&&u.each((function(s,l){o(r,s)&&s.dirty();var u=e.getPerformArgs(s,r.block);u.skip=!t.performRawSeries&&i.isSeriesFiltered(s.context.model),Um(s,n),a|=s.perform(u)}))}})),e.unfinished|=a}Gm.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},Gm.getPerformArgs=function(e,t){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,r=!t&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:r,modBy:null!=a?Math.ceil(a/r):null,modDataCount:a}}},Gm.getPipeline=function(e){return this._pipelineMap.get(e)},Gm.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),n=e.getData().count(),r=i.progressiveEnabled&&t.incrementalPrepareRender&&n>=i.threshold,a=e.get("large")&&n>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?n:null;e.pipelineContext=i.context={progressiveRender:r,modDataCount:o,large:a}},Gm.restorePipelines=function(e){var t=this,i=t._pipelineMap=Nm();e.eachSeries((function(e){var n=e.getProgressive(),r=e.uid;i.set(r,{id:r,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:n&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),$m(t,e,e.dataTask)}))},Gm.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.ecInstance.getModel(),i=this.api;Em(this._allHandlers,(function(n){var r=e.get(n.uid)||e.set(n.uid,[]);n.reset&&function(e,t,i,n,r){var a=i.seriesTaskMap||(i.seriesTaskMap=Nm()),o=t.seriesType,s=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(l):o?n.eachRawSeriesByType(o,l):s&&s(n,r).each(l);function l(i){var o=i.uid,s=a.get(o)||a.set(o,Om({plan:qm,reset:Ym,count:Jm}));s.context={model:i,ecModel:n,api:r,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:e},$m(e,i,s)}var u=e._pipelineMap;a.each((function(e,t){u.get(t)||(e.dispose(),a.removeKey(t))}))}(this,n,r,t,i),n.overallReset&&function(e,t,i,n,r){var a=i.overallTask=i.overallTask||Om({reset:Wm});a.context={ecModel:n,api:r,overallReset:t.overallReset,scheduler:e};var o=a.agentStubMap=a.agentStubMap||Nm(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;s?n.eachRawSeriesByType(s,c):l?l(n,r).each(c):(u=!1,Em(n.getSeries(),c));function c(t){var i=t.uid,n=o.get(i);n||(n=o.set(i,Om({reset:jm,onDirty:Zm})),a.dirty()),n.context={model:t,overallProgress:u,modifyOutputEnd:h},n.agent=a,n.__block=u,$m(e,t,n)}var d=e._pipelineMap;o.each((function(e,t){d.get(t)||(e.dispose(),a.dirty(),o.removeKey(t))}))}(this,n,r,t,i)}),this)},Gm.prepareView=function(e,t,i,n){var r=e.renderTask,a=r.context;a.model=t,a.ecModel=i,a.api=n,r.__block=!e.incrementalPrepareRender,$m(this,t,r)},Gm.performDataProcessorTasks=function(e,t){Hm(this,this._dataProcessorHandlers,e,t,{block:!0})},Gm.performVisualTasks=function(e,t,i){Hm(this,this._visualHandlers,e,t,i)},Gm.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t|=e.dataTask.perform()})),this.unfinished|=t},Gm.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))};var Um=Gm.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)};function Wm(e){e.overallReset(e.ecModel,e.api,e.payload)}function jm(e,t){return e.overallProgress&&Xm}function Xm(){this.agent.dirty(),this.getDownstream().dirty()}function Zm(){this.agent&&this.agent.dirty()}function qm(e){return e.plan&&e.plan(e.model,e.ecModel,e.api,e.payload)}function Ym(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Fm(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?Lm(t,(function(e,t){return Qm(t)})):Km}var Km=Qm(0);function Qm(e){return function(t,i){var n=i.data,r=i.resetDefines[e];if(r&&r.dataEach)for(var a=t.start;a<t.end;a++)r.dataEach(n,a);else r&&r.progress&&r.progress(t,n)}}function Jm(e){return e.data.count()}function $m(e,t,i){var n=t.uid,r=e._pipelineMap.get(n);!r.head&&(r.head=i),r.tail&&r.tail.pipe(i),r.tail=i,i.__idxInPipeline=r.count++,i.__pipeline=r}function ev(e){tv=null;try{e(iv,nv)}catch(t){}return tv}Vm.wrapStageHandler=function(e,t){return Pm(e)&&(e={overallReset:e,seriesType:ev(e)}),e.uid=km("stageHandler"),t&&(e.visualType=t),e};var tv,iv={},nv={};function rv(e,t){for(var i in t.prototype)e[i]=Rm}rv(iv,zm),rv(nv,Bm),iv.eachSeriesByType=iv.eachRawSeriesByType=function(e){tv=e},iv.eachComponent=function(e){"series"===e.mainType&&e.subType&&(tv=e.subType)};var av=Vm,ov=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],sv={color:ov,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],ov]},lv=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],uv={color:lv,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:"#eee"},crossStyle:{color:"#eee"},label:{color:"#000"}}},legend:{textStyle:{color:"#eee"}},textStyle:{color:"#eee"},title:{textStyle:{color:"#eee"}},toolbox:{iconStyle:{normal:{borderColor:"#eee"}}},dataZoom:{textStyle:{color:"#eee"}},visualMap:{textStyle:{color:"#eee"}},timeline:{lineStyle:{color:"#eee"},itemStyle:{normal:{color:lv[1]}},label:{normal:{textStyle:{color:"#eee"}}},controlStyle:{normal:{color:"#eee",borderColor:"#eee"}}},timeAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},logAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},valueAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},categoryAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},line:{symbol:"circle"},graph:{color:lv},gauge:{title:{textStyle:{color:"#eee"}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};uv.categoryAxis.splitLine.show=!1;var hv=uv,cv=ud,dv=jg,fv=yd.detectSourceFormat,pv=_d.SERIES_LAYOUT_BY_COLUMN;cv.extend({type:"dataset",defaultOption:{seriesLayoutBy:pv,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){fv(this)}}),dv.extend({type:"dataset"});var gv={},mv=Ys.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(e,t){var i=.5522848,n=t.cx,r=t.cy,a=t.rx,o=t.ry,s=a*i,l=o*i;e.moveTo(n-a,r),e.bezierCurveTo(n-a,r-l,n-s,r-o,n,r-o),e.bezierCurveTo(n+s,r-o,n+a,r-l,n+a,r),e.bezierCurveTo(n+a,r+l,n+s,r+o,n,r+o),e.bezierCurveTo(n-s,r+o,n-a,r+l,n-a,r),e.closePath()}}),vv=Ii,yv=Fr,_v=Tl,xv=Sl,bv=ru,wv=mv,Tv=lu,Sv=Ys,Mv=ql,Av=Kl,Iv=Eu,Cv=$i,Dv=Re,Ev=_o.createFromString,Lv=l,Pv=Lv.isString,Nv=Lv.extend,Rv=Lv.defaults,Ov=Lv.trim,kv=Lv.each,zv=/[\s,]+/;function Bv(e){Pv(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));for(9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}function Fv(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}Fv.prototype.parse=function(e,t){t=t||{};var i=Bv(e);if(!i)throw new Error("Illegal svg");var n=new vv;this._root=n;var r=i.getAttribute("viewBox")||"",a=parseFloat(i.getAttribute("width")||t.width),o=parseFloat(i.getAttribute("height")||t.height);isNaN(a)&&(a=null),isNaN(o)&&(o=null),jv(i,n,null,!0);for(var s,l,u=i.firstChild;u;)this._parseNode(u,n),u=u.nextSibling;if(r){var h=Ov(r).split(zv);h.length>=4&&(s={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(s&&null!=a&&null!=o&&(l=Kv(s,a,o),!t.ignoreViewBox)){var c=n;(n=new vv).add(c),c.scale=l.scale.slice(),c.position=l.position.slice()}return t.ignoreRootClip||null==a||null==o||n.setClipPath(new bv({shape:{x:0,y:0,width:a,height:o}})),{root:n,width:a,height:o,viewBoxRect:s,viewBoxTransform:l}},Fv.prototype._parseNode=function(e,t){var i,n,r=e.nodeName.toLowerCase();if("defs"===r?this._isDefine=!0:"text"===r&&(this._isText=!0),this._isDefine){if(n=Gv[r]){var a=n.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=a)}}else(n=Vv[r])&&(i=n.call(this,e,t),t.add(i));for(var s=e.firstChild;s;)1===s.nodeType&&this._parseNode(s,i),3===s.nodeType&&this._isText&&this._parseText(s,i),s=s.nextSibling;"defs"===r?this._isDefine=!1:"text"===r&&(this._isText=!1)},Fv.prototype._parseText=function(e,t){if(1===e.nodeType){var i=e.getAttribute("dx")||0,n=e.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var r=new _v({style:{text:e.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Hv(t,r),jv(e,r,this._defs);var a=r.style.fontSize;a&&a<9&&(r.style.fontSize=9,r.scale=r.scale||[1,1],r.scale[0]*=a/9,r.scale[1]*=a/9);var o=r.getBoundingRect();return this._textX+=o.width,t.add(r),r};var Vv={g:function(e,t){var i=new vv;return Hv(t,i),jv(e,i,this._defs),i},rect:function(e,t){var i=new bv;return Hv(t,i),jv(e,i,this._defs),i.setShape({x:parseFloat(e.getAttribute("x")||0),y:parseFloat(e.getAttribute("y")||0),width:parseFloat(e.getAttribute("width")||0),height:parseFloat(e.getAttribute("height")||0)}),i},circle:function(e,t){var i=new xv;return Hv(t,i),jv(e,i,this._defs),i.setShape({cx:parseFloat(e.getAttribute("cx")||0),cy:parseFloat(e.getAttribute("cy")||0),r:parseFloat(e.getAttribute("r")||0)}),i},line:function(e,t){var i=new Tv;return Hv(t,i),jv(e,i,this._defs),i.setShape({x1:parseFloat(e.getAttribute("x1")||0),y1:parseFloat(e.getAttribute("y1")||0),x2:parseFloat(e.getAttribute("x2")||0),y2:parseFloat(e.getAttribute("y2")||0)}),i},ellipse:function(e,t){var i=new wv;return Hv(t,i),jv(e,i,this._defs),i.setShape({cx:parseFloat(e.getAttribute("cx")||0),cy:parseFloat(e.getAttribute("cy")||0),rx:parseFloat(e.getAttribute("rx")||0),ry:parseFloat(e.getAttribute("ry")||0)}),i},polygon:function(e,t){var i=e.getAttribute("points");i&&(i=Uv(i));var n=new Mv({shape:{points:i||[]}});return Hv(t,n),jv(e,n,this._defs),n},polyline:function(e,t){var i=new Sv;Hv(t,i),jv(e,i,this._defs);var n=e.getAttribute("points");return n&&(n=Uv(n)),new Av({shape:{points:n||[]}})},image:function(e,t){var i=new yv;return Hv(t,i),jv(e,i,this._defs),i.setStyle({image:e.getAttribute("xlink:href"),x:e.getAttribute("x"),y:e.getAttribute("y"),width:e.getAttribute("width"),height:e.getAttribute("height")}),i},text:function(e,t){var i=e.getAttribute("x")||0,n=e.getAttribute("y")||0,r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(r),this._textY=parseFloat(n)+parseFloat(a);var o=new vv;return Hv(t,o),jv(e,o,this._defs),o},tspan:function(e,t){var i=e.getAttribute("x"),n=e.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var r=e.getAttribute("dx")||0,a=e.getAttribute("dy")||0,o=new vv;return Hv(t,o),jv(e,o,this._defs),this._textX+=r,this._textY+=a,o},path:function(e,t){var i=e.getAttribute("d")||"",n=Ev(i);return Hv(t,n),jv(e,n,this._defs),n}},Gv={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||0,10),i=parseInt(e.getAttribute("y1")||0,10),n=parseInt(e.getAttribute("x2")||10,10),r=parseInt(e.getAttribute("y2")||0,10),a=new Iv(t,i,n,r);return function(e,t){var i=e.firstChild;for(;i;){if(1===i.nodeType){var n=i.getAttribute("offset");n=n.indexOf("%")>0?parseInt(n,10)/100:n?parseFloat(n):0;var r=i.getAttribute("stop-color")||"#000000";t.addColorStop(n,r)}i=i.nextSibling}}(e,a),a},radialgradient:function(e){}};function Hv(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Rv(t.__inheritedStyle,e.__inheritedStyle))}function Uv(e){for(var t=Ov(e).split(zv),i=[],n=0;n<t.length;n+=2){var r=parseFloat(t[n]),a=parseFloat(t[n+1]);i.push([r,a])}return i}var Wv={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-align":"textAlign","alignment-baseline":"textBaseline"};function jv(e,t,i,n){var r=t.__inheritedStyle||{},a="text"===t.type;if(1===e.nodeType&&(function(e,t){var i=e.getAttribute("transform");if(i){i=i.replace(/,/g," ");var n=null,r=[];i.replace(qv,(function(e,t,i){r.push(t,i)}));for(var a=r.length-1;a>0;a-=2){var o=r[a],s=r[a-1];switch(n=n||Dv.create(),s){case"translate":o=Ov(o).split(zv),Dv.translate(n,n,[parseFloat(o[0]),parseFloat(o[1]||0)]);break;case"scale":o=Ov(o).split(zv),Dv.scale(n,n,[parseFloat(o[0]),parseFloat(o[1]||o[0])]);break;case"rotate":o=Ov(o).split(zv),Dv.rotate(n,n,parseFloat(o[0]));break;case"skew":o=Ov(o).split(zv),console.warn("Skew transform is not supported yet");break;case"matrix":o=Ov(o).split(zv);n[0]=parseFloat(o[0]),n[1]=parseFloat(o[1]),n[2]=parseFloat(o[2]),n[3]=parseFloat(o[3]),n[4]=parseFloat(o[4]),n[5]=parseFloat(o[5])}}t.setLocalTransform(n)}}(e,t),Nv(r,function(e){var t=e.getAttribute("style"),i={};if(!t)return i;var n,r={};Yv.lastIndex=0;for(;null!=(n=Yv.exec(t));)r[n[1]]=n[2];for(var a in Wv)Wv.hasOwnProperty(a)&&null!=r[a]&&(i[Wv[a]]=r[a]);return i}(e)),!n))for(var o in Wv)if(Wv.hasOwnProperty(o)){var s=e.getAttribute(o);null!=s&&(r[Wv[o]]=s)}var l=a?"textFill":"fill",u=a?"textStroke":"stroke";t.style=t.style||new Cv;var h=t.style;null!=r.fill&&h.set(l,Zv(r.fill,i)),null!=r.stroke&&h.set(u,Zv(r.stroke,i)),kv(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){var t="lineWidth"===e&&a?"textStrokeWidth":e;null!=r[e]&&h.set(t,parseFloat(r[e]))})),r.textBaseline&&"auto"!==r.textBaseline||(r.textBaseline="alphabetic"),"alphabetic"===r.textBaseline&&(r.textBaseline="bottom"),"start"===r.textAlign&&(r.textAlign="left"),"end"===r.textAlign&&(r.textAlign="right"),kv(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(e){null!=r[e]&&h.set(e,r[e])})),r.lineDash&&(t.style.lineDash=Ov(r.lineDash).split(zv)),h[u]&&"none"!==h[u]&&(t[u]=!0),t.__inheritedStyle=r}var Xv=/url\(\s*#(.*?)\)/;function Zv(e,t){var i=t&&e&&e.match(Xv);return i?t[Ov(i[1])]:e}var qv=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;var Yv=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Kv(e,t,i){var n=t/e.width,r=i/e.height,a=Math.min(n,r);return{scale:[a,a],position:[-(e.x+e.width/2)*a+t/2,-(e.y+e.height/2)*a+i/2]}}gv.parseXML=Bv,gv.makeViewBoxTransform=Kv,gv.parseSVG=function(e,t){return(new Fv).parse(e,t)};var Qv=l,Jv=Qv.createHashMap,$v=Qv.isString,ey=Qv.isArray,ty=Qv.each;Qv.assert;var iy=gv.parseXML,ny=Jv(),ry={registerMap:function(e,t,i){var n;return ey(t)?n=t:t.svg?n=[{type:"svg",source:t.svg,specialAreas:t.specialAreas}]:(t.geoJson&&!t.features&&(i=t.specialAreas,t=t.geoJson),n=[{type:"geoJSON",source:t,specialAreas:i}]),ty(n,(function(e){var t=e.type;"geoJson"===t&&(t=e.type="geoJSON"),(0,ay[t])(e)})),ny.set(e,n)},retrieveMap:function(e){return ny.get(e)}},ay={geoJSON:function(e){var t=e.source;e.geoJSON=$v(t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(t):new Function("return ("+t+");")():t},svg:function(e){e.svgXML=iy(e.source)}},oy=ry,sy={},ly={};function uy(e){return e}function hy(e,t,i,n,r){this._old=e,this._new=t,this._oldKeyGetter=i||uy,this._newKeyGetter=n||uy,this.context=r}function cy(e,t,i,n,r){for(var a=0;a<e.length;a++){var o="_ec_"+r[n](e[a],a),s=t[o];null==s?(i.push(o),t[o]=a):(s.length||(t[o]=s=[s]),s.push(a))}}hy.prototype={constructor:hy,add:function(e){return this._add=e,this},update:function(e){return this._update=e,this},remove:function(e){return this._remove=e,this},execute:function(){var e=this._old,t=this._new,i={},n=[],r=[];for(cy(e,{},n,"_oldKeyGetter",this),cy(t,i,r,"_newKeyGetter",this),a=0;a<e.length;a++){if(null!=(s=i[o=n[a]]))(u=s.length)?(1===u&&(i[o]=null),s=s.shift()):i[o]=null,this._update&&this._update(s,a);else this._remove&&this._remove(a)}for(var a=0;a<r.length;a++){var o=r[a];if(i.hasOwnProperty(o)){var s;if(null==(s=i[o]))continue;if(s.length)for(var l=0,u=s.length;l<u;l++)this._add&&this._add(s[l]);else this._add&&this._add(s)}}}};var dy=hy,fy={},py=l,gy=py.each,my=py.createHashMap;py.assert;var vy=my(["tooltip","label","itemName","itemId","seriesName"]);function yy(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}fy.OTHER_DIMENSIONS=vy,fy.summarizeDimensions=function(e){var t={},i=t.encode={},n=my(),r=[],a=[],o=t.userOutput={dimensionNames:e.dimensions.slice(),encode:{}};gy(e.dimensions,(function(t){var s,l=e.getDimensionInfo(t),u=l.coordDim;if(u){var h=l.coordDimIndex;yy(i,u)[h]=t,l.isExtraCoord||(n.set(u,1),"ordinal"!==(s=l.type)&&"time"!==s&&(r[0]=t),yy(o.encode,u)[h]=l.index),l.defaultTooltip&&a.push(t)}vy.each((function(e,t){var n=yy(i,t),r=l.otherDims[t];null!=r&&!1!==r&&(n[r]=l.name)}))}));var s=[],l={};n.each((function(e,t){var n=i[t];l[t]=n[0],s=s.concat(n)})),t.dataDimsOnCoord=s,t.encodeFirstDimNotExtra=l;var u=i.label;u&&u.length&&(r=u.slice());var h=i.tooltip;return h&&h.length?a=h.slice():a.length||(a=r.slice()),i.defaultedLabel=r,i.defaultedTooltip=a,t},fy.getDimensionTypeByAxis=function(e){return"category"===e?"ordinal":"time"===e?"time":"float"};var _y=l;var xy=function(e){null!=e&&_y.extend(this,e),this.otherDims={}},by=l,wy=mc,Ty=dy,Sy=Ld,My=Mp,Ay=My.defaultDimValueGetters,Iy=My.DefaultDataProvider,Cy=fy.summarizeDimensions,Dy=xy,Ey=by.isObject,Ly={float:"undefined"==typeof Float64Array?Array:Float64Array,int:"undefined"==typeof Int32Array?Array:Int32Array,ordinal:Array,number:Array,time:Array},Py="undefined"==typeof Uint32Array?Array:Uint32Array,Ny="undefined"==typeof Int32Array?Array:Int32Array,Ry="undefined"==typeof Uint16Array?Array:Uint16Array;function Oy(e){return e._rawCount>65535?Py:Ry}var ky=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],zy=["_extent","_approximateExtent","_rawExtent"];function By(e,t){by.each(ky.concat(t.__wrappedMethods||[]),(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e.__wrappedMethods=t.__wrappedMethods,by.each(zy,(function(i){e[i]=by.clone(t[i])})),e._calculationInfo=by.extend(t._calculationInfo)}var Fy=function(e,t){e=e||["x","y"];for(var i={},n=[],r={},a=0;a<e.length;a++){var o=e[a];by.isString(o)?o=new Dy({name:o}):o instanceof Dy||(o=new Dy(o));var s=o.name;o.type=o.type||"float",o.coordDim||(o.coordDim=s,o.coordDimIndex=0),o.otherDims=o.otherDims||{},n.push(s),i[s]=o,o.index=a,o.createInvertedIndices&&(r[s]=[])}this.dimensions=n,this._dimensionInfos=i,this.hostModel=t,this.dataType,this._indices=null,this._count=0,this._rawCount=0,this._storage={},this._nameList=[],this._idList=[],this._optionModels=[],this._visual={},this._layout={},this._itemVisuals=[],this.hasItemVisual={},this._itemLayouts=[],this._graphicEls=[],this._chunkSize=1e5,this._chunkCount=0,this._rawData,this._rawExtent={},this._extent={},this._approximateExtent={},this._dimensionsSummary=Cy(this),this._invertedIndicesMap=r,this._calculationInfo={},this.userOutput=this._dimensionsSummary.userOutput},Vy=Fy.prototype;function Gy(e,t,i,n,r){var a=Ly[t.type],o=n-1,s=t.name,l=e[s][o];if(l&&l.length<i){for(var u=new a(Math.min(r-o*i,i)),h=0;h<l.length;h++)u[h]=l[h];e[s][o]=u}for(var c=n*i;c<r;c+=i)e[s].push(new a(Math.min(r-c,i)))}function Hy(e){var t=e._invertedIndicesMap;by.each(t,(function(i,n){var r=e._dimensionInfos[n].ordinalMeta;if(r){i=t[n]=new Ny(r.categories.length);for(var a=0;a<i.length;a++)i[a]=-1;for(a=0;a<e._count;a++)i[e.get(n,a)]=a}}))}function Uy(e,t,i){var n;if(null!=t){var r=e._chunkSize,a=Math.floor(i/r),o=i%r,s=e.dimensions[t],l=e._storage[s][a];if(l){n=l[o];var u=e._dimensionInfos[s].ordinalMeta;u&&u.categories.length&&(n=u.categories[n])}}return n}function Wy(e){return e}function jy(e){return e<this._count&&e>=0?this._indices[e]:-1}function Xy(e,t){var i=e._idList[t];return null==i&&(i=Uy(e,e._idDimIdx,t)),null==i&&(i="e\0\0"+t),i}function Zy(e){return by.isArray(e)||(e=[e]),e}function qy(e,t){var i=e.dimensions,n=new Fy(by.map(i,e.getDimensionInfo,e),e.hostModel);By(n,e);for(var r=n._storage={},a=e._storage,o=0;o<i.length;o++){var s=i[o];a[s]&&(by.indexOf(t,s)>=0?(r[s]=Yy(a[s]),n._rawExtent[s]=Ky(),n._extent[s]=null):r[s]=a[s])}return n}function Yy(e){for(var t,i,n=new Array(e.length),r=0;r<e.length;r++)n[r]=(t=e[r],i=void 0,(i=t.constructor)===Array?t.slice():new i(t));return n}function Ky(){return[1/0,-1/0]}Vy.type="list",Vy.hasItemOption=!0,Vy.getDimension=function(e){return"number"!=typeof e&&(isNaN(e)||this._dimensionInfos.hasOwnProperty(e))||(e=this.dimensions[e]),e},Vy.getDimensionInfo=function(e){return this._dimensionInfos[this.getDimension(e)]},Vy.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice()},Vy.mapDimension=function(e,t){var i=this._dimensionsSummary;if(null==t)return i.encodeFirstDimNotExtra[e];var n=i.encode[e];return!0===t?(n||[]).slice():n&&n[t]},Vy.initData=function(e,t,i){(Sy.isInstance(e)||by.isArrayLike(e))&&(e=new Iy(e,this.dimensions.length)),this._rawData=e,this._storage={},this._indices=null,this._nameList=t||[],this._idList=[],this._nameRepeatCount={},i||(this.hasItemOption=!1),this.defaultDimValueGetter=Ay[this._rawData.getSource().sourceFormat],this._dimValueGetter=i=i||this.defaultDimValueGetter,this._dimValueGetterArrayRows=Ay.arrayRows,this._rawExtent={},this._initDataFromProvider(0,e.count()),e.pure&&(this.hasItemOption=!1)},Vy.getProvider=function(){return this._rawData},Vy.appendData=function(e){var t=this._rawData,i=this.count();t.appendData(e);var n=t.count();t.persistent||(n+=i),this._initDataFromProvider(i,n)},Vy.appendValues=function(e,t){for(var i=this._chunkSize,n=this._storage,r=this.dimensions,a=r.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,t?t.length:0),u=this._chunkCount,h=0;h<a;h++){o[v=r[h]]||(o[v]=Ky()),n[v]||(n[v]=[]),Gy(n,this._dimensionInfos[v],i,u,l),this._chunkCount=n[v].length}for(var c=new Array(a),d=s;d<l;d++){for(var f=d-s,p=Math.floor(d/i),g=d%i,m=0;m<a;m++){var v=r[m],y=this._dimValueGetterArrayRows(e[f]||c,v,f,m);n[v][p][g]=y;var _=o[v];y<_[0]&&(_[0]=y),y>_[1]&&(_[1]=y)}t&&(this._nameList[d]=t[f])}this._rawCount=this._count=l,this._extent={},Hy(this)},Vy._initDataFromProvider=function(e,t){if(!(e>=t)){for(var i,n=this._chunkSize,r=this._rawData,a=this._storage,o=this.dimensions,s=o.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;p<s;p++){c[b=o[p]]||(c[b]=Ky());var g=l[b];0===g.otherDims.itemName&&(i=this._nameDimIdx=p),0===g.otherDims.itemId&&(this._idDimIdx=p),a[b]||(a[b]=[]),Gy(a,g,n,f,t),this._chunkCount=a[b].length}for(var m=new Array(s),v=e;v<t;v++){m=r.getItem(v,m);for(var y=Math.floor(v/n),_=v%n,x=0;x<s;x++){var b,w=a[b=o[x]][y],T=this._dimValueGetter(m,b,v,x);w[_]=T;var S=c[b];T<S[0]&&(S[0]=T),T>S[1]&&(S[1]=T)}if(!r.pure){var M=u[v];if(m&&null==M)if(null!=m.name)u[v]=M=m.name;else if(null!=i){var A=o[i],I=a[A][y];if(I){M=I[_];var C=l[A].ordinalMeta;C&&C.categories.length&&(M=C.categories[M])}}var D=null==m?null:m.id;null==D&&null!=M&&(d[M]=d[M]||0,D=M,d[M]>0&&(D+="__ec__"+d[M]),d[M]++),null!=D&&(h[v]=D)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent={},Hy(this)}},Vy.count=function(){return this._count},Vy.getIndices=function(){var e=this._indices;if(e){var t=e.constructor,i=this._count;if(t===Array){r=new t(i);for(var n=0;n<i;n++)r[n]=e[n]}else r=new t(e.buffer,0,i)}else{var r=new(t=Oy(this))(this.count());for(n=0;n<r.length;n++)r[n]=n}return r},Vy.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var i=this._storage;if(!i[e])return NaN;t=this.getRawIndex(t);var n=Math.floor(t/this._chunkSize),r=t%this._chunkSize;return i[e][n][r]},Vy.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var i=this._storage[e];if(!i)return NaN;var n=Math.floor(t/this._chunkSize),r=t%this._chunkSize;return i[n][r]},Vy._getFast=function(e,t){var i=Math.floor(t/this._chunkSize),n=t%this._chunkSize;return this._storage[e][i][n]},Vy.getValues=function(e,t){var i=[];by.isArray(e)||(t=e,e=this.dimensions);for(var n=0,r=e.length;n<r;n++)i.push(this.get(e[n],t));return i},Vy.hasValue=function(e){for(var t=this._dimensionsSummary.dataDimsOnCoord,i=0,n=t.length;i<n;i++)if(isNaN(this.get(t[i],e)))return!1;return!0},Vy.getDataExtent=function(e){e=this.getDimension(e);var t=this._storage[e],i=Ky();if(!t)return i;var n,r=this.count();if(!this._indices)return this._rawExtent[e].slice();if(n=this._extent[e])return n.slice();for(var a=(n=i)[0],o=n[1],s=0;s<r;s++){var l=this._getFast(e,this.getRawIndex(s));l<a&&(a=l),l>o&&(o=l)}return n=[a,o],this._extent[e]=n,n},Vy.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(e)},Vy.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},Vy.getCalculationInfo=function(e){return this._calculationInfo[e]},Vy.setCalculationInfo=function(e,t){Ey(e)?by.extend(this._calculationInfo,e):this._calculationInfo[e]=t},Vy.getSum=function(e){var t=0;if(this._storage[e])for(var i=0,n=this.count();i<n;i++){var r=this.get(e,i);isNaN(r)||(t+=r)}return t},Vy.getMedian=function(e){var t=[];this.each(e,(function(e,i){isNaN(e)||t.push(e)}));var i=[].concat(t).sort((function(e,t){return e-t})),n=this.count();return 0===n?0:n%2==1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},Vy.rawIndexOf=function(e,t){var i=(e&&this._invertedIndicesMap[e])[t];return null==i||isNaN(i)?-1:i},Vy.indexOfName=function(e){for(var t=0,i=this.count();t<i;t++)if(this.getName(t)===e)return t;return-1},Vy.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(null!=i&&i<this._count&&i===e)return e;for(var n=0,r=this._count-1;n<=r;){var a=(n+r)/2|0;if(t[a]<e)n=a+1;else{if(!(t[a]>e))return a;r=a-1}}return-1},Vy.indicesOfNearest=function(e,t,i){var n=[];if(!this._storage[e])return n;null==i&&(i=1/0);for(var r=1/0,a=-1,o=0,s=0,l=this.count();s<l;s++){var u=t-this.get(e,s),h=Math.abs(u);h<=i&&((h<r||h===r&&u>=0&&a<0)&&(r=h,a=u,o=0),u===a&&(n[o++]=s))}return n.length=o,n},Vy.getRawIndex=Wy,Vy.getRawDataItem=function(e){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(e));for(var t=[],i=0;i<this.dimensions.length;i++){var n=this.dimensions[i];t.push(this.get(n,e))}return t},Vy.getName=function(e){var t=this.getRawIndex(e);return this._nameList[t]||Uy(this,this._nameDimIdx,t)||""},Vy.getId=function(e){return Xy(this,this.getRawIndex(e))},Vy.each=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this;for(var r=(e=by.map(Zy(e),this.getDimension,this)).length,a=0;a<this.count();a++)switch(r){case 0:t.call(i,a);break;case 1:t.call(i,this.get(e[0],a),a);break;case 2:t.call(i,this.get(e[0],a),this.get(e[1],a),a);break;default:for(var o=0,s=[];o<r;o++)s[o]=this.get(e[o],a);s[o]=a,t.apply(i,s)}}},Vy.filterSelf=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this,e=by.map(Zy(e),this.getDimension,this);for(var r=this.count(),a=new(Oy(this))(r),o=[],s=e.length,l=0,u=e[0],h=0;h<r;h++){var c,d=this.getRawIndex(h);if(0===s)c=t.call(i,h);else if(1===s){var f=this._getFast(u,d);c=t.call(i,f,h)}else{for(var p=0;p<s;p++)o[p]=this._getFast(u,d);o[p]=h,c=t.apply(i,o)}c&&(a[l++]=d)}return l<r&&(this._indices=a),this._count=l,this._extent={},this.getRawIndex=this._indices?jy:Wy,this}},Vy.selectRange=function(e){if(this._count){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);var n=t.length;if(n){var r=this.count(),a=new(Oy(this))(r),o=0,s=t[0],l=e[s][0],u=e[s][1],h=!1;if(!this._indices){var c=0;if(1===n){for(var d=this._storage[t[0]],f=0;f<this._chunkCount;f++)for(var p=d[f],g=Math.min(this._count-f*this._chunkSize,this._chunkSize),m=0;m<g;m++){((b=p[m])>=l&&b<=u||isNaN(b))&&(a[o++]=c),c++}h=!0}else if(2===n){d=this._storage[s];var v=this._storage[t[1]],y=e[t[1]][0],_=e[t[1]][1];for(f=0;f<this._chunkCount;f++){p=d[f];var x=v[f];for(g=Math.min(this._count-f*this._chunkSize,this._chunkSize),m=0;m<g;m++){var b=p[m],w=x[m];(b>=l&&b<=u||isNaN(b))&&(w>=y&&w<=_||isNaN(w))&&(a[o++]=c),c++}}h=!0}}if(!h)if(1===n)for(m=0;m<r;m++){var T=this.getRawIndex(m);((b=this._getFast(s,T))>=l&&b<=u||isNaN(b))&&(a[o++]=T)}else for(m=0;m<r;m++){var S=!0;for(T=this.getRawIndex(m),f=0;f<n;f++){var M=t[f];((b=this._getFast(i,T))<e[M][0]||b>e[M][1])&&(S=!1)}S&&(a[o++]=this.getRawIndex(m))}return o<r&&(this._indices=a),this._count=o,this._extent={},this.getRawIndex=this._indices?jy:Wy,this}}},Vy.mapArray=function(e,t,i,n){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this;var r=[];return this.each(e,(function(){r.push(t&&t.apply(this,arguments))}),i),r},Vy.map=function(e,t,i,n){i=i||n||this;var r=qy(this,e=by.map(Zy(e),this.getDimension,this));r._indices=this._indices,r.getRawIndex=r._indices?jy:Wy;for(var a=r._storage,o=[],s=this._chunkSize,l=e.length,u=this.count(),h=[],c=r._rawExtent,d=0;d<u;d++){for(var f=0;f<l;f++)h[f]=this.get(e[f],d);h[l]=d;var p=t&&t.apply(i,h);if(null!=p){"object"!=typeof p&&(o[0]=p,p=o);for(var g=this.getRawIndex(d),m=Math.floor(g/s),v=g%s,y=0;y<p.length;y++){var _=e[y],x=p[y],b=c[_],w=a[_];w&&(w[m][v]=x),x<b[0]&&(b[0]=x),x>b[1]&&(b[1]=x)}}}return r},Vy.downSample=function(e,t,i,n){for(var r=qy(this,[e]),a=r._storage,o=[],s=Math.floor(1/t),l=a[e],u=this.count(),h=this._chunkSize,c=r._rawExtent[e],d=new(Oy(this))(u),f=0,p=0;p<u;p+=s){s>u-p&&(s=u-p,o.length=s);for(var g=0;g<s;g++){var m=this.getRawIndex(p+g),v=Math.floor(m/h),y=m%h;o[g]=l[v][y]}var _=i(o),x=this.getRawIndex(Math.min(p+n(o,_)||0,u-1)),b=x%h;l[Math.floor(x/h)][b]=_,_<c[0]&&(c[0]=_),_>c[1]&&(c[1]=_),d[f++]=x}return r._count=f,r._indices=d,r.getRawIndex=jy,r},Vy.getItemModel=function(e){var t=this.hostModel;return new wy(this.getRawDataItem(e),t,t&&t.ecModel)},Vy.diff=function(e){var t=this;return new Ty(e?e.getIndices():[],this.getIndices(),(function(t){return Xy(e,t)}),(function(e){return Xy(t,e)}))},Vy.getVisual=function(e){var t=this._visual;return t&&t[e]},Vy.setVisual=function(e,t){if(Ey(e))for(var i in e)e.hasOwnProperty(i)&&this.setVisual(i,e[i]);else this._visual=this._visual||{},this._visual[e]=t},Vy.setLayout=function(e,t){if(Ey(e))for(var i in e)e.hasOwnProperty(i)&&this.setLayout(i,e[i]);else this._layout[e]=t},Vy.getLayout=function(e){return this._layout[e]},Vy.getItemLayout=function(e){return this._itemLayouts[e]},Vy.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?by.extend(this._itemLayouts[e]||{},t):t},Vy.clearItemLayouts=function(){this._itemLayouts.length=0},Vy.getItemVisual=function(e,t,i){var n=this._itemVisuals[e],r=n&&n[t];return null!=r||i?r:this.getVisual(t)},Vy.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{},r=this.hasItemVisual;if(this._itemVisuals[e]=n,Ey(t))for(var a in t)t.hasOwnProperty(a)&&(n[a]=t[a],r[a]=!0);else n[t]=i,r[t]=!0},Vy.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var Qy=function(e){e.seriesIndex=this.seriesIndex,e.dataIndex=this.dataIndex,e.dataType=this.dataType};Vy.setItemGraphicEl=function(e,t){var i=this.hostModel;t&&(t.dataIndex=e,t.dataType=this.dataType,t.seriesIndex=i&&i.seriesIndex,"group"===t.type&&t.traverse(Qy,t)),this._graphicEls[e]=t},Vy.getItemGraphicEl=function(e){return this._graphicEls[e]},Vy.eachItemGraphicEl=function(e,t){by.each(this._graphicEls,(function(i,n){i&&e&&e.call(t,i,n)}))},Vy.cloneShallow=function(e){if(!e){var t=by.map(this.dimensions,this.getDimensionInfo,this);e=new Fy(t,this.hostModel)}if(e._storage=this._storage,By(e,this),this._indices){var i=this._indices.constructor;e._indices=new i(this._indices)}else e._indices=null;return e.getRawIndex=e._indices?jy:Wy,e},Vy.wrapMethod=function(e,t){var i=this[e];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=i.apply(this,arguments);return t.apply(this,[e].concat(by.slice(arguments)))})},Vy.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],Vy.CHANGABLE_METHODS=["filterSelf","selectRange"];var Jy=Fy,$y=l,e_=$y.createHashMap,t_=$y.each,i_=$y.isString,n_=$y.defaults,r_=$y.extend,a_=$y.isObject,o_=$y.clone,s_=qa.normalizeToArray,l_=yd,u_=l_.guessOrdinal,h_=l_.BE_ORDINAL,c_=Ld,d_=fy.OTHER_DIMENSIONS,f_=xy;function p_(e,t,i){if(i||null!=t.get(e)){for(var n=0;null!=t.get(e+n);)n++;e+=n}return t.set(e,!0),e}var g_=function(e,t,i){c_.isInstance(t)||(t=c_.seriesDataToSource(t)),i=i||{},e=(e||[]).slice();for(var n=(i.dimsDef||[]).slice(),r=e_(),a=e_(),o=[],s=function(e,t,i,n){var r=Math.max(e.dimensionsDetectCount||1,t.length,i.length,n||0);return t_(t,(function(e){var t=e.dimsDef;t&&(r=Math.max(r,t.length))})),r}(t,e,n,i.dimCount),l=0;l<s;l++){var u=n[l]=r_({},a_(n[l])?n[l]:{name:n[l]}),h=u.name,c=o[l]=new f_;null!=h&&null==r.get(h)&&(c.name=c.displayName=h,r.set(h,l)),null!=u.type&&(c.type=u.type),null!=u.displayName&&(c.displayName=u.displayName)}var d=i.encodeDef;!d&&i.encodeDefaulter&&(d=i.encodeDefaulter(t,s)),(d=e_(d)).each((function(e,t){if(1===(e=s_(e).slice()).length&&!i_(e[0])&&e[0]<0)d.set(t,!1);else{var i=d.set(t,[]);t_(e,(function(e,n){i_(e)&&(e=r.get(e)),null!=e&&e<s&&(i[n]=e,p(o[e],t,n))}))}}));var f=0;function p(e,t,i){null!=d_.get(t)?e.otherDims[t]=i:(e.coordDim=t,e.coordDimIndex=i,a.set(t,!0))}t_(e,(function(e,t){var i,n,r;if(i_(e))i=e,e={};else{i=e.name;var a=e.ordinalMeta;e.ordinalMeta=null,(e=o_(e)).ordinalMeta=a,n=e.dimsDef,r=e.otherDims,e.name=e.coordDim=e.coordDimIndex=e.dimsDef=e.otherDims=null}if(!1!==(s=d.get(i))){var s;if(!(s=s_(s)).length)for(var l=0;l<(n&&n.length||1);l++){for(;f<o.length&&null!=o[f].coordDim;)f++;f<o.length&&s.push(f++)}t_(s,(function(t,a){var s=o[t];if(p(n_(s,e),i,a),null==s.name&&n){var l=n[a];!a_(l)&&(l={name:l}),s.name=s.displayName=l.name,s.defaultTooltip=l.defaultTooltip}r&&n_(s.otherDims,r)}))}}));var g=i.generateCoord,m=i.generateCoordCount,v=null!=m;m=g?m||1:0;for(var y=g||"value",_=0;_<s;_++){null==(c=o[_]=o[_]||new f_).coordDim&&(c.coordDim=p_(y,a,v),c.coordDimIndex=0,(!g||m<=0)&&(c.isExtraCoord=!0),m--),null==c.name&&(c.name=p_(c.coordDim,r)),null!=c.type||u_(t,_,c.name)!==h_.Must&&(!c.isExtraCoord||null==c.otherDims.itemName&&null==c.otherDims.seriesName)||(c.type="ordinal")}return o},m_=g_,v_=m_;var y_=function(e,t){return v_((t=t||{}).coordDimensions||[],e,{dimsDef:t.dimensionsDefine||e.dimensionsDefine,encodeDef:t.encodeDefine||e.encodeDefine,dimCount:t.dimensionsCount,encodeDefaulter:t.encodeDefaulter,generateCoord:t.generateCoord,generateCoordCount:t.generateCoordCount})},__={},x_=l,b_=x_.createHashMap;x_.retrieve;var w_=x_.each;function T_(e){this.coordSysName=e,this.coordSysDims=[],this.axisMap=b_(),this.categoryAxisMap=b_(),this.firstCategoryDimIndex=null}var S_={cartesian2d:function(e,t,i,n){var r=e.getReferringComponents("xAxis")[0],a=e.getReferringComponents("yAxis")[0];t.coordSysDims=["x","y"],i.set("x",r),i.set("y",a),M_(r)&&(n.set("x",r),t.firstCategoryDimIndex=0),M_(a)&&(n.set("y",a),t.firstCategoryDimIndex,t.firstCategoryDimIndex=1)},singleAxis:function(e,t,i,n){var r=e.getReferringComponents("singleAxis")[0];t.coordSysDims=["single"],i.set("single",r),M_(r)&&(n.set("single",r),t.firstCategoryDimIndex=0)},polar:function(e,t,i,n){var r=e.getReferringComponents("polar")[0],a=r.findAxisModel("radiusAxis"),o=r.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],i.set("radius",a),i.set("angle",o),M_(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),M_(o)&&(n.set("angle",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,i,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,i,n){var r=e.ecModel,a=r.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();w_(a.parallelAxisIndex,(function(e,a){var s=r.getComponent("parallelAxis",e),l=o[a];i.set(l,s),M_(s)&&null==t.firstCategoryDimIndex&&(n.set(l,s),t.firstCategoryDimIndex=a)}))}};function M_(e){return"category"===e.get("type")}__.getCoordSysInfoBySeries=function(e){var t=e.get("coordinateSystem"),i=new T_(t),n=S_[t];if(n)return n(e,i,i.axisMap,i.categoryAxisMap),i};var A_={},I_=l,C_=I_.each,D_=I_.isString;function E_(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}A_.enableDataStack=function(e,t,i){var n,r,a,o,s=(i=i||{}).byIndex,l=i.stackedCoordDimension,u=!(!e||!e.get("stack"));if(C_(t,(function(e,i){D_(e)&&(t[i]=e={name:e}),u&&!e.isExtraCoord&&(s||n||!e.ordinalMeta||(n=e),r||"ordinal"===e.type||"time"===e.type||l&&l!==e.coordDim||(r=e))})),!r||s||n||(s=!0),r){a="__\0ecstackresult",o="__\0ecstackedover",n&&(n.createInvertedIndices=!0);var h=r.coordDim,c=r.type,d=0;C_(t,(function(e){e.coordDim===h&&d++})),t.push({name:a,coordDim:h,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0}),d++,t.push({name:o,coordDim:o,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:r&&r.name,stackedByDimension:n&&n.name,isStackedByIndex:s,stackedOverDimension:o,stackResultDimension:a}},A_.isDimensionStacked=E_,A_.getStackedDimension=function(e,t){return E_(e,t)?e.getCalculationInfo("stackResultDimension"):t};var L_=l,P_=Jy,N_=y_,R_=_d.SOURCE_FORMAT_ORIGINAL,O_=fy.getDimensionTypeByAxis,k_=qa.getDataItemValue,z_=Bf,B_=__.getCoordSysInfoBySeries,F_=Ld,V_=A_.enableDataStack,G_=yd.makeSeriesEncodeForAxisCoordSys;var H_=function(e,t,i){i=i||{},F_.isInstance(e)||(e=F_.seriesDataToSource(e));var n,r=t.get("coordinateSystem"),a=z_.get(r),o=B_(t);o&&(n=L_.map(o.coordSysDims,(function(e){var t={name:e},i=o.axisMap.get(e);if(i){var n=i.get("type");t.type=O_(n)}return t}))),n||(n=a&&(a.getDimensionsInfo?a.getDimensionsInfo():a.dimensions.slice())||["x","y"]);var s,l,u=N_(e,{coordDimensions:n,generateCoord:i.generateCoord,encodeDefaulter:i.useEncodeDefaulter?L_.curry(G_,n,t):null});o&&L_.each(u,(function(e,t){var i=e.coordDim,n=o.categoryAxisMap.get(i);n&&(null==s&&(s=t),e.ordinalMeta=n.getOrdinalMeta()),null!=e.otherDims.itemName&&(l=!0)})),l||null==s||(u[s].otherDims.itemName=0);var h=V_(t,u),c=new P_(u,t);c.setCalculationInfo(h);var d=null!=s&&function(e){if(e.sourceFormat===R_){var t=function(e){var t=0;for(;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[]);return null!=t&&!L_.isArray(k_(t))}}(e)?function(e,t,i,n){return n===s?i:this.defaultDimValueGetter(e,t,i,n)}:null;return c.hasItemOption=!1,c.initData(e,null,d),c},U_=H_,W_={},j_=ro;function X_(e){this._setting=e||{},this._extent=[1/0,-1/0],this._interval=0,this.init&&this.init.apply(this,arguments)}X_.prototype.parse=function(e){return e},X_.prototype.getSetting=function(e){return this._setting[e]},X_.prototype.contain=function(e){var t=this._extent;return e>=t[0]&&e<=t[1]},X_.prototype.normalize=function(e){var t=this._extent;return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},X_.prototype.scale=function(e){var t=this._extent;return e*(t[1]-t[0])+t[0]},X_.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},X_.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},X_.prototype.getExtent=function(){return this._extent.slice()},X_.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},X_.prototype.isBlank=function(){return this._isBlank},X_.prototype.setBlank=function(e){this._isBlank=e},X_.prototype.getLabel=null,j_.enableClassExtend(X_),j_.enableClassManagement(X_,{registerWhenExtend:!0});var Z_=X_,q_=l,Y_=q_.createHashMap,K_=q_.isObject,Q_=q_.map;function J_(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}J_.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&Q_(i,tx);return new J_({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var $_=J_.prototype;function ex(e){return e._map||(e._map=Y_(e.categories))}function tx(e){return K_(e)&&null!=e.value?e.value:e+""}$_.getOrdinal=function(e){return ex(this).get(e)},$_.parseAndCollect=function(e){var t,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=ex(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var ix=J_,nx=l,rx=Z_,ax=ix,ox=rx.prototype,sx=rx.extend({type:"ordinal",init:function(e,t){e&&!nx.isArray(e)||(e=new ax({categories:e})),this._ordinalMeta=e,this._extent=t||[0,e.categories.length-1]},parse:function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},contain:function(e){return e=this.parse(e),ox.contain.call(this,e)&&null!=this._ordinalMeta.categories[e]},normalize:function(e){return ox.normalize.call(this,this.parse(e))},scale:function(e){return Math.round(ox.scale.call(this,e))},getTicks:function(){for(var e=[],t=this._extent,i=t[0];i<=t[1];)e.push(i),i++;return e},getLabel:function(e){if(!this.isBlank())return this._ordinalMeta.categories[e]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:nx.noop,niceExtent:nx.noop});sx.create=function(){return new sx};var lx=sx,ux={},hx=wc,cx=hx.round;function dx(e){return hx.getPrecisionSafe(e)+2}function fx(e,t,i){e[t]=Math.max(Math.min(e[t],i[1]),i[0])}function px(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),fx(e,0,t),fx(e,1,t),e[0]>e[1]&&(e[0]=e[1])}ux.intervalScaleNiceTicks=function(e,t,i,n){var r={},a=e[1]-e[0],o=r.interval=hx.nice(a/t,!0);null!=i&&o<i&&(o=r.interval=i),null!=n&&o>n&&(o=r.interval=n);var s=r.intervalPrecision=dx(o);return px(r.niceTickExtent=[cx(Math.ceil(e[0]/o)*o,s),cx(Math.floor(e[1]/o)*o,s)],e),r},ux.getIntervalPrecision=dx,ux.fixExtent=px;var gx=wc,mx=Ac,vx=Z_,yx=ux,_x=gx.round,xx=vx.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(e,t){var i=this._extent;isNaN(e)||(i[0]=parseFloat(e)),isNaN(t)||(i[1]=parseFloat(t))},unionExtent:function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),xx.prototype.setExtent.call(this,t[0],t[1])},getInterval:function(){return this._interval},setInterval:function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=yx.getIntervalPrecision(e)},getTicks:function(e){var t=this._interval,i=this._extent,n=this._niceExtent,r=this._intervalPrecision,a=[];if(!t)return a;i[0]<n[0]&&(e?a.push(_x(n[0]-t,r)):a.push(i[0]));for(var o=n[0];o<=n[1]&&(a.push(o),(o=_x(o+t,r))!==a[a.length-1]);)if(a.length>1e4)return[];var s=a.length?a[a.length-1]:n[1];return i[1]>s&&(e?a.push(_x(s+t,r)):a.push(i[1])),a},getMinorTicks:function(e){for(var t=this.getTicks(!0),i=[],n=this.getExtent(),r=1;r<t.length;r++){for(var a=t[r],o=t[r-1],s=0,l=[],u=(a-o)/e;s<e-1;){var h=gx.round(o+(s+1)*u);h>n[0]&&h<n[1]&&l.push(h),s++}i.push(l)}return i},getLabel:function(e,t){if(null==e)return"";var i=t&&t.precision;return null==i?i=gx.getPrecisionSafe(e)||0:"auto"===i&&(i=this._intervalPrecision),e=_x(e,i,!0),mx.addCommas(e)},niceTicks:function(e,t,i){e=e||5;var n=this._extent,r=n[1]-n[0];if(isFinite(r)){r<0&&(r=-r,n.reverse());var a=yx.intervalScaleNiceTicks(n,e,t,i);this._intervalPrecision=a.intervalPrecision,this._interval=a.interval,this._niceExtent=a.niceTickExtent}},niceExtent:function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var i=t[0];e.fixMax||(t[1]+=i/2),t[0]-=i/2}else t[1]=1;var n=t[1]-t[0];isFinite(n)||(t[0]=0,t[1]=1),this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var r=this._interval;e.fixMin||(t[0]=_x(Math.floor(t[0]/r)*r)),e.fixMax||(t[1]=_x(Math.ceil(t[1]/r)*r))}});xx.create=function(){return new xx};var bx=xx,Tx={},Sx=l,Mx=wc.parsePercent,Ax=A_.isDimensionStacked,Ix="undefined"!=typeof Float32Array?Float32Array:Array;function Cx(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function Dx(e){return e.dim+e.index}function Ex(e,t){var i=[];return t.eachSeriesByType(e,(function(e){Ox(e)&&!kx(e)&&i.push(e)})),i}function Lx(e){var t=function(e){var t={};Sx.each(e,(function(e){var i=e.coordinateSystem.getBaseAxis();if("time"===i.type||"value"===i.type)for(var n=e.getData(),r=i.dim+"_"+i.index,a=n.mapDimension(i.dim),o=0,s=n.count();o<s;++o){var l=n.get(a,o);t[r]?t[r].push(l):t[r]=[l]}}));var i=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(r){r.sort((function(e,t){return e-t}));for(var a=null,o=1;o<r.length;++o){var s=r[o]-r[o-1];s>0&&(a=null===a?s:Math.min(a,s))}i[n]=a}}return i}(e),i=[];return Sx.each(e,(function(e){var n,r=e.coordinateSystem.getBaseAxis(),a=r.getExtent();if("category"===r.type)n=r.getBandWidth();else if("value"===r.type||"time"===r.type){var o=r.dim+"_"+r.index,s=t[o],l=Math.abs(a[1]-a[0]),u=r.scale.getExtent(),h=Math.abs(u[1]-u[0]);n=s?l/h*s:l}else{var c=e.getData();n=Math.abs(a[1]-a[0])/c.count()}var d=Mx(e.get("barWidth"),n),f=Mx(e.get("barMaxWidth"),n),p=Mx(e.get("barMinWidth")||1,n),g=e.get("barGap"),m=e.get("barCategoryGap");i.push({bandWidth:n,barWidth:d,barMaxWidth:f,barMinWidth:p,barGap:g,barCategoryGap:m,axisKey:Dx(r),stackId:Cx(e)})})),Px(i)}function Px(e){var t={};Sx.each(e,(function(e,i){var n=e.axisKey,r=e.bandWidth,a=t[n]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=a.stacks;t[n]=a;var s=e.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(a.remainedWidth,l),a.remainedWidth-=l);var u=e.barMaxWidth;u&&(o[s].maxWidth=u);var h=e.barMinWidth;h&&(o[s].minWidth=h);var c=e.barGap;null!=c&&(a.gap=c);var d=e.barCategoryGap;null!=d&&(a.categoryGap=d)}));var i={};return Sx.each(t,(function(e,t){i[t]={};var n=e.stacks,r=e.bandWidth,a=Mx(e.categoryGap,r),o=Mx(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-a)/(l+(l-1)*o);u=Math.max(u,0),Sx.each(n,(function(e){var t=e.maxWidth,i=e.minWidth;if(e.width){n=e.width;t&&(n=Math.min(n,t)),i&&(n=Math.max(n,i)),e.width=n,s-=n+o*n,l--}else{var n=u;t&&t<n&&(n=Math.min(t,s)),i&&i>n&&(n=i),n!==u&&(e.width=n,s-=n+o*n,l--)}})),u=(s-a)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;Sx.each(n,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;Sx.each(n,(function(e,n){i[t][n]=i[t][n]||{bandWidth:r,offset:d,width:e.width},d+=e.width*(1+o)}))})),i}function Nx(e,t,i){if(e&&t){var n=e[Dx(t)];return null!=n&&null!=i&&(n=n[Cx(i)]),n}}var Rx={seriesType:"bar",plan:Zg(),reset:function(e){if(Ox(e)&&kx(e)){var t=e.getData(),i=e.coordinateSystem,n=i.grid.getRect(),r=i.getBaseAxis(),a=i.getOtherAxis(r),o=t.mapDimension(a.dim),s=t.mapDimension(r.dim),l=a.isHorizontal(),u=l?0:1,h=Nx(Lx([e]),r,e).width;return h>.5||(h=.5),{progress:function(e,t){var c,d=e.count,f=new Ix(2*d),p=new Ix(2*d),g=new Ix(d),m=[],v=[],y=0,_=0;for(;null!=(c=e.next());)v[u]=t.get(o,c),v[1-u]=t.get(s,c),m=i.dataToPoint(v,null,m),p[y]=l?n.x+n.width:m[0],f[y++]=m[0],p[y]=l?m[1]:n.y+n.height,f[y++]=m[1],g[_++]=c;t.setLayout({largePoints:f,largeDataIndices:g,largeBackgroundPoints:p,barWidth:h,valueAxisStart:zx(r,a),backgroundStart:l?n.x:n.y,valueAxisHorizontal:l})}}}}};function Ox(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function kx(e){return e.pipelineContext&&e.pipelineContext.large}function zx(e,t,i){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}Tx.getLayoutOnAxis=function(e){var t=[],i=e.axis,n="axis0";if("category"===i.type){for(var r=i.getBandWidth(),a=0;a<e.count;a++)t.push(Sx.defaults({bandWidth:r,axisKey:n,stackId:"__ec_stack_"+a},e));var o=Px(t),s=[];for(a=0;a<e.count;a++){var l=o.axis0["__ec_stack_"+a];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}},Tx.prepareLayoutBarSeries=Ex,Tx.makeColumnLayout=Lx,Tx.retrieveColumnLayout=Nx,Tx.layout=function(e,t){var i=Ex(e,t),n=Lx(i),r={},a={};Sx.each(i,(function(e){var t=e.getData(),i=e.coordinateSystem,o=i.getBaseAxis(),s=Cx(e),l=n[Dx(o)][s],u=l.offset,h=l.width,c=i.getOtherAxis(o),d=e.get("barMinHeight")||0;r[s]=r[s]||[],a[s]=a[s]||[],t.setLayout({bandWidth:l.bandWidth,offset:u,size:h});for(var f=t.mapDimension(c.dim),p=t.mapDimension(o.dim),g=Ax(t,f),m=c.isHorizontal(),v=zx(o,c),y=0,_=t.count();y<_;y++){var x,b,w,T,S,M=t.get(f,y),A=t.get(p,y),I=M>=0?"p":"n",C=v;if(g&&(r[s][A]||(r[s][A]={p:v,n:v}),C=r[s][A][I]),m)x=C,b=(S=i.dataToPoint([M,A]))[1]+u,w=S[0]-v,T=h,Math.abs(w)<d&&(w=(w<0?-1:1)*d),isNaN(w)||g&&(r[s][A][I]+=w);else x=(S=i.dataToPoint([A,M]))[0]+u,b=C,w=h,T=S[1]-v,Math.abs(T)<d&&(T=(T<=0?-1:1)*d),isNaN(T)||g&&(r[s][A][I]+=T);t.setItemLayout(y,{x:x,y:b,width:w,height:T})}}),this)},Tx.largeLayout=Rx;var Bx=l,Fx=wc,Vx=Ac,Gx=ux,Hx=bx,Ux=Hx.prototype,Wx=Math.ceil,jx=Math.floor,Xx=864e5,Zx=Hx.extend({type:"time",getLabel:function(e){var t=this._stepLvl,i=new Date(e);return Vx.formatTime(t[0],i,this.getSetting("useUTC"))},niceExtent:function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=Xx,t[1]+=Xx),t[1]===-1/0&&t[0]===1/0){var i=new Date;t[1]=+new Date(i.getFullYear(),i.getMonth(),i.getDate()),t[0]=t[1]-Xx}this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var n=this._interval;e.fixMin||(t[0]=Fx.round(jx(t[0]/n)*n)),e.fixMax||(t[1]=Fx.round(Wx(t[1]/n)*n))},niceTicks:function(e,t,i){e=e||10;var n=this._extent,r=n[1]-n[0],a=r/e;null!=t&&a<t&&(a=t),null!=i&&a>i&&(a=i);var o=qx.length,s=function(e,t,i,n){for(;i<n;){var r=i+n>>>1;e[r][1]<t?i=r+1:n=r}return i}(qx,a,0,o),l=qx[Math.min(s,o-1)],u=l[1];if("year"===l[0]){var h=r/u;u*=Fx.nice(h/e,!0)}var c=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,d=[Math.round(Wx((n[0]-c)/u)*u+c),Math.round(jx((n[1]-c)/u)*u+c)];Gx.fixExtent(d,n),this._stepLvl=l,this._interval=u,this._niceExtent=d},parse:function(e){return+Fx.parseDate(e)}});Bx.each(["contain","normalize"],(function(e){Zx.prototype[e]=function(t){return Ux[e].call(this,this.parse(t))}}));var qx=[["hh:mm:ss",1e3],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",6e4],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",36e5],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",Xx],["MM-dd\nyyyy",1728e5],["MM-dd\nyyyy",2592e5],["MM-dd\nyyyy",3456e5],["MM-dd\nyyyy",432e6],["MM-dd\nyyyy",5184e5],["week",6048e5],["MM-dd\nyyyy",864e6],["week",12096e5],["week",18144e5],["month",26784e5],["week",36288e5],["month",53568e5],["week",6048e6],["quarter",8208e6],["month",107136e5],["month",13392e6],["half-year",16416e6],["month",214272e5],["month",26784e6],["year",32832e6]];Zx.create=function(e){return new Zx({useUTC:e.ecModel.get("useUTC")})};var Yx=l,Kx=Z_,Qx=wc,Jx=bx,$x=Kx.prototype,eb=Jx.prototype,tb=Qx.getPrecisionSafe,ib=Qx.round,nb=Math.floor,rb=Math.ceil,ab=Math.pow,ob=Math.log,sb=Kx.extend({type:"log",base:10,$constructor:function(){Kx.apply(this,arguments),this._originalScale=new Jx},getTicks:function(e){var t=this._originalScale,i=this._extent,n=t.getExtent();return Yx.map(eb.getTicks.call(this,e),(function(e){var r=Qx.round(ab(this.base,e));return r=e===i[0]&&t.__fixMin?lb(r,n[0]):r,r=e===i[1]&&t.__fixMax?lb(r,n[1]):r}),this)},getMinorTicks:eb.getMinorTicks,getLabel:eb.getLabel,scale:function(e){return e=$x.scale.call(this,e),ab(this.base,e)},setExtent:function(e,t){var i=this.base;e=ob(e)/ob(i),t=ob(t)/ob(i),eb.setExtent.call(this,e,t)},getExtent:function(){var e=this.base,t=$x.getExtent.call(this);t[0]=ab(e,t[0]),t[1]=ab(e,t[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(t[0]=lb(t[0],n[0])),i.__fixMax&&(t[1]=lb(t[1],n[1])),t},unionExtent:function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=ob(e[0])/ob(t),e[1]=ob(e[1])/ob(t),$x.unionExtent.call(this,e)},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},niceTicks:function(e){e=e||10;var t=this._extent,i=t[1]-t[0];if(!(i===1/0||i<=0)){var n=Qx.quantity(i);for(e/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var r=[Qx.round(rb(t[0]/n)*n),Qx.round(nb(t[1]/n)*n)];this._interval=n,this._niceExtent=r}},niceExtent:function(e){eb.niceExtent.call(this,e);var t=this._originalScale;t.__fixMin=e.fixMin,t.__fixMax=e.fixMax}});function lb(e,t){return ib(e,tb(t))}Yx.each(["contain","normalize"],(function(e){sb.prototype[e]=function(t){return t=ob(t)/ob(this.base),$x[e].call(this,t)}})),sb.create=function(){return new sb};var ub=sb,hb=l,cb=lx,db=bx,fb=Z_,pb=wc,gb=Tx,mb=gb.prepareLayoutBarSeries,vb=gb.makeColumnLayout,yb=gb.retrieveColumnLayout,_b=wi;function xb(e,t){var i,n,r,a=e.type,o=t.getMin(),s=t.getMax(),l=e.getExtent();"ordinal"===a?i=t.getCategories().length:(n=t.get("boundaryGap"),hb.isArray(n)||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=pb.parsePercent(n[0],1),n[1]=pb.parsePercent(n[1],1),r=l[1]-l[0]||Math.abs(l[0])),"dataMin"===o?o=l[0]:"function"==typeof o&&(o=o({min:l[0],max:l[1]})),"dataMax"===s?s=l[1]:"function"==typeof s&&(s=s({min:l[0],max:l[1]}));var u=null!=o,h=null!=s;null==o&&(o="ordinal"===a?i?0:NaN:l[0]-n[0]*r),null==s&&(s="ordinal"===a?i?i-1:NaN:l[1]+n[1]*r),(null==o||!isFinite(o))&&(o=NaN),(null==s||!isFinite(s))&&(s=NaN),e.setBlank(hb.eqNaN(o)||hb.eqNaN(s)||"ordinal"===a&&!e.getOrdinalMeta().categories.length),t.getNeedCrossZero()&&(o>0&&s>0&&!u&&(o=0),o<0&&s<0&&!h&&(s=0));var c=t.ecModel;if(c&&"time"===a){var d,f=mb("bar",c);if(hb.each(f,(function(e){d|=e.getBaseAxis()===t.axis})),d){var p=vb(f),g=function(e,t,i,n){var r=i.axis.getExtent(),a=r[1]-r[0],o=yb(n,i.axis);if(void 0===o)return{min:e,max:t};var s=1/0;hb.each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;hb.each(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=t-e,c=h/(1-(s+l)/a)-h;return{min:e-=c*(s/u),max:t+=c*(l/u)}}(o,s,t,p);o=g.min,s=g.max}}return{extent:[o,s],fixMin:u,fixMax:h}}function bb(e){var t,i=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"string"==typeof i?(t=i,i=function(i){return i=e.scale.getLabel(i),t.replace("{value}",null!=i?i:"")}):"function"==typeof i?function(t,r){return null!=n&&(r=t-n),i(wb(e,t),r)}:function(t){return e.scale.getLabel(t)}}function wb(e,t){return"category"===e.type?e.scale.getLabel(t):t}function Tb(e){var t=e.get("interval");return null==t?"auto":t}W_.getScaleExtent=xb,W_.niceScaleExtent=function(e,t){var i=xb(e,t),n=i.extent,r=t.get("splitNumber");"log"===e.type&&(e.base=t.get("logBase"));var a=e.type;e.setExtent(n[0],n[1]),e.niceExtent({splitNumber:r,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:"interval"===a||"time"===a?t.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?t.get("maxInterval"):null});var o=t.get("interval");null!=o&&e.setInterval&&e.setInterval(o)},W_.createScaleByModel=function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new cb(e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),[1/0,-1/0]);case"value":return new db;default:return(fb.getClass(t)||db).create(e)}},W_.ifAxisCrossZero=function(e){var t=e.scale.getExtent(),i=t[0],n=t[1];return!(i>0&&n>0||i<0&&n<0)},W_.makeLabelFormatter=bb,W_.getAxisRawValue=wb,W_.estimateLabelUnionRect=function(e){var t=e.model,i=e.scale;if(t.get("axisLabel.show")&&!i.isBlank()){var n,r,a="category"===e.type,o=i.getExtent();r=a?i.count():(n=i.getTicks()).length;var s,l,u,h,c,d,f,p,g,m=e.getLabelModel(),v=bb(e),y=1;r>40&&(y=Math.ceil(r/40));for(var _=0;_<r;_+=y){var x=v(n?n[_]:o[0]+_),b=m.getTextRect(x),w=(l=b,u=m.get("rotate")||0,h=void 0,c=void 0,d=void 0,f=void 0,p=void 0,g=void 0,void 0,h=u*Math.PI/180,c=l.plain(),d=c.width,f=c.height,p=d*Math.abs(Math.cos(h))+Math.abs(f*Math.sin(h)),g=d*Math.abs(Math.sin(h))+Math.abs(f*Math.cos(h)),new _b(c.x,c.y,p,g));s?s.union(w):s=w}return s}},W_.getOptionCategoryInterval=Tb,W_.shouldShowAllLabels=function(e){return"category"===e.type&&0===Tb(e.getLabelModel())};var Sb=l,Mb={getMin:function(e){var t=this.option,i=e||null==t.rangeStart?t.min:t.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!Sb.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(e){var t=this.option,i=e||null==t.rangeEnd?t.max:t.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!Sb.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var e=this.option;return null==e.rangeStart&&null==e.rangeEnd&&!e.scale},getCoordSysModel:Sb.noop,setRange:function(e,t){this.option.rangeStart=e,this.option.rangeEnd=t},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},Ab={},Ib=l,Cb=yo,Db=wi,Eb=fn.calculateTextPosition,Lb=Cb.extendShape({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=t.width/2,a=t.height/2;e.moveTo(i,n-a),e.lineTo(i+r,n+a),e.lineTo(i-r,n+a),e.closePath()}}),Pb=Cb.extendShape({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=t.width/2,a=t.height/2;e.moveTo(i,n-a),e.lineTo(i+r,n),e.lineTo(i,n+a),e.lineTo(i-r,n),e.closePath()}}),Nb=Cb.extendShape({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var i=t.x,n=t.y,r=t.width/5*3,a=Math.max(r,t.height),o=r/2,s=o*o/(a-o),l=n-a+o+s,u=Math.asin(s/o),h=Math.cos(u)*o,c=Math.sin(u),d=Math.cos(u),f=.6*o,p=.7*o;e.moveTo(i-h,l+s),e.arc(i,l,o,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(i+h-c*f,l+s+d*f,i,n-p,i,n),e.bezierCurveTo(i,n-p,i-h+c*f,l+s+d*f,i-h,l+s),e.closePath()}}),Rb=Cb.extendShape({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var i=t.height,n=t.width,r=t.x,a=t.y,o=n/3*2;e.moveTo(r,a),e.lineTo(r+o,a+i),e.lineTo(r,a+i/4*3),e.lineTo(r-o,a+i),e.lineTo(r,a),e.closePath()}}),Ob={line:Cb.Line,rect:Cb.Rect,roundRect:Cb.Rect,square:Cb.Rect,circle:Cb.Circle,diamond:Pb,pin:Nb,arrow:Rb,triangle:Lb},kb={line:function(e,t,i,n,r){r.x1=e,r.y1=t+n/2,r.x2=e+i,r.y2=t+n/2},rect:function(e,t,i,n,r){r.x=e,r.y=t,r.width=i,r.height=n},roundRect:function(e,t,i,n,r){r.x=e,r.y=t,r.width=i,r.height=n,r.r=Math.min(i,n)/4},square:function(e,t,i,n,r){var a=Math.min(i,n);r.x=e,r.y=t,r.width=a,r.height=a},circle:function(e,t,i,n,r){r.cx=e+i/2,r.cy=t+n/2,r.r=Math.min(i,n)/2},diamond:function(e,t,i,n,r){r.cx=e+i/2,r.cy=t+n/2,r.width=i,r.height=n},pin:function(e,t,i,n,r){r.x=e+i/2,r.y=t+n/2,r.width=i,r.height=n},arrow:function(e,t,i,n,r){r.x=e+i/2,r.y=t+n/2,r.width=i,r.height=n},triangle:function(e,t,i,n,r){r.cx=e+i/2,r.cy=t+n/2,r.width=i,r.height=n}},zb={};Ib.each(Ob,(function(e,t){zb[t]=new e}));var Bb=Cb.extendShape({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,i){var n=Eb(e,t,i),r=this.shape;return r&&"pin"===r.symbolType&&"inside"===t.textPosition&&(n.y=i.y+.4*i.height),n},buildPath:function(e,t,i){var n=t.symbolType;if("none"!==n){var r=zb[n];r||(r=zb[n="rect"]),kb[n](t.x,t.y,t.width,t.height,r.shape),r.buildPath(e,r.shape,i)}}});function Fb(e,t){if("image"!==this.type){var i=this.style,n=this.shape;n&&"line"===n.symbolType?i.stroke=e:this.__isEmptyBrush?(i.stroke=e,i.fill=t||"#fff"):(i.fill&&(i.fill=e),i.stroke&&(i.stroke=e)),this.dirty(!1)}}Ab.createSymbol=function(e,t,i,n,r,a,o){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?Cb.makeImage(e.slice(8),new Db(t,i,n,r),o?"center":"cover"):0===e.indexOf("path://")?Cb.makePath(e.slice(7),{},new Db(t,i,n,r),o?"center":"cover"):new Bb({shape:{symbolType:e,x:t,y:i,width:n,height:r}})).__isEmptyBrush=l,s.setColor=Fb,s.setColor(a),s};var Vb=l,Gb=U_,Hb=W_,Ub=Mb,Wb=mc,jb=bc;jb.getLayoutRect,ly.getLayoutRect=jb.getLayoutRect;var Xb=A_,Zb=Xb.enableDataStack,qb=Xb.isDimensionStacked,Yb=Xb.getStackedDimension,Kb=m_;ly.completeDimensions=Kb;var Qb=y_;ly.createDimensions=Qb;var Jb=Ab;ly.createSymbol=Jb.createSymbol;var $b={isDimensionStacked:qb,enableDataStack:Zb,getStackedDimension:Yb};ly.createList=function(e){return Gb(e.getSource(),e)},ly.dataStack=$b,ly.createScale=function(e,t){var i=t;Wb.isInstance(t)||(i=new Wb(t),Vb.mixin(i,Ub));var n=Hb.createScaleByModel(i);return n.setExtent(e[0],e[1]),Hb.niceScaleExtent(n,i),n},ly.mixinAxisModelCommonMethods=function(e){Vb.mixin(e,Ub)};var ew={},tw=Ss;function iw(e,t){return Math.abs(e-t)<1e-8}ew.contain=function(e,t,i){var n=0,r=e[0];if(!r)return!1;for(var a=1;a<e.length;a++){var o=e[a];n+=tw(r[0],r[1],o[0],o[1],t,i),r=o}var s=e[0];return iw(r[0],s[0])&&iw(r[1],s[1])||(n+=tw(r[0],r[1],s[0],s[1],t,i)),0!==n};var nw=wi,rw=Oo,aw=P,ow=ew;function sw(e,t,i){if(this.name=e,this.geometries=t,i)i=[i[0],i[1]];else{var n=this.getBoundingRect();i=[n.x+n.width/2,n.y+n.height/2]}this.center=i}sw.prototype={constructor:sw,properties:null,getBoundingRect:function(){var e=this._rect;if(e)return e;for(var t=Number.MAX_VALUE,i=[t,t],n=[-t,-t],r=[],a=[],o=this.geometries,s=0;s<o.length;s++)if("polygon"===o[s].type){var l=o[s].exterior;rw.fromPoints(l,r,a),aw.min(i,i,r),aw.max(n,n,a)}return 0===s&&(i[0]=i[1]=n[0]=n[1]=0),this._rect=new nw(i[0],i[1],n[0]-i[0],n[1]-i[1])},contain:function(e){var t=this.getBoundingRect(),i=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var n=0,r=i.length;n<r;n++)if("polygon"===i[n].type){var a=i[n].exterior,o=i[n].interiors;if(ow.contain(a,e[0],e[1])){for(var s=0;s<(o?o.length:0);s++)if(ow.contain(o[s]))continue e;return!0}}return!1},transformTo:function(e,t,i,n){var r=this.getBoundingRect(),a=r.width/r.height;i?n||(n=i/a):i=a*n;for(var o=new nw(e,t,i,n),s=r.calculateTransform(o),l=this.geometries,u=0;u<l.length;u++)if("polygon"===l[u].type){for(var h=l[u].exterior,c=l[u].interiors,d=0;d<h.length;d++)aw.applyTransform(h[d],h[d],s);for(var f=0;f<(c?c.length:0);f++)for(d=0;d<c[f].length;d++)aw.applyTransform(c[f][d],c[f][d],s)}(r=this._rect).copy(o),this.center=[r.x+r.width/2,r.y+r.height/2]},cloneShallow:function(e){null==e&&(e=this.name);var t=new sw(e,this.geometries,this.center);return t._rect=this._rect,t.transformTo=null,t}};var lw=sw,uw=l,hw=lw;function cw(e,t,i){for(var n=[],r=t[0],a=t[1],o=0;o<e.length;o+=2){var s=e.charCodeAt(o)-64,l=e.charCodeAt(o+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),r=s+=r,a=l+=a,n.push([s/i,l/i])}return n}var dw=function(e,t){return function(e){if(!e.UTF8Encoding)return e;var t=e.UTF8Scale;null==t&&(t=1024);for(var i=e.features,n=0;n<i.length;n++)for(var r=i[n].geometry,a=r.coordinates,o=r.encodeOffsets,s=0;s<a.length;s++){var l=a[s];if("Polygon"===r.type)a[s]=cw(l,o[s],t);else if("MultiPolygon"===r.type)for(var u=0;u<l.length;u++){var h=l[u];l[u]=cw(h,o[s][u],t)}}e.UTF8Encoding=!1}(e),uw.map(uw.filter(e.features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var i=e.properties,n=e.geometry,r=n.coordinates,a=[];"Polygon"===n.type&&a.push({type:"polygon",exterior:r[0],interiors:r.slice(1)}),"MultiPolygon"===n.type&&uw.each(r,(function(e){e[0]&&a.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new hw(i[t||"name"],a,i.cp);return o.properties=i,o}))},fw={},pw=l,gw=fn,mw=qa.makeInner,vw=W_,yw=vw.makeLabelFormatter,_w=vw.getOptionCategoryInterval,xw=vw.shouldShowAllLabels,bw=mw();function ww(e,t){var i,n,r=Tw(e,"labels"),a=_w(t),o=Sw(r,a);return o||(pw.isFunction(a)?i=Iw(e,a):(n="auto"===a?function(e){var t=bw(e).autoInterval;return null!=t?t:bw(e).autoInterval=e.calculateCategoryInterval()}(e):a,i=Aw(e,n)),Mw(r,a,{labels:i,labelCategoryInterval:n}))}function Tw(e,t){return bw(e)[t]||(bw(e)[t]=[])}function Sw(e,t){for(var i=0;i<e.length;i++)if(e[i].key===t)return e[i].value}function Mw(e,t,i){return e.push({key:t,value:i}),i}function Aw(e,t,i){var n=yw(e),r=e.scale,a=r.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],h=r.count();0!==u&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=xw(e),d=o.get("showMinLabel")||c,f=o.get("showMaxLabel")||c;d&&u!==a[0]&&g(a[0]);for(var p=u;p<=a[1];p+=l)g(p);function g(e){s.push(i?e:{formattedLabel:n(e),rawLabel:r.getLabel(e),tickValue:e})}return f&&p-l!==a[1]&&g(a[1]),s}function Iw(e,t,i){var n=e.scale,r=yw(e),a=[];return pw.each(n.getTicks(),(function(e){var o=n.getLabel(e);t(e,o)&&a.push(i?e:{formattedLabel:r(e),rawLabel:o,tickValue:e})})),a}fw.createAxisLabels=function(e){return"category"===e.type?function(e){var t=e.getLabelModel(),i=ww(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(e):function(e){var t=e.scale.getTicks(),i=yw(e);return{labels:pw.map(t,(function(t,n){return{formattedLabel:i(t,n),rawLabel:e.scale.getLabel(t),tickValue:t}}))}}(e)},fw.createAxisTicks=function(e,t){return"category"===e.type?function(e,t){var i,n,r=Tw(e,"ticks"),a=_w(t),o=Sw(r,a);if(o)return o;t.get("show")&&!e.scale.isBlank()||(i=[]);if(pw.isFunction(a))i=Iw(e,a,!0);else if("auto"===a){var s=ww(e,e.getLabelModel());n=s.labelCategoryInterval,i=pw.map(s.labels,(function(e){return e.tickValue}))}else i=Aw(e,n=a,!0);return Mw(r,a,{ticks:i,tickCategoryInterval:n})}(e,t):{ticks:e.scale.getTicks()}},fw.calculateCategoryInterval=function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),i=yw(e),n=(t.axisRotate-t.labelRotate)/180*Math.PI,r=e.scale,a=r.getExtent(),o=r.count();if(a[1]-a[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),h=Math.abs(u*Math.cos(n)),c=Math.abs(u*Math.sin(n)),d=0,f=0;l<=a[1];l+=s){var p,g,m=gw.getBoundingRect(i(l),t.font,"center","top");p=1.3*m.width,g=1.3*m.height,d=Math.max(d,p,7),f=Math.max(f,g,7)}var v=d/h,y=f/c;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(v,y))),x=bw(e.model),b=e.getExtent(),w=x.lastAutoInterval,T=x.lastTickCount;return null!=w&&null!=T&&Math.abs(w-_)<=1&&Math.abs(T-o)<=1&&w>_&&x.axisExtend0===b[0]&&x.axisExtend1===b[1]?_=w:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtend0=b[0],x.axisExtend1=b[1]),_};var Cw=l,Dw=Cw.each,Ew=Cw.map,Lw=wc,Pw=Lw.linearMap,Nw=Lw.getPixelPrecision,Rw=Lw.round,Ow=fw,kw=Ow.createAxisTicks,zw=Ow.createAxisLabels,Bw=Ow.calculateCategoryInterval,Fw=[0,1],Vw=function(e,t,i){this.dim=e,this.scale=t,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};function Gw(e,t){var i=(e[1]-e[0])/t/2;e[0]+=i,e[1]-=i}Vw.prototype={constructor:Vw,contain:function(e){var t=this._extent,i=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return e>=i&&e<=n},containData:function(e){return this.scale.contain(e)},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(e){return Nw(e||this.scale.getExtent(),this._extent)},setExtent:function(e,t){var i=this._extent;i[0]=e,i[1]=t},dataToCoord:function(e,t){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&"ordinal"===n.type&&Gw(i=i.slice(),n.count()),Pw(e,Fw,i,t)},coordToData:function(e,t){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&Gw(i=i.slice(),n.count());var r=Pw(e,i,Fw,t);return this.scale.scale(r)},pointToData:function(e,t){},getTicksCoords:function(e){var t=(e=e||{}).tickModel||this.getTickModel(),i=kw(this,t).ticks,n=Ew(i,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this);return function(e,t,i,n){var r=t.length;if(!e.onBand||i||!r)return;var a,o,s=e.getExtent();if(1===r)t[0].coord=s[0],a=t[1]={coord:s[0]};else{var l=t[r-1].tickValue-t[0].tickValue,u=(t[r-1].coord-t[0].coord)/l;Dw(t,(function(e){e.coord-=u/2})),o=1+e.scale.getExtent()[1]-t[r-1].tickValue,a={coord:t[r-1].coord+u*o},t.push(a)}var h=s[0]>s[1];c(t[0].coord,s[0])&&(n?t[0].coord=s[0]:t.shift());n&&c(s[0],t[0].coord)&&t.unshift({coord:s[0]});c(s[1],a.coord)&&(n?a.coord=s[1]:t.pop());n&&c(a.coord,s[1])&&t.push({coord:s[1]});function c(e,t){return e=Rw(e),t=Rw(t),h?e>t:e<t}}(this,n,t.get("alignWithLabel"),e.clamp),n},getMinorTicksCoords:function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");e>0&&e<100||(e=5);var t=this.scale.getMinorTicks(e);return Ew(t,(function(e){return Ew(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},getViewLabels:function(){return zw(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return Bw(this)}};var Hw=Vw,Uw=r;sy.zrender=Uw;var Ww=Re;sy.matrix=Ww;var jw=P;sy.vector=jw;var Xw=l,Zw=$e;sy.color=Zw;var qw=yo,Yw=wc;sy.number=Yw;var Kw=Ac;sy.format=Kw;var Qw=dm;Qw.throttle,sy.throttle=Qw.throttle;var Jw=ly;sy.helper=Jw;var $w=dw;sy.parseGeoJSON=$w;var eT=Jy;sy.List=eT;var tT=mc;sy.Model=tT;var iT=Hw;sy.Axis=iT;var nT=s;sy.env=nT;var rT=$w,aT={};Xw.each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],(function(e){aT[e]=Xw[e]}));var oT={};Xw.each(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],(function(e){oT[e]=qw[e]})),sy.parseGeoJson=rT,sy.util=aT,sy.graphic=oT,function(e){var t=r,i=l,n=$e,a=s,o=Ni,u=q,h=Lf,c=Rf,d=Bf,f=Kf,p=_p,g=Sp,m=ud,v=Fg,y=jg,_=cm,x=yo,b=qa,w=dm.throttle,T=ym,S=Tm,M=Cm,A=av,I=sv,C=hv,D=oy,E=i.assert,L=i.each,P=i.isFunction,N=i.isObject,R=m.parseClassType,O={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:3500,COMPONENT:4e3,BRUSH:5e3}},k="__flagInMainProcess",z=/^[a-zA-Z0-9_]+$/;function B(e,t){return function(i,n,r){t||!this._disposed?(i=i&&i.toLowerCase(),u.prototype[e].call(this,i,n,r)):this.id}}function F(){u.call(this)}function V(e,n,r){r=r||{},"string"==typeof n&&(n=ce[n]),this.id,this.group,this._dom=e;var a=this._zr=t.init(e,{renderer:r.renderer||"canvas",devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height});this._throttledZrFlush=w(i.bind(a.flush,a),17),(n=i.clone(n))&&p(n,!0),this._theme=n,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new d;var s,l,h=this._api=(l=(s=this)._coordSysMgr,i.extend(new c(s),{getCoordinateSystems:i.bind(l.getCoordinateSystems,l),getComponentByElement:function(e){for(;e;){var t=e.__ecComponentInfo;if(null!=t)return s._model.getComponent(t.mainType,t.index);e=e.parent}}}));function f(e,t){return e.__prio-t.__prio}o(he,f),o(se,f),this._scheduler=new A(this,h,se,he),u.call(this,this._ecEventProcessor=new re),this._messageCenter=new F,this._initEvents(),this.resize=i.bind(this.resize,this),this._pendingActions=[],a.animation.on("frame",this._onframe,this),function(e,t){e.on("rendered",(function(){t.trigger("rendered"),!e.animation.isFinished()||t.__optionUpdated||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))}(a,this),i.setAsPrimitive(this)}F.prototype.on=B("on",!0),F.prototype.off=B("off",!0),F.prototype.one=B("one",!0),i.mixin(F,u);var G=V.prototype;function H(e,t,i){if(this._disposed)this.id;else{var n,r=this._model,a=this._coordSysMgr.getCoordinateSystems();t=b.parseFinder(r,t);for(var o=0;o<a.length;o++){var s=a[o];if(s[e]&&null!=(n=s[e](r,t,i)))return n}}}G._onframe=function(){if(!this._disposed){var e=this._scheduler;if(this.__optionUpdated){var t=this.__optionUpdated.silent;this[k]=!0,W(this),U.update.call(this),this[k]=!1,this.__optionUpdated=!1,Y.call(this,t),K.call(this,t)}else if(e.unfinished){var i=1,n=this._model,r=this._api;e.unfinished=!1;do{var a=+new Date;e.performSeriesTasks(n),e.performDataProcessorTasks(n),X(this,n),e.performVisualTasks(n),ee(this,this._model,r,"remain"),i-=+new Date-a}while(i>0&&e.unfinished);e.unfinished||this._zr.flush()}}},G.getDom=function(){return this._dom},G.getZr=function(){return this._zr},G.setOption=function(e,t,i){if(this._disposed)this.id;else{var n;if(N(t)&&(i=t.lazyUpdate,n=t.silent,t=t.notMerge),this[k]=!0,!this._model||t){var r=new f(this._api),a=this._theme,o=this._model=new h;o.scheduler=this._scheduler,o.init(null,null,a,r)}this._model.setOption(e,le),i?(this.__optionUpdated={silent:n},this[k]=!1):(W(this),U.update.call(this),this._zr.flush(),this.__optionUpdated=!1,this[k]=!1,Y.call(this,n),K.call(this,n))}},G.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},G.getModel=function(){return this._model},G.getOption=function(){return this._model&&this._model.getOption()},G.getWidth=function(){return this._zr.getWidth()},G.getHeight=function(){return this._zr.getHeight()},G.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},G.getRenderedCanvas=function(e){if(a.canvasSupported)return(e=e||{}).pixelRatio=e.pixelRatio||1,e.backgroundColor=e.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(e)},G.getSvgDataURL=function(){if(a.svgSupported){var e=this._zr,t=e.storage.getDisplayList();return i.each(t,(function(e){e.stopAnimation(!0)})),e.painter.toDataURL()}},G.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,i=this._model,n=[],r=this;L(t,(function(e){i.eachComponent({mainType:e},(function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(n.push(t),t.group.ignore=!0)}))}));var a="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return L(n,(function(e){e.group.ignore=!1})),a}this.id},G.getConnectedDataURL=function(e){if(this._disposed)this.id;else if(a.canvasSupported){var n="svg"===e.type,r=this.group,o=Math.min,s=Math.max,l=1/0;if(pe[r]){var u=l,h=l,c=-1/0,d=-1/0,f=[],p=e&&e.pixelRatio||1;i.each(fe,(function(t,a){if(t.group===r){var l=n?t.getZr().painter.getSvgDom().innerHTML:t.getRenderedCanvas(i.clone(e)),p=t.getDom().getBoundingClientRect();u=o(p.left,u),h=o(p.top,h),c=s(p.right,c),d=s(p.bottom,d),f.push({dom:l,left:p.left,top:p.top})}}));var g=(c*=p)-(u*=p),m=(d*=p)-(h*=p),v=i.createCanvas(),y=t.init(v,{renderer:n?"svg":"canvas"});if(y.resize({width:g,height:m}),n){var _="";return L(f,(function(e){var t=e.left-u,i=e.top-h;_+='<g transform="translate('+t+","+i+')">'+e.dom+"</g>"})),y.painter.getSvgRoot().innerHTML=_,e.connectedBackgroundColor&&y.painter.setBackgroundColor(e.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}return e.connectedBackgroundColor&&y.add(new x.Rect({shape:{x:0,y:0,width:g,height:m},style:{fill:e.connectedBackgroundColor}})),L(f,(function(e){var t=new x.Image({style:{x:e.left*p-u,y:e.top*p-h,image:e.dom}});y.add(t)})),y.refreshImmediately(),v.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}},G.convertToPixel=i.curry(H,"convertToPixel"),G.convertFromPixel=i.curry(H,"convertFromPixel"),G.containPixel=function(e,t){if(!this._disposed){var n,r=this._model;return e=b.parseFinder(r,e),i.each(e,(function(e,r){r.indexOf("Models")>=0&&i.each(e,(function(e){var i=e.coordinateSystem;if(i&&i.containPoint)n|=!!i.containPoint(t);else if("seriesModels"===r){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(n|=a.containPoint(t,e))}}),this)}),this),!!n}this.id},G.getVisual=function(e,t){var i=this._model,n=(e=b.parseFinder(i,e,{defaultMainType:"series"})).seriesModel.getData(),r=e.hasOwnProperty("dataIndexInside")?e.dataIndexInside:e.hasOwnProperty("dataIndex")?n.indexOfRawIndex(e.dataIndex):null;return null!=r?n.getItemVisual(r,t):n.getVisual(t)},G.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},G.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]};var U={prepareAndUpdate:function(e){W(this),U.update.call(this,e)},update:function(e){var t=this._model,i=this._api,r=this._zr,o=this._coordSysMgr,s=this._scheduler;if(t){s.restoreData(t,e),s.performSeriesTasks(t),o.create(t,i),s.performDataProcessorTasks(t,e),X(this,t),o.update(t,i),J(t),s.performVisualTasks(t,e),$(this,t,i,e);var l=t.get("backgroundColor")||"transparent";if(a.canvasSupported)r.setBackgroundColor(l);else{var u=n.parse(l);l=n.stringify(u,"rgb"),0===u[3]&&(l="transparent")}te(t,i)}},updateTransform:function(e){var t=this._model,n=this,r=this._api;if(t){var a=[];t.eachComponent((function(i,o){var s=n.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(o,t,r,e);l&&l.update&&a.push(s)}else a.push(s)}));var o=i.createHashMap();t.eachSeries((function(i){var a=n._chartsMap[i.__viewId];if(a.updateTransform){var s=a.updateTransform(i,t,r,e);s&&s.update&&o.set(i.uid,1)}else o.set(i.uid,1)})),J(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0,dirtyMap:o}),ee(n,t,r,e,o),te(t,this._api)}},updateView:function(e){var t=this._model;t&&(_.markUpdateMethod(e,"updateView"),J(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0}),$(this,this._model,this._api,e),te(t,this._api))},updateVisual:function(e){U.update.call(this,e)},updateLayout:function(e){U.update.call(this,e)}};function W(e){var t=e._model,i=e._scheduler;i.restorePipelines(t),i.prepareStageTasks(),Q(e,"component",t,i),Q(e,"chart",t,i),i.plan()}function j(e,t,n,r,a){var o=e._model;if(r){var s={};s[r+"Id"]=n[r+"Id"],s[r+"Index"]=n[r+"Index"],s[r+"Name"]=n[r+"Name"];var l={mainType:r,query:s};a&&(l.subType=a);var u=n.excludeSeriesId;null!=u&&(u=i.createHashMap(b.normalizeToArray(u))),o&&o.eachComponent(l,(function(t){u&&null!=u.get(t.id)||h(e["series"===r?"_chartsMap":"_componentsMap"][t.__viewId])}),e)}else L(e._componentsViews.concat(e._chartsViews),h);function h(i){i&&i.__alive&&i[t]&&i[t](i.__model,o,e._api,n)}}function X(e,t){var i=e._chartsMap,n=e._scheduler;t.eachSeries((function(e){n.updateStreamModes(e,i[e.__viewId])}))}function Z(e,t){var n=e.type,r=e.escapeConnect,a=ae[n],o=a.actionInfo,s=(o.update||"update").split(":"),l=s.pop();s=null!=s[0]&&R(s[0]),this[k]=!0;var u=[e],h=!1;e.batch&&(h=!0,u=i.map(e.batch,(function(t){return(t=i.defaults(i.extend({},t),e)).batch=null,t})));var c,d=[],f="highlight"===n||"downplay"===n;L(u,(function(e){(c=(c=a.action(e,this._model,this._api))||i.extend({},e)).type=o.event||c.type,d.push(c),f?j(this,l,e,"series"):s&&j(this,l,e,s.main,s.sub)}),this),"none"===l||f||s||(this.__optionUpdated?(W(this),U.update.call(this,e),this.__optionUpdated=!1):U[l].call(this,e)),c=h?{type:o.event||n,escapeConnect:r,batch:d}:d[0],this[k]=!1,!t&&this._messageCenter.trigger(c.type,c)}function Y(e){for(var t=this._pendingActions;t.length;){var i=t.shift();Z.call(this,i,e)}}function K(e){!e&&this.trigger("updated")}function Q(e,t,i,n){for(var r="component"===t,a=r?e._componentsViews:e._chartsViews,o=r?e._componentsMap:e._chartsMap,s=e._zr,l=e._api,u=0;u<a.length;u++)a[u].__alive=!1;function h(e){var t="_ec_"+e.id+"_"+e.type,u=o[t];if(!u){var h=R(e.type);(u=new(r?y.getClass(h.main,h.sub):_.getClass(h.sub))).init(i,l),o[t]=u,a.push(u),s.add(u.group)}e.__viewId=u.__id=t,u.__alive=!0,u.__model=e,u.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!r&&n.prepareView(u,e,i,l)}r?i.eachComponent((function(e,t){"series"!==e&&h(t)})):i.eachSeries(h);for(u=0;u<a.length;){var c=a[u];c.__alive?u++:(!r&&c.renderTask.dispose(),s.remove(c.group),c.dispose(i,l),a.splice(u,1),delete o[c.__id],c.__id=c.group.__ecComponentInfo=null)}}function J(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function $(e,t,i,n){!function(e,t,i,n,r){L(r||e._componentsViews,(function(e){var r=e.__model;e.render(r,t,i,n),ne(r,e)}))}(e,t,i,n),L(e._chartsViews,(function(e){e.__alive=!1})),ee(e,t,i,n),L(e._chartsViews,(function(e){e.__alive||e.remove(t,i)}))}function ee(e,t,i,n,r){var o,s=e._scheduler;t.eachSeries((function(t){var i=e._chartsMap[t.__viewId];i.__alive=!0;var a=i.renderTask;s.updatePayload(a,n),r&&r.get(t.uid)&&a.dirty(),o|=a.perform(s.getPerformArgs(a)),i.group.silent=!!t.get("silent"),ne(t,i),function(e,t){var i=e.get("blendMode")||null;t.group.traverse((function(e){e.isGroup||e.style.blend!==i&&e.setStyle("blend",i),e.eachPendingDisplayable&&e.eachPendingDisplayable((function(e){e.setStyle("blend",i)}))}))}(t,i)})),s.unfinished|=o,function(e,t){var i=e._zr.storage,n=0;i.traverse((function(e){n++})),n>t.get("hoverLayerThreshold")&&!a.node&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var i=e._chartsMap[t.__viewId];i.__alive&&i.group.traverse((function(e){e.useHoverLayer=!0}))}}))}(e,t),S(e._zr.dom,t)}function te(e,t){L(ue,(function(i){i(e,t)}))}G.resize=function(e){if(this._disposed)this.id;else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var i=t.resetOption("media"),n=e&&e.silent;this[k]=!0,i&&W(this),U.update.call(this),this[k]=!1,Y.call(this,n),K.call(this,n)}}},G.showLoading=function(e,t){if(this._disposed)this.id;else if(N(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),de[e]){var i=de[e](this._api,t),n=this._zr;this._loadingFX=i,n.add(i)}},G.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},G.makeActionFromEvent=function(e){var t=i.extend({},e);return t.type=oe[e.type],t},G.dispatchAction=function(e,t){this._disposed?this.id:(N(t)||(t={silent:!!t}),ae[e.type]&&this._model&&(this[k]?this._pendingActions.push(e):(Z.call(this,e,t.silent),t.flush?this._zr.flush(!0):!1!==t.flush&&a.browser.weChat&&this._throttledZrFlush(),Y.call(this,t.silent),K.call(this,t.silent))))},G.appendData=function(e){if(this._disposed)this.id;else{var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0}},G.on=B("on",!1),G.off=B("off",!1),G.one=B("one",!1);var ie=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function ne(e,t){var i=e.get("z"),n=e.get("zlevel");t.group.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=n&&(e.zlevel=n))}))}function re(){this.eventInfo}G._initEvents=function(){L(ie,(function(e){var t=function(t){var n,r=this.getModel(),a=t.target;if("globalout"===e)n={};else if(a&&null!=a.dataIndex){var o=a.dataModel||r.getSeriesByIndex(a.seriesIndex);n=o&&o.getDataParams(a.dataIndex,a.dataType,a)||{}}else a&&a.eventData&&(n=i.extend({},a.eventData));if(n){var s=n.componentType,l=n.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=n.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),h=u&&this["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];n.event=t,n.type=e,this._ecEventProcessor.eventInfo={targetEl:a,packedEvent:n,model:u,view:h},this.trigger(e,n)}};t.zrEventfulCallAtLast=!0,this._zr.on(e,t,this)}),this),L(oe,(function(e,t){this._messageCenter.on(t,(function(e){this.trigger(t,e)}),this)}),this)},G.isDisposed=function(){return this._disposed},G.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},G.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,b.setAttribute(this.getDom(),ve,"");var e=this._api,t=this._model;L(this._componentsViews,(function(i){i.dispose(t,e)})),L(this._chartsViews,(function(i){i.dispose(t,e)})),this._zr.dispose(),delete fe[this.id]}},i.mixin(V,u),re.prototype={constructor:re,normalizeQuery:function(e){var t={},n={},r={};if(i.isString(e)){var a=R(e);t.mainType=a.main||null,t.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};i.each(e,(function(e,i){for(var a=!1,l=0;l<o.length;l++){var u=o[l],h=i.lastIndexOf(u);if(h>0&&h===i.length-u.length){var c=i.slice(0,h);"data"!==c&&(t.mainType=c,t[u.toLowerCase()]=e,a=!0)}}s.hasOwnProperty(i)&&(n[i]=e,a=!0),a||(r[i]=e)}))}return{cptQuery:t,dataQuery:n,otherQuery:r}},filter:function(e,t,i){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,r,a));function h(e,t,i,n){return null==e[i]||t[n||i]===e[i]}},afterTrigger:function(){this.eventInfo=null}};var ae={},oe={},se=[],le=[],ue=[],he=[],ce={},de={},fe={},pe={},ge=new Date-0,me=new Date-0,ve="_echarts_instance_";function ye(e){pe[e]=!1}var _e=ye;function xe(e){return fe[b.getAttribute(e,ve)]}function be(e,t){ce[e]=t}function we(e){le.push(e)}function Te(e,t){Ae(se,e,t,1e3)}function Se(e,t,i){"function"==typeof t&&(i=t,t="");var n=N(e)?e.type:[e,e={event:t}][0];e.event=(e.event||n).toLowerCase(),t=e.event,E(z.test(n)&&z.test(t)),ae[n]||(ae[n]={action:i,actionInfo:e}),oe[t]=n}function Me(e,t){Ae(he,e,t,3e3,"visual")}function Ae(e,t,i,n,r){(P(t)||N(t))&&(i=t,t=n);var a=A.wrapStageHandler(i,r);return a.__prio=t,a.__raw=i,e.push(a),a}function Ie(e,t){de[e]=t}Me(2e3,T),we(p),Te(900,g),Ie("default",M),Se({type:"highlight",event:"highlight",update:"highlight"},i.noop),Se({type:"downplay",event:"downplay",update:"downplay"},i.noop),be("light",I),be("dark",C);e.version="4.9.0",e.dependencies={zrender:"4.3.2"},e.PRIORITY=O,e.init=function(e,t,i){var n=xe(e);if(n)return n;var r=new V(e,t,i);return r.id="ec_"+ge++,fe[r.id]=r,b.setAttribute(e,ve,r.id),function(e){var t="__connectUpdateStatus";function i(e,i){for(var n=0;n<e.length;n++)e[n][t]=i}L(oe,(function(n,r){e._messageCenter.on(r,(function(n){if(pe[e.group]&&0!==e[t]){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),a=[];L(fe,(function(t){t!==e&&t.group===e.group&&a.push(t)})),i(a,0),L(a,(function(e){1!==e[t]&&e.dispatchAction(r)})),i(a,2)}}))}))}(r),r},e.connect=function(e){if(i.isArray(e)){var t=e;e=null,L(t,(function(t){null!=t.group&&(e=t.group)})),e=e||"g_"+me++,L(t,(function(t){t.group=e}))}return pe[e]=!0,e},e.disConnect=ye,e.disconnect=_e,e.dispose=function(e){"string"==typeof e?e=fe[e]:e instanceof V||(e=xe(e)),e instanceof V&&!e.isDisposed()&&e.dispose()},e.getInstanceByDom=xe,e.getInstanceById=function(e){return fe[e]},e.registerTheme=be,e.registerPreprocessor=we,e.registerProcessor=Te,e.registerPostUpdate=function(e){ue.push(e)},e.registerAction=Se,e.registerCoordinateSystem=function(e,t){d.register(e,t)},e.getCoordinateSystemDimensions=function(e){var t=d.get(e);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()},e.registerLayout=function(e,t){Ae(he,e,t,1e3,"layout")},e.registerVisual=Me,e.registerLoading=Ie,e.extendComponentModel=function(e){return m.extend(e)},e.extendComponentView=function(e){return y.extend(e)},e.extendSeriesModel=function(e){return v.extend(e)},e.extendChartView=function(e){return _.extend(e)},e.setCanvasCreator=function(e){i.$override("createCanvas",e)},e.registerMap=function(e,t,i){D.registerMap(e,t,i)},e.getMap=function(e){var t=D.retrieveMap(e);return t&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},e.dataTool={};var Ce=sy;!function(){for(var t in Ce)Ce.hasOwnProperty(t)&&(e[t]=Ce[t])}()}(n);var sT=U_;Fg.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(e,t){return sT(this.getSource(),this,{useEncodeDefaulter:!0})},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clip:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0}});var lT={},uT=Mp.retrieveRawValue;lT.getDefaultLabel=function(e,t){var i=e.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return uT(e,t,i[0]);if(n){for(var r=[],a=0;a<i.length;a++){var o=uT(e,t,i[a]);r.push(o)}return r.join(" ")}};var hT=l,cT=Ab.createSymbol,dT=yo,fT=wc.parsePercent,pT=lT.getDefaultLabel;function gT(e,t,i){dT.Group.call(this),this.updateData(e,t,i)}var mT=gT.prototype,vT=gT.getSymbolSize=function(e,t){var i=e.getItemVisual(t,"symbolSize");return i instanceof Array?i.slice():[+i,+i]};function yT(e){return[e[0]/2,e[1]/2]}function _T(e,t){this.parent.drift(e,t)}mT._createSymbol=function(e,t,i,n,r){this.removeAll();var a=t.getItemVisual(i,"color"),o=cT(e,-1,-1,2,2,a,r);o.attr({z2:100,culling:!0,scale:yT(n)}),o.drift=_T,this._symbolType=e,this.add(o)},mT.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(e)},mT.getSymbolPath=function(){return this.childAt(0)},mT.getScale=function(){return this.childAt(0).scale},mT.highlight=function(){this.childAt(0).trigger("emphasis")},mT.downplay=function(){this.childAt(0).trigger("normal")},mT.setZ=function(e,t){var i=this.childAt(0);i.zlevel=e,i.z=t},mT.setDraggable=function(e){var t=this.childAt(0);t.draggable=e,t.cursor=e?"move":t.cursor},mT.updateData=function(e,t,i){this.silent=!1;var n=e.getItemVisual(t,"symbol")||"circle",r=e.hostModel,a=vT(e,t),o=n!==this._symbolType;if(o){var s=e.getItemVisual(t,"symbolKeepAspect");this._createSymbol(n,e,t,a,s)}else{(l=this.childAt(0)).silent=!1,dT.updateProps(l,{scale:yT(a)},r,t)}if(this._updateCommon(e,t,a,i),o){var l=this.childAt(0),u=i&&i.fadeIn,h={scale:l.scale.slice()};u&&(h.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),dT.initProps(l,h,r,t)}this._seriesModel=r};var xT=["itemStyle"],bT=["emphasis","itemStyle"],wT=["label"],TT=["emphasis","label"];function ST(e,t){if(!this.incremental&&!this.useHoverLayer)if("emphasis"===t){var i=this.__symbolOriginalScale,n=i[1]/i[0],r={scale:[Math.max(1.1*i[0],i[0]+3),Math.max(1.1*i[1],i[1]+3*n)]};this.animateTo(r,400,"elasticOut")}else"normal"===t&&this.animateTo({scale:this.__symbolOriginalScale},400,"elasticOut")}mT._updateCommon=function(e,t,i,n){var r=this.childAt(0),a=e.hostModel,o=e.getItemVisual(t,"color");"image"!==r.type?r.useStyle({strokeNoScale:!0}):r.setStyle({opacity:1,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,shadowColor:null});var s=n&&n.itemStyle,l=n&&n.hoverItemStyle,u=n&&n.symbolOffset,h=n&&n.labelModel,c=n&&n.hoverLabelModel,d=n&&n.hoverAnimation,f=n&&n.cursorStyle;if(!n||e.hasItemOption){var p=n&&n.itemModel?n.itemModel:e.getItemModel(t);s=p.getModel(xT).getItemStyle(["color"]),l=p.getModel(bT).getItemStyle(),u=p.getShallow("symbolOffset"),h=p.getModel(wT),c=p.getModel(TT),d=p.getShallow("hoverAnimation"),f=p.getShallow("cursor")}else l=hT.extend({},l);var g=r.style,m=e.getItemVisual(t,"symbolRotate");r.attr("rotation",(m||0)*Math.PI/180||0),u&&r.attr("position",[fT(u[0],i[0]),fT(u[1],i[1])]),f&&r.attr("cursor",f),r.setColor(o,n&&n.symbolInnerColor),r.setStyle(s);var v=e.getItemVisual(t,"opacity");null!=v&&(g.opacity=v);var y=e.getItemVisual(t,"liftZ"),_=r.__z2Origin;null!=y?null==_&&(r.__z2Origin=r.z2,r.z2+=y):null!=_&&(r.z2=_,r.__z2Origin=null);var x=n&&n.useNameLabel;dT.setLabelStyle(g,l,h,c,{labelFetcher:a,labelDataIndex:t,defaultText:function(t,i){return x?e.getName(t):pT(e,t)},isRectText:!0,autoColor:o}),r.__symbolOriginalScale=yT(i),r.hoverStyle=l,r.highDownOnUpdate=d&&a.isAnimationEnabled()?ST:null,dT.setHoverStyle(r)},mT.fadeOut=function(e,t){var i=this.childAt(0);this.silent=i.silent=!0,(!t||!t.keepLabel)&&(i.style.text=null),dT.updateProps(i,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,e)},hT.inherits(gT,dT.Group);var MT=gT,AT=yo,IT=MT,CT=l.isObject;function DT(e){this.group=new AT.Group,this._symbolCtor=e||IT}var ET=DT.prototype;function LT(e,t,i,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(i))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(i,"symbol")}function PT(e){return null==e||CT(e)||(e={isIgnore:e}),e||{}}function NT(e){var t=e.hostModel;return{itemStyle:t.getModel("itemStyle").getItemStyle(["color"]),hoverItemStyle:t.getModel("emphasis.itemStyle").getItemStyle(),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverAnimation:t.get("hoverAnimation"),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label"),cursorStyle:t.get("cursor")}}ET.updateData=function(e,t){t=PT(t);var i=this.group,n=e.hostModel,r=this._data,a=this._symbolCtor,o=NT(e);r||i.removeAll(),e.diff(r).add((function(n){var r=e.getItemLayout(n);if(LT(e,r,n,t)){var s=new a(e,n,o);s.attr("position",r),e.setItemGraphicEl(n,s),i.add(s)}})).update((function(s,l){var u=r.getItemGraphicEl(l),h=e.getItemLayout(s);LT(e,h,s,t)?(u?(u.updateData(e,s,o),AT.updateProps(u,{position:h},n)):(u=new a(e,s)).attr("position",h),i.add(u),e.setItemGraphicEl(s,u)):i.remove(u)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&t.fadeOut((function(){i.remove(t)}))})).execute(),this._data=e},ET.isPersistent=function(){return!0},ET.updateLayout=function(){var e=this._data;e&&e.eachItemGraphicEl((function(t,i){var n=e.getItemLayout(i);t.attr("position",n)}))},ET.incrementalPrepareUpdate=function(e){this._seriesScope=NT(e),this._data=null,this.group.removeAll()},ET.incrementalUpdate=function(e,t,i){function n(e){e.isGroup||(e.incremental=e.useHoverLayer=!0)}i=PT(i);for(var r=e.start;r<e.end;r++){var a=t.getItemLayout(r);if(LT(t,a,r,i)){var o=new this._symbolCtor(t,r,this._seriesScope);o.traverse(n),o.attr("position",a),this.group.add(o),t.setItemGraphicEl(r,o)}}},ET.remove=function(e){var t=this.group,i=this._data;i&&e?i.eachItemGraphicEl((function(e){e.fadeOut((function(){t.remove(e)}))})):t.removeAll()};var RT=DT,OT={},kT=A_.isDimensionStacked,zT=l.map;OT.prepareDataCoordInfo=function(e,t,i){var n,r=e.getBaseAxis(),a=e.getOtherAxis(r),o=function(e,t){var i=0,n=e.scale.getExtent();"start"===t?i=n[0]:"end"===t?i=n[1]:n[0]>0?i=n[0]:n[1]<0&&(i=n[1]);return i}(a,i),s=r.dim,l=a.dim,u=t.mapDimension(l),h=t.mapDimension(s),c="x"===l||"radius"===l?1:0,d=zT(e.dimensions,(function(e){return t.mapDimension(e)})),f=t.getCalculationInfo("stackResultDimension");return(n|=kT(t,d[0]))&&(d[0]=f),(n|=kT(t,d[1]))&&(d[1]=f),{dataDimsForPoint:d,valueStart:o,valueAxisDim:l,baseAxisDim:s,stacked:!!n,valueDim:u,baseDim:h,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}},OT.getStackedOnPoint=function(e,t,i,n){var r=NaN;e.stacked&&(r=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(r)&&(r=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=i.get(e.baseDim,n),o[1-a]=r,t.dataToPoint(o)};var BT=OT,FT=BT.prepareDataCoordInfo,VT=BT.getStackedOnPoint;var GT=function(e,t,i,n,r,a,o,s){for(var l=function(e,t){var i=[];return t.diff(e).add((function(e){i.push({cmd:"+",idx:e})})).update((function(e,t){i.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){i.push({cmd:"-",idx:e})})).execute(),i}(e,t),u=[],h=[],c=[],d=[],f=[],p=[],g=[],m=FT(r,t,o),v=FT(a,e,s),y=0;y<l.length;y++){var _=l[y],x=!0;switch(_.cmd){case"=":var b=e.getItemLayout(_.idx),w=t.getItemLayout(_.idx1);(isNaN(b[0])||isNaN(b[1]))&&(b=w.slice()),u.push(b),h.push(w),c.push(i[_.idx]),d.push(n[_.idx1]),g.push(t.getRawIndex(_.idx1));break;case"+":var T=_.idx;u.push(r.dataToPoint([t.get(m.dataDimsForPoint[0],T),t.get(m.dataDimsForPoint[1],T)])),h.push(t.getItemLayout(T).slice()),c.push(VT(m,r,t,T)),d.push(n[T]),g.push(t.getRawIndex(T));break;case"-":T=_.idx;var S=e.getRawIndex(T);S!==T?(u.push(e.getItemLayout(T)),h.push(a.dataToPoint([e.get(v.dataDimsForPoint[0],T),e.get(v.dataDimsForPoint[1],T)])),c.push(i[T]),d.push(VT(v,a,e,T)),g.push(S)):x=!1}x&&(f.push(_),p.push(p.length))}p.sort((function(e,t){return g[e]-g[t]}));var M=[],A=[],I=[],C=[],D=[];for(y=0;y<p.length;y++){T=p[y];M[y]=u[T],A[y]=h[T],I[y]=c[T],C[y]=d[T],D[y]=f[T]}return{current:M,next:A,stackedOnCurrent:I,stackedOnNext:C,status:D}},HT={},UT=Ys,WT=P,jT=Il,XT=WT.min,ZT=WT.max,qT=WT.scaleAndAdd,YT=WT.copy,KT=[],QT=[],JT=[];function $T(e){return isNaN(e[0])||isNaN(e[1])}function eS(e,t,i,n,r,a,o,s,l,u,h){return"none"!==u&&u?tS.apply(this,arguments):iS.apply(this,arguments)}function tS(e,t,i,n,r,a,o,s,l,u,h){for(var c=0,d=i,f=0;f<n;f++){var p=t[d];if(d>=r||d<0)break;if($T(p)){if(h){d+=a;continue}break}if(d===i)e[a>0?"moveTo":"lineTo"](p[0],p[1]);else if(l>0){var g=t[c],m="y"===u?1:0,v=(p[m]-g[m])*l;YT(QT,g),QT[m]=g[m]+v,YT(JT,p),JT[m]=p[m]-v,e.bezierCurveTo(QT[0],QT[1],JT[0],JT[1],p[0],p[1])}else e.lineTo(p[0],p[1]);c=d,d+=a}return f}function iS(e,t,i,n,r,a,o,s,l,u,h){for(var c=0,d=i,f=0;f<n;f++){var p=t[d];if(d>=r||d<0)break;if($T(p)){if(h){d+=a;continue}break}if(d===i)e[a>0?"moveTo":"lineTo"](p[0],p[1]),YT(QT,p);else if(l>0){var g=d+a,m=t[g];if(h)for(;m&&$T(t[g]);)m=t[g+=a];var v=.5,y=t[c];if(!(m=t[g])||$T(m))YT(JT,p);else{var _,x;if($T(m)&&!h&&(m=p),WT.sub(KT,m,y),"x"===u||"y"===u){var b="x"===u?0:1;_=Math.abs(p[b]-y[b]),x=Math.abs(p[b]-m[b])}else _=WT.dist(p,y),x=WT.dist(p,m);qT(JT,p,KT,-l*(1-(v=x/(x+_))))}XT(QT,QT,s),ZT(QT,QT,o),XT(JT,JT,s),ZT(JT,JT,o),e.bezierCurveTo(QT[0],QT[1],JT[0],JT[1],p[0],p[1]),qT(QT,p,KT,l*v)}else e.lineTo(p[0],p[1]);c=d,d+=a}return f}function nS(e,t){var i=[1/0,1/0],n=[-1/0,-1/0];if(t)for(var r=0;r<e.length;r++){var a=e[r];a[0]<i[0]&&(i[0]=a[0]),a[1]<i[1]&&(i[1]=a[1]),a[0]>n[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:t?i:n,max:t?n:i}}var rS=UT.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:jT(UT.prototype.brush),buildPath:function(e,t){var i=t.points,n=0,r=i.length,a=nS(i,t.smoothConstraint);if(t.connectNulls){for(;r>0&&$T(i[r-1]);r--);for(;n<r&&$T(i[n]);n++);}for(;n<r;)n+=eS(e,i,n,r,r,1,a.min,a.max,t.smooth,t.smoothMonotone,t.connectNulls)+1}}),aS=UT.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},brush:jT(UT.prototype.brush),buildPath:function(e,t){var i=t.points,n=t.stackedOnPoints,r=0,a=i.length,o=t.smoothMonotone,s=nS(i,t.smoothConstraint),l=nS(n,t.smoothConstraint);if(t.connectNulls){for(;a>0&&$T(i[a-1]);a--);for(;r<a&&$T(i[r]);r++);}for(;r<a;){var u=eS(e,i,r,a,a,1,s.min,s.max,t.smooth,o,t.connectNulls);eS(e,n,r+u-1,u,a,-1,l.min,l.max,t.stackedOnSmooth,o,t.connectNulls),r+=u+1,e.closePath()}}});HT.Polyline=rS,HT.Polygon=aS;var oS={},sS=yo,lS=wc.round;function uS(e,t,i){var n=e.getArea(),r=e.getBaseAxis().isHorizontal(),a=n.x,o=n.y,s=n.width,l=n.height,u=i.get("lineStyle.width")||2;a-=u/2,o-=u/2,s+=u,l+=u,a=Math.floor(a),s=Math.round(s);var h=new sS.Rect({shape:{x:a,y:o,width:s,height:l}});return t&&(h.shape[r?"width":"height"]=0,sS.initProps(h,{shape:{width:s,height:l}},i)),h}function hS(e,t,i){var n=e.getArea(),r=new sS.Sector({shape:{cx:lS(e.cx,1),cy:lS(e.cy,1),r0:lS(n.r0,1),r:lS(n.r,1),startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});return t&&(r.shape.endAngle=n.startAngle,sS.initProps(r,{shape:{endAngle:n.endAngle}},i)),r}oS.createGridClipPath=uS,oS.createPolarClipPath=hS,oS.createClipPath=function(e,t,i){return e?"polar"===e.type?hS(e,t,i):"cartesian2d"===e.type?uS(e,t,i):null:null};var cS=l,dS=Oo.fromPoints,fS=RT,pS=MT,gS=GT,mS=yo,vS=qa,yS=HT,_S=yS.Polyline,xS=yS.Polygon,bS=cm,wS=OT,TS=wS.prepareDataCoordInfo,SS=wS.getStackedOnPoint,MS=oS,AS=MS.createGridClipPath,IS=MS.createPolarClipPath;function CS(e,t){if(e.length===t.length){for(var i=0;i<e.length;i++){var n=e[i],r=t[i];if(n[0]!==r[0]||n[1]!==r[1])return}return!0}}function DS(e,t){var i=[],n=[],r=[],a=[];return dS(e,i,n),dS(t,r,a),Math.max(Math.abs(i[0]-r[0]),Math.abs(i[1]-r[1]),Math.abs(n[0]-a[0]),Math.abs(n[1]-a[1]))}function ES(e){return"number"==typeof e?e:e?.5:0}function LS(e,t,i){for(var n=t.getBaseAxis(),r="x"===n.dim||"radius"===n.dim?0:1,a=[],o=0;o<e.length-1;o++){var s=e[o+1],l=e[o];a.push(l);var u=[];switch(i){case"end":u[r]=s[r],u[1-r]=l[1-r],a.push(u);break;case"middle":var h=(l[r]+s[r])/2,c=[];u[r]=c[r]=h,u[1-r]=l[1-r],c[1-r]=s[1-r],a.push(u),a.push(c);break;default:u[r]=l[r],u[1-r]=s[1-r],a.push(u)}}return e[o]&&a.push(e[o]),a}function PS(e,t,i){var n=e.get("showAllSymbol"),r="auto"===n;if(!n||r){var a=i.getAxesByScale("ordinal")[0];if(a&&(!r||!function(e,t){var i=e.getExtent(),n=Math.abs(i[1]-i[0])/e.scale.count();isNaN(n)&&(n=0);for(var r=t.count(),a=Math.max(1,Math.round(r/5)),o=0;o<r;o+=a)if(1.5*pS.getSymbolSize(t,o)[e.isHorizontal()?1:0]>n)return!1;return!0}(a,t))){var o=t.mapDimension(a.dim),s={};return cS.each(a.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function NS(e,t,i){if("cartesian2d"===e.type){var n=e.getBaseAxis().isHorizontal(),r=AS(e,t,i);if(!i.get("clip",!0)){var a=r.shape,o=Math.max(a.width,a.height);n?(a.y-=o,a.height+=2*o):(a.x-=o,a.width+=2*o)}return r}return IS(e,t,i)}bS.extend({type:"line",init:function(){var e=new mS.Group,t=new fS;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},render:function(e,t,i){var n=e.coordinateSystem,r=this.group,a=e.getData(),o=e.getModel("lineStyle"),s=e.getModel("areaStyle"),l=a.mapArray(a.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,f=this._polygon,p=this._lineGroup,g=e.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(e,t,i){if(!i.valueDim)return[];for(var n=[],r=0,a=t.count();r<a;r++)n.push(SS(i,e,t,r));return n}(n,a,TS(n,a,v)),_=e.get("showSymbol"),x=_&&!u&&PS(e,a,n),b=this._data;b&&b.eachItemGraphicEl((function(e,t){e.__temp&&(r.remove(e),b.setItemGraphicEl(t,null))})),_||c.remove(),r.add(p);var w,T=!u&&e.get("step");n&&n.getArea&&e.get("clip",!0)&&(null!=(w=n.getArea()).width?(w.x-=.1,w.y-=.1,w.width+=.2,w.height+=.2):w.r0&&(w.r0-=.5,w.r1+=.5)),this._clipShapeForSymbol=w,d&&h.type===n.type&&T===this._step?(m&&!f?f=this._newPolygon(l,y,n,g):f&&!m&&(p.remove(f),f=this._polygon=null),p.setClipPath(NS(n,!1,e)),_&&c.updateData(a,{isIgnore:x,clipShape:w}),a.eachItemGraphicEl((function(e){e.stopAnimation(!0)})),CS(this._stackedOnPoints,y)&&CS(this._points,l)||(g?this._updateAnimation(a,y,n,i,T,v):(T&&(l=LS(l,n,T),y=LS(y,n,T)),d.setShape({points:l}),f&&f.setShape({points:l,stackedOnPoints:y})))):(_&&c.updateData(a,{isIgnore:x,clipShape:w}),T&&(l=LS(l,n,T),y=LS(y,n,T)),d=this._newPolyline(l,n,g),m&&(f=this._newPolygon(l,y,n,g)),p.setClipPath(NS(n,!0,e)));var S=function(e,t){var i=e.getVisual("visualMeta");if(i&&i.length&&e.count()&&"cartesian2d"===t.type){for(var n,r,a=i.length-1;a>=0;a--){var o=i[a].dimension,s=e.dimensions[o],l=e.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){r=i[a];break}}if(r){var u=t.getAxis(n),h=cS.map(r.stops,(function(e){return{coord:u.toGlobalCoord(u.dataToCoord(e.value)),color:e.color}})),c=h.length,d=r.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),d.reverse());var f=h[0].coord-10,p=h[c-1].coord+10,g=p-f;if(g<.001)return"transparent";cS.each(h,(function(e){e.offset=(e.coord-f)/g})),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new mS.LinearGradient(0,0,0,0,h,!0);return m[n]=f,m[n+"2"]=p,m}}}(a,n)||a.getVisual("color");d.useStyle(cS.defaults(o.getLineStyle(),{fill:"none",stroke:S,lineJoin:"bevel"}));var M=e.get("smooth");if(M=ES(e.get("smooth")),d.setShape({smooth:M,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")}),f){var A=a.getCalculationInfo("stackedOnSeries"),I=0;f.useStyle(cS.defaults(s.getAreaStyle(),{fill:S,opacity:.7,lineJoin:"bevel"})),A&&(I=ES(A.get("smooth"))),f.setShape({smooth:M,stackedOnSmooth:I,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")})}this._data=a,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=T,this._valueOrigin=v},dispose:function(){},highlight:function(e,t,i,n){var r=e.getData(),a=vS.queryDataIndex(r,n);if(!(a instanceof Array)&&null!=a&&a>=0){var o=r.getItemGraphicEl(a);if(!o){var s=r.getItemLayout(a);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(o=new pS(r,a)).position=s,o.setZ(e.get("zlevel"),e.get("z")),o.ignore=isNaN(s[0])||isNaN(s[1]),o.__temp=!0,r.setItemGraphicEl(a,o),o.stopSymbolAnimation(!0),this.group.add(o)}o.highlight()}else bS.prototype.highlight.call(this,e,t,i,n)},downplay:function(e,t,i,n){var r=e.getData(),a=vS.queryDataIndex(r,n);if(null!=a&&a>=0){var o=r.getItemGraphicEl(a);o&&(o.__temp?(r.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else bS.prototype.downplay.call(this,e,t,i,n)},_newPolyline:function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new _S({shape:{points:e},silent:!0,z2:10}),this._lineGroup.add(t),this._polyline=t,t},_newPolygon:function(e,t){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new xS({shape:{points:e,stackedOnPoints:t},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_updateAnimation:function(e,t,i,n,r,a){var o=this._polyline,s=this._polygon,l=e.hostModel,u=gS(this._data,e,this._stackedOnPoints,t,this._coordSys,i,this._valueOrigin,a),h=u.current,c=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;if(r&&(h=LS(u.current,i,r),c=LS(u.stackedOnCurrent,i,r),d=LS(u.next,i,r),f=LS(u.stackedOnNext,i,r)),DS(h,d)>3e3||s&&DS(c,f)>3e3)return o.setShape({points:d}),void(s&&s.setShape({points:d,stackedOnPoints:f}));o.shape.__points=u.current,o.shape.points=h,mS.updateProps(o,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),mS.updateProps(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;m<g.length;m++){if("="===g[m].cmd){var v=e.getItemGraphicEl(g[m].idx1);v&&p.push({el:v,ptIdx:m})}}o.animators&&o.animators.length&&o.animators[0].during((function(){for(var e=0;e<p.length;e++){p[e].el.attr("position",o.shape.__points[p[e].ptIdx])}}))},remove:function(e){var t=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl((function(e,n){e.__temp&&(t.remove(e),i.setItemGraphicEl(n,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._data=null}});var RS=l.isFunction;var OS=function(e,t,i){return{seriesType:e,performRawSeries:!0,reset:function(e,n,r){var a=e.getData(),o=e.get("symbol"),s=e.get("symbolSize"),l=e.get("symbolKeepAspect"),u=e.get("symbolRotate"),h=RS(o),c=RS(s),d=RS(u),f=h||c||d,p=!h&&o?o:t,g=c?null:s;if(a.setVisual({legendSymbol:i||p,symbol:p,symbolSize:g,symbolKeepAspect:l,symbolRotate:u}),!n.isSeriesFiltered(e))return{dataEach:a.hasItemOption||f?function(t,i){if(f){var n=e.getRawValue(i),r=e.getDataParams(i);h&&t.setItemVisual(i,"symbol",o(n,r)),c&&t.setItemVisual(i,"symbolSize",s(n,r)),d&&t.setItemVisual(i,"symbolRotate",u(n,r))}if(t.hasItemOption){var a=t.getItemModel(i),l=a.getShallow("symbol",!0),p=a.getShallow("symbolSize",!0),g=a.getShallow("symbolRotate",!0),m=a.getShallow("symbolKeepAspect",!0);null!=l&&t.setItemVisual(i,"symbol",l),null!=p&&t.setItemVisual(i,"symbolSize",p),null!=g&&t.setItemVisual(i,"symbolRotate",g),null!=m&&t.setItemVisual(i,"symbolKeepAspect",m)}}:null}}}},kS=l.map,zS=Zg,BS=A_.isDimensionStacked;var FS=function(e){return{seriesType:e,plan:zS(),reset:function(e){var t=e.getData(),i=e.coordinateSystem,n=e.pipelineContext.large;if(i){var r=kS(i.dimensions,(function(e){return t.mapDimension(e)})).slice(0,2),a=r.length,o=t.getCalculationInfo("stackResultDimension");return BS(t,r[0])&&(r[0]=o),BS(t,r[1])&&(r[1]=o),a&&{progress:function(e,t){for(var o=e.end-e.start,s=n&&new Float32Array(o*a),l=e.start,u=0,h=[],c=[];l<e.end;l++){var d;if(1===a){var f=t.get(r[0],l);d=!isNaN(f)&&i.dataToPoint(f,null,c)}else{f=h[0]=t.get(r[0],l);var p=h[1]=t.get(r[1],l);d=!isNaN(f)&&!isNaN(p)&&i.dataToPoint(h,null,c)}n?(s[u++]=d?d[0]:NaN,s[u++]=d?d[1]:NaN):t.setItemLayout(l,d&&d.slice()||[NaN,NaN])}n&&t.setLayout("symbolPoints",s)}}}}}},VS={average:function(e){for(var t=0,i=0,n=0;n<e.length;n++)isNaN(e[n])||(t+=e[n],i++);return 0===i?NaN:t/i},sum:function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i]||0;return t},max:function(e){for(var t=-1/0,i=0;i<e.length;i++)e[i]>t&&(t=e[i]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,i=0;i<e.length;i++)e[i]<t&&(t=e[i]);return isFinite(t)?t:NaN},nearest:function(e){return e[0]}},GS=function(e,t){return Math.round(e.length/2)};var HS=function(e){return{seriesType:e,modifyOutputEnd:!0,reset:function(e,t,i){var n=e.getData(),r=e.get("sampling"),a=e.coordinateSystem;if("cartesian2d"===a.type&&r){var o,s=a.getBaseAxis(),l=a.getOtherAxis(s),u=s.getExtent(),h=Math.abs(u[1]-u[0]),c=Math.round(n.count()/h);if(c>1)"string"==typeof r?o=VS[r]:"function"==typeof r&&(o=r),o&&e.setData(n.downSample(n.mapDimension(l.dim),1/c,o,GS))}}}},US=l;function WS(e){return this._axes[e]}var jS=function(e){this._axes={},this._dimList=[],this.name=e||""};jS.prototype={constructor:jS,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return US.map(this._dimList,WS,this)},getAxesByScale:function(e){return e=e.toLowerCase(),US.filter(this.getAxes(),(function(t){return t.scale.type===e}))},addAxis:function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},dataToCoord:function(e){return this._dataCoordConvert(e,"dataToCoord")},coordToData:function(e){return this._dataCoordConvert(e,"coordToData")},_dataCoordConvert:function(e,t){for(var i=this._dimList,n=e instanceof Array?[]:{},r=0;r<i.length;r++){var a=i[r],o=this._axes[a];n[a]=o[t](e[a])}return n}};var XS=l,ZS=wi,qS=jS;function YS(e){qS.call(this,e)}YS.prototype={constructor:YS,type:"cartesian2d",dimensions:["x","y"],getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},containPoint:function(e){var t=this.getAxis("x"),i=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&i.contain(i.toLocalCoord(e[1]))},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},dataToPoint:function(e,t,i){var n=this.getAxis("x"),r=this.getAxis("y");return(i=i||[])[0]=n.toGlobalCoord(n.dataToCoord(e[0])),i[1]=r.toGlobalCoord(r.dataToCoord(e[1])),i},clampData:function(e,t){var i=this.getAxis("x").scale,n=this.getAxis("y").scale,r=i.getExtent(),a=n.getExtent(),o=i.parse(e[0]),s=n.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),o),Math.max(r[0],r[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},pointToData:function(e,t){var i=this.getAxis("x"),n=this.getAxis("y");return(t=t||[])[0]=i.coordToData(i.toLocalCoord(e[0])),t[1]=n.coordToData(n.toLocalCoord(e[1])),t},getOtherAxis:function(e){return this.getAxis("x"===e.dim?"y":"x")},getArea:function(){var e=this.getAxis("x").getGlobalExtent(),t=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1]),n=Math.min(t[0],t[1]),r=Math.max(e[0],e[1])-i,a=Math.max(t[0],t[1])-n;return new ZS(i,n,r,a)}},XS.inherits(YS,qS);var KS=YS,QS=l,JS=Hw,$S=function(e,t,i,n,r){JS.call(this,e,t,i),this.type=n||"value",this.position=r||"bottom"};$S.prototype={constructor:$S,index:0,getAxesOnZeroOf:null,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},getGlobalExtent:function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},toLocalCoord:null,toGlobalCoord:null},QS.inherits($S,JS);var eM=$S,tM=l,iM={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},nM={};nM.categoryAxis=tM.merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},iM),nM.valueAxis=tM.merge({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},iM),nM.timeAxis=tM.defaults({scale:!0,min:"dataMin",max:"dataMax"},nM.valueAxis),nM.logAxis=tM.defaults({scale:!0,logBase:10},nM.valueAxis);var rM=nM,aM=l,oM=rM,sM=ud,lM=bc,uM=lM.getLayoutParams,hM=lM.mergeLayoutParam,cM=ix,dM=["value","category","time","log"];var fM=function(e,t,i,n){aM.each(dM,(function(r){t.extend({type:e+"Axis."+r,mergeDefaultAndTheme:function(t,n){var a=this.layoutMode,o=a?uM(t):{},s=n.getTheme();aM.merge(t,s.get(r+"Axis")),aM.merge(t,this.getDefaultOption()),t.type=i(e,t),a&&hM(t,o,a)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=cM.createByAxisModel(this))},getCategories:function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:aM.mergeAll([{},oM[r+"Axis"],n],!0)})})),sM.registerSubTypeDefaulter(e+"Axis",aM.curry(i,e))},pM=l,gM=fM,mM=Mb,vM=ud.extend({type:"cartesian2dAxis",axis:null,init:function(){vM.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){vM.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){vM.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function yM(e,t){return t.type||(t.data?"category":"value")}pM.merge(vM.prototype,mM);var _M={offset:0};gM("x",vM,yM,_M),gM("y",vM,yM,_M),ud.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var xM=l,bM=xM.isObject,wM=xM.each,TM=xM.map,SM=xM.indexOf;xM.retrieve;var MM=bc.getLayoutRect,AM=W_,IM=AM.createScaleByModel,CM=AM.ifAxisCrossZero,DM=AM.niceScaleExtent,EM=AM.estimateLabelUnionRect,LM=KS,PM=eM,NM=Bf,RM=A_.getStackedDimension;function OM(e,t,i){return e.getCoordSysModel()===t}function kM(e,t,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(e,t,i),this.model=e}var zM=kM.prototype;function BM(e,t,i,n){i.getAxesOnZeroOf=function(){return r?[r]:[]};var r,a=e[t],o=i.model,s=o.get("axisLine.onZero"),l=o.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)FM(a[l])&&(r=a[l]);else for(var u in a)if(a.hasOwnProperty(u)&&FM(a[u])&&!n[h(a[u])]){r=a[u];break}r&&(n[h(r)]=!0)}function h(e){return e.dim+"_"+e.index}}function FM(e){return e&&"category"!==e.type&&"time"!==e.type&&CM(e)}zM.type="grid",zM.axisPointerEnabled=!0,zM.getRect=function(){return this._rect},zM.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model),wM(i.x,(function(e){DM(e.scale,e.model)})),wM(i.y,(function(e){DM(e.scale,e.model)}));var n={};wM(i.x,(function(e){BM(i,"y",e,n)})),wM(i.y,(function(e){BM(i,"x",e,n)})),this.resize(this.model,t)},zM.resize=function(e,t,i){var n=MM(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});this._rect=n;var r=this._axesList;function a(){wM(r,(function(e){var t=e.isHorizontal(),i=t?[0,n.width]:[0,n.height],r=e.inverse?1:0;e.setExtent(i[r],i[1-r]),function(e,t){var i=e.getExtent(),n=i[0]+i[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return n-e+t}}(e,t?n.x:n.y)}))}a(),!i&&e.get("containLabel")&&(wM(r,(function(e){if(!e.model.get("axisLabel.inside")){var t=EM(e);if(t){var i=e.isHorizontal()?"height":"width",r=e.model.get("axisLabel.margin");n[i]-=t[i]+r,"top"===e.position?n.y+=t.height+r:"left"===e.position&&(n.x+=t.width+r)}}})),a())},zM.getAxis=function(e,t){var i=this._axesMap[e];if(null!=i){if(null==t)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[t]}},zM.getAxes=function(){return this._axesList.slice()},zM.getCartesian=function(e,t){if(null!=e&&null!=t){var i="x"+e+"y"+t;return this._coordsMap[i]}bM(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,r=this._coordsList;n<r.length;n++)if(r[n].getAxis("x").index===e||r[n].getAxis("y").index===t)return r[n]},zM.getCartesians=function(){return this._coordsList.slice()},zM.convertToPixel=function(e,t,i){var n=this._findConvertTarget(e,t);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},zM.convertFromPixel=function(e,t,i){var n=this._findConvertTarget(e,t);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},zM._findConvertTarget=function(e,t){var i,n,r=t.seriesModel,a=t.xAxisModel||r&&r.getReferringComponents("xAxis")[0],o=t.yAxisModel||r&&r.getReferringComponents("yAxis")[0],s=t.gridModel,l=this._coordsList;if(r)i=r.coordinateSystem,SM(l,i)<0&&(i=null);else if(a&&o)i=this.getCartesian(a.componentIndex,o.componentIndex);else if(a)n=this.getAxis("x",a.componentIndex);else if(o)n=this.getAxis("y",o.componentIndex);else if(s){s.coordinateSystem===this&&(i=this._coordsList[0])}return{cartesian:i,axis:n}},zM.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},zM._initCartesian=function(e,t,i){var n={left:!1,right:!1,top:!1,bottom:!1},r={x:{},y:{}},a={x:0,y:0};if(t.eachComponent("xAxis",o("x"),this),t.eachComponent("yAxis",o("y"),this),!a.x||!a.y)return this._axesMap={},void(this._axesList=[]);function o(t){return function(i,o){if(OM(i,e)){var s=i.get("position");"x"===t?"top"!==s&&"bottom"!==s&&(s=n.bottom?"top":"bottom"):"left"!==s&&"right"!==s&&(s=n.left?"right":"left"),n[s]=!0;var l=new PM(t,IM(i),[0,0],i.get("type"),s),u="category"===l.type;l.onBand=u&&i.get("boundaryGap"),l.inverse=i.get("inverse"),i.axis=l,l.model=i,l.grid=this,l.index=o,this._axesList.push(l),r[t][o]=l,a[t]++}}}this._axesMap=r,wM(r.x,(function(t,i){wM(r.y,(function(n,r){var a="x"+i+"y"+r,o=new LM(a);o.grid=this,o.model=e,this._coordsMap[a]=o,this._coordsList.push(o),o.addAxis(t),o.addAxis(n)}),this)}),this)},zM._updateScale=function(e,t){function i(e,t,i){wM(e.mapDimension(t.dim,!0),(function(i){t.scale.unionExtentFromData(e,RM(e,i))}))}wM(this._axesList,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeries((function(e){if(HM(e)){var n=GM(e),r=n[0],a=n[1];if(!OM(r,t)||!OM(a,t))return;var o=this.getCartesian(r.componentIndex,a.componentIndex),s=e.getData(),l=o.getAxis("x"),u=o.getAxis("y");"list"===s.type&&(i(s,l),i(s,u))}}),this)},zM.getTooltipAxes=function(e){var t=[],i=[];return wM(this.getCartesians(),(function(n){var r=null!=e&&"auto"!==e?n.getAxis(e):n.getBaseAxis(),a=n.getOtherAxis(r);SM(t,r)<0&&t.push(r),SM(i,a)<0&&i.push(a)})),{baseAxes:t,otherAxes:i}};var VM=["xAxis","yAxis"];function GM(e,t){return TM(VM,(function(t){return e.getReferringComponents(t)[0]}))}function HM(e){return"cartesian2d"===e.get("coordinateSystem")}kM.create=function(e,t){var i=[];return e.eachComponent("grid",(function(n,r){var a=new kM(n,e,t);a.name="grid_"+r,a.resize(n,t,!0),n.coordinateSystem=a,i.push(a)})),e.eachSeries((function(e){if(HM(e)){var t=GM(e),i=t[0],n=t[1],r=i.getCoordSysModel().coordinateSystem;e.coordinateSystem=r.getCartesian(i.componentIndex,n.componentIndex)}})),i},kM.dimensions=kM.prototype.dimensions=LM.prototype.dimensions,NM.register("cartesian2d",kM);var UM=l,WM=UM.retrieve,jM=UM.defaults,XM=UM.extend,ZM=UM.each,qM=Ac,YM=yo,KM=mc,QM=wc,JM=QM.isRadianAroundZero,$M=QM.remRadian,eA=Ab.createSymbol,tA=Re,iA=P.applyTransform,nA=W_.shouldShowAllLabels,rA=Math.PI,aA=function(e,t){this.opt=t,this.axisModel=e,jM(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new YM.Group;var i=new YM.Group({position:t.position.slice(),rotation:t.rotation});i.updateTransform(),this._transform=i.transform,this._dumbGroup=i};aA.prototype={constructor:aA,hasBuilder:function(e){return!!oA[e]},add:function(e){oA[e].call(this)},getGroup:function(){return this.group}};var oA={axisLine:function(){var e=this.opt,t=this.axisModel;if(t.get("axisLine.show")){var i=this.axisModel.axis.getExtent(),n=this._transform,r=[i[0],0],a=[i[1],0];n&&(iA(r,r,n),iA(a,a,n));var o=XM({lineCap:"round"},t.getModel("axisLine.lineStyle").getLineStyle());this.group.add(new YM.Line({anid:"line",subPixelOptimize:!0,shape:{x1:r[0],y1:r[1],x2:a[0],y2:a[1]},style:o,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1}));var s=t.get("axisLine.symbol"),l=t.get("axisLine.symbolSize"),u=t.get("axisLine.symbolOffset")||0;if("number"==typeof u&&(u=[u,u]),null!=s){"string"==typeof s&&(s=[s,s]),"string"!=typeof l&&"number"!=typeof l||(l=[l,l]);var h=l[0],c=l[1];ZM([{rotate:e.rotation+Math.PI/2,offset:u[0],r:0},{rotate:e.rotation-Math.PI/2,offset:u[1],r:Math.sqrt((r[0]-a[0])*(r[0]-a[0])+(r[1]-a[1])*(r[1]-a[1]))}],(function(t,i){if("none"!==s[i]&&null!=s[i]){var n=eA(s[i],-h/2,-c/2,h,c,o.stroke,!0),a=t.r+t.offset,l=[r[0]+a*Math.cos(e.rotation),r[1]-a*Math.sin(e.rotation)];n.attr({rotation:t.rotate,position:l,silent:!0,z2:11}),this.group.add(n)}}),this)}}},axisTickLabel:function(){var e=this.axisModel,t=this.opt,i=function(e,t,i){var n=t.axis,r=t.getModel("axisTick");if(!r.get("show")||n.scale.isBlank())return;for(var a=r.getModel("lineStyle"),o=i.tickDirection*r.get("length"),s=fA(n.getTicksCoords(),e._transform,o,jM(a.getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")}),"ticks"),l=0;l<s.length;l++)e.group.add(s[l]);return s}(this,e,t),n=function(e,t,i){var n=t.axis;if(!WM(i.axisLabelShow,t.get("axisLabel.show"))||n.scale.isBlank())return;var r=t.getModel("axisLabel"),a=r.get("margin"),o=n.getViewLabels(),s=(WM(i.labelRotate,r.get("rotate"))||0)*rA/180,l=lA(i.rotation,s,i.labelDirection),u=t.getCategories&&t.getCategories(!0),h=[],c=uA(t),d=t.get("triggerEvent");return ZM(o,(function(o,s){var f=o.tickValue,p=o.formattedLabel,g=o.rawLabel,m=r;u&&u[f]&&u[f].textStyle&&(m=new KM(u[f].textStyle,r,t.ecModel));var v=m.getTextColor()||t.get("axisLine.lineStyle.color"),y=[n.dataToCoord(f),i.labelOffset+i.labelDirection*a],_=new YM.Text({anid:"label_"+f,position:y,rotation:l.rotation,silent:c,z2:10});YM.setTextStyle(_.style,m,{text:p,textAlign:m.getShallow("align",!0)||l.textAlign,textVerticalAlign:m.getShallow("verticalAlign",!0)||m.getShallow("baseline",!0)||l.textVerticalAlign,textFill:"function"==typeof v?v("category"===n.type?g:"value"===n.type?f+"":f,s):v}),d&&(_.eventData=sA(t),_.eventData.targetType="axisLabel",_.eventData.value=g),e._dumbGroup.add(_),_.updateTransform(),h.push(_),e.group.add(_),_.decomposeTransform()})),h}(this,e,t);!function(e,t,i){if(nA(e.axis))return;var n=e.get("axisLabel.showMinLabel"),r=e.get("axisLabel.showMaxLabel");i=i||[];var a=(t=t||[])[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(hA(a),hA(u)):cA(a,o)&&(n?(hA(o),hA(h)):(hA(a),hA(u)));!1===r?(hA(s),hA(c)):cA(l,s)&&(r?(hA(l),hA(d)):(hA(s),hA(c)))}(e,n,i),function(e,t,i){var n=t.axis,r=t.getModel("minorTick");if(!r.get("show")||n.scale.isBlank())return;var a=n.getMinorTicksCoords();if(!a.length)return;for(var o=r.getModel("lineStyle"),s=i.tickDirection*r.get("length"),l=jM(o.getLineStyle(),jM(t.getModel("axisTick").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})),u=0;u<a.length;u++)for(var h=fA(a[u],e._transform,s,l,"minorticks_"+u),c=0;c<h.length;c++)e.group.add(h[c])}(this,e,t)},axisName:function(){var e=this.opt,t=this.axisModel,i=WM(e.axisName,t.get("name"));if(i){var n,r,a=t.get("nameLocation"),o=e.nameDirection,s=t.getModel("nameTextStyle"),l=t.get("nameGap")||0,u=this.axisModel.axis.getExtent(),h=u[0]>u[1]?-1:1,c=["start"===a?u[0]-h*l:"end"===a?u[1]+h*l:(u[0]+u[1])/2,dA(a)?e.labelOffset+o*l:0],d=t.get("nameRotate");null!=d&&(d=d*rA/180),dA(a)?n=lA(e.rotation,null!=d?d:e.rotation,o):(n=function(e,t,i,n){var r,a,o=$M(i-e.rotation),s=n[0]>n[1],l="start"===t&&!s||"start"!==t&&s;JM(o-rA/2)?(a=l?"bottom":"top",r="center"):JM(o-1.5*rA)?(a=l?"top":"bottom",r="center"):(a="middle",r=o<1.5*rA&&o>rA/2?l?"left":"right":l?"right":"left");return{rotation:o,textAlign:r,textVerticalAlign:a}}(e,a,d||0,u),null!=(r=e.axisNameAvailableWidth)&&(r=Math.abs(r/Math.sin(n.rotation)),!isFinite(r)&&(r=null)));var f=s.getFont(),p=t.get("nameTruncate",!0)||{},g=p.ellipsis,m=WM(e.nameTruncateMaxWidth,p.maxWidth,r),v=null!=g&&null!=m?qM.truncateText(i,m,f,g,{minChar:2,placeholder:p.placeholder}):i,y=t.get("tooltip",!0),_=t.mainType,x={componentType:_,name:i,$vars:["name"]};x[_+"Index"]=t.componentIndex;var b=new YM.Text({anid:"name",__fullText:i,__truncatedText:v,position:c,rotation:n.rotation,silent:uA(t),z2:1,tooltip:y&&y.show?XM({content:i,formatter:function(){return i},formatterParams:x},y):null});YM.setTextStyle(b.style,s,{text:v,textFont:f,textFill:s.getTextColor()||t.get("axisLine.lineStyle.color"),textAlign:s.get("align")||n.textAlign,textVerticalAlign:s.get("verticalAlign")||n.textVerticalAlign}),t.get("triggerEvent")&&(b.eventData=sA(t),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},sA=aA.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},lA=aA.innerTextLayout=function(e,t,i){var n,r,a=$M(t-e);return JM(a)?(r=i>0?"top":"bottom",n="center"):JM(a-rA)?(r=i>0?"bottom":"top",n="center"):(r="middle",n=a>0&&a<rA?i>0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:r}};var uA=aA.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)};function hA(e){e&&(e.ignore=!0)}function cA(e,t,i){var n=e&&e.getBoundingRect().clone(),r=t&&t.getBoundingRect().clone();if(n&&r){var a=tA.identity([]);return tA.rotate(a,a,-e.rotation),n.applyTransform(tA.mul([],a,e.getLocalTransform())),r.applyTransform(tA.mul([],a,t.getLocalTransform())),n.intersect(r)}}function dA(e){return"middle"===e||"center"===e}function fA(e,t,i,n,r){for(var a=[],o=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=i,t&&(iA(o,o,t),iA(s,s,t));var h=new YM.Line({anid:r+"_"+e[l].tickValue,subPixelOptimize:!0,shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:n,z2:2,silent:!0});a.push(h)}return a}var pA=aA,gA={},mA=l,vA=mc,yA=mA.each,_A=mA.curry;function xA(e,t){return"all"===e||mA.isArray(e)&&mA.indexOf(e,t)>=0||e===t}function bA(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[TA(e)]}function wA(e){return!!e.get("handle.show")}function TA(e){return e.type+"||"+e.id}gA.collect=function(e,t){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(e,t,i){var n=t.getComponent("tooltip"),r=t.getComponent("axisPointer"),a=r.get("link",!0)||[],o=[];yA(i.getCoordinateSystems(),(function(i){if(i.axisPointerEnabled){var s=TA(i.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=i;var u=i.model.getModel("tooltip",n);if(yA(i.getAxes(),_A(f,!1,null)),i.getTooltipAxes&&n&&u.get("show")){var h="axis"===u.get("trigger"),c="cross"===u.get("axisPointer.type"),d=i.getTooltipAxes(u.get("axisPointer.axis"));(h||c)&&yA(d.baseAxes,_A(f,!c||"cross",h)),c&&yA(d.otherAxes,_A(f,"cross",!1))}}function f(n,s,h){var c=h.model.getModel("axisPointer",r),d=c.get("show");if(d&&("auto"!==d||n||wA(c))){null==s&&(s=c.get("triggerTooltip")),c=n?function(e,t,i,n,r,a){var o=t.getModel("axisPointer"),s={};yA(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=mA.clone(o.get(e))})),s.snap="category"!==e.type&&!!a,"cross"===o.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===r){var u=o.get("label.show");if(l.show=null==u||u,!a){var h=s.lineStyle=o.get("crossStyle");h&&mA.defaults(l,h.textStyle)}}return e.model.getModel("axisPointer",new vA(s,i,n))}(h,u,r,t,n,s):c;var f=c.get("snap"),p=TA(h.model),g=s||f||"category"===h.type,m=e.axesInfo[p]={key:p,axis:h,coordSys:i,axisPointerModel:c,triggerTooltip:s,involveSeries:g,snap:f,useHandle:wA(c),seriesModels:[]};l[p]=m,e.seriesInvolved|=g;var v=function(e,t){for(var i=t.model,n=t.dim,r=0;r<e.length;r++){var a=e[r]||{};if(xA(a[n+"AxisId"],i.id)||xA(a[n+"AxisIndex"],i.componentIndex)||xA(a[n+"AxisName"],i.name))return r}}(a,h);if(null!=v){var y=o[v]||(o[v]={axesInfo:{}});y.axesInfo[p]=m,y.mapper=a[v].mapper,m.linkGroup=y}}}}))}(i,e,t),i.seriesInvolved&&function(e,t){t.eachSeries((function(t){var i=t.coordinateSystem,n=t.get("tooltip.trigger",!0),r=t.get("tooltip.show",!0);i&&"none"!==n&&!1!==n&&"item"!==n&&!1!==r&&!1!==t.get("axisPointer.show",!0)&&yA(e.coordSysAxesInfo[TA(i.model)],(function(e){var n=e.axis;i.getAxis(n.dim)===n&&(e.seriesModels.push(t),null==e.seriesDataCount&&(e.seriesDataCount=0),e.seriesDataCount+=t.getData().count())}))}),this)}(i,e),i},gA.fixValue=function(e){var t=bA(e);if(t){var i=t.axisPointerModel,n=t.axis.scale,r=i.option,a=i.get("status"),o=i.get("value");null!=o&&(o=n.parse(o));var s=wA(i);null==a&&(r.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),r.value=o,s&&(r.status=t.axis.scale.isBlank()?"hide":"show")}},gA.getAxisInfo=bA,gA.getAxisPointerModel=function(e){var t=bA(e);return t&&t.axisPointerModel},gA.makeKey=TA;var SA=gA,MA=n.extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(e,t,i,n){this.axisPointerClass&&SA.fixValue(e),MA.superApply(this,"render",arguments),AA(this,e,t,i,n,!0)},updateAxisPointer:function(e,t,i,n,r){AA(this,e,t,i,n,!1)},remove:function(e,t){var i=this._axisPointer;i&&i.remove(t),MA.superApply(this,"remove",arguments)},dispose:function(e,t){IA(this,t),MA.superApply(this,"dispose",arguments)}});function AA(e,t,i,n,r,a){var o=MA.getAxisPointerClass(e.axisPointerClass);if(o){var s=SA.getAxisPointerModel(t);s?(e._axisPointer||(e._axisPointer=new o)).render(t,s,n,a):IA(e,n)}}function IA(e,t,i){var n=e._axisPointer;n&&n.dispose(t,i),e._axisPointer=null}var CA=[];MA.registerAxisPointerClass=function(e,t){CA[e]=t},MA.getAxisPointerClass=function(e){return e&&CA[e]};var DA=MA,EA={},LA=l;EA.layout=function(e,t,i){i=i||{};var n=e.coordinateSystem,r=t.axis,a={},o=r.getAxesOnZeroOf()[0],s=r.position,l=o?"onZero":s,u=r.dim,h=n.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],d={left:0,right:1,top:0,bottom:1,onZero:2},f=t.get("offset")||0,p="x"===u?[c[2]-f,c[3]+f]:[c[0]-f,c[1]+f];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));p[d.onZero]=Math.max(Math.min(g,p[1]),p[0])}a.position=["y"===u?p[d[l]]:c[0],"x"===u?p[d[l]]:c[3]],a.rotation=Math.PI/2*("x"===u?0:1),a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],a.labelOffset=o?p[d[s]]-p[d.onZero]:0,t.get("axisTick.inside")&&(a.tickDirection=-a.tickDirection),LA.retrieve(i.labelInside,t.get("axisLabel.inside"))&&(a.labelDirection=-a.labelDirection);var m=t.get("axisLabel.rotate");return a.labelRotate="top"===l?-m:m,a.z2=1,a};var PA={},NA=l,RA=yo;PA.rectCoordAxisBuildSplitArea=function(e,t,i,n){var r=i.axis;if(!r.scale.isBlank()){var a=i.getModel("splitArea"),o=a.getModel("areaStyle"),s=o.get("color"),l=n.coordinateSystem.getRect(),u=r.getTicksCoords({tickModel:a,clamp:!0});if(u.length){var h=s.length,c=e.__splitAreaColors,d=NA.createHashMap(),f=0;if(c)for(var p=0;p<u.length;p++){var g=c.get(u[p].tickValue);if(null!=g){f=(g+(h-1)*p)%h;break}}var m=r.toGlobalCoord(u[0].coord),v=o.getAreaStyle();s=NA.isArray(s)?s:[s];for(p=1;p<u.length;p++){var y,_,x,b,w=r.toGlobalCoord(u[p].coord);r.isHorizontal()?(y=m,_=l.y,x=w-y,b=l.height,m=y+x):(y=l.x,_=m,x=l.width,m=_+(b=w-_));var T=u[p-1].tickValue;null!=T&&d.set(T,f),t.add(new RA.Rect({anid:null!=T?"area_"+T:null,shape:{x:y,y:_,width:x,height:b},style:NA.defaults({fill:s[f]},v),silent:!0})),f=(f+1)%h}e.__splitAreaColors=d}}},PA.rectCoordAxisHandleRemove=function(e){e.__splitAreaColors=null};var OA=l,kA=yo,zA=pA,BA=DA,FA=EA,VA=PA,GA=VA.rectCoordAxisBuildSplitArea,HA=VA.rectCoordAxisHandleRemove,UA=["axisLine","axisTickLabel","axisName"],WA=["splitArea","splitLine","minorSplitLine"],jA=BA.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(e,t,i,n){this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new kA.Group,this.group.add(this._axisGroup),e.get("show")){var a=e.getCoordSysModel(),o=FA.layout(a,e),s=new zA(e,o);OA.each(UA,s.add,s),this._axisGroup.add(s.getGroup()),OA.each(WA,(function(t){e.get(t+".show")&&this["_"+t](e,a)}),this),kA.groupTransition(r,this._axisGroup,e),jA.superCall(this,"render",e,t,i,n)}},remove:function(){HA(this)},_splitLine:function(e,t){var i=e.axis;if(!i.scale.isBlank()){var n=e.getModel("splitLine"),r=n.getModel("lineStyle"),a=r.get("color");a=OA.isArray(a)?a:[a];for(var o=t.coordinateSystem.getRect(),s=i.isHorizontal(),l=0,u=i.getTicksCoords({tickModel:n}),h=[],c=[],d=r.getLineStyle(),f=0;f<u.length;f++){var p=i.toGlobalCoord(u[f].coord);s?(h[0]=p,h[1]=o.y,c[0]=p,c[1]=o.y+o.height):(h[0]=o.x,h[1]=p,c[0]=o.x+o.width,c[1]=p);var g=l++%a.length,m=u[f].tickValue;this._axisGroup.add(new kA.Line({anid:null!=m?"line_"+u[f].tickValue:null,subPixelOptimize:!0,shape:{x1:h[0],y1:h[1],x2:c[0],y2:c[1]},style:OA.defaults({stroke:a[g]},d),silent:!0}))}}},_minorSplitLine:function(e,t){var i=e.axis,n=e.getModel("minorSplitLine").getModel("lineStyle"),r=t.coordinateSystem.getRect(),a=i.isHorizontal(),o=i.getMinorTicksCoords();if(o.length)for(var s=[],l=[],u=n.getLineStyle(),h=0;h<o.length;h++)for(var c=0;c<o[h].length;c++){var d=i.toGlobalCoord(o[h][c].coord);a?(s[0]=d,s[1]=r.y,l[0]=d,l[1]=r.y+r.height):(s[0]=r.x,s[1]=d,l[0]=r.x+r.width,l[1]=d),this._axisGroup.add(new kA.Line({anid:"minor_line_"+o[h][c].tickValue,subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,silent:!0}))}},_splitArea:function(e,t){GA(this,this._axisGroup,e,t)}});jA.extend({type:"xAxis"}),jA.extend({type:"yAxis"});var XA=n,ZA=l,qA=yo;XA.extendComponentView({type:"grid",render:function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new qA.Rect({shape:e.coordinateSystem.getRect(),style:ZA.defaults({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))}}),XA.registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})}));var YA=n,KA=OS,QA=FS,JA=HS;YA.registerVisual(KA("line","circle","line")),YA.registerLayout(QA("line")),YA.registerProcessor(YA.PRIORITY.PROCESSOR.STATISTIC,JA("line"));var $A=U_,eI=Fg.extend({type:"series.__base_bar__",getInitialData:function(e,t){return $A(this.getSource(),this,{useEncodeDefaulter:!0})},getMarkerPosition:function(e){var t=this.coordinateSystem;if(t){var i=t.dataToPoint(t.clampData(e)),n=this.getData(),r=n.getLayout("offset"),a=n.getLayout("size");return i[t.getBaseAxis().isHorizontal()?0:1]+=r+a/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});eI.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},defaultOption:{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1}}});var tI={},iI=yo,nI=lT.getDefaultLabel;function rI(e,t){"outside"===e.textPosition&&(e.textPosition=t)}tI.setLabel=function(e,t,i,n,r,a,o){var s=i.getModel("label"),l=i.getModel("emphasis.label");iI.setLabelStyle(e,t,s,l,{labelFetcher:r,labelDataIndex:a,defaultText:nI(r.getData(),a),isRectText:!0,autoColor:n}),rI(e),rI(t)};var aI=fo([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),oI={getBarItemStyle:function(e){var t=aI(this,e);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(t.lineDash=i)}return t}},sI=(0,yo.extendShape)({type:"sausage",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},buildPath:function(e,t){var i=t.cx,n=t.cy,r=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=.5*(a-r),s=r+o,l=t.startAngle,u=t.endAngle,h=t.clockwise,c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);(h?u-l<2*Math.PI:l-u<2*Math.PI)&&(e.moveTo(c*r+i,d*r+n),e.arc(c*s+i,d*s+n,o,-Math.PI+l,l,!h)),e.arc(i,n,a,l,u,!h),e.moveTo(f*a+i,p*a+n),e.arc(f*s+i,p*s+n,o,u-2*Math.PI,u-Math.PI,!h),0!==r&&(e.arc(i,n,r,u,l,h),e.moveTo(c*r+i,p*r+n)),e.closePath()}}),lI=n,uI=l,hI=yo,cI=tI.setLabel,dI=mc,fI=oI,pI=Ys,gI=Ii,mI=dm.throttle,vI=oS.createClipPath,yI=sI,_I=["itemStyle","barBorderWidth"],xI=[0,0];uI.extend(dI.prototype,fI),lI.extendChartView({type:"bar",render:function(e,t,i){this._updateDrawMode(e);var n=e.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||(this._isLargeDraw?this._renderLarge(e,t,i):this._renderNormal(e,t,i)),this.group},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._incrementalRenderLarge(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e,t,i){var n,r=this.group,a=e.getData(),o=this._data,s=e.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=e.isAnimationEnabled()?e:null,h=e.get("clip",!0),c=function(e,t){var i=e.getArea&&e.getArea();if("cartesian2d"===e.type){var n=e.getBaseAxis();if("category"!==n.type||!n.onBand){var r=t.getLayout("bandWidth");n.isHorizontal()?(i.x-=r,i.width+=2*r):(i.y-=r,i.height+=2*r)}}return i}(s,a);r.removeClipPath();var d=e.get("roundCap",!0),f=e.get("showBackground",!0),p=e.getModel("backgroundStyle"),g=p.get("barBorderRadius")||0,m=[],v=this._backgroundEls||[],y=function(e){var t=II[s.type](a,e),i=function(e,t,i){return new("polar"===e.type?hI.Sector:hI.Rect)({shape:NI(t,i,e),silent:!0,z2:0})}(s,n,t);return i.useStyle(p.getBarItemStyle()),"cartesian2d"===s.type&&i.setShape("r",g),m[e]=i,i};a.diff(o).add((function(t){var i=a.getItemModel(t),o=II[s.type](a,t,i);if(f&&y(t),a.hasValue(t)){if(h)if(TI[s.type](c,o))return void r.remove(l);var l=SI[s.type](t,o,n,u,!1,d);a.setItemGraphicEl(t,l),r.add(l),DI(l,a,t,i,o,e,n,"polar"===s.type)}})).update((function(t,i){var l=a.getItemModel(t),_=II[s.type](a,t,l);if(f){var x;0===v.length?x=y(i):((x=v[i]).useStyle(p.getBarItemStyle()),"cartesian2d"===s.type&&x.setShape("r",g),m[t]=x);var b=II[s.type](a,t),w=NI(n,b,s);hI.updateProps(x,{shape:w},u,t)}var T=o.getItemGraphicEl(i);if(a.hasValue(t)){if(h)if(TI[s.type](c,_))return void r.remove(T);T?hI.updateProps(T,{shape:_},u,t):T=SI[s.type](t,_,n,u,!0,d),a.setItemGraphicEl(t,T),r.add(T),DI(T,a,t,l,_,e,n,"polar"===s.type)}else r.remove(T)})).remove((function(e){var t=o.getItemGraphicEl(e);"cartesian2d"===s.type?t&&MI(e,u,t):t&&AI(e,u,t)})).execute();var _=this._backgroundGroup||(this._backgroundGroup=new gI);_.removeAll();for(var x=0;x<m.length;++x)_.add(m[x]);r.add(_),this._backgroundEls=m,this._data=a},_renderLarge:function(e,t,i){this._clear(),LI(e,this.group);var n=e.get("clip",!0)?vI(e.coordinateSystem,!1,e):null;n?this.group.setClipPath(n):this.group.removeClipPath()},_incrementalRenderLarge:function(e,t){this._removeBackground(),LI(t,this.group,!0)},dispose:uI.noop,remove:function(e){this._clear(e)},_clear:function(e){var t=this.group,i=this._data;e&&e.get("animation")&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl((function(t){"sector"===t.type?AI(t.dataIndex,e,t):MI(t.dataIndex,e,t)}))):t.removeAll(),this._data=null},_removeBackground:function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null}});var bI=Math.max,wI=Math.min,TI={cartesian2d:function(e,t){var i=t.width<0?-1:1,n=t.height<0?-1:1;i<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var r=bI(t.x,e.x),a=wI(t.x+t.width,e.x+e.width),o=bI(t.y,e.y),s=wI(t.y+t.height,e.y+e.height);t.x=r,t.y=o,t.width=a-r,t.height=s-o;var l=t.width<0||t.height<0;return i<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),l},polar:function(e,t){var i=t.r0<=t.r?1:-1;if(i<0){var n=t.r;t.r=t.r0,t.r0=n}n=wI(t.r,e.r);var r=bI(t.r0,e.r0);t.r=n,t.r0=r;var a=n-r<0;if(i<0){n=t.r;t.r=t.r0,t.r0=n}return a}},SI={cartesian2d:function(e,t,i,n,r){var a=new hI.Rect({shape:uI.extend({},t),z2:1});if(a.name="item",n){var o=i?"height":"width",s={};a.shape[o]=0,s[o]=t[o],hI[r?"updateProps":"initProps"](a,{shape:s},n,e)}return a},polar:function(e,t,i,n,r,a){var o=t.startAngle<t.endAngle,s=new(!i&&a?yI:hI.Sector)({shape:uI.defaults({clockwise:o},t),z2:1});if(s.name="item",n){var l=i?"r":"endAngle",u={};s.shape[l]=i?0:t.startAngle,u[l]=t[l],hI[r?"updateProps":"initProps"](s,{shape:u},n,e)}return s}};function MI(e,t,i){i.style.text=null,hI.updateProps(i,{shape:{width:0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}function AI(e,t,i){i.style.text=null,hI.updateProps(i,{shape:{r:i.shape.r0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}var II={cartesian2d:function(e,t,i){var n=e.getItemLayout(t),r=i?function(e,t){var i=e.get(_I)||0,n=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),r=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(i,n,r)}(i,n):0,a=n.width>0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*r/2,y:n.y+o*r/2,width:n.width-a*r,height:n.height-o*r}},polar:function(e,t,i){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};function CI(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function DI(e,t,i,n,r,a,o,s){var l=t.getItemVisual(i,"color"),u=t.getItemVisual(i,"opacity"),h=t.getVisual("borderColor"),c=n.getModel("itemStyle"),d=n.getModel("emphasis.itemStyle").getBarItemStyle();s||e.setShape("r",c.get("barBorderRadius")||0),e.useStyle(uI.defaults({stroke:CI(r)?"none":h,fill:CI(r)?"none":l,opacity:u},c.getBarItemStyle()));var f=n.getShallow("cursor");f&&e.attr("cursor",f);var p=o?r.height>0?"bottom":"top":r.width>0?"left":"right";s||cI(e.style,d,n,l,a,i,p),CI(r)&&(d.fill=d.stroke="none"),hI.setHoverStyle(e,d)}var EI=pI.extend({type:"largeBar",shape:{points:[]},buildPath:function(e,t){for(var i=t.points,n=this.__startPoint,r=this.__baseDimIdx,a=0;a<i.length;a+=2)n[r]=i[a+r],e.moveTo(n[0],n[1]),e.lineTo(i[a],i[a+1])}});function LI(e,t,i){var n=e.getData(),r=[],a=n.getLayout("valueAxisHorizontal")?1:0;r[1-a]=n.getLayout("valueAxisStart");var o=n.getLayout("largeDataIndices"),s=n.getLayout("barWidth"),l=e.getModel("backgroundStyle");if(e.get("showBackground",!0)){var u=n.getLayout("largeBackgroundPoints"),h=[];h[1-a]=n.getLayout("backgroundStart");var c=new EI({shape:{points:u},incremental:!!i,__startPoint:h,__baseDimIdx:a,__largeDataIndices:o,__barWidth:s,silent:!0,z2:0});!function(e,t,i){var n=t.get("borderColor")||t.get("color"),r=t.getItemStyle(["color","borderColor"]);e.useStyle(r),e.style.fill=null,e.style.stroke=n,e.style.lineWidth=i.getLayout("barWidth")}(c,l,n),t.add(c)}var d=new EI({shape:{points:n.getLayout("largePoints")},incremental:!!i,__startPoint:r,__baseDimIdx:a,__largeDataIndices:o,__barWidth:s});t.add(d),function(e,t,i){var n=i.getVisual("borderColor")||i.getVisual("color"),r=t.getModel("itemStyle").getItemStyle(["color","borderColor"]);e.useStyle(r),e.style.fill=null,e.style.stroke=n,e.style.lineWidth=i.getLayout("barWidth")}(d,e,n),d.seriesIndex=e.seriesIndex,e.get("silent")||(d.on("mousedown",PI),d.on("mousemove",PI))}var PI=mI((function(e){var t=function(e,t,i){var n=e.__baseDimIdx,r=1-n,a=e.shape.points,o=e.__largeDataIndices,s=Math.abs(e.__barWidth/2),l=e.__startPoint[r];xI[0]=t,xI[1]=i;for(var u=xI[n],h=xI[1-n],c=u-s,d=u+s,f=0,p=a.length/2;f<p;f++){var g=2*f,m=a[g+n],v=a[g+r];if(m>=c&&m<=d&&(l<=v?h>=l&&h<=v:h>=v&&h<=l))return o[f]}return-1}(this,e.offsetX,e.offsetY);this.dataIndex=t>=0?t:null}),30,!1);function NI(e,t,i){var n,r="polar"===i.type;return n=r?i.getArea():i.grid.getRect(),r?{cx:n.cx,cy:n.cy,r0:e?n.r0:t.r0,r:e?n.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}:{x:e?t.x:n.x,y:e?n.y:t.y,width:e?t.width:n.width,height:e?n.height:t.height}}var RI=n,OI=l,kI=Tx,zI=kI.layout,BI=kI.largeLayout;RI.registerLayout(RI.PRIORITY.VISUAL.LAYOUT,OI.curry(zI,"bar")),RI.registerLayout(RI.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,BI),RI.registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}});var FI=y_,VI=Jy,GI=l,HI=GI.extend,UI=GI.isArray;var WI=function(e,t,i){t=UI(t)&&{coordDimensions:t}||HI({},t);var n=e.getSource(),r=FI(n,t),a=new VI(r,e);return a.initData(n,i),a},jI=l,XI={updateSelectedMap:function(e){this._targetList=jI.isArray(e)?e.slice():[],this._selectTargetMap=jI.reduce(e||[],(function(e,t){return e.set(t.name,t),e}),jI.createHashMap())},select:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);"single"===this.get("selectedMode")&&this._selectTargetMap.each((function(e){e.selected=!1})),i&&(i.selected=!0)},unSelect:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);i&&(i.selected=!1)},toggleSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);if(null!=i)return this[i.selected?"unSelect":"select"](e,t),i.selected},isSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);return i&&i.selected}};var ZI=function(e,t){this.getAllNames=function(){var e=t();return e.mapArray(e.getName)},this.containName=function(e){return t().indexOfName(e)>=0},this.indexOfName=function(t){return e().indexOfName(t)},this.getItemVisual=function(t,i){return e().getItemVisual(t,i)}},qI=n,YI=WI,KI=l,QI=qa,JI=wc.getPercentWithPrecision,$I=XI,eC=Mp.retrieveRawAttr,tC=yd.makeSeriesEncodeForNameBased,iC=ZI,nC=qI.extendSeriesModel({type:"series.pie",init:function(e){nC.superApply(this,"init",arguments),this.legendVisualProvider=new iC(KI.bind(this.getData,this),KI.bind(this.getRawData,this)),this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(e)},mergeOption:function(e){nC.superCall(this,"mergeOption",e),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(e,t){return YI(this,{coordDimensions:["value"],encodeDefaulter:KI.curry(tC,this)})},_createSelectableList:function(){for(var e=this.getRawData(),t=e.mapDimension("value"),i=[],n=0,r=e.count();n<r;n++)i.push({name:e.getName(n),value:e.get(t,n),selected:eC(e,n,"selected")});return i},getDataParams:function(e){var t=this.getData(),i=nC.superCall(this,"getDataParams",e),n=[];return t.each(t.mapDimension("value"),(function(e){n.push(e)})),i.percent=JI(n,e,t.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},_defaultLabelLine:function(e){QI.defaultEmphasis(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,hoverOffset:10,avoidLabelOverlap:!0,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:!1,show:!0,position:"outer",alignTo:"none",margin:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},animationType:"expansion",animationTypeUpdate:"transition",animationEasing:"cubicOut"}});KI.mixin(nC,$I);var rC=l,aC=yo,oC=cm;function sC(e,t,i,n){var r=t.getData(),a=this.dataIndex,o=r.getName(a),s=t.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:e,name:o,seriesId:t.id}),r.each((function(e){lC(r.getItemGraphicEl(e),r.getItemLayout(e),t.isSelected(r.getName(e)),s,i)}))}function lC(e,t,i,n,r){var a=(t.startAngle+t.endAngle)/2,o=i?n:0,s=[Math.cos(a)*o,Math.sin(a)*o];r?e.animate().when(200,{position:s}).start("bounceOut"):e.attr("position",s)}function uC(e,t){aC.Group.call(this);var i=new aC.Sector({z2:2}),n=new aC.Polyline,r=new aC.Text;this.add(i),this.add(n),this.add(r),this.updateData(e,t,!0)}var hC=uC.prototype;hC.updateData=function(e,t,i){var n=this.childAt(0),r=this.childAt(1),a=this.childAt(2),o=e.hostModel,s=e.getItemModel(t),l=e.getItemLayout(t),u=rC.extend({},l);u.label=null;var h=o.getShallow("animationTypeUpdate");i?(n.setShape(u),"scale"===o.getShallow("animationType")?(n.shape.r=l.r0,aC.initProps(n,{shape:{r:l.r}},o,t)):(n.shape.endAngle=l.startAngle,aC.updateProps(n,{shape:{endAngle:l.endAngle}},o,t))):"expansion"===h?n.setShape(u):aC.updateProps(n,{shape:u},o,t);var c=e.getItemVisual(t,"color");n.useStyle(rC.defaults({lineJoin:"bevel",fill:c},s.getModel("itemStyle").getItemStyle())),n.hoverStyle=s.getModel("emphasis.itemStyle").getItemStyle();var d=s.getShallow("cursor");d&&n.attr("cursor",d),lC(this,e.getItemLayout(t),o.isSelected(e.getName(t)),o.get("selectedOffset"),o.get("animation"));var f=!i&&"transition"===h;this._updateLabel(e,t,f),this.highDownOnUpdate=o.get("silent")?null:function(e,t){var i=o.isAnimationEnabled()&&s.get("hoverAnimation");"emphasis"===t?(r.ignore=r.hoverIgnore,a.ignore=a.hoverIgnore,i&&(n.stopAnimation(!0),n.animateTo({shape:{r:l.r+o.get("hoverOffset")}},300,"elasticOut"))):(r.ignore=r.normalIgnore,a.ignore=a.normalIgnore,i&&(n.stopAnimation(!0),n.animateTo({shape:{r:l.r}},300,"elasticOut")))},aC.setHoverStyle(this)},hC._updateLabel=function(e,t,i){var n=this.childAt(1),r=this.childAt(2),a=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"color");if(!s||isNaN(s.x)||isNaN(s.y))r.ignore=r.normalIgnore=r.hoverIgnore=n.ignore=n.normalIgnore=n.hoverIgnore=!0;else{var u={points:s.linePoints||[[s.x,s.y],[s.x,s.y],[s.x,s.y]]},h={x:s.x,y:s.y};i?(aC.updateProps(n,{shape:u},a,t),aC.updateProps(r,{style:h},a,t)):(n.attr({shape:u}),r.attr({style:h})),r.attr({rotation:s.rotation,origin:[s.x,s.y],z2:10});var c=o.getModel("label"),d=o.getModel("emphasis.label"),f=o.getModel("labelLine"),p=o.getModel("emphasis.labelLine");l=e.getItemVisual(t,"color");aC.setLabelStyle(r.style,r.hoverStyle={},c,d,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:s.text,autoColor:l,useInsideStyle:!!s.inside},{textAlign:s.textAlign,textVerticalAlign:s.verticalAlign,opacity:e.getItemVisual(t,"opacity")}),r.ignore=r.normalIgnore=!c.get("show"),r.hoverIgnore=!d.get("show"),n.ignore=n.normalIgnore=!f.get("show"),n.hoverIgnore=!p.get("show"),n.setStyle({stroke:l,opacity:e.getItemVisual(t,"opacity")}),n.setStyle(f.getModel("lineStyle").getLineStyle()),n.hoverStyle=p.getModel("lineStyle").getLineStyle();var g=f.get("smooth");g&&!0===g&&(g=.4),n.setShape({smooth:g})}},rC.inherits(uC,aC.Group),oC.extend({type:"pie",init:function(){var e=new aC.Group;this._sectorGroup=e},render:function(e,t,i,n){if(!n||n.from!==this.uid){var r=e.getData(),a=this._data,o=this.group,s=t.get("animation"),l=!a,u=e.get("animationType"),h=e.get("animationTypeUpdate"),c=rC.curry(sC,this.uid,e,s,i),d=e.get("selectedMode");if(r.diff(a).add((function(e){var t=new uC(r,e);l&&"scale"!==u&&t.eachChild((function(e){e.stopAnimation(!0)})),d&&t.on("click",c),r.setItemGraphicEl(e,t),o.add(t)})).update((function(e,t){var i=a.getItemGraphicEl(t);l||"transition"===h||i.eachChild((function(e){e.stopAnimation(!0)})),i.updateData(r,e),i.off("click"),d&&i.on("click",c),o.add(i),r.setItemGraphicEl(e,i)})).remove((function(e){var t=a.getItemGraphicEl(e);o.remove(t)})).execute(),s&&r.count()>0&&(l?"scale"!==u:"transition"!==h)){for(var f=r.getItemLayout(0),p=1;isNaN(f.startAngle)&&p<r.count();++p)f=r.getItemLayout(p);var g=Math.max(i.getWidth(),i.getHeight())/2,m=rC.bind(o.removeClipPath,o);o.setClipPath(this._createClipPath(f.cx,f.cy,g,f.startAngle,f.clockwise,m,e,l))}else o.removeClipPath();this._data=r}},dispose:function(){},_createClipPath:function(e,t,i,n,r,a,o,s){var l=new aC.Sector({shape:{cx:e,cy:t,r0:0,r:i,startAngle:n,endAngle:n,clockwise:r}});return(s?aC.initProps:aC.updateProps)(l,{shape:{endAngle:n+(r?1:-1)*Math.PI*2}},o,a),l},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,r=e[1]-i.cy,a=Math.sqrt(n*n+r*r);return a<=i.r&&a>=i.r0}}});var cC=n,dC=l;var fC=function(e,t){dC.each(t,(function(t){t.update="updateView",cC.registerAction(t,(function(i,n){var r={};return n.eachComponent({mainType:"series",subType:e,query:i},(function(e){e[t.method]&&e[t.method](i.name,i.dataIndex);var n=e.getData();n.each((function(t){var i=n.getName(t);r[i]=e.isSelected(i)||!1}))})),{name:i.name,selected:r,seriesId:i.seriesId}}))}))},pC=l.createHashMap;var gC=function(e){return{getTargetSeries:function(t){var i={},n=pC();return t.eachSeriesByType(e,(function(e){e.__paletteScope=i,n.set(e.uid,e)})),n},reset:function(e,t){var i=e.getRawData(),n={},r=e.getData();r.each((function(e){var t=r.getRawIndex(e);n[t]=e})),i.each((function(t){var a,o=n[t],s=null!=o&&r.getItemVisual(o,"color",!0),l=null!=o&&r.getItemVisual(o,"borderColor",!0);if(s&&l||(a=i.getItemModel(t)),!s){var u=a.get("itemStyle.color")||e.getColorFromPalette(i.getName(t)||t+"",e.__paletteScope,i.count());null!=o&&r.setItemVisual(o,"color",u)}if(!l){var h=a.get("itemStyle.borderColor");null!=o&&r.setItemVisual(o,"borderColor",h)}}))}}},mC=fn,vC=wc.parsePercent,yC=Math.PI/180;function _C(e,t,i,n,r,a,o,s,l,u){function h(t,i,n,r){for(var a=t;a<i&&!(e[a].y+n>l+o);a++)if(e[a].y+=n,a>t&&a+1<i&&e[a+1].y>e[a].y+e[a].height)return void c(a,n/2);c(i-1,n/2)}function c(t,i){for(var n=t;n>=0&&!(e[n].y-i<l)&&(e[n].y-=i,!(n>0&&e[n].y>e[n-1].y+e[n-1].height));n--);}function d(e,t,i,n,r,a){for(var o=t?Number.MAX_VALUE:0,s=0,l=e.length;s<l;s++)if("none"===e[s].labelAlignTo){var u=Math.abs(e[s].y-n),h=e[s].len,c=e[s].len2,d=u<r+h?Math.sqrt((r+h+c)*(r+h+c)-u*u):Math.abs(e[s].x-i);t&&d>=o&&(d=o-10),!t&&d<=o&&(d=o+10),e[s].x=i+d*a,o=d}}e.sort((function(e,t){return e.y-t.y}));for(var f,p=0,g=e.length,m=[],v=[],y=0;y<g;y++){if("outer"===e[y].position&&"labelLine"===e[y].labelAlignTo){var _=e[y].x-u;e[y].linePoints[1][0]+=_,e[y].x=u}(f=e[y].y-p)<0&&h(y,g,-f),p=e[y].y+e[y].height}o-p<0&&c(g-1,p-o);for(y=0;y<g;y++)e[y].y>=i?v.push(e[y]):m.push(e[y]);d(m,!1,t,i,n,r),d(v,!0,t,i,n,r)}function xC(e){return"center"===e.position}var bC=function(e,t,i,n,r,a){var o,s,l=e.getData(),u=[],h=!1,c=(e.get("minShowLabelAngle")||0)*yC;l.each((function(n){var a=l.getItemLayout(n),d=l.getItemModel(n),f=d.getModel("label"),p=f.get("position")||d.get("emphasis.label.position"),g=f.get("distanceToLabelLine"),m=f.get("alignTo"),v=vC(f.get("margin"),i),y=f.get("bleedMargin"),_=f.getFont(),x=d.getModel("labelLine"),b=x.get("length");b=vC(b,i);var w=x.get("length2");if(w=vC(w,i),!(a.angle<c)){var T,S,M,A,I=(a.startAngle+a.endAngle)/2,C=Math.cos(I),D=Math.sin(I);o=a.cx,s=a.cy;var E,L=e.getFormattedLabel(n,"normal")||l.getName(n),P=mC.getBoundingRect(L,_,A,"top"),N="inside"===p||"inner"===p;if("center"===p)T=a.cx,S=a.cy,A="center";else{var R=(N?(a.r+a.r0)/2*C:a.r*C)+o,O=(N?(a.r+a.r0)/2*D:a.r*D)+s;if(T=R+3*C,S=O+3*D,!N){var k=R+C*(b+t-a.r),z=O+D*(b+t-a.r),B=k+(C<0?-1:1)*w;T="edge"===m?C<0?r+v:r+i-v:B+(C<0?-g:g),S=z,M=[[R,O],[k,z],[B,z]]}A=N?"center":"edge"===m?C>0?"right":"left":C>0?"left":"right"}var F=f.get("rotate");E="number"==typeof F?F*(Math.PI/180):F?C<0?-I+Math.PI:-I:0,h=!!E,a.label={x:T,y:S,position:p,height:P.height,len:b,len2:w,linePoints:M,textAlign:A,verticalAlign:"middle",rotation:E,inside:N,labelDistance:g,labelAlignTo:m,labelMargin:v,bleedMargin:y,textRect:P,text:L,font:_},N||u.push(a.label)}})),!h&&e.get("avoidLabelOverlap")&&function(e,t,i,n,r,a,o,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0;d<e.length;d++)xC(e[d])||(e[d].x<t?(h=Math.min(h,e[d].x),l.push(e[d])):(c=Math.max(c,e[d].x),u.push(e[d])));for(_C(u,t,i,n,1,0,a,0,s,c),_C(l,t,i,n,-1,0,a,0,s,h),d=0;d<e.length;d++){var f=e[d];if(!xC(f)){var p=f.linePoints;if(p){var g,m="edge"===f.labelAlignTo,v=f.textRect.width;(g=m?f.x<t?p[2][0]-f.labelDistance-o-f.labelMargin:o+r-f.labelMargin-p[2][0]-f.labelDistance:f.x<t?f.x-o-f.bleedMargin:o+r-f.x-f.bleedMargin)<f.textRect.width&&(f.text=mC.truncateText(f.text,g,f.font),"edge"===f.labelAlignTo&&(v=mC.getWidth(f.text,f.font)));var y=p[1][0]-p[2][0];m?f.x<t?p[2][0]=o+f.labelMargin+v+f.labelDistance:p[2][0]=o+r-f.labelMargin-v-f.labelDistance:(f.x<t?p[2][0]=f.x+f.labelDistance:p[2][0]=f.x-f.labelDistance,p[1][0]=p[2][0]+y),p[1][1]=p[2][1]=f.y}}}}(u,o,s,t,i,n,r,a)},wC=wc,TC=wC.parsePercent,SC=wC.linearMap,MC=bc,AC=bC,IC=l,CC=2*Math.PI,DC=Math.PI/180;var EC=function(e){return{seriesType:e,reset:function(e,t){var i=t.findComponents({mainType:"legend"});if(i&&i.length){var n=e.getData();n.filterSelf((function(e){for(var t=n.getName(e),r=0;r<i.length;r++)if(!i[r].isSelected(t))return!1;return!0}))}}}},LC=n,PC=l,NC=gC,RC=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),n=t.mapDimension("value"),r=function(e,t){return MC.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,i),a=e.get("center"),o=e.get("radius");IC.isArray(o)||(o=[0,o]),IC.isArray(a)||(a=[a,a]);var s=TC(r.width,i.getWidth()),l=TC(r.height,i.getHeight()),u=Math.min(s,l),h=TC(a[0],s)+r.x,c=TC(a[1],l)+r.y,d=TC(o[0],u/2),f=TC(o[1],u/2),p=-e.get("startAngle")*DC,g=e.get("minAngle")*DC,m=0;t.each(n,(function(e){!isNaN(e)&&m++}));var v=t.getSum(n),y=Math.PI/(v||m)*2,_=e.get("clockwise"),x=e.get("roseType"),b=e.get("stillShowZeroSum"),w=t.getDataExtent(n);w[0]=0;var T=CC,S=0,M=p,A=_?1:-1;if(t.each(n,(function(e,i){var n;if(isNaN(e))t.setItemLayout(i,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:h,cy:c,r0:d,r:x?NaN:f,viewRect:r});else{(n="area"!==x?0===v&&b?y:e*y:CC/m)<g?(n=g,T-=g):S+=e;var a=M+A*n;t.setItemLayout(i,{angle:n,startAngle:M,endAngle:a,clockwise:_,cx:h,cy:c,r0:d,r:x?SC(e,w,[d,f]):f,viewRect:r}),M=a}})),T<CC&&m)if(T<=.001){var I=CC/m;t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i);n.angle=I,n.startAngle=p+A*i*I,n.endAngle=p+A*(i+1)*I}}))}else y=T/S,M=p,t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i),r=n.angle===g?g:e*y;n.startAngle=M,n.endAngle=M+A*r,M+=A*r}}));AC(e,f,r.width,r.height,r.x,r.y)}))},OC=EC;fC("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),LC.registerVisual(NC("pie")),LC.registerLayout(PC.curry(RC,"pie")),LC.registerProcessor(OC("pie"));var kC=U_;Fg.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(e,t){return kC(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},clip:!0}});var zC=yo,BC=Ab.createSymbol,FC=Vu,VC=zC.extendShape({shape:{points:null},symbolProxy:null,softClipShape:null,buildPath:function(e,t){var i=t.points,n=t.size,r=this.symbolProxy,a=r.shape;if(!((e.getContext?e.getContext():e)&&n[0]<4))for(var o=0;o<i.length;){var s=i[o++],l=i[o++];isNaN(s)||isNaN(l)||(this.softClipShape&&!this.softClipShape.contain(s,l)||(a.x=s-n[0]/2,a.y=l-n[1]/2,a.width=n[0],a.height=n[1],r.buildPath(e,a,!0)))}},afterBrush:function(e){var t=this.shape,i=t.points,n=t.size;if(n[0]<4){this.setTransform(e);for(var r=0;r<i.length;){var a=i[r++],o=i[r++];isNaN(a)||isNaN(o)||(this.softClipShape&&!this.softClipShape.contain(a,o)||e.fillRect(a-n[0]/2,o-n[1]/2,n[0],n[1]))}this.restoreTransform(e)}},findDataIndex:function(e,t){for(var i=this.shape,n=i.points,r=i.size,a=Math.max(r[0],4),o=Math.max(r[1],4),s=n.length/2-1;s>=0;s--){var l=2*s,u=n[l]-a/2,h=n[l+1]-o/2;if(e>=u&&t>=h&&e<=u+a&&t<=h+o)return s}return-1}});function GC(){this.group=new zC.Group}var HC=GC.prototype;HC.isPersistent=function(){return!this._incremental},HC.updateData=function(e,t){this.group.removeAll();var i=new VC({rectHover:!0,cursor:"default"});i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!1,t),this.group.add(i),this._incremental=null},HC.updateLayout=function(e){if(!this._incremental){var t=e.getLayout("symbolPoints");this.group.eachChild((function(e){if(null!=e.startIndex){var i=2*(e.endIndex-e.startIndex),n=4*e.startIndex*2;t=new Float32Array(t.buffer,n,i)}e.setShape("points",t)}))}},HC.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new FC({silent:!0})),this.group.add(this._incremental)):this._incremental=null},HC.incrementalUpdate=function(e,t,i){var n;this._incremental?(n=new VC,this._incremental.addDisplayable(n,!0)):((n=new VC({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end})).incremental=!0,this.group.add(n)),n.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(n,t,!!this._incremental,i)},HC._setCommon=function(e,t,i,n){var r=t.hostModel;n=n||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=n.clipShape||null,e.symbolProxy=BC(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("color");s&&e.setColor(s),i||(e.seriesIndex=r.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>=0&&(e.dataIndex=i+(e.startIndex||0))})))},HC.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},HC._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var UC=RT,WC=GC,jC=FS;n.extendChartView({type:"scatter",render:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).updateData(n,{clipShape:this._getClipShape(e)}),this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(e,t,i){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var r=jC().reset(e);r.progress&&r.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_getClipShape:function(e){var t=e.coordinateSystem,i=t&&t.getArea&&t.getArea();return e.get("clip",!0)?i:null},_updateSymbolDraw:function(e,t){var i=this._symbolDraw,n=t.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new WC:new UC,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}});var XC=n,ZC=OS,qC=FS;XC.registerVisual(ZC("scatter","circle")),XC.registerLayout(qC("scatter"));var YC=Hw;function KC(e,t,i){YC.call(this,e,t,i),this.type="value",this.angle=0,this.name="",this.model}l.inherits(KC,YC);var QC=l,JC=KC,$C=bx,eD=wc,tD=W_,iD=tD.getScaleExtent,nD=tD.niceScaleExtent,rD=Bf,aD=ub;function oD(e,t,i){this._model=e,this.dimensions=[],this._indicatorAxes=QC.map(e.getIndicatorModels(),(function(e,t){var i="indicator_"+t,n=new JC(i,"log"===e.get("axisType")?new aD:new $C);return n.name=e.get("name"),n.model=e,e.axis=n,this.dimensions.push(i),n}),this),this.resize(e,i),this.cx,this.cy,this.r,this.r0,this.startAngle}oD.prototype.getIndicatorAxes=function(){return this._indicatorAxes},oD.prototype.dataToPoint=function(e,t){var i=this._indicatorAxes[t];return this.coordToPoint(i.dataToCoord(e),t)},oD.prototype.coordToPoint=function(e,t){var i=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(i),this.cy-e*Math.sin(i)]},oD.prototype.pointToData=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=Math.sqrt(t*t+i*i);t/=n,i/=n;for(var r,a=Math.atan2(-i,t),o=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],h=Math.abs(a-u.angle);h<o&&(r=u,s=l,o=h)}return[s,+(r&&r.coordToData(n))]},oD.prototype.resize=function(e,t){var i=e.get("center"),n=t.getWidth(),r=t.getHeight(),a=Math.min(n,r)/2;this.cx=eD.parsePercent(i[0],n),this.cy=eD.parsePercent(i[1],r),this.startAngle=e.get("startAngle")*Math.PI/180;var o=e.get("radius");"string"!=typeof o&&"number"!=typeof o||(o=[0,o]),this.r0=eD.parsePercent(o[0],a),this.r=eD.parsePercent(o[1],a),QC.each(this._indicatorAxes,(function(e,t){e.setExtent(this.r0,this.r);var i=this.startAngle+t*Math.PI*2/this._indicatorAxes.length;i=Math.atan2(Math.sin(i),Math.cos(i)),e.angle=i}),this)},oD.prototype.update=function(e,t){var i=this._indicatorAxes,n=this._model;QC.each(i,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeriesByType("radar",(function(t,r){if("radar"===t.get("coordinateSystem")&&e.getComponent("radar",t.get("radarIndex"))===n){var a=t.getData();QC.each(i,(function(e){e.scale.unionExtentFromData(a,a.mapDimension(e.dim))}))}}),this);var r=n.get("splitNumber");function a(e){var t=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),i=e/t;return 2===i?i=5:i*=2,i*t}QC.each(i,(function(e,t){var i=iD(e.scale,e.model).extent;nD(e.scale,e.model);var n=e.model,o=e.scale,s=n.getMin(),l=n.getMax(),u=o.getInterval();if(null!=s&&null!=l)o.setExtent(+s,+l),o.setInterval((l-s)/r);else if(null!=s){do{h=s+u*r,o.setExtent(+s,h),o.setInterval(u),u=a(u)}while(h<i[1]&&isFinite(h)&&isFinite(i[1]))}else if(null!=l){do{c=l-u*r,o.setExtent(c,+l),o.setInterval(u),u=a(u)}while(c>i[0]&&isFinite(c)&&isFinite(i[0]))}else{o.getTicks().length-1>r&&(u=a(u));var h=Math.ceil(i[1]/u)*u,c=eD.round(h-u*r);o.setExtent(c,h),o.setInterval(u)}}))},oD.dimensions=[],oD.create=function(e,t){var i=[];return e.eachComponent("radar",(function(n){var r=new oD(n,e,t);i.push(r),n.coordinateSystem=r})),e.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("radarIndex")||0])})),i},rD.register("radar",oD);var sD=n,lD=l,uD=mc,hD=Mb,cD=rM.valueAxis;function dD(e,t){return lD.defaults({show:t},e)}sD.extendComponentModel({type:"radar",optionUpdated:function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),i=this.get("scale"),n=this.get("axisLine"),r=this.get("axisTick"),a=this.get("axisType"),o=this.get("axisLabel"),s=this.get("name"),l=this.get("name.show"),u=this.get("name.formatter"),h=this.get("nameGap"),c=this.get("triggerEvent"),d=lD.map(this.get("indicator")||[],(function(d){null!=d.max&&d.max>0&&!d.min?d.min=0:null!=d.min&&d.min<0&&!d.max&&(d.max=0);var f=s;if(null!=d.color&&(f=lD.defaults({color:d.color},s)),d=lD.merge(lD.clone(d),{boundaryGap:e,splitNumber:t,scale:i,axisLine:n,axisTick:r,axisType:a,axisLabel:o,name:d.text,nameLocation:"end",nameGap:h,nameTextStyle:f,triggerEvent:c},!1),l||(d.name=""),"string"==typeof u){var p=d.name;d.name=u.replace("{value}",null!=p?p:"")}else"function"==typeof u&&(d.name=u(d.name,d));var g=lD.extend(new uD(d,null,this.ecModel),hD);return g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this.getIndicatorModels=function(){return d}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:lD.merge({lineStyle:{color:"#bbb"}},cD.axisLine),axisLabel:dD(cD.axisLabel,!1),axisTick:dD(cD.axisTick,!1),axisType:"interval",splitLine:dD(cD.splitLine,!0),splitArea:dD(cD.splitArea,!0),indicator:[]}});var fD=l,pD=pA,gD=yo,mD=["axisLine","axisTickLabel","axisName"];n.extendComponentView({type:"radar",render:function(e,t,i){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},_buildAxes:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes(),n=fD.map(i,(function(e){return new pD(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}));fD.each(n,(function(e){fD.each(mD,e.add,e),this.group.add(e.getGroup())}),this)},_buildSplitLineAndArea:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes();if(i.length){var n=e.get("shape"),r=e.getModel("splitLine"),a=e.getModel("splitArea"),o=r.getModel("lineStyle"),s=a.getModel("areaStyle"),l=r.get("show"),u=a.get("show"),h=o.get("color"),c=s.get("color");h=fD.isArray(h)?h:[h],c=fD.isArray(c)?c:[c];var d=[],f=[];if("circle"===n)for(var p=i[0].getTicksCoords(),g=t.cx,m=t.cy,v=0;v<p.length;v++){if(l)d[M(d,h,v)].push(new gD.Circle({shape:{cx:g,cy:m,r:p[v].coord}}));if(u&&v<p.length-1)f[M(f,c,v)].push(new gD.Ring({shape:{cx:g,cy:m,r0:p[v].coord,r:p[v+1].coord}}))}else{var y,_=fD.map(i,(function(e,i){var n=e.getTicksCoords();return y=null==y?n.length-1:Math.min(n.length-1,y),fD.map(n,(function(e){return t.coordToPoint(e.coord,i)}))})),x=[];for(v=0;v<=y;v++){for(var b=[],w=0;w<i.length;w++)b.push(_[w][v]);if(b[0]&&b.push(b[0].slice()),l)d[M(d,h,v)].push(new gD.Polyline({shape:{points:b}}));if(u&&x)f[M(f,c,v-1)].push(new gD.Polygon({shape:{points:b.concat(x)}}));x=b.slice().reverse()}}var T=o.getLineStyle(),S=s.getAreaStyle();fD.each(f,(function(e,t){this.group.add(gD.mergePath(e,{style:fD.defaults({stroke:"none",fill:c[t%c.length]},S),silent:!0}))}),this),fD.each(d,(function(e,t){this.group.add(gD.mergePath(e,{style:fD.defaults({fill:"none",stroke:h[t%h.length]},T),silent:!0}))}),this)}function M(e,t,i){var n=i%t.length;return e[n]=e[n]||[],n}}});var vD=Fg,yD=WI,_D=l,xD=Ac.encodeHTML,bD=ZI,wD=vD.extend({type:"series.radar",dependencies:["radar"],init:function(e){wD.superApply(this,"init",arguments),this.legendVisualProvider=new bD(_D.bind(this.getData,this),_D.bind(this.getRawData,this))},getInitialData:function(e,t){return yD(this,{generateCoord:"indicator_",generateCoordCount:1/0})},formatTooltip:function(e,t,i,n){var r=this.getData(),a=this.coordinateSystem.getIndicatorAxes(),o=this.getData().getName(e),s="html"===n?"<br/>":"\n";return xD(""===o?this.name:o)+s+_D.map(a,(function(t,i){var n=r.get(r.mapDimension(t.dim),e);return xD(t.name+" : "+n)})).join(s)},getTooltipPosition:function(e){if(null!=e)for(var t=this.getData(),i=this.coordinateSystem,n=t.getValues(_D.map(i.dimensions,(function(e){return t.mapDimension(e)})),e,!0),r=0,a=n.length;r<a;r++)if(!isNaN(n[r])){var o=i.getIndicatorAxes();return i.coordToPoint(o[r].dataToCoord(n[r]),r)}},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}}),TD=yo,SD=l,MD=Ab;n.extendChartView({type:"radar",render:function(e,t,i){var n=e.coordinateSystem,r=this.group,a=e.getData(),o=this._data;function s(e,t){var i=e.getItemVisual(t,"symbol")||"circle",n=e.getItemVisual(t,"color");if("none"!==i){var r=function(e){return SD.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),a=MD.createSymbol(i,-1,-1,2,2,n),o=e.getItemVisual(t,"symbolRotate")||0;return a.attr({style:{strokeNoScale:!0},z2:100,scale:[r[0]/2,r[1]/2],rotation:o*Math.PI/180||0}),a}}function l(t,i,n,r,a,o){n.removeAll();for(var l=0;l<i.length-1;l++){var u=s(r,a);u&&(u.__dimIdx=l,t[l]?(u.attr("position",t[l]),TD[o?"initProps":"updateProps"](u,{position:i[l]},e,a)):u.attr("position",i[l]),n.add(u))}}function u(e){return SD.map(e,(function(e){return[n.cx,n.cy]}))}a.diff(o).add((function(t){var i=a.getItemLayout(t);if(i){var n=new TD.Polygon,r=new TD.Polyline,o={shape:{points:i}};n.shape.points=u(i),r.shape.points=u(i),TD.initProps(n,o,e,t),TD.initProps(r,o,e,t);var s=new TD.Group,h=new TD.Group;s.add(r),s.add(n),s.add(h),l(r.shape.points,i,h,a,t,!0),a.setItemGraphicEl(t,s)}})).update((function(t,i){var n=o.getItemGraphicEl(i),r=n.childAt(0),s=n.childAt(1),u=n.childAt(2),h={shape:{points:a.getItemLayout(t)}};h.shape.points&&(l(r.shape.points,h.shape.points,u,a,t,!1),TD.updateProps(r,h,e),TD.updateProps(s,h,e),a.setItemGraphicEl(t,n))})).remove((function(e){r.remove(o.getItemGraphicEl(e))})).execute(),a.eachItemGraphicEl((function(e,t){var i=a.getItemModel(t),n=e.childAt(0),o=e.childAt(1),s=e.childAt(2),l=a.getItemVisual(t,"color");r.add(e),n.useStyle(SD.defaults(i.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:l})),n.hoverStyle=i.getModel("emphasis.lineStyle").getLineStyle();var u=i.getModel("areaStyle"),h=i.getModel("emphasis.areaStyle"),c=u.isEmpty()&&u.parentModel.isEmpty(),d=h.isEmpty()&&h.parentModel.isEmpty();d=d&&c,o.ignore=c,o.useStyle(SD.defaults(u.getAreaStyle(),{fill:l,opacity:.7})),o.hoverStyle=h.getAreaStyle();var f=i.getModel("itemStyle").getItemStyle(["color"]),p=i.getModel("emphasis.itemStyle").getItemStyle(),g=i.getModel("label"),m=i.getModel("emphasis.label");s.eachChild((function(e){e.setStyle(f),e.hoverStyle=SD.clone(p);var i=a.get(a.dimensions[e.__dimIdx],t);(null==i||isNaN(i))&&(i=""),TD.setLabelStyle(e.style,e.hoverStyle,g,m,{labelFetcher:a.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:i,autoColor:l,isRectText:!0})})),e.highDownOnUpdate=function(e,t){o.attr("ignore","emphasis"===t?d:c)},TD.setHoverStyle(e)})),this._data=a},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var AD=l;function ID(e){return!isNaN(e[0])&&!isNaN(e[1])}function CD(e){return[e.cx,e.cy]}var DD=function(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),i=[],n=e.coordinateSystem;if(n){var r=n.getIndicatorAxes();AD.each(r,(function(e,a){t.each(t.mapDimension(r[a].dim),(function(e,t){i[t]=i[t]||[];var r=n.dataToPoint(e,a);i[t][a]=ID(r)?r:CD(n)}))})),t.each((function(e){var r=AD.find(i[e],(function(e){return ID(e)}))||CD(n);i[e].push(r.slice()),t.setItemLayout(e,i[e])}))}}))},ED=l;var LD=n,PD=gC,ND=OS,RD=DD,OD=EC,kD=function(e){var t=e.polar;if(t){ED.isArray(t)||(t=[t]);var i=[];ED.each(t,(function(t,n){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],ED.isArray(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):i.push(t)})),e.polar=i}ED.each(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))};LD.registerVisual(PD("radar")),LD.registerVisual(ND("radar","circle")),LD.registerLayout(RD),LD.registerProcessor(OD("radar")),LD.registerPreprocessor(kD);for(var zD=l,BD=lw,FD=[126,25],VD=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],GD=0;GD<VD.length;GD++)for(var HD=0;HD<VD[GD].length;HD++)VD[GD][HD][0]/=10.5,VD[GD][HD][1]/=-14,VD[GD][HD][0]+=FD[0],VD[GD][HD][1]+=FD[1];var UD=function(e,t){"china"===e&&t.push(new BD("南海诸岛",zD.map(VD,(function(e){return{type:"polygon",exterior:e}})),FD))},WD={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};var jD=function(e,t){if("china"===e){var i=WD[t.name];if(i){var n=t.center;n[0]+=i[0]/10.5,n[1]+=-i[1]/14}}},XD={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};var ZD=function(e,t){if("world"===e){var i=XD[t.name];if(i){var n=t.center;n[0]=i[0],n[1]=i[1]}}},qD=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var YD=function(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:qD[0]})},KD=l.each,QD=dw,JD=qa.makeInner,$D=UD,eE=jD,tE=ZD,iE=YD,nE=JD();function rE(e){for(var t,i=0;i<e.length;i++){var n=e[i].getBoundingRect();(t=t||n.clone()).union(n)}return t}var aE={load:function(e,t,i){var n=nE(t).parsed;if(n)return n;var r,a=t.specialAreas||{},o=t.geoJSON;try{r=o?QD(o,i):[]}catch(s){throw new Error("Invalid geoJson format\n"+s.message)}return $D(e,r),KD(r,(function(t){var i=t.name;eE(e,t),tE(e,t),iE(e,t);var n=a[i];n&&t.transformTo(n.left,n.top,n.width,n.height)})),nE(t).parsed={regions:r,boundingRect:rE(r)}}},oE=gv,sE=oE.parseSVG,lE=oE.makeViewBoxTransform,uE=Ii,hE=ru,cE=l,dE=cE.assert,fE=cE.createHashMap,pE=wi,gE=(0,qa.makeInner)();function mE(e,t){var i,n,r=e.svgXML;try{n=(i=r&&sE(r,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root,dE(null!=n)}catch(h){throw new Error("Invalid svg format\n"+h.message)}var a=i.width,o=i.height,s=i.viewBoxRect;if(t||(t=null==a||null==o?n.getBoundingRect():new pE(0,0,0,0),null!=a&&(t.width=a),null!=o&&(t.height=o)),s){var l=lE(s,t.width,t.height),u=n;(n=new uE).add(u),u.scale=l.scale,u.position=l.position}return n.setClipPath(new hE({shape:t.plain()})),{root:n,boundingRect:t}}var vE={load:function(e,t){var i=gE(t).originRoot;if(i)return{root:i,boundingRect:gE(t).boundingRect};var n=mE(t);return gE(t).originRoot=n.root,gE(t).boundingRect=n.boundingRect,n},makeGraphic:function(e,t,i){var n=gE(t),r=n.rootMap||(n.rootMap=fE()),a=r.get(i);if(a)return a;var o=n.originRoot,s=n.boundingRect;return n.originRootHostKey?a=mE(t,s).root:(n.originRootHostKey=i,a=o),r.set(i,a)},removeGraphic:function(e,t,i){var n=gE(t),r=n.rootMap;r&&r.removeKey(i),i===n.originRootHostKey&&(n.originRootHostKey=null)}},yE=l,_E=yE.each,xE=yE.createHashMap,bE=oy,wE=wi,TE={geoJSON:aE,svg:vE};function SE(e){return function(t,i){var n=ME(t),r=[];return _E(n,(function(n){var a=TE[n.type][e];a&&r.push(a(t,n,i))})),r}}function ME(e){return bE.retrieveMap(e)||[]}var AE={load:function(e,t,i){var n,r=[],a=xE(),o=xE(),s=ME(e);return _E(s,(function(s){var l=TE[s.type].load(e,s,i);_E(l.regions,(function(e){var i=e.name;t&&t.hasOwnProperty(i)&&(e=e.cloneShallow(i=t[i])),r.push(e),a.set(i,e),o.set(i,e.center)}));var u=l.boundingRect;u&&(n?n.union(u):n=u.clone())})),{regions:r,regionsMap:a,nameCoordMap:o,boundingRect:n||new wE(0,0,0,0)}},makeGraphic:SE("makeGraphic"),removeGraphic:SE("removeGraphic")},IE=l,CE=WI,DE=Fg,EE=Ac,LE=EE.encodeHTML,PE=EE.addCommas,NE=XI,RE=Mp.retrieveRawAttr,OE=AE,kE=yd.makeSeriesEncodeForNameBased,zE=DE.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],getInitialData:function(e){for(var t=CE(this,{coordDimensions:["value"],encodeDefaulter:IE.curry(kE,this)}),i=t.mapDimension("value"),n=IE.createHashMap(),r=[],a=[],o=0,s=t.count();o<s;o++){var l=t.getName(o);n.set(l,!0),r.push({name:l,value:t.get(i,o),selected:RE(t,o,"selected")})}var u=OE.load(this.getMapType(),this.option.nameMap,this.option.nameProperty);return IE.each(u.regions,(function(e){var t=e.name;n.get(t)||(r.push({name:t}),a.push(t))})),this.updateSelectedMap(r),t.appendValues([],a),t},getHostGeoModel:function(){var e=this.option.geoIndex;return null!=e?this.dependentModels.geo[e]:null},getMapType:function(){return(this.getHostGeoModel()||this).option.map},getRawValue:function(e){var t=this.getData();return t.get(t.mapDimension("value"),e)},getRegionModel:function(e){var t=this.getData();return t.getItemModel(t.indexOfName(e))},formatTooltip:function(e,t,i,n){for(var r=this.getData(),a=PE(this.getRawValue(e)),o=r.getName(e),s=this.seriesGroup,l=[],u=0;u<s.length;u++){var h=s[u].originalData.indexOfName(o),c=r.mapDimension("value");isNaN(s[u].originalData.get(c,h))||l.push(LE(s[u].name))}var d="html"===n?"<br/>":"\n";return l.join(", ")+d+LE(o+" : "+a)},getTooltipPosition:function(e){if(null!=e){var t=this.getData().getName(e),i=this.coordinateSystem,n=i.getRegion(t);return n&&i.dataToPoint(n.center)}},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},nameProperty:"name"}});IE.mixin(zE,NE);var BE={},FE="\0_ec_interaction_mutex";function VE(e){return e[FE]||(e[FE]={})}n.registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){})),BE.take=function(e,t,i){VE(e)[t]=i},BE.release=function(e,t,i){var n=VE(e);n[t]===i&&(n[t]=null)},BE.isTaken=function(e,t){return!!VE(e)[t]};var GE=l,HE=q,UE=Y,WE=BE;function jE(e){this.pointerChecker,this._zr=e,this._opt={};var t=GE.bind,i=t(XE,this),n=t(ZE,this),r=t(qE,this),a=t(YE,this),o=t(KE,this);HE.call(this),this.setPointerChecker=function(e){this.pointerChecker=e},this.enable=function(t,s){this.disable(),this._opt=GE.defaults(GE.clone(s)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",n),e.on("mouseup",r)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",o))},this.disable=function(){e.off("mousedown",i),e.off("mousemove",n),e.off("mouseup",r),e.off("mousewheel",a),e.off("pinch",o)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function XE(e){if(!(UE.isMiddleOrRightButtonOnMouseUpDown(e)||e.target&&e.target.draggable)){var t=e.offsetX,i=e.offsetY;this.pointerChecker&&this.pointerChecker(e,t,i)&&(this._x=t,this._y=i,this._dragging=!0)}}function ZE(e){if(this._dragging&&$E("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!WE.isTaken(this._zr,"globalPan")){var t=e.offsetX,i=e.offsetY,n=this._x,r=this._y,a=t-n,o=i-r;this._x=t,this._y=i,this._opt.preventDefaultMouseMove&&UE.stop(e.event),JE(this,"pan","moveOnMouseMove",e,{dx:a,dy:o,oldX:n,oldY:r,newX:t,newY:i})}}function qE(e){UE.isMiddleOrRightButtonOnMouseUpDown(e)||(this._dragging=!1)}function YE(e){var t=$E("zoomOnMouseWheel",e,this._opt),i=$E("moveOnMouseWheel",e,this._opt),n=e.wheelDelta,r=Math.abs(n),a=e.offsetX,o=e.offsetY;if(0!==n&&(t||i)){if(t){var s=r>3?1.4:r>1?1.2:1.1;QE(this,"zoom","zoomOnMouseWheel",e,{scale:n>0?s:1/s,originX:a,originY:o})}if(i){var l=Math.abs(n);QE(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:a,originY:o})}}}function KE(e){WE.isTaken(this._zr,"globalPan")||QE(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY})}function QE(e,t,i,n,r){e.pointerChecker&&e.pointerChecker(n,r.originX,r.originY)&&(UE.stop(n.event),JE(e,t,i,n,r))}function JE(e,t,i,n,r){r.isAvailableBehavior=GE.bind($E,null,i,n),e.trigger(t,r)}function $E(e,t,i){var n=i[e];return!e||n&&(!GE.isString(n)||t.event[n+"Key"])}GE.mixin(jE,HE);var eL=jE,tL={};tL.updateViewOnPan=function(e,t,i){var n=e.target,r=n.position;r[0]+=t,r[1]+=i,n.dirty()},tL.updateViewOnZoom=function(e,t,i,n){var r=e.target,a=e.zoomLimit,o=r.position,s=r.scale,l=e.zoom=e.zoom||1;if(l*=t,a){var u=a.min||0,h=a.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/e.zoom;e.zoom=l,o[0]-=(i-o[0])*(c-1),o[1]-=(n-o[1])*(c-1),s[0]*=c,s[1]*=c,r.dirty()};var iL={},nL={axisPointer:1,tooltip:1,brush:1};iL.onIrrelevantElement=function(e,t,i){var n=t.getComponentByElement(e.topTarget),r=n&&n.coordinateSystem;return n&&n!==i&&!nL[n.mainType]&&r&&r.model!==i};var rL=l,aL=eL,oL=tL,sL=iL.onIrrelevantElement,lL=yo,uL=AE,hL=vc.getUID,cL=qe;function dL(e){var t=e.getItemStyle(),i=e.get("areaColor");return null!=i&&(t.fill=i),t}function fL(e,t){t.eachChild((function(t){rL.each(t.__regions,(function(i){t.trigger(e.isSelected(i.name)?"emphasis":"normal")}))}))}function pL(e,t){var i=new lL.Group;this.uid=hL("ec_map_draw"),this._controller=new aL(e.getZr()),this._controllerHost={target:t?i:null},this.group=i,this._updateGroup=t,this._mouseDownFlag,this._mapName,this._initialized,i.add(this._regionsGroup=new lL.Group),i.add(this._backgroundGroup=new lL.Group)}pL.prototype={constructor:pL,draw:function(e,t,i,n,r){var a="geo"===e.mainType,o=e.getData&&e.getData();a&&t.eachComponent({mainType:"series",subType:"map"},(function(t){o||t.getHostGeoModel()!==e||(o=t.getData())}));var s=e.coordinateSystem;this._updateBackground(s);var l,u=this._regionsGroup,h=this.group,c=s.getTransformInfo(),d=!u.childAt(0)||r;if(d)h.transform=c.roamTransform,h.decomposeTransform(),h.dirty();else{var f=new cL;f.transform=c.roamTransform,f.decomposeTransform();var p={scale:f.scale,position:f.position};l=f.scale,lL.updateProps(h,p,e)}var g=c.rawScale,m=c.rawPosition;u.removeAll();var v=["itemStyle"],y=["emphasis","itemStyle"],_=["label"],x=["emphasis","label"],b=rL.createHashMap();rL.each(s.regions,(function(t){var i=b.get(t.name)||b.set(t.name,new lL.Group),n=new lL.CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(n);var r,s=(R=e.getRegionModel(t.name)||e).getModel(v),c=R.getModel(y),f=dL(s),p=dL(c),w=R.getModel(_),T=R.getModel(x);if(o){r=o.indexOfName(t.name);var S=o.getItemVisual(r,"color",!0);S&&(f.fill=S)}var M=function(e){return[e[0]*g[0]+m[0],e[1]*g[1]+m[1]]};rL.each(t.geometries,(function(e){if("polygon"===e.type){for(var t=[],i=0;i<e.exterior.length;++i)t.push(M(e.exterior[i]));n.shape.paths.push(new lL.Polygon({segmentIgnoreThreshold:1,shape:{points:t}}));for(i=0;i<(e.interiors?e.interiors.length:0);++i){for(var r=e.interiors[i],a=(t=[],0);a<r.length;++a)t.push(M(r[a]));n.shape.paths.push(new lL.Polygon({segmentIgnoreThreshold:1,shape:{points:t}}))}}})),n.setStyle(f),n.style.strokeNoScale=!0,n.culling=!0;var A=w.get("show"),I=T.get("show"),C=o&&isNaN(o.get(o.mapDimension("value"),r)),D=o&&o.getItemLayout(r);if(a||C&&(A||I)||D&&D.showLabel){var E,L=a?t.name:r;(!o||r>=0)&&(E=e);var P=new lL.Text({position:M(t.center.slice()),scale:[1/h.scale[0],1/h.scale[1]],z2:10,silent:!0});if(lL.setLabelStyle(P.style,P.hoverStyle={},w,T,{labelFetcher:E,labelDataIndex:L,defaultText:t.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),!d){var N=[1/l[0],1/l[1]];lL.updateProps(P,{scale:N},e)}i.add(P)}if(o)o.setItemGraphicEl(r,i);else{var R=e.getRegionModel(t.name);n.eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:t.name,region:R&&R.option||{}}}(i.__regions||(i.__regions=[])).push(t),i.highDownSilentOnTouch=!!e.get("selectedMode"),lL.setHoverStyle(i,p),u.add(i)})),this._updateController(e,t,i),function(e,t,i,n,r){i.off("click"),i.off("mousedown"),t.get("selectedMode")&&(i.on("mousedown",(function(){e._mouseDownFlag=!0})),i.on("click",(function(a){if(e._mouseDownFlag){e._mouseDownFlag=!1;for(var o=a.target;!o.__regions;)o=o.parent;if(o){var s={type:("geo"===t.mainType?"geo":"map")+"ToggleSelect",batch:rL.map(o.__regions,(function(e){return{name:e.name,from:r.uid}}))};s[t.mainType+"Id"]=t.id,n.dispatchAction(s),fL(t,i)}}})))}(this,e,u,i,n),fL(e,u)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&uL.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(e){var t=e.map;this._mapName!==t&&rL.each(uL.makeGraphic(t,this.uid),(function(e){this._backgroundGroup.add(e)}),this),this._mapName=t},_updateController:function(e,t,i){var n=e.coordinateSystem,r=this._controller,a=this._controllerHost;a.zoomLimit=e.get("scaleLimit"),a.zoom=n.getZoom(),r.enable(e.get("roam")||!1);var o=e.mainType;function s(){var t={type:"geoRoam",componentType:o};return t[o+"Id"]=e.id,t}r.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,oL.updateViewOnPan(a,e.dx,e.dy),i.dispatchAction(rL.extend(s(),{dx:e.dx,dy:e.dy}))}),this),r.off("zoom").on("zoom",(function(e){if(this._mouseDownFlag=!1,oL.updateViewOnZoom(a,e.scale,e.originX,e.originY),i.dispatchAction(rL.extend(s(),{zoom:e.scale,originX:e.originX,originY:e.originY})),this._updateGroup){var t=this.group.scale;this._regionsGroup.traverse((function(e){"text"===e.type&&e.attr("scale",[1/t[0],1/t[1]])}))}}),this),r.setPointerChecker((function(t,r,a){return n.getViewRectAfterRoam().contain(r,a)&&!sL(t,i,e)}))}};var gL=pL,mL=l,vL=yo,yL=gL;function _L(e){var t=this.__seriesMapHighDown;t&&t.recordVersion===this.__seriesMapCallKey&&xL(t,e)}function xL(e,t){var i=e.circle,n=e.labelModel,r=e.hoverLabelModel,a=e.emphasisText,o=e.normalText;t?(i.style.extendFrom(vL.setTextStyle({},r,{text:r.get("show")?a:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=vL.Z2_EMPHASIS_LIFT):(vL.setTextStyle(i.style,n,{text:n.get("show")?o:null,textPosition:n.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),i.dirty(!1),null!=i.__mapOriginalZ2&&(i.z2=i.__mapOriginalZ2,i.__mapOriginalZ2=null))}n.extendChartView({type:"map",render:function(e,t,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var r=this.group;if(r.removeAll(),!e.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===e.id)(a=this._mapDraw)&&r.add(a.group);else if(e.needsDrawMap){var a=this._mapDraw||new yL(i,!0);r.add(a.group),a.draw(e,t,i,this,n),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(e,t,i){var n=e.originalData,r=this.group;n.each(n.mapDimension("value"),(function(t,i){if(!isNaN(t)){var a=n.getItemLayout(i);if(a&&a.point){var o=a.point,s=a.offset,l=new vL.Circle({style:{fill:e.getData().getVisual("color")},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:vL.Z2_EMPHASIS_LIFT+1)});if(!s){var u=e.mainSeries.getData(),h=n.getName(i),c=u.indexOfName(h),d=n.getItemModel(i),f=d.getModel("label"),p=d.getModel("emphasis.label"),g=u.getItemGraphicEl(c),m=mL.retrieve2(e.getFormattedLabel(c,"normal"),h),v=mL.retrieve2(e.getFormattedLabel(c,"emphasis"),m),y=g.__seriesMapHighDown,_=Math.random();if(!y){y=g.__seriesMapHighDown={};var x=mL.curry(_L,!0),b=mL.curry(_L,!1);g.on("mouseover",x).on("mouseout",b).on("emphasis",x).on("normal",b)}g.__seriesMapCallKey=_,mL.extend(y,{recordVersion:_,circle:l,labelModel:f,hoverLabelModel:p,emphasisText:v,normalText:m}),xL(y,!1)}r.add(l)}}}))}});var bL={};bL.updateCenterAndZoom=function(e,t,i){var n=e.getZoom(),r=e.getCenter(),a=t.zoom,o=e.dataToPoint(r);if(null!=t.dx&&null!=t.dy){o[0]-=t.dx,o[1]-=t.dy;r=e.pointToData(o);e.setCenter(r)}if(null!=a){if(i){var s=i.min||0,l=i.max||1/0;a=Math.max(Math.min(n*a,l),s)/n}e.scale[0]*=a,e.scale[1]*=a;var u=e.position,h=(t.originX-u[0])*(a-1),c=(t.originY-u[1])*(a-1);u[0]-=h,u[1]-=c,e.updateTransform();r=e.pointToData(o);e.setCenter(r),e.setZoom(a*n)}return{center:e.getCenter(),zoom:e.getZoom()}};var wL=n,TL=l,SL=bL.updateCenterAndZoom;wL.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},(function(t){var n=t.coordinateSystem;if("geo"===n.type){var r=SL(n,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom),"series"===i&&TL.each(t.seriesGroup,(function(e){e.setCenter(r.center),e.setZoom(r.zoom)}))}}))}));var ML=l,AL=P,IL=Re,CL=wi,DL=qe,EL=AL.applyTransform;function LL(){DL.call(this)}function PL(e){this.name=e,this.zoomLimit,DL.call(this),this._roamTransformable=new LL,this._rawTransformable=new LL,this._center,this._zoom}function NL(e,t,i,n){var r=i.seriesModel,a=r?r.coordinateSystem:null;return a===this?a[e](n):null}ML.mixin(LL,DL),PL.prototype={constructor:PL,type:"view",dimensions:["x","y"],setBoundingRect:function(e,t,i,n){return this._rect=new CL(e,t,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(e,t,i,n){this.transformTo(e,t,i,n),this._viewRect=new CL(e,t,i,n)},transformTo:function(e,t,i,n){var r=this.getBoundingRect(),a=this._rawTransformable;a.transform=r.calculateTransform(new CL(e,t,i,n)),a.decomposeTransform(),this._updateTransform()},setCenter:function(e){e&&(this._center=e,this._updateCenterAndZoom())},setZoom:function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},getDefaultCenter:function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),r=this.getZoom();n=AL.applyTransform([],n,e),i=AL.applyTransform([],i,e),t.origin=n,t.position=[i[0]-n[0],i[1]-n[1]],t.scale=[r,r],this._updateTransform()},_updateTransform:function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),IL.copy(this.transform||(this.transform=[]),t.transform||IL.create()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],IL.invert(this.invTransform,this.transform),this.decomposeTransform()},getTransformInfo:function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?ML.slice(e):IL.create(),rawScale:ML.slice(t.scale),rawPosition:ML.slice(t.position)}},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},dataToPoint:function(e,t,i){var n=t?this._rawTransform:this.transform;return i=i||[],n?EL(i,e,n):AL.copy(i,e)},pointToData:function(e){var t=this.invTransform;return t?EL([],e,t):[e[0],e[1]]},convertToPixel:ML.curry(NL,"dataToPoint"),convertFromPixel:ML.curry(NL,"pointToData"),containPoint:function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])}},ML.mixin(PL,DL);var RL=PL,OL=l,kL=wi,zL=RL,BL=AE;function FL(e,t,i,n){zL.call(this,e),this.map=t;var r=BL.load(t,i);this._nameCoordMap=r.nameCoordMap,this._regionsMap=r.regionsMap,this._invertLongitute=null==n||n,this.regions=r.regions,this._rect=r.boundingRect}function VL(e,t,i,n){var r=i.geoModel,a=i.seriesModel,o=r?r.coordinateSystem:a?a.coordinateSystem||(a.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return o===this?o[e](n):null}FL.prototype={constructor:FL,type:"geo",dimensions:["lng","lat"],containCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return!0;return!1},transformTo:function(e,t,i,n){var r=this.getBoundingRect(),a=this._invertLongitute;r=r.clone(),a&&(r.y=-r.y-r.height);var o=this._rawTransformable;if(o.transform=r.calculateTransform(new kL(e,t,i,n)),o.decomposeTransform(),a){var s=o.scale;s[1]=-s[1]}o.updateTransform(),this._updateTransform()},getRegion:function(e){return this._regionsMap.get(e)},getRegionByCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return t[i]},addGeoCoord:function(e,t){this._nameCoordMap.set(e,t)},getGeoCoord:function(e){return this._nameCoordMap.get(e)},getBoundingRect:function(){return this._rect},dataToPoint:function(e,t,i){if("string"==typeof e&&(e=this.getGeoCoord(e)),e)return zL.prototype.dataToPoint.call(this,e,t,i)},convertToPixel:OL.curry(VL,"dataToPoint"),convertFromPixel:OL.curry(VL,"pointToData")},OL.mixin(FL,zL);var GL=n,HL=l,UL=FL,WL=bc,jL=wc,XL=AE,ZL=oy;function qL(e,t){var i=e.get("boundingCoords");if(null!=i){var n=i[0],r=i[1];isNaN(n[0])||isNaN(n[1])||isNaN(r[0])||isNaN(r[1])||this.setBoundingRect(n[0],n[1],r[0]-n[0],r[1]-n[1])}var a,o=this.getBoundingRect(),s=e.get("layoutCenter"),l=e.get("layoutSize"),u=t.getWidth(),h=t.getHeight(),c=o.width/o.height*this.aspectScale,d=!1;if(s&&l&&(s=[jL.parsePercent(s[0],u),jL.parsePercent(s[1],h)],l=jL.parsePercent(l,Math.min(u,h)),isNaN(s[0])||isNaN(s[1])||isNaN(l)||(d=!0)),d){var f={};c>1?(f.width=l,f.height=l/c):(f.height=l,f.width=l*c),f.y=s[1]-f.height/2,f.x=s[0]-f.width/2}else(a=e.getBoxLayoutParams()).aspect=c,f=WL.getLayoutRect(a,{width:u,height:h});this.setViewRect(f.x,f.y,f.width,f.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function YL(e,t){HL.each(t.get("geoCoord"),(function(t,i){e.addGeoCoord(i,t)}))}var KL={dimensions:UL.prototype.dimensions,create:function(e,t){var i=[];e.eachComponent("geo",(function(e,n){var r=e.get("map"),a=e.get("aspectScale"),o=!0,s=ZL.retrieveMap(r);s&&s[0]&&"svg"===s[0].type?(null==a&&(a=1),o=!1):null==a&&(a=.75);var l=new UL(r+n,r,e.get("nameMap"),o);l.aspectScale=a,l.zoomLimit=e.get("scaleLimit"),i.push(l),YL(l,e),e.coordinateSystem=l,l.model=e,l.resize=qL,l.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=i[t]}}));var n={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();n[t]=n[t]||[],n[t].push(e)}})),HL.each(n,(function(e,n){var r=HL.map(e,(function(e){return e.get("nameMap")})),a=new UL(n,n,HL.mergeAll(r));a.zoomLimit=HL.retrieve.apply(null,HL.map(e,(function(e){return e.get("scaleLimit")}))),i.push(a),a.resize=qL,a.aspectScale=e[0].get("aspectScale"),a.resize(e[0],t),HL.each(e,(function(e){e.coordinateSystem=a,YL(a,e)}))})),i},getFilledRegions:function(e,t,i){for(var n=(e||[]).slice(),r=HL.createHashMap(),a=0;a<n.length;a++)r.set(n[a].name,n[a]);var o=XL.load(t,i);return HL.each(o.regions,(function(e){var t=e.name;!r.get(t)&&n.push({name:t})})),n}};GL.registerCoordinateSystem("geo",KL);var QL=KL,JL=l;var $L=l;var eP=function(e){var t={};e.eachSeriesByType("map",(function(e){var i=e.getHostGeoModel(),n=i?"o"+i.id:"i"+e.getMapType();(t[n]=t[n]||[]).push(e)})),$L.each(t,(function(e,t){for(var i,n,r,a=(i=$L.map(e,(function(e){return e.getData()})),n=e[0].get("mapValueCalculation"),r={},$L.each(i,(function(e){e.each(e.mapDimension("value"),(function(t,i){var n="ec-"+e.getName(i);r[n]=r[n]||[],isNaN(t)||r[n].push(t)}))})),i[0].map(i[0].mapDimension("value"),(function(e,t){for(var a="ec-"+i[0].getName(t),o=0,s=1/0,l=-1/0,u=r[a].length,h=0;h<u;h++)s=Math.min(s,r[a][h]),l=Math.max(l,r[a][h]),o+=r[a][h];return 0===u?NaN:"min"===n?s:"max"===n?l:"average"===n?o/u:o}))),o=0;o<e.length;o++)e[o].originalData=e[o].getData();for(o=0;o<e.length;o++)e[o].seriesGroup=e,e[o].needsDrawMap=0===o&&!e[o].getHostGeoModel(),e[o].setData(a.cloneShallow()),e[o].mainSeries=e[0]}))},tP=l;var iP=n,nP=function(e){var t={};e.eachSeriesByType("map",(function(i){var n=i.getMapType();if(!i.getHostGeoModel()&&!t[n]){var r={};JL.each(i.seriesGroup,(function(t){var i=t.coordinateSystem,n=t.originalData;t.get("showLegendSymbol")&&e.getComponent("legend")&&n.each(n.mapDimension("value"),(function(e,t){var a=n.getName(t),o=i.getRegion(a);if(o&&!isNaN(e)){var s=r[a]||0,l=i.dataToPoint(o.center);r[a]=s+1,n.setItemLayout(t,{point:l,offset:s})}}))}));var a=i.getData();a.each((function(e){var t=a.getName(e),i=a.getItemLayout(e)||{};i.showLabel=!r[t],a.setItemLayout(e,i)})),t[n]=!0}}))},rP=function(e){e.eachSeriesByType("map",(function(e){var t=e.get("color"),i=e.getModel("itemStyle"),n=i.get("areaColor"),r=i.get("color")||t[e.seriesIndex%t.length];e.getData().setVisual({areaColor:n,color:r})}))},aP=eP,oP=function(e){tP.each(e.series,(function(e){e&&"map"===e.type&&(e.map=e.map||e.mapType,tP.defaults(e,e.mapLocation))}))},sP=fC;iP.registerLayout(nP),iP.registerVisual(rP),iP.registerProcessor(iP.PRIORITY.PROCESSOR.STATISTIC,aP),iP.registerPreprocessor(oP),sP("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}]);var lP=l,uP=lP.each,hP="\0__link_datas",cP="\0__link_mainData";function dP(e,t){if((n=this)[cP]===n){var i=lP.extend({},this[hP]);i[this.dataType]=t,mP(t,i,e)}else vP(t,this.dataType,this[cP],e);var n;return t}function fP(e,t){return e.struct&&e.struct.update(this),t}function pP(e,t){return uP(t[hP],(function(i,n){i!==t&&vP(i.cloneShallow(),n,t,e)})),t}function gP(e){var t=this[cP];return null==e||null==t?t:t[hP][e]}function mP(e,t,i){e[hP]={},uP(t,(function(t,n){vP(t,n,e,i)}))}function vP(e,t,i,n){i[hP][t]=e,e[cP]=i,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=gP}var yP=function(e){var t=e.mainData,i=e.datas;i||(i={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,mP(t,i,e),uP(i,(function(i){uP(t.TRANSFERABLE_METHODS,(function(t){i.wrapMethod(t,lP.curry(dP,e))}))})),t.wrapMethod("cloneShallow",lP.curry(pP,e)),uP(t.CHANGABLE_METHODS,(function(i){t.wrapMethod(i,lP.curry(fP,e))})),lP.assert(i[t.dataType]===t)},_P=l,xP=yP,bP=Jy,wP=y_,TP=function(e,t){this.name=e||"",this.depth=0,this.height=0,this.parentNode=null,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.hostTree=t};function SP(e){this.root,this.data,this._nodes=[],this.hostModel=e}TP.prototype={constructor:TP,isRemoved:function(){return this.dataIndex<0},eachNode:function(e,t,i){"function"==typeof e&&(i=t,t=e,e=null),e=e||{},_P.isString(e)&&(e={order:e});var n,r=e.order||"preorder",a=this[e.attr||"children"];"preorder"===r&&(n=t.call(i,this));for(var o=0;!n&&o<a.length;o++)a[o].eachNode(e,t,i);"postorder"===r&&t.call(i,this)},updateDepthAndHeight:function(e){var t=0;this.depth=e;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(e+1),n.height>t&&(t=n.height)}this.height=t+1},getNodeById:function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t<n;t++){var r=i[t].getNodeById(e);if(r)return r}},contains:function(e){if(e===this)return!0;for(var t=0,i=this.children,n=i.length;t<n;t++){var r=i[t].contains(e);if(r)return r}},getAncestors:function(e){for(var t=[],i=e?this:this.parentNode;i;)t.push(i),i=i.parentNode;return t.reverse(),t},getValue:function(e){var t=this.hostTree.data;return t.get(t.getDimension(e||"value"),this.dataIndex)},setLayout:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},setVisual:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},getVisual:function(e,t){return this.hostTree.data.getItemVisual(this.dataIndex,e,t)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},isDescendantOf:function(e){return e!==this&&e.isAncestorOf(this)}},SP.prototype={constructor:SP,type:"tree",eachNode:function(e,t,i){this.root.eachNode(e,t,i)},getNodeByDataIndex:function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},getNodeByName:function(e){return this.root.getNodeByName(e)},update:function(){for(var e=this.data,t=this._nodes,i=0,n=t.length;i<n;i++)t[i].dataIndex=-1;for(i=0,n=e.count();i<n;i++)t[e.getRawIndex(i)].dataIndex=i},clearLayouts:function(){this.data.clearItemLayouts()}},SP.createTree=function(e,t,i){var n=new SP(t),r=[],a=1;!function e(t,i){var o=t.value;a=Math.max(a,_P.isArray(o)?o.length:1),r.push(t);var s=new TP(t.name,n);i?function(e,t){var i=t.children;if(e.parentNode===t)return;i.push(e),e.parentNode=t}(s,i):n.root=s,n._nodes.push(s);var l=t.children;if(l)for(var u=0;u<l.length;u++)e(l[u],s)}(e),n.root.updateDepthAndHeight(0);var o=wP(r,{coordDimensions:["value"],dimensionsCount:a}),s=new bP(o,t);return s.initData(r),i&&i(s),xP({mainData:s,struct:n,structAttr:"tree"}),n.update(),n};var MP=SP,AP=Fg,IP=MP,CP=Ac.encodeHTML,DP=mc;AP.extend({type:"series.tree",layoutInfo:null,layoutMode:"box",getInitialData:function(e){var t={name:e.name,children:e.data},i=e.leaves||{},n=new DP(i,this,this.ecModel),r=IP.createTree(t,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=r.getNodeByDataIndex(t);return i.children.length&&i.isExpand||(e.parentModel=n),e}))}));var a=0;r.eachNode("preorder",(function(e){e.depth>a&&(a=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:a;return r.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),r.data},getOrient:function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},formatTooltip:function(e){for(var t=this.getData().tree,i=t.root.children[0],n=t.getNodeByDataIndex(e),r=n.getValue(),a=n.name;n&&n!==i;)a=n.parentNode.name+"."+a,n=n.parentNode;return CP(a+(isNaN(r)||null==r?"":" : "+r))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}});var EP={},LP=bc;function PP(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function NP(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function RP(e,t,i){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:i}function OP(e,t,i){var n=i/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=i,t.hierNode.modifier+=i,t.hierNode.prelim+=i,e.hierNode.change+=n}function kP(e,t){return e.parentNode===t.parentNode?1:2}EP.init=function(e){e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var t,i,n=[e];t=n.pop();)if(i=t.children,t.isExpand&&i.length)for(var r=i.length-1;r>=0;r--){var a=i[r];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:r,thread:null},n.push(a)}},EP.firstWalk=function(e,t){var i=e.isExpand?e.children:[],n=e.parentNode.children,r=e.hierNode.i?n[e.hierNode.i-1]:null;if(i.length){!function(e){var t=e.children,i=t.length,n=0,r=0;for(;--i>=0;){var a=t[i];a.hierNode.prelim+=n,a.hierNode.modifier+=n,r+=a.hierNode.change,n+=a.hierNode.shift+r}}(e);var a=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;r?(e.hierNode.prelim=r.hierNode.prelim+t(e,r),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else r&&(e.hierNode.prelim=r.hierNode.prelim+t(e,r));e.parentNode.hierNode.defaultAncestor=function(e,t,i,n){if(t){for(var r=e,a=e,o=a.parentNode.children[0],s=t,l=r.hierNode.modifier,u=a.hierNode.modifier,h=o.hierNode.modifier,c=s.hierNode.modifier;s=PP(s),a=NP(a),s&&a;){r=PP(r),o=NP(o),r.hierNode.ancestor=e;var d=s.hierNode.prelim+c-a.hierNode.prelim-u+n(s,a);d>0&&(OP(RP(s,e,i),e,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=r.hierNode.modifier,h+=o.hierNode.modifier}s&&!PP(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=c-l),a&&!NP(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-h,i=e)}return i}(e,r,e.parentNode.hierNode.defaultAncestor||n[0],t)},EP.secondWalk=function(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier},EP.separation=function(e){return arguments.length?e:kP},EP.radialCoordinate=function(e,t){var i={};return e-=Math.PI/2,i.x=t*Math.cos(e),i.y=t*Math.sin(e),i},EP.getViewRect=function(e,t){return LP.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})};var zP=l,BP=yo,FP=MT,VP=EP.radialCoordinate,GP=n,HP=Oo,UP=RL,WP=tL,jP=eL,XP=iL.onIrrelevantElement,ZP=wc.parsePercent,qP=BP.extendShape({shape:{parentPoint:[],childPoints:[],orient:"",forkPosition:""},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.childPoints,n=i.length,r=t.parentPoint,a=i[0],o=i[n-1];if(1===n)return e.moveTo(r[0],r[1]),void e.lineTo(a[0],a[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=ZP(t.forkPosition,1),c=[];c[l]=r[l],c[u]=r[u]+(o[u]-r[u])*h,e.moveTo(r[0],r[1]),e.lineTo(c[0],c[1]),e.moveTo(a[0],a[1]),c[l]=a[l],e.lineTo(c[0],c[1]),c[l]=o[l],e.lineTo(c[0],c[1]),e.lineTo(o[0],o[1]);for(var d=1;d<n-1;d++){var f=i[d];e.moveTo(f[0],f[1]),c[l]=f[l],e.lineTo(c[0],c[1])}}});function YP(e,t){var i=e.getItemLayout(t);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==e.getItemVisual(t,"symbol")}function KP(e,t,i){return i.itemModel=t,i.itemStyle=t.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=t.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=t.getModel("lineStyle").getLineStyle(),i.labelModel=t.getModel("label"),i.hoverLabelModel=t.getModel("emphasis.label"),!1===e.isExpand&&0!==e.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function QP(e,t,i,n,r,a){var o=!i,s=e.tree.getNodeByDataIndex(t),l=s.getModel(),u=(a=KP(s,l,a),e.tree.root),h=s.parentNode===u?s:s.parentNode||s,c=e.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,p=s.getLayout();o?(i=new FP(e,t,a)).attr("position",[f.x,f.y]):i.updateData(e,t,a),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=p.rawX,i.__radialRawY=p.rawY,n.add(i),e.setItemGraphicEl(t,i),BP.updateProps(i,{position:[p.x,p.y]},r);var g=i.getSymbolPath();if("radial"===a.layout){var m,v,y=u.children[0],_=y.getLayout(),x=y.children.length;if(p.x===_.x&&!0===s.isExpand){var b={};b.x=(y.children[0].getLayout().x+y.children[x-1].getLayout().x)/2,b.y=(y.children[0].getLayout().y+y.children[x-1].getLayout().y)/2,(m=Math.atan2(b.y-_.y,b.x-_.x))<0&&(m=2*Math.PI+m),(v=b.x<_.x)&&(m-=Math.PI)}else(m=Math.atan2(p.y-_.y,p.x-_.x))<0&&(m=2*Math.PI+m),0===s.children.length||0!==s.children.length&&!1===s.isExpand?(v=p.x<_.x)&&(m-=Math.PI):(v=p.x>_.x)||(m-=Math.PI);var w=v?"left":"right",T=a.labelModel.get("rotate"),S=T*(Math.PI/180);g.setStyle({textPosition:a.labelModel.get("position")||w,textRotation:null==T?-m:S,textOrigin:"center",verticalAlign:"middle"})}!function(e,t,i,n,r,a,o,s,l){var u=l.edgeShape,h=n.__edge;if("curve"===u)t.parentNode&&t.parentNode!==i&&(h||(h=n.__edge=new BP.BezierCurve({shape:$P(l,r,r),style:zP.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),BP.updateProps(h,{shape:$P(l,a,o),style:zP.defaults({opacity:1},l.lineStyle)},e));else if("polyline"===u&&"orthogonal"===l.layout&&t!==i&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var c=t.children,d=[],f=0;f<c.length;f++){var p=c[f].getLayout();d.push([p.x,p.y])}h||(h=n.__edge=new qP({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:l.orient,forkPosition:l.edgeForkPosition},style:zP.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),BP.updateProps(h,{shape:{parentPoint:[o.x,o.y],childPoints:d},style:zP.defaults({opacity:1},l.lineStyle)},e)}s.add(h)}(r,s,u,i,f,d,p,n,a)}function JP(e,t,i,n,r,a){for(var o,s=e.tree.getNodeByDataIndex(t),l=e.tree.root,u=s.getModel(),h=(a=KP(s,u,a),s.parentNode===l?s:s.parentNode||s),c=a.edgeShape;null==(o=h.getLayout());)h=h.parentNode===l?h:h.parentNode||h;BP.updateProps(i,{position:[o.x+1,o.y+1]},r,(function(){n.remove(i),e.setItemGraphicEl(t,null)})),i.fadeOut(null,{keepLabel:!0});var d=e.getItemGraphicEl(h.dataIndex).__edge,f=i.__edge||(!1===h.isExpand||1===h.children.length?d:void 0);c=a.edgeShape;f&&("curve"===c?BP.updateProps(f,{shape:$P(a,o,o),style:{opacity:0}},r,(function(){n.remove(f)})):"polyline"===c&&"orthogonal"===a.layout&&BP.updateProps(f,{shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]]},style:{opacity:0}},r,(function(){n.remove(f)})))}function $P(e,t,i){var n,r,a,o,s,l,u,h,c=e.orient;if("radial"===e.layout){s=t.rawX,u=t.rawY,l=i.rawX,h=i.rawY;var d=VP(s,u),f=VP(s,u+(h-u)*e.curvature),p=VP(l,h+(u-h)*e.curvature),g=VP(l,h);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:f.x,cpy1:f.y,cpx2:p.x,cpy2:p.y}}return s=t.x,u=t.y,l=i.x,h=i.y,"LR"!==c&&"RL"!==c||(n=s+(l-s)*e.curvature,r=u,a=l+(s-l)*e.curvature,o=h),"TB"!==c&&"BT"!==c||(n=s,r=u+(h-u)*e.curvature,a=l,o=h+(u-h)*e.curvature),{x1:s,y1:u,x2:l,y2:h,cpx1:n,cpy1:r,cpx2:a,cpy2:o}}GP.extendChartView({type:"tree",init:function(e,t){this._oldTree,this._mainGroup=new BP.Group,this._controller=new jP(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(e,t,i,n){var r=e.getData(),a=e.layoutInfo,o=this._mainGroup,s=e.get("layout");"radial"===s?o.attr("position",[a.x+a.width/2,a.y+a.height/2]):o.attr("position",[a.x,a.y]),this._updateViewCoordSys(e,a,s),this._updateController(e,t,i);var l=this._data,u={expandAndCollapse:e.get("expandAndCollapse"),layout:s,edgeShape:e.get("edgeShape"),edgeForkPosition:e.get("edgeForkPosition"),orient:e.getOrient(),curvature:e.get("lineStyle.curveness"),symbolRotate:e.get("symbolRotate"),symbolOffset:e.get("symbolOffset"),hoverAnimation:e.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};r.diff(l).add((function(t){YP(r,t)&&QP(r,t,null,o,e,u)})).update((function(t,i){var n=l.getItemGraphicEl(i);YP(r,t)?QP(r,t,n,o,e,u):n&&JP(l,i,n,o,e,u)})).remove((function(t){var i=l.getItemGraphicEl(t);i&&JP(l,t,i,o,e,u)})).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),!0===u.expandAndCollapse&&r.eachItemGraphicEl((function(t,n){t.off("click").on("click",(function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:n})}))})),this._data=r},_updateViewCoordSys:function(e){var t=e.getData(),i=[];t.each((function(e){var n=t.getItemLayout(e);!n||isNaN(n.x)||isNaN(n.y)||i.push([+n.x,+n.y])}));var n=[],r=[];HP.fromPoints(i,n,r);var a=this._min,o=this._max;r[0]-n[0]==0&&(n[0]=a?a[0]:n[0]-1,r[0]=o?o[0]:r[0]+1),r[1]-n[1]==0&&(n[1]=a?a[1]:n[1]-1,r[1]=o?o[1]:r[1]+1);var s=e.coordinateSystem=new UP;s.zoomLimit=e.get("scaleLimit"),s.setBoundingRect(n[0],n[1],r[0]-n[0],r[1]-n[1]),s.setCenter(e.get("center")),s.setZoom(e.get("zoom")),this.group.attr({position:s.position,scale:s.scale}),this._viewCoordSys=s,this._min=n,this._max=r},_updateController:function(e,t,i){var n=this._controller,r=this._controllerHost,a=this.group;n.setPointerChecker((function(t,n,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(n,r)&&!XP(t,i,e)})),n.enable(e.get("roam")),r.zoomLimit=e.get("scaleLimit"),r.zoom=e.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",(function(t){WP.updateViewOnPan(r,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})}),this).on("zoom",(function(t){WP.updateViewOnZoom(r,t.scale,t.originX,t.originY),i.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(e)}),this)},_updateNodeAndLinkScale:function(e){var t=e.getData(),i=this._getNodeGlobalScale(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},_getNodeGlobalScale:function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var i=this._nodeScaleRatio,n=t.scale,r=n&&n[0]||1;return((t.getZoom()-1)*i+1)/r},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},remove:function(){this._mainGroup.removeAll(),this._data=null}});var eN=n,tN=bL.updateCenterAndZoom;eN.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var i=e.dataIndex,n=t.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand}))})),eN.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var i=t.coordinateSystem,n=tN(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var iN={};iN.eachAfter=function(e,t,i){for(var n,r=[e],a=[];n=r.pop();)if(a.push(n),n.isExpand){var o=n.children;if(o.length)for(var s=0;s<o.length;s++)r.push(o[s])}for(;n=a.pop();)t(n,i)},iN.eachBefore=function(e,t){for(var i,n=[e];i=n.pop();)if(t(i),i.isExpand){var r=i.children;if(r.length)for(var a=r.length-1;a>=0;a--)n.push(r[a])}};var nN=iN,rN=nN.eachAfter,aN=nN.eachBefore,oN=EP,sN=oN.init,lN=oN.firstWalk,uN=oN.secondWalk,hN=oN.separation,cN=oN.radialCoordinate,dN=oN.getViewRect;var fN=n,pN=OS,gN=function(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var i=dN(e,t);e.layoutInfo=i;var n=e.get("layout"),r=0,a=0,o=null;"radial"===n?(r=2*Math.PI,a=Math.min(i.height,i.width)/2,o=hN((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(r=i.width,a=i.height,o=hN());var s=e.getData().tree.root,l=s.children[0];if(l){sN(s),rN(l,lN,o),s.hierNode.modifier=-l.hierNode.prelim,aN(l,uN);var u=l,h=l,c=l;aN(l,(function(e){var t=e.getLayout().x;t<u.getLayout().x&&(u=e),t>h.getLayout().x&&(h=e),e.depth>c.depth&&(c=e)}));var d=u===h?1:o(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;if("radial"===n)p=r/(h.getLayout().x+d+f),g=a/(c.depth-1||1),aN(l,(function(e){m=(e.getLayout().x+f)*p,v=(e.depth-1)*g;var t=cN(m,v);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:v},!0)}));else{var y=e.getOrient();"RL"===y||"LR"===y?(g=a/(h.getLayout().x+d+f),p=r/(c.depth-1||1),aN(l,(function(e){v=(e.getLayout().x+f)*g,m="LR"===y?(e.depth-1)*p:r-(e.depth-1)*p,e.setLayout({x:m,y:v},!0)}))):"TB"!==y&&"BT"!==y||(p=r/(h.getLayout().x+d+f),g=a/(c.depth-1||1),aN(l,(function(e){m=(e.getLayout().x+f)*p,v="TB"===y?(e.depth-1)*g:a-(e.depth-1)*g,e.setLayout({x:m,y:v},!0)})))}}}(e,t)}))};fN.registerVisual(pN("tree","circle")),fN.registerLayout(gN);var mN={},vN=l;function yN(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}mN.retrieveTargetInfo=function(e,t,i){if(e&&vN.indexOf(t,e.type)>=0){var n=i.getData().tree.root,r=e.targetNode;if("string"==typeof r&&(r=n.getNodeById(r)),r&&n.contains(r))return{node:r};var a=e.targetNodeId;if(null!=a&&(r=n.getNodeById(a)))return{node:r}}},mN.getPathToRoot=yN,mN.aboveViewRoot=function(e,t){var i=yN(e);return vN.indexOf(i,t)>=0},mN.wrapTreePathInfo=function(e,t){for(var i=[];e;){var n=e.dataIndex;i.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return i.reverse(),i};var _N=l,xN=Fg,bN=MP,wN=mc,TN=Ac,SN=TN.encodeHTML,MN=TN.addCommas,AN=mN.wrapTreePathInfo;function IN(e){var t=0;_N.each(e.children,(function(e){IN(e);var i=e.value;_N.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;_N.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),_N.isArray(e.value)?e.value[0]=i:e.value=i}xN.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(e,t){var i={name:e.name,children:e.data};IN(i);var n=e.levels||[],r=this.designatedVisualItemStyle={},a=new wN({itemStyle:r},this,t);n=e.levels=function(e,t){var i,n=t.get("color");if(!n)return;if(e=e||[],_N.each(e,(function(e){var t=new wN(e),n=t.get("color");(t.get("itemStyle.color")||n&&"none"!==n)&&(i=!0)})),!i){(e[0]||(e[0]={})).color=n.slice()}return e}(n,t);var o=_N.map(n||[],(function(e){return new wN(e,a,t)}),this),s=bN.createTree(i,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=s.getNodeByDataIndex(t),n=o[i.depth];return e.parentModel=n||a,e}))}));return s.data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(e){var t=this.getData(),i=this.getRawValue(e),n=_N.isArray(i)?MN(i[0]):MN(i),r=t.getName(e);return SN(r+": "+n)},getDataParams:function(e){var t=xN.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=AN(i,this),t},setLayoutInfo:function(e){this.layoutInfo=this.layoutInfo||{},_N.extend(this.layoutInfo,e)},mapIdToIndex:function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=_N.createHashMap(),this._idIndexMapCount=0);var i=t.get(e);return null==i&&t.set(e,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)}});var CN=yo,DN=bc,EN=l,LN=mN.wrapTreePathInfo;function PN(e){this.group=new CN.Group,e.add(this.group)}function NN(e,t,i,n,r,a){var o=[[r?e:e-5,t],[e+i,t],[e+i,t+n],[r?e:e-5,t+n]];return!a&&o.splice(2,0,[e+i+5,t+n/2]),!r&&o.push([e,t+n/2]),o}function RN(e,t,i){e.eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.componentIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&LN(i,t)}}PN.prototype={constructor:PN,render:function(e,t,i,n){var r=e.getModel("breadcrumb"),a=this.group;if(a.removeAll(),r.get("show")&&i){var o=r.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(e,l,o,s,n),DN.positionElement(a,l.pos,l.box)}},_prepare:function(e,t,i){for(var n=e;n;n=n.parentNode){var r=n.getModel().get("name"),a=i.getTextRect(r),o=Math.max(a.width+16,t.emptyItemWidth);t.totalWidth+=o+8,t.renderList.push({node:n,text:r,width:o})}},_renderContent:function(e,t,i,n,r){for(var a=0,o=t.emptyItemWidth,s=e.get("breadcrumb.height"),l=DN.getAvailableSize(t.pos,t.box),u=t.totalWidth,h=t.renderList,c=h.length-1;c>=0;c--){var d=h[c],f=d.node,p=d.width,g=d.text;u>l.width&&(u-=p-o,p=o,g=null);var m=new CN.Polygon({shape:{points:NN(a,0,p,s,c===h.length-1,0===c)},style:EN.defaults(i.getItemStyle(),{lineJoin:"bevel",text:g,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:EN.curry(r,f)});this.group.add(m),RN(m,e,f),a+=p+8}},remove:function(){this.group.removeAll()}};var ON=PN,kN={},zN=l;kN.createWrap=function(){var e,t=[],i={};return{add:function(e,n,r,a,o){return zN.isString(a)&&(o=a,a=0),!i[e.id]&&(i[e.id]=1,t.push({el:e,target:n,time:r,delay:a,easing:o}),!0)},done:function(t){return e=t,this},start:function(){for(var n=t.length,r=0,a=t.length;r<a;r++){var o=t[r];o.el.animateTo(o.target,o.time,o.delay,o.easing,s)}return this;function s(){--n||(t.length=0,i={},e&&e())}}}};var BN=n,FN=l,VN=yo,GN=dy,HN=mN,UN=ON,WN=eL,jN=wi,XN=Re,ZN=kN,qN=fo,YN=Ac.windowOpen,KN=FN.bind,QN=VN.Group,JN=VN.Rect,$N=FN.each,eR=["label"],tR=["emphasis","label"],iR=["upperLabel"],nR=["emphasis","upperLabel"],rR=qN([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),aR=function(e){var t=rR(e);return t.stroke=t.fill=t.lineWidth=null,t};function oR(e,t,i,n,r,a,o,s,l,u){if(o){var h=o.getLayout(),c=e.getData();if(c.setItemGraphicEl(o.dataIndex,null),h&&h.isInView){var d=h.width,f=h.height,p=h.borderWidth,g=h.invisible,m=o.getRawIndex(),v=s&&s.getRawIndex(),y=o.viewChildren,_=h.upperHeight,x=y&&y.length,b=o.getModel("itemStyle"),w=o.getModel("emphasis.itemStyle"),T=E("nodeGroup",QN);if(T){if(l.add(T),T.attr("position",[h.x||0,h.y||0]),T.__tmNodeWidth=d,T.__tmNodeHeight=f,h.isAboveViewRoot)return T;var S=o.getModel(),M=E("background",JN,u,1);if(M&&function(t,i,n){if(i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex,i.setShape({x:0,y:0,width:d,height:f}),g)I(i);else{i.invisible=!1;var r=o.getVisual("borderColor",!0),a=w.get("borderColor"),s=aR(b);s.fill=r;var l=rR(w);if(l.fill=a,n){var u=d-2*p;C(s,l,r,u,_,{x:p,y:0,width:u,height:_})}else s.text=l.text=null;i.setStyle(s),VN.setElementHoverStyle(i,l)}t.add(i)}(T,M,x&&h.upperLabelHeight),x)VN.isHighDownDispatcher(T)&&VN.setAsHighDownDispatcher(T,!1),M&&(VN.setAsHighDownDispatcher(M,!0),c.setItemGraphicEl(o.dataIndex,M));else{var A=E("content",JN,u,2);A&&function(t,i){i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex;var n=Math.max(d-2*p,0),r=Math.max(f-2*p,0);if(i.culling=!0,i.setShape({x:p,y:p,width:n,height:r}),g)I(i);else{i.invisible=!1;var a=o.getVisual("color",!0),s=aR(b);s.fill=a;var l=rR(w);C(s,l,a,n,r),i.setStyle(s),VN.setElementHoverStyle(i,l)}t.add(i)}(T,A),M&&VN.isHighDownDispatcher(M)&&VN.setAsHighDownDispatcher(M,!1),VN.setAsHighDownDispatcher(T,!0),c.setItemGraphicEl(o.dataIndex,T)}return T}}}function I(e){!e.invisible&&a.push(e)}function C(t,i,n,r,a,s){var l=S.get("name"),u=S.getModel(s?iR:eR),c=S.getModel(s?nR:tR),d=u.getShallow("show");VN.setLabelStyle(t,i,u,c,{defaultText:d?l:null,autoColor:n,isRectText:!0,labelFetcher:e,labelDataIndex:o.dataIndex,labelProp:s?"upperLabel":"label"}),D(t,s,h),D(i,s,h),s&&(t.textRect=FN.clone(s)),t.truncate=d&&u.get("ellipsis")?{outerWidth:r,outerHeight:a,minChar:2}:null}function D(t,i,n){var r=t.text;if(!i&&n.isLeafRoot&&null!=r){var a=e.get("drillDownIcon",!0);t.text=a?a+" "+r:r}}function E(e,a,s,l){var u=null!=v&&i[e][v],h=r[e];return u?(i[e][v]=null,function(e,t,i){(e[m]={}).old="nodeGroup"===i?t.position.slice():FN.extend({},t.shape)}(h,u,e)):g||((u=new a({z:sR(s,l)})).__tmDepth=s,u.__tmStorageName=e,function(e,t,i){var a=e[m]={},s=o.parentNode;if(s&&(!n||"drillDown"===n.direction)){var l=0,u=0,h=r.background[s.getRawIndex()];!n&&h&&h.old&&(l=h.old.width,u=h.old.height),a.old="nodeGroup"===i?[0,u]:{x:l,y:u,width:0,height:0}}a.fadein="nodeGroup"!==i}(h,0,e)),t[e][m]=u}}function sR(e,t){var i=10*e+t;return(i-1)/i}BN.extendChartView({type:"treemap",init:function(e,t){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(e,t,i,n){var r=t.findComponents({mainType:"series",subType:"treemap",query:n});if(!(FN.indexOf(r,e)<0)){this.seriesModel=e,this.api=i,this.ecModel=t;var a=HN.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),o=n&&n.type,s=e.layoutInfo,l=!this._oldTree,u=this._storage,h="treemapRootToNode"===o&&a&&u?{rootNodeGroup:u.nodeGroup[a.node.getRawIndex()],direction:n.direction}:null,c=this._giveContainerGroup(s),d=this._doRender(c,e,h);l||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(c,d,e,h),this._resetController(i),this._renderBreadcrumb(e,i,a)}},_giveContainerGroup:function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new QN,this._initEvents(t),this.group.add(t)),t.attr("position",[e.x,e.y]),t},_doRender:function(e,t,i){var n=t.getData().tree,r=this._oldTree,a={nodeGroup:[],background:[],content:[]},o={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],u=FN.curry(oR,t,o,s,i,a,l);!function e(t,i,n,r,a){r?(i=t,$N(t,(function(e,t){!e.isRemoved()&&s(t,t)}))):new GN(i,t,o,o).add(s).update(s).remove(FN.curry(s,null)).execute();function o(e){return e.getId()}function s(o,s){var l=null!=o?t[o]:null,h=null!=s?i[s]:null,c=u(l,h,n,a);c&&e(l&&l.viewChildren||[],h&&h.viewChildren||[],c,r,a+1)}}(n.root?[n.root]:[],r&&r.root?[r.root]:[],e,n===r||!r,0);var h,c,d=(c={nodeGroup:[],background:[],content:[]},(h=s)&&$N(h,(function(e,t){var i=c[t];$N(e,(function(e){e&&(i.push(e),e.__tmWillDelete=1)}))})),c);return this._oldTree=n,this._storage=o,{lastsForAnimation:a,willDeleteEls:d,renderFinally:function(){$N(d,(function(e){$N(e,(function(e){e.parent&&e.parent.remove(e)}))})),$N(l,(function(e){e.invisible=!0,e.dirty()}))}}},_doAnimation:function(e,t,i,n){if(i.get("animation")){var r=i.get("animationDurationUpdate"),a=i.get("animationEasing"),o=ZN.createWrap();$N(t.willDeleteEls,(function(e,t){$N(e,(function(e,i){if(!e.invisible){var s,l=e.parent;if(n&&"drillDown"===n.direction)s=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,h=l.__tmNodeHeight/2),s="nodeGroup"===t?{position:[u,h],style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}s&&o.add(e,s,r,a)}}))})),$N(this._storage,(function(e,i){$N(e,(function(e,n){var s=t.lastsForAnimation[i][n],l={};s&&("nodeGroup"===i?s.old&&(l.position=e.position.slice(),e.attr("position",s.old)):(s.old&&(l.shape=FN.extend({},e.shape),e.setShape(s.old)),s.fadein?(e.setStyle("opacity",0),l.style={opacity:1}):1!==e.style.opacity&&(l.style={opacity:1})),o.add(e,l,r,a))}))}),this),this._state="animating",o.done(KN((function(){this._state="ready",t.renderFinally()}),this)).start()}},_resetController:function(e){var t=this._controller;t||((t=this._controller=new WN(e.getZr())).enable(this.seriesModel.get("roam")),t.on("pan",KN(this._onPan,this)),t.on("zoom",KN(this._onZoom,this)));var i=new jN(0,0,e.getWidth(),e.getHeight());t.setPointerChecker((function(e,t,n){return i.contain(t,n)}))},_clearController:function(){var e=this._controller;e&&(e.dispose(),e=null)},_onPan:function(e){if("animating"!==this._state&&(Math.abs(e.dx)>3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var i=t.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+e.dx,y:i.y+e.dy,width:i.width,height:i.height}})}},_onZoom:function(e){var t=e.originX,i=e.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var r=n.getLayout();if(!r)return;var a=new jN(r.x,r.y,r.width,r.height),o=this.seriesModel.layoutInfo;t-=o.x,i-=o.y;var s=XN.create();XN.translate(s,s,[-t,-i]),XN.scale(s,s,[e.scale,e.scale]),XN.translate(s,s,[t,i]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},_initEvents:function(e){e.on("click",(function(e){if("ready"===this._state){var t=this.seriesModel.get("nodeClick",!0);if(t){var i=this.findTarget(e.offsetX,e.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===t)this._zoomToNode(i);else if("link"===t){var r=n.hostTree.data.getItemModel(n.dataIndex),a=r.get("link",!0),o=r.get("target",!0)||"blank";a&&YN(a,o)}}}}}),this)},_renderBreadcrumb:function(e,t,i){i||(i=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(i={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new UN(this.group))).render(e,t,i.node,KN((function(t){"animating"!==this._state&&(HN.aboveViewRoot(e.getViewRoot(),t)?this._rootToNode({node:t}):this._zoomToNode({node:t}))}),this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},_rootToNode:function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},findTarget:function(e,t){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(n){var r=this._storage.background[n.getRawIndex()];if(r){var a=r.transformCoordToLocal(e,t),o=r.shape;if(!(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height))return!1;i={node:n,offsetX:a[0],offsetY:a[1]}}}),this),i}});for(var lR=n,uR=mN,hR=function(){},cR=["treemapZoomToNode","treemapRender","treemapMove"],dR=0;dR<cR.length;dR++)lR.registerAction({type:cR[dR],update:"updateView"},hR);lR.registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,i){var n=uR.retrieveTargetInfo(e,["treemapZoomToNode","treemapRootToNode"],t);if(n){var r=t.getViewRoot();r&&(e.direction=uR.aboveViewRoot(r,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var fR=l,pR=$e,gR=wc.linearMap,mR=fR.each,vR=fR.isObject,yR=function(e){var t=e.mappingMethod,i=e.type,n=this.option=fR.clone(e);this.type=i,this.mappingMethod=t,this._normalizeData=DR[t];var r=_R[i];this.applyVisual=r.applyVisual,this.getColorMapper=r.getColorMapper,this._doMap=r._doMap[t],"piecewise"===t?(xR(n),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,fR.each(t,(function(t,i){t.originIndex=i,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(n)):"category"===t?n.categories?function(e){var t=e.categories,i=e.visual,n=e.categoryMap={};if(mR(t,(function(e,t){n[e]=t})),!fR.isArray(i)){var r=[];fR.isObject(i)?mR(i,(function(e,t){var i=n[t];r[null!=i?i:-1]=e})):r[-1]=i,i=CR(e,r)}for(var a=t.length-1;a>=0;a--)null==i[a]&&(delete n[t[a]],t.pop())}(n):xR(n,!0):(fR.assert("linear"!==t||n.dataExtent),xR(n))};yR.prototype={constructor:yR,mapValueToVisual:function(e){var t=this._normalizeData(e);return this._doMap(t,e)},getNormalizer:function(){return fR.bind(this._normalizeData,this)}};var _R=yR.visualHandlers={color:{applyVisual:TR("color"),getColorMapper:function(){var e=this.option;return fR.bind("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),SR.call(this,e)}:function(t,i,n){var r=!!n;return!i&&(t=this._normalizeData(t)),n=pR.fastLerp(t,e.parsedVisual,n),r?n:pR.stringify(n,"rgba")},this)},_doMap:{linear:function(e){return pR.stringify(pR.fastLerp(e,this.option.parsedVisual),"rgba")},category:SR,piecewise:function(e,t){var i=IR.call(this,t);return null==i&&(i=pR.stringify(pR.fastLerp(e,this.option.parsedVisual),"rgba")),i},fixed:MR}},colorHue:bR((function(e,t){return pR.modifyHSL(e,t)})),colorSaturation:bR((function(e,t){return pR.modifyHSL(e,null,t)})),colorLightness:bR((function(e,t){return pR.modifyHSL(e,null,null,t)})),colorAlpha:bR((function(e,t){return pR.modifyAlpha(e,t)})),opacity:{applyVisual:TR("opacity"),_doMap:AR([0,1])},liftZ:{applyVisual:TR("liftZ"),_doMap:{linear:MR,category:MR,piecewise:MR,fixed:MR}},symbol:{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);if(fR.isString(n))i("symbol",n);else if(vR(n))for(var r in n)n.hasOwnProperty(r)&&i(r,n[r])},_doMap:{linear:wR,category:SR,piecewise:function(e,t){var i=IR.call(this,t);return null==i&&(i=wR.call(this,e)),i},fixed:MR}},symbolSize:{applyVisual:TR("symbolSize"),_doMap:AR([0,1])}};function xR(e,t){var i=e.visual,n=[];fR.isObject(i)?mR(i,(function(e){n.push(e)})):null!=i&&n.push(i);t||1!==n.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(n[1]=n[0]),CR(e,n)}function bR(e){return{applyVisual:function(t,i,n){t=this.mapValueToVisual(t),n("color",e(i("color"),t))},_doMap:AR([0,1])}}function wR(e){var t=this.option.visual;return t[Math.round(gR(e,[0,1],[0,t.length-1],!0))]||{}}function TR(e){return function(t,i,n){n(e,this.mapValueToVisual(t))}}function SR(e){var t=this.option.visual;return t[this.option.loop&&-1!==e?e%t.length:e]}function MR(){return this.option.visual[0]}function AR(e){return{linear:function(t){return gR(t,e,this.option.visual,!0)},category:SR,piecewise:function(t,i){var n=IR.call(this,i);return null==n&&(n=gR(t,e,this.option.visual,!0)),n},fixed:MR}}function IR(e){var t=this.option,i=t.pieceList;if(t.hasSpecialVisual){var n=i[yR.findPieceIndex(e,i)];if(n&&n.visual)return n.visual[this.type]}}function CR(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=fR.map(t,(function(e){return pR.parse(e)}))),t}var DR={linear:function(e){return gR(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,i=yR.findPieceIndex(e,t,!0);if(null!=i)return gR(i,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?-1:t},fixed:fR.noop};function ER(e,t,i){return e?t<=i:t<i}yR.listVisualTypes=function(){var e=[];return fR.each(_R,(function(t,i){e.push(i)})),e},yR.addVisualHandler=function(e,t){_R[e]=t},yR.isValidType=function(e){return _R.hasOwnProperty(e)},yR.eachVisual=function(e,t,i){fR.isObject(e)?fR.each(e,t,i):t.call(i,e)},yR.mapVisual=function(e,t,i){var n,r=fR.isArray(e)?[]:fR.isObject(e)?{}:(n=!0,null);return yR.eachVisual(e,(function(e,a){var o=t.call(i,e,a);n?r=o:r[a]=o})),r},yR.retrieveVisuals=function(e){var t,i={};return e&&mR(_R,(function(n,r){e.hasOwnProperty(r)&&(i[r]=e[r],t=!0)})),t?i:null},yR.prepareVisualTypes=function(e){if(vR(e)){var t=[];mR(e,(function(e,i){t.push(i)})),e=t}else{if(!fR.isArray(e))return[];e=e.slice()}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},yR.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},yR.findPieceIndex=function(e,t,i){for(var n,r=1/0,a=0,o=t.length;a<o;a++){var s=t[a].value;if(null!=s){if(s===e||"string"==typeof s&&s===e+"")return a;i&&c(s,a)}}for(a=0,o=t.length;a<o;a++){var l=t[a],u=l.interval,h=l.close;if(u){if(u[0]===-1/0){if(ER(h[1],e,u[1]))return a}else if(u[1]===1/0){if(ER(h[0],u[0],e))return a}else if(ER(h[0],u[0],e)&&ER(h[1],e,u[1]))return a;i&&c(u[0],a),i&&c(u[1],a)}}if(i)return e===1/0?t.length-1:e===-1/0?0:n;function c(t,i){var a=Math.abs(t-e);a<r&&(r=a,n=i)}};var LR=yR,PR=LR,NR=$e,RR=l,OR=RR.isArray;function kR(e,t,i,n){var r=e.getModel(),a=e.getLayout();if(a&&!a.invisible&&a.isInView){var o,s=e.getModel("itemStyle"),l=function(e,t,i){var n=RR.extend({},t),r=i.designatedVisualItemStyle;return RR.each(["color","colorAlpha","colorSaturation"],(function(i){r[i]=t[i];var a=e.get(i);r[i]=null,null!=a&&(n[i]=a)})),n}(s,t,n),u=s.get("borderColor"),h=s.get("borderColorSaturation");null!=h&&(u=function(e,t){return null!=t?NR.modifyHSL(t,null,null,e):null}(h,o=zR(l))),e.setVisual("borderColor",u);var c=e.viewChildren;if(c&&c.length){var d=function(e,t,i,n,r,a){if(!a||!a.length)return;var o=FR(t,"color")||null!=r.color&&"none"!==r.color&&(FR(t,"colorAlpha")||FR(t,"colorSaturation"));if(!o)return;var s=t.get("visualMin"),l=t.get("visualMax"),u=i.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var h=t.get("colorMappingBy"),c={type:o.name,dataExtent:u,visual:o.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new PR(c);return d.__drColorMappingBy=h,d}(0,r,a,0,l,c);RR.each(c,(function(e,t){if(e.depth>=i.length||e===i[e.depth]){var a=function(e,t,i,n,r,a){var o=RR.extend({},t);if(r){var s=r.type,l="color"===s&&r.__drColorMappingBy,u="index"===l?n:"id"===l?a.mapIdToIndex(i.getId()):i.getValue(e.get("visualDimension"));o[s]=r.mapValueToVisual(u)}return o}(r,l,e,t,d,n);kR(e,a,i,n)}}))}else o=zR(l),e.setVisual("color",o)}}function zR(e){var t=BR(e,"color");if(t){var i=BR(e,"colorAlpha"),n=BR(e,"colorSaturation");return n&&(t=NR.modifyHSL(t,null,null,n)),i&&(t=NR.modifyAlpha(t,i)),t}}function BR(e,t){var i=e[t];if(null!=i&&"none"!==i)return i}function FR(e,t){var i=e.get(t);return OR(i)&&i.length?{name:t,range:i}:null}var VR={seriesType:"treemap",reset:function(e,t,i,n){var r=e.getData().tree.root;r.isRemoved()||kR(r,{},e.getViewRoot().getAncestors(),e)}},GR=l,HR=wi,UR=wc,WR=UR.parsePercent,jR=UR.MAX_SAFE_INTEGER,XR=bc,ZR=mN,qR=Math.max,YR=Math.min,KR=GR.retrieve,QR=GR.each,JR=["itemStyle","borderWidth"],$R=["itemStyle","gapWidth"],eO=["upperLabel","show"],tO=["upperLabel","height"],iO={seriesType:"treemap",reset:function(e,t,i,n){var r=i.getWidth(),a=i.getHeight(),o=e.option,s=XR.getLayoutRect(e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=o.size||[],u=WR(KR(s.width,l[0]),r),h=WR(KR(s.height,l[1]),a),c=n&&n.type,d=ZR.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),f="treemapRender"===c||"treemapMove"===c?n.rootRect:null,p=e.getViewRoot(),g=ZR.getPathToRoot(p);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(e,t,i,n,r){var a,o=(t||{}).node,s=[n,r];if(!o||o===i)return s;var l=n*r,u=l*e.option.zoomToNodeRatio;for(;a=o.parentNode;){for(var h=0,c=a.children,d=0,f=c.length;d<f;d++)h+=c[d].getValue();var p=o.getValue();if(0===p)return s;u*=h/p;var g=a.getModel(),m=g.get(JR);(u+=4*m*m+(3*m+Math.max(m,sO(g)))*Math.pow(u,.5))>jR&&(u=jR),o=a}u<l&&(u=l);var v=Math.pow(u/l,.5);return[n*v,r*v]}(e,d,p,u,h):f?[f.width,f.height]:[u,h],v=o.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:o.squareRatio,sort:v,leafDepth:o.leafDepth};p.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};p.setLayout(_),nO(p,y,!1,0);_=p.getLayout();QR(g,(function(e,t){var i=(g[t+1]||p).getValue();e.setLayout(GR.extend({dataExtent:[i,i],borderWidth:0,upperHeight:0},_))}))}var x=e.getData().tree.root;x.setLayout(function(e,t,i){if(t)return{x:t.x,y:t.y};var n={x:0,y:0};if(!i)return n;var r=i.node,a=r.getLayout();if(!a)return n;var o=[a.width/2,a.height/2],s=r;for(;s;){var l=s.getLayout();o[0]+=l.x,o[1]+=l.y,s=s.parentNode}return{x:e.width/2-o[0],y:e.height/2-o[1]}}(s,f,d),!0),e.setLayoutInfo(s),oO(x,new HR(-s.x,-s.y,r,a),g,p,0)}};function nO(e,t,i,n){var r,a;if(!e.isRemoved()){var o=e.getLayout();r=o.width,a=o.height;var s=(f=e.getModel()).get(JR),l=f.get($R)/2,u=sO(f),h=Math.max(s,u),c=s-l,d=h-l,f=e.getModel();e.setLayout({borderWidth:s,upperHeight:h,upperLabelHeight:u},!0);var p=(r=qR(r-2*c,0))*(a=qR(a-c-d,0)),g=function(e,t,i,n,r,a){var o=e.children||[],s=n.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=n.leafDepth&&n.leafDepth<=a;if(r&&!l)return e.viewChildren=[];o=GR.filter(o,(function(e){return!e.isRemoved()})),function(e,t){t&&e.sort((function(e,i){var n="asc"===t?e.getValue()-i.getValue():i.getValue()-e.getValue();return 0===n?"asc"===t?e.dataIndex-i.dataIndex:i.dataIndex-e.dataIndex:n}))}(o,s);var u=function(e,t,i){for(var n=0,r=0,a=t.length;r<a;r++)n+=t[r].getValue();var o=e.get("visualDimension");if(t&&t.length)if("value"===o&&i)s=[t[t.length-1].getValue(),t[0].getValue()],"asc"===i&&s.reverse();else{var s=[1/0,-1/0];QR(t,(function(e){var t=e.getValue(o);t<s[0]&&(s[0]=t),t>s[1]&&(s[1]=t)}))}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(t,o,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,i,n,r){if(!n)return i;for(var a=e.get("visibleMin"),o=r.length,s=o,l=o-1;l>=0;l--){var u=r["asc"===n?o-l-1:l].getValue();u/i*t<a&&(s=l,i-=u)}return"asc"===n?r.splice(0,o-s):r.splice(s,o-s),i}(t,i,u.sum,s,o),0===u.sum)return e.viewChildren=[];for(var h=0,c=o.length;h<c;h++){var d=o[h].getValue()/u.sum*i;o[h].setLayout({area:d})}l&&(o.length&&e.setLayout({isLeafRoot:!0},!0),o.length=0);return e.viewChildren=o,e.setLayout({dataExtent:u.dataExtent},!0),o}(e,f,p,t,i,n);if(g.length){var m={x:c,y:d,width:r,height:a},v=YR(r,a),y=1/0,_=[];_.area=0;for(var x=0,b=g.length;x<b;){var w=g[x];_.push(w),_.area+=w.getLayout().area;var T=rO(_,v,t.squareRatio);T<=y?(x++,y=T):(_.area-=_.pop().getLayout().area,aO(_,v,m,l,!1),v=YR(m.width,m.height),_.length=_.area=0,y=1/0)}if(_.length&&aO(_,v,m,l,!0),!i){var S=f.get("childrenVisibleMin");null!=S&&p<S&&(i=!0)}for(x=0,b=g.length;x<b;x++)nO(g[x],t,i,n+1)}}}function rO(e,t,i){for(var n,r=0,a=1/0,o=0,s=e.length;o<s;o++)(n=e[o].getLayout().area)&&(n<a&&(a=n),n>r&&(r=n));var l=e.area*e.area,u=t*t*i;return l?qR(u*r/l,l/(u*a)):1/0}function aO(e,t,i,n,r){var a=t===i.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=i[s[a]],h=t?e.area/t:0;(r||h>i[l[o]])&&(h=i[l[o]]);for(var c=0,d=e.length;c<d;c++){var f=e[c],p={},g=h?f.getLayout().area/h:0,m=p[l[o]]=qR(h-2*n,0),v=i[s[a]]+i[l[a]]-u,y=c===d-1||v<g?v:g,_=p[l[a]]=qR(y-2*n,0);p[s[o]]=i[s[o]]+YR(n,m/2),p[s[a]]=u+YR(n,_/2),u+=y,f.setLayout(p,!0)}i[s[o]]+=h,i[l[o]]-=h}function oO(e,t,i,n,r){var a=e.getLayout(),o=i[r],s=o&&o===e;if(!(o&&!s||r===i.length&&e!==n)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(a),isAboveViewRoot:s},!0);var l=new HR(t.x-a.x,t.y-a.y,t.width,t.height);QR(e.viewChildren||[],(function(e){oO(e,l,i,n,r+1)}))}}function sO(e){return e.get(eO)?e.get(tO):0}var lO=n,uO=VR,hO=iO;lO.registerVisual(uO),lO.registerLayout(hO);var cO=l,dO=ro.enableClassCheck;function fO(e){return"_EC_"+e}var pO=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},gO=pO.prototype;function mO(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function vO(e,t,i){this.node1=e,this.node2=t,this.dataIndex=null==i?-1:i}gO.type="graph",gO.isDirected=function(){return this._directed},gO.addNode=function(e,t){e=null==e?""+t:""+e;var i=this._nodesMap;if(!i[fO(e)]){var n=new mO(e,t);return n.hostGraph=this,this.nodes.push(n),i[fO(e)]=n,n}},gO.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},gO.getNodeById=function(e){return this._nodesMap[fO(e)]},gO.addEdge=function(e,t,i){var n=this._nodesMap,r=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),mO.isInstance(e)||(e=n[fO(e)]),mO.isInstance(t)||(t=n[fO(t)]),e&&t){var a=e.id+"-"+t.id,o=new vO(e,t,i);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),r[a]=o,o}},gO.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},gO.getEdge=function(e,t){mO.isInstance(e)&&(e=e.id),mO.isInstance(t)&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},gO.eachNode=function(e,t){for(var i=this.nodes,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&e.call(t,i[r],r)},gO.eachEdge=function(e,t){for(var i=this.edges,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&i[r].node1.dataIndex>=0&&i[r].node2.dataIndex>=0&&e.call(t,i[r],r)},gO.breadthFirstTraverse=function(e,t,i,n){if(mO.isInstance(t)||(t=this._nodesMap[fO(t)]),t){for(var r="out"===i?"outEdges":"in"===i?"inEdges":"edges",a=0;a<this.nodes.length;a++)this.nodes[a].__visited=!1;if(!e.call(n,t,null))for(var o=[t];o.length;){var s=o.shift(),l=s[r];for(a=0;a<l.length;a++){var u=l[a],h=u.node1===s?u.node2:u.node1;if(!h.__visited){if(e.call(n,h,s))return;o.push(h),h.__visited=!0}}}}},gO.update=function(){for(var e=this.data,t=this.edgeData,i=this.nodes,n=this.edges,r=0,a=i.length;r<a;r++)i[r].dataIndex=-1;for(r=0,a=e.count();r<a;r++)i[e.getRawIndex(r)].dataIndex=r;t.filterSelf((function(e){var i=n[t.getRawIndex(e)];return i.node1.dataIndex>=0&&i.node2.dataIndex>=0}));for(r=0,a=n.length;r<a;r++)n[r].dataIndex=-1;for(r=0,a=t.count();r<a;r++)n[t.getRawIndex(r)].dataIndex=r},gO.clone=function(){for(var e=new pO(this._directed),t=this.nodes,i=this.edges,n=0;n<t.length;n++)e.addNode(t[n].id,t[n].dataIndex);for(n=0;n<i.length;n++){var r=i[n];e.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return e},mO.prototype={constructor:mO,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)}},vO.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};var yO=function(e,t){return{getValue:function(i){var n=this[e][t];return n.get(n.getDimension(i||"value"),this.dataIndex)},setVisual:function(i,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[e][t].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}};cO.mixin(mO,yO("hostGraph","data")),cO.mixin(vO,yO("hostGraph","edgeData")),pO.Node=mO,pO.Edge=vO,dO(mO),dO(vO);var _O=l,xO=Jy,bO=pO,wO=yP,TO=y_,SO=Bf,MO=U_;var AO=function(e,t,i,n,r){for(var a=new bO(n),o=0;o<e.length;o++)a.addNode(_O.retrieve(e[o].id,e[o].name,o),o);var s=[],l=[],u=0;for(o=0;o<t.length;o++){var h=t[o],c=h.source,d=h.target;a.addEdge(c,d,u)&&(l.push(h),s.push(_O.retrieve(h.id,c+" > "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=MO(e,i);else{var g=SO.get(p),m=g&&"view"!==g.type&&g.dimensions||[];_O.indexOf(m,"value")<0&&m.concat(["value"]);var v=TO(e,{coordDimensions:m});(f=new xO(v,i)).initData(e)}var y=new xO(["value"],i);return y.initData(l,s),r&&r(f,y),wO({mainData:f,struct:a,structAttr:"graph",datas:{node:f,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a},IO={},CO=l,DO=function(e){return e.get("autoCurveness")||null},EO=function(e,t){var i=DO(e),n=20,r=[];if("number"==typeof i)n=i;else if(CO.isArray(i))return void(e.__curvenessList=i);t>n&&(n=t);var a=n%2?n+2:n+3;r=[];for(var o=0;o<a;o++)r.push((o%2?o+1:o)/10*(o%2?-1:1));e.__curvenessList=r},LO=function(e,t,i){var n=[e.id,e.dataIndex].join("."),r=[t.id,t.dataIndex].join(".");return[i.uid,n,r].join("--\x3e")},PO=function(e){var t=e.split("--\x3e");return[t[0],t[2],t[1]].join("--\x3e")},NO=function(e,t){var i=t.__edgeMap;return i[e]?i[e].length:0};IO.initCurvenessList=function(e){DO(e)&&(e.__curvenessList=[],e.__edgeMap={},EO(e))},IO.createEdgeMapForCurveness=function(e,t,i,n){if(DO(i)){var r=LO(e,t,i),a=i.__edgeMap,o=a[PO(r)];a[r]&&!o?a[r].isForward=!0:o&&a[r]&&(o.isForward=!0,a[r].isForward=!1),a[r]=a[r]||[],a[r].push(n)}},IO.getCurvenessForEdge=function(e,t,i,n){var r=DO(t),a=CO.isArray(r);if(!r)return null;var o=function(e,t){var i=LO(e.node1,e.node2,t);return t.__edgeMap[i]}(e,t);if(!o)return null;for(var s=-1,l=0;l<o.length;l++)if(o[l]===i){s=l;break}var u=function(e,t){return NO(LO(e.node1,e.node2,t),t)+NO(LO(e.node2,e.node1,t),t)}(e,t);EO(t,u),e.lineStyle=e.lineStyle||{};var h=LO(e.node1,e.node2,t),c=t.__curvenessList,d=a||u%2?0:1;if(o.isForward)return c[d+s];var f=PO(h),p=NO(f,t),g=c[s+p+d];return n?a?r&&0===r[0]?(p+d)%2?g:-g:((p%2?0:1)+d)%2?g:-g:(p+d)%2?g:-g:c[s+p+d]};var RO=n,OO=Jy,kO=l,zO=qa.defaultEmphasis,BO=mc,FO=Ac.encodeHTML,VO=AO,GO=ZI,HO=IO,UO=HO.initCurvenessList,WO=HO.createEdgeMapForCurveness,jO=RO.extendSeriesModel({type:"series.graph",init:function(e){jO.superApply(this,"init",arguments);var t=this;function i(){return t._categoriesData}this.legendVisualProvider=new GO(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeOption:function(e){jO.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(e){jO.superApply(this,"mergeDefaultAndTheme",arguments),zO(e,["edgeLabel"],["show"])},getInitialData:function(e,t){var i=e.edges||e.links||[],n=e.data||e.nodes||[],r=this;if(n&&i){UO(this);var a=VO(n,i,this,!0,(function(e,i){e.wrapMethod("getItemModel",(function(e){var t=r._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=r.getModel("edgeLabel"),a=new BO({label:n.option},n.parentModel,t),o=r.getModel("emphasis.edgeLabel"),s=new BO({emphasis:{label:o.option}},o.parentModel,t);function l(e){return(e=this.parsePath(e))&&"label"===e[0]?a:e&&"emphasis"===e[0]&&"label"===e[1]?s:this.parentModel}i.wrapMethod("getItemModel",(function(e){return e.customizeGetParent(l),e}))}));return kO.each(a.edges,(function(e){WO(e.node1,e.node2,this,e.dataIndex)}),this),a.data}},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getData(),r=this.getDataParams(e,i),a=n.graph.getEdgeByIndex(e),o=n.getName(a.node1.dataIndex),s=n.getName(a.node2.dataIndex),l=[];return null!=o&&l.push(o),null!=s&&l.push(s),l=FO(l.join(" > ")),r.value&&(l+=" : "+FO(r.value)),l}return jO.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=kO.map(this.option.categories||[],(function(e){return null!=e.value?e:kO.extend({value:0},e)})),t=new OO(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},isAnimationEnabled:function(){return jO.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}}}}),XO=yo,ZO=P,qO=XO.Line.prototype,YO=XO.BezierCurve.prototype;function KO(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var QO=XO.extendShape({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(e,t){this[KO(t)?"_buildPathLine":"_buildPathCurve"](e,t)},_buildPathLine:qO.buildPath,_buildPathCurve:YO.buildPath,pointAt:function(e){return this[KO(this.shape)?"_pointAtLine":"_pointAtCurve"](e)},_pointAtLine:qO.pointAt,_pointAtCurve:YO.pointAt,tangentAt:function(e){var t=this.shape,i=KO(t)?[t.x2-t.x1,t.y2-t.y1]:this._tangentAtCurve(e);return ZO.normalize(i,i)},_tangentAtCurve:YO.tangentAt}),JO=l,$O=P,ek=Ab,tk=QO,ik=yo,nk=wc.round,rk=["fromSymbol","toSymbol"];function ak(e){return"_"+e+"Type"}function ok(e,t,i){var n=t.getItemVisual(i,e);if(n&&"none"!==n){var r=t.getItemVisual(i,"color"),a=t.getItemVisual(i,e+"Size"),o=t.getItemVisual(i,e+"Rotate");JO.isArray(a)||(a=[a,a]);var s=ek.createSymbol(n,-a[0]/2,-a[1]/2,a[0],a[1],r);return s.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,s.name=e,s}}function sk(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var i=t[2];i?(e.cpx1=i[0],e.cpy1=i[1]):(e.cpx1=NaN,e.cpy1=NaN)}function lk(e,t,i){ik.Group.call(this),this._createLine(e,t,i)}var uk=lk.prototype;uk.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),i=e.childOfName("toSymbol"),n=e.childOfName("label");if(t||i||!n.ignore){for(var r=1,a=this.parent;a;)a.scale&&(r/=a.scale[0]),a=a.parent;var o=e.childOfName("line");if(this.__dirty||o.__dirty){var s=o.shape.percent,l=o.pointAt(0),u=o.pointAt(s),h=$O.sub([],u,l);if($O.normalize(h,h),t){if(t.attr("position",l),null==(d=t.__specifiedRotation)){var c=o.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(c[1],c[0]))}else t.attr("rotation",d);t.attr("scale",[r*s,r*s])}if(i){var d;if(i.attr("position",u),null==(d=i.__specifiedRotation)){c=o.tangentAt(1);i.attr("rotation",-Math.PI/2-Math.atan2(c[1],c[0]))}else i.attr("rotation",d);i.attr("scale",[r*s,r*s])}if(!n.ignore){var f,p,g,m;n.attr("position",u);var v=n.__labelDistance,y=v[0]*r,_=v[1]*r,x=s/2,b=[(c=o.tangentAt(x))[1],-c[0]],w=o.pointAt(x);b[1]>0&&(b[0]=-b[0],b[1]=-b[1]);var T,S=c[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var M=-Math.atan2(c[1],c[0]);u[0]<l[0]&&(M=Math.PI+M),n.attr("rotation",M)}switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":T=-_,g="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":T=_,g="top";break;default:T=0,g="middle"}switch(n.__position){case"end":f=[h[0]*y+u[0],h[1]*_+u[1]],p=h[0]>.8?"left":h[0]<-.8?"right":"center",g=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":f=[-h[0]*y+l[0],-h[1]*_+l[1]],p=h[0]>.8?"right":h[0]<-.8?"left":"center",g=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":f=[y*S+l[0],l[1]+T],p=c[0]<0?"right":"left",m=[-y*S,-T];break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":f=[w[0],w[1]+T],p="center",m=[0,-T];break;case"insideEndTop":case"insideEnd":case"insideEndBottom":f=[-y*S+u[0],u[1]+T],p=c[0]>=0?"right":"left",m=[y*S,-T]}n.attr({style:{textVerticalAlign:n.__verticalAlign||g,textAlign:n.__textAlign||p},position:f,scale:[r,r],origin:m})}}}},uk._createLine=function(e,t,i){var n=e.hostModel,r=function(e){var t=new tk({name:"line",subPixelOptimize:!0});return sk(t.shape,e),t}(e.getItemLayout(t));r.shape.percent=0,ik.initProps(r,{shape:{percent:1}},n,t),this.add(r);var a=new ik.Text({name:"label",lineLabelOriginalOpacity:1});this.add(a),JO.each(rk,(function(i){var n=ok(i,e,t);this.add(n),this[ak(i)]=e.getItemVisual(t,i)}),this),this._updateCommonStl(e,t,i)},uk.updateData=function(e,t,i){var n=e.hostModel,r=this.childOfName("line"),a=e.getItemLayout(t),o={shape:{}};sk(o.shape,a),ik.updateProps(r,o,n,t),JO.each(rk,(function(i){var n=e.getItemVisual(t,i),r=ak(i);if(this[r]!==n){this.remove(this.childOfName(i));var a=ok(i,e,t);this.add(a)}this[r]=n}),this),this._updateCommonStl(e,t,i)},uk._updateCommonStl=function(e,t,i){var n=e.hostModel,r=this.childOfName("line"),a=i&&i.lineStyle,o=i&&i.hoverLineStyle,s=i&&i.labelModel,l=i&&i.hoverLabelModel;if(!i||e.hasItemOption){var u=e.getItemModel(t);a=u.getModel("lineStyle").getLineStyle(),o=u.getModel("emphasis.lineStyle").getLineStyle(),s=u.getModel("label"),l=u.getModel("emphasis.label")}var h=e.getItemVisual(t,"color"),c=JO.retrieve3(e.getItemVisual(t,"opacity"),a.opacity,1);r.useStyle(JO.defaults({strokeNoScale:!0,fill:"none",stroke:h,opacity:c},a)),r.hoverStyle=o,JO.each(rk,(function(e){var t=this.childOfName(e);t&&(t.setColor(h),t.setStyle({opacity:c}))}),this);var d,f,p=s.getShallow("show"),g=l.getShallow("show"),m=this.childOfName("label");if((p||g)&&(d=h||"#000",null==(f=n.getFormattedLabel(t,"normal",e.dataType)))){var v=n.getRawValue(t);f=null==v?e.getName(t):isFinite(v)?nk(v):v}var y=p?f:null,_=g?JO.retrieve2(n.getFormattedLabel(t,"emphasis",e.dataType),f):null,x=m.style;if(null!=y||null!=_){ik.setTextStyle(m.style,s,{text:y},{autoColor:d}),m.__textAlign=x.textAlign,m.__verticalAlign=x.textVerticalAlign,m.__position=s.get("position")||"middle";var b=s.get("distance");JO.isArray(b)||(b=[b,b]),m.__labelDistance=b}m.hoverStyle=null!=_?{text:_,textFill:l.getTextColor(!0),fontStyle:l.getShallow("fontStyle"),fontWeight:l.getShallow("fontWeight"),fontSize:l.getShallow("fontSize"),fontFamily:l.getShallow("fontFamily")}:{text:null},m.ignore=!p&&!g,ik.setHoverStyle(this)},uk.highlight=function(){this.trigger("emphasis")},uk.downplay=function(){this.trigger("normal")},uk.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},uk.setLinePoints=function(e){var t=this.childOfName("line");sk(t.shape,e),t.dirty()},JO.inherits(lk,ik.Group);var hk=lk,ck=yo,dk=hk;function fk(e){this._ctor=e||dk,this.group=new ck.Group}var pk=fk.prototype;function gk(e){var t=e.hostModel;return{lineStyle:t.getModel("lineStyle").getLineStyle(),hoverLineStyle:t.getModel("emphasis.lineStyle").getLineStyle(),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label")}}function mk(e){return isNaN(e[0])||isNaN(e[1])}function vk(e){return!mk(e[0])&&!mk(e[1])}pk.isPersistent=function(){return!0},pk.updateData=function(e){var t=this,i=t.group,n=t._lineData;t._lineData=e,n||i.removeAll();var r=gk(e);e.diff(n).add((function(i){!function(e,t,i,n){if(!vk(t.getItemLayout(i)))return;var r=new e._ctor(t,i,n);t.setItemGraphicEl(i,r),e.group.add(r)}(t,e,i,r)})).update((function(i,a){!function(e,t,i,n,r,a){var o=t.getItemGraphicEl(n);if(!vk(i.getItemLayout(r)))return void e.group.remove(o);o?o.updateData(i,r,a):o=new e._ctor(i,r,a);i.setItemGraphicEl(r,o),e.group.add(o)}(t,n,e,a,i,r)})).remove((function(e){i.remove(n.getItemGraphicEl(e))})).execute()},pk.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,i){t.updateLayout(e,i)}),this)},pk.incrementalPrepareUpdate=function(e){this._seriesScope=gk(e),this._lineData=null,this.group.removeAll()},pk.incrementalUpdate=function(e,t){function i(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=e.useHoverLayer=!0)}for(var n=e.start;n<e.end;n++){if(vk(t.getItemLayout(n))){var r=new this._ctor(t,n,this._seriesScope);r.traverse(i),this.group.add(r),t.setItemGraphicEl(n,r)}}},pk.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},pk._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var yk=fk,_k={};_k.getNodeGlobalScale=function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var i=e.option.nodeScaleRatio,n=t.scale,r=n&&n[0]||1;return((t.getZoom()-1)*i+1)/r},_k.getSymbolSize=function(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t};var xk=xo,bk=P,wk=_k.getSymbolSize,Tk=[],Sk=[],Mk=[],Ak=xk.quadraticAt,Ik=bk.distSquare,Ck=Math.abs;function Dk(e,t,i){for(var n,r=e[0],a=e[1],o=e[2],s=1/0,l=i*i,u=.1,h=.1;h<=.9;h+=.1){Tk[0]=Ak(r[0],a[0],o[0],h),Tk[1]=Ak(r[1],a[1],o[1],h),(f=Ck(Ik(Tk,t)-l))<s&&(s=f,n=h)}for(var c=0;c<32;c++){var d=n+u;Sk[0]=Ak(r[0],a[0],o[0],n),Sk[1]=Ak(r[1],a[1],o[1],n),Mk[0]=Ak(r[0],a[0],o[0],d),Mk[1]=Ak(r[1],a[1],o[1],d);var f=Ik(Sk,t)-l;if(Ck(f)<.01)break;var p=Ik(Mk,t)-l;u/=2,f<0?p>=0?n+=u:n-=u:p>=0?n-=u:n+=u}return n}var Ek=function(e,t){var i=[],n=xk.quadraticSubdivide,r=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),h=e.getVisual("toSymbol");l.__original||(l.__original=[bk.clone(l[0]),bk.clone(l[1])],l[2]&&l.__original.push(bk.clone(l[2])));var c=l.__original;if(null!=l[2]){if(bk.copy(r[0],c[0]),bk.copy(r[1],c[2]),bk.copy(r[2],c[1]),u&&"none"!==u){var d=wk(e.node1),f=Dk(r,c[0],d*t);n(r[0][0],r[1][0],r[2][0],f,i),r[0][0]=i[3],r[1][0]=i[4],n(r[0][1],r[1][1],r[2][1],f,i),r[0][1]=i[3],r[1][1]=i[4]}if(h&&"none"!==h){d=wk(e.node2),f=Dk(r,c[1],d*t);n(r[0][0],r[1][0],r[2][0],f,i),r[1][0]=i[1],r[2][0]=i[2],n(r[0][1],r[1][1],r[2][1],f,i),r[1][1]=i[1],r[2][1]=i[2]}bk.copy(l[0],r[0]),bk.copy(l[1],r[2]),bk.copy(l[2],r[1])}else{if(bk.copy(a[0],c[0]),bk.copy(a[1],c[1]),bk.sub(o,a[1],a[0]),bk.normalize(o,o),u&&"none"!==u){d=wk(e.node1);bk.scaleAndAdd(a[0],a[0],o,d*t)}if(h&&"none"!==h){d=wk(e.node2);bk.scaleAndAdd(a[1],a[1],o,-d*t)}bk.copy(l[0],a[0]),bk.copy(l[1],a[1])}}))},Lk=n,Pk=l,Nk=RT,Rk=yk,Ok=eL,kk=tL,zk=iL.onIrrelevantElement,Bk=yo,Fk=Ek,Vk=_k.getNodeGlobalScale,Gk="__focusNodeAdjacency",Hk=["itemStyle","opacity"],Uk=["lineStyle","opacity"];function Wk(e,t){var i=e.getVisual("opacity");return null!=i?i:e.getModel().get(t)}function jk(e,t,i){var n=e.getGraphicEl(),r=Wk(e,t);null!=i&&(null==r&&(r=1),r*=i),n.downplay&&n.downplay(),n.traverse((function(e){if(!e.isGroup){var t=e.lineLabelOriginalOpacity;null!=t&&null==i||(t=r),e.setStyle("opacity",t)}}))}function Xk(e,t){var i=Wk(e,t),n=e.getGraphicEl();n.traverse((function(e){!e.isGroup&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}Lk.extendChartView({type:"graph",init:function(e,t){var i=new Nk,n=new Rk,r=this.group;this._controller=new Ok(t.getZr()),this._controllerHost={target:r},r.add(i.group),r.add(n.group),this._symbolDraw=i,this._lineDraw=n,this._firstRender=!0},render:function(e,t,i){var n=this,r=e.coordinateSystem;this._model=e;var a=this._symbolDraw,o=this._lineDraw,s=this.group;if("view"===r.type){var l={position:r.position,scale:r.scale};this._firstRender?s.attr(l):Bk.updateProps(s,l,e)}Fk(e.getGraph(),Vk(e));var u=e.getData();a.updateData(u);var h=e.getEdgeData();o.updateData(h),this._updateNodeAndLinkScale(),this._updateController(e,t,i),clearTimeout(this._layoutTimeout);var c=e.forceLayout,d=e.get("force.layoutAnimation");c&&this._startForceLayoutIteration(c,d),u.eachItemGraphicEl((function(t,r){var a=u.getItemModel(r);t.off("drag").off("dragend");var o=a.get("draggable");o&&t.on("drag",(function(){c&&(c.warmUp(),!this._layouting&&this._startForceLayoutIteration(c,d),c.setFixed(r),u.setItemLayout(r,t.position))}),this).on("dragend",(function(){c&&c.setUnfixed(r)}),this),t.setDraggable(o&&c),t[Gk]&&t.off("mouseover",t[Gk]),t.__unfocusNodeAdjacency&&t.off("mouseout",t.__unfocusNodeAdjacency),a.get("focusNodeAdjacency")&&(t.on("mouseover",t[Gk]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex})}),t.on("mouseout",t.__unfocusNodeAdjacency=function(){n._dispatchUnfocus(i)}))}),this),u.graph.eachEdge((function(t){var r=t.getGraphicEl();r[Gk]&&r.off("mouseover",r[Gk]),r.__unfocusNodeAdjacency&&r.off("mouseout",r.__unfocusNodeAdjacency),t.getModel().get("focusNodeAdjacency")&&(r.on("mouseover",r[Gk]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex})}),r.on("mouseout",r.__unfocusNodeAdjacency=function(){n._dispatchUnfocus(i)}))}));var f="circular"===e.get("layout")&&e.get("circular.rotateLabel"),p=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(e,t){var i=u.getItemModel(t).get("label.rotate")||0,n=e.getSymbolPath();if(f){var r=u.getItemLayout(t),a=Math.atan2(r[1]-g,r[0]-p);a<0&&(a=2*Math.PI+a);var o=r[0]<p;o&&(a-=Math.PI);var s=o?"left":"right";Bk.modifyLabelStyle(n,{textRotation:-a,textPosition:s,textOrigin:"center"},{textPosition:s})}else Bk.modifyLabelStyle(n,{textRotation:i*=Math.PI/180})})),this._firstRender=!1},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={},this._clearTimer()},_dispatchUnfocus:function(e,t){var i=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){i._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:i._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var r=e.getData().graph,a=n.dataIndex,o=n.edgeDataIndex,s=r.getNodeByIndex(a),l=r.getEdgeByIndex(o);(s||l)&&(r.eachNode((function(e){jk(e,Hk,.1)})),r.eachEdge((function(e){jk(e,Uk,.1)})),s&&(Xk(s,Hk),Pk.each(s.edges,(function(e){e.dataIndex<0||(Xk(e,Uk),Xk(e.node1,Hk),Xk(e.node2,Hk))}))),l&&(Xk(l,Uk),Xk(l.node1,Hk),Xk(l.node2,Hk)))},unfocusNodeAdjacency:function(e,t,i,n){var r=e.getData().graph;r.eachNode((function(e){jk(e,Hk)})),r.eachEdge((function(e){jk(e,Uk)}))},_startForceLayoutIteration:function(e,t){var i=this;!function n(){e.step((function(e){i.updateLayout(i._model),(i._layouting=!e)&&(t?i._layoutTimeout=setTimeout(n,16):n())}))}()},_updateController:function(e,t,i){var n=this._controller,r=this._controllerHost,a=this.group;n.setPointerChecker((function(t,n,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(n,r)&&!zk(t,i,e)})),"view"===e.coordinateSystem.type?(n.enable(e.get("roam")),r.zoomLimit=e.get("scaleLimit"),r.zoom=e.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",(function(t){kk.updateViewOnPan(r,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){kk.updateViewOnZoom(r,t.scale,t.originX,t.originY),i.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(),Fk(e.getGraph(),Vk(e)),this._lineDraw.updateLayout()}),this)):n.disable()},_updateNodeAndLinkScale:function(){var e=this._model,t=e.getData(),i=Vk(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},updateLayout:function(e){Fk(e.getGraph(),Vk(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()}});var Zk=n;Zk.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},(function(){})),Zk.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},(function(){}));var qk=n,Yk=bL.updateCenterAndZoom;qk.registerAction({type:"graphRoam",event:"graphRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){var i=t.coordinateSystem,n=Yk(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var Kk=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),n=e.getGraph().data,r=i.mapArray(i.getName);n.filterSelf((function(e){var i=n.getItemModel(e).getShallow("category");if(null!=i){"number"==typeof i&&(i=r[i]);for(var a=0;a<t.length;a++)if(!t[a].isSelected(i))return!1}return!0}))}),this)};var Qk=function(e){var t={};e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),n=e.getData(),r={};i.each((function(n){var a=i.getName(n);r["ec-"+a]=n;var o=i.getItemModel(n),s=o.get("itemStyle.color")||e.getColorFromPalette(a,t);i.setItemVisual(n,"color",s);for(var l=["opacity","symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var h=o.getShallow(l[u],!0);null!=h&&i.setItemVisual(n,l[u],h)}})),i.count()&&n.each((function(e){var t=n.getItemModel(e).getShallow("category");if(null!=t){"string"==typeof t&&(t=r["ec-"+t]);for(var a=["color","opacity","symbol","symbolSize","symbolKeepAspect"],o=0;o<a.length;o++)null==n.getItemVisual(e,a[o],!0)&&n.setItemVisual(e,a[o],i.getItemVisual(t,a[o]))}}))}))};function Jk(e){return e instanceof Array||(e=[e,e]),e}var $k=function(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),i=e.getEdgeData(),n=Jk(e.get("edgeSymbol")),r=Jk(e.get("edgeSymbolSize")),a="lineStyle.color".split("."),o="lineStyle.opacity".split(".");i.setVisual("fromSymbol",n&&n[0]),i.setVisual("toSymbol",n&&n[1]),i.setVisual("fromSymbolSize",r&&r[0]),i.setVisual("toSymbolSize",r&&r[1]),i.setVisual("color",e.get(a)),i.setVisual("opacity",e.get(o)),i.each((function(e){var n=i.getItemModel(e),r=t.getEdgeByIndex(e),s=Jk(n.getShallow("symbol",!0)),l=Jk(n.getShallow("symbolSize",!0)),u=n.get(a),h=n.get(o);switch(u){case"source":u=r.node1.getVisual("color");break;case"target":u=r.node2.getVisual("color")}s[0]&&r.setVisual("fromSymbol",s[0]),s[1]&&r.setVisual("toSymbol",s[1]),l[0]&&r.setVisual("fromSymbolSize",l[0]),l[1]&&r.setVisual("toSymbolSize",l[1]),r.setVisual("color",u),r.setVisual("opacity",h)}))}))},ez={},tz=P,iz=l,nz=IO.getCurvenessForEdge;function rz(e,t){e.eachEdge((function(e,i){var n=iz.retrieve3(e.getModel().get("lineStyle.curveness"),-nz(e,t,i,!0),0),r=tz.clone(e.node1.getLayout()),a=tz.clone(e.node2.getLayout()),o=[r,a];+n&&o.push([(r[0]+a[0])/2-(r[1]-a[1])*n,(r[1]+a[1])/2-(a[0]-r[0])*n]),e.setLayout(o)}))}ez.simpleLayout=function(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var i=e.getGraph();i.eachNode((function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])})),rz(i,e)}},ez.simpleLayoutEdge=rz;var az=l.each,oz=ez,sz=oz.simpleLayout,lz=oz.simpleLayoutEdge;var uz=function(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),i=e.coordinateSystem;if(i&&"view"!==i.type){var n=e.getData(),r=[];az(i.dimensions,(function(e){r=r.concat(n.mapDimension(e,!0))}));for(var a=0;a<n.count();a++){for(var o=[],s=!1,l=0;l<r.length;l++){var u=n.get(r[l],a);isNaN(u)||(s=!0),o.push(u)}s?n.setItemLayout(a,i.dataToPoint(o)):n.setItemLayout(a,[NaN,NaN])}lz(n.graph,e)}else t&&"none"!==t||sz(e)}))},hz={},cz=P,dz=_k,fz=dz.getSymbolSize,pz=dz.getNodeGlobalScale,gz=l,mz=IO.getCurvenessForEdge,vz=Math.PI,yz=[];var _z={value:function(e,t,i,n,r,a,o,s){var l=0,u=n.getSum("value"),h=2*Math.PI/(u||s);i.eachNode((function(e){var t=e.getValue("value"),i=h*(u?t:1)/2;l+=i,e.setLayout([r*Math.cos(l)+a,r*Math.sin(l)+o]),l+=i}))},symbolSize:function(e,t,i,n,r,a,o,s){var l=0;yz.length=s;var u=pz(e);i.eachNode((function(e){var t=fz(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=u;var i=Math.asin(t/2/r);isNaN(i)&&(i=vz/2),yz[e.dataIndex]=i,l+=2*i}));var h=(2*vz-l)/s/2,c=0;i.eachNode((function(e){var t=h+yz[e.dataIndex];c+=t,e.setLayout([r*Math.cos(c)+a,r*Math.sin(c)+o]),c+=t}))}};hz.circularLayout=function(e,t){var i=e.coordinateSystem;if(!i||"view"===i.type){var n=i.getBoundingRect(),r=e.getData(),a=r.graph,o=n.width/2+n.x,s=n.height/2+n.y,l=Math.min(n.width,n.height)/2,u=r.count();r.setLayout({cx:o,cy:s}),u&&(_z[t](e,i,a,r,l,o,s,u),a.eachEdge((function(t,i){var n,r=gz.retrieve3(t.getModel().get("lineStyle.curveness"),mz(t,e,i),0),a=cz.clone(t.node1.getLayout()),l=cz.clone(t.node2.getLayout()),u=(a[0]+l[0])/2,h=(a[1]+l[1])/2;+r&&(n=[o*(r*=3)+u*(1-r),s*r+h*(1-r)]),t.setLayout([a,l,n])})))}};var xz=hz.circularLayout;var bz=function(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&xz(e,"symbolSize")}))},wz={},Tz=P,Sz=Tz.scaleAndAdd;wz.forceLayout=function(e,t,i){for(var n=i.rect,r=n.width,a=n.height,o=[n.x+r/2,n.y+a/2],s=null==i.gravity?.1:i.gravity,l=0;l<e.length;l++){var u=e[l];u.p||(u.p=Tz.create(r*(Math.random()-.5)+o[0],a*(Math.random()-.5)+o[1])),u.pp=Tz.clone(u.p),u.edges=null}var h=null==i.friction?.6:i.friction,c=h;return{warmUp:function(){c=.8*h},setFixed:function(t){e[t].fixed=!0},setUnfixed:function(t){e[t].fixed=!1},step:function(i){for(var n=[],r=e.length,a=0;a<t.length;a++){var l=t[a];if(!l.ignoreForceLayout){var u=l.n1,h=l.n2;Tz.sub(n,h.p,u.p);var d=Tz.len(n)-l.d,f=h.w/(u.w+h.w);isNaN(f)&&(f=0),Tz.normalize(n,n),!u.fixed&&Sz(u.p,u.p,n,f*d*c),!h.fixed&&Sz(h.p,h.p,n,-(1-f)*d*c)}}for(a=0;a<r;a++){(v=e[a]).fixed||(Tz.sub(n,o,v.p),Sz(v.p,v.p,n,s*c))}for(a=0;a<r;a++){u=e[a];for(var p=a+1;p<r;p++){h=e[p];Tz.sub(n,h.p,u.p),0===(d=Tz.len(n))&&(Tz.set(n,Math.random()-.5,Math.random()-.5),d=1);var g=(u.rep+h.rep)/d/d;!u.fixed&&Sz(u.pp,u.pp,n,g),!h.fixed&&Sz(h.pp,h.pp,n,-g)}}var m=[];for(a=0;a<r;a++){var v;(v=e[a]).fixed||(Tz.sub(m,v.p,v.pp),Sz(v.p,v.p,m,c),Tz.copy(v.pp,v.p))}c*=.992,i&&i(e,t,c<.01)}}};var Mz=wz.forceLayout,Az=ez.simpleLayout,Iz=hz.circularLayout,Cz=wc.linearMap,Dz=P,Ez=l,Lz=IO.getCurvenessForEdge;var Pz=function(e){e.eachSeriesByType("graph",(function(e){if(!(c=e.coordinateSystem)||"view"===c.type)if("force"===e.get("layout")){var t=e.preservedPoints||{},i=e.getGraph(),n=i.data,r=i.edgeData,a=e.getModel("force"),o=a.get("initLayout");e.preservedPoints?n.each((function(e){var i=n.getId(e);n.setItemLayout(e,t[i]||[NaN,NaN])})):o&&"none"!==o?"circular"===o&&Iz(e,"value"):Az(e);var s=n.getDataExtent("value"),l=r.getDataExtent("value"),u=a.get("repulsion"),h=a.get("edgeLength");Ez.isArray(u)||(u=[u,u]),Ez.isArray(h)||(h=[h,h]),h=[h[1],h[0]];var c,d=n.mapArray("value",(function(e,t){var i=n.getItemLayout(t),r=Cz(e,s,u);return isNaN(r)&&(r=(u[0]+u[1])/2),{w:r,rep:r,fixed:n.getItemModel(t).get("fixed"),p:!i||isNaN(i[0])||isNaN(i[1])?null:i}})),f=r.mapArray("value",(function(t,n){var r=i.getEdgeByIndex(n),a=Cz(t,l,h);isNaN(a)&&(a=(h[0]+h[1])/2);var o=r.getModel(),s=Ez.retrieve3(o.get("lineStyle.curveness"),-Lz(r,e,n,!0),0);return{n1:d[r.node1.dataIndex],n2:d[r.node2.dataIndex],d:a,curveness:s,ignoreForceLayout:o.get("ignoreForceLayout")}})),p=(c=e.coordinateSystem).getBoundingRect(),g=Mz(d,f,{rect:p,gravity:a.get("gravity"),friction:a.get("friction")}),m=g.step;g.step=function(e){for(var r=0,a=d.length;r<a;r++)d[r].fixed&&Dz.copy(d[r].p,i.getNodeByIndex(r).getLayout());m((function(r,a,o){for(var s=0,l=r.length;s<l;s++)r[s].fixed||i.getNodeByIndex(s).setLayout(r[s].p),t[n.getId(s)]=r[s].p;for(s=0,l=a.length;s<l;s++){var u=a[s],h=i.getEdgeByIndex(s),c=u.n1.p,d=u.n2.p,f=h.getLayout();(f=f?f.slice():[])[0]=f[0]||[],f[1]=f[1]||[],Dz.copy(f[0],c),Dz.copy(f[1],d),+u.curveness&&(f[2]=[(c[0]+d[0])/2-(c[1]-d[1])*u.curveness,(c[1]+d[1])/2-(d[0]-c[0])*u.curveness]),h.setLayout(f)}e&&e(o)}))},e.forceLayout=g,e.preservedPoints=t,g.step()}else e.forceLayout=null}))},Nz=RL,Rz=bc.getLayoutRect,Oz=Oo;var kz=n,zz=Kk,Bz=OS,Fz=Qk,Vz=$k,Gz=uz,Hz=bz,Uz=Pz,Wz=function(e,t){var i=[];return e.eachSeriesByType("graph",(function(e){var n=e.get("coordinateSystem");if(!n||"view"===n){var r=e.getData(),a=r.mapArray((function(e){var t=r.getItemModel(e);return[+t.get("x"),+t.get("y")]})),o=[],s=[];Oz.fromPoints(a,o,s),s[0]-o[0]==0&&(s[0]+=1,o[0]-=1),s[1]-o[1]==0&&(s[1]+=1,o[1]-=1);var l=(s[0]-o[0])/(s[1]-o[1]),u=function(e,t,i){var n=e.getBoxLayoutParams();return n.aspect=i,Rz(n,{width:t.getWidth(),height:t.getHeight()})}(e,t,l);isNaN(l)&&(o=[u.x,u.y],s=[u.x+u.width,u.y+u.height]);var h=s[0]-o[0],c=s[1]-o[1],d=u.width,f=u.height,p=e.coordinateSystem=new Nz;p.zoomLimit=e.get("scaleLimit"),p.setBoundingRect(o[0],o[1],h,c),p.setViewRect(u.x,u.y,d,f),p.setCenter(e.get("center")),p.setZoom(e.get("zoom")),i.push(p)}})),i};kz.registerProcessor(zz),kz.registerVisual(Bz("graph","circle",null)),kz.registerVisual(Fz),kz.registerVisual(Vz),kz.registerLayout(Gz),kz.registerLayout(kz.PRIORITY.VISUAL.POST_CHART_LAYOUT,Hz),kz.registerLayout(Uz),kz.registerCoordinateSystem("graphView",{create:Wz});var jz=WI;Fg.extend({type:"series.gauge",getInitialData:function(e,t){return jz(this,["value"])},defaultOption:{zlevel:0,z:2,center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#91c7ae"],[.8,"#63869e"],[1,"#c23531"]],width:30}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,distance:5,color:"auto"},pointer:{show:!0,length:"80%",width:8},itemStyle:{color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],color:"#333",fontSize:15},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"auto",fontSize:30}}});var Xz=Ys.extend({type:"echartsGaugePointer",shape:{angle:0,width:10,r:10,x:0,y:0},buildPath:function(e,t){var i=Math.cos,n=Math.sin,r=t.r,a=t.width,o=t.angle,s=t.x-i(o)*a*(a>=r/3?1:2),l=t.y-n(o)*a*(a>=r/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+i(o)*a,t.y+n(o)*a),e.lineTo(t.x+i(t.angle)*r,t.y+n(t.angle)*r),e.lineTo(t.x-i(o)*a,t.y-n(o)*a),e.lineTo(s,l)}}),Zz=yo,qz=cm,Yz=wc,Kz=Yz.parsePercent,Qz=Yz.round,Jz=Yz.linearMap;function $z(e,t){return t&&("string"==typeof t?e=t.replace("{value}",null!=e?e:""):"function"==typeof t&&(e=t(e))),e}var eB=2*Math.PI;qz.extend({type:"gauge",render:function(e,t,i){this.group.removeAll();var n=e.get("axisLine.lineStyle.color"),r=function(e,t){var i=e.get("center"),n=t.getWidth(),r=t.getHeight(),a=Math.min(n,r);return{cx:Kz(i[0],t.getWidth()),cy:Kz(i[1],t.getHeight()),r:Kz(e.get("radius"),a/2)}}(e,i);this._renderMain(e,t,i,n,r)},dispose:function(){},_renderMain:function(e,t,i,n,r){for(var a=this.group,o=e.getModel("axisLine"),s=o.getModel("lineStyle"),l=e.get("clockwise"),u=-e.get("startAngle")/180*Math.PI,h=((g=-e.get("endAngle")/180*Math.PI)-u)%eB,c=u,d=s.get("width"),f=o.get("show"),p=0;f&&p<n.length;p++){var g=u+h*Math.min(Math.max(n[p][0],0),1),m=new Zz.Sector({shape:{startAngle:c,endAngle:g,cx:r.cx,cy:r.cy,clockwise:l,r0:r.r-d,r:r.r},silent:!0});m.setStyle({fill:n[p][1]}),m.setStyle(s.getLineStyle(["color","borderWidth","borderColor"])),a.add(m),c=g}var v=function(e){if(e<=0)return n[0][1];for(var t=0;t<n.length;t++)if(n[t][0]>=e&&(0===t?0:n[t-1][0])<e)return n[t][1];return n[t-1][1]};if(!l){var y=u;u=g,g=y}this._renderTicks(e,t,i,v,r,u,g,l),this._renderPointer(e,t,i,v,r,u,g,l),this._renderTitle(e,t,i,v,r),this._renderDetail(e,t,i,v,r)},_renderTicks:function(e,t,i,n,r,a,o,s){for(var l=this.group,u=r.cx,h=r.cy,c=r.r,d=+e.get("min"),f=+e.get("max"),p=e.getModel("splitLine"),g=e.getModel("axisTick"),m=e.getModel("axisLabel"),v=e.get("splitNumber"),y=g.get("splitNumber"),_=Kz(p.get("length"),c),x=Kz(g.get("length"),c),b=a,w=(o-a)/v,T=w/y,S=p.getModel("lineStyle").getLineStyle(),M=g.getModel("lineStyle").getLineStyle(),A=0;A<=v;A++){var I=Math.cos(b),C=Math.sin(b);if(p.get("show")){var D=new Zz.Line({shape:{x1:I*c+u,y1:C*c+h,x2:I*(c-_)+u,y2:C*(c-_)+h},style:S,silent:!0});"auto"===S.stroke&&D.setStyle({stroke:n(A/v)}),l.add(D)}if(m.get("show")){var E=$z(Qz(A/v*(f-d)+d),m.get("formatter")),L=m.get("distance"),P=n(A/v);l.add(new Zz.Text({style:Zz.setTextStyle({},m,{text:E,x:I*(c-_-L)+u,y:C*(c-_-L)+h,textVerticalAlign:C<-.4?"top":C>.4?"bottom":"middle",textAlign:I<-.4?"left":I>.4?"right":"center"},{autoColor:P}),silent:!0}))}if(g.get("show")&&A!==v){for(var N=0;N<=y;N++){I=Math.cos(b),C=Math.sin(b);var R=new Zz.Line({shape:{x1:I*c+u,y1:C*c+h,x2:I*(c-x)+u,y2:C*(c-x)+h},silent:!0,style:M});"auto"===M.stroke&&R.setStyle({stroke:n((A+N/y)/v)}),l.add(R),b+=T}b-=T}else b+=w}},_renderPointer:function(e,t,i,n,r,a,o,s){var l=this.group,u=this._data;if(e.get("pointer.show")){var h=[+e.get("min"),+e.get("max")],c=[a,o],d=e.getData(),f=d.mapDimension("value");d.diff(u).add((function(t){var i=new Xz({shape:{angle:a}});Zz.initProps(i,{shape:{angle:Jz(d.get(f,t),h,c,!0)}},e),l.add(i),d.setItemGraphicEl(t,i)})).update((function(t,i){var n=u.getItemGraphicEl(i);Zz.updateProps(n,{shape:{angle:Jz(d.get(f,t),h,c,!0)}},e),l.add(n),d.setItemGraphicEl(t,n)})).remove((function(e){var t=u.getItemGraphicEl(e);l.remove(t)})).execute(),d.eachItemGraphicEl((function(e,t){var i=d.getItemModel(t),a=i.getModel("pointer");e.setShape({x:r.cx,y:r.cy,width:Kz(a.get("width"),r.r),r:Kz(a.get("length"),r.r)}),e.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===e.style.fill&&e.setStyle("fill",n(Jz(d.get(f,t),h,[0,1],!0))),Zz.setHoverStyle(e,i.getModel("emphasis.itemStyle").getItemStyle())})),this._data=d}else u&&u.eachItemGraphicEl((function(e){l.remove(e)}))},_renderTitle:function(e,t,i,n,r){var a=e.getData(),o=a.mapDimension("value"),s=e.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=r.cx+Kz(l[0],r.r),h=r.cy+Kz(l[1],r.r),c=+e.get("min"),d=+e.get("max"),f=e.getData().get(o,0),p=n(Jz(f,[c,d],[0,1],!0));this.group.add(new Zz.Text({silent:!0,style:Zz.setTextStyle({},s,{x:u,y:h,text:a.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:p,forceRich:!0})}))}},_renderDetail:function(e,t,i,n,r){var a=e.getModel("detail"),o=+e.get("min"),s=+e.get("max");if(a.get("show")){var l=a.get("offsetCenter"),u=r.cx+Kz(l[0],r.r),h=r.cy+Kz(l[1],r.r),c=Kz(a.get("width"),r.r),d=Kz(a.get("height"),r.r),f=e.getData(),p=f.get(f.mapDimension("value"),0),g=n(Jz(p,[o,s],[0,1],!0));this.group.add(new Zz.Text({silent:!0,style:Zz.setTextStyle({},a,{x:u,y:h,text:$z(p,a.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}});var tB=n,iB=l,nB=WI,rB=qa.defaultEmphasis,aB=yd.makeSeriesEncodeForNameBased,oB=ZI,sB=tB.extendSeriesModel({type:"series.funnel",init:function(e){sB.superApply(this,"init",arguments),this.legendVisualProvider=new oB(iB.bind(this.getData,this),iB.bind(this.getRawData,this)),this._defaultLabelLine(e)},getInitialData:function(e,t){return nB(this,{coordDimensions:["value"],encodeDefaulter:iB.curry(aB,this)})},_defaultLabelLine:function(e){rB(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},getDataParams:function(e){var t=this.getData(),i=sB.superCall(this,"getDataParams",e),n=t.mapDimension("value"),r=t.getSum(n);return i.percent=r?+(t.get(n,e)/r*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}}),lB=yo,uB=l,hB=cm;function cB(e,t){lB.Group.call(this);var i=new lB.Polygon,n=new lB.Polyline,r=new lB.Text;this.add(i),this.add(n),this.add(r),this.highDownOnUpdate=function(e,t){"emphasis"===t?(n.ignore=n.hoverIgnore,r.ignore=r.hoverIgnore):(n.ignore=n.normalIgnore,r.ignore=r.normalIgnore)},this.updateData(e,t,!0)}var dB=cB.prototype,fB=["itemStyle","opacity"];dB.updateData=function(e,t,i){var n=this.childAt(0),r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=e.getItemModel(t).get(fB);s=null==s?1:s,n.useStyle({}),i?(n.setShape({points:o.points}),n.setStyle({opacity:0}),lB.initProps(n,{style:{opacity:s}},r,t)):lB.updateProps(n,{style:{opacity:s},shape:{points:o.points}},r,t);var l=a.getModel("itemStyle"),u=e.getItemVisual(t,"color");n.setStyle(uB.defaults({lineJoin:"round",fill:u},l.getItemStyle(["opacity"]))),n.hoverStyle=l.getModel("emphasis").getItemStyle(),this._updateLabel(e,t),lB.setHoverStyle(this)},dB._updateLabel=function(e,t){var i=this.childAt(1),n=this.childAt(2),r=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t).label,s=e.getItemVisual(t,"color");lB.updateProps(i,{shape:{points:o.linePoints||o.linePoints}},r,t),lB.updateProps(n,{style:{x:o.x,y:o.y}},r,t),n.attr({rotation:o.rotation,origin:[o.x,o.y],z2:10});var l=a.getModel("label"),u=a.getModel("emphasis.label"),h=a.getModel("labelLine"),c=a.getModel("emphasis.labelLine");s=e.getItemVisual(t,"color");lB.setLabelStyle(n.style,n.hoverStyle={},l,u,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:e.getName(t),autoColor:s,useInsideStyle:!!o.inside},{textAlign:o.textAlign,textVerticalAlign:o.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},uB.inherits(cB,lB.Group),hB.extend({type:"funnel",render:function(e,t,i){var n=e.getData(),r=this._data,a=this.group;n.diff(r).add((function(e){var t=new cB(n,e);n.setItemGraphicEl(e,t),a.add(t)})).update((function(e,t){var i=r.getItemGraphicEl(t);i.updateData(n,e),a.add(i),n.setItemGraphicEl(e,i)})).remove((function(e){var t=r.getItemGraphicEl(e);a.remove(t)})).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var pB=bc,gB=wc,mB=gB.parsePercent,vB=gB.linearMap;var yB=function(e,t,i){e.eachSeriesByType("funnel",(function(e){var i=e.getData(),n=i.mapDimension("value"),r=e.get("sort"),a=function(e,t){return pB.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t),o=function(e,t){for(var i=e.mapDimension("value"),n=e.mapArray(i,(function(e){return e})),r=[],a="ascending"===t,o=0,s=e.count();o<s;o++)r[o]=o;return"function"==typeof t?r.sort(t):"none"!==t&&r.sort((function(e,t){return a?n[e]-n[t]:n[t]-n[e]})),r}(i,r),s=e.get("orient"),l=a.width,u=a.height,h=a.x,c=a.y,d="horizontal"===s?[mB(e.get("minSize"),u),mB(e.get("maxSize"),u)]:[mB(e.get("minSize"),l),mB(e.get("maxSize"),l)],f=i.getDataExtent(n),p=e.get("min"),g=e.get("max");null==p&&(p=Math.min(f[0],0)),null==g&&(g=f[1]);var m=e.get("funnelAlign"),v=e.get("gap"),y=(("horizontal"===s?l:u)-v*(i.count()-1))/i.count(),_=function(e,t){if("horizontal"===s){var r,a=i.get(n,e)||0,o=vB(a,[p,g],d,!0);switch(m){case"top":r=c;break;case"center":r=c+(u-o)/2;break;case"bottom":r=c+(u-o)}return[[t,r],[t,r+o]]}a=i.get(n,e)||0;var f,v=vB(a,[p,g],d,!0);switch(m){case"left":f=h;break;case"center":f=h+(l-v)/2;break;case"right":f=h+l-v}return[[f,t],[f+v,t]]};"ascending"===r&&(y=-y,v=-v,"horizontal"===s?h+=l:c+=u,o=o.reverse());for(var x=0;x<o.length;x++){var b=o[x],w=o[x+1],T=i.getItemModel(b);if("horizontal"===s){var S=T.get("itemStyle.width");null==S?S=y:(S=mB(S,l),"ascending"===r&&(S=-S));var M=_(b,h),A=_(w,h+S);h+=S+v,i.setItemLayout(b,{points:M.concat(A.slice().reverse())})}else{var I=T.get("itemStyle.height");null==I?I=y:(I=mB(I,u),"ascending"===r&&(I=-I));M=_(b,"horizontal"===s?h:c),A=_(w,"horizontal"===s?h+S:c+I);c+=I+v,i.setItemLayout(b,{points:M.concat(A.slice().reverse())})}}!function(e){e.each((function(t){var i,n,r,a,o=e.getItemModel(t),s=o.getModel("label").get("position"),l=o.get("orient"),u=o.getModel("labelLine"),h=e.getItemLayout(t),c=h.points,d="inner"===s||"inside"===s||"center"===s||"insideLeft"===s||"insideRight"===s;if(d)"insideLeft"===s?(n=(c[0][0]+c[3][0])/2+5,r=(c[0][1]+c[3][1])/2,i="left"):"insideRight"===s?(n=(c[1][0]+c[2][0])/2-5,r=(c[1][1]+c[2][1])/2,i="right"):(n=(c[0][0]+c[1][0]+c[2][0]+c[3][0])/4,r=(c[0][1]+c[1][1]+c[2][1]+c[3][1])/4,i="center"),a=[[n,r],[n,r]];else{var f,p,g,m,v=u.get("length");"left"===s?(f=(c[3][0]+c[0][0])/2,p=(c[3][1]+c[0][1])/2,n=(g=f-v)-5,i="right"):"right"===s?(f=(c[1][0]+c[2][0])/2,p=(c[1][1]+c[2][1])/2,n=(g=f+v)+5,i="left"):"top"===s?(f=(c[3][0]+c[0][0])/2,r=(m=(p=(c[3][1]+c[0][1])/2)-v)-5,i="center"):"bottom"===s?(f=(c[1][0]+c[2][0])/2,r=(m=(p=(c[1][1]+c[2][1])/2)+v)+5,i="center"):"rightTop"===s?(f="horizontal"===l?c[3][0]:c[1][0],p="horizontal"===l?c[3][1]:c[1][1],"horizontal"===l?(r=(m=p-v)-5,i="center"):(n=(g=f+v)+5,i="top")):"rightBottom"===s?(f=c[2][0],p=c[2][1],"horizontal"===l?(r=(m=p+v)+5,i="center"):(n=(g=f+v)+5,i="bottom")):"leftTop"===s?(f=c[0][0],p="horizontal"===l?c[0][1]:c[1][1],"horizontal"===l?(r=(m=p-v)-5,i="center"):(n=(g=f-v)-5,i="right")):"leftBottom"===s?(f="horizontal"===l?c[1][0]:c[3][0],p="horizontal"===l?c[1][1]:c[2][1],"horizontal"===l?(r=(m=p+v)+5,i="center"):(n=(g=f-v)-5,i="right")):(f=(c[1][0]+c[2][0])/2,p=(c[1][1]+c[2][1])/2,"horizontal"===l?(r=(m=p+v)+5,i="center"):(n=(g=f+v)+5,i="left")),"horizontal"===l?n=g=f:r=m=p,a=[[f,p],[g,m]]}h.label={linePoints:a,x:n,y:r,verticalAlign:"middle",textAlign:i,inside:d}}))}(i)}))},_B=n,xB=gC,bB=yB,wB=EC;_B.registerVisual(xB("funnel")),_B.registerLayout(bB),_B.registerProcessor(wB("funnel"));var TB=l,SB=qa;var MB=function(e){!function(e){if(e.parallel)return;var t=!1;TB.each(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}(e),function(e){var t=SB.normalizeToArray(e.parallelAxis);TB.each(t,(function(t){if(TB.isObject(t)){var i=t.parallelIndex||0,n=SB.normalizeToArray(e.parallel)[i];n&&n.parallelAxisDefault&&TB.merge(t,n.parallelAxisDefault,!1)}}))}(e)},AB=l,IB=Hw,CB=function(e,t,i,n,r){IB.call(this,e,t,i),this.type=n||"value",this.axisIndex=r};function DB(e,t){var i=e[t]-e[1-t];return{span:Math.abs(i),sign:i>0?-1:i<0?1:t?-1:1}}function EB(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}CB.prototype={constructor:CB,model:null,isHorizontal:function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")}},AB.inherits(CB,IB);var LB=function(e,t,i,n,r,a){e=e||0;var o=i[1]-i[0];if(null!=r&&(r=EB(r,[0,o])),null!=a&&(a=Math.max(a,null!=r?r:0)),"all"===n){var s=Math.abs(t[1]-t[0]);s=EB(s,[0,o]),r=a=EB(s,[r,a]),n=0}t[0]=EB(t[0],i),t[1]=EB(t[1],i);var l=DB(t,n);t[n]+=e;var u=r||0,h=i.slice();l.sign<0?h[0]+=u:h[1]-=u,t[n]=EB(t[n],h);var c=DB(t,n);return null!=r&&(c.sign!==l.sign||c.span<r)&&(t[1-n]=t[n]+l.sign*r),c=DB(t,n),null!=a&&c.span>a&&(t[1-n]=t[n]+c.sign*a),t},PB=l,NB=Re,RB=bc,OB=W_,kB=CB,zB=yo,BB=wc,FB=LB,VB=PB.each,GB=Math.min,HB=Math.max,UB=Math.floor,WB=Math.ceil,jB=BB.round,XB=Math.PI;function ZB(e,t,i){this._axesMap=PB.createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._rect,this._model=e,this._init(e,t,i)}function qB(e,t){return GB(HB(e,t[0]),t[1])}function YB(e,t){var i=t.layoutLength/(t.axisCount-1);return{position:i*e,axisNameAvailableWidth:i,axisLabelShow:!0}}function KB(e,t){var i,n,r=t.layoutLength,a=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,h=!1;return e<l[0]?(i=e*s,n=s):e<=l[1]?(i=t.axisExpandWindow0Pos+e*a-t.axisExpandWindow[0],u=a,h=!0):(i=r-(o-1-e)*s,n=s),{position:i,axisNameAvailableWidth:u,axisLabelShow:h,nameTruncateMaxWidth:n}}ZB.prototype={type:"parallel",constructor:ZB,_init:function(e,t,i){var n=e.dimensions,r=e.parallelAxisIndex;VB(n,(function(e,i){var n=r[i],a=t.getComponent("parallelAxis",n),o=this._axesMap.set(e,new kB(e,OB.createScaleByModel(a),[0,0],a.get("type"),n)),s="category"===o.type;o.onBand=s&&a.get("boundaryGap"),o.inverse=a.get("inverse"),a.axis=o,o.model=a,o.coordinateSystem=a.coordinateSystem=this}),this)},update:function(e,t){this._updateAxesFromSeries(this._model,e)},containPoint:function(e){var t=this._makeLayoutInfo(),i=t.axisBase,n=t.layoutBase,r=t.pixelDimIndex,a=e[1-r],o=e[r];return a>=i&&a<=i+t.axisLength&&o>=n&&o<=n+t.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(e,t){t.eachSeries((function(i){if(e.contains(i,t)){var n=i.getData();VB(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(n,n.mapDimension(e)),OB.niceScaleExtent(t.scale,t.model)}),this)}}),this)},resize:function(e,t){this._rect=RB.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var e,t=this._model,i=this._rect,n=["x","y"],r=["width","height"],a=t.get("layout"),o="horizontal"===a?0:1,s=i[r[o]],l=[0,s],u=this.dimensions.length,h=qB(t.get("axisExpandWidth"),l),c=qB(t.get("axisExpandCount")||0,[0,u]),d=t.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,f=t.get("axisExpandWindow");f?(e=qB(f[1]-f[0],l),f[1]=f[0]+e):(e=qB(h*(c-1),l),(f=[h*(t.get("axisExpandCenter")||UB(u/2))-e/2])[1]=f[0]+e);var p=(s-e)/(u-c);p<3&&(p=0);var g=[UB(jB(f[0]/h,1))+1,WB(jB(f[1]/h,1))-1],m=p/h*f[0];return{layout:a,pixelDimIndex:o,layoutBase:i[n[o]],layoutLength:s,axisBase:i[n[1-o]],axisLength:i[r[1-o]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var e=this._rect,t=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),r=n.layout;t.each((function(e){var t=[0,n.axisLength],i=e.inverse?1:0;e.setExtent(t[i],t[1-i])})),VB(i,(function(t,i){var a=(n.axisExpandable?KB:YB)(i,n),o={horizontal:{x:a.position,y:n.axisLength},vertical:{x:0,y:a.position}},s={horizontal:XB/2,vertical:0},l=[o[r].x+e.x,o[r].y+e.y],u=s[r],h=NB.create();NB.rotate(h,h,u),NB.translate(h,h,l),this._axesLayout[t]={position:l,rotation:u,transform:h,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},getAxis:function(e){return this._axesMap.get(e)},dataToPoint:function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},eachActiveState:function(e,t,i,n){null==i&&(i=0),null==n&&(n=e.count());var r=this._axesMap,a=this.dimensions,o=[],s=[];PB.each(a,(function(t){o.push(e.mapDimension(t)),s.push(r.get(t).model)}));for(var l=this.hasAxisBrushed(),u=i;u<n;u++){var h;if(l){h="active";for(var c=e.getValues(o,u),d=0,f=a.length;d<f;d++){if("inactive"===s[d].getActiveState(c[d])){h="inactive";break}}}else h="normal";t(h,u)}},hasAxisBrushed:function(){for(var e=this.dimensions,t=this._axesMap,i=!1,n=0,r=e.length;n<r;n++)"normal"!==t.get(e[n]).model.getActiveState()&&(i=!0);return i},axisCoordToPoint:function(e,t){var i=this._axesLayout[t];return zB.applyTransform([e,0],i.transform)},getAxisLayout:function(e){return PB.clone(this._axesLayout[e])},getSlidedAxisExpandWindow:function(e){var t=this._makeLayoutInfo(),i=t.pixelDimIndex,n=t.axisExpandWindow.slice(),r=n[1]-n[0],a=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:n};var o,s=e[i]-t.layoutBase-t.axisExpandWindow0Pos,l="slide",u=t.axisCollapseWidth,h=this._model.get("axisExpandSlideTriggerArea"),c=null!=h[0];if(u)c&&u&&s<r*h[0]?(l="jump",o=s-r*h[2]):c&&u&&s>r*(1-h[0])?(l="jump",o=s-r*(1-h[2])):(o=s-r*h[1])>=0&&(o=s-r*(1-h[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?FB(o,n,a,"all"):l="none";else{r=n[1]-n[0];(n=[HB(0,a[1]*s/r-r/2)])[1]=GB(a[1],n[0]+r),n[0]=n[1]-r}return{axisExpandWindow:n,behavior:l}}};var QB=ZB;Bf.register("parallel",{create:function(e,t){var i=[];return e.eachComponent("parallel",(function(n,r){var a=new QB(n,e,t);a.name="parallel_"+r,a.resize(n,t),n.coordinateSystem=a,a.model=n,i.push(a)})),e.eachSeries((function(t){if("parallel"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}});var JB=l,$B=fo,eF=fM,tF=wc,iF=Mb,nF=ud.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return $B([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(e){var t=this.activeIntervals=JB.clone(e);if(t)for(var i=t.length-1;i>=0;i--)tF.asc(t[i])},getActiveState:function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(e))return"inactive";if(1===t.length){var i=t[0];if(i[0]<=e&&e<=i[1])return"active"}else for(var n=0,r=t.length;n<r;n++)if(t[n][0]<=e&&e<=t[n][1])return"active";return"inactive"}});JB.merge(nF.prototype,iF),eF("parallel",nF,(function(e,t){return t.type||(t.data?"category":"value")}),{type:"value",dim:null,areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10});var rF=l,aF=ud;aF.extend({type:"parallel",dependencies:["parallelAxis"],coordinateSystem:null,dimensions:null,parallelAxisIndex:null,layoutMode:"box",defaultOption:{zlevel:0,z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},init:function(){aF.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(e){var t=this.option;e&&rF.merge(t,e,!0),this._initDimensions()},contains:function(e,t){var i=e.get("parallelIndex");return null!=i&&t.getComponent("parallel",i)===this},setAxisExpand:function(e){rF.each(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},_initDimensions:function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[],i=rF.filter(this.dependentModels.parallelAxis,(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this);rF.each(i,(function(i){e.push("dim"+i.get("dim")),t.push(i.componentIndex)}))}});var oF=n;oF.registerAction({type:"axisAreaSelect",event:"axisAreaSelected"},(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),oF.registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}));var sF=l,lF=q,uF=yo,hF=BE,cF=dy,dF=sF.curry,fF=sF.each,pF=sF.map,gF=Math.min,mF=Math.max,vF=Math.pow,yF={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},_F={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},xF={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},bF=0;function wF(e){lF.call(this),this._zr=e,this.group=new uF.Group,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,this._uid="brushController_"+bF++,this._handlers={},fF(YF,(function(e,t){this._handlers[t]=sF.bind(e,this)}),this)}function TF(e,t){var i=QF[t.brushType].createCover(e,t);return i.__brushOption=t,AF(i,t),e.group.add(i),i}function SF(e,t){var i=CF(t);return i.endCreating&&(i.endCreating(e,t),AF(t,t.__brushOption)),t}function MF(e,t){var i=t.__brushOption;CF(t).updateCoverShape(e,t,i.range,i)}function AF(e,t){var i=t.z;null==i&&(i=1e4),e.traverse((function(e){e.z=i,e.z2=i}))}function IF(e,t){CF(t).updateCommon(e,t),MF(e,t)}function CF(e){return QF[e.__brushOption.brushType]}function DF(e,t,i){var n,r=e._panels;if(!r)return!0;var a=e._transform;return fF(r,(function(e){e.isTargetByCursor(t,i,a)&&(n=e)})),n}function EF(e,t){var i=e._panels;if(!i)return!0;var n=t.__brushOption.panelId;return null==n||i[n]}function LF(e){var t=e._covers,i=t.length;return fF(t,(function(t){e.group.remove(t)}),e),t.length=0,!!i}function PF(e,t){var i=pF(e._covers,(function(e){var t=e.__brushOption,i=sF.clone(t.range);return{brushType:t.brushType,panelId:t.panelId,range:i}}));e.trigger("brush",i,{isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function NF(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function RF(e,t,i,n){var r=new uF.Group;return r.add(new uF.Rect({name:"main",style:BF(i),silent:!0,draggable:!0,cursor:"move",drift:dF(e,t,r,"nswe"),ondragend:dF(PF,t,{isEnd:!0})})),fF(n,(function(i){r.add(new uF.Rect({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:dF(e,t,r,i),ondragend:dF(PF,t,{isEnd:!0})}))})),r}function OF(e,t,i,n){var r=n.brushStyle.lineWidth||0,a=mF(r,6),o=i[0][0],s=i[1][0],l=o-r/2,u=s-r/2,h=i[0][1],c=i[1][1],d=h-a+r/2,f=c-a+r/2,p=h-o,g=c-s,m=p+r,v=g+r;zF(e,t,"main",o,s,p,g),n.transformable&&(zF(e,t,"w",l,u,a,v),zF(e,t,"e",d,u,a,v),zF(e,t,"n",l,u,m,a),zF(e,t,"s",l,f,m,a),zF(e,t,"nw",l,u,a,a),zF(e,t,"ne",d,u,a,a),zF(e,t,"sw",l,f,a,a),zF(e,t,"se",d,f,a,a))}function kF(e,t){var i=t.__brushOption,n=i.transformable,r=t.childAt(0);r.useStyle(BF(i)),r.attr({silent:!n,cursor:n?"move":"default"}),fF(["w","e","n","s","se","sw","ne","nw"],(function(i){var r=t.childOfName(i),a=VF(e,i);r&&r.attr({silent:!n,invisible:!n,cursor:n?_F[a]+"-resize":null})}))}function zF(e,t,i,n,r,a,o){var s=t.childOfName(i);s&&s.setShape(function(e){var t=gF(e[0][0],e[1][0]),i=gF(e[0][1],e[1][1]),n=mF(e[0][0],e[1][0]),r=mF(e[0][1],e[1][1]);return{x:t,y:i,width:n-t,height:r-i}}(WF(e,t,[[n,r],[n+a,r+o]])))}function BF(e){return sF.defaults({strokeNoScale:!0},e.brushStyle)}function FF(e,t,i,n){var r=[gF(e,i),gF(t,n)],a=[mF(e,i),mF(t,n)];return[[r[0],a[0]],[r[1],a[1]]]}function VF(e,t){if(t.length>1)return("e"===(i=[VF(e,(t=t.split(""))[0]),VF(e,t[1])])[0]||"w"===i[0])&&i.reverse(),i.join("");var i=uF.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return uF.getTransform(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[i]}function GF(e,t,i,n,r,a,o,s){var l=n.__brushOption,u=e(l.range),h=UF(i,a,o);fF(r.split(""),(function(e){var t=yF[e];u[t[0]][t[1]]+=h[t[0]]})),l.range=t(FF(u[0][0],u[1][0],u[0][1],u[1][1])),IF(i,n),PF(i,{isEnd:!1})}function HF(e,t,i,n,r){var a=t.__brushOption.range,o=UF(e,i,n);fF(a,(function(e){e[0]+=o[0],e[1]+=o[1]})),IF(e,t),PF(e,{isEnd:!1})}function UF(e,t,i){var n=e.group,r=n.transformCoordToLocal(t,i),a=n.transformCoordToLocal(0,0);return[r[0]-a[0],r[1]-a[1]]}function WF(e,t,i){var n=EF(e,t);return n&&!0!==n?n.clipPath(i,e._transform):sF.clone(i)}function jF(e){var t=e.event;t.preventDefault&&t.preventDefault()}function XF(e,t,i){return e.childOfName("main").contain(t,i)}function ZF(e,t,i,n){var r,a=e._creatingCover,o=e._creatingPanel,s=e._brushOption;if(e._track.push(i.slice()),function(e){var t=e._track;if(!t.length)return!1;var i=t[t.length-1],n=t[0],r=i[0]-n[0],a=i[1]-n[1];return vF(r*r+a*a,.5)>6}(e)||a){if(o&&!a){"single"===s.brushMode&&LF(e);var l=sF.clone(s);l.brushType=qF(l.brushType,o),l.panelId=!0===o?null:o.panelId,a=e._creatingCover=TF(e,l),e._covers.push(a)}if(a){var u=QF[qF(e._brushType,o)];a.__brushOption.range=u.getCreatingRange(WF(e,a,e._track)),n&&(SF(e,a),u.updateCommon(e,a)),MF(e,a),r={isEnd:n}}}else n&&"single"===s.brushMode&&s.removeOnClick&&DF(e,t,i)&&LF(e)&&(r={isEnd:n,removeOnClick:!0});return r}function qF(e,t){return"auto"===e?t.defaultBrushType:e}wF.prototype={constructor:wF,enableBrush:function(e){var t,i;return this._brushType&&(i=(t=this)._zr,hF.release(i,"globalPan",t._uid),function(e,t){fF(t,(function(t,i){e.off(i,t)}))}(i,t._handlers),t._brushType=t._brushOption=null),e.brushType&&function(e,t){var i=e._zr;e._enableGlobalPan||hF.take(i,"globalPan",e._uid);(function(e,t){fF(t,(function(t,i){e.on(i,t)}))})(i,e._handlers),e._brushType=t.brushType,e._brushOption=sF.merge(sF.clone(xF),t,!0)}(this,e),this},setPanels:function(e){if(e&&e.length){var t=this._panels={};sF.each(e,(function(e){t[e.panelId]=sF.clone(e)}))}else this._panels=null;return this},mount:function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({position:e.position||[0,0],rotation:e.rotation||0,scale:e.scale||[1,1]}),this._transform=t.getLocalTransform(),this},eachCover:function(e,t){fF(this._covers,e,t)},updateCovers:function(e){e=sF.map(e,(function(e){return sF.merge(sF.clone(xF),e,!0)}));var t=this._covers,i=this._covers=[],n=this,r=this._creatingCover;return new cF(t,e,(function(e,t){return a(e.__brushOption,t)}),a).add(o).update(o).remove((function(e){t[e]!==r&&n.group.remove(t[e])})).execute(),this;function a(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function o(a,o){var s=e[a];if(null!=o&&t[o]===r)i[a]=t[o];else{var l=i[a]=null!=o?(t[o].__brushOption=s,t[o]):SF(n,TF(n,s));IF(n,l)}}},unmount:function(){return this.enableBrush(!1),LF(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},sF.mixin(wF,lF);var YF={mousedown:function(e){if(this._dragging)KF(this,e);else if(!e.target||!e.target.draggable){jF(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=DF(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,i=e.offsetY,n=this.group.transformCoordToLocal(t,i);if(function(e,t,i){if(e._brushType&&!function(e,t,i){var n=e._zr;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}(e,t)){var n=e._zr,r=e._covers,a=DF(e,t,i);if(!e._dragging)for(var o=0;o<r.length;o++){var s=r[o].__brushOption;if(a&&(!0===a||s.panelId===a.panelId)&&QF[s.brushType].contain(r[o],i[0],i[1]))return}a&&n.setCursorStyle("crosshair")}}(this,e,n),this._dragging){jF(e);var r=ZF(this,e,n,!1);r&&PF(this,r)}},mouseup:function(e){KF(this,e)}};function KF(e,t){if(e._dragging){jF(t);var i=t.offsetX,n=t.offsetY,r=e.group.transformCoordToLocal(i,n),a=ZF(e,t,r,!0);e._dragging=!1,e._track=[],e._creatingCover=null,a&&PF(e,a)}}var QF={lineX:JF(0),lineY:JF(1),rect:{createCover:function(e,t){return RF(dF(GF,(function(e){return e}),(function(e){return e})),e,t,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(e){var t=NF(e);return FF(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,i,n){OF(e,t,i,n)},updateCommon:kF,contain:XF},polygon:{createCover:function(e,t){var i=new uF.Group;return i.add(new uF.Polyline({name:"main",style:BF(t),silent:!0})),i},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new uF.Polygon({name:"main",draggable:!0,drift:dF(HF,e,t),ondragend:dF(PF,e,{isEnd:!0})}))},updateCoverShape:function(e,t,i,n){t.childAt(0).setShape({points:WF(e,t,i)})},updateCommon:kF,contain:XF}};function JF(e){return{createCover:function(t,i){return RF(dF(GF,(function(t){var i=[t,[0,100]];return e&&i.reverse(),i}),(function(t){return t[e]})),t,i,[["w","e"],["n","s"]][e])},getCreatingRange:function(t){var i=NF(t);return[gF(i[0][e],i[1][e]),mF(i[0][e],i[1][e])]},updateCoverShape:function(t,i,n,r){var a,o=EF(t,i);if(!0!==o&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e,t._transform);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[n,a];e&&l.reverse(),OF(t,i,l,r)},updateCommon:kF,contain:XF}}var $F=wF,eV={},tV=wi,iV=iL.onIrrelevantElement,nV=yo;function rV(e){return tV.create(e)}eV.makeRectPanelClipPath=function(e){return e=rV(e),function(t,i){return nV.clipPointsByRect(t,e)}},eV.makeLinearBrushOtherExtent=function(e,t){return e=rV(e),function(i){var n=null!=t?t:i,r=n?e.width:e.height,a=n?e.x:e.y;return[a,a+(r||0)]}},eV.makeRectIsTargetByCursor=function(e,t,i){return e=rV(e),function(n,r,a){return e.contain(r[0],r[1])&&!iV(n,t,i)}};var aV=l,oV=pA,sV=$F,lV=eV,uV=yo,hV=["axisLine","axisTickLabel","axisName"],cV=n.extendComponentView({type:"parallelAxis",init:function(e,t){cV.superApply(this,"init",arguments),(this._brushController=new sV(t.getZr())).on("brush",aV.bind(this._onBrush,this))},render:function(e,t,i,n){if(!function(e,t,i){return i&&"axisAreaSelect"===i.type&&t.findComponents({mainType:"parallelAxis",query:i})[0]===e}(e,t,n)){this.axisModel=e,this.api=i,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new uV.Group,this.group.add(this._axisGroup),e.get("show")){var a=function(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}(e,t),o=a.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,h=o.getAxisLayout(u),c=aV.extend({strokeContainThreshold:l},h),d=new oV(e,c);aV.each(hV,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(c,s,e,a,l,i);var f=n&&!1===n.animation?null:e;uV.groupTransition(r,this._axisGroup,f)}}},_refreshBrushController:function(e,t,i,n,r,a){var o=i.axis.getExtent(),s=o[1]-o[0],l=Math.min(30,.1*Math.abs(s)),u=uV.BoundingRect.create({x:o[0],y:-r/2,width:s,height:r});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,position:e.position}).setPanels([{panelId:"pl",clipPath:lV.makeRectPanelClipPath(u),isTargetByCursor:lV.makeRectIsTargetByCursor(u,a,n),getLinearBrushOtherExtent:lV.makeLinearBrushOtherExtent(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(function(e){var t=e.axis;return aV.map(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}(i))},_onBrush:function(e,t){var i=this.axisModel,n=i.axis,r=aV.map(e,(function(e){return[n.coordToData(e.range[0],!0),n.coordToData(e.range[1],!0)]}));(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:r})},dispose:function(){this._brushController.dispose()}});var dV=n,fV=l,pV=dm,gV=MB;dV.extendComponentView({type:"parallel",render:function(e,t,i){this._model=e,this._api=i,this._handlers||(this._handlers={},fV.each(mV,(function(e,t){i.getZr().on(t,this._handlers[t]=fV.bind(e,this))}),this)),pV.createOrUpdate(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},dispose:function(e,t){fV.each(this._handlers,(function(e,i){t.getZr().off(i,e)})),this._handlers=null},_throttledDispatchExpand:function(e){this._dispatchExpand(e)},_dispatchExpand:function(e){e&&this._api.dispatchAction(fV.extend({type:"parallelAxisExpand"},e))}});var mV={mousedown:function(e){vV(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(vV(this,"click")&&t){var i=[e.offsetX,e.offsetY];if(Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2)>5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&vV(this,"mousemove")){var t=this._model,i=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};function vV(e,t){var i=e._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===t}dV.registerPreprocessor(gV);var yV=l,_V=yV.each,xV=yV.createHashMap,bV=U_;Fg.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var i=this.getSource();return function(e,t){if(e.encodeDefine)return;var i=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(!i)return;var n=e.encodeDefine=xV();_V(i.dimensions,(function(e){var t=+e.replace("dim","");n.set(e,t)}))}(i,this),bV(i,this)},getRawIndicesByActiveState:function(e){var t=this.coordinateSystem,i=this.getData(),n=[];return t.eachActiveState(i,(function(t,r){e===t&&n.push(i.getRawIndex(r))})),n},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"}});var wV=yo;function TV(e,t,i,n){for(var r,a=[],o=0;o<i.length;o++){var s=i[o],l=e.get(e.mapDimension(s),t);r=l,("category"===n.getAxis(s).type?null==r:null==r||isNaN(r))||a.push(n.dataToPoint(l,s))}return a}function SV(e,t,i,n,r){var a=TV(e,i,n,r),o=new wV.Polyline({shape:{points:a},silent:!0,z2:10});return t.add(o),e.setItemGraphicEl(i,o),o}function MV(e){var t=e.get("smooth",!0);return!0===t&&(t=.3),{lineStyle:e.getModel("lineStyle").getLineStyle(),smooth:null!=t?t:.3}}function AV(e,t,i,n){var r=n.lineStyle;t.hasItemOption&&(r=t.getItemModel(i).getModel("lineStyle").getLineStyle());e.useStyle(r);var a=e.style;a.fill=null,a.stroke=t.getItemVisual(i,"color"),a.opacity=t.getItemVisual(i,"opacity"),n.smooth&&(e.shape.smooth=n.smooth)}cm.extend({type:"parallel",init:function(){this._dataGroup=new wV.Group,this.group.add(this._dataGroup),this._data,this._initialized},render:function(e,t,i,n){var r=this._dataGroup,a=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,u=MV(e);if(a.diff(o).add((function(e){AV(SV(a,r,e,l,s),a,e,u)})).update((function(t,i){var r=o.getItemGraphicEl(i),h=TV(a,t,l,s);a.setItemGraphicEl(t,r);var c=n&&!1===n.animation?null:e;wV.updateProps(r,{shape:{points:h}},c,t),AV(r,a,t,u)})).remove((function(e){var t=o.getItemGraphicEl(e);r.remove(t)})).execute(),!this._initialized){this._initialized=!0;var h=function(e,t,i){var n=e.model,r=e.getRect(),a=new wV.Rect({shape:{x:r.x,y:r.y,width:r.width,height:r.height}}),o="horizontal"===n.get("layout")?"width":"height";return a.setShape(o,0),wV.initProps(a,{shape:{width:r.width,height:r.height}},t,i),a}(s,e,(function(){setTimeout((function(){r.removeClipPath()}))}));r.setClipPath(h)}this._data=a},incrementalPrepareRender:function(e,t,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(e,t,i){for(var n=t.getData(),r=t.coordinateSystem,a=r.dimensions,o=MV(t),s=e.start;s<e.end;s++){var l=SV(n,this._dataGroup,s,a,r);l.incremental=!0,AV(l,n,s,o)}},dispose:function(){},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});var IV=["lineStyle","normal","opacity"];n.registerVisual({seriesType:"parallel",reset:function(e,t,i){var n=e.getModel("itemStyle"),r=e.getModel("lineStyle"),a=t.get("color"),o=r.get("color")||n.get("color")||a[e.seriesIndex%a.length],s=e.get("inactiveOpacity"),l=e.get("activeOpacity"),u=e.getModel("lineStyle").getLineStyle(),h=e.coordinateSystem,c=e.getData(),d={normal:u.opacity,active:l,inactive:s};return c.setVisual("color",o),{progress:function(e,t){h.eachActiveState(t,(function(e,i){var n=d[e];if("normal"===e&&t.hasItemOption){var r=t.getItemModel(i).get(IV,!0);null!=r&&(n=r)}t.setItemVisual(i,"opacity",n)}),e.start,e.end)}}}});var CV=Fg,DV=AO,EV=Ac.encodeHTML,LV=mc,PV=CV.extend({type:"series.sankey",layoutInfo:null,levelModels:null,getInitialData:function(e,t){for(var i=e.edges||e.links,n=e.data||e.nodes,r=e.levels,a=this.levelModels={},o=0;o<r.length;o++)null!=r[o].depth&&r[o].depth>=0&&(a[r[o].depth]=new LV(r[o],this,t));if(n&&i)return DV(n,i,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getData().getItemLayout(t).depth;return i.levelModels[n]||this.parentModel})),e})),t.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getGraph().getEdgeByIndex(t).node1.getLayout().depth;return i.levelModels[n]||this.parentModel})),e}))})).data},setNodePosition:function(e,t){var i=this.option.data[e];i.localX=t[0],i.localY=t[1]},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getDataParams(e,i),r=n.data,a=r.source+" -- "+r.target;return n.value&&(a+=" : "+n.value),EV(a)}if("node"===i){var o=this.getGraph().getNodeByIndex(e).getLayout().value,s=this.getDataParams(e,i).data.name;if(o)a=s+" : "+o;return EV(a)}return PV.superCall(this,"formatTooltip",e,t)},optionUpdated:function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},getDataParams:function(e,t){var i=PV.superCall(this,"getDataParams",e,t);if(null==i.value&&"node"===t){var n=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=n}return i},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},levels:[],nodeAlign:"justify",itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},animationEasing:"linear",animationDuration:1e3}}),NV=yo,RV=n,OV=l,kV=["itemStyle","opacity"],zV=["emphasis","itemStyle","opacity"],BV=["lineStyle","opacity"],FV=["emphasis","lineStyle","opacity"];function VV(e,t){return e.getVisual("opacity")||e.getModel().get(t)}function GV(e,t,i){var n=e.getGraphicEl(),r=VV(e,t);null!=i&&(null==r&&(r=1),r*=i),n.downplay&&n.downplay(),n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",r)}))}function HV(e,t){var i=VV(e,t),n=e.getGraphicEl();n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}var UV=NV.extendShape({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0,orient:""},buildPath:function(e,t){var i=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+i,t.y2),e.bezierCurveTo(t.cpx2+i,t.cpy2,t.cpx1+i,t.cpy1,t.x1+i,t.y1)):(e.lineTo(t.x2,t.y2+i),e.bezierCurveTo(t.cpx2,t.cpy2+i,t.cpx1,t.cpy1+i,t.x1,t.y1+i)),e.closePath()},highlight:function(){this.trigger("emphasis")},downplay:function(){this.trigger("normal")}});RV.extendChartView({type:"sankey",_model:null,_focusAdjacencyDisabled:!1,render:function(e,t,i){var n=this,r=e.getGraph(),a=this.group,o=e.layoutInfo,s=o.width,l=o.height,u=e.getData(),h=e.getData("edge"),c=e.get("orient");this._model=e,a.removeAll(),a.attr("position",[o.x,o.y]),r.eachEdge((function(t){var i=new UV;i.dataIndex=t.dataIndex,i.seriesIndex=e.seriesIndex,i.dataType="edge";var n,r,o,u,d,f,p,g,m=t.getModel("lineStyle"),v=m.get("curveness"),y=t.node1.getLayout(),_=t.node1.getModel(),x=_.get("localX"),b=_.get("localY"),w=t.node2.getLayout(),T=t.node2.getModel(),S=T.get("localX"),M=T.get("localY"),A=t.getLayout();switch(i.shape.extent=Math.max(1,A.dy),i.shape.orient=c,"vertical"===c?(n=(null!=x?x*s:y.x)+A.sy,r=(null!=b?b*l:y.y)+y.dy,o=(null!=S?S*s:w.x)+A.ty,d=n,f=r*(1-v)+(u=null!=M?M*l:w.y)*v,p=o,g=r*v+u*(1-v)):(n=(null!=x?x*s:y.x)+y.dx,r=(null!=b?b*l:y.y)+A.sy,d=n*(1-v)+(o=null!=S?S*s:w.x)*v,f=r,p=n*v+o*(1-v),g=u=(null!=M?M*l:w.y)+A.ty),i.setShape({x1:n,y1:r,x2:o,y2:u,cpx1:d,cpy1:f,cpx2:p,cpy2:g}),i.setStyle(m.getItemStyle()),i.style.fill){case"source":i.style.fill=t.node1.getVisual("color");break;case"target":i.style.fill=t.node2.getVisual("color")}NV.setHoverStyle(i,t.getModel("emphasis.lineStyle").getItemStyle()),a.add(i),h.setItemGraphicEl(t.dataIndex,i)})),r.eachNode((function(t){var i=t.getLayout(),n=t.getModel(),r=n.get("localX"),o=n.get("localY"),h=n.getModel("label"),c=n.getModel("emphasis.label"),d=new NV.Rect({shape:{x:null!=r?r*s:i.x,y:null!=o?o*l:i.y,width:i.dx,height:i.dy},style:n.getModel("itemStyle").getItemStyle()}),f=t.getModel("emphasis.itemStyle").getItemStyle();NV.setLabelStyle(d.style,f,h,c,{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id,isRectText:!0}),d.setStyle("fill",t.getVisual("color")),NV.setHoverStyle(d,f),a.add(d),u.setItemGraphicEl(t.dataIndex,d),d.dataType="node"})),u.eachItemGraphicEl((function(t,r){var a=u.getItemModel(r);a.get("draggable")&&(t.drift=function(t,a){n._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=a,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){n._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move"),t.highlight=function(){this.trigger("emphasis")},t.downplay=function(){this.trigger("normal")},t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),a.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),h.eachItemGraphicEl((function(t,r){var a=h.getItemModel(r);t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),a.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),!this._data&&e.get("animation")&&a.setClipPath(function(e,t,i){var n=new NV.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return NV.initProps(n,{shape:{width:e.width+20}},t,i),n}(a.getBoundingRect(),e,(function(){a.removeClipPath()}))),this._data=e.getData()},dispose:function(){this._clearTimer()},_dispatchUnfocus:function(e){var t=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){t._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:t._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var r=e.getData(),a=r.graph,o=n.dataIndex,s=r.getItemModel(o),l=n.edgeDataIndex;if(null!=o||null!=l){var u=a.getNodeByIndex(o),h=a.getEdgeByIndex(l);if(a.eachNode((function(e){GV(e,kV,.1)})),a.eachEdge((function(e){GV(e,BV,.1)})),u){HV(u,zV);var c=s.get("focusNodeAdjacency");"outEdges"===c?OV.each(u.outEdges,(function(e){e.dataIndex<0||(HV(e,FV),HV(e.node2,zV))})):"inEdges"===c?OV.each(u.inEdges,(function(e){e.dataIndex<0||(HV(e,FV),HV(e.node1,zV))})):"allEdges"===c&&OV.each(u.edges,(function(e){e.dataIndex<0||(HV(e,FV),e.node1!==u&&HV(e.node1,zV),e.node2!==u&&HV(e.node2,zV))}))}h&&(HV(h,FV),HV(h.node1,zV),HV(h.node2,zV))}},unfocusNodeAdjacency:function(e,t,i,n){var r=e.getGraph();r.eachNode((function(e){GV(e,kV)})),r.eachEdge((function(e){GV(e,BV)}))}}),n.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))}));var WV=bc,jV=l,XV=qa.groupData;function ZV(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function qV(e,t,i,n,r){var a="vertical"===r?"x":"y";jV.each(e,(function(e){var o,s,l;e.sort((function(e,t){return e.getLayout()[a]-t.getLayout()[a]}));for(var u=0,h=e.length,c="vertical"===r?"dx":"dy",d=0;d<h;d++)(l=u-(s=e[d]).getLayout()[a])>0&&(o=s.getLayout()[a]+l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]+s.getLayout()[c]+t;if((l=u-t-("vertical"===r?n:i))>0)for(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0),u=o,d=h-2;d>=0;--d)(l=(s=e[d]).getLayout()[a]+s.getLayout()[c]+t-u)>0&&(o=s.getLayout()[a]-l,"vertical"===r?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[a]}))}function YV(e,t,i){jV.each(e.slice().reverse(),(function(e){jV.each(e,(function(e){if(e.outEdges.length){var n=iG(e.outEdges,KV,i)/iG(e.outEdges,tG,i);if(isNaN(n)){var r=e.outEdges.length;n=r?iG(e.outEdges,QV,i)/r:0}if("vertical"===i){var a=e.getLayout().x+(n-eG(e,i))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(n-eG(e,i))*t;e.setLayout({y:o},!0)}}}))}))}function KV(e,t){return eG(e.node2,t)*e.getValue()}function QV(e,t){return eG(e.node2,t)}function JV(e,t){return eG(e.node1,t)*e.getValue()}function $V(e,t){return eG(e.node1,t)}function eG(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function tG(e){return e.getValue()}function iG(e,t,i){for(var n=0,r=e.length,a=-1;++a<r;){var o=+t.call(e,e[a],i);isNaN(o)||(n+=o)}return n}function nG(e,t,i){jV.each(e,(function(e){jV.each(e,(function(e){if(e.inEdges.length){var n=iG(e.inEdges,JV,i)/iG(e.inEdges,tG,i);if(isNaN(n)){var r=e.inEdges.length;n=r?iG(e.inEdges,$V,i)/r:0}if("vertical"===i){var a=e.getLayout().x+(n-eG(e,i))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(n-eG(e,i))*t;e.setLayout({y:o},!0)}}}))}))}var rG=function(e,t,i){e.eachSeriesByType("sankey",(function(e){var i=e.get("nodeWidth"),n=e.get("nodeGap"),r=function(e,t){return WV.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=r;var a=r.width,o=r.height,s=e.getGraph(),l=s.nodes,u=s.edges;!function(e){jV.each(e,(function(e){var t=iG(e.outEdges,tG),i=iG(e.inEdges,tG),n=e.getValue()||0,r=Math.max(t,i,n);e.setLayout({value:r},!0)}))}(l),function(e,t,i,n,r,a,o,s,l){(function(e,t,i,n,r,a,o){for(var s=[],l=[],u=[],h=[],c=0,d=0;d<t.length;d++)s[d]=1;for(d=0;d<e.length;d++)l[d]=e[d].inEdges.length,0===l[d]&&u.push(e[d]);var f=-1;for(;u.length;){for(var p=0;p<u.length;p++){var g=u[p],m=g.hostGraph.data.getRawDataItem(g.dataIndex),v=null!=m.depth&&m.depth>=0;v&&m.depth>f&&(f=m.depth),g.setLayout({depth:v?m.depth:c},!0),"vertical"===a?g.setLayout({dy:i},!0):g.setLayout({dx:i},!0);for(var y=0;y<g.outEdges.length;y++){var _=g.outEdges[y];s[t.indexOf(_)]=0;var x=_.node2;0==--l[e.indexOf(x)]&&h.indexOf(x)<0&&h.push(x)}}++c,u=h,h=[]}for(d=0;d<s.length;d++)if(1===s[d])throw new Error("Sankey is a DAG, the original data has cycle!");var b=f>c-1?f:c-1;o&&"left"!==o&&function(e,t,i,n){if("right"===t){for(var r=[],a=e,o=0;a.length;){for(var s=0;s<a.length;s++){var l=a[s];l.setLayout({skNodeHeight:o},!0);for(var u=0;u<l.inEdges.length;u++){var h=l.inEdges[u];r.indexOf(h.node1)<0&&r.push(h.node1)}}a=r,r=[],++o}jV.each(e,(function(e){ZV(e)||e.setLayout({depth:Math.max(0,n-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){jV.each(e,(function(e){ZV(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}(e,n)}(e,o,0,b);!function(e,t,i){jV.each(e,(function(e){var n=e.getLayout().depth*t;"vertical"===i?e.setLayout({y:n},!0):e.setLayout({x:n},!0)}))}(e,"vertical"===a?(r-i)/b:(n-i)/b,a)})(e,t,i,r,a,s,l),function(e,t,i,n,r,a,o){var s=function(e,t){var i=[],n="vertical"===t?"y":"x",r=XV(e,(function(e){return e.getLayout()[n]}));return r.keys.sort((function(e,t){return e-t})),jV.each(r.keys,(function(e){i.push(r.buckets.get(e))})),i}(e,o);(function(e,t,i,n,r,a){var o=1/0;jV.each(e,(function(e){var t=e.length,s=0;jV.each(e,(function(e){s+=e.getLayout().value}));var l="vertical"===a?(n-(t-1)*r)/s:(i-(t-1)*r)/s;l<o&&(o=l)})),jV.each(e,(function(e){jV.each(e,(function(e,t){var i=e.getLayout().value*o;"vertical"===a?(e.setLayout({x:t},!0),e.setLayout({dx:i},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:i},!0))}))})),jV.each(t,(function(e){var t=+e.getValue()*o;e.setLayout({dy:t},!0)}))})(s,t,i,n,r,o),qV(s,r,i,n,o);for(var l=1;a>0;a--)YV(s,l*=.99,o),qV(s,r,i,n,o),nG(s,l,o),qV(s,r,i,n,o)}(e,t,a,r,n,o,s),function(e,t){var i="vertical"===t?"x":"y";jV.each(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[i]-t.node2.getLayout()[i]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[i]-t.node1.getLayout()[i]}))})),jV.each(e,(function(e){var t=0,i=0;jV.each(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),jV.each(e.inEdges,(function(e){e.setLayout({ty:i},!0),i+=e.getLayout().dy}))}))}(e,s)}(l,u,i,n,a,o,0!==jV.filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))},aG=LR,oG=l;var sG=n,lG=rG,uG=function(e,t){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph().nodes;if(t.length){var i=1/0,n=-1/0;oG.each(t,(function(e){var t=e.getLayout().value;t<i&&(i=t),t>n&&(n=t)})),oG.each(t,(function(t){var r=new aG({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),a=t.getModel().get("itemStyle.color");null!=a?t.setVisual("color",a):t.setVisual("color",r)}))}}))};sG.registerLayout(lG),sG.registerVisual(uG);var hG={},cG=WI,dG=l,fG=fy.getDimensionTypeByAxis,pG=yd.makeSeriesEncodeForAxisCoordSys,gG={_baseAxisDim:null,getInitialData:function(e,t){var i,n,r=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=r.get("type"),s=a.get("type");"category"===o?(e.layout="horizontal",i=r.getOrdinalMeta(),n=!0):"category"===s?(e.layout="vertical",i=a.getOrdinalMeta(),n=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],d=[r,a],f=d[u].get("type"),p=d[1-u].get("type"),g=e.data;if(g&&n){var m=[];dG.each(g,(function(e,t){var i;e.value&&dG.isArray(e.value)?(i=e.value.slice(),e.value.unshift(t)):dG.isArray(e)?(i=e.slice(),e.unshift(t)):i=e,m.push(i)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:h,type:fG(f),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:fG(p),dimsDef:v.slice()}];return cG(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:dG.curry(pG,y,this)})},getBaseAxis:function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis}};hG.seriesModelMixin=gG;var mG=l,vG=Fg,yG=hG.seriesModelMixin,_G=vG.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}});mG.mixin(_G,yG,!0);var xG=l,bG=yo,wG=Ys,TG=["itemStyle"],SG=["emphasis","itemStyle"];cm.extend({type:"boxplot",render:function(e,t,i){var n=e.getData(),r=this.group,a=this._data;this._data||r.removeAll();var o="horizontal"===e.get("layout")?1:0;n.diff(a).add((function(e){if(n.hasValue(e)){var t=AG(n.getItemLayout(e),n,e,o,!0);n.setItemGraphicEl(e,t),r.add(t)}})).update((function(e,t){var i=a.getItemGraphicEl(t);if(n.hasValue(e)){var s=n.getItemLayout(e);i?IG(s,i,n,e):i=AG(s,n,e,o),r.add(i),n.setItemGraphicEl(e,i)}else r.remove(i)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&r.remove(t)})).execute(),this._data=n},remove:function(e){var t=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl((function(e){e&&t.remove(e)}))},dispose:xG.noop});var MG=wG.extend({type:"boxplotBoxPath",shape:{},buildPath:function(e,t){var i=t.points,n=0;for(e.moveTo(i[n][0],i[n][1]),n++;n<4;n++)e.lineTo(i[n][0],i[n][1]);for(e.closePath();n<i.length;n++)e.moveTo(i[n][0],i[n][1]),n++,e.lineTo(i[n][0],i[n][1])}});function AG(e,t,i,n,r){var a=e.ends,o=new MG({shape:{points:r?CG(a,n,e):a}});return IG(e,o,t,i,r),o}function IG(e,t,i,n,r){var a=i.hostModel;(0,bG[r?"initProps":"updateProps"])(t,{shape:{points:e.ends}},a,n);var o=i.getItemModel(n),s=o.getModel(TG),l=i.getItemVisual(n,"color"),u=s.getItemStyle(["borderColor"]);u.stroke=l,u.strokeNoScale=!0,t.useStyle(u),t.z2=100;var h=o.getModel(SG).getItemStyle();bG.setHoverStyle(t,h)}function CG(e,t,i){return xG.map(e,(function(e){return(e=e.slice())[t]=i.initBaseline,e}))}var DG=["itemStyle","borderColor"];var EG=function(e,t){var i=e.get("color");e.eachRawSeriesByType("boxplot",(function(t){var n=i[t.seriesIndex%i.length],r=t.getData();r.setVisual({legendSymbol:"roundRect",color:t.get(DG)||n}),e.isSeriesFiltered(t)||r.each((function(e){var t=r.getItemModel(e);r.setItemVisual(e,{color:t.get(DG,!0)})}))}))},LG=l,PG=wc.parsePercent,NG=LG.each;var RG=n,OG=EG,kG=function(e){var t=function(e){var t=[],i=[];return e.eachSeriesByType("boxplot",(function(e){var n=e.getBaseAxis(),r=LG.indexOf(i,n);r<0&&(r=i.length,i[r]=n,t[r]={axis:n,seriesModels:[]}),t[r].seriesModels.push(e)})),t}(e);NG(t,(function(e){var t=e.seriesModels;t.length&&(!function(e){var t,i,n=e.axis,r=e.seriesModels,a=r.length,o=e.boxWidthList=[],s=e.boxOffsetList=[],l=[];if("category"===n.type)i=n.getBandWidth();else{var u=0;NG(r,(function(e){u=Math.max(u,e.getData().count())})),t=n.getExtent(),Math.abs(t[1]-t[0])}NG(r,(function(e){var t=e.get("boxWidth");LG.isArray(t)||(t=[t,t]),l.push([PG(t[0],i)||0,PG(t[1],i)||0])}));var h=.8*i-2,c=h/a*.3,d=(h-c*(a-1))/a,f=d/2-h/2;NG(r,(function(e,t){s.push(f),f+=c+d,o.push(Math.min(Math.max(d,l[t][0]),l[t][1]))}))}(e),NG(t,(function(t,i){!function(e,t,i){var n=e.coordinateSystem,r=e.getData(),a=i/2,o="horizontal"===e.get("layout")?0:1,s=1-o,l=["x","y"],u=r.mapDimension(l[o]),h=r.mapDimension(l[s],!0);if(null==u||h.length<5)return;for(var c=0;c<r.count();c++){var d=r.get(u,c),f=_(d,h[2],c),p=_(d,h[0],c),g=_(d,h[1],c),m=_(d,h[3],c),v=_(d,h[4],c),y=[];x(y,g,0),x(y,m,1),y.push(p,g,v,m),b(y,p),b(y,v),b(y,f),r.setItemLayout(c,{initBaseline:f[s],ends:y})}function _(e,i,a){var l,u=r.get(i,a),h=[];return h[o]=e,h[s]=u,isNaN(e)||isNaN(u)?l=[NaN,NaN]:(l=n.dataToPoint(h))[o]+=t,l}function x(e,t,i){var n=t.slice(),r=t.slice();n[o]+=a,r[o]-=a,i?e.push(n,r):e.push(r,n)}function b(e,t){var i=t.slice(),n=t.slice();i[o]-=a,n[o]+=a,e.push(i,n)}}(t,e.boxOffsetList[i],e.boxWidthList[i])})))}))};RG.registerVisual(OG),RG.registerLayout(kG);var zG=l,BG=Fg,FG=hG.seriesModelMixin,VG=BG.extend({type:"series.candlestick",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationUpdate:!1,animationEasing:"linear",animationDuration:300},getShadowDim:function(){return"open"},brushSelector:function(e,t,i){var n=t.getItemLayout(e);return n&&i.rect(n.brushRect)}});zG.mixin(VG,FG,!0);var GG=l,HG=cm,UG=yo,WG=Ys,jG=oS.createClipPath,XG=["itemStyle"],ZG=["emphasis","itemStyle"],qG=["color","color0","borderColor","borderColor0"];HG.extend({type:"candlestick",render:function(e,t,i){this.group.removeClipPath(),this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e){var t=e.getData(),i=this._data,n=this.group,r=t.getLayout("isSimpleBox"),a=e.get("clip",!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||n.removeAll(),t.diff(i).add((function(i){if(t.hasValue(i)){var o,l=t.getItemLayout(i);if(a&&QG(s,l))return;o=KG(l,i,!0),UG.initProps(o,{shape:{points:l.ends}},e,i),JG(o,t,i,r),n.add(o),t.setItemGraphicEl(i,o)}})).update((function(o,l){var u=i.getItemGraphicEl(l);if(t.hasValue(o)){var h=t.getItemLayout(o);a&&QG(s,h)?n.remove(u):(u?UG.updateProps(u,{shape:{points:h.ends}},e,o):u=KG(h),JG(u,t,o,r),n.add(u),t.setItemGraphicEl(o,u))}else n.remove(u)})).remove((function(e){var t=i.getItemGraphicEl(e);t&&n.remove(t)})).execute(),this._data=t},_renderLarge:function(e){this._clear(),tH(e,this.group);var t=e.get("clip",!0)?jG(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},_incrementalRenderNormal:function(e,t){for(var i,n=t.getData(),r=n.getLayout("isSimpleBox");null!=(i=e.next());){var a;JG(a=KG(n.getItemLayout(i)),n,i,r),a.incremental=!0,this.group.add(a)}},_incrementalRenderLarge:function(e,t){tH(t,this.group,!0)},remove:function(e){this._clear()},_clear:function(){this.group.removeAll(),this._data=null},dispose:GG.noop});var YG=WG.extend({type:"normalCandlestickBox",shape:{},buildPath:function(e,t){var i=t.points;this.__simpleBox?(e.moveTo(i[4][0],i[4][1]),e.lineTo(i[6][0],i[6][1])):(e.moveTo(i[0][0],i[0][1]),e.lineTo(i[1][0],i[1][1]),e.lineTo(i[2][0],i[2][1]),e.lineTo(i[3][0],i[3][1]),e.closePath(),e.moveTo(i[4][0],i[4][1]),e.lineTo(i[5][0],i[5][1]),e.moveTo(i[6][0],i[6][1]),e.lineTo(i[7][0],i[7][1]))}});function KG(e,t,i){var n=e.ends;return new YG({shape:{points:i?$G(n,e):n},z2:100})}function QG(e,t){for(var i=!0,n=0;n<t.ends.length;n++)if(e.contain(t.ends[n][0],t.ends[n][1])){i=!1;break}return i}function JG(e,t,i,n){var r=t.getItemModel(i),a=r.getModel(XG),o=t.getItemVisual(i,"color"),s=t.getItemVisual(i,"borderColor")||o,l=a.getItemStyle(qG);e.useStyle(l),e.style.strokeNoScale=!0,e.style.fill=o,e.style.stroke=s,e.__simpleBox=n;var u=r.getModel(ZG).getItemStyle();UG.setHoverStyle(e,u)}function $G(e,t){return GG.map(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var eH=WG.extend({type:"largeCandlestickBox",shape:{},buildPath:function(e,t){for(var i=t.points,n=0;n<i.length;)if(this.__sign===i[n++]){var r=i[n++];e.moveTo(r,i[n++]),e.lineTo(r,i[n++])}else n+=3}});function tH(e,t,i){var n=e.getData(),r=n.getLayout("largePoints"),a=new eH({shape:{points:r},__sign:1});t.add(a);var o=new eH({shape:{points:r},__sign:-1});t.add(o),iH(1,a,e,n),iH(-1,o,e,n),i&&(a.incremental=!0,o.incremental=!0)}function iH(e,t,i,n){var r=e>0?"P":"N",a=n.getVisual("borderColor"+r)||n.getVisual("color"+r),o=i.getModel(XG).getItemStyle(qG);t.useStyle(o),t.style.fill=null,t.style.stroke=a}var nH=l;var rH=function(e){e&&nH.isArray(e.series)&&nH.each(e.series,(function(e){nH.isObject(e)&&"k"===e.type&&(e.type="candlestick")}))},aH=["itemStyle","borderColor"],oH=["itemStyle","borderColor0"],sH=["itemStyle","color"],lH=["itemStyle","color0"],uH={seriesType:"candlestick",plan:Zg(),performRawSeries:!0,reset:function(e,t){if(e.getData().setVisual({legendSymbol:"roundRect",colorP:i(1,e),colorN:i(-1,e),borderColorP:n(1,e),borderColorN:n(-1,e)}),!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){var r;for(;null!=(r=e.next());){var a=t.getItemModel(r),o=t.getItemLayout(r).sign;t.setItemVisual(r,{color:i(o,a),borderColor:n(o,a)})}}};function i(e,t){return t.get(e>0?sH:lH)}function n(e,t){return t.get(e>0?aH:oH)}}},hH=yo.subPixelOptimize,cH=Zg,dH=wc.parsePercent,fH=l.retrieve2,pH="undefined"!=typeof Float32Array?Float32Array:Array,gH={seriesType:"candlestick",plan:cH(),reset:function(e){var t=e.coordinateSystem,i=e.getData(),n=function(e,t){var i,n=e.getBaseAxis(),r="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/t.count()),a=dH(fH(e.get("barMaxWidth"),r),r),o=dH(fH(e.get("barMinWidth"),1),r),s=e.get("barWidth");return null!=s?dH(s,r):Math.max(Math.min(r/2,a),o)}(e,i),r=["x","y"],a=i.mapDimension(r[0]),o=i.mapDimension(r[1],!0),s=o[0],l=o[1],u=o[2],h=o[3];if(i.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),!(null==a||o.length<4))return{progress:e.pipelineContext.large?function(e,i){var n,r,o=new pH(4*e.count),c=0,d=[],f=[];for(;null!=(r=e.next());){var p=i.get(a,r),g=i.get(s,r),m=i.get(l,r),v=i.get(u,r),y=i.get(h,r);isNaN(p)||isNaN(v)||isNaN(y)?(o[c++]=NaN,c+=3):(o[c++]=mH(i,r,g,m,l),d[0]=p,d[1]=v,n=t.dataToPoint(d,null,f),o[c++]=n?n[0]:NaN,o[c++]=n?n[1]:NaN,d[1]=y,n=t.dataToPoint(d,null,f),o[c++]=n?n[1]:NaN)}i.setLayout("largePoints",o)}:function(e,i){var r;for(;null!=(r=e.next());){var o=i.get(a,r),c=i.get(s,r),d=i.get(l,r),f=i.get(u,r),p=i.get(h,r),g=Math.min(c,d),m=Math.max(c,d),v=w(g,o),y=w(m,o),_=w(f,o),x=w(p,o),b=[];T(b,y,0),T(b,v,1),b.push(M(x),M(y),M(_),M(v)),i.setItemLayout(r,{sign:mH(i,r,c,d,l),initBaseline:c>d?y[1]:v[1],ends:b,brushRect:S(f,p,o)})}function w(e,i){var n=[];return n[0]=i,n[1]=e,isNaN(i)||isNaN(e)?[NaN,NaN]:t.dataToPoint(n)}function T(e,t,i){var r=t.slice(),a=t.slice();r[0]=hH(r[0]+n/2,1,!1),a[0]=hH(a[0]-n/2,1,!0),i?e.push(r,a):e.push(a,r)}function S(e,t,i){var r=w(e,i),a=w(t,i);return r[0]-=n/2,a[0]-=n/2,{x:r[0],y:r[1],width:n,height:a[1]-r[1]}}function M(e){return e[0]=hH(e[0],1),e}}}}};function mH(e,t,i,n,r){return i>n?-1:i<n?1:t>0?e.get(r,t-1)<=n?1:-1:1}var vH=n,yH=rH,_H=uH,xH=gH;vH.registerPreprocessor(yH),vH.registerVisual(_H),vH.registerLayout(xH);var bH=U_;Fg.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(e,t){return bH(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var wH=l,TH=Ab.createSymbol,SH=yo.Group,MH=wc.parsePercent,AH=MT;function IH(e,t){var i=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?i:null,fill:"fill"===t.brushType?i:null}})}))}function CH(e,t){SH.call(this);var i=new AH(e,t),n=new SH;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(e,t)}var DH=CH.prototype;DH.stopEffectAnimation=function(){this.childAt(1).removeAll()},DH.startEffectAnimation=function(e){for(var t=e.symbolType,i=e.color,n=this.childAt(1),r=0;r<3;r++){var a=TH(t,-1,-1,2,2,i);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var o=-r/3*e.period+e.effectOffset;a.animate("",!0).when(e.period,{scale:[e.rippleScale/2,e.rippleScale/2]}).delay(o).start(),a.animateStyle(!0).when(e.period,{opacity:0}).delay(o).start(),n.add(a)}IH(n,e)},DH.updateEffectAnimation=function(e){for(var t=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],r=0;r<n.length;r++){var a=n[r];if(t[a]!==e[a])return this.stopEffectAnimation(),void this.startEffectAnimation(e)}IH(i,e)},DH.highlight=function(){this.trigger("emphasis")},DH.downplay=function(){this.trigger("normal")},DH.updateData=function(e,t){var i=e.hostModel;this.childAt(0).updateData(e,t);var n=this.childAt(1),r=e.getItemModel(t),a=e.getItemVisual(t,"symbol"),o=function(e){return wH.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),s=e.getItemVisual(t,"color");n.attr("scale",o),n.traverse((function(e){e.attr({fill:s})}));var l=r.getShallow("symbolOffset");if(l){var u=n.position;u[0]=MH(l[0],o[0]),u[1]=MH(l[1],o[1])}var h=e.getItemVisual(t,"symbolRotate");n.rotation=(h||0)*Math.PI/180||0;var c={};if(c.showEffectOn=i.get("showEffectOn"),c.rippleScale=r.get("rippleEffect.scale"),c.brushType=r.get("rippleEffect.brushType"),c.period=1e3*r.get("rippleEffect.period"),c.effectOffset=t/e.count(),c.z=r.getShallow("z")||0,c.zlevel=r.getShallow("zlevel")||0,c.symbolType=a,c.color=s,c.rippleEffectColor=r.get("rippleEffect.color"),this.off("mouseover").off("mouseout").off("emphasis").off("normal"),"render"===c.showEffectOn)this._effectCfg?this.updateEffectAnimation(c):this.startEffectAnimation(c),this._effectCfg=c;else{this._effectCfg=null,this.stopEffectAnimation();var d=this.childAt(0),f=function(){d.highlight(),"render"!==c.showEffectOn&&this.startEffectAnimation(c)},p=function(){d.downplay(),"render"!==c.showEffectOn&&this.stopEffectAnimation()};this.on("mouseover",f,this).on("mouseout",p,this).on("emphasis",f,this).on("normal",p,this)}this._effectCfg=c},DH.fadeOut=function(e){this.off("mouseover").off("mouseout").off("emphasis").off("normal"),e&&e()},wH.inherits(CH,SH);var EH=RT,LH=CH,PH=Re,NH=FS;n.extendChartView({type:"effectScatter",init:function(){this._symbolDraw=new EH(LH)},render:function(e,t,i){var n=e.getData(),r=this._symbolDraw;r.updateData(n),this.group.add(r.group)},updateTransform:function(e,t,i){var n=e.getData();this.group.dirty();var r=NH().reset(e);r.progress&&r.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateGroupTransform:function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=PH.clone(t.getRoamTransform()),this.group.decomposeTransform())},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(t)},dispose:function(){}});var RH=n,OH=OS,kH=FS;RH.registerVisual(OH("effectScatter","circle")),RH.registerLayout(kH("effectScatter"));var zH=Fg,BH=Jy,FH=l,VH=FH.concatArray,GH=FH.mergeAll,HH=FH.map,UH=Ac.encodeHTML,WH="undefined"==typeof Uint32Array?Array:Uint32Array,jH="undefined"==typeof Float64Array?Array:Float64Array;function XH(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=HH(t,(function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),GH([t,e[0],e[1]])})))}var ZH=zH.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.color",init:function(e){e.data=e.data||[],XH(e);var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),ZH.superApply(this,"init",arguments)},mergeOption:function(e){if(XH(e),e.data){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count))}ZH.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=VH(this._flatCoords,t.flatCoords),this._flatCoordsOffset=VH(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e);return t.option instanceof Array?t.option:t.getShallow("coords")},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*e],n=this._flatCoordsOffset[2*e+1],r=0;r<n;r++)t[r]=t[r]||[],t[r][0]=this._flatCoords[i+2*r],t[r][1]=this._flatCoords[i+2*r+1];return n}var a=this._getCoordsFromItemModel(e);for(r=0;r<a.length;r++)t[r]=t[r]||[],t[r][0]=a[r][0],t[r][1]=a[r][1];return a.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var i=e.length,n=new WH(i),r=new jH(i),a=0,o=0,s=0,l=0;l<i;){s++;var u=e[l++];n[o++]=a+t,n[o++]=u;for(var h=0;h<u;h++){var c=e[l++],d=e[l++];r[a++]=c,r[a++]=d}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,o),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var i=new BH(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,r){if(e instanceof Array)return NaN;i.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),i},formatTooltip:function(e){var t=this.getData().getItemModel(e),i=t.get("name");if(i)return i;var n=t.get("fromName"),r=t.get("toName"),a=[];return null!=n&&a.push(n),null!=r&&a.push(r),UH(a.join(" > "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}),qH=yo,YH=hk,KH=l,QH=Ab.createSymbol,JH=P,$H=xo;function eU(e,t,i){qH.Group.call(this),this.add(this.createLine(e,t,i)),this._updateEffectSymbol(e,t)}var tU=eU.prototype;tU.createLine=function(e,t,i){return new YH(e,t,i)},tU._updateEffectSymbol=function(e,t){var i=e.getItemModel(t).getModel("effect"),n=i.get("symbolSize"),r=i.get("symbol");KH.isArray(n)||(n=[n,n]);var a=i.get("color")||e.getItemVisual(t,"color"),o=this.childAt(1);this._symbolType!==r&&(this.remove(o),(o=QH(r,-.5,-.5,1,1,a)).z2=100,o.culling=!0,this.add(o)),o&&(o.setStyle("shadowColor",a),o.setStyle(i.getItemStyle(["color"])),o.attr("scale",n),o.setColor(a),o.attr("scale",n),this._symbolType=r,this._symbolScale=n,this._updateEffectAnimation(e,i,t))},tU._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var r=this,a=e.getItemLayout(i),o=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=KH.retrieve(t.get("delay"),(function(t){return t/e.count()*o/3})),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),l>0&&(o=this.getLineLength(n)/l*1e3),o!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-o*n.__t),n.__t=0;var d=n.animate("",s).when(o,{__t:1}).delay(c).during((function(){r.updateSymbolPosition(n)}));s||d.done((function(){r.remove(n)})),d.start()}this._period=o,this._loop=s}},tU.getLineLength=function(e){return JH.dist(e.__p1,e.__cp1)+JH.dist(e.__cp1,e.__p2)},tU.updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},tU.updateData=function(e,t,i){this.childAt(0).updateData(e,t,i),this._updateEffectSymbol(e,t)},tU.updateSymbolPosition=function(e){var t=e.__p1,i=e.__p2,n=e.__cp1,r=e.__t,a=e.position,o=[a[0],a[1]],s=$H.quadraticAt,l=$H.quadraticDerivativeAt;a[0]=s(t[0],n[0],i[0],r),a[1]=s(t[1],n[1],i[1],r);var u=l(t[0],n[0],i[0],r),h=l(t[1],n[1],i[1],r);if(e.rotation=-Math.atan2(h,u)-Math.PI/2,"line"===this._symbolType||"rect"===this._symbolType||"roundRect"===this._symbolType)if(void 0!==e.__lastT&&e.__lastT<e.__t){var c=1.05*JH.dist(o,a);e.attr("scale",[e.scale[0],c]),1===r&&(a[0]=o[0]+(a[0]-o[0])/2,a[1]=o[1]+(a[1]-o[1])/2)}else if(1===e.__lastT){c=2*JH.dist(t,a);e.attr("scale",[e.scale[0],c])}else e.attr("scale",this._symbolScale);e.__lastT=e.__t,e.ignore=!1},tU.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var i=e.getItemModel(t).getModel("effect");this._updateEffectAnimation(e,i,t)},KH.inherits(eU,qH.Group);var iU=eU,nU=yo,rU=l;function aU(e,t,i){nU.Group.call(this),this._createPolyline(e,t,i)}var oU=aU.prototype;oU._createPolyline=function(e,t,i){var n=e.getItemLayout(t),r=new nU.Polyline({shape:{points:n}});this.add(r),this._updateCommonStl(e,t,i)},oU.updateData=function(e,t,i){var n=e.hostModel,r=this.childAt(0),a={shape:{points:e.getItemLayout(t)}};nU.updateProps(r,a,n,t),this._updateCommonStl(e,t,i)},oU._updateCommonStl=function(e,t,i){var n=this.childAt(0),r=e.getItemModel(t),a=e.getItemVisual(t,"color"),o=i&&i.lineStyle,s=i&&i.hoverLineStyle;i&&!e.hasItemOption||(o=r.getModel("lineStyle").getLineStyle(),s=r.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle(rU.defaults({strokeNoScale:!0,fill:"none",stroke:a},o)),n.hoverStyle=s,nU.setHoverStyle(this)},oU.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},rU.inherits(aU,nU.Group);var sU=aU,lU=sU,uU=l,hU=iU,cU=P;function dU(e,t,i){hU.call(this,e,t,i),this._lastFrame=0,this._lastFramePercent=0}var fU=dU.prototype;fU.createLine=function(e,t,i){return new lU(e,t,i)},fU.updateAnimationPoints=function(e,t){this._points=t;for(var i=[0],n=0,r=1;r<t.length;r++){var a=t[r-1],o=t[r];n+=cU.dist(a,o),i.push(n)}if(0!==n){for(r=0;r<i.length;r++)i[r]/=n;this._offsets=i,this._length=n}},fU.getLineLength=function(e){return this._length},fU.updateSymbolPosition=function(e){var t=e.__t,i=this._points,n=this._offsets,r=i.length;if(n){var a=this._lastFrame;if(t<this._lastFramePercent){for(o=Math.min(a+1,r-1);o>=0&&!(n[o]<=t);o--);o=Math.min(o,r-2)}else{for(var o=a;o<r&&!(n[o]>t);o++);o=Math.min(o-1,r-2)}cU.lerp(e.position,i[o],i[o+1],(t-n[o])/(n[o+1]-n[o]));var s=i[o+1][0]-i[o][0],l=i[o+1][1]-i[o][1];e.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},uU.inherits(dU,hU);var pU=dU,gU=yo,mU=Vu,vU=ps,yU=vs,_U=gU.extendShape({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(e,t){var i=t.segs,n=t.curveness;if(t.polyline)for(var r=0;r<i.length;){var a=i[r++];if(a>0){e.moveTo(i[r++],i[r++]);for(var o=1;o<a;o++)e.lineTo(i[r++],i[r++])}}else for(r=0;r<i.length;){var s=i[r++],l=i[r++],u=i[r++],h=i[r++];if(e.moveTo(s,l),n>0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;e.quadraticCurveTo(c,d,u,h)}else e.lineTo(u,h)}},findDataIndex:function(e,t){var i=this.shape,n=i.segs,r=i.curveness;if(i.polyline)for(var a=0,o=0;o<n.length;){var s=n[o++];if(s>0)for(var l=n[o++],u=n[o++],h=1;h<s;h++){var c=n[o++],d=n[o++];if(vU.containStroke(l,u,c,d))return a}a++}else for(a=0,o=0;o<n.length;){l=n[o++],u=n[o++],c=n[o++],d=n[o++];if(r>0){var f=(l+c)/2-(u-d)*r,p=(u+d)/2-(c-l)*r;if(yU.containStroke(l,u,f,p,c,d))return a}else if(vU.containStroke(l,u,c,d))return a;a++}return-1}});function xU(){this.group=new gU.Group}var bU=xU.prototype;bU.isPersistent=function(){return!this._incremental},bU.updateData=function(e){this.group.removeAll();var t=new _U({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},bU.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new mU({silent:!0})),this.group.add(this._incremental)):this._incremental=null},bU.incrementalUpdate=function(e,t){var i=new _U;i.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(i,t,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=e.start,this.group.add(i))},bU.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},bU._setCommon=function(e,t,i){var n=t.hostModel;e.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),e.useStyle(n.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var r=t.getVisual("color");r&&e.setStyle("stroke",r),e.setStyle("fill"),i||(e.seriesIndex=n.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>0&&(e.dataIndex=i+e.__startIndex)})))},bU._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var wU=xU,TU={seriesType:"lines",plan:Zg(),reset:function(e){var t=e.coordinateSystem,i=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(r,a){var o=[];if(n){var s,l=r.end-r.start;if(i){for(var u=0,h=r.start;h<r.end;h++)u+=e.getLineCoordsCount(h);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var c=0,d=[];for(h=r.start;h<r.end;h++){var f=e.getLineCoords(h,o);i&&(s[c++]=f);for(var p=0;p<f;p++)d=t.dataToPoint(o[p],!1,d),s[c++]=d[0],s[c++]=d[1]}a.setLayout("linesPoints",s)}else for(h=r.start;h<r.end;h++){var g=a.getItemModel(h),m=(f=e.getLineCoords(h,o),[]);if(i)for(var v=0;v<f;v++)m.push(t.dataToPoint(o[v]));else{m[0]=t.dataToPoint(o[0]),m[1]=t.dataToPoint(o[1]);var y=g.get("lineStyle.curveness");+y&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*y,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*y])}a.setItemLayout(h,m)}}}}},SU=TU,MU=n,AU=yk,IU=iU,CU=hk,DU=sU,EU=pU,LU=wU,PU=SU,NU=oS.createClipPath;function RU(e){return e instanceof Array||(e=[e,e]),e}MU.extendChartView({type:"lines",init:function(){},render:function(e,t,i){var n=e.getData(),r=this._updateLineDraw(n,e),a=e.get("zlevel"),o=e.get("effect.trailLength"),s=i.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(a).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&o&&(l||s.configLayer(a,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)})),r.updateData(n);var u=e.get("clip",!0)&&NU(e.coordinateSystem,!1,e);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=a,this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateLineDraw(n,e).incrementalPrepareUpdate(n),this._clearLayer(i),this._finished=!1},incrementalRender:function(e,t,i){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData(),r=e.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var a=PU.reset(e);a.progress&&a.progress({start:0,end:n.count()},n),this._lineDraw.updateLayout(),this._clearLayer(i)},_updateLineDraw:function(e,t){var i=this._lineDraw,n=this._showEffect(t),r=!!t.get("polyline"),a=t.pipelineContext.large;return i&&n===this._hasEffet&&r===this._isPolyline&&a===this._isLargeDraw||(i&&i.remove(),i=this._lineDraw=a?new LU:new AU(r?n?EU:DU:n?IU:CU),this._hasEffet=n,this._isPolyline=r,this._isLargeDraw=a,this.group.removeAll()),this.group.add(i.group),i},_showEffect:function(e){return!!e.get("effect.show")},_clearLayer:function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},remove:function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},dispose:function(){}});var OU="lineStyle.opacity".split("."),kU=n,zU=SU,BU={seriesType:"lines",reset:function(e,t,i){var n=RU(e.get("symbol")),r=RU(e.get("symbolSize")),a=e.getData();return a.setVisual("fromSymbol",n&&n[0]),a.setVisual("toSymbol",n&&n[1]),a.setVisual("fromSymbolSize",r&&r[0]),a.setVisual("toSymbolSize",r&&r[1]),a.setVisual("opacity",e.get(OU)),{dataEach:a.hasItemOption?function(e,t){var i=e.getItemModel(t),n=RU(i.getShallow("symbol",!0)),r=RU(i.getShallow("symbolSize",!0)),a=i.get(OU);n[0]&&e.setItemVisual(t,"fromSymbol",n[0]),n[1]&&e.setItemVisual(t,"toSymbol",n[1]),r[0]&&e.setItemVisual(t,"fromSymbolSize",r[0]),r[1]&&e.setItemVisual(t,"toSymbolSize",r[1]),e.setItemVisual(t,"opacity",a)}:null}}};kU.registerLayout(zU),kU.registerVisual(BU);var FU=U_,VU=Bf;Fg.extend({type:"series.heatmap",getInitialData:function(e,t){return FU(this.getSource(),this,{generateCoord:"value"})},preventIncremental:function(){var e=VU.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0}});var GU=l;function HU(){var e=GU.createCanvas();this.canvas=e,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}HU.prototype={update:function(e,t,i,n,r,a){var o=this._getBrush(),s=this._getGradient(e,r,"inRange"),l=this._getGradient(e,r,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),d=e.length;h.width=t,h.height=i;for(var f=0;f<d;++f){var p=e[f],g=p[0],m=p[1],v=n(p[2]);c.globalAlpha=v,c.drawImage(o,g-u,m-u)}if(!h.width||!h.height)return h;for(var y=c.getImageData(0,0,h.width,h.height),_=y.data,x=0,b=_.length,w=this.minOpacity,T=this.maxOpacity-w;x<b;){v=_[x+3]/256;var S=4*Math.floor(255*v);if(v>0){var M=a(v)?s:l;v>0&&(v=v*T+w),_[x++]=M[S],_[x++]=M[S+1],_[x++]=M[S+2],_[x++]=M[S+3]*v*256}else x+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var e=this._brushCanvas||(this._brushCanvas=GU.createCanvas()),t=this.pointSize+this.blurSize,i=2*t;e.width=i,e.height=i;var n=e.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-t,t,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),e},_getGradient:function(e,t,i){for(var n=this._gradientPixels,r=n[i]||(n[i]=new Uint8ClampedArray(1024)),a=[0,0,0,0],o=0,s=0;s<256;s++)t[i](s/255,!0,a),r[o++]=a[0],r[o++]=a[1],r[o++]=a[2],r[o++]=a[3];return r}};var UU=yo,WU=HU,jU=l;n.extendChartView({type:"heatmap",render:function(e,t,i){var n;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(i){i===e&&(n=t)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var r=e.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(e,i,0,e.getData().count()):function(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}(r)&&this._renderOnGeo(r,e,n,i)},incrementalPrepareRender:function(e,t,i){this.group.removeAll()},incrementalRender:function(e,t,i,n){t.coordinateSystem&&this._renderOnCartesianAndCalendar(t,n,e.start,e.end,!0)},_renderOnCartesianAndCalendar:function(e,t,i,n,r){var a,o,s=e.coordinateSystem;if("cartesian2d"===s.type){var l=s.getAxis("x"),u=s.getAxis("y");a=l.getBandWidth(),o=u.getBandWidth()}for(var h=this.group,c=e.getData(),d="itemStyle",f="emphasis.itemStyle",p="label",g="emphasis.label",m=e.getModel(d).getItemStyle(["color"]),v=e.getModel(f).getItemStyle(),y=e.getModel(p),_=e.getModel(g),x=s.type,b="cartesian2d"===x?[c.mapDimension("x"),c.mapDimension("y"),c.mapDimension("value")]:[c.mapDimension("time"),c.mapDimension("value")],w=i;w<n;w++){var T;if("cartesian2d"===x){if(isNaN(c.get(b[2],w)))continue;var S=s.dataToPoint([c.get(b[0],w),c.get(b[1],w)]);T=new UU.Rect({shape:{x:Math.floor(Math.round(S[0])-a/2),y:Math.floor(Math.round(S[1])-o/2),width:Math.ceil(a),height:Math.ceil(o)},style:{fill:c.getItemVisual(w,"color"),opacity:c.getItemVisual(w,"opacity")}})}else{if(isNaN(c.get(b[1],w)))continue;T=new UU.Rect({z2:1,shape:s.dataToRect([c.get(b[0],w)]).contentShape,style:{fill:c.getItemVisual(w,"color"),opacity:c.getItemVisual(w,"opacity")}})}var M=c.getItemModel(w);c.hasItemOption&&(m=M.getModel(d).getItemStyle(["color"]),v=M.getModel(f).getItemStyle(),y=M.getModel(p),_=M.getModel(g));var A=e.getRawValue(w),I="-";A&&null!=A[2]&&(I=A[2]),UU.setLabelStyle(m,v,y,_,{labelFetcher:e,labelDataIndex:w,defaultText:I,isRectText:!0}),T.setStyle(m),UU.setHoverStyle(T,c.hasItemOption?v:jU.extend({},v)),T.incremental=r,r&&(T.useHoverLayer=!0),h.add(T),c.setItemGraphicEl(w,T)}},_renderOnGeo:function(e,t,i,n){var r=i.targetVisuals.inRange,a=i.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new WU;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),u=e.getRoamTransform();l.applyTransform(u);var h=Math.max(l.x,0),c=Math.max(l.y,0),d=Math.min(l.width+l.x,n.getWidth()),f=Math.min(l.height+l.y,n.getHeight()),p=d-h,g=f-c,m=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],v=o.mapArray(m,(function(t,i,n){var r=e.dataToPoint([t,i]);return r[0]-=h,r[1]-=c,r.push(n),r})),y=i.getExtent(),_="visualMap.continuous"===i.type?function(e,t){var i=e[1]-e[0];return t=[(t[0]-e[0])/i,(t[1]-e[0])/i],function(e){return e>=t[0]&&e<=t[1]}}(y,i.option.range):function(e,t,i){var n=e[1]-e[0],r=(t=jU.map(t,(function(t){return{interval:[(t.interval[0]-e[0])/n,(t.interval[1]-e[0])/n]}}))).length,a=0;return function(e){for(var n=a;n<r;n++)if((o=t[n].interval)[0]<=e&&e<=o[1]){a=n;break}if(n===r)for(n=a-1;n>=0;n--){var o;if((o=t[n].interval)[0]<=e&&e<=o[1]){a=n;break}}return n>=0&&n<r&&i[n]}}(y,i.getPieceList(),i.option.selected);s.update(v,p,g,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:a.color.getColorMapper()},_);var x=new UU.Image({style:{width:p,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(x)},dispose:function(){}});var XU=eI.extend({type:"series.pictorialBar",dependencies:["grid"],defaultOption:{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,hoverAnimation:!1},getInitialData:function(e){return e.stack=null,XU.superApply(this,"getInitialData",arguments)}}),ZU=n,qU=l,YU=yo,KU=Ab.createSymbol,QU=wc,JU=QU.parsePercent,$U=QU.isNumeric,eW=tI.setLabel,tW=["itemStyle","borderWidth"],iW=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],nW=new YU.Circle;function rW(e,t,i,n){var r=e.getItemLayout(t),a=i.get("symbolRepeat"),o=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:t,layout:r,itemModel:i,symbolType:e.getItemVisual(t,"symbol")||"circle",color:e.getItemVisual(t,"color"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};!function(e,t,i,n,r){var a,o=n.valueDim,s=e.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[o.wh]<=0);if(qU.isArray(s)){var c=[aW(l,s[0])-u,aW(l,s[1])-u];c[1]<c[0]&&c.reverse(),a=c[h]}else a=null!=s?aW(l,s)-u:t?n.coordSysExtent[o.index][h]-u:i[o.wh];r.boundingLength=a,t&&(r.repeatCutLength=i[o.wh]);r.pxSign=a>0?1:a<0?-1:0}(i,a,r,n,c),function(e,t,i,n,r,a,o,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),f=e.getItemVisual(t,"symbolSize");qU.isArray(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]);f[c.index]=JU(f[c.index],d),f[h.index]=JU(f[h.index],n?d:Math.abs(a)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[h.index]*=(l.isHorizontal?-1:1)*o}(e,t,r,a,0,c.boundingLength,c.pxSign,u,n,c),function(e,t,i,n,r){var a=e.get(tW)||0;a&&(nW.attr({scale:t.slice(),rotation:i}),nW.updateTransform(),a/=nW.getLineScale(),a*=t[n.valueDim.index]);r.valueLineWidth=a}(i,c.symbolScale,l,n,c);var d=c.symbolSize,f=i.get("symbolOffset");return qU.isArray(f)&&(f=[JU(f[0],d[0]),JU(f[1],d[1])]),function(e,t,i,n,r,a,o,s,l,u,h,c){var d=h.categoryDim,f=h.valueDim,p=c.pxSign,g=Math.max(t[f.index]+s,0),m=g;if(n){var v=Math.abs(l),y=qU.retrieve(e.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1)),y=JU(y,t[f.index]);var x=Math.max(g+2*y,0),b=_?0:2*y,w=$U(n),T=w?n:bW((v+b)/x);x=g+2*(y=(v-T*g)/2/(_?T:T-1)),b=_?0:2*y,w||"fixed"===n||(T=u?bW((Math.abs(u)+b)/x):0),m=T*x-b,c.repeatTimes=T,c.symbolMargin=y}var S=p*(m/2),M=c.pathPosition=[];M[d.index]=i[d.wh]/2,M[f.index]="start"===o?S:"end"===o?l-S:l/2,a&&(M[0]+=a[0],M[1]+=a[1]);var A=c.bundlePosition=[];A[d.index]=i[d.xy],A[f.index]=i[f.xy];var I=c.barRectShape=qU.extend({},i);I[f.wh]=p*Math.max(Math.abs(i[f.wh]),Math.abs(M[f.index]+S)),I[d.wh]=i[d.wh];var C=c.clipShape={};C[d.xy]=-i[d.xy],C[d.wh]=h.ecSize[d.wh],C[f.xy]=0,C[f.wh]=i[f.wh]}(i,d,r,a,0,f,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function aW(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function oW(e){var t=e.symbolPatternSize,i=KU(e.symbolType,-t/2,-t/2,t,t,e.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function sW(e,t,i,n){var r=e.__pictorialBundle,a=i.symbolSize,o=i.valueLineWidth,s=i.pathPosition,l=t.valueDim,u=i.repeatTimes||0,h=0,c=a[t.valueDim.index]+o+2*i.symbolMargin;for(yW(e,(function(e){e.__pictorialAnimationIndex=h,e.__pictorialRepeatTimes=u,h<u?_W(e,null,p(h),i,n):_W(e,null,{scale:[0,0]},i,n,(function(){r.remove(e)})),pW(e,i),h++}));h<u;h++){var d=oW(i);d.__pictorialAnimationIndex=h,d.__pictorialRepeatTimes=u,r.add(d);var f=p(h);_W(d,{position:f.position,scale:[0,0]},{scale:f.scale,rotation:f.rotation},i,n),d.on("mouseover",g).on("mouseout",m),pW(d,i)}function p(e){var t=s.slice(),n=i.pxSign,r=e;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(r=u-1-e),t[l.index]=c*(r-u/2+.5)+s[l.index],{position:t,scale:i.symbolScale.slice(),rotation:i.rotation}}function g(){yW(e,(function(e){e.trigger("emphasis")}))}function m(){yW(e,(function(e){e.trigger("normal")}))}}function lW(e,t,i,n){var r=e.__pictorialBundle,a=e.__pictorialMainPath;a?_W(a,null,{position:i.pathPosition.slice(),scale:i.symbolScale.slice(),rotation:i.rotation},i,n):(a=e.__pictorialMainPath=oW(i),r.add(a),_W(a,{position:i.pathPosition.slice(),scale:[0,0],rotation:i.rotation},{scale:i.symbolScale.slice()},i,n),a.on("mouseover",(function(){this.trigger("emphasis")})).on("mouseout",(function(){this.trigger("normal")}))),pW(a,i)}function uW(e,t,i){var n=qU.extend({},t.barRectShape),r=e.__pictorialBarRect;r?_W(r,null,{shape:n},t,i):(r=e.__pictorialBarRect=new YU.Rect({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(r))}function hW(e,t,i,n){if(i.symbolClip){var r=e.__pictorialClipPath,a=qU.extend({},i.clipShape),o=t.valueDim,s=i.animationModel,l=i.dataIndex;if(r)YU.updateProps(r,{shape:a},s,l);else{a[o.wh]=0,r=new YU.Rect({shape:a}),e.__pictorialBundle.setClipPath(r),e.__pictorialClipPath=r;var u={};u[o.wh]=i.clipShape[o.wh],YU[n?"updateProps":"initProps"](r,{shape:u},s,l)}}}function cW(e,t){var i=e.getItemModel(t);return i.getAnimationDelayParams=dW,i.isAnimationEnabled=fW,i}function dW(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function fW(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function pW(e,t){e.off("emphasis").off("normal");var i=t.symbolScale.slice();t.hoverAnimation&&e.on("emphasis",(function(){this.animateTo({scale:[1.1*i[0],1.1*i[1]]},400,"elasticOut")})).on("normal",(function(){this.animateTo({scale:i.slice()},400,"elasticOut")}))}function gW(e,t,i,n){var r=new YU.Group,a=new YU.Group;return r.add(a),r.__pictorialBundle=a,a.attr("position",i.bundlePosition.slice()),i.symbolRepeat?sW(r,t,i):lW(r,0,i),uW(r,i,n),hW(r,t,i,n),r.__pictorialShapeStr=vW(e,i),r.__pictorialSymbolMeta=i,r}function mW(e,t,i,n){var r=n.__pictorialBarRect;r&&(r.style.text=null);var a=[];yW(n,(function(e){a.push(e)})),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),qU.each(a,(function(e){YU.updateProps(e,{scale:[0,0]},i,t,(function(){n.parent&&n.parent.remove(n)}))})),e.setItemGraphicEl(t,null)}function vW(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function yW(e,t,i){qU.each(e.__pictorialBundle.children(),(function(n){n!==e.__pictorialBarRect&&t.call(i,n)}))}function _W(e,t,i,n,r,a){t&&e.attr(t),n.symbolClip&&!r?i&&e.attr(i):i&&YU[r?"updateProps":"initProps"](e,i,n.animationModel,n.dataIndex,a)}function xW(e,t,i){var n=i.color,r=i.dataIndex,a=i.itemModel,o=a.getModel("itemStyle").getItemStyle(["color"]),s=a.getModel("emphasis.itemStyle").getItemStyle(),l=a.getShallow("cursor");yW(e,(function(e){e.setColor(n),e.setStyle(qU.defaults({fill:n,opacity:i.opacity},o)),YU.setHoverStyle(e,s),l&&(e.cursor=l),e.z2=i.z2}));var u={},h=t.valueDim.posDesc[+(i.boundingLength>0)],c=e.__pictorialBarRect;eW(c.style,u,a,n,t.seriesModel,r,h),YU.setHoverStyle(c,u)}function bW(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}ZU.extendChartView({type:"pictorialBar",render:function(e,t,i){var n=this.group,r=e.getData(),a=this._data,o=e.coordinateSystem,s=!!o.getBaseAxis().isHorizontal(),l=o.grid.getRect(),u={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:iW[+s],categoryDim:iW[1-s]};return r.diff(a).add((function(e){if(r.hasValue(e)){var t=cW(r,e),i=rW(r,e,t,u),a=gW(r,u,i);r.setItemGraphicEl(e,a),n.add(a),xW(a,u,i)}})).update((function(e,t){var i=a.getItemGraphicEl(t);if(r.hasValue(e)){var o=cW(r,e),s=rW(r,e,o,u),l=vW(r,s);i&&l!==i.__pictorialShapeStr&&(n.remove(i),r.setItemGraphicEl(e,null),i=null),i?function(e,t,i){var n=i.animationModel,r=i.dataIndex,a=e.__pictorialBundle;YU.updateProps(a,{position:i.bundlePosition.slice()},n,r),i.symbolRepeat?sW(e,t,i,!0):lW(e,t,i,!0);uW(e,i,!0),hW(e,t,i,!0)}(i,u,s):i=gW(r,u,s,!0),r.setItemGraphicEl(e,i),i.__pictorialSymbolMeta=s,n.add(i),xW(i,u,s)}else n.remove(i)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&mW(a,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=r,this.group},dispose:qU.noop,remove:function(e,t){var i=this.group,n=this._data;e.get("animation")?n&&n.eachItemGraphicEl((function(t){mW(n,t.dataIndex,e,t)})):i.removeAll()}});var wW=n,TW=l,SW=Tx.layout,MW=OS;wW.registerLayout(TW.curry(SW,"pictorialBar")),wW.registerVisual(MW("pictorialBar","roundRect"));var AW=l,IW=Hw,CW=function(e,t,i,n,r){IW.call(this,e,t,i),this.type=n||"value",this.position=r||"bottom",this.orient=null};CW.prototype={constructor:CW,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},pointToData:function(e,t){return this.coordinateSystem.pointToData(e,t)[0]},toGlobalCoord:null,toLocalCoord:null},AW.inherits(CW,IW);var DW=CW,EW=W_,LW=bc.getLayoutRect,PW=l.each;function NW(e,t,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(e,t,i),this.model=e}NW.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:NW,_init:function(e,t,i){var n=this.dimension,r=new DW(n,EW.createScaleByModel(e),[0,0],e.get("type"),e.get("position")),a="category"===r.type;r.onBand=a&&e.get("boundaryGap"),r.inverse=e.get("inverse"),r.orient=e.get("orient"),e.axis=r,r.model=e,r.coordinateSystem=this,this._axis=r},update:function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();PW(t.mapDimension(this.dimension,!0),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),EW.niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},resize:function(e,t){this._rect=LW({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},getRect:function(){return this._rect},_adjustAxis:function(){var e=this._rect,t=this._axis,i=t.isHorizontal(),n=i?[0,e.width]:[0,e.height],r=t.reverse?1:0;t.setExtent(n[r],n[1-r]),this._updateAxisTransform(t,i?e.x:e.y)},_updateAxisTransform:function(e,t){var i=e.getExtent(),n=i[0]+i[1],r=e.isHorizontal();e.toGlobalCoord=r?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord=r?function(e){return e-t}:function(e){return n-e+t}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(e){var t=this.getRect(),i=this.getAxis();return"horizontal"===i.orient?i.contain(i.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},pointToData:function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},dataToPoint:function(e){var t=this.getAxis(),i=this.getRect(),n=[],r="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),n[r]=t.toGlobalCoord(t.dataToCoord(+e)),n[1-r]=0===r?i.y+i.height/2:i.x+i.width/2,n}};var RW=NW;Bf.register("single",{create:function(e,t){var i=[];return e.eachComponent("singleAxis",(function(n,r){var a=new RW(n,e,t);a.name="single_"+r,a.resize(n,t),n.coordinateSystem=a,i.push(a)})),e.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"singleAxis",index:t.get("singleAxisIndex"),id:t.get("singleAxisId")})[0];t.coordinateSystem=i&&i.coordinateSystem}})),i},dimensions:RW.prototype.dimensions});var OW={},kW=l;OW.layout=function(e,t){t=t||{};var i=e.coordinateSystem,n=e.axis,r={},a=n.position,o=n.orient,s=i.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};r.position=["vertical"===o?u.vertical[a]:l[0],"horizontal"===o?u.horizontal[a]:l[3]],r.rotation=Math.PI/2*{horizontal:0,vertical:1}[o],r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[a],e.get("axisTick.inside")&&(r.tickDirection=-r.tickDirection),kW.retrieve(t.labelInside,e.get("axisLabel.inside"))&&(r.labelDirection=-r.labelDirection);var h=t.rotate;return null==h&&(h=e.get("axisLabel.rotate")),r.labelRotation="top"===a?-h:h,r.z2=1,r};var zW=l,BW=pA,FW=yo,VW=OW,GW=DA,HW=PA,UW=HW.rectCoordAxisBuildSplitArea,WW=HW.rectCoordAxisHandleRemove,jW=["axisLine","axisTickLabel","axisName"],XW=["splitArea","splitLine"],ZW=GW.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(e,t,i,n){var r=this.group;r.removeAll();var a=this._axisGroup;this._axisGroup=new FW.Group;var o=VW.layout(e),s=new BW(e,o);zW.each(jW,s.add,s),r.add(this._axisGroup),r.add(s.getGroup()),zW.each(XW,(function(t){e.get(t+".show")&&this["_"+t](e)}),this),FW.groupTransition(a,this._axisGroup,e),ZW.superCall(this,"render",e,t,i,n)},remove:function(){WW(this)},_splitLine:function(e){var t=e.axis;if(!t.scale.isBlank()){var i=e.getModel("splitLine"),n=i.getModel("lineStyle"),r=n.get("width"),a=n.get("color");a=a instanceof Array?a:[a];for(var o=e.coordinateSystem.getRect(),s=t.isHorizontal(),l=[],u=0,h=t.getTicksCoords({tickModel:i}),c=[],d=[],f=0;f<h.length;++f){var p=t.toGlobalCoord(h[f].coord);s?(c[0]=p,c[1]=o.y,d[0]=p,d[1]=o.y+o.height):(c[0]=o.x,c[1]=p,d[0]=o.x+o.width,d[1]=p);var g=u++%a.length;l[g]=l[g]||[],l[g].push(new FW.Line({subPixelOptimize:!0,shape:{x1:c[0],y1:c[1],x2:d[0],y2:d[1]},style:{lineWidth:r},silent:!0}))}for(f=0;f<l.length;++f)this.group.add(FW.mergePath(l[f],{style:{stroke:a[f%a.length],lineDash:n.getLineDash(r),lineWidth:r},silent:!0}))}},_splitArea:function(e){UW(this,this._axisGroup,e,e)}}),qW=l,YW=fM,KW=Mb,QW=ud.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}});qW.merge(QW.prototype,KW),YW("single",QW,(function(e,t){return t.type||(t.data?"category":"value")}),{left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}});var JW=l,$W=qa;var ej=function(e,t){var i,n=[],r=e.seriesIndex;if(null==r||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=$W.queryDataIndex(a,e);if(null==o||o<0||JW.isArray(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)n=l.dataToPoint(a.getValues(JW.map(l.dimensions,(function(e){return a.mapDimension(e)})),o,!0))||[];else if(s){var u=s.getBoundingRect().clone();u.applyTransform(s.transform),n=[u.x+u.width/2,u.y+u.height/2]}return{point:n,el:s}},tj=l,ij=qa.makeInner,nj=gA,rj=ej,aj=tj.each,oj=tj.curry,sj=ij();function lj(e,t,i,n,r){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t))if(e.involveSeries){var o=function(e,t){var i=t.axis,n=i.dim,r=e,a=[],o=Number.MAX_VALUE,s=-1;return aj(t.seriesModels,(function(t,l){var u,h,c=t.getData().mapDimension(n,!0);if(t.getAxisTooltipData){var d=t.getAxisTooltipData(c,e,i);h=d.dataIndices,u=d.nestestValue}else{if(!(h=t.getData().indicesOfNearest(c[0],e,"category"===i.type?.5:null)).length)return;u=t.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var f=e-u,p=Math.abs(f);p<=o&&((p<o||f>=0&&s<0)&&(o=p,s=f,r=u,a.length=0),aj(h,(function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:a,snapToValue:r}}(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&null==r.seriesIndex&&tj.extend(r,s[0]),!n&&e.snap&&a.containData(l)&&null!=l&&(t=l),i.showPointer(e,t,s,r),i.showTooltip(e,o,l)}else i.showPointer(e,t)}function uj(e,t,i,n){e[t.key]={value:i,payloadBatch:n}}function hj(e,t,i,n){var r=i.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&r.length){var l=t.coordSys.model,u=nj.makeKey(l),h=e.map[u];h||(h=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:r.slice()})}}function cj(e){var t=e.axis.model,i={},n=i.axisDim=e.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=t.componentIndex,i.axisName=i[n+"AxisName"]=t.name,i.axisId=i[n+"AxisId"]=t.id,i}function dj(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var fj=function(e,t,i){var n=e.currTrigger,r=[e.x,e.y],a=e,o=e.dispatchAction||tj.bind(i.dispatchAction,i),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){dj(r)&&(r=rj({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=dj(r),u=a.axesInfo,h=s.axesInfo,c="leave"===n||dj(r),d={},f={},p={list:[],map:{}},g={showPointer:oj(uj,f),showTooltip:oj(hj,p)};aj(s.coordSysMap,(function(e,t){var i=l||e.containPoint(r);aj(s.coordSysAxesInfo[t],(function(e,t){var n=e.axis,a=function(e,t){for(var i=0;i<(e||[]).length;i++){var n=e[i];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}(u,e);if(!c&&i&&(!u||a)){var o=a&&a.value;null!=o||l||(o=n.pointToData(r)),null!=o&&lj(e,o,g,!1,d)}}))}));var m={};return aj(h,(function(e,t){var i=e.linkGroup;i&&!f[t]&&aj(i.axesInfo,(function(t,n){var r=f[n];if(t!==e&&r){var a=r.value;i.mapper&&(a=e.axis.scale.parse(i.mapper(a,cj(t),cj(e)))),m[e.key]=a}}))})),aj(m,(function(e,t){lj(h[t],e,g,!0,d)})),function(e,t,i){var n=i.axesInfo=[];aj(t,(function(t,i){var r=t.axisPointerModel.option,a=e[i];a?(!t.useHandle&&(r.status="show"),r.value=a.value,r.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(r.status="hide"),"show"===r.status&&n.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:r.value})}))}(f,h,d),function(e,t,i,n){if(dj(t)||!e.list.length)return void n({type:"hideTip"});var r=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:e.list})}(p,r,e,o),function(e,t,i){var n=i.getZr(),r="axisPointerLastHighlights",a=sj(n)[r]||{},o=sj(n)[r]={};aj(e,(function(e,t){var i=e.axisPointerModel.option;"show"===i.status&&aj(i.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];tj.each(a,(function(e,t){!o[t]&&l.push(e)})),tj.each(o,(function(e,t){!a[t]&&s.push(e)})),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}};n.extendComponentModel({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}}});var pj={},gj=l,mj=s,vj=(0,qa.makeInner)(),yj=gj.each;function _j(e,t,i){e.handler("leave",null,i)}function xj(e,t,i,n){t.handler(e,i,n)}pj.register=function(e,t,i){if(!mj.node){var n=t.getZr();vj(n).records||(vj(n).records={}),function(e,t){if(vj(e).initialized)return;function i(i,n){e.on(i,(function(i){var r=function(e){var t={showTip:[],hideTip:[]},i=function(n){var r=t[n.type];r?r.push(n):(n.dispatchAction=i,e.dispatchAction(n))};return{dispatchAction:i,pendings:t}}(t);yj(vj(e).records,(function(e){e&&n(e,i,r.dispatchAction)})),function(e,t){var i,n=e.showTip.length,r=e.hideTip.length;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]);i&&(i.dispatchAction=null,t.dispatchAction(i))}(r.pendings,t)}))}vj(e).initialized=!0,i("click",gj.curry(xj,"click")),i("mousemove",gj.curry(xj,"mousemove")),i("globalout",_j)}(n,t),(vj(n).records[e]||(vj(n).records[e]={})).handler=i}},pj.unregister=function(e,t){if(!mj.node){var i=t.getZr();(vj(i).records||{})[e]&&(vj(i).records[e]=null)}};var bj=pj,wj=n.extendComponentView({type:"axisPointer",render:function(e,t,i){var n=t.getComponent("tooltip"),r=e.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";bj.register("axisPointer",i,(function(e,t,i){"none"!==r&&("leave"===e||r.indexOf(e)>=0)&&i({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},remove:function(e,t){bj.unregister(t.getZr(),"axisPointer"),wj.superApply(this._model,"remove",arguments)},dispose:function(e,t){bj.unregister("axisPointer",t),wj.superApply(this._model,"dispose",arguments)}}),Tj=l,Sj=ro,Mj=yo,Aj=gA,Ij=Y,Cj=dm,Dj=(0,qa.makeInner)(),Ej=Tj.clone,Lj=Tj.bind;function Pj(){}function Nj(e,t,i,n){Rj(Dj(i).lastProp,n)||(Dj(i).lastProp=n,t?Mj.updateProps(i,n,e):(i.stopAnimation(),i.attr(n)))}function Rj(e,t){if(Tj.isObject(e)&&Tj.isObject(t)){var i=!0;return Tj.each(t,(function(t,n){i=i&&Rj(e[n],t)})),!!i}return e===t}function Oj(e,t){e[t.get("label.show")?"show":"hide"]()}function kj(e){return{position:e.position.slice(),rotation:e.rotation||0}}function zj(e,t,i){var n=t.get("z"),r=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=n&&(e.z=n),null!=r&&(e.zlevel=r),e.silent=i)}))}Pj.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(e,t,i,n){var r=t.get("value"),a=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,n||this._lastValue!==r||this._lastStatus!==a){this._lastValue=r,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||"hide"===a)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,r,e,t,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(e,t);if(o){var c=Tj.curry(Nj,t,h);this.updatePointerEl(o,l,c,t),this.updateLabelEl(o,l,c,t)}else o=this._group=new Mj.Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),i.getZr().add(o);zj(o,t,!0),this._renderHandle(r)}},remove:function(e){this.clear(e)},dispose:function(e){this.clear(e)},determineAnimation:function(e,t){var i=t.get("animation"),n=e.axis,r="category"===n.type,a=t.get("snap");if(!a&&!r)return!1;if("auto"===i||null==i){var o=this.animationThreshold;if(r&&n.getBandWidth()>o)return!0;if(a){var s=Aj.getAxisInfo(e).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===i},makeElOption:function(e,t,i,n,r){},createPointerEl:function(e,t,i,n){var r=t.pointer;if(r){var a=Dj(e).pointerEl=new Mj[r.type](Ej(t.pointer));e.add(a)}},createLabelEl:function(e,t,i,n){if(t.label){var r=Dj(e).labelEl=new Mj.Rect(Ej(t.label));e.add(r),Oj(r,n)}},updatePointerEl:function(e,t,i){var n=Dj(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},updateLabelEl:function(e,t,i,n){var r=Dj(e).labelEl;r&&(r.setStyle(t.label.style),i(r,{shape:t.label.shape,position:t.label.position}),Oj(r,n))},_renderHandle:function(e){if(!this._dragging&&this.updateHandleTransform){var t,i=this._axisPointerModel,n=this._api.getZr(),r=this._handle,a=i.getModel("handle"),o=i.get("status");if(!a.get("show")||!o||"hide"===o)return r&&n.remove(r),void(this._handle=null);this._handle||(t=!0,r=this._handle=Mj.createIcon(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){Ij.stop(e.event)},onmousedown:Lj(this._onHandleDragMove,this,0,0),drift:Lj(this._onHandleDragMove,this),ondragend:Lj(this._onHandleDragEnd,this)}),n.add(r)),zj(r,i,!1);r.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");Tj.isArray(s)||(s=[s,s]),r.attr("scale",[s[0]/2,s[1]/2]),Cj.createOrUpdate(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},_moveHandleToValue:function(e,t){Nj(this._axisPointerModel,!t&&this._moveAnimation,this._handle,kj(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(kj(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(kj(n)),Dj(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},_onHandleDragEnd:function(e){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,n=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}}},Pj.prototype.constructor=Pj,Sj.enableClassExtend(Pj);var Bj=Pj,Fj={},Vj=l,Gj=yo,Hj=fn,Uj=Ac,Wj=Re,jj=W_,Xj=pA;function Zj(e,t,i,n,r){var a=qj(i.get("value"),t.axis,t.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),o=i.getModel("label"),s=Uj.normalizeCssArray(o.get("padding")||0),l=o.getFont(),u=Hj.getBoundingRect(a,l),h=r.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=r.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=r.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),function(e,t,i,n){var r=n.getWidth(),a=n.getHeight();e[0]=Math.min(e[0]+t,r)-t,e[1]=Math.min(e[1]+i,a)-i,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(h,c,d,n);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get("axisLine.lineStyle.color")),e.label={shape:{x:0,y:0,width:c,height:d,r:o.get("borderRadius")},position:h.slice(),style:{text:a,textFont:l,textFill:o.getTextColor(),textPosition:"inside",textPadding:s,fill:g,stroke:o.get("borderColor")||"transparent",lineWidth:o.get("borderWidth")||0,shadowBlur:o.get("shadowBlur"),shadowColor:o.get("shadowColor"),shadowOffsetX:o.get("shadowOffsetX"),shadowOffsetY:o.get("shadowOffsetY")},z2:10}}function qj(e,t,i,n,r){e=t.scale.parse(e);var a=t.scale.getLabel(e,{precision:r.precision}),o=r.formatter;if(o){var s={value:jj.getAxisRawValue(t,e),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};Vj.each(n,(function(e){var t=i.getSeriesByIndex(e.seriesIndex),n=e.dataIndexInside,r=t&&t.getDataParams(n);r&&s.seriesData.push(r)})),Vj.isString(o)?a=o.replace("{value}",a):Vj.isFunction(o)&&(a=o(s))}return a}function Yj(e,t,i){var n=Wj.create();return Wj.rotate(n,n,i.rotation),Wj.translate(n,n,i.position),Gj.applyTransform([e.dataToCoord(t),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}Fj.buildElStyle=function(e){var t,i=e.get("type"),n=e.getModel(i+"Style");return"line"===i?(t=n.getLineStyle()).fill=null:"shadow"===i&&((t=n.getAreaStyle()).stroke=null),t},Fj.buildLabelElOption=Zj,Fj.getValueLabel=qj,Fj.getTransformedPosition=Yj,Fj.buildCartesianSingleLabelElOption=function(e,t,i,n,r,a){var o=Xj.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=r.get("label.margin"),Zj(t,n,r,a,{position:Yj(n.axis,e,i),align:o.textAlign,verticalAlign:o.textVerticalAlign})},Fj.makeLineShape=function(e,t,i){return{x1:e[i=i||0],y1:e[1-i],x2:t[i],y2:t[1-i]}},Fj.makeRectShape=function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}},Fj.makeSectorShape=function(e,t,i,n,r,a){return{cx:e,cy:t,r0:i,r:n,startAngle:r,endAngle:a,clockwise:!0}};var Kj=Fj,Qj=EA,Jj=DA,$j=Bj.extend({makeElOption:function(e,t,i,n,r){var a=i.axis,o=a.grid,s=n.get("type"),l=eX(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&"none"!==s){var h=Kj.buildElStyle(n),c=tX[s](a,u,l);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=Qj.layout(o.model,i);Kj.buildCartesianSingleLabelElOption(t,e,d,i,n,r)},getHandleTransform:function(e,t,i){var n=Qj.layout(t.axis.grid.model,t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:Kj.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var r=i.axis,a=r.grid,o=r.getGlobalExtent(!0),s=eX(a,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=e.position;u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{position:u,rotation:e.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function eX(e,t){var i={};return i[t.dim+"AxisIndex"]=t.index,e.getCartesian(i)}var tX={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:Kj.makeLineShape([t,i[0]],[t,i[1]],iX(e))}},shadow:function(e,t,i){var n=Math.max(1,e.getBandWidth()),r=i[1]-i[0];return{type:"Rect",shape:Kj.makeRectShape([t-n/2,i[0]],[n,r],iX(e))}}};function iX(e){return"x"===e.dim?0:1}Jj.registerAxisPointerClass("CartesianAxisPointer",$j);var nX=n,rX=l,aX=gA,oX=fj;nX.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!rX.isArray(t)&&(e.axisPointer.link=[t])}})),nX.registerProcessor(nX.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=aX.collect(e,t)})),nX.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},oX);var sX=Fj,lX=OW,uX=DA,hX=["x","y"],cX=["width","height"],dX=Bj.extend({makeElOption:function(e,t,i,n,r){var a=i.axis,o=a.coordinateSystem,s=gX(o,1-pX(a)),l=o.dataToPoint(t)[0],u=n.get("type");if(u&&"none"!==u){var h=sX.buildElStyle(n),c=fX[u](a,l,s);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=lX.layout(i);sX.buildCartesianSingleLabelElOption(t,e,d,i,n,r)},getHandleTransform:function(e,t,i){var n=lX.layout(t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:sX.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var r=i.axis,a=r.coordinateSystem,o=pX(r),s=gX(a,o),l=e.position;l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=gX(a,1-o),h=(u[1]+u[0])/2,c=[h,h];return c[o]=l[o],{position:l,rotation:e.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),fX={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:sX.makeLineShape([t,i[0]],[t,i[1]],pX(e))}},shadow:function(e,t,i){var n=e.getBandWidth(),r=i[1]-i[0];return{type:"Rect",shape:sX.makeRectShape([t-n/2,i[0]],[n,r],pX(e))}}};function pX(e){return e.isHorizontal()?0:1}function gX(e,t){var i=e.getRect();return[i[hX[t]],i[hX[t]]+i[cX[t]]]}uX.registerAxisPointerClass("SingleAxisPointer",dX),n.extendComponentView({type:"single"});var mX=Fg,vX=y_,yX=fy.getDimensionTypeByAxis,_X=Jy,xX=l,bX=qa.groupData,wX=Ac.encodeHTML,TX=ZI,SX=mX.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(e){SX.superApply(this,"init",arguments),this.legendVisualProvider=new TX(xX.bind(this.getData,this),xX.bind(this.getRawData,this))},fixData:function(e){var t=e.length,i={},n=bX(e,(function(e){return i.hasOwnProperty(e[0])||(i[e[0]]=-1),e[2]})),r=[];n.buckets.each((function(e,t){r.push({name:t,dataList:e})}));for(var a=r.length,o=0;o<a;++o){for(var s=r[o].name,l=0;l<r[o].dataList.length;++l){var u=r[o].dataList[l][0];i[u]=o}for(var u in i)i.hasOwnProperty(u)&&i[u]!==o&&(i[u]=o,e[t]=[],e[t][0]=u,e[t][1]=0,e[t][2]=s,t++)}return e},getInitialData:function(e,t){for(var i=t.queryComponents({mainType:"singleAxis",index:this.get("singleAxisIndex"),id:this.get("singleAxisId")})[0].get("type"),n=xX.filter(e.data,(function(e){return void 0!==e[2]})),r=this.fixData(n||[]),a=[],o=this.nameMap=xX.createHashMap(),s=0,l=0;l<r.length;++l)a.push(r[l][2]),o.get(r[l][2])||(o.set(r[l][2],s),s++);var u=vX(r,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:yX(i)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}),h=new _X(u,this);return h.initData(r),h},getLayerSeries:function(){for(var e=this.getData(),t=e.count(),i=[],n=0;n<t;++n)i[n]=n;var r=e.mapDimension("single"),a=bX(i,(function(t){return e.get("name",t)})),o=[];return a.buckets.each((function(t,i){t.sort((function(t,i){return e.get(r,t)-e.get(r,i)})),o.push({name:i,indices:t})})),o},getAxisTooltipData:function(e,t,i){xX.isArray(e)||(e=e?[e]:[]);for(var n,r=this.getData(),a=this.getLayerSeries(),o=[],s=a.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,h=-1,c=a[l].indices.length,d=0;d<c;++d){var f=r.get(e[0],a[l].indices[d]),p=Math.abs(f-t);p<=u&&(n=f,u=p,h=a[l].indices[d])}o.push(h)}return{dataIndices:o,nestestValue:n}},formatTooltip:function(e){var t=this.getData(),i=t.getName(e),n=t.get(t.mapDimension("value"),e);return(isNaN(n)||null==n)&&(n="-"),wX(i+" : "+n)},defaultOption:{zlevel:0,z:2,coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",color:"#000",fontSize:11},emphasis:{label:{show:!0}}}}),MX=n,AX=HT.Polygon,IX=yo,CX=l,DX=CX.bind,EX=CX.extend,LX=dy;MX.extendChartView({type:"themeRiver",init:function(){this._layers=[]},render:function(e,t,i){var n=e.getData(),r=this.group,a=e.getLayerSeries(),o=n.getLayout("layoutInfo"),s=o.rect,l=o.boundaryGap;function u(e){return e.name}r.attr("position",[0,s.y+l[0]]);var h=new LX(this._layersSeries||[],a,u,u),c={};function d(t,i,o){var s=this._layers;if("remove"!==t){for(var l,u,h,d=[],f=[],p=a[i].indices,g=0;g<p.length;g++){var m=n.getItemLayout(p[g]),v=m.x,y=m.y0,_=m.y;d.push([v,y]),f.push([v,y+_]),l=n.getItemVisual(p[g],"color")}var x=n.getItemLayout(p[0]),b=n.getItemModel(p[g-1]),w=b.getModel("label"),T=w.get("margin");if("add"===t){var S=c[i]=new IX.Group;u=new AX({shape:{points:d,stackedOnPoints:f,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),h=new IX.Text({style:{x:x.x-T,y:x.y0+x.y/2}}),S.add(u),S.add(h),r.add(S),u.setClipPath(function(e,t,i){var n=new IX.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return IX.initProps(n,{shape:{width:e.width+20,height:e.height+20}},t,i),n}(u.getBoundingRect(),e,(function(){u.removeClipPath()})))}else{S=s[o];u=S.childAt(0),h=S.childAt(1),r.add(S),c[i]=S,IX.updateProps(u,{shape:{points:d,stackedOnPoints:f}},e),IX.updateProps(h,{style:{x:x.x-T,y:x.y0+x.y/2}},e)}var M=b.getModel("emphasis.itemStyle"),A=b.getModel("itemStyle");IX.setTextStyle(h.style,w,{text:w.get("show")?e.getFormattedLabel(p[g-1],"normal")||n.getName(p[g-1]):null,textVerticalAlign:"middle"}),u.setStyle(EX({fill:l},A.getItemStyle(["color"]))),IX.setHoverStyle(u,M.getItemStyle())}else r.remove(s[i])}h.add(DX(d,this,"add")).update(DX(d,this,"update")).remove(DX(d,this,"remove")).execute(),this._layersSeries=a,this._layers=c},dispose:function(){}});var PX=l,NX=wc;function RX(e,t,i){if(e.count())for(var n,r=t.coordinateSystem,a=t.getLayerSeries(),o=e.mapDimension("single"),s=e.mapDimension("value"),l=PX.map(a,(function(t){return PX.map(t.indices,(function(t){var i=r.dataToPoint(e.get(o,t));return i[1]=e.get(s,t),i}))})),u=function(e){for(var t=e.length,i=e[0].length,n=[],r=[],a=0,o={},s=0;s<i;++s){for(var l=0,u=0;l<t;++l)u+=e[l][s][1];u>a&&(a=u),n.push(u)}for(var h=0;h<i;++h)r[h]=(a-n[h])/2;a=0;for(var c=0;c<i;++c){var d=n[c]+r[c];d>a&&(a=d)}return o.y0=r,o.max=a,o}(l),h=u.y0,c=i/u.max,d=a.length,f=a[0].indices.length,p=0;p<f;++p){n=h[p]*c,e.setItemLayout(a[0].indices[p],{layerIndex:0,x:l[0][p][0],y0:n,y:l[0][p][1]*c});for(var g=1;g<d;++g)n+=l[g-1][p][1]*c,e.setItemLayout(a[g].indices[p],{layerIndex:g,x:l[g][p][0],y0:n,y:l[g][p][1]*c})}}var OX=function(e,t){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.coordinateSystem,n={},r=i.getRect();n.rect=r;var a=e.get("boundaryGap"),o=i.getAxis();(n.boundaryGap=a,"horizontal"===o.orient)?(a[0]=NX.parsePercent(a[0],r.height),a[1]=NX.parsePercent(a[1],r.height),RX(t,e,r.height-a[0]-a[1])):(a[0]=NX.parsePercent(a[0],r.width),a[1]=NX.parsePercent(a[1],r.width),RX(t,e,r.width-a[0]-a[1]));t.setLayout("layoutInfo",n)}))},kX=l.createHashMap;var zX=n,BX=OX,FX=function(e){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.getRawData(),n=e.get("color"),r=kX();t.each((function(e){r.set(t.getRawIndex(e),e)})),i.each((function(a){var o=i.getName(a),s=n[(e.nameMap.get(o)-1)%n.length];i.setItemVisual(a,"color",s);var l=r.get(a);null!=l&&t.setItemVisual(l,"color",s)}))}))},VX=EC;zX.registerLayout(BX),zX.registerVisual(FX),zX.registerProcessor(VX("themeRiver"));var GX=l,HX=Fg,UX=MP,WX=mc,jX=mN.wrapTreePathInfo;function XX(e){var t=0;GX.each(e.children,(function(e){XX(e);var i=e.value;GX.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;GX.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),GX.isArray(e.value)?e.value[0]=i:e.value=i}HX.extend({type:"series.sunburst",_viewRoot:null,getInitialData:function(e,t){var i={name:e.name,children:e.data};XX(i);var n=GX.map(e.levels||[],(function(e){return new WX(e,this,t)}),this),r=UX.createTree(i,this,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=r.getNodeByDataIndex(t),a=n[i.depth];return a&&(e.parentModel=a),e}))}));return r.data},optionUpdated:function(){this.resetViewRoot()},getDataParams:function(e){var t=HX.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=jX(i,this),t},defaultOption:{zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,percentPrecision:2,stillShowZeroSum:!0,highlightPolicy:"descendant",nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},highlight:{itemStyle:{opacity:1}},downplay:{itemStyle:{opacity:.5},label:{opacity:.6}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicOut",data:[],levels:[],sort:"desc"},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)}});var ZX=l,qX=yo,YX="none",KX="ancestor",QX="self";function JX(e,t,i){qX.Group.call(this);var n=new qX.Sector({z2:2});n.seriesIndex=t.seriesIndex;var r=new qX.Text({z2:4,silent:e.getModel("label").get("silent")});function a(){r.ignore=r.hoverIgnore}function o(){r.ignore=r.normalIgnore}this.add(n),this.add(r),this.updateData(!0,e,"normal",t,i),this.on("emphasis",a).on("normal",o).on("mouseover",a).on("mouseout",o)}var $X=JX.prototype;$X.updateData=function(e,t,i,n,r){this.node=t,t.piece=this,n=n||this._seriesModel,r=r||this._ecModel;var a=this.childAt(0);a.dataIndex=t.dataIndex;var o=t.getModel(),s=t.getLayout(),l=ZX.extend({},s);l.label=null;var u=function(e,t,i){var n=e.getVisual("color"),r=e.getVisual("visualMeta");r&&0!==r.length||(n=null);var a=e.getModel("itemStyle").get("color");if(a)return a;if(n)return n;if(0===e.depth)return i.option.color[0];var o=i.option.color.length;a=i.option.color[function(e){var t=e;for(;t.depth>1;)t=t.parentNode;var i=e.getAncestors()[0];return ZX.indexOf(i.children,t)}(e)%o];return a}(t,0,r);!function(e,t,i){t.getData().setItemVisual(e.dataIndex,"color",i)}(t,n,u);var h,c=o.getModel("itemStyle").getItemStyle();if("normal"===i)h=c;else{var d=o.getModel(i+".itemStyle").getItemStyle();h=ZX.merge(d,c)}h=ZX.defaults({lineJoin:"bevel",fill:h.fill||u},h),e?(a.setShape(l),a.shape.r=s.r0,qX.updateProps(a,{shape:{r:s.r}},n,t.dataIndex),a.useStyle(h)):"object"==typeof h.fill&&h.fill.type||"object"==typeof a.style.fill&&a.style.fill.type?(qX.updateProps(a,{shape:l},n),a.useStyle(h)):qX.updateProps(a,{shape:l,style:h},n),this._updateLabel(n,u,i);var f=o.getShallow("cursor");if(f&&a.attr("cursor",f),e){var p=n.getShallow("highlightPolicy");this._initEvents(a,t,n,p)}this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel,qX.setHoverStyle(this)},$X.onEmphasis=function(e){var t=this;this.node.hostTree.root.eachNode((function(i){var n,r,a;i.piece&&(t.node===i?i.piece.updateData(!1,i,"emphasis"):(n=i,r=t.node,(a=e)!==YX&&(a===QX?n===r:a===KX?n===r||n.isAncestorOf(r):n===r||n.isDescendantOf(r))?i.piece.childAt(0).trigger("highlight"):e!==YX&&i.piece.childAt(0).trigger("downplay")))}))},$X.onNormal=function(){this.node.hostTree.root.eachNode((function(e){e.piece&&e.piece.updateData(!1,e,"normal")}))},$X.onHighlight=function(){this.updateData(!1,this.node,"highlight")},$X.onDownplay=function(){this.updateData(!1,this.node,"downplay")},$X._updateLabel=function(e,t,i){var n=this.node.getModel(),r=n.getModel("label"),a="normal"===i||"emphasis"===i?r:n.getModel(i+".label"),o=n.getModel("emphasis.label"),s=a.get("formatter")?i:"normal",l=ZX.retrieve(e.getFormattedLabel(this.node.dataIndex,s,null,null,"label"),this.node.name);!1===S("show")&&(l="");var u=this.node.getLayout(),h=a.get("minAngle");null==h&&(h=r.get("minAngle")),h=h/180*Math.PI;var c=u.endAngle-u.startAngle;null!=h&&Math.abs(c)<h&&(l="");var d=this.childAt(1);qX.setLabelStyle(d.style,d.hoverStyle||{},r,o,{defaultText:a.getShallow("show")?l:null,autoColor:t,useInsideStyle:!0});var f,p=(u.startAngle+u.endAngle)/2,g=Math.cos(p),m=Math.sin(p),v=S("position"),y=S("distance")||0,_=S("align");"outside"===v?(f=u.r+y,_=p>Math.PI/2?"right":"left"):_&&"center"!==_?"left"===_?(f=u.r0+y,p>Math.PI/2&&(_="right")):"right"===_&&(f=u.r-y,p>Math.PI/2&&(_="left")):(f=(u.r+u.r0)/2,_="center"),d.attr("style",{text:l,textAlign:_,textVerticalAlign:S("verticalAlign")||"middle",opacity:S("opacity")});var x=f*g+u.cx,b=f*m+u.cy;d.attr("position",[x,b]);var w=S("rotate"),T=0;function S(e){var t=a.get(e);return null==t?r.get(e):t}"radial"===w?(T=-p)<-Math.PI/2&&(T+=Math.PI):"tangential"===w?(T=Math.PI/2-p)>Math.PI/2?T-=Math.PI:T<-Math.PI/2&&(T+=Math.PI):"number"==typeof w&&(T=w*Math.PI/180),d.attr("rotation",T)},$X._initEvents=function(e,t,i,n){e.off("mouseover").off("mouseout").off("emphasis").off("normal");var r=this,a=function(){r.onEmphasis(n)},o=function(){r.onNormal()};i.isAnimationEnabled()&&e.on("mouseover",a).on("mouseout",o).on("emphasis",a).on("normal",o).on("downplay",(function(){r.onDownplay()})).on("highlight",(function(){r.onHighlight()}))},ZX.inherits(JX,qX.Group);var eZ=l,tZ=cm,iZ=JX,nZ=dy,rZ=Ac.windowOpen;tZ.extend({type:"sunburst",init:function(){},render:function(e,t,i,n){var r=this;this.seriesModel=e,this.api=i,this.ecModel=t;var a=e.getData(),o=a.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),h=[];s.eachNode((function(e){h.push(e)}));var c=this._oldChildren||[];if(function(i,n){if(0===i.length&&0===n.length)return;function r(e){return e.getId()}function s(r,s){!function(i,n){u||!i||i.getValue()||(i=null);if(i!==o&&n!==o)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",e,t),a.setItemGraphicEl(i.dataIndex,n.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(n);else if(i){var r=new iZ(i,e,t);l.add(r),a.setItemGraphicEl(i.dataIndex,r)}}(null==r?null:i[r],null==s?null:n[s])}new nZ(n,i,r,r).add(s).update(s).remove(eZ.curry(s,null)).execute()}(h,c),function(i,n){if(n.depth>0){r.virtualPiece?r.virtualPiece.updateData(!1,i,"normal",e,t):(r.virtualPiece=new iZ(i,e,t),l.add(r.virtualPiece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var a=function(e){r._rootToNode(n.parentNode)};n.piece._onclickEvent=a,r.virtualPiece.on("click",a)}else r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(o,s),n&&n.highlight&&n.highlight.piece){var d=e.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(d)}else if(n&&n.unhighlight){var f=this.virtualPiece;!f&&o.children.length&&(f=o.children[0].piece),f&&f.onNormal()}this._initEvents(),this._oldChildren=h},dispose:function(){},_initEvents:function(){var e=this,t=function(t){var i=!1;e.seriesModel.getViewRoot().eachNode((function(n){if(!i&&n.piece&&n.piece.childAt(0)===t.target){var r=n.getModel().get("nodeClick");if("rootToNode"===r)e._rootToNode(n);else if("link"===r){var a=n.getModel(),o=a.get("link");if(o){var s=a.get("target",!0)||"_blank";rZ(o,s)}}i=!0}}))};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",t),this.group._onclickEvent=t},_rootToNode:function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,r=e[1]-i.cy,a=Math.sqrt(n*n+r*r);return a<=i.r&&a>=i.r0}}});var aZ=n,oZ=mN;aZ.registerAction({type:"sunburstRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=oZ.retrieveTargetInfo(e,["sunburstRootToNode"],t);if(n){var r=t.getViewRoot();r&&(e.direction=oZ.aboveViewRoot(r,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));aZ.registerAction({type:"sunburstHighlight",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=oZ.retrieveTargetInfo(e,["sunburstHighlight"],t);n&&(e.highlight=n.node)}))}));aZ.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){e.unhighlight=!0}))}));var sZ=wc.parsePercent,lZ=l,uZ=Math.PI/180;function hZ(e,t){var i=e.children||[];e.children=function(e,t){if("function"==typeof t)return e.sort(t);var i="asc"===t;return e.sort((function(e,t){var n=(e.getValue()-t.getValue())*(i?1:-1);return 0===n?(e.dataIndex-t.dataIndex)*(i?-1:1):n}))}(i,t),i.length&&lZ.each(e.children,(function(e){hZ(e,t)}))}var cZ=n,dZ=l,fZ=gC,pZ=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),n=e.get("radius");lZ.isArray(n)||(n=[0,n]),lZ.isArray(t)||(t=[t,t]);var r=i.getWidth(),a=i.getHeight(),o=Math.min(r,a),s=sZ(t[0],r),l=sZ(t[1],a),u=sZ(n[0],o/2),h=sZ(n[1],o/2),c=-e.get("startAngle")*uZ,d=e.get("minAngle")*uZ,f=e.getData().tree.root,p=e.getViewRoot(),g=p.depth,m=e.get("sort");null!=m&&hZ(p,m);var v=0;lZ.each(p.children,(function(e){!isNaN(e.getValue())&&v++}));var y=p.getValue(),_=Math.PI/(y||v)*2,x=p.depth>0,b=p.height-(x?-1:1),w=(h-u)/(b||1),T=e.get("clockwise"),S=e.get("stillShowZeroSum"),M=T?1:-1,A=function(e,t){if(e){var i=t;if(e!==f){var n=e.getValue(),r=0===y&&S?_:n*_;r<d&&(r=d),i=t+M*r;var a=e.depth-g-(x?-1:1),h=u+w*a,c=u+w*(a+1),p=e.getModel();null!=p.get("r0")&&(h=sZ(p.get("r0"),o/2)),null!=p.get("r")&&(c=sZ(p.get("r"),o/2)),e.setLayout({angle:r,startAngle:t,endAngle:i,clockwise:T,cx:s,cy:l,r0:h,r:c})}if(e.children&&e.children.length){var m=0;lZ.each(e.children,(function(e){m+=A(e,t+m)}))}return i-t}};if(x){var I=u,C=u+w,D=2*Math.PI;f.setLayout({angle:D,startAngle:c,endAngle:c+D,clockwise:T,cx:s,cy:l,r0:I,r:C})}A(p,c)}))},gZ=EC;cZ.registerVisual(dZ.curry(fZ,"sunburst")),cZ.registerLayout(dZ.curry(pZ,"sunburst")),cZ.registerProcessor(dZ.curry(gZ,"sunburst"));var mZ=l;function vZ(e,t){return t=t||[0,0],mZ.map(["x","y"],(function(i,n){var r=this.getAxis(i),a=t[n],o=e[n]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(a-o)-r.dataToCoord(a+o))}),this)}var yZ=function(e){var t=e.grid.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:mZ.bind(vZ,e)}}},_Z=l;function xZ(e,t){return t=t||[0,0],_Z.map([0,1],(function(i){var n=t[i],r=e[i]/2,a=[],o=[];return a[i]=n-r,o[i]=n+r,a[1-i]=o[1-i]=t[1-i],Math.abs(this.dataToPoint(a)[i]-this.dataToPoint(o)[i])}),this)}var bZ=function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:_Z.bind(xZ,e)}}},wZ=l;function TZ(e,t){var i=this.getAxis(),n=t instanceof Array?t[0]:t,r=(e instanceof Array?e[0]:e)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-r)-i.dataToCoord(n+r))}var SZ=function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:wZ.bind(TZ,e)}}},MZ=l;function AZ(e,t){return MZ.map(["Radius","Angle"],(function(i,n){var r=this["get"+i+"Axis"](),a=t[n],o=e[n]/2,s="dataTo"+i,l="category"===r.type?r.getBandWidth():Math.abs(r[s](a-o)-r[s](a+o));return"Angle"===i&&(l=l*Math.PI/180),l}),this)}var IZ=function(e){var t=e.getRadiusAxis(),i=e.getAngleAxis(),n=t.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:MZ.bind((function(n){var r=t.dataToRadius(n[0]),a=i.dataToAngle(n[1]),o=e.coordToPoint([r,a]);return o.push(r,a*Math.PI/180),o})),size:MZ.bind(AZ,e)}}};var CZ=function(e){var t=e.getRect(),i=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(t,i){return e.dataToPoint(t,i)}}}},DZ=l,EZ=yo,LZ=lT.getDefaultLabel,PZ=U_,NZ=Tx.getLayoutOnAxis,RZ=dy,OZ=Fg,kZ=mc,zZ=cm,BZ=oS.createClipPath,FZ=yZ,VZ=bZ,GZ=SZ,HZ=IZ,UZ=CZ,WZ=EZ.CACHED_LABEL_STYLE_PROPERTIES,jZ=["itemStyle"],XZ=["emphasis","itemStyle"],ZZ=["label"],qZ=["emphasis","label"],YZ={cartesian2d:FZ,geo:VZ,singleAxis:GZ,polar:HZ,calendar:UZ};function KZ(e,t,i,n,r){null==i[e]||r||(t[e]=i[e],i[e]=n[e])}function QZ(e,t,i,n){var r=e.get("renderItem"),a=e.coordinateSystem,o={};a&&(o=a.prepareCustoms?a.prepareCustoms():YZ[a.type](a));var s,l,u,h,c,d=DZ.defaults({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(e,i){return null==i&&(i=s),t.get(t.getDimension(e||0),i)},style:function(i,n){null==n&&(n=s),g(n);var r=l.getModel(jZ).getItemStyle();null!=c&&(r.fill=c);var a=t.getItemVisual(n,"opacity");null!=a&&(r.opacity=a);var o=i?nq(i,u):u;return EZ.setTextStyle(r,o,null,{autoColor:c,isRectText:!0}),r.text=o.getShallow("show")?DZ.retrieve2(e.getFormattedLabel(n,"normal"),LZ(t,n)):null,i&&rq(r,i),r},styleEmphasis:function(i,n){null==n&&(n=s),g(n);var r=l.getModel(XZ).getItemStyle(),a=i?nq(i,h):h;return EZ.setTextStyle(r,a,null,{isRectText:!0},!0),r.text=a.getShallow("show")?DZ.retrieve3(e.getFormattedLabel(n,"emphasis"),e.getFormattedLabel(n,"normal"),LZ(t,n)):null,i&&rq(r,i),r},visual:function(e,i){return null==i&&(i=s),t.getItemVisual(i,e)},barLayout:function(e){if(a.getBaseAxis){var t=a.getBaseAxis();return NZ(DZ.defaults({axis:t},e),n)}},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(e){return EZ.getFont(e,i)}},o.api||{}),f={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:o.coordSys,dataInsideLength:t.count(),encode:JZ(e.getData())},p=!0;return function(e,i){return s=e,p=!0,r&&r(DZ.defaults({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:i?i.type:null},f),d)};function g(e){null==e&&(e=s),p&&(l=t.getItemModel(e),u=l.getModel(ZZ),h=l.getModel(qZ),c=t.getItemVisual(e,"color"),p=!1)}}function JZ(e){var t={};return DZ.each(e.dimensions,(function(i,n){var r=e.getDimensionInfo(i);if(!r.isExtraCoord){var a=r.coordDim;(t[a]=t[a]||[])[r.coordDimIndex]=n}})),t}function $Z(e,t,i,n,r,a){return(e=eq(e,t,i,n,r,a,!0))&&a.setItemGraphicEl(t,e),e}function eq(e,t,i,n,r,a,o){var s,l=!i,u=(i=i||{}).type,h=i.shape,c=i.style;if(e&&(l||null!=u&&u!==e.__customGraphicType||"path"===u&&((s=h)&&(s.hasOwnProperty("pathData")||s.hasOwnProperty("d")))&&oq(h)!==e.__customPathData||"image"===u&&sq(c,"image")&&c.image!==e.__customImagePath||"text"===u&&sq(h,"text")&&c.text!==e.__customText)&&(r.remove(e),e=null),!l){var d=!e;return!e&&(e=function(e){var t,i=e.type;if("path"===i){var n=e.shape,r=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,a=oq(n);(t=EZ.makePath(a,null,r,n.layout||"center")).__customPathData=a}else if("image"===i)(t=new EZ.Image({})).__customImagePath=e.style.image;else if("text"===i)(t=new EZ.Text({})).__customText=e.style.text;else if("group"===i)t=new EZ.Group;else{if("compoundPath"===i)throw new Error('"compoundPath" is not supported yet.');t=new(EZ.getShapeClass(i))}return t.__customGraphicType=i,t.name=e.name,t}(i)),function(e,t,i,n,r,a,o){var s={},l=i.style||{};if(i.shape&&(s.shape=DZ.clone(i.shape)),i.position&&(s.position=i.position.slice()),i.scale&&(s.scale=i.scale.slice()),i.origin&&(s.origin=i.origin.slice()),i.rotation&&(s.rotation=i.rotation),"image"===e.type&&i.style){var u=s.style={};DZ.each(["x","y","width","height"],(function(t){KZ(t,u,l,e.style,a)}))}"text"===e.type&&i.style&&(u=s.style={},DZ.each(["x","y"],(function(t){KZ(t,u,l,e.style,a)})),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke));if("group"!==e.type&&(e.useStyle(l),a)){e.style.opacity=0;var h=l.opacity;null==h&&(h=1),EZ.initProps(e,{style:{opacity:h}},n,t)}a?e.attr(s):EZ.updateProps(e,s,n,t),i.hasOwnProperty("z2")&&e.attr("z2",i.z2||0),i.hasOwnProperty("silent")&&e.attr("silent",i.silent),i.hasOwnProperty("invisible")&&e.attr("invisible",i.invisible),i.hasOwnProperty("ignore")&&e.attr("ignore",i.ignore),i.hasOwnProperty("info")&&e.attr("info",i.info);var c=i.styleEmphasis;EZ.setElementHoverStyle(e,c),o&&EZ.setAsHighDownDispatcher(e,!1!==c)}(e,t,i,n,0,d,o),"group"===u&&function(e,t,i,n,r){var a=i.children,o=a?a.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(!o&&!l&&!u)return;if(l)return h={oldChildren:e.children()||[],newChildren:a||[],dataIndex:t,animatableModel:n,group:e,data:r},void new RZ(h.oldChildren,h.newChildren,tq,tq,h).add(iq).update(iq).remove(aq).execute();var h;u&&e.removeAll();for(var c=0;c<o;c++)a[c]&&eq(e.childAt(c),t,a[c],n,e,r)}(e,t,i,n,a),r.add(e),e}}function tq(e,t){var i=e&&e.name;return null!=i?i:"e\0\0"+t}function iq(e,t){var i=this.context,n=null!=e?i.newChildren[e]:null;eq(null!=t?i.oldChildren[t]:null,i.dataIndex,n,i.animatableModel,i.group,i.data)}function nq(e,t){var i=new kZ({},t);return DZ.each(WZ,(function(t,n){e.hasOwnProperty(t)&&(i.option[n]=e[t])})),i}function rq(e,t){for(var i in t)!t.hasOwnProperty(i)&&WZ.hasOwnProperty(i)||(e[i]=t[i])}function aq(e){var t=this.context,i=t.oldChildren[e];i&&t.group.remove(i)}function oq(e){return e&&(e.pathData||e.d)}function sq(e,t){return e&&e.hasOwnProperty(t)}OZ.extend({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,useTransform:!0,clip:!1},getInitialData:function(e,t){return PZ(this.getSource(),this)},getDataParams:function(e,t,i){var n=OZ.prototype.getDataParams.apply(this,arguments);return i&&(n.info=i.info),n}}),zZ.extend({type:"custom",_data:null,render:function(e,t,i,n){var r=this._data,a=e.getData(),o=this.group,s=QZ(e,a,t,i);a.diff(r).add((function(t){$Z(null,t,s(t,n),e,o,a)})).update((function(t,i){$Z(r.getItemGraphicEl(i),t,s(t,n),e,o,a)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&o.remove(t)})).execute();var l=e.get("clip",!0)?BZ(e.coordinateSystem,!1,e):null;l?o.setClipPath(l):o.removeClipPath(),this._data=a},incrementalPrepareRender:function(e,t,i){this.group.removeAll(),this._data=null},incrementalRender:function(e,t,i,n,r){var a=t.getData(),o=QZ(t,a,i,n);function s(e){e.isGroup||(e.incremental=!0,e.useHoverLayer=!0)}for(var l=e.start;l<e.end;l++){$Z(null,l,o(l,r),t,this.group,a).traverse(s)}},dispose:DZ.noop,filterForExposedEvent:function(e,t,i,n){var r=t.element;if(null==r||i.name===r)return!0;for(;(i=i.parent)&&i!==this.group;)if(i.name===r)return!0;return!1}});var lq=l,uq=wc.parsePercent,hq=A_.isDimensionStacked;function cq(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function dq(e,t){return t.dim+e.model.componentIndex}var fq=function(e,t,i){var n={},r=function(e,t){var i={};lq.each(e,(function(e,t){var n=e.getData(),r=e.coordinateSystem,a=r.getBaseAxis(),o=dq(r,a),s=a.getExtent(),l="category"===a.type?a.getBandWidth():Math.abs(s[1]-s[0])/n.count(),u=i[o]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=u.stacks;i[o]=u;var c=cq(e);h[c]||u.autoWidthCount++,h[c]=h[c]||{width:0,maxWidth:0};var d=uq(e.get("barWidth"),l),f=uq(e.get("barMaxWidth"),l),p=e.get("barGap"),g=e.get("barCategoryGap");d&&!h[c].width&&(d=Math.min(u.remainedWidth,d),h[c].width=d,u.remainedWidth-=d),f&&(h[c].maxWidth=f),null!=p&&(u.gap=p),null!=g&&(u.categoryGap=g)}));var n={};return lq.each(i,(function(e,t){n[t]={};var i=e.stacks,r=e.bandWidth,a=uq(e.categoryGap,r),o=uq(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-a)/(l+(l-1)*o);u=Math.max(u,0),lq.each(i,(function(e,t){var i=e.maxWidth;i&&i<u&&(i=Math.min(i,s),e.width&&(i=Math.min(i,e.width)),s-=i,e.width=i,l--)})),u=(s-a)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;lq.each(i,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;lq.each(i,(function(e,i){n[t][i]=n[t][i]||{offset:d,width:e.width},d+=e.width*(1+o)}))})),n}(lq.filter(t.getSeriesByType(e),(function(e){return!t.isSeriesFiltered(e)&&e.coordinateSystem&&"polar"===e.coordinateSystem.type})));t.eachSeriesByType(e,(function(e){if("polar"===e.coordinateSystem.type){var t=e.getData(),i=e.coordinateSystem,a=i.getBaseAxis(),o=dq(i,a),s=cq(e),l=r[o][s],u=l.offset,h=l.width,c=i.getOtherAxis(a),d=e.coordinateSystem.cx,f=e.coordinateSystem.cy,p=e.get("barMinHeight")||0,g=e.get("barMinAngle")||0;n[s]=n[s]||[];for(var m=t.mapDimension(c.dim),v=t.mapDimension(a.dim),y=hq(t,m),_="radius"!==a.dim||!e.get("roundCap",!0),x="radius"===c.dim?c.dataToRadius(0):c.dataToAngle(0),b=0,w=t.count();b<w;b++){var T,S,M,A,I=t.get(m,b),C=t.get(v,b),D=I>=0?"p":"n",E=x;if(y&&(n[s][C]||(n[s][C]={p:x,n:x}),E=n[s][C][D]),"radius"===c.dim){var L=c.dataToRadius(I)-x,P=a.dataToAngle(C);Math.abs(L)<p&&(L=(L<0?-1:1)*p),T=E,S=E+L,A=(M=P-u)-h,y&&(n[s][C][D]=S)}else{var N=c.dataToAngle(I,_)-x,R=a.dataToRadius(C);Math.abs(N)<g&&(N=(N<0?-1:1)*g),S=(T=R+u)+h,M=E,A=E+N,y&&(n[s][C][D]=A)}t.setItemLayout(b,{cx:d,cy:f,r0:T,r:S,startAngle:-M*Math.PI/180,endAngle:-A*Math.PI/180})}}}),this)},pq=l,gq=Hw;function mq(e,t){gq.call(this,"radius",e,t),this.type="category"}mq.prototype={constructor:mq,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToRadius:gq.prototype.dataToCoord,radiusToData:gq.prototype.coordToData},pq.inherits(mq,gq);var vq=mq,yq=l,_q=fn,xq=Hw,bq=(0,qa.makeInner)();function wq(e,t){t=t||[0,360],xq.call(this,"angle",e,t),this.type="category"}wq.prototype={constructor:wq,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToAngle:xq.prototype.dataToCoord,angleToData:xq.prototype.coordToData,calculateCategoryInterval:function(){var e=this,t=e.getLabelModel(),i=e.scale,n=i.getExtent(),r=i.count();if(n[1]-n[0]<1)return 0;var a=n[0],o=e.dataToCoord(a+1)-e.dataToCoord(a),s=Math.abs(o),l=_q.getBoundingRect(a,t.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var h=Math.max(0,Math.floor(u)),c=bq(e.model),d=c.lastAutoInterval,f=c.lastTickCount;return null!=d&&null!=f&&Math.abs(d-h)<=1&&Math.abs(f-r)<=1&&d>h?h=d:(c.lastTickCount=r,c.lastAutoInterval=h),h}},yq.inherits(wq,xq);var Tq=vq,Sq=wq,Mq=function(e){this.name=e||"",this.cx=0,this.cy=0,this._radiusAxis=new Tq,this._angleAxis=new Sq,this._radiusAxis.polar=this._angleAxis.polar=this};Mq.prototype={type:"polar",axisPointerEnabled:!0,constructor:Mq,dimensions:["radius","angle"],model:null,containPoint:function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},containData:function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},getAxis:function(e){return this["_"+e+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(e){var t=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===e&&t.push(i),n.scale.type===e&&t.push(n),t},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},dataToPoint:function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},pointToData:function(e,t){var i=this.pointToCoord(e);return[this._radiusAxis.radiusToData(i[0],t),this._angleAxis.angleToData(i[1],t)]},pointToCoord:function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=this.getAngleAxis(),r=n.getExtent(),a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);n.inverse?a=o-360:o=a+360;var s=Math.sqrt(t*t+i*i);t/=s,i/=s;for(var l=Math.atan2(-i,t)/Math.PI*180,u=l<a?1:-1;l<a||l>o;)l+=360*u;return[s,l]},coordToPoint:function(e){var t=e[0],i=e[1]/180*Math.PI;return[Math.cos(i)*t+this.cx,-Math.sin(i)*t+this.cy]},getArea:function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var i=e.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:e.inverse,contain:function(e,t){var i=e-this.cx,n=t-this.cy,r=i*i+n*n,a=this.r,o=this.r0;return r<=a*a&&r>=o*o}}}};var Aq=Mq,Iq=l,Cq=fM,Dq=Mb,Eq=ud.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});Iq.merge(Eq.prototype,Dq);var Lq={splitNumber:5};function Pq(e,t){return t.type||(t.data?"category":"value")}Cq("angle",Eq,Pq,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),Cq("radius",Eq,Pq,Lq),n.extendComponentModel({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});var Nq=l,Rq=Aq,Oq=wc.parsePercent,kq=W_,zq=kq.createScaleByModel,Bq=kq.niceScaleExtent,Fq=Bf,Vq=A_.getStackedDimension;function Gq(e,t){var i=this,n=i.getAngleAxis(),r=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===i){var t=e.getData();Nq.each(t.mapDimension("radius",!0),(function(e){r.scale.unionExtentFromData(t,Vq(t,e))})),Nq.each(t.mapDimension("angle",!0),(function(e){n.scale.unionExtentFromData(t,Vq(t,e))}))}})),Bq(n.scale,n.model),Bq(r.scale,r.model),"category"===n.type&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function Hq(e,t){if(e.type=t.get("type"),e.scale=zq(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),"angleAxis"===t.mainType){e.inverse^=t.get("clockwise");var i=t.get("startAngle");e.setExtent(i,i+(e.inverse?-360:360))}t.axis=e,e.model=t}var Uq={dimensions:Rq.prototype.dimensions,create:function(e,t){var i=[];return e.eachComponent("polar",(function(e,n){var r=new Rq(n);r.update=Gq;var a=r.getRadiusAxis(),o=r.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");Hq(a,s),Hq(o,l),function(e,t,i){var n=t.get("center"),r=i.getWidth(),a=i.getHeight();e.cx=Oq(n[0],r),e.cy=Oq(n[1],a);var o=e.getRadiusAxis(),s=Math.min(r,a)/2,l=t.get("radius");null==l?l=[0,"100%"]:Nq.isArray(l)||(l=[0,l]),l=[Oq(l[0],s),Oq(l[1],s)],o.inverse?o.setExtent(l[1],l[0]):o.setExtent(l[0],l[1])}(r,e,t),i.push(r),e.coordinateSystem=r,r.model=e})),e.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}};Fq.register("polar",Uq);var Wq=l,jq=yo,Xq=mc,Zq=pA,qq=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Yq(e,t,i){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],i]),r=e.coordToPoint([t[1],i]);return{x1:n[0],y1:n[1],x2:r[0],y2:r[1]}}function Kq(e){return e.getRadiusAxis().inverse?0:1}function Qq(e){var t=e[0],i=e[e.length-1];t&&i&&Math.abs(Math.abs(t.coord-i.coord)-360)<1e-4&&e.pop()}DA.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,r=n.getRadiusAxis().getExtent(),a=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=Wq.map(i.getViewLabels(),(function(e){return(e=Wq.clone(e)).coord=i.dataToCoord(e.tickValue),e}));Qq(s),Qq(a),Wq.each(qq,(function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,a,o,r,s)}),this)}},_axisLine:function(e,t,i,n,r){var a,o=e.getModel("axisLine.lineStyle"),s=Kq(t),l=s?0:1;(a=0===r[l]?new jq.Circle({shape:{cx:t.cx,cy:t.cy,r:r[s]},style:o.getLineStyle(),z2:1,silent:!0}):new jq.Ring({shape:{cx:t.cx,cy:t.cy,r:r[s],r0:r[l]},style:o.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(a)},_axisTick:function(e,t,i,n,r){var a=e.getModel("axisTick"),o=(a.get("inside")?-1:1)*a.get("length"),s=r[Kq(t)],l=Wq.map(i,(function(e){return new jq.Line({shape:Yq(t,[s,s+o],e.coord)})}));this.group.add(jq.mergePath(l,{style:Wq.defaults(a.getModel("lineStyle").getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")})}))},_minorTick:function(e,t,i,n,r){if(n.length){for(var a=e.getModel("axisTick"),o=e.getModel("minorTick"),s=(a.get("inside")?-1:1)*o.get("length"),l=r[Kq(t)],u=[],h=0;h<n.length;h++)for(var c=0;c<n[h].length;c++)u.push(new jq.Line({shape:Yq(t,[l,l+s],n[h][c].coord)}));this.group.add(jq.mergePath(u,{style:Wq.defaults(o.getModel("lineStyle").getLineStyle(),Wq.defaults(a.getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")}))}))}},_axisLabel:function(e,t,i,n,r,a){var o=e.getCategories(!0),s=e.getModel("axisLabel"),l=s.get("margin"),u=e.get("triggerEvent");Wq.each(a,(function(i,n){var a=s,h=i.tickValue,c=r[Kq(t)],d=t.coordToPoint([c+l,i.coord]),f=t.cx,p=t.cy,g=Math.abs(d[0]-f)/c<.3?"center":d[0]>f?"left":"right",m=Math.abs(d[1]-p)/c<.3?"middle":d[1]>p?"top":"bottom";o&&o[h]&&o[h].textStyle&&(a=new Xq(o[h].textStyle,s,s.ecModel));var v=new jq.Text({silent:Zq.isLabelSilent(e)});this.group.add(v),jq.setTextStyle(v.style,a,{x:d[0],y:d[1],textFill:a.getTextColor()||e.get("axisLine.lineStyle.color"),text:i.formattedLabel,textAlign:g,textVerticalAlign:m}),u&&(v.eventData=Zq.makeAxisEventDataBase(e),v.eventData.targetType="axisLabel",v.eventData.value=i.rawLabel)}),this)},_splitLine:function(e,t,i,n,r){var a=e.getModel("splitLine").getModel("lineStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;u<i.length;u++){var h=s++%o.length;l[h]=l[h]||[],l[h].push(new jq.Line({shape:Yq(t,r,i[u].coord)}))}for(u=0;u<l.length;u++)this.group.add(jq.mergePath(l[u],{style:Wq.defaults({stroke:o[u%o.length]},a.getLineStyle()),silent:!0,z:e.get("z")}))},_minorSplitLine:function(e,t,i,n,r){if(n.length){for(var a=e.getModel("minorSplitLine").getModel("lineStyle"),o=[],s=0;s<n.length;s++)for(var l=0;l<n[s].length;l++)o.push(new jq.Line({shape:Yq(t,r,n[s][l].coord)}));this.group.add(jq.mergePath(o,{style:a.getLineStyle(),silent:!0,z:e.get("z")}))}},_splitArea:function(e,t,i,n,r){if(i.length){var a=e.getModel("splitArea").getModel("areaStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=Math.PI/180,h=-i[0].coord*u,c=Math.min(r[0],r[1]),d=Math.max(r[0],r[1]),f=e.get("clockwise"),p=1;p<i.length;p++){var g=s++%o.length;l[g]=l[g]||[],l[g].push(new jq.Sector({shape:{cx:t.cx,cy:t.cy,r0:c,r:d,startAngle:h,endAngle:-i[p].coord*u,clockwise:f},silent:!0})),h=-i[p].coord*u}for(p=0;p<l.length;p++)this.group.add(jq.mergePath(l[p],{style:Wq.defaults({fill:o[p%o.length]},a.getAreaStyle()),silent:!0}))}}});var Jq=l,$q=yo,eY=pA,tY=["axisLine","axisTickLabel","axisName"],iY=["splitLine","splitArea","minorSplitLine"];DA.extend({type:"radiusAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,r=n.getAngleAxis(),a=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=r.getExtent()[0],l=i.getExtent(),u=function(e,t,i){return{position:[e.cx,e.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:t.getModel("axisLabel").get("rotate"),z2:1}}(n,e,s),h=new eY(e,u);Jq.each(tY,h.add,h),this.group.add(h.getGroup()),Jq.each(iY,(function(t){e.get(t+".show")&&!i.scale.isBlank()&&this["_"+t](e,n,s,l,a,o)}),this)}},_splitLine:function(e,t,i,n,r){var a=e.getModel("splitLine").getModel("lineStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;u<r.length;u++){var h=s++%o.length;l[h]=l[h]||[],l[h].push(new $q.Circle({shape:{cx:t.cx,cy:t.cy,r:r[u].coord}}))}for(u=0;u<l.length;u++)this.group.add($q.mergePath(l[u],{style:Jq.defaults({stroke:o[u%o.length],fill:null},a.getLineStyle()),silent:!0}))},_minorSplitLine:function(e,t,i,n,r,a){if(a.length){for(var o=e.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<a.length;l++)for(var u=0;u<a[l].length;u++)s.push(new $q.Circle({shape:{cx:t.cx,cy:t.cy,r:a[l][u].coord}}));this.group.add($q.mergePath(s,{style:Jq.defaults({fill:null},o.getLineStyle()),silent:!0}))}},_splitArea:function(e,t,i,n,r){if(r.length){var a=e.getModel("splitArea").getModel("areaStyle"),o=a.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=r[0].coord,h=1;h<r.length;h++){var c=s++%o.length;l[c]=l[c]||[],l[c].push(new $q.Sector({shape:{cx:t.cx,cy:t.cy,r0:u,r:r[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),u=r[h].coord}for(h=0;h<l.length;h++)this.group.add($q.mergePath(l[h],{style:Jq.defaults({fill:o[h%o.length]},a.getAreaStyle()),silent:!0}))}}});var nY=Ac,rY=yo,aY=Fj,oY=Re,sY=pA,lY=DA,uY=Bj.extend({makeElOption:function(e,t,i,n,r){var a=i.axis;"angle"===a.dim&&(this.animationThreshold=Math.PI/18);var o,s=a.polar,l=s.getOtherAxis(a).getExtent();o=a["dataTo"+nY.capitalFirst(a.dim)](t);var u=n.get("type");if(u&&"none"!==u){var h=aY.buildElStyle(n),c=hY[u](a,s,o,l,h);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=function(e,t,i,n,r){var a=t.axis,o=a.dataToCoord(e),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===a.dim){var d=oY.create();oY.rotate(d,d,s),oY.translate(d,d,[n.cx,n.cy]),l=rY.applyTransform([o,-r],d);var f=t.getModel("axisLabel").get("rotate")||0,p=sY.innerTextLayout(s,f*Math.PI/180,-1);u=p.textAlign,h=p.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+r,o]);var m=n.cx,v=n.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(t,i,0,s,n.get("label.margin"));aY.buildLabelElOption(e,i,n,r,d)}});var hY={line:function(e,t,i,n,r){return"angle"===e.dim?{type:"Line",shape:aY.makeLineShape(t.coordToPoint([n[0],i]),t.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:i}}},shadow:function(e,t,i,n,r){var a=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:aY.makeSectorShape(t.cx,t.cy,n[0],n[1],(-i-a/2)*o,(a/2-i)*o)}:{type:"Sector",shape:aY.makeSectorShape(t.cx,t.cy,i-a/2,i+a/2,0,2*Math.PI)}}};lY.registerAxisPointerClass("PolarAxisPointer",uY);var cY=n,dY=l,fY=fq;cY.registerLayout(dY.curry(fY,"bar")),cY.extendComponentView({type:"polar"});var pY=l,gY=qa,mY=ud,vY=mc,yY=XI,_Y=QL,xY=mY.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(e){mY.prototype.init.apply(this,arguments),gY.defaultEmphasis(e,"label",["show"])},optionUpdated:function(){var e=this.option,t=this;e.regions=_Y.getFilledRegions(e.regions,e.map,e.nameMap),this._optionModelMap=pY.reduce(e.regions||[],(function(e,i){return i.name&&e.set(i.name,new vY(i,t)),e}),pY.createHashMap()),this.updateSelectedMap(e.regions)},defaultOption:{zlevel:0,z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},getRegionModel:function(e){return this._optionModelMap.get(e)||new vY(null,this,this.ecModel)},getFormattedLabel:function(e,t){t=t||"normal";var i=this.getRegionModel(e).get(("normal"===t?"":t+".")+"label.formatter"),n={name:e};return"function"==typeof i?(n.status=t,i(n)):"string"==typeof i?i.replace("{a}",null!=e?e:""):void 0},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e}});pY.mixin(xY,yY);var bY=gL;n.extendComponentView({type:"geo",init:function(e,t){var i=new bY(t,!0);this._mapDraw=i,this.group.add(i.group)},render:function(e,t,i,n){if(!n||"geoToggleSelect"!==n.type||n.from!==this.uid){var r=this._mapDraw;e.get("show")?r.draw(e,t,i,this,n):this._mapDraw.group.removeAll(),this.group.silent=e.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}});var wY=n,TY=l;function SY(e,t){t.update="updateView",wY.registerAction(t,(function(t,i){var n={};return i.eachComponent({mainType:"geo",query:t},(function(i){i[e](t.name);var r=i.coordinateSystem;TY.each(r.regions,(function(e){n[e.name]=i.isSelected(e.name)||!1}))})),{selected:n,name:t.name}}))}SY("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),SY("select",{type:"geoSelect",event:"geoselected"}),SY("unSelect",{type:"geoUnSelect",event:"geounselected"});var MY=l,AY=bc,IY=wc,CY=Bf;function DY(e,t,i){this._model=e}function EY(e,t,i,n){var r=i.calendarModel,a=i.seriesModel,o=r?r.coordinateSystem:a?a.coordinateSystem:null;return o===this?o[e](n):null}DY.prototype={constructor:DY,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(e){var t=(e=IY.parseDate(e)).getFullYear(),i=e.getMonth()+1;i=i<10?"0"+i:i;var n=e.getDate();n=n<10?"0"+n:n;var r=e.getDay();return{y:t,m:i,d:n,day:r=Math.abs((r+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+i+"-"+n,date:e}},getNextNDay:function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},update:function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var i=this._rangeInfo.weeks||1,n=["width","height"],r=this._model.get("cellSize").slice(),a=this._model.getBoxLayoutParams(),o="horizontal"===this._orient?[i,7]:[7,i];MY.each([0,1],(function(e){u(r,e)&&(a[n[e]]=r[e]*o[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=AY.getLayoutRect(a,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}MY.each([0,1],(function(e){u(r,e)||(r[e]=l[n[e]]/o[e])})),this._sw=r[0],this._sh=r[1]},dataToPoint:function(e,t){MY.isArray(e)&&(e=e[0]),null==t&&(t=!0);var i=this.getDateInfo(e),n=this._rangeInfo,r=i.formatedDate;if(t&&!(i.time>=n.start.time&&i.time<n.end.time+864e5))return[NaN,NaN];var a=i.day,o=this._getRangeInfo([n.start.time,r]).nthWeek;return"vertical"===this._orient?[this._rect.x+a*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]:[this._rect.x+o*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]},pointToData:function(e){var t=this.pointToDate(e);return t&&t.time},dataToRect:function(e,t){var i=this.dataToPoint(e,t);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},pointToDate:function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,i=Math.floor((e[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,t-1,n):this._getDateByWeeksAndDay(t,i-1,n)},convertToPixel:MY.curry(EY,"dataToPoint"),convertFromPixel:MY.curry(EY,"pointToData"),_initRangeOption:function(){var e=this._model.get("range"),t=e;if(MY.isArray(t)&&1===t.length&&(t=t[0]),/^\d{4}$/.test(t)&&(e=[t+"-01-01",t+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(t)){var i=this.getDateInfo(t),n=i.date;n.setMonth(n.getMonth()+1);var r=this.getNextNDay(n,-1);e=[i.formatedDate,r.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(t)&&(e=[t,t]);var a=this._getRangeInfo(e);return a.start.time>a.end.time&&e.reverse(),e},_getRangeInfo:function(e){var t;(e=[this.getDateInfo(e[0]),this.getDateInfo(e[1])])[0].time>e[1].time&&(t=!0,e.reverse());var i=Math.floor(e[1].time/864e5)-Math.floor(e[0].time/864e5)+1,n=new Date(e[0].time),r=n.getDate(),a=e[1].date.getDate();n.setDate(r+i-1);var o=n.getDate();if(o!==a)for(var s=n.getTime()-e[1].time>0?1:-1;(o=n.getDate())!==a&&(n.getTime()-e[1].time)*s>0;)i-=s,n.setDate(o-s);var l=Math.floor((i+e[0].day+6)/7),u=t?1-l:l-1;return t&&e.reverse(),{range:[e[0].formatedDate,e[1].formatedDate],start:e[0],end:e[1],allDay:i,weeks:l,nthWeek:u,fweek:e[0].day,lweek:e[1].day}},_getDateByWeeksAndDay:function(e,t,i){var n=this._getRangeInfo(i);if(e>n.weeks||0===e&&t<n.fweek||e===n.weeks&&t>n.lweek)return!1;var r=7*(e-1)-n.fweek+t,a=new Date(n.start.time);return a.setDate(n.start.d+r),this.getDateInfo(a)}},DY.dimensions=DY.prototype.dimensions,DY.getDimensionsInfo=DY.prototype.getDimensionsInfo,DY.create=function(e,t){var i=[];return e.eachComponent("calendar",(function(n){var r=new DY(n,e,t);i.push(r),n.coordinateSystem=r})),e.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},CY.register("calendar",DY);var LY=l,PY=ud,NY=bc,RY=NY.getLayoutParams,OY=NY.sizeCalculable,kY=NY.mergeLayoutParam,zY=PY.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(e,t,i,n){var r=RY(e);zY.superApply(this,"init",arguments),BY(e,r)},mergeOption:function(e,t){zY.superApply(this,"mergeOption",arguments),BY(this.option,e)}});function BY(e,t){var i=e.cellSize;LY.isArray(i)?1===i.length&&(i[1]=i[0]):i=e.cellSize=[i,i];var n=LY.map([0,1],(function(e){return OY(t,e)&&(i[e]="auto"),null!=i[e]&&"auto"!==i[e]}));kY(e,t,{type:"box",ignoreSize:n})}var FY=l,VY=yo,GY=Ac,HY=wc,UY={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},WY={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};n.extendComponentView({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(e,t,i){var n=this.group;n.removeAll();var r=e.coordinateSystem,a=r.getRangeInfo(),o=r.getOrient();this._renderDayRect(e,a,n),this._renderLines(e,a,o,n),this._renderYearText(e,a,o,n),this._renderMonthText(e,o,n),this._renderWeekText(e,a,o,n)},_renderDayRect:function(e,t,i){for(var n=e.coordinateSystem,r=e.getModel("itemStyle").getItemStyle(),a=n.getCellWidth(),o=n.getCellHeight(),s=t.start.time;s<=t.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new VY.Rect({shape:{x:l[0],y:l[1],width:a,height:o},cursor:"default",style:r});i.add(u)}},_renderLines:function(e,t,i,n){var r=this,a=e.coordinateSystem,o=e.getModel("splitLine.lineStyle").getLineStyle(),s=e.get("splitLine.show"),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=a.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=a.getDateInfo(c)}function d(t){r._firstDayOfMonth.push(a.getDateInfo(t)),r._firstDayPoints.push(a.dataToRect([t],!1).tl);var l=r._getLinePointsOfOneWeek(e,t,i);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,o,n)}d(a.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,i),o,n),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,i),o,n)},_getEdgesPoints:function(e,t,i){var n=[e[0].slice(),e[e.length-1].slice()],r="horizontal"===i?0:1;return n[0][r]=n[0][r]-t/2,n[1][r]=n[1][r]+t/2,n},_drawSplitline:function(e,t,i){var n=new VY.Polyline({z2:20,shape:{points:e},style:t});i.add(n)},_getLinePointsOfOneWeek:function(e,t,i){var n=e.coordinateSystem;t=n.getDateInfo(t);for(var r=[],a=0;a<7;a++){var o=n.getNextNDay(t.time,a),s=n.dataToRect([o.time],!1);r[2*o.day]=s.tl,r[2*o.day+1]=s["horizontal"===i?"bl":"tr"]}return r},_formatterLabel:function(e,t){return"string"==typeof e&&e?GY.formatTplSimple(e,t):"function"==typeof e?e(t):t.nameMap},_yearTextPositionControl:function(e,t,i,n,r){t=t.slice();var a=["center","bottom"];"bottom"===n?(t[1]+=r,a=["center","top"]):"left"===n?t[0]-=r:"right"===n?(t[0]+=r,a=["center","top"]):t[1]-=r;var o=0;return"left"!==n&&"right"!==n||(o=Math.PI/2),{rotation:o,position:t,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(e,t,i,n){var r=e.getModel("yearLabel");if(r.get("show")){var a=r.get("margin"),o=r.get("position");o||(o="horizontal"!==i?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=t.start.y;+t.end.y>+t.start.y&&(d=d+"-"+t.end.y);var f=r.get("formatter"),p={start:t.start.y,end:t.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new VY.Text({z2:30});VY.setTextStyle(m.style,r,{text:g}),m.attr(this._yearTextPositionControl(m,c[o],i,o,a)),n.add(m)}},_monthTextPositionControl:function(e,t,i,n,r){var a="left",o="top",s=e[0],l=e[1];return"horizontal"===i?(l+=r,t&&(a="center"),"start"===n&&(o="bottom")):(s+=r,t&&(o="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:o}},_renderMonthText:function(e,t,i){var n=e.getModel("monthLabel");if(n.get("show")){var r=n.get("nameMap"),a=n.get("margin"),o=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];FY.isString(r)&&(r=UY[r.toUpperCase()]||[]);var u="start"===o?0:1,h="horizontal"===t?0:1;a="start"===o?-a:a;for(var c="center"===s,d=0;d<l[u].length-1;d++){var f=l[u][d].slice(),p=this._firstDayOfMonth[d];if(c){var g=this._firstDayPoints[d];f[h]=(g[h]+l[0][d+1][h])/2}var m=n.get("formatter"),v=r[+p.m-1],y={yyyy:p.y,yy:(p.y+"").slice(2),MM:p.m,M:+p.m,nameMap:v},_=this._formatterLabel(m,y),x=new VY.Text({z2:30});FY.extend(VY.setTextStyle(x.style,n,{text:_}),this._monthTextPositionControl(f,c,t,o,a)),i.add(x)}}},_weekTextPositionControl:function(e,t,i,n,r){var a="center",o="middle",s=e[0],l=e[1],u="start"===i;return"horizontal"===t?(s=s+n+(u?1:-1)*r[0]/2,a=u?"right":"left"):(l=l+n+(u?1:-1)*r[1]/2,o=u?"bottom":"top"),{x:s,y:l,textAlign:a,textVerticalAlign:o}},_renderWeekText:function(e,t,i,n){var r=e.getModel("dayLabel");if(r.get("show")){var a=e.coordinateSystem,o=r.get("position"),s=r.get("nameMap"),l=r.get("margin"),u=a.getFirstDayOfWeek();FY.isString(s)&&(s=WY[s.toUpperCase()]||[]);var h=a.getNextNDay(t.end.time,7-t.lweek).time,c=[a.getCellWidth(),a.getCellHeight()];l=HY.parsePercent(l,c["horizontal"===i?0:1]),"start"===o&&(h=a.getNextNDay(t.start.time,-(7+t.fweek)).time,l=-l);for(var d=0;d<7;d++){var f,p=a.getNextNDay(h,d),g=a.dataToRect([p.time],!1).center;f=Math.abs((d+u)%7);var m=new VY.Text({z2:30});FY.extend(VY.setTextStyle(m.style,r,{text:s[f]}),this._weekTextPositionControl(g,i,o,l,c)),n.add(m)}}}});var jY=n,XY=l,ZY=qa,qY=yo,YY=bc,KY=wc.parsePercent,QY={path:null,compoundPath:null,group:qY.Group,image:qY.Image,text:qY.Text};jY.registerPreprocessor((function(e){var t=e.graphic;XY.isArray(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}));var JY=jY.extendComponentModel({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(e){var t=this.option.elements;this.option.elements=null,JY.superApply(this,"mergeOption",arguments),this.option.elements=t},optionUpdated:function(e,t){var i=this.option,n=(t?i:e).elements,r=i.elements=t?[]:i.elements,a=[];this._flatten(n,a);var o=ZY.mappingToExists(r,a);ZY.makeIdAndName(o);var s=this._elOptionsToUpdate=[];XY.each(o,(function(e,t){var i=e.option;i&&(s.push(i),function(e,t){var i=e.exist;if(t.id=e.keyInfo.id,!t.type&&i&&(t.type=i.type),null==t.parentId){var n=t.parentOption;n?t.parentId=n.id:i&&(t.parentId=i.parentId)}t.parentOption=null}(e,i),function(e,t,i){var n=XY.extend({},i),r=e[t],a=i.$action||"merge";"merge"===a?r?(XY.merge(r,n,!0),YY.mergeLayoutParam(r,n,{ignoreSize:!0}),YY.copyLayoutParams(i,r)):e[t]=n:"replace"===a?e[t]=n:"remove"===a&&r&&(e[t]=null)}(r,t,i),function(e,t){if(!e)return;e.hv=t.hv=[tK(t,["left","right"]),tK(t,["top","bottom"])],"group"===e.type&&(null==e.width&&(e.width=t.width=0),null==e.height&&(e.height=t.height=0))}(r[t],i))}),this);for(var l=r.length-1;l>=0;l--)null==r[l]?r.splice(l,1):delete r[l].$action},_flatten:function(e,t,i){XY.each(e,(function(e){if(e){i&&(e.parentOption=i),t.push(e);var n=e.children;"group"===e.type&&n&&this._flatten(n,t,e),delete e.children}}),this)},useElOptionsToUpdate:function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e}});function $Y(e,t,i,n){var r=i.type,a=new(QY.hasOwnProperty(r)?QY[r]:qY.getShapeClass(r))(i);t.add(a),n.set(e,a),a.__ecGraphicId=e}function eK(e,t){var i=e&&e.parent;i&&("group"===e.type&&e.traverse((function(e){eK(e,t)})),t.removeKey(e.__ecGraphicId),i.remove(e))}function tK(e,t){var i;return XY.each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(i=!0)})),i}jY.extendComponentView({type:"graphic",init:function(e,t){this._elMap=XY.createHashMap(),this._lastGraphicModel},render:function(e,t,i){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,i)},_updateElements:function(e){var t=e.useElOptionsToUpdate();if(t){var i=this._elMap,n=this.group;XY.each(t,(function(t){var r=t.$action,a=t.id,o=i.get(a),s=t.parentId,l=null!=s?i.get(s):n,u=t.style;"text"===t.type&&u&&(t.hv&&t.hv[1]&&(u.textVerticalAlign=u.textBaseline=null),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke));var h=function(e){return e=XY.extend({},e),XY.each(["id","parentId","$action","hv","bounding"].concat(YY.LOCATION_PARAMS),(function(t){delete e[t]})),e}(t);r&&"merge"!==r?"replace"===r?(eK(o,i),$Y(a,l,h,i)):"remove"===r&&eK(o,i):o?o.attr(h):$Y(a,l,h,i);var c=i.get(a);c&&(c.__ecGraphicWidthOption=t.width,c.__ecGraphicHeightOption=t.height,function(e,t,i){var n=e.eventData;e.silent||e.ignore||n||(n=e.eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name});n&&(n.info=e.info)}(c,e))}))}},_relocate:function(e,t){for(var i=e.option.elements,n=this.group,r=this._elMap,a=t.getWidth(),o=t.getHeight(),s=0;s<i.length;s++){var l=i[s];if((h=r.get(l.id))&&h.isGroup){var u=(c=h.parent)===n;h.__ecGraphicWidth=KY(h.__ecGraphicWidthOption,u?a:c.__ecGraphicWidth)||0,h.__ecGraphicHeight=KY(h.__ecGraphicHeightOption,u?o:c.__ecGraphicHeight)||0}}for(s=i.length-1;s>=0;s--){var h;l=i[s];if(h=r.get(l.id)){var c,d=(c=h.parent)===n?{width:a,height:o}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight};YY.positionElement(h,l,d,null,{hv:l.hv,boundingMode:l.bounding})}}},_clear:function(){var e=this._elMap;e.each((function(t){eK(t,e)})),this._elMap=XY.createHashMap()},dispose:function(){this._clear()}});var iK={},nK={};iK.register=function(e,t){nK[e]=t},iK.get=function(e){return nK[e]};var rK=l,aK=iK,oK=n.extendComponentModel({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){oK.superApply(this,"optionUpdated",arguments),rK.each(this.option.feature,(function(e,t){var i=aK.get(t);i&&rK.merge(e,i.defaultOption)}))},defaultOption:{show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1}}}),sK={},lK=bc,uK=lK.getLayoutRect,hK=lK.box,cK=lK.positionElement,dK=Ac,fK=yo;sK.layout=function(e,t,i){var n=t.getBoxLayoutParams(),r=t.get("padding"),a={width:i.getWidth(),height:i.getHeight()},o=uK(n,a,r);hK(t.get("orient"),e,t.get("itemGap"),o.width,o.height),cK(e,n,a,r)},sK.makeBackground=function(e,t){var i=dK.normalizeCssArray(t.get("padding")),n=t.getItemStyle(["color","opacity"]);return n.fill=t.get("backgroundColor"),e=new fK.Rect({shape:{x:e.x-i[3],y:e.y-i[0],width:e.width+i[1]+i[3],height:e.height+i[0]+i[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1})};var pK=l,gK=fn,mK=iK,vK=yo,yK=mc,_K=dy,xK=sK;n.extendComponentView({type:"toolbox",render:function(e,t,i,n){var r=this.group;if(r.removeAll(),e.get("show")){var a=+e.get("itemSize"),o=e.get("feature")||{},s=this._features||(this._features={}),l=[];pK.each(o,(function(e,t){l.push(t)})),new _K(this._featureNames||[],l).add(u).update(u).remove(pK.curry(u,null)).execute(),this._featureNames=l,xK.layout(r,e,i),r.add(xK.makeBackground(r.getBoundingRect(),e)),r.eachChild((function(e){var t=e.__title,n=e.hoverStyle;if(n&&t){var o=gK.getBoundingRect(t,gK.makeFont(n)),s=e.position[0]+r.position[0],l=!1;e.position[1]+r.position[1]+a+o.height>i.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:a+8;s+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):s-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}}))}function u(u,h){var c,d=l[u],f=l[h],p=o[d],g=new yK(p,e,e.ecModel);if(n&&null!=n.newTitle&&n.featureName===d&&(p.title=n.newTitle),d&&!f){if(function(e){return 0===e.indexOf("my")}(d))c={model:g,onclick:g.option.onclick,featureName:d};else{var m=mK.get(d);if(!m)return;c=new m(g,t,i)}s[d]=c}else{if(!(c=s[f]))return;c.model=g,c.ecModel=t,c.api=i}d||!f?g.get("show")&&!c.unusable?(!function(n,o,s){var l=n.getModel("iconStyle"),u=n.getModel("emphasis.iconStyle"),h=o.getIcons?o.getIcons():n.get("icon"),c=n.get("title")||{};if("string"==typeof h){var d=h,f=c;c={},(h={})[s]=d,c[s]=f}var p=n.iconPaths={};pK.each(h,(function(s,h){var d=vK.createIcon(s,{},{x:-a/2,y:-a/2,width:a,height:a});d.setStyle(l.getItemStyle()),d.hoverStyle=u.getItemStyle(),d.setStyle({text:c[h],textAlign:u.get("textAlign"),textBorderRadius:u.get("textBorderRadius"),textPadding:u.get("textPadding"),textFill:null});var f=e.getModel("tooltip");f&&f.get("show")&&d.attr("tooltip",pK.extend({content:c[h],formatter:f.get("formatter",!0)||function(){return c[h]},formatterParams:{componentType:"toolbox",name:h,title:c[h],$vars:["name","title"]},position:f.get("position",!0)||"bottom"},f.option)),vK.setHoverStyle(d),e.get("showTitle")&&(d.__title=c[h],d.on("mouseover",(function(){var t=u.getItemStyle(),i="vertical"===e.get("orient")?null==e.get("right")?"right":"left":null==e.get("bottom")?"bottom":"top";d.setStyle({textFill:u.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:u.get("textBackgroundColor"),textPosition:u.get("textPosition")||i})})).on("mouseout",(function(){d.setStyle({textFill:null,textBackgroundColor:null})}))),d.trigger(n.get("iconStatus."+h)||"normal"),r.add(d),d.on("click",pK.bind(o.onclick,o,t,i,h)),p[h]=d}))}(g,c,d),g.setIconStatus=function(e,t){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[e]=t,n[e]&&n[e].trigger(t)},c.render&&c.render(g,t,i,n)):c.remove&&c.remove(t,i):c.dispose&&c.dispose(t,i)}},updateView:function(e,t,i,n){pK.each(this._features,(function(e){e.updateView&&e.updateView(e.model,t,i,n)}))},remove:function(e,t){pK.each(this._features,(function(i){i.remove&&i.remove(e,t)})),this.group.removeAll()},dispose:function(e,t){pK.each(this._features,(function(i){i.dispose&&i.dispose(e,t)}))}});var bK=s,wK=iK,TK=_m.toolbox.saveAsImage;function SK(e){this.model=e}SK.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:TK.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:TK.lang.slice()},SK.prototype.unusable=!bK.canvasSupported,SK.prototype.onclick=function(e,t){var i=this.model,n=i.get("name")||e.get("title.0.text")||"echarts",r="svg"===t.getZr().painter.getType()?"svg":i.get("type",!0)||"png",a=t.getConnectedDataURL({type:r,backgroundColor:i.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||bK.browser.ie||bK.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(a.split(",")[1]),s=o.length,l=new Uint8Array(s);s--;)l[s]=o.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+r)}else{var h=i.get("lang"),c='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(h&&h[0]||"")+'" /></body>';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+r,d.target="_blank",d.href=a;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});d.dispatchEvent(f)}},wK.register("saveAsImage",SK);var MK=n,AK=l,IK=iK,CK=_m.toolbox.magicType;function DK(e){this.model=e}DK.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:AK.clone(CK.title),option:{},seriesIndex:{}};var EK=DK.prototype;EK.getIcons=function(){var e=this.model,t=e.get("icon"),i={};return AK.each(e.get("type"),(function(e){t[e]&&(i[e]=t[e])})),i};var LK={line:function(e,t,i,n){if("bar"===e)return AK.merge({id:t,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(e,t,i,n){if("line"===e)return AK.merge({id:t,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(e,t,i,n){var r="__ec_magicType_stack__"===i.get("stack");if("line"===e||"bar"===e)return n.setIconStatus("stack",r?"normal":"emphasis"),AK.merge({id:t,stack:r?"":"__ec_magicType_stack__"},n.get("option.stack")||{},!0)}},PK=[["line","bar"],["stack"]];EK.onclick=function(e,t,i){var n=this.model,r=n.get("seriesIndex."+i);if(LK[i]){var a,o={series:[]};if(AK.each(PK,(function(e){AK.indexOf(e,i)>=0&&AK.each(e,(function(e){n.setIconStatus(e,"normal")}))})),n.setIconStatus(i,"emphasis"),e.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(t){var r=t.subType,a=t.id,s=LK[i](r,a,t,n);s&&(AK.defaults(s,t.option),o.series.push(s));var l=t.coordinateSystem;if(l&&"cartesian2d"===l.type&&("line"===i||"bar"===i)){var u=l.getAxesByScale("ordinal")[0];if(u){var h=u.dim+"Axis",c=e.queryComponents({mainType:h,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;o[h]=o[h]||[];for(var d=0;d<=c;d++)o[h][c]=o[h][c]||{};o[h][c].boundaryGap="bar"===i}}})),"stack"===i)a=o.series&&o.series[0]&&"__ec_magicType_stack__"===o.series[0].stack?AK.merge({stack:CK.title.tiled},CK.title):AK.clone(CK.title);t.dispatchAction({type:"changeMagicType",currentType:i,newOption:o,newTitle:a,featureName:"magicType"})}},MK.registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),IK.register("magicType",DK);var NK=n,RK=l,OK=Y,kK=iK,zK=_m.toolbox.dataView,BK=new Array(60).join("-");function FK(e){return RK.map(e,(function(e){var t=e.getRawData(),i=[e.name],n=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,r=arguments[e-1],a=t.getName(r),o=0;o<e-1;o++)n[o]=arguments[o];i.push((a?a+"\t":"")+n.join("\t"))})),i.join("\n")})).join("\n\n"+BK+"\n\n")}function VK(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var GK=new RegExp("[\t]+","g");function HK(e,t){var i=e.split(new RegExp("\n*"+BK+"\n*","g")),n={series:[]};return RK.each(i,(function(e,i){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf("\t")>=0)return!0}(e)){var r=function(e){for(var t=e.split(/\n+/g),i=VK(t.shift()).split(GK),n=[],r=RK.map(i,(function(e){return{name:e,data:[]}})),a=0;a<t.length;a++){var o=VK(t[a]).split(GK);n.push(o.shift());for(var s=0;s<o.length;s++)r[s]&&(r[s].data[a]=o[s])}return{series:r,categories:n}}(e),a=t[i],o=a.axisDim+"Axis";a&&(n[o]=n[o]||[],n[o][a.axisIndex]={data:r.categories},n.series=n.series.concat(r.series))}else{r=function(e){for(var t=e.split(/\n+/g),i=VK(t.shift()),n=[],r=0;r<t.length;r++){var a=VK(t[r]);if(a){var o,s=a.split(GK),l="",u=!1;isNaN(s[0])?(u=!0,l=s[0],s=s.slice(1),n[r]={name:l,value:[]},o=n[r].value):o=n[r]=[];for(var h=0;h<s.length;h++)o.push(+s[h]);1===o.length&&(u?n[r].value=o[0]:n[r]=o[0])}}return{name:i,data:n}}(e);n.series.push(r)}})),n}function UK(e){this._dom=null,this.model=e}function WK(e,t){return RK.map(e,(function(e,i){var n=t&&t[i];if(RK.isObject(n)&&!RK.isArray(n)){RK.isObject(e)&&!RK.isArray(e)||(e={value:e});var r=null!=n.name&&null==e.name;return e=RK.defaults(e,n),r&&delete e.name,e}return e}))}UK.defaultOption={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:RK.clone(zK.title),lang:RK.clone(zK.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},UK.prototype.onclick=function(e,t){var i=t.getDom(),n=this.model;this._dom&&i.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",r.style.backgroundColor=n.get("backgroundColor")||"#fff";var a=document.createElement("h4"),o=n.get("lang")||[];a.innerHTML=o[0]||n.get("title"),a.style.cssText="margin: 10px 20px;",a.style.color=n.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="display:block;width:100%;overflow:auto;";var u=n.get("optionToContent"),h=n.get("contentToOption"),c=function(e){var t,i,n=function(e){var t={},i=[],n=[];return e.eachRawSeries((function(e){var r=e.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)i.push(e);else{var a=r.getBaseAxis();if("category"===a.type){var o=a.dim+"_"+a.index;t[o]||(t[o]={categoryAxis:a,valueAxis:r.getOtherAxis(a),series:[]},n.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else i.push(e)}})),{seriesGroupByCategoryAxis:t,other:i,meta:n}}(e);return{value:RK.filter([(t=n.seriesGroupByCategoryAxis,i=[],RK.each(t,(function(e,t){var n=e.categoryAxis,r=e.valueAxis.dim,a=[" "].concat(RK.map(e.series,(function(e){return e.name}))),o=[n.model.getCategories()];RK.each(e.series,(function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(r),(function(e){return e})))}));for(var s=[a.join("\t")],l=0;l<o[0].length;l++){for(var u=[],h=0;h<o.length;h++)u.push(o[h][l]);s.push(u.join("\t"))}i.push(s.join("\n"))})),i.join("\n\n"+BK+"\n\n")),FK(n.other)],(function(e){return e.replace(/[\n\t\s]/g,"")})).join("\n\n"+BK+"\n\n"),meta:n.meta}}(e);if("function"==typeof u){var d=u(t.getOption());"string"==typeof d?s.innerHTML=d:RK.isDom(d)&&s.appendChild(d)}else s.appendChild(l),l.readOnly=n.get("readOnly"),l.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",l.style.color=n.get("textColor"),l.style.borderColor=n.get("textareaBorderColor"),l.style.backgroundColor=n.get("textareaColor"),l.value=c.value;var f=c.meta,p=document.createElement("div");p.style.cssText="position:absolute;bottom:0;left:0;right:0;";var g="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",m=document.createElement("div"),v=document.createElement("div");g+=";background-color:"+n.get("buttonColor"),g+=";color:"+n.get("buttonTextColor");var y=this;function _(){i.removeChild(r),y._dom=null}OK.addEventListener(m,"click",_),OK.addEventListener(v,"click",(function(){var e;try{e="function"==typeof h?h(s,t.getOption()):HK(l.value,f)}catch(i){throw _(),new Error("Data view format error "+i)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),_()})),m.innerHTML=o[1],v.innerHTML=o[2],v.style.cssText=g,m.style.cssText=g,!n.get("readOnly")&&p.appendChild(v),p.appendChild(m),r.appendChild(a),r.appendChild(s),r.appendChild(p),s.style.height=i.clientHeight-80+"px",i.appendChild(r),this._dom=r},UK.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},UK.prototype.dispose=function(e,t){this.remove(e,t)},kK.register("dataView",UK),NK.registerAction({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var i=[];RK.each(e.newOption.series,(function(e){var n=t.getSeriesByName(e.name)[0];if(n){var r=n.get("data");i.push({name:e.name,data:WK(e.data,r)})}else i.push(RK.extend({type:"scatter"},e))})),t.mergeOption(RK.defaults({series:i},e.newOption))}));var jK=l,XK=yo,ZK=qa,qK=eV,YK=jK.each,KK=jK.indexOf,QK=jK.curry,JK=["dataToPoint","pointToData"],$K=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"];function eQ(e,t,i){var n=this._targetInfoList=[],r={},a=nQ(t,e);YK(rQ,(function(e,t){(!i||!i.include||KK(i.include,t)>=0)&&e(a,n,r)}))}var tQ=eQ.prototype;function iQ(e){return e[0]>e[1]&&e.reverse(),e}function nQ(e,t){return ZK.parseFinder(e,t,{includeMainTypes:$K})}tQ.setOutputRanges=function(e,t){this.matchOutputRanges(e,t,(function(e,t,i){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var n=sQ[e.brushType](0,i,t);e.__rangeOffset={offset:uQ[e.brushType](n.values,e.range,[1,1]),xyMinMax:n.xyMinMax}}}))},tQ.matchOutputRanges=function(e,t,i){YK(e,(function(e){var n=this.findTargetInfo(e,t);n&&!0!==n&&jK.each(n.coordSyses,(function(n){var r=sQ[e.brushType](1,n,e.range);i(e,r.values,n,t)}))}),this)},tQ.setInputRanges=function(e,t){YK(e,(function(e){var i,n,r,a,o,s=this.findTargetInfo(e,t);if(e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=sQ[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?uQ[e.brushType](l.values,u.offset,(i=l.xyMinMax,n=u.xyMinMax,r=cQ(i),a=cQ(n),o=[r[0]/a[0],r[1]/a[1]],isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o)):l.values}}),this)},tQ.makePanelOpts=function(e,t){return jK.map(this._targetInfoList,(function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t&&t(i),clipPath:qK.makeRectPanelClipPath(n),isTargetByCursor:qK.makeRectIsTargetByCursor(n,e,i.coordSysModel),getLinearBrushOtherExtent:qK.makeLinearBrushOtherExtent(n)}}))},tQ.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return!0===n||n&&KK(n.coordSyses,t.coordinateSystem)>=0},tQ.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=nQ(t,e),r=0;r<i.length;r++){var a=i[r],o=e.panelId;if(o){if(a.panelId===o)return a}else for(r=0;r<aQ.length;r++)if(aQ[r](n,a))return a}return!0};var rQ={grid:function(e,t){var i=e.xAxisModels,n=e.yAxisModels,r=e.gridModels,a=jK.createHashMap(),o={},s={};(i||n||r)&&(YK(i,(function(e){var t=e.axis.grid.model;a.set(t.id,t),o[t.id]=!0})),YK(n,(function(e){var t=e.axis.grid.model;a.set(t.id,t),s[t.id]=!0})),YK(r,(function(e){a.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),a.each((function(e){var r=e.coordinateSystem,a=[];YK(r.getCartesians(),(function(e,t){(KK(i,e.getAxis("x").model)>=0||KK(n,e.getAxis("y").model)>=0)&&a.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:oQ.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){YK(e.geoModels,(function(e){var i=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:i,coordSyses:[i],getPanelRect:oQ.geo})}))}},aQ=[function(e,t){var i=e.xAxisModel,n=e.yAxisModel,r=e.gridModel;return!r&&i&&(r=i.axis.grid.model),!r&&n&&(r=n.axis.grid.model),r&&r===t.gridModel},function(e,t){var i=e.geoModel;return i&&i===t.geoModel}],oQ={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(XK.getTransform(e)),t}},sQ={lineX:QK(lQ,0),lineY:QK(lQ,1),rect:function(e,t,i){var n=t[JK[e]]([i[0][0],i[1][0]]),r=t[JK[e]]([i[0][1],i[1][1]]),a=[iQ([n[0],r[0]]),iQ([n[1],r[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:jK.map(i,(function(i){var r=t[JK[e]](i);return n[0][0]=Math.min(n[0][0],r[0]),n[1][0]=Math.min(n[1][0],r[1]),n[0][1]=Math.max(n[0][1],r[0]),n[1][1]=Math.max(n[1][1],r[1]),r})),xyMinMax:n}}};function lQ(e,t,i,n){var r=i.getAxis(["x","y"][e]),a=iQ(jK.map([0,1],(function(e){return t?r.coordToData(r.toLocalCoord(n[e])):r.toGlobalCoord(r.dataToCoord(n[e]))}))),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var uQ={lineX:QK(hQ,0),lineY:QK(hQ,1),rect:function(e,t,i){return[[e[0][0]-i[0]*t[0][0],e[0][1]-i[0]*t[0][1]],[e[1][0]-i[1]*t[1][0],e[1][1]-i[1]*t[1][1]]]},polygon:function(e,t,i){return jK.map(e,(function(e,n){return[e[0]-i[0]*t[n][0],e[1]-i[1]*t[n][1]]}))}};function hQ(e,t,i,n){return[t[0]-n[e]*i[0],t[1]-n[e]*i[1]]}function cQ(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var dQ=eQ,fQ={},pQ=l.each,gQ="\0_ec_hist_store";function mQ(e){var t=e[gQ];return t||(t=e[gQ]=[{}]),t}fQ.push=function(e,t){var i=mQ(e);pQ(t,(function(t,n){for(var r=i.length-1;r>=0;r--){if(i[r][n])break}if(r<0){var a=e.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(a){var o=a.getPercentRange();i[0][n]={dataZoomId:n,start:o[0],end:o[1]}}}})),i.push(t)},fQ.pop=function(e){var t=mQ(e),i=t[t.length-1];t.length>1&&t.pop();var n={};return pQ(i,(function(e,i){for(var r=t.length-1;r>=0;r--){if(e=t[r][i]){n[i]=e;break}}})),n},fQ.clear=function(e){e[gQ]=null},fQ.count=function(e){return mQ(e).length},ud.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var vQ={},yQ=l,_Q=Ac,xQ=["cartesian2d","polar","singleAxis"];function bQ(e,t){e=e.slice();var i=yQ.map(e,_Q.capitalFirst);t=(t||[]).slice();var n=yQ.map(t,_Q.capitalFirst);return function(r,a){yQ.each(e,(function(e,o){for(var s={name:e,capital:i[o]},l=0;l<t.length;l++)s[t[l]]=e+n[l];r.call(a,s)}))}}var wQ=bQ(["x","y","z","radius","angle","single"],["axisIndex","axis","index","id"]);vQ.isCoordSupported=function(e){return yQ.indexOf(xQ,e)>=0},vQ.createNameEach=bQ,vQ.eachAxisDim=wQ,vQ.createLinkedNodesFinder=function(e,t,i){return function(r){var a,o={nodes:[],records:{}};if(t((function(e){o.records[e.name]={}})),!r)return o;n(r,o);do{a=!1,e(s)}while(a);function s(e){!function(e,t){return yQ.indexOf(t.nodes,e)>=0}(e,o)&&function(e,n){var r=!1;return t((function(t){yQ.each(i(e,t)||[],(function(e){n.records[t.name][e]&&(r=!0)}))})),r}(e,o)&&(n(e,o),a=!0)}return o};function n(e,n){n.nodes.push(e),t((function(t){yQ.each(i(e,t)||[],(function(e){n.records[t.name][e]=!0}))}))}};var TQ=l,SQ=wc,MQ=vQ,AQ=LB,IQ=TQ.each,CQ=SQ.asc,DQ=function(e,t,i,n){this._dimName=e,this._axisIndex=t,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=n,this._dataZoomModel=i};function EQ(e,t){var i=e.getAxisModel(),n=e._percentWindow,r=e._valueWindow;if(n){var a=SQ.getPixelPrecision(r,[0,500]);a=Math.min(a,20);var o=t||0===n[0]&&100===n[1];i.setRange(o?null:+r[0].toFixed(a),o?null:+r[1].toFixed(a))}}DQ.prototype={constructor:DQ,hostedBy:function(e){return this._dataZoomModel===e},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var e=[],t=this.ecModel;return t.eachSeries((function(i){if(MQ.isCoordSupported(i.get("coordinateSystem"))){var n=this._dimName,r=t.queryComponents({mainType:n+"Axis",index:i.get(n+"AxisIndex"),id:i.get(n+"AxisId")})[0];this._axisIndex===(r&&r.componentIndex)&&e.push(i)}}),this),e},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var e,t,i,n=this._dimName,r=this.ecModel,a=this.getAxisModel();return"x"===n||"y"===n?(t="gridIndex",e="x"===n?"y":"x"):(t="polarIndex",e="angle"===n?"radius":"angle"),r.eachComponent(e+"Axis",(function(e){(e.get(t)||0)===(a.get(t)||0)&&(i=e)})),i},getMinMaxSpan:function(){return TQ.clone(this._minMaxSpan)},calculateDataWindow:function(e){var t,i=this._dataExtent,n=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),a=[0,100],o=[],s=[];IQ(["start","end"],(function(l,u){var h=e[l],c=e[l+"Value"];"percent"===r[u]?(null==h&&(h=a[u]),c=n.parse(SQ.linearMap(h,a,i))):(t=!0,c=null==c?i[u]:n.parse(c),h=SQ.linearMap(c,i,a)),s[u]=c,o[u]=h})),CQ(s),CQ(o);var l=this._minMaxSpan;function u(e,t,i,r,a){var o=a?"Span":"ValueSpan";AQ(0,e,i,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=SQ.linearMap(e[s],i,r,!0),a&&(t[s]=n.parse(t[s]))}return t?u(s,o,i,a,!1):u(o,s,a,i,!0),{valueWindow:s,percentWindow:o}},reset:function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=function(e,t,i){var n=[1/0,-1/0];IQ(i,(function(e){var i=e.getData();i&&IQ(i.mapDimension(t,!0),(function(e){var t=i.getApproximateExtent(e);t[0]<n[0]&&(n[0]=t[0]),t[1]>n[1]&&(n[1]=t[1])}))})),n[1]<n[0]&&(n=[NaN,NaN]);return function(e,t){var i=e.getAxisModel(),n=i.getMin(!0),r="category"===i.get("type"),a=r&&i.getCategories().length;null!=n&&"dataMin"!==n&&"function"!=typeof n?t[0]=n:r&&(t[0]=a>0?0:NaN);var o=i.getMax(!0);null!=o&&"dataMax"!==o&&"function"!=typeof o?t[1]=o:r&&(t[1]=a>0?a-1:NaN);i.get("scale",!0)||(t[0]>0&&(t[0]=0),t[1]<0&&(t[1]=0))}(e,n),n}(this,this._dimName,t),function(e){var t=e._minMaxSpan={},i=e._dataZoomModel,n=e._dataExtent;IQ(["min","max"],(function(r){var a=i.get(r+"Span"),o=i.get(r+"ValueSpan");null!=o&&(o=e.getAxisModel().axis.scale.parse(o)),null!=o?a=SQ.linearMap(n[0]+o,n,[0,100],!0):null!=a&&(o=SQ.linearMap(a,[0,100],n,!0)-n[0]),t[r+"Span"]=a,t[r+"ValueSpan"]=o}))}(this);var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,EQ(this)}},restore:function(e){e===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,EQ(this,!0))},filterData:function(e,t){if(e===this._dataZoomModel){var i=this._dimName,n=this.getTargetSeriesModels(),r=e.get("filterMode"),a=this._valueWindow;"none"!==r&&IQ(n,(function(e){var t=e.getData(),n=t.mapDimension(i,!0);n.length&&("weakFilter"===r?t.filterSelf((function(e){for(var i,r,o,s=0;s<n.length;s++){var l=t.get(n[s],e),u=!isNaN(l),h=l<a[0],c=l>a[1];if(u&&!h&&!c)return!0;u&&(o=!0),h&&(i=!0),c&&(r=!0)}return o&&i&&r})):IQ(n,(function(i){if("empty"===r)e.setData(t=t.map(i,(function(e){return function(e){return e>=a[0]&&e<=a[1]}(e)?e:NaN})));else{var n={};n[i]=a,t.selectRange(n)}})),IQ(n,(function(e){t.setApproximateExtent(a,e)})))}))}}};var LQ=n,PQ=l,NQ=s,RQ=qa,OQ=vQ,kQ=DQ,zQ=PQ.each,BQ=OQ.eachAxisDim,FQ=LQ.extendComponentModel({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(e,t,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=VQ(e);this.settledOption=n,this.mergeDefaultAndTheme(e,i),this.doInit(n)},mergeOption:function(e){var t=VQ(e);PQ.merge(this.option,e,!0),PQ.merge(this.settledOption,t,!0),this.doInit(t)},doInit:function(e){var t=this.option;NQ.canvasSupported||(t.realtime=!1),this._setDefaultThrottle(e),GQ(this,e);var i=this.settledOption;zQ([["start","startValue"],["end","endValue"]],(function(e,n){"value"===this._rangePropMode[n]&&(t[e[0]]=i[e[0]]=null)}),this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var e=this._axisProxies;this.eachTargetAxis((function(t,i,n,r){var a=this.dependentModels[t.axis][i],o=a.__dzAxisProxy||(a.__dzAxisProxy=new kQ(t.name,i,this,r));e[t.name+"_"+i]=o}),this)},_resetTarget:function(){var e=this.option,t=this._judgeAutoMode();BQ((function(t){var i=t.axisIndex;e[i]=RQ.normalizeToArray(e[i])}),this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,t=!1;BQ((function(i){null!=e[i.axisIndex]&&(t=!0)}),this);var i=e.orient;return null==i&&t?"orient":t?void 0:(null==i&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var e=!0,t=this.get("orient",!0),i=this.option,n=this.dependentModels;if(e){var r="vertical"===t?"y":"x";n[r+"Axis"].length?(i[r+"AxisIndex"]=[0],e=!1):zQ(n.singleAxis,(function(n){e&&n.get("orient",!0)===t&&(i.singleAxisIndex=[n.componentIndex],e=!1)}))}e&&BQ((function(t){if(e){var n=[],r=this.dependentModels[t.axis];if(r.length&&!n.length)for(var a=0,o=r.length;a<o;a++)"category"===r[a].get("type")&&n.push(a);i[t.axisIndex]=n,n.length&&(e=!1)}}),this),e&&this.ecModel.eachSeries((function(e){this._isSeriesHasAllAxesTypeOf(e,"value")&&BQ((function(t){var n=i[t.axisIndex],r=e.get(t.axisIndex),a=e.get(t.axisId);r=e.ecModel.queryComponents({mainType:t.axis,index:r,id:a})[0].componentIndex,PQ.indexOf(n,r)<0&&n.push(r)}))}),this)},_autoSetOrient:function(){var e;this.eachTargetAxis((function(t){!e&&(e=t.name)}),this),this.option.orient="y"===e?"vertical":"horizontal"},_isSeriesHasAllAxesTypeOf:function(e,t){var i=!0;return BQ((function(n){var r=e.get(n.axisIndex),a=this.dependentModels[n.axis][r];a&&a.get("type")===t||(i=!1)}),this),i},_setDefaultThrottle:function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},getFirstTargetAxisModel:function(){var e;return BQ((function(t){if(null==e){var i=this.get(t.axisIndex);i.length&&(e=this.dependentModels[t.axis][i[0]])}}),this),e},eachTargetAxis:function(e,t){var i=this.ecModel;BQ((function(n){zQ(this.get(n.axisIndex),(function(r){e.call(t,n,r,this,i)}),this)}),this)},getAxisProxy:function(e,t){return this._axisProxies[e+"_"+t]},getAxisModel:function(e,t){var i=this.getAxisProxy(e,t);return i&&i.getAxisModel()},setRawRange:function(e){var t=this.option,i=this.settledOption;zQ([["start","startValue"],["end","endValue"]],(function(n){null==e[n[0]]&&null==e[n[1]]||(t[n[0]]=i[n[0]]=e[n[0]],t[n[1]]=i[n[1]]=e[n[1]])}),this),GQ(this,e)},setCalculatedRange:function(e){var t=this.option;zQ(["start","startValue","end","endValue"],(function(i){t[i]=e[i]}))},getPercentRange:function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},getValueRange:function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(e){if(e)return e.__dzAxisProxy;var t=this._axisProxies;for(var i in t)if(t.hasOwnProperty(i)&&t[i].hostedBy(this))return t[i];for(var i in t)if(t.hasOwnProperty(i)&&!t[i].hostedBy(this))return t[i]},getRangePropMode:function(){return this._rangePropMode.slice()}});function VQ(e){var t={};return zQ(["start","end","startValue","endValue","throttle"],(function(i){e.hasOwnProperty(i)&&(t[i]=e[i])})),t}function GQ(e,t){var i=e._rangePropMode,n=e.get("rangeMode");zQ([["start","startValue"],["end","endValue"]],(function(e,r){var a=null!=t[e[0]],o=null!=t[e[1]];a&&!o?i[r]="percent":!a&&o?i[r]="value":n?i[r]=n[r]:a&&(i[r]="percent")}))}var HQ=FQ,UQ=jg.extend({type:"dataZoom",render:function(e,t,i,n){this.dataZoomModel=e,this.ecModel=t,this.api=i},getTargetCoordInfo:function(){var e=this.dataZoomModel,t=this.ecModel,i={};return e.eachTargetAxis((function(e,n){var r=t.getComponent(e.axis,n);if(r){var a=r.getCoordSysModel();a&&function(e,t,i,n){for(var r,a=0;a<i.length;a++)if(i[a].model===e){r=i[a];break}r||i.push(r={model:e,axisModels:[],coordIndex:n});r.axisModels.push(t)}(a,r,i[a.mainType]||(i[a.mainType]=[]),a.componentIndex)}}),this),i}}),WQ=UQ;HQ.extend({type:"dataZoom.select"}),WQ.extend({type:"dataZoom.select"});var jQ=n,XQ=l,ZQ=XQ.createHashMap,qQ=XQ.each;jQ.registerProcessor({getTargetSeries:function(e){var t=ZQ();return e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){var r=n.getAxisProxy(e.name,i);qQ(r.getTargetSeriesModels(),(function(e){t.set(e.uid,e)}))}))})),t},modifyOutputEnd:!0,overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){n.getAxisProxy(e.name,i).reset(n,t)})),e.eachTargetAxis((function(e,i,n){n.getAxisProxy(e.name,i).filterData(n,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy(),i=t.getDataPercentWindow(),n=t.getDataValueWindow();e.setCalculatedRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]})}))}});var YQ=l,KQ=vQ;n.registerAction("dataZoom",(function(e,t){var i=KQ.createLinkedNodesFinder(YQ.bind(t.eachComponent,t,"dataZoom"),KQ.eachAxisDim,(function(e,t){return e.get(t.axisIndex)})),n=[];t.eachComponent({mainType:"dataZoom",query:e},(function(e,t){n.push.apply(n,i(e).nodes)})),YQ.each(n,(function(t,i){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}));var QQ=n,JQ=l,$Q=$F,eJ=dQ,tJ=fQ,iJ=LB,nJ=iK,rJ=_m.toolbox.dataZoom,aJ=JQ.each;function oJ(e,t,i){(this._brushController=new $Q(i.getZr())).on("brush",JQ.bind(this._onBrush,this)).mount(),this._isZoomActive}oJ.defaultOption={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:JQ.clone(rJ.title),brushStyle:{borderWidth:0,color:"rgba(0,0,0,0.2)"}};var sJ=oJ.prototype;sJ.render=function(e,t,i,n){this.model=e,this.ecModel=t,this.api=i,function(e,t,i,n,r){var a=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(a="dataZoomSelect"===n.key&&n.dataZoomSelectActive);i._isZoomActive=a,e.setIconStatus("zoom",a?"emphasis":"normal");var o=new eJ(uJ(e.option),t,{include:["grid"]});i._brushController.setPanels(o.makePanelOpts(r,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}))).enableBrush(!!a&&{brushType:"auto",brushStyle:e.getModel("brushStyle").getItemStyle()})}(e,t,this,n,i),function(e,t){e.setIconStatus("back",tJ.count(t)>1?"emphasis":"normal")}(e,t)},sJ.onclick=function(e,t,i){lJ[i].call(this)},sJ.remove=function(e,t){this._brushController.unmount()},sJ.dispose=function(e,t){this._brushController.dispose()};var lJ={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(tJ.pop(this.ecModel))}};function uJ(e){var t={};return JQ.each(["xAxisIndex","yAxisIndex"],(function(i){t[i]=e[i],null==t[i]&&(t[i]="all"),(!1===t[i]||"none"===t[i])&&(t[i]=[])})),t}sJ._onBrush=function(e,t){if(t.isEnd&&e.length){var i={},n=this.ecModel;this._brushController.updateCovers([]),new eJ(uJ(this.model.option),n,{include:["grid"]}).matchOutputRanges(e,n,(function(e,t,i){if("cartesian2d"===i.type){var n=e.brushType;"rect"===n?(r("x",i,t[0]),r("y",i,t[1])):r({lineX:"x",lineY:"y"}[n],i,t)}})),tJ.push(n,i),this._dispatchZoomAction(i)}function r(e,t,r){var a=t.getAxis(e),o=a.model,s=function(e,t,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},(function(i){i.getAxisModel(e,t.componentIndex)&&(n=i)})),n}(e,o,n),l=s.findRepresentativeAxisProxy(o).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=iJ(0,r.slice(),a.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},sJ._dispatchZoomAction=function(e){var t=[];aJ(e,(function(e,i){t.push(JQ.clone(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},nJ.register("dataZoom",oJ),QQ.registerPreprocessor((function(e){if(e){var t=e.dataZoom||(e.dataZoom=[]);JQ.isArray(t)||(e.dataZoom=t=[t]);var i=e.toolbox;if(i&&(JQ.isArray(i)&&(i=i[0]),i&&i.feature)){var n=i.feature.dataZoom;r("xAxis",n),r("yAxis",n)}}function r(i,n){if(n){var r=i+"Index",a=n[r];null==a||"all"===a||JQ.isArray(a)||(a=!1===a||"none"===a?[]:[a]),function(t,i){var n=e[t];JQ.isArray(n)||(n=n?[n]:[]);aJ(n,i)}(i,(function(e,o){if(null==a||"all"===a||-1!==JQ.indexOf(a,o)){var s={type:"select",$fromToolbox:!0,filterMode:n.filterMode||"filter",id:"\0_ec_\0toolbox-dataZoom_"+i+o};s[r]=o,t.push(s)}}))}}}));var hJ=n,cJ=fQ,dJ=iK,fJ=_m.toolbox.restore;function pJ(e){this.model=e}pJ.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:fJ.title},pJ.prototype.onclick=function(e,t,i){cJ.clear(e),t.dispatchAction({type:"restore",from:this.uid})},dJ.register("restore",pJ),hJ.registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")})),n.extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var gJ=l,mJ=$e,vJ=Y,yJ=K,_J=s,xJ=Ac,bJ=gJ.each,wJ=xJ.toCamelCase,TJ=["","-webkit-","-moz-","-o-"];function SJ(e){var t,i,n,r=[],a=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.getModel("textStyle"),l=e.get("padding");return a&&r.push((n="left "+(t=a)+"s "+(i="cubic-bezier(0.23, 1, 0.32, 1)")+",top "+t+"s "+i,gJ.map(TJ,(function(e){return e+"transition:"+n})).join(";"))),o&&(_J.canvasSupported?r.push("background-Color:"+o):(r.push("background-Color:#"+mJ.toHex(o)),r.push("filter:alpha(opacity=70)"))),bJ(["width","color","radius"],(function(t){var i="border-"+t,n=wJ(i),a=e.get(n);null!=a&&r.push(i+":"+a+("color"===t?"":"px"))})),r.push(function(e){var t=[],i=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var r=e.get("lineHeight");null==r&&(r=Math.round(3*i/2)),i&&t.push("line-height:"+r+"px");var a=e.get("textShadowColor"),o=e.get("textShadowBlur")||0,s=e.get("textShadowOffsetX")||0,l=e.get("textShadowOffsetY")||0;return o&&t.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),bJ(["decoration","align"],(function(i){var n=e.get(i);n&&t.push("text-"+i+":"+n)})),t.join(";")}(s)),null!=l&&r.push("padding:"+xJ.normalizeCssArray(l).join("px ")+"px"),r.join(";")+";"}function MJ(e,t,i,n,r){var a=t&&t.painter;if(i){var o=a&&a.getViewportRoot();o&&yJ.transformLocalCoord(e,o,document.body,n,r)}else{e[0]=n,e[1]=r;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}function AJ(e,t,i){if(_J.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=t.getZr(),a=this._appendToBody=i&&i.appendToBody;this._styleCoord=[0,0,0,0],MJ(this._styleCoord,r,a,t.getWidth()/2,t.getHeight()/2),a?document.body.appendChild(n):e.appendChild(n),this._container=e,this._show=!1,this._hideTimeout;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!o._enterable){var t=r.handler,i=r.painter.getViewportRoot();vJ.normalizeEvent(i,e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){o._enterable&&o._show&&o.hideLater(o._hideDelay),o._inContent=!1}}AJ.prototype={constructor:AJ,_enterable:!0,update:function(e){var t=this._container,i=t.currentStyle||document.defaultView.getComputedStyle(t),n=t.style;"absolute"!==n.position&&"absolute"!==i.position&&(n.position="relative"),e.get("alwaysShowContent")&&this._moveTooltipIfResized()},_moveTooltipIfResized:function(){var e=this._styleCoord[2],t=this._styleCoord[3],i=e*this._zr.getWidth(),n=t*this._zr.getHeight();this.moveTo(i,n)},show:function(e){clearTimeout(this._hideTimeout);var t=this.el,i=this._styleCoord;t.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+SJ(e)+";left:"+i[0]+"px;top:"+i[1]+"px;"+(e.get("extraCssText")||""),t.style.display=t.innerHTML?"block":"none",t.style.pointerEvents=this._enterable?"auto":"none",this._show=!0},setContent:function(e){this.el.innerHTML=null==e?"":e},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el;return[e.clientWidth,e.clientHeight]},moveTo:function(e,t){var i=this._styleCoord;MJ(i,this._zr,this._appendToBody,e,t);var n=this.el.style;n.left=i[0]+"px",n.top=i[1]+"px"},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(gJ.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},dispose:function(){this.el.parentNode.removeChild(this.el)},getOuterSize:function(){var e=this.el.clientWidth,t=this.el.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(this.el);i&&(e+=parseInt(i.borderLeftWidth,10)+parseInt(i.borderRightWidth,10),t+=parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10))}return{width:e,height:t}}};var IJ=AJ,CJ=l,DJ=Tl,EJ=yo;function LJ(e,t,i,n){e[0]=i,e[1]=n,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}function PJ(e){var t=this._zr=e.getZr();this._styleCoord=[0,0,0,0],LJ(this._styleCoord,t,e.getWidth()/2,e.getHeight()/2),this._show=!1,this._hideTimeout}PJ.prototype={constructor:PJ,_enterable:!0,update:function(e){e.get("alwaysShowContent")&&this._moveTooltipIfResized()},_moveTooltipIfResized:function(){var e=this._styleCoord[2],t=this._styleCoord[3],i=e*this._zr.getWidth(),n=t*this._zr.getHeight();this.moveTo(i,n)},show:function(e){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.attr("show",!0),this._show=!0},setContent:function(e,t,i){this.el&&this._zr.remove(this.el);for(var n={},r=e,a="{marker",o=r.indexOf(a);o>=0;){var s=r.indexOf("|}"),l=r.substr(o+a.length,s-o-a.length);l.indexOf("sub")>-1?n["marker"+l]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:t[l],textOffset:[3,0]}:n["marker"+l]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:t[l]},o=(r=r.substr(s+1)).indexOf("{marker")}var u=i.getModel("textStyle"),h=u.get("fontSize"),c=i.get("textLineHeight");null==c&&(c=Math.round(3*h/2)),this.el=new DJ({style:EJ.setTextStyle({},u,{rich:n,text:e,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding"),textLineHeight:c}),z:i.get("z")}),this._zr.add(this.el);var d=this;this.el.on("mouseover",(function(){d._enterable&&(clearTimeout(d._hideTimeout),d._show=!0),d._inContent=!0})),this.el.on("mouseout",(function(){d._enterable&&d._show&&d.hideLater(d._hideDelay),d._inContent=!1}))},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el.getBoundingRect();return[e.width,e.height]},moveTo:function(e,t){if(this.el){var i=this._styleCoord;LJ(i,this._zr,e,t),this.el.attr("position",[i[0],i[1]])}},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(CJ.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},dispose:function(){clearTimeout(this._hideTimeout),this.el&&this._zr.remove(this.el)},getOuterSize:function(){var e=this.getSize();return{width:e[0],height:e[1]}}};var NJ=n,RJ=l,OJ=s,kJ=IJ,zJ=PJ,BJ=Ac,FJ=wc,VJ=yo,GJ=ej,HJ=bc,UJ=mc,WJ=pj,jJ=W_,XJ=Fj,ZJ=qa.getTooltipRenderMode,qJ=RJ.bind,YJ=RJ.each,KJ=FJ.parsePercent,QJ=new VJ.Rect({shape:{x:-1,y:-1,width:2,height:2}});function JJ(e){for(var t=e.pop();e.length;){var i=e.pop();i&&(UJ.isInstance(i)&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),t=new UJ(i,t,t.ecModel))}return t}function $J(e,t){return e.dispatchAction||RJ.bind(t.dispatchAction,t)}function e$(e){return"center"===e||"middle"===e}NJ.extendComponentView({type:"tooltip",init:function(e,t){if(!OJ.node){var i,n=e.getComponent("tooltip"),r=n.get("renderMode");this._renderMode=ZJ(r),"html"===this._renderMode?(i=new kJ(t.getDom(),t,{appendToBody:n.get("appendToBody",!0)}),this._newLine="<br/>"):(i=new zJ(t),this._newLine="\n"),this._tooltipContent=i}},render:function(e,t,i){if(!OJ.node){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=e.get("alwaysShowContent");var n=this._tooltipContent;n.update(e),n.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var e=this._tooltipModel.get("triggerOn");WJ.register("itemTooltip",this._api,qJ((function(t,i,n){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(i,n):"leave"===t&&this._hide(n))}),this))},_keepShow:function(){var e=this._tooltipModel,t=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==e.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&n.manuallyShowTip(e,t,i,{x:n._lastX,y:n._lastY})}))}},manuallyShowTip:function(e,t,i,n){if(n.from!==this.uid&&!OJ.node){var r=$J(n,i);this._ticket="";var a=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var o=QJ;o.position=[n.x,n.y],o.update(),o.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:o},r)}else if(a)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},r);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(e,t,i,n))return;var s=GJ(n,t),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el},r)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},r))}},manuallyHideTip:function(e,t,i,n){var r=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide($J(n,i))},_manuallyAxisShowTip:function(e,t,i,n){var r=n.seriesIndex,a=n.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=a&&null!=o){var s=t.getSeriesByIndex(r);if(s)if("axis"===(e=JJ([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,e])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:a,position:n.position}),!0}},_tryShow:function(e,t){var i=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var n=e.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,e):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(e,i,t)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(e,i,t)):(this._lastDataByCoordSys=null,this._hide(t))}},_showOrMove:function(e,t){var i=e.get("showDelay");t=RJ.bind(t,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(t,i):t()},_showAxisTooltip:function(e,t){var i=this._ecModel,n=this._tooltipModel,r=[t.offsetX,t.offsetY],a=[],o=[],s=JJ([t.tooltipOption,n]),l=this._renderMode,u=this._newLine,h={};YJ(e,(function(e){YJ(e.dataByAxis,(function(e){var t=i.getComponent(e.axisDim+"Axis",e.axisIndex),n=e.value,r=[];if(t&&null!=n){var s=XJ.getValueLabel(n,t.axis,i,e.seriesDataIndices,e.valueLabelOpt);RJ.each(e.seriesDataIndices,(function(a){var u=i.getSeriesByIndex(a.seriesIndex),c=a.dataIndexInside,d=u&&u.getDataParams(c);if(d.axisDim=e.axisDim,d.axisIndex=e.axisIndex,d.axisType=e.axisType,d.axisId=e.axisId,d.axisValue=jJ.getAxisRawValue(t.axis,n),d.axisValueLabel=s,d){o.push(d);var f,p=u.formatTooltip(c,!0,null,l);if(RJ.isObject(p)){f=p.html;var g=p.markers;RJ.merge(h,g)}else f=p;r.push(f)}}));var c=s;"html"!==l?a.push(r.join(u)):a.push((c?BJ.encodeHTML(c)+u:"")+r.join(u))}}))}),this),a.reverse(),a=a.join(this._newLine+this._newLine);var c=t.position;this._showOrMove(s,(function(){this._updateContentNotChangedOnAxis(e)?this._updatePosition(s,c,r[0],r[1],this._tooltipContent,o):this._showTooltipContent(s,a,o,Math.random(),r[0],r[1],c,void 0,h)}))},_showSeriesItemTooltip:function(e,t,i){var n=this._ecModel,r=t.seriesIndex,a=n.getSeriesByIndex(r),o=t.dataModel||a,s=t.dataIndex,l=t.dataType,u=o.getData(l),h=JJ([u.getItemModel(s),o,a&&(a.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,f,p=o.getDataParams(s,l),g=o.formatTooltip(s,!1,l,this._renderMode);RJ.isObject(g)?(d=g.html,f=g.markers):(d=g,f=null);var m="item_"+o.name+"_"+s;this._showOrMove(h,(function(){this._showTooltipContent(h,d,p,m,e.offsetX,e.offsetY,e.position,e.target,f)})),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:r,from:this.uid})}},_showComponentItemTooltip:function(e,t,i){var n=t.tooltip;if("string"==typeof n){n={content:n,formatter:n}}var r=new UJ(n,this._tooltipModel,this._ecModel),a=r.get("content"),o=Math.random();this._showOrMove(r,(function(){this._showTooltipContent(r,a,r.get("formatterParams")||{},o,e.offsetX,e.offsetY,e.position,t)})),i({type:"showTip",from:this.uid})},_showTooltipContent:function(e,t,i,n,r,a,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent,h=e.get("formatter");o=o||e.get("position");var c=t;if(h&&"string"==typeof h)c=BJ.formatTpl(h,i,!0);else if("function"==typeof h){var d=qJ((function(t,n){t===this._ticket&&(u.setContent(n,l,e),this._updatePosition(e,o,r,a,u,i,s))}),this);this._ticket=n,c=h(i,n,d)}u.setContent(c,l,e),u.show(e),this._updatePosition(e,o,r,a,u,i,s)}},_updatePosition:function(e,t,i,n,r,a,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),h=e.get("align"),c=e.get("verticalAlign"),d=o&&o.getBoundingRect().clone();if(o&&d.applyTransform(o.transform),"function"==typeof t&&(t=t([i,n],a,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),RJ.isArray(t))i=KJ(t[0],s),n=KJ(t[1],l);else if(RJ.isObject(t)){t.width=u[0],t.height=u[1];var f=HJ.getLayoutRect(t,{width:s,height:l});i=f.x,n=f.y,h=null,c=null}else if("string"==typeof t&&o){var p=function(e,t,i){var n=i[0],r=i[1],a=5,o=0,s=0,l=t.width,u=t.height;switch(e){case"inside":o=t.x+l/2-n/2,s=t.y+u/2-r/2;break;case"top":o=t.x+l/2-n/2,s=t.y-r-a;break;case"bottom":o=t.x+l/2-n/2,s=t.y+u+a;break;case"left":o=t.x-n-a,s=t.y+u/2-r/2;break;case"right":o=t.x+l+a,s=t.y+u/2-r/2}return[o,s]}(t,d,u);i=p[0],n=p[1]}else{p=function(e,t,i,n,r,a,o){var s=i.getOuterSize(),l=s.width,u=s.height;null!=a&&(e+l+a>n?e-=l+a:e+=a);null!=o&&(t+u+o>r?t-=u+o:t+=o);return[e,t]}(i,n,r,s,l,h?null:20,c?null:20);i=p[0],n=p[1]}if(h&&(i-=e$(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=e$(c)?u[1]/2:"bottom"===c?u[1]:0),e.get("confine")){p=function(e,t,i,n,r){var a=i.getOuterSize(),o=a.width,s=a.height;return e=Math.min(e+o,n)-o,t=Math.min(t+s,r)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(i,n,r,s,l);i=p[0],n=p[1]}r.moveTo(i,n)},_updateContentNotChangedOnAxis:function(e){var t=this._lastDataByCoordSys,i=!!t&&t.length===e.length;return i&&YJ(t,(function(t,n){var r=t.dataByAxis||{},a=(e[n]||{}).dataByAxis||[];(i&=r.length===a.length)&&YJ(r,(function(e,t){var n=a[t]||{},r=e.seriesDataIndices||[],o=n.seriesDataIndices||[];(i&=e.value===n.value&&e.axisType===n.axisType&&e.axisId===n.axisId&&r.length===o.length)&&YJ(r,(function(e,t){var n=o[t];i&=e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}))}))})),this._lastDataByCoordSys=e,!!i},_hide:function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},dispose:function(e,t){OJ.node||(this._tooltipContent.dispose(),WJ.unregister("itemTooltip",t))}});var t$=n;t$.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),t$.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var i$=l,n$=["rect","polygon","keep","clear"];var r$=function(e,t){var i=e&&e.brush;if(i$.isArray(i)||(i=i?[i]:[]),i.length){var n=[];i$.each(i,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(n=n.concat(t))}));var r=e&&e.toolbox;i$.isArray(r)&&(r=r[0]),r||(r={feature:{}},e.toolbox=[r]);var a,o,s=r.feature||(r.feature={}),l=s.brush||(s.brush={}),u=l.type||(l.type=[]);u.push.apply(u,n),a=u,o={},i$.each(a,(function(e){o[e]=1})),a.length=0,i$.each(o,(function(e,t){a.push(t)})),t&&!u.length&&u.push.apply(u,n$)}},a$={},o$={},s$=l,l$=LR,u$=s$.each;function h$(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}o$.createVisualMappings=function(e,t,i){var n={};return u$(t,(function(t){var r,a=n[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);u$(e[t],(function(e,n){if(l$.isValidType(n)){var r={type:n,visual:e};i&&i(r,t),a[n]=new l$(r),"opacity"===n&&((r=s$.clone(r)).type="colorAlpha",a.__hidden.__alphaForOpacity=new l$(r))}}))})),n},o$.replaceVisualOption=function(e,t,i){var n;s$.each(i,(function(e){t.hasOwnProperty(e)&&h$(t[e])&&(n=!0)})),n&&s$.each(i,(function(i){t.hasOwnProperty(i)&&h$(t[i])?e[i]=s$.clone(t[i]):delete e[i]}))},o$.applyVisual=function(e,t,i,n,r,a){var o,s={};function l(e){return i.getItemVisual(o,e)}function u(e,t){i.setItemVisual(o,e,t)}function h(e,h){o=null==a?e:h;var c=i.getRawDataItem(o);if(!c||!1!==c.visualMap)for(var d=n.call(r,e),f=t[d],p=s[d],g=0,m=p.length;g<m;g++){var v=p[g];f[v]&&f[v].applyVisual(e,l,u)}}s$.each(e,(function(e){var i=l$.prepareVisualTypes(t[e]);s[e]=i})),null==a?i.each(h):i.each([a],h)},o$.incrementalApplyVisual=function(e,t,i,n){var r={};return s$.each(e,(function(e){var i=l$.prepareVisualTypes(t[e]);r[e]=i})),{progress:function(e,a){function o(e){return a.getItemVisual(l,e)}function s(e,t){a.setItemVisual(l,e,t)}var l;for(null!=n&&(n=a.getDimension(n));null!=(l=e.next());){var u=a.getRawDataItem(l);if(!u||!1!==u.visualMap)for(var h=null!=n?a.get(n,l,!0):l,c=i(h),d=t[c],f=r[c],p=0,g=f.length;p<g;p++){var m=f[p];d[m]&&d[m].applyVisual(h,o,s)}}}}};var c$=ew,d$=wi,f$=yo.linePolygonIntersect,p$={lineX:g$(0),lineY:g$(1),rect:{point:function(e,t,i){return e&&i.boundingRect.contain(e[0],e[1])},rect:function(e,t,i){return e&&i.boundingRect.intersect(e)}},polygon:{point:function(e,t,i){return e&&i.boundingRect.contain(e[0],e[1])&&c$.contain(i.range,e[0],e[1])},rect:function(e,t,i){var n=i.range;if(!e||n.length<=1)return!1;var r=e.x,a=e.y,o=e.width,s=e.height,l=n[0];return!!(c$.contain(n,r,a)||c$.contain(n,r+o,a)||c$.contain(n,r,a+s)||c$.contain(n,r+o,a+s)||d$.create(e).contain(l[0],l[1])||f$(r,a,r+o,a,n)||f$(r,a,r,a+s,n)||f$(r+o,a,r+o,a+s,n)||f$(r,a+s,r+o,a+s,n))||void 0}}};function g$(e){var t=["x","y"],i=["width","height"];return{point:function(t,i,n){if(t){var r=n.range;return m$(t[e],r)}},rect:function(n,r,a){if(n){var o=a.range,s=[n[t[e]],n[t[e]]+n[i[e]]];return s[1]<s[0]&&s.reverse(),m$(s[0],o)||m$(s[1],o)||m$(o[0],s)||m$(o[1],s)}}}}function m$(e,t){return t[0]<=e&&e<=t[1]}var v$=n,y$=l,_$=wi,x$=o$,b$=p$,w$=dm,T$=dQ,S$=["inBrush","outOfBrush"],M$="__ecInBrushSelectEvent",A$=v$.PRIORITY.VISUAL.BRUSH;function I$(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new T$(t.option,e)).setInputRanges(t.areas,e)}))}function C$(e,t){if(!e.isDisposed()){var i=e.getZr();i[M$]=!0,e.dispatchAction({type:"brushSelect",batch:t}),i[M$]=!1}}function D$(e,t,i,n){for(var r=0,a=t.length;r<a;r++){var o=t[r];if(e[o.brushType](n,i,o.selectors,o))return!0}}function E$(e){var t=e.brushSelector;if(y$.isString(t)){var i=[];return y$.each(b$,(function(e,n){i[n]=function(i,n,r,a){var o=n.getItemLayout(i);return e[t](o,r,a)}})),i}if(y$.isFunction(t)){var n={};return y$.each(b$,(function(e,i){n[i]=t})),n}return t}v$.registerLayout(A$,(function(e,t,i){e.eachComponent({mainType:"brush"},(function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1})})),I$(e)})),v$.registerVisual(A$,(function(e,t,i){var n,r,a=[];e.eachComponent({mainType:"brush"},(function(t,i){var o={brushId:t.id,brushIndex:i,brushName:t.name,areas:y$.clone(t.areas),selected:[]};a.push(o);var s=t.option,l=s.brushLink,u=[],h=[],c=[],d=0;i||(n=s.throttleType,r=s.throttleDelay);var f=y$.map(t.areas,(function(e){return function(e){var t=e.selectors={};return y$.each(b$[e.brushType],(function(i,n){t[n]=function(n){return i(n,t,e)}})),e}(y$.defaults({boundingRect:L$[e.brushType](e)},e))})),p=x$.createVisualMappings(t.option,S$,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||u[e]}function m(e){return!!e.length}y$.isArray(l)&&y$.each(l,(function(e){u[e]=1})),e.eachSeries((function(i,n){var r=c[n]=[];"parallel"===i.subType?function(e,t){var i=e.coordinateSystem;d|=i.hasAxisBrushed(),g(t)&&i.eachActiveState(e.getData(),(function(e,t){"active"===e&&(h[t]=1)}))}(i,n):function(i,n,r){var a=E$(i);if(!a||function(e,t){var i=e.option.seriesIndex;return null!=i&&"all"!==i&&(y$.isArray(i)?y$.indexOf(i,t)<0:t!==i)}(t,n))return;if(y$.each(f,(function(n){a[n.brushType]&&t.brushTargetManager.controlSeries(n,i,e)&&r.push(n),d|=m(r)})),g(n)&&m(r)){var o=i.getData();o.each((function(e){D$(a,r,o,e)&&(h[e]=1)}))}}(i,n,r)})),e.eachSeries((function(e,t){var i={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};o.selected.push(i);var n=E$(e),r=c[t],a=e.getData(),s=g(t)?function(e){return h[e]?(i.dataIndex.push(a.getRawIndex(e)),"inBrush"):"outOfBrush"}:function(e){return D$(n,r,a,e)?(i.dataIndex.push(a.getRawIndex(e)),"inBrush"):"outOfBrush"};(g(t)?d:m(r))&&x$.applyVisual(S$,p,a,s)}))})),function(e,t,i,n,r){if(!r)return;var a=e.getZr();if(a[M$])return;a.__ecBrushSelect||(a.__ecBrushSelect=C$);w$.createOrUpdate(a,"__ecBrushSelect",i,t)(e,n)}(t,n,r,a,i)}));var L$={lineX:y$.noop,lineY:y$.noop,rect:function(e){return P$(e.range)},polygon:function(e){for(var t,i=e.range,n=0,r=i.length;n<r;n++){t=t||[[1/0,-1/0],[1/0,-1/0]];var a=i[n];a[0]<t[0][0]&&(t[0][0]=a[0]),a[0]>t[0][1]&&(t[0][1]=a[0]),a[1]<t[1][0]&&(t[1][0]=a[1]),a[1]>t[1][1]&&(t[1][1]=a[1])}return t&&P$(t)}};function P$(e){return new _$(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}a$.layoutCovers=I$;var N$=l,R$=o$,O$=mc,k$=["#ddd"];function z$(e,t){return N$.merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new O$(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}n.extendComponentModel({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(e,t){var i=this.option;!t&&R$.replaceVisualOption(i,e,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:k$},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(e){e&&(this.areas=N$.map(e,(function(e){return z$(this.option,e)}),this))},setBrushOption:function(e){this.brushOption=z$(this.option,e),this.brushType=this.brushOption.brushType}});var B$=n,F$=l,V$=$F,G$=a$.layoutCovers;function H$(e,t,i,n){(!n||n.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())}B$.extendComponentView({type:"brush",init:function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new V$(t.getZr())).on("brush",F$.bind(this._onBrush,this)).mount()},render:function(e){return this.model=e,H$.apply(this,arguments)},updateTransform:function(e,t){return G$(t),H$.apply(this,arguments)},updateView:H$,dispose:function(){this._brushController.dispose()},_onBrush:function(e,t){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(e,this.ecModel),(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:F$.clone(e),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:F$.clone(e),$from:i})}});var U$=n;U$.registerAction({type:"brush",event:"brush"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),U$.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),U$.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var W$=l,j$=iK,X$=_m.toolbox.brush;function Z$(e,t,i){this.model=e,this.ecModel=t,this.api=i,this._brushType,this._brushMode}Z$.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:W$.clone(X$.title)};var q$=Z$.prototype;q$.render=q$.updateView=function(e,t,i){var n,r,a;t.eachComponent({mainType:"brush"},(function(e){n=e.brushType,r=e.brushOption.brushMode||"single",a|=e.areas.length})),this._brushType=n,this._brushMode=r,W$.each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===r:"clear"===t?a:t===n)?"emphasis":"normal")}))},q$.getIcons=function(){var e=this.model,t=e.get("icon",!0),i={};return W$.each(e.get("type",!0),(function(e){t[e]&&(i[e]=t[e])})),i},q$.onclick=function(e,t,i){var n=this._brushType,r=this._brushMode;"clear"===i?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===r?"single":"multiple":r}})},j$.register("brush",Z$),n.registerPreprocessor(r$);var Y$=l,K$=n,Q$=yo,J$=bc.getLayoutRect,$$=Ac.windowOpen;K$.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),K$.extendComponentView({type:"title",render:function(e,t,i){if(this.group.removeAll(),e.get("show")){var n=this.group,r=e.getModel("textStyle"),a=e.getModel("subtextStyle"),o=e.get("textAlign"),s=Y$.retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new Q$.Text({style:Q$.setTextStyle({},r,{text:e.get("text"),textFill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=e.get("subtext"),c=new Q$.Text({style:Q$.setTextStyle({},a,{text:h,textFill:a.getTextColor(),y:u.height+e.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),f=e.get("sublink"),p=e.get("triggerEvent",!0);l.silent=!d&&!p,c.silent=!f&&!p,d&&l.on("click",(function(){$$(d,"_"+e.get("target"))})),f&&c.on("click",(function(){$$(f,"_"+e.get("subtarget"))})),l.eventData=c.eventData=p?{componentType:"title",componentIndex:e.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=J$(m,{width:i.getWidth(),height:i.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?v.x+=v.width:"center"===o&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),n.attr("position",[v.x,v.y]);var y={textAlign:o,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var _=v.margin,x=e.getItemStyle(["color","opacity"]);x.fill=e.get("backgroundColor");var b=new Q$.Rect({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:e.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});n.add(b)}}});var e0=l;function t0(e){var t=e.itemStyle||(e.itemStyle={}),i=t.emphasis||(t.emphasis={}),n=e.label||e.label||{},r=n.normal||(n.normal={}),a={normal:1,emphasis:1};e0.each(n,(function(e,t){a[t]||i0(r,t)||(r[t]=e)})),i.label&&!i0(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function i0(e,t){return e.hasOwnProperty(t)}var n0=function(e){var t=e&&e.timeline;e0.isArray(t)||(t=t?[t]:[]),e0.each(t,(function(e){e&&function(e){var t=e.type,i={number:"value",time:"time"};i[t]&&(e.axisType=i[t],delete e.type);if(t0(e),i0(e,"controlPosition")){var n=e.controlStyle||(e.controlStyle={});i0(n,"position")||(n.position=e.controlPosition),"none"!==n.position||i0(n,"show")||(n.show=!1,delete n.position),delete e.controlPosition}e0.each(e.data||[],(function(e){e0.isObject(e)&&!e0.isArray(e)&&(!i0(e,"value")&&i0(e,"name")&&(e.value=e.name),t0(e))}))}(e)}))};ud.registerSubTypeDefaulter("timeline",(function(){return"slider"}));var r0=n,a0=l;r0.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t){var i=t.getComponent("timeline");return i&&null!=e.currentIndex&&(i.setCurrentIndex(e.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),t.resetOption("timeline"),a0.defaults({currentIndex:i.option.currentIndex},e)})),r0.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var i=t.getComponent("timeline");i&&null!=e.playState&&i.setPlayState(e.playState)}));var o0=l,s0=Jy,l0=qa,u0=ud.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(e,t,i){this._data,this._names,this.mergeDefaultAndTheme(e,i),this._initData()},mergeOption:function(e){u0.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(e){this.option.autoPlay=!!e},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var e=this.option,t=e.data||[],i=e.axisType,n=this._names=[];if("category"===i){var r=[];o0.each(t,(function(e,t){var i,a=l0.getDataItemValue(e);o0.isObject(e)?(i=o0.clone(e)).value=t:i=t,r.push(i),o0.isString(a)||null!=a&&!isNaN(a)||(a=""),n.push(a+"")})),t=r}var a={category:"ordinal",time:"time"}[i]||"number";(this._data=new s0([{name:"value",type:a}],this)).initData(t,n)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}}),h0=l,c0=ng,d0=u0.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}});h0.mixin(d0,c0);var f0=jg.extend({type:"timeline"}),p0=l,g0=Hw,m0=function(e,t,i,n){g0.call(this,e,t,i),this.type=n||"value",this.model=null};m0.prototype={constructor:m0,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},p0.inherits(m0,g0);var v0=l,y0=wi,_0=Re,x0=yo,b0=bc,w0=f0,T0=m0,S0=Ab.createSymbol,M0=W_,A0=wc,I0=Ac.encodeHTML,C0=v0.bind,D0=v0.each,E0=Math.PI;function L0(e,t,i,n,r,a){var o=t.get("color");if(r)r.setColor(o),i.add(r),a&&a.onUpdate(r);else{var s=e.get("symbol");(r=S0(s,-1,-1,2,2,o)).setStyle("strokeNoScale",!0),i.add(r),a&&a.onCreate(r)}var l=t.getItemStyle(["color","symbol","symbolSize"]);r.setStyle(l),n=v0.merge({rectHover:!0,z2:100},n,!0);var u=e.get("symbolSize");(u=u instanceof Array?u.slice():[+u,+u])[0]/=2,u[1]/=2,n.scale=u;var h=e.get("symbolOffset");if(h){var c=n.position=n.position||[0,0];c[0]+=A0.parsePercent(h[0],u[0]),c[1]+=A0.parsePercent(h[1],u[1])}var d=e.get("symbolRotate");return n.rotation=(d||0)*Math.PI/180||0,r.attr(n),r.updateTransform(),r}function P0(e,t,i,n,r){if(!e.dragging){var a=n.getModel("checkpointStyle"),o=i.dataToCoord(n.getData().get(["value"],t));r||!a.get("animation",!0)?e.attr({position:[o,0]}):(e.stopAnimation(!0),e.animateTo({position:[o,0]},a.get("animationDuration",!0),a.get("animationEasing",!0)))}}w0.extend({type:"timeline.slider",init:function(e,t){this.api=t,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var r=this._layout(e,i),a=this._createGroup("mainGroup"),o=this._createGroup("labelGroup"),s=this._axis=this._createAxis(r,e);e.formatTooltip=function(e){return I0(s.scale.getLabel(e))},D0(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](r,a,s,e)}),this),this._renderAxisLabel(r,o,s,e),this._position(r,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(e,t){var i=e.get("label.position"),n=e.get("orient"),r=function(e,t){return b0.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t);null==i||"auto"===i?i="horizontal"===n?r.y+r.height/2<t.getHeight()/2?"-":"+":r.x+r.width/2<t.getWidth()/2?"+":"-":isNaN(i)&&(i={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[n][i]);var a,o,s,l,u={horizontal:"center",vertical:i>=0||"+"===i?"left":"right"},h={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:E0/2},d="vertical"===n?r.height:r.width,f=e.getModel("controlStyle"),p=f.get("show",!0),g=p?f.get("itemSize"):0,m=p?f.get("itemGap"):0,v=g+m,y=e.get("label.rotate")||0;y=y*E0/180;var _=f.get("position",!0),x=p&&f.get("showPlayBtn",!0),b=p&&f.get("showPrevBtn",!0),w=p&&f.get("showNextBtn",!0),T=0,S=d;return"left"===_||"bottom"===_?(x&&(a=[0,0],T+=v),b&&(o=[T,0],T+=v),w&&(s=[S-g,0],S-=v)):(x&&(a=[S-g,0],S-=v),b&&(o=[0,0],T+=v),w&&(s=[S-g,0],S-=v)),l=[T,S],e.get("inverse")&&l.reverse(),{viewRect:r,mainLength:d,orient:n,rotation:c[n],labelRotation:y,labelPosOpt:i,labelAlign:e.get("label.align")||u[n],labelBaseline:e.get("label.verticalAlign")||e.get("label.baseline")||h[n],playPosition:a,prevBtnPosition:o,nextBtnPosition:s,axisExtent:l,controlSize:g,controlGap:m}},_position:function(e,t){var i=this._mainGroup,n=this._labelGroup,r=e.viewRect;if("vertical"===e.orient){var a=_0.create(),o=r.x,s=r.y+r.height;_0.translate(a,a,[-o,-s]),_0.rotate(a,a,-E0/2),_0.translate(a,a,[o,s]),(r=r.clone()).applyTransform(a)}var l=m(r),u=m(i.getBoundingRect()),h=m(n.getBoundingRect()),c=i.position,d=n.position;d[0]=c[0]=l[0][0];var f,p=e.labelPosOpt;isNaN(p)?(v(c,u,l,1,f="+"===p?0:1),v(d,h,l,1,1-f)):(v(c,u,l,1,f=p>=0?0:1),d[1]=c[1]+p);function g(e){var t=e.position;e.origin=[l[0][0]-t[0],l[1][0]-t[1]]}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function v(e,t,i,n,r){e[n]+=i[n][r]-t[n][r]}i.attr("position",c),n.attr("position",d),i.rotation=n.rotation=e.rotation,g(i),g(n)},_createAxis:function(e,t){var i=t.getData(),n=t.get("axisType"),r=M0.createScaleByModel(t,n);r.getTicks=function(){return i.mapArray(["value"],(function(e){return e}))};var a=i.getDataExtent("value");r.setExtent(a[0],a[1]),r.niceTicks();var o=new T0("value",r,e.axisExtent,n);return o.model=t,o},_createGroup:function(e){var t=this["_"+e]=new x0.Group;return this.group.add(t),t},_renderAxisLine:function(e,t,i,n){var r=i.getExtent();n.get("lineStyle.show")&&t.add(new x0.Line({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:v0.extend({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(e,t,i,n){var r=n.getData(),a=i.scale.getTicks();D0(a,(function(e){var a=i.dataToCoord(e),o=r.getItemModel(e),s=o.getModel("itemStyle"),l=o.getModel("emphasis.itemStyle"),u={position:[a,0],onclick:C0(this._changeTimeline,this,e)},h=L0(o,s,t,u);x0.setHoverStyle(h,l.getItemStyle()),o.get("tooltip")?(h.dataIndex=e,h.dataModel=n):h.dataIndex=h.dataModel=null}),this)},_renderAxisLabel:function(e,t,i,n){if(i.getLabelModel().get("show")){var r=n.getData(),a=i.getViewLabels();D0(a,(function(n){var a=n.tickValue,o=r.getItemModel(a),s=o.getModel("label"),l=o.getModel("emphasis.label"),u=i.dataToCoord(n.tickValue),h=new x0.Text({position:[u,0],rotation:e.labelRotation-e.rotation,onclick:C0(this._changeTimeline,this,a),silent:!1});x0.setTextStyle(h.style,s,{text:n.formattedLabel,textAlign:e.labelAlign,textVerticalAlign:e.labelBaseline}),t.add(h),x0.setHoverStyle(h,x0.setTextStyle({},l))}),this)}},_renderControl:function(e,t,i,n){var r=e.controlSize,a=e.rotation,o=n.getModel("controlStyle").getItemStyle(),s=n.getModel("emphasis.controlStyle").getItemStyle(),l=[0,-r/2,r,r],u=n.getPlayState(),h=n.get("inverse",!0);function c(e,i,u,h){if(e){var c=function(e,t,i,n){var r=n.style,a=x0.createIcon(e.get(t),n||{},new y0(i[0],i[1],i[2],i[3]));r&&a.setStyle(r);return a}(n,i,l,{position:e,origin:[r/2,0],rotation:h?-a:0,rectHover:!0,style:o,onclick:u});t.add(c),x0.setHoverStyle(c,s)}}c(e.nextBtnPosition,"controlStyle.nextIcon",C0(this._changeTimeline,this,h?"-":"+")),c(e.prevBtnPosition,"controlStyle.prevIcon",C0(this._changeTimeline,this,h?"+":"-")),c(e.playPosition,"controlStyle."+(u?"stopIcon":"playIcon"),C0(this._handlePlayClick,this,!u),!0)},_renderCurrentPointer:function(e,t,i,n){var r=n.getData(),a=n.getCurrentIndex(),o=r.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=C0(s._handlePointerDrag,s),e.ondragend=C0(s._handlePointerDragend,s),P0(e,a,i,n,!0)},onUpdate:function(e){P0(e,a,i,n)}};this._currentPointer=L0(o,o,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},_handlePointerDrag:function(e,t,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},_pointerChangeTimeline:function(e,t){var i=this._toAxisCoord(e)[0],n=this._axis,r=A0.asc(n.getExtent().slice());i>r[1]&&(i=r[1]),i<r[0]&&(i=r[0]),this._currentPointer.position[0]=i,this._currentPointer.dirty();var a=this._findNearestTick(i),o=this.model;(t||a!==o.getCurrentIndex()&&o.get("realtime"))&&this._changeTimeline(a)},_doPlayStop:function(){this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(C0((function(){var e=this.model;this._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))}),this),this.model.get("playInterval")))},_toAxisCoord:function(e){var t=this._mainGroup.getLocalTransform();return x0.applyTransform(e,t,!0)},_findNearestTick:function(e){var t,i=this.model.getData(),n=1/0,r=this._axis;return i.each(["value"],(function(i,a){var o=r.dataToCoord(i),s=Math.abs(o-e);s<n&&(n=s,t=a)})),t},_clearTimer:function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},_changeTimeline:function(e){var t=this.model.getCurrentIndex();"+"===e?e=t+1:"-"===e&&(e=t-1),this.api.dispatchAction({type:"timelineChange",currentIndex:e,from:this.uid})}}),n.registerPreprocessor(n0);var N0=n,R0=l,O0=s,k0=qa,z0=Ac,B0=ng,F0=z0.addCommas,V0=z0.encodeHTML;function G0(e){k0.defaultEmphasis(e,"label",["show"])}var H0=N0.extendComponentModel({type:"marker",dependencies:["series","grid","polar","geo"],init:function(e,t,i){this.mergeDefaultAndTheme(e,i),this._mergeOption(e,i,!1,!0)},isAnimationEnabled:function(){if(O0.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},mergeOption:function(e,t){this._mergeOption(e,t,!1,!1)},_mergeOption:function(e,t,i,n){var r=this.constructor,a=this.mainType+"Model";i||t.eachSeries((function(e){var i=e.get(this.mainType,!0),o=e[a];i&&i.data?(o?o._mergeOption(i,t,!0):(n&&G0(i),R0.each(i.data,(function(e){e instanceof Array?(G0(e[0]),G0(e[1])):G0(e)})),o=new r(i,this,t),R0.extend(o,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),e[a]=o):e[a]=null}),this)},formatTooltip:function(e,t,i,n){var r=this.getData(),a=this.getRawValue(e),o=R0.isArray(a)?R0.map(a,F0).join(", "):F0(a),s=r.getName(e),l=V0(this.name);return(null!=a||s)&&(l+="html"===n?"<br/>":"\n"),s&&(l+=V0(s),null!=a&&(l+=" : ")),null!=a&&(l+=V0(o)),l},getData:function(){return this._data},setData:function(e){this._data=e}});R0.mixin(H0,B0);var U0=H0;U0.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var W0={},j0=l,X0=wc,Z0=A_.isDimensionStacked,q0=j0.indexOf;function Y0(e,t,i,n,r,a){var o=[],s=Z0(t,n)?t.getCalculationInfo("stackResultDimension"):n,l=$0(t,s,e),u=t.indicesOfNearest(s,l)[0];o[r]=t.get(i,u),o[a]=t.get(s,u);var h=t.get(n,u),c=X0.getPrecision(t.get(n,u));return(c=Math.min(c,20))>=0&&(o[a]=+o[a].toFixed(c)),[o,h]}var K0=j0.curry,Q0={min:K0(Y0,"min"),max:K0(Y0,"max"),average:K0(Y0,"average")};function J0(e,t,i,n){var r={};return null!=e.valueIndex||null!=e.valueDim?(r.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,r.valueAxis=i.getAxis(function(e,t){var i=e.getData(),n=i.dimensions;t=i.getDimension(t);for(var r=0;r<n.length;r++){var a=i.getDimensionInfo(n[r]);if(a.name===t)return a.coordDim}}(n,r.valueDataDim)),r.baseAxis=i.getOtherAxis(r.valueAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim)):(r.baseAxis=n.getBaseAxis(),r.valueAxis=i.getOtherAxis(r.baseAxis),r.baseDataDim=t.mapDimension(r.baseAxis.dim),r.valueDataDim=t.mapDimension(r.valueAxis.dim)),r}function $0(e,t,i){if("average"===i){var n=0,r=0;return e.each(t,(function(e,t){isNaN(e)||(n+=e,r++)})),n/r}return"median"===i?e.getMedian(t):e.getDataExtent(t,!0)["max"===i?1:0]}W0.dataTransform=function(e,t){var i=e.getData(),n=e.coordinateSystem;if(t&&!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!j0.isArray(t.coord)&&n){var r=n.dimensions,a=J0(t,i,n,e);if((t=j0.clone(t)).type&&Q0[t.type]&&a.baseAxis&&a.valueAxis){var o=q0(r,a.baseAxis.dim),s=q0(r,a.valueAxis.dim),l=Q0[t.type](i,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else{for(var u=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis],h=0;h<2;h++)Q0[u[h]]&&(u[h]=$0(i,i.mapDimension(r[h]),u[h]));t.coord=u}}return t},W0.getAxisInfo=J0,W0.dataFilter=function(e,t){return!(e&&e.containData&&t.coord&&!function(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}(t))||e.containData(t.coord)},W0.dimValueGetter=function(e,t,i,n){return n<2?e.coord&&e.coord[n]:e.value},W0.numCalculate=$0;var e1=l,t1=n.extendComponentView({type:"marker",init:function(){this.markerGroupMap=e1.createHashMap()},render:function(e,t,i){var n=this.markerGroupMap;n.each((function(e){e.__keep=!1}));var r=this.type+"Model";t.eachSeries((function(e){var n=e[r];n&&this.renderSeries(e,n,t,i)}),this),n.each((function(e){!e.__keep&&this.group.remove(e.group)}),this)},renderSeries:function(){}}),i1=l,n1=RT,r1=wc,a1=Jy,o1=W0;function s1(e,t,i){var n=t.coordinateSystem;e.each((function(r){var a,o=e.getItemModel(r),s=r1.parsePercent(o.get("x"),i.getWidth()),l=r1.parsePercent(o.get("y"),i.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)a=t.getMarkerPosition(e.getValues(e.dimensions,r));else if(n){var u=e.get(n.dimensions[0],r),h=e.get(n.dimensions[1],r);a=n.dataToPoint([u,h])}}else a=[s,l];isNaN(s)||(a[0]=s),isNaN(l)||(a[1]=l),e.setItemLayout(r,a)}))}t1.extend({type:"markPoint",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markPointModel;t&&(s1(t.getData(),e,i),this.markerGroupMap.get(e.id).updateLayout(t))}),this)},renderSeries:function(e,t,i,n){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new n1),u=function(e,t,i){var n;n=e?i1.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return i1.defaults({name:e},i)})):[{name:"value",type:"float"}];var r=new a1(n,i),a=i1.map(i.get("data"),i1.curry(o1.dataTransform,t));e&&(a=i1.filter(a,i1.curry(o1.dataFilter,e)));return r.initData(a,null,e?o1.dimValueGetter:function(e){return e.value}),r}(r,e,t);t.setData(u),s1(t.getData(),e,n),u.each((function(e){var i=u.getItemModel(e),n=i.getShallow("symbol"),r=i.getShallow("symbolSize"),a=i.getShallow("symbolRotate"),s=i1.isFunction(n),l=i1.isFunction(r),h=i1.isFunction(a);if(s||l||h){var c=t.getRawValue(e),d=t.getDataParams(e);s&&(n=n(c,d)),l&&(r=r(c,d)),h&&(a=a(c,d))}u.setItemVisual(e,{symbol:n,symbolSize:r,symbolRotate:a,color:i.get("itemStyle.color")||o.getVisual("color")})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(e){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),n.registerPreprocessor((function(e){e.markPoint=e.markPoint||{}})),U0.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});var l1=l,u1=Jy,h1=wc,c1=W0,d1=yk,f1=t1,p1=A_.getStackedDimension,g1=function(e,t,i,n){var r=e.getData(),a=n.type;if(!l1.isArray(n)&&("min"===a||"max"===a||"average"===a||"median"===a||null!=n.xAxis||null!=n.yAxis)){var o,s;if(null!=n.yAxis||null!=n.xAxis)o=t.getAxis(null!=n.yAxis?"y":"x"),s=l1.retrieve(n.yAxis,n.xAxis);else{var l=c1.getAxisInfo(n,r,t,e);o=l.valueAxis;var u=p1(r,l.valueDataDim);s=c1.numCalculate(r,u,a)}var h="x"===o.dim?0:1,c=1-h,d=l1.clone(n),f={};d.type=null,d.coord=[],f.coord=[],d.coord[c]=-1/0,f.coord[c]=1/0;var p=i.get("precision");p>=0&&"number"==typeof s&&(s=+s.toFixed(Math.min(p,20))),d.coord[h]=f.coord[h]=s,n=[d,f,{type:a,valueIndex:n.valueIndex,value:s}]}return(n=[c1.dataTransform(e,n[0]),c1.dataTransform(e,n[1]),l1.extend({},n[2])])[2].type=n[2].type||"",l1.merge(n[2],n[0]),l1.merge(n[2],n[1]),n};function m1(e){return!isNaN(e)&&!isFinite(e)}function v1(e,t,i,n){var r=1-e,a=n.dimensions[e];return m1(t[r])&&m1(i[r])&&t[e]===i[e]&&n.getAxis(a).containData(t[e])}function y1(e,t){if("cartesian2d"===e.type){var i=t[0].coord,n=t[1].coord;if(i&&n&&(v1(1,i,n,e)||v1(0,i,n,e)))return!0}return c1.dataFilter(e,t[0])&&c1.dataFilter(e,t[1])}function _1(e,t,i,n,r){var a,o=n.coordinateSystem,s=e.getItemModel(t),l=h1.parsePercent(s.get("x"),r.getWidth()),u=h1.parsePercent(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)a=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var h=o.dimensions,c=e.get(h[0],t),d=e.get(h[1],t);a=o.dataToPoint([c,d])}if("cartesian2d"===o.type){var f=o.getAxis("x"),p=o.getAxis("y");h=o.dimensions;m1(e.get(h[0],t))?a[0]=f.toGlobalCoord(f.getExtent()[i?0:1]):m1(e.get(h[1],t))&&(a[1]=p.toGlobalCoord(p.getExtent()[i?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];e.setItemLayout(t,a)}f1.extend({type:"markLine",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markLineModel;if(t){var n=t.getData(),r=t.__from,a=t.__to;r.each((function(t){_1(r,t,!0,e,i),_1(a,t,!1,e,i)})),n.each((function(e){n.setItemLayout(e,[r.getItemLayout(e),a.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},renderSeries:function(e,t,i,n){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new d1);this.group.add(l.group);var u=function(e,t,i){var n;n=e?l1.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return l1.defaults({name:e},i)})):[{name:"value",type:"float"}];var r=new u1(n,i),a=new u1(n,i),o=new u1([],i),s=l1.map(i.get("data"),l1.curry(g1,t,e,i));e&&(s=l1.filter(s,l1.curry(y1,e)));var l=e?c1.dimValueGetter:function(e){return e.value};return r.initData(l1.map(s,(function(e){return e[0]})),null,l),a.initData(l1.map(s,(function(e){return e[1]})),null,l),o.initData(l1.map(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:r,to:a,line:o}}(r,e,t),h=u.from,c=u.to,d=u.line;t.__from=h,t.__to=c,t.setData(d);var f=t.get("symbol"),p=t.get("symbolSize");function g(t,i,r){var a=t.getItemModel(i);_1(t,i,r,e,n),t.setItemVisual(i,{symbolRotate:a.get("symbolRotate"),symbolSize:a.get("symbolSize")||p[r?0:1],symbol:a.get("symbol",!0)||f[r?0:1],color:a.get("itemStyle.color")||o.getVisual("color")})}l1.isArray(f)||(f=[f,f]),"number"==typeof p&&(p=[p,p]),u.from.each((function(e){g(h,e,!0),g(c,e,!1)})),d.each((function(e){var t=d.getItemModel(e).get("lineStyle.color");d.setItemVisual(e,{color:t||h.getItemVisual(e,"color")}),d.setItemLayout(e,[h.getItemLayout(e),c.getItemLayout(e)]),d.setItemVisual(e,{fromSymbolRotate:h.getItemVisual(e,"symbolRotate"),fromSymbolSize:h.getItemVisual(e,"symbolSize"),fromSymbol:h.getItemVisual(e,"symbol"),toSymbolRotate:c.getItemVisual(e,"symbolRotate"),toSymbolSize:c.getItemVisual(e,"symbolSize"),toSymbol:c.getItemVisual(e,"symbol")})})),l.updateData(d),u.line.eachItemGraphicEl((function(e,i){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),n.registerPreprocessor((function(e){e.markLine=e.markLine||{}})),U0.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var x1=l,b1=$e,w1=Jy,T1=wc,S1=yo,M1=W0,A1=function(e,t,i,n){var r=M1.dataTransform(e,n[0]),a=M1.dataTransform(e,n[1]),o=x1.retrieve,s=r.coord,l=a.coord;s[0]=o(s[0],-1/0),s[1]=o(s[1],-1/0),l[0]=o(l[0],1/0),l[1]=o(l[1],1/0);var u=x1.mergeAll([{},r,a]);return u.coord=[r.coord,a.coord],u.x0=r.x,u.y0=r.y,u.x1=a.x,u.y1=a.y,u};function I1(e){return!isNaN(e)&&!isFinite(e)}function C1(e,t,i,n){var r=1-e;return I1(t[r])&&I1(i[r])}function D1(e,t){var i=t.coord[0],n=t.coord[1];return!("cartesian2d"!==e.type||!i||!n||!C1(1,i,n)&&!C1(0,i,n))||(M1.dataFilter(e,{coord:i,x:t.x0,y:t.y0})||M1.dataFilter(e,{coord:n,x:t.x1,y:t.y1}))}function E1(e,t,i,n,r){var a,o=n.coordinateSystem,s=e.getItemModel(t),l=T1.parsePercent(s.get(i[0]),r.getWidth()),u=T1.parsePercent(s.get(i[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)a=n.getMarkerPosition(e.getValues(i,t));else{var h=[f=e.get(i[0],t),p=e.get(i[1],t)];o.clampData&&o.clampData(h,h),a=o.dataToPoint(h,!0)}if("cartesian2d"===o.type){var c=o.getAxis("x"),d=o.getAxis("y"),f=e.get(i[0],t),p=e.get(i[1],t);I1(f)?a[0]=c.toGlobalCoord(c.getExtent()["x0"===i[0]?0:1]):I1(p)&&(a[1]=d.toGlobalCoord(d.getExtent()["y0"===i[1]?0:1]))}isNaN(l)||(a[0]=l),isNaN(u)||(a[1]=u)}else a=[l,u];return a}var L1=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];t1.extend({type:"markArea",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markAreaModel;if(t){var n=t.getData();n.each((function(t){var r=x1.map(L1,(function(r){return E1(n,t,r,e,i)}));n.setItemLayout(t,r),n.getItemGraphicEl(t).setShape("points",r)}))}}),this)},renderSeries:function(e,t,i,n){var r=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,{group:new S1.Group});this.group.add(l.group),l.__keep=!0;var u=function(e,t,i){var n,r,a=["x0","y0","x1","y1"];e?(n=x1.map(e&&e.dimensions,(function(e){var i=t.getData(),n=i.getDimensionInfo(i.mapDimension(e))||{};return x1.defaults({name:e},n)})),r=new w1(x1.map(a,(function(e,t){return{name:e,type:n[t%2].type}})),i)):r=new w1(n=[{name:"value",type:"float"}],i);var o=x1.map(i.get("data"),x1.curry(A1,t,e,i));e&&(o=x1.filter(o,x1.curry(D1,e)));var s=e?function(e,t,i,n){return e.coord[Math.floor(n/2)][n%2]}:function(e){return e.value};return r.initData(o,null,s),r.hasItemOption=!0,r}(r,e,t);t.setData(u),u.each((function(t){var i=x1.map(L1,(function(i){return E1(u,t,i,e,n)})),a=!0;x1.each(L1,(function(e){if(a){var i=u.get(e[0],t),n=u.get(e[1],t);(I1(i)||r.getAxis("x").containData(i))&&(I1(n)||r.getAxis("y").containData(n))&&(a=!1)}})),u.setItemLayout(t,{points:i,allClipped:a}),u.setItemVisual(t,{color:o.getVisual("color")})})),u.diff(l.__data).add((function(e){var t=u.getItemLayout(e);if(!t.allClipped){var i=new S1.Polygon({shape:{points:t.points}});u.setItemGraphicEl(e,i),l.group.add(i)}})).update((function(e,i){var n=l.__data.getItemGraphicEl(i),r=u.getItemLayout(e);r.allClipped?n&&l.group.remove(n):(n?S1.updateProps(n,{shape:{points:r.points}},t,e):n=new S1.Polygon({shape:{points:r.points}}),u.setItemGraphicEl(e,n),l.group.add(n))})).remove((function(e){var t=l.__data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,i){var n=u.getItemModel(i),r=n.getModel("label"),a=n.getModel("emphasis.label"),o=u.getItemVisual(i,"color");e.useStyle(x1.defaults(n.getModel("itemStyle").getItemStyle(),{fill:b1.modifyAlpha(o,.4),stroke:o})),e.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),S1.setLabelStyle(e.style,e.hoverStyle,r,a,{labelFetcher:t,labelDataIndex:i,defaultText:u.getName(i)||"",isRectText:!0,autoColor:o}),S1.setHoverStyle(e,{}),e.dataModel=t})),l.__data=u,l.group.silent=t.get("silent")||e.get("silent")}}),n.registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var P1=n,N1=l,R1=mc,O1=qa.isNameSpecified,k1=_m.legend.selector,z1={all:{type:"all",title:N1.clone(k1.all)},inverse:{type:"inverse",title:N1.clone(k1.inverse)}},B1=P1.extendComponentModel({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(e,t,i){this.mergeDefaultAndTheme(e,i),e.selected=e.selected||{},this._updateSelector(e)},mergeOption:function(e){B1.superCall(this,"mergeOption",e),this._updateSelector(e)},_updateSelector:function(e){var t=e.selector;!0===t&&(t=e.selector=["all","inverse"]),N1.isArray(t)&&N1.each(t,(function(e,i){N1.isString(e)&&(e={type:e}),t[i]=N1.merge(e,z1[e.type])}))},optionUpdated:function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,i=0;i<e.length;i++){var n=e[i].get("name");if(this.isSelected(n)){this.select(n),t=!0;break}}!t&&this.select(e[0].get("name"))}},_updateData:function(e){var t=[],i=[];e.eachRawSeries((function(n){var r,a=n.name;if(i.push(a),n.legendVisualProvider){var o=n.legendVisualProvider.getAllNames();e.isSeriesFiltered(n)||(i=i.concat(o)),o.length?t=t.concat(o):r=!0}else r=!0;r&&O1(n)&&t.push(n.name)})),this._availableNames=i;var n=this.get("data")||t,r=N1.map(n,(function(e){return"string"!=typeof e&&"number"!=typeof e||(e={name:e}),new R1(e,this,this.ecModel)}),this);this._data=r},getData:function(){return this._data},select:function(e){var t=this.option.selected;if("single"===this.get("selectedMode")){var i=this._data;N1.each(i,(function(e){t[e.get("name")]=!1}))}t[e]=!0},unSelect:function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},toggleSelected:function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},allSelect:function(){var e=this._data,t=this.option.selected;N1.each(e,(function(e){t[e.get("name",!0)]=!0}))},inverseSelect:function(){var e=this._data,t=this.option.selected;N1.each(e,(function(e){var i=e.get("name",!0);t.hasOwnProperty(i)||(t[i]=!0),t[i]=!t[i]}))},isSelected:function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&N1.indexOf(this._availableNames,e)>=0},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:" sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}}}),F1=B1,V1=n,G1=l;function H1(e,t,i){var n,r={},a="toggleSelected"===e;return i.eachComponent("legend",(function(i){a&&null!=n?i[n?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?i[e]():(i[e](t.name),n=i.isSelected(t.name));var o=i.getData();G1.each(o,(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var n=i.isSelected(t);r.hasOwnProperty(t)?r[t]=r[t]&&n:r[t]=n}}))})),"allSelect"===e||"inverseSelect"===e?{selected:r}:{name:t.name,selected:r}}V1.registerAction("legendToggleSelect","legendselectchanged",G1.curry(H1,"toggleSelected")),V1.registerAction("legendAllSelect","legendselectall",G1.curry(H1,"allSelect")),V1.registerAction("legendInverseSelect","legendinverseselect",G1.curry(H1,"inverseSelect")),V1.registerAction("legendSelect","legendselected",G1.curry(H1,"select")),V1.registerAction("legendUnSelect","legendunselected",G1.curry(H1,"unSelect"));var U1=n,W1=l,j1=Ab.createSymbol,X1=yo,Z1=sK.makeBackground,q1=bc,Y1=W1.curry,K1=W1.each,Q1=X1.Group;function J1(e,t,i,n,r,a){var o;return"line"!==t&&t.indexOf("empty")<0?(o=i.getItemStyle(),e.style.stroke=n,a||(o.stroke=r)):o=i.getItemStyle(["borderWidth","borderColor"]),e.setStyle(o)}function $1(e,t,i,n){t2(e,t,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),e2(e,t,i,n)}function e2(e,t,i,n){var r=i.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||i.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:n})}function t2(e,t,i,n){var r=i.getZr().storage.getDisplayList()[0];r&&r.useHoverLayer||i.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:n})}var i2=U1.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new Q1),this._backgroundEl,this.group.add(this._selectorGroup=new Q1),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(e,t,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),a=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===a?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===a?"end":"start"),this.renderInner(r,e,t,i,o,a,s);var l=e.getBoxLayoutParams(),u={width:i.getWidth(),height:i.getHeight()},h=e.get("padding"),c=q1.getLayoutRect(l,u,h),d=this.layoutInner(e,r,c,n,o,s),f=q1.getLayoutRect(W1.defaults({width:d.width,height:d.height},l),u,h);this.group.attr("position",[f.x-d.x,f.y-d.y]),this.group.add(this._backgroundEl=Z1(d,e))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(e,t,i,n,r,a,o){var s=this.getContentGroup(),l=W1.createHashMap(),u=t.get("selectedMode"),h=[];i.eachRawSeries((function(e){!e.get("legendHoverLink")&&h.push(e.id)})),K1(t.getData(),(function(r,a){var o=r.get("name");if(this.newlineDisabled||""!==o&&"\n"!==o){var c=i.getSeriesByName(o)[0];if(!l.get(o))if(c){var d=c.getData(),f=d.getVisual("color"),p=d.getVisual("borderColor");"function"==typeof f&&(f=f(c.getDataParams(0))),"function"==typeof p&&(p=p(c.getDataParams(0)));var g=d.getVisual("legendSymbol")||"roundRect",m=d.getVisual("symbol");this._createItem(o,a,r,t,g,m,e,f,p,u).on("click",Y1($1,o,null,n,h)).on("mouseover",Y1(e2,c.name,null,n,h)).on("mouseout",Y1(t2,c.name,null,n,h)),l.set(o,!0)}else i.eachRawSeries((function(i){if(!l.get(o)&&i.legendVisualProvider){var s=i.legendVisualProvider;if(!s.containName(o))return;var c=s.indexOfName(o),d=s.getItemVisual(c,"color"),f=s.getItemVisual(c,"borderColor");this._createItem(o,a,r,t,"roundRect",null,e,d,f,u).on("click",Y1($1,null,o,n,h)).on("mouseover",Y1(e2,null,o,n,h)).on("mouseout",Y1(t2,null,o,n,h)),l.set(o,!0)}}),this)}else s.add(new Q1({newline:!0}))}),this),r&&this._createSelector(r,t,n,a,o)},_createSelector:function(e,t,i,n,r){var a=this.getSelectorGroup();K1(e,(function(e){!function(e){var n=e.type,r=new X1.Text({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===n?"legendAllSelect":"legendInverseSelect"})}});a.add(r);var o=t.getModel("selectorLabel"),s=t.getModel("emphasis.selectorLabel");X1.setLabelStyle(r.style,r.hoverStyle={},o,s,{defaultText:e.title,isRectText:!1}),X1.setHoverStyle(r)}(e)}))},_createItem:function(e,t,i,n,r,a,o,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),f=n.get("inactiveBorderColor"),p=n.get("symbolKeepAspect"),g=n.getModel("itemStyle"),m=n.isSelected(e),v=new Q1,y=i.getModel("textStyle"),_=i.get("icon"),x=i.getModel("tooltip"),b=x.parentModel,w=j1(r=_||r,0,0,h,c,m?s:d,null==p||p);if(v.add(J1(w,r,g,l,f,m)),!_&&a&&(a!==r||"none"===a)){var T=.8*c;"none"===a&&(a="circle");var S=j1(a,(h-T)/2,(c-T)/2,T,T,m?s:d,null==p||p);v.add(J1(S,a,g,l,f,m))}var M="left"===o?h+5:-5,A=o,I=n.get("formatter"),C=e;"string"==typeof I&&I?C=I.replace("{name}",null!=e?e:""):"function"==typeof I&&(C=I(e)),v.add(new X1.Text({style:X1.setTextStyle({},y,{text:C,x:M,y:c/2,textFill:m?y.getTextColor():d,textAlign:A,textVerticalAlign:"middle"})}));var D=new X1.Rect({shape:v.getBoundingRect(),invisible:!0,tooltip:x.get("show")?W1.extend({content:e,formatter:b.get("formatter",!0)||function(){return e},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:e,$vars:["name"]}},x.option):null});return v.add(D),v.eachChild((function(e){e.silent=!0})),D.silent=!u,this.getContentGroup().add(v),X1.setHoverStyle(v),v.__legendDataIndex=t,v},layoutInner:function(e,t,i,n,r,a){var o=this.getContentGroup(),s=this.getSelectorGroup();q1.box(e.get("orient"),o,e.get("itemGap"),i.width,i.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(r){q1.box("horizontal",s,e.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=e.get("selectorButtonGap",!0),f=e.getOrient().index,p=0===f?"width":"height",g=0===f?"height":"width",m=0===f?"y":"x";"end"===a?c[f]+=l[p]+d:u[f]+=h[p]+d,c[1-f]+=l[g]/2-h[g]/2,s.attr("position",c),o.attr("position",u);var v={x:0,y:0};return v[p]=l[p]+d+h[p],v[g]=Math.max(l[g],h[g]),v[m]=Math.min(0,h[m]+c[1-f]),v}return o.attr("position",u),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});var n2=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var i=0;i<t.length;i++)if(!t[i].isSelected(e.name))return!1;return!0}))},r2=n,a2=n2,o2=ud;r2.registerProcessor(r2.PRIORITY.PROCESSOR.SERIES_FILTER,a2),o2.registerSubTypeDefaulter("legend",(function(){return"plain"}));var s2=F1,l2=bc,u2=l2.mergeLayoutParam,h2=l2.getLayoutParams,c2=s2.extend({type:"legend.scroll",setScrollDataIndex:function(e){this.option.scrollDataIndex=e},defaultOption:{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800},init:function(e,t,i,n){var r=h2(e);c2.superCall(this,"init",e,t,i,n),d2(this,e,r)},mergeOption:function(e,t){c2.superCall(this,"mergeOption",e,t),d2(this,this.option,e)}});function d2(e,t,i){var n=[1,1];n[e.getOrient().index]=0,u2(t,i,{type:"box",ignoreSize:n})}var f2=l,p2=yo,g2=bc,m2=i2,v2=p2.Group,y2=["width","height"],_2=["x","y"],x2=m2.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){x2.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new v2),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new v2),this._showController},resetInner:function(){x2.superCall(this,"resetInner"),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},renderInner:function(e,t,i,n,r,a,o){var s=this;x2.superCall(this,"renderInner",e,t,i,n,r,a,o);var l=this._controllerGroup,u=t.get("pageIconSize",!0);f2.isArray(u)||(u=[u,u]),c("pagePrev",0);var h=t.getModel("pageTextStyle");function c(e,i){var r=e+"DataIndex",a=p2.createIcon(t.get("pageIcons",!0)[t.getOrient().name][i],{onclick:f2.bind(s._pageGo,s,r,t,n)},{x:-u[0]/2,y:-u[1]/2,width:u[0],height:u[1]});a.name=e,l.add(a)}l.add(new p2.Text({name:"pageText",style:{textFill:h.getTextColor(),font:h.getFont(),textVerticalAlign:"middle",textAlign:"center"},silent:!0})),c("pageNext",1)},layoutInner:function(e,t,i,n,r,a){var o=this.getSelectorGroup(),s=e.getOrient().index,l=y2[s],u=_2[s],h=y2[1-s],c=_2[1-s];r&&g2.box("horizontal",o,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),f=o.getBoundingRect(),p=[-f.x,-f.y],g=f2.clone(i);r&&(g[l]=i[l]-f[l]-d);var m=this._layoutContentAndController(e,n,g,s,l,h,c);if(r){if("end"===a)p[s]+=m[l]+d;else{var v=f[l]+d;p[s]-=v,m[u]-=v}m[l]+=f[l]+d,p[1-s]+=m[c]+m[h]/2-f[h]/2,m[h]=Math.max(m[h],f[h]),m[c]=Math.min(m[c],f[c]+p[1-s]),o.attr("position",p)}return m},_layoutContentAndController:function(e,t,i,n,r,a,o){var s=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;g2.box(e.get("orient"),s,e.get("itemGap"),n?i.width:null,n?null:i.height),g2.box("horizontal",u,e.get("pageButtonItemGap",!0));var h=s.getBoundingRect(),c=u.getBoundingRect(),d=this._showController=h[r]>i[r],f=[-h.x,-h.y];t||(f[n]=s.position[n]);var p=[0,0],g=[-c.x,-c.y],m=f2.retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));d&&("end"===e.get("pageButtonPosition",!0)?g[n]+=i[r]-c[r]:p[n]+=c[r]+m);g[1-n]+=h[a]/2-c[a]/2,s.attr("position",f),l.attr("position",p),u.attr("position",g);var v={x:0,y:0};if(v[r]=d?i[r]:h[r],v[a]=Math.max(h[a],c[a]),v[o]=Math.min(0,c[o]+g[1-n]),l.__rectSize=i[r],d){var y={x:0,y:0};y[r]=Math.max(i[r]-c[r]-m,0),y[a]=v[a],l.setClipPath(new p2.Rect({shape:y})),l.__rectSize=y[r]}else u.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var _=this._getPageInfo(e);return null!=_.pageIndex&&p2.updateProps(s,{position:_.contentPosition},!!d&&e),this._updatePageInfoView(e,_),v},_pageGo:function(e,t,i){var n=this._getPageInfo(t)[e];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:t.id})},_updatePageInfoView:function(e,t){var i=this._controllerGroup;f2.each(["pagePrev","pageNext"],(function(n){var r=null!=t[n+"DataIndex"],a=i.childOfName(n);a&&(a.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),a.cursor=r?"pointer":"default")}));var n=i.childOfName("pageText"),r=e.get("pageFormatter"),a=t.pageIndex,o=null!=a?a+1:0,s=t.pageCount;n&&r&&n.setStyle("text",f2.isString(r)?r.replace("{current}",o).replace("{total}",s):r({current:o,total:s}))},_getPageInfo:function(e){var t=e.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,r=e.getOrient().index,a=y2[r],o=_2[r],s=this._findTargetItemIndex(t),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[r]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=h;++p)(!(v=y(l[p]))&&m.e>g.s+n||v&&!_(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(p=s-1,g=f,m=f,v=null;p>=-1;--p)(v=y(l[p]))&&_(m,v.s)||!(g.i<m.i)||(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(e){if(e){var t=e.getBoundingRect(),i=t[o]+e.position[r];return{s:i,e:i+t[a],i:e.__legendDataIndex}}}function _(e,t){return e.e>=t&&e.s<=t+n}},_findTargetItemIndex:function(e){return this._showController?(this.getContentGroup().eachChild((function(n,r){var a=n.__legendDataIndex;null==i&&null!=a&&(i=r),a===e&&(t=r)})),null!=t?t:i):0;var t,i}});n.registerAction("legendScroll","legendscroll",(function(e,t){var i=e.scrollDataIndex;null!=i&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(i)}))})),HQ.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var b2=l,w2=Y,T2=yo,S2=dm,M2=WQ,A2=wc,I2=bc,C2=LB,D2=T2.Rect,E2=A2.linearMap,L2=A2.asc,P2=b2.bind,N2=b2.each,R2=["line","bar","candlestick","scatter"],O2=M2.extend({type:"dataZoom.slider",init:function(e,t){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=t},render:function(e,t,i,n){O2.superApply(this,"render",arguments),S2.createOrUpdate(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=e.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){O2.superApply(this,"remove",arguments),S2.clear(this,"_dispatchZoomAction")},dispose:function(){O2.superApply(this,"dispose",arguments),S2.clear(this,"_dispatchZoomAction")},_buildView:function(){var e=this.group;e.removeAll(),this._resetLocation(),this._resetInterval();var t=this._displayables.barGroup=new T2.Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},_resetLocation:function(){var e=this.dataZoomModel,t=this.api,i=this._findCoordRect(),n={width:t.getWidth(),height:t.getHeight()},r="horizontal"===this._orient?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=I2.getLayoutParams(e.option);b2.each(["right","top","width","height"],(function(e){"ph"===a[e]&&(a[e]=r[e])}));var o=I2.getLayoutRect(a,n,e.padding);this._location={x:o.x,y:o.y},this._size=[o.width,o.height],"vertical"===this._orient&&this._size.reverse()},_positionGroup:function(){var e=this.group,t=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),r=n&&n.get("inverse"),a=this._displayables.barGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr("horizontal"!==i||r?"horizontal"===i&&r?{scale:o?[-1,1]:[-1,-1]}:"vertical"!==i||r?{scale:o?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:o?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:o?[1,1]:[1,-1]});var s=e.getBoundingRect([a]);e.attr("position",[t.x-s.x,t.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var e=this.dataZoomModel,t=this._size,i=this._displayables.barGroup;i.add(new D2({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40})),i.add(new D2({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:b2.bind(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(e){var t=this._size,i=e.series,n=i.getRawData(),r=i.getShadowDim?i.getShadowDim():e.otherDim;if(null!=r){var a=n.getDataExtent(r),o=.3*(a[1]-a[0]);a=[a[0]-o,a[1]+o];var s,l=[0,t[1]],u=[0,t[0]],h=[[t[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),f=0,p=Math.round(n.count()/t[0]);n.each([r],(function(e,t){if(p>0&&t%p)f+=d;else{var i=null==e||isNaN(e)||""===e,n=i?0:E2(e,a,l,!0);i&&!s&&t?(h.push([h[h.length-1][0],0]),c.push([c[c.length-1][0],0])):!i&&s&&(h.push([f,0]),c.push([f,0])),h.push([f,n]),c.push([f,n]),f+=d,s=i}}));var g=this.dataZoomModel;this._displayables.barGroup.add(new T2.Polygon({shape:{points:h},style:b2.defaults({fill:g.get("dataBackgroundColor")},g.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new T2.Polyline({shape:{points:c},style:g.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var i,n=this.ecModel;return e.eachTargetAxis((function(r,a){var o=e.getAxisProxy(r.name,a).getTargetSeriesModels();b2.each(o,(function(e){if(!(i||!0!==t&&b2.indexOf(R2,e.get("type"))<0)){var o,s=n.getComponent(r.axis,a).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[r.name],u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(o=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),i={thisAxis:s,series:e,thisDim:r.name,otherDim:l,otherAxisInverse:o}}}),this)}),this),i}},_renderHandle:function(){var e=this._displayables,t=e.handles=[],i=e.handleLabels=[],n=this._displayables.barGroup,r=this._size,a=this.dataZoomModel;n.add(e.filler=new D2({draggable:!0,cursor:k2(this._orient),drift:P2(this._onDragMove,this,"all"),ondragstart:P2(this._showDataInfo,this,!0),ondragend:P2(this._onDragEnd,this),onmouseover:P2(this._showDataInfo,this,!0),onmouseout:P2(this._showDataInfo,this,!1),style:{fill:a.get("fillerColor"),textPosition:"inside"}})),n.add(new D2({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:r[0],height:r[1]},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),N2([0,1],(function(e){var r=T2.createIcon(a.get("handleIcon"),{cursor:k2(this._orient),draggable:!0,drift:P2(this._onDragMove,this,e),ondragend:P2(this._onDragEnd,this),onmouseover:P2(this._showDataInfo,this,!0),onmouseout:P2(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),o=r.getBoundingRect();this._handleHeight=A2.parsePercent(a.get("handleSize"),this._size[1]),this._handleWidth=o.width/o.height*this._handleHeight,r.setStyle(a.getModel("handleStyle").getItemStyle());var s=a.get("handleColor");null!=s&&(r.style.fill=s),n.add(t[e]=r);var l=a.textStyleModel;this.group.add(i[e]=new T2.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))}),this)},_resetInterval:function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[E2(e[0],[0,100],t,!0),E2(e[1],[0,100],t,!0)]},_updateInterval:function(e,t){var i=this.dataZoomModel,n=this._handleEnds,r=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];C2(t,n,r,i.get("zoomLock")?"all":e,null!=a.minSpan?E2(a.minSpan,o,r,!0):null,null!=a.maxSpan?E2(a.maxSpan,o,r,!0):null);var s=this._range,l=this._range=L2([E2(n[0],r,o,!0),E2(n[1],r,o,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(e){var t=this._displayables,i=this._handleEnds,n=L2(i.slice()),r=this._size;N2([0,1],(function(e){var n=t.handles[e],a=this._handleHeight;n.attr({scale:[a/2,a/2],position:[i[e],r[1]/2-a/2]})}),this),t.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:r[1]}),this._updateDataInfo(e)},_updateDataInfo:function(e){var t=this.dataZoomModel,i=this._displayables,n=i.handleLabels,r=this._orient,a=["",""];if(t.get("showDetail")){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,l=this._range,u=e?o.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:o.getDataValueWindow();a=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var h=L2(this._handleEnds.slice());function c(e){var t=T2.getTransform(i.handles[e].parent,this.group),o=T2.transformDirection(0===e?"right":"left",t),s=this._handleWidth/2+5,l=T2.applyTransform([h[e]+(0===e?-s:s),this._size[1]/2],t);n[e].setStyle({x:l[0],y:l[1],textVerticalAlign:"horizontal"===r?"middle":o,textAlign:"horizontal"===r?o:"center",text:a[e]})}c.call(this,0),c.call(this,1)},_formatLabel:function(e,t){var i=this.dataZoomModel,n=i.get("labelFormatter"),r=i.get("labelPrecision");null!=r&&"auto"!==r||(r=t.getPixelPrecision());var a=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel(Math.round(e)):e.toFixed(Math.min(r,20));return b2.isFunction(n)?n(e,a):b2.isString(n)?n.replace("{value}",a):a},_showDataInfo:function(e){e=this._dragging||e;var t=this._displayables.handleLabels;t[0].attr("invisible",!e),t[1].attr("invisible",!e)},_onDragMove:function(e,t,i,n){this._dragging=!0,w2.stop(n.event);var r=this._displayables.barGroup.getLocalTransform(),a=T2.applyTransform([t,i],r,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get("realtime");this._updateView(!s),o&&s&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(e){var t=this._size,i=this._displayables.barGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(i[0]<0||i[0]>t[0]||i[1]<0||i[1]>t[1])){var n=this._handleEnds,r=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-r);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:e[0],end:e[1]})},_findCoordRect:function(){var e;if(N2(this.getTargetCoordInfo(),(function(t){if(!e&&t.length){var i=t[0].model.coordinateSystem;e=i.getRect&&i.getRect()}})),!e){var t=this.api.getWidth(),i=this.api.getHeight();e={x:.2*t,y:.2*i,width:.6*t,height:.6*i}}return e}});function k2(e){return"vertical"===e?"ns-resize":"ew-resize"}HQ.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var z2={},B2=l,F2=eL,V2=dm,G2="\0_ec_dataZoom_roams";function H2(e){var t=e.getZr();return t[G2]||(t[G2]={})}function U2(e){B2.each(e,(function(t,i){t.count||(t.controller.dispose(),delete e[i])}))}function W2(e,t){e.dispatchAction({type:"dataZoom",batch:t})}z2.register=function(e,t){var i=H2(e),n=t.dataZoomId,r=t.coordId;B2.each(i,(function(e,i){var a=e.dataZoomInfos;a[n]&&B2.indexOf(t.allCoordIds,r)<0&&(delete a[n],e.count--)})),U2(i);var a=i[r];a||((a=i[r]={coordId:r,dataZoomInfos:{},count:0}).controller=function(e,t){var i=new F2(e.getZr());return B2.each(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(i){var n=[];B2.each(t.dataZoomInfos,(function(r){if(i.isAvailableBehavior(r.dataZoomModel.option)){var a=(r.getRange||{})[e],o=a&&a(t.controller,i);!r.dataZoomModel.get("disabled",!0)&&o&&n.push({dataZoomId:r.dataZoomId,start:o[0],end:o[1]})}})),n.length&&t.dispatchAction(n)}))})),i}(e,a),a.dispatchAction=B2.curry(W2,e)),!a.dataZoomInfos[n]&&a.count++,a.dataZoomInfos[n]=t;var o,s,l,u,h,c=(o=a.dataZoomInfos,l="type_",u={type_true:2,type_move:1,type_false:0,type_undefined:-1},h=!0,B2.each(o,(function(e){var t=e.dataZoomModel,i=!t.get("disabled",!0)&&(!t.get("zoomLock",!0)||"move");u[l+i]>u[l+s]&&(s=i),h&=t.get("preventDefaultMouseMove",!0)})),{controlType:s,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!h}});a.controller.enable(c.controlType,c.opt),a.controller.setPointerChecker(t.containsPoint),V2.createOrUpdate(a,"dispatchAction",t.dataZoomModel.get("throttle",!0),"fixRate")},z2.unregister=function(e,t){var i=H2(e);B2.each(i,(function(e){e.controller.dispose();var i=e.dataZoomInfos;i[t]&&(delete i[t],e.count--)})),U2(i)},z2.generateCoordId=function(e){return e.type+"\0_"+e.id};var j2=l,X2=WQ,Z2=LB,q2=z2,Y2=j2.bind,K2=X2.extend({type:"dataZoom.inside",init:function(e,t){this._range},render:function(e,t,i,n){K2.superApply(this,"render",arguments),this._range=e.getPercentRange(),j2.each(this.getTargetCoordInfo(),(function(t,n){var r=j2.map(t,(function(e){return q2.generateCoordId(e.model)}));j2.each(t,(function(t){var a=t.model,o={};j2.each(["pan","zoom","scrollMove"],(function(e){o[e]=Y2(Q2[e],this,t,n)}),this),q2.register(i,{coordId:q2.generateCoordId(a),allCoordIds:r,containsPoint:function(e,t,i){return a.coordinateSystem.containPoint([t,i])},dataZoomId:e.id,dataZoomModel:e,getRange:o})}),this)}),this)},dispose:function(){q2.unregister(this.api,this.dataZoomModel.id),K2.superApply(this,"dispose",arguments),this._range=null}}),Q2={zoom:function(e,t,i,n){var r=this._range,a=r.slice(),o=e.axisModels[0];if(o){var s=$2[t](null,[n.originX,n.originY],o,i,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return Z2(0,a,[0,100],0,h.minSpan,h.maxSpan),this._range=a,r[0]!==a[0]||r[1]!==a[1]?a:void 0}},pan:J2((function(e,t,i,n,r,a){var o=$2[n]([a.oldX,a.oldY],[a.newX,a.newY],t,r,i);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:J2((function(e,t,i,n,r,a){return $2[n]([0,0],[a.scrollDelta,a.scrollDelta],t,r,i).signal*(e[1]-e[0])*a.scrollDelta}))};function J2(e){return function(t,i,n,r){var a=this._range,o=a.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,i,n,r);return Z2(l,o,[0,100],"all"),this._range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}}}var $2={grid:function(e,t,i,n,r){var a=i.axis,o={},s=r.model.coordinateSystem.getRect();return e=e||[0,0],"x"===a.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,i,n,r){var a=i.axis,o={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===i.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,i,n,r){var a=i.axis,o=r.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===a.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},e3=l,t3=e3.each;function i3(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var n3=function(e){var t=e&&e.visualMap;e3.isArray(t)||(t=t?[t]:[]),t3(t,(function(e){if(e){i3(e,"splitList")&&!i3(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&e3.isArray(t)&&t3(t,(function(e){e3.isObject(e)&&(i3(e,"start")&&!i3(e,"min")&&(e.min=e.start),i3(e,"end")&&!i3(e,"max")&&(e.max=e.end))}))}}))};ud.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var r3=n,a3=l,o3=o$,s3=LR,l3=r3.PRIORITY.VISUAL.COMPONENT;function u3(e,t,i,n){for(var r=t.targetVisuals[n],a=s3.prepareVisualTypes(r),o={color:e.getData().getVisual("color")},s=0,l=a.length;s<l;s++){var u=a[s],h=r["opacity"===u?"__alphaForOpacity":u];h&&h.applyVisual(i,c,d)}return o.color;function c(e){return o[e]}function d(e,t){o[e]=t}}r3.registerVisual(l3,{createOnAllSeries:!0,reset:function(e,t){var i=[];return t.eachComponent("visualMap",(function(t){var n=e.pipelineContext;!t.isTargetSeries(e)||n&&n.large||i.push(o3.incrementalApplyVisual(t.stateList,t.targetVisuals,a3.bind(t.getValueState,t),t.getDataDimension(e.getData())))})),i}}),r3.registerVisual(l3,{createOnAllSeries:!0,reset:function(e,t){var i=e.getData(),n=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var r=t.getVisualMeta(a3.bind(u3,null,e,t))||{stops:[],outerColors:[]},a=t.getDataDimension(i),o=i.getDimensionInfo(a);null!=o&&(r.dimension=o.index,n.push(r))}})),e.getData().setVisual("visualMeta",n)}});var h3=l,c3={get:function(e,t,i){var n=h3.clone((d3[e]||{})[t]);return i&&h3.isArray(n)?n[n.length-1]:n}},d3={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},f3=c3,p3=n,g3=l,m3=s,v3=f3,y3=LR,_3=o$,x3=qa,b3=wc,w3=y3.mapVisual,T3=y3.eachVisual,S3=g3.isArray,M3=g3.each,A3=b3.asc,I3=b3.linearMap,C3=g3.noop,D3=p3.extendComponentModel({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(e,t,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(e,i)},optionUpdated:function(e,t){var i=this.option;m3.canvasSupported||(i.realtime=!1),!t&&_3.replaceVisualOption(i,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(e){var t=this.stateList;e=g3.bind(e,this),this.controllerVisuals=_3.createVisualMappings(this.option.controller,t,e),this.targetVisuals=_3.createVisualMappings(this.option.target,t,e)},getTargetSeriesIndices:function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,i){t.push(i)})):t=x3.normalizeToArray(e),t},eachTargetSeries:function(e,t){g3.each(this.getTargetSeriesIndices(),(function(i){e.call(t,this.ecModel.getSeriesByIndex(i))}),this)},isTargetSeries:function(e){var t=!1;return this.eachTargetSeries((function(i){i===e&&(t=!0)})),t},formatValueText:function(e,t,i){var n,r,a=this.option,o=a.precision,s=this.dataBound,l=a.formatter;return i=i||["<",">"],g3.isArray(e)&&(e=e.slice(),n=!0),r=t?e:n?[u(e[0]),u(e[1])]:u(e),g3.isString(l)?l.replace("{value}",n?r[0]:r).replace("{value2}",n?r[1]:r):g3.isFunction(l)?n?l(e[0],e[1]):l(e):n?e[0]===s[0]?i[0]+" "+r[1]:e[1]===s[1]?i[1]+" "+r[0]:r[0]+" - "+r[1]:r;function u(e){return e===s[0]?"min":e===s[1]?"max":(+e).toFixed(Math.min(o,20))}},resetExtent:function(){var e=this.option,t=A3([e.min,e.max]);this._dataExtent=t},getDataDimension:function(e){var t=this.option.dimension,i=e.dimensions;if(null!=t||i.length){if(null!=t)return e.getDimension(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var a=n[r];if(!e.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var e=this.ecModel,t=this.option,i={inRange:t.inRange,outOfRange:t.outOfRange},n=t.target||(t.target={}),r=t.controller||(t.controller={});g3.merge(n,i),g3.merge(r,i);var a=this.isCategory();function o(i){S3(t.color)&&!i.inRange&&(i.inRange={color:t.color.slice().reverse()}),i.inRange=i.inRange||{color:e.get("gradientColor")},M3(this.stateList,(function(e){var t=i[e];if(g3.isString(t)){var n=v3.get(t,"active",a);n?(i[e]={},i[e][t]=n):delete i[e]}}),this)}o.call(this,n),o.call(this,r),function(e,t,i){var n=e[t],r=e[i];n&&!r&&(r=e[i]={},M3(n,(function(e,t){if(y3.isValidType(t)){var i=v3.get(t,"inactive",a);null!=i&&(r[t]=i,"color"!==t||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}.call(this,n,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,i=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,n=this.get("inactiveColor");M3(this.stateList,(function(r){var o=this.itemSize,s=e[r];s||(s=e[r]={color:a?n:[n]}),null==s.symbol&&(s.symbol=t&&g3.clone(t)||(a?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=i&&g3.clone(i)||(a?o[0]:[o[0],o[0]])),s.symbol=w3(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;T3(l,(function(e){e>u&&(u=e)})),s.symbolSize=w3(l,(function(e){return I3(e,[0,u],[0,o[0]],!0)}))}}),this)}.call(this,r)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:C3,getValueState:C3,getVisualMeta:C3}),E3=D3,L3=l,P3=E3,N3=wc,R3=[20,140],O3=P3.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(e,t){O3.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},resetItemSize:function(){O3.superApply(this,"resetItemSize",arguments);var e=this.itemSize;"horizontal"===this._orient&&e.reverse(),(null==e[0]||isNaN(e[0]))&&(e[0]=R3[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=R3[1])},_resetRange:function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):L3.isArray(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},completeVisualOption:function(){P3.prototype.completeVisualOption.apply(this,arguments),L3.each(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=0)}),this)},setSelected:function(e){this.option.range=e.slice(),this._resetRange()},getSelected:function(){var e=this.getExtent(),t=N3.asc((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},getValueState:function(e){var t=this.option.range,i=this.getExtent();return(t[0]<=i[0]||t[0]<=e)&&(t[1]>=i[1]||e<=t[1])?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],r=i.getData();r.each(this.getDataDimension(r),(function(t,i){e[0]<=t&&t<=e[1]&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getVisualMeta:function(e){var t=k3(this,"outOfRange",this.getExtent()),i=k3(this,"inRange",this.option.range.slice()),n=[];function r(t,i){n.push({value:t,color:e(t,i)})}for(var a=0,o=0,s=i.length,l=t.length;o<l&&(!i.length||t[o]<=i[0]);o++)t[o]<i[a]&&r(t[o],"outOfRange");for(var u=1;a<s;a++,u=0)u&&n.length&&r(i[a],"outOfRange"),r(i[a],"inRange");for(u=1;o<l;o++)(!i.length||i[i.length-1]<t[o])&&(u&&(n.length&&r(n[n.length-1].value,"outOfRange"),u=0),r(t[o],"outOfRange"));var h=n.length;return{stops:n,outerColors:[h?n[0].color:"transparent",h?n[h-1].color:"transparent"]}}});function k3(e,t,i){if(i[0]===i[1])return i.slice();for(var n=(i[1]-i[0])/200,r=i[0],a=[],o=0;o<=200&&r<i[1];o++)a.push(r),r+=n;return a.push(i[1]),a}var z3=l,B3=yo,F3=Ac,V3=bc,G3=LR,H3=n.extendComponentView({type:"visualMap",autoPositionValues:{left:1,right:1,top:1,bottom:1},init:function(e,t){this.ecModel=e,this.api=t,this.visualMapModel},render:function(e,t,i,n){this.visualMapModel=e,!1!==e.get("show")?this.doRender.apply(this,arguments):this.group.removeAll()},renderBackground:function(e){var t=this.visualMapModel,i=F3.normalizeCssArray(t.get("padding")||0),n=e.getBoundingRect();e.add(new B3.Rect({z2:-1,silent:!0,shape:{x:n.x-i[3],y:n.y-i[0],width:n.width+i[3]+i[1],height:n.height+i[0]+i[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},getControllerVisual:function(e,t,i){var n=(i=i||{}).forceState,r=this.visualMapModel,a={};if("symbol"===t&&(a.symbol=r.get("itemSymbol")),"color"===t){var o=r.get("contentColor");a.color=o}function s(e){return a[e]}function l(e,t){a[e]=t}var u=r.controllerVisuals[n||r.getValueState(e)],h=G3.prepareVisualTypes(u);return z3.each(h,(function(n){var r=u[n];i.convertOpacityToAlpha&&"opacity"===n&&(n="colorAlpha",r=u.__alphaForOpacity),G3.dependsOn(n,t)&&r&&r.applyVisual(e,s,l)})),a[t]},positionGroup:function(e){var t=this.visualMapModel,i=this.api;V3.positionElement(e,t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},doRender:z3.noop}),U3={},W3=l,j3=bc.getLayoutRect;U3.getItemAlign=function(e,t,i){var n=e.option,r=n.align;if(null!=r&&"auto"!==r)return r;for(var a={width:t.getWidth(),height:t.getHeight()},o="horizontal"===n.orient?1:0,s=[["left","right","width"],["top","bottom","height"]],l=s[o],u=[0,null,10],h={},c=0;c<3;c++)h[s[1-o][c]]=u[c],h[l[c]]=2===c?i[0]:n[l[c]];var d=[["x","width",3],["y","height",0]][o],f=j3(h,a,n.padding);return l[(f.margin[d[2]]||0)+f[d[0]]+.5*f[d[1]]<.5*a[d[1]]?0:1]},U3.makeHighDownBatch=function(e,t){return W3.each(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e};var X3=l,Z3=Eu,q3=Y,Y3=H3,K3=yo,Q3=LB,J3=U3,$3=qa,e5=wc.linearMap,t5=X3.each,i5=Math.min,n5=Math.max,r5=Y3.extend({type:"visualMap.continuous",init:function(){r5.superApply(this,"init",arguments),this._shapes={},this._dataInterval=[],this._handleEnds=[],this._orient,this._useHandle,this._hoverLinkDataIndices=[],this._dragging,this._hovering},doRender:function(e,t,i,n){n&&"selectDataRange"===n.type&&n.from===this.uid||this._buildView()},_buildView:function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var i=e.get("text");this._renderEndsText(t,i,0),this._renderEndsText(t,i,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},_renderEndsText:function(e,t,i){if(t){var n=t[1-i];n=null!=n?n+"":"";var r=this.visualMapModel,a=r.get("textGap"),o=r.itemSize,s=this._shapes.barGroup,l=this._applyTransform([o[0]/2,0===i?-a:o[1]+a],s),u=this._applyTransform(0===i?"bottom":"top",s),h=this._orient,c=this.visualMapModel.textStyleModel;this.group.add(new K3.Text({style:{x:l[0],y:l[1],textVerticalAlign:"horizontal"===h?"middle":u,textAlign:"horizontal"===h?u:"center",text:n,textFont:c.getFont(),textFill:c.getTextColor()}}))}},_renderBar:function(e){var t=this.visualMapModel,i=this._shapes,n=t.itemSize,r=this._orient,a=this._useHandle,o=J3.getItemAlign(t,this.api,n),s=i.barGroup=this._createBarGroup(o);s.add(i.outOfRange=a5()),s.add(i.inRange=a5(null,a?s5(this._orient):null,X3.bind(this._dragHandle,this,"all",!1),X3.bind(this._dragHandle,this,"all",!0)));var l=t.textStyleModel.getTextRect("国"),u=n5(l.width,l.height);a&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(s,0,n,u,r,o),this._createHandle(s,1,n,u,r,o)),this._createIndicator(s,n,u,r),e.add(s)},_createHandle:function(e,t,i,n,r){var a=X3.bind(this._dragHandle,this,t,!1),o=X3.bind(this._dragHandle,this,t,!0),s=a5(function(e,t){return 0===e?[[0,0],[t,0],[t,-t]]:[[0,0],[t,0],[t,t]]}(t,n),s5(this._orient),a,o);s.position[0]=i[0],e.add(s);var l=this.visualMapModel.textStyleModel,u=new K3.Text({draggable:!0,drift:a,onmousemove:function(e){q3.stop(e.event)},ondragend:o,style:{x:0,y:0,text:"",textFont:l.getFont(),textFill:l.getTextColor()}});this.group.add(u);var h=["horizontal"===r?n/2:1.5*n,"horizontal"===r?0===t?-1.5*n:1.5*n:0===t?-n/2:n/2],c=this._shapes;c.handleThumbs[t]=s,c.handleLabelPoints[t]=h,c.handleLabels[t]=u},_createIndicator:function(e,t,i,n){var r=a5([[0,0]],"move");r.position[0]=t[0],r.attr({invisible:!0,silent:!0}),e.add(r);var a=this.visualMapModel.textStyleModel,o=new K3.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textFont:a.getFont(),textFill:a.getTextColor()}});this.group.add(o);var s=["horizontal"===n?i/2:9,0],l=this._shapes;l.indicator=r,l.indicatorLabel=o,l.indicatorLabelPoint=s},_dragHandle:function(e,t,i,n){if(this._useHandle){if(this._dragging=!t,!t){var r=this._applyTransform([i,n],this._shapes.barGroup,!0);this._updateInterval(e,r[1]),this._updateView()}t===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?!this._hovering&&this._clearHoverLinkToSeries():o5(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},_resetInterval:function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),i=e.getExtent(),n=[0,e.itemSize[1]];this._handleEnds=[e5(t[0],i,n,!0),e5(t[1],i,n,!0)]},_updateInterval:function(e,t){t=t||0;var i=this.visualMapModel,n=this._handleEnds,r=[0,i.itemSize[1]];Q3(t,n,r,e,0);var a=i.getExtent();this._dataInterval=[e5(n[0],r,a,!0),e5(n[1],r,a,!0)]},_updateView:function(e){var t=this.visualMapModel,i=t.getExtent(),n=this._shapes,r=[0,t.itemSize[1]],a=e?r:this._handleEnds,o=this._createBarVisual(this._dataInterval,i,a,"inRange"),s=this._createBarVisual(i,i,r,"outOfRange");n.inRange.setStyle({fill:o.barColor,opacity:o.opacity}).setShape("points",o.barPoints),n.outOfRange.setStyle({fill:s.barColor,opacity:s.opacity}).setShape("points",s.barPoints),this._updateHandle(a,o)},_createBarVisual:function(e,t,i,n){var r={forceState:n,convertOpacityToAlpha:!0},a=this._makeColorGradient(e,r),o=[this.getControllerVisual(e[0],"symbolSize",r),this.getControllerVisual(e[1],"symbolSize",r)],s=this._createBarPoints(i,o);return{barColor:new Z3(0,0,0,1,a),barPoints:s,handlesColor:[a[0].color,a[a.length-1].color]}},_makeColorGradient:function(e,t){var i=[],n=(e[1]-e[0])/100;i.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var r=1;r<100;r++){var a=e[0]+n*r;if(a>e[1])break;i.push({color:this.getControllerVisual(a,"color",t),offset:r/100})}return i.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),i},_createBarPoints:function(e,t){var i=this.visualMapModel.itemSize;return[[i[0]-t[0],e[0]],[i[0],e[0]],[i[0],e[1]],[i[0]-t[1],e[1]]]},_createBarGroup:function(e){var t=this._orient,i=this.visualMapModel.get("inverse");return new K3.Group("horizontal"!==t||i?"horizontal"===t&&i?{scale:"bottom"===e?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==t||i?{scale:"left"===e?[1,1]:[-1,1]}:{scale:"left"===e?[1,-1]:[-1,-1]}:{scale:"bottom"===e?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(e,t){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,r=i.handleThumbs,a=i.handleLabels;t5([0,1],(function(o){var s=r[o];s.setStyle("fill",t.handlesColor[o]),s.position[1]=e[o];var l=K3.applyTransform(i.handleLabelPoints[o],K3.getTransform(s,this.group));a[o].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[o]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===o?"bottom":"top":"left",i.barGroup)})}),this)}},_showIndicator:function(e,t,i,n){var r=this.visualMapModel,a=r.getExtent(),o=r.itemSize,s=[0,o[1]],l=e5(e,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(e,t,i,n){return e?[[0,-i5(t,n5(i,0))],[6,0],[0,i5(t,n5(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,o[1]));var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=K3.applyTransform(u.indicatorLabelPoint,K3.getTransform(h,this.group)),f=u.indicatorLabel;f.attr("invisible",!1);var p=this._applyTransform("left",u.barGroup),g=this._orient;f.setStyle({text:(i||"")+r.formatValueText(t),textVerticalAlign:"horizontal"===g?p:"middle",textAlign:"horizontal"===g?"center":p,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var e=this;this._shapes.barGroup.on("mousemove",(function(t){if(e._hovering=!0,!e._dragging){var i=e.visualMapModel.itemSize,n=e._applyTransform([t.offsetX,t.offsetY],e._shapes.barGroup,!0,!0);n[1]=i5(n5(0,n[1]),i[1]),e._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}})).on("mouseout",(function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()}))},_enableHoverLinkFromSeries:function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(e,t){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var r=[0,n[1]],a=i.getExtent();e=i5(n5(r[0],e),r[1]);var o=function(e,t,i){var n=6,r=e.get("hoverLinkDataSize");r&&(n=e5(r,t,i,!0)/2);return n}(i,a,r),s=[e-o,e+o],l=e5(e,r,a,!0),u=[e5(s[0],r,a,!0),e5(s[1],r,a,!0)];s[0]<r[0]&&(u[0]=-1/0),s[1]>r[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",o):u[1]===1/0?this._showIndicator(l,u[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var h=this._hoverLinkDataIndices,c=[];(t||o5(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=$3.compressBatches(h,c);this._dispatchHighDown("downplay",J3.makeHighDownBatch(d[0],i)),this._dispatchHighDown("highlight",J3.makeHighDownBatch(d[1],i))}},_hoverLinkFromSeriesMouseOver:function(e){var t=e.target,i=this.visualMapModel;if(t&&null!=t.dataIndex){var n=this.ecModel.getSeriesByIndex(t.seriesIndex);if(i.isTargetSeries(n)){var r=n.getData(t.dataType),a=r.get(i.getDataDimension(r),t.dataIndex,!0);isNaN(a)||this._showIndicator(a,a)}}},_hideIndicator:function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",J3.makeHighDownBatch(e,this.visualMapModel)),e.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},_applyTransform:function(e,t,i,n){var r=K3.getTransform(t,n?null:this.group);return K3[X3.isArray(e)?"applyTransform":"transformDirection"](e,r,i)},_dispatchHighDown:function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});function a5(e,t,i,n){return new K3.Polygon({shape:{points:e},draggable:!!i,cursor:t,drift:i,onmousemove:function(e){q3.stop(e.event)},ondragend:n})}function o5(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function s5(e){return"vertical"===e?"ns-resize":"ew-resize"}n.registerAction({type:"selectDataRange",event:"dataRangeSelected",update:"update"},(function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))})),n.registerPreprocessor(n3);var l5=l,u5=E3,h5=LR,c5=f3,d5=wc.reformIntervals,f5=u5.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(e,t){f5.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var i=this._mode=this._determineMode();p5[this._mode].call(this),this._resetSelected(e,t);var n=this.option.categories;this.resetVisual((function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=l5.clone(n)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=l5.map(this._pieceList,(function(e){e=l5.clone(e);return"inRange"!==t&&(e.visual=null),e})))}))},completeVisualOption:function(){var e=this.option,t={},i=h5.listVisualTypes(),n=this.isCategory();function r(e,t,i){return e&&e[t]&&(l5.isObject(e[t])?e[t].hasOwnProperty(i):e[t]===i)}l5.each(e.pieces,(function(e){l5.each(i,(function(i){e.hasOwnProperty(i)&&(t[i]=1)}))})),l5.each(t,(function(t,i){var a=0;l5.each(this.stateList,(function(t){a|=r(e,t,i)||r(e.target,t,i)}),this),!a&&l5.each(this.stateList,(function(t){(e[t]||(e[t]={}))[i]=c5.get(i,"inRange"===t?"active":"inactive",n)}))}),this),u5.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(e,t){var i=this.option,n=this._pieceList,r=(t?i:e).selected||{};if(i.selected=r,l5.each(n,(function(e,t){var i=this.getSelectedMapKey(e);r.hasOwnProperty(i)||(r[i]=!0)}),this),"single"===i.selectedMode){var a=!1;l5.each(n,(function(e,t){var i=this.getSelectedMapKey(e);r[i]&&(a?r[i]=!1:a=!0)}),this)}},getSelectedMapKey:function(e){return"categories"===this._mode?e.value+"":e.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(e){this.option.selected=l5.clone(e)},getValueState:function(e){var t=h5.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],r=i.getData();r.each(this.getDataDimension(r),(function(t,i){h5.findPieceIndex(t,this._pieceList)===e&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getRepresentValue:function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var i=e.interval||[];t=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return t},getVisualMeta:function(e){if(!this.isCategory()){var t=[],i=[],n=this,r=this._pieceList.slice();if(r.length){var a=r[0].interval[0];a!==-1/0&&r.unshift({interval:[-1/0,a]}),(a=r[r.length-1].interval[1])!==1/0&&r.push({interval:[a,1/0]})}else r.push({interval:[-1/0,1/0]});var o=-1/0;return l5.each(r,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:i}}function s(r,a){var o=n.getRepresentValue({interval:r});a||(a=n.getValueState(o));var s=e(o,a);r[0]===-1/0?i[0]=s:r[1]===1/0?i[1]=s:t.push({value:r[0],color:s},{value:r[1],color:s})}}}),p5={splitNumber:function(){var e=this.option,t=this._pieceList,i=Math.min(e.precision,20),n=this.getExtent(),r=e.splitNumber;r=Math.max(parseInt(r,10),1),e.splitNumber=r;for(var a=(n[1]-n[0])/r;+a.toFixed(i)!==a&&i<5;)i++;e.precision=i,a=+a.toFixed(i),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o<r;s+=a,o++){var l=o===r-1?n[1]:s+a;t.push({interval:[s,l],close:[1,1]})}e.maxOpen&&t.push({interval:[n[1],1/0],close:[0,0]}),d5(t),l5.each(t,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(){var e=this.option;l5.each(e.categories,(function(e){this._pieceList.push({text:this.formatValueText(e,!0),value:e})}),this),g5(e,this._pieceList)},pieces:function(){var e=this.option,t=this._pieceList;l5.each(e.pieces,(function(e,i){l5.isObject(e)||(e={value:e});var n={text:"",index:i};if(null!=e.label&&(n.text=e.label),e.hasOwnProperty("value")){var r=n.value=e.value;n.interval=[r,r],n.close=[1,1]}else{for(var a=n.interval=[],o=n.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],h=0;h<2;h++){for(var c=[["gte","gt","min"],["lte","lt","max"]][h],d=0;d<3&&null==a[h];d++)a[h]=e[c[d]],o[h]=s[d],u[h]=2===d;null==a[h]&&(a[h]=l[h])}u[0]&&a[1]===1/0&&(o[0]=0),u[1]&&a[0]===-1/0&&(o[1]=0),a[0]===a[1]&&o[0]&&o[1]&&(n.value=a[0])}n.visual=h5.retrieveVisuals(e),t.push(n)}),this),g5(e,t),d5(t),l5.each(t,(function(e){var t=e.close,i=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,i)}),this)}};function g5(e,t){var i=e.inverse;("vertical"===e.orient?!i:i)&&t.reverse()}var m5=l,v5=H3,y5=yo,_5=Ab.createSymbol,x5=bc,b5=U3;v5.extend({type:"visualMap.piecewise",doRender:function(){var e=this.group;e.removeAll();var t=this.visualMapModel,i=t.get("textGap"),n=t.textStyleModel,r=n.getFont(),a=n.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,h=m5.retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,h,o),m5.each(l.viewPieceList,(function(n){var l=n.piece,u=new y5.Group;u.onclick=m5.bind(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=t.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new y5.Text({style:{x:"right"===o?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:o,textFont:r,textFill:a,opacity:"outOfRange"===d?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,h,o),x5.box(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},_enableHoverLink:function(e,t){function i(e){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:e,batch:b5.makeHighDownBatch(i.findTargetDataIndices(t),i)})}e.on("mouseover",m5.bind(i,this,"highlight")).on("mouseout",m5.bind(i,this,"downplay"))},_getItemAlign:function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return b5.getItemAlign(e,this.api,e.itemSize);var i=t.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(e,t,i,n,r){if(t){var a=new y5.Group,o=this.visualMapModel.textStyleModel;a.add(new y5.Text({style:{x:n?"right"===r?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?r:"center",text:t,textFont:o.getFont(),textFill:o.getTextColor()}})),e.add(a)}},_getViewData:function(){var e=this.visualMapModel,t=m5.map(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),i=e.get("text"),n=e.get("orient"),r=e.get("inverse");return("horizontal"===n?r:!r)?t.reverse():i&&(i=i.slice().reverse()),{viewPieceList:t,endsText:i}},_createItemSymbol:function(e,t,i){e.add(_5(this.getControllerVisual(t,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(t,"color")))},_onItemClick:function(e){var t=this.visualMapModel,i=t.option,n=m5.clone(i.selected),r=t.getSelectedMapKey(e);"single"===i.selectedMode?(n[r]=!0,m5.each(n,(function(e,t){n[t]=t===r}))):n[r]=!n[r],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}}),n.registerPreprocessor(n3);var w5,T5={},S5=s,M5="urn:schemas-microsoft-com:vml",A5="undefined"==typeof window?null:window,I5=!1,C5=A5&&A5.document;if(C5&&!S5.canvasSupported)try{!C5.namespaces.zrvml&&C5.namespaces.add("zrvml",M5),w5=function(e){return C5.createElement("<zrvml:"+e+' class="zrvml">')}}catch(n8){w5=function(e){return C5.createElement("<"+e+' xmlns="'+M5+'" class="zrvml">')}}T5.doc=C5,T5.createNode=function(e){return w5(e)},T5.initVML=function(){if(!I5&&C5){I5=!0;var e=C5.styleSheets;e.length<31?C5.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):e[0].addRule(".zrvml","behavior:url(#default#VML)")}};var D5=s,E5=P.applyTransform,L5=wi,P5=$e,N5=fn,R5=dn,O5=Ir,k5=Nr,z5=Fr,B5=Tl,F5=Ys,V5=ds,G5=Au,H5=T5,U5=V5.CMD,W5=Math.round,j5=Math.sqrt,X5=Math.abs,Z5=Math.cos,q5=Math.sin,Y5=Math.max;if(!D5.canvasSupported){var K5=21600,Q5=K5/2,J5=function(e){e.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",e.coordsize=K5+","+K5,e.coordorigin="0,0"},$5=function(e,t,i){return"rgb("+[e,t,i].join(",")+")"},e4=function(e,t){t&&e&&t.parentNode!==e&&e.appendChild(t)},t4=function(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)},i4=function(e,t,i){return 1e5*(parseFloat(e)||0)+1e3*(parseFloat(t)||0)+i},n4=R5.parsePercent,r4=function(e,t,i){var n=P5.parse(t);i=+i,isNaN(i)&&(i=1),n&&(e.color=$5(n[0],n[1],n[2]),e.opacity=i*n[3])},a4=function(e){var t=P5.parse(e);return[$5(t[0],t[1],t[2]),t[3]]},o4=function(e,t,i,n){var r="fill"===t,a=e.getElementsByTagName(t)[0];null!=i[t]&&"none"!==i[t]&&(r||!r&&i.lineWidth)?(e[r?"filled":"stroked"]="true",i[t]instanceof G5&&t4(e,a),a||(a=H5.createNode(t)),r?function(e,t,i){var n=t.fill;if(null!=n)if(n instanceof G5){var r,a=0,o=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){r="gradient";var d=i.transform,f=[n.x*h,n.y*c],p=[n.x2*h,n.y2*c];d&&(E5(f,f,d),E5(p,p,d));var g=p[0]-f[0],m=p[1]-f[1];(a=180*Math.atan2(g,m)/Math.PI)<0&&(a+=360),a<1e-6&&(a=0)}else{r="gradientradial",f=[n.x*h,n.y*c],d=i.transform;var v=i.scale,y=h,_=c;o=[(f[0]-u.x)/y,(f[1]-u.y)/_],d&&E5(f,f,d),y/=v[0]*K5,_/=v[1]*K5;var x=Y5(y,_);s=0/x,l=2*n.r/x-s}var b=n.colorStops.slice();b.sort((function(e,t){return e.offset-t.offset}));for(var w=b.length,T=[],S=[],M=0;M<w;M++){var A=b[M],I=a4(A.color);S.push(A.offset*l+s+" "+I[0]),0!==M&&M!==w-1||T.push(I)}if(w>=2){var C=T[0][0],D=T[1][0],E=T[0][1]*t.opacity,L=T[1][1]*t.opacity;e.type=r,e.method="none",e.focus="100%",e.angle=a,e.color=C,e.color2=D,e.colors=S.join(","),e.opacity=L,e.opacity2=E}"radial"===r&&(e.focusposition=o.join(","))}else r4(e,n,t.opacity)}(a,i,n):function(e,t){t.lineDash&&(e.dashstyle=t.lineDash.join(" ")),null==t.stroke||t.stroke instanceof G5||r4(e,t.stroke,t.opacity)}(a,i),e4(e,a)):(e[r?"filled":"stroked"]="false",t4(e,a))},s4=[[],[],[]];F5.prototype.brushVML=function(e){var t=this.style,i=this._vmlEl;i||(i=H5.createNode("shape"),J5(i),this._vmlEl=i),o4(i,"fill",t,this),o4(i,"stroke",t,this);var n=this.transform,r=null!=n,a=i.getElementsByTagName("stroke")[0];if(a){var o=t.lineWidth;if(r&&!t.strokeNoScale){var s=n[0]*n[3]-n[1]*n[2];o*=j5(X5(s))}a.weight=o+"px"}var l=this.path||(this.path=new V5);this.__dirtyPath&&(l.beginPath(),l.subPixelOptimize=!1,this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),i.path=function(e,t){var i,n,r,a,o,s,l=U5.M,u=U5.C,h=U5.L,c=U5.A,d=U5.Q,f=[],p=e.data,g=e.len();for(a=0;a<g;){switch(n="",i=0,r=p[a++]){case l:n=" m ",i=1,o=p[a++],s=p[a++],s4[0][0]=o,s4[0][1]=s;break;case h:n=" l ",i=1,o=p[a++],s=p[a++],s4[0][0]=o,s4[0][1]=s;break;case d:case u:n=" c ",i=3;var m,v,y=p[a++],_=p[a++],x=p[a++],b=p[a++];r===d?(m=x,v=b,x=(x+2*y)/3,b=(b+2*_)/3,y=(o+2*y)/3,_=(s+2*_)/3):(m=p[a++],v=p[a++]),s4[0][0]=y,s4[0][1]=_,s4[1][0]=x,s4[1][1]=b,s4[2][0]=m,s4[2][1]=v,o=m,s=v;break;case c:var w=0,T=0,S=1,M=1,A=0;t&&(w=t[4],T=t[5],S=j5(t[0]*t[0]+t[1]*t[1]),M=j5(t[2]*t[2]+t[3]*t[3]),A=Math.atan2(-t[1]/M,t[0]/S));var I=p[a++],C=p[a++],D=p[a++],E=p[a++],L=p[a++]+A,P=p[a++]+L+A;a++;var N=p[a++],R=I+Z5(L)*D,O=C+q5(L)*E,k=(y=I+Z5(P)*D,_=C+q5(P)*E,N?" wa ":" at ");Math.abs(R-y)<1e-4&&(Math.abs(P-L)>.01?N&&(R+=270/K5):Math.abs(O-C)<1e-4?N&&R<I||!N&&R>I?_-=270/K5:_+=270/K5:N&&O<C||!N&&O>C?y+=270/K5:y-=270/K5),f.push(k,W5(((I-D)*S+w)*K5-Q5),",",W5(((C-E)*M+T)*K5-Q5),",",W5(((I+D)*S+w)*K5-Q5),",",W5(((C+E)*M+T)*K5-Q5),",",W5((R*S+w)*K5-Q5),",",W5((O*M+T)*K5-Q5),",",W5((y*S+w)*K5-Q5),",",W5((_*M+T)*K5-Q5)),o=y,s=_;break;case U5.R:var z=s4[0],B=s4[1];z[0]=p[a++],z[1]=p[a++],B[0]=z[0]+p[a++],B[1]=z[1]+p[a++],t&&(E5(z,z,t),E5(B,B,t)),z[0]=W5(z[0]*K5-Q5),B[0]=W5(B[0]*K5-Q5),z[1]=W5(z[1]*K5-Q5),B[1]=W5(B[1]*K5-Q5),f.push(" m ",z[0],",",z[1]," l ",B[0],",",z[1]," l ",B[0],",",B[1]," l ",z[0],",",B[1]);break;case U5.Z:f.push(" x ")}if(i>0){f.push(n);for(var F=0;F<i;F++){var V=s4[F];t&&E5(V,V,t),f.push(W5(V[0]*K5-Q5),",",W5(V[1]*K5-Q5),F<i-1?",":"")}}}return f.join("")}(l,this.transform),i.style.zIndex=i4(this.zlevel,this.z,this.z2),e4(e,i),null!=t.text?this.drawRectText(e,this.getBoundingRect()):this.removeRectText(e)},F5.prototype.onRemove=function(e){t4(e,this._vmlEl),this.removeRectText(e)},F5.prototype.onAdd=function(e){e4(e,this._vmlEl),this.appendRectText(e)};z5.prototype.brushVML=function(e){var t,i,n,r=this.style,a=r.image;if("object"==typeof(n=a)&&n.tagName&&"IMG"===n.tagName.toUpperCase()){var o=a.src;if(o===this._imageSrc)t=this._imageWidth,i=this._imageHeight;else{var s=a.runtimeStyle,l=s.width,u=s.height;s.width="auto",s.height="auto",t=a.width,i=a.height,s.width=l,s.height=u,this._imageSrc=o,this._imageWidth=t,this._imageHeight=i}a=o}else a===this._imageSrc&&(t=this._imageWidth,i=this._imageHeight);if(a){var h=r.x||0,c=r.y||0,d=r.width,f=r.height,p=r.sWidth,g=r.sHeight,m=r.sx||0,v=r.sy||0,y=p&&g,_=this._vmlEl;_||(_=H5.doc.createElement("div"),J5(_),this._vmlEl=_);var x,b=_.style,w=!1,T=1,S=1;if(this.transform&&(x=this.transform,T=j5(x[0]*x[0]+x[1]*x[1]),S=j5(x[2]*x[2]+x[3]*x[3]),w=x[1]||x[2]),w){var M=[h,c],A=[h+d,c],I=[h,c+f],C=[h+d,c+f];E5(M,M,x),E5(A,A,x),E5(I,I,x),E5(C,C,x);var D=Y5(M[0],A[0],I[0],C[0]),E=Y5(M[1],A[1],I[1],C[1]),L=[];L.push("M11=",x[0]/T,",","M12=",x[2]/S,",","M21=",x[1]/T,",","M22=",x[3]/S,",","Dx=",W5(h*T+x[4]),",","Dy=",W5(c*S+x[5])),b.padding="0 "+W5(D)+"px "+W5(E)+"px 0",b.filter="progid:DXImageTransform.Microsoft.Matrix("+L.join("")+", SizingMethod=clip)"}else x&&(h=h*T+x[4],c=c*S+x[5]),b.filter="",b.left=W5(h)+"px",b.top=W5(c)+"px";var P=this._imageEl,N=this._cropEl;P||(P=H5.doc.createElement("div"),this._imageEl=P);var R=P.style;if(y){if(t&&i)R.width=W5(T*t*d/p)+"px",R.height=W5(S*i*f/g)+"px";else{var O=new Image,k=this;O.onload=function(){O.onload=null,t=O.width,i=O.height,R.width=W5(T*t*d/p)+"px",R.height=W5(S*i*f/g)+"px",k._imageWidth=t,k._imageHeight=i,k._imageSrc=a},O.src=a}N||((N=H5.doc.createElement("div")).style.overflow="hidden",this._cropEl=N);var z=N.style;z.width=W5((d+m*d/p)*T),z.height=W5((f+v*f/g)*S),z.filter="progid:DXImageTransform.Microsoft.Matrix(Dx="+-m*d/p*T+",Dy="+-v*f/g*S+")",N.parentNode||_.appendChild(N),P.parentNode!==N&&N.appendChild(P)}else R.width=W5(T*d)+"px",R.height=W5(S*f)+"px",_.appendChild(P),N&&N.parentNode&&(_.removeChild(N),this._cropEl=null);var B="",F=r.opacity;F<1&&(B+=".Alpha(opacity="+W5(100*F)+") "),B+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+a+", SizingMethod=scale)",R.filter=B,_.style.zIndex=i4(this.zlevel,this.z,this.z2),e4(e,_),null!=r.text&&this.drawRectText(e,this.getBoundingRect())}},z5.prototype.onRemove=function(e){t4(e,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(e)},z5.prototype.onAdd=function(e){e4(e,this._vmlEl),this.appendRectText(e)};var l4,u4={},h4=0,c4=document.createElement("div");N5.$override("measureText",(function(e,t){var i=H5.doc;l4||((l4=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",H5.doc.body.appendChild(l4));try{l4.style.font=t}catch(n){}return l4.innerHTML="",l4.appendChild(i.createTextNode(e)),{width:l4.offsetWidth}}));for(var d4=new L5,f4=function(e,t,i,n){var r=this.style;this.__dirty&&R5.normalizeTextStyle(r,!0);var a=r.text;if(null!=a&&(a+=""),a){if(r.rich){var o=N5.parseRichText(a,r);a=[];for(var s=0;s<o.lines.length;s++){for(var l=o.lines[s].tokens,u=[],h=0;h<l.length;h++)u.push(l[h].text);a.push(u.join(""))}a=a.join("\n")}var c,d,f=r.textAlign,p=r.textVerticalAlign,g=function(e){var t=u4[e];if(!t){h4>100&&(h4=0,u4={});var i,n=c4.style;try{n.font=e,i=n.fontFamily.split(",")[0]}catch(n8){}t={style:n.fontStyle||"normal",variant:n.fontVariant||"normal",weight:n.fontWeight||"normal",size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},u4[e]=t,h4++}return t}(r.font),m=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';i=i||N5.getBoundingRect(a,m,f,p,r.textPadding,r.textLineHeight);var v=this.transform;if(v&&!n&&(d4.copy(t),d4.applyTransform(v),t=d4),n)c=t.x,d=t.y;else{var y=r.textPosition;if(y instanceof Array)c=t.x+n4(y[0],t.width),d=t.y+n4(y[1],t.height),f=f||"left";else{var _=this.calculateTextPosition?this.calculateTextPosition({},r,t):N5.calculateTextPosition({},r,t);c=_.x,d=_.y,f=f||_.textAlign,p=p||_.textVerticalAlign}}c=N5.adjustTextX(c,i.width,f),d=N5.adjustTextY(d,i.height,p),d+=i.height/2;var x,b,w,T=H5.createNode,S=this._textVmlEl;S?b=(x=(w=S.firstChild).nextSibling).nextSibling:(S=T("line"),x=T("path"),b=T("textpath"),w=T("skew"),b.style["v-text-align"]="left",J5(S),x.textpathok=!0,b.on=!0,S.from="0 0",S.to="1000 0.05",e4(S,w),e4(S,x),e4(S,b),this._textVmlEl=S);var M=[c,d],A=S.style;v&&n?(E5(M,M,v),w.on=!0,w.matrix=v[0].toFixed(3)+","+v[2].toFixed(3)+","+v[1].toFixed(3)+","+v[3].toFixed(3)+",0,0",w.offset=(W5(M[0])||0)+","+(W5(M[1])||0),w.origin="0 0",A.left="0px",A.top="0px"):(w.on=!1,A.left=W5(c)+"px",A.top=W5(d)+"px"),b.string=String(a).replace(/&/g,"&").replace(/"/g,""");try{b.style.font=m}catch(n8){}o4(S,"fill",{fill:r.textFill,opacity:r.opacity},this),o4(S,"stroke",{stroke:r.textStroke,opacity:r.opacity,lineDash:r.lineDash||null},this),S.style.zIndex=i4(this.zlevel,this.z,this.z2),e4(e,S)}},p4=function(e){t4(e,this._textVmlEl),this._textVmlEl=null},g4=function(e){e4(e,this._textVmlEl)},m4=[O5,k5,z5,F5,B5],v4=0;v4<m4.length;v4++){var y4=m4[v4].prototype;y4.drawRectText=f4,y4.removeRectText=p4,y4.appendRectText=g4}B5.prototype.brushVML=function(e){var t=this.style;null!=t.text?this.drawRectText(e,{x:t.x||0,y:t.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(e)},B5.prototype.onRemove=function(e){this.removeRectText(e)},B5.prototype.onAdd=function(e){this.appendRectText(e)}}var _4=Zt,x4=T5,b4=l.each;function w4(e){return parseInt(e,10)}function T4(e,t){x4.initVML(),this.root=e,this.storage=t;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",e.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var r=t.delFromStorage,a=t.addToStorage;t.delFromStorage=function(e){r.call(t,e),e&&e.onRemove&&e.onRemove(n)},t.addToStorage=function(e){e.onAdd&&e.onAdd(n),a.call(t,e)},this._firstPaint=!0}T4.prototype={constructor:T4,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0,!0);this._paintList(e)},_paintList:function(e){for(var t=this._vmlRoot,i=0;i<e.length;i++){var n=e[i];n.invisible||n.ignore?(n.__alreadyNotVisible||n.onRemove(t),n.__alreadyNotVisible=!0):(n.__alreadyNotVisible&&n.onAdd(t),n.__alreadyNotVisible=!1,n.__dirty&&(n.beforeBrush&&n.beforeBrush(),(n.brushVML||n.brush).call(n,t),n.afterBrush&&n.afterBrush())),n.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(t),this._firstPaint=!1)},resize:function(e,t){e=null==e?this._getWidth():e,t=null==t?this._getHeight():t;if(this._width!==e||this._height!==t){this._width=e,this._height=t;var i=this._vmlViewport.style;i.width=e+"px",i.height=t+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var e=this.root,t=e.currentStyle;return(e.clientWidth||w4(t.width))-w4(t.paddingLeft)-w4(t.paddingRight)|0},_getHeight:function(){var e=this.root,t=e.currentStyle;return(e.clientHeight||w4(t.height))-w4(t.paddingTop)-w4(t.paddingBottom)|0}},b4(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],(function(e){var t;T4.prototype[e]=(t=e,function(){_4('In IE8.0 VML mode painter not support method "'+t+'"')})}));var S4=T4;(0,r.registerPainter)("vml",S4);var M4={},A4={};A4.createElement=function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)};var I4=A4.createElement,C4=wi,D4=Re,E4=fn,L4=dn,P4=Tl,N4=ds.CMD,R4=Array.prototype.join,O4=Math.round,k4=Math.sin,z4=Math.cos,B4=Math.PI,F4=2*Math.PI,V4=180/B4;function G4(e){return O4(1e4*e)/1e4}function H4(e){return e<1e-4&&e>-1e-4}function U4(e,t){t&&W4(e,"transform","matrix("+R4.call(t,",")+")")}function W4(e,t,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&e.setAttribute(t,i)}function j4(e,t,i,n){if(function(e,t){var i=t?e.textFill:e.fill;return null!=i&&"none"!==i}(t,i)){var r=i?t.textFill:t.fill;W4(e,"fill",r="transparent"===r?"none":r),W4(e,"fill-opacity",null!=t.fillOpacity?t.fillOpacity*t.opacity:t.opacity)}else W4(e,"fill","none");if(function(e,t){var i=t?e.textStroke:e.stroke;return null!=i&&"none"!==i}(t,i)){var a=i?t.textStroke:t.stroke;W4(e,"stroke",a="transparent"===a?"none":a),W4(e,"stroke-width",(i?t.textStrokeWidth:t.lineWidth)/(!i&&t.strokeNoScale?n.getLineScale():1)),W4(e,"paint-order",i?"stroke":"fill"),W4(e,"stroke-opacity",null!=t.strokeOpacity?t.strokeOpacity:t.opacity),t.lineDash?(W4(e,"stroke-dasharray",t.lineDash.join(",")),W4(e,"stroke-dashoffset",O4(t.lineDashOffset||0))):W4(e,"stroke-dasharray",""),t.lineCap&&W4(e,"stroke-linecap",t.lineCap),t.lineJoin&&W4(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&W4(e,"stroke-miterlimit",t.miterLimit)}else W4(e,"stroke","none")}var X4={};X4.brush=function(e){var t=e.style,i=e.__svgEl;i||(i=I4("path"),e.__svgEl=i),e.path||e.createPathProxy();var n=e.path;if(e.__dirtyPath){n.beginPath(),n.subPixelOptimize=!1,e.buildPath(n,e.shape),e.__dirtyPath=!1;var r=function(e){for(var t=[],i=e.data,n=e.len(),r=0;r<n;){var a="",o=0;switch(i[r++]){case N4.M:a="M",o=2;break;case N4.L:a="L",o=2;break;case N4.Q:a="Q",o=4;break;case N4.C:a="C",o=6;break;case N4.A:var s=i[r++],l=i[r++],u=i[r++],h=i[r++],c=i[r++],d=i[r++],f=i[r++],p=i[r++],g=Math.abs(d),m=H4(g-F4)||(p?d>=F4:-d>=F4),v=d>0?d%F4:d%F4+F4,y=!1;y=!!m||!H4(g)&&v>=B4==!!p;var _=G4(s+u*z4(c)),x=G4(l+h*k4(c));m&&(d=p?F4-1e-4:1e-4-F4,y=!0,9===r&&t.push("M",_,x));var b=G4(s+u*z4(c+d)),w=G4(l+h*k4(c+d));t.push("A",G4(u),G4(h),O4(f*V4),+y,+p,b,w);break;case N4.Z:a="Z";break;case N4.R:b=G4(i[r++]),w=G4(i[r++]);var T=G4(i[r++]),S=G4(i[r++]);t.push("M",b,w,"L",b+T,w,"L",b+T,w+S,"L",b,w+S,"L",b,w)}a&&t.push(a);for(var M=0;M<o;M++)t.push(G4(i[r++]))}return t.join(" ")}(n);r.indexOf("NaN")<0&&W4(i,"d",r)}j4(i,t,!1,e),U4(i,e.transform),null!=t.text?$4(e,e.getBoundingRect()):t6(e)};var Z4={brush:function(e){var t=e.style,i=t.image;i instanceof HTMLImageElement&&(i=i.src);if(i){var n=t.x||0,r=t.y||0,a=t.width,o=t.height,s=e.__svgEl;s||(s=I4("image"),e.__svgEl=s),i!==e.__imageSrc&&(!function(e,t,i){e.setAttributeNS("http://www.w3.org/1999/xlink",t,i)}(s,"href",i),e.__imageSrc=i),W4(s,"width",a),W4(s,"height",o),W4(s,"x",n),W4(s,"y",r),U4(s,e.transform),null!=t.text?$4(e,e.getBoundingRect()):t6(e)}}},q4={},Y4=new C4,K4={},Q4=[],J4={left:"start",right:"end",center:"middle",middle:"middle"},$4=function(e,t){var i=e.style,n=e.transform,r=e instanceof P4||i.transformText;e.__dirty&&L4.normalizeTextStyle(i,!0);var a=i.text;if(null!=a&&(a+=""),L4.needDrawText(a,i)){null==a&&(a=""),!r&&n&&(Y4.copy(t),Y4.applyTransform(n),t=Y4);var o=e.__textSvgEl;o||(o=I4("text"),e.__textSvgEl=o);var s=o.style,l=i.font||E4.DEFAULT_FONT,u=o.__computedFont;l!==o.__styleFont&&(s.font=o.__styleFont=l,u=o.__computedFont=s.font);var h=i.textPadding,c=i.textLineHeight,d=e.__textCotentBlock;d&&!e.__dirtyText||(d=e.__textCotentBlock=E4.parsePlainText(a,u,h,c,i.truncate));var f=d.outerHeight,p=d.lineHeight;L4.getBoxPosition(K4,e,i,t);var g=K4.baseX,m=K4.baseY,v=K4.textAlign||"left",y=K4.textVerticalAlign;!function(e,t,i,n,r,a,o){D4.identity(Q4),t&&i&&D4.copy(Q4,i);var s=n.textRotation;if(r&&s){var l=n.textOrigin;"center"===l?(a=r.width/2+r.x,o=r.height/2+r.y):l&&(a=l[0]+r.x,o=l[1]+r.y),Q4[4]-=a,Q4[5]-=o,D4.rotate(Q4,Q4,s),Q4[4]+=a,Q4[5]+=o}U4(e,Q4)}(o,r,n,i,t,g,m);var _=g,x=E4.adjustTextY(m,f,y);h&&(_=function(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}(g,v,h),x+=h[0]),x+=p/2,j4(o,i,!0,e);var b=d.canCacheByTextString,w=e.__tspanList||(e.__tspanList=[]),T=w.length;if(b&&e.__canCacheByTextString&&e.__text===a){if(e.__dirtyText&&T)for(var S=0;S<T;++S)e6(w[S],v,_,x+S*p)}else{e.__text=a,e.__canCacheByTextString=b;var M=d.lines,A=M.length;for(S=0;S<A;S++){var I=w[S],C=M[S];I?I.__zrText!==C&&(I.innerHTML="",I.appendChild(document.createTextNode(C))):(I=w[S]=I4("tspan"),o.appendChild(I),I.appendChild(document.createTextNode(C))),e6(I,v,_,x+S*p)}if(T>A){for(;S<T;S++)o.removeChild(w[S]);w.length=A}}}};function e6(e,t,i,n){W4(e,"dominant-baseline","middle"),W4(e,"text-anchor",J4[t]),W4(e,"x",i),W4(e,"y",n)}function t6(e){e&&e.__textSvgEl&&(e.__textSvgEl.parentNode&&e.__textSvgEl.parentNode.removeChild(e.__textSvgEl),e.__textSvgEl=null,e.__tspanList=[],e.__text=null)}function i6(){}function n6(e,t,i,n){for(var r=0,a=t.length,o=0,s=0;r<a;r++){var l=t[r];if(l.removed){for(u=[],h=s;h<s+l.count;h++)u.push(h);l.indices=u,s+=l.count}else{for(var u=[],h=o;h<o+l.count;h++)u.push(h);l.indices=u,o+=l.count,l.added||(s+=l.count)}}return t}q4.drawRectText=$4,q4.brush=function(e){null!=e.style.text?$4(e,!1):t6(e)},M4.path=X4,M4.image=Z4,M4.text=q4,i6.prototype={diff:function(e,t,i){i||(i=function(e,t){return e===t}),this.equals=i;var n=this;e=e.slice();var r=(t=t.slice()).length,a=e.length,o=1,s=r+a,l=[{newPos:-1,components:[]}],u=this.extractCommon(l[0],t,e,0);if(l[0].newPos+1>=r&&u+1>=a){for(var h=[],c=0;c<t.length;c++)h.push(c);return[{indices:h,count:t.length}]}function d(){for(var i=-1*o;i<=o;i+=2){var s,u=l[i-1],h=l[i+1],c=(h?h.newPos:0)-i;u&&(l[i-1]=void 0);var d=u&&u.newPos+1<r,f=h&&0<=c&&c<a;if(d||f){if(!d||f&&u.newPos<h.newPos?(s={newPos:(p=h).newPos,components:p.components.slice(0)},n.pushComponent(s.components,void 0,!0)):((s=u).newPos++,n.pushComponent(s.components,!0,void 0)),c=n.extractCommon(s,t,e,i),s.newPos+1>=r&&c+1>=a)return n6(n,s.components);l[i]=s}else l[i]=void 0}var p;o++}for(;o<=s;){var f=d();if(f)return f}},pushComponent:function(e,t,i){var n=e[e.length-1];n&&n.added===t&&n.removed===i?e[e.length-1]={count:n.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,n){for(var r=t.length,a=i.length,o=e.newPos,s=o-n,l=0;o+1<r&&s+1<a&&this.equals(t[o+1],i[s+1]);)o++,s++,l++;return l&&e.components.push({count:l}),e.newPos=o,s},tokenize:function(e){return e.slice()},join:function(e){return e.slice()}};var r6=new i6;var a6=function(e,t,i){return r6.diff(e,t,i)},o6=A4.createElement,s6=l,l6=Ys,u6=Fr,h6=Tl,c6=M4,d6=c6.path,f6=c6.image,p6=c6.text;function g6(e,t,i,n,r){this._zrId=e,this._svgRoot=t,this._tagNames="string"==typeof i?[i]:i,this._markLabel=n,this._domName=r||"_dom",this.nextId=0}g6.prototype.createElement=o6,g6.prototype.getDefs=function(e){var t=this._svgRoot,i=this._svgRoot.getElementsByTagName("defs");return 0===i.length?e?((i=t.insertBefore(this.createElement("defs"),t.firstChild)).contains||(i.contains=function(e){var t=i.children;if(!t)return!1;for(var n=t.length-1;n>=0;--n)if(t[n]===e)return!0;return!1}),i):null:i[0]},g6.prototype.update=function(e,t){if(e){var i=this.getDefs(!1);if(e[this._domName]&&i.contains(e[this._domName]))"function"==typeof t&&t(e);else{var n=this.add(e);n&&(e[this._domName]=n)}}},g6.prototype.addDom=function(e){this.getDefs(!0).appendChild(e)},g6.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},g6.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return s6.each(this._tagNames,(function(i){var n=e.getElementsByTagName(i);t=t.concat([].slice.call(n))})),t},g6.prototype.markAllUnused=function(){var e=this.getDoms(),t=this;s6.each(e,(function(e){e[t._markLabel]="0"}))},g6.prototype.markUsed=function(e){e&&(e[this._markLabel]="1")},g6.prototype.removeUnused=function(){var e=this.getDefs(!1);if(e){var t=this.getDoms(),i=this;s6.each(t,(function(t){"1"!==t[i._markLabel]&&e.removeChild(t)}))}},g6.prototype.getSvgProxy=function(e){return e instanceof l6?d6:e instanceof u6?f6:e instanceof h6?p6:d6},g6.prototype.getTextSvgElement=function(e){return e.__textSvgEl},g6.prototype.getSvgElement=function(e){return e.__svgEl};var m6=g6,v6=m6,y6=l,_6=Zt,x6=$e;function b6(e,t){v6.call(this,e,t,["linearGradient","radialGradient"],"__gradient_in_use__")}y6.inherits(b6,v6),b6.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var i=this;y6.each(["fill","stroke"],(function(n){if(t.style[n]&&("linear"===t.style[n].type||"radial"===t.style[n].type)){var r,a=t.style[n],o=i.getDefs(!0);a._dom?(r=a._dom,o.contains(a._dom)||i.addDom(r)):r=i.add(a),i.markUsed(t);var s=r.getAttribute("id");e.setAttribute(n,"url(#"+s+")")}}))}},b6.prototype.add=function(e){var t;if("linear"===e.type)t=this.createElement("linearGradient");else{if("radial"!==e.type)return _6("Illegal gradient type."),null;t=this.createElement("radialGradient")}return e.id=e.id||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-gradient-"+e.id),this.updateDom(e,t),this.addDom(t),t},b6.prototype.update=function(e){var t=this;v6.prototype.update.call(this,e,(function(){var i=e.type,n=e._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?t.updateDom(e,e._dom):(t.removeDom(e),t.add(e))}))},b6.prototype.updateDom=function(e,t){if("linear"===e.type)t.setAttribute("x1",e.x),t.setAttribute("y1",e.y),t.setAttribute("x2",e.x2),t.setAttribute("y2",e.y2);else{if("radial"!==e.type)return void _6("Illegal gradient type.");t.setAttribute("cx",e.x),t.setAttribute("cy",e.y),t.setAttribute("r",e.r)}e.global?t.setAttribute("gradientUnits","userSpaceOnUse"):t.setAttribute("gradientUnits","objectBoundingBox"),t.innerHTML="";for(var i=e.colorStops,n=0,r=i.length;n<r;++n){var a=this.createElement("stop");a.setAttribute("offset",100*i[n].offset+"%");var o=i[n].color;if(o.indexOf("rgba")>-1){var s=x6.parse(o)[3],l=x6.toHex(o);a.setAttribute("stop-color","#"+l),a.setAttribute("stop-opacity",s)}else a.setAttribute("stop-color",i[n].color);t.appendChild(a)}e._dom=t},b6.prototype.markUsed=function(e){if(e.style){var t=e.style.fill;t&&t._dom&&v6.prototype.markUsed.call(this,t._dom),(t=e.style.stroke)&&t._dom&&v6.prototype.markUsed.call(this,t._dom)}};var w6=b6,T6=m6,S6=l,M6=Re;function A6(e,t){T6.call(this,e,t,"clipPath","__clippath_in_use__")}S6.inherits(A6,T6),A6.prototype.update=function(e){var t=this.getSvgElement(e);t&&this.updateDom(t,e.__clipPaths,!1);var i=this.getTextSvgElement(e);i&&this.updateDom(i,e.__clipPaths,!0),this.markUsed(e)},A6.prototype.updateDom=function(e,t,i){if(t&&t.length>0){var n,r,a=this.getDefs(!0),o=t[0],s=i?"_textDom":"_dom";o[s]?(r=o[s].getAttribute("id"),n=o[s],a.contains(n)||a.appendChild(n)):(r="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",r),a.appendChild(n),o[s]=n);var l=this.getSvgProxy(o);if(o.transform&&o.parent.invTransform&&!i){var u=Array.prototype.slice.call(o.transform);M6.mul(o.transform,o.parent.invTransform,o.transform),l.brush(o),o.transform=u}else l.brush(o);var h=this.getSvgElement(o);n.innerHTML="",n.appendChild(h.cloneNode()),e.setAttribute("clip-path","url(#"+r+")"),t.length>1&&this.updateDom(n,t.slice(1),i)}else e&&e.setAttribute("clip-path","none")},A6.prototype.markUsed=function(e){var t=this;e.__clipPaths&&S6.each(e.__clipPaths,(function(e){e._dom&&T6.prototype.markUsed.call(t,e._dom),e._textDom&&T6.prototype.markUsed.call(t,e._textDom)}))};var I6=A6,C6=m6;function D6(e,t){C6.call(this,e,t,["filter"],"__filter_in_use__","_shadowDom")}function E6(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY||e.textShadowBlur||e.textShadowOffsetX||e.textShadowOffsetY)}l.inherits(D6,C6),D6.prototype.addWithoutUpdate=function(e,t){if(t&&E6(t.style)){var i;if(t._shadowDom)i=t._shadowDom,this.getDefs(!0).contains(t._shadowDom)||this.addDom(i);else i=this.add(t);this.markUsed(t);var n=i.getAttribute("id");e.style.filter="url(#"+n+")"}},D6.prototype.add=function(e){var t=this.createElement("filter");return e._shadowDomId=e._shadowDomId||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-shadow-"+e._shadowDomId),this.updateDom(e,t),this.addDom(t),t},D6.prototype.update=function(e,t){if(E6(t.style)){var i=this;C6.prototype.update.call(this,t,(function(){i.updateDom(t,t._shadowDom)}))}else this.remove(e,t)},D6.prototype.remove=function(e,t){null!=t._shadowDomId&&(this.removeDom(e),e.style.filter="")},D6.prototype.updateDom=function(e,t){var i=t.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,r,a,o,s=e.style,l=e.scale&&e.scale[0]||1,u=e.scale&&e.scale[1]||1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,r=s.shadowOffsetY||0,a=s.shadowBlur,o=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(t,s);n=s.textShadowOffsetX||0,r=s.textShadowOffsetY||0,a=s.textShadowBlur,o=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",r/u),i.setAttribute("flood-color",o);var h=a/2/l+" "+a/2/u;i.setAttribute("stdDeviation",h),t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width",Math.ceil(a/2*200)+"%"),t.setAttribute("height",Math.ceil(a/2*200)+"%"),t.appendChild(i),e._shadowDom=t},D6.prototype.markUsed=function(e){e._shadowDom&&C6.prototype.markUsed.call(this,e._shadowDom)};var L6=D6,P6=A4.createElement,N6=l,R6=Zt,O6=Ys,k6=Fr,z6=Tl,B6=a6,F6=w6,V6=I6,G6=L6,H6=M4,U6=H6.path,W6=H6.image,j6=H6.text;function X6(e){return parseInt(e,10)}function Z6(e,t){return t&&e&&t.parentNode!==e}function q6(e,t,i){if(Z6(e,t)&&i){var n=i.nextSibling;n?e.insertBefore(t,n):e.appendChild(t)}}function Y6(e,t){if(Z6(e,t)){var i=e.firstChild;i?e.insertBefore(t,i):e.appendChild(t)}}function K6(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function Q6(e){return e.__textSvgEl}function J6(e){return e.__svgEl}var $6=function(e,t,i,n){this.root=e,this.storage=t,this._opts=i=N6.extend({},i||{});var r=P6("svg");r.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.setAttribute("version","1.1"),r.setAttribute("baseProfile","full"),r.style.cssText="user-select:none;position:absolute;left:0;top:0;";var a=P6("g");r.appendChild(a);var o=P6("g");r.appendChild(o),this.gradientManager=new F6(n,o),this.clipPathManager=new V6(n,o),this.shadowManager=new G6(n,o);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=r,this._svgRoot=o,this._backgroundRoot=a,this._viewport=s,e.appendChild(s),s.appendChild(r),this.resize(i.width,i.height),this._visibleList=[]};$6.prototype={constructor:$6,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},setBackgroundColor:function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var t=P6("rect");t.setAttribute("width",this.getWidth()),t.setAttribute("height",this.getHeight()),t.setAttribute("x",0),t.setAttribute("y",0),t.setAttribute("id",0),t.style.fill=e,this._backgroundRoot.appendChild(t),this._backgroundNode=t},_paintList:function(e){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var t,i,n=this._svgRoot,r=this._visibleList,a=e.length,o=[];for(t=0;t<a;t++){var s=e[t],l=(i=s)instanceof O6?U6:i instanceof k6?W6:i instanceof z6?j6:U6,u=J6(s)||Q6(s);s.invisible||(s.__dirty&&(l&&l.brush(s),this.clipPathManager.update(s),s.style&&(this.gradientManager.update(s.style.fill),this.gradientManager.update(s.style.stroke),this.shadowManager.update(u,s)),s.__dirty=!1),o.push(s))}var h,c=B6(r,o);for(t=0;t<c.length;t++){if((p=c[t]).removed)for(var d=0;d<p.count;d++){u=J6(s=r[p.indices[d]]);var f=Q6(s);K6(n,u),K6(n,f)}}for(t=0;t<c.length;t++){var p;if((p=c[t]).added)for(d=0;d<p.count;d++){u=J6(s=o[p.indices[d]]),f=Q6(s);h?q6(n,u,h):Y6(n,u),u?q6(n,f,u):h?q6(n,f,h):Y6(n,f),q6(n,f,u),h=f||u||h,this.gradientManager.addWithoutUpdate(u||f,s),this.shadowManager.addWithoutUpdate(u||f,s),this.clipPathManager.markUsed(s)}else if(!p.removed)for(d=0;d<p.count;d++){u=J6(s=o[p.indices[d]]),f=Q6(s),u=J6(s),f=Q6(s);this.gradientManager.markUsed(s),this.gradientManager.addWithoutUpdate(u||f,s),this.shadowManager.markUsed(s),this.shadowManager.addWithoutUpdate(u||f,s),this.clipPathManager.markUsed(s),f&&q6(n,f,u),h=u||f||h}}this.gradientManager.removeUnused(),this.clipPathManager.removeUnused(),this.shadowManager.removeUnused(),this._visibleList=o},_getDefs:function(e){var t,i=this._svgDom;return 0===(t=i.getElementsByTagName("defs")).length?e?((t=i.insertBefore(P6("defs"),i.firstChild)).contains||(t.contains=function(e){var i=t.children;if(!i)return!1;for(var n=i.length-1;n>=0;--n)if(i[n]===e)return!0;return!1}),t):null:t[0]},resize:function(e,t){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||this._height!==t){this._width=e,this._height=t;var r=i.style;r.width=e+"px",r.height=t+"px";var a=this._svgDom;a.setAttribute("width",e),a.setAttribute("height",t)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",e),this._backgroundNode.setAttribute("height",t))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],r=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||X6(s[i])||X6(o.style[i]))-(X6(s[r])||0)-(X6(s[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/></g,">\n\r<"))}},N6.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],(function(e){var t;$6.prototype[e]=(t=e,function(){R6('In SVG mode painter not support method "'+t+'"')})}));var e8=$6;(0,r.registerPainter)("svg",e8),function(e){var t=n;!function(){for(var i in t){if(null==t||!t.hasOwnProperty(i)||"default"===i||"__esModule"===i)return;e[i]=t[i]}}();var i=sy;!function(){for(var t in i){if(null==i||!i.hasOwnProperty(t)||"default"===t||"__esModule"===t)return;e[t]=i[t]}}()}(i);var t8,i8=e(i);t8=function(e){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=106)}([function(t,i){t.exports=e},function(e,t,i){var n=i(40),r=i(52),a=i(5),o=i(4),s=i(8),l=i(19),u=i(35),h=i(15),c=i(0),d=i.n(c),f=i(36),p=i(60),g=i.n(p),m=i(61),v=i(124),y=i(125),_=i(129),x=i(130),b=i(2),w=i(132),T=i(43),S=i(76),M=i(133),A=i(134),I=i(135),C=i(136),D=i(41),E=i(37),L=i(26),P=i(3),N=i(137),R=i(56),O=i(138),k=i(139),z=i(140),B=i(9),F=i(74),V=i(54),G=i(18),H=i(59),U=i(141),W=i(146),j=i(71),X=i(147),Z=i(148),q=i(149),Y=i(150),K=i(151),Q=i(152);function J(e){return e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof Image}d.a.util.extend(u.a.prototype,U.a),s.a.import(W.a),s.a.import(j.a),s.a.import(X.a),s.a.import(Z.a),s.a.import(q.a),s.a.import(Y.a),s.a.import(K.a),s.a.import(Q.a);var $=f.a.prototype.addToScene,ee=f.a.prototype.removeFromScene;f.a.prototype.addToScene=function(e){if($.call(this,e),this.__zr){var t=this.__zr;e.traverse((function(e){e.__zr=t,e.addAnimatorsToZr&&e.addAnimatorsToZr(t)}))}},f.a.prototype.removeFromScene=function(e){ee.call(this,e),e.traverse((function(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}))},l.a.prototype.setTextureImage=function(e,t,i,n){if(this.shader){var r,a,o=i.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(e),(a=t)&&"none"!==a&&(r=te.loadTexture(t,i,n,(function(t){s.enableTexture(e),o&&o.refresh()})),s.set(e,r)),r}};var te={};te.Renderer=r.a,te.Node=u.a,te.Mesh=n.a,te.Shader=s.a,te.Material=l.a,te.Texture=o.a,te.Texture2D=a.a,te.Geometry=h.a,te.SphereGeometry=w.a,te.PlaneGeometry=T.a,te.CubeGeometry=S.a,te.AmbientLight=M.a,te.DirectionalLight=A.a,te.PointLight=I.a,te.SpotLight=C.a,te.PerspectiveCamera=D.a,te.OrthographicCamera=E.a,te.Vector2=L.a,te.Vector3=P.a,te.Vector4=N.a,te.Quaternion=R.a,te.Matrix2=O.a,te.Matrix2d=k.a,te.Matrix3=z.a,te.Matrix4=B.a,te.Plane=F.a,te.Ray=V.a,te.BoundingBox=G.a,te.Frustum=H.a;var ie=m.a.createBlank("rgba(255,255,255,0)").image;function ne(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function re(e){if((e.wrapS===o.a.REPEAT||e.wrapT===o.a.REPEAT)&&e.image){var t=ne(e.width),i=ne(e.height);if(t!==e.width||i!==e.height){var n=document.createElement("canvas");n.width=t,n.height=i,n.getContext("2d").drawImage(e.image,0,0,t,i),e.image=n}}}te.loadTexture=function(e,t,i,n){"function"==typeof i&&(n=i,i={}),i=i||{};for(var r=Object.keys(i).sort(),a="",o=0;o<r.length;o++)a+=r[o]+"_"+i[r[o]]+"_";var s,l=t.__textureCache=t.__textureCache||new g.a(20);if((s=e).getZr&&s.setOption){var u=e.__textureid__;if(c=l.get(a+u))c.texture.surface.setECharts(e),n&&n(c.texture);else{var h=new v.a(e);for(h.onupdate=function(){t.getZr().refresh()},c={texture:h.getTexture()},o=0;o<r.length;o++)c.texture[r[o]]=i[r[o]];u=e.__textureid__||"__ecgl_ec__"+c.texture.__uid__,e.__textureid__=u,l.put(a+u,c),n&&n(c.texture)}return c.texture}if(J(e)){var c;if(u=e.__textureid__,!(c=l.get(a+u))){for(c={texture:new te.Texture2D({image:e})},o=0;o<r.length;o++)c.texture[r[o]]=i[r[o]];u=e.__textureid__||"__ecgl_image__"+c.texture.__uid__,e.__textureid__=u,l.put(a+u,c),re(c.texture),n&&n(c.texture)}return c.texture}if(c=l.get(a+e))c.callbacks?c.callbacks.push(n):n&&n(c.texture);else if(e.match(/.hdr$|^data:application\/octet-stream/)){c={callbacks:[n]};var d=m.a.loadTexture(e,{exposure:i.exposure,fileType:"hdr"},(function(){d.dirty(),c.callbacks.forEach((function(e){e&&e(d)})),c.callbacks=null}));c.texture=d,l.put(a+e,c)}else{for(d=new te.Texture2D({image:new Image}),o=0;o<r.length;o++)d[r[o]]=i[r[o]];c={texture:d,callbacks:[n]};var f=d.image;f.onload=function(){d.image=f,re(d),d.dirty(),c.callbacks.forEach((function(e){e&&e(d)})),c.callbacks=null},f.src=e,d.image=ie,l.put(a+e,c)}return c.texture},te.createAmbientCubemap=function(e,t,i,n){var r=(e=e||{}).texture,a=b.a.firstNotNull(e.exposure,1),o=new y.a({intensity:b.a.firstNotNull(e.specularIntensity,1)}),s=new _.a({intensity:b.a.firstNotNull(e.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return o.cubemap=te.loadTexture(r,i,{exposure:a},(function(){o.cubemap.flipY=!1;var e=Date.now();o.prefilter(t,32);var i=Date.now()-e;console.log("Prefilter environment map: "+i+"ms"),s.coefficients=x.a.projectEnvironmentMap(t,o.cubemap,{lod:1}),n&&n()})),{specular:o,diffuse:s}},te.createBlankTexture=m.a.createBlank,te.isImage=J,te.additiveBlend=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)},te.parseColor=function(e,t){return e instanceof Array?(t||(t=[]),t[0]=e[0],t[1]=e[1],t[2]=e[2],e.length>3?t[3]=e[3]:t[3]=1,t):((t=d.a.color.parse(e||"#000",t)||[0,0,0,0])[0]/=255,t[1]/=255,t[2]/=255,t)},te.directionFromAlphaBeta=function(e,t){var i=e/180*Math.PI+Math.PI/2,n=-t/180*Math.PI+Math.PI/2,r=[],a=Math.sin(i);return r[0]=a*Math.cos(n),r[1]=-Math.cos(i),r[2]=a*Math.sin(n),r},te.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096}return t},te.COMMON_SHADERS=["lambert","color","realistic","hatching"],te.createShader=function(e){var t=s.a.source(e+".vertex"),i=s.a.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),i||console.error("Fragment shader of '%s' not exits",e);var n=new s.a(t,i);return n.name=e,n},te.createMaterial=function(e,t){t instanceof Array||(t=[t]);var i=te.createShader(e),n=new l.a({shader:i});return t.forEach((function(e){"string"==typeof e&&n.define(e)})),n},te.setMaterialFromModel=function(e,t,i,n){t.autoUpdateTextureStatus=!1;var r=i.getModel(e+"Material"),a=r.get("detailTexture"),o=b.a.firstNotNull(r.get("textureTiling"),1),s=b.a.firstNotNull(r.get("textureOffset"),0);"number"==typeof o&&(o=[o,o]),"number"==typeof s&&(s=[s,s]);var l=o[0]>1||o[1]>1?te.Texture.REPEAT:te.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===e){var h=r.get("roughness"),c=r.get("metalness");null!=c?isNaN(c)&&(t.setTextureImage("metalnessMap",c,n,u),c=b.a.firstNotNull(r.get("metalnessAdjust"),.5)):c=0,null!=h?isNaN(h)&&(t.setTextureImage("roughnessMap",h,n,u),h=b.a.firstNotNull(r.get("roughnessAdjust"),.5)):h=.5;var d=r.get("normalTexture");t.setTextureImage("detailMap",a,n,u),t.setTextureImage("normalMap",d,n,u),t.set({roughness:h,metalness:c,detailUvRepeat:o,detailUvOffset:s})}else if("lambert"===e)t.setTextureImage("detailMap",a,n,u),t.set({detailUvRepeat:o,detailUvOffset:s});else if("color"===e)t.setTextureImage("detailMap",a,n,u),t.set({detailUvRepeat:o,detailUvOffset:s});else if("hatching"===e){var f=r.get("hatchingTextures")||[];f.length<6&&console.error("Invalid hatchingTextures.");for(var p=0;p<6;p++)t.setTextureImage("hatch"+(p+1),f[p],n,{anisotropic:8,wrapS:te.Texture.REPEAT,wrapT:te.Texture.REPEAT});t.set({detailUvRepeat:o,detailUvOffset:s})}},te.updateVertexAnimation=function(e,t,i,n){var r=n.get("animation"),a=n.get("animationDurationUpdate"),o=n.get("animationEasingUpdate"),s=i.shadowDepthMaterial;if(r&&t&&a>0&&t.geometry.vertexCount===i.geometry.vertexCount){i.material.define("vertex","VERTEX_ANIMATION"),i.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<e.length;l++)i.geometry.attributes[e[l][0]].value=t.geometry.attributes[e[l][1]].value;i.geometry.dirty(),i.__percent=0,i.material.set("percent",0),i.stopAnimation(),i.animate().when(a,{__percent:1}).during((function(){i.material.set("percent",i.__percent),s&&s.set("percent",i.__percent)})).done((function(){i.ignorePreZ=!1,i.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")})).start(o)}else i.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")},t.a=te},function(e,t,i){var n=i(0),r=i.n(n),a={firstNotNull:function(){for(var e=0,t=arguments.length;e<t;e++)if(null!=arguments[e])return arguments[e]},queryDataIndex:function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?r.a.util.isArray(t.dataIndex)?r.a.util.map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?r.a.util.isArray(t.name)?r.a.util.map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0}};t.a=a},function(e,t,i){var n=i(12),r=function(e,t,i){e=e||0,t=t||0,i=i||0,this.array=n.a.fromValues(e,t,i),this._dirty=!0};r.prototype={constructor:r,add:function(e){return n.a.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,i){return this.array[0]=e,this.array[1]=t,this.array[2]=i,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this._dirty=!0,this},clone:function(){return new r(this.x,this.y,this.z)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return n.a.cross(this.array,e.array,t.array),this._dirty=!0,this},dist:function(e){return n.a.dist(this.array,e.array)},distance:function(e){return n.a.distance(this.array,e.array)},div:function(e){return n.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return n.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return n.a.dot(this.array,e.array)},len:function(){return n.a.len(this.array)},length:function(){return n.a.length(this.array)},lerp:function(e,t,i){return n.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},min:function(e){return n.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return n.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return n.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return n.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return n.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return n.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return n.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return n.a.squaredDistance(this.array,e.array)},sqrLen:function(){return n.a.sqrLen(this.array)},squaredLength:function(){return n.a.squaredLength(this.array)},sub:function(e){return n.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return n.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return n.a.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return n.a.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return n.a.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},applyProjection:function(e){var t=this.array;if(0===(e=e.array)[15]){var i=-1/t[2];t[0]=e[0]*t[0]*i,t[1]=e[5]*t[1]*i,t[2]=(e[10]*t[2]+e[14])*i}else t[0]=e[0]*t[0]+e[12],t[1]=e[5]*t[1]+e[13],t[2]=e[10]*t[2]+e[14];return this._dirty=!0,this},eulerFromQuat:function(e,t){r.eulerFromQuat(this,e,t)},eulerFromMat3:function(e,t){r.eulerFromMat3(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var a=Object.defineProperty;if(a){var o=r.prototype;a(o,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),a(o,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),a(o,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}})}function s(e,t,i){return e<t?t:e>i?i:e}r.add=function(e,t,i){return n.a.add(e.array,t.array,i.array),e._dirty=!0,e},r.set=function(e,t,i,r){n.a.set(e.array,t,i,r),e._dirty=!0},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.cross=function(e,t,i){return n.a.cross(e.array,t.array,i.array),e._dirty=!0,e},r.distance=r.dist=function(e,t){return n.a.distance(e.array,t.array)},r.divide=r.div=function(e,t,i){return n.a.divide(e.array,t.array,i.array),e._dirty=!0,e},r.dot=function(e,t){return n.a.dot(e.array,t.array)},r.len=function(e){return n.a.length(e.array)},r.lerp=function(e,t,i,r){return n.a.lerp(e.array,t.array,i.array,r),e._dirty=!0,e},r.min=function(e,t,i){return n.a.min(e.array,t.array,i.array),e._dirty=!0,e},r.max=function(e,t,i){return n.a.max(e.array,t.array,i.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},r.negate=function(e,t){return n.a.negate(e.array,t.array),e._dirty=!0,e},r.normalize=function(e,t){return n.a.normalize(e.array,t.array),e._dirty=!0,e},r.random=function(e,t){return n.a.random(e.array,t),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i),e._dirty=!0,e},r.scaleAndAdd=function(e,t,i,r){return n.a.scaleAndAdd(e.array,t.array,i.array,r),e._dirty=!0,e},r.squaredDistance=r.sqrDist=function(e,t){return n.a.sqrDist(e.array,t.array)},r.squaredLength=r.sqrLen=function(e){return n.a.sqrLen(e.array)},r.subtract=r.sub=function(e,t,i){return n.a.subtract(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat3=function(e,t,i){return n.a.transformMat3(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat4=function(e,t,i){return n.a.transformMat4(e.array,t.array,i.array),e._dirty=!0,e},r.transformQuat=function(e,t,i){return n.a.transformQuat(e.array,t.array,i.array),e._dirty=!0,e};var l=Math.atan2,u=Math.asin,h=Math.abs;r.eulerFromQuat=function(e,t,i){e._dirty=!0,t=t.array;var n=e.array,r=t[0],a=t[1],o=t[2],h=t[3],c=r*r,d=a*a,f=o*o,p=h*h;switch(i=(i||"XYZ").toUpperCase()){case"XYZ":n[0]=l(2*(r*h-a*o),p-c-d+f),n[1]=u(s(2*(r*o+a*h),-1,1)),n[2]=l(2*(o*h-r*a),p+c-d-f);break;case"YXZ":n[0]=u(s(2*(r*h-a*o),-1,1)),n[1]=l(2*(r*o+a*h),p-c-d+f),n[2]=l(2*(r*a+o*h),p-c+d-f);break;case"ZXY":n[0]=u(s(2*(r*h+a*o),-1,1)),n[1]=l(2*(a*h-o*r),p-c-d+f),n[2]=l(2*(o*h-r*a),p-c+d-f);break;case"ZYX":n[0]=l(2*(r*h+o*a),p-c-d+f),n[1]=u(s(2*(a*h-r*o),-1,1)),n[2]=l(2*(r*a+o*h),p+c-d-f);break;case"YZX":n[0]=l(2*(r*h-o*a),p-c+d-f),n[1]=l(2*(a*h-r*o),p+c-d-f),n[2]=u(s(2*(r*a+o*h),-1,1));break;case"XZY":n[0]=l(2*(r*h+a*o),p-c+d-f),n[1]=l(2*(r*o+a*h),p+c-d-f),n[2]=u(s(2*(o*h-r*a),-1,1));break;default:console.warn("Unkown order: "+i)}return e},r.eulerFromMat3=function(e,t,i){var n=t.array,r=n[0],a=n[3],o=n[6],c=n[1],d=n[4],f=n[7],p=n[2],g=n[5],m=n[8],v=e.array;switch(i=(i||"XYZ").toUpperCase()){case"XYZ":v[1]=u(s(o,-1,1)),h(o)<.99999?(v[0]=l(-f,m),v[2]=l(-a,r)):(v[0]=l(g,d),v[2]=0);break;case"YXZ":v[0]=u(-s(f,-1,1)),h(f)<.99999?(v[1]=l(o,m),v[2]=l(c,d)):(v[1]=l(-p,r),v[2]=0);break;case"ZXY":v[0]=u(s(g,-1,1)),h(g)<.99999?(v[1]=l(-p,m),v[2]=l(-a,d)):(v[1]=0,v[2]=l(c,r));break;case"ZYX":v[1]=u(-s(p,-1,1)),h(p)<.99999?(v[0]=l(g,m),v[2]=l(c,r)):(v[0]=0,v[2]=l(-a,d));break;case"YZX":v[2]=u(s(c,-1,1)),h(c)<.99999?(v[0]=l(-f,d),v[1]=l(-p,r)):(v[0]=0,v[1]=l(o,m));break;case"XZY":v[2]=u(-s(a,-1,1)),h(a)<.99999?(v[0]=l(g,d),v[1]=l(o,r)):(v[0]=l(-f,m),v[1]=0);break;default:console.warn("Unkown order: "+i)}return e._dirty=!0,e},Object.defineProperties(r,{POSITIVE_X:{get:function(){return new r(1,0,0)}},NEGATIVE_X:{get:function(){return new r(-1,0,0)}},POSITIVE_Y:{get:function(){return new r(0,1,0)}},NEGATIVE_Y:{get:function(){return new r(0,-1,0)}},POSITIVE_Z:{get:function(){return new r(0,0,1)}},NEGATIVE_Z:{get:function(){return new r(0,0,-1)}},UP:{get:function(){return new r(0,1,0)}},ZERO:{get:function(){return new r}}}),t.a=r},function(e,t,i){var n=i(7),r=i(11),a=i(57),o=n.a.extend({width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.REPEAT,wrapT:r.a.REPEAT,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},(function(){this._cache=new a.a}),{getWebGLTexture:function(e){var t=e.gl,i=this._cache;return i.use(e.__uid__),i.miss("webgl_texture")&&i.put("webgl_texture",t.createTexture()),this.dynamic?this.update(e):i.isDirty()&&(this.update(e),i.fresh()),i.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(e){},updateCommon:function(e){var t=e.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===r.a.DEPTH_COMPONENT&&(this.useMipmap=!1);var i=e.getGLExtension("EXT_sRGB");this.format!==o.SRGB||i||(this.format=o.RGB),this.format!==o.SRGB_ALPHA||i||(this.format=o.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var e=this.minFilter;return this.NPOT||!this.useMipmap?e===r.a.NEAREST_MIPMAP_NEAREST||e===r.a.NEAREST_MIPMAP_LINEAR?r.a.NEAREST:e===r.a.LINEAR_MIPMAP_LINEAR||e===r.a.LINEAR_MIPMAP_NEAREST?r.a.LINEAR:e:e},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(e){--e;for(var t=1;t<32;t<<=1)e|=e>>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var i=t.get("webgl_texture");i&&e.gl.deleteTexture(i),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(o.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}}),Object.defineProperty(o.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}}),o.BYTE=r.a.BYTE,o.UNSIGNED_BYTE=r.a.UNSIGNED_BYTE,o.SHORT=r.a.SHORT,o.UNSIGNED_SHORT=r.a.UNSIGNED_SHORT,o.INT=r.a.INT,o.UNSIGNED_INT=r.a.UNSIGNED_INT,o.FLOAT=r.a.FLOAT,o.HALF_FLOAT=36193,o.UNSIGNED_INT_24_8_WEBGL=34042,o.DEPTH_COMPONENT=r.a.DEPTH_COMPONENT,o.DEPTH_STENCIL=r.a.DEPTH_STENCIL,o.ALPHA=r.a.ALPHA,o.RGB=r.a.RGB,o.RGBA=r.a.RGBA,o.LUMINANCE=r.a.LUMINANCE,o.LUMINANCE_ALPHA=r.a.LUMINANCE_ALPHA,o.SRGB=35904,o.SRGB_ALPHA=35906,o.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,o.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,o.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,o.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,o.NEAREST=r.a.NEAREST,o.LINEAR=r.a.LINEAR,o.NEAREST_MIPMAP_NEAREST=r.a.NEAREST_MIPMAP_NEAREST,o.LINEAR_MIPMAP_NEAREST=r.a.LINEAR_MIPMAP_NEAREST,o.NEAREST_MIPMAP_LINEAR=r.a.NEAREST_MIPMAP_LINEAR,o.LINEAR_MIPMAP_LINEAR=r.a.LINEAR_MIPMAP_LINEAR,o.REPEAT=r.a.REPEAT,o.CLAMP_TO_EDGE=r.a.CLAMP_TO_EDGE,o.MIRRORED_REPEAT=r.a.MIRRORED_REPEAT,t.a=o},function(e,t,i){var n=i(4),r=i(11),a=i(14),o=i(73).a.isPowerOfTwo;function s(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}var l=n.a.extend((function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}}),{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var i=this.format,a=this.type,o=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==n.a.REPEAT&&this.wrapT!==n.a.REPEAT||!this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,o?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,o?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,o?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,o?this.minFilter:this.getAvailableMinFilter());var s=e.getGLExtension("EXT_texture_filter_anisotropic");if(s&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,s.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===a&&(e.getGLExtension("OES_texture_half_float")||(a=r.a.FLOAT)),this.mipmaps.length)for(var l=this.width,u=this.height,h=0;h<this.mipmaps.length;h++){var c=this.mipmaps[h];this._updateTextureData(t,c,h,l,u,i,a,!1),l/=2,u/=2}else this._updateTextureData(t,this,0,this.width,this.height,i,a,o),!this.useMipmap||this.NPOT&&!o||t.generateMipmap(t.TEXTURE_2D);t.bindTexture(t.TEXTURE_2D,null)},_updateTextureData:function(e,t,i,r,a,o,l,u){if(t.image){var h=t.image;u&&(this._potCanvas=function(e,t){var i=s(e.width),n=s(e.height);return(t=t||document.createElement("canvas")).width=i,t.height=n,t.getContext("2d").drawImage(e.image,0,0,i,n),t}(this,this._potCanvas),h=this._potCanvas),e.texImage2D(e.TEXTURE_2D,i,o,o,l,h)}else o<=n.a.COMPRESSED_RGBA_S3TC_DXT5_EXT&&o>=n.a.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,i,o,r,a,0,t.pixels):e.texImage2D(e.TEXTURE_2D,i,o,r,a,0,o,l,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){return o(this.width)&&o(this.height)},isRenderable:function(){return this.image?"CANVAS"===this.image.nodeName||"VIDEO"===this.image.nodeName||this.image.complete:!(!this.width||!this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var i=a.a.createImage();t&&(i.crossOrigin=t);var n=this;return i.onload=function(){n.dirty(),n.trigger("success",n),i.onload=null},i.onerror=function(){n.trigger("error",n),i.onerror=null},i.src=e,this.image=i,this}});Object.defineProperty(l.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(l.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),t.a=l},function(e,t,i){var n=i(161);t.a=n.a},function(e,t,i){var n=i(110),r=i(53),a=i(23),o=function(){this.__uid__=a.a.genGUID()};o.__initializers__=[function(e){a.a.extend(this,e)}],a.a.extend(o,n.a),a.a.extend(o.prototype,r.a),t.a=o},function(e,t,i){var n=i(23),r=i(14),a=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,o=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,s=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,l={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function u(e){for(var t=[],i=0;i<e;i++)t[i]=0;return t}var h={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return u(2)},vec3:function(){return u(3)},vec4:function(){return u(4)},ivec2:function(){return u(2)},ivec3:function(){return u(3)},ivec4:function(){return u(4)},mat2:function(){return u(4)},mat3:function(){return u(9)},mat4:function(){return u(16)},array:function(){return[]}},c=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],d=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],f=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],p={vec4:4,vec3:3,vec2:2,float:1},g={},m={};function v(e){return e.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function y(){console.error("Wrong uniform/attributes syntax")}function _(e,t){for(var i=/[,=\(\):]/,n=t.replace(/:\s*\[\s*(.*)\s*\]/g,"="+e+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),a=[],o=0;o<n.length;o++)n[o].match(i)?a.push(n[o].charAt(0),n[o].slice(1)):a.push(n[o]);var s,l=0,u={},h=null;function p(e){e||y();var t=e.match(/\[(.*?)\]/);s=e.replace(/\[(.*?)\]/,""),u[s]={},t&&(u[s].isArray=!0,u[s].arraySize=t[1])}for(p((n=a)[0]),o=1;o<n.length;o++){var g=n[o];if(g)if("="!==g)if(":"!==g)if(","!==g)if(")"!==g)if("("!==g)if(g.indexOf("vec")>=0){if(1!==l&&4!==l){y();break}l=2,h=[]}else if(1!==l)if(4!==l)p(g),l=0;else{var m=g;c.indexOf(m)>=0||d.indexOf(m)>=0||f.indexOf(m)>=0?u[s].semantic=m:"ignore"===m||"unconfigurable"===m?u[s].ignore=!0:u[s].value="bool"===e?"true"===m:parseFloat(m)}else u[s].value="bool"===e?"true"===g:parseFloat(g),h=null;else{if(2!==l){y();break}if(!(h instanceof Array)){y();break}h.push(+n[++o])}else u[s].value=new r.a.Float32Array(h),h=null,l=5;else if(2===l){if(!(h instanceof Array)){y();break}h.push(+n[++o])}else l=5;else l=4;else{if(0!==l&&3!==l){y();break}l=1}}return u}function x(e,t){"object"==typeof e&&(t=e.fragment,e=e.vertex),e=v(e),t=v(t),this._shaderID=function(e,t){var i="vertex:"+e+"fragment:"+t;if(g[i])return g[i];var r=n.a.genGUID();return g[i]=r,m[r]={vertex:e,fragment:t},r}(e,t),this._vertexCode=x.parseImport(e),this._fragmentCode=x.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}x.prototype={constructor:x,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var i=this.uniformTemplates[t];e[t]={type:i.type,value:i.value()}}return e},_parseImport:function(){this._vertexCode=x.parseImport(this.vertex),this._fragmentCode=x.parseImport(this.fragment)},_addSemanticUniform:function(e,t,i){if(c.indexOf(i)>=0)this.attributeSemantics[i]={symbol:e,type:t};else if(f.indexOf(i)>=0){var n=!1,r=i;i.match(/TRANSPOSE$/)&&(n=!0,r=i.slice(0,-9)),this.matrixSemantics[i]={symbol:e,type:t,isTranspose:n,semanticNoTranspose:r}}else d.indexOf(i)>=0&&(this.uniformSemantics[i]={symbol:e,type:t})},_addMaterialUniform:function(e,t,i,n,r,a){a[e]={type:i,value:r?h.array:n||h[t],semantic:null}},_parseUniforms:function(){var e={},t=this;function i(e){return null!=e?function(){return e}:null}function n(n,r,a){var o=_(r,a),s=[];for(var u in o){var h=o[u],c=h.semantic,d=u,f=l[r],p=i(o[u].value);o[u].isArray&&(d+="["+o[u].arraySize+"]",f+="v"),s.push(d),t._uniformList.push(u),h.ignore||("sampler2D"!==r&&"samplerCube"!==r||(t.textures[u]={shaderType:"fragment",type:r}),c?t._addSemanticUniform(u,f,c):t._addMaterialUniform(u,r,f,p,o[u].isArray,e))}return s.length>0?"uniform "+r+" "+s.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(a,n),this._fragmentCode=this._fragmentCode.replace(a,n),t.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(o,(function(i,n,r){var a=_(n,r),o=p[n]||1,s=[];for(var l in a){var u=a[l].semantic;if(e[l]={type:"float",size:o,semantic:u||null},u){if(c.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');t.attributeSemantics[u]={symbol:l,type:n}}s.push(l)}return"attribute "+n+" "+s.join(",")+";\n"})),this.attributes=e},_parseDefines:function(){var e=this;function t(t,i,n){var r=e.fragmentDefines;return r[i]||(r[i]="false"!==n&&("true"===n||(n?isNaN(parseFloat(n))?n.trim():parseFloat(n):null))),""}this._vertexCode=this._vertexCode.replace(s,t),this._fragmentCode=this._fragmentCode.replace(s,t)},clone:function(){var e=m[this._shaderID];return new x(e.vertex,e.fragment)}},Object.defineProperty&&(Object.defineProperty(x.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(x.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(x.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(x.prototype,"uniforms",{get:function(){return this._uniformList}}));var b=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;x.parseImport=function(e){return e=e.replace(b,(function(e,t,i){return(e=x.source(i))?x.parseImport(e):(console.error('Shader chunk "'+i+'" not existed in library'),"")}))};var w=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;x.import=function(e){e.replace(w,(function(e,t,i,n){if(n=n.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var r,a=i.split("."),o=x.codes,s=0;s<a.length-1;)o[r=a[s++]]||(o[r]={}),o=o[r];o[r=a[s]]=n}return n}))},x.codes={},x.source=function(e){for(var t=e.split("."),i=x.codes,n=0;i&&n<t.length;)i=i[t[n++]];return"string"!=typeof i?(console.error('Shader "'+e+'" not existed in library'),""):i},t.a=x},function(e,t,i){var n,r,a,o,s=i(21),l=i(12),u=i(55),h=i(34),c=i(3),d=function(){this._axisX=new c.a,this._axisY=new c.a,this._axisZ=new c.a,this.array=s.a.create(),this._dirty=!0};d.prototype={constructor:d,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return s.a.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new d).copy(this)},copy:function(e){return s.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return s.a.determinant(this.array)},fromQuat:function(e){return s.a.fromQuat(this.array,e.array),this._dirty=!0,this},fromRotationTranslation:function(e,t){return s.a.fromRotationTranslation(this.array,e.array,t.array),this._dirty=!0,this},fromMat2d:function(e){return d.fromMat2d(this,e),this},frustum:function(e,t,i,n,r,a){return s.a.frustum(this.array,e,t,i,n,r,a),this._dirty=!0,this},identity:function(){return s.a.identity(this.array),this._dirty=!0,this},invert:function(){return s.a.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(e,t,i){return s.a.lookAt(this.array,e.array,t.array,i.array),this._dirty=!0,this},mul:function(e){return s.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return s.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return s.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return s.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},ortho:function(e,t,i,n,r,a){return s.a.ortho(this.array,e,t,i,n,r,a),this._dirty=!0,this},perspective:function(e,t,i,n){return s.a.perspective(this.array,e,t,i,n),this._dirty=!0,this},rotate:function(e,t){return s.a.rotate(this.array,this.array,e,t.array),this._dirty=!0,this},rotateX:function(e){return s.a.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return s.a.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return s.a.rotateZ(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return s.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return s.a.translate(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return s.a.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:(n=l.a.create(),r=l.a.create(),a=l.a.create(),o=h.a.create(),function(e,t,i){var s=this.array;l.a.set(n,s[0],s[1],s[2]),l.a.set(r,s[4],s[5],s[6]),l.a.set(a,s[8],s[9],s[10]);var c=l.a.length(n),d=l.a.length(r),f=l.a.length(a);this.determinant()<0&&(c=-c),e&&e.set(c,d,f),i.set(s[12],s[13],s[14]),h.a.fromMat4(o,s),o[0]/=c,o[1]/=c,o[2]/=c,o[3]/=d,o[4]/=d,o[5]/=d,o[6]/=f,o[7]/=f,o[8]/=f,u.a.fromMat3(t.array,o),u.a.normalize(t.array,t.array),t._dirty=!0,i._dirty=!0}),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var f=Object.defineProperty;if(f){var p=d.prototype;f(p,"z",{get:function(){var e=this.array;return this._axisZ.set(e[8],e[9],e[10]),this._axisZ},set:function(e){var t=this.array;e=e.array,t[8]=e[0],t[9]=e[1],t[10]=e[2],this._dirty=!0}}),f(p,"y",{get:function(){var e=this.array;return this._axisY.set(e[4],e[5],e[6]),this._axisY},set:function(e){var t=this.array;e=e.array,t[4]=e[0],t[5]=e[1],t[6]=e[2],this._dirty=!0}}),f(p,"x",{get:function(){var e=this.array;return this._axisX.set(e[0],e[1],e[2]),this._axisX},set:function(e){var t=this.array;e=e.array,t[0]=e[0],t[1]=e[1],t[2]=e[2],this._dirty=!0}})}d.adjoint=function(e,t){return s.a.adjoint(e.array,t.array),e._dirty=!0,e},d.copy=function(e,t){return s.a.copy(e.array,t.array),e._dirty=!0,e},d.determinant=function(e){return s.a.determinant(e.array)},d.identity=function(e){return s.a.identity(e.array),e._dirty=!0,e},d.ortho=function(e,t,i,n,r,a,o){return s.a.ortho(e.array,t,i,n,r,a,o),e._dirty=!0,e},d.perspective=function(e,t,i,n,r){return s.a.perspective(e.array,t,i,n,r),e._dirty=!0,e},d.lookAt=function(e,t,i,n){return s.a.lookAt(e.array,t.array,i.array,n.array),e._dirty=!0,e},d.invert=function(e,t){return s.a.invert(e.array,t.array),e._dirty=!0,e},d.multiply=d.mul=function(e,t,i){return s.a.mul(e.array,t.array,i.array),e._dirty=!0,e},d.fromQuat=function(e,t){return s.a.fromQuat(e.array,t.array),e._dirty=!0,e},d.fromRotationTranslation=function(e,t,i){return s.a.fromRotationTranslation(e.array,t.array,i.array),e._dirty=!0,e},d.fromMat2d=function(e,t){return e._dirty=!0,t=t.array,(e=e.array)[0]=t[0],e[4]=t[2],e[12]=t[4],e[1]=t[1],e[5]=t[3],e[13]=t[5],e},d.rotate=function(e,t,i,n){return s.a.rotate(e.array,t.array,i,n.array),e._dirty=!0,e},d.rotateX=function(e,t,i){return s.a.rotateX(e.array,t.array,i),e._dirty=!0,e},d.rotateY=function(e,t,i){return s.a.rotateY(e.array,t.array,i),e._dirty=!0,e},d.rotateZ=function(e,t,i){return s.a.rotateZ(e.array,t.array,i),e._dirty=!0,e},d.scale=function(e,t,i){return s.a.scale(e.array,t.array,i.array),e._dirty=!0,e},d.transpose=function(e,t){return s.a.transpose(e.array,t.array),e._dirty=!0,e},d.translate=function(e,t,i){return s.a.translate(e.array,t.array,i.array),e._dirty=!0,e},t.a=d},function(e,t,i){var n=i(7),r=i(4);i(27);var a=i(11),o=i(57),s="framebuffer",l="renderbuffer",u="renderbuffer_width",h="renderbuffer_height",c="renderbuffer_attached",d="depthtexture_attached",f=a.a.FRAMEBUFFER,p=a.a.RENDERBUFFER,g=a.a.DEPTH_ATTACHMENT,m=a.a.COLOR_ATTACHMENT0,v=n.a.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new o.a,this._textures={}}),{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer(f,this._getFrameBufferGL(e)),this._boundRenderer=e;var i=this._cache;i.put("viewport",e.viewport);var n,r,a=!1;for(var o in this._textures){a=!0;var s=this._textures[o];s&&(n=s.texture.width,r=s.texture.height,this._doAttach(e,s.texture,o,s.target))}this._width=n,this._height=r,!a&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,n,r,1);var m=i.get("attached_textures");if(m)for(var o in m)if(!this._textures[o]){var v=m[o];this._doDetach(t,o,v)}if(!i.get(d)&&this.depthBuffer){i.miss(l)&&i.put(l,t.createRenderbuffer());var y=i.get(l);n===i.get(u)&&r===i.get(h)||(t.bindRenderbuffer(p,y),t.renderbufferStorage(p,t.DEPTH_COMPONENT16,n,r),i.put(u,n),i.put(h,r),t.bindRenderbuffer(p,null)),i.get(c)||(t.framebufferRenderbuffer(f,g,p,y),i.put(c,!0))}},unbind:function(e){e.__currentFrameBuffer=null,e.gl.bindFramebuffer(f,null),this._boundRenderer=null,this._cache.use(e.__uid__);var t=this._cache.get("viewport");t&&e.setViewport(t),this.updateMipmap(e)},updateMipmap:function(e){var t=e.gl;for(var i in this._textures){var n=this._textures[i];if(n){var o=n.texture;if(!o.NPOT&&o.useMipmap&&o.minFilter===r.a.LINEAR_MIPMAP_LINEAR){var s="textureCube"===o.textureType?a.a.TEXTURE_CUBE_MAP:a.a.TEXTURE_2D;t.bindTexture(s,o.getWebGLTexture(e)),t.generateMipmap(s),t.bindTexture(s,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(f)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(s)&&t.put(s,e.gl.createFramebuffer()),t.get(s)},attach:function(e,t,i){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||m,i=i||a.a.TEXTURE_2D;var n,r=this._boundRenderer;if(r&&r.gl){var o=this._cache;o.use(r.__uid__),n=o.get("attached_textures")}var s=this._textures[t];if(!s||s.target!==i||s.texture!==e||!n||null==n[t]){var l=!0;r&&(l=this._doAttach(r,e,t,i),this.viewport||r.setViewport(0,0,e.width,e.height,1)),l&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=i)}},_doAttach:function(e,t,i,n){var r=e.gl,o=t.getWebGLTexture(e),s=this._cache.get("attached_textures");if(s&&s[i]){var u=s[i];if(u.texture===t&&u.target===n)return}var h=!0;if(((i=+i)===g||i===a.a.DEPTH_STENCIL_ATTACHMENT)&&(e.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),h=!1),t.format!==a.a.DEPTH_COMPONENT&&t.format!==a.a.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),h=!1),h)){var m=this._cache.get(l);m&&(r.framebufferRenderbuffer(f,g,p,null),r.deleteRenderbuffer(m),this._cache.put(l,!1)),this._cache.put(c,!1),this._cache.put(d,!0)}return r.framebufferTexture2D(f,i,n,o,0),s||(s={},this._cache.put("attached_textures",s)),s[i]=s[i]||{},s[i].texture=t,s[i].target=n,h},_doDetach:function(e,t,i){e.framebufferTexture2D(f,t,i,null,0);var n=this._cache.get("attached_textures");n&&n[t]&&(n[t]=null),t!==g&&t!==a.a.DEPTH_STENCIL_ATTACHMENT||this._cache.put(d,!1)},detach:function(e,t){this._textures[e]=null,this._boundRenderer&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t))},dispose:function(e){var t=e.gl,i=this._cache;i.use(e.__uid__);var n=i.get(l);n&&t.deleteRenderbuffer(n);var r=i.get(s);r&&t.deleteFramebuffer(r),i.deleteContext(e.__uid__),this._textures={}}});v.DEPTH_ATTACHMENT=g,v.COLOR_ATTACHMENT0=m,v.STENCIL_ATTACHMENT=a.a.STENCIL_ATTACHMENT,v.DEPTH_STENCIL_ATTACHMENT=a.a.DEPTH_STENCIL_ATTACHMENT,t.a=v},function(e,t,i){t.a={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444}},function(e,t,i){var n,r=i(20),a={create:function(){var e=new r.a(3);return e[0]=0,e[1]=0,e[2]=0,e},clone:function(e){var t=new r.a(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:function(e,t,i){var n=new r.a(3);return n[0]=e,n[1]=t,n[2]=i,n},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},set:function(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e},add:function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e},subtract:function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}};a.sub=a.subtract,a.multiply=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e},a.mul=a.multiply,a.divide=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e},a.div=a.divide,a.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e},a.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e},a.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e},a.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e[2]=t[2]+i[2]*n,e},a.distance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(i*i+n*n+r*r)},a.dist=a.distance,a.squaredDistance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return i*i+n*n+r*r},a.sqrDist=a.squaredDistance,a.length=function(e){var t=e[0],i=e[1],n=e[2];return Math.sqrt(t*t+i*i+n*n)},a.len=a.length,a.squaredLength=function(e){var t=e[0],i=e[1],n=e[2];return t*t+i*i+n*n},a.sqrLen=a.squaredLength,a.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},a.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},a.normalize=function(e,t){var i=t[0],n=t[1],r=t[2],a=i*i+n*n+r*r;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},a.cross=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2];return e[0]=r*l-a*s,e[1]=a*o-n*l,e[2]=n*s-r*o,e},a.lerp=function(e,t,i,n){var r=t[0],a=t[1],o=t[2];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e[2]=o+n*(i[2]-o),e},a.random=function(e,t){t=t||1;var i=2*Object(r.c)()*Math.PI,n=2*Object(r.c)()-1,a=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(i)*a,e[1]=Math.sin(i)*a,e[2]=n*t,e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[3]*n+i[7]*r+i[11]*a+i[15];return o=o||1,e[0]=(i[0]*n+i[4]*r+i[8]*a+i[12])/o,e[1]=(i[1]*n+i[5]*r+i[9]*a+i[13])/o,e[2]=(i[2]*n+i[6]*r+i[10]*a+i[14])/o,e},a.transformMat3=function(e,t,i){var n=t[0],r=t[1],a=t[2];return e[0]=n*i[0]+r*i[3]+a*i[6],e[1]=n*i[1]+r*i[4]+a*i[7],e[2]=n*i[2]+r*i[5]+a*i[8],e},a.transformQuat=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2],u=i[3],h=u*n+s*a-l*r,c=u*r+l*n-o*a,d=u*a+o*r-s*n,f=-o*n-s*r-l*a;return e[0]=h*u+f*-o+c*-l-d*-s,e[1]=c*u+f*-s+d*-o-h*-l,e[2]=d*u+f*-l+h*-s-c*-o,e},a.rotateX=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[0],a[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),a[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.rotateY=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),a[1]=r[1],a[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.rotateZ=function(e,t,i,n){var r=[],a=[];return r[0]=t[0]-i[0],r[1]=t[1]-i[1],r[2]=t[2]-i[2],a[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),a[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),a[2]=r[2],e[0]=a[0]+i[0],e[1]=a[1]+i[1],e[2]=a[2]+i[2],e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=3),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],a(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2];return e}),a.angle=function(e,t){var i=a.fromValues(e[0],e[1],e[2]),n=a.fromValues(t[0],t[1],t[2]);a.normalize(i,i),a.normalize(n,n);var r=a.dot(i,n);return r>1?0:Math.acos(r)},t.a=a},function(e,t){var i={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},n={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},r=Object.prototype.toString,a=Array.prototype,o=a.forEach,s=a.filter,l=a.slice,u=a.map,h=a.reduce,c={};function d(e){if(null==e||"object"!=typeof e)return e;var t=e,a=r.call(e);if("[object Array]"===a){if(!S(e)){t=[];for(var o=0,s=e.length;o<s;o++)t[o]=d(e[o])}}else if(n[a]){if(!S(e)){var l=e.constructor;if(e.constructor.from)t=l.from(e);else for(t=new l(e.length),o=0,s=e.length;o<s;o++)t[o]=d(e[o])}}else if(!i[a]&&!S(e)&&!w(e))for(var u in t={},e)e.hasOwnProperty(u)&&(t[u]=d(e[u]));return t}function f(e,t,i){if(!x(t)||!x(e))return i?d(t):e;for(var n in t)if(t.hasOwnProperty(n)){var r=e[n],a=t[n];!x(a)||!x(r)||_(a)||_(r)||w(a)||w(r)||b(a)||b(r)||S(a)||S(r)?!i&&n in e||(e[n]=d(t[n])):f(r,a,i)}return e}function p(e,t,i){for(var n in t)t.hasOwnProperty(n)&&(i?null!=t[n]:null==e[n])&&(e[n]=t[n]);return e}var g,m=function(){return c.createCanvas()};function v(e,t,i){if(e&&t)if(e.forEach&&e.forEach===o)e.forEach(t,i);else if(e.length===+e.length)for(var n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(i,e[a],a,e)}function y(e,t){var i=l.call(arguments,2);return function(){return e.apply(t,i.concat(l.call(arguments)))}}function _(e){return"[object Array]"===r.call(e)}function x(e){var t=typeof e;return"function"===t||!!e&&"object"==t}function b(e){return!!i[r.call(e)]}function w(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}c.createCanvas=function(){return document.createElement("canvas")};var T="__ec_primitive__";function S(e){return e[T]}function M(e){var t=_(e),i=this;function n(e,n){t?i.set(e,n):i.set(n,e)}e instanceof M?e.each(n):e&&v(e,n)}M.prototype={constructor:M,get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]=t},each:function(e,t){for(var i in void 0!==t&&(e=y(e,t)),this)this.hasOwnProperty(i)&&e(this[i],i)},removeKey:function(e){delete this[e]}},t.$override=function(e,t){"createCanvas"===e&&(g=null),c[e]=t},t.clone=d,t.merge=f,t.mergeAll=function(e,t){for(var i=e[0],n=1,r=e.length;n<r;n++)i=f(i,e[n],t);return i},t.extend=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},t.defaults=p,t.createCanvas=m,t.getContext=function(){return g||(g=m().getContext("2d")),g},t.indexOf=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i}return-1},t.inherits=function(e,t){var i=e.prototype;function n(){}for(var r in n.prototype=t.prototype,e.prototype=new n,i)e.prototype[r]=i[r];e.prototype.constructor=e,e.superClass=t},t.mixin=function(e,t,i){p(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,i)},t.isArrayLike=function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},t.each=v,t.map=function(e,t,i){if(e&&t){if(e.map&&e.map===u)return e.map(t,i);for(var n=[],r=0,a=e.length;r<a;r++)n.push(t.call(i,e[r],r,e));return n}},t.reduce=function(e,t,i,n){if(e&&t){if(e.reduce&&e.reduce===h)return e.reduce(t,i,n);for(var r=0,a=e.length;r<a;r++)i=t.call(n,i,e[r],r,e);return i}},t.filter=function(e,t,i){if(e&&t){if(e.filter&&e.filter===s)return e.filter(t,i);for(var n=[],r=0,a=e.length;r<a;r++)t.call(i,e[r],r,e)&&n.push(e[r]);return n}},t.find=function(e,t,i){if(e&&t)for(var n=0,r=e.length;n<r;n++)if(t.call(i,e[n],n,e))return e[n]},t.bind=y,t.curry=function(e){var t=l.call(arguments,1);return function(){return e.apply(this,t.concat(l.call(arguments)))}},t.isArray=_,t.isFunction=function(e){return"function"==typeof e},t.isString=function(e){return"[object String]"===r.call(e)},t.isObject=x,t.isBuiltInObject=b,t.isTypedArray=function(e){return!!n[r.call(e)]},t.isDom=w,t.eqNaN=function(e){return e!=e},t.retrieve=function(e){for(var t=0,i=arguments.length;t<i;t++)if(null!=arguments[t])return arguments[t]},t.retrieve2=function(e,t){return null!=e?e:t},t.retrieve3=function(e,t,i){return null!=e?e:null!=t?t:i},t.slice=function(){return Function.call.apply(l,arguments)},t.normalizeCssArray=function(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e},t.assert=function(e,t){if(!e)throw new Error(t)},t.trim=function(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},t.setAsPrimitive=function(e){e[T]=!0},t.isPrimitive=S,t.createHashMap=function(e){return new M(e)},t.concatArray=function(e,t){for(var i=new e.constructor(e.length+t.length),n=0;n<e.length;n++)i[n]=e[n];var r=e.length;for(n=0;n<t.length;n++)i[n+r]=t[n];return i},t.noop=function(){}},function(e,t,i){(function(e){var n,r=i(112),a={supportWebGL:function(){if(null==n)try{var e=document.createElement("canvas");if(!e.getContext("webgl")&&!e.getContext("experimental-webgl"))throw new Error}catch(n8){n=!1}return n}};a.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,a.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,a.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,a.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,a.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,a.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,a.Float64Array="undefined"==typeof Float64Array?Array:Float64Array;var o={};"undefined"!=typeof window?o=window:void 0!==e&&(o=e),a.requestAnimationFrame=o.requestAnimationFrame||o.msRequestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},a.createCanvas=function(){return document.createElement("canvas")},a.createImage=function(){return new o.Image},a.request={get:r.a.get},t.a=a}).call(t,i(68))},function(e,t,i){var n=i(14),r=i(12),a=i(21),o=i(18),s=i(118),l=r.a.create,u=r.a.add,h=r.a.set,c=s.a.Attribute,d=s.a.extend((function(){return{attributes:{position:new c("position","float",3,"POSITION"),texcoord0:new c("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new c("texcoord1","float",2,"TEXCOORD_1"),normal:new c("normal","float",3,"NORMAL"),tangent:new c("tangent","float",4,"TANGENT"),color:new c("color","float",4,"COLOR"),weight:new c("weight","float",3,"WEIGHT"),joint:new c("joint","float",4,"JOINT"),barycentric:new c("barycentric","float",3,null)},boundingBox:null}}),{mainAttribute:"position",updateBoundingBox:function(){var e=this.boundingBox;e||(e=this.boundingBox=new o.a);var t=this.attributes.position.value;if(t&&t.length){var i=e.min,n=e.max,a=i.array,s=n.array;r.a.set(a,t[0],t[1],t[2]),r.a.set(s,t[0],t[1],t[2]);for(var l=3;l<t.length;){var u=t[l++],h=t[l++],c=t[l++];u<a[0]&&(a[0]=u),h<a[1]&&(a[1]=h),c<a[2]&&(a[2]=c),u>s[0]&&(s[0]=u),h>s[1]&&(s[1]=h),c>s[2]&&(s[2]=c)}i._dirty=!0,n._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,i=t.position.value,a=t.normal.value;if(a&&a.length===i.length)for(var o=0;o<a.length;o++)a[o]=0;else a=t.normal.value=new n.a.Float32Array(i.length);for(var s,u,c,d=l(),f=l(),p=l(),g=l(),m=l(),v=l(),y=e?e.length:this.vertexCount,_=0;_<y;)for(e?(s=e[_++],u=e[_++],c=e[_++]):(s=_++,u=_++,c=_++),h(d,i[3*s],i[3*s+1],i[3*s+2]),h(f,i[3*u],i[3*u+1],i[3*u+2]),h(p,i[3*c],i[3*c+1],i[3*c+2]),r.a.sub(g,d,f),r.a.sub(m,f,p),r.a.cross(v,g,m),o=0;o<3;o++)a[3*s+o]=a[3*s+o]+v[o],a[3*u+o]=a[3*u+o]+v[o],a[3*c+o]=a[3*c+o]+v[o];for(o=0;o<a.length;)h(v,a[o],a[o+1],a[o+2]),r.a.normalize(v,v),a[o++]=v[0],a[o++]=v[1],a[o++]=v[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.indices,t=this.attributes,i=t.position.value,n=t.normal.value,a=l(),o=l(),s=l(),u=l(),c=l(),d=l();n||(n=t.normal.value=new Float32Array(i.length));for(var f,p,g,m=e?e.length:this.vertexCount,v=0;v<m;){e?(f=e[v++],p=e[v++],g=e[v++]):(f=v++,p=v++,g=v++),h(a,i[3*f],i[3*f+1],i[3*f+2]),h(o,i[3*p],i[3*p+1],i[3*p+2]),h(s,i[3*g],i[3*g+1],i[3*g+2]),r.a.sub(u,a,o),r.a.sub(c,o,s),r.a.cross(d,u,c),r.a.normalize(d,d);for(var y=0;y<3;y++)n[3*f+y]=d[y],n[3*p+y]=d[y],n[3*g+y]=d[y]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var e=this.vertexCount,t=this.attributes;t.tangent.value||(t.tangent.value=new Float32Array(4*e));var i=t.texcoord0.value,n=t.position.value,a=t.tangent.value,o=t.normal.value;if(i){for(var s=[],h=[],c=0;c<e;c++)s[c]=[0,0,0],h[c]=[0,0,0];var d,f,p,g=[0,0,0],m=[0,0,0],v=this.indices,y=v?v.length:this.vertexCount;for(c=0;c<y;){v?(d=v[c++],f=v[c++],p=v[c++]):(d=c++,f=c++,p=c++);var _=i[2*d],x=i[2*f],b=i[2*p],w=i[2*d+1],T=i[2*f+1],S=i[2*p+1],M=n[3*d],A=n[3*f],I=n[3*p],C=n[3*d+1],D=n[3*f+1],E=n[3*p+1],L=n[3*d+2],P=A-M,N=I-M,R=D-C,O=E-C,k=n[3*f+2]-L,z=n[3*p+2]-L,B=x-_,F=b-_,V=T-w,G=S-w,H=1/(B*G-V*F);g[0]=(G*P-V*N)*H,g[1]=(G*R-V*O)*H,g[2]=(G*k-V*z)*H,m[0]=(B*N-F*P)*H,m[1]=(B*O-F*R)*H,m[2]=(B*z-F*k)*H,u(s[d],s[d],g),u(s[f],s[f],g),u(s[p],s[p],g),u(h[d],h[d],m),u(h[f],h[f],m),u(h[p],h[p],m)}var U=l(),W=l(),j=l();for(c=0;c<e;c++){j[0]=o[3*c],j[1]=o[3*c+1],j[2]=o[3*c+2];var X=s[c];r.a.scale(U,j,r.a.dot(j,X)),r.a.sub(U,X,U),r.a.normalize(U,U),r.a.cross(W,j,X),a[4*c]=U[0],a[4*c+1]=U[1],a[4*c+2]=U[2],a[4*c+3]=r.a.dot(W,h[c])<0?-1:1}this.dirty()}else console.warn("Geometry without texcoords can't generate tangents.")}},isUniqueVertex:function(){return!this.isUseIndices()||this.vertexCount===this.indices.length},generateUniqueVertex:function(){if(this.vertexCount&&this.indices){this.indices.length>65535&&(this.indices=new n.a.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,i=this.getEnabledAttributes(),r={},a=0;a<i.length;a++)r[u=i[a]]=e[u].value,e[u].init(this.indices.length);for(var o=0,s=0;s<t.length;s++){var l=t[s];for(a=0;a<i.length;a++)for(var u,h=e[u=i[a]].value,c=e[u].size,d=0;d<c;d++)h[o*c+d]=r[u][l*c+d];t[s]=o,o++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var e=this.attributes,t=e.barycentric.value,i=this.indices;if(!t||t.length!==3*i.length){t=e.barycentric.value=new Float32Array(3*i.length);for(var n=0;n<(i?i.length:this.vertexCount/3);)for(var r=0;r<3;r++)t[3*(i?i[n++]:3*n+r)+r]=1;this.dirty()}}},applyTransform:function(e){var t=this.attributes,i=t.position.value,n=t.normal.value,o=t.tangent.value;e=e.array;var s=a.a.create();a.a.invert(s,e),a.a.transpose(s,s);var l=r.a.transformMat4,u=r.a.forEach;u(i,3,0,null,l,e),n&&u(n,3,0,null,l,s),o&&u(o,4,0,null,l,s),this.boundingBox&&this.updateBoundingBox()},dispose:function(e){var t=this._cache;t.use(e.__uid__);var i=t.get("chunks");if(i)for(var n=0;n<i.length;n++){for(var r=i[n],a=0;a<r.attributeBuffers.length;a++){var o=r.attributeBuffers[a];e.gl.deleteBuffer(o.buffer)}r.indicesBuffer&&e.gl.deleteBuffer(r.indicesBuffer.buffer)}if(this.__vaoCache){var s=e.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});d.STATIC_DRAW=s.a.STATIC_DRAW,d.DYNAMIC_DRAW=s.a.DYNAMIC_DRAW,d.STREAM_DRAW=s.a.STREAM_DRAW,d.AttributeBuffer=s.a.AttributeBuffer,d.IndicesBuffer=s.a.IndicesBuffer,d.Attribute=c,t.a=d},function(e,t,i){var n=i(7),r=i(37),a=i(43),o=i(8),s=i(19),l=i(40),u=i(11),h=i(126);o.a.import(h.a);var c=new a.a,d=new l.a({geometry:c,frustumCulling:!1}),f=new r.a,p=n.a.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var e=new o.a(o.a.source("clay.compositor.vertex"),this.fragment),t=new s.a({shader:e});t.enableTexturesAll(),this.material=t}),{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||u.a.COLOR_ATTACHMENT0,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var i in this.outputs){var n=this.outputs[i];n&&t.attach(n,i)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var i=e.gl;if(t){this.bind(e,t);var n=e.getGLExtension("EXT_draw_buffers");if(n&&this.outputs){var r=[];for(var a in this.outputs)(a=+a)>=i.COLOR_ATTACHMENT0&&a<=i.COLOR_ATTACHMENT0+8&&r.push(a);n.drawBuffersEXT(r)}}this.trigger("beforerender",this,e);var o=this.clearDepth?i.DEPTH_BUFFER_BIT:0;if(i.depthMask(!0),this.clearColor){o|=i.COLOR_BUFFER_BIT,i.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&i.clearColor(s[0],s[1],s[2],s[3])}i.clear(o),this.blendWithPrevious?(i.enable(i.BLEND),this.material.transparent=!0):(i.disable(i.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){d.material=this.material,e.renderPass([d],f)},dispose:function(e){}});t.a=p},function(e,t,i){t.a=function(e,t,i){return{seriesType:e,reset:function(e,t){var i=e.getData(),n=e.visualColorAccessPath.split(".");n[n.length-1]="opacity";var r=e.get(n);return i.setVisual("opacity",null==r?1:r),{dataEach:i.hasItemOption?function(e,t){var i=e.getItemModel(t).get(n,!0);null!=i&&e.setItemVisual(t,"opacity",i)}:null}}}}},function(e,t,i){var n,r,a,o,s,l,u=i(3),h=i(12),c=h.a.set,d=h.a.copy,f=function(e,t){this.min=e||new u.a(1/0,1/0,1/0),this.max=t||new u.a(-1/0,-1/0,-1/0),this.vertices=null};f.prototype={constructor:f,updateFromVertices:function(e){if(e.length>0){var t=this.min,i=this.max,n=t.array,r=i.array;d(n,e[0]),d(r,e[0]);for(var a=1;a<e.length;a++){var o=e[a];o[0]<n[0]&&(n[0]=o[0]),o[1]<n[1]&&(n[1]=o[1]),o[2]<n[2]&&(n[2]=o[2]),o[0]>r[0]&&(r[0]=o[0]),o[1]>r[1]&&(r[1]=o[1]),o[2]>r[2]&&(r[2]=o[2])}t._dirty=!0,i._dirty=!0}},union:function(e){var t=this.min,i=this.max;return h.a.min(t.array,t.array,e.min.array),h.a.max(i.array,i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},intersection:function(e){var t=this.min,i=this.max;return h.a.max(t.array,t.array,e.min.array),h.a.min(i.array,i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,i=this.max.array,n=e.min.array,r=e.max.array;return!(t[0]>r[0]||t[1]>r[1]||t[2]>r[2]||i[0]<n[0]||i[1]<n[1]||i[2]<n[2])},containBoundingBox:function(e){var t=this.min.array,i=this.max.array,n=e.min.array,r=e.max.array;return t[0]<=n[0]&&t[1]<=n[1]&&t[2]<=n[2]&&i[0]>=r[0]&&i[1]>=r[1]&&i[2]>=r[2]},containPoint:function(e){var t=this.min.array,i=this.max.array,n=e.array;return t[0]<=n[0]&&t[1]<=n[1]&&t[2]<=n[2]&&i[0]>=n[0]&&i[1]>=n[1]&&i[2]>=n[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:function(e){this.transformFrom(this,e)},transformFrom:(n=h.a.create(),r=h.a.create(),a=h.a.create(),o=h.a.create(),s=h.a.create(),l=h.a.create(),function(e,t){var i=e.min.array,u=e.max.array,h=t.array;return n[0]=h[0]*i[0],n[1]=h[1]*i[0],n[2]=h[2]*i[0],r[0]=h[0]*u[0],r[1]=h[1]*u[0],r[2]=h[2]*u[0],a[0]=h[4]*i[1],a[1]=h[5]*i[1],a[2]=h[6]*i[1],o[0]=h[4]*u[1],o[1]=h[5]*u[1],o[2]=h[6]*u[1],s[0]=h[8]*i[2],s[1]=h[9]*i[2],s[2]=h[10]*i[2],l[0]=h[8]*u[2],l[1]=h[9]*u[2],l[2]=h[10]*u[2],i=this.min.array,u=this.max.array,i[0]=Math.min(n[0],r[0])+Math.min(a[0],o[0])+Math.min(s[0],l[0])+h[12],i[1]=Math.min(n[1],r[1])+Math.min(a[1],o[1])+Math.min(s[1],l[1])+h[13],i[2]=Math.min(n[2],r[2])+Math.min(a[2],o[2])+Math.min(s[2],l[2])+h[14],u[0]=Math.max(n[0],r[0])+Math.max(a[0],o[0])+Math.max(s[0],l[0])+h[12],u[1]=Math.max(n[1],r[1])+Math.max(a[1],o[1])+Math.max(s[1],l[1])+h[13],u[2]=Math.max(n[2],r[2])+Math.max(a[2],o[2])+Math.max(s[2],l[2])+h[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t=this.min.array,i=this.max.array,n=e.array,r=t[0],a=t[1],o=t[2],s=i[0],l=i[1],u=t[2],h=i[0],c=i[1],d=i[2];if(1===n[15])t[0]=n[0]*r+n[12],t[1]=n[5]*a+n[13],i[2]=n[10]*o+n[14],i[0]=n[0]*h+n[12],i[1]=n[5]*c+n[13],t[2]=n[10]*d+n[14];else{var f=-1/o;t[0]=n[0]*r*f,t[1]=n[5]*a*f,i[2]=(n[10]*o+n[14])*f,f=-1/u,i[0]=n[0]*s*f,i[1]=n[5]*l*f,f=-1/d,t[2]=(n[10]*d+n[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=h.a.fromValues(0,0,0);this.vertices=e}var i=this.min.array,n=this.max.array;return c(e[0],i[0],i[1],i[2]),c(e[1],i[0],n[1],i[2]),c(e[2],n[0],i[1],i[2]),c(e[3],n[0],n[1],i[2]),c(e[4],i[0],i[1],n[2]),c(e[5],i[0],n[1],n[2]),c(e[6],n[0],i[1],n[2]),c(e[7],n[0],n[1],n[2]),this},copy:function(e){var t=this.min,i=this.max;return d(t.array,e.min.array),d(i.array,e.max.array),t._dirty=!0,i._dirty=!0,this},clone:function(){var e=new f;return e.copy(this),e}},t.a=f},function(e,t,i){var n=i(7),r=i(23),a=i(113).a.parseToFloat,o={};function s(e){var t=Object.keys(e);t.sort();for(var i=[],n=0;n<t.length;n++){var r=t[n],a=e[r];null===a?i.push(r):i.push(r+" "+a.toString())}return i.join("\n")}var l=n.a.extend((function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}}),(function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)}),{precision:"highp",setUniform:function(e,t){void 0===t&&console.warn('Uniform value "'+e+'" is undefined');var i=this.uniforms[e];i&&("string"==typeof t&&(t=a(t)||t),i.value=t,this.autoUpdateTextureStatus&&"t"===i.type&&(t?this.enableTexture(e):this.disableTexture(e)))},setUniforms:function(e){for(var t in e){var i=e[t];this.setUniform(t,i)}},isUniformEnabled:function(e){return this._enabledUniforms.indexOf(e)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if("object"==typeof e)for(var i in e){var n=e[i];this.setUniform(i,n)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var i=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var n=this.uniforms;this._enabledUniforms=Object.keys(n),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(e){var t=this.uniforms[e].type;return"t"===t||"tv"===t}),this);var a=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=r.a.clone(e.vertexDefines),this.fragmentDefines=r.a.clone(e.fragmentDefines),t){for(var s in i)n[s]&&(n[s].value=i[s].value);r.a.defaults(this.vertexDefines,a),r.a.defaults(this.fragmentDefines,o)}var l={};for(var u in e.textures)l[u]={shaderType:e.textures[u].shaderType,type:e.textures[u].type,enabled:!(!t||!this._textureStatus[u])&&this._textureStatus[u].enabled};this._textureStatus=l,this._programKey=""},clone:function(){var e=new this.constructor({name:this.name,shader:this.shader});for(var t in this.uniforms)e.uniforms[t].value=this.uniforms[t].value;return e.depthTest=this.depthTest,e.depthMask=this.depthMask,e.transparent=this.transparent,e.blend=this.blend,e.vertexDefines=r.a.clone(this.vertexDefines),e.fragmentDefines=r.a.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,i){var n=this.vertexDefines,r=this.fragmentDefines;"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<3&&(i=t,t=e,e="both"),i=null!=i?i:null,"vertex"!==e&&"both"!==e||n[t]!==i&&(n[t]=i,this._programKey=""),"fragment"!==e&&"both"!==e||r[t]!==i&&(r[t]=i,"both"!==e&&(this._programKey=""))},undefine:function(e,t){"vertex"!==e&&"fragment"!==e&&"both"!==e&&arguments.length<2&&(t=e,e="both"),"vertex"!==e&&"both"!==e||this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),"fragment"!==e&&"both"!==e||this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],"both"!==e&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return void 0!==this.vertexDefines[t];case"fragment":return void 0!==this.fragmentDefines[t]}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.enableTexture(e[t]);else{var i=this._textureStatus[e];i&&(i.enabled||(i.enabled=!0,this._programKey=""))}},enableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!0;this._programKey=""},disableTexture:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.disableTexture(e[t]);else{var i=this._textureStatus[e];i&&(!i.enabled||(i.enabled=!1,this._programKey=""))}},disableTexturesAll:function(){var e=this._textureStatus;for(var t in e)e[t].enabled=!1;this._programKey=""},isTextureEnabled:function(e){var t=this._textureStatus;return!!t[e]&&t[e].enabled},getEnabledTextures:function(){var e=[],t=this._textureStatus;for(var i in t)t[i].enabled&&e.push(i);return e},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=function(e,t,i){i.sort();for(var n=[],a=0;a<i.length;a++){var l=i[a];n.push(l)}var u=s(e)+"\n"+s(t)+"\n"+n.join("\n");if(o[u])return o[u];var h=r.a.genGUID();return o[u]=h,h}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}});t.a=l},function(e,t,i){i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return r})),i.d(t,"c",(function(){return a}));var n=1e-6,r=Array,a=Math.random},function(e,t,i){var n=i(20),r={create:function(){var e=new n.a(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},clone:function(e){var t=new n.a(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},transpose:function(e,t){if(e===t){var i=t[1],n=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},invert:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],v=t[15],y=i*s-n*o,_=i*l-r*o,x=i*u-a*o,b=n*l-r*s,w=n*u-a*s,T=r*u-a*l,S=h*g-c*p,M=h*m-d*p,A=h*v-f*p,I=c*m-d*g,C=c*v-f*g,D=d*v-f*m,E=y*D-_*C+x*I+b*A-w*M+T*S;return E?(E=1/E,e[0]=(s*D-l*C+u*I)*E,e[1]=(r*C-n*D-a*I)*E,e[2]=(g*T-m*w+v*b)*E,e[3]=(d*w-c*T-f*b)*E,e[4]=(l*A-o*D-u*M)*E,e[5]=(i*D-r*A+a*M)*E,e[6]=(m*x-p*T-v*_)*E,e[7]=(h*T-d*x+f*_)*E,e[8]=(o*C-s*A+u*S)*E,e[9]=(n*A-i*C-a*S)*E,e[10]=(p*w-g*x+v*y)*E,e[11]=(c*x-h*w-f*y)*E,e[12]=(s*M-o*I-l*S)*E,e[13]=(i*I-n*M+r*S)*E,e[14]=(g*_-p*b-m*y)*E,e[15]=(h*b-c*_+d*y)*E,e):null},adjoint:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],v=t[15];return e[0]=s*(d*v-f*m)-c*(l*v-u*m)+g*(l*f-u*d),e[1]=-(n*(d*v-f*m)-c*(r*v-a*m)+g*(r*f-a*d)),e[2]=n*(l*v-u*m)-s*(r*v-a*m)+g*(r*u-a*l),e[3]=-(n*(l*f-u*d)-s*(r*f-a*d)+c*(r*u-a*l)),e[4]=-(o*(d*v-f*m)-h*(l*v-u*m)+p*(l*f-u*d)),e[5]=i*(d*v-f*m)-h*(r*v-a*m)+p*(r*f-a*d),e[6]=-(i*(l*v-u*m)-o*(r*v-a*m)+p*(r*u-a*l)),e[7]=i*(l*f-u*d)-o*(r*f-a*d)+h*(r*u-a*l),e[8]=o*(c*v-f*g)-h*(s*v-u*g)+p*(s*f-u*c),e[9]=-(i*(c*v-f*g)-h*(n*v-a*g)+p*(n*f-a*c)),e[10]=i*(s*v-u*g)-o*(n*v-a*g)+p*(n*u-a*s),e[11]=-(i*(s*f-u*c)-o*(n*f-a*c)+h*(n*u-a*s)),e[12]=-(o*(c*m-d*g)-h*(s*m-l*g)+p*(s*d-l*c)),e[13]=i*(c*m-d*g)-h*(n*m-r*g)+p*(n*d-r*c),e[14]=-(i*(s*m-l*g)-o*(n*m-r*g)+p*(n*l-r*s)),e[15]=i*(s*d-l*c)-o*(n*d-r*c)+h*(n*l-r*s),e},determinant:function(e){var t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],h=e[9],c=e[10],d=e[11],f=e[12],p=e[13],g=e[14],m=e[15];return(t*o-i*a)*(c*m-d*g)-(t*s-n*a)*(h*m-d*p)+(t*l-r*a)*(h*g-c*p)+(i*s-n*o)*(u*m-d*f)-(i*l-r*o)*(u*g-c*f)+(n*l-r*s)*(u*p-h*f)},multiply:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=t[9],f=t[10],p=t[11],g=t[12],m=t[13],v=t[14],y=t[15],_=i[0],x=i[1],b=i[2],w=i[3];return e[0]=_*n+x*s+b*c+w*g,e[1]=_*r+x*l+b*d+w*m,e[2]=_*a+x*u+b*f+w*v,e[3]=_*o+x*h+b*p+w*y,_=i[4],x=i[5],b=i[6],w=i[7],e[4]=_*n+x*s+b*c+w*g,e[5]=_*r+x*l+b*d+w*m,e[6]=_*a+x*u+b*f+w*v,e[7]=_*o+x*h+b*p+w*y,_=i[8],x=i[9],b=i[10],w=i[11],e[8]=_*n+x*s+b*c+w*g,e[9]=_*r+x*l+b*d+w*m,e[10]=_*a+x*u+b*f+w*v,e[11]=_*o+x*h+b*p+w*y,_=i[12],x=i[13],b=i[14],w=i[15],e[12]=_*n+x*s+b*c+w*g,e[13]=_*r+x*l+b*d+w*m,e[14]=_*a+x*u+b*f+w*v,e[15]=_*o+x*h+b*p+w*y,e},multiplyAffine:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[4],s=t[5],l=t[6],u=t[8],h=t[9],c=t[10],d=t[12],f=t[13],p=t[14],g=i[0],m=i[1],v=i[2];return e[0]=g*n+m*o+v*u,e[1]=g*r+m*s+v*h,e[2]=g*a+m*l+v*c,g=i[4],m=i[5],v=i[6],e[4]=g*n+m*o+v*u,e[5]=g*r+m*s+v*h,e[6]=g*a+m*l+v*c,g=i[8],m=i[9],v=i[10],e[8]=g*n+m*o+v*u,e[9]=g*r+m*s+v*h,e[10]=g*a+m*l+v*c,g=i[12],m=i[13],v=i[14],e[12]=g*n+m*o+v*u+d,e[13]=g*r+m*s+v*h+f,e[14]=g*a+m*l+v*c+p,e}};r.mul=r.multiply,r.mulAffine=r.multiplyAffine,r.translate=function(e,t,i){var n,r,a,o,s,l,u,h,c,d,f,p,g=i[0],m=i[1],v=i[2];return t===e?(e[12]=t[0]*g+t[4]*m+t[8]*v+t[12],e[13]=t[1]*g+t[5]*m+t[9]*v+t[13],e[14]=t[2]*g+t[6]*m+t[10]*v+t[14],e[15]=t[3]*g+t[7]*m+t[11]*v+t[15]):(n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=t[9],f=t[10],p=t[11],e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=h,e[8]=c,e[9]=d,e[10]=f,e[11]=p,e[12]=n*g+s*m+c*v+t[12],e[13]=r*g+l*m+d*v+t[13],e[14]=a*g+u*m+f*v+t[14],e[15]=o*g+h*m+p*v+t[15]),e},r.scale=function(e,t,i){var n=i[0],r=i[1],a=i[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},r.rotate=function(e,t,i,r){var a,o,s,l,u,h,c,d,f,p,g,m,v,y,_,x,b,w,T,S,M,A,I,C,D=r[0],E=r[1],L=r[2],P=Math.sqrt(D*D+E*E+L*L);return Math.abs(P)<n.b?null:(D*=P=1/P,E*=P,L*=P,a=Math.sin(i),s=1-(o=Math.cos(i)),l=t[0],u=t[1],h=t[2],c=t[3],d=t[4],f=t[5],p=t[6],g=t[7],m=t[8],v=t[9],y=t[10],_=t[11],x=D*D*s+o,b=E*D*s+L*a,w=L*D*s-E*a,T=D*E*s-L*a,S=E*E*s+o,M=L*E*s+D*a,A=D*L*s+E*a,I=E*L*s-D*a,C=L*L*s+o,e[0]=l*x+d*b+m*w,e[1]=u*x+f*b+v*w,e[2]=h*x+p*b+y*w,e[3]=c*x+g*b+_*w,e[4]=l*T+d*S+m*M,e[5]=u*T+f*S+v*M,e[6]=h*T+p*S+y*M,e[7]=c*T+g*S+_*M,e[8]=l*A+d*I+m*C,e[9]=u*A+f*I+v*C,e[10]=h*A+p*I+y*C,e[11]=c*A+g*I+_*C,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},r.rotateX=function(e,t,i){var n=Math.sin(i),r=Math.cos(i),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],h=t[9],c=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*r+u*n,e[5]=o*r+h*n,e[6]=s*r+c*n,e[7]=l*r+d*n,e[8]=u*r-a*n,e[9]=h*r-o*n,e[10]=c*r-s*n,e[11]=d*r-l*n,e},r.rotateY=function(e,t,i){var n=Math.sin(i),r=Math.cos(i),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],h=t[9],c=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r-u*n,e[1]=o*r-h*n,e[2]=s*r-c*n,e[3]=l*r-d*n,e[8]=a*n+u*r,e[9]=o*n+h*r,e[10]=s*n+c*r,e[11]=l*n+d*r,e},r.rotateZ=function(e,t,i){var n=Math.sin(i),r=Math.cos(i),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],h=t[5],c=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*r+u*n,e[1]=o*r+h*n,e[2]=s*r+c*n,e[3]=l*r+d*n,e[4]=u*r-a*n,e[5]=h*r-o*n,e[6]=c*r-s*n,e[7]=d*r-l*n,e},r.fromRotationTranslation=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=n+n,l=r+r,u=a+a,h=n*s,c=n*l,d=n*u,f=r*l,p=r*u,g=a*u,m=o*s,v=o*l,y=o*u;return e[0]=1-(f+g),e[1]=c+y,e[2]=d-v,e[3]=0,e[4]=c-y,e[5]=1-(h+g),e[6]=p+m,e[7]=0,e[8]=d+v,e[9]=p-m,e[10]=1-(h+f),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e},r.fromQuat=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i+i,s=n+n,l=r+r,u=i*o,h=n*o,c=n*s,d=r*o,f=r*s,p=r*l,g=a*o,m=a*s,v=a*l;return e[0]=1-c-p,e[1]=h+v,e[2]=d-m,e[3]=0,e[4]=h-v,e[5]=1-u-p,e[6]=f+g,e[7]=0,e[8]=d+m,e[9]=f-g,e[10]=1-u-c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},r.frustum=function(e,t,i,n,r,a,o){var s=1/(i-t),l=1/(r-n),u=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(i+t)*s,e[9]=(r+n)*l,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0,e},r.perspective=function(e,t,i,n,r){var a=1/Math.tan(t/2),o=1/(n-r);return e[0]=a/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(r+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*r*n*o,e[15]=0,e},r.ortho=function(e,t,i,n,r,a,o){var s=1/(t-i),l=1/(n-r),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*s,e[13]=(r+n)*l,e[14]=(o+a)*u,e[15]=1,e},r.lookAt=function(e,t,i,a){var o,s,l,u,h,c,d,f,p,g,m=t[0],v=t[1],y=t[2],_=a[0],x=a[1],b=a[2],w=i[0],T=i[1],S=i[2];return Math.abs(m-w)<n.b&&Math.abs(v-T)<n.b&&Math.abs(y-S)<n.b?r.identity(e):(d=m-w,f=v-T,p=y-S,o=x*(p*=g=1/Math.sqrt(d*d+f*f+p*p))-b*(f*=g),s=b*(d*=g)-_*p,l=_*f-x*d,(g=Math.sqrt(o*o+s*s+l*l))?(o*=g=1/g,s*=g,l*=g):(o=0,s=0,l=0),u=f*l-p*s,h=p*o-d*l,c=d*s-f*o,(g=Math.sqrt(u*u+h*h+c*c))?(u*=g=1/g,h*=g,c*=g):(u=0,h=0,c=0),e[0]=o,e[1]=u,e[2]=d,e[3]=0,e[4]=s,e[5]=h,e[6]=f,e[7]=0,e[8]=l,e[9]=c,e[10]=p,e[11]=0,e[12]=-(o*m+s*v+l*y),e[13]=-(u*m+h*v+c*y),e[14]=-(d*m+f*v+p*y),e[15]=1,e)},r.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2)+Math.pow(e[9],2)+Math.pow(e[10],2)+Math.pow(e[11],2)+Math.pow(e[12],2)+Math.pow(e[13],2)+Math.pow(e[14],2)+Math.pow(e[15],2))},t.a=r},function(e,t,i){var n=i(0),r=i.n(n),a=i(36),o=i(174),s=i(41),l=i(37),u=i(9),h=i(3),c=i(26),d=i(53),f=i(176),p=i(200),g=i(49);function m(e){e=e||"perspective",this.layer=null,this.scene=new a.a,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new f.a,this._temporalSS=new p.a,this._shadowMapPass=new o.a;for(var t=[],i=0,n=0;n<30;n++){for(var r=[],s=0;s<6;s++)r.push(4*Object(g.a)(i,2)-2),r.push(4*Object(g.a)(i,3)-2),i++;t.push(r)}this._pcfKernels=t,this.scene.on("beforerender",(function(e,t,i){this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,i)}),this)}m.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),"perspective"===e?this.camera instanceof s.a||(this.camera=new s.a,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof l.a||(this.camera=new l.a,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3},m.prototype.setViewport=function(e,t,i,n,r){this.camera instanceof s.a&&(this.camera.aspect=i/n),r=r||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=i,this.viewport.height=n,this.viewport.devicePixelRatio=r,this._compositor.resize(i*r,n*r),this._temporalSS.resize(i*r,n*r)},m.prototype.containPoint=function(e,t){var i=this.viewport;return t=this.layer.renderer.getHeight()-t,e>=i.x&&t>=i.y&&e<=i.x+i.width&&t<=i.y+i.height};var v=new c.a;m.prototype.castRay=function(e,t,i){var n=this.layer.renderer,r=n.viewport;return n.viewport=this.viewport,n.screenToNDC(e,t,v),this.camera.castRay(v,i),n.viewport=r,i},m.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;t<e.transparent.length;t++){var i=e.transparent[t].geometry;i.needsSortVerticesProgressively&&i.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),i.needsSortTrianglesProgressively&&i.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},m.prototype.render=function(e,t){this._doRender(e,t,this._frame),this._frame++},m.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},m.prototype.needsTemporalSS=function(){var e=this._enableTemporalSS;return"auto"===e&&(e=this._enablePostEffect),e},m.prototype.hasDOF=function(){return this._enableDOF},m.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},m.prototype._doRender=function(e,t,i){var n=this.scene,r=this.camera;i=i||0,this._updateTransparent(e,n,r,i),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,n,r,!0)),this._updateShadowPCFKernel(i);var a,o=e.clearColor;e.gl.clearColor(o[0],o[1],o[2],o[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,r),this._compositor.updateNormal(e,n,r,this._temporalSS.getFrame())),this._updateSSAO(e,n,r,this._temporalSS.getFrame()),this._enablePostEffect?((a=this._compositor.getSourceFrameBuffer()).bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(n,r,!0,!0),a.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,n,r,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,n,r,null,0))):this.needsTemporalSS()&&t?((a=this._temporalSS.getSourceFrameBuffer()).bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(n,r,!0,!0),e.restoreClear(),a.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),e.render(n,r,!0,!0))},m.prototype._updateTransparent=function(e,t,i,n){for(var r=new h.a,a=new u.a,o=i.getWorldPosition(),s=t.getRenderList(i).transparent,l=0;l<s.length;l++){var c=s[l],d=c.geometry;u.a.invert(a,c.worldTransform),h.a.transformMat4(r,o,a),d.needsSortTriangles&&d.needsSortTriangles()&&d.doSortTriangles(r,n),d.needsSortVertices&&d.needsSortVertices()&&d.doSortVertices(r,n)}},m.prototype._updateSSAO=function(e,t,i){var n=this._enableSSAO&&this._enablePostEffect;n&&this._compositor.updateSSAO(e,t,i,this._temporalSS.getFrame());for(var r=t.getRenderList(i),a=0;a<r.opaque.length;a++){var o=r.opaque[a];o.renderNormal&&o.material[n?"enableTexture":"disableTexture"]("ssaoMap"),n&&o.material.set("ssaoMap",this._compositor.getSSAOTexture())}},m.prototype._updateShadowPCFKernel=function(e){for(var t=this._pcfKernels[e%this._pcfKernels.length],i=this.scene.getRenderList(this.camera).opaque,n=0;n<i.length;n++)i[n].receiveShadow&&(i[n].material.set("pcfKernel",t),i[n].material.define("fragment","PCF_KERNEL_SIZE",t.length/2))},m.prototype.dispose=function(e){this._compositor.dispose(e.gl),this._temporalSS.dispose(e.gl),this._shadowMapPass.dispose(e)},m.prototype.setPostEffect=function(e,t){var i=this._compositor;this._enablePostEffect=e.get("enable");var n=e.getModel("bloom"),r=e.getModel("edge"),a=e.getModel("DOF",e.getModel("depthOfField")),o=e.getModel("SSAO",e.getModel("screenSpaceAmbientOcclusion")),s=e.getModel("SSR",e.getModel("screenSpaceReflection")),l=e.getModel("FXAA"),u=e.getModel("colorCorrection");n.get("enable")?i.enableBloom():i.disableBloom(),a.get("enable")?i.enableDOF():i.disableDOF(),s.get("enable")?i.enableSSR():i.disableSSR(),u.get("enable")?i.enableColorCorrection():i.disableColorCorrection(),r.get("enable")?i.enableEdge():i.disableEdge(),l.get("enable")?i.enableFXAA():i.disableFXAA(),this._enableDOF=a.get("enable"),this._enableSSAO=o.get("enable"),this._enableSSAO?i.enableSSAO():i.disableSSAO(),i.setBloomIntensity(n.get("intensity")),i.setEdgeColor(r.get("color")),i.setColorLookupTexture(u.get("lookupTexture"),t),i.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach((function(e){i.setSSAOParameter(e,o.get(e))})),["quality","maxRoughness","physical"].forEach((function(e){i.setSSRParameter(e,s.get(e))})),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach((function(e){i.setDOFParameter(e,a.get(e))})),["brightness","contrast","saturation"].forEach((function(e){i.setColorCorrection(e,u.get(e))}))},m.prototype.setDOFFocusOnPoint=function(e){if(this._enablePostEffect){if(e>this.camera.far||e<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",e),!0}},m.prototype.setTemporalSuperSampling=function(e){this._enableTemporalSS=e.get("enable")},m.prototype.isLinearSpace=function(){return this._enablePostEffect},m.prototype.setRootNode=function(e){if(this.rootNode!==e){for(var t=this.rootNode.children(),i=0;i<t.length;i++)e.add(t[i]);e!==this.scene&&this.scene.add(e),this.rootNode=e}},m.prototype.add=function(e){this.rootNode.add(e)},m.prototype.remove=function(e){this.rootNode.remove(e)},m.prototype.removeAll=function(e){this.rootNode.removeAll(e)},r.a.util.extend(m.prototype,d.a),t.a=m},function(e,t,i){var n=0,r=Array.prototype.forEach,a={genGUID:function(){return++n},relative2absolute:function(e,t){if(!t||e.match(/^\//))return e;for(var i=e.split("/"),n=t.split("/"),r=i[0];"."===r||".."===r;)".."===r&&n.pop(),i.shift(),r=i[0];return n.join("/")+"/"+i.join("/")},extend:function(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},defaults:function(e,t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i]);return e},extendWithPropList:function(e,t,i){if(t)for(var n=0;n<i.length;n++){var r=i[n];e[r]=t[r]}return e},defaultsWithPropList:function(e,t,i){if(t)for(var n=0;n<i.length;n++){var r=i[n];null==e[r]&&(e[r]=t[r])}return e},each:function(e,t,i){if(e&&t)if(e.forEach&&e.forEach===r)e.forEach(t,i);else if(e.length===+e.length)for(var n=0,a=e.length;n<a;n++)t.call(i,e[n],n,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(i,e[o],o,e)},isObject:function(e){return e===Object(e)},isArray:function(e){return Array.isArray(e)},isArrayLike:function(e){return!!e&&e.length===+e.length},clone:function(e){if(a.isObject(e)){if(a.isArray(e))return e.slice();if(a.isArrayLike(e)){for(var t=new e.constructor(e.length),i=0;i<e.length;i++)t[i]=e[i];return t}return a.extend({},e)}return e}};t.a=a},function(e,t,i){var n=i(35),r=i(8),a=i(119);r.a.import(a.a);var o=n.a.extend((function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}}),{type:"",clone:function(){var e=n.a.prototype.clone.call(this);return e.color=Array.prototype.slice.call(this.color),e.intensity=this.intensity,e.castShadow=this.castShadow,e.shadowResolution=this.shadowResolution,e}});t.a=o},function(e,t,i){var n=i(15),r=i(0),a=i.n(r),o=i(38),s=i(6).a.vec3,l=[[0,0],[1,1]],u=n.a.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new n.a.Attribute("position","float",3,"POSITION"),positionPrev:new n.a.Attribute("positionPrev","float",3),positionNext:new n.a.Attribute("positionNext","float",3),prevPositionPrev:new n.a.Attribute("prevPositionPrev","float",3),prevPosition:new n.a.Attribute("prevPosition","float",3),prevPositionNext:new n.a.Attribute("prevPositionNext","float",3),offset:new n.a.Attribute("offset","float",1),color:new n.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,i,n){return 1/(s.dist(e,t)+s.dist(i,t)+s.dist(n,i)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(l)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(l)},getPolylineVertexCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/3,this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/3,this.useNativeLine?0:2*Math.max(t-1,0)},addCubicCurve:function(e,t,i,n,r,a){null==a&&(a=1);var o=e[0],s=e[1],l=e[2],u=t[0],h=t[1],c=t[2],d=i[0],f=i[1],p=i[2],g=n[0],m=n[1],v=n[2],y=this._getCubicCurveApproxStep(e,t,i,n),_=y*y,x=_*y,b=3*y,w=3*_,T=6*_,S=6*x,M=o-2*u+d,A=s-2*h+f,I=l-2*c+p,C=3*(u-d)-o+g,D=3*(h-f)-s+m,E=3*(c-p)-l+v,L=o,P=s,N=l,R=(u-o)*b+M*w+C*x,O=(h-s)*b+A*w+D*x,k=(c-l)*b+I*w+E*x,z=M*T+C*S,B=A*T+D*S,F=I*T+E*S,V=C*S,G=D*S,H=E*S,U=0,W=0,j=Math.ceil(1/y),X=new Float32Array(3*(j+1)),Z=(X=[],0);for(W=0;W<j+1;W++)X[Z++]=L,X[Z++]=P,X[Z++]=N,L+=R,P+=O,N+=k,R+=z,O+=B,k+=F,z+=V,B+=G,F+=H,(U+=y)>1&&(L=R>0?Math.min(L,g):Math.max(L,g),P=O>0?Math.min(P,m):Math.max(P,m),N=k>0?Math.min(N,v):Math.max(N,v));return this.addPolyline(X,r,a)},addLine:function(e,t,i,n){return this.addPolyline([e,t],i,n)},addPolyline:function(e,t,i,n,r){if(e.length){var a="number"!=typeof e[0];if(null==r&&(r=a?e.length:e.length/3),!(r<2)){null==n&&(n=0),null==i&&(i=1),this._itemVertexOffsets.push(this._vertexOffset);var o,s,l=(a="number"!=typeof e[0])?"number"!=typeof t[0]:t.length/4===r,u=this.attributes.position,h=this.attributes.positionPrev,c=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,g=this._vertexOffset;i=Math.max(i,.01);for(var m=n;m<r;m++){if(a)o=e[m],s=l?t[m]:t;else{var v=3*m;if((o=o||[])[0]=e[v],o[1]=e[v+1],o[2]=e[v+2],l){var y=4*m;(s=s||[])[0]=t[y],s[1]=t[y+1],s[2]=t[y+2],s[3]=t[y+3]}else s=t}if(this.useNativeLine?m>1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m<r-1&&(h.set(g+2,o),h.set(g+3,o)),m>0&&(c.set(g-2,o),c.set(g-1,o)),u.set(g,o),u.set(g+1,o),d.set(g,s),d.set(g+1,s),f.set(g,i/2),f.set(g+1,-i/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,o),g++;else if(m>0){var _=3*this._triangleOffset;(p=this.indices)[_]=g-4,p[_+1]=g-3,p[_+2]=g-2,p[_+3]=g-3,p[_+4]=g-1,p[_+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,b=this._vertexOffset+2*r;h.copy(x,x+2),h.copy(x+1,x+3),c.copy(b-1,b-3),c.copy(b-2,b-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(e,t){for(var i=this._itemVertexOffsets[e],n=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,r=i;r<n;r++)this.attributes.color.set(r,t);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});a.a.util.defaults(u.prototype,o.a),t.a=u},function(e,t,i){var n=i(70),r=function(e,t){e=e||0,t=t||0,this.array=n.a.fromValues(e,t),this._dirty=!0};if(r.prototype={constructor:r,add:function(e){return n.a.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t){return this.array[0]=e,this.array[1]=t,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this._dirty=!0,this},clone:function(){return new r(this.x,this.y)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return n.a.cross(e.array,this.array,t.array),e._dirty=!0,this},dist:function(e){return n.a.dist(this.array,e.array)},distance:function(e){return n.a.distance(this.array,e.array)},div:function(e){return n.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return n.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return n.a.dot(this.array,e.array)},len:function(){return n.a.len(this.array)},length:function(){return n.a.length(this.array)},lerp:function(e,t,i){return n.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},min:function(e){return n.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return n.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return n.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return n.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return n.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return n.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return n.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return n.a.squaredDistance(this.array,e.array)},sqrLen:function(){return n.a.sqrLen(this.array)},squaredLength:function(){return n.a.squaredLength(this.array)},sub:function(e){return n.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return n.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat2:function(e){return n.a.transformMat2(this.array,this.array,e.array),this._dirty=!0,this},transformMat2d:function(e){return n.a.transformMat2d(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return n.a.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return n.a.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty){var a=r.prototype;Object.defineProperty(a,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),Object.defineProperty(a,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}})}r.add=function(e,t,i){return n.a.add(e.array,t.array,i.array),e._dirty=!0,e},r.set=function(e,t,i){return n.a.set(e.array,t,i),e._dirty=!0,e},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.cross=function(e,t,i){return n.a.cross(e.array,t.array,i.array),e._dirty=!0,e},r.distance=r.dist=function(e,t){return n.a.distance(e.array,t.array)},r.divide=r.div=function(e,t,i){return n.a.divide(e.array,t.array,i.array),e._dirty=!0,e},r.dot=function(e,t){return n.a.dot(e.array,t.array)},r.len=function(e){return n.a.length(e.array)},r.lerp=function(e,t,i,r){return n.a.lerp(e.array,t.array,i.array,r),e._dirty=!0,e},r.min=function(e,t,i){return n.a.min(e.array,t.array,i.array),e._dirty=!0,e},r.max=function(e,t,i){return n.a.max(e.array,t.array,i.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},r.negate=function(e,t){return n.a.negate(e.array,t.array),e._dirty=!0,e},r.normalize=function(e,t){return n.a.normalize(e.array,t.array),e._dirty=!0,e},r.random=function(e,t){return n.a.random(e.array,t),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i),e._dirty=!0,e},r.scaleAndAdd=function(e,t,i,r){return n.a.scaleAndAdd(e.array,t.array,i.array,r),e._dirty=!0,e},r.squaredDistance=r.sqrDist=function(e,t){return n.a.sqrDist(e.array,t.array)},r.squaredLength=r.sqrLen=function(e){return n.a.sqrLen(e.array)},r.subtract=r.sub=function(e,t,i){return n.a.subtract(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat2=function(e,t,i){return n.a.transformMat2(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat2d=function(e,t,i){return n.a.transformMat2d(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat3=function(e,t,i){return n.a.transformMat3(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat4=function(e,t,i){return n.a.transformMat4(e.array,t.array,i.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(4),r=i(11),a=i(23),o=i(73),s=i(14),l=o.a.isPowerOfTwo,u=["px","nx","py","ny","pz","nz"],h=n.a.extend((function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}}),{textureType:"textureCube",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(e);var i=this.format,n=this.type;t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var a=e.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_CUBE_MAP,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===n&&(e.getGLExtension("OES_texture_half_float")||(n=r.a.FLOAT)),this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(t,u,l,o,s,i,n),o/=2,s/=2}else this._updateTextureData(t,this,0,this.width,this.height,i,n),!this.NPOT&&this.useMipmap&&t.generateMipmap(t.TEXTURE_CUBE_MAP);t.bindTexture(t.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(e,t,i,n,r,a,o){for(var s=0;s<6;s++){var l=u[s],h=t.image&&t.image[l];h?e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,i,a,a,o,h):e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,i,a,n,r,0,a,o,t.pixels&&t.pixels[l])}},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_CUBE_MAP))},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?l(this.image.px.width)&&l(this.image.px.height):l(this.width)&&l(this.height)},isRenderable:function(){return this.image.px?c(this.image.px)&&c(this.image.nx)&&c(this.image.py)&&c(this.image.ny)&&c(this.image.pz)&&c(this.image.nz):!(!this.width||!this.height)},load:function(e,t){var i=0,n=this;return a.a.each(e,(function(e,r){var a=s.a.createImage();t&&(a.crossOrigin=t),a.onload=function(){0==--i&&(n.dirty(),n.trigger("success",n)),a.onload=null},a.onerror=function(){i--,a.onerror=null},i++,a.src=e,n.image[r]=a})),this}});function c(e){return"CANVAS"===e.nodeName||"VIDEO"===e.nodeName||e.complete}Object.defineProperty(h.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}}),Object.defineProperty(h.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(e){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}}),t.a=h},function(e,t,i){t.a={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}}},function(e,t,i){t.a={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}}},function(e,t,i){var n=i(1),r=i(42),a=i(0),o=i.n(a);function s(){}s.prototype={constructor:s,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new n.a.DirectionalLight({shadowBias:.005}),this.ambientLight=new n.a.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,i=this.ambientLight,r=e.getModel("light"),a=r.getModel("main"),o=r.getModel("ambient");t.intensity=a.get("intensity"),i.intensity=o.get("intensity"),t.color=n.a.parseColor(a.get("color")).slice(0,3),i.color=n.a.parseColor(o.get("color")).slice(0,3);var s=a.get("alpha")||0,l=a.get("beta")||0;t.position.setArray(n.a.directionFromAlphaBeta(s,l)),t.lookAt(n.a.Vector3.ZERO),t.castShadow=a.get("shadow"),t.shadowResolution=n.a.getShadowResolution(a.get("shadowQuality"))},updateAmbientCubemap:function(e,t,i){var r=t.getModel("light.ambientCubemap"),a=r.get("texture");if(a){this._cubemapLightsCache=this._cubemapLightsCache||{};var o=this._cubemapLightsCache[a];if(!o){var s=this;o=this._cubemapLightsCache[a]=n.a.createAmbientCubemap(r.option,e,i,(function(){s._isSkyboxFromAmbientCubemap&&s._skybox.setEnvironmentMap(o.specular.cubemap),i.getZr().refresh()}))}this._lightRoot.add(o.diffuse),this._lightRoot.add(o.specular),this._currentCubemapLights=o}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,i){var a=t.get("environment"),s=this,l=(s._skybox=s._skybox||new r.a,s._skybox);if(a&&"none"!==a)if("auto"===a)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var u=this._currentCubemapLights.specular.cubemap;l.setEnvironmentMap(u),this._scene&&l.attachScene(this._scene),l.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof a&&a.colorStops||"string"==typeof a&&o.a.color.parse(a)){this._isSkyboxFromAmbientCubemap=!1;var h=new n.a.Texture2D({anisotropic:8,flipY:!1});l.setEnvironmentMap(h);var c=h.image=document.createElement("canvas");c.width=c.height=16;var d=c.getContext("2d");new o.a.graphic.Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:a}}).brush(d),l.attachScene(this._scene)}else this._isSkyboxFromAmbientCubemap=!1,h=n.a.loadTexture(a,i,{anisotropic:8,flipY:!1}),l.setEnvironmentMap(h),l.attachScene(this._scene);else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var f=t.coordinateSystem;if(this._skybox)if(!f||!f.viewGL||"auto"===a||a.match&&a.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var p=f.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[p]("fragment","SRGB_DECODE")}}},t.a=s},function(e,t,i){t.a={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}}},function(e,t,i){var n=i(0),r=i.n(n),a={getFormattedLabel:function(e,t,i,n,a){i=i||"normal";var o=e.getData(n).getItemModel(t),s=e.getDataParams(t,n);null!=a&&s.value instanceof Array&&(s.value=s.value[a]);var l,u=o.get("normal"===i?["label","formatter"]:["emphasis","label","formatter"]);return null==u&&(u=o.get(["label","formatter"])),"function"==typeof u?(s.status=i,l=u(s)):"string"==typeof u&&(l=r.a.format.formatTpl(u,s)),l},normalizeToArray:function(e){return e instanceof Array?e:null==e?[]:[e]}};t.a=a},function(e,t,i){var n,r=i(20),a={create:function(){var e=new r.a(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new r.a(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,i,n){var a=new r.a(4);return a[0]=e,a[1]=t,a[2]=i,a[3]=n,a},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},set:function(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e},add:function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e},subtract:function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e}};a.sub=a.subtract,a.multiply=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e[3]=t[3]*i[3],e},a.mul=a.multiply,a.divide=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e[3]=t[3]/i[3],e},a.div=a.divide,a.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e[3]=Math.min(t[3],i[3]),e},a.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e[3]=Math.max(t[3],i[3]),e},a.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e},a.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e[2]=t[2]+i[2]*n,e[3]=t[3]+i[3]*n,e},a.distance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(i*i+n*n+r*r+a*a)},a.dist=a.distance,a.squaredDistance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2],a=t[3]-e[3];return i*i+n*n+r*r+a*a},a.sqrDist=a.squaredDistance,a.length=function(e){var t=e[0],i=e[1],n=e[2],r=e[3];return Math.sqrt(t*t+i*i+n*n+r*r)},a.len=a.length,a.squaredLength=function(e){var t=e[0],i=e[1],n=e[2],r=e[3];return t*t+i*i+n*n+r*r},a.sqrLen=a.squaredLength,a.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},a.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},a.normalize=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i*i+n*n+r*r+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},a.lerp=function(e,t,i,n){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e[2]=o+n*(i[2]-o),e[3]=s+n*(i[3]-s),e},a.random=function(e,t){return t=t||1,e[0]=Object(r.c)(),e[1]=Object(r.c)(),e[2]=Object(r.c)(),e[3]=Object(r.c)(),a.normalize(e,e),a.scale(e,e,t),e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3];return e[0]=i[0]*n+i[4]*r+i[8]*a+i[12]*o,e[1]=i[1]*n+i[5]*r+i[9]*a+i[13]*o,e[2]=i[2]*n+i[6]*r+i[10]*a+i[14]*o,e[3]=i[3]*n+i[7]*r+i[11]*a+i[15]*o,e},a.transformQuat=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=i[0],s=i[1],l=i[2],u=i[3],h=u*n+s*a-l*r,c=u*r+l*n-o*a,d=u*a+o*r-s*n,f=-o*n-s*r-l*a;return e[0]=h*u+f*-o+c*-l-d*-s,e[1]=c*u+f*-s+d*-o-h*-l,e[2]=d*u+f*-l+h*-s-c*-o,e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=4),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],n[3]=e[s+3],a(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2],e[s+3]=n[3];return e}),t.a=a},function(e,t,i){var n=i(20),r={create:function(){var e=new n.a(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat4:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},clone:function(e){var t=new n.a(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:function(e,t){if(e===t){var i=t[1],n=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=n,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},invert:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8],c=h*o-s*u,d=-h*a+s*l,f=u*a-o*l,p=i*c+n*d+r*f;return p?(p=1/p,e[0]=c*p,e[1]=(-h*n+r*u)*p,e[2]=(s*n-r*o)*p,e[3]=d*p,e[4]=(h*i-r*l)*p,e[5]=(-s*i+r*a)*p,e[6]=f*p,e[7]=(-u*i+n*l)*p,e[8]=(o*i-n*a)*p,e):null},adjoint:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8];return e[0]=o*h-s*u,e[1]=r*u-n*h,e[2]=n*s-r*o,e[3]=s*l-a*h,e[4]=i*h-r*l,e[5]=r*a-i*s,e[6]=a*u-o*l,e[7]=n*l-i*u,e[8]=i*o-n*a,e},determinant:function(e){var t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*(u*a-o*l)+i*(-u*r+o*s)+n*(l*r-a*s)},multiply:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=i[0],f=i[1],p=i[2],g=i[3],m=i[4],v=i[5],y=i[6],_=i[7],x=i[8];return e[0]=d*n+f*o+p*u,e[1]=d*r+f*s+p*h,e[2]=d*a+f*l+p*c,e[3]=g*n+m*o+v*u,e[4]=g*r+m*s+v*h,e[5]=g*a+m*l+v*c,e[6]=y*n+_*o+x*u,e[7]=y*r+_*s+x*h,e[8]=y*a+_*l+x*c,e}};r.mul=r.multiply,r.translate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=i[0],f=i[1];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=d*n+f*o+u,e[7]=d*r+f*s+h,e[8]=d*a+f*l+c,e},r.rotate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=t[7],c=t[8],d=Math.sin(i),f=Math.cos(i);return e[0]=f*n+d*o,e[1]=f*r+d*s,e[2]=f*a+d*l,e[3]=f*o-d*n,e[4]=f*s-d*r,e[5]=f*l-d*a,e[6]=u,e[7]=h,e[8]=c,e},r.scale=function(e,t,i){var n=i[0],r=i[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},r.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},r.fromQuat=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i+i,s=n+n,l=r+r,u=i*o,h=n*o,c=n*s,d=r*o,f=r*s,p=r*l,g=a*o,m=a*s,v=a*l;return e[0]=1-c-p,e[3]=h-v,e[6]=d+m,e[1]=h+v,e[4]=1-u-p,e[7]=f-g,e[2]=d-m,e[5]=f+g,e[8]=1-u-c,e},r.normalFromMat4=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],h=t[8],c=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],v=t[15],y=i*s-n*o,_=i*l-r*o,x=i*u-a*o,b=n*l-r*s,w=n*u-a*s,T=r*u-a*l,S=h*g-c*p,M=h*m-d*p,A=h*v-f*p,I=c*m-d*g,C=c*v-f*g,D=d*v-f*m,E=y*D-_*C+x*I+b*A-w*M+T*S;return E?(E=1/E,e[0]=(s*D-l*C+u*I)*E,e[1]=(l*A-o*D-u*M)*E,e[2]=(o*C-s*A+u*S)*E,e[3]=(r*C-n*D-a*I)*E,e[4]=(i*D-r*A+a*M)*E,e[5]=(n*A-i*C-a*S)*E,e[6]=(g*T-m*w+v*b)*E,e[7]=(m*x-p*T-v*_)*E,e[8]=(p*w-g*x+v*y)*E,e):null},r.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2))},t.a=r},function(e,t,i){var n,r,a,o,s=i(7),l=i(3),u=i(56),h=i(9),c=i(21),d=i(18),f=0,p=s.a.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+f++),this.position||(this.position=new l.a),this.rotation||(this.rotation=new u.a),this.scale||(this.scale=new l.a(1,1,1)),this.worldTransform=new h.a,this.localTransform=new h.a,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var i=t._nodeRepository;delete i[this.name],i[e]=this}this.name=e},add:function(e){var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var i=this._scene;i&&i!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,i=t.indexOf(e);i<0||(t.splice(i,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t<e.length;t++)e[t]._parent=null,this._scene&&e[t].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(e){e._scene.removeFromScene(e),e._scene=null},_addSelfToScene:function(e){this._scene.addToScene(e),e._scene=this._scene},isAncestor:function(e){for(var t=e._parent;t;){if(t===this)return!0;t=t._parent}return!1},children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},getChildByName:function(e){for(var t=this._children,i=0;i<t.length;i++)if(t[i].name===e)return t[i]},getDescendantByName:function(e){for(var t=this._children,i=0;i<t.length;i++){var n=t[i];if(n.name===e)return n;var r=n.getDescendantByName(e);if(r)return r}},queryNode:function(e){if(e){for(var t=e.split("/"),i=this,n=0;n<t.length;n++){var r=t[n];if(r){for(var a=!1,o=i._children,s=0;s<o.length;s++){var l=o[s];if(l.name===r){i=l,a=!0;break}}if(!a)return}}return i}},getPath:function(e){if(!this._parent)return"/";for(var t=this._parent,i=this.name;t._parent&&(i=t.name+"/"+i,t._parent!=e);)t=t._parent;return!t._parent&&e?null:i},traverse:function(e,t){e.call(t,this);for(var i=this._children,n=0,r=i.length;n<r;n++)i[n].traverse(e,t)},eachChild:function(e,t){for(var i=this._children,n=0,r=i.length;n<r;n++){var a=i[n];e.call(t,a,n)}},setLocalTransform:function(e){c.a.copy(this.localTransform.array,e.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(e){var t=e?null:this.scale;this.localTransform.decomposeMatrix(t,this.rotation,this.position)},setWorldTransform:function(e){c.a.copy(this.worldTransform.array,e.array),this.decomposeWorldTransform()},decomposeWorldTransform:(o=c.a.create(),function(e){var t=this.localTransform,i=this.worldTransform;this._parent?(c.a.invert(o,this._parent.worldTransform.array),c.a.multiply(t.array,o,i.array)):c.a.copy(t.array,i.array);var n=e?null:this.scale;t.decomposeMatrix(n,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var e=this.position,t=this.rotation,i=this.scale;if(this.transformNeedsUpdate()){var n=this.localTransform.array;c.a.fromRotationTranslation(n,t.array,e.array),c.a.scale(n,n,i.array),t._dirty=!1,i._dirty=!1,e._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var e=this.localTransform.array,t=this.worldTransform.array;this._parent?c.a.multiplyAffine(t,this._parent.worldTransform.array,e):c.a.copy(t,e)},updateWorldTransform:function(){for(var e=this;e&&e.getParent()&&e.getParent().transformNeedsUpdate();)e=e.getParent();e.update()},update:function(e){this.autoUpdateLocalTransform?this.updateLocalTransform():e=!0,(e||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),e=!0,this._needsUpdateWorldTransform=!1);for(var t=this._children,i=0,n=t.length;i<n;i++)t[i].update(e)},getBoundingBox:function(){function e(e){return!e.invisible&&e.geometry}var t=new d.a,i=new h.a,n=new h.a;return function(r,a){return a=a||new d.a,this._parent?h.a.invert(n,this._parent.worldTransform):h.a.identity(n),this.traverse((function(e){e.geometry&&e.geometry.boundingBox&&(t.copy(e.geometry.boundingBox),h.a.multiply(i,n,e.worldTransform),t.applyTransform(i),a.union(t))}),this,e),a}}(),getWorldPosition:function(e){this.transformNeedsUpdate()&&this.updateWorldTransform();var t=this.worldTransform.array;if(e){var i=e.array;return i[0]=t[12],i[1]=t[13],i[2]=t[14],e}return new l.a(t[12],t[13],t[14])},clone:function(){var e=new this.constructor,t=this._children;e.setName(this.name),e.position.copy(this.position),e.rotation.copy(this.rotation),e.scale.copy(this.scale);for(var i=0;i<t.length;i++)e.add(t[i].clone());return e},rotateAround:(r=new l.a,a=new h.a,function(e,t,i){r.copy(this.position).subtract(e);var n=this.localTransform;n.identity(),n.translate(e),n.rotate(i,t),a.fromRotationTranslation(this.rotation,r),n.multiply(a),n.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}),lookAt:(n=new h.a,function(e,t){n.lookAt(this.position,e,t||this.localTransform.y).invert(),this.setLocalTransform(n),this.target=e})});t.a=p},function(e,t,i){var n=i(35),r=i(24),a=i(58),o=i(18),s=i(23),l=i(21),u=i(69),h=i(9),c=l.a.create(),d=l.a.create(),f={};function p(e){var t=[],i=Object.keys(e);i.sort();for(var n=0;n<i.length;n++){var r=i[n];t.push(r+" "+e[r])}var a=t.join("\n");if(f[a])return f[a];var o=s.a.genGUID();return f[a]=o,o}function g(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}g.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0},g.prototype.add=function(e,t){t?this.transparent[this._transparentCount++]=e:this.opaque[this._opaqueCount++]=e},g.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var m,v,y=n.a.extend((function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new o.a,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new u.a(20)}}),(function(){this._scene=this}),{addToScene:function(e){e instanceof a.a?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof r.a&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof a.a?(t=this._cameraList.indexOf(e))>=0&&this._cameraList.splice(t,1):e instanceof r.a&&(t=this.lights.indexOf(e))>=0&&this.lights.splice(t,1),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t={},i=0;i<e.length;i++){var n=e[i];if(!n.invisible){var r=n.group;t[r]||(t[r]={}),t[r][n.type]=t[r][n.type]||0,t[r][n.type]++}}for(var a in this._lightNumber=t,t)this._lightProgramKeys[a]=p(t[a]);this._updateLightUniforms()},cloneNode:function(e){var t=e.clone(),i={};return function e(t,n){i[t.__uid__]=n;for(var r=0;r<t._children.length;r++)e(t._children[r],n._children[r])}(e,t),t.traverse((function(e){e.skeleton&&(e.skeleton=e.skeleton.clone(i)),e.material&&(e.material=e.material.clone())})),t},updateRenderList:function(e,t){var i=e.__uid__,n=this._renderLists.get(i);n||(n=new g,this._renderLists.put(i,n)),n.startCount(),t&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var r=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,e,r,n,t),n.endCount(),n},getRenderList:function(e){return this._renderLists.get(e.__uid__)},_doUpdateRenderList:function(e,t,i,n,r){if(!e.invisible)for(var a=0;a<e._children.length;a++){var o=e._children[a];if(o.isRenderable()){var s=o.isSkinnedMesh()?c:o.worldTransform.array,u=o.geometry;l.a.multiplyAffine(d,t.viewMatrix.array,s),(r&&!u.boundingBox||!this.isFrustumCulled(o,t,d))&&n.add(o,o.material.transparent||i)}o._children.length>0&&this._doUpdateRenderList(o,t,i,n,r)}},isFrustumCulled:(m=new o.a,v=new h.a,function(e,t,i){var n=e.boundingBox;if(n||(n=e.skeleton&&e.skeleton.boundingBox?e.skeleton.boundingBox:e.geometry.boundingBox),!n)return!1;if(v.array=i,m.transformFrom(n,v),e.castShadow&&this.viewBoundingBoxLastFrame.union(m),e.frustumCulling){if(!m.intersectBoundingBox(t.frustum.boundingBox))return!0;v.array=t.projectionMatrix.array,m.max.array[2]>0&&m.min.array[2]<0&&(m.max.array[2]=-1e-20),m.applyProjection(v);var r=m.min.array,a=m.max.array;if(a[0]<-1||r[0]>1||a[1]<-1||r[1]>1||a[2]<-1||r[2]>1)return!0}return!1}),_updateLightUniforms:function(){var e=this.lights;e.sort(_);var t=this._lightUniforms;for(var i in t)for(var n in t[i])t[i][n].value.length=0;for(var r=0;r<e.length;r++){var a=e[r];if(!a.invisible)for(var n in i=a.group,a.uniformTemplates){var o=a.uniformTemplates[n],s=o.value(a);if(null!=s){t[i]||(t[i]={}),t[i][n]||(t[i][n]={type:"",value:[]});var l=t[i][n];switch(l.type=o.type+"v",o.type){case"1i":case"1f":case"t":l.value.push(s);break;case"2f":case"3f":case"4f":for(var u=0;u<s.length;u++)l.value.push(s[u]);break;default:console.error("Unkown light uniform type "+o.type)}}}}},getLightGroups:function(){var e=[];for(var t in this._lightNumber)e.push(t);return e},getNumberChangedLightGroups:function(){var e=[];for(var t in this._lightNumber)this.isLightNumberChanged(t)&&e.push(t);return e},isLightNumberChanged:function(e){var t=this._previousLightNumber,i=this._lightNumber;for(var n in i[e]){if(!t[e])return!0;if(i[e][n]!==t[e][n])return!0}for(var n in t[e]){if(!i[e])return!0;if(i[e][n]!==t[e][n])return!0}return!1},getLightsNumbers:function(e){return this._lightNumber[e]},getProgramKey:function(e){return this._lightProgramKeys[e]},setLightUniforms:function(){function e(e,t,i){for(var n in e){var r=e[n];if("tv"===r.type){if(!t.hasUniform(n))continue;for(var a=[],o=0;o<r.value.length;o++){var s=r.value[o],l=t.takeCurrentTextureSlot(i,s);a.push(l)}t.setUniform(i.gl,"1iv",n,a)}else t.setUniform(i.gl,r.type,n,r.value)}}return function(t,i,n){e(this._lightUniforms[i],t,n),e(this.shadowUniforms,t,n)}}(),dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function _(e,t){if(t.castShadow&&!e.castShadow)return!0}t.a=y},function(e,t,i){var n=i(58),r=n.a.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=n.a.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}});t.a=r},function(e,t,i){t.a={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var i in t)e||!t[i].value?t[i].value=[]:t[i].value=Array.prototype.slice.call(t[i].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e=this.attributes;for(var t in e)e[t].value&&e[t].value.length>0?e[t].value=new Float32Array(e[t].value):e[t].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}}},function(e,t,i){var n=i(0),r=i.n(n);t.a=function(e,t,i){var n=e.getData(),a=e.getRawValue(t),o=r.a.util.isArray(a)?function(e){var a=[],o=function(e,t){var i=[];return r.a.util.each(e.dimensions,(function(n){var r=e.getDimensionInfo(n),a=r.otherDims[t];null!=a&&!1!==a&&(i[a]=r.name)})),i}(n,"tooltip");function s(e,t){var o=n.getDimensionInfo(t);if(o&&!1!==o.otherDims.tooltip){var s=o.type,l="- "+(o.tooltipName||o.name)+": "+("ordinal"===s?e+"":"time"===s?i?"":r.a.format.formatTime("yyyy/MM/dd hh:mm:ss",e):r.a.format.addCommas(e));l&&a.push(r.a.format.encodeHTML(l))}}return o.length?r.a.util.each(o,(function(e){s(n.get(e,t),e)})):r.a.util.each(e,s),"<br/>"+a.join("<br/>")}(a):r.a.format.encodeHTML(r.a.format.addCommas(a)),s=n.getName(t),l=n.getItemVisual(t,"color");r.a.util.isObject(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=r.a.format.getTooltipMarker(l),h=e.name;return"\0-"===h&&(h=""),h=h?r.a.format.encodeHTML(h)+(i?": ":"<br/>"):"",i?u+h+o:h+u+(s?r.a.format.encodeHTML(s)+": "+o:o)}},function(e,t,i){var n=i(72),r=i(11),a=n.a.extend({skeleton:null,joints:null,useSkinMatricesTexture:!1},(function(){this.joints||(this.joints=[])}),{isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=n.a.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});a.POINTS=r.a.POINTS,a.LINES=r.a.LINES,a.LINE_LOOP=r.a.LINE_LOOP,a.LINE_STRIP=r.a.LINE_STRIP,a.TRIANGLES=r.a.TRIANGLES,a.TRIANGLE_STRIP=r.a.TRIANGLE_STRIP,a.TRIANGLE_FAN=r.a.TRIANGLE_FAN,a.BACK=r.a.BACK,a.FRONT=r.a.FRONT,a.FRONT_AND_BACK=r.a.FRONT_AND_BACK,a.CW=r.a.CW,a.CCW=r.a.CCW,t.a=a},function(e,t,i){var n=i(58),r=n.a.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=2*Math.atan(1/e[5]);this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=n.a.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}});t.a=r},function(e,t,i){var n=i(40),r=i(76),a=i(8),o=i(19),s=i(4),l=i(121);a.a.import(l.a);var u=n.a.extend((function(){var e=new a.a({vertex:a.a.source("clay.skybox.vertex"),fragment:a.a.source("clay.skybox.fragment")}),t=new o.a({shader:e,depthMask:!1});return{scene:null,geometry:new r.a,material:t,environmentMap:null,culling:!1}}),(function(){var e=this.scene;e&&this.attachScene(e),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)}),{attachScene:function(e){this.scene&&this.detachScene(),e.skybox=this,this.scene=e,e.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(e){this.detachScene(),this.geometry.dispose(e)},setEnvironmentMap:function(e){"texture2D"===e.textureType?(this.material.define("EQUIRECTANGULAR"),e.minFilter=s.a.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",e)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(e,t,i){this.renderSkybox(e,i)},renderSkybox:function(e,t){this.position.copy(t.getWorldPosition()),this.update(),e.gl.disable(e.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],t)}});t.a=u},function(e,t,i){var n=i(15),r=i(18),a=n.a.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var e=this.heightSegments,t=this.widthSegments,i=this.attributes,n=[],a=[],o=[],s=[],l=0;l<=e;l++)for(var u=l/e,h=0;h<=t;h++){var c=h/t;if(n.push([2*c-1,2*u-1,0]),a&&a.push([c,u]),o&&o.push([0,0,1]),h<t&&l<e){var d=h+l*(t+1);s.push([d,d+1,d+t+1]),s.push([d+t+1,d+1,d+t+2])}}i.position.fromArray(n),i.texcoord0.fromArray(a),i.normal.fromArray(o),this.initIndicesFromArray(s),this.boundingBox=new r.a,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}});t.a=a},function(e,t,i){t.a={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(e){e=e||{},this.option.viewControl=this.option.viewControl||{},null!=e.alpha&&(this.option.viewControl.alpha=e.alpha),null!=e.beta&&(this.option.viewControl.beta=e.beta),null!=e.distance&&(this.option.viewControl.distance=e.distance),null!=e.center&&(this.option.viewControl.center=e.center)}}},function(e,t,i){var n=i(7),r=i(26),a=i(3);i(56);var o=i(2).a.firstNotNull,s={left:0,middle:1,right:2};function l(e){return e instanceof Array||(e=[e,e]),e}var u=n.a.extend((function(){return{zr:null,viewGL:null,_center:new a.a,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new r.a,_panVelocity:new r.a,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}}),(function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach((function(e){this[e]=this[e].bind(this)}),this)}),{init:function(){var e=this.zr;e&&(e.on("mousedown",this._mouseDownHandler),e.on("globalout",this._mouseUpHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("pinch",this._pinchHandler),e.animation.on("frame",this._update),e.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var e=this.zr;e&&(e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("pinch",this._pinchHandler),e.off("globalout",this._mouseUpHandler),e.dom.removeEventListener("contextmenu",this._contextMenuHandler),e.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(e){this._distance=e,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(e){this._orthoSize=e,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(e){e=Math.max(Math.min(this.maxAlpha,e),this.minAlpha),this._theta=e/180*Math.PI,this._needsUpdate=!0},setBeta:function(e){e=Math.max(Math.min(this.maxBeta,e),this.minBeta),this._phi=-e/180*Math.PI,this._needsUpdate=!0},setCenter:function(e){this._center.setArray(e)},setViewGL:function(e){this.viewGL=e},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(e,t){var i=(t=t||{}).baseDistance||0,n=t.baseOrthoSize||1,r=e.get("projection");"perspective"!==r&&"orthographic"!==r&&"isometric"!==r&&(console.error("Unkown projection type %s, use perspective projection instead.",r),r="perspective"),this._projection=r,this.viewGL.setProjection(r);var a=e.get("distance")+i,s=e.get("orthographicSize")+n;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach((function(t){this[t[0]]=o(e.get(t[0]),t[1])}),this),this.minDistance+=i,this.maxDistance+=i,this.minOrthographicSize+=n,this.maxOrthographicSize+=n;var l=e.ecModel,u={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach((function(t){u[t]=o(e.get(t),l&&l.get(t))}));var h=o(t.alpha,e.get("alpha"))||0,c=o(t.beta,e.get("beta"))||0,d=o(t.center,e.get("center"))||[0,0,0];u.animation&&u.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:h,beta:c,center:d,distance:a,targetOrthographicSize:s,easing:u.animationEasingUpdate,duration:u.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(h),this.setBeta(c),this.setCenter(d),this.setOrthographicSize(s)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){null==s[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==s[this.rotateMouseButton]&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),"cw"!==this.autoRotateDirection&&"ccw"!==this.autoRotateDirection&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection)},animateTo:function(e){var t=this.zr,i=this,n={},r={};return null!=e.distance&&(n.distance=this.getDistance(),r.distance=e.distance),null!=e.orthographicSize&&(n.orthographicSize=this.getOrthographicSize(),r.orthographicSize=e.orthographicSize),null!=e.alpha&&(n.alpha=this.getAlpha(),r.alpha=e.alpha),null!=e.beta&&(n.beta=this.getBeta(),r.beta=e.beta),null!=e.center&&(n.center=this.getCenter(),r.center=e.center),this._addAnimator(t.animation.animate(n).when(e.duration||1e3,r).during((function(){null!=n.alpha&&i.setAlpha(n.alpha),null!=n.beta&&i.setBeta(n.beta),null!=n.distance&&i.setDistance(n.distance),null!=n.center&&i.setCenter(n.center),null!=n.orthographicSize&&i.setOrthographicSize(n.orthographicSize),i._needsUpdate=!0}))).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e<this._animators.length;e++)this._animators[e].stop();this._animators.length=0},update:function(){this._needsUpdate=!0,this._update(20)},_isAnimating:function(){return this._animators.length>0},_update:function(e){if(this._rotating){var t=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=t*e/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),i=this._orthoSize,n=i/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-n/2,t.right=n/2,t.top=i/2,t.bottom=-i/2},_updatePan:function(e){var t=this._panVelocity,i=this._distance,n=this.getCamera(),r=n.worldTransform.y,a=n.worldTransform.x;this._center.scaleAndAdd(a,-t.x*i/200).scaleAndAdd(r,-t.y*i/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new a.a,i=this._theta+Math.PI/2,n=this._phi+Math.PI/2,r=Math.sin(i);t.x=r*Math.cos(n),t.y=-Math.cos(i),t.z=r*Math.sin(n),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&e>0&&(this._stillTimeout=setTimeout((function(){t._rotating=!0}),1e3*e))},_vectorDamping:function(e,t){var i=e.len();(i*=t)<1e-4&&(i=0),e.normalize().scale(i)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),i=Math.atan2(e.x,e.z);this._theta=t,this._phi=-i,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(e){if(!e.target&&!this._isAnimating()){var t=e.offsetX,i=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,i)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?1===e.event.targetTouches.length&&(this._mode="rotate"):e.event.button===s[this.rotateMouseButton]?this._mode="rotate":e.event.button===s[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY)}},_mouseMoveHandler:function(e){if(!(e.target&&e.target.__isGLToZRProxy||this._isAnimating())){var t=l(this.panSensitivity),i=l(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*i[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*i[1]):"pan"===this._mode&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault()}},_mouseWheelHandler:function(e){if(!this._isAnimating()){var t=e.event.wheelDelta||-e.event.detail;this._zoomHandler(e,t)}},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,e.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(e,t){if(0!==t){var i,n=e.offsetX,r=e.offsetY;this.viewGL&&!this.viewGL.containPoint(n,r)||(i="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*i*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),e.event.preventDefault())}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(e){var t=this._animators;return t.push(e),e.done((function(){var i=t.indexOf(e);i>=0&&t.splice(i,1)})),e}});Object.defineProperty(u.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}}),t.a=u},function(e,t,i){t.a="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,i){var n=i(13),r=i(82),a=i(85).parsePercent,o=i(171),s=n.each,l=["left","right","top","bottom","width","height"],u=[["width","left","right"],["height","top","bottom"]];function h(e,t,i,n,r){var a=0,o=0;null==n&&(n=1/0),null==r&&(r=1/0);var s=0;t.eachChild((function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=t.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===e){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,o+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=o+v)>r||l.newline?(a+=s+i,o=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===e?a=h+i:o=c+i)}))}var c=h,d=n.curry(h,"vertical"),f=n.curry(h,"horizontal");function p(e,t,i){i=o.normalizeCssArray(i||0);var n=t.width,s=t.height,l=a(e.left,n),u=a(e.top,s),h=a(e.right,n),c=a(e.bottom,s),d=a(e.width,n),f=a(e.height,s),p=i[2]+i[0],g=i[1]+i[3],m=e.aspect;switch(isNaN(d)&&(d=n-h-g-l),isNaN(f)&&(f=s-c-p-u),null!=m&&(isNaN(d)&&isNaN(f)&&(m>n/s?d=.8*n:f=.8*s),isNaN(d)&&(d=m*f),isNaN(f)&&(f=d/m)),isNaN(l)&&(l=n-h-d-g),isNaN(u)&&(u=s-c-f-p),e.left||e.right){case"center":l=n/2-d/2-i[3];break;case"right":l=n-d-g}switch(e.top||e.bottom){case"middle":case"center":u=s/2-f/2-i[0];break;case"bottom":u=s-f-p}l=l||0,u=u||0,isNaN(d)&&(d=n-g-l-(h||0)),isNaN(f)&&(f=s-p-u-(c||0));var v=new r(l+i[3],u+i[0],d,f);return v.margin=i,v}function g(e,t){return t&&e&&s(l,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}t.LOCATION_PARAMS=l,t.HV_NAMES=u,t.box=c,t.vbox=d,t.hbox=f,t.getAvailableSize=function(e,t,i){var n=t.width,r=t.height,s=a(e.x,n),l=a(e.y,r),u=a(e.x2,n),h=a(e.y2,r);return(isNaN(s)||isNaN(parseFloat(e.x)))&&(s=0),(isNaN(u)||isNaN(parseFloat(e.x2)))&&(u=n),(isNaN(l)||isNaN(parseFloat(e.y)))&&(l=0),(isNaN(h)||isNaN(parseFloat(e.y2)))&&(h=r),i=o.normalizeCssArray(i||0),{width:Math.max(u-s-i[1]-i[3],0),height:Math.max(h-l-i[0]-i[2],0)}},t.getLayoutRect=p,t.positionElement=function(e,t,i,a,o){var s=!o||!o.hv||o.hv[0],l=!o||!o.hv||o.hv[1],u=o&&o.boundingMode||"all";if(s||l){var h;if("raw"===u)h="group"===e.type?new r(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(h=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(h=h.clone()).applyTransform(c)}t=p(n.defaults({width:h.width,height:h.height},t),i,a);var d=e.position,f=s?t.x-h.x:0,g=l?t.y-h.y:0;e.attr("position","raw"===u?[f,g]:[d[0]+f,d[1]+g])}},t.sizeCalculable=function(e,t){return null!=e[u[t][0]]||null!=e[u[t][1]]&&null!=e[u[t][2]]},t.mergeLayoutParam=function(e,t,i){!n.isObject(i)&&(i={});var r=i.ignoreSize;!n.isArray(r)&&(r=[r,r]);var a=l(u[0],0),o=l(u[1],1);function l(i,n){var a={},o=0,l={},u=0;if(s(i,(function(t){l[t]=e[t]})),s(i,(function(e){h(t,e)&&(a[e]=l[e]=t[e]),c(a,e)&&o++,c(l,e)&&u++})),r[n])return c(t,i[1])?l[i[2]]=null:c(t,i[2])&&(l[i[1]]=null),l;if(2!==u&&o){if(o>=2)return a;for(var d=0;d<i.length;d++){var f=i[d];if(!h(a,f)&&h(e,f)){a[f]=e[f];break}}return a}return l}function h(e,t){return e.hasOwnProperty(t)}function c(e,t){return null!=e[t]&&"auto"!==e[t]}function d(e,t,i){s(e,(function(e){t[e]=i[e]}))}d(u[0],e,a),d(u[1],e,o)},t.getLayoutParams=function(e){return g({},e)},t.copyLayoutParams=g},function(e,t,i){var n=i(7).a.extend((function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),{updateParameter:function(e,t){var i,n,r=this.outputs[e],a=r.parameters,o=r._parametersCopy;if(o||(o=r._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return i=a.width instanceof Function?a.width.call(this,t):a.width,n=a.height instanceof Function?a.height.call(this,t):a.height,o.width===i&&o.height===n||this._outputTextures[e]&&this._outputTextures[e].dispose(t.gl),o.width=i,o.height=n,o},setParameter:function(e,t){},getParameter:function(e){},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},render:function(){},getOutput:function(e,t){if(null==t)return t=e,this._outputTextures[t];var i=this.outputs[t];return i?this._rendered?i.outputLastFrame?this._prevOutputTextures[t]:this._outputTextures[t]:this._rendering?(this._prevOutputTextures[t]||(this._prevOutputTextures[t]=this._compositor.allocateTexture(i.parameters||{})),this._prevOutputTextures[t]):(this.render(e),this._outputTextures[t]):void 0},removeReference:function(e){this._outputReferences[e]--,0===this._outputReferences[e]&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},link:function(e,t,i){this.inputLinks[e]={node:t,pin:i},t.outputLinks[i]||(t.outputLinks[i]=[]),t.outputLinks[i].push({node:this,pin:e}),this.pass.material.enableTexture(e)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(e){if(!this._rendering){for(var t in this._rendering=!0,this.inputLinks){var i=this.inputLinks[t];i.node.updateReference(i.pin)}this._rendering=!1}e&&this._outputReferences[e]++},beforeFrame:function(){for(var e in this._rendered=!1,this.outputLinks)this._outputReferences[e]=0},afterFrame:function(){for(var e in this.outputLinks)this._outputReferences[e]>0&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))}});t.a=n},function(e,t,i){t.a=function(e,t){for(var i=0,n=1/t,r=e;r>0;)i+=n*(r%t),r=Math.floor(r/t),n/=t;return i}},function(e,t,i){var n=i(0),r=i.n(n);t.a=function(e,t,i){i=i||e.getSource();var n=t||r.a.getCoordinateSystemDimensions(e.get("coordinateSystem"))||["x","y","z"],a=r.a.helper.createDimensions(i,{dimensionsDefine:i.dimensionsDefine||e.get("dimensions"),encodeDefine:i.encodeDefine||e.get("encode"),coordDimensions:n.map((function(t){var i=e.getReferringComponents(t+"Axis3D")[0];return{type:i&&"category"===i.get("type")?"ordinal":"float",name:t}}))});"cartesian3D"===e.get("coordinateSystem")&&a.forEach((function(t){if(n.indexOf(t.coordDim)>=0){var i=e.getReferringComponents(t.coordDim+"Axis3D")[0];i&&"category"===i.get("type")&&(t.ordinalMeta=i.getOrdinalMeta())}}));var o=r.a.helper.dataStack.enableDataStack(e,a,{byIndex:!0,stackedCoordDimension:"z"}),s=new r.a.List(a,e);return s.setCalculationInfo(o),s.initData(i),s}},function(e,t){e.exports=function(e,t,i){return{seriesType:e,performRawSeries:!0,reset:function(e,n,r){var a=e.getData(),o=e.get("symbol")||t,s=e.get("symbolSize"),l=e.get("symbolKeepAspect");if(a.setVisual({legendSymbol:i||o,symbol:o,symbolSize:s,symbolKeepAspect:l}),!n.isSeriesFiltered(e)){var u="function"==typeof s;return{dataEach:a.hasItemOption||u?function(t,i){if("function"==typeof s){var n=e.getRawValue(i),r=e.getDataParams(i);t.setItemVisual(i,"symbolSize",s(n,r))}if(t.hasItemOption){var a=t.getItemModel(i),o=a.getShallow("symbol",!0),l=a.getShallow("symbolSize",!0),u=a.getShallow("symbolKeepAspect",!0);null!=o&&t.setItemVisual(i,"symbol",o),null!=l&&t.setItemVisual(i,"symbolSize",l),null!=u&&t.setItemVisual(i,"symbolKeepAspect",u)}}:null}}}}}},function(e,t,i){var n=i(7),r=i(111),a=i(11),o=i(14),s=i(19),l=i(26),u=i(115),h=i(8),c=i(71),d=i(21),f=i(12);h.a.import(c.a);var p=d.a.create,g={};function m(e){return e.material}function v(e,t,i){return t.uniforms[i].value}function y(e,t,i,n){return i!==n}function _(e){return!0}function x(){}var b={float:a.a.FLOAT,byte:a.a.BYTE,ubyte:a.a.UNSIGNED_BYTE,short:a.a.SHORT,ushort:a.a.UNSIGNED_SHORT};function w(e,t,i){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=i,this.vao=null}function T(e){var t,i;this.bind=function(e){t||((t=o.a.createCanvas()).width=t.height=1,t.getContext("2d"));var n=e.gl,r=!i;r&&(i=n.createTexture()),n.bindTexture(n.TEXTURE_2D,i),r&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)},this.unbind=function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var S=n.a.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=o.a.createCanvas());var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new r.a(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(n8){throw"Error creating WebGL Context "+n8}this._programMgr=new u.a(this),this._placeholderTexture=new T(this)}),{resize:function(e,t){var i=this.canvas,n=this.devicePixelRatio;null!=e?(i.style.width=e+"px",i.style.height=t+"px",i.width=e*n,i.height=t*n,this._width=e,this._height=t):(this._width=i.width/n,this._height=i.height/n),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,i,n,r){if("object"==typeof e){var a=e;e=a.x,t=a.y,i=a.width,n=a.height,r=a.devicePixelRatio}r=r||this.devicePixelRatio,this.gl.viewport(e*r,t*r,i*r,n*r),this.viewport={x:e,y:t,width:i,height:n,devicePixelRatio:r}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var e=this._clearStack.pop();this.clearColor=e.clearColor,this.clearBit=e.clearBit}},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,i,n){var r=this.gl,a=this.clearColor;if(this.clearBit){r.colorMask(!0,!0,!0,!0),r.depthMask(!0);var o=this.viewport,s=!1,l=o.devicePixelRatio;(o.width!==this._width||o.height!==this._height||l&&l!==this.devicePixelRatio||o.x||o.y)&&(s=!0,r.enable(r.SCISSOR_TEST),r.scissor(o.x*l,o.y*l,o.width*l,o.height*l)),r.clearColor(a[0],a[1],a[2],a[3]),r.clear(this.clearBit),s&&r.disable(r.SCISSOR_TEST)}if(i||e.update(!1),e.updateLights(),t=t||e.getMainCamera()){t.update();var u=e.updateRenderList(t,!0);this._sceneRendering=e;var h=u.opaque,c=u.transparent,g=e.material;e.trigger("beforerender",this,e,t,u),n?(this.renderPreZ(h,e,t),r.depthFunc(r.LEQUAL)):r.depthFunc(r.LESS);for(var m=p(),v=f.a.create(),y=0;y<c.length;y++){var _=c[y];d.a.multiplyAffine(m,t.viewMatrix.array,_.worldTransform.array),f.a.transformMat4(v,_.position.array,m),_.__depth=v[2]}this.renderPass(h,t,{getMaterial:function(e){return g||e.material},sortCompare:this.opaqueSortCompare}),this.renderPass(c,t,{getMaterial:function(e){return g||e.material},sortCompare:this.transparentSortCompare}),e.trigger("afterrender",this,e,t,u),this._sceneRendering=null}else console.error("Can't find camera in the scene.")},getProgram:function(e,t,i){return t=t||e.material,this._programMgr.getProgram(e,t,i)},validateProgram:function(e){if(e.__error){var t=e.__error;if(g[e.__uid__])return;if(g[e.__uid__]=!0,this.throwError)throw new Error(t);this.trigger("error",t)}},updatePrograms:function(e,t,i){var n=i&&i.getMaterial||m;t=t||null;for(var r=0;r<e.length;r++){var a=e[r],o=n.call(this,a);if(r>0){var s=e[r-1],l=s.joints?s.joints.length:0;if((a.joints?a.joints.length:0)===l&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var u=this._programMgr.getProgram(a,o,t);this.validateProgram(u),a.__program=u}},renderPass:function(e,t,i){this.trigger("beforerenderpass",this,e,t,i),(i=i||{}).getMaterial=i.getMaterial||m,i.getUniform=i.getUniform||v,i.isMaterialChanged=i.isMaterialChanged||y,i.beforeRender=i.beforeRender||x,i.afterRender=i.afterRender||x;var n=i.ifRender||_;this.updatePrograms(e,this._sceneRendering,i),i.sortCompare&&e.sort(i.sortCompare);var r=this.viewport,a=r.devicePixelRatio,o=[r.x*a,r.y*a,r.width*a,r.height*a],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[o[2],o[3]],h=Date.now();t?(d.a.copy(M.VIEW,t.viewMatrix.array),d.a.copy(M.PROJECTION,t.projectionMatrix.array),d.a.copy(M.VIEWINVERSE,t.worldTransform.array)):(d.a.identity(M.VIEW),d.a.identity(M.PROJECTION),d.a.identity(M.VIEWINVERSE)),d.a.multiply(M.VIEWPROJECTION,M.PROJECTION,M.VIEW),d.a.invert(M.PROJECTIONINVERSE,M.PROJECTION),d.a.invert(M.VIEWPROJECTIONINVERSE,M.VIEWPROJECTION);for(var c,f,p,g,b,w,T,S,A,I,C,D,E=this.gl,L=this._sceneRendering,P=this.getGLExtension("OES_vertex_array_object"),N=0;N<e.length;N++){var R,O=e[N],k=null!=O.worldTransform;if(n(O)){k&&(R=O.isSkinnedMesh&&O.isSkinnedMesh()?M.IDENTITY:O.worldTransform.array);var z=O.geometry,B=i.getMaterial.call(this,O),F=O.__program,V=B.shader,G=z.__uid__+"-"+F.__uid__,H=G!==I;I=G,H&&P&&P.bindVertexArrayOES(null),k&&(d.a.copy(M.WORLD,R),d.a.multiply(M.WORLDVIEWPROJECTION,M.VIEWPROJECTION,R),d.a.multiplyAffine(M.WORLDVIEW,M.VIEW,R),(V.matrixSemantics.WORLDINVERSE||V.matrixSemantics.WORLDINVERSETRANSPOSE)&&d.a.invert(M.WORLDINVERSE,R),(V.matrixSemantics.WORLDVIEWINVERSE||V.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&d.a.invert(M.WORLDVIEWINVERSE,M.WORLDVIEW),(V.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||V.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&d.a.invert(M.WORLDVIEWPROJECTIONINVERSE,M.WORLDVIEWPROJECTION)),O.beforeRender&&O.beforeRender(this),i.beforeRender.call(this,O,B,c);var U=F!==f;U?(F.bind(this),F.setUniformOfSemantic(E,"VIEWPORT",o),F.setUniformOfSemantic(E,"WINDOW_SIZE",l),t&&(F.setUniformOfSemantic(E,"NEAR",t.near),F.setUniformOfSemantic(E,"FAR",t.far)),F.setUniformOfSemantic(E,"DEVICEPIXELRATIO",a),F.setUniformOfSemantic(E,"TIME",h),F.setUniformOfSemantic(E,"VIEWPORT_SIZE",u),L&&L.setLightUniforms(F,O.lightGroup,this)):F=f,(U||i.isMaterialChanged(O,p,B,c))&&(B.depthTest!==g&&(B.depthTest?E.enable(E.DEPTH_TEST):E.disable(E.DEPTH_TEST),g=B.depthTest),B.depthMask!==b&&(E.depthMask(B.depthMask),b=B.depthMask),B.transparent!==A&&(B.transparent?E.enable(E.BLEND):E.disable(E.BLEND),A=B.transparent),B.transparent&&(B.blend?B.blend(E):(E.blendEquationSeparate(E.FUNC_ADD,E.FUNC_ADD),E.blendFuncSeparate(E.SRC_ALPHA,E.ONE_MINUS_SRC_ALPHA,E.ONE,E.ONE_MINUS_SRC_ALPHA))),D=this._bindMaterial(O,B,F,p||null,c||null,f||null,i.getUniform),c=B);var W=V.matrixSemanticKeys;if(k)for(var j=0;j<W.length;j++){var X=W[j],Z=V.matrixSemantics[X],q=M[X];if(Z.isTranspose){var Y=M[Z.semanticNoTranspose];d.a.transpose(q,Y)}F.setUniform(E,Z.type,Z.symbol,q)}O.cullFace!==T&&(T=O.cullFace,E.cullFace(T)),O.frontFace!==S&&(S=O.frontFace,E.frontFace(S)),O.culling!==w&&((w=O.culling)?E.enable(E.CULL_FACE):E.disable(E.CULL_FACE)),this._updateSkeleton(O,F,D),H&&(C=this._bindVAO(P,V,z,F)),this._renderObject(O,C),i.afterRender(this,O),O.afterRender&&O.afterRender(this),f=F,p=O}}P&&P.bindVertexArrayOES(null),this.trigger("afterrenderpass",this,e,t,i)},getMaxJointNumber:function(){return this._glinfo.getMaxJointNumber()},_updateSkeleton:function(e,t,i){var n=this.gl,r=e.skeleton;if(r)if(r.update(),e.joints.length>this._glinfo.getMaxJointNumber()){var a=r.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,a,i),t.setUniform(n,"1i","skinMatricesTexture",i),t.setUniform(n,"1f","skinMatricesTextureSize",a.width)}else{var o=r.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(n,"SKIN_MATRIX",o)}},_renderObject:function(e,t){var i=this.gl,n=e.geometry,r=e.mode;if(null==r&&(r=4),t.indicesBuffer){var a=this.getGLExtension("OES_element_index_uint")&&n.indices instanceof Uint32Array?i.UNSIGNED_INT:i.UNSIGNED_SHORT;i.drawElements(r,t.indicesBuffer.count,a,0)}else i.drawArrays(r,0,n.vertexCount)},_bindMaterial:function(e,t,i,n,r,a,o){for(var s=this.gl,l=a===i,u=i.currentTextureSlot(),h=t.getEnabledUniforms(),c=t.getTextureUniforms(),d=this._placeholderTexture,f=0;f<c.length;f++){var p=o(e,t,v=c[f]);if("t"===(m=t.uniforms[v].type)&&p)p.__slot=-1;else if("tv"===m)for(var g=0;g<p.length;g++)p[g]&&(p[g].__slot=-1)}for(d.__slot=-1,f=0;f<h.length;f++){var m,v=h[f],y=t.uniforms[v],_=(p=o(e,t,v),"t"===(m=y.type));if(_&&(p&&p.isRenderable()||(p=d)),r&&l){var x=o(n,r,v);if(_&&(x&&x.isRenderable()||(x=d)),x===p){if(_)i.takeCurrentTextureSlot(this,null);else if("tv"===m&&p)for(g=0;g<p.length;g++)i.takeCurrentTextureSlot(this,null);continue}}if(null!=p)if(_)if(p.__slot<0){var b=i.currentTextureSlot();i.setUniform(s,"1i",v,b)&&(i.takeCurrentTextureSlot(this,p),p.__slot=b)}else i.setUniform(s,"1i",v,p.__slot);else if(Array.isArray(p)){if(0===p.length)continue;if("tv"===m){if(!i.hasUniform(v))continue;var w=[];for(g=0;g<p.length;g++){var T=p[g];T.__slot<0?(b=i.currentTextureSlot(),w.push(b),i.takeCurrentTextureSlot(this,T),T.__slot=b):w.push(T.__slot)}i.setUniform(s,"1iv",v,w)}else i.setUniform(s,y.type,v,p)}else i.setUniform(s,y.type,v,p)}var S=i.currentTextureSlot();return i.resetTextureSlot(u),S},_bindVAO:function(e,t,i,n){var r=!i.dynamic,a=this.gl,o=this.__uid__+"-"+n.__uid__,s=i.__vaoCache[o];if(!s){var l=i.getBufferChunks(this);if(!l||!l.length)return;for(var u=l[0],h=u.attributeBuffers,c=u.indicesBuffer,d=[],f=[],p=0;p<h.length;p++){var g,m=(S=h[p]).name,v=S.semantic;if(v){var y=t.attributeSemantics[v];g=y&&y.symbol}else g=m;g&&n.attributes[g]&&(d.push(S),f.push(g))}s=new w(d,f,c),r&&(i.__vaoCache[o]=s)}var _=!0;if(e&&r&&(null==s.vao?s.vao=e.createVertexArrayOES():_=!1,e.bindVertexArrayOES(s.vao)),d=s.availableAttributes,c=s.indicesBuffer,_){var x=n.enableAttributes(this,s.availableAttributeSymbols,e&&r&&s);for(p=0;p<d.length;p++){var T=x[p];if(-1!==T){var S,M=(S=d[p]).buffer,A=S.size,I=b[S.type]||a.FLOAT;a.bindBuffer(a.ARRAY_BUFFER,M),a.vertexAttribPointer(T,A,I,!1,0,0)}}i.isUseIndices()&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,c.buffer)}return s},renderPreZ:function(e,t,i){var n=this.gl,r=this._prezMaterial||new s.a({shader:new h.a(h.a.source("clay.prez.vertex"),h.a.source("clay.prez.fragment"))});this._prezMaterial=r,n.colorMask(!1,!1,!1,!1),n.depthMask(!0),this.renderPass(e,i,{ifRender:function(e){return!e.ignorePreZ},isMaterialChanged:function(e,t){var i=e.material,n=t.material;return i.get("diffuseMap")!==n.get("diffuseMap")||(i.get("alphaCutoff")||0)!==(n.get("alphaCutoff")||0)},getUniform:function(e,t,i){return"alphaMap"===i?e.material.get("diffuseMap"):"alphaCutoff"===i?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:t.get(i)},getMaterial:function(){return r},sort:this.opaqueSortCompare}),n.colorMask(!0,!0,!0,!0),n.depthMask(!0)},disposeScene:function(e){this.disposeNode(e,!0,!0),e.dispose()},disposeNode:function(e,t,i){e.getParent()&&e.getParent().remove(e);var n={};e.traverse((function(e){var r=e.material;if(e.geometry&&t&&e.geometry.dispose(this),i&&r&&!n[r.__uid__]){for(var a=r.getTextureUniforms(),o=0;o<a.length;o++){var s=a[o],l=r.uniforms[s].value,u=r.uniforms[s].type;if(l)if("t"===u)l.dispose&&l.dispose(this);else if("tv"===u)for(var h=0;h<l.length;h++)l[h]&&l[h].dispose&&l[h].dispose(this)}n[r.__uid__]=!0}e.dispose&&e.dispose(this)}),this)},disposeGeometry:function(e){e.dispose(this)},disposeTexture:function(e){e.dispose(this)},disposeFrameBuffer:function(e){e.dispose(this)},dispose:function(){},screenToNDC:function(e,t,i){i||(i=new l.a),t=this._height-t;var n=this.viewport,r=i.array;return r[0]=(e-n.x)/n.width,r[0]=2*r[0]-1,r[1]=(t-n.y)/n.height,r[1]=2*r[1]-1,i}});S.opaqueSortCompare=S.prototype.opaqueSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.renderOrder-t.renderOrder},S.transparentSortCompare=S.prototype.transparentSortCompare=function(e,t){return e.renderOrder===t.renderOrder?e.__depth===t.__depth?e.__program===t.__program?e.material===t.material?e.geometry.__uid__-t.geometry.__uid__:e.material.__uid__-t.material.__uid__:e.__program&&t.__program?e.__program.__uid__-t.__program.__uid__:0:e.__depth-t.__depth:e.renderOrder-t.renderOrder};var M={IDENTITY:p(),WORLD:p(),VIEW:p(),PROJECTION:p(),WORLDVIEW:p(),VIEWPROJECTION:p(),WORLDVIEWPROJECTION:p(),WORLDINVERSE:p(),VIEWINVERSE:p(),PROJECTIONINVERSE:p(),WORLDVIEWINVERSE:p(),VIEWPROJECTIONINVERSE:p(),WORLDVIEWPROJECTIONINVERSE:p(),WORLDTRANSPOSE:p(),VIEWTRANSPOSE:p(),PROJECTIONTRANSPOSE:p(),WORLDVIEWTRANSPOSE:p(),VIEWPROJECTIONTRANSPOSE:p(),WORLDVIEWPROJECTIONTRANSPOSE:p(),WORLDINVERSETRANSPOSE:p(),VIEWINVERSETRANSPOSE:p(),PROJECTIONINVERSETRANSPOSE:p(),WORLDVIEWINVERSETRANSPOSE:p(),VIEWPROJECTIONINVERSETRANSPOSE:p(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:p()};S.COLOR_BUFFER_BIT=a.a.COLOR_BUFFER_BIT,S.DEPTH_BUFFER_BIT=a.a.DEPTH_BUFFER_BIT,S.STENCIL_BUFFER_BIT=a.a.STENCIL_BUFFER_BIT,t.a=S},function(e,t,i){function n(e,t){this.action=e,this.context=t}var r={trigger:function(e){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(e)){var t=this.__handlers__[e],i=t.length,n=-1,r=arguments;switch(r.length){case 1:for(;++n<i;)t[n].action.call(t[n].context);return;case 2:for(;++n<i;)t[n].action.call(t[n].context,r[1]);return;case 3:for(;++n<i;)t[n].action.call(t[n].context,r[1],r[2]);return;case 4:for(;++n<i;)t[n].action.call(t[n].context,r[1],r[2],r[3]);return;case 5:for(;++n<i;)t[n].action.call(t[n].context,r[1],r[2],r[3],r[4]);return;default:for(;++n<i;)t[n].action.apply(t[n].context,Array.prototype.slice.call(r,1));return}}},on:function(e,t,i){if(e&&t){var r=this.__handlers__||(this.__handlers__={});if(r[e]){if(this.has(e,t))return}else r[e]=[];var a=new n(t,i||this);return r[e].push(a),this}},once:function(e,t,i){if(e&&t){var n=this;return this.on(e,(function i(){n.off(e,i),t.apply(this,arguments)}),i)}},before:function(e,t,i){if(e&&t)return e="before"+e,this.on(e,t,i)},after:function(e,t,i){if(e&&t)return e="after"+e,this.on(e,t,i)},success:function(e,t){return this.once("success",e,t)},error:function(e,t){return this.once("error",e,t)},off:function(e,t){var i=this.__handlers__||(this.__handlers__={});if(t){if(i[e]){for(var n=i[e],r=[],a=0;a<n.length;a++)t&&n[a].action!==t&&r.push(n[a]);i[e]=r}return this}i[e]=[]},has:function(e,t){var i=this.__handlers__;if(!i||!i[e])return!1;for(var n=i[e],r=0;r<n.length;r++)if(n[r].action===t)return!0}};t.a=r},function(e,t,i){var n,r,a,o,s,l=i(3),u=i(12),h=1e-5,c=function(e,t){this.origin=e||new l.a,this.direction=t||new l.a};c.prototype={constructor:c,intersectPlane:function(e,t){var i=e.normal.array,n=e.distance,r=this.origin.array,a=this.direction.array,o=u.a.dot(i,a);if(0===o)return null;t||(t=new l.a);var s=(u.a.dot(i,r)-n)/o;return u.a.scaleAndAdd(t.array,r,a,-s),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=u.a.dot(e.normal.array,this.direction.array);u.a.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,2*-t),this.direction._dirty=!0},distanceToPoint:(s=u.a.create(),function(e){u.a.sub(s,e,this.origin.array);var t=u.a.dot(s,this.direction.array);if(t<0)return u.a.distance(this.origin.array,e);var i=u.a.lenSquared(s);return Math.sqrt(i-t*t)}),intersectSphere:function(){var e=u.a.create();return function(t,i,n){var r=this.origin.array,a=this.direction.array;t=t.array,u.a.sub(e,t,r);var o=u.a.dot(e,a),s=u.a.squaredLength(e)-o*o,h=i*i;if(!(s>h)){var c=Math.sqrt(h-s),d=o-c,f=o+c;return n||(n=new l.a),d<0?f<0?null:(u.a.scaleAndAdd(n.array,r,a,f),n):(u.a.scaleAndAdd(n.array,r,a,d),n)}}}(),intersectBoundingBox:function(e,t){var i,n,r,a,o,s,h=this.direction.array,c=this.origin.array,d=e.min.array,f=e.max.array,p=1/h[0],g=1/h[1],m=1/h[2];if(p>=0?(i=(d[0]-c[0])*p,n=(f[0]-c[0])*p):(n=(d[0]-c[0])*p,i=(f[0]-c[0])*p),g>=0?(r=(d[1]-c[1])*g,a=(f[1]-c[1])*g):(a=(d[1]-c[1])*g,r=(f[1]-c[1])*g),i>a||r>n)return null;if((r>i||i!=i)&&(i=r),(a<n||n!=n)&&(n=a),m>=0?(o=(d[2]-c[2])*m,s=(f[2]-c[2])*m):(s=(d[2]-c[2])*m,o=(f[2]-c[2])*m),i>s||o>n)return null;if((o>i||i!=i)&&(i=o),(s<n||n!=n)&&(n=s),n<0)return null;var v=i>=0?i:n;return t||(t=new l.a),u.a.scaleAndAdd(t.array,c,h,v),t},intersectTriangle:(n=u.a.create(),r=u.a.create(),a=u.a.create(),o=u.a.create(),function(e,t,i,s,c,d){var f=this.direction.array,p=this.origin.array;e=e.array,t=t.array,i=i.array,u.a.sub(n,t,e),u.a.sub(r,i,e),u.a.cross(o,r,f);var g=u.a.dot(n,o);if(s){if(g>-1e-5)return null}else if(g>-1e-5&&g<h)return null;u.a.sub(a,p,e);var m=u.a.dot(o,a)/g;if(m<0||m>1)return null;u.a.cross(o,n,a);var v=u.a.dot(f,o)/g;if(v<0||v>1||m+v>1)return null;u.a.cross(o,n,r);var y=-u.a.dot(a,o)/g;return y<0?null:(c||(c=new l.a),d&&l.a.set(d,1-m-v,m,v),u.a.scaleAndAdd(c.array,p,f,y),c)}),applyTransform:function(e){l.a.add(this.direction,this.direction,this.origin),l.a.transformMat4(this.origin,this.origin,e),l.a.transformMat4(this.direction,this.direction,e),l.a.sub(this.direction,this.direction,this.origin),l.a.normalize(this.direction,this.direction)},copy:function(e){l.a.copy(this.origin,e.origin),l.a.copy(this.direction,e.direction)},clone:function(){var e=new c;return e.copy(this),e}},t.a=c},function(e,t,i){var n,r,a,o,s=i(20),l=i(12),u=i(33),h=i(34),c={create:function(){var e=new s.a(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}};c.rotationTo=(n=l.a.create(),r=l.a.fromValues(1,0,0),a=l.a.fromValues(0,1,0),function(e,t,i){var o=l.a.dot(t,i);return o<-.999999?(l.a.cross(n,r,t),l.a.length(n)<1e-6&&l.a.cross(n,a,t),l.a.normalize(n,n),c.setAxisAngle(e,n,Math.PI),e):o>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(l.a.cross(n,t,i),e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=1+o,c.normalize(e,e))}),c.setAxes=(o=h.a.create(),function(e,t,i,n){return o[0]=i[0],o[3]=i[1],o[6]=i[2],o[1]=n[0],o[4]=n[1],o[7]=n[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],c.normalize(e,c.fromMat3(e,o))}),c.clone=u.a.clone,c.fromValues=u.a.fromValues,c.copy=u.a.copy,c.set=u.a.set,c.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},c.setAxisAngle=function(e,t,i){i*=.5;var n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e},c.add=u.a.add,c.multiply=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=i[0],l=i[1],u=i[2],h=i[3];return e[0]=n*h+o*s+r*u-a*l,e[1]=r*h+o*l+a*s-n*u,e[2]=a*h+o*u+n*l-r*s,e[3]=o*h-n*s-r*l-a*u,e},c.mul=c.multiply,c.scale=u.a.scale,c.rotateX=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l+o*s,e[1]=r*l+a*s,e[2]=a*l-r*s,e[3]=o*l-n*s,e},c.rotateY=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l-a*s,e[1]=r*l+o*s,e[2]=a*l+n*s,e[3]=o*l-r*s,e},c.rotateZ=function(e,t,i){i*=.5;var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l+r*s,e[1]=r*l-n*s,e[2]=a*l+o*s,e[3]=o*l-a*s,e},c.calculateW=function(e,t){var i=t[0],n=t[1],r=t[2];return e[0]=i,e[1]=n,e[2]=r,e[3]=Math.sqrt(Math.abs(1-i*i-n*n-r*r)),e},c.dot=u.a.dot,c.lerp=u.a.lerp,c.slerp=function(e,t,i,n){var r,a,o,s,l,u=t[0],h=t[1],c=t[2],d=t[3],f=i[0],p=i[1],g=i[2],m=i[3];return(a=u*f+h*p+c*g+d*m)<0&&(a=-a,f=-f,p=-p,g=-g,m=-m),1-a>1e-6?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-n)*r)/o,l=Math.sin(n*r)/o):(s=1-n,l=n),e[0]=s*u+l*f,e[1]=s*h+l*p,e[2]=s*c+l*g,e[3]=s*d+l*m,e},c.invert=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i*i+n*n+r*r+a*a,s=o?1/o:0;return e[0]=-i*s,e[1]=-n*s,e[2]=-r*s,e[3]=a*s,e},c.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},c.length=u.a.length,c.len=c.length,c.squaredLength=u.a.squaredLength,c.sqrLen=c.squaredLength,c.normalize=u.a.normalize,c.fromMat3=function(e,t){var i,n=t[0]+t[4]+t[8];if(n>0)i=Math.sqrt(n+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*a+o]-t[3*o+a])*i,e[a]=(t[3*a+r]+t[3*r+a])*i,e[o]=(t[3*o+r]+t[3*r+o])*i}return e},t.a=c},function(e,t,i){var n,r=i(55),a=i(34),o=function(e,t,i,n){e=e||0,t=t||0,i=i||0,n=void 0===n?1:n,this.array=r.a.fromValues(e,t,i,n),this._dirty=!0};o.prototype={constructor:o,add:function(e){return r.a.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return r.a.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,i,n){return this.array[0]=e,this.array[1]=t,this.array[2]=i,this.array[3]=n,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new o(this.x,this.y,this.z,this.w)},conjugate:function(){return r.a.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return r.a.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return r.a.dot(this.array,e.array)},fromMat3:function(e){return r.a.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(n=a.a.create(),function(e){return a.a.fromMat4(n,e.array),a.a.transpose(n,n),r.a.fromMat3(this.array,n),this._dirty=!0,this}),identity:function(){return r.a.identity(this.array),this._dirty=!0,this},invert:function(){return r.a.invert(this.array,this.array),this._dirty=!0,this},len:function(){return r.a.len(this.array)},length:function(){return r.a.length(this.array)},lerp:function(e,t,i){return r.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},mul:function(e){return r.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return r.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return r.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return r.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return r.a.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return r.a.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return r.a.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return r.a.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return r.a.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,i){return r.a.setAxes(this.array,e.array,t.array,i.array),this._dirty=!0,this},setAxisAngle:function(e,t){return r.a.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,i){return r.a.slerp(this.array,e.array,t.array,i),this._dirty=!0,this},sqrLen:function(){return r.a.sqrLen(this.array)},squaredLength:function(){return r.a.squaredLength(this.array)},fromEuler:function(e,t){return o.fromEuler(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var s=Object.defineProperty;if(s){var l=o.prototype;s(l,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),s(l,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),s(l,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),s(l,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}o.add=function(e,t,i){return r.a.add(e.array,t.array,i.array),e._dirty=!0,e},o.set=function(e,t,i,n,a){r.a.set(e.array,t,i,n,a),e._dirty=!0},o.copy=function(e,t){return r.a.copy(e.array,t.array),e._dirty=!0,e},o.calculateW=function(e,t){return r.a.calculateW(e.array,t.array),e._dirty=!0,e},o.conjugate=function(e,t){return r.a.conjugate(e.array,t.array),e._dirty=!0,e},o.identity=function(e){return r.a.identity(e.array),e._dirty=!0,e},o.invert=function(e,t){return r.a.invert(e.array,t.array),e._dirty=!0,e},o.dot=function(e,t){return r.a.dot(e.array,t.array)},o.len=function(e){return r.a.length(e.array)},o.lerp=function(e,t,i,n){return r.a.lerp(e.array,t.array,i.array,n),e._dirty=!0,e},o.slerp=function(e,t,i,n){return r.a.slerp(e.array,t.array,i.array,n),e._dirty=!0,e},o.multiply=o.mul=function(e,t,i){return r.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},o.rotateX=function(e,t,i){return r.a.rotateX(e.array,t.array,i),e._dirty=!0,e},o.rotateY=function(e,t,i){return r.a.rotateY(e.array,t.array,i),e._dirty=!0,e},o.rotateZ=function(e,t,i){return r.a.rotateZ(e.array,t.array,i),e._dirty=!0,e},o.setAxisAngle=function(e,t,i){return r.a.setAxisAngle(e.array,t.array,i),e._dirty=!0,e},o.normalize=function(e,t){return r.a.normalize(e.array,t.array),e._dirty=!0,e},o.squaredLength=o.sqrLen=function(e){return r.a.sqrLen(e.array)},o.fromMat3=function(e,t){return r.a.fromMat3(e.array,t.array),e._dirty=!0,e},o.setAxes=function(e,t,i,n){return r.a.setAxes(e.array,t.array,i.array,n.array),e._dirty=!0,e},o.rotationTo=function(e,t,i){return r.a.rotationTo(e.array,t.array,i.array),e._dirty=!0,e},o.fromEuler=function(e,t,i){e._dirty=!0,t=t.array;var n=e.array,r=Math.cos(t[0]/2),a=Math.cos(t[1]/2),o=Math.cos(t[2]/2),s=Math.sin(t[0]/2),l=Math.sin(t[1]/2),u=Math.sin(t[2]/2);switch(i=(i||"XYZ").toUpperCase()){case"XYZ":n[0]=s*a*o+r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o-s*l*u;break;case"YXZ":n[0]=s*a*o+r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o+s*l*u;break;case"ZXY":n[0]=s*a*o-r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o-s*l*u;break;case"ZYX":n[0]=s*a*o-r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o+s*l*u;break;case"YZX":n[0]=s*a*o+r*l*u,n[1]=r*l*o+s*a*u,n[2]=r*a*u-s*l*o,n[3]=r*a*o-s*l*u;break;case"XZY":n[0]=s*a*o-r*l*u,n[1]=r*l*o-s*a*u,n[2]=r*a*u+s*l*o,n[3]=r*a*o+s*l*u}},t.a=o},function(e,t,i){var n="__dt__",r=function(){this._contextId=0,this._caches=[],this._context={}};(r.prototype={use:function(e,t){var i=this._caches;i[e]||(i[e]={},t&&(i[e]=t())),this._contextId=e,this._context=i[e]},put:function(e,t){this._context[e]=t},get:function(e){return this._context[e]},dirty:function(e){var t=n+(e=e||"");this.put(t,!0)},dirtyAll:function(e){for(var t=n+(e=e||""),i=this._caches,r=0;r<i.length;r++)i[r]&&(i[r][t]=!0)},fresh:function(e){var t=n+(e=e||"");this.put(t,!1)},freshAll:function(e){for(var t=n+(e=e||""),i=this._caches,r=0;r<i.length;r++)i[r]&&(i[r][t]=!1)},isDirty:function(e){var t=n+(e=e||""),i=this._context;return!i.hasOwnProperty(t)||!0===i[t]},deleteContext:function(e){delete this._caches[e],this._context={}},delete:function(e){delete this._context[e]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(e,t){Object.keys(this._caches).forEach((function(i){e&&e.call(t,i)}))},miss:function(e){return!this._context.hasOwnProperty(e)}}).constructor=r,t.a=r},function(e,t,i){var n,r=i(35),a=i(9),o=i(59),s=i(54),l=i(33),u=i(12),h=r.a.extend((function(){return{projectionMatrix:new a.a,invProjectionMatrix:new a.a,viewMatrix:new a.a,frustum:new o.a}}),(function(){this.update(!0)}),{update:function(e){r.a.prototype.update.call(this,e),a.a.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),a.a.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){a.a.copy(this.viewMatrix,e),a.a.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){a.a.copy(this.projectionMatrix,e),a.a.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(n=l.a.create(),function(e,t){var i=void 0!==t?t:new s.a,r=e.array[0],a=e.array[1];return l.a.set(n,r,a,-1,1),l.a.transformMat4(n,n,this.invProjectionMatrix.array),l.a.transformMat4(n,n,this.worldTransform.array),u.a.scale(i.origin.array,n,1/n[3]),l.a.set(n,r,a,1,1),l.a.transformMat4(n,n,this.invProjectionMatrix.array),l.a.transformMat4(n,n,this.worldTransform.array),u.a.scale(n,n,1/n[3]),u.a.sub(i.direction.array,n,i.origin.array),u.a.normalize(i.direction.array,i.direction.array),i.direction._dirty=!0,i.origin._dirty=!0,i})});t.a=h},function(e,t,i){var n,r=i(18),a=i(74),o=i(12),s=o.a.set,l=o.a.copy,u=o.a.transformMat4,h=Math.min,c=Math.max,d=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new a.a);for(this.boundingBox=new r.a,this.vertices=[],e=0;e<8;e++)this.vertices[e]=o.a.fromValues(0,0,0)};d.prototype={setFromProjection:function(e){var t=this.planes,i=e.array,n=i[0],r=i[1],a=i[2],o=i[3],l=i[4],u=i[5],h=i[6],c=i[7],d=i[8],f=i[9],p=i[10],g=i[11],m=i[12],v=i[13],y=i[14],_=i[15];s(t[0].normal.array,o-n,c-l,g-d),t[0].distance=-(_-m),t[0].normalize(),s(t[1].normal.array,o+n,c+l,g+d),t[1].distance=-(_+m),t[1].normalize(),s(t[2].normal.array,o+r,c+u,g+f),t[2].distance=-(_+v),t[2].normalize(),s(t[3].normal.array,o-r,c-u,g-f),t[3].distance=-(_-v),t[3].normalize(),s(t[4].normal.array,o-a,c-h,g-p),t[4].distance=-(_-y),t[4].normalize(),s(t[5].normal.array,o+a,c+h,g+p),t[5].distance=-(_+y),t[5].normalize();var x=this.boundingBox,b=this.vertices;if(0===_){var w=u/n,T=-y/(p-1),S=-y/(p+1),M=-S/u,A=-T/u;x.min.set(-M*w,-M,S),x.max.set(M*w,M,T),s(b[0],-M*w,-M,S),s(b[1],-M*w,M,S),s(b[2],M*w,-M,S),s(b[3],M*w,M,S),s(b[4],-A*w,-A,T),s(b[5],-A*w,A,T),s(b[6],A*w,-A,T),s(b[7],A*w,A,T)}else{var I=(-1-m)/n,C=(1-m)/n,D=(1-v)/u,E=(-1-v)/u,L=(-1-y)/p,P=(1-y)/p;x.min.set(Math.min(I,C),Math.min(E,D),Math.min(P,L)),x.max.set(Math.max(C,I),Math.max(D,E),Math.max(L,P));var N=x.min.array,R=x.max.array;s(b[0],N[0],N[1],N[2]),s(b[1],N[0],R[1],N[2]),s(b[2],R[0],N[1],N[2]),s(b[3],R[0],R[1],N[2]),s(b[4],N[0],N[1],R[2]),s(b[5],N[0],R[1],R[2]),s(b[6],R[0],N[1],R[2]),s(b[7],R[0],R[1],R[2])}},getTransformedBoundingBox:(n=o.a.create(),function(e,t){var i=this.vertices,r=t.array,a=e.min,o=e.max,s=a.array,d=o.array,f=i[0];u(n,f,r),l(s,n),l(d,n);for(var p=1;p<8;p++)f=i[p],u(n,f,r),s[0]=h(n[0],s[0]),s[1]=h(n[1],s[1]),s[2]=h(n[2],s[2]),d[0]=c(n[0],d[0]),d[1]=c(n[1],d[1]),d[2]=c(n[2],d[2]);return a._dirty=!0,o._dirty=!0,e})},t.a=d},function(e,t){var i=function(){this.head=null,this.tail=null,this._len=0},n=i.prototype;n.insert=function(e){var t=new r(e);return this.insertEntry(t),t},n.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},n.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},n.len=function(){return this._len},n.clear=function(){this.head=this.tail=null,this._len=0};var r=function(e){this.value=e,this.next,this.prev},a=function(e){this._list=new i,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},o=a.prototype;o.put=function(e,t){var i=this._list,n=this._map,a=null;if(null==n[e]){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new r(t),s.key=e,i.insertEntry(s),n[e]=s}return a},o.get=function(e){var t=this._map[e],i=this._list;if(null!=t)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;e.exports=s},function(e,t,i){var n=i(5),r=i(27),a=i(14),o=i(62),s=i(75),l=i(36),u=i(122),h=i(123),c={loadTexture:function(e,t,i,a){var o;if("function"==typeof t?(a=i=t,t={}):t=t||{},"string"==typeof e){if(e.match(/.hdr$/)||"hdr"===t.fileType)return o=new n.a({width:0,height:0,sRGB:!1}),c._fetchTexture(e,(function(e){h.a.parseRGBE(e,o,t.exposure),o.dirty(),i&&i(o)}),a),o;e.match(/.dds$/)||"dds"===t.fileType?(o=new n.a({width:0,height:0}),c._fetchTexture(e,(function(e){u.a.parse(e,o),o.dirty(),i&&i(o)}),a)):((o=new n.a).load(e),o.success(i),o.error(a))}else"object"==typeof e&&void 0!==e.px&&((o=new r.a).load(e),o.success(i),o.error(a));return o},loadPanorama:function(e,t,i,n,r,a){var o=this;"function"==typeof n?(a=r=n,n={}):n=n||{},c.loadTexture(t,n,(function(t){t.flipY=n.flipY||!1,o.panoramaToCubeMap(e,t,i,n),t.dispose(e),r&&r(i)}),a)},panoramaToCubeMap:function(e,t,i,n){var r=new o.a,a=new s.a({scene:new l.a});return a.setEnvironmentMap(t),(n=n||{}).encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),i.sRGB=t.sRGB,r.texture=i,r.render(e,a.scene),r.texture=null,r.dispose(e),i},heightToNormal:function(e,t){var i=document.createElement("canvas"),n=i.width=e.width,r=i.height=e.height,a=i.getContext("2d");a.drawImage(e,0,0,n,r),t=t||!1;for(var o=a.getImageData(0,0,n,r),s=a.createImageData(n,r),l=0;l<o.data.length;l+=4){if(t){var u=o.data[l],h=o.data[l+1],c=o.data[l+2];if(Math.abs(u-h)+Math.abs(h-c)>20)return console.warn("Given image is not a height map"),e}var d,f,p,g;l%(4*n)==0?(d=o.data[l],p=o.data[l+4]):l%(4*n)==4*(n-1)?(d=o.data[l-4],p=o.data[l]):(d=o.data[l-4],p=o.data[l+4]),l<4*n?(f=o.data[l],g=o.data[l+4*n]):l>n*(r-1)*4?(f=o.data[l-4*n],g=o.data[l]):(f=o.data[l-4*n],g=o.data[l+4*n]),s.data[l]=d-p+127,s.data[l+1]=f-g+127,s.data[l+2]=255,s.data[l+3]=255}return a.putImageData(s,0,0),i},isHeightImage:function(e,t,i){if(!e||!e.width||!e.height)return!1;var n=document.createElement("canvas"),r=n.getContext("2d"),a=t||32;i=i||20,n.width=n.height=a,r.drawImage(e,0,0,a,a);for(var o=r.getImageData(0,0,a,a),s=0;s<o.data.length;s+=4){var l=o.data[s],u=o.data[s+1],h=o.data[s+2];if(Math.abs(l-u)+Math.abs(u-h)>i)return!1}return!0},_fetchTexture:function(e,t,i){a.a.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:i})},createChessboard:function(e,t,i,r){e=e||512,t=t||64,i=i||"black",r=r||"white";var a=Math.ceil(e/t),o=document.createElement("canvas");o.width=e,o.height=e;var s=o.getContext("2d");s.fillStyle=r,s.fillRect(0,0,e,e),s.fillStyle=i;for(var l=0;l<a;l++)for(var u=0;u<a;u++)(u%2?l%2:l%2-1)&&s.fillRect(l*t,u*t,t,t);return new n.a({image:o,anisotropic:8})},createBlank:function(e){var t=document.createElement("canvas");t.width=1,t.height=1;var i=t.getContext("2d");return i.fillStyle=e,i.fillRect(0,0,1,1),new n.a({image:t})}};t.a=c},function(e,t,i){var n=i(7),r=i(3),a=i(41),o=i(10),s=["px","nx","py","ny","pz","nz"],l=n.a.extend((function(){var e={position:new r.a,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new a.a({fov:90}),nx:new a.a({fov:90}),py:new a.a({fov:90}),ny:new a.a({fov:90}),pz:new a.a({fov:90}),nz:new a.a({fov:90})};return t.px.lookAt(r.a.POSITIVE_X,r.a.NEGATIVE_Y),t.nx.lookAt(r.a.NEGATIVE_X,r.a.NEGATIVE_Y),t.py.lookAt(r.a.POSITIVE_Y,r.a.POSITIVE_Z),t.ny.lookAt(r.a.NEGATIVE_Y,r.a.NEGATIVE_Z),t.pz.lookAt(r.a.POSITIVE_Z,r.a.NEGATIVE_Y),t.nz.lookAt(r.a.NEGATIVE_Z,r.a.NEGATIVE_Y),e._frameBuffer=new o.a,e}),{getCamera:function(e){return this._cameras[e]},render:function(e,t,i){var n=e.gl;i||t.update();for(var a=this.texture.width,o=2*Math.atan(a/(a-.5))/Math.PI*180,l=0;l<6;l++){var u=s[l],h=this._cameras[u];if(r.a.copy(h.position,this.position),h.far=this.far,h.near=this.near,h.fov=o,this.shadowMapPass){h.update();var c=t.getBoundingBox();c.applyTransform(h.viewMatrix),t.viewBoundingBoxLastFrame.copy(c),this.shadowMapPass.render(e,t,h,!0)}this._frameBuffer.attach(this.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+l),this._frameBuffer.bind(e),e.render(t,h,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}});t.a=l},function(e,t,i){var n=i(1),r=i(165),a=i(166);n.a.Shader.import(a.a),t.a=n.a.Mesh.extend((function(){return{geometry:new r.a({dynamic:!0}),material:new n.a.Material({shader:n.a.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(204),s=i(25),l=i(2),u=i(6),h=i(65),c=i(66),d=i(46),f=u.a.vec3;function p(e){this.rootNode=new a.a.Node,this._triangulationResults={},this._shadersMap=a.a.COMMON_SHADERS.reduce((function(e,t){return e[t]=a.a.createShader("ecgl."+t),e}),{}),this._linesShader=a.a.createShader("ecgl.meshLines3D");var t={};a.a.COMMON_SHADERS.forEach((function(e){t[e]=new a.a.Material({shader:a.a.createShader("ecgl."+e)})})),this._groundMaterials=t,this._groundMesh=new a.a.Mesh({geometry:new a.a.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new c.a(512,512,e),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=e}a.a.Shader.import(d.a),p.prototype={constructor:p,extrudeY:!0,update:function(e,t,i,n,r){var a=e.getData();null==n&&(n=0),null==r&&(r=a.count()),this._startIndex=n,this._endIndex=r-1,this._triangulation(e,n,r);var o=this._getShader(e.get("shading"));this._prepareMesh(e,o,i,n,r),this.rootNode.updateWorldTransform(),this._updateRegionMesh(e,i,n,r);var s=e.coordinateSystem;"geo3D"===s.type&&this._updateGroundPlane(e,s,i);var l=this;this._labelsBuilder.updateData(a,n,r),this._labelsBuilder.getLabelPosition=function(e,t,i){var n=a.getName(e),r=i;if("geo3D"===s.type){var o=s.getRegion(n);return o?(h=o.center,s.dataToPoint([h[0],h[1],r])):[NaN,NaN,NaN]}var u=l._triangulationResults[e-l._startIndex],h=l.extrudeY?[(u.max[0]+u.min[0])/2,u.max[1]+r,(u.max[2]+u.min[2])/2]:[(u.max[0]+u.min[0])/2,(u.max[1]+u.min[1])/2,u.max[2]+r]},this._data=a,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(e),this._lastHoverDataIndex=0},_initMeshes:function(){var e,t=this,i=(e=new a.a.Mesh({name:"Polygon",material:new a.a.Material({shader:t._shadersMap.lambert}),geometry:new a.a.Geometry({sortTriangles:!0,dynamic:!0}),culling:!1,ignorePicking:!0,renderNormal:!0}),r.a.util.extend(e.geometry,h.a),e),n=new a.a.Mesh({material:new a.a.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new s.a({useNativeLine:!1})});this.rootNode.add(i),this.rootNode.add(n),i.material.define("both","VERTEX_COLOR"),i.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=i,this._linesMesh=n,this.rootNode.add(this._groundMesh)},_getShader:function(e){var t=this._shadersMap[e];return t||(console.warn("Unkown shading "+e),t=this._shadersMap.lambert),t.__shading=e,t},_prepareMesh:function(e,t,i,n,r){for(var o=0,s=0,l=0,u=0,h=n;h<r;h++){var c=this._getRegionPolygonInfo(h),d=this._getRegionLinesInfo(h,e,this._linesMesh.geometry);o+=c.vertexCount,s+=c.triangleCount,l+=d.vertexCount,u+=d.triangleCount}var f=this._polygonMesh,p=f.geometry;["position","normal","texcoord0","color"].forEach((function(e){p.attributes[e].init(o)})),p.indices=o>65535?new Uint32Array(3*s):new Uint16Array(3*s),f.material.shader!==t&&f.material.attachShader(t,!0),a.a.setMaterialFromModel(t.__shading,f.material,e,i),l>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(l),this._linesMesh.geometry.setTriangleCount(u)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(r-n))},_updateRegionMesh:function(e,t,i,n){for(var r=e.getData(),o=0,s=0,u=!1,h=this._polygonMesh,c=this._linesMesh,d=i;d<n;d++){var f=e.getRegionModel(d),p=f.getModel("itemStyle"),g=p.get("color"),m=l.a.firstNotNull(p.get("opacity"),1),v=r.getItemVisual(d,"color",!0);null!=v&&r.hasValue(d)&&(g=v),r.setItemVisual(d,"color",g),r.setItemVisual(d,"opacity",m),g=a.a.parseColor(g);var y=a.a.parseColor(p.get("borderColor"));g[3]*=m,y[3]*=m;var _=g[3]<.99;h.material.set("color",[1,1,1,1]),u=u||_;for(var x=l.a.firstNotNull(f.get("height",!0),e.get("regionHeight")),b=this._updatePolygonGeometry(e,h.geometry,d,x,o,s,g),w=o;w<b.vertexOffset;w++)this._dataIndexOfVertex[w]=d;this._vertexRangeOfDataIndex[2*(d-i)]=o,this._vertexRangeOfDataIndex[2*(d-i)+1]=b.vertexOffset,o=b.vertexOffset,s=b.triangleOffset;var T=p.get("borderWidth"),S=T>0;S&&(T*=t.getDevicePixelRatio(),this._updateLinesGeometry(c.geometry,e,d,x,T,e.coordinateSystem.transform)),c.invisible=!S,c.material.set({color:y})}(h=this._polygonMesh).material.transparent=u,h.material.depthMask=!u,h.geometry.updateBoundingBox(),h.frontFace=this.extrudeY?a.a.Mesh.CCW:a.a.Mesh.CW,h.material.get("normalMap")&&h.geometry.generateTangents(),h.seriesIndex=e.seriesIndex,h.on("mousemove",this._onmousemove,this),h.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(e){var t=e.getModel("debug.wireframe");if(t.get("show")){var i=a.a.parseColor(t.get("lineStyle.color")||"rgba(0,0,0,0.5)"),n=l.a.firstNotNull(t.get("lineStyle.width"),1),r=this._polygonMesh;r.geometry.generateBarycentric(),r.material.define("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",i),r.material.set("wireframeLineWidth",n)}},_onmousemove:function(e){var t=this._dataIndexOfVertex[e.triangle[0]];null==t&&(t=-1),t!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(t),this._labelsBuilder.updateLabels([t])),this._lastHoverDataIndex=t,this._polygonMesh.dataIndex=t},_onmouseout:function(e){e.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(e,t,i){var n=e.getModel("groundPlane",e);if(this._groundMesh.invisible=!n.get("show",!0),!this._groundMesh.invisible){var r=e.get("shading"),o=this._groundMaterials[r];o||(console.warn("Unkown shading "+r),o=this._groundMaterials.lambert),a.a.setMaterialFromModel(r,o,n,i),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",a.a.parseColor(n.get("color"))),this._groundMesh.scale.set(t.size[0],t.size[2],1)}},_triangulation:function(e,t,i){this._triangulationResults=[];for(var n=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0],a=e.coordinateSystem,s=t;s<i;s++){for(var l=[],u=e.getRegionPolygonCoords(s),h=0;h<u.length;h++){var c=u[h].exterior,d=u[h].interiors,p=[],g=[];if(!(c.length<3)){for(var m=0,v=0;v<c.length;v++){var y=c[v];p[m++]=y[0],p[m++]=y[1]}for(v=0;v<d.length;v++)if(!(d[v].length<3)){for(var _=p.length/2,x=0;x<d[v].length;x++)y=d[v][x],p.push(y[0]),p.push(y[1]);g.push(_)}var b=Object(o.a)(p,g),w=new Float64Array(p.length/2*3),T=[],S=[1/0,1/0,1/0],M=[-1/0,-1/0,-1/0],A=0;for(v=0;v<p.length;)f.set(T,p[v++],0,p[v++]),a&&a.transform&&f.transformMat4(T,T,a.transform),f.min(S,S,T),f.max(M,M,T),w[A++]=T[0],w[A++]=T[1],w[A++]=T[2];f.min(n,n,S),f.max(r,r,M),l.push({points:w,indices:b,min:S,max:M})}}this._triangulationResults.push(l)}this._geoBoundingBox=[n,r]},_getRegionPolygonInfo:function(e){for(var t=this._triangulationResults[e-this._startIndex],i=0,n=0,r=0;r<t.length;r++)i+=t[r].points.length/3,n+=t[r].indices.length/3;return{vertexCount:2*i+4*i,triangleCount:2*n+2*i}},_updatePolygonGeometry:function(e,t,i,n,r,a,o){var s=e.get("projectUVOnGround"),l=t.attributes.position,u=t.attributes.normal,h=t.attributes.texcoord0,c=t.attributes.color,d=this._triangulationResults[i-this._startIndex],p=c.value&&o,g=t.indices,m=this.extrudeY?1:2,v=this.extrudeY?2:1,y=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],_=f.mul([],this._geoBoundingBox[0],y),x=f.mul([],this._geoBoundingBox[1],y),b=Math.max(x[0]-_[0],x[2]-_[2]);function w(e,t,i){var n=r;!function(e,t,i){for(var n=e.points,a=n.length,s=[],u=[],d=0;d<a;d+=3)s[0]=n[d],s[m]=t,s[v]=n[d+2],u[0]=(n[d]*y[0]-_[0])/b,u[1]=(n[d+2]*y[v]-_[2])/b,l.set(r,s),p&&c.set(r,o),h.set(r++,u)}(e,t);for(var s=e.indices.length,u=0;u<s;u++)g[3*a+u]=e.indices[u]+n;a+=e.indices.length/3}for(var T=this.extrudeY?[0,1,0]:[0,0,1],S=f.negate([],T),M=0;M<d.length;M++){var A=r,I=d[M];w(I,0),w(I,n);for(var C=I.points.length/3,D=0;D<C;D++)u.set(A+D,S),u.set(A+D+C,T);var E=[0,3,1,1,3,2],L=[[],[],[],[]],P=[],N=[],R=[],O=[],k=0;for(D=0;D<C;D++){for(var z=(D+1)%C,B=(I.points[3*z]-I.points[3*D])*y[0],F=(I.points[3*z+2]-I.points[3*D+2])*y[v],V=Math.sqrt(B*B+F*F),G=0;G<4;G++){var H=0===G||3===G,U=3*(H?D:z);L[G][0]=I.points[U],L[G][m]=G>1?n:0,L[G][v]=I.points[U+2],l.set(r+G,L[G]),s?(O[0]=(I.points[U]*y[0]-_[0])/b,O[1]=(I.points[U+2]*y[v]-_[v])/b):(O[0]=(H?k:k+V)/b,O[1]=(L[G][m]*y[m]-_[m])/b),h.set(r+G,O)}for(f.sub(P,L[1],L[0]),f.sub(N,L[3],L[0]),f.cross(R,P,N),f.normalize(R,R),G=0;G<4;G++)u.set(r+G,R),p&&c.set(r+G,o);for(G=0;G<6;G++)g[3*a+G]=E[G]+r;r+=4,a+=2,k+=V}}return t.dirty(),{vertexOffset:r,triangleOffset:a}},_getRegionLinesInfo:function(e,t,i){var n=0,r=0;return t.getRegionModel(e).getModel("itemStyle").get("borderWidth")>0&&t.getRegionPolygonCoords(e).forEach((function(e){var t=e.exterior,a=e.interiors;n+=i.getPolylineVertexCount(t),r+=i.getPolylineTriangleCount(t);for(var o=0;o<a.length;o++)n+=i.getPolylineVertexCount(a[o]),r+=i.getPolylineTriangleCount(a[o])}),this),{vertexCount:n,triangleCount:r}},_updateLinesGeometry:function(e,t,i,n,r,a){function o(e){for(var t=new Float64Array(3*e.length),i=0,r=[],o=0;o<e.length;o++)r[0]=e[o][0],r[1]=n+.1,r[2]=e[o][1],a&&f.transformMat4(r,r,a),t[i++]=r[0],t[i++]=r[1],t[i++]=r[2];return t}var s=[1,1,1,1];t.getRegionPolygonCoords(i).forEach((function(t){var i=t.exterior,n=t.interiors;e.addPolyline(o(i),s,r);for(var a=0;a<n.length;a++)e.addPolyline(o(n[a]),s,r)}))},highlight:function(e){var t=this._data;if(t){var i=t.getItemModel(e).getModel("emphasis.itemStyle"),n=i.get("color"),o=l.a.firstNotNull(i.get("opacity"),t.getItemVisual(e,"opacity"),1);if(null==n){var s=t.getItemVisual(e,"color");n=r.a.color.lift(s,-.4)}null==o&&(o=t.getItemVisual(e,"opacity"));var u=a.a.parseColor(n);u[3]*=o,this._setColorOfDataIndex(t,e,u)}},downplay:function(e){var t=this._data;if(t){var i=t.getItemVisual(e,"color"),n=l.a.firstNotNull(t.getItemVisual(e,"opacity"),1),r=a.a.parseColor(i);r[3]*=n,this._setColorOfDataIndex(t,e,r)}},_setColorOfDataIndex:function(e,t,i){if(!(t<this._startIndex&&t>this._endIndex)){t-=this._startIndex;for(var n=this._vertexRangeOfDataIndex[2*t];n<this._vertexRangeOfDataIndex[2*t+1];n++)this._polygonMesh.geometry.attributes.color.set(n,i);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}},t.a=p},function(e,t,i){var n=i(97),r=i(6).a.vec3,a=r.create(),o=r.create(),s=r.create();t.a={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(e,t){var i=this.indices;if(0===t){var n=this.attributes.position;e=e.array,this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new i.constructor(i.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var l,u=0,h=0;h<i.length;){n.get(i[h++],a),n.get(i[h++],o),n.get(i[h++],s);var c=r.sqrDist(a,e),d=r.sqrDist(o,e),f=r.sqrDist(s,e),p=Math.min(c,d);p=Math.min(p,f),3===h?(l=p,p=0):p-=l,this._triangleZList[u++]=p}}var g=this._sortedTriangleIndices;for(h=0;h<g.length;h++)g[h]=h;if(this.triangleCount<2e4)0===t&&this._simpleSort(!0);else for(h=0;h<3;h++)this._progressiveQuickSort(3*t+h);var m=this._indicesTmp,v=this._triangleZListTmp,y=this._triangleZList;for(h=0;h<this.triangleCount;h++){var _=3*g[h],x=3*h;m[x++]=i[_++],m[x++]=i[_++],m[x]=i[_],v[h]=y[g[h]]}var b=this._indicesTmp;this._indicesTmp=this.indices,this.indices=b,b=this._triangleZListTmp,this._triangleZListTmp=this._triangleZList,this._triangleZList=b,this.dirtyIndices()},_simpleSort:function(e){var t=this._triangleZList,i=this._sortedTriangleIndices;function r(e,i){return t[i]-t[e]}e?Array.prototype.sort.call(i,r):n.a.sort(i,r,0,i.length-1)},_progressiveQuickSort:function(e){var t=this._triangleZList,i=this._sortedTriangleIndices;this._quickSort=this._quickSort||new n.a,this._quickSort.step(i,(function(e,i){return t[i]-t[e]}),e)}}},function(e,t,i){var n=i(0),r=i.n(n),a=i(81),o=i(63),s=i(2);function l(e,t,i){this._labelsMesh=new o.a,this._labelTextureSurface=new a.a({width:512,height:512,devicePixelRatio:i.getDevicePixelRatio(),onupdate:function(){i.getZr().refresh()}}),this._api=i,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}l.prototype.getLabelPosition=function(e,t,i){return[0,0,0]},l.prototype.getLabelDistance=function(e,t,i){return 0},l.prototype.getMesh=function(){return this._labelsMesh},l.prototype.updateData=function(e,t,i){null==t&&(t=0),null==i&&(i=e.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===i-t||(this._labelsVisibilitiesBits=new Uint8Array(i-t));for(var n=["label","show"],r=["emphasis","label","show"],a=t;a<i;a++){var o=e.getItemModel(a),s=o.get(n),l=o.get(r);null==l&&(l=s);var u=(s?1:0)|(l?2:0);this._labelsVisibilitiesBits[a-t]=u}this._start=t,this._end=i,this._data=e},l.prototype.updateLabels=function(e){if(this._data){for(var t=(e=e||[]).length>0,i={},n=0;n<e.length;n++)i[e[n]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var a=["label"],o=["emphasis","label"],l=this._data.hostModel,u=this._data,h=l.getModel(a),c=l.getModel(o,h),d={left:"right",right:"left",top:"center",bottom:"center"},f={left:"middle",right:"middle",top:"bottom",bottom:"top"},p=this._start;p<this._end;p++){var g=!1;if(t&&i[p]&&(g=!0),this._labelsVisibilitiesBits[p-this._start]&(g?2:1)){var m=u.getItemModel(p).getModel(g?o:a,g?c:h),v=m.get("distance")||0,y=m.get("position"),_=m.getModel("textStyle"),x=this._api.getDevicePixelRatio(),b=l.getFormattedLabel(p,g?"emphasis":"normal");if(null==b||""===b)return;var w=new r.a.graphic.Text;r.a.graphic.setTextStyle(w.style,_,{text:b,textFill:_.get("color")||u.getItemVisual(p,"color")||"#000",textAlign:"left",textVerticalAlign:"top",opacity:s.a.firstNotNull(_.get("opacity"),u.getItemVisual(p,"opacity"),1)});var T=w.getBoundingRect();T.height*=1.2;var S=this._labelTextureSurface.add(w),M=d[y]||"center",A=f[y]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(p,y,v),[T.width*x,T.height*x],S,M,A,this.getLabelDistance(p,y,v)*x)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},t.a=l},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(239),s=i(240),l=i(66),u=i(9),h=i(2);function c(e,t){this.rootNode=new a.a.Node,this.is2D=e,this._labelsBuilder=new l.a(256,256,t),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=t,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}c.prototype={constructor:c,highlightOnMouseover:!0,update:function(e,t,i,n,r){var o=this._prevMesh;this._prevMesh=this._mesh,this._mesh=o;var l=e.getData();if(null==n&&(n=0),null==r&&(r=l.count()),this._startDataIndex=n,this._endDataIndex=r-1,!this._mesh){var u=this._prevMesh&&this._prevMesh.material;this._mesh=new s.a({renderOrder:10,frustumCulling:!1}),u&&(this._mesh.material=u)}u=this._mesh.material;var h=this._mesh.geometry,c=h.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var d=this._getSymbolInfo(e,n,r),f=i.getDevicePixelRatio(),p=e.getModel("itemStyle").getItemStyle(),g=e.get("large"),m=1;d.maxSize>2?(m=this._updateSymbolSprite(e,p,d,f),u.enableTexture("sprite")):u.disableTexture("sprite"),c.position.init(r-n);var v=[];if(g){u.undefine("VERTEX_SIZE"),u.undefine("VERTEX_COLOR");var y=l.getVisual("color"),_=l.getVisual("opacity");a.a.parseColor(y,v),v[3]*=_,u.set({color:v,u_Size:d.maxSize*this._sizeScale})}else u.set({color:[1,1,1,1]}),u.define("VERTEX_SIZE"),u.define("VERTEX_COLOR"),c.size.init(r-n),c.color.init(r-n),this._originalOpacity=new Float32Array(r-n);for(var x=l.getLayout("points"),b=c.position.value,w=0;w<r-n;w++){var T=3*w,S=2*w;if(this.is2D?(b[T]=x[S],b[T+1]=x[S+1],b[T+2]=-10):(b[T]=x[T],b[T+1]=x[T+1],b[T+2]=x[T+2]),!g){y=l.getItemVisual(w,"color"),_=l.getItemVisual(w,"opacity"),a.a.parseColor(y,v),v[3]*=_,c.color.set(w,v),v[3];var M=l.getItemVisual(w,"symbolSize");M=M instanceof Array?Math.max(M[0],M[1]):M,isNaN(M)&&(M=0),c.size.value[w]=M*m*this._sizeScale,this._originalOpacity[w]=v[3]}}this._mesh.sizeScale=m,h.updateBoundingBox(),h.dirty(),this._updateMaterial(e,p);var A=e.coordinateSystem;A&&A.viewGL&&u[A.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE"),g||this._updateLabelBuilder(e,n,r),this._updateHandler(e,t,i),this._updateAnimation(e),this._api=i},getPointsMesh:function(){return this._mesh},updateLabels:function(e){this._labelsBuilder.updateLabels(e)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},_updateSymbolSprite:function(e,t,i,n){i.maxSize=Math.min(2*i.maxSize,200);var r,a,s=[];return i.aspect>1?(s[0]=i.maxSize,s[1]=i.maxSize/i.aspect):(s[1]=i.maxSize,s[0]=i.maxSize*i.aspect),s[0]=s[0]||1,s[1]=s[1]||1,this._symbolType===i.type&&(r=this._symbolSize,a=s,r&&a&&r[0]===a[0]&&r[1]===a[1])&&this._lineWidth===t.lineWidth||(o.a.createSymbolSprite(i.type,s,{fill:"#fff",lineWidth:t.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(s[0]/2,10)},this._spriteImageCanvas),o.a.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=i.type,this._symbolSize=s,this._lineWidth=t.lineWidth),this._spriteImageCanvas.width/i.maxSize*n},_updateMaterial:function(e,t){var i="lighter"===e.get("blendMode")?a.a.additiveBlend:null,n=this._mesh.material;n.blend=i,n.set("lineWidth",t.lineWidth/20);var r=a.a.parseColor(t.stroke);n.set("strokeColor",r),n.transparent=!0,n.depthMask=!1,n.depthTest=!this.is2D,n.sortVertices=!this.is2D},_updateLabelBuilder:function(e,t,i){var n=e.getData(),r=this._mesh.geometry,a=r.attributes.position.value,o=(t=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(n,t,i),this._labelsBuilder.getLabelPosition=function(e,i,n){var r=3*(e-t);return[a[r],a[r+1],a[r+2]]},this._labelsBuilder.getLabelDistance=function(e,i,n){return r.attributes.size.get(e-t)/o/2+n},this._labelsBuilder.updateLabels()},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,e)},_updateHandler:function(e,t,i){var n,r=e.getData(),a=this._mesh,o=this,s=-1,l=e.coordinateSystem&&"cartesian3D"===e.coordinateSystem.type;l&&(n=e.coordinateSystem.model),a.seriesIndex=e.seriesIndex,a.off("mousemove"),a.off("mouseout"),a.on("mousemove",(function(t){var u=t.vertexIndex+o._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(r,s),this.highlight(r,u),this._labelsBuilder.updateLabels([u])),l&&i.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get(e.coordDimToDataDim("x")[0],u),r.get(e.coordDimToDataDim("y")[0],u),r.get(e.coordDimToDataDim("z")[0],u)],grid3DIndex:n.componentIndex})),a.dataIndex=u,s=u}),this),a.on("mouseout",(function(e){var t=e.vertexIndex+o._startDataIndex;this.highlightOnMouseover&&(this.downplay(r,t),this._labelsBuilder.updateLabels()),s=-1,a.dataIndex=-1,l&&i.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:n.componentIndex})}),this)},updateLayout:function(e,t,i){var n=e.getData();if(this._mesh){var r=this._mesh.geometry.attributes.position.value,a=n.getLayout("points");if(this.is2D)for(var o=0;o<a.length/2;o++){var s=3*o,l=2*o;r[s]=a[l],r[s+1]=a[l+1],r[s+2]=-10}else for(o=0;o<a.length;o++)r[o]=a[o];this._mesh.geometry.dirty(),i.getZr().refresh()}},updateView:function(e){if(this._mesh){var t=new u.a;u.a.mul(t,e.viewMatrix,this._mesh.worldTransform),u.a.mul(t,e.projectionMatrix,t),this._mesh.updateNDCPosition(t,this.is2D,this._api)}},highlight:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var i=e.getItemModel(t).getModel("emphasis.itemStyle"),n=i.get("color"),o=i.get("opacity");if(null==n){var s=e.getItemVisual(t,"color");n=r.a.color.lift(s,-.4)}null==o&&(o=e.getItemVisual(t,"opacity"));var l=a.a.parseColor(n);l[3]*=o,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,l),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(e,t){if(!(t>this._endDataIndex||t<this._startDataIndex)){var i=e.getItemVisual(t,"color"),n=e.getItemVisual(t,"opacity"),r=a.a.parseColor(i);r[3]*=n,this._mesh.geometry.attributes.color.set(t-this._startDataIndex,r),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(e){if(this._originalOpacity){for(var t=this._mesh.geometry,i=0;i<t.vertexCount;i++){var n=this._originalOpacity[i]*e;t.attributes.color.value[4*i+3]=n}t.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(e){this._mesh&&this._setPositionTextureToMesh(this._mesh,e),this._positionTexture=e},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(e){if(e!==this._sizeScale){if(this._mesh){var t=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",t/this._sizeScale*e);var i=this._mesh.geometry.attributes;if(i.size.value)for(var n=0;n<i.size.value.length;n++)i.size.value[n]=i.size.value[n]/this._sizeScale*e}this._sizeScale=e}},_setPositionTextureToMesh:function(e,t){t&&e.material.set("positionTexture",t),e.material[t?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(e,t,i){if(e.get("large"))return(d=h.a.firstNotNull(e.get("symbolSize"),1))instanceof Array?(l=Math.max(d[0],d[1]),n=d[0]/d[1]):(l=d,n=1),{maxSize:d,type:e.get("symbol"),aspect:n};for(var n,r=e.getData(),a=!1,o=r.getItemVisual(0,"symbol")||"circle",s=!1,l=0,u=t;u<i;u++){var c,d=r.getItemVisual(u,"symbolSize"),f=r.getItemVisual(u,"symbol");if(d instanceof Array)c=d[0]/d[1],l=Math.max(Math.max(d[0],d[1]),l);else{if(isNaN(d))return;c=1,l=Math.max(d,l)}null!=n&&Math.abs(c-n)>.05&&(a=!0),f!==o&&(s=!0),o=f,n=c}return a&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored."),{maxSize:l,type:o,aspect:n}}},t.a=c},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(n8){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){var n=i(114),r=function(e){this._list=new n.a,this._map={},this._maxSize=e||10};r.prototype.setMaxSize=function(e){this._maxSize=e},r.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var i=this._list.length();if(i>=this._maxSize&&i>0){var n=this._list.head;this._list.remove(n),delete this._map[n.key]}var r=this._list.insert(t);r.key=e,this._map[e]=r}},r.prototype.get=function(e){var t=this._map[e];if(this._map.hasOwnProperty(e))return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value},r.prototype.remove=function(e){var t=this._map[e];void 0!==t&&(delete this._map[e],this._list.remove(t))},r.prototype.clear=function(){this._list.clear(),this._map={}},t.a=r},function(e,t,i){var n,r=i(20),a={create:function(){var e=new r.a(2);return e[0]=0,e[1]=0,e},clone:function(e){var t=new r.a(2);return t[0]=e[0],t[1]=e[1],t},fromValues:function(e,t){var i=new r.a(2);return i[0]=e,i[1]=t,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,i){return e[0]=t,e[1]=i,e},add:function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},subtract:function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}};a.sub=a.subtract,a.multiply=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},a.mul=a.multiply,a.divide=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},a.div=a.divide,a.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},a.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},a.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},a.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},a.distance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(i*i+n*n)},a.dist=a.distance,a.squaredDistance=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n},a.sqrDist=a.squaredDistance,a.length=function(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)},a.len=a.length,a.squaredLength=function(e){var t=e[0],i=e[1];return t*t+i*i},a.sqrLen=a.squaredLength,a.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},a.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},a.normalize=function(e,t){var i=t[0],n=t[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r),e[0]=t[0]*r,e[1]=t[1]*r),e},a.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},a.cross=function(e,t,i){var n=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=n,e},a.lerp=function(e,t,i,n){var r=t[0],a=t[1];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e},a.random=function(e,t){t=t||1;var i=2*GLMAT_RANDOM()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e},a.transformMat2=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r,e[1]=i[1]*n+i[3]*r,e},a.transformMat2d=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r+i[4],e[1]=i[1]*n+i[3]*r+i[5],e},a.transformMat3=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[3]*r+i[6],e[1]=i[1]*n+i[4]*r+i[7],e},a.transformMat4=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[4]*r+i[12],e[1]=i[1]*n+i[5]*r+i[13],e},a.forEach=(n=a.create(),function(e,t,i,r,a,o){var s,l;for(t||(t=2),i||(i=0),l=r?Math.min(r*t+i,e.length):e.length,s=i;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],a(n,n,o),e[s]=n[0],e[s+1]=n[1];return e}),t.a=a},function(e,t,i){t.a="@export clay.prez.vertex\nuniform mat4 WVP : WORLDVIEWPROJECTION;\nattribute vec3 pos : POSITION;\nattribute vec2 uv : TEXCOORD_0;\n@import clay.chunk.skinning_header\nvarying vec2 v_Texcoord;\nvoid main()\n{\n vec3 P = pos;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = (skinMatrixWS * vec4(pos, 1.0)).xyz;\n#endif\n gl_Position = WVP * vec4(P, 1.0);\n v_Texcoord = uv;\n}\n@end\n@export clay.prez.fragment\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end"},function(e,t,i){var n,r=i(35),a=i(11),o=r.a.extend({material:null,geometry:null,mode:a.a.TRIANGLES,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:a.a.BACK,frontFace:a.a.CCW,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(e){},afterRender:function(e,t){},getBoundingBox:function(e,t){return t=r.a.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:(n=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var e=r.a.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var t=0;t<n.length;t++){var i=n[t];e[i]!==this[i]&&(e[i]=this[i])}return e})});o.POINTS=a.a.POINTS,o.LINES=a.a.LINES,o.LINE_LOOP=a.a.LINE_LOOP,o.LINE_STRIP=a.a.LINE_STRIP,o.TRIANGLES=a.a.TRIANGLES,o.TRIANGLE_STRIP=a.a.TRIANGLE_STRIP,o.TRIANGLE_FAN=a.a.TRIANGLE_FAN,o.BACK=a.a.BACK,o.FRONT=a.a.FRONT,o.FRONT_AND_BACK=a.a.FRONT_AND_BACK,o.CW=a.a.CW,o.CCW=a.a.CCW,t.a=o},function(e,t,i){var n={isPowerOfTwo:function(e){return 0==(e&e-1)},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}};t.a=n},function(e,t,i){var n,r,a,o,s=i(3),l=i(21),u=i(12),h=i(33),c=function(e,t){this.normal=e||new s.a(0,1,0),this.distance=t||0};c.prototype={constructor:c,distanceToPoint:function(e){return u.a.dot(e.array,this.normal.array)-this.distance},projectPoint:function(e,t){t||(t=new s.a);var i=this.distanceToPoint(e);return u.a.scaleAndAdd(t.array,e.array,this.normal.array,-i),t._dirty=!0,t},normalize:function(){var e=1/u.a.len(this.normal.array);u.a.scale(this.normal.array,e),this.distance*=e},intersectFrustum:function(e){for(var t=e.vertices,i=this.normal.array,n=u.a.dot(t[0].array,i)>this.distance,r=1;r<8;r++)if(u.a.dot(t[r].array,i)>this.distance!=n)return!0},intersectLine:(o=u.a.create(),function(e,t,i){var n=this.distanceToPoint(e),r=this.distanceToPoint(t);if(n>0&&r>0||n<0&&r<0)return null;var a=this.normal.array,l=this.distance,h=e.array;u.a.sub(o,t.array,e.array),u.a.normalize(o,o);var c=u.a.dot(a,o);if(0===c)return null;i||(i=new s.a);var d=(u.a.dot(a,h)-l)/c;return u.a.scaleAndAdd(i.array,h,o,-d),i._dirty=!0,i}),applyTransform:(n=l.a.create(),r=h.a.create(),a=h.a.create(),a[3]=1,function(e){e=e.array,u.a.scale(a,this.normal.array,this.distance),h.a.transformMat4(a,a,e),this.distance=u.a.dot(a,this.normal.array),l.a.invert(n,e),l.a.transpose(n,n),r[3]=0,u.a.copy(r,this.normal.array),h.a.transformMat4(r,r,n),u.a.copy(this.normal.array,r)}),copy:function(e){u.a.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new c;return e.copy(this),e}},t.a=c},function(e,t,i){var n=i(42);t.a=n.a},function(e,t,i){var n=i(15),r=i(43),a=i(9),o=i(3),s=i(18),l=i(14),u=new a.a,h=n.a.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},(function(){this.build()}),{build:function(){var e={px:c("px",this.depthSegments,this.heightSegments),nx:c("nx",this.depthSegments,this.heightSegments),py:c("py",this.widthSegments,this.depthSegments),ny:c("ny",this.widthSegments,this.depthSegments),pz:c("pz",this.widthSegments,this.heightSegments),nz:c("nz",this.widthSegments,this.heightSegments)},t=["position","texcoord0","normal"],i=0,n=0;for(var r in e)i+=e[r].vertexCount,n+=e[r].indices.length;for(var a=0;a<t.length;a++)this.attributes[t[a]].init(i);this.indices=new l.a.Uint16Array(n);var o=0,u=0;for(var r in e){var h=e[r];for(a=0;a<t.length;a++)for(var d=t[a],f=h.attributes[d].value,p=h.attributes[d].size,g="normal"===d,m=0;m<f.length;m++){var v=f[m];this.inside&&g&&(v=-v),this.attributes[d].value[m+p*u]=v}var y=h.indices.length;for(m=0;m<h.indices.length;m++)this.indices[m+o]=u+h.indices[this.inside?y-m-1:m];o+=h.indices.length,u+=h.vertexCount}this.boundingBox=new s.a,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function c(e,t,i){u.identity();var n=new r.a({widthSegments:t,heightSegments:i});switch(e){case"px":a.a.translate(u,u,o.a.POSITIVE_X),a.a.rotateY(u,u,Math.PI/2);break;case"nx":a.a.translate(u,u,o.a.NEGATIVE_X),a.a.rotateY(u,u,-Math.PI/2);break;case"py":a.a.translate(u,u,o.a.POSITIVE_Y),a.a.rotateX(u,u,-Math.PI/2);break;case"ny":a.a.translate(u,u,o.a.NEGATIVE_Y),a.a.rotateX(u,u,Math.PI/2);break;case"pz":a.a.translate(u,u,o.a.POSITIVE_Z);break;case"nz":a.a.translate(u,u,o.a.NEGATIVE_Z),a.a.rotateY(u,u,Math.PI)}return n.applyTransform(u),n}t.a=h},function(e,t,i){var n=i(5),r=i(27),a=i(4),o=i(10),s=i(16),l=i(19),u=i(8),h=i(42),c=i(36),d=i(62),f=i(14),p=i(61),g=i(127),m=i(128),v={},y=["px","nx","py","ny","pz","nz"];v.prefilterEnvironmentMap=function(e,t,i,s,g){g&&s||(s=v.generateNormalDistribution(),g=v.integrateBRDF(e,s));var _=(i=i||{}).width||64,x=i.height||64,b=i.type||t.type,w=new r.a({width:_,height:x,type:b,flipY:!1,mipmaps:[]});w.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var T=Math.min(_,x),S=Math.log(T)/Math.log(2)+1,M=new l.a({shader:new u.a({vertex:u.a.source("clay.skybox.vertex"),fragment:m.a})});M.set("normalDistribution",s),i.encodeRGBM&&M.define("fragment","RGBM_ENCODE"),i.decodeRGBM&&M.define("fragment","RGBM_DECODE");var A,I=new c.a;if("texture2D"===t.textureType){var C=new r.a({width:_,height:x,type:b===a.a.FLOAT?a.a.HALF_FLOAT:b});p.a.panoramaToCubeMap(e,t,C,{encodeRGBM:i.decodeRGBM}),t=C}(A=new h.a({scene:I,material:M})).material.set("environmentMap",t);var D=new d.a({texture:w});i.encodeRGBM&&(b=w.type=a.a.UNSIGNED_BYTE);for(var E=new n.a({width:_,height:x,type:b}),L=new o.a({depthBuffer:!1}),P=f.a[b===a.a.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],N=0;N<S;N++){w.mipmaps[N]={pixels:{}},A.material.set("roughness",N/(S-1));for(var R=E.width,O=2*Math.atan(R/(R-.5))/Math.PI*180,k=0;k<y.length;k++){var z=new P(E.width*E.height*4);L.attach(E),L.bind(e);var B=D.getCamera(y[k]);B.fov=O,e.render(I,B),e.gl.readPixels(0,0,E.width,E.height,a.a.RGBA,b,z),L.unbind(e),w.mipmaps[N].pixels[y[k]]=z}E.width/=2,E.height/=2,E.dirty()}return L.dispose(e),E.dispose(e),A.dispose(e),s.dispose(e),{environmentMap:w,brdfLookup:g,normalDistribution:s,maxMipmapLevel:S}},v.integrateBRDF=function(e,t){t=t||v.generateNormalDistribution();var i=new o.a({depthBuffer:!1}),r=new s.a({fragment:g.a}),l=new n.a({width:512,height:256,type:a.a.HALF_FLOAT,wrapS:a.a.CLAMP_TO_EDGE,wrapT:a.a.CLAMP_TO_EDGE,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST,useMipmap:!1});return r.setUniform("normalDistribution",t),r.setUniform("viewportSize",[512,256]),r.attachOutput(l),r.render(e,i),i.dispose(e),l},v.generateNormalDistribution=function(e,t){e=e||256,t=t||1024;for(var i=new n.a({width:e,height:t,type:a.a.FLOAT,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST,wrapS:a.a.CLAMP_TO_EDGE,wrapT:a.a.CLAMP_TO_EDGE,useMipmap:!1}),r=new Float32Array(t*e*4),o=[],s=0;s<e;s++){for(var l=s/e,u=l*l,h=0;h<t;h++){var c=(h<<16|h>>>16)>>>0;c=(((16711935&(c=((252645135&(c=((858993459&(c=((1431655765&c)<<1|(2863311530&c)>>>1)>>>0))<<2|(3435973836&c)>>>2)>>>0))<<4|(4042322160&c)>>>4)>>>0))<<8|(4278255360&c)>>>8)>>>0)/4294967296;var d=Math.sqrt((1-c)/(1+(u*u-1)*c));o[h]=d}for(h=0;h<t;h++){var f=4*(h*e+s),p=(d=o[h],Math.sqrt(1-d*d)),g=h/t,m=2*Math.PI*g;r[f]=p*Math.cos(m),r[f+1]=d,r[f+2]=p*Math.sin(m),r[f+3]=1}}return i.pixels=r,i},t.a=v},function(e,t,i){var n=i(20),r={create:function(){var e=new n.a(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},clone:function(e){var t=new n.a(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},transpose:function(e,t){if(e===t){var i=t[1];e[1]=t[2],e[2]=i}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},invert:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=i*a-r*n;return o?(o=1/o,e[0]=a*o,e[1]=-n*o,e[2]=-r*o,e[3]=i*o,e):null},adjoint:function(e,t){var i=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=i,e},determinant:function(e){return e[0]*e[3]-e[2]*e[1]},multiply:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=i[0],l=i[1],u=i[2],h=i[3];return e[0]=n*s+a*l,e[1]=r*s+o*l,e[2]=n*u+a*h,e[3]=r*u+o*h,e}};r.mul=r.multiply,r.rotate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=n*l+a*s,e[1]=r*l+o*s,e[2]=n*-s+a*l,e[3]=r*-s+o*l,e},r.scale=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=i[0],l=i[1];return e[0]=n*s,e[1]=r*s,e[2]=a*l,e[3]=o*l,e},r.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2))},r.LDU=function(e,t,i,n){return e[2]=n[2]/n[0],i[0]=n[0],i[1]=n[1],i[3]=n[3]-e[2]*i[1],[e,t,i]},t.a=r},function(e,t,i){var n=i(20),r={create:function(){var e=new n.a(6);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},clone:function(e){var t=new n.a(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},invert:function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=i*a-n*r;return l?(l=1/l,e[0]=a*l,e[1]=-n*l,e[2]=-r*l,e[3]=i*l,e[4]=(r*s-a*o)*l,e[5]=(n*o-i*s)*l,e):null},determinant:function(e){return e[0]*e[3]-e[1]*e[2]},multiply:function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=i[0],h=i[1],c=i[2],d=i[3],f=i[4],p=i[5];return e[0]=n*u+a*h,e[1]=r*u+o*h,e[2]=n*c+a*d,e[3]=r*c+o*d,e[4]=n*f+a*p+s,e[5]=r*f+o*p+l,e}};r.mul=r.multiply,r.rotate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+a*u,e[1]=r*h+o*u,e[2]=n*-u+a*h,e[3]=r*-u+o*h,e[4]=s,e[5]=l,e},r.scale=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=i[0],h=i[1];return e[0]=n*u,e[1]=r*u,e[2]=a*h,e[3]=o*h,e[4]=s,e[5]=l,e},r.translate=function(e,t,i){var n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=i[0],h=i[1];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=n*u+a*h+s,e[5]=r*u+o*h+l,e},r.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+1)},t.a=r},function(e,t){var i="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)};e.exports=i},function(e,t,i){var n=i(0),r=i.n(n),a=i(5);function o(e,t,i,n,r,a,o){this._zr=e,this._x=0,this._y=0,this._rowHeight=0,this.width=n,this.height=r,this.offsetX=t,this.offsetY=i,this.dpr=o,this.gap=a}function s(e){(e=e||{}).width=e.width||512,e.height=e.height||512,e.devicePixelRatio=e.devicePixelRatio||1,e.gap=null==e.gap?2:e.gap;var t=document.createElement("canvas");t.width=e.width*e.devicePixelRatio,t.height=e.height*e.devicePixelRatio,this._canvas=t,this._texture=new a.a({image:t,flipY:!1});var i=this;this._zr=r.a.zrender.init(t);var n=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){n.call(this),i._texture.dirty(),i.onupdate&&i.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new o(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}o.prototype={constructor:o,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(e,t,i){var n=e.getBoundingRect();null==t&&(t=n.width),null==i&&(i=n.height),t*=this.dpr,i*=this.dpr,this._fitElement(e,t,i);var r=this._x,a=this._y,o=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(r+t+l>o&&(r=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,i),a+i+l>s)return null;e.position[0]+=this.offsetX*this.dpr+r,e.position[1]+=this.offsetY*this.dpr+a,this._zr.add(e);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[r/o+u[0],a/s+u[1]],[(r+t)/o+u[0],(a+i)/s+u[1]]]},_fitElement:function(e,t,i){var n=e.getBoundingRect(),r=t/n.width,a=i/n.height;e.position=[-n.x*r,-n.y*a],e.scale=[r,a],e.update()}},s.prototype={clear:function(){for(var e=0;e<this._textureAtlasNodes.length;e++)this._textureAtlasNodes[e].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var e=4096/this._dpr,t=this._textureAtlasNodes.length,i=t*this._nodeWidth%e,n=Math.floor(t*this._nodeWidth/e)*this._nodeHeight;if(!(n>=e)){var r=(i+this._nodeWidth)*this._dpr,a=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:r,height:a})}catch(n8){this._canvas.width=r,this._canvas.height=a}var s=new o(this._zr,i,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(s),s}console.error("Too much labels. Some will be ignored.")},add:function(e,t,i){if(this._coords[e.id])return console.warn("Element already been add"),this._coords[e.id];var n=this._getCurrentNode().add(e,t,i);if(!n){var r=this._expand();if(!r)return;n=r.add(e,t,i)}return this._coords[e.id]=n,n},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]}},t.a=s},function(e,t,i){var n=i(83),r=i(84),a=n.applyTransform,o=Math.min,s=Math.max;function l(e,t,i,n){i<0&&(e+=i,i=-i),n<0&&(t+=n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}l.prototype={constructor:l,union:function(e){var t=o(e.x,this.x),i=o(e.y,this.y);this.width=s(e.x+e.width,this.x+this.width)-t,this.height=s(e.y+e.height,this.y+this.height)-i,this.x=t,this.y=i},applyTransform:function(){var e=[],t=[],i=[],n=[];return function(r){if(r){e[0]=i[0]=this.x,e[1]=n[1]=this.y,t[0]=n[0]=this.x+this.width,t[1]=i[1]=this.y+this.height,a(e,e,r),a(t,t,r),a(i,i,r),a(n,n,r),this.x=o(e[0],t[0],i[0],n[0]),this.y=o(e[1],t[1],i[1],n[1]);var l=s(e[0],t[0],i[0],n[0]),u=s(e[1],t[1],i[1],n[1]);this.width=l-this.x,this.height=u-this.y}}}(),calculateTransform:function(e){var t=this,i=e.width/t.width,n=e.height/t.height,a=r.create();return r.translate(a,a,[-t.x,-t.y]),r.scale(a,a,[i,n]),r.translate(a,a,[e.x,e.y]),a},intersect:function(e){if(!e)return!1;e instanceof l||(e=l.create(e));var t=this,i=t.x,n=t.x+t.width,r=t.y,a=t.y+t.height,o=e.x,s=e.x+e.width,u=e.y,h=e.y+e.height;return!(n<o||s<i||a<u||h<r)},contain:function(e,t){var i=this;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},clone:function(){return new l(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},l.create=function(e){return new l(e.x,e.y,e.width,e.height)};var u=l;e.exports=u},function(e,t){var i="undefined"==typeof Float32Array?Array:Float32Array;function n(e){return Math.sqrt(a(e))}var r=n;function a(e){return e[0]*e[0]+e[1]*e[1]}var o=a;function s(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var l=s;function u(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var h=u;t.create=function(e,t){var n=new i(2);return null==e&&(e=0),null==t&&(t=0),n[0]=e,n[1]=t,n},t.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},t.clone=function(e){var t=new i(2);return t[0]=e[0],t[1]=e[1],t},t.set=function(e,t,i){return e[0]=t,e[1]=i,e},t.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},t.scaleAndAdd=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},t.sub=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},t.len=n,t.length=r,t.lenSquare=a,t.lengthSquare=o,t.mul=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},t.div=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},t.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},t.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},t.normalize=function(e,t){var i=n(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e},t.distance=s,t.dist=l,t.distanceSquare=u,t.distSquare=h,t.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},t.lerp=function(e,t,i,n){return e[0]=t[0]+n*(i[0]-t[0]),e[1]=t[1]+n*(i[1]-t[1]),e},t.applyTransform=function(e,t,i){var n=t[0],r=t[1];return e[0]=i[0]*n+i[2]*r+i[4],e[1]=i[1]*n+i[3]*r+i[5],e},t.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},t.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}},function(e,t){var i="undefined"==typeof Float32Array?Array:Float32Array;function n(){var e=new i(6);return r(e),e}function r(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}t.create=n,t.identity=r,t.copy=a,t.mul=function(e,t,i){var n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],o=t[1]*i[2]+t[3]*i[3],s=t[0]*i[4]+t[2]*i[5]+t[4],l=t[1]*i[4]+t[3]*i[5]+t[5];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e},t.translate=function(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e},t.rotate=function(e,t,i){var n=t[0],r=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+o*u,e[1]=-n*u+o*h,e[2]=r*h+s*u,e[3]=-r*u+h*s,e[4]=h*a+u*l,e[5]=h*l-u*a,e},t.scale=function(e,t,i){var n=i[0],r=i[1];return e[0]=t[0]*n,e[1]=t[1]*r,e[2]=t[2]*n,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*r,e},t.invert=function(e,t){var i=t[0],n=t[2],r=t[4],a=t[1],o=t[3],s=t[5],l=i*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*r)*l,e[5]=(a*r-i*s)*l,e):null},t.clone=function(e){var t=n();return a(t,e),t}},function(e,t,i){var n=i(13),r=1e-4,a=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function o(e){return Math.floor(Math.log(e)/Math.LN10)}t.linearMap=function(e,t,i,n){var r=t[1]-t[0],a=i[1]-i[0];if(0===r)return 0===a?i[0]:(i[0]+i[1])/2;if(n)if(r>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/r*a+i[0]},t.parsePercent=function(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return"string"==typeof e?(i=e,i.replace(/^\s+/,"").replace(/\s+$/,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var i},t.round=function(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e},t.asc=function(e){return e.sort((function(e,t){return e-t})),e},t.getPrecision=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i},t.getPrecisionSafe=function(e){var t=e.toString(),i=t.indexOf("e");if(i>0){var n=+t.slice(i+1);return n<0?-n:0}var r=t.indexOf(".");return r<0?0:t.length-1-r},t.getPixelPrecision=function(e,t){var i=Math.log,n=Math.LN10,r=Math.floor(i(e[1]-e[0])/n),a=Math.round(i(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},t.getPercentWithPrecision=function(e,t,i){if(!e[t])return 0;var r=n.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===r)return 0;for(var a=Math.pow(10,i),o=n.map(e,(function(e){return(isNaN(e)?0:e)/r*a*100})),s=100*a,l=n.map(o,(function(e){return Math.floor(e)})),u=n.reduce(l,(function(e,t){return e+t}),0),h=n.map(o,(function(e,t){return e-l[t]}));u<s;){for(var c=Number.NEGATIVE_INFINITY,d=null,f=0,p=h.length;f<p;++f)h[f]>c&&(c=h[f],d=f);++l[d],h[d]=0,++u}return l[t]/a},t.MAX_SAFE_INTEGER=9007199254740991,t.remRadian=function(e){var t=2*Math.PI;return(e%t+t)%t},t.isRadianAroundZero=function(e){return e>-1e-4&&e<r},t.parseDate=function(e){if(e instanceof Date)return e;if("string"==typeof e){var t=a.exec(e);if(!t)return new Date(NaN);if(t[8]){var i=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(i-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,i,+(t[5]||0),+t[6]||0,+t[7]||0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,+t[7]||0)}return null==e?new Date(NaN):new Date(Math.round(e))},t.quantity=function(e){return Math.pow(10,o(e))},t.nice=function(e,t){var i=o(e),n=Math.pow(10,i),r=e/n;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*n,i>=-20?+e.toFixed(i<0?-i:0):e},t.reformIntervals=function(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,i=1,n=0;n<e.length;){for(var r=e[n].interval,a=e[n].close,o=0;o<2;o++)r[o]<=t&&(r[o]=t,a[o]=o?1:1-i),t=r[o],i=a[o];r[0]===r[1]&&a[0]*a[1]!=1?e.splice(n,1):n++}return e;function s(e,t,i){return e.interval[i]<t.interval[i]||e.interval[i]===t.interval[i]&&(e.close[i]-t.close[i]==(i?-1:1)||!i&&s(e,t,1))}},t.isNumeric=function(e){return e-parseFloat(e)>=0}},function(e,t,i){var n=i(5),r=i(11),a=i(23),o=function(){this._pool={},this._allocatedTextures=[]};o.prototype={constructor:o,get:function(e){var t=u(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]);var i=this._pool[t];if(!i.length){var r=new n.a(e);return this._allocatedTextures.push(r),r}return i.pop()},put:function(e){var t=u(e);this._pool.hasOwnProperty(t)||(this._pool[t]=[]),this._pool[t].push(e)},clear:function(e){for(var t=0;t<this._allocatedTextures.length;t++)this._allocatedTextures[t].dispose(e);this._pool={},this._allocatedTextures=[]}};var s={width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.CLAMP_TO_EDGE,wrapT:r.a.CLAMP_TO_EDGE,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},l=Object.keys(s);function u(e){var t,i,n,o;a.a.defaultsWithPropList(e,s,l),i=(t=e).width,n=t.height,o=0==(i&i-1)&&0==(n&n-1),t.format===r.a.DEPTH_COMPONENT&&(t.useMipmap=!1),o&&t.useMipmap||(t.minFilter==r.a.NEAREST_MIPMAP_NEAREST||t.minFilter==r.a.NEAREST_MIPMAP_LINEAR?t.minFilter=r.a.NEAREST:t.minFilter!=r.a.LINEAR_MIPMAP_LINEAR&&t.minFilter!=r.a.LINEAR_MIPMAP_NEAREST||(t.minFilter=r.a.LINEAR)),o||(t.wrapS=r.a.CLAMP_TO_EDGE,t.wrapT=r.a.CLAMP_TO_EDGE);for(var u="",h=0;h<l.length;h++)u+=e[l[h]].toString();return u}t.a=o},function(e,t,i){t.a="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n"},function(e,t,i){t.a="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n"},function(e,t,i){t.a="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end"},function(e,t,i){t.a="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end"},function(e,t,i){var n=i(0),r=i.n(n);t.a={getFilledRegions:function(e,t){var i,n=(e||[]).slice();if("string"==typeof t?i=(t=r.a.getMap(t))&&t.geoJson:t&&t.features&&(i=t),!i)return console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),i.features||console.error("Invalid GeoJSON for map3D"),[];for(var a={},o=i.features,s=0;s<n.length;s++)a[n[s].name]=n[s];for(s=0;s<o.length;s++){var l=o[s].properties.name;a[l]||n.push({name:l})}return n},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}}},function(e,t,i){function n(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function r(e,t,i,r,a){var o=i,s=e[t];n(e,t,r);for(var l=i;l<r;l++)a(e[l],s)<0&&(n(e,l,o),o++);return n(e,r,o),o}function a(e,t,i,n){if(i<n){var o=r(e,Math.floor((i+n)/2),i,n,t);a(e,t,i,o-1),a(e,t,o+1,n)}}function o(){this._parts=[]}o.prototype.step=function(e,t,i){var n=e.length;if(0===i){this._parts=[],this._sorted=!1;var o=Math.floor(n/2);this._parts.push({pivot:o,left:0,right:n-1}),this._currentSortPartIdx=0}if(!this._sorted){var s=this._parts;if(0===s.length)return this._sorted=!0,!0;if(s.length<512){for(var l=0;l<s.length;l++)s[l].pivot=r(e,s[l].pivot,s[l].left,s[l].right,t);var u=[];for(l=0;l<s.length;l++){var h,c=s[l].left;(h=s[l].pivot-1)>c&&u.push({pivot:Math.floor((h+c)/2),left:c,right:h}),c=s[l].pivot+1,(h=s[l].right)>c&&u.push({pivot:Math.floor((h+c)/2),left:c,right:h})}s=this._parts=u}else for(l=0;l<Math.floor(s.length/10);l++){var d=s.length-1-this._currentSortPartIdx;if(a(e,t,s[d].left,s[d].right),this._currentSortPartIdx++,this._currentSortPartIdx===s.length)return this._sorted=!0,!0}return!1}},o.sort=a,t.a=o},function(e,t,i){var n=i(99),r=i(0),a=i.n(r),o=i(47),s=i.n(o),l=i(22),u=i(2);function h(e,t){var i=e.getBoxLayoutParams(),n=s.a.getLayoutRect(i,{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var r=this.getGeoBoundingRect(),a=r.width/r.height*(e.get("aspectScale")||.75),o=e.get("boxWidth"),l=e.get("boxDepth"),u=e.get("boxHeight");null==u&&(u=5),isNaN(o)&&isNaN(l)&&(o=100),isNaN(l)?l=o/a:isNaN(o)&&(o=l/a),this.setSize(o,u,l),this.regionHeight=e.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(u-this.regionHeight,0))}function c(e,t){var i=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this&&"series.map3D"!==e.type){var t=e.getData(),n=e.coordDimToDataDim("alt"),r=n&&n[0];if(r){var a=t.getDataExtent(r,!0);i[0]=Math.min(i[0],a[0]),i[1]=Math.max(i[1],a[1])}}}),this),i&&isFinite(i[1]-i[0])){var n=a.a.helper.createScale(i,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new a.a.Axis("altitude",n),this.resize(this.model,t)}}var d=0,f={dimensions:n.a.prototype.dimensions,create:function(e,t){var i=[];if(!a.a.getMap)throw new Error("geo3D component depends on geo component");function n(e,n){var r=f.createGeo3D(e);e.__viewGL=e.__viewGL||new l.a,r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,i.push(r),r.resize=h,r.resize(e,t),r.update=c}return e.eachComponent("geo3D",(function(e,t){n(e)})),e.eachSeriesByType("map3D",(function(e,t){var i=e.get("coordinateSystem");null==i&&(i="geo3D"),"geo3D"===i&&n(e)})),e.eachSeries((function(t){if("geo3D"===t.get("coordinateSystem")){if("series.map3D"===t.type)return;var i=t.getReferringComponents("geo3D")[0];if(i||(i=e.getComponent("geo3D")),!i)throw new Error('geo "'+u.a.firstNotNull(t.get("geo3DIndex"),t.get("geo3DId"),0)+'" not found');t.coordinateSystem=i.coordinateSystem}})),i},createGeo3D:function(e){var t,i=e.get("map");if("string"==typeof i?(t=i,i=a.a.getMap(i)):i&&i.features&&(i={geoJson:i}),i||function(e){console.error("Map "+e+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")}(i),!i.geoJson.features)throw new Error("Invalid GeoJSON for map3D");return null==t&&(t="GEO_ANONYMOUS_"+d++),new n.a(t+d++,t,i&&i.geoJson,i&&i.specialAreas,e.get("nameMap"))}};a.a.registerCoordinateSystem("geo3D",f),t.a=f},function(e,t,i){var n=i(0),r=i.n(n),a=i(6),o=i(205),s=i.n(o),l=i(206),u=i.n(l),h=a.a.vec3,c=a.a.mat4,d=[s.a,u.a];function f(e,t,i,n,r){this.name=e,this.map=t,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(i,n,r),this.transform=c.identity(new Float64Array(16)),this.invTransform=c.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}f.prototype={constructor:f,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(e,t,i){var n=r.a.parseGeoJSON||r.a.parseGeoJson;try{this.regions=e?n(e):[]}catch(n8){throw"Invalid geoJson format\n"+n8}t=t||{},i=i||{};for(var a=this.regions,o={},s=0;s<a.length;s++){var l=a[s].name;l=i[l]||l,a[s].name=l,o[l]=a[s],this.addGeoCoord(l,a[s].center);var u=t[l];u&&a[s].transformTo(u.left,u.top,u.width,u.height)}this._regionsMap=o,this._geoRect=null,d.forEach((function(e){e(this)}),this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var e,t=this.regions,i=0;i<t.length;i++){var n=t[i].getBoundingRect();(e=e||n.clone()).union(n)}return this._geoRect=e||new r.a.graphic.BoundingRect(0,0,0,0)},addGeoCoord:function(e,t){this._nameCoordMap[e]=t},getRegion:function(e){return this._regionsMap[e]},getRegionByCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return t[i]},setSize:function(e,t,i){this.size=[e,t,i];var n=this.getGeoBoundingRect(),r=e/n.width,a=-i/n.height,o=-e/2-n.x*r,s=i/2-n.y*a,l=this.extrudeY?[o,0,s]:[o,s,0],u=this.extrudeY?[r,1,a]:[r,a,1],h=this.transform;c.identity(h),c.translate(h,h,l),c.scale(h,h,u),c.invert(this.invTransform,h)},dataToPoint:function(e,t){t=t||[];var i=this.extrudeY?1:2,n=this.extrudeY?2:1,r=e[2];return isNaN(r)&&(r=0),t[0]=e[0],t[n]=e[1],this.altitudeAxis?t[i]=this.altitudeAxis.dataToCoord(r):t[i]=0,t[i]+=this.regionHeight,h.transformMat4(t,t,this.transform),t},pointToData:function(e,t){}},t.a=f},function(e,t,i){var n=i(6).a.mat4,r=512,a=.6435011087932844,o=Math.PI,s=.1;function l(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom,this.maxPitch=60,this.zoomOffset=0}l.prototype={constructor:l,dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(e){this.bearing=e.bearing,this.pitch=e.pitch,this.center=e.center,this.zoom=e.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,r)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var e=.5/Math.tan(a/2)*this.height*s,t=Math.max(Math.min(this.pitch,this.maxPitch),0)/180*Math.PI,i=a/2,o=Math.PI/2+t,l=Math.sin(i)*e/Math.sin(Math.PI-o-i),u=1.1*(Math.cos(Math.PI/2-t)*l+e);this.pitch>50&&(u=1e3);var h=[];n.perspective(h,a,this.width/this.height,1,u),this.viewGL.camera.projectionMatrix.setArray(h),this.viewGL.camera.decomposeProjectionMatrix(),h=n.identity([]);var c=this.dataToPoint(this.center);n.scale(h,h,[1,-1,1]),n.translate(h,h,[0,0,-e]),n.rotateX(h,h,t),n.rotateZ(h,h,-this.bearing/180*Math.PI),n.translate(h,h,[-c[0]*this.getScale()*s,-c[1]*this.getScale()*s,0]),this.viewGL.camera.viewMatrix.array=h;var d=[];n.invert(d,h),this.viewGL.camera.worldTransform.array=d,this.viewGL.camera.decomposeWorldTransform();var f,p=r*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var g=this.altitudeExtent[1]-this.altitudeExtent[0];f=this.boxHeight/g*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else f=p/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*s;this.viewGL.rootNode.scale.set(this.getScale()*s,this.getScale()*s,f)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(e,t){return this.projectOnTileWithScale(e,this.getScale()*r,t)},projectOnTileWithScale:function(e,t,i){var n=e[0],r=e[1]*o/180,a=t*(n*o/180+o)/(2*o),s=t*(o-Math.log(Math.tan(o/4+.5*r)))/(2*o);return(i=i||[])[0]=a,i[1]=s,i},unprojectFromTile:function(e,t){return this.unprojectOnTileWithScale(e,this.getScale()*r,t)},unprojectOnTileWithScale:function(e,t,i){var n=e[0],r=e[1],a=n/t*(2*o)-o,s=2*(Math.atan(Math.exp(o-r/t*(2*o)))-o/4);return(i=i||[])[0]=180*a/o,i[1]=180*s/o,i},dataToPoint:function(e,t){return(t=this.projectOnTileWithScale(e,r,t))[0]-=this._origin[0],t[1]-=this._origin[1],t[2]=isNaN(e[2])?0:e[2],isNaN(e[2])||(t[2]=e[2],this.altitudeExtent&&(t[2]-=this.altitudeExtent[0])),t}},t.a=l},function(e,t,i){var n=i(2),r=i(1),a=i(22);t.a=function(e,t,i){function o(e,t){var i=t.getWidth(),n=t.getHeight(),r=t.getDevicePixelRatio();this.viewGL.setViewport(0,0,i,n,r),this.width=i,this.height=n,this.altitudeScale=e.get("altitudeScale"),this.boxHeight=e.get("boxHeight")}function s(e,t){if("auto"!==this.model.get("boxHeight")){var i=[1/0,-1/0];e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),n=e.coordDimToDataDim("alt")[0];if(n){var r=t.getDataExtent(n,!0);i[0]=Math.min(i[0],r[0]),i[1]=Math.max(i[1],r[1])}}}),this),i&&isFinite(i[1]-i[0])&&(this.altitudeExtent=i)}}return{dimensions:t.prototype.dimensions,create:function(l,u){var h=[];return l.eachComponent(e,(function(e){var i=e.__viewGL;i||(i=e.__viewGL=new a.a).setRootNode(new r.a.Node);var n=new t;n.viewGL=e.__viewGL,n.resize=o,n.resize(e,u),h.push(n),e.coordinateSystem=n,n.model=e,n.update=s})),l.eachSeries((function(t){if(t.get("coordinateSystem")===e){var i=t.getReferringComponents(e)[0];if(i||(i=l.getComponent(e)),!i)throw new Error(e+' "'+n.a.firstNotNull(t.get(e+"Index"),t.get(e+"Id"),0)+'" not found');t.coordinateSystem=i.coordinateSystem}})),i&&i(h,l,u),h}}}},function(e,t,i){t.a="\n@export ecgl.displayShadow.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_WorldPosition;\n\nvarying vec3 v_Normal;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n\n@end\n\n\n@export ecgl.displayShadow.fragment\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform float roughness: 0.2;\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.ssaoMap.header\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n float shadow = 1.0;\n\n @import ecgl.common.ssaoMap.main\n\n#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {\n shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);\n }\n#endif\n\n shadow *= 0.5 + ao * 0.5;\n shadow = clamp(shadow, 0.0, 1.0);\n\n gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);\n}\n\n@end"},function(e,t,i){var n=i(84),r=i.n(n),a=i(83),o=i.n(a);function s(e){this.viewGL=e}s.prototype.reset=function(e,t){this._updateCamera(t.getWidth(),t.getHeight(),t.getDevicePixelRatio()),this._viewTransform=r.a.create(),this.updateTransform(e,t)},s.prototype.updateTransform=function(e,t){var i=e.coordinateSystem;i.getRoamTransform&&(r.a.invert(this._viewTransform,i.getRoamTransform()),this._setCameraTransform(this._viewTransform),t.getZr().refresh())},s.prototype.dataToPoint=function(e,t,i){i=e.dataToPoint(t,null,i);var n=this._viewTransform;n&&o.a.applyTransform(i,i,n)},s.prototype.removeTransformInPoint=function(e){return this._viewTransform&&o.a.applyTransform(e,e,this._viewTransform),e},s.prototype.getZoom=function(){if(this._viewTransform){var e=this._viewTransform;return 1/Math.max(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]))}return 1},s.prototype._setCameraTransform=function(e){var t=this.viewGL.camera;t.position.set(e[4],e[5],0),t.scale.set(Math.sqrt(e[0]*e[0]+e[1]*e[1]),Math.sqrt(e[2]*e[2]+e[3]*e[3]),1)},s.prototype._updateCamera=function(e,t,i){this.viewGL.setViewport(0,0,e,t,i);var n=this.viewGL.camera;n.left=n.top=0,n.bottom=t,n.right=e,n.near=0,n.far=100},t.a=s},function(e,t,i){(function(e){var i;"undefined"!=typeof window?i=window.__DEV__:void 0!==e&&(i=e.__DEV__),void 0===i&&(i=!0);var n=i;t.__DEV__=n}).call(t,i(68))},function(e,t,i){var n,r,a,o,s,l,u,h=i(15),c=i(0),d=i.n(c),f=i(38),p=i(6).a.vec2,g=[[0,0],[1,1]],m=h.a.extend((function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new h.a.Attribute("position","float",2,"POSITION"),normal:new h.a.Attribute("normal","float",2),offset:new h.a.Attribute("offset","float",1),color:new h.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.offset.init(e),t.normal.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(this.indices=0===e?null:this.vertexCount>65535?new Uint32Array(3*e):new Uint16Array(3*e))},_getCubicCurveApproxStep:function(e,t,i,n){return 1/(p.dist(e,t)+p.dist(i,t)+p.dist(n,i)+1)*this.segmentScale},getCubicCurveVertexCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(e,t,i,n){var r=this._getCubicCurveApproxStep(e,t,i,n),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(g)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(g)},getPolylineVertexCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/2,this.useNativeLine?2*(t-1):2*(t-1)+2},getPolylineTriangleCount:function(e){var t;return t="number"==typeof e?e:"number"!=typeof e[0]?e.length:e.length/2,this.useNativeLine?0:2*(t-1)},addCubicCurve:function(e,t,i,n,r,a){null==a&&(a=1);var o=e[0],s=e[1],l=t[0],u=t[1],h=i[0],c=i[1],d=n[0],f=n[1],p=this._getCubicCurveApproxStep(e,t,i,n),g=p*p,m=g*p,v=3*p,y=3*g,_=6*g,x=6*m,b=o-2*l+h,w=s-2*u+c,T=3*(l-h)-o+d,S=3*(u-c)-s+f,M=o,A=s,I=(l-o)*v+b*y+T*m,C=(u-s)*v+w*y+S*m,D=b*_+T*x,E=w*_+S*x,L=T*x,P=S*x,N=0,R=0,O=Math.ceil(1/p),k=new Float32Array(3*(O+1)),z=(k=[],0);for(R=0;R<O+1;R++)k[z++]=M,k[z++]=A,M+=I,A+=C,I+=D,C+=E,D+=L,E+=P,(N+=p)>1&&(M=I>0?Math.min(M,d):Math.max(M,d),A=C>0?Math.min(A,f):Math.max(A,f));this.addPolyline(k,r,a)},addLine:function(e,t,i,n){this.addPolyline([e,t],i,n)},addPolyline:(n=p.create(),r=p.create(),a=p.create(),o=p.create(),s=[],l=[],u=[],function(e,t,i,h,c){if(e.length){var d="number"!=typeof e[0];if(null==c&&(c=d?e.length:e.length/2),!(c<2)){null==h&&(h=0),null==i&&(i=1),this._itemVertexOffsets.push(this._vertexOffset);for(var f,g=d?"number"!=typeof t[0]:t.length/4===c,m=this.attributes.position,v=this.attributes.color,y=this.attributes.offset,_=this.attributes.normal,x=this.indices,b=this._vertexOffset,w=0;w<c;w++){if(d)s=e[w+h],f=g?t[w+h]:t;else{var T=2*w+h;if((s=s||[])[0]=e[T],s[1]=e[T+1],g){var S=4*w+h;(f=f||[])[0]=t[S],f[1]=t[S+1],f[2]=t[S+2],f[3]=t[S+3]}else f=t}if(this.useNativeLine)w>1&&(m.copy(b,b-1),v.copy(b,b-1),b++);else{var M;if(w<c-1)if(d?p.copy(l,e[w+1]):(T=2*(w+1)+h,(l=l||[])[0]=e[T],l[1]=e[T+1]),w>0){p.sub(n,s,u),p.sub(r,l,s),p.normalize(n,n),p.normalize(r,r),p.add(o,n,r),p.normalize(o,o);var A=i/2*Math.min(1/p.dot(n,o),2);a[0]=-o[1],a[1]=o[0],M=A}else p.sub(n,l,s),p.normalize(n,n),a[0]=-n[1],a[1]=n[0],M=i/2;else p.sub(n,s,u),p.normalize(n,n),a[0]=-n[1],a[1]=n[0],M=i/2;_.set(b,a),_.set(b+1,a),y.set(b,M),y.set(b+1,-M),p.copy(u,s),m.set(b,s),m.set(b+1,s),v.set(b,f),v.set(b+1,f),b+=2}if(this.useNativeLine)v.set(b,f),m.set(b,s),b++;else if(w>0){var I=3*this._faceOffset;(x=this.indices)[I]=b-4,x[I+1]=b-3,x[I+2]=b-2,x[I+3]=b-3,x[I+4]=b-1,x[I+5]=b-2,this._faceOffset+=2}}this._vertexOffset=b}}}),setItemColor:function(e,t){for(var i=this._itemVertexOffsets[e],n=e<this._itemVertexOffsets.length-1?this._itemVertexOffsets[e+1]:this._vertexOffset,r=i;r<n;r++)this.attributes.color.set(r,t);this.dirty("color")}});d.a.util.defaults(m.prototype,f.a),t.a=m},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),i(107),i(154),i(201),i(207),i(213),i(219),i(225),i(232),i(236),i(243),i(249),i(252),i(256),i(259),i(262),i(275),i(281)},function(e,t,i){var n=i(0),r=i.n(n),a=i(108),o=i(109),s=i(153),l=i(1),u={echarts:"4.1.0",claygl:"1.2.1"};function h(e,t){e.replace(".","")-0<u[t].replace(".","")-0&&function(e){throw new Error(e+" version is too old, needs "+u[e]+" or higher")}(t),console.log("Loaded "+t+", version "+e)}function c(e){this._layers={},this._zr=e}h(a.a,"claygl"),h(r.a.version,"echarts"),c.prototype.update=function(e,t){var i=this,n=t.getZr();if(n.getWidth()&&n.getHeight()){for(var a in this._layers)this._layers[a].removeViewsAll();e.eachComponent((function(i,n){if("series"!==i){var r=t.getViewOfComponentModel(n),a=n.coordinateSystem;if(r.__ecgl__){if(a){if(!a.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+n.id);o=a.viewGL}else{if(!n.viewGL)return void console.error("Can't find viewGL of component "+n.id);o=a.viewGL}var o=a.viewGL,u=s(n);u.addView(o),r.afterRender&&r.afterRender(n,e,t,u),l(r.groupGL,n.get("silent"))}}})),e.eachSeries((function(i){var n=t.getViewOfSeriesModel(i),r=i.coordinateSystem;if(n.__ecgl__){if(r&&!r.viewGL&&!n.viewGL)return void console.error("Can't find viewGL of series "+n.id);var a=r&&r.viewGL||n.viewGL,o=s(i);o.addView(a),n.afterRender&&n.afterRender(i,e,t,o),l(n.groupGL,i.get("silent"))}}))}else console.warn("Dom has no width or height");function s(e){var t;e.coordinateSystem&&e.coordinateSystem.model,t=e.get("zlevel");var a=i._layers,s=a[t];if(!s){if(s=a[t]=new o.a("gl-"+t,n),n.painter.isSingleCanvas()){s.virtual=!0;var l=new r.a.graphic.Image({z:1e4,style:{image:s.renderer.canvas},silent:!0});s.__hostImage=l,n.add(l)}n.painter.insertLayer(t,s)}return s.__hostImage&&s.__hostImage.setStyle({width:s.renderer.getWidth(),height:s.renderer.getHeight()}),s}function l(e,t){e&&e.traverse((function(e){e.isRenderable&&e.isRenderable()&&(e.ignorePicking=null!=e.$ignorePicking?e.$ignorePicking:t)}))}};var d=r.a.init;r.a.init=function(){var e=d.apply(this,arguments);return e.getZr().painter.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas)return this._layers[0].dom;var t=document.createElement("canvas"),i=e.pixelRatio||this.dpr;t.width=this.getWidth()*i,t.height=this.getHeight()*i;var n=t.getContext("2d");n.dpr=i,n.clearRect(0,0,t.width,t.height),e.backgroundColor&&(n.fillStyle=e.backgroundColor,n.fillRect(0,0,t.width,t.height));var r,a=this.storage.getDisplayList(!0),o={},s=this;function l(e,t){var i,r=s._zlevelList;null==e&&(e=-1/0);for(var a=0;a<r.length;a++){var o=r[a],l=s._layers[o];if(!l.__builtin__&&o>e&&o<t){i=l;break}}i&&i.renderToCanvas&&(n.save(),i.renderToCanvas(n),n.restore())}for(var u={ctx:n},h=0;h<a.length;h++){var c=a[h];c.zlevel!==r&&(l(r,c.zlevel),r=c.zlevel),this._doPaintEl(c,u,!0,o)}return l(r,1/0),t},e},r.a.registerPostUpdate((function(e,t){var i=t.getZr();(i.__egl=i.__egl||new c(i)).update(e,t)})),r.a.registerPreprocessor(s.a),r.a.graphicGL=l.a},function(e,t,i){t.a="1.2.1"},function(e,t,i){var n=i(0),r=i.n(n),a=i(52),o=i(117),s=i(4),l=i(1),u=i(53),h=i(80),c=i.n(h),d=function(e,t){this.id=e,this.zr=t;try{this.renderer=new a.a({clearBit:0,devicePixelRatio:t.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(t.painter.getWidth(),t.painter.getHeight())}catch(n8){return this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does not support WebGL",void console.error(n8)}this.onglobalout=this.onglobalout.bind(this),t.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var i=this.dom.style;i.position="absolute",i.left="0",i.top="0",this.views=[],this._picking=new o.a({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new r.a.graphic.Rect({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null};function f(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}d.prototype.addView=function(e){if(e.layer!==this){var t=this._viewsToDispose.indexOf(e);t>=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var i=this.zr;e.scene.traverse((function(e){e.__zr=i,e.addAnimatorsToZr&&e.addAnimatorsToZr(i)}))}},d.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(f,this),e.layer=null,this._viewsToDispose.push(e))}},d.prototype.removeViewsAll=function(){this.views.forEach((function(e){e.scene.traverse(f,this),e.layer=null,this._viewsToDispose.push(e)}),this),this.views.length=0},d.prototype.resize=function(e,t){this.renderer.resize(e,t)},d.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)},d.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)},d.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},d.prototype.needsRefresh=function(){this.zr.refresh()},d.prototype.refresh=function(e){this._backgroundColor=e?l.a.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t<this.views.length;t++)this.views[t].prepareRender(this.renderer);for(this._doRender(!1),this._trackAndClean(),t=0;t<this._viewsToDispose.length;t++)this._viewsToDispose[t].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},d.prototype.renderToCanvas=function(e){this._startAccumulating(!0),e.drawImage(this.dom,0,0,e.canvas.width,e.canvas.height)},d.prototype._doRender=function(e){this.clear(),this.renderer.saveViewport();for(var t=0;t<this.views.length;t++)this.views[t].render(this.renderer,e);this.renderer.restoreViewport()},d.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var p=1;function g(e){for(var t=0;t<e.length;t++)e[t].__used__=0}function m(e,t){for(var i=0;i<t.length;i++)t[i].__used__||t[i].dispose(e)}function v(e,t){e.__used__=e.__used__||0,e.__used__++,1===e.__used__&&t.push(e)}function y(e,t,i){var n,r;e.traverse((function(e){if(e.isRenderable()){var a=e.geometry,o=e.material;if(o!==n)for(var l=o.getTextureUniforms(),u=0;u<l.length;u++){var h=l[u],c=o.uniforms[h].value;if(c)if(c instanceof s.a)v(c,t);else if(c instanceof Array)for(var d=0;d<c.length;d++)c[d]instanceof s.a&&v(c[d],t)}a!==r&&v(a,i),n=o,r=a}}));for(var a=0;a<e.lights.length;a++)e.lights[a].cubemap&&v(e.lights[a].cubemap,t)}d.prototype._startAccumulating=function(e){var t=this;this._stopAccumulating();for(var i=!1,n=0;n<this.views.length;n++)i=this.views[n].needsAccumulate()||i;function r(n){if(t._accumulatingId&&n===t._accumulatingId){for(var a=!0,o=0;o<t.views.length;o++)a=t.views[o].isAccumulateFinished()&&i;a||(t._doRender(!0),e?r(n):c()((function(){r(n)})))}}i&&(this._accumulatingId=p++,e?r(t._accumulatingId):this._accumulatingTimeout=setTimeout((function(){r(t._accumulatingId)}),50))},d.prototype._trackAndClean=function(){var e=[],t=[];this._textureList&&(g(this._textureList),g(this._geometriesList));for(var i=0;i<this.views.length;i++)y(this.views[i].scene,e,t);this._textureList&&(m(this.renderer,this._textureList),m(this.renderer,this._geometriesList)),this._textureList=e,this._geometriesList=t},d.prototype.dispose=function(){this._stopAccumulating(),this.renderer.disposeScene(this.scene),this.zr.off("globalout",this.onglobalout)},d.prototype.onmousedown=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mousedown",e,t),this._dispatchDataEvent("mousedown",e,t)),this._downX=e.offsetX,this._downY=e.offsetY}},d.prototype.onmousemove=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY),i=t&&t.target,n=this._hovered;this._hovered=t,n&&i!==n.target&&(n.relatedTarget=i,this._dispatchEvent("mouseout",e,n),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",e,t),t&&(this.zr.setCursorStyle("pointer"),n&&i===n.target||this._dispatchEvent("mouseover",e,t)),this._dispatchDataEvent("mousemove",e,t)}},d.prototype.onmouseup=function(e){if(!e.target||!e.target.__isGLToZRProxy){e=e.event;var t=this.pickObject(e.offsetX,e.offsetY);t&&(this._dispatchEvent("mouseup",e,t),this._dispatchDataEvent("mouseup",e,t)),this._upX=e.offsetX,this._upY=e.offsetY}},d.prototype.onclick=d.prototype.dblclick=function(e){if(!e.target||!e.target.__isGLToZRProxy){var t=this._upX-this._downX,i=this._upY-this._downY;if(!(Math.sqrt(t*t+i*i)>20)){e=e.event;var n=this.pickObject(e.offsetX,e.offsetY);n&&(this._dispatchEvent(e.type,e,n),this._dispatchDataEvent(e.type,e,n));var r=this._clickToSetFocusPoint(e);r&&r.view.setDOFFocusOnPoint(r.distance)&&this.zr.refresh()}}},d.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,i=t.viewport,n=this.views.length-1;n>=0;n--){var r=this.views[n];if(r.hasDOF()&&r.containPoint(e.offsetX,e.offsetY)){this._picking.scene=r.scene,this._picking.camera=r.camera,t.viewport=r.viewport;var a=this._picking.pick(e.offsetX,e.offsetY,!0);if(a)return a.view=r,a}}t.viewport=i},d.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})},d.prototype.pickObject=function(e,t){for(var i=[],n=this.renderer,r=n.viewport,a=0;a<this.views.length;a++){var o=this.views[a];o.containPoint(e,t)&&(this._picking.scene=o.scene,this._picking.camera=o.camera,n.viewport=o.viewport,this._picking.pickAll(e,t,i))}return n.viewport=r,i.sort((function(e,t){return e.distance-t.distance})),i[0]},d.prototype._dispatchEvent=function(e,t,i){i||(i={});var n=i.target;for(i.cancelBubble=!1,i.event=t,i.type=e,i.offsetX=t.offsetX,i.offsetY=t.offsetY;n&&(n.trigger(e,i),n=n.getParent(),!i.cancelBubble););this._dispatchToView(e,i)},d.prototype._dispatchDataEvent=function(e,t,i){var n=i&&i.target,r=n&&n.dataIndex,a=n&&n.seriesIndex,o=n&&n.eventData,s=!1,l=this._zrEventProxy;l.position=[t.offsetX,t.offsetY],l.update();var u={target:l};"mousemove"===e&&(null!=r?r!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(l.dataIndex=this._lastDataIndex,l.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0):null!=o&&o!==this._lastEventData&&(null!=this._lastEventData&&(l.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),s=!0),this._lastEventData=o,this._lastDataIndex=r,this._lastSeriesIndex=a),l.eventData=o,l.dataIndex=r,l.seriesIndex=a,(null!=o||parseInt(r,10)>=0&&parseInt(a,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),s&&this.zr.handler.dispatchToElement(u,"mouseover",t))},d.prototype._dispatchToView=function(e,t){for(var i=0;i<this.views.length;i++)this.views[i].containPoint(t.offsetX,t.offsetY)&&this.views[i].trigger(e,t)},r.a.util.extend(d.prototype,u.a),t.a=d},function(e,t,i){function n(e,t,i){"object"==typeof t&&(i=t,t=null);var n,o=this;if(!(e instanceof Function))for(var s in n=[],e)e.hasOwnProperty(s)&&n.push(s);var l=function(t){if(o.apply(this,arguments),e instanceof Function?r(this,e.call(this,t)):a(this,e,n),this.constructor===l)for(var i=l.__initializers__,s=0;s<i.length;s++)i[s].apply(this,arguments)};l.__super__=o,o.__initializers__?l.__initializers__=o.__initializers__.slice():l.__initializers__=[],t&&l.__initializers__.push(t);var u=function(){};return u.prototype=o.prototype,l.prototype=new u,l.prototype.constructor=l,r(l.prototype,i),l.extend=o.extend,l.derive=o.extend,l}function r(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}function a(e,t,i){for(var n=0;n<i.length;n++){var r=i[n];e[r]=t[r]}}t.a={extend:n,derive:n}},function(e,t,i){var n=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB"],r=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];t.a=function(e){for(var t={},i={},a=0;a<n.length;a++)s(n[a]);for(a=0;a<r.length;a++){var o=r[a];i[o]=e.getParameter(e[o])}function s(i){var n=e.getExtension(i);n||(n=e.getExtension("MOZ_"+i)),n||(n=e.getExtension("WEBKIT_"+i)),t[i]=n}this.getExtension=function(e){return e in t||s(e),t[e]},this.getParameter=function(e){return i[e]},this.getMaxJointNumber=function(){return 15}}},function(e,t,i){t.a={get:function(e){var t=new XMLHttpRequest;t.open("get",e.url),t.responseType=e.responseType||"text",e.onprogress&&(t.onprogress=function(t){if(t.lengthComputable){var i=t.loaded/t.total;e.onprogress(i,t.loaded,t.total)}else e.onprogress(null)}),t.onload=function(i){t.status>=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}}},function(e,t,i){var n=i(69),r={},a={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function o(e){return(e=Math.round(e))<0?0:e>255?255:e}function s(e){return e<0?0:e>1?1:e}function l(e){return e.length&&"%"===e.charAt(e.length-1)?o(parseFloat(e)/100*255):o(parseInt(e,10))}function u(e){return e.length&&"%"===e.charAt(e.length-1)?s(parseFloat(e)/100):s(parseFloat(e))}function h(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function c(e,t,i){return e+(t-e)*i}function d(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}function f(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var p=new n.a(20),g=null;function m(e,t){g&&f(g,t),g=p.put(e,g||t.slice())}function v(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=u(e[1]),r=u(e[2]),a=r<=.5?r*(n+1):r+n-r*n,s=2*r-a;return d(t=t||[],o(255*h(s,a,i+1/3)),o(255*h(s,a,i)),o(255*h(s,a,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}r.parse=function(e,t){if(e){t=t||[];var i=p.get(e);if(i)return f(t,i);var n,r=(e+="").replace(/ /g,"").toLowerCase();if(r in a)return f(t,a[r]),m(e,t),t;if("#"===r.charAt(0))return 4===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=4095?(d(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),m(e,t),t):void d(t,0,0,0,1):7===r.length?(n=parseInt(r.substr(1),16))>=0&&n<=16777215?(d(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),m(e,t),t):void d(t,0,0,0,1):void 0;var o=r.indexOf("("),s=r.indexOf(")");if(-1!==o&&s+1===r.length){var h=r.substr(0,o),c=r.substr(o+1,s-(o+1)).split(","),g=1;switch(h){case"rgba":if(4!==c.length)return void d(t,0,0,0,1);g=u(c.pop());case"rgb":return 3!==c.length?void d(t,0,0,0,1):(d(t,l(c[0]),l(c[1]),l(c[2]),g),m(e,t),t);case"hsla":return 4!==c.length?void d(t,0,0,0,1):(c[3]=u(c[3]),v(c,t),m(e,t),t);case"hsl":return 3!==c.length?void d(t,0,0,0,1):(v(c,t),m(e,t),t);default:return}}d(t,0,0,0,1)}},r.parseToFloat=function(e,t){if(t=r.parse(e,t))return t[0]/=255,t[1]/=255,t[2]/=255,t},r.lift=function(e,t){var i=r.parse(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0;return r.stringify(i,4===i.length?"rgba":"rgb")}},r.toHex=function(e){var t=r.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},r.fastLerp=function(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),a=Math.ceil(n),l=t[r],u=t[a],h=n-r;return i[0]=o(c(l[0],u[0],h)),i[1]=o(c(l[1],u[1],h)),i[2]=o(c(l[2],u[2],h)),i[3]=s(c(l[3],u[3],h)),i}},r.fastMapToColor=r.fastLerp,r.lerp=function(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),a=Math.floor(n),l=Math.ceil(n),u=r.parse(t[a]),h=r.parse(t[l]),d=n-a,f=r.stringify([o(c(u[0],h[0],d)),o(c(u[1],h[1],d)),o(c(u[2],h[2],d)),s(c(u[3],h[3],d))],"rgba");return i?{color:f,leftIndex:a,rightIndex:l,value:n}:f}},r.mapToColor=r.lerp,r.modifyHSL=function(e,t,i,n){if(e=r.parse(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=u(i)),null!=n&&(e[2]=u(n)),r.stringify(v(e),"rgba")},r.modifyAlpha=function(e,t){if((e=r.parse(e))&&null!=t)return e[3]=s(t),r.stringify(e,"rgba")},r.stringify=function(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}},t.a=r},function(e,t,i){var n=function(){this.head=null,this.tail=null,this._length=0};n.prototype.insert=function(e){var t=new n.Entry(e);return this.insertEntry(t),t},n.prototype.insertAt=function(e,t){if(!(e<0)){for(var i=this.head,r=0;i&&r!=e;)i=i.next,r++;if(i){var a=new n.Entry(t),o=i.prev;o?(o.next=a,a.prev=o):this.head=a,a.next=i,i.prev=a}else this.insert(t)}},n.prototype.insertBeforeEntry=function(e,t){var i=new n.Entry(e),r=t.prev;r?(r.next=i,i.prev=r):this.head=i,i.next=t,t.prev=i,this._length++},n.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++},n.prototype.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._length--},n.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,i=0;t&&i!=e;)t=t.next,i++;return t?(this.remove(t),t.value):void 0}},n.prototype.getHead=function(){if(this.head)return this.head.value},n.prototype.getTail=function(){if(this.tail)return this.tail.value},n.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,i=0;t&&i!=e;)t=t.next,i++;return t.value}},n.prototype.indexOf=function(e){for(var t=this.head,i=0;t;){if(t.value===e)return i;t=t.next,i++}},n.prototype.length=function(){return this._length},n.prototype.isEmpty=function(){return 0===this._length},n.prototype.forEach=function(e,t){for(var i=this.head,n=0,r=void 0!==t;i;)r?e.call(t,i.value,n):e(i.value,n),i=i.next,n++},n.prototype.clear=function(){this.tail=this.head=null,this._length=0},n.Entry=function(e){this.value=e,this.next=null,this.prev=null},t.a=n},function(e,t,i){var n=i(116),r=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function a(e,t,i){var n={};for(var a in i)n[a+"_COUNT"]=i[a];return e.replace(r,(function(e,i,r,a){var o="";isNaN(i)&&(i=i in t?t[i]:n[i]),isNaN(r)&&(r=r in t?t[r]:n[r]);for(var s=parseInt(i);s<parseInt(r);s++)o+="{"+a.replace(/float\s*\(\s*_idx_\s*\)/g,s.toFixed(1)).replace(/_idx_/g,s)+"}";return o}))}function o(e,t,i){var n=[];if(t)for(var r in t){var a=t[r];a>0&&n.push("#define "+r.toUpperCase()+"_COUNT "+a)}if(i)for(var o=0;o<i.length;o++){var s=i[o];n.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in e){var l=e[s];null===l?n.push("#define "+s):n.push("#define "+s+" "+l.toString())}return n.join("\n")}function s(e){this._renderer=e,this._cache={}}s.prototype.getProgram=function(e,t,i){var r=this._cache,s=e.isSkinnedMesh&&e.isSkinnedMesh(),l="s"+t.shader.shaderID+"m"+t.getProgramKey();if(i&&(l+="se"+i.getProgramKey(e.lightGroup)),s&&(l+=","+e.joints.length),x=r[l])return x;var u=i?i.getLightsNumbers(e.lightGroup):{},h=this._renderer,c=h.gl,d=t.getEnabledTextures(),f="";if(s){var p={SKINNING:null,JOINT_COUNT:e.joints.length};e.joints.length>h.getMaxJointNumber()&&(p.USE_SKIN_MATRICES_TEXTURE=null),f="\n"+o(p)+"\n"}var g=f+o(t.vertexDefines,u,d),m=f+o(t.fragmentDefines,u,d),v=g+"\n"+t.shader.vertex,y=["OES_standard_derivatives","EXT_shader_texture_lod"].filter((function(e){return null!=h.getGLExtension(e)}));y.indexOf("EXT_shader_texture_lod")>=0&&(m+="\n#define SUPPORT_TEXTURE_LOD"),y.indexOf("OES_standard_derivatives")>=0&&(m+="\n#define SUPPORT_STANDARD_DERIVATIVES");var _,x,b=function(e){for(var t=[],i=0;i<e.length;i++)t.push("#extension GL_"+e[i]+" : enable");return t.join("\n")}(y)+"\n"+["precision",_=t.precision,"float"].join(" ")+";\n"+["precision",_,"int"].join(" ")+";\n"+["precision",_,"sampler2D"].join(" ")+";\n\n"+m+"\n"+t.shader.fragment,w=a(v,t.vertexDefines,u),T=a(b,t.fragmentDefines,u);(x=new n.a).uniformSemantics=t.shader.uniformSemantics,x.attributes=t.shader.attributes;var S=x.buildProgram(c,t.shader,w,T);return x.__error=S,r[l]=x,x},t.a=s},function(e,t,i){var n=i(14),r=i(7),a={};function o(e){for(var t=e.split("\n"),i=0,n=t.length;i<n;i++)t[i]=i+1+": "+t[i];return t.join("\n")}function s(e,t,i){if(!e.getShaderParameter(t,e.COMPILE_STATUS))return[e.getShaderInfoLog(t),o(i)].join("\n")}var l=new n.a.Float32Array(16),u=r.a.extend({uniformSemantics:{},attributes:{}},(function(){this._locations={},this._textureSlot=0,this._program=null}),{bind:function(e){this._textureSlot=0,e.gl.useProgram(this._program)},hasUniform:function(e){var t=this._locations[e];return null!=t},useTextureSlot:function(e,t,i){t&&(e.gl.activeTexture(e.gl.TEXTURE0+i),t.isRenderable()?t.bind(e):t.unbind(e))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(e){this._textureSlot=e||0},takeCurrentTextureSlot:function(e,t){var i=this._textureSlot;return this.useTextureSlot(e,t,i),this._textureSlot++,i},setUniform:function(e,t,i,r){var a=this._locations[i];if(null==a)return!1;switch(t){case"m4":if(!(r instanceof Float32Array)){for(var o=0;o<r.length;o++)l[o]=r[o];r=l}e.uniformMatrix4fv(a,!1,r);break;case"2i":e.uniform2i(a,r[0],r[1]);break;case"2f":e.uniform2f(a,r[0],r[1]);break;case"3i":e.uniform3i(a,r[0],r[1],r[2]);break;case"3f":e.uniform3f(a,r[0],r[1],r[2]);break;case"4i":e.uniform4i(a,r[0],r[1],r[2],r[3]);break;case"4f":e.uniform4f(a,r[0],r[1],r[2],r[3]);break;case"1i":e.uniform1i(a,r);break;case"1f":e.uniform1f(a,r);break;case"1fv":e.uniform1fv(a,r);break;case"1iv":e.uniform1iv(a,r);break;case"2iv":e.uniform2iv(a,r);break;case"2fv":e.uniform2fv(a,r);break;case"3iv":e.uniform3iv(a,r);break;case"3fv":e.uniform3fv(a,r);break;case"4iv":e.uniform4iv(a,r);break;case"4fv":e.uniform4fv(a,r);break;case"m2":case"m2v":e.uniformMatrix2fv(a,!1,r);break;case"m3":case"m3v":e.uniformMatrix3fv(a,!1,r);break;case"m4v":if(Array.isArray(r)&&Array.isArray(r[0])){var s=new n.a.Float32Array(16*r.length),u=0;for(o=0;o<r.length;o++)for(var h=r[o],c=0;c<16;c++)s[u++]=h[c];e.uniformMatrix4fv(a,!1,s)}else e.uniformMatrix4fv(a,!1,r)}return!0},setUniformOfSemantic:function(e,t,i){var n=this.uniformSemantics[t];return!!n&&this.setUniform(e,n.type,n.symbol,i)},enableAttributes:function(e,t,i){var n,r=e.gl,o=this._program,s=this._locations;(n=i?i.__enabledAttributeList:a[e.__uid__])||(n=i?i.__enabledAttributeList=[]:a[e.__uid__]=[]);for(var l=[],u=0;u<t.length;u++){var h=t[u];if(this.attributes[h]){var c=s[h];if(null==c){if(-1===(c=r.getAttribLocation(o,h))){l[u]=-1;continue}s[h]=c}l[u]=c,n[c]?n[c]=2:n[c]=1}else l[u]=-1}for(u=0;u<n.length;u++)switch(n[u]){case 1:r.enableVertexAttribArray(u),n[u]=3;break;case 2:n[u]=3;break;case 3:r.disableVertexAttribArray(u),n[u]=0}return l},buildProgram:function(e,t,i,n){var r=e.createShader(e.VERTEX_SHADER),a=e.createProgram();e.shaderSource(r,i),e.compileShader(r);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,n),e.compileShader(o);var l=s(e,r,i);if(l)return l;if(l=s(e,o,n))return l;if(e.attachShader(a,r),e.attachShader(a,o),t.attributeSemantics.POSITION)e.bindAttribLocation(a,0,t.attributeSemantics.POSITION.symbol);else{var u=Object.keys(this.attributes);e.bindAttribLocation(a,0,u[0])}if(e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))return"Could not link program\n"+e.getProgramInfoLog(a);for(var h=0;h<t.uniforms.length;h++){var c=t.uniforms[h];this._locations[c]=e.getUniformLocation(a,c)}e.deleteShader(r),e.deleteShader(o),this._program=a,this.vertexCode=i,this.fragmentCode=n}});t.a=u},function(e,t,i){var n,r,a,o,s,l=i(7),u=i(54),h=i(26),c=i(3),d=i(9),f=i(72),p=i(11),g=i(12),m=l.a.extend({scene:null,camera:null,renderer:null},(function(){this._ray=new u.a,this._ndc=new h.a}),{pick:function(e,t,i){return this.pickAll(e,t,[],i)[0]||null},pickAll:function(e,t,i,n){return this.renderer.screenToNDC(e,t,this._ndc),this.camera.castRay(this._ndc,this._ray),i=i||[],this._intersectNode(this.scene,i,n||!1),i.sort(this._intersectionCompareFunc),i},_intersectNode:function(e,t,i){e instanceof f.a&&e.isRenderable()&&(e.ignorePicking&&!i||!(e.mode===p.a.TRIANGLES&&e.geometry.isUseIndices()||e.geometry.pickByRay||e.geometry.pick)||this._intersectRenderable(e,t));for(var n=0;n<e._children.length;n++)this._intersectNode(e._children[n],t,i)},_intersectRenderable:(n=new c.a,r=new c.a,a=new c.a,o=new u.a,s=new d.a,function(e,t){var i=e.isSkinnedMesh();o.copy(this._ray),d.a.invert(s,e.worldTransform),i||o.applyTransform(s);var l=e.geometry,u=i?e.skeleton.boundingBox:l.boundingBox;if(!u||o.intersectBoundingBox(u))if(l.pick)l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,e,t);else if(l.pickByRay)l.pickByRay(o,e,t);else{var h,f,v=e.cullFace===p.a.BACK&&e.frontFace===p.a.CCW||e.cullFace===p.a.FRONT&&e.frontFace===p.a.CW,y=l.indices,_=l.attributes.position,x=l.attributes.weight,b=l.attributes.joint,w=[];if(_&&_.value&&y){if(i){f=e.skeleton.getSubSkinMatrices(e.__uid__,e.joints);for(var T=0;T<e.joints.length;T++){w[T]=w[T]||[];for(var S=0;S<16;S++)w[T][S]=f[16*T+S]}var M=[],A=[],I=[],C=[],D=[],E=l.attributes.skinnedPosition;for(E&&E.value||(l.createAttribute("skinnedPosition","f",3),(E=l.attributes.skinnedPosition).init(l.vertexCount)),T=0;T<l.vertexCount;T++){for(_.get(T,M),x.get(T,A),b.get(T,I),A[3]=1-A[0]-A[1]-A[2],g.a.set(C,0,0,0),S=0;S<4;S++)I[S]>=0&&A[S]>1e-4&&(g.a.transformMat4(D,M,w[I[S]]),g.a.scaleAndAdd(C,C,D,A[S]));E.set(T,C)}}for(T=0;T<y.length;T+=3){var L=y[T],P=y[T+1],N=y[T+2],R=i?l.attributes.skinnedPosition:_;if(R.get(L,n.array),R.get(P,r.array),R.get(N,a.array),h=v?o.intersectTriangle(n,r,a,e.culling):o.intersectTriangle(n,a,r,e.culling)){var O=new c.a;i?c.a.copy(O,h):c.a.transformMat4(O,h,e.worldTransform),t.push(new m.Intersection(h,O,e,[L,P,N],T/3,c.a.dist(O,this._ray.origin)))}}}}}),_intersectionCompareFunc:function(e,t){return e.distance-t.distance}});m.Intersection=function(e,t,i,n,r,a){this.point=e,this.pointWorld=t,this.target=i,this.triangle=n,this.triangleIndex=r,this.distance=a},t.a=m},function(e,t,i){var n=i(7),r=i(11),a=i(57),o=i(14);function s(e){return{byte:o.a.Int8Array,ubyte:o.a.Uint8Array,short:o.a.Int16Array,ushort:o.a.Uint16Array}[e]||o.a.Float32Array}function l(e){return"attr_"+e}function u(e,t,i,n){switch(this.name=e,this.type=t,this.size=i,this.semantic=n||"",this.value=null,i){case 1:this.get=function(e){return this.value[e]},this.set=function(e,t){this.value[e]=t},this.copy=function(e,t){this.value[e]=this.value[e]};break;case 2:this.get=function(e,t){var i=this.value;return t[0]=i[2*e],t[1]=i[2*e+1],t},this.set=function(e,t){var i=this.value;i[2*e]=t[0],i[2*e+1]=t[1]},this.copy=function(e,t){var i=this.value;t*=2,i[e*=2]=i[t],i[e+1]=i[t+1]};break;case 3:this.get=function(e,t){var i=3*e,n=this.value;return t[0]=n[i],t[1]=n[i+1],t[2]=n[i+2],t},this.set=function(e,t){var i=3*e,n=this.value;n[i]=t[0],n[i+1]=t[1],n[i+2]=t[2]},this.copy=function(e,t){var i=this.value;t*=3,i[e*=3]=i[t],i[e+1]=i[t+1],i[e+2]=i[t+2]};break;case 4:this.get=function(e,t){var i=this.value,n=4*e;return t[0]=i[n],t[1]=i[n+1],t[2]=i[n+2],t[3]=i[n+3],t},this.set=function(e,t){var i=this.value,n=4*e;i[n]=t[0],i[n+1]=t[1],i[n+2]=t[2],i[n+3]=t[3]},this.copy=function(e,t){var i=this.value;t*=4,i[e*=4]=i[t],i[e+1]=i[t+1],i[e+2]=i[t+2],i[e+3]=i[t+3]}}}function h(e,t,i,n,r){this.name=e,this.type=t,this.buffer=i,this.size=n,this.semantic=r,this.symbol="",this.needsRemove=!1}function c(e){this.buffer=e,this.count=0}u.prototype.init=function(e){if(!this.value||this.value.length!=e*this.size){var t=s(this.type);this.value=new t(e*this.size)}},u.prototype.fromArray=function(e){var t,i=s(this.type);if(e[0]&&e[0].length){var n=0,r=this.size;t=new i(e.length*r);for(var a=0;a<e.length;a++)for(var o=0;o<r;o++)t[n++]=e[a][o]}else t=new i(e);this.value=t},u.prototype.clone=function(e){var t=new u(this.name,this.type,this.size,this.semantic);return e&&console.warn("todo"),t};var d=n.a.extend((function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}}),(function(){this._cache=new a.a,this._attributeList=Object.keys(this.attributes),this.__vaoCache={}}),{mainAttribute:"",pick:null,pickByRay:null,dirty:function(){for(var e=this.getEnabledAttributes(),t=0;t<e.length;t++)this.dirtyAttribute(e[t]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(e){this._cache.dirtyAll(l(e)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(e,t){if(e<this.triangleCount&&e>=0){t||(t=[]);var i=this.indices;return t[0]=i[3*e],t[1]=i[3*e+1],t[2]=i[3*e+2],t}},setTriangleIndices:function(e,t){var i=this.indices;i[3*e]=t[0],i[3*e+1]=t[1],i[3*e+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,i=this.vertexCount>65535?o.a.Uint32Array:o.a.Uint16Array;if(e[0]&&e[0].length){var n=0;t=new i(3*e.length);for(var r=0;r<e.length;r++)for(var a=0;a<3;a++)t[n++]=e[r][a]}else t=new i(e);this.indices=t},createAttribute:function(e,t,i,n){var r=new u(e,t,i,n);return this.attributes[e]&&this.removeAttribute(e),this.attributes[e]=r,this._attributeList.push(e),r},removeAttribute:function(e){var t=this._attributeList,i=t.indexOf(e);return i>=0&&(t.splice(i,1),delete this.attributes[e],!0)},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var i=[],n=this.vertexCount,r=0;r<t.length;r++){var a=t[r],o=this.attributes[a];o.value&&o.value.length===n*o.size&&i.push(a)}return this._enabledAttributes=i,i},getBufferChunks:function(e){var t=this._cache;t.use(e.__uid__);var i=t.isDirty("attributes"),n=t.isDirty("indices");if(i||n){this._updateBuffer(e.gl,i,n);for(var r=this.getEnabledAttributes(),a=0;a<r.length;a++)t.fresh(l(r[a]));t.fresh("attributes"),t.fresh("indices")}return t.fresh("any"),t.get("chunks")},_updateBuffer:function(e,t,i){var n=this._cache,a=n.get("chunks"),o=!1;a||((a=[])[0]={attributeBuffers:[],indicesBuffer:null},n.put("chunks",a),o=!0);var s=a[0],u=s.attributeBuffers,d=s.indicesBuffer;if(t||o){var f=this.getEnabledAttributes(),p={};if(!o)for(var g=0;g<u.length;g++)p[u[g].name]=u[g];for(var m=0;m<f.length;m++){var v,y,_=f[m],x=this.attributes[_];o||(v=p[_]),y=v?v.buffer:e.createBuffer(),n.isDirty(l(_))&&(e.bindBuffer(e.ARRAY_BUFFER,y),e.bufferData(e.ARRAY_BUFFER,x.value,this.dynamic?r.a.DYNAMIC_DRAW:r.a.STATIC_DRAW)),u[m]=new h(_,x.type,y,x.size,x.semantic)}for(g=m;g<u.length;g++)e.deleteBuffer(u[g].buffer);u.length=m}this.isUseIndices()&&(i||o)&&(d||(d=new c(e.createBuffer()),s.indicesBuffer=d),d.count=this.indices.length,e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,d.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?r.a.DYNAMIC_DRAW:r.a.STATIC_DRAW))},dispose:function(e){var t=this._cache;t.use(e.__uid__);var i=t.get("chunks");if(i)for(var n=0;n<i.length;n++){for(var r=i[n],a=0;a<r.attributeBuffers.length;a++){var o=r.attributeBuffers[a];e.gl.deleteBuffer(o.buffer)}r.indicesBuffer&&e.gl.deleteBuffer(r.indicesBuffer.buffer)}if(this.__vaoCache){var s=e.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},t.deleteContext(e.__uid__)}});Object.defineProperty&&(Object.defineProperty(d.prototype,"vertexCount",{enumerable:!1,get:function(){var e=this.attributes[this.mainAttribute];return e||(e=this.attributes[this._attributeList[0]]),e&&e.value?e.value.length/e.size:0}}),Object.defineProperty(d.prototype,"triangleCount",{enumerable:!1,get:function(){var e=this.indices;return e?e.length/3:0}})),d.STATIC_DRAW=r.a.STATIC_DRAW,d.DYNAMIC_DRAW=r.a.DYNAMIC_DRAW,d.STREAM_DRAW=r.a.STREAM_DRAW,d.AttributeBuffer=h,d.IndicesBuffer=c,d.Attribute=u,t.a=d},function(e,t,i){var n=i(120),r="@export clay.header.",a="@end",o=":unconfigurable;";t.a=[r+"directional_light","uniform vec3 directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+o,"uniform vec3 directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+o,a,r+"ambient_light","uniform vec3 ambientLightColor[AMBIENT_LIGHT_COUNT]"+o,a,r+"ambient_sh_light","uniform vec3 ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+o,"uniform vec3 ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+o,n.a,a,r+"ambient_cubemap_light","uniform vec3 ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+o,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+o,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+o,a,r+"point_light","uniform vec3 pointLightPosition[POINT_LIGHT_COUNT]"+o,"uniform float pointLightRange[POINT_LIGHT_COUNT]"+o,"uniform vec3 pointLightColor[POINT_LIGHT_COUNT]"+o,a,r+"spot_light","uniform vec3 spotLightPosition[SPOT_LIGHT_COUNT]"+o,"uniform vec3 spotLightDirection[SPOT_LIGHT_COUNT]"+o,"uniform float spotLightRange[SPOT_LIGHT_COUNT]"+o,"uniform float spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+o,"uniform float spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+o,"uniform float spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+o,"uniform vec3 spotLightColor[SPOT_LIGHT_COUNT]"+o,a].join("\n")},function(e,t,i){t.a="vec3 calcAmbientSHLight(int idx, vec3 N) {\n int offset = 9 * idx;\n return ambientSHLightCoefficients[0]\n + ambientSHLightCoefficients[1] * N.x\n + ambientSHLightCoefficients[2] * N.y\n + ambientSHLightCoefficients[3] * N.z\n + ambientSHLightCoefficients[4] * N.x * N.z\n + ambientSHLightCoefficients[5] * N.z * N.y\n + ambientSHLightCoefficients[6] * N.y * N.x\n + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)\n + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);\n}"},function(e,t,i){t.a="@export clay.skybox.vertex\n#define SHADER_NAME skybox\nuniform mat4 world : WORLD;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nvarying vec3 v_WorldPosition;\nvoid main()\n{\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n@export clay.skybox.fragment\n#define PI 3.1415926\nuniform mat4 viewInverse : VIEWINVERSE;\n#ifdef EQUIRECTANGULAR\nuniform sampler2D environmentMap;\n#else\nuniform samplerCube environmentMap;\n#endif\nuniform float lod: 0.0;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n#ifdef EQUIRECTANGULAR\n float phi = acos(V.y);\n float theta = atan(-V.x, V.z) + PI * 0.5;\n vec2 uv = vec2(theta / 2.0 / PI, phi / PI);\n vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));\n#else\n #if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)\n vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));\n #else\n vec4 texel = decodeHDR(textureCube(environmentMap, V));\n #endif\n#endif\n#ifdef SRGB_DECODE\n texel = sRGBToLinear(texel);\n#endif\n#ifdef TONEMAPPING\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n#ifdef SRGB_ENCODE\n texel = linearTosRGB(texel);\n#endif\n gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));\n}\n@end"},function(e,t,i){var n=i(4),r=i(5);function a(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}i(27);var o=a("DXT1"),s=a("DXT3"),l=a("DXT5"),u={parse:function(e,t){var i=new Int32Array(e,0,31);if(542327876!==i[0])return null;if(4&!i(20))return null;var a,u,h=i(21),c=i[4],d=i[3],f=512&i[28],p=131072&i[2];switch(h){case o:a=8,u=n.a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case s:a=16,u=n.a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case l:a=16,u=n.a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var g=i[1]+4,m=f?6:1,v=1;p&&(v=Math.max(1,i[7]));for(var y=[],_=0;_<m;_++){var x=c,b=d;y[_]=new r.a({width:x,height:b,format:u});for(var w=[],T=0;T<v;T++){var S=Math.max(4,x)/4*Math.max(4,b)/4*a,M=new Uint8Array(e,g,S);g+=S,x*=.5,b*=.5,w[T]=M}y[_].pixels=w[0],p&&(y[_].mipmaps=w)}if(!t)return y[0];t.width=y[0].width,t.height=y[0].height,t.format=y[0].format,t.pixels=y[0].pixels,t.mipmaps=y[0].mipmaps}};t.a=u},function(e,t,i){var n=i(4),r=i(5),a=String.fromCharCode;function o(e,t,i,n){if(e[3]>0){var r=Math.pow(2,e[3]-128-8+n);t[i+0]=e[0]*r,t[i+1]=e[1]*r,t[i+2]=e[2]*r}else t[i+0]=0,t[i+1]=0,t[i+2]=0;return t[i+3]=1,t}function s(e,t,i,n){for(var r,a,o=0,s=0,l=n;l>0;)if(e[s][0]=t[i++],e[s][1]=t[i++],e[s][2]=t[i++],e[s][3]=t[i++],1===e[s][0]&&1===e[s][1]&&1===e[s][2]){for(var u=e[s][3]<<o>>>0;u>0;u--)r=e[s-1],(a=e[s])[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],s++,l--;o+=8}else s++,l--,o=0;return i}function l(e,t,i,n){if(n<8|n>32767)return s(e,t,i,n);if(2!=(r=t[i++]))return s(e,t,i-1,n);if(e[0][1]=t[i++],e[0][2]=t[i++],r=t[i++],(e[0][2]<<8>>>0|r)>>>0!==n)return null;for(var r=0;r<4;r++)for(var a=0;a<n;){var o=t[i++];if(o>128){o=(127&o)>>>0;for(var l=t[i++];o--;)e[a++][r]=l}else for(;o--;)e[a++][r]=t[i++]}return i}var u={parseRGBE:function(e,t,i){null==i&&(i=0);var s=new Uint8Array(e),u=s.length;if("#?"===function(e,t,i){for(var n="",r=t;r<i;r++)n+=a(e[r]);return n}(s,0,2)){for(var h=2;h<u&&("\n"!==a(s[h])||"\n"!==a(s[h+1]));h++);if(!(h>=u)){h+=2;for(var c="";h<u;h++){var d=a(s[h]);if("\n"===d)break;c+=d}var f=c.split(" "),p=parseInt(f[1]),g=parseInt(f[3]);if(g&&p){for(var m=h+1,v=[],y=0;y<g;y++){v[y]=[];for(var _=0;_<4;_++)v[y][_]=0}for(var x=new Float32Array(g*p*4),b=0,w=0;w<p;w++){if(!(m=l(v,s,m,g)))return null;for(y=0;y<g;y++)o(v[y],x,b,i),b+=4}return t||(t=new r.a),t.width=g,t.height=p,t.pixels=x,t.type=n.a.FLOAT,t}}}},parseRGBEFromPNG:function(e){}};t.a=u},function(e,t,i){var n=i(5),r=i(3),a=i(26),o=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function s(e){return"_on"+e}var l,u,h,c,d,f,p,g,m=function(e){var t=this;this._texture=new n.a({anisotropic:32,flipY:!1,surface:this,dispose:function(e){t.dispose(),n.a.prototype.dispose.call(this,e)}}),o.forEach((function(e){this[s(e)]=function(t){t.triangle&&this._meshes.forEach((function(i){this.dispatchEvent(e,i,t.triangle,t.point)}),this)}}),this),this._meshes=[],e&&this.setECharts(e),this.onupdate=null};m.prototype={constructor:m,getTexture:function(){return this._texture},setECharts:function(e){this._chart=e;var t=e.getDom();if(t instanceof HTMLCanvasElement){var i=this,n=e.getZr(),r=n.__oldRefreshImmediately||n.refreshImmediately;n.refreshImmediately=function(){r.call(this),i._texture.dirty(),i.onupdate&&i.onupdate()},n.__oldRefreshImmediately=r}else console.error("ECharts must init on canvas if it is used as texture."),t=document.createElement("canvas");this._texture.image=t,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:(l=new r.a,u=new r.a,h=new r.a,c=new a.a,d=new a.a,f=new a.a,p=new a.a,g=new r.a,function(e,t,i,n){var o=t.geometry,s=o.attributes.position,m=o.attributes.texcoord0,v=r.a.dot,y=r.a.cross;s.get(i[0],l.array),s.get(i[1],u.array),s.get(i[2],h.array),m.get(i[0],c.array),m.get(i[1],d.array),m.get(i[2],f.array),y(g,u,h);var _=v(l,g),x=v(n,g)/_;y(g,h,l);var b=v(n,g)/_;y(g,l,u);var w=v(n,g)/_;a.a.scale(p,c,x),a.a.scaleAndAdd(p,p,d,b),a.a.scaleAndAdd(p,p,f,w);var T=p.x*this._chart.getWidth(),S=p.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(e,{zrX:T,zrY:S})}),attachToMesh:function(e){this._meshes.indexOf(e)>=0||(o.forEach((function(t){e.on(t,this[s(t)],this)}),this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),o.forEach((function(t){e.off(t,this[s(t)])}),this)},dispose:function(){this._meshes.forEach((function(e){this.detachFromMesh(e)}),this)}},t.a=m},function(e,t,i){var n=i(24),r=i(77),a=n.a.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(e,t){if(e.getGLExtension("EXT_shader_texture_lod")){this._brdfLookup||(this._normalDistribution=r.a.generateNormalDistribution(),this._brdfLookup=r.a.integrateBRDF(e,this._normalDistribution));var i=this.cubemap;if(!i.__prefiltered){var n=r.a.prefilterEnvironmentMap(e,i,{encodeRGBM:!0,width:t,height:t},this._normalDistribution,this._brdfLookup);this.cubemap=n.environmentMap,this.cubemap.__prefiltered=!0,i.dispose(e)}}else console.warn("Device not support textureCubeLodEXT")},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}},ambientCubemapLightCubemap:{type:"t",value:function(e){return e.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(e){return e._brdfLookup}}}});t.a=a},function(e,t,i){t.a="\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end"},function(e,t,i){t.a="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"},function(e,t,i){t.a="#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"},function(e,t,i){var n=i(24),r=i(14),a=n.a.extend({castShadow:!1,coefficients:[]},(function(){this._coefficientsTmpArr=new r.a.Float32Array(27)}),{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}},ambientSHLightCoefficients:{type:"3f",value:function(e){for(var t=e._coefficientsTmpArr,i=0;i<e.coefficients.length;i++)t[i]=e.coefficients[i];return t}}}});t.a=a},function(e,t,i){var n=i(4),r=i(10),a=i(5);i(16);var o=i(14),s=i(42),l=i(75),u=i(62),h=i(36),c=i(12);i(131);var d={},f=["px","nx","py","ny","pz","nz"];function p(e,t){var i=e[0],n=e[1],r=e[2];return 0===t?1:1===t?i:2===t?n:3===t?r:4===t?i*r:5===t?n*r:6===t?i*n:7===t?3*r*r-1:i*i-n*n}var g={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};d.projectEnvironmentMap=function(e,t,i){var d;(i=i||{}).lod=i.lod||0;var m=new h.a,v=64;"texture2D"===t.textureType?d=new l.a({scene:m,environmentMap:t}):(v=t.image&&t.image.px?t.image.px.width:t.width,d=new s.a({scene:m,environmentMap:t}));var y=Math.ceil(v/Math.pow(2,i.lod)),_=Math.ceil(v/Math.pow(2,i.lod)),x=new a.a({width:y,height:_}),b=new r.a;d.material.define("fragment","RGBM_ENCODE"),i.decodeRGBM&&d.material.define("fragment","RGBM_DECODE"),d.material.set("lod",i.lod);for(var w=new u.a({texture:x}),T={},S=0;S<f.length;S++){T[f[S]]=new Uint8Array(y*_*4);var M=w.getCamera(f[S]);M.fov=90,b.attach(x),b.bind(e),e.render(m,M),e.gl.readPixels(0,0,y,_,n.a.RGBA,n.a.UNSIGNED_BYTE,T[f[S]]),b.unbind(e)}return d.dispose(e),b.dispose(e),x.dispose(e),function(e,t,i,n){for(var r=new o.a.Float32Array(27),a=c.a.create(),s=c.a.create(),l=c.a.create(),u=0;u<9;u++){for(var h=c.a.create(),d=0;d<f.length;d++){for(var m=t[f[d]],v=c.a.create(),y=0,_=0,x=g[f[d]],b=0;b<n;b++)for(var w=0;w<i;w++){a[0]=w/(i-1)*2-1,a[1]=b/(n-1)*2-1,a[2]=-1,c.a.normalize(a,a),l[0]=a[x[0]]*x[3],l[1]=a[x[1]]*x[4],l[2]=a[x[2]]*x[5],s[0]=m[_++]/255,s[1]=m[_++]/255,s[2]=m[_++]/255;var T=m[_++]/255*8.12;s[0]*=T,s[1]*=T,s[2]*=T,c.a.scaleAndAdd(v,v,s,p(l,u)*-a[2]),y+=-a[2]}c.a.scaleAndAdd(h,h,v,1/y)}r[3*u]=h[0]/6,r[3*u+1]=h[1]/6,r[3*u+2]=h[2]/6}return r}(0,T,y,_)},t.a=d},function(e,t,i){t.a="uniform samplerCube environmentMap;\nvarying vec2 v_Texcoord;\n#define TEXTURE_SIZE 16\nmat3 front = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n);\nmat3 back = mat3(\n -1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, -1.0\n);\nmat3 left = mat3(\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0,\n 1.0, 0.0, 0.0\n);\nmat3 right = mat3(\n 0.0, 0.0, 1.0,\n 0.0, 1.0, 0.0,\n -1.0, 0.0, 0.0\n);\nmat3 up = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0,\n 0.0, -1.0, 0.0\n);\nmat3 down = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0\n);\nfloat harmonics(vec3 normal){\n int index = int(gl_FragCoord.x);\n float x = normal.x;\n float y = normal.y;\n float z = normal.z;\n if(index==0){\n return 1.0;\n }\n else if(index==1){\n return x;\n }\n else if(index==2){\n return y;\n }\n else if(index==3){\n return z;\n }\n else if(index==4){\n return x*z;\n }\n else if(index==5){\n return y*z;\n }\n else if(index==6){\n return x*y;\n }\n else if(index==7){\n return 3.0*z*z - 1.0;\n }\n else{\n return x*x - y*y;\n }\n}\nvec3 sampleSide(mat3 rot)\n{\n vec3 result = vec3(0.0);\n float divider = 0.0;\n for (int i = 0; i < TEXTURE_SIZE * TEXTURE_SIZE; i++) {\n float x = mod(float(i), float(TEXTURE_SIZE));\n float y = float(i / TEXTURE_SIZE);\n vec2 sidecoord = ((vec2(x, y) + vec2(0.5, 0.5)) / vec2(TEXTURE_SIZE)) * 2.0 - 1.0;\n vec3 normal = normalize(vec3(sidecoord, -1.0));\n vec3 fetchNormal = rot * normal;\n vec3 texel = textureCube(environmentMap, fetchNormal).rgb;\n result += harmonics(fetchNormal) * texel * -normal.z;\n divider += -normal.z;\n }\n return result / divider;\n}\nvoid main()\n{\n vec3 result = (\n sampleSide(front) +\n sampleSide(back) +\n sampleSide(left) +\n sampleSide(right) +\n sampleSide(up) +\n sampleSide(down)\n ) / 6.0;\n gl_FragColor = vec4(result, 1.0);\n}"},function(e,t,i){var n=i(15),r=i(18),a=n.a.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},(function(){this.build()}),{build:function(){var e=this.heightSegments,t=this.widthSegments,i=this.attributes.position,n=this.attributes.texcoord0,a=this.attributes.normal,o=(t+1)*(e+1);i.init(o),n.init(o),a.init(o);var s,l,u,h,c,d,f,p,g,m,v,y=o>65535?Uint32Array:Uint16Array,_=this.indices=new y(t*e*6),x=this.radius,b=this.phiStart,w=this.phiLength,T=this.thetaStart,S=this.thetaLength,M=[],A=[],I=0,C=1/(x=this.radius);for(f=0;f<=e;f++)for(d=0;d<=t;d++)h=d/t,c=f/e,s=-x*Math.cos(b+h*w)*Math.sin(T+c*S),l=x*Math.cos(T+c*S),u=x*Math.sin(b+h*w)*Math.sin(T+c*S),M[0]=s,M[1]=l,M[2]=u,A[0]=h,A[1]=c,i.set(I,M),n.set(I,A),M[0]*=C,M[1]*=C,M[2]*=C,a.set(I,M),I++;var D=t+1,E=0;for(f=0;f<e;f++)for(d=0;d<t;d++)g=f*D+d,p=f*D+d+1,v=(f+1)*D+d+1,m=(f+1)*D+d,_[E++]=p,_[E++]=g,_[E++]=v,_[E++]=g,_[E++]=m,_[E++]=v;this.boundingBox=new r.a,this.boundingBox.max.set(x,x,x),this.boundingBox.min.set(-x,-x,-x)}});t.a=a},function(e,t,i){var n=i(24).a.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}}}});t.a=n},function(e,t,i){var n=i(24),r=i(3),a=n.a.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new r.a,e.__dir.copy(e.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}}},clone:function(){var e=n.a.prototype.clone.call(this);return e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}});t.a=a},function(e,t,i){var n=i(24),r=n.a.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(e){return e.range}},pointLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}}},clone:function(){var e=n.a.prototype.clone.call(this);return e.range=this.range,e}});t.a=r},function(e,t,i){var n=i(24),r=i(3),a=n.a.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:.001,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(e){return e.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(e){return e.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(e){return Math.cos(e.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(e){return e.falloffFactor}},spotLightDirection:{type:"3f",value:function(e){return e.__dir=e.__dir||new r.a,e.__dir.copy(e.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(e){var t=e.color,i=e.intensity;return[t[0]*i,t[1]*i,t[2]*i]}}},clone:function(){var e=n.a.prototype.clone.call(this);return e.range=this.range,e.umbraAngle=this.umbraAngle,e.penumbraAngle=this.penumbraAngle,e.falloffFactor=this.falloffFactor,e.shadowBias=this.shadowBias,e.shadowSlopeScale=this.shadowSlopeScale,e}});t.a=a},function(e,t,i){var n=i(33),r=function(e,t,i,r){e=e||0,t=t||0,i=i||0,r=r||0,this.array=n.a.fromValues(e,t,i,r),this._dirty=!0};r.prototype={constructor:r,add:function(e){return n.a.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,i,n){return this.array[0]=e,this.array[1]=t,this.array[2]=i,this.array[3]=n,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new r(this.x,this.y,this.z,this.w)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},dist:function(e){return n.a.dist(this.array,e.array)},distance:function(e){return n.a.distance(this.array,e.array)},div:function(e){return n.a.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return n.a.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return n.a.dot(this.array,e.array)},len:function(){return n.a.len(this.array)},length:function(){return n.a.length(this.array)},lerp:function(e,t,i){return n.a.lerp(this.array,e.array,t.array,i),this._dirty=!0,this},min:function(e){return n.a.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return n.a.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return n.a.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return n.a.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return n.a.random(this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return n.a.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return n.a.sqrDist(this.array,e.array)},squaredDistance:function(e){return n.a.squaredDistance(this.array,e.array)},sqrLen:function(){return n.a.sqrLen(this.array)},squaredLength:function(){return n.a.squaredLength(this.array)},sub:function(e){return n.a.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return n.a.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return n.a.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return n.a.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var a=Object.defineProperty;if(a){var o=r.prototype;a(o,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),a(o,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),a(o,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),a(o,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}r.add=function(e,t,i){return n.a.add(e.array,t.array,i.array),e._dirty=!0,e},r.set=function(e,t,i,r,a){n.a.set(e.array,t,i,r,a),e._dirty=!0},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.distance=r.dist=function(e,t){return n.a.distance(e.array,t.array)},r.divide=r.div=function(e,t,i){return n.a.divide(e.array,t.array,i.array),e._dirty=!0,e},r.dot=function(e,t){return n.a.dot(e.array,t.array)},r.len=function(e){return n.a.length(e.array)},r.lerp=function(e,t,i,r){return n.a.lerp(e.array,t.array,i.array,r),e._dirty=!0,e},r.min=function(e,t,i){return n.a.min(e.array,t.array,i.array),e._dirty=!0,e},r.max=function(e,t,i){return n.a.max(e.array,t.array,i.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.multiply(e.array,t.array,i.array),e._dirty=!0,e},r.negate=function(e,t){return n.a.negate(e.array,t.array),e._dirty=!0,e},r.normalize=function(e,t){return n.a.normalize(e.array,t.array),e._dirty=!0,e},r.random=function(e,t){return n.a.random(e.array,t),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i),e._dirty=!0,e},r.scaleAndAdd=function(e,t,i,r){return n.a.scaleAndAdd(e.array,t.array,i.array,r),e._dirty=!0,e},r.squaredDistance=r.sqrDist=function(e,t){return n.a.sqrDist(e.array,t.array)},r.squaredLength=r.sqrLen=function(e){return n.a.sqrLen(e.array)},r.subtract=r.sub=function(e,t,i){return n.a.subtract(e.array,t.array,i.array),e._dirty=!0,e},r.transformMat4=function(e,t,i){return n.a.transformMat4(e.array,t.array,i.array),e._dirty=!0,e},r.transformQuat=function(e,t,i){return n.a.transformQuat(e.array,t.array,i.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(78),r=function(){this.array=n.a.create(),this._dirty=!0};r.prototype={constructor:r,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new r).copy(this)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},adjoint:function(){return n.a.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return n.a.determinant(this.array)},identity:function(){return n.a.identity(this.array),this._dirty=!0,this},invert:function(){return n.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return n.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return n.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return n.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return n.a.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},r.adjoint=function(e,t){return n.a.adjoint(e.array,t.array),e._dirty=!0,e},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.determinant=function(e){return n.a.determinant(e.array)},r.identity=function(e){return n.a.identity(e.array),e._dirty=!0,e},r.invert=function(e,t){return n.a.invert(e.array,t.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.mul(e.array,t.array,i.array),e._dirty=!0,e},r.rotate=function(e,t,i){return n.a.rotate(e.array,t.array,i),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i.array),e._dirty=!0,e},r.transpose=function(e,t){return n.a.transpose(e.array,t.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(79),r=function(){this.array=n.a.create(),this._dirty=!0};r.prototype={constructor:r,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},clone:function(){return(new r).copy(this)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return n.a.determinant(this.array)},identity:function(){return n.a.identity(this.array),this._dirty=!0,this},invert:function(){return n.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return n.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return n.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return n.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return n.a.translate(this.array,this.array,e.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.determinant=function(e){return n.a.determinant(e.array)},r.identity=function(e){return n.a.identity(e.array),e._dirty=!0,e},r.invert=function(e,t){return n.a.invert(e.array,t.array),e._dirty=!0,e},r.multiply=r.mul=function(e,t,i){return n.a.mul(e.array,t.array,i.array),e._dirty=!0,e},r.rotate=function(e,t,i){return n.a.rotate(e.array,t.array,i),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i.array),e._dirty=!0,e},r.translate=function(e,t,i){return n.a.translate(e.array,t.array,i.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(34),r=function(){this.array=n.a.create(),this._dirty=!0};r.prototype={constructor:r,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return n.a.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new r).copy(this)},copy:function(e){return n.a.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return n.a.determinant(this.array)},fromMat2d:function(e){return n.a.fromMat2d(this.array,e.array),this._dirty=!0,this},fromMat4:function(e){return n.a.fromMat4(this.array,e.array),this._dirty=!0,this},fromQuat:function(e){return n.a.fromQuat(this.array,e.array),this._dirty=!0,this},identity:function(){return n.a.identity(this.array),this._dirty=!0,this},invert:function(){return n.a.invert(this.array,this.array),this._dirty=!0,this},mul:function(e){return n.a.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return n.a.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return n.a.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return n.a.multiply(this.array,e.array,this.array),this._dirty=!0,this},rotate:function(e){return n.a.rotate(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return n.a.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return n.a.translate(this.array,this.array,e.array),this._dirty=!0,this},normalFromMat4:function(e){return n.a.normalFromMat4(this.array,e.array),this._dirty=!0,this},transpose:function(){return n.a.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},r.adjoint=function(e,t){return n.a.adjoint(e.array,t.array),e._dirty=!0,e},r.copy=function(e,t){return n.a.copy(e.array,t.array),e._dirty=!0,e},r.determinant=function(e){return n.a.determinant(e.array)},r.identity=function(e){return n.a.identity(e.array),e._dirty=!0,e},r.invert=function(e,t){return n.a.invert(e.array,t.array),e},r.multiply=r.mul=function(e,t,i){return n.a.mul(e.array,t.array,i.array),e._dirty=!0,e},r.fromMat2d=function(e,t){return n.a.fromMat2d(e.array,t.array),e._dirty=!0,e},r.fromMat4=function(e,t){return n.a.fromMat4(e.array,t.array),e._dirty=!0,e},r.fromQuat=function(e,t){return n.a.fromQuat(e.array,t.array),e._dirty=!0,e},r.normalFromMat4=function(e,t){return n.a.normalFromMat4(e.array,t.array),e._dirty=!0,e},r.rotate=function(e,t,i){return n.a.rotate(e.array,t.array,i),e._dirty=!0,e},r.scale=function(e,t,i){return n.a.scale(e.array,t.array,i.array),e._dirty=!0,e},r.transpose=function(e,t){return n.a.transpose(e.array,t.array),e._dirty=!0,e},r.translate=function(e,t,i){return n.a.translate(e.array,t.array,i.array),e._dirty=!0,e},t.a=r},function(e,t,i){var n=i(142),r=i.n(n),a={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(e,t){var i;if(this._animators=this._animators||[],e){for(var n=e.split("."),a=this,o=0,s=n.length;o<s;o++)a&&(a=a[n[o]]);a&&(i=a)}else i=this;if(null==i)throw new Error("Target "+e+" not exists");var l=this._animators,u=new r.a(i,t),h=this;return u.during((function(){h.__zr&&h.__zr.refresh()})).done((function(){var e=l.indexOf(u);e>=0&&l.splice(e,1)})),l.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,i=t.length,n=0;n<i;n++)t[n].stop(e);return t.length=0,this},addAnimatorsToZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.addAnimator(this._animators[t])},removeAnimatorsFromZr:function(e){if(this._animators)for(var t=0;t<this._animators.length;t++)e.animation.removeAnimator(this._animators[t])}};t.a=a},function(e,t,i){var n=i(143),r=i(145),a=i(13).isArrayLike,o=Array.prototype.slice;function s(e,t){return e[t]}function l(e,t,i){e[t]=i}function u(e,t,i){return(t-e)*i+e}function h(e,t,i){return i>.5?t:e}function c(e,t,i,n,r){var a=e.length;if(1==r)for(var o=0;o<a;o++)n[o]=u(e[o],t[o],i);else{var s=a&&e[0].length;for(o=0;o<a;o++)for(var l=0;l<s;l++)n[o][l]=u(e[o][l],t[o][l],i)}}function d(e,t,i){var n=e.length,r=t.length;if(n!==r)if(n>r)e.length=r;else for(var a=n;a<r;a++)e.push(1===i?t[a]:o.call(t[a]));var s=e[0]&&e[0].length;for(a=0;a<e.length;a++)if(1===i)isNaN(e[a])&&(e[a]=t[a]);else for(var l=0;l<s;l++)isNaN(e[a][l])&&(e[a][l]=t[a][l])}function f(e,t,i){if(e===t)return!0;var n=e.length;if(n!==t.length)return!1;if(1===i){for(var r=0;r<n;r++)if(e[r]!==t[r])return!1}else{var a=e[0].length;for(r=0;r<n;r++)for(var o=0;o<a;o++)if(e[r][o]!==t[r][o])return!1}return!0}function p(e,t,i,n,r,a,o,s,l){var u=e.length;if(1==l)for(var h=0;h<u;h++)s[h]=g(e[h],t[h],i[h],n[h],r,a,o);else{var c=e[0].length;for(h=0;h<u;h++)for(var d=0;d<c;d++)s[h][d]=g(e[h][d],t[h][d],i[h][d],n[h][d],r,a,o)}}function g(e,t,i,n,r,a,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*a+s*r+t}function m(e){if(a(e)){var t=e.length;if(a(e[0])){for(var i=[],n=0;n<t;n++)i.push(o.call(e[n]));return i}return o.call(e)}return e}function v(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function y(e,t,i,o,s,l){var m=e._getter,y=e._setter,_="spline"===t,x=o.length;if(x){var b,w=o[0].value,T=a(w),S=!1,M=!1,A=T?function(e){var t=e[e.length-1].value;return a(t&&t[0])?2:1}(o):0;o.sort((function(e,t){return e.time-t.time})),b=o[x-1].time;for(var I=[],C=[],D=o[0].value,E=!0,L=0;L<x;L++){I.push(o[L].time/b);var P=o[L].value;if(T&&f(P,D,A)||!T&&P===D||(E=!1),D=P,"string"==typeof P){var N=r.parse(P);N?(P=N,S=!0):M=!0}C.push(P)}if(l||!E){var R=C[x-1];for(L=0;L<x-1;L++)T?d(C[L],R,A):!isNaN(C[L])||isNaN(R)||M||S||(C[L]=R);T&&d(m(e._target,s),R,A);var O,k,z,B,F,V=0,G=0;if(S)var H=[0,0,0,0];var U=new n({target:e._target,life:b,loop:e._loop,delay:e._delay,onframe:function(e,t){var i;if(t<0)i=0;else if(t<G){for(i=Math.min(V+1,x-1);i>=0&&!(I[i]<=t);i--);i=Math.min(i,x-2)}else{for(i=V;i<x&&!(I[i]>t);i++);i=Math.min(i-1,x-2)}V=i,G=t;var n=I[i+1]-I[i];if(0!==n)if(O=(t-I[i])/n,_)if(z=C[i],k=C[0===i?i:i-1],B=C[i>x-2?x-1:i+1],F=C[i>x-3?x-1:i+2],T)p(k,z,B,F,O,O*O,O*O*O,m(e,s),A);else{if(S)r=p(k,z,B,F,O,O*O,O*O*O,H,1),r=v(H);else{if(M)return h(z,B,O);r=g(k,z,B,F,O,O*O,O*O*O)}y(e,s,r)}else if(T)c(C[i],C[i+1],O,m(e,s),A);else{var r;if(S)c(C[i],C[i+1],O,H,1),r=v(H);else{if(M)return h(C[i],C[i+1],O);r=u(C[i],C[i+1],O)}y(e,s,r)}},ondestroy:i});return t&&"spline"!==t&&(U.easing=t),U}}}var _=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||s,this._setter=n||l,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};_.prototype={when:function(e,t){var i=this._tracks;for(var n in t)if(t.hasOwnProperty(n)){if(!i[n]){i[n]=[];var r=this._getter(this._target,n);if(null==r)continue;0!==e&&i[n].push({time:0,value:m(r)})}i[n].push({time:e,value:t[n]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].pause();this._paused=!0},resume:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var e=this._doneList,t=e.length,i=0;i<t;i++)e[i].call(this)},start:function(e,t){var i,n=this,r=0,a=function(){--r||n._doneCallback()};for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=y(this,e,a,this._tracks[o],o,t);s&&(this._clipList.push(s),r++,this.animation&&this.animation.addClip(s),i=s)}if(i){var l=i.onframe;i.onframe=function(e,t){l(e,t);for(var i=0;i<n._onframeList.length;i++)n._onframeList[i](e,t)}}return r||this._doneCallback(),this},stop:function(e){for(var t=this._clipList,i=this.animation,n=0;n<t.length;n++){var r=t[n];e&&r.onframe(this._target,1),i&&i.removeClip(r)}t.length=0},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this},getClips:function(){return this._clipList}};var x=_;e.exports=x},function(e,t,i){var n=i(144);function r(e){this._target=e.target,this._life=e.life||1e3,this._delay=e.delay||0,this._initialized=!1,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this._pausedTime=0,this._paused=!1}r.prototype={constructor:r,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var i=(e-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var r=this.easing,a="string"==typeof r?n[r]:r,o="function"==typeof a?a(i):i;return this.fire("frame",o),1==i?this.loop?(this.restart(e),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(e,t){this[e="on"+e]&&this[e](this._target,t)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var a=r;e.exports=a},function(e,t){var i={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=n*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-i.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*i.bounceIn(2*e):.5*i.bounceOut(2*e-1)+.5}},n=i;e.exports=n},function(e,t,i){var n=i(60),r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function a(e){return(e=Math.round(e))<0?0:e>255?255:e}function o(e){return e<0?0:e>1?1:e}function s(e){return e.length&&"%"===e.charAt(e.length-1)?a(parseFloat(e)/100*255):a(parseInt(e,10))}function l(e){return e.length&&"%"===e.charAt(e.length-1)?o(parseFloat(e)/100):o(parseFloat(e))}function u(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function h(e,t,i){return e+(t-e)*i}function c(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}function d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var f=new n(20),p=null;function g(e,t){p&&d(p,t),p=f.put(e,p||t.slice())}function m(e,t){if(e){t=t||[];var i=f.get(e);if(i)return d(t,i);var n,a=(e+="").replace(/ /g,"").toLowerCase();if(a in r)return d(t,r[a]),g(e,t),t;if("#"===a.charAt(0))return 4===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=4095?(c(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),g(e,t),t):void c(t,0,0,0,1):7===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=16777215?(c(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),g(e,t),t):void c(t,0,0,0,1):void 0;var o=a.indexOf("("),u=a.indexOf(")");if(-1!==o&&u+1===a.length){var h=a.substr(0,o),p=a.substr(o+1,u-(o+1)).split(","),m=1;switch(h){case"rgba":if(4!==p.length)return void c(t,0,0,0,1);m=l(p.pop());case"rgb":return 3!==p.length?void c(t,0,0,0,1):(c(t,s(p[0]),s(p[1]),s(p[2]),m),g(e,t),t);case"hsla":return 4!==p.length?void c(t,0,0,0,1):(p[3]=l(p[3]),v(p,t),g(e,t),t);case"hsl":return 3!==p.length?void c(t,0,0,0,1):(v(p,t),g(e,t),t);default:return}}c(t,0,0,0,1)}}function v(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=l(e[1]),r=l(e[2]),o=r<=.5?r*(n+1):r+n-r*n,s=2*r-o;return c(t=t||[],a(255*u(s,o,i+1/3)),a(255*u(s,o,i)),a(255*u(s,o,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function y(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),r=Math.floor(n),s=Math.ceil(n),l=t[r],u=t[s],c=n-r;return i[0]=a(h(l[0],u[0],c)),i[1]=a(h(l[1],u[1],c)),i[2]=a(h(l[2],u[2],c)),i[3]=o(h(l[3],u[3],c)),i}}var _=y;function x(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),r=Math.floor(n),s=Math.ceil(n),l=m(t[r]),u=m(t[s]),c=n-r,d=w([a(h(l[0],u[0],c)),a(h(l[1],u[1],c)),a(h(l[2],u[2],c)),o(h(l[3],u[3],c))],"rgba");return i?{color:d,leftIndex:r,rightIndex:s,value:n}:d}}var b=x;function w(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}}t.parse=m,t.lift=function(e,t){var i=m(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0,i[n]>255?i[n]=255:e[n]<0&&(i[n]=0);return w(i,4===i.length?"rgba":"rgb")}},t.toHex=function(e){var t=m(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},t.fastLerp=y,t.fastMapToColor=_,t.lerp=x,t.mapToColor=b,t.modifyHSL=function(e,t,i,n){if(e=m(e))return e=function(e){if(e){var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(n,r,a),s=Math.max(n,r,a),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?t=d-c:r===s?t=1/3+h-d:a===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,i,u];return null!=e[3]&&f.push(e[3]),f}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=l(i)),null!=n&&(e[2]=l(n)),w(v(e),"rgba")},t.modifyAlpha=function(e,t){if((e=m(e))&&null!=t)return e[3]=o(t),w(e,"rgba")},t.stringify=w},function(e,t,i){t.a="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\n#ifdef SUPPORT_STANDARD_DERIVATIVES\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#else\nfloat edgeFactor(float width)\n{\n return 1.0;\n}\n#endif\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 8.12), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 8.12);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\n#ifdef USE_SKIN_MATRICES_TEXTURE\nuniform sampler2D skinMatricesTexture : ignore;\nuniform float skinMatricesTextureSize: ignore;\nmat4 getSkinMatrix(sampler2D tex, float idx) {\n float j = idx * 4.0;\n float x = mod(j, skinMatricesTextureSize);\n float y = floor(j / skinMatricesTextureSize) + 0.5;\n vec2 scale = vec2(skinMatricesTextureSize);\n return mat4(\n texture2D(tex, vec2(x + 0.5, y) / scale),\n texture2D(tex, vec2(x + 1.5, y) / scale),\n texture2D(tex, vec2(x + 2.5, y) / scale),\n texture2D(tex, vec2(x + 3.5, y) / scale)\n );\n}\nmat4 getSkinMatrix(float idx) {\n return getSkinMatrix(skinMatricesTexture, idx);\n}\n#else\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end"},function(e,t,i){t.a="\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"},function(e,t,i){t.a="@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"},function(e,t,i){t.a="/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,i){t.a="@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(e,t,i){t.a="@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"},function(e,t,i){t.a="@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end"},function(e,t,i){var n=i(0),r=i.n(n),a=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function o(e,t){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var i=e[t].normal,n=e[t].emphasis;i&&(e[t]=i),n&&(e.emphasis=e.emphasis||{},e.emphasis[t]=n)}}function s(e){e&&(e instanceof Array||(e=[e]),r.a.util.each(e,(function(e){if(e.axisLabel){var t=e.axisLabel;r.a.util.extend(t,t.textStyle),t.textStyle=null}})))}t.a=function(e){r.a.util.each(e.series,(function(t){r.a.util.indexOf(a,t.type)>=0&&(function(e){o(e,"itemStyle"),o(e,"lineStyle"),o(e,"areaStyle"),o(e,"label")}(t),"mapbox"===t.coordinateSystem&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))})),s(e.xAxis3D),s(e.yAxis3D),s(e.zAxis3D),s(e.grid3D),o(e.geo3D)}},function(e,t,i){i(155),i(159),i(160),i(167);var n=i(0),r=i.n(n);r.a.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"grid3D",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},(function(e,t){})),r.a.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},(function(e,t){}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(156),o=r.a.extendComponentModel({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});function s(e,t){return t.type||(t.data?"category":"value")}r.a.helper.mixinAxisModelCommonMethods(o),Object(a.a)("x",o,s,{name:"X"}),Object(a.a)("y",o,s,{name:"Y"}),Object(a.a)("z",o,s,{name:"Z"})},function(e,t,i){var n=i(0),r=i.n(n),a=i(157),o=i(158),s=i.n(o),l=["value","category","time","log"];t.a=function(e,t,i,n){r.a.util.each(l,(function(o){t.extend({type:e+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(t,n){var a=n.getTheme();r.a.util.merge(t,a.get(o+"Axis3D")),r.a.util.merge(t,this.getDefaultOption()),t.type=i(e,t)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=s.a.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:r.a.util.merge(r.a.util.clone(a.a[o+"Axis3D"]),n||{},!0)})})),t.superClass.registerSubTypeDefaulter(e+"Axis3D",r.a.util.curry(i,e))}},function(e,t,i){var n=i(0),r=i.n(n),a={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},o=r.a.util.merge({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},a),s=r.a.util.merge({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},a),l=r.a.util.defaults({scale:!0,min:"dataMin",max:"dataMax"},s),u=r.a.util.defaults({logBase:10},s);u.scale=!0,t.a={categoryAxis3D:o,valueAxis3D:s,timeAxis3D:l,logAxis3D:u}},function(e,t,i){var n=i(13),r=n.createHashMap,a=n.isObject,o=n.map;function s(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}s.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&o(i,h);return new s({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var l=s.prototype;function u(e){return e._map||(e._map=r(e.categories))}function h(e){return a(e)&&null!=e.value?e.value:e+""}l.getOrdinal=function(e){return u(this).get(e)},l.parseAndCollect=function(e){var t,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=u(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var c=s;e.exports=c},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=r.a.extendComponentModel({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a),r.a.util.merge(l.prototype,s.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(45),s=i(25),l=i(2),u=i(81),h=i(30),c=i(162),d=i(164),f=i(63),p=i(46),g=l.a.firstNotNull;a.a.Shader.import(p.a),["x","y","z"].forEach((function(e){r.a.extendComponentView({type:e+"Axis3D"})}));var m={x:0,y:2,z:1};r.a.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(e,t){var i=new a.a.Material({shader:a.a.createShader("ecgl.color"),depthMask:!1,transparent:!0}),n=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});i.define("fragment","DOUBLE_SIDED"),i.define("both","VERTEX_COLOR"),this.groupGL=new a.a.Node,this._control=new o.a({zr:t.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map((function(e){var t=new c.a(e,n,i);return this.groupGL.add(t.rootNode),t}),this),this._axes=["x","y","z"].map((function(e){var t=new d.a(e,n);return this.groupGL.add(t.rootNode),t}),this);var r=t.getDevicePixelRatio();this._axisLabelSurface=new u.a({width:256,height:256,devicePixelRatio:r}),this._axisLabelSurface.onupdate=function(){t.getZr().refresh()},this._axisPointerLineMesh=new a.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:n,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new u.a({width:128,height:128,devicePixelRatio:r}),this._axisPointerLabelsMesh=new f.a({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new a.a.Node,this._sceneHelper=new h.a,this._sceneHelper.initLight(this._lightRoot)},render:function(e,t,i){this._model=e,this._api=i;var n=e.coordinateSystem;n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(n.viewGL);var a=e.getModel("viewControl");r.setFromViewControlModel(a,0),this._axisLabelSurface.clear(),r.off("update"),e.get("show")&&(this._faces.forEach((function(n){n.update(e,t,i)}),this),this._axes.forEach((function(t){t.update(e,this._axisLabelSurface,i)}),this)),r.on("update",this._onCameraChange.bind(this,e,i),this),this._sceneHelper.setScene(n.viewGL.scene),this._sceneHelper.updateLight(e),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._initMouseHandler(e)},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},showAxisPointer:function(e,t,i,n){this._doShowAxisPointer(),this._updateAxisPointer(n.value)},hideAxisPointer:function(e,t,i,n){this._doHideAxisPointer()},_initMouseHandler:function(e){var t=e.coordinateSystem.viewGL;e.get("show")&&e.get("axisPointer.show")?t.on("mousemove",this._updateAxisPointerOnMousePosition,this):t.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(e){if(!e.target){for(var t,i=this._model.coordinateSystem,n=i.viewGL,r=n.castRay(e.offsetX,e.offsetY,new a.a.Ray),o=0;o<this._faces.length;o++){var s=this._faces[o];if(!s.rootNode.invisible){s.plane.normal.dot(n.camera.worldTransform.z)<0&&s.plane.normal.negate();var l=r.intersectPlane(s.plane);if(l){var u=i.getAxis(s.faceInfo[0]),h=i.getAxis(s.faceInfo[1]),c=m[s.faceInfo[0]],d=m[s.faceInfo[1]];u.contain(l.array[c])&&h.contain(l.array[d])&&(t=l)}}}if(t){var f=i.pointToData(t.array,[],!0);this._updateAxisPointer(f),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(e,t){e.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var i=this._control;t.dispatchAction({type:"grid3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),center:i.getCenter(),from:this.uid,grid3DId:e.id})},_updateFaceVisibility:function(){var e=this._control.getCamera(),t=new a.a.Vector3;e.update();for(var i=0;i<this._faces.length/2;i++){for(var n=[],r=0;r<2;r++)this._faces[2*i+r].rootNode.getWorldPosition(t),t.transformMat4(e.viewMatrix),n[r]=t.z;var o=n[0]>n[1]?0:1,s=this._faces[2*i+o],l=this._faces[2*i+1-o];s.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),i=e.getAxis("y"),n=e.getAxis("z"),r=n.getExtentMax(),a=n.getExtentMin(),o=t.getExtentMin(),s=t.getExtentMax(),l=i.getExtentMax(),u=i.getExtentMin(),h=this._axes[0].rootNode,c=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?u:l,g=f[2].rootNode.invisible?r:a,m=f[0].rootNode.invisible?o:s,v=f[2].rootNode.invisible?r:a,y=f[0].rootNode.invisible?s:o,_=f[4].rootNode.invisible?u:l;h.rotation.identity(),c.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,h.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,c.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),h.position.set(0,g,p),c.position.set(m,v,0),d.position.set(y,0,_),h.update(),c.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new a.a.Vector4,new a.a.Vector4],i=new a.a.Vector4;this.groupGL.getWorldPosition(i),i.w=1,i.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),i.x/=i.w,i.y/=i.w,this._axes.forEach((function(n){var r=n.axisLineCoords;n.labelsMesh.geometry;for(var a=0;a<t.length;a++)t[a].setArray(r[a]),t[a].w=1,t[a].transformMat4(n.rootNode.worldTransform).transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),t[a].x/=t[a].w,t[a].y/=t[a].w;var o,s,l=t[1].x-t[0].x,u=t[1].y-t[0].y,h=(t[1].x+t[0].x)/2,c=(t[1].y+t[0].y)/2;Math.abs(u/l)<.5?(o="center",s=c>i.y?"bottom":"top"):(s="middle",o=h>i.x?"left":"right"),n.setSpriteAlign(o,s,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){var t=this._model.coordinateSystem,i=t.dataToPoint(e),n=this._axisPointerLineMesh.geometry,r=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function s(e){return l.a.firstNotNull(e.model.get("axisPointer.show"),r.get("show"))}function u(e){var t=e.model.getModel("axisPointer",r).getModel("lineStyle"),i=a.a.parseColor(t.get("color")),n=g(t.get("width"),1),o=g(t.get("opacity"),1);return i[3]*=o,{color:i,lineWidth:n}}n.convertToDynamicArray(!0);for(var h=0;h<this._faces.length;h++){var c=this._faces[h];if(!c.rootNode.invisible){for(var d=c.faceInfo,f=d[3]<0?t.getAxis(d[2]).getExtentMin():t.getAxis(d[2]).getExtentMax(),p=m[d[2]],v=0;v<2;v++){var y=d[v],_=d[1-v],x=t.getAxis(y),b=t.getAxis(_);if(s(x)){var w=m[y],T=m[_];(A=[0,0,0])[w]=(M=[0,0,0])[w]=i[w],A[p]=M[p]=f,A[T]=b.getExtentMin(),M[T]=b.getExtentMax();var S=u(x);n.addLine(A,M,S.color,S.lineWidth*o)}}if(s(t.getAxis(d[2]))){var M,A=i.slice();(M=i.slice())[p]=f,S=u(t.getAxis(d[2])),n.addLine(A,M,S.color,S.lineWidth*o)}}}n.convertToTypedArray(),this._updateAxisPointerLabelsMesh(e),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(e){var t=this._model,i=this._axisPointerLabelsMesh,n=this._axisPointerLabelsSurface,a=t.coordinateSystem,o=t.getModel("axisPointer");i.geometry.convertToDynamicArray(!0),n.clear();var s={x:"y",y:"x",z:"y"};this._axes.forEach((function(t,l){var u=a.getAxis(t.dim),h=u.model.getModel("axisPointer",o),c=h.getModel("label"),d=h.get("lineStyle.color");if(c.get("show")&&h.get("show")){var f=e[l],p=c.get("formatter"),g=u.scale.getLabel(f);if(null!=p)g=p(g,e);else if("interval"===u.scale.type||"log"===u.scale.type){var v=r.a.number.getPrecisionSafe(u.scale.getTicks()[0]);g=f.toFixed(v+2)}var y=c.getModel("textStyle"),_=y.get("color"),x=new r.a.graphic.Text;r.a.graphic.setTextStyle(x.style,y,{text:g,textFill:_||d,textAlign:"left",textVerticalAlign:"top"});var b=n.add(x),w=x.getBoundingRect(),T=this._api.getDevicePixelRatio(),S=t.rootNode.position.toArray();S[m[s[t.dim]]]+=(t.flipped?-1:1)*c.get("margin"),S[m[t.dim]]=u.dataToCoord(e[l]),i.geometry.addSprite(S,[w.width*T,w.height*T],b,t.textAlign,t.textVerticalAlign)}}),this),n.getZr().refreshImmediately(),i.material.set("uvScale",n.getCoordsScale()),i.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,i){var n=i(70),r=i(12),a=i(33),o=i(78),s=i(79),l=i(34),u=i(21),h=i(55);t.a={vec2:n.a,vec3:r.a,vec4:a.a,mat2:o.a,mat2d:s.a,mat3:l.a,mat4:u.a,quat:h.a}},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(25),l=i(163),u=o.a.firstNotNull,h={x:0,y:2,z:1};function c(e,t,i){this.rootNode=new a.a.Node;var n=new a.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),r=new a.a.Mesh({geometry:new l.a,material:i,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(r),this.rootNode.add(n),this.faceInfo=e,this.plane=new a.a.Plane,this.linesMesh=n,this.quadsMesh=r}c.prototype.update=function(e,t,i){var n=e.coordinateSystem,r=[n.getAxis(this.faceInfo[0]),n.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,o=this.quadsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0),this._updateSplitLines(a,r,e,i),this._udpateSplitAreas(o,r,e,i),a.convertToTypedArray(),o.convertToTypedArray();var s=n.getAxis(this.faceInfo[2]);!function(e,t,i,n){var r=[0,0,0],a=n<0?i.getExtentMin():i.getExtentMax();r[h[i.dim]]=a,e.position.setArray(r),e.rotation.identity(),t.distance=-Math.abs(a),t.normal.set(0,0,0),"x"===i.dim?(e.rotation.rotateY(n*Math.PI/2),t.normal.x=-n):"z"===i.dim?(e.rotation.rotateX(-n*Math.PI/2),t.normal.y=-n):(n>0&&e.rotation.rotateY(Math.PI),t.normal.z=-n)}(this.rootNode,this.plane,s,this.faceInfo[3])},c.prototype._updateSplitLines=function(e,t,i,n){var o=n.getDevicePixelRatio();t.forEach((function(n,s){var l=n.model,h=t[1-s].getExtent();if(!n.scale.isBlank()){var c=l.getModel("splitLine",i.getModel("splitLine"));if(c.get("show")){var d=c.getModel("lineStyle"),f=d.get("color"),p=u(d.get("opacity"),1),g=u(d.get("width"),1);f=r.a.util.isArray(f)?f:[f];for(var m=n.getTicksCoords({tickModel:c}),v=0,y=0;y<m.length;y++){var _=m[y].coord,x=a.a.parseColor(f[v%f.length]);x[3]*=p;var b=[0,0,0],w=[0,0,0];b[s]=w[s]=_,b[1-s]=h[0],w[1-s]=h[1],e.addLine(b,w,x,g*o),v++}}}}))},c.prototype._udpateSplitAreas=function(e,t,i,n){t.forEach((function(n,o){var s=n.model,l=t[1-o].getExtent();if(!n.scale.isBlank()){var h=s.getModel("splitArea",i.getModel("splitArea"));if(h.get("show")){var c=h.getModel("areaStyle"),d=c.get("color"),f=u(c.get("opacity"),1);d=r.a.util.isArray(d)?d:[d];for(var p=n.getTicksCoords({tickModel:h,clamp:!0}),g=0,m=[0,0,0],v=[0,0,0],y=0;y<p.length;y++){var _=p[y].coord,x=[0,0,0],b=[0,0,0];if(x[o]=b[o]=_,x[1-o]=l[0],b[1-o]=l[1],0!==y){var w=a.a.parseColor(d[g%d.length]);w[3]*=f,e.addQuad([m,x,b,v],w),m=x,v=b,g++}else m=x,v=b}}}}))},t.a=c},function(e,t,i){var n,r,a,o,s=i(15),l=i(0),u=i.n(l),h=i(38),c=i(6).a.vec3,d=s.a.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new s.a.Attribute("position","float",3,"POSITION"),normal:new s.a.Attribute("normal","float",3,"NORMAL"),color:new s.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,i=this.getQuadVertexCount()*e,n=this.getQuadTriangleCount()*e;this.vertexCount!==i&&(t.position.init(i),t.normal.init(i),t.color.init(i)),this.triangleCount!==n&&(this.indices=i>65535?new Uint32Array(3*n):new Uint16Array(3*n))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:(n=c.create(),r=c.create(),a=c.create(),o=[0,3,1,3,2,1],function(e,t){var i=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;c.sub(n,e[1],e[0]),c.sub(r,e[2],e[1]),c.cross(a,n,r),c.normalize(a,a);for(var u=0;u<4;u++)i.set(this._vertexOffset+u,e[u]),l.set(this._vertexOffset+u,t),s.set(this._vertexOffset+u,a);var h=3*this._faceOffset;for(u=0;u<6;u++)this.indices[h+u]=o[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2})});u.a.util.defaults(d.prototype,h.a),t.a=d},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(25),s=i(2),l=i(63),u=s.a.firstNotNull,h={x:0,y:2,z:1};function c(e,t){var i=new a.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,renderOrder:2}),n=new l.a;n.material.depthMask=!1;var r=new a.a.Node;r.add(i),r.add(n),this.rootNode=r,this.dim=e,this.linesMesh=i,this.labelsMesh=n,this.axisLineCoords=null,this.labelElements=[]}var d={x:"y",y:"x",z:"y"};c.prototype.update=function(e,t,i){var n=e.coordinateSystem.getAxis(this.dim),o=this.linesMesh.geometry,s=this.labelsMesh.geometry;o.convertToDynamicArray(!0),s.convertToDynamicArray(!0);var l=n.model,c=n.getExtent(),f=i.getDevicePixelRatio(),p=l.getModel("axisLine",e.getModel("axisLine")),g=l.getModel("axisTick",e.getModel("axisTick")),m=l.getModel("axisLabel",e.getModel("axisLabel")),v=p.get("lineStyle.color");if(p.get("show")){var y=p.getModel("lineStyle"),_=[0,0,0];(D=[0,0,0])[E=h[n.dim]]=c[0],_[E]=c[1],this.axisLineCoords=[D,_];var x=a.a.parseColor(v),b=u(y.get("width"),1),w=u(y.get("opacity"),1);x[3]*=w,o.addLine(D,_,x,b*f)}if(g.get("show")){var T=g.getModel("lineStyle"),S=a.a.parseColor(u(T.get("color"),v));b=u(T.get("width"),1),S[3]*=u(T.get("opacity"),1);for(var M=n.getTicksCoords(),A=g.get("length"),I=0;I<M.length;I++){var C=M[I].coord,D=[0,0,0],E=(_=[0,0,0],h[n.dim]),L=h[d[n.dim]];D[E]=_[E]=C,_[L]=A,o.addLine(D,_,S,b*f)}}if(this.labelElements=[],f=i.getDevicePixelRatio(),m.get("show")){M=n.getTicksCoords();var P=l.get("data"),N=m.get("margin"),R=n.getViewLabels();for(I=0;I<R.length;I++){var O=R[I].tickValue,k=R[I].formattedLabel,z=R[I].rawLabel,B=(C=n.dataToCoord(O),[0,0,0]);E=h[n.dim],L=h[d[n.dim]],B[E]=B[E]=C,B[L]=N;var F=m;P&&P[O]&&P[O].textStyle&&(F=new r.a.Model(P[O].textStyle,m,l.ecModel));var V=u(F.get("color"),v),G=new r.a.graphic.Text;r.a.graphic.setTextStyle(G.style,F,{text:k,textFill:"function"==typeof V?V("category"===n.type?z:"value"===n.type?O+"":O,I):V,textVerticalAlign:"top",textAlign:"left"});var H=t.add(G),U=G.getBoundingRect();s.addSprite(B,[U.width*f,U.height*f],H),this.labelElements.push(G)}}if(l.get("name")){var W=l.getModel("nameTextStyle"),j=(B=[0,0,0],E=h[n.dim],L=h[d[n.dim]],u(W.get("color"),v)),X=W.get("borderColor");b=W.get("borderWidth"),B[E]=B[E]=(c[0]+c[1])/2,B[L]=l.get("nameGap"),G=new r.a.graphic.Text,r.a.graphic.setTextStyle(G.style,W,{text:l.get("name"),textFill:j,textStroke:X,lineWidth:b}),H=t.add(G),U=G.getBoundingRect(),s.addSprite(B,[U.width*f,U.height*f],H),G.__idx=this.labelElements.length,this.nameLabelElement=G}this.labelsMesh.material.set("textureAtlas",t.getTexture()),this.labelsMesh.material.set("uvScale",t.getCoordsScale()),o.convertToTypedArray(),s.convertToTypedArray()},c.prototype.setSpriteAlign=function(e,t,i){for(var n=i.getDevicePixelRatio(),r=this.labelsMesh.geometry,a=0;a<this.labelElements.length;a++){var o=this.labelElements[a].getBoundingRect();r.setSpriteAlign(a,[o.width*n,o.height*n],e,t)}var s=this.nameLabelElement;s&&(o=s.getBoundingRect(),r.setSpriteAlign(s.__idx,[o.width*n,o.height*n],e,t),r.dirty()),this.textAlign=e,this.textVerticalAlign=t},t.a=c},function(e,t,i){var n=i(0),r=i.n(n),a=i(15),o=i(38),s=[0,1,2,0,2,3],l=a.a.extend((function(){return{attributes:{position:new a.a.Attribute("position","float",3,"POSITION"),texcoord:new a.a.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new a.a.Attribute("offset","float",2),color:new a.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(e){this._spriteCount=e;var t=4*e,i=2*e;this.vertexCount!==t&&(this.attributes.position.init(t),this.attributes.offset.init(t),this.attributes.color.init(t)),this.triangleCount!==i&&(this.indices=t>65535?new Uint32Array(3*i):new Uint16Array(3*i))},setSpriteAlign:function(e,t,i,n,r){var a,o,s,l;switch(null==i&&(i="left"),null==n&&(n="top"),r=r||0,i){case"left":a=r,s=t[0]+r;break;case"center":case"middle":a=-t[0]/2,s=t[0]/2;break;case"right":a=-t[0]-r,s=-r}switch(n){case"bottom":o=r,l=t[1]+r;break;case"middle":o=-t[1]/2,l=t[1]/2;break;case"top":o=-t[1]-r,l=-r}var u=4*e,h=this.attributes.offset;h.set(u,[a,l]),h.set(u+1,[s,l]),h.set(u+2,[s,o]),h.set(u+3,[a,o])},addSprite:function(e,t,i,n,r,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,i,n,r,a);for(var l=0;l<s.length;l++)this.indices[3*this._faceOffset+l]=s[l]+o;return this._faceOffset+=2,this._vertexOffset+=4,o/4},setSprite:function(e,t,i,n,r,a,o){for(var s=4*e,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,t);var h=l.texcoord;h.set(s,[n[0][0],n[0][1]]),h.set(s+1,[n[1][0],n[0][1]]),h.set(s+2,[n[1][0],n[1][1]]),h.set(s+3,[n[0][0],n[1][1]]),this.setSpriteAlign(e,i,r,a,o)}});r.a.util.defaults(l.prototype,o.a),t.a=l},function(e,t,i){t.a="@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end"},function(e,t,i){var n=i(168),r=i(170),a=i(0),o=i.n(a),s=i(47),l=i.n(s),u=i(22),h=i(2);function c(e,t){var i=e.getBoxLayoutParams(),n=l.a.getLayoutRect(i,{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio());var r=e.get("boxWidth"),a=e.get("boxHeight"),o=e.get("boxDepth");["x","y","z"].forEach((function(t){if(!this.getAxis(t))throw new Error("Grid"+e.id+" don't have "+t+"Axis")}),this),this.getAxis("x").setExtent(-r/2,r/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-a/2,a/2),this.size=[r,a,o]}function d(e,t){var i={};e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();["x","y","z"].forEach((function(e){t.mapDimension(e,!0).forEach((function(n){var r,a;r=e,a=t.getDataExtent(n,!0),i[r]=i[r]||[1/0,-1/0],i[r][0]=Math.min(a[0],i[r][0]),i[r][1]=Math.max(a[1],i[r][1])}))}))}}),this),["xAxis3D","yAxis3D","zAxis3D"].forEach((function(t){e.eachComponent(t,(function(e){var n=t.charAt(0),a=e.getReferringComponents("grid3D")[0],s=a.coordinateSystem;if(s===this){var l=s.getAxis(n);if(l)console.warn("Can't have two %s in one grid3D",t);else{var u=o.a.helper.createScale(i[n]||[1/0,-1/0],e);(l=new r.a(n,u)).type=e.get("type");var h="category"===l.type;l.onBand=h&&e.get("boundaryGap"),l.inverse=e.get("inverse"),e.axis=l,l.model=e,l.getLabelModel=function(){return e.getModel("axisLabel",a.getModel("axisLabel"))},l.getTickModel=function(){return e.getModel("axisTick",a.getModel("axisTick"))},s.addAxis(l)}}}),this)}),this),this.resize(this.model,t)}var f={dimensions:n.a.prototype.dimensions,create:function(e,t){var i=[];e.eachComponent("grid3D",(function(e){e.__viewGL=e.__viewGL||new u.a;var t=new n.a;t.model=e,t.viewGL=e.__viewGL,e.coordinateSystem=t,i.push(t),t.resize=c,t.update=d}));var r=["xAxis3D","yAxis3D","zAxis3D"];return e.eachSeries((function(t){if("cartesian3D"===t.get("coordinateSystem")){if(null==(n=t.getReferringComponents("grid3D")[0])){var i=function(e,t){return r.map((function(i){var n=e.getReferringComponents(i)[0];if(null==n&&(n=t.getComponent(i)),!n)throw new Error(i+' "'+h.a.firstNotNull(e.get(i+"Index"),e.get(i+"Id"),0)+'" not found');return n}))}(t,e),n=i[0].getCoordSysModel();i.forEach((function(e){var t=e.getCoordSysModel();if(!t)throw new Error('grid3D "'+h.a.firstNotNull(e.get("gridIndex"),e.get("gridId"),0)+'" not found');if(t!==n)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")}))}var a=n.coordinateSystem;t.coordinateSystem=a}})),i}};o.a.registerCoordinateSystem("grid3D",f)},function(e,t,i){var n=i(0),r=i.n(n),a=i(169),o=i.n(a);function s(e){o.a.call(this,e),this.size=[0,0,0]}s.prototype={constructor:s,type:"cartesian3D",dimensions:["x","y","z"],model:null,containPoint:function(e){return this.getAxis("x").contain(e[0])&&this.getAxis("y").contain(e[2])&&this.getAxis("z").contain(e[1])},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])&&this.getAxis("z").containData(e[2])},dataToPoint:function(e,t,i){return(t=t||[])[0]=this.getAxis("x").dataToCoord(e[0],i),t[2]=this.getAxis("y").dataToCoord(e[1],i),t[1]=this.getAxis("z").dataToCoord(e[2],i),t},pointToData:function(e,t,i){return(t=t||[])[0]=this.getAxis("x").coordToData(e[0],i),t[1]=this.getAxis("y").coordToData(e[2],i),t[2]=this.getAxis("z").coordToData(e[1],i),t}},r.a.util.inherits(s,o.a),t.a=s},function(e,t,i){var n=i(13);function r(e){return this._axes[e]}var a=function(e){this._axes={},this._dimList=[],this.name=e||""};a.prototype={constructor:a,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return n.map(this._dimList,r,this)},getAxesByScale:function(e){return e=e.toLowerCase(),n.filter(this.getAxes(),(function(t){return t.scale.type===e}))},addAxis:function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},dataToCoord:function(e){return this._dataCoordConvert(e,"dataToCoord")},coordToData:function(e){return this._dataCoordConvert(e,"coordToData")},_dataCoordConvert:function(e,t){for(var i=this._dimList,n=e instanceof Array?[]:{},r=0;r<i.length;r++){var a=i[r],o=this._axes[a];n[a]=o[t](e[a])}return n}};var o=a;e.exports=o},function(e,t,i){var n=i(0),r=i.n(n);function a(e,t,i){r.a.Axis.call(this,e,t,i)}a.prototype={constructor:a,getExtentMin:function(){var e=this._extent;return Math.min(e[0],e[1])},getExtentMax:function(){var e=this._extent;return Math.max(e[0],e[1])},calculateCategoryInterval:function(){return Math.floor(this.scale.count()/8)}},r.a.util.inherits(a,r.a.Axis),t.a=a},function(e,t,i){var n=i(13),r=i(172),a=i(85),o=n.normalizeCssArray,s=/([&<>"'])/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"};function u(e){return null==e?"":(e+"").replace(s,(function(e,t){return l[t]}))}var h=["a","b","c","d","e","f","g"],c=function(e,t){return"{"+e+(null==t?"":t)+"}"};function d(e,t){return"0000".substr(0,t-(e+="").length)+e}var f=r.truncateText,p=r.getBoundingRect;t.addCommas=function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")},t.toCamelCase=function(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e},t.normalizeCssArray=o,t.encodeHTML=u,t.formatTpl=function(e,t,i){n.isArray(t)||(t=[t]);var r=t.length;if(!r)return"";for(var a=t[0].$vars||[],o=0;o<a.length;o++){var s=h[o];e=e.replace(c(s),c(s,0))}for(var l=0;l<r;l++)for(var d=0;d<a.length;d++){var f=t[l][a[d]];e=e.replace(c(h[d],l),i?u(f):f)}return e},t.formatTplSimple=function(e,t,i){return n.each(t,(function(t,n){e=e.replace("{"+n+"}",i?u(t):t)})),e},t.getTooltipMarker=function(e,t){var i=(e=n.isString(e)?{color:e,extraCssText:t}:e||{}).color,r=e.type;return t=e.extraCssText,i?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+u(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+u(i)+";"+(t||"")+'"></span>':""},t.formatTime=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=a.parseDate(t),r=i?"UTC":"",o=n["get"+r+"FullYear"](),s=n["get"+r+"Month"]()+1,l=n["get"+r+"Date"](),u=n["get"+r+"Hours"](),h=n["get"+r+"Minutes"](),c=n["get"+r+"Seconds"](),f=n["get"+r+"Milliseconds"]();return e=e.replace("MM",d(s,2)).replace("M",s).replace("yyyy",o).replace("yy",o%100).replace("dd",d(l,2)).replace("d",l).replace("hh",d(u,2)).replace("h",u).replace("mm",d(h,2)).replace("m",h).replace("ss",d(c,2)).replace("s",c).replace("SSS",d(f,3))},t.capitalFirst=function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},t.truncateText=f,t.getTextRect=p},function(e,t,i){var n=i(82),r=i(173),a=i(13),o=a.getContext,s=a.extend,l=a.retrieve2,u=a.retrieve3,h=a.trim,c={},d=0,f=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,p="12px sans-serif",g={};function m(e,t){var i=e+":"+(t=t||p);if(c[i])return c[i];for(var n=(e+"").split("\n"),r=0,a=0,o=n.length;a<o;a++)r=Math.max(S(n[a],t).width,r);return d>5e3&&(d=0,c={}),d++,c[i]=r,r}function v(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function y(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function _(e,t,i,n,r){if(!t)return"";var a=(e+"").split("\n");r=x(t,i,n,r);for(var o=0,s=a.length;o<s;o++)a[o]=b(a[o],r);return a.join("\n")}function x(e,t,i,n){(n=s({},n)).font=t,i=l(i,"..."),n.maxIterations=l(n.maxIterations,2);var r=n.minChar=l(n.minChar,0);n.cnCharWidth=m("国",t);var a=n.ascCharWidth=m("a",t);n.placeholder=l(n.placeholder,"");for(var o=e=Math.max(0,e-1),u=0;u<r&&o>=a;u++)o-=a;var h=m(i);return h>o&&(i="",h=0),o=e-h,n.ellipsis=i,n.ellipsisWidth=h,n.contentWidth=o,n.containerWidth=e,n}function b(e,t){var i=t.containerWidth,n=t.font,r=t.contentWidth;if(!i)return"";var a=m(e,n);if(a<=i)return e;for(var o=0;;o++){if(a<=r||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?w(e,r,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(e.length*r/a):0;a=m(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function w(e,t,i,n){for(var r=0,a=0,o=e.length;a<o&&r<t;a++){var s=e.charCodeAt(a);r+=0<=s&&s<=127?i:n}return a}function T(e){return m("国",e)}function S(e,t){return g.measureText(e,t)}function M(e,t,i,n){null!=e&&(e+="");var r=T(t),a=e?e.split("\n"):[],o=a.length*r,s=o;if(i&&(s+=i[0]+i[2]),e&&n){var l=n.outerHeight,u=n.outerWidth;if(null!=l&&s>l)e="",a=[];else if(null!=u)for(var h=x(u-(i?i[1]+i[3]:0),t,n.ellipsis,{minChar:n.minChar,placeholder:n.placeholder}),c=0,d=a.length;c<d;c++)a[c]=b(a[c],h)}return{lines:a,height:o,outerHeight:s,lineHeight:r}}function A(e,t){var i={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return i;for(var n,a=f.lastIndex=0;null!=(n=f.exec(e));){var o=n.index;o>a&&I(i,e.substring(a,o)),I(i,n[2],n[1]),a=f.lastIndex}a<e.length&&I(i,e.substring(a,e.length));var s=i.lines,h=0,c=0,d=[],p=t.textPadding,g=t.truncate,v=g&&g.outerWidth,y=g&&g.outerHeight;p&&(null!=v&&(v-=p[1]+p[3]),null!=y&&(y-=p[0]+p[2]));for(var x=0;x<s.length;x++){for(var b=s[x],w=0,S=0,M=0;M<b.tokens.length;M++){var A=(z=b.tokens[M]).styleName&&t.rich[z.styleName]||{},C=z.textPadding=A.textPadding,D=z.font=A.font||t.font,E=z.textHeight=l(A.textHeight,T(D));if(C&&(E+=C[0]+C[2]),z.height=E,z.lineHeight=u(A.textLineHeight,t.textLineHeight,E),z.textAlign=A&&A.textAlign||t.textAlign,z.textVerticalAlign=A&&A.textVerticalAlign||"middle",null!=y&&h+z.lineHeight>y)return{lines:[],width:0,height:0};z.textWidth=m(z.text,D);var L=A.textWidth,P=null==L||"auto"===L;if("string"==typeof L&&"%"===L.charAt(L.length-1))z.percentWidth=L,d.push(z),L=0;else{if(P){L=z.textWidth;var N=A.textBackgroundColor,R=N&&N.image;R&&(R=r.findExistImage(R),r.isImageReady(R)&&(L=Math.max(L,R.width*E/R.height)))}var O=C?C[1]+C[3]:0;L+=O;var k=null!=v?v-S:null;null!=k&&k<L&&(!P||k<O?(z.text="",z.textWidth=L=0):(z.text=_(z.text,k-O,D,g.ellipsis,{minChar:g.minChar}),z.textWidth=m(z.text,D),L=z.textWidth+O))}S+=z.width=L,A&&(w=Math.max(w,z.lineHeight))}b.width=S,b.lineHeight=w,h+=w,c=Math.max(c,S)}for(i.outerWidth=i.width=l(t.textWidth,c),i.outerHeight=i.height=l(t.textHeight,h),p&&(i.outerWidth+=p[1]+p[3],i.outerHeight+=p[0]+p[2]),x=0;x<d.length;x++){var z,B=(z=d[x]).percentWidth;z.width=parseInt(B,10)/100*c}return i}function I(e,t,i){for(var n=""===t,r=t.split("\n"),a=e.lines,o=0;o<r.length;o++){var s=r[o],l={styleName:i,text:s,isLineHolder:!s&&!n};if(o)a.push({tokens:[l]});else{var u=(a[a.length-1]||(a[0]={tokens:[]})).tokens,h=u.length;1===h&&u[0].isLineHolder?u[0]=l:(s||!h||n)&&u.push(l)}}}g.measureText=function(e,t){var i=o();return i.font=t||p,i.measureText(e)},t.DEFAULT_FONT=p,t.$override=function(e,t){g[e]=t},t.getWidth=m,t.getBoundingRect=function(e,t,i,r,a,o,s){return o?function(e,t,i,r,a,o,s){var l=A(e,{rich:o,truncate:s,font:t,textAlign:i,textPadding:a}),u=l.outerWidth,h=l.outerHeight,c=v(0,u,i),d=y(0,h,r);return new n(c,d,u,h)}(e,t,i,r,a,o,s):function(e,t,i,r,a,o){var s=M(e,t,a,o),l=m(e,t);a&&(l+=a[1]+a[3]);var u=s.outerHeight,h=v(0,l,i),c=y(0,u,r),d=new n(h,c,l,u);return d.lineHeight=s.lineHeight,d}(e,t,i,r,a,s)},t.adjustTextX=v,t.adjustTextY=y,t.adjustTextPositionOnRect=function(e,t,i){var n=t.x,r=t.y,a=t.height,o=t.width,s=a/2,l="left",u="top";switch(e){case"left":n-=i,r+=s,l="right",u="middle";break;case"right":n+=i+o,r+=s,u="middle";break;case"top":n+=o/2,r-=i,l="center",u="bottom";break;case"bottom":n+=o/2,r+=a+i,l="center";break;case"inside":n+=o/2,r+=s,l="center",u="middle";break;case"insideLeft":n+=i,r+=s,u="middle";break;case"insideRight":n+=o-i,r+=s,l="right",u="middle";break;case"insideTop":n+=o/2,r+=i,l="center";break;case"insideBottom":n+=o/2,r+=a-i,l="center",u="bottom";break;case"insideTopLeft":n+=i,r+=i;break;case"insideTopRight":n+=o-i,r+=i,l="right";break;case"insideBottomLeft":n+=i,r+=a-i,u="bottom";break;case"insideBottomRight":n+=o-i,r+=a-i,l="right",u="bottom"}return{x:n,y:r,textAlign:l,textVerticalAlign:u}},t.truncateText=_,t.getLineHeight=T,t.measureText=S,t.parsePlainText=M,t.parseRichText=A,t.makeFont=function(e){var t=(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ");return t&&h(t)||e.textFont||e.font}},function(e,t,i){var n=new(i(60))(50);function r(){var e=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var i=e.pending[t],n=i.cb;n&&n(this,i.cbPayload),i.hostEl.dirty()}e.pending.length=0}function a(e){return e&&e.width&&e.height}t.findExistImage=function(e){if("string"==typeof e){var t=n.get(e);return t&&t.image}return e},t.createOrUpdateImage=function(e,t,i,o,s){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!i)return t;var l=n.get(e),u={hostEl:i,cb:o,cbPayload:s};return l?!a(t=l.image)&&l.pending.push(u):(!t&&(t=new Image),t.onload=r,n.put(e,t.__cachedImgObj={image:t,pending:[u]}),t.src=t.__zrImageSrc=e),t}return e}return t},t.isImageReady=a},function(e,t,i){var n=i(7),r=i(11),a=i(3),o=i(18),s=i(59),l=i(9),u=i(52),h=i(8),c=i(19),d=i(10),f=i(4),p=i(5),g=i(27),m=i(41),v=i(37),y=i(16),_=i(86),x=i(21),b=i(175),w=["px","nx","py","ny","pz","nz"];function T(e,t,i){return"alphaMap"===i?e.material.get("diffuseMap"):"alphaCutoff"===i?e.material.isDefined("fragment","ALPHA_TEST")&&e.material.get("diffuseMap")&&e.material.get("alphaCutoff")||0:t.get(i)}function S(e,t){var i=e.material,n=t.material;return i.get("diffuseMap")!==n.get("diffuseMap")||(i.get("alphaCutoff")||0)!==(n.get("alphaCutoff")||0)}h.a.import(b.a);var M,A,I,C,D,E,L,P=n.a.extend((function(){return{softShadow:P.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new d.a,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new _.a}}),(function(){this._gaussianPassH=new y.a({fragment:h.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new y.a({fragment:h.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new y.a({fragment:h.a.source("clay.sm.debug_depth")})}),{render:function(e,t,i,n){i||(i=t.getMainCamera()),this.trigger("beforerender",this,e,t,i),this._renderShadowPass(e,t,i,n),this.trigger("afterrender",this,e,t,i)},renderDebug:function(e,t){e.saveClear();var i=e.viewport,n=0,r=t||i.width/4,a=r;for(var o in this.softShadow===P.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[o];e.setViewport(n,0,r*s.width/s.height,a),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(e),n+=r*s.width/s.height}e.setViewport(i),e.restoreClear()},_updateReceivers:function(e,t){if(t.receiveShadow?(this._receivers.push(t),t.material.set("shadowEnabled",1),t.material.set("pcfKernel",this.kernelPCF)):t.material.set("shadowEnabled",0),this.softShadow===P.VSM)t.material.define("fragment","USE_VSM"),t.material.undefine("fragment","PCF_KERNEL_SIZE");else{t.material.undefine("fragment","USE_VSM");var i=this.kernelPCF;i&&i.length?t.material.define("fragment","PCF_KERNEL_SIZE",i.length/2):t.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(e,t){var i=this;t.traverse((function(t){t.isRenderable()&&i._updateReceivers(e,t)}));for(var n=0;n<t.lights.length;n++){var r=t.lights[n];r.castShadow&&!r.invisible&&this._lightsCastShadow.push(r)}},_renderShadowPass:function(e,t,i,n){for(var r in this._shadowMapNumber)this._shadowMapNumber[r]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var a=e.gl;if(n||t.update(),i&&i.update(),t.updateLights(),this._update(e,t),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,a.enable(a.DEPTH_TEST),a.depthMask(!0),a.disable(a.BLEND),a.clearColor(1,1,1,1);for(var o,s=[],l=[],u=[],h=[],c=[],d=[],f=0;f<this._lightsCastShadow.length;f++){var p=this._lightsCastShadow[f];if("DIRECTIONAL_LIGHT"===p.type){if(o){console.warn("Only one direectional light supported with shadow cascade");continue}if(p.shadowCascade>4){console.warn("Support at most 4 cascade");continue}p.shadowCascade>1&&(o=p),this.renderDirectionalLightShadow(e,t,i,p,c,h,u)}else"SPOT_LIGHT"===p.type?this.renderSpotLightShadow(e,t,p,l,s):"POINT_LIGHT"===p.type&&this.renderPointLightShadow(e,t,p,d);this._shadowMapNumber[p.type]++}for(var g in this._shadowMapNumber){var m=this._shadowMapNumber[g],v=g+"_SHADOWMAP_COUNT";for(f=0;f<this._receivers.length;f++)(y=this._receivers[f].material).fragmentDefines[v]!==m&&(m>0?y.define("fragment",v,m):y.isDefined("fragment",v)&&y.undefine("fragment",v))}for(f=0;f<this._receivers.length;f++){var y=this._receivers[f].material;o?y.define("fragment","SHADOW_CASCADE",o.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var _=t.shadowUniforms;if(u.length>0){var x=u.map(S);if(_.directionalLightShadowMaps={value:u,type:"tv"},_.directionalLightMatrices={value:h,type:"m4v"},_.directionalLightShadowMapSizes={value:x,type:"1fv"},o){var b=c.slice(),w=c.slice();b.pop(),w.shift(),b.reverse(),w.reverse(),h.reverse(),_.shadowCascadeClipsNear={value:b,type:"1fv"},_.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var T=s.map(S);(_=t.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},_.spotLightMatrices={value:l,type:"m4v"},_.spotLightShadowMapSizes={value:T,type:"1fv"}}d.length>0&&(_.pointLightShadowMaps={value:d,type:"tv"})}function S(e){return e.height}},renderDirectionalLightShadow:(M=new s.a,A=new l.a,I=new o.a,C=new l.a,D=new l.a,E=new l.a,L=new l.a,function(e,t,i,n,r,a,o){var s=this._getDepthMaterial(n),h={getMaterial:function(e){return e.shadowDepthMaterial||s},isMaterialChanged:S,getUniform:T,ifRender:function(e){return e.castShadow},sortCompare:u.a.opaqueSortCompare};if(!t.viewBoundingBoxLastFrame.isFinite()){var c=t.getBoundingBox();t.viewBoundingBoxLastFrame.copy(c).applyTransform(i.viewMatrix)}var d=Math.min(-t.viewBoundingBoxLastFrame.min.z,i.far),f=Math.max(-t.viewBoundingBoxLastFrame.max.z,i.near),p=this._getDirectionalLightCamera(n,t,i),g=E.array;L.copy(p.projectionMatrix),x.a.invert(D.array,p.worldTransform.array),x.a.multiply(D.array,D.array,i.worldTransform.array),x.a.multiply(g,L.array,D.array);for(var v=[],y=i instanceof m.a,_=(i.near+i.far)/(i.near-i.far),b=2*i.near*i.far/(i.near-i.far),w=0;w<=n.shadowCascade;w++){var N=f*Math.pow(d/f,w/n.shadowCascade),R=f+(d-f)*w/n.shadowCascade,O=N*n.cascadeSplitLogFactor+R*(1-n.cascadeSplitLogFactor);v.push(O),r.push(-(-O*_+b)/-O)}var k=this._getTexture(n,n.shadowCascade);o.push(k);var z=e.viewport,B=e.gl;for(this._frameBuffer.attach(k),this._frameBuffer.bind(e),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT),w=0;w<n.shadowCascade;w++){var F=v[w],V=v[w+1];y?x.a.perspective(A.array,i.fov/180*Math.PI,i.aspect,F,V):x.a.ortho(A.array,i.left,i.right,i.bottom,i.top,F,V),M.setFromProjection(A),M.getTransformedBoundingBox(I,D),I.applyProjection(L);var G=I.min.array,H=I.max.array;G[0]=Math.max(G[0],-1),G[1]=Math.max(G[1],-1),H[0]=Math.min(H[0],1),H[1]=Math.min(H[1],1),C.ortho(G[0],H[0],G[1],H[1],1,-1),p.projectionMatrix.multiplyLeft(C);var U=n.shadowResolution||512;e.setViewport((n.shadowCascade-w-1)*U,0,U,U,1);var W=t.updateRenderList(p);e.renderPass(W.opaque,p,h),this.softShadow===P.VSM&&this._gaussianFilter(e,k,k.width);var j=new l.a;j.copy(p.viewMatrix).multiplyLeft(p.projectionMatrix),a.push(j.array),p.projectionMatrix.copy(L)}this._frameBuffer.unbind(e),e.setViewport(z)}),renderSpotLightShadow:function(e,t,i,n,r){var a=this._getTexture(i),o=this._getSpotLightCamera(i),s=e.gl;this._frameBuffer.attach(a),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var h=this._getDepthMaterial(i),c={getMaterial:function(e){return e.shadowDepthMaterial||h},isMaterialChanged:S,getUniform:T,ifRender:function(e){return e.castShadow},sortCompare:u.a.opaqueSortCompare},d=t.updateRenderList(o);e.renderPass(d.opaque,o,c),this._frameBuffer.unbind(e),this.softShadow===P.VSM&&this._gaussianFilter(e,a,a.width);var f=new l.a;f.copy(o.worldTransform).invert().multiplyLeft(o.projectionMatrix),r.push(a),n.push(f.array)},renderPointLightShadow:function(e,t,i,n){var r=this._getTexture(i),s=e.gl;n.push(r);var l=this._getDepthMaterial(i),h={getMaterial:function(e){return e.shadowDepthMaterial||l},getUniform:T,sortCompare:u.a.opaqueSortCompare},c={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},d=new o.a,f=i.getWorldPosition().array,p=new o.a,g=i.range;p.min.setArray(f),p.max.setArray(f);var m=new a.a(g,g,g);p.max.add(m),p.min.sub(m);var v={px:!1,py:!1,pz:!1,nx:!1,ny:!1,nz:!1};t.traverse((function(e){if(e.isRenderable()&&e.castShadow){var t=e.geometry;if(!t.boundingBox){for(var i=0;i<w.length;i++)c[w[i]].push(e);return}if(d.transformFrom(t.boundingBox,e.worldTransform),!d.intersectBoundingBox(p))return;for(d.updateVertices(),i=0;i<w.length;i++)v[w[i]]=!1;for(i=0;i<8;i++){var n=d.vertices[i],r=n[0]-f[0],a=n[1]-f[1],o=n[2]-f[2],s=Math.abs(r),l=Math.abs(a),u=Math.abs(o);s>l?s>u?v[r>0?"px":"nx"]=!0:v[o>0?"pz":"nz"]=!0:l>u?v[a>0?"py":"ny"]=!0:v[o>0?"pz":"nz"]=!0}for(i=0;i<w.length;i++)v[w[i]]&&c[w[i]].push(e)}}));for(var y=0;y<6;y++){var _=w[y],x=this._getPointLightCamera(i,_);this._frameBuffer.attach(r,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+y),this._frameBuffer.bind(e),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),e.renderPass(c[_],x,h)}this._frameBuffer.unbind(e)},_getDepthMaterial:function(e){var t=this._lightMaterials[e.__uid__],i="POINT_LIGHT"===e.type;if(!t){var n=i?"clay.sm.distance.":"clay.sm.depth.";t=new c.a({precision:this.precision,shader:new h.a(h.a.source(n+"vertex"),h.a.source(n+"fragment"))}),this._lightMaterials[e.__uid__]=t}return null!=e.shadowSlopeScale&&t.setUniform("slopeScale",e.shadowSlopeScale),null!=e.shadowBias&&t.setUniform("bias",e.shadowBias),this.softShadow===P.VSM?t.define("fragment","USE_VSM"):t.undefine("fragment","USE_VSM"),i&&(t.set("lightPosition",e.getWorldPosition().array),t.set("range",e.range)),t},_gaussianFilter:function(e,t,i){var n={width:i,height:i,type:f.a.FLOAT},r=this._texturePool.get(n);this._frameBuffer.attach(r),this._frameBuffer.bind(e),this._gaussianPassH.setUniform("texture",t),this._gaussianPassH.setUniform("textureWidth",i),this._gaussianPassH.render(e),this._frameBuffer.attach(t),this._gaussianPassV.setUniform("texture",r),this._gaussianPassV.setUniform("textureHeight",i),this._gaussianPassV.render(e),this._frameBuffer.unbind(e),this._texturePool.put(r)},_getTexture:function(e,t){var i=e.__uid__,n=this._textures[i],a=e.shadowResolution||512;return t=t||1,n||((n="POINT_LIGHT"===e.type?new g.a:new p.a).width=a*t,n.height=a,this.softShadow===P.VSM?(n.type=f.a.FLOAT,n.anisotropic=4):(n.minFilter=r.a.NEAREST,n.magFilter=r.a.NEAREST,n.useMipmap=!1),this._textures[i]=n),n},_getPointLightCamera:function(e,t){this._lightCameras.point||(this._lightCameras.point={px:new m.a,nx:new m.a,py:new m.a,ny:new m.a,pz:new m.a,nz:new m.a});var i=this._lightCameras.point[t];switch(i.far=e.range,i.fov=90,i.position.set(0,0,0),t){case"px":i.lookAt(a.a.POSITIVE_X,a.a.NEGATIVE_Y);break;case"nx":i.lookAt(a.a.NEGATIVE_X,a.a.NEGATIVE_Y);break;case"py":i.lookAt(a.a.POSITIVE_Y,a.a.POSITIVE_Z);break;case"ny":i.lookAt(a.a.NEGATIVE_Y,a.a.NEGATIVE_Z);break;case"pz":i.lookAt(a.a.POSITIVE_Z,a.a.NEGATIVE_Y);break;case"nz":i.lookAt(a.a.NEGATIVE_Z,a.a.NEGATIVE_Y)}return e.getWorldPosition(i.position),i.update(),i},_getDirectionalLightCamera:function(){var e=new l.a,t=new o.a,i=new o.a;return function(n,r,a){this._lightCameras.directional||(this._lightCameras.directional=new v.a);var o=this._lightCameras.directional;t.copy(r.viewBoundingBoxLastFrame),t.intersection(a.frustum.boundingBox),o.position.copy(t.min).add(t.max).scale(.5).transformMat4(a.worldTransform),o.rotation.copy(n.rotation),o.scale.copy(n.scale),o.updateWorldTransform(),l.a.invert(e,o.worldTransform),l.a.multiply(e,e,a.worldTransform),i.copy(t).applyTransform(e);var s=i.min.array,u=i.max.array;return o.position.set((s[0]+u[0])/2,(s[1]+u[1])/2,u[2]).transformMat4(o.worldTransform),o.near=0,o.far=-s[2]+u[2],isNaN(this.lightFrustumBias)?o.far*=4:o.far+=this.lightFrustumBias,o.left=s[0],o.right=u[0],o.top=u[1],o.bottom=s[1],o.update(!0),o}}(),_getSpotLightCamera:function(e){this._lightCameras.spot||(this._lightCameras.spot=new m.a);var t=this._lightCameras.spot;return t.fov=2*e.penumbraAngle,t.far=e.range,t.worldTransform.copy(e.worldTransform),t.updateProjectionMatrix(),x.a.invert(t.viewMatrix.array,t.worldTransform.array),t},dispose:function(e){var t=e.gl||e;for(var i in this._frameBuffer&&this._frameBuffer.dispose(t),this._textures)this._textures[i].dispose(t);this._texturePool.clear(e.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var n=0;n<this._receivers.length;n++){var r=this._receivers[n];if(r.material){var a=r.material;a.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),a.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),a.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),a.set("shadowEnabled",0)}}this._receivers=[],this._lightsCastShadow=[]}});P.VSM=1,P.PCF=2,t.a=P},function(e,t,i){t.a="@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n@import clay.chunk.skinning_header\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nvoid main(){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n v_ViewPosition = worldViewProjection * vec4(skinnedPosition, 1.0);\n gl_Position = v_ViewPosition;\n v_Texcoord = texcoord;\n}\n@end\n@export clay.sm.depth.fragment\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nuniform float bias : 0.001;\nuniform float slopeScale : 1.0;\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\n@import clay.util.encode_float\nvoid main(){\n float depth = v_ViewPosition.z / v_ViewPosition.w;\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n gl_Position = worldViewProjection * vec4(skinnedPosition , 1.0);\n v_WorldPosition = (world * vec4(skinnedPosition, 1.0)).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end"},function(e,t,i){var n=i(8),r=i(5),a=i(4),o=i(10),s=i(177),l=i(189),u=i(191),h=i(193),c=i(1),d=i(194),f=i(196);i(9);var p=i(197),g=i(87),m=i(88),v=i(89),y=i(90),_=i(91),x=i(92),b=i(93),w=i(94),T=i(95),S=i(198),M=i(199);n.a.import(g.a),n.a.import(m.a),n.a.import(v.a),n.a.import(y.a),n.a.import(_.a),n.a.import(x.a),n.a.import(b.a),n.a.import(w.a),n.a.import(T.a),n.a.import(S.a),n.a.import(M.a);var A={color:{parameters:{width:function(e){return e.getWidth()},height:function(e){return e.getHeight()}}}},I=["composite","FXAA"];function C(){this._sourceTexture=new r.a({type:a.a.HALF_FLOAT}),this._depthTexture=new r.a({format:a.a.DEPTH_COMPONENT,type:a.a.UNSIGNED_INT}),this._framebuffer=new o.a,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,o.a.DEPTH_ATTACHMENT),this._normalPass=new d.a,this._compositor=Object(s.a)(p.a);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map((function(e){return this._compositor.getNodeByName(e)}),this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=I.map((function(e){return this._compositor.getNodeByName(e)}),this);var i={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new l.a(i),this._ssrPass=new u.a(i),this._edgePass=new f.a(i)}C.prototype.resize=function(e,t,i){e*=i=i||1,t*=i;var n=this._sourceTexture,r=this._depthTexture;n.width=e,n.height=t,r.width=e,r.height=t},C.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},C.prototype._getPrevNode=function(e){for(var t=I.indexOf(e.name)-1,i=this._finalNodesChain[t];i&&!this._compositor.getNodeByName(i.name);)t-=1,i=this._finalNodesChain[t];return i},C.prototype._getNextNode=function(e){for(var t=I.indexOf(e.name)+1,i=this._finalNodesChain[t];i&&!this._compositor.getNodeByName(i.name);)t+=1,i=this._finalNodesChain[t];return i},C.prototype._addChainNode=function(e){var t=this._getPrevNode(e),i=this._getNextNode(e);t&&(t.outputs=A,e.inputs.texture=t.name,i?(e.outputs=A,i.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))},C.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),i=this._getNextNode(e);t&&(i?(t.outputs=A,i.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))},C.prototype.updateNormal=function(e,t,i,n){this._ifRenderNormalPass()&&this._normalPass.update(e,t,i)},C.prototype.updateSSAO=function(e,t,i,n){this._ssaoPass.update(e,i,n)},C.prototype.enableSSAO=function(){this._enableSSAO=!0},C.prototype.disableSSAO=function(){this._enableSSAO=!1},C.prototype.enableSSR=function(){this._enableSSR=!0},C.prototype.disableSSR=function(){this._enableSSR=!1},C.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},C.prototype.getSourceFrameBuffer=function(){return this._framebuffer},C.prototype.getSourceTexture=function(){return this._sourceTexture},C.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},C.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},C.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},C.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},C.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},C.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},C.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},C.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},C.prototype.enableEdge=function(){this._enableEdge=!0},C.prototype.disableEdge=function(){this._enableEdge=!1},C.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)},C.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var i={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",i);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break;default:console.warn("Unkown SSAO parameter "+e)}},C.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var i=0;i<this._dofBlurNodes.length;i++)this._dofBlurNodes[i].setParameter("blurRadius",t);break;case"quality":var n={low:4,medium:8,high:16,ultra:32}[t]||8;for(this._dofBlurKernelSize=n,i=0;i<this._dofBlurNodes.length;i++)this._dofBlurNodes[i].pass.material.define("POISSON_KERNEL_SIZE",n);this._dofBlurKernel=new Float32Array(2*n);break;default:console.warn("Unkown DOF parameter "+e)}},C.prototype.setSSRParameter=function(e,t){if(null!=t)switch(e){case"quality":var i={low:10,medium:15,high:30,ultra:80}[t]||20,n={low:32,medium:16,high:8,ultra:4}[t]||16;this._ssrPass.setParameter("maxIteration",i),this._ssrPass.setParameter("pixelStride",n);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-t,1),0));break;case"physical":this.setPhysicallyCorrectSSR(t);break;default:console.warn("Unkown SSR parameter "+e)}},C.prototype.setPhysicallyCorrectSSR=function(e){this._ssrPass.setPhysicallyCorrect(e)},C.prototype.setEdgeColor=function(e){var t=c.a.parseColor(e);this._edgePass.setParameter("edgeColor",t)},C.prototype.setExposure=function(e){this._compositeNode.setParameter("exposure",Math.pow(2,e))},C.prototype.setColorLookupTexture=function(e,t){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?e:"none",t,{minFilter:c.a.Texture.NEAREST,magFilter:c.a.Texture.NEAREST,flipY:!1})},C.prototype.setColorCorrection=function(e,t){this._compositeNode.setParameter(e,t)},C.prototype.isSSREnabled=function(){return this._enableSSR},C.prototype.composite=function(e,t,i,n,r){var a=this._sourceTexture,o=a;this._enableEdge&&(this._edgePass.update(e,i,a,r),a=o=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(e,i,a,r),o=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=o,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,l=this._dofBlurKernelSize,u=r%Math.floor(h.a.length/2/l),c=0;c<2*l;c++)s[c]=h.a[c+u*l*2];for(c=0;c<this._dofBlurNodes.length;c++)this._dofBlurNodes[c].setParameter("percent",r/30),this._dofBlurNodes[c].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",i.near),this._cocNode.setParameter("zFar",i.far),this._compositor.render(e,n)},C.prototype.dispose=function(e){this._sourceTexture.dispose(e),this._depthTexture.dispose(e),this._framebuffer.dispose(e),this._compositor.dispose(e),this._normalPass.dispose(e),this._ssaoPass.dispose(e)},t.a=C},function(e,t,i){var n=i(178);t.a=n.a},function(e,t,i){var n=i(23),r=i(179),a=i(181),o=i(182),s=i(183),l=i(8),u=i(4),h=i(5),c=i(27),d=i(184);Object(d.a)(l.a);var f=/^#source\((.*?)\)/;function p(e,t,i){var n,r,u,h,c=e.type||"filter";if("filter"===c){var d=e.shader.trim(),p=f.exec(d);if(p?n=l.a.source(p[1].trim()):"#"===d.charAt(0)&&(n=t.shaders[d.substr(1)]),n||(n=d),!n)return}if(e.inputs)for(var g in r={},e.inputs)"string"==typeof e.inputs[g]?r[g]=e.inputs[g]:r[g]={node:e.inputs[g].node,pin:e.inputs[g].pin};if(e.outputs)for(var g in u={},e.outputs){var m=e.outputs[g];u[g]={},null!=m.attachment&&(u[g].attachment=m.attachment),null!=m.keepLastFrame&&(u[g].keepLastFrame=m.keepLastFrame),null!=m.outputLastFrame&&(u[g].outputLastFrame=m.outputLastFrame),m.parameters&&(u[g].parameters=v(m.parameters))}if(h="scene"===c?new a.a({name:e.name,scene:i.scene,camera:i.camera,outputs:u}):"texture"===c?new o.a({name:e.name,outputs:u}):new s.a({name:e.name,shader:n,inputs:r,outputs:u})){if(e.parameters)for(var g in e.parameters)"string"==typeof(x=e.parameters[g])&&("#"===(x=x.trim()).charAt(0)?x=t.textures[x.substr(1)]:h.on("beforerender",y(g,_(x)))),h.setParameter(g,x);if(e.defines&&h.pass)for(var g in e.defines){var x=e.defines[g];h.pass.material.define("fragment",g,x)}}return h}function g(e,t){return e}function m(e,t){return t}function v(e){var t={};if(!e)return t;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach((function(i){var n=e[i];null!=n&&("string"==typeof n&&(n=u.a[n]),t[i]=n)}));var i=e.scale||1;return["width","height"].forEach((function(n){if(null!=e[n]){var r=e[n];"string"==typeof r?(r=r.trim(),t[n]=(a=_(r),o=(o=i)||1,function(e){var t=e.getDevicePixelRatio(),i=e.getWidth()*o,n=e.getHeight()*o;return a(i,n,t)})):t[n]=r}var a,o})),t.width||(t.width=g),t.height||(t.height=m),null!=e.useMipmap&&(t.useMipmap=e.useMipmap),t}function y(e,t){return function(i){var n=i.getDevicePixelRatio(),r=i.getWidth(),a=i.getHeight(),o=t(r,a,n);this.setParameter(e,o)}}function _(e){var t=/^expr\((.*)\)$/.exec(e);if(t)try{var i=new Function("width","height","dpr","return "+t[1]);return i(1,1),i}catch(n8){throw new Error("Invalid expression.")}}t.a=function(e,t){var i=new r.a;t=t||{};var a={textures:{},parameters:{}};for(var o in e.parameters){var s=e.parameters[o];a.parameters[o]=v(s)}return function(e,t,i,r){if(e.textures){var a={},o=0,s=!1,l=i.textureRootPath;n.a.each(e.textures,(function(e,t){var i,u=e.path,d=v(e.parameters);if(Array.isArray(u)&&6===u.length)l&&(u=u.map((function(e){return n.a.relative2absolute(e,l)}))),i=new c.a(d);else{if("string"!=typeof u)return;l&&(u=n.a.relative2absolute(u,l)),i=new h.a(d)}i.load(u),o++,i.once("success",(function(){a[t]=i,0==--o&&(r(a),s=!0)}))})),0!==o||s||r(a)}else r({})}(e,0,t,(function(n){a.textures=n,function(n,r){for(var o=0;o<e.nodes.length;o++){var s=p(e.nodes[o],a,t);s&&i.addNode(s)}}()})),i}},function(e,t,i){var n=i(180),r=i(86),a=i(10),o=n.a.extend((function(){return{_outputs:[],_texturePool:new r.a,_frameBuffer:new a.a({depthBuffer:!1})}}),{addNode:function(e){n.a.prototype.addNode.call(this,e),e._compositor=this},render:function(e,t){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var i=0;i<this.nodes.length;i++)this.nodes[i].outputs||this._outputs.push(this.nodes[i])}for(i=0;i<this.nodes.length;i++)this.nodes[i].beforeFrame();for(i=0;i<this._outputs.length;i++)this._outputs[i].updateReference();for(i=0;i<this._outputs.length;i++)this._outputs[i].render(e,t);for(i=0;i<this.nodes.length;i++)this.nodes[i].afterFrame()},allocateTexture:function(e){return this._texturePool.get(e)},releaseTexture:function(e){this._texturePool.put(e)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(e){this._texturePool.clear(e)}});t.a=o},function(e,t,i){var n=i(7),r=i(48),a=n.a.extend((function(){return{nodes:[]}}),{dirty:function(){this._dirty=!0},addNode:function(e){this.nodes.indexOf(e)>=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){"string"==typeof e&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t<this.nodes.length;t++)if(this.nodes[t].name===e)return this.nodes[t]},update:function(){for(var e=0;e<this.nodes.length;e++)this.nodes[e].clear();for(e=0;e<this.nodes.length;e++){var t=this.nodes[e];if(t.inputs)for(var i in t.inputs)if(t.inputs[i])if(!t.pass||t.pass.material.isUniformEnabled(i)){var n=t.inputs[i],r=this.findPin(n);r?t.link(i,r.node,r.pin):"string"==typeof n?console.warn("Node "+n+" not exist"):console.warn("Pin of "+n.node+"."+n.pin+" not exist")}else console.warn("Pin "+t.name+"."+i+" not used.")}},findPin:function(e){var t;if(("string"==typeof e||e instanceof r.a)&&(e={node:e}),"string"==typeof e.node)for(var i=0;i<this.nodes.length;i++){var n=this.nodes[i];n.name===e.node&&(t=n)}else t=e.node;if(t){var a=e.pin;if(a||t.outputs&&(a=Object.keys(t.outputs)[0]),t.outputs[a])return{node:t,pin:a}}}});t.a=a},function(e,t,i){var n=i(48),r=i(11),a=i(10),o=n.a.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},(function(){this.frameBuffer=new a.a}),{render:function(e){this._rendering=!0;var t,i=e.gl;if(this.trigger("beforerender"),this.outputs){var n=this.frameBuffer;for(var a in this.outputs){var o=this.updateParameter(a,e),s=this.outputs[a],l=this._compositor.allocateTexture(o);this._outputTextures[a]=l,"string"==typeof(c=s.attachment||i.COLOR_ATTACHMENT0)&&(c=i[c]),n.attach(l,c)}n.bind(e);var u=e.getGLExtension("EXT_draw_buffers");if(u){var h=[];for(var c in this.outputs)(c=parseInt(c))>=i.COLOR_ATTACHMENT0&&c<=i.COLOR_ATTACHMENT0+8&&h.push(c);u.drawBuffersEXT(h)}e.saveClear(),e.clearBit=r.a.DEPTH_BUFFER_BIT|r.a.COLOR_BUFFER_BIT,t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),n.unbind(e)}else t=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",t),this._rendering=!1,this._rendered=!0}});t.a=o},function(e,t,i){var n=i(48).a.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}});t.a=n},function(e,t,i){var n=i(16),r=i(48),a=r.a.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var e=new n.a({fragment:this.shader});this.pass=e}),{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var i=e.gl;for(var n in this.inputLinks){var r=(c=this.inputLinks[n]).node.getOutput(e,c.pin);this.pass.setUniform(n,r)}if(this.outputs){this.pass.outputs={};var a={};for(var o in this.outputs){var s=this.updateParameter(o,e);isNaN(s.width)&&this.updateParameter(o,e);var l=this.outputs[o],u=this._compositor.allocateTexture(s);this._outputTextures[o]=u,"string"==typeof(h=l.attachment||i.COLOR_ATTACHMENT0)&&(h=i[h]),a[h]=u}for(var h in this._compositor.getFrameBuffer().bind(e),a)this._compositor.getFrameBuffer().attach(a[h],h);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);for(var n in this.inputLinks){var c;(c=this.inputLinks[n]).node.removeReference(c.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var i,n,r=this.outputs[e],a=r.parameters,o=r._parametersCopy;if(o||(o=r._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return i=a.width instanceof Function?a.width.call(this,t):a.width,n=a.height instanceof Function?a.height.call(this,t):a.height,i=Math.ceil(i),n=Math.ceil(n),o.width===i&&o.height===n||this._outputTextures[e]&&this._outputTextures[e].dispose(t),o.width=i,o.height=n,o},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){this._outputReferences[e]--,0===this._outputReferences[e]&&(this.outputs[e].keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e]))},clear:function(){r.a.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});t.a=a},function(e,t,i){t.a=function(e){e.import(n.a),e.import(r.a),e.import(a.a),e.import(o.a),e.import(s.a),e.import(l.a),e.import(u.a),e.import(h.a),e.import(c.a),e.import(d.a),e.import(f.a),e.import(p.a),e.import(g.a)};var n=i(185),r=i(87),a=i(186),o=i(88),s=i(187),l=i(89),u=i(90),h=i(91),c=i(92),d=i(93),f=i(188),p=i(94),g=i(95)},function(e,t,i){t.a="@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end"},function(e,t,i){t.a="@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end"},function(e,t,i){var n=i(9),r=i(3),a=i(5),o=i(4),s=i(16),l=i(8),u=i(10),h=i(49),c=i(190);function d(e){for(var t=new Uint8Array(e*e*4),i=0,n=new r.a,a=0;a<e;a++)for(var o=0;o<e;o++)n.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),t[i++]=255*(.5*n.x+.5),t[i++]=255*(.5*n.y+.5),t[i++]=0,t[i++]=255;return t}function f(e){return new a.a({pixels:d(e),wrapS:o.a.REPEAT,wrapT:o.a.REPEAT,width:e,height:e})}function p(e,t,i){var n=new Float32Array(3*e);t=t||0;for(var r=0;r<e;r++){var a=Object(h.a)(r+t,2)*(i?1:2)*Math.PI,o=Object(h.a)(r+t,3)*Math.PI,s=Math.random(),l=Math.cos(a)*Math.sin(o)*s,u=Math.cos(o)*s,c=Math.sin(a)*Math.sin(o)*s;n[3*r]=l,n[3*r+1]=u,n[3*r+2]=c}return n}function g(e){e=e||{},this._ssaoPass=new s.a({fragment:l.a.source("ecgl.ssao.estimate")}),this._blurPass=new s.a({fragment:l.a.source("ecgl.ssao.blur")}),this._framebuffer=new u.a({depthBuffer:!1}),this._ssaoTexture=new a.a,this._blurTexture=new a.a,this._blurTexture2=new a.a,this._depthTex=e.depthTexture,this._normalTex=e.normalTexture,this.setNoiseSize(4),this.setKernelSize(e.kernelSize||12),null!=e.radius&&this.setParameter("radius",e.radius),null!=e.power&&this.setParameter("power",e.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}l.a.import(c.a),g.prototype.setDepthTexture=function(e){this._depthTex=e},g.prototype.setNormalTexture=function(e){this._normalTex=e,this._ssaoPass.material[e?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},g.prototype.update=function(e,t,i){var r=e.getWidth(),a=e.getHeight(),o=this._ssaoPass,s=this._blurPass;o.setUniform("kernel",this._kernels[i%this._kernels.length]),o.setUniform("depthTex",this._depthTex),null!=this._normalTex&&o.setUniform("normalTex",this._normalTex),o.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var l=new n.a;n.a.transpose(l,t.worldTransform),o.setUniform("projection",t.projectionMatrix.array),o.setUniform("projectionInv",t.invProjectionMatrix.array),o.setUniform("viewInverseTranspose",l.array);var u=this._ssaoTexture,h=this._blurTexture,c=this._blurTexture2;u.width=r/2,u.height=a/2,h.width=r,h.height=a,c.width=r,c.height=a,this._framebuffer.attach(u),this._framebuffer.bind(e),e.gl.clearColor(1,1,1,1),e.gl.clear(e.gl.COLOR_BUFFER_BIT),o.render(e),s.setUniform("textureSize",[r/2,a/2]),s.setUniform("projection",t.projectionMatrix.array),this._framebuffer.attach(h),s.setUniform("direction",0),s.setUniform("ssaoTexture",u),s.render(e),this._framebuffer.attach(c),s.setUniform("textureSize",[r,a]),s.setUniform("direction",1),s.setUniform("ssaoTexture",h),s.render(e),this._framebuffer.unbind(e);var d=e.clearColor;e.gl.clearColor(d[0],d[1],d[2],d[3])},g.prototype.getTargetTexture=function(){return this._blurTexture2},g.prototype.setParameter=function(e,t){"noiseTexSize"===e?this.setNoiseSize(t):"kernelSize"===e?this.setKernelSize(t):"intensity"===e?this._ssaoPass.material.set("intensity",t):this._ssaoPass.setUniform(e,t)},g.prototype.setKernelSize=function(e){this._kernelSize=e,this._ssaoPass.material.define("fragment","KERNEL_SIZE",e),this._kernels=this._kernels||[];for(var t=0;t<30;t++)this._kernels[t]=p(e,t*e,!!this._normalTex)},g.prototype.setNoiseSize=function(e){var t=this._ssaoPass.getUniform("noiseTex");t?(t.data=d(e),t.width=t.height=e,t.dirty()):(t=f(e),this._ssaoPass.setUniform("noiseTex",f(e))),this._ssaoPass.setUniform("noiseTexSize",[e,e])},g.prototype.dispose=function(e){this._blurTexture.dispose(e),this._ssaoTexture.dispose(e),this._blurTexture2.dispose(e)},t.a=g},function(e,t,i){t.a="@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"},function(e,t,i){var n=i(9);i(3);var r=i(5),a=i(4),o=i(16),s=i(8),l=i(10);i(49);var u=i(77),h=i(192);function c(e){e=e||{},this._ssrPass=new o.a({fragment:s.a.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new o.a({fragment:s.a.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",e.normalTexture),this._ssrPass.setUniform("gBufferTexture2",e.depthTexture),this._blurPass1.setUniform("gBufferTexture1",e.normalTexture),this._blurPass1.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.setUniform("gBufferTexture1",e.normalTexture),this._blurPass2.setUniform("gBufferTexture2",e.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new r.a({type:a.a.HALF_FLOAT}),this._texture2=new r.a({type:a.a.HALF_FLOAT}),this._texture3=new r.a({type:a.a.HALF_FLOAT}),this._prevTexture=new r.a({type:a.a.HALF_FLOAT}),this._currentTexture=new r.a({type:a.a.HALF_FLOAT}),this._frameBuffer=new l.a({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}s.a.import(h.a),c.prototype.setAmbientCubemap=function(e,t){this._ssrPass.material.set("specularCubemap",e),this._ssrPass.material.set("specularIntensity",t);var i=e&&t;this._ssrPass.material[i?"enableTexture":"disableTexture"]("specularCubemap")},c.prototype.update=function(e,t,i,r){var a=e.getWidth(),o=e.getHeight(),s=this._ssrTexture,l=this._texture2,u=this._texture3;s.width=this._prevTexture.width=this._currentTexture.width=a/this._downScale,s.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,l.width=u.width=a,l.height=u.height=o;var h=this._frameBuffer,c=this._ssrPass,d=this._blurPass1,f=this._blurPass2,p=this._blendPass,g=new n.a,m=new n.a;n.a.transpose(g,t.worldTransform),n.a.transpose(m,t.viewMatrix),c.setUniform("sourceTexture",i),c.setUniform("projection",t.projectionMatrix.array),c.setUniform("projectionInv",t.invProjectionMatrix.array),c.setUniform("toViewSpace",g.array),c.setUniform("toWorldSpace",m.array),c.setUniform("nearZ",t.near);var v=r/this._totalSamples*this._samplePerFrame;if(c.setUniform("jitterOffset",v),c.setUniform("sampleOffset",r*this._samplePerFrame),d.setUniform("textureSize",[s.width,s.height]),f.setUniform("textureSize",[a,o]),f.setUniform("sourceTexture",i),d.setUniform("projection",t.projectionMatrix.array),f.setUniform("projection",t.projectionMatrix.array),h.attach(s),h.bind(e),c.render(e),this._physicallyCorrect&&(h.attach(this._currentTexture),p.setUniform("texture1",this._prevTexture),p.setUniform("texture2",s),p.material.set({weight1:r>=1?.95:0,weight2:r>=1?.05:1}),p.render(e)),h.attach(l),d.setUniform("texture",this._physicallyCorrect?this._currentTexture:s),d.render(e),h.attach(u),f.setUniform("texture",l),f.render(e),h.unbind(e),this._physicallyCorrect){var y=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=y}},c.prototype.getTargetTexture=function(){return this._texture3},c.prototype.setParameter=function(e,t){"maxIteration"===e?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)},c.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=u.a.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e},c.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")},c.prototype.isFinished=function(e){return!this._physicallyCorrect||e>this._totalSamples/this._samplePerFrame},c.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)},t.a=c},function(e,t,i){t.a="@export ecgl.ssr.main\n\n#define SHADER_NAME SSR\n#define MAX_ITERATION 20;\n#define SAMPLE_PER_FRAME 5;\n#define TOTAL_SAMPLES 128;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform sampler2D gBufferTexture3;\nuniform samplerCube specularCubemap;\nuniform float specularIntensity: 1;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 toViewSpace;\nuniform mat4 toWorldSpace;\n\nuniform float maxRayDistance: 200;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\n#ifdef PHYSICALLY_CORRECT\nuniform sampler2D normalDistribution;\nuniform float sampleOffset: 0;\nuniform vec2 normalDistributionSize;\n\nvec3 transformNormal(vec3 H, vec3 N) {\n vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n dPQK *= 1.2;\n\n if (intersect) {\n break;\n }\n }\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n#if !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"},function(e,t,i){t.a=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925]},function(e,t,i){var n=i(5),r=i(4),a=i(8),o=i(10),s=i(19),l=i(16),u=i(61),h=i(195);function c(e,t,i,n,r){var a=e.gl;t.setUniform(a,"1i",i,r),a.activeTexture(a.TEXTURE0+r),n.isRenderable()?n.bind(e):n.unbind(e)}function d(e,t,i,n,r){var a,o,s,l,u=e.gl;return function(r,h,d){if(!l||l.material!==r.material){var f=r.material,p=r.__program,g=f.get("roughness");null==g&&(g=1);var m=f.get("normalMap")||t,v=f.get("roughnessMap"),y=f.get("bumpMap"),_=f.get("uvRepeat"),x=f.get("uvOffset"),b=f.get("detailUvRepeat"),w=f.get("detailUvOffset"),T=!!y&&f.isTextureEnabled("bumpMap"),S=!!v&&f.isTextureEnabled("roughnessMap"),M=f.isDefined("fragment","DOUBLE_SIDED");y=y||i,v=v||n,d!==h?(h.set("normalMap",m),h.set("bumpMap",y),h.set("roughnessMap",v),h.set("useBumpMap",T),h.set("useRoughnessMap",S),h.set("doubleSide",M),null!=_&&h.set("uvRepeat",_),null!=x&&h.set("uvOffset",x),null!=b&&h.set("detailUvRepeat",b),null!=w&&h.set("detailUvOffset",w),h.set("roughness",g)):(p.setUniform(u,"1f","roughness",g),a!==m&&c(e,p,"normalMap",m,0),o!==y&&y&&c(e,p,"bumpMap",y,1),s!==v&&v&&c(e,p,"roughnessMap",v,2),null!=_&&p.setUniform(u,"2f","uvRepeat",_),null!=x&&p.setUniform(u,"2f","uvOffset",x),null!=b&&p.setUniform(u,"2f","detailUvRepeat",b),null!=w&&p.setUniform(u,"2f","detailUvOffset",w),p.setUniform(u,"1i","useBumpMap",+T),p.setUniform(u,"1i","useRoughnessMap",+S),p.setUniform(u,"1i","doubleSide",+M)),a=m,o=y,s=v,l=r}}}function f(e){this._depthTex=new n.a({format:r.a.DEPTH_COMPONENT,type:r.a.UNSIGNED_INT}),this._normalTex=new n.a({type:r.a.HALF_FLOAT}),this._framebuffer=new o.a,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,o.a.DEPTH_ATTACHMENT),this._normalMaterial=new s.a({shader:new a.a(a.a.source("ecgl.normal.vertex"),a.a.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=u.a.createBlank("#000"),this._defaultBumpMap=u.a.createBlank("#000"),this._defaultRoughessMap=u.a.createBlank("#000"),this._debugPass=new l.a({fragment:a.a.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}a.a.import(h.a),f.prototype.getDepthTexture=function(){return this._depthTex},f.prototype.getNormalTexture=function(){return this._normalTex},f.prototype.update=function(e,t,i){var n=e.getWidth(),r=e.getHeight(),a=this._depthTex,o=this._normalTex,s=this._normalMaterial;a.width=n,a.height=r,o.width=n,o.height=r;var l=t.getRenderList(i).opaque;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(l,i,{getMaterial:function(){return s},ifRender:function(e){return e.renderNormal},beforeRender:d(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)},f.prototype.renderDebug=function(e){this._debugPass.render(e)},f.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)},t.a=f},function(e,t,i){t.a="@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"},function(e,t,i){i(9),i(3);var n=i(5),r=i(4),a=i(16),o=i(8),s=i(10);function l(e){e=e||{},this._edgePass=new a.a({fragment:o.a.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new n.a({type:r.a.HALF_FLOAT}),this._frameBuffer=new s.a,this._frameBuffer.attach(this._targetTexture)}l.prototype.update=function(e,t,i,n){var r=e.getWidth(),a=e.getHeight(),o=this._targetTexture;o.width=r,o.height=a;var s=this._frameBuffer;s.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[r,a]),this._edgePass.setUniform("texture",i),this._edgePass.render(e),s.unbind(e)},l.prototype.getTargetTexture=function(){return this._targetTexture},l.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)},l.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)},t.a=l},function(e,t,i){t.a={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]}},function(e,t,i){t.a="@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end"},function(e,t,i){t.a="@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end"},function(e,t,i){var n=i(49),r=i(16),a=i(10),o=i(5),s=i(8),l=i(9);function u(e){for(var t=[],i=0;i<30;i++)t.push([Object(n.a)(i,2),Object(n.a)(i,3)]);this._haltonSequence=t,this._frame=0,this._sourceTex=new o.a,this._sourceFb=new a.a,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new o.a,this._outputTex=new o.a;var l=this._blendPass=new r.a({fragment:s.a.source("clay.compositor.blend")});l.material.disableTexturesAll(),l.material.enableTexture(["texture1","texture2"]),this._blendFb=new a.a({depthBuffer:!1}),this._outputPass=new r.a({fragment:s.a.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(e){e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}}u.prototype={constructor:u,jitterProjection:function(e,t){var i=e.viewport,n=i.devicePixelRatio||e.getDevicePixelRatio(),r=i.width*n,a=i.height*n,o=this._haltonSequence[this._frame%this._haltonSequence.length],s=new l.a;s.array[12]=(2*o[0]-1)/r,s.array[13]=(2*o[1]-1)/a,l.a.mul(t.projectionMatrix,s,t.projectionMatrix),l.a.invert(t.invProjectionMatrix,t.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(e,t){this._prevFrameTex.width=e,this._prevFrameTex.height=t,this._outputTex.width=e,this._outputTex.height=t,this._sourceTex.width=e,this._sourceTex.height=t,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(e,t,i){var n=this._blendPass;0===this._frame?(n.setUniform("weight1",0),n.setUniform("weight2",1)):(n.setUniform("weight1",.9),n.setUniform("weight2",.1)),n.setUniform("texture1",this._prevFrameTex),n.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),n.render(e),this._blendFb.unbind(e),i||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var r=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=r,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}},t.a=u},function(e,t,i){var n=i(0),r=i.n(n);i(202),i(203),i(98),r.a.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"geo3D",query:e},(function(t){t.setView(e)}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=i(31),u=i(96),h=r.a.extendComponentModel({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var e=this.option;e.regions=this.getFilledRegions(e.regions,e.map);var t=r.a.helper.completeDimensions(["value"],e.data,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),i=new r.a.List(t,this);i.initData(e.regions);var n={};i.each((function(e){var t=i.getName(e),r=i.getItemModel(e);n[t]=r})),this._regionModelMap=n,this._data=i},getData:function(){return this._data},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new r.a.Model(null,this)},getRegionPolygonCoords:function(e){var t=this.getData().getName(e),i=this.coordinateSystem.getRegion(t);return i?i.geometries:[]},getFormattedLabel:function(e,t){var i=this._data.getName(e),n=this.getRegionModel(i),r=n.get("normal"===t?["label","formatter"]:["emphasis","label","formatter"]);null==r&&(r=n.get(["label","formatter"]));var a={name:i};if("function"==typeof r)return a.status=t,r(a);if("string"==typeof r){var o=a.seriesName;return r.replace("{a}",null!=o?o:"")}return i},defaultOption:{regions:[]}});r.a.util.merge(h.prototype,u.a),r.a.util.merge(h.prototype,a.a),r.a.util.merge(h.prototype,o.a),r.a.util.merge(h.prototype,s.a),r.a.util.merge(h.prototype,l.a)},function(e,t,i){var n=i(64),r=i(0),a=i.n(r),o=i(1),s=i(45),l=i(30);a.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new n.a(t),this.groupGL=new o.a.Node,this._lightRoot=new o.a.Node,this._sceneHelper=new l.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new s.a({zr:t.getZr()}),this._control.init()},render:function(e,t,i){this.groupGL.add(this._geo3DBuilder.rootNode);var n=e.coordinateSystem;if(n&&n.viewGL){n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(n.viewGL);var a=e.getModel("viewControl");r.setFromViewControlModel(a,0),this._sceneHelper.setScene(n.viewGL.scene),this._sceneHelper.updateLight(e),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._geo3DBuilder.update(e,t,i,0,e.getData().count());var o=n.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[o]("fragment","SRGB_DECODE")})),r.off("update"),r.on("update",(function(){i.dispatchAction({type:"geo3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,geo3DId:e.id})})),r.update()}},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},dispose:function(){this._control.dispose()}})},function(e,t,i){function n(e,t,i){i=i||2;var n,s,l,u,h,f,g,m=t&&t.length,v=m?t[0]*i:e.length,y=r(e,0,v,i,!0),_=[];if(!y)return _;if(m&&(y=function(e,t,i,n){var o,s,l,u=[];for(o=0,s=t.length;o<s;o++)(l=r(e,t[o]*n,o<s-1?t[o+1]*n:e.length,n,!1))===l.next&&(l.steiner=!0),u.push(p(l));for(u.sort(c),o=0;o<u.length;o++)d(u[o],i),i=a(i,i.next);return i}(e,t,y,i)),e.length>80*i){n=l=e[0],s=u=e[1];for(var x=i;x<v;x+=i)(h=e[x])<n&&(n=h),(f=e[x+1])<s&&(s=f),h>l&&(l=h),f>u&&(u=f);g=Math.max(l-n,u-s)}return o(y,_,i,n,s,g),_}function r(e,t,i,n,r){var a,o;if(r===M(e,t,i,n)>0)for(a=t;a<i;a+=n)o=w(a,e[a],e[a+1],o);else for(a=i-n;a>=t;a-=n)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(T(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==v(n.prev,n,n.next))n=n.next;else{if(T(n),(n=t=n.prev)===n.next)return null;i=!0}}while(i||n!==t);return t}function o(e,t,i,n,r,c,d){if(e){!d&&c&&function(e,t,i,n){var r=e;do{null===r.z&&(r.z=f(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,i,n,r,a,o,s,l,u=1;do{for(i=e,e=null,a=null,o=0;i;){for(o++,n=i,s=0,t=0;t<u&&(s++,n=n.nextZ);t++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=n}a.nextZ=null,u*=2}while(o>1)}(r)}(e,n,r,c);for(var p,g,m=e;e.prev!==e.next;)if(p=e.prev,g=e.next,c?l(e,n,r,c):s(e))t.push(p.i/i),t.push(e.i/i),t.push(g.i/i),T(e),e=g.next,m=g.next;else if((e=g)===m){d?1===d?o(e=u(e,t,i),t,i,n,r,c,2):2===d&&h(e,t,i,n,r,c):o(a(e),t,i,n,r,c,1);break}}}function s(e){var t=e.prev,i=e,n=e.next;if(v(t,i,n)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&v(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function l(e,t,i,n){var r=e.prev,a=e,o=e.next;if(v(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,u=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,h=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,c=f(s,l,t,i,n),d=f(u,h,t,i,n),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=c;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(e,t,i){var n=e;do{var r=n.prev,a=n.next.next;!y(r,a)&&_(r,n,n.next,a)&&x(r,a)&&x(a,r)&&(t.push(r.i/i),t.push(n.i/i),t.push(a.i/i),T(n),T(n.next),n=e=a),n=n.next}while(n!==e);return n}function h(e,t,i,n,r,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var h=b(l,u);return l=a(l,l.next),h=a(h,h.next),o(l,t,i,n,r,s),void o(h,t,i,n,r,s)}u=u.next}l=l.next}while(l!==e)}function c(e,t){return e.x-t.x}function d(e,t){if(t=function(e,t){var i,n=t,r=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>o){if(o=s,s===r){if(a===n.y)return n;if(a===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!i)return null;if(r===o)return i.prev;var l,u=i,h=i.x,c=i.y,d=1/0;for(n=i.next;n!==u;)r>=n.x&&n.x>=h&&r!==n.x&&g(a<c?r:o,a,h,c,a<c?o:r,a,n.x,n.y)&&((l=Math.abs(a-n.y)/(r-n.x))<d||l===d&&n.x>i.x)&&x(n,e)&&(i=n,d=l),n=n.next;return i}(e,t),t){var i=b(t,e);a(i,i.next)}}function f(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)/r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,i=e;do{t.x<i.x&&(i=t),t=t.next}while(t!==e);return i}function g(e,t,i,n,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(i-o)*(t-s)>=0&&(i-o)*(a-s)-(r-o)*(n-s)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&_(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&x(e,t)&&x(t,e)&&function(e,t){var i=e,n=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function _(e,t,i,n){return!!(y(e,t)&&y(i,n)||y(e,n)&&y(i,t))||v(e,t,i)>0!=v(e,t,n)>0&&v(i,n,e)>0!=v(i,n,t)>0}function x(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function b(e,t){var i=new S(e.i,e.x,e.y),n=new S(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function w(e,t,i,n){var r=new S(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function T(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function S(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,i,n){for(var r=0,a=t,o=i-n;a<i;a+=n)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}t.a=n,n.deviation=function(e,t,i,n){var r=t&&t.length,a=r?t[0]*i:e.length,o=Math.abs(M(e,0,a,i));if(r)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,h=s<l-1?t[s+1]*i:e.length;o-=Math.abs(M(e,u,h,i))}var c=0;for(s=0;s<n.length;s+=3){var d=n[s]*i,f=n[s+1]*i,p=n[s+2]*i;c+=Math.abs((e[d]-e[p])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[p+1]-e[d+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)}},function(e,t,i){var n=i(13),r={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};e.exports=function(e){n.each(e.regions,(function(e){var t=r[e.name];if(t){var i=e.center;i[0]+=t[0]/10.5,i[1]+=-t[1]/14}}))}},function(e,t,i){var n=i(13),r={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};e.exports=function(e){n.each(e.regions,(function(e){var t=r[e.name];if(t){var i=e.center;i[0]=t[0],i[1]=t[1]}}))}},function(e,t,i){var n=i(0),r=i.n(n);i(208),i(209),i(211),r.a.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"globe",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},(function(e,t){}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=i(31);function u(e,t){e.id=e.id||e.name||t+""}var h=r.a.extendComponentModel({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){h.superApply(this,"init",arguments),r.a.util.each(this.option.layers,(function(e,t){r.a.util.merge(e,this.defaultLayerOption),u(e,t)}),this)},mergeOption:function(e){var t=this.option.layers;function i(e){return r.a.util.reduce(e,(function(e,t,i){return u(t,i),e[t.id]=t,e}),{})}if(this.option.layers=null,h.superApply(this,"mergeOption",arguments),t&&t.length){var n=i(e.layers),a=i(t);for(var o in n)a[o]?r.a.util.merge(a[o],n[o],!0):t.push(e.layers[o]);this.option.layers=t}r.a.util.each(this.option.layers,(function(e){r.a.util.merge(e,this.defaultLayerOption)}),this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(e,t,i){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=i},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var e=this.getDisplacementTexture(),t=this.get("displacementScale");return e&&"none"!==e||(t=0),t},hasDisplacement:function(){return this.getDisplacemenScale()>0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var e=this.getDisplacementTexture(),t=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==e||this._displacementScale!==t,this._displacementTexture=e,this._displacementScale=t},isDisplacementChanged:function(){return this._displacementChanged}});r.a.util.merge(h.prototype,a.a),r.a.util.merge(h.prototype,o.a),r.a.util.merge(h.prototype,s.a),r.a.util.merge(h.prototype,l.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(45),s=i(30),l=i(210),u=i(2);r.a.extendComponentView({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(e,t){this.groupGL=new a.a.Node,this._sphereGeometry=new a.a.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new a.a.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new a.a.PlaneGeometry,this._earthMesh=new a.a.Mesh({renderNormal:!0}),this._lightRoot=new a.a.Node,this._sceneHelper=new s.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new o.a({zr:t.getZr()}),this._control.init(),this._layerMeshes={}},render:function(e,t,i){var n=e.coordinateSystem,r=e.get("shading");n.viewGL.add(this._lightRoot),e.get("show")?n.viewGL.add(this.groupGL):n.viewGL.remove(this.groupGL),this._sceneHelper.setScene(n.viewGL.scene),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var s="ecgl."+r;o.material&&o.material.shader.name===s||(o.material=a.a.createMaterial(s)),a.a.setMaterialFromModel(r,o.material,e,i),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(e){var t=o.material.get(e);t&&(t.flipY=!1)})),o.material.set("color",a.a.parseColor(e.get("baseColor")));var l=.99*n.radius;o.scale.set(l,l,l);var u=o.material.setTextureImage("diffuseMap",e.get("baseTexture"),i,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var h=o.material.setTextureImage("bumpMap",e.get("heightTexture"),i,{flipY:!1,anisotropic:8});h&&h.surface&&h.surface.attachToMesh(o),o.material[e.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(e,i),this._displaceVertices(e,i),this._updateViewControl(e,i),this._updateLayers(e,i)},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i)},_updateLayers:function(e,t){var i=e.coordinateSystem,n=e.get("layers"),o=i.radius,s=[],l=[],h=[],c=[];r.a.util.each(n,(function(e){var n=new r.a.Model(e),d=n.get("type"),f=a.a.loadTexture(n.get("texture"),t,{flipY:!1,anisotropic:8});if(f.surface&&f.surface.attachToMesh(this._earthMesh),"blend"===d){var p=n.get("blendTo"),g=u.a.firstNotNull(n.get("intensity"),1);"emission"===p?(h.push(f),c.push(g)):(s.push(f),l.push(g))}else{var m=n.get("id"),v=this._layerMeshes[m];v||(v=this._layerMeshes[m]=new a.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===n.get("shading")?(v.material=v.__lambertMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),v.__lambertMaterial=v.material):(v.material=v.__colorMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),v.__colorMaterial=v.material),v.material.enableTexture("diffuseMap");var y=n.get("distance"),_=o+(null==y?i.radius/100:y);v.scale.set(_,_,_),o=_;var x=this._blankTexture||(this._blankTexture=a.a.createBlankTexture("rgba(255, 255, 255, 0)"));v.material.set("diffuseMap",x),a.a.loadTexture(n.get("texture"),t,{flipY:!1,anisotropic:8},(function(e){e.surface&&e.surface.attachToMesh(v),v.material.set("diffuseMap",e),t.getZr().refresh()})),n.get("show")?this.groupGL.add(v):this.groupGL.remove(v)}}),this);var d=this._earthMesh.material;d.define("fragment","LAYER_DIFFUSEMAP_COUNT",s.length),d.define("fragment","LAYER_EMISSIVEMAP_COUNT",h.length),d.set("layerDiffuseMap",s),d.set("layerDiffuseIntensity",l),d.set("layerEmissiveMap",h),d.set("layerEmissionIntensity",c);var f=e.getModel("debug.wireframe");if(f.get("show")){d.define("both","WIREFRAME_TRIANGLE");var p=a.a.parseColor(f.get("lineStyle.color")||"rgba(0,0,0,0.5)"),g=u.a.firstNotNull(f.get("lineStyle.width"),1);d.set("wireframeLineWidth",g),d.set("wireframeLineColor",p)}else d.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(e,t){var i=e.coordinateSystem,n=e.getModel("viewControl");i.viewGL.camera;var r=this,a=this._control;a.setViewGL(i.viewGL);var o,s,l=n.get("targetCoord");null!=l&&(s=l[0]+90,o=l[1]),a.setFromViewControlModel(n,{baseDistance:i.radius,alpha:o,beta:s}),a.off("update"),a.on("update",(function(){t.dispatchAction({type:"globeChangeCamera",alpha:a.getAlpha(),beta:a.getBeta(),distance:a.getDistance()-i.radius,center:a.getCenter(),from:r.uid,globeId:e.id})}))},_displaceVertices:function(e,t){var i=e.get("displacementQuality"),n=e.get("debug.wireframe.show"),r=e.coordinateSystem;if(e.isDisplacementChanged()||i!==this._displacementQuality||n!==this._showDebugWireframe){this._displacementQuality=i,this._showDebugWireframe=n;var a=this._sphereGeometry,o={low:100,medium:200,high:400,ultra:800}[i]||200,s=o/2;(a.widthSegments!==o||n)&&(a.widthSegments=o,a.heightSegments=s,a.build()),this._doDisplaceVertices(a,r),n&&a.generateBarycentric()}},_doDisplaceVertices:function(e,t){var i=e.attributes.position.value,n=e.attributes.texcoord0.value,r=e.__originalPosition;r&&r.length===i.length||((r=new Float32Array(i.length)).set(i),e.__originalPosition=r);for(var a=t.displacementWidth,o=t.displacementHeight,s=t.displacementData,l=0;l<e.vertexCount;l++){var u=3*l,h=2*l,c=r[u+1],d=r[u+2],f=r[u+3],p=n[h++],g=n[h++],m=Math.round(p*(a-1)),v=Math.round(g*(o-1)),y=s?s[v*a+m]:0;i[u+1]=c+c*y,i[u+2]=d+d*y,i[u+3]=f+f*y}e.generateVertexNormals(),e.dirty(),e.updateBoundingBox()},_updateLight:function(e,t){var i=this._earthMesh;this._sceneHelper.updateLight(e);var n=this._sceneHelper.mainLight,a=e.get("light.main.time")||new Date,o=l.a.getPosition(r.a.number.parseDate(a),0,0),s=Math.cos(o.altitude);n.position.y=-s*Math.cos(o.azimuth),n.position.x=Math.sin(o.altitude),n.position.z=s*Math.sin(o.azimuth),n.lookAt(i.getWorldPosition())},dispose:function(e,t){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,i){var n=Math.PI,r=Math.sin,a=Math.cos,o=Math.tan,s=Math.asin,l=Math.atan2,u=n/180,h=23.4397*u;function c(e,t){return l(r(e)*a(h)-o(t)*r(h),a(e))}function d(e,t,i){return l(r(e),a(e)*r(t)-o(i)*a(t))}function f(e,t,i){return s(r(t)*r(i)+a(t)*a(i)*a(e))}function p(e){var t,i,o=function(e){return u*(357.5291+.98560028*e)}(e),l=function(e){return e+u*(1.9148*r(e)+.02*r(2*e)+3e-4*r(3*e))+102.9372*u+n}(o);return{dec:(t=l,i=0,s(r(i)*a(h)+a(i)*r(h)*r(t))),ra:c(l,0)}}var g={getPosition:function(e,t,i){var n=u*-i,r=u*t,a=function(e){return function(e){return e.valueOf()/864e5-.5+2440588}(e)-2451545}(e),o=p(a),s=function(e,t){return u*(280.16+360.9856235*e)-t}(a,n)-o.ra;return{azimuth:d(s,r,o.dec),altitude:f(s,r,o.dec)}}};t.a=g},function(e,t,i){var n=i(212),r=i(0),a=i.n(r),o=i(47),s=i.n(o),l=i(22),u=i(2),h=i(1);function c(e,t){var i=e.getBoxLayoutParams(),n=s.a.getLayoutRect(i,{width:t.getWidth(),height:t.getHeight()});n.y=t.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,t.getDevicePixelRatio()),this.radius=e.get("globeRadius");var r=e.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,r-this.radius)}function d(e,t){var i=[1/0,-1/0];if(e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData(),n=e.coordDimToDataDim("alt"),r=n&&n[0];if(r){var a=t.getDataExtent(r,!0);i[0]=Math.min(i[0],a[0]),i[1]=Math.max(i[1],a[1])}}}),this),i&&isFinite(i[1]-i[0])){var n=a.a.helper.createScale(i,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new a.a.Axis("altitude",n),this.resize(this.model,t)}}var f={dimensions:n.a.prototype.dimensions,create:function(e,t){var i=[];return e.eachComponent("globe",(function(e){e.__viewGL=e.__viewGL||new l.a;var r=new n.a;r.viewGL=e.__viewGL,e.coordinateSystem=r,r.model=e,i.push(r),r.resize=c,r.resize(e,t),r.update=d})),e.eachSeries((function(t){if("globe"===t.get("coordinateSystem")){var i=t.getReferringComponents("globe")[0];if(i||(i=e.getComponent("globe")),!i)throw new Error('globe "'+u.a.firstNotNull(t.get("globe3DIndex"),t.get("globe3DId"),0)+'" not found');var n=i.coordinateSystem;t.coordinateSystem=n}})),e.eachComponent("globe",(function(e,i){var n=e.coordinateSystem,r=e.getDisplacementTexture(),a=e.getDisplacemenScale();if(e.isDisplacementChanged()){if(e.hasDisplacement()){var o=!0;h.a.loadTexture(r,t,(function(i){var n=function(e,t){var i=document.createElement("canvas"),n=i.getContext("2d"),r=e.width,a=e.height;i.width=r,i.height=a,n.drawImage(e,0,0,r,a);for(var o=n.getImageData(0,0,r,a).data,s=new Float32Array(o.length/4),l=0;l<o.length/4;l++){var u=o[4*l];s[l]=u/255*t}return{data:s,width:r,height:a}}(i.image,a);e.setDisplacementData(n.data,n.width,n.height),o||t.dispatchAction({type:"globeUpdateDisplacment"})})),o=!1}else n.setDisplacementData(null,0,0);n.setDisplacementData(e.displacementData,e.displacementWidth,e.displacementHeight)}})),i}};a.a.registerCoordinateSystem("globe",f)},function(e,t,i){var n=i(6).a.vec3;function r(e){this.radius=e,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}r.prototype={constructor:r,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(e,t,i){this.displacementData=e,this.displacementWidth=t,this.displacementHeight=i},_getDisplacementScale:function(e,t){var i=(e+180)/360*(this.displacementWidth-1),n=(90-t)/180*(this.displacementHeight-1),r=Math.round(i)+Math.round(n)*this.displacementWidth;return this.displacementData[r]},dataToPoint:function(e,t){var i=e[0],n=e[1],r=e[2]||0,a=this.radius;this.displacementData&&(a*=1+this._getDisplacementScale(i,n)),this.altitudeAxis&&(a+=this.altitudeAxis.dataToCoord(r)),i=i*Math.PI/180,n=n*Math.PI/180;var o=Math.cos(n)*a;return(t=t||[])[0]=-o*Math.cos(i+Math.PI),t[1]=Math.sin(n)*a,t[2]=o*Math.sin(i+Math.PI),t},pointToData:function(e,t){var i=e[0],r=e[1],a=e[2],o=n.len(e);i/=o,r/=o,a/=o;var s=Math.asin(r),l=Math.atan2(a,-i);l<0&&(l=2*Math.PI+l);var u=180*s/Math.PI,h=180*l/Math.PI-180;return(t=t||[])[0]=h,t[1]=u,t[2]=o-this.radius,this.altitudeAxis&&(t[2]=this.altitudeAxis.coordToData(t[2])),t}},t.a=r},function(e,t,i){var n=i(0),r=i.n(n);i(214),i(216),i(217),r.a.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"mapbox3D",query:e},(function(t){t.setMapboxCameraOption(e)}))}))},function(e,t,i){var n=i(215),r=i(0),a=i.n(r),o=i(101),s=Object(o.a)("mapbox3D",n.a,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMapboxCameraOption())}))}));a.a.registerCoordinateSystem("mapbox3D",s)},function(e,t,i){var n=i(100);function r(){n.a.apply(this,arguments)}r.prototype=new n.a,r.prototype.constructor=r,r.prototype.type="mapbox3D",t.a=r},function(e,t,i){var n=i(0),r=i.n(n),a=i(28),o=i(29),s=["zoom","center","pitch","bearing"],l=r.a.extendComponentModel({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var e=this;return s.reduce((function(t,i){return t[i]=e.get(i),t}),{})},setMapboxCameraOption:function(e){null!=e&&s.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMapbox:function(){return this._mapbox},setMapbox:function(e){this._mapbox=e}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(218),o=i(30),s=i(1),l=i(102);s.a.Shader.import(l.a),r.a.extendComponentView({type:"mapbox3D",__ecgl__:!0,init:function(e,t){var i=t.getZr();this._zrLayer=new a.a("mapbox3D",i),i.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new s.a.Node,this._sceneHelper=new o.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var n=this._zrLayer.getMapbox(),r=this._dispatchInteractAction.bind(this,t,n);["zoom","rotate","drag","pitch","rotate","move"].forEach((function(e){n.on(e,r)})),this._groundMesh=new s.a.Mesh({geometry:new s.a.PlaneGeometry,material:new s.a.Material({shader:new s.a.Shader({vertex:s.a.Shader.source("ecgl.displayShadow.vertex"),fragment:s.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(e,t,i){var n=this._zrLayer.getMapbox(),r=e.get("style"),a=JSON.stringify(r);a!==this._oldStyleStr&&r&&n.setStyle(r),this._oldStyleStr=a,n.setCenter(e.get("center")),n.setZoom(e.get("zoom")),n.setPitch(e.get("pitch")),n.setBearing(e.get("bearing")),e.setMapbox(n);var o=e.coordinateSystem;o.viewGL.scene.add(this._lightRoot),o.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),i),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._mapbox3DModel=e},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,i,n){e.coordinateSystem.setCameraOption(n),this._updateGroundMesh(),i.getZr().refresh()},_dispatchInteractAction:function(e,t,i){e.dispatchAction({type:"mapbox3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){if(this._mapbox3DModel){var e=this._mapbox3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var i=new s.a.Plane(new s.a.Vector3(0,0,1),0),n=e.viewGL.camera.castRay(new s.a.Vector2(-1,-1)),r=e.viewGL.camera.castRay(new s.a.Vector2(1,1)),a=n.intersectPlane(i),o=r.intersectPlane(i),l=a.dist(o)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(l,l,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}})},function(e,t,i){function n(e,t){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}n.prototype.resize=function(){this._mapbox.resize()},n.prototype.getMapbox=function(){return this._mapbox},n.prototype.clear=function(){},n.prototype.refresh=function(){this._mapbox.resize()};var r=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];n.prototype._initEvents=function(){var e=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},r.forEach((function(t){this._handlers[t]=function(t){var i={};for(var n in t)i[n]=t[n];i.bubbles=!1;var r=new t.constructor(t.type,i);e.dispatchEvent(r)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},n.prototype.dispose=function(){r.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this)},t.a=n},function(e,t,i){var n=i(0),r=i.n(n);i(220),i(222),i(223),r.a.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},(function(e,t){t.eachComponent({mainType:"maptalks3D",query:e},(function(t){t.setMaptalksCameraOption(e)}))}))},function(e,t,i){var n=i(221),r=i(0),a=i.n(r),o=i(101),s=Object(o.a)("maptalks3D",n.a,(function(e){e.forEach((function(e){e.setCameraOption(e.model.getMaptalksCameraOption())}))}));a.a.registerCoordinateSystem("maptalks3D",s)},function(e,t,i){var n=i(100);function r(){n.a.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}r.prototype=new n.a,r.prototype.constructor=r,r.prototype.type="maptalks3D",t.a=r},function(e,t,i){var n=i(0),r=i.n(n),a=i(28),o=i(29),s=["zoom","center","pitch","bearing"],l=r.a.extendComponentModel({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'© <a href="http://osm.org">OpenStreetMap</a> contributors, © <a href="https://carto.com/">CARTO</a>',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var e=this;return s.reduce((function(t,i){return t[i]=e.get(i),t}),{})},setMaptalksCameraOption:function(e){null!=e&&s.forEach((function(t){null!=e[t]&&(this.option[t]=e[t])}),this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(e){this._maptalks=e}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(224),o=i(30),s=i(1),l=i(102);s.a.Shader.import(l.a),r.a.extendComponentView({type:"maptalks3D",__ecgl__:!0,init:function(e,t){this._groundMesh=new s.a.Mesh({geometry:new s.a.PlaneGeometry,material:new s.a.Material({shader:new s.a.Shader({vertex:s.a.Shader.source("ecgl.displayShadow.vertex"),fragment:s.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(e,t){var i=t.getZr();this._zrLayer=new a.a("maptalks3D",i,e.get("center"),e.get("zoom")),i.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new s.a.Node,this._sceneHelper=new o.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var n=this._zrLayer.getMaptalks(),r=this._dispatchInteractAction.bind(this,t,n);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend"].forEach((function(e){n.on(e,r)}))},render:function(e,t,i){this._zrLayer||this._initMaptalksLayer(e,i);var n=this._zrLayer.getMaptalks(),r=e.get("urlTemplate"),a=n.getBaseLayer();r!==this._oldUrlTemplate&&(a?a.setOptions({urlTemplate:r,attribution:e.get("attribution")}):(a=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:r,subdomains:["a","b","c"],attribution:e.get("attribution")}),n.setBaseLayer(a))),this._oldUrlTemplate=r,n.setCenter(e.get("center")),n.setZoom(e.get("zoom"),{animation:!1}),n.setPitch(e.get("pitch")),n.setBearing(e.get("bearing")),e.setMaptalks(n);var o=e.coordinateSystem;o.viewGL.scene.add(this._lightRoot),o.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(e),o.viewGL.setPostEffect(e.getModel("postEffect"),i),o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")),this._maptalks3DModel=e},afterRender:function(e,t,i,n){var r=n.renderer;this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i),e.coordinateSystem.viewGL.scene.traverse((function(e){e.material&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(e,t,i,n){e.coordinateSystem.setCameraOption(n),this._updateGroundMesh(),i.getZr().refresh()},_dispatchInteractAction:function(e,t,i){e.dispatchAction({type:"maptalks3DChangeCamera",pitch:t.getPitch(),zoom:t.getZoom(),center:t.getCenter().toArray(),bearing:t.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){if(this._maptalks3DModel){var e=this._maptalks3DModel.coordinateSystem,t=e.dataToPoint(e.center);this._groundMesh.position.set(t[0],t[1],-.001);var i=new s.a.Plane(new s.a.Vector3(0,0,1),0),n=e.viewGL.camera.castRay(new s.a.Vector2(-1,-1)),r=e.viewGL.camera.castRay(new s.a.Vector2(1,1)),a=n.intersectPlane(i),o=r.intersectPlane(i),l=a.dist(o)/e.viewGL.rootNode.scale.x;this._groundMesh.scale.set(l,l,1)}},dispose:function(e,t){this._zrLayer&&this._zrLayer.dispose(),t.getZr().painter.delLayer(-1e3)}})},function(e,t,i){function n(e,t,i,n){if(this.id=e,this.zr=t,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:i,zoom:n,fog:!1}),this._initEvents()}n.prototype.resize=function(){this._maptalks.checkSize()},n.prototype.getMaptalks=function(){return this._maptalks},n.prototype.clear=function(){},n.prototype.refresh=function(){this._maptalks.checkSize()};var r=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];n.prototype._initEvents=function(){var e=this.dom;this._handlers=this._handlers||{contextmenu:function(e){return e.preventDefault(),!1}},r.forEach((function(t){this._handlers[t]=function(i){var n={};for(var r in i)n[r]=i[r];n.bubbles=!1;var a=new i.constructor(i.type,n);"mousewheel"===t||"DOMMouseScroll"===t?e.dispatchEvent(a):e.firstElementChild.dispatchEvent(a)},this.zr.dom.addEventListener(t,this._handlers[t])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},n.prototype.dispose=function(){r.forEach((function(e){this.zr.dom.removeEventListener(e,this._handlers[e])}),this),this._maptalks.remove()},t.a=n},function(e,t,i){var n=i(0),r=i.n(n);i(226),i(229),i(231);var a=i(17);r.a.registerVisual(Object(a.a)("bar3D")),r.a.registerProcessor((function(e,t){e.eachSeriesByType("bar3d",(function(e){var t=e.getData();t.filterSelf((function(e){return t.hasValue(e)}))}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(3),o=i(6),s=i(227),l=i(228),u=o.a.vec3,h=r.a.helper.dataStack.isDimensionStacked;function c(e,t){var i=h(e,t[2]);return{dimension:i?e.getCalculationInfo("stackResultDimension"):t[2],isStacked:i}}r.a.registerLayout((function(e,t){e.eachSeriesByType("bar3D",(function(e){var t=e.coordinateSystem,i=t&&t.type;if("globe"===i)!function(e,t){var i=e.getData(),n=e.get("minHeight")||0,o=e.get("barSize"),s=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==o){var h=t.radius*Math.PI,d=Object(l.a)(i,s[0],s[1]);o=[h/Math.sqrt(i.count()/d),h/Math.sqrt(i.count()/d)]}else r.a.util.isArray(o)||(o=[o,o]);var f=c(i,s);i.each(s,(function(e,r,a,s){var l=i.get(f.dimension,s),h=f.isStacked?l-a:t.altitudeAxis.scale.getExtent()[0],c=Math.max(t.altitudeAxis.dataToCoord(a),n),d=t.dataToPoint([e,r,h]),p=t.dataToPoint([e,r,l]),g=u.sub([],p,d);u.normalize(g,g);var m=[o[0],c,o[1]];i.setItemLayout(s,[d,g,m])})),i.setLayout("orient",a.a.UP.array)}(e,t);else if("cartesian3D"===i)Object(s.a)(e,t);else if("geo3D"===i)!function(e,t){var i=e.getData(),n=e.get("barSize"),a=e.get("minHeight")||0,o=["lng","lat","alt"].map((function(t){return e.coordDimToDataDim(t)[0]}));if(null==n){var s=Math.min(t.size[0],t.size[2]),u=Object(l.a)(i,o[0],o[1]);n=[s/Math.sqrt(i.count()/u),s/Math.sqrt(i.count()/u)]}else r.a.util.isArray(n)||(n=[n,n]);var h=[0,1,0],d=c(i,o);i.each(o,(function(e,r,o,s){var l=i.get(d.dimension,s),u=d.isStacked?l-o:t.altitudeAxis.scale.getExtent()[0],c=Math.max(t.altitudeAxis.dataToCoord(o),a),f=t.dataToPoint([e,r,u]),p=[n[0],c,n[1]];i.setItemLayout(s,[f,h,p])})),i.setLayout("orient",[1,0,0])}(e,t);else{if("mapbox3D"!==i&&"maptalks3D"!==i)throw t?new Error("bar3D doesn't support coordinate system "+t.type):new Error("bar3D doesn't have coordinate system.");!function(e,t){var i=e.getData(),n=e.coordDimToDataDim("lng")[0],a=e.coordDimToDataDim("lat")[0],o=e.coordDimToDataDim("alt")[0],s=e.get("barSize"),u=e.get("minHeight")||0;if(null==s){var h=i.getDataExtent(n),d=i.getDataExtent(a),f=t.dataToPoint([h[0],d[0]]),p=t.dataToPoint([h[1],d[1]]),g=Math.min(Math.abs(f[0]-p[0]),Math.abs(f[1]-p[1]))||1,m=Object(l.a)(i,n,a);s=[g/Math.sqrt(i.count()/m),g/Math.sqrt(i.count()/m)]}else r.a.util.isArray(s)||(s=[s,s]),s[0]/=t.getScale()/16,s[1]/=t.getScale()/16;var v=[0,0,1],y=[n,a,o],_=c(i,y);i.each(y,(function(e,n,r,a){var o=i.get(_.dimension,a),l=_.isStacked?o-r:0,h=t.dataToPoint([e,n,l]),c=t.dataToPoint([e,n,o]),d=Math.max(c[2]-h[2],u),f=[s[0],d,s[1]];i.setItemLayout(a,[h,v,f])})),i.setLayout("orient",[1,0,0])}(e,t)}}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(6).a.vec3,o=r.a.helper.dataStack.isDimensionStacked;t.a=function(e,t){var i=e.getData(),n=e.get("barSize");if(null==n){var s,l,u=t.size,h=t.getAxis("x"),c=t.getAxis("y");s="category"===h.type?.7*h.getBandWidth():.6*Math.round(u[0]/Math.sqrt(i.count())),l="category"===c.type?.7*c.getBandWidth():.6*Math.round(u[1]/Math.sqrt(i.count())),n=[s,l]}else r.a.util.isArray(n)||(n=[n,n]);var d,f,p,g=t.getAxis("z").scale.getExtent(),m=(f=(d=g)[0],p=d[1],!(f>0&&p>0||f<0&&p<0)),v=["x","y","z"].map((function(t){return e.coordDimToDataDim(t)[0]})),y=o(i,v[2]),_=y?i.getCalculationInfo("stackResultDimension"):v[2];i.each(v,(function(e,r,o,s){var l=i.get(_,s),u=y?l-o:m?0:g[0],h=t.dataToPoint([e,r,u]),c=t.dataToPoint([e,r,l]),d=a.dist(h,c),f=[0,c[1]<h[1]?-1:1,0];0===Math.abs(d)&&(d=.1);var p=[n[0],d,n[1]];i.setItemLayout(s,[h,f,p])})),i.setLayout("orient",[1,0,0])}},function(e,t,i){t.a=function(e,t,i){for(var n=e.getDataExtent(t),r=e.getDataExtent(i),a=n[1]-n[0]||n[0],o=r[1]-r[0]||r[0],s=new Uint8Array(2500),l=0;l<e.count();l++){var u=e.get(t,l),h=e.get(i,l),c=Math.floor((u-n[0])/a*49),d=50*Math.floor((h-r[0])/o*49)+c;s[d]=s[d]||1}var f=0;for(l=0;l<s.length;l++)s[l]&&f++;return f/s.length}},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(32),l=i(230),u=i(66),h=i(6).a.vec3;r.a.extendChartView({type:"bar3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._api=t,this._labelsBuilder=new u.a(256,256,t);var i=this;this._labelsBuilder.getLabelPosition=function(e,t,n){if(i._data){var r=i._data.getItemLayout(e),a=r[0],o=r[1],s=r[2][1];return h.scaleAndAdd([],a,o,n+s)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(e,t,i){var n=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=n,this._barMesh||(this._barMesh=new a.a.Mesh({geometry:new l.a,shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:"cartesian3D"===e.coordinateSystem.type,renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var r=e.coordinateSystem;if(this._doRender(e,i),r&&r.viewGL){r.viewGL.add(this.groupGL);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._barMesh.material[o]("fragment","SRGB_DECODE")}this._data=e.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(e)},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,e)},_doRender:function(e,t){var i=e.getData(),n=e.get("shading"),r="color"!==n,o=this,s=this._barMesh,l="ecgl."+n;s.material&&s.material.shader.name===l||(s.material=a.a.createMaterial(l,["VERTEX_COLOR"])),a.a.setMaterialFromModel(n,s.material,e,t),s.geometry.enableNormal=r,s.geometry.resetOffset();var u=e.get("bevelSize"),h=e.get("bevelSmoothness");s.geometry.bevelSegments=h,s.geometry.bevelSize=u;var c=[],d=new Float32Array(4*i.count()),f=0,p=0,g=!1;i.each((function(e){if(i.hasValue(e)){var t=i.getItemVisual(e,"color"),n=i.getItemVisual(e,"opacity");null==n&&(n=1),a.a.parseColor(t,c),c[3]*=n,d[f++]=c[0],d[f++]=c[1],d[f++]=c[2],d[f++]=c[3],c[3]>0&&(p++,c[3]<.99&&(g=!0))}})),s.geometry.setBarCount(p);var m=i.getLayout("orient"),v=this._barIndexOfData=new Int32Array(i.count());p=0,i.each((function(e){if(i.hasValue(e)){var t=i.getItemLayout(e),n=t[0],r=t[1],a=t[2],s=4*e;c[0]=d[s++],c[1]=d[s++],c[2]=d[s++],c[3]=d[s++],c[3]>0&&(o._barMesh.geometry.addBar(n,r,m,a,c,e),v[e]=p++)}else v[e]=-1})),s.geometry.dirty(),s.geometry.updateBoundingBox();var y=s.material;y.transparent=g,y.depthMask=!g,s.geometry.sortTriangles=g,this._initHandler(e,t)},_initHandler:function(e,t){var i=e.getData(),n=this._barMesh,r="cartesian3D"===e.coordinateSystem.type;n.seriesIndex=e.seriesIndex;var a=-1;n.off("mousemove"),n.off("mouseout"),n.on("mousemove",(function(e){var o=n.geometry.getDataIndexOfVertex(e.triangle[0]);o!==a&&(this._downplay(a),this._highlight(o),this._labelsBuilder.updateLabels([o]),r&&t.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get("x",o),i.get("y",o),i.get("z",o,!0)]})),a=o,n.dataIndex=o}),this),n.on("mouseout",(function(e){this._downplay(a),this._labelsBuilder.updateLabels(),a=-1,n.dataIndex=-1,r&&t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(e){var t=this._data;if(t){var i=this._barIndexOfData[e];if(!(i<0)){var n=t.getItemModel(e).getModel("emphasis.itemStyle"),o=n.get("color"),s=n.get("opacity");if(null==o){var l=t.getItemVisual(e,"color");o=r.a.color.lift(l,-.4)}null==s&&(s=t.getItemVisual(e,"opacity"));var u=a.a.parseColor(o);u[3]*=s,this._barMesh.geometry.setColor(i,u),this._api.getZr().refresh()}}},_downplay:function(e){var t=this._data;if(t){var i=this._barIndexOfData[e];if(!(i<0)){var n=t.getItemVisual(e,"color"),r=t.getItemVisual(e,"opacity"),o=a.a.parseColor(n);o[3]*=r,this._barMesh.geometry.setColor(i,o),this._api.getZr().refresh()}}},highlight:function(e,t,i,n){this._toggleStatus("highlight",e,t,i,n)},downplay:function(e,t,i,n){this._toggleStatus("downplay",e,t,i,n)},_toggleStatus:function(e,t,i,n,a){var l=t.getData(),u=o.a.queryDataIndex(l,a),h=this;null!=u?r.a.util.each(s.a.normalizeToArray(u),(function(t){"highlight"===e?this._highlight(t):this._downplay(t)}),this):l.each((function(t){"highlight"===e?h._highlight(t):h._downplay(t)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,i){var n,r,a,o,s,l,u,h,c=i(0),d=i.n(c),f=i(38),p=i(65),g=i(15),m=i(6),v=m.a.vec3,y=m.a.mat3,_=g.a.extend((function(){return{attributes:{position:new g.a.Attribute("position","float",3,"POSITION"),normal:new g.a.Attribute("normal","float",3,"NORMAL"),color:new g.a.Attribute("color","float",4,"COLOR"),prevPosition:new g.a.Attribute("prevPosition","float",3),prevNormal:new g.a.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(e){var t=this.enableNormal,i=this.getBarVertexCount()*e,n=this.getBarTriangleCount()*e;this.vertexCount!==i&&(this.attributes.position.init(i),t?this.attributes.normal.init(i):this.attributes.normal.value=null,this.attributes.color.init(i)),this.triangleCount!==n&&(this.indices=i>65535?new Uint32Array(3*n):new Uint16Array(3*n),this._dataIndices=new Uint32Array(i))},getBarVertexCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarVertexCount(e):this.enableNormal?24:8},getBarTriangleCount:function(){var e=this.bevelSize>0?this.bevelSegments:0;return e>0?this._getBevelBarTriangleCount(e):12},_getBevelBarVertexCount:function(e){return 4*(e+1)*(e+1)*2},_getBevelBarTriangleCount:function(e){return(4*e+3+1)*(2*e+1)*2+4},setColor:function(e,t){for(var i=this.getBarVertexCount(),n=i*(e+1),r=i*e;r<n;r++)this.attributes.color.set(r,t);this.dirtyAttribute("color")},getDataIndexOfVertex:function(e){return this._dataIndices?this._dataIndices[e]:null},addBar:function(){for(var e=v.create,t=v.scaleAndAdd,i=e(),n=e(),r=e(),a=e(),o=e(),s=e(),l=e(),u=[],h=[],c=0;c<8;c++)u[c]=e();var d=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],f=[0,1,2,0,2,3],p=[];for(c=0;c<d.length;c++)for(var g=d[c],m=0;m<2;m++){for(var y=[],_=0;_<3;_++)y.push(g[f[3*m+_]]);p.push(y)}return function(e,c,g,m,y,_){var x=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(e,c,g,m,this.bevelSize,this.bevelSegments,y);else{v.copy(r,c),v.normalize(r,r),v.cross(a,g,r),v.normalize(a,a),v.cross(n,r,a),v.normalize(a,a),v.negate(o,n),v.negate(s,r),v.negate(l,a),t(u[0],e,n,m[0]/2),t(u[0],u[0],a,m[2]/2),t(u[1],e,n,m[0]/2),t(u[1],u[1],l,m[2]/2),t(u[2],e,o,m[0]/2),t(u[2],u[2],l,m[2]/2),t(u[3],e,o,m[0]/2),t(u[3],u[3],a,m[2]/2),t(i,e,r,m[1]),t(u[4],i,n,m[0]/2),t(u[4],u[4],a,m[2]/2),t(u[5],i,n,m[0]/2),t(u[5],u[5],l,m[2]/2),t(u[6],i,o,m[0]/2),t(u[6],u[6],l,m[2]/2),t(u[7],i,o,m[0]/2),t(u[7],u[7],a,m[2]/2);var b=this.attributes;if(this.enableNormal){h[0]=n,h[1]=o,h[2]=r,h[3]=s,h[4]=a,h[5]=l;for(var w=this._vertexOffset,T=0;T<d.length;T++){for(var S=3*this._triangleOffset,M=0;M<6;M++)this.indices[S++]=w+f[M];w+=4,this._triangleOffset+=2}for(T=0;T<d.length;T++){var A=h[T];for(M=0;M<4;M++){var I=d[T][M];b.position.set(this._vertexOffset,u[I]),b.normal.set(this._vertexOffset,A),b.color.set(this._vertexOffset++,y)}}}else{for(T=0;T<p.length;T++){for(S=3*this._triangleOffset,M=0;M<3;M++)this.indices[S+M]=p[T][M]+this._vertexOffset;this._triangleOffset++}for(T=0;T<u.length;T++)b.position.set(this._vertexOffset,u[T]),b.color.set(this._vertexOffset++,y)}}var C=this._vertexOffset;for(T=x;T<C;T++)this._dataIndices[T]=_}}(),_addBevelBar:(n=v.create(),r=v.create(),a=v.create(),o=y.create(),s=[],l=[1,-1,-1,1],u=[1,1,-1,-1],h=[2,0],function(e,t,i,c,d,f,p){v.copy(r,t),v.normalize(r,r),v.cross(a,i,r),v.normalize(a,a),v.cross(n,r,a),v.normalize(a,a),o[0]=n[0],o[1]=n[1],o[2]=n[2],o[3]=r[0],o[4]=r[1],o[5]=r[2],o[6]=a[0],o[7]=a[1],o[8]=a[2],d=Math.min(c[0],c[2])/2*d;for(var g=0;g<3;g++)s[g]=Math.max(c[g]-2*d,0);var m=(c[0]-s[0])/2,y=(c[1]-s[1])/2,_=(c[2]-s[2])/2,x=[],b=[],w=this._vertexOffset,T=[];for(g=0;g<2;g++){T[g]=T[g]=[];for(var S=0;S<=f;S++)for(var M=0;M<4;M++){(0===S&&0===g||1===g&&S===f)&&T[g].push(w);for(var A=0;A<=f;A++){var I=A/f*Math.PI/2+Math.PI/2*M,C=S/f*Math.PI/2+Math.PI/2*g;b[0]=m*Math.cos(I)*Math.sin(C),b[1]=y*Math.cos(C),b[2]=_*Math.sin(I)*Math.sin(C),x[0]=b[0]+l[M]*s[0]/2,x[1]=b[1]+y+h[g]*s[1]/2,x[2]=b[2]+u[M]*s[2]/2,Math.abs(m-y)<1e-6&&Math.abs(y-_)<1e-6||(b[0]/=m*m,b[1]/=y*y,b[2]/=_*_),v.normalize(b,b),v.transformMat3(x,x,o),v.transformMat3(b,b,o),v.add(x,x,e),this.attributes.position.set(w,x),this.enableNormal&&this.attributes.normal.set(w,b),this.attributes.color.set(w,p),w++}}}var D=4*f+3,E=2*f+1,L=D+1;for(M=0;M<E;M++)for(g=0;g<=D;g++){var P=M*L+g+this._vertexOffset,N=M*L+(g+1)%L+this._vertexOffset,R=(M+1)*L+(g+1)%L+this._vertexOffset,O=(M+1)*L+g+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[R,P,N]),this.setTriangleIndices(this._triangleOffset++,[R,O,P])}this.setTriangleIndices(this._triangleOffset++,[T[0][0],T[0][2],T[0][1]]),this.setTriangleIndices(this._triangleOffset++,[T[0][0],T[0][3],T[0][2]]),this.setTriangleIndices(this._triangleOffset++,[T[1][0],T[1][1],T[1][2]]),this.setTriangleIndices(this._triangleOffset++,[T[1][0],T[1][2],T[1][3]]),this._vertexOffset=w})});d.a.util.defaults(_.prototype,f.a),d.a.util.defaults(_.prototype,p.a),t.a=_},function(e,t,i){var n=i(0),r=i.n(n),a=i(31),o=i(32),s=i(39),l=i(50),u=r.a.extendSeriesModel({type:"series.bar3D",dependencies:["globe"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){return Object(l.a)(this)},getFormattedLabel:function(e,t,i,n){var r=o.a.getFormattedLabel(this,e,t,i,n);return null==r&&(r=this.getData().get("z",e)),r},formatTooltip:function(e){return Object(s.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});r.a.util.merge(u.prototype,a.a)},function(e,t,i){var n=i(0),r=i.n(n);i(233),i(234);var a=i(51),o=i.n(a),s=i(17);r.a.registerVisual(o()("line3D","circle",null)),r.a.registerVisual(Object(s.a)("line3D")),r.a.registerLayout((function(e,t){e.eachSeriesByType("line3D",(function(e){var t=e.getData(),i=e.coordinateSystem;if(i){if("cartesian3D"!==i.type)return void console.error("line3D needs cartesian3D coordinateSystem");var n=new Float32Array(3*t.count()),r=[],a=[],o=i.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));i&&t.each(o,(function(e,t,o,s){r[0]=e,r[1]=t,r[2]=o,i.dataToPoint(r,a),n[3*s]=a[0],n[3*s+1]=a[1],n[3*s+2]=a[2]})),t.setLayout("points",n)}}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(39),o=i(50);r.a.extendSeriesModel({type:"series.line3D",dependencies:["grid3D"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){return Object(o.a)(this)},formatTooltip:function(e){return Object(a.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(25),l=i(9),u=i(3),h=i(235),c=i.n(h),d=i(6),f=i(46),p=d.a.vec3;a.a.Shader.import(f.a),r.a.extendChartView({type:"line3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._api=t},render:function(e,t,i){var n=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=n,this._line3DMesh||(this._line3DMesh=new a.a.Mesh({geometry:new s.a({useNativeLine:!1,sortTriangles:!0}),material:new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var r=e.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this.groupGL);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[o]("fragment","SRGB_DECODE")}this._doRender(e,i),this._data=e.getData(),this._camera=r.viewGL.camera,this.updateCamera(),this._updateAnimation(e)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(e,t){var i=e.getData(),n=this._line3DMesh;n.geometry.resetOffset();var r=i.getLayout("points"),s=[],l=new Float32Array(r.length/3*4),u=0,h=!1;i.each((function(e){var t=i.getItemVisual(e,"color"),n=i.getItemVisual(e,"opacity");null==n&&(n=1),a.a.parseColor(t,s),s[3]*=n,l[u++]=s[0],l[u++]=s[1],l[u++]=s[2],l[u++]=s[3],s[3]<.99&&(h=!0)})),n.geometry.setVertexCount(n.geometry.getPolylineVertexCount(r)),n.geometry.setTriangleCount(n.geometry.getPolylineTriangleCount(r)),n.geometry.addPolyline(r,l,o.a.firstNotNull(e.get("lineStyle.width"),1)),n.geometry.dirty(),n.geometry.updateBoundingBox();var c=n.material;c.transparent=h,c.depthMask=!h;var d=e.getModel("debug.wireframe");d.get("show")?(n.geometry.createAttribute("barycentric","float",3),n.geometry.generateBarycentric(),n.material.set("both","WIREFRAME_TRIANGLE"),n.material.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")||"rgba(0,0,0,0.5)")),n.material.set("wireframeLineWidth",o.a.firstNotNull(d.get("lineStyle.width"),1))):n.material.set("both","WIREFRAME_TRIANGLE"),this._points=r,this._initHandler(e,t)},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,e)},_initHandler:function(e,t){var i=e.getData(),n=e.coordinateSystem,r=this._line3DMesh,a=-1;r.seriesIndex=e.seriesIndex,r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(e){var o=n.pointToData(e.point.array),s=i.indicesOfNearest("x",o[0])[0];s!==a&&(t.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get("x",s),i.get("y",s),i.get("z",s)]}),r.dataIndex=s),a=s}),this),r.on("mouseout",(function(e){a=-1,r.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateNDCPosition:function(){var e=new l.a,t=this._camera;l.a.multiply(e,t.projectionMatrix,t.viewMatrix);var i=this._positionNDC,n=this._points,r=n.length/3;i&&i.length/2===r||(i=this._positionNDC=new Float32Array(2*r));for(var a=[],o=0;o<r;o++){var s=3*o,u=2*o;a[0]=n[s],a[1]=n[s+1],a[2]=n[s+2],a[3]=1,p.transformMat4(a,a,e.array),i[u]=a[0]/a[3],i[u+1]=a[1]/a[3]}},_pick:function(e,t,i,n,r,a){var o=this._positionNDC,s=this._data.hostModel.get("lineStyle.width"),l=-1,h=.5*i.viewport.width,d=.5*i.viewport.height;e=(e+1)*h,t=(t+1)*d;for(var f=1;f<o.length/2;f++){var p=(o[2*(f-1)]+1)*h,g=(o[2*(f-1)+1]+1)*d,m=(o[2*f]+1)*h,v=(o[2*f+1]+1)*d;c.a.containStroke(p,g,m,v,s,e,t)&&(l=(p-e)*(p-e)+(g-t)*(g-t)<(m-e)*(m-e)+(v-t)*(v-t)?f-1:f)}if(l>=0){var y=3*l,_=new u.a(this._points[y],this._points[y+1],this._points[y+2]);a.push({dataIndex:l,point:_,pointWorld:_.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(_)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t){t.containStroke=function(e,t,i,n,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>t+s&&o>n+s||o<t-s&&o<n-s||a>e+s&&a>i+s||a<e-s&&a<i-s)return!1;if(e===i)return Math.abs(a-e)<=s/2;var u=(l=(t-n)/(e-i))*a-o+(e*n-i*t)/(e-i);return u*u/(l*l+1)<=s/2*s/2}},function(e,t,i){var n=i(0),r=i.n(n);i(237),i(238);var a=i(51),o=i.n(a),s=i(17);r.a.registerVisual(o()("scatter3D","circle",null)),r.a.registerVisual(Object(s.a)("scatter3D")),r.a.registerLayout({seriesType:"scatter3D",reset:function(e){var t=e.coordinateSystem;if(t){var i=t.dimensions;if(i.length<3)return void console.error("scatter3D needs 3D coordinateSystem");var n=i.map((function(t){return e.coordDimToDataDim(t)[0]})),r=[],a=[];return{progress:function(e,i){for(var o=new Float32Array(3*(e.end-e.start)),s=e.start;s<e.end;s++){var l=3*(s-e.start);r[0]=i.get(n[0],s),r[1]=i.get(n[1],s),r[2]=i.get(n[2],s),t.dataToPoint(r,a),o[l]=a[0],o[l+1]=a[1],o[l+2]=a[2]}i.setLayout("points",o)}}}}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(32),o=i(39),s=i(50);r.a.extendSeriesModel({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){return Object(s.a)(this)},getFormattedLabel:function(e,t,i,n){var r=a.a.getFormattedLabel(this,e,t,i,n);if(null==r){var o=this.getData(),s=o.dimensions[o.dimensions.length-1];r=o.get(s,e)}return r},formatTooltip:function(e){return Object(o.a)(this,e)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(32),l=i(67);r.a.extendChartView({type:"scatter3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(e,t,i){if(this.groupGL.removeAll(),e.getData().count()){var n=e.coordinateSystem;if(!n||!n.viewGL)throw new Error("Invalid coordinate system");n.viewGL.add(this.groupGL),this._camera=n.viewGL.camera;var r=this._pointsBuilderList[0];r||(r=this._pointsBuilderList[0]=new l.a(!1,i)),this._pointsBuilderList.length=1,this.groupGL.add(r.rootNode),r.update(e,t,i),r.updateView(n.viewGL.camera)}},incrementalPrepareRender:function(e,t,i){var n=e.coordinateSystem;if(!n||!n.viewGL)throw new Error("Invalid coordinate system");n.viewGL.add(this.groupGL),this._camera=n.viewGL.camera,this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(e,t,i,n){if(!(e.end<=e.start)){var r=this._pointsBuilderList[this._currentStep];r||(r=new l.a(!1,n),this._pointsBuilderList[this._currentStep]=r),this.groupGL.add(r.rootNode),r.update(t,i,n,e.start,e.end),r.updateView(t.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach((function(e){e.updateView(this._camera)}),this)},highlight:function(e,t,i,n){this._toggleStatus("highlight",e,t,i,n)},downplay:function(e,t,i,n){this._toggleStatus("downplay",e,t,i,n)},_toggleStatus:function(e,t,i,n,a){var l=t.getData(),u=o.a.queryDataIndex(l,a),h="highlight"===e;null!=u?r.a.util.each(s.a.normalizeToArray(u),(function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var i=this._pointsBuilderList[t];h?i.highlight(l,e):i.downplay(l,e)}}),this):l.each((function(e){for(var t=0;t<this._pointsBuilderList.length;t++){var i=this._pointsBuilderList[t];h?i.highlight(l,e):i.downplay(l,e)}}))},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0),r=i.n(n);function a(e,t,i){(t=t||document.createElement("canvas")).width=e,t.height=e;var n=t.getContext("2d");return i&&i(n),t}var o={getMarginByStyle:function(e){var t=e.minMargin||0,i=0;e.stroke&&"none"!==e.stroke&&(i=null==e.lineWidth?1:e.lineWidth);var n=e.shadowBlur||0,r=e.shadowOffsetX||0,a=e.shadowOffsetY||0,o={};return o.left=Math.max(i/2,-r+n,t),o.right=Math.max(i/2,r+n,t),o.top=Math.max(i/2,-a+n,t),o.bottom=Math.max(i/2,a+n,t),o},createSymbolSprite:function(e,t,i,n){var s=function(e,t,i,n){r.a.util.isArray(t)||(t=[t,t]);var a=o.getMarginByStyle(i,n),s=t[0]+a.left+a.right,l=t[1]+a.top+a.bottom,u=r.a.helper.createSymbol(e,0,0,t[0],t[1]),h=Math.max(s,l);u.position=[a.left,a.top],s>l?u.position[1]+=(h-l)/2:u.position[0]+=(h-s)/2;var c=u.getBoundingRect();return u.position[0]-=c.x,u.position[1]-=c.y,u.setStyle(i),u.update(),u.__size=h,u}(e,t,i),l=o.getMarginByStyle(i);return{image:a(s.__size,n,(function(e){s.brush(e)})),margin:l}},createSDFFromCanvas:function(e,t,i,n){return a(t,n,(function(t){var n=e.getContext("2d").getImageData(0,0,e.width,e.height);t.putImageData(function(e,t,i){var n=t.width,r=t.height,a=e.canvas.width,o=e.canvas.height,s=n/a,l=r/o;function u(e){return e<128?1:-1}function h(e,a){var o=1/0;e=Math.floor(e*s);for(var h=(a=Math.floor(a*l))*n+e,c=u(t.data[4*h]),d=Math.max(a-i,0);d<Math.min(a+i,r);d++)for(var f=Math.max(e-i,0);f<Math.min(e+i,n);f++){h=d*n+f;var p=f-e,g=d-a;if(c!==u(t.data[4*h])){var m=p*p+g*g;m<o&&(o=m)}}return c*Math.sqrt(o)}for(var c=e.createImageData(a,o),d=0;d<o;d++)for(var f=0;f<a;f++){var p=h(f,d)/i*.5+.5,g=4*(d*a+f);c.data[g++]=255*(1-p),c.data[g++]=255*(1-p),c.data[g++]=255*(1-p),c.data[g++]=255}return c}(t,n,i),0,0)}))},createSimpleSprite:function(e,t){return a(e,t,(function(t){var i=e/2;t.beginPath(),t.arc(i,i,60,0,2*Math.PI,!1),t.closePath();var n=t.createRadialGradient(i,i,0,i,i,i);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=n,t.fill()}))}};t.a=o},function(e,t,i){var n=i(1),r=i(241),a=i(0),o=i.n(a),s=i(6),l=i(242),u=s.a.vec4;n.a.Shader.import(l.a);var h=n.a.Mesh.extend((function(){var e=new n.a.Geometry({dynamic:!0,attributes:{color:new n.a.Geometry.Attribute("color","float",4,"COLOR"),position:new n.a.Geometry.Attribute("position","float",3,"POSITION"),size:new n.a.Geometry.Attribute("size","float",1),prevPosition:new n.a.Geometry.Attribute("prevPosition","float",3),prevSize:new n.a.Geometry.Attribute("prevSize","float",1)}});o.a.util.extend(e,r.a);var t=new n.a.Material({shader:n.a.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});t.enableTexture("sprite"),t.define("both","VERTEX_COLOR"),t.define("both","VERTEX_SIZE");var i=new n.a.Texture2D({image:document.createElement("canvas"),flipY:!1});return t.set("sprite",i),e.pick=this._pick.bind(this),{geometry:e,material:t,mode:n.a.Mesh.POINTS,sizeScale:1}}),{_pick:function(e,t,i,r,a,o){var s=this._positionNDC;if(s)for(var l=i.viewport,u=2/l.width,h=2/l.height,c=this.geometry.vertexCount-1;c>=0;c--){var d,f=s[2*(d=this.geometry.indices?this.geometry.indices[c]:c)],p=s[2*d+1],g=this.geometry.attributes.size.get(d)/this.sizeScale/2;if(e>f-g*u&&e<f+g*u&&t>p-g*h&&t<p+g*h){var m=new n.a.Vector3,v=new n.a.Vector3;this.geometry.attributes.position.get(d,m.array),n.a.Vector3.transformMat4(v,m,this.worldTransform),o.push({vertexIndex:d,point:m,pointWorld:v,target:this,distance:v.distance(r.getWorldPosition())})}}},updateNDCPosition:function(e,t,i){var n=this._positionNDC,r=this.geometry;n&&n.length/2===r.vertexCount||(n=this._positionNDC=new Float32Array(2*r.vertexCount));for(var a=u.create(),o=0;o<r.vertexCount;o++)r.attributes.position.get(o,a),a[3]=1,u.transformMat4(a,a,e.array),u.scale(a,a,1/a[3]),n[2*o]=a[0],n[2*o+1]=a[1]}});t.a=h},function(e,t,i){var n=i(97),r=i(6).a.vec3;t.a={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(e,t){var i=this.indices,n=r.create();if(!i){i=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var a=0;a<i.length;a++)i[a]=a}if(0===t){var o,s=this.attributes.position,l=(e=e.array,0);for(this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount)),a=0;a<this.vertexCount;a++){s.get(a,n);var u=r.sqrDist(n,e);isNaN(u)&&(u=1e7,l++),0===a?(o=u,u=0):u-=o,this._zList[a]=u}this._noneCount=l}if(this.vertexCount<2e4)0===t&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(a=0;a<3;a++)this._progressiveQuickSort(3*t+a);this.dirtyIndices()},_simpleSort:function(e){var t=this._zList,i=this.indices;function r(e,i){return t[i]-t[e]}e?Array.prototype.sort.call(i,r):n.a.sort(i,r,0,i.length-1)},_progressiveQuickSort:function(e){var t=this._zList,i=this.indices;this._quickSort=this._quickSort||new n.a,this._quickSort.step(i,(function(e,i){return t[i]-t[e]}),e)}}},function(e,t,i){t.a="@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end"},function(e,t,i){var n=i(0),r=i.n(n);i(244),i(245),i(248);var a=i(17);r.a.registerVisual(Object(a.a)("lines3D")),r.a.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},(function(){})),r.a.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},(function(){})),r.a.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},(function(){}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(6),o=a.a.vec3,s=a.a.vec2,l=o.normalize,u=o.cross,h=o.sub,c=o.add,d=o.create,f=d(),p=d(),g=d(),m=d(),v=[],y=[];function _(e,t){s.copy(v,e[0]),s.copy(y,e[1]);var i=[],n=i[0]=d(),r=i[1]=d(),a=i[2]=d(),_=i[3]=d();t.dataToPoint(v,n),t.dataToPoint(y,_),l(f,n),h(p,_,n),l(p,p),u(g,p,f),l(g,g),u(p,f,g),c(r,f,p),l(r,r),l(f,_),h(p,n,_),l(p,p),u(g,p,f),l(g,g),u(p,f,g),c(a,f,p),l(a,a),c(m,n,_),l(m,m);var x=o.dot(n,m),b=o.dot(m,r),w=(Math.max(o.len(n),o.len(_))-x)/b*2;return o.scaleAndAdd(r,n,r,w),o.scaleAndAdd(a,_,a,w),i}function x(e,t){for(var i=new Float32Array(3*e.length),n=0,r=[],a=0;a<e.length;a++)t.dataToPoint(e[a],r),i[n++]=r[0],i[n++]=r[1],i[n++]=r[2];return i}function b(e){var t=[];return e.each((function(i){var n=e.getItemModel(i),r=n.option instanceof Array?n.option:n.getShallow("coords",!0);if(!(r instanceof Array&&r.length>0&&r[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(r)+". Lines must have 2d coords array in data item.");t.push(r)})),{coordsList:t}}function w(e,t,i){var n=e.getData(),r=e.get("polyline"),a=b(n);n.setLayout("lineType",r?"polyline":"cubicBezier"),n.each((function(e){var s=a.coordsList[e],l=r?x(s,t):function(e,t,i){var n=[],r=n[0]=o.create(),a=n[1]=o.create(),s=n[2]=o.create(),l=n[3]=o.create();t.dataToPoint(e[0],r),t.dataToPoint(e[1],l);var u=o.dist(r,l);return o.lerp(a,r,l,.3),o.lerp(s,r,l,.3),o.scaleAndAdd(a,a,i,Math.min(.1*u,10)),o.scaleAndAdd(s,s,i,Math.min(.1*u,10)),n}(s,t,i);n.setItemLayout(e,l)}))}r.a.registerLayout((function(e,t){e.eachSeriesByType("lines3D",(function(e){var t=e.coordinateSystem;"globe"===t.type?function(e,t){var i=e.getData(),n=e.get("polyline");i.setLayout("lineType",n?"polyline":"cubicBezier");var r=b(i);i.each((function(e){var a=r.coordsList[e],o=n?x:_;i.setItemLayout(e,o(a,t))}))}(e,t):"geo3D"===t.type?w(e,t,[0,1,0]):"mapbox3D"!==t.type&&"maptalks3D"!==t.type||w(e,t,[0,0,1])}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(25),s=i(246),l=i(46);a.a.Shader.import(l.a),r.a.extendChartView({type:"lines3D",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this._meshLinesMaterial=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new a.a.Mesh({geometry:new o.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new s.a},render:function(e,t,i){this.groupGL.add(this._linesMesh);var n=e.coordinateSystem,r=e.getData();if(n&&n.viewGL){n.viewGL.add(this.groupGL),this._updateLines(e,t,i);var o=n.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var s=this._trailMesh;if(s.stopAnimation(),e.get("effect.show")){this.groupGL.add(s),s.updateData(r,i,this._linesMesh.geometry),s.__time=s.__time||0;var l=36e5;this._curveEffectsAnimator=s.animate("",{loop:!0}).when(l,{__time:l}).during((function(){s.setAnimationTime(s.__time)})).start()}else this.groupGL.remove(s),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===e.get("blendMode")?a.a.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var e=this._curveEffectsAnimator;e&&(e.isPaused()?e.resume():e.pause())},_updateLines:function(e,t,i){var n=e.getData(),r=e.coordinateSystem,o=this._linesMesh.geometry,s=e.get("polyline");o.expandLine=!0;var l=function(e){return null!=e.radius?e.radius:null!=e.size?Math.max(e.size[0],e.size[1],e.size[2]):100}(r);o.segmentScale=l/20;var u="lineStyle.width".split("."),h=i.getDevicePixelRatio();n.each((function(e){var t=n.getItemModel(e).get(u);null==t&&(t=1),n.setItemVisual(e,"lineWidth",t)})),o.useNativeLine=!1;var c=0,d=0;n.each((function(e){var t=n.getItemLayout(e);s?(c+=o.getPolylineVertexCount(t),d+=o.getPolylineTriangleCount(t)):(c+=o.getCubicCurveVertexCount(t[0],t[1],t[2],t[3]),d+=o.getCubicCurveTriangleCount(t[0],t[1],t[2],t[3]))})),o.setVertexCount(c),o.setTriangleCount(d),o.resetOffset();var f=[];n.each((function(e){var t=n.getItemLayout(e),i=n.getItemVisual(e,"color"),r=n.getItemVisual(e,"opacity"),l=n.getItemVisual(e,"lineWidth")*h;null==r&&(r=1),(f=a.a.parseColor(i,f))[3]*=r,s?o.addPolyline(t,f,l):o.addCubicCurve(t[0],t[1],t[2],t[3],f,l)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0);i.n(n);var r=i(1),a=i(6),o=i(25),s=i(247),l=a.a.vec3;r.a.Shader.import(s.a),t.a=r.a.Mesh.extend((function(){var e=new r.a.Material({shader:new r.a.Shader(r.a.Shader.source("ecgl.trail2.vertex"),r.a.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),t=new o.a({dynamic:!0});return t.createAttribute("dist","float",1),t.createAttribute("distAll","float",1),t.createAttribute("start","float",1),{geometry:t,material:e,culling:!1,$ignorePicking:!0}}),{updateData:function(e,t,i){var n=e.hostModel,a=this.geometry,o=n.getModel("effect"),s=o.get("trailWidth")*t.getDevicePixelRatio(),u=o.get("trailLength"),h=n.get("effect.constantSpeed"),c=1e3*n.get("effect.period"),d=null!=h;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),d?this.material.set("speed",h/1e3):this.material.set("period",c),this.material[d?"define":"undefine"]("vertex","CONSTANT_SPEED");var f=n.get("polyline");a.trailLength=u,this.material.set("trailLength",u),a.resetOffset(),["position","positionPrev","positionNext"].forEach((function(e){a.attributes[e].value=i.attributes[e].value})),["dist","distAll","start","offset","color"].forEach((function(e){a.attributes[e].init(a.vertexCount)})),a.indices=i.indices;var p=[],g=o.get("trailColor"),m=o.get("trailOpacity"),v=null!=g,y=null!=m;this.updateWorldTransform();var _=this.worldTransform.x.len(),x=this.worldTransform.y.len(),b=this.worldTransform.z.len(),w=0,T=0;e.each((function(t){var n=e.getItemLayout(t),o=y?m:e.getItemVisual(t,"opacity"),u=e.getItemVisual(t,"color");null==o&&(o=1),(p=r.a.parseColor(v?g:u,p))[3]*=o;for(var h=f?i.getPolylineVertexCount(n):i.getCubicCurveVertexCount(n[0],n[1],n[2],n[3]),S=0,M=[],A=[],I=w;I<w+h;I++)a.attributes.position.get(I,M),M[0]*=_,M[1]*=x,M[2]*=b,I>w&&(S+=l.dist(M,A)),a.attributes.dist.set(I,S),l.copy(A,M);T=Math.max(T,S);var C=Math.random()*(d?S:c);for(I=w;I<w+h;I++)a.attributes.distAll.set(I,S),a.attributes.start.set(I,C),a.attributes.offset.set(I,(i.attributes.offset.get(I)>0?1:-1)*s/2),a.attributes.color.set(I,p);w+=h})),this.material.set("spotSize",.1*T*u),this.material.set("spotIntensity",o.get("spotIntensity")),a.dirty()},setAnimationTime:function(e){this.material.set("time",e)}})},function(e,t,i){t.a="@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end"},function(e,t,i){var n=i(0),r=i.n(n);r.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var i=new r.a.List(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,r){if(e instanceof Array)return NaN;i.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),i},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}})},function(e,t,i){var n=i(0),r=i.n(n);i(250),i(251);var a=i(17);r.a.registerVisual(Object(a.a)("polygons3D"))},function(e,t,i){var n=i(0),r=i.n(n),a=i(31);function o(e,t){for(var i=[],n=0;n<t.length;n++)i.push(e.dataToPoint(t[n]));return i}var s=r.a.extendSeriesModel({type:"series.polygons3D",getRegionModel:function(e){return this.getData().getItemModel(e)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,i=this.getData().getItemModel(e),n=i.option instanceof Array?i.option:i.getShallow("coords");i.get("multiPolygon")||(n=[n]);for(var r=[],a=0;a<n.length;a++){for(var s=[],l=1;l<n[a].length;l++)s.push(o(t,n[a][l]));r.push({exterior:o(t,n[a][0]),interiors:s})}return r},getInitialData:function(e){var t=new r.a.List(["value"],this);return t.hasItemOption=!1,t.initData(e.data,[],(function(e,i,n,r){if(e instanceof Array)return NaN;t.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),t},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});r.a.util.merge(s.prototype,a.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(64),o=i(1);r.a.extendChartView({type:"polygons3D",__ecgl__:!0,init:function(e,t){this.groupGL=new o.a.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(e,t,i){this.groupGL.removeAll();var n=e.coordinateSystem;n&&n.viewGL&&n.viewGL.add(this.groupGL);var r=this._geo3DBuilderList[0];r||((r=new a.a(i)).extrudeY="mapbox3D"!==n.type&&"maptalks3D"!==n.type,this._geo3DBuilderList[0]=r),this._updateShaderDefines(n,r),r.update(e,t,i),this._geo3DBuilderList.length=1,this.groupGL.add(r.rootNode)},incrementalPrepareRender:function(e,t,i){this.groupGL.removeAll();var n=e.coordinateSystem;n&&n.viewGL&&n.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(e,t,i,n){var r=this._geo3DBuilderList[this._currentStep],o=t.coordinateSystem;r||((r=new a.a(n)).extrudeY="mapbox3D"!==o.type&&"maptalks3D"!==o.type,this._geo3DBuilderList[this._currentStep]=r),r.update(t,i,n,e.start,e.end),this.groupGL.add(r.rootNode),this._updateShaderDefines(o,r),this._currentStep++},_updateShaderDefines:function(e,t){var i=e.viewGL.isLinearSpace()?"define":"undefine";t.rootNode.traverse((function(t){t.material&&(t.material[i]("fragment","SRGB_DECODE"),"mapbox3D"!==e.type&&"maptalks3D"!==e.type||(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1)))}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0),r=i.n(n);i(253),i(254),i(255);var a=i(17);r.a.registerVisual(Object(a.a)("surface"))},function(e,t,i){var n=i(0),r=i.n(n),a=i(31),o=i(39),s=i(50),l=r.a.extendSeriesModel({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",formatTooltip:function(e){return Object(o.a)(this,e)},getInitialData:function(e,t){var i=e.data;function n(e){return!(isNaN(e.min)||isNaN(e.max)||isNaN(e.step))}function a(e){var t=r.a.number.getPrecisionSafe;return Math.max(t(e.min),t(e.max),t(e.step))+1}if(!i)if(e.parametric){var o=e.parametricEquation||{},l=o.u||{},u=o.v||{};["u","v"].forEach((function(e){n(o[e])||console.error("Invalid parametricEquation.%s",e)})),["x","y","z"].forEach((function(e){"function"==typeof o[e]||console.error("parametricEquation.%s needs to be function",e)}));var h=Math.floor((l.max+l.step-l.min)/l.step),c=Math.floor((u.max+u.step-u.min)/u.step);i=new Float32Array(h*c*5);var d=a(l),f=a(u);for(M=0,A=0;A<c;A++)for(I=0;I<h;I++){var p=I*l.step+l.min,g=A*u.step+u.min,m=r.a.number.round(Math.min(p,l.max),d),v=r.a.number.round(Math.min(g,u.max),f);C=o.x(m,v),D=o.y(m,v),P=o.z(m,v),i[M++]=C,i[M++]=D,i[M++]=P,i[M++]=m,i[M++]=v}}else{var y=e.equation||{},_=y.x||{},x=y.y||{};if(["x","y"].forEach((function(e){n(y[e])||console.error("Invalid equation.%s",e)})),"function"!=typeof y.z)return void console.error("equation.z needs to be function");var b=Math.floor((_.max+_.step-_.min)/_.step),w=Math.floor((x.max+x.step-x.min)/x.step);i=new Float32Array(b*w*3);for(var T=a(_),S=a(x),M=0,A=0;A<w;A++)for(var I=0;I<b;I++){var C=I*_.step+_.min,D=A*x.step+x.min,E=r.a.number.round(Math.min(C,_.max),T),L=r.a.number.round(Math.min(D,x.max),S),P=y.z(E,L);i[M++]=E,i[M++]=L,i[M++]=P}}var N=["x","y","z"];return e.parametric&&N.push("u","v"),Object(s.a)(this,N,i)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},itemStyle:{},animationDurationUpdate:500}});r.a.util.merge(l.prototype,a.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1);i(2);var o=i(6),s=i(65),l=o.a.vec3;r.a.extendChartView({type:"surface",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node},render:function(e,t,i){var n=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=n,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var r=e.coordinateSystem,o=e.get("shading"),s=e.getData(),l="ecgl."+o;if(this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===l||(this._surfaceMesh.material=a.a.createMaterial(l,["VERTEX_COLOR","DOUBLE_SIDED"])),a.a.setMaterialFromModel(o,this._surfaceMesh.material,e,i),r&&r.viewGL){r.viewGL.add(this.groupGL);var u=r.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[u]("fragment","SRGB_DECODE")}var h=e.get("parametric"),c=this._getDataShape(s,h),d=e.getModel("wireframe"),f=d.get("lineStyle.width"),p=d.get("show")&&f>0;this._updateSurfaceMesh(this._surfaceMesh,e,c,p);var g=this._surfaceMesh.material;p?(g.define("WIREFRAME_QUAD"),g.set("wireframeLineWidth",f),g.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")))):g.undefine("WIREFRAME_QUAD"),this._initHandler(e,i),this._updateAnimation(e)},_updateAnimation:function(e){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new a.a.Mesh({geometry:new a.a.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),r.a.util.extend(e.geometry,s.a),e},_initHandler:function(e,t){var i=e.getData(),n=this._surfaceMesh,r=e.coordinateSystem;n.seriesIndex=e.seriesIndex;var a=-1;n.off("mousemove"),n.off("mouseout"),n.on("mousemove",(function(e){var o=function(e,t){for(var i=1/0,r=-1,a=[],o=0;o<e.length;o++){n.geometry.attributes.position.get(e[o],a);var s=l.dist(t.array,a);s<i&&(i=s,r=e[o])}return r}(e.triangle,e.point);if(o>=0){var s=[];n.geometry.attributes.position.get(o,s);for(var u=r.pointToData(s),h=1/0,c=-1,d=[],f=0;f<i.count();f++){d[0]=i.get("x",f),d[1]=i.get("y",f),d[2]=i.get("z",f);var p=l.squaredDistance(d,u);p<h&&(c=f,h=p)}c!==a&&t.dispatchAction({type:"grid3DShowAxisPointer",value:u}),a=c,n.dataIndex=c}else n.dataIndex=-1}),this),n.on("mouseout",(function(e){a=-1,n.dataIndex=-1,t.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateSurfaceMesh:function(e,t,i,n){var r=e.geometry,o=t.getData(),s=o.getLayout("points"),u=0;o.each((function(e){o.hasValue(e)||u++}));var h=u||n,c=r.attributes.position,d=r.attributes.normal,f=r.attributes.texcoord0,p=r.attributes.barycentric,g=r.attributes.color,m=i.row,v=i.column,y="color"!==t.get("shading");if(h){var _=(m-1)*(v-1)*4;c.init(_),n&&p.init(_)}else c.value=new Float32Array(s);g.init(r.vertexCount),f.init(r.vertexCount);var x,b=[0,3,1,1,3,2],w=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],T=r.indices=new(r.vertexCount>65535?Uint32Array:Uint16Array)((m-1)*(v-1)*6),S=function(e,t,i){i[1]=e*v+t,i[0]=e*v+t+1,i[3]=(e+1)*v+t+1,i[2]=(e+1)*v+t},M=!1;if(h){var A=[],I=[],C=0;y?d.init(r.vertexCount):d.value=null;for(var D=[[],[],[]],E=[],L=[],P=l.create(),N=function(e,t,i){var n=3*t;return i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i},R=new Float32Array(s.length),O=new Float32Array(s.length/3*4),k=0;k<o.count();k++)if(o.hasValue(k)){var z=a.a.parseColor(o.getItemVisual(k,"color")),B=o.getItemVisual(k,"opacity");z[3]*=B,z[3]<.99&&(M=!0);for(var F=0;F<4;F++)O[4*k+F]=z[F]}var V=[1e7,1e7,1e7];for(k=0;k<m-1;k++)for(var G=0;G<v-1;G++){var H=4*(k*(v-1)+G);S(k,G,A);var U=!1;for(F=0;F<4;F++)N(s,A[F],I),x=I,(isNaN(x[0])||isNaN(x[1])||isNaN(x[2]))&&(U=!0);for(F=0;F<4;F++)U?c.set(H+F,V):(N(s,A[F],I),c.set(H+F,I)),n&&p.set(H+F,w[F]);for(F=0;F<6;F++)T[C++]=b[F]+H;if(y&&!U)for(F=0;F<2;F++){for(var W=3*F,j=0;j<3;j++)N(s,q=A[b[W]+j],D[j]);for(l.sub(E,D[0],D[1]),l.sub(L,D[1],D[2]),l.cross(P,E,L),j=0;j<3;j++){var X=3*A[b[W]+j];R[X]=R[X]+P[0],R[X+1]=R[X+1]+P[1],R[X+2]=R[X+2]+P[2]}}}if(y)for(k=0;k<R.length/3;k++)N(R,k,P),l.normalize(P,P),R[3*k]=P[0],R[3*k+1]=P[1],R[3*k+2]=P[2];z=[];var Z=[];for(k=0;k<m-1;k++)for(G=0;G<v-1;G++)for(H=4*(k*(v-1)+G),S(k,G,A),F=0;F<4;F++){for(j=0;j<4;j++)z[j]=O[4*A[F]+j];g.set(H+F,z),y&&(N(R,A[F],P),d.set(H+F,P));var q=A[F];Z[0]=q%v/(v-1),Z[1]=Math.floor(q/v)/(m-1),f.set(H+F,Z)}}else{for(Z=[],k=0;k<o.count();k++)Z[0]=k%v/(v-1),Z[1]=Math.floor(k/v)/(m-1),z=a.a.parseColor(o.getItemVisual(k,"color")),B=o.getItemVisual(k,"opacity"),z[3]*=B,z[3]<.99&&(M=!0),g.set(k,z),f.set(k,Z);A=[];var Y=0;for(k=0;k<m-1;k++)for(G=0;G<v-1;G++)for(S(k,G,A),F=0;F<6;F++)T[Y++]=A[b[F]];y?r.generateVertexNormals():d.value=null}e.material.get("normalMap")&&r.generateTangents(),r.updateBoundingBox(),r.dirty(),e.material.transparent=M,e.material.depthMask=!M},_getDataShape:function(e,t){for(var i=-1/0,n=0,r=0,a=0,o=t?"u":"x",s=0;s<e.count();s++){var l=e.get(o,s);if(l<i){if(a&&a!==r)throw new Error("Invalid data. data should be a row major 2d array.");a=r,r=0,n++}i=l,r++}return{row:n+1,column:r}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0);i.n(n).a.registerLayout((function(e,t){e.eachSeriesByType("surface",(function(e){var t=e.coordinateSystem;t&&"cartesian3D"===t.type||console.error("Surface chart only support cartesian3D coordinateSystem");var i=e.getData(),n=new Float32Array(3*i.count()),r=[NaN,NaN,NaN];if(t&&"cartesian3D"===t.type){var a=t.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]}));i.each(a,(function(e,a,o,s){var l;l=i.hasValue(s)?t.dataToPoint([e,a,o]):r,n[3*s]=l[0],n[3*s+1]=l[1],n[3*s+2]=l[2]}))}i.setLayout("points",n)}))}))},function(e,t,i){var n=i(0),r=i.n(n);i(99),i(257),i(258);var a=i(17);r.a.registerVisual(Object(a.a)("map3D")),r.a.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},(function(e,t){t.eachComponent({mainType:"series",subType:"map3D",query:e},(function(t){t.setView(e)}))}))},function(e,t,i){var n=i(0),r=i.n(n),a=i(44),o=i(28),s=i(29),l=i(31),u=i(96),h=i(32),c=i(39),d=i(98);function f(e,t){for(var i=[],n=0;n<t.length;n++)i.push(e.dataToPoint(t[n]));return i}var p=r.a.extendSeriesModel({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualColorAccessPath:"itemStyle.color",optionUpdated:function(e){e=e||{};var t=this.get("coordinateSystem");if(null!=t&&"geo3D"!==t){var i=[];["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"].forEach((function(t){null!=e[t]&&i.push(t)})),i.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",i.join(", "),t),this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null}},getInitialData:function(e){e.data=this.getFilledRegions(e.data,e.map);var t=r.a.helper.completeDimensions(["value"],e.data),i=new r.a.List(t,this);i.initData(e.data);var n={};return i.each((function(e){var t=i.getName(e),r=i.getItemModel(e);n[t]=r})),this._regionModelMap=n,i},formatTooltip:function(e){return Object(c.a)(this,e)},getRegionModel:function(e){var t=this.getData().getName(e);return this._regionModelMap[t]||new r.a.Model(null,this)},getRegionPolygonCoords:function(e){var t=this.coordinateSystem,i=this.getData().getName(e);if(t.transform)return(n=t.getRegion(i))?n.geometries:[];this._geo||(this._geo=d.a.createGeo3D(this));for(var n=this._geo.getRegion(i),r=[],a=0;a<n.geometries.length;a++){var o=n.geometries[a],s=[],l=f(t,o.exterior);if(s&&s.length)for(var u=0;u<o.interiors.length;u++)s.push(f(t,s[u]));r.push({interiors:s,exterior:l})}return r},getFormattedLabel:function(e,t){var i=h.a.getFormattedLabel(this,e,t);return null==i&&(i=this.getData().getName(e)),i},defaultOption:{coordinateSystem:"geo3D",data:null}});r.a.util.merge(p.prototype,u.a),r.a.util.merge(p.prototype,a.a),r.a.util.merge(p.prototype,o.a),r.a.util.merge(p.prototype,s.a),r.a.util.merge(p.prototype,l.a)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(45),s=i(30),l=i(64);r.a.extendChartView({type:"map3D",__ecgl__:!0,init:function(e,t){this._geo3DBuilder=new l.a(t),this.groupGL=new a.a.Node},render:function(e,t,i){var n=e.coordinateSystem;if(n&&n.viewGL){if(this.groupGL.add(this._geo3DBuilder.rootNode),n.viewGL.add(this.groupGL),"geo3D"===n.type){this._sceneHelper||(this._sceneHelper=new s.a,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(n.viewGL.scene),this._sceneHelper.updateLight(e),n.viewGL.setPostEffect(e.getModel("postEffect"),i),n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));var r=this._control;r||(r=this._control=new o.a({zr:i.getZr()}),this._control.init());var a=e.getModel("viewControl");r.setViewGL(n.viewGL),r.setFromViewControlModel(a,0),r.off("update"),r.on("update",(function(){i.dispatchAction({type:"map3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),from:this.uid,map3DId:e.id})})),this._geo3DBuilder.extrudeY=!0}else this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),e.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1;this._geo3DBuilder.update(e,t,i,0,e.getData().count());var l=n.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(e){e.material&&e.material[l]("fragment","SRGB_DECODE")}))}},afterRender:function(e,t,i,n){var r=n.renderer,a=e.coordinateSystem;a&&"geo3D"===a.type&&(this._sceneHelper.updateAmbientCubemap(r,e,i),this._sceneHelper.updateSkybox(r,e,i))},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,i){var n=i(0),r=i.n(n);i(260),i(261);var a=i(51),o=i.n(a),s=i(17);r.a.registerVisual(o()("scatterGL","circle",null)),r.a.registerVisual(Object(s.a)("scatterGL")),r.a.registerLayout({seriesType:"scatterGL",reset:function(e){var t,i=e.coordinateSystem;if(i){var n=i.dimensions,r=[];1===n.length?t=function(e,t){for(var r=new Float32Array(2*(e.end-e.start)),a=e.start;a<e.end;a++){var o=2*(a-e.start),s=t.get(n[0],a),l=i.dataToPoint(s);r[o]=l[0],r[o+1]=l[1]}t.setLayout("points",r)}:2===n.length&&(t=function(e,t){for(var a=new Float32Array(2*(e.end-e.start)),o=e.start;o<e.end;o++){var s=2*(o-e.start),l=t.get(n[0],o),u=t.get(n[1],o);r[0]=l,r[1]=u,r=i.dataToPoint(r),a[s]=r[0],a[s+1]=r[1]}t.setLayout("points",a)})}return{progress:t}}})},function(e,t,i){var n=i(0),r=i.n(n);r.a.extendSeriesModel({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){return r.a.helper.createList(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(22),s=i(67),l=i(103);i(2),r.a.extendChartView({type:"scatterGL",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new l.a(this.viewGL)},render:function(e,t,i){if(this.groupGL.removeAll(),this._glViewHelper.reset(e,i),e.getData().count()){var n=this._pointsBuilderList[0];n||(n=this._pointsBuilderList[0]=new s.a(!0,i)),this._pointsBuilderList.length=1,this.groupGL.add(n.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),n.update(e,t,i),this.viewGL.setPostEffect(e.getModel("postEffect"),i)}},incrementalPrepareRender:function(e,t,i){this.groupGL.removeAll(),this._glViewHelper.reset(e,i),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),i)},incrementalRender:function(e,t,i,n){if(!(e.end<=e.start)){var r=this._pointsBuilderList[this._currentStep];r||(r=new s.a(!0,n),this._pointsBuilderList[this._currentStep]=r),this.groupGL.add(r.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),r.setSizeScale(this._sizeScale),r.update(t,i,n,e.start,e.end),n.getZr().refresh(),this._currentStep++}},updateTransform:function(e,t,i){if(e.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(e,i);var n=this._glViewHelper.getZoom(),r=Math.max((e.get("zoomScale")||0)*(n-1)+1,0);this._sizeScale=r,this._pointsBuilderList.forEach((function(e){e.setSizeScale(r)}))}},_removeTransformInPoints:function(e){if(e)for(var t=[],i=0;i<e.length;i+=2)t[0]=e[i],t[1]=e[i+1],this._glViewHelper.removeTransformInPoint(t),e[i]=t[0],e[i+1]=t[1]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(e,t,i){var n=i(0),r=i.n(n);i(263),i(268);var a=i(51),o=i.n(a),s=i(17);function l(){}r.a.registerVisual(o()("graphGL","circle",null)),r.a.registerVisual(Object(s.a)("graphGL")),r.a.registerVisual((function(e){var t={};e.eachSeriesByType("graphGL",(function(e){var i=e.getCategoriesData(),n=e.getData(),r={};i.each((function(n){var a=i.getName(n);r[a]=n;var o=i.getItemModel(n).get("itemStyle.color")||e.getColorFromPalette(a,t);i.setItemVisual(n,"color",o)})),i.count()&&n.each((function(e){var t=n.getItemModel(e).getShallow("category");null!=t&&("string"==typeof t&&(t=r[t]),n.getItemVisual(e,"color",!0)||n.setItemVisual(e,"color",i.getItemVisual(t,"color")))}))}))})),r.a.registerVisual((function(e){e.eachSeriesByType("graphGL",(function(e){var t=e.getGraph(),i=e.getEdgeData(),n="lineStyle.color".split("."),r="lineStyle.opacity".split(".");i.setVisual("color",e.get(n)),i.setVisual("opacity",e.get(r)),i.each((function(e){var a=i.getItemModel(e),o=t.getEdgeByIndex(e),s=a.get(n),l=a.get(r);switch(s){case"source":s=o.node1.getVisual("color");break;case"target":s=o.node2.getVisual("color")}o.setVisual("color",s),o.setVisual("opacity",l)}))}))})),r.a.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){t.setView(e)}))})),r.a.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},l),r.a.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},l),r.a.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},l),r.a.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},l)},function(e,t,i){var n=i(0),r=i.n(n),a=i(264),o=i(32),s=r.a.extendSeriesModel({type:"series.graphGL",visualColorAccessPath:"itemStyle.color",init:function(e){s.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(e){s.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(e,t,i,n){var r=o.a.getFormattedLabel(this,e,t,i,n);if(null==r){var a=this.getData(),s=a.dimensions[a.dimensions.length-1];r=a.get(s,e)}return r},getInitialData:function(e,t){var i=e.edges||e.links||[],n=e.data||e.nodes||[],o=this;if(n&&i)return Object(a.a)(n,i,this,!0,(function(e,i){e.wrapMethod("getItemModel",(function(e){var t=o._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=o.getModel("edgeLabel"),a=new r.a.Model({label:n.option},n.parentModel,t);function s(e){return(e=this.parsePath(e))&&"label"===e[0]?a:this.parentModel}i.wrapMethod("getItemModel",(function(e){return e.customizeGetParent(s),e}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getData(),a=this.getDataParams(e,i),o=n.graph.getEdgeByIndex(e),l=n.getName(o.node1.dataIndex),u=n.getName(o.node2.dataIndex),h=[];return null!=l&&h.push(l),null!=u&&h.push(u),h=r.a.format.encodeHTML(h.join(" > ")),a.value&&(h+=" : "+r.a.format.encodeHTML(a.value)),h}return s.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=(this.option.categories||[]).map((function(e){return null!=e.value?e:r.a.util.extend({value:0},e)})),t=new r.a.List(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setView:function(e){null!=e.zoom&&(this.option.zoom=e.zoom),null!=e.offset&&(this.option.offset=e.offset)},setNodePosition:function(e){for(var t=0;t<e.length/2;t++){var i=e[2*t],n=e[2*t+1],r=this.getData().getRawDataItem(t);r.x=i,r.y=n}},isAnimationEnabled:function(){return s.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(265),o=i.n(a),s=i(267),l=i.n(s),u=i(2);t.a=function(e,t,i,n,a){for(var s=new o.a(n),h=0;h<e.length;h++)s.addNode(u.a.firstNotNull(e[h].id,e[h].name,h),h);var c,d=[],f=[],p=0;for(h=0;h<t.length;h++){var g=t[h],m=g.source,v=g.target;s.addEdge(m,v,p)&&(f.push(g),d.push(u.a.firstNotNull(g.id,m+" > "+v)),p++)}var y=r.a.helper.completeDimensions(["value"],e);(c=new r.a.List(y,i)).initData(e);var _=new r.a.List(["value"],i);return _.initData(f,d),a&&a(c,_),l()({mainData:c,struct:s,structAttr:"graph",datas:{node:c,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),s.update(),s}},function(e,t,i){i(104).__DEV__;var n=i(13),r=i(266).enableClassCheck;function a(e){return"_EC_"+e}var o=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},s=o.prototype;function l(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function u(e,t,i){this.node1=e,this.node2=t,this.dataIndex=null==i?-1:i}s.type="graph",s.isDirected=function(){return this._directed},s.addNode=function(e,t){e=e||""+t;var i=this._nodesMap;if(!i[a(e)]){var n=new l(e,t);return n.hostGraph=this,this.nodes.push(n),i[a(e)]=n,n}},s.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},s.getNodeById=function(e){return this._nodesMap[a(e)]},s.addEdge=function(e,t,i){var n=this._nodesMap,r=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),l.isInstance(e)||(e=n[a(e)]),l.isInstance(t)||(t=n[a(t)]),e&&t){var o=e.id+"-"+t.id;if(!r[o]){var s=new u(e,t,i);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),r[o]=s,s}}},s.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},s.getEdge=function(e,t){l.isInstance(e)&&(e=e.id),l.isInstance(t)&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},s.eachNode=function(e,t){for(var i=this.nodes,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&e.call(t,i[r],r)},s.eachEdge=function(e,t){for(var i=this.edges,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&i[r].node1.dataIndex>=0&&i[r].node2.dataIndex>=0&&e.call(t,i[r],r)},s.breadthFirstTraverse=function(e,t,i,n){if(l.isInstance(t)||(t=this._nodesMap[a(t)]),t){for(var r="out"===i?"outEdges":"in"===i?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(n,t,null))for(var s=[t];s.length;){var u=s.shift(),h=u[r];for(o=0;o<h.length;o++){var c=h[o],d=c.node1===u?c.node2:c.node1;if(!d.__visited){if(e.call(n,d,u))return;s.push(d),d.__visited=!0}}}}},s.update=function(){for(var e=this.data,t=this.edgeData,i=this.nodes,n=this.edges,r=0,a=i.length;r<a;r++)i[r].dataIndex=-1;for(r=0,a=e.count();r<a;r++)i[e.getRawIndex(r)].dataIndex=r;for(t.filterSelf((function(e){var i=n[t.getRawIndex(e)];return i.node1.dataIndex>=0&&i.node2.dataIndex>=0})),r=0,a=n.length;r<a;r++)n[r].dataIndex=-1;for(r=0,a=t.count();r<a;r++)n[t.getRawIndex(r)].dataIndex=r},s.clone=function(){for(var e=new o(this._directed),t=this.nodes,i=this.edges,n=0;n<t.length;n++)e.addNode(t[n].id,t[n].dataIndex);for(n=0;n<i.length;n++){var r=i[n];e.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return e},l.prototype={constructor:l,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)}},u.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};var h=function(e,t){return{getValue:function(i){var n=this[e][t];return n.get(n.getDimension(i||"value"),this.dataIndex)},setVisual:function(i,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[e][t].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}};n.mixin(l,h("hostGraph","data")),n.mixin(u,h("hostGraph","edgeData")),o.Node=l,o.Edge=u,r(l),r(u);var c=o;e.exports=c},function(e,t,i){i(104).__DEV__;var n=i(13),r="___EC__COMPONENT__CONTAINER___";function a(e){var t={main:"",sub:""};return e&&(e=e.split("."),t.main=e[0]||"",t.sub=e[1]||""),t}var o=0;function s(e,t){var i=n.slice(arguments,2);return this.superClass.prototype[t].apply(e,i)}function l(e,t,i){return this.superClass.prototype[t].apply(e,i)}t.parseClassType=a,t.enableClassExtend=function(e,t){e.$constructor=e,e.extend=function(e){var t=this,i=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return n.extend(i.prototype,e),i.extend=this.extend,i.superCall=s,i.superApply=l,n.inherits(i,this),i.superClass=t,i}},t.enableClassCheck=function(e){var t=["__\0is_clz",o++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},t.enableClassManagement=function(e,t){t=t||{};var i={};if(e.registerClass=function(e,t){if(t)if(function(e){n.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=a(t)).sub){if(t.sub!==r){var o=function(e){var t=i[e.main];return t&&t[r]||((t=i[e.main]={})[r]=!0),t}(t);o[t.sub]=e}}else i[t.main]=e;return e},e.getClass=function(e,t,n){var a=i[e];if(a&&a[r]&&(a=t?a[t]:null),n&&!a)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return a},e.getClassesByMainType=function(e){e=a(e);var t=[],o=i[e.main];return o&&o[r]?n.each(o,(function(e,i){i!==r&&t.push(e)})):t.push(o),t},e.hasClass=function(e){return e=a(e),!!i[e.main]},e.getAllClassMainTypes=function(){var e=[];return n.each(i,(function(t,i){e.push(i)})),e},e.hasSubTypes=function(e){e=a(e);var t=i[e.main];return t&&t[r]},e.parseClassType=a,t.registerWhenExtend){var o=e.extend;o&&(e.extend=function(t){var i=o.call(this,t);return e.registerClass(i,t.type)})}return e},t.setReadOnly=function(e,t){}},function(e,t,i){var n=i(13),r=n.each,a="\0__link_datas",o="\0__link_mainData";function s(e,t){if((r=this)[o]===r){var i=n.extend({},this[a]);i[this.dataType]=t,c(t,i,e)}else d(t,this.dataType,this[o],e);var r;return t}function l(e,t){return e.struct&&e.struct.update(this),t}function u(e,t){return r(t[a],(function(i,n){i!==t&&d(i.cloneShallow(),n,t,e)})),t}function h(e){var t=this[o];return null==e||null==t?t:t[a][e]}function c(e,t,i){e[a]={},r(t,(function(t,n){d(t,n,e,i)}))}function d(e,t,i,n){i[a][t]=e,e[o]=i,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=h}var f=function(e){var t=e.mainData,i=e.datas;i||(i={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,c(t,i,e),r(i,(function(i){r(t.TRANSFERABLE_METHODS,(function(t){i.wrapMethod(t,n.curry(s,e))}))})),t.wrapMethod("cloneShallow",n.curry(u,e)),r(t.CHANGABLE_METHODS,(function(i){t.wrapMethod(i,n.curry(l,e))})),n.assert(i[t.dataType]===t)};e.exports=f},function(e,t,i){var n=i(0),r=i.n(n),a=i(47),o=i.n(a),s=i(1),l=i(22),u=i(105),h=i(2),c=i(269),d=i(271),f=i(80),p=i.n(f),g=i(6),m=i(273),v=i(67),y=i(274),_=g.a.vec2;s.a.Shader.import(y.a);var x,b=1;r.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(e,t){this.groupGL=new s.a.Node,this.viewGL=new l.a("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new v.a(!0,t),this._forceEdgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new s.a.Geometry({attributes:{node:new s.a.Geometry.Attribute("node","float",2),color:new s.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:s.a.Mesh.LINES}),this._edgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new u.a({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new m.a({zr:t.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(e,t,i){this.groupGL.add(this._pointsBuilder.rootNode),this._model=e,this._api=i,this._initLayout(e,t,i),this._pointsBuilder.update(e,t,i),this._forceLayoutInstance instanceof c.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(e,i),this._control.off("update"),this._control.on("update",(function(){i.dispatchAction({type:"graphGLRoam",seriesId:e.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(h.a.firstNotNull(e.get("zoom"),1)),this._control.setOffset(e.get("offset")||[0,0]);var n=this._pointsBuilder.getPointsMesh();if(n.off("mousemove",this._mousemoveHandler),n.off("mouseout",this._mouseOutHandler,this),i.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,e.get("focusNodeAdjacency")){var r=e.get("focusNodeAdjacencyOn");"click"===r?i.getZr().on("click",this._clickHandler):"mouseover"===r?(n.on("mousemove",this._mousemoveHandler,this),n.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):console.warn("Unkown focusNodeAdjacencyOn value s"+r)}this._lastMouseOverDataIndex=-1},_clickHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(e){if(!this._layouting){var t=this._pointsBuilder.getPointsMesh().dataIndex;t>=0?t!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:t}):this._mouseOutHandler(e),this._lastMouseOverDataIndex=t}},_mouseOutHandler:function(e){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(e,t){var i=this._forceEdgesMesh.geometry,n=t.getEdgeData(),r=0,a=this._forceLayoutInstance,o=2*n.count();i.attributes.node.init(o),i.attributes.color.init(o),n.each((function(t){var o=e[t];i.attributes.node.set(r,a.getNodeUV(o.node1)),i.attributes.node.set(r+1,a.getNodeUV(o.node2));var l=n.getItemVisual(o.dataIndex,"color"),u=s.a.parseColor(l);u[3]*=h.a.firstNotNull(n.getItemVisual(o.dataIndex,"opacity"),1),i.attributes.color.set(r,u),i.attributes.color.set(r+1,u),r+=2})),i.dirty()},_updateMeshLinesGeometry:function(){var e=this._model.getEdgeData(),t=this._edgesMesh.geometry,i=(e=this._model.getEdgeData(),this._model.getData().getLayout("points"));t.resetOffset(),t.setVertexCount(e.count()*t.getLineVertexCount()),t.setTriangleCount(e.count()*t.getLineTriangleCount());var n=[],r=[],a=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*e.count()),this._edgeIndicesMap=new Float32Array(e.count()),e.each((function(o){var l=e.graph.getEdgeByIndex(o),u=2*l.node1.dataIndex,c=2*l.node2.dataIndex;n[0]=i[u],n[1]=i[u+1],r[0]=i[c],r[1]=i[c+1];var d=e.getItemVisual(l.dataIndex,"color"),f=s.a.parseColor(d);f[3]*=h.a.firstNotNull(e.getItemVisual(l.dataIndex,"opacity"),1);var p=e.getItemModel(l.dataIndex),g=h.a.firstNotNull(p.get(a),1)*this._api.getDevicePixelRatio();t.addLine(n,r,f,g);for(var m=0;m<4;m++)this._originalEdgeColors[4*l.dataIndex+m]=f[m];this._edgeIndicesMap[l.dataIndex]=o}),this),t.dirty()},_updateForceNodesGeometry:function(e){for(var t=this._pointsBuilder.getPointsMesh(),i=[],n=0;n<e.count();n++)this._forceLayoutInstance.getNodeUV(n,i),t.geometry.attributes.position.set(n,i);t.geometry.dirty("position")},_initLayout:function(e,t,i){var n=e.get("layout"),a=e.getGraph(),s=e.getBoxLayoutParams(),l=o.a.getLayoutRect(s,{width:i.getWidth(),height:i.getHeight()});"force"===n&&(console.warn("Currently only forceAtlas2 layout supported."),n="forceAtlas2"),this.stopLayout(e,t,i,{beforeLayout:!0});var u=e.getData(),f=e.getData();if("forceAtlas2"===n){var p=e.getModel("forceAtlas2"),g=this._forceLayoutInstance,m=[],v=[],y=u.getDataExtent("value"),_=f.getDataExtent("value"),x=h.a.firstNotNull(p.get("edgeWeight"),1),b=h.a.firstNotNull(p.get("nodeWeight"),1);"number"==typeof x&&(x=[x,x]),"number"==typeof b&&(b=[b,b]);var w=0,T={},S=new Float32Array(2*u.count());if(a.eachNode((function(e){var t,i,n=e.dataIndex,a=u.get("value",n);if(u.hasItemOption){var o=u.getItemModel(n);t=o.get("x"),i=o.get("y")}null==t&&(t=l.x+Math.random()*l.width,i=l.y+Math.random()*l.height),S[2*w]=t,S[2*w+1]=i,T[e.id]=w++;var s=r.a.number.linearMap(a,y,b);isNaN(s)&&(s=isNaN(b[0])?1:b[0]),m.push({x:t,y:i,mass:s,size:u.getItemVisual(n,"symbolSize")})})),u.setLayout("points",S),a.eachEdge((function(e){var t=e.dataIndex,i=u.get("value",t),n=r.a.number.linearMap(i,_,x);isNaN(n)&&(n=isNaN(x[0])?1:x[0]),v.push({node1:T[e.node1.id],node2:T[e.node2.id],weight:n,dataIndex:t})})),!g){var M=p.get("GPU");this._forceLayoutInstance&&((!M||this._forceLayoutInstance instanceof c.a)&&(M||this._forceLayoutInstance instanceof d.a)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),g=this._forceLayoutInstance=M?new c.a:new d.a}g.initData(m,v),g.updateOption(p.option),this._updateForceEdgesGeometry(g.getEdges(),e),this._updatePositionTexture(),i.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else S=new Float32Array(2*u.count()),w=0,a.eachNode((function(e){var t,i,n=e.dataIndex;if(u.hasItemOption){var r=u.getItemModel(n);t=r.get("x"),i=r.get("y")}S[w++]=t,S[w++]=i})),u.setLayout("points",S),this._updateAfterLayout(e,t,i)},_updatePositionTexture:function(){var e=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(e),this._forceEdgesMesh.material.set("positionTex",e)},startLayout:function(e,t,i,n){if(!n||null==n.from||n.from===this.uid){var r=this.viewGL,a=(i=this._api,this._forceLayoutInstance),o=this._model.getData(),s=this._model.getModel("forceAtlas2");if(a){if(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),this._forceLayoutInstance){this._updateForceNodesGeometry(e.getData()),this._pointsBuilder.hideLabels();var l=this,u=this._layoutId=b++,h=s.getShallow("maxSteps"),c=s.getShallow("steps"),d=0,f=Math.max(2*c,20),g=function(t){if(t===l._layoutId)return a.isFinished(h)?(i.dispatchAction({type:"graphGLStopLayout",from:l.uid}),void i.dispatchAction({type:"graphGLFinishLayout",points:o.getLayout("points"),from:l.uid})):void a.update(r.layer.renderer,c,(function(){l._updatePositionTexture(),(d+=c)>=f&&(l._syncNodePosition(e),d=0),i.getZr().refresh(),p()((function(){g(t)}))}))};p()((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(r.layer.renderer),l._forceLayoutInstanceToDispose=null),g(u)})),this._layouting=!0}}else console.error("None layout don't have startLayout action")}},stopLayout:function(e,t,i,n){n&&null!=n.from&&n.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(n&&n.beforeLayout||(this._syncNodePosition(e),this._updateAfterLayout(e,t,i)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(e){var t=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);e.getData().setLayout("points",t),e.setNodePosition(t)},_updateAfterLayout:function(e,t,i){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(e,t,i),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(e,t,i,n){var r=this._model.getData();this._downplayAll();var a=n.dataIndex,o=r.graph,s=[],l=o.getNodeByIndex(a);s.push(l),l.edges.forEach((function(e){e.dataIndex<0||(e.node1!==l&&s.push(e.node1),e.node2!==l&&s.push(e.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(e){this._pointsBuilder.highlight(r,e.dataIndex)}),this),this._pointsBuilder.updateLabels(s.map((function(e){return e.dataIndex})));var u=[];l.edges.forEach((function(e){e.dataIndex>=0&&(this._highlightEdge(e.dataIndex),u.push(e))}),this),this._focusNodes=s,this._focusEdges=u},unfocusNodeAdjacency:function(e,t,i,n){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(e){var t=this._model.getEdgeData().getItemModel(e),i=s.a.parseColor(t.get("emphasis.lineStyle.color")||t.get("lineStyle.color")),n=h.a.firstNotNull(t.get("emphasis.lineStyle.opacity"),t.get("lineStyle.opacity"),1);i[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],i)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(e){this._pointsBuilder.downplay(this._model.getData(),e.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(e){this._downplayEdge(e.dataIndex)}),this)},_downplayEdge:function(e){var t=this._getColor(e,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)},_setEdgeFade:(x=[],function(e,t){this._getColor(e,x),x[3]*=t,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],x)}),_getColor:function(e,t){for(var i=0;i<4;i++)t[i]=this._originalEdgeColors[4*e+i];return t},_fadeOutEdgesAll:function(e){this._model.getData().graph.eachEdge((function(t){this._setEdgeFade(t.dataIndex,e)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(e,t){this.viewGL.setViewport(0,0,t.getWidth(),t.getHeight(),t.getDevicePixelRatio());for(var i=this.viewGL.camera,n=e.getData().getLayout("points"),r=_.create(1/0,1/0),a=_.create(-1/0,-1/0),o=[],s=0;s<n.length;)o[0]=n[s++],o[1]=n[s++],_.min(r,r,o),_.max(a,a,o);var l=(a[1]+r[1])/2,u=(a[0]+r[0])/2;if(!(u>i.left&&u<i.right&&l<i.bottom&&l>i.top)){var h=Math.max(a[0]-r[0],10),c=h/t.getWidth()*t.getHeight();h*=1.4,c*=1.4,r[0]-=.2*h,i.left=r[0],i.top=l-c/2,i.bottom=l+c/2,i.right=h+r[0],i.near=0,i.far=100}},dispose:function(){var e=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(e),this.groupGL.removeAll(),this._layoutId=-1},remove:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(16),s=i(10),l=i(270);a.a.Shader.import(l.a);var u={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function h(e){var t={type:a.a.Texture.FLOAT,minFilter:a.a.Texture.NEAREST,magFilter:a.a.Texture.NEAREST};this._positionSourceTex=new a.a.Texture2D(t),this._positionSourceTex.flipY=!1,this._positionTex=new a.a.Texture2D(t),this._positionPrevTex=new a.a.Texture2D(t),this._forceTex=new a.a.Texture2D(t),this._forcePrevTex=new a.a.Texture2D(t),this._weightedSumTex=new a.a.Texture2D(t),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new a.a.Texture2D(t),this._globalSpeedPrevTex=new a.a.Texture2D(t),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new o.a({fragment:a.a.Shader.source("clay.compositor.output")});var i=function(e){e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE)};this._edgeForceMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node1:new a.a.Geometry.Attribute("node1","float",2),node2:new a.a.Geometry.Attribute("node2","float",2),weight:new a.a.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:i,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._weightedSumMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node:new a.a.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:i,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._framebuffer=new s.a({depthBuffer:!1}),this._dummyCamera=new a.a.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}h.prototype.updateOption=function(e){for(var t in u)this[t]=u[t];var i=this._nodes.length;if(this.jitterTolerence=i>5e4?10:i>5e3?1:.1,this.scaling=i>100?2:10,e)for(var t in u)null!=e[t]&&(this[t]=e[t]);if(this.repulsionByDegree)for(var n=this._positionSourceTex.pixels,r=0;r<this._nodes.length;r++)n[4*r+2]=(this._nodes[r].degree||0)+1},h.prototype._updateGravityCenter=function(e){var t=this._nodes,i=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var n=[1/0,1/0],r=[-1/0,-1/0],a=0;a<t.length;a++)n[0]=Math.min(t[a].x,n[0]),n[1]=Math.min(t[a].y,n[1]),r[0]=Math.max(t[a].x,r[0]),r[1]=Math.max(t[a].y,r[1]);this._gravityCenter=[.5*(n[0]+r[0]),.5*(n[1]+r[1])]}for(a=0;a<i.length;a++){var o=i[a].node1,s=i[a].node2;t[o].degree=(t[o].degree||0)+1,t[s].degree=(t[s].degree||0)+1}},h.prototype.initData=function(e,t){this._nodes=e,this._edges=t,this._updateGravityCenter();var i=Math.ceil(Math.sqrt(e.length)),n=i,r=new Float32Array(i*n*4);this._resize(i,n);for(var a=0,o=0;o<e.length;o++){var s=e[o];r[a++]=s.x||0,r[a++]=s.y||0,r[a++]=s.mass||1,r[a++]=s.size||1}this._positionSourceTex.pixels=r;var l=this._edgeForceMesh.geometry,u=t.length;l.attributes.node1.init(2*u),l.attributes.node2.init(2*u),l.attributes.weight.init(2*u);var h=[];for(o=0;o<t.length;o++){var c=l.attributes,d=t[o].weight;null==d&&(d=1),c.node1.set(o,this.getNodeUV(t[o].node1,h)),c.node2.set(o,this.getNodeUV(t[o].node2,h)),c.weight.set(o,d),c.node1.set(o+u,this.getNodeUV(t[o].node2,h)),c.node2.set(o+u,this.getNodeUV(t[o].node1,h)),c.weight.set(o+u,d)}var f=this._weightedSumMesh.geometry;for(f.attributes.node.init(e.length),o=0;o<e.length;o++)f.attributes.node.set(o,this.getNodeUV(o,h));l.dirty(),f.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",e.length),this._nodeRepulsionPass.material.setUniform("textureSize",[i,n]),this._inited=!1,this._frame=0},h.prototype.getNodes=function(){return this._nodes},h.prototype.getEdges=function(){return this._edges},h.prototype.step=function(e){this._inited||(this._initFromSource(e),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(e);var t=this._nodeRepulsionPass;t.setUniform("strongGravityMode",this.strongGravityMode),t.setUniform("gravity",this.gravity),t.setUniform("gravityCenter",this._gravityCenter),t.setUniform("scaling",this.scaling),t.setUniform("preventOverlap",this.preventOverlap),t.setUniform("positionTex",this._positionPrevTex),t.render(e);var i=this._edgeForceMesh;i.material.set("linLogMode",this.linLogMode),i.material.set("edgeWeightInfluence",this.edgeWeightInfluence),i.material.set("preventOverlap",this.preventOverlap),i.material.set("positionTex",this._positionPrevTex),e.gl.enable(e.gl.BLEND),e.renderPass([i],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT),e.gl.enable(e.gl.BLEND);var n=this._weightedSumMesh;n.material.set("positionTex",this._positionPrevTex),n.material.set("forceTex",this._forceTex),n.material.set("forcePrevTex",this._forcePrevTex),e.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var r=this._globalSpeedPass;r.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),r.setUniform("weightedSumTex",this._weightedSumTex),r.setUniform("jitterTolerence",this.jitterTolerence),e.gl.disable(e.gl.BLEND),r.render(e);var a=this._positionPass;this._framebuffer.attach(this._positionTex),a.setUniform("globalSpeedTex",this._globalSpeedTex),a.setUniform("positionTex",this._positionPrevTex),a.setUniform("forceTex",this._forceTex),a.setUniform("forcePrevTex",this._forcePrevTex),a.render(e),this._framebuffer.unbind(e),this._swapTexture()},h.prototype.update=function(e,t,i){null==t&&(t=1),t=Math.max(t,1);for(var n=0;n<t;n++)this.step(e);i&&i()},h.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},h.prototype.getNodeUV=function(e,t){t=t||[];var i=this._positionTex.width,n=this._positionTex.height;return t[0]=e%i/(i-1),t[1]=Math.floor(e/i)/(n-1)||0,t},h.prototype.getNodePosition=function(e,t){var i=this._positionArr,n=this._positionTex.width,r=this._positionTex.height,a=n*r;i&&i.length===4*a||(i=this._positionArr=new Float32Array(4*a)),this._framebuffer.bind(e),this._framebuffer.attach(this._positionPrevTex),e.gl.readPixels(0,0,n,r,e.gl.RGBA,e.gl.FLOAT,i),this._framebuffer.unbind(e),t||(t=new Float32Array(2*this._nodes.length));for(var o=0;o<this._nodes.length;o++)t[2*o]=i[4*o],t[2*o+1]=i[4*o+1];return t},h.prototype.getTextureData=function(e,t){var i=this["_"+t+"Tex"],n=i.width,r=i.height;this._framebuffer.bind(e),this._framebuffer.attach(i);var a=new Float32Array(n*r*4);return e.gl.readPixels(0,0,n,r,e.gl.RGBA,e.gl.FLOAT,a),this._framebuffer.unbind(e),a},h.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},h.prototype.isFinished=function(e){return this._frame>e},h.prototype._swapTexture=function(){var e=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=e,e=this._forcePrevTex,this._forcePrevTex=this._forceTex,this._forceTex=e,e=this._globalSpeedPrevTex,this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=e},h.prototype._initFromSource=function(e){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(e),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(e),e.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),e.gl.clear(e.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(e)},h.prototype._resize=function(e,t){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(i){this[i].width=e,this[i].height=t,this[i].dirty()}),this)},h.prototype.dispose=function(e){this._framebuffer.dispose(e),this._copyPass.dispose(e),this._nodeRepulsionPass.dispose(e),this._positionPass.dispose(e),this._globalSpeedPass.dispose(e),this._edgeForceMesh.geometry.dispose(e),this._weightedSumMesh.geometry.dispose(e),this._positionSourceTex.dispose(e),this._positionTex.dispose(e),this._positionPrevTex.dispose(e),this._forceTex.dispose(e),this._forcePrevTex.dispose(e),this._weightedSumTex.dispose(e),this._globalSpeedTex.dispose(e),this._globalSpeedPrevTex.dispose(e)},r.a.ForceAtlas2GPU=h,t.a=h},function(e,t,i){t.a="@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end"},function(e,t,i){var n=i(5),r=i(4),a=i(272).a.toString();a=a.slice(a.indexOf("{")+1,a.lastIndexOf("}"));var o={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},s=function(e){for(var t in o)this[t]=o[t];if(e)for(var t in e)this[t]=e[t];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new n.a({type:r.a.FLOAT,flipY:!1,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST})};s.prototype.initData=function(e,t){var i=new Blob([a]),n=window.URL.createObjectURL(i);this._worker=new Worker(n),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=e,this._edges=t,this._frame=0;for(var r=e.length,o=t.length,s=new Float32Array(2*r),l=new Float32Array(r),u=new Float32Array(r),h=new Float32Array(2*o),c=new Float32Array(o),d=0;d<e.length;d++){var f=e[d];s[2*d]=f.x,s[2*d+1]=f.y,l[d]=null==f.mass?1:f.mass,u[d]=null==f.size?1:f.size}for(d=0;d<t.length;d++){var p=t[d],g=p.node1,m=p.node2;h[2*d]=g,h[2*d+1]=m,c[d]=null==p.weight?1:p.weight}var v=Math.ceil(Math.sqrt(e.length)),y=v,_=new Float32Array(v*y*4),x=this._positionTex;x.width=v,x.height=y,x.pixels=_,this._worker.postMessage({cmd:"init",nodesPosition:s,nodesMass:l,nodesSize:u,edges:h,edgesWeight:c}),this._globalSpeed=1/0},s.prototype.updateOption=function(e){var t={};for(var i in o)t[i]=o[i];var n=this._nodes,r=this._edges,a=n.length;if(t.jitterTolerence=a>5e4?10:a>5e3?1:.1,t.scaling=a>100?2:10,t.barnesHutOptimize=a>1e3,e)for(var i in o)null!=e[i]&&(t[i]=e[i]);if(!t.gravityCenter){for(var s=[1/0,1/0],l=[-1/0,-1/0],u=0;u<n.length;u++)s[0]=Math.min(n[u].x,s[0]),s[1]=Math.min(n[u].y,s[1]),l[0]=Math.max(n[u].x,l[0]),l[1]=Math.max(n[u].y,l[1]);t.gravityCenter=[.5*(s[0]+l[0]),.5*(s[1]+l[1])]}for(u=0;u<r.length;u++){var h=r[u].node1,c=r[u].node2;n[h].degree=(n[h].degree||0)+1,n[c].degree=(n[c].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:t})},s.prototype.update=function(e,t,i){null==t&&(t=1),t=Math.max(t,1),this._frame+=t,this._onupdate=i,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(t)})},s.prototype._$onupdate=function(e){if(!this._disposed){var t=new Float32Array(e.data.buffer);this._globalSpeed=e.data.globalSpeed,this._positionArr=t,this._updateTexture(t),this._onupdate&&this._onupdate()}},s.prototype.getNodePositionTexture=function(){return this._positionTex},s.prototype.getNodeUV=function(e,t){t=t||[];var i=this._positionTex.width,n=this._positionTex.height;return t[0]=e%i/(i-1),t[1]=Math.floor(e/i)/(n-1),t},s.prototype.getNodes=function(){return this._nodes},s.prototype.getEdges=function(){return this._edges},s.prototype.isFinished=function(e){return this._frame>e},s.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var i=0;i<this._positionArr.length;i++)t[i]=this._positionArr[i];return t},s.prototype._updateTexture=function(e){for(var t=this._positionTex.pixels,i=0,n=0;n<e.length;)t[i++]=e[n++],t[i++]=e[n++],t[i++]=1,t[i++]=1;this._positionTex.dirty()},s.prototype.dispose=function(e){this._disposed=!0,this._worker=null},t.a=s},function(e,t,i){t.a=function(){var e=function(){return new Float32Array(2)},t=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(i*i+n*n)},i=function(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)},n=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},r=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},a=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},o=function(e,t){return e[0]=t[0],e[1]=t[1],e},s=function(e,t,i){return e[0]=t,e[1]=i,e};function l(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var u=l.prototype;function h(){this.position=new Float32Array(2),this.force=e(),this.forcePrev=e(),this.mass=1,this.inDegree=0,this.outDegree=0}function c(e,t){this.source=e,this.target=t,this.weight=1}function d(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new l,this.rootRegion.centerOfMass=e(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}u.beforeUpdate=function(){for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},u.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].afterUpdate()},u.addNode=function(e){if(0===this.nSubRegions){if(null==this.node)return void(this.node=e);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(e),this._updateCenterOfMass(e)},u.findSubRegion=function(e,t){for(var i=0;i<this.nSubRegions;i++){var n=this.subRegions[i];if(n.contain(e,t))return n}},u.contain=function(e,t){return this.bbox[0]<=e&&this.bbox[2]>=e&&this.bbox[1]<=t&&this.bbox[3]>=t},u.setBBox=function(e,t,i,n){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=i,this.bbox[3]=n,this.size=(i-e+n-t)/2},u._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new l,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},u._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),i=this.bbox;if(!t){var n=(i[0]+i[2])/2,r=(i[1]+i[3])/2,a=(i[2]-i[0])/2,o=(i[3]-i[1])/2,s=e.position[0]>=n?1:0,l=e.position[1]>=r?1:0;(t=this._newSubRegion()).setBBox(s*a+i[0],l*o+i[1],(s+1)*a+i[0],(l+1)*o+i[1])}t.addNode(e)},u._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var t=this.centerOfMass[0]*this.mass,i=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,i+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=i/this.mass};var f,p=d.prototype;p.initNodes=function(e,t,i){var n=t.length;this.nodes.length=0;for(var r=void 0!==i,a=0;a<n;a++){var o=new h;o.position[0]=e[2*a],o.position[1]=e[2*a+1],o.mass=t[a],r&&(o.size=i[a]),this.nodes.push(o)}this._massArr=t,this._swingingArr=new Float32Array(n),r&&(this._sizeArr=i)},p.initEdges=function(e,t){var i=e.length/2;this.edges.length=0;for(var n=0;n<i;n++){var r=e[2*n],a=e[2*n+1],o=this.nodes[r],s=this.nodes[a];if(!o||!s)return void console.error("Node not exists, try initNodes before initEdges");o.outDegree++,s.inDegree++;var l=new c(o,s);t&&(l.weight=t[n]),this.edges.push(l)}},p.updateSettings=function(){if(this.repulsionByDegree)for(var e=0;e<this.nodes.length;e++)(t=this.nodes[e]).mass=t.inDegree+t.outDegree+1;else for(e=0;e<this.nodes.length;e++){var t;(t=this.nodes[e]).mass=this._massArr[e]}},p.update=function(){var a=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var l=0;l<a;l++)this.rootRegion.addNode(this.nodes[l]);this.rootRegion.afterUpdate()}for(l=0;l<a;l++){var u=this.nodes[l];o(u.forcePrev,u.force),s(u.force,0,0)}for(l=0;l<a;l++){var h=this.nodes[l];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,h);else for(var c=l+1;c<a;c++){var d=this.nodes[c];this.applyNodeToNodeRepulsion(h,d,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(h):this.applyNodeGravity(h))}for(l=0;l<this.edges.length;l++)this.applyEdgeAttraction(this.edges[l]);var f=0,p=0,g=e();for(l=0;l<a;l++)u=this.nodes[l],f+=(v=t(u.force,u.forcePrev))*u.mass,r(g,u.force,u.forcePrev),p+=.5*i(g)*u.mass,this._swingingArr[l]=v;var m=this.jitterTolerence*this.jitterTolerence*p/f;for(this._globalSpeed>0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m,l=0;l<a;l++){u=this.nodes[l];var v=this._swingingArr[l],y=.1*m/(1+m*Math.sqrt(v)),_=i(u.force);_>0&&(y=Math.min(_*y,10)/_,n(u.position,u.position,u.force,y))}},p.applyRegionToNodeRepulsion=(f=e(),function(e,t){if(e.node)this.applyNodeToNodeRepulsion(e.node,t,!0);else{a(f,t.position,e.centerOfMass);var i=f[0]*f[0]+f[1]*f[1];if(i>this.barnesHutTheta*e.size*e.size){var r=this.scaling*t.mass*e.mass/i;n(t.force,t.force,f,r)}else for(var o=0;o<e.nSubRegions;o++)this.applyRegionToNodeRepulsion(e.subRegions[o],t)}}),p.applyNodeToNodeRepulsion=function(){var t=e();return function(e,i,r){if(e!=i){a(t,e.position,i.position);var o=t[0]*t[0]+t[1]*t[1];if(0!==o){var s;if(this.preventOverlap){var l=Math.sqrt(o);if((l=l-e.size-i.size)>0)s=this.scaling*e.mass*i.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*e.mass*i.mass}}else s=this.scaling*e.mass*i.mass/o;n(e.force,e.force,t,s),n(i.force,i.force,t,-s)}}}}(),p.applyEdgeAttraction=function(){var t=e();return function(e){var r=e.source,o=e.target;a(t,r.position,o.position);var s,l,u=i(t);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?e.weight:Math.pow(e.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-r.size-o.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,n(r.force,r.force,t,l),n(o.force,o.force,t,-l))}}(),p.applyNodeGravity=function(){var t=e();return function(e){a(t,this.gravityCenter,e.position);var r=i(t);n(e.force,e.force,t,this.gravity*e.mass/(r+1))}}(),p.applyNodeStrongGravity=function(){var t=e();return function(e){a(t,this.gravityCenter,e.position),n(e.force,e.force,t,this.gravity*e.mass)}}(),p.updateBBox=function(){for(var e=1/0,t=1/0,i=-1/0,n=-1/0,r=0;r<this.nodes.length;r++){var a=this.nodes[r].position;e=Math.min(e,a[0]),t=Math.min(t,a[1]),i=Math.max(i,a[0]),n=Math.max(n,a[1])}this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=i,this.bbox[3]=n},p.getGlobalSpeed=function(){return this._globalSpeed};var g=null;self.onmessage=function(e){switch(e.data.cmd){case"init":(g=new d).initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),g.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(g)for(var t in e.data.config)g[t]=e.data.config[t];break;case"update":var i=e.data.steps;if(g){for(var n=0;n<i;n++)g.update();var r=g.nodes.length,a=new Float32Array(2*r);for(n=0;n<r;n++){var o=g.nodes[n];a[2*n]=o.position[0],a[2*n+1]=o.position[1]}self.postMessage({buffer:a.buffer,globalSpeed:g.getGlobalSpeed()},[a.buffer])}else{var s=new Float32Array;self.postMessage({buffer:s.buffer,globalSpeed:g.getGlobalSpeed()},[s.buffer])}}}}},function(e,t,i){var n=i(7);i(2);var r=n.a.extend((function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}}),(function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)}),{init:function(){var e=this.zr;e.on("mousedown",this._mouseDownHandler),e.on("mousewheel",this._mouseWheelHandler),e.on("globalout",this._mouseUpHandler),e.animation.on("frame",this._update)},setTarget:function(e){this._target=e},setZoom:function(e){this._zoom=Math.max(Math.min(e,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(e){this._dx=e[0],this._dy=e[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){if(this._target&&this._needsUpdate){var e=this._target,t=this._zoom;e.position.x=this._dx,e.position.y=this._dy,e.scale.set(t,t,t),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update")}},_mouseDownHandler:function(e){if(!e.target){var t=e.offsetX,i=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(t,i)){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var n=this._convertPos(t,i);this._x=n.x,this._y=n.y}}},_convertPos:function(e,t){var i=this.viewGL.camera,n=this.viewGL.viewport;return{x:(e-n.x)/n.width*(i.right-i.left)+i.left,y:(t-n.y)/n.height*(i.bottom-i.top)+i.top}},_mouseMoveHandler:function(e){var t=this._convertPos(e.offsetX,e.offsetY);this._dx+=t.x-this._x,this._dy+=t.y-this._y,this._x=t.x,this._y=t.y,this._needsUpdate=!0},_mouseUpHandler:function(e){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(e){var t=(e=e.event).wheelDelta||-e.detail;if(0!==t){var i=e.offsetX,n=e.offsetY;if(!this.viewGL||this.viewGL.containPoint(i,n)){var r=t>0?1.1:.9,a=Math.max(Math.min(this._zoom*r,this.maxZoom),this.minZoom);r=a/this._zoom;var o=this._convertPos(i,n),s=(o.x-this._dx)*(r-1),l=(o.y-this._dy)*(r-1);this._dx-=s,this._dy-=l,this._zoom=a,this._needsUpdate=!0}}},dispose:function(){var e=this.zr;e.off("mousedown",this._mouseDownHandler),e.off("mousemove",this._mouseMoveHandler),e.off("mouseup",this._mouseUpHandler),e.off("mousewheel",this._mouseWheelHandler),e.off("globalout",this._mouseUpHandler),e.animation.off("frame",this._update)}});t.a=r},function(e,t,i){t.a="@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end"},function(e,t,i){var n=i(0);i.n(n),i(276),i(280)},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(2),s=i(22),l=i(277);r.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(e,t){this.viewGL=new s.a("orthographic"),this.groupGL=new a.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new l.a;var i=new a.a.Mesh({geometry:new a.a.PlaneGeometry,material:new a.a.Material({shader:new a.a.Shader({vertex:a.a.Shader.source("ecgl.color.vertex"),fragment:a.a.Shader.source("ecgl.color.fragment")}),transparent:!0})});i.material.enableTexture("diffuseMap"),this.groupGL.add(i),this._planeMesh=i},render:function(e,t,i){var n=this._particleSurface;n.setParticleType(e.get("particleType")),n.setSupersampling(e.get("supersampling")),this._updateData(e,i),this._updateCamera(i.getWidth(),i.getHeight(),i.getDevicePixelRatio());var r=o.a.firstNotNull(e.get("particleDensity"),128);n.setParticleDensity(r,r);var s=this._planeMesh,l=+new Date,u=this,h=!0;s.__percent=0,s.stopAnimation(),s.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var e=+new Date,t=Math.min(e-l,20);l+=t,u._renderer&&(n.update(u._renderer,i,t/1e3,h),s.material.set("diffuseMap",n.getSurfaceTexture())),h=!1})).start();var c=e.getModel("itemStyle"),d=a.a.parseColor(c.get("color"));d[3]*=o.a.firstNotNull(c.get("opacity"),1),s.material.set("color",d),n.setColorTextureImage(e.get("colorTexture"),i),n.setParticleSize(e.get("particleSize")),n.particleSpeedScaling=e.get("particleSpeed"),n.motionBlurFactor=1-Math.pow(.1,e.get("particleTrail"))},updateTransform:function(e,t,i){this._updateData(e,i)},afterRender:function(e,t,i,n){var r=n.renderer;this._renderer=r},_updateData:function(e,t){var i=e.coordinateSystem,n=i.dimensions.map((function(t){return e.coordDimToDataDim(t)[0]})),r=e.getData(),a=r.getDataExtent(n[0]),o=r.getDataExtent(n[1]),s=e.get("gridWidth"),l=e.get("gridHeight");if(null==s||"auto"===s){var u=(a[1]-a[0])/(o[1]-o[0]);s=Math.round(Math.sqrt(u*r.count()))}null!=l&&"auto"!==l||(l=Math.ceil(r.count()/s));var h=this._particleSurface.vectorFieldTexture,c=h.pixels;if(c&&c.length===l*s*4)for(var d=0;d<c.length;d++)c[d]=0;else c=h.pixels=new Float32Array(s*l*4);var f=0,p=1/0,g=new Float32Array(2*r.count()),m=0,v=[[1/0,1/0],[-1/0,-1/0]];r.each([n[0],n[1],"vx","vy"],(function(e,t,n,r){var a=i.dataToPoint([e,t]);g[m++]=a[0],g[m++]=a[1],v[0][0]=Math.min(a[0],v[0][0]),v[0][1]=Math.min(a[1],v[0][1]),v[1][0]=Math.max(a[0],v[1][0]),v[1][1]=Math.max(a[1],v[1][1]);var o=Math.sqrt(n*n+r*r);f=Math.max(f,o),p=Math.min(p,o)})),r.each(["vx","vy"],(function(e,t,i){var n=Math.round((g[2*i]-v[0][0])/(v[1][0]-v[0][0])*(s-1)),r=4*((l-1-Math.round((g[2*i+1]-v[0][1])/(v[1][1]-v[0][1])*(l-1)))*s+n);c[r]=e/f*.5+.5,c[r+1]=t/f*.5+.5,c[r+3]=1})),h.width=s,h.height=l,"bmap"===e.get("coordinateSystem")&&this._fillEmptyPixels(h),h.dirty(),this._updatePlanePosition(v[0],v[1],e,t),this._updateGradientTexture(r.getVisual("visualMeta"),[p,f])},_fillEmptyPixels:function(e){var t=e.pixels,i=e.width,n=e.height;function r(e,r,a){e=Math.max(Math.min(e,i-1),0);var o=4*((r=Math.max(Math.min(r,n-1),0))*(i-1)+e);return 0!==t[o+3]&&(a[0]=t[o],a[1]=t[o+1],!0)}function a(e,t,i){i[0]=e[0]+t[0],i[1]=e[1]+t[1]}for(var o=[],s=[],l=[],u=[],h=[],c=0,d=0;d<n;d++)for(var f=0;f<i;f++){var p=4*(d*(i-1)+f);0===t[p+3]&&(c=o[0]=o[1]=0,r(f-1,d,s)&&(c++,a(s,o,o)),r(f+1,d,l)&&(c++,a(l,o,o)),r(f,d-1,u)&&(c++,a(u,o,o)),r(f,d+1,h)&&(c++,a(h,o,o)),o[0]/=c,o[1]/=c,t[p]=o[0],t[p+1]=o[1]),t[p+3]=1}},_updateGradientTexture:function(e,t){if(e&&e.length){this._gradientTexture=this._gradientTexture||new a.a.Texture2D({image:document.createElement("canvas")});var i=this._gradientTexture,n=i.image;n.width=200,n.height=1;var r=n.getContext("2d"),o=r.createLinearGradient(0,.5,n.width,.5);e[0].stops.forEach((function(e){var i;t[1]===t[0]?i=0:(i=e.value/t[1],i=Math.min(Math.max(i,0),1)),o.addColorStop(i,e.color)})),r.fillStyle=o,r.fillRect(0,0,n.width,n.height),i.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)}else this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(e,t,i,n){var r=this._limitInViewportAndFullFill(e,t,i,n);e=r.leftTop,t=r.rightBottom,this._particleSurface.setRegion(r.region),this._planeMesh.position.set((e[0]+t[0])/2,n.getHeight()-(e[1]+t[1])/2,0);var a=t[0]-e[0],o=t[1]-e[1];this._planeMesh.scale.set(a/2,o/2,1),this._particleSurface.resize(Math.max(Math.min(a,2048),1),Math.max(Math.min(o,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(e,t,i,n){var r=[Math.max(e[0],0),Math.max(e[1],0)],a=[Math.min(t[0],n.getWidth()),Math.min(t[1],n.getHeight())];if("bmap"===i.get("coordinateSystem")){var o=i.getData().getDataExtent(i.coordDimToDataDim("lng")[0]);Math.floor(o[1]-o[0])>=359&&(r[0]>0&&(r[0]=0),a[0]<n.getWidth()&&(a[0]=n.getWidth()))}var s=t[0]-e[0],l=t[1]-e[1],u=a[0]-r[0],h=a[1]-r[1];return{leftTop:r,rightBottom:a,region:[(r[0]-e[0])/s,1-h/l-(r[1]-e[1])/l,u/s,h/l]}},_updateCamera:function(e,t,i){this.viewGL.setViewport(0,0,e,t,i);var n=this.viewGL.camera;n.left=n.bottom=0,n.top=t,n.right=e,n.near=0,n.far=100,n.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}})},function(e,t,i){var n=i(16),r=i(15),a=i(40),o=i(19),s=i(8),l=i(5),u=i(4),h=i(37),c=i(43),d=i(10),f=i(278),p=i(279);s.a.import(p.a);var g=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new l.a({type:u.a.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};g.prototype={constructor:g,init:function(){var e={type:u.a.FLOAT,minFilter:u.a.NEAREST,magFilter:u.a.NEAREST,useMipmap:!1};this._spawnTexture=new l.a(e),this._particleTexture0=new l.a(e),this._particleTexture1=new l.a(e),this._frameBuffer=new d.a({depthBuffer:!1}),this._particlePass=new n.a({fragment:s.a.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new n.a({fragment:s.a.source("clay.compositor.downsample")});var t=new a.a({renderOrder:10,material:new o.a({shader:new s.a(s.a.source("ecgl.vfParticle.renderPoints.vertex"),s.a.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:a.a.POINTS,geometry:new r.a({dynamic:!0,mainAttribute:"texcoord0"})}),i=new a.a({renderOrder:10,material:new o.a({shader:new s.a(s.a.source("ecgl.vfParticle.renderLines.vertex"),s.a.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new f.a,culling:!1}),p=new a.a({material:new o.a({shader:new s.a(s.a.source("ecgl.color.vertex"),s.a.source("ecgl.color.fragment"))}),geometry:new c.a});p.material.enableTexture("diffuseMap"),this._particlePointsMesh=t,this._particleLinesMesh=i,this._lastFrameFullQuadMesh=p,this._camera=new h.a,this._thisFrameTexture=new l.a,this._lastFrameTexture=new l.a},setParticleDensity:function(e,t){for(var i=new Float32Array(e*t*4),n=0,r=this.particleLife,a=0;a<e;a++)for(var o=0;o<t;o++,n++){i[4*n]=Math.random(),i[4*n+1]=Math.random(),i[4*n+2]=Math.random();var s=(r[1]-r[0])*Math.random()+r[0];i[4*n+3]=s}"line"===this._particleType?this._setLineGeometry(e,t):this._setPointsGeometry(e,t),this._spawnTexture.width=e,this._spawnTexture.height=t,this._spawnTexture.pixels=i,this._particleTexture0.width=this._particleTexture1.width=e,this._particleTexture0.height=this._particleTexture1.height=t,this._particlePass.setUniform("textureSize",[e,t])},_setPointsGeometry:function(e,t){var i=e*t,n=this._particlePointsMesh.geometry,r=n.attributes;r.texcoord0.init(i);for(var a=0,o=0;o<e;o++)for(var s=0;s<t;s++,a++)r.texcoord0.value[2*a]=o/e,r.texcoord0.value[2*a+1]=s/t;n.dirty()},_setLineGeometry:function(e,t){var i=e*t,n=this._getParticleMesh().geometry;n.setLineCount(i),n.resetOffset();for(var r=0;r<e;r++)for(var a=0;a<t;a++)n.addLine([r/e,a/t]);n.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(e,t,i,n){var r=this._getParticleMesh(),a=this._frameBuffer,o=this._particlePass;n&&this._updateDownsampleTextures(e,t),r.material.set("size",this._particleSize*this._supersampling),r.material.set("color",this.particleColor),o.setUniform("speedScaling",this.particleSpeedScaling),a.attach(this._particleTexture1),o.setUniform("firstFrameTime",n?(this.particleLife[1]+this.particleLife[0])/2:0),o.setUniform("particleTexture",this._particleTexture0),o.setUniform("deltaTime",i),o.setUniform("elapsedTime",this._elapsedTime),o.render(e,a),r.material.set("particleTexture",this._particleTexture1),r.material.set("prevParticleTexture",this._particleTexture0),a.attach(this._thisFrameTexture),a.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT);var s=this._lastFrameFullQuadMesh;s.material.set("diffuseMap",this._lastFrameTexture),s.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),e.renderPass([s,r],this._camera),a.unbind(e),this._downsample(e),this._swapTexture(),this._elapsedTime+=i},_downsample:function(e){var t=this._downsampleTextures;if(0!==t.length)for(var i=0,n=this._thisFrameTexture,r=t[i];r;)this._frameBuffer.attach(r),this._downsamplePass.setUniform("texture",n),this._downsamplePass.setUniform("textureSize",[n.width,n.height]),this._downsamplePass.render(e,this._frameBuffer),n=r,r=t[++i]},getSurfaceTexture:function(){var e=this._downsampleTextures;return e.length>0?e[e.length-1]:this._lastFrameTexture},setRegion:function(e){this._particlePass.setUniform("region",e)},resize:function(e,t){this._lastFrameTexture.width=e*this._supersampling,this._lastFrameTexture.height=t*this._supersampling,this._thisFrameTexture.width=e*this._supersampling,this._thisFrameTexture.height=t*this._supersampling,this._width=e,this._height=t},setParticleSize:function(e){var t=this._getParticleMesh();if(e<=2)return t.material.disableTexture("spriteTexture"),void(t.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new l.a),this._spriteTexture.image&&this._spriteTexture.image.width===e||(this._spriteTexture.image=function(e){var t=document.createElement("canvas");t.width=t.height=e;var i=t.getContext("2d");return i.fillStyle="#fff",i.arc(e/2,e/2,e/2,0,2*Math.PI),i.fill(),t}(e),this._spriteTexture.dirty()),t.material.transparent=!0,t.material.enableTexture("spriteTexture"),t.material.set("spriteTexture",this._spriteTexture),this._particleSize=e},setGradientTexture:function(e){var t=this._getParticleMesh().material;t[e?"enableTexture":"disableTexture"]("gradientTexture"),t.setUniform("gradientTexture",e)},setColorTextureImage:function(e,t){this._getParticleMesh().material.setTextureImage("colorTexture",e,t,{flipY:!0})},setParticleType:function(e){this._particleType=e},clearFrame:function(e){var t=this._frameBuffer;t.attach(this._lastFrameTexture),t.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),t.unbind(e)},setSupersampling:function(e){this._supersampling=e,this.resize(this._width,this._height)},_updateDownsampleTextures:function(e,t){for(var i=this._downsampleTextures,n=Math.max(Math.floor(Math.log(this._supersampling/t.getDevicePixelRatio())/Math.log(2)),0),r=2,a=this._width*this._supersampling,o=this._height*this._supersampling,s=0;s<n;s++)i[s]=i[s]||new l.a,i[s].width=a/r,i[s].height=o/r,r*=2;for(;s<i.length;s++)i[s].dispose(e);i.length=n},_swapTexture:function(){var e=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=e,e=this._thisFrameTexture,this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=e},dispose:function(e){e.disposeFrameBuffer(this._frameBuffer),e.disposeTexture(this.vectorFieldTexture),e.disposeTexture(this._spawnTexture),e.disposeTexture(this._particleTexture0),e.disposeTexture(this._particleTexture1),e.disposeTexture(this._thisFrameTexture),e.disposeTexture(this._lastFrameTexture),e.disposeGeometry(this._particleLinesMesh.geometry),e.disposeGeometry(this._particlePointsMesh.geometry),e.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&e.disposeTexture(this._spriteTexture),this._particlePass.dispose(e),this._downsamplePass.dispose(e),this._downsampleTextures.forEach((function(t){t.dispose(e)}))}},t.a=g},function(e,t,i){var n=i(15),r=i(0);i.n(r);var a=n.a.extend((function(){return{dynamic:!0,attributes:{position:new n.a.Attribute("position","float",3,"POSITION")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(e){var t=this.attributes,i=4*e,n=2*e;this.vertexCount!==i&&t.position.init(i),this.triangleCount!==n&&(this.indices=0===n?null:this.vertexCount>65535?new Uint32Array(3*n):new Uint16Array(3*n))},addLine:function(e){var t=this._vertexOffset;this.attributes.position.set(t,[e[0],e[1],1]),this.attributes.position.set(t+1,[e[0],e[1],-1]),this.attributes.position.set(t+2,[e[0],e[1],2]),this.attributes.position.set(t+3,[e[0],e[1],-2]),this.setTriangleIndices(this._faceOffset++,[t,t+1,t+2]),this.setTriangleIndices(this._faceOffset++,[t+1,t+2,t+3]),this._vertexOffset+=4}});t.a=a},function(e,t,i){t.a="@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n"},function(e,t,i){var n=i(0),r=i.n(n);r.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(e,t){var i=r.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];if(i.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");i.push("vx","vy");var n=r.a.helper.completeDimensions(i,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),a=new r.a.List(n,this);return a.initData(this.getSource()),a},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}})},function(e,t,i){var n=i(0),r=i.n(n);i(282),i(283);var a=i(17);r.a.registerVisual(Object(a.a)("linesGL"))},function(e,t,i){var n=i(0),r=i.n(n),a=i(13);i.n(a);var o=r.a.extendSeriesModel({type:"series.linesGL",dependencies:["grid","geo"],visualColorAccessPath:"lineStyle.color",streamEnabled:!0,init:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),o.superApply(this,"init",arguments)},mergeOption:function(e){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),o.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=Object(a.concatArray)(this._flatCoords,t.flatCoords),this._flatCoordsOffset=Object(a.concatArray)(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e),i=t.option instanceof Array?t.option:t.getShallow("coords");if(!(i instanceof Array&&i.length>0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");return i},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*e],n=this._flatCoordsOffset[2*e+1],r=0;r<n;r++)t[r]=t[r]||[],t[r][0]=this._flatCoords[i+2*r],t[r][1]=this._flatCoords[i+2*r+1];return n}var a=this._getCoordsFromItemModel(e);for(r=0;r<a.length;r++)t[r]=t[r]||[],t[r][0]=a[r][0],t[r][1]=a[r][1];return a.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var i=e.length,n=new Uint32Array(i),r=new Float64Array(i),a=0,o=0,s=0,l=0;l<i;){s++;var u=e[l++];n[o++]=a+t,n[o++]=u;for(var h=0;h<u;h++){var c=e[l++],d=e[l++];if(r[a++]=c,r[a++]=d,l>i)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,o),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var i=new r.a.List(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,r){if(e instanceof Array)return NaN;i.hasItemOption=!0;var a=e.value;return null!=a?a instanceof Array?a[r]:a:void 0})),i},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}})},function(e,t,i){var n=i(0),r=i.n(n),a=i(1),o=i(22),s=i(105),l=i(103),u=i(2);r.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(e,t){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new l.a(this.viewGL),this._nativeLinesShader=a.a.createShader("ecgl.lines3D"),this._meshLinesShader=a.a.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(e,t,i){this.groupGL.removeAll(),this._glViewHelper.reset(e,i);var n=this._linesMeshes[0];n||(n=this._linesMeshes[0]=this._createLinesMesh(e)),this._linesMeshes.length=1,this.groupGL.add(n),this._updateLinesMesh(e,n,0,e.getData().count()),this.viewGL.setPostEffect(e.getModel("postEffect"),i)},incrementalPrepareRender:function(e,t,i){this.groupGL.removeAll(),this._glViewHelper.reset(e,i),this._currentStep=0,this.viewGL.setPostEffect(e.getModel("postEffect"),i)},incrementalRender:function(e,t,i,n){var r=this._linesMeshes[this._currentStep];r||(r=this._createLinesMesh(t),this._linesMeshes[this._currentStep]=r),this._updateLinesMesh(t,r,e.start,e.end),this.groupGL.add(r),n.getZr().refresh(),this._currentStep++},updateTransform:function(e,t,i){e.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(e,i)},_createLinesMesh:function(e){return new a.a.Mesh({$ignorePicking:!0,material:new a.a.Material({shader:a.a.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new s.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:a.a.Mesh.LINES,culling:!1})},_updateLinesMesh:function(e,t,i,n){var r=e.getData();t.material.blend="lighter"===e.get("blendMode")?a.a.additiveBlend:null;var o=e.get("lineStyle.curveness")||0,s=e.get("polyline"),l=t.geometry,h=e.coordinateSystem,c=u.a.firstNotNull(e.get("lineStyle.width"),1);c>1?(t.material.shader!==this._meshLinesShader&&t.material.attachShader(this._meshLinesShader),t.mode=a.a.Mesh.TRIANGLES):(t.material.shader!==this._nativeLinesShader&&t.material.attachShader(this._nativeLinesShader),t.mode=a.a.Mesh.LINES),i=i||0,n=n||r.count(),l.resetOffset();var d=0,f=0,p=[],g=[],m=[],v=[],y=[],_=.3,x=.7;function b(){g[0]=p[0]*x+v[0]*_-(p[1]-v[1])*o,g[1]=p[1]*x+v[1]*_-(v[0]-p[0])*o,m[0]=p[0]*_+v[0]*x-(p[1]-v[1])*o,m[1]=p[1]*_+v[1]*x-(v[0]-p[0])*o}if(s||0!==o)for(var w=i;w<n;w++)if(s){var T=e.getLineCoordsCount(w);d+=l.getPolylineVertexCount(T),f+=l.getPolylineTriangleCount(T)}else e.getLineCoords(w,y),this._glViewHelper.dataToPoint(h,y[0],p),this._glViewHelper.dataToPoint(h,y[1],v),b(),d+=l.getCubicCurveVertexCount(p,g,m,v),f+=l.getCubicCurveTriangleCount(p,g,m,v);else{var S=n-i;d+=S*l.getLineVertexCount(),f+=S*l.getLineVertexCount()}l.setVertexCount(d),l.setTriangleCount(f);var M=i,A=[];for(w=i;w<n;w++){a.a.parseColor(r.getItemVisual(M,"color"),A);var I=u.a.firstNotNull(r.getItemVisual(M,"opacity"),1);A[3]*=I,T=e.getLineCoords(w,y);for(var C=0;C<T;C++)this._glViewHelper.dataToPoint(h,y[C],y[C]);s?l.addPolyline(y,A,c,0,T):0!==o?(p=y[0],v=y[1],b(),l.addCubicCurve(p,g,m,v,A,c)):l.addPolyline(y,A,c,0,2),M++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})}])},t8(i);export{i8 as e};
|