import{U as e,V as t}from"./vendor.f6a75447.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;n3&&(n=j.call(n,1));for(var a=t.length,o=0;o4&&(n=j.call(n,1,n.length-1));for(var a=n[n.length-1],o=t.length,s=0;s>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;a1&&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;or)e.length=r;else for(var a=n;a=0&&!(m[i]<=t);i--);i=Math.min(i,u-2)}else{for(i=D;it);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;e0&&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=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=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=0;)r++;return r-t}function Di(e,t,i,n,r){for(n===t&&n++;n>>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;l0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=o;o=r-l,l=r-u}for(o++;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;ls&&(l=s);var u=o;o=r-l,l=r-u}else{for(s=n-r;l=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=r,l+=r}for(o++;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=7||f>=7);if(p)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===n){for(l=0;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)=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=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;l1;){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])break;s(e)}},this.forceMergeRuns=function(){for(;a>1;){var e=a-2;e>0&&n[e-1]=32;)t|=1&e,e>>=1;return e+t}(r);do{if((a=Ci(e,i,n,t))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=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;o0},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;a5e3&&(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=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;ah)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;fr&&Hn(i,e.substring(r,a)),Hn(i,n[2],n[1]),r=Cn.lastIndex}rf)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&&Cu&&(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;_=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=0&&i.splice(n,1),e.__hoverMir=null},clearHover:function(e){for(var t=this._hoverElements,i=0;i15)break}s.__drawIndex=g,s.__drawIndex0&&e>n[0]){for(o=0;oe);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;n0?.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=0&&this._clips.splice(t,1)},removeAnimator:function(e){for(var t=e.getClips(),i=0;i=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=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))=0&&p=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))=0&&m1e-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:rr&&(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;it.length&&(this._expandData(),t=this.data);for(var i=0;i0&&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&&fl||c>0&&pu||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(;_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;al||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||oe+s&&a>i+s||at+c&&h>n+c&&h>a+c&&h>s+c||he+c&&u>i+c&&u>r+c&&u>o+c||ut+u&&l>n+u&&l>a+u||le+u&&s>i+u&&s>r+u||si||h+ur&&(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||ar?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||u1&&(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?vt&&s>n&&s>a||s=0&&u<=1){for(var h=0,c=Ls.quadraticAt(t,n,a,u),d=0;di||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;d1&&(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;r1&&(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=11?function(){var t,i=this.__clipPaths,n=this.style;if(i)for(var r=0;ri-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=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=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=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]}));lh&&(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=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':'':{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=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;nt)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=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=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=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||d1&&n>0?s:o}};return a;function o(){return t=e?null:a":"\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":"
":"",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=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(t1?"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;fi.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=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;n0;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;a65535?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=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=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_[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;pS[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=0&&t=0&&to&&(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=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(null!=i&&ie))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=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=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=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=l&&b<=u||isNaN(b))&&(a[o++]=T)}else for(m=0;me[M][1])&&(S=!1)}S&&(a[o++]=this.getRawIndex(m))}return ob[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;pu-p&&(s=u-p,o.length=s);for(var g=0;gc[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=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[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&&on&&(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[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]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;rn[0]&&h0&&(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&&tn&&(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=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)i&&(a=i);var o=qx.length,s=function(e,t,i,n){for(;i>>1;e[r][1]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;_>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;n0})),(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;i1&&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:e0&&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;o0&&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;_+=''+e.dom+""})),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;ut.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;l0&&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;n0?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=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=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;rn[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(;n0&&$T(i[a-1]);a--);for(;rn)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=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;mt&&(t=e[i]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,i=0;i1)"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;rt[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;nu[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&&a0?"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=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;rl[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),oe&&(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;x0?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=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();n0&&(l?"scale"!==u:"transition"!==h)){for(var f=r.getItemLayout(0),p=1;isNaN(f.startAngle)&&p=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;al+o);a++)if(e[a].y+=n,a>t&&a+1e[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-i0&&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=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=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.angle0?"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=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;li[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":"\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":"\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=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;i1?(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;at&&(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=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;ia&&(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_.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=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;th.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;r3||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=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:tu[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;djR&&(u=jR),o=a}us[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*tr&&(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=0&&e.call(t,i[r],r)},gO.eachEdge=function(e,t){for(var i=this.edges,n=i.length,r=0;r=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=0&&i.node2.dataIndex>=0}));for(r=0,a=n.length;r=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 "+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 ")),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].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=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]=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=e&&(0===t?0:n[t-1][0]).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();o0?-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.spana&&(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=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;ur*(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;n1)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;o5)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=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;d0&&(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=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;yc-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;s0;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;tn&&(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();n0?"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:i0?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 "))},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=0&&!(n[o]<=t);o--);o=Math.min(o,r-2)}else{for(var o=a;ot);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;r0){e.moveTo(i[r++],i[r++]);for(var o=1;o0){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;o0)for(var l=n[o++],u=n[o++],h=1;h0){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;h0){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=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=0;n--){var o;if((o=t[n].interval)[0]<=e&&e<=o[1]){a=n;break}}return n>=0&&n0?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,h0: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=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;oa&&(a=u),n.push(u)}for(var h=0;ha&&(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;p1;)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)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*_;rn[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=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)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=lo;)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;hf?"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;um?"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.timea.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&&tn.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=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=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='';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=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=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=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=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[1]&&(n[1]=t[1])}))})),n[1]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;sa[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;a0?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;a1?"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="
"):(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;gt[0][1]&&(t[0][1]=a[0]),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=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":"\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=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=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;ii[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=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"],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]=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;oe[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[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","≥"][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("')}}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=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.01?N&&(R+=270/K5):Math.abs(O-C)<1e-4?N&&RI?_-=270/K5:_+=270/K5:N&&OC?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;F100&&(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-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=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;MA){for(;S=r&&u+1>=a){for(var h=[],c=0;c=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=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-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=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(/>\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;o3?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;li?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=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=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;s0&&(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;s1?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;os[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;o65535&&(this.indices=new n.a.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,i=this.getEnabledAttributes(),r={},a=0;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;ar[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]=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=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=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;t30},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;lthis.camera.far||e65535?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;W1&&(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;m1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m0&&(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=e1&&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;l0&&(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;s0&&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;i0&&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;r0?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),"
"+a.join("
")}(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?": ":"
"):"",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]),h0&&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;e0},_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;d0&&(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;y0){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;Nthis._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;fh)){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=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=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&&g1)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=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;l20)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;si)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;l65535?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;d0;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;s1?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;othis._endIndex)){t-=this._startIndex;for(var n=this._vertexRangeOfDataIndex[2*t];n=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;h0,i={},n=0;n2?(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;w1?(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;othis._endDataIndex||tthis._endDataIndex||t.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 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>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>>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;ho&&(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=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=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]}));uc&&(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=-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=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;tc&&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;l50&&(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;R1&&(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;w1&&(m.copy(b,b-1),v.copy(b,b-1),b++);else{var M;if(w0){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=ee&&o=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;t20)){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=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=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);s0&&n.push("#define "+r.toUpperCase()+"_COUNT "+a)}if(i)for(var o=0;oh.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=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=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=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;r0){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]<>>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;a128){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=u)){h+=2;for(var c="";h=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;i65535?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=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.5?t:e}function c(e,t,i,n,r){var a=e.length;if(1==r)for(var o=0;or)e.length=r;else for(var a=n;a=0&&!(I[i]<=t);i--);i=Math.min(i,x-2)}else{for(i=V;it);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;e255?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;on[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;ai.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;h0&&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;y65535?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;I65535?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"'])/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':'':""},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;a5e3&&(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=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;al)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;ca&&I(i,e.substring(a,o)),I(i,n[2],n[1]),a=f.lastIndex}ay)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&&k4){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;f0?y.define("fragment",v,m):y.isDefined("fragment",v)&&y.undefine("fragment",v))}for(f=0;f0){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;wl?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 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=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=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 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;o80*i){n=l=e[0],s=u=e[1];for(var x=i;xl&&(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=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;t0||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.xa.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.x&&n.x>=h&&r!==n.x&&g(ai.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=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;a0},_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;lOpenStreetMap contributors, © CARTO',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]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;r0&&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=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||oe+s&&a>i+s||al?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=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&&ep-g*h&&t=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.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;a0&&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;Iw&&(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;I0?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;n0;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=0){var s=[];n.geometry.attributes.position.get(o,s);for(var u=r.pointToData(s),h=1/0,c=-1,d=[],f=0;f65535?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 ")),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 "+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=0&&e.call(t,i[r],r)},s.eachEdge=function(e,t){for(var i=this.edges,n=i.length,r=0;r=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=0&&i.node2.dataIndex>=0})),r=0,a=n.length;r=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=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;si.left&&ui.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;re},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;d5e4?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;ue},s.prototype.getNodePosition=function(e,t){if(t||(t=new Float32Array(2*this._nodes.length)),this._positionArr)for(var i=0;i=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;a0&&(this.strongGravityMode?this.applyNodeStrongGravity(h):this.applyNodeGravity(h))}for(l=0;l0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m,l=0;l0&&(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;o0)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;r0?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=359&&(r[0]>0&&(r[0]=0),a[0]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;s65535?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;ri)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