Files
QIDI_PLUS4/fluidd/assets/vue-echarts-chunk-Behpt2qw.js
2024-12-04 10:21:57 +08:00

3534 lines
1000 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{V as T1,d as N2,s as Qf,t as O2,c as Ma,g as B2,w as jl,a as S1,o as F2,b as k2,h as z2,i as Ql,n as U2,e as H2,u as V2}from"./index-CxlebU9W.js";var rv=T1;T1.util.warn;/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var iv=function(t,e){return iv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},iv(t,e)};function K(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");iv(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var G2=function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t}(),W2=function(){function t(){this.browser=new G2,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return t}(),vt=new W2;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(vt.wxa=!0,vt.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?vt.worker=!0:typeof navigator>"u"||navigator.userAgent.indexOf("Node.js")===0?(vt.node=!0,vt.svgSupported=!0):X2(navigator.userAgent,vt);function X2(t,e){var r=e.browser,i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(t);i&&(r.firefox=!0,r.version=i[1]),n&&(r.ie=!0,r.version=n[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}var Md=12,w1="sans-serif",Zi=Md+"px "+w1,Y2=20,Z2=100,q2="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function $2(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r<t.length;r++){var i=String.fromCharCode(r+32),n=(t.charCodeAt(r)-Y2)/Z2;e[i]=n}return e}var K2=$2(q2),oo={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var t,e;return function(r,i){if(!t){var n=oo.createCanvas();t=n&&n.getContext("2d")}if(t)return e!==i&&(e=t.font=i||Zi),t.measureText(r);r=r||"",i=i||Zi;var a=/((?:\d+)?\.?\d*)px/.exec(i),o=a&&+a[1]||Md,s=0;if(i.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var u=K2[r[l]];s+=u==null?o:u*o}return{width:s}}}(),loadImage:function(t,e,r){var i=new Image;return i.onload=e,i.onerror=r,i.src=t,i}},b1=Qn(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),A1=Qn(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),Us=Object.prototype.toString,uf=Array.prototype,j2=uf.forEach,Q2=uf.filter,Cd=uf.slice,J2=uf.map,ag=(function(){}).constructor,Js=ag?ag.prototype:null,Dd="__proto__",tb=2311;function E1(){return tb++}function Ld(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function ut(t){if(t==null||typeof t!="object")return t;var e=t,r=Us.call(t);if(r==="[object Array]"){if(!rs(t)){e=[];for(var i=0,n=t.length;i<n;i++)e[i]=ut(t[i])}}else if(A1[r]){if(!rs(t)){var a=t.constructor;if(a.from)e=a.from(t);else{e=new a(t.length);for(var i=0,n=t.length;i<n;i++)e[i]=t[i]}}}else if(!b1[r]&&!rs(t)&&!gs(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==Dd&&(e[o]=ut(t[o]))}return e}function dt(t,e,r){if(!rt(e)||!rt(t))return r?ut(e):t;for(var i in e)if(e.hasOwnProperty(i)&&i!==Dd){var n=t[i],a=e[i];rt(a)&&rt(n)&&!j(a)&&!j(n)&&!gs(a)&&!gs(n)&&!og(a)&&!og(n)&&!rs(a)&&!rs(n)?dt(n,a,r):(r||!(i in t))&&(t[i]=ut(e[i]))}return t}function Y(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==Dd&&(t[r]=e[r]);return t}function Et(t,e,r){for(var i=mt(e),n=0;n<i.length;n++){var a=i[n];t[a]==null&&(t[a]=e[a])}return t}function bt(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r}return-1}function Rd(t,e){var r=t.prototype;function i(){}i.prototype=e.prototype,t.prototype=new i;for(var n in r)r.hasOwnProperty(n)&&(t.prototype[n]=r[n]);t.prototype.constructor=t,t.superClass=e}function kr(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),n=0;n<i.length;n++){var a=i[n];a!=="constructor"&&t[a]==null&&(t[a]=e[a])}else Et(t,e)}function ke(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function C(t,e,r){if(t&&e)if(t.forEach&&t.forEach===j2)t.forEach(e,r);else if(t.length===+t.length)for(var i=0,n=t.length;i<n;i++)e.call(r,t[i],i,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(r,t[a],a,t)}function tt(t,e,r){if(!t)return[];if(!e)return Pd(t);if(t.map&&t.map===J2)return t.map(e,r);for(var i=[],n=0,a=t.length;n<a;n++)i.push(e.call(r,t[n],n,t));return i}function Qn(t,e,r,i){if(t&&e){for(var n=0,a=t.length;n<a;n++)r=e.call(i,r,t[n],n,t);return r}}function oe(t,e,r){if(!t)return[];if(!e)return Pd(t);if(t.filter&&t.filter===Q2)return t.filter(e,r);for(var i=[],n=0,a=t.length;n<a;n++)e.call(r,t[n],n,t)&&i.push(t[n]);return i}function mt(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}function eb(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return function(){return t.apply(e,r.concat(Cd.call(arguments)))}}var nt=Js&&ct(Js.bind)?Js.call.bind(Js.bind):eb;function le(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(Cd.call(arguments)))}}function j(t){return Array.isArray?Array.isArray(t):Us.call(t)==="[object Array]"}function ct(t){return typeof t=="function"}function Q(t){return typeof t=="string"}function nv(t){return Us.call(t)==="[object String]"}function $t(t){return typeof t=="number"}function rt(t){var e=typeof t;return e==="function"||!!t&&e==="object"}function og(t){return!!b1[Us.call(t)]}function Ke(t){return!!A1[Us.call(t)]}function gs(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function ff(t){return t.colorStops!=null}function rb(t){return t.image!=null}function yu(t){return t!==t}function ja(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,i=t.length;r<i;r++)if(t[r]!=null)return t[r]}function ft(t,e){return t??e}function Jl(t,e,r){return t??e??r}function Pd(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return Cd.apply(t,e)}function M1(t){if(typeof t=="number")return[t,t,t,t];var e=t.length;return e===2?[t[0],t[1],t[0],t[1]]:e===3?[t[0],t[1],t[2],t[1]]:t}function xr(t,e){if(!t)throw new Error(e)}function jr(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var C1="__ec_primitive__";function xu(t){t[C1]=!0}function rs(t){return t[C1]}var ib=function(){function t(){this.data={}}return t.prototype.delete=function(e){var r=this.has(e);return r&&delete this.data[e],r},t.prototype.has=function(e){return this.data.hasOwnProperty(e)},t.prototype.get=function(e){return this.data[e]},t.prototype.set=function(e,r){return this.data[e]=r,this},t.prototype.keys=function(){return mt(this.data)},t.prototype.forEach=function(e){var r=this.data;for(var i in r)r.hasOwnProperty(i)&&e(r[i],i)},t}(),D1=typeof Map=="function";function nb(){return D1?new Map:new ib}var ab=function(){function t(e){var r=j(e);this.data=nb();var i=this;e instanceof t?e.each(n):e&&C(e,n);function n(a,o){r?i.set(a,o):i.set(o,a)}}return t.prototype.hasKey=function(e){return this.data.has(e)},t.prototype.get=function(e){return this.data.get(e)},t.prototype.set=function(e,r){return this.data.set(e,r),r},t.prototype.each=function(e,r){this.data.forEach(function(i,n){e.call(r,i,n)})},t.prototype.keys=function(){var e=this.data.keys();return D1?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t}();function ht(t){return new ab(t)}function ob(t,e){for(var r=new t.constructor(t.length+e.length),i=0;i<t.length;i++)r[i]=t[i];for(var n=t.length,i=0;i<e.length;i++)r[i+n]=e[i];return r}function hf(t,e){var r;if(Object.create)r=Object.create(t);else{var i=function(){};i.prototype=t,r=new i}return e&&Y(r,e),r}function L1(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function gt(t,e){return t.hasOwnProperty(e)}function Te(){}var tu=180/Math.PI;function so(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function sb(t){return[t[0],t[1]]}function sg(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function lb(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function ub(t){return Math.sqrt(fb(t))}function fb(t){return t[0]*t[0]+t[1]*t[1]}function Jf(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function hb(t,e){var r=ub(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function av(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var ov=av;function cb(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Ha=cb;function th(t,e,r,i){return t[0]=e[0]+i*(r[0]-e[0]),t[1]=e[1]+i*(r[1]-e[1]),t}function _r(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}function Pa(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Ia(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var ia=function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t}(),vb=function(){function t(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(e){for(var r=e.target;r&&!r.draggable;)r=r.parent||r.__hostTarget;r&&(this._draggingTarget=r,r.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new ia(r,e),"dragstart",e.event))},t.prototype._drag=function(e){var r=this._draggingTarget;if(r){var i=e.offsetX,n=e.offsetY,a=i-this._x,o=n-this._y;this._x=i,this._y=n,r.drift(a,o,e),this.handler.dispatchToElement(new ia(r,e),"drag",e.event);var s=this.handler.findHover(i,n,r).target,l=this._dropTarget;this._dropTarget=s,r!==s&&(l&&s!==l&&this.handler.dispatchToElement(new ia(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new ia(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new ia(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new ia(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t}(),zr=function(){function t(e){e&&(this._$eventProcessor=e)}return t.prototype.on=function(e,r,i,n){this._$handlers||(this._$handlers={});var a=this._$handlers;if(typeof r=="function"&&(n=i,i=r,r=null),!i||!e)return this;var o=this._$eventProcessor;r!=null&&o&&o.normalizeQuery&&(r=o.normalizeQuery(r)),a[e]||(a[e]=[]);for(var s=0;s<a[e].length;s++)if(a[e][s].h===i)return this;var l={h:i,query:r,ctx:n||this,callAtLast:i.zrEventfulCallAtLast},u=a[e].length-1,f=a[e][u];return f&&f.callAtLast?a[e].splice(u,0,l):a[e].push(l),this},t.prototype.isSilent=function(e){var r=this._$handlers;return!r||!r[e]||!r[e].length},t.prototype.off=function(e,r){var i=this._$handlers;if(!i)return this;if(!e)return this._$handlers={},this;if(r){if(i[e]){for(var n=[],a=0,o=i[e].length;a<o;a++)i[e][a].h!==r&&n.push(i[e][a]);i[e]=n}i[e]&&i[e].length===0&&delete i[e]}else delete i[e];return this},t.prototype.trigger=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[e],a=this._$eventProcessor;if(n)for(var o=r.length,s=n.length,l=0;l<s;l++){var u=n[l];if(!(a&&a.filter&&u.query!=null&&!a.filter(e,u.query)))switch(o){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,r[0]);break;case 2:u.h.call(u.ctx,r[0],r[1]);break;default:u.h.apply(u.ctx,r);break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},t.prototype.triggerWithContext=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[e],a=this._$eventProcessor;if(n)for(var o=r.length,s=r[o-1],l=n.length,u=0;u<l;u++){var f=n[u];if(!(a&&a.filter&&f.query!=null&&!a.filter(e,f.query)))switch(o){case 0:f.h.call(s);break;case 1:f.h.call(s,r[0]);break;case 2:f.h.call(s,r[0],r[1]);break;default:f.h.apply(s,r.slice(1,o-1));break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},t}(),db=Math.log(2);function sv(t,e,r,i,n,a){var o=i+"-"+n,s=t.length;if(a.hasOwnProperty(o))return a[o];if(e===1){var l=Math.round(Math.log((1<<s)-1&~n)/db);return t[r][l]}for(var u=i|1<<r,f=r+1;i&1<<f;)f++;for(var h=0,v=0,c=0;v<s;v++){var d=1<<v;d&n||(h+=(c%2?-1:1)*t[r][v]*sv(t,e-1,f,u,n|d,a),c++)}return a[o]=h,h}function lg(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],i={},n=sv(r,8,0,0,0,i);if(n!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]==null&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*sv(r,7,o===0?1:0,1<<o,1<<s,i)/n*e[o];return function(l,u,f){var h=u*a[6]+f*a[7]+1;l[0]=(u*a[0]+f*a[1]+a[2])/h,l[1]=(u*a[3]+f*a[4]+a[5])/h}}}var ug="___zrEVENTSAVED",eh=[];function pb(t,e,r,i,n){return lv(eh,e,i,n,!0)&&lv(t,r,eh[0],eh[1])}function lv(t,e,r,i,n){if(e.getBoundingClientRect&&vt.domSupported&&!R1(e)){var a=e[ug]||(e[ug]={}),o=gb(e,a),s=mb(o,a,n);if(s)return s(t,r,i),!0}return!1}function gb(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var i=["left","right"],n=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=o.style,l=a%2,u=(a>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return r}function mb(t,e,r){for(var i=r?"invTrans":"trans",n=e[i],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var f=t[u].getBoundingClientRect(),h=2*u,v=f.left,c=f.top;o.push(v,c),l=l&&a&&v===a[h]&&c===a[h+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&n?n:(e.srcCoords=o,e[i]=r?lg(s,o):lg(o,s))}function R1(t){return t.nodeName.toUpperCase()==="CANVAS"}var _b=/([&<>"'])/g,yb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function _e(t){return t==null?"":(t+"").replace(_b,function(e,r){return yb[r]})}var xb=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rh=[],Tb=vt.browser.firefox&&+vt.browser.version.split(".")[0]<39;function uv(t,e,r,i){return r=r||{},i?fg(t,e,r):Tb&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):fg(t,e,r),r}function fg(t,e,r){if(vt.domSupported&&t.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(R1(t)){var a=t.getBoundingClientRect();r.zrX=i-a.left,r.zrY=n-a.top;return}else if(lv(rh,t,i,n)){r.zrX=rh[0],r.zrY=rh[1];return}}r.zrX=r.zrY=0}function Id(t){return t||window.event}function sr(t,e,r){if(e=Id(e),e.zrX!=null)return e;var i=e.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&uv(t,o,e,r)}else{uv(t,e,e,r);var a=Sb(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&xb.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function Sb(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,i=t.deltaY;if(r==null||i==null)return e;var n=Math.abs(i!==0?i:r),a=i>0?-1:i<0?1:r>0?-1:1;return 3*n*a}function wb(t,e,r,i){t.addEventListener(e,r,i)}function bb(t,e,r,i){t.removeEventListener(e,r,i)}var gi=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function hg(t){return t.which===2||t.which===3}var Ab=function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,i){return this._doTrack(e,r,i),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,i){var n=e.touches;if(n){for(var a={points:[],touches:[],target:r,event:e},o=0,s=n.length;o<s;o++){var l=n[o],u=uv(i,l,{});a.points.push([u.zrX,u.zrY]),a.touches.push(l)}this._track.push(a)}},t.prototype._recognize=function(e){for(var r in ih)if(ih.hasOwnProperty(r)){var i=ih[r](this._track,e);if(i)return i}},t}();function cg(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function Eb(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var ih={pinch:function(t,e){var r=t.length;if(r){var i=(t[r-1]||{}).points,n=(t[r-2]||{}).points||i;if(n&&n.length>1&&i&&i.length>1){var a=cg(i)/cg(n);!isFinite(a)&&(a=1),e.pinchScale=a;var o=Eb(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}};function Va(){return[1,0,0,1,0,0]}function Nd(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Mb(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Ga(t,e,r){var i=e[0]*r[0]+e[2]*r[1],n=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t}function fv(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Od(t,e,r,i){i===void 0&&(i=[0,0]);var n=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],f=Math.sin(r),h=Math.cos(r);return t[0]=n*h+s*f,t[1]=-n*f+s*h,t[2]=a*h+l*f,t[3]=-a*f+h*l,t[4]=h*(o-i[0])+f*(u-i[1])+i[0],t[5]=h*(u-i[1])-f*(o-i[0])+i[1],t}function Cb(t,e,r){var i=r[0],n=r[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function cf(t,e){var r=e[0],i=e[2],n=e[4],a=e[1],o=e[3],s=e[5],l=r*o-a*i;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*s-o*n)*l,t[5]=(a*n-r*s)*l,t):null}var yt=function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,i=this.y-e.y;return Math.sqrt(r*r+i*i)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,i=this.y-e.y;return r*r+i*i},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,i=this.y;return this.x=e[0]*r+e[2]*i+e[4],this.y=e[1]*r+e[3]*i+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,i){e.x=r,e.y=i},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,i){e.x=r.x+i.x,e.y=r.y+i.y},t.sub=function(e,r,i){e.x=r.x-i.x,e.y=r.y-i.y},t.scale=function(e,r,i){e.x=r.x*i,e.y=r.y*i},t.scaleAndAdd=function(e,r,i,n){e.x=r.x+i.x*n,e.y=r.y+i.y*n},t.lerp=function(e,r,i,n){var a=1-n;e.x=a*r.x+n*i.x,e.y=a*r.y+n*i.y},t}(),tl=Math.min,el=Math.max,Qi=new yt,Ji=new yt,tn=new yt,en=new yt,vo=new yt,po=new yt,Pt=function(){function t(e,r,i,n){i<0&&(e=e+i,i=-i),n<0&&(r=r+n,n=-n),this.x=e,this.y=r,this.width=i,this.height=n}return t.prototype.union=function(e){var r=tl(e.x,this.x),i=tl(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=el(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=el(e.y+e.height,this.y+this.height)-i:this.height=e.height,this.x=r,this.y=i},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){var r=this,i=e.width/r.width,n=e.height/r.height,a=Va();return fv(a,a,[-r.x,-r.y]),Cb(a,a,[i,n]),fv(a,a,[e.x,e.y]),a},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,f=e.y,h=e.y+e.height,v=!(a<l||u<n||s<f||h<o);if(r){var c=1/0,d=0,p=Math.abs(a-l),g=Math.abs(u-n),m=Math.abs(s-f),_=Math.abs(h-o),y=Math.min(p,g),x=Math.min(m,_);a<l||u<n?y>d&&(d=y,p<g?yt.set(po,-p,0):yt.set(po,g,0)):y<c&&(c=y,p<g?yt.set(vo,p,0):yt.set(vo,-g,0)),s<f||h<o?x>d&&(d=x,m<_?yt.set(po,0,-m):yt.set(po,0,_)):y<c&&(c=y,m<_?yt.set(vo,0,m):yt.set(vo,0,-_))}return r&&yt.copy(r,v?vo:po),v},t.prototype.contain=function(e,r){var i=this;return e>=i.x&&e<=i.x+i.width&&r>=i.y&&r<=i.y+i.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(e,r){e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height},t.applyTransform=function(e,r,i){if(!i){e!==r&&t.copy(e,r);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];e.x=r.x*n+o,e.y=r.y*a+s,e.width=r.width*n,e.height=r.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Qi.x=tn.x=r.x,Qi.y=en.y=r.y,Ji.x=en.x=r.x+r.width,Ji.y=tn.y=r.y+r.height,Qi.transform(i),en.transform(i),Ji.transform(i),tn.transform(i),e.x=tl(Qi.x,Ji.x,tn.x,en.x),e.y=tl(Qi.y,Ji.y,tn.y,en.y);var l=el(Qi.x,Ji.x,tn.x,en.x),u=el(Qi.y,Ji.y,tn.y,en.y);e.width=l-e.x,e.height=u-e.y},t}(),P1="silent";function Db(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:Lb}}function Lb(){gi(this.event)}var Rb=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.handler=null,r}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(zr),go=function(){function t(e,r){this.x=e,this.y=r}return t}(),Pb=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],nh=new Pt(0,0,0,0),I1=function(t){K(e,t);function e(r,i,n,a,o){var s=t.call(this)||this;return s._hovered=new go(0,0),s.storage=r,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new Rb,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new vb(s),s}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(C(Pb,function(i){r.on&&r.on(i,this[i],this)},this),r.handler=this),this.proxy=r},e.prototype.mousemove=function(r){var i=r.zrX,n=r.zrY,a=N1(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new go(i,n):this.findHover(i,n),u=l.target,f=this.proxy;f.setCursor&&f.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(l,"mousemove",r),u&&u!==s&&this.dispatchToElement(l,"mouseover",r)},e.prototype.mouseout=function(r){var i=r.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},e.prototype.resize=function(){this._hovered=new go(0,0)},e.prototype.dispatch=function(r,i){var n=this[r];n&&n.call(this,i)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(r){var i=this.proxy;i.setCursor&&i.setCursor(r)},e.prototype.dispatchToElement=function(r,i,n){r=r||{};var a=r.target;if(!(a&&a.silent)){for(var o="on"+i,s=Db(i,r,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},e.prototype.findHover=function(r,i,n){var a=this.storage.getDisplayList(),o=new go(r,i);if(vg(a,o,r,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,f=new Pt(r-u,i-u,l,l),h=a.length-1;h>=0;h--){var v=a[h];v!==n&&!v.ignore&&!v.ignoreCoarsePointer&&(!v.parent||!v.parent.ignoreCoarsePointer)&&(nh.copy(v.getBoundingRect()),v.transform&&nh.applyTransform(v.transform),nh.intersect(f)&&s.push(v))}if(s.length)for(var c=4,d=Math.PI/12,p=Math.PI*2,g=0;g<u;g+=c)for(var m=0;m<p;m+=d){var _=r+g*Math.cos(m),y=i+g*Math.sin(m);if(vg(s,o,_,y,n),o.target)return o}}return o},e.prototype.processGesture=function(r,i){this._gestureMgr||(this._gestureMgr=new Ab);var n=this._gestureMgr;i==="start"&&n.clear();var a=n.recognize(r,this.findHover(r.zrX,r.zrY,null).target,this.proxy.dom);if(i==="end"&&n.clear(),a){var o=a.type;r.gestureEvent=o;var s=new go;s.target=a.target,this.dispatchToElement(s,o,a.event)}},e}(zr);C(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){I1.prototype[t]=function(e){var r=e.zrX,i=e.zrY,n=N1(this,r,i),a,o;if((t!=="mouseup"||!n)&&(a=this.findHover(r,i),o=a.target),t==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(t==="mouseup")this._upEl=o;else if(t==="click"){if(this._downEl!==this._upEl||!this._downPoint||ov(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,t,e)}});function Ib(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var i=t,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(e,r))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s||i.parent}return n?P1:!0}return!1}function vg(t,e,r,i,n){for(var a=t.length-1;a>=0;a--){var o=t[a],s=void 0;if(o!==n&&!o.ignore&&(s=Ib(o,r,i))&&(!e.topTarget&&(e.topTarget=o),s!==P1)){e.target=o;break}}}function N1(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}var O1=32,mo=7;function Nb(t){for(var e=0;t>=O1;)e|=t&1,t>>=1;return t+e}function dg(t,e,r,i){var n=e+1;if(n===r)return 1;if(i(t[n++],t[e])<0){for(;n<r&&i(t[n],t[n-1])<0;)n++;Ob(t,e,n)}else for(;n<r&&i(t[n],t[n-1])>=0;)n++;return n-e}function Ob(t,e,r){for(r--;e<r;){var i=t[e];t[e++]=t[r],t[r--]=i}}function pg(t,e,r,i,n){for(i===e&&i++;i<r;i++){for(var a=t[i],o=e,s=i,l;o<s;)l=o+s>>>1,n(a,t[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;u>0;)t[o+u]=t[o+u-1],u--}t[o]=a}}function ah(t,e,r,i,n,a){var o=0,s=0,l=1;if(a(t,e[r+n])>0){for(s=i-n;l<s&&a(t,e[r+n+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;l<s&&a(t,e[r+n-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o<l;){var f=o+(l-o>>>1);a(t,e[r+f])>0?o=f+1:l=f}return l}function oh(t,e,r,i,n,a){var o=0,s=0,l=1;if(a(t,e[r+n])<0){for(s=n+1;l<s&&a(t,e[r+n-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l<s&&a(t,e[r+n+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o<l;){var f=o+(l-o>>>1);a(t,e[r+f])<0?l=f:o=f+1}return l}function Bb(t,e){var r=mo,i,n,a=0,o=[];i=[],n=[];function s(c,d){i[a]=c,n[a]=d,a+=1}function l(){for(;a>1;){var c=a-2;if(c>=1&&n[c-1]<=n[c]+n[c+1]||c>=2&&n[c-2]<=n[c]+n[c-1])n[c-1]<n[c+1]&&c--;else if(n[c]>n[c+1])break;f(c)}}function u(){for(;a>1;){var c=a-2;c>0&&n[c-1]<n[c+1]&&c--,f(c)}}function f(c){var d=i[c],p=n[c],g=i[c+1],m=n[c+1];n[c]=p+m,c===a-3&&(i[c+1]=i[c+2],n[c+1]=n[c+2]),a--;var _=oh(t[g],t,d,p,0,e);d+=_,p-=_,p!==0&&(m=ah(t[d+p-1],t,g,m,m-1,e),m!==0&&(p<=m?h(d,p,g,m):v(d,p,g,m)))}function h(c,d,p,g){var m=0;for(m=0;m<d;m++)o[m]=t[c+m];var _=0,y=p,x=c;if(t[x++]=t[y++],--g===0){for(m=0;m<d;m++)t[x+m]=o[_+m];return}if(d===1){for(m=0;m<g;m++)t[x+m]=t[y+m];t[x+g]=o[_];return}for(var S=r,T,w,b;;){T=0,w=0,b=!1;do if(e(t[y],o[_])<0){if(t[x++]=t[y++],w++,T=0,--g===0){b=!0;break}}else if(t[x++]=o[_++],T++,w=0,--d===1){b=!0;break}while((T|w)<S);if(b)break;do{if(T=oh(t[y],o,_,d,0,e),T!==0){for(m=0;m<T;m++)t[x+m]=o[_+m];if(x+=T,_+=T,d-=T,d<=1){b=!0;break}}if(t[x++]=t[y++],--g===0){b=!0;break}if(w=ah(o[_],t,y,g,0,e),w!==0){for(m=0;m<w;m++)t[x+m]=t[y+m];if(x+=w,y+=w,g-=w,g===0){b=!0;break}}if(t[x++]=o[_++],--d===1){b=!0;break}S--}while(T>=mo||w>=mo);if(b)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),d===1){for(m=0;m<g;m++)t[x+m]=t[y+m];t[x+g]=o[_]}else{if(d===0)throw new Error;for(m=0;m<d;m++)t[x+m]=o[_+m]}}function v(c,d,p,g){var m=0;for(m=0;m<g;m++)o[m]=t[p+m];var _=c+d-1,y=g-1,x=p+g-1,S=0,T=0;if(t[x--]=t[_--],--d===0){for(S=x-(g-1),m=0;m<g;m++)t[S+m]=o[m];return}if(g===1){for(x-=d,_-=d,T=x+1,S=_+1,m=d-1;m>=0;m--)t[T+m]=t[S+m];t[x]=o[y];return}for(var w=r;;){var b=0,A=0,M=!1;do if(e(o[y],t[_])<0){if(t[x--]=t[_--],b++,A=0,--d===0){M=!0;break}}else if(t[x--]=o[y--],A++,b=0,--g===1){M=!0;break}while((b|A)<w);if(M)break;do{if(b=d-oh(o[y],t,c,d,d-1,e),b!==0){for(x-=b,_-=b,d-=b,T=x+1,S=_+1,m=b-1;m>=0;m--)t[T+m]=t[S+m];if(d===0){M=!0;break}}if(t[x--]=o[y--],--g===1){M=!0;break}if(A=g-ah(t[_],o,0,g,g-1,e),A!==0){for(x-=A,y-=A,g-=A,T=x+1,S=y+1,m=0;m<A;m++)t[T+m]=o[S+m];if(g<=1){M=!0;break}}if(t[x--]=t[_--],--d===0){M=!0;break}w--}while(b>=mo||A>=mo);if(M)break;w<0&&(w=0),w+=2}if(r=w,r<1&&(r=1),g===1){for(x-=d,_-=d,T=x+1,S=_+1,m=d-1;m>=0;m--)t[T+m]=t[S+m];t[x]=o[y]}else{if(g===0)throw new Error;for(S=x-(g-1),m=0;m<g;m++)t[S+m]=o[m]}}return{mergeRuns:l,forceMergeRuns:u,pushRun:s}}function eu(t,e,r,i){r||(r=0),i||(i=t.length);var n=i-r;if(!(n<2)){var a=0;if(n<O1){a=dg(t,r,i,e),pg(t,r,i,r+a,e);return}var o=Bb(t,e),s=Nb(n);do{if(a=dg(t,r,i,e),a<s){var l=n;l>s&&(l=s),pg(t,r,r+l,r+a,e),a=l}o.pushRun(r,a),o.mergeRuns(),n-=a,r+=a}while(n!==0);o.forceMergeRuns()}}var er=1,Yo=2,Ca=4,gg=!1;function sh(){gg||(gg=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function mg(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var Fb=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=mg}return t.prototype.traverse=function(e,r){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,r)},t.prototype.getDisplayList=function(e,r){r=r||!1;var i=this._displayList;return(e||!i.length)&&this.updateDisplayList(r),i},t.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var r=this._roots,i=this._displayList,n=0,a=r.length;n<a;n++)this._updateAndAddDisplayable(r[n],null,e);i.length=this._displayListLen,eu(i,mg)},t.prototype._updateAndAddDisplayable=function(e,r,i){if(!(e.ignore&&!i)){e.beforeUpdate(),e.update(),e.afterUpdate();var n=e.getClipPath();if(e.ignoreClip)r=null;else if(n){r?r=r.slice():r=[];for(var a=n,o=e;a;)a.parent=o,a.updateTransform(),r.push(a),o=a,a=a.getClipPath()}if(e.childrenRef){for(var s=e.childrenRef(),l=0;l<s.length;l++){var u=s[l];e.__dirty&&(u.__dirty|=er),this._updateAndAddDisplayable(u,r,i)}e.__dirty=0}else{var f=e;r&&r.length?f.__clipPaths=r:f.__clipPaths&&f.__clipPaths.length>0&&(f.__clipPaths=[]),isNaN(f.z)&&(sh(),f.z=0),isNaN(f.z2)&&(sh(),f.z2=0),isNaN(f.zlevel)&&(sh(),f.zlevel=0),this._displayList[this._displayListLen++]=f}var h=e.getDecalElement&&e.getDecalElement();h&&this._updateAndAddDisplayable(h,r,i);var v=e.getTextGuideLine();v&&this._updateAndAddDisplayable(v,r,i);var c=e.getTextContent();c&&this._updateAndAddDisplayable(c,r,i)}},t.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},t.prototype.delRoot=function(e){if(e instanceof Array){for(var r=0,i=e.length;r<i;r++)this.delRoot(e[r]);return}var n=bt(this._roots,e);n>=0&&this._roots.splice(n,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),ms;ms=vt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var is={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)))},elasticOut:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},elasticInOut:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-is.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?is.bounceIn(t*2)*.5:is.bounceOut(t*2-1)*.5+.5}},rl=Math.pow,Gi=Math.sqrt,Tu=1e-8,B1=1e-4,_g=Gi(3),il=1/3,Kr=so(),hr=so(),Wa=so();function Fi(t){return t>-Tu&&t<Tu}function F1(t){return t>Tu||t<-Tu}function ce(t,e,r,i,n){var a=1-n;return a*a*(a*t+3*n*e)+n*n*(n*i+3*a*r)}function yg(t,e,r,i,n){var a=1-n;return 3*(((e-t)*a+2*(r-e)*n)*a+(i-r)*n*n)}function Su(t,e,r,i,n,a){var o=i+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),u=t-n,f=s*s-3*o*l,h=s*l-9*o*u,v=l*l-3*s*u,c=0;if(Fi(f)&&Fi(h))if(Fi(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[c++]=d)}else{var p=h*h-4*f*v;if(Fi(p)){var g=h/f,d=-s/o+g,m=-g/2;d>=0&&d<=1&&(a[c++]=d),m>=0&&m<=1&&(a[c++]=m)}else if(p>0){var _=Gi(p),y=f*s+1.5*o*(-h+_),x=f*s+1.5*o*(-h-_);y<0?y=-rl(-y,il):y=rl(y,il),x<0?x=-rl(-x,il):x=rl(x,il);var d=(-s-(y+x))/(3*o);d>=0&&d<=1&&(a[c++]=d)}else{var S=(2*f*s-3*o*h)/(2*Gi(f*f*f)),T=Math.acos(S)/3,w=Gi(f),b=Math.cos(T),d=(-s-2*w*b)/(3*o),m=(-s+w*(b+_g*Math.sin(T)))/(3*o),A=(-s+w*(b-_g*Math.sin(T)))/(3*o);d>=0&&d<=1&&(a[c++]=d),m>=0&&m<=1&&(a[c++]=m),A>=0&&A<=1&&(a[c++]=A)}}return c}function k1(t,e,r,i,n){var a=6*r-12*e+6*t,o=9*e+3*i-3*t-9*r,s=3*e-3*t,l=0;if(Fi(o)){if(F1(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var f=a*a-4*o*s;if(Fi(f))n[0]=-a/(2*o);else if(f>0){var h=Gi(f),u=(-a+h)/(2*o),v=(-a-h)/(2*o);u>=0&&u<=1&&(n[l++]=u),v>=0&&v<=1&&(n[l++]=v)}}return l}function wu(t,e,r,i,n,a){var o=(e-t)*n+t,s=(r-e)*n+e,l=(i-r)*n+r,u=(s-o)*n+o,f=(l-s)*n+s,h=(f-u)*n+u;a[0]=t,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=f,a[6]=l,a[7]=i}function z1(t,e,r,i,n,a,o,s,l,u,f){var h,v=.005,c=1/0,d,p,g,m;Kr[0]=l,Kr[1]=u;for(var _=0;_<1;_+=.05)hr[0]=ce(t,r,n,o,_),hr[1]=ce(e,i,a,s,_),g=Ha(Kr,hr),g<c&&(h=_,c=g);c=1/0;for(var y=0;y<32&&!(v<B1);y++)d=h-v,p=h+v,hr[0]=ce(t,r,n,o,d),hr[1]=ce(e,i,a,s,d),g=Ha(hr,Kr),d>=0&&g<c?(h=d,c=g):(Wa[0]=ce(t,r,n,o,p),Wa[1]=ce(e,i,a,s,p),m=Ha(Wa,Kr),p<=1&&m<c?(h=p,c=m):v*=.5);return f&&(f[0]=ce(t,r,n,o,h),f[1]=ce(e,i,a,s,h)),Gi(c)}function kb(t,e,r,i,n,a,o,s,l){for(var u=t,f=e,h=0,v=1/l,c=1;c<=l;c++){var d=c*v,p=ce(t,r,n,o,d),g=ce(e,i,a,s,d),m=p-u,_=g-f;h+=Math.sqrt(m*m+_*_),u=p,f=g}return h}function Ae(t,e,r,i){var n=1-i;return n*(n*t+2*i*e)+i*i*r}function xg(t,e,r,i){return 2*((1-i)*(e-t)+i*(r-e))}function zb(t,e,r,i,n){var a=t-2*e+r,o=2*(e-t),s=t-i,l=0;if(Fi(a)){if(F1(o)){var u=-s/o;u>=0&&u<=1&&(n[l++]=u)}}else{var f=o*o-4*a*s;if(Fi(f)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(f>0){var h=Gi(f),u=(-o+h)/(2*a),v=(-o-h)/(2*a);u>=0&&u<=1&&(n[l++]=u),v>=0&&v<=1&&(n[l++]=v)}}return l}function U1(t,e,r){var i=t+r-2*e;return i===0?.5:(t-e)/i}function bu(t,e,r,i,n){var a=(e-t)*i+t,o=(r-e)*i+e,s=(o-a)*i+a;n[0]=t,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=r}function H1(t,e,r,i,n,a,o,s,l){var u,f=.005,h=1/0;Kr[0]=o,Kr[1]=s;for(var v=0;v<1;v+=.05){hr[0]=Ae(t,r,n,v),hr[1]=Ae(e,i,a,v);var c=Ha(Kr,hr);c<h&&(u=v,h=c)}h=1/0;for(var d=0;d<32&&!(f<B1);d++){var p=u-f,g=u+f;hr[0]=Ae(t,r,n,p),hr[1]=Ae(e,i,a,p);var c=Ha(hr,Kr);if(p>=0&&c<h)u=p,h=c;else{Wa[0]=Ae(t,r,n,g),Wa[1]=Ae(e,i,a,g);var m=Ha(Wa,Kr);g<=1&&m<h?(u=g,h=m):f*=.5}}return l&&(l[0]=Ae(t,r,n,u),l[1]=Ae(e,i,a,u)),Gi(h)}function Ub(t,e,r,i,n,a,o){for(var s=t,l=e,u=0,f=1/o,h=1;h<=o;h++){var v=h*f,c=Ae(t,r,n,v),d=Ae(e,i,a,v),p=c-s,g=d-l;u+=Math.sqrt(p*p+g*g),s=c,l=d}return u}var Hb=/cubic-bezier\(([0-9,\.e ]+)\)/;function Bd(t){var e=t&&Hb.exec(t);if(e){var r=e[1].split(","),i=+jr(r[0]),n=+jr(r[1]),a=+jr(r[2]),o=+jr(r[3]);if(isNaN(i+n+a+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:Su(0,i,a,1,l,s)&&ce(0,n,o,1,s[0])}}}var Vb=function(){function t(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Te,this.ondestroy=e.ondestroy||Te,this.onrestart=e.onrestart||Te,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var i=this._life,n=e-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ct(e)?e:is[e]||Bd(e)},t}(),V1=function(){function t(e){this.value=e}return t}(),Gb=function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new V1(e);return this.insertEntry(r),r},t.prototype.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++},t.prototype.remove=function(e){var r=e.prev,i=e.next;r?r.next=i:this.head=i,i?i.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),lo=function(){function t(e){this._list=new Gb,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var i=this._list,n=this._map,a=null;if(n[e]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new V1(r),s.key=e,i.insertEntry(s),n[e]=s}return a},t.prototype.get=function(e){var r=this._map[e],i=this._list;if(r!=null)return r!==i.tail&&(i.remove(r),i.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),Tg={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 Ir(t){return t=Math.round(t),t<0?0:t>255?255:t}function Wb(t){return t=Math.round(t),t<0?0:t>360?360:t}function _s(t){return t<0?0:t>1?1:t}function lh(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Ir(parseFloat(e)/100*255):Ir(parseInt(e,10))}function Vn(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?_s(parseFloat(e)/100):_s(parseFloat(e))}function uh(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(2/3-r)*6:t}function ki(t,e,r){return t+(e-t)*r}function or(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function hv(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var G1=new lo(20),nl=null;function na(t,e){nl&&hv(nl,e),nl=G1.put(t,nl||e.slice())}function Be(t,e){if(t){e=e||[];var r=G1.get(t);if(r)return hv(e,r);t=t+"";var i=t.replace(/ /g,"").toLowerCase();if(i in Tg)return hv(e,Tg[i]),na(t,e),e;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){or(e,0,0,0,1);return}return or(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),na(t,e),e}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){or(e,0,0,0,1);return}return or(e,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),na(t,e),e}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),f=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?or(e,+u[0],+u[1],+u[2],1):or(e,0,0,0,1);f=Vn(u.pop());case"rgb":if(u.length>=3)return or(e,lh(u[0]),lh(u[1]),lh(u[2]),u.length===3?f:Vn(u[3])),na(t,e),e;or(e,0,0,0,1);return;case"hsla":if(u.length!==4){or(e,0,0,0,1);return}return u[3]=Vn(u[3]),cv(u,e),na(t,e),e;case"hsl":if(u.length!==3){or(e,0,0,0,1);return}return cv(u,e),na(t,e),e;default:return}}or(e,0,0,0,1)}}function cv(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=Vn(t[1]),n=Vn(t[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],or(e,Ir(uh(o,a,r+1/3)*255),Ir(uh(o,a,r)*255),Ir(uh(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function Xb(t){if(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),a=Math.max(e,r,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var f=((a-e)/6+o/2)/o,h=((a-r)/6+o/2)/o,v=((a-i)/6+o/2)/o;e===a?l=v-h:r===a?l=1/3+f-v:i===a&&(l=2/3+h-f),l<0&&(l+=1),l>1&&(l-=1)}var c=[l*360,u,s];return t[3]!=null&&c.push(t[3]),c}}function Sg(t,e){var r=Be(t);if(r){for(var i=0;i<3;i++)r[i]=r[i]*(1-e)|0,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return pi(r,r.length===4?"rgba":"rgb")}}function fh(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){r=r||[];var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=e[n],s=e[a],l=i-n;return r[0]=Ir(ki(o[0],s[0],l)),r[1]=Ir(ki(o[1],s[1],l)),r[2]=Ir(ki(o[2],s[2],l)),r[3]=_s(ki(o[3],s[3],l)),r}}function Yb(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=Be(e[n]),s=Be(e[a]),l=i-n,u=pi([Ir(ki(o[0],s[0],l)),Ir(ki(o[1],s[1],l)),Ir(ki(o[2],s[2],l)),_s(ki(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function hh(t,e,r,i){var n=Be(t);if(t)return n=Xb(n),e!=null&&(n[0]=Wb(e)),r!=null&&(n[1]=Vn(r)),i!=null&&(n[2]=Vn(i)),pi(cv(n),"rgba")}function Zb(t,e){var r=Be(t);if(r&&e!=null)return r[3]=_s(e),pi(r,"rgba")}function pi(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function Au(t,e){var r=Be(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var wg=new lo(100);function vv(t){if(Q(t)){var e=wg.get(t);return e||(e=Sg(t,-.1),wg.put(t,e)),e}else if(ff(t)){var r=Y({},t);return r.colorStops=tt(t.colorStops,function(i){return{offset:i.offset,color:Sg(i.color,-.1)}}),r}return t}var Eu=Math.round;function ys(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=Be(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e??1}}var bg=1e-4;function zi(t){return t<bg&&t>-bg}function al(t){return Eu(t*1e3)/1e3}function dv(t){return Eu(t*1e4)/1e4}function qb(t){return"matrix("+al(t[0])+","+al(t[1])+","+al(t[2])+","+al(t[3])+","+dv(t[4])+","+dv(t[5])+")"}var $b={left:"start",right:"end",center:"middle",middle:"middle"};function Kb(t,e,r){return r==="top"?t+=e/2:r==="bottom"&&(t-=e/2),t}function jb(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function Qb(t){var e=t.style,r=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function W1(t){return t&&!!t.image}function Jb(t){return t&&!!t.svgElement}function Fd(t){return W1(t)||Jb(t)}function X1(t){return t.type==="linear"}function Y1(t){return t.type==="radial"}function Z1(t){return t&&(t.type==="linear"||t.type==="radial")}function vf(t){return"url(#"+t+")"}function q1(t){var e=t.getGlobalScale(),r=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function $1(t){var e=t.x||0,r=t.y||0,i=(t.rotation||0)*tu,n=ft(t.scaleX,1),a=ft(t.scaleY,1),o=t.skewX||0,s=t.skewY||0,l=[];return(e||r)&&l.push("translate("+e+"px,"+r+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+Eu(o*tu)+"deg, "+Eu(s*tu)+"deg)"),l.join(" ")}var tA=function(){return vt.hasGlobalWindow&&ct(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:typeof Buffer<"u"?function(t){return Buffer.from(t).toString("base64")}:function(t){return null}}(),pv=Array.prototype.slice;function fi(t,e,r){return(e-t)*r+t}function ch(t,e,r,i){for(var n=e.length,a=0;a<n;a++)t[a]=fi(e[a],r[a],i);return t}function eA(t,e,r,i){for(var n=e.length,a=n&&e[0].length,o=0;o<n;o++){t[o]||(t[o]=[]);for(var s=0;s<a;s++)t[o][s]=fi(e[o][s],r[o][s],i)}return t}function ol(t,e,r,i){for(var n=e.length,a=0;a<n;a++)t[a]=e[a]+r[a]*i;return t}function Ag(t,e,r,i){for(var n=e.length,a=n&&e[0].length,o=0;o<n;o++){t[o]||(t[o]=[]);for(var s=0;s<a;s++)t[o][s]=e[o][s]+r[o][s]*i}return t}function rA(t,e){for(var r=t.length,i=e.length,n=r>i?e:t,a=Math.min(r,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;s<Math.max(r,i);s++)n.push({offset:o.offset,color:o.color.slice()})}function iA(t,e,r){var i=t,n=e;if(!(!i.push||!n.push)){var a=i.length,o=n.length;if(a!==o){var s=a>o;if(s)i.length=o;else for(var l=a;l<o;l++)i.push(r===1?n[l]:pv.call(n[l]))}for(var u=i[0]&&i[0].length,l=0;l<i.length;l++)if(r===1)isNaN(i[l])&&(i[l]=n[l]);else for(var f=0;f<u;f++)isNaN(i[l][f])&&(i[l][f]=n[l][f])}}function ns(t){if(ke(t)){var e=t.length;if(ke(t[0])){for(var r=[],i=0;i<e;i++)r.push(pv.call(t[i]));return r}return pv.call(t)}return t}function ru(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=t[3]==null?1:t[3],"rgba("+t.join(",")+")"}function nA(t){return ke(t&&t[0])?2:1}var sl=0,iu=1,K1=2,Zo=3,gv=4,mv=5,Eg=6;function Mg(t){return t===gv||t===mv}function ll(t){return t===iu||t===K1}var _o=[0,0,0,0],aA=function(){function t(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=Eg,l=r;if(ke(r)){var u=nA(r);s=u,(u===1&&!$t(r[0])||u===2&&!$t(r[0][0]))&&(o=!0)}else if($t(r)&&!yu(r))s=sl;else if(Q(r))if(!isNaN(+r))s=sl;else{var f=Be(r);f&&(l=f,s=Zo)}else if(ff(r)){var h=Y({},l);h.colorStops=tt(r.colorStops,function(c){return{offset:c.offset,color:Be(c.color)}}),X1(r)?s=gv:Y1(r)&&(s=mv),l=h}a===0?this.valType=s:(s!==this.valType||s===Eg)&&(o=!0),this.discrete=this.discrete||o;var v={time:e,value:l,rawValue:r,percent:0};return i&&(v.easing=i,v.easingFunc=ct(i)?i:is[i]||Bd(i)),n.push(v),v},t.prototype.prepare=function(e,r){var i=this.keyframes;this._needsSort&&i.sort(function(p,g){return p.time-g.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=ll(n),u=Mg(n),f=0;f<a;f++){var h=i[f],v=h.value,c=o.value;h.percent=h.time/e,s||(l&&f!==a-1?iA(v,c,n):u&&rA(v.colorStops,c.colorStops))}if(!s&&n!==mv&&r&&this.needsAnimate()&&r.needsAnimate()&&n===r.valType&&!r._finished){this._additiveTrack=r;for(var d=i[0].value,f=0;f<a;f++)n===sl?i[f].additiveValue=i[f].value-d:n===Zo?i[f].additiveValue=ol([],i[f].value,d,-1):ll(n)&&(i[f].additiveValue=n===iu?ol([],i[f].value,d,-1):Ag([],i[f].value,d,-1))}},t.prototype.step=function(e,r){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var i=this._additiveTrack!=null,n=i?"additiveValue":"value",a=this.valType,o=this.keyframes,s=o.length,l=this.propName,u=a===Zo,f,h=this._lastFr,v=Math.min,c,d;if(s===1)c=d=o[0];else{if(r<0)f=0;else if(r<this._lastFrP){var p=v(h+1,s-1);for(f=p;f>=0&&!(o[f].percent<=r);f--);f=v(f,s-2)}else{for(f=h;f<s&&!(o[f].percent>r);f++);f=v(f-1,s-2)}d=o[f+1],c=o[f]}if(c&&d){this._lastFr=f,this._lastFrP=r;var g=d.percent-c.percent,m=g===0?1:v((r-c.percent)/g,1);d.easingFunc&&(m=d.easingFunc(m));var _=i?this._additiveValue:u?_o:e[l];if((ll(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)e[l]=m<1?c.rawValue:d.rawValue;else if(ll(a))a===iu?ch(_,c[n],d[n],m):eA(_,c[n],d[n],m);else if(Mg(a)){var y=c[n],x=d[n],S=a===gv;e[l]={type:S?"linear":"radial",x:fi(y.x,x.x,m),y:fi(y.y,x.y,m),colorStops:tt(y.colorStops,function(w,b){var A=x.colorStops[b];return{offset:fi(w.offset,A.offset,m),color:ru(ch([],w.color,A.color,m))}}),global:x.global},S?(e[l].x2=fi(y.x2,x.x2,m),e[l].y2=fi(y.y2,x.y2,m)):e[l].r=fi(y.r,x.r,m)}else if(u)ch(_,c[n],d[n],m),i||(e[l]=ru(_));else{var T=fi(c[n],d[n],m);i?this._additiveValue=T:e[l]=T}i&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,i=this.propName,n=this._additiveValue;r===sl?e[i]=e[i]+n:r===Zo?(Be(e[i],_o),ol(_o,_o,n,1),e[i]=ru(_o)):r===iu?ol(e[i],e[i],n,1):r===K1&&Ag(e[i],e[i],n,1)},t}(),oA=function(){function t(e,r,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&n){Ld("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,i){return this.whenWithKeys(e,r,mt(r),i)},t.prototype.whenWithKeys=function(e,r,i,n){for(var a=this._tracks,o=0;o<i.length;o++){var s=i[o],l=a[s];if(!l){l=a[s]=new aA(s);var u=void 0,f=this._getAdditiveTrack(s);if(f){var h=f.keyframes,v=h[h.length-1];u=v&&v.value,f.valType===Zo&&u&&(u=ru(u))}else u=this._target[s];if(u==null)continue;e>0&&l.addKeyframe(0,ns(u),n),this._trackKeys.push(s)}l.addKeyframe(e,ns(r[s]),n)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,i=0;i<r;i++)e[i].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,r=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,r)for(var i=0;i<r.length;i++)r[i].call(this)},t.prototype._setTracksFinished=function(){for(var e=this._tracks,r=this._trackKeys,i=0;i<r.length;i++)e[r[i]].setFinished()},t.prototype._getAdditiveTrack=function(e){var r,i=this._additiveAnimators;if(i)for(var n=0;n<i.length;n++){var a=i[n].getTrack(e);a&&(r=a)}return r},t.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var r=this,i=[],n=this._maxTime||0,a=0;a<this._trackKeys.length;a++){var o=this._trackKeys[a],s=this._tracks[o],l=this._getAdditiveTrack(o),u=s.keyframes,f=u.length;if(s.prepare(n,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var h=u[f-1];h&&(r._target[s.propName]=h.rawValue),s.setFinished()}else i.push(s)}if(i.length||this._force){var v=new Vb({life:n,loop:this._loop,delay:this._delay||0,onframe:function(c){r._started=2;var d=r._additiveAnimators;if(d){for(var p=!1,g=0;g<d.length;g++)if(d[g]._clip){p=!0;break}p||(r._additiveAnimators=null)}for(var g=0;g<i.length;g++)i[g].step(r._target,c);var m=r._onframeCbs;if(m)for(var g=0;g<m.length;g++)m[g](r._target,c)},ondestroy:function(){r._doneCallback()}});this._clip=v,this.animation&&this.animation.addClip(v),e&&v.setEasing(e)}else this._doneCallback();return this}},t.prototype.stop=function(e){if(this._clip){var r=this._clip;e&&r.onframe(1),this._abortedCallback()}},t.prototype.delay=function(e){return this._delay=e,this},t.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},t.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},t.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(e){return this._tracks[e]},t.prototype.getTracks=function(){var e=this;return tt(this._trackKeys,function(r){return e._tracks[r]})},t.prototype.stopTracks=function(e,r){if(!e.length||!this._clip)return!0;for(var i=this._tracks,n=this._trackKeys,a=0;a<e.length;a++){var o=i[e[a]];o&&!o.isFinished()&&(r?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,a=0;a<n.length;a++)if(!i[n[a]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},t.prototype.saveTo=function(e,r,i){if(e){r=r||this._trackKeys;for(var n=0;n<r.length;n++){var a=r[n],o=this._tracks[a];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[i?0:s.length-1];l&&(e[a]=ns(l.rawValue))}}}},t.prototype.__changeFinalValue=function(e,r){r=r||mt(e);for(var i=0;i<r.length;i++){var n=r[i],a=this._tracks[n];if(a){var o=a.keyframes;if(o.length>1){var s=o.pop();a.addKeyframe(s.time,e[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},t}();const df=oA;function Na(){return new Date().getTime()}var sA=function(t){K(e,t);function e(r){var i=t.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,r=r||{},i.stage=r.stage||{},i}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var i=r.getClip();i&&this.addClip(i)},e.prototype.removeClip=function(r){if(r.animation){var i=r.prev,n=r.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var i=r.getClip();i&&this.removeClip(i),r.animation=null},e.prototype.update=function(r){for(var i=Na()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,r||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function i(){r._running&&(ms(i),!r._paused&&r.update())}ms(i)},e.prototype.start=function(){this._running||(this._time=Na(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Na(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Na()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var i=r.next;r.prev=r.next=r.animation=null,r=i}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,i){i=i||{},this.start();var n=new df(r,i.loop);return this.addAnimator(n),n},e}(zr),lA=300,vh=vt.domSupported,dh=function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=tt(t,function(n){var a=n.replace("mouse","pointer");return r.hasOwnProperty(a)?a:n});return{mouse:t,touch:e,pointer:i}}(),Cg={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Dg=!1;function _v(t){var e=t.pointerType;return e==="pen"||e==="touch"}function uA(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function ph(t){t&&(t.zrByTouch=!0)}function fA(t,e){return sr(t.dom,new hA(t,e),!0)}function j1(t,e){for(var r=e,i=!1;r&&r.nodeType!==9&&!(i=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return i}var hA=function(){function t(e,r){this.stopPropagation=Te,this.stopImmediatePropagation=Te,this.preventDefault=Te,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t}(),Lr={mousedown:function(t){t=sr(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=sr(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=sr(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=sr(this.dom,t);var e=t.toElement||t.relatedTarget;j1(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){Dg=!0,t=sr(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){Dg||(t=sr(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=sr(this.dom,t),ph(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Lr.mousemove.call(this,t),Lr.mousedown.call(this,t)},touchmove:function(t){t=sr(this.dom,t),ph(t),this.handler.processGesture(t,"change"),Lr.mousemove.call(this,t)},touchend:function(t){t=sr(this.dom,t),ph(t),this.handler.processGesture(t,"end"),Lr.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<lA&&Lr.click.call(this,t)},pointerdown:function(t){Lr.mousedown.call(this,t)},pointermove:function(t){_v(t)||Lr.mousemove.call(this,t)},pointerup:function(t){Lr.mouseup.call(this,t)},pointerout:function(t){_v(t)||Lr.mouseout.call(this,t)}};C(["click","dblclick","contextmenu"],function(t){Lr[t]=function(e){e=sr(this.dom,e),this.trigger(t,e)}});var yv={pointermove:function(t){_v(t)||yv.mousemove.call(this,t)},pointerup:function(t){yv.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function cA(t,e){var r=e.domHandlers;vt.pointerEventsSupported?C(dh.pointer,function(i){nu(e,i,function(n){r[i].call(t,n)})}):(vt.touchEventsSupported&&C(dh.touch,function(i){nu(e,i,function(n){r[i].call(t,n),uA(e)})}),C(dh.mouse,function(i){nu(e,i,function(n){n=Id(n),e.touching||r[i].call(t,n)})}))}function vA(t,e){vt.pointerEventsSupported?C(Cg.pointer,r):vt.touchEventsSupported||C(Cg.mouse,r);function r(i){function n(a){a=Id(a),j1(t,a.target)||(a=fA(t,a),e.domHandlers[i].call(t,a))}nu(e,i,n,{capture:!0})}}function nu(t,e,r,i){t.mounted[e]=r,t.listenerOpts[e]=i,wb(t.domTarget,e,r,i)}function gh(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&bb(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var Lg=function(){function t(e,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=r}return t}(),dA=function(t){K(e,t);function e(r,i){var n=t.call(this)||this;return n.__pointerCapturing=!1,n.dom=r,n.painterRoot=i,n._localHandlerScope=new Lg(r,Lr),vh&&(n._globalHandlerScope=new Lg(document,yv)),cA(n,n._localHandlerScope),n}return e.prototype.dispose=function(){gh(this._localHandlerScope),vh&&gh(this._globalHandlerScope)},e.prototype.setCursor=function(r){this.dom.style&&(this.dom.style.cursor=r||"default")},e.prototype.__togglePointerCapture=function(r){if(this.__mayPointerCapture=null,vh&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var i=this._globalHandlerScope;r?vA(this,i):gh(i)}},e}(zr),Q1=1;vt.hasGlobalWindow&&(Q1=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Mu=Q1,xv=.4,Tv="#333",Sv="#ccc",pA="#eee",Rg=Nd,Pg=5e-5;function rn(t){return t>Pg||t<-Pg}var nn=[],aa=[],mh=Va(),_h=Math.abs,pf=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return rn(this.rotation)||rn(this.x)||rn(this.y)||rn(this.scaleX-1)||rn(this.scaleY-1)||rn(this.skewX)||rn(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),i=this.transform;if(!(r||e)){i&&(Rg(i),this.invTransform=null);return}i=i||Va(),r?this.getLocalTransform(i):Rg(i),e&&(r?Ga(i,e,i):Mb(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(nn);var i=nn[0]<0?-1:1,n=nn[1]<0?-1:1,a=((nn[0]-i)*r+i)/nn[0]||0,o=((nn[1]-n)*r+n)/nn[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||Va(),cf(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=Math.atan2(e[1],e[0]),a=Math.PI/2+n-Math.atan2(e[3],e[2]);i=Math.sqrt(i)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=i,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Va(),Ga(aa,e.invTransform,r),r=aa);var i=this.originX,n=this.originY;(i||n)&&(mh[4]=i,mh[5]=n,Ga(aa,r,mh),aa[4]-=i,aa[5]-=n,r=aa),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var i=[e,r],n=this.invTransform;return n&&_r(i,i,n),i},t.prototype.transformCoordToGlobal=function(e,r){var i=[e,r],n=this.transform;return n&&_r(i,i,n),i},t.prototype.getLineScale=function(){var e=this.transform;return e&&_h(e[0]-1)>1e-10&&_h(e[3]-1)>1e-10?Math.sqrt(_h(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){J1(this,e)},t.getLocalTransform=function(e,r){r=r||[];var i=e.originX||0,n=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,f=e.x,h=e.y,v=e.skewX?Math.tan(e.skewX):0,c=e.skewY?Math.tan(-e.skewY):0;if(i||n||s||l){var d=i+s,p=n+l;r[4]=-d*a-v*p*o,r[5]=-p*o-c*d*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=c*a,r[2]=v*o,u&&Od(r,r,u),r[4]+=i+f,r[5]+=n+h,r},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),ii=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function J1(t,e){for(var r=0;r<ii.length;r++){var i=ii[r];t[i]=e[i]}}var Ig={};function rr(t,e){e=e||Zi;var r=Ig[e];r||(r=Ig[e]=new lo(500));var i=r.get(t);return i==null&&(i=oo.measureText(t,e).width,r.put(t,i)),i}function Ng(t,e,r,i){var n=rr(t,e),a=gf(e),o=qo(0,n,r),s=Da(0,a,i),l=new Pt(o,s,n,a);return l}function kd(t,e,r,i){var n=((t||"")+"").split(`
`),a=n.length;if(a===1)return Ng(n[0],e,r,i);for(var o=new Pt(0,0,0,0),s=0;s<n.length;s++){var l=Ng(n[s],e,r,i);s===0?o.copy(l):o.union(l)}return o}function qo(t,e,r){return r==="right"?t-=e:r==="center"&&(t-=e/2),t}function Da(t,e,r){return r==="middle"?t-=e/2:r==="bottom"&&(t-=e),t}function gf(t){return rr("国",t)}function mi(t,e){return typeof t=="string"?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function tx(t,e,r){var i=e.position||"inside",n=e.distance!=null?e.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,f="left",h="top";if(i instanceof Array)l+=mi(i[0],r.width),u+=mi(i[1],r.height),f=null,h=null;else switch(i){case"left":l-=n,u+=s,f="right",h="middle";break;case"right":l+=n+o,u+=s,h="middle";break;case"top":l+=o/2,u-=n,f="center",h="bottom";break;case"bottom":l+=o/2,u+=a+n,f="center";break;case"inside":l+=o/2,u+=s,f="center",h="middle";break;case"insideLeft":l+=n,u+=s,h="middle";break;case"insideRight":l+=o-n,u+=s,f="right",h="middle";break;case"insideTop":l+=o/2,u+=n,f="center";break;case"insideBottom":l+=o/2,u+=a-n,f="center",h="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,f="right";break;case"insideBottomLeft":l+=n,u+=a-n,h="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,f="right",h="bottom";break}return t=t||{},t.x=l,t.y=u,t.align=f,t.verticalAlign=h,t}var yh="__zr_normal__",xh=ii.concat(["ignore"]),gA=Qn(ii,function(t,e){return t[e]=!0,t},{ignore:!1}),oa={},mA=new Pt(0,0,0,0),mf=function(){function t(e){this.id=E1(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,i){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(r),i.position!=null){var f=mA;i.layoutRect?f.copy(i.layoutRect):f.copy(this.getBoundingRect()),n||f.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(oa,i,f):tx(oa,i,f),a.x=oa.x,a.y=oa.y,o=oa.align,s=oa.verticalAlign;var h=i.origin;if(h&&i.rotation!=null){var v=void 0,c=void 0;h==="center"?(v=f.width*.5,c=f.height*.5):(v=mi(h[0],f.width),c=mi(h[1],f.height)),u=!0,a.originX=-a.x+v+(n?0:f.x),a.originY=-a.y+c+(n?0:f.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],u||(a.originX=-d[0],a.originY=-d[1]));var p=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,_=void 0,y=void 0;p&&this.canBeInsideText()?(m=i.insideFill,_=i.insideStroke,(m==null||m==="auto")&&(m=this.getInsideTextFill()),(_==null||_==="auto")&&(_=this.getInsideTextStroke(m),y=!0)):(m=i.outsideFill,_=i.outsideStroke,(m==null||m==="auto")&&(m=this.getOutsideFill()),(_==null||_==="auto")&&(_=this.getOutsideStroke(m),y=!0)),m=m||"#000",(m!==g.fill||_!==g.stroke||y!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=m,g.stroke=_,g.autoStroke=y,g.align=o,g.verticalAlign=s,r.setDefaultTextStyle(g)),r.__dirty|=er,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Sv:Tv},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),i=typeof r=="string"&&Be(r);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,pi(i,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},Y(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(rt(e))for(var i=e,n=mt(i),a=0;a<n.length;a++){var o=n[a];this.attrKV(o,e[o])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var r=this._normalState,i=0;i<this.animators.length;i++){var n=this.animators[i],a=n.__fromStateTransition;if(!(n.getLoop()||a&&a!==yh)){var o=n.targetName,s=o?r[o]:r;n.saveTo(s)}}},t.prototype._innerSaveToNormal=function(e){var r=this._normalState;r||(r=this._normalState={}),e.textConfig&&!r.textConfig&&(r.textConfig=this.textConfig),this._savePrimaryToNormal(e,r,xh)},t.prototype._savePrimaryToNormal=function(e,r,i){for(var n=0;n<i.length;n++){var a=i[n];e[a]!=null&&!(a in r)&&(r[a]=this[a])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(yh,!1,e)},t.prototype.useState=function(e,r,i,n){var a=e===yh,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(bt(s,e)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){Ld("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var f=!!(u&&u.hoverLayer||n);f&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,r,!i&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,v=this._textGuide;return h&&h.useState(e,r,i,f),v&&v.useState(e,r,i,f),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~er),u}}},t.prototype.useStates=function(e,r,i){if(!e.length)this.clearStates();else{var n=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l<o;l++)if(e[l]!==a[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var u=e[l],f=void 0;this.stateProxy&&(f=this.stateProxy(u,e)),f||(f=this.states[u]),f&&n.push(f)}var h=n[o-1],v=!!(h&&h.hoverLayer||i);v&&this._toggleHoverLayerFlag(!0);var c=this._mergeStates(n),d=this.stateTransition;this.saveCurrentToNormalState(c),this._applyStateObj(e.join(","),c,this._normalState,!1,!r&&!this.__inHover&&d&&d.duration>0,d);var p=this._textContent,g=this._textGuide;p&&p.useStates(e,r,v),g&&g.useStates(e,r,v),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!v&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~er)}},t.prototype.isSilent=function(){for(var e=this.silent,r=this.parent;!e&&r;){if(r.silent){e=!0;break}r=r.parent}return e},t.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var r=this.animators[e];r.targetName&&r.changeTarget(this[r.targetName])}},t.prototype.removeState=function(e){var r=bt(this.currentStates,e);if(r>=0){var i=this.currentStates.slice();i.splice(r,1),this.useStates(i)}},t.prototype.replaceState=function(e,r,i){var n=this.currentStates.slice(),a=bt(n,e),o=bt(n,r)>=0;a>=0?o?n.splice(a,1):n[a]=r:i&&!o&&n.push(r),this.useStates(n)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},i,n=0;n<e.length;n++){var a=e[n];Y(r,a),a.textConfig&&(i=i||{},Y(i,a.textConfig))}return i&&(r.textConfig=i),r},t.prototype._applyStateObj=function(e,r,i,n,a,o){var s=!(r&&n);r&&r.textConfig?(this.textConfig=Y({},n?this.textConfig:i.textConfig),Y(this.textConfig,r.textConfig)):s&&i.textConfig&&(this.textConfig=i.textConfig);for(var l={},u=!1,f=0;f<xh.length;f++){var h=xh[f],v=a&&gA[h];r&&r[h]!=null?v?(u=!0,l[h]=r[h]):this[h]=r[h]:s&&i[h]!=null&&(v?(u=!0,l[h]=i[h]):this[h]=i[h])}if(!a)for(var f=0;f<this.animators.length;f++){var c=this.animators[f],d=c.targetName;c.getLoop()||c.__changeFinalValue(d?(r||i)[d]:r||i)}u&&this._transitionState(e,l,o)},t.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var r=this.__zr;r&&e.addSelfToZr(r),e.__zr=r,e.__hostTarget=this}},t.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},t.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(e){var r=this._textContent;r!==e&&(r&&r!==e&&this.removeTextContent(),e.innerTransformable=new pf,this._attachComponent(e),this._textContent=e,this.markRedraw())},t.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),Y(this.textConfig,e),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=er;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var r=this._textContent,i=this._textGuide;r&&(r.__inHover=e),i&&(i.__inHover=e)},t.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var r=this.animators;if(r)for(var i=0;i<r.length;i++)e.animation.addAnimator(r[i]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},t.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var r=this.animators;if(r)for(var i=0;i<r.length;i++)e.animation.removeAnimator(r[i]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},t.prototype.animate=function(e,r,i){var n=e?this[e]:this,a=new df(n,r,i);return e&&(a.targetName=e),this.addAnimator(a,e),a},t.prototype.addAnimator=function(e,r){var i=this.__zr,n=this;e.during(function(){n.updateDuringAnimation(r)}).done(function(){var a=n.animators,o=bt(a,e);o>=0&&a.splice(o,1)}),this.animators.push(e),i&&i.animation.addAnimator(e),i&&i.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var i=this.animators,n=i.length,a=[],o=0;o<n;o++){var s=i[o];!e||e===s.scope?s.stop(r):a.push(s)}return this.animators=a,this},t.prototype.animateTo=function(e,r,i){Th(this,e,r,i)},t.prototype.animateFrom=function(e,r,i){Th(this,e,r,i,!0)},t.prototype._transitionState=function(e,r,i,n){for(var a=Th(this,r,i,n),o=0;o<a.length;o++)a[o].__fromStateTransition=e},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=function(){var e=t.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=er;function r(i,n,a,o){Object.defineProperty(e,i,{get:function(){if(!this[n]){var l=this[n]=[];s(this,l)}return this[n]},set:function(l){this[a]=l[0],this[o]=l[1],this[n]=l,s(this,l)}});function s(l,u){Object.defineProperty(u,0,{get:function(){return l[a]},set:function(f){l[a]=f}}),Object.defineProperty(u,1,{get:function(){return l[o]},set:function(f){l[o]=f}})}}Object.defineProperty&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))}(),t}();kr(mf,zr);kr(mf,pf);function Th(t,e,r,i,n){r=r||{};var a=[];ex(t,"",t,e,r,i,a,n);var o=a.length,s=!1,l=r.done,u=r.aborted,f=function(){s=!0,o--,o<=0&&(s?l&&l():u&&u())},h=function(){o--,o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&r.during&&a[0].during(function(d,p){r.during(p)});for(var v=0;v<a.length;v++){var c=a[v];f&&c.done(f),h&&c.aborted(h),r.force&&c.duration(r.duration),c.start(r.easing)}return a}function Sh(t,e,r){for(var i=0;i<r;i++)t[i]=e[i]}function _A(t){return ke(t[0])}function yA(t,e,r){if(ke(e[r]))if(ke(t[r])||(t[r]=[]),Ke(e[r])){var i=e[r].length;t[r].length!==i&&(t[r]=new e[r].constructor(i),Sh(t[r],e[r],i))}else{var n=e[r],a=t[r],o=n.length;if(_A(n))for(var s=n[0].length,l=0;l<o;l++)a[l]?Sh(a[l],n[l],s):a[l]=Array.prototype.slice.call(n[l]);else Sh(a,n,o);a.length=n.length}else t[r]=e[r]}function xA(t,e){return t===e||ke(t)&&ke(e)&&TA(t,e)}function TA(t,e){var r=t.length;if(r!==e.length)return!1;for(var i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}function ex(t,e,r,i,n,a,o,s){for(var l=mt(i),u=n.duration,f=n.delay,h=n.additive,v=n.setToFinal,c=!rt(a),d=t.animators,p=[],g=0;g<l.length;g++){var m=l[g],_=i[m];if(_!=null&&r[m]!=null&&(c||a[m]))if(rt(_)&&!ke(_)&&!ff(_)){if(e){s||(r[m]=_,t.updateDuringAnimation(e));continue}ex(t,m,r[m],_,n,a&&a[m],o,s)}else p.push(m);else s||(r[m]=_,t.updateDuringAnimation(e),p.push(m))}var y=p.length;if(!h&&y)for(var x=0;x<d.length;x++){var S=d[x];if(S.targetName===e){var T=S.stopTracks(p);if(T){var w=bt(d,S);d.splice(w,1)}}}if(n.force||(p=oe(p,function(E){return!xA(i[E],r[E])}),y=p.length),y>0||n.force&&!o.length){var b=void 0,A=void 0,M=void 0;if(s){A={},v&&(b={});for(var x=0;x<y;x++){var m=p[x];A[m]=r[m],v?b[m]=i[m]:r[m]=i[m]}}else if(v){M={};for(var x=0;x<y;x++){var m=p[x];M[m]=ns(r[m]),yA(r,i,m)}}var S=new df(r,!1,!1,h?oe(d,function(D){return D.targetName===e}):null);S.targetName=e,n.scope&&(S.scope=n.scope),v&&b&&S.whenWithKeys(0,b,p),M&&S.whenWithKeys(0,M,p),S.whenWithKeys(u??500,s?A:i,p).delay(f||0),t.addAnimator(S,e),o.push(S)}}var ee=function(t){K(e,t);function e(r){var i=t.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(r),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var i=this._children,n=0;n<i.length;n++)if(i[n].name===r)return i[n]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(r){return r&&r!==this&&r.parent!==this&&(this._children.push(r),this._doAdd(r)),this},e.prototype.addBefore=function(r,i){if(r&&r!==this&&r.parent!==this&&i&&i.parent===this){var n=this._children,a=n.indexOf(i);a>=0&&(n.splice(a,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,i){var n=bt(this._children,r);return n>=0&&this.replaceAt(i,n),this},e.prototype.replaceAt=function(r,i){var n=this._children,a=n[i];if(r&&r!==this&&r.parent!==this&&r!==a){n[i]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var i=this.__zr;i&&i!==r.__zr&&r.addSelfToZr(i),i&&i.refresh()},e.prototype.remove=function(r){var i=this.__zr,n=this._children,a=bt(n,r);return a<0?this:(n.splice(a,1),r.parent=null,i&&r.removeSelfFromZr(i),i&&i.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,i=this.__zr,n=0;n<r.length;n++){var a=r[n];i&&a.removeSelfFromZr(i),a.parent=null}return r.length=0,this},e.prototype.eachChild=function(r,i){for(var n=this._children,a=0;a<n.length;a++){var o=n[a];r.call(i,o,a)}return this},e.prototype.traverse=function(r,i){for(var n=0;n<this._children.length;n++){var a=this._children[n],o=r.call(i,a);a.isGroup&&!o&&a.traverse(r,i)}return this},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.addSelfToZr(r)}},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.removeSelfFromZr(r)}},e.prototype.getBoundingRect=function(r){for(var i=new Pt(0,0,0,0),n=r||this._children,a=[],o=null,s=0;s<n.length;s++){var l=n[s];if(!(l.ignore||l.invisible)){var u=l.getBoundingRect(),f=l.getLocalTransform(a);f?(Pt.applyTransform(i,u,f),o=o||i.clone(),o.union(i)):(o=o||u.clone(),o.union(u))}}return o||i},e}(mf);ee.prototype.type="group";/*!
* ZRender, a high performance 2d drawing library.
*
* Copyright (c) 2013, Baidu Inc.
* All rights reserved.
*
* LICENSE
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
*/var au={},rx={};function SA(t){delete rx[t]}function wA(t){if(!t)return!1;if(typeof t=="string")return Au(t,1)<xv;if(t.colorStops){for(var e=t.colorStops,r=0,i=e.length,n=0;n<i;n++)r+=Au(e[n].color,1);return r/=i,r<xv}return!1}var bA=function(){function t(e,r,i){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=r,this.id=e;var a=new Fb,o=i.renderer||"canvas";au[o]||(o=mt(au)[0]),i.useDirtyRect=i.useDirtyRect==null?!1:i.useDirtyRect;var s=new au[o](r,a,i,e),l=i.ssr||s.ssrOnly;this.storage=a,this.painter=s;var u=!vt.node&&!vt.worker&&!l?new dA(s.getViewportRoot(),s.root):null,f=i.useCoarsePointer,h=f==null||f==="auto"?vt.touchEventsSupported:!!f,v=44,c;h&&(c=ft(i.pointerSize,v)),this.handler=new I1(a,s,u,s.root,c),this.animation=new sA({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return t.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},t.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(e,r){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,r),this.refresh())},t.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=wA(e))},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(e){this._darkMode=e},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},t.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},t.prototype.flush=function(){this._disposed||this._flush(!1)},t.prototype._flush=function(e){var r,i=Na();this._needsRefresh&&(r=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(r=!0,this.refreshHoverImmediately());var n=Na();r?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-i})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},t.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){if(!this._disposed)return this.handler.findHover(e,r)},t.prototype.on=function(e,r,i){return this._disposed||this.handler.on(e,r,i),this},t.prototype.off=function(e,r){this._disposed||this.handler.off(e,r)},t.prototype.trigger=function(e,r){this._disposed||this.handler.trigger(e,r)},t.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),r=0;r<e.length;r++)e[r]instanceof ee&&e[r].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},t.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,SA(this.id))},t}();function wv(t,e){var r=new bA(E1(),t,e);return rx[r.id]=r,r}function AA(t,e){au[t]=e}var bv;function EA(t){if(typeof bv=="function")return bv(t)}function MA(t){bv=t}var Og=1e-4,ix=20;function CA(t){return t.replace(/^\s+|\s+$/g,"")}function te(t,e,r,i){var n=e[0],a=e[1],o=r[0],s=r[1],l=a-n,u=s-o;if(l===0)return u===0?o:(o+s)/2;if(i)if(l>0){if(t<=n)return o;if(t>=a)return s}else{if(t>=n)return o;if(t<=a)return s}else{if(t===n)return o;if(t===a)return s}return(t-n)/l*u+o}function se(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return Q(t)?CA(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function Jt(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),ix),t=(+t).toFixed(e),r?t:+t}function On(t){return t.sort(function(e,r){return e-r}),t}function ci(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Math.round(t*e)/e===t)return r}return zd(t)}function zd(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),i=r>0?+e.slice(r+1):0,n=r>0?r:e.length,a=e.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function nx(t,e){var r=Math.log,i=Math.LN10,n=Math.floor(r(t[1]-t[0])/i),a=Math.round(r(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function DA(t,e){var r=Math.max(ci(t),ci(e)),i=t+e;return r>ix?i:Jt(i,r)}function ax(t){var e=Math.PI*2;return(t%e+e)%e}function Cu(t){return t>-Og&&t<Og}var LA=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function ni(t){if(t instanceof Date)return t;if(Q(t)){var e=LA.exec(t);if(!e)return new Date(NaN);if(e[8]){var r=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(r-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,r,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}else return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}else if(t==null)return new Date(NaN);return new Date(Math.round(t))}function RA(t){return Math.pow(10,Ud(t))}function Ud(t){if(t===0)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return t/Math.pow(10,e)>=10&&e++,e}function ox(t,e){var r=Ud(t),i=Math.pow(10,r),n=t/i,a;return n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10,t=a*i,r>=-20?+t.toFixed(r<0?-r:0):t}function Bg(t){t.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,r=1,i=0;i<t.length;){for(var n=t[i].interval,a=t[i].close,o=0;o<2;o++)n[o]<=e&&(n[o]=e,a[o]=o?1:1-r),e=n[o],r=a[o];n[0]===n[1]&&a[0]*a[1]!==1?t.splice(i,1):i++}return t;function s(l,u,f){return l.interval[f]<u.interval[f]||l.interval[f]===u.interval[f]&&(l.close[f]-u.close[f]===(f?-1:1)||!f&&s(l,u,1))}}function Du(t){var e=parseFloat(t);return e==t&&(e!==0||!Q(t)||t.indexOf("x")<=0)?e:NaN}function PA(t){return!isNaN(Du(t))}function sx(){return Math.round(Math.random()*9)}function lx(t,e){return e===0?t:lx(e,t%e)}function Fg(t,e){return t==null?e:e==null?t:t*e/lx(t,e)}function Xe(t){throw new Error(t)}function kg(t,e,r){return(e-t)*r+t}var ux="series\0",IA="\0_ec_\0";function ue(t){return t instanceof Array?t:t==null?[]:[t]}function zg(t,e,r){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,n=r.length;i<n;i++){var a=r[i];!t.emphasis[e].hasOwnProperty(a)&&t[e].hasOwnProperty(a)&&(t.emphasis[e][a]=t[e][a])}}}var Ug=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Hs(t){return rt(t)&&!j(t)&&!(t instanceof Date)?t.value:t}function NA(t){return rt(t)&&!(t instanceof Array)}function fx(t,e,r){var i=r==="normalMerge",n=r==="replaceMerge",a=r==="replaceAll";t=t||[],e=(e||[]).slice();var o=ht();C(e,function(l,u){if(!rt(l)){e[u]=null;return}});var s=OA(t,o,r);return(i||n)&&BA(s,t,o,e),i&&FA(s,e),i||n?kA(s,e,n):a&&zA(s,e),UA(s),s}function OA(t,e,r){var i=[];if(r==="replaceAll")return i;for(var n=0;n<t.length;n++){var a=t[n];a&&a.id!=null&&e.set(a.id,n),i.push({existing:r==="replaceMerge"||xs(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return i}function BA(t,e,r,i){C(i,function(n,a){if(!(!n||n.id==null)){var o=as(n.id),s=r.get(o);if(s!=null){var l=t[s];xr(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=n,l.existing=e[s],i[a]=null}}})}function FA(t,e){C(e,function(r,i){if(!(!r||r.name==null))for(var n=0;n<t.length;n++){var a=t[n].existing;if(!t[n].newOption&&a&&(a.id==null||r.id==null)&&!xs(r)&&!xs(a)&&hx("name",a,r)){t[n].newOption=r,e[i]=null;return}}})}function kA(t,e,r){C(e,function(i){if(i){for(var n,a=0;(n=t[a])&&(n.newOption||xs(n.existing)||n.existing&&i.id!=null&&!hx("id",i,n.existing));)a++;n?(n.newOption=i,n.brandNew=r):t.push({newOption:i,brandNew:r,existing:null,keyInfo:null}),a++}})}function zA(t,e){C(e,function(r){t.push({newOption:r,brandNew:!0,existing:null,keyInfo:null})})}function UA(t){var e=ht();C(t,function(r){var i=r.existing;i&&e.set(i.id,r)}),C(t,function(r){var i=r.newOption;xr(!i||i.id==null||!e.get(i.id)||e.get(i.id)===r,"id duplicates: "+(i&&i.id)),i&&i.id!=null&&e.set(i.id,r),!r.keyInfo&&(r.keyInfo={})}),C(t,function(r,i){var n=r.existing,a=r.newOption,o=r.keyInfo;if(rt(a)){if(o.name=a.name!=null?as(a.name):n?n.name:ux+i,n)o.id=as(n.id);else if(a.id!=null)o.id=as(a.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(e.get(o.id))}e.set(o.id,r)}})}function hx(t,e,r){var i=Ne(e[t],null),n=Ne(r[t],null);return i!=null&&n!=null&&i===n}function as(t){return Ne(t,"")}function Ne(t,e){return t==null?e:Q(t)?t:$t(t)||nv(t)?t+"":e}function Hd(t){var e=t.name;return!!(e&&e.indexOf(ux))}function xs(t){return t&&t.id!=null&&as(t.id).indexOf(IA)===0}function HA(t,e,r){C(t,function(i){var n=i.newOption;rt(n)&&(i.keyInfo.mainType=e,i.keyInfo.subType=VA(e,n,i.existing,r))})}function VA(t,e,r,i){var n=e.type?e.type:r?r.subType:i.determineSubType(t,e);return n}function GA(t,e){var r={},i={};return n(t||[],r),n(e||[],i,r),[a(r),a(i)];function n(o,s,l){for(var u=0,f=o.length;u<f;u++){var h=Ne(o[u].seriesId,null);if(h==null)return;for(var v=ue(o[u].dataIndex),c=l&&l[h],d=0,p=v.length;d<p;d++){var g=v[d];c&&c[g]?c[g]=null:(s[h]||(s[h]={}))[g]=1}}}function a(o,s){var l=[];for(var u in o)if(o.hasOwnProperty(u)&&o[u]!=null)if(s)l.push(+u);else{var f=a(o[u],!0);f.length&&l.push({seriesId:u,dataIndex:f})}return l}}function qn(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return j(e.dataIndex)?tt(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return j(e.name)?tt(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}function Yt(){var t="__ec_inner_"+WA++;return function(e){return e[t]||(e[t]={})}}var WA=sx();function wh(t,e,r){var i=Vd(e,r),n=i.mainTypeSpecified,a=i.queryOptionMap,o=i.others,s=o,l=r?r.defaultMainType:null;return!n&&l&&a.set(l,{}),a.each(function(u,f){var h=Vs(t,f,u,{useDefault:l===f,enableAll:r&&r.enableAll!=null?r.enableAll:!0,enableNone:r&&r.enableNone!=null?r.enableNone:!0});s[f+"Models"]=h.models,s[f+"Model"]=h.models[0]}),s}function Vd(t,e){var r;if(Q(t)){var i={};i[t+"Index"]=0,r=i}else r=t;var n=ht(),a={},o=!1;return C(r,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){a[l]=s;return}var u=l.match(/^(\w+)(Index|Id|Name)$/)||[],f=u[1],h=(u[2]||"").toLowerCase();if(!(!f||!h||e&&e.includeMainTypes&&bt(e.includeMainTypes,f)<0)){o=o||!!f;var v=n.get(f)||n.set(f,{});v[h]=s}}),{mainTypeSpecified:o,queryOptionMap:n,others:a}}var Ze={useDefault:!0,enableAll:!1,enableNone:!1},XA={useDefault:!1,enableAll:!0,enableNone:!0};function Vs(t,e,r,i){i=i||Ze;var n=r.index,a=r.id,o=r.name,s={models:null,specified:n!=null||a!=null||o!=null};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=t.getComponent(e))?[l]:[],s}return n==="none"||n===!1?(xr(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(n==="all"&&(xr(i.enableAll,'`"all"` is not a valid value on index option.'),n=a=o=null),s.models=t.queryComponents({mainType:e,index:n,id:a,name:o}),s)}function cx(t,e,r){t.setAttribute?t.setAttribute(e,r):t[e]=r}function YA(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function ZA(t){return t==="auto"?vt.domSupported?"html":"richText":t||"html"}function vx(t,e,r,i,n){var a=e==null||e==="auto";if(i==null)return i;if($t(i)){var o=kg(r||0,i,n);return Jt(o,a?Math.max(ci(r||0),ci(i)):e)}else{if(Q(i))return n<1?r:i;for(var s=[],l=r,u=i,f=Math.max(l?l.length:0,u.length),h=0;h<f;++h){var v=t.getDimensionInfo(h);if(v&&v.type==="ordinal")s[h]=(n<1&&l?l:u)[h];else{var c=l&&l[h]?l[h]:0,d=u[h],o=kg(c,d,n);s[h]=Jt(o,a?Math.max(ci(c),ci(d)):e)}}return s}}var qA=".",an="___EC__COMPONENT__CONTAINER___",dx="___EC__EXTENDED_CLASS___";function Qr(t){var e={main:"",sub:""};if(t){var r=t.split(qA);e.main=r[0]||"",e.sub=r[1]||""}return e}function $A(t){xr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function KA(t){return!!(t&&t[dx])}function Gd(t,e){t.$constructor=t,t.extend=function(r){var i=this,n;return jA(i)?n=function(a){K(o,a);function o(){return a.apply(this,arguments)||this}return o}(i):(n=function(){(r.$constructor||i).apply(this,arguments)},Rd(n,this)),Y(n.prototype,r),n[dx]=!0,n.extend=this.extend,n.superCall=tE,n.superApply=eE,n.superClass=i,n}}function jA(t){return ct(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function px(t,e){t.extend=e.extend}var QA=Math.round(Math.random()*10);function JA(t){var e=["__\0is_clz",QA++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function tE(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return this.superClass.prototype[e].apply(t,r)}function eE(t,e,r){return this.superClass.prototype[e].apply(t,r)}function _f(t){var e={};t.registerClass=function(i){var n=i.type||i.prototype.type;if(n){$A(n),i.prototype.type=n;var a=Qr(n);if(!a.sub)e[a.main]=i;else if(a.sub!==an){var o=r(a);o[a.sub]=i}}return i},t.getClass=function(i,n,a){var o=e[i];if(o&&o[an]&&(o=n?o[n]:null),a&&!o)throw new Error(n?"Component "+i+"."+(n||"")+" is used but not imported.":i+".type should be specified.");return o},t.getClassesByMainType=function(i){var n=Qr(i),a=[],o=e[n.main];return o&&o[an]?C(o,function(s,l){l!==an&&a.push(s)}):a.push(o),a},t.hasClass=function(i){var n=Qr(i);return!!e[n.main]},t.getAllClassMainTypes=function(){var i=[];return C(e,function(n,a){i.push(a)}),i},t.hasSubTypes=function(i){var n=Qr(i),a=e[n.main];return a&&a[an]};function r(i){var n=e[i.main];return(!n||!n[an])&&(n=e[i.main]={},n[an]=!0),n}}function Ts(t,e){for(var r=0;r<t.length;r++)t[r][1]||(t[r][1]=t[r][0]);return e=e||!1,function(i,n,a){for(var o={},s=0;s<t.length;s++){var l=t[s][1];if(!(n&&bt(n,l)>=0||a&&bt(a,l)<0)){var u=i.getShallow(l,e);u!=null&&(o[t[s][0]]=u)}}return o}}var rE=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],iE=Ts(rE),nE=function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return iE(this,e,r)},t}(),Av=new lo(50);function aE(t){if(typeof t=="string"){var e=Av.get(t);return e&&e.image}else return t}function Wd(t,e,r,i,n){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=Av.get(t),o={hostEl:r,cb:i,cbPayload:n};return a?(e=a.image,!yf(e)&&a.pending.push(o)):(e=oo.loadImage(t,Hg,Hg),e.__zrImageSrc=t,Av.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function Hg(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var r=t.pending[e],i=r.cb;i&&i(this,r.cbPayload),r.hostEl.dirty()}t.pending.length=0}function yf(t){return t&&t.width&&t.height}var bh=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function oE(t,e,r,i,n){if(!e)return"";var a=(t+"").split(`
`);n=gx(e,r,i,n);for(var o=0,s=a.length;o<s;o++)a[o]=mx(a[o],n);return a.join(`
`)}function gx(t,e,r,i){i=i||{};var n=Y({},i);n.font=e,r=ft(r,"..."),n.maxIterations=ft(i.maxIterations,2);var a=n.minChar=ft(i.minChar,0);n.cnCharWidth=rr("国",e);var o=n.ascCharWidth=rr("a",e);n.placeholder=ft(i.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;l<a&&s>=o;l++)s-=o;var u=rr(r,e);return u>s&&(r="",u=0),s=t-u,n.ellipsis=r,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=t,n}function mx(t,e){var r=e.containerWidth,i=e.font,n=e.contentWidth;if(!r)return"";var a=rr(t,i);if(a<=r)return t;for(var o=0;;o++){if(a<=n||o>=e.maxIterations){t+=e.ellipsis;break}var s=o===0?sE(t,n,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*n/a):0;t=t.substr(0,s),a=rr(t,i)}return t===""&&(t=e.placeholder),t}function sE(t,e,r,i){for(var n=0,a=0,o=t.length;a<o&&n<e;a++){var s=t.charCodeAt(a);n+=0<=s&&s<=127?r:i}return a}function lE(t,e){t!=null&&(t+="");var r=e.overflow,i=e.padding,n=e.font,a=r==="truncate",o=gf(n),s=ft(e.lineHeight,o),l=!!e.backgroundColor,u=e.lineOverflow==="truncate",f=e.width,h;f!=null&&(r==="break"||r==="breakAll")?h=t?_x(t,e.font,f,r==="breakAll",0).lines:[]:h=t?t.split(`
`):[];var v=h.length*s,c=ft(e.height,v);if(v>c&&u){var d=Math.floor(c/s);h=h.slice(0,d)}if(t&&a&&f!=null)for(var p=gx(f,n,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),g=0;g<h.length;g++)h[g]=mx(h[g],p);for(var m=c,_=0,g=0;g<h.length;g++)_=Math.max(rr(h[g],n),_);f==null&&(f=_);var y=_;return i&&(m+=i[0]+i[2],y+=i[1]+i[3],f+=i[1]+i[3]),l&&(y=f),{lines:h,height:c,outerWidth:y,outerHeight:m,lineHeight:s,calculatedLineHeight:o,contentWidth:_,contentHeight:v,width:f}}var uE=function(){function t(){}return t}(),Vg=function(){function t(e){this.tokens=[],e&&(this.tokens=e)}return t}(),fE=function(){function t(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]}return t}();function hE(t,e){var r=new fE;if(t!=null&&(t+=""),!t)return r;for(var i=e.width,n=e.height,a=e.overflow,o=(a==="break"||a==="breakAll")&&i!=null?{width:i,accumWidth:0,breakAll:a==="breakAll"}:null,s=bh.lastIndex=0,l;(l=bh.exec(t))!=null;){var u=l.index;u>s&&Ah(r,t.substring(s,u),e,o),Ah(r,l[2],e,o,l[1]),s=bh.lastIndex}s<t.length&&Ah(r,t.substring(s,t.length),e,o);var f=[],h=0,v=0,c=e.padding,d=a==="truncate",p=e.lineOverflow==="truncate";function g(O,X,G){O.width=X,O.lineHeight=G,h+=G,v=Math.max(v,X)}t:for(var m=0;m<r.lines.length;m++){for(var _=r.lines[m],y=0,x=0,S=0;S<_.tokens.length;S++){var T=_.tokens[S],w=T.styleName&&e.rich[T.styleName]||{},b=T.textPadding=w.padding,A=b?b[1]+b[3]:0,M=T.font=w.font||e.font;T.contentHeight=gf(M);var E=ft(w.height,T.contentHeight);if(T.innerHeight=E,b&&(E+=b[0]+b[2]),T.height=E,T.lineHeight=Jl(w.lineHeight,e.lineHeight,E),T.align=w&&w.align||e.align,T.verticalAlign=w&&w.verticalAlign||"middle",p&&n!=null&&h+T.lineHeight>n){S>0?(_.tokens=_.tokens.slice(0,S),g(_,x,y),r.lines=r.lines.slice(0,m+1)):r.lines=r.lines.slice(0,m);break t}var D=w.width,R=D==null||D==="auto";if(typeof D=="string"&&D.charAt(D.length-1)==="%")T.percentWidth=D,f.push(T),T.contentWidth=rr(T.text,M);else{if(R){var P=w.backgroundColor,I=P&&P.image;I&&(I=aE(I),yf(I)&&(T.width=Math.max(T.width,I.width*E/I.height)))}var N=d&&i!=null?i-x:null;N!=null&&N<T.width?!R||N<A?(T.text="",T.width=T.contentWidth=0):(T.text=oE(T.text,N-A,M,e.ellipsis,{minChar:e.truncateMinChar}),T.width=T.contentWidth=rr(T.text,M)):T.contentWidth=rr(T.text,M)}T.width+=A,x+=T.width,w&&(y=Math.max(y,T.lineHeight))}g(_,x,y)}r.outerWidth=r.width=ft(i,v),r.outerHeight=r.height=ft(n,h),r.contentHeight=h,r.contentWidth=v,c&&(r.outerWidth+=c[1]+c[3],r.outerHeight+=c[0]+c[2]);for(var m=0;m<f.length;m++){var T=f[m],V=T.percentWidth;T.width=parseInt(V,10)/100*r.width}return r}function Ah(t,e,r,i,n){var a=e==="",o=n&&r.rich[n]||{},s=t.lines,l=o.font||r.font,u=!1,f,h;if(i){var v=o.padding,c=v?v[1]+v[3]:0;if(o.width!=null&&o.width!=="auto"){var d=mi(o.width,i.width)+c;s.length>0&&d+i.accumWidth>i.width&&(f=e.split(`
`),u=!0),i.accumWidth=d}else{var p=_x(e,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=p.accumWidth+c,h=p.linesWidths,f=p.lines}}else f=e.split(`
`);for(var g=0;g<f.length;g++){var m=f[g],_=new uE;if(_.styleName=n,_.text=m,_.isLineHolder=!m&&!a,typeof o.width=="number"?_.width=o.width:_.width=h?h[g]:rr(m,l),!g&&!u){var y=(s[s.length-1]||(s[0]=new Vg)).tokens,x=y.length;x===1&&y[0].isLineHolder?y[0]=_:(m||!x||a)&&y.push(_)}else s.push(new Vg([_]))}}function cE(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var vE=Qn(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function dE(t){return cE(t)?!!vE[t]:!0}function _x(t,e,r,i,n){for(var a=[],o=[],s="",l="",u=0,f=0,h=0;h<t.length;h++){var v=t.charAt(h);if(v===`
`){l&&(s+=l,f+=u),a.push(s),o.push(f),s="",l="",u=0,f=0;continue}var c=rr(v,e),d=i?!1:!dE(v);if(a.length?f+c>r:n+f+c>r){f?(s||l)&&(d?(s||(s=l,l="",u=0,f=u),a.push(s),o.push(f-u),l+=v,u+=c,s="",f=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(f),s=v,f=c)):d?(a.push(l),o.push(u),l=v,u=c):(a.push(v),o.push(c));continue}f+=c,d?(l+=v,u+=c):(l&&(s+=l,l="",u=0),s+=v)}return!a.length&&!s&&(s=t,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(f)),a.length===1&&(f+=n),{accumWidth:f,lines:a,linesWidths:o}}var Ev="__zr_style_"+Math.round(Math.random()*10),Gn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},xf={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Gn[Ev]=!0;var Gg=["z","z2","invisible"],pE=["invisible"],Jn=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var i=mt(r),n=0;n<i.length;n++){var a=i[n];a==="style"?this.useStyle(r[a]):t.prototype.attrKV.call(this,a,r[a])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(r,i,n,a){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&gE(this,r,i)||o&&!o[0]&&!o[3])return!1;if(n&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(a&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(r,i){return this.rectContain(r,i)},e.prototype.traverse=function(r,i){r.call(i,this)},e.prototype.rectContain=function(r,i){var n=this.transformCoordToLocal(r,i),a=this.getBoundingRect();return a.contain(n[0],n[1])},e.prototype.getPaintRect=function(){var r=this._paintRect;if(!this._paintRect||this.__dirty){var i=this.transform,n=this.getBoundingRect(),a=this.style,o=a.shadowBlur||0,s=a.shadowOffsetX||0,l=a.shadowOffsetY||0;r=this._paintRect||(this._paintRect=new Pt(0,0,0,0)),i?Pt.applyTransform(r,n,i):r.copy(n),(o||s||l)&&(r.width+=o*2+Math.abs(s),r.height+=o*2+Math.abs(l),r.x=Math.min(r.x,r.x+s-o),r.y=Math.min(r.y,r.y+l-o));var u=this.dirtyRectTolerance;r.isZero()||(r.x=Math.floor(r.x-u),r.y=Math.floor(r.y-u),r.width=Math.ceil(r.width+1+u*2),r.height=Math.ceil(r.height+1+u*2))}return r},e.prototype.setPrevPaintRect=function(r){r?(this._prevPaintRect=this._prevPaintRect||new Pt(0,0,0,0),this._prevPaintRect.copy(r)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(r){return this.animate("style",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(r,i){r!=="style"?t.prototype.attrKV.call(this,r,i):this.style?this.setStyle(i):this.useStyle(i)},e.prototype.setStyle=function(r,i){return typeof r=="string"?this.style[r]=i:Y(this.style,r),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(r){r||this.markRedraw(),this.__dirty|=Yo,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&Yo)},e.prototype.styleUpdated=function(){this.__dirty&=~Yo},e.prototype.createStyle=function(r){return hf(Gn,r)},e.prototype.useStyle=function(r){r[Ev]||(r=this.createStyle(r)),this.__inHover?this.__hoverStyle=r:this.style=r,this.dirtyStyle()},e.prototype.isStyleObject=function(r){return r[Ev]},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var i=this._normalState;r.style&&!i.style&&(i.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(r,i,Gg)},e.prototype._applyStateObj=function(r,i,n,a,o,s){t.prototype._applyStateObj.call(this,r,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.style?o?a?u=i.style:(u=this._mergeStyle(this.createStyle(),n.style),this._mergeStyle(u,i.style)):(u=this._mergeStyle(this.createStyle(),a?this.style:n.style),this._mergeStyle(u,i.style)):l&&(u=n.style),u)if(o){var f=this.style;if(this.style=this.createStyle(l?{}:f),l)for(var h=mt(f),v=0;v<h.length;v++){var c=h[v];c in u&&(u[c]=u[c],this.style[c]=f[c])}for(var d=mt(u),v=0;v<d.length;v++){var c=d[v];this.style[c]=this.style[c]}this._transitionState(r,{style:u},s,this.getAnimationStyleProps())}else this.useStyle(u);for(var p=this.__inHover?pE:Gg,v=0;v<p.length;v++){var c=p[v];i&&i[c]!=null?this[c]=i[c]:l&&n[c]!=null&&(this[c]=n[c])}},e.prototype._mergeStates=function(r){for(var i=t.prototype._mergeStates.call(this,r),n,a=0;a<r.length;a++){var o=r[a];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(i.style=n),i},e.prototype._mergeStyle=function(r,i){return Y(r,i),r},e.prototype.getAnimationStyleProps=function(){return xf},e.initDefaultProps=function(){var r=e.prototype;r.type="displayable",r.invisible=!1,r.z=0,r.z2=0,r.zlevel=0,r.culling=!1,r.cursor="pointer",r.rectHover=!1,r.incremental=!1,r._rect=null,r.dirtyRectTolerance=0,r.__dirty=er|Yo}(),e}(mf),Eh=new Pt(0,0,0,0),Mh=new Pt(0,0,0,0);function gE(t,e,r){return Eh.copy(t.getBoundingRect()),t.transform&&Eh.applyTransform(t.transform),Mh.width=e,Mh.height=r,!Eh.intersect(Mh)}var cr=Math.min,vr=Math.max,Ch=Math.sin,Dh=Math.cos,on=Math.PI*2,ul=so(),fl=so(),hl=so();function Wg(t,e,r,i,n,a){n[0]=cr(t,r),n[1]=cr(e,i),a[0]=vr(t,r),a[1]=vr(e,i)}var Xg=[],Yg=[];function mE(t,e,r,i,n,a,o,s,l,u){var f=k1,h=ce,v=f(t,r,n,o,Xg);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var c=0;c<v;c++){var d=h(t,r,n,o,Xg[c]);l[0]=cr(d,l[0]),u[0]=vr(d,u[0])}v=f(e,i,a,s,Yg);for(var c=0;c<v;c++){var p=h(e,i,a,s,Yg[c]);l[1]=cr(p,l[1]),u[1]=vr(p,u[1])}l[0]=cr(t,l[0]),u[0]=vr(t,u[0]),l[0]=cr(o,l[0]),u[0]=vr(o,u[0]),l[1]=cr(e,l[1]),u[1]=vr(e,u[1]),l[1]=cr(s,l[1]),u[1]=vr(s,u[1])}function _E(t,e,r,i,n,a,o,s){var l=U1,u=Ae,f=vr(cr(l(t,r,n),1),0),h=vr(cr(l(e,i,a),1),0),v=u(t,r,n,f),c=u(e,i,a,h);o[0]=cr(t,n,v),o[1]=cr(e,a,c),s[0]=vr(t,n,v),s[1]=vr(e,a,c)}function yE(t,e,r,i,n,a,o,s,l){var u=Pa,f=Ia,h=Math.abs(n-a);if(h%on<1e-4&&h>1e-4){s[0]=t-r,s[1]=e-i,l[0]=t+r,l[1]=e+i;return}if(ul[0]=Dh(n)*r+t,ul[1]=Ch(n)*i+e,fl[0]=Dh(a)*r+t,fl[1]=Ch(a)*i+e,u(s,ul,fl),f(l,ul,fl),n=n%on,n<0&&(n=n+on),a=a%on,a<0&&(a=a+on),n>a&&!o?a+=on:n<a&&o&&(n+=on),o){var v=a;a=n,n=v}for(var c=0;c<a;c+=Math.PI/2)c>n&&(hl[0]=Dh(c)*r+t,hl[1]=Ch(c)*i+e,u(s,hl,s),f(l,hl,l))}var Bt={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},sn=[],ln=[],Hr=[],Ai=[],Vr=[],Gr=[],Lh=Math.min,Rh=Math.max,un=Math.cos,fn=Math.sin,si=Math.abs,Mv=Math.PI,Oi=Mv*2,Ph=typeof Float32Array<"u",yo=[];function Ih(t){var e=Math.round(t/Mv*1e8)/1e8;return e%2*Mv}function xE(t,e){var r=Ih(t[0]);r<0&&(r+=Oi);var i=r-t[0],n=t[1];n+=i,!e&&n-r>=Oi?n=r+Oi:e&&r-n>=Oi?n=r-Oi:!e&&r>n?n=r+(Oi-Ih(r-n)):e&&r<n&&(n=r-(Oi-Ih(n-r))),t[0]=r,t[1]=n}var _i=function(){function t(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(e,r,i){i=i||0,i>0&&(this._ux=si(i/Mu/e)||0,this._uy=si(i/Mu/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(Bt.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var i=si(e-this._xi),n=si(r-this._yi),a=i>this._ux||n>this._uy;if(this.addData(Bt.L,e,r),this._ctx&&a&&this._ctx.lineTo(e,r),a)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,i,n,a,o){return this._drawPendingPt(),this.addData(Bt.C,e,r,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(e,r,i,n,a,o),this._xi=a,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,i,n){return this._drawPendingPt(),this.addData(Bt.Q,e,r,i,n),this._ctx&&this._ctx.quadraticCurveTo(e,r,i,n),this._xi=i,this._yi=n,this},t.prototype.arc=function(e,r,i,n,a,o){this._drawPendingPt(),yo[0]=n,yo[1]=a,xE(yo,o),n=yo[0],a=yo[1];var s=a-n;return this.addData(Bt.A,e,r,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,i,n,a,o),this._xi=un(a)*i+e,this._yi=fn(a)*i+r,this},t.prototype.arcTo=function(e,r,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,i,n,a),this},t.prototype.rect=function(e,r,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,i,n),this.addData(Bt.R,e,r,i,n),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Bt.Z);var e=this._ctx,r=this._x0,i=this._y0;return e&&e.closePath(),this._xi=r,this._yi=i,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){var r=e.length;!(this.data&&this.data.length===r)&&Ph&&(this.data=new Float32Array(r));for(var i=0;i<r;i++)this.data[i]=e[i];this._len=r},t.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var r=e.length,i=0,n=this._len,a=0;a<r;a++)i+=e[a].len();Ph&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(var a=0;a<r;a++)for(var o=e[a].data,s=0;s<o.length;s++)this.data[n++]=o[s];this._len=n},t.prototype.addData=function(e,r,i,n,a,o,s,l,u){if(this._saveData){var f=this.data;this._len+arguments.length>f.length&&(this._expandData(),f=this.data);for(var h=0;h<arguments.length;h++)f[this._len++]=arguments[h]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r<this._len;r++)e[r]=this.data[r];this.data=e}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,Ph&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){Hr[0]=Hr[1]=Vr[0]=Vr[1]=Number.MAX_VALUE,Ai[0]=Ai[1]=Gr[0]=Gr[1]=-Number.MAX_VALUE;var e=this.data,r=0,i=0,n=0,a=0,o;for(o=0;o<this._len;){var s=e[o++],l=o===1;switch(l&&(r=e[o],i=e[o+1],n=r,a=i),s){case Bt.M:r=n=e[o++],i=a=e[o++],Vr[0]=n,Vr[1]=a,Gr[0]=n,Gr[1]=a;break;case Bt.L:Wg(r,i,e[o],e[o+1],Vr,Gr),r=e[o++],i=e[o++];break;case Bt.C:mE(r,i,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],Vr,Gr),r=e[o++],i=e[o++];break;case Bt.Q:_E(r,i,e[o++],e[o++],e[o],e[o+1],Vr,Gr),r=e[o++],i=e[o++];break;case Bt.A:var u=e[o++],f=e[o++],h=e[o++],v=e[o++],c=e[o++],d=e[o++]+c;o+=1;var p=!e[o++];l&&(n=un(c)*h+u,a=fn(c)*v+f),yE(u,f,h,v,c,d,p,Vr,Gr),r=un(d)*h+u,i=fn(d)*v+f;break;case Bt.R:n=r=e[o++],a=i=e[o++];var g=e[o++],m=e[o++];Wg(n,a,n+g,a+m,Vr,Gr);break;case Bt.Z:r=n,i=a;break}Pa(Hr,Hr,Vr),Ia(Ai,Ai,Gr)}return o===0&&(Hr[0]=Hr[1]=Ai[0]=Ai[1]=0),new Pt(Hr[0],Hr[1],Ai[0]-Hr[0],Ai[1]-Hr[1])},t.prototype._calculateLength=function(){var e=this.data,r=this._len,i=this._ux,n=this._uy,a=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var u=this._pathSegLen,f=0,h=0,v=0;v<r;){var c=e[v++],d=v===1;d&&(a=e[v],o=e[v+1],s=a,l=o);var p=-1;switch(c){case Bt.M:a=s=e[v++],o=l=e[v++];break;case Bt.L:{var g=e[v++],m=e[v++],_=g-a,y=m-o;(si(_)>i||si(y)>n||v===r-1)&&(p=Math.sqrt(_*_+y*y),a=g,o=m);break}case Bt.C:{var x=e[v++],S=e[v++],g=e[v++],m=e[v++],T=e[v++],w=e[v++];p=kb(a,o,x,S,g,m,T,w,10),a=T,o=w;break}case Bt.Q:{var x=e[v++],S=e[v++],g=e[v++],m=e[v++];p=Ub(a,o,x,S,g,m,10),a=g,o=m;break}case Bt.A:var b=e[v++],A=e[v++],M=e[v++],E=e[v++],D=e[v++],R=e[v++],P=R+D;v+=1,d&&(s=un(D)*M+b,l=fn(D)*E+A),p=Rh(M,E)*Lh(Oi,Math.abs(R)),a=un(P)*M+b,o=fn(P)*E+A;break;case Bt.R:{s=a=e[v++],l=o=e[v++];var I=e[v++],N=e[v++];p=I*2+N*2;break}case Bt.Z:{var _=s-a,y=l-o;p=Math.sqrt(_*_+y*y),a=s,o=l;break}}p>=0&&(u[h++]=p,f+=p)}return this._pathLen=f,f},t.prototype.rebuildPath=function(e,r){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,f,h,v,c=r<1,d,p,g=0,m=0,_,y=0,x,S;if(!(c&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,p=this._pathLen,_=r*p,!_)))t:for(var T=0;T<o;){var w=i[T++],b=T===1;switch(b&&(u=i[T],f=i[T+1],s=u,l=f),w!==Bt.L&&y>0&&(e.lineTo(x,S),y=0),w){case Bt.M:s=u=i[T++],l=f=i[T++],e.moveTo(u,f);break;case Bt.L:{h=i[T++],v=i[T++];var A=si(h-u),M=si(v-f);if(A>n||M>a){if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;e.lineTo(u*(1-D)+h*D,f*(1-D)+v*D);break t}g+=E}e.lineTo(h,v),u=h,f=v,y=0}else{var R=A*A+M*M;R>y&&(x=h,S=v,y=R)}break}case Bt.C:{var P=i[T++],I=i[T++],N=i[T++],V=i[T++],O=i[T++],X=i[T++];if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;wu(u,P,N,O,D,sn),wu(f,I,V,X,D,ln),e.bezierCurveTo(sn[1],ln[1],sn[2],ln[2],sn[3],ln[3]);break t}g+=E}e.bezierCurveTo(P,I,N,V,O,X),u=O,f=X;break}case Bt.Q:{var P=i[T++],I=i[T++],N=i[T++],V=i[T++];if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;bu(u,P,N,D,sn),bu(f,I,V,D,ln),e.quadraticCurveTo(sn[1],ln[1],sn[2],ln[2]);break t}g+=E}e.quadraticCurveTo(P,I,N,V),u=N,f=V;break}case Bt.A:var G=i[T++],lt=i[T++],J=i[T++],ot=i[T++],at=i[T++],Dt=i[T++],pt=i[T++],Ot=!i[T++],Ht=J>ot?J:ot,Nt=si(J-ot)>.001,wt=at+Dt,et=!1;if(c){var E=d[m++];g+E>_&&(wt=at+Dt*(_-g)/E,et=!0),g+=E}if(Nt&&e.ellipse?e.ellipse(G,lt,J,ot,pt,at,wt,Ot):e.arc(G,lt,Ht,at,wt,Ot),et)break t;b&&(s=un(at)*J+G,l=fn(at)*ot+lt),u=un(wt)*J+G,f=fn(wt)*ot+lt;break;case Bt.R:s=u=i[T],l=f=i[T+1],h=i[T++],v=i[T++];var xt=i[T++],re=i[T++];if(c){var E=d[m++];if(g+E>_){var Vt=_-g;e.moveTo(h,v),e.lineTo(h+Lh(Vt,xt),v),Vt-=xt,Vt>0&&e.lineTo(h+xt,v+Lh(Vt,re)),Vt-=re,Vt>0&&e.lineTo(h+Rh(xt-Vt,0),v+re),Vt-=xt,Vt>0&&e.lineTo(h,v+Rh(re-Vt,0));break t}g+=E}e.rect(h,v,xt,re);break;case Bt.Z:if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;e.lineTo(u*(1-D)+s*D,f*(1-D)+l*D);break t}g+=E}e.closePath(),u=s,f=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=Bt,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function sa(t,e,r,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=t;if(o>e+s&&o>i+s||o<e-s&&o<i-s||a>t+s&&a>r+s||a<t-s&&a<r-s)return!1;if(t!==r)l=(e-i)/(t-r),u=(t*i-r*e)/(t-r);else return Math.abs(a-t)<=s/2;var f=l*a-o+u,h=f*f/(l*l+1);return h<=s/2*s/2}function TE(t,e,r,i,n,a,o,s,l,u,f){if(l===0)return!1;var h=l;if(f>e+h&&f>i+h&&f>a+h&&f>s+h||f<e-h&&f<i-h&&f<a-h&&f<s-h||u>t+h&&u>r+h&&u>n+h&&u>o+h||u<t-h&&u<r-h&&u<n-h&&u<o-h)return!1;var v=z1(t,e,r,i,n,a,o,s,u,f,null);return v<=h/2}function SE(t,e,r,i,n,a,o,s,l){if(o===0)return!1;var u=o;if(l>e+u&&l>i+u&&l>a+u||l<e-u&&l<i-u&&l<a-u||s>t+u&&s>r+u&&s>n+u||s<t-u&&s<r-u&&s<n-u)return!1;var f=H1(t,e,r,i,n,a,s,l,null);return f<=u/2}var Zg=Math.PI*2;function vi(t){return t%=Zg,t<0&&(t+=Zg),t}var xo=Math.PI*2;function wE(t,e,r,i,n,a,o,s,l){if(o===0)return!1;var u=o;s-=t,l-=e;var f=Math.sqrt(s*s+l*l);if(f-u>r||f+u<r)return!1;if(Math.abs(i-n)%xo<1e-4)return!0;if(a){var h=i;i=vi(n),n=vi(h)}else i=vi(i),n=vi(n);i>n&&(n+=xo);var v=Math.atan2(l,s);return v<0&&(v+=xo),v>=i&&v<=n||v+xo>=i&&v+xo<=n}function hn(t,e,r,i,n,a){if(a>e&&a>i||a<e&&a<i||i===e)return 0;var o=(a-e)/(i-e),s=i<e?1:-1;(o===1||o===0)&&(s=i<e?.5:-.5);var l=o*(r-t)+t;return l===n?1/0:l>n?s:0}var Ei=_i.CMD,cn=Math.PI*2,bE=1e-4;function AE(t,e){return Math.abs(t-e)<bE}var Pe=[-1,-1,-1],ur=[-1,-1];function EE(){var t=ur[0];ur[0]=ur[1],ur[1]=t}function ME(t,e,r,i,n,a,o,s,l,u){if(u>e&&u>i&&u>a&&u>s||u<e&&u<i&&u<a&&u<s)return 0;var f=Su(e,i,a,s,u,Pe);if(f===0)return 0;for(var h=0,v=-1,c=void 0,d=void 0,p=0;p<f;p++){var g=Pe[p],m=g===0||g===1?.5:1,_=ce(t,r,n,o,g);_<l||(v<0&&(v=k1(e,i,a,s,ur),ur[1]<ur[0]&&v>1&&EE(),c=ce(e,i,a,s,ur[0]),v>1&&(d=ce(e,i,a,s,ur[1]))),v===2?g<ur[0]?h+=c<e?m:-m:g<ur[1]?h+=d<c?m:-m:h+=s<d?m:-m:g<ur[0]?h+=c<e?m:-m:h+=s<c?m:-m)}return h}function CE(t,e,r,i,n,a,o,s){if(s>e&&s>i&&s>a||s<e&&s<i&&s<a)return 0;var l=zb(e,i,a,s,Pe);if(l===0)return 0;var u=U1(e,i,a);if(u>=0&&u<=1){for(var f=0,h=Ae(e,i,a,u),v=0;v<l;v++){var c=Pe[v]===0||Pe[v]===1?.5:1,d=Ae(t,r,n,Pe[v]);d<o||(Pe[v]<u?f+=h<e?c:-c:f+=a<h?c:-c)}return f}else{var c=Pe[0]===0||Pe[0]===1?.5:1,d=Ae(t,r,n,Pe[0]);return d<o?0:a<e?c:-c}}function DE(t,e,r,i,n,a,o,s){if(s-=e,s>r||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Pe[0]=-l,Pe[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=cn-1e-4){i=0,n=cn;var f=a?1:-1;return o>=Pe[0]+t&&o<=Pe[1]+t?f:0}if(i>n){var h=i;i=n,n=h}i<0&&(i+=cn,n+=cn);for(var v=0,c=0;c<2;c++){var d=Pe[c];if(d+t>o){var p=Math.atan2(s,d),f=a?1:-1;p<0&&(p=cn+p),(p>=i&&p<=n||p+cn>=i&&p+cn<=n)&&(p>Math.PI/2&&p<Math.PI*1.5&&(f=-f),v+=f)}}return v}function yx(t,e,r,i,n){for(var a=t.data,o=t.len(),s=0,l=0,u=0,f=0,h=0,v,c,d=0;d<o;){var p=a[d++],g=d===1;switch(p===Ei.M&&d>1&&(r||(s+=hn(l,u,f,h,i,n))),g&&(l=a[d],u=a[d+1],f=l,h=u),p){case Ei.M:f=a[d++],h=a[d++],l=f,u=h;break;case Ei.L:if(r){if(sa(l,u,a[d],a[d+1],e,i,n))return!0}else s+=hn(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Ei.C:if(r){if(TE(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=ME(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Ei.Q:if(r){if(SE(l,u,a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=CE(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Ei.A:var m=a[d++],_=a[d++],y=a[d++],x=a[d++],S=a[d++],T=a[d++];d+=1;var w=!!(1-a[d++]);v=Math.cos(S)*y+m,c=Math.sin(S)*x+_,g?(f=v,h=c):s+=hn(l,u,v,c,i,n);var b=(i-m)*x/y+m;if(r){if(wE(m,_,x,S,S+T,w,e,b,n))return!0}else s+=DE(m,_,x,S,S+T,w,b,n);l=Math.cos(S+T)*y+m,u=Math.sin(S+T)*x+_;break;case Ei.R:f=l=a[d++],h=u=a[d++];var A=a[d++],M=a[d++];if(v=f+A,c=h+M,r){if(sa(f,h,v,h,e,i,n)||sa(v,h,v,c,e,i,n)||sa(v,c,f,c,e,i,n)||sa(f,c,f,h,e,i,n))return!0}else s+=hn(v,h,v,c,i,n),s+=hn(f,c,f,h,i,n);break;case Ei.Z:if(r){if(sa(l,u,f,h,e,i,n))return!0}else s+=hn(l,u,f,h,i,n);l=f,u=h;break}}return!r&&!AE(u,h)&&(s+=hn(l,u,f,h,i,n)||0),s!==0}function LE(t,e,r){return yx(t,0,!1,e,r)}function RE(t,e,r,i){return yx(t,e,!0,r,i)}var Lu=Et({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Gn),PE={style:Et({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},xf.style)},Nh=ii.concat(["invisible","culling","z","z2","zlevel","parent"]),kt=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new e;n.buildPath===e.prototype.buildPath&&(n.buildPath=function(l){r.buildPath(l,r.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s<Nh.length;++s)n[Nh[s]]=this[Nh[s]];n.__dirty|=er}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(r){var i=mt(r);this.shape=this.getDefaultShape();var n=this.getDefaultStyle();n&&this.useStyle(n);for(var a=0;a<i.length;a++){var o=i[a],s=r[o];o==="style"?this.style?Y(this.style,s):this.useStyle(s):o==="shape"?Y(this.shape,s):t.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var r=this.style.fill;if(r!=="none"){if(Q(r)){var i=Au(r,0);return i>.5?Tv:i>.2?pA:Sv}else if(r)return Sv}return Tv},e.prototype.getInsideTextStroke=function(r){var i=this.style.fill;if(Q(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Au(r,0)<xv;if(a===o)return i}},e.prototype.buildPath=function(r,i,n){},e.prototype.pathUpdated=function(){this.__dirty&=~Ca},e.prototype.getUpdatedPathProxy=function(r){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,r),this.path},e.prototype.createPathProxy=function(){this.path=new _i(!1)},e.prototype.hasStroke=function(){var r=this.style,i=r.stroke;return!(i==null||i==="none"||!(r.lineWidth>0))},e.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,i=this.style,n=!r;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Ca)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||n){s.copy(r);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var f=this.strokeContainThreshold;u=Math.max(u,f??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},e.prototype.contain=function(r,i){var n=this.transformCoordToLocal(r,i),a=this.getBoundingRect(),o=this.style;if(r=n[0],i=n[1],a.contain(r,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),RE(s,l/u,r,i)))return!0}if(this.hasFill())return LE(s,r,i)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Ca,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,i){r==="shape"?this.setShape(i):t.prototype.attrKV.call(this,r,i)},e.prototype.setShape=function(r,i){var n=this.shape;return n||(n=this.shape={}),typeof r=="string"?n[r]=i:Y(n,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Ca)},e.prototype.createStyle=function(r){return hf(Lu,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var i=this._normalState;r.shape&&!i.shape&&(i.shape=Y({},this.shape))},e.prototype._applyStateObj=function(r,i,n,a,o,s){t.prototype._applyStateObj.call(this,r,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=Y({},n.shape),Y(u,i.shape)):(u=Y({},a?this.shape:n.shape),Y(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=Y({},this.shape);for(var f={},h=mt(u),v=0;v<h.length;v++){var c=h[v];typeof u[c]=="object"?this.shape[c]=u[c]:f[c]=u[c]}this._transitionState(r,{shape:f},s)}else this.shape=u,this.dirtyShape()},e.prototype._mergeStates=function(r){for(var i=t.prototype._mergeStates.call(this,r),n,a=0;a<r.length;a++){var o=r[a];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(i.shape=n),i},e.prototype.getAnimationStyleProps=function(){return PE},e.prototype.isZeroArea=function(){return!1},e.extend=function(r){var i=function(a){K(o,a);function o(s){var l=a.call(this,s)||this;return r.init&&r.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return ut(r.style)},o.prototype.getDefaultShape=function(){return ut(r.shape)},o}(e);for(var n in r)typeof r[n]=="function"&&(i.prototype[n]=r[n]);return i},e.initDefaultProps=function(){var r=e.prototype;r.type="path",r.strokeContainThreshold=5,r.segmentIgnoreThreshold=0,r.subPixelOptimize=!1,r.autoBatch=!1,r.__dirty=er|Yo|Ca}(),e}(Jn),IE=Et({strokeFirst:!0,font:Zi,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Lu),Ss=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var r=this.style,i=r.stroke;return i!=null&&i!=="none"&&r.lineWidth>0},e.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},e.prototype.createStyle=function(r){return hf(IE,r)},e.prototype.setBoundingRect=function(r){this._rect=r},e.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var i=r.text;i!=null?i+="":i="";var n=kd(i,r.font,r.textAlign,r.textBaseline);if(n.x+=r.x||0,n.y+=r.y||0,this.hasStroke()){var a=r.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},e.initDefaultProps=function(){var r=e.prototype;r.dirtyRectTolerance=10}(),e}(Jn);Ss.prototype.type="tspan";var NE=Et({x:0,y:0},Gn),OE={style:Et({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},xf.style)};function BE(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var ir=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return hf(NE,r)},e.prototype._getSize=function(r){var i=this.style,n=i[r];if(n!=null)return n;var a=BE(i.image)?i.image:this.__image;if(!a)return 0;var o=r==="width"?"height":"width",s=i[o];return s==null?a[r]:a[r]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return OE},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new Pt(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Jn);ir.prototype.type="image";function FE(t,e){var r=e.x,i=e.y,n=e.width,a=e.height,o=e.r,s,l,u,f;n<0&&(r=r+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=f=o:o instanceof Array?o.length===1?s=l=u=f=o[0]:o.length===2?(s=u=o[0],l=f=o[1]):o.length===3?(s=o[0],l=f=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],f=o[3]):s=l=u=f=0;var h;s+l>n&&(h=s+l,s*=n/h,l*=n/h),u+f>n&&(h=u+f,u*=n/h,f*=n/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+f>a&&(h=s+f,s*=a/h,f*=a/h),t.moveTo(r+s,i),t.lineTo(r+n-l,i),l!==0&&t.arc(r+n-l,i+l,l,-Math.PI/2,0),t.lineTo(r+n,i+a-u),u!==0&&t.arc(r+n-u,i+a-u,u,0,Math.PI/2),t.lineTo(r+f,i+a),f!==0&&t.arc(r+f,i+a-f,f,Math.PI/2,Math.PI),t.lineTo(r,i+s),s!==0&&t.arc(r+s,i+s,s,Math.PI,Math.PI*1.5)}var Oa=Math.round;function xx(t,e,r){if(e){var i=e.x1,n=e.x2,a=e.y1,o=e.y2;t.x1=i,t.x2=n,t.y1=a,t.y2=o;var s=r&&r.lineWidth;return s&&(Oa(i*2)===Oa(n*2)&&(t.x1=t.x2=Bn(i,s,!0)),Oa(a*2)===Oa(o*2)&&(t.y1=t.y2=Bn(a,s,!0))),t}}function Tx(t,e,r){if(e){var i=e.x,n=e.y,a=e.width,o=e.height;t.x=i,t.y=n,t.width=a,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=Bn(i,s,!0),t.y=Bn(n,s,!0),t.width=Math.max(Bn(i+a,s,!1)-t.x,a===0?0:1),t.height=Math.max(Bn(n+o,s,!1)-t.y,o===0?0:1)),t}}function Bn(t,e,r){if(!e)return t;var i=Oa(t*2);return(i+Oa(e))%2===0?i/2:(i+(r?1:-1))/2}var kE=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),zE={},Kt=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new kE},e.prototype.buildPath=function(r,i){var n,a,o,s;if(this.subPixelOptimize){var l=Tx(zE,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?FE(r,i):r.rect(n,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(kt);Kt.prototype.type="rect";var qg={fill:"#000"},$g=2,UE={style:Et({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},xf.style)},Xt=function(t){K(e,t);function e(r){var i=t.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=qg,i.attr(r),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r<this._children.length;r++){var i=this._children[r];i.zlevel=this.zlevel,i.z=this.z,i.z2=this.z2,i.culling=this.culling,i.cursor=this.cursor,i.invisible=this.invisible}},e.prototype.updateTransform=function(){var r=this.innerTransformable;r?(r.updateTransform(),r.transform&&(this.transform=r.transform)):t.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(r){var i=this.innerTransformable;return i?i.getLocalTransform(r):t.prototype.getLocalTransform.call(this,r)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,GE(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var i=0;i<this._children.length;i++)this._children[i].__zr=r},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var i=0;i<this._children.length;i++)this._children[i].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var r=new Pt(0,0,0,0),i=this._children,n=[],a=null,o=0;o<i.length;o++){var s=i[o],l=s.getBoundingRect(),u=s.getLocalTransform(n);u?(r.copy(l),r.applyTransform(u),a=a||r.clone(),a.union(r)):(a=a||l.clone(),a.union(l))}this._rect=a||r}return this._rect},e.prototype.setDefaultTextStyle=function(r){this._defaultStyle=r||qg},e.prototype.setTextContent=function(r){},e.prototype._mergeStyle=function(r,i){if(!i)return r;var n=i.rich,a=r.rich||n&&{};return Y(r,i),n&&a?(this._mergeRich(a,n),r.rich=a):a&&(r.rich=a),r},e.prototype._mergeRich=function(r,i){for(var n=mt(i),a=0;a<n.length;a++){var o=n[a];r[o]=r[o]||{},Y(r[o],i[o])}},e.prototype.getAnimationStyleProps=function(){return UE},e.prototype._getOrCreateChild=function(r){var i=this._children[this._childCursor];return(!i||!(i instanceof r))&&(i=new r),this._children[this._childCursor++]=i,i.__zr=this.__zr,i.parent=this,i},e.prototype._updatePlainTexts=function(){var r=this.style,i=r.font||Zi,n=r.padding,a=rm(r),o=lE(a,r),s=Oh(r),l=!!r.backgroundColor,u=o.outerHeight,f=o.outerWidth,h=o.contentWidth,v=o.lines,c=o.lineHeight,d=this._defaultStyle,p=r.x||0,g=r.y||0,m=r.align||d.align||"left",_=r.verticalAlign||d.verticalAlign||"top",y=p,x=Da(g,o.contentHeight,_);if(s||n){var S=qo(p,f,m),T=Da(g,u,_);s&&this._renderBackground(r,r,S,T,f,u)}x+=c/2,n&&(y=em(p,m,n),_==="top"?x+=n[0]:_==="bottom"&&(x-=n[2]));for(var w=0,b=!1,A=tm("fill"in r?r.fill:(b=!0,d.fill)),M=Jg("stroke"in r?r.stroke:!l&&(!d.autoStroke||b)?(w=$g,d.stroke):null),E=r.textShadowBlur>0,D=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),R=o.calculatedLineHeight,P=0;P<v.length;P++){var I=this._getOrCreateChild(Ss),N=I.createStyle();I.useStyle(N),N.text=v[P],N.x=y,N.y=x,m&&(N.textAlign=m),N.textBaseline="middle",N.opacity=r.opacity,N.strokeFirst=!0,E&&(N.shadowBlur=r.textShadowBlur||0,N.shadowColor=r.textShadowColor||"transparent",N.shadowOffsetX=r.textShadowOffsetX||0,N.shadowOffsetY=r.textShadowOffsetY||0),N.stroke=M,N.fill=A,M&&(N.lineWidth=r.lineWidth||w,N.lineDash=r.lineDash,N.lineDashOffset=r.lineDashOffset||0),N.font=i,jg(N,r),x+=c,D&&I.setBoundingRect(new Pt(qo(N.x,r.width,N.textAlign),Da(N.y,R,N.textBaseline),h,R))}},e.prototype._updateRichTexts=function(){var r=this.style,i=rm(r),n=hE(i,r),a=n.width,o=n.outerWidth,s=n.outerHeight,l=r.padding,u=r.x||0,f=r.y||0,h=this._defaultStyle,v=r.align||h.align,c=r.verticalAlign||h.verticalAlign,d=qo(u,o,v),p=Da(f,s,c),g=d,m=p;l&&(g+=l[3],m+=l[0]);var _=g+a;Oh(r)&&this._renderBackground(r,r,d,p,o,s);for(var y=!!r.backgroundColor,x=0;x<n.lines.length;x++){for(var S=n.lines[x],T=S.tokens,w=T.length,b=S.lineHeight,A=S.width,M=0,E=g,D=_,R=w-1,P=void 0;M<w&&(P=T[M],!P.align||P.align==="left");)this._placeToken(P,r,b,m,E,"left",y),A-=P.width,E+=P.width,M++;for(;R>=0&&(P=T[R],P.align==="right");)this._placeToken(P,r,b,m,D,"right",y),A-=P.width,D-=P.width,R--;for(E+=(a-(E-g)-(_-D)-A)/2;M<=R;)P=T[M],this._placeToken(P,r,b,m,E+P.width/2,"center",y),E+=P.width,M++;m+=b}},e.prototype._placeToken=function(r,i,n,a,o,s,l){var u=i.rich[r.styleName]||{};u.text=r.text;var f=r.verticalAlign,h=a+n/2;f==="top"?h=a+r.height/2:f==="bottom"&&(h=a+n-r.height/2);var v=!r.isLineHolder&&Oh(u);v&&this._renderBackground(u,i,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var c=!!u.backgroundColor,d=r.textPadding;d&&(o=em(o,s,d),h-=r.height/2-d[0]-r.innerHeight/2);var p=this._getOrCreateChild(Ss),g=p.createStyle();p.useStyle(g);var m=this._defaultStyle,_=!1,y=0,x=tm("fill"in u?u.fill:"fill"in i?i.fill:(_=!0,m.fill)),S=Jg("stroke"in u?u.stroke:"stroke"in i?i.stroke:!c&&!l&&(!m.autoStroke||_)?(y=$g,m.stroke):null),T=u.textShadowBlur>0||i.textShadowBlur>0;g.text=r.text,g.x=o,g.y=h,T&&(g.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,g.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",g.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,g.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=r.font||Zi,g.opacity=Jl(u.opacity,i.opacity,1),jg(g,u),S&&(g.lineWidth=Jl(u.lineWidth,i.lineWidth,y),g.lineDash=ft(u.lineDash,i.lineDash),g.lineDashOffset=i.lineDashOffset||0,g.stroke=S),x&&(g.fill=x);var w=r.contentWidth,b=r.contentHeight;p.setBoundingRect(new Pt(qo(g.x,w,g.textAlign),Da(g.y,b,g.textBaseline),w,b))},e.prototype._renderBackground=function(r,i,n,a,o,s){var l=r.backgroundColor,u=r.borderWidth,f=r.borderColor,h=l&&l.image,v=l&&!h,c=r.borderRadius,d=this,p,g;if(v||r.lineHeight||u&&f){p=this._getOrCreateChild(Kt),p.useStyle(p.createStyle()),p.style.fill=null;var m=p.shape;m.x=n,m.y=a,m.width=o,m.height=s,m.r=c,p.dirtyShape()}if(v){var _=p.style;_.fill=l||null,_.fillOpacity=ft(r.fillOpacity,1)}else if(h){g=this._getOrCreateChild(ir),g.onload=function(){d.dirtyStyle()};var y=g.style;y.image=l.image,y.x=n,y.y=a,y.width=o,y.height=s}if(u&&f){var _=p.style;_.lineWidth=u,_.stroke=f,_.strokeOpacity=ft(r.strokeOpacity,1),_.lineDash=r.borderDash,_.lineDashOffset=r.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var x=(p||g).style;x.shadowBlur=r.shadowBlur||0,x.shadowColor=r.shadowColor||"transparent",x.shadowOffsetX=r.shadowOffsetX||0,x.shadowOffsetY=r.shadowOffsetY||0,x.opacity=Jl(r.opacity,i.opacity,1)},e.makeFont=function(r){var i="";return bx(r)&&(i=[r.fontStyle,r.fontWeight,Sx(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),i&&jr(i)||r.textFont||r.font},e}(Jn),HE={left:!0,right:1,center:1},VE={top:1,bottom:1,middle:1},Kg=["fontStyle","fontWeight","fontSize","fontFamily"];function Sx(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?Md+"px":t+"px"}function jg(t,e){for(var r=0;r<Kg.length;r++){var i=Kg[r],n=e[i];n!=null&&(t[i]=n)}}function bx(t){return t.fontSize!=null||t.fontFamily||t.fontWeight}function GE(t){return Qg(t),C(t.rich,Qg),t}function Qg(t){if(t){t.font=Xt.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||HE[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||VE[r]?r:"top";var i=t.padding;i&&(t.padding=M1(t.padding))}}function Jg(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function tm(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function em(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function rm(t){var e=t.text;return e!=null&&(e+=""),e}function Oh(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var Mt=Yt(),WE=function(t,e,r,i){if(i){var n=Mt(i);n.dataIndex=r,n.dataType=e,n.seriesIndex=t,n.ssrType="chart",i.type==="group"&&i.traverse(function(a){var o=Mt(a);o.seriesIndex=t,o.dataIndex=r,o.dataType=e,o.ssrType="chart"})}},im=1,nm={},Ax=Yt(),Xd=Yt(),Yd=0,Tf=1,Sf=2,Tr=["emphasis","blur","select"],Ru=["normal","emphasis","blur","select"],XE=10,YE=9,Wn="highlight",ou="downplay",os="select",su="unselect",ss="toggleSelect";function la(t){return t!=null&&t!=="none"}function wf(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function Ex(t){wf(t,"emphasis",Sf)}function Mx(t){t.hoverState===Sf&&wf(t,"normal",Yd)}function Zd(t){wf(t,"blur",Tf)}function Cx(t){t.hoverState===Tf&&wf(t,"normal",Yd)}function ZE(t){t.selected=!0}function qE(t){t.selected=!1}function am(t,e,r){e(t,r)}function xi(t,e,r){am(t,e,r),t.isGroup&&t.traverse(function(i){am(i,e,r)})}function om(t,e){switch(e){case"emphasis":t.hoverState=Sf;break;case"normal":t.hoverState=Yd;break;case"blur":t.hoverState=Tf;break;case"select":t.selected=!0}}function $E(t,e,r,i){for(var n=t.style,a={},o=0;o<e.length;o++){var s=e[o],l=n[s];a[s]=l??(i&&i[s])}for(var o=0;o<t.animators.length;o++){var u=t.animators[o];u.__fromStateTransition&&u.__fromStateTransition.indexOf(r)<0&&u.targetName==="style"&&u.saveTo(a,e)}return a}function KE(t,e,r,i){var n=r&&bt(r,"select")>=0,a=!1;if(t instanceof kt){var o=Ax(t),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(la(s)||la(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=Y({},i),u=Y({},u),u.fill=s):!la(u.fill)&&la(s)?(a=!0,i=Y({},i),u=Y({},u),u.fill=vv(s)):!la(u.stroke)&&la(l)&&(a||(i=Y({},i),u=Y({},u)),u.stroke=vv(l)),i.style=u}}if(i&&i.z2==null){a||(i=Y({},i));var f=t.z2EmphasisLift;i.z2=t.z2+(f??XE)}return i}function jE(t,e,r){if(r&&r.z2==null){r=Y({},r);var i=t.z2SelectLift;r.z2=t.z2+(i??YE)}return r}function QE(t,e,r){var i=bt(t.currentStates,e)>=0,n=t.style.opacity,a=i?null:$E(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=Y({},r),o=Y({opacity:i?n:a.opacity*.1},o),r.style=o),r}function Bh(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return KE(this,t,e,r);if(t==="blur")return QE(this,t,r);if(t==="select")return jE(this,t,r)}return r}function JE(t){t.stateProxy=Bh;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=Bh),r&&(r.stateProxy=Bh)}function sm(t,e){!Px(t,e)&&!t.__highByOuter&&xi(t,Ex)}function lm(t,e){!Px(t,e)&&!t.__highByOuter&&xi(t,Mx)}function Pu(t,e){t.__highByOuter|=1<<(e||0),xi(t,Ex)}function Iu(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&xi(t,Mx)}function tM(t){xi(t,Zd)}function Dx(t){xi(t,Cx)}function Lx(t){xi(t,ZE)}function Rx(t){xi(t,qE)}function Px(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Ix(t){var e=t.getModel(),r=[],i=[];e.eachComponent(function(n,a){var o=Xd(a),s=n==="series",l=s?t.getViewOfSeriesModel(a):t.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){Cx(u)}),s&&r.push(a)),o.isBlured=!1}),C(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(r,!1,e)})}function Cv(t,e,r,i){var n=i.getModel();r=r||"coordinateSystem";function a(u,f){for(var h=0;h<f.length;h++){var v=u.getItemGraphicEl(f[h]);v&&Dx(v)}}if(t!=null&&!(!e||e==="none")){var o=n.getSeriesByIndex(t),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];n.eachSeries(function(u){var f=o===u,h=u.coordinateSystem;h&&h.master&&(h=h.master);var v=h&&s?h===s:f;if(!(r==="series"&&!f||r==="coordinateSystem"&&!v||e==="series"&&f)){var c=i.getViewOfSeriesModel(u);if(c.group.traverse(function(g){g.__highByOuter&&f&&e==="self"||Zd(g)}),ke(e))a(u.getData(),e);else if(rt(e))for(var d=mt(e),p=0;p<d.length;p++)a(u.getData(d[p]),e[d[p]]);l.push(u),Xd(u).isBlured=!0}}),n.eachComponent(function(u,f){if(u!=="series"){var h=i.getViewOfComponentModel(f);h&&h.toggleBlurSeries&&h.toggleBlurSeries(l,!0,n)}})}}function Dv(t,e,r){if(!(t==null||e==null)){var i=r.getModel().getComponent(t,e);if(i){Xd(i).isBlured=!0;var n=r.getViewOfComponentModel(i);!n||!n.focusBlurEnabled||n.group.traverse(function(a){Zd(a)})}}}function eM(t,e,r){var i=t.seriesIndex,n=t.getData(e.dataType);if(n){var a=qn(n,e);a=(j(a)?a[0]:a)||0;var o=n.getItemGraphicEl(a);if(!o)for(var s=n.count(),l=0;!o&&l<s;)o=n.getItemGraphicEl(l++);if(o){var u=Mt(o);Cv(i,u.focus,u.blurScope,r)}else{var f=t.get(["emphasis","focus"]),h=t.get(["emphasis","blurScope"]);f!=null&&Cv(i,f,h,r)}}}function qd(t,e,r,i){var n={focusSelf:!1,dispatchers:null};if(t==null||t==="series"||e==null||r==null)return n;var a=i.getModel().getComponent(t,e);if(!a)return n;var o=i.getViewOfComponentModel(a);if(!o||!o.findHighDownDispatchers)return n;for(var s=o.findHighDownDispatchers(r),l,u=0;u<s.length;u++)if(Mt(s[u]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function rM(t,e,r){var i=Mt(t),n=qd(i.componentMainType,i.componentIndex,i.componentHighDownName,r),a=n.dispatchers,o=n.focusSelf;a?(o&&Dv(i.componentMainType,i.componentIndex,r),C(a,function(s){return sm(s,e)})):(Cv(i.seriesIndex,i.focus,i.blurScope,r),i.focus==="self"&&Dv(i.componentMainType,i.componentIndex,r),sm(t,e))}function iM(t,e,r){Ix(r);var i=Mt(t),n=qd(i.componentMainType,i.componentIndex,i.componentHighDownName,r).dispatchers;n?C(n,function(a){return lm(a,e)}):lm(t,e)}function nM(t,e,r){if(Pv(e)){var i=e.dataType,n=t.getData(i),a=qn(n,e);j(a)||(a=[a]),t[e.type===ss?"toggleSelect":e.type===os?"select":"unselect"](a,i)}}function um(t){var e=t.getAllData();C(e,function(r){var i=r.data,n=r.type;i.eachItemGraphicEl(function(a,o){t.isSelected(o,n)?Lx(a):Rx(a)})})}function aM(t){var e=[];return t.eachSeries(function(r){var i=r.getAllData();C(i,function(n){n.data;var a=n.type,o=r.getSelectedDataIndices();if(o.length>0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function Nu(t,e,r){$d(t,!0),xi(t,JE),sM(t,e,r)}function oM(t){$d(t,!1)}function Lv(t,e,r,i){i?oM(t):Nu(t,e,r)}function sM(t,e,r){var i=Mt(t);e!=null?(i.focus=e,i.blurScope=r):i.focus&&(i.focus=null)}var fm=["emphasis","blur","select"],lM={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function hm(t,e,r,i){r=r||"itemStyle";for(var n=0;n<fm.length;n++){var a=fm[n],o=e.getModel([a,r]),s=t.ensureState(a);s.style=o[lM[r]]()}}function $d(t,e){var r=e===!1,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),(!r||i.__highDownDispatcher)&&(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!r)}function Rv(t){return!!(t&&t.__highDownDispatcher)}function uM(t){var e=nm[t];return e==null&&im<=32&&(e=nm[t]=im++),e}function Pv(t){var e=t.type;return e===os||e===su||e===ss}function cm(t){var e=t.type;return e===Wn||e===ou}function fM(t){var e=Ax(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var r=t.states.select||{};e.selectFill=r.style&&r.style.fill||null,e.selectStroke=r.style&&r.style.stroke||null}var ua=_i.CMD,hM=[[],[],[]],vm=Math.sqrt,cM=Math.atan2;function vM(t,e){if(e){var r=t.data,i=t.len(),n,a,o,s,l,u,f=ua.M,h=ua.C,v=ua.L,c=ua.R,d=ua.A,p=ua.Q;for(o=0,s=0;o<i;){switch(n=r[o++],s=o,a=0,n){case f:a=1;break;case v:a=1;break;case h:a=3;break;case p:a=2;break;case d:var g=e[4],m=e[5],_=vm(e[0]*e[0]+e[1]*e[1]),y=vm(e[2]*e[2]+e[3]*e[3]),x=cM(-e[1]/y,e[0]/_);r[o]*=_,r[o++]+=g,r[o]*=y,r[o++]+=m,r[o++]*=_,r[o++]*=y,r[o++]+=x,r[o++]+=x,o+=2,s=o;break;case c:u[0]=r[o++],u[1]=r[o++],_r(u,u,e),r[s++]=u[0],r[s++]=u[1],u[0]+=r[o++],u[1]+=r[o++],_r(u,u,e),r[s++]=u[0],r[s++]=u[1]}for(l=0;l<a;l++){var S=hM[l];S[0]=r[o++],S[1]=r[o++],_r(S,S,e),r[s++]=S[0],r[s++]=S[1]}}t.increaseVersion()}}var Fh=Math.sqrt,cl=Math.sin,vl=Math.cos,To=Math.PI;function dm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Iv(t,e){return(t[0]*e[0]+t[1]*e[1])/(dm(t)*dm(e))}function pm(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Iv(t,e))}function gm(t,e,r,i,n,a,o,s,l,u,f){var h=l*(To/180),v=vl(h)*(t-r)/2+cl(h)*(e-i)/2,c=-1*cl(h)*(t-r)/2+vl(h)*(e-i)/2,d=v*v/(o*o)+c*c/(s*s);d>1&&(o*=Fh(d),s*=Fh(d));var p=(n===a?-1:1)*Fh((o*o*(s*s)-o*o*(c*c)-s*s*(v*v))/(o*o*(c*c)+s*s*(v*v)))||0,g=p*o*c/s,m=p*-s*v/o,_=(t+r)/2+vl(h)*g-cl(h)*m,y=(e+i)/2+cl(h)*g+vl(h)*m,x=pm([1,0],[(v-g)/o,(c-m)/s]),S=[(v-g)/o,(c-m)/s],T=[(-1*v-g)/o,(-1*c-m)/s],w=pm(S,T);if(Iv(S,T)<=-1&&(w=To),Iv(S,T)>=1&&(w=0),w<0){var b=Math.round(w/To*1e6)/1e6;w=To*2+b%2*To}f.addData(u,_,y,o,s,x,w,h,a)}var dM=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,pM=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function gM(t){var e=new _i;if(!t)return e;var r=0,i=0,n=r,a=i,o,s=_i.CMD,l=t.match(dM);if(!l)return e;for(var u=0;u<l.length;u++){for(var f=l[u],h=f.charAt(0),v=void 0,c=f.match(pM)||[],d=c.length,p=0;p<d;p++)c[p]=parseFloat(c[p]);for(var g=0;g<d;){var m=void 0,_=void 0,y=void 0,x=void 0,S=void 0,T=void 0,w=void 0,b=r,A=i,M=void 0,E=void 0;switch(h){case"l":r+=c[g++],i+=c[g++],v=s.L,e.addData(v,r,i);break;case"L":r=c[g++],i=c[g++],v=s.L,e.addData(v,r,i);break;case"m":r+=c[g++],i+=c[g++],v=s.M,e.addData(v,r,i),n=r,a=i,h="l";break;case"M":r=c[g++],i=c[g++],v=s.M,e.addData(v,r,i),n=r,a=i,h="L";break;case"h":r+=c[g++],v=s.L,e.addData(v,r,i);break;case"H":r=c[g++],v=s.L,e.addData(v,r,i);break;case"v":i+=c[g++],v=s.L,e.addData(v,r,i);break;case"V":i=c[g++],v=s.L,e.addData(v,r,i);break;case"C":v=s.C,e.addData(v,c[g++],c[g++],c[g++],c[g++],c[g++],c[g++]),r=c[g-2],i=c[g-1];break;case"c":v=s.C,e.addData(v,c[g++]+r,c[g++]+i,c[g++]+r,c[g++]+i,c[g++]+r,c[g++]+i),r+=c[g-2],i+=c[g-1];break;case"S":m=r,_=i,M=e.len(),E=e.data,o===s.C&&(m+=r-E[M-4],_+=i-E[M-3]),v=s.C,b=c[g++],A=c[g++],r=c[g++],i=c[g++],e.addData(v,m,_,b,A,r,i);break;case"s":m=r,_=i,M=e.len(),E=e.data,o===s.C&&(m+=r-E[M-4],_+=i-E[M-3]),v=s.C,b=r+c[g++],A=i+c[g++],r+=c[g++],i+=c[g++],e.addData(v,m,_,b,A,r,i);break;case"Q":b=c[g++],A=c[g++],r=c[g++],i=c[g++],v=s.Q,e.addData(v,b,A,r,i);break;case"q":b=c[g++]+r,A=c[g++]+i,r+=c[g++],i+=c[g++],v=s.Q,e.addData(v,b,A,r,i);break;case"T":m=r,_=i,M=e.len(),E=e.data,o===s.Q&&(m+=r-E[M-4],_+=i-E[M-3]),r=c[g++],i=c[g++],v=s.Q,e.addData(v,m,_,r,i);break;case"t":m=r,_=i,M=e.len(),E=e.data,o===s.Q&&(m+=r-E[M-4],_+=i-E[M-3]),r+=c[g++],i+=c[g++],v=s.Q,e.addData(v,m,_,r,i);break;case"A":y=c[g++],x=c[g++],S=c[g++],T=c[g++],w=c[g++],b=r,A=i,r=c[g++],i=c[g++],v=s.A,gm(b,A,r,i,T,w,y,x,S,v,e);break;case"a":y=c[g++],x=c[g++],S=c[g++],T=c[g++],w=c[g++],b=r,A=i,r+=c[g++],i+=c[g++],v=s.A,gm(b,A,r,i,T,w,y,x,S,v,e);break}}(h==="z"||h==="Z")&&(v=s.Z,e.addData(v),r=n,i=a),o=v}return e.toStatic(),e}var Nx=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.applyTransform=function(r){},e}(kt);function Ox(t){return t.setData!=null}function Bx(t,e){var r=gM(t),i=Y({},e);return i.buildPath=function(n){if(Ox(n)){n.setData(r.data);var a=n.getContext();a&&n.rebuildPath(a,1)}else{var a=n;r.rebuildPath(a,1)}},i.applyTransform=function(n){vM(r,n),this.dirtyShape()},i}function mM(t,e){return new Nx(Bx(t,e))}function _M(t,e){var r=Bx(t,e),i=function(n){K(a,n);function a(o){var s=n.call(this,o)||this;return s.applyTransform=r.applyTransform,s.buildPath=r.buildPath,s}return a}(Nx);return i}function yM(t,e){for(var r=[],i=t.length,n=0;n<i;n++){var a=t[n];r.push(a.getUpdatedPathProxy(!0))}var o=new kt(e);return o.createPathProxy(),o.buildPath=function(s){if(Ox(s)){s.appendPath(r);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var xM=function(){function t(){this.cx=0,this.cy=0,this.r=0}return t}(),bf=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new xM},e.prototype.buildPath=function(r,i){r.moveTo(i.cx+i.r,i.cy),r.arc(i.cx,i.cy,i.r,0,Math.PI*2)},e}(kt);bf.prototype.type="circle";var TM=function(){function t(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return t}(),Kd=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new TM},e.prototype.buildPath=function(r,i){var n=.5522848,a=i.cx,o=i.cy,s=i.rx,l=i.ry,u=s*n,f=l*n;r.moveTo(a-s,o),r.bezierCurveTo(a-s,o-f,a-u,o-l,a,o-l),r.bezierCurveTo(a+u,o-l,a+s,o-f,a+s,o),r.bezierCurveTo(a+s,o+f,a+u,o+l,a,o+l),r.bezierCurveTo(a-u,o+l,a-s,o+f,a-s,o),r.closePath()},e}(kt);Kd.prototype.type="ellipse";var Fx=Math.PI,kh=Fx*2,vn=Math.sin,fa=Math.cos,SM=Math.acos,we=Math.atan2,mm=Math.abs,ls=Math.sqrt,$o=Math.max,Wr=Math.min,Cr=1e-4;function wM(t,e,r,i,n,a,o,s){var l=r-t,u=i-e,f=o-n,h=s-a,v=h*l-f*u;if(!(v*v<Cr))return v=(f*(e-a)-h*(t-n))/v,[t+v*l,e+v*u]}function dl(t,e,r,i,n,a,o){var s=t-r,l=e-i,u=(o?a:-a)/ls(s*s+l*l),f=u*l,h=-u*s,v=t+f,c=e+h,d=r+f,p=i+h,g=(v+d)/2,m=(c+p)/2,_=d-v,y=p-c,x=_*_+y*y,S=n-a,T=v*p-d*c,w=(y<0?-1:1)*ls($o(0,S*S*x-T*T)),b=(T*y-_*w)/x,A=(-T*_-y*w)/x,M=(T*y+_*w)/x,E=(-T*_+y*w)/x,D=b-g,R=A-m,P=M-g,I=E-m;return D*D+R*R>P*P+I*I&&(b=M,A=E),{cx:b,cy:A,x0:-f,y0:-h,x1:b*(n/S-1),y1:A*(n/S-1)}}function bM(t){var e;if(j(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function AM(t,e){var r,i=$o(e.r,0),n=$o(e.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var f=e.cx,h=e.cy,v=!!e.clockwise,c=mm(u-l),d=c>kh&&c%kh;if(d>Cr&&(c=d),!(i>Cr))t.moveTo(f,h);else if(c>kh-Cr)t.moveTo(f+i*fa(l),h+i*vn(l)),t.arc(f,h,i,l,u,!v),n>Cr&&(t.moveTo(f+n*fa(u),h+n*vn(u)),t.arc(f,h,n,u,l,v));else{var p=void 0,g=void 0,m=void 0,_=void 0,y=void 0,x=void 0,S=void 0,T=void 0,w=void 0,b=void 0,A=void 0,M=void 0,E=void 0,D=void 0,R=void 0,P=void 0,I=i*fa(l),N=i*vn(l),V=n*fa(u),O=n*vn(u),X=c>Cr;if(X){var G=e.cornerRadius;G&&(r=bM(G),p=r[0],g=r[1],m=r[2],_=r[3]);var lt=mm(i-n)/2;if(y=Wr(lt,m),x=Wr(lt,_),S=Wr(lt,p),T=Wr(lt,g),A=w=$o(y,x),M=b=$o(S,T),(w>Cr||b>Cr)&&(E=i*fa(u),D=i*vn(u),R=n*fa(l),P=n*vn(l),c<Fx)){var J=wM(I,N,R,P,E,D,V,O);if(J){var ot=I-J[0],at=N-J[1],Dt=E-J[0],pt=D-J[1],Ot=1/vn(SM((ot*Dt+at*pt)/(ls(ot*ot+at*at)*ls(Dt*Dt+pt*pt)))/2),Ht=ls(J[0]*J[0]+J[1]*J[1]);A=Wr(w,(i-Ht)/(Ot+1)),M=Wr(b,(n-Ht)/(Ot-1))}}}if(!X)t.moveTo(f+I,h+N);else if(A>Cr){var Nt=Wr(m,A),wt=Wr(_,A),et=dl(R,P,I,N,i,Nt,v),xt=dl(E,D,V,O,i,wt,v);t.moveTo(f+et.cx+et.x0,h+et.cy+et.y0),A<w&&Nt===wt?t.arc(f+et.cx,h+et.cy,A,we(et.y0,et.x0),we(xt.y0,xt.x0),!v):(Nt>0&&t.arc(f+et.cx,h+et.cy,Nt,we(et.y0,et.x0),we(et.y1,et.x1),!v),t.arc(f,h,i,we(et.cy+et.y1,et.cx+et.x1),we(xt.cy+xt.y1,xt.cx+xt.x1),!v),wt>0&&t.arc(f+xt.cx,h+xt.cy,wt,we(xt.y1,xt.x1),we(xt.y0,xt.x0),!v))}else t.moveTo(f+I,h+N),t.arc(f,h,i,l,u,!v);if(!(n>Cr)||!X)t.lineTo(f+V,h+O);else if(M>Cr){var Nt=Wr(p,M),wt=Wr(g,M),et=dl(V,O,E,D,n,-wt,v),xt=dl(I,N,R,P,n,-Nt,v);t.lineTo(f+et.cx+et.x0,h+et.cy+et.y0),M<b&&Nt===wt?t.arc(f+et.cx,h+et.cy,M,we(et.y0,et.x0),we(xt.y0,xt.x0),!v):(wt>0&&t.arc(f+et.cx,h+et.cy,wt,we(et.y0,et.x0),we(et.y1,et.x1),!v),t.arc(f,h,n,we(et.cy+et.y1,et.cx+et.x1),we(xt.cy+xt.y1,xt.cx+xt.x1),v),Nt>0&&t.arc(f+xt.cx,h+xt.cy,Nt,we(xt.y1,xt.x1),we(xt.y0,xt.x0),!v))}else t.lineTo(f+V,h+O),t.arc(f,h,n,u,l,v)}t.closePath()}}}var EM=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t}(),Af=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new EM},e.prototype.buildPath=function(r,i){AM(r,i)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(kt);Af.prototype.type="sector";var MM=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),jd=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new MM},e.prototype.buildPath=function(r,i){var n=i.cx,a=i.cy,o=Math.PI*2;r.moveTo(n+i.r,a),r.arc(n,a,i.r,0,o,!1),r.moveTo(n+i.r0,a),r.arc(n,a,i.r0,0,o,!0)},e}(kt);jd.prototype.type="ring";function CM(t,e,r,i){var n=[],a=[],o=[],s=[],l,u,f,h;if(i){f=[1/0,1/0],h=[-1/0,-1/0];for(var v=0,c=t.length;v<c;v++)Pa(f,f,t[v]),Ia(h,h,t[v]);Pa(f,f,i[0]),Ia(h,h,i[1])}for(var v=0,c=t.length;v<c;v++){var d=t[v];if(r)l=t[v?v-1:c-1],u=t[(v+1)%c];else if(v===0||v===c-1){n.push(sb(t[v]));continue}else l=t[v-1],u=t[v+1];lb(a,u,l),Jf(a,a,e);var p=av(d,l),g=av(d,u),m=p+g;m!==0&&(p/=m,g/=m),Jf(o,a,-p),Jf(s,a,g);var _=sg([],d,o),y=sg([],d,s);i&&(Ia(_,_,f),Pa(_,_,h),Ia(y,y,f),Pa(y,y,h)),n.push(_),n.push(y)}return r&&n.push(n.shift()),n}function kx(t,e,r){var i=e.smooth,n=e.points;if(n&&n.length>=2){if(i){var a=CM(n,i,r,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],f=n[(s+1)%o];t.bezierCurveTo(l[0],l[1],u[0],u[1],f[0],f[1])}}else{t.moveTo(n[0][0],n[0][1]);for(var s=1,h=n.length;s<h;s++)t.lineTo(n[s][0],n[s][1])}r&&t.closePath()}}var DM=function(){function t(){this.points=null,this.smooth=0,this.smoothConstraint=null}return t}(),Gs=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new DM},e.prototype.buildPath=function(r,i){kx(r,i,!0)},e}(kt);Gs.prototype.type="polygon";var LM=function(){function t(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return t}(),Ws=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new LM},e.prototype.buildPath=function(r,i){kx(r,i,!1)},e}(kt);Ws.prototype.type="polyline";var RM={},PM=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return t}(),qi=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new PM},e.prototype.buildPath=function(r,i){var n,a,o,s;if(this.subPixelOptimize){var l=xx(RM,i,this.style);n=l.x1,a=l.y1,o=l.x2,s=l.y2}else n=i.x1,a=i.y1,o=i.x2,s=i.y2;var u=i.percent;u!==0&&(r.moveTo(n,a),u<1&&(o=n*(1-u)+o*u,s=a*(1-u)+s*u),r.lineTo(o,s))},e.prototype.pointAt=function(r){var i=this.shape;return[i.x1*(1-r)+i.x2*r,i.y1*(1-r)+i.y2*r]},e}(kt);qi.prototype.type="line";var Ge=[],IM=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return t}();function _m(t,e,r){var i=t.cpx2,n=t.cpy2;return i!=null||n!=null?[(r?yg:ce)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?yg:ce)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?xg:Ae)(t.x1,t.cpx1,t.x2,e),(r?xg:Ae)(t.y1,t.cpy1,t.y2,e)]}var Qd=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new IM},e.prototype.buildPath=function(r,i){var n=i.x1,a=i.y1,o=i.x2,s=i.y2,l=i.cpx1,u=i.cpy1,f=i.cpx2,h=i.cpy2,v=i.percent;v!==0&&(r.moveTo(n,a),f==null||h==null?(v<1&&(bu(n,l,o,v,Ge),l=Ge[1],o=Ge[2],bu(a,u,s,v,Ge),u=Ge[1],s=Ge[2]),r.quadraticCurveTo(l,u,o,s)):(v<1&&(wu(n,l,f,o,v,Ge),l=Ge[1],f=Ge[2],o=Ge[3],wu(a,u,h,s,v,Ge),u=Ge[1],h=Ge[2],s=Ge[3]),r.bezierCurveTo(l,u,f,h,o,s)))},e.prototype.pointAt=function(r){return _m(this.shape,r,!1)},e.prototype.tangentAt=function(r){var i=_m(this.shape,r,!0);return hb(i,i)},e}(kt);Qd.prototype.type="bezier-curve";var NM=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t}(),Ef=function(t){K(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new NM},e.prototype.buildPath=function(r,i){var n=i.cx,a=i.cy,o=Math.max(i.r,0),s=i.startAngle,l=i.endAngle,u=i.clockwise,f=Math.cos(s),h=Math.sin(s);r.moveTo(f*o+n,h*o+a),r.arc(n,a,o,s,l,!u)},e}(kt);Ef.prototype.type="arc";var OM=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="compound",r}return e.prototype._updatePathDirty=function(){for(var r=this.shape.paths,i=this.shapeChanged(),n=0;n<r.length;n++)i=i||r[n].shapeChanged();i&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var r=this.shape.paths||[],i=this.getGlobalScale(),n=0;n<r.length;n++)r[n].path||r[n].createPathProxy(),r[n].path.setScale(i[0],i[1],r[n].segmentIgnoreThreshold)},e.prototype.buildPath=function(r,i){for(var n=i.paths||[],a=0;a<n.length;a++)n[a].buildPath(r,n[a].shape,!0)},e.prototype.afterBrush=function(){for(var r=this.shape.paths||[],i=0;i<r.length;i++)r[i].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),kt.prototype.getBoundingRect.call(this)},e}(kt);const zx=OM;var Ux=function(){function t(e){this.colorStops=e||[]}return t.prototype.addColorStop=function(e,r){this.colorStops.push({offset:e,color:r})},t}(),Jd=function(t){K(e,t);function e(r,i,n,a,o,s){var l=t.call(this,o)||this;return l.x=r??0,l.y=i??0,l.x2=n??1,l.y2=a??0,l.type="linear",l.global=s||!1,l}return e}(Ux),BM=function(t){K(e,t);function e(r,i,n,a,o){var s=t.call(this,a)||this;return s.x=r??.5,s.y=i??.5,s.r=n??.5,s.type="radial",s.global=o||!1,s}return e}(Ux);const FM=BM;var dn=[0,0],pn=[0,0],pl=new yt,gl=new yt,kM=function(){function t(e,r){this._corners=[],this._axes=[],this._origin=[0,0];for(var i=0;i<4;i++)this._corners[i]=new yt;for(var i=0;i<2;i++)this._axes[i]=new yt;e&&this.fromBoundingRect(e,r)}return t.prototype.fromBoundingRect=function(e,r){var i=this._corners,n=this._axes,a=e.x,o=e.y,s=a+e.width,l=o+e.height;if(i[0].set(a,o),i[1].set(s,o),i[2].set(s,l),i[3].set(a,l),r)for(var u=0;u<4;u++)i[u].transform(r);yt.sub(n[0],i[1],i[0]),yt.sub(n[1],i[3],i[0]),n[0].normalize(),n[1].normalize();for(var u=0;u<2;u++)this._origin[u]=n[u].dot(i[0])},t.prototype.intersect=function(e,r){var i=!0,n=!r;return pl.set(1/0,1/0),gl.set(0,0),!this._intersectCheckOneSide(this,e,pl,gl,n,1)&&(i=!1,n)||!this._intersectCheckOneSide(e,this,pl,gl,n,-1)&&(i=!1,n)||n||yt.copy(r,i?pl:gl),i},t.prototype._intersectCheckOneSide=function(e,r,i,n,a,o){for(var s=!0,l=0;l<2;l++){var u=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,dn),this._getProjMinMaxOnAxis(l,r._corners,pn),dn[1]<pn[0]||dn[0]>pn[1]){if(s=!1,a)return s;var f=Math.abs(pn[0]-dn[1]),h=Math.abs(dn[0]-pn[1]);Math.min(f,h)>n.len()&&(f<h?yt.scale(n,u,-f*o):yt.scale(n,u,h*o))}else if(i){var f=Math.abs(pn[0]-dn[1]),h=Math.abs(dn[0]-pn[1]);Math.min(f,h)<i.len()&&(f<h?yt.scale(i,u,f*o):yt.scale(i,u,-h*o))}}return s},t.prototype._getProjMinMaxOnAxis=function(e,r,i){for(var n=this._axes[e],a=this._origin,o=r[0].dot(n)+a[e],s=o,l=o,u=1;u<r.length;u++){var f=r[u].dot(n)+a[e];s=Math.min(f,s),l=Math.max(f,l)}i[0]=s,i[1]=l},t}();const Ou=kM;var zM=[],UM=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.notClear=!0,r.incremental=!0,r._displayables=[],r._temporaryDisplayables=[],r._cursor=0,r}return e.prototype.traverse=function(r,i){r.call(i,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(r,i){i?this._temporaryDisplayables.push(r):this._displayables.push(r),this.markRedraw()},e.prototype.addDisplayables=function(r,i){i=i||!1;for(var n=0;n<r.length;n++)this.addDisplayable(r[n],i)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(r){for(var i=this._cursor;i<this._displayables.length;i++)r&&r(this._displayables[i]);for(var i=0;i<this._temporaryDisplayables.length;i++)r&&r(this._temporaryDisplayables[i])},e.prototype.update=function(){this.updateTransform();for(var r=this._cursor;r<this._displayables.length;r++){var i=this._displayables[r];i.parent=this,i.update(),i.parent=null}for(var r=0;r<this._temporaryDisplayables.length;r++){var i=this._temporaryDisplayables[r];i.parent=this,i.update(),i.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var r=new Pt(1/0,1/0,-1/0,-1/0),i=0;i<this._displayables.length;i++){var n=this._displayables[i],a=n.getBoundingRect().clone();n.needLocalTransform()&&a.applyTransform(n.getLocalTransform(zM)),r.union(a)}this._rect=r}return this._rect},e.prototype.contain=function(r,i){var n=this.transformCoordToLocal(r,i),a=this.getBoundingRect();if(a.contain(n[0],n[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(r,i))return!0}return!1},e}(Jn);const HM=UM;var VM=Yt();function tp(t,e,r,i,n){var a;if(e&&e.ecModel){var o=e.ecModel.getUpdatePayload();a=o&&o.animation}var s=e&&e.isAnimationEnabled(),l=t==="update";if(s){var u=void 0,f=void 0,h=void 0;i?(u=ft(i.duration,200),f=ft(i.easing,"cubicOut"),h=0):(u=e.getShallow(l?"animationDurationUpdate":"animationDuration"),f=e.getShallow(l?"animationEasingUpdate":"animationEasing"),h=e.getShallow(l?"animationDelayUpdate":"animationDelay")),a&&(a.duration!=null&&(u=a.duration),a.easing!=null&&(f=a.easing),a.delay!=null&&(h=a.delay)),ct(h)&&(h=h(r,n)),ct(u)&&(u=u(r));var v={duration:u||0,delay:h,easing:f};return v}else return null}function ep(t,e,r,i,n,a,o){var s=!1,l;ct(n)?(o=a,a=n,n=null):rt(n)&&(a=n.cb,o=n.during,s=n.isFrom,l=n.removeOpt,n=n.dataIndex);var u=t==="leave";u||e.stopAnimation("leave");var f=tp(t,i,n,u?l||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(e,n):null);if(f&&f.duration>0){var h=f.duration,v=f.delay,c=f.easing,d={duration:h,delay:v||0,easing:c,done:a,force:!!a||!!o,setToFinal:!u,scope:t,during:o};s?e.animateFrom(r,d):e.animateTo(r,d)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),a&&a()}function Sr(t,e,r,i,n,a){ep("update",t,e,r,i,n,a)}function $i(t,e,r,i,n,a){ep("enter",t,e,r,i,n,a)}function Xa(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){var r=t.animators[e];if(r.scope==="leave")return!0}return!1}function Bu(t,e,r,i,n,a){Xa(t)||ep("leave",t,e,r,i,n,a)}function ym(t,e,r,i){t.removeTextContent(),t.removeTextGuideLine(),Bu(t,{style:{opacity:0}},e,r,i)}function GM(t,e,r){function i(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(n){n.isGroup||ym(n,e,r,i)}):ym(t,e,r,i)}function WM(t){VM(t).oldStyle=t.style}var Fu=Math.max,ku=Math.min,Nv={};function XM(t){return kt.extend(t)}var YM=_M;function ZM(t,e){return YM(t,e)}function Ur(t,e){Nv[t]=e}function Hx(t){if(Nv.hasOwnProperty(t))return Nv[t]}function rp(t,e,r,i){var n=mM(t,e);return r&&(i==="center"&&(r=Gx(r,n.getBoundingRect())),Wx(n,r)),n}function Vx(t,e,r){var i=new ir({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(n){if(r==="center"){var a={width:n.width,height:n.height};i.setStyle(Gx(e,a))}}});return i}function Gx(t,e){var r=e.width/e.height,i=t.height*r,n;i<=t.width?n=t.height:(i=t.width,n=i/r);var a=t.x+t.width/2,o=t.y+t.height/2;return{x:a-i/2,y:o-n/2,width:i,height:n}}var qM=yM;function Wx(t,e){if(t.applyTransform){var r=t.getBoundingRect(),i=r.calculateTransform(e);t.applyTransform(i)}}function ws(t,e){return xx(t,t,{lineWidth:e}),t}function $M(t){return Tx(t.shape,t.shape,t.style),t}var KM=Bn;function us(t,e){for(var r=Nd([]);t&&t!==e;)Ga(r,t.getLocalTransform(),r),t=t.parent;return r}function Wi(t,e,r){return e&&!ke(e)&&(e=pf.getLocalTransform(e)),r&&(e=cf([],e)),_r([],t,e)}function ip(t,e,r){var i=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),n=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),a=[t==="left"?-i:t==="right"?i:0,t==="top"?-n:t==="bottom"?n:0];return a=Wi(a,e,r),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function xm(t){return!t.isGroup}function jM(t){return t.shape!=null}function Xx(t,e,r){if(!t||!e)return;function i(o){var s={};return o.traverse(function(l){xm(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return jM(o)&&(s.shape=Y({},o.shape)),s}var a=i(t);e.traverse(function(o){if(xm(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Sr(o,l,r,Mt(o).dataIndex)}}})}function QM(t,e){return tt(t,function(r){var i=r[0];i=Fu(i,e.x),i=ku(i,e.x+e.width);var n=r[1];return n=Fu(n,e.y),n=ku(n,e.y+e.height),[i,n]})}function JM(t,e){var r=Fu(t.x,e.x),i=ku(t.x+t.width,e.x+e.width),n=Fu(t.y,e.y),a=ku(t.y+t.height,e.y+e.height);if(i>=r&&a>=n)return{x:r,y:n,width:i-r,height:a-n}}function np(t,e,r){var i=Y({rectHover:!0},e),n=i.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(n.image=t.slice(8),Et(n,r),new ir(i)):rp(t.replace("path://",""),i,r,"center")}function tC(t,e,r,i,n){for(var a=0,o=n[n.length-1];a<n.length;a++){var s=n[a];if(Yx(t,e,r,i,s[0],s[1],o[0],o[1]))return!0;o=s}}function Yx(t,e,r,i,n,a,o,s){var l=r-t,u=i-e,f=o-n,h=s-a,v=zh(f,h,l,u);if(eC(v))return!1;var c=t-n,d=e-a,p=zh(c,d,l,u)/v;if(p<0||p>1)return!1;var g=zh(c,d,f,h)/v;return!(g<0||g>1)}function zh(t,e,r,i){return t*i-r*e}function eC(t){return t<=1e-6&&t>=-1e-6}function Mf(t){var e=t.itemTooltipOption,r=t.componentModel,i=t.itemName,n=Q(e)?{formatter:e}:e,a=r.mainType,o=r.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=t.formatterParamsExtra;l&&C(mt(l),function(f){gt(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=Mt(t.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:Et({content:i,encodeHTMLContent:!0,formatterParams:s},n)}}function Tm(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function ap(t,e){if(t)if(j(t))for(var r=0;r<t.length;r++)Tm(t[r],e);else Tm(t,e)}Ur("circle",bf);Ur("ellipse",Kd);Ur("sector",Af);Ur("ring",jd);Ur("polygon",Gs);Ur("polyline",Ws);Ur("rect",Kt);Ur("line",qi);Ur("bezierCurve",Qd);Ur("arc",Ef);const rC=Object.freeze(Object.defineProperty({__proto__:null,Arc:Ef,BezierCurve:Qd,BoundingRect:Pt,Circle:bf,CompoundPath:zx,Ellipse:Kd,Group:ee,Image:ir,IncrementalDisplayable:HM,Line:qi,LinearGradient:Jd,OrientedBoundingRect:Ou,Path:kt,Point:yt,Polygon:Gs,Polyline:Ws,RadialGradient:FM,Rect:Kt,Ring:jd,Sector:Af,Text:Xt,applyTransform:Wi,clipPointsByRect:QM,clipRectByRect:JM,createIcon:np,extendPath:ZM,extendShape:XM,getShapeClass:Hx,getTransform:us,groupTransition:Xx,initProps:$i,isElementRemoved:Xa,lineLineIntersect:Yx,linePolygonIntersect:tC,makeImage:Vx,makePath:rp,mergePath:qM,registerShape:Ur,removeElement:Bu,removeElementWithFadeOut:GM,resizePath:Wx,setTooltipConfig:Mf,subPixelOptimize:KM,subPixelOptimizeLine:ws,subPixelOptimizeRect:$M,transformDirection:ip,traverseElements:ap,updateProps:Sr},Symbol.toStringTag,{value:"Module"}));var Cf={};function Zx(t,e){for(var r=0;r<Tr.length;r++){var i=Tr[r],n=e[i],a=t.ensureState(i);a.style=a.style||{},a.style.text=n}var o=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(o,!0)}function Ov(t,e,r){var i=t.labelFetcher,n=t.labelDataIndex,a=t.labelDimIndex,o=e.normal,s;i&&(s=i.getFormattedLabel(n,"normal",null,a,o&&o.get("formatter"),r!=null?{interpolatedValue:r}:null)),s==null&&(s=ct(t.defaultText)?t.defaultText(n,t,r):t.defaultText);for(var l={normal:s},u=0;u<Tr.length;u++){var f=Tr[u],h=e[f];l[f]=ft(i?i.getFormattedLabel(n,f,null,a,h&&h.get("formatter")):null,s)}return l}function op(t,e,r,i){r=r||Cf;for(var n=t instanceof Xt,a=!1,o=0;o<Ru.length;o++){var s=e[Ru[o]];if(s&&s.getShallow("show")){a=!0;break}}var l=n?t:t.getTextContent();if(a){n||(l||(l=new Xt,t.setTextContent(l)),t.stateProxy&&(l.stateProxy=t.stateProxy));var u=Ov(r,e),f=e.normal,h=!!f.getShallow("show"),v=qe(f,i&&i.normal,r,!1,!n);v.text=u.normal,n||t.setTextConfig(Sm(f,r,!1));for(var o=0;o<Tr.length;o++){var c=Tr[o],s=e[c];if(s){var d=l.ensureState(c),p=!!ft(s.getShallow("show"),h);if(p!==h&&(d.ignore=!p),d.style=qe(s,i&&i[c],r,!0,!n),d.style.text=u[c],!n){var g=t.ensureState(c);g.textConfig=Sm(s,r,!0)}}}l.silent=!!f.getShallow("silent"),l.style.x!=null&&(v.x=l.style.x),l.style.y!=null&&(v.y=l.style.y),l.ignore=!h,l.useStyle(v),l.dirty(),r.enableTextSetter&&(Df(l).setLabelText=function(m){var _=Ov(r,e,m);Zx(l,_)})}else l&&(l.ignore=!0);t.dirty()}function sp(t,e){e=e||"label";for(var r={normal:t.getModel(e)},i=0;i<Tr.length;i++){var n=Tr[i];r[n]=t.getModel([n,e])}return r}function qe(t,e,r,i,n){var a={};return iC(a,t,r,i,n),e&&Y(a,e),a}function Sm(t,e,r){e=e||{};var i={},n,a=t.getShallow("rotate"),o=ft(t.getShallow("distance"),r?null:5),s=t.getShallow("offset");return n=t.getShallow("position")||(r?null:"inside"),n==="outside"&&(n=e.defaultOutsidePosition||"top"),n!=null&&(i.position=n),s!=null&&(i.offset=s),a!=null&&(a*=Math.PI/180,i.rotation=a),o!=null&&(i.distance=o),i.outsideFill=t.get("color")==="inherit"?e.inheritColor||null:"auto",i}function iC(t,e,r,i,n){r=r||Cf;var a=e.ecModel,o=a&&a.option.textStyle,s=nC(e),l;if(s){l={};for(var u in s)if(s.hasOwnProperty(u)){var f=e.getModel(["rich",u]);Em(l[u]={},f,o,r,i,n,!1,!0)}}l&&(t.rich=l);var h=e.get("overflow");h&&(t.overflow=h);var v=e.get("minMargin");v!=null&&(t.margin=v),Em(t,e,o,r,i,n,!0,!1)}function nC(t){for(var e;t&&t!==t.ecModel;){var r=(t.option||Cf).rich;if(r){e=e||{};for(var i=mt(r),n=0;n<i.length;n++){var a=i[n];e[a]=1}}t=t.parentModel}return e}var wm=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],bm=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Am=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function Em(t,e,r,i,n,a,o,s){r=!n&&r||Cf;var l=i&&i.inheritColor,u=e.getShallow("color"),f=e.getShallow("textBorderColor"),h=ft(e.getShallow("opacity"),r.opacity);(u==="inherit"||u==="auto")&&(l?u=l:u=null),(f==="inherit"||f==="auto")&&(l?f=l:f=null),a||(u=u||r.color,f=f||r.textBorderColor),u!=null&&(t.fill=u),f!=null&&(t.stroke=f);var v=ft(e.getShallow("textBorderWidth"),r.textBorderWidth);v!=null&&(t.lineWidth=v);var c=ft(e.getShallow("textBorderType"),r.textBorderType);c!=null&&(t.lineDash=c);var d=ft(e.getShallow("textBorderDashOffset"),r.textBorderDashOffset);d!=null&&(t.lineDashOffset=d),!n&&h==null&&!s&&(h=i&&i.defaultOpacity),h!=null&&(t.opacity=h),!n&&!a&&t.fill==null&&i.inheritColor&&(t.fill=i.inheritColor);for(var p=0;p<wm.length;p++){var g=wm[p],m=ft(e.getShallow(g),r[g]);m!=null&&(t[g]=m)}for(var p=0;p<bm.length;p++){var g=bm[p],m=e.getShallow(g);m!=null&&(t[g]=m)}if(t.verticalAlign==null){var _=e.getShallow("baseline");_!=null&&(t.verticalAlign=_)}if(!o||!i.disableBox){for(var p=0;p<Am.length;p++){var g=Am[p],m=e.getShallow(g);m!=null&&(t[g]=m)}var y=e.getShallow("borderType");y!=null&&(t.borderDash=y),(t.backgroundColor==="auto"||t.backgroundColor==="inherit")&&l&&(t.backgroundColor=l),(t.borderColor==="auto"||t.borderColor==="inherit")&&l&&(t.borderColor=l)}}function aC(t,e){var r=e&&e.getModel("textStyle");return jr([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))}var Df=Yt();function oC(t,e,r,i,n){var a=Df(t);if(!a.valueAnimation||a.prevValue===a.value)return;var o=a.defaultInterpolatedText,s=ft(a.interpolatedValue,a.prevValue),l=a.value;function u(f){var h=vx(r,a.precision,s,l,f);a.interpolatedValue=f===1?null:h;var v=Ov({labelDataIndex:e,labelFetcher:n,defaultText:o?o(h):h+""},a.statesModels,h);Zx(t,v)}t.percent=0,(a.prevValue==null?$i:Sr)(t,{percent:1},i,e,null,u)}var sC=["textStyle","color"],Uh=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Hh=new Xt,lC=function(){function t(){}return t.prototype.getTextColor=function(e){var r=this.ecModel;return this.getShallow("color")||(!e&&r?r.get(sC):null)},t.prototype.getFont=function(){return aC({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(e){for(var r={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},i=0;i<Uh.length;i++)r[Uh[i]]=this.getShallow(Uh[i]);return Hh.useStyle(r),Hh.update(),Hh.getBoundingRect()},t}(),qx=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],uC=Ts(qx),fC=function(){function t(){}return t.prototype.getLineStyle=function(e){return uC(this,e)},t}(),$x=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],hC=Ts($x),cC=function(){function t(){}return t.prototype.getItemStyle=function(e,r){return hC(this,e,r)},t}(),Zt=function(){function t(e,r,i){this.parentModel=r,this.ecModel=i,this.option=e}return t.prototype.init=function(e,r,i){},t.prototype.mergeOption=function(e,r){dt(this.option,e,!0)},t.prototype.get=function(e,r){return e==null?this.option:this._doGet(this.parsePath(e),!r&&this.parentModel)},t.prototype.getShallow=function(e,r){var i=this.option,n=i==null?i:i[e];if(n==null&&!r){var a=this.parentModel;a&&(n=a.getShallow(e))}return n},t.prototype.getModel=function(e,r){var i=e!=null,n=i?this.parsePath(e):null,a=i?this._doGet(n):this.option;return r=r||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(n)),new t(a,r,this.ecModel)},t.prototype.isEmpty=function(){return this.option==null},t.prototype.restoreData=function(){},t.prototype.clone=function(){var e=this.constructor;return new e(ut(this.option))},t.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},t.prototype.resolveParentPath=function(e){return e},t.prototype.isAnimationEnabled=function(){if(!vt.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(e,r){var i=this.option;if(!e)return i;for(var n=0;n<e.length&&!(e[n]&&(i=i&&typeof i=="object"?i[e[n]]:null,i==null));n++);return i==null&&r&&(i=r._doGet(this.resolveParentPath(e),r.parentModel)),i},t}();Gd(Zt);JA(Zt);kr(Zt,fC);kr(Zt,cC);kr(Zt,nE);kr(Zt,lC);var vC=Math.round(Math.random()*10);function Lf(t){return[t||"",vC++].join("_")}function dC(t){var e={};t.registerSubTypeDefaulter=function(r,i){var n=Qr(r);e[n.main]=i},t.determineSubType=function(r,i){var n=i.type;if(!n){var a=Qr(r).main;t.hasSubTypes(r)&&e[a]&&(n=e[a](i))}return n}}function pC(t,e){t.topologicalTravel=function(a,o,s,l){if(!a.length)return;var u=r(o),f=u.graph,h=u.noEntryList,v={};for(C(a,function(_){v[_]=!0});h.length;){var c=h.pop(),d=f[c],p=!!v[c];p&&(s.call(l,c,d.originalDeps.slice()),delete v[c]),C(d.successor,p?m:g)}C(v,function(){var _="";throw new Error(_)});function g(_){f[_].entryCount--,f[_].entryCount===0&&h.push(_)}function m(_){v[_]=!0,g(_)}};function r(a){var o={},s=[];return C(a,function(l){var u=i(o,l),f=u.originalDeps=e(l),h=n(f,a);u.entryCount=h.length,u.entryCount===0&&s.push(l),C(h,function(v){bt(u.predecessor,v)<0&&u.predecessor.push(v);var c=i(o,v);bt(c.successor,v)<0&&c.successor.push(l)})}),{graph:o,noEntryList:s}}function i(a,o){return a[o]||(a[o]={predecessor:[],successor:[]}),a[o]}function n(a,o){var s=[];return C(a,function(l){bt(o,l)>=0&&s.push(l)}),s}}function Xs(t,e){return dt(dt({},t,!0),e,!0)}const gC={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},mC={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},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:"旭日图",custom:"自定义图表",chart:"图表"}},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:""}}}};var zu="ZH",lp="EN",Ya=lp,lu={},up={},Kx=vt.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||Ya).toUpperCase();return t.indexOf(zu)>-1?zu:Ya}():Ya;function jx(t,e){t=t.toUpperCase(),up[t]=new Zt(e),lu[t]=e}function _C(t){if(Q(t)){var e=lu[t.toUpperCase()]||{};return t===zu||t===lp?ut(e):dt(ut(e),ut(lu[Ya]),!1)}else return dt(ut(t),ut(lu[Ya]),!1)}function yC(t){return up[t]}function xC(){return up[Ya]}jx(lp,gC);jx(zu,mC);var fp=1e3,hp=fp*60,fs=hp*60,gr=fs*24,Mm=gr*365,Ko={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},ml="{yyyy}-{MM}-{dd}",Cm={year:"{yyyy}",month:"{yyyy}-{MM}",day:ml,hour:ml+" "+Ko.hour,minute:ml+" "+Ko.minute,second:ml+" "+Ko.second,millisecond:Ko.none},Vh=["year","month","day","hour","minute","second","millisecond"],Qx=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Ie(t,e){return t+="","0000".substr(0,e-t.length)+t}function Za(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function TC(t){return t===Za(t)}function SC(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Rf(t,e,r,i){var n=ni(t),a=n[cp(r)](),o=n[qa(r)]()+1,s=Math.floor((o-1)/3)+1,l=n[Pf(r)](),u=n["get"+(r?"UTC":"")+"Day"](),f=n[bs(r)](),h=(f-1)%12+1,v=n[If(r)](),c=n[Nf(r)](),d=n[Of(r)](),p=f>=12?"pm":"am",g=p.toUpperCase(),m=i instanceof Zt?i:yC(i||Kx)||xC(),_=m.getModel("time"),y=_.get("month"),x=_.get("monthAbbr"),S=_.get("dayOfWeek"),T=_.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,p+"").replace(/{A}/g,g+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Ie(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,Ie(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Ie(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[u]).replace(/{ee}/g,T[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Ie(f,2)).replace(/{H}/g,f+"").replace(/{hh}/g,Ie(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,Ie(v,2)).replace(/{m}/g,v+"").replace(/{ss}/g,Ie(c,2)).replace(/{s}/g,c+"").replace(/{SSS}/g,Ie(d,3)).replace(/{S}/g,d+"")}function wC(t,e,r,i,n){var a=null;if(Q(r))a=r;else if(ct(r))a=r(t.value,e,{level:t.level});else{var o=Y({},Ko);if(t.level>0)for(var s=0;s<Vh.length;++s)o[Vh[s]]="{primary|"+o[Vh[s]]+"}";var l=r?r.inherit===!1?r:Et(r,o):o,u=Jx(t.value,n);if(l[u])a=l[u];else if(l.inherit){for(var f=Qx.indexOf(u),s=f-1;s>=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(j(a)){var h=t.level==null?0:t.level>=0?t.level:a.length+t.level;h=Math.min(h,a.length-1),a=a[h]}}return Rf(new Date(t.value),a,n,i)}function Jx(t,e){var r=ni(t),i=r[qa(e)]()+1,n=r[Pf(e)](),a=r[bs(e)](),o=r[If(e)](),s=r[Nf(e)](),l=r[Of(e)](),u=l===0,f=u&&s===0,h=f&&o===0,v=h&&a===0,c=v&&n===1,d=c&&i===1;return d?"year":c?"month":v?"day":h?"hour":f?"minute":u?"second":"millisecond"}function Dm(t,e,r){var i=$t(t)?ni(t):t;switch(e=e||Jx(t,r),e){case"year":return i[cp(r)]();case"half-year":return i[qa(r)]()>=6?1:0;case"quarter":return Math.floor((i[qa(r)]()+1)/4);case"month":return i[qa(r)]();case"day":return i[Pf(r)]();case"half-day":return i[bs(r)]()/24;case"hour":return i[bs(r)]();case"minute":return i[If(r)]();case"second":return i[Nf(r)]();case"millisecond":return i[Of(r)]()}}function cp(t){return t?"getUTCFullYear":"getFullYear"}function qa(t){return t?"getUTCMonth":"getMonth"}function Pf(t){return t?"getUTCDate":"getDate"}function bs(t){return t?"getUTCHours":"getHours"}function If(t){return t?"getUTCMinutes":"getMinutes"}function Nf(t){return t?"getUTCSeconds":"getSeconds"}function Of(t){return t?"getUTCMilliseconds":"getMilliseconds"}function bC(t){return t?"setUTCFullYear":"setFullYear"}function tT(t){return t?"setUTCMonth":"setMonth"}function eT(t){return t?"setUTCDate":"setDate"}function rT(t){return t?"setUTCHours":"setHours"}function iT(t){return t?"setUTCMinutes":"setMinutes"}function nT(t){return t?"setUTCSeconds":"setSeconds"}function aT(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Uu(t){if(!PA(t))return Q(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function oT(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,i){return i.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var Ys=M1;function Bv(t,e,r){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(f){return f&&jr(f)?f:"-"}function a(f){return!!(f!=null&&!isNaN(f)&&isFinite(f))}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?ni(t):t;if(isNaN(+l)){if(s)return"-"}else return Rf(l,i,r)}if(e==="ordinal")return nv(t)?n(t):$t(t)&&a(t)?t+"":"-";var u=Du(t);return a(u)?Uu(u):nv(t)?n(t):typeof t=="boolean"?t+"":"-"}var Lm=["a","b","c","d","e","f","g"],Gh=function(t,e){return"{"+t+(e??"")+"}"};function sT(t,e,r){j(e)||(e=[e]);var i=e.length;if(!i)return"";for(var n=e[0].$vars||[],a=0;a<n.length;a++){var o=Lm[a];t=t.replace(Gh(o),Gh(o,0))}for(var s=0;s<i;s++)for(var l=0;l<n.length;l++){var u=e[s][n[l]];t=t.replace(Gh(Lm[l],s),r?_e(u):u)}return t}function lT(t,e){var r=Q(t)?{color:t,extraCssText:e}:t||{},i=r.color,n=r.type;e=r.extraCssText;var a=r.renderMode||"html";if(!i)return"";if(a==="html")return n==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+_e(i)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+_e(i)+";"+(e||"")+'"></span>';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function AC(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd
yyyy`);var i=ni(e),n="get",a=i[n+"FullYear"](),o=i[n+"Month"]()+1,s=i[n+"Date"](),l=i[n+"Hours"](),u=i[n+"Minutes"](),f=i[n+"Seconds"](),h=i[n+"Milliseconds"]();return t=t.replace("MM",Ie(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Ie(a%100+"",2)).replace("dd",Ie(s,2)).replace("d",s).replace("hh",Ie(l,2)).replace("h",l).replace("mm",Ie(u,2)).replace("m",u).replace("ss",Ie(f,2)).replace("s",f).replace("SSS",Ie(h,3)),t}function $n(t,e){return e=e||"transparent",Q(t)?t:rt(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var uu=C,uT=["left","right","top","bottom","width","height"],_l=[["width","left","right"],["height","top","bottom"]];function vp(t,e,r,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;e.eachChild(function(l,u){var f=l.getBoundingRect(),h=e.childAt(u+1),v=h&&h.getBoundingRect(),c,d;if(t==="horizontal"){var p=f.width+(v?-v.x+f.x:0);c=a+p,c>i||l.newline?(a=0,c=p,o+=s+r,s=f.height):s=Math.max(s,f.height)}else{var g=f.height+(v?-v.y+f.y:0);d=o+g,d>n||l.newline?(a+=s+r,o=0,d=g,s=f.width):s=Math.max(s,f.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),t==="horizontal"?a=c+r:o=d+r)})}var $a=vp;le(vp,"vertical");le(vp,"horizontal");function Ki(t,e,r){r=Ys(r||0);var i=e.width,n=e.height,a=se(t.left,i),o=se(t.top,n),s=se(t.right,i),l=se(t.bottom,n),u=se(t.width,i),f=se(t.height,n),h=r[2]+r[0],v=r[1]+r[3],c=t.aspect;switch(isNaN(u)&&(u=i-s-v-a),isNaN(f)&&(f=n-l-h-o),c!=null&&(isNaN(u)&&isNaN(f)&&(c>i/n?u=i*.8:f=n*.8),isNaN(u)&&(u=c*f),isNaN(f)&&(f=u/c)),isNaN(a)&&(a=i-s-u-v),isNaN(o)&&(o=n-l-f-h),t.left||t.right){case"center":a=i/2-u/2-r[3];break;case"right":a=i-u-v;break}switch(t.top||t.bottom){case"middle":case"center":o=n/2-f/2-r[0];break;case"bottom":o=n-f-h;break}a=a||0,o=o||0,isNaN(u)&&(u=i-v-a-(s||0)),isNaN(f)&&(f=n-h-o-(l||0));var d=new Pt(a+r[3],o+r[0],u,f);return d.margin=r,d}function fT(t,e,r,i,n,a){var o=!n||!n.hv||n.hv[0],s=!n||!n.hv||n.hv[1],l=n&&n.boundingMode||"all";if(a=a||t,a.x=t.x,a.y=t.y,!o&&!s)return!1;var u;if(l==="raw")u=t.type==="group"?new Pt(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(u=t.getBoundingRect(),t.needLocalTransform()){var f=t.getLocalTransform();u=u.clone(),u.applyTransform(f)}var h=Ki(Et({width:u.width,height:u.height},e),r,i),v=o?h.x-u.x:0,c=s?h.y-u.y:0;return l==="raw"?(a.x=v,a.y=c):(a.x+=v,a.y+=c),a===t&&t.markRedraw(),!0}function As(t){var e=t.layoutMode||t.constructor.layoutMode;return rt(e)?e:e?{type:e}:null}function Kn(t,e,r){var i=r&&r.ignoreSize;!j(i)&&(i=[i,i]);var n=o(_l[0],0),a=o(_l[1],1);u(_l[0],t,n),u(_l[1],t,a);function o(f,h){var v={},c=0,d={},p=0,g=2;if(uu(f,function(y){d[y]=t[y]}),uu(f,function(y){s(e,y)&&(v[y]=d[y]=e[y]),l(v,y)&&c++,l(d,y)&&p++}),i[h])return l(e,f[1])?d[f[2]]=null:l(e,f[2])&&(d[f[1]]=null),d;if(p===g||!c)return d;if(c>=g)return v;for(var m=0;m<f.length;m++){var _=f[m];if(!s(v,_)&&s(t,_)){v[_]=t[_];break}}return v}function s(f,h){return f.hasOwnProperty(h)}function l(f,h){return f[h]!=null&&f[h]!=="auto"}function u(f,h,v){uu(f,function(c){h[c]=v[c]})}}function Zs(t){return hT({},t)}function hT(t,e){return e&&t&&uu(uT,function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var EC=Yt(),Rt=function(t){K(e,t);function e(r,i,n){var a=t.call(this,r,i,n)||this;return a.uid=Lf("ec_cpt_model"),a}return e.prototype.init=function(r,i,n){this.mergeDefaultAndTheme(r,n)},e.prototype.mergeDefaultAndTheme=function(r,i){var n=As(this),a=n?Zs(r):{},o=i.getTheme();dt(r,o.get(this.mainType)),dt(r,this.getDefaultOption()),n&&Kn(r,a,n)},e.prototype.mergeOption=function(r,i){dt(this.option,r,!0);var n=As(this);n&&Kn(this.option,r,n)},e.prototype.optionUpdated=function(r,i){},e.prototype.getDefaultOption=function(){var r=this.constructor;if(!KA(r))return r.defaultOption;var i=EC(this);if(!i.defaultOption){for(var n=[],a=r;a;){var o=a.prototype.defaultOption;o&&n.push(o),a=a.superClass}for(var s={},l=n.length-1;l>=0;l--)s=dt(s,n[l],!0);i.defaultOption=s}return i.defaultOption},e.prototype.getReferringComponents=function(r,i){var n=r+"Index",a=r+"Id";return Vs(this.ecModel,r,{index:this.get(n,!0),id:this.get(a,!0)},i)},e.prototype.getBoxLayoutParams=function(){var r=this;return{left:r.get("left"),top:r.get("top"),right:r.get("right"),bottom:r.get("bottom"),width:r.get("width"),height:r.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),e}(Zt);px(Rt,Zt);_f(Rt);dC(Rt);pC(Rt,MC);function MC(t){var e=[];return C(Rt.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=tt(e,function(r){return Qr(r).main}),t!=="dataset"&&bt(e,"dataset")<=0&&e.unshift("dataset"),e}var cT="";typeof navigator<"u"&&(cT=navigator.platform||"");var ha="rgba(0, 0, 0, 0.2)";const CC={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:ha,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:ha,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:ha,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:ha,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:ha,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:ha,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:cT.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var vT=ht(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),wr="original",je="arrayRows",ai="objectRows",Ti="keyedColumns",Xi="typedArray",dT="unknown",Jr="column",uo="row",Je={Must:1,Might:2,Not:3},pT=Yt();function DC(t){pT(t).datasetMap=ht()}function LC(t,e,r){var i={},n=gT(e);if(!n||!t)return i;var a=[],o=[],s=e.ecModel,l=pT(s).datasetMap,u=n.uid+"_"+r.seriesLayoutBy,f,h;t=t.slice(),C(t,function(p,g){var m=rt(p)?p:t[g]={name:p};m.type==="ordinal"&&f==null&&(f=g,h=d(m)),i[m.name]=[]});var v=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});C(t,function(p,g){var m=p.name,_=d(p);if(f==null){var y=v.valueWayDim;c(i[m],y,_),c(o,y,_),v.valueWayDim+=_}else if(f===g)c(i[m],0,_),c(a,0,_);else{var y=v.categoryWayDim;c(i[m],y,_),c(o,y,_),v.categoryWayDim+=_}});function c(p,g,m){for(var _=0;_<m;_++)p.push(g+_)}function d(p){var g=p.dimsDef;return g?g.length:1}return a.length&&(i.itemName=a),o.length&&(i.seriesName=o),i}function gT(t){var e=t.get("data",!0);if(!e)return Vs(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},Ze).models[0]}function RC(t){return!t.get("transform",!0)&&!t.get("fromTransformResult",!0)?[]:Vs(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},Ze).models}function mT(t,e){return PC(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function PC(t,e,r,i,n,a){var o,s=5;if(Ke(t))return Je.Not;var l,u;if(i){var f=i[a];rt(f)?(l=f.name,u=f.type):Q(f)&&(l=f)}if(u!=null)return u==="ordinal"?Je.Must:Je.Not;if(e===je){var h=t;if(r===uo){for(var v=h[a],c=0;c<(v||[]).length&&c<s;c++)if((o=x(v[n+c]))!=null)return o}else for(var c=0;c<h.length&&c<s;c++){var d=h[n+c];if(d&&(o=x(d[a]))!=null)return o}}else if(e===ai){var p=t;if(!l)return Je.Not;for(var c=0;c<p.length&&c<s;c++){var g=p[c];if(g&&(o=x(g[l]))!=null)return o}}else if(e===Ti){var m=t;if(!l)return Je.Not;var v=m[l];if(!v||Ke(v))return Je.Not;for(var c=0;c<v.length&&c<s;c++)if((o=x(v[c]))!=null)return o}else if(e===wr)for(var _=t,c=0;c<_.length&&c<s;c++){var g=_[c],y=Hs(g);if(!j(y))return Je.Not;if((o=x(y[a]))!=null)return o}function x(S){var T=Q(S);if(S!=null&&Number.isFinite(Number(S))&&S!=="")return T?Je.Might:Je.Not;if(T&&S!=="-")return Je.Must}return Je.Not}var IC=ht();function NC(t,e,r){var i=IC.get(e);if(!i)return r;var n=i(t);return n?r.concat(n):r}var Rm=Yt();Yt();var dp=function(){function t(){}return t.prototype.getColorFromPalette=function(e,r,i){var n=ue(this.get("color",!0)),a=this.get("colorLayer",!0);return BC(this,Rm,n,a,e,r,i)},t.prototype.clearColorPalette=function(){FC(this,Rm)},t}();function OC(t,e){for(var r=t.length,i=0;i<r;i++)if(t[i].length>e)return t[i];return t[r-1]}function BC(t,e,r,i,n,a,o){a=a||t;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var f=o==null||!i?r:OC(i,o);if(f=f||r,!(!f||!f.length)){var h=f[l];return n&&(u[n]=h),s.paletteIdx=(l+1)%f.length,h}}function FC(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var yl,So,Pm,Im="\0_ec_inner",kC=1,pp=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Zt(a),this._locale=new Zt(o),this._optionManager=s},e.prototype.setOption=function(r,i,n){var a=Bm(i);this._optionManager.setOption(r,n,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,i){return this._resetOption(r,Bm(i))},e.prototype._resetOption=function(r,i){var n=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?Pm(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&C(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=ht(),u=i&&i.replaceMergeMainTypeMap;DC(this),C(r,function(h,v){h!=null&&(Rt.hasClass(v)?v&&(s.push(v),l.set(v,!0)):n[v]=n[v]==null?ut(h):dt(n[v],h,!0))}),u&&u.each(function(h,v){Rt.hasClass(v)&&!l.get(v)&&(s.push(v),l.set(v,!0))}),Rt.topologicalTravel(s,Rt.getAllClassMainTypes(),f,this);function f(h){var v=NC(this,h,ue(r[h])),c=a.get(h),d=c?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",p=fx(c,v,d);HA(p,h,Rt),n[h]=null,a.set(h,null),o.set(h,0);var g=[],m=[],_=0,y;C(p,function(x,S){var T=x.existing,w=x.newOption;if(!w)T&&(T.mergeOption({},this),T.optionUpdated({},!1));else{var b=h==="series",A=Rt.getClass(h,x.keyInfo.subType,!b);if(!A)return;if(h==="tooltip"){if(y)return;y=!0}if(T&&T.constructor===A)T.name=x.keyInfo.name,T.mergeOption(w,this),T.optionUpdated(w,!1);else{var M=Y({componentIndex:S},x.keyInfo);T=new A(w,this,this,M),Y(T,M),x.brandNew&&(T.__requireNewView=!0),T.init(w,this,this),T.optionUpdated(null,!0)}}T?(g.push(T.option),m.push(T),_++):(g.push(void 0),m.push(void 0))},this),n[h]=g,a.set(h,m),o.set(h,_),h==="series"&&yl(this)}this._seriesIndices||yl(this)},e.prototype.getOption=function(){var r=ut(this.option);return C(r,function(i,n){if(Rt.hasClass(n)){for(var a=ue(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!xs(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[n]=a}}),delete r[Im],r},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,i){var n=this._componentsMap.get(r);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o<n.length;o++)if(n[o])return n[o]}}},e.prototype.queryComponents=function(r){var i=r.mainType;if(!i)return[];var n=r.index,a=r.id,o=r.name,s=this._componentsMap.get(i);if(!s||!s.length)return[];var l;return n!=null?(l=[],C(ue(n),function(u){s[u]&&l.push(s[u])})):a!=null?l=Nm("id",a,s):o!=null?l=Nm("name",o,s):l=oe(s,function(u){return!!u}),Om(l,r)},e.prototype.findComponents=function(r){var i=r.query,n=r.mainType,a=s(i),o=a?this.queryComponents(a):oe(this._componentsMap.get(n),function(u){return!!u});return l(Om(o,r));function s(u){var f=n+"Index",h=n+"Id",v=n+"Name";return u&&(u[f]!=null||u[h]!=null||u[v]!=null)?{mainType:n,index:u[f],id:u[h],name:u[v]}:null}function l(u){return r.filter?oe(u,r.filter):u}},e.prototype.eachComponent=function(r,i,n){var a=this._componentsMap;if(ct(r)){var o=i,s=r;a.each(function(h,v){for(var c=0;h&&c<h.length;c++){var d=h[c];d&&s.call(o,v,d,d.componentIndex)}})}else for(var l=Q(r)?a.get(r):rt(r)?this.findComponents(r):null,u=0;l&&u<l.length;u++){var f=l[u];f&&i.call(n,f,f.componentIndex)}},e.prototype.getSeriesByName=function(r){var i=Ne(r,null);return oe(this._componentsMap.get("series"),function(n){return!!n&&i!=null&&n.name===i})},e.prototype.getSeriesByIndex=function(r){return this._componentsMap.get("series")[r]},e.prototype.getSeriesByType=function(r){return oe(this._componentsMap.get("series"),function(i){return!!i&&i.subType===r})},e.prototype.getSeries=function(){return oe(this._componentsMap.get("series"),function(r){return!!r})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(r,i){So(this),C(this._seriesIndices,function(n){var a=this._componentsMap.get("series")[n];r.call(i,a,n)},this)},e.prototype.eachRawSeries=function(r,i){C(this._componentsMap.get("series"),function(n){n&&r.call(i,n,n.componentIndex)})},e.prototype.eachSeriesByType=function(r,i,n){So(this),C(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];o.subType===r&&i.call(n,o,a)},this)},e.prototype.eachRawSeriesByType=function(r,i,n){return C(this.getSeriesByType(r),i,n)},e.prototype.isSeriesFiltered=function(r){return So(this),this._seriesIndicesMap.get(r.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(r,i){So(this);var n=[];C(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];r.call(i,o,a)&&n.push(a)},this),this._seriesIndices=n,this._seriesIndicesMap=ht(n)},e.prototype.restoreData=function(r){yl(this);var i=this._componentsMap,n=[];i.each(function(a,o){Rt.hasClass(o)&&n.push(o)}),Rt.topologicalTravel(n,Rt.getAllClassMainTypes(),function(a){C(i.get(a),function(o){o&&(a!=="series"||!zC(o,r))&&o.restoreData()})})},e.internalField=function(){yl=function(r){var i=r._seriesIndices=[];C(r._componentsMap.get("series"),function(n){n&&i.push(n.componentIndex)}),r._seriesIndicesMap=ht(i)},So=function(r){},Pm=function(r,i){r.option={},r.option[Im]=kC,r._componentsMap=ht({series:[]}),r._componentsCount=ht();var n=i.aria;rt(n)&&n.enabled==null&&(n.enabled=!0),UC(i,r._theme.option),dt(i,CC,!1),r._mergeOption(i,null)}}(),e}(Zt);function zC(t,e){if(e){var r=e.seriesIndex,i=e.seriesId,n=e.seriesName;return r!=null&&t.componentIndex!==r||i!=null&&t.id!==i||n!=null&&t.name!==n}}function UC(t,e){var r=t.color&&!t.colorLayer;C(e,function(i,n){n==="colorLayer"&&r||Rt.hasClass(n)||(typeof i=="object"?t[n]=t[n]?dt(t[n],i,!1):ut(i):t[n]==null&&(t[n]=i))})}function Nm(t,e,r){if(j(e)){var i=ht();return C(e,function(a){if(a!=null){var o=Ne(a,null);o!=null&&i.set(a,!0)}}),oe(r,function(a){return a&&i.get(a[t])})}else{var n=Ne(e,null);return oe(r,function(a){return a&&n!=null&&a[t]===n})}}function Om(t,e){return e.hasOwnProperty("subType")?oe(t,function(r){return r&&r.subType===e.subType}):t}function Bm(t){var e=ht();return t&&C(ue(t.replaceMerge),function(r){e.set(r,!0)}),{replaceMergeMainTypeMap:e}}kr(pp,dp);var HC=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],_T=function(){function t(e){C(HC,function(r){this[r]=nt(e[r],e)},this)}return t}(),Wh={},Bf=function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(e,r){var i=[];C(Wh,function(n,a){var o=n.create(e,r);i=i.concat(o||[])}),this._coordinateSystems=i},t.prototype.update=function(e,r){C(this._coordinateSystems,function(i){i.update&&i.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(e,r){Wh[e]=r},t.get=function(e){return Wh[e]},t}(),VC=/^(min|max)?(.+)$/,GC=function(){function t(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return t.prototype.setOption=function(e,r,i){e&&(C(ue(e.series),function(o){o&&o.data&&Ke(o.data)&&xu(o.data)}),C(ue(e.dataset),function(o){o&&o.source&&Ke(o.source)&&xu(o.source)})),e=ut(e);var n=this._optionBackup,a=WC(e,r,!n);this._newBaseOption=a.baseOption,n?(a.timelineOptions.length&&(n.timelineOptions=a.timelineOptions),a.mediaList.length&&(n.mediaList=a.mediaList),a.mediaDefault&&(n.mediaDefault=a.mediaDefault)):this._optionBackup=a},t.prototype.mountOption=function(e){var r=this._optionBackup;return this._timelineOptions=r.timelineOptions,this._mediaList=r.mediaList,this._mediaDefault=r.mediaDefault,this._currentMediaIndices=[],ut(e?r.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(e){var r,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(r=ut(i[n.getCurrentIndex()]))}return r},t.prototype.getMediaOption=function(e){var r=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,a=this._mediaDefault,o=[],s=[];if(!n.length&&!a)return s;for(var l=0,u=n.length;l<u;l++)XC(n[l].query,r,i)&&o.push(l);return!o.length&&a&&(o=[-1]),o.length&&!ZC(o,this._currentMediaIndices)&&(s=tt(o,function(f){return ut(f===-1?a.option:n[f].option)})),this._currentMediaIndices=o,s},t}();function WC(t,e,r){var i=[],n,a,o=t.baseOption,s=t.timeline,l=t.options,u=t.media,f=!!t.media,h=!!(l||s||o&&o.timeline);o?(a=o,a.timeline||(a.timeline=s)):((h||f)&&(t.options=t.media=null),a=t),f&&j(u)&&C(u,function(c){c&&c.option&&(c.query?i.push(c):n||(n=c))}),v(a),C(l,function(c){return v(c)}),C(i,function(c){return v(c.option)});function v(c){C(e,function(d){d(c,r)})}return{baseOption:a,timelineOptions:l||[],mediaDefault:n,mediaList:i}}function XC(t,e,r){var i={width:e,height:r,aspectratio:e/r},n=!0;return C(t,function(a,o){var s=o.match(VC);if(!(!s||!s[1]||!s[2])){var l=s[1],u=s[2].toLowerCase();YC(i[u],a,l)||(n=!1)}}),n}function YC(t,e,r){return r==="min"?t>=e:r==="max"?t<=e:t===e}function ZC(t,e){return t.join(",")===e.join(",")}var Ar=C,Es=rt,Fm=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Xh(t){var e=t&&t.itemStyle;if(e)for(var r=0,i=Fm.length;r<i;r++){var n=Fm[r],a=e.normal,o=e.emphasis;a&&a[n]&&(t[n]=t[n]||{},t[n].normal?dt(t[n].normal,a[n]):t[n].normal=a[n],a[n]=null),o&&o[n]&&(t[n]=t[n]||{},t[n].emphasis?dt(t[n].emphasis,o[n]):t[n].emphasis=o[n],o[n]=null)}}function Ee(t,e,r){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var i=t[e].normal,n=t[e].emphasis;i&&(r?(t[e].normal=t[e].emphasis=null,Et(t[e],i)):t[e]=i),n&&(t.emphasis=t.emphasis||{},t.emphasis[e]=n,n.focus&&(t.emphasis.focus=n.focus),n.blurScope&&(t.emphasis.blurScope=n.blurScope))}}function jo(t){Ee(t,"itemStyle"),Ee(t,"lineStyle"),Ee(t,"areaStyle"),Ee(t,"label"),Ee(t,"labelLine"),Ee(t,"upperLabel"),Ee(t,"edgeLabel")}function ae(t,e){var r=Es(t)&&t[e],i=Es(r)&&r.textStyle;if(i)for(var n=0,a=Ug.length;n<a;n++){var o=Ug[n];i.hasOwnProperty(o)&&(r[o]=i[o])}}function lr(t){t&&(jo(t),ae(t,"label"),t.emphasis&&ae(t.emphasis,"label"))}function qC(t){if(Es(t)){Xh(t),jo(t),ae(t,"label"),ae(t,"upperLabel"),ae(t,"edgeLabel"),t.emphasis&&(ae(t.emphasis,"label"),ae(t.emphasis,"upperLabel"),ae(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Xh(e),lr(e));var r=t.markLine;r&&(Xh(r),lr(r));var i=t.markArea;i&&lr(i);var n=t.data;if(t.type==="graph"){n=n||t.nodes;var a=t.links||t.edges;if(a&&!Ke(a))for(var o=0;o<a.length;o++)lr(a[o]);C(t.categories,function(u){jo(u)})}if(n&&!Ke(n))for(var o=0;o<n.length;o++)lr(n[o]);if(e=t.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)lr(s[o]);if(r=t.markLine,r&&r.data)for(var l=r.data,o=0;o<l.length;o++)j(l[o])?(lr(l[o][0]),lr(l[o][1])):lr(l[o]);t.type==="gauge"?(ae(t,"axisLabel"),ae(t,"title"),ae(t,"detail")):t.type==="treemap"?(Ee(t.breadcrumb,"itemStyle"),C(t.levels,function(u){jo(u)})):t.type==="tree"&&jo(t.leaves)}}function li(t){return j(t)?t:t?[t]:[]}function km(t){return(j(t)?t[0]:t)||{}}function $C(t,e){Ar(li(t.series),function(i){Es(i)&&qC(i)});var r=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&r.push("valueAxis","categoryAxis","logAxis","timeAxis"),Ar(r,function(i){Ar(li(t[i]),function(n){n&&(ae(n,"axisLabel"),ae(n.axisPointer,"label"))})}),Ar(li(t.parallel),function(i){var n=i&&i.parallelAxisDefault;ae(n,"axisLabel"),ae(n&&n.axisPointer,"label")}),Ar(li(t.calendar),function(i){Ee(i,"itemStyle"),ae(i,"dayLabel"),ae(i,"monthLabel"),ae(i,"yearLabel")}),Ar(li(t.radar),function(i){ae(i,"name"),i.name&&i.axisName==null&&(i.axisName=i.name,delete i.name),i.nameGap!=null&&i.axisNameGap==null&&(i.axisNameGap=i.nameGap,delete i.nameGap)}),Ar(li(t.geo),function(i){Es(i)&&(lr(i),Ar(li(i.regions),function(n){lr(n)}))}),Ar(li(t.timeline),function(i){lr(i),Ee(i,"label"),Ee(i,"itemStyle"),Ee(i,"controlStyle",!0);var n=i.data;j(n)&&C(n,function(a){rt(a)&&(Ee(a,"label"),Ee(a,"itemStyle"))})}),Ar(li(t.toolbox),function(i){Ee(i,"iconStyle"),Ar(i.feature,function(n){Ee(n,"iconStyle")})}),ae(km(t.axisPointer),"label"),ae(km(t.tooltip).axisPointer,"label")}function KC(t,e){for(var r=e.split(","),i=t,n=0;n<r.length&&(i=i&&i[r[n]],i!=null);n++);return i}function jC(t,e,r,i){for(var n=e.split(","),a=t,o,s=0;s<n.length-1;s++)o=n[s],a[o]==null&&(a[o]={}),a=a[o];a[n[s]]==null&&(a[n[s]]=r)}function zm(t){t&&C(QC,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var QC=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],JC=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Yh=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function wo(t){var e=t&&t.itemStyle;if(e)for(var r=0;r<Yh.length;r++){var i=Yh[r][1],n=Yh[r][0];e[i]!=null&&(e[n]=e[i])}}function Um(t){t&&t.alignTo==="edge"&&t.margin!=null&&t.edgeDistance==null&&(t.edgeDistance=t.margin)}function Hm(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function tD(t){t&&t.focusNodeAdjacency!=null&&(t.emphasis=t.emphasis||{},t.emphasis.focus==null&&(t.emphasis.focus="adjacency"))}function yT(t,e){if(t)for(var r=0;r<t.length;r++)e(t[r]),t[r]&&yT(t[r].children,e)}function xT(t,e){$C(t,e),t.series=ue(t.series),C(t.series,function(r){if(rt(r)){var i=r.type;if(i==="line")r.clipOverflow!=null&&(r.clip=r.clipOverflow);else if(i==="pie"||i==="gauge"){r.clockWise!=null&&(r.clockwise=r.clockWise),Um(r.label);var n=r.data;if(n&&!Ke(n))for(var a=0;a<n.length;a++)Um(n[a]);r.hoverOffset!=null&&(r.emphasis=r.emphasis||{},(r.emphasis.scaleSize=null)&&(r.emphasis.scaleSize=r.hoverOffset))}else if(i==="gauge"){var o=KC(r,"pointer.color");o!=null&&jC(r,"itemStyle.color",o)}else if(i==="bar"){wo(r),wo(r.backgroundStyle),wo(r.emphasis);var n=r.data;if(n&&!Ke(n))for(var a=0;a<n.length;a++)typeof n[a]=="object"&&(wo(n[a]),wo(n[a]&&n[a].emphasis))}else if(i==="sunburst"){var s=r.highlightPolicy;s&&(r.emphasis=r.emphasis||{},r.emphasis.focus||(r.emphasis.focus=s)),Hm(r),yT(r.data,Hm)}else i==="graph"||i==="sankey"?tD(r):i==="map"&&(r.mapType&&!r.map&&(r.map=r.mapType),r.mapLocation&&Et(r,r.mapLocation));r.hoverAnimation!=null&&(r.emphasis=r.emphasis||{},r.emphasis&&r.emphasis.scale==null&&(r.emphasis.scale=r.hoverAnimation)),zm(r)}}),t.dataRange&&(t.visualMap=t.dataRange),C(JC,function(r){var i=t[r];i&&(j(i)||(i=[i]),C(i,function(n){zm(n)}))})}function eD(t){var e=ht();t.eachSeries(function(r){var i=r.get("stack");if(i){var n=e.get(i)||e.set(i,[]),a=r.getData(),o={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:r};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;n.length&&a.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(o)}}),e.each(rD)}function rD(t){C(t,function(e,r){var i=[],n=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,f,h){var v=o.get(e.stackedDimension,h);if(isNaN(v))return n;var c,d;s?d=o.getRawIndex(h):c=o.get(e.stackedByDimension,h);for(var p=NaN,g=r-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var _=m.data.getByRawIndex(m.stackResultDimension,d);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&v>=0&&_>0||l==="samesign"&&v<=0&&_<0){v=DA(v,_),p=_;break}}}return i[0]=v,i[1]=p,i})})}var Ff=function(){function t(e){this.data=e.data||(e.sourceFormat===Ti?{}:[]),this.sourceFormat=e.sourceFormat||dT,this.seriesLayoutBy=e.seriesLayoutBy||Jr,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var i=0;i<r.length;i++){var n=r[i];n.type==null&&mT(this,i)===Je.Must&&(n.type="ordinal")}}return t}();function gp(t){return t instanceof Ff}function Fv(t,e,r){r=r||ST(t);var i=e.seriesLayoutBy,n=nD(t,r,i,e.sourceHeader,e.dimensions),a=new Ff({data:t,sourceFormat:r,seriesLayoutBy:i,dimensionsDefine:n.dimensionsDefine,startIndex:n.startIndex,dimensionsDetectedCount:n.dimensionsDetectedCount,metaRawOption:ut(e)});return a}function TT(t){return new Ff({data:t,sourceFormat:Ke(t)?Xi:wr})}function iD(t){return new Ff({data:t.data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:ut(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})}function ST(t){var e=dT;if(Ke(t))e=Xi;else if(j(t)){t.length===0&&(e=je);for(var r=0,i=t.length;r<i;r++){var n=t[r];if(n!=null){if(j(n)||Ke(n)){e=je;break}else if(rt(n)){e=ai;break}}}}else if(rt(t)){for(var a in t)if(gt(t,a)&&ke(t[a])){e=Ti;break}}return e}function nD(t,e,r,i,n){var a,o;if(!t)return{dimensionsDefine:Vm(n),startIndex:o,dimensionsDetectedCount:a};if(e===je){var s=t;i==="auto"||i==null?Gm(function(u){u!=null&&u!=="-"&&(Q(u)?o==null&&(o=1):o=0)},r,s,10):o=$t(i)?i:i?1:0,!n&&o===1&&(n=[],Gm(function(u,f){n[f]=u!=null?u+"":""},r,s,1/0)),a=n?n.length:r===uo?s.length:s[0]?s[0].length:null}else if(e===ai)n||(n=aD(t));else if(e===Ti)n||(n=[],C(t,function(u,f){n.push(f)}));else if(e===wr){var l=Hs(t[0]);a=j(l)&&l.length||1}return{startIndex:o,dimensionsDefine:Vm(n),dimensionsDetectedCount:a}}function aD(t){for(var e=0,r;e<t.length&&!(r=t[e++]););if(r)return mt(r)}function Vm(t){if(t){var e=ht();return tt(t,function(r,i){r=rt(r)?r:{name:r};var n={name:r.name,displayName:r.displayName,type:r.type};if(n.name==null)return n;n.name+="",n.displayName==null&&(n.displayName=n.name);var a=e.get(n.name);return a?n.name+="-"+a.count++:e.set(n.name,{count:1}),n})}}function Gm(t,e,r,i){if(e===uo)for(var n=0;n<r.length&&n<i;n++)t(r[n]?r[n][0]:null,n);else for(var a=r[0]||[],n=0;n<a.length&&n<i;n++)t(a[n],n)}function wT(t){var e=t.sourceFormat;return e===ai||e===Ti}var gn,mn,_n,Wm,Xm,bT=function(){function t(e,r){var i=gp(e)?e:TT(e);this._source=i;var n=this._data=i.data;i.sourceFormat===Xi&&(this._offset=0,this._dimSize=r,this._data=n),Xm(this,n,i)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(e,r){},t.prototype.appendData=function(e){},t.prototype.clean=function(){},t.protoInitialize=function(){var e=t.prototype;e.pure=!1,e.persistent=!0}(),t.internalField=function(){var e;Xm=function(o,s,l){var u=l.sourceFormat,f=l.seriesLayoutBy,h=l.startIndex,v=l.dimensionsDefine,c=Wm[mp(u,f)];if(Y(o,c),u===Xi)o.getItem=r,o.count=n,o.fillStorage=i;else{var d=AT(u,f);o.getItem=nt(d,null,s,h,v);var p=ET(u,f);o.count=nt(p,null,s,h,v)}};var r=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,u=this._dimSize,f=u*o,h=0;h<u;h++)s[h]=l[f+h];return s},i=function(o,s,l,u){for(var f=this._data,h=this._dimSize,v=0;v<h;v++){for(var c=u[v],d=c[0]==null?1/0:c[0],p=c[1]==null?-1/0:c[1],g=s-o,m=l[v],_=0;_<g;_++){var y=f[_*h+v];m[o+_]=y,y<d&&(d=y),y>p&&(p=y)}c[0]=d,c[1]=p}},n=function(){return this._data?this._data.length/this._dimSize:0};Wm=(e={},e[je+"_"+Jr]={pure:!0,appendData:a},e[je+"_"+uo]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ai]={pure:!0,appendData:a},e[Ti]={pure:!0,appendData:function(o){var s=this._data;C(o,function(l,u){for(var f=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)f.push(l[h])})}},e[wr]={appendData:a},e[Xi]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}}(),t}(),Ym=function(t,e,r,i){return t[i]},oD=(gn={},gn[je+"_"+Jr]=function(t,e,r,i){return t[i+e]},gn[je+"_"+uo]=function(t,e,r,i,n){i+=e;for(var a=n||[],o=t,s=0;s<o.length;s++){var l=o[s];a[s]=l?l[i]:null}return a},gn[ai]=Ym,gn[Ti]=function(t,e,r,i,n){for(var a=n||[],o=0;o<r.length;o++){var s=r[o].name,l=t[s];a[o]=l?l[i]:null}return a},gn[wr]=Ym,gn);function AT(t,e){var r=oD[mp(t,e)];return r}var Zm=function(t,e,r){return t.length},sD=(mn={},mn[je+"_"+Jr]=function(t,e,r){return Math.max(0,t.length-e)},mn[je+"_"+uo]=function(t,e,r){var i=t[0];return i?Math.max(0,i.length-e):0},mn[ai]=Zm,mn[Ti]=function(t,e,r){var i=r[0].name,n=t[i];return n?n.length:0},mn[wr]=Zm,mn);function ET(t,e){var r=sD[mp(t,e)];return r}var Zh=function(t,e,r){return t[e]},lD=(_n={},_n[je]=Zh,_n[ai]=function(t,e,r){return t[r]},_n[Ti]=Zh,_n[wr]=function(t,e,r){var i=Hs(t);return i instanceof Array?i[e]:i},_n[Xi]=Zh,_n);function MT(t){var e=lD[t];return e}function mp(t,e){return t===je?t+"_"+e:t}function Qa(t,e,r){if(t){var i=t.getRawDataItem(e);if(i!=null){var n=t.getStore(),a=n.getSource().sourceFormat;if(r!=null){var o=t.getDimensionIndex(r),s=n.getDimensionProperty(o);return MT(a)(i,o,s)}else{var l=i;return a===wr&&(l=Hs(i)),l}}}}var uD=/\{@(.+?)\}/g,fD=function(){function t(){}return t.prototype.getDataParams=function(e,r){var i=this.getData(r),n=this.getRawValue(e,r),a=i.getRawIndex(e),o=i.getName(e),s=i.getRawDataItem(e),l=i.getItemVisual(e,"style"),u=l&&l[i.getItemVisual(e,"drawType")||"fill"],f=l&&l.stroke,h=this.mainType,v=h==="series",c=i.userOutput&&i.userOutput.get();return{componentType:h,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:v?this.subType:null,seriesIndex:this.seriesIndex,seriesId:v?this.id:null,seriesName:v?this.name:null,name:o,dataIndex:a,data:s,dataType:r,value:n,color:u,borderColor:f,dimensionNames:c?c.fullDimensions:null,encode:c?c.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(e,r,i,n,a,o){r=r||"normal";var s=this.getData(i),l=this.getDataParams(e,i);if(o&&(l.value=o.interpolatedValue),n!=null&&j(l.value)&&(l.value=l.value[n]),!a){var u=s.getItemModel(e);a=u.get(r==="normal"?["label","formatter"]:[r,"label","formatter"])}if(ct(a))return l.status=r,l.dimensionIndex=n,a(l);if(Q(a)){var f=sT(a,l);return f.replace(uD,function(h,v){var c=v.length,d=v;d.charAt(0)==="["&&d.charAt(c-1)==="]"&&(d=+d.slice(1,c-1));var p=Qa(s,e,d);if(o&&j(o.interpolatedValue)){var g=s.getDimensionIndex(d);g>=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})}},t.prototype.getRawValue=function(e,r){return Qa(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,i){},t}();function qm(t){var e,r;return rt(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function hs(t){return new hD(t)}var hD=function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,i=e&&e.skip;if(this._dirty&&r){var n=this.context;n.data=n.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=f(this._modBy),s=this._modDataCount||0,l=f(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function f(_){return!(_>=1)&&(_=1),_}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(i)),this._modBy=l,this._modDataCount=u;var v=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var c=this._dueIndex,d=Math.min(v!=null?this._dueIndex+v:1/0,this._dueEnd);if(!i&&(h||c<d)){var p=this._progress;if(j(p))for(var g=0;g<p.length;g++)this._doProgress(p[g],c,d,l,u);else this._doProgress(p,c,d,l,u)}this._dueIndex=d;var m=this._settedOutputEnd!=null?this._settedOutputEnd:d;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(e,r,i,n,a){$m.reset(r,i,n,a),this._callingProgress=e,this._callingProgress({start:r,end:i,count:i-r,next:$m.next},this.context)},t.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var r,i;!e&&this._reset&&(r=this._reset(this.context),r&&r.progress&&(i=r.forceFirstProgress,r=r.progress),j(r)&&!r.length&&(r=null)),this._progress=r,this._modBy=this._modDataCount=null;var n=this._downstream;return n&&n.dirty(),i},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},t}(),$m=function(){var t,e,r,i,n,a={reset:function(l,u,f,h){e=l,t=u,r=f,i=h,n=Math.ceil(i/r),a.next=r>1&&i>0?s:o}};return a;function o(){return e<t?e++:null}function s(){var l=e%n*r+Math.ceil(e/n),u=e>=t?null:l<i?l:e;return e++,u}}();function fu(t,e){var r=e&&e.type;return r==="ordinal"?t:(r==="time"&&!$t(t)&&t!=null&&t!=="-"&&(t=+ni(t)),t==null||t===""?NaN:Number(t))}ht({number:function(t){return parseFloat(t)},time:function(t){return+ni(t)},trim:function(t){return Q(t)?jr(t):t}});var cD=function(){function t(e,r){var i=e==="desc";this._resultLT=i?1:-1,r==null&&(r=i?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var i=$t(e)?e:Du(e),n=$t(r)?r:Du(r),a=isNaN(i),o=isNaN(n);if(a&&(i=this._incomparable),o&&(n=this._incomparable),a&&o){var s=Q(e),l=Q(r);s&&(i=l?e:0),l&&(n=s?r:0)}return i<n?this._resultLT:i>n?-this._resultLT:0},t}(),vD=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(e){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(e){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(e,r){},t.prototype.retrieveValueFromItem=function(e,r){},t.prototype.convertValue=function(e,r){return fu(e,r)},t}();function dD(t,e){var r=new vD,i=t.data,n=r.sourceFormat=t.sourceFormat,a=t.startIndex,o="";t.seriesLayoutBy!==Jr&&Xe(o);var s=[],l={},u=t.dimensionsDefine;if(u)C(u,function(p,g){var m=p.name,_={index:g,name:m,displayName:p.displayName};if(s.push(_),m!=null){var y="";gt(l,m)&&Xe(y),l[m]=_}});else for(var f=0;f<t.dimensionsDetectedCount;f++)s.push({index:f});var h=AT(n,Jr);e.__isBuiltIn&&(r.getRawDataItem=function(p){return h(i,a,s,p)},r.getRawData=nt(pD,null,t)),r.cloneRawData=nt(gD,null,t);var v=ET(n,Jr);r.count=nt(v,null,i,a,s);var c=MT(n);r.retrieveValue=function(p,g){var m=h(i,a,s,p);return d(m,g)};var d=r.retrieveValueFromItem=function(p,g){if(p!=null){var m=s[g];if(m)return c(p,g,m.name)}};return r.getDimensionInfo=nt(mD,null,s,l),r.cloneAllDimensionInfo=nt(_D,null,s),r}function pD(t){var e=t.sourceFormat;if(!_p(e)){var r="";Xe(r)}return t.data}function gD(t){var e=t.sourceFormat,r=t.data;if(!_p(e)){var i="";Xe(i)}if(e===je){for(var n=[],a=0,o=r.length;a<o;a++)n.push(r[a].slice());return n}else if(e===ai){for(var n=[],a=0,o=r.length;a<o;a++)n.push(Y({},r[a]));return n}}function mD(t,e,r){if(r!=null){if($t(r)||!isNaN(r)&&!gt(e,r))return t[r];if(gt(e,r))return e[r]}}function _D(t){return ut(t)}var CT=ht();function yD(t){t=ut(t);var e=t.type,r="";e||Xe(r);var i=e.split(":");i.length!==2&&Xe(r);var n=!1;i[0]==="echarts"&&(e=i[1],n=!0),t.__isBuiltIn=n,CT.set(e,t)}function xD(t,e,r){var i=ue(t),n=i.length,a="";n||Xe(a);for(var o=0,s=n;o<s;o++){var l=i[o];e=TD(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function TD(t,e,r,i){var n="";e.length||Xe(n),rt(t)||Xe(n);var a=t.type,o=CT.get(a);o||Xe(n);var s=tt(e,function(u){return dD(u,o)}),l=ue(o.transform({upstream:s[0],upstreamList:s,config:ut(t.config)}));return tt(l,function(u,f){var h="";rt(u)||Xe(h),u.data||Xe(h);var v=ST(u.data);_p(v)||Xe(h);var c,d=e[0];if(d&&f===0&&!u.dimensions){var p=d.startIndex;p&&(u.data=d.data.slice(0,p).concat(u.data)),c={seriesLayoutBy:Jr,sourceHeader:p,dimensions:d.metaRawOption.dimensions}}else c={seriesLayoutBy:Jr,sourceHeader:0,dimensions:u.dimensions};return Fv(u.data,c,null)})}function _p(t){return t===je||t===ai}var kf="undefined",SD=typeof Uint32Array===kf?Array:Uint32Array,wD=typeof Uint16Array===kf?Array:Uint16Array,DT=typeof Int32Array===kf?Array:Int32Array,Km=typeof Float64Array===kf?Array:Float64Array,LT={float:Km,int:DT,ordinal:Array,number:Array,time:Km},qh;function bo(t){return t>65535?SD:wD}function ca(){return[1/0,-1/0]}function bD(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function jm(t,e,r,i,n){var a=LT[r||"float"];if(n){var o=t[e],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;u<s;u++)l[u]=o[u];t[e]=l}}else t[e]=new a(i)}var kv=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=ht()}return t.prototype.initData=function(e,r,i){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var n=e.getSource(),a=this.defaultDimValueGetter=qh[n.sourceFormat];this._dimValueGetter=i||a,this._rawExtent=[],wT(n),this._dimensions=tt(r,function(o){return{type:o.type,property:o.property}}),this._initDataFromProvider(0,e.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(e,r){var i=this._calcDimNameToIdx,n=this._dimensions,a=i.get(e);if(a!=null){if(n[a].type===r)return a}else a=n.length;return n[a]={type:r},i.set(e,a),this._chunks[a]=new LT[r||"float"](this._rawCount),this._rawExtent[a]=ca(),a},t.prototype.collectOrdinalMeta=function(e,r){var i=this._chunks[e],n=this._dimensions[e],a=this._rawExtent,o=n.ordinalOffset||0,s=i.length;o===0&&(a[e]=ca());for(var l=a[e],u=o;u<s;u++){var f=i[u]=r.parseAndCollect(i[u]);isNaN(f)||(l[0]=Math.min(f,l[0]),l[1]=Math.max(f,l[1]))}n.ordinalMeta=r,n.ordinalOffset=s,n.type="ordinal"},t.prototype.getOrdinalMeta=function(e){var r=this._dimensions[e],i=r.ordinalMeta;return i},t.prototype.getDimensionProperty=function(e){var r=this._dimensions[e];return r&&r.property},t.prototype.appendData=function(e){var r=this._provider,i=this.count();r.appendData(e);var n=r.count();return r.persistent||(n+=i),i<n&&this._initDataFromProvider(i,n,!0),[i,n]},t.prototype.appendValues=function(e,r){for(var i=this._chunks,n=this._dimensions,a=n.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,r||0),u=0;u<a;u++){var f=n[u];jm(i,u,f.type,l,!0)}for(var h=[],v=s;v<l;v++)for(var c=v-s,d=0;d<a;d++){var f=n[d],p=qh.arrayRows.call(this,e[c]||h,f.property,c,d);i[d][v]=p;var g=o[d];p<g[0]&&(g[0]=p),p>g[1]&&(g[1]=p)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=tt(o,function(_){return _.property}),f=0;f<s;f++){var h=o[f];l[f]||(l[f]=ca()),jm(a,f,h.type,r,i)}if(n.fillStorage)n.fillStorage(e,r,a,l);else for(var v=[],c=e;c<r;c++){v=n.getItem(c,v);for(var d=0;d<s;d++){var p=a[d],g=this._dimValueGetter(v,u[d],c,d);p[c]=g;var m=l[d];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r<this._count))return NaN;var i=this._chunks[e];return i?i[this.getRawIndex(r)]:NaN},t.prototype.getValues=function(e,r){var i=[],n=[];if(r==null){r=e,e=[];for(var a=0;a<this._dimensions.length;a++)n.push(a)}else n=e;for(var a=0,o=n.length;a<o;a++)i.push(this.get(n[a],r));return i},t.prototype.getByRawIndex=function(e,r){if(!(r>=0&&r<this._rawCount))return NaN;var i=this._chunks[e];return i?i[r]:NaN},t.prototype.getSum=function(e){var r=this._chunks[e],i=0;if(r)for(var n=0,a=this.count();n<a;n++){var o=this.get(e,n);isNaN(o)||(i+=o)}return i},t.prototype.getMedian=function(e){var r=[];this.each([e],function(a){isNaN(a)||r.push(a)});var i=r.sort(function(a,o){return a-o}),n=this.count();return n===0?0:n%2===1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},t.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,i=r[e];if(i!=null&&i<this._count&&i===e)return e;for(var n=0,a=this._count-1;n<=a;){var o=(n+a)/2|0;if(r[o]<e)n=o+1;else if(r[o]>e)a=o-1;else return o}return-1},t.prototype.indicesOfNearest=function(e,r,i){var n=this._chunks,a=n[e],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,f=0,h=this.count();f<h;f++){var v=this.getRawIndex(f),c=r-a[v],d=Math.abs(c);d<=i&&((d<s||d===s&&c>=0&&l<0)&&(s=d,l=c,u=0),c===l&&(o[u++]=f))}return o.length=u,o},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var i=r.constructor,n=this._count;if(i===Array){e=new i(n);for(var a=0;a<n;a++)e[a]=r[a]}else e=new i(r.buffer,0,n)}else{var i=bo(this._rawCount);e=new i(this.count());for(var a=0;a<e.length;a++)e[a]=a}return e},t.prototype.filter=function(e,r){if(!this._count)return this;for(var i=this.clone(),n=i.count(),a=bo(i._rawCount),o=new a(n),s=[],l=e.length,u=0,f=e[0],h=i._chunks,v=0;v<n;v++){var c=void 0,d=i.getRawIndex(v);if(l===0)c=r(v);else if(l===1){var p=h[f][d];c=r(p,v)}else{for(var g=0;g<l;g++)s[g]=h[e[g]][d];s[g]=v,c=r.apply(null,s)}c&&(o[u++]=d)}return u<n&&(i._indices=o),i._count=u,i._extent=[],i._updateGetRawIdx(),i},t.prototype.selectRange=function(e){var r=this.clone(),i=r._count;if(!i)return this;var n=mt(e),a=n.length;if(!a)return this;var o=r.count(),s=bo(r._rawCount),l=new s(o),u=0,f=n[0],h=e[f][0],v=e[f][1],c=r._chunks,d=!1;if(!r._indices){var p=0;if(a===1){for(var g=c[n[0]],m=0;m<i;m++){var _=g[m];(_>=h&&_<=v||isNaN(_))&&(l[u++]=p),p++}d=!0}else if(a===2){for(var g=c[n[0]],y=c[n[1]],x=e[n[1]][0],S=e[n[1]][1],m=0;m<i;m++){var _=g[m],T=y[m];(_>=h&&_<=v||isNaN(_))&&(T>=x&&T<=S||isNaN(T))&&(l[u++]=p),p++}d=!0}}if(!d)if(a===1)for(var m=0;m<o;m++){var w=r.getRawIndex(m),_=c[n[0]][w];(_>=h&&_<=v||isNaN(_))&&(l[u++]=w)}else for(var m=0;m<o;m++){for(var b=!0,w=r.getRawIndex(m),A=0;A<a;A++){var M=n[A],_=c[M][w];(_<e[M][0]||_>e[M][1])&&(b=!1)}b&&(l[u++]=r.getRawIndex(m))}return u<o&&(r._indices=l),r._count=u,r._extent=[],r._updateGetRawIdx(),r},t.prototype.map=function(e,r){var i=this.clone(e);return this._updateDims(i,e,r),i},t.prototype.modify=function(e,r){this._updateDims(this,e,r)},t.prototype._updateDims=function(e,r,i){for(var n=e._chunks,a=[],o=r.length,s=e.count(),l=[],u=e._rawExtent,f=0;f<r.length;f++)u[r[f]]=ca();for(var h=0;h<s;h++){for(var v=e.getRawIndex(h),c=0;c<o;c++)l[c]=n[r[c]][v];l[o]=h;var d=i&&i.apply(null,l);if(d!=null){typeof d!="object"&&(a[0]=d,d=a);for(var f=0;f<d.length;f++){var p=r[f],g=d[f],m=u[p],_=n[p];_&&(_[v]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},t.prototype.lttbDownSample=function(e,r){var i=this.clone([e],!0),n=i._chunks,a=n[e],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),f,h,v,c=new(bo(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));c[s++]=u;for(var d=1;d<o-1;d+=l){for(var p=Math.min(d+l,o-1),g=Math.min(d+l*2,o),m=(g+p)/2,_=0,y=p;y<g;y++){var x=this.getRawIndex(y),S=a[x];isNaN(S)||(_+=S)}_/=g-p;var T=d,w=Math.min(d+l,o),b=d-1,A=a[u];f=-1,v=T;for(var M=-1,E=0,y=T;y<w;y++){var x=this.getRawIndex(y),S=a[x];if(isNaN(S)){E++,M<0&&(M=x);continue}h=Math.abs((b-m)*(S-A)-(b-y)*(_-A)),h>f&&(f=h,v=x)}E>0&&E<w-T&&(c[s++]=Math.min(M,v),v=Math.max(M,v)),c[s++]=v,u=v}return c[s++]=this.getRawIndex(o-1),i._count=s,i._indices=c,i.getRawIndex=this._getRawIdx,i},t.prototype.downSample=function(e,r,i,n){for(var a=this.clone([e],!0),o=a._chunks,s=[],l=Math.floor(1/r),u=o[e],f=this.count(),h=a._rawExtent[e]=ca(),v=new(bo(this._rawCount))(Math.ceil(f/l)),c=0,d=0;d<f;d+=l){l>f-d&&(l=f-d,s.length=l);for(var p=0;p<l;p++){var g=this.getRawIndex(d+p);s[p]=u[g]}var m=i(s),_=this.getRawIndex(Math.min(d+n(s,m)||0,f-1));u[_]=m,m<h[0]&&(h[0]=m),m>h[1]&&(h[1]=m),v[c++]=_}return a._count=c,a._indices=v,a._updateGetRawIdx(),a},t.prototype.each=function(e,r){if(this._count)for(var i=e.length,n=this._chunks,a=0,o=this.count();a<o;a++){var s=this.getRawIndex(a);switch(i){case 0:r(a);break;case 1:r(n[e[0]][s],a);break;case 2:r(n[e[0]][s],n[e[1]][s],a);break;default:for(var l=0,u=[];l<i;l++)u[l]=n[e[l]][s];u[l]=a,r.apply(null,u)}}},t.prototype.getDataExtent=function(e){var r=this._chunks[e],i=ca();if(!r)return i;var n=this.count(),a=!this._indices,o;if(a)return this._rawExtent[e].slice();if(o=this._extent[e],o)return o.slice();o=i;for(var s=o[0],l=o[1],u=0;u<n;u++){var f=this.getRawIndex(u),h=r[f];h<s&&(s=h),h>l&&(l=h)}return o=[s,l],this._extent[e]=o,o},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var i=[],n=this._chunks,a=0;a<n.length;a++)i.push(n[a][r]);return i},t.prototype.clone=function(e,r){var i=new t,n=this._chunks,a=e&&Qn(e,function(s,l){return s[l]=!0,s},{});if(a)for(var o=0;o<n.length;o++)i._chunks[o]=a[o]?bD(n[o]):n[o];else i._chunks=n;return this._copyCommonProps(i),r||(i._indices=this._cloneIndices()),i._updateGetRawIdx(),i},t.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=ut(this._extent),e._rawExtent=ut(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,r=void 0;if(e===Array){var i=this._indices.length;r=new e(i);for(var n=0;n<i;n++)r[n]=this._indices[n]}else r=new e(this._indices);return r}return null},t.prototype._getRawIdxIdentity=function(e){return e},t.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function e(r,i,n,a){return fu(r[a],this._dimensions[a])}qh={arrayRows:e,objectRows:function(r,i,n,a){return fu(r[i],this._dimensions[a])},keyedColumns:e,original:function(r,i,n,a){var o=r&&(r.value==null?r:r.value);return fu(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,i,n,a){return r[a]}}}(),t}(),RT=function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),i=!!r.length,n,a;if(xl(e)){var o=e,s=void 0,l=void 0,u=void 0;if(i){var f=r[0];f.prepareSource(),u=f.getSource(),s=u.data,l=u.sourceFormat,a=[f._getVersionSign()]}else s=o.get("data",!0),l=Ke(s)?Xi:wr,a=[];var h=this._getSourceMetaRawOption()||{},v=u&&u.metaRawOption||{},c=ft(h.seriesLayoutBy,v.seriesLayoutBy)||null,d=ft(h.sourceHeader,v.sourceHeader),p=ft(h.dimensions,v.dimensions),g=c!==v.seriesLayoutBy||!!d!=!!v.sourceHeader||p;n=g?[Fv(s,{seriesLayoutBy:c,sourceHeader:d,dimensions:p},l)]:[]}else{var m=e;if(i){var _=this._applyTransform(r);n=_.sourceList,a=_.upstreamSignList}else{var y=m.get("source",!0);n=[Fv(y,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},t.prototype._applyTransform=function(e){var r=this._sourceHost,i=r.get("transform",!0),n=r.get("fromTransformResult",!0);if(n!=null){var a="";e.length!==1&&Jm(a)}var o,s=[],l=[];return C(e,function(u){u.prepareSource();var f=u.getSource(n||0),h="";n!=null&&!f&&Jm(h),s.push(f),l.push(u._getVersionSign())}),i?o=xD(i,s,{datasetIndex:r.componentIndex}):n!=null&&(o=[iD(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r<e.length;r++){var i=e[r];if(i._isDirty()||this._upstreamSignList[r]!==i._getVersionSign())return!0}},t.prototype.getSource=function(e){e=e||0;var r=this._sourceList[e];if(!r){var i=this._getUpstreamSourceManagers();return i[0]&&i[0].getSource(e)}return r},t.prototype.getSharedDataStore=function(e){var r=e.makeStoreSchema();return this._innerGetDataStore(r.dimensions,e.source,r.hash)},t.prototype._innerGetDataStore=function(e,r,i){var n=0,a=this._storeList,o=a[n];o||(o=a[n]={});var s=o[i];if(!s){var l=this._getUpstreamSourceManagers()[0];xl(this._sourceHost)&&l?s=l._innerGetDataStore(e,r,i):(s=new kv,s.initData(new bT(r,e.length),e)),o[i]=s}return s},t.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(xl(e)){var r=gT(e);return r?[r.getSourceManager()]:[]}else return tt(RC(e),function(i){return i.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,r,i,n;if(xl(e))r=e.get("seriesLayoutBy",!0),i=e.get("sourceHeader",!0),n=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var a=e;r=a.get("seriesLayoutBy",!0),i=a.get("sourceHeader",!0),n=a.get("dimensions",!0)}return{seriesLayoutBy:r,sourceHeader:i,dimensions:n}},t}();function Qm(t){var e=t.option.transform;e&&xu(t.option.transform)}function xl(t){return t.mainType==="series"}function Jm(t){throw new Error(t)}var PT="line-height:1";function IT(t,e){var r=t.color||"#6e7079",i=t.fontSize||12,n=t.fontWeight||"400",a=t.color||"#464646",o=t.fontSize||14,s=t.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+_e(i+"")+"px;color:"+_e(r)+";font-weight:"+_e(n+""),valueStyle:"font-size:"+_e(o+"")+"px;color:"+_e(a)+";font-weight:"+_e(s+"")}:{nameStyle:{fontSize:i,fill:r,fontWeight:n},valueStyle:{fontSize:o,fill:a,fontWeight:s}}}var AD=[0,10,20,30],ED=["",`
`,`
`,`
`];function Ms(t,e){return e.type=t,e}function zv(t){return t.type==="section"}function NT(t){return zv(t)?MD:CD}function OT(t){if(zv(t)){var e=0,r=t.blocks.length,i=r>1||r>0&&!t.noHeader;return C(t.blocks,function(n){var a=OT(n);a>=e&&(e=a+ +(i&&(!a||zv(n)&&!n.noHeader)))}),e}return 0}function MD(t,e,r,i){var n=e.noHeader,a=DD(OT(e)),o=[],s=e.blocks||[];xr(!s||j(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(gt(u,l)){var f=new cD(u[l],null);s.sort(function(d,p){return f.evaluate(d.sortParam,p.sortParam)})}else l==="seriesDesc"&&s.reverse()}C(s,function(d,p){var g=e.valueFormatter,m=NT(d)(g?Y(Y({},t),{valueFormatter:g}):t,d,p>0?a.html:0,i);m!=null&&o.push(m)});var h=t.renderMode==="richText"?o.join(a.richText):Uv(o.join(""),n?r:a.html);if(n)return h;var v=Bv(e.header,"ordinal",t.useUTC),c=IT(i,t.renderMode).nameStyle;return t.renderMode==="richText"?BT(t,v,c)+a.richText+h:Uv('<div style="'+c+";"+PT+';">'+_e(v)+"</div>"+h,r)}function CD(t,e,r,i){var n=t.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,f=e.valueFormatter||t.valueFormatter||function(x){return x=j(x)?x:[x],tt(x,function(S,T){return Bv(S,j(c)?c[T]:c,u)})};if(!(a&&o)){var h=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",n),v=a?"":Bv(l,"ordinal",u),c=e.valueType,d=o?[]:f(e.value,e.dataIndex),p=!s||!a,g=!s&&a,m=IT(i,n),_=m.nameStyle,y=m.valueStyle;return n==="richText"?(s?"":h)+(a?"":BT(t,v,_))+(o?"":PD(t,d,p,g,y)):Uv((s?"":h)+(a?"":LD(v,!s,_))+(o?"":RD(d,p,g,y)),r)}}function t0(t,e,r,i,n,a){if(t){var o=NT(t),s={useUTC:n,renderMode:r,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,a)}}function DD(t){return{html:AD[t],richText:ED[t]}}function Uv(t,e){var r='<div style="clear:both"></div>',i="margin: "+e+"px 0 0";return'<div style="'+i+";"+PT+';">'+t+r+"</div>"}function LD(t,e,r){var i=e?"margin-left:2px":"";return'<span style="'+r+";"+i+'">'+_e(t)+"</span>"}function RD(t,e,r,i){var n=r?"10px":"20px",a=e?"float:right;margin-left:"+n:"";return t=j(t)?t:[t],'<span style="'+a+";"+i+'">'+tt(t,function(o){return _e(o)}).join("&nbsp;&nbsp;")+"</span>"}function BT(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function PD(t,e,r,i,n){var a=[n],o=i?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(j(e)?e.join(" "):e,a)}function ID(t,e){var r=t.getData().getItemVisual(e,"style"),i=r[t.visualDrawType];return $n(i)}function FT(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var $h=function(){function t(){this.richTextStyles={},this._nextStyleNameId=sx()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,i){var n=i==="richText"?this._generateStyleName():null,a=lT({color:r,type:e,renderMode:i,markerId:n});return Q(a)?a:(this.richTextStyles[n]=a.style,a.content)},t.prototype.wrapRichTextStyle=function(e,r){var i={};j(r)?C(r,function(a){return Y(i,a)}):Y(i,r);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+e+"}"},t}();function ND(t){var e=t.series,r=t.dataIndex,i=t.multipleSeries,n=e.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(r),l=j(s),u=ID(e,r),f,h,v,c;if(o>1||l&&!o){var d=OD(s,e,r,a,u);f=d.inlineValues,h=d.inlineValueTypes,v=d.blocks,c=d.inlineValues[0]}else if(o){var p=n.getDimensionInfo(a[0]);c=f=Qa(n,r,a[0]),h=p.type}else c=f=l?s[0]:s;var g=Hd(e),m=g&&e.name||"",_=n.getName(r),y=i?m:_;return Ms("section",{header:m,noHeader:i||!g,sortParam:c,blocks:[Ms("nameValue",{markerType:"item",markerColor:u,name:y,noName:!jr(y),value:f,valueType:h,dataIndex:r})].concat(v||[])})}function OD(t,e,r,i,n){var a=e.getData(),o=Qn(t,function(h,v,c){var d=a.getDimensionInfo(c);return h=h||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];i.length?C(i,function(h){f(Qa(a,r,h),h)}):C(t,f);function f(h,v){var c=a.getDimensionInfo(v);!c||c.otherDims.tooltip===!1||(o?u.push(Ms("nameValue",{markerType:"subItem",markerColor:n,name:c.displayName,value:h,valueType:c.type})):(s.push(h),l.push(c.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Mi=Yt();function Tl(t,e){return t.getName(e)||t.getId(e)}var BD="__universalTransitionEnabled",yi=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,i,n){this.seriesIndex=this.componentIndex,this.dataTask=hs({count:kD,reset:zD}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,n);var a=Mi(this).sourceManager=new RT(this);a.prepareSource();var o=this.getInitialData(r,n);r0(o,this),this.dataTask.context.data=o,Mi(this).dataBeforeProcessed=o,e0(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,i){var n=As(this),a=n?Zs(r):{},o=this.subType;Rt.hasClass(o)&&(o+="Series"),dt(r,i.getTheme().get(this.subType)),dt(r,this.getDefaultOption()),zg(r,"label",["show"]),this.fillDataTextStyle(r.data),n&&Kn(r,a,n)},e.prototype.mergeOption=function(r,i){r=dt(this.option,r,!0),this.fillDataTextStyle(r.data);var n=As(this);n&&Kn(this.option,r,n);var a=Mi(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,i);r0(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Mi(this).dataBeforeProcessed=o,e0(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!Ke(r))for(var i=["show"],n=0;n<r.length;n++)r[n]&&r[n].label&&zg(r[n],"label",i)},e.prototype.getInitialData=function(r,i){},e.prototype.appendData=function(r){var i=this.getRawData();i.appendData(r.data)},e.prototype.getData=function(r){var i=Hv(this);if(i){var n=i.context.data;return r==null||!n.getLinkedData?n:n.getLinkedData(r)}else return Mi(this).data},e.prototype.getAllData=function(){var r=this.getData();return r&&r.getLinkedDataAll?r.getLinkedDataAll():[{data:r}]},e.prototype.setData=function(r){var i=Hv(this);if(i){var n=i.context;n.outputData=r,i!==this.dataTask&&(n.data=r)}Mi(this).data=r},e.prototype.getEncode=function(){var r=this.get("encode",!0);if(r)return ht(r)},e.prototype.getSourceManager=function(){return Mi(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return Mi(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var r=this.get("colorBy");return r||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var r=this.coordinateSystem;return r&&r.getBaseAxis&&r.getBaseAxis()},e.prototype.formatTooltip=function(r,i,n){return ND({series:this,dataIndex:r,multipleSeries:i})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(vt.node&&!(r&&r.ssr))return!1;var i=this.getShallow("animation");return i&&this.getData().count()>this.getShallow("animationThreshold")&&(i=!1),!!i},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,i,n){var a=this.ecModel,o=dp.prototype.getColorFromPalette.call(this,r,i,n);return o||(o=a.getColorFromPalette(r,i,n)),o},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,i){this._innerSelect(this.getData(i),r)},e.prototype.unselect=function(r,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<r.length;s++){var l=r[s],u=Tl(o,l);n[u]=!1,this._selectedDataIndicesMap[u]=-1}}},e.prototype.toggleSelect=function(r,i){for(var n=[],a=0;a<r.length;a++)n[0]=r[a],this.isSelected(r[a],i)?this.unselect(n,i):this.select(n,i)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var r=this._selectedDataIndicesMap,i=mt(r),n=[],a=0;a<i.length;a++){var o=r[i[a]];o>=0&&n.push(o)}return n},e.prototype.isSelected=function(r,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[Tl(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[BD])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){rt(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,f=0;f<l;f++){var h=i[f],v=Tl(r,h);u[v]=!0,this._selectedDataIndicesMap[v]=r.getRawIndex(h)}}else if(s==="single"||s===!0){var c=i[l-1],v=Tl(r,c);o.selectedMap=(n={},n[v]=!0,n),this._selectedDataIndicesMap=(a={},a[v]=r.getRawIndex(c),a)}}},e.prototype._initSelectedMapFromData=function(r){if(!this.option.selectedMap){var i=[];r.hasItemOption&&r.each(function(n){var a=r.getRawDataItem(n);a&&a.selected&&i.push(n)}),i.length>0&&this._innerSelect(r,i)}},e.registerClass=function(r){return Rt.registerClass(r)},e.protoInitialize=function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),e}(Rt);kr(yi,fD);kr(yi,dp);px(yi,Rt);function e0(t){var e=t.name;Hd(t)||(t.name=FD(t)||e)}function FD(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),i=[];return C(r,function(n){var a=e.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function kD(t){return t.model.getRawData().count()}function zD(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),UD}function UD(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function r0(t,e){C(ob(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,le(HD,e))})}function HD(t,e){var r=Hv(t);return r&&r.setOutputEnd((e||this).count()),e}function Hv(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var i=r.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(t.uid))}return i}}var ze=function(){function t(){this.group=new ee,this.uid=Lf("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,i,n){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,i,n){},t.prototype.updateLayout=function(e,r,i,n){},t.prototype.updateVisual=function(e,r,i,n){},t.prototype.toggleBlurSeries=function(e,r,i){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t}();Gd(ze);_f(ze);function kT(){var t=Yt();return function(e){var r=t(e),i=e.pipelineContext,n=!!r.large,a=!!r.progressiveRender,o=r.large=!!(i&&i.large),s=r.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var zT=Yt(),VD=kT(),Nr=function(){function t(){this.group=new ee,this.uid=Lf("viewChart"),this.renderTask=hs({plan:GD,reset:WD}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,i,n){},t.prototype.highlight=function(e,r,i,n){var a=e.getData(n&&n.dataType);a&&n0(a,n,"emphasis")},t.prototype.downplay=function(e,r,i,n){var a=e.getData(n&&n.dataType);a&&n0(a,n,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,i,n){this.render(e,r,i,n)},t.prototype.updateLayout=function(e,r,i,n){this.render(e,r,i,n)},t.prototype.updateVisual=function(e,r,i,n){this.render(e,r,i,n)},t.prototype.eachRendered=function(e){ap(this.group,e)},t.markUpdateMethod=function(e,r){zT(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function i0(t,e,r){t&&Rv(t)&&(e==="emphasis"?Pu:Iu)(t,r)}function n0(t,e,r){var i=qn(t,e),n=e&&e.highlightKey!=null?uM(e.highlightKey):null;i!=null?C(ue(i),function(a){i0(t.getItemGraphicEl(a),r,n)}):t.eachItemGraphicEl(function(a){i0(a,r,n)})}Gd(Nr);_f(Nr);function GD(t){return VD(t.model)}function WD(t){var e=t.model,r=t.ecModel,i=t.api,n=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=n&&zT(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,i,n),XD[l]}var XD={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Hu="\0__throttleOriginMethod",a0="\0__throttleRate",o0="\0__throttleType";function yp(t,e,r){var i,n=0,a=0,o=null,s,l,u,f;e=e||0;function h(){a=new Date().getTime(),o=null,t.apply(l,u||[])}var v=function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];i=new Date().getTime(),l=this,u=c;var p=f||e,g=f||r;f=null,s=i-(g?n:a)-p,clearTimeout(o),g?o=setTimeout(h,p):s>=0?h():o=setTimeout(h,-s),n=i};return v.clear=function(){o&&(clearTimeout(o),o=null)},v.debounceNextCall=function(c){f=c},v}function zf(t,e,r,i){var n=t[e];if(n){var a=n[Hu]||n,o=n[o0],s=n[a0];if(s!==r||o!==i){if(r==null||!i)return t[e]=a;n=t[e]=yp(a,r,i==="debounce"),n[Hu]=a,n[o0]=i,n[a0]=r}return n}}function Vu(t,e){var r=t[e];r&&r[Hu]&&(r.clear&&r.clear(),t[e]=r[Hu])}var s0=Yt(),l0={itemStyle:Ts($x,!0),lineStyle:Ts(qx,!0)},YD={lineStyle:"stroke",itemStyle:"fill"};function UT(t,e){var r=t.visualStyleMapper||l0[e];return r||(console.warn("Unknown style type '"+e+"'."),l0.itemStyle)}function HT(t,e){var r=t.visualDrawType||YD[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var ZD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),i=t.visualStyleAccessPath||"itemStyle",n=t.getModel(i),a=UT(t,i),o=a(n),s=n.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=HT(t,i),u=o[l],f=ct(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||f||h){var v=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=v,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ct(o.fill)?v:o.fill,o.stroke=o.stroke==="auto"||ct(o.stroke)?v:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&f)return r.setVisual("colorFromPalette",!1),{dataEach:function(c,d){var p=t.getDataParams(d),g=Y({},o);g[l]=f(p),c.setItemVisual(d,"style",g)}}}},Ao=new Zt,qD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),i=t.visualStyleAccessPath||"itemStyle",n=UT(t,i),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){Ao.option=l[i];var u=n(Ao),f=o.ensureUniqueItemVisual(s,"style");Y(f,u),Ao.option.decal&&(o.setItemVisual(s,"decal",Ao.option.decal),Ao.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},$D={performRawSeries:!0,overallReset:function(t){var e=ht();t.eachSeries(function(r){var i=r.getColorBy();if(!r.isColorBySeries()){var n=r.type+"-"+i,a=e.get(n);a||(a={},e.set(n,a)),s0(r).scope=a}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var i=r.getRawData(),n={},a=r.getData(),o=s0(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=HT(r,s);a.each(function(u){var f=a.getRawIndex(u);n[f]=u}),i.each(function(u){var f=n[u],h=a.getItemVisual(f,"colorFromPalette");if(h){var v=a.ensureUniqueItemVisual(f,"style"),c=i.getName(u)||u+"",d=i.count();v[l]=r.getColorFromPalette(c,o,d)}})}})}},Sl=Math.PI;function KD(t,e){e=e||{},Et(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var r=new ee,i=new Kt({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(i);var n=new Xt({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Kt({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(a);var o;return e.showSpinner&&(o=new Ef({shape:{startAngle:-Sl/2,endAngle:-Sl/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Sl*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Sl*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=n.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),f=t.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:f}),a.setShape({x:u-l,y:f-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var VT=function(){function t(e,r,i,n){this._stageTaskMap=ht(),this.ecInstance=e,this.api=r,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,a=!r&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var i=this._pipelineMap.get(e.uid),n=e.getData(),a=n.count(),o=i.progressiveEnabled&&r.incrementalPrepareRender&&a>=i.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},t.prototype.restorePipelines=function(e){var r=this,i=r._pipelineMap=ht();e.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),r._pipe(n,n.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),i=this.api;C(this._allHandlers,function(n){var a=e.get(n.uid)||e.set(n.uid,{}),o="";xr(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,r,i),n.overallReset&&this._createOverallStageTask(n,a,r,i)},this)},t.prototype.prepareView=function(e,r,i,n){var a=e.renderTask,o=a.context;o.model=r,o.ecModel=i,o.api=n,a.__block=!e.incrementalPrepareRender,this._pipe(r,a)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,i){this._performStageTasks(this._visualHandlers,e,r,i)},t.prototype._performStageTasks=function(e,r,i,n){n=n||{};var a=!1,o=this;C(e,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var f=o._stageTaskMap.get(l.uid),h=f.seriesTaskMap,v=f.overallTask;if(v){var c,d=v.agentStubMap;d.each(function(g){s(n,g)&&(g.dirty(),c=!0)}),c&&v.dirty(),o.updatePayload(v,i);var p=o.getPerformArgs(v,n.block);d.each(function(g){g.perform(p)}),v.perform(p)&&(a=!0)}else h&&h.each(function(g,m){s(n,g)&&g.dirty();var _=o.getPerformArgs(g,n.block);_.skip=!l.performRawSeries&&r.isSeriesFiltered(g.context.model),o.updatePayload(g,i),g.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(i){r=i.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,i,n){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=ht(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?i.eachRawSeries(f):l?i.eachRawSeriesByType(l,f):u&&u(i,n).each(f);function f(h){var v=h.uid,c=s.set(v,o&&o.get(v)||hs({plan:eL,reset:rL,count:nL}));c.context={model:h,ecModel:i,api:n,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(h,c)}},t.prototype._createOverallStageTask=function(e,r,i,n){var a=this,o=r.overallTask=r.overallTask||hs({reset:jD});o.context={ecModel:i,api:n,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=ht(),u=e.seriesType,f=e.getTargetSeries,h=!0,v=!1,c="";xr(!e.createOnAllSeries,c),u?i.eachRawSeriesByType(u,d):f?f(i,n).each(d):(h=!1,C(i.getSeries(),d));function d(p){var g=p.uid,m=l.set(g,s&&s.get(g)||(v=!0,hs({reset:QD,onDirty:tL})));m.context={model:p,overallProgress:h},m.agent=o,m.__block=h,a._pipe(p,m)}v&&o.dirty()},t.prototype._pipe=function(e,r){var i=e.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=r),n.tail&&n.tail.pipe(r),n.tail=r,r.__idxInPipeline=n.count++,r.__pipeline=n},t.wrapStageHandler=function(e,r){return ct(e)&&(e={overallReset:e,seriesType:aL(e)}),e.uid=Lf("stageHandler"),r&&(e.visualType=r),e},t}();function jD(t){t.overallReset(t.ecModel,t.api,t.payload)}function QD(t){return t.overallProgress&&JD}function JD(){this.agent.dirty(),this.getDownstream().dirty()}function tL(){this.agent&&this.agent.dirty()}function eL(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function rL(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=ue(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?tt(e,function(r,i){return GT(i)}):iL}var iL=GT(0);function GT(t){return function(e,r){var i=r.data,n=r.resetDefines[t];if(n&&n.dataEach)for(var a=e.start;a<e.end;a++)n.dataEach(i,a);else n&&n.progress&&n.progress(e,i)}}function nL(t){return t.data.count()}function aL(t){Gu=null;try{t(Cs,WT)}catch{}return Gu}var Cs={},WT={},Gu;XT(Cs,pp);XT(WT,_T);Cs.eachSeriesByType=Cs.eachRawSeriesByType=function(t){Gu=t};Cs.eachComponent=function(t){t.mainType==="series"&&t.subType&&(Gu=t.subType)};function XT(t,e){for(var r in e.prototype)t[r]=Te}var u0=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const oL={color:u0,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],u0]};var Re="#B9B8CE",f0="#100C2A",wl=function(){return{axisLine:{lineStyle:{color:Re}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},h0=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],YT={darkMode:!0,color:h0,backgroundColor:f0,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:Re}},textStyle:{color:Re},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:Re}},dataZoom:{borderColor:"#71708A",textStyle:{color:Re},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:Re}},timeline:{lineStyle:{color:Re},label:{color:Re},controlStyle:{color:Re,borderColor:Re}},calendar:{itemStyle:{color:f0},dayLabel:{color:Re},monthLabel:{color:Re},yearLabel:{color:Re}},timeAxis:wl(),logAxis:wl(),valueAxis:wl(),categoryAxis:wl(),line:{symbol:"circle"},graph:{color:h0},gauge:{title:{color:Re},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:Re},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};YT.categoryAxis.splitLine.show=!1;var sL=function(){function t(){}return t.prototype.normalizeQuery=function(e){var r={},i={},n={};if(Q(e)){var a=Qr(e);r.mainType=a.main||null,r.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};C(e,function(l,u){for(var f=!1,h=0;h<o.length;h++){var v=o[h],c=u.lastIndexOf(v);if(c>0&&c===u.length-v.length){var d=u.slice(0,c);d!=="data"&&(r.mainType=d,r[v.toLowerCase()]=l,f=!0)}}s.hasOwnProperty(u)&&(i[u]=l,f=!0),f||(n[u]=l)})}return{cptQuery:r,dataQuery:i,otherQuery:n}},t.prototype.filter=function(e,r){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return f(l,o,"mainType")&&f(l,o,"subType")&&f(l,o,"index","componentIndex")&&f(l,o,"name")&&f(l,o,"id")&&f(u,a,"name")&&f(u,a,"dataIndex")&&f(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,n,a));function f(h,v,c,d){return h[c]==null||v[d||c]===h[c]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),Vv=["symbol","symbolSize","symbolRotate","symbolOffset"],c0=Vv.concat(["symbolKeepAspect"]),lL={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o<Vv.length;o++){var s=Vv[o],l=t.get(s);ct(l)?(a=!0,n[s]=l):i[s]=l}if(i.symbol=i.symbol||t.defaultSymbol,r.setVisual(Y({legendIcon:t.legendIcon||i.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},i)),e.isSeriesFiltered(t))return;var u=mt(n);function f(h,v){for(var c=t.getRawValue(v),d=t.getDataParams(v),p=0;p<u.length;p++){var g=u[p];h.setItemVisual(v,g,n[g](c,d))}}return{dataEach:a?f:null}}},uL={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.hasSymbolVisual||e.isSeriesFiltered(t))return;var r=t.getData();function i(n,a){for(var o=n.getItemModel(a),s=0;s<c0.length;s++){var l=c0[s],u=o.getShallow(l,!0);u!=null&&n.setItemVisual(a,l,u)}}return{dataEach:r.hasItemOption?i:null}}};function ZT(t,e,r){switch(r){case"color":var i=t.getItemVisual(e,"style");return i[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,r)}}function qT(t,e){switch(e){case"color":var r=t.getVisual("style");return r[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function fL(t,e,r,i){switch(r){case"color":var n=t.ensureUniqueItemVisual(e,"style");n[t.getVisual("drawType")]=i,t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,r,i);break}}function va(t,e,r,i,n){var a=t+e;r.isSilent(a)||i.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,u=n.selected,f=0;f<u.length;f++)if(u[f].seriesIndex===s){var h=o.getData(),v=qn(h,n.fromActionPayload);r.trigger(a,{type:a,seriesId:o.id,name:j(v)?h.getName(v[0]):h.getName(v),selected:Q(l)?l:Y({},l)})}})}function hL(t,e,r){t.on("selectchanged",function(i){var n=r.getModel();i.isFromClick?(va("map","selectchanged",e,n,i),va("pie","selectchanged",e,n,i)):i.fromAction==="select"?(va("map","selected",e,n,i),va("pie","selected",e,n,i)):i.fromAction==="unselect"&&(va("map","unselected",e,n,i),va("pie","unselected",e,n,i))})}function Ba(t,e,r){for(var i;t&&!(e(t)&&(i=t,r));)t=t.__hostTarget||t.parent;return i}var cL=Math.round(Math.random()*9),vL=typeof Object.defineProperty=="function",dL=function(){function t(){this._id="__ec_inner_"+cL++}return t.prototype.get=function(e){return this._guard(e)[this._id]},t.prototype.set=function(e,r){var i=this._guard(e);return vL?Object.defineProperty(i,this._id,{value:r,enumerable:!1,configurable:!0}):i[this._id]=r,this},t.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},t.prototype.has=function(e){return!!this._guard(e)[this._id]},t.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},t}(),pL=kt.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,i=e.cy,n=e.width/2,a=e.height/2;t.moveTo(r,i-a),t.lineTo(r+n,i+a),t.lineTo(r-n,i+a),t.closePath()}}),gL=kt.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,i=e.cy,n=e.width/2,a=e.height/2;t.moveTo(r,i-a),t.lineTo(r+n,i),t.lineTo(r,i+a),t.lineTo(r-n,i),t.closePath()}}),mL=kt.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.x,i=e.y,n=e.width/5*3,a=Math.max(n,e.height),o=n/2,s=o*o/(a-o),l=i-a+o+s,u=Math.asin(s/o),f=Math.cos(u)*o,h=Math.sin(u),v=Math.cos(u),c=o*.6,d=o*.7;t.moveTo(r-f,l+s),t.arc(r,l,o,Math.PI-u,Math.PI*2+u),t.bezierCurveTo(r+f-h*c,l+s+v*c,r,i-d,r,i),t.bezierCurveTo(r,i-d,r-f+h*c,l+s+v*c,r-f,l+s),t.closePath()}}),_L=kt.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.height,i=e.width,n=e.x,a=e.y,o=i/3*2;t.moveTo(n,a),t.lineTo(n+o,a+r),t.lineTo(n,a+r/4*3),t.lineTo(n-o,a+r),t.lineTo(n,a),t.closePath()}}),yL={line:qi,rect:Kt,roundRect:Kt,square:Kt,circle:bf,diamond:gL,pin:mL,arrow:_L,triangle:pL},xL={line:function(t,e,r,i,n){n.x1=t,n.y1=e+i/2,n.x2=t+r,n.y2=e+i/2},rect:function(t,e,r,i,n){n.x=t,n.y=e,n.width=r,n.height=i},roundRect:function(t,e,r,i,n){n.x=t,n.y=e,n.width=r,n.height=i,n.r=Math.min(r,i)/4},square:function(t,e,r,i,n){var a=Math.min(r,i);n.x=t,n.y=e,n.width=a,n.height=a},circle:function(t,e,r,i,n){n.cx=t+r/2,n.cy=e+i/2,n.r=Math.min(r,i)/2},diamond:function(t,e,r,i,n){n.cx=t+r/2,n.cy=e+i/2,n.width=r,n.height=i},pin:function(t,e,r,i,n){n.x=t+r/2,n.y=e+i/2,n.width=r,n.height=i},arrow:function(t,e,r,i,n){n.x=t+r/2,n.y=e+i/2,n.width=r,n.height=i},triangle:function(t,e,r,i,n){n.cx=t+r/2,n.cy=e+i/2,n.width=r,n.height=i}},Wu={};C(yL,function(t,e){Wu[e]=new t});var TL=kt.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,r){var i=tx(t,e,r),n=this.shape;return n&&n.symbolType==="pin"&&e.position==="inside"&&(i.y=r.y+r.height*.4),i},buildPath:function(t,e,r){var i=e.symbolType;if(i!=="none"){var n=Wu[i];n||(i="rect",n=Wu[i]),xL[i](e.x,e.y,e.width,e.height,n.shape),n.buildPath(t,n.shape,r)}}});function SL(t,e){if(this.type!=="image"){var r=this.style;this.__isEmptyBrush?(r.stroke=t,r.fill=e||"#fff",r.lineWidth=2):this.shape.symbolType==="line"?r.stroke=t:r.fill=t,this.markRedraw()}}function Br(t,e,r,i,n,a,o){var s=t.indexOf("empty")===0;s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return t.indexOf("image://")===0?l=Vx(t.slice(8),new Pt(e,r,i,n),o?"center":"cover"):t.indexOf("path://")===0?l=rp(t.slice(7),{},new Pt(e,r,i,n),o?"center":"cover"):l=new TL({shape:{symbolType:t,x:e,y:r,width:i,height:n}}),l.__isEmptyBrush=s,l.setColor=SL,a&&l.setColor(a),l}function wL(t){return j(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function $T(t,e){if(t!=null)return j(t)||(t=[t,t]),[se(t[0],e[0])||0,se(ft(t[1],t[0]),e[1])||0]}function Fn(t){return isFinite(t)}function bL(t,e,r){var i=e.x==null?0:e.x,n=e.x2==null?1:e.x2,a=e.y==null?0:e.y,o=e.y2==null?0:e.y2;e.global||(i=i*r.width+r.x,n=n*r.width+r.x,a=a*r.height+r.y,o=o*r.height+r.y),i=Fn(i)?i:0,n=Fn(n)?n:1,a=Fn(a)?a:0,o=Fn(o)?o:0;var s=t.createLinearGradient(i,a,n,o);return s}function AL(t,e,r){var i=r.width,n=r.height,a=Math.min(i,n),o=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(o=o*i+r.x,s=s*n+r.y,l=l*a),o=Fn(o)?o:.5,s=Fn(s)?s:.5,l=l>=0&&Fn(l)?l:.5;var u=t.createRadialGradient(o,s,0,o,s,l);return u}function Gv(t,e,r){for(var i=e.type==="radial"?AL(t,e,r):bL(t,e,r),n=e.colorStops,a=0;a<n.length;a++)i.addColorStop(n[a].offset,n[a].color);return i}function EL(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!0;return!1}function bl(t){return parseInt(t,10)}function Fa(t,e,r){var i=["width","height"][e],n=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],o=["paddingRight","paddingBottom"][e];if(r[i]!=null&&r[i]!=="auto")return parseFloat(r[i]);var s=document.defaultView.getComputedStyle(t);return(t[n]||bl(s[i])||bl(t.style[i]))-(bl(s[a])||0)-(bl(s[o])||0)|0}function ML(t,e){return!t||t==="solid"||!(e>0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:$t(t)?[t]:j(t)?t:null}function xp(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&ML(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(r){var n=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;n&&n!==1&&(r=tt(r,function(a){return a/n}),i/=n)}return[r,i]}var CL=new _i(!0);function Xu(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function v0(t){return typeof t=="string"&&t!=="none"}function Yu(t){var e=t.fill;return e!=null&&e!=="none"}function d0(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function p0(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function Wv(t,e,r){var i=Wd(e.image,e.__image,r);if(yf(i)){var n=t.createPattern(i,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*tu),a.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(a)}return n}}function DL(t,e,r,i){var n,a=Xu(r),o=Yu(r),s=r.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var f=e.path||CL,h=e.__dirty;if(!i){var v=r.fill,c=r.stroke,d=o&&!!v.colorStops,p=a&&!!c.colorStops,g=o&&!!v.image,m=a&&!!c.image,_=void 0,y=void 0,x=void 0,S=void 0,T=void 0;(d||p)&&(T=e.getBoundingRect()),d&&(_=h?Gv(t,v,T):e.__canvasFillGradient,e.__canvasFillGradient=_),p&&(y=h?Gv(t,c,T):e.__canvasStrokeGradient,e.__canvasStrokeGradient=y),g&&(x=h||!e.__canvasFillPattern?Wv(t,v,e):e.__canvasFillPattern,e.__canvasFillPattern=x),m&&(S=h||!e.__canvasStrokePattern?Wv(t,c,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),d?t.fillStyle=_:g&&(x?t.fillStyle=x:o=!1),p?t.strokeStyle=y:m&&(S?t.strokeStyle=S:a=!1)}var w=e.getGlobalScale();f.setScale(w[0],w[1],e.segmentIgnoreThreshold);var b,A;t.setLineDash&&r.lineDash&&(n=xp(e),b=n[0],A=n[1]);var M=!0;(u||h&Ca)&&(f.setDPR(t.dpr),l?f.setContext(null):(f.setContext(t),M=!1),f.reset(),e.buildPath(f,e.shape,i),f.toStatic(),e.pathUpdated()),M&&f.rebuildPath(t,l?s:1),b&&(t.setLineDash(b),t.lineDashOffset=A),i||(r.strokeFirst?(a&&p0(t,r),o&&d0(t,r)):(o&&d0(t,r),a&&p0(t,r))),b&&t.setLineDash([])}function LL(t,e,r){var i=e.__image=Wd(r.image,e.__image,e,e.onload);if(!(!i||!yf(i))){var n=r.x||0,a=r.y||0,o=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),r.sWidth&&r.sHeight){var u=r.sx||0,f=r.sy||0;t.drawImage(i,u,f,r.sWidth,r.sHeight,n,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,f=r.sy,h=o-u,v=s-f;t.drawImage(i,u,f,h,v,n,a,o,s)}else t.drawImage(i,n,a,o,s)}}function RL(t,e,r){var i,n=r.text;if(n!=null&&(n+=""),n){t.font=r.font||Zi,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,o=void 0;t.setLineDash&&r.lineDash&&(i=xp(e),a=i[0],o=i[1]),a&&(t.setLineDash(a),t.lineDashOffset=o),r.strokeFirst?(Xu(r)&&t.strokeText(n,r.x,r.y),Yu(r)&&t.fillText(n,r.x,r.y)):(Yu(r)&&t.fillText(n,r.x,r.y),Xu(r)&&t.strokeText(n,r.x,r.y)),a&&t.setLineDash([])}}var g0=["shadowBlur","shadowOffsetX","shadowOffsetY"],m0=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function KT(t,e,r,i,n){var a=!1;if(!i&&(r=r||{},e===r))return!1;if(i||e.opacity!==r.opacity){Ye(t,n),a=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?Gn.opacity:o}(i||e.blend!==r.blend)&&(a||(Ye(t,n),a=!0),t.globalCompositeOperation=e.blend||Gn.blend);for(var s=0;s<g0.length;s++){var l=g0[s];(i||e[l]!==r[l])&&(a||(Ye(t,n),a=!0),t[l]=t.dpr*(e[l]||0))}return(i||e.shadowColor!==r.shadowColor)&&(a||(Ye(t,n),a=!0),t.shadowColor=e.shadowColor||Gn.shadowColor),a}function _0(t,e,r,i,n){var a=Ds(e,n.inHover),o=i?null:r&&Ds(r,n.inHover)||{};if(a===o)return!1;var s=KT(t,a,o,i,n);if((i||a.fill!==o.fill)&&(s||(Ye(t,n),s=!0),v0(a.fill)&&(t.fillStyle=a.fill)),(i||a.stroke!==o.stroke)&&(s||(Ye(t,n),s=!0),v0(a.stroke)&&(t.strokeStyle=a.stroke)),(i||a.opacity!==o.opacity)&&(s||(Ye(t,n),s=!0),t.globalAlpha=a.opacity==null?1:a.opacity),e.hasStroke()){var l=a.lineWidth,u=l/(a.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==u&&(s||(Ye(t,n),s=!0),t.lineWidth=u)}for(var f=0;f<m0.length;f++){var h=m0[f],v=h[0];(i||a[v]!==o[v])&&(s||(Ye(t,n),s=!0),t[v]=a[v]||h[1])}return s}function PL(t,e,r,i,n){return KT(t,Ds(e,n.inHover),r&&Ds(r,n.inHover),i,n)}function jT(t,e){var r=e.transform,i=t.dpr||1;r?t.setTransform(i*r[0],i*r[1],i*r[2],i*r[3],i*r[4],i*r[5]):t.setTransform(i,0,0,i,0,0)}function IL(t,e,r){for(var i=!1,n=0;n<t.length;n++){var a=t[n];i=i||a.isZeroArea(),jT(e,a),e.beginPath(),a.buildPath(e,a.shape),e.clip()}r.allClipped=i}function NL(t,e){return t&&e?t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||t[4]!==e[4]||t[5]!==e[5]:!(!t&&!e)}var y0=1,x0=2,T0=3,S0=4;function OL(t){var e=Yu(t),r=Xu(t);return!(t.lineDash||!(+e^+r)||e&&typeof t.fill!="string"||r&&typeof t.stroke!="string"||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}function Ye(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function Ds(t,e){return e&&t.__hoverStyle||t.style}function Tp(t,e){kn(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function kn(t,e,r,i){var n=e.transform;if(!e.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1)){e.__dirty&=~er,e.__isRendered=!1;return}var a=e.__clipPaths,o=r.prevElClipPaths,s=!1,l=!1;if((!o||EL(a,o))&&(o&&o.length&&(Ye(t,r),t.restore(),l=s=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),a&&a.length&&(Ye(t,r),t.save(),IL(a,t,r),s=!0),r.prevElClipPaths=a),r.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var u=r.prevEl;u||(l=s=!0);var f=e instanceof kt&&e.autoBatch&&OL(e.style);s||NL(n,u.transform)?(Ye(t,r),jT(t,e)):f||Ye(t,r);var h=Ds(e,r.inHover);e instanceof kt?(r.lastDrawType!==y0&&(l=!0,r.lastDrawType=y0),_0(t,e,u,l,r),(!f||!r.batchFill&&!r.batchStroke)&&t.beginPath(),DL(t,e,h,f),f&&(r.batchFill=h.fill||"",r.batchStroke=h.stroke||"")):e instanceof Ss?(r.lastDrawType!==T0&&(l=!0,r.lastDrawType=T0),_0(t,e,u,l,r),RL(t,e,h)):e instanceof ir?(r.lastDrawType!==x0&&(l=!0,r.lastDrawType=x0),PL(t,e,u,l,r),LL(t,e,h)):e.getTemporalDisplayables&&(r.lastDrawType!==S0&&(l=!0,r.lastDrawType=S0),BL(t,e,r)),f&&i&&Ye(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),r.prevEl=e,e.__dirty=0,e.__isRendered=!0}function BL(t,e,r){var i=e.getDisplayables(),n=e.getTemporalDisplayables();t.save();var a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:r.viewWidth,viewHeight:r.viewHeight,inHover:r.inHover},o,s;for(o=e.getCursor(),s=i.length;o<s;o++){var l=i[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),kn(t,l,a,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}for(var u=0,f=n.length;u<f;u++){var l=n[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),kn(t,l,a,u===f-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}var Kh=new dL,w0=new lo(100),b0=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Xv(t,e){if(t==="none")return null;var r=e.getDevicePixelRatio(),i=e.getZr(),n=i.painter.type==="svg";t.dirty&&Kh.delete(t);var a=Kh.get(t);if(a)return a;var o=Et(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=n?1:1/r,Kh.set(t,s),t.dirty=!1,s;function l(u){for(var f=[r],h=!0,v=0;v<b0.length;++v){var c=o[b0[v]];if(c!=null&&!j(c)&&!Q(c)&&!$t(c)&&typeof c!="boolean"){h=!1;break}f.push(c)}var d;if(h){d=f.join(",")+(n?"-svg":"");var p=w0.get(d);p&&(n?u.svgElement=p:u.image=p)}var g=JT(o.dashArrayX),m=FL(o.dashArrayY),_=QT(o.symbol),y=kL(g),x=tS(m),S=!n&&oo.createCanvas(),T=n&&{tag:"g",attrs:{},key:"dcl",children:[]},w=A(),b;S&&(S.width=w.width*r,S.height=w.height*r,b=S.getContext("2d")),M(),h&&w0.put(d,S||T),u.image=S,u.svgElement=T,u.svgWidth=w.width,u.svgHeight=w.height;function A(){for(var E=1,D=0,R=y.length;D<R;++D)E=Fg(E,y[D]);for(var P=1,D=0,R=_.length;D<R;++D)P=Fg(P,_[D].length);E*=P;var I=x*y.length*_.length;return{width:Math.max(1,Math.min(E,o.maxTileWidth)),height:Math.max(1,Math.min(I,o.maxTileHeight))}}function M(){b&&(b.clearRect(0,0,S.width,S.height),o.backgroundColor&&(b.fillStyle=o.backgroundColor,b.fillRect(0,0,S.width,S.height)));for(var E=0,D=0;D<m.length;++D)E+=m[D];if(E<=0)return;for(var R=-x,P=0,I=0,N=0;R<w.height;){if(P%2===0){for(var V=I/2%_.length,O=0,X=0,G=0;O<w.width*2;){for(var lt=0,D=0;D<g[N].length;++D)lt+=g[N][D];if(lt<=0)break;if(X%2===0){var J=(1-o.symbolSize)*.5,ot=O+g[N][X]*J,at=R+m[P]*J,Dt=g[N][X]*o.symbolSize,pt=m[P]*o.symbolSize,Ot=G/2%_[V].length;Ht(ot,at,Dt,pt,_[V][Ot])}O+=g[N][X],++G,++X,X===g[N].length&&(X=0)}++N,N===g.length&&(N=0)}R+=m[P],++I,++P,P===m.length&&(P=0)}function Ht(Nt,wt,et,xt,re){var Vt=n?1:r,Ce=Br(re,Nt*Vt,wt*Vt,et*Vt,xt*Vt,o.color,o.symbolKeepAspect);if(n){var br=i.painter.renderOneToVNode(Ce);br&&T.children.push(br)}else Tp(b,Ce)}}}}function QT(t){if(!t||t.length===0)return[["rect"]];if(Q(t))return[[t]];for(var e=!0,r=0;r<t.length;++r)if(!Q(t[r])){e=!1;break}if(e)return QT([t]);for(var i=[],r=0;r<t.length;++r)Q(t[r])?i.push([t[r]]):i.push(t[r]);return i}function JT(t){if(!t||t.length===0)return[[0,0]];if($t(t)){var e=Math.ceil(t);return[[e,e]]}for(var r=!0,i=0;i<t.length;++i)if(!$t(t[i])){r=!1;break}if(r)return JT([t]);for(var n=[],i=0;i<t.length;++i)if($t(t[i])){var e=Math.ceil(t[i]);n.push([e,e])}else{var e=tt(t[i],function(s){return Math.ceil(s)});e.length%2===1?n.push(e.concat(e)):n.push(e)}return n}function FL(t){if(!t||typeof t=="object"&&t.length===0)return[0,0];if($t(t)){var e=Math.ceil(t);return[e,e]}var r=tt(t,function(i){return Math.ceil(i)});return t.length%2?r.concat(r):r}function kL(t){return tt(t,function(e){return tS(e)})}function tS(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return t.length%2===1?e*2:e}function zL(t,e){t.eachRawSeries(function(r){if(!t.isSeriesFiltered(r)){var i=r.getData();i.hasItemVisual()&&i.each(function(o){var s=i.getItemVisual(o,"decal");if(s){var l=i.ensureUniqueItemVisual(o,"style");l.decal=Xv(s,e)}});var n=i.getVisual("decal");if(n){var a=i.getVisual("style");a.decal=Xv(n,e)}}})}var Rr=new zr,eS={};function UL(t,e){eS[t]=e}function HL(t){return eS[t]}var VL=1,GL=800,WL=900,XL=1e3,YL=2e3,ZL=5e3,rS=1e3,qL=1100,Sp=2e3,iS=3e3,$L=4e3,Uf=4500,KL=4600,jL=5e3,QL=6e3,nS=7e3,JL={PROCESSOR:{FILTER:XL,SERIES_FILTER:GL,STATISTIC:ZL},VISUAL:{LAYOUT:rS,PROGRESSIVE_LAYOUT:qL,GLOBAL:Sp,CHART:iS,POST_CHART_LAYOUT:KL,COMPONENT:$L,BRUSH:jL,CHART_ITEM:Uf,ARIA:QL,DECAL:nS}},be="__flagInMainProcess",We="__pendingUpdate",jh="__needsUpdateStatus",A0=/^[a-zA-Z0-9_]+$/,Qh="__connectUpdateStatus",E0=0,tR=1,eR=2;function aS(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isDisposed()){this.id;return}return sS(this,t,e)}}function oS(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return sS(this,t,e)}}function sS(t,e,r){return r[0]=r[0]&&r[0].toLowerCase(),zr.prototype[e].apply(t,r)}var lS=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(zr),uS=lS.prototype;uS.on=oS("on");uS.off=oS("off");var da,Jh,Al,Ci,tc,ec,rc,Eo,Mo,M0,C0,ic,D0,El,L0,fS,nr,R0,hS=function(t){K(e,t);function e(r,i,n){var a=t.call(this,new sL)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},a._pendingActions=[],n=n||{},Q(i)&&(i=cS[i]),a._dom=r;var o="canvas",s="auto",l=!1;n.ssr&&MA(function(v){var c=Mt(v),d=c.dataIndex;if(d!=null){var p=ht();return p.set("series_index",c.seriesIndex),p.set("data_index",d),c.ssrType&&p.set("ssr_type",c.ssrType),p}});var u=a._zr=wv(r,{renderer:n.renderer||o,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height,ssr:n.ssr,useDirtyRect:ft(n.useDirtyRect,l),useCoarsePointer:ft(n.useCoarsePointer,s),pointerSize:n.pointerSize});a._ssr=n.ssr,a._throttledZrFlush=yp(nt(u.flush,u),17),i=ut(i),i&&xT(i,!0),a._theme=i,a._locale=_C(n.locale||Kx),a._coordSysMgr=new Bf;var f=a._api=L0(a);function h(v,c){return v.__prio-c.__prio}return eu(qu,h),eu(Yv,h),a._scheduler=new VT(a,f,Yv,qu),a._messageCenter=new lS,a._initEvents(),a.resize=nt(a.resize,a),u.animation.on("frame",a._onframe,a),M0(u,a),C0(u,a),xu(a),a}return e.prototype._onframe=function(){if(!this._disposed){R0(this);var r=this._scheduler;if(this[We]){var i=this[We].silent;this[be]=!0;try{da(this),Ci.update.call(this,null,this[We].updateParams)}catch(l){throw this[be]=!1,this[We]=null,l}this._zr.flush(),this[be]=!1,this[We]=null,Eo.call(this,i),Mo.call(this,i)}else if(r.unfinished){var n=VL,a=this._model,o=this._api;r.unfinished=!1;do{var s=+new Date;r.performSeriesTasks(a),r.performDataProcessorTasks(a),ec(this,a),r.performVisualTasks(a),El(this,this._model,o,"remain",{}),n-=+new Date-s}while(n>0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,i,n){if(!this[be]){if(this._disposed){this.id;return}var a,o,s;if(rt(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[be]=!0,!this._model||i){var l=new GC(this._api),u=this._theme,f=this._model=new pp;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},Zv);var h={seriesTransition:s,optionChanged:!0};if(n)this[We]={silent:a,updateParams:h},this[be]=!1,this.getZr().wakeUp();else{try{da(this),Ci.update.call(this,null,h)}catch(v){throw this[We]=null,this[be]=!1,v}this._ssr||this._zr.flush(),this[We]=null,this[be]=!1,Eo.call(this,a),Mo.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||vt.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var i=this._zr.painter;return i.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){if(vt.svgSupported){var r=this._zr,i=r.storage.getDisplayList();return C(i,function(n){n.stopAnimation(null,!0)}),r.painter.toDataURL()}},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var i=r.excludeComponents,n=this._model,a=[],o=this;C(i,function(l){n.eachComponent({mainType:l},function(u){var f=o._componentsMap[u.__viewId];f.group.ignore||(a.push(f),f.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return C(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var i=r.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(P0[n]){var l=s,u=s,f=-s,h=-s,v=[],c=r&&r.pixelRatio||this.getDevicePixelRatio();C(vs,function(y,x){if(y.group===n){var S=i?y.getZr().painter.getSvgDom().innerHTML:y.renderToCanvas(ut(r)),T=y.getDom().getBoundingClientRect();l=a(T.left,l),u=a(T.top,u),f=o(T.right,f),h=o(T.bottom,h),v.push({dom:S,left:T.left,top:T.top})}}),l*=c,u*=c,f*=c,h*=c;var d=f-l,p=h-u,g=oo.createCanvas(),m=wv(g,{renderer:i?"svg":"canvas"});if(m.resize({width:d,height:p}),i){var _="";return C(v,function(y){var x=y.left-l,S=y.top-u;_+='<g transform="translate('+x+","+S+')">'+y.dom+"</g>"}),m.painter.getSvgRoot().innerHTML=_,r.connectedBackgroundColor&&m.painter.setBackgroundColor(r.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return r.connectedBackgroundColor&&m.add(new Kt({shape:{x:0,y:0,width:d,height:p},style:{fill:r.connectedBackgroundColor}})),C(v,function(y){var x=new ir({style:{x:y.left*c-l,y:y.top*c-u,image:y.dom}});m.add(x)}),m.refreshImmediately(),g.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,i){return tc(this,"convertToPixel",r,i)},e.prototype.convertFromPixel=function(r,i){return tc(this,"convertFromPixel",r,i)},e.prototype.containPixel=function(r,i){if(this._disposed){this.id;return}var n=this._model,a,o=wh(n,r);return C(o,function(s,l){l.indexOf("Models")>=0&&C(s,function(u){var f=u.coordinateSystem;if(f&&f.containPoint)a=a||!!f.containPoint(i);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(i,u))}},this)},this),!!a},e.prototype.getVisual=function(r,i){var n=this._model,a=wh(n,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?ZT(s,l,i):qT(s,i)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;C(rR,function(i){var n=function(a){var o=r.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&Ba(s,function(d){var p=Mt(d);if(p&&p.dataIndex!=null){var g=p.dataModel||o.getSeriesByIndex(p.seriesIndex);return l=g&&g.getDataParams(p.dataIndex,p.dataType,s)||{},!0}else if(p.eventData)return l=Y({},p.eventData),!0},!0),l){var f=l.componentType,h=l.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=l.seriesIndex);var v=f&&h!=null&&o.getComponent(f,h),c=v&&r[v.mainType==="series"?"_chartsMap":"_componentsMap"][v.__viewId];l.event=a,l.type=i,r._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:v,view:c},r.trigger(i,l)}};n.zrEventfulCallAtLast=!0,r._zr.on(i,n,r)}),C(cs,function(i,n){r._messageCenter.on(n,function(a){this.trigger(n,a)},r)}),C(["selectchanged"],function(i){r._messageCenter.on(i,function(n){this.trigger(i,n)},r)}),hL(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&cx(this.getDom(),bp,"");var i=this,n=i._api,a=i._model;C(i._componentsViews,function(o){o.dispose(a,n)}),C(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete vs[i.id]},e.prototype.resize=function(r){if(!this[be]){if(this._disposed){this.id;return}this._zr.resize(r);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=r&&r.silent;this[We]&&(a==null&&(a=this[We].silent),n=!0,this[We]=null),this[be]=!0;try{n&&da(this),Ci.update.call(this,{type:"resize",animation:Y({duration:0},r&&r.animation)})}catch(o){throw this[be]=!1,o}this[be]=!1,Eo.call(this,a),Mo.call(this,a)}}},e.prototype.showLoading=function(r,i){if(this._disposed){this.id;return}if(rt(r)&&(i=r,r=""),r=r||"default",this.hideLoading(),!!qv[r]){var n=qv[r](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var i=Y({},r);return i.type=cs[r.type],i},e.prototype.dispatchAction=function(r,i){if(this._disposed){this.id;return}if(rt(i)||(i={silent:!!i}),!!Zu[r.type]&&this._model){if(this[be]){this._pendingActions.push(r);return}var n=i.silent;rc.call(this,r,n);var a=i.flush;a?this._zr.flush():a!==!1&&vt.browser.weChat&&this._throttledZrFlush(),Eo.call(this,n),Mo.call(this,n)}},e.prototype.updateLabelLayout=function(){Rr.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var i=r.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){da=function(h){var v=h._scheduler;v.restorePipelines(h._model),v.prepareStageTasks(),Jh(h,!0),Jh(h,!1),v.plan()},Jh=function(h,v){for(var c=h._model,d=h._scheduler,p=v?h._componentsViews:h._chartsViews,g=v?h._componentsMap:h._chartsMap,m=h._zr,_=h._api,y=0;y<p.length;y++)p[y].__alive=!1;v?c.eachComponent(function(T,w){T!=="series"&&x(w)}):c.eachSeries(x);function x(T){var w=T.__requireNewView;T.__requireNewView=!1;var b="_ec_"+T.id+"_"+T.type,A=!w&&g[b];if(!A){var M=Qr(T.type),E=v?ze.getClass(M.main,M.sub):Nr.getClass(M.sub);A=new E,A.init(c,_),g[b]=A,p.push(A),m.add(A.group)}T.__viewId=A.__id=b,A.__alive=!0,A.__model=T,A.group.__ecComponentInfo={mainType:T.mainType,index:T.componentIndex},!v&&d.prepareView(A,T,c,_)}for(var y=0;y<p.length;){var S=p[y];S.__alive?y++:(!v&&S.renderTask.dispose(),m.remove(S.group),S.dispose(c,_),p.splice(y,1),g[S.__id]===S&&delete g[S.__id],S.__id=S.group.__ecComponentInfo=null)}},Al=function(h,v,c,d,p){var g=h._model;if(g.setUpdatePayload(c),!d){C([].concat(h._componentsViews).concat(h._chartsViews),S);return}var m={};m[d+"Id"]=c[d+"Id"],m[d+"Index"]=c[d+"Index"],m[d+"Name"]=c[d+"Name"];var _={mainType:d,query:m};p&&(_.subType=p);var y=c.excludeSeriesId,x;y!=null&&(x=ht(),C(ue(y),function(T){var w=Ne(T,null);w!=null&&x.set(w,!0)})),g&&g.eachComponent(_,function(T){var w=x&&x.get(T.id)!=null;if(!w)if(cm(c))if(T instanceof yi)c.type===Wn&&!c.notBlur&&!T.get(["emphasis","disabled"])&&eM(T,c,h._api);else{var b=qd(T.mainType,T.componentIndex,c.name,h._api),A=b.focusSelf,M=b.dispatchers;c.type===Wn&&A&&!c.notBlur&&Dv(T.mainType,T.componentIndex,h._api),M&&C(M,function(E){c.type===Wn?Pu(E):Iu(E)})}else Pv(c)&&T instanceof yi&&(nM(T,c,h._api),um(T),nr(h))},h),g&&g.eachComponent(_,function(T){var w=x&&x.get(T.id)!=null;w||S(h[d==="series"?"_chartsMap":"_componentsMap"][T.__viewId])},h);function S(T){T&&T.__alive&&T[v]&&T[v](T.__model,g,h._api,c)}},Ci={prepareAndUpdate:function(h){da(this),Ci.update.call(this,h,{optionChanged:h.newOption!=null})},update:function(h,v){var c=this._model,d=this._api,p=this._zr,g=this._coordSysMgr,m=this._scheduler;if(c){c.setUpdatePayload(h),m.restoreData(c,h),m.performSeriesTasks(c),g.create(c,d),m.performDataProcessorTasks(c,h),ec(this,c),g.update(c,d),r(c),m.performVisualTasks(c,h),ic(this,c,d,h,v);var _=c.get("backgroundColor")||"transparent",y=c.get("darkMode");p.setBackgroundColor(_),y!=null&&y!=="auto"&&p.setDarkMode(y),Rr.trigger("afterupdate",c,d)}},updateTransform:function(h){var v=this,c=this._model,d=this._api;if(c){c.setUpdatePayload(h);var p=[];c.eachComponent(function(m,_){if(m!=="series"){var y=v.getViewOfComponentModel(_);if(y&&y.__alive)if(y.updateTransform){var x=y.updateTransform(_,c,d,h);x&&x.update&&p.push(y)}else p.push(y)}});var g=ht();c.eachSeries(function(m){var _=v._chartsMap[m.__viewId];if(_.updateTransform){var y=_.updateTransform(m,c,d,h);y&&y.update&&g.set(m.uid,1)}else g.set(m.uid,1)}),r(c),this._scheduler.performVisualTasks(c,h,{setDirty:!0,dirtyMap:g}),El(this,c,d,h,{},g),Rr.trigger("afterupdate",c,d)}},updateView:function(h){var v=this._model;v&&(v.setUpdatePayload(h),Nr.markUpdateMethod(h,"updateView"),r(v),this._scheduler.performVisualTasks(v,h,{setDirty:!0}),ic(this,v,this._api,h,{}),Rr.trigger("afterupdate",v,this._api))},updateVisual:function(h){var v=this,c=this._model;c&&(c.setUpdatePayload(h),c.eachSeries(function(d){d.getData().clearAllVisual()}),Nr.markUpdateMethod(h,"updateVisual"),r(c),this._scheduler.performVisualTasks(c,h,{visualType:"visual",setDirty:!0}),c.eachComponent(function(d,p){if(d!=="series"){var g=v.getViewOfComponentModel(p);g&&g.__alive&&g.updateVisual(p,c,v._api,h)}}),c.eachSeries(function(d){var p=v._chartsMap[d.__viewId];p.updateVisual(d,c,v._api,h)}),Rr.trigger("afterupdate",c,this._api))},updateLayout:function(h){Ci.update.call(this,h)}},tc=function(h,v,c,d){if(h._disposed){h.id;return}for(var p=h._model,g=h._coordSysMgr.getCoordinateSystems(),m,_=wh(p,c),y=0;y<g.length;y++){var x=g[y];if(x[v]&&(m=x[v](p,_,d))!=null)return m}},ec=function(h,v){var c=h._chartsMap,d=h._scheduler;v.eachSeries(function(p){d.updateStreamModes(p,c[p.__viewId])})},rc=function(h,v){var c=this,d=this.getModel(),p=h.type,g=h.escapeConnect,m=Zu[p],_=m.actionInfo,y=(_.update||"update").split(":"),x=y.pop(),S=y[0]!=null&&Qr(y[0]);this[be]=!0;var T=[h],w=!1;h.batch&&(w=!0,T=tt(h.batch,function(P){return P=Et(Y({},P),h),P.batch=null,P}));var b=[],A,M=Pv(h),E=cm(h);if(E&&Ix(this._api),C(T,function(P){if(A=m.action(P,c._model,c._api),A=A||Y({},P),A.type=_.event||A.type,b.push(A),E){var I=Vd(h),N=I.queryOptionMap,V=I.mainTypeSpecified,O=V?N.keys()[0]:"series";Al(c,x,P,O),nr(c)}else M?(Al(c,x,P,"series"),nr(c)):S&&Al(c,x,P,S.main,S.sub)}),x!=="none"&&!E&&!M&&!S)try{this[We]?(da(this),Ci.update.call(this,h),this[We]=null):Ci[x].call(this,h)}catch(P){throw this[be]=!1,P}if(w?A={type:_.event||p,escapeConnect:g,batch:b}:A=b[0],this[be]=!1,!v){var D=this._messageCenter;if(D.trigger(A.type,A),M){var R={type:"selectchanged",escapeConnect:g,selected:aM(d),isFromClick:h.isFromClick||!1,fromAction:h.type,fromActionPayload:h};D.trigger(R.type,R)}}},Eo=function(h){for(var v=this._pendingActions;v.length;){var c=v.shift();rc.call(this,c,h)}},Mo=function(h){!h&&this.trigger("updated")},M0=function(h,v){h.on("rendered",function(c){v.trigger("rendered",c),h.animation.isFinished()&&!v[We]&&!v._scheduler.unfinished&&!v._pendingActions.length&&v.trigger("finished")})},C0=function(h,v){h.on("mouseover",function(c){var d=c.target,p=Ba(d,Rv);p&&(rM(p,c,v._api),nr(v))}).on("mouseout",function(c){var d=c.target,p=Ba(d,Rv);p&&(iM(p,c,v._api),nr(v))}).on("click",function(c){var d=c.target,p=Ba(d,function(_){return Mt(_).dataIndex!=null},!0);if(p){var g=p.selected?"unselect":"select",m=Mt(p);v._api.dispatchAction({type:g,dataType:m.dataType,dataIndexInside:m.dataIndex,seriesIndex:m.seriesIndex,isFromClick:!0})}})};function r(h){h.clearColorPalette(),h.eachSeries(function(v){v.clearColorPalette()})}function i(h){var v=[],c=[],d=!1;if(h.eachComponent(function(_,y){var x=y.get("zlevel")||0,S=y.get("z")||0,T=y.getZLevelKey();d=d||!!T,(_==="series"?c:v).push({zlevel:x,z:S,idx:y.componentIndex,type:_,key:T})}),d){var p=v.concat(c),g,m;eu(p,function(_,y){return _.zlevel===y.zlevel?_.z-y.z:_.zlevel-y.zlevel}),C(p,function(_){var y=h.getComponent(_.type,_.idx),x=_.zlevel,S=_.key;g!=null&&(x=Math.max(g,x)),S?(x===g&&S!==m&&x++,m=S):m&&(x===g&&x++,m=""),g=x,y.setZLevel(x)})}}ic=function(h,v,c,d,p){i(v),D0(h,v,c,d,p),C(h._chartsViews,function(g){g.__alive=!1}),El(h,v,c,d,p),C(h._chartsViews,function(g){g.__alive||g.remove(v,c)})},D0=function(h,v,c,d,p,g){C(g||h._componentsViews,function(m){var _=m.__model;u(_,m),m.render(_,v,c,d),s(_,m),f(_,m)})},El=function(h,v,c,d,p,g){var m=h._scheduler;p=Y(p||{},{updatedSeries:v.getSeries()}),Rr.trigger("series:beforeupdate",v,c,p);var _=!1;v.eachSeries(function(y){var x=h._chartsMap[y.__viewId];x.__alive=!0;var S=x.renderTask;m.updatePayload(S,d),u(y,x),g&&g.get(y.uid)&&S.dirty(),S.perform(m.getPerformArgs(S))&&(_=!0),x.group.silent=!!y.get("silent"),o(y,x),um(y)}),m.unfinished=_||m.unfinished,Rr.trigger("series:layoutlabels",v,c,p),Rr.trigger("series:transition",v,c,p),v.eachSeries(function(y){var x=h._chartsMap[y.__viewId];s(y,x),f(y,x)}),a(h,v),Rr.trigger("series:afterupdate",v,c,p)},nr=function(h){h[jh]=!0,h.getZr().wakeUp()},R0=function(h){h[jh]&&(h.getZr().storage.traverse(function(v){Xa(v)||n(v)}),h[jh]=!1)};function n(h){for(var v=[],c=h.currentStates,d=0;d<c.length;d++){var p=c[d];p==="emphasis"||p==="blur"||p==="select"||v.push(p)}h.selected&&h.states.select&&v.push("select"),h.hoverState===Sf&&h.states.emphasis?v.push("emphasis"):h.hoverState===Tf&&h.states.blur&&v.push("blur"),h.useStates(v)}function a(h,v){var c=h._zr,d=c.storage,p=0;d.traverse(function(g){g.isGroup||p++}),p>v.get("hoverLayerThreshold")&&!vt.node&&!vt.worker&&v.eachSeries(function(g){if(!g.preventUsingHoverLayer){var m=h._chartsMap[g.__viewId];m.__alive&&m.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function o(h,v){var c=h.get("blendMode")||null;v.eachRendered(function(d){d.isGroup||(d.style.blend=c)})}function s(h,v){if(!h.preventAutoZ){var c=h.get("z")||0,d=h.get("zlevel")||0;v.eachRendered(function(p){return l(p,c,d,-1/0),!0})}}function l(h,v,c,d){var p=h.getTextContent(),g=h.getTextGuideLine(),m=h.isGroup;if(m)for(var _=h.childrenRef(),y=0;y<_.length;y++)d=Math.max(l(_[y],v,c,d),d);else h.z=v,h.zlevel=c,d=Math.max(h.z2,d);if(p&&(p.z=v,p.zlevel=c,isFinite(d)&&(p.z2=d+2)),g){var x=h.textGuideLineConfig;g.z=v,g.zlevel=c,isFinite(d)&&(g.z2=d+(x&&x.showAbove?1:-1))}return d}function u(h,v){v.eachRendered(function(c){if(!Xa(c)){var d=c.getTextContent(),p=c.getTextGuideLine();c.stateTransition&&(c.stateTransition=null),d&&d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),c.hasState()?(c.prevStates=c.currentStates,c.clearStates()):c.prevStates&&(c.prevStates=null)}})}function f(h,v){var c=h.getModel("stateAnimation"),d=h.isAnimationEnabled(),p=c.get("duration"),g=p>0?{duration:p,delay:c.get("delay"),easing:c.get("easing")}:null;v.eachRendered(function(m){if(m.states&&m.states.emphasis){if(Xa(m))return;if(m instanceof kt&&fM(m),m.__dirty){var _=m.prevStates;_&&m.useStates(_)}if(d){m.stateTransition=g;var y=m.getTextContent(),x=m.getTextGuideLine();y&&(y.stateTransition=g),x&&(x.stateTransition=g)}m.__dirty&&n(m)}})}L0=function(h){return new(function(v){K(c,v);function c(){return v!==null&&v.apply(this,arguments)||this}return c.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},c.prototype.getComponentByElement=function(d){for(;d;){var p=d.__ecComponentInfo;if(p!=null)return h._model.getComponent(p.mainType,p.index);d=d.parent}},c.prototype.enterEmphasis=function(d,p){Pu(d,p),nr(h)},c.prototype.leaveEmphasis=function(d,p){Iu(d,p),nr(h)},c.prototype.enterBlur=function(d){tM(d),nr(h)},c.prototype.leaveBlur=function(d){Dx(d),nr(h)},c.prototype.enterSelect=function(d){Lx(d),nr(h)},c.prototype.leaveSelect=function(d){Rx(d),nr(h)},c.prototype.getModel=function(){return h.getModel()},c.prototype.getViewOfComponentModel=function(d){return h.getViewOfComponentModel(d)},c.prototype.getViewOfSeriesModel=function(d){return h.getViewOfSeriesModel(d)},c}(_T))(h)},fS=function(h){function v(c,d){for(var p=0;p<c.length;p++){var g=c[p];g[Qh]=d}}C(cs,function(c,d){h._messageCenter.on(d,function(p){if(P0[h.group]&&h[Qh]!==E0){if(p&&p.escapeConnect)return;var g=h.makeActionFromEvent(p),m=[];C(vs,function(_){_!==h&&_.group===h.group&&m.push(_)}),v(m,E0),C(m,function(_){_[Qh]!==tR&&_.dispatchAction(g)}),v(m,eR)}})})}}(),e}(zr),wp=hS.prototype;wp.on=aS("on");wp.off=aS("off");wp.one=function(t,e,r){var i=this;function n(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];e&&e.apply&&e.apply(this,a),i.off(t,n)}this.on.call(this,t,n,r)};var rR=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var Zu={},cs={},Yv=[],Zv=[],qu=[],cS={},qv={},vs={},P0={},iR=+new Date-0,bp="_echarts_instance_";function nR(t,e,r){var i=!(r&&r.ssr);if(i){var n=aR(t);if(n)return n}var a=new hS(t,e,r);return a.id="ec_"+iR++,vs[a.id]=a,i&&cx(t,bp,a.id),fS(a),Rr.trigger("afterinit",a),a}function aR(t){return vs[YA(t,bp)]}function vS(t,e){cS[t]=e}function Ap(t){bt(Zv,t)<0&&Zv.push(t)}function dS(t,e){Mp(Yv,t,e,YL)}function pS(t){Ep("afterinit",t)}function gS(t){Ep("afterupdate",t)}function Ep(t,e){Rr.on(t,e)}function ta(t,e,r){ct(e)&&(r=e,e="");var i=rt(t)?t.type:[t,t={event:e}][0];t.event=(t.event||i).toLowerCase(),e=t.event,!cs[e]&&(xr(A0.test(i)&&A0.test(e)),Zu[i]||(Zu[i]={action:r,actionInfo:t}),cs[e]=i)}function oR(t,e){Bf.register(t,e)}function sR(t){var e=Bf.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()}function lR(t,e){Mp(qu,t,e,rS,"layout")}function ea(t,e){Mp(qu,t,e,iS,"visual")}var I0=[];function Mp(t,e,r,i,n){if((ct(e)||rt(e))&&(r=e,e=i),!(bt(I0,r)>=0)){I0.push(r);var a=VT.wrapStageHandler(r,n);a.__prio=e,a.__raw=r,t.push(a)}}function mS(t,e){qv[t]=e}function uR(t,e,r){var i=HL("registerMap");i&&i(t,e,r)}var fR=yD;ea(Sp,ZD);ea(Uf,qD);ea(Uf,$D);ea(Sp,lL);ea(Uf,uL);ea(nS,zL);Ap(xT);dS(WL,eD);mS("default",KD);ta({type:Wn,event:Wn,update:Wn},Te);ta({type:ou,event:ou,update:ou},Te);ta({type:os,event:os,update:os},Te);ta({type:su,event:su,update:su},Te);ta({type:ss,event:ss,update:ss},Te);vS("light",oL);vS("dark",YT);function Co(t){return t==null?0:t.length||1}function N0(t){return t}var hR=function(){function t(e,r,i,n,a,o){this._old=e,this._new=r,this._oldKeyGetter=i||N0,this._newKeyGetter=n||N0,this.context=a,this._diffModeMultiple=o==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,i={},n=new Array(e.length),a=new Array(r.length);this._initIndexMap(e,null,n,"_oldKeyGetter"),this._initIndexMap(r,i,a,"_newKeyGetter");for(var o=0;o<e.length;o++){var s=n[o],l=i[s],u=Co(l);if(u>1){var f=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(f,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,i={},n={},a=[],o=[];this._initIndexMap(e,i,a,"_oldKeyGetter"),this._initIndexMap(r,n,o,"_newKeyGetter");for(var s=0;s<a.length;s++){var l=a[s],u=i[l],f=n[l],h=Co(u),v=Co(f);if(h>1&&v===1)this._updateManyToOne&&this._updateManyToOne(f,u),n[l]=null;else if(h===1&&v>1)this._updateOneToMany&&this._updateOneToMany(f,u),n[l]=null;else if(h===1&&v===1)this._update&&this._update(f,u),n[l]=null;else if(h>1&&v>1)this._updateManyToMany&&this._updateManyToMany(f,u),n[l]=null;else if(h>1)for(var c=0;c<h;c++)this._remove&&this._remove(u[c]);else this._remove&&this._remove(u)}this._performRestAdd(o,n)},t.prototype._performRestAdd=function(e,r){for(var i=0;i<e.length;i++){var n=e[i],a=r[n],o=Co(a);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(a[s]);else o===1&&this._add&&this._add(a);r[n]=null}},t.prototype._initIndexMap=function(e,r,i,n){for(var a=this._diffModeMultiple,o=0;o<e.length;o++){var s="_ec_"+this[n](e[o],o);if(a||(i[o]=s),!!r){var l=r[s],u=Co(l);u===0?(r[s]=o,a&&i.push(s)):u===1?r[s]=[l,o]:l.push(o)}}},t}(),cR=function(){function t(e,r){this._encode=e,this._schema=r}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t}();function vR(t,e){var r={},i=r.encode={},n=ht(),a=[],o=[],s={};C(t.dimensions,function(v){var c=t.getDimensionInfo(v),d=c.coordDim;if(d){var p=c.coordDimIndex;nc(i,d)[p]=v,c.isExtraCoord||(n.set(d,1),pR(c.type)&&(a[0]=v),nc(s,d)[p]=t.getDimensionIndex(c.name)),c.defaultTooltip&&o.push(v)}vT.each(function(g,m){var _=nc(i,m),y=c.otherDims[m];y!=null&&y!==!1&&(_[y]=c.name)})});var l=[],u={};n.each(function(v,c){var d=i[c];u[c]=d[0],l=l.concat(d)}),r.dataDimsOnCoord=l,r.dataDimIndicesOnCoord=tt(l,function(v){return t.getDimensionInfo(v).storeDimIndex}),r.encodeFirstDimNotExtra=u;var f=i.label;f&&f.length&&(a=f.slice());var h=i.tooltip;return h&&h.length?o=h.slice():o.length||(o=a.slice()),i.defaultedLabel=a,i.defaultedTooltip=o,r.userOutput=new cR(s,e),r}function nc(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function dR(t){return t==="category"?"ordinal":t==="time"?"time":"float"}function pR(t){return!(t==="ordinal"||t==="time")}var hu=function(){function t(e){this.otherDims={},e!=null&&Y(this,e)}return t}(),gR=Yt(),mR={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},_S=function(){function t(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=TS(this.source)))},t.prototype.getSourceDimensionIndex=function(e){return ft(this._dimNameMap.get(e),-1)},t.prototype.getSourceDimension=function(e){var r=this.source.dimensionsDefine;if(r)return r[e]},t.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,r=wT(this.source),i=!SS(e),n="",a=[],o=0,s=0;o<e;o++){var l=void 0,u=void 0,f=void 0,h=this.dimensions[s];if(h&&h.storeDimIndex===o)l=r?h.name:null,u=h.type,f=h.ordinalMeta,s++;else{var v=this.getSourceDimension(o);v&&(l=r?v.name:null,u=v.type)}a.push({property:l,type:u,ordinalMeta:f}),r&&l!=null&&(!h||!h.isCalculationCoord)&&(n+=i?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),n+="$",n+=mR[u]||"f",f&&(n+=f.uid),n+="$"}var c=this.source,d=[c.seriesLayoutBy,c.startIndex,n].join("$$");return{dimensions:a,hash:d}},t.prototype.makeOutputDimensionNames=function(){for(var e=[],r=0,i=0;r<this._fullDimCount;r++){var n=void 0,a=this.dimensions[i];if(a&&a.storeDimIndex===r)a.isCalculationCoord||(n=a.name),i++;else{var o=this.getSourceDimension(r);o&&(n=o.name)}e.push(n)}return e},t.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t}();function yS(t){return t instanceof _S}function xS(t){for(var e=ht(),r=0;r<(t||[]).length;r++){var i=t[r],n=rt(i)?i.name:i;n!=null&&e.get(n)==null&&e.set(n,r)}return e}function TS(t){var e=gR(t);return e.dimNameMap||(e.dimNameMap=xS(t.dimensionsDefine))}function SS(t){return t>30}var Do=rt,Di=tt,_R=typeof Int32Array>"u"?Array:Int32Array,yR="e\0\0",O0=-1,xR=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],TR=["_approximateExtent"],B0,Ml,Lo,Ro,ac,Cl,oc,wS=function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i,n=!1;yS(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(n=!0,i=e),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},f=0;f<i.length;f++){var h=i[f],v=Q(h)?new hu({name:h}):h instanceof hu?h:new hu(h),c=v.name;v.type=v.type||"float",v.coordDim||(v.coordDim=c,v.coordDimIndex=0);var d=v.otherDims=v.otherDims||{};o.push(c),a[c]=v,u[c]!=null&&(l=!0),v.createInvertedIndices&&(s[c]=[]),d.itemName===0&&(this._nameDimIdx=f),d.itemId===0&&(this._idDimIdx=f),n&&(v.storeDimIndex=f)}if(this.dimensions=o,this._dimInfos=a,this._initGetDimensionInfo(l),this.hostModel=r,this._invertedIndicesMap=s,this._dimOmitted){var p=this._dimIdxToName=ht();C(o,function(g){p.set(a[g].storeDimIndex,g)})}}return t.prototype.getDimension=function(e){var r=this._recognizeDimIndex(e);if(r==null)return e;if(r=e,!this._dimOmitted)return this.dimensions[r];var i=this._dimIdxToName.get(r);if(i!=null)return i;var n=this._schema.getSourceDimension(r);if(n)return n.name},t.prototype.getDimensionIndex=function(e){var r=this._recognizeDimIndex(e);if(r!=null)return r;if(e==null)return-1;var i=this._getDimInfo(e);return i?i.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},t.prototype._recognizeDimIndex=function(e){if($t(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},t.prototype._getStoreDimIndex=function(e){var r=this.getDimensionIndex(e);return r},t.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},t.prototype._initGetDimensionInfo=function(e){var r=this._dimInfos;this._getDimInfo=e?function(i){return r.hasOwnProperty(i)?r[i]:void 0}:function(i){return r[i]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(e,r){var i=this._dimSummary;if(r==null)return i.encodeFirstDimNotExtra[e];var n=i.encode[e];return n?n[r]:null},t.prototype.mapDimensionsAll=function(e){var r=this._dimSummary,i=r.encode[e];return(i||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(e,r,i){var n=this,a;if(e instanceof kv&&(a=e),!a){var o=this.dimensions,s=gp(e)||ke(e)?new bT(e,o.length):e;a=new kv;var l=Di(o,function(u){return{type:n._dimInfos[u].type,property:u}});a.initData(s,l,i)}this._store=a,this._nameList=(r||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,a.count()),this._dimSummary=vR(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(e){var r=this._store.appendData(e);this._doInit(r[0],r[1])},t.prototype.appendValues=function(e,r){var i=this._store.appendValues(e,r.length),n=i.start,a=i.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),r)for(var s=n;s<a;s++){var l=s-n;this._nameList[s]=r[l],o&&oc(this,s)}},t.prototype._updateOrdinalMeta=function(){for(var e=this._store,r=this.dimensions,i=0;i<r.length;i++){var n=this._dimInfos[r[i]];n.ordinalMeta&&e.collectOrdinalMeta(n.storeDimIndex,n.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==Xi&&!e.fillStorage},t.prototype._doInit=function(e,r){if(!(e>=r)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===wr;if(l&&!n.pure)for(var u=[],f=e;f<r;f++){var h=n.getItem(f,u);if(!this.hasItemOption&&NA(h)&&(this.hasItemOption=!0),h){var v=h.name;a[f]==null&&v!=null&&(a[f]=Ne(v,null));var c=h.id;o[f]==null&&c!=null&&(o[f]=Ne(c,null))}}if(this._shouldMakeIdFromName())for(var f=e;f<r;f++)oc(this,f);B0(this)}},t.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.setApproximateExtent=function(e,r){r=this.getDimension(r),this._approximateExtent[r]=e.slice()},t.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},t.prototype.setCalculationInfo=function(e,r){Do(e)?Y(this._calculationInfo,e):this._calculationInfo[e]=r},t.prototype.getName=function(e){var r=this.getRawIndex(e),i=this._nameList[r];return i==null&&this._nameDimIdx!=null&&(i=Lo(this,this._nameDimIdx,r)),i==null&&(i=""),i},t.prototype._getCategory=function(e,r){var i=this._store.get(e,r),n=this._store.getOrdinalMeta(e);return n?n.categories[i]:i},t.prototype.getId=function(e){return Ml(this,this.getRawIndex(e))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(e,r){var i=this._store,n=this._dimInfos[e];if(n)return i.get(n.storeDimIndex,r)},t.prototype.getByRawIndex=function(e,r){var i=this._store,n=this._dimInfos[e];if(n)return i.getByRawIndex(n.storeDimIndex,r)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},t.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},t.prototype.getValues=function(e,r){var i=this,n=this._store;return j(e)?n.getValues(Di(e,function(a){return i._getStoreDimIndex(a)}),r):n.getValues(e)},t.prototype.hasValue=function(e){for(var r=this._dimSummary.dataDimIndicesOnCoord,i=0,n=r.length;i<n;i++)if(isNaN(this._store.get(r[i],e)))return!1;return!0},t.prototype.indexOfName=function(e){for(var r=0,i=this._store.count();r<i;r++)if(this.getName(r)===e)return r;return-1},t.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},t.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},t.prototype.rawIndexOf=function(e,r){var i=e&&this._invertedIndicesMap[e],n=i[r];return n==null||isNaN(n)?O0:n},t.prototype.indicesOfNearest=function(e,r,i){return this._store.indicesOfNearest(this._getStoreDimIndex(e),r,i)},t.prototype.each=function(e,r,i){ct(e)&&(i=r,r=e,e=[]);var n=i||this,a=Di(Ro(e),this._getStoreDimIndex,this);this._store.each(a,n?nt(r,n):r)},t.prototype.filterSelf=function(e,r,i){ct(e)&&(i=r,r=e,e=[]);var n=i||this,a=Di(Ro(e),this._getStoreDimIndex,this);return this._store=this._store.filter(a,n?nt(r,n):r),this},t.prototype.selectRange=function(e){var r=this,i={},n=mt(e);return C(n,function(a){var o=r._getStoreDimIndex(a);i[o]=e[a]}),this._store=this._store.selectRange(i),this},t.prototype.mapArray=function(e,r,i){ct(e)&&(i=r,r=e,e=[]),i=i||this;var n=[];return this.each(e,function(){n.push(r&&r.apply(this,arguments))},i),n},t.prototype.map=function(e,r,i,n){var a=i||n||this,o=Di(Ro(e),this._getStoreDimIndex,this),s=Cl(this);return s._store=this._store.map(o,a?nt(r,a):r),s},t.prototype.modify=function(e,r,i,n){var a=i||n||this,o=Di(Ro(e),this._getStoreDimIndex,this);this._store.modify(o,a?nt(r,a):r)},t.prototype.downSample=function(e,r,i,n){var a=Cl(this);return a._store=this._store.downSample(this._getStoreDimIndex(e),r,i,n),a},t.prototype.lttbDownSample=function(e,r){var i=Cl(this);return i._store=this._store.lttbDownSample(this._getStoreDimIndex(e),r),i},t.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},t.prototype.getItemModel=function(e){var r=this.hostModel,i=this.getRawDataItem(e);return new Zt(i,r,r&&r.ecModel)},t.prototype.diff=function(e){var r=this;return new hR(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(i){return Ml(e,i)},function(i){return Ml(r,i)})},t.prototype.getVisual=function(e){var r=this._visual;return r&&r[e]},t.prototype.setVisual=function(e,r){this._visual=this._visual||{},Do(e)?Y(this._visual,e):this._visual[e]=r},t.prototype.getItemVisual=function(e,r){var i=this._itemVisuals[e],n=i&&i[r];return n??this.getVisual(r)},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(e,r){var i=this._itemVisuals,n=i[e];n||(n=i[e]={});var a=n[r];return a==null&&(a=this.getVisual(r),j(a)?a=a.slice():Do(a)&&(a=Y({},a)),n[r]=a),a},t.prototype.setItemVisual=function(e,r,i){var n=this._itemVisuals[e]||{};this._itemVisuals[e]=n,Do(r)?Y(n,r):n[r]=i},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){Do(e)?Y(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,i){this._itemLayouts[e]=i?Y(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var i=this.hostModel&&this.hostModel.seriesIndex;WE(i,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){C(this._graphicEls,function(i,n){i&&e&&e.call(r,i,n)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:Di(this.dimensions,this._getDimInfo,this),this.hostModel)),ac(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var i=this[e];ct(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var n=i.apply(this,arguments);return r.apply(this,[n].concat(Pd(arguments)))})},t.internalField=function(){B0=function(e){var r=e._invertedIndicesMap;C(r,function(i,n){var a=e._dimInfos[n],o=a.ordinalMeta,s=e._store;if(o){i=r[n]=new _R(o.categories.length);for(var l=0;l<i.length;l++)i[l]=O0;for(var l=0;l<s.count();l++)i[s.get(a.storeDimIndex,l)]=l}})},Lo=function(e,r,i){return Ne(e._getCategory(r,i),null)},Ml=function(e,r){var i=e._idList[r];return i==null&&e._idDimIdx!=null&&(i=Lo(e,e._idDimIdx,r)),i==null&&(i=yR+r),i},Ro=function(e){return j(e)||(e=e!=null?[e]:[]),e},Cl=function(e){var r=new t(e._schema?e._schema:Di(e.dimensions,e._getDimInfo,e),e.hostModel);return ac(r,e),r},ac=function(e,r){C(xR.concat(r.__wrappedMethods||[]),function(i){r.hasOwnProperty(i)&&(e[i]=r[i])}),e.__wrappedMethods=r.__wrappedMethods,C(TR,function(i){e[i]=ut(r[i])}),e._calculationInfo=Y({},r._calculationInfo)},oc=function(e,r){var i=e._nameList,n=e._idList,a=e._nameDimIdx,o=e._idDimIdx,s=i[r],l=n[r];if(s==null&&a!=null&&(i[r]=s=Lo(e,a,r)),l==null&&o!=null&&(n[r]=l=Lo(e,o,r)),l==null&&s!=null){var u=e._nameRepeatCount,f=u[s]=(u[s]||0)+1;l=s,f>1&&(l+="__ec__"+f),n[r]=l}}}(),t}();function SR(t,e){return bS(t,e).dimensions}function bS(t,e){gp(t)||(t=TT(t)),e=e||{};var r=e.coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],n=ht(),a=[],o=bR(t,r,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&SS(o),l=i===t.dimensionsDefine,u=l?TS(t):xS(i),f=e.encodeDefine;!f&&e.encodeDefaulter&&(f=e.encodeDefaulter(t,o));for(var h=ht(f),v=new DT(o),c=0;c<v.length;c++)v[c]=-1;function d(A){var M=v[A];if(M<0){var E=i[A],D=rt(E)?E:{name:E},R=new hu,P=D.name;P!=null&&u.get(P)!=null&&(R.name=R.displayName=P),D.type!=null&&(R.type=D.type),D.displayName!=null&&(R.displayName=D.displayName);var I=a.length;return v[A]=I,R.storeDimIndex=A,a.push(R),R}return a[M]}if(!s)for(var c=0;c<o;c++)d(c);h.each(function(A,M){var E=ue(A).slice();if(E.length===1&&!Q(E[0])&&E[0]<0){h.set(M,!1);return}var D=h.set(M,[]);C(E,function(R,P){var I=Q(R)?u.get(R):R;I!=null&&I<o&&(D[P]=I,g(d(I),M,P))})});var p=0;C(r,function(A){var M,E,D,R;if(Q(A))M=A,R={};else{R=A,M=R.name;var P=R.ordinalMeta;R.ordinalMeta=null,R=Y({},R),R.ordinalMeta=P,E=R.dimsDef,D=R.otherDims,R.name=R.coordDim=R.coordDimIndex=R.dimsDef=R.otherDims=null}var I=h.get(M);if(I!==!1){if(I=ue(I),!I.length)for(var N=0;N<(E&&E.length||1);N++){for(;p<o&&d(p).coordDim!=null;)p++;p<o&&I.push(p++)}C(I,function(V,O){var X=d(V);if(l&&R.type!=null&&(X.type=R.type),g(Et(X,R),M,O),X.name==null&&E){var G=E[O];!rt(G)&&(G={name:G}),X.name=X.displayName=G.name,X.defaultTooltip=G.defaultTooltip}D&&Et(X.otherDims,D)})}});function g(A,M,E){vT.get(M)!=null?A.otherDims[M]=E:(A.coordDim=M,A.coordDimIndex=E,n.set(M,!0))}var m=e.generateCoord,_=e.generateCoordCount,y=_!=null;_=m?_||1:0;var x=m||"value";function S(A){A.name==null&&(A.name=A.coordDim)}if(s)C(a,function(A){S(A)}),a.sort(function(A,M){return A.storeDimIndex-M.storeDimIndex});else for(var T=0;T<o;T++){var w=d(T),b=w.coordDim;b==null&&(w.coordDim=AR(x,n,y),w.coordDimIndex=0,(!m||_<=0)&&(w.isExtraCoord=!0),_--),S(w),w.type==null&&(mT(t,T)===Je.Must||w.isExtraCoord&&(w.otherDims.itemName!=null||w.otherDims.seriesName!=null))&&(w.type="ordinal")}return wR(a),new _S({source:t,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function wR(t){for(var e=ht(),r=0;r<t.length;r++){var i=t[r],n=i.name,a=e.get(n)||0;a>0&&(i.name=n+(a-1)),a++,e.set(n,a)}}function bR(t,e,r,i){var n=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,i||0);return C(e,function(a){var o;rt(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function AR(t,e,r){if(r||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}var ER=function(){function t(e){this.coordSysDims=[],this.axisMap=ht(),this.categoryAxisMap=ht(),this.coordSysName=e}return t}();function MR(t){var e=t.get("coordinateSystem"),r=new ER(e),i=CR[e];if(i)return i(t,r,r.axisMap,r.categoryAxisMap),r}var CR={cartesian2d:function(t,e,r,i){var n=t.getReferringComponents("xAxis",Ze).models[0],a=t.getReferringComponents("yAxis",Ze).models[0];e.coordSysDims=["x","y"],r.set("x",n),r.set("y",a),pa(n)&&(i.set("x",n),e.firstCategoryDimIndex=0),pa(a)&&(i.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,i){var n=t.getReferringComponents("singleAxis",Ze).models[0];e.coordSysDims=["single"],r.set("single",n),pa(n)&&(i.set("single",n),e.firstCategoryDimIndex=0)},polar:function(t,e,r,i){var n=t.getReferringComponents("polar",Ze).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),pa(a)&&(i.set("radius",a),e.firstCategoryDimIndex=0),pa(o)&&(i.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,i){var n=t.ecModel,a=n.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();C(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),f=o[l];r.set(f,u),pa(u)&&(i.set(f,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function pa(t){return t.get("type")==="category"}function AS(t,e,r){r=r||{};var i=r.byIndex,n=r.stackedCoordDimension,a,o,s;DR(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),u,f,h,v;if(C(a,function(_,y){Q(_)&&(a[y]=_={name:_}),l&&!_.isExtraCoord&&(!i&&!u&&_.ordinalMeta&&(u=_),!f&&_.type!=="ordinal"&&_.type!=="time"&&(!n||n===_.coordDim)&&(f=_))}),f&&!i&&!u&&(i=!0),f){h="__\0ecstackresult_"+t.id,v="__\0ecstackedover_"+t.id,u&&(u.createInvertedIndices=!0);var c=f.coordDim,d=f.type,p=0;C(a,function(_){_.coordDim===c&&p++});var g={name:h,coordDim:c,coordDimIndex:p,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:v,coordDim:v,coordDimIndex:p+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(v,d),m.storeDimIndex=s.ensureCalculationDimension(h,d)),o.appendCalculationDimension(g),o.appendCalculationDimension(m)):(a.push(g),a.push(m))}return{stackedDimension:f&&f.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:v,stackResultDimension:h}}function DR(t){return!yS(t.schema)}function Ja(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function ES(t,e){return Ja(t,e)?t.getCalculationInfo("stackResultDimension"):e}function LR(t,e){var r=t.get("coordinateSystem"),i=Bf.get(r),n;return e&&e.coordSysDims&&(n=tt(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=dR(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function RR(t,e,r){var i,n;return r&&C(t,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(t[i].otherDims.itemName=0),i}function PR(t,e,r){r=r||{};var i=e.getSourceManager(),n,a=!1;n=i.getSource(),a=n.sourceFormat===wr;var o=MR(e),s=LR(e,o),l=r.useEncodeDefaulter,u=ct(l)?l:l?le(LC,s,e):null,f={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=bS(n,f),v=RR(h.dimensions,r.createInvertedIndices,o),c=a?null:i.getSharedDataStore(h),d=AS(e,{schema:h,store:c}),p=new wS(h,e);p.setCalculationInfo(d);var g=v!=null&&IR(n)?function(m,_,y,x){return x===v?y:this.defaultDimValueGetter(m,_,y,x)}:null;return p.hasItemOption=!1,p.initData(a?n:c,null,g),p}function IR(t){if(t.sourceFormat===wr){var e=NR(t.data||[]);return!j(Hs(e))}}function NR(t){for(var e=0;e<t.length&&t[e]==null;)e++;return t[e]}var oi=function(){function t(e){this._setting=e||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(e){return this._setting[e]},t.prototype.unionExtent=function(e){var r=this._extent;e[0]<r[0]&&(r[0]=e[0]),e[1]>r[1]&&(r[1]=e[1])},t.prototype.unionExtentFromData=function(e,r){this.unionExtent(e.getApproximateExtent(r))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(r)||(i[1]=r)},t.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(e){this._isBlank=e},t}();_f(oi);var OR=0,$u=function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++OR}return t.createByAxisModel=function(e){var r=e.option,i=r.data,n=i&&tt(i,BR);return new t({categories:n,needCollect:!n,deduplication:r.dedplication!==!1})},t.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},t.prototype.parseAndCollect=function(e){var r,i=this._needCollect;if(!Q(e)&&!i)return e;if(i&&!this._deduplication)return r=this.categories.length,this.categories[r]=e,r;var n=this._getOrCreateMap();return r=n.get(e),r==null&&(i?(r=this.categories.length,this.categories[r]=e,n.set(e,r)):r=NaN),r},t.prototype._getOrCreateMap=function(){return this._map||(this._map=ht(this.categories))},t}();function BR(t){return rt(t)&&t.value!=null?t.value:t+""}function $v(t){return t.type==="interval"||t.type==="log"}function FR(t,e,r,i){var n={},a=t[1]-t[0],o=n.interval=ox(a/e);r!=null&&o<r&&(o=n.interval=r),i!=null&&o>i&&(o=n.interval=i);var s=n.intervalPrecision=MS(o),l=n.niceTickExtent=[Jt(Math.ceil(t[0]/o)*o,s),Jt(Math.floor(t[1]/o)*o,s)];return kR(l,t),n}function sc(t){var e=Math.pow(10,Ud(t)),r=t/e;return r?r===2?r=3:r===3?r=5:r*=2:r=1,Jt(r*e)}function MS(t){return ci(t)+2}function F0(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function kR(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),F0(t,0,e),F0(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function Hf(t,e){return t>=e[0]&&t<=e[1]}function Vf(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function Gf(t,e){return t*(e[1]-e[0])+e[0]}var Cp=function(t){K(e,t);function e(r){var i=t.call(this,r)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new $u({})),j(n)&&(n=new $u({categories:tt(n,function(a){return rt(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return e.prototype.parse=function(r){return r==null?NaN:Q(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},e.prototype.contain=function(r){return r=this.parse(r),Hf(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),Vf(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(Gf(r,this._extent)),this.getRawOrdinalNumber(r)},e.prototype.getTicks=function(){for(var r=[],i=this._extent,n=i[0];n<=i[1];)r.push({value:n}),n++;return r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=r.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o<l;++o){var u=i[o];n[o]=u,a[u]=o}for(var f=0;o<s;++o){for(;a[f]!=null;)f++;n.push(f),a[f]=o}},e.prototype._getTickNumber=function(r){var i=this._ticksByOrdinalNumber;return i&&r>=0&&r<i.length?i[r]:r},e.prototype.getRawOrdinalNumber=function(r){var i=this._ordinalNumbersByTick;return i&&r>=0&&r<i.length?i[r]:r},e.prototype.getLabel=function(r){if(!this.isBlank()){var i=this.getRawOrdinalNumber(r.value),n=this._ordinalMeta.categories[i];return n==null?"":n+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(r,i){this.unionExtent(r.getApproximateExtent(i))},e.prototype.isInExtentRange=function(r){return r=this._getTickNumber(r),this._extent[0]<=r&&this._extent[1]>=r},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(oi);oi.registerClass(Cp);var yn=Jt,fo=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return Hf(r,this._extent)},e.prototype.normalize=function(r){return Vf(r,this._extent)},e.prototype.scale=function(r){return Gf(r,this._extent)},e.prototype.setExtent=function(r,i){var n=this._extent;isNaN(r)||(n[0]=parseFloat(r)),isNaN(i)||(n[1]=parseFloat(i))},e.prototype.unionExtent=function(r){var i=this._extent;r[0]<i[0]&&(i[0]=r[0]),r[1]>i[1]&&(i[1]=r[1]),this.setExtent(i[0],i[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=MS(r)},e.prototype.getTicks=function(r){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]<a[0]&&(r?s.push({value:yn(a[0]-i,o)}):s.push({value:n[0]}));for(var u=a[0];u<=a[1]&&(s.push({value:u}),u=yn(u+i,o),u!==s[s.length-1].value);)if(s.length>l)return[];var f=s.length?s[s.length-1].value:a[1];return n[1]>f&&(r?s.push({value:yn(f+i,o)}):s.push({value:n[1]})),s},e.prototype.getMinorTicks=function(r){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;o<i.length;o++){for(var s=i[o],l=i[o-1],u=0,f=[],h=s.value-l.value,v=h/r;u<r-1;){var c=yn(l.value+(u+1)*v);c>a[0]&&c<a[1]&&f.push(c),u++}n.push(f)}return n},e.prototype.getLabel=function(r,i){if(r==null)return"";var n=i&&i.precision;n==null?n=ci(r.value)||0:n==="auto"&&(n=this._intervalPrecision);var a=yn(r.value,n,!0);return Uu(a)},e.prototype.calcNiceTicks=function(r,i,n){r=r||5;var a=this._extent,o=a[1]-a[0];if(isFinite(o)){o<0&&(o=-o,a.reverse());var s=FR(a,r,i,n);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(r){var i=this._extent;if(i[0]===i[1])if(i[0]!==0){var n=Math.abs(i[0]);r.fixMax||(i[1]+=n/2),i[0]-=n/2}else i[1]=1;var a=i[1]-i[0];isFinite(a)||(i[0]=0,i[1]=1),this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval);var o=this._interval;r.fixMin||(i[0]=yn(Math.floor(i[0]/o)*o)),r.fixMax||(i[1]=yn(Math.ceil(i[1]/o)*o))},e.prototype.setNiceExtent=function(r,i){this._niceExtent=[r,i]},e.type="interval",e}(oi);oi.registerClass(fo);var CS=typeof Float32Array<"u",zR=CS?Float32Array:Array;function ka(t){return j(t)?CS?new Float32Array(t):t:new zR(t)}var UR="__ec_stack_";function DS(t){return t.get("stack")||UR+t.seriesIndex}function LS(t){return t.dim+t.index}function HR(t,e){var r=[];return e.eachSeriesByType(t,function(i){YR(i)&&r.push(i)}),r}function VR(t){var e={};C(t,function(l){var u=l.coordinateSystem,f=u.getBaseAxis();if(!(f.type!=="time"&&f.type!=="value"))for(var h=l.getData(),v=f.dim+"_"+f.index,c=h.getDimensionIndex(h.mapDimension(f.dim)),d=h.getStore(),p=0,g=d.count();p<g;++p){var m=d.get(c,p);e[v]?e[v].push(m):e[v]=[m]}});var r={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n){n.sort(function(l,u){return l-u});for(var a=null,o=1;o<n.length;++o){var s=n[o]-n[o-1];s>0&&(a=a===null?s:Math.min(a,s))}r[i]=a}}return r}function GR(t){var e=VR(t),r=[];return C(t,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],f=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),v=Math.abs(h[1]-h[0]);s=u?f/v*u:f}else{var c=i.getData();s=Math.abs(o[1]-o[0])/c.count()}var d=se(i.get("barWidth"),s),p=se(i.get("barMaxWidth"),s),g=se(i.get("barMinWidth")||(ZR(i)?.5:1),s),m=i.get("barGap"),_=i.get("barCategoryGap");r.push({bandWidth:s,barWidth:d,barMaxWidth:p,barMinWidth:g,barGap:m,barCategoryGap:_,axisKey:LS(a),stackId:DS(i)})}),WR(r)}function WR(t){var e={};C(t,function(i,n){var a=i.axisKey,o=i.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var f=i.barWidth;f&&!l[u].width&&(l[u].width=f,f=Math.min(s.remainedWidth,f),s.remainedWidth-=f);var h=i.barMaxWidth;h&&(l[u].maxWidth=h);var v=i.barMinWidth;v&&(l[u].minWidth=v);var c=i.barGap;c!=null&&(s.gap=c);var d=i.barCategoryGap;d!=null&&(s.categoryGap=d)});var r={};return C(e,function(i,n){r[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=mt(a).length;s=Math.max(35-l*4,15)+"%"}var u=se(s,o),f=se(i.gap,1),h=i.remainedWidth,v=i.autoWidthCount,c=(h-u)/(v+(v-1)*f);c=Math.max(c,0),C(a,function(m){var _=m.maxWidth,y=m.minWidth;if(m.width){var x=m.width;_&&(x=Math.min(x,_)),y&&(x=Math.max(x,y)),m.width=x,h-=x+f*x,v--}else{var x=c;_&&_<x&&(x=Math.min(_,h)),y&&y>x&&(x=y),x!==c&&(m.width=x,h-=x+f*x,v--)}}),c=(h-u)/(v+(v-1)*f),c=Math.max(c,0);var d=0,p;C(a,function(m,_){m.width||(m.width=c),p=m,d+=m.width*(1+f)}),p&&(d-=p.width*f);var g=-d/2;C(a,function(m,_){r[n][_]=r[n][_]||{bandWidth:o,offset:g,width:m.width},g+=m.width*(1+f)})}),r}function XR(t,e,r){if(t&&e){var i=t[LS(e)];return i!=null&&r!=null?i[DS(r)]:i}}function YR(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function ZR(t){return t.pipelineContext&&t.pipelineContext.large}var qR=function(t,e,r,i){for(;r<i;){var n=r+i>>>1;t[n][1]<e?r=n+1:i=n}return r},RS=function(t){K(e,t);function e(r){var i=t.call(this,r)||this;return i.type="time",i}return e.prototype.getLabel=function(r){var i=this.getSetting("useUTC");return Rf(r.value,Cm[SC(Za(this._minLevelUnit))]||Cm.second,i,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(r,i,n){var a=this.getSetting("useUTC"),o=this.getSetting("locale");return wC(r,i,n,o,a)},e.prototype.getTicks=function(){var r=this._interval,i=this._extent,n=[];if(!r)return n;n.push({value:i[0],level:0});var a=this.getSetting("useUTC"),o=eP(this._minLevelUnit,this._approxInterval,a,i);return n=n.concat(o),n.push({value:i[1],level:0}),n},e.prototype.calcNiceExtent=function(r){var i=this._extent;if(i[0]===i[1]&&(i[0]-=gr,i[1]+=gr),i[1]===-1/0&&i[0]===1/0){var n=new Date;i[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),i[0]=i[1]-gr}this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval)},e.prototype.calcNiceTicks=function(r,i,n){r=r||10;var a=this._extent,o=a[1]-a[0];this._approxInterval=o/r,i!=null&&this._approxInterval<i&&(this._approxInterval=i),n!=null&&this._approxInterval>n&&(this._approxInterval=n);var s=Dl.length,l=Math.min(qR(Dl,this._approxInterval,0,s),s-1);this._interval=Dl[l][1],this._minLevelUnit=Dl[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return $t(r)?r:+ni(r)},e.prototype.contain=function(r){return Hf(this.parse(r),this._extent)},e.prototype.normalize=function(r){return Vf(this.parse(r),this._extent)},e.prototype.scale=function(r){return Gf(r,this._extent)},e.type="time",e}(fo),Dl=[["second",fp],["minute",hp],["hour",fs],["quarter-day",fs*6],["half-day",fs*12],["day",gr*1.2],["half-week",gr*3.5],["week",gr*7],["month",gr*31],["quarter",gr*95],["half-year",Mm/2],["year",Mm]];function $R(t,e,r,i){var n=ni(e),a=ni(r),o=function(d){return Dm(n,d,i)===Dm(a,d,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},f=function(){return u()&&o("hour")},h=function(){return f()&&o("minute")},v=function(){return h()&&o("second")},c=function(){return v()&&o("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return u();case"hour":return f();case"minute":return h();case"second":return v();case"millisecond":return c()}}function KR(t,e){return t/=gr,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function jR(t){var e=30*gr;return t/=e,t>6?6:t>3?3:t>2?2:1}function QR(t){return t/=fs,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function k0(t,e){return t/=e?hp:fp,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function JR(t){return ox(t)}function tP(t,e,r){var i=new Date(t);switch(Za(e)){case"year":case"month":i[tT(r)](0);case"day":i[eT(r)](1);case"hour":i[rT(r)](0);case"minute":i[iT(r)](0);case"second":i[nT(r)](0),i[aT(r)](0)}return i.getTime()}function eP(t,e,r,i){var n=1e4,a=Qx,o=0;function s(M,E,D,R,P,I,N){for(var V=new Date(E),O=E,X=V[R]();O<D&&O<=i[1];)N.push({value:O}),X+=M,V[P](X),O=V.getTime();N.push({value:O,notAdd:!0})}function l(M,E,D){var R=[],P=!E.length;if(!$R(Za(M),i[0],i[1],r)){P&&(E=[{value:tP(new Date(i[0]),M,r)},{value:i[1]}]);for(var I=0;I<E.length-1;I++){var N=E[I].value,V=E[I+1].value;if(N!==V){var O=void 0,X=void 0,G=void 0,lt=!1;switch(M){case"year":O=Math.max(1,Math.round(e/gr/365)),X=cp(r),G=bC(r);break;case"half-year":case"quarter":case"month":O=jR(e),X=qa(r),G=tT(r);break;case"week":case"half-week":case"day":O=KR(e),X=Pf(r),G=eT(r),lt=!0;break;case"half-day":case"quarter-day":case"hour":O=QR(e),X=bs(r),G=rT(r);break;case"minute":O=k0(e,!0),X=If(r),G=iT(r);break;case"second":O=k0(e,!1),X=Nf(r),G=nT(r);break;case"millisecond":O=JR(e),X=Of(r),G=aT(r);break}s(O,N,V,X,G,lt,R),M==="year"&&D.length>1&&I===0&&D.unshift({value:D[0].value-O})}}for(var I=0;I<R.length;I++)D.push(R[I]);return R}}for(var u=[],f=[],h=0,v=0,c=0;c<a.length&&o++<n;++c){var d=Za(a[c]);if(TC(a[c])){l(a[c],u[u.length-1]||[],f);var p=a[c+1]?Za(a[c+1]):null;if(d!==p){if(f.length){v=h,f.sort(function(M,E){return M.value-E.value});for(var g=[],m=0;m<f.length;++m){var _=f[m].value;(m===0||f[m-1].value!==_)&&(g.push(f[m]),_>=i[0]&&_<=i[1]&&h++)}var y=(i[1]-i[0])/e;if(h>y*1.5&&v>y/1.5||(u.push(g),h>y||t===a[c]))break}f=[]}}}for(var x=oe(tt(u,function(M){return oe(M,function(E){return E.value>=i[0]&&E.value<=i[1]&&!E.notAdd})}),function(M){return M.length>0}),S=[],T=x.length-1,c=0;c<x.length;++c)for(var w=x[c],b=0;b<w.length;++b)S.push({value:w[b].value,level:T-c});S.sort(function(M,E){return M.value-E.value});for(var A=[],c=0;c<S.length;++c)(c===0||S[c].value!==S[c-1].value)&&A.push(S[c]);return A}oi.registerClass(RS);var z0=oi.prototype,ds=fo.prototype,rP=Jt,iP=Math.floor,nP=Math.ceil,Ll=Math.pow,Er=Math.log,Dp=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="log",r.base=10,r._originalScale=new fo,r._interval=0,r}return e.prototype.getTicks=function(r){var i=this._originalScale,n=this._extent,a=i.getExtent(),o=ds.getTicks.call(this,r);return tt(o,function(s){var l=s.value,u=Jt(Ll(this.base,l));return u=l===n[0]&&this._fixMin?Rl(u,a[0]):u,u=l===n[1]&&this._fixMax?Rl(u,a[1]):u,{value:u}},this)},e.prototype.setExtent=function(r,i){var n=Er(this.base);r=Er(Math.max(0,r))/n,i=Er(Math.max(0,i))/n,ds.setExtent.call(this,r,i)},e.prototype.getExtent=function(){var r=this.base,i=z0.getExtent.call(this);i[0]=Ll(r,i[0]),i[1]=Ll(r,i[1]);var n=this._originalScale,a=n.getExtent();return this._fixMin&&(i[0]=Rl(i[0],a[0])),this._fixMax&&(i[1]=Rl(i[1],a[1])),i},e.prototype.unionExtent=function(r){this._originalScale.unionExtent(r);var i=this.base;r[0]=Er(r[0])/Er(i),r[1]=Er(r[1])/Er(i),z0.unionExtent.call(this,r)},e.prototype.unionExtentFromData=function(r,i){this.unionExtent(r.getApproximateExtent(i))},e.prototype.calcNiceTicks=function(r){r=r||10;var i=this._extent,n=i[1]-i[0];if(!(n===1/0||n<=0)){var a=RA(n),o=r/n*a;for(o<=.5&&(a*=10);!isNaN(a)&&Math.abs(a)<1&&Math.abs(a)>0;)a*=10;var s=[Jt(nP(i[0]/a)*a),Jt(iP(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(r){ds.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return r=Er(r)/Er(this.base),Hf(r,this._extent)},e.prototype.normalize=function(r){return r=Er(r)/Er(this.base),Vf(r,this._extent)},e.prototype.scale=function(r){return r=Gf(r,this._extent),Ll(this.base,r)},e.type="log",e}(oi),PS=Dp.prototype;PS.getMinorTicks=ds.getMinorTicks;PS.getLabel=ds.getLabel;function Rl(t,e){return rP(t,ci(e))}oi.registerClass(Dp);var aP=function(){function t(e,r,i){this._prepareParams(e,r,i)}return t.prototype._prepareParams=function(e,r,i){i[1]<i[0]&&(i=[NaN,NaN]),this._dataMin=i[0],this._dataMax=i[1];var n=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&r.getNeedCrossZero&&r.getNeedCrossZero();var a=r.get("min",!0);a==null&&(a=r.get("startValue",!0));var o=this._modelMinRaw=a;ct(o)?this._modelMinNum=Pl(e,o({min:i[0],max:i[1]})):o!=="dataMin"&&(this._modelMinNum=Pl(e,o));var s=this._modelMaxRaw=r.get("max",!0);if(ct(s)?this._modelMaxNum=Pl(e,s({min:i[0],max:i[1]})):s!=="dataMax"&&(this._modelMaxNum=Pl(e,s)),n)this._axisDataLen=r.getCategories().length;else{var l=r.get("boundaryGap"),u=j(l)?l:[l||0,l||0];typeof u[0]=="boolean"||typeof u[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[mi(u[0],1),mi(u[1],1)]}},t.prototype.calculate=function(){var e=this._isOrdinal,r=this._dataMin,i=this._dataMax,n=this._axisDataLen,a=this._boundaryGapInner,o=e?null:i-r||Math.abs(r),s=this._modelMinRaw==="dataMin"?r:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?i:this._modelMaxNum,u=s!=null,f=l!=null;s==null&&(s=e?n?0:NaN:r-a[0]*o),l==null&&(l=e?n?n-1:NaN:i+a[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var h=yu(s)||yu(l)||e&&!n;this._needCrossZero&&(s>0&&l>0&&!u&&(s=0),s<0&&l<0&&!f&&(l=0));var v=this._determinedMin,c=this._determinedMax;return v!=null&&(s=v,u=!0),c!=null&&(l=c,f=!0),{min:s,max:l,minFixed:u,maxFixed:f,isBlank:h}},t.prototype.modifyDataMinMax=function(e,r){this[sP[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var i=oP[e];this[i]=r},t.prototype.freeze=function(){this.frozen=!0},t}(),oP={min:"_determinedMin",max:"_determinedMax"},sP={min:"_dataMin",max:"_dataMax"};function IS(t,e,r){var i=t.rawExtentInfo;return i||(i=new aP(t,e,r),t.rawExtentInfo=i,i)}function Pl(t,e){return e==null?null:yu(e)?NaN:t.parse(e)}function NS(t,e){var r=t.type,i=IS(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var n=i.min,a=i.max,o=e.ecModel;if(o&&r==="time"){var s=HR("bar",o),l=!1;if(C(s,function(h){l=l||h.getBaseAxis()===e.axis}),l){var u=GR(s),f=lP(n,a,e,u);n=f.min,a=f.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function lP(t,e,r,i){var n=r.axis.getExtent(),a=n[1]-n[0],o=XR(i,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;C(o,function(c){s=Math.min(c.offset,s)});var l=-1/0;C(o,function(c){l=Math.max(c.offset+c.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,f=e-t,h=1-(s+l)/a,v=f/h-f;return e+=v*(l/u),t-=v*(s/u),{min:t,max:e}}function Kv(t,e){var r=e,i=NS(t,r),n=i.extent,a=r.get("splitNumber");t instanceof Dp&&(t.base=r.get("logBase"));var o=t.type,s=r.get("interval"),l=o==="interval"||o==="time";t.setExtent(n[0],n[1]),t.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&t.setInterval&&t.setInterval(s)}function OS(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new Cp({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new RS({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(oi.getClass(e)||fo)}}function uP(t){var e=t.scale.getExtent(),r=e[0],i=e[1];return!(r>0&&i>0||r<0&&i<0)}function ho(t){var e=t.getLabelModel().get("formatter"),r=t.type==="category"?t.scale.getExtent()[0]:null;return t.scale.type==="time"?function(i){return function(n,a){return t.scale.getFormattedLabel(n,a,i)}}(e):Q(e)?function(i){return function(n){var a=t.scale.getLabel(n),o=i.replace("{value}",a??"");return o}}(e):ct(e)?function(i){return function(n,a){return r!=null&&(a=n.value-r),i(Lp(t,n),a,n.level!=null?{level:n.level}:null)}}(e):function(i){return t.scale.getLabel(i)}}function Lp(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function fP(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var i,n,a=r.getExtent();r instanceof Cp?n=r.count():(i=r.getTicks(),n=i.length);var o=t.getLabelModel(),s=ho(t),l,u=1;n>40&&(u=Math.ceil(n/40));for(var f=0;f<n;f+=u){var h=i?i[f]:{value:a[0]+f},v=s(h,f),c=o.getTextRect(v),d=hP(c,o.get("rotate")||0);l?l.union(d):l=d}return l}}function hP(t,e){var r=e*Math.PI/180,i=t.width,n=t.height,a=i*Math.abs(Math.cos(r))+Math.abs(n*Math.sin(r)),o=i*Math.abs(Math.sin(r))+Math.abs(n*Math.cos(r)),s=new Pt(t.x,t.y,a,o);return s}function Rp(t){var e=t.get("interval");return e??"auto"}function BS(t){return t.type==="category"&&Rp(t.getLabelModel())===0}function FS(t,e){var r={};return C(t.mapDimensionsAll(e),function(i){r[ES(t,i)]=!0}),mt(r)}function cP(t,e,r){e&&C(FS(e,r),function(i){var n=e.getApproximateExtent(i);n[0]<t[0]&&(t[0]=n[0]),n[1]>t[1]&&(t[1]=n[1])})}var kS=function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t}(),vP={isDimensionStacked:Ja,enableDataStack:AS,getStackedDimension:ES};function dP(t,e){var r=e;e instanceof Zt||(r=new Zt(e));var i=OS(r);return i.setExtent(t[0],t[1]),Kv(i,r),i}function pP(t){kr(t,kS)}var U0=[],gP={registerPreprocessor:Ap,registerProcessor:dS,registerPostInit:pS,registerPostUpdate:gS,registerUpdateLifecycle:Ep,registerAction:ta,registerCoordinateSystem:oR,registerLayout:lR,registerVisual:ea,registerTransform:fR,registerLoading:mS,registerMap:uR,registerImpl:UL,PRIORITY:JL,ComponentModel:Rt,ComponentView:ze,SeriesModel:yi,ChartView:Nr,registerComponentModel:function(t){Rt.registerClass(t)},registerComponentView:function(t){ze.registerClass(t)},registerSeriesModel:function(t){yi.registerClass(t)},registerChartView:function(t){Nr.registerClass(t)},registerSubTypeDefaulter:function(t,e){Rt.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){AA(t,e)}};function Qe(t){if(j(t)){C(t,function(e){Qe(e)});return}bt(U0,t)>=0||(U0.push(t),ct(t)&&(t={install:t}),t.install(gP))}var Ls=Yt();function zS(t,e){var r=tt(e,function(i){return t.scale.parse(i)});return t.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function mP(t){var e=t.getLabelModel().get("customValues");if(e){var r=ho(t);return{labels:zS(t,e).map(function(i){var n={value:i};return{formattedLabel:r(n),rawLabel:t.scale.getLabel(n),tickValue:i}})}}return t.type==="category"?yP(t):TP(t)}function _P(t,e){var r=t.getTickModel().get("customValues");return r?{ticks:zS(t,r)}:t.type==="category"?xP(t,e):{ticks:tt(t.scale.getTicks(),function(i){return i.value})}}function yP(t){var e=t.getLabelModel(),r=US(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function US(t,e){var r=HS(t,"labels"),i=Rp(e),n=VS(r,i);if(n)return n;var a,o;return ct(i)?a=XS(t,i):(o=i==="auto"?SP(t):i,a=WS(t,o)),GS(r,i,{labels:a,labelCategoryInterval:o})}function xP(t,e){var r=HS(t,"ticks"),i=Rp(e),n=VS(r,i);if(n)return n;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ct(i))a=XS(t,i,!0);else if(i==="auto"){var s=US(t,t.getLabelModel());o=s.labelCategoryInterval,a=tt(s.labels,function(l){return l.tickValue})}else o=i,a=WS(t,o,!0);return GS(r,i,{ticks:a,tickCategoryInterval:o})}function TP(t){var e=t.scale.getTicks(),r=ho(t);return{labels:tt(e,function(i,n){return{level:i.level,formattedLabel:r(i,n),rawLabel:t.scale.getLabel(i),tickValue:i.value}})}}function HS(t,e){return Ls(t)[e]||(Ls(t)[e]=[])}function VS(t,e){for(var r=0;r<t.length;r++)if(t[r].key===e)return t[r].value}function GS(t,e,r){return t.push({key:e,value:r}),r}function SP(t){var e=Ls(t).autoInterval;return e??(Ls(t).autoInterval=t.calculateCategoryInterval())}function wP(t){var e=bP(t),r=ho(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,n=t.scale,a=n.getExtent(),o=n.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=t.dataToCoord(l+1)-t.dataToCoord(l),f=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),v=0,c=0;l<=a[1];l+=s){var d=0,p=0,g=kd(r({value:l}),e.font,"center","top");d=g.width*1.3,p=g.height*1.3,v=Math.max(v,d,7),c=Math.max(c,p,7)}var m=v/f,_=c/h;isNaN(m)&&(m=1/0),isNaN(_)&&(_=1/0);var y=Math.max(0,Math.floor(Math.min(m,_))),x=Ls(t.model),S=t.getExtent(),T=x.lastAutoInterval,w=x.lastTickCount;return T!=null&&w!=null&&Math.abs(T-y)<=1&&Math.abs(w-o)<=1&&T>y&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?y=T:(x.lastTickCount=o,x.lastAutoInterval=y,x.axisExtent0=S[0],x.axisExtent1=S[1]),y}function bP(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function WS(t,e,r){var i=ho(t),n=t.scale,a=n.getExtent(),o=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],f=n.count();u!==0&&l>1&&f/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=BS(t),v=o.get("showMinLabel")||h,c=o.get("showMaxLabel")||h;v&&u!==a[0]&&p(a[0]);for(var d=u;d<=a[1];d+=l)p(d);c&&d-l!==a[1]&&p(a[1]);function p(g){var m={value:g};s.push(r?g:{formattedLabel:i(m),rawLabel:n.getLabel(m),tickValue:g})}return s}function XS(t,e,r){var i=t.scale,n=ho(t),a=[];return C(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;e(o.value,s)&&a.push(r?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var H0=[0,1],Pp=function(){function t(e,r,i){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=i||[0,0]}return t.prototype.contain=function(e){var r=this._extent,i=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return e>=i&&e<=n},t.prototype.containData=function(e){return this.scale.contain(e)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(e){return nx(e||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(e,r){var i=this._extent;i[0]=e,i[1]=r},t.prototype.dataToCoord=function(e,r){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&n.type==="ordinal"&&(i=i.slice(),V0(i,n.count())),te(e,H0,i,r)},t.prototype.coordToData=function(e,r){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),V0(i,n.count()));var a=te(e,i,H0,r);return this.scale.scale(a)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),i=_P(this,r),n=i.ticks,a=tt(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return AP(this,a,o,e.clamp),a},t.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var i=this.scale.getMinorTicks(r),n=tt(i,function(a){return tt(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},t.prototype.getViewLabels=function(){return mP(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var e=this._extent,r=this.scale.getExtent(),i=r[1]-r[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},t.prototype.calculateCategoryInterval=function(){return wP(this)},t}();function V0(t,e){var r=t[1]-t[0],i=e,n=r/i/2;t[0]+=n,t[1]-=n}function AP(t,e,r,i){var n=e.length;if(!t.onBand||r||!n)return;var a=t.getExtent(),o,s;if(n===1)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[n-1].tickValue-e[0].tickValue,u=(e[n-1].coord-e[0].coord)/l;C(e,function(c){c.coord-=u/2});var f=t.scale.getExtent();s=1+f[1]-e[n-1].tickValue,o={coord:e[n-1].coord+u*s},e.push(o)}var h=a[0]>a[1];v(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift()),i&&v(a[0],e[0].coord)&&e.unshift({coord:a[0]}),v(a[1],o.coord)&&(i?o.coord=a[1]:e.pop()),i&&v(o.coord,a[1])&&e.push({coord:a[1]});function v(c,d){return c=Jt(c),d=Jt(d),h?c>d:c<d}}var Po=Math.PI*2,xn=_i.CMD,EP=["top","right","bottom","left"];function MP(t,e,r,i,n){var a=r.width,o=r.height;switch(t){case"top":i.set(r.x+a/2,r.y-e),n.set(0,-1);break;case"bottom":i.set(r.x+a/2,r.y+o+e),n.set(0,1);break;case"left":i.set(r.x-e,r.y+o/2),n.set(-1,0);break;case"right":i.set(r.x+a+e,r.y+o/2),n.set(1,0);break}}function CP(t,e,r,i,n,a,o,s,l){o-=t,s-=e;var u=Math.sqrt(o*o+s*s);o/=u,s/=u;var f=o*r+t,h=s*r+e;if(Math.abs(i-n)%Po<1e-4)return l[0]=f,l[1]=h,u-r;if(a){var v=i;i=vi(n),n=vi(v)}else i=vi(i),n=vi(n);i>n&&(n+=Po);var c=Math.atan2(s,o);if(c<0&&(c+=Po),c>=i&&c<=n||c+Po>=i&&c+Po<=n)return l[0]=f,l[1]=h,u-r;var d=r*Math.cos(i)+t,p=r*Math.sin(i)+e,g=r*Math.cos(n)+t,m=r*Math.sin(n)+e,_=(d-o)*(d-o)+(p-s)*(p-s),y=(g-o)*(g-o)+(m-s)*(m-s);return _<y?(l[0]=d,l[1]=p,Math.sqrt(_)):(l[0]=g,l[1]=m,Math.sqrt(y))}function jv(t,e,r,i,n,a,o,s){var l=n-t,u=a-e,f=r-t,h=i-e,v=Math.sqrt(f*f+h*h);f/=v,h/=v;var c=l*f+u*h,d=c/v;s&&(d=Math.min(Math.max(d,0),1)),d*=v;var p=o[0]=t+d*f,g=o[1]=e+d*h;return Math.sqrt((p-n)*(p-n)+(g-a)*(g-a))}function YS(t,e,r,i,n,a,o){r<0&&(t=t+r,r=-r),i<0&&(e=e+i,i=-i);var s=t+r,l=e+i,u=o[0]=Math.min(Math.max(n,t),s),f=o[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-n)*(u-n)+(f-a)*(f-a))}var Pr=[];function DP(t,e,r){var i=YS(e.x,e.y,e.width,e.height,t.x,t.y,Pr);return r.set(Pr[0],Pr[1]),i}function LP(t,e,r){for(var i=0,n=0,a=0,o=0,s,l,u=1/0,f=e.data,h=t.x,v=t.y,c=0;c<f.length;){var d=f[c++];c===1&&(i=f[c],n=f[c+1],a=i,o=n);var p=u;switch(d){case xn.M:a=f[c++],o=f[c++],i=a,n=o;break;case xn.L:p=jv(i,n,f[c],f[c+1],h,v,Pr,!0),i=f[c++],n=f[c++];break;case xn.C:p=z1(i,n,f[c++],f[c++],f[c++],f[c++],f[c],f[c+1],h,v,Pr),i=f[c++],n=f[c++];break;case xn.Q:p=H1(i,n,f[c++],f[c++],f[c],f[c+1],h,v,Pr),i=f[c++],n=f[c++];break;case xn.A:var g=f[c++],m=f[c++],_=f[c++],y=f[c++],x=f[c++],S=f[c++];c+=1;var T=!!(1-f[c++]);s=Math.cos(x)*_+g,l=Math.sin(x)*y+m,c<=1&&(a=s,o=l);var w=(h-g)*y/_+g;p=CP(g,m,y,x,x+S,T,w,v,Pr),i=Math.cos(x+S)*_+g,n=Math.sin(x+S)*y+m;break;case xn.R:a=i=f[c++],o=n=f[c++];var b=f[c++],A=f[c++];p=YS(a,o,b,A,h,v,Pr);break;case xn.Z:p=jv(i,n,a,o,h,v,Pr,!0),i=a,n=o;break}p<u&&(u=p,r.set(Pr[0],Pr[1]))}return u}var zn=new yt,me=new yt,tr=new yt,za=new yt,Io=new yt;function G0(t,e){if(t){var r=t.getTextGuideLine(),i=t.getTextContent();if(i&&r){var n=t.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],o=n.candidates||EP,s=i.getBoundingRect().clone();s.applyTransform(i.getComputedTransform());var l=1/0,u=n.anchor,f=t.getComputedTransform(),h=f&&cf([],f),v=e.get("length2")||0;u&&tr.copy(u);for(var c=0;c<o.length;c++){var d=o[c];MP(d,0,s,zn,za),yt.scaleAndAdd(me,zn,za,v),me.transform(h);var p=t.getBoundingRect(),g=u?u.distance(me):t instanceof kt?LP(me,t.path,tr):DP(me,p,tr);g<l&&(l=g,me.transform(f),tr.transform(f),tr.toArray(a[0]),me.toArray(a[1]),zn.toArray(a[2]))}RP(a,e.get("minTurnAngle")),r.setShape({points:a})}}}var W0=[],Tn=new yt;function RP(t,e){if(e<=180&&e>0){e=e/180*Math.PI,zn.fromArray(t[0]),me.fromArray(t[1]),tr.fromArray(t[2]),yt.sub(za,zn,me),yt.sub(Io,tr,me);var r=za.len(),i=Io.len();if(!(r<.001||i<.001)){za.scale(1/r),Io.scale(1/i);var n=za.dot(Io),a=Math.cos(e);if(a<n){var o=jv(me.x,me.y,tr.x,tr.y,zn.x,zn.y,W0,!1);Tn.fromArray(W0),Tn.scaleAndAdd(Io,o/Math.tan(Math.PI-e));var s=tr.x!==me.x?(Tn.x-me.x)/(tr.x-me.x):(Tn.y-me.y)/(tr.y-me.y);if(isNaN(s))return;s<0?yt.copy(Tn,me):s>1&&yt.copy(Tn,tr),Tn.toArray(t[1])}}}}function lc(t,e,r,i){var n=r==="normal",a=n?t:t.ensureState(r);a.ignore=e;var o=i.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();n?t.useStyle(s):a.style=s}function PP(t,e){var r=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),r>0&&i.length>=3){var n=ov(i[0],i[1]),a=ov(i[1],i[2]);if(!n||!a){t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*r,s=th([],i[1],i[0],o/n),l=th([],i[1],i[2],o/a),u=th([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var f=1;f<i.length;f++)t.lineTo(i[f][0],i[f][1])}function IP(t,e,r){var i=t.getTextGuideLine(),n=t.getTextContent();if(!n){i&&t.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),s=n.ignore,l=0;l<Ru.length;l++){var u=Ru[l],f=e[u],h=u==="normal";if(f){var v=f.get("show"),c=h?s:ft(n.states[u]&&n.states[u].ignore,s);if(c||!ft(v,o)){var d=h?i:i&&i.states[u];d&&(d.ignore=!0),i&&lc(i,!0,u,f);continue}i||(i=new Ws,t.setTextGuideLine(i),!h&&(s||!o)&&lc(i,!0,"normal",e.normal),t.stateProxy&&(i.stateProxy=t.stateProxy)),lc(i,!1,u,f)}}if(i){Et(i.style,r),i.style.fill=null;var p=a.get("showAbove"),g=t.textGuideLineConfig=t.textGuideLineConfig||{};g.showAbove=p||!1,i.buildPath=PP}}function NP(t,e){e=e||"labelLine";for(var r={normal:t.getModel(e)},i=0;i<Tr.length;i++){var n=Tr[i];r[n]=t.getModel([n,e])}return r}function ZS(t){for(var e=[],r=0;r<t.length;r++){var i=t[r];if(!i.defaultAttr.ignore){var n=i.label,a=n.getComputedTransform(),o=n.getBoundingRect(),s=!a||a[1]<1e-5&&a[2]<1e-5,l=n.style.margin||0,u=o.clone();u.applyTransform(a),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var f=s?new Ou(o,a):null;e.push({label:n,labelLine:i.labelLine,rect:u,localRect:o,obb:f,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:a})}}return e}function qS(t,e,r,i,n,a){var o=t.length;if(o<2)return;t.sort(function(b,A){return b.rect[e]-A.rect[e]});for(var s=0,l,u=!1,f=0,h=0;h<o;h++){var v=t[h],c=v.rect;l=c[e]-s,l<0&&(c[e]-=l,v.label[e]-=l,u=!0);var d=Math.max(-l,0);f+=d,s=c[e]+c[r]}f>0&&a&&S(-f/o,0,o);var p=t[0],g=t[o-1],m,_;y(),m<0&&T(-m,.8),_<0&&T(_,.8),y(),x(m,_,1),x(_,m,-1),y(),m<0&&w(-m),_<0&&w(_);function y(){m=p.rect[e]-i,_=n-g.rect[e]-g.rect[r]}function x(b,A,M){if(b<0){var E=Math.min(A,-b);if(E>0){S(E*M,0,o);var D=E+b;D<0&&T(-D*M,1)}else T(-b*M,1)}}function S(b,A,M){b!==0&&(u=!0);for(var E=A;E<M;E++){var D=t[E],R=D.rect;R[e]+=b,D.label[e]+=b}}function T(b,A){for(var M=[],E=0,D=1;D<o;D++){var R=t[D-1].rect,P=Math.max(t[D].rect[e]-R[e]-R[r],0);M.push(P),E+=P}if(E){var I=Math.min(Math.abs(b)/E,A);if(b>0)for(var D=0;D<o-1;D++){var N=M[D]*I;S(N,0,D+1)}else for(var D=o-1;D>0;D--){var N=M[D-1]*I;S(-N,D,o)}}}function w(b){var A=b<0?-1:1;b=Math.abs(b);for(var M=Math.ceil(b/(o-1)),E=0;E<o-1;E++)if(A>0?S(M,0,E+1):S(-M,o-E-1,o),b-=M,b<=0)return}return u}function OP(t,e,r,i){return qS(t,"x","width",e,r,i)}function BP(t,e,r,i){return qS(t,"y","height",e,r,i)}function $S(t){var e=[];t.sort(function(p,g){return g.priority-p.priority});var r=new Pt(0,0,0,0);function i(p){if(!p.ignore){var g=p.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}p.ignore=!0}for(var n=0;n<t.length;n++){var a=t[n],o=a.axisAligned,s=a.localRect,l=a.transform,u=a.label,f=a.labelLine;r.copy(a.rect),r.width-=.1,r.height-=.1,r.x+=.05,r.y+=.05;for(var h=a.obb,v=!1,c=0;c<e.length;c++){var d=e[c];if(r.intersect(d.rect)){if(o&&d.axisAligned){v=!0;break}if(d.obb||(d.obb=new Ou(d.localRect,d.transform)),h||(h=new Ou(s,l)),h.intersect(d.obb)){v=!0;break}}}v?(i(u),f&&i(f)):(u.attr("ignore",a.defaultAttr.ignore),f&&f.attr("ignore",a.defaultAttr.labelGuideIgnore),e.push(a))}}function FP(t){if(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].slice());return e}}function kP(t,e){var r=t.label,i=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:r.style.align,verticalAlign:r.style.verticalAlign,labelLinePoints:FP(i&&i.shape.points)}}var X0=["align","verticalAlign","width","height","fontSize"],De=new pf,uc=Yt(),zP=Yt();function Il(t,e,r){for(var i=0;i<r.length;i++){var n=r[i];e[n]!=null&&(t[n]=e[n])}}var Nl=["x","y","rotation"],UP=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(e,r,i,n,a){var o=n.style,s=n.__hostTarget,l=s.textConfig||{},u=n.getComputedTransform(),f=n.getBoundingRect().plain();Pt.applyTransform(f,f,u),u?De.setLocalTransform(u):(De.x=De.y=De.rotation=De.originX=De.originY=0,De.scaleX=De.scaleY=1),De.rotation=vi(De.rotation);var h=n.__hostTarget,v;if(h){v=h.getBoundingRect().plain();var c=h.getComputedTransform();Pt.applyTransform(v,v,c)}var d=v&&h.getTextGuideLine();this._labelList.push({label:n,labelLine:d,seriesModel:i,dataIndex:e,dataType:r,layoutOption:a,computedLayoutOption:null,rect:f,hostRect:v,priority:v?v.width*v.height:0,defaultAttr:{ignore:n.ignore,labelGuideIgnore:d&&d.ignore,x:De.x,y:De.y,scaleX:De.scaleX,scaleY:De.scaleY,rotation:De.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:n.cursor,attachedPos:l.position,attachedRot:l.rotation}})},t.prototype.addLabelsOfSeries=function(e){var r=this;this._chartViewList.push(e);var i=e.__model,n=i.get("labelLayout");(ct(n)||mt(n).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=Mt(a);o&&!o.disableLabelLayout&&r._addLabel(s.dataIndex,s.dataType,i,o,n)})},t.prototype.updateLayoutConfig=function(e){var r=e.getWidth(),i=e.getHeight();function n(y,x){return function(){G0(y,x)}}for(var a=0;a<this._labelList.length;a++){var o=this._labelList[a],s=o.label,l=s.__hostTarget,u=o.defaultAttr,f=void 0;ct(o.layoutOption)?f=o.layoutOption(kP(o,l)):f=o.layoutOption,f=f||{},o.computedLayoutOption=f;var h=Math.PI/180;l&&l.setTextConfig({local:!1,position:f.x!=null||f.y!=null?null:u.attachedPos,rotation:f.rotate!=null?f.rotate*h:u.attachedRot,offset:[f.dx||0,f.dy||0]});var v=!1;if(f.x!=null?(s.x=se(f.x,r),s.setStyle("x",0),v=!0):(s.x=u.x,s.setStyle("x",u.style.x)),f.y!=null?(s.y=se(f.y,i),s.setStyle("y",0),v=!0):(s.y=u.y,s.setStyle("y",u.style.y)),f.labelLinePoints){var c=l.getTextGuideLine();c&&(c.setShape({points:f.labelLinePoints}),v=!1)}var d=uc(s);d.needsUpdateLabelLine=v,s.rotation=f.rotate!=null?f.rotate*h:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var p=0;p<X0.length;p++){var g=X0[p];s.setStyle(g,f[g]!=null?f[g]:u.style[g])}if(f.draggable){if(s.draggable=!0,s.cursor="move",l){var m=o.seriesModel;if(o.dataIndex!=null){var _=o.seriesModel.getData(o.dataType);m=_.getItemModel(o.dataIndex)}s.on("drag",n(l,m.getModel("labelLine")))}}else s.off("drag"),s.cursor=u.cursor}},t.prototype.layout=function(e){var r=e.getWidth(),i=e.getHeight(),n=ZS(this._labelList),a=oe(n,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=oe(n,function(l){return l.layoutOption.moveOverlap==="shiftY"});OP(a,0,r),BP(o,0,i);var s=oe(n,function(l){return l.layoutOption.hideOverlap});$S(s)},t.prototype.processLabelsOverall=function(){var e=this;C(this._chartViewList,function(r){var i=r.__model,n=r.ignoreLabelLineUpdate,a=i.isAnimationEnabled();r.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var s=!n,l=o.getTextContent();!s&&l&&(s=uc(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,i),a&&e._animateLabels(o,i)})})},t.prototype._updateLabelLine=function(e,r){var i=e.getTextContent(),n=Mt(e),a=n.dataIndex;if(i&&a!=null){var o=r.getData(n.dataType),s=o.getItemModel(a),l={},u=o.getItemVisual(a,"style");if(u){var f=o.getVisual("drawType");l.stroke=u[f]}var h=s.getModel("labelLine");IP(e,NP(s),l),G0(e,h)}},t.prototype._animateLabels=function(e,r){var i=e.getTextContent(),n=e.getTextGuideLine();if(i&&(e.forceLabelAnimation||!i.ignore&&!i.invisible&&!e.disableLabelAnimation&&!Xa(e))){var a=uc(i),o=a.oldLayout,s=Mt(e),l=s.dataIndex,u={x:i.x,y:i.y,rotation:i.rotation},f=r.getData(s.dataType);if(o){i.attr(o);var v=e.prevStates;v&&(bt(v,"select")>=0&&i.attr(a.oldLayoutSelect),bt(v,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),Sr(i,u,r,l)}else if(i.attr(u),!Df(i).valueAnimation){var h=ft(i.style.opacity,1);i.style.opacity=0,$i(i,{style:{opacity:h}},r,l)}if(a.oldLayout=u,i.states.select){var c=a.oldLayoutSelect={};Il(c,u,Nl),Il(c,i.states.select,Nl)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};Il(d,u,Nl),Il(d,i.states.emphasis,Nl)}oC(i,l,f,r,r)}if(n&&!n.ignore&&!n.invisible){var a=zP(n),o=a.oldLayout,p={points:n.shape.points};o?(n.attr({shape:o}),Sr(n,{shape:p},r)):(n.setShape(p),n.style.strokePercent=0,$i(n,{style:{strokePercent:1}},r)),a.oldLayout=p}},t}(),fc=Yt();function HP(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,i){var n=fc(r).labelManager;n||(n=fc(r).labelManager=new UP),n.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,i){var n=fc(r).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),n.updateLayoutConfig(r),n.layout(r),n.processLabelsOverall()})}const VP=["getWidth","getHeight","getDom","getOption","resize","dispatchAction","convertToPixel","convertFromPixel","containPixel","getDataURL","getConnectedDataURL","appendData","clear","isDisposed","dispose"];function GP(t){function e(i){return(...n)=>{if(!t.value)throw new Error("ECharts is not initialized yet.");return t.value[i].apply(t.value,n)}}function r(){const i=Object.create(null);return VP.forEach(n=>{i[n]=e(n)}),i}return r()}function WP(t,e,r){jl([r,t,e],([i,n,a],o,s)=>{let l=null;if(i&&n&&a){const{offsetWidth:u,offsetHeight:f}=i,h=a===!0?{}:a,{throttle:v=100,onResize:c}=h;let d=!1;const p=()=>{n.resize(),c==null||c()},g=v?yp(p,v):p;l=new ResizeObserver(()=>{!d&&(d=!0,i.offsetWidth===u&&i.offsetHeight===f)||g()}),l.observe(i)}s(()=>{l&&(l.disconnect(),l=null)})})}const XP={autoresize:[Boolean,Object]},YP=/^on[^a-z]/,KS=t=>YP.test(t);function ZP(t){const e={};for(const r in t)KS(r)||(e[r]=t[r]);return e}function cu(t,e){const r=H2(t)?V2(t):t;return r&&typeof r=="object"&&"value"in r?r.value||e:r||e}const qP="ecLoadingOptions";function $P(t,e,r){const i=Ql(qP,{}),n=Ma(()=>({...cu(i,{}),...r==null?void 0:r.value}));S1(()=>{const a=t.value;a&&(e.value?a.showLoading(n.value):a.hideLoading())})}const KP={loading:Boolean,loadingOptions:Object};let No=null;const Ip="x-vue-echarts";function jP(){if(No!=null)return No;if(typeof HTMLElement>"u"||typeof customElements>"u")return No=!1;try{new Function("tag","class EChartsElement extends HTMLElement{__dispose=null;disconnectedCallback(){this.__dispose&&(this.__dispose(),this.__dispose=null)}}customElements.get(tag)==null&&customElements.define(tag,EChartsElement);")(Ip)}catch{return No=!1}return No=!0}document.head.appendChild(document.createElement("style")).textContent=`x-vue-echarts{display:block;width:100%;height:100%;min-width:0}
`;const QP=jP();rv&&rv.config.ignoredElements.push(Ip);const JP="ecTheme",tI="ecInitOptions",eI="ecUpdateOptions",Y0=/(^&?~?!?)native:/;var f4=N2({name:"echarts",props:{option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean,...XP,...KP},emits:{},inheritAttrs:!1,setup(t,{attrs:e}){const r=Qf(),i=Qf(),n=Qf(),a=Ql(JP,null),o=Ql(tI,null),s=Ql(eI,null),{autoresize:l,manualUpdate:u,loading:f,loadingOptions:h}=O2(t),v=Ma(()=>n.value||t.option||null),c=Ma(()=>t.theme||cu(a,{})),d=Ma(()=>t.initOptions||cu(o,{})),p=Ma(()=>t.updateOptions||cu(s,{})),g=Ma(()=>ZP(e)),m={},_=B2().proxy.$listeners,y={};_?Object.keys(_).forEach(A=>{Y0.test(A)?m[A.replace(Y0,"$1")]=_[A]:y[A]=_[A]}):Object.keys(e).filter(A=>KS(A)).forEach(A=>{let M=A.charAt(2).toLowerCase()+A.slice(3);if(M.indexOf("native:")===0){const E=`on${M.charAt(7).toUpperCase()}${M.slice(8)}`;m[E]=e[A];return}M.substring(M.length-4)==="Once"&&(M=`~${M.substring(0,M.length-4)}`),y[M]=e[A]});function x(A){if(!r.value)return;const M=i.value=nR(r.value,c.value,d.value);t.group&&(M.group=t.group),Object.keys(y).forEach(R=>{let P=y[R];if(!P)return;let I=R.toLowerCase();I.charAt(0)==="~"&&(I=I.substring(1),P.__once__=!0);let N=M;if(I.indexOf("zr:")===0&&(N=M.getZr(),I=I.substring(3)),P.__once__){delete P.__once__;const V=P;P=(...O)=>{V(...O),N.off(I,P)}}N.on(I,P)});function E(){M&&!M.isDisposed()&&M.resize()}function D(){const R=A||v.value;R&&M.setOption(R,p.value)}l.value?U2(()=>{E(),D()}):D()}function S(A,M){t.manualUpdate&&(n.value=A),i.value?i.value.setOption(A,M||{}):x(A)}function T(){i.value&&(i.value.dispose(),i.value=void 0)}let w=null;jl(u,A=>{typeof w=="function"&&(w(),w=null),A||(w=jl(()=>t.option,(M,E)=>{M&&(i.value?i.value.setOption(M,{notMerge:M!==E,...p.value}):x())},{deep:!0}))},{immediate:!0}),jl([c,d],()=>{T(),x()},{deep:!0}),S1(()=>{t.group&&i.value&&(i.value.group=t.group)});const b=GP(i);return $P(i,f,h),WP(i,l,r),F2(()=>{x()}),k2(()=>{QP&&r.value?r.value.__dispose=T:T()}),{chart:i,root:r,setOption:S,nonEventAttrs:g,nativeListeners:m,...b}},render(){const t=rv?{attrs:this.nonEventAttrs,on:this.nativeListeners}:{...this.nonEventAttrs,...this.nativeListeners};return t.ref="root",t.class=t.class?["echarts"].concat(t.class):"echarts",z2(Ip,t)}}),rI=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r){return PR(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(r){var i=new ee,n=Br("line",0,r.itemHeight/2,r.itemWidth,0,r.lineStyle.stroke,!1);i.add(n),n.setStyle(r.lineStyle);var a=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=a==="none"?"circle":a,l=r.itemHeight*.8,u=Br(s,(r.itemWidth-l)/2,(r.itemHeight-l)/2,l,l,r.itemStyle.fill);i.add(u),u.setStyle(r.itemStyle);var f=r.iconRotate==="inherit"?o:r.iconRotate||0;return u.rotation=f*Math.PI/180,u.setOrigin([r.itemWidth/2,r.itemHeight/2]),s.indexOf("empty")>-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(yi);function jS(t,e){var r=t.mapDimensionsAll("defaultedLabel"),i=r.length;if(i===1){var n=Qa(t,e,r[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o<r.length;o++)a.push(Qa(t,e,r[o]));return a.join(" ")}}function iI(t,e){var r=t.mapDimensionsAll("defaultedLabel");if(!j(e))return e+"";for(var i=[],n=0;n<r.length;n++){var a=t.getDimensionIndex(r[n]);a>=0&&i.push(e[a])}return i.join(" ")}var Np=function(t){K(e,t);function e(r,i,n,a){var o=t.call(this)||this;return o.updateData(r,i,n,a),o}return e.prototype._createSymbol=function(r,i,n,a,o){this.removeAll();var s=Br(r,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=nI,this._symbolType=r,this.add(s)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Pu(this.childAt(0))},e.prototype.downplay=function(){Iu(this.childAt(0))},e.prototype.setZ=function(r,i){var n=this.childAt(0);n.zlevel=r,n.z=i},e.prototype.setDraggable=function(r,i){var n=this.childAt(0);n.draggable=r,n.cursor=!i&&r?"move":n.cursor},e.prototype.updateData=function(r,i,n,a){this.silent=!1;var o=r.getItemVisual(i,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,i),u=o!==this._symbolType,f=a&&a.disableAnimation;if(u){var h=r.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,r,i,l,h)}else{var v=this.childAt(0);v.silent=!1;var c={scaleX:l[0]/2,scaleY:l[1]/2};f?v.attr(c):Sr(v,c,s,i),WM(v)}if(this._updateCommon(r,i,l,n,a),u){var v=this.childAt(0);if(!f){var c={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:v.style.opacity}};v.scaleX=v.scaleY=0,v.style.opacity=0,$i(v,c,s,i)}}f&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,i,n,a,o){var s=this.childAt(0),l=r.hostModel,u,f,h,v,c,d,p,g,m;if(a&&(u=a.emphasisItemStyle,f=a.blurItemStyle,h=a.selectItemStyle,v=a.focus,c=a.blurScope,p=a.labelStatesModels,g=a.hoverScale,m=a.cursorStyle,d=a.emphasisDisabled),!a||r.hasItemOption){var _=a&&a.itemModel?a.itemModel:r.getItemModel(i),y=_.getModel("emphasis");u=y.getModel("itemStyle").getItemStyle(),h=_.getModel(["select","itemStyle"]).getItemStyle(),f=_.getModel(["blur","itemStyle"]).getItemStyle(),v=y.get("focus"),c=y.get("blurScope"),d=y.get("disabled"),p=sp(_),g=y.getShallow("scale"),m=_.getShallow("cursor")}var x=r.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=$T(r.getItemVisual(i,"symbolOffset"),n);S&&(s.x=S[0],s.y=S[1]),m&&s.attr("cursor",m);var T=r.getItemVisual(i,"style"),w=T.fill;if(s instanceof ir){var b=s.style;s.useStyle(Y({image:b.image,x:b.x,y:b.y,width:b.width,height:b.height},T))}else s.__isEmptyBrush?s.useStyle(Y({},T)):s.useStyle(T),s.style.decal=null,s.setColor(w,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var A=r.getItemVisual(i,"liftZ"),M=this._z2;A!=null?M==null&&(this._z2=s.z2,s.z2+=A):M!=null&&(s.z2=M,this._z2=null);var E=o&&o.useNameLabel;op(s,p,{labelFetcher:l,labelDataIndex:i,defaultText:D,inheritColor:w,defaultOpacity:T.opacity});function D(I){return E?r.getName(I):jS(r,I)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var R=s.ensureState("emphasis");R.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=f;var P=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;R.scaleX=this._sizeX*P,R.scaleY=this._sizeY*P,this.setSymbolScale(1),Lv(this,v,c,d)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,i,n){var a=this.childAt(0),o=Mt(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&Bu(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Bu(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,i){return wL(r.getItemVisual(i,"symbolSize"))},e}(ee);function nI(t,e){this.parent.drift(t,e)}function hc(t,e,r,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(r))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function Z0(t){return t!=null&&!rt(t)&&(t={isIgnore:t}),t||{}}function q0(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:sp(e),cursorStyle:e.get("cursor")}}var aI=function(){function t(e){this.group=new ee,this._SymbolCtor=e||Np}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Z0(r);var i=this.group,n=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=q0(e),u={disableAnimation:s},f=r.getSymbolPoint||function(h){return e.getItemLayout(h)};a||i.removeAll(),e.diff(a).add(function(h){var v=f(h);if(hc(e,v,h,r)){var c=new o(e,h,l,u);c.setPosition(v),e.setItemGraphicEl(h,c),i.add(c)}}).update(function(h,v){var c=a.getItemGraphicEl(v),d=f(h);if(!hc(e,d,h,r)){i.remove(c);return}var p=e.getItemVisual(h,"symbol")||"circle",g=c&&c.getSymbolType&&c.getSymbolType();if(!c||g&&g!==p)i.remove(c),c=new o(e,h,l,u),c.setPosition(d);else{c.updateData(e,h,l,u);var m={x:d[0],y:d[1]};s?c.attr(m):Sr(c,m,n)}i.add(c),e.setItemGraphicEl(h,c)}).remove(function(h){var v=a.getItemGraphicEl(h);v&&v.fadeOut(function(){i.remove(v)},n)}).execute(),this._getSymbolPoint=f,this._data=e},t.prototype.updateLayout=function(){var e=this,r=this._data;r&&r.eachItemGraphicEl(function(i,n){var a=e._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=q0(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,i){this._progressiveEls=[],i=Z0(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a<e.end;a++){var o=r.getItemLayout(a);if(hc(r,o,a,i)){var s=new this._SymbolCtor(r,a,this._seriesScope);s.traverse(n),s.setPosition(o),this.group.add(s),r.setItemGraphicEl(a,s),this._progressiveEls.push(s)}}},t.prototype.eachRendered=function(e){ap(this._progressiveEls||this.group,e)},t.prototype.remove=function(e){var r=this.group,i=this._data;i&&e?i.eachItemGraphicEl(function(n){n.fadeOut(function(){r.remove(n)},i.hostModel)}):r.removeAll()},t}();function QS(t,e,r){var i=t.getBaseAxis(),n=t.getOtherAxis(i),a=oI(n,r),o=i.dim,s=n.dim,l=e.mapDimension(s),u=e.mapDimension(o),f=s==="x"||s==="radius"?1:0,h=tt(t.dimensions,function(d){return e.mapDimension(d)}),v=!1,c=e.getCalculationInfo("stackResultDimension");return Ja(e,h[0])&&(v=!0,h[0]=c),Ja(e,h[1])&&(v=!0,h[1]=c),{dataDimsForPoint:h,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!v,valueDim:l,baseDim:u,baseDataOffset:f,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function oI(t,e){var r=0,i=t.scale.getExtent();return e==="start"?r=i[0]:e==="end"?r=i[1]:$t(e)&&!isNaN(e)?r=e:i[0]>0?r=i[0]:i[1]<0&&(r=i[1]),r}function JS(t,e,r,i){var n=NaN;t.stacked&&(n=r.get(r.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=t.valueStart);var a=t.baseDataOffset,o=[];return o[a]=r.get(t.baseDim,i),o[1-a]=n,e.dataToPoint(o)}function sI(t,e){var r=[];return e.diff(t).add(function(i){r.push({cmd:"+",idx:i})}).update(function(i,n){r.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){r.push({cmd:"-",idx:i})}).execute(),r}function lI(t,e,r,i,n,a,o,s){for(var l=sI(t,e),u=[],f=[],h=[],v=[],c=[],d=[],p=[],g=QS(n,e,o),m=t.getLayout("points")||[],_=e.getLayout("points")||[],y=0;y<l.length;y++){var x=l[y],S=!0,T=void 0,w=void 0;switch(x.cmd){case"=":T=x.idx*2,w=x.idx1*2;var b=m[T],A=m[T+1],M=_[w],E=_[w+1];(isNaN(b)||isNaN(A))&&(b=M,A=E),u.push(b,A),f.push(M,E),h.push(r[T],r[T+1]),v.push(i[w],i[w+1]),p.push(e.getRawIndex(x.idx1));break;case"+":var D=x.idx,R=g.dataDimsForPoint,P=n.dataToPoint([e.get(R[0],D),e.get(R[1],D)]);w=D*2,u.push(P[0],P[1]),f.push(_[w],_[w+1]);var I=JS(g,n,e,D);h.push(I[0],I[1]),v.push(i[w],i[w+1]),p.push(e.getRawIndex(D));break;case"-":S=!1}S&&(c.push(x),d.push(d.length))}d.sort(function(Dt,pt){return p[Dt]-p[pt]});for(var N=u.length,V=ka(N),O=ka(N),X=ka(N),G=ka(N),lt=[],y=0;y<d.length;y++){var J=d[y],ot=y*2,at=J*2;V[ot]=u[at],V[ot+1]=u[at+1],O[ot]=f[at],O[ot+1]=f[at+1],X[ot]=h[at],X[ot+1]=h[at+1],G[ot]=v[at],G[ot+1]=v[at+1],lt[y]=c[J]}return{current:V,next:O,stackedOnCurrent:X,stackedOnNext:G,status:lt}}var Li=Math.min,Ri=Math.max;function Xn(t,e){return isNaN(t)||isNaN(e)}function Qv(t,e,r,i,n,a,o,s,l){for(var u,f,h,v,c,d,p=r,g=0;g<i;g++){var m=e[p*2],_=e[p*2+1];if(p>=n||p<0)break;if(Xn(m,_)){if(l){p+=a;continue}break}if(p===r)t[a>0?"moveTo":"lineTo"](m,_),h=m,v=_;else{var y=m-u,x=_-f;if(y*y+x*x<.5){p+=a;continue}if(o>0){for(var S=p+a,T=e[S*2],w=e[S*2+1];T===m&&w===_&&g<i;)g++,S+=a,p+=a,T=e[S*2],w=e[S*2+1],m=e[p*2],_=e[p*2+1],y=m-u,x=_-f;var b=g+1;if(l)for(;Xn(T,w)&&b<i;)b++,S+=a,T=e[S*2],w=e[S*2+1];var A=.5,M=0,E=0,D=void 0,R=void 0;if(b>=i||Xn(T,w))c=m,d=_;else{M=T-u,E=w-f;var P=m-u,I=T-m,N=_-f,V=w-_,O=void 0,X=void 0;if(s==="x"){O=Math.abs(P),X=Math.abs(I);var G=M>0?1:-1;c=m-G*O*o,d=_,D=m+G*X*o,R=_}else if(s==="y"){O=Math.abs(N),X=Math.abs(V);var lt=E>0?1:-1;c=m,d=_-lt*O*o,D=m,R=_+lt*X*o}else O=Math.sqrt(P*P+N*N),X=Math.sqrt(I*I+V*V),A=X/(X+O),c=m-M*o*(1-A),d=_-E*o*(1-A),D=m+M*o*A,R=_+E*o*A,D=Li(D,Ri(T,m)),R=Li(R,Ri(w,_)),D=Ri(D,Li(T,m)),R=Ri(R,Li(w,_)),M=D-m,E=R-_,c=m-M*O/X,d=_-E*O/X,c=Li(c,Ri(u,m)),d=Li(d,Ri(f,_)),c=Ri(c,Li(u,m)),d=Ri(d,Li(f,_)),M=m-c,E=_-d,D=m+M*X/O,R=_+E*X/O}t.bezierCurveTo(h,v,c,d,m,_),h=D,v=R}else t.lineTo(m,_)}u=m,f=_,p+=a}return g}var tw=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),uI=function(t){K(e,t);function e(r){var i=t.call(this,r)||this;return i.type="ec-polyline",i}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new tw},e.prototype.buildPath=function(r,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&Xn(n[o*2-2],n[o*2-1]);o--);for(;a<o&&Xn(n[a*2],n[a*2+1]);a++);}for(;a<o;)a+=Qv(r,n,a,o,o,1,i.smooth,i.smoothMonotone,i.connectNulls)+1},e.prototype.getPointOn=function(r,i){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n=this.path,a=n.data,o=_i.CMD,s,l,u=i==="x",f=[],h=0;h<a.length;){var v=a[h++],c=void 0,d=void 0,p=void 0,g=void 0,m=void 0,_=void 0,y=void 0;switch(v){case o.M:s=a[h++],l=a[h++];break;case o.L:if(c=a[h++],d=a[h++],y=u?(r-s)/(c-s):(r-l)/(d-l),y<=1&&y>=0){var x=u?(d-l)*y+l:(c-s)*y+s;return u?[r,x]:[x,r]}s=c,l=d;break;case o.C:c=a[h++],d=a[h++],p=a[h++],g=a[h++],m=a[h++],_=a[h++];var S=u?Su(s,c,p,m,r,f):Su(l,d,g,_,r,f);if(S>0)for(var T=0;T<S;T++){var w=f[T];if(w<=1&&w>=0){var x=u?ce(l,d,g,_,w):ce(s,c,p,m,w);return u?[r,x]:[x,r]}}s=m,l=_;break}}},e}(kt),fI=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tw),hI=function(t){K(e,t);function e(r){var i=t.call(this,r)||this;return i.type="ec-polygon",i}return e.prototype.getDefaultShape=function(){return new fI},e.prototype.buildPath=function(r,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&Xn(n[s*2-2],n[s*2-1]);s--);for(;o<s&&Xn(n[o*2],n[o*2+1]);o++);}for(;o<s;){var u=Qv(r,n,o,s,s,1,i.smooth,l,i.connectNulls);Qv(r,a,o+u-1,u,s,-1,i.stackedOnSmooth,l,i.connectNulls),o+=u+1,r.closePath()}},e}(kt);function cI(t,e,r,i,n){var a=t.getArea(),o=a.x,s=a.y,l=a.width,u=a.height,f=r.get(["lineStyle","width"])||2;o-=f/2,s-=f/2,l+=f,u+=f,l=Math.ceil(l),o!==Math.floor(o)&&(o=Math.floor(o),l++);var h=new Kt({shape:{x:o,y:s,width:l,height:u}});if(e){var v=t.getBaseAxis(),c=v.isHorizontal(),d=v.inverse;c?(d&&(h.shape.x+=l),h.shape.width=0):(d||(h.shape.y+=u),h.shape.height=0);var p=ct(n)?function(g){n(g,h)}:null;$i(h,{shape:{width:l,height:u,x:o,y:s}},r,null,i,p)}return h}function vI(t,e,r){var i=t.getArea(),n=Jt(i.r0,1),a=Jt(i.r,1),o=new Af({shape:{cx:Jt(t.cx,1),cy:Jt(t.cy,1),r0:n,r:a,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});if(e){var s=t.getBaseAxis().dim==="angle";s?o.shape.endAngle=i.startAngle:o.shape.r=n,$i(o,{shape:{endAngle:i.endAngle,r:a}},r)}return o}function dI(t,e){return t.type===e}function $0(t,e){if(t.length===e.length){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return;return!0}}function K0(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,a=0;a<t.length;){var o=t[a++],s=t[a++];isNaN(o)||(e=Math.min(o,e),i=Math.max(o,i)),isNaN(s)||(r=Math.min(s,r),n=Math.max(s,n))}return[[e,r],[i,n]]}function j0(t,e){var r=K0(t),i=r[0],n=r[1],a=K0(e),o=a[0],s=a[1];return Math.max(Math.abs(i[0]-o[0]),Math.abs(i[1]-o[1]),Math.abs(n[0]-s[0]),Math.abs(n[1]-s[1]))}function Q0(t){return $t(t)?t:t?.5:0}function pI(t,e,r){if(!r.valueDim)return[];for(var i=e.count(),n=ka(i*2),a=0;a<i;a++){var o=JS(r,t,e,a);n[a*2]=o[0],n[a*2+1]=o[1]}return n}function Pi(t,e,r,i){var n=e.getBaseAxis(),a=n.dim==="x"||n.dim==="radius"?0:1,o=[],s=0,l=[],u=[],f=[],h=[];if(i){for(s=0;s<t.length;s+=2)!isNaN(t[s])&&!isNaN(t[s+1])&&h.push(t[s],t[s+1]);t=h}for(s=0;s<t.length-2;s+=2)switch(f[0]=t[s+2],f[1]=t[s+3],u[0]=t[s],u[1]=t[s+1],o.push(u[0],u[1]),r){case"end":l[a]=f[a],l[1-a]=u[1-a],o.push(l[0],l[1]);break;case"middle":var v=(u[a]+f[a])/2,c=[];l[a]=c[a]=v,l[1-a]=u[1-a],c[1-a]=f[1-a],o.push(l[0],l[1]),o.push(c[0],c[1]);break;default:l[a]=u[a],l[1-a]=f[1-a],o.push(l[0],l[1])}return o.push(t[s++],t[s++]),o}function gI(t,e){var r=[],i=t.length,n,a;function o(f,h,v){var c=f.coord,d=(v-c)/(h.coord-c),p=Yb(d,[f.color,h.color]);return{coord:v,color:p}}for(var s=0;s<i;s++){var l=t[s],u=l.coord;if(u<0)n=l;else if(u>e){a?r.push(o(a,l,e)):n&&r.push(o(n,l,0),o(n,l,e));break}else n&&(r.push(o(n,l,0)),n=null),r.push(l),a=l}return r}function mI(t,e,r){var i=t.getVisual("visualMeta");if(!(!i||!i.length||!t.count())&&e.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=t.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=e.getAxis(n),u=tt(a.stops,function(y){return{coord:l.toGlobalCoord(l.dataToCoord(y.value)),color:y.color}}),f=u.length,h=a.outerColors.slice();f&&u[0].coord>u[f-1].coord&&(u.reverse(),h.reverse());var v=gI(u,n==="x"?r.getWidth():r.getHeight()),c=v.length;if(!c&&f)return u[0].coord<0?h[1]?h[1]:u[f-1].color:h[0]?h[0]:u[0].color;var d=10,p=v[0].coord-d,g=v[c-1].coord+d,m=g-p;if(m<.001)return"transparent";C(v,function(y){y.offset=(y.coord-p)/m}),v.push({offset:c?v[c-1].offset:.5,color:h[1]||"transparent"}),v.unshift({offset:c?v[0].offset:.5,color:h[0]||"transparent"});var _=new Jd(0,0,0,0,v,!0);return _[n]=p,_[n+"2"]=g,_}}}function _I(t,e,r){var i=t.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(n&&yI(a,e))){var o=e.mapDimension(a.dim),s={};return C(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function yI(t,e){var r=t.getExtent(),i=Math.abs(r[1]-r[0])/t.scale.count();isNaN(i)&&(i=0);for(var n=e.count(),a=Math.max(1,Math.round(n/5)),o=0;o<n;o+=a)if(Np.getSymbolSize(e,o)[t.isHorizontal()?1:0]*1.5>i)return!1;return!0}function xI(t,e){return isNaN(t)||isNaN(e)}function TI(t){for(var e=t.length/2;e>0&&xI(t[e*2-2],t[e*2-1]);e--);return e-1}function J0(t,e){return[t[e*2],t[e*2+1]]}function SI(t,e,r){for(var i=t.length/2,n=r==="x"?0:1,a,o,s=0,l=-1,u=0;u<i;u++)if(o=t[u*2+n],!(isNaN(o)||isNaN(t[u*2+1-n]))){if(u===0){a=o;continue}if(a<=e&&o>=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function ew(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<Tr.length;e++)if(t.get([Tr[e],"endLabel","show"]))return!0;return!1}function cc(t,e,r,i){if(dI(e,"cartesian2d")){var n=i.getModel("endLabel"),a=n.get("valueAnimation"),o=i.getData(),s={lastFrameIndex:0},l=ew(i)?function(c,d){t._endLabelOnDuring(c,d,o,s,a,n,e)}:null,u=e.getBaseAxis().isHorizontal(),f=cI(e,r,i,function(){var c=t._endLabel;c&&r&&s.originalX!=null&&c.attr({x:s.originalX,y:s.originalY})},l);if(!i.get("clip",!0)){var h=f.shape,v=Math.max(h.width,h.height);u?(h.y-=v,h.height+=v*2):(h.x-=v,h.width+=v*2)}return l&&l(1,f),f}else return vI(e,r,i)}function wI(t,e){var r=e.getBaseAxis(),i=r.isHorizontal(),n=r.inverse,a=i?n?"right":"left":"center",o=i?"middle":n?"top":"bottom";return{normal:{align:t.get("align")||a,verticalAlign:t.get("verticalAlign")||o}}}var bI=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(){var r=new ee,i=new aI;this.group.add(i.group),this._symbolDraw=i,this._lineGroup=r},e.prototype.render=function(r,i,n){var a=this,o=r.coordinateSystem,s=this.group,l=r.getData(),u=r.getModel("lineStyle"),f=r.getModel("areaStyle"),h=l.getLayout("points")||[],v=o.type==="polar",c=this._coordSys,d=this._symbolDraw,p=this._polyline,g=this._polygon,m=this._lineGroup,_=!i.ssr&&r.get("animation"),y=!f.isEmpty(),x=f.get("origin"),S=QS(o,l,x),T=y&&pI(o,l,S),w=r.get("showSymbol"),b=r.get("connectNulls"),A=w&&!v&&_I(r,l,o),M=this._data;M&&M.eachItemGraphicEl(function(pt,Ot){pt.__temp&&(s.remove(pt),M.setItemGraphicEl(Ot,null))}),w||d.remove(),s.add(m);var E=v?!1:r.get("step"),D;o&&o.getArea&&r.get("clip",!0)&&(D=o.getArea(),D.width!=null?(D.x-=.1,D.y-=.1,D.width+=.2,D.height+=.2):D.r0&&(D.r0-=.5,D.r+=.5)),this._clipShapeForSymbol=D;var R=mI(l,o,n)||l.getVisual("style")[l.getVisual("drawType")];if(!(p&&c.type===o.type&&E===this._step))w&&d.updateData(l,{isIgnore:A,clipShape:D,disableAnimation:!0,getSymbolPoint:function(pt){return[h[pt*2],h[pt*2+1]]}}),_&&this._initSymbolLabelAnimation(l,o,D),E&&(h=Pi(h,o,E,b),T&&(T=Pi(T,o,E,b))),p=this._newPolyline(h),y?g=this._newPolygon(h,T):g&&(m.remove(g),g=this._polygon=null),v||this._initOrUpdateEndLabel(r,o,$n(R)),m.setClipPath(cc(this,o,!0,r));else{y&&!g?g=this._newPolygon(h,T):g&&!y&&(m.remove(g),g=this._polygon=null),v||this._initOrUpdateEndLabel(r,o,$n(R));var P=m.getClipPath();if(P){var I=cc(this,o,!1,r);$i(P,{shape:I.shape},r)}else m.setClipPath(cc(this,o,!0,r));w&&d.updateData(l,{isIgnore:A,clipShape:D,disableAnimation:!0,getSymbolPoint:function(pt){return[h[pt*2],h[pt*2+1]]}}),(!$0(this._stackedOnPoints,T)||!$0(this._points,h))&&(_?this._doUpdateAnimation(l,T,o,n,E,x,b):(E&&(h=Pi(h,o,E,b),T&&(T=Pi(T,o,E,b))),p.setShape({points:h}),g&&g.setShape({points:h,stackedOnPoints:T})))}var N=r.getModel("emphasis"),V=N.get("focus"),O=N.get("blurScope"),X=N.get("disabled");if(p.useStyle(Et(u.getLineStyle(),{fill:"none",stroke:R,lineJoin:"bevel"})),hm(p,r,"lineStyle"),p.style.lineWidth>0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var G=p.getState("emphasis").style;G.lineWidth=+p.style.lineWidth+1}Mt(p).seriesIndex=r.seriesIndex,Lv(p,V,O,X);var lt=Q0(r.get("smooth")),J=r.get("smoothMonotone");if(p.setShape({smooth:lt,smoothMonotone:J,connectNulls:b}),g){var ot=l.getCalculationInfo("stackedOnSeries"),at=0;g.useStyle(Et(f.getAreaStyle(),{fill:R,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),ot&&(at=Q0(ot.get("smooth"))),g.setShape({smooth:lt,stackedOnSmooth:at,smoothMonotone:J,connectNulls:b}),hm(g,r,"areaStyle"),Mt(g).seriesIndex=r.seriesIndex,Lv(g,V,O,X)}var Dt=function(pt){a._changePolyState(pt)};l.eachItemGraphicEl(function(pt){pt&&(pt.onHoverStateChange=Dt)}),this._polyline.onHoverStateChange=Dt,this._data=l,this._coordSys=o,this._stackedOnPoints=T,this._points=h,this._step=E,this._valueOrigin=x,r.get("triggerLineEvent")&&(this.packEventData(r,p),g&&this.packEventData(r,g))},e.prototype.packEventData=function(r,i){Mt(i).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},e.prototype.highlight=function(r,i,n,a){var o=r.getData(),s=qn(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var f=l[s*2],h=l[s*2+1];if(isNaN(f)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(f,h))return;var v=r.get("zlevel")||0,c=r.get("z")||0;u=new Np(o,s),u.x=f,u.y=h,u.setZ(v,c);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=v,d.z=c,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Nr.prototype.highlight.call(this,r,i,n,a)},e.prototype.downplay=function(r,i,n,a){var o=r.getData(),s=qn(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Nr.prototype.downplay.call(this,r,i,n,a)},e.prototype._changePolyState=function(r){var i=this._polygon;om(this._polyline,r),i&&om(i,r)},e.prototype._newPolyline=function(r){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new uI({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},e.prototype._newPolygon=function(r,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new hI({shape:{points:r,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(r,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,f=u.get("animationDuration");ct(f)&&(f=f(null));var h=u.get("animationDelay")||0,v=ct(h)?h(null):h;r.eachItemGraphicEl(function(c,d){var p=c;if(p){var g=[c.x,c.y],m=void 0,_=void 0,y=void 0;if(n)if(o){var x=n,S=i.pointToCoord(g);a?(m=x.startAngle,_=x.endAngle,y=-S[1]/180*Math.PI):(m=x.r0,_=x.r,y=S[0])}else{var T=n;a?(m=T.x,_=T.x+T.width,y=c.x):(m=T.y+T.height,_=T.y,y=c.y)}var w=_===m?0:(y-m)/(_-m);l&&(w=1-w);var b=ct(h)?h(d):f*w+v,A=p.getSymbolPath(),M=A.getTextContent();p.attr({scaleX:0,scaleY:0}),p.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:b}),M&&M.animateFrom({style:{opacity:0}},{duration:300,delay:b}),A.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,i,n){var a=r.getModel("endLabel");if(ew(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new Xt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var f=TI(l);f>=0&&(op(s,sp(r,"endLabel"),{inheritColor:n,labelFetcher:r,labelDataIndex:f,defaultText:function(h,v,c){return c!=null?iI(o,c):jS(o,h)},enableTextSetter:!0},wI(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,i,n,a,o,s,l){var u=this._endLabel,f=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=n.getLayout("points"),v=n.hostModel,c=v.get("connectNulls"),d=s.get("precision"),p=s.get("distance")||0,g=l.getBaseAxis(),m=g.isHorizontal(),_=g.inverse,y=i.shape,x=_?m?y.x:y.y+y.height:m?y.x+y.width:y.y,S=(m?p:0)*(_?-1:1),T=(m?0:-p)*(_?-1:1),w=m?"x":"y",b=SI(h,x,w),A=b.range,M=A[1]-A[0],E=void 0;if(M>=1){if(M>1&&!c){var D=J0(h,A[0]);u.attr({x:D[0]+S,y:D[1]+T}),o&&(E=v.getRawValue(A[0]))}else{var D=f.getPointOn(x,w);D&&u.attr({x:D[0]+S,y:D[1]+T});var R=v.getRawValue(A[0]),P=v.getRawValue(A[1]);o&&(E=vx(n,d,R,P,b.t))}a.lastFrameIndex=A[0]}else{var I=r===1||a.lastFrameIndex>0?A[0]:0,D=J0(h,I);o&&(E=v.getRawValue(I)),u.attr({x:D[0]+S,y:D[1]+T})}if(o){var N=Df(u);typeof N.setLabelText=="function"&&N.setLabelText(E)}}},e.prototype._doUpdateAnimation=function(r,i,n,a,o,s,l){var u=this._polyline,f=this._polygon,h=r.hostModel,v=lI(this._data,r,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin),c=v.current,d=v.stackedOnCurrent,p=v.next,g=v.stackedOnNext;if(o&&(c=Pi(v.current,n,o,l),d=Pi(v.stackedOnCurrent,n,o,l),p=Pi(v.next,n,o,l),g=Pi(v.stackedOnNext,n,o,l)),j0(c,p)>3e3||f&&j0(d,g)>3e3){u.stopAnimation(),u.setShape({points:p}),f&&(f.stopAnimation(),f.setShape({points:p,stackedOnPoints:g}));return}u.shape.__points=v.current,u.shape.points=c;var m={shape:{points:p}};v.current!==c&&(m.shape.__points=v.next),u.stopAnimation(),Sr(u,m,h),f&&(f.setShape({points:c,stackedOnPoints:d}),f.stopAnimation(),Sr(f,{shape:{stackedOnPoints:g}},h),u.shape.points!==f.shape.points&&(f.shape.points=u.shape.points));for(var _=[],y=v.status,x=0;x<y.length;x++){var S=y[x].cmd;if(S==="="){var T=r.getItemGraphicEl(y[x].idx1);T&&_.push({el:T,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){f&&f.dirtyShape();for(var w=u.shape.__points,b=0;b<_.length;b++){var A=_[b].el,M=_[b].ptIdx*2;A.x=w[M],A.y=w[M+1],A.markRedraw()}})},e.prototype.remove=function(r){var i=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(a,o){a.__temp&&(i.remove(a),n.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(Nr);function AI(t,e){return{seriesType:t,plan:kT(),reset:function(r){var i=r.getData(),n=r.coordinateSystem;if(r.pipelineContext,!!n){var a=tt(n.dimensions,function(h){return i.mapDimension(h)}).slice(0,2),o=a.length,s=i.getCalculationInfo("stackResultDimension");Ja(i,a[0])&&(a[0]=s),Ja(i,a[1])&&(a[1]=s);var l=i.getStore(),u=i.getDimensionIndex(a[0]),f=i.getDimensionIndex(a[1]);return o&&{progress:function(h,v){for(var c=h.end-h.start,d=ka(c*o),p=[],g=[],m=h.start,_=0;m<h.end;m++){var y=void 0;if(o===1){var x=l.get(u,m);y=n.dataToPoint(x,null,g)}else p[0]=l.get(u,m),p[1]=l.get(f,m),y=n.dataToPoint(p,null,g);d[_++]=y[0],d[_++]=y[1]}v.setLayout("points",d)}}}}}}var EI={average:function(t){for(var e=0,r=0,i=0;i<t.length;i++)isNaN(t[i])||(e+=t[i],r++);return r===0?NaN:e/r},sum:function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r]||0;return e},max:function(t){for(var e=-1/0,r=0;r<t.length;r++)t[r]>e&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r<t.length;r++)t[r]<e&&(e=t[r]);return isFinite(e)?e:NaN},minmax:function(t){for(var e=-1/0,r=-1/0,i=0;i<t.length;i++){var n=t[i],a=Math.abs(n);a>e&&(e=a,r=n)}return isFinite(r)?r:NaN},nearest:function(t){return t[0]}},MI=function(t){return Math.round(t.length/2)};function CI(t){return{seriesType:t,reset:function(e,r,i){var n=e.getData(),a=e.get("sampling"),o=e.coordinateSystem,s=n.count();if(s>10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),f=l.getExtent(),h=i.getDevicePixelRatio(),v=Math.abs(f[1]-f[0])*(h||1),c=Math.round(s/v);if(isFinite(c)&&c>1){a==="lttb"&&e.setData(n.lttbDownSample(n.mapDimension(u.dim),1/c));var d=void 0;Q(a)?d=EI[a]:ct(a)&&(d=a),d&&e.setData(n.downSample(n.mapDimension(u.dim),1/c,d,MI))}}}}}function DI(t){t.registerChartView(bI),t.registerSeriesModel(rI),t.registerLayout(AI("line")),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),i=e.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",i)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,CI("line"))}var LI=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Rt),Jv=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ze).models[0]},e.type="cartesian2dAxis",e}(Rt);kr(Jv,kS);var rw={show:!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:"#6E7079",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:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},RI=dt({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},rw),Op=dt({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},rw),PI=dt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Op),II=Et({logBase:10},Op);const NI={category:RI,value:Op,time:PI,log:II};var OI={value:1,category:1,time:1,log:1};function t_(t,e,r,i){C(OI,function(n,a){var o=dt(dt({},NI[a],!0),i,!0),s=function(l){K(u,l);function u(){var f=l!==null&&l.apply(this,arguments)||this;return f.type=e+"Axis."+a,f}return u.prototype.mergeDefaultAndTheme=function(f,h){var v=As(this),c=v?Zs(f):{},d=h.getTheme();dt(f,d.get(a+"Axis")),dt(f,this.getDefaultOption()),f.type=e_(f),v&&Kn(f,c,v)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=$u.createByAxisModel(this))},u.prototype.getCategories=function(f){var h=this.option;if(h.type==="category")return f?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",e_)}function e_(t){return t.type||(t.data?"category":"value")}var Bp=function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return tt(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),oe(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t}(),td=["x","y"];function r_(t){return t.type==="interval"||t.type==="time"}var BI=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=td,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!r_(r)||!r_(i))){var n=r.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var f=(s[0]-o[0])/l,h=(s[1]-o[1])/u,v=o[0]-n[0]*f,c=o[1]-a[0]*h,d=this._transform=[f,0,0,h,v,c];this._invTransform=cf([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(r[0]))&&n.contain(n.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,i){var n=this.dataToPoint(r),a=this.dataToPoint(i),o=this.getArea(),s=new Pt(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,i,n){n=n||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return _r(n,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},e.prototype.clampData=function(r,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(r[0]),u=a.parse(r[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},e.prototype.pointToData=function(r,i){var n=[];if(this._invTransform)return _r(n,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(r[0]),i),n[1]=o.coordToData(o.toLocalCoord(r[1]),i),n},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(r){r=r||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-r,o=Math.min(n[0],n[1])-r,s=Math.max(i[0],i[1])-a+r,l=Math.max(n[0],n[1])-o+r;return new Pt(a,o,s,l)},e}(Bp),FI=function(t){K(e,t);function e(r,i,n,a,o){var s=t.call(this,r,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),r&&i[0]>i[1]&&i.reverse(),i},e.prototype.pointToData=function(r,i){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),i)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e}(Pp);function ed(t,e,r){r=r||{};var i=t.coordinateSystem,n=e.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,f=i.getRect(),h=[f.x,f.x+f.width,f.y,f.y+f.height],v={left:0,right:1,top:0,bottom:1,onZero:2},c=e.get("offset")||0,d=u==="x"?[h[2]-c,h[3]+c]:[h[0]-c,h[1]+c];if(o){var p=o.toGlobalCoord(o.dataToCoord(0));d[v.onZero]=Math.max(Math.min(p,d[1]),d[0])}a.position=[u==="y"?d[v[l]]:h[0],u==="x"?d[v[l]]:h[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=g[s],a.labelOffset=o?d[v[s]]-d[v.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),ja(r.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var m=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-m:m,a.z2=1,a}function i_(t){return t.get("coordinateSystem")==="cartesian2d"}function n_(t){var e={xAxisModel:null,yAxisModel:null};return C(e,function(r,i){var n=i.replace(/Model$/,""),a=t.getReferringComponents(n,Ze).models[0];e[i]=a}),e}var vc=Math.log;function kI(t,e,r){var i=fo.prototype,n=i.getTicks.call(r),a=i.getTicks.call(r,!0),o=n.length-1,s=i.getInterval.call(r),l=NS(t,e),u=l.extent,f=l.fixMin,h=l.fixMax;if(t.type==="log"){var v=vc(t.base);u=[vc(u[0])/v,vc(u[1])/v]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:o,fixMin:f,fixMax:h});var c=i.getExtent.call(t);f&&(u[0]=c[0]),h&&(u[1]=c[1]);var d=i.getInterval.call(t),p=u[0],g=u[1];if(f&&h)d=(g-p)/o;else if(f)for(g=u[0]+d*o;g<u[1]&&isFinite(g)&&isFinite(u[1]);)d=sc(d),g=u[0]+d*o;else if(h)for(p=u[1]-d*o;p>u[0]&&isFinite(p)&&isFinite(u[0]);)d=sc(d),p=u[1]-d*o;else{var m=t.getTicks().length-1;m>o&&(d=sc(d));var _=d*o;g=Math.ceil(u[1]/d)*d,p=Jt(g-_),p<0&&u[0]>=0?(p=0,g=Jt(_)):g>0&&u[1]<=0&&(g=0,p=-Jt(_))}var y=(n[0].value-a[0].value)/s,x=(n[o].value-a[o].value)/s;i.setExtent.call(t,p+d*y,g+d*x),i.setInterval.call(t,d),(y||x)&&i.setNiceExtent.call(t,p+d,g-d)}var zI=function(){function t(e,r,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=td,this._initCartesian(e,r,i),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var i=this._axesMap;this._updateScale(e,this.model);function n(o){var s,l=mt(o),u=l.length;if(u){for(var f=[],h=u-1;h>=0;h--){var v=+l[h],c=o[v],d=c.model,p=c.scale;$v(p)&&d.get("alignTicks")&&d.get("interval")==null?f.push(c):(Kv(p,d),$v(p)&&(s=c))}f.length&&(s||(s=f.pop(),Kv(s.scale,s.model)),C(f,function(g){kI(g.scale,g.model,s.scale)}))}}n(i.x),n(i.y);var a={};C(i.x,function(o){a_(i,"y",o,a)}),C(i.y,function(o){a_(i,"x",o,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,i){var n=e.getBoxLayoutParams(),a=!i&&e.get("containLabel"),o=Ki(n,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(C(s,function(u){if(!u.model.get(["axisLabel","inside"])){var f=fP(u);if(f){var h=u.isHorizontal()?"height":"width",v=u.model.get(["axisLabel","margin"]);o[h]-=f[h]+v,u.position==="top"?o.y+=f.height+v:u.position==="left"&&(o.x+=f.width+v)}}}),l()),C(this._coordsList,function(u){u.calcAffineTransform()});function l(){C(s,function(u){var f=u.isHorizontal(),h=f?[0,o.width]:[0,o.height],v=u.inverse?1:0;u.setExtent(h[v],h[1-v]),UI(u,f?o.x:o.y)})}},t.prototype.getAxis=function(e,r){var i=this._axesMap[e];if(i!=null)return i[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var i="x"+e+"y"+r;return this._coordsMap[i]}rt(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,a=this._coordsList;n<a.length;n++)if(a[n].getAxis("x").index===e||a[n].getAxis("y").index===r)return a[n]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(e,r,i){var n=this._findConvertTarget(r);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},t.prototype.convertFromPixel=function(e,r,i){var n=this._findConvertTarget(r);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},t.prototype._findConvertTarget=function(e){var r=e.seriesModel,i=e.xAxisModel||r&&r.getReferringComponents("xAxis",Ze).models[0],n=e.yAxisModel||r&&r.getReferringComponents("yAxis",Ze).models[0],a=e.gridModel,o=this._coordsList,s,l;if(r)s=r.coordinateSystem,bt(o,s)<0&&(s=null);else if(i&&n)s=this.getCartesian(i.componentIndex,n.componentIndex);else if(i)l=this.getAxis("x",i.componentIndex);else if(n)l=this.getAxis("y",n.componentIndex);else if(a){var u=a.coordinateSystem;u===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},t.prototype.containPoint=function(e){var r=this._coordsList[0];if(r)return r.containPoint(e)},t.prototype._initCartesian=function(e,r,i){var n=this,a=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(r.eachComponent("xAxis",u("x"),this),r.eachComponent("yAxis",u("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,C(s.x,function(f,h){C(s.y,function(v,c){var d="x"+h+"y"+c,p=new BI(d);p.master=n,p.model=e,n._coordsMap[d]=p,n._coordsList.push(p),p.addAxis(f),p.addAxis(v)})});function u(f){return function(h,v){if(dc(h,e)){var c=h.get("position");f==="x"?c!=="top"&&c!=="bottom"&&(c=o.bottom?"top":"bottom"):c!=="left"&&c!=="right"&&(c=o.left?"right":"left"),o[c]=!0;var d=new FI(f,OS(h),[0,0],h.get("type"),c),p=d.type==="category";d.onBand=p&&h.get("boundaryGap"),d.inverse=h.get("inverse"),h.axis=d,d.model=h,d.grid=a,d.index=v,a._axesList.push(d),s[f][v]=d,l[f]++}}}},t.prototype._updateScale=function(e,r){C(this._axesList,function(n){if(n.scale.setExtent(1/0,-1/0),n.type==="category"){var a=n.model.get("categorySortInfo");n.scale.setSortInfo(a)}}),e.eachSeries(function(n){if(i_(n)){var a=n_(n),o=a.xAxisModel,s=a.yAxisModel;if(!dc(o,r)||!dc(s,r))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),u=n.getData(),f=l.getAxis("x"),h=l.getAxis("y");i(u,f),i(u,h)}},this);function i(n,a){C(FS(n,a.dim),function(o){a.scale.unionExtentFromData(n,o)})}},t.prototype.getTooltipAxes=function(e){var r=[],i=[];return C(this.getCartesians(),function(n){var a=e!=null&&e!=="auto"?n.getAxis(e):n.getBaseAxis(),o=n.getOtherAxis(a);bt(r,a)<0&&r.push(a),bt(i,o)<0&&i.push(o)}),{baseAxes:r,otherAxes:i}},t.create=function(e,r){var i=[];return e.eachComponent("grid",function(n,a){var o=new t(n,e,r);o.name="grid_"+a,o.resize(n,r,!0),n.coordinateSystem=o,i.push(o)}),e.eachSeries(function(n){if(i_(n)){var a=n_(n),o=a.xAxisModel,s=a.yAxisModel,l=o.getCoordSysModel(),u=l.coordinateSystem;n.coordinateSystem=u.getCartesian(o.componentIndex,s.componentIndex)}}),i},t.dimensions=td,t}();function dc(t,e){return t.getCoordSysModel()===e}function a_(t,e,r,i){r.getAxesOnZeroOf=function(){return a?[a]:[]};var n=t[e],a,o=r.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)o_(n[l])&&(a=n[l]);else for(var u in n)if(n.hasOwnProperty(u)&&o_(n[u])&&!i[f(n[u])]){a=n[u];break}a&&(i[f(a)]=!0);function f(h){return h.dim+"_"+h.index}}function o_(t){return t&&t.type!=="category"&&t.type!=="time"&&uP(t)}function UI(t,e){var r=t.getExtent(),i=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(n){return n+e}:function(n){return i-n+e},t.toLocalCoord=t.dim==="x"?function(n){return n-e}:function(n){return i-n+e}}var Ui=Math.PI,Yi=function(){function t(e,r){this.group=new ee,this.opt=r,this.axisModel=e,Et(r,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var i=new ee({x:r.position[0],y:r.position[1],rotation:r.rotation});i.updateTransform(),this._transformGroup=i}return t.prototype.hasBuilder=function(e){return!!s_[e]},t.prototype.add=function(e){s_[e](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(e,r,i){var n=ax(r-e),a,o;return Cu(n)?(o=i>0?"top":"bottom",a="center"):Cu(n-Ui)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n<Ui?a=i>0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t}(),s_={axisLine:function(t,e,r,i){var n=e.get(["axisLine","show"]);if(n==="auto"&&t.handleAutoShown&&(n=t.handleAutoShown("axisLine")),!!n){var a=e.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(_r(s,s,o),_r(l,l,o));var f=Y({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new qi({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:f,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});ws(h.shape,h.style.lineWidth),h.anid="line",r.add(h);var v=e.get(["axisLine","symbol"]);if(v!=null){var c=e.get(["axisLine","symbolSize"]);Q(v)&&(v=[v,v]),(Q(c)||$t(c))&&(c=[c,c]);var d=$T(e.get(["axisLine","symbolOffset"])||0,c),p=c[0],g=c[1];C([{rotate:t.rotation+Math.PI/2,offset:d[0],r:0},{rotate:t.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(m,_){if(v[_]!=="none"&&v[_]!=null){var y=Br(v[_],-p/2,-g/2,p,g,f.stroke,!0),x=m.r+m.offset,S=u?l:s;y.attr({rotation:m.rotate,x:S[0]+x*Math.cos(t.rotation),y:S[1]-x*Math.sin(t.rotation),silent:!0,z2:11}),r.add(y)}})}}},axisTickLabel:function(t,e,r,i){var n=GI(r,i,e,t),a=XI(r,i,e,t);if(VI(e,a,n),WI(r,i,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=ZS(tt(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));$S(o)}},axisName:function(t,e,r,i){var n=ja(t.axisName,e.get("name"));if(n){var a=e.get("nameLocation"),o=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),f=u[0]>u[1]?-1:1,h=[a==="start"?u[0]-f*l:a==="end"?u[1]+f*l:(u[0]+u[1])/2,u_(a)?t.labelOffset+o*l:0],v,c=e.get("nameRotate");c!=null&&(c=c*Ui/180);var d;u_(a)?v=Yi.innerTextLayout(t.rotation,c??t.rotation,o):(v=HI(t.rotation,a,c||0,u),d=t.axisNameAvailableWidth,d!=null&&(d=Math.abs(d/Math.sin(v.rotation)),!isFinite(d)&&(d=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},m=g.ellipsis,_=ja(t.nameTruncateMaxWidth,g.maxWidth,d),y=new Xt({x:h[0],y:h[1],rotation:v.rotation,silent:Yi.isLabelSilent(e),style:qe(s,{text:n,font:p,overflow:"truncate",width:_,ellipsis:m,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||v.textAlign,verticalAlign:s.get("verticalAlign")||v.textVerticalAlign}),z2:1});if(Mf({el:y,componentModel:e,itemName:n}),y.__fullText=n,y.anid="name",e.get("triggerEvent")){var x=Yi.makeAxisEventDataBase(e);x.targetType="axisName",x.name=n,Mt(y).eventData=x}i.add(y),y.updateTransform(),r.add(y),y.decomposeTransform()}}};function HI(t,e,r,i){var n=ax(r-t),a,o,s=i[0]>i[1],l=e==="start"&&!s||e!=="start"&&s;return Cu(n-Ui/2)?(o=l?"bottom":"top",a="center"):Cu(n-Ui*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",n<Ui*1.5&&n>Ui/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function VI(t,e,r){if(!BS(t.axis)){var i=t.get(["axisLabel","showMinLabel"]),n=t.get(["axisLabel","showMaxLabel"]);e=e||[],r=r||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=r[0],f=r[1],h=r[r.length-1],v=r[r.length-2];i===!1?(ar(a),ar(u)):l_(a,o)&&(i?(ar(o),ar(f)):(ar(a),ar(u))),n===!1?(ar(s),ar(h)):l_(l,s)&&(n?(ar(l),ar(v)):(ar(s),ar(h)))}}function ar(t){t&&(t.ignore=!0)}function l_(t,e){var r=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(!(!r||!i)){var n=Nd([]);return Od(n,n,-t.rotation),r.applyTransform(Ga([],n,t.getLocalTransform())),i.applyTransform(Ga([],n,e.getLocalTransform())),r.intersect(i)}}function u_(t){return t==="middle"||t==="center"}function iw(t,e,r,i,n){for(var a=[],o=[],s=[],l=0;l<t.length;l++){var u=t[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=r,e&&(_r(o,o,e),_r(s,s,e));var f=new qi({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});ws(f.shape,f.style.lineWidth),f.anid=n+"_"+t[l].tickValue,a.push(f)}return a}function GI(t,e,r,i){var n=r.axis,a=r.getModel("axisTick"),o=a.get("show");if(o==="auto"&&i.handleAutoShown&&(o=i.handleAutoShown("axisTick")),!(!o||n.scale.isBlank())){for(var s=a.getModel("lineStyle"),l=i.tickDirection*a.get("length"),u=n.getTicksCoords(),f=iw(u,e.transform,l,Et(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;h<f.length;h++)t.add(f[h]);return f}}function WI(t,e,r,i){var n=r.axis,a=r.getModel("minorTick");if(!(!a.get("show")||n.scale.isBlank())){var o=n.getMinorTicksCoords();if(o.length)for(var s=a.getModel("lineStyle"),l=i*a.get("length"),u=Et(s.getLineStyle(),Et(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),f=0;f<o.length;f++)for(var h=iw(o[f],e.transform,l,u,"minorticks_"+f),v=0;v<h.length;v++)t.add(h[v])}}function XI(t,e,r,i){var n=r.axis,a=ja(i.axisLabelShow,r.get(["axisLabel","show"]));if(!(!a||n.scale.isBlank())){var o=r.getModel("axisLabel"),s=o.get("margin"),l=n.getViewLabels(),u=(ja(i.labelRotate,o.get("rotate"))||0)*Ui/180,f=Yi.innerTextLayout(i.rotation,u,i.labelDirection),h=r.getCategories&&r.getCategories(!0),v=[],c=Yi.isLabelSilent(r),d=r.get("triggerEvent");return C(l,function(p,g){var m=n.scale.type==="ordinal"?n.scale.getRawOrdinalNumber(p.tickValue):p.tickValue,_=p.formattedLabel,y=p.rawLabel,x=o;if(h&&h[m]){var S=h[m];rt(S)&&S.textStyle&&(x=new Zt(S.textStyle,o,r.ecModel))}var T=x.getTextColor()||r.get(["axisLine","lineStyle","color"]),w=n.dataToCoord(m),b=x.getShallow("align",!0)||f.textAlign,A=ft(x.getShallow("alignMinLabel",!0),b),M=ft(x.getShallow("alignMaxLabel",!0),b),E=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||f.textVerticalAlign,D=ft(x.getShallow("verticalAlignMinLabel",!0),E),R=ft(x.getShallow("verticalAlignMaxLabel",!0),E),P=new Xt({x:w,y:i.labelOffset+i.labelDirection*s,rotation:f.rotation,silent:c,z2:10+(p.level||0),style:qe(x,{text:_,align:g===0?A:g===l.length-1?M:b,verticalAlign:g===0?D:g===l.length-1?R:E,fill:ct(T)?T(n.type==="category"?y:n.type==="value"?m+"":m,g):T})});if(P.anid="label_"+m,d){var I=Yi.makeAxisEventDataBase(r);I.targetType="axisLabel",I.value=y,I.tickIndex=g,n.type==="category"&&(I.dataIndex=m),Mt(P).eventData=I}e.add(P),P.updateTransform(),v.push(P),t.add(P),P.decomposeTransform()}),v}}function YI(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return ZI(r,t,e),r.seriesInvolved&&$I(r,t),r}function ZI(t,e,r){var i=e.getComponent("tooltip"),n=e.getComponent("axisPointer"),a=n.get("link",!0)||[],o=[];C(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Rs(s.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var f=s.model,h=f.getModel("tooltip",i);if(C(s.getAxes(),le(p,!1,null)),s.getTooltipAxes&&i&&h.get("show")){var v=h.get("trigger")==="axis",c=h.get(["axisPointer","type"])==="cross",d=s.getTooltipAxes(h.get(["axisPointer","axis"]));(v||c)&&C(d.baseAxes,le(p,c?"cross":!0,v)),c&&C(d.otherAxes,le(p,"cross",!1))}function p(g,m,_){var y=_.model.getModel("axisPointer",n),x=y.get("show");if(!(!x||x==="auto"&&!g&&!rd(y))){m==null&&(m=y.get("triggerTooltip")),y=g?qI(_,h,n,e,g,m):y;var S=y.get("snap"),T=y.get("triggerEmphasis"),w=Rs(_.model),b=m||S||_.type==="category",A=t.axesInfo[w]={key:w,axis:_,coordSys:s,axisPointerModel:y,triggerTooltip:m,triggerEmphasis:T,involveSeries:b,snap:S,useHandle:rd(y),seriesModels:[],linkGroup:null};u[w]=A,t.seriesInvolved=t.seriesInvolved||b;var M=KI(a,_);if(M!=null){var E=o[M]||(o[M]={axesInfo:{}});E.axesInfo[w]=A,E.mapper=a[M].mapper,A.linkGroup=E}}}})}function qI(t,e,r,i,n,a){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};C(s,function(v){l[v]=ut(o.get(v))}),l.snap=t.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),n==="cross"){var f=o.get(["label","show"]);if(u.show=f??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&Et(u,h.textStyle)}}return t.model.getModel("axisPointer",new Zt(l,r,i))}function $I(t,e){e.eachSeries(function(r){var i=r.coordinateSystem,n=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!i||n==="none"||n===!1||n==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||C(t.coordSysAxesInfo[Rs(i.model)],function(o){var s=o.axis;i.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function KI(t,e){for(var r=e.model,i=e.dim,n=0;n<t.length;n++){var a=t[n]||{};if(pc(a[i+"AxisId"],r.id)||pc(a[i+"AxisIndex"],r.componentIndex)||pc(a[i+"AxisName"],r.name))return n}}function pc(t,e){return t==="all"||j(t)&&bt(t,e)>=0||t===e}function jI(t){var e=Fp(t);if(e){var r=e.axisPointerModel,i=e.axis.scale,n=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=i.parse(o));var s=rd(r);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),n.value=o,s&&(n.status=e.axis.scale.isBlank()?"hide":"show")}}function Fp(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[Rs(t)]}function QI(t){var e=Fp(t);return e&&e.axisPointerModel}function rd(t){return!!t.get(["handle","show"])}function Rs(t){return t.type+"||"+t.id}var f_={},nw=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,i,n,a){this.axisPointerClass&&jI(r),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(r,n,!0)},e.prototype.updateAxisPointer=function(r,i,n,a){this._doUpdateAxisPointerClass(r,n,!1)},e.prototype.remove=function(r,i){var n=this._axisPointer;n&&n.remove(i)},e.prototype.dispose=function(r,i){this._disposeAxisPointer(i),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(r,i,n){var a=e.getAxisPointerClass(this.axisPointerClass);if(a){var o=QI(r);o?(this._axisPointer||(this._axisPointer=new a)).render(r,o,i,n):this._disposeAxisPointer(i)}},e.prototype._disposeAxisPointer=function(r){this._axisPointer&&this._axisPointer.dispose(r),this._axisPointer=null},e.registerAxisPointerClass=function(r,i){f_[r]=i},e.getAxisPointerClass=function(r){return r&&f_[r]},e.type="axis",e}(ze),id=Yt();function JI(t,e,r,i){var n=r.axis;if(!n.scale.isBlank()){var a=r.getModel("splitArea"),o=a.getModel("areaStyle"),s=o.get("color"),l=i.coordinateSystem.getRect(),u=n.getTicksCoords({tickModel:a,clamp:!0});if(u.length){var f=s.length,h=id(t).splitAreaColors,v=ht(),c=0;if(h)for(var d=0;d<u.length;d++){var p=h.get(u[d].tickValue);if(p!=null){c=(p+(f-1)*d)%f;break}}var g=n.toGlobalCoord(u[0].coord),m=o.getAreaStyle();s=j(s)?s:[s];for(var d=1;d<u.length;d++){var _=n.toGlobalCoord(u[d].coord),y=void 0,x=void 0,S=void 0,T=void 0;n.isHorizontal()?(y=g,x=l.y,S=_-y,T=l.height,g=y+S):(y=l.x,x=g,S=l.width,T=_-x,g=x+T);var w=u[d-1].tickValue;w!=null&&v.set(w,c),e.add(new Kt({anid:w!=null?"area_"+w:null,shape:{x:y,y:x,width:S,height:T},style:Et({fill:s[c]},m),autoBatch:!0,silent:!0})),c=(c+1)%f}id(t).splitAreaColors=v}}}function tN(t){id(t).splitAreaColors=null}var eN=["axisLine","axisTickLabel","axisName"],rN=["splitArea","splitLine","minorSplitLine"],aw=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="CartesianAxisPointer",r}return e.prototype.render=function(r,i,n,a){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new ee,this.group.add(this._axisGroup),!!r.get("show")){var s=r.getCoordSysModel(),l=ed(s,r),u=new Yi(r,Y({handleAutoShown:function(h){for(var v=s.coordinateSystem.getCartesians(),c=0;c<v.length;c++)if($v(v[c].getOtherAxis(r.axis).scale))return!0;return!1}},l));C(eN,u.add,u),this._axisGroup.add(u.getGroup()),C(rN,function(h){r.get([h,"show"])&&iN[h](this,this._axisGroup,r,s)},this);var f=a&&a.type==="changeAxisOrder"&&a.isInitSort;f||Xx(o,this._axisGroup,r),t.prototype.render.call(this,r,i,n,a)}},e.prototype.remove=function(){tN(this)},e.type="cartesianAxis",e}(nw),iN={splitLine:function(t,e,r,i){var n=r.axis;if(!n.scale.isBlank()){var a=r.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=j(s)?s:[s];for(var l=i.coordinateSystem.getRect(),u=n.isHorizontal(),f=0,h=n.getTicksCoords({tickModel:a}),v=[],c=[],d=o.getLineStyle(),p=0;p<h.length;p++){var g=n.toGlobalCoord(h[p].coord);u?(v[0]=g,v[1]=l.y,c[0]=g,c[1]=l.y+l.height):(v[0]=l.x,v[1]=g,c[0]=l.x+l.width,c[1]=g);var m=f++%s.length,_=h[p].tickValue,y=new qi({anid:_!=null?"line_"+h[p].tickValue:null,autoBatch:!0,shape:{x1:v[0],y1:v[1],x2:c[0],y2:c[1]},style:Et({stroke:s[m]},d),silent:!0});ws(y.shape,d.lineWidth),e.add(y)}}},minorSplitLine:function(t,e,r,i){var n=r.axis,a=r.getModel("minorSplitLine"),o=a.getModel("lineStyle"),s=i.coordinateSystem.getRect(),l=n.isHorizontal(),u=n.getMinorTicksCoords();if(u.length)for(var f=[],h=[],v=o.getLineStyle(),c=0;c<u.length;c++)for(var d=0;d<u[c].length;d++){var p=n.toGlobalCoord(u[c][d].coord);l?(f[0]=p,f[1]=s.y,h[0]=p,h[1]=s.y+s.height):(f[0]=s.x,f[1]=p,h[0]=s.x+s.width,h[1]=p);var g=new qi({anid:"minor_line_"+u[c][d].tickValue,autoBatch:!0,shape:{x1:f[0],y1:f[1],x2:h[0],y2:h[1]},style:v,silent:!0});ws(g.shape,v.lineWidth),e.add(g)}},splitArea:function(t,e,r,i){JI(t,e,r,i)}},ow=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="xAxis",e}(aw),nN=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=ow.type,r}return e.type="yAxis",e}(aw),aN=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="grid",r}return e.prototype.render=function(r,i){this.group.removeAll(),r.get("show")&&this.group.add(new Kt({shape:r.coordinateSystem.getRect(),style:Et({fill:r.get("backgroundColor")},r.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(ze),h_={offset:0};function oN(t){t.registerComponentView(aN),t.registerComponentModel(LI),t.registerCoordinateSystem("cartesian2d",zI),t_(t,"x",Jv,h_),t_(t,"y",Jv,h_),t.registerComponentView(ow),t.registerComponentView(nN),t.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var c_="\0_ec_interaction_mutex";function v_(t,e){return!!sN(t)[e]}function sN(t){return t[c_]||(t[c_]={})}ta({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Te);var lN=function(t){K(e,t);function e(r){var i=t.call(this)||this;i._zr=r;var n=nt(i._mousedownHandler,i),a=nt(i._mousemoveHandler,i),o=nt(i._mouseupHandler,i),s=nt(i._mousewheelHandler,i),l=nt(i._pinchHandler,i);return i.enable=function(u,f){this.disable(),this._opt=Et(ut(f)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),u==null&&(u=!0),(u===!0||u==="move"||u==="pan")&&(r.on("mousedown",n),r.on("mousemove",a),r.on("mouseup",o)),(u===!0||u==="scale"||u==="zoom")&&(r.on("mousewheel",s),r.on("pinch",l))},i.disable=function(){r.off("mousedown",n),r.off("mousemove",a),r.off("mouseup",o),r.off("mousewheel",s),r.off("pinch",l)},i}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(r){this.pointerChecker=r},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(r){if(!hg(r)){for(var i=r.target;i;){if(i.draggable)return;i=i.__hostTarget||i.parent}var n=r.offsetX,a=r.offsetY;this.pointerChecker&&this.pointerChecker(r,n,a)&&(this._x=n,this._y=a,this._dragging=!0)}},e.prototype._mousemoveHandler=function(r){if(!(!this._dragging||!vu("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||v_(this._zr,"globalPan"))){var i=r.offsetX,n=r.offsetY,a=this._x,o=this._y,s=i-a,l=n-o;this._x=i,this._y=n,this._opt.preventDefaultMouseMove&&gi(r.event),sw(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:a,oldY:o,newX:i,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){hg(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var i=vu("zoomOnMouseWheel",r,this._opt),n=vu("moveOnMouseWheel",r,this._opt),a=r.wheelDelta,o=Math.abs(a),s=r.offsetX,l=r.offsetY;if(!(a===0||!i&&!n)){if(i){var u=o>3?1.4:o>1?1.2:1.1,f=a>0?u:1/u;gc(this,"zoom","zoomOnMouseWheel",r,{scale:f,originX:s,originY:l,isAvailableBehavior:null})}if(n){var h=Math.abs(a),v=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);gc(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:v,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!v_(this._zr,"globalPan")){var i=r.pinchScale>1?1.1:1/1.1;gc(this,"zoom",null,r,{scale:i,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e}(zr);function gc(t,e,r,i,n){t.pointerChecker&&t.pointerChecker(i,n.originX,n.originY)&&(gi(i.event),sw(t,e,r,i,n))}function sw(t,e,r,i,n){n.isAvailableBehavior=nt(vu,null,r,i),t.trigger(e,n)}function vu(t,e,r){var i=r[t];return!t||i&&(!Q(i)||e.event[i+"Key"])}var Ps=C,uN=rt,Ku=-1,Me=function(){function t(e){var r=e.mappingMethod,i=e.type,n=this.option=ut(e);this.type=i,this.mappingMethod=r,this._normalizeData=cN[r];var a=t.visualHandlers[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(mc(n),fN(n)):r==="category"?n.categories?hN(n):mc(n,!0):(xr(r!=="linear"||n.dataExtent),mc(n))}return t.prototype.mapValueToVisual=function(e){var r=this._normalizeData(e);return this._normalizedToVisual(r,e)},t.prototype.getNormalizer=function(){return nt(this._normalizeData,this)},t.listVisualTypes=function(){return mt(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(e,r,i){rt(e)?C(e,r,i):r.call(i,e)},t.mapVisual=function(e,r,i){var n,a=j(e)?[]:rt(e)?{}:(n=!0,null);return t.eachVisual(e,function(o,s){var l=r.call(i,o,s);n?a=l:a[s]=l}),a},t.retrieveVisuals=function(e){var r={},i;return e&&Ps(t.visualHandlers,function(n,a){e.hasOwnProperty(a)&&(r[a]=e[a],i=!0)}),i?r:null},t.prepareVisualTypes=function(e){if(j(e))e=e.slice();else if(uN(e)){var r=[];Ps(e,function(i,n){r.push(n)}),e=r}else return[];return e.sort(function(i,n){return n==="color"&&i!=="color"&&i.indexOf("color")===0?1:-1}),e},t.dependsOn=function(e,r){return r==="color"?!!(e&&e.indexOf(r)===0):e===r},t.findPieceIndex=function(e,r,i){for(var n,a=1/0,o=0,s=r.length;o<s;o++){var l=r[o].value;if(l!=null){if(l===e||Q(l)&&l===e+"")return o;i&&v(l,o)}}for(var o=0,s=r.length;o<s;o++){var u=r[o],f=u.interval,h=u.close;if(f){if(f[0]===-1/0){if(Bl(h[1],e,f[1]))return o}else if(f[1]===1/0){if(Bl(h[0],f[0],e))return o}else if(Bl(h[0],f[0],e)&&Bl(h[1],e,f[1]))return o;i&&v(f[0],o),i&&v(f[1],o)}}if(i)return e===1/0?r.length-1:e===-1/0?0:n;function v(c,d){var p=Math.abs(c-e);p<a&&(a=p,n=d)}},t.visualHandlers={color:{applyVisual:Oo("color"),getColorMapper:function(){var e=this.option;return nt(e.mappingMethod==="category"?function(r,i){return!i&&(r=this._normalizeData(r)),Qo.call(this,r)}:function(r,i,n){var a=!!n;return!i&&(r=this._normalizeData(r)),n=fh(r,e.parsedVisual,n),a?n:pi(n,"rgba")},this)},_normalizedToVisual:{linear:function(e){return pi(fh(e,this.option.parsedVisual),"rgba")},category:Qo,piecewise:function(e,r){var i=ad.call(this,r);return i==null&&(i=pi(fh(e,this.option.parsedVisual),"rgba")),i},fixed:Rn}},colorHue:Ol(function(e,r){return hh(e,r)}),colorSaturation:Ol(function(e,r){return hh(e,null,r)}),colorLightness:Ol(function(e,r){return hh(e,null,null,r)}),colorAlpha:Ol(function(e,r){return Zb(e,r)}),decal:{applyVisual:Oo("decal"),_normalizedToVisual:{linear:null,category:Qo,piecewise:null,fixed:null}},opacity:{applyVisual:Oo("opacity"),_normalizedToVisual:nd([0,1])},liftZ:{applyVisual:Oo("liftZ"),_normalizedToVisual:{linear:Rn,category:Rn,piecewise:Rn,fixed:Rn}},symbol:{applyVisual:function(e,r,i){var n=this.mapValueToVisual(e);i("symbol",n)},_normalizedToVisual:{linear:d_,category:Qo,piecewise:function(e,r){var i=ad.call(this,r);return i==null&&(i=d_.call(this,e)),i},fixed:Rn}},symbolSize:{applyVisual:Oo("symbolSize"),_normalizedToVisual:nd([0,1])}},t}();function fN(t){var e=t.pieceList;t.hasSpecialVisual=!1,C(e,function(r,i){r.originIndex=i,r.visual!=null&&(t.hasSpecialVisual=!0)})}function hN(t){var e=t.categories,r=t.categoryMap={},i=t.visual;if(Ps(e,function(o,s){r[o]=s}),!j(i)){var n=[];rt(i)?Ps(i,function(o,s){var l=r[s];n[l??Ku]=o}):n[Ku]=i,i=lw(t,n)}for(var a=e.length-1;a>=0;a--)i[a]==null&&(delete r[e[a]],e.pop())}function mc(t,e){var r=t.visual,i=[];rt(r)?Ps(r,function(a){i.push(a)}):r!=null&&i.push(r);var n={color:1,symbol:1};!e&&i.length===1&&!n.hasOwnProperty(t.type)&&(i[1]=i[0]),lw(t,i)}function Ol(t){return{applyVisual:function(e,r,i){var n=this.mapValueToVisual(e);i("color",t(r("color"),n))},_normalizedToVisual:nd([0,1])}}function d_(t){var e=this.option.visual;return e[Math.round(te(t,[0,1],[0,e.length-1],!0))]||{}}function Oo(t){return function(e,r,i){i(t,this.mapValueToVisual(e))}}function Qo(t){var e=this.option.visual;return e[this.option.loop&&t!==Ku?t%e.length:t]}function Rn(){return this.option.visual[0]}function nd(t){return{linear:function(e){return te(e,t,this.option.visual,!0)},category:Qo,piecewise:function(e,r){var i=ad.call(this,r);return i==null&&(i=te(e,t,this.option.visual,!0)),i},fixed:Rn}}function ad(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var i=Me.findPieceIndex(t,r),n=r[i];if(n&&n.visual)return n.visual[this.type]}}function lw(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=tt(e,function(r){var i=Be(r);return i||[0,0,0,1]})),e}var cN={linear:function(t){return te(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=Me.findPieceIndex(t,e,!0);if(r!=null)return te(r,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return e??Ku},fixed:Te};function Bl(t,e,r){return t?e<=r:e<r}function qs(t,e,r,i,n,a){t=t||0;var o=r[1]-r[0];if(n!=null&&(n=ga(n,[0,o])),a!=null&&(a=Math.max(a,n??0)),i==="all"){var s=Math.abs(e[1]-e[0]);s=ga(s,[0,o]),n=a=ga(s,[n,a]),i=0}e[0]=ga(e[0],r),e[1]=ga(e[1],r);var l=_c(e,i);e[i]+=t;var u=n||0,f=r.slice();l.sign<0?f[0]+=u:f[1]-=u,e[i]=ga(e[i],f);var h;return h=_c(e,i),n!=null&&(h.sign!==l.sign||h.span<n)&&(e[1-i]=e[i]+l.sign*n),h=_c(e,i),a!=null&&h.span>a&&(e[1-i]=e[i]+h.sign*a),e}function _c(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function ga(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}function vN(t,e,r,i){return t&&(t.legacy||t.legacy!==!1&&!r&&!i&&e!=="tspan"&&(e==="text"||gt(t,"text")))}function dN(t,e,r){var i=t,n,a,o;if(e==="text")o=i;else{o={},gt(i,"text")&&(o.text=i.text),gt(i,"rich")&&(o.rich=i.rich),gt(i,"textFill")&&(o.fill=i.textFill),gt(i,"textStroke")&&(o.stroke=i.textStroke),gt(i,"fontFamily")&&(o.fontFamily=i.fontFamily),gt(i,"fontSize")&&(o.fontSize=i.fontSize),gt(i,"fontStyle")&&(o.fontStyle=i.fontStyle),gt(i,"fontWeight")&&(o.fontWeight=i.fontWeight),a={type:"text",style:o,silent:!0},n={};var s=gt(i,"textPosition");n.position=s?i.textPosition:"inside",gt(i,"textPosition")&&(n.position=i.textPosition),gt(i,"textOffset")&&(n.offset=i.textOffset),gt(i,"textRotation")&&(n.rotation=i.textRotation),gt(i,"textDistance")&&(n.distance=i.textDistance)}return p_(o,t),C(o.rich,function(l){p_(l,l)}),{textConfig:n,textContent:a}}function p_(t,e){e&&(e.font=e.textFont||e.font,gt(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),gt(e,"textAlign")&&(t.align=e.textAlign),gt(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),gt(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),gt(e,"textWidth")&&(t.width=e.textWidth),gt(e,"textHeight")&&(t.height=e.textHeight),gt(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),gt(e,"textPadding")&&(t.padding=e.textPadding),gt(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),gt(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),gt(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),gt(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),gt(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),gt(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),gt(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}var uw={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},g_=mt(uw);Qn(ii,function(t,e){return t[e]=1,t},{});ii.join(", ");var ju=["","style","shape","extra"],to=Yt();function kp(t,e,r,i,n){var a=t+"Animation",o=tp(t,i,n)||{},s=to(e).userDuring;return o.duration>0&&(o.during=s?nt(xN,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=t),Y(o,r[a]),o}function yc(t,e,r,i){i=i||{};var n=i.dataIndex,a=i.isInit,o=i.clearStyle,s=r.isAnimationEnabled(),l=to(t),u=e.style;l.userDuring=e.during;var f={},h={};if(SN(t,e,h),__("shape",e,h),__("extra",e,h),!a&&s&&(TN(t,e,f),m_("shape",t,e,f),m_("extra",t,e,f),wN(t,e,u,f)),h.style=u,gN(t,h,o),_N(t,e),s)if(a){var v={};C(ju,function(d){var p=d?e[d]:e;p&&p.enterFrom&&(d&&(v[d]=v[d]||{}),Y(d?v[d]:v,p.enterFrom))});var c=kp("enter",t,e,r,n);c.duration>0&&t.animateFrom(v,c)}else mN(t,e,n||0,r,f);fw(t,e),u?t.dirty():t.markRedraw()}function fw(t,e){for(var r=to(t).leaveToProps,i=0;i<ju.length;i++){var n=ju[i],a=n?e[n]:e;a&&a.leaveTo&&(r||(r=to(t).leaveToProps={}),n&&(r[n]=r[n]||{}),Y(n?r[n]:r,a.leaveTo))}}function pN(t,e,r,i){if(t){var n=t.parent,a=to(t).leaveToProps;if(a){var o=kp("update",t,e,r,0);o.done=function(){n.remove(t)},t.animateTo(a,o)}else n.remove(t)}}function Yn(t){return t==="all"}function gN(t,e,r){var i=e.style;if(!t.isGroup&&i){if(r){t.useStyle({});for(var n=t.animators,a=0;a<n.length;a++){var o=n[a];o.targetName==="style"&&o.changeTarget(t.style)}}t.setStyle(i)}e&&(e.style=null,e&&t.attr(e),e.style=i)}function mN(t,e,r,i,n){if(n){var a=kp("update",t,e,i,r);a.duration>0&&t.animateFrom(n,a)}}function _N(t,e){gt(e,"silent")&&(t.silent=e.silent),gt(e,"ignore")&&(t.ignore=e.ignore),t instanceof Jn&&gt(e,"invisible")&&(t.invisible=e.invisible),t instanceof kt&&gt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var Xr={},yN={setTransform:function(t,e){return Xr.el[t]=e,this},getTransform:function(t){return Xr.el[t]},setShape:function(t,e){var r=Xr.el,i=r.shape||(r.shape={});return i[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=Xr.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=Xr.el,i=r.style;return i&&(i[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=Xr.el.style;if(e)return e[t]},setExtra:function(t,e){var r=Xr.el.extra||(Xr.el.extra={});return r[t]=e,this},getExtra:function(t){var e=Xr.el.extra;if(e)return e[t]}};function xN(){var t=this,e=t.el;if(e){var r=to(e).userDuring,i=t.userDuring;if(r!==i){t.el=t.userDuring=null;return}Xr.el=e,i(yN)}}function m_(t,e,r,i){var n=r[t];if(n){var a=e[t],o;if(a){var s=r.transition,l=n.transition;if(l)if(!o&&(o=i[t]={}),Yn(l))Y(o,a);else for(var u=ue(l),f=0;f<u.length;f++){var h=u[f],v=a[h];o[h]=v}else if(Yn(s)||bt(s,t)>=0){!o&&(o=i[t]={});for(var c=mt(a),f=0;f<c.length;f++){var h=c[f],v=a[h];bN(n[h],v)&&(o[h]=v)}}}}}function __(t,e,r){var i=e[t];if(i)for(var n=r[t]={},a=mt(i),o=0;o<a.length;o++){var s=a[o];n[s]=ns(i[s])}}function TN(t,e,r){for(var i=e.transition,n=Yn(i)?ii:ue(i||[]),a=0;a<n.length;a++){var o=n[a];if(!(o==="style"||o==="shape"||o==="extra")){var s=t[o];r[o]=s}}}function SN(t,e,r){for(var i=0;i<g_.length;i++){var n=g_[i],a=uw[n],o=e[n];o&&(r[a[0]]=o[0],r[a[1]]=o[1])}for(var i=0;i<ii.length;i++){var s=ii[i];e[s]!=null&&(r[s]=e[s])}}function wN(t,e,r,i){if(r){var n=t.style,a;if(n){var o=r.transition,s=e.transition;if(o&&!Yn(o)){var l=ue(o);!a&&(a=i.style={});for(var u=0;u<l.length;u++){var f=l[u],h=n[f];a[f]=h}}else if(t.getAnimationStyleProps&&(Yn(s)||Yn(o)||bt(s,"style")>=0)){var v=t.getAnimationStyleProps(),c=v?v.style:null;if(c){!a&&(a=i.style={});for(var d=mt(r),u=0;u<d.length;u++){var f=d[u];if(c[f]){var h=n[f];a[f]=h}}}}}}}function bN(t,e){return ke(t)?t!==e:t!=null&&isFinite(t)}var hw=Yt(),AN=["percent","easing","shape","style","extra"];function EN(t){t.stopAnimation("keyframe"),t.attr(hw(t))}function od(t,e,r){if(!(!r.isAnimationEnabled()||!e)){if(j(e)){C(e,function(s){od(t,s,r)});return}var i=e.keyframes,n=e.duration;if(r&&n==null){var a=tp("enter",r,0);n=a&&a.duration}if(!(!i||!n)){var o=hw(t);C(ju,function(s){if(!(s&&!t[s])){var l;i.sort(function(u,f){return u.percent-f.percent}),C(i,function(u){var f=t.animators,h=s?u[s]:u;if(h){var v=mt(h);if(s||(v=oe(v,function(p){return bt(AN,p)<0})),!!v.length){l||(l=t.animate(s,e.loop,!0),l.scope="keyframe");for(var c=0;c<f.length;c++)f[c]!==l&&f[c].targetName===l.targetName&&f[c].stopTracks(v);s&&(o[s]=o[s]||{});var d=s?o[s]:o;C(v,function(p){d[p]=((s?t[s]:t)||{})[p]}),l.whenWithKeys(n*u.percent,h,v,u.easing)}}}),l&&l.delay(e.delay||0).duration(n).start(e.easing)}})}}}function y_(t,e,r){var i=oo.createCanvas(),n=e.getWidth(),a=e.getHeight(),o=i.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=n+"px",o.height=a+"px",i.setAttribute("data-zr-dom-id",t)),i.width=n*r,i.height=a*r,i}var xc=function(t){K(e,t);function e(r,i,n){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;n=n||Mu,typeof r=="string"?o=y_(r,i,n):rt(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(L1(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=i,a.dpr=n,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=y_("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,i,n,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new Pt(0,0,0,0);function f(_){if(!(!_.isFinite()||_.isZero()))if(o.length===0){var y=new Pt(0,0,0,0);y.copy(_),o.push(y)}else{for(var x=!1,S=1/0,T=0,w=0;w<o.length;++w){var b=o[w];if(b.intersect(_)){var A=new Pt(0,0,0,0);A.copy(b),A.union(_),o[w]=A,x=!0;break}else if(l){u.copy(_),u.union(b);var M=_.width*_.height,E=b.width*b.height,D=u.width*u.height,R=D-M-E;R<S&&(S=R,T=w)}}if(l&&(o[T].union(_),x=!0),!x){var y=new Pt(0,0,0,0);y.copy(_),o.push(y)}l||(l=o.length>=s)}}for(var h=this.__startIndex;h<this.__endIndex;++h){var v=r[h];if(v){var c=v.shouldBePainted(n,a,!0,!0),d=v.__isRendered&&(v.__dirty&er||!c)?v.getPrevPaintRect():null;d&&f(d);var p=c&&(v.__dirty&er||!v.__isRendered)?v.getPaintRect():null;p&&f(p)}}for(var h=this.__prevStartIndex;h<this.__prevEndIndex;++h){var v=i[h],c=v&&v.shouldBePainted(n,a,!0,!0);if(v&&(!c||!v.__zr)&&v.__isRendered){var d=v.getPrevPaintRect();d&&f(d)}}var g;do{g=!1;for(var h=0;h<o.length;){if(o[h].isZero()){o.splice(h,1);continue}for(var m=h+1;m<o.length;)o[h].intersect(o[m])?(g=!0,o[h].union(o[m]),o.splice(m,1)):m++;h++}}while(g);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,i){var n=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=r+"px",o.height=i+"px"),a.width=r*n,a.height=i*n,s&&(s.width=r*n,s.height=i*n,n!==1&&this.ctxBack.scale(n,n))},e.prototype.clear=function(r,i,n){var a=this.dom,o=this.ctx,s=a.width,l=a.height;i=i||this.clearColor;var u=this.motionBlur&&!r,f=this.lastFrameAlpha,h=this.dpr,v=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/h,l/h));var c=this.domBack;function d(p,g,m,_){if(o.clearRect(p,g,m,_),i&&i!=="transparent"){var y=void 0;if(ff(i)){var x=i.global||i.__width===m&&i.__height===_;y=x&&i.__canvasGradient||Gv(o,i,{x:0,y:0,width:m,height:_}),i.__canvasGradient=y,i.__width=m,i.__height=_}else rb(i)&&(i.scaleX=i.scaleX||h,i.scaleY=i.scaleY||h,y=Wv(o,i,{dirty:function(){v.setUnpainted(),v.painter.refresh()}}));o.save(),o.fillStyle=y||i,o.fillRect(p,g,m,_),o.restore()}u&&(o.save(),o.globalAlpha=f,o.drawImage(c,p,g,m,_),o.restore())}!n||u?d(0,0,s,l):n.length&&C(n,function(p){d(p.x*h,p.y*h,p.width*h,p.height*h)})},e}(zr),x_=1e5,Sn=314159,Fl=.01,MN=.001;function CN(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function DN(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var LN=function(){function t(e,r,i,n){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=i=Y({},i||{}),this.dpr=i.devicePixelRatio||Mu,this._singleCanvas=a,this.root=e;var o=e.style;o&&(L1(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var f=e,h=f.width,v=f.height;i.width!=null&&(h=i.width),i.height!=null&&(v=i.height),this.dpr=i.devicePixelRatio||1,f.width=h*this.dpr,f.height=v*this.dpr,this._width=h,this._height=v;var c=new xc(f,this,this.dpr);c.__builtin__=!0,c.initContext(),l[Sn]=c,c.zlevel=Sn,s.push(Sn),this._domRoot=e}else{this._width=Fa(e,0,i),this._height=Fa(e,1,i);var u=this._domRoot=DN(this._width,this._height);e.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),i=this._prevDisplayList,n=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,i,e,this._redrawId);for(var a=0;a<n.length;a++){var o=n[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,i=this._hoverlayer;if(i&&i.clear(),!!r){for(var n={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<r;o++){var s=e[o];s.__inHover&&(i||(i=this._hoverlayer=this.getLayer(x_)),a||(a=i.ctx,a.save()),kn(a,s,n,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(x_)},t.prototype.paintOne=function(e,r){Tp(e,r)},t.prototype._paintList=function(e,r,i,n){if(this._redrawId===n){i=i||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,r,i),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;ms(function(){l._paintList(e,r,i,n)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Sn).ctx,r=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,r,i),this.eachBuiltinLayer(function(n){n.virtual&&e.drawImage(n.dom,0,0,r,i)})},t.prototype._doPaintList=function(e,r,i){for(var n=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||i)&&a.push(u)}for(var f=!0,h=!1,v=function(p){var g=a[p],m=g.ctx,_=o&&g.createRepaintRects(e,r,c._width,c._height),y=i?g.__startIndex:g.__drawIndex,x=!i&&g.incremental&&Date.now,S=x&&Date.now(),T=g.zlevel===c._zlevelList[0]?c._backgroundColor:null;if(g.__startIndex===g.__endIndex)g.clear(!1,T,_);else if(y===g.__startIndex){var w=e[y];(!w.incremental||!w.notClear||i)&&g.clear(!1,T,_)}y===-1&&(console.error("For some unknown reason. drawIndex is -1"),y=g.__startIndex);var b,A=function(R){var P={inHover:!1,allClipped:!1,prevEl:null,viewWidth:n._width,viewHeight:n._height};for(b=y;b<g.__endIndex;b++){var I=e[b];if(I.__inHover&&(h=!0),n._doPaintEl(I,g,o,R,P,b===g.__endIndex-1),x){var N=Date.now()-S;if(N>15)break}}P.prevElClipPaths&&m.restore()};if(_)if(_.length===0)b=g.__endIndex;else for(var M=c.dpr,E=0;E<_.length;++E){var D=_[E];m.save(),m.beginPath(),m.rect(D.x*M,D.y*M,D.width*M,D.height*M),m.clip(),A(D),m.restore()}else m.save(),A(),m.restore();g.__drawIndex=b,g.__drawIndex<g.__endIndex&&(f=!1)},c=this,d=0;d<a.length;d++)v(d);return vt.wxa&&C(this._layers,function(p){p&&p.ctx&&p.ctx.draw&&p.ctx.draw()}),{finished:f,needsRefreshHover:h}},t.prototype._doPaintEl=function(e,r,i,n,a,o){var s=r.ctx;if(i){var l=e.getPaintRect();(!n||l&&l.intersect(n))&&(kn(s,e,a,o),e.setPrevPaintRect(l))}else kn(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Sn);var i=this._layers[e];return i||(i=new xc("zr_"+e,this,this.dpr),i.zlevel=e,i.__builtin__=!0,this._layerConfig[e]?dt(i,this._layerConfig[e],!0):this._layerConfig[e-Fl]&&dt(i,this._layerConfig[e-Fl],!0),r&&(i.virtual=r),this.insertLayer(e,i),i.initContext()),i},t.prototype.insertLayer=function(e,r){var i=this._layers,n=this._zlevelList,a=n.length,o=this._domRoot,s=null,l=-1;if(!i[e]&&CN(r)){if(a>0&&e>n[0]){for(l=0;l<a-1&&!(n[l]<e&&n[l+1]>e);l++);s=i[n[l]]}if(n.splice(l+1,0,e),i[e]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},t.prototype.eachLayer=function(e,r){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n];e.call(r,this._layers[a],a)}},t.prototype.eachBuiltinLayer=function(e,r){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n],o=this._layers[a];o.__builtin__&&e.call(r,o,a)}},t.prototype.eachOtherLayer=function(e,r){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n],o=this._layers[a];o.__builtin__||e.call(r,o,a)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(h,v){h.__dirty=h.__used=!1});function r(h){a&&(a.__endIndex!==h&&(a.__dirty=!0),a.__endIndex=h)}if(this._singleCanvas)for(var i=1;i<e.length;i++){var n=e[i];if(n.zlevel!==e[i-1].zlevel||n.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var n=e[l],u=n.zlevel,f=void 0;s!==u&&(s=u,o=0),n.incremental?(f=this.getLayer(u+MN,this._needsManuallyCompositing),f.incremental=!0,o=1):f=this.getLayer(u+(o>0?Fl:0),this._needsManuallyCompositing),f.__builtin__||Ld("ZLevel "+u+" has been used by unkown layer "+f.id),f!==a&&(f.__used=!0,f.__startIndex!==l&&(f.__dirty=!0),f.__startIndex=l,f.incremental?f.__drawIndex=-1:f.__drawIndex=l,r(l),a=f),n.__dirty&er&&!n.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(h,v){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,C(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var i=this._layerConfig;i[e]?dt(i[e],r,!0):i[e]=r;for(var n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];if(a===e||a===e+Fl){var o=this._layers[a];dt(o,i[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,i=this._zlevelList,n=r[e];n&&(n.dom.parentNode.removeChild(n.dom),delete r[e],i.splice(bt(i,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var n=this._opts,a=this.root;if(e!=null&&(n.width=e),r!=null&&(n.height=r),e=Fa(a,0,n),r=Fa(a,1,n),i.style.display="",this._width!==e||r!==this._height){i.style.width=e+"px",i.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(Sn).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Sn].dom;var r=new xc("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var i=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var n=r.dom.width,a=r.dom.height;this.eachLayer(function(h){h.__builtin__?i.drawImage(h.dom,0,0,n,a):h.renderToCanvas&&(i.save(),h.renderToCanvas(i),i.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var f=s[l];kn(i,f,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();function cw(t){t.registerPainter("canvas",LN)}var RN=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,i,n){t.prototype.init.call(this,r,i,n),this._sourceManager=new RT(this),Qm(this)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),Qm(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Jr},e}(Rt),PN=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(ze);function vw(t){t.registerComponentModel(RN),t.registerComponentView(PN)}Qe([cw,vw]);Qe(HP);function T_(t,e,r){typeof e=="object"&&(r=e,e=null);var i=this,n;if(!(t instanceof Function)){n=[];for(var a in t)t.hasOwnProperty(a)&&n.push(a)}var o=function(l){if(i.apply(this,arguments),t instanceof Function?S_(this,t.call(this,l)):IN(this,t,n),this.constructor===o)for(var u=o.__initializers__,f=0;f<u.length;f++)u[f].apply(this,arguments)};o.__super__=i,i.__initializers__?o.__initializers__=i.__initializers__.slice():o.__initializers__=[],e&&o.__initializers__.push(e);var s=function(){};return s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o,S_(o.prototype,r),o.extend=i.extend,o.derive=i.extend,o}function S_(t,e){if(e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}function IN(t,e,r){for(var i=0;i<r.length;i++){var n=r[i];t[n]=e[n]}}const NN={extend:T_,derive:T_};function ON(t,e){this.action=t,this.context=e}var zp={trigger:function(t){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(t)){var e=this.__handlers__[t],r=e.length,i=-1,n=arguments;switch(n.length){case 1:for(;++i<r;)e[i].action.call(e[i].context);return;case 2:for(;++i<r;)e[i].action.call(e[i].context,n[1]);return;case 3:for(;++i<r;)e[i].action.call(e[i].context,n[1],n[2]);return;case 4:for(;++i<r;)e[i].action.call(e[i].context,n[1],n[2],n[3]);return;case 5:for(;++i<r;)e[i].action.call(e[i].context,n[1],n[2],n[3],n[4]);return;default:for(;++i<r;)e[i].action.apply(e[i].context,Array.prototype.slice.call(n,1));return}}},on:function(t,e,r){if(!(!t||!e)){var i=this.__handlers__||(this.__handlers__={});if(!i[t])i[t]=[];else if(this.has(t,e))return;var n=new ON(e,r||this);return i[t].push(n),this}},once:function(t,e,r){if(!t||!e)return;var i=this;function n(){i.off(t,n),e.apply(this,arguments)}return this.on(t,n,r)},before:function(t,e,r){if(!(!t||!e))return t="before"+t,this.on(t,e,r)},after:function(t,e,r){if(!(!t||!e))return t="after"+t,this.on(t,e,r)},success:function(t,e){return this.once("success",t,e)},error:function(t,e){return this.once("error",t,e)},off:function(t,e){var r=this.__handlers__||(this.__handlers__={});if(!e){r[t]=[];return}if(r[t]){for(var i=r[t],n=[],a=0;a<i.length;a++)e&&i[a].action!==e&&n.push(i[a]);r[t]=n}return this},has:function(t,e){var r=this.__handlers__;if(!r||!r[t])return!1;for(var i=r[t],n=0;n<i.length;n++)if(i[n].action===e)return!0}},BN=0,FN=Array.prototype,kN=FN.forEach,ne={genGUID:function(){return++BN},relative2absolute:function(t,e){if(!e||t.match(/^\//))return t;for(var r=t.split("/"),i=e.split("/"),n=r[0];n==="."||n==="..";)n===".."&&i.pop(),r.shift(),n=r[0];return i.join("/")+"/"+r.join("/")},extend:function(t,e){if(e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},defaults:function(t,e){if(e)for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t},extendWithPropList:function(t,e,r){if(e)for(var i=0;i<r.length;i++){var n=r[i];t[n]=e[n]}return t},defaultsWithPropList:function(t,e,r){if(e)for(var i=0;i<r.length;i++){var n=r[i];t[n]==null&&(t[n]=e[n])}return t},each:function(t,e,r){if(t&&e)if(t.forEach&&t.forEach===kN)t.forEach(e,r);else if(t.length===+t.length)for(var i=0,n=t.length;i<n;i++)e.call(r,t[i],i,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(r,t[a],a,t)},isObject:function(t){return t===Object(t)},isArray:function(t){return Array.isArray(t)},isArrayLike:function(t){return t?t.length===+t.length:!1},clone:function(t){if(ne.isObject(t)){if(ne.isArray(t))return t.slice();if(ne.isArrayLike(t)){for(var e=new t.constructor(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}else return ne.extend({},t)}else return t}},Se=function(){this.__uid__=ne.genGUID()};Se.__initializers__=[function(t){ne.extend(this,t)}];ne.extend(Se,NN);ne.extend(Se.prototype,zp);var w_=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB","ANGLE_instanced_arrays"],b_=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];function zN(t){for(var e={},r={},i=0;i<w_.length;i++){var n=w_[i];o(n)}for(var i=0;i<b_.length;i++){var a=b_[i];r[a]=t.getParameter(t[a])}this.getExtension=function(s){return s in e||o(s),e[s]},this.getParameter=function(s){return r[s]};function o(s){if(t.getExtension){var l=t.getExtension(s);l||(l=t.getExtension("MOZ_"+s)),l||(l=t.getExtension("WEBKIT_"+s)),e[s]=l}}}const F={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444};function UN(t){var e=new XMLHttpRequest;e.open("get",t.url),e.responseType=t.responseType||"text",t.onprogress&&(e.onprogress=function(r){if(r.lengthComputable){var i=r.loaded/r.total;t.onprogress(i,r.loaded,r.total)}else t.onprogress(null)}),e.onload=function(r){e.status>=400?t.onerror&&t.onerror():t.onload&&t.onload(e.response)},t.onerror&&(e.onerror=t.onerror),e.send(null)}const HN={get:UN};var Tc,Ct={};Ct.supportWebGL=function(){if(Tc==null)try{var t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)throw new Error}catch{Tc=!1}return Tc};Ct.Int8Array=typeof Int8Array>"u"?Array:Int8Array;Ct.Uint8Array=typeof Uint8Array>"u"?Array:Uint8Array;Ct.Uint16Array=typeof Uint16Array>"u"?Array:Uint16Array;Ct.Uint32Array=typeof Uint32Array>"u"?Array:Uint32Array;Ct.Int16Array=typeof Int16Array>"u"?Array:Int16Array;Ct.Float32Array=typeof Float32Array>"u"?Array:Float32Array;Ct.Float64Array=typeof Float64Array>"u"?Array:Float64Array;var Un={};typeof window<"u"?Un=window:typeof global<"u"&&(Un=global);Ct.requestAnimationFrame=Un.requestAnimationFrame||Un.msRequestAnimationFrame||Un.mozRequestAnimationFrame||Un.webkitRequestAnimationFrame||function(t){setTimeout(t,16)};Ct.createCanvas=function(){return document.createElement("canvas")};Ct.createImage=function(){return new Un.Image};Ct.request={get:HN.get};Ct.addEventListener=function(t,e,r,i){t.addEventListener(e,r,i)};Ct.removeEventListener=function(t,e,r){t.removeEventListener(e,r)};var pe=function(){this.head=null,this.tail=null,this._length=0};pe.prototype.insert=function(t){var e=new pe.Entry(t);return this.insertEntry(e),e};pe.prototype.insertAt=function(t,e){if(!(t<0)){for(var r=this.head,i=0;r&&i!=t;)r=r.next,i++;if(r){var n=new pe.Entry(e),a=r.prev;a?(a.next=n,n.prev=a):this.head=n,n.next=r,r.prev=n}else this.insert(e)}};pe.prototype.insertBeforeEntry=function(t,e){var r=new pe.Entry(t),i=e.prev;i?(i.next=r,r.prev=i):this.head=r,r.next=e,e.prev=r,this._length++};pe.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this._length++};pe.prototype.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._length--};pe.prototype.removeAt=function(t){if(!(t<0)){for(var e=this.head,r=0;e&&r!=t;)e=e.next,r++;if(e)return this.remove(e),e.value}};pe.prototype.getHead=function(){if(this.head)return this.head.value};pe.prototype.getTail=function(){if(this.tail)return this.tail.value};pe.prototype.getAt=function(t){if(!(t<0)){for(var e=this.head,r=0;e&&r!=t;)e=e.next,r++;return e.value}};pe.prototype.indexOf=function(t){for(var e=this.head,r=0;e;){if(e.value===t)return r;e=e.next,r++}};pe.prototype.length=function(){return this._length};pe.prototype.isEmpty=function(){return this._length===0};pe.prototype.forEach=function(t,e){for(var r=this.head,i=0,n=typeof e<"u";r;)n?t.call(e,r.value,i):t(r.value,i),r=r.next,i++};pe.prototype.clear=function(){this.tail=this.head=null,this._length=0};pe.Entry=function(t){this.value=t,this.next=null,this.prev=null};var ra=function(t){this._list=new pe,this._map={},this._maxSize=t||10};ra.prototype.setMaxSize=function(t){this._maxSize=t};ra.prototype.put=function(t,e){if(!this._map.hasOwnProperty(t)){var r=this._list.length();if(r>=this._maxSize&&r>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var n=this._list.insert(e);n.key=t,this._map[t]=n}};ra.prototype.get=function(t){var e=this._map[t];if(this._map.hasOwnProperty(t))return e!==this._list.tail&&(this._list.remove(e),this._list.insertEntry(e)),e.value};ra.prototype.remove=function(t){var e=this._map[t];typeof e<"u"&&(delete this._map[t],this._list.remove(e))};ra.prototype.clear=function(){this._list.clear(),this._map={}};var qt={},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 Or(t){return t=Math.round(t),t<0?0:t>255?255:t}function VN(t){return t=Math.round(t),t<0?0:t>360?360:t}function Is(t){return t<0?0:t>1?1:t}function Sc(t){return t.length&&t.charAt(t.length-1)==="%"?Or(parseFloat(t)/100*255):Or(parseInt(t,10))}function eo(t){return t.length&&t.charAt(t.length-1)==="%"?Is(parseFloat(t)/100):Is(parseFloat(t))}function wc(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(2/3-r)*6:t}function Hi(t,e,r){return t+(e-t)*r}function Dr(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function sd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var dw=new ra(20),kl=null;function ma(t,e){kl&&sd(kl,e),kl=dw.put(t,kl||e.slice())}qt.parse=function(t,e){if(t){e=e||[];var r=dw.get(t);if(r)return sd(e,r);t=t+"";var i=t.replace(/ /g,"").toLowerCase();if(i in A_)return sd(e,A_[i]),ma(t,e),e;if(i.charAt(0)==="#"){if(i.length===4){var n=parseInt(i.substr(1),16);if(!(n>=0&&n<=4095)){Dr(e,0,0,0,1);return}return Dr(e,(n&3840)>>4|(n&3840)>>8,n&240|(n&240)>>4,n&15|(n&15)<<4,1),ma(t,e),e}else if(i.length===7){var n=parseInt(i.substr(1),16);if(!(n>=0&&n<=16777215)){Dr(e,0,0,0,1);return}return Dr(e,(n&16711680)>>16,(n&65280)>>8,n&255,1),ma(t,e),e}return}var a=i.indexOf("("),o=i.indexOf(")");if(a!==-1&&o+1===i.length){var s=i.substr(0,a),l=i.substr(a+1,o-(a+1)).split(","),u=1;switch(s){case"rgba":if(l.length!==4){Dr(e,0,0,0,1);return}u=eo(l.pop());case"rgb":if(l.length!==3){Dr(e,0,0,0,1);return}return Dr(e,Sc(l[0]),Sc(l[1]),Sc(l[2]),u),ma(t,e),e;case"hsla":if(l.length!==4){Dr(e,0,0,0,1);return}return l[3]=eo(l[3]),ld(l,e),ma(t,e),e;case"hsl":if(l.length!==3){Dr(e,0,0,0,1);return}return ld(l,e),ma(t,e),e;default:return}}Dr(e,0,0,0,1)}};qt.parseToFloat=function(t,e){if(e=qt.parse(t,e),!!e)return e[0]/=255,e[1]/=255,e[2]/=255,e};function ld(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=eo(t[1]),n=eo(t[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],Dr(e,Or(wc(o,a,r+1/3)*255),Or(wc(o,a,r)*255),Or(wc(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function GN(t){if(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),a=Math.max(e,r,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var f=((a-e)/6+o/2)/o,h=((a-r)/6+o/2)/o,v=((a-i)/6+o/2)/o;e===a?l=v-h:r===a?l=1/3+f-v:i===a&&(l=2/3+h-f),l<0&&(l+=1),l>1&&(l-=1)}var c=[l*360,u,s];return t[3]!=null&&c.push(t[3]),c}}qt.lift=function(t,e){var r=qt.parse(t);if(r){for(var i=0;i<3;i++)e<0?r[i]=r[i]*(1-e)|0:r[i]=(255-r[i])*e+r[i]|0;return qt.stringify(r,r.length===4?"rgba":"rgb")}};qt.toHex=function(t){var e=qt.parse(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)};qt.fastLerp=function(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){r=r||[];var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=e[n],s=e[a],l=i-n;return r[0]=Or(Hi(o[0],s[0],l)),r[1]=Or(Hi(o[1],s[1],l)),r[2]=Or(Hi(o[2],s[2],l)),r[3]=Is(Hi(o[3],s[3],l)),r}};qt.fastMapToColor=qt.fastLerp;qt.lerp=function(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=qt.parse(e[n]),s=qt.parse(e[a]),l=i-n,u=qt.stringify([Or(Hi(o[0],s[0],l)),Or(Hi(o[1],s[1],l)),Or(Hi(o[2],s[2],l)),Is(Hi(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:n,rightIndex:a,value:i}:u}};qt.mapToColor=qt.lerp;qt.modifyHSL=function(t,e,r,i){if(t=qt.parse(t),t)return t=GN(t),e!=null&&(t[0]=VN(e)),r!=null&&(t[1]=eo(r)),i!=null&&(t[2]=eo(i)),qt.stringify(ld(t),"rgba")};qt.modifyAlpha=function(t,e){if(t=qt.parse(t),t&&e!=null)return t[3]=Is(e),qt.stringify(t,"rgba")};qt.stringify=function(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}};var WN=qt.parseToFloat,bc={};function E_(t){var e=Object.keys(t);e.sort();for(var r=[],i=0;i<e.length;i++){var n=e[i],a=t[n];a===null?r.push(n):r.push(n+" "+a.toString())}return r.join(`
`)}function XN(t,e,r){r.sort();for(var i=[],n=0;n<r.length;n++){var a=r[n];i.push(a)}var o=E_(t)+`
`+E_(e)+`
`+i.join(`
`);if(bc[o])return bc[o];var s=ne.genGUID();return bc[o]=s,s}var Si=Se.extend(function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}},function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)},{precision:"highp",setUniform:function(t,e){e===void 0&&console.warn('Uniform value "'+t+'" is undefined');var r=this.uniforms[t];r&&(typeof e=="string"&&(e=WN(e)||e),r.value=e,this.autoUpdateTextureStatus&&r.type==="t"&&(e?this.enableTexture(t):this.disableTexture(t)))},setUniforms:function(t){for(var e in t){var r=t[e];this.setUniform(e,r)}},isUniformEnabled:function(t){return this._enabledUniforms.indexOf(t)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(t,e){if(typeof t=="object")for(var r in t){var i=t[r];this.setUniform(r,i)}else this.setUniform(t,e)},get:function(t){var e=this.uniforms[t];if(e)return e.value},attachShader:function(t,e){var r=this.uniforms;this.uniforms=t.createUniforms(),this.shader=t;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter(function(u){var f=this.uniforms[u].type;return f==="t"||f==="tv"},this);var n=this.vertexDefines,a=this.fragmentDefines;if(this.vertexDefines=ne.clone(t.vertexDefines),this.fragmentDefines=ne.clone(t.fragmentDefines),e){for(var o in r)i[o]&&(i[o].value=r[o].value);ne.defaults(this.vertexDefines,n),ne.defaults(this.fragmentDefines,a)}var s={};for(var l in t.textures)s[l]={shaderType:t.textures[l].shaderType,type:t.textures[l].type,enabled:e&&this._textureStatus[l]?this._textureStatus[l].enabled:!1};this._textureStatus=s,this._programKey=""},clone:function(){var t=new this.constructor({name:this.name,shader:this.shader});for(var e in this.uniforms)t.uniforms[e].value=this.uniforms[e].value;return t.depthTest=this.depthTest,t.depthMask=this.depthMask,t.transparent=this.transparent,t.blend=this.blend,t.vertexDefines=ne.clone(this.vertexDefines),t.fragmentDefines=ne.clone(this.fragmentDefines),t.enableTexture(this.getEnabledTextures()),t.precision=this.precision,t},define:function(t,e,r){var i=this.vertexDefines,n=this.fragmentDefines;t!=="vertex"&&t!=="fragment"&&t!=="both"&&arguments.length<3&&(r=e,e=t,t="both"),r=r??null,(t==="vertex"||t==="both")&&i[e]!==r&&(i[e]=r,this._programKey=""),(t==="fragment"||t==="both")&&n[e]!==r&&(n[e]=r,t!=="both"&&(this._programKey=""))},undefine:function(t,e){t!=="vertex"&&t!=="fragment"&&t!=="both"&&arguments.length<2&&(e=t,t="both"),(t==="vertex"||t==="both")&&this.isDefined("vertex",e)&&(delete this.vertexDefines[e],this._programKey=""),(t==="fragment"||t==="both")&&this.isDefined("fragment",e)&&(delete this.fragmentDefines[e],t!=="both"&&(this._programKey=""))},isDefined:function(t,e){switch(t){case"vertex":return this.vertexDefines[e]!==void 0;case"fragment":return this.fragmentDefines[e]!==void 0}},getDefine:function(t,e){switch(t){case"vertex":return this.vertexDefines[e];case"fragment":return this.fragmentDefines[e]}},enableTexture:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)this.enableTexture(t[e]);return}var r=this._textureStatus[t];if(r){var i=r.enabled;i||(r.enabled=!0,this._programKey="")}},enableTexturesAll:function(){var t=this._textureStatus;for(var e in t)t[e].enabled=!0;this._programKey=""},disableTexture:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)this.disableTexture(t[e]);return}var r=this._textureStatus[t];if(r){var i=!r.enabled;i||(r.enabled=!1,this._programKey="")}},disableTexturesAll:function(){var t=this._textureStatus;for(var e in t)t[e].enabled=!1;this._programKey=""},isTextureEnabled:function(t){var e=this._textureStatus;return!!e[t]&&e[t].enabled},getEnabledTextures:function(){var t=[],e=this._textureStatus;for(var r in e)e[r].enabled&&t.push(r);return t},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=XN(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}}),du=1e-6,xe=Array,Ua=Math.random,H={};H.create=function(){var t=new xe(2);return t[0]=0,t[1]=0,t};H.clone=function(t){var e=new xe(2);return e[0]=t[0],e[1]=t[1],e};H.fromValues=function(t,e){var r=new xe(2);return r[0]=t,r[1]=e,r};H.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t};H.set=function(t,e,r){return t[0]=e,t[1]=r,t};H.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t};H.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t};H.sub=H.subtract;H.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t};H.mul=H.multiply;H.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t};H.div=H.divide;H.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t};H.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t};H.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t};H.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t};H.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(r*r+i*i)};H.dist=H.distance;H.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1];return r*r+i*i};H.sqrDist=H.squaredDistance;H.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)};H.len=H.length;H.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r};H.sqrLen=H.squaredLength;H.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t};H.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t};H.normalize=function(t,e){var r=e[0],i=e[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t};H.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]};H.cross=function(t,e,r){var i=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=i,t};H.lerp=function(t,e,r,i){var n=e[0],a=e[1];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t};H.random=function(t,e){e=e||1;var r=GLMAT_RANDOM()*2*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t};H.transformMat2=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n,t[1]=r[1]*i+r[3]*n,t};H.transformMat2d=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t};H.transformMat3=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[3]*n+r[6],t[1]=r[1]*i+r[4]*n+r[7],t};H.transformMat4=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t};H.forEach=function(){var t=H.create();return function(e,r,i,n,a,o){var s,l;for(r||(r=2),i||(i=0),n?l=Math.min(n*r+i,e.length):l=e.length,s=i;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],a(t,t,o),e[s]=t[0],e[s+1]=t[1];return e}}();var st=function(t,e){t=t||0,e=e||0,this.array=H.fromValues(t,e),this._dirty=!0};st.prototype={constructor:st,add:function(t){return H.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e){return this.array[0]=t,this.array[1]=e,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this._dirty=!0,this},clone:function(){return new st(this.x,this.y)},copy:function(t){return H.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return H.cross(t.array,this.array,e.array),t._dirty=!0,this},dist:function(t){return H.dist(this.array,t.array)},distance:function(t){return H.distance(this.array,t.array)},div:function(t){return H.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return H.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return H.dot(this.array,t.array)},len:function(){return H.len(this.array)},length:function(){return H.length(this.array)},lerp:function(t,e,r){return H.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},min:function(t){return H.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return H.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return H.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return H.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return H.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return H.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return H.random(this.array,t),this._dirty=!0,this},scale:function(t){return H.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return H.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return H.sqrDist(this.array,t.array)},squaredDistance:function(t){return H.squaredDistance(this.array,t.array)},sqrLen:function(){return H.sqrLen(this.array)},squaredLength:function(){return H.squaredLength(this.array)},sub:function(t){return H.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return H.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat2:function(t){return H.transformMat2(this.array,this.array,t.array),this._dirty=!0,this},transformMat2d:function(t){return H.transformMat2d(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return H.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return H.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};if(Object.defineProperty){var M_=st.prototype;Object.defineProperty(M_,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Object.defineProperty(M_,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}})}st.add=function(t,e,r){return H.add(t.array,e.array,r.array),t._dirty=!0,t};st.set=function(t,e,r){return H.set(t.array,e,r),t._dirty=!0,t};st.copy=function(t,e){return H.copy(t.array,e.array),t._dirty=!0,t};st.cross=function(t,e,r){return H.cross(t.array,e.array,r.array),t._dirty=!0,t};st.dist=function(t,e){return H.distance(t.array,e.array)};st.distance=st.dist;st.div=function(t,e,r){return H.divide(t.array,e.array,r.array),t._dirty=!0,t};st.divide=st.div;st.dot=function(t,e){return H.dot(t.array,e.array)};st.len=function(t){return H.length(t.array)};st.lerp=function(t,e,r,i){return H.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};st.min=function(t,e,r){return H.min(t.array,e.array,r.array),t._dirty=!0,t};st.max=function(t,e,r){return H.max(t.array,e.array,r.array),t._dirty=!0,t};st.mul=function(t,e,r){return H.multiply(t.array,e.array,r.array),t._dirty=!0,t};st.multiply=st.mul;st.negate=function(t,e){return H.negate(t.array,e.array),t._dirty=!0,t};st.normalize=function(t,e){return H.normalize(t.array,e.array),t._dirty=!0,t};st.random=function(t,e){return H.random(t.array,e),t._dirty=!0,t};st.scale=function(t,e,r){return H.scale(t.array,e.array,r),t._dirty=!0,t};st.scaleAndAdd=function(t,e,r,i){return H.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};st.sqrDist=function(t,e){return H.sqrDist(t.array,e.array)};st.squaredDistance=st.sqrDist;st.sqrLen=function(t){return H.sqrLen(t.array)};st.squaredLength=st.sqrLen;st.sub=function(t,e,r){return H.subtract(t.array,e.array,r.array),t._dirty=!0,t};st.subtract=st.sub;st.transformMat2=function(t,e,r){return H.transformMat2(t.array,e.array,r.array),t._dirty=!0,t};st.transformMat2d=function(t,e,r){return H.transformMat2d(t.array,e.array,r.array),t._dirty=!0,t};st.transformMat3=function(t,e,r){return H.transformMat3(t.array,e.array,r.array),t._dirty=!0,t};st.transformMat4=function(t,e,r){return H.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};var C_=1,D_=2,Ac=3,L_={};function YN(t){for(var e=t.split(`
`),r=0,i=e.length;r<i;r++)e[r]=r+1+": "+e[r];return e.join(`
`)}function R_(t,e,r){if(!t.getShaderParameter(e,t.COMPILE_STATUS))return[t.getShaderInfoLog(e),YN(r)].join(`
`)}var P_=new Ct.Float32Array(16),ZN=Se.extend({uniformSemantics:{},attributes:{}},function(){this._locations={},this._textureSlot=0,this._program=null},{bind:function(t){this._textureSlot=0,t.gl.useProgram(this._program)},hasUniform:function(t){var e=this._locations[t];return e!=null},useTextureSlot:function(t,e,r){e&&(t.gl.activeTexture(t.gl.TEXTURE0+r),e.isRenderable()?e.bind(t):e.unbind(t))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(t){this._textureSlot=t||0},takeCurrentTextureSlot:function(t,e){var r=this._textureSlot;return this.useTextureSlot(t,e,r),this._textureSlot++,r},setUniform:function(t,e,r,i){var n=this._locations,a=n[r];if(a==null)return!1;switch(e){case"m4":if(!(i instanceof Float32Array)){for(var o=0;o<i.length;o++)P_[o]=i[o];i=P_}t.uniformMatrix4fv(a,!1,i);break;case"2i":t.uniform2i(a,i[0],i[1]);break;case"2f":t.uniform2f(a,i[0],i[1]);break;case"3i":t.uniform3i(a,i[0],i[1],i[2]);break;case"3f":t.uniform3f(a,i[0],i[1],i[2]);break;case"4i":t.uniform4i(a,i[0],i[1],i[2],i[3]);break;case"4f":t.uniform4f(a,i[0],i[1],i[2],i[3]);break;case"1i":t.uniform1i(a,i);break;case"1f":t.uniform1f(a,i);break;case"1fv":t.uniform1fv(a,i);break;case"1iv":t.uniform1iv(a,i);break;case"2iv":t.uniform2iv(a,i);break;case"2fv":t.uniform2fv(a,i);break;case"3iv":t.uniform3iv(a,i);break;case"3fv":t.uniform3fv(a,i);break;case"4iv":t.uniform4iv(a,i);break;case"4fv":t.uniform4fv(a,i);break;case"m2":case"m2v":t.uniformMatrix2fv(a,!1,i);break;case"m3":case"m3v":t.uniformMatrix3fv(a,!1,i);break;case"m4v":if(Array.isArray(i)&&Array.isArray(i[0])){for(var s=new Ct.Float32Array(i.length*16),l=0,o=0;o<i.length;o++)for(var u=i[o],f=0;f<16;f++)s[l++]=u[f];t.uniformMatrix4fv(a,!1,s)}else t.uniformMatrix4fv(a,!1,i);break}return!0},setUniformOfSemantic:function(t,e,r){var i=this.uniformSemantics[e];return i?this.setUniform(t,i.type,i.symbol,r):!1},enableAttributes:function(t,e,r){var i=t.gl,n=this._program,a=this._locations,o;r?o=r.__enabledAttributeList:o=L_[t.__uid__],o||(r?o=r.__enabledAttributeList=[]:o=L_[t.__uid__]=[]);for(var s=[],l=0;l<e.length;l++){var u=e[l];if(!this.attributes[u]){s[l]=-1;continue}var f=a[u];if(f==null){if(f=i.getAttribLocation(n,u),f===-1){s[l]=-1;continue}a[u]=f}s[l]=f,o[f]?o[f]=D_:o[f]=C_}for(var l=0;l<o.length;l++)switch(o[l]){case C_:i.enableVertexAttribArray(l),o[l]=Ac;break;case D_:o[l]=Ac;break;case Ac:i.disableVertexAttribArray(l),o[l]=0;break}return s},getAttribLocation:function(t,e){var r=this._locations,i=r[e];return i==null&&(i=t.getAttribLocation(this._program,e),r[e]=i),i},buildProgram:function(t,e,r,i){var n=t.createShader(t.VERTEX_SHADER),a=t.createProgram();t.shaderSource(n,r),t.compileShader(n);var o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,i),t.compileShader(o);var s=R_(t,n,r);if(s||(s=R_(t,o,i),s))return s;if(t.attachShader(a,n),t.attachShader(a,o),e.attributeSemantics.POSITION)t.bindAttribLocation(a,0,e.attributeSemantics.POSITION.symbol);else{var l=Object.keys(this.attributes);t.bindAttribLocation(a,0,l[0])}if(t.linkProgram(a),t.deleteShader(n),t.deleteShader(o),this._program=a,this.vertexCode=r,this.fragmentCode=i,!t.getProgramParameter(a,t.LINK_STATUS))return`Could not link program
`+t.getProgramInfoLog(a);for(var u=0;u<e.uniforms.length;u++){var f=e.uniforms[u];this._locations[f]=t.getUniformLocation(a,f)}}}),qN=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function I_(t,e,r){function i(o,s,l,u){var f="";isNaN(s)&&(s in e?s=e[s]:s=n[s]),isNaN(l)&&(l in e?l=e[l]:l=n[l]);for(var h=parseInt(s);h<parseInt(l);h++)f+="{"+u.replace(/float\s*\(\s*_idx_\s*\)/g,h.toFixed(1)).replace(/_idx_/g,h)+"}";return f}var n={};for(var a in r)n[a+"_COUNT"]=r[a];return t.replace(qN,i)}function Ec(t,e,r){var i=[];if(e)for(var n in e){var a=e[n];a>0&&i.push("#define "+n.toUpperCase()+"_COUNT "+a)}if(r)for(var o=0;o<r.length;o++){var s=r[o];i.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in t){var l=t[s];l===null?i.push("#define "+s):i.push("#define "+s+" "+l.toString())}return i.join(`
`)}function $N(t){for(var e=[],r=0;r<t.length;r++)e.push("#extension GL_"+t[r]+" : enable");return e.join(`
`)}function KN(t){return["precision",t,"float"].join(" ")+`;
`+["precision",t,"int"].join(" ")+`;
`+["precision",t,"sampler2D"].join(" ")+`;
`}function pw(t){this._renderer=t,this._cache={}}pw.prototype.getProgram=function(t,e,r){var i=this._cache,n=t.isSkinnedMesh&&t.isSkinnedMesh(),a=t.isInstancedMesh&&t.isInstancedMesh(),o="s"+e.shader.shaderID+"m"+e.getProgramKey();r&&(o+="se"+r.getProgramKey(t.lightGroup)),n&&(o+=",sk"+t.joints.length),a&&(o+=",is");var x=i[o];if(x)return x;var s=r?r.getLightsNumbers(t.lightGroup):{},l=this._renderer,u=l.gl,f=e.getEnabledTextures(),h="";if(n){var v={SKINNING:null,JOINT_COUNT:t.joints.length};t.joints.length>l.getMaxJointNumber()&&(v.USE_SKIN_MATRICES_TEXTURE=null),h+=`
`+Ec(v)+`
`}a&&(h+=`
#define INSTANCING
`);var c=h+Ec(e.vertexDefines,s,f),d=h+Ec(e.fragmentDefines,s,f),p=c+`
`+e.shader.vertex,g=["OES_standard_derivatives","EXT_shader_texture_lod"].filter(function(T){return l.getGLExtension(T)!=null});g.indexOf("EXT_shader_texture_lod")>=0&&(d+=`
#define SUPPORT_TEXTURE_LOD`),g.indexOf("OES_standard_derivatives")>=0&&(d+=`
#define SUPPORT_STANDARD_DERIVATIVES`);var m=$N(g)+`
`+KN(e.precision)+`
`+d+`
`+e.shader.fragment,_=I_(p,e.vertexDefines,s),y=I_(m,e.fragmentDefines,s),x=new ZN;x.uniformSemantics=e.shader.uniformSemantics,x.attributes=e.shader.attributes;var S=x.buildProgram(u,e.shader,_,y);return x.__error=S,i[o]=x,x};var N_=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,jN=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,O_=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,QN={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 ui(t){for(var e=[],r=0;r<t;r++)e[r]=0;return e}var B_={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return ui(2)},vec3:function(){return ui(3)},vec4:function(){return ui(4)},ivec2:function(){return ui(2)},ivec3:function(){return ui(3)},ivec4:function(){return ui(4)},mat2:function(){return ui(4)},mat3:function(){return ui(9)},mat4:function(){return ui(16)},array:function(){return[]}},ud=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],gw=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],mw=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],JN={vec4:4,vec3:3,vec2:2,float:1},Mc={},_w={};function tO(t,e){var r="vertex:"+t+"fragment:"+e;if(Mc[r])return Mc[r];var i=ne.genGUID();return Mc[r]=i,_w[i]={vertex:t,fragment:e},i}function F_(t){return t.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function _a(){console.error("Wrong uniform/attributes syntax")}function k_(t,e){for(var r=/[,=\(\):]/,i=e.replace(/:\s*\[\s*(.*)\s*\]/g,"="+t+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),n=[],a=0;a<i.length;a++)i[a].match(r)?n.push(i[a].charAt(0),i[a].slice(1)):n.push(i[a]);i=n;var o=0,s=1,l=2,u=3,f=4,h=5,v=o,c={},d=null,p;g(i[0]);function g(y){y||_a();var x=y.match(/\[(.*?)\]/);p=y.replace(/\[(.*?)\]/,""),c[p]={},x&&(c[p].isArray=!0,c[p].arraySize=x[1])}for(var a=1;a<i.length;a++){var m=i[a];if(m){if(m==="="){if(v!==o&&v!==u){_a();break}v=s;continue}else if(m===":"){v=f;continue}else if(m===","){if(v===l){if(!(d instanceof Array)){_a();break}d.push(+i[++a])}else v=h;continue}else if(m===")"){c[p].value=new Ct.Float32Array(d),d=null,v=h;continue}else if(m==="("){if(v!==l){_a();break}if(!(d instanceof Array)){_a();break}d.push(+i[++a]);continue}else if(m.indexOf("vec")>=0){if(v!==s&&v!==f){_a();break}v=l,d=[];continue}else if(v===s){t==="bool"?c[p].value=m==="true":c[p].value=parseFloat(m),d=null;continue}else if(v===f){var _=m;ud.indexOf(_)>=0||gw.indexOf(_)>=0||mw.indexOf(_)>=0?c[p].semantic=_:_==="ignore"||_==="unconfigurable"?c[p].ignore=!0:t==="bool"?c[p].value=_==="true":c[p].value=parseFloat(_);continue}g(m),v=o}}return c}function $(t,e){typeof t=="object"&&(e=t.fragment,t=t.vertex),t=F_(t),e=F_(e),this._shaderID=tO(t,e),this._vertexCode=$.parseImport(t),this._fragmentCode=$.parseImport(e),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}$.prototype={constructor:$,createUniforms:function(){var t={};for(var e in this.uniformTemplates){var r=this.uniformTemplates[e];t[e]={type:r.type,value:r.value()}}return t},_parseImport:function(){this._vertexCode=$.parseImport(this.vertex),this._fragmentCode=$.parseImport(this.fragment)},_addSemanticUniform:function(t,e,r){if(ud.indexOf(r)>=0)this.attributeSemantics[r]={symbol:t,type:e};else if(mw.indexOf(r)>=0){var i=!1,n=r;r.match(/TRANSPOSE$/)&&(i=!0,n=r.slice(0,-9)),this.matrixSemantics[r]={symbol:t,type:e,isTranspose:i,semanticNoTranspose:n}}else gw.indexOf(r)>=0&&(this.uniformSemantics[r]={symbol:t,type:e})},_addMaterialUniform:function(t,e,r,i,n,a){a[t]={type:r,value:n?B_.array:i||B_[e],semantic:null}},_parseUniforms:function(){var t={},e=this,r="vertex";this._uniformList=[],this._vertexCode=this._vertexCode.replace(N_,n),r="fragment",this._fragmentCode=this._fragmentCode.replace(N_,n),e.matrixSemanticKeys=Object.keys(this.matrixSemantics);function i(a){return a!=null?function(){return a}:null}function n(a,o,s){var l=k_(o,s),u=[];for(var f in l){var h=l[f],v=h.semantic,c=f,d=QN[o],p=i(l[f].value);l[f].isArray&&(c+="["+l[f].arraySize+"]",d+="v"),u.push(c),e._uniformList.push(f),h.ignore||((o==="sampler2D"||o==="samplerCube")&&(e.textures[f]={shaderType:r,type:o}),v?e._addSemanticUniform(f,d,v):e._addMaterialUniform(f,o,d,p,l[f].isArray,t))}return u.length>0?"uniform "+o+" "+u.join(",")+`;
`:""}this.uniformTemplates=t},_parseAttributes:function(){var t={},e=this;this._vertexCode=this._vertexCode.replace(jN,r);function r(i,n,a){var o=k_(n,a),s=JN[n]||1,l=[];for(var u in o){var f=o[u].semantic;if(t[u]={type:"float",size:s,semantic:f||null},f){if(ud.indexOf(f)<0)throw new Error('Unkown semantic "'+f+'"');e.attributeSemantics[f]={symbol:u,type:n}}l.push(u)}return"attribute "+n+" "+l.join(",")+`;
`}this.attributes=t},_parseDefines:function(){var t=this,e="vertex";this._vertexCode=this._vertexCode.replace(O_,r),e="fragment",this._fragmentCode=this._fragmentCode.replace(O_,r);function r(i,n,a){var o=e==="vertex"?t.vertexDefines:t.fragmentDefines;return o[n]||(a==="false"?o[n]=!1:a==="true"?o[n]=!0:o[n]=a?isNaN(parseFloat(a))?a.trim():parseFloat(a):null),""}},clone:function(){var t=_w[this._shaderID],e=new $(t.vertex,t.fragment);return e}};Object.defineProperty&&(Object.defineProperty($.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty($.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty($.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty($.prototype,"uniforms",{get:function(){return this._uniformList}}));var eO=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;$.parseImport=function(t){return t=t.replace(eO,function(n,r,i){var n=$.source(i);return n?$.parseImport(n):(console.error('Shader chunk "'+i+'" not existed in library'),"")}),t};var rO=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;$.import=function(t){t.replace(rO,function(e,r,i,a){var a=a.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"");if(a){for(var o=i.split("."),s=$.codes,l=0,u;l<o.length-1;)u=o[l++],s[u]||(s[u]={}),s=s[u];u=o[l],s[u]=a}return a})};$.codes={};$.source=function(t){for(var e=t.split("."),r=$.codes,i=0;r&&i<e.length;){var n=e[i++];r=r[n]}return typeof r!="string"?(console.error('Shader "'+t+'" not existed in library'),""):r};const yw=`@export clay.prez.vertex
uniform mat4 WVP : WORLDVIEWPROJECTION;
attribute vec3 pos : POSITION;
attribute vec2 uv : TEXCOORD_0;
uniform vec2 uvRepeat : [1.0, 1.0];
uniform vec2 uvOffset : [0.0, 0.0];
@import clay.chunk.skinning_header
@import clay.chunk.instancing_header
varying vec2 v_Texcoord;
void main()
{
vec4 P = vec4(pos, 1.0);
#ifdef SKINNING
@import clay.chunk.skin_matrix
P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
@import clay.chunk.instancing_matrix
P = instanceMat * P;
#endif
gl_Position = WVP * P;
v_Texcoord = uv * uvRepeat + uvOffset;
}
@end
@export clay.prez.fragment
uniform sampler2D alphaMap;
uniform float alphaCutoff: 0.0;
varying vec2 v_Texcoord;
void main()
{
if (alphaCutoff > 0.0) {
if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {
discard;
}
}
gl_FragColor = vec4(0.0,0.0,0.0,1.0);
}
@end`;var z={};z.create=function(){var t=new xe(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};z.clone=function(t){var e=new xe(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};z.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};z.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};z.transpose=function(t,e){if(t===e){var r=e[1],i=e[2],n=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[11]=e[14],t[12]=n,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t};z.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],h=e[9],v=e[10],c=e[11],d=e[12],p=e[13],g=e[14],m=e[15],_=r*s-i*o,y=r*l-n*o,x=r*u-a*o,S=i*l-n*s,T=i*u-a*s,w=n*u-a*l,b=f*p-h*d,A=f*g-v*d,M=f*m-c*d,E=h*g-v*p,D=h*m-c*p,R=v*m-c*g,P=_*R-y*D+x*E+S*M-T*A+w*b;return P?(P=1/P,t[0]=(s*R-l*D+u*E)*P,t[1]=(n*D-i*R-a*E)*P,t[2]=(p*w-g*T+m*S)*P,t[3]=(v*T-h*w-c*S)*P,t[4]=(l*M-o*R-u*A)*P,t[5]=(r*R-n*M+a*A)*P,t[6]=(g*x-d*w-m*y)*P,t[7]=(f*w-v*x+c*y)*P,t[8]=(o*D-s*M+u*b)*P,t[9]=(i*M-r*D-a*b)*P,t[10]=(d*T-p*x+m*_)*P,t[11]=(h*x-f*T-c*_)*P,t[12]=(s*A-o*E-l*b)*P,t[13]=(r*E-i*A+n*b)*P,t[14]=(p*y-d*S-g*_)*P,t[15]=(f*S-h*y+v*_)*P,t):null};z.adjoint=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],h=e[9],v=e[10],c=e[11],d=e[12],p=e[13],g=e[14],m=e[15];return t[0]=s*(v*m-c*g)-h*(l*m-u*g)+p*(l*c-u*v),t[1]=-(i*(v*m-c*g)-h*(n*m-a*g)+p*(n*c-a*v)),t[2]=i*(l*m-u*g)-s*(n*m-a*g)+p*(n*u-a*l),t[3]=-(i*(l*c-u*v)-s*(n*c-a*v)+h*(n*u-a*l)),t[4]=-(o*(v*m-c*g)-f*(l*m-u*g)+d*(l*c-u*v)),t[5]=r*(v*m-c*g)-f*(n*m-a*g)+d*(n*c-a*v),t[6]=-(r*(l*m-u*g)-o*(n*m-a*g)+d*(n*u-a*l)),t[7]=r*(l*c-u*v)-o*(n*c-a*v)+f*(n*u-a*l),t[8]=o*(h*m-c*p)-f*(s*m-u*p)+d*(s*c-u*h),t[9]=-(r*(h*m-c*p)-f*(i*m-a*p)+d*(i*c-a*h)),t[10]=r*(s*m-u*p)-o*(i*m-a*p)+d*(i*u-a*s),t[11]=-(r*(s*c-u*h)-o*(i*c-a*h)+f*(i*u-a*s)),t[12]=-(o*(h*g-v*p)-f*(s*g-l*p)+d*(s*v-l*h)),t[13]=r*(h*g-v*p)-f*(i*g-n*p)+d*(i*v-n*h),t[14]=-(r*(s*g-l*p)-o*(i*g-n*p)+d*(i*l-n*s)),t[15]=r*(s*v-l*h)-o*(i*v-n*h)+f*(i*l-n*s),t};z.determinant=function(t){var e=t[0],r=t[1],i=t[2],n=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],f=t[9],h=t[10],v=t[11],c=t[12],d=t[13],p=t[14],g=t[15],m=e*o-r*a,_=e*s-i*a,y=e*l-n*a,x=r*s-i*o,S=r*l-n*o,T=i*l-n*s,w=u*d-f*c,b=u*p-h*c,A=u*g-v*c,M=f*p-h*d,E=f*g-v*d,D=h*g-v*p;return m*D-_*E+y*M+x*A-S*b+T*w};z.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],h=e[8],v=e[9],c=e[10],d=e[11],p=e[12],g=e[13],m=e[14],_=e[15],y=r[0],x=r[1],S=r[2],T=r[3];return t[0]=y*i+x*s+S*h+T*p,t[1]=y*n+x*l+S*v+T*g,t[2]=y*a+x*u+S*c+T*m,t[3]=y*o+x*f+S*d+T*_,y=r[4],x=r[5],S=r[6],T=r[7],t[4]=y*i+x*s+S*h+T*p,t[5]=y*n+x*l+S*v+T*g,t[6]=y*a+x*u+S*c+T*m,t[7]=y*o+x*f+S*d+T*_,y=r[8],x=r[9],S=r[10],T=r[11],t[8]=y*i+x*s+S*h+T*p,t[9]=y*n+x*l+S*v+T*g,t[10]=y*a+x*u+S*c+T*m,t[11]=y*o+x*f+S*d+T*_,y=r[12],x=r[13],S=r[14],T=r[15],t[12]=y*i+x*s+S*h+T*p,t[13]=y*n+x*l+S*v+T*g,t[14]=y*a+x*u+S*c+T*m,t[15]=y*o+x*f+S*d+T*_,t};z.multiplyAffine=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[4],s=e[5],l=e[6],u=e[8],f=e[9],h=e[10],v=e[12],c=e[13],d=e[14],p=r[0],g=r[1],m=r[2];return t[0]=p*i+g*o+m*u,t[1]=p*n+g*s+m*f,t[2]=p*a+g*l+m*h,p=r[4],g=r[5],m=r[6],t[4]=p*i+g*o+m*u,t[5]=p*n+g*s+m*f,t[6]=p*a+g*l+m*h,p=r[8],g=r[9],m=r[10],t[8]=p*i+g*o+m*u,t[9]=p*n+g*s+m*f,t[10]=p*a+g*l+m*h,p=r[12],g=r[13],m=r[14],t[12]=p*i+g*o+m*u+v,t[13]=p*n+g*s+m*f+c,t[14]=p*a+g*l+m*h+d,t};z.mul=z.multiply;z.mulAffine=z.multiplyAffine;z.translate=function(t,e,r){var i=r[0],n=r[1],a=r[2],o,s,l,u,f,h,v,c,d,p,g,m;return e===t?(t[12]=e[0]*i+e[4]*n+e[8]*a+e[12],t[13]=e[1]*i+e[5]*n+e[9]*a+e[13],t[14]=e[2]*i+e[6]*n+e[10]*a+e[14],t[15]=e[3]*i+e[7]*n+e[11]*a+e[15]):(o=e[0],s=e[1],l=e[2],u=e[3],f=e[4],h=e[5],v=e[6],c=e[7],d=e[8],p=e[9],g=e[10],m=e[11],t[0]=o,t[1]=s,t[2]=l,t[3]=u,t[4]=f,t[5]=h,t[6]=v,t[7]=c,t[8]=d,t[9]=p,t[10]=g,t[11]=m,t[12]=o*i+f*n+d*a+e[12],t[13]=s*i+h*n+p*a+e[13],t[14]=l*i+v*n+g*a+e[14],t[15]=u*i+c*n+m*a+e[15]),t};z.scale=function(t,e,r){var i=r[0],n=r[1],a=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};z.rotate=function(t,e,r,i){var n=i[0],a=i[1],o=i[2],s=Math.sqrt(n*n+a*a+o*o),l,u,f,h,v,c,d,p,g,m,_,y,x,S,T,w,b,A,M,E,D,R,P,I;return Math.abs(s)<du?null:(s=1/s,n*=s,a*=s,o*=s,l=Math.sin(r),u=Math.cos(r),f=1-u,h=e[0],v=e[1],c=e[2],d=e[3],p=e[4],g=e[5],m=e[6],_=e[7],y=e[8],x=e[9],S=e[10],T=e[11],w=n*n*f+u,b=a*n*f+o*l,A=o*n*f-a*l,M=n*a*f-o*l,E=a*a*f+u,D=o*a*f+n*l,R=n*o*f+a*l,P=a*o*f-n*l,I=o*o*f+u,t[0]=h*w+p*b+y*A,t[1]=v*w+g*b+x*A,t[2]=c*w+m*b+S*A,t[3]=d*w+_*b+T*A,t[4]=h*M+p*E+y*D,t[5]=v*M+g*E+x*D,t[6]=c*M+m*E+S*D,t[7]=d*M+_*E+T*D,t[8]=h*R+p*P+y*I,t[9]=v*R+g*P+x*I,t[10]=c*R+m*P+S*I,t[11]=d*R+_*P+T*I,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)};z.rotateX=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],f=e[9],h=e[10],v=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*n+u*i,t[5]=o*n+f*i,t[6]=s*n+h*i,t[7]=l*n+v*i,t[8]=u*n-a*i,t[9]=f*n-o*i,t[10]=h*n-s*i,t[11]=v*n-l*i,t};z.rotateY=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],f=e[9],h=e[10],v=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*n-u*i,t[1]=o*n-f*i,t[2]=s*n-h*i,t[3]=l*n-v*i,t[8]=a*i+u*n,t[9]=o*i+f*n,t[10]=s*i+h*n,t[11]=l*i+v*n,t};z.rotateZ=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],f=e[5],h=e[6],v=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*n+u*i,t[1]=o*n+f*i,t[2]=s*n+h*i,t[3]=l*n+v*i,t[4]=u*n-a*i,t[5]=f*n-o*i,t[6]=h*n-s*i,t[7]=v*n-l*i,t};z.fromRotationTranslation=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=i+i,l=n+n,u=a+a,f=i*s,h=i*l,v=i*u,c=n*l,d=n*u,p=a*u,g=o*s,m=o*l,_=o*u;return t[0]=1-(c+p),t[1]=h+_,t[2]=v-m,t[3]=0,t[4]=h-_,t[5]=1-(f+p),t[6]=d+g,t[7]=0,t[8]=v+m,t[9]=d-g,t[10]=1-(f+c),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t};z.fromQuat=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r+r,s=i+i,l=n+n,u=r*o,f=i*o,h=i*s,v=n*o,c=n*s,d=n*l,p=a*o,g=a*s,m=a*l;return t[0]=1-h-d,t[1]=f+m,t[2]=v-g,t[3]=0,t[4]=f-m,t[5]=1-u-d,t[6]=c+p,t[7]=0,t[8]=v+g,t[9]=c-p,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};z.frustum=function(t,e,r,i,n,a,o){var s=1/(r-e),l=1/(n-i),u=1/(a-o);return t[0]=a*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a*2*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(n+i)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t};z.perspective=function(t,e,r,i,n){var a=1/Math.tan(e/2),o=1/(i-n);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+i)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*i*o,t[15]=0,t};z.ortho=function(t,e,r,i,n,a,o){var s=1/(e-r),l=1/(i-n),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(n+i)*l,t[14]=(o+a)*u,t[15]=1,t};z.lookAt=function(t,e,r,i){var n,a,o,s,l,u,f,h,v,c,d=e[0],p=e[1],g=e[2],m=i[0],_=i[1],y=i[2],x=r[0],S=r[1],T=r[2];return Math.abs(d-x)<du&&Math.abs(p-S)<du&&Math.abs(g-T)<du?z.identity(t):(f=d-x,h=p-S,v=g-T,c=1/Math.sqrt(f*f+h*h+v*v),f*=c,h*=c,v*=c,n=_*v-y*h,a=y*f-m*v,o=m*h-_*f,c=Math.sqrt(n*n+a*a+o*o),c?(c=1/c,n*=c,a*=c,o*=c):(n=0,a=0,o=0),s=h*o-v*a,l=v*n-f*o,u=f*a-h*n,c=Math.sqrt(s*s+l*l+u*u),c?(c=1/c,s*=c,l*=c,u*=c):(s=0,l=0,u=0),t[0]=n,t[1]=s,t[2]=f,t[3]=0,t[4]=a,t[5]=l,t[6]=h,t[7]=0,t[8]=o,t[9]=u,t[10]=v,t[11]=0,t[12]=-(n*d+a*p+o*g),t[13]=-(s*d+l*p+u*g),t[14]=-(f*d+h*p+v*g),t[15]=1,t)};z.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))};var L={};L.create=function(){var t=new xe(3);return t[0]=0,t[1]=0,t[2]=0,t};L.clone=function(t){var e=new xe(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e};L.fromValues=function(t,e,r){var i=new xe(3);return i[0]=t,i[1]=e,i[2]=r,i};L.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t};L.set=function(t,e,r,i){return t[0]=e,t[1]=r,t[2]=i,t};L.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t};L.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};L.sub=L.subtract;L.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t};L.mul=L.multiply;L.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t};L.div=L.divide;L.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t};L.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t};L.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t};L.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t};L.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+i*i+n*n)};L.dist=L.distance;L.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return r*r+i*i+n*n};L.sqrDist=L.squaredDistance;L.length=function(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)};L.len=L.length;L.squaredLength=function(t){var e=t[0],r=t[1],i=t[2];return e*e+r*r+i*i};L.sqrLen=L.squaredLength;L.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t};L.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t};L.normalize=function(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t};L.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]};L.cross=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=n*l-a*s,t[1]=a*o-i*l,t[2]=i*s-n*o,t};L.lerp=function(t,e,r,i){var n=e[0],a=e[1],o=e[2];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t[2]=o+i*(r[2]-o),t};L.random=function(t,e){e=e||1;var r=Ua()*2*Math.PI,i=Ua()*2-1,n=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*n,t[1]=Math.sin(r)*n,t[2]=i*e,t};L.transformMat4=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=r[3]*i+r[7]*n+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/o,t[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/o,t[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/o,t};L.transformMat3=function(t,e,r){var i=e[0],n=e[1],a=e[2];return t[0]=i*r[0]+n*r[3]+a*r[6],t[1]=i*r[1]+n*r[4]+a*r[7],t[2]=i*r[2]+n*r[5]+a*r[8],t};L.transformQuat=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],f=u*i+s*a-l*n,h=u*n+l*i-o*a,v=u*a+o*n-s*i,c=-o*i-s*n-l*a;return t[0]=f*u+c*-o+h*-l-v*-s,t[1]=h*u+c*-s+v*-o-f*-l,t[2]=v*u+c*-l+f*-s-h*-o,t};L.rotateX=function(t,e,r,i){var n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t};L.rotateY=function(t,e,r,i){var n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t};L.rotateZ=function(t,e,r,i){var n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t};L.forEach=function(){var t=L.create();return function(e,r,i,n,a,o){var s,l;for(r||(r=3),i||(i=0),n?l=Math.min(n*r+i,e.length):l=e.length,s=i;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}();L.angle=function(t,e){var r=L.fromValues(t[0],t[1],t[2]),i=L.fromValues(e[0],e[1],e[2]);L.normalize(r,r),L.normalize(i,i);var n=L.dot(r,i);return n>1?0:Math.acos(n)};$.import(yw);var Wt=z.create,z_={};function U_(t){return t.material}function iO(t,e,r){return e.uniforms[r].value}function nO(t,e,r,i){return r!==i}function aO(t){return!0}function H_(){}var V_={float:F.FLOAT,byte:F.BYTE,ubyte:F.UNSIGNED_BYTE,short:F.SHORT,ushort:F.UNSIGNED_SHORT};function oO(t,e,r){this.availableAttributes=t,this.availableAttributeSymbols=e,this.indicesBuffer=r,this.vao=null}function sO(t){var e,r;this.bind=function(i){e||(e=Ct.createCanvas(),e.width=e.height=1,e.getContext("2d"));var n=i.gl,a=!r;a&&(r=n.createTexture()),n.bindTexture(n.TEXTURE_2D,r),a&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e)},this.unbind=function(i){i.gl.bindTexture(i.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var yr=Se.extend(function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:typeof window<"u"&&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:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}},function(){this.canvas||(this.canvas=Ct.createCanvas());var t=this.canvas;try{var e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!this.gl)throw new Error;this._glinfo=new zN(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(r){throw"Error creating WebGL Context "+r}this._programMgr=new pw(this),this._placeholderTexture=new sO},{resize:function(t,e){var r=this.canvas,i=this.devicePixelRatio;t!=null?(r.style&&(r.style.width=t+"px",r.style.height=e+"px"),r.width=t*i,r.height=e*i,this._width=t,this._height=e):(this._width=r.width/i,this._height=r.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var t=this.viewport;return t.width/t.height},setDevicePixelRatio:function(t){this.devicePixelRatio=t,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(t){return this._glinfo.getExtension(t)},getGLParameter:function(t){return this._glinfo.getParameter(t)},setViewport:function(t,e,r,i,n){if(typeof t=="object"){var a=t;t=a.x,e=a.y,r=a.width,i=a.height,n=a.devicePixelRatio}n=n||this.devicePixelRatio,this.gl.viewport(t*n,e*n,r*n,i*n),this.viewport={x:t,y:e,width:r,height:i,devicePixelRatio:n}},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 t=this._clearStack.pop();this.clearColor=t.clearColor,this.clearBit=t.clearBit}},bindSceneRendering:function(t){this._sceneRendering=t},render:function(t,e,r,i){var n=this.gl,a=this.clearColor;if(this.clearBit){n.colorMask(!0,!0,!0,!0),n.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,n.enable(n.SCISSOR_TEST),n.scissor(o.x*l,o.y*l,o.width*l,o.height*l)),n.clearColor(a[0],a[1],a[2],a[3]),n.clear(this.clearBit),s&&n.disable(n.SCISSOR_TEST)}if(r||t.update(!1),t.updateLights(),e=e||t.getMainCamera(),!e){console.error("Can't find camera in the scene.");return}e.update();var u=t.updateRenderList(e,!0);this._sceneRendering=t;var f=u.opaque,h=u.transparent,v=t.material;t.trigger("beforerender",this,t,e,u),i?(this.renderPreZ(f,t,e),n.depthFunc(n.LEQUAL)):n.depthFunc(n.LESS);for(var c=Wt(),d=L.create(),p=0;p<h.length;p++){var g=h[p];z.multiplyAffine(c,e.viewMatrix.array,g.worldTransform.array),L.transformMat4(d,g.position.array,c),g.__depth=d[2]}this.renderPass(f,e,{getMaterial:function(m){return v||m.material},sortCompare:this.opaqueSortCompare}),this.renderPass(h,e,{getMaterial:function(m){return v||m.material},sortCompare:this.transparentSortCompare}),t.trigger("afterrender",this,t,e,u),this._sceneRendering=null},getProgram:function(t,e,r){return e=e||t.material,this._programMgr.getProgram(t,e,r)},validateProgram:function(t){if(t.__error){var e=t.__error;if(z_[t.__uid__])return;if(z_[t.__uid__]=!0,this.throwError)throw new Error(e);this.trigger("error",e)}},updatePrograms:function(t,e,r){var i=r&&r.getMaterial||U_;e=e||null;for(var n=0;n<t.length;n++){var a=t[n],o=i.call(this,a);if(n>0){var s=t[n-1],l=s.joints?s.joints.length:0,u=a.joints?a.joints.length:0;if(u===l&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var f=this._programMgr.getProgram(a,o,e);this.validateProgram(f),a.__program=f}},renderPass:function(t,e,r){this.trigger("beforerenderpass",this,t,e,r),r=r||{},r.getMaterial=r.getMaterial||U_,r.getUniform=r.getUniform||iO,r.isMaterialChanged=r.isMaterialChanged||nO,r.beforeRender=r.beforeRender||H_,r.afterRender=r.afterRender||H_;var i=r.ifRender||aO;this.updatePrograms(t,this._sceneRendering,r),r.sortCompare&&t.sort(r.sortCompare);var n=this.viewport,a=n.devicePixelRatio,o=[n.x*a,n.y*a,n.width*a,n.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]],f=Date.now();e?(z.copy(Gt.VIEW,e.viewMatrix.array),z.copy(Gt.PROJECTION,e.projectionMatrix.array),z.copy(Gt.VIEWINVERSE,e.worldTransform.array)):(z.identity(Gt.VIEW),z.identity(Gt.PROJECTION),z.identity(Gt.VIEWINVERSE)),z.multiply(Gt.VIEWPROJECTION,Gt.PROJECTION,Gt.VIEW),z.invert(Gt.PROJECTIONINVERSE,Gt.PROJECTION),z.invert(Gt.VIEWPROJECTIONINVERSE,Gt.VIEWPROJECTION);for(var h=this.gl,v=this._sceneRendering,c,d,p,g,m,_,y,x,S,T,w,b,A=null,M=0;M<t.length;M++){var E=t[M],D=E.worldTransform!=null,R;if(i(E)){D&&(R=E.isSkinnedMesh&&E.isSkinnedMesh()?E.offsetMatrix?E.offsetMatrix.array:Gt.IDENTITY:E.worldTransform.array);var P=E.geometry,I=r.getMaterial.call(this,E),N=E.__program,V=I.shader,O=P.__uid__+"-"+N.__uid__,X=O!==T;T=O,X&&A&&A.bindVertexArrayOES(null),D&&(z.copy(Gt.WORLD,R),z.multiply(Gt.WORLDVIEWPROJECTION,Gt.VIEWPROJECTION,R),z.multiplyAffine(Gt.WORLDVIEW,Gt.VIEW,R),(V.matrixSemantics.WORLDINVERSE||V.matrixSemantics.WORLDINVERSETRANSPOSE)&&z.invert(Gt.WORLDINVERSE,R),(V.matrixSemantics.WORLDVIEWINVERSE||V.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&z.invert(Gt.WORLDVIEWINVERSE,Gt.WORLDVIEW),(V.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||V.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&z.invert(Gt.WORLDVIEWPROJECTIONINVERSE,Gt.WORLDVIEWPROJECTION)),E.beforeRender&&E.beforeRender(this),r.beforeRender.call(this,E,I,c);var G=N!==d;G?(N.bind(this),N.setUniformOfSemantic(h,"VIEWPORT",o),N.setUniformOfSemantic(h,"WINDOW_SIZE",l),e&&(N.setUniformOfSemantic(h,"NEAR",e.near),N.setUniformOfSemantic(h,"FAR",e.far)),N.setUniformOfSemantic(h,"DEVICEPIXELRATIO",a),N.setUniformOfSemantic(h,"TIME",f),N.setUniformOfSemantic(h,"VIEWPORT_SIZE",u),v&&v.setLightUniforms(N,E.lightGroup,this)):N=d,(G||r.isMaterialChanged(E,p,I,c))&&(I.depthTest!==g&&(I.depthTest?h.enable(h.DEPTH_TEST):h.disable(h.DEPTH_TEST),g=I.depthTest),I.depthMask!==m&&(h.depthMask(I.depthMask),m=I.depthMask),I.transparent!==S&&(I.transparent?h.enable(h.BLEND):h.disable(h.BLEND),S=I.transparent),I.transparent&&(I.blend?I.blend(h):(h.blendEquationSeparate(h.FUNC_ADD,h.FUNC_ADD),h.blendFuncSeparate(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA))),b=this._bindMaterial(E,I,N,p||null,c||null,d||null,r.getUniform),c=I);var lt=V.matrixSemanticKeys;if(D)for(var J=0;J<lt.length;J++){var ot=lt[J],at=V.matrixSemantics[ot],Dt=Gt[ot];if(at.isTranspose){var pt=Gt[at.semanticNoTranspose];z.transpose(Dt,pt)}N.setUniform(h,at.type,at.symbol,Dt)}E.cullFace!==y&&(y=E.cullFace,h.cullFace(y)),E.frontFace!==x&&(x=E.frontFace,h.frontFace(x)),E.culling!==_&&(_=E.culling,_?h.enable(h.CULL_FACE):h.disable(h.CULL_FACE)),this._updateSkeleton(E,N,b),X&&(w=this._bindVAO(A,V,P,N)),this._renderObject(E,w,N),r.afterRender(this,E),E.afterRender&&E.afterRender(this),d=N,p=E}}this.trigger("afterrenderpass",this,t,e,r)},getMaxJointNumber:function(){return this.maxJointNumber},_updateSkeleton:function(t,e,r){var i=this.gl,n=t.skeleton;if(n)if(n.update(),t.joints.length>this.getMaxJointNumber()){var a=n.getSubSkinMatricesTexture(t.__uid__,t.joints);e.useTextureSlot(this,a,r),e.setUniform(i,"1i","skinMatricesTexture",r),e.setUniform(i,"1f","skinMatricesTextureSize",a.width)}else{var o=n.getSubSkinMatrices(t.__uid__,t.joints);e.setUniformOfSemantic(i,"SKIN_MATRIX",o)}},_renderObject:function(t,e,r){var i=this.gl,n=t.geometry,a=t.mode;a==null&&(a=4);var o=null,s=t.isInstancedMesh&&t.isInstancedMesh();if(s&&(o=this.getGLExtension("ANGLE_instanced_arrays"),!o)){console.warn("Device not support ANGLE_instanced_arrays extension");return}var l;if(s&&(l=this._bindInstancedAttributes(t,r,o)),e.indicesBuffer){var u=this.getGLExtension("OES_element_index_uint"),f=u&&n.indices instanceof Uint32Array,h=f?i.UNSIGNED_INT:i.UNSIGNED_SHORT;s?o.drawElementsInstancedANGLE(a,e.indicesBuffer.count,h,0,t.getInstanceCount()):i.drawElements(a,e.indicesBuffer.count,h,0)}else s?o.drawArraysInstancedANGLE(a,0,n.vertexCount,t.getInstanceCount()):i.drawArrays(a,0,n.vertexCount);if(s)for(var v=0;v<l.length;v++)i.disableVertexAttribArray(l[v])},_bindInstancedAttributes:function(t,e,r){for(var i=this.gl,n=t.getInstancedAttributesBuffers(this),a=[],o=0;o<n.length;o++){var s=n[o],l=e.getAttribLocation(i,s.symbol);if(!(l<0)){var u=V_[s.type]||i.FLOAT;i.enableVertexAttribArray(l),i.bindBuffer(i.ARRAY_BUFFER,s.buffer),i.vertexAttribPointer(l,s.size,u,!1,0,0),r.vertexAttribDivisorANGLE(l,s.divisor),a.push(l)}}return a},_bindMaterial:function(t,e,r,i,n,a,o){for(var s=this.gl,l=a===r,u=r.currentTextureSlot(),f=e.getEnabledUniforms(),h=e.getTextureUniforms(),v=this._placeholderTexture,c=0;c<h.length;c++){var d=h[c],p=o(t,e,d),g=e.uniforms[d].type;if(g==="t"&&p)p.__slot=-1;else if(g==="tv")for(var m=0;m<p.length;m++)p[m]&&(p[m].__slot=-1)}v.__slot=-1;for(var c=0;c<f.length;c++){var d=f[c],_=e.uniforms[d],p=o(t,e,d),g=_.type,y=g==="t";if(y&&(!p||!p.isRenderable())&&(p=v),n&&l){var x=o(i,n,d);if(y&&(!x||!x.isRenderable())&&(x=v),x===p){if(y)r.takeCurrentTextureSlot(this,null);else if(g==="tv"&&p)for(var m=0;m<p.length;m++)r.takeCurrentTextureSlot(this,null);continue}}if(p!=null)if(y)if(p.__slot<0){var S=r.currentTextureSlot(),T=r.setUniform(s,"1i",d,S);T&&(r.takeCurrentTextureSlot(this,p),p.__slot=S)}else r.setUniform(s,"1i",d,p.__slot);else if(Array.isArray(p)){if(p.length===0)continue;if(g==="tv"){if(!r.hasUniform(d))continue;for(var w=[],m=0;m<p.length;m++){var b=p[m];if(b.__slot<0){var S=r.currentTextureSlot();w.push(S),r.takeCurrentTextureSlot(this,b),b.__slot=S}else w.push(b.__slot)}r.setUniform(s,"1iv",d,w)}else r.setUniform(s,_.type,d,p)}else r.setUniform(s,_.type,d,p)}var A=r.currentTextureSlot();return r.resetTextureSlot(u),A},_bindVAO:function(t,e,r,i){var n=!r.dynamic,a=this.gl,o=this.__uid__+"-"+i.__uid__,s=r.__vaoCache[o];if(!s){var l=r.getBufferChunks(this);if(!l||!l.length)return;for(var u=l[0],f=u.attributeBuffers,x=u.indicesBuffer,y=[],h=[],v=0;v<f.length;v++){var c=f[v],d=c.name,p=c.semantic,g;if(p){var m=e.attributeSemantics[p];g=m&&m.symbol}else g=d;g&&i.attributes[g]&&(y.push(c),h.push(g))}s=new oO(y,h,x),n&&(r.__vaoCache[o]=s)}var _=!0;t&&n&&(s.vao==null?s.vao=t.createVertexArrayOES():_=!1,t.bindVertexArrayOES(s.vao));var y=s.availableAttributes,x=s.indicesBuffer;if(_){for(var S=i.enableAttributes(this,s.availableAttributeSymbols,t&&n&&s),v=0;v<y.length;v++){var T=S[v];if(T!==-1){var c=y[v],w=c.buffer,b=c.size,A=V_[c.type]||a.FLOAT;a.bindBuffer(a.ARRAY_BUFFER,w),a.vertexAttribPointer(T,b,A,!1,0,0)}}r.isUseIndices()&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,x.buffer)}return s},renderPreZ:function(t,e,r){var i=this.gl,n=this._prezMaterial||new Si({shader:new $($.source("clay.prez.vertex"),$.source("clay.prez.fragment"))});this._prezMaterial=n,i.colorMask(!1,!1,!1,!1),i.depthMask(!0),this.renderPass(t,r,{ifRender:function(a){return!a.ignorePreZ},isMaterialChanged:function(a,o){var s=a.material,l=o.material;return s.get("diffuseMap")!==l.get("diffuseMap")||(s.get("alphaCutoff")||0)!==(l.get("alphaCutoff")||0)},getUniform:function(a,o,s){if(s==="alphaMap")return a.material.get("diffuseMap");if(s==="alphaCutoff"){if(a.material.isDefined("fragment","ALPHA_TEST")&&a.material.get("diffuseMap")){var l=a.material.get("alphaCutoff");return l||0}return 0}else return s==="uvRepeat"?a.material.get("uvRepeat"):s==="uvOffset"?a.material.get("uvOffset"):o.get(s)},getMaterial:function(){return n},sort:this.opaqueSortCompare}),i.colorMask(!0,!0,!0,!0),i.depthMask(!0)},disposeScene:function(t){this.disposeNode(t,!0,!0),t.dispose()},disposeNode:function(t,e,r){t.getParent()&&t.getParent().remove(t);var i={};t.traverse(function(n){var a=n.material;if(n.geometry&&e&&n.geometry.dispose(this),r&&a&&!i[a.__uid__]){for(var o=a.getTextureUniforms(),s=0;s<o.length;s++){var l=o[s],u=a.uniforms[l].value,f=a.uniforms[l].type;if(u){if(f==="t")u.dispose&&u.dispose(this);else if(f==="tv")for(var h=0;h<u.length;h++)u[h]&&u[h].dispose&&u[h].dispose(this)}}i[a.__uid__]=!0}n.dispose&&n.dispose(this)},this)},disposeGeometry:function(t){t.dispose(this)},disposeTexture:function(t){t.dispose(this)},disposeFrameBuffer:function(t){t.dispose(this)},dispose:function(){},screenToNDC:function(t,e,r){r||(r=new st),e=this._height-e;var i=this.viewport,n=r.array;return n[0]=(t-i.x)/i.width,n[0]=n[0]*2-1,n[1]=(e-i.y)/i.height,n[1]=n[1]*2-1,r}});yr.opaqueSortCompare=yr.prototype.opaqueSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.renderOrder-e.renderOrder};yr.transparentSortCompare=yr.prototype.transparentSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__depth===e.__depth?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.__depth-e.__depth:t.renderOrder-e.renderOrder};var Gt={IDENTITY:Wt(),WORLD:Wt(),VIEW:Wt(),PROJECTION:Wt(),WORLDVIEW:Wt(),VIEWPROJECTION:Wt(),WORLDVIEWPROJECTION:Wt(),WORLDINVERSE:Wt(),VIEWINVERSE:Wt(),PROJECTIONINVERSE:Wt(),WORLDVIEWINVERSE:Wt(),VIEWPROJECTIONINVERSE:Wt(),WORLDVIEWPROJECTIONINVERSE:Wt(),WORLDTRANSPOSE:Wt(),VIEWTRANSPOSE:Wt(),PROJECTIONTRANSPOSE:Wt(),WORLDVIEWTRANSPOSE:Wt(),VIEWPROJECTIONTRANSPOSE:Wt(),WORLDVIEWPROJECTIONTRANSPOSE:Wt(),WORLDINVERSETRANSPOSE:Wt(),VIEWINVERSETRANSPOSE:Wt(),PROJECTIONINVERSETRANSPOSE:Wt(),WORLDVIEWINVERSETRANSPOSE:Wt(),VIEWPROJECTIONINVERSETRANSPOSE:Wt(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:Wt()};yr.COLOR_BUFFER_BIT=F.COLOR_BUFFER_BIT;yr.DEPTH_BUFFER_BIT=F.DEPTH_BUFFER_BIT;yr.STENCIL_BUFFER_BIT=F.STENCIL_BUFFER_BIT;var B=function(t,e,r){t=t||0,e=e||0,r=r||0,this.array=L.fromValues(t,e,r),this._dirty=!0};B.prototype={constructor:B,add:function(t){return L.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e,r){return this.array[0]=t,this.array[1]=e,this.array[2]=r,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this._dirty=!0,this},clone:function(){return new B(this.x,this.y,this.z)},copy:function(t){return L.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return L.cross(this.array,t.array,e.array),this._dirty=!0,this},dist:function(t){return L.dist(this.array,t.array)},distance:function(t){return L.distance(this.array,t.array)},div:function(t){return L.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return L.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return L.dot(this.array,t.array)},len:function(){return L.len(this.array)},length:function(){return L.length(this.array)},lerp:function(t,e,r){return L.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},min:function(t){return L.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return L.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return L.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return L.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return L.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return L.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return L.random(this.array,t),this._dirty=!0,this},scale:function(t){return L.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return L.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return L.sqrDist(this.array,t.array)},squaredDistance:function(t){return L.squaredDistance(this.array,t.array)},sqrLen:function(){return L.sqrLen(this.array)},squaredLength:function(){return L.squaredLength(this.array)},sub:function(t){return L.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return L.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return L.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return L.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return L.transformQuat(this.array,this.array,t.array),this._dirty=!0,this},applyProjection:function(t){var e=this.array;if(t=t.array,t[15]===0){var r=-1/e[2];e[0]=t[0]*e[0]*r,e[1]=t[5]*e[1]*r,e[2]=(t[10]*e[2]+t[14])*r}else e[0]=t[0]*e[0]+t[12],e[1]=t[5]*e[1]+t[13],e[2]=t[10]*e[2]+t[14];return this._dirty=!0,this},eulerFromQuat:function(t,e){B.eulerFromQuat(this,t,e)},eulerFromMat3:function(t,e){B.eulerFromMat3(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var zl=Object.defineProperty;if(zl){var Cc=B.prototype;zl(Cc,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),zl(Cc,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),zl(Cc,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}})}B.add=function(t,e,r){return L.add(t.array,e.array,r.array),t._dirty=!0,t};B.set=function(t,e,r,i){L.set(t.array,e,r,i),t._dirty=!0};B.copy=function(t,e){return L.copy(t.array,e.array),t._dirty=!0,t};B.cross=function(t,e,r){return L.cross(t.array,e.array,r.array),t._dirty=!0,t};B.dist=function(t,e){return L.distance(t.array,e.array)};B.distance=B.dist;B.div=function(t,e,r){return L.divide(t.array,e.array,r.array),t._dirty=!0,t};B.divide=B.div;B.dot=function(t,e){return L.dot(t.array,e.array)};B.len=function(t){return L.length(t.array)};B.lerp=function(t,e,r,i){return L.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};B.min=function(t,e,r){return L.min(t.array,e.array,r.array),t._dirty=!0,t};B.max=function(t,e,r){return L.max(t.array,e.array,r.array),t._dirty=!0,t};B.mul=function(t,e,r){return L.multiply(t.array,e.array,r.array),t._dirty=!0,t};B.multiply=B.mul;B.negate=function(t,e){return L.negate(t.array,e.array),t._dirty=!0,t};B.normalize=function(t,e){return L.normalize(t.array,e.array),t._dirty=!0,t};B.random=function(t,e){return L.random(t.array,e),t._dirty=!0,t};B.scale=function(t,e,r){return L.scale(t.array,e.array,r),t._dirty=!0,t};B.scaleAndAdd=function(t,e,r,i){return L.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};B.sqrDist=function(t,e){return L.sqrDist(t.array,e.array)};B.squaredDistance=B.sqrDist;B.sqrLen=function(t){return L.sqrLen(t.array)};B.squaredLength=B.sqrLen;B.sub=function(t,e,r){return L.subtract(t.array,e.array,r.array),t._dirty=!0,t};B.subtract=B.sub;B.transformMat3=function(t,e,r){return L.transformMat3(t.array,e.array,r.array),t._dirty=!0,t};B.transformMat4=function(t,e,r){return L.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};B.transformQuat=function(t,e,r){return L.transformQuat(t.array,e.array,r.array),t._dirty=!0,t};function dr(t,e,r){return t<e?e:t>r?r:t}var Ft=Math.atan2,pr=Math.asin,ya=Math.abs;B.eulerFromQuat=function(t,e,v){t._dirty=!0,e=e.array;var i=t.array,n=e[0],a=e[1],o=e[2],s=e[3],l=n*n,u=a*a,f=o*o,h=s*s,v=(v||"XYZ").toUpperCase();switch(v){case"XYZ":i[0]=Ft(2*(n*s-a*o),h-l-u+f),i[1]=pr(dr(2*(n*o+a*s),-1,1)),i[2]=Ft(2*(o*s-n*a),h+l-u-f);break;case"YXZ":i[0]=pr(dr(2*(n*s-a*o),-1,1)),i[1]=Ft(2*(n*o+a*s),h-l-u+f),i[2]=Ft(2*(n*a+o*s),h-l+u-f);break;case"ZXY":i[0]=pr(dr(2*(n*s+a*o),-1,1)),i[1]=Ft(2*(a*s-o*n),h-l-u+f),i[2]=Ft(2*(o*s-n*a),h-l+u-f);break;case"ZYX":i[0]=Ft(2*(n*s+o*a),h-l-u+f),i[1]=pr(dr(2*(a*s-n*o),-1,1)),i[2]=Ft(2*(n*a+o*s),h+l-u-f);break;case"YZX":i[0]=Ft(2*(n*s-o*a),h-l+u-f),i[1]=Ft(2*(a*s-n*o),h+l-u-f),i[2]=pr(dr(2*(n*a+o*s),-1,1));break;case"XZY":i[0]=Ft(2*(n*s+a*o),h-l+u-f),i[1]=Ft(2*(n*o+a*s),h+l-u-f),i[2]=pr(dr(2*(o*s-n*a),-1,1));break;default:console.warn("Unkown order: "+v)}return t};B.eulerFromMat3=function(t,e,d){var i=e.array,n=i[0],a=i[3],o=i[6],s=i[1],l=i[4],u=i[7],f=i[2],h=i[5],v=i[8],c=t.array,d=(d||"XYZ").toUpperCase();switch(d){case"XYZ":c[1]=pr(dr(o,-1,1)),ya(o)<.99999?(c[0]=Ft(-u,v),c[2]=Ft(-a,n)):(c[0]=Ft(h,l),c[2]=0);break;case"YXZ":c[0]=pr(-dr(u,-1,1)),ya(u)<.99999?(c[1]=Ft(o,v),c[2]=Ft(s,l)):(c[1]=Ft(-f,n),c[2]=0);break;case"ZXY":c[0]=pr(dr(h,-1,1)),ya(h)<.99999?(c[1]=Ft(-f,v),c[2]=Ft(-a,l)):(c[1]=0,c[2]=Ft(s,n));break;case"ZYX":c[1]=pr(-dr(f,-1,1)),ya(f)<.99999?(c[0]=Ft(h,v),c[2]=Ft(s,n)):(c[0]=0,c[2]=Ft(-a,l));break;case"YZX":c[2]=pr(dr(s,-1,1)),ya(s)<.99999?(c[0]=Ft(-u,l),c[1]=Ft(-f,n)):(c[0]=0,c[1]=Ft(o,v));break;case"XZY":c[2]=pr(-dr(a,-1,1)),ya(a)<.99999?(c[0]=Ft(h,l),c[1]=Ft(o,n)):(c[0]=Ft(-u,v),c[1]=0);break;default:console.warn("Unkown order: "+d)}return t._dirty=!0,t};Object.defineProperties(B,{POSITIVE_X:{get:function(){return new B(1,0,0)}},NEGATIVE_X:{get:function(){return new B(-1,0,0)}},POSITIVE_Y:{get:function(){return new B(0,1,0)}},NEGATIVE_Y:{get:function(){return new B(0,-1,0)}},POSITIVE_Z:{get:function(){return new B(0,0,1)}},NEGATIVE_Z:{get:function(){return new B(0,0,-1)}},UP:{get:function(){return new B(0,1,0)}},ZERO:{get:function(){return new B}}});var Dc=1e-5,Zn=function(t,e){this.origin=t||new B,this.direction=e||new B};Zn.prototype={constructor:Zn,intersectPlane:function(t,e){var r=t.normal.array,i=t.distance,n=this.origin.array,a=this.direction.array,o=L.dot(r,a);if(o===0)return null;e||(e=new B);var s=(L.dot(r,n)-i)/o;return L.scaleAndAdd(e.array,n,a,-s),e._dirty=!0,e},mirrorAgainstPlane:function(t){var e=L.dot(t.normal.array,this.direction.array);L.scaleAndAdd(this.direction.array,this.direction.array,t.normal.array,-e*2),this.direction._dirty=!0},distanceToPoint:function(){var t=L.create();return function(e){L.sub(t,e,this.origin.array);var r=L.dot(t,this.direction.array);if(r<0)return L.distance(this.origin.array,e);var i=L.lenSquared(t);return Math.sqrt(i-r*r)}}(),intersectSphere:function(){var t=L.create();return function(e,r,i){var n=this.origin.array,a=this.direction.array;e=e.array,L.sub(t,e,n);var o=L.dot(t,a),s=L.squaredLength(t),l=s-o*o,u=r*r;if(!(l>u)){var f=Math.sqrt(u-l),h=o-f,v=o+f;return i||(i=new B),h<0?v<0?null:(L.scaleAndAdd(i.array,n,a,v),i):(L.scaleAndAdd(i.array,n,a,h),i)}}}(),intersectBoundingBox:function(t,e){var r=this.direction.array,i=this.origin.array,n=t.min.array,a=t.max.array,o=1/r[0],s=1/r[1],l=1/r[2],u,f,h,v,c,d;if(o>=0?(u=(n[0]-i[0])*o,f=(a[0]-i[0])*o):(f=(n[0]-i[0])*o,u=(a[0]-i[0])*o),s>=0?(h=(n[1]-i[1])*s,v=(a[1]-i[1])*s):(v=(n[1]-i[1])*s,h=(a[1]-i[1])*s),u>v||h>f||((h>u||u!==u)&&(u=h),(v<f||f!==f)&&(f=v),l>=0?(c=(n[2]-i[2])*l,d=(a[2]-i[2])*l):(d=(n[2]-i[2])*l,c=(a[2]-i[2])*l),u>d||c>f)||((c>u||u!==u)&&(u=c),(d<f||f!==f)&&(f=d),f<0))return null;var p=u>=0?u:f;return e||(e=new B),L.scaleAndAdd(e.array,i,r,p),e},intersectTriangle:function(){var t=L.create(),e=L.create(),r=L.create(),i=L.create();return function(n,a,o,s,l,u){var f=this.direction.array,h=this.origin.array;n=n.array,a=a.array,o=o.array,L.sub(t,a,n),L.sub(e,o,n),L.cross(i,e,f);var v=L.dot(t,i);if(s){if(v>-Dc)return null}else if(v>-Dc&&v<Dc)return null;L.sub(r,h,n);var c=L.dot(i,r)/v;if(c<0||c>1)return null;L.cross(i,t,r);var d=L.dot(f,i)/v;if(d<0||d>1||c+d>1)return null;L.cross(i,t,e);var p=-L.dot(r,i)/v;return p<0?null:(l||(l=new B),u&&B.set(u,1-c-d,c,d),L.scaleAndAdd(l.array,h,f,p),l)}}(),applyTransform:function(t){B.add(this.direction,this.direction,this.origin),B.transformMat4(this.origin,this.origin,t),B.transformMat4(this.direction,this.direction,t),B.sub(this.direction,this.direction,this.origin),B.normalize(this.direction,this.direction)},copy:function(t){B.copy(this.origin,t.origin),B.copy(this.direction,t.direction)},clone:function(){var t=new Zn;return t.copy(this),t}};var k={};k.create=function(){var t=new xe(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t};k.clone=function(t){var e=new xe(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e};k.fromValues=function(t,e,r,i){var n=new xe(4);return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n};k.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};k.set=function(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t};k.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t};k.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t};k.sub=k.subtract;k.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t};k.mul=k.multiply;k.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t};k.div=k.divide;k.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t};k.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t};k.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t};k.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t};k.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+i*i+n*n+a*a)};k.dist=k.distance;k.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2],a=e[3]-t[3];return r*r+i*i+n*n+a*a};k.sqrDist=k.squaredDistance;k.length=function(t){var e=t[0],r=t[1],i=t[2],n=t[3];return Math.sqrt(e*e+r*r+i*i+n*n)};k.len=k.length;k.squaredLength=function(t){var e=t[0],r=t[1],i=t[2],n=t[3];return e*e+r*r+i*i+n*n};k.sqrLen=k.squaredLength;k.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};k.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t};k.normalize=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r*r+i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t[3]=e[3]*o),t};k.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]};k.lerp=function(t,e,r,i){var n=e[0],a=e[1],o=e[2],s=e[3];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t[2]=o+i*(r[2]-o),t[3]=s+i*(r[3]-s),t};k.random=function(t,e){return e=e||1,t[0]=Ua(),t[1]=Ua(),t[2]=Ua(),t[3]=Ua(),k.normalize(t,t),k.scale(t,t,e),t};k.transformMat4=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,t};k.transformQuat=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],f=u*i+s*a-l*n,h=u*n+l*i-o*a,v=u*a+o*n-s*i,c=-o*i-s*n-l*a;return t[0]=f*u+c*-o+h*-l-v*-s,t[1]=h*u+c*-s+v*-o-f*-l,t[2]=v*u+c*-l+f*-s-h*-o,t};k.forEach=function(){var t=k.create();return function(e,r,i,n,a,o){var s,l;for(r||(r=4),i||(i=0),n?l=Math.min(n*r+i,e.length):l=e.length,s=i;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();var it={};it.create=function(){var t=new xe(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t};it.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};it.clone=function(t){var e=new xe(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e};it.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t};it.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t};it.transpose=function(t,e){if(t===e){var r=e[1],i=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=i,t[7]=n}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t};it.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],h=f*o-s*u,v=-f*a+s*l,c=u*a-o*l,d=r*h+i*v+n*c;return d?(d=1/d,t[0]=h*d,t[1]=(-f*i+n*u)*d,t[2]=(s*i-n*o)*d,t[3]=v*d,t[4]=(f*r-n*l)*d,t[5]=(-s*r+n*a)*d,t[6]=c*d,t[7]=(-u*r+i*l)*d,t[8]=(o*r-i*a)*d,t):null};it.adjoint=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8];return t[0]=o*f-s*u,t[1]=n*u-i*f,t[2]=i*s-n*o,t[3]=s*l-a*f,t[4]=r*f-n*l,t[5]=n*a-r*s,t[6]=a*u-o*l,t[7]=i*l-r*u,t[8]=r*o-i*a,t};it.determinant=function(t){var e=t[0],r=t[1],i=t[2],n=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8];return e*(u*a-o*l)+r*(-u*n+o*s)+i*(l*n-a*s)};it.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],h=e[8],v=r[0],c=r[1],d=r[2],p=r[3],g=r[4],m=r[5],_=r[6],y=r[7],x=r[8];return t[0]=v*i+c*o+d*u,t[1]=v*n+c*s+d*f,t[2]=v*a+c*l+d*h,t[3]=p*i+g*o+m*u,t[4]=p*n+g*s+m*f,t[5]=p*a+g*l+m*h,t[6]=_*i+y*o+x*u,t[7]=_*n+y*s+x*f,t[8]=_*a+y*l+x*h,t};it.mul=it.multiply;it.translate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],h=e[8],v=r[0],c=r[1];return t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=v*i+c*o+u,t[7]=v*n+c*s+f,t[8]=v*a+c*l+h,t};it.rotate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],h=e[8],v=Math.sin(r),c=Math.cos(r);return t[0]=c*i+v*o,t[1]=c*n+v*s,t[2]=c*a+v*l,t[3]=c*o-v*i,t[4]=c*s-v*n,t[5]=c*l-v*a,t[6]=u,t[7]=f,t[8]=h,t};it.scale=function(t,e,r){var i=r[0],n=r[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t};it.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t};it.fromQuat=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r+r,s=i+i,l=n+n,u=r*o,f=i*o,h=i*s,v=n*o,c=n*s,d=n*l,p=a*o,g=a*s,m=a*l;return t[0]=1-h-d,t[3]=f-m,t[6]=v+g,t[1]=f+m,t[4]=1-u-d,t[7]=c-p,t[2]=v-g,t[5]=c+p,t[8]=1-u-h,t};it.normalFromMat4=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],h=e[9],v=e[10],c=e[11],d=e[12],p=e[13],g=e[14],m=e[15],_=r*s-i*o,y=r*l-n*o,x=r*u-a*o,S=i*l-n*s,T=i*u-a*s,w=n*u-a*l,b=f*p-h*d,A=f*g-v*d,M=f*m-c*d,E=h*g-v*p,D=h*m-c*p,R=v*m-c*g,P=_*R-y*D+x*E+S*M-T*A+w*b;return P?(P=1/P,t[0]=(s*R-l*D+u*E)*P,t[1]=(l*M-o*R-u*A)*P,t[2]=(o*D-s*M+u*b)*P,t[3]=(n*D-i*R-a*E)*P,t[4]=(r*R-n*M+a*A)*P,t[5]=(i*M-r*D-a*b)*P,t[6]=(p*w-g*T+m*S)*P,t[7]=(g*x-d*w-m*y)*P,t[8]=(d*T-p*x+m*_)*P,t):null};it.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))};var Z={};Z.create=function(){var t=new xe(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t};Z.rotationTo=function(){var t=L.create(),e=L.fromValues(1,0,0),r=L.fromValues(0,1,0);return function(i,n,a){var o=L.dot(n,a);return o<-.999999?(L.cross(t,e,n),L.length(t)<1e-6&&L.cross(t,r,n),L.normalize(t,t),Z.setAxisAngle(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(L.cross(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,Z.normalize(i,i))}}();Z.setAxes=function(){var t=it.create();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],Z.normalize(e,Z.fromMat3(e,t))}}();Z.clone=k.clone;Z.fromValues=k.fromValues;Z.copy=k.copy;Z.set=k.set;Z.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t};Z.setAxisAngle=function(t,e,r){r=r*.5;var i=Math.sin(r);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(r),t};Z.add=k.add;Z.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],f=r[3];return t[0]=i*f+o*s+n*u-a*l,t[1]=n*f+o*l+a*s-i*u,t[2]=a*f+o*u+i*l-n*s,t[3]=o*f-i*s-n*l-a*u,t};Z.mul=Z.multiply;Z.scale=k.scale;Z.rotateX=function(t,e,r){r*=.5;var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+o*s,t[1]=n*l+a*s,t[2]=a*l-n*s,t[3]=o*l-i*s,t};Z.rotateY=function(t,e,r){r*=.5;var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l-a*s,t[1]=n*l+o*s,t[2]=a*l+i*s,t[3]=o*l-n*s,t};Z.rotateZ=function(t,e,r){r*=.5;var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+n*s,t[1]=n*l-i*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t};Z.calculateW=function(t,e){var r=e[0],i=e[1],n=e[2];return t[0]=r,t[1]=i,t[2]=n,t[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),t};Z.dot=k.dot;Z.lerp=k.lerp;Z.slerp=function(t,e,r,i){var n=e[0],a=e[1],o=e[2],s=e[3],l=r[0],u=r[1],f=r[2],h=r[3],v,c,d,p,g;return c=n*l+a*u+o*f+s*h,c<0&&(c=-c,l=-l,u=-u,f=-f,h=-h),1-c>1e-6?(v=Math.acos(c),d=Math.sin(v),p=Math.sin((1-i)*v)/d,g=Math.sin(i*v)/d):(p=1-i,g=i),t[0]=p*n+g*l,t[1]=p*a+g*u,t[2]=p*o+g*f,t[3]=p*s+g*h,t};Z.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r*r+i*i+n*n+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-i*s,t[2]=-n*s,t[3]=a*s,t};Z.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t};Z.length=k.length;Z.len=Z.length;Z.squaredLength=k.squaredLength;Z.sqrLen=Z.squaredLength;Z.normalize=k.normalize;Z.fromMat3=function(t,e){var r=e[0]+e[4]+e[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[n*3+n]&&(n=2);var a=(n+1)%3,o=(n+2)%3;i=Math.sqrt(e[n*3+n]-e[a*3+a]-e[o*3+o]+1),t[n]=.5*i,i=.5/i,t[3]=(e[a*3+o]-e[o*3+a])*i,t[a]=(e[a*3+n]+e[n*3+a])*i,t[o]=(e[o*3+n]+e[n*3+o])*i}return t};var q=function(){this._axisX=new B,this._axisY=new B,this._axisZ=new B,this.array=z.create(),this._dirty=!0};q.prototype={constructor:q,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},adjoint:function(){return z.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return new q().copy(this)},copy:function(t){return z.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return z.determinant(this.array)},fromQuat:function(t){return z.fromQuat(this.array,t.array),this._dirty=!0,this},fromRotationTranslation:function(t,e){return z.fromRotationTranslation(this.array,t.array,e.array),this._dirty=!0,this},fromMat2d:function(t){return q.fromMat2d(this,t),this},frustum:function(t,e,r,i,n,a){return z.frustum(this.array,t,e,r,i,n,a),this._dirty=!0,this},identity:function(){return z.identity(this.array),this._dirty=!0,this},invert:function(){return z.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(t,e,r){return z.lookAt(this.array,t.array,e.array,r.array),this._dirty=!0,this},mul:function(t){return z.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return z.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return z.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return z.multiply(this.array,t.array,this.array),this._dirty=!0,this},ortho:function(t,e,r,i,n,a){return z.ortho(this.array,t,e,r,i,n,a),this._dirty=!0,this},perspective:function(t,e,r,i){return z.perspective(this.array,t,e,r,i),this._dirty=!0,this},rotate:function(t,e){return z.rotate(this.array,this.array,t,e.array),this._dirty=!0,this},rotateX:function(t){return z.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return z.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return z.rotateZ(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return z.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return z.translate(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return z.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var t=L.create(),e=L.create(),r=L.create(),i=it.create();return function(n,a,o){var s=this.array;L.set(t,s[0],s[1],s[2]),L.set(e,s[4],s[5],s[6]),L.set(r,s[8],s[9],s[10]);var l=L.length(t),u=L.length(e),f=L.length(r),h=this.determinant();h<0&&(l=-l),n&&n.set(l,u,f),o.set(s[12],s[13],s[14]),it.fromMat4(i,s),i[0]/=l,i[1]/=l,i[2]/=l,i[3]/=u,i[4]/=u,i[5]/=u,i[6]/=f,i[7]/=f,i[8]/=f,Z.fromMat3(a.array,i),Z.normalize(a.array,a.array),a._dirty=!0,o._dirty=!0}}(),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var Ul=Object.defineProperty;if(Ul){var Lc=q.prototype;Ul(Lc,"z",{get:function(){var t=this.array;return this._axisZ.set(t[8],t[9],t[10]),this._axisZ},set:function(t){var e=this.array;t=t.array,e[8]=t[0],e[9]=t[1],e[10]=t[2],this._dirty=!0}}),Ul(Lc,"y",{get:function(){var t=this.array;return this._axisY.set(t[4],t[5],t[6]),this._axisY},set:function(t){var e=this.array;t=t.array,e[4]=t[0],e[5]=t[1],e[6]=t[2],this._dirty=!0}}),Ul(Lc,"x",{get:function(){var t=this.array;return this._axisX.set(t[0],t[1],t[2]),this._axisX},set:function(t){var e=this.array;t=t.array,e[0]=t[0],e[1]=t[1],e[2]=t[2],this._dirty=!0}})}q.adjoint=function(t,e){return z.adjoint(t.array,e.array),t._dirty=!0,t};q.copy=function(t,e){return z.copy(t.array,e.array),t._dirty=!0,t};q.determinant=function(t){return z.determinant(t.array)};q.identity=function(t){return z.identity(t.array),t._dirty=!0,t};q.ortho=function(t,e,r,i,n,a,o){return z.ortho(t.array,e,r,i,n,a,o),t._dirty=!0,t};q.perspective=function(t,e,r,i,n){return z.perspective(t.array,e,r,i,n),t._dirty=!0,t};q.lookAt=function(t,e,r,i){return z.lookAt(t.array,e.array,r.array,i.array),t._dirty=!0,t};q.invert=function(t,e){return z.invert(t.array,e.array),t._dirty=!0,t};q.mul=function(t,e,r){return z.mul(t.array,e.array,r.array),t._dirty=!0,t};q.multiply=q.mul;q.fromQuat=function(t,e){return z.fromQuat(t.array,e.array),t._dirty=!0,t};q.fromRotationTranslation=function(t,e,r){return z.fromRotationTranslation(t.array,e.array,r.array),t._dirty=!0,t};q.fromMat2d=function(i,r){i._dirty=!0;var r=r.array,i=i.array;return i[0]=r[0],i[4]=r[2],i[12]=r[4],i[1]=r[1],i[5]=r[3],i[13]=r[5],i};q.rotate=function(t,e,r,i){return z.rotate(t.array,e.array,r,i.array),t._dirty=!0,t};q.rotateX=function(t,e,r){return z.rotateX(t.array,e.array,r),t._dirty=!0,t};q.rotateY=function(t,e,r){return z.rotateY(t.array,e.array,r),t._dirty=!0,t};q.rotateZ=function(t,e,r){return z.rotateZ(t.array,e.array,r),t._dirty=!0,t};q.scale=function(t,e,r){return z.scale(t.array,e.array,r.array),t._dirty=!0,t};q.transpose=function(t,e){return z.transpose(t.array,e.array),t._dirty=!0,t};q.translate=function(t,e,r){return z.translate(t.array,e.array,r.array),t._dirty=!0,t};var It=function(t,e,r,i){t=t||0,e=e||0,r=r||0,i=i===void 0?1:i,this.array=Z.fromValues(t,e,r,i),this._dirty=!0};It.prototype={constructor:It,add:function(t){return Z.add(this.array,this.array,t.array),this._dirty=!0,this},calculateW:function(){return Z.calculateW(this.array,this.array),this._dirty=!0,this},set:function(t,e,r,i){return this.array[0]=t,this.array[1]=e,this.array[2]=r,this.array[3]=i,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new It(this.x,this.y,this.z,this.w)},conjugate:function(){return Z.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(t){return Z.copy(this.array,t.array),this._dirty=!0,this},dot:function(t){return Z.dot(this.array,t.array)},fromMat3:function(t){return Z.fromMat3(this.array,t.array),this._dirty=!0,this},fromMat4:function(){var t=it.create();return function(e){return it.fromMat4(t,e.array),it.transpose(t,t),Z.fromMat3(this.array,t),this._dirty=!0,this}}(),identity:function(){return Z.identity(this.array),this._dirty=!0,this},invert:function(){return Z.invert(this.array,this.array),this._dirty=!0,this},len:function(){return Z.len(this.array)},length:function(){return Z.length(this.array)},lerp:function(t,e,r){return Z.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},mul:function(t){return Z.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return Z.multiply(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return Z.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return Z.multiply(this.array,t.array,this.array),this._dirty=!0,this},normalize:function(){return Z.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(t){return Z.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return Z.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return Z.rotateZ(this.array,this.array,t),this._dirty=!0,this},rotationTo:function(t,e){return Z.rotationTo(this.array,t.array,e.array),this._dirty=!0,this},setAxes:function(t,e,r){return Z.setAxes(this.array,t.array,e.array,r.array),this._dirty=!0,this},setAxisAngle:function(t,e){return Z.setAxisAngle(this.array,t.array,e),this._dirty=!0,this},slerp:function(t,e,r){return Z.slerp(this.array,t.array,e.array,r),this._dirty=!0,this},sqrLen:function(){return Z.sqrLen(this.array)},squaredLength:function(){return Z.squaredLength(this.array)},fromEuler:function(t,e){return It.fromEuler(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var Bo=Object.defineProperty;if(Bo){var Hl=It.prototype;Bo(Hl,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Bo(Hl,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),Bo(Hl,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),Bo(Hl,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}It.add=function(t,e,r){return Z.add(t.array,e.array,r.array),t._dirty=!0,t};It.set=function(t,e,r,i,n){Z.set(t.array,e,r,i,n),t._dirty=!0};It.copy=function(t,e){return Z.copy(t.array,e.array),t._dirty=!0,t};It.calculateW=function(t,e){return Z.calculateW(t.array,e.array),t._dirty=!0,t};It.conjugate=function(t,e){return Z.conjugate(t.array,e.array),t._dirty=!0,t};It.identity=function(t){return Z.identity(t.array),t._dirty=!0,t};It.invert=function(t,e){return Z.invert(t.array,e.array),t._dirty=!0,t};It.dot=function(t,e){return Z.dot(t.array,e.array)};It.len=function(t){return Z.length(t.array)};It.lerp=function(t,e,r,i){return Z.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};It.slerp=function(t,e,r,i){return Z.slerp(t.array,e.array,r.array,i),t._dirty=!0,t};It.mul=function(t,e,r){return Z.multiply(t.array,e.array,r.array),t._dirty=!0,t};It.multiply=It.mul;It.rotateX=function(t,e,r){return Z.rotateX(t.array,e.array,r),t._dirty=!0,t};It.rotateY=function(t,e,r){return Z.rotateY(t.array,e.array,r),t._dirty=!0,t};It.rotateZ=function(t,e,r){return Z.rotateZ(t.array,e.array,r),t._dirty=!0,t};It.setAxisAngle=function(t,e,r){return Z.setAxisAngle(t.array,e.array,r),t._dirty=!0,t};It.normalize=function(t,e){return Z.normalize(t.array,e.array),t._dirty=!0,t};It.sqrLen=function(t){return Z.sqrLen(t.array)};It.squaredLength=It.sqrLen;It.fromMat3=function(t,e){return Z.fromMat3(t.array,e.array),t._dirty=!0,t};It.setAxes=function(t,e,r,i){return Z.setAxes(t.array,e.array,r.array,i.array),t._dirty=!0,t};It.rotationTo=function(t,e,r){return Z.rotationTo(t.array,e.array,r.array),t._dirty=!0,t};It.fromEuler=function(t,e,f){t._dirty=!0,e=e.array;var i=t.array,n=Math.cos(e[0]/2),a=Math.cos(e[1]/2),o=Math.cos(e[2]/2),s=Math.sin(e[0]/2),l=Math.sin(e[1]/2),u=Math.sin(e[2]/2),f=(f||"XYZ").toUpperCase();switch(f){case"XYZ":i[0]=s*a*o+n*l*u,i[1]=n*l*o-s*a*u,i[2]=n*a*u+s*l*o,i[3]=n*a*o-s*l*u;break;case"YXZ":i[0]=s*a*o+n*l*u,i[1]=n*l*o-s*a*u,i[2]=n*a*u-s*l*o,i[3]=n*a*o+s*l*u;break;case"ZXY":i[0]=s*a*o-n*l*u,i[1]=n*l*o+s*a*u,i[2]=n*a*u+s*l*o,i[3]=n*a*o-s*l*u;break;case"ZYX":i[0]=s*a*o-n*l*u,i[1]=n*l*o+s*a*u,i[2]=n*a*u-s*l*o,i[3]=n*a*o+s*l*u;break;case"YZX":i[0]=s*a*o+n*l*u,i[1]=n*l*o+s*a*u,i[2]=n*a*u-s*l*o,i[3]=n*a*o-s*l*u;break;case"XZY":i[0]=s*a*o-n*l*u,i[1]=n*l*o-s*a*u,i[2]=n*a*u+s*l*o,i[3]=n*a*o+s*l*u;break}};var Ii=L.set,Vl=L.copy,ye=function(t,e){this.min=t||new B(1/0,1/0,1/0),this.max=e||new B(-1/0,-1/0,-1/0),this.vertices=null};ye.prototype={constructor:ye,updateFromVertices:function(t){if(t.length>0){var e=this.min,r=this.max,i=e.array,n=r.array;Vl(i,t[0]),Vl(n,t[0]);for(var a=1;a<t.length;a++){var o=t[a];o[0]<i[0]&&(i[0]=o[0]),o[1]<i[1]&&(i[1]=o[1]),o[2]<i[2]&&(i[2]=o[2]),o[0]>n[0]&&(n[0]=o[0]),o[1]>n[1]&&(n[1]=o[1]),o[2]>n[2]&&(n[2]=o[2])}e._dirty=!0,r._dirty=!0}},union:function(t){var e=this.min,r=this.max;return L.min(e.array,e.array,t.min.array),L.max(r.array,r.array,t.max.array),e._dirty=!0,r._dirty=!0,this},intersection:function(t){var e=this.min,r=this.max;return L.max(e.array,e.array,t.min.array),L.min(r.array,r.array,t.max.array),e._dirty=!0,r._dirty=!0,this},intersectBoundingBox:function(t){var e=this.min.array,r=this.max.array,i=t.min.array,n=t.max.array;return!(e[0]>n[0]||e[1]>n[1]||e[2]>n[2]||r[0]<i[0]||r[1]<i[1]||r[2]<i[2])},containBoundingBox:function(t){var e=this.min.array,r=this.max.array,i=t.min.array,n=t.max.array;return e[0]<=i[0]&&e[1]<=i[1]&&e[2]<=i[2]&&r[0]>=n[0]&&r[1]>=n[1]&&r[2]>=n[2]},containPoint:function(t){var e=this.min.array,r=this.max.array,i=t.array;return e[0]<=i[0]&&e[1]<=i[1]&&e[2]<=i[2]&&r[0]>=i[0]&&r[1]>=i[1]&&r[2]>=i[2]},isFinite:function(){var t=this.min.array,e=this.max.array;return isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])},applyTransform:function(t){this.transformFrom(this,t)},transformFrom:function(){var t=L.create(),e=L.create(),r=L.create(),i=L.create(),n=L.create(),a=L.create();return function(o,s){var l=o.min.array,u=o.max.array,f=s.array;return t[0]=f[0]*l[0],t[1]=f[1]*l[0],t[2]=f[2]*l[0],e[0]=f[0]*u[0],e[1]=f[1]*u[0],e[2]=f[2]*u[0],r[0]=f[4]*l[1],r[1]=f[5]*l[1],r[2]=f[6]*l[1],i[0]=f[4]*u[1],i[1]=f[5]*u[1],i[2]=f[6]*u[1],n[0]=f[8]*l[2],n[1]=f[9]*l[2],n[2]=f[10]*l[2],a[0]=f[8]*u[2],a[1]=f[9]*u[2],a[2]=f[10]*u[2],l=this.min.array,u=this.max.array,l[0]=Math.min(t[0],e[0])+Math.min(r[0],i[0])+Math.min(n[0],a[0])+f[12],l[1]=Math.min(t[1],e[1])+Math.min(r[1],i[1])+Math.min(n[1],a[1])+f[13],l[2]=Math.min(t[2],e[2])+Math.min(r[2],i[2])+Math.min(n[2],a[2])+f[14],u[0]=Math.max(t[0],e[0])+Math.max(r[0],i[0])+Math.max(n[0],a[0])+f[12],u[1]=Math.max(t[1],e[1])+Math.max(r[1],i[1])+Math.max(n[1],a[1])+f[13],u[2]=Math.max(t[2],e[2])+Math.max(r[2],i[2])+Math.max(n[2],a[2])+f[14],this.min._dirty=!0,this.max._dirty=!0,this}}(),applyProjection:function(t){var e=this.min.array,r=this.max.array,i=t.array,n=e[0],a=e[1],o=e[2],s=r[0],l=r[1],u=e[2],f=r[0],h=r[1],v=r[2];if(i[15]===1)e[0]=i[0]*n+i[12],e[1]=i[5]*a+i[13],r[2]=i[10]*o+i[14],r[0]=i[0]*f+i[12],r[1]=i[5]*h+i[13],e[2]=i[10]*v+i[14];else{var c=-1/o;e[0]=i[0]*n*c,e[1]=i[5]*a*c,r[2]=(i[10]*o+i[14])*c,c=-1/u,r[0]=i[0]*s*c,r[1]=i[5]*l*c,c=-1/v,e[2]=(i[10]*v+i[14])*c}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var t=this.vertices;if(!t){t=[];for(var e=0;e<8;e++)t[e]=L.fromValues(0,0,0);this.vertices=t}var r=this.min.array,i=this.max.array;return Ii(t[0],r[0],r[1],r[2]),Ii(t[1],r[0],i[1],r[2]),Ii(t[2],i[0],r[1],r[2]),Ii(t[3],i[0],i[1],r[2]),Ii(t[4],r[0],r[1],i[2]),Ii(t[5],r[0],i[1],i[2]),Ii(t[6],i[0],r[1],i[2]),Ii(t[7],i[0],i[1],i[2]),this},copy:function(t){var e=this.min,r=this.max;return Vl(e.array,t.min.array),Vl(r.array,t.max.array),e._dirty=!0,r._dirty=!0,this},clone:function(){var t=new ye;return t.copy(this),t}};var lO=0,ti=Se.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},function(){this.name||(this.name=(this.type||"NODE")+"_"+lO++),this.position||(this.position=new B),this.rotation||(this.rotation=new It),this.scale||(this.scale=new B(1,1,1)),this.worldTransform=new q,this.localTransform=new q,this._children=[]},{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(t){var e=this._scene;if(e){var r=e._nodeRepository;delete r[this.name],r[t]=this}this.name=t},add:function(t){var e=t._parent;if(e!==this){e&&e.remove(t),t._parent=this,this._children.push(t);var r=this._scene;r&&r!==t.scene&&t.traverse(this._addSelfToScene,this),t._needsUpdateWorldTransform=!0}},remove:function(t){var e=this._children,r=e.indexOf(t);r<0||(e.splice(r,1),t._parent=null,this._scene&&t.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var t=this._children,e=0;e<t.length;e++)t[e]._parent=null,this._scene&&t[e].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(t){t._scene.removeFromScene(t),t._scene=null},_addSelfToScene:function(t){this._scene.addToScene(t),t._scene=this._scene},isAncestor:function(t){for(var e=t._parent;e;){if(e===this)return!0;e=e._parent}return!1},children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},getChildByName:function(t){for(var e=this._children,r=0;r<e.length;r++)if(e[r].name===t)return e[r]},getDescendantByName:function(t){for(var e=this._children,r=0;r<e.length;r++){var i=e[r];if(i.name===t)return i;var n=i.getDescendantByName(t);if(n)return n}},queryNode:function(t){if(t){for(var e=t.split("/"),r=this,i=0;i<e.length;i++){var n=e[i];if(n){for(var a=!1,o=r._children,s=0;s<o.length;s++){var l=o[s];if(l.name===n){r=l,a=!0;break}}if(!a)return}}return r}},getPath:function(t){if(!this._parent)return"/";for(var e=this._parent,r=this.name;e._parent&&(r=e.name+"/"+r,e._parent!=t);)e=e._parent;return!e._parent&&t?null:r},traverse:function(t,e){t.call(e,this);for(var r=this._children,i=0,n=r.length;i<n;i++)r[i].traverse(t,e)},eachChild:function(t,e){for(var r=this._children,i=0,n=r.length;i<n;i++){var a=r[i];t.call(e,a,i)}},setLocalTransform:function(t){z.copy(this.localTransform.array,t.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(t){var e=t?null:this.scale;this.localTransform.decomposeMatrix(e,this.rotation,this.position)},setWorldTransform:function(t){z.copy(this.worldTransform.array,t.array),this.decomposeWorldTransform()},decomposeWorldTransform:function(){var t=z.create();return function(e){var r=this.localTransform,i=this.worldTransform;this._parent?(z.invert(t,this._parent.worldTransform.array),z.multiply(r.array,t,i.array)):z.copy(r.array,i.array);var n=e?null:this.scale;r.decomposeMatrix(n,this.rotation,this.position)}}(),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var t=this.position,e=this.rotation,r=this.scale;if(this.transformNeedsUpdate()){var i=this.localTransform.array;z.fromRotationTranslation(i,e.array,t.array),z.scale(i,i,r.array),e._dirty=!1,r._dirty=!1,t._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var t=this.localTransform.array,e=this.worldTransform.array;this._parent?z.multiplyAffine(e,this._parent.worldTransform.array,t):z.copy(e,t)},updateWorldTransform:function(){for(var t=this;t&&t.getParent()&&t.getParent().transformNeedsUpdate();)t=t.getParent();t.update()},update:function(t){this.autoUpdateLocalTransform?this.updateLocalTransform():t=!0,(t||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),t=!0,this._needsUpdateWorldTransform=!1);for(var e=this._children,r=0,i=e.length;r<i;r++)e[r].update(t)},getBoundingBox:function(){function t(n){return!n.invisible&&n.geometry}var e=new ye,r=new q,i=new q;return function(n,a){return a=a||new ye,this._parent?q.invert(i,this._parent.worldTransform):q.identity(i),this.traverse(function(o){o.geometry&&o.geometry.boundingBox&&(e.copy(o.geometry.boundingBox),q.multiply(r,i,o.worldTransform),e.applyTransform(r),a.union(e))},this,t),a}}(),getWorldPosition:function(t){this.transformNeedsUpdate()&&this.updateWorldTransform();var e=this.worldTransform.array;if(t){var r=t.array;return r[0]=e[12],r[1]=e[13],r[2]=e[14],t}else return new B(e[12],e[13],e[14])},clone:function(){var t=new this.constructor,e=this._children;t.setName(this.name),t.position.copy(this.position),t.rotation.copy(this.rotation),t.scale.copy(this.scale);for(var r=0;r<e.length;r++)t.add(e[r].clone());return t},rotateAround:function(){var t=new B,e=new q;return function(r,i,n){t.copy(this.position).subtract(r);var a=this.localTransform;a.identity(),a.translate(r),a.rotate(n,i),e.fromRotationTranslation(this.rotation,t),a.multiply(e),a.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}}(),lookAt:function(){var t=new q;return function(e,r){t.lookAt(this.position,e,r||this.localTransform.y).invert(),this.setLocalTransform(t),this.target=e}}()}),Ue=ti.extend({material:null,geometry:null,mode:F.TRIANGLES,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:F.BACK,frontFace:F.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(t){},afterRender:function(t,e){},getBoundingBox:function(t,e){return e=ti.prototype.getBoundingBox.call(this,t,e),this.geometry&&this.geometry.boundingBox&&e.union(this.geometry.boundingBox),e},clone:function(){var t=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"];return function(){var e=ti.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var r=0;r<t.length;r++){var i=t[r];e[i]!==this[i]&&(e[i]=this[i])}return e}}()});Ue.POINTS=F.POINTS;Ue.LINES=F.LINES;Ue.LINE_LOOP=F.LINE_LOOP;Ue.LINE_STRIP=F.LINE_STRIP;Ue.TRIANGLES=F.TRIANGLES;Ue.TRIANGLE_STRIP=F.TRIANGLE_STRIP;Ue.TRIANGLE_FAN=F.TRIANGLE_FAN;Ue.BACK=F.BACK;Ue.FRONT=F.FRONT;Ue.FRONT_AND_BACK=F.FRONT_AND_BACK;Ue.CW=F.CW;Ue.CCW=F.CCW;var Up=Se.extend({scene:null,camera:null,renderer:null},function(){this._ray=new Zn,this._ndc=new st},{pick:function(t,e,r){var i=this.pickAll(t,e,[],r);return i[0]||null},pickAll:function(t,e,r,i){return this.renderer.screenToNDC(t,e,this._ndc),this.camera.castRay(this._ndc,this._ray),r=r||[],this._intersectNode(this.scene,r,i||!1),r.sort(this._intersectionCompareFunc),r},_intersectNode:function(t,e,r){t instanceof Ue&&t.isRenderable()&&(!t.ignorePicking||r)&&(t.mode===F.TRIANGLES&&t.geometry.isUseIndices()||t.geometry.pickByRay||t.geometry.pick)&&this._intersectRenderable(t,e);for(var i=0;i<t._children.length;i++)this._intersectNode(t._children[i],e,r)},_intersectRenderable:function(){var t=new B,e=new B,r=new B,i=new Zn,n=new q;return function(a,o){var s=a.isSkinnedMesh();i.copy(this._ray),q.invert(n,a.worldTransform),s||i.applyTransform(n);var l=a.geometry,u=s?a.skeleton.boundingBox:l.boundingBox;if(!(u&&!i.intersectBoundingBox(u))){if(l.pick){l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,a,o);return}else if(l.pickByRay){l.pickByRay(i,a,o);return}var f=a.cullFace===F.BACK&&a.frontFace===F.CCW||a.cullFace===F.FRONT&&a.frontFace===F.CW,h,v=l.indices,c=l.attributes.position,d=l.attributes.weight,p=l.attributes.joint,g,m=[];if(!(!c||!c.value||!v)){if(s){g=a.skeleton.getSubSkinMatrices(a.__uid__,a.joints);for(var _=0;_<a.joints.length;_++){m[_]=m[_]||[];for(var y=0;y<16;y++)m[_][y]=g[_*16+y]}var x=[],S=[],T=[],w=[],b=[],A=l.attributes.skinnedPosition;(!A||!A.value)&&(l.createAttribute("skinnedPosition","f",3),A=l.attributes.skinnedPosition,A.init(l.vertexCount));for(var _=0;_<l.vertexCount;_++){c.get(_,x),d.get(_,S),p.get(_,T),S[3]=1-S[0]-S[1]-S[2],L.set(w,0,0,0);for(var y=0;y<4;y++)T[y]>=0&&S[y]>1e-4&&(L.transformMat4(b,x,m[T[y]]),L.scaleAndAdd(w,w,b,S[y]));A.set(_,w)}}for(var _=0;_<v.length;_+=3){var M=v[_],E=v[_+1],D=v[_+2],R=s?l.attributes.skinnedPosition:c;if(R.get(M,t.array),R.get(E,e.array),R.get(D,r.array),f?h=i.intersectTriangle(t,e,r,a.culling):h=i.intersectTriangle(t,r,e,a.culling),h){var P=new B;s?B.copy(P,h):B.transformMat4(P,h,a.worldTransform),o.push(new Up.Intersection(h,P,a,[M,E,D],_/3,B.dist(P,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(t,e){return t.distance-e.distance}});Up.Intersection=function(t,e,r,i,n,a){this.point=t,this.pointWorld=e,this.target=r,this.triangle=i,this.triangleIndex=n,this.distance=a};var Fo="__dt__",ro=function(){this._contextId=0,this._caches=[],this._context={}};ro.prototype={use:function(t,e){var r=this._caches;r[t]||(r[t]={},e&&(r[t]=e())),this._contextId=t,this._context=r[t]},put:function(t,e){this._context[t]=e},get:function(t){return this._context[t]},dirty:function(t){t=t||"";var e=Fo+t;this.put(e,!0)},dirtyAll:function(t){t=t||"";for(var e=Fo+t,r=this._caches,i=0;i<r.length;i++)r[i]&&(r[i][e]=!0)},fresh:function(t){t=t||"";var e=Fo+t;this.put(e,!1)},freshAll:function(t){t=t||"";for(var e=Fo+t,r=this._caches,i=0;i<r.length;i++)r[i]&&(r[i][e]=!1)},isDirty:function(t){t=t||"";var e=Fo+t,r=this._context;return!r.hasOwnProperty(e)||r[e]===!0},deleteContext:function(t){delete this._caches[t],this._context={}},delete:function(t){delete this._context[t]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(t,e){var r=Object.keys(this._caches);r.forEach(function(i){t&&t.call(e,i)})},miss:function(t){return!this._context.hasOwnProperty(t)}};ro.prototype.constructor=ro;var W=Se.extend({width:512,height:512,type:F.UNSIGNED_BYTE,format:F.RGBA,wrapS:F.REPEAT,wrapT:F.REPEAT,minFilter:F.LINEAR_MIPMAP_LINEAR,magFilter:F.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},function(){this._cache=new ro},{getWebGLTexture:function(t){var e=t.gl,r=this._cache;return r.use(t.__uid__),r.miss("webgl_texture")&&r.put("webgl_texture",e.createTexture()),this.dynamic?this.update(t):r.isDirty()&&(this.update(t),r.fresh()),r.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(t){},updateCommon:function(t){var e=t.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===F.DEPTH_COMPONENT&&(this.useMipmap=!1);var r=t.getGLExtension("EXT_sRGB");this.format===W.SRGB&&!r&&(this.format=W.RGB),this.format===W.SRGB_ALPHA&&!r&&(this.format=W.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?F.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?F.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var t=this.minFilter;return this.NPOT||!this.useMipmap?t===F.NEAREST_MIPMAP_NEAREST||t===F.NEAREST_MIPMAP_LINEAR?F.NEAREST:t===F.LINEAR_MIPMAP_LINEAR||t===F.LINEAR_MIPMAP_NEAREST?F.LINEAR:t:t},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(t){--t;for(var e=1;e<32;e<<=1)t=t|t>>e;return t+1},dispose:function(t){var e=this._cache;e.use(t.__uid__);var r=e.get("webgl_texture");r&&t.gl.deleteTexture(r),e.deleteContext(t.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(W.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}});Object.defineProperty(W.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}});W.BYTE=F.BYTE;W.UNSIGNED_BYTE=F.UNSIGNED_BYTE;W.SHORT=F.SHORT;W.UNSIGNED_SHORT=F.UNSIGNED_SHORT;W.INT=F.INT;W.UNSIGNED_INT=F.UNSIGNED_INT;W.FLOAT=F.FLOAT;W.HALF_FLOAT=36193;W.UNSIGNED_INT_24_8_WEBGL=34042;W.DEPTH_COMPONENT=F.DEPTH_COMPONENT;W.DEPTH_STENCIL=F.DEPTH_STENCIL;W.ALPHA=F.ALPHA;W.RGB=F.RGB;W.RGBA=F.RGBA;W.LUMINANCE=F.LUMINANCE;W.LUMINANCE_ALPHA=F.LUMINANCE_ALPHA;W.SRGB=35904;W.SRGB_ALPHA=35906;W.COMPRESSED_RGB_S3TC_DXT1_EXT=33776;W.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777;W.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778;W.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779;W.NEAREST=F.NEAREST;W.LINEAR=F.LINEAR;W.NEAREST_MIPMAP_NEAREST=F.NEAREST_MIPMAP_NEAREST;W.LINEAR_MIPMAP_NEAREST=F.LINEAR_MIPMAP_NEAREST;W.NEAREST_MIPMAP_LINEAR=F.NEAREST_MIPMAP_LINEAR;W.LINEAR_MIPMAP_LINEAR=F.LINEAR_MIPMAP_LINEAR;W.REPEAT=F.REPEAT;W.CLAMP_TO_EDGE=F.CLAMP_TO_EDGE;W.MIRRORED_REPEAT=F.MIRRORED_REPEAT;var Ve=Ue.extend({skeleton:null,joints:null},function(){this.joints||(this.joints=[])},{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var t=Ue.prototype.clone.call(this);return t.skeleton=this.skeleton,this.joints&&(t.joints=this.joints.slice()),t}});Ve.POINTS=F.POINTS;Ve.LINES=F.LINES;Ve.LINE_LOOP=F.LINE_LOOP;Ve.LINE_STRIP=F.LINE_STRIP;Ve.TRIANGLES=F.TRIANGLES;Ve.TRIANGLE_STRIP=F.TRIANGLE_STRIP;Ve.TRIANGLE_FAN=F.TRIANGLE_FAN;Ve.BACK=F.BACK;Ve.FRONT=F.FRONT;Ve.FRONT_AND_BACK=F.FRONT_AND_BACK;Ve.CW=F.CW;Ve.CCW=F.CCW;var $s={};$s.isPowerOfTwo=function(t){return(t&t-1)===0};$s.nextPowerOfTwo=function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t};$s.nearestPowerOfTwo=function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))};var G_=$s.isPowerOfTwo;function W_(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function uO(t,e){var r=W_(t.width),i=W_(t.height);e=e||document.createElement("canvas"),e.width=r,e.height=i;var n=e.getContext("2d");return n.drawImage(t.image,0,0,r,i),e}var At=W.extend(function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}},{textureType:"texture2D",update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(t);var r=this.format,i=this.type,n=!!(this.convertToPOT&&!this.mipmaps.length&&this.image&&(this.wrapS===W.REPEAT||this.wrapT===W.REPEAT)&&this.NPOT);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n?this.wrapS:this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n?this.wrapT:this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n?this.magFilter:this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n?this.minFilter:this.getAvailableMinFilter());var a=t.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),i===36193){var o=t.getGLExtension("OES_texture_half_float");o||(i=F.FLOAT)}if(this.mipmaps.length)for(var s=this.width,l=this.height,u=0;u<this.mipmaps.length;u++){var f=this.mipmaps[u];this._updateTextureData(e,f,u,s,l,r,i,!1),s/=2,l/=2}else this._updateTextureData(e,this,0,this.width,this.height,r,i,n),this.useMipmap&&(!this.NPOT||n)&&e.generateMipmap(e.TEXTURE_2D);e.bindTexture(e.TEXTURE_2D,null)},_updateTextureData:function(t,e,r,i,n,a,o,s){if(e.image){var l=e.image;s&&(this._potCanvas=uO(this,this._potCanvas),l=this._potCanvas),t.texImage2D(t.TEXTURE_2D,r,a,a,o,l)}else a<=W.COMPRESSED_RGBA_S3TC_DXT5_EXT&&a>=W.COMPRESSED_RGB_S3TC_DXT1_EXT?t.compressedTexImage2D(t.TEXTURE_2D,r,a,i,n,0,e.pixels):t.texImage2D(t.TEXTURE_2D,r,a,i,n,0,a,o,e.pixels)},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_2D))},isPowerOfTwo:function(){return G_(this.width)&&G_(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!!(this.width&&this.height)},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,null)},load:function(t,e){var r=Ct.createImage();e&&(r.crossOrigin=e);var i=this;return r.onload=function(){i.dirty(),i.trigger("success",i)},r.onerror=function(){i.trigger("error",i)},r.src=t,this.image=r,this}});Object.defineProperty(At.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(t){this.image?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}});Object.defineProperty(At.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(t){this.image?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}});function xw(t){return{byte:Ct.Int8Array,ubyte:Ct.Uint8Array,short:Ct.Int16Array,ushort:Ct.Uint16Array}[t]||Ct.Float32Array}function Rc(t){return"attr_"+t}function io(t,e,r,i){switch(this.name=t,this.type=e,this.size=r,this.semantic=i||"",this.value=null,r){case 1:this.get=function(n){return this.value[n]},this.set=function(n,a){this.value[n]=a},this.copy=function(n,a){this.value[n]=this.value[n]};break;case 2:this.get=function(n,a){var o=this.value;return a[0]=o[n*2],a[1]=o[n*2+1],a},this.set=function(n,a){var o=this.value;o[n*2]=a[0],o[n*2+1]=a[1]},this.copy=function(n,a){var o=this.value;a*=2,n*=2,o[n]=o[a],o[n+1]=o[a+1]};break;case 3:this.get=function(n,a){var o=n*3,s=this.value;return a[0]=s[o],a[1]=s[o+1],a[2]=s[o+2],a},this.set=function(n,a){var o=n*3,s=this.value;s[o]=a[0],s[o+1]=a[1],s[o+2]=a[2]},this.copy=function(n,a){var o=this.value;a*=3,n*=3,o[n]=o[a],o[n+1]=o[a+1],o[n+2]=o[a+2]};break;case 4:this.get=function(n,a){var o=this.value,s=n*4;return a[0]=o[s],a[1]=o[s+1],a[2]=o[s+2],a[3]=o[s+3],a},this.set=function(n,a){var o=this.value,s=n*4;o[s]=a[0],o[s+1]=a[1],o[s+2]=a[2],o[s+3]=a[3]},this.copy=function(n,a){var o=this.value;a*=4,n*=4,o[n]=o[a],o[n+1]=o[a+1],o[n+2]=o[a+2],o[n+3]=o[a+3]}}}io.prototype.init=function(t){if(!this.value||this.value.length!==t*this.size){var e=xw(this.type);this.value=new e(t*this.size)}};io.prototype.fromArray=function(t){var e=xw(this.type),r;if(t[0]&&t[0].length){var i=0,n=this.size;r=new e(t.length*n);for(var a=0;a<t.length;a++)for(var o=0;o<n;o++)r[i++]=t[a][o]}else r=new e(t);this.value=r};io.prototype.clone=function(t){var e=new io(this.name,this.type,this.size,this.semantic);return t&&console.warn("todo"),e};function Tw(t,e,r,i,n){this.name=t,this.type=e,this.buffer=r,this.size=i,this.semantic=n,this.symbol="",this.needsRemove=!1}function Sw(t){this.buffer=t,this.count=0}var He=Se.extend(function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}},function(){this._cache=new ro,this._attributeList=Object.keys(this.attributes),this.__vaoCache={}},{mainAttribute:"",pick:null,pickByRay:null,dirty:function(){for(var t=this.getEnabledAttributes(),e=0;e<t.length;e++)this.dirtyAttribute(t[e]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(t){this._cache.dirtyAll(Rc(t)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(t,e){if(t<this.triangleCount&&t>=0){e||(e=[]);var r=this.indices;return e[0]=r[t*3],e[1]=r[t*3+1],e[2]=r[t*3+2],e}},setTriangleIndices:function(t,e){var r=this.indices;r[t*3]=e[0],r[t*3+1]=e[1],r[t*3+2]=e[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(t){var e,r=this.vertexCount>65535?Ct.Uint32Array:Ct.Uint16Array;if(t[0]&&t[0].length){var i=0,n=3;e=new r(t.length*n);for(var a=0;a<t.length;a++)for(var o=0;o<n;o++)e[i++]=t[a][o]}else e=new r(t);this.indices=e},createAttribute:function(t,e,r,i){var n=new io(t,e,r,i);return this.attributes[t]&&this.removeAttribute(t),this.attributes[t]=n,this._attributeList.push(t),n},removeAttribute:function(t){var e=this._attributeList,r=e.indexOf(t);return r>=0?(e.splice(r,1),delete this.attributes[t],!0):!1},getAttribute:function(t){return this.attributes[t]},getEnabledAttributes:function(){var t=this._enabledAttributes,e=this._attributeList;if(t)return t;for(var r=[],i=this.vertexCount,n=0;n<e.length;n++){var a=e[n],o=this.attributes[a];o.value&&o.value.length===i*o.size&&r.push(a)}return this._enabledAttributes=r,r},getBufferChunks:function(t){var e=this._cache;e.use(t.__uid__);var r=e.isDirty("attributes"),i=e.isDirty("indices");if(r||i){this._updateBuffer(t.gl,r,i);for(var n=this.getEnabledAttributes(),a=0;a<n.length;a++)e.fresh(Rc(n[a]));e.fresh("attributes"),e.fresh("indices")}return e.fresh("any"),e.get("chunks")},_updateBuffer:function(t,e,r){var i=this._cache,n=i.get("chunks"),a=!1;n||(n=[],n[0]={attributeBuffers:[],indicesBuffer:null},i.put("chunks",n),a=!0);var o=n[0],s=o.attributeBuffers,l=o.indicesBuffer;if(e||a){var u=this.getEnabledAttributes(),f={};if(!a)for(var h=0;h<s.length;h++)f[s[h].name]=s[h];for(var v=0;v<u.length;v++){var c=u[v],d=this.attributes[c],p;a||(p=f[c]);var g;p?g=p.buffer:g=t.createBuffer(),i.isDirty(Rc(c))&&(t.bindBuffer(t.ARRAY_BUFFER,g),t.bufferData(t.ARRAY_BUFFER,d.value,this.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW)),s[v]=new Tw(c,d.type,g,d.size,d.semantic)}for(var h=v;h<s.length;h++)t.deleteBuffer(s[h].buffer);s.length=v}this.isUseIndices()&&(r||a)&&(l||(l=new Sw(t.createBuffer()),o.indicesBuffer=l),l.count=this.indices.length,t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,l.buffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW))},dispose:function(t){var e=this._cache;e.use(t.__uid__);var r=e.get("chunks");if(r)for(var i=0;i<r.length;i++){for(var n=r[i],a=0;a<n.attributeBuffers.length;a++){var o=n.attributeBuffers[a];t.gl.deleteBuffer(o.buffer)}n.indicesBuffer&&t.gl.deleteBuffer(n.indicesBuffer.buffer)}if(this.__vaoCache){var s=t.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},e.deleteContext(t.__uid__)}});Object.defineProperty&&(Object.defineProperty(He.prototype,"vertexCount",{enumerable:!1,get:function(){var t=this.attributes[this.mainAttribute];return t||(t=this.attributes[this._attributeList[0]]),!t||!t.value?0:t.value.length/t.size}}),Object.defineProperty(He.prototype,"triangleCount",{enumerable:!1,get:function(){var t=this.indices;return t?t.length/3:0}}));He.STATIC_DRAW=F.STATIC_DRAW;He.DYNAMIC_DRAW=F.DYNAMIC_DRAW;He.STREAM_DRAW=F.STREAM_DRAW;He.AttributeBuffer=Tw;He.IndicesBuffer=Sw;He.Attribute=io;var Le=L.create,xa=L.add,wn=L.set,Yr=He.Attribute,Ut=He.extend(function(){return{attributes:{position:new Yr("position","float",3,"POSITION"),texcoord0:new Yr("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new Yr("texcoord1","float",2,"TEXCOORD_1"),normal:new Yr("normal","float",3,"NORMAL"),tangent:new Yr("tangent","float",4,"TANGENT"),color:new Yr("color","float",4,"COLOR"),weight:new Yr("weight","float",3,"WEIGHT"),joint:new Yr("joint","float",4,"JOINT"),barycentric:new Yr("barycentric","float",3,null)},boundingBox:null}},{mainAttribute:"position",updateBoundingBox:function(){var t=this.boundingBox;t||(t=this.boundingBox=new ye);var e=this.attributes.position.value;if(e&&e.length){var r=t.min,i=t.max,n=r.array,a=i.array;L.set(n,e[0],e[1],e[2]),L.set(a,e[0],e[1],e[2]);for(var o=3;o<e.length;){var s=e[o++],l=e[o++],u=e[o++];s<n[0]&&(n[0]=s),l<n[1]&&(n[1]=l),u<n[2]&&(n[2]=u),s>a[0]&&(a[0]=s),l>a[1]&&(a[1]=l),u>a[2]&&(a[2]=u)}r._dirty=!0,i._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var t=this.indices,e=this.attributes,r=e.position.value,i=e.normal.value;if(!i||i.length!==r.length)i=e.normal.value=new Ct.Float32Array(r.length);else for(var n=0;n<i.length;n++)i[n]=0;for(var a=Le(),o=Le(),s=Le(),l=Le(),u=Le(),f=Le(),h=t?t.length:this.vertexCount,v,c,d,p=0;p<h;){t?(v=t[p++],c=t[p++],d=t[p++]):(v=p++,c=p++,d=p++),wn(a,r[v*3],r[v*3+1],r[v*3+2]),wn(o,r[c*3],r[c*3+1],r[c*3+2]),wn(s,r[d*3],r[d*3+1],r[d*3+2]),L.sub(l,a,o),L.sub(u,o,s),L.cross(f,l,u);for(var n=0;n<3;n++)i[v*3+n]=i[v*3+n]+f[n],i[c*3+n]=i[c*3+n]+f[n],i[d*3+n]=i[d*3+n]+f[n]}for(var n=0;n<i.length;)wn(f,i[n],i[n+1],i[n+2]),L.normalize(f,f),i[n++]=f[0],i[n++]=f[1],i[n++]=f[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var t=this.indices,e=this.attributes,r=e.position.value,i=e.normal.value,n=Le(),a=Le(),o=Le(),s=Le(),l=Le(),u=Le();i||(i=e.normal.value=new Float32Array(r.length));for(var f=t?t.length:this.vertexCount,h,v,c,d=0;d<f;){t?(h=t[d++],v=t[d++],c=t[d++]):(h=d++,v=d++,c=d++),wn(n,r[h*3],r[h*3+1],r[h*3+2]),wn(a,r[v*3],r[v*3+1],r[v*3+2]),wn(o,r[c*3],r[c*3+1],r[c*3+2]),L.sub(s,n,a),L.sub(l,a,o),L.cross(u,s,l),L.normalize(u,u);for(var p=0;p<3;p++)i[h*3+p]=u[p],i[v*3+p]=u[p],i[c*3+p]=u[p]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var t=this.vertexCount,e=this.attributes;e.tangent.value||(e.tangent.value=new Float32Array(t*4));var r=e.texcoord0.value,i=e.position.value,n=e.tangent.value,a=e.normal.value;if(!r){console.warn("Geometry without texcoords can't generate tangents.");return}for(var o=[],s=[],l=0;l<t;l++)o[l]=[0,0,0],s[l]=[0,0,0];for(var u=[0,0,0],f=[0,0,0],h=this.indices,v=h?h.length:this.vertexCount,c,d,p,l=0;l<v;){h?(c=h[l++],d=h[l++],p=h[l++]):(c=l++,d=l++,p=l++);var g=r[c*2],m=r[d*2],_=r[p*2],y=r[c*2+1],x=r[d*2+1],S=r[p*2+1],T=i[c*3],w=i[d*3],b=i[p*3],A=i[c*3+1],M=i[d*3+1],E=i[p*3+1],D=i[c*3+2],R=i[d*3+2],P=i[p*3+2],I=w-T,N=b-T,V=M-A,O=E-A,X=R-D,G=P-D,lt=m-g,J=_-g,ot=x-y,at=S-y,Dt=1/(lt*at-ot*J);u[0]=(at*I-ot*N)*Dt,u[1]=(at*V-ot*O)*Dt,u[2]=(at*X-ot*G)*Dt,f[0]=(lt*N-J*I)*Dt,f[1]=(lt*O-J*V)*Dt,f[2]=(lt*G-J*X)*Dt,xa(o[c],o[c],u),xa(o[d],o[d],u),xa(o[p],o[p],u),xa(s[c],s[c],f),xa(s[d],s[d],f),xa(s[p],s[p],f)}for(var pt=Le(),Ot=Le(),Ht=Le(),l=0;l<t;l++){Ht[0]=a[l*3],Ht[1]=a[l*3+1],Ht[2]=a[l*3+2];var Nt=o[l];L.scale(pt,Ht,L.dot(Ht,Nt)),L.sub(pt,Nt,pt),L.normalize(pt,pt),L.cross(Ot,Ht,Nt),n[l*4]=pt[0],n[l*4+1]=pt[1],n[l*4+2]=pt[2],n[l*4+3]=L.dot(Ot,s[l])<0?-1:1}this.dirty()}},isUniqueVertex:function(){return this.isUseIndices()?this.vertexCount===this.indices.length:!0},generateUniqueVertex:function(){if(!(!this.vertexCount||!this.indices)){this.indices.length>65535&&(this.indices=new Ct.Uint32Array(this.indices));for(var t=this.attributes,e=this.indices,r=this.getEnabledAttributes(),i={},n=0;n<r.length;n++){var a=r[n];i[a]=t[a].value,t[a].init(this.indices.length)}for(var o=0,s=0;s<e.length;s++){for(var l=e[s],n=0;n<r.length;n++)for(var a=r[n],u=t[a].value,f=t[a].size,h=0;h<f;h++)u[o*f+h]=i[a][l*f+h];e[s]=o,o++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var t=this.attributes,e=t.barycentric.value,r=this.indices;if(!(e&&e.length===r.length*3)){e=t.barycentric.value=new Float32Array(r.length*3);for(var i=0;i<(r?r.length:this.vertexCount/3);)for(var n=0;n<3;n++){var a=r?r[i++]:i*3+n;e[a*3+n]=1}this.dirty()}}},applyTransform:function(t){var e=this.attributes,r=e.position.value,i=e.normal.value,n=e.tangent.value;t=t.array;var a=z.create();z.invert(a,t),z.transpose(a,a);var o=L.transformMat4,s=L.forEach;s(r,3,0,null,o,t),i&&s(i,3,0,null,o,a),n&&s(n,4,0,null,o,a),this.boundingBox&&this.updateBoundingBox()},dispose:function(t){var e=this._cache;e.use(t.__uid__);var r=e.get("chunks");if(r)for(var i=0;i<r.length;i++){for(var n=r[i],a=0;a<n.attributeBuffers.length;a++){var o=n.attributeBuffers[a];t.gl.deleteBuffer(o.buffer)}n.indicesBuffer&&t.gl.deleteBuffer(n.indicesBuffer.buffer)}if(this.__vaoCache){var s=t.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},e.deleteContext(t.__uid__)}});Ut.STATIC_DRAW=He.STATIC_DRAW;Ut.DYNAMIC_DRAW=He.DYNAMIC_DRAW;Ut.STREAM_DRAW=He.STREAM_DRAW;Ut.AttributeBuffer=He.AttributeBuffer;Ut.IndicesBuffer=He.IndicesBuffer;Ut.Attribute=Yr;const fO=`vec3 calcAmbientSHLight(int idx, vec3 N) {
int offset = 9 * idx;
return ambientSHLightCoefficients[0]
+ ambientSHLightCoefficients[1] * N.x
+ ambientSHLightCoefficients[2] * N.y
+ ambientSHLightCoefficients[3] * N.z
+ ambientSHLightCoefficients[4] * N.x * N.z
+ ambientSHLightCoefficients[5] * N.z * N.y
+ ambientSHLightCoefficients[6] * N.y * N.x
+ ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)
+ ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);
}`;var Mr="uniform vec3 ",ko="uniform float ",Ta="@export clay.header.",Sa="@end",ge=":unconfigurable;";const hO=[Ta+"directional_light",Mr+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+ge,Mr+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+ge,Sa,Ta+"ambient_light",Mr+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+ge,Sa,Ta+"ambient_sh_light",Mr+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+ge,Mr+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+ge,fO,Sa,Ta+"ambient_cubemap_light",Mr+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+ge,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+ge,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+ge,Sa,Ta+"point_light",Mr+"pointLightPosition[POINT_LIGHT_COUNT]"+ge,ko+"pointLightRange[POINT_LIGHT_COUNT]"+ge,Mr+"pointLightColor[POINT_LIGHT_COUNT]"+ge,Sa,Ta+"spot_light",Mr+"spotLightPosition[SPOT_LIGHT_COUNT]"+ge,Mr+"spotLightDirection[SPOT_LIGHT_COUNT]"+ge,ko+"spotLightRange[SPOT_LIGHT_COUNT]"+ge,ko+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+ge,ko+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+ge,ko+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+ge,Mr+"spotLightColor[SPOT_LIGHT_COUNT]"+ge,Sa].join(`
`);$.import(hO);var Fr=ti.extend(function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}},{type:"",clone:function(){var t=ti.prototype.clone.call(this);return t.color=Array.prototype.slice.call(this.color),t.intensity=this.intensity,t.castShadow=this.castShadow,t.shadowResolution=this.shadowResolution,t}}),ps=function(t,e){this.normal=t||new B(0,1,0),this.distance=e||0};ps.prototype={constructor:ps,distanceToPoint:function(t){return L.dot(t.array,this.normal.array)-this.distance},projectPoint:function(t,e){e||(e=new B);var r=this.distanceToPoint(t);return L.scaleAndAdd(e.array,t.array,this.normal.array,-r),e._dirty=!0,e},normalize:function(){var t=1/L.len(this.normal.array);L.scale(this.normal.array,t),this.distance*=t},intersectFrustum:function(t){for(var e=t.vertices,r=this.normal.array,i=L.dot(e[0].array,r)>this.distance,n=1;n<8;n++)if(L.dot(e[n].array,r)>this.distance!=i)return!0},intersectLine:function(){var t=L.create();return function(e,r,i){var n=this.distanceToPoint(e),a=this.distanceToPoint(r);if(n>0&&a>0||n<0&&a<0)return null;var o=this.normal.array,s=this.distance,l=e.array;L.sub(t,r.array,e.array),L.normalize(t,t);var u=L.dot(o,t);if(u===0)return null;i||(i=new B);var f=(L.dot(o,l)-s)/u;return L.scaleAndAdd(i.array,l,t,-f),i._dirty=!0,i}}(),applyTransform:function(){var t=z.create(),e=k.create(),r=k.create();return r[3]=1,function(i){i=i.array,L.scale(r,this.normal.array,this.distance),k.transformMat4(r,r,i),this.distance=L.dot(r,this.normal.array),z.invert(t,i),z.transpose(t,t),e[3]=0,L.copy(e,this.normal.array),k.transformMat4(e,e,t),L.copy(this.normal.array,e)}}(),copy:function(t){L.copy(this.normal.array,t.normal.array),this.normal._dirty=!0,this.distance=t.distance},clone:function(){var t=new ps;return t.copy(this),t}};var ie=L.set,X_=L.copy,Y_=L.transformMat4,Pc=Math.min,Ic=Math.max,Wf=function(){this.planes=[];for(var t=0;t<6;t++)this.planes.push(new ps);this.boundingBox=new ye,this.vertices=[];for(var t=0;t<8;t++)this.vertices[t]=L.fromValues(0,0,0)};Wf.prototype={setFromProjection:function(t){var e=this.planes,r=t.array,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],l=r[5],u=r[6],f=r[7],h=r[8],v=r[9],c=r[10],d=r[11],p=r[12],g=r[13],m=r[14],_=r[15];ie(e[0].normal.array,o-i,f-s,d-h),e[0].distance=-(_-p),e[0].normalize(),ie(e[1].normal.array,o+i,f+s,d+h),e[1].distance=-(_+p),e[1].normalize(),ie(e[2].normal.array,o+n,f+l,d+v),e[2].distance=-(_+g),e[2].normalize(),ie(e[3].normal.array,o-n,f-l,d-v),e[3].distance=-(_-g),e[3].normalize(),ie(e[4].normal.array,o-a,f-u,d-c),e[4].distance=-(_-m),e[4].normalize(),ie(e[5].normal.array,o+a,f+u,d+c),e[5].distance=-(_+m),e[5].normalize();var y=this.boundingBox,x=this.vertices;if(_===0){var S=l/i,T=-m/(c-1),w=-m/(c+1),b=-w/l,A=-T/l;y.min.set(-b*S,-b,w),y.max.set(b*S,b,T),ie(x[0],-b*S,-b,w),ie(x[1],-b*S,b,w),ie(x[2],b*S,-b,w),ie(x[3],b*S,b,w),ie(x[4],-A*S,-A,T),ie(x[5],-A*S,A,T),ie(x[6],A*S,-A,T),ie(x[7],A*S,A,T)}else{var M=(-1-p)/i,E=(1-p)/i,D=(1-g)/l,R=(-1-g)/l,P=(-1-m)/c,I=(1-m)/c;y.min.set(Math.min(M,E),Math.min(R,D),Math.min(I,P)),y.max.set(Math.max(E,M),Math.max(D,R),Math.max(P,I));var N=y.min.array,V=y.max.array;ie(x[0],N[0],N[1],N[2]),ie(x[1],N[0],V[1],N[2]),ie(x[2],V[0],N[1],N[2]),ie(x[3],V[0],V[1],N[2]),ie(x[4],N[0],N[1],V[2]),ie(x[5],N[0],V[1],V[2]),ie(x[6],V[0],N[1],V[2]),ie(x[7],V[0],V[1],V[2])}},getTransformedBoundingBox:function(){var t=L.create();return function(e,r){var i=this.vertices,n=r.array,a=e.min,o=e.max,s=a.array,l=o.array,u=i[0];Y_(t,u,n),X_(s,t),X_(l,t);for(var f=1;f<8;f++)u=i[f],Y_(t,u,n),s[0]=Pc(t[0],s[0]),s[1]=Pc(t[1],s[1]),s[2]=Pc(t[2],s[2]),l[0]=Ic(t[0],l[0]),l[1]=Ic(t[1],l[1]),l[2]=Ic(t[2],l[2]);return a._dirty=!0,o._dirty=!0,e}}()};var no=ti.extend(function(){return{projectionMatrix:new q,invProjectionMatrix:new q,viewMatrix:new q,frustum:new Wf}},function(){this.update(!0)},{update:function(t){ti.prototype.update.call(this,t),q.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),q.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(t){q.copy(this.viewMatrix,t),q.invert(this.worldTransform,t),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(t){q.copy(this.projectionMatrix,t),q.invert(this.invProjectionMatrix,t),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:function(){var t=k.create();return function(e,r){var i=r!==void 0?r:new Zn,n=e.array[0],a=e.array[1];return k.set(t,n,a,-1,1),k.transformMat4(t,t,this.invProjectionMatrix.array),k.transformMat4(t,t,this.worldTransform.array),L.scale(i.origin.array,t,1/t[3]),k.set(t,n,a,1,1),k.transformMat4(t,t,this.invProjectionMatrix.array),k.transformMat4(t,t,this.worldTransform.array),L.scale(t,t,1/t[3]),L.sub(i.direction.array,t,i.origin.array),L.normalize(i.direction.array,i.direction.array),i.direction._dirty=!0,i.origin._dirty=!0,i}}()}),cO=z.create(),Z_=z.create(),Nc={};function vO(t){var e=[],r=Object.keys(t);r.sort();for(var i=0;i<r.length;i++){var n=r[i];e.push(n+" "+t[n])}var a=e.join(`
`);if(Nc[a])return Nc[a];var o=ne.genGUID();return Nc[a]=o,o}function Xf(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}Xf.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0};Xf.prototype.add=function(t,e){e?this.transparent[this._transparentCount++]=t:this.opaque[this._opaqueCount++]=t};Xf.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var ji=ti.extend(function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new ye,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new ra(20)}},function(){this._scene=this},{addToScene:function(t){t instanceof no?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(t)):t instanceof Fr&&this.lights.push(t),t.name&&(this._nodeRepository[t.name]=t)},removeFromScene:function(t){var e;t instanceof no?(e=this._cameraList.indexOf(t),e>=0&&this._cameraList.splice(e,1)):t instanceof Fr&&(e=this.lights.indexOf(t),e>=0&&this.lights.splice(e,1)),t.name&&delete this._nodeRepository[t.name]},getNode:function(t){return this._nodeRepository[t]},setMainCamera:function(t){var e=this._cameraList.indexOf(t);e>=0&&this._cameraList.splice(e,1),this._cameraList.unshift(t)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var t=this.lights;this._previousLightNumber=this._lightNumber;for(var e={},r=0;r<t.length;r++){var i=t[r];if(!i.invisible){var n=i.group;e[n]||(e[n]={}),e[n][i.type]=e[n][i.type]||0,e[n][i.type]++}}this._lightNumber=e;for(var a in e)this._lightProgramKeys[a]=vO(e[a]);this._updateLightUniforms()},cloneNode:function(t){var e=t.clone(),r={};function i(n,a){r[n.__uid__]=a;for(var o=0;o<n._children.length;o++){var s=n._children[o],l=a._children[o];i(s,l)}}return i(t,e),e.traverse(function(n){n.skeleton&&(n.skeleton=n.skeleton.clone(r)),n.material&&(n.material=n.material.clone())}),e},updateRenderList:function(t,e){var r=t.__uid__,i=this._renderLists.get(r);i||(i=new Xf,this._renderLists.put(r,i)),i.startCount(),e&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var n=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,t,n,i,e),i.endCount(),i},getRenderList:function(t){return this._renderLists.get(t.__uid__)},_doUpdateRenderList:function(t,e,r,i,n){if(!t.invisible)for(var a=0;a<t._children.length;a++){var o=t._children[a];if(o.isRenderable()){var s=o.isSkinnedMesh()?cO:o.worldTransform.array,l=o.geometry;z.multiplyAffine(Z_,e.viewMatrix.array,s),(n&&!l.boundingBox||!this.isFrustumCulled(o,e,Z_))&&i.add(o,o.material.transparent||r)}o._children.length>0&&this._doUpdateRenderList(o,e,r,i,n)}},isFrustumCulled:function(){var t=new ye,e=new q;return function(r,i,n){var a=r.boundingBox;if(a||(r.skeleton&&r.skeleton.boundingBox?a=r.skeleton.boundingBox:a=r.geometry.boundingBox),!a)return!1;if(e.array=n,t.transformFrom(a,e),r.castShadow&&this.viewBoundingBoxLastFrame.union(t),r.frustumCulling){if(!t.intersectBoundingBox(i.frustum.boundingBox))return!0;e.array=i.projectionMatrix.array,t.max.array[2]>0&&t.min.array[2]<0&&(t.max.array[2]=-1e-20),t.applyProjection(e);var o=t.min.array,s=t.max.array;if(s[0]<-1||o[0]>1||s[1]<-1||o[1]>1||s[2]<-1||o[2]>1)return!0}return!1}}(),_updateLightUniforms:function(){var t=this.lights;t.sort(dO);var e=this._lightUniforms;for(var r in e)for(var i in e[r])e[r][i].value.length=0;for(var n=0;n<t.length;n++){var a=t[n];if(!a.invisible){var r=a.group;for(var i in a.uniformTemplates){var o=a.uniformTemplates[i],s=o.value(a);if(s!=null){e[r]||(e[r]={}),e[r][i]||(e[r][i]={type:"",value:[]});var l=e[r][i];switch(l.type=o.type+"v",o.type){case"1i":case"1f":case"t":l.value.push(s);break;case"2f":case"3f":case"4f":for(var u=0;u<s.length;u++)l.value.push(s[u]);break;default:console.error("Unkown light uniform type "+o.type)}}}}}},getLightGroups:function(){var t=[];for(var e in this._lightNumber)t.push(e);return t},getNumberChangedLightGroups:function(){var t=[];for(var e in this._lightNumber)this.isLightNumberChanged(e)&&t.push(e);return t},isLightNumberChanged:function(t){var e=this._previousLightNumber,r=this._lightNumber;for(var i in r[t])if(!e[t]||r[t][i]!==e[t][i])return!0;for(var i in e[t])if(!r[t]||r[t][i]!==e[t][i])return!0;return!1},getLightsNumbers:function(t){return this._lightNumber[t]},getProgramKey:function(t){return this._lightProgramKeys[t]},setLightUniforms:function(){function t(e,r,i){for(var n in e){var a=e[n];if(a.type==="tv"){if(!r.hasUniform(n))continue;for(var o=[],s=0;s<a.value.length;s++){var l=a.value[s],u=r.takeCurrentTextureSlot(i,l);o.push(u)}r.setUniform(i.gl,"1iv",n,o)}else r.setUniform(i.gl,a.type,n,a.value)}}return function(e,r,i){t(this._lightUniforms[r],e,i),t(this.shadowUniforms,e,i)}}(),dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function dO(t,e){if(e.castShadow&&!t.castShadow)return!0}var Gl=$s.isPowerOfTwo,pO=["px","nx","py","ny","pz","nz"],jn=W.extend(function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}},{textureType:"textureCube",update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(t);var r=this.format,i=this.type;e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_S,this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_T,this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var n=t.getGLExtension("EXT_texture_filter_anisotropic");if(n&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_CUBE_MAP,n.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),i===36193){var a=t.getGLExtension("OES_texture_half_float");a||(i=F.FLOAT)}if(this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(e,u,l,o,s,r,i),o/=2,s/=2}else this._updateTextureData(e,this,0,this.width,this.height,r,i),!this.NPOT&&this.useMipmap&&e.generateMipmap(e.TEXTURE_CUBE_MAP);e.bindTexture(e.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(t,e,r,i,n,a,o){for(var s=0;s<6;s++){var l=pO[s],u=e.image&&e.image[l];u?t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+s,r,a,a,o,u):t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+s,r,a,i,n,0,a,o,e.pixels&&e.pixels[l])}},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_CUBE_MAP))},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?Gl(this.image.px.width)&&Gl(this.image.px.height):Gl(this.width)&&Gl(this.height)},isRenderable:function(){return this.image.px?wa(this.image.px)&&wa(this.image.nx)&&wa(this.image.py)&&wa(this.image.ny)&&wa(this.image.pz)&&wa(this.image.nz):!!(this.width&&this.height)},load:function(t,e){var r=0,i=this;return ne.each(t,function(n,a){var o=Ct.createImage();e&&(o.crossOrigin=e),o.onload=function(){r--,r===0&&(i.dirty(),i.trigger("success",i))},o.onerror=function(){r--},r++,o.src=n,i.image[a]=o}),this}});Object.defineProperty(jn.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}});Object.defineProperty(jn.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}});function wa(t){return t.width>0&&t.height>0}var ve=no.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var t=this.fov/180*Math.PI;this.projectionMatrix.perspective(t,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array,e=Math.atan(1/t[5])*2;this.fov=e/Math.PI*180,this.aspect=t[5]/t[0],this.near=t[14]/(t[10]-1),this.far=t[14]/(t[10]+1)},clone:function(){var t=no.prototype.clone.call(this);return t.fov=this.fov,t.aspect=this.aspect,t.near=this.near,t.far=this.far,t}}),Wl="framebuffer",hi="renderbuffer",q_=hi+"_width",$_=hi+"_height",Oc=hi+"_attached",Bc="depthtexture_attached",bn=F.FRAMEBUFFER,zo=F.RENDERBUFFER,Jo=F.DEPTH_ATTACHMENT,ww=F.COLOR_ATTACHMENT0,he=Se.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new ro,this._textures={}},{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(t){if(t.__currentFrameBuffer){if(t.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}t.__currentFrameBuffer=this;var e=t.gl;e.bindFramebuffer(bn,this._getFrameBufferGL(t)),this._boundRenderer=t;var r=this._cache;r.put("viewport",t.viewport);var i=!1,n,a;for(var o in this._textures){i=!0;var s=this._textures[o];s&&(n=s.texture.width,a=s.texture.height,this._doAttach(t,s.texture,o,s.target))}this._width=n,this._height=a,!i&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?t.setViewport(this.viewport):t.setViewport(0,0,n,a,1);var l=r.get("attached_textures");if(l){for(var o in l)if(!this._textures[o]){var u=l[o];this._doDetach(e,o,u)}}if(!r.get(Bc)&&this.depthBuffer){r.miss(hi)&&r.put(hi,e.createRenderbuffer());var f=r.get(hi);(n!==r.get(q_)||a!==r.get($_))&&(e.bindRenderbuffer(zo,f),e.renderbufferStorage(zo,e.DEPTH_COMPONENT16,n,a),r.put(q_,n),r.put($_,a),e.bindRenderbuffer(zo,null)),r.get(Oc)||(e.framebufferRenderbuffer(bn,Jo,zo,f),r.put(Oc,!0))}},unbind:function(t){t.__currentFrameBuffer=null;var e=t.gl;e.bindFramebuffer(bn,null),this._boundRenderer=null,this._cache.use(t.__uid__);var r=this._cache.get("viewport");r&&t.setViewport(r),this.updateMipmap(t)},updateMipmap:function(t){var e=t.gl;for(var r in this._textures){var i=this._textures[r];if(i){var n=i.texture;if(!n.NPOT&&n.useMipmap&&n.minFilter===W.LINEAR_MIPMAP_LINEAR){var a=n.textureType==="textureCube"?F.TEXTURE_CUBE_MAP:F.TEXTURE_2D;e.bindTexture(a,n.getWebGLTexture(t)),e.generateMipmap(a),e.bindTexture(a,null)}}}},checkStatus:function(t){return t.checkFramebufferStatus(bn)},_getFrameBufferGL:function(t){var e=this._cache;return e.use(t.__uid__),e.miss(Wl)&&e.put(Wl,t.gl.createFramebuffer()),e.get(Wl)},attach:function(t,e,r){if(!t.width)throw new Error("The texture attached to color buffer is not a valid.");e=e||ww,r=r||F.TEXTURE_2D;var i=this._boundRenderer,n=i&&i.gl,a;if(n){var o=this._cache;o.use(i.__uid__),a=o.get("attached_textures")}var s=this._textures[e];if(!(s&&s.target===r&&s.texture===t&&a&&a[e]!=null)){var l=!0;i&&(l=this._doAttach(i,t,e,r),this.viewport||i.setViewport(0,0,t.width,t.height,1)),l&&(this._textures[e]=this._textures[e]||{},this._textures[e].texture=t,this._textures[e].target=r)}},_doAttach:function(t,e,r,i){var n=t.gl,a=e.getWebGLTexture(t),o=this._cache.get("attached_textures");if(o&&o[r]){var s=o[r];if(s.texture===e&&s.target===i)return}r=+r;var l=!0;if(r===Jo||r===F.DEPTH_STENCIL_ATTACHMENT){var u=t.getGLExtension("WEBGL_depth_texture");if(u||(console.error("Depth texture is not supported by the browser"),l=!1),e.format!==F.DEPTH_COMPONENT&&e.format!==F.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l){var f=this._cache.get(hi);f&&(n.framebufferRenderbuffer(bn,Jo,zo,null),n.deleteRenderbuffer(f),this._cache.put(hi,!1)),this._cache.put(Oc,!1),this._cache.put(Bc,!0)}}return n.framebufferTexture2D(bn,r,i,a,0),o||(o={},this._cache.put("attached_textures",o)),o[r]=o[r]||{},o[r].texture=e,o[r].target=i,l},_doDetach:function(t,e,r){t.framebufferTexture2D(bn,e,r,null,0);var i=this._cache.get("attached_textures");i&&i[e]&&(i[e]=null),(e===Jo||e===F.DEPTH_STENCIL_ATTACHMENT)&&this._cache.put(Bc,!1)},detach:function(t,e){if(this._textures[t]=null,this._boundRenderer){var r=this._cache;r.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,t,e)}},dispose:function(t){var e=t.gl,r=this._cache;r.use(t.__uid__);var i=r.get(hi);i&&e.deleteRenderbuffer(i);var n=r.get(Wl);n&&e.deleteFramebuffer(n),r.deleteContext(t.__uid__),this._textures={}}});he.DEPTH_ATTACHMENT=Jo;he.COLOR_ATTACHMENT0=ww;he.STENCIL_ATTACHMENT=F.STENCIL_ATTACHMENT;he.DEPTH_STENCIL_ATTACHMENT=F.DEPTH_STENCIL_ATTACHMENT;var gO=["px","nx","py","ny","pz","nz"],Hp=Se.extend(function(){var t={position:new B,far:1e3,near:.1,texture:null,shadowMapPass:null},e=t._cameras={px:new ve({fov:90}),nx:new ve({fov:90}),py:new ve({fov:90}),ny:new ve({fov:90}),pz:new ve({fov:90}),nz:new ve({fov:90})};return e.px.lookAt(B.POSITIVE_X,B.NEGATIVE_Y),e.nx.lookAt(B.NEGATIVE_X,B.NEGATIVE_Y),e.py.lookAt(B.POSITIVE_Y,B.POSITIVE_Z),e.ny.lookAt(B.NEGATIVE_Y,B.NEGATIVE_Z),e.pz.lookAt(B.POSITIVE_Z,B.NEGATIVE_Y),e.nz.lookAt(B.NEGATIVE_Z,B.NEGATIVE_Y),t._frameBuffer=new he,t},{getCamera:function(t){return this._cameras[t]},render:function(t,e,r){var i=t.gl;r||e.update();for(var n=this.texture.width,a=2*Math.atan(n/(n-.5))/Math.PI*180,o=0;o<6;o++){var s=gO[o],l=this._cameras[s];if(B.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=a,this.shadowMapPass){l.update();var u=e.getBoundingBox();u.applyTransform(l.viewMatrix),e.viewBoundingBoxLastFrame.copy(u),this.shadowMapPass.render(t,e,l,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+o),this._frameBuffer.bind(t),t.render(e,l,!0),this._frameBuffer.unbind(t)}},dispose:function(t){this._frameBuffer.dispose(t)}}),Vp=Ut.extend({dynamic:!1,widthSegments:1,heightSegments:1},function(){this.build()},{build:function(){for(var t=this.heightSegments,e=this.widthSegments,r=this.attributes,i=[],n=[],a=[],o=[],s=0;s<=t;s++)for(var l=s/t,u=0;u<=e;u++){var f=u/e;if(i.push([2*f-1,2*l-1,0]),n&&n.push([f,l]),a&&a.push([0,0,1]),u<e&&s<t){var h=u+s*(e+1);o.push([h,h+1,h+e+1]),o.push([h+e+1,h+1,h+e+2])}}r.position.fromArray(i),r.texcoord0.fromArray(n),r.normal.fromArray(a),this.initIndicesFromArray(o),this.boundingBox=new ye,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}}),Qt=new q,bw=Ut.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},function(){this.build()},{build:function(){var t={px:ba("px",this.depthSegments,this.heightSegments),nx:ba("nx",this.depthSegments,this.heightSegments),py:ba("py",this.widthSegments,this.depthSegments),ny:ba("ny",this.widthSegments,this.depthSegments),pz:ba("pz",this.widthSegments,this.heightSegments),nz:ba("nz",this.widthSegments,this.heightSegments)},e=["position","texcoord0","normal"],r=0,i=0;for(var n in t)r+=t[n].vertexCount,i+=t[n].indices.length;for(var a=0;a<e.length;a++)this.attributes[e[a]].init(r);this.indices=new Ct.Uint16Array(i);var o=0,s=0;for(var n in t){for(var l=t[n],a=0;a<e.length;a++)for(var u=e[a],f=l.attributes[u].value,h=l.attributes[u].size,v=u==="normal",c=0;c<f.length;c++){var d=f[c];this.inside&&v&&(d=-d),this.attributes[u].value[c+h*s]=d}for(var p=l.indices.length,c=0;c<l.indices.length;c++)this.indices[c+o]=s+l.indices[this.inside?p-c-1:c];o+=l.indices.length,s+=l.vertexCount}this.boundingBox=new ye,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function ba(t,e,r){Qt.identity();var i=new Vp({widthSegments:e,heightSegments:r});switch(t){case"px":q.translate(Qt,Qt,B.POSITIVE_X),q.rotateY(Qt,Qt,Math.PI/2);break;case"nx":q.translate(Qt,Qt,B.NEGATIVE_X),q.rotateY(Qt,Qt,-Math.PI/2);break;case"py":q.translate(Qt,Qt,B.POSITIVE_Y),q.rotateX(Qt,Qt,-Math.PI/2);break;case"ny":q.translate(Qt,Qt,B.NEGATIVE_Y),q.rotateX(Qt,Qt,Math.PI/2);break;case"pz":q.translate(Qt,Qt,B.POSITIVE_Z);break;case"nz":q.translate(Qt,Qt,B.NEGATIVE_Z),q.rotateY(Qt,Qt,Math.PI);break}return i.applyTransform(Qt),i}const mO=`@export clay.skybox.vertex
#define SHADER_NAME skybox
uniform mat4 world : WORLD;
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
varying vec3 v_WorldPosition;
void main()
{
v_WorldPosition = (world * vec4(position, 1.0)).xyz;
gl_Position = worldViewProjection * vec4(position, 1.0);
}
@end
@export clay.skybox.fragment
#define PI 3.1415926
uniform mat4 viewInverse : VIEWINVERSE;
#ifdef EQUIRECTANGULAR
uniform sampler2D environmentMap;
#else
uniform samplerCube environmentMap;
#endif
uniform float lod: 0.0;
varying vec3 v_WorldPosition;
@import clay.util.rgbm
@import clay.util.srgb
@import clay.util.ACES
void main()
{
vec3 eyePos = viewInverse[3].xyz;
vec3 V = normalize(v_WorldPosition - eyePos);
#ifdef EQUIRECTANGULAR
float phi = acos(V.y);
float theta = atan(-V.x, V.z) + PI * 0.5;
vec2 uv = vec2(theta / 2.0 / PI, phi / PI);
vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));
#else
#if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)
vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));
#else
vec4 texel = decodeHDR(textureCube(environmentMap, V));
#endif
#endif
#ifdef SRGB_DECODE
texel = sRGBToLinear(texel);
#endif
#ifdef TONEMAPPING
texel.rgb = ACESToneMapping(texel.rgb);
#endif
#ifdef SRGB_ENCODE
texel = linearTosRGB(texel);
#endif
gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));
}
@end`;$.import(mO);var Ns=Ve.extend(function(){var t=new $({vertex:$.source("clay.skybox.vertex"),fragment:$.source("clay.skybox.fragment")}),e=new Si({shader:t,depthMask:!1});return{scene:null,geometry:new bw,material:e,environmentMap:null,culling:!1,_dummyCamera:new ve}},function(){var t=this.scene;t&&this.attachScene(t),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)},{attachScene:function(t){this.scene&&this.detachScene(),t.skybox=this,this.scene=t,t.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(t){this.detachScene(),this.geometry.dispose(t)},setEnvironmentMap:function(t){t.textureType==="texture2D"?(this.material.define("EQUIRECTANGULAR"),t.minFilter=W.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",t)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(t,e,r){this.renderSkybox(t,r)},renderSkybox:function(t,e){var r=this._dummyCamera;r.aspect=t.getViewportAspect(),r.fov=e.fov||50,r.updateProjectionMatrix(),q.invert(r.invProjectionMatrix,r.projectionMatrix),r.worldTransform.copy(e.worldTransform),r.viewMatrix.copy(e.viewMatrix),this.position.copy(e.getWorldPosition()),this.update(),t.gl.disable(t.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),t.renderPass([this],r)}}),_O=542327876,yO=131072,xO=512,TO=4;function Gp(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}var SO=31,wO=Gp("DXT1"),bO=Gp("DXT3"),AO=Gp("DXT5"),EO=0,MO=1,CO=2,DO=3,LO=4,RO=7,PO=20,IO=21,NO=28,OO={parse:function(t,e){var r=new Int32Array(t,0,SO);if(r[EO]!==_O||!r(PO)&TO)return null;var i=r(IO),n=r[LO],a=r[DO],o=r[NO]&xO,s=r[CO]&yO,l,u;switch(i){case wO:l=8,u=W.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case bO:l=16,u=W.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case AO:l=16,u=W.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var f=r[MO]+4,h=o?6:1,v=1;s&&(v=Math.max(1,r[RO]));for(var c=[],d=0;d<h;d++){var p=n,g=a;c[d]=new At({width:p,height:g,format:u});for(var m=[],_=0;_<v;_++){var y=Math.max(4,p)/4*Math.max(4,g)/4*l,x=new Uint8Array(t,f,y);f+=y,p*=.5,g*=.5,m[_]=x}c[d].pixels=m[0],s&&(c[d].mipmaps=m)}if(e)e.width=c[0].width,e.height=c[0].height,e.format=c[0].format,e.pixels=c[0].pixels,e.mipmaps=c[0].mipmaps;else return c[0]}},pu=String.fromCharCode,BO=8,FO=32767;function kO(t,e,r,i){if(t[3]>0){var n=Math.pow(2,t[3]-128-8+i);e[r+0]=t[0]*n,e[r+1]=t[1]*n,e[r+2]=t[2]*n}else e[r+0]=0,e[r+1]=0,e[r+2]=0;return e[r+3]=1,e}function zO(t,e,r){for(var i="",n=e;n<r;n++)i+=pu(t[n]);return i}function UO(t,e){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]}function K_(t,e,r,i){for(var n=0,a=0,o=i;o>0;)if(t[a][0]=e[r++],t[a][1]=e[r++],t[a][2]=e[r++],t[a][3]=e[r++],t[a][0]===1&&t[a][1]===1&&t[a][2]===1){for(var s=t[a][3]<<n>>>0;s>0;s--)UO(t[a-1],t[a]),a++,o--;n+=8}else a++,o--,n=0;return r}function HO(t,e,r,i){if(i<BO|i>FO)return K_(t,e,r,i);var n=e[r++];if(n!=2)return K_(t,e,r-1,i);if(t[0][1]=e[r++],t[0][2]=e[r++],n=e[r++],(t[0][2]<<8>>>0|n)>>>0!==i)return null;for(var n=0;n<4;n++)for(var a=0;a<i;){var o=e[r++];if(o>128){o=(o&127)>>>0;for(var s=e[r++];o--;)t[a++][n]=s}else for(;o--;)t[a++][n]=e[r++]}return r}var VO={parseRGBE:function(t,e,r){r==null&&(r=0);var i=new Uint8Array(t),n=i.length;if(zO(i,0,2)==="#?"){for(var a=2;a<n&&!(pu(i[a])===`
`&&pu(i[a+1])===`
`);a++);if(!(a>=n)){a+=2;for(var o="";a<n;a++){var s=pu(i[a]);if(s===`
`)break;o+=s}var l=o.split(" "),u=parseInt(l[1]),f=parseInt(l[3]);if(!(!f||!u)){for(var h=a+1,v=[],c=0;c<f;c++){v[c]=[];for(var d=0;d<4;d++)v[c][d]=0}for(var p=new Float32Array(f*u*4),g=0,m=0;m<u;m++){var h=HO(v,i,h,f);if(!h)return null;for(var c=0;c<f;c++)kO(v[c],p,g,r),g+=4}return e||(e=new At),e.width=f,e.height=u,e.pixels=p,e.type=W.FLOAT,e}}}},parseRGBEFromPNG:function(t){}},ei={loadTexture:function(t,e,r,i){var n;if(typeof e=="function"?(r=e,i=r,e={}):e=e||{},typeof t=="string"){if(t.match(/.hdr$/)||e.fileType==="hdr")return n=new At({width:0,height:0,sRGB:!1}),ei._fetchTexture(t,function(a){VO.parseRGBE(a,n,e.exposure),n.dirty(),r&&r(n)},i),n;t.match(/.dds$/)||e.fileType==="dds"?(n=new At({width:0,height:0}),ei._fetchTexture(t,function(a){OO.parse(a,n),n.dirty(),r&&r(n)},i)):(n=new At,n.load(t),n.success(r),n.error(i))}else typeof t=="object"&&typeof t.px<"u"&&(n=new jn,n.load(t),n.success(r),n.error(i));return n},loadPanorama:function(t,e,r,i,n,a){var o=this;typeof i=="function"?(n=i,a=n,i={}):i=i||{},ei.loadTexture(e,i,function(s){s.flipY=i.flipY||!1,o.panoramaToCubeMap(t,s,r,i),s.dispose(t),n&&n(r)},a)},panoramaToCubeMap:function(t,e,r,i){var n=new Hp,a=new Ns({scene:new ji});return a.setEnvironmentMap(e),i=i||{},i.encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),r.sRGB=e.sRGB,n.texture=r,n.render(t,a.scene),n.texture=null,n.dispose(t),r},heightToNormal:function(t,e){var r=document.createElement("canvas"),i=r.width=t.width,n=r.height=t.height,a=r.getContext("2d");a.drawImage(t,0,0,i,n),e=e||!1;for(var o=a.getImageData(0,0,i,n),s=a.createImageData(i,n),l=0;l<o.data.length;l+=4){if(e){var u=o.data[l],f=o.data[l+1],h=o.data[l+2],v=Math.abs(u-f)+Math.abs(f-h);if(v>20)return console.warn("Given image is not a height map"),t}var c,d,p,g;l%(i*4)===0?(c=o.data[l],p=o.data[l+4]):l%(i*4)===(i-1)*4?(c=o.data[l-4],p=o.data[l]):(c=o.data[l-4],p=o.data[l+4]),l<i*4?(d=o.data[l],g=o.data[l+i*4]):l>i*(n-1)*4?(d=o.data[l-i*4],g=o.data[l]):(d=o.data[l-i*4],g=o.data[l+i*4]),s.data[l]=c-p+127,s.data[l+1]=d-g+127,s.data[l+2]=255,s.data[l+3]=255}return a.putImageData(s,0,0),r},isHeightImage:function(t,e,r){if(!t||!t.width||!t.height)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=e||32;r=r||20,i.width=i.height=a,n.drawImage(t,0,0,a,a);for(var o=n.getImageData(0,0,a,a),s=0;s<o.data.length;s+=4){var l=o.data[s],u=o.data[s+1],f=o.data[s+2],h=Math.abs(l-u)+Math.abs(u-f);if(h>r)return!1}return!0},_fetchTexture:function(t,e,r){Ct.request.get({url:t,responseType:"arraybuffer",onload:e,onerror:r})},createChessboard:function(t,e,r,i){t=t||512,e=e||64,r=r||"black",i=i||"white";var n=Math.ceil(t/e),a=document.createElement("canvas");a.width=t,a.height=t;var o=a.getContext("2d");o.fillStyle=i,o.fillRect(0,0,t,t),o.fillStyle=r;for(var s=0;s<n;s++)for(var l=0;l<n;l++){var u=l%2?s%2:s%2-1;u&&o.fillRect(s*e,l*e,e,e)}var f=new At({image:a,anisotropic:8});return f},createBlank:function(t){var e=document.createElement("canvas");e.width=1,e.height=1;var r=e.getContext("2d");r.fillStyle=t,r.fillRect(0,0,1,1);var i=new At({image:e});return i}},fd=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function hd(t){return"_on"+t}var cd=function(t){var e=this;this._texture=new At({anisotropic:32,flipY:!1,surface:this,dispose:function(r){e.dispose(),At.prototype.dispose.call(this,r)}}),fd.forEach(function(r){this[hd(r)]=function(i){i.triangle&&this._meshes.forEach(function(n){this.dispatchEvent(r,n,i.triangle,i.point)},this)}},this),this._meshes=[],t&&this.setECharts(t),this.onupdate=null};cd.prototype={constructor:cd,getTexture:function(){return this._texture},setECharts:function(t){this._chart=t;var e=t.getDom();if(!(e instanceof HTMLCanvasElement))console.error("ECharts must init on canvas if it is used as texture."),e=document.createElement("canvas");else{var r=this,i=t.getZr(),n=i.__oldRefreshImmediately||i.refreshImmediately;i.refreshImmediately=function(){n.call(this),r._texture.dirty(),r.onupdate&&r.onupdate()},i.__oldRefreshImmediately=n}this._texture.image=e,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:function(){var t=new B,e=new B,r=new B,i=new st,n=new st,a=new st,o=new st,s=new B;return function(l,u,f,h){var v=u.geometry,c=v.attributes.position,d=v.attributes.texcoord0,p=B.dot,g=B.cross;c.get(f[0],t.array),c.get(f[1],e.array),c.get(f[2],r.array),d.get(f[0],i.array),d.get(f[1],n.array),d.get(f[2],a.array),g(s,e,r);var m=p(t,s),_=p(h,s)/m;g(s,r,t);var y=p(h,s)/m;g(s,t,e);var x=p(h,s)/m;st.scale(o,i,_),st.scaleAndAdd(o,o,n,y),st.scaleAndAdd(o,o,a,x);var S=o.x*this._chart.getWidth(),T=o.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(l,{zrX:S,zrY:T})}}(),attachToMesh:function(t){this._meshes.indexOf(t)>=0||(fd.forEach(function(e){t.on(e,this[hd(e)],this)},this),this._meshes.push(t))},detachFromMesh:function(t){var e=this._meshes.indexOf(t);e>=0&&this._meshes.splice(e,1),fd.forEach(function(r){t.off(r,this[hd(r)])},this)},dispose:function(){this._meshes.forEach(function(t){this.detachFromMesh(t)},this)}};var Os=no.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array;this.left=(-1-t[12])/t[0],this.right=(1-t[12])/t[0],this.top=(1-t[13])/t[5],this.bottom=(-1-t[13])/t[5],this.near=-(-1-t[14])/t[10],this.far=-(1-t[14])/t[10]},clone:function(){var t=no.prototype.clone.call(this);return t.left=this.left,t.right=this.right,t.near=this.near,t.far=this.far,t.top=this.top,t.bottom=this.bottom,t}});const GO=`
@export clay.compositor.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
varying vec2 v_Texcoord;
void main()
{
v_Texcoord = texcoord;
gl_Position = worldViewProjection * vec4(position, 1.0);
}
@end`;$.import(GO);var WO=new Vp,j_=new Ve({geometry:WO,frustumCulling:!1}),XO=new Os,Oe=Se.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var t=new $($.source("clay.compositor.vertex"),this.fragment),e=new Si({shader:t});e.enableTexturesAll(),this.material=e},{setUniform:function(t,e){this.material.setUniform(t,e)},getUniform:function(t){var e=this.material.uniforms[t];if(e)return e.value},attachOutput:function(t,e){this.outputs||(this.outputs={}),e=e||F.COLOR_ATTACHMENT0,this.outputs[e]=t},detachOutput:function(t){for(var e in this.outputs)this.outputs[e]===t&&(this.outputs[e]=null)},bind:function(t,e){if(this.outputs)for(var r in this.outputs){var i=this.outputs[r];i&&e.attach(i,r)}e&&e.bind(t)},unbind:function(t,e){e.unbind(t)},render:function(t,e){var r=t.gl;if(e){this.bind(t,e);var i=t.getGLExtension("EXT_draw_buffers");if(i&&this.outputs){var n=[];for(var a in this.outputs)a=+a,a>=r.COLOR_ATTACHMENT0&&a<=r.COLOR_ATTACHMENT0+8&&n.push(a);i.drawBuffersEXT(n)}}this.trigger("beforerender",this,t);var o=this.clearDepth?r.DEPTH_BUFFER_BIT:0;if(r.depthMask(!0),this.clearColor){o=o|r.COLOR_BUFFER_BIT,r.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&r.clearColor(s[0],s[1],s[2],s[3])}r.clear(o),this.blendWithPrevious?(r.enable(r.BLEND),this.material.transparent=!0):(r.disable(r.BLEND),this.material.transparent=!1),this.renderQuad(t),this.trigger("afterrender",this,t),e&&this.unbind(t,e)},renderQuad:function(t){j_.material=this.material,t.renderPass([j_],XO)},dispose:function(t){}});const YO=`#define SAMPLE_NUMBER 1024
#define PI 3.14159265358979
uniform sampler2D normalDistribution;
uniform vec2 viewportSize : [512, 256];
const vec3 N = vec3(0.0, 0.0, 1.0);
const float fSampleNumber = float(SAMPLE_NUMBER);
vec3 importanceSampleNormal(float i, float roughness, vec3 N) {
vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;
vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
vec3 tangentX = normalize(cross(N, upVector));
vec3 tangentZ = cross(N, tangentX);
return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
float G_Smith(float roughness, float NoV, float NoL) {
float k = roughness * roughness / 2.0;
float G1V = NoV / (NoV * (1.0 - k) + k);
float G1L = NoL / (NoL * (1.0 - k) + k);
return G1L * G1V;
}
void main() {
vec2 uv = gl_FragCoord.xy / viewportSize;
float NoV = uv.x;
float roughness = uv.y;
vec3 V;
V.x = sqrt(1.0 - NoV * NoV);
V.y = 0.0;
V.z = NoV;
float A = 0.0;
float B = 0.0;
for (int i = 0; i < SAMPLE_NUMBER; i++) {
vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);
vec3 L = reflect(-V, H);
float NoL = clamp(L.z, 0.0, 1.0);
float NoH = clamp(H.z, 0.0, 1.0);
float VoH = clamp(dot(V, H), 0.0, 1.0);
if (NoL > 0.0) {
float G = G_Smith(roughness, NoV, NoL);
float G_Vis = G * VoH / (NoH * NoV);
float Fc = pow(1.0 - VoH, 5.0);
A += (1.0 - Fc) * G_Vis;
B += Fc * G_Vis;
}
}
gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);
}
`,ZO=`#define SHADER_NAME prefilter
#define SAMPLE_NUMBER 1024
#define PI 3.14159265358979
uniform mat4 viewInverse : VIEWINVERSE;
uniform samplerCube environmentMap;
uniform sampler2D normalDistribution;
uniform float roughness : 0.5;
varying vec2 v_Texcoord;
varying vec3 v_WorldPosition;
@import clay.util.rgbm
vec3 importanceSampleNormal(float i, float roughness, vec3 N) {
vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;
vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
vec3 tangentX = normalize(cross(N, upVector));
vec3 tangentZ = cross(N, tangentX);
return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
void main() {
vec3 eyePos = viewInverse[3].xyz;
vec3 V = normalize(v_WorldPosition - eyePos);
vec3 N = V;
vec3 prefilteredColor = vec3(0.0);
float totalWeight = 0.0;
float fMaxSampleNumber = float(SAMPLE_NUMBER);
for (int i = 0; i < SAMPLE_NUMBER; i++) {
vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);
vec3 L = reflect(-V, H);
float NoL = clamp(dot(N, L), 0.0, 1.0);
if (NoL > 0.0) {
prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;
totalWeight += NoL;
}
}
gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));
}
`;var ri={},Fc=["px","nx","py","ny","pz","nz"];ri.prefilterEnvironmentMap=function(t,e,r,i,n){(!n||!i)&&(i=ri.generateNormalDistribution(),n=ri.integrateBRDF(t,i)),r=r||{};var a=r.width||64,o=r.height||64,s=r.type||e.type,l=new jn({width:a,height:o,type:s,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var u=Math.min(a,o),f=Math.log(u)/Math.log(2)+1,h=new Si({shader:new $({vertex:$.source("clay.skybox.vertex"),fragment:ZO})});h.set("normalDistribution",i),r.encodeRGBM&&h.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&h.define("fragment","RGBM_DECODE");var v=new ji,c;if(e.textureType==="texture2D"){var d=new jn({width:a,height:o,type:s===W.FLOAT?W.HALF_FLOAT:s});ei.panoramaToCubeMap(t,e,d,{encodeRGBM:r.decodeRGBM}),e=d}c=new Ns({scene:v,material:h}),c.material.set("environmentMap",e);var p=new Hp({texture:l});r.encodeRGBM&&(s=l.type=W.UNSIGNED_BYTE);for(var g=new At({width:a,height:o,type:s}),m=new he({depthBuffer:!1}),_=Ct[s===W.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],y=0;y<f;y++){l.mipmaps[y]={pixels:{}},c.material.set("roughness",y/(f-1));for(var x=g.width,S=2*Math.atan(x/(x-.5))/Math.PI*180,T=0;T<Fc.length;T++){var w=new _(g.width*g.height*4);m.attach(g),m.bind(t);var b=p.getCamera(Fc[T]);b.fov=S,t.render(v,b),t.gl.readPixels(0,0,g.width,g.height,W.RGBA,s,w),m.unbind(t),l.mipmaps[y].pixels[Fc[T]]=w}g.width/=2,g.height/=2,g.dirty()}return m.dispose(t),g.dispose(t),c.dispose(t),i.dispose(t),{environmentMap:l,brdfLookup:n,normalDistribution:i,maxMipmapLevel:f}};ri.integrateBRDF=function(t,e){e=e||ri.generateNormalDistribution();var r=new he({depthBuffer:!1}),i=new Oe({fragment:YO}),n=new At({width:512,height:256,type:W.HALF_FLOAT,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE,minFilter:W.NEAREST,magFilter:W.NEAREST,useMipmap:!1});return i.setUniform("normalDistribution",e),i.setUniform("viewportSize",[512,256]),i.attachOutput(n),i.render(t,r),r.dispose(t),n};ri.generateNormalDistribution=function(r,i){for(var r=r||256,i=i||1024,n=new At({width:r,height:i,type:W.FLOAT,minFilter:W.NEAREST,magFilter:W.NEAREST,wrapS:W.CLAMP_TO_EDGE,wrapT:W.CLAMP_TO_EDGE,useMipmap:!1}),a=new Float32Array(i*r*4),o=[],s=0;s<r;s++){for(var l=s/r,u=l*l,f=0;f<i;f++){var h=(f<<16|f>>>16)>>>0;h=((h&1431655765)<<1|(h&2863311530)>>>1)>>>0,h=((h&858993459)<<2|(h&3435973836)>>>2)>>>0,h=((h&252645135)<<4|(h&4042322160)>>>4)>>>0,h=(((h&16711935)<<8|(h&4278255360)>>>8)>>>0)/4294967296;var v=Math.sqrt((1-h)/(1+(u*u-1)*h));o[f]=v}for(var f=0;f<i;f++){var c=(f*r+s)*4,v=o[f],d=Math.sqrt(1-v*v),p=f/i,g=2*Math.PI*p;a[c]=d*Math.cos(g),a[c+1]=v,a[c+2]=d*Math.sin(g),a[c+3]=1}}return n.pixels=a,n};var qO=Fr.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(t,e){if(!t.getGLExtension("EXT_shader_texture_lod")){console.warn("Device not support textureCubeLodEXT");return}this._brdfLookup||(this._normalDistribution=ri.generateNormalDistribution(),this._brdfLookup=ri.integrateBRDF(t,this._normalDistribution));var r=this.cubemap;if(!r.__prefiltered){var i=ri.prefilterEnvironmentMap(t,r,{encodeRGBM:!0,width:e,height:e},this._normalDistribution,this._brdfLookup);this.cubemap=i.environmentMap,this.cubemap.__prefiltered=!0,r.dispose(t)}},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}},ambientCubemapLightCubemap:{type:"t",value:function(t){return t.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(t){return t._brdfLookup}}}}),$O=Fr.extend({castShadow:!1,coefficients:[]},function(){this._coefficientsTmpArr=new Ct.Float32Array(9*3)},{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}},ambientSHLightCoefficients:{type:"3f",value:function(t){for(var e=t._coefficientsTmpArr,r=0;r<t.coefficients.length;r++)e[r]=t.coefficients[r];return e}}}}),Aw={},Hn=["px","nx","py","ny","pz","nz"];function KO(t,e){var r=t[0],i=t[1],n=t[2];return e===0?1:e===1?r:e===2?i:e===3?n:e===4?r*n:e===5?i*n:e===6?r*i:e===7?3*n*n-1:r*r-i*i}var jO={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};function QO(t,e,r,i){for(var n=new Ct.Float32Array(27),a=L.create(),o=L.create(),s=L.create(),l=0;l<9;l++){for(var u=L.create(),f=0;f<Hn.length;f++){for(var h=e[Hn[f]],v=L.create(),c=0,d=0,p=jO[Hn[f]],g=0;g<i;g++)for(var m=0;m<r;m++){a[0]=m/(r-1)*2-1,a[1]=g/(i-1)*2-1,a[2]=-1,L.normalize(a,a),s[0]=a[p[0]]*p[3],s[1]=a[p[1]]*p[4],s[2]=a[p[2]]*p[5],o[0]=h[d++]/255,o[1]=h[d++]/255,o[2]=h[d++]/255;var _=h[d++]/255*8.12;o[0]*=_,o[1]*=_,o[2]*=_,L.scaleAndAdd(v,v,o,KO(s,l)*-a[2]),c+=-a[2]}L.scaleAndAdd(u,u,v,1/c)}n[l*3]=u[0]/6,n[l*3+1]=u[1]/6,n[l*3+2]=u[2]/6}return n}Aw.projectEnvironmentMap=function(t,e,r){r=r||{},r.lod=r.lod||0;var i,n=new ji,a=64;e.textureType==="texture2D"?i=new Ns({scene:n,environmentMap:e}):(a=e.image&&e.image.px?e.image.px.width:e.width,i=new Ns({scene:n,environmentMap:e}));var o=Math.ceil(a/Math.pow(2,r.lod)),s=Math.ceil(a/Math.pow(2,r.lod)),l=new At({width:o,height:s}),u=new he;i.material.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&i.material.define("fragment","RGBM_DECODE"),i.material.set("lod",r.lod);for(var f=new Hp({texture:l}),h={},v=0;v<Hn.length;v++){h[Hn[v]]=new Uint8Array(o*s*4);var c=f.getCamera(Hn[v]);c.fov=90,u.attach(l),u.bind(t),t.render(n,c),t.gl.readPixels(0,0,o,s,W.RGBA,W.UNSIGNED_BYTE,h[Hn[v]]),u.unbind(t)}return i.dispose(t),u.dispose(t),l.dispose(t),QO(t,h,o,s)};var mr={firstNotNull:function(){for(var t=0,e=arguments.length;t<e;t++)if(arguments[t]!=null)return arguments[t]},queryDataIndex:function(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return j(e.dataIndex)?tt(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return j(e.name)?tt(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}},JO=Ut.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:Math.PI*2,thetaStart:0,thetaLength:Math.PI,radius:1},function(){this.build()},{build:function(){var t=this.heightSegments,e=this.widthSegments,r=this.attributes.position,i=this.attributes.texcoord0,n=this.attributes.normal,a=(e+1)*(t+1);r.init(a),i.init(a),n.init(a);var o=a>65535?Uint32Array:Uint16Array,s=this.indices=new o(e*t*6),l,u,f,h,v,c,d,y=this.radius,p=this.phiStart,g=this.phiLength,m=this.thetaStart,_=this.thetaLength,y=this.radius,x=[],S=[],T=0,w=1/y;for(d=0;d<=t;d++)for(c=0;c<=e;c++)h=c/e,v=d/t,l=-y*Math.cos(p+h*g)*Math.sin(m+v*_),u=y*Math.cos(m+v*_),f=y*Math.sin(p+h*g)*Math.sin(m+v*_),x[0]=l,x[1]=u,x[2]=f,S[0]=h,S[1]=v,r.set(T,x),i.set(T,S),x[0]*=w,x[1]*=w,x[2]*=w,n.set(T,x),T++;var b,A,M,E,D=e+1,R=0;for(d=0;d<t;d++)for(c=0;c<e;c++)A=d*D+c,b=d*D+c+1,E=(d+1)*D+c+1,M=(d+1)*D+c,s[R++]=b,s[R++]=A,s[R++]=E,s[R++]=A,s[R++]=M,s[R++]=E;this.boundingBox=new ye,this.boundingBox.max.set(y,y,y),this.boundingBox.min.set(-y,-y,-y)}}),t3=Fr.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}}}}),e3=Fr.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(t){return t.__dir=t.__dir||new B,t.__dir.copy(t.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}}},clone:function(){var t=Fr.prototype.clone.call(this);return t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}}),r3=Fr.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(t){return t.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(t){return t.range}},pointLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}}},clone:function(){var t=Fr.prototype.clone.call(this);return t.range=this.range,t}}),i3=Fr.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:.001,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(t){return t.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(t){return t.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(t){return Math.cos(t.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(t){return Math.cos(t.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(t){return t.falloffFactor}},spotLightDirection:{type:"3f",value:function(t){return t.__dir=t.__dir||new B,t.__dir.copy(t.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}}},clone:function(){var t=Fr.prototype.clone.call(this);return t.range=this.range,t.umbraAngle=this.umbraAngle,t.penumbraAngle=this.penumbraAngle,t.falloffFactor=this.falloffFactor,t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}}),St=function(t,e,r,i){t=t||0,e=e||0,r=r||0,i=i||0,this.array=k.fromValues(t,e,r,i),this._dirty=!0};St.prototype={constructor:St,add:function(t){return k.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e,r,i){return this.array[0]=t,this.array[1]=e,this.array[2]=r,this.array[3]=i,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new St(this.x,this.y,this.z,this.w)},copy:function(t){return k.copy(this.array,t.array),this._dirty=!0,this},dist:function(t){return k.dist(this.array,t.array)},distance:function(t){return k.distance(this.array,t.array)},div:function(t){return k.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return k.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return k.dot(this.array,t.array)},len:function(){return k.len(this.array)},length:function(){return k.length(this.array)},lerp:function(t,e,r){return k.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},min:function(t){return k.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return k.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return k.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return k.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return k.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return k.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return k.random(this.array,t),this._dirty=!0,this},scale:function(t){return k.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return k.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return k.sqrDist(this.array,t.array)},squaredDistance:function(t){return k.squaredDistance(this.array,t.array)},sqrLen:function(){return k.sqrLen(this.array)},squaredLength:function(){return k.squaredLength(this.array)},sub:function(t){return k.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return k.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return k.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return k.transformQuat(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var Uo=Object.defineProperty;if(Uo){var Xl=St.prototype;Uo(Xl,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Uo(Xl,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),Uo(Xl,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),Uo(Xl,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}St.add=function(t,e,r){return k.add(t.array,e.array,r.array),t._dirty=!0,t};St.set=function(t,e,r,i,n){k.set(t.array,e,r,i,n),t._dirty=!0};St.copy=function(t,e){return k.copy(t.array,e.array),t._dirty=!0,t};St.dist=function(t,e){return k.distance(t.array,e.array)};St.distance=St.dist;St.div=function(t,e,r){return k.divide(t.array,e.array,r.array),t._dirty=!0,t};St.divide=St.div;St.dot=function(t,e){return k.dot(t.array,e.array)};St.len=function(t){return k.length(t.array)};St.lerp=function(t,e,r,i){return k.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};St.min=function(t,e,r){return k.min(t.array,e.array,r.array),t._dirty=!0,t};St.max=function(t,e,r){return k.max(t.array,e.array,r.array),t._dirty=!0,t};St.mul=function(t,e,r){return k.multiply(t.array,e.array,r.array),t._dirty=!0,t};St.multiply=St.mul;St.negate=function(t,e){return k.negate(t.array,e.array),t._dirty=!0,t};St.normalize=function(t,e){return k.normalize(t.array,e.array),t._dirty=!0,t};St.random=function(t,e){return k.random(t.array,e),t._dirty=!0,t};St.scale=function(t,e,r){return k.scale(t.array,e.array,r),t._dirty=!0,t};St.scaleAndAdd=function(t,e,r,i){return k.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};St.sqrDist=function(t,e){return k.sqrDist(t.array,e.array)};St.squaredDistance=St.sqrDist;St.sqrLen=function(t){return k.sqrLen(t.array)};St.squaredLength=St.sqrLen;St.sub=function(t,e,r){return k.subtract(t.array,e.array,r.array),t._dirty=!0,t};St.subtract=St.sub;St.transformMat4=function(t,e,r){return k.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};St.transformQuat=function(t,e,r){return k.transformQuat(t.array,e.array,r.array),t._dirty=!0,t};var Tt={};Tt.create=function(){var t=new xe(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t};Tt.clone=function(t){var e=new xe(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e};Tt.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};Tt.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t};Tt.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t};Tt.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r*a-n*i;return o?(o=1/o,t[0]=a*o,t[1]=-i*o,t[2]=-n*o,t[3]=r*o,t):null};Tt.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t};Tt.determinant=function(t){return t[0]*t[3]-t[2]*t[1]};Tt.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],f=r[3];return t[0]=i*s+a*l,t[1]=n*s+o*l,t[2]=i*u+a*f,t[3]=n*u+o*f,t};Tt.mul=Tt.multiply;Tt.rotate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+a*s,t[1]=n*l+o*s,t[2]=i*-s+a*l,t[3]=n*-s+o*l,t};Tt.scale=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=i*s,t[1]=n*s,t[2]=a*l,t[3]=o*l,t};Tt.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))};Tt.LDU=function(t,e,r,i){return t[2]=i[2]/i[0],r[0]=i[0],r[1]=i[1],r[3]=i[3]-t[2]*r[1],[t,e,r]};var Fe=function(){this.array=Tt.create(),this._dirty=!0};Fe.prototype={constructor:Fe,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},clone:function(){return new Fe().copy(this)},copy:function(t){return Tt.copy(this.array,t.array),this._dirty=!0,this},adjoint:function(){return Tt.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return Tt.determinant(this.array)},identity:function(){return Tt.identity(this.array),this._dirty=!0,this},invert:function(){return Tt.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return Tt.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return Tt.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return Tt.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return Tt.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return Tt.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return Tt.scale(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return Tt.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};Fe.adjoint=function(t,e){return Tt.adjoint(t.array,e.array),t._dirty=!0,t};Fe.copy=function(t,e){return Tt.copy(t.array,e.array),t._dirty=!0,t};Fe.determinant=function(t){return Tt.determinant(t.array)};Fe.identity=function(t){return Tt.identity(t.array),t._dirty=!0,t};Fe.invert=function(t,e){return Tt.invert(t.array,e.array),t._dirty=!0,t};Fe.mul=function(t,e,r){return Tt.mul(t.array,e.array,r.array),t._dirty=!0,t};Fe.multiply=Fe.mul;Fe.rotate=function(t,e,r){return Tt.rotate(t.array,e.array,r),t._dirty=!0,t};Fe.scale=function(t,e,r){return Tt.scale(t.array,e.array,r.array),t._dirty=!0,t};Fe.transpose=function(t,e){return Tt.transpose(t.array,e.array),t._dirty=!0,t};var Lt={};Lt.create=function(){var t=new xe(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t};Lt.clone=function(t){var e=new xe(6);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};Lt.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t};Lt.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t};Lt.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=r*a-i*n;return l?(l=1/l,t[0]=a*l,t[1]=-i*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-a*o)*l,t[5]=(i*o-r*s)*l,t):null};Lt.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};Lt.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],f=r[1],h=r[2],v=r[3],c=r[4],d=r[5];return t[0]=i*u+a*f,t[1]=n*u+o*f,t[2]=i*h+a*v,t[3]=n*h+o*v,t[4]=i*c+a*d+s,t[5]=n*c+o*d+l,t};Lt.mul=Lt.multiply;Lt.rotate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=i*f+a*u,t[1]=n*f+o*u,t[2]=i*-u+a*f,t[3]=n*-u+o*f,t[4]=s,t[5]=l,t};Lt.scale=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],f=r[1];return t[0]=i*u,t[1]=n*u,t[2]=a*f,t[3]=o*f,t[4]=s,t[5]=l,t};Lt.translate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],f=r[1];return t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=i*u+a*f+s,t[5]=n*u+o*f+l,t};Lt.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)};var $e=function(){this.array=Lt.create(),this._dirty=!0};$e.prototype={constructor:$e,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},clone:function(){return new $e().copy(this)},copy:function(t){return Lt.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return Lt.determinant(this.array)},identity:function(){return Lt.identity(this.array),this._dirty=!0,this},invert:function(){return Lt.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return Lt.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return Lt.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return Lt.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return Lt.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return Lt.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return Lt.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return Lt.translate(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};$e.copy=function(t,e){return Lt.copy(t.array,e.array),t._dirty=!0,t};$e.determinant=function(t){return Lt.determinant(t.array)};$e.identity=function(t){return Lt.identity(t.array),t._dirty=!0,t};$e.invert=function(t,e){return Lt.invert(t.array,e.array),t._dirty=!0,t};$e.mul=function(t,e,r){return Lt.mul(t.array,e.array,r.array),t._dirty=!0,t};$e.multiply=$e.mul;$e.rotate=function(t,e,r){return Lt.rotate(t.array,e.array,r),t._dirty=!0,t};$e.scale=function(t,e,r){return Lt.scale(t.array,e.array,r.array),t._dirty=!0,t};$e.translate=function(t,e,r){return Lt.translate(t.array,e.array,r.array),t._dirty=!0,t};var fe=function(){this.array=it.create(),this._dirty=!0};fe.prototype={constructor:fe,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},adjoint:function(){return it.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return new fe().copy(this)},copy:function(t){return it.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return it.determinant(this.array)},fromMat2d:function(t){return it.fromMat2d(this.array,t.array),this._dirty=!0,this},fromMat4:function(t){return it.fromMat4(this.array,t.array),this._dirty=!0,this},fromQuat:function(t){return it.fromQuat(this.array,t.array),this._dirty=!0,this},identity:function(){return it.identity(this.array),this._dirty=!0,this},invert:function(){return it.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return it.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return it.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return it.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return it.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return it.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return it.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return it.translate(this.array,this.array,t.array),this._dirty=!0,this},normalFromMat4:function(t){return it.normalFromMat4(this.array,t.array),this._dirty=!0,this},transpose:function(){return it.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};fe.adjoint=function(t,e){return it.adjoint(t.array,e.array),t._dirty=!0,t};fe.copy=function(t,e){return it.copy(t.array,e.array),t._dirty=!0,t};fe.determinant=function(t){return it.determinant(t.array)};fe.identity=function(t){return it.identity(t.array),t._dirty=!0,t};fe.invert=function(t,e){return it.invert(t.array,e.array),t};fe.mul=function(t,e,r){return it.mul(t.array,e.array,r.array),t._dirty=!0,t};fe.multiply=fe.mul;fe.fromMat2d=function(t,e){return it.fromMat2d(t.array,e.array),t._dirty=!0,t};fe.fromMat4=function(t,e){return it.fromMat4(t.array,e.array),t._dirty=!0,t};fe.fromQuat=function(t,e){return it.fromQuat(t.array,e.array),t._dirty=!0,t};fe.normalFromMat4=function(t,e){return it.normalFromMat4(t.array,e.array),t._dirty=!0,t};fe.rotate=function(t,e,r){return it.rotate(t.array,e.array,r),t._dirty=!0,t};fe.scale=function(t,e,r){return it.scale(t.array,e.array,r.array),t._dirty=!0,t};fe.transpose=function(t,e){return it.transpose(t.array,e.array),t._dirty=!0,t};fe.translate=function(t,e,r){return it.translate(t.array,e.array,r.array),t._dirty=!0,t};var n3={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(t,e){this._animators=this._animators||[];var r=this,i;if(t){for(var n=t.split("."),a=r,o=0,s=n.length;o<s;o++)a&&(a=a[n[o]]);a&&(i=a)}else i=r;if(i==null)throw new Error("Target "+t+" not exists");var l=this._animators,u=new df(i,e),f=this;return u.during(function(){f.__zr&&f.__zr.refresh()}).done(function(){var h=l.indexOf(u);h>=0&&l.splice(h,1)}),l.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(t){this._animators=this._animators||[];for(var e=this._animators,r=e.length,i=0;i<r;i++)e[i].stop(t);return e.length=0,this},addAnimatorsToZr:function(t){if(this._animators)for(var e=0;e<this._animators.length;e++)t.animation.addAnimator(this._animators[e])},removeAnimatorsFromZr:function(t){if(this._animators)for(var e=0;e<this._animators.length;e++)t.animation.removeAnimator(this._animators[e])}};const a3=`
@export clay.util.rand
highp float rand(vec2 uv) {
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);
return fract(sin(sn) * c);
}
@end
@export clay.util.calculate_attenuation
uniform float attenuationFactor : 5.0;
float lightAttenuation(float dist, float range)
{
float attenuation = 1.0;
attenuation = dist*dist/(range*range+1.0);
float att_s = attenuationFactor;
attenuation = 1.0/(attenuation*att_s+1.0);
att_s = 1.0/(att_s+1.0);
attenuation = attenuation - att_s;
attenuation /= 1.0 - att_s;
return clamp(attenuation, 0.0, 1.0);
}
@end
@export clay.util.edge_factor
#ifdef SUPPORT_STANDARD_DERIVATIVES
float edgeFactor(float width)
{
vec3 d = fwidth(v_Barycentric);
vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);
return min(min(a3.x, a3.y), a3.z);
}
#else
float edgeFactor(float width)
{
return 1.0;
}
#endif
@end
@export clay.util.encode_float
vec4 encodeFloat(const in float depth)
{
const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);
const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);
vec4 res = fract(depth * bitShifts);
res -= res.xxyz * bit_mask;
return res;
}
@end
@export clay.util.decode_float
float decodeFloat(const in vec4 color)
{
const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
return dot(color, bitShifts);
}
@end
@export clay.util.float
@import clay.util.encode_float
@import clay.util.decode_float
@end
@export clay.util.rgbm_decode
vec3 RGBMDecode(vec4 rgbm, float range) {
return range * rgbm.rgb * rgbm.a;
}
@end
@export clay.util.rgbm_encode
vec4 RGBMEncode(vec3 color, float range) {
if (dot(color, color) == 0.0) {
return vec4(0.0);
}
vec4 rgbm;
color /= range;
rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);
rgbm.a = ceil(rgbm.a * 255.0) / 255.0;
rgbm.rgb = color / rgbm.a;
return rgbm;
}
@end
@export clay.util.rgbm
@import clay.util.rgbm_decode
@import clay.util.rgbm_encode
vec4 decodeHDR(vec4 color)
{
#if defined(RGBM_DECODE) || defined(RGBM)
return vec4(RGBMDecode(color, 8.12), 1.0);
#else
return color;
#endif
}
vec4 encodeHDR(vec4 color)
{
#if defined(RGBM_ENCODE) || defined(RGBM)
return RGBMEncode(color.xyz, 8.12);
#else
return color;
#endif
}
@end
@export clay.util.srgb
vec4 sRGBToLinear(in vec4 value) {
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);
}
vec4 linearTosRGB(in vec4 value) {
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);
}
@end
@export clay.chunk.skinning_header
#ifdef SKINNING
attribute vec3 weight : WEIGHT;
attribute vec4 joint : JOINT;
#ifdef USE_SKIN_MATRICES_TEXTURE
uniform sampler2D skinMatricesTexture : ignore;
uniform float skinMatricesTextureSize: ignore;
mat4 getSkinMatrix(sampler2D tex, float idx) {
float j = idx * 4.0;
float x = mod(j, skinMatricesTextureSize);
float y = floor(j / skinMatricesTextureSize) + 0.5;
vec2 scale = vec2(skinMatricesTextureSize);
return mat4(
texture2D(tex, vec2(x + 0.5, y) / scale),
texture2D(tex, vec2(x + 1.5, y) / scale),
texture2D(tex, vec2(x + 2.5, y) / scale),
texture2D(tex, vec2(x + 3.5, y) / scale)
);
}
mat4 getSkinMatrix(float idx) {
return getSkinMatrix(skinMatricesTexture, idx);
}
#else
uniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;
mat4 getSkinMatrix(float idx) {
return skinMatrix[int(idx)];
}
#endif
#endif
@end
@export clay.chunk.skin_matrix
mat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;
if (weight.y > 1e-4)
{
skinMatrixWS += getSkinMatrix(joint.y) * weight.y;
}
if (weight.z > 1e-4)
{
skinMatrixWS += getSkinMatrix(joint.z) * weight.z;
}
float weightW = 1.0-weight.x-weight.y-weight.z;
if (weightW > 1e-4)
{
skinMatrixWS += getSkinMatrix(joint.w) * weightW;
}
@end
@export clay.chunk.instancing_header
#ifdef INSTANCING
attribute vec4 instanceMat1;
attribute vec4 instanceMat2;
attribute vec4 instanceMat3;
#endif
@end
@export clay.chunk.instancing_matrix
mat4 instanceMat = mat4(
vec4(instanceMat1.xyz, 0.0),
vec4(instanceMat2.xyz, 0.0),
vec4(instanceMat3.xyz, 0.0),
vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)
);
@end
@export clay.util.parallax_correct
vec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {
vec3 first = (boxMax - pos) / dir;
vec3 second = (boxMin - pos) / dir;
vec3 further = max(first, second);
float dist = min(further.x, min(further.y, further.z));
vec3 fixedPos = pos + dir * dist;
vec3 boxCenter = (boxMax + boxMin) * 0.5;
return normalize(fixedPos - boxCenter);
}
@end
@export clay.util.clamp_sample
vec4 clampSample(const in sampler2D texture, const in vec2 coord)
{
#ifdef STEREO
float eye = step(0.5, coord.x) * 0.5;
vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));
#else
vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));
#endif
return texture2D(texture, coordClamped);
}
@end
@export clay.util.ACES
vec3 ACESToneMapping(vec3 color)
{
const float A = 2.51;
const float B = 0.03;
const float C = 2.43;
const float D = 0.59;
const float E = 0.14;
return (color * (A * color + B)) / (color * (C * color + D) + E);
}
@end`,o3=`
@export ecgl.common.transformUniforms
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;
uniform mat4 world : WORLD;
@end
@export ecgl.common.attributes
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
attribute vec3 normal : NORMAL;
@end
@export ecgl.common.uv.header
uniform vec2 uvRepeat : [1.0, 1.0];
uniform vec2 uvOffset : [0.0, 0.0];
uniform vec2 detailUvRepeat : [1.0, 1.0];
uniform vec2 detailUvOffset : [0.0, 0.0];
varying vec2 v_Texcoord;
varying vec2 v_DetailTexcoord;
@end
@export ecgl.common.uv.main
v_Texcoord = texcoord * uvRepeat + uvOffset;
v_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;
@end
@export ecgl.common.uv.fragmentHeader
varying vec2 v_Texcoord;
varying vec2 v_DetailTexcoord;
@end
@export ecgl.common.albedo.main
vec4 albedoTexel = vec4(1.0);
#ifdef DIFFUSEMAP_ENABLED
albedoTexel = texture2D(diffuseMap, v_Texcoord);
#ifdef SRGB_DECODE
albedoTexel = sRGBToLinear(albedoTexel);
#endif
#endif
#ifdef DETAILMAP_ENABLED
vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);
#ifdef SRGB_DECODE
detailTexel = sRGBToLinear(detailTexel);
#endif
albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);
albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;
#endif
@end
@export ecgl.common.wireframe.vertexHeader
#ifdef WIREFRAME_QUAD
attribute vec4 barycentric;
varying vec4 v_Barycentric;
#elif defined(WIREFRAME_TRIANGLE)
attribute vec3 barycentric;
varying vec3 v_Barycentric;
#endif
@end
@export ecgl.common.wireframe.vertexMain
#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)
v_Barycentric = barycentric;
#endif
@end
@export ecgl.common.wireframe.fragmentHeader
uniform float wireframeLineWidth : 1;
uniform vec4 wireframeLineColor: [0, 0, 0, 0.5];
#ifdef WIREFRAME_QUAD
varying vec4 v_Barycentric;
float edgeFactor () {
vec4 d = fwidth(v_Barycentric);
vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);
return min(min(min(a4.x, a4.y), a4.z), a4.w);
}
#elif defined(WIREFRAME_TRIANGLE)
varying vec3 v_Barycentric;
float edgeFactor () {
vec3 d = fwidth(v_Barycentric);
vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);
return min(min(a3.x, a3.y), a3.z);
}
#endif
@end
@export ecgl.common.wireframe.fragmentMain
#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)
if (wireframeLineWidth > 0.) {
vec4 lineColor = wireframeLineColor;
#ifdef SRGB_DECODE
lineColor = sRGBToLinear(lineColor);
#endif
gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);
}
#endif
@end
@export ecgl.common.bumpMap.header
#ifdef BUMPMAP_ENABLED
uniform sampler2D bumpMap;
uniform float bumpScale : 1.0;
vec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)
{
vec2 dSTdx = dFdx(v_Texcoord);
vec2 dSTdy = dFdy(v_Texcoord);
float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;
float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;
float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;
vec3 vSigmaX = dFdx(surfPos);
vec3 vSigmaY = dFdy(surfPos);
vec3 vN = surfNormal;
vec3 R1 = cross(vSigmaY, vN);
vec3 R2 = cross(vN, vSigmaX);
float fDet = dot(vSigmaX, R1);
vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);
return normalize(abs(fDet) * baseNormal - vGrad);
}
#endif
@end
@export ecgl.common.normalMap.vertexHeader
#ifdef NORMALMAP_ENABLED
attribute vec4 tangent : TANGENT;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif
@end
@export ecgl.common.normalMap.vertexMain
#ifdef NORMALMAP_ENABLED
if (dot(tangent, tangent) > 0.0) {
v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);
v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);
}
#endif
@end
@export ecgl.common.normalMap.fragmentHeader
#ifdef NORMALMAP_ENABLED
uniform sampler2D normalMap;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif
@end
@export ecgl.common.normalMap.fragmentMain
#ifdef NORMALMAP_ENABLED
if (dot(v_Tangent, v_Tangent) > 0.0) {
vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;
if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;
mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);
N = normalize(tbn * N);
}
}
#endif
@end
@export ecgl.common.vertexAnimation.header
#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
attribute vec3 prevNormal;
uniform float percent;
#endif
@end
@export ecgl.common.vertexAnimation.main
#ifdef VERTEX_ANIMATION
vec3 pos = mix(prevPosition, position, percent);
vec3 norm = mix(prevNormal, normal, percent);
#else
vec3 pos = position;
vec3 norm = normal;
#endif
@end
@export ecgl.common.ssaoMap.header
#ifdef SSAOMAP_ENABLED
uniform sampler2D ssaoMap;
uniform vec4 viewport : VIEWPORT;
#endif
@end
@export ecgl.common.ssaoMap.main
float ao = 1.0;
#ifdef SSAOMAP_ENABLED
ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;
#endif
@end
@export ecgl.common.diffuseLayer.header
#if (LAYER_DIFFUSEMAP_COUNT > 0)
uniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];
uniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];
#endif
@end
@export ecgl.common.emissiveLayer.header
#if (LAYER_EMISSIVEMAP_COUNT > 0)
uniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];
uniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];
#endif
@end
@export ecgl.common.layers.header
@import ecgl.common.diffuseLayer.header
@import ecgl.common.emissiveLayer.header
@end
@export ecgl.common.diffuseLayer.main
#if (LAYER_DIFFUSEMAP_COUNT > 0)
for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{
float intensity = layerDiffuseIntensity[_idx_];
vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);
#ifdef SRGB_DECODE
texel2 = sRGBToLinear(texel2);
#endif
albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);
albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;
}}
#endif
@end
@export ecgl.common.emissiveLayer.main
#if (LAYER_EMISSIVEMAP_COUNT > 0)
for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)
{{
vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];
#ifdef SRGB_DECODE
texel2 = sRGBToLinear(texel2);
#endif
float intensity = layerEmissionIntensity[_idx_];
gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;
}}
#endif
@end
`,s3=`@export ecgl.color.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
@import ecgl.common.uv.header
attribute vec2 texcoord : TEXCOORD_0;
attribute vec3 position: POSITION;
@import ecgl.common.wireframe.vertexHeader
#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif
#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
uniform float percent : 1.0;
#endif
#ifdef ATMOSPHERE_ENABLED
attribute vec3 normal: NORMAL;
uniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;
varying vec3 v_Normal;
#endif
void main()
{
#ifdef VERTEX_ANIMATION
vec3 pos = mix(prevPosition, position, percent);
#else
vec3 pos = position;
#endif
gl_Position = worldViewProjection * vec4(pos, 1.0);
@import ecgl.common.uv.main
#ifdef VERTEX_COLOR
v_Color = a_Color;
#endif
#ifdef ATMOSPHERE_ENABLED
v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);
#endif
@import ecgl.common.wireframe.vertexMain
}
@end
@export ecgl.color.fragment
#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0
uniform sampler2D diffuseMap;
uniform sampler2D detailMap;
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
varying vec3 v_Normal;
#endif
#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif
@import ecgl.common.layers.header
@import ecgl.common.uv.fragmentHeader
@import ecgl.common.wireframe.fragmentHeader
@import clay.util.srgb
void main()
{
#ifdef SRGB_DECODE
gl_FragColor = sRGBToLinear(color);
#else
gl_FragColor = color;
#endif
#ifdef VERTEX_COLOR
gl_FragColor *= v_Color;
#endif
@import ecgl.common.albedo.main
@import ecgl.common.diffuseLayer.main
gl_FragColor *= albedoTexel;
#ifdef ATMOSPHERE_ENABLED
float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
gl_FragColor.rgb += glowColor * atmoIntensity;
#endif
@import ecgl.common.emissiveLayer.main
@import ecgl.common.wireframe.fragmentMain
}
@end`,l3=`/**
* http: */
@export ecgl.lambert.vertex
@import ecgl.common.transformUniforms
@import ecgl.common.uv.header
@import ecgl.common.attributes
@import ecgl.common.wireframe.vertexHeader
#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif
@import ecgl.common.vertexAnimation.header
varying vec3 v_Normal;
varying vec3 v_WorldPosition;
void main()
{
@import ecgl.common.uv.main
@import ecgl.common.vertexAnimation.main
gl_Position = worldViewProjection * vec4(pos, 1.0);
v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);
v_WorldPosition = (world * vec4(pos, 1.0)).xyz;
#ifdef VERTEX_COLOR
v_Color = a_Color;
#endif
@import ecgl.common.wireframe.vertexMain
}
@end
@export ecgl.lambert.fragment
#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0
#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2
@import ecgl.common.uv.fragmentHeader
varying vec3 v_Normal;
varying vec3 v_WorldPosition;
uniform sampler2D diffuseMap;
uniform sampler2D detailMap;
@import ecgl.common.layers.header
uniform float emissionIntensity: 1.0;
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
uniform mat4 viewInverse : VIEWINVERSE;
#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
#endif
#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif
#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif
@import ecgl.common.ssaoMap.header
@import ecgl.common.bumpMap.header
@import clay.util.srgb
@import ecgl.common.wireframe.fragmentHeader
@import clay.plugin.compute_shadow_map
void main()
{
#ifdef SRGB_DECODE
gl_FragColor = sRGBToLinear(color);
#else
gl_FragColor = color;
#endif
#ifdef VERTEX_COLOR
#ifdef SRGB_DECODE
gl_FragColor *= sRGBToLinear(v_Color);
#else
gl_FragColor *= v_Color;
#endif
#endif
@import ecgl.common.albedo.main
@import ecgl.common.diffuseLayer.main
gl_FragColor *= albedoTexel;
vec3 N = v_Normal;
#ifdef DOUBLE_SIDED
vec3 eyePos = viewInverse[3].xyz;
vec3 V = normalize(eyePos - v_WorldPosition);
if (dot(N, V) < 0.0) {
N = -N;
}
#endif
float ambientFactor = 1.0;
#ifdef BUMPMAP_ENABLED
N = bumpNormal(v_WorldPosition, v_Normal, N);
ambientFactor = dot(v_Normal, N);
#endif
vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);
vec3 diffuseColor = vec3(0.0, 0.0, 0.0);
@import ecgl.common.ssaoMap.main
#ifdef AMBIENT_LIGHT_COUNT
for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)
{
diffuseColor += ambientLightColor[i] * ambientFactor * ao;
}
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
{{
diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;
}}
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
if(shadowEnabled)
{
computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
}
#endif
for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)
{
vec3 lightDirection = -directionalLightDirection[i];
vec3 lightColor = directionalLightColor[i];
float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
if (shadowEnabled)
{
shadowContrib = shadowContribsDir[i];
}
#endif
float ndl = dot(N, normalize(lightDirection)) * shadowContrib;
diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);
}
#endif
gl_FragColor.rgb *= diffuseColor;
#ifdef ATMOSPHERE_ENABLED
float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
gl_FragColor.rgb += glowColor * atmoIntensity;
#endif
@import ecgl.common.emissiveLayer.main
@import ecgl.common.wireframe.fragmentMain
}
@end`,u3=`@export ecgl.realistic.vertex
@import ecgl.common.transformUniforms
@import ecgl.common.uv.header
@import ecgl.common.attributes
@import ecgl.common.wireframe.vertexHeader
#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif
#ifdef NORMALMAP_ENABLED
attribute vec4 tangent : TANGENT;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif
@import ecgl.common.vertexAnimation.header
varying vec3 v_Normal;
varying vec3 v_WorldPosition;
void main()
{
@import ecgl.common.uv.main
@import ecgl.common.vertexAnimation.main
gl_Position = worldViewProjection * vec4(pos, 1.0);
v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);
v_WorldPosition = (world * vec4(pos, 1.0)).xyz;
#ifdef VERTEX_COLOR
v_Color = a_Color;
#endif
#ifdef NORMALMAP_ENABLED
v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);
v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);
#endif
@import ecgl.common.wireframe.vertexMain
}
@end
@export ecgl.realistic.fragment
#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0
#define PI 3.14159265358979
#define ROUGHNESS_CHANEL 0
#define METALNESS_CHANEL 1
#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2
#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif
@import ecgl.common.uv.fragmentHeader
varying vec3 v_Normal;
varying vec3 v_WorldPosition;
uniform sampler2D diffuseMap;
uniform sampler2D detailMap;
uniform sampler2D metalnessMap;
uniform sampler2D roughnessMap;
@import ecgl.common.layers.header
uniform float emissionIntensity: 1.0;
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
uniform float metalness : 0.0;
uniform float roughness : 0.5;
uniform mat4 viewInverse : VIEWINVERSE;
#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
#endif
#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif
#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT
@import clay.header.ambient_cubemap_light
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif
@import ecgl.common.normalMap.fragmentHeader
@import ecgl.common.ssaoMap.header
@import ecgl.common.bumpMap.header
@import clay.util.srgb
@import clay.util.rgbm
@import ecgl.common.wireframe.fragmentHeader
@import clay.plugin.compute_shadow_map
vec3 F_Schlick(float ndv, vec3 spec) {
return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);
}
float D_Phong(float g, float ndh) {
float a = pow(8192.0, g);
return (a + 2.0) / 8.0 * pow(ndh, a);
}
void main()
{
vec4 albedoColor = color;
vec3 eyePos = viewInverse[3].xyz;
vec3 V = normalize(eyePos - v_WorldPosition);
#ifdef VERTEX_COLOR
#ifdef SRGB_DECODE
albedoColor *= sRGBToLinear(v_Color);
#else
albedoColor *= v_Color;
#endif
#endif
@import ecgl.common.albedo.main
@import ecgl.common.diffuseLayer.main
albedoColor *= albedoTexel;
float m = metalness;
#ifdef METALNESSMAP_ENABLED
float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];
m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);
#endif
vec3 baseColor = albedoColor.rgb;
albedoColor.rgb = baseColor * (1.0 - m);
vec3 specFactor = mix(vec3(0.04), baseColor, m);
float g = 1.0 - roughness;
#ifdef ROUGHNESSMAP_ENABLED
float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];
g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);
#endif
vec3 N = v_Normal;
#ifdef DOUBLE_SIDED
if (dot(N, V) < 0.0) {
N = -N;
}
#endif
float ambientFactor = 1.0;
#ifdef BUMPMAP_ENABLED
N = bumpNormal(v_WorldPosition, v_Normal, N);
ambientFactor = dot(v_Normal, N);
#endif
@import ecgl.common.normalMap.fragmentMain
vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);
vec3 diffuseTerm = vec3(0.0);
vec3 specularTerm = vec3(0.0);
float ndv = clamp(dot(N, V), 0.0, 1.0);
vec3 fresnelTerm = F_Schlick(ndv, specFactor);
@import ecgl.common.ssaoMap.main
#ifdef AMBIENT_LIGHT_COUNT
for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)
{{
diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;
}}
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
{{
diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;
}}
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
if(shadowEnabled)
{
computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
}
#endif
for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)
{{
vec3 L = -directionalLightDirection[_idx_];
vec3 lc = directionalLightColor[_idx_];
vec3 H = normalize(L + V);
float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);
float ndh = clamp(dot(N, H), 0.0, 1.0);
float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
if (shadowEnabled)
{
shadowContrib = shadowContribsDir[_idx_];
}
#endif
vec3 li = lc * ndl * shadowContrib;
diffuseTerm += li;
specularTerm += li * fresnelTerm * D_Phong(g, ndh);
}}
#endif
#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT
vec3 L = reflect(-V, N);
L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);
float rough2 = clamp(1.0 - g, 0.0, 1.0);
float bias2 = rough2 * 5.0;
vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;
vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;
vec3 envTexel2;
for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)
{{
envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);
specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;
}}
#endif
gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;
gl_FragColor.a = albedoColor.a;
#ifdef ATMOSPHERE_ENABLED
float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
gl_FragColor.rgb += glowColor * atmoIntensity;
#endif
#ifdef SRGB_ENCODE
gl_FragColor = linearTosRGB(gl_FragColor);
#endif
@import ecgl.common.emissiveLayer.main
@import ecgl.common.wireframe.fragmentMain
}
@end`,f3=`@export ecgl.hatching.vertex
@import ecgl.realistic.vertex
@end
@export ecgl.hatching.fragment
#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2
@import ecgl.common.uv.fragmentHeader
varying vec3 v_Normal;
varying vec3 v_WorldPosition;
uniform vec4 color : [0.0, 0.0, 0.0, 1.0];
uniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];
uniform mat4 viewInverse : VIEWINVERSE;
#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif
#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif
@import ecgl.common.ssaoMap.header
@import ecgl.common.bumpMap.header
@import clay.util.srgb
@import ecgl.common.wireframe.fragmentHeader
@import clay.plugin.compute_shadow_map
uniform sampler2D hatch1;
uniform sampler2D hatch2;
uniform sampler2D hatch3;
uniform sampler2D hatch4;
uniform sampler2D hatch5;
uniform sampler2D hatch6;
float shade(in float tone) {
vec4 c = vec4(1. ,1., 1., 1.);
float step = 1. / 6.;
vec2 uv = v_DetailTexcoord;
if (tone <= step / 2.0) {
c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);
}
else if (tone <= step) {
c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);
}
if(tone > step && tone <= 2. * step){
c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));
}
if(tone > 2. * step && tone <= 3. * step){
c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));
}
if(tone > 3. * step && tone <= 4. * step){
c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));
}
if(tone > 4. * step && tone <= 5. * step){
c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));
}
if(tone > 5. * step){
c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));
}
return c.r;
}
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
#ifdef SRGB_DECODE
vec4 inkColor = sRGBToLinear(color);
#else
vec4 inkColor = color;
#endif
#ifdef VERTEX_COLOR
#ifdef SRGB_DECODE
inkColor *= sRGBToLinear(v_Color);
#else
inkColor *= v_Color;
#endif
#endif
vec3 N = v_Normal;
#ifdef DOUBLE_SIDED
vec3 eyePos = viewInverse[3].xyz;
vec3 V = normalize(eyePos - v_WorldPosition);
if (dot(N, V) < 0.0) {
N = -N;
}
#endif
float tone = 0.0;
float ambientFactor = 1.0;
#ifdef BUMPMAP_ENABLED
N = bumpNormal(v_WorldPosition, v_Normal, N);
ambientFactor = dot(v_Normal, N);
#endif
vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);
@import ecgl.common.ssaoMap.main
#ifdef AMBIENT_LIGHT_COUNT
for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)
{
tone += dot(ambientLightColor[i], w) * ambientFactor * ao;
}
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
{{
tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;
}}
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
if(shadowEnabled)
{
computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
}
#endif
for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)
{
vec3 lightDirection = -directionalLightDirection[i];
float lightTone = dot(directionalLightColor[i], w);
float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
if (shadowEnabled)
{
shadowContrib = shadowContribsDir[i];
}
#endif
float ndl = dot(N, normalize(lightDirection)) * shadowContrib;
tone += lightTone * clamp(ndl, 0.0, 1.0);
}
#endif
gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));
}
@end
`,h3=`@export ecgl.sm.depth.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
uniform float percent : 1.0;
#endif
varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;
void main(){
#ifdef VERTEX_ANIMATION
vec3 pos = mix(prevPosition, position, percent);
#else
vec3 pos = position;
#endif
v_ViewPosition = worldViewProjection * vec4(pos, 1.0);
gl_Position = v_ViewPosition;
v_Texcoord = texcoord;
}
@end
@export ecgl.sm.depth.fragment
@import clay.sm.depth.fragment
@end`;Object.assign(ti.prototype,n3);$.import(a3);$.import(yw);$.import(o3);$.import(s3);$.import(l3);$.import(u3);$.import(f3);$.import(h3);function c3(t){return!t||t==="none"}function Ew(t){return t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof Image}function v3(t){return t.getZr&&t.setOption}var d3=ji.prototype.addToScene,p3=ji.prototype.removeFromScene;ji.prototype.addToScene=function(t){if(d3.call(this,t),this.__zr){var e=this.__zr;t.traverse(function(r){r.__zr=e,r.addAnimatorsToZr&&r.addAnimatorsToZr(e)})}};ji.prototype.removeFromScene=function(t){p3.call(this,t),t.traverse(function(e){var r=e.__zr;e.__zr=null,r&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(r)})};Si.prototype.setTextureImage=function(t,e,r,i){if(this.shader){var n=r.getZr(),a=this,o;return a.autoUpdateTextureStatus=!1,a.disableTexture(t),c3(e)||(o=U.loadTexture(e,r,i,function(s){a.enableTexture(t),n&&n.refresh()}),a.set(t,o)),o}};var U={};U.Renderer=yr;U.Node=ti;U.Mesh=Ve;U.Shader=$;U.Material=Si;U.Texture=W;U.Texture2D=At;U.Geometry=Ut;U.SphereGeometry=JO;U.PlaneGeometry=Vp;U.CubeGeometry=bw;U.AmbientLight=t3;U.DirectionalLight=e3;U.PointLight=r3;U.SpotLight=i3;U.PerspectiveCamera=ve;U.OrthographicCamera=Os;U.Vector2=st;U.Vector3=B;U.Vector4=St;U.Quaternion=It;U.Matrix2=Fe;U.Matrix2d=$e;U.Matrix3=fe;U.Matrix4=q;U.Plane=ps;U.Ray=Zn;U.BoundingBox=ye;U.Frustum=Wf;var Yl=null;function g3(){return Yl!==null||(Yl=ei.createBlank("rgba(255,255,255,0)").image),Yl}function Q_(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function J_(t){if((t.wrapS===W.REPEAT||t.wrapT===W.REPEAT)&&t.image){var e=Q_(t.width),r=Q_(t.height);if(e!==t.width||r!==t.height){var i=document.createElement("canvas");i.width=e,i.height=r;var n=i.getContext("2d");n.drawImage(t.image,0,0,e,r),t.image=i}}}U.loadTexture=function(t,e,r,i){typeof r=="function"&&(i=r,r={}),r=r||{};for(var n=Object.keys(r).sort(),a="",o=0;o<n.length;o++)a+=n[o]+"_"+r[n[o]]+"_";var s=e.__textureCache=e.__textureCache||new lo(20);if(v3(t)){var l=t.__textureid__,u=s.get(a+l);if(u)u.texture.surface.setECharts(t),i&&i(u.texture);else{var f=new cd(t);f.onupdate=function(){e.getZr().refresh()},u={texture:f.getTexture()};for(var o=0;o<n.length;o++)u.texture[n[o]]=r[n[o]];l=t.__textureid__||"__ecgl_ec__"+u.texture.__uid__,t.__textureid__=l,s.put(a+l,u),i&&i(u.texture)}return u.texture}else if(Ew(t)){var l=t.__textureid__,u=s.get(a+l);if(!u){u={texture:new U.Texture2D({image:t})};for(var o=0;o<n.length;o++)u.texture[n[o]]=r[n[o]];l=t.__textureid__||"__ecgl_image__"+u.texture.__uid__,t.__textureid__=l,s.put(a+l,u),J_(u.texture),i&&i(u.texture)}return u.texture}else{var u=s.get(a+t);if(u)u.callbacks?u.callbacks.push(i):i&&i(u.texture);else if(t.match(/.hdr$|^data:application\/octet-stream/)){u={callbacks:[i]};var h=ei.loadTexture(t,{exposure:r.exposure,fileType:"hdr"},function(){h.dirty(),u.callbacks.forEach(function(d){d&&d(h)}),u.callbacks=null});u.texture=h,s.put(a+t,u)}else{for(var h=new U.Texture2D({image:new Image}),o=0;o<n.length;o++)h[n[o]]=r[n[o]];u={texture:h,callbacks:[i]};var v=h.image;v.onload=function(){h.image=v,J_(h),h.dirty(),u.callbacks.forEach(function(p){p&&p(h)}),u.callbacks=null},v.crossOrigin="Anonymous",v.src=t,h.image=g3(),s.put(a+t,u)}return u.texture}};U.createAmbientCubemap=function(t,e,r,i){t=t||{};var n=t.texture,a=mr.firstNotNull(t.exposure,1),o=new qO({intensity:mr.firstNotNull(t.specularIntensity,1)}),s=new $O({intensity:mr.firstNotNull(t.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return o.cubemap=U.loadTexture(n,r,{exposure:a},function(){o.cubemap.flipY=!1,o.prefilter(e,32),s.coefficients=Aw.projectEnvironmentMap(e,o.cubemap,{lod:1}),i&&i()}),{specular:o,diffuse:s}};U.createBlankTexture=ei.createBlank;U.isImage=Ew;U.additiveBlend=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)};U.parseColor=function(t,e){return t instanceof Array?(e||(e=[]),e[0]=t[0],e[1]=t[1],e[2]=t[2],t.length>3?e[3]=t[3]:e[3]=1,e):(e=Be(t||"#000",e)||[0,0,0,0],e[0]/=255,e[1]/=255,e[2]/=255,e)};U.directionFromAlphaBeta=function(t,e){var r=t/180*Math.PI+Math.PI/2,i=-e/180*Math.PI+Math.PI/2,n=[],a=Math.sin(r);return n[0]=a*Math.cos(i),n[1]=-Math.cos(r),n[2]=a*Math.sin(i),n};U.getShadowResolution=function(t){var e=1024;switch(t){case"low":e=512;break;case"medium":break;case"high":e=2048;break;case"ultra":e=4096;break}return e};U.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"];U.createShader=function(t){t==="ecgl.shadow"&&(t="ecgl.displayShadow");var e=$.source(t+".vertex"),r=$.source(t+".fragment");e||console.error("Vertex shader of '%s' not exits",t),r||console.error("Fragment shader of '%s' not exits",t);var i=new $(e,r);return i.name=t,i};U.createMaterial=function(t,e){e instanceof Array||(e=[e]);var r=U.createShader(t),i=new Si({shader:r});return e.forEach(function(n){typeof n=="string"&&i.define(n)}),i};U.setMaterialFromModel=function(t,e,r,i){e.autoUpdateTextureStatus=!1;var n=r.getModel(t+"Material"),a=n.get("detailTexture"),o=mr.firstNotNull(n.get("textureTiling"),1),s=mr.firstNotNull(n.get("textureOffset"),0);typeof o=="number"&&(o=[o,o]),typeof s=="number"&&(s=[s,s]);var l=o[0]>1||o[1]>1?U.Texture.REPEAT:U.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if(t==="realistic"){var f=n.get("roughness"),h=n.get("metalness");h!=null?isNaN(h)&&(e.setTextureImage("metalnessMap",h,i,u),h=mr.firstNotNull(n.get("metalnessAdjust"),.5)):h=0,f!=null?isNaN(f)&&(e.setTextureImage("roughnessMap",f,i,u),f=mr.firstNotNull(n.get("roughnessAdjust"),.5)):f=.5;var v=n.get("normalTexture");e.setTextureImage("detailMap",a,i,u),e.setTextureImage("normalMap",v,i,u),e.set({roughness:f,metalness:h,detailUvRepeat:o,detailUvOffset:s})}else if(t==="lambert")e.setTextureImage("detailMap",a,i,u),e.set({detailUvRepeat:o,detailUvOffset:s});else if(t==="color")e.setTextureImage("detailMap",a,i,u),e.set({detailUvRepeat:o,detailUvOffset:s});else if(t==="hatching"){var c=n.get("hatchingTextures")||[];c.length<6;for(var d=0;d<6;d++)e.setTextureImage("hatch"+(d+1),c[d],i,{anisotropic:8,wrapS:U.Texture.REPEAT,wrapT:U.Texture.REPEAT});e.set({detailUvRepeat:o,detailUvOffset:s})}};U.updateVertexAnimation=function(t,e,r,i){var n=i.get("animation"),a=i.get("animationDurationUpdate"),o=i.get("animationEasingUpdate"),s=r.shadowDepthMaterial;if(n&&e&&a>0&&e.geometry.vertexCount===r.geometry.vertexCount){r.material.define("vertex","VERTEX_ANIMATION"),r.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<t.length;l++)r.geometry.attributes[t[l][0]].value=e.geometry.attributes[t[l][1]].value;r.geometry.dirty(),r.__percent=0,r.material.set("percent",0),r.stopAnimation(),r.animate().when(a,{__percent:1}).during(function(){r.material.set("percent",r.__percent),s&&s.set("percent",r.__percent)}).done(function(){r.ignorePreZ=!1,r.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")}).start(o)}else r.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")};var zt=function(t,e){this.id=t,this.zr=e;try{this.renderer=new yr({clearBit:0,devicePixelRatio:e.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(e.painter.getWidth(),e.painter.getHeight())}catch(i){this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does not support WebGL",console.error(i);return}this.onglobalout=this.onglobalout.bind(this),e.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var r=this.dom.style;r.position="absolute",r.left="0",r.top="0",this.views=[],this._picking=new Up({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new Kt({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null,this._disposed=!1};zt.prototype.setUnpainted=function(){};zt.prototype.addView=function(t){if(t.layer!==this){var e=this._viewsToDispose.indexOf(t);e>=0&&this._viewsToDispose.splice(e,1),this.views.push(t),t.layer=this;var r=this.zr;t.scene.traverse(function(i){i.__zr=r,i.addAnimatorsToZr&&i.addAnimatorsToZr(r)})}};function Mw(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)}zt.prototype.removeView=function(t){if(t.layer===this){var e=this.views.indexOf(t);e>=0&&(this.views.splice(e,1),t.scene.traverse(Mw,this),t.layer=null,this._viewsToDispose.push(t))}};zt.prototype.removeViewsAll=function(){this.views.forEach(function(t){t.scene.traverse(Mw,this),t.layer=null,this._viewsToDispose.push(t)},this),this.views.length=0};zt.prototype.resize=function(t,e){var r=this.renderer;r.resize(t,e)};zt.prototype.clear=function(){var t=this.renderer.gl,e=this._backgroundColor||[0,0,0,0];t.clearColor(e[0],e[1],e[2],e[3]),t.depthMask(!0),t.colorMask(!0,!0,!0,!0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT)};zt.prototype.clearDepth=function(){var t=this.renderer.gl;t.clear(t.DEPTH_BUFFER_BIT)};zt.prototype.clearColor=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)};zt.prototype.needsRefresh=function(){this.zr.refresh()};zt.prototype.refresh=function(t){this._backgroundColor=t?U.parseColor(t):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var e=0;e<this.views.length;e++)this.views[e].prepareRender(this.renderer);this._doRender(!1),this._trackAndClean();for(var e=0;e<this._viewsToDispose.length;e++)this._viewsToDispose[e].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()};zt.prototype.renderToCanvas=function(t){this._startAccumulating(!0),t.drawImage(this.dom,0,0,t.canvas.width,t.canvas.height)};zt.prototype._doRender=function(t){this.clear(),this.renderer.saveViewport();for(var e=0;e<this.views.length;e++)this.views[e].render(this.renderer,t);this.renderer.restoreViewport()};zt.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var m3=1;zt.prototype._startAccumulating=function(t){var e=this;this._stopAccumulating();for(var r=!1,i=0;i<this.views.length;i++)r=this.views[i].needsAccumulate()||r;if(!r)return;function n(a){if(!(!e._accumulatingId||a!==e._accumulatingId)){for(var o=!0,s=0;s<e.views.length;s++)o=e.views[s].isAccumulateFinished()&&r;o||(e._doRender(!0),t?n(a):ms(function(){n(a)}))}}this._accumulatingId=m3++,t?n(e._accumulatingId):this._accumulatingTimeout=setTimeout(function(){n(e._accumulatingId)},50)};zt.prototype._trackAndClean=function(){var t=[],e=[];this._textureList&&(Qu(this._textureList),Qu(this._geometriesList));for(var r=0;r<this.views.length;r++)_3(this.views[r].scene,t,e);this._textureList&&(Ju(this.renderer,this._textureList),Ju(this.renderer,this._geometriesList)),this._textureList=t,this._geometriesList=e};function Qu(t){for(var e=0;e<t.length;e++)t[e].__used__=0}function Ju(t,e){for(var r=0;r<e.length;r++)e[r].__used__||e[r].dispose(t)}function Zl(t,e){t.__used__=t.__used__||0,t.__used__++,t.__used__===1&&e.push(t)}function _3(t,e,r){var i,n;t.traverse(function(o){if(o.isRenderable()){var s=o.geometry,l=o.material;if(l!==i)for(var u=l.getTextureUniforms(),f=0;f<u.length;f++){var h=u[f],v=l.uniforms[h].value;if(v){if(v instanceof W)Zl(v,e);else if(v instanceof Array)for(var c=0;c<v.length;c++)v[c]instanceof W&&Zl(v[c],e)}}s!==n&&Zl(s,r),i=l,n=s}});for(var a=0;a<t.lights.length;a++)t.lights[a].cubemap&&Zl(t.lights[a].cubemap,e)}zt.prototype.dispose=function(){this._disposed||(this._stopAccumulating(),this._textureList&&(Qu(this._textureList),Qu(this._geometriesList),Ju(this.renderer,this._textureList),Ju(this.renderer,this._geometriesList)),this.zr.off("globalout",this.onglobalout),this._disposed=!0)};zt.prototype.onmousedown=function(t){if(!(t.target&&t.target.__isGLToZRProxy)){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY);e&&(this._dispatchEvent("mousedown",t,e),this._dispatchDataEvent("mousedown",t,e)),this._downX=t.offsetX,this._downY=t.offsetY}};zt.prototype.onmousemove=function(t){if(!(t.target&&t.target.__isGLToZRProxy)){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY),r=e&&e.target,i=this._hovered;this._hovered=e,i&&r!==i.target&&(i.relatedTarget=r,this._dispatchEvent("mouseout",t,i),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",t,e),e&&(this.zr.setCursorStyle("pointer"),(!i||r!==i.target)&&this._dispatchEvent("mouseover",t,e)),this._dispatchDataEvent("mousemove",t,e)}};zt.prototype.onmouseup=function(t){if(!(t.target&&t.target.__isGLToZRProxy)){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY);e&&(this._dispatchEvent("mouseup",t,e),this._dispatchDataEvent("mouseup",t,e)),this._upX=t.offsetX,this._upY=t.offsetY}};zt.prototype.onclick=zt.prototype.dblclick=function(t){if(!(t.target&&t.target.__isGLToZRProxy)){var e=this._upX-this._downX,r=this._upY-this._downY;if(!(Math.sqrt(e*e+r*r)>20)){t=t.event;var i=this.pickObject(t.offsetX,t.offsetY);i&&(this._dispatchEvent(t.type,t,i),this._dispatchDataEvent(t.type,t,i));var n=this._clickToSetFocusPoint(t);if(n){var a=n.view.setDOFFocusOnPoint(n.distance);a&&this.zr.refresh()}}}};zt.prototype._clickToSetFocusPoint=function(t){for(var e=this.renderer,r=e.viewport,i=this.views.length-1;i>=0;i--){var n=this.views[i];if(n.hasDOF()&&n.containPoint(t.offsetX,t.offsetY)){this._picking.scene=n.scene,this._picking.camera=n.camera,e.viewport=n.viewport;var a=this._picking.pick(t.offsetX,t.offsetY,!0);if(a)return a.view=n,a}}e.viewport=r};zt.prototype.onglobalout=function(t){var e=this._hovered;e&&this._dispatchEvent("mouseout",t,{target:e.target})};zt.prototype.pickObject=function(t,e){for(var r=[],i=this.renderer,n=i.viewport,a=0;a<this.views.length;a++){var o=this.views[a];o.containPoint(t,e)&&(this._picking.scene=o.scene,this._picking.camera=o.camera,i.viewport=o.viewport,this._picking.pickAll(t,e,r))}return i.viewport=n,r.sort(function(s,l){return s.distance-l.distance}),r[0]};zt.prototype._dispatchEvent=function(t,e,r){r||(r={});var i=r.target;for(r.cancelBubble=!1,r.event=e,r.type=t,r.offsetX=e.offsetX,r.offsetY=e.offsetY;i&&(i.trigger(t,r),i=i.getParent(),!r.cancelBubble););this._dispatchToView(t,r)};zt.prototype._dispatchDataEvent=function(t,e,r){var i=r&&r.target,n=i&&i.dataIndex,a=i&&i.seriesIndex,o=i&&i.eventData,s=!1,l=this._zrEventProxy;l.x=e.offsetX,l.y=e.offsetY,l.update();var u={target:l};const f=Mt(l);t==="mousemove"&&(n!=null?n!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(f.dataIndex=this._lastDataIndex,f.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0):o!=null&&o!==this._lastEventData&&(this._lastEventData!=null&&(f.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0),this._lastEventData=o,this._lastDataIndex=n,this._lastSeriesIndex=a),f.eventData=o,f.dataIndex=n,f.seriesIndex=a,(o!=null||parseInt(n,10)>=0&&parseInt(a,10)>=0)&&(this.zr.handler.dispatchToElement(u,t,e),s&&this.zr.handler.dispatchToElement(u,"mouseover",e))};zt.prototype._dispatchToView=function(t,e){for(var r=0;r<this.views.length;r++)this.views[r].containPoint(e.offsetX,e.offsetY)&&this.views[r].trigger(t,e)};Object.assign(zt.prototype,zp);var y3=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function ts(t,e){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var r=t[e].normal,i=t[e].emphasis;r&&(t[e]=r),i&&(t.emphasis=t.emphasis||{},t.emphasis[e]=i)}}function x3(t){ts(t,"itemStyle"),ts(t,"lineStyle"),ts(t,"areaStyle"),ts(t,"label")}function ql(t){t&&(t instanceof Array||(t=[t]),C(t,function(e){if(e.axisLabel){var r=e.axisLabel;Object.assign(r,r.textStyle),r.textStyle=null}}))}function T3(t){C(t.series,function(e){bt(y3,e.type)>=0&&(x3(e),e.coordinateSystem==="mapbox"&&(e.coordinateSystem="mapbox3D",t.mapbox3D=t.mapbox))}),ql(t.xAxis3D),ql(t.yAxis3D),ql(t.zAxis3D),ql(t.grid3D),ts(t.geo3D)}function Cw(t){this._layers={},this._zr=t}Cw.prototype.update=function(t,e){var r=this,i=e.getZr();if(!i.getWidth()||!i.getHeight()){console.warn("Dom has no width or height");return}function n(s){i.setSleepAfterStill(0);var l;s.coordinateSystem&&s.coordinateSystem.model,l=s.get("zlevel");var u=r._layers,f=u[l];if(!f){if(f=u[l]=new zt("gl-"+l,i),i.painter.isSingleCanvas()){f.virtual=!0;var h=new ir({z:1e4,style:{image:f.renderer.canvas},silent:!0});f.__hostImage=h,i.add(h)}i.painter.insertLayer(l,f)}return f.__hostImage&&f.__hostImage.setStyle({width:f.renderer.getWidth(),height:f.renderer.getHeight()}),f}function a(s,l){s&&s.traverse(function(u){u.isRenderable&&u.isRenderable()&&(u.ignorePicking=u.$ignorePicking!=null?u.$ignorePicking:l)})}for(var o in this._layers)this._layers[o].removeViewsAll();t.eachComponent(function(s,l){if(s!=="series"){var u=e.getViewOfComponentModel(l),f=l.coordinateSystem;if(u.__ecgl__){var h;if(f){if(!f.viewGL){console.error("Can't find viewGL in coordinateSystem of component "+l.id);return}h=f.viewGL}else{if(!l.viewGL){console.error("Can't find viewGL of component "+l.id);return}h=f.viewGL}var h=f.viewGL,v=n(l);v.addView(h),u.afterRender&&u.afterRender(l,t,e,v),a(u.groupGL,l.get("silent"))}}}),t.eachSeries(function(s){var l=e.getViewOfSeriesModel(s),u=s.coordinateSystem;if(l.__ecgl__){if(u&&!u.viewGL&&!l.viewGL){console.error("Can't find viewGL of series "+l.id);return}var f=u&&u.viewGL||l.viewGL,h=n(s);h.addView(f),l.afterRender&&l.afterRender(s,t,e,h),a(l.groupGL,s.get("silent"))}})};pS(function(t){var e=t.getZr(),r=e.painter.dispose;e.painter.dispose=function(){typeof this.eachOtherLayer=="function"&&this.eachOtherLayer(function(i){i instanceof zt&&i.dispose()}),r.call(this)},e.painter.getRenderedCanvas=function(i){if(i=i||{},this._singleCanvas)return this._layers[0].dom;var n=document.createElement("canvas"),a=i.pixelRatio||this.dpr;n.width=this.getWidth()*a,n.height=this.getHeight()*a;var o=n.getContext("2d");o.dpr=a,o.clearRect(0,0,n.width,n.height),i.backgroundColor&&(o.fillStyle=i.backgroundColor,o.fillRect(0,0,n.width,n.height));var s=this.storage.getDisplayList(!0),l={},u,f=this;function h(p,g){var m=f._zlevelList;p==null&&(p=-1/0);for(var _,y=0;y<m.length;y++){var x=m[y],S=f._layers[x];if(!S.__builtin__&&x>p&&x<g){_=S;break}}_&&_.renderToCanvas&&(o.save(),_.renderToCanvas(o),o.restore())}for(var v={ctx:o},c=0;c<s.length;c++){var d=s[c];d.zlevel!==u&&(h(u,d.zlevel),u=d.zlevel),this._doPaintEl(d,v,!0,null,l)}return h(u,1/0),n}});gS(function(t,e){var r=e.getZr(),i=r.__egl=r.__egl||new Cw(r);i.update(t,e)});Ap(T3);const S3={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(t){t=t||{},this.option.viewControl=this.option.viewControl||{},t.alpha!=null&&(this.option.viewControl.alpha=t.alpha),t.beta!=null&&(this.option.viewControl.beta=t.beta),t.distance!=null&&(this.option.viewControl.distance=t.distance),t.center!=null&&(this.option.viewControl.center=t.center)}},w3={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}},b3={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}};var Yf=Rt.extend({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}}});dt(Yf.prototype,S3);dt(Yf.prototype,w3);dt(Yf.prototype,b3);var Ho=mr.firstNotNull,ty={left:0,middle:1,right:2};function ey(t){return t instanceof Array||(t=[t,t]),t}var Dw=Se.extend(function(){return{zr:null,viewGL:null,_center:new B,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new st,_panVelocity:new st,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}},function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach(function(t){this[t]=this[t].bind(this)},this)},{init:function(){var t=this.zr;t&&(t.on("mousedown",this._mouseDownHandler),t.on("globalout",this._mouseUpHandler),t.on("mousewheel",this._mouseWheelHandler),t.on("pinch",this._pinchHandler),t.animation.on("frame",this._update),t.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var t=this.zr;t&&(t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("pinch",this._pinchHandler),t.off("globalout",this._mouseUpHandler),t.dom.removeEventListener("contextmenu",this._contextMenuHandler),t.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(t){this._distance=t,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(t){this._orthoSize=t,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(t){t=Math.max(Math.min(this.maxAlpha,t),this.minAlpha),this._theta=t/180*Math.PI,this._needsUpdate=!0},setBeta:function(t){t=Math.max(Math.min(this.maxBeta,t),this.minBeta),this._phi=-t/180*Math.PI,this._needsUpdate=!0},setCenter:function(t){this._center.setArray(t)},setViewGL:function(t){this.viewGL=t},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(t,e){e=e||{};var r=e.baseDistance||0,i=e.baseOrthoSize||1,n=t.get("projection");n!=="perspective"&&n!=="orthographic"&&n!=="isometric"&&(n="perspective"),this._projection=n,this.viewGL.setProjection(n);var a=t.get("distance")+r,o=t.get("orthographicSize")+i;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach(function(v){this[v[0]]=Ho(t.get(v[0]),v[1])},this),this.minDistance+=r,this.maxDistance+=r,this.minOrthographicSize+=i,this.maxOrthographicSize+=i;var s=t.ecModel,l={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach(function(v){l[v]=Ho(t.get(v),s&&s.get(v))});var u=Ho(e.alpha,t.get("alpha"))||0,f=Ho(e.beta,t.get("beta"))||0,h=Ho(e.center,t.get("center"))||[0,0,0];l.animation&&l.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:u,beta:f,center:h,distance:a,orthographicSize:o,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(u),this.setBeta(f),this.setCenter(h),this.setOrthographicSize(o)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){},animateTo:function(t){var e=this.zr,r=this,i={},n={};return t.distance!=null&&(i.distance=this.getDistance(),n.distance=t.distance),t.orthographicSize!=null&&(i.orthographicSize=this.getOrthographicSize(),n.orthographicSize=t.orthographicSize),t.alpha!=null&&(i.alpha=this.getAlpha(),n.alpha=t.alpha),t.beta!=null&&(i.beta=this.getBeta(),n.beta=t.beta),t.center!=null&&(i.center=this.getCenter(),n.center=t.center),this._addAnimator(e.animation.animate(i).when(t.duration||1e3,n).during(function(){i.alpha!=null&&r.setAlpha(i.alpha),i.beta!=null&&r.setBeta(i.beta),i.distance!=null&&r.setDistance(i.distance),i.center!=null&&r.setCenter(i.center),i.orthographicSize!=null&&r.setOrthographicSize(i.orthographicSize),r._needsUpdate=!0})).start(t.easing||"linear")},stopAllAnimation:function(){for(var t=0;t<this._animators.length;t++)this._animators[t].stop();this._animators.length=0},update:function(){this._needsUpdate=!0,this._update(20)},_isAnimating:function(){return this._animators.length>0},_update:function(t){if(this._rotating){var e=(this.autoRotateDirection==="cw"?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=e*t/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&&(t=Math.min(t,50),this._updateDistanceOrSize(t),this._updatePan(t),this._updateRotate(t),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(t){var e=this._rotateVelocity;this._phi=e.y*t/20+this._phi,this._theta=e.x*t/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(e,Math.pow(this.damping,t/16))},_updateDistanceOrSize:function(t){this._projection==="perspective"?this._setDistance(this._distance+this._zoomSpeed*t/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*t/20),this._zoomSpeed*=Math.pow(this.damping,t/16)},_setDistance:function(t){this._distance=Math.max(Math.min(t,this.maxDistance),this.minDistance)},_setOrthoSize:function(t){this._orthoSize=Math.max(Math.min(t,this.maxOrthographicSize),this.minOrthographicSize);var e=this.getCamera(),r=this._orthoSize,i=r/this.viewGL.viewport.height*this.viewGL.viewport.width;e.left=-i/2,e.right=i/2,e.top=r/2,e.bottom=-r/2},_updatePan:function(t){var e=this._panVelocity,r=this._distance,i=this.getCamera(),n=i.worldTransform.y,a=i.worldTransform.x;this._center.scaleAndAdd(a,-e.x*r/200).scaleAndAdd(n,-e.y*r/200),this._vectorDamping(e,0)},_updateTransform:function(){var t=this.getCamera(),e=new B,r=this._theta+Math.PI/2,i=this._phi+Math.PI/2,n=Math.sin(r);e.x=n*Math.cos(i),e.y=-Math.cos(r),e.z=n*Math.sin(i),t.position.copy(this._center).scaleAndAdd(e,this._distance),t.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var t=this.autoRotateAfterStill,e=this;!isNaN(t)&&t>0&&(this._stillTimeout=setTimeout(function(){e._rotating=!0},t*1e3))},_vectorDamping:function(t,e){var r=t.len();r=r*e,r<1e-4&&(r=0),t.normalize().scale(r)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var t=this.getCamera().worldTransform.z,e=Math.asin(t.y),r=Math.atan2(t.x,t.z);this._theta=e,this._phi=-r,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(t){if(!t.target&&!this._isAnimating()){var e=t.offsetX,r=t.offsetY;this.viewGL&&!this.viewGL.containPoint(e,r)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),t.event.targetTouches?t.event.targetTouches.length===1&&(this._mode="rotate"):t.event.button===ty[this.rotateMouseButton]?this._mode="rotate":t.event.button===ty[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=t.offsetX,this._mouseY=t.offsetY)}},_mouseMoveHandler:function(t){if(!(t.target&&t.target.__isGLToZRProxy)&&!this._isAnimating()){var e=ey(this.panSensitivity),r=ey(this.rotateSensitivity);this._mode==="rotate"?(this._rotateVelocity.y=(t.offsetX-this._mouseX)/this.zr.getHeight()*2*r[0],this._rotateVelocity.x=(t.offsetY-this._mouseY)/this.zr.getWidth()*2*r[1]):this._mode==="pan"&&(this._panVelocity.x=(t.offsetX-this._mouseX)/this.zr.getWidth()*e[0]*400,this._panVelocity.y=(-t.offsetY+this._mouseY)/this.zr.getHeight()*e[1]*400),this._mouseX=t.offsetX,this._mouseY=t.offsetY,t.event.preventDefault()}},_mouseWheelHandler:function(t){if(!this._isAnimating()){var e=t.event.wheelDelta||-t.event.detail;this._zoomHandler(t,e)}},_pinchHandler:function(t){this._isAnimating()||(this._zoomHandler(t,t.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(t,e){if(e!==0){var r=t.offsetX,i=t.offsetY;if(!(this.viewGL&&!this.viewGL.containPoint(r,i))){var n;this._projection==="perspective"?n=Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):n=Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(e>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&this._mode==="rotate"&&this._startCountingStill(),t.event.preventDefault()}}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return this.rotateMouseButton==="right"||this.panMouseButton==="right"},_contextMenuHandler:function(t){this._isRightMouseButtonUsed()&&t.preventDefault()},_addAnimator:function(t){var e=this._animators;return e.push(t),t.done(function(){var r=e.indexOf(t);r>=0&&e.splice(r,1)}),t}});Object.defineProperty(Dw.prototype,"autoRotate",{get:function(t){return this._autoRotate},set:function(t){this._autoRotate=t,this._rotating=t}});const Wp={convertToDynamicArray:function(t){t&&this.resetOffset();var e=this.attributes;for(var r in e)t||!e[r].value?e[r].value=[]:e[r].value=Array.prototype.slice.call(e[r].value);t||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var t=this.attributes;for(var e in t)t[e].value&&t[e].value.length>0?t[e].value=new Float32Array(t[e].value):t[e].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},Zf={vec2:H,vec3:L,vec4:k,mat2:Tt,mat2d:Lt,mat3:it,mat4:z,quat:Z};var kc=Zf.vec3,ry=[[0,0],[1,1]],qf=Ut.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new Ut.Attribute("position","float",3,"POSITION"),positionPrev:new Ut.Attribute("positionPrev","float",3),positionNext:new Ut.Attribute("positionNext","float",3),prevPositionPrev:new Ut.Attribute("prevPositionPrev","float",3),prevPosition:new Ut.Attribute("prevPosition","float",3),prevPositionNext:new Ut.Attribute("prevPositionNext","float",3),offset:new Ut.Attribute("offset","float",1),color:new Ut.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(t){var e=this.attributes;this.vertexCount!==t&&(e.position.init(t),e.color.init(t),this.useNativeLine||(e.positionPrev.init(t),e.positionNext.init(t),e.offset.init(t)),t>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(t===0?this.indices=null:this.indices=this.vertexCount>65535?new Uint32Array(t*3):new Uint16Array(t*3))},_getCubicCurveApproxStep:function(t,e,r,i){var n=kc.dist(t,e)+kc.dist(r,e)+kc.dist(i,r),a=1/(n+1)*this.segmentScale;return a},getCubicCurveVertexCount:function(t,e,r,i){var n=this._getCubicCurveApproxStep(t,e,r,i),a=Math.ceil(1/n);return this.useNativeLine?a*2:a*2+2},getCubicCurveTriangleCount:function(t,e,r,i){var n=this._getCubicCurveApproxStep(t,e,r,i),a=Math.ceil(1/n);return this.useNativeLine?0:a*2},getLineVertexCount:function(){return this.getPolylineVertexCount(ry)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(ry)},getPolylineVertexCount:function(t){var e;if(typeof t=="number")e=t;else{var r=typeof t[0]!="number";e=r?t.length:t.length/3}return this.useNativeLine?(e-1)*2:(e-1)*2+2},getPolylineTriangleCount:function(t){var e;if(typeof t=="number")e=t;else{var r=typeof t[0]!="number";e=r?t.length:t.length/3}return this.useNativeLine?0:Math.max(e-1,0)*2},addCubicCurve:function(t,e,r,i,n,a){a==null&&(a=1);for(var o=t[0],s=t[1],l=t[2],u=e[0],f=e[1],h=e[2],v=r[0],c=r[1],d=r[2],p=i[0],g=i[1],m=i[2],_=this._getCubicCurveApproxStep(t,e,r,i),y=_*_,x=y*_,S=3*_,T=3*y,w=6*y,b=6*x,A=o-u*2+v,M=s-f*2+c,E=l-h*2+d,D=(u-v)*3-o+p,R=(f-c)*3-s+g,P=(h-d)*3-l+m,I=o,N=s,V=l,O=(u-o)*S+A*T+D*x,X=(f-s)*S+M*T+R*x,G=(h-l)*S+E*T+P*x,lt=A*w+D*b,J=M*w+R*b,ot=E*w+P*b,at=D*b,Dt=R*b,pt=P*b,Ot=0,Ht=0,Nt=Math.ceil(1/_),wt=new Float32Array((Nt+1)*3),wt=[],et=0,Ht=0;Ht<Nt+1;Ht++)wt[et++]=I,wt[et++]=N,wt[et++]=V,I+=O,N+=X,V+=G,O+=lt,X+=J,G+=ot,lt+=at,J+=Dt,ot+=pt,Ot+=_,Ot>1&&(I=O>0?Math.min(I,p):Math.max(I,p),N=X>0?Math.min(N,g):Math.max(N,g),V=G>0?Math.min(V,m):Math.max(V,m));return this.addPolyline(wt,n,a)},addLine:function(t,e,r,i){return this.addPolyline([t,e],r,i)},addPolyline:function(t,e,r,i,n){if(t.length){var a=typeof t[0]!="number";if(n==null&&(n=a?t.length:t.length/3),!(n<2)){i==null&&(i=0),r==null&&(r=1),this._itemVertexOffsets.push(this._vertexOffset);var a=typeof t[0]!="number",o=a?typeof e[0]!="number":e.length/4===n,s=this.attributes.position,l=this.attributes.positionPrev,u=this.attributes.positionNext,f=this.attributes.color,h=this.attributes.offset,v=this.indices,c=this._vertexOffset,d,p;r=Math.max(r,.01);for(var g=i;g<n;g++){if(a)d=t[g],o?p=e[g]:p=e;else{var m=g*3;if(d=d||[],d[0]=t[m],d[1]=t[m+1],d[2]=t[m+2],o){var _=g*4;p=p||[],p[0]=e[_],p[1]=e[_+1],p[2]=e[_+2],p[3]=e[_+3]}else p=e}if(this.useNativeLine?g>1&&(s.copy(c,c-1),f.copy(c,c-1),c++):(g<n-1&&(l.set(c+2,d),l.set(c+3,d)),g>0&&(u.set(c-2,d),u.set(c-1,d)),s.set(c,d),s.set(c+1,d),f.set(c,p),f.set(c+1,p),h.set(c,r/2),h.set(c+1,-r/2),c+=2),this.useNativeLine)f.set(c,p),s.set(c,d),c++;else if(g>0){var y=this._triangleOffset*3,v=this.indices;v[y]=c-4,v[y+1]=c-3,v[y+2]=c-2,v[y+3]=c-3,v[y+4]=c-1,v[y+5]=c-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,S=this._vertexOffset+n*2;l.copy(x,x+2),l.copy(x+1,x+3),u.copy(S-1,S-3),u.copy(S-2,S-4)}return this._vertexOffset=c,this._vertexOffset}}},setItemColor:function(t,e){for(var r=this._itemVertexOffsets[t],i=t<this._itemVertexOffsets.length-1?this._itemVertexOffsets[t+1]:this._vertexOffset,n=r;n<i;n++)this.attributes.color.set(n,e);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});Et(qf.prototype,Wp);function tf(t,e,r,i,n,a,o){this._zr=t,this._x=0,this._y=0,this._rowHeight=0,this.width=i,this.height=n,this.offsetX=e,this.offsetY=r,this.dpr=o,this.gap=a}tf.prototype={constructor:tf,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(t,e,r){var i=t.getBoundingRect();e==null&&(e=i.width),r==null&&(r=i.height),e*=this.dpr,r*=this.dpr,this._fitElement(t,e,r);var n=this._x,a=this._y,o=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(n+e+l>o&&(n=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=e+l,this._rowHeight=Math.max(this._rowHeight,r),a+r+l>s)return null;t.x+=this.offsetX*this.dpr+n,t.y+=this.offsetY*this.dpr+a,this._zr.add(t);var u=[this.offsetX/this.width,this.offsetY/this.height],f=[[n/o+u[0],a/s+u[1]],[(n+e)/o+u[0],(a+r)/s+u[1]]];return f},_fitElement:function(t,e,r){var i=t.getBoundingRect(),n=e/i.width,a=r/i.height;t.x=-i.x*n,t.y=-i.y*a,t.scaleX=n,t.scaleY=a,t.update()}};function vd(t){t=t||{},t.width=t.width||512,t.height=t.height||512,t.devicePixelRatio=t.devicePixelRatio||1,t.gap=t.gap==null?2:t.gap;var e=document.createElement("canvas");e.width=t.width*t.devicePixelRatio,e.height=t.height*t.devicePixelRatio,this._canvas=e,this._texture=new At({image:e,flipY:!1});var r=this;this._zr=wv(e);var i=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){i.call(this),r._texture.dirty(),r.onupdate&&r.onupdate()},this._dpr=t.devicePixelRatio,this._coords={},this.onupdate=t.onupdate,this._gap=t.gap,this._textureAtlasNodes=[new tf(this._zr,0,0,t.width,t.height,this._gap,this._dpr)],this._nodeWidth=t.width,this._nodeHeight=t.height,this._currentNodeIdx=0}vd.prototype={clear:function(){for(var t=0;t<this._textureAtlasNodes.length;t++)this._textureAtlasNodes[t].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var t=4096/this._dpr,e=this._textureAtlasNodes,r=e.length,i=r*this._nodeWidth%t,n=Math.floor(r*this._nodeWidth/t)*this._nodeHeight;if(!(n>=t)){var a=(i+this._nodeWidth)*this._dpr,o=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:a,height:o})}catch{this._canvas.width=a,this._canvas.height=o}var s=new tf(this._zr,i,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(s),s}},add:function(t,e,r){if(this._coords[t.id])return this._coords[t.id];var i=this._getCurrentNode().add(t,e,r);if(!i){var n=this._expand();if(!n)return;i=n.add(t,e,r)}return this._coords[t.id]=i,i},getCoordsScale:function(){var t=this._dpr;return[this._nodeWidth/this._canvas.width*t,this._nodeHeight/this._canvas.height*t]},getCoords:function(t){return this._coords[t]},dispose:function(){this._zr.dispose()}};function dd(){}dd.prototype={constructor:dd,setScene:function(t){this._scene=t,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(t){this._lightRoot=t,this.mainLight=new U.DirectionalLight({shadowBias:.005}),this.ambientLight=new U.AmbientLight,t.add(this.mainLight),t.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(t){var e=this.mainLight,r=this.ambientLight,i=t.getModel("light"),n=i.getModel("main"),a=i.getModel("ambient");e.intensity=n.get("intensity"),r.intensity=a.get("intensity"),e.color=U.parseColor(n.get("color")).slice(0,3),r.color=U.parseColor(a.get("color")).slice(0,3);var o=n.get("alpha")||0,s=n.get("beta")||0;e.position.setArray(U.directionFromAlphaBeta(o,s)),e.lookAt(U.Vector3.ZERO),e.castShadow=n.get("shadow"),e.shadowResolution=U.getShadowResolution(n.get("shadowQuality"))},updateAmbientCubemap:function(t,e,r){var i=e.getModel("light.ambientCubemap"),n=i.get("texture");if(n){this._cubemapLightsCache=this._cubemapLightsCache||{};var a=this._cubemapLightsCache[n];if(!a){var o=this;a=this._cubemapLightsCache[n]=U.createAmbientCubemap(i.option,t,r,function(){o._isSkyboxFromAmbientCubemap&&o._skybox.setEnvironmentMap(a.specular.cubemap),r.getZr().refresh()})}this._lightRoot.add(a.diffuse),this._lightRoot.add(a.specular),this._currentCubemapLights=a}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(t,e,r){var i=e.get("environment"),n=this;function a(){return n._skybox=n._skybox||new Ns,n._skybox}var o=a();if(i&&i!=="none")if(i==="auto")if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var s=this._currentCubemapLights.specular.cubemap;o.setEnvironmentMap(s),this._scene&&o.attachScene(this._scene),o.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if(typeof i=="object"&&i.colorStops||typeof i=="string"&&Be(i)){this._isSkyboxFromAmbientCubemap=!1;var l=new U.Texture2D({anisotropic:8,flipY:!1});o.setEnvironmentMap(l);var u=l.image=document.createElement("canvas");u.width=u.height=16;var f=u.getContext("2d"),h=new Kt({shape:{x:0,y:0,width:16,height:16},style:{fill:i}});Tp(f,h),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;var l=U.loadTexture(i,r,{anisotropic:8,flipY:!1});o.setEnvironmentMap(l),o.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var v=e.coordinateSystem;if(this._skybox)if(v&&v.viewGL&&i!=="auto"&&!(i.match&&i.match(/.hdr$/))){var c=v.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[c]("fragment","SRGB_DECODE")}else this._skybox.material.undefine("fragment","SRGB_DECODE")}};var An=Zf.vec3,Lw=Ut.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new Ut.Attribute("position","float",3,"POSITION"),normal:new Ut.Attribute("normal","float",3,"NORMAL"),color:new Ut.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(t){var e=this.attributes,r=this.getQuadVertexCount()*t,i=this.getQuadTriangleCount()*t;this.vertexCount!==r&&(e.position.init(r),e.normal.init(r),e.color.init(r)),this.triangleCount!==i&&(this.indices=r>65535?new Uint32Array(i*3):new Uint16Array(i*3))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var t=An.create(),e=An.create(),r=An.create(),i=[0,3,1,3,2,1];return function(n,a){var o=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;An.sub(t,n[1],n[0]),An.sub(e,n[2],n[1]),An.cross(r,t,e),An.normalize(r,r);for(var u=0;u<4;u++)o.set(this._vertexOffset+u,n[u]),l.set(this._vertexOffset+u,a),s.set(this._vertexOffset+u,r);for(var f=this._faceOffset*3,u=0;u<6;u++)this.indices[f+u]=i[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});Et(Lw.prototype,Wp);var pd=mr.firstNotNull,A3={x:0,y:2,z:1};function E3(t,e,r,i){var n=[0,0,0],a=i<0?r.getExtentMin():r.getExtentMax();n[A3[r.dim]]=a,t.position.setArray(n),t.rotation.identity(),e.distance=-Math.abs(a),e.normal.set(0,0,0),r.dim==="x"?(t.rotation.rotateY(i*Math.PI/2),e.normal.x=-i):r.dim==="z"?(t.rotation.rotateX(-i*Math.PI/2),e.normal.y=-i):(i>0&&t.rotation.rotateY(Math.PI),e.normal.z=-i)}function $f(t,e,r){this.rootNode=new U.Node;var i=new U.Mesh({geometry:new qf({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),n=new U.Mesh({geometry:new Lw,material:r,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(n),this.rootNode.add(i),this.faceInfo=t,this.plane=new U.Plane,this.linesMesh=i,this.quadsMesh=n}$f.prototype.update=function(t,e,r){var i=t.coordinateSystem,n=[i.getAxis(this.faceInfo[0]),i.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,o=this.quadsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0),this._updateSplitLines(a,n,t,r),this._udpateSplitAreas(o,n,t,r),a.convertToTypedArray(),o.convertToTypedArray();var s=i.getAxis(this.faceInfo[2]);E3(this.rootNode,this.plane,s,this.faceInfo[3])};$f.prototype._updateSplitLines=function(t,e,r,i){var n=i.getDevicePixelRatio();e.forEach(function(a,o){var s=a.model,l=e[1-o].getExtent();if(!a.scale.isBlank()){var u=s.getModel("splitLine",r.getModel("splitLine"));if(u.get("show")){var f=u.getModel("lineStyle"),h=f.get("color"),v=pd(f.get("opacity"),1),c=pd(f.get("width"),1);h=j(h)?h:[h];for(var d=a.getTicksCoords({tickModel:u}),p=0,g=0;g<d.length;g++){var m=d[g].coord,_=U.parseColor(h[p%h.length]);_[3]*=v;var y=[0,0,0],x=[0,0,0];y[o]=x[o]=m,y[1-o]=l[0],x[1-o]=l[1],t.addLine(y,x,_,c*n),p++}}}})};$f.prototype._udpateSplitAreas=function(t,e,r,i){e.forEach(function(n,a){var o=n.model,s=e[1-a].getExtent();if(!n.scale.isBlank()){var l=o.getModel("splitArea",r.getModel("splitArea"));if(l.get("show")){var u=l.getModel("areaStyle"),f=u.get("color"),h=pd(u.get("opacity"),1);f=j(f)?f:[f];for(var v=n.getTicksCoords({tickModel:l,clamp:!0}),c=0,d=[0,0,0],p=[0,0,0],g=0;g<v.length;g++){var m=v[g].coord,_=[0,0,0],y=[0,0,0];if(_[a]=y[a]=m,_[1-a]=s[0],y[1-a]=s[1],g===0){d=_,p=y;continue}var x=U.parseColor(f[c%f.length]);x[3]*=h,t.addQuad([d,_,y,p],x),d=_,p=y,c++}}}})};var iy=[0,1,2,0,2,3],Rw=Ut.extend(function(){return{attributes:{position:new Ut.Attribute("position","float",3,"POSITION"),texcoord:new Ut.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new Ut.Attribute("offset","float",2),color:new Ut.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(t){this._spriteCount=t;var e=t*4,r=t*2;this.vertexCount!==e&&(this.attributes.position.init(e),this.attributes.offset.init(e),this.attributes.color.init(e)),this.triangleCount!==r&&(this.indices=e>65535?new Uint32Array(r*3):new Uint16Array(r*3))},setSpriteAlign:function(t,e,r,i,n){r==null&&(r="left"),i==null&&(i="top");var a,o,s,l;switch(n=n||0,r){case"left":a=n,s=e[0]+n;break;case"center":case"middle":a=-e[0]/2,s=e[0]/2;break;case"right":a=-e[0]-n,s=-n;break}switch(i){case"bottom":o=n,l=e[1]+n;break;case"middle":o=-e[1]/2,l=e[1]/2;break;case"top":o=-e[1]-n,l=-n;break}var u=t*4,f=this.attributes.offset;f.set(u,[a,l]),f.set(u+1,[s,l]),f.set(u+2,[s,o]),f.set(u+3,[a,o])},addSprite:function(t,e,r,i,n,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,t,e,r,i,n,a);for(var s=0;s<iy.length;s++)this.indices[this._faceOffset*3+s]=iy[s]+o;return this._faceOffset+=2,this._vertexOffset+=4,o/4},setSprite:function(t,e,r,i,n,a,o){for(var s=t*4,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,e);var f=l.texcoord;f.set(s,[i[0][0],i[0][1]]),f.set(s+1,[i[1][0],i[0][1]]),f.set(s+2,[i[1][0],i[1][1]]),f.set(s+3,[i[0][0],i[1][1]]),this.setSpriteAlign(t,r,n,a,o)}});Et(Rw.prototype,Wp);const M3=`@export ecgl.labels.vertex
attribute vec3 position: POSITION;
attribute vec2 texcoord: TEXCOORD_0;
attribute vec2 offset;
#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform vec4 viewport : VIEWPORT;
varying vec2 v_Texcoord;
void main()
{
vec4 proj = worldViewProjection * vec4(position, 1.0);
vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;
screen += offset;
proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);
gl_Position = proj;
#ifdef VERTEX_COLOR
v_Color = a_Color;
#endif
v_Texcoord = texcoord;
}
@end
@export ecgl.labels.fragment
uniform vec3 color : [1.0, 1.0, 1.0];
uniform float alpha : 1.0;
uniform sampler2D textureAtlas;
uniform vec2 uvScale: [1.0, 1.0];
#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif
varying float v_Miter;
varying vec2 v_Texcoord;
void main()
{
gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);
#ifdef VERTEX_COLOR
gl_FragColor *= v_Color;
#endif
}
@end`;U.Shader.import(M3);const Pw=U.Mesh.extend(function(){var t=new Rw({dynamic:!0}),e=new U.Material({shader:U.createShader("ecgl.labels"),transparent:!0,depthMask:!1});return{geometry:t,material:e,culling:!1,castShadow:!1,ignorePicking:!0}});var En=mr.firstNotNull,Mn={x:0,y:2,z:1};function Xp(t,e){var r=new U.Mesh({geometry:new qf({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,renderOrder:2}),i=new Pw;i.material.depthMask=!1;var n=new U.Node;n.add(r),n.add(i),this.rootNode=n,this.dim=t,this.linesMesh=r,this.labelsMesh=i,this.axisLineCoords=null,this.labelElements=[]}var zc={x:"y",y:"x",z:"y"};Xp.prototype.update=function(t,e,r){var i=t.coordinateSystem,n=i.getAxis(this.dim),a=this.linesMesh.geometry,o=this.labelsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0);var s=n.model,l=n.getExtent(),E=r.getDevicePixelRatio(),u=s.getModel("axisLine",t.getModel("axisLine")),f=s.getModel("axisTick",t.getModel("axisTick")),h=s.getModel("axisLabel",t.getModel("axisLabel")),v=u.get("lineStyle.color");if(u.get("show")){var c=u.getModel("lineStyle"),d=[0,0,0],p=[0,0,0],g=Mn[n.dim];d[g]=l[0],p[g]=l[1],this.axisLineCoords=[d,p];var m=U.parseColor(v),_=En(c.get("width"),1),y=En(c.get("opacity"),1);m[3]*=y,a.addLine(d,p,m,_*E)}if(f.get("show")){var x=f.getModel("lineStyle"),S=U.parseColor(En(x.get("color"),v)),_=En(x.get("width"),1);S[3]*=En(x.get("opacity"),1);for(var T=n.getTicksCoords(),w=f.get("length"),b=0;b<T.length;b++){var A=T[b].coord,d=[0,0,0],p=[0,0,0],g=Mn[n.dim],M=Mn[zc[n.dim]];d[g]=p[g]=A,p[M]=w,a.addLine(d,p,S,_*E)}}this.labelElements=[];var E=r.getDevicePixelRatio();if(h.get("show"))for(var T=n.getTicksCoords(),D=s.get("data"),R=h.get("margin"),P=n.getViewLabels(),b=0;b<P.length;b++){var I=P[b].tickValue,N=P[b].formattedLabel,V=P[b].rawLabel,A=n.dataToCoord(I),O=[0,0,0],g=Mn[n.dim],M=Mn[zc[n.dim]];O[g]=O[g]=A,O[M]=R;var X=h;D&&D[I]&&D[I].textStyle&&(X=new Zt(D[I].textStyle,h,s.ecModel));var G=En(X.get("color"),v),lt=new Xt({style:qe(X,{text:N,fill:typeof G=="function"?G(n.type==="category"?V:n.type==="value"?I+"":I,b):G,verticalAlign:"top",align:"left"})}),J=e.add(lt),ot=lt.getBoundingRect();o.addSprite(O,[ot.width*E,ot.height*E],J),this.labelElements.push(lt)}if(s.get("name")){var at=s.getModel("nameTextStyle"),O=[0,0,0],g=Mn[n.dim],M=Mn[zc[n.dim]],Dt=En(at.get("color"),v),pt=at.get("borderColor"),_=at.get("borderWidth");O[g]=O[g]=(l[0]+l[1])/2,O[M]=s.get("nameGap");var lt=new Xt({style:qe(at,{text:s.get("name"),fill:Dt,stroke:pt,lineWidth:_})}),J=e.add(lt),ot=lt.getBoundingRect();o.addSprite(O,[ot.width*E,ot.height*E],J),lt.__idx=this.labelElements.length,this.nameLabelElement=lt}this.labelsMesh.material.set("textureAtlas",e.getTexture()),this.labelsMesh.material.set("uvScale",e.getCoordsScale()),a.convertToTypedArray(),o.convertToTypedArray()};Xp.prototype.setSpriteAlign=function(t,e,r){for(var i=r.getDevicePixelRatio(),n=this.labelsMesh.geometry,a=0;a<this.labelElements.length;a++){var o=this.labelElements[a],s=o.getBoundingRect();n.setSpriteAlign(a,[s.width*i,s.height*i],t,e)}var l=this.nameLabelElement;if(l){var s=l.getBoundingRect();n.setSpriteAlign(l.__idx,[s.width*i,s.height*i],t,e),n.dirty()}this.textAlign=t,this.textVerticalAlign=e};const C3=`@export ecgl.lines3D.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position: POSITION;
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
void main()
{
gl_Position = worldViewProjection * vec4(position, 1.0);
v_Color = a_Color;
}
@end
@export ecgl.lines3D.fragment
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
varying vec4 v_Color;
@import clay.util.srgb
void main()
{
#ifdef SRGB_DECODE
gl_FragColor = sRGBToLinear(color * v_Color);
#else
gl_FragColor = color * v_Color;
#endif
}
@end
@export ecgl.lines3D.clipNear
vec4 clipNear(vec4 p1, vec4 p2) {
float n = (p1.w - near) / (p1.w - p2.w);
return vec4(mix(p1.xy, p2.xy, n), -near, near);
}
@end
@export ecgl.lines3D.expandLine
#ifdef VERTEX_ANIMATION
vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);
vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);
vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);
#else
vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);
vec4 currProj = worldViewProjection * vec4(position, 1.0);
vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);
#endif
if (currProj.w < 0.0) {
if (nextProj.w > 0.0) {
currProj = clipNear(currProj, nextProj);
}
else if (prevProj.w > 0.0) {
currProj = clipNear(currProj, prevProj);
}
}
vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;
vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;
vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;
vec2 dir;
float len = offset;
if (position == positionPrev) {
dir = normalize(nextScreen - currScreen);
}
else if (position == positionNext) {
dir = normalize(currScreen - prevScreen);
}
else {
vec2 dirA = normalize(currScreen - prevScreen);
vec2 dirB = normalize(nextScreen - currScreen);
vec2 tanget = normalize(dirA + dirB);
float miter = 1.0 / max(dot(tanget, dirA), 0.5);
len *= miter;
dir = tanget;
}
dir = vec2(-dir.y, dir.x) * len;
currScreen += dir;
currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);
@end
@export ecgl.meshLines3D.vertex
attribute vec3 position: POSITION;
attribute vec3 positionPrev;
attribute vec3 positionNext;
attribute float offset;
attribute vec4 a_Color : COLOR;
#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
attribute vec3 prevPositionPrev;
attribute vec3 prevPositionNext;
uniform float percent : 1.0;
#endif
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform vec4 viewport : VIEWPORT;
uniform float near : NEAR;
varying vec4 v_Color;
@import ecgl.common.wireframe.vertexHeader
@import ecgl.lines3D.clipNear
void main()
{
@import ecgl.lines3D.expandLine
gl_Position = currProj;
v_Color = a_Color;
@import ecgl.common.wireframe.vertexMain
}
@end
@export ecgl.meshLines3D.fragment
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
varying vec4 v_Color;
@import ecgl.common.wireframe.fragmentHeader
@import clay.util.srgb
void main()
{
#ifdef SRGB_DECODE
gl_FragColor = sRGBToLinear(color * v_Color);
#else
gl_FragColor = color * v_Color;
#endif
@import ecgl.common.wireframe.fragmentMain
}
@end`;var ny=mr.firstNotNull;U.Shader.import(C3);var Cn={x:0,y:2,z:1};const D3=ze.extend({type:"grid3D",__ecgl__:!0,init:function(t,e){var r=[["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"]],i=["x","y","z"],n=new U.Material({shader:U.createShader("ecgl.color"),depthMask:!1,transparent:!0}),a=new U.Material({shader:U.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new U.Node,this._control=new Dw({zr:e.getZr()}),this._control.init(),this._faces=r.map(function(s){var l=new $f(s,a,n);return this.groupGL.add(l.rootNode),l},this),this._axes=i.map(function(s){var l=new Xp(s,a);return this.groupGL.add(l.rootNode),l},this);var o=e.getDevicePixelRatio();this._axisLabelSurface=new vd({width:256,height:256,devicePixelRatio:o}),this._axisLabelSurface.onupdate=function(){e.getZr().refresh()},this._axisPointerLineMesh=new U.Mesh({geometry:new qf({useNativeLine:!1}),material:a,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new vd({width:128,height:128,devicePixelRatio:o}),this._axisPointerLabelsMesh=new Pw({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new U.Node,this._sceneHelper=new dd,this._sceneHelper.initLight(this._lightRoot)},render:function(t,e,r){this._model=t,this._api=r;var i=t.coordinateSystem;i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var n=this._control;n.setViewGL(i.viewGL);var a=t.getModel("viewControl");n.setFromViewControlModel(a,0),this._axisLabelSurface.clear(),n.off("update"),t.get("show")&&(this._faces.forEach(function(o){o.update(t,e,r)},this),this._axes.forEach(function(o){o.update(t,this._axisLabelSurface,r)},this)),n.on("update",this._onCameraChange.bind(this,t,r),this),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(t),i.viewGL.setPostEffect(t.getModel("postEffect"),r),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._initMouseHandler(t)},afterRender:function(t,e,r,i){var n=i.renderer;this._sceneHelper.updateAmbientCubemap(n,t,r),this._sceneHelper.updateSkybox(n,t,r)},showAxisPointer:function(t,e,r,i){this._doShowAxisPointer(),this._updateAxisPointer(i.value)},hideAxisPointer:function(t,e,r,i){this._doHideAxisPointer()},_initMouseHandler:function(t){var e=t.coordinateSystem,r=e.viewGL;t.get("show")&&t.get("axisPointer.show")?r.on("mousemove",this._updateAxisPointerOnMousePosition,this):r.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(t){if(!t.target){for(var e=this._model,r=e.coordinateSystem,i=r.viewGL,n=i.castRay(t.offsetX,t.offsetY,new U.Ray),a,o=0;o<this._faces.length;o++){var s=this._faces[o];if(!s.rootNode.invisible){s.plane.normal.dot(i.camera.worldTransform.z)<0&&s.plane.normal.negate();var l=n.intersectPlane(s.plane);if(l){var u=r.getAxis(s.faceInfo[0]),f=r.getAxis(s.faceInfo[1]),h=Cn[s.faceInfo[0]],v=Cn[s.faceInfo[1]];u.contain(l.array[h])&&f.contain(l.array[v])&&(a=l)}}}if(a){var c=r.pointToData(a.array,[],!0);this._updateAxisPointer(c),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(t,e){t.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var r=this._control;e.dispatchAction({type:"grid3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,grid3DId:t.id})},_updateFaceVisibility:function(){var t=this._control.getCamera(),e=new U.Vector3;t.update();for(var r=0;r<this._faces.length/2;r++){for(var i=[],n=0;n<2;n++){var a=this._faces[r*2+n];a.rootNode.getWorldPosition(e),e.transformMat4(t.viewMatrix),i[n]=e.z}var o=i[0]>i[1]?0:1,s=this._faces[r*2+o],l=this._faces[r*2+1-o];s.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var t=this._model.coordinateSystem,e=t.getAxis("x"),r=t.getAxis("y"),i=t.getAxis("z"),n=i.getExtentMax(),a=i.getExtentMin(),o=e.getExtentMin(),s=e.getExtentMax(),l=r.getExtentMax(),u=r.getExtentMin(),f=this._axes[0].rootNode,h=this._axes[1].rootNode,v=this._axes[2].rootNode,c=this._faces,d=c[4].rootNode.invisible?u:l,p=c[2].rootNode.invisible?n:a,g=c[0].rootNode.invisible?o:s,m=c[2].rootNode.invisible?n:a,_=c[0].rootNode.invisible?s:o,y=c[4].rootNode.invisible?u:l;f.rotation.identity(),h.rotation.identity(),v.rotation.identity(),c[4].rootNode.invisible&&(this._axes[0].flipped=!0,f.rotation.rotateX(Math.PI)),c[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),c[4].rootNode.invisible&&(this._axes[2].flipped=!0,v.rotation.rotateY(Math.PI)),f.position.set(0,p,d),h.position.set(g,m,0),v.position.set(_,0,y),f.update(),h.update(),v.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var t=this._control.getCamera(),e=[new U.Vector4,new U.Vector4],r=new U.Vector4;this.groupGL.getWorldPosition(r),r.w=1,r.transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),r.x/=r.w,r.y/=r.w,this._axes.forEach(function(i){var n=i.axisLineCoords;i.labelsMesh.geometry;for(var a=0;a<e.length;a++)e[a].setArray(n[a]),e[a].w=1,e[a].transformMat4(i.rootNode.worldTransform).transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),e[a].x/=e[a].w,e[a].y/=e[a].w;var o=e[1].x-e[0].x,s=e[1].y-e[0].y,l=(e[1].x+e[0].x)/2,u=(e[1].y+e[0].y)/2,f,h;Math.abs(s/o)<.5?(f="center",h=u>r.y?"bottom":"top"):(h="middle",f=l>r.x?"left":"right"),i.setSpriteAlign(f,h,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(t){var e=this._model.coordinateSystem,r=e.dataToPoint(t),i=this._axisPointerLineMesh,n=i.geometry,a=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();n.convertToDynamicArray(!0);function s(b){return mr.firstNotNull(b.model.get("axisPointer.show"),a.get("show"))}function l(b){var A=b.model.getModel("axisPointer",a),M=A.getModel("lineStyle"),E=U.parseColor(M.get("color")),D=ny(M.get("width"),1),R=ny(M.get("opacity"),1);return E[3]*=R,{color:E,lineWidth:D}}for(var u=0;u<this._faces.length;u++){var f=this._faces[u];if(!f.rootNode.invisible){for(var h=f.faceInfo,v=h[3]<0?e.getAxis(h[2]).getExtentMin():e.getAxis(h[2]).getExtentMax(),c=Cn[h[2]],d=0;d<2;d++){var p=h[d],g=h[1-d],m=e.getAxis(p),_=e.getAxis(g);if(s(m)){var y=[0,0,0],x=[0,0,0],S=Cn[p],T=Cn[g];y[S]=x[S]=r[S],y[c]=x[c]=v,y[T]=_.getExtentMin(),x[T]=_.getExtentMax();var w=l(m);n.addLine(y,x,w.color,w.lineWidth*o)}}if(s(e.getAxis(h[2]))){var y=r.slice(),x=r.slice();x[c]=v;var w=l(e.getAxis(h[2]));n.addLine(y,x,w.color,w.lineWidth*o)}}}n.convertToTypedArray(),this._updateAxisPointerLabelsMesh(t),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(t){var e=this._model,r=this._axisPointerLabelsMesh,i=this._axisPointerLabelsSurface,n=e.coordinateSystem,a=e.getModel("axisPointer");r.geometry.convertToDynamicArray(!0),i.clear();var o={x:"y",y:"x",z:"y"};this._axes.forEach(function(s,l){var u=n.getAxis(s.dim),f=u.model,h=f.getModel("axisPointer",a),v=h.getModel("label"),c=h.get("lineStyle.color");if(!(!v.get("show")||!h.get("show"))){var d=t[l],p=v.get("formatter"),g=u.scale.getLabel({value:d});if(p!=null)g=p(g,t);else if(u.scale.type==="interval"||u.scale.type==="log"){var m=zd(u.scale.getTicks()[0]);g=d.toFixed(m+2)}var _=v.get("color"),y=new Xt({style:qe(v,{text:g,fill:_||c,align:"left",verticalAlign:"top"})}),x=i.add(y),S=y.getBoundingRect(),T=this._api.getDevicePixelRatio(),w=s.rootNode.position.toArray(),b=Cn[o[s.dim]];w[b]+=(s.flipped?-1:1)*v.get("margin"),w[Cn[s.dim]]=u.dataToCoord(t[l]),r.geometry.addSprite(w,[S.width*T,S.height*T],x,s.textAlign,s.textVerticalAlign)}},this),i.getZr().refreshImmediately(),r.material.set("uvScale",i.getCoordsScale()),r.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._axisLabelSurface.dispose(),this._axisPointerLabelsSurface.dispose()}});function Bs(t){Bp.call(this,t),this.type="cartesian3D",this.dimensions=["x","y","z"],this.size=[0,0,0]}Bs.prototype={constructor:Bs,model:null,containPoint:function(t){return this.getAxis("x").contain(t[0])&&this.getAxis("y").contain(t[2])&&this.getAxis("z").contain(t[1])},containData:function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])&&this.getAxis("z").containData(t[2])},dataToPoint:function(t,e,r){return e=e||[],e[0]=this.getAxis("x").dataToCoord(t[0],r),e[2]=this.getAxis("y").dataToCoord(t[1],r),e[1]=this.getAxis("z").dataToCoord(t[2],r),e},pointToData:function(t,e,r){return e=e||[],e[0]=this.getAxis("x").coordToData(t[0],r),e[1]=this.getAxis("y").coordToData(t[2],r),e[2]=this.getAxis("z").coordToData(t[1],r),e}};Rd(Bs,Bp);function ef(t,e,r){Pp.call(this,t,e,r)}ef.prototype={constructor:ef,getExtentMin:function(){var t=this._extent;return Math.min(t[0],t[1])},getExtentMax:function(){var t=this._extent;return Math.max(t[0],t[1])},calculateCategoryInterval:function(){return Math.floor(this.scale.count()/8)}};Rd(ef,Pp);var rf=function(){this._pool={},this._allocatedTextures=[]};rf.prototype={constructor:rf,get:function(t){var e=ay(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]);var r=this._pool[e];if(!r.length){var i=new At(t);return this._allocatedTextures.push(i),i}return r.pop()},put:function(t){var e=ay(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]);var r=this._pool[e];r.push(t)},clear:function(t){for(var e=0;e<this._allocatedTextures.length;e++)this._allocatedTextures[e].dispose(t);this._pool={},this._allocatedTextures=[]}};var Iw={width:512,height:512,type:F.UNSIGNED_BYTE,format:F.RGBA,wrapS:F.CLAMP_TO_EDGE,wrapT:F.CLAMP_TO_EDGE,minFilter:F.LINEAR_MIPMAP_LINEAR,magFilter:F.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},Uc=Object.keys(Iw);function ay(t){ne.defaultsWithPropList(t,Iw,Uc),L3(t);for(var e="",r=0;r<Uc.length;r++){var i=Uc[r],n=t[i].toString();e+=n}return e}function L3(t){var e=R3(t.width,t.height);t.format===F.DEPTH_COMPONENT&&(t.useMipmap=!1),(!e||!t.useMipmap)&&(t.minFilter==F.NEAREST_MIPMAP_NEAREST||t.minFilter==F.NEAREST_MIPMAP_LINEAR?t.minFilter=F.NEAREST:(t.minFilter==F.LINEAR_MIPMAP_LINEAR||t.minFilter==F.LINEAR_MIPMAP_NEAREST)&&(t.minFilter=F.LINEAR)),e||(t.wrapS=F.CLAMP_TO_EDGE,t.wrapT=F.CLAMP_TO_EDGE)}function R3(t,e){return(t&t-1)===0&&(e&e-1)===0}const P3=`@export clay.sm.depth.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
uniform vec2 uvRepeat = vec2(1.0, 1.0);
uniform vec2 uvOffset = vec2(0.0, 0.0);
@import clay.chunk.skinning_header
@import clay.chunk.instancing_header
varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;
void main(){
vec4 P = vec4(position, 1.0);
#ifdef SKINNING
@import clay.chunk.skin_matrix
P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
@import clay.chunk.instancing_matrix
P = instanceMat * P;
#endif
v_ViewPosition = worldViewProjection * P;
gl_Position = v_ViewPosition;
v_Texcoord = texcoord * uvRepeat + uvOffset;
}
@end
@export clay.sm.depth.fragment
varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;
uniform float bias : 0.001;
uniform float slopeScale : 1.0;
uniform sampler2D alphaMap;
uniform float alphaCutoff: 0.0;
@import clay.util.encode_float
void main(){
float depth = v_ViewPosition.z / v_ViewPosition.w;
if (alphaCutoff > 0.0) {
if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {
discard;
}
}
#ifdef USE_VSM
depth = depth * 0.5 + 0.5;
float moment1 = depth;
float moment2 = depth * depth;
#ifdef SUPPORT_STANDARD_DERIVATIVES
float dx = dFdx(depth);
float dy = dFdy(depth);
moment2 += 0.25*(dx*dx+dy*dy);
#endif
gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);
#else
#ifdef SUPPORT_STANDARD_DERIVATIVES
float dx = dFdx(depth);
float dy = dFdy(depth);
depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;
#else
depth += bias;
#endif
gl_FragColor = encodeFloat(depth * 0.5 + 0.5);
#endif
}
@end
@export clay.sm.debug_depth
uniform sampler2D depthMap;
varying vec2 v_Texcoord;
@import clay.util.decode_float
void main() {
vec4 tex = texture2D(depthMap, v_Texcoord);
#ifdef USE_VSM
gl_FragColor = vec4(tex.rgb, 1.0);
#else
float depth = decodeFloat(tex);
gl_FragColor = vec4(depth, depth, depth, 1.0);
#endif
}
@end
@export clay.sm.distance.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform mat4 world : WORLD;
attribute vec3 position : POSITION;
@import clay.chunk.skinning_header
varying vec3 v_WorldPosition;
void main (){
vec4 P = vec4(position, 1.0);
#ifdef SKINNING
@import clay.chunk.skin_matrix
P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
@import clay.chunk.instancing_matrix
P = instanceMat * P;
#endif
gl_Position = worldViewProjection * P;
v_WorldPosition = (world * P).xyz;
}
@end
@export clay.sm.distance.fragment
uniform vec3 lightPosition;
uniform float range : 100;
varying vec3 v_WorldPosition;
@import clay.util.encode_float
void main(){
float dist = distance(lightPosition, v_WorldPosition);
#ifdef USE_VSM
gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);
#else
dist = dist / range;
gl_FragColor = encodeFloat(dist);
#endif
}
@end
@export clay.plugin.shadow_map_common
@import clay.util.decode_float
float tapShadowMap(sampler2D map, vec2 uv, float z){
vec4 tex = texture2D(map, uv);
return step(z, decodeFloat(tex) * 2.0 - 1.0);
}
float pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {
float shadowContrib = tapShadowMap(map, uv, z);
vec2 offset = vec2(1.0 / textureSize) * scale;
#ifdef PCF_KERNEL_SIZE
for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{
shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);
}}
return shadowContrib / float(PCF_KERNEL_SIZE + 1);
#else
shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);
shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);
shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);
shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);
shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);
shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);
shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);
shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);
return shadowContrib / 9.0;
#endif
}
float pcf(sampler2D map, vec2 uv, float z, float textureSize) {
return pcf(map, uv, z, textureSize, vec2(1.0));
}
float chebyshevUpperBound(vec2 moments, float z){
float p = 0.0;
z = z * 0.5 + 0.5;
if (z <= moments.x) {
p = 1.0;
}
float variance = moments.y - moments.x * moments.x;
variance = max(variance, 0.0000001);
float mD = moments.x - z;
float pMax = variance / (variance + mD * mD);
pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);
return max(p, pMax);
}
float computeShadowContrib(
sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset
) {
vec4 posInLightSpace = lightVPM * vec4(position, 1.0);
posInLightSpace.xyz /= posInLightSpace.w;
float z = posInLightSpace.z;
if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&
all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){
vec2 uv = (posInLightSpace.xy+1.0) / 2.0;
#ifdef USE_VSM
vec2 moments = texture2D(map, uv * scale + offset).xy;
return chebyshevUpperBound(moments, z);
#else
return pcf(map, uv * scale + offset, z, textureSize, scale);
#endif
}
return 1.0;
}
float computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {
return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));
}
float computeShadowContribOmni(samplerCube map, vec3 direction, float range)
{
float dist = length(direction);
vec4 shadowTex = textureCube(map, direction);
#ifdef USE_VSM
vec2 moments = shadowTex.xy;
float variance = moments.y - moments.x * moments.x;
float mD = moments.x - dist;
float p = variance / (variance + mD * mD);
if(moments.x + 0.001 < dist){
return clamp(p, 0.0, 1.0);
}else{
return 1.0;
}
#else
return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);
#endif
}
@end
@export clay.plugin.compute_shadow_map
#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)
#ifdef SPOT_LIGHT_SHADOWMAP_COUNT
uniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT
#if defined(SHADOW_CASCADE)
uniform sampler2D directionalLightShadowMaps[1]:unconfigurable;
uniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;
uniform float directionalLightShadowMapSizes[1]:unconfigurable;
uniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;
uniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;
#else
uniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
#endif
#ifdef POINT_LIGHT_SHADOWMAP_COUNT
uniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
uniform bool shadowEnabled : true;
#ifdef PCF_KERNEL_SIZE
uniform vec2 pcfKernel[PCF_KERNEL_SIZE];
#endif
@import clay.plugin.shadow_map_common
#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)
void computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {
float shadowContrib;
for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
shadowContrib = computeShadowContrib(
spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,
spotLightShadowMapSizes[_idx_]
);
shadowContribs[_idx_] = shadowContrib;
}}
for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{
shadowContribs[_idx_] = 1.0;
}}
}
#endif
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
#ifdef SHADOW_CASCADE
void computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){
float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)
/ (gl_DepthRange.far - gl_DepthRange.near);
float shadowContrib;
shadowContribs[0] = 1.0;
for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{
if (
depth >= shadowCascadeClipsNear[_idx_] &&
depth <= shadowCascadeClipsFar[_idx_]
) {
shadowContrib = computeShadowContrib(
directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,
directionalLightShadowMapSizes[0],
vec2(1.0 / float(SHADOW_CASCADE), 1.0),
vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)
);
shadowContribs[0] = shadowContrib;
}
}}
for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{
shadowContribs[_idx_] = 1.0;
}}
}
#else
void computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){
float shadowContrib;
for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
shadowContrib = computeShadowContrib(
directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,
directionalLightShadowMapSizes[_idx_]
);
shadowContribs[_idx_] = shadowContrib;
}}
for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{
shadowContribs[_idx_] = 1.0;
}}
}
#endif
#endif
#if defined(POINT_LIGHT_SHADOWMAP_COUNT)
void computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){
vec3 lightPosition;
vec3 direction;
for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
lightPosition = pointLightPosition[_idx_];
direction = position - lightPosition;
shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);
}}
for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{
shadowContribs[_idx_] = 1.0;
}}
}
#endif
#endif
@end`;var Ni=["px","nx","py","ny","pz","nz"];$.import(P3);function Hc(t,e,r){if(r==="alphaMap")return t.material.get("diffuseMap");if(r==="alphaCutoff"){if(t.material.isDefined("fragment","ALPHA_TEST")&&t.material.get("diffuseMap")){var i=t.material.get("alphaCutoff");return i||0}return 0}else return r==="uvRepeat"?t.material.get("uvRepeat"):r==="uvOffset"?t.material.get("uvOffset"):e.get(r)}function oy(t,e){var r=t.material,i=e.material;return r.get("diffuseMap")!==i.get("diffuseMap")||(r.get("alphaCutoff")||0)!==(i.get("alphaCutoff")||0)}var qr=Se.extend(function(){return{softShadow:qr.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new he,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new rf}},function(){this._gaussianPassH=new Oe({fragment:$.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new Oe({fragment:$.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new Oe({fragment:$.source("clay.sm.debug_depth")})},{render:function(t,e,r,i){r||(r=e.getMainCamera()),this.trigger("beforerender",this,t,e,r),this._renderShadowPass(t,e,r,i),this.trigger("afterrender",this,t,e,r)},renderDebug:function(t,e){t.saveClear();var r=t.viewport,i=0,n=0,a=e||r.width/4,o=a;this.softShadow===qr.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM");for(var s in this._textures){var l=this._textures[s];t.setViewport(i,n,a*l.width/l.height,o),this._outputDepthPass.setUniform("depthMap",l),this._outputDepthPass.render(t),i+=a*l.width/l.height}t.setViewport(r),t.restoreClear()},_updateReceivers:function(t,e){if(e.receiveShadow?(this._receivers.push(e),e.material.set("shadowEnabled",1),e.material.set("pcfKernel",this.kernelPCF)):e.material.set("shadowEnabled",0),this.softShadow===qr.VSM)e.material.define("fragment","USE_VSM"),e.material.undefine("fragment","PCF_KERNEL_SIZE");else{e.material.undefine("fragment","USE_VSM");var r=this.kernelPCF;r&&r.length?e.material.define("fragment","PCF_KERNEL_SIZE",r.length/2):e.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(t,e){var r=this;e.traverse(function(a){a.isRenderable()&&r._updateReceivers(t,a)});for(var i=0;i<e.lights.length;i++){var n=e.lights[i];n.castShadow&&!n.invisible&&this._lightsCastShadow.push(n)}},_renderShadowPass:function(t,e,r,i){for(var n in this._shadowMapNumber)this._shadowMapNumber[n]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var a=t.gl;if(i||e.update(),r&&r.update(),e.updateLights(),this._update(t,e),!this._lightsCastShadow.length&&this._lastRenderNotCastShadow)return;this._lastRenderNotCastShadow=this._lightsCastShadow===0,a.enable(a.DEPTH_TEST),a.depthMask(!0),a.disable(a.BLEND),a.clearColor(1,1,1,1);for(var o=[],s=[],l=[],u=[],f=[],h=[],v,c=0;c<this._lightsCastShadow.length;c++){var d=this._lightsCastShadow[c];if(d.type==="DIRECTIONAL_LIGHT"){if(v){console.warn("Only one direectional light supported with shadow cascade");continue}if(d.shadowCascade>4){console.warn("Support at most 4 cascade");continue}d.shadowCascade>1&&(v=d),this.renderDirectionalLightShadow(t,e,r,d,f,u,l)}else d.type==="SPOT_LIGHT"?this.renderSpotLightShadow(t,e,d,s,o):d.type==="POINT_LIGHT"&&this.renderPointLightShadow(t,e,d,h);this._shadowMapNumber[d.type]++}for(var p in this._shadowMapNumber)for(var g=this._shadowMapNumber[p],m=p+"_SHADOWMAP_COUNT",c=0;c<this._receivers.length;c++){var _=this._receivers[c],y=_.material;y.fragmentDefines[m]!==g&&(g>0?y.define("fragment",m,g):y.isDefined("fragment",m)&&y.undefine("fragment",m))}for(var c=0;c<this._receivers.length;c++){var _=this._receivers[c],y=_.material;v?y.define("fragment","SHADOW_CASCADE",v.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var x=e.shadowUniforms;function S(M){return M.height}if(l.length>0){var T=l.map(S);if(x.directionalLightShadowMaps={value:l,type:"tv"},x.directionalLightMatrices={value:u,type:"m4v"},x.directionalLightShadowMapSizes={value:T,type:"1fv"},v){var w=f.slice(),b=f.slice();w.pop(),b.shift(),w.reverse(),b.reverse(),u.reverse(),x.shadowCascadeClipsNear={value:w,type:"1fv"},x.shadowCascadeClipsFar={value:b,type:"1fv"}}}if(o.length>0){var A=o.map(S),x=e.shadowUniforms;x.spotLightShadowMaps={value:o,type:"tv"},x.spotLightMatrices={value:s,type:"m4v"},x.spotLightShadowMapSizes={value:A,type:"1fv"}}h.length>0&&(x.pointLightShadowMaps={value:h,type:"tv"})},renderDirectionalLightShadow:function(){var t=new Wf,e=new q,r=new ye,i=new q,n=new q,a=new q,o=new q;return function(s,l,u,f,h,v,c){var d=this._getDepthMaterial(f),p={getMaterial:function(ot){return ot.shadowDepthMaterial||d},isMaterialChanged:oy,getUniform:Hc,ifRender:function(ot){return ot.castShadow},sortCompare:yr.opaqueSortCompare};if(!l.viewBoundingBoxLastFrame.isFinite()){var g=l.getBoundingBox();l.viewBoundingBoxLastFrame.copy(g).applyTransform(u.viewMatrix)}var m=Math.min(-l.viewBoundingBoxLastFrame.min.z,u.far),_=Math.max(-l.viewBoundingBoxLastFrame.max.z,u.near),y=this._getDirectionalLightCamera(f,l,u),x=a.array;o.copy(y.projectionMatrix),z.invert(n.array,y.worldTransform.array),z.multiply(n.array,n.array,u.worldTransform.array),z.multiply(x,o.array,n.array);for(var S=[],T=u instanceof ve,w=(u.near+u.far)/(u.near-u.far),b=2*u.near*u.far/(u.near-u.far),A=0;A<=f.shadowCascade;A++){var M=_*Math.pow(m/_,A/f.shadowCascade),E=_+(m-_)*A/f.shadowCascade,D=M*f.cascadeSplitLogFactor+E*(1-f.cascadeSplitLogFactor);S.push(D),h.push(-(-D*w+b)/-D)}var R=this._getTexture(f,f.shadowCascade);c.push(R);var P=s.viewport,I=s.gl;this._frameBuffer.attach(R),this._frameBuffer.bind(s),I.clear(I.COLOR_BUFFER_BIT|I.DEPTH_BUFFER_BIT);for(var A=0;A<f.shadowCascade;A++){var N=S[A],V=S[A+1];T?z.perspective(e.array,u.fov/180*Math.PI,u.aspect,N,V):z.ortho(e.array,u.left,u.right,u.bottom,u.top,N,V),t.setFromProjection(e),t.getTransformedBoundingBox(r,n),r.applyProjection(o);var O=r.min.array,X=r.max.array;O[0]=Math.max(O[0],-1),O[1]=Math.max(O[1],-1),X[0]=Math.min(X[0],1),X[1]=Math.min(X[1],1),i.ortho(O[0],X[0],O[1],X[1],1,-1),y.projectionMatrix.multiplyLeft(i);var G=f.shadowResolution||512;s.setViewport((f.shadowCascade-A-1)*G,0,G,G,1);var lt=l.updateRenderList(y);s.renderPass(lt.opaque,y,p),this.softShadow===qr.VSM&&this._gaussianFilter(s,R,R.width);var J=new q;J.copy(y.viewMatrix).multiplyLeft(y.projectionMatrix),v.push(J.array),y.projectionMatrix.copy(o)}this._frameBuffer.unbind(s),s.setViewport(P)}}(),renderSpotLightShadow:function(t,e,r,i,n){var a=this._getTexture(r),o=this._getSpotLightCamera(r),s=t.gl;this._frameBuffer.attach(a),this._frameBuffer.bind(t),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var l=this._getDepthMaterial(r),u={getMaterial:function(v){return v.shadowDepthMaterial||l},isMaterialChanged:oy,getUniform:Hc,ifRender:function(v){return v.castShadow},sortCompare:yr.opaqueSortCompare},f=e.updateRenderList(o);t.renderPass(f.opaque,o,u),this._frameBuffer.unbind(t),this.softShadow===qr.VSM&&this._gaussianFilter(t,a,a.width);var h=new q;h.copy(o.worldTransform).invert().multiplyLeft(o.projectionMatrix),n.push(a),i.push(h.array)},renderPointLightShadow:function(t,e,r,i){var n=this._getTexture(r),a=t.gl;i.push(n);var o=this._getDepthMaterial(r),s={getMaterial:function(_){return _.shadowDepthMaterial||o},getUniform:Hc,sortCompare:yr.opaqueSortCompare},l={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},u=new ye,f=r.getWorldPosition().array,h=new ye,v=r.range;h.min.setArray(f),h.max.setArray(f);var c=new B(v,v,v);h.max.add(c),h.min.sub(c);var d={px:!1,py:!1,pz:!1,nx:!1,ny:!1,nz:!1};e.traverse(function(_){if(_.isRenderable()&&_.castShadow){var y=_.geometry;if(!y.boundingBox){for(var x=0;x<Ni.length;x++)l[Ni[x]].push(_);return}if(u.transformFrom(y.boundingBox,_.worldTransform),!u.intersectBoundingBox(h))return;u.updateVertices();for(var x=0;x<Ni.length;x++)d[Ni[x]]=!1;for(var x=0;x<8;x++){var S=u.vertices[x],T=S[0]-f[0],w=S[1]-f[1],b=S[2]-f[2],A=Math.abs(T),M=Math.abs(w),E=Math.abs(b);A>M?A>E?d[T>0?"px":"nx"]=!0:d[b>0?"pz":"nz"]=!0:M>E?d[w>0?"py":"ny"]=!0:d[b>0?"pz":"nz"]=!0}for(var x=0;x<Ni.length;x++)d[Ni[x]]&&l[Ni[x]].push(_)}});for(var p=0;p<6;p++){var g=Ni[p],m=this._getPointLightCamera(r,g);this._frameBuffer.attach(n,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+p),this._frameBuffer.bind(t),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),t.renderPass(l[g],m,s)}this._frameBuffer.unbind(t)},_getDepthMaterial:function(t){var e=this._lightMaterials[t.__uid__],r=t.type==="POINT_LIGHT";if(!e){var i=r?"clay.sm.distance.":"clay.sm.depth.";e=new Si({precision:this.precision,shader:new $($.source(i+"vertex"),$.source(i+"fragment"))}),this._lightMaterials[t.__uid__]=e}return t.shadowSlopeScale!=null&&e.setUniform("slopeScale",t.shadowSlopeScale),t.shadowBias!=null&&e.setUniform("bias",t.shadowBias),this.softShadow===qr.VSM?e.define("fragment","USE_VSM"):e.undefine("fragment","USE_VSM"),r&&(e.set("lightPosition",t.getWorldPosition().array),e.set("range",t.range)),e},_gaussianFilter:function(t,e,r){var i={width:r,height:r,type:W.FLOAT},n=this._texturePool.get(i);this._frameBuffer.attach(n),this._frameBuffer.bind(t),this._gaussianPassH.setUniform("texture",e),this._gaussianPassH.setUniform("textureWidth",r),this._gaussianPassH.render(t),this._frameBuffer.attach(e),this._gaussianPassV.setUniform("texture",n),this._gaussianPassV.setUniform("textureHeight",r),this._gaussianPassV.render(t),this._frameBuffer.unbind(t),this._texturePool.put(n)},_getTexture:function(t,e){var r=t.__uid__,i=this._textures[r],n=t.shadowResolution||512;return e=e||1,i||(t.type==="POINT_LIGHT"?i=new jn:i=new At,i.width=n*e,i.height=n,this.softShadow===qr.VSM?(i.type=W.FLOAT,i.anisotropic=4):(i.minFilter=F.NEAREST,i.magFilter=F.NEAREST,i.useMipmap=!1),this._textures[r]=i),i},_getPointLightCamera:function(t,e){this._lightCameras.point||(this._lightCameras.point={px:new ve,nx:new ve,py:new ve,ny:new ve,pz:new ve,nz:new ve});var r=this._lightCameras.point[e];switch(r.far=t.range,r.fov=90,r.position.set(0,0,0),e){case"px":r.lookAt(B.POSITIVE_X,B.NEGATIVE_Y);break;case"nx":r.lookAt(B.NEGATIVE_X,B.NEGATIVE_Y);break;case"py":r.lookAt(B.POSITIVE_Y,B.POSITIVE_Z);break;case"ny":r.lookAt(B.NEGATIVE_Y,B.NEGATIVE_Z);break;case"pz":r.lookAt(B.POSITIVE_Z,B.NEGATIVE_Y);break;case"nz":r.lookAt(B.NEGATIVE_Z,B.NEGATIVE_Y);break}return t.getWorldPosition(r.position),r.update(),r},_getDirectionalLightCamera:function(){var t=new q,e=new ye,r=new ye;return function(i,n,a){this._lightCameras.directional||(this._lightCameras.directional=new Os);var o=this._lightCameras.directional;e.copy(n.viewBoundingBoxLastFrame),e.intersection(a.frustum.boundingBox),o.position.copy(e.min).add(e.max).scale(.5).transformMat4(a.worldTransform),o.rotation.copy(i.rotation),o.scale.copy(i.scale),o.updateWorldTransform(),q.invert(t,o.worldTransform),q.multiply(t,t,a.worldTransform),r.copy(e).applyTransform(t);var s=r.min.array,l=r.max.array;return o.position.set((s[0]+l[0])/2,(s[1]+l[1])/2,l[2]).transformMat4(o.worldTransform),o.near=0,o.far=-s[2]+l[2],isNaN(this.lightFrustumBias)?o.far*=4:o.far+=this.lightFrustumBias,o.left=s[0],o.right=l[0],o.top=l[1],o.bottom=s[1],o.update(!0),o}}(),_getSpotLightCamera:function(t){this._lightCameras.spot||(this._lightCameras.spot=new ve);var e=this._lightCameras.spot;return e.fov=t.penumbraAngle*2,e.far=t.range,e.worldTransform.copy(t.worldTransform),e.updateProjectionMatrix(),z.invert(e.viewMatrix.array,e.worldTransform.array),e},dispose:function(t){var e=t.gl||t;this._frameBuffer&&this._frameBuffer.dispose(e);for(var r in this._textures)this._textures[r].dispose(e);this._texturePool.clear(t.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var i=0;i<this._receivers.length;i++){var n=this._receivers[i];if(n.material){var a=n.material;a.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),a.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),a.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),a.set("shadowEnabled",0)}}this._receivers=[],this._lightsCastShadow=[]}});qr.VSM=1;qr.PCF=2;var Fs=Se.extend(function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},{updateParameter:function(t,e){var r=this.outputs[t],i=r.parameters,n=r._parametersCopy;if(n||(n=r._parametersCopy={}),i)for(var a in i)a!=="width"&&a!=="height"&&(n[a]=i[a]);var o,s;return i.width instanceof Function?o=i.width.call(this,e):o=i.width,i.height instanceof Function?s=i.height.call(this,e):s=i.height,(n.width!==o||n.height!==s)&&this._outputTextures[t]&&this._outputTextures[t].dispose(e.gl),n.width=o,n.height=s,n},setParameter:function(t,e){},getParameter:function(t){},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},render:function(){},getOutput:function(t,e){if(e==null)return e=t,this._outputTextures[e];var r=this.outputs[e];if(r)return this._rendered?r.outputLastFrame?this._prevOutputTextures[e]:this._outputTextures[e]:this._rendering?(this._prevOutputTextures[e]||(this._prevOutputTextures[e]=this._compositor.allocateTexture(r.parameters||{})),this._prevOutputTextures[e]):(this.render(t),this._outputTextures[e])},removeReference:function(t){if(this._outputReferences[t]--,this._outputReferences[t]===0){var e=this.outputs[t];e.keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t])}},link:function(t,e,r){this.inputLinks[t]={node:e,pin:r},e.outputLinks[r]||(e.outputLinks[r]=[]),e.outputLinks[r].push({node:this,pin:t}),this.pass.material.enableTexture(t)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(t){if(!this._rendering){this._rendering=!0;for(var e in this.inputLinks){var r=this.inputLinks[e];r.node.updateReference(r.pin)}this._rendering=!1}t&&this._outputReferences[t]++},beforeFrame:function(){this._rendered=!1;for(var t in this.outputLinks)this._outputReferences[t]=0},afterFrame:function(){for(var t in this.outputLinks)if(this._outputReferences[t]>0){var e=this.outputs[t];e.keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t])}}}),sy=Se.extend(function(){return{nodes:[]}},{dirty:function(){this._dirty=!0},addNode:function(t){this.nodes.indexOf(t)>=0||(this.nodes.push(t),this._dirty=!0)},removeNode:function(t){typeof t=="string"&&(t=this.getNodeByName(t));var e=this.nodes.indexOf(t);e>=0&&(this.nodes.splice(e,1),this._dirty=!0)},getNodeByName:function(t){for(var e=0;e<this.nodes.length;e++)if(this.nodes[e].name===t)return this.nodes[e]},update:function(){for(var t=0;t<this.nodes.length;t++)this.nodes[t].clear();for(var t=0;t<this.nodes.length;t++){var e=this.nodes[t];if(e.inputs){for(var r in e.inputs)if(e.inputs[r]){if(e.pass&&!e.pass.material.isUniformEnabled(r)){console.warn("Pin "+e.name+"."+r+" not used.");continue}var i=e.inputs[r],n=this.findPin(i);n?e.link(r,n.node,n.pin):console.warn(typeof i=="string"?"Node "+i+" not exist":"Pin of "+i.node+"."+i.pin+" not exist")}}}},findPin:function(t){var e;if((typeof t=="string"||t instanceof Fs)&&(t={node:t}),typeof t.node=="string")for(var r=0;r<this.nodes.length;r++){var i=this.nodes[r];i.name===t.node&&(e=i)}else e=t.node;if(e){var n=t.pin;if(n||e.outputs&&(n=Object.keys(e.outputs)[0]),e.outputs[n])return{node:e,pin:n}}}}),I3=sy.extend(function(){return{_outputs:[],_texturePool:new rf,_frameBuffer:new he({depthBuffer:!1})}},{addNode:function(t){sy.prototype.addNode.call(this,t),t._compositor=this},render:function(t,e){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var r=0;r<this.nodes.length;r++)this.nodes[r].outputs||this._outputs.push(this.nodes[r])}for(var r=0;r<this.nodes.length;r++)this.nodes[r].beforeFrame();for(var r=0;r<this._outputs.length;r++)this._outputs[r].updateReference();for(var r=0;r<this._outputs.length;r++)this._outputs[r].render(t,e);for(var r=0;r<this.nodes.length;r++)this.nodes[r].afterFrame()},allocateTexture:function(t){return this._texturePool.get(t)},releaseTexture:function(t){this._texturePool.put(t)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(t){this._texturePool.clear(t)}}),N3=Fs.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},function(){this.frameBuffer=new he},{render:function(t){this._rendering=!0;var e=t.gl;this.trigger("beforerender");var r;if(!this.outputs)r=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);else{var i=this.frameBuffer;for(var n in this.outputs){var a=this.updateParameter(n,t),o=this.outputs[n],s=this._compositor.allocateTexture(a);this._outputTextures[n]=s;var l=o.attachment||e.COLOR_ATTACHMENT0;typeof l=="string"&&(l=e[l]),i.attach(s,l)}i.bind(t);var u=t.getGLExtension("EXT_draw_buffers");if(u){var f=[];for(var l in this.outputs)l=parseInt(l),l>=e.COLOR_ATTACHMENT0&&l<=e.COLOR_ATTACHMENT0+8&&f.push(l);u.drawBuffersEXT(f)}t.saveClear(),t.clearBit=F.DEPTH_BUFFER_BIT|F.COLOR_BUFFER_BIT,r=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),t.restoreClear(),i.unbind(t)}this.trigger("afterrender",r),this._rendering=!1,this._rendered=!0}}),O3=Fs.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(t,e){return this.texture},beforeFrame:function(){},afterFrame:function(){}}),B3=Fs.extend(function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},function(){var t=new Oe({fragment:this.shader});this.pass=t},{render:function(t,e){this.trigger("beforerender",t),this._rendering=!0;var r=t.gl;for(var i in this.inputLinks){var n=this.inputLinks[i],a=n.node.getOutput(t,n.pin);this.pass.setUniform(i,a)}if(!this.outputs)this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(t),this.pass.render(t,e);else{this.pass.outputs={};var o={};for(var s in this.outputs){var l=this.updateParameter(s,t);isNaN(l.width)&&this.updateParameter(s,t);var u=this.outputs[s],f=this._compositor.allocateTexture(l);this._outputTextures[s]=f;var h=u.attachment||r.COLOR_ATTACHMENT0;typeof h=="string"&&(h=r[h]),o[h]=f}this._compositor.getFrameBuffer().bind(t);for(var h in o)this._compositor.getFrameBuffer().attach(o[h],h);this.pass.render(t),this._compositor.getFrameBuffer().updateMipmap(t)}for(var i in this.inputLinks){var n=this.inputLinks[i];n.node.removeReference(n.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",t)},updateParameter:function(t,e){var r=this.outputs[t],i=r.parameters,n=r._parametersCopy;if(n||(n=r._parametersCopy={}),i)for(var a in i)a!=="width"&&a!=="height"&&(n[a]=i[a]);var o,s;return typeof i.width=="function"?o=i.width.call(this,e):o=i.width,typeof i.height=="function"?s=i.height.call(this,e):s=i.height,o=Math.ceil(o),s=Math.ceil(s),(n.width!==o||n.height!==s)&&this._outputTextures[t]&&this._outputTextures[t].dispose(e),n.width=o,n.height=s,n},setParameter:function(t,e){this.pass.setUniform(t,e)},getParameter:function(t){return this.pass.getUniform(t)},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},define:function(t,e){this.pass.material.define("fragment",t,e)},undefine:function(t){this.pass.material.undefine("fragment",t)},removeReference:function(t){if(this._outputReferences[t]--,this._outputReferences[t]===0){var e=this.outputs[t];e.keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t])}},clear:function(){Fs.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});const F3=`@export clay.compositor.coloradjust
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float brightness : 0.0;
uniform float contrast : 1.0;
uniform float exposure : 0.0;
uniform float gamma : 1.0;
uniform float saturation : 1.0;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
vec4 tex = texture2D( texture, v_Texcoord);
vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);
color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);
color = clamp( color * pow(2.0, exposure), 0.0, 1.0);
color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);
float luminance = dot( color, w );
color = mix(vec3(luminance), color, saturation);
gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.brightness
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float brightness : 0.0;
void main()
{
vec4 tex = texture2D( texture, v_Texcoord);
vec3 color = tex.rgb + vec3(brightness);
gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.contrast
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float contrast : 1.0;
void main()
{
vec4 tex = texture2D( texture, v_Texcoord);
vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);
gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.exposure
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float exposure : 0.0;
void main()
{
vec4 tex = texture2D(texture, v_Texcoord);
vec3 color = tex.rgb * pow(2.0, exposure);
gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.gamma
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float gamma : 1.0;
void main()
{
vec4 tex = texture2D(texture, v_Texcoord);
vec3 color = pow(tex.rgb, vec3(gamma));
gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.saturation
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float saturation : 1.0;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
vec4 tex = texture2D(texture, v_Texcoord);
vec3 color = tex.rgb;
float luminance = dot(color, w);
color = mix(vec3(luminance), color, saturation);
gl_FragColor = vec4(color, tex.a);
}
@end`,Nw=`@export clay.compositor.kernel.gaussian_9
float gaussianKernel[9];
gaussianKernel[0] = 0.07;
gaussianKernel[1] = 0.09;
gaussianKernel[2] = 0.12;
gaussianKernel[3] = 0.14;
gaussianKernel[4] = 0.16;
gaussianKernel[5] = 0.14;
gaussianKernel[6] = 0.12;
gaussianKernel[7] = 0.09;
gaussianKernel[8] = 0.07;
@end
@export clay.compositor.kernel.gaussian_13
float gaussianKernel[13];
gaussianKernel[0] = 0.02;
gaussianKernel[1] = 0.03;
gaussianKernel[2] = 0.06;
gaussianKernel[3] = 0.08;
gaussianKernel[4] = 0.11;
gaussianKernel[5] = 0.13;
gaussianKernel[6] = 0.14;
gaussianKernel[7] = 0.13;
gaussianKernel[8] = 0.11;
gaussianKernel[9] = 0.08;
gaussianKernel[10] = 0.06;
gaussianKernel[11] = 0.03;
gaussianKernel[12] = 0.02;
@end
@export clay.compositor.gaussian_blur
#define SHADER_NAME gaussian_blur
uniform sampler2D texture;varying vec2 v_Texcoord;
uniform float blurSize : 2.0;
uniform vec2 textureSize : [512.0, 512.0];
uniform float blurDir : 0.0;
@import clay.util.rgbm
@import clay.util.clamp_sample
void main (void)
{
@import clay.compositor.kernel.gaussian_9
vec2 off = blurSize / textureSize;
off *= vec2(1.0 - blurDir, blurDir);
vec4 sum = vec4(0.0);
float weightAll = 0.0;
for (int i = 0; i < 9; i++) {
float w = gaussianKernel[i];
vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));
sum += texel * w;
weightAll += w;
}
gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));
}
@end
`,k3=`@export clay.compositor.hdr.log_lum
varying vec2 v_Texcoord;
uniform sampler2D texture;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
@import clay.util.rgbm
void main()
{
vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));
float luminance = dot(tex.rgb, w);
luminance = log(luminance + 0.001);
gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));
}
@end
@export clay.compositor.hdr.lum_adaption
varying vec2 v_Texcoord;
uniform sampler2D adaptedLum;
uniform sampler2D currentLum;
uniform float frameTime : 0.02;
@import clay.util.rgbm
void main()
{
float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;
float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);
fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));
gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));
}
@end
@export clay.compositor.lum
varying vec2 v_Texcoord;
uniform sampler2D texture;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
vec4 tex = texture2D( texture, v_Texcoord );
float luminance = dot(tex.rgb, w);
gl_FragColor = vec4(vec3(luminance), 1.0);
}
@end`,Ow=`
@export clay.compositor.lut
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform sampler2D lookup;
void main()
{
vec4 tex = texture2D(texture, v_Texcoord);
float blueColor = tex.b * 63.0;
vec2 quad1;
quad1.y = floor(floor(blueColor) / 8.0);
quad1.x = floor(blueColor) - (quad1.y * 8.0);
vec2 quad2;
quad2.y = floor(ceil(blueColor) / 8.0);
quad2.x = ceil(blueColor) - (quad2.y * 8.0);
vec2 texPos1;
texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);
texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);
vec2 texPos2;
texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);
texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);
vec4 newColor1 = texture2D(lookup, texPos1);
vec4 newColor2 = texture2D(lookup, texPos2);
vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
gl_FragColor = vec4(newColor.rgb, tex.w);
}
@end`,z3=`@export clay.compositor.vignette
#define OUTPUT_ALPHA
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float darkness: 1;
uniform float offset: 1;
@import clay.util.rgbm
void main()
{
vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));
gl_FragColor.rgb = texel.rgb;
vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);
gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));
}
@end`,Bw=`@export clay.compositor.output
#define OUTPUT_ALPHA
varying vec2 v_Texcoord;
uniform sampler2D texture;
@import clay.util.rgbm
void main()
{
vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));
gl_FragColor.rgb = tex.rgb;
#ifdef OUTPUT_ALPHA
gl_FragColor.a = tex.a;
#else
gl_FragColor.a = 1.0;
#endif
gl_FragColor = encodeHDR(gl_FragColor);
#ifdef PREMULTIPLY_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif
}
@end`,Fw=`@export clay.compositor.bright
uniform sampler2D texture;
uniform float threshold : 1;
uniform float scale : 1.0;
uniform vec2 textureSize: [512, 512];
varying vec2 v_Texcoord;
const vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);
@import clay.util.rgbm
vec4 median(vec4 a, vec4 b, vec4 c)
{
return a + b + c - min(min(a, b), c) - max(max(a, b), c);
}
void main()
{
vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));
#ifdef ANTI_FLICKER
vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);
vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));
vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));
vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));
vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));
texel = median(median(texel, s1, s2), s3, s4);
#endif
float lum = dot(texel.rgb , lumWeight);
vec4 color;
if (lum > threshold && texel.a > 0.0)
{
color = vec4(texel.rgb * scale, texel.a * scale);
}
else
{
color = vec4(0.0);
}
gl_FragColor = encodeHDR(color);
}
@end
`,kw=`@export clay.compositor.downsample
uniform sampler2D texture;
uniform vec2 textureSize : [512, 512];
varying vec2 v_Texcoord;
@import clay.util.rgbm
float brightness(vec3 c)
{
return max(max(c.r, c.g), c.b);
}
@import clay.util.clamp_sample
void main()
{
vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;
#ifdef ANTI_FLICKER
vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;
vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;
vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;
vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;
float s1w = 1.0 / (brightness(s1) + 1.0);
float s2w = 1.0 / (brightness(s2) + 1.0);
float s3w = 1.0 / (brightness(s3) + 1.0);
float s4w = 1.0 / (brightness(s4) + 1.0);
float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);
vec4 color = vec4(
(s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,
1.0
);
#else
vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));
color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));
color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));
color *= 0.25;
#endif
gl_FragColor = encodeHDR(color);
}
@end`,zw=`
@export clay.compositor.upsample
#define HIGH_QUALITY
uniform sampler2D texture;
uniform vec2 textureSize : [512, 512];
uniform float sampleScale: 0.5;
varying vec2 v_Texcoord;
@import clay.util.rgbm
@import clay.util.clamp_sample
void main()
{
#ifdef HIGH_QUALITY
vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;
vec4 s;
s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));
s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;
s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));
s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;
s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;
s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;
s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;
s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));
gl_FragColor = encodeHDR(s / 16.0);
#else
vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;
vec4 s;
s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));
s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));
s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));
gl_FragColor = encodeHDR(s / 4.0);
#endif
}
@end`,Uw=`@export clay.compositor.hdr.composite
#define TONEMAPPING
uniform sampler2D texture;
#ifdef BLOOM_ENABLED
uniform sampler2D bloom;
#endif
#ifdef LENSFLARE_ENABLED
uniform sampler2D lensflare;
uniform sampler2D lensdirt;
#endif
#ifdef LUM_ENABLED
uniform sampler2D lum;
#endif
#ifdef LUT_ENABLED
uniform sampler2D lut;
#endif
#ifdef COLOR_CORRECTION
uniform float brightness : 0.0;
uniform float contrast : 1.0;
uniform float saturation : 1.0;
#endif
#ifdef VIGNETTE
uniform float vignetteDarkness: 1.0;
uniform float vignetteOffset: 1.0;
#endif
uniform float exposure : 1.0;
uniform float bloomIntensity : 0.25;
uniform float lensflareIntensity : 1;
varying vec2 v_Texcoord;
@import clay.util.srgb
vec3 ACESToneMapping(vec3 color)
{
const float A = 2.51;
const float B = 0.03;
const float C = 2.43;
const float D = 0.59;
const float E = 0.14;
return (color * (A * color + B)) / (color * (C * color + D) + E);
}
float eyeAdaption(float fLum)
{
return mix(0.2, fLum, 0.5);
}
#ifdef LUT_ENABLED
vec3 lutTransform(vec3 color) {
float blueColor = color.b * 63.0;
vec2 quad1;
quad1.y = floor(floor(blueColor) / 8.0);
quad1.x = floor(blueColor) - (quad1.y * 8.0);
vec2 quad2;
quad2.y = floor(ceil(blueColor) / 8.0);
quad2.x = ceil(blueColor) - (quad2.y * 8.0);
vec2 texPos1;
texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);
texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);
vec2 texPos2;
texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);
texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);
vec4 newColor1 = texture2D(lut, texPos1);
vec4 newColor2 = texture2D(lut, texPos2);
vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
return newColor.rgb;
}
#endif
@import clay.util.rgbm
void main()
{
vec4 texel = vec4(0.0);
vec4 originalTexel = vec4(0.0);
#ifdef TEXTURE_ENABLED
texel = decodeHDR(texture2D(texture, v_Texcoord));
originalTexel = texel;
#endif
#ifdef BLOOM_ENABLED
vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));
texel.rgb += bloomTexel.rgb * bloomIntensity;
texel.a += bloomTexel.a * bloomIntensity;
#endif
#ifdef LENSFLARE_ENABLED
texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;
#endif
texel.a = min(texel.a, 1.0);
#ifdef LUM_ENABLED
float fLum = texture2D(lum, vec2(0.5, 0.5)).r;
float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));
float exposureBias = adaptedLumDest * exposure;
#else
float exposureBias = exposure;
#endif
#ifdef TONEMAPPING
texel.rgb *= exposureBias;
texel.rgb = ACESToneMapping(texel.rgb);
#endif
texel = linearTosRGB(texel);
#ifdef LUT_ENABLED
texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));
#endif
#ifdef COLOR_CORRECTION
texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);
texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);
float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));
texel.rgb = mix(vec3(lum), texel.rgb, saturation);
#endif
#ifdef VIGNETTE
vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);
texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));
#endif
gl_FragColor = encodeHDR(texel);
#ifdef DEBUG
#if DEBUG == 1
gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));
#elif DEBUG == 2
gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);
#elif DEBUG == 3
gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));
#endif
#endif
if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {
gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));
}
#ifdef PREMULTIPLY_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif
}
@end`,U3=`@export clay.compositor.lensflare
#define SAMPLE_NUMBER 8
uniform sampler2D texture;
uniform sampler2D lenscolor;
uniform vec2 textureSize : [512, 512];
uniform float dispersal : 0.3;
uniform float haloWidth : 0.4;
uniform float distortion : 1.0;
varying vec2 v_Texcoord;
@import clay.util.rgbm
vec4 textureDistorted(
in vec2 texcoord,
in vec2 direction,
in vec3 distortion
) {
return vec4(
decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,
decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,
decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,
1.0
);
}
void main()
{
vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;
vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;
vec2 haloVec = normalize(ghostVec) * haloWidth;
vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);
vec4 result = vec4(0.0);
for (int i = 0; i < SAMPLE_NUMBER; i++)
{
vec2 offset = fract(texcoord + ghostVec * float(i));
float weight = length(vec2(0.5) - offset) / length(vec2(0.5));
weight = pow(1.0 - weight, 10.0);
result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;
}
result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));
float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
weight = pow(1.0 - weight, 10.0);
vec2 offset = fract(texcoord + haloVec);
result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;
gl_FragColor = result;
}
@end`,Hw=`@export clay.compositor.blend
#define SHADER_NAME blend
#ifdef TEXTURE1_ENABLED
uniform sampler2D texture1;
uniform float weight1 : 1.0;
#endif
#ifdef TEXTURE2_ENABLED
uniform sampler2D texture2;
uniform float weight2 : 1.0;
#endif
#ifdef TEXTURE3_ENABLED
uniform sampler2D texture3;
uniform float weight3 : 1.0;
#endif
#ifdef TEXTURE4_ENABLED
uniform sampler2D texture4;
uniform float weight4 : 1.0;
#endif
#ifdef TEXTURE5_ENABLED
uniform sampler2D texture5;
uniform float weight5 : 1.0;
#endif
#ifdef TEXTURE6_ENABLED
uniform sampler2D texture6;
uniform float weight6 : 1.0;
#endif
varying vec2 v_Texcoord;
@import clay.util.rgbm
void main()
{
vec4 tex = vec4(0.0);
#ifdef TEXTURE1_ENABLED
tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;
#endif
#ifdef TEXTURE2_ENABLED
tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;
#endif
#ifdef TEXTURE3_ENABLED
tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;
#endif
#ifdef TEXTURE4_ENABLED
tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;
#endif
#ifdef TEXTURE5_ENABLED
tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;
#endif
#ifdef TEXTURE6_ENABLED
tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;
#endif
gl_FragColor = encodeHDR(tex);
}
@end`,Vw=`@export clay.compositor.fxaa
uniform sampler2D texture;
uniform vec4 viewport : VIEWPORT;
varying vec2 v_Texcoord;
#define FXAA_REDUCE_MIN (1.0/128.0)
#define FXAA_REDUCE_MUL (1.0/8.0)
#define FXAA_SPAN_MAX 8.0
@import clay.util.rgbm
void main()
{
vec2 resolution = 1.0 / viewport.zw;
vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;
vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;
vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;
vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;
vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );
vec3 rgbM = rgbaM.xyz;
float opacity = rgbaM.w;
vec3 luma = vec3( 0.299, 0.587, 0.114 );
float lumaNW = dot( rgbNW, luma );
float lumaNE = dot( rgbNE, luma );
float lumaSW = dot( rgbSW, luma );
float lumaSE = dot( rgbSE, luma );
float lumaM = dot( rgbM, luma );
float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );
float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );
vec2 dir;
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );
float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );
dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),
max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
dir * rcpDirMin)) * resolution;
vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;
rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;
rgbA *= 0.5;
vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;
rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;
rgbB *= 0.25;
rgbB += rgbA * 0.5;
float lumaB = dot( rgbB, luma );
if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )
{
gl_FragColor = vec4( rgbA, opacity );
}
else {
gl_FragColor = vec4( rgbB, opacity );
}
}
@end`;function H3(t){t.import(F3),t.import(Nw),t.import(k3),t.import(Ow),t.import(z3),t.import(Bw),t.import(Fw),t.import(kw),t.import(zw),t.import(Uw),t.import(U3),t.import(Hw),t.import(Vw)}H3($);var V3=/^#source\((.*?)\)/;function G3(t,e){var r=new I3;e=e||{};var i={textures:{},parameters:{}},n=function(s,l){for(var u=0;u<t.nodes.length;u++){var f=t.nodes[u],h=W3(f,i,e);h&&r.addNode(h)}};for(var a in t.parameters){var o=t.parameters[a];i.parameters[a]=Yp(o)}return Z3(t,i,e,function(s){i.textures=s,n()}),r}function W3(t,e,r){var i=t.type||"filter",n,a,o;if(i==="filter"){var s=t.shader.trim(),l=V3.exec(s);if(l?n=$.source(l[1].trim()):s.charAt(0)==="#"&&(n=e.shaders[s.substr(1)]),n||(n=s),!n)return}if(t.inputs){a={};for(var u in t.inputs)typeof t.inputs[u]=="string"?a[u]=t.inputs[u]:a[u]={node:t.inputs[u].node,pin:t.inputs[u].pin}}if(t.outputs){o={};for(var u in t.outputs){var f=t.outputs[u];o[u]={},f.attachment!=null&&(o[u].attachment=f.attachment),f.keepLastFrame!=null&&(o[u].keepLastFrame=f.keepLastFrame),f.outputLastFrame!=null&&(o[u].outputLastFrame=f.outputLastFrame),f.parameters&&(o[u].parameters=Yp(f.parameters))}}var h;if(i==="scene"?h=new N3({name:t.name,scene:r.scene,camera:r.camera,outputs:o}):i==="texture"?h=new O3({name:t.name,outputs:o}):h=new B3({name:t.name,shader:n,inputs:a,outputs:o}),h){if(t.parameters)for(var u in t.parameters){var v=t.parameters[u];typeof v=="string"?(v=v.trim(),v.charAt(0)==="#"?v=e.textures[v.substr(1)]:h.on("beforerender",q3(u,Gw(v)))):typeof v=="function"&&h.on("beforerender",v),h.setParameter(u,v)}if(t.defines&&h.pass)for(var u in t.defines){var v=t.defines[u];h.pass.material.define("fragment",u,v)}}return h}function X3(t,e){return t}function Y3(t,e){return e}function Yp(t){var e={};if(!t)return e;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach(function(i){var n=t[i];n!=null&&(typeof n=="string"&&(n=W[n]),e[i]=n)});var r=t.scale||1;return["width","height"].forEach(function(i){if(t[i]!=null){var n=t[i];typeof n=="string"?(n=n.trim(),e[i]=$3(i,Gw(n),r)):e[i]=n}}),e.width||(e.width=X3),e.height||(e.height=Y3),t.useMipmap!=null&&(e.useMipmap=t.useMipmap),e}function Z3(t,e,r,i){if(!t.textures){i({});return}var n={},a=0,o=!1,s=r.textureRootPath;ne.each(t.textures,function(l,u){var f,h=l.path,v=Yp(l.parameters);if(Array.isArray(h)&&h.length===6)s&&(h=h.map(function(c){return ne.relative2absolute(c,s)})),f=new jn(v);else if(typeof h=="string")s&&(h=ne.relative2absolute(h,s)),f=new At(v);else return;f.load(h),a++,f.once("success",function(){n[u]=f,a--,a===0&&(i(n),o=!0)})}),a===0&&!o&&i(n)}function q3(t,e){return function(r){var i=r.getDevicePixelRatio(),n=r.getWidth(),a=r.getHeight(),o=e(n,a,i);this.setParameter(t,o)}}function $3(t,e,r){return r=r||1,function(i){var n=i.getDevicePixelRatio(),a=i.getWidth()*r,o=i.getHeight()*r;return e(a,o,n)}}function Gw(t){var e=/^expr\((.*)\)$/.exec(t);if(e)try{var r=new Function("width","height","dpr","return "+e[1]);return r(1,1),r}catch{throw new Error("Invalid expression.")}}function ao(t,e){for(var r=0,i=1/e,n=t;n>0;)r=r+i*(n%e),n=Math.floor(n/e),i=i/e;return r}const K3=`@export ecgl.ssao.estimate
uniform sampler2D depthTex;
uniform sampler2D normalTex;
uniform sampler2D noiseTex;
uniform vec2 depthTexSize;
uniform vec2 noiseTexSize;
uniform mat4 projection;
uniform mat4 projectionInv;
uniform mat4 viewInverseTranspose;
uniform vec3 kernel[KERNEL_SIZE];
uniform float radius : 1;
uniform float power : 1;
uniform float bias: 1e-2;
uniform float intensity: 1.0;
varying vec2 v_Texcoord;
float ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {
float occlusion = 0.0;
for (int i = 0; i < KERNEL_SIZE; i++) {
vec3 samplePos = kernel[i];
#ifdef NORMALTEX_ENABLED
samplePos = kernelBasis * samplePos;
#endif
samplePos = samplePos * radius + originPos;
vec4 texCoord = projection * vec4(samplePos, 1.0);
texCoord.xy /= texCoord.w;
vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);
float sampleDepth = depthTexel.r * 2.0 - 1.0;
if (projection[3][3] == 0.0) {
sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);
}
else {
sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];
}
float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));
occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);
}
#ifdef NORMALTEX_ENABLED
occlusion = 1.0 - occlusion / float(KERNEL_SIZE);
#else
occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);
#endif
return pow(occlusion, power);
}
void main()
{
vec4 depthTexel = texture2D(depthTex, v_Texcoord);
#ifdef NORMALTEX_ENABLED
vec4 tex = texture2D(normalTex, v_Texcoord);
if (dot(tex.rgb, tex.rgb) == 0.0) {
gl_FragColor = vec4(1.0);
return;
}
vec3 N = tex.rgb * 2.0 - 1.0;
N = (viewInverseTranspose * vec4(N, 0.0)).xyz;
vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;
vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;
vec3 T = normalize(rvec - N * dot(rvec, N));
vec3 BT = normalize(cross(N, T));
mat3 kernelBasis = mat3(T, BT, N);
#else
if (depthTexel.r > 0.99999) {
gl_FragColor = vec4(1.0);
return;
}
mat3 kernelBasis;
#endif
float z = depthTexel.r * 2.0 - 1.0;
vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);
vec4 p4 = projectionInv * projectedPos;
vec3 position = p4.xyz / p4.w;
float ao = ssaoEstimator(position, kernelBasis);
ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);
gl_FragColor = vec4(vec3(ao), 1.0);
}
@end
@export ecgl.ssao.blur
#define SHADER_NAME SSAO_BLUR
uniform sampler2D ssaoTexture;
#ifdef NORMALTEX_ENABLED
uniform sampler2D normalTex;
#endif
varying vec2 v_Texcoord;
uniform vec2 textureSize;
uniform float blurSize : 1.0;
uniform int direction: 0.0;
#ifdef DEPTHTEX_ENABLED
uniform sampler2D depthTex;
uniform mat4 projection;
uniform float depthRange : 0.5;
float getLinearDepth(vec2 coord)
{
float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;
return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
}
#endif
void main()
{
float kernel[5];
kernel[0] = 0.122581;
kernel[1] = 0.233062;
kernel[2] = 0.288713;
kernel[3] = 0.233062;
kernel[4] = 0.122581;
vec2 off = vec2(0.0);
if (direction == 0) {
off[0] = blurSize / textureSize.x;
}
else {
off[1] = blurSize / textureSize.y;
}
vec2 coord = v_Texcoord;
float sum = 0.0;
float weightAll = 0.0;
#ifdef NORMALTEX_ENABLED
vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;
#endif
#if defined(DEPTHTEX_ENABLED)
float centerDepth = getLinearDepth(v_Texcoord);
#endif
for (int i = 0; i < 5; i++) {
vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));
float w = kernel[i];
#ifdef NORMALTEX_ENABLED
vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;
w *= clamp(dot(normal, centerNormal), 0.0, 1.0);
#endif
#ifdef DEPTHTEX_ENABLED
float d = getLinearDepth(coord);
w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));
#endif
weightAll += w;
sum += texture2D(ssaoTexture, coord).r * w;
}
gl_FragColor = vec4(vec3(sum / weightAll), 1.0);
}
@end
`;$.import(K3);function Ww(t){for(var e=new Uint8Array(t*t*4),r=0,i=new B,n=0;n<t;n++)for(var a=0;a<t;a++)i.set(Math.random()*2-1,Math.random()*2-1,0).normalize(),e[r++]=(i.x*.5+.5)*255,e[r++]=(i.y*.5+.5)*255,e[r++]=0,e[r++]=255;return e}function ly(t){return new At({pixels:Ww(t),wrapS:W.REPEAT,wrapT:W.REPEAT,width:t,height:t})}function j3(t,e,r){var i=new Float32Array(t*3);e=e||0;for(var n=0;n<t;n++){var a=ao(n+e,2)*(r?1:2)*Math.PI,o=ao(n+e,3)*Math.PI,s=Math.random(),l=Math.cos(a)*Math.sin(o)*s,u=Math.cos(o)*s,f=Math.sin(a)*Math.sin(o)*s;i[n*3]=l,i[n*3+1]=u,i[n*3+2]=f}return i}function wi(t){t=t||{},this._ssaoPass=new Oe({fragment:$.source("ecgl.ssao.estimate")}),this._blurPass=new Oe({fragment:$.source("ecgl.ssao.blur")}),this._framebuffer=new he({depthBuffer:!1}),this._ssaoTexture=new At,this._blurTexture=new At,this._blurTexture2=new At,this._depthTex=t.depthTexture,this._normalTex=t.normalTexture,this.setNoiseSize(4),this.setKernelSize(t.kernelSize||12),t.radius!=null&&this.setParameter("radius",t.radius),t.power!=null&&this.setParameter("power",t.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}wi.prototype.setDepthTexture=function(t){this._depthTex=t};wi.prototype.setNormalTexture=function(t){this._normalTex=t,this._ssaoPass.material[t?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)};wi.prototype.update=function(t,e,r){var i=t.getWidth(),n=t.getHeight(),a=this._ssaoPass,o=this._blurPass;a.setUniform("kernel",this._kernels[r%this._kernels.length]),a.setUniform("depthTex",this._depthTex),this._normalTex!=null&&a.setUniform("normalTex",this._normalTex),a.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var s=new q;q.transpose(s,e.worldTransform),a.setUniform("projection",e.projectionMatrix.array),a.setUniform("projectionInv",e.invProjectionMatrix.array),a.setUniform("viewInverseTranspose",s.array);var l=this._ssaoTexture,u=this._blurTexture,f=this._blurTexture2;l.width=i/2,l.height=n/2,u.width=i,u.height=n,f.width=i,f.height=n,this._framebuffer.attach(l),this._framebuffer.bind(t),t.gl.clearColor(1,1,1,1),t.gl.clear(t.gl.COLOR_BUFFER_BIT),a.render(t),o.setUniform("textureSize",[i/2,n/2]),o.setUniform("projection",e.projectionMatrix.array),this._framebuffer.attach(u),o.setUniform("direction",0),o.setUniform("ssaoTexture",l),o.render(t),this._framebuffer.attach(f),o.setUniform("textureSize",[i,n]),o.setUniform("direction",1),o.setUniform("ssaoTexture",u),o.render(t),this._framebuffer.unbind(t);var h=t.clearColor;t.gl.clearColor(h[0],h[1],h[2],h[3])};wi.prototype.getTargetTexture=function(){return this._blurTexture2};wi.prototype.setParameter=function(t,e){t==="noiseTexSize"?this.setNoiseSize(e):t==="kernelSize"?this.setKernelSize(e):t==="intensity"?this._ssaoPass.material.set("intensity",e):this._ssaoPass.setUniform(t,e)};wi.prototype.setKernelSize=function(t){this._kernelSize=t,this._ssaoPass.material.define("fragment","KERNEL_SIZE",t),this._kernels=this._kernels||[];for(var e=0;e<30;e++)this._kernels[e]=j3(t,e*t,!!this._normalTex)};wi.prototype.setNoiseSize=function(t){var e=this._ssaoPass.getUniform("noiseTex");e?(e.data=Ww(t),e.width=e.height=t,e.dirty()):(e=ly(t),this._ssaoPass.setUniform("noiseTex",ly(t))),this._ssaoPass.setUniform("noiseTexSize",[t,t])};wi.prototype.dispose=function(t){this._blurTexture.dispose(t),this._ssaoTexture.dispose(t),this._blurTexture2.dispose(t)};const Q3=`@export ecgl.ssr.main
#define SHADER_NAME SSR
#define MAX_ITERATION 20;
#define SAMPLE_PER_FRAME 5;
#define TOTAL_SAMPLES 128;
uniform sampler2D sourceTexture;
uniform sampler2D gBufferTexture1;
uniform sampler2D gBufferTexture2;
uniform sampler2D gBufferTexture3;
uniform samplerCube specularCubemap;
uniform float specularIntensity: 1;
uniform mat4 projection;
uniform mat4 projectionInv;
uniform mat4 toViewSpace;
uniform mat4 toWorldSpace;
uniform float maxRayDistance: 200;
uniform float pixelStride: 16;
uniform float pixelStrideZCutoff: 50;
uniform float screenEdgeFadeStart: 0.9;
uniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8;
uniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;
uniform float nearZ;
uniform vec2 viewportSize : VIEWPORT_SIZE;
uniform float jitterOffset: 0;
varying vec2 v_Texcoord;
#ifdef DEPTH_DECODE
@import clay.util.decode_float
#endif
#ifdef PHYSICALLY_CORRECT
uniform sampler2D normalDistribution;
uniform float sampleOffset: 0;
uniform vec2 normalDistributionSize;
vec3 transformNormal(vec3 H, vec3 N) {
vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
vec3 tangentX = normalize(cross(N, upVector));
vec3 tangentZ = cross(N, tangentX);
return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
vec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {
float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));
vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;
return transformNormal(H, N);
}
float G_Smith(float g, float ndv, float ndl) {
float roughness = 1.0 - g;
float k = roughness * roughness / 2.0;
float G1V = ndv / (ndv * (1.0 - k) + k);
float G1L = ndl / (ndl * (1.0 - k) + k);
return G1L * G1V;
}
vec3 F_Schlick(float ndv, vec3 spec) {
return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);
}
#endif
float fetchDepth(sampler2D depthTexture, vec2 uv)
{
vec4 depthTexel = texture2D(depthTexture, uv);
return depthTexel.r * 2.0 - 1.0;
}
float linearDepth(float depth)
{
if (projection[3][3] == 0.0) {
return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
}
else {
return (depth - projection[3][2]) / projection[2][2];
}
}
bool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)
{
if (rayZFar > rayZNear)
{
float t = rayZFar; rayZFar = rayZNear; rayZNear = t;
}
float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));
return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;
}
bool traceScreenSpaceRay(
vec3 rayOrigin, vec3 rayDir, float jitter,
out vec2 hitPixel, out vec3 hitPoint, out float iterationCount
)
{
float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)
? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;
vec3 rayEnd = rayOrigin + rayDir * rayLength;
vec4 H0 = projection * vec4(rayOrigin, 1.0);
vec4 H1 = projection * vec4(rayEnd, 1.0);
float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;
vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;
vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;
vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;
P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;
vec2 delta = P1 - P0;
bool permute = false;
if (abs(delta.x) < abs(delta.y)) {
permute = true;
delta = delta.yx;
P0 = P0.yx;
P1 = P1.yx;
}
float stepDir = sign(delta.x);
float invdx = stepDir / delta.x;
vec3 dQ = (Q1 - Q0) * invdx;
float dk = (k1 - k0) * invdx;
vec2 dP = vec2(stepDir, delta.y * invdx);
float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);
float pixStride = 1.0 + strideScaler * pixelStride;
dP *= pixStride; dQ *= pixStride; dk *= pixStride;
vec4 pqk = vec4(P0, Q0.z, k0);
vec4 dPQK = vec4(dP, dQ.z, dk);
pqk += dPQK * jitter;
float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);
float rayZNear;
bool intersect = false;
vec2 texelSize = 1.0 / viewportSize;
iterationCount = 0.0;
for (int i = 0; i < MAX_ITERATION; i++)
{
pqk += dPQK;
rayZNear = rayZFar;
rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);
hitPixel = permute ? pqk.yx : pqk.xy;
hitPixel *= texelSize;
intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);
iterationCount += 1.0;
dPQK *= 1.2;
if (intersect) {
break;
}
}
Q0.xy += dQ.xy * iterationCount;
Q0.z = pqk.z;
hitPoint = Q0 / pqk.w;
return intersect;
}
float calculateAlpha(
float iterationCount, float reflectivity,
vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir
)
{
float alpha = clamp(reflectivity, 0.0, 1.0);
alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));
vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;
float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));
alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);
float _eyeFadeStart = eyeFadeStart;
float _eyeFadeEnd = eyeFadeEnd;
if (_eyeFadeStart > _eyeFadeEnd) {
float tmp = _eyeFadeEnd;
_eyeFadeEnd = _eyeFadeStart;
_eyeFadeStart = tmp;
}
float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);
alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);
alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);
return alpha;
}
@import clay.util.rand
@import clay.util.rgbm
void main()
{
vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);
if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {
discard;
}
float g = normalAndGloss.a;
#if !defined(PHYSICALLY_CORRECT)
if (g <= minGlossiness) {
discard;
}
#endif
float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);
vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);
N = normalize((toViewSpace * vec4(N, 0.0)).xyz);
vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);
vec4 pos = projectionInv * projectedPos;
vec3 rayOrigin = pos.xyz / pos.w;
vec3 V = -normalize(rayOrigin);
float ndv = clamp(dot(N, V), 0.0, 1.0);
float iterationCount;
float jitter = rand(fract(v_Texcoord + jitterOffset));
#ifdef PHYSICALLY_CORRECT
vec4 color = vec4(vec3(0.0), 1.0);
vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);
vec3 albedo = albedoMetalness.rgb;
float m = albedoMetalness.a;
vec3 diffuseColor = albedo * (1.0 - m);
vec3 spec = mix(vec3(0.04), albedo, m);
float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);
for (int i = 0; i < SAMPLE_PER_FRAME; i++) {
vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);
vec3 rayDir = normalize(reflect(-V, H));
#else
vec3 rayDir = normalize(reflect(-V, N));
#endif
vec2 hitPixel;
vec3 hitPoint;
bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);
float dist = distance(rayOrigin, hitPoint);
vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;
hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);
#ifdef PHYSICALLY_CORRECT
float ndl = clamp(dot(N, rayDir), 0.0, 1.0);
float vdh = clamp(dot(V, H), 0.0, 1.0);
float ndh = clamp(dot(N, H), 0.0, 1.0);
vec3 litTexel = vec3(0.0);
if (dot(hitNormal, rayDir) < 0.0 && intersect) {
litTexel = texture2D(sourceTexture, hitPixel).rgb;
litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);
}
else {
#ifdef SPECULARCUBEMAP_ENABLED
vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;
litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;
#endif
}
color.rgb += ndl * litTexel * (
F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)
);
}
color.rgb /= float(SAMPLE_PER_FRAME);
#else
#if !defined(SPECULARCUBEMAP_ENABLED)
if (dot(hitNormal, rayDir) >= 0.0) {
discard;
}
if (!intersect) {
discard;
}
#endif
float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);
vec4 color = texture2D(sourceTexture, hitPixel);
color.rgb *= alpha;
#ifdef SPECULARCUBEMAP_ENABLED
vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;
alpha = alpha * (intersect ? 1.0 : 0.0);
float bias = (1.0 -g) * 5.0;
color.rgb += (1.0 - alpha)
* RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb
* specularIntensity;
#endif
#endif
gl_FragColor = encodeHDR(color);
}
@end
@export ecgl.ssr.blur
uniform sampler2D texture;
uniform sampler2D gBufferTexture1;
uniform sampler2D gBufferTexture2;
uniform mat4 projection;
uniform float depthRange : 0.05;
varying vec2 v_Texcoord;
uniform vec2 textureSize;
uniform float blurSize : 1.0;
#ifdef BLEND
#ifdef SSAOTEX_ENABLED
uniform sampler2D ssaoTex;
#endif
uniform sampler2D sourceTexture;
#endif
float getLinearDepth(vec2 coord)
{
float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;
return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
}
@import clay.util.rgbm
void main()
{
@import clay.compositor.kernel.gaussian_9
vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);
float g = centerNTexel.a;
float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;
#ifdef VERTICAL
vec2 off = vec2(0.0, maxBlurSize / textureSize.y);
#else
vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);
#endif
vec2 coord = v_Texcoord;
vec4 sum = vec4(0.0);
float weightAll = 0.0;
vec3 cN = centerNTexel.rgb * 2.0 - 1.0;
float cD = getLinearDepth(v_Texcoord);
for (int i = 0; i < 9; i++) {
vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));
float w = gaussianKernel[i]
* clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);
float d = getLinearDepth(coord);
w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));
weightAll += w;
sum += decodeHDR(texture2D(texture, coord)) * w;
}
#ifdef BLEND
float aoFactor = 1.0;
#ifdef SSAOTEX_ENABLED
aoFactor = texture2D(ssaoTex, v_Texcoord).r;
#endif
gl_FragColor = encodeHDR(
sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))
);
#else
gl_FragColor = encodeHDR(sum / weightAll);
#endif
}
@end`;$.import(Q3);function bi(t){t=t||{},this._ssrPass=new Oe({fragment:$.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new Oe({fragment:$.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new Oe({fragment:$.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new Oe({fragment:$.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",t.normalTexture),this._ssrPass.setUniform("gBufferTexture2",t.depthTexture),this._blurPass1.setUniform("gBufferTexture1",t.normalTexture),this._blurPass1.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.setUniform("gBufferTexture1",t.normalTexture),this._blurPass2.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new At({type:W.HALF_FLOAT}),this._texture2=new At({type:W.HALF_FLOAT}),this._texture3=new At({type:W.HALF_FLOAT}),this._prevTexture=new At({type:W.HALF_FLOAT}),this._currentTexture=new At({type:W.HALF_FLOAT}),this._frameBuffer=new he({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}bi.prototype.setAmbientCubemap=function(t,e){this._ssrPass.material.set("specularCubemap",t),this._ssrPass.material.set("specularIntensity",e);var r=t&&e;this._ssrPass.material[r?"enableTexture":"disableTexture"]("specularCubemap")};bi.prototype.update=function(t,e,r,i){var n=t.getWidth(),a=t.getHeight(),o=this._ssrTexture,s=this._texture2,l=this._texture3;o.width=this._prevTexture.width=this._currentTexture.width=n/this._downScale,o.height=this._prevTexture.height=this._currentTexture.height=a/this._downScale,s.width=l.width=n,s.height=l.height=a;var u=this._frameBuffer,f=this._ssrPass,h=this._blurPass1,v=this._blurPass2,c=this._blendPass,d=new q,p=new q;q.transpose(d,e.worldTransform),q.transpose(p,e.viewMatrix),f.setUniform("sourceTexture",r),f.setUniform("projection",e.projectionMatrix.array),f.setUniform("projectionInv",e.invProjectionMatrix.array),f.setUniform("toViewSpace",d.array),f.setUniform("toWorldSpace",p.array),f.setUniform("nearZ",e.near);var g=i/this._totalSamples*this._samplePerFrame;if(f.setUniform("jitterOffset",g),f.setUniform("sampleOffset",i*this._samplePerFrame),h.setUniform("textureSize",[o.width,o.height]),v.setUniform("textureSize",[n,a]),v.setUniform("sourceTexture",r),h.setUniform("projection",e.projectionMatrix.array),v.setUniform("projection",e.projectionMatrix.array),u.attach(o),u.bind(t),f.render(t),this._physicallyCorrect&&(u.attach(this._currentTexture),c.setUniform("texture1",this._prevTexture),c.setUniform("texture2",o),c.material.set({weight1:i>=1?.95:0,weight2:i>=1?.05:1}),c.render(t)),u.attach(s),h.setUniform("texture",this._physicallyCorrect?this._currentTexture:o),h.render(t),u.attach(l),v.setUniform("texture",s),v.render(t),u.unbind(t),this._physicallyCorrect){var m=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=m}};bi.prototype.getTargetTexture=function(){return this._texture3};bi.prototype.setParameter=function(t,e){t==="maxIteration"?this._ssrPass.material.define("fragment","MAX_ITERATION",e):this._ssrPass.setUniform(t,e)};bi.prototype.setPhysicallyCorrect=function(t){t?(this._normalDistribution||(this._normalDistribution=ri.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=t};bi.prototype.setSSAOTexture=function(t){var e=this._blurPass2;t?(e.material.enableTexture("ssaoTex"),e.material.set("ssaoTex",t)):e.material.disableTexture("ssaoTex")};bi.prototype.isFinished=function(t){return this._physicallyCorrect?t>this._totalSamples/this._samplePerFrame:!0};bi.prototype.dispose=function(t){this._ssrTexture.dispose(t),this._texture2.dispose(t),this._texture3.dispose(t),this._prevTexture.dispose(t),this._currentTexture.dispose(t),this._frameBuffer.dispose(t)};const uy=[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],J3=`@export ecgl.normal.vertex
@import ecgl.common.transformUniforms
@import ecgl.common.uv.header
@import ecgl.common.attributes
varying vec3 v_Normal;
varying vec3 v_WorldPosition;
@import ecgl.common.normalMap.vertexHeader
@import ecgl.common.vertexAnimation.header
void main()
{
@import ecgl.common.vertexAnimation.main
@import ecgl.common.uv.main
v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);
v_WorldPosition = (world * vec4(pos, 1.0)).xyz;
@import ecgl.common.normalMap.vertexMain
gl_Position = worldViewProjection * vec4(pos, 1.0);
}
@end
@export ecgl.normal.fragment
#define ROUGHNESS_CHANEL 0
uniform bool useBumpMap;
uniform bool useRoughnessMap;
uniform bool doubleSide;
uniform float roughness;
@import ecgl.common.uv.fragmentHeader
varying vec3 v_Normal;
varying vec3 v_WorldPosition;
uniform mat4 viewInverse : VIEWINVERSE;
@import ecgl.common.normalMap.fragmentHeader
@import ecgl.common.bumpMap.header
uniform sampler2D roughnessMap;
void main()
{
vec3 N = v_Normal;
bool flipNormal = false;
if (doubleSide) {
vec3 eyePos = viewInverse[3].xyz;
vec3 V = normalize(eyePos - v_WorldPosition);
if (dot(N, V) < 0.0) {
flipNormal = true;
}
}
@import ecgl.common.normalMap.fragmentMain
if (useBumpMap) {
N = bumpNormal(v_WorldPosition, v_Normal, N);
}
float g = 1.0 - roughness;
if (useRoughnessMap) {
float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];
g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);
}
if (flipNormal) {
N = -N;
}
gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;
gl_FragColor.a = g;
}
@end`;$.import(J3);function Vc(t,e,r,i,n){var a=t.gl;e.setUniform(a,"1i",r,n),a.activeTexture(a.TEXTURE0+n),i.isRenderable()?i.bind(t):i.unbind(t)}function tB(t,e,r,i,n){var a,o,s,l,u=t.gl;return function(f,h,v){if(!(l&&l.material===f.material)){var c=f.material,d=f.__program,p=c.get("roughness");p==null&&(p=1);var g=c.get("normalMap")||e,m=c.get("roughnessMap"),_=c.get("bumpMap"),y=c.get("uvRepeat"),x=c.get("uvOffset"),S=c.get("detailUvRepeat"),T=c.get("detailUvOffset"),w=!!_&&c.isTextureEnabled("bumpMap"),b=!!m&&c.isTextureEnabled("roughnessMap"),A=c.isDefined("fragment","DOUBLE_SIDED");_=_||r,m=m||i,v!==h?(h.set("normalMap",g),h.set("bumpMap",_),h.set("roughnessMap",m),h.set("useBumpMap",w),h.set("useRoughnessMap",b),h.set("doubleSide",A),y!=null&&h.set("uvRepeat",y),x!=null&&h.set("uvOffset",x),S!=null&&h.set("detailUvRepeat",S),T!=null&&h.set("detailUvOffset",T),h.set("roughness",p)):(d.setUniform(u,"1f","roughness",p),a!==g&&Vc(t,d,"normalMap",g,0),o!==_&&_&&Vc(t,d,"bumpMap",_,1),s!==m&&m&&Vc(t,d,"roughnessMap",m,2),y!=null&&d.setUniform(u,"2f","uvRepeat",y),x!=null&&d.setUniform(u,"2f","uvOffset",x),S!=null&&d.setUniform(u,"2f","detailUvRepeat",S),T!=null&&d.setUniform(u,"2f","detailUvOffset",T),d.setUniform(u,"1i","useBumpMap",+w),d.setUniform(u,"1i","useRoughnessMap",+b),d.setUniform(u,"1i","doubleSide",+A)),a=g,o=_,s=m,l=f}}}function co(t){this._depthTex=new At({format:W.DEPTH_COMPONENT,type:W.UNSIGNED_INT}),this._normalTex=new At({type:W.HALF_FLOAT}),this._framebuffer=new he,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,he.DEPTH_ATTACHMENT),this._normalMaterial=new Si({shader:new $($.source("ecgl.normal.vertex"),$.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=ei.createBlank("#000"),this._defaultBumpMap=ei.createBlank("#000"),this._defaultRoughessMap=ei.createBlank("#000"),this._debugPass=new Oe({fragment:$.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}co.prototype.getDepthTexture=function(){return this._depthTex};co.prototype.getNormalTexture=function(){return this._normalTex};co.prototype.update=function(t,e,r){var i=t.getWidth(),n=t.getHeight(),a=this._depthTex,o=this._normalTex,s=this._normalMaterial;a.width=i,a.height=n,o.width=i,o.height=n;var l=e.getRenderList(r).opaque;this._framebuffer.bind(t),t.gl.clearColor(0,0,0,0),t.gl.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT),t.gl.disable(t.gl.BLEND),t.renderPass(l,r,{getMaterial:function(){return s},ifRender:function(u){return u.renderNormal},beforeRender:tB(t,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:t.opaqueSortCompare}),this._framebuffer.unbind(t)};co.prototype.renderDebug=function(t){this._debugPass.render(t)};co.prototype.dispose=function(t){this._depthTex.dispose(t),this._normalTex.dispose(t)};function Ks(t){t=t||{},this._edgePass=new Oe({fragment:$.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",t.normalTexture),this._edgePass.setUniform("depthTexture",t.depthTexture),this._targetTexture=new At({type:W.HALF_FLOAT}),this._frameBuffer=new he,this._frameBuffer.attach(this._targetTexture)}Ks.prototype.update=function(t,e,r,i){var n=t.getWidth(),a=t.getHeight(),o=this._targetTexture;o.width=n,o.height=a;var s=this._frameBuffer;s.bind(t),this._edgePass.setUniform("projectionInv",e.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[n,a]),this._edgePass.setUniform("texture",r),this._edgePass.render(t),s.unbind(t)};Ks.prototype.getTargetTexture=function(){return this._targetTexture};Ks.prototype.setParameter=function(t,e){this._edgePass.setUniform(t,e)};Ks.prototype.dispose=function(t){this._targetTexture.dispose(t),this._frameBuffer.dispose(t)};const eB={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"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]},rB=`@export ecgl.dof.coc
uniform sampler2D depth;
uniform float zNear: 0.1;
uniform float zFar: 2000;
uniform float focalDistance: 3;
uniform float focalRange: 1;
uniform float focalLength: 30;
uniform float fstop: 2.8;
varying vec2 v_Texcoord;
@import clay.util.encode_float
void main()
{
float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;
float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));
float aperture = focalLength / fstop;
float coc;
float uppper = focalDistance + focalRange;
float lower = focalDistance - focalRange;
if (dist <= uppper && dist >= lower) {
coc = 0.5;
}
else {
float focalAdjusted = dist > uppper ? uppper : lower;
coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));
coc = clamp(coc, 0.0, 2.0) / 2.00001;
if (dist < lower) {
coc = -coc;
}
coc = coc * 0.5 + 0.5;
}
gl_FragColor = encodeFloat(coc);
}
@end
@export ecgl.dof.composite
#define DEBUG 0
uniform sampler2D original;
uniform sampler2D blurred;
uniform sampler2D nearfield;
uniform sampler2D coc;
uniform sampler2D nearcoc;
varying vec2 v_Texcoord;
@import clay.util.rgbm
@import clay.util.float
void main()
{
vec4 blurredColor = texture2D(blurred, v_Texcoord);
vec4 originalColor = texture2D(original, v_Texcoord);
float fCoc = decodeFloat(texture2D(coc, v_Texcoord));
fCoc = abs(fCoc * 2.0 - 1.0);
float weight = smoothstep(0.0, 1.0, fCoc);
#ifdef NEARFIELD_ENABLED
vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);
float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));
fNearCoc = abs(fNearCoc * 2.0 - 1.0);
gl_FragColor = encodeHDR(
mix(
nearfieldColor, mix(originalColor, blurredColor, weight),
pow(1.0 - fNearCoc, 4.0)
)
);
#else
gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));
#endif
}
@end
@export ecgl.dof.diskBlur
#define POISSON_KERNEL_SIZE 16;
uniform sampler2D texture;
uniform sampler2D coc;
varying vec2 v_Texcoord;
uniform float blurRadius : 10.0;
uniform vec2 textureSize : [512.0, 512.0];
uniform vec2 poissonKernel[POISSON_KERNEL_SIZE];
uniform float percent;
float nrand(const in vec2 n) {
return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
@import clay.util.rgbm
@import clay.util.float
void main()
{
vec2 offset = blurRadius / textureSize;
float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );
float cosa = cos(rnd);
float sina = sin(rnd);
vec4 basis = vec4(cosa, -sina, sina, cosa);
#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)
offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);
#endif
#ifdef BLUR_COC
float cocSum = 0.0;
#else
vec4 color = vec4(0.0);
#endif
float weightSum = 0.0;
for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {
vec2 ofs = poissonKernel[i];
ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));
vec2 uv = v_Texcoord + ofs * offset;
vec4 texel = texture2D(texture, uv);
float w = 1.0;
#ifdef BLUR_COC
float fCoc = decodeFloat(texel) * 2.0 - 1.0;
cocSum += clamp(fCoc, -1.0, 0.0) * w;
#else
texel = texel;
#if !defined(BLUR_NEARFIELD)
float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;
w *= abs(fCoc);
#endif
texel.rgb *= texel.a;
color += texel * w;
#endif
weightSum += w;
}
#ifdef BLUR_COC
gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);
#else
color /= weightSum;
color.rgb /= (color.a + 0.0001);
gl_FragColor = color;
#endif
}
@end`,iB=`@export ecgl.edge
uniform sampler2D texture;
uniform sampler2D normalTexture;
uniform sampler2D depthTexture;
uniform mat4 projectionInv;
uniform vec2 textureSize;
uniform vec4 edgeColor: [0,0,0,0.8];
varying vec2 v_Texcoord;
vec3 packColor(vec2 coord) {
float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;
vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);
vec4 p4 = projectionInv * p;
return vec3(
texture2D(normalTexture, coord).rg,
-p4.z / p4.w / 5.0
);
}
void main() {
vec2 cc = v_Texcoord;
vec3 center = packColor(cc);
float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;
float dx = size / textureSize.x;
float dy = size / textureSize.y;
vec2 coord;
vec3 topLeft = packColor(cc+vec2(-dx, -dy));
vec3 top = packColor(cc+vec2(0.0, -dy));
vec3 topRight = packColor(cc+vec2(dx, -dy));
vec3 left = packColor(cc+vec2(-dx, 0.0));
vec3 right = packColor(cc+vec2(dx, 0.0));
vec3 bottomLeft = packColor(cc+vec2(-dx, dy));
vec3 bottom = packColor(cc+vec2(0.0, dy));
vec3 bottomRight = packColor(cc+vec2(dx, dy));
vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;
vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;
float edge = sqrt(dot(h, h) + dot(v, v));
edge = smoothstep(0.8, 1.0, edge);
gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);
}
@end`;$.import(Nw);$.import(Ow);$.import(Bw);$.import(Fw);$.import(kw);$.import(zw);$.import(Uw);$.import(Hw);$.import(Vw);$.import(rB);$.import(iB);function Xw(t,e){return{color:{parameters:{width:t,height:e}}}}var Zp=["composite","FXAA"];function _t(){this._width,this._height,this._dpr,this._sourceTexture=new At({type:W.HALF_FLOAT}),this._depthTexture=new At({format:W.DEPTH_COMPONENT,type:W.UNSIGNED_INT}),this._framebuffer=new he,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,he.DEPTH_ATTACHMENT),this._normalPass=new co,this._compositor=G3(eB);var t=this._compositor.getNodeByName("source");t.texture=this._sourceTexture;var e=this._compositor.getNodeByName("coc");this._sourceNode=t,this._cocNode=e,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(i){return this._compositor.getNodeByName(i)},this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=Zp.map(function(i){return this._compositor.getNodeByName(i)},this);var r={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new wi(r),this._ssrPass=new bi(r),this._edgePass=new Ks(r)}_t.prototype.resize=function(i,n,r){r=r||1;var i=i*r,n=n*r,a=this._sourceTexture,o=this._depthTexture;a.width=i,a.height=n,o.width=i,o.height=n;var s={getWidth:function(){return i},getHeight:function(){return n},getDevicePixelRatio:function(){return r}};function l(u,f){if(typeof u[f]=="function"){var h=u[f].__original||u[f];u[f]=function(v){return h.call(this,s)},u[f].__original=h}}this._compositor.nodes.forEach(function(u){for(var f in u.outputs){var h=u.outputs[f].parameters;h&&(l(h,"width"),l(h,"height"))}for(var v in u.parameters)l(u.parameters,v)}),this._width=i,this._height=n,this._dpr=r};_t.prototype.getWidth=function(){return this._width};_t.prototype.getHeight=function(){return this._height};_t.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR};_t.prototype._getPrevNode=function(t){for(var e=Zp.indexOf(t.name)-1,r=this._finalNodesChain[e];r&&!this._compositor.getNodeByName(r.name);)e-=1,r=this._finalNodesChain[e];return r};_t.prototype._getNextNode=function(t){for(var e=Zp.indexOf(t.name)+1,r=this._finalNodesChain[e];r&&!this._compositor.getNodeByName(r.name);)e+=1,r=this._finalNodesChain[e];return r};_t.prototype._addChainNode=function(t){var e=this._getPrevNode(t),r=this._getNextNode(t);e&&(t.inputs.texture=e.name,r?(t.outputs=Xw(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=t.name):t.outputs=null,this._compositor.addNode(t))};_t.prototype._removeChainNode=function(t){var e=this._getPrevNode(t),r=this._getNextNode(t);e&&(r?(e.outputs=Xw(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=e.name):e.outputs=null,this._compositor.removeNode(t))};_t.prototype.updateNormal=function(t,e,r,i){this._ifRenderNormalPass()&&this._normalPass.update(t,e,r)};_t.prototype.updateSSAO=function(t,e,r,i){this._ssaoPass.update(t,r,i)};_t.prototype.enableSSAO=function(){this._enableSSAO=!0};_t.prototype.disableSSAO=function(){this._enableSSAO=!1};_t.prototype.enableSSR=function(){this._enableSSR=!0};_t.prototype.disableSSR=function(){this._enableSSR=!1};_t.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()};_t.prototype.getSourceFrameBuffer=function(){return this._framebuffer};_t.prototype.getSourceTexture=function(){return this._sourceTexture};_t.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)};_t.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)};_t.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()};_t.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()};_t.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()};_t.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()};_t.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0};_t.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1};_t.prototype.enableEdge=function(){this._enableEdge=!0};_t.prototype.disableEdge=function(){this._enableEdge=!1};_t.prototype.setBloomIntensity=function(t){this._compositeNode.setParameter("bloomIntensity",t)};_t.prototype.setSSAOParameter=function(t,e){switch(t){case"quality":var r={low:6,medium:12,high:32,ultra:62}[e]||12;this._ssaoPass.setParameter("kernelSize",r);break;case"radius":this._ssaoPass.setParameter(t,e),this._ssaoPass.setParameter("bias",e/200);break;case"intensity":this._ssaoPass.setParameter(t,e);break}};_t.prototype.setDOFParameter=function(t,e){switch(t){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(t,e);break;case"blurRadius":for(var r=0;r<this._dofBlurNodes.length;r++)this._dofBlurNodes[r].setParameter("blurRadius",e);break;case"quality":var i={low:4,medium:8,high:16,ultra:32}[e]||8;this._dofBlurKernelSize=i;for(var r=0;r<this._dofBlurNodes.length;r++)this._dofBlurNodes[r].pass.material.define("POISSON_KERNEL_SIZE",i);this._dofBlurKernel=new Float32Array(i*2);break}};_t.prototype.setSSRParameter=function(t,e){if(e!=null)switch(t){case"quality":var r={low:10,medium:15,high:30,ultra:80}[e]||20,i={low:32,medium:16,high:8,ultra:4}[e]||16;this._ssrPass.setParameter("maxIteration",r),this._ssrPass.setParameter("pixelStride",i);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-e,1),0));break;case"physical":this.setPhysicallyCorrectSSR(e);break;default:console.warn("Unkown SSR parameter "+t)}};_t.prototype.setPhysicallyCorrectSSR=function(t){this._ssrPass.setPhysicallyCorrect(t)};_t.prototype.setEdgeColor=function(t){var e=U.parseColor(t);this._edgePass.setParameter("edgeColor",e)};_t.prototype.setExposure=function(t){this._compositeNode.setParameter("exposure",Math.pow(2,t))};_t.prototype.setColorLookupTexture=function(t,e){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?t:"none",e,{minFilter:U.Texture.NEAREST,magFilter:U.Texture.NEAREST,flipY:!1})};_t.prototype.setColorCorrection=function(t,e){this._compositeNode.setParameter(t,e)};_t.prototype.isSSREnabled=function(){return this._enableSSR};_t.prototype.composite=function(t,e,r,i,n){var a=this._sourceTexture,o=a;this._enableEdge&&(this._edgePass.update(t,r,a,n),a=o=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(t,r,a,n),o=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=o,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,l=this._dofBlurKernelSize,u=Math.floor(uy.length/2/l),f=n%u,h=0;h<l*2;h++)s[h]=uy[h+f*l*2];for(var h=0;h<this._dofBlurNodes.length;h++)this._dofBlurNodes[h].setParameter("percent",n/30),this._dofBlurNodes[h].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",r.near),this._cocNode.setParameter("zFar",r.far),this._compositor.render(t,i)};_t.prototype.dispose=function(t){this._sourceTexture.dispose(t),this._depthTexture.dispose(t),this._framebuffer.dispose(t),this._compositor.dispose(t),this._normalPass.dispose(t),this._ssaoPass.dispose(t)};function gd(t){for(var e=[],r=0;r<30;r++)e.push([ao(r,2),ao(r,3)]);this._haltonSequence=e,this._frame=0,this._sourceTex=new At,this._sourceFb=new he,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new At,this._outputTex=new At;var i=this._blendPass=new Oe({fragment:$.source("clay.compositor.blend")});i.material.disableTexturesAll(),i.material.enableTexture(["texture1","texture2"]),this._blendFb=new he({depthBuffer:!1}),this._outputPass=new Oe({fragment:$.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(n){n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA)}}gd.prototype={constructor:gd,jitterProjection:function(t,e){var r=t.viewport,i=r.devicePixelRatio||t.getDevicePixelRatio(),n=r.width*i,a=r.height*i,o=this._haltonSequence[this._frame%this._haltonSequence.length],s=new q;s.array[12]=(o[0]*2-1)/n,s.array[13]=(o[1]*2-1)/a,q.mul(e.projectionMatrix,s,e.projectionMatrix),q.invert(e.invProjectionMatrix,e.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(t,e){this._prevFrameTex.width=t,this._prevFrameTex.height=e,this._outputTex.width=t,this._outputTex.height=e,this._sourceTex.width=t,this._sourceTex.height=e,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(t,e,r){var i=this._blendPass;this._frame===0?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",e||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(t),i.render(t),this._blendFb.unbind(t),r||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(t));var n=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=n,this._frame++},dispose:function(t){this._sourceFb.dispose(t),this._blendFb.dispose(t),this._prevFrameTex.dispose(t),this._outputTex.dispose(t),this._sourceTex.dispose(t),this._outputPass.dispose(t),this._blendPass.dispose(t)}};function jt(t){t=t||"perspective",this.layer=null,this.scene=new ji,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(t),this._compositor=new _t,this._temporalSS=new gd,this._shadowMapPass=new qr;for(var e=[],r=0,i=0;i<30;i++){for(var n=[],a=0;a<6;a++)n.push(ao(r,2)*4-2),n.push(ao(r,3)*4-2),r++;e.push(n)}this._pcfKernels=e,this.scene.on("beforerender",function(o,s,l){this.needsTemporalSS()&&this._temporalSS.jitterProjection(o,l)},this)}jt.prototype.setProjection=function(t){var e=this.camera;e&&e.update(),t==="perspective"?this.camera instanceof ve||(this.camera=new ve,e&&this.camera.setLocalTransform(e.localTransform)):this.camera instanceof Os||(this.camera=new Os,e&&this.camera.setLocalTransform(e.localTransform)),this.camera.near=.1,this.camera.far=2e3};jt.prototype.setViewport=function(t,e,r,i,n){this.camera instanceof ve&&(this.camera.aspect=r/i),n=n||1,this.viewport.x=t,this.viewport.y=e,this.viewport.width=r,this.viewport.height=i,this.viewport.devicePixelRatio=n,this._compositor.resize(r*n,i*n),this._temporalSS.resize(r*n,i*n)};jt.prototype.containPoint=function(t,e){var r=this.viewport,i=this.layer.renderer.getHeight();return e=i-e,t>=r.x&&e>=r.y&&t<=r.x+r.width&&e<=r.y+r.height};var fy=new st;jt.prototype.castRay=function(t,e,r){var i=this.layer.renderer,n=i.viewport;return i.viewport=this.viewport,i.screenToNDC(t,e,fy),this.camera.castRay(fy,r),i.viewport=n,r};jt.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var t=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var e=0;e<t.transparent.length;e++){var r=t.transparent[e],i=r.geometry;i.needsSortVerticesProgressively&&i.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),i.needsSortTrianglesProgressively&&i.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()};jt.prototype.render=function(t,e){this._doRender(t,e,this._frame),this._frame++};jt.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively};jt.prototype.needsTemporalSS=function(){var t=this._enableTemporalSS;return t==="auto"&&(t=this._enablePostEffect),t};jt.prototype.hasDOF=function(){return this._enableDOF};jt.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30};jt.prototype._doRender=function(t,e,r){var i=this.scene,n=this.camera;r=r||0,this._updateTransparent(t,i,n,r),e||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(t,i,n,!0)),this._updateShadowPCFKernel(r);var a=t.clearColor;if(t.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,n),this._compositor.updateNormal(t,i,n,this._temporalSS.getFrame())),this._updateSSAO(t,i,n,this._temporalSS.getFrame()),this._enablePostEffect){var o=this._compositor.getSourceFrameBuffer();o.bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),t.render(i,n,!0,!0),o.unbind(t),this.needsTemporalSS()&&e?(this._compositor.composite(t,i,n,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),this._compositor.composite(t,i,n,null,0))}else if(this.needsTemporalSS()&&e){var o=this._temporalSS.getSourceFrameBuffer();o.bind(t),t.saveClear(),t.clearBit=t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT,t.render(i,n,!0,!0),t.restoreClear(),o.unbind(t),t.setViewport(this.viewport),this._temporalSS.render(t)}else t.setViewport(this.viewport),t.render(i,n,!0,!0)};jt.prototype._updateTransparent=function(t,e,r,i){for(var n=new B,a=new q,o=r.getWorldPosition(),s=e.getRenderList(r).transparent,l=0;l<s.length;l++){var u=s[l],f=u.geometry;q.invert(a,u.worldTransform),B.transformMat4(n,o,a),f.needsSortTriangles&&f.needsSortTriangles()&&f.doSortTriangles(n,i),f.needsSortVertices&&f.needsSortVertices()&&f.doSortVertices(n,i)}};jt.prototype._updateSSAO=function(t,e,r){var i=this._enableSSAO&&this._enablePostEffect;i&&this._compositor.updateSSAO(t,e,r,this._temporalSS.getFrame());for(var n=e.getRenderList(r),a=0;a<n.opaque.length;a++){var o=n.opaque[a];o.renderNormal&&o.material[i?"enableTexture":"disableTexture"]("ssaoMap"),i&&o.material.set("ssaoMap",this._compositor.getSSAOTexture())}};jt.prototype._updateShadowPCFKernel=function(t){for(var e=this._pcfKernels[t%this._pcfKernels.length],r=this.scene.getRenderList(this.camera),i=r.opaque,n=0;n<i.length;n++)i[n].receiveShadow&&(i[n].material.set("pcfKernel",e),i[n].material.define("fragment","PCF_KERNEL_SIZE",e.length/2))};jt.prototype.dispose=function(t){this._compositor.dispose(t.gl),this._temporalSS.dispose(t.gl),this._shadowMapPass.dispose(t)};jt.prototype.setPostEffect=function(t,e){var r=this._compositor;this._enablePostEffect=t.get("enable");var i=t.getModel("bloom"),n=t.getModel("edge"),a=t.getModel("DOF",t.getModel("depthOfField")),o=t.getModel("SSAO",t.getModel("screenSpaceAmbientOcclusion")),s=t.getModel("SSR",t.getModel("screenSpaceReflection")),l=t.getModel("FXAA"),u=t.getModel("colorCorrection");i.get("enable")?r.enableBloom():r.disableBloom(),a.get("enable")?r.enableDOF():r.disableDOF(),s.get("enable")?r.enableSSR():r.disableSSR(),u.get("enable")?r.enableColorCorrection():r.disableColorCorrection(),n.get("enable")?r.enableEdge():r.disableEdge(),l.get("enable")?r.enableFXAA():r.disableFXAA(),this._enableDOF=a.get("enable"),this._enableSSAO=o.get("enable"),this._enableSSAO?r.enableSSAO():r.disableSSAO(),r.setBloomIntensity(i.get("intensity")),r.setEdgeColor(n.get("color")),r.setColorLookupTexture(u.get("lookupTexture"),e),r.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach(function(f){r.setSSAOParameter(f,o.get(f))}),["quality","maxRoughness","physical"].forEach(function(f){r.setSSRParameter(f,s.get(f))}),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach(function(f){r.setDOFParameter(f,a.get(f))}),["brightness","contrast","saturation"].forEach(function(f){r.setColorCorrection(f,u.get(f))})};jt.prototype.setDOFFocusOnPoint=function(t){if(this._enablePostEffect)return t>this.camera.far||t<this.camera.near?void 0:(this._compositor.setDOFParameter("focalDistance",t),!0)};jt.prototype.setTemporalSuperSampling=function(t){this._enableTemporalSS=t.get("enable")};jt.prototype.isLinearSpace=function(){return this._enablePostEffect};jt.prototype.setRootNode=function(t){if(this.rootNode!==t){for(var e=this.rootNode.children(),r=0;r<e.length;r++)t.add(e[r]);t!==this.scene&&this.scene.add(t),this.rootNode=t}};jt.prototype.add=function(t){this.rootNode.add(t)};jt.prototype.remove=function(t){this.rootNode.remove(t)};jt.prototype.removeAll=function(t){this.rootNode.removeAll(t)};Object.assign(jt.prototype,zp);function nB(t,e){var r=t.getBoxLayoutParams(),i=Ki(r,{width:e.getWidth(),height:e.getHeight()});i.y=e.getHeight()-i.y-i.height,this.viewGL.setViewport(i.x,i.y,i.width,i.height,e.getDevicePixelRatio());var n=t.get("boxWidth"),a=t.get("boxHeight"),o=t.get("boxDepth");this.getAxis("x").setExtent(-n/2,n/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-a/2,a/2),this.size=[n,a,o]}function aB(t,e){var r={};function i(n,a){r[n]=r[n]||[1/0,-1/0],r[n][0]=Math.min(a[0],r[n][0]),r[n][1]=Math.max(a[1],r[n][1])}t.eachSeries(function(n){if(n.coordinateSystem===this){var a=n.getData();["x","y","z"].forEach(function(o){a.mapDimensionsAll(o,!0).forEach(function(s){i(o,a.getDataExtent(s,!0))})})}},this),["xAxis3D","yAxis3D","zAxis3D"].forEach(function(n){t.eachComponent(n,function(a){var o=n.charAt(0),s=a.getReferringComponents("grid3D").models[0],l=s.coordinateSystem;if(l===this){var u=l.getAxis(o);if(!u){var f=dP(r[o]||[1/0,-1/0],a);u=new ef(o,f),u.type=a.get("type");var h=u.type==="category";u.onBand=h&&a.get("boundaryGap"),u.inverse=a.get("inverse"),a.axis=u,u.model=a,u.getLabelModel=function(){return a.getModel("axisLabel",s.getModel("axisLabel"))},u.getTickModel=function(){return a.getModel("axisTick",s.getModel("axisTick"))},l.addAxis(u)}}},this)},this),this.resize(this.model,e)}var oB={dimensions:Bs.prototype.dimensions,create:function(t,e){var r=[];t.eachComponent("grid3D",function(a){a.__viewGL=a.__viewGL||new jt;var o=new Bs;o.model=a,o.viewGL=a.__viewGL,a.coordinateSystem=o,r.push(o),o.resize=nB,o.update=aB});var i=["xAxis3D","yAxis3D","zAxis3D"];function n(a,o){return i.map(function(s){var l=a.getReferringComponents(s).models[0];return l==null&&(l=o.getComponent(s)),l})}return t.eachSeries(function(a){if(a.get("coordinateSystem")==="cartesian3D"){var o=a.getReferringComponents("grid3D").models[0];if(o==null){var s=n(a,t),o=s[0].getCoordSysModel();s.forEach(function(f){f.getCoordSysModel()})}var l=o.coordinateSystem;a.coordinateSystem=l}}),r}},Yw=Rt.extend({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});pP(Yw);var Zw={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},sB=dt({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},Zw),qp=dt({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},Zw),lB=Et({scale:!0,min:"dataMin",max:"dataMax"},qp),qw=Et({logBase:10},qp);qw.scale=!0;const uB={categoryAxis3D:sB,valueAxis3D:qp,timeAxis3D:lB,logAxis3D:qw};var fB=["value","category","time","log"];function hB(t,e,r,i,n){fB.forEach(function(a){var o=r.extend({type:e+"Axis3D."+a,__ordinalMeta:null,mergeDefaultAndTheme:function(s,l){var u=l.getTheme();dt(s,u.get(a+"Axis3D")),dt(s,this.getDefaultOption()),s.type=i(e,s)},optionUpdated:function(){var s=this.option;s.type==="category"&&(this.__ordinalMeta=$u.createByAxisModel(this))},getCategories:function(){if(this.option.type==="category")return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:dt(ut(uB[a+"Axis3D"]),n||{},!0)});t.registerComponentModel(o)}),t.registerSubTypeDefaulter(e+"Axis3D",le(i,e))}function cB(t,e){return e.type||(e.data?"category":"value")}function vB(t){t.registerComponentModel(Yf),t.registerComponentView(D3),t.registerCoordinateSystem("grid3D",oB),["x","y","z"].forEach(function(e){hB(t,e,Yw,cB,{name:e.toUpperCase()});const r=t.ComponentView.extend({type:e+"Axis3D"});t.registerComponentView(r)}),t.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},function(e,r){r.eachComponent({mainType:"grid3D",query:e},function(i){i.setView(e)})}),t.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},function(e,r){}),t.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},function(e,r){})}const dB={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}};function Gc(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function $w(t,e,r,i,n){var a=r,o=t[e];Gc(t,e,i);for(var s=r;s<i;s++)n(t[s],o)<0&&(Gc(t,s,a),a++);return Gc(t,i,a),a}function nf(t,e,r,i){if(r<i){var n=Math.floor((r+i)/2),a=$w(t,n,r,i,e);nf(t,e,r,a-1),nf(t,e,a+1,i)}}function af(){this._parts=[]}af.prototype.step=function(t,e,r){var i=t.length;if(r===0){this._parts=[],this._sorted=!1;var n=Math.floor(i/2);this._parts.push({pivot:n,left:0,right:i-1}),this._currentSortPartIdx=0}if(!this._sorted){var a=this._parts;if(a.length===0)return this._sorted=!0,!0;if(a.length<512){for(var o=0;o<a.length;o++)a[o].pivot=$w(t,a[o].pivot,a[o].left,a[o].right,e);for(var s=[],o=0;o<a.length;o++){var l=a[o].left,u=a[o].pivot-1;u>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u});var l=a[o].pivot+1,u=a[o].right;u>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u})}a=this._parts=s}else for(var o=0;o<Math.floor(a.length/10);o++){var f=a.length-1-this._currentSortPartIdx;if(nf(t,e,a[f].left,a[f].right),this._currentSortPartIdx++,this._currentSortPartIdx===a.length)return this._sorted=!0,!0}return!1}};af.sort=nf;var Ka=Zf.vec3,hy=Ka.create(),cy=Ka.create(),vy=Ka.create();const pB={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(t,e){var r=this.indices;if(e===0){var i=this.attributes.position,t=t.array;(!this._triangleZList||this._triangleZList.length!==this.triangleCount)&&(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new r.constructor(r.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var n=0,a,o=0;o<r.length;){i.get(r[o++],hy),i.get(r[o++],cy),i.get(r[o++],vy);var s=Ka.sqrDist(hy,t),l=Ka.sqrDist(cy,t),u=Ka.sqrDist(vy,t),f=Math.min(s,l);f=Math.min(f,u),o===3?(a=f,f=0):f=f-a,this._triangleZList[n++]=f}}for(var h=this._sortedTriangleIndices,o=0;o<h.length;o++)h[o]=o;if(this.triangleCount<2e4)e===0&&this._simpleSort(!0);else for(var o=0;o<3;o++)this._progressiveQuickSort(e*3+o);for(var v=this._indicesTmp,c=this._triangleZListTmp,d=this._triangleZList,o=0;o<this.triangleCount;o++){var p=h[o]*3,g=o*3;v[g++]=r[p++],v[g++]=r[p++],v[g]=r[p],c[o]=d[h[o]]}var m=this._indicesTmp;this._indicesTmp=this.indices,this.indices=m;var m=this._triangleZListTmp;this._triangleZListTmp=this._triangleZList,this._triangleZList=m,this.dirtyIndices()},_simpleSort:function(t){var e=this._triangleZList,r=this._sortedTriangleIndices;function i(n,a){return e[a]-e[n]}t?Array.prototype.sort.call(r,i):af.sort(r,i,0,r.length-1)},_progressiveQuickSort:function(t){var e=this._triangleZList,r=this._sortedTriangleIndices;this._quickSort=this._quickSort||new af,this._quickSort.step(r,function(i,n){return e[n]-e[i]},t)}};function md(t,e){const r=t.getItemVisual(e,"style");if(r){const i=t.getVisual("drawType");return r[i]}}function dy(t,e){const r=t.getItemVisual(e,"style");return r&&r.opacity}function gB(t,e){var r=[];return C(t.dimensions,function(i){var n=t.getDimensionInfo(i),a=n.otherDims,o=a[e];o!=null&&o!==!1&&(r[o]=n.name)}),r}function mB(t,e,r){function i(h){var v=[],c=gB(n,"tooltip");c.length?C(c,function(p){d(n.get(p,e),p)}):C(h,d);function d(p,g){var m=n.getDimensionInfo(g);if(!(!m||m.otherDims.tooltip===!1)){var _=m.type,y="- "+(m.tooltipName||m.name)+": "+(_==="ordinal"?p+"":_==="time"?r?"":AC("yyyy/MM/dd hh:mm:ss",p):Uu(p));y&&v.push(_e(y))}}return"<br/>"+v.join("<br/>")}var n=t.getData(),a=t.getRawValue(e),o=j(a)?i(a):_e(Uu(a)),s=n.getName(e),l=md(n,e);rt(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=lT(l),f=t.name;return f==="\0-"&&(f=""),f=f?_e(f)+(r?": ":"<br/>"):"",r?u+f+o:f+u+(s?_e(s)+": "+o:o)}function _B(t,e,r){r=r||t.getSource();var i=e||sR(t.get("coordinateSystem"))||["x","y","z"],n=SR(r,{dimensionsDefine:r.dimensionsDefine||t.get("dimensions"),encodeDefine:r.encodeDefine||t.get("encode"),coordDimensions:i.map(function(s){var l=t.getReferringComponents(s+"Axis3D").models[0];return{type:l&&l.get("type")==="category"?"ordinal":"float",name:s}})});t.get("coordinateSystem")==="cartesian3D"&&n.forEach(function(s){if(i.indexOf(s.coordDim)>=0){var l=t.getReferringComponents(s.coordDim+"Axis3D").models[0];l&&l.get("type")==="category"&&(s.ordinalMeta=l.getOrdinalMeta())}});var a=vP.enableDataStack(t,n,{byIndex:!0,stackedCoordDimension:"z"}),o=new wS(n,t);return o.setCalculationInfo(a),o.initData(r),o}var Kw=yi.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(t){return mB(this,t)},getInitialData:function(t,e){var r=t.data;function i(V){return!(isNaN(V.min)||isNaN(V.max)||isNaN(V.step))}function n(V){var O=zd;return Math.max(O(V.min),O(V.max),O(V.step))+1}if(!r)if(t.parametric){var x=t.parametricEquation||{},S=x.u||{},T=x.v||{};["u","v"].forEach(function(O){i(x[O])}),["x","y","z"].forEach(function(O){x[O]});var w=Math.floor((S.max+S.step-S.min)/S.step),b=Math.floor((T.max+T.step-T.min)/T.step);r=new Float32Array(w*b*5);for(var A=n(S),M=n(T),v=0,c=0;c<b;c++)for(var d=0;d<w;d++){var E=d*S.step+S.min,D=c*T.step+T.min,R=Jt(Math.min(E,S.max),A),P=Jt(Math.min(D,T.max),M),p=x.x(R,P),g=x.y(R,P),y=x.z(R,P);r[v++]=p,r[v++]=g,r[v++]=y,r[v++]=R,r[v++]=P}}else{var a=t.equation||{},o=a.x||{},s=a.y||{};if(["x","y"].forEach(function(V){i(a[V])}),typeof a.z!="function")return;var l=Math.floor((o.max+o.step-o.min)/o.step),u=Math.floor((s.max+s.step-s.min)/s.step);r=new Float32Array(l*u*3);for(var f=n(o),h=n(s),v=0,c=0;c<u;c++)for(var d=0;d<l;d++){var p=d*o.step+o.min,g=c*s.step+s.min,m=Jt(Math.min(p,o.max),f),_=Jt(Math.min(g,s.max),h),y=a.z(m,_);r[v++]=m,r[v++]=_,r[v++]=y}}var I=["x","y","z"];t.parametric&&I.push("u","v");var N=_B(this,I,r);return N},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},dataShape:null,itemStyle:{},animationDurationUpdate:500}});dt(Kw.prototype,dB);var Dn=Zf.vec3;function yB(t){return isNaN(t[0])||isNaN(t[1])||isNaN(t[2])}const xB=Nr.extend({type:"surface",__ecgl__:!0,init:function(t,e){this.groupGL=new U.Node},render:function(t,e,r){var i=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=i,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var n=t.coordinateSystem,a=t.get("shading"),o=t.getData(),s="ecgl."+a;if((!this._surfaceMesh.material||this._surfaceMesh.material.shader.name!==s)&&(this._surfaceMesh.material=U.createMaterial(s,["VERTEX_COLOR","DOUBLE_SIDED"])),U.setMaterialFromModel(a,this._surfaceMesh.material,t,r),n&&n.viewGL){n.viewGL.add(this.groupGL);var l=n.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[l]("fragment","SRGB_DECODE")}var u=t.get("parametric"),f=t.get("dataShape");f||(f=this._getDataShape(o,u));var h=t.getModel("wireframe"),v=h.get("lineStyle.width"),c=h.get("show")&&v>0;this._updateSurfaceMesh(this._surfaceMesh,t,f,c);var d=this._surfaceMesh.material;c?(d.define("WIREFRAME_QUAD"),d.set("wireframeLineWidth",v),d.set("wireframeLineColor",U.parseColor(h.get("lineStyle.color")))):d.undefine("WIREFRAME_QUAD"),this._initHandler(t,r),this._updateAnimation(t)},_updateAnimation:function(t){U.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,t)},_createSurfaceMesh:function(){var t=new U.Mesh({geometry:new U.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new U.Material({shader:new U.Shader(U.Shader.source("ecgl.sm.depth.vertex"),U.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return t.geometry.createAttribute("barycentric","float",4),t.geometry.createAttribute("prevPosition","float",3),t.geometry.createAttribute("prevNormal","float",3),Object.assign(t.geometry,pB),t},_initHandler:function(t,e){var r=t.getData(),i=this._surfaceMesh,n=t.coordinateSystem;function a(s,l){for(var u=1/0,f=-1,h=[],v=0;v<s.length;v++){i.geometry.attributes.position.get(s[v],h);var c=Dn.dist(l.array,h);c<u&&(u=c,f=s[v])}return f}i.seriesIndex=t.seriesIndex;var o=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",function(s){var l=a(s.triangle,s.point);if(l>=0){var u=[];i.geometry.attributes.position.get(l,u);for(var f=n.pointToData(u),h=1/0,v=-1,c=[],d=0;d<r.count();d++){c[0]=r.get("x",d),c[1]=r.get("y",d),c[2]=r.get("z",d);var p=Dn.squaredDistance(c,f);p<h&&(v=d,h=p)}v!==o&&e.dispatchAction({type:"grid3DShowAxisPointer",value:f}),o=v,i.dataIndex=v}else i.dataIndex=-1},this),i.on("mouseout",function(s){o=-1,i.dataIndex=-1,e.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_updateSurfaceMesh:function(t,e,r,i){var n=t.geometry,a=e.getData(),o=a.getLayout("points"),s=0;a.each(function(re){a.hasValue(re)||s++});var l=s||i,u=n.attributes.position,f=n.attributes.normal,h=n.attributes.texcoord0,v=n.attributes.barycentric,c=n.attributes.color,d=r[0],p=r[1],g=e.get("shading"),m=g!=="color";if(l){var _=(d-1)*(p-1)*4;u.init(_),i&&v.init(_)}else u.value=new Float32Array(o);c.init(n.vertexCount),h.init(n.vertexCount);var y=[0,3,1,1,3,2],x=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],S=n.indices=new(n.vertexCount>65535?Uint32Array:Uint16Array)((d-1)*(p-1)*6),T=function(re,Vt,Ce){Ce[1]=re*p+Vt,Ce[0]=re*p+Vt+1,Ce[3]=(re+1)*p+Vt+1,Ce[2]=(re+1)*p+Vt},w=!1;if(l){var b=[],A=[],M=0;m?f.init(n.vertexCount):f.value=null;for(var E=[[],[],[]],D=[],R=[],P=Dn.create(),I=function(re,Vt,Ce){var br=Vt*3;return Ce[0]=re[br],Ce[1]=re[br+1],Ce[2]=re[br+2],Ce},N=new Float32Array(o.length),V=new Float32Array(o.length/3*4),O=0;O<a.count();O++)if(a.hasValue(O)){var wt=U.parseColor(md(a,O)),X=dy(a,O);X!=null&&(wt[3]*=X),wt[3]<.99&&(w=!0);for(var G=0;G<4;G++)V[O*4+G]=wt[G]}for(var lt=[1e7,1e7,1e7],O=0;O<d-1;O++)for(var J=0;J<p-1;J++){var ot=O*(p-1)+J,at=ot*4;T(O,J,b);for(var Dt=!1,G=0;G<4;G++)I(o,b[G],A),yB(A)&&(Dt=!0);for(var G=0;G<4;G++)Dt?u.set(at+G,lt):(I(o,b[G],A),u.set(at+G,A)),i&&v.set(at+G,x[G]);for(var G=0;G<6;G++)S[M++]=y[G]+at;if(m&&!Dt)for(var G=0;G<2;G++){for(var pt=G*3,Ot=0;Ot<3;Ot++){var Ht=b[y[pt]+Ot];I(o,Ht,E[Ot])}Dn.sub(D,E[0],E[1]),Dn.sub(R,E[1],E[2]),Dn.cross(P,D,R);for(var Ot=0;Ot<3;Ot++){var Nt=b[y[pt]+Ot]*3;N[Nt]=N[Nt]+P[0],N[Nt+1]=N[Nt+1]+P[1],N[Nt+2]=N[Nt+2]+P[2]}}}if(m)for(var O=0;O<N.length/3;O++)I(N,O,P),Dn.normalize(P,P),N[O*3]=P[0],N[O*3+1]=P[1],N[O*3+2]=P[2];for(var wt=[],et=[],O=0;O<d-1;O++)for(var J=0;J<p-1;J++){var ot=O*(p-1)+J,at=ot*4;T(O,J,b);for(var G=0;G<4;G++){for(var Ot=0;Ot<4;Ot++)wt[Ot]=V[b[G]*4+Ot];c.set(at+G,wt),m&&(I(N,b[G],P),f.set(at+G,P));var Ht=b[G];et[0]=Ht%p/(p-1),et[1]=Math.floor(Ht/p)/(d-1),h.set(at+G,et)}ot++}}else{for(var et=[],O=0;O<a.count();O++){et[0]=O%p/(p-1),et[1]=Math.floor(O/p)/(d-1);var wt=U.parseColor(md(a,O)),X=dy(a,O);X!=null&&(wt[3]*=X),wt[3]<.99&&(w=!0),c.set(O,wt),h.set(O,et)}for(var b=[],xt=0,O=0;O<d-1;O++)for(var J=0;J<p-1;J++){T(O,J,b);for(var G=0;G<6;G++)S[xt++]=b[y[G]]}m?n.generateVertexNormals():f.value=null}t.material.get("normalMap")&&n.generateTangents(),n.updateBoundingBox(),n.dirty(),t.material.transparent=w,t.material.depthMask=!w},_getDataShape:function(t,e){for(var r=-1/0,i=0,n=0,a=!1,o=e?"u":"x",s=t.count(),l=0;l<s;l++){var u=t.get(o,l);u<r&&(n=0,i++),r=u,n++}if((!i||n===1)&&(a=!0),!a)return[i+1,n];for(var f=Math.floor(Math.sqrt(s));f>0;){if(Math.floor(s/f)===s/f)return[f,s/f];f--}return f=Math.floor(Math.sqrt(s)),[f,f]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function TB(t){t.registerChartView(xB),t.registerSeriesModel(Kw),t.registerLayout(function(e,r){e.eachSeriesByType("surface",function(i){var n=i.coordinateSystem;!n||n.type;var a=i.getData(),o=new Float32Array(3*a.count()),s=[NaN,NaN,NaN];if(n&&n.type==="cartesian3D"){var l=n.dimensions,u=l.map(function(f){return i.coordDimToDataDim(f)[0]});a.each(u,function(f,h,v,c){var d;a.hasValue(c)?d=n.dataToPoint([f,h,v]):d=s,o[c*3]=d[0],o[c*3+1]=d[1],o[c*3+2]=d[2]})}a.setLayout("points",o)})})}var In=Yt(),py=ut,Wc=nt,SB=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,i,n){var a=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,r,i);var f=u.graphicKey;f!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=f;var h=this._moveAnimation=this.determineAnimation(e,r);if(!s)s=this._group=new ee,this.createPointerEl(s,u,e,r),this.createLabelEl(s,u,e,r),i.getZr().add(s);else{var v=le(gy,r,h);this.updatePointerEl(s,u,v),this.updateLabelEl(s,u,v,r)}_y(s,r,!0),this._renderHandle(a)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var i=r.get("animation"),n=e.axis,a=n.type==="category",o=r.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=Fp(e).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},t.prototype.makeElOption=function(e,r,i,n,a){},t.prototype.createPointerEl=function(e,r,i,n){var a=r.pointer;if(a){var o=In(e).pointerEl=new rC[a.type](py(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,i,n){if(r.label){var a=In(e).labelEl=new Xt(py(r.label));e.add(a),my(a,n)}},t.prototype.updatePointerEl=function(e,r,i){var n=In(e).pointerEl;n&&r.pointer&&(n.setStyle(r.pointer.style),i(n,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,i,n){var a=In(e).labelEl;a&&(a.setStyle(r.label.style),i(a,{x:r.label.x,y:r.label.y}),my(a,n))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=np(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){gi(u.event)},onmousedown:Wc(this._onHandleDragMove,this,0,0),drift:Wc(this._onHandleDragMove,this),ondragend:Wc(this._onHandleDragEnd,this)}),i.add(n)),_y(n,r,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");j(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,zf(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){gy(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Xc(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(Xc(i),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(Xc(n)),In(i).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),i=this._group,n=this._handle;r&&i&&(this._lastGraphicKey=null,i&&r.remove(i),n&&r.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),Vu(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,i){return i=i||0,{x:e[i],y:e[1-i],width:r[i],height:r[1-i]}},t}();function gy(t,e,r,i){jw(In(r).lastProp,i)||(In(r).lastProp=i,e?Sr(r,i,t):(r.stopAnimation(),r.attr(i)))}function jw(t,e){if(rt(t)&&rt(e)){var r=!0;return C(e,function(i,n){r=r&&jw(t[n],i)}),!!r}else return t===e}function my(t,e){t[e.get(["label","show"])?"show":"hide"]()}function Xc(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function _y(t,e,r){var i=e.get("z"),n=e.get("zlevel");t&&t.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=r)})}function wB(t){var e=t.get("type"),r=t.getModel(e+"Style"),i;return e==="line"?(i=r.getLineStyle(),i.fill=null):e==="shadow"&&(i=r.getAreaStyle(),i.stroke=null),i}function bB(t,e,r,i,n){var a=r.get("value"),o=Qw(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=Ys(s.get("padding")||0),u=s.getFont(),f=kd(o,u),h=n.position,v=f.width+l[1]+l[3],c=f.height+l[0]+l[2],d=n.align;d==="right"&&(h[0]-=v),d==="center"&&(h[0]-=v/2);var p=n.verticalAlign;p==="bottom"&&(h[1]-=c),p==="middle"&&(h[1]-=c/2),AB(h,v,c,i);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:qe(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function AB(t,e,r,i){var n=i.getWidth(),a=i.getHeight();t[0]=Math.min(t[0]+e,n)-e,t[1]=Math.min(t[1]+r,a)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Qw(t,e,r,i,n){t=e.scale.parse(t);var a=e.scale.getLabel({value:t},{precision:n.precision}),o=n.formatter;if(o){var s={value:Lp(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};C(i,function(l){var u=r.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,h=u&&u.getDataParams(f);h&&s.seriesData.push(h)}),Q(o)?a=o.replace("{value}",a):ct(o)&&(a=o(s))}return a}function Jw(t,e,r){var i=Va();return Od(i,i,r.rotation),fv(i,i,r.position),Wi([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],i)}function EB(t,e,r,i,n,a){var o=Yi.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=n.get(["label","margin"]),bB(e,i,n,a,{position:Jw(i.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function MB(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function CB(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}var DB=function(t){K(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),f=yy(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var v=wB(a),c=LB[u](s,h,f);c.style=v,r.graphicKey=c.type,r.pointer=c}var d=ed(l.model,n);EB(i,r,d,n,a,o)},e.prototype.getHandleTransform=function(r,i,n){var a=ed(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=Jw(i.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=yy(s,o).getOtherAxis(o).getGlobalExtent(),f=o.dim==="x"?0:1,h=[r.x,r.y];h[f]+=i[f],h[f]=Math.min(l[1],h[f]),h[f]=Math.max(l[0],h[f]);var v=(u[1]+u[0])/2,c=[v,v];c[f]=h[f];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:c,tooltipOption:d[f]}},e}(SB);function yy(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var LB={line:function(t,e,r){var i=MB([e,r[0]],[e,r[1]],xy(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r){var i=Math.max(1,t.getBandWidth()),n=r[1]-r[0];return{type:"Rect",shape:CB([e-i/2,r[0]],[i,n],xy(t))}}};function xy(t){return t.dim==="x"?0:1}var RB=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},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}},e}(Rt),di=Yt(),PB=C;function t2(t,e,r){if(!vt.node){var i=e.getZr();di(i).records||(di(i).records={}),IB(i,e);var n=di(i).records[t]||(di(i).records[t]={});n.handler=r}}function IB(t,e){if(di(t).initialized)return;di(t).initialized=!0,r("click",le(Ty,"click")),r("mousemove",le(Ty,"mousemove")),r("globalout",OB);function r(i,n){t.on(i,function(a){var o=BB(e);PB(di(t).records,function(s){s&&n(s,a,o.dispatchAction)}),NB(o.pendings,e)})}}function NB(t,e){var r=t.showTip.length,i=t.hideTip.length,n;r?n=t.showTip[r-1]:i&&(n=t.hideTip[i-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function OB(t,e,r){t.handler("leave",null,r)}function Ty(t,e,r,i){e.handler(t,r,i)}function BB(t){var e={showTip:[],hideTip:[]},r=function(i){var n=e[i.type];n?n.push(i):(i.dispatchAction=r,t.dispatchAction(i))};return{dispatchAction:r,pendings:e}}function _d(t,e){if(!vt.node){var r=e.getZr(),i=(di(r).records||{})[t];i&&(di(r).records[t]=null)}}var FB=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,i,n){var a=i.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";t2("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,i){_d("axisPointer",i)},e.prototype.dispose=function(r,i){_d("axisPointer",i)},e.type="axisPointer",e}(ze);function e2(t,e){var r=[],i=t.seriesIndex,n;if(i==null||!(n=e.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=qn(a,t);if(o==null||o<0||j(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),f=l.getOtherAxis(u),h=f.dim,v=u.dim,c=h==="x"||h==="radius"?1:0,d=a.mapDimension(v),p=[];p[c]=a.get(d,o),p[1-c]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(p)||[]}else r=l.dataToPoint(a.getValues(tt(l.dimensions,function(m){return a.mapDimension(m)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var Sy=Yt();function kB(t,e,r){var i=t.currTrigger,n=[t.x,t.y],a=t,o=t.dispatchAction||nt(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){gu(n)&&(n=e2({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=gu(n),u=a.axesInfo,f=s.axesInfo,h=i==="leave"||gu(n),v={},c={},d={list:[],map:{}},p={showPointer:le(UB,c),showTooltip:le(HB,d)};C(s.coordSysMap,function(m,_){var y=l||m.containPoint(n);C(s.coordSysAxesInfo[_],function(x,S){var T=x.axis,w=XB(u,x);if(!h&&y&&(!u||w)){var b=w&&w.value;b==null&&!l&&(b=T.pointToData(n)),b!=null&&wy(x,b,p,!1,v)}})});var g={};return C(f,function(m,_){var y=m.linkGroup;y&&!c[_]&&C(y.axesInfo,function(x,S){var T=c[S];if(x!==m&&T){var w=T.value;y.mapper&&(w=m.axis.scale.parse(y.mapper(w,by(x),by(m)))),g[m.key]=w}})}),C(g,function(m,_){wy(f[_],m,p,!0,v)}),VB(c,f,v),GB(d,n,t,o),WB(f,o,r),v}}function wy(t,e,r,i,n){var a=t.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var o=zB(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&Y(n,s[0]),!i&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function zB(t,e){var r=e.axis,i=r.dim,n=t,a=[],o=Number.MAX_VALUE,s=-1;return C(e.seriesModels,function(l,u){var f=l.getData().mapDimensionsAll(i),h,v;if(l.getAxisTooltipData){var c=l.getAxisTooltipData(f,t,r);v=c.dataIndices,h=c.nestestValue}else{if(v=l.getData().indicesOfNearest(f[0],t,r.type==="category"?.5:null),!v.length)return;h=l.getData().get(f[0],v[0])}if(!(h==null||!isFinite(h))){var d=t-h,p=Math.abs(d);p<=o&&((p<o||d>=0&&s<0)&&(o=p,s=d,n=h,a.length=0),C(v,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:n}}function UB(t,e,r,i){t[e.key]={value:r,payloadBatch:i}}function HB(t,e,r,i){var n=r.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!n.length)){var l=e.coordSys.model,u=Rs(l),f=t.map[u];f||(f=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(f)),f.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function VB(t,e,r){var i=r.axesInfo=[];C(e,function(n,a){var o=n.axisPointerModel.option,s=t[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function GB(t,e,r,i){if(gu(e)||!t.list.length){i({type:"hideTip"});return}var n=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:t.list})}function WB(t,e,r){var i=r.getZr(),n="axisPointerLastHighlights",a=Sy(i)[n]||{},o=Sy(i)[n]={};C(t,function(u,f){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&C(h.seriesDataIndices,function(v){var c=v.seriesIndex+" | "+v.dataIndex;o[c]=v})});var s=[],l=[];C(a,function(u,f){!o[f]&&l.push(u)}),C(o,function(u,f){!a[f]&&s.push(u)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function XB(t,e){for(var r=0;r<(t||[]).length;r++){var i=t[r];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function by(t){var e=t.axis.model,r={},i=r.axisDim=t.axis.dim;return r.axisIndex=r[i+"AxisIndex"]=e.componentIndex,r.axisName=r[i+"AxisName"]=e.name,r.axisId=r[i+"AxisId"]=e.id,r}function gu(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function r2(t){nw.registerAxisPointerClass("CartesianAxisPointer",DB),t.registerComponentModel(RB),t.registerComponentView(FB),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!j(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=YI(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},kB)}function YB(t){Qe(oN),Qe(r2)}function ZB(t,e){var r=t.existing;if(e.id=t.keyInfo.id,!e.type&&r&&(e.type=r.type),e.parentId==null){var i=e.parentOption;i?e.parentId=i.id:r&&(e.parentId=r.parentId)}e.parentOption=null}function Ay(t,e){var r;return C(e,function(i){t[i]!=null&&t[i]!=="auto"&&(r=!0)}),r}function qB(t,e,r){var i=Y({},r),n=t[e],a=r.$action||"merge";a==="merge"?n?(dt(n,i,!0),Kn(n,i,{ignoreSize:!0}),hT(r,n),$l(r,n),$l(r,n,"shape"),$l(r,n,"style"),$l(r,n,"extra"),r.clipPath=n.clipPath):t[e]=i:a==="replace"?t[e]=i:a==="remove"&&n&&(t[e]=null)}var i2=["transition","enterFrom","leaveTo"],$B=i2.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function $l(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var i=r?i2:$B,n=0;n<i.length;n++){var a=i[n];t[a]==null&&e[a]!=null&&(t[a]=e[a])}}function KB(t,e){if(t&&(t.hv=e.hv=[Ay(e,["left","right"]),Ay(e,["top","bottom"])],t.type==="group")){var r=t,i=e;r.width==null&&(r.width=i.width=0),r.height==null&&(r.height=i.height=0)}}var jB=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.preventAutoZ=!0,r}return e.prototype.mergeOption=function(r,i){var n=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,r,i),this.option.elements=n},e.prototype.optionUpdated=function(r,i){var n=this.option,a=(i?n:r).elements,o=n.elements=i?[]:n.elements,s=[];this._flatten(a,s,null);var l=fx(o,s,"normalMerge"),u=this._elOptionsToUpdate=[];C(l,function(f,h){var v=f.newOption;v&&(u.push(v),ZB(f,v),qB(o,h,v),KB(o[h],v))},this),n.elements=oe(o,function(f){return f&&delete f.$action,f!=null})},e.prototype._flatten=function(r,i,n){C(r,function(a){if(a){n&&(a.parentOption=n),i.push(a);var o=a.children;o&&o.length&&this._flatten(o,i,a),delete a.children}},this)},e.prototype.useElOptionsToUpdate=function(){var r=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,r},e.type="graphic",e.defaultOption={elements:[]},e}(Rt),Ey={path:null,compoundPath:null,group:ee,image:ir,text:Xt},fr=Yt(),QB=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){this._elMap=ht()},e.prototype.render=function(r,i,n){r!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=r,this._updateElements(r),this._relocate(r,n)},e.prototype._updateElements=function(r){var i=r.useElOptionsToUpdate();if(i){var n=this._elMap,a=this.group,o=r.get("z"),s=r.get("zlevel");C(i,function(l){var u=Ne(l.id,null),f=u!=null?n.get(u):null,h=Ne(l.parentId,null),v=h!=null?n.get(h):a,c=l.type,d=l.style;c==="text"&&d&&l.hv&&l.hv[1]&&(d.textVerticalAlign=d.textBaseline=d.verticalAlign=d.align=null);var p=l.textContent,g=l.textConfig;if(d&&vN(d,c,!!g,!!p)){var m=dN(d,c);!g&&m.textConfig&&(g=l.textConfig=m.textConfig),!p&&m.textContent&&(p=m.textContent)}var _=JB(l),y=l.$action||"merge",x=y==="merge",S=y==="replace";if(x){var T=!f,w=f;T?w=My(u,v,l.type,n):(w&&(fr(w).isNew=!1),EN(w)),w&&(yc(w,_,r,{isInit:T}),Cy(w,l,o,s))}else if(S){mu(f,l,n,r);var b=My(u,v,l.type,n);b&&(yc(b,_,r,{isInit:!0}),Cy(b,l,o,s))}else y==="remove"&&(fw(f,l),mu(f,l,n,r));var A=n.get(u);if(A&&p)if(x){var M=A.getTextContent();M?M.attr(p):A.setTextContent(new Xt(p))}else S&&A.setTextContent(new Xt(p));if(A){var E=l.clipPath;if(E){var D=E.type,R=void 0,T=!1;if(x){var P=A.getClipPath();T=!P||fr(P).type!==D,R=T?yd(D):P}else S&&(T=!0,R=yd(D));A.setClipPath(R),yc(R,E,r,{isInit:T}),od(R,E.keyframeAnimation,r)}var I=fr(A);A.setTextConfig(g),I.option=l,tF(A,r,l),Mf({el:A,componentModel:r,itemName:A.name,itemTooltipOption:l.tooltip}),od(A,l.keyframeAnimation,r)}})}},e.prototype._relocate=function(r,i){for(var n=r.option.elements,a=this.group,o=this._elMap,s=i.getWidth(),l=i.getHeight(),u=["x","y"],f=0;f<n.length;f++){var h=n[f],v=Ne(h.id,null),c=v!=null?o.get(v):null;if(!(!c||!c.isGroup)){var d=c.parent,p=d===a,g=fr(c),m=fr(d);g.width=se(g.option.width,p?s:m.width)||0,g.height=se(g.option.height,p?l:m.height)||0}}for(var f=n.length-1;f>=0;f--){var h=n[f],v=Ne(h.id,null),c=v!=null?o.get(v):null;if(c){var d=c.parent,m=fr(d),_=d===a?{width:s,height:l}:{width:m.width,height:m.height},y={},x=fT(c,h,_,null,{hv:h.hv,boundingMode:h.bounding},y);if(!fr(c).isNew&&x){for(var S=h.transition,T={},w=0;w<u.length;w++){var b=u[w],A=y[b];S&&(Yn(S)||bt(S,b)>=0)?T[b]=A:c[b]=A}Sr(c,T,r,0)}else c.attr(y)}}},e.prototype._clear=function(){var r=this,i=this._elMap;i.each(function(n){mu(n,fr(n).option,i,r._lastGraphicModel)}),this._elMap=ht()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(ze);function yd(t){var e=gt(Ey,t)?Ey[t]:Hx(t),r=new e({});return fr(r).type=t,r}function My(t,e,r,i){var n=yd(r);return e.add(n),i.set(t,n),fr(n).id=t,fr(n).isNew=!0,n}function mu(t,e,r,i){var n=t&&t.parent;n&&(t.type==="group"&&t.traverse(function(a){mu(a,e,r,i)}),pN(t,e,i),r.removeKey(fr(t).id))}function Cy(t,e,r,i){t.isGroup||C([["cursor",Jn.prototype.cursor],["zlevel",i||0],["z",r||0],["z2",0]],function(n){var a=n[0];gt(e,a)?t[a]=ft(e[a],n[1]):t[a]==null&&(t[a]=n[1])}),C(mt(e),function(n){if(n.indexOf("on")===0){var a=e[n];t[n]=ct(a)?a:null}}),gt(e,"draggable")&&(t.draggable=e.draggable),e.name!=null&&(t.name=e.name),e.id!=null&&(t.id=e.id)}function JB(t){return t=Y({},t),C(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(uT),function(e){delete t[e]}),t}function tF(t,e,r){var i=Mt(t).eventData;!t.silent&&!t.ignore&&!i&&(i=Mt(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),i&&(i.info=r.info)}function eF(t){t.registerComponentModel(jB),t.registerComponentView(QB),t.registerPreprocessor(function(e){var r=e.graphic;j(r)?!r[0]||!r[0].elements?e.graphic=[{elements:r}]:e.graphic=[e.graphic[0]]:r&&!r.elements&&(e.graphic=[{elements:[r]}])})}var Dy=["x","y","radius","angle","single"],rF=["cartesian2d","polar","singleAxis"];function iF(t){var e=t.get("coordinateSystem");return bt(rF,e)>=0}function Vi(t){return t+"Axis"}function nF(t,e){var r=ht(),i=[],n=ht();t.eachComponent({mainType:"dataZoom",query:e},function(f){n.get(f.uid)||s(f)});var a;do a=!1,t.eachComponent("dataZoom",o);while(a);function o(f){!n.get(f.uid)&&l(f)&&(s(f),a=!0)}function s(f){n.set(f.uid,!0),i.push(f),u(f)}function l(f){var h=!1;return f.eachTargetAxis(function(v,c){var d=r.get(v);d&&d[c]&&(h=!0)}),h}function u(f){f.eachTargetAxis(function(h,v){(r.get(h)||r.set(h,[]))[v]=!0})}return i}function n2(t){var e=t.ecModel,r={infoList:[],infoMap:ht()};return t.eachTargetAxis(function(i,n){var a=e.getComponent(Vi(i),n);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}var Yc=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t}(),of=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,i,n){var a=Ly(r);this.settledOption=a,this.mergeDefaultAndTheme(r,n),this._doInit(a)},e.prototype.mergeOption=function(r){var i=Ly(r);dt(this.option,r,!0),dt(this.settledOption,i,!0),this._doInit(i)},e.prototype._doInit=function(r){var i=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var n=this.settledOption;C([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(i[a[0]]=n[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),i=this._targetAxisInfoMap=ht(),n=this._fillSpecifiedTargetAxis(i);n?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var i=!1;return C(Dy,function(n){var a=this.getReferringComponents(Vi(n),XA);if(a.specified){i=!0;var o=new Yc;C(a.models,function(s){o.add(s.componentIndex)}),r.set(n,o)}},this),i},e.prototype._fillAutoTargetAxisByOrient=function(r,i){var n=this.ecModel,a=!0;if(a){var o=i==="vertical"?"y":"x",s=n.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=n.findComponents({mainType:"singleAxis",filter:function(f){return f.get("orient",!0)===i}});l(s,"single")}function l(u,f){var h=u[0];if(h){var v=new Yc;if(v.add(h.componentIndex),r.set(f,v),a=!1,f==="x"||f==="y"){var c=h.getReferringComponents("grid",Ze).models[0];c&&C(u,function(d){h.componentIndex!==d.componentIndex&&c===d.getReferringComponents("grid",Ze).models[0]&&v.add(d.componentIndex)})}}}a&&C(Dy,function(u){if(a){var f=n.findComponents({mainType:Vi(u),filter:function(v){return v.get("type",!0)==="category"}});if(f[0]){var h=new Yc;h.add(f[0].componentIndex),r.set(u,h),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(i){!r&&(r=i)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var i=this._rangePropMode,n=this.get("rangeMode");C([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?i[o]="percent":!s&&l?i[o]="value":n?i[o]=n[o]:s&&(i[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(i,n){r==null&&(r=this.ecModel.getComponent(Vi(i),n))},this),r},e.prototype.eachTargetAxis=function(r,i){this._targetAxisInfoMap.each(function(n,a){C(n.indexList,function(o){r.call(i,a,o)})})},e.prototype.getAxisProxy=function(r,i){var n=this.getAxisModel(r,i);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(r,i){var n=this._targetAxisInfoMap.get(r);if(n&&n.indexMap[i])return this.ecModel.getComponent(Vi(r),i)},e.prototype.setRawRange=function(r){var i=this.option,n=this.settledOption;C([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(i[a[0]]=n[a[0]]=r[a[0]],i[a[1]]=n[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var i=this.option;C(["start","startValue","end","endValue"],function(n){i[n]=r[n]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},e.prototype.getValueRange=function(r,i){if(r==null&&i==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(r,i).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var i,n=this._targetAxisInfoMap.keys(),a=0;a<n.length;a++)for(var o=n[a],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var u=this.getAxisProxy(o,s.indexList[l]);if(u.hostedBy(this))return u;i||(i=u)}return i},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e}(Rt);function Ly(t){var e={};return C(["start","end","startValue","endValue","throttle"],function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e}var a2=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,i,n,a){this.dataZoomModel=r,this.ecModel=i,this.api=n},e.type="dataZoom",e}(ze),La=C,Ry=On,aF=function(){function t(e,r,i,n){this._dimName=e,this._axisIndex=r,this.ecModel=n,this._dataZoomModel=i}return t.prototype.hostedBy=function(e){return this._dataZoomModel===e},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(r){if(iF(r)){var i=Vi(this._dimName),n=r.getReferringComponents(i,Ze).models[0];n&&this._axisIndex===n.componentIndex&&e.push(r)}},this),e},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return ut(this._minMaxSpan)},t.prototype.calculateDataWindow=function(e){var r=this._dataExtent,i=this.getAxisModel(),n=i.axis.scale,a=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],u;La(["start","end"],function(v,c){var d=e[v],p=e[v+"Value"];a[c]==="percent"?(d==null&&(d=o[c]),p=n.parse(te(d,o,r))):(u=!0,p=p==null?r[c]:n.parse(p),d=te(p,r,o)),l[c]=p==null||isNaN(p)?r[c]:p,s[c]=d==null||isNaN(d)?o[c]:d}),Ry(l),Ry(s);var f=this._minMaxSpan;u?h(l,s,r,o,!1):h(s,l,o,r,!0);function h(v,c,d,p,g){var m=g?"Span":"ValueSpan";qs(0,v,d,"all",f["min"+m],f["max"+m]);for(var _=0;_<2;_++)c[_]=te(v[_],d,p,!0),g&&(c[_]=n.parse(c[_]))}return{valueWindow:l,percentWindow:s}},t.prototype.reset=function(e){if(e===this._dataZoomModel){var r=this.getTargetSeriesModels();this._dataExtent=oF(this,this._dimName,r),this._updateMinMaxSpan();var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(e,r){if(e!==this._dataZoomModel)return;var i=this._dimName,n=this.getTargetSeriesModels(),a=e.get("filterMode"),o=this._valueWindow;if(a==="none")return;La(n,function(l){var u=l.getData(),f=u.mapDimensionsAll(i);if(f.length){if(a==="weakFilter"){var h=u.getStore(),v=tt(f,function(c){return u.getDimensionIndex(c)},u);u.filterSelf(function(c){for(var d,p,g,m=0;m<f.length;m++){var _=h.get(v[m],c),y=!isNaN(_),x=_<o[0],S=_>o[1];if(y&&!x&&!S)return!0;y&&(g=!0),x&&(d=!0),S&&(p=!0)}return g&&d&&p})}else La(f,function(c){if(a==="empty")l.setData(u=u.map(c,function(p){return s(p)?p:NaN}));else{var d={};d[c]=o,u.selectRange(d)}});La(f,function(c){u.setApproximateExtent(o,c)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,i=this._dataExtent;La(["min","max"],function(n){var a=r.get(n+"Span"),o=r.get(n+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=te(i[0]+o,i,[0,100],!0):a!=null&&(o=te(a,[0,100],i,!0)-i[0]),e[n+"Span"]=a,e[n+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var e=this.getAxisModel(),r=this._percentWindow,i=this._valueWindow;if(r){var n=nx(i,[0,500]);n=Math.min(n,20);var a=e.axis.scale.rawExtentInfo;r[0]!==0&&a.setDeterminedMinMax("min",+i[0].toFixed(n)),r[1]!==100&&a.setDeterminedMinMax("max",+i[1].toFixed(n)),a.freeze()}},t}();function oF(t,e,r){var i=[1/0,-1/0];La(r,function(o){cP(i,o.getData(),e)});var n=t.getAxisModel(),a=IS(n.axis.scale,n,i).calculate();return[a.min,a.max]}var sF={getTargetSeries:function(t){function e(n){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(Vi(o),s);n(o,s,l,a)})})}e(function(n,a,o,s){o.__dzAxisProxy=null});var r=[];e(function(n,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new aF(n,a,s,t),r.push(o.__dzAxisProxy))});var i=ht();return C(r,function(n){C(n.getTargetSeriesModels(),function(a){i.set(a.uid,a)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(i,n){r.getAxisProxy(i,n).reset(r)}),r.eachTargetAxis(function(i,n){r.getAxisProxy(i,n).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var i=r.findRepresentativeAxisProxy();if(i){var n=i.getDataPercentWindow(),a=i.getDataValueWindow();r.setCalculatedRange({start:n[0],end:n[1],startValue:a[0],endValue:a[1]})}})}};function lF(t){t.registerAction("dataZoom",function(e,r){var i=nF(r,e);C(i,function(n){n.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var Py=!1;function o2(t){Py||(Py=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,sF),lF(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function uF(t,e){var r=Ys(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new Kt({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1}),t}var fF=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Rt);function s2(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function l2(t){if(vt.domSupported){for(var e=document.documentElement.style,r=0,i=t.length;r<i;r++)if(t[r]in e)return t[r]}}var u2=l2(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),hF=l2(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function f2(t,e){if(!t)return e;e=oT(e,!0);var r=t.indexOf(e);return t=r===-1?e:"-"+t.slice(0,r)+"-"+e,t.toLowerCase()}function cF(t,e){var r=t.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(t);return r?r[e]:null}var vF=f2(hF,"transition"),$p=f2(u2,"transform"),dF="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(vt.transform3dSupported?"will-change:transform;":"");function pF(t){return t=t==="left"?"right":t==="right"?"left":t==="top"?"bottom":"top",t}function gF(t,e,r){if(!Q(r)||r==="inside")return"";var i=t.get("backgroundColor"),n=t.get("borderWidth");e=$n(e);var a=pF(r),o=Math.max(Math.round(n)*1.5,6),s="",l=$p+":",u;bt(["left","right"],a)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var f=u*Math.PI/180,h=o+n,v=h*Math.abs(Math.cos(f))+h*Math.abs(Math.sin(f)),c=Math.round(((v-Math.SQRT2*n)/2+Math.SQRT2*n-(v-h)/2)*100)/100;s+=";"+a+":-"+c+"px";var d=e+" solid "+n+"px;",p=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+i+";"];return'<div style="'+p.join("")+'"></div>'}function mF(t,e){var r="cubic-bezier(0.23,1,0.32,1)",i=" "+t/2+"s "+r,n="opacity"+i+",visibility"+i;return e||(i=" "+t+"s "+r,n+=vt.transformSupported?","+$p+i:",left"+i+",top"+i),vF+":"+n}function Iy(t,e,r){var i=t.toFixed(0)+"px",n=e.toFixed(0)+"px";if(!vt.transformSupported)return r?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=vt.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return r?"top:0;left:0;"+$p+":"+o+";":[["top",0],["left",0],[u2,o]]}function _F(t){var e=[],r=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont()),r&&e.push("line-height:"+Math.round(r*3/2)+"px");var n=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,o=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return n&&a&&e.push("text-shadow:"+o+"px "+s+"px "+a+"px "+n),C(["decoration","align"],function(l){var u=t.get(l);u&&e.push("text-"+l+":"+u)}),e.join(";")}function yF(t,e,r){var i=[],n=t.get("transitionDuration"),a=t.get("backgroundColor"),o=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),u=t.get("shadowOffsetY"),f=t.getModel("textStyle"),h=FT(t,"html"),v=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+v),e&&n&&i.push(mF(n,r)),a&&i.push("background-color:"+a),C(["width","color","radius"],function(c){var d="border-"+c,p=oT(d),g=t.get(p);g!=null&&i.push(d+":"+g+(c==="color"?"":"px"))}),i.push(_F(f)),h!=null&&i.push("padding:"+Ys(h).join("px ")+"px"),i.join(";")+";"}function Ny(t,e,r,i,n){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&pb(t,o,r,i,n)}else{t[0]=i,t[1]=n;var s=a&&a.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var xF=function(){function t(e,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,vt.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=e.getZr(),a=r.appendTo,o=a&&(Q(a)?document.querySelector(a):gs(a)?a:ct(a)&&a(e.getDom()));Ny(this._styleCoord,n,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(i),this._api=e,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,f=n.painter.getViewportRoot();sr(f,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),i=cF(r,"position"),n=r.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=dF+yF(e,!this._firstShow,this._longHide)+Iy(a[0],a[1],!0)+("border-color:"+$n(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,i,n,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(Q(a)&&i.get("trigger")==="item"&&!s2(i)&&(s=gF(i,n,a)),Q(e))o.innerHTML=e+s;else if(e){o.innerHTML="",j(e)||(e=[e]);for(var l=0;l<e.length;l++)gs(e[l])&&e[l].parentNode!==o&&o.appendChild(e[l]);if(s&&o.childNodes.length){var u=document.createElement("div");u.innerHTML=s,o.appendChild(u)}}},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el;return[e.offsetWidth,e.offsetHeight]},t.prototype.moveTo=function(e,r){var i=this._styleCoord;if(Ny(i,this._zr,this._container,e,r),i[0]!=null&&i[1]!=null){var n=this.el.style,a=Iy(i[0],i[1]);C(a,function(o){n[o[0]]=o[1]})}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){var e=this,r=this.el.style;r.visibility="hidden",r.opacity="0",vt.transform3dSupported&&(r.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(nt(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},t}(),TF=function(){function t(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),By(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return t.prototype.update=function(e){var r=e.get("alwaysShowContent");r&&this._moveIfResized(),this._alwaysShowContent=r},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(e,r,i,n,a){var o=this;rt(e)&&Xe(""),this.el&&this._zr.remove(this.el);var s=i.getModel("textStyle");this.el=new Xt({style:{rich:r.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:n,textShadowColor:s.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:FT(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),C(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(u){o.el.style[u]=i.get(u)}),C(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(u){o.el.style[u]=s.get(u)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el,r=this.el.getBoundingRect(),i=Oy(e.style);return[r.width+i.left+i.right,r.height+i.top+i.bottom]},t.prototype.moveTo=function(e,r){var i=this.el;if(i){var n=this._styleCoord;By(n,this._zr,e,r),e=n[0],r=n[1];var a=i.style,o=Bi(a.borderWidth||0),s=Oy(a);i.x=e+o+s.left,i.y=r+o+s.top,i.markRedraw()}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(nt(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function Bi(t){return Math.max(0,t)}function Oy(t){var e=Bi(t.shadowBlur||0),r=Bi(t.shadowOffsetX||0),i=Bi(t.shadowOffsetY||0);return{left:Bi(e-r),right:Bi(e+r),top:Bi(e-i),bottom:Bi(e+i)}}function By(t,e,r,i){t[0]=r,t[1]=i,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var SF=new Kt({shape:{x:-1,y:-1,width:2,height:2}}),wF=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,i){if(!(vt.node||!i.getDom())){var n=r.getComponent("tooltip"),a=this._renderMode=ZA(n.get("renderMode"));this._tooltipContent=a==="richText"?new TF(i):new xF(i,{appendTo:n.get("appendToBody",!0)?"body":n.get("appendTo",!0)})}},e.prototype.render=function(r,i,n){if(!(vt.node||!n.getDom())){this.group.removeAll(),this._tooltipModel=r,this._ecModel=i,this._api=n;var a=this._tooltipContent;a.update(r),a.setEnterable(r.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&r.get("transitionDuration")?zf(this,"_updatePosition",50,"fixRate"):Vu(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var r=this._tooltipModel,i=r.get("triggerOn");t2("itemTooltip",this._api,nt(function(n,a,o){i!=="none"&&(i.indexOf(n)>=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,i=this._ecModel,n=this._api,a=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(r,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,i,n,a){if(!(a.from===this.uid||vt.node||!n.getDom())){var o=Fy(a,n);this._ticket="";var s=a.dataByCoordSys,l=MF(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var f=SF;f.x=a.x,f.y=a.y,f.update(),Mt(f).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:f},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,i,n,a))return;var h=e2(a,i),v=h.point[0],c=h.point[1];v!=null&&c!=null&&this._tryShow({offsetX:v,offsetY:c,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(r,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(Fy(a,n))},e.prototype._manuallyAxisShowTip=function(r,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var f=u.getData(),h=Vo([f.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(r,i){var n=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(n){var s=Mt(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Ba(n,function(f){if(Mt(f).dataIndex!=null)return l=f,!0;if(Mt(f).tooltipConfig!=null)return u=f,!0},!0),l?this._showSeriesItemTooltip(r,l,i):u?this._showComponentItemTooltip(r,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},e.prototype._showOrMove=function(r,i){var n=r.get("showDelay");i=nt(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},e.prototype._showAxisTooltip=function(r,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=Vo([i.tooltipOption],a),l=this._renderMode,u=[],f=Ms("section",{blocks:[],noHeader:!0}),h=[],v=new $h;C(r,function(_){C(_.dataByAxis,function(y){var x=n.getComponent(y.axisDim+"Axis",y.axisIndex),S=y.value;if(!(!x||S==null)){var T=Qw(S,x.axis,n,y.seriesDataIndices,y.valueLabelOpt),w=Ms("section",{header:T,noHeader:!jr(T),sortBlocks:!0,blocks:[]});f.blocks.push(w),C(y.seriesDataIndices,function(b){var A=n.getSeriesByIndex(b.seriesIndex),M=b.dataIndexInside,E=A.getDataParams(M);if(!(E.dataIndex<0)){E.axisDim=y.axisDim,E.axisIndex=y.axisIndex,E.axisType=y.axisType,E.axisId=y.axisId,E.axisValue=Lp(x.axis,{value:S}),E.axisValueLabel=T,E.marker=v.makeTooltipMarker("item",$n(E.color),l);var D=qm(A.formatTooltip(M,!0,null)),R=D.frag;if(R){var P=Vo([A],a).get("valueFormatter");w.blocks.push(P?Y({valueFormatter:P},R):R)}D.text&&h.push(D.text),u.push(E)}})}})}),f.blocks.reverse(),h.reverse();var c=i.position,d=s.get("order"),p=t0(f,v,l,d,n.get("useUTC"),s.get("textStyle"));p&&h.unshift(p);var g=l==="richText"?`
`:"<br/>",m=h.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,c,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],c,null,v)})},e.prototype._showSeriesItemTooltip=function(r,i,n){var a=this._ecModel,o=Mt(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,h=o.dataType,v=u.getData(h),c=this._renderMode,d=r.positionDefault,p=Vo([v.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var m=u.getDataParams(f,h),_=new $h;m.marker=_.makeTooltipMarker("item",$n(m.color),c);var y=qm(u.formatTooltip(f,!1,h)),x=p.get("order"),S=p.get("valueFormatter"),T=y.frag,w=T?t0(S?Y({valueFormatter:S},T):T,_,c,x,a.get("useUTC"),p.get("textStyle")):y.text,b="item_"+u.name+"_"+f;this._showOrMove(p,function(){this._showTooltipContent(p,w,m,b,r.offsetX,r.offsetY,r.position,r.target,_)}),n({type:"showTip",dataIndexInside:f,dataIndex:v.getRawIndex(f),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,i,n){var a=this._renderMode==="html",o=Mt(i),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(Q(l)){var f=l;l={content:f,formatter:f},u=!0}u&&a&&l.content&&(l=ut(l),l.content=_e(l.content));var h=[l],v=this._ecModel.getComponent(o.componentMainType,o.componentIndex);v&&h.push(v),h.push({formatter:l.content});var c=r.positionDefault,d=Vo(h,this._tooltipModel,c?{position:c}:null),p=d.get("content"),g=Math.random()+"",m=new $h;this._showOrMove(d,function(){var _=ut(d.get("formatterParams")||{});this._showTooltipContent(d,p,_,g,r.offsetX,r.offsetY,r.position,i,m)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,i,n,a,o,s,l,u,f){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.setEnterable(r.get("enterable"));var v=r.get("formatter");l=l||r.get("position");var c=i,d=this._getNearestPoint([o,s],n,r.get("trigger"),r.get("borderColor")),p=d.color;if(v)if(Q(v)){var g=r.ecModel.get("useUTC"),m=j(n)?n[0]:n,_=m&&m.axisType&&m.axisType.indexOf("time")>=0;c=v,_&&(c=Rf(m.axisValue,c,g)),c=sT(c,n,!0)}else if(ct(v)){var y=nt(function(x,S){x===this._ticket&&(h.setContent(S,f,r,p,l),this._updatePosition(r,l,o,s,h,n,u))},this);this._ticket=a,c=v(n,a,y)}else c=v;h.setContent(c,f,r,p,l),h.show(r,p),this._updatePosition(r,l,o,s,h,n,u)}},e.prototype._getNearestPoint=function(r,i,n,a){if(n==="axis"||j(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!j(i))return{color:a||i.color||i.borderColor}},e.prototype._updatePosition=function(r,i,n,a,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();i=i||r.get("position");var h=o.getSize(),v=r.get("align"),c=r.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),ct(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,f],contentSize:h.slice()})),j(i))n=se(i[0],u),a=se(i[1],f);else if(rt(i)){var p=i;p.width=h[0],p.height=h[1];var g=Ki(p,{width:u,height:f});n=g.x,a=g.y,v=null,c=null}else if(Q(i)&&l){var m=EF(i,d,h,r.get("borderWidth"));n=m[0],a=m[1]}else{var m=bF(n,a,o,u,f,v?null:20,c?null:20);n=m[0],a=m[1]}if(v&&(n-=ky(v)?h[0]/2:v==="right"?h[0]:0),c&&(a-=ky(c)?h[1]/2:c==="bottom"?h[1]:0),s2(r)){var m=AF(n,a,o,u,f);n=m[0],a=m[1]}o.moveTo(n,a)},e.prototype._updateContentNotChangedOnAxis=function(r,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===r.length;return o&&C(n,function(s,l){var u=s.dataByAxis||[],f=r[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&C(u,function(v,c){var d=h[c]||{},p=v.seriesDataIndices||[],g=d.seriesDataIndices||[];o=o&&v.value===d.value&&v.axisType===d.axisType&&v.axisId===d.axisId&&p.length===g.length,o&&C(p,function(m,_){var y=g[_];o=o&&m.seriesIndex===y.seriesIndex&&m.dataIndex===y.dataIndex}),a&&C(v.seriesDataIndices,function(m){var _=m.seriesIndex,y=i[_],x=a[_];y&&x&&x.data!==y.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=i,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,i){vt.node||!i.getDom()||(Vu(this,"_updatePosition"),this._tooltipContent.dispose(),_d("itemTooltip",i))},e.type="tooltip",e}(ze);function Vo(t,e,r){var i=e.ecModel,n;r?(n=new Zt(r,i,i),n=new Zt(e.option,n,i)):n=e;for(var a=t.length-1;a>=0;a--){var o=t[a];o&&(o instanceof Zt&&(o=o.get("tooltip",!0)),Q(o)&&(o={formatter:o}),o&&(n=new Zt(o,n,i)))}return n}function Fy(t,e){return t.dispatchAction||nt(e.dispatchAction,e)}function bF(t,e,r,i,n,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(t+l+a+2>i?t-=l+a:t+=a),o!=null&&(e+u+o>n?e-=u+o:e+=o),[t,e]}function AF(t,e,r,i,n){var a=r.getSize(),o=a[0],s=a[1];return t=Math.min(t+o,i)-o,e=Math.min(e+s,n)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function EF(t,e,r,i){var n=r[0],a=r[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,f=e.height;switch(t){case"inside":s=e.x+u/2-n/2,l=e.y+f/2-a/2;break;case"top":s=e.x+u/2-n/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-n/2,l=e.y+f+o;break;case"left":s=e.x-n-o,l=e.y+f/2-a/2;break;case"right":s=e.x+u+o,l=e.y+f/2-a/2}return[s,l]}function ky(t){return t==="center"||t==="middle"}function MF(t,e,r){var i=Vd(t).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=Vs(e,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var f=Mt(u).tooltipConfig;if(f&&f.name===t.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}function CF(t){Qe(r2),t.registerComponentModel(fF),t.registerComponentView(wF),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Te),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Te)}var zy=C;function Uy(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function Hy(t,e,r){var i={};return zy(e,function(a){var o=i[a]=n();zy(t[a],function(s,l){if(Me.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new Me(u),l==="opacity"&&(u=ut(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Me(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function DF(t,e,r){var i;C(r,function(n){e.hasOwnProperty(n)&&Uy(e[n])&&(i=!0)}),i&&C(r,function(n){e.hasOwnProperty(n)&&Uy(e[n])?t[n]=ut(e[n]):delete t[n]})}function LF(t,e,r,i){var n={};return C(t,function(a){var o=Me.prepareVisualTypes(e[a]);n[a]=o}),{progress:function(o,s){var l;i!=null&&(l=s.getDimensionIndex(i));function u(S){return ZT(s,h,S)}function f(S,T){fL(s,h,S,T)}for(var h,v=s.getStore();(h=o.next())!=null;){var c=s.getRawDataItem(h);if(!(c&&c.visualMap===!1))for(var d=i!=null?v.get(l,h):h,p=r(d),g=e[p],m=n[p],_=0,y=m.length;_<y;_++){var x=m[_];g[x]&&g[x].applyVisual(d,u,f)}}}}}var RF=function(t,e){if(e==="all")return{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}},xd=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.prototype.init=function(r,i,n){this.mergeDefaultAndTheme(r,n),r.selected=r.selected||{},this._updateSelector(r)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),this._updateSelector(r)},e.prototype._updateSelector=function(r){var i=r.selector,n=this.ecModel;i===!0&&(i=r.selector=["all","inverse"]),j(i)&&C(i,function(a,o){Q(a)&&(a={type:a}),i[o]=dt(a,RF(n,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var i=!1,n=0;n<r.length;n++){var a=r[n].get("name");if(this.isSelected(a)){this.select(a),i=!0;break}}!i&&this.select(r[0].get("name"))}},e.prototype._updateData=function(r){var i=[],n=[];r.eachRawSeries(function(l){var u=l.name;n.push(u);var f;if(l.legendVisualProvider){var h=l.legendVisualProvider,v=h.getAllNames();r.isSeriesFiltered(l)||(n=n.concat(v)),v.length?i=i.concat(v):f=!0}else f=!0;f&&Hd(l)&&i.push(l.name)}),this._availableNames=n;var a=this.get("data")||i,o=ht(),s=tt(a,function(l){return(Q(l)||$t(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new Zt(l,this,this.ecModel))},this);this._data=oe(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(r){var i=this.option.selected,n=this.get("selectedMode");if(n==="single"){var a=this._data;C(a,function(o){i[o.get("name")]=!1})}i[r]=!0},e.prototype.unSelect=function(r){this.get("selectedMode")!=="single"&&(this.option.selected[r]=!1)},e.prototype.toggleSelected=function(r){var i=this.option.selected;i.hasOwnProperty(r)||(i[r]=!0),this[i[r]?"unSelect":"select"](r)},e.prototype.allSelect=function(){var r=this._data,i=this.option.selected;C(r,function(n){i[n.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var r=this._data,i=this.option.selected;C(r,function(n){var a=n.get("name",!0);i.hasOwnProperty(a)||(i[a]=!0),i[a]=!i[a]})},e.prototype.isSelected=function(r){var i=this.option.selected;return!(i.hasOwnProperty(r)&&!i[r])&&bt(this._availableNames,r)>=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={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,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},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}},e}(Rt),Aa=le,Td=C,Kl=ee,h2=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new Kl),this.group.add(this._selectorGroup=new Kl),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,i,n,l,s,u);var f=r.getBoxLayoutParams(),h={width:n.getWidth(),height:n.getHeight()},v=r.get("padding"),c=Ki(f,h,v),d=this.layoutInner(r,o,c,a,l,u),p=Ki(Et({width:d.width,height:d.height},f),h,v);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=uF(d,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,i,n,a,o,s,l){var u=this.getContentGroup(),f=ht(),h=i.get("selectedMode"),v=[];n.eachRawSeries(function(c){!c.get("legendHoverLink")&&v.push(c.id)}),Td(i.getData(),function(c,d){var p=c.get("name");if(!this.newlineDisabled&&(p===""||p===`
`)){var g=new Kl;g.newline=!0,u.add(g);return}var m=n.getSeriesByName(p)[0];if(!f.get(p))if(m){var _=m.getData(),y=_.getVisual("legendLineStyle")||{},x=_.getVisual("legendIcon"),S=_.getVisual("style"),T=this._createItem(m,p,d,c,i,r,y,S,x,h,a);T.on("click",Aa(Vy,p,null,a,v)).on("mouseover",Aa(Sd,m.name,null,a,v)).on("mouseout",Aa(wd,m.name,null,a,v)),n.ssr&&T.eachChild(function(w){var b=Mt(w);b.seriesIndex=m.seriesIndex,b.dataIndex=d,b.ssrType="legend"}),f.set(p,!0)}else n.eachRawSeries(function(w){if(!f.get(p)&&w.legendVisualProvider){var b=w.legendVisualProvider;if(!b.containName(p))return;var A=b.indexOfName(p),M=b.getItemVisual(A,"style"),E=b.getItemVisual(A,"legendIcon"),D=Be(M.fill);D&&D[3]===0&&(D[3]=.2,M=Y(Y({},M),{fill:pi(D,"rgba")}));var R=this._createItem(w,p,d,c,i,r,{},M,E,h,a);R.on("click",Aa(Vy,null,p,a,v)).on("mouseover",Aa(Sd,null,p,a,v)).on("mouseout",Aa(wd,null,p,a,v)),n.ssr&&R.eachChild(function(P){var I=Mt(P);I.seriesIndex=w.seriesIndex,I.dataIndex=d,I.ssrType="legend"}),f.set(p,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},e.prototype._createSelector=function(r,i,n,a,o){var s=this.getSelectorGroup();Td(r,function(u){var f=u.type,h=new Xt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(h);var v=i.getModel("selectorLabel"),c=i.getModel(["emphasis","selectorLabel"]);op(h,{normal:v,emphasis:c},{defaultText:u.title}),Nu(h)})},e.prototype._createItem=function(r,i,n,a,o,s,l,u,f,h,v){var c=r.visualDrawType,d=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(i),m=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),y=a.get("icon");f=y||f||"roundRect";var x=PF(f,a,l,u,c,g,v),S=new Kl,T=a.getModel("textStyle");if(ct(r.getLegendIcon)&&(!y||y==="inherit"))S.add(r.getLegendIcon({itemWidth:d,itemHeight:p,icon:f,iconRotate:m,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}));else{var w=y==="inherit"&&r.getData().getVisual("symbol")?m==="inherit"?r.getData().getVisual("symbolRotate"):m:0;S.add(IF({itemWidth:d,itemHeight:p,icon:f,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}))}var b=s==="left"?d+5:-5,A=s,M=o.get("formatter"),E=i;Q(M)&&M?E=M.replace("{name}",i??""):ct(M)&&(E=M(i));var D=g?T.getTextColor():a.get("inactiveColor");S.add(new Xt({style:qe(T,{text:E,x:b,y:p/2,fill:D,align:A,verticalAlign:"middle"},{inheritColor:D})}));var R=new Kt({shape:S.getBoundingRect(),style:{fill:"transparent"}}),P=a.getModel("tooltip");return P.get("show")&&Mf({el:R,componentModel:o,itemName:i,itemTooltipOption:P.option}),S.add(R),S.eachChild(function(I){I.silent=!0}),R.silent=!h,this.getContentGroup().add(S),Nu(S),S.__legendDataIndex=n,S},e.prototype.layoutInner=function(r,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();$a(r.get("orient"),l,r.get("itemGap"),n.width,n.height);var f=l.getBoundingRect(),h=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){$a("horizontal",u,r.get("selectorItemGap",!0));var v=u.getBoundingRect(),c=[-v.x,-v.y],d=r.get("selectorButtonGap",!0),p=r.getOrient().index,g=p===0?"width":"height",m=p===0?"height":"width",_=p===0?"y":"x";s==="end"?c[p]+=f[g]+d:h[p]+=v[g]+d,c[1-p]+=f[m]/2-v[m]/2,u.x=c[0],u.y=c[1],l.x=h[0],l.y=h[1];var y={x:0,y:0};return y[g]=f[g]+d+v[g],y[m]=Math.max(f[m],v[m]),y[_]=Math.min(0,v[_]+c[1-p]),y}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(ze);function PF(t,e,r,i,n,a,o){function s(g,m){g.lineWidth==="auto"&&(g.lineWidth=m.lineWidth>0?2:0),Td(g,function(_,y){g[y]==="inherit"&&(g[y]=m[y])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),f=t.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?i.decal:Xv(h,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[f]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:r).opacity),s(u,i);var v=e.getModel("lineStyle"),c=v.getLineStyle();if(s(c,r),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),c.stroke==="auto"&&(c.stroke=i.fill),!a){var d=e.get("inactiveBorderWidth"),p=u[f];u.lineWidth=d==="auto"?i.lineWidth>0&&p?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),c.stroke=v.get("inactiveColor"),c.lineWidth=v.get("inactiveWidth")}return{itemStyle:u,lineStyle:c}}function IF(t){var e=t.icon||"roundRect",r=Br(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return r.setStyle(t.itemStyle),r.rotation=(t.iconRotate||0)*Math.PI/180,r.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill="#fff",r.style.lineWidth=2),r}function Vy(t,e,r,i){wd(t,e,r,i),r.dispatchAction({type:"legendToggleSelect",name:t??e}),Sd(t,e,r,i)}function c2(t){for(var e=t.getZr().storage.getDisplayList(),r,i=0,n=e.length;i<n&&!(r=e[i].states.emphasis);)i++;return r&&r.hoverLayer}function Sd(t,e,r,i){c2(r)||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:i})}function wd(t,e,r,i){c2(r)||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:i})}function NF(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var i=0;i<e.length;i++)if(!e[i].isSelected(r.name))return!1;return!0})}function Go(t,e,r){var i={},n=t==="toggleSelected",a;return r.eachComponent("legend",function(o){n&&a!=null?o[a?"select":"unSelect"](e.name):t==="allSelect"||t==="inverseSelect"?o[t]():(o[t](e.name),a=o.isSelected(e.name));var s=o.getData();C(s,function(l){var u=l.get("name");if(!(u===`
`||u==="")){var f=o.isSelected(u);i.hasOwnProperty(u)?i[u]=i[u]&&f:i[u]=f}})}),t==="allSelect"||t==="inverseSelect"?{selected:i}:{name:e.name,selected:i}}function OF(t){t.registerAction("legendToggleSelect","legendselectchanged",le(Go,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",le(Go,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",le(Go,"inverseSelect")),t.registerAction("legendSelect","legendselected",le(Go,"select")),t.registerAction("legendUnSelect","legendunselected",le(Go,"unSelect"))}function v2(t){t.registerComponentModel(xd),t.registerComponentView(h2),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,NF),t.registerSubTypeDefaulter("legend",function(){return"plain"}),OF(t)}var BF=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.setScrollDataIndex=function(r){this.option.scrollDataIndex=r},e.prototype.init=function(r,i,n){var a=Zs(r);t.prototype.init.call(this,r,i,n),Gy(this,r,a)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),Gy(this,this.option,r)},e.type="legend.scroll",e.defaultOption=Xs(xd.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(xd);function Gy(t,e,r){var i=t.getOrient(),n=[1,1];n[i.index]=0,Kn(e,r,{type:"box",ignoreSize:!!n})}var Wy=ee,Zc=["width","height"],qc=["x","y"],FF=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!0,r._currentIndex=0,r}return e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new Wy),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Wy)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(r,i,n,a,o,s,l){var u=this;t.prototype.renderInner.call(this,r,i,n,a,o,s,l);var f=this._controllerGroup,h=i.get("pageIconSize",!0),v=j(h)?h:[h,h];d("pagePrev",0);var c=i.getModel("pageTextStyle");f.add(new Xt({name:"pageText",style:{text:"xx/xx",fill:c.getTextColor(),font:c.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),d("pageNext",1);function d(p,g){var m=p+"DataIndex",_=np(i.get("pageIcons",!0)[i.getOrient().name][g],{onclick:nt(u._pageGo,u,m,i,a)},{x:-v[0]/2,y:-v[1]/2,width:v[0],height:v[1]});_.name=p,f.add(_)}},e.prototype.layoutInner=function(r,i,n,a,o,s){var l=this.getSelectorGroup(),u=r.getOrient().index,f=Zc[u],h=qc[u],v=Zc[1-u],c=qc[1-u];o&&$a("horizontal",l,r.get("selectorItemGap",!0));var d=r.get("selectorButtonGap",!0),p=l.getBoundingRect(),g=[-p.x,-p.y],m=ut(n);o&&(m[f]=n[f]-p[f]-d);var _=this._layoutContentAndController(r,a,m,u,f,v,c,h);if(o){if(s==="end")g[u]+=_[f]+d;else{var y=p[f]+d;g[u]-=y,_[h]-=y}_[f]+=p[f]+d,g[1-u]+=_[c]+_[v]/2-p[v]/2,_[v]=Math.max(_[v],p[v]),_[c]=Math.min(_[c],p[c]+g[1-u]),l.x=g[0],l.y=g[1],l.markRedraw()}return _},e.prototype._layoutContentAndController=function(r,i,n,a,o,s,l,u){var f=this.getContentGroup(),h=this._containerGroup,v=this._controllerGroup;$a(r.get("orient"),f,r.get("itemGap"),a?n.width:null,a?null:n.height),$a("horizontal",v,r.get("pageButtonItemGap",!0));var c=f.getBoundingRect(),d=v.getBoundingRect(),p=this._showController=c[o]>n[o],g=[-c.x,-c.y];i||(g[a]=f[u]);var m=[0,0],_=[-d.x,-d.y],y=ft(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(p){var x=r.get("pageButtonPosition",!0);x==="end"?_[a]+=n[o]-d[o]:m[a]+=d[o]+y}_[1-a]+=c[s]/2-d[s]/2,f.setPosition(g),h.setPosition(m),v.setPosition(_);var S={x:0,y:0};if(S[o]=p?n[o]:c[o],S[s]=Math.max(c[s],d[s]),S[l]=Math.min(0,d[l]+_[1-a]),h.__rectSize=n[o],p){var T={x:0,y:0};T[o]=Math.max(n[o]-d[o]-y,0),T[s]=S[s],h.setClipPath(new Kt({shape:T})),h.__rectSize=T[o]}else v.eachChild(function(b){b.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(r);return w.pageIndex!=null&&Sr(f,{x:w.contentPosition[0],y:w.contentPosition[1]},p?r:null),this._updatePageInfoView(r,w),S},e.prototype._pageGo=function(r,i,n){var a=this._getPageInfo(i)[r];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},e.prototype._updatePageInfoView=function(r,i){var n=this._controllerGroup;C(["pagePrev","pageNext"],function(f){var h=f+"DataIndex",v=i[h]!=null,c=n.childOfName(f);c&&(c.setStyle("fill",v?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),c.cursor=v?"pointer":"default")});var a=n.childOfName("pageText"),o=r.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",Q(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(r){var i=r.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=Zc[o],l=qc[o],u=this._findTargetItemIndex(i),f=n.children(),h=f[u],v=f.length,c=v?1:0,d={contentPosition:[n.x,n.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return d;var p=x(h);d.contentPosition[o]=-p.s;for(var g=u+1,m=p,_=p,y=null;g<=v;++g)y=x(f[g]),(!y&&_.e>m.s+a||y&&!S(y,m.s))&&(_.i>m.i?m=_:m=y,m&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=m.i),++d.pageCount)),_=y;for(var g=u-1,m=p,_=p,y=null;g>=-1;--g)y=x(f[g]),(!y||!S(_,y.s))&&m.i<_.i&&(_=m,d.pagePrevDataIndex==null&&(d.pagePrevDataIndex=m.i),++d.pageCount,++d.pageIndex),m=y;return d;function x(T){if(T){var w=T.getBoundingRect(),b=w[l]+T[l];return{s:b,e:b+w[s],i:T.__legendDataIndex}}}function S(T,w){return T.e>=w&&T.s<=w+a}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(i=s)}),i??a},e.type="legend.scroll",e}(h2);function kF(t){t.registerAction("legendScroll","legendscroll",function(e,r){var i=e.scrollDataIndex;i!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(n){n.setScrollDataIndex(i)})})}function zF(t){Qe(v2),t.registerComponentModel(BF),t.registerComponentView(FF),kF(t)}function UF(t){Qe(v2),Qe(zF)}var HF=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=Xs(of.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(of),Kp=Yt();function VF(t,e,r){Kp(t).coordSysRecordMap.each(function(i){var n=i.dataZoomInfoMap.get(e.uid);n&&(n.getRange=r)})}function GF(t,e){for(var r=Kp(t).coordSysRecordMap,i=r.keys(),n=0;n<i.length;n++){var a=i[n],o=r.get(a),s=o.dataZoomInfoMap;if(s){var l=e.uid,u=s.get(l);u&&(s.removeKey(l),s.keys().length||d2(r,o))}}}function d2(t,e){if(e){t.removeKey(e.model.uid);var r=e.controller;r&&r.dispose()}}function WF(t,e){var r={model:e,containsPoint:le(YF,e),dispatchAction:le(XF,t),dataZoomInfoMap:null,controller:null},i=r.controller=new lN(t.getZr());return C(["pan","zoom","scrollMove"],function(n){i.on(n,function(a){var o=[];r.dataZoomInfoMap.each(function(s){if(a.isAvailableBehavior(s.model.option)){var l=(s.getRange||{})[n],u=l&&l(s.dzReferCoordSysInfo,r.model.mainType,r.controller,a);!s.model.get("disabled",!0)&&u&&o.push({dataZoomId:s.model.id,start:u[0],end:u[1]})}}),o.length&&r.dispatchAction(o)})}),r}function XF(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function YF(t,e,r,i){return t.coordinateSystem.containPoint([r,i])}function ZF(t){var e,r="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},n=!0;return t.each(function(a){var o=a.model,s=o.get("disabled",!0)?!1:o.get("zoomLock",!0)?"move":!0;i[r+s]>i[r+e]&&(e=s),n=n&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}function qF(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var i=Kp(r),n=i.coordSysRecordMap||(i.coordSysRecordMap=ht());n.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=n2(a);C(o.infoList,function(s){var l=s.model.uid,u=n.get(l)||n.set(l,WF(r,s.model)),f=u.dataZoomInfoMap||(u.dataZoomInfoMap=ht());f.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),n.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){d2(n,a);return}var f=ZF(l);o.enable(f.controlType,f.opt),o.setPointerChecker(a.containsPoint),zf(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var $F=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,i,n){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),VF(n,r,{pan:nt($c.pan,this),zoom:nt($c.zoom,this),scrollMove:nt($c.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){GF(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(a2),$c={zoom:function(t,e,r,i){var n=this.range,a=n.slice(),o=t.axisModels[0];if(o){var s=Kc[e](null,[i.originX,i.originY],o,r,t),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/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var f=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(qs(0,a,[0,100],0,f.minSpan,f.maxSpan),this.range=a,n[0]!==a[0]||n[1]!==a[1])return a}},pan:Xy(function(t,e,r,i,n,a){var o=Kc[i]([a.oldX,a.oldY],[a.newX,a.newY],e,n,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:Xy(function(t,e,r,i,n,a){var o=Kc[i]([0,0],[a.scrollDelta,a.scrollDelta],e,n,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function Xy(t){return function(e,r,i,n){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,i,n);if(qs(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var Kc={grid:function(t,e,r,i,n){var a=r.axis,o={},s=n.model.coordinateSystem.getRect();return t=t||[0,0],a.dim==="x"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(t,e,r,i,n){var a=r.axis,o={},s=n.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(t,e,r,i,n){var a=r.axis,o=n.model.coordinateSystem.getRect(),s={};return t=t||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function KF(t){o2(t),t.registerComponentModel(HF),t.registerComponentView($F),qF(t)}var jF=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=Xs(of.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(of),Wo=Kt,Yy=7,QF=1,jc=30,JF=7,Xo="horizontal",Zy="vertical",t5=5,e5=["line","bar","candlestick","scatter"],r5={easing:"cubicOut",duration:100,delay:0},i5=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._displayables={},r}return e.prototype.init=function(r,i){this.api=i,this._onBrush=nt(this._onBrush,this),this._onBrushEnd=nt(this._onBrushEnd,this)},e.prototype.render=function(r,i,n,a){if(t.prototype.render.apply(this,arguments),zf(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){Vu(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var i=this._displayables.sliderGroup=new ee;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(i),this._positionGroup()},e.prototype._resetLocation=function(){var r=this.dataZoomModel,i=this.api,n=r.get("brushSelect"),a=n?JF:0,o=this._findCoordRect(),s={width:i.getWidth(),height:i.getHeight()},l=this._orient===Xo?{right:s.width-o.x-o.width,top:s.height-jc-Yy-a,width:o.width,height:jc}:{right:Yy,top:o.y,width:jc,height:o.height},u=Zs(r.option);C(["right","top","width","height"],function(h){u[h]==="ph"&&(u[h]=l[h])});var f=Ki(u,s);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===Zy&&this._size.reverse()},e.prototype._positionGroup=function(){var r=this.group,i=this._location,n=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(n===Xo&&!o?{scaleY:l?1:-1,scaleX:1}:n===Xo&&o?{scaleY:l?1:-1,scaleX:-1}:n===Zy&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]);r.x=i.x-u.x,r.y=i.y-u.y,r.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var r=this.dataZoomModel,i=this._size,n=this._displayables.sliderGroup,a=r.get("brushSelect");n.add(new Wo({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new Wo({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:nt(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),n.add(o)},e.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var i=this._size,n=this._shadowSize||[],a=r.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,f=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||i[0]!==n[0]||i[1]!==n[1]){var h=o.getDataExtent(l),v=(h[1]-h[0])*.3;h=[h[0]-v,h[1]+v];var c=[0,i[1]],d=[0,i[0]],p=[[i[0],0],[0,0]],g=[],m=d[1]/(o.count()-1),_=0,y=Math.round(o.count()/i[0]),x;o.each([l],function(A,M){if(y>0&&M%y){_+=m;return}var E=A==null||isNaN(A)||A==="",D=E?0:te(A,h,c,!0);E&&!x&&M?(p.push([p[p.length-1][0],0]),g.push([g[g.length-1][0],0])):!E&&x&&(p.push([_,0]),g.push([_,0])),p.push([_,D]),g.push([_,D]),_+=m,x=E}),u=this._shadowPolygonPts=p,f=this._shadowPolylinePts=g}this._shadowData=o,this._shadowDim=l,this._shadowSize=[i[0],i[1]];var S=this.dataZoomModel;function T(A){var M=S.getModel(A?"selectedDataBackground":"dataBackground"),E=new ee,D=new Gs({shape:{points:u},segmentIgnoreThreshold:1,style:M.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),R=new Ws({shape:{points:f},segmentIgnoreThreshold:1,style:M.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return E.add(D),E.add(R),E}for(var w=0;w<3;w++){var b=T(w===1);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}},e.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,i=r.get("showDataShadow");if(i!==!1){var n,a=this.ecModel;return r.eachTargetAxis(function(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();C(l,function(u){if(!n&&!(i!==!0&&bt(e5,u.get("type"))<0)){var f=a.getComponent(Vi(o),s).axis,h=n5(o),v,c=u.coordinateSystem;h!=null&&c.getOtherAxis&&(v=c.getOtherAxis(f).inverse),h=u.getData().mapDimension(h),n={thisAxis:f,series:u,thisDim:o,otherDim:h,otherAxisInverse:v}}},this)},this),n}},e.prototype._renderHandle=function(){var r=this.group,i=this._displayables,n=i.handles=[null,null],a=i.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,f=l.get("borderRadius")||0,h=l.get("brushSelect"),v=i.filler=new Wo({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(v),o.add(new Wo({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:f},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:QF,fill:"rgba(0,0,0,0)"}})),C([0,1],function(y){var x=l.get("handleIcon");!Wu[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var S=Br(x,-1,0,2,2,null,!0);S.attr({cursor:qy(this._orient),draggable:!0,drift:nt(this._onDragMove,this,y),ondragend:nt(this._onDragEnd,this),onmouseover:nt(this._showDataInfo,this,!0),onmouseout:nt(this._showDataInfo,this,!1),z2:5});var T=S.getBoundingRect(),w=l.get("handleSize");this._handleHeight=se(w,this._size[1]),this._handleWidth=T.width/T.height*this._handleHeight,S.setStyle(l.getModel("handleStyle").getItemStyle()),S.style.strokeNoScale=!0,S.rectHover=!0,S.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Nu(S);var b=l.get("handleColor");b!=null&&(S.style.fill=b),o.add(n[y]=S);var A=l.getModel("textStyle");r.add(a[y]=new Xt({silent:!0,invisible:!0,style:qe(A,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:A.getTextColor(),font:A.getFont()}),z2:10}))},this);var c=v;if(h){var d=se(l.get("moveHandleSize"),s[1]),p=i.moveHandle=new Kt({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:d}}),g=d*.8,m=i.moveHandleIcon=Br(l.get("moveHandleIcon"),-g/2,-g/2,g,g,"#fff",!0);m.silent=!0,m.y=s[1]+d/2-.5,p.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(d,10));c=i.moveZone=new Kt({invisible:!0,shape:{y:s[1]-_,height:d+_}}),c.on("mouseover",function(){u.enterEmphasis(p)}).on("mouseout",function(){u.leaveEmphasis(p)}),o.add(p),o.add(m),o.add(c)}c.attr({draggable:!0,cursor:qy(this._orient),drift:nt(this._onDragMove,this,"all"),ondragstart:nt(this._showDataInfo,this,!0),ondragend:nt(this._onDragEnd,this),onmouseover:nt(this._showDataInfo,this,!0),onmouseout:nt(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[te(r[0],[0,100],i,!0),te(r[1],[0,100],i,!0)]},e.prototype._updateInterval=function(r,i){var n=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=n.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];qs(i,a,o,n.get("zoomLock")?"all":r,s.minSpan!=null?te(s.minSpan,l,o,!0):null,s.maxSpan!=null?te(s.maxSpan,l,o,!0):null);var u=this._range,f=this._range=On([te(a[0],o,l,!0),te(a[1],o,l,!0)]);return!u||u[0]!==f[0]||u[1]!==f[1]},e.prototype._updateView=function(r){var i=this._displayables,n=this._handleEnds,a=On(n.slice()),o=this._size;C([0,1],function(c){var d=i.handles[c],p=this._handleHeight;d.attr({scaleX:p/2,scaleY:p/2,x:n[c]+(c?-1:1),y:o[1]/2-p/2})},this),i.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};i.moveHandle&&(i.moveHandle.setShape(s),i.moveZone.setShape(s),i.moveZone.getBoundingRect(),i.moveHandleIcon&&i.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=i.dataShadowSegs,u=[0,a[0],a[1],o[0]],f=0;f<l.length;f++){var h=l[f],v=h.getClipPath();v||(v=new Kt,h.setClipPath(v)),v.setShape({x:u[f],y:0,width:u[f+1]-u[f],height:o[1]})}this._updateDataInfo(r)},e.prototype._updateDataInfo=function(r){var i=this.dataZoomModel,n=this._displayables,a=n.handleLabels,o=this._orient,s=["",""];if(i.get("showDetail")){var l=i.findRepresentativeAxisProxy();if(l){var u=l.getAxisModel().axis,f=this._range,h=r?l.calculateDataWindow({start:f[0],end:f[1]}).valueWindow:l.getDataValueWindow();s=[this._formatLabel(h[0],u),this._formatLabel(h[1],u)]}}var v=On(this._handleEnds.slice());c.call(this,0),c.call(this,1);function c(d){var p=us(n.handles[d].parent,this.group),g=ip(d===0?"right":"left",p),m=this._handleWidth/2+t5,_=Wi([v[d]+(d===0?-m:m),this._size[1]/2],p);a[d].setStyle({x:_[0],y:_[1],verticalAlign:o===Xo?"middle":g,align:o===Xo?g:"center",text:s[d]})}},e.prototype._formatLabel=function(r,i){var n=this.dataZoomModel,a=n.get("labelFormatter"),o=n.get("labelPrecision");(o==null||o==="auto")&&(o=i.getPixelPrecision());var s=r==null||isNaN(r)?"":i.type==="category"||i.type==="time"?i.scale.getLabel({value:Math.round(r)}):r.toFixed(Math.min(o,20));return ct(a)?a(r,s):Q(a)?a.replace("{value}",s):s},e.prototype._showDataInfo=function(r){r=this._dragging||r;var i=this._displayables,n=i.handleLabels;n[0].attr("invisible",!r),n[1].attr("invisible",!r),i.moveHandle&&this.api[r?"enterEmphasis":"leaveEmphasis"](i.moveHandle,1)},e.prototype._onDragMove=function(r,i,n,a){this._dragging=!0,gi(a.event);var o=this._displayables.sliderGroup.getLocalTransform(),s=Wi([i,n],o,!0),l=this._updateInterval(r,s[0]),u=this.dataZoomModel.get("realtime");this._updateView(!u),l&&u&&this._dispatchZoomAction(!0)},e.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1);var r=this.dataZoomModel.get("realtime");!r&&this._dispatchZoomAction(!1)},e.prototype._onClickPanel=function(r){var i=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(r.offsetX,r.offsetY);if(!(n[0]<0||n[0]>i[0]||n[1]<0||n[1]>i[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",n[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(r){var i=r.offsetX,n=r.offsetY;this._brushStart=new yt(i,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(r){if(this._brushing){var i=this._displayables.brushRect;if(this._brushing=!1,!!i){i.attr("ignore",!0);var n=i.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(n.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=On([te(n.x,o,s,!0),te(n.x+n.width,o,s,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(gi(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},e.prototype._updateBrushRect=function(r,i){var n=this._displayables,a=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new Wo({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,i),f=l.transformCoordToLocal(s.x,s.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:f[0],y:0,width:u[0]-f[0],height:h[1]})},e.prototype._dispatchZoomAction=function(r){var i=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?r5:null,start:i[0],end:i[1]})},e.prototype._findCoordRect=function(){var r,i=n2(this.dataZoomModel).infoList;if(!r&&i.length){var n=i[0].model.coordinateSystem;r=n.getRect&&n.getRect()}if(!r){var a=this.api.getWidth(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},e.type="dataZoom.slider",e}(a2);function n5(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function qy(t){return t==="vertical"?"ns-resize":"ew-resize"}function a5(t){t.registerComponentModel(jF),t.registerComponentView(i5),o2(t)}function o5(t){Qe(KF),Qe(a5)}var p2={get:function(t,e,r){var i=ut((s5[t]||{})[e]);return r&&j(i)?i[i.length-1]:i}},s5={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},$y=Me.mapVisual,l5=Me.eachVisual,u5=j,Ky=C,f5=On,h5=te,sf=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return e.prototype.init=function(r,i,n){this.mergeDefaultAndTheme(r,n)},e.prototype.optionUpdated=function(r,i){var n=this.option;!i&&DF(n,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(r){var i=this.stateList;r=nt(r,this),this.controllerVisuals=Hy(this.option.controller,i,r),this.targetVisuals=Hy(this.option.target,i,r)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var r=this.option.seriesIndex,i=[];return r==null||r==="all"?this.ecModel.eachSeries(function(n,a){i.push(a)}):i=ue(r),i},e.prototype.eachTargetSeries=function(r,i){C(this.getTargetSeriesIndices(),function(n){var a=this.ecModel.getSeriesByIndex(n);a&&r.call(i,a)},this)},e.prototype.isTargetSeries=function(r){var i=!1;return this.eachTargetSeries(function(n){n===r&&(i=!0)}),i},e.prototype.formatValueText=function(r,i,n){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;n=n||["<",">"],j(r)&&(r=r.slice(),u=!0);var f=i?r:u?[h(r[0]),h(r[1])]:h(r);if(Q(l))return l.replace("{value}",u?f[0]:f).replace("{value2}",u?f[1]:f);if(ct(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===s[0]?n[0]+" "+f[1]:r[1]===s[1]?n[1]+" "+f[0]:f[0]+" - "+f[1];return f;function h(v){return v===s[0]?"min":v===s[1]?"max":(+v).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var r=this.option,i=f5([r.min,r.max]);this._dataExtent=i},e.prototype.getDataDimensionIndex=function(r){var i=this.option.dimension;if(i!=null)return r.getDimensionIndex(i);for(var n=r.dimensions,a=n.length-1;a>=0;a--){var o=n[a],s=r.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var r=this.ecModel,i=this.option,n={inRange:i.inRange,outOfRange:i.outOfRange},a=i.target||(i.target={}),o=i.controller||(i.controller={});dt(a,n),dt(o,n);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),f.call(this,o);function l(h){u5(i.color)&&!h.inRange&&(h.inRange={color:i.color.slice().reverse()}),h.inRange=h.inRange||{color:r.get("gradientColor")}}function u(h,v,c){var d=h[v],p=h[c];d&&!p&&(p=h[c]={},Ky(d,function(g,m){if(Me.isValidType(m)){var _=p2.get(m,"inactive",s);_!=null&&(p[m]=_,m==="color"&&!p.hasOwnProperty("opacity")&&!p.hasOwnProperty("colorAlpha")&&(p.opacity=[0,0]))}}))}function f(h){var v=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,c=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,d=this.get("inactiveColor"),p=this.getItemSymbol(),g=p||"roundRect";Ky(this.stateList,function(m){var _=this.itemSize,y=h[m];y||(y=h[m]={color:s?d:[d]}),y.symbol==null&&(y.symbol=v&&ut(v)||(s?g:[g])),y.symbolSize==null&&(y.symbolSize=c&&ut(c)||(s?_[0]:[_[0],_[0]])),y.symbol=$y(y.symbol,function(T){return T==="none"?g:T});var x=y.symbolSize;if(x!=null){var S=-1/0;l5(x,function(T){T>S&&(S=T)}),y.symbolSize=$y(x,function(T){return h5(T,[0,S],[0,_[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(r){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(r){return null},e.prototype.getVisualMeta=function(r){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Rt),jy=[20,140],c5=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.optionUpdated=function(r,i){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(n){n.mappingMethod="linear",n.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=jy[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=jy[1])},e.prototype._resetRange=function(){var r=this.getExtent(),i=this.option.range;!i||i.auto?(r.auto=1,this.option.range=r):j(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],r[0]),i[1]=Math.min(i[1],r[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),C(this.stateList,function(r){var i=this.option.controller[r].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},e.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},e.prototype.getSelected=function(){var r=this.getExtent(),i=On((this.get("range")||[]).slice());return i[0]>r[1]&&(i[0]=r[1]),i[1]>r[1]&&(i[1]=r[1]),i[0]<r[0]&&(i[0]=r[0]),i[1]<r[0]&&(i[1]=r[0]),i},e.prototype.getValueState=function(r){var i=this.option.range,n=this.getExtent();return(i[0]<=n[0]||i[0]<=r)&&(i[1]>=n[1]||r<=i[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var i=[];return this.eachTargetSeries(function(n){var a=[],o=n.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),i.push({seriesId:n.id,dataIndex:a})},this),i},e.prototype.getVisualMeta=function(r){var i=Qy(this,"outOfRange",this.getExtent()),n=Qy(this,"inRange",this.option.range.slice()),a=[];function o(c,d){a.push({value:c,color:r(c,d)})}for(var s=0,l=0,u=n.length,f=i.length;l<f&&(!n.length||i[l]<=n[0]);l++)i[l]<n[s]&&o(i[l],"outOfRange");for(var h=1;s<u;s++,h=0)h&&a.length&&o(n[s],"outOfRange"),o(n[s],"inRange");for(var h=1;l<f;l++)(!n.length||n[n.length-1]<i[l])&&(h&&(a.length&&o(a[a.length-1].value,"outOfRange"),h=0),o(i[l],"outOfRange"));var v=a.length;return{stops:a,outerColors:[v?a[0].color:"transparent",v?a[v-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=Xs(sf.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(sf);function Qy(t,e,r){if(r[0]===r[1])return r.slice();for(var i=200,n=(r[1]-r[0])/i,a=r[0],o=[],s=0;s<=i&&a<r[1];s++)o.push(a),a+=n;return o.push(r[1]),o}var g2=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.autoPositionValues={left:1,right:1,top:1,bottom:1},r}return e.prototype.init=function(r,i){this.ecModel=r,this.api=i},e.prototype.render=function(r,i,n,a){if(this.visualMapModel=r,r.get("show")===!1){this.group.removeAll();return}this.doRender(r,i,n,a)},e.prototype.renderBackground=function(r){var i=this.visualMapModel,n=Ys(i.get("padding")||0),a=r.getBoundingRect();r.add(new Kt({z2:-1,silent:!0,shape:{x:a.x-n[3],y:a.y-n[0],width:a.width+n[3]+n[1],height:a.height+n[0]+n[2]},style:{fill:i.get("backgroundColor"),stroke:i.get("borderColor"),lineWidth:i.get("borderWidth")}}))},e.prototype.getControllerVisual=function(r,i,n){n=n||{};var a=n.forceState,o=this.visualMapModel,s={};if(i==="color"){var l=o.get("contentColor");s.color=l}function u(c){return s[c]}function f(c,d){s[c]=d}var h=o.controllerVisuals[a||o.getValueState(r)],v=Me.prepareVisualTypes(h);return C(v,function(c){var d=h[c];n.convertOpacityToAlpha&&c==="opacity"&&(c="colorAlpha",d=h.__alphaForOpacity),Me.dependsOn(c,i)&&d&&d.applyVisual(r,u,f)}),s[i]},e.prototype.positionGroup=function(r){var i=this.visualMapModel,n=this.api;fT(r,i.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},e.prototype.doRender=function(r,i,n,a){},e.type="visualMap",e}(ze),Jy=[["left","right","width"],["top","bottom","height"]];function m2(t,e,r){var i=t.option,n=i.align;if(n!=null&&n!=="auto")return n;for(var a={width:e.getWidth(),height:e.getHeight()},o=i.orient==="horizontal"?1:0,s=Jy[o],l=[0,null,10],u={},f=0;f<3;f++)u[Jy[1-o][f]]=l[f],u[s[f]]=f===2?r[0]:i[s[f]];var h=[["x","width",3],["y","height",0]][o],v=Ki(u,a,i.padding);return s[(v.margin[h[2]]||0)+v[h[0]]+v[h[1]]*.5<a[h[1]]*.5?0:1]}function _u(t,e){return C(t||[],function(r){r.dataIndex!=null&&(r.dataIndexInside=r.dataIndex,r.dataIndex=null),r.highlightKey="visualMap"+(e?e.componentIndex:"")}),t}var Zr=te,v5=C,t1=Math.min,Qc=Math.max,d5=12,p5=6,g5=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._shapes={},r._dataInterval=[],r._handleEnds=[],r._hoverLinkDataIndices=[],r}return e.prototype.init=function(r,i){t.prototype.init.call(this,r,i),this._hoverLinkFromSeriesMouseOver=nt(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=nt(this._hideIndicator,this)},e.prototype.doRender=function(r,i,n,a){(!a||a.type!=="selectDataRange"||a.from!==this.uid)&&this._buildView()},e.prototype._buildView=function(){this.group.removeAll();var r=this.visualMapModel,i=this.group;this._orient=r.get("orient"),this._useHandle=r.get("calculable"),this._resetInterval(),this._renderBar(i);var n=r.get("text");this._renderEndsText(i,n,0),this._renderEndsText(i,n,1),this._updateView(!0),this.renderBackground(i),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(i)},e.prototype._renderEndsText=function(r,i,n){if(i){var a=i[1-n];a=a!=null?a+"":"";var o=this.visualMapModel,s=o.get("textGap"),l=o.itemSize,u=this._shapes.mainGroup,f=this._applyTransform([l[0]/2,n===0?-s:l[1]+s],u),h=this._applyTransform(n===0?"bottom":"top",u),v=this._orient,c=this.visualMapModel.textStyleModel;this.group.add(new Xt({style:qe(c,{x:f[0],y:f[1],verticalAlign:v==="horizontal"?"middle":h,align:v==="horizontal"?h:"center",text:a})}))}},e.prototype._renderBar=function(r){var i=this.visualMapModel,n=this._shapes,a=i.itemSize,o=this._orient,s=this._useHandle,l=m2(i,this.api,a),u=n.mainGroup=this._createBarGroup(l),f=new ee;u.add(f),f.add(n.outOfRange=e1()),f.add(n.inRange=e1(null,s?i1(this._orient):null,nt(this._dragHandle,this,"all",!1),nt(this._dragHandle,this,"all",!0))),f.setClipPath(new Kt({shape:{x:0,y:0,width:a[0],height:a[1],r:3}}));var h=i.textStyleModel.getTextRect("国"),v=Qc(h.width,h.height);s&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(i,u,0,a,v,o),this._createHandle(i,u,1,a,v,o)),this._createIndicator(i,u,a,v,o),r.add(u)},e.prototype._createHandle=function(r,i,n,a,o,s){var l=nt(this._dragHandle,this,n,!1),u=nt(this._dragHandle,this,n,!0),f=mi(r.get("handleSize"),a[0]),h=Br(r.get("handleIcon"),-f/2,-f/2,f,f,null,!0),v=i1(this._orient);h.attr({cursor:v,draggable:!0,drift:l,ondragend:u,onmousemove:function(m){gi(m.event)}}),h.x=a[0]/2,h.useStyle(r.getModel("handleStyle").getItemStyle()),h.setStyle({strokeNoScale:!0,strokeFirst:!0}),h.style.lineWidth*=2,h.ensureState("emphasis").style=r.getModel(["emphasis","handleStyle"]).getItemStyle(),$d(h,!0),i.add(h);var c=this.visualMapModel.textStyleModel,d=new Xt({cursor:v,draggable:!0,drift:l,onmousemove:function(m){gi(m.event)},ondragend:u,style:qe(c,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var p=[f,0],g=this._shapes;g.handleThumbs[n]=h,g.handleLabelPoints[n]=p,g.handleLabels[n]=d},e.prototype._createIndicator=function(r,i,n,a,o){var s=mi(r.get("indicatorSize"),n[0]),l=Br(r.get("indicatorIcon"),-s/2,-s/2,s,s,null,!0);l.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var u=r.getModel("indicatorStyle").getItemStyle();if(l instanceof ir){var f=l.style;l.useStyle(Y({image:f.image,x:f.x,y:f.y,width:f.width,height:f.height},u))}else l.useStyle(u);i.add(l);var h=this.visualMapModel.textStyleModel,v=new Xt({silent:!0,invisible:!0,style:qe(h,{x:0,y:0,text:""})});this.group.add(v);var c=[(o==="horizontal"?a/2:p5)+n[0]/2,0],d=this._shapes;d.indicator=l,d.indicatorLabel=v,d.indicatorLabelPoint=c,this._firstShowIndicator=!0},e.prototype._dragHandle=function(r,i,n,a){if(this._useHandle){if(this._dragging=!i,!i){var o=this._applyTransform([n,a],this._shapes.mainGroup,!0);this._updateInterval(r,o[1]),this._hideIndicator(),this._updateView()}i===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),i?!this._hovering&&this._clearHoverLinkToSeries():r1(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[r],!1)}},e.prototype._resetInterval=function(){var r=this.visualMapModel,i=this._dataInterval=r.getSelected(),n=r.getExtent(),a=[0,r.itemSize[1]];this._handleEnds=[Zr(i[0],n,a,!0),Zr(i[1],n,a,!0)]},e.prototype._updateInterval=function(r,i){i=i||0;var n=this.visualMapModel,a=this._handleEnds,o=[0,n.itemSize[1]];qs(i,a,o,r,0);var s=n.getExtent();this._dataInterval=[Zr(a[0],o,s,!0),Zr(a[1],o,s,!0)]},e.prototype._updateView=function(r){var i=this.visualMapModel,n=i.getExtent(),a=this._shapes,o=[0,i.itemSize[1]],s=r?o:this._handleEnds,l=this._createBarVisual(this._dataInterval,n,s,"inRange"),u=this._createBarVisual(n,n,o,"outOfRange");a.inRange.setStyle({fill:l.barColor}).setShape("points",l.barPoints),a.outOfRange.setStyle({fill:u.barColor}).setShape("points",u.barPoints),this._updateHandle(s,l)},e.prototype._createBarVisual=function(r,i,n,a){var o={forceState:a,convertOpacityToAlpha:!0},s=this._makeColorGradient(r,o),l=[this.getControllerVisual(r[0],"symbolSize",o),this.getControllerVisual(r[1],"symbolSize",o)],u=this._createBarPoints(n,l);return{barColor:new Jd(0,0,0,1,s),barPoints:u,handlesColor:[s[0].color,s[s.length-1].color]}},e.prototype._makeColorGradient=function(r,i){var n=100,a=[],o=(r[1]-r[0])/n;a.push({color:this.getControllerVisual(r[0],"color",i),offset:0});for(var s=1;s<n;s++){var l=r[0]+o*s;if(l>r[1])break;a.push({color:this.getControllerVisual(l,"color",i),offset:s/n})}return a.push({color:this.getControllerVisual(r[1],"color",i),offset:1}),a},e.prototype._createBarPoints=function(r,i){var n=this.visualMapModel.itemSize;return[[n[0]-i[0],r[0]],[n[0],r[0]],[n[0],r[1]],[n[0]-i[1],r[1]]]},e.prototype._createBarGroup=function(r){var i=this._orient,n=this.visualMapModel.get("inverse");return new ee(i==="horizontal"&&!n?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&n?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!n?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},e.prototype._updateHandle=function(r,i){if(this._useHandle){var n=this._shapes,a=this.visualMapModel,o=n.handleThumbs,s=n.handleLabels,l=a.itemSize,u=a.getExtent();v5([0,1],function(f){var h=o[f];h.setStyle("fill",i.handlesColor[f]),h.y=r[f];var v=Zr(r[f],[0,l[1]],u,!0),c=this.getControllerVisual(v,"symbolSize");h.scaleX=h.scaleY=c/l[0],h.x=l[0]-c/2;var d=Wi(n.handleLabelPoints[f],us(h,this.group));s[f].setStyle({x:d[0],y:d[1],text:a.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",n.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(r,i,n,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],f=this._shapes,h=f.indicator;if(h){h.attr("invisible",!1);var v={convertOpacityToAlpha:!0},c=this.getControllerVisual(r,"color",v),d=this.getControllerVisual(r,"symbolSize"),p=Zr(r,s,u,!0),g=l[0]-d/2,m={x:h.x,y:h.y};h.y=p,h.x=g;var _=Wi(f.indicatorLabelPoint,us(h,this.group)),y=f.indicatorLabel;y.attr("invisible",!1);var x=this._applyTransform("left",f.mainGroup),S=this._orient,T=S==="horizontal";y.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:T?x:"middle",align:T?"center":x});var w={x:g,y:p,style:{fill:c}},b={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var A={duration:100,easing:"cubicInOut",additive:!0};h.x=m.x,h.y=m.y,h.animateTo(w,A),y.animateTo(b,A)}else h.attr(w),y.attr(b);this._firstShowIndicator=!1;var M=this._shapes.handleLabels;if(M)for(var E=0;E<M.length;E++)this.api.enterBlur(M[E])}},e.prototype._enableHoverLinkToSeries=function(){var r=this;this._shapes.mainGroup.on("mousemove",function(i){if(r._hovering=!0,!r._dragging){var n=r.visualMapModel.itemSize,a=r._applyTransform([i.offsetX,i.offsetY],r._shapes.mainGroup,!0,!0);a[1]=t1(Qc(0,a[1]),n[1]),r._doHoverLinkToSeries(a[1],0<=a[0]&&a[0]<=n[0])}}).on("mouseout",function(){r._hovering=!1,!r._dragging&&r._clearHoverLinkToSeries()})},e.prototype._enableHoverLinkFromSeries=function(){var r=this.api.getZr();this.visualMapModel.option.hoverLink?(r.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),r.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},e.prototype._doHoverLinkToSeries=function(r,i){var n=this.visualMapModel,a=n.itemSize;if(n.option.hoverLink){var o=[0,a[1]],s=n.getExtent();r=t1(Qc(o[0],r),o[1]);var l=m5(n,s,o),u=[r-l,r+l],f=Zr(r,o,s,!0),h=[Zr(u[0],o,s,!0),Zr(u[1],o,s,!0)];u[0]<o[0]&&(h[0]=-1/0),u[1]>o[1]&&(h[1]=1/0),i&&(h[0]===-1/0?this._showIndicator(f,h[1],"< ",l):h[1]===1/0?this._showIndicator(f,h[0],"> ",l):this._showIndicator(f,f,"≈ ",l));var v=this._hoverLinkDataIndices,c=[];(i||r1(n))&&(c=this._hoverLinkDataIndices=n.findTargetDataIndices(h));var d=GA(v,c);this._dispatchHighDown("downplay",_u(d[0],n)),this._dispatchHighDown("highlight",_u(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var i;if(Ba(r.target,function(l){var u=Mt(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var n=this.ecModel.getSeriesByIndex(i.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(n)){var o=n.getData(i.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var n=0;n<i.length;n++)this.api.leaveBlur(i[n])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var r=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",_u(r,this.visualMapModel)),r.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var r=this.api.getZr();r.off("mouseover",this._hoverLinkFromSeriesMouseOver),r.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(r,i,n,a){var o=us(i,a?null:this.group);return j(r)?Wi(r,o,n):ip(r,o,n)},e.prototype._dispatchHighDown=function(r,i){i&&i.length&&this.api.dispatchAction({type:r,batch:i})},e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(g2);function e1(t,e,r,i){return new Gs({shape:{points:t},draggable:!!r,cursor:e,drift:r,onmousemove:function(n){gi(n.event)},ondragend:i})}function m5(t,e,r){var i=d5/2,n=t.get("hoverLinkDataSize");return n&&(i=Zr(n,e,r,!0)/2),i}function r1(t){var e=t.get("hoverLinkOnHandle");return!!(e??t.get("realtime"))}function i1(t){return t==="vertical"?"ns-resize":"ew-resize"}var _5={type:"selectDataRange",event:"dataRangeSelected",update:"update"},y5=function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(r){r.setSelected(t.selected)})},x5=[{createOnAllSeries:!0,reset:function(t,e){var r=[];return e.eachComponent("visualMap",function(i){var n=t.pipelineContext;!i.isTargetSeries(t)||n&&n.large||r.push(LF(i.stateList,i.targetVisuals,nt(i.getValueState,i),i.getDataDimensionIndex(t.getData())))}),r}},{createOnAllSeries:!0,reset:function(t,e){var r=t.getData(),i=[];e.eachComponent("visualMap",function(n){if(n.isTargetSeries(t)){var a=n.getVisualMeta(nt(T5,null,t,n))||{stops:[],outerColors:[]},o=n.getDataDimensionIndex(r);o>=0&&(a.dimension=o,i.push(a))}}),t.getData().setVisual("visualMeta",i)}}];function T5(t,e,r,i){for(var n=e.targetVisuals[i],a=Me.prepareVisualTypes(n),o={color:qT(t.getData(),"color")},s=0,l=a.length;s<l;s++){var u=a[s],f=n[u==="opacity"?"__alphaForOpacity":u];f&&f.applyVisual(r,h,v)}return o.color;function h(c){return o[c]}function v(c,d){o[c]=d}}var n1=C;function S5(t){var e=t&&t.visualMap;j(e)||(e=e?[e]:[]),n1(e,function(r){if(r){Ea(r,"splitList")&&!Ea(r,"pieces")&&(r.pieces=r.splitList,delete r.splitList);var i=r.pieces;i&&j(i)&&n1(i,function(n){rt(n)&&(Ea(n,"start")&&!Ea(n,"min")&&(n.min=n.start),Ea(n,"end")&&!Ea(n,"max")&&(n.max=n.end))})}})}function Ea(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var a1=!1;function _2(t){a1||(a1=!0,t.registerSubTypeDefaulter("visualMap",function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(_5,y5),C(x5,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(S5))}function w5(t){t.registerComponentModel(c5),t.registerComponentView(g5),_2(t)}var b5=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._pieceList=[],r}return e.prototype.optionUpdated=function(r,i){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],A5[this._mode].call(this,this._pieceList),this._resetSelected(r,i);var a=this.option.categories;this.resetVisual(function(o,s){n==="categories"?(o.mappingMethod="category",o.categories=ut(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=tt(this._pieceList,function(l){return l=ut(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var r=this.option,i={},n=Me.listVisualTypes(),a=this.isCategory();C(r.pieces,function(s){C(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),C(i,function(s,l){var u=!1;C(this.stateList,function(f){u=u||o(r,f,l)||o(r.target,f,l)},this),!u&&C(this.stateList,function(f){(r[f]||(r[f]={}))[l]=p2.get(l,f==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(r,i){var n=this.option,a=this._pieceList,o=(i?n:r).selected||{};if(n.selected=o,C(a,function(l,u){var f=this.getSelectedMapKey(l);o.hasOwnProperty(f)||(o[f]=!0)},this),n.selectedMode==="single"){var s=!1;C(a,function(l,u){var f=this.getSelectedMapKey(l);o[f]&&(s?o[f]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(r){this.option.selected=ut(r)},e.prototype.getValueState=function(r){var i=Me.findPieceIndex(r,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var i=[],n=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var f=Me.findPieceIndex(l,n);f===r&&o.push(u)},this),i.push({seriesId:a.id,dataIndex:o})},this),i},e.prototype.getRepresentValue=function(r){var i;if(this.isCategory())i=r.value;else if(r.value!=null)i=r.value;else{var n=r.interval||[];i=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return i},e.prototype.getVisualMeta=function(r){if(this.isCategory())return;var i=[],n=["",""],a=this;function o(f,h){var v=a.getRepresentValue({interval:f});h||(h=a.getValueState(v));var c=r(v,h);f[0]===-1/0?n[0]=c:f[1]===1/0?n[1]=c:i.push({value:f[0],color:c},{value:f[1],color:c})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return C(s,function(f){var h=f.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:i,outerColors:n}},e.type="visualMap.piecewise",e.defaultOption=Xs(sf.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(sf),A5={splitNumber:function(t){var e=this.option,r=Math.min(e.precision,20),i=this.getExtent(),n=e.splitNumber;n=Math.max(parseInt(n,10),1),e.splitNumber=n;for(var a=(i[1]-i[0])/n;+a.toFixed(r)!==a&&r<5;)r++;e.precision=r,a=+a.toFixed(r),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o<n;s+=a,o++){var l=o===n-1?i[1]:s+a;t.push({interval:[s,l],close:[1,1]})}e.maxOpen&&t.push({interval:[i[1],1/0],close:[0,0]}),Bg(t),C(t,function(u,f){u.index=f,u.text=this.formatValueText(u.interval)},this)},categories:function(t){var e=this.option;C(e.categories,function(r){t.push({text:this.formatValueText(r,!0),value:r})},this),o1(e,t)},pieces:function(t){var e=this.option;C(e.pieces,function(r,i){rt(r)||(r={value:r});var n={text:"",index:i};if(r.label!=null&&(n.text=r.label),r.hasOwnProperty("value")){var a=n.value=r.value;n.interval=[a,a],n.close=[1,1]}else{for(var o=n.interval=[],s=n.close=[0,0],l=[1,0,1],u=[-1/0,1/0],f=[],h=0;h<2;h++){for(var v=[["gte","gt","min"],["lte","lt","max"]][h],c=0;c<3&&o[h]==null;c++)o[h]=r[v[c]],s[h]=l[c],f[h]=c===2;o[h]==null&&(o[h]=u[h])}f[0]&&o[1]===1/0&&(s[0]=0),f[1]&&o[0]===-1/0&&(s[1]=0),o[0]===o[1]&&s[0]&&s[1]&&(n.value=o[0])}n.visual=Me.retrieveVisuals(r),t.push(n)},this),o1(e,t),Bg(t),C(t,function(r){var i=r.close,n=[["<","≤"][i[1]],[">","≥"][i[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,n)},this)}};function o1(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}var E5=function(t){K(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.doRender=function(){var r=this.group;r.removeAll();var i=this.visualMapModel,n=i.get("textGap"),a=i.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=i.itemSize,f=this._getViewData(),h=f.endsText,v=ja(i.get("showLabel",!0),!h);h&&this._renderEndsText(r,h[0],u,v,l),C(f.viewPieceList,function(c){var d=c.piece,p=new ee;p.onclick=nt(this._onItemClick,this,d),this._enableHoverLink(p,c.indexInModelPieceList);var g=i.getRepresentValue(d);if(this._createItemSymbol(p,g,[0,0,u[0],u[1]]),v){var m=this.visualMapModel.getValueState(g);p.add(new Xt({style:{x:l==="right"?-n:u[0]+n,y:u[1]/2,text:d.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:m==="outOfRange"?.5:1}}))}r.add(p)},this),h&&this._renderEndsText(r,h[1],u,v,l),$a(i.get("orient"),r,i.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},e.prototype._enableHoverLink=function(r,i){var n=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=n.visualMapModel;s.option.hoverLink&&n.api.dispatchAction({type:o,batch:_u(s.findTargetDataIndices(i),s)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,i=r.option;if(i.orient==="vertical")return m2(r,this.api,r.itemSize);var n=i.align;return(!n||n==="auto")&&(n="left"),n},e.prototype._renderEndsText=function(r,i,n,a,o){if(i){var s=new ee,l=this.visualMapModel.textStyleModel;s.add(new Xt({style:qe(l,{x:a?o==="right"?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:a?o:"center",text:i})})),r.add(s)}},e.prototype._getViewData=function(){var r=this.visualMapModel,i=tt(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),n=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?i.reverse():n&&(n=n.slice().reverse()),{viewPieceList:i,endsText:n}},e.prototype._createItemSymbol=function(r,i,n){r.add(Br(this.getControllerVisual(i,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(i,"color")))},e.prototype._onItemClick=function(r){var i=this.visualMapModel,n=i.option,a=n.selectedMode;if(a){var o=ut(n.selected),s=i.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,C(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(g2);function M5(t){t.registerComponentModel(b5),t.registerComponentView(E5),_2(t)}function C5(t){Qe(w5),Qe(M5)}var Jc=Math.sin,tv=Math.cos,y2=Math.PI,Ln=Math.PI*2,D5=180/y2,x2=function(){function t(){}return t.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},t.prototype.moveTo=function(e,r){this._add("M",e,r)},t.prototype.lineTo=function(e,r){this._add("L",e,r)},t.prototype.bezierCurveTo=function(e,r,i,n,a,o){this._add("C",e,r,i,n,a,o)},t.prototype.quadraticCurveTo=function(e,r,i,n){this._add("Q",e,r,i,n)},t.prototype.arc=function(e,r,i,n,a,o){this.ellipse(e,r,i,i,0,n,a,o)},t.prototype.ellipse=function(e,r,i,n,a,o,s,l){var u=s-o,f=!l,h=Math.abs(u),v=zi(h-Ln)||(f?u>=Ln:-u>=Ln),c=u>0?u%Ln:u%Ln+Ln,d=!1;v?d=!0:zi(h)?d=!1:d=c>=y2==!!f;var p=e+i*tv(o),g=r+n*Jc(o);this._start&&this._add("M",p,g);var m=Math.round(a*D5);if(v){var _=1/this._p,y=(f?1:-1)*(Ln-_);this._add("A",i,n,m,1,+f,e+i*tv(o+y),r+n*Jc(o+y)),_>.01&&this._add("A",i,n,m,0,+f,p,g)}else{var x=e+i*tv(s),S=r+n*Jc(s);this._add("A",i,n,m,+d,+f,x,S)}},t.prototype.rect=function(e,r,i,n){this._add("M",e,r),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(e,r,i,n,a,o,s,l,u){for(var f=[],h=this._p,v=1;v<arguments.length;v++){var c=arguments[v];if(isNaN(c)){this._invalid=!0;return}f.push(Math.round(c*h)/h)}this._d.push(e+f.join(" ")),this._start=e==="Z"},t.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},t.prototype.getStr=function(){return this._str},t}(),jp="none",L5=Math.round;function R5(t){var e=t.fill;return e!=null&&e!==jp}function P5(t){var e=t.stroke;return e!=null&&e!==jp}var bd=["lineCap","miterLimit","lineJoin"],I5=tt(bd,function(t){return"stroke-"+t.toLowerCase()});function N5(t,e,r,i){var n=e.opacity==null?1:e.opacity;if(r instanceof ir){t("opacity",n);return}if(R5(e)){var a=ys(e.fill);t("fill",a.color);var o=e.fillOpacity!=null?e.fillOpacity*a.opacity*n:a.opacity*n;o<1&&t("fill-opacity",o)}else t("fill",jp);if(P5(e)){var s=ys(e.stroke);t("stroke",s.color);var l=e.strokeNoScale?r.getLineScale():1,u=l?(e.lineWidth||0)/l:0,f=e.strokeOpacity!=null?e.strokeOpacity*s.opacity*n:s.opacity*n,h=e.strokeFirst;if(u!==1&&t("stroke-width",u),h&&t("paint-order",h?"stroke":"fill"),f<1&&t("stroke-opacity",f),e.lineDash){var v=xp(r),c=v[0],d=v[1];c&&(d=L5(d||0),t("stroke-dasharray",c.join(",")),(d||i)&&t("stroke-dashoffset",d))}for(var p=0;p<bd.length;p++){var g=bd[p];if(e[g]!==Lu[g]){var m=e[g]||Lu[g];m&&t(I5[p],m)}}}}var T2="http://www.w3.org/2000/svg",S2="http://www.w3.org/1999/xlink",O5="http://www.w3.org/2000/xmlns/",B5="http://www.w3.org/XML/1998/namespace",s1="ecmeta_";function w2(t){return document.createElementNS(T2,t)}function de(t,e,r,i,n){return{tag:t,attrs:r||{},children:i,text:n,key:e}}function F5(t,e){var r=[];if(e)for(var i in e){var n=e[i],a=i;n!==!1&&(n!==!0&&n!=null&&(a+='="'+n+'"'),r.push(a))}return"<"+t+" "+r.join(" ")+">"}function k5(t){return"</"+t+">"}function Qp(t,e){e=e||{};var r=e.newline?`
`:"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return F5(o,s)+(o!=="style"?_e(l):l||"")+(a?""+r+tt(a,function(u){return i(u)}).join(r)+r:"")+k5(o)}return i(t)}function z5(t,e,r){r=r||{};var i=r.newline?`
`:"",n=" {"+i,a=i+"}",o=tt(mt(t),function(l){return l+n+tt(mt(t[l]),function(u){return u+":"+t[l][u]+";"}).join(i)+a}).join(i),s=tt(mt(e),function(l){return"@keyframes "+l+n+tt(mt(e[l]),function(u){return u+n+tt(mt(e[l][u]),function(f){var h=e[l][u][f];return f==="d"&&(h='path("'+h+'")'),f+":"+h+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":["<![CDATA[",o,s,"]]>"].join(i)}function Ad(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function l1(t,e,r,i){return de("svg","root",{width:t,height:e,xmlns:T2,"xmlns:xlink":S2,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+t+" "+e:!1},r)}var U5=0;function b2(){return U5++}var u1={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Pn="transform-origin";function H5(t,e,r){var i=Y({},t.shape);Y(i,e),t.buildPath(r,i);var n=new x2;return n.reset(q1(t)),r.rebuildPath(n,1),n.generateStr(),n.getStr()}function V5(t,e){var r=e.originX,i=e.originY;(r||i)&&(t[Pn]=r+"px "+i+"px")}var G5={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function A2(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function W5(t,e,r){var i=t.shape.paths,n={},a,o;if(C(i,function(l){var u=Ad(r.zrId);u.animation=!0,Kf(l,{},u,!0);var f=u.cssAnims,h=u.cssNodes,v=mt(f),c=v.length;if(c){o=v[c-1];var d=f[o];for(var p in d){var g=d[p];n[p]=n[p]||{d:""},n[p].d+=g.d||""}for(var m in h){var _=h[m].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){e.d=!1;var s=A2(n,r);return a.replace(o,s)}}function f1(t){return Q(t)?u1[t]?"cubic-bezier("+u1[t]+")":Bd(t)?t:"":""}function Kf(t,e,r,i){var n=t.animators,a=n.length,o=[];if(t instanceof zx){var s=W5(t,e,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u<a;u++){var f=n[u],h=[f.getMaxTime()/1e3+"s"],v=f1(f.getClip().easing),c=f.getDelay();v?h.push(v):h.push("linear"),c&&h.push(c/1e3+"s"),f.getLoop()&&h.push("infinite");var d=h.join(" ");l[d]=l[d]||[d,[]],l[d][1].push(f)}function p(_){var y=_[1],x=y.length,S={},T={},w={},b="animation-timing-function";function A(Ht,Nt,wt){for(var et=Ht.getTracks(),xt=Ht.getMaxTime(),re=0;re<et.length;re++){var Vt=et[re];if(Vt.needsAnimate()){var Ce=Vt.keyframes,br=Vt.propName;if(wt&&(br=wt(br)),br)for(var jf=0;jf<Ce.length;jf++){var js=Ce[jf],Qs=Math.round(js.time/xt*100)+"%",ig=f1(js.easing),ng=js.rawValue;(Q(ng)||$t(ng))&&(Nt[Qs]=Nt[Qs]||{},Nt[Qs][br]=js.rawValue,ig&&(Nt[Qs][b]=ig))}}}}for(var M=0;M<x;M++){var E=y[M],D=E.targetName;D?D==="shape"&&A(E,T):!i&&A(E,S)}for(var R in S){var P={};J1(P,t),Y(P,S[R]);var I=$1(P),N=S[R][b];w[R]=I?{transform:I}:{},V5(w[R],P),N&&(w[R][b]=N)}var V,O=!0;for(var R in T){w[R]=w[R]||{};var X=!V,N=T[R][b];X&&(V=new _i);var G=V.len();V.reset(),w[R].d=H5(t,T[R],V);var lt=V.len();if(!X&&G!==lt){O=!1;break}N&&(w[R][b]=N)}if(!O)for(var R in w)delete w[R].d;if(!i)for(var M=0;M<x;M++){var E=y[M],D=E.targetName;D==="style"&&A(E,w,function(et){return G5[et]})}for(var J=mt(w),ot=!0,at,M=1;M<J.length;M++){var Dt=J[M-1],pt=J[M];if(w[Dt][Pn]!==w[pt][Pn]){ot=!1;break}at=w[Dt][Pn]}if(ot&&at){for(var R in w)w[R][Pn]&&delete w[R][Pn];e[Pn]=at}if(oe(J,function(Ht){return mt(w[Ht]).length>0}).length){var Ot=A2(w,r);return Ot+" "+_[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var m=r.zrId+"-cls-"+b2();r.cssNodes["."+m]={animation:o.join(",")},e.class=m}}function X5(t,e,r){if(!t.ignore)if(t.isSilent()){var i={"pointer-events":"none"};h1(i,e,r)}else{var n=t.states.emphasis&&t.states.emphasis.style?t.states.emphasis.style:{},a=n.fill;if(!a){var o=t.style&&t.style.fill,s=t.states.select&&t.states.select.style&&t.states.select.style.fill,l=t.currentStates.indexOf("select")>=0&&s||o;l&&(a=vv(l))}var u=n.lineWidth;if(u){var f=!n.strokeNoScale&&t.transform?t.transform[0]:1;u=u/f}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),h1(i,e,r)}}function h1(t,e,r,i){var n=JSON.stringify(t),a=r.cssStyleCache[n];a||(a=r.zrId+"-cls-"+b2(),r.cssStyleCache[n]=a,r.cssNodes["."+a+":hover"]=t),e.class=e.class?e.class+" "+a:a}var ks=Math.round;function E2(t){return t&&Q(t.src)}function M2(t){return t&&ct(t.toDataURL)}function Jp(t,e,r,i){N5(function(n,a){var o=n==="fill"||n==="stroke";o&&Z1(a)?D2(e,t,n,i):o&&Fd(a)?L2(r,t,n,i):o&&a==="none"?t[n]="transparent":t[n]=a},e,r,!1),Q5(r,t,i)}function tg(t,e){var r=EA(e);r&&(r.each(function(i,n){i!=null&&(t[(s1+n).toLowerCase()]=i+"")}),e.isSilent()&&(t[s1+"silent"]="true"))}function c1(t){return zi(t[0]-1)&&zi(t[1])&&zi(t[2])&&zi(t[3]-1)}function Y5(t){return zi(t[4])&&zi(t[5])}function eg(t,e,r){if(e&&!(Y5(e)&&c1(e))){var i=1e4;t.transform=c1(e)?"translate("+ks(e[4]*i)/i+" "+ks(e[5]*i)/i+")":qb(e)}}function v1(t,e,r){for(var i=t.points,n=[],a=0;a<i.length;a++)n.push(ks(i[a][0]*r)/r),n.push(ks(i[a][1]*r)/r);e.points=n.join(" ")}function d1(t){return!t.smooth}function Z5(t){var e=tt(t,function(r){return typeof r=="string"?[r,r]:r});return function(r,i,n){for(var a=0;a<e.length;a++){var o=e[a],s=r[o[0]];s!=null&&(i[o[1]]=ks(s*n)/n)}}}var q5={circle:[Z5(["cx","cy","r"])],polyline:[v1,d1],polygon:[v1,d1]};function $5(t){for(var e=t.animators,r=0;r<e.length;r++)if(e[r].targetName==="shape")return!0;return!1}function C2(t,e){var r=t.style,i=t.shape,n=q5[t.type],a={},o=e.animation,s="path",l=t.style.strokePercent,u=e.compress&&q1(t)||4;if(n&&!e.willUpdate&&!(n[1]&&!n[1](i))&&!(o&&$5(t))&&!(l<1)){s=t.type;var f=Math.pow(10,u);n[0](i,a,f)}else{var h=!t.path||t.shapeChanged();t.path||t.createPathProxy();var v=t.path;h&&(v.beginPath(),t.buildPath(v,t.shape),t.pathUpdated());var c=v.getVersion(),d=t,p=d.__svgPathBuilder;(d.__svgPathVersion!==c||!p||l!==d.__svgPathStrokePercent)&&(p||(p=d.__svgPathBuilder=new x2),p.reset(u),v.rebuildPath(p,l),p.generateStr(),d.__svgPathVersion=c,d.__svgPathStrokePercent=l),a.d=p.getStr()}return eg(a,t.transform),Jp(a,r,t,e),tg(a,t),e.animation&&Kf(t,a,e),e.emphasis&&X5(t,a,e),de(s,t.id+"",a)}function K5(t,e){var r=t.style,i=r.image;if(i&&!Q(i)&&(E2(i)?i=i.src:M2(i)&&(i=i.toDataURL())),!!i){var n=r.x||0,a=r.y||0,o=r.width,s=r.height,l={href:i,width:o,height:s};return n&&(l.x=n),a&&(l.y=a),eg(l,t.transform),Jp(l,r,t,e),tg(l,t),e.animation&&Kf(t,l,e),de("image",t.id+"",l)}}function j5(t,e){var r=t.style,i=r.text;if(i!=null&&(i+=""),!(!i||isNaN(r.x)||isNaN(r.y))){var n=r.font||Zi,a=r.x||0,o=Kb(r.y||0,gf(n),r.textBaseline),s=$b[r.textAlign]||r.textAlign,l={"dominant-baseline":"central","text-anchor":s};if(bx(r)){var u="",f=r.fontStyle,h=Sx(r.fontSize);if(!parseFloat(h))return;var v=r.fontFamily||w1,c=r.fontWeight;u+="font-size:"+h+";font-family:"+v+";",f&&f!=="normal"&&(u+="font-style:"+f+";"),c&&c!=="normal"&&(u+="font-weight:"+c+";"),l.style=u}else l.style="font: "+n;return i.match(/\s/)&&(l["xml:space"]="preserve"),a&&(l.x=a),o&&(l.y=o),eg(l,t.transform),Jp(l,r,t,e),tg(l,t),e.animation&&Kf(t,l,e),de("text",t.id+"",l,void 0,i)}}function p1(t,e){if(t instanceof kt)return C2(t,e);if(t instanceof ir)return K5(t,e);if(t instanceof Ss)return j5(t,e)}function Q5(t,e,r){var i=t.style;if(jb(i)){var n=Qb(t),a=r.shadowCache,o=a[n];if(!o){var s=t.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var f=i.shadowOffsetX||0,h=i.shadowOffsetY||0,v=i.shadowBlur,c=ys(i.shadowColor),d=c.opacity,p=c.color,g=v/2/l,m=v/2/u,_=g+" "+m;o=r.zrId+"-s"+r.shadowIdx++,r.defs[o]=de("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[de("feDropShadow","",{dx:f/l,dy:h/u,stdDeviation:_,"flood-color":p,"flood-opacity":d})]),a[n]=o}e.filter=vf(o)}}function D2(t,e,r,i){var n=t[r],a,o={gradientUnits:n.global?"userSpaceOnUse":"objectBoundingBox"};if(X1(n))a="linearGradient",o.x1=n.x,o.y1=n.y,o.x2=n.x2,o.y2=n.y2;else if(Y1(n))a="radialGradient",o.cx=ft(n.x,.5),o.cy=ft(n.y,.5),o.r=ft(n.r,.5);else return;for(var s=n.colorStops,l=[],u=0,f=s.length;u<f;++u){var h=dv(s[u].offset)*100+"%",v=s[u].color,c=ys(v),d=c.color,p=c.opacity,g={offset:h};g["stop-color"]=d,p<1&&(g["stop-opacity"]=p),l.push(de("stop",u+"",g))}var m=de(a,"",o,l),_=Qp(m),y=i.gradientCache,x=y[_];x||(x=i.zrId+"-g"+i.gradientIdx++,y[_]=x,o.id=x,i.defs[x]=de(a,x,o,l)),e[r]=vf(x)}function L2(t,e,r,i){var n=t.style[r],a=t.getBoundingRect(),o={},s=n.repeat,l=s==="no-repeat",u=s==="repeat-x",f=s==="repeat-y",h;if(W1(n)){var v=n.imageWidth,c=n.imageHeight,d=void 0,p=n.image;if(Q(p)?d=p:E2(p)?d=p.src:M2(p)&&(d=p.toDataURL()),typeof Image>"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";xr(v,g),xr(c,g)}else if(v==null||c==null){var m=function(M,E){if(M){var D=M.elm,R=v||E.width,P=c||E.height;M.tag==="pattern"&&(u?(P=1,R/=a.width):f&&(R=1,P/=a.height)),M.attrs.width=R,M.attrs.height=P,D&&(D.setAttribute("width",R),D.setAttribute("height",P))}},_=Wd(d,null,t,function(M){l||m(T,M),m(h,M)});_&&_.width&&_.height&&(v=v||_.width,c=c||_.height)}h=de("image","img",{href:d,width:v,height:c}),o.width=v,o.height=c}else n.svgElement&&(h=ut(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(h){var y,x;l?y=x=1:u?(x=1,y=o.width/a.width):f?(y=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",y!=null&&!isNaN(y)&&(o.width=y),x!=null&&!isNaN(x)&&(o.height=x);var S=$1(n);S&&(o.patternTransform=S);var T=de("pattern","",o,[h]),w=Qp(T),b=i.patternCache,A=b[w];A||(A=i.zrId+"-p"+i.patternIdx++,b[w]=A,o.id=A,T=i.defs[A]=de("pattern",A,o,[h])),e[r]=vf(A)}}function J5(t,e,r){var i=r.clipPathCache,n=r.defs,a=i[t.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};i[t.id]=a,n[a]=de("clipPath",a,o,[C2(t,r)])}e["clip-path"]=vf(a)}function g1(t){return document.createTextNode(t)}function Nn(t,e,r){t.insertBefore(e,r)}function m1(t,e){t.removeChild(e)}function _1(t,e){t.appendChild(e)}function R2(t){return t.parentNode}function P2(t){return t.nextSibling}function ev(t,e){t.textContent=e}var y1=58,t4=120,e4=de("","");function Ed(t){return t===void 0}function $r(t){return t!==void 0}function r4(t,e,r){for(var i={},n=e;n<=r;++n){var a=t[n].key;a!==void 0&&(i[a]=n)}return i}function es(t,e){var r=t.key===e.key,i=t.tag===e.tag;return i&&r}function zs(t){var e,r=t.children,i=t.tag;if($r(i)){var n=t.elm=w2(i);if(rg(e4,t),j(r))for(e=0;e<r.length;++e){var a=r[e];a!=null&&_1(n,zs(a))}else $r(t.text)&&!rt(t.text)&&_1(n,g1(t.text))}else t.elm=g1(t.text);return t.elm}function I2(t,e,r,i,n){for(;i<=n;++i){var a=r[i];a!=null&&Nn(t,zs(a),e)}}function lf(t,e,r,i){for(;r<=i;++r){var n=e[r];if(n!=null)if($r(n.tag)){var a=R2(n.elm);m1(a,n.elm)}else m1(t,n.elm)}}function rg(t,e){var r,i=e.elm,n=t&&t.attrs||{},a=e.attrs||{};if(n!==a){for(r in a){var o=a[r],s=n[r];s!==o&&(o===!0?i.setAttribute(r,""):o===!1?i.removeAttribute(r):r==="style"?i.style.cssText=o:r.charCodeAt(0)!==t4?i.setAttribute(r,o):r==="xmlns:xlink"||r==="xmlns"?i.setAttributeNS(O5,r,o):r.charCodeAt(3)===y1?i.setAttributeNS(B5,r,o):r.charCodeAt(5)===y1?i.setAttributeNS(S2,r,o):i.setAttribute(r,o))}for(r in n)r in a||i.removeAttribute(r)}}function i4(t,e,r){for(var i=0,n=0,a=e.length-1,o=e[0],s=e[a],l=r.length-1,u=r[0],f=r[l],h,v,c,d;i<=a&&n<=l;)o==null?o=e[++i]:s==null?s=e[--a]:u==null?u=r[++n]:f==null?f=r[--l]:es(o,u)?(Ra(o,u),o=e[++i],u=r[++n]):es(s,f)?(Ra(s,f),s=e[--a],f=r[--l]):es(o,f)?(Ra(o,f),Nn(t,o.elm,P2(s.elm)),o=e[++i],f=r[--l]):es(s,u)?(Ra(s,u),Nn(t,s.elm,o.elm),s=e[--a],u=r[++n]):(Ed(h)&&(h=r4(e,i,a)),v=h[u.key],Ed(v)?Nn(t,zs(u),o.elm):(c=e[v],c.tag!==u.tag?Nn(t,zs(u),o.elm):(Ra(c,u),e[v]=void 0,Nn(t,c.elm,o.elm))),u=r[++n]);(i<=a||n<=l)&&(i>a?(d=r[l+1]==null?null:r[l+1].elm,I2(t,d,r,n,l)):lf(t,e,i,a))}function Ra(t,e){var r=e.elm=t.elm,i=t.children,n=e.children;t!==e&&(rg(t,e),Ed(e.text)?$r(i)&&$r(n)?i!==n&&i4(r,i,n):$r(n)?($r(t.text)&&ev(r,""),I2(r,null,n,0,n.length-1)):$r(i)?lf(r,i,0,i.length-1):$r(t.text)&&ev(r,""):t.text!==e.text&&($r(i)&&lf(r,i,0,i.length-1),ev(r,e.text)))}function n4(t,e){if(es(t,e))Ra(t,e);else{var r=t.elm,i=R2(r);zs(e),i!==null&&(Nn(i,e.elm,P2(r)),lf(i,[t],0,0))}return e}var a4=0,o4=function(){function t(e,r,i){if(this.type="svg",this.refreshHover=x1(),this.configLayer=x1(),this.storage=r,this._opts=i=Y({},i),this.root=e,this._id="zr"+a4++,this._oldVNode=l1(i.width,i.height),e&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=w2("svg");rg(null,this._oldVNode),n.appendChild(a),e.appendChild(n)}this.resize(i.width,i.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",n4(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return p1(e,Ad(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=Ad(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis;var o=[],s=this._bgVNode=s4(i,n,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=de("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=tt(mt(a.defs),function(v){return a.defs[v]});if(u.length&&o.push(de("defs","defs",{},u)),e.animation){var f=z5(a.cssNodes,a.cssAnims,{newline:!0});if(f){var h=de("style","stl",{},[],f);o.push(h)}}return l1(i,n,o,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},Qp(this.renderToVNode({animation:ft(e.cssAnimation,!0),emphasis:ft(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:ft(e.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(e,r,i){for(var n=e.length,a=[],o=0,s,l,u=0,f=0;f<n;f++){var h=e[f];if(!h.invisible){var v=h.__clipPaths,c=v&&v.length||0,d=l&&l.length||0,p=void 0;for(p=Math.max(c-1,d-1);p>=0&&!(v&&l&&v[p]===l[p]);p--);for(var g=d-1;g>p;g--)o--,s=a[o-1];for(var m=p+1;m<c;m++){var _={};J5(v[m],_,r);var y=de("g","clip-g-"+u++,_,[]);(s?s.children:i).push(y),a[o++]=y,s=y}l=v;var x=p1(h,r);x&&(s?s.children:i).push(x)}}},t.prototype.resize=function(e,r){var i=this._opts,n=this.root,a=this._viewport;if(e!=null&&(i.width=e),r!=null&&(i.height=r),n&&a&&(a.style.display="none",e=Fa(n,0,i),r=Fa(n,1,i),a.style.display=""),this._width!==e||this._height!==r){if(this._width=e,this._height=r,a){var o=a.style;o.width=e+"px",o.height=r+"px"}if(Fd(this._backgroundColor))this.refresh();else{var s=this._svgDom;s&&(s.setAttribute("width",e),s.setAttribute("height",r));var l=this._bgVNode&&this._bgVNode.elm;l&&(l.setAttribute("width",e),l.setAttribute("height",r))}}},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},t.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},t.prototype.toDataURL=function(e){var r=this.renderToString(),i="data:image/svg+xml;";return e?(r=tA(r),r&&i+"base64,"+r):i+"charset=UTF-8,"+encodeURIComponent(r)},t}();function x1(t){return function(){}}function s4(t,e,r,i){var n;if(r&&r!=="none")if(n=de("rect","bg",{width:t,height:e,x:"0",y:"0"}),Z1(r))D2({fill:r},n.attrs,"fill",i);else if(Fd(r))L2({style:{fill:r},dirty:Te,getBoundingRect:function(){return{width:t,height:e}}},n.attrs,"fill",i);else{var a=ys(r),o=a.color,s=a.opacity;n.attrs.fill=o,s<1&&(n.attrs["fill-opacity"]=s)}return n}function l4(t){t.registerPainter("svg",o4)}Qe([vw,CF,YB,o5,UF,DI,C5,eF,TB,vB,l4,cw]);export{f4 as default};