import{V as q1,d as Rb,s as fl,i as hl,t as Pb,c as va,g as Ib,w as cl,a as Rg,o as Nb,b as Ob,h as Pg,n as Bb,u as Fb}from"./index-FcXwFJdn.js";var Tv=q1;q1.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 Sv=function(t,e){return Sv=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])},Sv(t,e)};function W(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Sv(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var kb=function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t}(),zb=function(){function t(){this.browser=new kb,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}(),ct=new zb;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(ct.wxa=!0,ct.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?ct.worker=!0:typeof navigator>"u"?(ct.node=!0,ct.svgSupported=!0):Ub(navigator.userAgent,ct);function Ub(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 Zd=12,K1="sans-serif",en=Zd+"px "+K1,Hb=20,Vb=100,Gb="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Wb(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)-Hb)/Vb;e[i]=n}return e}var Xb=Wb(Gb),go={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var t,e;return function(r,i){if(!t){var n=go.createCanvas();t=n&&n.getContext("2d")}if(t)return e!==i&&(e=t.font=i||en),t.measureText(r);r=r||"",i=i||en;var a=/(\d+)px/.exec(i),o=a&&+a[1]||Zd,s=0;if(i.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var u=Xb[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}},j1=la(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),Q1=la(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),Ks=Object.prototype.toString,Rf=Array.prototype,Yb=Rf.forEach,Zb=Rf.filter,$d=Rf.slice,$b=Rf.map,Ig=(function(){}).constructor,vl=Ig?Ig.prototype:null,qd="__proto__",qb=2311;function J1(){return qb++}function Kd(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function lt(t){if(t==null||typeof t!="object")return t;var e=t,r=Ks.call(t);if(r==="[object Array]"){if(!cs(t)){e=[];for(var i=0,n=t.length;i<n;i++)e[i]=lt(t[i])}}else if(Q1[r]){if(!cs(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(!j1[r]&&!cs(t)&&!Fu(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==qd&&(e[o]=lt(t[o]))}return e}function vt(t,e,r){if(!Q(e)||!Q(t))return r?lt(e):t;for(var i in e)if(e.hasOwnProperty(i)&&i!==qd){var n=t[i],a=e[i];Q(a)&&Q(n)&&!Y(a)&&!Y(n)&&!Fu(a)&&!Fu(n)&&!Ng(a)&&!Ng(n)&&!cs(a)&&!cs(n)?vt(n,a,r):(r||!(i in t))&&(t[i]=lt(e[i]))}return t}function H(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==qd&&(t[r]=e[r]);return t}function Mt(t,e,r){for(var i=_t(e),n=0;n<i.length;n++){var a=i[n];(r?e[a]!=null:t[a]==null)&&(t[a]=e[a])}return t}function Ct(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 jd(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 Zr(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"&&(r?e[a]!=null:t[a]==null)&&(t[a]=e[a])}else Mt(t,e,r)}function Ze(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function M(t,e,r){if(t&&e)if(t.forEach&&t.forEach===Yb)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 j(t,e,r){if(!t)return[];if(!e)return Qd(t);if(t.map&&t.map===$b)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 la(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 ce(t,e,r){if(!t)return[];if(!e)return Qd(t);if(t.filter&&t.filter===Zb)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 _t(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 Kb(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return function(){return t.apply(e,r.concat($d.call(arguments)))}}var rt=vl&&ft(vl.bind)?vl.call.bind(vl.bind):Kb;function de(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat($d.call(arguments)))}}function Y(t){return Array.isArray?Array.isArray(t):Ks.call(t)==="[object Array]"}function ft(t){return typeof t=="function"}function q(t){return typeof t=="string"}function wv(t){return Ks.call(t)==="[object String]"}function Qt(t){return typeof t=="number"}function Q(t){var e=typeof t;return e==="function"||!!t&&e==="object"}function Ng(t){return!!j1[Ks.call(t)]}function hr(t){return!!Q1[Ks.call(t)]}function Fu(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function Pf(t){return t.colorStops!=null}function jb(t){return t.image!=null}function ku(t){return t!==t}function ao(){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 gt(t,e){return t??e}function vu(t,e,r){return t??e??r}function Qd(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return $d.apply(t,e)}function tx(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 Dr(t,e){if(!t)throw new Error(e)}function oi(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var ex="__ec_primitive__";function zu(t){t[ex]=!0}function cs(t){return t[ex]}var Qb=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 _t(this.data)},t.prototype.forEach=function(e){var r=this.data;for(var i in r)r.hasOwnProperty(i)&&e(r[i],i)},t}(),rx=typeof Map=="function";function Jb(){return rx?new Map:new Qb}var tA=function(){function t(e){var r=Y(e);this.data=Jb();var i=this;e instanceof t?e.each(n):e&&M(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 rx?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t}();function ut(t){return new tA(t)}function eA(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 If(t,e){var r;if(Object.create)r=Object.create(t);else{var i=function(){};i.prototype=t,r=new i}return e&&H(r,e),r}function ix(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function mt(t,e){return t.hasOwnProperty(e)}function Me(){}var du=180/Math.PI;function mo(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function rA(t){return[t[0],t[1]]}function Og(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function iA(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function nA(t){return Math.sqrt(aA(t))}function aA(t){return t[0]*t[0]+t[1]*t[1]}function mh(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function oA(t,e){var r=nA(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function bv(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Av=bv;function sA(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var ja=sA;function _h(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 Mr(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 Va(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Ga(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var da=function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t}(),lA=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 da(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 da(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 da(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new da(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new da(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new da(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t}(),$r=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}(),uA=Math.log(2);function Ev(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)/uA);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]*Ev(t,e-1,f,u,n|d,a),c++)}return a[o]=h,h}function Bg(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=Ev(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)*Ev(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 Fg="___zrEVENTSAVED",yh=[];function fA(t,e,r,i,n){return Cv(yh,e,i,n,!0)&&Cv(t,r,yh[0],yh[1])}function Cv(t,e,r,i,n){if(e.getBoundingClientRect&&ct.domSupported&&!nx(e)){var a=e[Fg]||(e[Fg]={}),o=hA(e,a),s=cA(o,a,n);if(s)return s(t,r,i),!0}return!1}function hA(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 cA(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?Bg(s,o):Bg(o,s))}function nx(t){return t.nodeName.toUpperCase()==="CANVAS"}var vA=/([&<>"'])/g,dA={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ce(t){return t==null?"":(t+"").replace(vA,function(e,r){return dA[r]})}var pA=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xh=[],gA=ct.browser.firefox&&+ct.browser.version.split(".")[0]<39;function Mv(t,e,r,i){return r=r||{},i?kg(t,e,r):gA&&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):kg(t,e,r),r}function kg(t,e,r){if(ct.domSupported&&t.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(nx(t)){var a=t.getBoundingClientRect();r.zrX=i-a.left,r.zrY=n-a.top;return}else if(Cv(xh,t,i,n)){r.zrX=xh[0],r.zrY=xh[1];return}}r.zrX=r.zrY=0}function Jd(t){return t||window.event}function mr(t,e,r){if(e=Jd(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&&Mv(t,o,e,r)}else{Mv(t,e,e,r);var a=mA(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&pA.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function mA(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 _A(t,e,r,i){t.addEventListener(e,r,i)}function yA(t,e,r,i){t.removeEventListener(e,r,i)}var Ei=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function zg(t){return t.which===2||t.which===3}var xA=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=Mv(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 Th)if(Th.hasOwnProperty(r)){var i=Th[r](this._track,e);if(i)return i}},t}();function Ug(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function TA(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var Th={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=Ug(i)/Ug(n);!isFinite(a)&&(a=1),e.pinchScale=a;var o=TA(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}};function Cs(){return[1,0,0,1,0,0]}function tp(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function SA(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 Qa(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 Dv(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 ep(t,e,r){var i=e[0],n=e[2],a=e[4],o=e[1],s=e[3],l=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=i*f+o*u,t[1]=-i*u+o*f,t[2]=n*f+s*u,t[3]=-n*u+f*s,t[4]=f*a+u*l,t[5]=f*l-u*a,t}function wA(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 Nf(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 St=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}(),dl=Math.min,pl=Math.max,sn=new St,ln=new St,un=new St,fn=new St,wo=new St,bo=new St,It=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=dl(e.x,this.x),i=dl(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=pl(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=pl(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=Cs();return Dv(a,a,[-r.x,-r.y]),wA(a,a,[i,n]),Dv(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?St.set(bo,-p,0):St.set(bo,g,0)):y<c&&(c=y,p<g?St.set(wo,p,0):St.set(wo,-g,0)),s<f||h<o?x>d&&(d=x,m<_?St.set(bo,0,-m):St.set(bo,0,_)):y<c&&(c=y,m<_?St.set(wo,0,m):St.set(wo,0,-_))}return r&&St.copy(r,v?wo:bo),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}sn.x=un.x=r.x,sn.y=fn.y=r.y,ln.x=fn.x=r.x+r.width,ln.y=un.y=r.y+r.height,sn.transform(i),fn.transform(i),ln.transform(i),un.transform(i),e.x=dl(sn.x,ln.x,un.x,fn.x),e.y=dl(sn.y,ln.y,un.y,fn.y);var l=pl(sn.x,ln.x,un.x,fn.x),u=pl(sn.y,ln.y,un.y,fn.y);e.width=l-e.x,e.height=u-e.y},t}(),ax="silent";function bA(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:AA}}function AA(){Ei(this.event)}var EA=function(t){W(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}($r),Ao=function(){function t(e,r){this.x=e,this.y=r}return t}(),CA=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Sh=new It(0,0,0,0),ox=function(t){W(e,t);function e(r,i,n,a,o){var s=t.call(this)||this;return s._hovered=new Ao(0,0),s.storage=r,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new EA,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new lA(s),s}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(M(CA,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=sx(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 Ao(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 Ao(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=bA(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 Ao(r,i);if(Hg(a,o,r,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,f=new It(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)&&(Sh.copy(v.getBoundingRect()),v.transform&&Sh.applyTransform(v.transform),Sh.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(Hg(s,o,_,y,n),o.target)return o}}return o},e.prototype.processGesture=function(r,i){this._gestureMgr||(this._gestureMgr=new xA);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 Ao;s.target=a.target,this.dispatchToElement(s,o,a.event)}},e}($r);M(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){ox.prototype[t]=function(e){var r=e.zrX,i=e.zrY,n=sx(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||Av(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,t,e)}});function MA(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?ax:!0}return!1}function Hg(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=MA(o,r,i))&&(!e.topTarget&&(e.topTarget=o),s!==ax)){e.target=o;break}}}function sx(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}const DA=ox;var lx=32,Eo=7;function LA(t){for(var e=0;t>=lx;)e|=t&1,t>>=1;return t+e}function Vg(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++;RA(t,e,n)}else for(;n<r&&i(t[n],t[n-1])>=0;)n++;return n-e}function RA(t,e,r){for(r--;e<r;){var i=t[e];t[e++]=t[r],t[r--]=i}}function Gg(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 wh(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 bh(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 PA(t,e){var r=Eo,i,n,a=0;t.length;var 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 _=bh(t[g],t,d,p,0,e);d+=_,p-=_,p!==0&&(m=wh(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=bh(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=wh(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>=Eo||w>=Eo);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,C=!1;do if(e(o[y],t[_])<0){if(t[x--]=t[_--],b++,A=0,--d===0){C=!0;break}}else if(t[x--]=o[y--],A++,b=0,--g===1){C=!0;break}while((b|A)<w);if(C)break;do{if(b=d-bh(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){C=!0;break}}if(t[x--]=o[y--],--g===1){C=!0;break}if(A=g-wh(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){C=!0;break}}if(t[x--]=t[_--],--d===0){C=!0;break}w--}while(b>=Eo||A>=Eo);if(C)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 pu(t,e,r,i){r||(r=0),i||(i=t.length);var n=i-r;if(!(n<2)){var a=0;if(n<lx){a=Vg(t,r,i,e),Gg(t,r,i,r+a,e);return}var o=PA(t,e),s=LA(n);do{if(a=Vg(t,r,i,e),a<s){var l=n;l>s&&(l=s),Gg(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 ur=1,rs=2,ka=4,Wg=!1;function Ah(){Wg||(Wg=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Xg(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var IA=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Xg}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,pu(i,Xg)},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|=ur),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)&&(Ah(),f.z=0),isNaN(f.z2)&&(Ah(),f.z2=0),isNaN(f.zlevel)&&(Ah(),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=Ct(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}(),ux;ux=ct.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};const Uu=ux;var vs={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-vs.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?vs.bounceIn(t*2)*.5:vs.bounceOut(t*2-1)*.5+.5}},gl=Math.pow,Qi=Math.sqrt,Hu=1e-8,fx=1e-4,Yg=Qi(3),ml=1/3,ai=mo(),Tr=mo(),Ja=mo();function Yi(t){return t>-Hu&&t<Hu}function hx(t){return t>Hu||t<-Hu}function ye(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 Zg(t,e,r,i,n){var a=1-n;return 3*(((e-t)*a+2*(r-e)*n)*a+(i-r)*n*n)}function Vu(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(Yi(f)&&Yi(h))if(Yi(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(Yi(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 _=Qi(p),y=f*s+1.5*o*(-h+_),x=f*s+1.5*o*(-h-_);y<0?y=-gl(-y,ml):y=gl(y,ml),x<0?x=-gl(-x,ml):x=gl(x,ml);var d=(-s-(y+x))/(3*o);d>=0&&d<=1&&(a[c++]=d)}else{var S=(2*f*s-3*o*h)/(2*Qi(f*f*f)),T=Math.acos(S)/3,w=Qi(f),b=Math.cos(T),d=(-s-2*w*b)/(3*o),m=(-s+w*(b+Yg*Math.sin(T)))/(3*o),A=(-s+w*(b-Yg*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 cx(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(Yi(o)){if(hx(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var f=a*a-4*o*s;if(Yi(f))n[0]=-a/(2*o);else if(f>0){var h=Qi(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 Gu(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 vx(t,e,r,i,n,a,o,s,l,u,f){var h,v=.005,c=1/0,d,p,g,m;ai[0]=l,ai[1]=u;for(var _=0;_<1;_+=.05)Tr[0]=ye(t,r,n,o,_),Tr[1]=ye(e,i,a,s,_),g=ja(ai,Tr),g<c&&(h=_,c=g);c=1/0;for(var y=0;y<32&&!(v<fx);y++)d=h-v,p=h+v,Tr[0]=ye(t,r,n,o,d),Tr[1]=ye(e,i,a,s,d),g=ja(Tr,ai),d>=0&&g<c?(h=d,c=g):(Ja[0]=ye(t,r,n,o,p),Ja[1]=ye(e,i,a,s,p),m=ja(Ja,ai),p<=1&&m<c?(h=p,c=m):v*=.5);return f&&(f[0]=ye(t,r,n,o,h),f[1]=ye(e,i,a,s,h)),Qi(c)}function NA(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=ye(t,r,n,o,d),g=ye(e,i,a,s,d),m=p-u,_=g-f;h+=Math.sqrt(m*m+_*_),u=p,f=g}return h}function Pe(t,e,r,i){var n=1-i;return n*(n*t+2*i*e)+i*i*r}function $g(t,e,r,i){return 2*((1-i)*(e-t)+i*(r-e))}function OA(t,e,r,i,n){var a=t-2*e+r,o=2*(e-t),s=t-i,l=0;if(Yi(a)){if(hx(o)){var u=-s/o;u>=0&&u<=1&&(n[l++]=u)}}else{var f=o*o-4*a*s;if(Yi(f)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(f>0){var h=Qi(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 dx(t,e,r){var i=t+r-2*e;return i===0?.5:(t-e)/i}function Wu(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 px(t,e,r,i,n,a,o,s,l){var u,f=.005,h=1/0;ai[0]=o,ai[1]=s;for(var v=0;v<1;v+=.05){Tr[0]=Pe(t,r,n,v),Tr[1]=Pe(e,i,a,v);var c=ja(ai,Tr);c<h&&(u=v,h=c)}h=1/0;for(var d=0;d<32&&!(f<fx);d++){var p=u-f,g=u+f;Tr[0]=Pe(t,r,n,p),Tr[1]=Pe(e,i,a,p);var c=ja(Tr,ai);if(p>=0&&c<h)u=p,h=c;else{Ja[0]=Pe(t,r,n,g),Ja[1]=Pe(e,i,a,g);var m=ja(Ja,ai);g<=1&&m<h?(u=g,h=m):f*=.5}}return l&&(l[0]=Pe(t,r,n,u),l[1]=Pe(e,i,a,u)),Qi(h)}function BA(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=Pe(t,r,n,v),d=Pe(e,i,a,v),p=c-s,g=d-l;u+=Math.sqrt(p*p+g*g),s=c,l=d}return u}var FA=/cubic-bezier\(([0-9,\.e ]+)\)/;function rp(t){var e=t&&FA.exec(t);if(e){var r=e[1].split(","),i=+oi(r[0]),n=+oi(r[1]),a=+oi(r[2]),o=+oi(r[3]);if(isNaN(i+n+a+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:Vu(0,i,a,1,l,s)&&ye(0,n,o,1,s[0])}}}var kA=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||Me,this.ondestroy=e.ondestroy||Me,this.onrestart=e.onrestart||Me,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=ft(e)?e:vs[e]||rp(e)},t}();const zA=kA;var gx=function(){function t(e){this.value=e}return t}(),UA=function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new gx(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}(),HA=function(){function t(e){this._list=new UA,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 gx(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}();const _o=HA;var qg={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 Gr(t){return t=Math.round(t),t<0?0:t>255?255:t}function VA(t){return t=Math.round(t),t<0?0:t>360?360:t}function Ms(t){return t<0?0:t>1?1:t}function Eh(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Gr(parseFloat(e)/100*255):Gr(parseInt(e,10))}function Kn(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Ms(parseFloat(e)/100):Ms(parseFloat(e))}function Ch(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 Zi(t,e,r){return t+(e-t)*r}function gr(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function Lv(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var mx=new _o(20),_l=null;function pa(t,e){_l&&Lv(_l,e),_l=mx.put(t,_l||e.slice())}function Xe(t,e){if(t){e=e||[];var r=mx.get(t);if(r)return Lv(e,r);t=t+"";var i=t.replace(/ /g,"").toLowerCase();if(i in qg)return Lv(e,qg[i]),pa(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)){gr(e,0,0,0,1);return}return gr(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),pa(t,e),e}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){gr(e,0,0,0,1);return}return gr(e,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),pa(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?gr(e,+u[0],+u[1],+u[2],1):gr(e,0,0,0,1);f=Kn(u.pop());case"rgb":if(u.length>=3)return gr(e,Eh(u[0]),Eh(u[1]),Eh(u[2]),u.length===3?f:Kn(u[3])),pa(t,e),e;gr(e,0,0,0,1);return;case"hsla":if(u.length!==4){gr(e,0,0,0,1);return}return u[3]=Kn(u[3]),Rv(u,e),pa(t,e),e;case"hsl":if(u.length!==3){gr(e,0,0,0,1);return}return Rv(u,e),pa(t,e),e;default:return}}gr(e,0,0,0,1)}}function Rv(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=Kn(t[1]),n=Kn(t[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],gr(e,Gr(Ch(o,a,r+1/3)*255),Gr(Ch(o,a,r)*255),Gr(Ch(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function GA(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 Kg(t,e){var r=Xe(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,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return bi(r,r.length===4?"rgba":"rgb")}}function Mh(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]=Gr(Zi(o[0],s[0],l)),r[1]=Gr(Zi(o[1],s[1],l)),r[2]=Gr(Zi(o[2],s[2],l)),r[3]=Ms(Zi(o[3],s[3],l)),r}}function WA(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=Xe(e[n]),s=Xe(e[a]),l=i-n,u=bi([Gr(Zi(o[0],s[0],l)),Gr(Zi(o[1],s[1],l)),Gr(Zi(o[2],s[2],l)),Ms(Zi(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function Dh(t,e,r,i){var n=Xe(t);if(t)return n=GA(n),e!=null&&(n[0]=VA(e)),r!=null&&(n[1]=Kn(r)),i!=null&&(n[2]=Kn(i)),bi(Rv(n),"rgba")}function XA(t,e){var r=Xe(t);if(r&&e!=null)return r[3]=Ms(e),bi(r,"rgba")}function bi(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 Xu(t,e){var r=Xe(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Yu=Math.round;function Ds(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=Xe(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e??1}}var jg=1e-4;function $i(t){return t<jg&&t>-jg}function yl(t){return Yu(t*1e3)/1e3}function Pv(t){return Yu(t*1e4)/1e4}function YA(t){return"matrix("+yl(t[0])+","+yl(t[1])+","+yl(t[2])+","+yl(t[3])+","+Pv(t[4])+","+Pv(t[5])+")"}var ZA={left:"start",right:"end",center:"middle",middle:"middle"};function $A(t,e,r){return r==="top"?t+=e/2:r==="bottom"&&(t-=e/2),t}function qA(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function KA(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 _x(t){return t&&!!t.image}function jA(t){return t&&!!t.svgElement}function ip(t){return _x(t)||jA(t)}function yx(t){return t.type==="linear"}function xx(t){return t.type==="radial"}function Tx(t){return t&&(t.type==="linear"||t.type==="radial")}function Of(t){return"url(#"+t+")"}function Sx(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 bx(t){var e=t.x||0,r=t.y||0,i=(t.rotation||0)*du,n=gt(t.scaleX,1),a=gt(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("+Yu(o*du)+"deg, "+Yu(s*du)+"deg)"),l.join(" ")}var QA=function(){return ct.hasGlobalWindow&&ft(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}}(),Iv=Array.prototype.slice;function _i(t,e,r){return(e-t)*r+t}function Lh(t,e,r,i){for(var n=e.length,a=0;a<n;a++)t[a]=_i(e[a],r[a],i);return t}function JA(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]=_i(e[o][s],r[o][s],i)}return t}function xl(t,e,r,i){for(var n=e.length,a=0;a<n;a++)t[a]=e[a]+r[a]*i;return t}function Qg(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 tE(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 eE(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]:Iv.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 ds(t){if(Ze(t)){var e=t.length;if(Ze(t[0])){for(var r=[],i=0;i<e;i++)r.push(Iv.call(t[i]));return r}return Iv.call(t)}return t}function gu(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 rE(t){return Ze(t&&t[0])?2:1}var Tl=0,mu=1,Ax=2,is=3,Nv=4,Ov=5,Jg=6;function tm(t){return t===Nv||t===Ov}function Sl(t){return t===mu||t===Ax}var Co=[0,0,0,0],iE=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=Jg,l=r;if(Ze(r)){var u=rE(r);s=u,(u===1&&!Qt(r[0])||u===2&&!Qt(r[0][0]))&&(o=!0)}else if(Qt(r)&&!ku(r))s=Tl;else if(q(r))if(!isNaN(+r))s=Tl;else{var f=Xe(r);f&&(l=f,s=is)}else if(Pf(r)){var h=H({},l);h.colorStops=j(r.colorStops,function(c){return{offset:c.offset,color:Xe(c.color)}}),yx(r)?s=Nv:xx(r)&&(s=Ov),l=h}a===0?this.valType=s:(s!==this.valType||s===Jg)&&(o=!0),this.discrete=this.discrete||o;var v={time:e,value:l,rawValue:r,percent:0};return i&&(v.easing=i,v.easingFunc=ft(i)?i:vs[i]||rp(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=Sl(n),u=tm(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?eE(v,c,n):u&&tE(v.colorStops,c.colorStops))}if(!s&&n!==Ov&&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===Tl?i[f].additiveValue=i[f].value-d:n===is?i[f].additiveValue=xl([],i[f].value,d,-1):Sl(n)&&(i[f].additiveValue=n===mu?xl([],i[f].value,d,-1):Qg([],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===is,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?Co:e[l];if((Sl(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)e[l]=m<1?c.rawValue:d.rawValue;else if(Sl(a))a===mu?Lh(_,c[n],d[n],m):JA(_,c[n],d[n],m);else if(tm(a)){var y=c[n],x=d[n],S=a===Nv;e[l]={type:S?"linear":"radial",x:_i(y.x,x.x,m),y:_i(y.y,x.y,m),colorStops:j(y.colorStops,function(w,b){var A=x.colorStops[b];return{offset:_i(w.offset,A.offset,m),color:gu(Lh([],w.color,A.color,m))}}),global:x.global},S?(e[l].x2=_i(y.x2,x.x2,m),e[l].y2=_i(y.y2,x.y2,m)):e[l].r=_i(y.r,x.r,m)}else if(u)Lh(_,c[n],d[n],m),i||(e[l]=gu(_));else{var T=_i(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===Tl?e[i]=e[i]+n:r===is?(Xe(e[i],Co),xl(Co,Co,n,1),e[i]=gu(Co)):r===mu?xl(e[i],e[i],n,1):r===Ax&&Qg(e[i],e[i],n,1)},t}(),nE=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){Kd("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,_t(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 iE(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===is&&u&&(u=gu(u))}else u=this._target[s];if(u==null)continue;e>0&&l.addKeyframe(0,ds(u),n),this._trackKeys.push(s)}l.addKeyframe(e,ds(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 zA({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 j(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]=ds(l.rawValue))}}}},t.prototype.__changeFinalValue=function(e,r){r=r||_t(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 Bf=nE;function Wa(){return new Date().getTime()}var aE=function(t){W(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=Wa()-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&&(Uu(i),!r._paused&&r.update())}Uu(i)},e.prototype.start=function(){this._running||(this._time=Wa(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Wa(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Wa()-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 Bf(r,i.loop);return this.addAnimator(n),n},e}($r),oE=300,Rh=ct.domSupported,Ph=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=j(t,function(n){var a=n.replace("mouse","pointer");return r.hasOwnProperty(a)?a:n});return{mouse:t,touch:e,pointer:i}}(),em={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},rm=!1;function Bv(t){var e=t.pointerType;return e==="pen"||e==="touch"}function sE(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 Ih(t){t&&(t.zrByTouch=!0)}function lE(t,e){return mr(t.dom,new uE(t,e),!0)}function Ex(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 uE=function(){function t(e,r){this.stopPropagation=Me,this.stopImmediatePropagation=Me,this.preventDefault=Me,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t}(),Ur={mousedown:function(t){t=mr(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=mr(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=mr(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=mr(this.dom,t);var e=t.toElement||t.relatedTarget;Ex(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){rm=!0,t=mr(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){rm||(t=mr(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=mr(this.dom,t),Ih(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Ur.mousemove.call(this,t),Ur.mousedown.call(this,t)},touchmove:function(t){t=mr(this.dom,t),Ih(t),this.handler.processGesture(t,"change"),Ur.mousemove.call(this,t)},touchend:function(t){t=mr(this.dom,t),Ih(t),this.handler.processGesture(t,"end"),Ur.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<oE&&Ur.click.call(this,t)},pointerdown:function(t){Ur.mousedown.call(this,t)},pointermove:function(t){Bv(t)||Ur.mousemove.call(this,t)},pointerup:function(t){Ur.mouseup.call(this,t)},pointerout:function(t){Bv(t)||Ur.mouseout.call(this,t)}};M(["click","dblclick","contextmenu"],function(t){Ur[t]=function(e){e=mr(this.dom,e),this.trigger(t,e)}});var Fv={pointermove:function(t){Bv(t)||Fv.mousemove.call(this,t)},pointerup:function(t){Fv.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 fE(t,e){var r=e.domHandlers;ct.pointerEventsSupported?M(Ph.pointer,function(i){_u(e,i,function(n){r[i].call(t,n)})}):(ct.touchEventsSupported&&M(Ph.touch,function(i){_u(e,i,function(n){r[i].call(t,n),sE(e)})}),M(Ph.mouse,function(i){_u(e,i,function(n){n=Jd(n),e.touching||r[i].call(t,n)})}))}function hE(t,e){ct.pointerEventsSupported?M(em.pointer,r):ct.touchEventsSupported||M(em.mouse,r);function r(i){function n(a){a=Jd(a),Ex(t,a.target)||(a=lE(t,a),e.domHandlers[i].call(t,a))}_u(e,i,n,{capture:!0})}}function _u(t,e,r,i){t.mounted[e]=r,t.listenerOpts[e]=i,_A(t.domTarget,e,r,i)}function Nh(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&yA(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var im=function(){function t(e,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=r}return t}(),cE=function(t){W(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 im(r,Ur),Rh&&(n._globalHandlerScope=new im(document,Fv)),fE(n,n._localHandlerScope),n}return e.prototype.dispose=function(){Nh(this._localHandlerScope),Rh&&Nh(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,Rh&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var i=this._globalHandlerScope;r?hE(this,i):Nh(i)}},e}($r);const vE=cE;var Cx=1;ct.hasGlobalWindow&&(Cx=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Zu=Cx,kv=.4,zv="#333",Uv="#ccc",dE="#eee",nm=tp,am=5e-5;function hn(t){return t>am||t<-am}var cn=[],ga=[],Oh=Cs(),Bh=Math.abs,Ff=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 hn(this.rotation)||hn(this.x)||hn(this.y)||hn(this.scaleX-1)||hn(this.scaleY-1)||hn(this.skewX)||hn(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),i=this.transform;if(!(r||e)){i&&(nm(i),this.invTransform=null);return}i=i||Cs(),r?this.getLocalTransform(i):nm(i),e&&(r?Qa(i,e,i):SA(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(cn);var i=cn[0]<0?-1:1,n=cn[1]<0?-1:1,a=((cn[0]-i)*r+i)/cn[0]||0,o=((cn[1]-n)*r+n)/cn[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||Cs(),Nf(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&&(Qa(ga,e.invTransform,r),r=ga);var i=this.originX,n=this.originY;(i||n)&&(Oh[4]=i,Oh[5]=n,Qa(ga,r,Oh),ga[4]-=i,ga[5]-=n,r=ga),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&&Mr(i,i,n),i},t.prototype.transformCoordToGlobal=function(e,r){var i=[e,r],n=this.transform;return n&&Mr(i,i,n),i},t.prototype.getLineScale=function(){var e=this.transform;return e&&Bh(e[0]-1)>1e-10&&Bh(e[3]-1)>1e-10?Math.sqrt(Bh(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){Mx(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&&ep(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}(),hi=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Mx(t,e){for(var r=0;r<hi.length;r++){var i=hi[r];t[i]=e[i]}}var om={};function fr(t,e){e=e||en;var r=om[e];r||(r=om[e]=new _o(500));var i=r.get(t);return i==null&&(i=go.measureText(t,e).width,r.put(t,i)),i}function sm(t,e,r,i){var n=fr(t,e),a=kf(e),o=ns(0,n,r),s=za(0,a,i),l=new It(o,s,n,a);return l}function np(t,e,r,i){var n=((t||"")+"").split(`
`),a=n.length;if(a===1)return sm(n[0],e,r,i);for(var o=new It(0,0,0,0),s=0;s<n.length;s++){var l=sm(n[s],e,r,i);s===0?o.copy(l):o.union(l)}return o}function ns(t,e,r){return r==="right"?t-=e:r==="center"&&(t-=e/2),t}function za(t,e,r){return r==="middle"?t-=e/2:r==="bottom"&&(t-=e),t}function kf(t){return fr("国",t)}function Ci(t,e){return typeof t=="string"?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function Dx(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+=Ci(i[0],r.width),u+=Ci(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 Fh="__zr_normal__",kh=hi.concat(["ignore"]),pE=la(hi,function(t,e){return t[e]=!0,t},{ignore:!1}),ma={},gE=new It(0,0,0,0),ap=function(){function t(e){this.id=J1(),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=gE;i.layoutRect?f.copy(i.layoutRect):f.copy(this.getBoundingRect()),n||f.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(ma,i,f):Dx(ma,i,f),a.x=ma.x,a.y=ma.y,o=ma.align,s=ma.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=Ci(h[0],f.width),c=Ci(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|=ur,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()?Uv:zv},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),i=typeof r=="string"&&Xe(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,bi(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||{},H(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(Q(e))for(var i=e,n=_t(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!==Fh)){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,kh)},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(Fh,!1,e)},t.prototype.useState=function(e,r,i,n){var a=e===Fh,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Ct(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){Kd("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&=~ur),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&=~ur)}},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=Ct(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=Ct(n,e),o=Ct(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];H(r,a),a.textConfig&&(i=i||{},H(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=H({},n?this.textConfig:i.textConfig),H(this.textConfig,r.textConfig)):s&&i.textConfig&&(this.textConfig=i.textConfig);for(var l={},u=!1,f=0;f<kh.length;f++){var h=kh[f],v=a&&pE[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 Ff,this._attachComponent(e),this._textContent=e,this.markRedraw())},t.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),H(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|=ur;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 Bf(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=Ct(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){zh(this,e,r,i)},t.prototype.animateFrom=function(e,r,i){zh(this,e,r,i,!0)},t.prototype._transitionState=function(e,r,i,n){for(var a=zh(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=ur;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}();Zr(ap,$r);Zr(ap,Ff);function zh(t,e,r,i,n){r=r||{};var a=[];Lx(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 Uh(t,e,r){for(var i=0;i<r;i++)t[i]=e[i]}function mE(t){return Ze(t[0])}function _E(t,e,r){if(Ze(e[r]))if(Ze(t[r])||(t[r]=[]),hr(e[r])){var i=e[r].length;t[r].length!==i&&(t[r]=new e[r].constructor(i),Uh(t[r],e[r],i))}else{var n=e[r],a=t[r],o=n.length;if(mE(n))for(var s=n[0].length,l=0;l<o;l++)a[l]?Uh(a[l],n[l],s):a[l]=Array.prototype.slice.call(n[l]);else Uh(a,n,o);a.length=n.length}else t[r]=e[r]}function yE(t,e){return t===e||Ze(t)&&Ze(e)&&xE(t,e)}function xE(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 Lx(t,e,r,i,n,a,o,s){for(var l=_t(i),u=n.duration,f=n.delay,h=n.additive,v=n.setToFinal,c=!Q(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(Q(_)&&!Ze(_)&&!Pf(_)){if(e){s||(r[m]=_,t.updateDuringAnimation(e));continue}Lx(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=Ct(d,S);d.splice(w,1)}}}if(n.force||(p=ce(p,function(E){return!yE(i[E],r[E])}),y=p.length),y>0||n.force&&!o.length){var b=void 0,A=void 0,C=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){C={};for(var x=0;x<y;x++){var m=p[x];C[m]=ds(r[m]),_E(r,i,m)}}var S=new Bf(r,!1,!1,h?ce(d,function(D){return D.targetName===e}):null);S.targetName=e,n.scope&&(S.scope=n.scope),v&&b&&S.whenWithKeys(0,b,p),C&&S.whenWithKeys(0,C,p),S.whenWithKeys(u??500,s?A:i,p).delay(f||0),t.addAnimator(S,e),o.push(S)}}const Rx=ap;var oe=function(t){W(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=Ct(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=Ct(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 It(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?(It.applyTransform(i,u,f),o=o||i.clone(),o.union(i)):(o=o||u.clone(),o.union(u))}}return o||i},e}(Rx);oe.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 yu={},Px={};function TE(t){delete Px[t]}function SE(t){if(!t)return!1;if(typeof t=="string")return Xu(t,1)<kv;if(t.colorStops){for(var e=t.colorStops,r=0,i=e.length,n=0;n<i;n++)r+=Xu(e[n].color,1);return r/=i,r<kv}return!1}var wE=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 IA,o=i.renderer||"canvas";yu[o]||(o=_t(yu)[0]),i.useDirtyRect=i.useDirtyRect==null?!1:i.useDirtyRect;var s=new yu[o](r,a,i,e),l=i.ssr||s.ssrOnly;this.storage=a,this.painter=s;var u=!ct.node&&!ct.worker&&!l?new vE(s.getViewportRoot(),s.root):null,f=i.useCoarsePointer,h=f==null||f==="auto"?ct.touchEventsSupported:!!f,v=44,c;h&&(c=gt(i.pointerSize,v)),this.handler=new DA(a,s,u,s.root,c),this.animation=new aE({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return t.prototype.add=function(e){e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},t.prototype.remove=function(e){e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(e,r){this.painter.configLayer&&this.painter.configLayer(e,r),this.refresh()},t.prototype.setBackgroundColor=function(e){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=SE(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){e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1},t.prototype.refresh=function(){this._needsRefresh=!0,this.animation.start()},t.prototype.flush=function(){this._flush(!1)},t.prototype._flush=function(e){var r,i=Wa();this._needsRefresh&&(r=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(r=!0,this.refreshHoverImmediately());var n=Wa();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.animation.start(),this._stillFrameAccum=0},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover()},t.prototype.resize=function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){return this.handler.findHover(e,r)},t.prototype.on=function(e,r,i){return this.handler.on(e,r,i),this},t.prototype.off=function(e,r){this.handler.off(e,r)},t.prototype.trigger=function(e,r){this.handler.trigger(e,r)},t.prototype.clear=function(){for(var e=this.storage.getRoots(),r=0;r<e.length;r++)e[r]instanceof oe&&e[r].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()},t.prototype.dispose=function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,TE(this.id)},t}();function Hv(t,e){var r=new wE(J1(),t,e);return Px[r.id]=r,r}function bE(t,e){yu[t]=e}var lm=1e-4,Ix=20;function AE(t){return t.replace(/^\s+|\s+$/g,"")}function ae(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 ve(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)?AE(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function re(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),Ix),t=(+t).toFixed(e),r?t:+t}function Gn(t){return t.sort(function(e,r){return e-r}),t}function Ti(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 op(t)}function op(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 EE(t,e){var r=Math.max(Ti(t),Ti(e)),i=t+e;return r>Ix?i:re(i,r)}function Ox(t){var e=Math.PI*2;return(t%e+e)%e}function $u(t){return t>-lm&&t<lm}var CE=/^(?:(\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 ci(t){if(t instanceof Date)return t;if(q(t)){var e=CE.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 ME(t){return Math.pow(10,sp(t))}function sp(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 Bx(t,e){var r=sp(t),i=Math.pow(10,r),n=t/i,a;return e?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,t=a*i,r>=-20?+t.toFixed(r<0?-r:0):t}function um(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 qu(t){var e=parseFloat(t);return e==t&&(e!==0||!q(t)||t.indexOf("x")<=0)?e:NaN}function DE(t){return!isNaN(qu(t))}function Fx(){return Math.round(Math.random()*9)}function kx(t,e){return e===0?t:kx(e,t%e)}function fm(t,e){return t==null?e:e==null?t:t*e/kx(t,e)}function Qe(t){throw new Error(t)}function hm(t,e,r){return(e-t)*r+t}var zx="series\0",LE="\0_ec_\0";function pe(t){return t instanceof Array?t:t==null?[]:[t]}function cm(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 vm=["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 js(t){return Q(t)&&!Y(t)&&!(t instanceof Date)?t.value:t}function RE(t){return Q(t)&&!(t instanceof Array)}function Ux(t,e,r){var i=r==="normalMerge",n=r==="replaceMerge",a=r==="replaceAll";t=t||[],e=(e||[]).slice();var o=ut();M(e,function(l,u){if(!Q(l)){e[u]=null;return}});var s=PE(t,o,r);return(i||n)&&IE(s,t,o,e),i&&NE(s,e),i||n?OE(s,e,n):a&&BE(s,e),FE(s),s}function PE(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"||Ls(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return i}function IE(t,e,r,i){M(i,function(n,a){if(!(!n||n.id==null)){var o=ps(n.id),s=r.get(o);if(s!=null){var l=t[s];Dr(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=n,l.existing=e[s],i[a]=null}}})}function NE(t,e){M(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)&&!Ls(r)&&!Ls(a)&&Hx("name",a,r)){t[n].newOption=r,e[i]=null;return}}})}function OE(t,e,r){M(e,function(i){if(i){for(var n,a=0;(n=t[a])&&(n.newOption||Ls(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 BE(t,e){M(e,function(r){t.push({newOption:r,brandNew:!0,existing:null,keyInfo:null})})}function FE(t){var e=ut();M(t,function(r){var i=r.existing;i&&e.set(i.id,r)}),M(t,function(r){var i=r.newOption;Dr(!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={})}),M(t,function(r,i){var n=r.existing,a=r.newOption,o=r.keyInfo;if(Q(a)){if(o.name=a.name!=null?ps(a.name):n?n.name:zx+i,n)o.id=ps(n.id);else if(a.id!=null)o.id=ps(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=Ge(e[t],null),n=Ge(r[t],null);return i!=null&&n!=null&&i===n}function ps(t){return Ge(t,"")}function Ge(t,e){return t==null?e:q(t)?t:Qt(t)||wv(t)?t+"":e}function lp(t){var e=t.name;return!!(e&&e.indexOf(zx))}function Ls(t){return t&&t.id!=null&&ps(t.id).indexOf(LE)===0}function kE(t,e,r){M(t,function(i){var n=i.newOption;Q(n)&&(i.keyInfo.mainType=e,i.keyInfo.subType=zE(e,n,i.existing,r))})}function zE(t,e,r,i){var n=e.type?e.type:r?r.subType:i.determineSubType(t,e);return n}function UE(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=Ge(o[u].seriesId,null);if(h==null)return;for(var v=pe(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 ia(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return Y(e.dataIndex)?j(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return Y(e.name)?j(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}function Kt(){var t="__ec_inner_"+HE++;return function(e){return e[t]||(e[t]={})}}var HE=Fx();function Hh(t,e,r){var i=up(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=Qs(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 up(t,e){var r;if(q(t)){var i={};i[t+"Index"]=0,r=i}else r=t;var n=ut(),a={},o=!1;return M(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&&Ct(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 tr={useDefault:!0,enableAll:!1,enableNone:!1},VE={useDefault:!1,enableAll:!0,enableNone:!0};function Qs(t,e,r,i){i=i||tr;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?(Dr(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(n==="all"&&(Dr(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 Vx(t,e,r){t.setAttribute?t.setAttribute(e,r):t[e]=r}function GE(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function WE(t){return t==="auto"?ct.domSupported?"html":"richText":t||"html"}function Gx(t,e,r,i,n){var a=e==null||e==="auto";if(i==null)return i;if(Qt(i)){var o=hm(r||0,i,n);return re(o,a?Math.max(Ti(r||0),Ti(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=hm(c,d,n);s[h]=re(o,a?Math.max(Ti(c),Ti(d)):e)}}return s}}var XE=".",vn="___EC__COMPONENT__CONTAINER___",Wx="___EC__EXTENDED_CLASS___";function si(t){var e={main:"",sub:""};if(t){var r=t.split(XE);e.main=r[0]||"",e.sub=r[1]||""}return e}function YE(t){Dr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function ZE(t){return!!(t&&t[Wx])}function fp(t,e){t.$constructor=t,t.extend=function(r){var i=this,n;return $E(i)?n=function(a){W(o,a);function o(){return a.apply(this,arguments)||this}return o}(i):(n=function(){(r.$constructor||i).apply(this,arguments)},jd(n,this)),H(n.prototype,r),n[Wx]=!0,n.extend=this.extend,n.superCall=jE,n.superApply=QE,n.superClass=i,n}}function $E(t){return ft(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function Xx(t,e){t.extend=e.extend}var qE=Math.round(Math.random()*10);function KE(t){var e=["__\0is_clz",qE++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function jE(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 QE(t,e,r){return this.superClass.prototype[e].apply(t,r)}function zf(t){var e={};t.registerClass=function(i){var n=i.type||i.prototype.type;if(n){YE(n),i.prototype.type=n;var a=si(n);if(!a.sub)e[a.main]=i;else if(a.sub!==vn){var o=r(a);o[a.sub]=i}}return i},t.getClass=function(i,n,a){var o=e[i];if(o&&o[vn]&&(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=si(i),a=[],o=e[n.main];return o&&o[vn]?M(o,function(s,l){l!==vn&&a.push(s)}):a.push(o),a},t.hasClass=function(i){var n=si(i);return!!e[n.main]},t.getAllClassMainTypes=function(){var i=[];return M(e,function(n,a){i.push(a)}),i},t.hasSubTypes=function(i){var n=si(i),a=e[n.main];return a&&a[vn]};function r(i){var n=e[i.main];return(!n||!n[vn])&&(n=e[i.main]={},n[vn]=!0),n}}function Rs(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&&Ct(n,l)>=0||a&&Ct(a,l)<0)){var u=i.getShallow(l,e);u!=null&&(o[t[s][0]]=u)}}return o}}var JE=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],tC=Rs(JE),eC=function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return tC(this,e,r)},t}(),Vv=new _o(50);function rC(t){if(typeof t=="string"){var e=Vv.get(t);return e&&e.image}else return t}function hp(t,e,r,i,n){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=Vv.get(t),o={hostEl:r,cb:i,cbPayload:n};return a?(e=a.image,!Uf(e)&&a.pending.push(o)):(e=go.loadImage(t,dm,dm),e.__zrImageSrc=t,Vv.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function dm(){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 Uf(t){return t&&t.width&&t.height}var Vh=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function iC(t,e,r,i,n){if(!e)return"";var a=(t+"").split(`
`);n=Yx(e,r,i,n);for(var o=0,s=a.length;o<s;o++)a[o]=Zx(a[o],n);return a.join(`
`)}function Yx(t,e,r,i){i=i||{};var n=H({},i);n.font=e,r=gt(r,"..."),n.maxIterations=gt(i.maxIterations,2);var a=n.minChar=gt(i.minChar,0);n.cnCharWidth=fr("国",e);var o=n.ascCharWidth=fr("a",e);n.placeholder=gt(i.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;l<a&&s>=o;l++)s-=o;var u=fr(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 Zx(t,e){var r=e.containerWidth,i=e.font,n=e.contentWidth;if(!r)return"";var a=fr(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?nC(t,n,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*n/a):0;t=t.substr(0,s),a=fr(t,i)}return t===""&&(t=e.placeholder),t}function nC(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 aC(t,e){t!=null&&(t+="");var r=e.overflow,i=e.padding,n=e.font,a=r==="truncate",o=kf(n),s=gt(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=gt(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=Yx(f,n,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),g=0;g<h.length;g++)h[g]=Zx(h[g],p);for(var m=c,_=0,g=0;g<h.length;g++)_=Math.max(fr(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 oC=function(){function t(){}return t}(),pm=function(){function t(e){this.tokens=[],e&&(this.tokens=e)}return t}(),sC=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 lC(t,e){var r=new sC;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=Vh.lastIndex=0,l;(l=Vh.exec(t))!=null;){var u=l.index;u>s&&Gh(r,t.substring(s,u),e,o),Gh(r,l[2],e,o,l[1]),s=Vh.lastIndex}s<t.length&&Gh(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,U,z){O.width=U,O.lineHeight=z,h+=z,v=Math.max(v,U)}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,C=T.font=w.font||e.font;T.contentHeight=kf(C);var E=gt(w.height,T.contentHeight);if(T.innerHeight=E,b&&(E+=b[0]+b[2]),T.height=E,T.lineHeight=vu(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,L=D==null||D==="auto";if(typeof D=="string"&&D.charAt(D.length-1)==="%")T.percentWidth=D,f.push(T),T.contentWidth=fr(T.text,C);else{if(L){var P=w.backgroundColor,N=P&&P.image;N&&(N=rC(N),Uf(N)&&(T.width=Math.max(T.width,N.width*E/N.height)))}var I=d&&i!=null?i-x:null;I!=null&&I<T.width?!L||I<A?(T.text="",T.width=T.contentWidth=0):(T.text=iC(T.text,I-A,C,e.ellipsis,{minChar:e.truncateMinChar}),T.width=T.contentWidth=fr(T.text,C)):T.contentWidth=fr(T.text,C)}T.width+=A,x+=T.width,w&&(y=Math.max(y,T.lineHeight))}g(_,x,y)}r.outerWidth=r.width=gt(i,v),r.outerHeight=r.height=gt(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],k=T.percentWidth;T.width=parseInt(k,10)/100*r.width}return r}function Gh(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=Ci(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 oC;if(_.styleName=n,_.text=m,_.isLineHolder=!m&&!a,typeof o.width=="number"?_.width=o.width:_.width=h?h[g]:fr(m,l),!g&&!u){var y=(s[s.length-1]||(s[0]=new pm)).tokens,x=y.length;x===1&&y[0].isLineHolder?y[0]=_:(m||!x||a)&&y.push(_)}else s.push(new pm([_]))}}function uC(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var fC=la(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function hC(t){return uC(t)?!!fC[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=fr(v,e),d=i?!1:!hC(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 Gv="__zr_style_"+Math.round(Math.random()*10),jn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Hf={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};jn[Gv]=!0;var gm=["z","z2","invisible"],cC=["invisible"],vC=function(t){W(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var i=_t(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&&dC(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 It(0,0,0,0)),i?It.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 It(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:H(this.style,r),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(r){r||this.markRedraw(),this.__dirty|=rs,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&rs)},e.prototype.styleUpdated=function(){this.__dirty&=~rs},e.prototype.createStyle=function(r){return If(jn,r)},e.prototype.useStyle=function(r){r[Gv]||(r=this.createStyle(r)),this.__inHover?this.__hoverStyle=r:this.style=r,this.dirtyStyle()},e.prototype.isStyleObject=function(r){return r[Gv]},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,gm)},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=_t(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=_t(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?cC:gm,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 H(r,i),r},e.prototype.getAnimationStyleProps=function(){return Hf},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=ur|rs}(),e}(Rx),Wh=new It(0,0,0,0),Xh=new It(0,0,0,0);function dC(t,e,r){return Wh.copy(t.getBoundingRect()),t.transform&&Wh.applyTransform(t.transform),Xh.width=e,Xh.height=r,!Wh.intersect(Xh)}const ua=vC;var Sr=Math.min,wr=Math.max,Yh=Math.sin,Zh=Math.cos,dn=Math.PI*2,wl=mo(),bl=mo(),Al=mo();function mm(t,e,r,i,n,a){n[0]=Sr(t,r),n[1]=Sr(e,i),a[0]=wr(t,r),a[1]=wr(e,i)}var _m=[],ym=[];function pC(t,e,r,i,n,a,o,s,l,u){var f=cx,h=ye,v=f(t,r,n,o,_m);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,_m[c]);l[0]=Sr(d,l[0]),u[0]=wr(d,u[0])}v=f(e,i,a,s,ym);for(var c=0;c<v;c++){var p=h(e,i,a,s,ym[c]);l[1]=Sr(p,l[1]),u[1]=wr(p,u[1])}l[0]=Sr(t,l[0]),u[0]=wr(t,u[0]),l[0]=Sr(o,l[0]),u[0]=wr(o,u[0]),l[1]=Sr(e,l[1]),u[1]=wr(e,u[1]),l[1]=Sr(s,l[1]),u[1]=wr(s,u[1])}function gC(t,e,r,i,n,a,o,s){var l=dx,u=Pe,f=wr(Sr(l(t,r,n),1),0),h=wr(Sr(l(e,i,a),1),0),v=u(t,r,n,f),c=u(e,i,a,h);o[0]=Sr(t,n,v),o[1]=Sr(e,a,c),s[0]=wr(t,n,v),s[1]=wr(e,a,c)}function mC(t,e,r,i,n,a,o,s,l){var u=Va,f=Ga,h=Math.abs(n-a);if(h%dn<1e-4&&h>1e-4){s[0]=t-r,s[1]=e-i,l[0]=t+r,l[1]=e+i;return}if(wl[0]=Zh(n)*r+t,wl[1]=Yh(n)*i+e,bl[0]=Zh(a)*r+t,bl[1]=Yh(a)*i+e,u(s,wl,bl),f(l,wl,bl),n=n%dn,n<0&&(n=n+dn),a=a%dn,a<0&&(a=a+dn),n>a&&!o?a+=dn:n<a&&o&&(n+=dn),o){var v=a;a=n,n=v}for(var c=0;c<a;c+=Math.PI/2)c>n&&(Al[0]=Zh(c)*r+t,Al[1]=Yh(c)*i+e,u(s,Al,s),f(l,Al,l))}var kt={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},pn=[],gn=[],Kr=[],Ni=[],jr=[],Qr=[],$h=Math.min,qh=Math.max,mn=Math.cos,_n=Math.sin,pi=Math.abs,Wv=Math.PI,Wi=Wv*2,Kh=typeof Float32Array<"u",Mo=[];function jh(t){var e=Math.round(t/Wv*1e8)/1e8;return e%2*Wv}function _C(t,e){var r=jh(t[0]);r<0&&(r+=Wi);var i=r-t[0],n=t[1];n+=i,!e&&n-r>=Wi?n=r+Wi:e&&r-n>=Wi?n=r-Wi:!e&&r>n?n=r+(Wi-jh(r-n)):e&&r<n&&(n=r-(Wi-jh(n-r))),t[0]=r,t[1]=n}var Mi=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=pi(i/Zu/e)||0,this._uy=pi(i/Zu/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(kt.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=pi(e-this._xi),n=pi(r-this._yi),a=i>this._ux||n>this._uy;if(this.addData(kt.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(kt.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(kt.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(),Mo[0]=n,Mo[1]=a,_C(Mo,o),n=Mo[0],a=Mo[1];var s=a-n;return this.addData(kt.A,e,r,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,i,n,a,o),this._xi=mn(a)*i+e,this._yi=_n(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(kt.R,e,r,i,n),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(kt.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)&&Kh&&(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();Kh&&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,Kh&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){Kr[0]=Kr[1]=jr[0]=jr[1]=Number.MAX_VALUE,Ni[0]=Ni[1]=Qr[0]=Qr[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 kt.M:r=n=e[o++],i=a=e[o++],jr[0]=n,jr[1]=a,Qr[0]=n,Qr[1]=a;break;case kt.L:mm(r,i,e[o],e[o+1],jr,Qr),r=e[o++],i=e[o++];break;case kt.C:pC(r,i,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],jr,Qr),r=e[o++],i=e[o++];break;case kt.Q:gC(r,i,e[o++],e[o++],e[o],e[o+1],jr,Qr),r=e[o++],i=e[o++];break;case kt.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=mn(c)*h+u,a=_n(c)*v+f),mC(u,f,h,v,c,d,p,jr,Qr),r=mn(d)*h+u,i=_n(d)*v+f;break;case kt.R:n=r=e[o++],a=i=e[o++];var g=e[o++],m=e[o++];mm(n,a,n+g,a+m,jr,Qr);break;case kt.Z:r=n,i=a;break}Va(Kr,Kr,jr),Ga(Ni,Ni,Qr)}return o===0&&(Kr[0]=Kr[1]=Ni[0]=Ni[1]=0),new It(Kr[0],Kr[1],Ni[0]-Kr[0],Ni[1]-Kr[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 kt.M:a=s=e[v++],o=l=e[v++];break;case kt.L:{var g=e[v++],m=e[v++],_=g-a,y=m-o;(pi(_)>i||pi(y)>n||v===r-1)&&(p=Math.sqrt(_*_+y*y),a=g,o=m);break}case kt.C:{var x=e[v++],S=e[v++],g=e[v++],m=e[v++],T=e[v++],w=e[v++];p=NA(a,o,x,S,g,m,T,w,10),a=T,o=w;break}case kt.Q:{var x=e[v++],S=e[v++],g=e[v++],m=e[v++];p=BA(a,o,x,S,g,m,10),a=g,o=m;break}case kt.A:var b=e[v++],A=e[v++],C=e[v++],E=e[v++],D=e[v++],L=e[v++],P=L+D;v+=1,e[v++],d&&(s=mn(D)*C+b,l=_n(D)*E+A),p=qh(C,E)*$h(Wi,Math.abs(L)),a=mn(P)*C+b,o=_n(P)*E+A;break;case kt.R:{s=a=e[v++],l=o=e[v++];var N=e[v++],I=e[v++];p=N*2+I*2;break}case kt.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!==kt.L&&y>0&&(e.lineTo(x,S),y=0),w){case kt.M:s=u=i[T++],l=f=i[T++],e.moveTo(u,f);break;case kt.L:{h=i[T++],v=i[T++];var A=pi(h-u),C=pi(v-f);if(A>n||C>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 L=A*A+C*C;L>y&&(x=h,S=v,y=L)}break}case kt.C:{var P=i[T++],N=i[T++],I=i[T++],k=i[T++],O=i[T++],U=i[T++];if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;Gu(u,P,I,O,D,pn),Gu(f,N,k,U,D,gn),e.bezierCurveTo(pn[1],gn[1],pn[2],gn[2],pn[3],gn[3]);break t}g+=E}e.bezierCurveTo(P,N,I,k,O,U),u=O,f=U;break}case kt.Q:{var P=i[T++],N=i[T++],I=i[T++],k=i[T++];if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;Wu(u,P,I,D,pn),Wu(f,N,k,D,gn),e.quadraticCurveTo(pn[1],gn[1],pn[2],gn[2]);break t}g+=E}e.quadraticCurveTo(P,N,I,k),u=I,f=k;break}case kt.A:var z=i[T++],nt=i[T++],$=i[T++],J=i[T++],it=i[T++],Pt=i[T++],pt=i[T++],Bt=!i[T++],Xt=$>J?$:J,Nt=pi($-J)>.001,Et=it+Pt,K=!1;if(c){var E=d[m++];g+E>_&&(Et=it+Pt*(_-g)/E,K=!0),g+=E}if(Nt&&e.ellipse?e.ellipse(z,nt,$,J,pt,it,Et,Bt):e.arc(z,nt,Xt,it,Et,Bt),K)break t;b&&(s=mn(it)*$+z,l=_n(it)*J+nt),u=mn(Et)*$+z,f=_n(Et)*J+nt;break;case kt.R:s=u=i[T],l=f=i[T+1],h=i[T++],v=i[T++];var wt=i[T++],se=i[T++];if(c){var E=d[m++];if(g+E>_){var Zt=_-g;e.moveTo(h,v),e.lineTo(h+$h(Zt,wt),v),Zt-=wt,Zt>0&&e.lineTo(h+wt,v+$h(Zt,se)),Zt-=se,Zt>0&&e.lineTo(h+qh(wt-Zt,0),v+se),Zt-=wt,Zt>0&&e.lineTo(h,v+qh(se-Zt,0));break t}g+=E}e.rect(h,v,wt,se);break;case kt.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=kt,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function _a(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 yC(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=vx(t,e,r,i,n,a,o,s,u,f,null);return v<=h/2}function xC(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=px(t,e,r,i,n,a,s,l,null);return f<=u/2}var xm=Math.PI*2;function Si(t){return t%=xm,t<0&&(t+=xm),t}var Do=Math.PI*2;function TC(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)%Do<1e-4)return!0;if(a){var h=i;i=Si(n),n=Si(h)}else i=Si(i),n=Si(n);i>n&&(n+=Do);var v=Math.atan2(l,s);return v<0&&(v+=Do),v>=i&&v<=n||v+Do>=i&&v+Do<=n}function yn(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 Oi=Mi.CMD,xn=Math.PI*2,SC=1e-4;function wC(t,e){return Math.abs(t-e)<SC}var Ue=[-1,-1,-1],yr=[-1,-1];function bC(){var t=yr[0];yr[0]=yr[1],yr[1]=t}function AC(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=Vu(e,i,a,s,u,Ue);if(f===0)return 0;for(var h=0,v=-1,c=void 0,d=void 0,p=0;p<f;p++){var g=Ue[p],m=g===0||g===1?.5:1,_=ye(t,r,n,o,g);_<l||(v<0&&(v=cx(e,i,a,s,yr),yr[1]<yr[0]&&v>1&&bC(),c=ye(e,i,a,s,yr[0]),v>1&&(d=ye(e,i,a,s,yr[1]))),v===2?g<yr[0]?h+=c<e?m:-m:g<yr[1]?h+=d<c?m:-m:h+=s<d?m:-m:g<yr[0]?h+=c<e?m:-m:h+=s<c?m:-m)}return h}function EC(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=OA(e,i,a,s,Ue);if(l===0)return 0;var u=dx(e,i,a);if(u>=0&&u<=1){for(var f=0,h=Pe(e,i,a,u),v=0;v<l;v++){var c=Ue[v]===0||Ue[v]===1?.5:1,d=Pe(t,r,n,Ue[v]);d<o||(Ue[v]<u?f+=h<e?c:-c:f+=a<h?c:-c)}return f}else{var c=Ue[0]===0||Ue[0]===1?.5:1,d=Pe(t,r,n,Ue[0]);return d<o?0:a<e?c:-c}}function CC(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);Ue[0]=-l,Ue[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=xn-1e-4){i=0,n=xn;var f=a?1:-1;return o>=Ue[0]+t&&o<=Ue[1]+t?f:0}if(i>n){var h=i;i=n,n=h}i<0&&(i+=xn,n+=xn);for(var v=0,c=0;c<2;c++){var d=Ue[c];if(d+t>o){var p=Math.atan2(s,d),f=a?1:-1;p<0&&(p=xn+p),(p>=i&&p<=n||p+xn>=i&&p+xn<=n)&&(p>Math.PI/2&&p<Math.PI*1.5&&(f=-f),v+=f)}}return v}function qx(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===Oi.M&&d>1&&(r||(s+=yn(l,u,f,h,i,n))),g&&(l=a[d],u=a[d+1],f=l,h=u),p){case Oi.M:f=a[d++],h=a[d++],l=f,u=h;break;case Oi.L:if(r){if(_a(l,u,a[d],a[d+1],e,i,n))return!0}else s+=yn(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Oi.C:if(r){if(yC(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=AC(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 Oi.Q:if(r){if(xC(l,u,a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=EC(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Oi.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+=yn(l,u,v,c,i,n);var b=(i-m)*x/y+m;if(r){if(TC(m,_,x,S,S+T,w,e,b,n))return!0}else s+=CC(m,_,x,S,S+T,w,b,n);l=Math.cos(S+T)*y+m,u=Math.sin(S+T)*x+_;break;case Oi.R:f=l=a[d++],h=u=a[d++];var A=a[d++],C=a[d++];if(v=f+A,c=h+C,r){if(_a(f,h,v,h,e,i,n)||_a(v,h,v,c,e,i,n)||_a(v,c,f,c,e,i,n)||_a(f,c,f,h,e,i,n))return!0}else s+=yn(v,h,v,c,i,n),s+=yn(f,c,f,h,i,n);break;case Oi.Z:if(r){if(_a(l,u,f,h,e,i,n))return!0}else s+=yn(l,u,f,h,i,n);l=f,u=h;break}}return!r&&!wC(u,h)&&(s+=yn(l,u,f,h,i,n)||0),s!==0}function MC(t,e,r){return qx(t,0,!1,e,r)}function DC(t,e,r,i){return qx(t,e,!0,r,i)}var Ku=Mt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},jn),LC={style:Mt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Hf.style)},Qh=hi.concat(["invisible","culling","z","z2","zlevel","parent"]),RC=function(t){W(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<Qh.length;++s)n[Qh[s]]=this[Qh[s]];n.__dirty|=ur}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(r){var i=_t(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?H(this.style,s):this.useStyle(s):o==="shape"?H(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=Xu(r,0);return i>.5?zv:i>.2?dE:Uv}else if(r)return Uv}return zv},e.prototype.getInsideTextStroke=function(r){var i=this.style.fill;if(q(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Xu(r,0)<kv;if(a===o)return i}},e.prototype.buildPath=function(r,i,n){},e.prototype.pathUpdated=function(){this.__dirty&=~ka},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 Mi(!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&ka)&&(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)),DC(s,l/u,r,i)))return!0}if(this.hasFill())return MC(s,r,i)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=ka,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:H(n,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&ka)},e.prototype.createStyle=function(r){return If(Ku,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var i=this._normalState;r.shape&&!i.shape&&(i.shape=H({},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=H({},n.shape),H(u,i.shape)):(u=H({},a?this.shape:n.shape),H(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=H({},this.shape);for(var f={},h=_t(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 LC},e.prototype.isZeroArea=function(){return!1},e.extend=function(r){var i=function(a){W(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 lt(r.style)},o.prototype.getDefaultShape=function(){return lt(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=ur|rs|ka}(),e}(ua);const Ut=RC;var PC=Mt({strokeFirst:!0,font:en,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Ku),Kx=function(t){W(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 If(PC,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=np(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}(ua);Kx.prototype.type="tspan";const ju=Kx;var IC=Mt({x:0,y:0},jn),NC={style:Mt({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Hf.style)};function OC(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var jx=function(t){W(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return If(IC,r)},e.prototype._getSize=function(r){var i=this.style,n=i[r];if(n!=null)return n;var a=OC(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 NC},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new It(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e}(ua);jx.prototype.type="image";const Pr=jx;function BC(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 Xa=Math.round;function Qx(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&&(Xa(i*2)===Xa(n*2)&&(t.x1=t.x2=Wn(i,s,!0)),Xa(a*2)===Xa(o*2)&&(t.y1=t.y2=Wn(a,s,!0))),t}}function Jx(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=Wn(i,s,!0),t.y=Wn(n,s,!0),t.width=Math.max(Wn(i+a,s,!1)-t.x,a===0?0:1),t.height=Math.max(Wn(n+o,s,!1)-t.y,o===0?0:1)),t}}function Wn(t,e,r){if(!e)return t;var i=Xa(t*2);return(i+Xa(e))%2===0?i/2:(i+(r?1:-1))/2}var FC=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),kC={},tT=function(t){W(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new FC},e.prototype.buildPath=function(r,i){var n,a,o,s;if(this.subPixelOptimize){var l=Jx(kC,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?BC(r,i):r.rect(n,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Ut);tT.prototype.type="rect";const ie=tT;var Tm={fill:"#000"},Sm=2,zC={style:Mt({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},Hf.style)},eT=function(t){W(e,t);function e(r){var i=t.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=Tm,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,VC(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 It(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||Tm},e.prototype.setTextContent=function(r){},e.prototype._mergeStyle=function(r,i){if(!i)return r;var n=i.rich,a=r.rich||n&&{};return H(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=_t(i),a=0;a<n.length;a++){var o=n[a];r[o]=r[o]||{},H(r[o],i[o])}},e.prototype.getAnimationStyleProps=function(){return zC},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||en,n=r.padding,a=Dm(r),o=aC(a,r),s=Jh(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=za(g,o.contentHeight,_);if(s||n){var S=ns(p,f,m),T=za(g,u,_);s&&this._renderBackground(r,r,S,T,f,u)}x+=c/2,n&&(y=Mm(p,m,n),_==="top"?x+=n[0]:_==="bottom"&&(x-=n[2]));for(var w=0,b=!1,A=Cm("fill"in r?r.fill:(b=!0,d.fill)),C=Em("stroke"in r?r.stroke:!l&&(!d.autoStroke||b)?(w=Sm,d.stroke):null),E=r.textShadowBlur>0,D=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),L=o.calculatedLineHeight,P=0;P<v.length;P++){var N=this._getOrCreateChild(ju),I=N.createStyle();N.useStyle(I),I.text=v[P],I.x=y,I.y=x,m&&(I.textAlign=m),I.textBaseline="middle",I.opacity=r.opacity,I.strokeFirst=!0,E&&(I.shadowBlur=r.textShadowBlur||0,I.shadowColor=r.textShadowColor||"transparent",I.shadowOffsetX=r.textShadowOffsetX||0,I.shadowOffsetY=r.textShadowOffsetY||0),I.stroke=C,I.fill=A,C&&(I.lineWidth=r.lineWidth||w,I.lineDash=r.lineDash,I.lineDashOffset=r.lineDashOffset||0),I.font=i,bm(I,r),x+=c,D&&N.setBoundingRect(new It(ns(I.x,r.width,I.textAlign),za(I.y,L,I.textBaseline),h,L))}},e.prototype._updateRichTexts=function(){var r=this.style,i=Dm(r),n=lC(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=ns(u,o,v),p=za(f,s,c),g=d,m=p;l&&(g+=l[3],m+=l[0]);var _=g+a;Jh(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,C=0,E=g,D=_,L=w-1,P=void 0;C<w&&(P=T[C],!P.align||P.align==="left");)this._placeToken(P,r,b,m,E,"left",y),A-=P.width,E+=P.width,C++;for(;L>=0&&(P=T[L],P.align==="right");)this._placeToken(P,r,b,m,D,"right",y),A-=P.width,D-=P.width,L--;for(E+=(a-(E-g)-(_-D)-A)/2;C<=L;)P=T[C],this._placeToken(P,r,b,m,E+P.width/2,"center",y),E+=P.width,C++;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&&Jh(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=Mm(o,s,d),h-=r.height/2-d[0]-r.innerHeight/2);var p=this._getOrCreateChild(ju),g=p.createStyle();p.useStyle(g);var m=this._defaultStyle,_=!1,y=0,x=Cm("fill"in u?u.fill:"fill"in i?i.fill:(_=!0,m.fill)),S=Em("stroke"in u?u.stroke:"stroke"in i?i.stroke:!c&&!l&&(!m.autoStroke||_)?(y=Sm,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||en,g.opacity=vu(u.opacity,i.opacity,1),bm(g,u),S&&(g.lineWidth=vu(u.lineWidth,i.lineWidth,y),g.lineDash=gt(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 It(ns(g.x,w,g.textAlign),za(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(ie),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=gt(r.fillOpacity,1)}else if(h){g=this._getOrCreateChild(Pr),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=gt(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=vu(r.opacity,i.opacity,1)},e.makeFont=function(r){var i="";return iT(r)&&(i=[r.fontStyle,r.fontWeight,rT(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),i&&oi(i)||r.textFont||r.font},e}(ua),UC={left:!0,right:1,center:1},HC={top:1,bottom:1,middle:1},wm=["fontStyle","fontWeight","fontSize","fontFamily"];function rT(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?Zd+"px":t+"px"}function bm(t,e){for(var r=0;r<wm.length;r++){var i=wm[r],n=e[i];n!=null&&(t[i]=n)}}function iT(t){return t.fontSize!=null||t.fontFamily||t.fontWeight}function VC(t){return Am(t),M(t.rich,Am),t}function Am(t){if(t){t.font=eT.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||UC[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||HC[r]?r:"top";var i=t.padding;i&&(t.padding=tx(t.padding))}}function Em(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function Cm(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function Mm(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function Dm(t){var e=t.text;return e!=null&&(e+=""),e}function Jh(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}const Jt=eT;var Ft=Kt(),GC=function(t,e,r,i){if(i){var n=Ft(i);n.dataIndex=r,n.dataType=e,n.seriesIndex=t,i.type==="group"&&i.traverse(function(a){var o=Ft(a);o.seriesIndex=t,o.dataIndex=r,o.dataType=e})}},Lm=1,Rm={},nT=Kt(),cp=Kt(),vp=0,Vf=1,Gf=2,Lr=["emphasis","blur","select"],Qu=["normal","emphasis","blur","select"],WC=10,XC=9,Qn="highlight",xu="downplay",gs="select",Tu="unselect",ms="toggleSelect";function ya(t){return t!=null&&t!=="none"}var Pm=new _o(100);function Im(t){if(q(t)){var e=Pm.get(t);return e||(e=Kg(t,-.1),Pm.put(t,e)),e}else if(Pf(t)){var r=H({},t);return r.colorStops=j(t.colorStops,function(i){return{offset:i.offset,color:Kg(i.color,-.1)}}),r}return t}function Wf(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function aT(t){Wf(t,"emphasis",Gf)}function oT(t){t.hoverState===Gf&&Wf(t,"normal",vp)}function dp(t){Wf(t,"blur",Vf)}function sT(t){t.hoverState===Vf&&Wf(t,"normal",vp)}function YC(t){t.selected=!0}function ZC(t){t.selected=!1}function Nm(t,e,r){e(t,r)}function Di(t,e,r){Nm(t,e,r),t.isGroup&&t.traverse(function(i){Nm(i,e,r)})}function Om(t,e){switch(e){case"emphasis":t.hoverState=Gf;break;case"normal":t.hoverState=vp;break;case"blur":t.hoverState=Vf;break;case"select":t.selected=!0}}function $C(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 qC(t,e,r,i){var n=r&&Ct(r,"select")>=0,a=!1;if(t instanceof Ut){var o=nT(t),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(ya(s)||ya(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=H({},i),u=H({},u),u.fill=s):!ya(u.fill)&&ya(s)?(a=!0,i=H({},i),u=H({},u),u.fill=Im(s)):!ya(u.stroke)&&ya(l)&&(a||(i=H({},i),u=H({},u)),u.stroke=Im(l)),i.style=u}}if(i&&i.z2==null){a||(i=H({},i));var f=t.z2EmphasisLift;i.z2=t.z2+(f??WC)}return i}function KC(t,e,r){if(r&&r.z2==null){r=H({},r);var i=t.z2SelectLift;r.z2=t.z2+(i??XC)}return r}function jC(t,e,r){var i=Ct(t.currentStates,e)>=0,n=t.style.opacity,a=i?null:$C(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=H({},r),o=H({opacity:i?n:a.opacity*.1},o),r.style=o),r}function tc(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return qC(this,t,e,r);if(t==="blur")return jC(this,t,r);if(t==="select")return KC(this,t,r)}return r}function QC(t){t.stateProxy=tc;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=tc),r&&(r.stateProxy=tc)}function Bm(t,e){!hT(t,e)&&!t.__highByOuter&&Di(t,aT)}function Fm(t,e){!hT(t,e)&&!t.__highByOuter&&Di(t,oT)}function Ju(t,e){t.__highByOuter|=1<<(e||0),Di(t,aT)}function tf(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Di(t,oT)}function JC(t){Di(t,dp)}function lT(t){Di(t,sT)}function uT(t){Di(t,YC)}function fT(t){Di(t,ZC)}function hT(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function cT(t){var e=t.getModel(),r=[],i=[];e.eachComponent(function(n,a){var o=cp(a),s=n==="series",l=s?t.getViewOfSeriesModel(a):t.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){sT(u)}),s&&r.push(a)),o.isBlured=!1}),M(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(r,!1,e)})}function Xv(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&&lT(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"||dp(g)}),Ze(e))a(u.getData(),e);else if(Q(e))for(var d=_t(e),p=0;p<d.length;p++)a(u.getData(d[p]),e[d[p]]);l.push(u),cp(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 Yv(t,e,r){if(!(t==null||e==null)){var i=r.getModel().getComponent(t,e);if(i){cp(i).isBlured=!0;var n=r.getViewOfComponentModel(i);!n||!n.focusBlurEnabled||n.group.traverse(function(a){dp(a)})}}}function tM(t,e,r){var i=t.seriesIndex,n=t.getData(e.dataType);if(n){var a=ia(n,e);a=(Y(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=Ft(o);Xv(i,u.focus,u.blurScope,r)}else{var f=t.get(["emphasis","focus"]),h=t.get(["emphasis","blurScope"]);f!=null&&Xv(i,f,h,r)}}}function pp(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(Ft(s[u]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function eM(t,e,r){var i=Ft(t),n=pp(i.componentMainType,i.componentIndex,i.componentHighDownName,r),a=n.dispatchers,o=n.focusSelf;a?(o&&Yv(i.componentMainType,i.componentIndex,r),M(a,function(s){return Bm(s,e)})):(Xv(i.seriesIndex,i.focus,i.blurScope,r),i.focus==="self"&&Yv(i.componentMainType,i.componentIndex,r),Bm(t,e))}function rM(t,e,r){cT(r);var i=Ft(t),n=pp(i.componentMainType,i.componentIndex,i.componentHighDownName,r).dispatchers;n?M(n,function(a){return Fm(a,e)}):Fm(t,e)}function iM(t,e,r){if(qv(e)){var i=e.dataType,n=t.getData(i),a=ia(n,e);Y(a)||(a=[a]),t[e.type===ms?"toggleSelect":e.type===gs?"select":"unselect"](a,i)}}function km(t){var e=t.getAllData();M(e,function(r){var i=r.data,n=r.type;i.eachItemGraphicEl(function(a,o){t.isSelected(o,n)?uT(a):fT(a)})})}function nM(t){var e=[];return t.eachSeries(function(r){var i=r.getAllData();M(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 ef(t,e,r){gp(t,!0),Di(t,QC),oM(t,e,r)}function aM(t){gp(t,!1)}function Zv(t,e,r,i){i?aM(t):ef(t,e,r)}function oM(t,e,r){var i=Ft(t);e!=null?(i.focus=e,i.blurScope=r):i.focus&&(i.focus=null)}var zm=["emphasis","blur","select"],sM={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Um(t,e,r,i){r=r||"itemStyle";for(var n=0;n<zm.length;n++){var a=zm[n],o=e.getModel([a,r]),s=t.ensureState(a);s.style=i?i(o):o[sM[r]]()}}function gp(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 $v(t){return!!(t&&t.__highDownDispatcher)}function lM(t){var e=Rm[t];return e==null&&Lm<=32&&(e=Rm[t]=Lm++),e}function qv(t){var e=t.type;return e===gs||e===Tu||e===ms}function Hm(t){var e=t.type;return e===Qn||e===xu}function uM(t){var e=nT(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 xa=Mi.CMD,fM=[[],[],[]],Vm=Math.sqrt,hM=Math.atan2;function cM(t,e){if(e){var r=t.data,i=t.len(),n,a,o,s,l,u,f=xa.M,h=xa.C,v=xa.L,c=xa.R,d=xa.A,p=xa.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=hM(-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++],Mr(u,u,e),r[s++]=u[0],r[s++]=u[1],u[0]+=r[o++],u[1]+=r[o++],Mr(u,u,e),r[s++]=u[0],r[s++]=u[1]}for(l=0;l<a;l++){var S=fM[l];S[0]=r[o++],S[1]=r[o++],Mr(S,S,e),r[s++]=S[0],r[s++]=S[1]}}t.increaseVersion()}}var ec=Math.sqrt,El=Math.sin,Cl=Math.cos,Lo=Math.PI;function Gm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Kv(t,e){return(t[0]*e[0]+t[1]*e[1])/(Gm(t)*Gm(e))}function Wm(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Kv(t,e))}function Xm(t,e,r,i,n,a,o,s,l,u,f){var h=l*(Lo/180),v=Cl(h)*(t-r)/2+El(h)*(e-i)/2,c=-1*El(h)*(t-r)/2+Cl(h)*(e-i)/2,d=v*v/(o*o)+c*c/(s*s);d>1&&(o*=ec(d),s*=ec(d));var p=(n===a?-1:1)*ec((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+Cl(h)*g-El(h)*m,y=(e+i)/2+El(h)*g+Cl(h)*m,x=Wm([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=Wm(S,T);if(Kv(S,T)<=-1&&(w=Lo),Kv(S,T)>=1&&(w=0),w<0){var b=Math.round(w/Lo*1e6)/1e6;w=Lo*2+b%2*Lo}f.addData(u,_,y,o,s,x,w,h,a)}var vM=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,dM=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function pM(t){var e=new Mi;if(!t)return e;var r=0,i=0,n=r,a=i,o,s=Mi.CMD,l=t.match(vM);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(dM)||[],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,C=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,C=e.len(),E=e.data,o===s.C&&(m+=r-E[C-4],_+=i-E[C-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,C=e.len(),E=e.data,o===s.C&&(m+=r-E[C-4],_+=i-E[C-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,C=e.len(),E=e.data,o===s.Q&&(m+=r-E[C-4],_+=i-E[C-3]),r=c[g++],i=c[g++],v=s.Q,e.addData(v,m,_,r,i);break;case"t":m=r,_=i,C=e.len(),E=e.data,o===s.Q&&(m+=r-E[C-4],_+=i-E[C-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,Xm(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,Xm(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 vT=function(t){W(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.applyTransform=function(r){},e}(Ut);function dT(t){return t.setData!=null}function pT(t,e){var r=pM(t),i=H({},e);return i.buildPath=function(n){if(dT(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){cM(r,n),this.dirtyShape()},i}function gM(t,e){return new vT(pT(t,e))}function mM(t,e){var r=pT(t,e),i=function(n){W(a,n);function a(o){var s=n.call(this,o)||this;return s.applyTransform=r.applyTransform,s.buildPath=r.buildPath,s}return a}(vT);return i}function _M(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 Ut(e);return o.createPathProxy(),o.buildPath=function(s){if(dT(s)){s.appendPath(r);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var yM=function(){function t(){this.cx=0,this.cy=0,this.r=0}return t}(),gT=function(t){W(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new yM},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}(Ut);gT.prototype.type="circle";const mp=gT;var xM=function(){function t(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return t}(),mT=function(t){W(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){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}(Ut);mT.prototype.type="ellipse";const _T=mT;var yT=Math.PI,rc=yT*2,Tn=Math.sin,Ta=Math.cos,TM=Math.acos,Le=Math.atan2,Ym=Math.abs,_s=Math.sqrt,as=Math.max,Jr=Math.min,kr=1e-4;function SM(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<kr))return v=(f*(e-a)-h*(t-n))/v,[t+v*l,e+v*u]}function Ml(t,e,r,i,n,a,o){var s=t-r,l=e-i,u=(o?a:-a)/_s(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)*_s(as(0,S*S*x-T*T)),b=(T*y-_*w)/x,A=(-T*_-y*w)/x,C=(T*y+_*w)/x,E=(-T*_+y*w)/x,D=b-g,L=A-m,P=C-g,N=E-m;return D*D+L*L>P*P+N*N&&(b=C,A=E),{cx:b,cy:A,x0:-f,y0:-h,x1:b*(n/S-1),y1:A*(n/S-1)}}function wM(t){var e;if(Y(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 bM(t,e){var r,i=as(e.r,0),n=as(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=Ym(u-l),d=c>rc&&c%rc;if(d>kr&&(c=d),!(i>kr))t.moveTo(f,h);else if(c>rc-kr)t.moveTo(f+i*Ta(l),h+i*Tn(l)),t.arc(f,h,i,l,u,!v),n>kr&&(t.moveTo(f+n*Ta(u),h+n*Tn(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,C=void 0,E=void 0,D=void 0,L=void 0,P=void 0,N=i*Ta(l),I=i*Tn(l),k=n*Ta(u),O=n*Tn(u),U=c>kr;if(U){var z=e.cornerRadius;z&&(r=wM(z),p=r[0],g=r[1],m=r[2],_=r[3]);var nt=Ym(i-n)/2;if(y=Jr(nt,m),x=Jr(nt,_),S=Jr(nt,p),T=Jr(nt,g),A=w=as(y,x),C=b=as(S,T),(w>kr||b>kr)&&(E=i*Ta(u),D=i*Tn(u),L=n*Ta(l),P=n*Tn(l),c<yT)){var $=SM(N,I,L,P,E,D,k,O);if($){var J=N-$[0],it=I-$[1],Pt=E-$[0],pt=D-$[1],Bt=1/Tn(TM((J*Pt+it*pt)/(_s(J*J+it*it)*_s(Pt*Pt+pt*pt)))/2),Xt=_s($[0]*$[0]+$[1]*$[1]);A=Jr(w,(i-Xt)/(Bt+1)),C=Jr(b,(n-Xt)/(Bt-1))}}}if(!U)t.moveTo(f+N,h+I);else if(A>kr){var Nt=Jr(m,A),Et=Jr(_,A),K=Ml(L,P,N,I,i,Nt,v),wt=Ml(E,D,k,O,i,Et,v);t.moveTo(f+K.cx+K.x0,h+K.cy+K.y0),A<w&&Nt===Et?t.arc(f+K.cx,h+K.cy,A,Le(K.y0,K.x0),Le(wt.y0,wt.x0),!v):(Nt>0&&t.arc(f+K.cx,h+K.cy,Nt,Le(K.y0,K.x0),Le(K.y1,K.x1),!v),t.arc(f,h,i,Le(K.cy+K.y1,K.cx+K.x1),Le(wt.cy+wt.y1,wt.cx+wt.x1),!v),Et>0&&t.arc(f+wt.cx,h+wt.cy,Et,Le(wt.y1,wt.x1),Le(wt.y0,wt.x0),!v))}else t.moveTo(f+N,h+I),t.arc(f,h,i,l,u,!v);if(!(n>kr)||!U)t.lineTo(f+k,h+O);else if(C>kr){var Nt=Jr(p,C),Et=Jr(g,C),K=Ml(k,O,E,D,n,-Et,v),wt=Ml(N,I,L,P,n,-Nt,v);t.lineTo(f+K.cx+K.x0,h+K.cy+K.y0),C<b&&Nt===Et?t.arc(f+K.cx,h+K.cy,C,Le(K.y0,K.x0),Le(wt.y0,wt.x0),!v):(Et>0&&t.arc(f+K.cx,h+K.cy,Et,Le(K.y0,K.x0),Le(K.y1,K.x1),!v),t.arc(f,h,n,Le(K.cy+K.y1,K.cx+K.x1),Le(wt.cy+wt.y1,wt.cx+wt.x1),v),Nt>0&&t.arc(f+wt.cx,h+wt.cy,Nt,Le(wt.y1,wt.x1),Le(wt.y0,wt.x0),!v))}else t.lineTo(f+k,h+O),t.arc(f,h,n,u,l,v)}t.closePath()}}}var AM=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}(),xT=function(t){W(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new AM},e.prototype.buildPath=function(r,i){bM(r,i)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Ut);xT.prototype.type="sector";const _p=xT;var EM=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),TT=function(t){W(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){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}(Ut);TT.prototype.type="ring";const ST=TT;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++)Va(f,f,t[v]),Ga(h,h,t[v]);Va(f,f,i[0]),Ga(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(rA(t[v]));continue}else l=t[v-1],u=t[v+1];iA(a,u,l),mh(a,a,e);var p=bv(d,l),g=bv(d,u),m=p+g;m!==0&&(p/=m,g/=m),mh(o,a,-p),mh(s,a,g);var _=Og([],d,o),y=Og([],d,s);i&&(Ga(_,_,f),Va(_,_,h),Ga(y,y,f),Va(y,y,h)),n.push(_),n.push(y)}return r&&n.push(n.shift()),n}function wT(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 MM=function(){function t(){this.points=null,this.smooth=0,this.smoothConstraint=null}return t}(),Js=function(t){W(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){wT(r,i,!0)},e}(Ut);Js.prototype.type="polygon";var DM=function(){function t(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return t}(),bT=function(t){W(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 DM},e.prototype.buildPath=function(r,i){wT(r,i,!1)},e}(Ut);bT.prototype.type="polyline";const Xf=bT;var LM={},RM=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return t}(),AT=function(t){W(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 RM},e.prototype.buildPath=function(r,i){var n,a,o,s;if(this.subPixelOptimize){var l=Qx(LM,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}(Ut);AT.prototype.type="line";const na=AT;var Ke=[],PM=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 Zm(t,e,r){var i=t.cpx2,n=t.cpy2;return i!=null||n!=null?[(r?Zg:ye)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?Zg:ye)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?$g:Pe)(t.x1,t.cpx1,t.x2,e),(r?$g:Pe)(t.y1,t.cpy1,t.y2,e)]}var ET=function(t){W(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=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&&(Wu(n,l,o,v,Ke),l=Ke[1],o=Ke[2],Wu(a,u,s,v,Ke),u=Ke[1],s=Ke[2]),r.quadraticCurveTo(l,u,o,s)):(v<1&&(Gu(n,l,f,o,v,Ke),l=Ke[1],f=Ke[2],o=Ke[3],Gu(a,u,h,s,v,Ke),u=Ke[1],h=Ke[2],s=Ke[3]),r.bezierCurveTo(l,u,f,h,o,s)))},e.prototype.pointAt=function(r){return Zm(this.shape,r,!1)},e.prototype.tangentAt=function(r){var i=Zm(this.shape,r,!0);return oA(i,i)},e}(Ut);ET.prototype.type="bezier-curve";const CT=ET;var IM=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}(),MT=function(t){W(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.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}(Ut);MT.prototype.type="arc";const yp=MT;var NM=function(t){W(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),Ut.prototype.getBoundingRect.call(this)},e}(Ut);const DT=NM;var OM=function(){function t(e){this.colorStops=e||[]}return t.prototype.addColorStop=function(e,r){this.colorStops.push({offset:e,color:r})},t}();const LT=OM;var xp=function(t){W(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}(LT),BM=function(t){W(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}(LT);const FM=BM;var Sn=[0,0],wn=[0,0],Dl=new St,Ll=new St,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 St;for(var i=0;i<2;i++)this._axes[i]=new St;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);St.sub(n[0],i[1],i[0]),St.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 Dl.set(1/0,1/0),Ll.set(0,0),!this._intersectCheckOneSide(this,e,Dl,Ll,n,1)&&(i=!1,n)||!this._intersectCheckOneSide(e,this,Dl,Ll,n,-1)&&(i=!1,n)||n||St.copy(r,i?Dl:Ll),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,Sn),this._getProjMinMaxOnAxis(l,r._corners,wn),Sn[1]<wn[0]||Sn[0]>wn[1]){if(s=!1,a)return s;var f=Math.abs(wn[0]-Sn[1]),h=Math.abs(Sn[0]-wn[1]);Math.min(f,h)>n.len()&&(f<h?St.scale(n,u,-f*o):St.scale(n,u,h*o))}else if(i){var f=Math.abs(wn[0]-Sn[1]),h=Math.abs(Sn[0]-wn[1]);Math.min(f,h)<i.len()&&(f<h?St.scale(i,u,f*o):St.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 rf=kM;var zM=[],UM=function(t){W(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 It(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}(ua);const HM=UM;var VM=Kt();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=gt(i.duration,200),f=gt(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)),ft(h)&&(h=h(r,n)),ft(u)&&(u=u(r));var v={duration:u||0,delay:h,easing:f};return v}else return null}function Sp(t,e,r,i,n,a,o){var s=!1,l;ft(n)?(o=a,a=n,n=null):Q(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 Rr(t,e,r,i,n,a){Sp("update",t,e,r,i,n,a)}function rn(t,e,r,i,n,a){Sp("enter",t,e,r,i,n,a)}function to(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 nf(t,e,r,i,n,a){to(t)||Sp("leave",t,e,r,i,n,a)}function $m(t,e,r,i){t.removeTextContent(),t.removeTextGuideLine(),nf(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||$m(n,e,r,i)}):$m(t,e,r,i)}function WM(t){VM(t).oldStyle=t.style}var af=Math.max,of=Math.min,jv={};function XM(t){return Ut.extend(t)}var YM=mM;function ZM(t,e){return YM(t,e)}function qr(t,e){jv[t]=e}function RT(t){if(jv.hasOwnProperty(t))return jv[t]}function wp(t,e,r,i){var n=gM(t,e);return r&&(i==="center"&&(r=IT(r,n.getBoundingRect())),NT(n,r)),n}function PT(t,e,r){var i=new Pr({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(IT(e,a))}}});return i}function IT(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 $M=_M;function NT(t,e){if(t.applyTransform){var r=t.getBoundingRect(),i=r.calculateTransform(e);t.applyTransform(i)}}function Ps(t,e){return Qx(t,t,{lineWidth:e}),t}function qM(t){return Jx(t.shape,t.shape,t.style),t}var KM=Wn;function ys(t,e){for(var r=tp([]);t&&t!==e;)Qa(r,t.getLocalTransform(),r),t=t.parent;return r}function Ji(t,e,r){return e&&!Ze(e)&&(e=Ff.getLocalTransform(e)),r&&(e=Nf([],e)),Mr([],t,e)}function bp(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=Ji(a,e,r),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function qm(t){return!t.isGroup}function jM(t){return t.shape!=null}function OT(t,e,r){if(!t||!e)return;function i(o){var s={};return o.traverse(function(l){qm(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=H({},o.shape)),s}var a=i(t);e.traverse(function(o){if(qm(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Rr(o,l,r,Ft(o).dataIndex)}}})}function QM(t,e){return j(t,function(r){var i=r[0];i=af(i,e.x),i=of(i,e.x+e.width);var n=r[1];return n=af(n,e.y),n=of(n,e.y+e.height),[i,n]})}function JM(t,e){var r=af(t.x,e.x),i=of(t.x+t.width,e.x+e.width),n=af(t.y,e.y),a=of(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 Ap(t,e,r){var i=H({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),Mt(n,r),new Pr(i)):wp(t.replace("path://",""),i,r,"center")}function tD(t,e,r,i,n){for(var a=0,o=n[n.length-1];a<n.length;a++){var s=n[a];if(BT(t,e,r,i,s[0],s[1],o[0],o[1]))return!0;o=s}}function BT(t,e,r,i,n,a,o,s){var l=r-t,u=i-e,f=o-n,h=s-a,v=ic(f,h,l,u);if(eD(v))return!1;var c=t-n,d=e-a,p=ic(c,d,l,u)/v;if(p<0||p>1)return!1;var g=ic(c,d,f,h)/v;return!(g<0||g>1)}function ic(t,e,r,i){return t*i-r*e}function eD(t){return t<=1e-6&&t>=-1e-6}function Yf(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&&M(_t(l),function(f){mt(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=Ft(t.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:Mt({content:i,formatterParams:s},n)}}function Km(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function Ep(t,e){if(t)if(Y(t))for(var r=0;r<t.length;r++)Km(t[r],e);else Km(t,e)}qr("circle",mp);qr("ellipse",_T);qr("sector",_p);qr("ring",ST);qr("polygon",Js);qr("polyline",Xf);qr("rect",ie);qr("line",na);qr("bezierCurve",CT);qr("arc",yp);const rD=Object.freeze(Object.defineProperty({__proto__:null,Arc:yp,BezierCurve:CT,BoundingRect:It,Circle:mp,CompoundPath:DT,Ellipse:_T,Group:oe,Image:Pr,IncrementalDisplayable:HM,Line:na,LinearGradient:xp,OrientedBoundingRect:rf,Path:Ut,Point:St,Polygon:Js,Polyline:Xf,RadialGradient:FM,Rect:ie,Ring:ST,Sector:_p,Text:Jt,applyTransform:Ji,clipPointsByRect:QM,clipRectByRect:JM,createIcon:Ap,extendPath:ZM,extendShape:XM,getShapeClass:RT,getTransform:ys,groupTransition:OT,initProps:rn,isElementRemoved:to,lineLineIntersect:BT,linePolygonIntersect:tD,makeImage:PT,makePath:wp,mergePath:$M,registerShape:qr,removeElement:nf,removeElementWithFadeOut:GM,resizePath:NT,setTooltipConfig:Yf,subPixelOptimize:KM,subPixelOptimizeLine:Ps,subPixelOptimizeRect:qM,transformDirection:bp,traverseElements:Ep,updateProps:Rr},Symbol.toStringTag,{value:"Module"}));var Zf={};function FT(t,e){for(var r=0;r<Lr.length;r++){var i=Lr[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 Qv(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=ft(t.defaultText)?t.defaultText(n,t,r):t.defaultText);for(var l={normal:s},u=0;u<Lr.length;u++){var f=Lr[u],h=e[f];l[f]=gt(i?i.getFormattedLabel(n,f,null,a,h&&h.get("formatter")):null,s)}return l}function Cp(t,e,r,i){r=r||Zf;for(var n=t instanceof Jt,a=!1,o=0;o<Qu.length;o++){var s=e[Qu[o]];if(s&&s.getShallow("show")){a=!0;break}}var l=n?t:t.getTextContent();if(a){n||(l||(l=new Jt,t.setTextContent(l)),t.stateProxy&&(l.stateProxy=t.stateProxy));var u=Qv(r,e),f=e.normal,h=!!f.getShallow("show"),v=er(f,i&&i.normal,r,!1,!n);v.text=u.normal,n||t.setTextConfig(jm(f,r,!1));for(var o=0;o<Lr.length;o++){var c=Lr[o],s=e[c];if(s){var d=l.ensureState(c),p=!!gt(s.getShallow("show"),h);if(p!==h&&(d.ignore=!p),d.style=er(s,i&&i[c],r,!0,!n),d.style.text=u[c],!n){var g=t.ensureState(c);g.textConfig=jm(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&&($f(l).setLabelText=function(m){var _=Qv(r,e,m);FT(l,_)})}else l&&(l.ignore=!0);t.dirty()}function Mp(t,e){e=e||"label";for(var r={normal:t.getModel(e)},i=0;i<Lr.length;i++){var n=Lr[i];r[n]=t.getModel([n,e])}return r}function er(t,e,r,i,n){var a={};return iD(a,t,r,i,n),e&&H(a,e),a}function jm(t,e,r){e=e||{};var i={},n,a=t.getShallow("rotate"),o=gt(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 iD(t,e,r,i,n){r=r||Zf;var a=e.ecModel,o=a&&a.option.textStyle,s=nD(e),l;if(s){l={};for(var u in s)if(s.hasOwnProperty(u)){var f=e.getModel(["rich",u]);e_(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),e_(t,e,o,r,i,n,!0,!1)}function nD(t){for(var e;t&&t!==t.ecModel;){var r=(t.option||Zf).rich;if(r){e=e||{};for(var i=_t(r),n=0;n<i.length;n++){var a=i[n];e[a]=1}}t=t.parentModel}return e}var Qm=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Jm=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],t_=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function e_(t,e,r,i,n,a,o,s){r=!n&&r||Zf;var l=i&&i.inheritColor,u=e.getShallow("color"),f=e.getShallow("textBorderColor"),h=gt(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=gt(e.getShallow("textBorderWidth"),r.textBorderWidth);v!=null&&(t.lineWidth=v);var c=gt(e.getShallow("textBorderType"),r.textBorderType);c!=null&&(t.lineDash=c);var d=gt(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<Qm.length;p++){var g=Qm[p],m=gt(e.getShallow(g),r[g]);m!=null&&(t[g]=m)}for(var p=0;p<Jm.length;p++){var g=Jm[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<t_.length;p++){var g=t_[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 aD(t,e){var r=e&&e.getModel("textStyle");return oi([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 $f=Kt();function oD(t,e,r,i,n){var a=$f(t);if(!a.valueAnimation||a.prevValue===a.value)return;var o=a.defaultInterpolatedText,s=gt(a.interpolatedValue,a.prevValue),l=a.value;function u(f){var h=Gx(r,a.precision,s,l,f);a.interpolatedValue=f===1?null:h;var v=Qv({labelDataIndex:e,labelFetcher:n,defaultText:o?o(h):h+""},a.statesModels,h);FT(t,v)}t.percent=0,(a.prevValue==null?rn:Rr)(t,{percent:1},i,e,null,u)}var sD=["textStyle","color"],nc=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],ac=new Jt,lD=function(){function t(){}return t.prototype.getTextColor=function(e){var r=this.ecModel;return this.getShallow("color")||(!e&&r?r.get(sD):null)},t.prototype.getFont=function(){return aD({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<nc.length;i++)r[nc[i]]=this.getShallow(nc[i]);return ac.useStyle(r),ac.update(),ac.getBoundingRect()},t}();const uD=lD;var kT=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],fD=Rs(kT),hD=function(){function t(){}return t.prototype.getLineStyle=function(e){return fD(this,e)},t}(),zT=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],cD=Rs(zT),vD=function(){function t(){}return t.prototype.getItemStyle=function(e,r){return cD(this,e,r)},t}(),fa=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){vt(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(lt(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(!ct.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}();fp(fa);KE(fa);Zr(fa,hD);Zr(fa,vD);Zr(fa,eC);Zr(fa,uD);const Te=fa;var dD=Math.round(Math.random()*10);function qf(t){return[t||"",dD++].join("_")}function pD(t){var e={};t.registerSubTypeDefaulter=function(r,i){var n=si(r);e[n.main]=i},t.determineSubType=function(r,i){var n=i.type;if(!n){var a=si(r).main;t.hasSubTypes(r)&&e[a]&&(n=e[a](i))}return n}}function gD(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(M(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]),M(d.successor,p?m:g)}M(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 M(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),M(h,function(v){Ct(u.predecessor,v)<0&&u.predecessor.push(v);var c=i(o,v);Ct(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 M(a,function(l){Ct(o,l)>=0&&s.push(l)}),s}}function tl(t,e){return vt(vt({},t,!0),e,!0)}const mD={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"}},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:". "}}}},_D={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:"旭日图"}},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 sf="ZH",Dp="EN",Is=Dp,Su={},Lp={},UT=ct.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return t.indexOf(sf)>-1?sf:Is}():Is;function HT(t,e){t=t.toUpperCase(),Lp[t]=new Te(e),Su[t]=e}function yD(t){if(q(t)){var e=Su[t.toUpperCase()]||{};return t===sf||t===Dp?lt(e):vt(lt(e),lt(Su[Is]),!1)}else return vt(lt(t),lt(Su[Is]),!1)}function xD(t){return Lp[t]}function TD(){return Lp[Is]}HT(Dp,mD);HT(sf,_D);var Rp=1e3,Pp=Rp*60,xs=Pp*60,Er=xs*24,r_=Er*365,os={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}"},Rl="{yyyy}-{MM}-{dd}",i_={year:"{yyyy}",month:"{yyyy}-{MM}",day:Rl,hour:Rl+" "+os.hour,minute:Rl+" "+os.minute,second:Rl+" "+os.second,millisecond:os.none},oc=["year","month","day","hour","minute","second","millisecond"],VT=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function He(t,e){return t+="","0000".substr(0,e-t.length)+t}function eo(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 SD(t){return t===eo(t)}function wD(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Kf(t,e,r,i){var n=ci(t),a=n[Ip(r)](),o=n[ro(r)]()+1,s=Math.floor((o-1)/3)+1,l=n[jf(r)](),u=n["get"+(r?"UTC":"")+"Day"](),f=n[Ns(r)](),h=(f-1)%12+1,v=n[Qf(r)](),c=n[Jf(r)](),d=n[th(r)](),p=i instanceof Te?i:xD(i||UT)||TD(),g=p.getModel("time"),m=g.get("month"),_=g.get("monthAbbr"),y=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,He(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[o-1]).replace(/{MMM}/g,_[o-1]).replace(/{MM}/g,He(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,He(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,He(f,2)).replace(/{H}/g,f+"").replace(/{hh}/g,He(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,He(v,2)).replace(/{m}/g,v+"").replace(/{ss}/g,He(c,2)).replace(/{s}/g,c+"").replace(/{SSS}/g,He(d,3)).replace(/{S}/g,d+"")}function bD(t,e,r,i,n){var a=null;if(q(r))a=r;else if(ft(r))a=r(t.value,e,{level:t.level});else{var o=H({},os);if(t.level>0)for(var s=0;s<oc.length;++s)o[oc[s]]="{primary|"+o[oc[s]]+"}";var l=r?r.inherit===!1?r:Mt(r,o):o,u=GT(t.value,n);if(l[u])a=l[u];else if(l.inherit){for(var f=VT.indexOf(u),s=f-1;s>=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(Y(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 Kf(new Date(t.value),a,n,i)}function GT(t,e){var r=ci(t),i=r[ro(e)]()+1,n=r[jf(e)](),a=r[Ns(e)](),o=r[Qf(e)](),s=r[Jf(e)](),l=r[th(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 n_(t,e,r){var i=Qt(t)?ci(t):t;switch(e=e||GT(t,r),e){case"year":return i[Ip(r)]();case"half-year":return i[ro(r)]()>=6?1:0;case"quarter":return Math.floor((i[ro(r)]()+1)/4);case"month":return i[ro(r)]();case"day":return i[jf(r)]();case"half-day":return i[Ns(r)]()/24;case"hour":return i[Ns(r)]();case"minute":return i[Qf(r)]();case"second":return i[Jf(r)]();case"millisecond":return i[th(r)]()}}function Ip(t){return t?"getUTCFullYear":"getFullYear"}function ro(t){return t?"getUTCMonth":"getMonth"}function jf(t){return t?"getUTCDate":"getDate"}function Ns(t){return t?"getUTCHours":"getHours"}function Qf(t){return t?"getUTCMinutes":"getMinutes"}function Jf(t){return t?"getUTCSeconds":"getSeconds"}function th(t){return t?"getUTCMilliseconds":"getMilliseconds"}function AD(t){return t?"setUTCFullYear":"setFullYear"}function WT(t){return t?"setUTCMonth":"setMonth"}function XT(t){return t?"setUTCDate":"setDate"}function YT(t){return t?"setUTCHours":"setHours"}function ZT(t){return t?"setUTCMinutes":"setMinutes"}function $T(t){return t?"setUTCSeconds":"setSeconds"}function qT(t){return t?"setUTCMilliseconds":"setMilliseconds"}function lf(t){if(!DE(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 KT(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 el=tx;function Jv(t,e,r){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(f){return f&&oi(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?ci(t):t;if(isNaN(+l)){if(s)return"-"}else return Kf(l,i,r)}if(e==="ordinal")return wv(t)?n(t):Qt(t)&&a(t)?t+"":"-";var u=qu(t);return a(u)?lf(u):wv(t)?n(t):typeof t=="boolean"?t+"":"-"}var a_=["a","b","c","d","e","f","g"],sc=function(t,e){return"{"+t+(e??"")+"}"};function jT(t,e,r){Y(e)||(e=[e]);var i=e.length;if(!i)return"";for(var n=e[0].$vars||[],a=0;a<n.length;a++){var o=a_[a];t=t.replace(sc(o),sc(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(sc(a_[l],s),r?Ce(u):u)}return t}function QT(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:'+Ce(i)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Ce(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 ED(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd
yyyy`);var i=ci(e),n=r?"getUTC":"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",He(o,2)).replace("M",o).replace("yyyy",a).replace("yy",He(a%100+"",2)).replace("dd",He(s,2)).replace("d",s).replace("hh",He(l,2)).replace("h",l).replace("mm",He(u,2)).replace("m",u).replace("ss",He(f,2)).replace("s",f).replace("SSS",He(h,3)),t}function aa(t,e){return e=e||"transparent",q(t)?t:Q(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var wu=M,JT=["left","right","top","bottom","width","height"],Pl=[["width","left","right"],["height","top","bottom"]];function Np(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 io=Np;de(Np,"vertical");de(Np,"horizontal");function nn(t,e,r){r=el(r||0);var i=e.width,n=e.height,a=ve(t.left,i),o=ve(t.top,n),s=ve(t.right,i),l=ve(t.bottom,n),u=ve(t.width,i),f=ve(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 It(a+r[3],o+r[0],u,f);return d.margin=r,d}function tS(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 It(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=nn(Mt({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 Os(t){var e=t.layoutMode||t.constructor.layoutMode;return Q(e)?e:e?{type:e}:null}function oa(t,e,r){var i=r&&r.ignoreSize;!Y(i)&&(i=[i,i]);var n=o(Pl[0],0),a=o(Pl[1],1);u(Pl[0],t,n),u(Pl[1],t,a);function o(f,h){var v={},c=0,d={},p=0,g=2;if(wu(f,function(y){d[y]=t[y]}),wu(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){wu(f,function(c){h[c]=v[c]})}}function rl(t){return eS({},t)}function eS(t,e){return e&&t&&wu(JT,function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var CD=Kt(),yo=function(t){W(e,t);function e(r,i,n){var a=t.call(this,r,i,n)||this;return a.uid=qf("ec_cpt_model"),a}return e.prototype.init=function(r,i,n){this.mergeDefaultAndTheme(r,n)},e.prototype.mergeDefaultAndTheme=function(r,i){var n=Os(this),a=n?rl(r):{},o=i.getTheme();vt(r,o.get(this.mainType)),vt(r,this.getDefaultOption()),n&&oa(r,a,n)},e.prototype.mergeOption=function(r,i){vt(this.option,r,!0);var n=Os(this);n&&oa(this.option,r,n)},e.prototype.optionUpdated=function(r,i){},e.prototype.getDefaultOption=function(){var r=this.constructor;if(!ZE(r))return r.defaultOption;var i=CD(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=vt(s,n[l],!0);i.defaultOption=s}return i.defaultOption},e.prototype.getReferringComponents=function(r,i){var n=r+"Index",a=r+"Id";return Qs(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}(Te);Xx(yo,Te);zf(yo);pD(yo);gD(yo,MD);function MD(t){var e=[];return M(yo.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=j(e,function(r){return si(r).main}),t!=="dataset"&&Ct(e,"dataset")<=0&&e.unshift("dataset"),e}const Ht=yo;var rS="";typeof navigator<"u"&&(rS=navigator.platform||"");var Sa="rgba(0, 0, 0, 0.2)";const DD={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Sa,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Sa,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Sa,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Sa,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Sa,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Sa,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:rS.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 iS=ut(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),Ir="original",ir="arrayRows",vi="objectRows",Li="keyedColumns",tn="typedArray",nS="unknown",li="column",xo="row",or={Must:1,Might:2,Not:3},aS=Kt();function LD(t){aS(t).datasetMap=ut()}function RD(t,e,r){var i={},n=oS(e);if(!n||!t)return i;var a=[],o=[],s=e.ecModel,l=aS(s).datasetMap,u=n.uid+"_"+r.seriesLayoutBy,f,h;t=t.slice(),M(t,function(p,g){var m=Q(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});M(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 oS(t){var e=t.get("data",!0);if(!e)return Qs(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},tr).models[0]}function PD(t){return!t.get("transform",!0)&&!t.get("fromTransformResult",!0)?[]:Qs(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},tr).models}function sS(t,e){return ID(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function ID(t,e,r,i,n,a){var o,s=5;if(hr(t))return or.Not;var l,u;if(i){var f=i[a];Q(f)?(l=f.name,u=f.type):q(f)&&(l=f)}if(u!=null)return u==="ordinal"?or.Must:or.Not;if(e===ir){var h=t;if(r===xo){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===vi){var p=t;if(!l)return or.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===Li){var m=t;if(!l)return or.Not;var v=m[l];if(!v||hr(v))return or.Not;for(var c=0;c<v.length&&c<s;c++)if((o=x(v[c]))!=null)return o}else if(e===Ir)for(var _=t,c=0;c<_.length&&c<s;c++){var g=_[c],y=js(g);if(!Y(y))return or.Not;if((o=x(y[a]))!=null)return o}function x(S){var T=q(S);if(S!=null&&isFinite(S)&&S!=="")return T?or.Might:or.Not;if(T&&S!=="-")return or.Must}return or.Not}var ND=ut();function OD(t,e,r){var i=ND.get(e);if(!i)return r;var n=i(t);return n?r.concat(n):r}var o_=Kt();Kt();var Op=function(){function t(){}return t.prototype.getColorFromPalette=function(e,r,i){var n=pe(this.get("color",!0)),a=this.get("colorLayer",!0);return FD(this,o_,n,a,e,r,i)},t.prototype.clearColorPalette=function(){kD(this,o_)},t}();function BD(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 FD(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:BD(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 kD(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var Il,Ro,s_,l_="\0_ec_inner",zD=1,Bp=function(t){W(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 Te(a),this._locale=new Te(o),this._optionManager=s},e.prototype.setOption=function(r,i,n){var a=h_(i);this._optionManager.setOption(r,n,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,i){return this._resetOption(r,h_(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"?s_(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&&M(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=ut(),u=i&&i.replaceMergeMainTypeMap;LD(this),M(r,function(h,v){h!=null&&(Ht.hasClass(v)?v&&(s.push(v),l.set(v,!0)):n[v]=n[v]==null?lt(h):vt(n[v],h,!0))}),u&&u.each(function(h,v){Ht.hasClass(v)&&!l.get(v)&&(s.push(v),l.set(v,!0))}),Ht.topologicalTravel(s,Ht.getAllClassMainTypes(),f,this);function f(h){var v=OD(this,h,pe(r[h])),c=a.get(h),d=c?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",p=Ux(c,v,d);kE(p,h,Ht),n[h]=null,a.set(h,null),o.set(h,0);var g=[],m=[],_=0,y;M(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=Ht.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 C=H({componentIndex:S},x.keyInfo);T=new A(w,this,this,C),H(T,C),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"&&Il(this)}this._seriesIndices||Il(this)},e.prototype.getOption=function(){var r=lt(this.option);return M(r,function(i,n){if(Ht.hasClass(n)){for(var a=pe(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Ls(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[n]=a}}),delete r[l_],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=[],M(pe(n),function(u){s[u]&&l.push(s[u])})):a!=null?l=u_("id",a,s):o!=null?l=u_("name",o,s):l=ce(s,function(u){return!!u}),f_(l,r)},e.prototype.findComponents=function(r){var i=r.query,n=r.mainType,a=s(i),o=a?this.queryComponents(a):ce(this._componentsMap.get(n),function(u){return!!u});return l(f_(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?ce(u,r.filter):u}},e.prototype.eachComponent=function(r,i,n){var a=this._componentsMap;if(ft(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):Q(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=Ge(r,null);return ce(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 ce(this._componentsMap.get("series"),function(i){return!!i&&i.subType===r})},e.prototype.getSeries=function(){return ce(this._componentsMap.get("series"),function(r){return!!r})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(r,i){Ro(this),M(this._seriesIndices,function(n){var a=this._componentsMap.get("series")[n];r.call(i,a,n)},this)},e.prototype.eachRawSeries=function(r,i){M(this._componentsMap.get("series"),function(n){n&&r.call(i,n,n.componentIndex)})},e.prototype.eachSeriesByType=function(r,i,n){Ro(this),M(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 M(this.getSeriesByType(r),i,n)},e.prototype.isSeriesFiltered=function(r){return Ro(this),this._seriesIndicesMap.get(r.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(r,i){Ro(this);var n=[];M(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=ut(n)},e.prototype.restoreData=function(r){Il(this);var i=this._componentsMap,n=[];i.each(function(a,o){Ht.hasClass(o)&&n.push(o)}),Ht.topologicalTravel(n,Ht.getAllClassMainTypes(),function(a){M(i.get(a),function(o){o&&(a!=="series"||!UD(o,r))&&o.restoreData()})})},e.internalField=function(){Il=function(r){var i=r._seriesIndices=[];M(r._componentsMap.get("series"),function(n){n&&i.push(n.componentIndex)}),r._seriesIndicesMap=ut(i)},Ro=function(r){},s_=function(r,i){r.option={},r.option[l_]=zD,r._componentsMap=ut({series:[]}),r._componentsCount=ut();var n=i.aria;Q(n)&&n.enabled==null&&(n.enabled=!0),HD(i,r._theme.option),vt(i,DD,!1),r._mergeOption(i,null)}}(),e}(Te);function UD(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 HD(t,e){var r=t.color&&!t.colorLayer;M(e,function(i,n){n==="colorLayer"&&r||Ht.hasClass(n)||(typeof i=="object"?t[n]=t[n]?vt(t[n],i,!1):lt(i):t[n]==null&&(t[n]=i))})}function u_(t,e,r){if(Y(e)){var i=ut();return M(e,function(a){if(a!=null){var o=Ge(a,null);o!=null&&i.set(a,!0)}}),ce(r,function(a){return a&&i.get(a[t])})}else{var n=Ge(e,null);return ce(r,function(a){return a&&n!=null&&a[t]===n})}}function f_(t,e){return e.hasOwnProperty("subType")?ce(t,function(r){return r&&r.subType===e.subType}):t}function h_(t){var e=ut();return t&&M(pe(t.replaceMerge),function(r){e.set(r,!0)}),{replaceMergeMainTypeMap:e}}Zr(Bp,Op);var VD=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],GD=function(){function t(e){M(VD,function(r){this[r]=rt(e[r],e)},this)}return t}();const lS=GD;var lc={},eh=function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(e,r){var i=[];M(lc,function(n,a){var o=n.create(e,r);i=i.concat(o||[])}),this._coordinateSystems=i},t.prototype.update=function(e,r){M(this._coordinateSystems,function(i){i.update&&i.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(e,r){lc[e]=r},t.get=function(e){return lc[e]},t}(),WD=/^(min|max)?(.+)$/,XD=function(){function t(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return t.prototype.setOption=function(e,r,i){e&&(M(pe(e.series),function(o){o&&o.data&&hr(o.data)&&zu(o.data)}),M(pe(e.dataset),function(o){o&&o.source&&hr(o.source)&&zu(o.source)})),e=lt(e);var n=this._optionBackup,a=YD(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=[],lt(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=lt(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++)ZD(n[l].query,r,i)&&o.push(l);return!o.length&&a&&(o=[-1]),o.length&&!qD(o,this._currentMediaIndices)&&(s=j(o,function(f){return lt(f===-1?a.option:n[f].option)})),this._currentMediaIndices=o,s},t}();function YD(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&&Y(u)&&M(u,function(c){c&&c.option&&(c.query?i.push(c):n||(n=c))}),v(a),M(l,function(c){return v(c)}),M(i,function(c){return v(c.option)});function v(c){M(e,function(d){d(c,r)})}return{baseOption:a,timelineOptions:l||[],mediaDefault:n,mediaList:i}}function ZD(t,e,r){var i={width:e,height:r,aspectratio:e/r},n=!0;return M(t,function(a,o){var s=o.match(WD);if(!(!s||!s[1]||!s[2])){var l=s[1],u=s[2].toLowerCase();$D(i[u],a,l)||(n=!1)}}),n}function $D(t,e,r){return r==="min"?t>=e:r==="max"?t<=e:t===e}function qD(t,e){return t.join(",")===e.join(",")}const KD=XD;var Or=M,Bs=Q,c_=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function uc(t){var e=t&&t.itemStyle;if(e)for(var r=0,i=c_.length;r<i;r++){var n=c_[r],a=e.normal,o=e.emphasis;a&&a[n]&&(t[n]=t[n]||{},t[n].normal?vt(t[n].normal,a[n]):t[n].normal=a[n],a[n]=null),o&&o[n]&&(t[n]=t[n]||{},t[n].emphasis?vt(t[n].emphasis,o[n]):t[n].emphasis=o[n],o[n]=null)}}function Ie(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,Mt(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 ss(t){Ie(t,"itemStyle"),Ie(t,"lineStyle"),Ie(t,"areaStyle"),Ie(t,"label"),Ie(t,"labelLine"),Ie(t,"upperLabel"),Ie(t,"edgeLabel")}function he(t,e){var r=Bs(t)&&t[e],i=Bs(r)&&r.textStyle;if(i)for(var n=0,a=vm.length;n<a;n++){var o=vm[n];i.hasOwnProperty(o)&&(r[o]=i[o])}}function _r(t){t&&(ss(t),he(t,"label"),t.emphasis&&he(t.emphasis,"label"))}function jD(t){if(Bs(t)){uc(t),ss(t),he(t,"label"),he(t,"upperLabel"),he(t,"edgeLabel"),t.emphasis&&(he(t.emphasis,"label"),he(t.emphasis,"upperLabel"),he(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(uc(e),_r(e));var r=t.markLine;r&&(uc(r),_r(r));var i=t.markArea;i&&_r(i);var n=t.data;if(t.type==="graph"){n=n||t.nodes;var a=t.links||t.edges;if(a&&!hr(a))for(var o=0;o<a.length;o++)_r(a[o]);M(t.categories,function(u){ss(u)})}if(n&&!hr(n))for(var o=0;o<n.length;o++)_r(n[o]);if(e=t.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)_r(s[o]);if(r=t.markLine,r&&r.data)for(var l=r.data,o=0;o<l.length;o++)Y(l[o])?(_r(l[o][0]),_r(l[o][1])):_r(l[o]);t.type==="gauge"?(he(t,"axisLabel"),he(t,"title"),he(t,"detail")):t.type==="treemap"?(Ie(t.breadcrumb,"itemStyle"),M(t.levels,function(u){ss(u)})):t.type==="tree"&&ss(t.leaves)}}function gi(t){return Y(t)?t:t?[t]:[]}function v_(t){return(Y(t)?t[0]:t)||{}}function QD(t,e){Or(gi(t.series),function(i){Bs(i)&&jD(i)});var r=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&r.push("valueAxis","categoryAxis","logAxis","timeAxis"),Or(r,function(i){Or(gi(t[i]),function(n){n&&(he(n,"axisLabel"),he(n.axisPointer,"label"))})}),Or(gi(t.parallel),function(i){var n=i&&i.parallelAxisDefault;he(n,"axisLabel"),he(n&&n.axisPointer,"label")}),Or(gi(t.calendar),function(i){Ie(i,"itemStyle"),he(i,"dayLabel"),he(i,"monthLabel"),he(i,"yearLabel")}),Or(gi(t.radar),function(i){he(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)}),Or(gi(t.geo),function(i){Bs(i)&&(_r(i),Or(gi(i.regions),function(n){_r(n)}))}),Or(gi(t.timeline),function(i){_r(i),Ie(i,"label"),Ie(i,"itemStyle"),Ie(i,"controlStyle",!0);var n=i.data;Y(n)&&M(n,function(a){Q(a)&&(Ie(a,"label"),Ie(a,"itemStyle"))})}),Or(gi(t.toolbox),function(i){Ie(i,"iconStyle"),Or(i.feature,function(n){Ie(n,"iconStyle")})}),he(v_(t.axisPointer),"label"),he(v_(t.tooltip).axisPointer,"label")}function JD(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 tL(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];(i||a[n[s]]==null)&&(a[n[s]]=r)}function d_(t){t&&M(eL,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var eL=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],rL=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],fc=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Po(t){var e=t&&t.itemStyle;if(e)for(var r=0;r<fc.length;r++){var i=fc[r][1],n=fc[r][0];e[i]!=null&&(e[n]=e[i])}}function p_(t){t&&t.alignTo==="edge"&&t.margin!=null&&t.edgeDistance==null&&(t.edgeDistance=t.margin)}function g_(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function iL(t){t&&t.focusNodeAdjacency!=null&&(t.emphasis=t.emphasis||{},t.emphasis.focus==null&&(t.emphasis.focus="adjacency"))}function uS(t,e){if(t)for(var r=0;r<t.length;r++)e(t[r]),t[r]&&uS(t[r].children,e)}function fS(t,e){QD(t,e),t.series=pe(t.series),M(t.series,function(r){if(Q(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),p_(r.label);var n=r.data;if(n&&!hr(n))for(var a=0;a<n.length;a++)p_(n[a]);r.hoverOffset!=null&&(r.emphasis=r.emphasis||{},(r.emphasis.scaleSize=null)&&(r.emphasis.scaleSize=r.hoverOffset))}else if(i==="gauge"){var o=JD(r,"pointer.color");o!=null&&tL(r,"itemStyle.color",o)}else if(i==="bar"){Po(r),Po(r.backgroundStyle),Po(r.emphasis);var n=r.data;if(n&&!hr(n))for(var a=0;a<n.length;a++)typeof n[a]=="object"&&(Po(n[a]),Po(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)),g_(r),uS(r.data,g_)}else i==="graph"||i==="sankey"?iL(r):i==="map"&&(r.mapType&&!r.map&&(r.map=r.mapType),r.mapLocation&&Mt(r,r.mapLocation));r.hoverAnimation!=null&&(r.emphasis=r.emphasis||{},r.emphasis&&r.emphasis.scale==null&&(r.emphasis.scale=r.hoverAnimation)),d_(r)}}),t.dataRange&&(t.visualMap=t.dataRange),M(rL,function(r){var i=t[r];i&&(Y(i)||(i=[i]),M(i,function(n){d_(n)}))})}function nL(t){var e=ut();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(aL)}function aL(t){M(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=EE(v,_),p=_;break}}}return i[0]=v,i[1]=p,i})})}var rh=function(){function t(e){this.data=e.data||(e.sourceFormat===Li?{}:[]),this.sourceFormat=e.sourceFormat||nS,this.seriesLayoutBy=e.seriesLayoutBy||li,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&&sS(this,i)===or.Must&&(n.type="ordinal")}}return t}();function Fp(t){return t instanceof rh}function td(t,e,r){r=r||hS(t);var i=e.seriesLayoutBy,n=sL(t,r,i,e.sourceHeader,e.dimensions),a=new rh({data:t,sourceFormat:r,seriesLayoutBy:i,dimensionsDefine:n.dimensionsDefine,startIndex:n.startIndex,dimensionsDetectedCount:n.dimensionsDetectedCount,metaRawOption:lt(e)});return a}function kp(t){return new rh({data:t,sourceFormat:hr(t)?tn:Ir})}function oL(t){return new rh({data:t.data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:lt(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})}function hS(t){var e=nS;if(hr(t))e=tn;else if(Y(t)){t.length===0&&(e=ir);for(var r=0,i=t.length;r<i;r++){var n=t[r];if(n!=null){if(Y(n)){e=ir;break}else if(Q(n)){e=vi;break}}}}else if(Q(t)){for(var a in t)if(mt(t,a)&&Ze(t[a])){e=Li;break}}return e}function sL(t,e,r,i,n){var a,o;if(!t)return{dimensionsDefine:m_(n),startIndex:o,dimensionsDetectedCount:a};if(e===ir){var s=t;i==="auto"||i==null?__(function(u){u!=null&&u!=="-"&&(q(u)?o==null&&(o=1):o=0)},r,s,10):o=Qt(i)?i:i?1:0,!n&&o===1&&(n=[],__(function(u,f){n[f]=u!=null?u+"":""},r,s,1/0)),a=n?n.length:r===xo?s.length:s[0]?s[0].length:null}else if(e===vi)n||(n=lL(t));else if(e===Li)n||(n=[],M(t,function(u,f){n.push(f)}));else if(e===Ir){var l=js(t[0]);a=Y(l)&&l.length||1}return{startIndex:o,dimensionsDefine:m_(n),dimensionsDetectedCount:a}}function lL(t){for(var e=0,r;e<t.length&&!(r=t[e++]););if(r)return _t(r)}function m_(t){if(t){var e=ut();return j(t,function(r,i){r=Q(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 __(t,e,r,i){if(e===xo)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 cS(t){var e=t.sourceFormat;return e===vi||e===Li}var bn,An,En,y_,x_,vS=function(){function t(e,r){var i=Fp(e)?e:kp(e);this._source=i;var n=this._data=i.data;i.sourceFormat===tn&&(this._offset=0,this._dimSize=r,this._data=n),x_(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;x_=function(o,s,l){var u=l.sourceFormat,f=l.seriesLayoutBy,h=l.startIndex,v=l.dimensionsDefine,c=y_[zp(u,f)];if(H(o,c),u===tn)o.getItem=r,o.count=n,o.fillStorage=i;else{var d=dS(u,f);o.getItem=rt(d,null,s,h,v);var p=pS(u,f);o.count=rt(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};y_=(e={},e[ir+"_"+li]={pure:!0,appendData:a},e[ir+"_"+xo]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[vi]={pure:!0,appendData:a},e[Li]={pure:!0,appendData:function(o){var s=this._data;M(o,function(l,u){for(var f=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)f.push(l[h])})}},e[Ir]={appendData:a},e[tn]={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}(),T_=function(t,e,r,i){return t[i]},uL=(bn={},bn[ir+"_"+li]=function(t,e,r,i){return t[i+e]},bn[ir+"_"+xo]=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},bn[vi]=T_,bn[Li]=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},bn[Ir]=T_,bn);function dS(t,e){var r=uL[zp(t,e)];return r}var S_=function(t,e,r){return t.length},fL=(An={},An[ir+"_"+li]=function(t,e,r){return Math.max(0,t.length-e)},An[ir+"_"+xo]=function(t,e,r){var i=t[0];return i?Math.max(0,i.length-e):0},An[vi]=S_,An[Li]=function(t,e,r){var i=r[0].name,n=t[i];return n?n.length:0},An[Ir]=S_,An);function pS(t,e){var r=fL[zp(t,e)];return r}var hc=function(t,e,r){return t[e]},hL=(En={},En[ir]=hc,En[vi]=function(t,e,r){return t[r]},En[Li]=hc,En[Ir]=function(t,e,r){var i=js(t);return i instanceof Array?i[e]:i},En[tn]=hc,En);function gS(t){var e=hL[t];return e}function zp(t,e){return t===ir?t+"_"+e:t}function oo(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 gS(a)(i,o,s)}else{var l=i;return a===Ir&&(l=js(i)),l}}}}var cL=/\{@(.+?)\}/g,vL=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&&Y(l.value)&&(l.value=l.value[n]),!a){var u=s.getItemModel(e);a=u.get(r==="normal"?["label","formatter"]:[r,"label","formatter"])}if(ft(a))return l.status=r,l.dimensionIndex=n,a(l);if(q(a)){var f=jT(a,l);return f.replace(cL,function(h,v){var c=v.length,d=v;d.charAt(0)==="["&&d.charAt(c-1)==="]"&&(d=+d.slice(1,c-1));var p=oo(s,e,d);if(o&&Y(o.interpolatedValue)){var g=s.getDimensionIndex(d);g>=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})}},t.prototype.getRawValue=function(e,r){return oo(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,i){},t}();function w_(t){var e,r;return Q(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function Ts(t){return new dL(t)}var dL=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(Y(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){b_.reset(r,i,n,a),this._callingProgress=e,this._callingProgress({start:r,end:i,count:i-r,next:b_.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),Y(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}(),b_=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 bu(t,e){var r=e&&e.type;return r==="ordinal"?t:(r==="time"&&!Qt(t)&&t!=null&&t!=="-"&&(t=+ci(t)),t==null||t===""?NaN:+t)}ut({number:function(t){return parseFloat(t)},time:function(t){return+ci(t)},trim:function(t){return q(t)?oi(t):t}});var pL=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=Qt(e)?e:qu(e),n=Qt(r)?r:qu(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}(),gL=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 bu(e,r)},t}();function mL(t,e){var r=new gL,i=t.data,n=r.sourceFormat=t.sourceFormat,a=t.startIndex,o="";t.seriesLayoutBy!==li&&Qe(o);var s=[],l={},u=t.dimensionsDefine;if(u)M(u,function(p,g){var m=p.name,_={index:g,name:m,displayName:p.displayName};if(s.push(_),m!=null){var y="";mt(l,m)&&Qe(y),l[m]=_}});else for(var f=0;f<t.dimensionsDetectedCount;f++)s.push({index:f});var h=dS(n,li);e.__isBuiltIn&&(r.getRawDataItem=function(p){return h(i,a,s,p)},r.getRawData=rt(_L,null,t)),r.cloneRawData=rt(yL,null,t);var v=pS(n,li);r.count=rt(v,null,i,a,s);var c=gS(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=rt(xL,null,s,l),r.cloneAllDimensionInfo=rt(TL,null,s),r}function _L(t){var e=t.sourceFormat;if(!Up(e)){var r="";Qe(r)}return t.data}function yL(t){var e=t.sourceFormat,r=t.data;if(!Up(e)){var i="";Qe(i)}if(e===ir){for(var n=[],a=0,o=r.length;a<o;a++)n.push(r[a].slice());return n}else if(e===vi){for(var n=[],a=0,o=r.length;a<o;a++)n.push(H({},r[a]));return n}}function xL(t,e,r){if(r!=null){if(Qt(r)||!isNaN(r)&&!mt(e,r))return t[r];if(mt(e,r))return e[r]}}function TL(t){return lt(t)}var mS=ut();function SL(t){t=lt(t);var e=t.type,r="";e||Qe(r);var i=e.split(":");i.length!==2&&Qe(r);var n=!1;i[0]==="echarts"&&(e=i[1],n=!0),t.__isBuiltIn=n,mS.set(e,t)}function wL(t,e,r){var i=pe(t),n=i.length,a="";n||Qe(a);for(var o=0,s=n;o<s;o++){var l=i[o];e=bL(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function bL(t,e,r,i){var n="";e.length||Qe(n),Q(t)||Qe(n);var a=t.type,o=mS.get(a);o||Qe(n);var s=j(e,function(u){return mL(u,o)}),l=pe(o.transform({upstream:s[0],upstreamList:s,config:lt(t.config)}));return j(l,function(u,f){var h="";Q(u)||Qe(h),u.data||Qe(h);var v=hS(u.data);Up(v)||Qe(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:li,sourceHeader:p,dimensions:d.metaRawOption.dimensions}}else c={seriesLayoutBy:li,sourceHeader:0,dimensions:u.dimensions};return td(u.data,c,null)})}function Up(t){return t===ir||t===vi}var ih="undefined",AL=typeof Uint32Array===ih?Array:Uint32Array,EL=typeof Uint16Array===ih?Array:Uint16Array,_S=typeof Int32Array===ih?Array:Int32Array,A_=typeof Float64Array===ih?Array:Float64Array,yS={float:A_,int:_S,ordinal:Array,number:Array,time:A_},cc;function Io(t){return t>65535?AL:EL}function wa(){return[1/0,-1/0]}function CL(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function E_(t,e,r,i,n){var a=yS[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 ed=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=ut()}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=cc[n.sourceFormat];this._dimValueGetter=i||a,this._rawExtent=[],cS(n),this._dimensions=j(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 yS[r||"float"](this._rawCount),this._rawExtent[a]=wa(),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]=wa());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];E_(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=cc.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=j(o,function(_){return _.property}),f=0;f<s;f++){var h=o[f];l[f]||(l[f]=wa()),E_(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=Io(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=Io(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=_t(e),a=n.length;if(!a)return this;var o=r.count(),s=Io(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 C=n[A],_=c[C][w];(_<e[C][0]||_>e[C][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]]=wa();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(Io(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 C=-1,E=0,y=T;y<w;y++){var x=this.getRawIndex(y),S=a[x];if(isNaN(S)){E++,C<0&&(C=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(C,v),v=Math.max(C,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]=wa(),v=new(Io(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=wa();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&&la(e,function(s,l){return s[l]=!0,s},{});if(a)for(var o=0;o<n.length;o++)i._chunks[o]=a[o]?CL(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=lt(this._extent),e._rawExtent=lt(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 bu(r[a],this._dimensions[a])}cc={arrayRows:e,objectRows:function(r,i,n,a){return bu(r[i],this._dimensions[a])},keyedColumns:e,original:function(r,i,n,a){var o=r&&(r.value==null?r:r.value);return bu(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,i,n,a){return r[a]}}}(),t}(),xS=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(Nl(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=hr(s)?tn:Ir,a=[];var h=this._getSourceMetaRawOption()||{},v=u&&u.metaRawOption||{},c=gt(h.seriesLayoutBy,v.seriesLayoutBy)||null,d=gt(h.sourceHeader,v.sourceHeader),p=gt(h.dimensions,v.dimensions),g=c!==v.seriesLayoutBy||!!d!=!!v.sourceHeader||p;n=g?[td(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=[td(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&&M_(a)}var o,s=[],l=[];return M(e,function(u){u.prepareSource();var f=u.getSource(n||0),h="";n!=null&&!f&&M_(h),s.push(f),l.push(u._getVersionSign())}),i?o=wL(i,s,{datasetIndex:r.componentIndex}):n!=null&&(o=[oL(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];Nl(this._sourceHost)&&l?s=l._innerGetDataStore(e,r,i):(s=new ed,s.initData(new vS(r,e.length),e)),o[i]=s}return s},t.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Nl(e)){var r=oS(e);return r?[r.getSourceManager()]:[]}else return j(PD(e),function(i){return i.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,r,i,n;if(Nl(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 C_(t){var e=t.option.transform;e&&zu(t.option.transform)}function Nl(t){return t.mainType==="series"}function M_(t){throw new Error(t)}var TS="line-height:1";function SS(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:"+Ce(i+"")+"px;color:"+Ce(r)+";font-weight:"+Ce(n+""),valueStyle:"font-size:"+Ce(o+"")+"px;color:"+Ce(a)+";font-weight:"+Ce(s+"")}:{nameStyle:{fontSize:i,fill:r,fontWeight:n},valueStyle:{fontSize:o,fill:a,fontWeight:s}}}var ML=[0,10,20,30],DL=["",`
`,`

`,`


`];function Fs(t,e){return e.type=t,e}function rd(t){return t.type==="section"}function wS(t){return rd(t)?LL:RL}function bS(t){if(rd(t)){var e=0,r=t.blocks.length,i=r>1||r>0&&!t.noHeader;return M(t.blocks,function(n){var a=bS(n);a>=e&&(e=a+ +(i&&(!a||rd(n)&&!n.noHeader)))}),e}return 0}function LL(t,e,r,i){var n=e.noHeader,a=PL(bS(e)),o=[],s=e.blocks||[];Dr(!s||Y(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(mt(u,l)){var f=new pL(u[l],null);s.sort(function(d,p){return f.evaluate(d.sortParam,p.sortParam)})}else l==="seriesDesc"&&s.reverse()}M(s,function(d,p){var g=e.valueFormatter,m=wS(d)(g?H(H({},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):id(o.join(""),n?r:a.html);if(n)return h;var v=Jv(e.header,"ordinal",t.useUTC),c=SS(i,t.renderMode).nameStyle;return t.renderMode==="richText"?AS(t,v,c)+a.richText+h:id('<div style="'+c+";"+TS+';">'+Ce(v)+"</div>"+h,r)}function RL(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=Y(x)?x:[x],j(x,function(S,T){return Jv(S,Y(c)?c[T]:c,u)})};if(!(a&&o)){var h=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",n),v=a?"":Jv(l,"ordinal",u),c=e.valueType,d=o?[]:f(e.value),p=!s||!a,g=!s&&a,m=SS(i,n),_=m.nameStyle,y=m.valueStyle;return n==="richText"?(s?"":h)+(a?"":AS(t,v,_))+(o?"":OL(t,d,p,g,y)):id((s?"":h)+(a?"":IL(v,!s,_))+(o?"":NL(d,p,g,y)),r)}}function D_(t,e,r,i,n,a){if(t){var o=wS(t),s={useUTC:n,renderMode:r,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,a)}}function PL(t){return{html:ML[t],richText:DL[t]}}function id(t,e){var r='<div style="clear:both"></div>',i="margin: "+e+"px 0 0";return'<div style="'+i+";"+TS+';">'+t+r+"</div>"}function IL(t,e,r){var i=e?"margin-left:2px":"";return'<span style="'+r+";"+i+'">'+Ce(t)+"</span>"}function NL(t,e,r,i){var n=r?"10px":"20px",a=e?"float:right;margin-left:"+n:"";return t=Y(t)?t:[t],'<span style="'+a+";"+i+'">'+j(t,function(o){return Ce(o)}).join("&nbsp;&nbsp;")+"</span>"}function AS(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function OL(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(Y(e)?e.join("  "):e,a)}function BL(t,e){var r=t.getData().getItemVisual(e,"style"),i=r[t.visualDrawType];return aa(i)}function ES(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var vc=function(){function t(){this.richTextStyles={},this._nextStyleNameId=Fx()}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=QT({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={};Y(r)?M(r,function(a){return H(i,a)}):H(i,r);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+e+"}"},t}();function FL(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=Y(s),u=BL(e,r),f,h,v,c;if(o>1||l&&!o){var d=kL(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=oo(n,r,a[0]),h=p.type}else c=f=l?s[0]:s;var g=lp(e),m=g&&e.name||"",_=n.getName(r),y=i?m:_;return Fs("section",{header:m,noHeader:i||!g,sortParam:c,blocks:[Fs("nameValue",{markerType:"item",markerColor:u,name:y,noName:!oi(y),value:f,valueType:h})].concat(v||[])})}function kL(t,e,r,i,n){var a=e.getData(),o=la(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?M(i,function(h){f(oo(a,r,h),h)}):M(t,f);function f(h,v){var c=a.getDimensionInfo(v);!c||c.otherDims.tooltip===!1||(o?u.push(Fs("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 Bi=Kt();function Ol(t,e){return t.getName(e)||t.getId(e)}var zL="__universalTransitionEnabled",nh=function(t){W(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=Ts({count:HL,reset:VL}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,n);var a=Bi(this).sourceManager=new xS(this);a.prepareSource();var o=this.getInitialData(r,n);R_(o,this),this.dataTask.context.data=o,Bi(this).dataBeforeProcessed=o,L_(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,i){var n=Os(this),a=n?rl(r):{},o=this.subType;Ht.hasClass(o)&&(o+="Series"),vt(r,i.getTheme().get(this.subType)),vt(r,this.getDefaultOption()),cm(r,"label",["show"]),this.fillDataTextStyle(r.data),n&&oa(r,a,n)},e.prototype.mergeOption=function(r,i){r=vt(this.option,r,!0),this.fillDataTextStyle(r.data);var n=Os(this);n&&oa(this.option,r,n);var a=Bi(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,i);R_(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Bi(this).dataBeforeProcessed=o,L_(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!hr(r))for(var i=["show"],n=0;n<r.length;n++)r[n]&&r[n].label&&cm(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=nd(this);if(i){var n=i.context.data;return r==null?n:n.getLinkedData(r)}else return Bi(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=nd(this);if(i){var n=i.context;n.outputData=r,i!==this.dataTask&&(n.data=r)}Bi(this).data=r},e.prototype.getEncode=function(){var r=this.get("encode",!0);if(r)return ut(r)},e.prototype.getSourceManager=function(){return Bi(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return Bi(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 FL({series:this,dataIndex:r,multipleSeries:i})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(ct.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=Op.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=Ol(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=_t(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[Ol(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[zL])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"){Q(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,f=0;f<l;f++){var h=i[f],v=Ol(r,h);u[v]=!0,this._selectedDataIndicesMap[v]=r.getRawIndex(h)}}else if(s==="single"||s===!0){var c=i[l-1],v=Ol(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 Ht.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}(Ht);Zr(nh,vL);Zr(nh,Op);Xx(nh,Ht);function L_(t){var e=t.name;lp(t)||(t.name=UL(t)||e)}function UL(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),i=[];return M(r,function(n){var a=e.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function HL(t){return t.model.getRawData().count()}function VL(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),GL}function GL(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function R_(t,e){M(eA(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,de(WL,e))})}function WL(t,e){var r=nd(t);return r&&r.setOutputEnd((e||this).count()),e}function nd(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}}const so=nh;var Hp=function(){function t(){this.group=new oe,this.uid=qf("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}();fp(Hp);zf(Hp);const cr=Hp;function CS(){var t=Kt();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 MS=Kt(),XL=CS(),Vp=function(){function t(){this.group=new oe,this.uid=qf("viewChart"),this.renderTask=Ts({plan:YL,reset:ZL}),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&&I_(a,n,"emphasis")},t.prototype.downplay=function(e,r,i,n){var a=e.getData(n&&n.dataType);a&&I_(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){Ep(this.group,e)},t.markUpdateMethod=function(e,r){MS(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function P_(t,e,r){t&&$v(t)&&(e==="emphasis"?Ju:tf)(t,r)}function I_(t,e,r){var i=ia(t,e),n=e&&e.highlightKey!=null?lM(e.highlightKey):null;i!=null?M(pe(i),function(a){P_(t.getItemGraphicEl(a),r,n)}):t.eachItemGraphicEl(function(a){P_(a,r,n)})}fp(Vp);zf(Vp);function YL(t){return XL(t.model)}function ZL(t){var e=t.model,r=t.ecModel,i=t.api,n=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=n&&MS(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,i,n),$L[l]}var $L={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)}}};const Ai=Vp;var uf="\0__throttleOriginMethod",N_="\0__throttleRate",O_="\0__throttleType";function Gp(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 ah(t,e,r,i){var n=t[e];if(n){var a=n[uf]||n,o=n[O_],s=n[N_];if(s!==r||o!==i){if(r==null||!i)return t[e]=a;n=t[e]=Gp(a,r,i==="debounce"),n[uf]=a,n[O_]=i,n[N_]=r}return n}}function ff(t,e){var r=t[e];r&&r[uf]&&(r.clear&&r.clear(),t[e]=r[uf])}var B_=Kt(),F_={itemStyle:Rs(zT,!0),lineStyle:Rs(kT,!0)},qL={lineStyle:"stroke",itemStyle:"fill"};function DS(t,e){var r=t.visualStyleMapper||F_[e];return r||(console.warn("Unknown style type '"+e+"'."),F_.itemStyle)}function LS(t,e){var r=t.visualDrawType||qL[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var KL={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),i=t.visualStyleAccessPath||"itemStyle",n=t.getModel(i),a=DS(t,i),o=a(n),s=n.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=LS(t,i),u=o[l],f=ft(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"||ft(o.fill)?v:o.fill,o.stroke=o.stroke==="auto"||ft(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=H({},o);g[l]=f(p),c.setItemVisual(d,"style",g)}}}},No=new Te,jL={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),i=t.visualStyleAccessPath||"itemStyle",n=DS(t,i),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){No.option=l[i];var u=n(No),f=o.ensureUniqueItemVisual(s,"style");H(f,u),No.option.decal&&(o.setItemVisual(s,"decal",No.option.decal),No.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},QL={performRawSeries:!0,overallReset:function(t){var e=ut();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)),B_(r).scope=a}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var i=r.getRawData(),n={},a=r.getData(),o=B_(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=LS(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)}})}})}},Bl=Math.PI;function JL(t,e){e=e||{},Mt(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 oe,i=new ie({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(i);var n=new Jt({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 ie({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 yp({shape:{startAngle:-Bl/2,endAngle:-Bl/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:Bl*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Bl*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 RS=function(){function t(e,r,i,n){this._stageTaskMap=ut(),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=ut();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;M(this._allHandlers,function(n){var a=e.get(n.uid)||e.set(n.uid,{}),o="";Dr(!(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;M(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=ut(),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)||Ts({plan:nR,reset:aR,count:sR}));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||Ts({reset:tR});o.context={ecModel:i,api:n,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=ut(),u=e.seriesType,f=e.getTargetSeries,h=!0,v=!1,c="";Dr(!e.createOnAllSeries,c),u?i.eachRawSeriesByType(u,d):f?f(i,n).each(d):(h=!1,M(i.getSeries(),d));function d(p){var g=p.uid,m=l.set(g,s&&s.get(g)||(v=!0,Ts({reset:eR,onDirty:iR})));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 ft(e)&&(e={overallReset:e,seriesType:lR(e)}),e.uid=qf("stageHandler"),r&&(e.visualType=r),e},t}();function tR(t){t.overallReset(t.ecModel,t.api,t.payload)}function eR(t){return t.overallProgress&&rR}function rR(){this.agent.dirty(),this.getDownstream().dirty()}function iR(){this.agent&&this.agent.dirty()}function nR(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function aR(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=pe(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?j(e,function(r,i){return PS(i)}):oR}var oR=PS(0);function PS(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 sR(t){return t.data.count()}function lR(t){hf=null;try{t(ks,IS)}catch{}return hf}var ks={},IS={},hf;NS(ks,Bp);NS(IS,lS);ks.eachSeriesByType=ks.eachRawSeriesByType=function(t){hf=t};ks.eachComponent=function(t){t.mainType==="series"&&t.subType&&(hf=t.subType)};function NS(t,e){for(var r in e.prototype)t[r]=Me}var k_=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const uR={color:k_,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],k_]};var ze="#B9B8CE",z_="#100C2A",Fl=function(){return{axisLine:{lineStyle:{color:ze}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},U_=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],OS={darkMode:!0,color:U_,backgroundColor:z_,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:ze}},textStyle:{color:ze},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:ze}},dataZoom:{borderColor:"#71708A",textStyle:{color:ze},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:ze}},timeline:{lineStyle:{color:ze},label:{color:ze},controlStyle:{color:ze,borderColor:ze}},calendar:{itemStyle:{color:z_},dayLabel:{color:ze},monthLabel:{color:ze},yearLabel:{color:ze}},timeAxis:Fl(),logAxis:Fl(),valueAxis:Fl(),categoryAxis:Fl(),line:{symbol:"circle"},graph:{color:U_},gauge:{title:{color:ze},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:ze},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};OS.categoryAxis.splitLine.show=!1;const fR=OS;var hR=function(){function t(){}return t.prototype.normalizeQuery=function(e){var r={},i={},n={};if(q(e)){var a=si(e);r.mainType=a.main||null,r.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};M(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}(),ad=["symbol","symbolSize","symbolRotate","symbolOffset"],H_=ad.concat(["symbolKeepAspect"]),cR={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<ad.length;o++){var s=ad[o],l=t.get(s);ft(l)?(a=!0,n[s]=l):i[s]=l}if(i.symbol=i.symbol||t.defaultSymbol,r.setVisual(H({legendIcon:t.legendIcon||i.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},i)),e.isSeriesFiltered(t))return;var u=_t(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}}},vR={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<H_.length;s++){var l=H_[s],u=o.getShallow(l,!0);u!=null&&n.setItemVisual(a,l,u)}}return{dataEach:r.hasItemOption?i:null}}};function BS(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 FS(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 dR(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 ba(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=ia(h,n.fromActionPayload);r.trigger(a,{type:a,seriesId:o.id,name:Y(v)?h.getName(v[0]):h.getName(v),selected:q(l)?l:H({},l)})}})}function pR(t,e,r){t.on("selectchanged",function(i){var n=r.getModel();i.isFromClick?(ba("map","selectchanged",e,n,i),ba("pie","selectchanged",e,n,i)):i.fromAction==="select"?(ba("map","selected",e,n,i),ba("pie","selected",e,n,i)):i.fromAction==="unselect"&&(ba("map","unselected",e,n,i),ba("pie","unselected",e,n,i))})}function Ya(t,e,r){for(var i;t&&!(e(t)&&(i=t,r));)t=t.__hostTarget||t.parent;return i}var gR=Math.round(Math.random()*9),mR=typeof Object.defineProperty=="function",_R=function(){function t(){this._id="__ec_inner_"+gR++}return t.prototype.get=function(e){return this._guard(e)[this._id]},t.prototype.set=function(e,r){var i=this._guard(e);return mR?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}(),yR=Ut.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()}}),xR=Ut.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()}}),TR=Ut.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()}}),SR=Ut.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()}}),wR={line:na,rect:ie,roundRect:ie,square:ie,circle:mp,diamond:xR,pin:TR,arrow:SR,triangle:yR},bR={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}},cf={};M(wR,function(t,e){cf[e]=new t});var AR=Ut.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,r){var i=Dx(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=cf[i];n||(i="rect",n=cf[i]),bR[i](e.x,e.y,e.width,e.height,n.shape),n.buildPath(t,n.shape,r)}}});function ER(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 Xr(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=PT(t.slice(8),new It(e,r,i,n),o?"center":"cover"):t.indexOf("path://")===0?l=wp(t.slice(7),{},new It(e,r,i,n),o?"center":"cover"):l=new AR({shape:{symbolType:t,x:e,y:r,width:i,height:n}}),l.__isEmptyBrush=s,l.setColor=ER,a&&l.setColor(a),l}function CR(t){return Y(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function kS(t,e){if(t!=null)return Y(t)||(t=[t,t]),[ve(t[0],e[0])||0,ve(gt(t[1],t[0]),e[1])||0]}function Xn(t){return isFinite(t)}function MR(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=Xn(i)?i:0,n=Xn(n)?n:1,a=Xn(a)?a:0,o=Xn(o)?o:0;var s=t.createLinearGradient(i,a,n,o);return s}function DR(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=Xn(o)?o:.5,s=Xn(s)?s:.5,l=l>=0&&Xn(l)?l:.5;var u=t.createRadialGradient(o,s,0,o,s,l);return u}function od(t,e,r){for(var i=e.type==="radial"?DR(t,e,r):MR(t,e,r),n=e.colorStops,a=0;a<n.length;a++)i.addColorStop(n[a].offset,n[a].color);return i}function LR(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 kl(t){return parseInt(t,10)}function Za(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]||kl(s[i])||kl(t.style[i]))-(kl(s[a])||0)-(kl(s[o])||0)|0}function RR(t,e){return!t||t==="solid"||!(e>0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:Qt(t)?[t]:Y(t)?t:null}function Wp(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&RR(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(r){var n=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;n&&n!==1&&(r=j(r,function(a){return a/n}),i/=n)}return[r,i]}var PR=new Mi(!0);function vf(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function V_(t){return typeof t=="string"&&t!=="none"}function df(t){var e=t.fill;return e!=null&&e!=="none"}function G_(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 W_(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 sd(t,e,r){var i=hp(e.image,e.__image,r);if(Uf(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)*du),a.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(a)}return n}}function IR(t,e,r,i){var n,a=vf(r),o=df(r),s=r.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var f=e.path||PR,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?od(t,v,T):e.__canvasFillGradient,e.__canvasFillGradient=_),p&&(y=h?od(t,c,T):e.__canvasStrokeGradient,e.__canvasStrokeGradient=y),g&&(x=h||!e.__canvasFillPattern?sd(t,v,e):e.__canvasFillPattern,e.__canvasFillPattern=x),m&&(S=h||!e.__canvasStrokePattern?sd(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=Wp(e),b=n[0],A=n[1]);var C=!0;(u||h&ka)&&(f.setDPR(t.dpr),l?f.setContext(null):(f.setContext(t),C=!1),f.reset(),e.buildPath(f,e.shape,i),f.toStatic(),e.pathUpdated()),C&&f.rebuildPath(t,l?s:1),b&&(t.setLineDash(b),t.lineDashOffset=A),i||(r.strokeFirst?(a&&W_(t,r),o&&G_(t,r)):(o&&G_(t,r),a&&W_(t,r))),b&&t.setLineDash([])}function NR(t,e,r){var i=e.__image=hp(r.image,e.__image,e,e.onload);if(!(!i||!Uf(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 OR(t,e,r){var i,n=r.text;if(n!=null&&(n+=""),n){t.font=r.font||en,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,o=void 0;t.setLineDash&&r.lineDash&&(i=Wp(e),a=i[0],o=i[1]),a&&(t.setLineDash(a),t.lineDashOffset=o),r.strokeFirst?(vf(r)&&t.strokeText(n,r.x,r.y),df(r)&&t.fillText(n,r.x,r.y)):(df(r)&&t.fillText(n,r.x,r.y),vf(r)&&t.strokeText(n,r.x,r.y)),a&&t.setLineDash([])}}var X_=["shadowBlur","shadowOffsetX","shadowOffsetY"],Y_=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function zS(t,e,r,i,n){var a=!1;if(!i&&(r=r||{},e===r))return!1;if(i||e.opacity!==r.opacity){Je(t,n),a=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?jn.opacity:o}(i||e.blend!==r.blend)&&(a||(Je(t,n),a=!0),t.globalCompositeOperation=e.blend||jn.blend);for(var s=0;s<X_.length;s++){var l=X_[s];(i||e[l]!==r[l])&&(a||(Je(t,n),a=!0),t[l]=t.dpr*(e[l]||0))}return(i||e.shadowColor!==r.shadowColor)&&(a||(Je(t,n),a=!0),t.shadowColor=e.shadowColor||jn.shadowColor),a}function Z_(t,e,r,i,n){var a=zs(e,n.inHover),o=i?null:r&&zs(r,n.inHover)||{};if(a===o)return!1;var s=zS(t,a,o,i,n);if((i||a.fill!==o.fill)&&(s||(Je(t,n),s=!0),V_(a.fill)&&(t.fillStyle=a.fill)),(i||a.stroke!==o.stroke)&&(s||(Je(t,n),s=!0),V_(a.stroke)&&(t.strokeStyle=a.stroke)),(i||a.opacity!==o.opacity)&&(s||(Je(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||(Je(t,n),s=!0),t.lineWidth=u)}for(var f=0;f<Y_.length;f++){var h=Y_[f],v=h[0];(i||a[v]!==o[v])&&(s||(Je(t,n),s=!0),t[v]=a[v]||h[1])}return s}function BR(t,e,r,i,n){return zS(t,zs(e,n.inHover),r&&zs(r,n.inHover),i,n)}function US(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 FR(t,e,r){for(var i=!1,n=0;n<t.length;n++){var a=t[n];i=i||a.isZeroArea(),US(e,a),e.beginPath(),a.buildPath(e,a.shape),e.clip()}r.allClipped=i}function kR(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 $_=1,q_=2,K_=3,j_=4;function zR(t){var e=df(t),r=vf(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 Je(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function zs(t,e){return e&&t.__hoverStyle||t.style}function Xp(t,e){Yn(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function Yn(t,e,r,i){var n=e.transform;if(!e.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1)){e.__dirty&=~ur,e.__isRendered=!1;return}var a=e.__clipPaths,o=r.prevElClipPaths,s=!1,l=!1;if((!o||LR(a,o))&&(o&&o.length&&(Je(t,r),t.restore(),l=s=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),a&&a.length&&(Je(t,r),t.save(),FR(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 Ut&&e.autoBatch&&zR(e.style);s||kR(n,u.transform)?(Je(t,r),US(t,e)):f||Je(t,r);var h=zs(e,r.inHover);e instanceof Ut?(r.lastDrawType!==$_&&(l=!0,r.lastDrawType=$_),Z_(t,e,u,l,r),(!f||!r.batchFill&&!r.batchStroke)&&t.beginPath(),IR(t,e,h,f),f&&(r.batchFill=h.fill||"",r.batchStroke=h.stroke||"")):e instanceof ju?(r.lastDrawType!==K_&&(l=!0,r.lastDrawType=K_),Z_(t,e,u,l,r),OR(t,e,h)):e instanceof Pr?(r.lastDrawType!==q_&&(l=!0,r.lastDrawType=q_),BR(t,e,u,l,r),NR(t,e,h)):e.getTemporalDisplayables&&(r.lastDrawType!==j_&&(l=!0,r.lastDrawType=j_),UR(t,e,r)),f&&i&&Je(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),r.prevEl=e,e.__dirty=0,e.__isRendered=!0}function UR(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(),Yn(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(),Yn(t,l,a,u===f-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}var dc=new _R,Q_=new _o(100),J_=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function ld(t,e){if(t==="none")return null;var r=e.getDevicePixelRatio(),i=e.getZr(),n=i.painter.type==="svg";t.dirty&&dc.delete(t);var a=dc.get(t);if(a)return a;var o=Mt(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,dc.set(t,s),t.dirty=!1,s;function l(u){for(var f=[r],h=!0,v=0;v<J_.length;++v){var c=o[J_[v]];if(c!=null&&!Y(c)&&!q(c)&&!Qt(c)&&typeof c!="boolean"){h=!1;break}f.push(c)}var d;if(h){d=f.join(",")+(n?"-svg":"");var p=Q_.get(d);p&&(n?u.svgElement=p:u.image=p)}var g=VS(o.dashArrayX),m=HR(o.dashArrayY),_=HS(o.symbol),y=VR(g),x=GS(m),S=!n&&go.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")),C(),h&&Q_.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,L=y.length;D<L;++D)E=fm(E,y[D]);for(var P=1,D=0,L=_.length;D<L;++D)P=fm(P,_[D].length);E*=P;var N=x*y.length*_.length;return{width:Math.max(1,Math.min(E,o.maxTileWidth)),height:Math.max(1,Math.min(N,o.maxTileHeight))}}function C(){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 L=-x,P=0,N=0,I=0;L<w.height;){if(P%2===0){for(var k=N/2%_.length,O=0,U=0,z=0;O<w.width*2;){for(var nt=0,D=0;D<g[I].length;++D)nt+=g[I][D];if(nt<=0)break;if(U%2===0){var $=(1-o.symbolSize)*.5,J=O+g[I][U]*$,it=L+m[P]*$,Pt=g[I][U]*o.symbolSize,pt=m[P]*o.symbolSize,Bt=z/2%_[k].length;Xt(J,it,Pt,pt,_[k][Bt])}O+=g[I][U],++z,++U,U===g[I].length&&(U=0)}++I,I===g.length&&(I=0)}L+=m[P],++N,++P,P===m.length&&(P=0)}function Xt(Nt,Et,K,wt,se){var Zt=n?1:r,Be=Xr(se,Nt*Zt,Et*Zt,K*Zt,wt*Zt,o.color,o.symbolKeepAspect);if(n){var Nr=i.painter.renderOneToVNode(Be);Nr&&T.children.push(Nr)}else Xp(b,Be)}}}}function HS(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 HS([t]);for(var i=[],r=0;r<t.length;++r)q(t[r])?i.push([t[r]]):i.push(t[r]);return i}function VS(t){if(!t||t.length===0)return[[0,0]];if(Qt(t)){var e=Math.ceil(t);return[[e,e]]}for(var r=!0,i=0;i<t.length;++i)if(!Qt(t[i])){r=!1;break}if(r)return VS([t]);for(var n=[],i=0;i<t.length;++i)if(Qt(t[i])){var e=Math.ceil(t[i]);n.push([e,e])}else{var e=j(t[i],function(s){return Math.ceil(s)});e.length%2===1?n.push(e.concat(e)):n.push(e)}return n}function HR(t){if(!t||typeof t=="object"&&t.length===0)return[0,0];if(Qt(t)){var e=Math.ceil(t);return[e,e]}var r=j(t,function(i){return Math.ceil(i)});return t.length%2?r.concat(r):r}function VR(t){return j(t,function(e){return GS(e)})}function GS(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return t.length%2===1?e*2:e}function GR(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=ld(s,e)}});var n=i.getVisual("decal");if(n){var a=i.getVisual("style");a.decal=ld(n,e)}}})}var Hr=new $r,WS={};function WR(t,e){WS[t]=e}function XR(t){return WS[t]}var YR=1,ZR=800,$R=900,qR=1e3,KR=2e3,jR=5e3,XS=1e3,QR=1100,Yp=2e3,YS=3e3,JR=4e3,oh=4500,tP=4600,eP=5e3,rP=6e3,ZS=7e3,iP={PROCESSOR:{FILTER:qR,SERIES_FILTER:ZR,STATISTIC:jR},VISUAL:{LAYOUT:XS,PROGRESSIVE_LAYOUT:QR,GLOBAL:Yp,CHART:YS,POST_CHART_LAYOUT:tP,COMPONENT:JR,BRUSH:eP,CHART_ITEM:oh,ARIA:rP,DECAL:ZS}},Re="__flagInMainProcess",je="__pendingUpdate",pc="__needsUpdateStatus",t0=/^[a-zA-Z0-9_]+$/,gc="__connectUpdateStatus",e0=0,nP=1,aP=2;function $S(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isDisposed()){this.id;return}return KS(this,t,e)}}function qS(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return KS(this,t,e)}}function KS(t,e,r){return r[0]=r[0]&&r[0].toLowerCase(),$r.prototype[e].apply(t,r)}var jS=function(t){W(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}($r),QS=jS.prototype;QS.on=qS("on");QS.off=qS("off");var Aa,mc,zl,Fi,_c,yc,xc,Oo,Bo,r0,i0,Tc,n0,Ul,a0,JS,dr,o0,tw=function(t){W(e,t);function e(r,i,n){var a=t.call(this,new hR)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},a._pendingActions=[],n=n||{},q(i)&&(i=ew[i]),a._dom=r;var o="canvas",s="auto",l=!1,u=a._zr=Hv(r,{renderer:n.renderer||o,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height,ssr:n.ssr,useDirtyRect:gt(n.useDirtyRect,l),useCoarsePointer:gt(n.useCoarsePointer,s),pointerSize:n.pointerSize});a._ssr=n.ssr,a._throttledZrFlush=Gp(rt(u.flush,u),17),i=lt(i),i&&fS(i,!0),a._theme=i,a._locale=yD(n.locale||UT),a._coordSysMgr=new eh;var f=a._api=a0(a);function h(v,c){return v.__prio-c.__prio}return pu(gf,h),pu(ud,h),a._scheduler=new RS(a,f,ud,gf),a._messageCenter=new jS,a._initEvents(),a.resize=rt(a.resize,a),u.animation.on("frame",a._onframe,a),r0(u,a),i0(u,a),zu(a),a}return e.prototype._onframe=function(){if(!this._disposed){o0(this);var r=this._scheduler;if(this[je]){var i=this[je].silent;this[Re]=!0;try{Aa(this),Fi.update.call(this,null,this[je].updateParams)}catch(l){throw this[Re]=!1,this[je]=null,l}this._zr.flush(),this[Re]=!1,this[je]=null,Oo.call(this,i),Bo.call(this,i)}else if(r.unfinished){var n=YR,a=this._model,o=this._api;r.unfinished=!1;do{var s=+new Date;r.performSeriesTasks(a),r.performDataProcessorTasks(a),yc(this,a),r.performVisualTasks(a),Ul(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[Re]){if(this._disposed){this.id;return}var a,o,s;if(Q(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[Re]=!0,!this._model||i){var l=new KD(this._api),u=this._theme,f=this._model=new Bp;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},fd);var h={seriesTransition:s,optionChanged:!0};if(n)this[je]={silent:a,updateParams:h},this[Re]=!1,this.getZr().wakeUp();else{try{Aa(this),Fi.update.call(this,null,h)}catch(v){throw this[je]=null,this[Re]=!1,v}this._ssr||this._zr.flush(),this[je]=null,this[Re]=!1,Oo.call(this,a),Bo.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||ct.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(ct.svgSupported){var r=this._zr,i=r.storage.getDisplayList();return M(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;M(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 M(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(s0[n]){var l=s,u=s,f=-s,h=-s,v=[],c=r&&r.pixelRatio||this.getDevicePixelRatio();M(ws,function(y,x){if(y.group===n){var S=i?y.getZr().painter.getSvgDom().innerHTML:y.renderToCanvas(lt(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=go.createCanvas(),m=Hv(g,{renderer:i?"svg":"canvas"});if(m.resize({width:d,height:p}),i){var _="";return M(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 ie({shape:{x:0,y:0,width:d,height:p},style:{fill:r.connectedBackgroundColor}})),M(v,function(y){var x=new Pr({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 _c(this,"convertToPixel",r,i)},e.prototype.convertFromPixel=function(r,i){return _c(this,"convertFromPixel",r,i)},e.prototype.containPixel=function(r,i){if(this._disposed){this.id;return}var n=this._model,a,o=Hh(n,r);return M(o,function(s,l){l.indexOf("Models")>=0&&M(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=Hh(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?BS(s,l,i):FS(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;M(oP,function(i){var n=function(a){var o=r.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&Ya(s,function(d){var p=Ft(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=H({},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)}),M(Ss,function(i,n){r._messageCenter.on(n,function(a){this.trigger(n,a)},r)}),M(["selectchanged"],function(i){r._messageCenter.on(i,function(n){this.trigger(i,n)},r)}),pR(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&&Vx(this.getDom(),$p,"");var i=this,n=i._api,a=i._model;M(i._componentsViews,function(o){o.dispose(a,n)}),M(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 ws[i.id]},e.prototype.resize=function(r){if(!this[Re]){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[je]&&(a==null&&(a=this[je].silent),n=!0,this[je]=null),this[Re]=!0;try{n&&Aa(this),Fi.update.call(this,{type:"resize",animation:H({duration:0},r&&r.animation)})}catch(o){throw this[Re]=!1,o}this[Re]=!1,Oo.call(this,a),Bo.call(this,a)}}},e.prototype.showLoading=function(r,i){if(this._disposed){this.id;return}if(Q(r)&&(i=r,r=""),r=r||"default",this.hideLoading(),!!hd[r]){var n=hd[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=H({},r);return i.type=Ss[r.type],i},e.prototype.dispatchAction=function(r,i){if(this._disposed){this.id;return}if(Q(i)||(i={silent:!!i}),!!pf[r.type]&&this._model){if(this[Re]){this._pendingActions.push(r);return}var n=i.silent;xc.call(this,r,n);var a=i.flush;a?this._zr.flush():a!==!1&&ct.browser.weChat&&this._throttledZrFlush(),Oo.call(this,n),Bo.call(this,n)}},e.prototype.updateLabelLayout=function(){Hr.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(){Aa=function(h){var v=h._scheduler;v.restorePipelines(h._model),v.prepareStageTasks(),mc(h,!0),mc(h,!1),v.plan()},mc=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 C=si(T.type),E=v?cr.getClass(C.main,C.sub):Ai.getClass(C.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)}},zl=function(h,v,c,d,p){var g=h._model;if(g.setUpdatePayload(c),!d){M([].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=ut(),M(pe(y),function(T){var w=Ge(T,null);w!=null&&x.set(w,!0)})),g&&g.eachComponent(_,function(T){var w=x&&x.get(T.id)!=null;if(!w)if(Hm(c))if(T instanceof so)c.type===Qn&&!c.notBlur&&!T.get(["emphasis","disabled"])&&tM(T,c,h._api);else{var b=pp(T.mainType,T.componentIndex,c.name,h._api),A=b.focusSelf,C=b.dispatchers;c.type===Qn&&A&&!c.notBlur&&Yv(T.mainType,T.componentIndex,h._api),C&&M(C,function(E){c.type===Qn?Ju(E):tf(E)})}else qv(c)&&T instanceof so&&(iM(T,c,h._api),km(T),dr(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)}},Fi={prepareAndUpdate:function(h){Aa(this),Fi.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),yc(this,c),g.update(c,d),r(c),m.performVisualTasks(c,h),Tc(this,c,d,h,v);var _=c.get("backgroundColor")||"transparent",y=c.get("darkMode");p.setBackgroundColor(_),y!=null&&y!=="auto"&&p.setDarkMode(y),Hr.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=ut();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}),Ul(this,c,d,h,{},g),Hr.trigger("afterupdate",c,d)}},updateView:function(h){var v=this._model;v&&(v.setUpdatePayload(h),Ai.markUpdateMethod(h,"updateView"),r(v),this._scheduler.performVisualTasks(v,h,{setDirty:!0}),Tc(this,v,this._api,h,{}),Hr.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()}),Ai.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)}),Hr.trigger("afterupdate",c,this._api))},updateLayout:function(h){Fi.update.call(this,h)}},_c=function(h,v,c,d){if(h._disposed){h.id;return}for(var p=h._model,g=h._coordSysMgr.getCoordinateSystems(),m,_=Hh(p,c),y=0;y<g.length;y++){var x=g[y];if(x[v]&&(m=x[v](p,_,d))!=null)return m}},yc=function(h,v){var c=h._chartsMap,d=h._scheduler;v.eachSeries(function(p){d.updateStreamModes(p,c[p.__viewId])})},xc=function(h,v){var c=this,d=this.getModel(),p=h.type,g=h.escapeConnect,m=pf[p],_=m.actionInfo,y=(_.update||"update").split(":"),x=y.pop(),S=y[0]!=null&&si(y[0]);this[Re]=!0;var T=[h],w=!1;h.batch&&(w=!0,T=j(h.batch,function(P){return P=Mt(H({},P),h),P.batch=null,P}));var b=[],A,C=qv(h),E=Hm(h);if(E&&cT(this._api),M(T,function(P){if(A=m.action(P,c._model,c._api),A=A||H({},P),A.type=_.event||A.type,b.push(A),E){var N=up(h),I=N.queryOptionMap,k=N.mainTypeSpecified,O=k?I.keys()[0]:"series";zl(c,x,P,O),dr(c)}else C?(zl(c,x,P,"series"),dr(c)):S&&zl(c,x,P,S.main,S.sub)}),x!=="none"&&!E&&!C&&!S)try{this[je]?(Aa(this),Fi.update.call(this,h),this[je]=null):Fi[x].call(this,h)}catch(P){throw this[Re]=!1,P}if(w?A={type:_.event||p,escapeConnect:g,batch:b}:A=b[0],this[Re]=!1,!v){var D=this._messageCenter;if(D.trigger(A.type,A),C){var L={type:"selectchanged",escapeConnect:g,selected:nM(d),isFromClick:h.isFromClick||!1,fromAction:h.type,fromActionPayload:h};D.trigger(L.type,L)}}},Oo=function(h){for(var v=this._pendingActions;v.length;){var c=v.shift();xc.call(this,c,h)}},Bo=function(h){!h&&this.trigger("updated")},r0=function(h,v){h.on("rendered",function(c){v.trigger("rendered",c),h.animation.isFinished()&&!v[je]&&!v._scheduler.unfinished&&!v._pendingActions.length&&v.trigger("finished")})},i0=function(h,v){h.on("mouseover",function(c){var d=c.target,p=Ya(d,$v);p&&(eM(p,c,v._api),dr(v))}).on("mouseout",function(c){var d=c.target,p=Ya(d,$v);p&&(rM(p,c,v._api),dr(v))}).on("click",function(c){var d=c.target,p=Ya(d,function(_){return Ft(_).dataIndex!=null},!0);if(p){var g=p.selected?"unselect":"select",m=Ft(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;pu(p,function(_,y){return _.zlevel===y.zlevel?_.z-y.z:_.zlevel-y.zlevel}),M(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)})}}Tc=function(h,v,c,d,p){i(v),n0(h,v,c,d,p),M(h._chartsViews,function(g){g.__alive=!1}),Ul(h,v,c,d,p),M(h._chartsViews,function(g){g.__alive||g.remove(v,c)})},n0=function(h,v,c,d,p,g){M(g||h._componentsViews,function(m){var _=m.__model;u(_,m),m.render(_,v,c,d),s(_,m),f(_,m)})},Ul=function(h,v,c,d,p,g){var m=h._scheduler;p=H(p||{},{updatedSeries:v.getSeries()}),Hr.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),km(y)}),m.unfinished=_||m.unfinished,Hr.trigger("series:layoutlabels",v,c,p),Hr.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),Hr.trigger("series:afterupdate",v,c,p)},dr=function(h){h[pc]=!0,h.getZr().wakeUp()},o0=function(h){h[pc]&&(h.getZr().storage.traverse(function(v){to(v)||n(v)}),h[pc]=!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===Gf&&h.states.emphasis?v.push("emphasis"):h.hoverState===Vf&&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")&&!ct.node&&!ct.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(!to(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(to(m))return;if(m instanceof Ut&&uM(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)}})}a0=function(h){return new(function(v){W(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){Ju(d,p),dr(h)},c.prototype.leaveEmphasis=function(d,p){tf(d,p),dr(h)},c.prototype.enterBlur=function(d){JC(d),dr(h)},c.prototype.leaveBlur=function(d){lT(d),dr(h)},c.prototype.enterSelect=function(d){uT(d),dr(h)},c.prototype.leaveSelect=function(d){fT(d),dr(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}(lS))(h)},JS=function(h){function v(c,d){for(var p=0;p<c.length;p++){var g=c[p];g[gc]=d}}M(Ss,function(c,d){h._messageCenter.on(d,function(p){if(s0[h.group]&&h[gc]!==e0){if(p&&p.escapeConnect)return;var g=h.makeActionFromEvent(p),m=[];M(ws,function(_){_!==h&&_.group===h.group&&m.push(_)}),v(m,e0),M(m,function(_){_[gc]!==nP&&_.dispatchAction(g)}),v(m,aP)}})})}}(),e}($r),Zp=tw.prototype;Zp.on=$S("on");Zp.off=$S("off");Zp.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 oP=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var pf={},Ss={},ud=[],fd=[],gf=[],ew={},hd={},ws={},s0={},sP=+new Date-0,$p="_echarts_instance_";function lP(t,e,r){var i=!(r&&r.ssr);if(i){var n=uP(t);if(n)return n}var a=new tw(t,e,r);return a.id="ec_"+sP++,ws[a.id]=a,i&&Vx(t,$p,a.id),JS(a),Hr.trigger("afterinit",a),a}function uP(t){return ws[GE(t,$p)]}function rw(t,e){ew[t]=e}function qp(t){Ct(fd,t)<0&&fd.push(t)}function iw(t,e){jp(ud,t,e,KR)}function nw(t){Kp("afterinit",t)}function aw(t){Kp("afterupdate",t)}function Kp(t,e){Hr.on(t,e)}function ha(t,e,r){ft(e)&&(r=e,e="");var i=Q(t)?t.type:[t,t={event:e}][0];t.event=(t.event||i).toLowerCase(),e=t.event,!Ss[e]&&(Dr(t0.test(i)&&t0.test(e)),pf[i]||(pf[i]={action:r,actionInfo:t}),Ss[e]=i)}function fP(t,e){eh.register(t,e)}function hP(t){var e=eh.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()}function cP(t,e){jp(gf,t,e,XS,"layout")}function ca(t,e){jp(gf,t,e,YS,"visual")}var l0=[];function jp(t,e,r,i,n){if((ft(e)||Q(e))&&(r=e,e=i),!(Ct(l0,r)>=0)){l0.push(r);var a=RS.wrapStageHandler(r,n);a.__prio=e,a.__raw=r,t.push(a)}}function ow(t,e){hd[t]=e}function vP(t,e,r){var i=XR("registerMap");i&&i(t,e,r)}var dP=SL;ca(Yp,KL);ca(oh,jL);ca(oh,QL);ca(Yp,cR);ca(oh,vR);ca(ZS,GR);qp(fS);iw($R,nL);ow("default",JL);ha({type:Qn,event:Qn,update:Qn},Me);ha({type:xu,event:xu,update:xu},Me);ha({type:gs,event:gs,update:gs},Me);ha({type:Tu,event:Tu,update:Tu},Me);ha({type:ms,event:ms,update:ms},Me);rw("light",uR);rw("dark",fR);function Fo(t){return t==null?0:t.length||1}function u0(t){return t}var pP=function(){function t(e,r,i,n,a,o){this._old=e,this._new=r,this._oldKeyGetter=i||u0,this._newKeyGetter=n||u0,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=Fo(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=Fo(u),v=Fo(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=Fo(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=Fo(l);u===0?(r[s]=o,a&&i.push(s)):u===1?r[s]=[l,o]:l.push(o)}}},t}();const gP=pP;var mP=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 _P(t,e){var r={},i=r.encode={},n=ut(),a=[],o=[],s={};M(t.dimensions,function(v){var c=t.getDimensionInfo(v),d=c.coordDim;if(d){var p=c.coordDimIndex;Sc(i,d)[p]=v,c.isExtraCoord||(n.set(d,1),xP(c.type)&&(a[0]=v),Sc(s,d)[p]=t.getDimensionIndex(c.name)),c.defaultTooltip&&o.push(v)}iS.each(function(g,m){var _=Sc(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=j(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 mP(s,e),r}function Sc(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function yP(t){return t==="category"?"ordinal":t==="time"?"time":"float"}function xP(t){return!(t==="ordinal"||t==="time")}var Au=function(){function t(e){this.otherDims={},e!=null&&H(this,e)}return t}(),TP=Kt(),SP={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},sw=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=fw(this.source)))},t.prototype.getSourceDimensionIndex=function(e){return gt(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=cS(this.source),i=!hw(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+=SP[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 lw(t){return t instanceof sw}function uw(t){for(var e=ut(),r=0;r<(t||[]).length;r++){var i=t[r],n=Q(i)?i.name:i;n!=null&&e.get(n)==null&&e.set(n,r)}return e}function fw(t){var e=TP(t);return e.dimNameMap||(e.dimNameMap=uw(t.dimensionsDefine))}function hw(t){return t>30}var ko=Q,ki=j,wP=typeof Int32Array>"u"?Array:Int32Array,bP="e\0\0",f0=-1,AP=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],EP=["_approximateExtent"],h0,Hl,zo,Uo,wc,Vl,bc,cw=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;lw(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 Au({name:h}):h instanceof Au?h:new Au(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=ut();M(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(Qt(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 ed&&(a=e),!a){var o=this.dimensions,s=Fp(e)||Ze(e)?new vS(e,o.length):e;a=new ed;var l=ki(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=_P(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&&bc(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!==tn&&!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===Ir;if(l&&!n.pure)for(var u=[],f=e;f<r;f++){var h=n.getItem(f,u);if(!this.hasItemOption&&RE(h)&&(this.hasItemOption=!0),h){var v=h.name;a[f]==null&&v!=null&&(a[f]=Ge(v,null));var c=h.id;o[f]==null&&c!=null&&(o[f]=Ge(c,null))}}if(this._shouldMakeIdFromName())for(var f=e;f<r;f++)bc(this,f);h0(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){ko(e)?H(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=zo(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 Hl(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 Y(e)?n.getValues(ki(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)?f0:n},t.prototype.indicesOfNearest=function(e,r,i){return this._store.indicesOfNearest(this._getStoreDimIndex(e),r,i)},t.prototype.each=function(e,r,i){ft(e)&&(i=r,r=e,e=[]);var n=i||this,a=ki(Uo(e),this._getStoreDimIndex,this);this._store.each(a,n?rt(r,n):r)},t.prototype.filterSelf=function(e,r,i){ft(e)&&(i=r,r=e,e=[]);var n=i||this,a=ki(Uo(e),this._getStoreDimIndex,this);return this._store=this._store.filter(a,n?rt(r,n):r),this},t.prototype.selectRange=function(e){var r=this,i={},n=_t(e);return M(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){ft(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=ki(Uo(e),this._getStoreDimIndex,this),s=Vl(this);return s._store=this._store.map(o,a?rt(r,a):r),s},t.prototype.modify=function(e,r,i,n){var a=i||n||this,o=ki(Uo(e),this._getStoreDimIndex,this);this._store.modify(o,a?rt(r,a):r)},t.prototype.downSample=function(e,r,i,n){var a=Vl(this);return a._store=this._store.downSample(this._getStoreDimIndex(e),r,i,n),a},t.prototype.lttbDownSample=function(e,r){var i=Vl(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 Te(i,r,r&&r.ecModel)},t.prototype.diff=function(e){var r=this;return new gP(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(i){return Hl(e,i)},function(i){return Hl(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||{},ko(e)?H(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),Y(a)?a=a.slice():ko(a)&&(a=H({},a)),n[r]=a),a},t.prototype.setItemVisual=function(e,r,i){var n=this._itemVisuals[e]||{};this._itemVisuals[e]=n,ko(r)?H(n,r):n[r]=i},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){ko(e)?H(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?H(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;GC(i,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){M(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:ki(this.dimensions,this._getDimInfo,this),this.hostModel)),wc(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var i=this[e];ft(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var n=i.apply(this,arguments);return r.apply(this,[n].concat(Qd(arguments)))})},t.internalField=function(){h0=function(e){var r=e._invertedIndicesMap;M(r,function(i,n){var a=e._dimInfos[n],o=a.ordinalMeta,s=e._store;if(o){i=r[n]=new wP(o.categories.length);for(var l=0;l<i.length;l++)i[l]=f0;for(var l=0;l<s.count();l++)i[s.get(a.storeDimIndex,l)]=l}})},zo=function(e,r,i){return Ge(e._getCategory(r,i),null)},Hl=function(e,r){var i=e._idList[r];return i==null&&e._idDimIdx!=null&&(i=zo(e,e._idDimIdx,r)),i==null&&(i=bP+r),i},Uo=function(e){return Y(e)||(e=e!=null?[e]:[]),e},Vl=function(e){var r=new t(e._schema?e._schema:ki(e.dimensions,e._getDimInfo,e),e.hostModel);return wc(r,e),r},wc=function(e,r){M(AP.concat(r.__wrappedMethods||[]),function(i){r.hasOwnProperty(i)&&(e[i]=r[i])}),e.__wrappedMethods=r.__wrappedMethods,M(EP,function(i){e[i]=lt(r[i])}),e._calculationInfo=H({},r._calculationInfo)},bc=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=zo(e,a,r)),l==null&&o!=null&&(n[r]=l=zo(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 CP(t,e){return vw(t,e).dimensions}function vw(t,e){Fp(t)||(t=kp(t)),e=e||{};var r=e.coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],n=ut(),a=[],o=DP(t,r,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&hw(o),l=i===t.dimensionsDefine,u=l?fw(t):uw(i),f=e.encodeDefine;!f&&e.encodeDefaulter&&(f=e.encodeDefaulter(t,o));for(var h=ut(f),v=new _S(o),c=0;c<v.length;c++)v[c]=-1;function d(A){var C=v[A];if(C<0){var E=i[A],D=Q(E)?E:{name:E},L=new Au,P=D.name;P!=null&&u.get(P)!=null&&(L.name=L.displayName=P),D.type!=null&&(L.type=D.type),D.displayName!=null&&(L.displayName=D.displayName);var N=a.length;return v[A]=N,L.storeDimIndex=A,a.push(L),L}return a[C]}if(!s)for(var c=0;c<o;c++)d(c);h.each(function(A,C){var E=pe(A).slice();if(E.length===1&&!q(E[0])&&E[0]<0){h.set(C,!1);return}var D=h.set(C,[]);M(E,function(L,P){var N=q(L)?u.get(L):L;N!=null&&N<o&&(D[P]=N,g(d(N),C,P))})});var p=0;M(r,function(A){var C,E,D,L;if(q(A))C=A,L={};else{L=A,C=L.name;var P=L.ordinalMeta;L.ordinalMeta=null,L=H({},L),L.ordinalMeta=P,E=L.dimsDef,D=L.otherDims,L.name=L.coordDim=L.coordDimIndex=L.dimsDef=L.otherDims=null}var N=h.get(C);if(N!==!1){if(N=pe(N),!N.length)for(var I=0;I<(E&&E.length||1);I++){for(;p<o&&d(p).coordDim!=null;)p++;p<o&&N.push(p++)}M(N,function(k,O){var U=d(k);if(l&&L.type!=null&&(U.type=L.type),g(Mt(U,L),C,O),U.name==null&&E){var z=E[O];!Q(z)&&(z={name:z}),U.name=U.displayName=z.name,U.defaultTooltip=z.defaultTooltip}D&&Mt(U.otherDims,D)})}});function g(A,C,E){iS.get(C)!=null?A.otherDims[C]=E:(A.coordDim=C,A.coordDimIndex=E,n.set(C,!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)M(a,function(A){S(A)}),a.sort(function(A,C){return A.storeDimIndex-C.storeDimIndex});else for(var T=0;T<o;T++){var w=d(T),b=w.coordDim;b==null&&(w.coordDim=LP(x,n,y),w.coordDimIndex=0,(!m||_<=0)&&(w.isExtraCoord=!0),_--),S(w),w.type==null&&(sS(t,T)===or.Must||w.isExtraCoord&&(w.otherDims.itemName!=null||w.otherDims.seriesName!=null))&&(w.type="ordinal")}return MP(a),new sw({source:t,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function MP(t){for(var e=ut(),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 DP(t,e,r,i){var n=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,i||0);return M(e,function(a){var o;Q(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function LP(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 RP=function(){function t(e){this.coordSysDims=[],this.axisMap=ut(),this.categoryAxisMap=ut(),this.coordSysName=e}return t}();function PP(t){var e=t.get("coordinateSystem"),r=new RP(e),i=IP[e];if(i)return i(t,r,r.axisMap,r.categoryAxisMap),r}var IP={cartesian2d:function(t,e,r,i){var n=t.getReferringComponents("xAxis",tr).models[0],a=t.getReferringComponents("yAxis",tr).models[0];e.coordSysDims=["x","y"],r.set("x",n),r.set("y",a),Ea(n)&&(i.set("x",n),e.firstCategoryDimIndex=0),Ea(a)&&(i.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,i){var n=t.getReferringComponents("singleAxis",tr).models[0];e.coordSysDims=["single"],r.set("single",n),Ea(n)&&(i.set("single",n),e.firstCategoryDimIndex=0)},polar:function(t,e,r,i){var n=t.getReferringComponents("polar",tr).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),Ea(a)&&(i.set("radius",a),e.firstCategoryDimIndex=0),Ea(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();M(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),f=o[l];r.set(f,u),Ea(u)&&(i.set(f,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function Ea(t){return t.get("type")==="category"}function dw(t,e,r){r=r||{};var i=r.byIndex,n=r.stackedCoordDimension,a,o,s;NP(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),u,f,h,v;if(M(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;M(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 NP(t){return!lw(t.schema)}function lo(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function pw(t,e){return lo(t,e)?t.getCalculationInfo("stackResultDimension"):e}function OP(t,e){var r=t.get("coordinateSystem"),i=eh.get(r),n;return e&&e.coordSysDims&&(n=j(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=yP(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function BP(t,e,r){var i,n;return r&&M(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 FP(t,e,r){r=r||{};var i=e.getSourceManager(),n,a=!1;t?(a=!0,n=kp(t)):(n=i.getSource(),a=n.sourceFormat===Ir);var o=PP(e),s=OP(e,o),l=r.useEncodeDefaulter,u=ft(l)?l:l?de(RD,s,e):null,f={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=vw(n,f),v=BP(h.dimensions,r.createInvertedIndices,o),c=a?null:i.getSharedDataStore(h),d=dw(e,{schema:h,store:c}),p=new cw(h,e);p.setCalculationInfo(d);var g=v!=null&&kP(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 kP(t){if(t.sourceFormat===Ir){var e=zP(t.data||[]);return!Y(js(e))}}function zP(t){for(var e=0;e<t.length&&t[e]==null;)e++;return t[e]}var di=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}();zf(di);var UP=0,mf=function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++UP}return t.createByAxisModel=function(e){var r=e.option,i=r.data,n=i&&j(i,HP);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=ut(this.categories))},t}();function HP(t){return Q(t)&&t.value!=null?t.value:t+""}function cd(t){return t.type==="interval"||t.type==="log"}function VP(t,e,r,i){var n={},a=t[1]-t[0],o=n.interval=Bx(a/e,!0);r!=null&&o<r&&(o=n.interval=r),i!=null&&o>i&&(o=n.interval=i);var s=n.intervalPrecision=gw(o),l=n.niceTickExtent=[re(Math.ceil(t[0]/o)*o,s),re(Math.floor(t[1]/o)*o,s)];return GP(l,t),n}function Ac(t){var e=Math.pow(10,sp(t)),r=t/e;return r?r===2?r=3:r===3?r=5:r*=2:r=1,re(r*e)}function gw(t){return Ti(t)+2}function c0(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function GP(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),c0(t,0,e),c0(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function sh(t,e){return t>=e[0]&&t<=e[1]}function lh(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function uh(t,e){return t*(e[1]-e[0])+e[0]}var mw=function(t){W(e,t);function e(r){var i=t.call(this,r)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new mf({})),Y(n)&&(n=new mf({categories:j(n,function(a){return Q(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),sh(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),lh(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(uh(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}(di);di.registerClass(mw);const _w=mw;var Cn=re,yw=function(t){W(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 sh(r,this._extent)},e.prototype.normalize=function(r){return lh(r,this._extent)},e.prototype.scale=function(r){return uh(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=gw(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:Cn(a[0]-i,o)}):s.push({value:n[0]}));for(var u=a[0];u<=a[1]&&(s.push({value:u}),u=Cn(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:Cn(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=Cn(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=Ti(r.value)||0:n==="auto"&&(n=this._intervalPrecision);var a=Cn(r.value,n,!0);return lf(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=VP(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]=Cn(Math.floor(i[0]/o)*o)),r.fixMax||(i[1]=Cn(Math.ceil(i[1]/o)*o))},e.prototype.setNiceExtent=function(r,i){this._niceExtent=[r,i]},e.type="interval",e}(di);di.registerClass(yw);const il=yw;var xw=typeof Float32Array<"u",WP=xw?Float32Array:Array;function $a(t){return Y(t)?xw?new Float32Array(t):t:new WP(t)}var XP="__ec_stack_";function Tw(t){return t.get("stack")||XP+t.seriesIndex}function Sw(t){return t.dim+t.index}function YP(t,e){var r=[];return e.eachSeriesByType(t,function(i){jP(i)&&r.push(i)}),r}function ZP(t){var e={};M(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 $P(t){var e=ZP(t),r=[];return M(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=ve(i.get("barWidth"),s),p=ve(i.get("barMaxWidth"),s),g=ve(i.get("barMinWidth")||(QP(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:Sw(a),stackId:Tw(i)})}),qP(r)}function qP(t){var e={};M(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 M(e,function(i,n){r[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=_t(a).length;s=Math.max(35-l*4,15)+"%"}var u=ve(s,o),f=ve(i.gap,1),h=i.remainedWidth,v=i.autoWidthCount,c=(h-u)/(v+(v-1)*f);c=Math.max(c,0),M(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;M(a,function(m,_){m.width||(m.width=c),p=m,d+=m.width*(1+f)}),p&&(d-=p.width*f);var g=-d/2;M(a,function(m,_){r[n][_]=r[n][_]||{bandWidth:o,offset:g,width:m.width},g+=m.width*(1+f)})}),r}function KP(t,e,r){if(t&&e){var i=t[Sw(e)];return i!=null&&r!=null?i[Tw(r)]:i}}function jP(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function QP(t){return t.pipelineContext&&t.pipelineContext.large}var JP=function(t,e,r,i){for(;r<i;){var n=r+i>>>1;t[n][1]<e?r=n+1:i=n}return r},ww=function(t){W(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 Kf(r.value,i_[wD(eo(this._minLevelUnit))]||i_.second,i,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(r,i,n){var a=this.getSetting("useUTC"),o=this.getSetting("locale");return bD(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=oI(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]-=Er,i[1]+=Er),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]-Er}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=Gl.length,l=Math.min(JP(Gl,this._approxInterval,0,s),s-1);this._interval=Gl[l][1],this._minLevelUnit=Gl[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return Qt(r)?r:+ci(r)},e.prototype.contain=function(r){return sh(this.parse(r),this._extent)},e.prototype.normalize=function(r){return lh(this.parse(r),this._extent)},e.prototype.scale=function(r){return uh(r,this._extent)},e.type="time",e}(il),Gl=[["second",Rp],["minute",Pp],["hour",xs],["quarter-day",xs*6],["half-day",xs*12],["day",Er*1.2],["half-week",Er*3.5],["week",Er*7],["month",Er*31],["quarter",Er*95],["half-year",r_/2],["year",r_]];function tI(t,e,r,i){var n=ci(e),a=ci(r),o=function(d){return n_(n,d,i)===n_(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 eI(t,e){return t/=Er,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function rI(t){var e=30*Er;return t/=e,t>6?6:t>3?3:t>2?2:1}function iI(t){return t/=xs,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function v0(t,e){return t/=e?Pp:Rp,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function nI(t){return Bx(t,!0)}function aI(t,e,r){var i=new Date(t);switch(eo(e)){case"year":case"month":i[WT(r)](0);case"day":i[XT(r)](1);case"hour":i[YT(r)](0);case"minute":i[ZT(r)](0);case"second":i[$T(r)](0),i[qT(r)](0)}return i.getTime()}function oI(t,e,r,i){var n=1e4,a=VT,o=0;function s(C,E,D,L,P,N,I){for(var k=new Date(E),O=E,U=k[L]();O<D&&O<=i[1];)I.push({value:O}),U+=C,k[P](U),O=k.getTime();I.push({value:O,notAdd:!0})}function l(C,E,D){var L=[],P=!E.length;if(!tI(eo(C),i[0],i[1],r)){P&&(E=[{value:aI(new Date(i[0]),C,r)},{value:i[1]}]);for(var N=0;N<E.length-1;N++){var I=E[N].value,k=E[N+1].value;if(I!==k){var O=void 0,U=void 0,z=void 0,nt=!1;switch(C){case"year":O=Math.max(1,Math.round(e/Er/365)),U=Ip(r),z=AD(r);break;case"half-year":case"quarter":case"month":O=rI(e),U=ro(r),z=WT(r);break;case"week":case"half-week":case"day":O=eI(e),U=jf(r),z=XT(r),nt=!0;break;case"half-day":case"quarter-day":case"hour":O=iI(e),U=Ns(r),z=YT(r);break;case"minute":O=v0(e,!0),U=Qf(r),z=ZT(r);break;case"second":O=v0(e,!1),U=Jf(r),z=$T(r);break;case"millisecond":O=nI(e),U=th(r),z=qT(r);break}s(O,I,k,U,z,nt,L),C==="year"&&D.length>1&&N===0&&D.unshift({value:D[0].value-O})}}for(var N=0;N<L.length;N++)D.push(L[N]);return L}}for(var u=[],f=[],h=0,v=0,c=0;c<a.length&&o++<n;++c){var d=eo(a[c]);if(SD(a[c])){l(a[c],u[u.length-1]||[],f);var p=a[c+1]?eo(a[c+1]):null;if(d!==p){if(f.length){v=h,f.sort(function(C,E){return C.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=ce(j(u,function(C){return ce(C,function(E){return E.value>=i[0]&&E.value<=i[1]&&!E.notAdd})}),function(C){return C.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(C,E){return C.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}di.registerClass(ww);const sI=ww;var d0=di.prototype,bs=il.prototype,lI=re,uI=Math.floor,fI=Math.ceil,Wl=Math.pow,Br=Math.log,Qp=function(t){W(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="log",r.base=10,r._originalScale=new il,r._interval=0,r}return e.prototype.getTicks=function(r){var i=this._originalScale,n=this._extent,a=i.getExtent(),o=bs.getTicks.call(this,r);return j(o,function(s){var l=s.value,u=re(Wl(this.base,l));return u=l===n[0]&&this._fixMin?Xl(u,a[0]):u,u=l===n[1]&&this._fixMax?Xl(u,a[1]):u,{value:u}},this)},e.prototype.setExtent=function(r,i){var n=Br(this.base);r=Br(Math.max(0,r))/n,i=Br(Math.max(0,i))/n,bs.setExtent.call(this,r,i)},e.prototype.getExtent=function(){var r=this.base,i=d0.getExtent.call(this);i[0]=Wl(r,i[0]),i[1]=Wl(r,i[1]);var n=this._originalScale,a=n.getExtent();return this._fixMin&&(i[0]=Xl(i[0],a[0])),this._fixMax&&(i[1]=Xl(i[1],a[1])),i},e.prototype.unionExtent=function(r){this._originalScale.unionExtent(r);var i=this.base;r[0]=Br(r[0])/Br(i),r[1]=Br(r[1])/Br(i),d0.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=ME(n),o=r/n*a;for(o<=.5&&(a*=10);!isNaN(a)&&Math.abs(a)<1&&Math.abs(a)>0;)a*=10;var s=[re(fI(i[0]/a)*a),re(uI(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(r){bs.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=Br(r)/Br(this.base),sh(r,this._extent)},e.prototype.normalize=function(r){return r=Br(r)/Br(this.base),lh(r,this._extent)},e.prototype.scale=function(r){return r=uh(r,this._extent),Wl(this.base,r)},e.type="log",e}(di),bw=Qp.prototype;bw.getMinorTicks=bs.getMinorTicks;bw.getLabel=bs.getLabel;function Xl(t,e){return lI(t,Ti(e))}di.registerClass(Qp);const hI=Qp;var cI=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=this._modelMinRaw=r.get("min",!0);ft(a)?this._modelMinNum=Yl(e,a({min:i[0],max:i[1]})):a!=="dataMin"&&(this._modelMinNum=Yl(e,a));var o=this._modelMaxRaw=r.get("max",!0);if(ft(o)?this._modelMaxNum=Yl(e,o({min:i[0],max:i[1]})):o!=="dataMax"&&(this._modelMaxNum=Yl(e,o)),n)this._axisDataLen=r.getCategories().length;else{var s=r.get("boundaryGap"),l=Y(s)?s:[s||0,s||0];typeof l[0]=="boolean"||typeof l[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[Ci(l[0],1),Ci(l[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=ku(s)||ku(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[dI[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var i=vI[e];this[i]=r},t.prototype.freeze=function(){this.frozen=!0},t}(),vI={min:"_determinedMin",max:"_determinedMax"},dI={min:"_dataMin",max:"_dataMax"};function Aw(t,e,r){var i=t.rawExtentInfo;return i||(i=new cI(t,e,r),t.rawExtentInfo=i,i)}function Yl(t,e){return e==null?null:ku(e)?NaN:t.parse(e)}function Ew(t,e){var r=t.type,i=Aw(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=YP("bar",o),l=!1;if(M(s,function(h){l=l||h.getBaseAxis()===e.axis}),l){var u=$P(s),f=pI(n,a,e,u);n=f.min,a=f.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function pI(t,e,r,i){var n=r.axis.getExtent(),a=n[1]-n[0],o=KP(i,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;M(o,function(c){s=Math.min(c.offset,s)});var l=-1/0;M(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 vd(t,e){var r=e,i=Ew(t,r),n=i.extent,a=r.get("splitNumber");t instanceof hI&&(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 Cw(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new _w({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new sI({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(di.getClass(e)||il)}}function gI(t){var e=t.scale.getExtent(),r=e[0],i=e[1];return!(r>0&&i>0||r<0&&i<0)}function nl(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):ft(e)?function(i){return function(n,a){return r!=null&&(a=n.value-r),i(Jp(t,n),a,n.level!=null?{level:n.level}:null)}}(e):function(i){return t.scale.getLabel(i)}}function Jp(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function mI(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var i,n,a=r.getExtent();r instanceof _w?n=r.count():(i=r.getTicks(),n=i.length);var o=t.getLabelModel(),s=nl(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=_I(c,o.get("rotate")||0);l?l.union(d):l=d}return l}}function _I(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 It(t.x,t.y,a,o);return s}function tg(t){var e=t.get("interval");return e??"auto"}function Mw(t){return t.type==="category"&&tg(t.getLabelModel())===0}function Dw(t,e){var r={};return M(t.mapDimensionsAll(e),function(i){r[pw(t,i)]=!0}),_t(r)}function yI(t,e,r){e&&M(Dw(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 Lw=function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t}(),xI={isDimensionStacked:lo,enableDataStack:dw,getStackedDimension:pw};function TI(t,e){var r=e;e instanceof Te||(r=new Te(e));var i=Cw(r);return i.setExtent(t[0],t[1]),vd(i,r),i}function SI(t){Zr(t,Lw)}var p0=[],wI={registerPreprocessor:qp,registerProcessor:iw,registerPostInit:nw,registerPostUpdate:aw,registerUpdateLifecycle:Kp,registerAction:ha,registerCoordinateSystem:fP,registerLayout:cP,registerVisual:ca,registerTransform:dP,registerLoading:ow,registerMap:vP,registerImpl:WR,PRIORITY:iP,ComponentModel:Ht,ComponentView:cr,SeriesModel:so,ChartView:Ai,registerComponentModel:function(t){Ht.registerClass(t)},registerComponentView:function(t){cr.registerClass(t)},registerSeriesModel:function(t){so.registerClass(t)},registerChartView:function(t){Ai.registerClass(t)},registerSubTypeDefaulter:function(t,e){Ht.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){bE(t,e)}};function nr(t){if(Y(t)){M(t,function(e){nr(e)});return}Ct(p0,t)>=0||(p0.push(t),ft(t)&&(t={install:t}),t.install(wI))}var Us=Kt();function bI(t){return t.type==="category"?EI(t):MI(t)}function AI(t,e){return t.type==="category"?CI(t,e):{ticks:j(t.scale.getTicks(),function(r){return r.value})}}function EI(t){var e=t.getLabelModel(),r=Rw(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function Rw(t,e){var r=Pw(t,"labels"),i=tg(e),n=Iw(r,i);if(n)return n;var a,o;return ft(i)?a=Bw(t,i):(o=i==="auto"?DI(t):i,a=Ow(t,o)),Nw(r,i,{labels:a,labelCategoryInterval:o})}function CI(t,e){var r=Pw(t,"ticks"),i=tg(e),n=Iw(r,i);if(n)return n;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ft(i))a=Bw(t,i,!0);else if(i==="auto"){var s=Rw(t,t.getLabelModel());o=s.labelCategoryInterval,a=j(s.labels,function(l){return l.tickValue})}else o=i,a=Ow(t,o,!0);return Nw(r,i,{ticks:a,tickCategoryInterval:o})}function MI(t){var e=t.scale.getTicks(),r=nl(t);return{labels:j(e,function(i,n){return{level:i.level,formattedLabel:r(i,n),rawLabel:t.scale.getLabel(i),tickValue:i.value}})}}function Pw(t,e){return Us(t)[e]||(Us(t)[e]=[])}function Iw(t,e){for(var r=0;r<t.length;r++)if(t[r].key===e)return t[r].value}function Nw(t,e,r){return t.push({key:e,value:r}),r}function DI(t){var e=Us(t).autoInterval;return e??(Us(t).autoInterval=t.calculateCategoryInterval())}function LI(t){var e=RI(t),r=nl(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=np(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=Us(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 RI(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 Ow(t,e,r){var i=nl(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=Mw(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 Bw(t,e,r){var i=t.scale,n=nl(t),a=[];return M(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 g0=[0,1],eg=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(),m0(i,n.count())),ae(e,g0,i,r)},t.prototype.coordToData=function(e,r){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),m0(i,n.count()));var a=ae(e,i,g0,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=AI(this,r),n=i.ticks,a=j(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return PI(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=j(i,function(a){return j(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},t.prototype.getViewLabels=function(){return bI(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 LI(this)},t}();function m0(t,e){var r=t[1]-t[0],i=e,n=r/i/2;t[0]+=n,t[1]-=n}function PI(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;M(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=re(c),d=re(d),h?c>d:c<d}}var Ho=Math.PI*2,Mn=Mi.CMD,II=["top","right","bottom","left"];function NI(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 OI(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)%Ho<1e-4)return l[0]=f,l[1]=h,u-r;if(a){var v=i;i=Si(n),n=Si(v)}else i=Si(i),n=Si(n);i>n&&(n+=Ho);var c=Math.atan2(s,o);if(c<0&&(c+=Ho),c>=i&&c<=n||c+Ho>=i&&c+Ho<=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 dd(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 Fw(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 Vr=[];function BI(t,e,r){var i=Fw(e.x,e.y,e.width,e.height,t.x,t.y,Vr);return r.set(Vr[0],Vr[1]),i}function FI(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 Mn.M:a=f[c++],o=f[c++],i=a,n=o;break;case Mn.L:p=dd(i,n,f[c],f[c+1],h,v,Vr,!0),i=f[c++],n=f[c++];break;case Mn.C:p=vx(i,n,f[c++],f[c++],f[c++],f[c++],f[c],f[c+1],h,v,Vr),i=f[c++],n=f[c++];break;case Mn.Q:p=px(i,n,f[c++],f[c++],f[c],f[c+1],h,v,Vr),i=f[c++],n=f[c++];break;case Mn.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=OI(g,m,y,x,x+S,T,w,v,Vr),i=Math.cos(x+S)*_+g,n=Math.sin(x+S)*y+m;break;case Mn.R:a=i=f[c++],o=n=f[c++];var b=f[c++],A=f[c++];p=Fw(a,o,b,A,h,v,Vr);break;case Mn.Z:p=dd(i,n,a,o,h,v,Vr,!0),i=a,n=o;break}p<u&&(u=p,r.set(Vr[0],Vr[1]))}return u}var Zn=new St,Ae=new St,sr=new St,qa=new St,Vo=new St;function _0(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||II,s=i.getBoundingRect().clone();s.applyTransform(i.getComputedTransform());var l=1/0,u=n.anchor,f=t.getComputedTransform(),h=f&&Nf([],f),v=e.get("length2")||0;u&&sr.copy(u);for(var c=0;c<o.length;c++){var d=o[c];NI(d,0,s,Zn,qa),St.scaleAndAdd(Ae,Zn,qa,v),Ae.transform(h);var p=t.getBoundingRect(),g=u?u.distance(Ae):t instanceof Ut?FI(Ae,t.path,sr):BI(Ae,p,sr);g<l&&(l=g,Ae.transform(f),sr.transform(f),sr.toArray(a[0]),Ae.toArray(a[1]),Zn.toArray(a[2]))}kI(a,e.get("minTurnAngle")),r.setShape({points:a})}}}var y0=[],Dn=new St;function kI(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Zn.fromArray(t[0]),Ae.fromArray(t[1]),sr.fromArray(t[2]),St.sub(qa,Zn,Ae),St.sub(Vo,sr,Ae);var r=qa.len(),i=Vo.len();if(!(r<.001||i<.001)){qa.scale(1/r),Vo.scale(1/i);var n=qa.dot(Vo),a=Math.cos(e);if(a<n){var o=dd(Ae.x,Ae.y,sr.x,sr.y,Zn.x,Zn.y,y0,!1);Dn.fromArray(y0),Dn.scaleAndAdd(Vo,o/Math.tan(Math.PI-e));var s=sr.x!==Ae.x?(Dn.x-Ae.x)/(sr.x-Ae.x):(Dn.y-Ae.y)/(sr.y-Ae.y);if(isNaN(s))return;s<0?St.copy(Dn,Ae):s>1&&St.copy(Dn,sr),Dn.toArray(t[1])}}}}function x0(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 zI(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=Av(i[0],i[1]),a=Av(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=_h([],i[1],i[0],o/n),l=_h([],i[1],i[2],o/a),u=_h([],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 UI(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<Qu.length;l++){var u=Qu[l],f=e[u],h=u==="normal";if(f){var v=f.get("show"),c=h?s:gt(n.states[u]&&n.states[u].ignore,s);if(c||!gt(v,o)){var d=h?i:i&&i.states[u];d&&(d.ignore=!0);continue}i||(i=new Xf,t.setTextGuideLine(i),!h&&(s||!o)&&x0(i,!0,"normal",e.normal),t.stateProxy&&(i.stateProxy=t.stateProxy)),x0(i,!1,u,f)}}if(i){Mt(i.style,r),i.style.fill=null;var p=a.get("showAbove"),g=t.textGuideLineConfig=t.textGuideLineConfig||{};g.showAbove=p||!1,i.buildPath=zI}}function HI(t,e){e=e||"labelLine";for(var r={normal:t.getModel(e)},i=0;i<Lr.length;i++){var n=Lr[i];r[n]=t.getModel([n,e])}return r}function kw(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 rf(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 zw(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,C){if(b<0){var E=Math.min(A,-b);if(E>0){S(E*C,0,o);var D=E+b;D<0&&T(-D*C,1)}else T(-b*C,1)}}function S(b,A,C){b!==0&&(u=!0);for(var E=A;E<C;E++){var D=t[E],L=D.rect;L[e]+=b,D.label[e]+=b}}function T(b,A){for(var C=[],E=0,D=1;D<o;D++){var L=t[D-1].rect,P=Math.max(t[D].rect[e]-L[e]-L[r],0);C.push(P),E+=P}if(E){var N=Math.min(Math.abs(b)/E,A);if(b>0)for(var D=0;D<o-1;D++){var I=C[D]*N;S(I,0,D+1)}else for(var D=o-1;D>0;D--){var I=C[D-1]*N;S(-I,D,o)}}}function w(b){var A=b<0?-1:1;b=Math.abs(b);for(var C=Math.ceil(b/(o-1)),E=0;E<o-1;E++)if(A>0?S(C,0,E+1):S(-C,o-E-1,o),b-=C,b<=0)return}return u}function VI(t,e,r,i){return zw(t,"x","width",e,r,i)}function GI(t,e,r,i){return zw(t,"y","height",e,r,i)}function Uw(t){var e=[];t.sort(function(p,g){return g.priority-p.priority});var r=new It(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 rf(d.localRect,d.transform)),h||(h=new rf(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 WI(t){if(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].slice());return e}}function XI(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:WI(i&&i.shape.points)}}var T0=["align","verticalAlign","width","height","fontSize"],Fe=new Ff,Ec=Kt(),YI=Kt();function Zl(t,e,r){for(var i=0;i<r.length;i++){var n=r[i];e[n]!=null&&(t[n]=e[n])}}var $l=["x","y","rotation"],ZI=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();It.applyTransform(f,f,u),u?Fe.setLocalTransform(u):(Fe.x=Fe.y=Fe.rotation=Fe.originX=Fe.originY=0,Fe.scaleX=Fe.scaleY=1),Fe.rotation=Si(Fe.rotation);var h=n.__hostTarget,v;if(h){v=h.getBoundingRect().plain();var c=h.getComputedTransform();It.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:Fe.x,y:Fe.y,scaleX:Fe.scaleX,scaleY:Fe.scaleY,rotation:Fe.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");(ft(n)||_t(n).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=Ft(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(){_0(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;ft(o.layoutOption)?f=o.layoutOption(XI(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=ve(f.x,r),s.setStyle("x",0),v=!0):(s.x=u.x,s.setStyle("x",u.style.x)),f.y!=null?(s.y=ve(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=Ec(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<T0.length;p++){var g=T0[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=kw(this._labelList),a=ce(n,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=ce(n,function(l){return l.layoutOption.moveOverlap==="shiftY"});VI(a,0,r),GI(o,0,i);var s=ce(n,function(l){return l.layoutOption.hideOverlap});Uw(s)},t.prototype.processLabelsOverall=function(){var e=this;M(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=Ec(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,i),a&&e._animateLabels(o,i)})})},t.prototype._updateLabelLine=function(e,r){var i=e.getTextContent(),n=Ft(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");UI(e,HI(s),l),_0(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&&!to(e))){var a=Ec(i),o=a.oldLayout,s=Ft(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&&(Ct(v,"select")>=0&&i.attr(a.oldLayoutSelect),Ct(v,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),Rr(i,u,r,l)}else if(i.attr(u),!$f(i).valueAnimation){var h=gt(i.style.opacity,1);i.style.opacity=0,rn(i,{style:{opacity:h}},r,l)}if(a.oldLayout=u,i.states.select){var c=a.oldLayoutSelect={};Zl(c,u,$l),Zl(c,i.states.select,$l)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};Zl(d,u,$l),Zl(d,i.states.emphasis,$l)}oD(i,l,f,r,r)}if(n&&!n.ignore&&!n.invisible){var a=YI(n),o=a.oldLayout,p={points:n.shape.points};o?(n.attr({shape:o}),Rr(n,{shape:p},r)):(n.setShape(p),n.style.strokePercent=0,rn(n,{style:{strokePercent:1}},r)),a.oldLayout=p}},t}(),Cc=Kt();function $I(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,i){var n=Cc(r).labelManager;n||(n=Cc(r).labelManager=new ZI),n.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,i){var n=Cc(r).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),n.updateLayoutConfig(r),n.layout(r),n.processLabelsOverall()})}var Mc=null;function qI(t){return Mc||(Mc=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),Mc(t)}var Dc=null;function KI(t){Dc||(Dc=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),Dc(t)}function jI(t){var e=document.createElement("style");return e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),(document.querySelector("head")||document.body).appendChild(e),e}function ql(t,e){e===void 0&&(e={});var r=document.createElement(t);return Object.keys(e).forEach(function(i){r[i]=e[i]}),r}function Hw(t,e,r){var i=window.getComputedStyle(t,r||null)||{display:"none"};return i[e]}function pd(t){if(!document.documentElement.contains(t))return{detached:!0,rendered:!1};for(var e=t;e!==document;){if(Hw(e,"display")==="none")return{detached:!1,rendered:!1};e=e.parentNode}return{detached:!1,rendered:!0}}var QI='.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}',gd=0,Eu=null;function JI(t,e){t.__resize_mutation_handler__||(t.__resize_mutation_handler__=rN.bind(t));var r=t.__resize_listeners__;if(!r){if(t.__resize_listeners__=[],window.ResizeObserver){var i=t.offsetWidth,n=t.offsetHeight,a=new ResizeObserver(function(){!t.__resize_observer_triggered__&&(t.__resize_observer_triggered__=!0,t.offsetWidth===i&&t.offsetHeight===n)||_f(t)}),o=pd(t),s=o.detached,l=o.rendered;t.__resize_observer_triggered__=s===!1&&l===!1,t.__resize_observer__=a,a.observe(t)}else if(t.attachEvent&&t.addEventListener)t.__resize_legacy_resize_handler__=function(){_f(t)},t.attachEvent("onresize",t.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",t.__resize_mutation_handler__);else if(gd||(Eu=jI(QI)),iN(t),t.__resize_rendered__=pd(t).rendered,window.MutationObserver){var u=new MutationObserver(t.__resize_mutation_handler__);u.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),t.__resize_mutation_observer__=u}}t.__resize_listeners__.push(e),gd++}function tN(t,e){var r=t.__resize_listeners__;if(r){if(e&&r.splice(r.indexOf(e),1),!r.length||!e){if(t.detachEvent&&t.removeEventListener){t.detachEvent("onresize",t.__resize_legacy_resize_handler__),document.removeEventListener("DOMSubtreeModified",t.__resize_mutation_handler__);return}t.__resize_observer__?(t.__resize_observer__.unobserve(t),t.__resize_observer__.disconnect(),t.__resize_observer__=null):(t.__resize_mutation_observer__&&(t.__resize_mutation_observer__.disconnect(),t.__resize_mutation_observer__=null),t.removeEventListener("scroll",rg),t.removeChild(t.__resize_triggers__.triggers),t.__resize_triggers__=null),t.__resize_listeners__=null}!--gd&&Eu&&Eu.parentNode.removeChild(Eu)}}function eN(t){var e=t.__resize_last__,r=e.width,i=e.height,n=t.offsetWidth,a=t.offsetHeight;return n!==r||a!==i?{width:n,height:a}:null}function rN(){var t=pd(this),e=t.rendered,r=t.detached;e!==this.__resize_rendered__&&(!r&&this.__resize_triggers__&&(ig(this),this.addEventListener("scroll",rg,!0)),this.__resize_rendered__=e,_f(this))}function rg(){var t=this;ig(this),this.__resize_raf__&&KI(this.__resize_raf__),this.__resize_raf__=qI(function(){var e=eN(t);e&&(t.__resize_last__=e,_f(t))})}function _f(t){!t||!t.__resize_listeners__||t.__resize_listeners__.forEach(function(e){e.call(t,t)})}function iN(t){var e=Hw(t,"position");(!e||e==="static")&&(t.style.position="relative"),t.__resize_old_position__=e,t.__resize_last__={};var r=ql("div",{className:"resize-triggers"}),i=ql("div",{className:"resize-expand-trigger"}),n=ql("div"),a=ql("div",{className:"resize-contract-trigger"});i.appendChild(n),r.appendChild(i),r.appendChild(a),t.appendChild(r),t.__resize_triggers__={triggers:r,expand:i,expandChild:n,contract:a},ig(t),t.addEventListener("scroll",rg,!0),t.__resize_last__={width:t.offsetWidth,height:t.offsetHeight}}function ig(t){var e=t.__resize_triggers__,r=e.expand,i=e.expandChild,n=e.contract,a=n.scrollWidth,o=n.scrollHeight,s=r.offsetWidth,l=r.offsetHeight,u=r.scrollWidth,f=r.scrollHeight;n.scrollLeft=a,n.scrollTop=o,i.style.width=s+1+"px",i.style.height=l+1+"px",r.scrollLeft=u,r.scrollTop=f}var yi=function(){return yi=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},yi.apply(this,arguments)};var nN=["getWidth","getHeight","getDom","getOption","resize","dispatchAction","convertToPixel","convertFromPixel","containPixel","getDataURL","getConnectedDataURL","appendData","clear","isDisposed","dispose"];function aN(t){return e=Object.create(null),nN.forEach(function(r){e[r]=function(i){return function(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(!t.value)throw new Error("ECharts is not initialized yet.");return t.value[i].apply(t.value,n)}}(r)}),e;var e}var oN={autoresize:[Boolean,Object]},sN=/^on[^a-z]/,lN=function(t){return sN.test(t)};function Kl(t,e){var r=Fb(t);return r&&typeof r=="object"&&"value"in r?r.value||e:r||e}var uN="ecLoadingOptions",fN={loading:Boolean,loadingOptions:Object},Go=null,ng="x-vue-echarts",S0=[],Wo=[];(function(t,e){if(t&&typeof document<"u"){var r,i=e.prepend===!0?"prepend":"append",n=e.singleTag===!0,a=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(n){var o=S0.indexOf(a);o===-1&&(o=S0.push(a)-1,Wo[o]={}),r=Wo[o]&&Wo[o][i]?Wo[o][i]:Wo[o][i]=s()}else r=s();t.charCodeAt(0)===65279&&(t=t.substring(1)),r.styleSheet?r.styleSheet.cssText+=t:r.appendChild(document.createTextNode(t))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),e.attributes)for(var u=Object.keys(e.attributes),f=0;f<u.length;f++)l.setAttribute(u[f],e.attributes[u[f]]);var h=i==="prepend"?"afterbegin":"beforeend";return a.insertAdjacentElement(h,l),l}})(`x-vue-echarts,.echarts-inner{display:block;width:100%;height:100%;min-width:0}
`,{});var hN=function(){if(Go!=null)return Go;if(typeof HTMLElement>"u"||typeof customElements>"u")return Go=!1;try{new Function("tag",`class EChartsElement extends HTMLElement {
  __dispose = null;

  disconnectedCallback() {
    if (this.__dispose) {
      this.__dispose();
      this.__dispose = null;
    }
  }
}

if (customElements.get(tag) == null) {
  customElements.define(tag, EChartsElement);
}
`)(ng)}catch{return Go=!1}return Go=!0}();Tv&&Tv.config.ignoredElements.push(ng);var cN="ecTheme",vN="ecInitOptions",dN="ecUpdateOptions",Cz=Rb({name:"echarts",props:yi(yi({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},oN),fN),emits:{},inheritAttrs:!1,setup:function(t,e){var r=e.attrs,i=fl(),n=fl(),a=fl(),o=fl(),s=hl(cN,null),l=hl(vN,null),u=hl(dN,null),f=Pb(t),h=f.autoresize,v=f.manualUpdate,c=f.loading,d=f.loadingOptions,p=va(function(){return o.value||t.option||null}),g=va(function(){return t.theme||Kl(s,{})}),m=va(function(){return t.initOptions||Kl(l,{})}),_=va(function(){return t.updateOptions||Kl(u,{})}),y=va(function(){return function(A){var C={};for(var E in A)lN(E)||(C[E]=A[E]);return C}(r)}),x=Ib().proxy.$listeners;function S(A){if(n.value){var C=a.value=lP(n.value,g.value,m.value);t.group&&(C.group=t.group);var E=x;E||(E={},Object.keys(r).filter(function(L){return L.indexOf("on")===0&&L.length>2}).forEach(function(L){var P=L.charAt(2).toLowerCase()+L.slice(3);P.substring(P.length-4)==="Once"&&(P="~".concat(P.substring(0,P.length-4))),E[P]=r[L]})),Object.keys(E).forEach(function(L){var P=E[L];if(P){var N=L.toLowerCase();N.charAt(0)==="~"&&(N=N.substring(1),P.__once__=!0);var I=C;if(N.indexOf("zr:")===0&&(I=C.getZr(),N=N.substring(3)),P.__once__){delete P.__once__;var k=P;P=function(){for(var O=[],U=0;U<arguments.length;U++)O[U]=arguments[U];k.apply(void 0,O),I.off(N,P)}}I.on(N,P)}}),h.value?Bb(function(){C&&!C.isDisposed()&&C.resize(),D()}):D()}function D(){var L=A||p.value;L&&C.setOption(L,_.value)}}function T(){a.value&&(a.value.dispose(),a.value=void 0)}var w=null;cl(v,function(A){typeof w=="function"&&(w(),w=null),A||(w=cl(function(){return t.option},function(C,E){C&&(a.value?a.value.setOption(C,yi({notMerge:C!==E},_.value)):S())},{deep:!0}))},{immediate:!0}),cl([g,m],function(){T(),S()},{deep:!0}),Rg(function(){t.group&&a.value&&(a.value.group=t.group)});var b=aN(a);return function(A,C,E){var D=hl(uN,{}),L=va(function(){return yi(yi({},Kl(D,{})),E==null?void 0:E.value)});Rg(function(){var P=A.value;P&&(C.value?P.showLoading(L.value):P.hideLoading())})}(a,c,d),function(A,C,E){var D=null;cl([E,A,C],function(L,P,N){var I=L[0],k=L[1],O=L[2];if(I&&k&&O){var U=O===!0?{}:O,z=U.throttle,nt=z===void 0?100:z,$=U.onResize,J=function(){k.resize(),$==null||$()};D=nt?Gp(J,nt):J,JI(I,D)}N(function(){I&&D&&tN(I,D)})})}(a,h,n),Nb(function(){S()}),Ob(function(){hN&&i.value?i.value.__dispose=T:T()}),yi({chart:a,root:i,inner:n,setOption:function(A,C){t.manualUpdate&&(o.value=A),a.value?a.value.setOption(A,C||{}):S(A)},nonEventAttrs:y},b)},render:function(){var t=Tv?{attrs:this.nonEventAttrs}:yi({},this.nonEventAttrs);return t.ref="root",t.class=t.class?["echarts"].concat(t.class):"echarts",Pg(ng,t,[Pg("div",{ref:"inner",class:"echarts-inner"})])}}),pN=function(t){W(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 FP(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(r){var i=new oe,n=Xr("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=Xr(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}(so);const gN=pN;function Vw(t,e){var r=t.mapDimensionsAll("defaultedLabel"),i=r.length;if(i===1){var n=oo(t,e,r[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o<r.length;o++)a.push(oo(t,e,r[o]));return a.join(" ")}}function mN(t,e){var r=t.mapDimensionsAll("defaultedLabel");if(!Y(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 ag=function(t){W(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=Xr(r,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=_N,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(){Ju(this.childAt(0))},e.prototype.downplay=function(){tf(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):Rr(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,rn(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=Mp(_),g=y.getShallow("scale"),m=_.getShallow("cursor")}var x=r.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=kS(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 Pr){var b=s.style;s.useStyle(H({image:b.image,x:b.x,y:b.y,width:b.width,height:b.height},T))}else s.__isEmptyBrush?s.useStyle(H({},T)):s.useStyle(T),s.style.decal=null,s.setColor(w,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var A=r.getItemVisual(i,"liftZ"),C=this._z2;A!=null?C==null&&(this._z2=s.z2,s.z2+=A):C!=null&&(s.z2=C,this._z2=null);var E=o&&o.useNameLabel;Cp(s,p,{labelFetcher:l,labelDataIndex:i,defaultText:D,inheritColor:w,defaultOpacity:T.opacity});function D(N){return E?r.getName(N):Vw(r,N)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var L=s.ensureState("emphasis");L.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;L.scaleX=this._sizeX*P,L.scaleY=this._sizeY*P,this.setSymbolScale(1),Zv(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=Ft(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&nf(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();nf(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,i){return CR(r.getItemVisual(i,"symbolSize"))},e}(oe);function _N(t,e){this.parent.drift(t,e)}function Lc(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 w0(t){return t!=null&&!Q(t)&&(t={isIgnore:t}),t||{}}function b0(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:Mp(e),cursorStyle:e.get("cursor")}}var yN=function(){function t(e){this.group=new oe,this._SymbolCtor=e||ag}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=w0(r);var i=this.group,n=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=b0(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(Lc(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(!Lc(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):Rr(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=b0(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,i){this._progressiveEls=[],i=w0(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(Lc(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){Ep(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 Gw(t,e,r){var i=t.getBaseAxis(),n=t.getOtherAxis(i),a=xN(n,r),o=i.dim,s=n.dim,l=e.mapDimension(s),u=e.mapDimension(o),f=s==="x"||s==="radius"?1:0,h=j(t.dimensions,function(d){return e.mapDimension(d)}),v=!1,c=e.getCalculationInfo("stackResultDimension");return lo(e,h[0])&&(v=!0,h[0]=c),lo(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 xN(t,e){var r=0,i=t.scale.getExtent();return e==="start"?r=i[0]:e==="end"?r=i[1]:Qt(e)&&!isNaN(e)?r=e:i[0]>0?r=i[0]:i[1]<0&&(r=i[1]),r}function Ww(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 TN(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 SN(t,e,r,i,n,a,o,s){for(var l=TN(t,e),u=[],f=[],h=[],v=[],c=[],d=[],p=[],g=Gw(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],C=_[w],E=_[w+1];(isNaN(b)||isNaN(A))&&(b=C,A=E),u.push(b,A),f.push(C,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,L=g.dataDimsForPoint,P=n.dataToPoint([e.get(L[0],D),e.get(L[1],D)]);w=D*2,u.push(P[0],P[1]),f.push(_[w],_[w+1]);var N=Ww(g,n,e,D);h.push(N[0],N[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(Pt,pt){return p[Pt]-p[pt]});for(var I=u.length,k=$a(I),O=$a(I),U=$a(I),z=$a(I),nt=[],y=0;y<d.length;y++){var $=d[y],J=y*2,it=$*2;k[J]=u[it],k[J+1]=u[it+1],O[J]=f[it],O[J+1]=f[it+1],U[J]=h[it],U[J+1]=h[it+1],z[J]=v[it],z[J+1]=v[it+1],nt[y]=c[$]}return{current:k,next:O,stackedOnCurrent:U,stackedOnNext:z,status:nt}}var zi=Math.min,Ui=Math.max;function Jn(t,e){return isNaN(t)||isNaN(e)}function md(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(Jn(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(;Jn(T,w)&&b<i;)b++,S+=a,T=e[S*2],w=e[S*2+1];var A=.5,C=0,E=0,D=void 0,L=void 0;if(b>=i||Jn(T,w))c=m,d=_;else{C=T-u,E=w-f;var P=m-u,N=T-m,I=_-f,k=w-_,O=void 0,U=void 0;if(s==="x"){O=Math.abs(P),U=Math.abs(N);var z=C>0?1:-1;c=m-z*O*o,d=_,D=m+z*U*o,L=_}else if(s==="y"){O=Math.abs(I),U=Math.abs(k);var nt=E>0?1:-1;c=m,d=_-nt*O*o,D=m,L=_+nt*U*o}else O=Math.sqrt(P*P+I*I),U=Math.sqrt(N*N+k*k),A=U/(U+O),c=m-C*o*(1-A),d=_-E*o*(1-A),D=m+C*o*A,L=_+E*o*A,D=zi(D,Ui(T,m)),L=zi(L,Ui(w,_)),D=Ui(D,zi(T,m)),L=Ui(L,zi(w,_)),C=D-m,E=L-_,c=m-C*O/U,d=_-E*O/U,c=zi(c,Ui(u,m)),d=zi(d,Ui(f,_)),c=Ui(c,zi(u,m)),d=Ui(d,zi(f,_)),C=m-c,E=_-d,D=m+C*U/O,L=_+E*U/O}t.bezierCurveTo(h,v,c,d,m,_),h=D,v=L}else t.lineTo(m,_)}u=m,f=_,p+=a}return g}var Xw=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),wN=function(t){W(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 Xw},e.prototype.buildPath=function(r,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&Jn(n[o*2-2],n[o*2-1]);o--);for(;a<o&&Jn(n[a*2],n[a*2+1]);a++);}for(;a<o;)a+=md(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=Mi.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?Vu(s,c,p,m,r,f):Vu(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?ye(l,d,g,_,w):ye(s,c,p,m,w);return u?[r,x]:[x,r]}}s=m,l=_;break}}},e}(Ut),bN=function(t){W(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Xw),AN=function(t){W(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 bN},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&&Jn(n[s*2-2],n[s*2-1]);s--);for(;o<s&&Jn(n[o*2],n[o*2+1]);o++);}for(;o<s;){var u=md(r,n,o,s,s,1,i.smooth,l,i.connectNulls);md(r,a,o+u-1,u,s,-1,i.stackedOnSmooth,l,i.connectNulls),o+=u+1,r.closePath()}},e}(Ut);function EN(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,o=Math.floor(o),l=Math.round(l);var h=new ie({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=ft(n)?function(g){n(g,h)}:null;rn(h,{shape:{width:l,height:u,x:o,y:s}},r,null,i,p)}return h}function CN(t,e,r){var i=t.getArea(),n=re(i.r0,1),a=re(i.r,1),o=new _p({shape:{cx:re(t.cx,1),cy:re(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,rn(o,{shape:{endAngle:i.endAngle,r:a}},r)}return o}function MN(t,e){return t.type===e}function A0(t,e){if(t.length===e.length){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return;return!0}}function E0(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 C0(t,e){var r=E0(t),i=r[0],n=r[1],a=E0(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 M0(t){return Qt(t)?t:t?.5:0}function DN(t,e,r){if(!r.valueDim)return[];for(var i=e.count(),n=$a(i*2),a=0;a<i;a++){var o=Ww(r,t,e,a);n[a*2]=o[0],n[a*2+1]=o[1]}return n}function Hi(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 LN(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=WA(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 RN(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=j(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=LN(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";M(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 xp(0,0,0,0,v,!0);return _[n]=p,_[n+"2"]=g,_}}}function PN(t,e,r){var i=t.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(n&&IN(a,e))){var o=e.mapDimension(a.dim),s={};return M(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function IN(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(ag.getSymbolSize(e,o)[t.isHorizontal()?1:0]*1.5>i)return!1;return!0}function NN(t,e){return isNaN(t)||isNaN(e)}function ON(t){for(var e=t.length/2;e>0&&NN(t[e*2-2],t[e*2-1]);e--);return e-1}function D0(t,e){return[t[e*2],t[e*2+1]]}function BN(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 Yw(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<Lr.length;e++)if(t.get([Lr[e],"endLabel","show"]))return!0;return!1}function Rc(t,e,r,i){if(MN(e,"cartesian2d")){var n=i.getModel("endLabel"),a=n.get("valueAnimation"),o=i.getData(),s={lastFrameIndex:0},l=Yw(i)?function(c,d){t._endLabelOnDuring(c,d,o,s,a,n,e)}:null,u=e.getBaseAxis().isHorizontal(),f=EN(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 CN(e,r,i)}function FN(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 kN=function(t){W(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(){var r=new oe,i=new yN;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.isAnimationEnabled(),y=!f.isEmpty(),x=f.get("origin"),S=Gw(o,l,x),T=y&&DN(o,l,S),w=r.get("showSymbol"),b=r.get("connectNulls"),A=w&&!v&&PN(r,l,o),C=this._data;C&&C.eachItemGraphicEl(function(pt,Bt){pt.__temp&&(s.remove(pt),C.setItemGraphicEl(Bt,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 L=RN(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=Hi(h,o,E,b),T&&(T=Hi(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,aa(L)),m.setClipPath(Rc(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,aa(L));var P=m.getClipPath();if(P){var N=Rc(this,o,!1,r);rn(P,{shape:N.shape},r)}else m.setClipPath(Rc(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]]}}),(!A0(this._stackedOnPoints,T)||!A0(this._points,h))&&(_?this._doUpdateAnimation(l,T,o,n,E,x,b):(E&&(h=Hi(h,o,E,b),T&&(T=Hi(T,o,E,b))),p.setShape({points:h}),g&&g.setShape({points:h,stackedOnPoints:T})))}var I=r.getModel("emphasis"),k=I.get("focus"),O=I.get("blurScope"),U=I.get("disabled");if(p.useStyle(Mt(u.getLineStyle(),{fill:"none",stroke:L,lineJoin:"bevel"})),Um(p,r,"lineStyle"),p.style.lineWidth>0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var z=p.getState("emphasis").style;z.lineWidth=+p.style.lineWidth+1}Ft(p).seriesIndex=r.seriesIndex,Zv(p,k,O,U);var nt=M0(r.get("smooth")),$=r.get("smoothMonotone");if(p.setShape({smooth:nt,smoothMonotone:$,connectNulls:b}),g){var J=l.getCalculationInfo("stackedOnSeries"),it=0;g.useStyle(Mt(f.getAreaStyle(),{fill:L,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),J&&(it=M0(J.get("smooth"))),g.setShape({smooth:nt,stackedOnSmooth:it,smoothMonotone:$,connectNulls:b}),Um(g,r,"areaStyle"),Ft(g).seriesIndex=r.seriesIndex,Zv(g,k,O,U)}var Pt=function(pt){a._changePolyState(pt)};l.eachItemGraphicEl(function(pt){pt&&(pt.onHoverStateChange=Pt)}),this._polyline.onHoverStateChange=Pt,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){Ft(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=ia(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 ag(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 Ai.prototype.highlight.call(this,r,i,n,a)},e.prototype.downplay=function(r,i,n,a){var o=r.getData(),s=ia(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 Ai.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 wN({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 AN({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");ft(f)&&(f=f(null));var h=u.get("animationDelay")||0,v=ft(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=ft(h)?h(d):f*w+v,A=p.getSymbolPath(),C=A.getTextContent();p.attr({scaleX:0,scaleY:0}),p.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:b}),C&&C.animateFrom({style:{opacity:0}},{duration:300,delay:b}),A.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,i,n){var a=r.getModel("endLabel");if(Yw(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 Jt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var f=ON(l);f>=0&&(Cp(s,Mp(r,"endLabel"),{inheritColor:n,labelFetcher:r,labelDataIndex:f,defaultText:function(h,v,c){return c!=null?mN(o,c):Vw(o,h)},enableTextSetter:!0},FN(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=BN(h,x,w),A=b.range,C=A[1]-A[0],E=void 0;if(C>=1){if(C>1&&!c){var D=D0(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 L=v.getRawValue(A[0]),P=v.getRawValue(A[1]);o&&(E=Gx(n,d,L,P,b.t))}a.lastFrameIndex=A[0]}else{var N=r===1||a.lastFrameIndex>0?A[0]:0,D=D0(h,N);o&&(E=v.getRawValue(N)),u.attr({x:D[0]+S,y:D[1]+T})}if(o){var I=$f(u);typeof I.setLabelText=="function"&&I.setLabelText(E)}}},e.prototype._doUpdateAnimation=function(r,i,n,a,o,s,l){var u=this._polyline,f=this._polygon,h=r.hostModel,v=SN(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=Hi(v.current,n,o,l),d=Hi(v.stackedOnCurrent,n,o,l),p=Hi(v.next,n,o,l),g=Hi(v.stackedOnNext,n,o,l)),C0(c,p)>3e3||f&&C0(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(),Rr(u,m,h),f&&(f.setShape({points:c,stackedOnPoints:d}),f.stopAnimation(),Rr(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,C=_[b].ptIdx*2;A.x=w[C],A.y=w[C+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}(Ai);const zN=kN;function UN(t,e){return{seriesType:t,plan:CS(),reset:function(r){var i=r.getData(),n=r.coordinateSystem,a=r.pipelineContext,o=e||a.large;if(n){var s=j(n.dimensions,function(c){return i.mapDimension(c)}).slice(0,2),l=s.length,u=i.getCalculationInfo("stackResultDimension");lo(i,s[0])&&(s[0]=u),lo(i,s[1])&&(s[1]=u);var f=i.getStore(),h=i.getDimensionIndex(s[0]),v=i.getDimensionIndex(s[1]);return l&&{progress:function(c,d){for(var p=c.end-c.start,g=o&&$a(p*l),m=[],_=[],y=c.start,x=0;y<c.end;y++){var S=void 0;if(l===1){var T=f.get(h,y);S=n.dataToPoint(T,null,_)}else m[0]=f.get(h,y),m[1]=f.get(v,y),S=n.dataToPoint(m,null,_);o?(g[x++]=S[0],g[x++]=S[1]):d.setItemLayout(y,S.slice())}o&&d.setLayout("points",g)}}}}}}var HN={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},nearest:function(t){return t[0]}},VN=function(t){return Math.round(t.length/2)};function GN(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=HN[a]:ft(a)&&(d=a),d&&e.setData(n.downSample(n.mapDimension(u.dim),1/c,d,VN))}}}}}function WN(t){t.registerChartView(zN),t.registerSeriesModel(gN),t.registerLayout(UN("line",!0)),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,GN("line"))}var XN=function(t){W(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}(Ht);const YN=XN;var _d=function(t){W(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",tr).models[0]},e.type="cartesian2dAxis",e}(Ht);Zr(_d,Lw);var Zw={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)"]}}},ZN=vt({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Zw),og=vt({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}}},Zw),$N=vt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},og),qN=Mt({logBase:10},og);const KN={category:ZN,value:og,time:$N,log:qN};var jN={value:1,category:1,time:1,log:1};function L0(t,e,r,i){M(jN,function(n,a){var o=vt(vt({},KN[a],!0),i,!0),s=function(l){W(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=Os(this),c=v?rl(f):{},d=h.getTheme();vt(f,d.get(a+"Axis")),vt(f,this.getDefaultOption()),f.type=R0(f),v&&oa(f,c,v)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=mf.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",R0)}function R0(t){return t.type||(t.data?"category":"value")}var sg=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 j(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),ce(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}(),yd=["x","y"];function P0(t){return t.type==="interval"||t.type==="time"}var QN=function(t){W(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=yd,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!P0(r)||!P0(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=Nf([],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 It(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 Mr(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 Mr(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(){var r=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),n=Math.min(r[0],r[1]),a=Math.min(i[0],i[1]),o=Math.max(r[0],r[1])-n,s=Math.max(i[0],i[1])-a;return new It(n,a,o,s)},e}(sg),JN=function(t){W(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}(eg);const tO=JN;function xd(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),ao(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 I0(t){return t.get("coordinateSystem")==="cartesian2d"}function N0(t){var e={xAxisModel:null,yAxisModel:null};return M(e,function(r,i){var n=i.replace(/Model$/,""),a=t.getReferringComponents(n,tr).models[0];e[i]=a}),e}var Pc=Math.log;function eO(t,e,r){var i=il.prototype,n=i.getTicks.call(r),a=i.getTicks.call(r,!0),o=n.length-1,s=i.getInterval.call(r),l=Ew(t,e),u=l.extent,f=l.fixMin,h=l.fixMax;if(t.type==="log"){var v=Pc(t.base);u=[Pc(u[0])/v,Pc(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=Ac(d),g=u[0]+d*o;else if(h)for(p=u[1]-d*o;p>u[0]&&isFinite(p)&&isFinite(u[0]);)d=Ac(d),p=u[1]-d*o;else{var m=t.getTicks().length-1;m>o&&(d=Ac(d));var _=d*o;g=Math.ceil(u[1]/d)*d,p=re(g-_),p<0&&u[0]>=0?(p=0,g=re(_)):g>0&&u[1]<=0&&(g=0,p=-re(_))}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 rO=function(){function t(e,r,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=yd,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=_t(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;cd(p)&&d.get("alignTicks")&&d.get("interval")==null?f.push(c):(vd(p,d),cd(p)&&(s=c))}f.length&&(s||(s=f.pop(),vd(s.scale,s.model)),M(f,function(g){eO(g.scale,g.model,s.scale)}))}}n(i.x),n(i.y);var a={};M(i.x,function(o){O0(i,"y",o,a)}),M(i.y,function(o){O0(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=nn(n,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(M(s,function(u){if(!u.model.get(["axisLabel","inside"])){var f=mI(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()),M(this._coordsList,function(u){u.calcAffineTransform()});function l(){M(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]),iO(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]}Q(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",tr).models[0],n=e.yAxisModel||r&&r.getReferringComponents("yAxis",tr).models[0],a=e.gridModel,o=this._coordsList,s,l;if(r)s=r.coordinateSystem,Ct(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,M(s.x,function(f,h){M(s.y,function(v,c){var d="x"+h+"y"+c,p=new QN(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(Ic(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 tO(f,Cw(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){M(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(I0(n)){var a=N0(n),o=a.xAxisModel,s=a.yAxisModel;if(!Ic(o,r)||!Ic(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){M(Dw(n,a.dim),function(o){a.scale.unionExtentFromData(n,o)})}},t.prototype.getTooltipAxes=function(e){var r=[],i=[];return M(this.getCartesians(),function(n){var a=e!=null&&e!=="auto"?n.getAxis(e):n.getBaseAxis(),o=n.getOtherAxis(a);Ct(r,a)<0&&r.push(a),Ct(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(I0(n)){var a=N0(n),o=a.xAxisModel,s=a.yAxisModel,l=o.getCoordSysModel(),u=l.coordinateSystem;n.coordinateSystem=u.getCartesian(o.componentIndex,s.componentIndex)}}),i},t.dimensions=yd,t}();function Ic(t,e){return t.getCoordSysModel()===e}function O0(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)B0(n[l])&&(a=n[l]);else for(var u in n)if(n.hasOwnProperty(u)&&B0(n[u])&&!i[f(n[u])]){a=n[u];break}a&&(i[f(a)]=!0);function f(h){return h.dim+"_"+h.index}}function B0(t){return t&&t.type!=="category"&&t.type!=="time"&&gI(t)}function iO(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}}const nO=rO;var qi=Math.PI,ta=function(){function t(e,r){this.group=new oe,this.opt=r,this.axisModel=e,Mt(r,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var i=new oe({x:r.position[0],y:r.position[1],rotation:r.rotation});i.updateTransform(),this._transformGroup=i}return t.prototype.hasBuilder=function(e){return!!F0[e]},t.prototype.add=function(e){F0[e](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(e,r,i){var n=Ox(r-e),a,o;return $u(n)?(o=i>0?"top":"bottom",a="center"):$u(n-qi)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n<qi?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}(),F0={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&&(Mr(s,s,o),Mr(l,l,o));var f=H({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new na({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:f,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});Ps(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)||Qt(c))&&(c=[c,c]);var d=kS(e.get(["axisLine","symbolOffset"])||0,c),p=c[0],g=c[1];M([{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=Xr(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=sO(r,i,e,t),a=uO(r,i,e,t);if(oO(e,a,n),lO(r,i,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=kw(j(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));Uw(o)}},axisName:function(t,e,r,i){var n=ao(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,z0(a)?t.labelOffset+o*l:0],v,c=e.get("nameRotate");c!=null&&(c=c*qi/180);var d;z0(a)?v=ta.innerTextLayout(t.rotation,c??t.rotation,o):(v=aO(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,_=ao(t.nameTruncateMaxWidth,g.maxWidth,d),y=new Jt({x:h[0],y:h[1],rotation:v.rotation,silent:ta.isLabelSilent(e),style:er(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(Yf({el:y,componentModel:e,itemName:n}),y.__fullText=n,y.anid="name",e.get("triggerEvent")){var x=ta.makeAxisEventDataBase(e);x.targetType="axisName",x.name=n,Ft(y).eventData=x}i.add(y),y.updateTransform(),r.add(y),y.decomposeTransform()}}};function aO(t,e,r,i){var n=Ox(r-t),a,o,s=i[0]>i[1],l=e==="start"&&!s||e!=="start"&&s;return $u(n-qi/2)?(o=l?"bottom":"top",a="center"):$u(n-qi*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",n<qi*1.5&&n>qi/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function oO(t,e,r){if(!Mw(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?(pr(a),pr(u)):k0(a,o)&&(i?(pr(o),pr(f)):(pr(a),pr(u))),n===!1?(pr(s),pr(h)):k0(l,s)&&(n?(pr(l),pr(v)):(pr(s),pr(h)))}}function pr(t){t&&(t.ignore=!0)}function k0(t,e){var r=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(!(!r||!i)){var n=tp([]);return ep(n,n,-t.rotation),r.applyTransform(Qa([],n,t.getLocalTransform())),i.applyTransform(Qa([],n,e.getLocalTransform())),r.intersect(i)}}function z0(t){return t==="middle"||t==="center"}function $w(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&&(Mr(o,o,e),Mr(s,s,e));var f=new na({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});Ps(f.shape,f.style.lineWidth),f.anid=n+"_"+t[l].tickValue,a.push(f)}return a}function sO(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=$w(u,e.transform,l,Mt(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;h<f.length;h++)t.add(f[h]);return f}}function lO(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=Mt(s.getLineStyle(),Mt(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),f=0;f<o.length;f++)for(var h=$w(o[f],e.transform,l,u,"minorticks_"+f),v=0;v<h.length;v++)t.add(h[v])}}function uO(t,e,r,i){var n=r.axis,a=ao(i.axisLabelShow,r.get(["axisLabel","show"]));if(!(!a||n.scale.isBlank())){var o=r.getModel("axisLabel"),s=o.get("margin"),l=n.getViewLabels(),u=(ao(i.labelRotate,o.get("rotate"))||0)*qi/180,f=ta.innerTextLayout(i.rotation,u,i.labelDirection),h=r.getCategories&&r.getCategories(!0),v=[],c=ta.isLabelSilent(r),d=r.get("triggerEvent");return M(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];Q(S)&&S.textStyle&&(x=new Te(S.textStyle,o,r.ecModel))}var T=x.getTextColor()||r.get(["axisLine","lineStyle","color"]),w=n.dataToCoord(m),b=new Jt({x:w,y:i.labelOffset+i.labelDirection*s,rotation:f.rotation,silent:c,z2:10+(p.level||0),style:er(x,{text:_,align:x.getShallow("align",!0)||f.textAlign,verticalAlign:x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||f.textVerticalAlign,fill:ft(T)?T(n.type==="category"?y:n.type==="value"?m+"":m,g):T})});if(b.anid="label_"+m,d){var A=ta.makeAxisEventDataBase(r);A.targetType="axisLabel",A.value=y,A.tickIndex=g,n.type==="category"&&(A.dataIndex=m),Ft(b).eventData=A}e.add(b),b.updateTransform(),v.push(b),t.add(b),b.decomposeTransform()}),v}}const qw=ta;function fO(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return hO(r,t,e),r.seriesInvolved&&vO(r,t),r}function hO(t,e,r){var i=e.getComponent("tooltip"),n=e.getComponent("axisPointer"),a=n.get("link",!0)||[],o=[];M(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Hs(s.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var f=s.model,h=f.getModel("tooltip",i);if(M(s.getAxes(),de(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)&&M(d.baseAxes,de(p,c?"cross":!0,v)),c&&M(d.otherAxes,de(p,"cross",!1))}function p(g,m,_){var y=_.model.getModel("axisPointer",n),x=y.get("show");if(!(!x||x==="auto"&&!g&&!Td(y))){m==null&&(m=y.get("triggerTooltip")),y=g?cO(_,h,n,e,g,m):y;var S=y.get("snap"),T=y.get("triggerEmphasis"),w=Hs(_.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:Td(y),seriesModels:[],linkGroup:null};u[w]=A,t.seriesInvolved=t.seriesInvolved||b;var C=dO(a,_);if(C!=null){var E=o[C]||(o[C]={axesInfo:{}});E.axesInfo[w]=A,E.mapper=a[C].mapper,A.linkGroup=E}}}})}function cO(t,e,r,i,n,a){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};M(s,function(v){l[v]=lt(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&&Mt(u,h.textStyle)}}return t.model.getModel("axisPointer",new Te(l,r,i))}function vO(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||M(t.coordSysAxesInfo[Hs(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 dO(t,e){for(var r=e.model,i=e.dim,n=0;n<t.length;n++){var a=t[n]||{};if(Nc(a[i+"AxisId"],r.id)||Nc(a[i+"AxisIndex"],r.componentIndex)||Nc(a[i+"AxisName"],r.name))return n}}function Nc(t,e){return t==="all"||Y(t)&&Ct(t,e)>=0||t===e}function pO(t){var e=lg(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=Td(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 lg(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[Hs(t)]}function gO(t){var e=lg(t);return e&&e.axisPointerModel}function Td(t){return!!t.get(["handle","show"])}function Hs(t){return t.type+"||"+t.id}var U0={},Kw=function(t){W(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&&pO(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=gO(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){U0[r]=i},e.getAxisPointerClass=function(r){return r&&U0[r]},e.type="axis",e}(cr),Sd=Kt();function mO(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=Sd(t).splitAreaColors,v=ut(),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=Y(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 ie({anid:w!=null?"area_"+w:null,shape:{x:y,y:x,width:S,height:T},style:Mt({fill:s[c]},m),autoBatch:!0,silent:!0})),c=(c+1)%f}Sd(t).splitAreaColors=v}}}function _O(t){Sd(t).splitAreaColors=null}var yO=["axisLine","axisTickLabel","axisName"],xO=["splitArea","splitLine","minorSplitLine"],jw=function(t){W(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 oe,this.group.add(this._axisGroup),!!r.get("show")){var s=r.getCoordSysModel(),l=xd(s,r),u=new qw(r,H({handleAutoShown:function(h){for(var v=s.coordinateSystem.getCartesians(),c=0;c<v.length;c++)if(cd(v[c].getOtherAxis(r.axis).scale))return!0;return!1}},l));M(yO,u.add,u),this._axisGroup.add(u.getGroup()),M(xO,function(h){r.get([h,"show"])&&TO[h](this,this._axisGroup,r,s)},this);var f=a&&a.type==="changeAxisOrder"&&a.isInitSort;f||OT(o,this._axisGroup,r),t.prototype.render.call(this,r,i,n,a)}},e.prototype.remove=function(){_O(this)},e.type="cartesianAxis",e}(Kw),TO={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=Y(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 na({anid:_!=null?"line_"+h[p].tickValue:null,autoBatch:!0,shape:{x1:v[0],y1:v[1],x2:c[0],y2:c[1]},style:Mt({stroke:s[m]},d),silent:!0});Ps(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 na({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});Ps(g.shape,v.lineWidth),e.add(g)}},splitArea:function(t,e,r,i){mO(t,e,r,i)}},Qw=function(t){W(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="xAxis",e}(jw),SO=function(t){W(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Qw.type,r}return e.type="yAxis",e}(jw),wO=function(t){W(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 ie({shape:r.coordinateSystem.getRect(),style:Mt({fill:r.get("backgroundColor")},r.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(cr),H0={offset:0};function bO(t){t.registerComponentView(wO),t.registerComponentModel(YN),t.registerCoordinateSystem("cartesian2d",nO),L0(t,"x",_d,H0),L0(t,"y",_d,H0),t.registerComponentView(Qw),t.registerComponentView(SO),t.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var V0="\0_ec_interaction_mutex";function G0(t,e){return!!AO(t)[e]}function AO(t){return t[V0]||(t[V0]={})}ha({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Me);var EO=function(t){W(e,t);function e(r){var i=t.call(this)||this;i._zr=r;var n=rt(i._mousedownHandler,i),a=rt(i._mousemoveHandler,i),o=rt(i._mouseupHandler,i),s=rt(i._mousewheelHandler,i),l=rt(i._pinchHandler,i);return i.enable=function(u,f){this.disable(),this._opt=Mt(lt(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(!zg(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||!Cu("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||G0(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&&Ei(r.event),Jw(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:a,oldY:o,newX:i,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){zg(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var i=Cu("zoomOnMouseWheel",r,this._opt),n=Cu("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;Oc(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);Oc(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:v,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!G0(this._zr,"globalPan")){var i=r.pinchScale>1?1.1:1/1.1;Oc(this,"zoom",null,r,{scale:i,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e}($r);function Oc(t,e,r,i,n){t.pointerChecker&&t.pointerChecker(i,n.originX,n.originY)&&(Ei(i.event),Jw(t,e,r,i,n))}function Jw(t,e,r,i,n){n.isAvailableBehavior=rt(Cu,null,r,i),t.trigger(e,n)}function Cu(t,e,r){var i=r[t];return!t||i&&(!q(i)||e.event[i+"Key"])}const CO=EO;var Vs=M,MO=Q,yf=-1,Ne=function(){function t(e){var r=e.mappingMethod,i=e.type,n=this.option=lt(e);this.type=i,this.mappingMethod=r,this._normalizeData=RO[r];var a=t.visualHandlers[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(Bc(n),DO(n)):r==="category"?n.categories?LO(n):Bc(n,!0):(Dr(r!=="linear"||n.dataExtent),Bc(n))}return t.prototype.mapValueToVisual=function(e){var r=this._normalizeData(e);return this._normalizedToVisual(r,e)},t.prototype.getNormalizer=function(){return rt(this._normalizeData,this)},t.listVisualTypes=function(){return _t(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(e,r,i){Q(e)?M(e,r,i):r.call(i,e)},t.mapVisual=function(e,r,i){var n,a=Y(e)?[]:Q(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&&Vs(t.visualHandlers,function(n,a){e.hasOwnProperty(a)&&(r[a]=e[a],i=!0)}),i?r:null},t.prepareVisualTypes=function(e){if(Y(e))e=e.slice();else if(MO(e)){var r=[];Vs(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(Ql(h[1],e,f[1]))return o}else if(f[1]===1/0){if(Ql(h[0],f[0],e))return o}else if(Ql(h[0],f[0],e)&&Ql(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:Xo("color"),getColorMapper:function(){var e=this.option;return rt(e.mappingMethod==="category"?function(r,i){return!i&&(r=this._normalizeData(r)),ls.call(this,r)}:function(r,i,n){var a=!!n;return!i&&(r=this._normalizeData(r)),n=Mh(r,e.parsedVisual,n),a?n:bi(n,"rgba")},this)},_normalizedToVisual:{linear:function(e){return bi(Mh(e,this.option.parsedVisual),"rgba")},category:ls,piecewise:function(e,r){var i=bd.call(this,r);return i==null&&(i=bi(Mh(e,this.option.parsedVisual),"rgba")),i},fixed:zn}},colorHue:jl(function(e,r){return Dh(e,r)}),colorSaturation:jl(function(e,r){return Dh(e,null,r)}),colorLightness:jl(function(e,r){return Dh(e,null,null,r)}),colorAlpha:jl(function(e,r){return XA(e,r)}),decal:{applyVisual:Xo("decal"),_normalizedToVisual:{linear:null,category:ls,piecewise:null,fixed:null}},opacity:{applyVisual:Xo("opacity"),_normalizedToVisual:wd([0,1])},liftZ:{applyVisual:Xo("liftZ"),_normalizedToVisual:{linear:zn,category:zn,piecewise:zn,fixed:zn}},symbol:{applyVisual:function(e,r,i){var n=this.mapValueToVisual(e);i("symbol",n)},_normalizedToVisual:{linear:W0,category:ls,piecewise:function(e,r){var i=bd.call(this,r);return i==null&&(i=W0.call(this,e)),i},fixed:zn}},symbolSize:{applyVisual:Xo("symbolSize"),_normalizedToVisual:wd([0,1])}},t}();function DO(t){var e=t.pieceList;t.hasSpecialVisual=!1,M(e,function(r,i){r.originIndex=i,r.visual!=null&&(t.hasSpecialVisual=!0)})}function LO(t){var e=t.categories,r=t.categoryMap={},i=t.visual;if(Vs(e,function(o,s){r[o]=s}),!Y(i)){var n=[];Q(i)?Vs(i,function(o,s){var l=r[s];n[l??yf]=o}):n[yf]=i,i=t2(t,n)}for(var a=e.length-1;a>=0;a--)i[a]==null&&(delete r[e[a]],e.pop())}function Bc(t,e){var r=t.visual,i=[];Q(r)?Vs(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]),t2(t,i)}function jl(t){return{applyVisual:function(e,r,i){var n=this.mapValueToVisual(e);i("color",t(r("color"),n))},_normalizedToVisual:wd([0,1])}}function W0(t){var e=this.option.visual;return e[Math.round(ae(t,[0,1],[0,e.length-1],!0))]||{}}function Xo(t){return function(e,r,i){i(t,this.mapValueToVisual(e))}}function ls(t){var e=this.option.visual;return e[this.option.loop&&t!==yf?t%e.length:t]}function zn(){return this.option.visual[0]}function wd(t){return{linear:function(e){return ae(e,t,this.option.visual,!0)},category:ls,piecewise:function(e,r){var i=bd.call(this,r);return i==null&&(i=ae(e,t,this.option.visual,!0)),i},fixed:zn}}function bd(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var i=Ne.findPieceIndex(t,r),n=r[i];if(n&&n.visual)return n.visual[this.type]}}function t2(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=j(e,function(r){var i=Xe(r);return i||[0,0,0,1]})),e}var RO={linear:function(t){return ae(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=Ne.findPieceIndex(t,e,!0);if(r!=null)return ae(r,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return e??yf},fixed:Me};function Ql(t,e,r){return t?e<=r:e<r}function al(t,e,r,i,n,a){t=t||0;var o=r[1]-r[0];if(n!=null&&(n=Ca(n,[0,o])),a!=null&&(a=Math.max(a,n??0)),i==="all"){var s=Math.abs(e[1]-e[0]);s=Ca(s,[0,o]),n=a=Ca(s,[n,a]),i=0}e[0]=Ca(e[0],r),e[1]=Ca(e[1],r);var l=Fc(e,i);e[i]+=t;var u=n||0,f=r.slice();l.sign<0?f[0]+=u:f[1]-=u,e[i]=Ca(e[i],f);var h;return h=Fc(e,i),n!=null&&(h.sign!==l.sign||h.span<n)&&(e[1-i]=e[i]+l.sign*n),h=Fc(e,i),a!=null&&h.span>a&&(e[1-i]=e[i]+h.sign*a),e}function Fc(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 Ca(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}function PO(t,e,r,i){return t&&(t.legacy||t.legacy!==!1&&!r&&!i&&e!=="tspan"&&(e==="text"||mt(t,"text")))}function IO(t,e,r){var i=t,n,a,o;if(e==="text")o=i;else{o={},mt(i,"text")&&(o.text=i.text),mt(i,"rich")&&(o.rich=i.rich),mt(i,"textFill")&&(o.fill=i.textFill),mt(i,"textStroke")&&(o.stroke=i.textStroke),mt(i,"fontFamily")&&(o.fontFamily=i.fontFamily),mt(i,"fontSize")&&(o.fontSize=i.fontSize),mt(i,"fontStyle")&&(o.fontStyle=i.fontStyle),mt(i,"fontWeight")&&(o.fontWeight=i.fontWeight),a={type:"text",style:o,silent:!0},n={};var s=mt(i,"textPosition");r?n.position=s?i.textPosition:"inside":s&&(n.position=i.textPosition),mt(i,"textPosition")&&(n.position=i.textPosition),mt(i,"textOffset")&&(n.offset=i.textOffset),mt(i,"textRotation")&&(n.rotation=i.textRotation),mt(i,"textDistance")&&(n.distance=i.textDistance)}return X0(o,t),M(o.rich,function(l){X0(l,l)}),{textConfig:n,textContent:a}}function X0(t,e){e&&(e.font=e.textFont||e.font,mt(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),mt(e,"textAlign")&&(t.align=e.textAlign),mt(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),mt(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),mt(e,"textWidth")&&(t.width=e.textWidth),mt(e,"textHeight")&&(t.height=e.textHeight),mt(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),mt(e,"textPadding")&&(t.padding=e.textPadding),mt(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),mt(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),mt(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),mt(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),mt(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),mt(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),mt(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}var e2={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Y0=_t(e2);la(hi,function(t,e){return t[e]=1,t},{});hi.join(", ");var xf=["","style","shape","extra"],uo=Kt();function ug(t,e,r,i,n){var a=t+"Animation",o=Tp(t,i,n)||{},s=uo(e).userDuring;return o.duration>0&&(o.during=s?rt(zO,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=t),H(o,r[a]),o}function kc(t,e,r,i){i=i||{};var n=i.dataIndex,a=i.isInit,o=i.clearStyle,s=r.isAnimationEnabled(),l=uo(t),u=e.style;l.userDuring=e.during;var f={},h={};if(HO(t,e,h),$0("shape",e,h),$0("extra",e,h),!a&&s&&(UO(t,e,f),Z0("shape",t,e,f),Z0("extra",t,e,f),VO(t,e,u,f)),h.style=u,OO(t,h,o),FO(t,e),s)if(a){var v={};M(xf,function(d){var p=d?e[d]:e;p&&p.enterFrom&&(d&&(v[d]=v[d]||{}),H(d?v[d]:v,p.enterFrom))});var c=ug("enter",t,e,r,n);c.duration>0&&t.animateFrom(v,c)}else BO(t,e,n||0,r,f);r2(t,e),u?t.dirty():t.markRedraw()}function r2(t,e){for(var r=uo(t).leaveToProps,i=0;i<xf.length;i++){var n=xf[i],a=n?e[n]:e;a&&a.leaveTo&&(r||(r=uo(t).leaveToProps={}),n&&(r[n]=r[n]||{}),H(n?r[n]:r,a.leaveTo))}}function NO(t,e,r,i){if(t){var n=t.parent,a=uo(t).leaveToProps;if(a){var o=ug("update",t,e,r,0);o.done=function(){n.remove(t),i&&i()},t.animateTo(a,o)}else n.remove(t),i&&i()}}function ea(t){return t==="all"}function OO(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 BO(t,e,r,i,n){if(n){var a=ug("update",t,e,i,r);a.duration>0&&t.animateFrom(n,a)}}function FO(t,e){mt(e,"silent")&&(t.silent=e.silent),mt(e,"ignore")&&(t.ignore=e.ignore),t instanceof ua&&mt(e,"invisible")&&(t.invisible=e.invisible),t instanceof Ut&&mt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var ti={},kO={setTransform:function(t,e){return ti.el[t]=e,this},getTransform:function(t){return ti.el[t]},setShape:function(t,e){var r=ti.el,i=r.shape||(r.shape={});return i[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=ti.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=ti.el,i=r.style;return i&&(i[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=ti.el.style;if(e)return e[t]},setExtra:function(t,e){var r=ti.el.extra||(ti.el.extra={});return r[t]=e,this},getExtra:function(t){var e=ti.el.extra;if(e)return e[t]}};function zO(){var t=this,e=t.el;if(e){var r=uo(e).userDuring,i=t.userDuring;if(r!==i){t.el=t.userDuring=null;return}ti.el=e,i(kO)}}function Z0(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]={}),ea(l))H(o,a);else for(var u=pe(l),f=0;f<u.length;f++){var h=u[f],v=a[h];o[h]=v}else if(ea(s)||Ct(s,t)>=0){!o&&(o=i[t]={});for(var c=_t(a),f=0;f<c.length;f++){var h=c[f],v=a[h];GO(n[h],v)&&(o[h]=v)}}}}}function $0(t,e,r){var i=e[t];if(i)for(var n=r[t]={},a=_t(i),o=0;o<a.length;o++){var s=a[o];n[s]=ds(i[s])}}function UO(t,e,r){for(var i=e.transition,n=ea(i)?hi:pe(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 HO(t,e,r){for(var i=0;i<Y0.length;i++){var n=Y0[i],a=e2[n],o=e[n];o&&(r[a[0]]=o[0],r[a[1]]=o[1])}for(var i=0;i<hi.length;i++){var s=hi[i];e[s]!=null&&(r[s]=e[s])}}function VO(t,e,r,i){if(r){var n=t.style,a;if(n){var o=r.transition,s=e.transition;if(o&&!ea(o)){var l=pe(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&&(ea(s)||ea(o)||Ct(s,"style")>=0)){var v=t.getAnimationStyleProps(),c=v?v.style:null;if(c){!a&&(a=i.style={});for(var d=_t(r),u=0;u<d.length;u++){var f=d[u];if(c[f]){var h=n[f];a[f]=h}}}}}}}function GO(t,e){return Ze(t)?t!==e:t!=null&&isFinite(t)}var i2=Kt(),WO=["percent","easing","shape","style","extra"];function XO(t){t.stopAnimation("keyframe"),t.attr(i2(t))}function Ad(t,e,r){if(!(!r.isAnimationEnabled()||!e)){if(Y(e)){M(e,function(s){Ad(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=i2(t);M(xf,function(s){if(!(s&&!t[s])){var l;i.sort(function(u,f){return u.percent-f.percent}),M(i,function(u){var f=t.animators,h=s?u[s]:u;if(h){var v=_t(h);if(s||(v=ce(v,function(p){return Ct(WO,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;M(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 q0(t,e,r){var i=go.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 YO=function(t){W(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||Zu,typeof r=="string"?o=q0(r,i,n):Q(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(ix(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=q0("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 It(0,0,0,0);function f(_){if(!(!_.isFinite()||_.isZero()))if(o.length===0){var y=new It(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 It(0,0,0,0);A.copy(b),A.union(_),o[w]=A,x=!0;break}else if(l){u.copy(_),u.union(b);var C=_.width*_.height,E=b.width*b.height,D=u.width*u.height,L=D-C-E;L<S&&(S=L,T=w)}}if(l&&(o[T].union(_),x=!0),!x){var y=new It(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&ur||!c)?v.getPrevPaintRect():null;d&&f(d);var p=c&&(v.__dirty&ur||!v.__isRendered)?v.getPaintRect():null;p&&f(p)}}for(var h=this.__prevStartIndex;h<this.__prevEndIndex;++h){var v=i[h],c=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(Pf(i)){var x=i.global||i.__width===m&&i.__height===_;y=x&&i.__canvasGradient||od(o,i,{x:0,y:0,width:m,height:_}),i.__canvasGradient=y,i.__width=m,i.__height=_}else jb(i)&&(i.scaleX=i.scaleX||h,i.scaleY=i.scaleY||h,y=sd(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&&M(n,function(p){d(p.x*h,p.y*h,p.width*h,p.height*h)})},e}($r);const zc=YO;var K0=1e5,Ln=314159,Jl=.01,ZO=.001;function $O(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function qO(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 KO=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=H({},i||{}),this.dpr=i.devicePixelRatio||Zu,this._singleCanvas=a,this.root=e;var o=e.style;o&&(ix(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 zc(f,this,this.dpr);c.__builtin__=!0,c.initContext(),l[Ln]=c,c.zlevel=Ln,s.push(Ln),this._domRoot=e}else{this._width=Za(e,0,i),this._height=Za(e,1,i);var u=this._domRoot=qO(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(K0)),a||(a=i.ctx,a.save()),Yn(a,s,n,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(K0)},t.prototype.paintOne=function(e,r){Xp(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;Uu(function(){l._paintList(e,r,i,n)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Ln).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(L){var P={inHover:!1,allClipped:!1,prevEl:null,viewWidth:n._width,viewHeight:n._height};for(b=y;b<g.__endIndex;b++){var N=e[b];if(N.__inHover&&(h=!0),n._doPaintEl(N,g,o,L,P,b===g.__endIndex-1),x){var I=Date.now()-S;if(I>15)break}}P.prevElClipPaths&&m.restore()};if(_)if(_.length===0)b=g.__endIndex;else for(var C=c.dpr,E=0;E<_.length;++E){var D=_[E];m.save(),m.beginPath(),m.rect(D.x*C,D.y*C,D.width*C,D.height*C),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 ct.wxa&&M(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))&&(Yn(s,e,a,o),e.setPrevPaintRect(l))}else Yn(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Ln);var i=this._layers[e];return i||(i=new zc("zr_"+e,this,this.dpr),i.zlevel=e,i.__builtin__=!0,this._layerConfig[e]?vt(i,this._layerConfig[e],!0):this._layerConfig[e-Jl]&&vt(i,this._layerConfig[e-Jl],!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]&&$O(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=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+ZO,this._needsManuallyCompositing),f.incremental=!0,o=1):f=this.getLayer(u+(o>0?Jl:0),this._needsManuallyCompositing),f.__builtin__||Kd("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&ur&&!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,M(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var i=this._layerConfig;i[e]?vt(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+Jl){var o=this._layers[a];vt(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(Ct(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=Za(a,0,n),r=Za(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(Ln).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[Ln].dom;var r=new zc("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];Yn(i,f,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();const jO=KO;function n2(t){t.registerPainter("canvas",jO)}var QO=function(t){W(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 xS(this),C_(this)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),C_(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:li},e}(Ht),JO=function(t){W(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(cr);function a2(t){t.registerComponentModel(QO),t.registerComponentView(JO)}nr([n2,a2]);nr($I);function j0(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?Q0(this,t.call(this,l)):t3(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,Q0(o.prototype,r),o.extend=i.extend,o.derive=i.extend,o}function Q0(t,e){if(e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}function t3(t,e,r){for(var i=0;i<r.length;i++){var n=r[i];t[n]=e[n]}}const e3={extend:j0,derive:j0};function r3(t,e){this.action=t,this.context=e}var i3={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 r3(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}};const fg=i3;var n3=0,a3=Array.prototype,o3=a3.forEach,ue={genGUID:function(){return++n3},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===o3)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(ue.isObject(t)){if(ue.isArray(t))return t.slice();if(ue.isArrayLike(t)){for(var e=new t.constructor(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}else return ue.extend({},t)}else return t}},De=function(){this.__uid__=ue.genGUID()};De.__initializers__=[function(t){ue.extend(this,t)}];ue.extend(De,e3);ue.extend(De.prototype,fg);var J0=["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"],ty=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];function s3(t){for(var e={},r={},i=0;i<J0.length;i++){var n=J0[i];o(n)}for(var i=0;i<ty.length;i++){var a=ty[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 B={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 l3(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 u3={get:l3};var Uc,Lt={};Lt.supportWebGL=function(){if(Uc==null)try{var t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)throw new Error}catch{Uc=!1}return Uc};Lt.Int8Array=typeof Int8Array>"u"?Array:Int8Array;Lt.Uint8Array=typeof Uint8Array>"u"?Array:Uint8Array;Lt.Uint16Array=typeof Uint16Array>"u"?Array:Uint16Array;Lt.Uint32Array=typeof Uint32Array>"u"?Array:Uint32Array;Lt.Int16Array=typeof Int16Array>"u"?Array:Int16Array;Lt.Float32Array=typeof Float32Array>"u"?Array:Float32Array;Lt.Float64Array=typeof Float64Array>"u"?Array:Float64Array;var $n={};typeof window<"u"?$n=window:typeof global<"u"&&($n=global);Lt.requestAnimationFrame=$n.requestAnimationFrame||$n.msRequestAnimationFrame||$n.mozRequestAnimationFrame||$n.webkitRequestAnimationFrame||function(t){setTimeout(t,16)};Lt.createCanvas=function(){return document.createElement("canvas")};Lt.createImage=function(){return new $n.Image};Lt.request={get:u3.get};Lt.addEventListener=function(t,e,r,i){t.addEventListener(e,r,i)};Lt.removeEventListener=function(t,e,r){t.removeEventListener(e,r)};var we=function(){this.head=null,this.tail=null,this._length=0};we.prototype.insert=function(t){var e=new we.Entry(t);return this.insertEntry(e),e};we.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 we.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)}};we.prototype.insertBeforeEntry=function(t,e){var r=new we.Entry(t),i=e.prev;i?(i.next=r,r.prev=i):this.head=r,r.next=e,e.prev=r,this._length++};we.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this._length++};we.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--};we.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}};we.prototype.getHead=function(){if(this.head)return this.head.value};we.prototype.getTail=function(){if(this.tail)return this.tail.value};we.prototype.getAt=function(t){if(!(t<0)){for(var e=this.head,r=0;e&&r!=t;)e=e.next,r++;return e.value}};we.prototype.indexOf=function(t){for(var e=this.head,r=0;e;){if(e.value===t)return r;e=e.next,r++}};we.prototype.length=function(){return this._length};we.prototype.isEmpty=function(){return this._length===0};we.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++};we.prototype.clear=function(){this.tail=this.head=null,this._length=0};we.Entry=function(t){this.value=t,this.next=null,this.prev=null};var To=function(t){this._list=new we,this._map={},this._maxSize=t||10};To.prototype.setMaxSize=function(t){this._maxSize=t};To.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}};To.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};To.prototype.remove=function(t){var e=this._map[t];typeof e<"u"&&(delete this._map[t],this._list.remove(e))};To.prototype.clear=function(){this._list.clear(),this._map={}};const o2=To;var jt={},ey={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 Wr(t){return t=Math.round(t),t<0?0:t>255?255:t}function f3(t){return t=Math.round(t),t<0?0:t>360?360:t}function Gs(t){return t<0?0:t>1?1:t}function Hc(t){return t.length&&t.charAt(t.length-1)==="%"?Wr(parseFloat(t)/100*255):Wr(parseInt(t,10))}function fo(t){return t.length&&t.charAt(t.length-1)==="%"?Gs(parseFloat(t)/100):Gs(parseFloat(t))}function Vc(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 zr(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function Ed(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var s2=new o2(20),tu=null;function Ma(t,e){tu&&Ed(tu,e),tu=s2.put(t,tu||e.slice())}jt.parse=function(t,e){if(t){e=e||[];var r=s2.get(t);if(r)return Ed(e,r);t=t+"";var i=t.replace(/ /g,"").toLowerCase();if(i in ey)return Ed(e,ey[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)){zr(e,0,0,0,1);return}return zr(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)){zr(e,0,0,0,1);return}return zr(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){zr(e,0,0,0,1);return}u=fo(l.pop());case"rgb":if(l.length!==3){zr(e,0,0,0,1);return}return zr(e,Hc(l[0]),Hc(l[1]),Hc(l[2]),u),Ma(t,e),e;case"hsla":if(l.length!==4){zr(e,0,0,0,1);return}return l[3]=fo(l[3]),Cd(l,e),Ma(t,e),e;case"hsl":if(l.length!==3){zr(e,0,0,0,1);return}return Cd(l,e),Ma(t,e),e;default:return}}zr(e,0,0,0,1)}};jt.parseToFloat=function(t,e){if(e=jt.parse(t,e),!!e)return e[0]/=255,e[1]/=255,e[2]/=255,e};function Cd(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=fo(t[1]),n=fo(t[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],zr(e,Wr(Vc(o,a,r+1/3)*255),Wr(Vc(o,a,r)*255),Wr(Vc(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function h3(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}}jt.lift=function(t,e){var r=jt.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 jt.stringify(r,r.length===4?"rgba":"rgb")}};jt.toHex=function(t){var e=jt.parse(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)};jt.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]=Wr(Ki(o[0],s[0],l)),r[1]=Wr(Ki(o[1],s[1],l)),r[2]=Wr(Ki(o[2],s[2],l)),r[3]=Gs(Ki(o[3],s[3],l)),r}};jt.fastMapToColor=jt.fastLerp;jt.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=jt.parse(e[n]),s=jt.parse(e[a]),l=i-n,u=jt.stringify([Wr(Ki(o[0],s[0],l)),Wr(Ki(o[1],s[1],l)),Wr(Ki(o[2],s[2],l)),Gs(Ki(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:n,rightIndex:a,value:i}:u}};jt.mapToColor=jt.lerp;jt.modifyHSL=function(t,e,r,i){if(t=jt.parse(t),t)return t=h3(t),e!=null&&(t[0]=f3(e)),r!=null&&(t[1]=fo(r)),i!=null&&(t[2]=fo(i)),jt.stringify(Cd(t),"rgba")};jt.modifyAlpha=function(t,e){if(t=jt.parse(t),t&&e!=null)return t[3]=Gs(e),jt.stringify(t,"rgba")};jt.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 c3=jt.parseToFloat,Gc={};function ry(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 v3(t,e,r){r.sort();for(var i=[],n=0;n<r.length;n++){var a=r[n];i.push(a)}var o=ry(t)+`
`+ry(e)+`
`+i.join(`
`);if(Gc[o])return Gc[o];var s=ue.genGUID();return Gc[o]=s,s}var Ri=De.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=c3(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=ue.clone(t.vertexDefines),this.fragmentDefines=ue.clone(t.fragmentDefines),e){for(var o in r)i[o]&&(i[o].value=r[o].value);ue.defaults(this.vertexDefines,n),ue.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=ue.clone(this.vertexDefines),t.fragmentDefines=ue.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=v3(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}}),Mu=1e-6,Ee=Array,Ka=Math.random,ht={};ht.create=function(){var t=new Ee(2);return t[0]=0,t[1]=0,t};ht.clone=function(t){var e=new Ee(2);return e[0]=t[0],e[1]=t[1],e};ht.fromValues=function(t,e){var r=new Ee(2);return r[0]=t,r[1]=e,r};ht.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t};ht.set=function(t,e,r){return t[0]=e,t[1]=r,t};ht.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t};ht.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t};ht.sub=ht.subtract;ht.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t};ht.mul=ht.multiply;ht.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t};ht.div=ht.divide;ht.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t};ht.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t};ht.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t};ht.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t};ht.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(r*r+i*i)};ht.dist=ht.distance;ht.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1];return r*r+i*i};ht.sqrDist=ht.squaredDistance;ht.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)};ht.len=ht.length;ht.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r};ht.sqrLen=ht.squaredLength;ht.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t};ht.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t};ht.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};ht.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]};ht.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};ht.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};ht.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};ht.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};ht.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};ht.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};ht.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};ht.forEach=function(){var t=ht.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}}();const tt=ht;var yt=function(t,e){t=t||0,e=e||0,this.array=tt.fromValues(t,e),this._dirty=!0};yt.prototype={constructor:yt,add:function(t){return tt.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 yt(this.x,this.y)},copy:function(t){return tt.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return tt.cross(t.array,this.array,e.array),t._dirty=!0,this},dist:function(t){return tt.dist(this.array,t.array)},distance:function(t){return tt.distance(this.array,t.array)},div:function(t){return tt.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return tt.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return tt.dot(this.array,t.array)},len:function(){return tt.len(this.array)},length:function(){return tt.length(this.array)},lerp:function(t,e,r){return tt.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},min:function(t){return tt.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return tt.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return tt.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return tt.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return tt.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return tt.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return tt.random(this.array,t),this._dirty=!0,this},scale:function(t){return tt.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return tt.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return tt.sqrDist(this.array,t.array)},squaredDistance:function(t){return tt.squaredDistance(this.array,t.array)},sqrLen:function(){return tt.sqrLen(this.array)},squaredLength:function(){return tt.squaredLength(this.array)},sub:function(t){return tt.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return tt.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat2:function(t){return tt.transformMat2(this.array,this.array,t.array),this._dirty=!0,this},transformMat2d:function(t){return tt.transformMat2d(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return tt.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return tt.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 iy=yt.prototype;Object.defineProperty(iy,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Object.defineProperty(iy,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}})}yt.add=function(t,e,r){return tt.add(t.array,e.array,r.array),t._dirty=!0,t};yt.set=function(t,e,r){return tt.set(t.array,e,r),t._dirty=!0,t};yt.copy=function(t,e){return tt.copy(t.array,e.array),t._dirty=!0,t};yt.cross=function(t,e,r){return tt.cross(t.array,e.array,r.array),t._dirty=!0,t};yt.dist=function(t,e){return tt.distance(t.array,e.array)};yt.distance=yt.dist;yt.div=function(t,e,r){return tt.divide(t.array,e.array,r.array),t._dirty=!0,t};yt.divide=yt.div;yt.dot=function(t,e){return tt.dot(t.array,e.array)};yt.len=function(t){return tt.length(t.array)};yt.lerp=function(t,e,r,i){return tt.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};yt.min=function(t,e,r){return tt.min(t.array,e.array,r.array),t._dirty=!0,t};yt.max=function(t,e,r){return tt.max(t.array,e.array,r.array),t._dirty=!0,t};yt.mul=function(t,e,r){return tt.multiply(t.array,e.array,r.array),t._dirty=!0,t};yt.multiply=yt.mul;yt.negate=function(t,e){return tt.negate(t.array,e.array),t._dirty=!0,t};yt.normalize=function(t,e){return tt.normalize(t.array,e.array),t._dirty=!0,t};yt.random=function(t,e){return tt.random(t.array,e),t._dirty=!0,t};yt.scale=function(t,e,r){return tt.scale(t.array,e.array,r),t._dirty=!0,t};yt.scaleAndAdd=function(t,e,r,i){return tt.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};yt.sqrDist=function(t,e){return tt.sqrDist(t.array,e.array)};yt.squaredDistance=yt.sqrDist;yt.sqrLen=function(t){return tt.sqrLen(t.array)};yt.squaredLength=yt.sqrLen;yt.sub=function(t,e,r){return tt.subtract(t.array,e.array,r.array),t._dirty=!0,t};yt.subtract=yt.sub;yt.transformMat2=function(t,e,r){return tt.transformMat2(t.array,e.array,r.array),t._dirty=!0,t};yt.transformMat2d=function(t,e,r){return tt.transformMat2d(t.array,e.array,r.array),t._dirty=!0,t};yt.transformMat3=function(t,e,r){return tt.transformMat3(t.array,e.array,r.array),t._dirty=!0,t};yt.transformMat4=function(t,e,r){return tt.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};const lr=yt;var ny=1,ay=2,Wc=3,oy={};function d3(t){for(var e=t.split(`
`),r=0,i=e.length;r<i;r++)e[r]=r+1+": "+e[r];return e.join(`
`)}function sy(t,e,r){if(!t.getShaderParameter(e,t.COMPILE_STATUS))return[t.getShaderInfoLog(e),d3(r)].join(`
`)}var ly=new Lt.Float32Array(16),p3=De.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++)ly[o]=i[o];i=ly}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 Lt.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=oy[t.__uid__],o||(r?o=r.__enabledAttributeList=[]:o=oy[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]=ay:o[f]=ny}for(var l=0;l<o.length;l++)switch(o[l]){case ny:i.enableVertexAttribArray(l),o[l]=Wc;break;case ay:o[l]=Wc;break;case Wc: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=sy(t,n,r);if(s||(s=sy(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)}}});const g3=p3;var m3=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function uy(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(m3,i)}function Xc(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 _3(t){for(var e=[],r=0;r<t.length;r++)e.push("#extension GL_"+t[r]+" : enable");return e.join(`
`)}function y3(t){return["precision",t,"float"].join(" ")+`;
`+["precision",t,"int"].join(" ")+`;
`+["precision",t,"sampler2D"].join(" ")+`;
`}function l2(t){this._renderer=t,this._cache={}}l2.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+=`
`+Xc(v)+`
`}a&&(h+=`
#define INSTANCING
`);var c=h+Xc(e.vertexDefines,s,f),d=h+Xc(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=_3(g)+`
`+y3(e.precision)+`
`+d+`
`+e.shader.fragment,_=uy(p,e.vertexDefines,s),y=uy(m,e.fragmentDefines,s),x=new g3;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 fy=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,x3=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,hy=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,T3={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 mi(t){for(var e=[],r=0;r<t;r++)e[r]=0;return e}var cy={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return mi(2)},vec3:function(){return mi(3)},vec4:function(){return mi(4)},ivec2:function(){return mi(2)},ivec3:function(){return mi(3)},ivec4:function(){return mi(4)},mat2:function(){return mi(4)},mat3:function(){return mi(9)},mat4:function(){return mi(16)},array:function(){return[]}},Md=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],u2=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],f2=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],S3={vec4:4,vec3:3,vec2:2,float:1},Yc={},h2={};function w3(t,e){var r="vertex:"+t+"fragment:"+e;if(Yc[r])return Yc[r];var i=ue.genGUID();return Yc[r]=i,h2[i]={vertex:t,fragment:e},i}function vy(t){return t.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function Da(){console.error("Wrong uniform/attributes syntax")}function dy(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||Da();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){Da();break}v=s;continue}else if(m===":"){v=f;continue}else if(m===","){if(v===l){if(!(d instanceof Array)){Da();break}d.push(+i[++a])}else v=h;continue}else if(m===")"){c[p].value=new Lt.Float32Array(d),d=null,v=h;continue}else if(m==="("){if(v!==l){Da();break}if(!(d instanceof Array)){Da();break}d.push(+i[++a]);continue}else if(m.indexOf("vec")>=0){if(v!==s&&v!==f){Da();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;Md.indexOf(_)>=0||u2.indexOf(_)>=0||f2.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 G(t,e){typeof t=="object"&&(e=t.fragment,t=t.vertex),t=vy(t),e=vy(e),this._shaderID=w3(t,e),this._vertexCode=G.parseImport(t),this._fragmentCode=G.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()}G.prototype={constructor:G,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=G.parseImport(this.vertex),this._fragmentCode=G.parseImport(this.fragment)},_addSemanticUniform:function(t,e,r){if(Md.indexOf(r)>=0)this.attributeSemantics[r]={symbol:t,type:e};else if(f2.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 u2.indexOf(r)>=0&&(this.uniformSemantics[r]={symbol:t,type:e})},_addMaterialUniform:function(t,e,r,i,n,a){a[t]={type:r,value:n?cy.array:i||cy[e],semantic:null}},_parseUniforms:function(){var t={},e=this,r="vertex";this._uniformList=[],this._vertexCode=this._vertexCode.replace(fy,n),r="fragment",this._fragmentCode=this._fragmentCode.replace(fy,n),e.matrixSemanticKeys=Object.keys(this.matrixSemantics);function i(a){return a!=null?function(){return a}:null}function n(a,o,s){var l=dy(o,s),u=[];for(var f in l){var h=l[f],v=h.semantic,c=f,d=T3[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(x3,r);function r(i,n,a){var o=dy(n,a),s=S3[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(Md.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(hy,r),e="fragment",this._fragmentCode=this._fragmentCode.replace(hy,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=h2[this._shaderID],e=new G(t.vertex,t.fragment);return e}};Object.defineProperty&&(Object.defineProperty(G.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(G.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(G.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(G.prototype,"uniforms",{get:function(){return this._uniformList}}));var b3=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;G.parseImport=function(t){return t=t.replace(b3,function(n,r,i){var n=G.source(i);return n?G.parseImport(n):(console.error('Shader chunk "'+i+'" not existed in library'),"")}),t};var A3=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;G.import=function(t){t.replace(A3,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=G.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})};G.codes={};G.source=function(t){for(var e=t.split("."),r=G.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 c2=`@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 Vt={};Vt.create=function(){var t=new Ee(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};Vt.clone=function(t){var e=new Ee(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};Vt.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};Vt.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};Vt.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};Vt.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,C=f*m-c*d,E=h*g-v*p,D=h*m-c*p,L=v*m-c*g,P=_*L-y*D+x*E+S*C-T*A+w*b;return P?(P=1/P,t[0]=(s*L-l*D+u*E)*P,t[1]=(n*D-i*L-a*E)*P,t[2]=(p*w-g*T+m*S)*P,t[3]=(v*T-h*w-c*S)*P,t[4]=(l*C-o*L-u*A)*P,t[5]=(r*L-n*C+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*C+u*b)*P,t[9]=(i*C-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};Vt.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};Vt.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,C=f*p-h*d,E=f*g-v*d,D=h*g-v*p;return m*D-_*E+y*C+x*A-S*b+T*w};Vt.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};Vt.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};Vt.mul=Vt.multiply;Vt.mulAffine=Vt.multiplyAffine;Vt.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};Vt.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};Vt.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,C,E,D,L,P,N;return Math.abs(s)<Mu?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,C=n*a*f-o*l,E=a*a*f+u,D=o*a*f+n*l,L=n*o*f+a*l,P=a*o*f-n*l,N=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*C+p*E+y*D,t[5]=v*C+g*E+x*D,t[6]=c*C+m*E+S*D,t[7]=d*C+_*E+T*D,t[8]=h*L+p*P+y*N,t[9]=v*L+g*P+x*N,t[10]=c*L+m*P+S*N,t[11]=d*L+_*P+T*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)};Vt.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};Vt.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};Vt.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};Vt.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};Vt.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};Vt.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};Vt.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};Vt.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};Vt.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)<Mu&&Math.abs(p-S)<Mu&&Math.abs(g-T)<Mu?Vt.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)};Vt.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))};const V=Vt;var R={};R.create=function(){var t=new Ee(3);return t[0]=0,t[1]=0,t[2]=0,t};R.clone=function(t){var e=new Ee(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e};R.fromValues=function(t,e,r){var i=new Ee(3);return i[0]=t,i[1]=e,i[2]=r,i};R.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t};R.set=function(t,e,r,i){return t[0]=e,t[1]=r,t[2]=i,t};R.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};R.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};R.sub=R.subtract;R.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};R.mul=R.multiply;R.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};R.div=R.divide;R.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};R.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};R.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t};R.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};R.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)};R.dist=R.distance;R.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};R.sqrDist=R.squaredDistance;R.length=function(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)};R.len=R.length;R.squaredLength=function(t){var e=t[0],r=t[1],i=t[2];return e*e+r*r+i*i};R.sqrLen=R.squaredLength;R.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t};R.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t};R.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};R.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]};R.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};R.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};R.random=function(t,e){e=e||1;var r=Ka()*2*Math.PI,i=Ka()*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};R.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};R.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};R.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};R.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};R.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};R.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};R.forEach=function(){var t=R.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}}();R.angle=function(t,e){var r=R.fromValues(t[0],t[1],t[2]),i=R.fromValues(e[0],e[1],e[2]);R.normalize(r,r),R.normalize(i,i);var n=R.dot(r,i);return n>1?0:Math.acos(n)};G.import(c2);var qt=V.create,py={};function gy(t){return t.material}function E3(t,e,r){return e.uniforms[r].value}function C3(t,e,r,i){return r!==i}function M3(t){return!0}function my(){}var _y={float:B.FLOAT,byte:B.BYTE,ubyte:B.UNSIGNED_BYTE,short:B.SHORT,ushort:B.UNSIGNED_SHORT};function D3(t,e,r){this.availableAttributes=t,this.availableAttributeSymbols=e,this.indicesBuffer=r,this.vao=null}function L3(t){var e,r;this.bind=function(i){e||(e=Lt.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 an=De.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=Lt.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 s3(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 l2(this),this._placeholderTexture=new L3},{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=qt(),d=R.create(),p=0;p<h.length;p++){var g=h[p];V.multiplyAffine(c,e.viewMatrix.array,g.worldTransform.array),R.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(py[t.__uid__])return;if(py[t.__uid__]=!0,this.throwError)throw new Error(e);this.trigger("error",e)}},updatePrograms:function(t,e,r){var i=r&&r.getMaterial||gy;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||gy,r.getUniform=r.getUniform||E3,r.isMaterialChanged=r.isMaterialChanged||C3,r.beforeRender=r.beforeRender||my,r.afterRender=r.afterRender||my;var i=r.ifRender||M3;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?(V.copy($t.VIEW,e.viewMatrix.array),V.copy($t.PROJECTION,e.projectionMatrix.array),V.copy($t.VIEWINVERSE,e.worldTransform.array)):(V.identity($t.VIEW),V.identity($t.PROJECTION),V.identity($t.VIEWINVERSE)),V.multiply($t.VIEWPROJECTION,$t.PROJECTION,$t.VIEW),V.invert($t.PROJECTIONINVERSE,$t.PROJECTION),V.invert($t.VIEWPROJECTIONINVERSE,$t.VIEWPROJECTION);for(var h=this.gl,v=this._sceneRendering,c,d,p,g,m,_,y,x,S,T,w,b,A=null,C=0;C<t.length;C++){var E=t[C],D=E.worldTransform!=null,L;if(i(E)){D&&(L=E.isSkinnedMesh&&E.isSkinnedMesh()?E.offsetMatrix?E.offsetMatrix.array:$t.IDENTITY:E.worldTransform.array);var P=E.geometry,N=r.getMaterial.call(this,E),I=E.__program,k=N.shader,O=P.__uid__+"-"+I.__uid__,U=O!==T;T=O,U&&A&&A.bindVertexArrayOES(null),D&&(V.copy($t.WORLD,L),V.multiply($t.WORLDVIEWPROJECTION,$t.VIEWPROJECTION,L),V.multiplyAffine($t.WORLDVIEW,$t.VIEW,L),(k.matrixSemantics.WORLDINVERSE||k.matrixSemantics.WORLDINVERSETRANSPOSE)&&V.invert($t.WORLDINVERSE,L),(k.matrixSemantics.WORLDVIEWINVERSE||k.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&V.invert($t.WORLDVIEWINVERSE,$t.WORLDVIEW),(k.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||k.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&V.invert($t.WORLDVIEWPROJECTIONINVERSE,$t.WORLDVIEWPROJECTION)),E.beforeRender&&E.beforeRender(this),r.beforeRender.call(this,E,N,c);var z=I!==d;z?(I.bind(this),I.setUniformOfSemantic(h,"VIEWPORT",o),I.setUniformOfSemantic(h,"WINDOW_SIZE",l),e&&(I.setUniformOfSemantic(h,"NEAR",e.near),I.setUniformOfSemantic(h,"FAR",e.far)),I.setUniformOfSemantic(h,"DEVICEPIXELRATIO",a),I.setUniformOfSemantic(h,"TIME",f),I.setUniformOfSemantic(h,"VIEWPORT_SIZE",u),v&&v.setLightUniforms(I,E.lightGroup,this)):I=d,(z||r.isMaterialChanged(E,p,N,c))&&(N.depthTest!==g&&(N.depthTest?h.enable(h.DEPTH_TEST):h.disable(h.DEPTH_TEST),g=N.depthTest),N.depthMask!==m&&(h.depthMask(N.depthMask),m=N.depthMask),N.transparent!==S&&(N.transparent?h.enable(h.BLEND):h.disable(h.BLEND),S=N.transparent),N.transparent&&(N.blend?N.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,N,I,p||null,c||null,d||null,r.getUniform),c=N);var nt=k.matrixSemanticKeys;if(D)for(var $=0;$<nt.length;$++){var J=nt[$],it=k.matrixSemantics[J],Pt=$t[J];if(it.isTranspose){var pt=$t[it.semanticNoTranspose];V.transpose(Pt,pt)}I.setUniform(h,it.type,it.symbol,Pt)}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,I,b),U&&(w=this._bindVAO(A,k,P,I)),this._renderObject(E,w,I),r.afterRender(this,E),E.afterRender&&E.afterRender(this),d=I,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=_y[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 D3(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=_y[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 Ri({shader:new G(G.source("clay.prez.vertex"),G.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 lr),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}});an.opaqueSortCompare=an.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};an.transparentSortCompare=an.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 $t={IDENTITY:qt(),WORLD:qt(),VIEW:qt(),PROJECTION:qt(),WORLDVIEW:qt(),VIEWPROJECTION:qt(),WORLDVIEWPROJECTION:qt(),WORLDINVERSE:qt(),VIEWINVERSE:qt(),PROJECTIONINVERSE:qt(),WORLDVIEWINVERSE:qt(),VIEWPROJECTIONINVERSE:qt(),WORLDVIEWPROJECTIONINVERSE:qt(),WORLDTRANSPOSE:qt(),VIEWTRANSPOSE:qt(),PROJECTIONTRANSPOSE:qt(),WORLDVIEWTRANSPOSE:qt(),VIEWPROJECTIONTRANSPOSE:qt(),WORLDVIEWPROJECTIONTRANSPOSE:qt(),WORLDINVERSETRANSPOSE:qt(),VIEWINVERSETRANSPOSE:qt(),PROJECTIONINVERSETRANSPOSE:qt(),WORLDVIEWINVERSETRANSPOSE:qt(),VIEWPROJECTIONINVERSETRANSPOSE:qt(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:qt()};an.COLOR_BUFFER_BIT=B.COLOR_BUFFER_BIT;an.DEPTH_BUFFER_BIT=B.DEPTH_BUFFER_BIT;an.STENCIL_BUFFER_BIT=B.STENCIL_BUFFER_BIT;const As=an;var at=function(t,e,r){t=t||0,e=e||0,r=r||0,this.array=R.fromValues(t,e,r),this._dirty=!0};at.prototype={constructor:at,add:function(t){return R.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 at(this.x,this.y,this.z)},copy:function(t){return R.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return R.cross(this.array,t.array,e.array),this._dirty=!0,this},dist:function(t){return R.dist(this.array,t.array)},distance:function(t){return R.distance(this.array,t.array)},div:function(t){return R.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return R.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return R.dot(this.array,t.array)},len:function(){return R.len(this.array)},length:function(){return R.length(this.array)},lerp:function(t,e,r){return R.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},min:function(t){return R.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return R.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return R.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return R.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return R.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return R.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return R.random(this.array,t),this._dirty=!0,this},scale:function(t){return R.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return R.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return R.sqrDist(this.array,t.array)},squaredDistance:function(t){return R.squaredDistance(this.array,t.array)},sqrLen:function(){return R.sqrLen(this.array)},squaredLength:function(){return R.squaredLength(this.array)},sub:function(t){return R.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return R.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return R.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return R.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return R.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){at.eulerFromQuat(this,t,e)},eulerFromMat3:function(t,e){at.eulerFromMat3(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var eu=Object.defineProperty;if(eu){var Zc=at.prototype;eu(Zc,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),eu(Zc,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),eu(Zc,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}})}at.add=function(t,e,r){return R.add(t.array,e.array,r.array),t._dirty=!0,t};at.set=function(t,e,r,i){R.set(t.array,e,r,i),t._dirty=!0};at.copy=function(t,e){return R.copy(t.array,e.array),t._dirty=!0,t};at.cross=function(t,e,r){return R.cross(t.array,e.array,r.array),t._dirty=!0,t};at.dist=function(t,e){return R.distance(t.array,e.array)};at.distance=at.dist;at.div=function(t,e,r){return R.divide(t.array,e.array,r.array),t._dirty=!0,t};at.divide=at.div;at.dot=function(t,e){return R.dot(t.array,e.array)};at.len=function(t){return R.length(t.array)};at.lerp=function(t,e,r,i){return R.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};at.min=function(t,e,r){return R.min(t.array,e.array,r.array),t._dirty=!0,t};at.max=function(t,e,r){return R.max(t.array,e.array,r.array),t._dirty=!0,t};at.mul=function(t,e,r){return R.multiply(t.array,e.array,r.array),t._dirty=!0,t};at.multiply=at.mul;at.negate=function(t,e){return R.negate(t.array,e.array),t._dirty=!0,t};at.normalize=function(t,e){return R.normalize(t.array,e.array),t._dirty=!0,t};at.random=function(t,e){return R.random(t.array,e),t._dirty=!0,t};at.scale=function(t,e,r){return R.scale(t.array,e.array,r),t._dirty=!0,t};at.scaleAndAdd=function(t,e,r,i){return R.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};at.sqrDist=function(t,e){return R.sqrDist(t.array,e.array)};at.squaredDistance=at.sqrDist;at.sqrLen=function(t){return R.sqrLen(t.array)};at.squaredLength=at.sqrLen;at.sub=function(t,e,r){return R.subtract(t.array,e.array,r.array),t._dirty=!0,t};at.subtract=at.sub;at.transformMat3=function(t,e,r){return R.transformMat3(t.array,e.array,r.array),t._dirty=!0,t};at.transformMat4=function(t,e,r){return R.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};at.transformQuat=function(t,e,r){return R.transformQuat(t.array,e.array,r.array),t._dirty=!0,t};function br(t,e,r){return t<e?e:t>r?r:t}var zt=Math.atan2,Ar=Math.asin,La=Math.abs;at.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]=zt(2*(n*s-a*o),h-l-u+f),i[1]=Ar(br(2*(n*o+a*s),-1,1)),i[2]=zt(2*(o*s-n*a),h+l-u-f);break;case"YXZ":i[0]=Ar(br(2*(n*s-a*o),-1,1)),i[1]=zt(2*(n*o+a*s),h-l-u+f),i[2]=zt(2*(n*a+o*s),h-l+u-f);break;case"ZXY":i[0]=Ar(br(2*(n*s+a*o),-1,1)),i[1]=zt(2*(a*s-o*n),h-l-u+f),i[2]=zt(2*(o*s-n*a),h-l+u-f);break;case"ZYX":i[0]=zt(2*(n*s+o*a),h-l-u+f),i[1]=Ar(br(2*(a*s-n*o),-1,1)),i[2]=zt(2*(n*a+o*s),h+l-u-f);break;case"YZX":i[0]=zt(2*(n*s-o*a),h-l+u-f),i[1]=zt(2*(a*s-n*o),h+l-u-f),i[2]=Ar(br(2*(n*a+o*s),-1,1));break;case"XZY":i[0]=zt(2*(n*s+a*o),h-l+u-f),i[1]=zt(2*(n*o+a*s),h+l-u-f),i[2]=Ar(br(2*(o*s-n*a),-1,1));break;default:console.warn("Unkown order: "+v)}return t};at.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]=Ar(br(o,-1,1)),La(o)<.99999?(c[0]=zt(-u,v),c[2]=zt(-a,n)):(c[0]=zt(h,l),c[2]=0);break;case"YXZ":c[0]=Ar(-br(u,-1,1)),La(u)<.99999?(c[1]=zt(o,v),c[2]=zt(s,l)):(c[1]=zt(-f,n),c[2]=0);break;case"ZXY":c[0]=Ar(br(h,-1,1)),La(h)<.99999?(c[1]=zt(-f,v),c[2]=zt(-a,l)):(c[1]=0,c[2]=zt(s,n));break;case"ZYX":c[1]=Ar(-br(f,-1,1)),La(f)<.99999?(c[0]=zt(h,v),c[2]=zt(s,n)):(c[0]=0,c[2]=zt(-a,l));break;case"YZX":c[2]=Ar(br(s,-1,1)),La(s)<.99999?(c[0]=zt(-u,l),c[1]=zt(-f,n)):(c[0]=0,c[1]=zt(o,v));break;case"XZY":c[2]=Ar(-br(a,-1,1)),La(a)<.99999?(c[0]=zt(h,l),c[1]=zt(o,n)):(c[0]=zt(-u,v),c[1]=0);break;default:console.warn("Unkown order: "+d)}return t._dirty=!0,t};Object.defineProperties(at,{POSITIVE_X:{get:function(){return new at(1,0,0)}},NEGATIVE_X:{get:function(){return new at(-1,0,0)}},POSITIVE_Y:{get:function(){return new at(0,1,0)}},NEGATIVE_Y:{get:function(){return new at(0,-1,0)}},POSITIVE_Z:{get:function(){return new at(0,0,1)}},NEGATIVE_Z:{get:function(){return new at(0,0,-1)}},UP:{get:function(){return new at(0,1,0)}},ZERO:{get:function(){return new at}}});const X=at;var $c=1e-5,Du=function(t,e){this.origin=t||new X,this.direction=e||new X};Du.prototype={constructor:Du,intersectPlane:function(t,e){var r=t.normal.array,i=t.distance,n=this.origin.array,a=this.direction.array,o=R.dot(r,a);if(o===0)return null;e||(e=new X);var s=(R.dot(r,n)-i)/o;return R.scaleAndAdd(e.array,n,a,-s),e._dirty=!0,e},mirrorAgainstPlane:function(t){var e=R.dot(t.normal.array,this.direction.array);R.scaleAndAdd(this.direction.array,this.direction.array,t.normal.array,-e*2),this.direction._dirty=!0},distanceToPoint:function(){var t=R.create();return function(e){R.sub(t,e,this.origin.array);var r=R.dot(t,this.direction.array);if(r<0)return R.distance(this.origin.array,e);var i=R.lenSquared(t);return Math.sqrt(i-r*r)}}(),intersectSphere:function(){var t=R.create();return function(e,r,i){var n=this.origin.array,a=this.direction.array;e=e.array,R.sub(t,e,n);var o=R.dot(t,a),s=R.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 X),h<0?v<0?null:(R.scaleAndAdd(i.array,n,a,v),i):(R.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 X),R.scaleAndAdd(e.array,i,r,p),e},intersectTriangle:function(){var t=R.create(),e=R.create(),r=R.create(),i=R.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,R.sub(t,a,n),R.sub(e,o,n),R.cross(i,e,f);var v=R.dot(t,i);if(s){if(v>-$c)return null}else if(v>-$c&&v<$c)return null;R.sub(r,h,n);var c=R.dot(i,r)/v;if(c<0||c>1)return null;R.cross(i,t,r);var d=R.dot(f,i)/v;if(d<0||d>1||c+d>1)return null;R.cross(i,t,e);var p=-R.dot(r,i)/v;return p<0?null:(l||(l=new X),u&&X.set(u,1-c-d,c,d),R.scaleAndAdd(l.array,h,f,p),l)}}(),applyTransform:function(t){X.add(this.direction,this.direction,this.origin),X.transformMat4(this.origin,this.origin,t),X.transformMat4(this.direction,this.direction,t),X.sub(this.direction,this.direction,this.origin),X.normalize(this.direction,this.direction)},copy:function(t){X.copy(this.origin,t.origin),X.copy(this.direction,t.direction)},clone:function(){var t=new Du;return t.copy(this),t}};const Tf=Du;var dt={};dt.create=function(){var t=new Ee(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t};dt.clone=function(t){var e=new Ee(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e};dt.fromValues=function(t,e,r,i){var n=new Ee(4);return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n};dt.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};dt.set=function(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t};dt.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};dt.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};dt.sub=dt.subtract;dt.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};dt.mul=dt.multiply;dt.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};dt.div=dt.divide;dt.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};dt.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};dt.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};dt.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};dt.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)};dt.dist=dt.distance;dt.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};dt.sqrDist=dt.squaredDistance;dt.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)};dt.len=dt.length;dt.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};dt.sqrLen=dt.squaredLength;dt.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};dt.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};dt.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};dt.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]};dt.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};dt.random=function(t,e){return e=e||1,t[0]=Ka(),t[1]=Ka(),t[2]=Ka(),t[3]=Ka(),dt.normalize(t,t),dt.scale(t,t,e),t};dt.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};dt.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};dt.forEach=function(){var t=dt.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}}();const Z=dt;var me={};me.create=function(){var t=new Ee(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};me.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};me.clone=function(t){var e=new Ee(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};me.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};me.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};me.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};me.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};me.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};me.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)};me.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};me.mul=me.multiply;me.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};me.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};me.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};me.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};me.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};me.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,C=f*m-c*d,E=h*g-v*p,D=h*m-c*p,L=v*m-c*g,P=_*L-y*D+x*E+S*C-T*A+w*b;return P?(P=1/P,t[0]=(s*L-l*D+u*E)*P,t[1]=(l*C-o*L-u*A)*P,t[2]=(o*D-s*C+u*b)*P,t[3]=(n*D-i*L-a*E)*P,t[4]=(r*L-n*C+a*A)*P,t[5]=(i*C-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};me.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))};const Tt=me;var Dt={};Dt.create=function(){var t=new Ee(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t};Dt.rotationTo=function(){var t=R.create(),e=R.fromValues(1,0,0),r=R.fromValues(0,1,0);return function(i,n,a){var o=R.dot(n,a);return o<-.999999?(R.cross(t,e,n),R.length(t)<1e-6&&R.cross(t,r,n),R.normalize(t,t),Dt.setAxisAngle(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(R.cross(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,Dt.normalize(i,i))}}();Dt.setAxes=function(){var t=Tt.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],Dt.normalize(e,Dt.fromMat3(e,t))}}();Dt.clone=Z.clone;Dt.fromValues=Z.fromValues;Dt.copy=Z.copy;Dt.set=Z.set;Dt.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t};Dt.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};Dt.add=Z.add;Dt.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};Dt.mul=Dt.multiply;Dt.scale=Z.scale;Dt.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};Dt.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};Dt.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};Dt.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};Dt.dot=Z.dot;Dt.lerp=Z.lerp;Dt.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};Dt.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};Dt.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t};Dt.length=Z.length;Dt.len=Dt.length;Dt.squaredLength=Z.squaredLength;Dt.sqrLen=Dt.squaredLength;Dt.normalize=Z.normalize;Dt.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};const ot=Dt;var Yt=function(){this._axisX=new X,this._axisY=new X,this._axisZ=new X,this.array=V.create(),this._dirty=!0};Yt.prototype={constructor:Yt,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 V.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return new Yt().copy(this)},copy:function(t){return V.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return V.determinant(this.array)},fromQuat:function(t){return V.fromQuat(this.array,t.array),this._dirty=!0,this},fromRotationTranslation:function(t,e){return V.fromRotationTranslation(this.array,t.array,e.array),this._dirty=!0,this},fromMat2d:function(t){return Yt.fromMat2d(this,t),this},frustum:function(t,e,r,i,n,a){return V.frustum(this.array,t,e,r,i,n,a),this._dirty=!0,this},identity:function(){return V.identity(this.array),this._dirty=!0,this},invert:function(){return V.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(t,e,r){return V.lookAt(this.array,t.array,e.array,r.array),this._dirty=!0,this},mul:function(t){return V.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return V.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return V.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return V.multiply(this.array,t.array,this.array),this._dirty=!0,this},ortho:function(t,e,r,i,n,a){return V.ortho(this.array,t,e,r,i,n,a),this._dirty=!0,this},perspective:function(t,e,r,i){return V.perspective(this.array,t,e,r,i),this._dirty=!0,this},rotate:function(t,e){return V.rotate(this.array,this.array,t,e.array),this._dirty=!0,this},rotateX:function(t){return V.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return V.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return V.rotateZ(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return V.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return V.translate(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return V.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var t=R.create(),e=R.create(),r=R.create(),i=Tt.create();return function(n,a,o){var s=this.array;R.set(t,s[0],s[1],s[2]),R.set(e,s[4],s[5],s[6]),R.set(r,s[8],s[9],s[10]);var l=R.length(t),u=R.length(e),f=R.length(r),h=this.determinant();h<0&&(l=-l),n&&n.set(l,u,f),o.set(s[12],s[13],s[14]),Tt.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,ot.fromMat3(a.array,i),ot.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 ru=Object.defineProperty;if(ru){var qc=Yt.prototype;ru(qc,"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}}),ru(qc,"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}}),ru(qc,"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}})}Yt.adjoint=function(t,e){return V.adjoint(t.array,e.array),t._dirty=!0,t};Yt.copy=function(t,e){return V.copy(t.array,e.array),t._dirty=!0,t};Yt.determinant=function(t){return V.determinant(t.array)};Yt.identity=function(t){return V.identity(t.array),t._dirty=!0,t};Yt.ortho=function(t,e,r,i,n,a,o){return V.ortho(t.array,e,r,i,n,a,o),t._dirty=!0,t};Yt.perspective=function(t,e,r,i,n){return V.perspective(t.array,e,r,i,n),t._dirty=!0,t};Yt.lookAt=function(t,e,r,i){return V.lookAt(t.array,e.array,r.array,i.array),t._dirty=!0,t};Yt.invert=function(t,e){return V.invert(t.array,e.array),t._dirty=!0,t};Yt.mul=function(t,e,r){return V.mul(t.array,e.array,r.array),t._dirty=!0,t};Yt.multiply=Yt.mul;Yt.fromQuat=function(t,e){return V.fromQuat(t.array,e.array),t._dirty=!0,t};Yt.fromRotationTranslation=function(t,e,r){return V.fromRotationTranslation(t.array,e.array,r.array),t._dirty=!0,t};Yt.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};Yt.rotate=function(t,e,r,i){return V.rotate(t.array,e.array,r,i.array),t._dirty=!0,t};Yt.rotateX=function(t,e,r){return V.rotateX(t.array,e.array,r),t._dirty=!0,t};Yt.rotateY=function(t,e,r){return V.rotateY(t.array,e.array,r),t._dirty=!0,t};Yt.rotateZ=function(t,e,r){return V.rotateZ(t.array,e.array,r),t._dirty=!0,t};Yt.scale=function(t,e,r){return V.scale(t.array,e.array,r.array),t._dirty=!0,t};Yt.transpose=function(t,e){return V.transpose(t.array,e.array),t._dirty=!0,t};Yt.translate=function(t,e,r){return V.translate(t.array,e.array,r.array),t._dirty=!0,t};const et=Yt;var Ot=function(t,e,r,i){t=t||0,e=e||0,r=r||0,i=i===void 0?1:i,this.array=ot.fromValues(t,e,r,i),this._dirty=!0};Ot.prototype={constructor:Ot,add:function(t){return ot.add(this.array,this.array,t.array),this._dirty=!0,this},calculateW:function(){return ot.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 Ot(this.x,this.y,this.z,this.w)},conjugate:function(){return ot.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(t){return ot.copy(this.array,t.array),this._dirty=!0,this},dot:function(t){return ot.dot(this.array,t.array)},fromMat3:function(t){return ot.fromMat3(this.array,t.array),this._dirty=!0,this},fromMat4:function(){var t=Tt.create();return function(e){return Tt.fromMat4(t,e.array),Tt.transpose(t,t),ot.fromMat3(this.array,t),this._dirty=!0,this}}(),identity:function(){return ot.identity(this.array),this._dirty=!0,this},invert:function(){return ot.invert(this.array,this.array),this._dirty=!0,this},len:function(){return ot.len(this.array)},length:function(){return ot.length(this.array)},lerp:function(t,e,r){return ot.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},mul:function(t){return ot.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return ot.multiply(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return ot.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return ot.multiply(this.array,t.array,this.array),this._dirty=!0,this},normalize:function(){return ot.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(t){return ot.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return ot.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return ot.rotateZ(this.array,this.array,t),this._dirty=!0,this},rotationTo:function(t,e){return ot.rotationTo(this.array,t.array,e.array),this._dirty=!0,this},setAxes:function(t,e,r){return ot.setAxes(this.array,t.array,e.array,r.array),this._dirty=!0,this},setAxisAngle:function(t,e){return ot.setAxisAngle(this.array,t.array,e),this._dirty=!0,this},slerp:function(t,e,r){return ot.slerp(this.array,t.array,e.array,r),this._dirty=!0,this},sqrLen:function(){return ot.sqrLen(this.array)},squaredLength:function(){return ot.squaredLength(this.array)},fromEuler:function(t,e){return Ot.fromEuler(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var Yo=Object.defineProperty;if(Yo){var iu=Ot.prototype;Yo(iu,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Yo(iu,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),Yo(iu,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),Yo(iu,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}Ot.add=function(t,e,r){return ot.add(t.array,e.array,r.array),t._dirty=!0,t};Ot.set=function(t,e,r,i,n){ot.set(t.array,e,r,i,n),t._dirty=!0};Ot.copy=function(t,e){return ot.copy(t.array,e.array),t._dirty=!0,t};Ot.calculateW=function(t,e){return ot.calculateW(t.array,e.array),t._dirty=!0,t};Ot.conjugate=function(t,e){return ot.conjugate(t.array,e.array),t._dirty=!0,t};Ot.identity=function(t){return ot.identity(t.array),t._dirty=!0,t};Ot.invert=function(t,e){return ot.invert(t.array,e.array),t._dirty=!0,t};Ot.dot=function(t,e){return ot.dot(t.array,e.array)};Ot.len=function(t){return ot.length(t.array)};Ot.lerp=function(t,e,r,i){return ot.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};Ot.slerp=function(t,e,r,i){return ot.slerp(t.array,e.array,r.array,i),t._dirty=!0,t};Ot.mul=function(t,e,r){return ot.multiply(t.array,e.array,r.array),t._dirty=!0,t};Ot.multiply=Ot.mul;Ot.rotateX=function(t,e,r){return ot.rotateX(t.array,e.array,r),t._dirty=!0,t};Ot.rotateY=function(t,e,r){return ot.rotateY(t.array,e.array,r),t._dirty=!0,t};Ot.rotateZ=function(t,e,r){return ot.rotateZ(t.array,e.array,r),t._dirty=!0,t};Ot.setAxisAngle=function(t,e,r){return ot.setAxisAngle(t.array,e.array,r),t._dirty=!0,t};Ot.normalize=function(t,e){return ot.normalize(t.array,e.array),t._dirty=!0,t};Ot.sqrLen=function(t){return ot.sqrLen(t.array)};Ot.squaredLength=Ot.sqrLen;Ot.fromMat3=function(t,e){return ot.fromMat3(t.array,e.array),t._dirty=!0,t};Ot.setAxes=function(t,e,r,i){return ot.setAxes(t.array,e.array,r.array,i.array),t._dirty=!0,t};Ot.rotationTo=function(t,e,r){return ot.rotationTo(t.array,e.array,r.array),t._dirty=!0,t};Ot.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}};const v2=Ot;var Vi=R.set,nu=R.copy,Lu=function(t,e){this.min=t||new X(1/0,1/0,1/0),this.max=e||new X(-1/0,-1/0,-1/0),this.vertices=null};Lu.prototype={constructor:Lu,updateFromVertices:function(t){if(t.length>0){var e=this.min,r=this.max,i=e.array,n=r.array;nu(i,t[0]),nu(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 R.min(e.array,e.array,t.min.array),R.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 R.max(e.array,e.array,t.min.array),R.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=R.create(),e=R.create(),r=R.create(),i=R.create(),n=R.create(),a=R.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]=R.fromValues(0,0,0);this.vertices=t}var r=this.min.array,i=this.max.array;return Vi(t[0],r[0],r[1],r[2]),Vi(t[1],r[0],i[1],r[2]),Vi(t[2],i[0],r[1],r[2]),Vi(t[3],i[0],i[1],r[2]),Vi(t[4],r[0],r[1],i[2]),Vi(t[5],r[0],i[1],i[2]),Vi(t[6],i[0],r[1],i[2]),Vi(t[7],i[0],i[1],i[2]),this},copy:function(t){var e=this.min,r=this.max;return nu(e.array,t.min.array),nu(r.array,t.max.array),e._dirty=!0,r._dirty=!0,this},clone:function(){var t=new Lu;return t.copy(this),t}};const Ve=Lu;var R3=0,ui=De.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")+"_"+R3++),this.position||(this.position=new X),this.rotation||(this.rotation=new v2),this.scale||(this.scale=new X(1,1,1)),this.worldTransform=new et,this.localTransform=new et,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){V.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){V.copy(this.worldTransform.array,t.array),this.decomposeWorldTransform()},decomposeWorldTransform:function(){var t=V.create();return function(e){var r=this.localTransform,i=this.worldTransform;this._parent?(V.invert(t,this._parent.worldTransform.array),V.multiply(r.array,t,i.array)):V.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;V.fromRotationTranslation(i,e.array,t.array),V.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?V.multiplyAffine(e,this._parent.worldTransform.array,t):V.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 Ve,r=new et,i=new et;return function(n,a){return a=a||new Ve,this._parent?et.invert(i,this._parent.worldTransform):et.identity(i),this.traverse(function(o){o.geometry&&o.geometry.boundingBox&&(e.copy(o.geometry.boundingBox),et.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 X(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 X,e=new et;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 et;return function(e,r){t.lookAt(this.position,e,r||this.localTransform.y).invert(),this.setLocalTransform(t),this.target=e}}()}),$e=ui.extend({material:null,geometry:null,mode:B.TRIANGLES,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:B.BACK,frontFace:B.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=ui.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=ui.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}}()});$e.POINTS=B.POINTS;$e.LINES=B.LINES;$e.LINE_LOOP=B.LINE_LOOP;$e.LINE_STRIP=B.LINE_STRIP;$e.TRIANGLES=B.TRIANGLES;$e.TRIANGLE_STRIP=B.TRIANGLE_STRIP;$e.TRIANGLE_FAN=B.TRIANGLE_FAN;$e.BACK=B.BACK;$e.FRONT=B.FRONT;$e.FRONT_AND_BACK=B.FRONT_AND_BACK;$e.CW=B.CW;$e.CCW=B.CCW;var hg=De.extend({scene:null,camera:null,renderer:null},function(){this._ray=new Tf,this._ndc=new lr},{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 $e&&t.isRenderable()&&(!t.ignorePicking||r)&&(t.mode===B.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 X,e=new X,r=new X,i=new Tf,n=new et;return function(a,o){var s=a.isSkinnedMesh();i.copy(this._ray),et.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===B.BACK&&a.frontFace===B.CCW||a.cullFace===B.FRONT&&a.frontFace===B.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],R.set(w,0,0,0);for(var y=0;y<4;y++)T[y]>=0&&S[y]>1e-4&&(R.transformMat4(b,x,m[T[y]]),R.scaleAndAdd(w,w,b,S[y]));A.set(_,w)}}for(var _=0;_<v.length;_+=3){var C=v[_],E=v[_+1],D=v[_+2],L=s?l.attributes.skinnedPosition:c;if(L.get(C,t.array),L.get(E,e.array),L.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 X;s?X.copy(P,h):X.transformMat4(P,h,a.worldTransform),o.push(new hg.Intersection(h,P,a,[C,E,D],_/3,X.dist(P,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(t,e){return t.distance-e.distance}});hg.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};const P3=hg;var Zo="__dt__",ho=function(){this._contextId=0,this._caches=[],this._context={}};ho.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=Zo+t;this.put(e,!0)},dirtyAll:function(t){t=t||"";for(var e=Zo+t,r=this._caches,i=0;i<r.length;i++)r[i]&&(r[i][e]=!0)},fresh:function(t){t=t||"";var e=Zo+t;this.put(e,!1)},freshAll:function(t){t=t||"";for(var e=Zo+t,r=this._caches,i=0;i<r.length;i++)r[i]&&(r[i][e]=!1)},isDirty:function(t){t=t||"";var e=Zo+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)}};ho.prototype.constructor=ho;var bt=De.extend({width:512,height:512,type:B.UNSIGNED_BYTE,format:B.RGBA,wrapS:B.REPEAT,wrapT:B.REPEAT,minFilter:B.LINEAR_MIPMAP_LINEAR,magFilter:B.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},function(){this._cache=new ho},{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===B.DEPTH_COMPONENT&&(this.useMipmap=!1);var r=t.getGLExtension("EXT_sRGB");this.format===bt.SRGB&&!r&&(this.format=bt.RGB),this.format===bt.SRGB_ALPHA&&!r&&(this.format=bt.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?B.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?B.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var t=this.minFilter;return this.NPOT||!this.useMipmap?t===B.NEAREST_MIPMAP_NEAREST||t===B.NEAREST_MIPMAP_LINEAR?B.NEAREST:t===B.LINEAR_MIPMAP_LINEAR||t===B.LINEAR_MIPMAP_NEAREST?B.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(bt.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}});Object.defineProperty(bt.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}});bt.BYTE=B.BYTE;bt.UNSIGNED_BYTE=B.UNSIGNED_BYTE;bt.SHORT=B.SHORT;bt.UNSIGNED_SHORT=B.UNSIGNED_SHORT;bt.INT=B.INT;bt.UNSIGNED_INT=B.UNSIGNED_INT;bt.FLOAT=B.FLOAT;bt.HALF_FLOAT=36193;bt.UNSIGNED_INT_24_8_WEBGL=34042;bt.DEPTH_COMPONENT=B.DEPTH_COMPONENT;bt.DEPTH_STENCIL=B.DEPTH_STENCIL;bt.ALPHA=B.ALPHA;bt.RGB=B.RGB;bt.RGBA=B.RGBA;bt.LUMINANCE=B.LUMINANCE;bt.LUMINANCE_ALPHA=B.LUMINANCE_ALPHA;bt.SRGB=35904;bt.SRGB_ALPHA=35906;bt.COMPRESSED_RGB_S3TC_DXT1_EXT=33776;bt.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777;bt.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778;bt.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779;bt.NEAREST=B.NEAREST;bt.LINEAR=B.LINEAR;bt.NEAREST_MIPMAP_NEAREST=B.NEAREST_MIPMAP_NEAREST;bt.LINEAR_MIPMAP_NEAREST=B.LINEAR_MIPMAP_NEAREST;bt.NEAREST_MIPMAP_LINEAR=B.NEAREST_MIPMAP_LINEAR;bt.LINEAR_MIPMAP_LINEAR=B.LINEAR_MIPMAP_LINEAR;bt.REPEAT=B.REPEAT;bt.CLAMP_TO_EDGE=B.CLAMP_TO_EDGE;bt.MIRRORED_REPEAT=B.MIRRORED_REPEAT;const st=bt;var vr=$e.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=$e.prototype.clone.call(this);return t.skeleton=this.skeleton,this.joints&&(t.joints=this.joints.slice()),t}});vr.POINTS=B.POINTS;vr.LINES=B.LINES;vr.LINE_LOOP=B.LINE_LOOP;vr.LINE_STRIP=B.LINE_STRIP;vr.TRIANGLES=B.TRIANGLES;vr.TRIANGLE_STRIP=B.TRIANGLE_STRIP;vr.TRIANGLE_FAN=B.TRIANGLE_FAN;vr.BACK=B.BACK;vr.FRONT=B.FRONT;vr.FRONT_AND_BACK=B.FRONT_AND_BACK;vr.CW=B.CW;vr.CCW=B.CCW;const cg=vr;var ol={};ol.isPowerOfTwo=function(t){return(t&t-1)===0};ol.nextPowerOfTwo=function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t};ol.nearestPowerOfTwo=function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))};var yy=ol.isPowerOfTwo;function xy(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function I3(t,e){var r=xy(t.width),i=xy(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 vg=st.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===st.REPEAT||this.wrapT===st.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=B.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=I3(this,this._potCanvas),l=this._potCanvas),t.texImage2D(t.TEXTURE_2D,r,a,a,o,l)}else a<=st.COMPRESSED_RGBA_S3TC_DXT5_EXT&&a>=st.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 yy(this.width)&&yy(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=Lt.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(vg.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(vg.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)}});const Rt=vg;function d2(t){return{byte:Lt.Int8Array,ubyte:Lt.Uint8Array,short:Lt.Int16Array,ushort:Lt.Uint16Array}[t]||Lt.Float32Array}function Kc(t){return"attr_"+t}function co(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]}}}co.prototype.init=function(t){if(!this.value||this.value.length!==t*this.size){var e=d2(this.type);this.value=new e(t*this.size)}};co.prototype.fromArray=function(t){var e=d2(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};co.prototype.clone=function(t){var e=new co(this.name,this.type,this.size,this.semantic);return t&&console.warn("todo"),e};function p2(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 g2(t){this.buffer=t,this.count=0}var qe=De.extend(function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}},function(){this._cache=new ho,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(Kc(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?Lt.Uint32Array:Lt.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 co(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(Kc(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(Kc(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 p2(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 g2(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(qe.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(qe.prototype,"triangleCount",{enumerable:!1,get:function(){var t=this.indices;return t?t.length/3:0}}));qe.STATIC_DRAW=B.STATIC_DRAW;qe.DYNAMIC_DRAW=B.DYNAMIC_DRAW;qe.STREAM_DRAW=B.STREAM_DRAW;qe.AttributeBuffer=p2;qe.IndicesBuffer=g2;qe.Attribute=co;var ke=R.create,Ra=R.add,Rn=R.set,ei=qe.Attribute,Wt=qe.extend(function(){return{attributes:{position:new ei("position","float",3,"POSITION"),texcoord0:new ei("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new ei("texcoord1","float",2,"TEXCOORD_1"),normal:new ei("normal","float",3,"NORMAL"),tangent:new ei("tangent","float",4,"TANGENT"),color:new ei("color","float",4,"COLOR"),weight:new ei("weight","float",3,"WEIGHT"),joint:new ei("joint","float",4,"JOINT"),barycentric:new ei("barycentric","float",3,null)},boundingBox:null}},{mainAttribute:"position",updateBoundingBox:function(){var t=this.boundingBox;t||(t=this.boundingBox=new Ve);var e=this.attributes.position.value;if(e&&e.length){var r=t.min,i=t.max,n=r.array,a=i.array;R.set(n,e[0],e[1],e[2]),R.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 Lt.Float32Array(r.length);else for(var n=0;n<i.length;n++)i[n]=0;for(var a=ke(),o=ke(),s=ke(),l=ke(),u=ke(),f=ke(),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++),Rn(a,r[v*3],r[v*3+1],r[v*3+2]),Rn(o,r[c*3],r[c*3+1],r[c*3+2]),Rn(s,r[d*3],r[d*3+1],r[d*3+2]),R.sub(l,a,o),R.sub(u,o,s),R.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;)Rn(f,i[n],i[n+1],i[n+2]),R.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=ke(),a=ke(),o=ke(),s=ke(),l=ke(),u=ke();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++),Rn(n,r[h*3],r[h*3+1],r[h*3+2]),Rn(a,r[v*3],r[v*3+1],r[v*3+2]),Rn(o,r[c*3],r[c*3+1],r[c*3+2]),R.sub(s,n,a),R.sub(l,a,o),R.cross(u,s,l),R.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],C=i[d*3+1],E=i[p*3+1],D=i[c*3+2],L=i[d*3+2],P=i[p*3+2],N=w-T,I=b-T,k=C-A,O=E-A,U=L-D,z=P-D,nt=m-g,$=_-g,J=x-y,it=S-y,Pt=1/(nt*it-J*$);u[0]=(it*N-J*I)*Pt,u[1]=(it*k-J*O)*Pt,u[2]=(it*U-J*z)*Pt,f[0]=(nt*I-$*N)*Pt,f[1]=(nt*O-$*k)*Pt,f[2]=(nt*z-$*U)*Pt,Ra(o[c],o[c],u),Ra(o[d],o[d],u),Ra(o[p],o[p],u),Ra(s[c],s[c],f),Ra(s[d],s[d],f),Ra(s[p],s[p],f)}for(var pt=ke(),Bt=ke(),Xt=ke(),l=0;l<t;l++){Xt[0]=a[l*3],Xt[1]=a[l*3+1],Xt[2]=a[l*3+2];var Nt=o[l];R.scale(pt,Xt,R.dot(Xt,Nt)),R.sub(pt,Nt,pt),R.normalize(pt,pt),R.cross(Bt,Xt,Nt),n[l*4]=pt[0],n[l*4+1]=pt[1],n[l*4+2]=pt[2],n[l*4+3]=R.dot(Bt,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 Lt.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=V.create();V.invert(a,t),V.transpose(a,a);var o=R.transformMat4,s=R.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__)}});Wt.STATIC_DRAW=qe.STATIC_DRAW;Wt.DYNAMIC_DRAW=qe.DYNAMIC_DRAW;Wt.STREAM_DRAW=qe.STREAM_DRAW;Wt.AttributeBuffer=qe.AttributeBuffer;Wt.IndicesBuffer=qe.IndicesBuffer;Wt.Attribute=ei;const N3=`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 Fr="uniform vec3 ",$o="uniform float ",Pa="@export clay.header.",Ia="@end",be=":unconfigurable;";const O3=[Pa+"directional_light",Fr+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+be,Fr+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+be,Ia,Pa+"ambient_light",Fr+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+be,Ia,Pa+"ambient_sh_light",Fr+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+be,Fr+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+be,N3,Ia,Pa+"ambient_cubemap_light",Fr+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+be,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+be,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+be,Ia,Pa+"point_light",Fr+"pointLightPosition[POINT_LIGHT_COUNT]"+be,$o+"pointLightRange[POINT_LIGHT_COUNT]"+be,Fr+"pointLightColor[POINT_LIGHT_COUNT]"+be,Ia,Pa+"spot_light",Fr+"spotLightPosition[SPOT_LIGHT_COUNT]"+be,Fr+"spotLightDirection[SPOT_LIGHT_COUNT]"+be,$o+"spotLightRange[SPOT_LIGHT_COUNT]"+be,$o+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+be,$o+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+be,$o+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+be,Fr+"spotLightColor[SPOT_LIGHT_COUNT]"+be,Ia].join(`
`);G.import(O3);var Yr=ui.extend(function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}},{type:"",clone:function(){var t=ui.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}}),Ru=function(t,e){this.normal=t||new X(0,1,0),this.distance=e||0};Ru.prototype={constructor:Ru,distanceToPoint:function(t){return R.dot(t.array,this.normal.array)-this.distance},projectPoint:function(t,e){e||(e=new X);var r=this.distanceToPoint(t);return R.scaleAndAdd(e.array,t.array,this.normal.array,-r),e._dirty=!0,e},normalize:function(){var t=1/R.len(this.normal.array);R.scale(this.normal.array,t),this.distance*=t},intersectFrustum:function(t){for(var e=t.vertices,r=this.normal.array,i=R.dot(e[0].array,r)>this.distance,n=1;n<8;n++)if(R.dot(e[n].array,r)>this.distance!=i)return!0},intersectLine:function(){var t=R.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;R.sub(t,r.array,e.array),R.normalize(t,t);var u=R.dot(o,t);if(u===0)return null;i||(i=new X);var f=(R.dot(o,l)-s)/u;return R.scaleAndAdd(i.array,l,t,-f),i._dirty=!0,i}}(),applyTransform:function(){var t=V.create(),e=Z.create(),r=Z.create();return r[3]=1,function(i){i=i.array,R.scale(r,this.normal.array,this.distance),Z.transformMat4(r,r,i),this.distance=R.dot(r,this.normal.array),V.invert(t,i),V.transpose(t,t),e[3]=0,R.copy(e,this.normal.array),Z.transformMat4(e,e,t),R.copy(this.normal.array,e)}}(),copy:function(t){R.copy(this.normal.array,t.normal.array),this.normal._dirty=!0,this.distance=t.distance},clone:function(){var t=new Ru;return t.copy(this),t}};const m2=Ru;var le=R.set,Ty=R.copy,Sy=R.transformMat4,jc=Math.min,Qc=Math.max,_2=function(){this.planes=[];for(var t=0;t<6;t++)this.planes.push(new m2);this.boundingBox=new Ve,this.vertices=[];for(var t=0;t<8;t++)this.vertices[t]=R.fromValues(0,0,0)};_2.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];le(e[0].normal.array,o-i,f-s,d-h),e[0].distance=-(_-p),e[0].normalize(),le(e[1].normal.array,o+i,f+s,d+h),e[1].distance=-(_+p),e[1].normalize(),le(e[2].normal.array,o+n,f+l,d+v),e[2].distance=-(_+g),e[2].normalize(),le(e[3].normal.array,o-n,f-l,d-v),e[3].distance=-(_-g),e[3].normalize(),le(e[4].normal.array,o-a,f-u,d-c),e[4].distance=-(_-m),e[4].normalize(),le(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),le(x[0],-b*S,-b,w),le(x[1],-b*S,b,w),le(x[2],b*S,-b,w),le(x[3],b*S,b,w),le(x[4],-A*S,-A,T),le(x[5],-A*S,A,T),le(x[6],A*S,-A,T),le(x[7],A*S,A,T)}else{var C=(-1-p)/i,E=(1-p)/i,D=(1-g)/l,L=(-1-g)/l,P=(-1-m)/c,N=(1-m)/c;y.min.set(Math.min(C,E),Math.min(L,D),Math.min(N,P)),y.max.set(Math.max(E,C),Math.max(D,L),Math.max(P,N));var I=y.min.array,k=y.max.array;le(x[0],I[0],I[1],I[2]),le(x[1],I[0],k[1],I[2]),le(x[2],k[0],I[1],I[2]),le(x[3],k[0],k[1],I[2]),le(x[4],I[0],I[1],k[2]),le(x[5],I[0],k[1],k[2]),le(x[6],k[0],I[1],k[2]),le(x[7],k[0],k[1],k[2])}},getTransformedBoundingBox:function(){var t=R.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];Sy(t,u,n),Ty(s,t),Ty(l,t);for(var f=1;f<8;f++)u=i[f],Sy(t,u,n),s[0]=jc(t[0],s[0]),s[1]=jc(t[1],s[1]),s[2]=jc(t[2],s[2]),l[0]=Qc(t[0],l[0]),l[1]=Qc(t[1],l[1]),l[2]=Qc(t[2],l[2]);return a._dirty=!0,o._dirty=!0,e}}()};const dg=_2;var vo=ui.extend(function(){return{projectionMatrix:new et,invProjectionMatrix:new et,viewMatrix:new et,frustum:new dg}},function(){this.update(!0)},{update:function(t){ui.prototype.update.call(this,t),et.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),et.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(t){et.copy(this.viewMatrix,t),et.invert(this.worldTransform,t),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(t){et.copy(this.projectionMatrix,t),et.invert(this.invProjectionMatrix,t),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:function(){var t=Z.create();return function(e,r){var i=r!==void 0?r:new Tf,n=e.array[0],a=e.array[1];return Z.set(t,n,a,-1,1),Z.transformMat4(t,t,this.invProjectionMatrix.array),Z.transformMat4(t,t,this.worldTransform.array),R.scale(i.origin.array,t,1/t[3]),Z.set(t,n,a,1,1),Z.transformMat4(t,t,this.invProjectionMatrix.array),Z.transformMat4(t,t,this.worldTransform.array),R.scale(t,t,1/t[3]),R.sub(i.direction.array,t,i.origin.array),R.normalize(i.direction.array,i.direction.array),i.direction._dirty=!0,i.origin._dirty=!0,i}}()}),B3=V.create(),wy=V.create(),Jc={};function F3(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(Jc[a])return Jc[a];var o=ue.genGUID();return Jc[a]=o,o}function fh(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}fh.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0};fh.prototype.add=function(t,e){e?this.transparent[this._transparentCount++]=t:this.opaque[this._opaqueCount++]=t};fh.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var on=ui.extend(function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new Ve,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new o2(20)}},function(){this._scene=this},{addToScene:function(t){t instanceof vo?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(t)):t instanceof Yr&&this.lights.push(t),t.name&&(this._nodeRepository[t.name]=t)},removeFromScene:function(t){var e;t instanceof vo?(e=this._cameraList.indexOf(t),e>=0&&this._cameraList.splice(e,1)):t instanceof Yr&&(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]=F3(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 fh,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()?B3:o.worldTransform.array,l=o.geometry;V.multiplyAffine(wy,e.viewMatrix.array,s),(n&&!l.boundingBox||!this.isFrustumCulled(o,e,wy))&&i.add(o,o.material.transparent||r)}o._children.length>0&&this._doUpdateRenderList(o,e,r,i,n)}},isFrustumCulled:function(){var t=new Ve,e=new et;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(k3);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 k3(t,e){if(e.castShadow&&!t.castShadow)return!0}var au=ol.isPowerOfTwo,z3=["px","nx","py","ny","pz","nz"],sa=st.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=B.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=z3[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?au(this.image.px.width)&&au(this.image.px.height):au(this.width)&&au(this.height)},isRenderable:function(){return this.image.px?Na(this.image.px)&&Na(this.image.nx)&&Na(this.image.py)&&Na(this.image.ny)&&Na(this.image.pz)&&Na(this.image.nz):!!(this.width&&this.height)},load:function(t,e){var r=0,i=this;return ue.each(t,function(n,a){var o=Lt.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(sa.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(sa.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 Na(t){return t.width>0&&t.height>0}var U3=vo.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=vo.prototype.clone.call(this);return t.fov=this.fov,t.aspect=this.aspect,t.near=this.near,t.far=this.far,t}});const xe=U3;var ou="framebuffer",xi="renderbuffer",by=xi+"_width",Ay=xi+"_height",tv=xi+"_attached",ev="depthtexture_attached",Pn=B.FRAMEBUFFER,qo=B.RENDERBUFFER,us=B.DEPTH_ATTACHMENT,y2=B.COLOR_ATTACHMENT0,_e=De.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new ho,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(Pn,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(ev)&&this.depthBuffer){r.miss(xi)&&r.put(xi,e.createRenderbuffer());var f=r.get(xi);(n!==r.get(by)||a!==r.get(Ay))&&(e.bindRenderbuffer(qo,f),e.renderbufferStorage(qo,e.DEPTH_COMPONENT16,n,a),r.put(by,n),r.put(Ay,a),e.bindRenderbuffer(qo,null)),r.get(tv)||(e.framebufferRenderbuffer(Pn,us,qo,f),r.put(tv,!0))}},unbind:function(t){t.__currentFrameBuffer=null;var e=t.gl;e.bindFramebuffer(Pn,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===st.LINEAR_MIPMAP_LINEAR){var a=n.textureType==="textureCube"?B.TEXTURE_CUBE_MAP:B.TEXTURE_2D;e.bindTexture(a,n.getWebGLTexture(t)),e.generateMipmap(a),e.bindTexture(a,null)}}}},checkStatus:function(t){return t.checkFramebufferStatus(Pn)},_getFrameBufferGL:function(t){var e=this._cache;return e.use(t.__uid__),e.miss(ou)&&e.put(ou,t.gl.createFramebuffer()),e.get(ou)},attach:function(t,e,r){if(!t.width)throw new Error("The texture attached to color buffer is not a valid.");e=e||y2,r=r||B.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===us||r===B.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!==B.DEPTH_COMPONENT&&e.format!==B.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l){var f=this._cache.get(xi);f&&(n.framebufferRenderbuffer(Pn,us,qo,null),n.deleteRenderbuffer(f),this._cache.put(xi,!1)),this._cache.put(tv,!1),this._cache.put(ev,!0)}}return n.framebufferTexture2D(Pn,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(Pn,e,r,null,0);var i=this._cache.get("attached_textures");i&&i[e]&&(i[e]=null),(e===us||e===B.DEPTH_STENCIL_ATTACHMENT)&&this._cache.put(ev,!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(xi);i&&e.deleteRenderbuffer(i);var n=r.get(ou);n&&e.deleteFramebuffer(n),r.deleteContext(t.__uid__),this._textures={}}});_e.DEPTH_ATTACHMENT=us;_e.COLOR_ATTACHMENT0=y2;_e.STENCIL_ATTACHMENT=B.STENCIL_ATTACHMENT;_e.DEPTH_STENCIL_ATTACHMENT=B.DEPTH_STENCIL_ATTACHMENT;var H3=["px","nx","py","ny","pz","nz"],pg=De.extend(function(){var t={position:new X,far:1e3,near:.1,texture:null,shadowMapPass:null},e=t._cameras={px:new xe({fov:90}),nx:new xe({fov:90}),py:new xe({fov:90}),ny:new xe({fov:90}),pz:new xe({fov:90}),nz:new xe({fov:90})};return e.px.lookAt(X.POSITIVE_X,X.NEGATIVE_Y),e.nx.lookAt(X.NEGATIVE_X,X.NEGATIVE_Y),e.py.lookAt(X.POSITIVE_Y,X.POSITIVE_Z),e.ny.lookAt(X.NEGATIVE_Y,X.NEGATIVE_Z),e.pz.lookAt(X.POSITIVE_Z,X.NEGATIVE_Y),e.nz.lookAt(X.NEGATIVE_Z,X.NEGATIVE_Y),t._frameBuffer=new _e,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=H3[o],l=this._cameras[s];if(X.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)}}),V3=Wt.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 Ve,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}});const gg=V3;var ee=new et,G3=Wt.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},function(){this.build()},{build:function(){var t={px:Oa("px",this.depthSegments,this.heightSegments),nx:Oa("nx",this.depthSegments,this.heightSegments),py:Oa("py",this.widthSegments,this.depthSegments),ny:Oa("ny",this.widthSegments,this.depthSegments),pz:Oa("pz",this.widthSegments,this.heightSegments),nz:Oa("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 Lt.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 Ve,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function Oa(t,e,r){ee.identity();var i=new gg({widthSegments:e,heightSegments:r});switch(t){case"px":et.translate(ee,ee,X.POSITIVE_X),et.rotateY(ee,ee,Math.PI/2);break;case"nx":et.translate(ee,ee,X.NEGATIVE_X),et.rotateY(ee,ee,-Math.PI/2);break;case"py":et.translate(ee,ee,X.POSITIVE_Y),et.rotateX(ee,ee,-Math.PI/2);break;case"ny":et.translate(ee,ee,X.NEGATIVE_Y),et.rotateX(ee,ee,Math.PI/2);break;case"pz":et.translate(ee,ee,X.POSITIVE_Z);break;case"nz":et.translate(ee,ee,X.NEGATIVE_Z),et.rotateY(ee,ee,Math.PI);break}return i.applyTransform(ee),i}const x2=G3,W3=`@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`;G.import(W3);var X3=cg.extend(function(){var t=new G({vertex:G.source("clay.skybox.vertex"),fragment:G.source("clay.skybox.fragment")}),e=new Ri({shader:t,depthMask:!1});return{scene:null,geometry:new x2,material:e,environmentMap:null,culling:!1,_dummyCamera:new xe}},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=st.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(),et.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)}});const Ws=X3;var Y3=542327876,Z3=131072,$3=512,q3=4;function mg(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}var K3=31,j3=mg("DXT1"),Q3=mg("DXT3"),J3=mg("DXT5"),tB=0,eB=1,rB=2,iB=3,nB=4,aB=7,oB=20,sB=21,lB=28,uB={parse:function(t,e){var r=new Int32Array(t,0,K3);if(r[tB]!==Y3||!r(oB)&q3)return null;var i=r(sB),n=r[nB],a=r[iB],o=r[lB]&$3,s=r[rB]&Z3,l,u;switch(i){case j3:l=8,u=st.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Q3:l=16,u=st.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case J3:l=16,u=st.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var f=r[eB]+4,h=o?6:1,v=1;s&&(v=Math.max(1,r[aB]));for(var c=[],d=0;d<h;d++){var p=n,g=a;c[d]=new Rt({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,fB=8,hB=32767;function cB(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 vB(t,e,r){for(var i="",n=e;n<r;n++)i+=Pu(t[n]);return i}function dB(t,e){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]}function Ey(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--)dB(t[a-1],t[a]),a++,o--;n+=8}else a++,o--,n=0;return r}function pB(t,e,r,i){if(i<fB|i>hB)return Ey(t,e,r,i);var n=e[r++];if(n!=2)return Ey(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 gB={parseRGBE:function(t,e,r){r==null&&(r=0);var i=new Uint8Array(t),n=i.length;if(vB(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=pB(v,i,h,f);if(!h)return null;for(var c=0;c<f;c++)cB(v[c],p,g,r),g+=4}return e||(e=new Rt),e.width=f,e.height=u,e.pixels=p,e.type=st.FLOAT,e}}}},parseRGBEFromPNG:function(t){}};const mB=gB;var Iu={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 Rt({width:0,height:0,sRGB:!1}),Iu._fetchTexture(t,function(a){mB.parseRGBE(a,n,e.exposure),n.dirty(),r&&r(n)},i),n;t.match(/.dds$/)||e.fileType==="dds"?(n=new Rt({width:0,height:0}),Iu._fetchTexture(t,function(a){uB.parse(a,n),n.dirty(),r&&r(n)},i)):(n=new Rt,n.load(t),n.success(r),n.error(i))}else typeof t=="object"&&typeof t.px<"u"&&(n=new sa,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||{},Iu.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 pg,a=new Ws({scene:new on});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){Lt.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 Rt({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 Rt({image:e});return i}};const ra=Iu;var Dd=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function Ld(t){return"_on"+t}var Rd=function(t){var e=this;this._texture=new Rt({anisotropic:32,flipY:!1,surface:this,dispose:function(r){e.dispose(),Rt.prototype.dispose.call(this,r)}}),Dd.forEach(function(r){this[Ld(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};Rd.prototype={constructor:Rd,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 X,e=new X,r=new X,i=new lr,n=new lr,a=new lr,o=new lr,s=new X;return function(l,u,f,h){var v=u.geometry,c=v.attributes.position,d=v.attributes.texcoord0,p=X.dot,g=X.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;lr.scale(o,i,_),lr.scaleAndAdd(o,o,n,y),lr.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||(Dd.forEach(function(e){t.on(e,this[Ld(e)],this)},this),this._meshes.push(t))},detachFromMesh:function(t){var e=this._meshes.indexOf(t);e>=0&&this._meshes.splice(e,1),Dd.forEach(function(r){t.off(r,this[Ld(r)])},this)},dispose:function(){this._meshes.forEach(function(t){this.detachFromMesh(t)},this)}};var _B=vo.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=vo.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 Xs=_B,yB=`
@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`;G.import(yB);var xB=new gg,Cy=new cg({geometry:xB,frustumCulling:!1}),TB=new Xs,We=De.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var t=new G(G.source("clay.compositor.vertex"),this.fragment),e=new Ri({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||B.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){Cy.material=this.material,t.renderPass([Cy],TB)},dispose:function(t){}});const SB=`#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);
}
`,wB=`#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 fi={},rv=["px","nx","py","ny","pz","nz"];fi.prefilterEnvironmentMap=function(t,e,r,i,n){(!n||!i)&&(i=fi.generateNormalDistribution(),n=fi.integrateBRDF(t,i)),r=r||{};var a=r.width||64,o=r.height||64,s=r.type||e.type,l=new sa({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 Ri({shader:new G({vertex:G.source("clay.skybox.vertex"),fragment:wB})});h.set("normalDistribution",i),r.encodeRGBM&&h.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&h.define("fragment","RGBM_DECODE");var v=new on,c;if(e.textureType==="texture2D"){var d=new sa({width:a,height:o,type:s===st.FLOAT?st.HALF_FLOAT:s});ra.panoramaToCubeMap(t,e,d,{encodeRGBM:r.decodeRGBM}),e=d}c=new Ws({scene:v,material:h}),c.material.set("environmentMap",e);var p=new pg({texture:l});r.encodeRGBM&&(s=l.type=st.UNSIGNED_BYTE);for(var g=new Rt({width:a,height:o,type:s}),m=new _e({depthBuffer:!1}),_=Lt[s===st.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<rv.length;T++){var w=new _(g.width*g.height*4);m.attach(g),m.bind(t);var b=p.getCamera(rv[T]);b.fov=S,t.render(v,b),t.gl.readPixels(0,0,g.width,g.height,st.RGBA,s,w),m.unbind(t),l.mipmaps[y].pixels[rv[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}};fi.integrateBRDF=function(t,e){e=e||fi.generateNormalDistribution();var r=new _e({depthBuffer:!1}),i=new We({fragment:SB}),n=new Rt({width:512,height:256,type:st.HALF_FLOAT,wrapS:st.CLAMP_TO_EDGE,wrapT:st.CLAMP_TO_EDGE,minFilter:st.NEAREST,magFilter:st.NEAREST,useMipmap:!1});return i.setUniform("normalDistribution",e),i.setUniform("viewportSize",[512,256]),i.attachOutput(n),i.render(t,r),r.dispose(t),n};fi.generateNormalDistribution=function(r,i){for(var r=r||256,i=i||1024,n=new Rt({width:r,height:i,type:st.FLOAT,minFilter:st.NEAREST,magFilter:st.NEAREST,wrapS:st.CLAMP_TO_EDGE,wrapT:st.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 bB=Yr.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=fi.generateNormalDistribution(),this._brdfLookup=fi.integrateBRDF(t,this._normalDistribution));var r=this.cubemap;if(!r.__prefiltered){var i=fi.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}}}});const AB=bB;var EB=Yr.extend({castShadow:!1,coefficients:[]},function(){this._coefficientsTmpArr=new Lt.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}}}});const CB=EB;var T2={},qn=["px","nx","py","ny","pz","nz"];function MB(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 DB={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 LB(t,e,r,i){for(var n=new Lt.Float32Array(27),a=R.create(),o=R.create(),s=R.create(),l=0;l<9;l++){for(var u=R.create(),f=0;f<qn.length;f++){for(var h=e[qn[f]],v=R.create(),c=0,d=0,p=DB[qn[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,R.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]*=_,R.scaleAndAdd(v,v,o,MB(s,l)*-a[2]),c+=-a[2]}R.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}T2.projectEnvironmentMap=function(t,e,r){r=r||{},r.lod=r.lod||0;var i,n=new on,a=64;e.textureType==="texture2D"?i=new Ws({scene:n,environmentMap:e}):(a=e.image&&e.image.px?e.image.px.width:e.width,i=new Ws({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 Rt({width:o,height:s}),u=new _e;i.material.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&i.material.define("fragment","RGBM_DECODE"),i.material.set("lod",r.lod);for(var f=new pg({texture:l}),h={},v=0;v<qn.length;v++){h[qn[v]]=new Uint8Array(o*s*4);var c=f.getCamera(qn[v]);c.fov=90,u.attach(l),u.bind(t),t.render(n,c),t.gl.readPixels(0,0,o,s,st.RGBA,st.UNSIGNED_BYTE,h[qn[v]]),u.unbind(t)}return i.dispose(t),u.dispose(t),l.dispose(t),LB(t,h,o,s)};var Cr={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 Y(e.dataIndex)?j(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return Y(e.name)?j(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}},RB=Wt.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,C,E,D=e+1,L=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,C=(d+1)*D+c,s[L++]=b,s[L++]=A,s[L++]=E,s[L++]=A,s[L++]=C,s[L++]=E;this.boundingBox=new Ve,this.boundingBox.max.set(y,y,y),this.boundingBox.min.set(-y,-y,-y)}});const PB=RB;var IB=Yr.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]}}}});const NB=IB;var OB=Yr.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 X,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=Yr.prototype.clone.call(this);return t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}});const BB=OB;var FB=Yr.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=Yr.prototype.clone.call(this);return t.range=this.range,t}});const kB=FB;var zB=Yr.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 X,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=Yr.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}});const UB=zB;var At=function(t,e,r,i){t=t||0,e=e||0,r=r||0,i=i||0,this.array=Z.fromValues(t,e,r,i),this._dirty=!0};At.prototype={constructor:At,add:function(t){return Z.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 At(this.x,this.y,this.z,this.w)},copy:function(t){return Z.copy(this.array,t.array),this._dirty=!0,this},dist:function(t){return Z.dist(this.array,t.array)},distance:function(t){return Z.distance(this.array,t.array)},div:function(t){return Z.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return Z.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return Z.dot(this.array,t.array)},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},min:function(t){return Z.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return Z.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return Z.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return Z.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return Z.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return Z.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return Z.random(this.array,t),this._dirty=!0,this},scale:function(t){return Z.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return Z.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return Z.sqrDist(this.array,t.array)},squaredDistance:function(t){return Z.squaredDistance(this.array,t.array)},sqrLen:function(){return Z.sqrLen(this.array)},squaredLength:function(){return Z.squaredLength(this.array)},sub:function(t){return Z.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return Z.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return Z.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return Z.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 Ko=Object.defineProperty;if(Ko){var su=At.prototype;Ko(su,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Ko(su,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),Ko(su,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),Ko(su,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}At.add=function(t,e,r){return Z.add(t.array,e.array,r.array),t._dirty=!0,t};At.set=function(t,e,r,i,n){Z.set(t.array,e,r,i,n),t._dirty=!0};At.copy=function(t,e){return Z.copy(t.array,e.array),t._dirty=!0,t};At.dist=function(t,e){return Z.distance(t.array,e.array)};At.distance=At.dist;At.div=function(t,e,r){return Z.divide(t.array,e.array,r.array),t._dirty=!0,t};At.divide=At.div;At.dot=function(t,e){return Z.dot(t.array,e.array)};At.len=function(t){return Z.length(t.array)};At.lerp=function(t,e,r,i){return Z.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};At.min=function(t,e,r){return Z.min(t.array,e.array,r.array),t._dirty=!0,t};At.max=function(t,e,r){return Z.max(t.array,e.array,r.array),t._dirty=!0,t};At.mul=function(t,e,r){return Z.multiply(t.array,e.array,r.array),t._dirty=!0,t};At.multiply=At.mul;At.negate=function(t,e){return Z.negate(t.array,e.array),t._dirty=!0,t};At.normalize=function(t,e){return Z.normalize(t.array,e.array),t._dirty=!0,t};At.random=function(t,e){return Z.random(t.array,e),t._dirty=!0,t};At.scale=function(t,e,r){return Z.scale(t.array,e.array,r),t._dirty=!0,t};At.scaleAndAdd=function(t,e,r,i){return Z.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};At.sqrDist=function(t,e){return Z.sqrDist(t.array,e.array)};At.squaredDistance=At.sqrDist;At.sqrLen=function(t){return Z.sqrLen(t.array)};At.squaredLength=At.sqrLen;At.sub=function(t,e,r){return Z.subtract(t.array,e.array,r.array),t._dirty=!0,t};At.subtract=At.sub;At.transformMat4=function(t,e,r){return Z.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};At.transformQuat=function(t,e,r){return Z.transformQuat(t.array,e.array,r.array),t._dirty=!0,t};const HB=At;var Oe={};Oe.create=function(){var t=new Ee(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t};Oe.clone=function(t){var e=new Ee(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e};Oe.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};Oe.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t};Oe.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};Oe.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};Oe.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};Oe.determinant=function(t){return t[0]*t[3]-t[2]*t[1]};Oe.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};Oe.mul=Oe.multiply;Oe.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};Oe.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};Oe.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))};Oe.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]};const ne=Oe;var Ye=function(){this.array=ne.create(),this._dirty=!0};Ye.prototype={constructor:Ye,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 Ye().copy(this)},copy:function(t){return ne.copy(this.array,t.array),this._dirty=!0,this},adjoint:function(){return ne.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return ne.determinant(this.array)},identity:function(){return ne.identity(this.array),this._dirty=!0,this},invert:function(){return ne.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return ne.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return ne.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return ne.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return ne.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return ne.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return ne.scale(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return ne.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)}};Ye.adjoint=function(t,e){return ne.adjoint(t.array,e.array),t._dirty=!0,t};Ye.copy=function(t,e){return ne.copy(t.array,e.array),t._dirty=!0,t};Ye.determinant=function(t){return ne.determinant(t.array)};Ye.identity=function(t){return ne.identity(t.array),t._dirty=!0,t};Ye.invert=function(t,e){return ne.invert(t.array,e.array),t._dirty=!0,t};Ye.mul=function(t,e,r){return ne.mul(t.array,e.array,r.array),t._dirty=!0,t};Ye.multiply=Ye.mul;Ye.rotate=function(t,e,r){return ne.rotate(t.array,e.array,r),t._dirty=!0,t};Ye.scale=function(t,e,r){return ne.scale(t.array,e.array,r.array),t._dirty=!0,t};Ye.transpose=function(t,e){return ne.transpose(t.array,e.array),t._dirty=!0,t};const VB=Ye;var ar={};ar.create=function(){var t=new Ee(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t};ar.clone=function(t){var e=new Ee(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};ar.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};ar.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t};ar.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};ar.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};ar.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};ar.mul=ar.multiply;ar.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};ar.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};ar.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};ar.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)};const fe=ar;var rr=function(){this.array=fe.create(),this._dirty=!0};rr.prototype={constructor:rr,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 rr().copy(this)},copy:function(t){return fe.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return fe.determinant(this.array)},identity:function(){return fe.identity(this.array),this._dirty=!0,this},invert:function(){return fe.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return fe.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return fe.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return fe.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return fe.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return fe.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return fe.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return fe.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)}};rr.copy=function(t,e){return fe.copy(t.array,e.array),t._dirty=!0,t};rr.determinant=function(t){return fe.determinant(t.array)};rr.identity=function(t){return fe.identity(t.array),t._dirty=!0,t};rr.invert=function(t,e){return fe.invert(t.array,e.array),t._dirty=!0,t};rr.mul=function(t,e,r){return fe.mul(t.array,e.array,r.array),t._dirty=!0,t};rr.multiply=rr.mul;rr.rotate=function(t,e,r){return fe.rotate(t.array,e.array,r),t._dirty=!0,t};rr.scale=function(t,e,r){return fe.scale(t.array,e.array,r.array),t._dirty=!0,t};rr.translate=function(t,e,r){return fe.translate(t.array,e.array,r.array),t._dirty=!0,t};const GB=rr;var ge=function(){this.array=Tt.create(),this._dirty=!0};ge.prototype={constructor:ge,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 Tt.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return new ge().copy(this)},copy:function(t){return Tt.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return Tt.determinant(this.array)},fromMat2d:function(t){return Tt.fromMat2d(this.array,t.array),this._dirty=!0,this},fromMat4:function(t){return Tt.fromMat4(this.array,t.array),this._dirty=!0,this},fromQuat:function(t){return Tt.fromQuat(this.array,t.array),this._dirty=!0,this},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},translate:function(t){return Tt.translate(this.array,this.array,t.array),this._dirty=!0,this},normalFromMat4:function(t){return Tt.normalFromMat4(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)}};ge.adjoint=function(t,e){return Tt.adjoint(t.array,e.array),t._dirty=!0,t};ge.copy=function(t,e){return Tt.copy(t.array,e.array),t._dirty=!0,t};ge.determinant=function(t){return Tt.determinant(t.array)};ge.identity=function(t){return Tt.identity(t.array),t._dirty=!0,t};ge.invert=function(t,e){return Tt.invert(t.array,e.array),t};ge.mul=function(t,e,r){return Tt.mul(t.array,e.array,r.array),t._dirty=!0,t};ge.multiply=ge.mul;ge.fromMat2d=function(t,e){return Tt.fromMat2d(t.array,e.array),t._dirty=!0,t};ge.fromMat4=function(t,e){return Tt.fromMat4(t.array,e.array),t._dirty=!0,t};ge.fromQuat=function(t,e){return Tt.fromQuat(t.array,e.array),t._dirty=!0,t};ge.normalFromMat4=function(t,e){return Tt.normalFromMat4(t.array,e.array),t._dirty=!0,t};ge.rotate=function(t,e,r){return Tt.rotate(t.array,e.array,r),t._dirty=!0,t};ge.scale=function(t,e,r){return Tt.scale(t.array,e.array,r.array),t._dirty=!0,t};ge.transpose=function(t,e){return Tt.transpose(t.array,e.array),t._dirty=!0,t};ge.translate=function(t,e,r){return Tt.translate(t.array,e.array,r.array),t._dirty=!0,t};const WB=ge;var XB={_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 Bf(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 YB=XB,ZB=`
@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`,$B=`
@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
`,qB=`@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`,KB=`/**
 * 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`,jB=`@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`,QB=`@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
`,JB=`@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(ui.prototype,YB);G.import(ZB);G.import(c2);G.import($B);G.import(qB);G.import(KB);G.import(jB);G.import(QB);G.import(JB);function tF(t){return!t||t==="none"}function S2(t){return t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof Image}function eF(t){return t.getZr&&t.setOption}var rF=on.prototype.addToScene,iF=on.prototype.removeFromScene;on.prototype.addToScene=function(t){if(rF.call(this,t),this.__zr){var e=this.__zr;t.traverse(function(r){r.__zr=e,r.addAnimatorsToZr&&r.addAnimatorsToZr(e)})}};on.prototype.removeFromScene=function(t){iF.call(this,t),t.traverse(function(e){var r=e.__zr;e.__zr=null,r&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(r)})};Ri.prototype.setTextureImage=function(t,e,r,i){if(this.shader){var n=r.getZr(),a=this,o;return a.autoUpdateTextureStatus=!1,a.disableTexture(t),tF(e)||(o=F.loadTexture(e,r,i,function(s){a.enableTexture(t),n&&n.refresh()}),a.set(t,o)),o}};var F={};F.Renderer=As;F.Node=ui;F.Mesh=cg;F.Shader=G;F.Material=Ri;F.Texture=st;F.Texture2D=Rt;F.Geometry=Wt;F.SphereGeometry=PB;F.PlaneGeometry=gg;F.CubeGeometry=x2;F.AmbientLight=NB;F.DirectionalLight=BB;F.PointLight=kB;F.SpotLight=UB;F.PerspectiveCamera=xe;F.OrthographicCamera=Xs;F.Vector2=lr;F.Vector3=X;F.Vector4=HB;F.Quaternion=v2;F.Matrix2=VB;F.Matrix2d=GB;F.Matrix3=WB;F.Matrix4=et;F.Plane=m2;F.Ray=Tf;F.BoundingBox=Ve;F.Frustum=dg;var lu=null;function nF(){return lu!==null||(lu=ra.createBlank("rgba(255,255,255,0)").image),lu}function My(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function Dy(t){if((t.wrapS===st.REPEAT||t.wrapT===st.REPEAT)&&t.image){var e=My(t.width),r=My(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}}}F.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 _o(20);if(eF(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 Rd(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(S2(t)){var l=t.__textureid__,u=s.get(a+l);if(!u){u={texture:new F.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),Dy(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=ra.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 F.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,Dy(h),h.dirty(),u.callbacks.forEach(function(p){p&&p(h)}),u.callbacks=null},v.crossOrigin="Anonymous",v.src=t,h.image=nF(),s.put(a+t,u)}return u.texture}};F.createAmbientCubemap=function(t,e,r,i){t=t||{};var n=t.texture,a=Cr.firstNotNull(t.exposure,1),o=new AB({intensity:Cr.firstNotNull(t.specularIntensity,1)}),s=new CB({intensity:Cr.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=F.loadTexture(n,r,{exposure:a},function(){o.cubemap.flipY=!1,o.prefilter(e,32),s.coefficients=T2.projectEnvironmentMap(e,o.cubemap,{lod:1}),i&&i()}),{specular:o,diffuse:s}};F.createBlankTexture=ra.createBlank;F.isImage=S2;F.additiveBlend=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)};F.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=Xe(t||"#000",e)||[0,0,0,0],e[0]/=255,e[1]/=255,e[2]/=255,e)};F.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};F.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};F.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"];F.createShader=function(t){t==="ecgl.shadow"&&(t="ecgl.displayShadow");var e=G.source(t+".vertex"),r=G.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 G(e,r);return i.name=t,i};F.createMaterial=function(t,e){e instanceof Array||(e=[e]);var r=F.createShader(t),i=new Ri({shader:r});return e.forEach(function(n){typeof n=="string"&&i.define(n)}),i};F.setMaterialFromModel=function(t,e,r,i){e.autoUpdateTextureStatus=!1;var n=r.getModel(t+"Material"),a=n.get("detailTexture"),o=Cr.firstNotNull(n.get("textureTiling"),1),s=Cr.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?F.Texture.REPEAT:F.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=Cr.firstNotNull(n.get("metalnessAdjust"),.5)):h=0,f!=null?isNaN(f)&&(e.setTextureImage("roughnessMap",f,i,u),f=Cr.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:F.Texture.REPEAT,wrapT:F.Texture.REPEAT});e.set({detailUvRepeat:o,detailUvOffset:s})}};F.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 Gt=function(t,e){this.id=t,this.zr=e;try{this.renderer=new As({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 P3({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new ie({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null,this._disposed=!1};Gt.prototype.setUnpainted=function(){};Gt.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 w2(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)}Gt.prototype.removeView=function(t){if(t.layer===this){var e=this.views.indexOf(t);e>=0&&(this.views.splice(e,1),t.scene.traverse(w2,this),t.layer=null,this._viewsToDispose.push(t))}};Gt.prototype.removeViewsAll=function(){this.views.forEach(function(t){t.scene.traverse(w2,this),t.layer=null,this._viewsToDispose.push(t)},this),this.views.length=0};Gt.prototype.resize=function(t,e){var r=this.renderer;r.resize(t,e)};Gt.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)};Gt.prototype.clearDepth=function(){var t=this.renderer.gl;t.clear(t.DEPTH_BUFFER_BIT)};Gt.prototype.clearColor=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)};Gt.prototype.needsRefresh=function(){this.zr.refresh()};Gt.prototype.refresh=function(t){this._backgroundColor=t?F.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()};Gt.prototype.renderToCanvas=function(t){this._startAccumulating(!0),t.drawImage(this.dom,0,0,t.canvas.width,t.canvas.height)};Gt.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()};Gt.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var aF=1;Gt.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):Uu(function(){n(a)}))}}this._accumulatingId=aF++,t?n(e._accumulatingId):this._accumulatingTimeout=setTimeout(function(){n(e._accumulatingId)},50)};Gt.prototype._trackAndClean=function(){var t=[],e=[];this._textureList&&(Sf(this._textureList),Sf(this._geometriesList));for(var r=0;r<this.views.length;r++)oF(this.views[r].scene,t,e);this._textureList&&(wf(this.renderer,this._textureList),wf(this.renderer,this._geometriesList)),this._textureList=t,this._geometriesList=e};function Sf(t){for(var e=0;e<t.length;e++)t[e].__used__=0}function wf(t,e){for(var r=0;r<e.length;r++)e[r].__used__||e[r].dispose(t)}function uu(t,e){t.__used__=t.__used__||0,t.__used__++,t.__used__===1&&e.push(t)}function oF(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 st)uu(v,e);else if(v instanceof Array)for(var c=0;c<v.length;c++)v[c]instanceof st&&uu(v[c],e)}}s!==n&&uu(s,r),i=l,n=s}});for(var a=0;a<t.lights.length;a++)t.lights[a].cubemap&&uu(t.lights[a].cubemap,e)}Gt.prototype.dispose=function(){this._disposed||(this._stopAccumulating(),this._textureList&&(Sf(this._textureList),Sf(this._geometriesList),wf(this.renderer,this._textureList),wf(this.renderer,this._geometriesList)),this.zr.off("globalout",this.onglobalout),this._disposed=!0)};Gt.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}};Gt.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)}};Gt.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}};Gt.prototype.onclick=Gt.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()}}}};Gt.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};Gt.prototype.onglobalout=function(t){var e=this._hovered;e&&this._dispatchEvent("mouseout",t,{target:e.target})};Gt.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]};Gt.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)};Gt.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=Ft(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))};Gt.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(Gt.prototype,fg);const b2=Gt;var sF=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function fs(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 lF(t){fs(t,"itemStyle"),fs(t,"lineStyle"),fs(t,"areaStyle"),fs(t,"label")}function fu(t){t&&(t instanceof Array||(t=[t]),M(t,function(e){if(e.axisLabel){var r=e.axisLabel;Object.assign(r,r.textStyle),r.textStyle=null}}))}function uF(t){M(t.series,function(e){Ct(sF,e.type)>=0&&(lF(e),e.coordinateSystem==="mapbox"&&(e.coordinateSystem="mapbox3D",t.mapbox3D=t.mapbox))}),fu(t.xAxis3D),fu(t.yAxis3D),fu(t.zAxis3D),fu(t.grid3D),fs(t.geo3D)}function A2(t){this._layers={},this._zr=t}A2.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 b2("gl-"+l,i),i.painter.isSingleCanvas()){f.virtual=!0;var h=new Pr({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"))}})};nw(function(t){var e=t.getZr(),r=e.painter.dispose;e.painter.dispose=function(){typeof this.eachOtherLayer=="function"&&this.eachOtherLayer(function(i){i instanceof b2&&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}});aw(function(t,e){var r=e.getZr(),i=r.__egl=r.__egl||new A2(r);i.update(t,e)});qp(uF);const fF={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)}},hF={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"}}},cF={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 hh=Ht.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}}});vt(hh.prototype,fF);vt(hh.prototype,hF);vt(hh.prototype,cF);const vF=hh;var jo=Cr.firstNotNull,Ly={left:0,middle:1,right:2};function Ry(t){return t instanceof Array||(t=[t,t]),t}var E2=De.extend(function(){return{zr:null,viewGL:null,_center:new X,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 lr,_panVelocity:new lr,_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]]=jo(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]=jo(t.get(v),s&&s.get(v))});var u=jo(e.alpha,t.get("alpha"))||0,f=jo(e.beta,t.get("beta"))||0,h=jo(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 X,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===Ly[this.rotateMouseButton]?this._mode="rotate":t.event.button===Ly[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=Ry(this.panSensitivity),r=Ry(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(E2.prototype,"autoRotate",{get:function(t){return this._autoRotate},set:function(t){this._autoRotate=t,this._rotating=t}});const dF=E2,_g={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()}},ch={vec2:tt,vec3:R,vec4:Z,mat2:ne,mat2d:fe,mat3:Tt,mat4:V,quat:ot};var iv=ch.vec3,Py=[[0,0],[1,1]],vh=Wt.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new Wt.Attribute("position","float",3,"POSITION"),positionPrev:new Wt.Attribute("positionPrev","float",3),positionNext:new Wt.Attribute("positionNext","float",3),prevPositionPrev:new Wt.Attribute("prevPositionPrev","float",3),prevPosition:new Wt.Attribute("prevPosition","float",3),prevPositionNext:new Wt.Attribute("prevPositionNext","float",3),offset:new Wt.Attribute("offset","float",1),color:new Wt.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=iv.dist(t,e)+iv.dist(r,e)+iv.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(Py)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(Py)},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,C=s-f*2+c,E=l-h*2+d,D=(u-v)*3-o+p,L=(f-c)*3-s+g,P=(h-d)*3-l+m,N=o,I=s,k=l,O=(u-o)*S+A*T+D*x,U=(f-s)*S+C*T+L*x,z=(h-l)*S+E*T+P*x,nt=A*w+D*b,$=C*w+L*b,J=E*w+P*b,it=D*b,Pt=L*b,pt=P*b,Bt=0,Xt=0,Nt=Math.ceil(1/_),Et=new Float32Array((Nt+1)*3),Et=[],K=0,Xt=0;Xt<Nt+1;Xt++)Et[K++]=N,Et[K++]=I,Et[K++]=k,N+=O,I+=U,k+=z,O+=nt,U+=$,z+=J,nt+=it,$+=Pt,J+=pt,Bt+=_,Bt>1&&(N=O>0?Math.min(N,p):Math.max(N,p),I=U>0?Math.min(I,g):Math.max(I,g),k=z>0?Math.min(k,m):Math.max(k,m));return this.addPolyline(Et,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}});Mt(vh.prototype,_g);function bf(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}bf.prototype={constructor:bf,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 Pd(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 Rt({image:e,flipY:!1});var r=this;this._zr=Hv(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 bf(this._zr,0,0,t.width,t.height,this._gap,this._dpr)],this._nodeWidth=t.width,this._nodeHeight=t.height,this._currentNodeIdx=0}Pd.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 bf(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 Id(){}Id.prototype={constructor:Id,setScene:function(t){this._scene=t,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(t){this._lightRoot=t,this.mainLight=new F.DirectionalLight({shadowBias:.005}),this.ambientLight=new F.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=F.parseColor(n.get("color")).slice(0,3),r.color=F.parseColor(a.get("color")).slice(0,3);var o=n.get("alpha")||0,s=n.get("beta")||0;e.position.setArray(F.directionFromAlphaBeta(o,s)),e.lookAt(F.Vector3.ZERO),e.castShadow=n.get("shadow"),e.shadowResolution=F.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]=F.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 Ws,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"&&Xe(i)){this._isSkyboxFromAmbientCubemap=!1;var l=new F.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 ie({shape:{x:0,y:0,width:16,height:16},style:{fill:i}});Xp(f,h),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;var l=F.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 In=ch.vec3,C2=Wt.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new Wt.Attribute("position","float",3,"POSITION"),normal:new Wt.Attribute("normal","float",3,"NORMAL"),color:new Wt.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=In.create(),e=In.create(),r=In.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;In.sub(t,n[1],n[0]),In.sub(e,n[2],n[1]),In.cross(r,t,e),In.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}}()});Mt(C2.prototype,_g);var Nd=Cr.firstNotNull,pF={x:0,y:2,z:1};function gF(t,e,r,i){var n=[0,0,0],a=i<0?r.getExtentMin():r.getExtentMax();n[pF[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 dh(t,e,r){this.rootNode=new F.Node;var i=new F.Mesh({geometry:new vh({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),n=new F.Mesh({geometry:new C2,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 F.Plane,this.linesMesh=i,this.quadsMesh=n}dh.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]);gF(this.rootNode,this.plane,s,this.faceInfo[3])};dh.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=Nd(f.get("opacity"),1),c=Nd(f.get("width"),1);h=Y(h)?h:[h];for(var d=a.getTicksCoords({tickModel:u}),p=0,g=0;g<d.length;g++){var m=d[g].coord,_=F.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++}}}})};dh.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=Nd(u.get("opacity"),1);f=Y(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=F.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],M2=Wt.extend(function(){return{attributes:{position:new Wt.Attribute("position","float",3,"POSITION"),texcoord:new Wt.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new Wt.Attribute("offset","float",2),color:new Wt.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)}});Mt(M2.prototype,_g);const mF=`@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`;F.Shader.import(mF);const D2=F.Mesh.extend(function(){var t=new M2({dynamic:!0}),e=new F.Material({shader:F.createShader("ecgl.labels"),transparent:!0,depthMask:!1});return{geometry:t,material:e,culling:!1,castShadow:!1,ignorePicking:!0}});var Nn=Cr.firstNotNull,On={x:0,y:2,z:1};function yg(t,e){var r=new F.Mesh({geometry:new vh({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,renderOrder:2}),i=new D2;i.material.depthMask=!1;var n=new F.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 nv={x:"y",y:"x",z:"y"};yg.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=On[n.dim];d[g]=l[0],p[g]=l[1],this.axisLineCoords=[d,p];var m=F.parseColor(v),_=Nn(c.get("width"),1),y=Nn(c.get("opacity"),1);m[3]*=y,a.addLine(d,p,m,_*E)}if(f.get("show")){var x=f.getModel("lineStyle"),S=F.parseColor(Nn(x.get("color"),v)),_=Nn(x.get("width"),1);S[3]*=Nn(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=On[n.dim],C=On[nv[n.dim]];d[g]=p[g]=A,p[C]=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"),L=h.get("margin"),P=n.getViewLabels(),b=0;b<P.length;b++){var N=P[b].tickValue,I=P[b].formattedLabel,k=P[b].rawLabel,A=n.dataToCoord(N),O=[0,0,0],g=On[n.dim],C=On[nv[n.dim]];O[g]=O[g]=A,O[C]=L;var U=h;D&&D[N]&&D[N].textStyle&&(U=new Te(D[N].textStyle,h,s.ecModel));var z=Nn(U.get("color"),v),nt=new Jt({style:er(U,{text:I,fill:typeof z=="function"?z(n.type==="category"?k:n.type==="value"?N+"":N,b):z,verticalAlign:"top",align:"left"})}),$=e.add(nt),J=nt.getBoundingRect();o.addSprite(O,[J.width*E,J.height*E],$),this.labelElements.push(nt)}if(s.get("name")){var it=s.getModel("nameTextStyle"),O=[0,0,0],g=On[n.dim],C=On[nv[n.dim]],Pt=Nn(it.get("color"),v),pt=it.get("borderColor"),_=it.get("borderWidth");O[g]=O[g]=(l[0]+l[1])/2,O[C]=s.get("nameGap");var nt=new Jt({style:er(it,{text:s.get("name"),fill:Pt,stroke:pt,lineWidth:_})}),$=e.add(nt),J=nt.getBoundingRect();o.addSprite(O,[J.width*E,J.height*E],$),nt.__idx=this.labelElements.length,this.nameLabelElement=nt}this.labelsMesh.material.set("textureAtlas",e.getTexture()),this.labelsMesh.material.set("uvScale",e.getCoordsScale()),a.convertToTypedArray(),o.convertToTypedArray()};yg.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 _F=`@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=Cr.firstNotNull;F.Shader.import(_F);var Bn={x:0,y:2,z:1};const yF=cr.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 F.Material({shader:F.createShader("ecgl.color"),depthMask:!1,transparent:!0}),a=new F.Material({shader:F.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new F.Node,this._control=new dF({zr:e.getZr()}),this._control.init(),this._faces=r.map(function(s){var l=new dh(s,a,n);return this.groupGL.add(l.rootNode),l},this),this._axes=i.map(function(s){var l=new yg(s,a);return this.groupGL.add(l.rootNode),l},this);var o=e.getDevicePixelRatio();this._axisLabelSurface=new Pd({width:256,height:256,devicePixelRatio:o}),this._axisLabelSurface.onupdate=function(){e.getZr().refresh()},this._axisPointerLineMesh=new F.Mesh({geometry:new vh({useNativeLine:!1}),material:a,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new Pd({width:128,height:128,devicePixelRatio:o}),this._axisPointerLabelsMesh=new D2({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new F.Node,this._sceneHelper=new Id,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 F.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=Bn[s.faceInfo[0]],v=Bn[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 F.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 F.Vector4,new F.Vector4],r=new F.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 Cr.firstNotNull(b.model.get("axisPointer.show"),a.get("show"))}function l(b){var A=b.model.getModel("axisPointer",a),C=A.getModel("lineStyle"),E=F.parseColor(C.get("color")),D=Ny(C.get("width"),1),L=Ny(C.get("opacity"),1);return E[3]*=L,{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=Bn[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=Bn[p],T=Bn[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=op(u.scale.getTicks()[0]);g=d.toFixed(m+2)}var _=v.get("color"),y=new Jt({style:er(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=Bn[o[s.dim]];w[b]+=(s.flipped?-1:1)*v.get("margin"),w[Bn[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 Ys(t){sg.call(this,t),this.type="cartesian3D",this.dimensions=["x","y","z"],this.size=[0,0,0]}Ys.prototype={constructor:Ys,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}};jd(Ys,sg);function Af(t,e,r){eg.call(this,t,e,r)}Af.prototype={constructor:Af,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)}};jd(Af,eg);var Od=function(){this._pool={},this._allocatedTextures=[]};Od.prototype={constructor:Od,get:function(t){var e=Oy(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]);var r=this._pool[e];if(!r.length){var i=new Rt(t);return this._allocatedTextures.push(i),i}return r.pop()},put:function(t){var e=Oy(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 L2={width:512,height:512,type:B.UNSIGNED_BYTE,format:B.RGBA,wrapS:B.CLAMP_TO_EDGE,wrapT:B.CLAMP_TO_EDGE,minFilter:B.LINEAR_MIPMAP_LINEAR,magFilter:B.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},av=Object.keys(L2);function Oy(t){ue.defaultsWithPropList(t,L2,av),xF(t);for(var e="",r=0;r<av.length;r++){var i=av[r],n=t[i].toString();e+=n}return e}function xF(t){var e=TF(t.width,t.height);t.format===B.DEPTH_COMPONENT&&(t.useMipmap=!1),(!e||!t.useMipmap)&&(t.minFilter==B.NEAREST_MIPMAP_NEAREST||t.minFilter==B.NEAREST_MIPMAP_LINEAR?t.minFilter=B.NEAREST:(t.minFilter==B.LINEAR_MIPMAP_LINEAR||t.minFilter==B.LINEAR_MIPMAP_NEAREST)&&(t.minFilter=B.LINEAR)),e||(t.wrapS=B.CLAMP_TO_EDGE,t.wrapT=B.CLAMP_TO_EDGE)}function TF(t,e){return(t&t-1)===0&&(e&e-1)===0}const R2=Od,SF=`@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 Gi=["px","nx","py","ny","pz","nz"];G.import(SF);function ov(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 By(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 ii=De.extend(function(){return{softShadow:ii.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 _e,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new R2}},function(){this._gaussianPassH=new We({fragment:G.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new We({fragment:G.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 We({fragment:G.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===ii.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===ii.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(C){return C.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 dg,e=new et,r=new Ve,i=new et,n=new et,a=new et,o=new et;return function(s,l,u,f,h,v,c){var d=this._getDepthMaterial(f),p={getMaterial:function(J){return J.shadowDepthMaterial||d},isMaterialChanged:By,getUniform:ov,ifRender:function(J){return J.castShadow},sortCompare:As.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),V.invert(n.array,y.worldTransform.array),V.multiply(n.array,n.array,u.worldTransform.array),V.multiply(x,o.array,n.array);for(var S=[],T=u instanceof xe,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 C=_*Math.pow(m/_,A/f.shadowCascade),E=_+(m-_)*A/f.shadowCascade,D=C*f.cascadeSplitLogFactor+E*(1-f.cascadeSplitLogFactor);S.push(D),h.push(-(-D*w+b)/-D)}var L=this._getTexture(f,f.shadowCascade);c.push(L);var P=s.viewport,N=s.gl;this._frameBuffer.attach(L),this._frameBuffer.bind(s),N.clear(N.COLOR_BUFFER_BIT|N.DEPTH_BUFFER_BIT);for(var A=0;A<f.shadowCascade;A++){var I=S[A],k=S[A+1];T?V.perspective(e.array,u.fov/180*Math.PI,u.aspect,I,k):V.ortho(e.array,u.left,u.right,u.bottom,u.top,I,k),t.setFromProjection(e),t.getTransformedBoundingBox(r,n),r.applyProjection(o);var O=r.min.array,U=r.max.array;O[0]=Math.max(O[0],-1),O[1]=Math.max(O[1],-1),U[0]=Math.min(U[0],1),U[1]=Math.min(U[1],1),i.ortho(O[0],U[0],O[1],U[1],1,-1),y.projectionMatrix.multiplyLeft(i);var z=f.shadowResolution||512;s.setViewport((f.shadowCascade-A-1)*z,0,z,z,1);var nt=l.updateRenderList(y);s.renderPass(nt.opaque,y,p),this.softShadow===ii.VSM&&this._gaussianFilter(s,L,L.width);var $=new et;$.copy(y.viewMatrix).multiplyLeft(y.projectionMatrix),v.push($.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:By,getUniform:ov,ifRender:function(v){return v.castShadow},sortCompare:As.opaqueSortCompare},f=e.updateRenderList(o);t.renderPass(f.opaque,o,u),this._frameBuffer.unbind(t),this.softShadow===ii.VSM&&this._gaussianFilter(t,a,a.width);var h=new et;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:ov,sortCompare:As.opaqueSortCompare},l={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},u=new Ve,f=r.getWorldPosition().array,h=new Ve,v=r.range;h.min.setArray(f),h.max.setArray(f);var c=new X(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<Gi.length;x++)l[Gi[x]].push(_);return}if(u.transformFrom(y.boundingBox,_.worldTransform),!u.intersectBoundingBox(h))return;u.updateVertices();for(var x=0;x<Gi.length;x++)d[Gi[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),C=Math.abs(w),E=Math.abs(b);A>C?A>E?d[T>0?"px":"nx"]=!0:d[b>0?"pz":"nz"]=!0:C>E?d[w>0?"py":"ny"]=!0:d[b>0?"pz":"nz"]=!0}for(var x=0;x<Gi.length;x++)d[Gi[x]]&&l[Gi[x]].push(_)}});for(var p=0;p<6;p++){var g=Gi[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 Ri({precision:this.precision,shader:new G(G.source(i+"vertex"),G.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===ii.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:st.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 sa:i=new Rt,i.width=n*e,i.height=n,this.softShadow===ii.VSM?(i.type=st.FLOAT,i.anisotropic=4):(i.minFilter=B.NEAREST,i.magFilter=B.NEAREST,i.useMipmap=!1),this._textures[r]=i),i},_getPointLightCamera:function(t,e){this._lightCameras.point||(this._lightCameras.point={px:new xe,nx:new xe,py:new xe,ny:new xe,pz:new xe,nz:new xe});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(X.POSITIVE_X,X.NEGATIVE_Y);break;case"nx":r.lookAt(X.NEGATIVE_X,X.NEGATIVE_Y);break;case"py":r.lookAt(X.POSITIVE_Y,X.POSITIVE_Z);break;case"ny":r.lookAt(X.NEGATIVE_Y,X.NEGATIVE_Z);break;case"pz":r.lookAt(X.POSITIVE_Z,X.NEGATIVE_Y);break;case"nz":r.lookAt(X.NEGATIVE_Z,X.NEGATIVE_Y);break}return t.getWorldPosition(r.position),r.update(),r},_getDirectionalLightCamera:function(){var t=new et,e=new Ve,r=new Ve;return function(i,n,a){this._lightCameras.directional||(this._lightCameras.directional=new Xs);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(),et.invert(t,o.worldTransform),et.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 xe);var e=this._lightCameras.spot;return e.fov=t.penumbraAngle*2,e.far=t.range,e.worldTransform.copy(t.worldTransform),e.updateProjectionMatrix(),V.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=[]}});ii.VSM=1;ii.PCF=2;var Zs=De.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])}}}),Fy=De.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 Zs)&&(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}}}}),wF=Fy.extend(function(){return{_outputs:[],_texturePool:new R2,_frameBuffer:new _e({depthBuffer:!1})}},{addNode:function(t){Fy.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)}}),bF=Zs.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},function(){this.frameBuffer=new _e},{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=B.DEPTH_BUFFER_BIT|B.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}});const AF=bF;var EF=Zs.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(t,e){return this.texture},beforeFrame:function(){},afterFrame:function(){}});const CF=EF;var MF=Zs.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 We({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(){Zs.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});const DF=MF,LF=`@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`,P2=`@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
`,RF=`@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`,I2=`
@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`,PF=`@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`,N2=`@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`,O2=`@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
`,B2=`@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`,F2=`
@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`,k2=`@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`,IF=`@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`,z2=`@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`,U2=`@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 NF(t){t.import(LF),t.import(P2),t.import(RF),t.import(I2),t.import(PF),t.import(N2),t.import(O2),t.import(B2),t.import(F2),t.import(k2),t.import(IF),t.import(z2),t.import(U2)}NF(G);var OF=/^#source\((.*?)\)/;function BF(t,e){var r=new wF;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=FF(f,i,e);h&&r.addNode(h)}};for(var a in t.parameters){var o=t.parameters[a];i.parameters[a]=xg(o)}return UF(t,i,e,function(s){i.textures=s,n()}),r}function FF(t,e,r){var i=t.type||"filter",n,a,o;if(i==="filter"){var s=t.shader.trim(),l=OF.exec(s);if(l?n=G.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=xg(f.parameters))}}var h;if(i==="scene"?h=new AF({name:t.name,scene:r.scene,camera:r.camera,outputs:o}):i==="texture"?h=new CF({name:t.name,outputs:o}):h=new DF({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",HF(u,H2(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 kF(t,e){return t}function zF(t,e){return e}function xg(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=st[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]=VF(i,H2(n),r)):e[i]=n}}),e.width||(e.width=kF),e.height||(e.height=zF),t.useMipmap!=null&&(e.useMipmap=t.useMipmap),e}function UF(t,e,r,i){if(!t.textures){i({});return}var n={},a=0,o=!1,s=r.textureRootPath;ue.each(t.textures,function(l,u){var f,h=l.path,v=xg(l.parameters);if(Array.isArray(h)&&h.length===6)s&&(h=h.map(function(c){return ue.relative2absolute(c,s)})),f=new sa(v);else if(typeof h=="string")s&&(h=ue.relative2absolute(h,s)),f=new Rt(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 HF(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 VF(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 H2(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 po(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 GF=`@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
`;G.import(GF);function V2(t){for(var e=new Uint8Array(t*t*4),r=0,i=new X,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 ky(t){return new Rt({pixels:V2(t),wrapS:st.REPEAT,wrapT:st.REPEAT,width:t,height:t})}function WF(t,e,r){var i=new Float32Array(t*3);e=e||0;for(var n=0;n<t;n++){var a=po(n+e,2)*(r?1:2)*Math.PI,o=po(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 Pi(t){t=t||{},this._ssaoPass=new We({fragment:G.source("ecgl.ssao.estimate")}),this._blurPass=new We({fragment:G.source("ecgl.ssao.blur")}),this._framebuffer=new _e({depthBuffer:!1}),this._ssaoTexture=new Rt,this._blurTexture=new Rt,this._blurTexture2=new Rt,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)}Pi.prototype.setDepthTexture=function(t){this._depthTex=t};Pi.prototype.setNormalTexture=function(t){this._normalTex=t,this._ssaoPass.material[t?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)};Pi.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 et;et.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])};Pi.prototype.getTargetTexture=function(){return this._blurTexture2};Pi.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)};Pi.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]=WF(t,e*t,!!this._normalTex)};Pi.prototype.setNoiseSize=function(t){var e=this._ssaoPass.getUniform("noiseTex");e?(e.data=V2(t),e.width=e.height=t,e.dirty()):(e=ky(t),this._ssaoPass.setUniform("noiseTex",ky(t))),this._ssaoPass.setUniform("noiseTexSize",[t,t])};Pi.prototype.dispose=function(t){this._blurTexture.dispose(t),this._ssaoTexture.dispose(t),this._blurTexture2.dispose(t)};const XF=`@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`;G.import(XF);function Ii(t){t=t||{},this._ssrPass=new We({fragment:G.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new We({fragment:G.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new We({fragment:G.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new We({fragment:G.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 Rt({type:st.HALF_FLOAT}),this._texture2=new Rt({type:st.HALF_FLOAT}),this._texture3=new Rt({type:st.HALF_FLOAT}),this._prevTexture=new Rt({type:st.HALF_FLOAT}),this._currentTexture=new Rt({type:st.HALF_FLOAT}),this._frameBuffer=new _e({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}Ii.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")};Ii.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 et,p=new et;et.transpose(d,e.worldTransform),et.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}};Ii.prototype.getTargetTexture=function(){return this._texture3};Ii.prototype.setParameter=function(t,e){t==="maxIteration"?this._ssrPass.material.define("fragment","MAX_ITERATION",e):this._ssrPass.setUniform(t,e)};Ii.prototype.setPhysicallyCorrect=function(t){t?(this._normalDistribution||(this._normalDistribution=fi.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};Ii.prototype.setSSAOTexture=function(t){var e=this._blurPass2;t?(e.material.enableTexture("ssaoTex"),e.material.set("ssaoTex",t)):e.material.disableTexture("ssaoTex")};Ii.prototype.isFinished=function(t){return this._physicallyCorrect?t>this._totalSamples/this._samplePerFrame:!0};Ii.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 zy=[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],YF=`@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`;G.import(YF);function sv(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 ZF(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&&sv(t,d,"normalMap",g,0),o!==_&&_&&sv(t,d,"bumpMap",_,1),s!==m&&m&&sv(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 So(t){this._depthTex=new Rt({format:st.DEPTH_COMPONENT,type:st.UNSIGNED_INT}),this._normalTex=new Rt({type:st.HALF_FLOAT}),this._framebuffer=new _e,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,_e.DEPTH_ATTACHMENT),this._normalMaterial=new Ri({shader:new G(G.source("ecgl.normal.vertex"),G.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=ra.createBlank("#000"),this._defaultBumpMap=ra.createBlank("#000"),this._defaultRoughessMap=ra.createBlank("#000"),this._debugPass=new We({fragment:G.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}So.prototype.getDepthTexture=function(){return this._depthTex};So.prototype.getNormalTexture=function(){return this._normalTex};So.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:ZF(t,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:t.opaqueSortCompare}),this._framebuffer.unbind(t)};So.prototype.renderDebug=function(t){this._debugPass.render(t)};So.prototype.dispose=function(t){this._depthTex.dispose(t),this._normalTex.dispose(t)};function sl(t){t=t||{},this._edgePass=new We({fragment:G.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",t.normalTexture),this._edgePass.setUniform("depthTexture",t.depthTexture),this._targetTexture=new Rt({type:st.HALF_FLOAT}),this._frameBuffer=new _e,this._frameBuffer.attach(this._targetTexture)}sl.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)};sl.prototype.getTargetTexture=function(){return this._targetTexture};sl.prototype.setParameter=function(t,e){this._edgePass.setUniform(t,e)};sl.prototype.dispose=function(t){this._targetTexture.dispose(t),this._frameBuffer.dispose(t)};const $F={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"}}]},qF=`@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`,KF=`@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`;G.import(P2);G.import(I2);G.import(N2);G.import(O2);G.import(B2);G.import(F2);G.import(k2);G.import(z2);G.import(U2);G.import(qF);G.import(KF);function G2(t,e){return{color:{parameters:{width:t,height:e}}}}var Tg=["composite","FXAA"];function xt(){this._width,this._height,this._dpr,this._sourceTexture=new Rt({type:st.HALF_FLOAT}),this._depthTexture=new Rt({format:st.DEPTH_COMPONENT,type:st.UNSIGNED_INT}),this._framebuffer=new _e,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,_e.DEPTH_ATTACHMENT),this._normalPass=new So,this._compositor=BF($F);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=Tg.map(function(i){return this._compositor.getNodeByName(i)},this);var r={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new Pi(r),this._ssrPass=new Ii(r),this._edgePass=new sl(r)}xt.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};xt.prototype.getWidth=function(){return this._width};xt.prototype.getHeight=function(){return this._height};xt.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR};xt.prototype._getPrevNode=function(t){for(var e=Tg.indexOf(t.name)-1,r=this._finalNodesChain[e];r&&!this._compositor.getNodeByName(r.name);)e-=1,r=this._finalNodesChain[e];return r};xt.prototype._getNextNode=function(t){for(var e=Tg.indexOf(t.name)+1,r=this._finalNodesChain[e];r&&!this._compositor.getNodeByName(r.name);)e+=1,r=this._finalNodesChain[e];return r};xt.prototype._addChainNode=function(t){var e=this._getPrevNode(t),r=this._getNextNode(t);e&&(t.inputs.texture=e.name,r?(t.outputs=G2(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=t.name):t.outputs=null,this._compositor.addNode(t))};xt.prototype._removeChainNode=function(t){var e=this._getPrevNode(t),r=this._getNextNode(t);e&&(r?(e.outputs=G2(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=e.name):e.outputs=null,this._compositor.removeNode(t))};xt.prototype.updateNormal=function(t,e,r,i){this._ifRenderNormalPass()&&this._normalPass.update(t,e,r)};xt.prototype.updateSSAO=function(t,e,r,i){this._ssaoPass.update(t,r,i)};xt.prototype.enableSSAO=function(){this._enableSSAO=!0};xt.prototype.disableSSAO=function(){this._enableSSAO=!1};xt.prototype.enableSSR=function(){this._enableSSR=!0};xt.prototype.disableSSR=function(){this._enableSSR=!1};xt.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()};xt.prototype.getSourceFrameBuffer=function(){return this._framebuffer};xt.prototype.getSourceTexture=function(){return this._sourceTexture};xt.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)};xt.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)};xt.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()};xt.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()};xt.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()};xt.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()};xt.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0};xt.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1};xt.prototype.enableEdge=function(){this._enableEdge=!0};xt.prototype.disableEdge=function(){this._enableEdge=!1};xt.prototype.setBloomIntensity=function(t){this._compositeNode.setParameter("bloomIntensity",t)};xt.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}};xt.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}};xt.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)}};xt.prototype.setPhysicallyCorrectSSR=function(t){this._ssrPass.setPhysicallyCorrect(t)};xt.prototype.setEdgeColor=function(t){var e=F.parseColor(t);this._edgePass.setParameter("edgeColor",e)};xt.prototype.setExposure=function(t){this._compositeNode.setParameter("exposure",Math.pow(2,t))};xt.prototype.setColorLookupTexture=function(t,e){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?t:"none",e,{minFilter:F.Texture.NEAREST,magFilter:F.Texture.NEAREST,flipY:!1})};xt.prototype.setColorCorrection=function(t,e){this._compositeNode.setParameter(t,e)};xt.prototype.isSSREnabled=function(){return this._enableSSR};xt.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(zy.length/2/l),f=n%u,h=0;h<l*2;h++)s[h]=zy[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)};xt.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 Bd(t){for(var e=[],r=0;r<30;r++)e.push([po(r,2),po(r,3)]);this._haltonSequence=e,this._frame=0,this._sourceTex=new Rt,this._sourceFb=new _e,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new Rt,this._outputTex=new Rt;var i=this._blendPass=new We({fragment:G.source("clay.compositor.blend")});i.material.disableTexturesAll(),i.material.enableTexture(["texture1","texture2"]),this._blendFb=new _e({depthBuffer:!1}),this._outputPass=new We({fragment:G.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)}}Bd.prototype={constructor:Bd,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 et;s.array[12]=(o[0]*2-1)/n,s.array[13]=(o[1]*2-1)/a,et.mul(e.projectionMatrix,s,e.projectionMatrix),et.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 te(t){t=t||"perspective",this.layer=null,this.scene=new on,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(t),this._compositor=new xt,this._temporalSS=new Bd,this._shadowMapPass=new ii;for(var e=[],r=0,i=0;i<30;i++){for(var n=[],a=0;a<6;a++)n.push(po(r,2)*4-2),n.push(po(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)}te.prototype.setProjection=function(t){var e=this.camera;e&&e.update(),t==="perspective"?this.camera instanceof xe||(this.camera=new xe,e&&this.camera.setLocalTransform(e.localTransform)):this.camera instanceof Xs||(this.camera=new Xs,e&&this.camera.setLocalTransform(e.localTransform)),this.camera.near=.1,this.camera.far=2e3};te.prototype.setViewport=function(t,e,r,i,n){this.camera instanceof xe&&(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)};te.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 Uy=new lr;te.prototype.castRay=function(t,e,r){var i=this.layer.renderer,n=i.viewport;return i.viewport=this.viewport,i.screenToNDC(t,e,Uy),this.camera.castRay(Uy,r),i.viewport=n,r};te.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()};te.prototype.render=function(t,e){this._doRender(t,e,this._frame),this._frame++};te.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively};te.prototype.needsTemporalSS=function(){var t=this._enableTemporalSS;return t==="auto"&&(t=this._enablePostEffect),t};te.prototype.hasDOF=function(){return this._enableDOF};te.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30};te.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)};te.prototype._updateTransparent=function(t,e,r,i){for(var n=new X,a=new et,o=r.getWorldPosition(),s=e.getRenderList(r).transparent,l=0;l<s.length;l++){var u=s[l],f=u.geometry;et.invert(a,u.worldTransform),X.transformMat4(n,o,a),f.needsSortTriangles&&f.needsSortTriangles()&&f.doSortTriangles(n,i),f.needsSortVertices&&f.needsSortVertices()&&f.doSortVertices(n,i)}};te.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())}};te.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))};te.prototype.dispose=function(t){this._compositor.dispose(t.gl),this._temporalSS.dispose(t.gl),this._shadowMapPass.dispose(t)};te.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))})};te.prototype.setDOFFocusOnPoint=function(t){if(this._enablePostEffect)return t>this.camera.far||t<this.camera.near?void 0:(this._compositor.setDOFParameter("focalDistance",t),!0)};te.prototype.setTemporalSuperSampling=function(t){this._enableTemporalSS=t.get("enable")};te.prototype.isLinearSpace=function(){return this._enablePostEffect};te.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}};te.prototype.add=function(t){this.rootNode.add(t)};te.prototype.remove=function(t){this.rootNode.remove(t)};te.prototype.removeAll=function(t){this.rootNode.removeAll(t)};Object.assign(te.prototype,fg);function jF(t,e){var r=t.getBoxLayoutParams(),i=nn(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 QF(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=TI(r[o]||[1/0,-1/0],a);u=new Af(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 JF={dimensions:Ys.prototype.dimensions,create:function(t,e){var r=[];t.eachComponent("grid3D",function(a){a.__viewGL=a.__viewGL||new te;var o=new Ys;o.model=a,o.viewGL=a.__viewGL,a.coordinateSystem=o,r.push(o),o.resize=jF,o.update=QF});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}};const t5=JF;var W2=Ht.extend({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});SI(W2);const e5=W2;var X2={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},r5=vt({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},X2),Sg=vt({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},X2),i5=Mt({scale:!0,min:"dataMin",max:"dataMax"},Sg),Y2=Mt({logBase:10},Sg);Y2.scale=!0;const n5={categoryAxis3D:r5,valueAxis3D:Sg,timeAxis3D:i5,logAxis3D:Y2};var a5=["value","category","time","log"];function o5(t,e,r,i,n){a5.forEach(function(a){var o=r.extend({type:e+"Axis3D."+a,__ordinalMeta:null,mergeDefaultAndTheme:function(s,l){var u=l.getTheme();vt(s,u.get(a+"Axis3D")),vt(s,this.getDefaultOption()),s.type=i(e,s)},optionUpdated:function(){var s=this.option;s.type==="category"&&(this.__ordinalMeta=mf.createByAxisModel(this))},getCategories:function(){if(this.option.type==="category")return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:vt(lt(n5[a+"Axis3D"]),n||{},!0)});t.registerComponentModel(o)}),t.registerSubTypeDefaulter(e+"Axis3D",de(i,e))}function s5(t,e){return e.type||(e.data?"category":"value")}function l5(t){t.registerComponentModel(vF),t.registerComponentView(yF),t.registerCoordinateSystem("grid3D",t5),["x","y","z"].forEach(function(e){o5(t,e,e5,s5,{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 u5={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 lv(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function Z2(t,e,r,i,n){var a=r,o=t[e];lv(t,e,i);for(var s=r;s<i;s++)n(t[s],o)<0&&(lv(t,s,a),a++);return lv(t,i,a),a}function Ef(t,e,r,i){if(r<i){var n=Math.floor((r+i)/2),a=Z2(t,n,r,i,e);Ef(t,e,r,a-1),Ef(t,e,a+1,i)}}function Cf(){this._parts=[]}Cf.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=Z2(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(Ef(t,e,a[f].left,a[f].right),this._currentSortPartIdx++,this._currentSortPartIdx===a.length)return this._sorted=!0,!0}return!1}};Cf.sort=Ef;var no=ch.vec3,Hy=no.create(),Vy=no.create(),Gy=no.create();const f5={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++],Vy),i.get(r[o++],Gy);var s=no.sqrDist(Hy,t),l=no.sqrDist(Vy,t),u=no.sqrDist(Gy,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):Cf.sort(r,i,0,r.length-1)},_progressiveQuickSort:function(t){var e=this._triangleZList,r=this._sortedTriangleIndices;this._quickSort=this._quickSort||new Cf,this._quickSort.step(r,function(i,n){return e[n]-e[i]},t)}};function Fd(t,e){const r=t.getItemVisual(e,"style");if(r){const i=t.getVisual("drawType");return r[i]}}function Wy(t,e){const r=t.getItemVisual(e,"style");return r&&r.opacity}function h5(t,e){var r=[];return M(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 c5(t,e,r){function i(h){var v=[],c=h5(n,"tooltip");c.length?M(c,function(p){d(n.get(p,e),p)}):M(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?"":ED("yyyy/MM/dd hh:mm:ss",p):lf(p));y&&v.push(Ce(y))}}return"<br/>"+v.join("<br/>")}var n=t.getData(),a=t.getRawValue(e),o=Y(a)?i(a):Ce(lf(a)),s=n.getName(e),l=Fd(n,e);Q(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=QT(l),f=t.name;return f==="\0-"&&(f=""),f=f?Ce(f)+(r?": ":"<br/>"):"",r?u+f+o:f+u+(s?Ce(s)+": "+o:o)}function v5(t,e,r){r=r||t.getSource();var i=e||hP(t.get("coordinateSystem"))||["x","y","z"],n=CP(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=xI.enableDataStack(t,n,{byIndex:!0,stackedCoordDimension:"z"}),o=new cw(n,t);return o.setCalculationInfo(a),o.initData(r),o}var $2=so.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(t){return c5(this,t)},getInitialData:function(t,e){var r=t.data;function i(k){return!(isNaN(k.min)||isNaN(k.max)||isNaN(k.step))}function n(k){var O=op;return Math.max(O(k.min),O(k.max),O(k.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),C=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,L=re(Math.min(E,S.max),A),P=re(Math.min(D,T.max),C),p=x.x(L,P),g=x.y(L,P),y=x.z(L,P);r[v++]=p,r[v++]=g,r[v++]=y,r[v++]=L,r[v++]=P}}else{var a=t.equation||{},o=a.x||{},s=a.y||{};if(["x","y"].forEach(function(k){i(a[k])}),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=re(Math.min(p,o.max),f),_=re(Math.min(g,s.max),h),y=a.z(m,_);r[v++]=m,r[v++]=_,r[v++]=y}}var N=["x","y","z"];t.parametric&&N.push("u","v");var I=v5(this,N,r);return I},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},dataShape:null,itemStyle:{},animationDurationUpdate:500}});vt($2.prototype,u5);const d5=$2;var Fn=ch.vec3;function p5(t){return isNaN(t[0])||isNaN(t[1])||isNaN(t[2])}const g5=Ai.extend({type:"surface",__ecgl__:!0,init:function(t,e){this.groupGL=new F.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=F.createMaterial(s,["VERTEX_COLOR","DOUBLE_SIDED"])),F.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",F.parseColor(h.get("lineStyle.color")))):d.undefine("WIREFRAME_QUAD"),this._initHandler(t,r),this._updateAnimation(t)},_updateAnimation:function(t){F.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,t)},_createSurfaceMesh:function(){var t=new F.Mesh({geometry:new F.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new F.Material({shader:new F.Shader(F.Shader.source("ecgl.sm.depth.vertex"),F.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,f5),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=Fn.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=Fn.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(se){a.hasValue(se)||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(se,Zt,Be){Be[1]=se*p+Zt,Be[0]=se*p+Zt+1,Be[3]=(se+1)*p+Zt+1,Be[2]=(se+1)*p+Zt},w=!1;if(l){var b=[],A=[],C=0;m?f.init(n.vertexCount):f.value=null;for(var E=[[],[],[]],D=[],L=[],P=Fn.create(),N=function(se,Zt,Be){var Nr=Zt*3;return Be[0]=se[Nr],Be[1]=se[Nr+1],Be[2]=se[Nr+2],Be},I=new Float32Array(o.length),k=new Float32Array(o.length/3*4),O=0;O<a.count();O++)if(a.hasValue(O)){var Et=F.parseColor(Fd(a,O)),U=Wy(a,O);U!=null&&(Et[3]*=U),Et[3]<.99&&(w=!0);for(var z=0;z<4;z++)k[O*4+z]=Et[z]}for(var nt=[1e7,1e7,1e7],O=0;O<d-1;O++)for(var $=0;$<p-1;$++){var J=O*(p-1)+$,it=J*4;T(O,$,b);for(var Pt=!1,z=0;z<4;z++)N(o,b[z],A),p5(A)&&(Pt=!0);for(var z=0;z<4;z++)Pt?u.set(it+z,nt):(N(o,b[z],A),u.set(it+z,A)),i&&v.set(it+z,x[z]);for(var z=0;z<6;z++)S[C++]=y[z]+it;if(m&&!Pt)for(var z=0;z<2;z++){for(var pt=z*3,Bt=0;Bt<3;Bt++){var Xt=b[y[pt]+Bt];N(o,Xt,E[Bt])}Fn.sub(D,E[0],E[1]),Fn.sub(L,E[1],E[2]),Fn.cross(P,D,L);for(var Bt=0;Bt<3;Bt++){var Nt=b[y[pt]+Bt]*3;I[Nt]=I[Nt]+P[0],I[Nt+1]=I[Nt+1]+P[1],I[Nt+2]=I[Nt+2]+P[2]}}}if(m)for(var O=0;O<I.length/3;O++)N(I,O,P),Fn.normalize(P,P),I[O*3]=P[0],I[O*3+1]=P[1],I[O*3+2]=P[2];for(var Et=[],K=[],O=0;O<d-1;O++)for(var $=0;$<p-1;$++){var J=O*(p-1)+$,it=J*4;T(O,$,b);for(var z=0;z<4;z++){for(var Bt=0;Bt<4;Bt++)Et[Bt]=k[b[z]*4+Bt];c.set(it+z,Et),m&&(N(I,b[z],P),f.set(it+z,P));var Xt=b[z];K[0]=Xt%p/(p-1),K[1]=Math.floor(Xt/p)/(d-1),h.set(it+z,K)}J++}}else{for(var K=[],O=0;O<a.count();O++){K[0]=O%p/(p-1),K[1]=Math.floor(O/p)/(d-1);var Et=F.parseColor(Fd(a,O)),U=Wy(a,O);U!=null&&(Et[3]*=U),Et[3]<.99&&(w=!0),c.set(O,Et),h.set(O,K)}for(var b=[],wt=0,O=0;O<d-1;O++)for(var $=0;$<p-1;$++){T(O,$,b);for(var z=0;z<6;z++)S[wt++]=b[y[z]]}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 m5(t){t.registerChartView(g5),t.registerSeriesModel(d5),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 Hn=Kt(),Xy=lt,uv=rt,_5=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 oe,this.createPointerEl(s,u,e,r),this.createLabelEl(s,u,e,r),i.getZr().add(s);else{var v=de(Yy,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=lg(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=Hn(e).pointerEl=new rD[a.type](Xy(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,i,n){if(r.label){var a=Hn(e).labelEl=new Jt(Xy(r.label));e.add(a),Zy(a,n)}},t.prototype.updatePointerEl=function(e,r,i){var n=Hn(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=Hn(e).labelEl;a&&(a.setStyle(r.label.style),i(a,{x:r.label.x,y:r.label.y}),Zy(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=Ap(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Ei(u.event)},onmousedown:uv(this._onHandleDragMove,this,0,0),drift:uv(this._onHandleDragMove,this),ondragend:uv(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");Y(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,ah(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){Yy(this._axisPointerModel,!r&&this._moveAnimation,this._handle,fv(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(fv(i),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(fv(n)),Hn(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),ff(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 Yy(t,e,r,i){q2(Hn(r).lastProp,i)||(Hn(r).lastProp=i,e?Rr(r,i,t):(r.stopAnimation(),r.attr(i)))}function q2(t,e){if(Q(t)&&Q(e)){var r=!0;return M(e,function(i,n){r=r&&q2(t[n],i)}),!!r}else return t===e}function Zy(t,e){t[e.get(["label","show"])?"show":"hide"]()}function fv(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)})}const y5=_5;function x5(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 T5(t,e,r,i,n){var a=r.get("value"),o=K2(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=el(s.get("padding")||0),u=s.getFont(),f=np(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),S5(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:er(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function S5(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 K2(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:Jp(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};M(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):ft(o)&&(a=o(s))}return a}function j2(t,e,r){var i=Cs();return ep(i,i,r.rotation),Dv(i,i,r.position),Ji([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],i)}function w5(t,e,r,i,n,a){var o=qw.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=n.get(["label","margin"]),T5(e,i,n,a,{position:j2(i.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function b5(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function A5(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}var E5=function(t){W(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=qy(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var v=x5(a),c=C5[u](s,h,f);c.style=v,r.graphicKey=c.type,r.pointer=c}var d=xd(l.model,n);w5(i,r,d,n,a,o)},e.prototype.getHandleTransform=function(r,i,n){var a=xd(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=j2(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=qy(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}(y5);function qy(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var C5={line:function(t,e,r){var i=b5([e,r[0]],[e,r[1]],Ky(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:A5([e-i/2,r[0]],[i,n],Ky(t))}}};function Ky(t){return t.dim==="x"?0:1}const M5=E5;var D5=function(t){W(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}(Ht);const L5=D5;var wi=Kt(),R5=M;function Q2(t,e,r){if(!ct.node){var i=e.getZr();wi(i).records||(wi(i).records={}),P5(i,e);var n=wi(i).records[t]||(wi(i).records[t]={});n.handler=r}}function P5(t,e){if(wi(t).initialized)return;wi(t).initialized=!0,r("click",de(jy,"click")),r("mousemove",de(jy,"mousemove")),r("globalout",N5);function r(i,n){t.on(i,function(a){var o=O5(e);R5(wi(t).records,function(s){s&&n(s,a,o.dispatchAction)}),I5(o.pendings,e)})}}function I5(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 N5(t,e,r){t.handler("leave",null,r)}function jy(t,e,r,i){e.handler(t,r,i)}function O5(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 kd(t,e){if(!ct.node){var r=e.getZr(),i=(wi(r).records||{})[t];i&&(wi(r).records[t]=null)}}var B5=function(t){W(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";Q2("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){kd("axisPointer",i)},e.prototype.dispose=function(r,i){kd("axisPointer",i)},e.type="axisPointer",e}(cr);const F5=B5;function J2(t,e){var r=[],i=t.seriesIndex,n;if(i==null||!(n=e.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=ia(a,t);if(o==null||o<0||Y(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(j(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 Qy=Kt();function k5(t,e,r){var i=t.currTrigger,n=[t.x,t.y],a=t,o=t.dispatchAction||rt(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Nu(n)&&(n=J2({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=Nu(n),u=a.axesInfo,f=s.axesInfo,h=i==="leave"||Nu(n),v={},c={},d={list:[],map:{}},p={showPointer:de(U5,c),showTooltip:de(H5,d)};M(s.coordSysMap,function(m,_){var y=l||m.containPoint(n);M(s.coordSysAxesInfo[_],function(x,S){var T=x.axis,w=X5(u,x);if(!h&&y&&(!u||w)){var b=w&&w.value;b==null&&!l&&(b=T.pointToData(n)),b!=null&&Jy(x,b,p,!1,v)}})});var g={};return M(f,function(m,_){var y=m.linkGroup;y&&!c[_]&&M(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,t1(x),t1(m)))),g[m.key]=w}})}),M(g,function(m,_){Jy(f[_],m,p,!0,v)}),V5(c,f,v),G5(d,n,t,o),W5(f,o,r),v}}function Jy(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=z5(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&H(n,s[0]),!i&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function z5(t,e){var r=e.axis,i=r.dim,n=t,a=[],o=Number.MAX_VALUE,s=-1;return M(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),M(v,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:n}}function U5(t,e,r,i){t[e.key]={value:r,payloadBatch:i}}function H5(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=Hs(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 V5(t,e,r){var i=r.axesInfo=[];M(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 G5(t,e,r,i){if(Nu(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 W5(t,e,r){var i=r.getZr(),n="axisPointerLastHighlights",a=Qy(i)[n]||{},o=Qy(i)[n]={};M(t,function(u,f){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&M(h.seriesDataIndices,function(v){var c=v.seriesIndex+" | "+v.dataIndex;o[c]=v})});var s=[],l=[];M(a,function(u,f){!o[f]&&l.push(u)}),M(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 X5(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 t1(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 Nu(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function tb(t){Kw.registerAxisPointerClass("CartesianAxisPointer",M5),t.registerComponentModel(L5),t.registerComponentView(F5),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!Y(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=fO(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},k5)}function Y5(t){nr(bO),nr(tb)}function Z5(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 e1(t,e){var r;return M(e,function(i){t[i]!=null&&t[i]!=="auto"&&(r=!0)}),r}function $5(t,e,r){var i=H({},r),n=t[e],a=r.$action||"merge";a==="merge"?n?(vt(n,i,!0),oa(n,i,{ignoreSize:!0}),eS(r,n),hu(r,n),hu(r,n,"shape"),hu(r,n,"style"),hu(r,n,"extra"),r.clipPath=n.clipPath):t[e]=i:a==="replace"?t[e]=i:a==="remove"&&n&&(t[e]=null)}var eb=["transition","enterFrom","leaveTo"],q5=eb.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function hu(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var i=r?eb:q5,n=0;n<i.length;n++){var a=i[n];t[a]==null&&e[a]!=null&&(t[a]=e[a])}}function K5(t,e){if(t&&(t.hv=e.hv=[e1(e,["left","right"]),e1(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 j5=function(t){W(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=Ux(o,s,"normalMerge"),u=this._elOptionsToUpdate=[];M(l,function(f,h){var v=f.newOption;v&&(u.push(v),Z5(f,v),$5(o,h,v),K5(o[h],v))},this),n.elements=ce(o,function(f){return f&&delete f.$action,f!=null})},e.prototype._flatten=function(r,i,n){M(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}(Ht),r1={path:null,compoundPath:null,group:oe,image:Pr,text:Jt},xr=Kt(),Q5=function(t){W(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=ut()},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");M(i,function(l){var u=Ge(l.id,null),f=u!=null?n.get(u):null,h=Ge(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&&PO(d,c,!!g,!!p)){var m=IO(d,c,!0);!g&&m.textConfig&&(g=l.textConfig=m.textConfig),!p&&m.textContent&&(p=m.textContent)}var _=J5(l),y=l.$action||"merge",x=y==="merge",S=y==="replace";if(x){var T=!f,w=f;T?w=i1(u,v,l.type,n):(w&&(xr(w).isNew=!1),XO(w)),w&&(kc(w,_,r,{isInit:T}),n1(w,l,o,s))}else if(S){Ou(f,l,n,r);var b=i1(u,v,l.type,n);b&&(kc(b,_,r,{isInit:!0}),n1(b,l,o,s))}else y==="remove"&&(r2(f,l),Ou(f,l,n,r));var A=n.get(u);if(A&&p)if(x){var C=A.getTextContent();C?C.attr(p):A.setTextContent(new Jt(p))}else S&&A.setTextContent(new Jt(p));if(A){var E=l.clipPath;if(E){var D=E.type,L=void 0,T=!1;if(x){var P=A.getClipPath();T=!P||xr(P).type!==D,L=T?zd(D):P}else S&&(T=!0,L=zd(D));A.setClipPath(L),kc(L,E,r,{isInit:T}),Ad(L,E.keyframeAnimation,r)}var N=xr(A);A.setTextConfig(g),N.option=l,t4(A,r,l),Yf({el:A,componentModel:r,itemName:A.name,itemTooltipOption:l.tooltip}),Ad(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=Ge(h.id,null),c=v!=null?o.get(v):null;if(!(!c||!c.isGroup)){var d=c.parent,p=d===a,g=xr(c),m=xr(d);g.width=ve(g.option.width,p?s:m.width)||0,g.height=ve(g.option.height,p?l:m.height)||0}}for(var f=n.length-1;f>=0;f--){var h=n[f],v=Ge(h.id,null),c=v!=null?o.get(v):null;if(c){var d=c.parent,m=xr(d),_=d===a?{width:s,height:l}:{width:m.width,height:m.height},y={},x=tS(c,h,_,null,{hv:h.hv,boundingMode:h.bounding},y);if(!xr(c).isNew&&x){for(var S=h.transition,T={},w=0;w<u.length;w++){var b=u[w],A=y[b];S&&(ea(S)||Ct(S,b)>=0)?T[b]=A:c[b]=A}Rr(c,T,r,0)}else c.attr(y)}}},e.prototype._clear=function(){var r=this,i=this._elMap;i.each(function(n){Ou(n,xr(n).option,i,r._lastGraphicModel)}),this._elMap=ut()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(cr);function zd(t){var e=mt(r1,t)?r1[t]:RT(t),r=new e({});return xr(r).type=t,r}function i1(t,e,r,i){var n=zd(r);return e.add(n),i.set(t,n),xr(n).id=t,xr(n).isNew=!0,n}function Ou(t,e,r,i){var n=t&&t.parent;n&&(t.type==="group"&&t.traverse(function(a){Ou(a,e,r,i)}),NO(t,e,i),r.removeKey(xr(t).id))}function n1(t,e,r,i){t.isGroup||M([["cursor",ua.prototype.cursor],["zlevel",i||0],["z",r||0],["z2",0]],function(n){var a=n[0];mt(e,a)?t[a]=gt(e[a],n[1]):t[a]==null&&(t[a]=n[1])}),M(_t(e),function(n){if(n.indexOf("on")===0){var a=e[n];t[n]=ft(a)?a:null}}),mt(e,"draggable")&&(t.draggable=e.draggable),e.name!=null&&(t.name=e.name),e.id!=null&&(t.id=e.id)}function J5(t){return t=H({},t),M(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(JT),function(e){delete t[e]}),t}function t4(t,e,r){var i=Ft(t).eventData;!t.silent&&!t.ignore&&!i&&(i=Ft(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),i&&(i.info=r.info)}function e4(t){t.registerComponentModel(j5),t.registerComponentView(Q5),t.registerPreprocessor(function(e){var r=e.graphic;Y(r)?!r[0]||!r[0].elements?e.graphic=[{elements:r}]:e.graphic=[e.graphic[0]]:r&&!r.elements&&(e.graphic=[{elements:[r]}])})}var a1=["x","y","radius","angle","single"],r4=["cartesian2d","polar","singleAxis"];function i4(t){var e=t.get("coordinateSystem");return Ct(r4,e)>=0}function ji(t){return t+"Axis"}function n4(t,e){var r=ut(),i=[],n=ut();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 rb(t){var e=t.ecModel,r={infoList:[],infoMap:ut()};return t.eachTargetAxis(function(i,n){var a=e.getComponent(ji(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 hv=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}(),Mf=function(t){W(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=o1(r);this.settledOption=a,this.mergeDefaultAndTheme(r,n),this._doInit(a)},e.prototype.mergeOption=function(r){var i=o1(r);vt(this.option,r,!0),vt(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;M([["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=ut(),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 M(a1,function(n){var a=this.getReferringComponents(ji(n),VE);if(a.specified){i=!0;var o=new hv;M(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 hv;if(v.add(h.componentIndex),r.set(f,v),a=!1,f==="x"||f==="y"){var c=h.getReferringComponents("grid",tr).models[0];c&&M(u,function(d){h.componentIndex!==d.componentIndex&&c===d.getReferringComponents("grid",tr).models[0]&&v.add(d.componentIndex)})}}}a&&M(a1,function(u){if(a){var f=n.findComponents({mainType:ji(u),filter:function(v){return v.get("type",!0)==="category"}});if(f[0]){var h=new hv;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");M([["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(ji(i),n))},this),r},e.prototype.eachTargetAxis=function(r,i){this._targetAxisInfoMap.each(function(n,a){M(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(ji(r),i)},e.prototype.setRawRange=function(r){var i=this.option,n=this.settledOption;M([["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;M(["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}(Ht);function o1(t){var e={};return M(["start","end","startValue","endValue","throttle"],function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e}var a4=function(t){W(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}(cr);const ib=a4;var Ua=M,s1=Gn,o4=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(i4(r)){var i=ji(this._dimName),n=r.getReferringComponents(i,tr).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 lt(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;Ua(["start","end"],function(v,c){var d=e[v],p=e[v+"Value"];a[c]==="percent"?(d==null&&(d=o[c]),p=n.parse(ae(d,o,r))):(u=!0,p=p==null?r[c]:n.parse(p),d=ae(p,r,o)),l[c]=p==null||isNaN(p)?r[c]:p,s[c]=d==null||isNaN(d)?o[c]:d}),s1(l),s1(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";al(0,v,d,"all",f["min"+m],f["max"+m]);for(var _=0;_<2;_++)c[_]=ae(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=s4(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;Ua(n,function(l){var u=l.getData(),f=u.mapDimensionsAll(i);if(f.length){if(a==="weakFilter"){var h=u.getStore(),v=j(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 Ua(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)}});Ua(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;Ua(["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=ae(i[0]+o,i,[0,100],!0):a!=null&&(o=ae(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 s4(t,e,r){var i=[1/0,-1/0];Ua(r,function(o){yI(i,o.getData(),e)});var n=t.getAxisModel(),a=Aw(n.axis.scale,n,i).calculate();return[a.min,a.max]}var l4={getTargetSeries:function(t){function e(n){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(ji(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 o4(n,a,s,t),r.push(o.__dzAxisProxy))});var i=ut();return M(r,function(n){M(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]})}})}};const u4=l4;function f4(t){t.registerAction("dataZoom",function(e,r){var i=n4(r,e);M(i,function(n){n.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var l1=!1;function nb(t){l1||(l1=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,u4),f4(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function h4(t,e){var r=el(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new ie({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 c4=function(t){W(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}(Ht);const v4=c4;function ab(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function ob(t){if(ct.domSupported){for(var e=document.documentElement.style,r=0,i=t.length;r<i;r++)if(t[r]in e)return t[r]}}var sb=ob(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),d4=ob(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function lb(t,e){if(!t)return e;e=KT(e,!0);var r=t.indexOf(e);return t=r===-1?e:"-"+t.slice(0,r)+"-"+e,t.toLowerCase()}function p4(t,e){var r=t.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(t);return r?e?r[e]:r:null}var g4=lb(d4,"transition"),wg=lb(sb,"transform"),m4="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(ct.transform3dSupported?"will-change:transform;":"");function _4(t){return t=t==="left"?"right":t==="right"?"left":t==="top"?"bottom":"top",t}function y4(t,e,r){if(!q(r)||r==="inside")return"";var i=t.get("backgroundColor"),n=t.get("borderWidth");e=aa(e);var a=_4(r),o=Math.max(Math.round(n)*1.5,6),s="",l=wg+":",u;Ct(["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 x4(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+=ct.transformSupported?","+wg+i:",left"+i+",top"+i),g4+":"+n}function u1(t,e,r){var i=t.toFixed(0)+"px",n=e.toFixed(0)+"px";if(!ct.transformSupported)return r?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=ct.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return r?"top:0;left:0;"+wg+":"+o+";":[["top",0],["left",0],[sb,o]]}function T4(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),M(["decoration","align"],function(l){var u=t.get(l);u&&e.push("text-"+l+":"+u)}),e.join(";")}function S4(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=ES(t,"html"),v=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+v),e&&n&&i.push(x4(n,r)),a&&i.push("background-color:"+a),M(["width","color","radius"],function(c){var d="border-"+c,p=KT(d),g=t.get(p);g!=null&&i.push(d+":"+g+(c==="color"?"":"px"))}),i.push(T4(f)),h!=null&&i.push("padding:"+el(h).join("px ")+"px"),i.join(";")+";"}function f1(t,e,r,i,n){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&fA(t,o,document.body,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 w4=function(){function t(e,r,i){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,ct.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=r.getZr(),o=this._appendToBody=i&&i.appendToBody;f1(this._styleCoord,a,o,r.getWidth()/2,r.getHeight()/2),o?document.body.appendChild(n):e.appendChild(n),this._container=e;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=a.handler,f=a.painter.getViewportRoot();mr(f,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){var r=this._container,i=p4(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=m4+S4(e,!this._firstShow,this._longHide)+u1(a[0],a[1],!0)+("border-color:"+aa(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"&&!ab(i)&&(s=y4(i,n,a)),q(e))o.innerHTML=e+s;else if(e){o.innerHTML="",Y(e)||(e=[e]);for(var l=0;l<e.length;l++)Fu(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(f1(i,this._zr,this._appendToBody,e,r),i[0]!=null&&i[1]!=null){var n=this.el.style,a=u1(i[0],i[1]);M(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",ct.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(rt(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this.el.parentNode.removeChild(this.el)},t}();const b4=w4;var A4=function(){function t(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),c1(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;Q(e)&&Qe(""),this.el&&this._zr.remove(this.el);var s=i.getModel("textStyle");this.el=new Jt({style:{rich:r.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:n,textShadowColor:s.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:ES(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),M(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(u){o.el.style[u]=i.get(u)}),M(["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=h1(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;c1(n,this._zr,e,r),e=n[0],r=n[1];var a=i.style,o=Xi(a.borderWidth||0),s=h1(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(rt(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function Xi(t){return Math.max(0,t)}function h1(t){var e=Xi(t.shadowBlur||0),r=Xi(t.shadowOffsetX||0),i=Xi(t.shadowOffsetY||0);return{left:Xi(e-r),right:Xi(e+r),top:Xi(e-i),bottom:Xi(e+i)}}function c1(t,e,r,i){t[0]=r,t[1]=i,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var E4=new ie({shape:{x:-1,y:-1,width:2,height:2}}),C4=function(t){W(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(!(ct.node||!i.getDom())){var n=r.getComponent("tooltip"),a=this._renderMode=WE(n.get("renderMode"));this._tooltipContent=a==="richText"?new A4(i):new b4(i.getDom(),i,{appendToBody:n.get("appendToBody",!0)})}},e.prototype.render=function(r,i,n){if(!(ct.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")?ah(this,"_updatePosition",50,"fixRate"):ff(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var r=this._tooltipModel,i=r.get("triggerOn");Q2("itemTooltip",this._api,rt(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||ct.node||!n.getDom())){var o=v1(a,n);this._ticket="";var s=a.dataByCoordSys,l=R4(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=E4;f.x=a.x,f.y=a.y,f.update(),Ft(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=J2(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(v1(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=Qo([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){this._lastDataByCoordSys=null;var s,l;Ya(n,function(u){if(Ft(u).dataIndex!=null)return s=u,!0;if(Ft(u).tooltipConfig!=null)return l=u,!0},!0),s?this._showSeriesItemTooltip(r,s,i):l?this._showComponentItemTooltip(r,l,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},e.prototype._showOrMove=function(r,i){var n=r.get("showDelay");i=rt(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=Qo([i.tooltipOption],a),l=this._renderMode,u=[],f=Fs("section",{blocks:[],noHeader:!0}),h=[],v=new vc;M(r,function(_){M(_.dataByAxis,function(y){var x=n.getComponent(y.axisDim+"Axis",y.axisIndex),S=y.value;if(!(!x||S==null)){var T=K2(S,x.axis,n,y.seriesDataIndices,y.valueLabelOpt),w=Fs("section",{header:T,noHeader:!oi(T),sortBlocks:!0,blocks:[]});f.blocks.push(w),M(y.seriesDataIndices,function(b){var A=n.getSeriesByIndex(b.seriesIndex),C=b.dataIndexInside,E=A.getDataParams(C);if(!(E.dataIndex<0)){E.axisDim=y.axisDim,E.axisIndex=y.axisIndex,E.axisType=y.axisType,E.axisId=y.axisId,E.axisValue=Jp(x.axis,{value:S}),E.axisValueLabel=T,E.marker=v.makeTooltipMarker("item",aa(E.color),l);var D=w_(A.formatTooltip(C,!0,null)),L=D.frag;if(L){var P=Qo([A],a).get("valueFormatter");w.blocks.push(P?H({valueFormatter:P},L):L)}D.text&&h.push(D.text),u.push(E)}})}})}),f.blocks.reverse(),h.reverse();var c=i.position,d=s.get("order"),p=D_(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=Ft(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=Qo([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 vc;m.marker=_.makeTooltipMarker("item",aa(m.color),c);var y=w_(u.formatTooltip(f,!1,h)),x=p.get("order"),S=p.get("valueFormatter"),T=y.frag,w=T?D_(S?H({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=Ft(i),o=a.tooltipConfig,s=o.option||{};if(q(s)){var l=s;s={content:l,formatter:l}}var u=[s],f=this._ecModel.getComponent(a.componentMainType,a.componentIndex);f&&u.push(f),u.push({formatter:s.content});var h=r.positionDefault,v=Qo(u,this._tooltipModel,h?{position:h}:null),c=v.get("content"),d=Math.random()+"",p=new vc;this._showOrMove(v,function(){var g=lt(v.get("formatterParams")||{});this._showTooltipContent(v,c,g,d,r.offsetX,r.offsetY,r.position,i,p)}),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=Y(n)?n[0]:n,_=m&&m.axisType&&m.axisType.indexOf("time")>=0;c=v,_&&(c=Kf(m.axisValue,c,g)),c=jT(c,n,!0)}else if(ft(v)){var y=rt(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"||Y(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!Y(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),ft(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,f],contentSize:h.slice()})),Y(i))n=ve(i[0],u),a=ve(i[1],f);else if(Q(i)){var p=i;p.width=h[0],p.height=h[1];var g=nn(p,{width:u,height:f});n=g.x,a=g.y,v=null,c=null}else if(q(i)&&l){var m=L4(i,d,h,r.get("borderWidth"));n=m[0],a=m[1]}else{var m=M4(n,a,o,u,f,v?null:20,c?null:20);n=m[0],a=m[1]}if(v&&(n-=d1(v)?h[0]/2:v==="right"?h[0]:0),c&&(a-=d1(c)?h[1]/2:c==="bottom"?h[1]:0),ab(r)){var m=D4(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&&M(n,function(s,l){var u=s.dataByAxis||[],f=r[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&M(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&&M(p,function(m,_){var y=g[_];o=o&&m.seriesIndex===y.seriesIndex&&m.dataIndex===y.dataIndex}),a&&M(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){ct.node||!i.getDom()||(ff(this,"_updatePosition"),this._tooltipContent.dispose(),kd("itemTooltip",i))},e.type="tooltip",e}(cr);function Qo(t,e,r){var i=e.ecModel,n;r?(n=new Te(r,i,i),n=new Te(e.option,n,i)):n=e;for(var a=t.length-1;a>=0;a--){var o=t[a];o&&(o instanceof Te&&(o=o.get("tooltip",!0)),q(o)&&(o={formatter:o}),o&&(n=new Te(o,n,i)))}return n}function v1(t,e){return t.dispatchAction||rt(e.dispatchAction,e)}function M4(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 D4(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 L4(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 d1(t){return t==="center"||t==="middle"}function R4(t,e,r){var i=up(t).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=Qs(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=Ft(u).tooltipConfig;if(f&&f.name===t.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}const P4=C4;function I4(t){nr(tb),t.registerComponentModel(v4),t.registerComponentView(P4),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Me),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Me)}var p1=M;function g1(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function m1(t,e,r){var i={};return p1(e,function(a){var o=i[a]=n();p1(t[a],function(s,l){if(Ne.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new Ne(u),l==="opacity"&&(u=lt(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Ne(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function N4(t,e,r){var i;M(r,function(n){e.hasOwnProperty(n)&&g1(e[n])&&(i=!0)}),i&&M(r,function(n){e.hasOwnProperty(n)&&g1(e[n])?t[n]=lt(e[n]):delete t[n]})}function O4(t,e,r,i){var n={};return M(t,function(a){var o=Ne.prepareVisualTypes(e[a]);n[a]=o}),{progress:function(o,s){var l;i!=null&&(l=s.getDimensionIndex(i));function u(S){return BS(s,h,S)}function f(S,T){dR(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 B4=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"])}},F4=function(t){W(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"]),Y(i)&&M(i,function(a,o){q(a)&&(a={type:a}),i[o]=vt(a,B4(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&&lp(l)&&i.push(l.name)}),this._availableNames=n;var a=this.get("data")||i,o=ut(),s=j(a,function(l){return(q(l)||Qt(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new Te(l,this,this.ecModel))},this);this._data=ce(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;M(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;M(r,function(n){i[n.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var r=this._data,i=this.option.selected;M(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])&&Ct(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}(Ht);const Ud=F4;var Ba=de,Hd=M,cu=oe,k4=function(t){W(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 cu),this.group.add(this._selectorGroup=new cu),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=nn(f,h,v),d=this.layoutInner(r,o,c,a,l,u),p=nn(Mt({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=h4(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=ut(),h=i.get("selectedMode"),v=[];n.eachRawSeries(function(c){!c.get("legendHoverLink")&&v.push(c.id)}),Hd(i.getData(),function(c,d){var p=c.get("name");if(!this.newlineDisabled&&(p===""||p===`
`)){var g=new cu;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",Ba(_1,p,null,a,v)).on("mouseover",Ba(Vd,m.name,null,a,v)).on("mouseout",Ba(Gd,m.name,null,a,v)),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),C=b.getItemVisual(A,"style"),E=b.getItemVisual(A,"legendIcon"),D=Xe(C.fill);D&&D[3]===0&&(D[3]=.2,C=H(H({},C),{fill:bi(D,"rgba")}));var L=this._createItem(w,p,d,c,i,r,{},C,E,h,a);L.on("click",Ba(_1,null,p,a,v)).on("mouseover",Ba(Vd,null,p,a,v)).on("mouseout",Ba(Gd,null,p,a,v)),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();Hd(r,function(u){var f=u.type,h=new Jt({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"]);Cp(h,{normal:v,emphasis:c},{defaultText:u.title}),ef(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=z4(f,a,l,u,c,g,v),S=new cu,T=a.getModel("textStyle");if(ft(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(U4({itemWidth:d,itemHeight:p,icon:f,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}))}var b=s==="left"?d+5:-5,A=s,C=o.get("formatter"),E=i;q(C)&&C?E=C.replace("{name}",i??""):ft(C)&&(E=C(i));var D=g?T.getTextColor():a.get("inactiveColor");S.add(new Jt({style:er(T,{text:E,x:b,y:p/2,fill:D,align:A,verticalAlign:"middle"},{inheritColor:D})}));var L=new ie({shape:S.getBoundingRect(),invisible:!0}),P=a.getModel("tooltip");return P.get("show")&&Yf({el:L,componentModel:o,itemName:i,itemTooltipOption:P.option}),S.add(L),S.eachChild(function(N){N.silent=!0}),L.silent=!h,this.getContentGroup().add(S),ef(S),S.__legendDataIndex=n,S},e.prototype.layoutInner=function(r,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();io(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){io("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}(cr);function z4(t,e,r,i,n,a,o){function s(g,m){g.lineWidth==="auto"&&(g.lineWidth=m.lineWidth>0?2:0),Hd(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:ld(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 U4(t){var e=t.icon||"roundRect",r=Xr(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 _1(t,e,r,i){Gd(t,e,r,i),r.dispatchAction({type:"legendToggleSelect",name:t??e}),Vd(t,e,r,i)}function ub(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 Vd(t,e,r,i){ub(r)||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:i})}function Gd(t,e,r,i){ub(r)||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:i})}const fb=k4;function H4(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 Jo(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();M(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 V4(t){t.registerAction("legendToggleSelect","legendselectchanged",de(Jo,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",de(Jo,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",de(Jo,"inverseSelect")),t.registerAction("legendSelect","legendselected",de(Jo,"select")),t.registerAction("legendUnSelect","legendunselected",de(Jo,"unSelect"))}function hb(t){t.registerComponentModel(Ud),t.registerComponentView(fb),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,H4),t.registerSubTypeDefaulter("legend",function(){return"plain"}),V4(t)}var G4=function(t){W(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=rl(r);t.prototype.init.call(this,r,i,n),y1(this,r,a)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),y1(this,this.option,r)},e.type="legend.scroll",e.defaultOption=tl(Ud.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}(Ud);function y1(t,e,r){var i=t.getOrient(),n=[1,1];n[i.index]=0,oa(e,r,{type:"box",ignoreSize:!!n})}const W4=G4;var x1=oe,cv=["width","height"],vv=["x","y"],X4=function(t){W(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 x1),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new x1)},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=Y(h)?h:[h,h];d("pagePrev",0);var c=i.getModel("pageTextStyle");f.add(new Jt({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",_=Ap(i.get("pageIcons",!0)[i.getOrient().name][g],{onclick:rt(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=cv[u],h=vv[u],v=cv[1-u],c=vv[1-u];o&&io("horizontal",l,r.get("selectorItemGap",!0));var d=r.get("selectorButtonGap",!0),p=l.getBoundingRect(),g=[-p.x,-p.y],m=lt(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;io(r.get("orient"),f,r.get("itemGap"),a?n.width:null,a?null:n.height),io("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=gt(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 ie({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&&Rr(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;M(["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=cv[o],l=vv[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}(fb);const Y4=X4;function Z4(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 $4(t){nr(hb),t.registerComponentModel(W4),t.registerComponentView(Y4),Z4(t)}function q4(t){nr(hb),nr($4)}var K4=function(t){W(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=tl(Mf.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(Mf);const j4=K4;var bg=Kt();function Q4(t,e,r){bg(t).coordSysRecordMap.each(function(i){var n=i.dataZoomInfoMap.get(e.uid);n&&(n.getRange=r)})}function J4(t,e){for(var r=bg(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||cb(r,o))}}}function cb(t,e){if(e){t.removeKey(e.model.uid);var r=e.controller;r&&r.dispose()}}function tk(t,e){var r={model:e,containsPoint:de(rk,e),dispatchAction:de(ek,t),dataZoomInfoMap:null,controller:null},i=r.controller=new CO(t.getZr());return M(["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 ek(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function rk(t,e,r,i){return t.coordinateSystem.containPoint([r,i])}function ik(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 nk(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var i=bg(r),n=i.coordSysRecordMap||(i.coordSysRecordMap=ut());n.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=rb(a);M(o.infoList,function(s){var l=s.model.uid,u=n.get(l)||n.set(l,tk(r,s.model)),f=u.dataZoomInfoMap||(u.dataZoomInfoMap=ut());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){cb(n,a);return}var f=ik(l);o.enable(f.controlType,f.opt),o.setPointerChecker(a.containsPoint),ah(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var ak=function(t){W(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(),Q4(n,r,{pan:rt(dv.pan,this),zoom:rt(dv.zoom,this),scrollMove:rt(dv.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){J4(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(ib),dv={zoom:function(t,e,r,i){var n=this.range,a=n.slice(),o=t.axisModels[0];if(o){var s=pv[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(al(0,a,[0,100],0,f.minSpan,f.maxSpan),this.range=a,n[0]!==a[0]||n[1]!==a[1])return a}},pan:T1(function(t,e,r,i,n,a){var o=pv[i]([a.oldX,a.oldY],[a.newX,a.newY],e,n,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:T1(function(t,e,r,i,n,a){var o=pv[i]([0,0],[a.scrollDelta,a.scrollDelta],e,n,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function T1(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(al(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var pv={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}};const ok=ak;function sk(t){nb(t),t.registerComponentModel(j4),t.registerComponentView(ok),nk(t)}var lk=function(t){W(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=tl(Mf.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}(Mf);const uk=lk;var ts=ie,S1=7,fk=1,gv=30,hk=7,es="horizontal",w1="vertical",ck=5,vk=["line","bar","candlestick","scatter"],dk={easing:"cubicOut",duration:100,delay:0},pk=function(t){W(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=rt(this._onBrush,this),this._onBrushEnd=rt(this._onBrushEnd,this)},e.prototype.render=function(r,i,n,a){if(t.prototype.render.apply(this,arguments),ah(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(){ff(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 oe;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?hk:0,o=this._findCoordRect(),s={width:i.getWidth(),height:i.getHeight()},l=this._orient===es?{right:s.width-o.x-o.width,top:s.height-gv-S1-a,width:o.width,height:gv}:{right:S1,top:o.y,width:gv,height:o.height},u=rl(r.option);M(["right","top","width","height"],function(h){u[h]==="ph"&&(u[h]=l[h])});var f=nn(u,s);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===w1&&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===es&&!o?{scaleY:l?1:-1,scaleX:1}:n===es&&o?{scaleY:l?1:-1,scaleX:-1}:n===w1&&!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 ts({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new ts({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:rt(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,C){if(y>0&&C%y){_+=m;return}var E=A==null||isNaN(A)||A==="",D=E?0:ae(A,h,c,!0);E&&!x&&C?(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 C=S.getModel(A?"selectedDataBackground":"dataBackground"),E=new oe,D=new Js({shape:{points:u},segmentIgnoreThreshold:1,style:C.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),L=new Xf({shape:{points:f},segmentIgnoreThreshold:1,style:C.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return E.add(D),E.add(L),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();M(l,function(u){if(!n&&!(i!==!0&&Ct(vk,u.get("type"))<0)){var f=a.getComponent(ji(o),s).axis,h=gk(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 ts({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(v),o.add(new ts({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:fk,fill:"rgba(0,0,0,0)"}})),M([0,1],function(y){var x=l.get("handleIcon");!cf[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var S=Xr(x,-1,0,2,2,null,!0);S.attr({cursor:b1(this._orient),draggable:!0,drift:rt(this._onDragMove,this,y),ondragend:rt(this._onDragEnd,this),onmouseover:rt(this._showDataInfo,this,!0),onmouseout:rt(this._showDataInfo,this,!1),z2:5});var T=S.getBoundingRect(),w=l.get("handleSize");this._handleHeight=ve(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(),ef(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 Jt({silent:!0,invisible:!0,style:er(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=ve(l.get("moveHandleSize"),s[1]),p=i.moveHandle=new ie({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=Xr(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 ie({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:b1(this._orient),drift:rt(this._onDragMove,this,"all"),ondragstart:rt(this._showDataInfo,this,!0),ondragend:rt(this._onDragEnd,this),onmouseover:rt(this._showDataInfo,this,!0),onmouseout:rt(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[ae(r[0],[0,100],i,!0),ae(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];al(i,a,o,n.get("zoomLock")?"all":r,s.minSpan!=null?ae(s.minSpan,l,o,!0):null,s.maxSpan!=null?ae(s.maxSpan,l,o,!0):null);var u=this._range,f=this._range=Gn([ae(a[0],o,l,!0),ae(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=Gn(n.slice()),o=this._size;M([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 ie,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=Gn(this._handleEnds.slice());c.call(this,0),c.call(this,1);function c(d){var p=ys(n.handles[d].parent,this.group),g=bp(d===0?"right":"left",p),m=this._handleWidth/2+ck,_=Ji([v[d]+(d===0?-m:m),this._size[1]/2],p);a[d].setStyle({x:_[0],y:_[1],verticalAlign:o===es?"middle":g,align:o===es?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 ft(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,Ei(a.event);var o=this._displayables.sliderGroup.getLocalTransform(),s=Ji([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 St(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=Gn([ae(n.x,o,s,!0),ae(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&&(Ei(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 ts({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?dk:null,start:i[0],end:i[1]})},e.prototype._findCoordRect=function(){var r,i=rb(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}(ib);function gk(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function b1(t){return t==="vertical"?"ns-resize":"ew-resize"}const mk=pk;function _k(t){t.registerComponentModel(uk),t.registerComponentView(mk),nb(t)}function yk(t){nr(sk),nr(_k)}var vb={get:function(t,e,r){var i=lt((xk[t]||{})[e]);return r&&Y(i)?i[i.length-1]:i}},xk={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]}},A1=Ne.mapVisual,Tk=Ne.eachVisual,Sk=Y,E1=M,wk=Gn,bk=ae,Df=function(t){W(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&&N4(n,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(r){var i=this.stateList;r=rt(r,this),this.controllerVisuals=m1(this.option.controller,i,r),this.targetVisuals=m1(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=pe(r),i},e.prototype.eachTargetSeries=function(r,i){M(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||["<",">"],Y(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(ft(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=wk([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={});vt(a,n),vt(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){Sk(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]={},E1(d,function(g,m){if(Ne.isValidType(m)){var _=vb.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";E1(this.stateList,function(m){var _=this.itemSize,y=h[m];y||(y=h[m]={color:s?d:[d]}),y.symbol==null&&(y.symbol=v&&lt(v)||(s?g:[g])),y.symbolSize==null&&(y.symbolSize=c&&lt(c)||(s?_[0]:[_[0],_[0]])),y.symbol=A1(y.symbol,function(T){return T==="none"?g:T});var x=y.symbolSize;if(x!=null){var S=-1/0;Tk(x,function(T){T>S&&(S=T)}),y.symbolSize=A1(x,function(T){return bk(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}(Ht),C1=[20,140],Ak=function(t){W(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]=C1[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=C1[1])},e.prototype._resetRange=function(){var r=this.getExtent(),i=this.option.range;!i||i.auto?(r.auto=1,this.option.range=r):Y(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),M(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=Gn((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=M1(this,"outOfRange",this.getExtent()),n=M1(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=tl(Df.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}(Df);function M1(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}const Ek=Ak;var Ck=function(t){W(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=el(i.get("padding")||0),a=r.getBoundingRect();r.add(new ie({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=Ne.prepareVisualTypes(h);return M(v,function(c){var d=h[c];n.convertOpacityToAlpha&&c==="opacity"&&(c="colorAlpha",d=h.__alphaForOpacity),Ne.dependsOn(c,i)&&d&&d.applyVisual(r,u,f)}),s[i]},e.prototype.positionGroup=function(r){var i=this.visualMapModel,n=this.api;tS(r,i.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},e.prototype.doRender=function(r,i,n,a){},e.type="visualMap",e}(cr);const db=Ck;var D1=[["left","right","width"],["top","bottom","height"]];function pb(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=D1[o],l=[0,null,10],u={},f=0;f<3;f++)u[D1[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=nn(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 Bu(t,e){return M(t||[],function(r){r.dataIndex!=null&&(r.dataIndexInside=r.dataIndex,r.dataIndex=null),r.highlightKey="visualMap"+(e?e.componentIndex:"")}),t}var ri=ae,Mk=M,L1=Math.min,mv=Math.max,Dk=12,Lk=6,Rk=function(t){W(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.doRender=function(r,i,n,a){this._api=n,(!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 Jt({style:er(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=pb(i,this.api,a),u=n.mainGroup=this._createBarGroup(l),f=new oe;u.add(f),f.add(n.outOfRange=R1()),f.add(n.inRange=R1(null,s?I1(this._orient):null,rt(this._dragHandle,this,"all",!1),rt(this._dragHandle,this,"all",!0))),f.setClipPath(new ie({shape:{x:0,y:0,width:a[0],height:a[1],r:3}}));var h=i.textStyleModel.getTextRect("国"),v=mv(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=rt(this._dragHandle,this,n,!1),u=rt(this._dragHandle,this,n,!0),f=Ci(r.get("handleSize"),a[0]),h=Xr(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){Ei(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(),gp(h,!0),i.add(h);var c=this.visualMapModel.textStyleModel,d=new Jt({cursor:v,draggable:!0,drift:l,onmousemove:function(m){Ei(m.event)},ondragend:u,style:er(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=Ci(r.get("indicatorSize"),n[0]),l=Xr(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 Pr){var f=l.style;l.useStyle(H({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 Jt({silent:!0,invisible:!0,style:er(h,{x:0,y:0,text:""})});this.group.add(v);var c=[(o==="horizontal"?a/2:Lk)+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():P1(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=[ri(i[0],n,a,!0),ri(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]];al(i,a,o,r,0);var s=n.getExtent();this._dataInterval=[ri(a[0],o,s,!0),ri(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 xp(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 oe(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();Mk([0,1],function(f){var h=o[f];h.setStyle("fill",i.handlesColor[f]),h.y=r[f];var v=ri(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=Ji(n.handleLabelPoints[f],ys(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=ri(r,s,u,!0),g=l[0]-d/2,m={x:h.x,y:h.y};h.y=p,h.x=g;var _=Ji(f.indicatorLabelPoint,ys(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 C=this._shapes.handleLabels;if(C)for(var E=0;E<C.length;E++)this._api.enterBlur(C[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]=L1(mv(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=L1(mv(o[0],r),o[1]);var l=Pk(n,s,o),u=[r-l,r+l],f=ri(r,o,s,!0),h=[ri(u[0],o,s,!0),ri(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||P1(n))&&(c=this._hoverLinkDataIndices=n.findTargetDataIndices(h));var d=UE(v,c);this._dispatchHighDown("downplay",Bu(d[0],n)),this._dispatchHighDown("highlight",Bu(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var i;if(Ya(r.target,function(l){var u=Ft(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",Bu(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=ys(i,a?null:this.group);return Y(r)?Ji(r,o,n):bp(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.prototype.remove=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(db);function R1(t,e,r,i){return new Js({shape:{points:t},draggable:!!r,cursor:e,drift:r,onmousemove:function(n){Ei(n.event)},ondragend:i})}function Pk(t,e,r){var i=Dk/2,n=t.get("hoverLinkDataSize");return n&&(i=ri(n,e,r,!0)/2),i}function P1(t){var e=t.get("hoverLinkOnHandle");return!!(e??t.get("realtime"))}function I1(t){return t==="vertical"?"ns-resize":"ew-resize"}const Ik=Rk;var Nk={type:"selectDataRange",event:"dataRangeSelected",update:"update"},Ok=function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(r){r.setSelected(t.selected)})},Bk=[{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(O4(i.stateList,i.targetVisuals,rt(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(rt(Fk,null,t,n))||{stops:[],outerColors:[]},o=n.getDataDimensionIndex(r);o>=0&&(a.dimension=o,i.push(a))}}),t.getData().setVisual("visualMeta",i)}}];function Fk(t,e,r,i){for(var n=e.targetVisuals[i],a=Ne.prepareVisualTypes(n),o={color:FS(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=M;function kk(t){var e=t&&t.visualMap;Y(e)||(e=e?[e]:[]),N1(e,function(r){if(r){Fa(r,"splitList")&&!Fa(r,"pieces")&&(r.pieces=r.splitList,delete r.splitList);var i=r.pieces;i&&Y(i)&&N1(i,function(n){Q(n)&&(Fa(n,"start")&&!Fa(n,"min")&&(n.min=n.start),Fa(n,"end")&&!Fa(n,"max")&&(n.max=n.end))})}})}function Fa(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var O1=!1;function gb(t){O1||(O1=!0,t.registerSubTypeDefaulter("visualMap",function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(Nk,Ok),M(Bk,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(kk))}function zk(t){t.registerComponentModel(Ek),t.registerComponentView(Ik),gb(t)}var Uk=function(t){W(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=[],Hk[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=lt(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=j(this._pieceList,function(l){return l=lt(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var r=this.option,i={},n=Ne.listVisualTypes(),a=this.isCategory();M(r.pieces,function(s){M(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),M(i,function(s,l){var u=!1;M(this.stateList,function(f){u=u||o(r,f,l)||o(r.target,f,l)},this),!u&&M(this.stateList,function(f){(r[f]||(r[f]={}))[l]=vb.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,M(a,function(l,u){var f=this.getSelectedMapKey(l);o.hasOwnProperty(f)||(o[f]=!0)},this),n.selectedMode==="single"){var s=!1;M(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=lt(r)},e.prototype.getValueState=function(r){var i=Ne.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=Ne.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 M(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=tl(Df.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}(Df),Hk={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]}),um(t),M(t,function(u,f){u.index=f,u.text=this.formatValueText(u.interval)},this)},categories:function(t){var e=this.option;M(e.categories,function(r){t.push({text:this.formatValueText(r,!0),value:r})},this),B1(e,t)},pieces:function(t){var e=this.option;M(e.pieces,function(r,i){Q(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=Ne.retrieveVisuals(r),t.push(n)},this),B1(e,t),um(t),M(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 B1(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}const Vk=Uk;var Gk=function(t){W(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=ao(i.get("showLabel",!0),!h);h&&this._renderEndsText(r,h[0],u,v,l),M(f.viewPieceList,function(c){var d=c.piece,p=new oe;p.onclick=rt(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 Jt({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),io(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:Bu(s.findTargetDataIndices(i),s)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,i=r.option;if(i.orient==="vertical")return pb(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 oe,l=this.visualMapModel.textStyleModel;s.add(new Jt({style:er(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=j(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(Xr(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=lt(n.selected),s=i.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,M(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}(db);const Wk=Gk;function Xk(t){t.registerComponentModel(Vk),t.registerComponentView(Wk),gb(t)}function Yk(t){nr(zk),nr(Xk)}var _v=Math.sin,yv=Math.cos,mb=Math.PI,kn=Math.PI*2,Zk=180/mb,_b=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=$i(h-kn)||(f?u>=kn:-u>=kn),c=u>0?u%kn:u%kn+kn,d=!1;v?d=!0:$i(h)?d=!1:d=c>=mb==!!f;var p=e+i*yv(o),g=r+n*_v(o);this._start&&this._add("M",p,g);var m=Math.round(a*Zk);if(v){var _=1/this._p,y=(f?1:-1)*(kn-_);this._add("A",i,n,m,1,+f,e+i*yv(o+y),r+n*_v(o+y)),_>.01&&this._add("A",i,n,m,0,+f,p,g)}else{var x=e+i*yv(s),S=r+n*_v(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}(),Es="none",$k=Math.round;function qk(t){var e=t.fill;return e!=null&&e!==Es}function Kk(t){var e=t.stroke;return e!=null&&e!==Es}var Wd=["lineCap","miterLimit","lineJoin"],jk=j(Wd,function(t){return"stroke-"+t.toLowerCase()});function Qk(t,e,r,i){var n=e.opacity==null?1:e.opacity;if(r instanceof Pr){t("opacity",n);return}if(qk(e)){var a=Ds(e.fill);t("fill",a.color);var o=e.fillOpacity!=null?e.fillOpacity*a.opacity*n:a.opacity*n;(i||o<1)&&t("fill-opacity",o)}else t("fill",Es);if(Kk(e)){var s=Ds(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((i||u!==1)&&t("stroke-width",u),(i||h)&&t("paint-order",h?"stroke":"fill"),(i||f<1)&&t("stroke-opacity",f),e.lineDash){var v=Wp(r),c=v[0],d=v[1];c&&(d=$k(d||0),t("stroke-dasharray",c.join(",")),(d||i)&&t("stroke-dashoffset",d))}else i&&t("stroke-dasharray",Es);for(var p=0;p<Wd.length;p++){var g=Wd[p];if(i||e[g]!==Ku[g]){var m=e[g]||Ku[g];m&&t(jk[p],m)}}}else i&&t("stroke",Es)}var yb="http://www.w3.org/2000/svg",xb="http://www.w3.org/1999/xlink",Jk="http://www.w3.org/2000/xmlns/",tz="http://www.w3.org/XML/1998/namespace";function Tb(t){return document.createElementNS(yb,t)}function Se(t,e,r,i,n){return{tag:t,attrs:r||{},children:i,text:n,key:e}}function ez(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 rz(t){return"</"+t+">"}function Ag(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 ez(o,s)+(o!=="style"?Ce(l):l||"")+(a?""+r+j(a,function(u){return i(u)}).join(r)+r:"")+rz(o)}return i(t)}function iz(t,e,r){r=r||{};var i=r.newline?`
`:"",n=" {"+i,a=i+"}",o=j(_t(t),function(l){return l+n+j(_t(t[l]),function(u){return u+":"+t[l][u]+";"}).join(i)+a}).join(i),s=j(_t(e),function(l){return"@keyframes "+l+n+j(_t(e[l]),function(u){return u+n+j(_t(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 Xd(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function F1(t,e,r,i){return Se("svg","root",{width:t,height:e,xmlns:yb,"xmlns:xlink":xb,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+t+" "+e:!1},r)}var k1={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"},Un="transform-origin";function nz(t,e,r){var i=H({},t.shape);H(i,e),t.buildPath(r,i);var n=new _b;return n.reset(Sx(t)),r.rebuildPath(n,1),n.generateStr(),n.getStr()}function az(t,e){var r=e.originX,i=e.originY;(r||i)&&(t[Un]=r+"px "+i+"px")}var oz={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Sb(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function sz(t,e,r){var i=t.shape.paths,n={},a,o;if(M(i,function(l){var u=Xd(r.zrId);u.animation=!0,ph(l,{},u,!0);var f=u.cssAnims,h=u.cssNodes,v=_t(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=Sb(n,r);return a.replace(o,s)}}function z1(t){return q(t)?k1[t]?"cubic-bezier("+k1[t]+")":rp(t)?t:"":""}function ph(t,e,r,i){var n=t.animators,a=n.length,o=[];if(t instanceof DT){var s=sz(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=z1(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(Xt,Nt,Et){for(var K=Xt.getTracks(),wt=Xt.getMaxTime(),se=0;se<K.length;se++){var Zt=K[se];if(Zt.needsAnimate()){var Be=Zt.keyframes,Nr=Zt.propName;if(Et&&(Nr=Et(Nr)),Nr)for(var gh=0;gh<Be.length;gh++){var ll=Be[gh],ul=Math.round(ll.time/wt*100)+"%",Dg=z1(ll.easing),Lg=ll.rawValue;(q(Lg)||Qt(Lg))&&(Nt[ul]=Nt[ul]||{},Nt[ul][Nr]=ll.rawValue,Dg&&(Nt[ul][b]=Dg))}}}}for(var C=0;C<x;C++){var E=y[C],D=E.targetName;D?D==="shape"&&A(E,T):!i&&A(E,S)}for(var L in S){var P={};Mx(P,t),H(P,S[L]);var N=bx(P),I=S[L][b];w[L]=N?{transform:N}:{},az(w[L],P),I&&(w[L][b]=I)}var k,O=!0;for(var L in T){w[L]=w[L]||{};var U=!k,I=T[L][b];U&&(k=new Mi);var z=k.len();k.reset(),w[L].d=nz(t,T[L],k);var nt=k.len();if(!U&&z!==nt){O=!1;break}I&&(w[L][b]=I)}if(!O)for(var L in w)delete w[L].d;if(!i)for(var C=0;C<x;C++){var E=y[C],D=E.targetName;D==="style"&&A(E,w,function(K){return oz[K]})}for(var $=_t(w),J=!0,it,C=1;C<$.length;C++){var Pt=$[C-1],pt=$[C];if(w[Pt][Un]!==w[pt][Un]){J=!1;break}it=w[Pt][Un]}if(J&&it){for(var L in w)w[L][Un]&&delete w[L][Un];e[Un]=it}if(ce($,function(Xt){return _t(w[Xt]).length>0}).length){var Bt=Sb(w,r);return Bt+" "+_[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var m=r.zrId+"-cls-"+r.cssClassIdx++;r.cssNodes["."+m]={animation:o.join(",")},e.class=m}}var $s=Math.round;function wb(t){return t&&q(t.src)}function bb(t){return t&&ft(t.toDataURL)}function Eg(t,e,r,i){Qk(function(n,a){var o=n==="fill"||n==="stroke";o&&Tx(a)?Eb(e,t,n,i):o&&ip(a)?Cb(r,t,n,i):t[n]=a},e,r,!1),dz(r,t,i)}function U1(t){return $i(t[0]-1)&&$i(t[1])&&$i(t[2])&&$i(t[3]-1)}function lz(t){return $i(t[4])&&$i(t[5])}function Cg(t,e,r){if(e&&!(lz(e)&&U1(e))){var i=r?10:1e4;t.transform=U1(e)?"translate("+$s(e[4]*i)/i+" "+$s(e[5]*i)/i+")":YA(e)}}function H1(t,e,r){for(var i=t.points,n=[],a=0;a<i.length;a++)n.push($s(i[a][0]*r)/r),n.push($s(i[a][1]*r)/r);e.points=n.join(" ")}function V1(t){return!t.smooth}function uz(t){var e=j(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]]=$s(s*n)/n)}}}var fz={circle:[uz(["cx","cy","r"])],polyline:[H1,V1],polygon:[H1,V1]};function hz(t){for(var e=t.animators,r=0;r<e.length;r++)if(e[r].targetName==="shape")return!0;return!1}function Ab(t,e){var r=t.style,i=t.shape,n=fz[t.type],a={},o=e.animation,s="path",l=t.style.strokePercent,u=e.compress&&Sx(t)||4;if(n&&!e.willUpdate&&!(n[1]&&!n[1](i))&&!(o&&hz(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 _b),p.reset(u),v.rebuildPath(p,l),p.generateStr(),d.__svgPathVersion=c,d.__svgPathStrokePercent=l),a.d=p.getStr()}return Cg(a,t.transform),Eg(a,r,t,e),e.animation&&ph(t,a,e),Se(s,t.id+"",a)}function cz(t,e){var r=t.style,i=r.image;if(i&&!q(i)&&(wb(i)?i=i.src:bb(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),Cg(l,t.transform),Eg(l,r,t,e),e.animation&&ph(t,l,e),Se("image",t.id+"",l)}}function vz(t,e){var r=t.style,i=r.text;if(i!=null&&(i+=""),!(!i||isNaN(r.x)||isNaN(r.y))){var n=r.font||en,a=r.x||0,o=$A(r.y||0,kf(n),r.textBaseline),s=ZA[r.textAlign]||r.textAlign,l={"dominant-baseline":"central","text-anchor":s};if(iT(r)){var u="",f=r.fontStyle,h=rT(r.fontSize);if(!parseFloat(h))return;var v=r.fontFamily||K1,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),Cg(l,t.transform),Eg(l,r,t,e),e.animation&&ph(t,l,e),Se("text",t.id+"",l,void 0,i)}}function G1(t,e){if(t instanceof Ut)return Ab(t,e);if(t instanceof Pr)return cz(t,e);if(t instanceof ju)return vz(t,e)}function dz(t,e,r){var i=t.style;if(qA(i)){var n=KA(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=Ds(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]=Se("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[Se("feDropShadow","",{dx:f/l,dy:h/u,stdDeviation:_,"flood-color":p,"flood-opacity":d})]),a[n]=o}e.filter=Of(o)}}function Eb(t,e,r,i){var n=t[r],a,o={gradientUnits:n.global?"userSpaceOnUse":"objectBoundingBox"};if(yx(n))a="linearGradient",o.x1=n.x,o.y1=n.y,o.x2=n.x2,o.y2=n.y2;else if(xx(n))a="radialGradient",o.cx=gt(n.x,.5),o.cy=gt(n.y,.5),o.r=gt(n.r,.5);else return;for(var s=n.colorStops,l=[],u=0,f=s.length;u<f;++u){var h=Pv(s[u].offset)*100+"%",v=s[u].color,c=Ds(v),d=c.color,p=c.opacity,g={offset:h};g["stop-color"]=d,p<1&&(g["stop-opacity"]=p),l.push(Se("stop",u+"",g))}var m=Se(a,"",o,l),_=Ag(m),y=i.gradientCache,x=y[_];x||(x=i.zrId+"-g"+i.gradientIdx++,y[_]=x,o.id=x,i.defs[x]=Se(a,x,o,l)),e[r]=Of(x)}function Cb(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(_x(n)){var v=n.imageWidth,c=n.imageHeight,d=void 0,p=n.image;if(q(p)?d=p:wb(p)?d=p.src:bb(p)&&(d=p.toDataURL()),typeof Image>"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";Dr(v,g),Dr(c,g)}else if(v==null||c==null){var m=function(C,E){if(C){var D=C.elm,L=v||E.width,P=c||E.height;C.tag==="pattern"&&(u?(P=1,L/=a.width):f&&(L=1,P/=a.height)),C.attrs.width=L,C.attrs.height=P,D&&(D.setAttribute("width",L),D.setAttribute("height",P))}},_=hp(d,null,t,function(C){l||m(T,C),m(h,C)});_&&_.width&&_.height&&(v=v||_.width,c=c||_.height)}h=Se("image","img",{href:d,width:v,height:c}),o.width=v,o.height=c}else n.svgElement&&(h=lt(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=bx(n);S&&(o.patternTransform=S);var T=Se("pattern","",o,[h]),w=Ag(T),b=i.patternCache,A=b[w];A||(A=i.zrId+"-p"+i.patternIdx++,b[w]=A,o.id=A,T=i.defs[A]=Se("pattern",A,o,[h])),e[r]=Of(A)}}function pz(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]=Se("clipPath",a,o,[Ab(t,r)])}e["clip-path"]=Of(a)}function W1(t){return document.createTextNode(t)}function Vn(t,e,r){t.insertBefore(e,r)}function X1(t,e){t.removeChild(e)}function Y1(t,e){t.appendChild(e)}function Mb(t){return t.parentNode}function Db(t){return t.nextSibling}function xv(t,e){t.textContent=e}var Z1=58,gz=120,mz=Se("","");function Yd(t){return t===void 0}function ni(t){return t!==void 0}function _z(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 hs(t,e){var r=t.key===e.key,i=t.tag===e.tag;return i&&r}function qs(t){var e,r=t.children,i=t.tag;if(ni(i)){var n=t.elm=Tb(i);if(Mg(mz,t),Y(r))for(e=0;e<r.length;++e){var a=r[e];a!=null&&Y1(n,qs(a))}else ni(t.text)&&!Q(t.text)&&Y1(n,W1(t.text))}else t.elm=W1(t.text);return t.elm}function Lb(t,e,r,i,n){for(;i<=n;++i){var a=r[i];a!=null&&Vn(t,qs(a),e)}}function Lf(t,e,r,i){for(;r<=i;++r){var n=e[r];if(n!=null)if(ni(n.tag)){var a=Mb(n.elm);X1(a,n.elm)}else X1(t,n.elm)}}function Mg(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.charCodeAt(0)!==gz?i.setAttribute(r,o):r==="xmlns:xlink"||r==="xmlns"?i.setAttributeNS(Jk,r,o):r.charCodeAt(3)===Z1?i.setAttributeNS(tz,r,o):r.charCodeAt(5)===Z1?i.setAttributeNS(xb,r,o):i.setAttribute(r,o))}for(r in n)r in a||i.removeAttribute(r)}}function yz(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]:hs(o,u)?(Ha(o,u),o=e[++i],u=r[++n]):hs(s,f)?(Ha(s,f),s=e[--a],f=r[--l]):hs(o,f)?(Ha(o,f),Vn(t,o.elm,Db(s.elm)),o=e[++i],f=r[--l]):hs(s,u)?(Ha(s,u),Vn(t,s.elm,o.elm),s=e[--a],u=r[++n]):(Yd(h)&&(h=_z(e,i,a)),v=h[u.key],Yd(v)?Vn(t,qs(u),o.elm):(c=e[v],c.tag!==u.tag?Vn(t,qs(u),o.elm):(Ha(c,u),e[v]=void 0,Vn(t,c.elm,o.elm))),u=r[++n]);(i<=a||n<=l)&&(i>a?(d=r[l+1]==null?null:r[l+1].elm,Lb(t,d,r,n,l)):Lf(t,e,i,a))}function Ha(t,e){var r=e.elm=t.elm,i=t.children,n=e.children;t!==e&&(Mg(t,e),Yd(e.text)?ni(i)&&ni(n)?i!==n&&yz(r,i,n):ni(n)?(ni(t.text)&&xv(r,""),Lb(r,null,n,0,n.length-1)):ni(i)?Lf(r,i,0,i.length-1):ni(t.text)&&xv(r,""):t.text!==e.text&&(ni(i)&&Lf(r,i,0,i.length-1),xv(r,e.text)))}function xz(t,e){if(hs(t,e))Ha(t,e);else{var r=t.elm,i=Mb(r);qs(e),i!==null&&(Vn(i,e.elm,Db(r)),Lf(i,[t],0,0))}return e}var Tz=0,Sz=function(){function t(e,r,i){if(this.type="svg",this.refreshHover=$1(),this.configLayer=$1(),this.storage=r,this._opts=i=H({},i),this.root=e,this._id="zr"+Tz++,this._oldVNode=F1(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=Tb("svg");Mg(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",xz(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return G1(e,Xd(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=Xd(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress;var o=[],s=this._bgVNode=wz(i,n,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=Se("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=j(_t(a.defs),function(v){return a.defs[v]});if(u.length&&o.push(Se("defs","defs",{},u)),e.animation){var f=iz(a.cssNodes,a.cssAnims,{newline:!0});if(f){var h=Se("style","stl",{},[],f);o.push(h)}}return F1(i,n,o,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},Ag(this.renderToVNode({animation:gt(e.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:gt(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 _={};pz(v[m],_,r);var y=Se("g","clip-g-"+u++,_,[]);(s?s.children:i).push(y),a[o++]=y,s=y}l=v;var x=G1(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=Za(n,0,i),r=Za(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(ip(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=QA(r),r&&i+"base64,"+r):i+"charset=UTF-8,"+encodeURIComponent(r)},t}();function $1(t){return function(){}}function wz(t,e,r,i){var n;if(r&&r!=="none")if(n=Se("rect","bg",{width:t,height:e,x:"0",y:"0",id:"0"}),Tx(r))Eb({fill:r},n.attrs,"fill",i);else if(ip(r))Cb({style:{fill:r},dirty:Me,getBoundingRect:function(){return{width:t,height:e}}},n.attrs,"fill",i);else{var a=Ds(r),o=a.color,s=a.opacity;n.attrs.fill=o,s<1&&(n.attrs["fill-opacity"]=s)}return n}const bz=Sz;function Az(t){t.registerPainter("svg",bz)}nr([a2,I4,Y5,yk,q4,WN,Yk,e4,m5,l5,Az,n2]);export{Cz as default};
