70 lines
1.9 MiB
70 lines
1.9 MiB
import{j as B,T as Z_,p as RF,o as ke,S as OF,C as Xo,e as Ix,B as Ee,g as IF,E as LF,s as hd,m as cr,n as op,M as mn,l as BF,U as DF,d as FF,t as o1,i as l1,q as Gd}from"./semi-ui-fcB3D8nU.js";import{g as aE,R as ds,r as ot}from"./react-core-C8o2IdY8.js";import{ax as jF,cI as zF,A as _i,s as Qt,bn as HF,aO as al,cJ as NF,cK as Lx,bk as GF,cL as WF,bf as lp,bg as dd,cM as Hv,cN as VF,cO as UF,cP as Nv,cQ as Gv,cR as Wv,aM as qr,cS as h1}from"./index-DApEyau7.js";import{u as xc}from"./i18n-DJWjvQyM.js";import{p as $F,d as YF,w as XF,W as KF,r as d1,a as qF,P as ZF}from"./withdrawProfileUtils-BeheHjO7.js";import"./tools-qobPTha0.js";import"./react-components-KaTRN41W.js";const Ko={mode:"desktop-browser"};/**
|
||
* @license lucide-react v0.511.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const JF=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],u1=jF("chart-line",JF),QF=s=>s;var ri;(function(s){s["desktop-browser"]="desktop-browser",s["mobile-browser"]="mobile-browser",s.node="node",s.worker="worker",s.miniApp="miniApp",s.wx="wx",s["desktop-miniApp"]="desktop-miniApp",s.lynx="lynx"})(ri||(ri={}));var Z;(function(s){s.cartesianAxis="cartesianAxis",s.cartesianBandAxis="cartesianAxis-band",s.cartesianLinearAxis="cartesianAxis-linear",s.cartesianTimeAxis="cartesianAxis-time",s.cartesianLogAxis="cartesianAxis-log",s.cartesianSymlogAxis="cartesianAxis-symlog",s.polarAxis="polarAxis",s.polarBandAxis="polarAxis-band",s.polarLinearAxis="polarAxis-linear",s.crosshair="crosshair",s.cartesianCrosshair="cartesianCrosshair",s.polarCrosshair="polarCrosshair",s.dataZoom="dataZoom",s.geoCoordinate="geoCoordinate",s.indicator="indicator",s.discreteLegend="discreteLegend",s.continuousLegend="continuousLegend",s.colorLegend="colorLegend",s.sizeLegend="sizeLegend",s.mapLabel="mapLabel",s.markLine="markLine",s.markArea="markArea",s.markPoint="markPoint",s.tooltip="tooltip",s.title="title",s.player="player",s.scrollBar="scrollBar",s.label="label",s.totalLabel="totalLabel",s.brush="brush",s.poptip="poptip",s.customMark="customMark"})(Z||(Z={}));var oE={exports:{}};(function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function n(l,h,d){this.fn=l,this.context=h,this.once=d||!1}function r(l,h,d,u,c){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new n(d,u||l,c),g=e?e+h:h;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],p]:l._events[g].push(p):(l._events[g]=p,l._eventsCount++),l}function a(l,h){--l._eventsCount===0?l._events=new i:delete l._events[h]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],d,u;if(this._eventsCount===0)return h;for(u in d=this._events)t.call(d,u)&&h.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},o.prototype.listeners=function(h){var d=e?e+h:h,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var c=0,p=u.length,g=new Array(p);c<p;c++)g[c]=u[c].fn;return g},o.prototype.listenerCount=function(h){var d=e?e+h:h,u=this._events[d];return u?u.fn?1:u.length:0},o.prototype.emit=function(h,d,u,c,p,g){var f=e?e+h:h;if(!this._events[f])return!1;var _=this._events[f],m=arguments.length,v,y;if(_.fn){switch(_.once&&this.removeListener(h,_.fn,void 0,!0),m){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,d),!0;case 3:return _.fn.call(_.context,d,u),!0;case 4:return _.fn.call(_.context,d,u,c),!0;case 5:return _.fn.call(_.context,d,u,c,p),!0;case 6:return _.fn.call(_.context,d,u,c,p,g),!0}for(y=1,v=new Array(m-1);y<m;y++)v[y-1]=arguments[y];_.fn.apply(_.context,v)}else{var b=_.length,x;for(y=0;y<b;y++)switch(_[y].once&&this.removeListener(h,_[y].fn,void 0,!0),m){case 1:_[y].fn.call(_[y].context);break;case 2:_[y].fn.call(_[y].context,d);break;case 3:_[y].fn.call(_[y].context,d,u);break;case 4:_[y].fn.call(_[y].context,d,u,c);break;default:if(!v)for(x=1,v=new Array(m-1);x<m;x++)v[x-1]=arguments[x];_[y].fn.apply(_[y].context,v)}}return!0},o.prototype.on=function(h,d,u){return r(this,h,d,u,!1)},o.prototype.once=function(h,d,u){return r(this,h,d,u,!0)},o.prototype.removeListener=function(h,d,u,c){var p=e?e+h:h;if(!this._events[p])return this;if(!d)return a(this,p),this;var g=this._events[p];if(g.fn)g.fn===d&&(!c||g.once)&&(!u||g.context===u)&&a(this,p);else{for(var f=0,_=[],m=g.length;f<m;f++)(g[f].fn!==d||c&&!g[f].once||u&&g[f].context!==u)&&_.push(g[f]);_.length?this._events[p]=_.length===1?_[0]:_:a(this,p)}return this},o.prototype.removeAllListeners=function(h){var d;return h?(d=e?e+h:h,this._events[d]&&a(this,d)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=e,o.EventEmitter=o,s.exports=o})(oE);var tj=oE.exports;const jo=aE(tj),Uh=(s,t)=>Object.prototype.toString.call(s)===`[object ${t}]`,ye=(s,t=!1)=>t?typeof s=="boolean":s===!0||s===!1||Uh(s,"Boolean"),K=s=>typeof s=="function",P=s=>s==null,E=s=>s!=null,$t=s=>{const t=typeof s;return s!==null&&t==="object"||t==="function"},ny=s=>typeof s=="object"&&s!==null,Rn=function(s){if(!ny(s)||!Uh(s,"Object"))return!1;if(Object.getPrototypeOf(s)===null)return!0;let t=s;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(s)===t},Re=s=>s===void 0,ht=(s,t=!1)=>{const e=typeof s;return t?e==="string":e==="string"||Uh(s,"String")},$=s=>Array.isArray?Array.isArray(s):Uh(s,"Array"),J_=function(s){return s!==null&&typeof s!="function"&&Number.isFinite(s.length)},ej=s=>Uh(s,"Date"),dt=(s,t=!1)=>{const e=typeof s;return t?e==="number":e==="number"||Uh(s,"Number")},ij=s=>typeof s=="string"&&!isNaN(Number(s))&&!isNaN(parseFloat(s)),N=s=>dt(s)&&Number.isFinite(s),lE=s=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(s),hE=s=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(s),sj=s=>({}).toString.call(s).replace(/^\[object /,"").replace(/]$/,""),nj=Object.prototype,rj=function(s){const t=s&&s.constructor;return s===(typeof t=="function"&&t.prototype||nj)},aj=Object.prototype.hasOwnProperty;function vt(s){if(P(s))return!0;if(J_(s))return!s.length;const t=sj(s);if(t==="Map"||t==="Set")return!s.size;if(rj(s))return!Object.keys(s).length;for(const e in s)if(aj.call(s,e))return!1;return!0}const It=(s,t,e)=>{const i=ht(t)?t.split("."):t;for(let n=0;n<i.length;n++)s=s?s[i[n]]:void 0;return s===void 0?e:s},oj=Object.prototype.hasOwnProperty,Zs=(s,t)=>s!=null&&oj.call(s,t);function bi(s){let t;if(!E(s)||typeof s!="object")return s;const e=$(s),i=s.length;t=e?new Array(i):typeof s=="object"?{}:ye(s)||dt(s)||ht(s)?s:ej(s)?new Date(+s):void 0;const n=e?void 0:Object.keys(Object(s));let r=-1;if(t)for(;++r<(n||s).length;){const a=n?n[r]:r,o=s[a];t[a]=bi(o)}return t}function dE(s,t,e=!1){if(t){if(s===t)return;if(E(t)&&typeof t=="object"){const i=Object(t),n=[];for(const o in i)n.push(o);let{length:r}=n,a=-1;for(;r--;){const o=n[++a];E(i[o])&&typeof i[o]=="object"?lj(s,t,o,e):uE(s,o,i[o])}}}}function lj(s,t,e,i=!1){const n=s[e],r=t[e];let a=t[e],o=!0;if($(r)){if(i)a=[];else if($(n))a=n;else if(J_(n)){a=new Array(n.length);let l=-1;const h=n.length;for(;++l<h;)a[l]=n[l]}}else Rn(r)?(a=n,typeof n!="function"&&typeof n=="object"||(a={})):o=!1;o&&dE(a,r,i),uE(s,e,a)}function uE(s,t,e){(e!==void 0&&!hj(s[t],e)||e===void 0&&!(t in s))&&(s[t]=e)}function hj(s,t){return s===t||Number.isNaN(s)&&Number.isNaN(t)}function lt(s,...t){let e=-1;const i=t.length;for(;++e<i;)dE(s,t[e],!0);return s}function yh(s,t){if(!s||!Rn(s))return s;const e={};return Object.keys(s).forEach(i=>{const n=s[i];let r=!1;t.forEach(a=>{(ht(a)&&a===i||a instanceof RegExp&&i.match(a))&&(r=!0)}),r||(e[i]=n)}),e}function c1(s){return Object.prototype.toString.call(s)}function p1(s){return Object.keys(s)}function Se(s,t,e){if(s===t)return!0;if(typeof s!=typeof t||s==null||t==null)return!1;if(Number.isNaN(s)&&Number.isNaN(t))return!0;if(c1(s)!==c1(t))return!1;if(K(s))return!!(e!=null&&e.skipFunction);if(typeof s!="object")return!1;if($(s)){if(s.length!==t.length)return!1;for(let r=s.length-1;r>=0;r--)if(!Se(s[r],t[r],e))return!1;return!0}if(!Rn(s))return!1;const i=p1(s),n=p1(t);if(i.length!==n.length)return!1;i.sort(),n.sort();for(let r=i.length-1;r>=0;r--)if(i[r]!=n[r])return!1;for(let r=i.length-1;r>=0;r--){const a=i[r];if(!Se(s[a],t[a],e))return!1}return!0}function dj(s){if(!s)return[];if(Object.keys)return Object.keys(s);const t=[];for(const e in s)s.hasOwnProperty(e)&&t.push(e);return t}function uj(s,t,e){const i=dj(t);for(let n=0;n<i.length;n++){const r=i[n];(e?t[r]!=null:s[r]==null)&&(s[r]=t[r])}return s}function Ai(s,t,e=!0){if(s="prototype"in s?s.prototype:s,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames){const i=Object.getOwnPropertyNames(t);for(let n=0;n<i.length;n++){const r=i[n];r!=="constructor"&&(e?t[r]!=null:s[r]==null)&&(s[r]=t[r])}}else uj(s,t,e)}function Y(s){return E(s)?$(s)?s:[s]:[]}function Ma(s){if(J_(s))return s[s.length-1]}const ei=(s,t)=>{var e;if(s.length===0)return;let i=s[0];for(let n=1;n<s.length;n++){const r=s[n];((e=t==null?void 0:t(r,i))!==null&&e!==void 0?e:r-i>0)&&(i=r)}return i},ki=(s,t)=>{var e;if(s.length===0)return;let i=s[0];for(let n=1;n<s.length;n++){const r=s[n];((e=t==null?void 0:t(r,i))!==null&&e!==void 0?e:r-i<0)&&(i=r)}return i};function hp(s,t){if(!$(s)||!$(t)||s.length!==t.length)return!1;for(let e=0;e<s.length;e++)if(s[e]!==t[e])return!1;return!0}function cj(s){return s&&$(s)?Array.from(new Set(Y(s))):s}function cE(s,t=Math.random){let e,i,n=s.length;for(;n;)e=Math.floor(t()*n),i=s[--n],s[n]=s[e],s[e]=i;return s}function ry(s){if(!$(s))return[s];const t=[];for(const e of s)t.push(...ry(e));return t}function pE(s,t,e){E(t)||(t=s,s=0),E(e)||(e=1);let i=-1;const n=0|Math.max(0,Math.ceil((t-s)/e)),r=new Array(n);for(;++i<n;)r[i]=s+i*e;return r}function gE(s,t){return s<t?-1:s>t?1:s>=t?0:NaN}function Qn(s){return Number(s)}function pj(s,t,e=Qn){const i=s.length;if(!i)return;if(i<2)return e(s[0],0,s);const n=(i-1)*t,r=Math.floor(n),a=e(s[r],r,s);return a+(e(s[r+1],r+1,s)-a)*(n-r)}function fE(s,t,e=0,i){for(P(i)&&(i=s.length);e<i;){const n=e+i>>>1;gE(s[n],t)>0?i=n:e=n+1}return e}const gj=(s,t)=>{let e=s;return e=s.sort(gE),pj(e,.5)},fj=1e-10,_j=1e-10;function gs(s,t,e=_j,i=fj){const n=i,r=e*Math.max(s,t);return Math.abs(s-t)<=Math.max(n,r)}function Vn(s,t,e,i){return s>t&&!gs(s,t,e,i)}function bn(s,t,e,i){return s<t&&!gs(s,t,e,i)}const $h=s=>{let t=null,e=null;return(...i)=>(t&&i.every((n,r)=>n===t[r])||(t=i,e=s(...i)),e)},xi=function(s,t,e){return s<t?t:s>e?e:s},sa=(s,t,e)=>{let[i,n]=s;n<i&&(i=s[1],n=s[0]);const r=n-i;return r>=e-t?[t,e]:(i=Math.min(Math.max(i,t),e-r),[i,i+r])};function Bx(s,t){let e;return s>t&&(e=s,s=t,t=e),i=>Math.max(s,Math.min(t,i))}let Ag=!1;try{Ag=typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"}catch{Ag=!1}function lr(s,t,e){let i,n,r,a,o,l,h=0,d=!1,u=!1,c=!0;const p=!t&&t!==0&&Ag;if(typeof s!="function")throw new TypeError("Expected a function");function g(b){const x=i,S=n;return i=n=void 0,h=b,a=s.apply(S,x),a}function f(b,x){return p?(cancelAnimationFrame(o),requestAnimationFrame(b)):setTimeout(b,x)}function _(b){const x=b-l;return l===void 0||x>=t||x<0||u&&b-h>=r}function m(){const b=Date.now();if(_(b))return v(b);o=f(m,function(x){const S=x-h,A=t-(x-l);return u?Math.min(A,r-S):A}(b))}function v(b){return o=void 0,c&&i?g(b):(i=n=void 0,a)}function y(...b){const x=Date.now(),S=_(x);if(i=b,n=this,l=x,S){if(o===void 0)return function(A){return h=A,o=f(m,t),d?g(A):a}(l);if(u)return o=f(m,t),g(l)}return o===void 0&&(o=f(m,t)),a}return t=+t||0,$t(e)&&(d=!!e.leading,u="maxWait"in e,u&&(r=Math.max(N(e.maxWait)?e.maxWait:0,t)),c="trailing"in e?!!e.trailing:c),y.cancel=function(){o!==void 0&&function(b){if(p)return cancelAnimationFrame(b);clearTimeout(b)}(o),h=0,i=l=n=o=void 0},y.flush=function(){return o===void 0?a:v(Date.now())},y.pending=function(){return o!==void 0},y}Ag=!1;function Ka(s,t,e){let i=!0,n=!0;if(typeof s!="function")throw new TypeError("Expected a function");return $t(e)&&(i="leading"in e?!!e.leading:i,n="trailing"in e?!!e.trailing:n),lr(s,t,{leading:i,trailing:n,maxWait:t})}function Wd(s,t){return e=>s*(1-e)+t*e}function mj(s,t){return function(e){return Math.round(s*(1-e)+t*e)}}function vj(s,t){const e=s.valueOf(),i=t.valueOf(),n=new Date;return r=>(n.setTime(e*(1-r)+i*r),n)}const ay=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vv=new RegExp(ay.source,"g");function yj(s){return function(){return s}}function bj(s){return function(t){return s(t)+""}}function xj(s,t){let e,i,n,r=ay.lastIndex=Vv.lastIndex=0,a=-1;const o=[],l=[];for(s+="",t+="";(e=ay.exec(s))&&(i=Vv.exec(t));)(n=i.index)>r&&(n=t.slice(r,n),o[a]?o[a]+=n:o[++a]=n),(e=e[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Wd(e,i)})),r=Vv.lastIndex;return r<t.length&&(n=t.slice(r),o[a]?o[a]+=n:o[++a]=n),o.length<2?l[0]?bj(l[0].x):yj(t):(t=l.length,function(h){for(let d,u=0;u<t;++u)o[(d=l[u]).i]=d.x(h);return o.join("")})}function Sj(s,t){return s&&t?s.replace(/\\?\{([^{}]+)\}/g,(e,i)=>e.charAt(0)==="\\"?e.slice(1):t[i]===void 0?"":t[i]):s}const re=1e-12,le=Math.PI,Js=le/2,pi=2*le,jt=2*Math.PI,Kt=Math.abs,he=Math.atan2,de=Math.cos,ps=Math.max,Ci=Math.min,se=Math.sin,fs=Math.sqrt,qo=Math.pow;function _E(s){return s>1?0:s<-1?le:Math.acos(s)}function g1(s){return s>=1?Js:s<=-1?-Js:Math.asin(s)}function f1(s,t,e,i,n){let r,a;return typeof s=="number"&&typeof e=="number"&&(r=(1-n)*s+n*e),typeof t=="number"&&typeof i=="number"&&(a=(1-n)*t+n*i),{x:r,y:a}}function _1(s,t){return s[0]*t[1]-s[1]*t[0]}function Aj(s,t){return Kt(s[0]-t[0])+Kt(s[1]-t[1])<1e-12}function mE(s,t=10){return Math.round(s*t)/t}function bh(s){const t=s.toString().split(/[eE]/),e=(t[0].split(".")[1]||"").length-(+t[1]||0);return e>0?e:0}function oy(s,t){return mE(s+t,10**Math.max(bh(s),bh(t)))}function kj(s,t){return mE(s-t,10**Math.max(bh(s),bh(t)))}class We{constructor(t=0,e=0,i,n){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new We(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return dt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return dt(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class ze{static distancePP(t,e){return fs(qo(t.x-e.x,2)+qo(t.y-e.y,2))}static distanceNN(t,e,i,n){return fs(qo(t-i,2)+qo(e-n,2))}static distancePN(t,e,i){return fs(qo(e-t.x,2)+qo(i-t.y,2))}static pointAtPP(t,e,i){return new We((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function ly(s,t,e){const{x1:i,y1:n,x2:r,y2:a}=t;return e.onlyTranslate()?(s!==t&&s.setValue(t.x1,t.y1,t.x2,t.y2),s.translate(e.e,e.f),t):(s.clear(),s.add(e.a*i+e.c*n+e.e,e.b*i+e.d*n+e.f),s.add(e.a*r+e.c*n+e.e,e.b*r+e.d*n+e.f),s.add(e.a*r+e.c*a+e.e,e.b*r+e.d*a+e.f),s.add(e.a*i+e.c*a+e.e,e.b*i+e.d*a+e.f),t)}class Pi{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Pi(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,i=0,n=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(t=0,e=0,i=0,n=0){return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(t=0,e=0){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return $(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(t=0,e=0,i=0,n=0){const r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(t=0,e=0){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return ly(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:r,x2:a,y2:o}=this,l=Math.cos(t),h=Math.sin(t),d=e-e*l+i*h,u=i-e*h-i*l;return[l*n-h*r+d,h*n+l*r+u,l*n-h*o+d,h*n+l*o+u,l*a-h*r+d,h*a+l*r+u,l*a-h*o+d,h*a+l*o+u]}scalePoints(t,e,i,n){const{x1:r,y1:a,x2:o,y2:l}=this;return[t*r+(1-t)*i,e*a+(1-e)*n,t*o+(1-t)*i,e*l+(1-e)*n]}}class Le extends Pi{}function ue(s){return s*(Math.PI/180)}function xh(s){return 180*s/Math.PI}const wj=(s=0)=>{if(s<0)for(;s<-pi;)s+=pi;else if(s>0)for(;s>pi;)s-=pi;return s},Tj=wj;function xn(s,t,e){return{x:s.x+t*Math.cos(e),y:s.y+t*Math.sin(e)}}function kg(s,t){return Math.atan2(t.y-s.y,t.x-s.x)}class Ke{constructor(t=1,e=0,i=0,n=1,r=0,a=0){this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=a}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,r,a){return!(this.e!==r||this.f!==a||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,r,a){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=a,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,a=this.f,o=new Ke,l=t*n-e*i;return o.a=n/l,o.b=-e/l,o.c=-i/l,o.d=t/l,o.e=(i*a-n*r)/l,o.f=-(t*a-e*r)/l,o}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,a=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=a,this.d=o,this}rotateByCenter(t,e,i){const n=Math.cos(t),r=Math.sin(t),a=(1-n)*e+r*i,o=(1-n)*i-r*e,l=n*this.a-r*this.b,h=r*this.a+n*this.b,d=n*this.c-r*this.d,u=r*this.c+n*this.d,c=n*this.e-r*this.f+a,p=r*this.e+n*this.f+o;return this.a=l,this.b=h,this.c=d,this.d=u,this.e=c,this.f=p,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,r,a){return this.multiply(t,e,i,n,r,a),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:r,f:a}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=a,this.f=r,this}multiply(t,e,i,n,r,a){const o=this.a,l=this.b,h=this.c,d=this.d,u=o*t+h*e,c=l*t+d*e,p=o*i+h*n,g=l*i+d*n,f=o*r+h*a+this.e,_=l*r+d*a+this.f;return this.a=u,this.b=c,this.c=p,this.d=g,this.e=f,this.f=_,this}interpolate(t,e){const i=new Ke;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:r,d:a,e:o,f:l}=this,h=i*a-n*r,d=a/h,u=-n/h,c=-r/h,p=i/h,g=(r*l-a*o)/h,f=-(i*l-n*o)/h,{x:_,y:m}=t;e.x=_*d+m*c+g,e.y=_*u+m*p+f}onlyTranslate(t=1){return this.a===t&&this.b===0&&this.c===0&&this.d===t}clone(){return new Ke(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!==0||e!==0){const o=Math.sqrt(t*t+e*e);a.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),a.scaleX=o,a.scaleY=r/o,a.skewX=(t*i+e*n)/r,a.skewY=0}else if(i!==0||n!==0){const o=Math.sqrt(i*i+n*n);a.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/o):-Math.acos(i/o)),a.scaleX=r/o,a.scaleY=o,a.skewX=0,a.skewY=(t*i+e*n)/r}return a.rotateDeg=xh(a.rotateDeg),a}}function Mj(s,t,e,i,n,r,a,o){const l=t.a,h=t.b,d=t.c,u=t.d,c=t.e,p=t.f,g=de(a),f=se(a);let _,m;o?(_=o[0],m=o[1]):(_=e,m=i);const v=_-e,y=m-i,b=l*g+d*f,x=h*g+u*f,S=d*g-l*f,A=u*g-h*f;s.a=n*b,s.b=n*x,s.c=r*S,s.d=r*A,s.e=c+l*_+d*m-b*v-S*y,s.f=p+h*_+u*m-x*v-A*y}class Cj{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:n=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<i)return 0;let a=0;const o=h=>{a++,t.delete(h)},l=Date.now();return t.forEach((h,d)=>{if(h.timestamp.length<r)return o(d);let u=0;for(;l-h.timestamp[h.timestamp.length-1-u]<n&&(u++,!(u>=r)););if(u<r)return o(d);for(;l-h.timestamp[0]>n;)h.timestamp.shift()}),a}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:n=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>n&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();t.forEach(r=>{for(;n-r.timestamp[0]>i;)r.timestamp.shift()})}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();for(;n-t.timestamp[0]>i;)t.timestamp.shift()}}function wg(s,t,e){t/=100,e/=100;const i=(1-Math.abs(2*e-1))*t,n=i*(1-Math.abs(s/60%2-1)),r=e-i/2;let a=0,o=0,l=0;return 0<=s&&s<60?(a=i,o=n,l=0):60<=s&&s<120?(a=n,o=i,l=0):120<=s&&s<180?(a=0,o=i,l=n):180<=s&&s<240?(a=0,o=n,l=i):240<=s&&s<300?(a=n,o=0,l=i):300<=s&&s<360&&(a=i,o=0,l=n),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function Q_(s,t,e){s/=255,t/=255,e/=255;const i=Math.min(s,t,e),n=Math.max(s,t,e),r=n-i;let a=0,o=0,l=0;return a=r===0?0:n===s?(t-e)/r%6:n===t?(e-s)/r+2:(s-t)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(n+i)/2,o=r===0?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l}}const m1=/^#([0-9a-f]{3,8})$/,v1={transparent:4294967040},og={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function dp(s){return((s=Math.max(0,Math.min(255,Math.round(s)||0)))<16?"0":"")+s.toString(16)}function Uv(s){return dt(s)?new Bi(s>>16,s>>8&255,255&s,1):$(s)?new Bi(s[0],s[1],s[2]):new Bi(255,255,255)}function Pj(s){return dt(s)?new Bi(s>>>24,s>>>16&255,s>>>8&255,255&s):$(s)?new Bi(s[0],s[1],s[2],s[3]):new Bi(255,255,255,1)}function $v(s){return s<.04045?.0773993808*s:Math.pow(.9478672986*s+.0521327014,2.4)}function Yv(s){return s<.0031308?12.92*s:1.055*Math.pow(s,.41666)-.055}class Qe{static Brighter(t,e=1){return e===1?t:new Qe(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return e===1?t:new Qe(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof Qe?t:new Qe(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(E(v1[t]))return Pj(v1[t]);if(E(og[t]))return Uv(og[t]);const e=`${t}`.trim().toLowerCase(),i=m1.exec(e);if(i){const n=parseInt(i[1],16),r=i[1].length;return r===3?new Bi((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):r===6?Uv(n):r===8?new Bi(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const n=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Bi(parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10),parseFloat(n[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const n=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),r=wg(parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10));return new Bi(r.r,r.g,r.b,parseFloat(n[3]))}}constructor(t){const e=Qe.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Bi(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,r=Q_(this.color.r,this.color.g,this.color.b),a=wg(P(t)?r.h:xi(t,0,360),P(e)?r.s:e>=0&&e<=1?100*e:e,P(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new Bi(a.r,a.g,a.b,n),this}setRGB(t,e,i){return!P(t)&&(this.color.r=t),!P(e)&&(this.color.g=e),!P(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=m1.exec(e),n=parseInt(i[1],16),r=i[1].length;return r===3?new Bi((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):r===6?Uv(n):r===8?new Bi(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):this}setColorName(t){const e=og[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new Qe(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=$v(t.color.r),this.color.g=$v(t.color.g),this.color.b=$v(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Yv(t.color.r),this.color.g=Yv(t.color.g),this.color.b=Yv(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Bi{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),E(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${dp(this.r)+dp(this.g)+dp(this.b)+(this.opacity===1?"":dp(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${t===1?"rgb(":"rgba("}${this.r},${this.g},${this.b}${t===1?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=Q_(this.r,this.g,this.b);return`${t===1?"hsl(":"hsla("}${e},${i}%,${n}%${t===1?")":`,${t})`}`}toString(){return this.formatHex()}}function vE(s){let t="",e="",i="";const n=s[0]==="#"?1:0;for(let r=n;r<s.length;r++)s[r]!=="#"&&(r<n+2?t+=s[r]:r<n+4?e+=s[r]:r<n+6&&(i+=s[r]));return[parseInt(t,16),parseInt(e,16),parseInt(i,16)]}function Ej(s,t){const e=s.r,i=t.r,n=s.g,r=t.g,a=s.b,o=t.b,l=s.opacity,h=t.opacity;return d=>{const u=Math.round(e*(1-d)+i*d),c=Math.round(n*(1-d)+r*d),p=Math.round(a*(1-d)+o*d);return new Bi(u,c,p,l*(1-d)+h*d)}}const Rj=Object.freeze(Object.defineProperty({__proto__:null,Color:Qe,DEFAULT_COLORS:og,RGB:Bi,hexToRgb:vE,hslToRgb:wg,interpolateRgb:Ej,rgbToHsl:Q_},Symbol.toStringTag,{value:"Module"}));function Xv(s,t,e){s[0]=t[0]-e[0],s[1]=t[1]-e[1]}let Ji,Qi,ts,es,An,kn,wn,Tn;function yE(s,t,e,i){let n,r=s[0],a=t[0],o=e[0],l=i[0];return a<r&&(n=a,a=r,r=n),l<o&&(n=l,l=o,o=n),!(a<o||l<r)&&(r=s[1],a=t[1],o=e[1],l=i[1],a<r&&(n=a,a=r,r=n),l<o&&(n=l,l=o,o=n),!(a<o||l<r))}function bE(s,t,e,i){if(!yE(s,t,e,i))return!1;const n=[0,0],r=[0,0],a=[0,0];if(Xv(n,t,s),Xv(r,i,e),Aj(n,r))return!0;Xv(a,e,s);const o=_1(a,r)/_1(n,r);return o>=0&&o<=1&&[s[0]+n[0]*o,s[1]+n[1]*o]}function xE(s,t,e){return s===null?t:t===null?s:(Ji=s.x1,Qi=s.x2,ts=s.y1,es=s.y2,An=t.x1,kn=t.x2,wn=t.y1,Tn=t.y2,Ji>=kn||Qi<=An||ts>=Tn||es<=wn?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(Ji,An),y1:Math.max(ts,wn),x2:Math.min(Qi,kn),y2:Math.min(es,Tn)})}var gl;(function(s){s[s.NONE=0]="NONE",s[s.BBOX1=1]="BBOX1",s[s.BBOX2=2]="BBOX2"})(gl||(gl={}));function Oj(s,t,e){return s&&t?(Ji=s.x1,Qi=s.x2,ts=s.y1,es=s.y2,An=t.x1,kn=t.x2,wn=t.y1,Tn=t.y2,Ji>An&&Qi<kn&&ts>wn&&es<Tn?gl.BBOX1:An>Ji&&kn<Qi&&wn>ts&&Tn<es?gl.BBOX2:gl.NONE):gl.NONE}function bu(s,t,e){return!s||!t||(e?(Ji=s.x1,Qi=s.x2,ts=s.y1,es=s.y2,An=t.x1,kn=t.x2,wn=t.y1,Tn=t.y2,Ji>Qi&&([Ji,Qi]=[Qi,Ji]),ts>es&&([ts,es]=[es,ts]),An>kn&&([An,kn]=[kn,An]),wn>Tn&&([wn,Tn]=[Tn,wn]),!(Ji>kn||Qi<An||ts>Tn||es<wn)):!(s.x1>t.x2||s.x2<t.x1||s.y1>t.y2||s.y2<t.y1))}function Vd(s,t,e){return!t||(e?(Ji=t.x1,Qi=t.x2,ts=t.y1,es=t.y2,Ji>Qi&&([Ji,Qi]=[Qi,Ji]),ts>es&&([ts,es]=[es,ts]),s.x>=Ji&&s.x<=Qi&&s.y>=ts&&s.y<=es):s.x>=t.x1&&s.x<=t.x2&&s.y>=t.y1&&s.y<=t.y2)}function Kv(s,t){return Math.abs(t[0]*s[0]+t[1]*s[1])}function up({x:s,y:t},e,i={x:0,y:0}){return{x:(s-i.x)*Math.cos(e)+(t-i.y)*Math.sin(e)+i.x,y:(s-i.x)*Math.sin(e)+(i.y-t)*Math.cos(e)+i.y}}function Md(s){return s/180*Math.PI}function hy(s){return{x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2}}function y1(s,t){const e=t?s.angle:Md(s.angle),i=hy(s);return[up({x:s.x1,y:s.y1},e,i),up({x:s.x2,y:s.y1},e,i),up({x:s.x2,y:s.y2},e,i),up({x:s.x1,y:s.y2},e,i)]}function Ij(s,t,e=!1,i){const n=y1(s,e),r=y1(t,e),a=(y,b)=>[b.x-y.x,b.y-y.y],o=hy(s),l=hy(t),h=a(o,l),d=a(n[0],n[1]),u=a(n[1],n[2]),c=a(r[0],r[1]),p=a(r[1],r[2]),g=e?s.angle:Md(s.angle);let f=e?s.angle+Js:Md(90-s.angle);const _=e?t.angle:Md(t.angle);let m=e?t.angle+Js:Md(90-t.angle);f>jt&&(f-=jt),m>jt&&(m-=jt);const v=(y,b,x,S)=>{const A=[Math.cos(b),Math.sin(b)];return y+(Kv(A,x)+Kv(A,S))/2>Kv(A,h)};return v((s.x2-s.x1)/2,g,c,p)&&v((s.y2-s.y1)/2,f,c,p)&&v((t.x2-t.x1)/2,_,d,u)&&v((t.y2-t.y1)/2,m,d,u)}let cp,pp,gp,fp;function Lj(s){return cp=1/0,pp=1/0,gp=-1/0,fp=-1/0,s.forEach(t=>{cp>t.x&&(cp=t.x),gp<t.x&&(gp=t.x),pp>t.y&&(pp=t.y),fp<t.y&&(fp=t.y)}),{x1:cp,y1:pp,x2:gp,y2:fp}}const Bj=1e-8;function Dj(s,t,e,i,n){for(let r=0,a=n[n.length-1];r<n.length;r++){const o=n[r];if(yE([s,t],[e,i],[o.x,o.y],[a.x,a.y]))return!0;a=o}return!1}function co(s,t,e){let i=0,n=s[0];if(!n)return!1;for(let a=1;a<s.length;a++){const o=s[a];i+=b1(n.x,n.y,o.x,o.y,t,e),n=o}const r=s[0];return x1(n.x,r.x)&&x1(n.y,r.y)||(i+=b1(n.x,n.y,r.x,r.y,t,e)),i!==0}function b1(s,t,e,i,n,r){if(r>t&&r>i||r<t&&r<i||i===t)return 0;const a=(r-t)/(i-t);let o=i<t?1:-1;a!==1&&a!==0||(o=i<t?.5:-.5);const l=a*(e-s)+s;return l===n?1/0:l>n?o:0}function x1(s,t){return Math.abs(s-t)<Bj}function S1(s,t){for(let e=0;e<t.length;e++)if(co(s,t[e].x,t[e].y)||e>0&&Dj(t[e-1].x,t[e-1].y,t[e].x,t[e].y,s))return!0;return!1}const A1=s=>{let t=s.charCodeAt(0),e=s.length===2?s.charCodeAt(1):0,i=t;return 55296<=t&&t<=56319&&56320<=e&&e<=57343&&(t&=1023,e&=1023,i=t<<10|e,i+=65536),i===12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i===8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i===172||i===175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i===161||i===164||167<=i&&i<=168||i===170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i===198||i===208||215<=i&&i<=216||222<=i&&i<=225||i===230||232<=i&&i<=234||236<=i&&i<=237||i===240||242<=i&&i<=243||247<=i&&i<=250||i===252||i===254||i===257||i===273||i===275||i===283||294<=i&&i<=295||i===299||305<=i&&i<=307||i===312||319<=i&&i<=322||i===324||328<=i&&i<=331||i===333||338<=i&&i<=339||358<=i&&i<=359||i===363||i===462||i===464||i===466||i===468||i===470||i===472||i===474||i===476||i===593||i===609||i===708||i===711||713<=i&&i<=715||i===717||i===720||728<=i&&i<=731||i===733||i===735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i===1025||1040<=i&&i<=1103||i===1105||i===8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i===8240||8242<=i&&i<=8243||i===8245||i===8251||i===8254||i===8308||i===8319||8321<=i&&i<=8324||i===8364||i===8451||i===8453||i===8457||i===8467||i===8470||8481<=i&&i<=8482||i===8486||i===8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i===8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i===8658||i===8660||i===8679||i===8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i===8715||i===8719||i===8721||i===8725||i===8730||8733<=i&&i<=8736||i===8739||i===8741||8743<=i&&i<=8748||i===8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i===8776||i===8780||i===8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i===8853||i===8857||i===8869||i===8895||i===8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i===9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i===9711||9733<=i&&i<=9734||i===9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i===9756||i===9758||i===9792||i===9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i===9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i===9955||9960<=i&&i<=9983||i===10045||i===10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i===65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};function Fj(s,t={}){const{fontStyle:e=t.fontStyle,fontVariant:i=t.fontVariant,fontWeight:n=t.fontWeight,fontSize:r=t.fontSize,fontFamily:a=t.fontFamily}=s;return(e?e+" ":"")+(i?i+" ":"")+(n?n+" ":"")+r+"px "+(a||"sans-serif")}class yi{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet=`-/: .,@%'"~`,this._option=t,this._userSpec=e??{},this.textSpec=this._initSpec(),E(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=E(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(P(this._canvas)&&(E(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),P(this._canvas)&&typeof window<"u"&&window.document!==void 0&&globalThis&&E(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),P(this._context)&&E(this._canvas)){const t=this._canvas.getContext("2d");E(t)&&(t.save(),t.font=Fj(this.textSpec),this._contextSaved=!0,this._context=t)}return!P(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:r=n.fontStyle,fontVariant:a=n.fontVariant,fontWeight:o=(t=n.fontWeight)!==null&&t!==void 0?t:"normal",fontSize:l=(e=n.fontSize)!==null&&e!==void 0?e:12,fontFamily:h=(i=n.fontFamily)!==null&&i!==void 0?i:"sans-serif",align:d,textAlign:u=d??"center",baseline:c,textBaseline:p=c??"middle",ellipsis:g,limit:f}=this._userSpec;let{lineHeight:_=l}=this._userSpec;if(ht(_)&&_[_.length-1]==="%"){const m=Number.parseFloat(_.substring(0,_.length-1))/100;_=l*m}return{fontStyle:r,fontVariant:a,fontFamily:h,fontSize:l,fontWeight:o,textAlign:u,textBaseline:p,ellipsis:g,limit:f,lineHeight:_}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(P(t))return{width:0,height:0};if(P(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:a,ellipsis:o,limit:l,lineHeight:h}=this.textSpec;let d;try{const u=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:a,ellipsis:!!o,maxLineWidth:l||1/0,lineHeight:h});d={width:u.width(),height:u.height()}}catch{this._notSupportVRender=!0,d=this.measureWithNaiveCanvas(t)}return d}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:r}=this.textSpec;return{width:i.width,height:(e=r)!==null&&e!==void 0?e:n}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let r=this._measureSpecialChar(n);P(r)&&yi.NUMBERS_CHAR_SET.includes(n)&&(r=this._measureNumberChar()),P(r)&&["F","W"].includes(A1(n))&&(r=this._measureFullSizeChar()),P(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let a=0;a<t.length;a++){const o=t[a],l=["F","W"].includes(A1(o))?1:.53;i.width+=l*n}return i.height=(e=r)!==null&&e!==void 0?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:r}=this.textSpec,a={width:0,height:0};if(P(t))return a;if($(t)){const o=t.filter(E).map(l=>l.toString());return o.length===0?a:o.length===1?e(o[0]):{width:o.reduce((l,h)=>Math.max(l,e(h).width),0),height:o.length*(((i=r)!==null&&i!==void 0?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(P(this._numberCharSize)){const t=this._standardMethod(yi.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/yi.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return P(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(yi.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(P(this._letterCharSize)){const t=this._standardMethod(yi.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/yi.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return E(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){E(this._canvas)&&(this._canvas=null),E(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}yi.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",yi.NUMBERS_CHAR_SET="0123456789",yi.FULL_SIZE_CHAR="字";const jj=typeof console<"u";function _p(s,t,e){const i=[t].concat([].slice.call(e));jj&&console[s].apply(console,i)}var Os;(function(s){s[s.None=0]="None",s[s.Error=1]="Error",s[s.Warn=2]="Warn",s[s.Info=3]="Info",s[s.Debug=4]="Debug"})(Os||(Os={}));class Nt{static getInstance(t,e){return Nt._instance&&dt(t)?Nt._instance.level(t):Nt._instance||(Nt._instance=new Nt(t,e)),Nt._instance}static setInstance(t){return Nt._instance=t}static setInstanceLevel(t){Nt._instance?Nt._instance.level(t):Nt._instance=new Nt(t)}static clearInstance(){Nt._instance=null}constructor(t=Os.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find(e=>e===t)||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex(i=>i===t);e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach(e=>e(...t))}canLogInfo(){return this._level>=Os.Info}canLogDebug(){return this._level>=Os.Debug}canLogError(){return this._level>=Os.Error}canLogWarn(){return this._level>=Os.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=Os.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):_p((e=this._method)!==null&&e!==void 0?e:"error","ERROR",t)),this}warn(...t){return this._level>=Os.Warn&&_p(this._method||"warn","WARN",t),this}info(...t){return this._level>=Os.Info&&_p(this._method||"log","INFO",t),this}debug(...t){return this._level>=Os.Debug&&_p(this._method||"log","DEBUG",t),this}}Nt._instance=null;function _s(s){if(N(s))return[s,s,s,s];if($(s)){const t=s.length;if(t===1){const e=s[0];return[e,e,e,e]}if(t===2){const[e,i]=s;return[e,i,e,i]}if(t===3){const[e,i,n]=s;return[e,i,n,i]}if(t===4)return s}if($t(s)){const{top:t=0,right:e=0,bottom:i=0,left:n=0}=s;return[t,e,i,n]}return[0,0,0,0]}function dy(s,t=0,e=0){if(!s)return{width:t,height:e};let i;try{i=window==null?void 0:window.getComputedStyle}catch{i=()=>({})}const n=i(s);if(/^(\d*\.?\d+)(px)$/.exec(n.width)){const r=parseFloat(n.width)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)||s.clientWidth-1,a=parseFloat(n.height)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)||s.clientHeight-1;return{width:r<=0?t:r,height:a<=0?e:a}}return{width:t,height:e}}function zj(s){const{x:t,y:e}=s.getBoundingClientRect();return{x:t,y:e}}function Hj(s,t){let e=s.parentNode;for(;e!==null;){if(e===t)return!0;e=e.parentNode}return!1}var Ss=63710088e-1,Nj={centimeters:Ss*100,centimetres:Ss*100,degrees:Ss/111325,feet:Ss*3.28084,inches:Ss*39.37,kilometers:Ss/1e3,kilometres:Ss/1e3,meters:Ss,metres:Ss,miles:Ss/1609.344,millimeters:Ss*1e3,millimetres:Ss*1e3,nauticalmiles:Ss/1852,radians:1,yards:Ss*1.0936};function k1(s,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=s,i}function SE(s,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=s,e}function Gj(s,t){t===void 0&&(t="kilometers");var e=Nj[t];if(!e)throw new Error(t+" units is invalid");return s/e}function Wj(s){return!!s&&s.constructor===Object}function Vj(s){return s.type==="Feature"?s.geometry:s}function Uj(s,t){if(!s||!t)return!1;const e=Vj(t),i=e.type,n=t.bbox;let r=e.coordinates;if(n&&Vd(s,{x1:n[0],x2:n[1],y1:n[1],y2:n[3]},!0)===!0)return!1;i==="Polygon"&&(r=[r]);let a=!1;for(let o=0;o<r.length;++o)for(let l=0;l<r[o].length;++l)if(co(r[o][l].map(h=>({x:h[0],y:h[1]})),s.x,s.y))return a=!0,a;return a}function $j(s,t,e,i={}){const n=ue(s[0]),r=ue(s[1]),a=ue(e),o=Gj(t,i.units),l=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(a)),h=n+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(l));return{x:xh(h),y:xh(l)}}const Yj=(s,t)=>{const{callback:e}=t;return e&&(s=s.filter(e)),s};function tm(){return new Tg}function Tg(){this.reset()}Tg.prototype={constructor:Tg,reset:function(){this.s=this.t=0},add:function(s){w1(mp,s,this.t),w1(this,mp.s,this.s),this.s?this.t+=mp.t:this.s=mp.t},valueOf:function(){return this.s}};var mp=new Tg;function w1(s,t,e){var i=s.s=t+e,n=i-t,r=i-n;s.t=t-r+(e-n)}var Vt=1e-6,Xj=1e-12,ie=Math.PI,ti=ie/2,T1=ie/4,js=ie*2,$i=180/ie,Ye=ie/180,xe=Math.abs,Yh=Math.atan,Fr=Math.atan2,Zt=Math.cos,AE=Math.exp,Mg=Math.log,qv=Math.pow,Ut=Math.sin,en=Math.sign||function(s){return s>0?1:s<0?-1:0},Ts=Math.sqrt,Dx=Math.tan;function kE(s){return s>1?0:s<-1?ie:Math.acos(s)}function hn(s){return s>1?ti:s<-1?-ti:Math.asin(s)}function sn(){}function Cg(s,t){s&&C1.hasOwnProperty(s.type)&&C1[s.type](s,t)}var M1={Feature:function(s,t){Cg(s.geometry,t)},FeatureCollection:function(s,t){for(var e=s.features,i=-1,n=e.length;++i<n;)Cg(e[i].geometry,t)}},C1={Sphere:function(s,t){t.sphere()},Point:function(s,t){s=s.coordinates,t.point(s[0],s[1],s[2])},MultiPoint:function(s,t){for(var e=s.coordinates,i=-1,n=e.length;++i<n;)s=e[i],t.point(s[0],s[1],s[2])},LineString:function(s,t){uy(s.coordinates,t,0)},MultiLineString:function(s,t){for(var e=s.coordinates,i=-1,n=e.length;++i<n;)uy(e[i],t,0)},Polygon:function(s,t){P1(s.coordinates,t)},MultiPolygon:function(s,t){for(var e=s.coordinates,i=-1,n=e.length;++i<n;)P1(e[i],t)},GeometryCollection:function(s,t){for(var e=s.geometries,i=-1,n=e.length;++i<n;)Cg(e[i],t)}};function uy(s,t,e){var i=-1,n=s.length-e,r;for(t.lineStart();++i<n;)r=s[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function P1(s,t){var e=-1,i=s.length;for(t.polygonStart();++e<i;)uy(s[e],t,1);t.polygonEnd()}function ol(s,t){s&&M1.hasOwnProperty(s.type)?M1[s.type](s,t):Cg(s,t)}function cy(s){return[Fr(s[1],s[0]),hn(s[2])]}function Sh(s){var t=s[0],e=s[1],i=Zt(e);return[i*Zt(t),i*Ut(t),Ut(e)]}function vp(s,t){return s[0]*t[0]+s[1]*t[1]+s[2]*t[2]}function Pg(s,t){return[s[1]*t[2]-s[2]*t[1],s[2]*t[0]-s[0]*t[2],s[0]*t[1]-s[1]*t[0]]}function Zv(s,t){s[0]+=t[0],s[1]+=t[1],s[2]+=t[2]}function yp(s,t){return[s[0]*t,s[1]*t,s[2]*t]}function py(s){var t=Ts(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]/=t,s[1]/=t,s[2]/=t}function gy(s,t){function e(i,n){return i=s(i,n),t(i[0],i[1])}return s.invert&&t.invert&&(e.invert=function(i,n){return i=t.invert(i,n),i&&s.invert(i[0],i[1])}),e}function fy(s,t){return[xe(s)>ie?s+Math.round(-s/js)*js:s,t]}fy.invert=fy;function wE(s,t,e){return(s%=js)?t||e?gy(R1(s),O1(t,e)):R1(s):t||e?O1(t,e):fy}function E1(s){return function(t,e){return t+=s,[t>ie?t-js:t<-ie?t+js:t,e]}}function R1(s){var t=E1(s);return t.invert=E1(-s),t}function O1(s,t){var e=Zt(s),i=Ut(s),n=Zt(t),r=Ut(t);function a(o,l){var h=Zt(l),d=Zt(o)*h,u=Ut(o)*h,c=Ut(l),p=c*e+d*i;return[Fr(u*n-p*r,d*e-c*i),hn(p*n+u*r)]}return a.invert=function(o,l){var h=Zt(l),d=Zt(o)*h,u=Ut(o)*h,c=Ut(l),p=c*n-u*r;return[Fr(u*n+c*r,d*e+p*i),hn(p*e-d*i)]},a}function Kj(s){s=wE(s[0]*Ye,s[1]*Ye,s.length>2?s[2]*Ye:0);function t(e){return e=s(e[0]*Ye,e[1]*Ye),e[0]*=$i,e[1]*=$i,e}return t.invert=function(e){return e=s.invert(e[0]*Ye,e[1]*Ye),e[0]*=$i,e[1]*=$i,e},t}function qj(s,t,e,i,n,r){if(e){var a=Zt(t),o=Ut(t),l=i*e;n==null?(n=t+i*js,r=t-l/2):(n=I1(a,n),r=I1(a,r),(i>0?n<r:n>r)&&(n+=i*js));for(var h,d=n;i>0?d>r:d<r;d-=l)h=cy([a,-o*Zt(d),-o*Ut(d)]),s.point(h[0],h[1])}}function I1(s,t){t=Sh(t),t[0]-=s,py(t);var e=kE(-t[1]);return((-t[2]<0?-e:e)+js-Vt)%js}function TE(){var s=[],t;return{point:function(e,i,n){t.push([e,i,n])},lineStart:function(){s.push(t=[])},lineEnd:sn,rejoin:function(){s.length>1&&s.push(s.pop().concat(s.shift()))},result:function(){var e=s;return s=[],t=null,e}}}function lg(s,t){return xe(s[0]-t[0])<Vt&&xe(s[1]-t[1])<Vt}function bp(s,t,e,i){this.x=s,this.z=t,this.o=e,this.e=i,this.v=!1,this.n=this.p=null}function ME(s,t,e,i,n){var r=[],a=[],o,l;if(s.forEach(function(g){if(!((f=g.length-1)<=0)){var f,_=g[0],m=g[f],v;if(lg(_,m)){if(!_[2]&&!m[2]){for(n.lineStart(),o=0;o<f;++o)n.point((_=g[o])[0],_[1]);n.lineEnd();return}m[0]+=2*Vt}r.push(v=new bp(_,g,null,!0)),a.push(v.o=new bp(_,null,v,!1)),r.push(v=new bp(m,g,null,!1)),a.push(v.o=new bp(m,null,v,!0))}}),!!r.length){for(a.sort(t),L1(r),L1(a),o=0,l=a.length;o<l;++o)a[o].e=e=!e;for(var h=r[0],d,u;;){for(var c=h,p=!0;c.v;)if((c=c.n)===h)return;d=c.z,n.lineStart();do{if(c.v=c.o.v=!0,c.e){if(p)for(o=0,l=d.length;o<l;++o)n.point((u=d[o])[0],u[1]);else i(c.x,c.n.x,1,n);c=c.n}else{if(p)for(d=c.p.z,o=d.length-1;o>=0;--o)n.point((u=d[o])[0],u[1]);else i(c.x,c.p.x,-1,n);c=c.p}c=c.o,d=c.z,p=!p}while(!c.v);n.lineEnd()}}}function L1(s){if(t=s.length){for(var t,e=0,i=s[0],n;++e<t;)i.n=n=s[e],n.p=i,i=n;i.n=n=s[0],n.p=i}}var Jv=tm();function Qv(s){return xe(s[0])<=ie?s[0]:en(s[0])*((xe(s[0])+ie)%js-ie)}function Zj(s,t){var e=Qv(t),i=t[1],n=Ut(i),r=[Ut(e),-Zt(e),0],a=0,o=0;Jv.reset(),n===1?i=ti+Vt:n===-1&&(i=-ti-Vt);for(var l=0,h=s.length;l<h;++l)if(u=(d=s[l]).length)for(var d,u,c=d[u-1],p=Qv(c),g=c[1]/2+T1,f=Ut(g),_=Zt(g),m=0;m<u;++m,p=y,f=x,_=S,c=v){var v=d[m],y=Qv(v),b=v[1]/2+T1,x=Ut(b),S=Zt(b),A=y-p,k=A>=0?1:-1,w=k*A,T=w>ie,M=f*x;if(Jv.add(Fr(M*k*Ut(w),_*S+M*Zt(w))),a+=T?A+k*js:A,T^p>=e^y>=e){var C=Pg(Sh(c),Sh(v));py(C);var R=Pg(r,C);py(R);var I=(T^A>=0?-1:1)*hn(R[2]);(i>I||i===I&&(C[0]||C[1]))&&(o+=T^A>=0?1:-1)}}return(a<-Vt||a<Vt&&Jv<-Vt)^o&1}function CE(s,t){return s<t?-1:s>t?1:s>=t?0:NaN}function Jj(s){return s.length===1&&(s=Qj(s)),{left:function(t,e,i,n){for(i==null&&(i=0),n==null&&(n=t.length);i<n;){var r=i+n>>>1;s(t[r],e)<0?i=r+1:n=r}return i},right:function(t,e,i,n){for(i==null&&(i=0),n==null&&(n=t.length);i<n;){var r=i+n>>>1;s(t[r],e)>0?n=r:i=r+1}return i}}}function Qj(s){return function(t,e){return CE(s(t),e)}}Jj(CE);function PE(s){for(var t=s.length,e,i=-1,n=0,r,a;++i<t;)n+=s[i].length;for(r=new Array(n);--t>=0;)for(a=s[t],e=a.length;--e>=0;)r[--n]=a[e];return r}function EE(s,t,e,i){return function(n){var r=t(n),a=TE(),o=t(a),l=!1,h,d,u,c={point:p,lineStart:f,lineEnd:_,polygonStart:function(){c.point=m,c.lineStart=v,c.lineEnd=y,d=[],h=[]},polygonEnd:function(){c.point=p,c.lineStart=f,c.lineEnd=_,d=PE(d);var b=Zj(h,i);d.length?(l||(n.polygonStart(),l=!0),ME(d,ez,b,e,n)):b&&(l||(n.polygonStart(),l=!0),n.lineStart(),e(null,null,1,n),n.lineEnd()),l&&(n.polygonEnd(),l=!1),d=h=null},sphere:function(){n.polygonStart(),n.lineStart(),e(null,null,1,n),n.lineEnd(),n.polygonEnd()}};function p(b,x){s(b,x)&&n.point(b,x)}function g(b,x){r.point(b,x)}function f(){c.point=g,r.lineStart()}function _(){c.point=p,r.lineEnd()}function m(b,x){u.push([b,x]),o.point(b,x)}function v(){o.lineStart(),u=[]}function y(){m(u[0][0],u[0][1]),o.lineEnd();var b=o.clean(),x=a.result(),S,A=x.length,k,w,T;if(u.pop(),h.push(u),u=null,!!A){if(b&1){if(w=x[0],(k=w.length-1)>0){for(l||(n.polygonStart(),l=!0),n.lineStart(),S=0;S<k;++S)n.point((T=w[S])[0],T[1]);n.lineEnd()}return}A>1&&b&2&&x.push(x.pop().concat(x.shift())),d.push(x.filter(tz))}}return c}}function tz(s){return s.length>1}function ez(s,t){return((s=s.x)[0]<0?s[1]-ti-Vt:ti-s[1])-((t=t.x)[0]<0?t[1]-ti-Vt:ti-t[1])}const B1=EE(function(){return!0},iz,nz,[-ie,-ti]);function iz(s){var t=NaN,e=NaN,i=NaN,n;return{lineStart:function(){s.lineStart(),n=1},point:function(r,a){var o=r>0?ie:-ie,l=xe(r-t);xe(l-ie)<Vt?(s.point(t,e=(e+a)/2>0?ti:-ti),s.point(i,e),s.lineEnd(),s.lineStart(),s.point(o,e),s.point(r,e),n=0):i!==o&&l>=ie&&(xe(t-i)<Vt&&(t-=i*Vt),xe(r-o)<Vt&&(r-=o*Vt),e=sz(t,e,r,a),s.point(i,e),s.lineEnd(),s.lineStart(),s.point(o,e),n=0),s.point(t=r,e=a),i=o},lineEnd:function(){s.lineEnd(),t=e=NaN},clean:function(){return 2-n}}}function sz(s,t,e,i){var n,r,a=Ut(s-e);return xe(a)>Vt?Yh((Ut(t)*(r=Zt(i))*Ut(e)-Ut(i)*(n=Zt(t))*Ut(s))/(n*r*a)):(t+i)/2}function nz(s,t,e,i){var n;if(s==null)n=e*ti,i.point(-ie,n),i.point(0,n),i.point(ie,n),i.point(ie,0),i.point(ie,-n),i.point(0,-n),i.point(-ie,-n),i.point(-ie,0),i.point(-ie,n);else if(xe(s[0]-t[0])>Vt){var r=s[0]<t[0]?ie:-ie;n=e*r/2,i.point(-r,n),i.point(0,n),i.point(r,n)}else i.point(t[0],t[1])}function rz(s){var t=Zt(s),e=6*Ye,i=t>0,n=xe(t)>Vt;function r(d,u,c,p){qj(p,s,e,c,d,u)}function a(d,u){return Zt(d)*Zt(u)>t}function o(d){var u,c,p,g,f;return{lineStart:function(){g=p=!1,f=1},point:function(_,m){var v=[_,m],y,b=a(_,m),x=i?b?0:h(_,m):b?h(_+(_<0?ie:-ie),m):0;if(!u&&(g=p=b)&&d.lineStart(),b!==p&&(y=l(u,v),(!y||lg(u,y)||lg(v,y))&&(v[2]=1)),b!==p)f=0,b?(d.lineStart(),y=l(v,u),d.point(y[0],y[1])):(y=l(u,v),d.point(y[0],y[1],2),d.lineEnd()),u=y;else if(n&&u&&i^b){var S;!(x&c)&&(S=l(v,u,!0))&&(f=0,i?(d.lineStart(),d.point(S[0][0],S[0][1]),d.point(S[1][0],S[1][1]),d.lineEnd()):(d.point(S[1][0],S[1][1]),d.lineEnd(),d.lineStart(),d.point(S[0][0],S[0][1],3)))}b&&(!u||!lg(u,v))&&d.point(v[0],v[1]),u=v,p=b,c=x},lineEnd:function(){p&&d.lineEnd(),u=null},clean:function(){return f|(g&&p)<<1}}}function l(d,u,c){var p=Sh(d),g=Sh(u),f=[1,0,0],_=Pg(p,g),m=vp(_,_),v=_[0],y=m-v*v;if(!y)return!c&&d;var b=t*m/y,x=-t*v/y,S=Pg(f,_),A=yp(f,b),k=yp(_,x);Zv(A,k);var w=S,T=vp(A,w),M=vp(w,w),C=T*T-M*(vp(A,A)-1);if(!(C<0)){var R=Ts(C),I=yp(w,(-T-R)/M);if(Zv(I,A),I=cy(I),!c)return I;var O=d[0],L=u[0],D=d[1],j=u[1],H;L<O&&(H=O,O=L,L=H);var W=L-O,V=xe(W-ie)<Vt,X=V||W<Vt;if(!V&&j<D&&(H=D,D=j,j=H),X?V?D+j>0^I[1]<(xe(I[0]-O)<Vt?D:j):D<=I[1]&&I[1]<=j:W>ie^(O<=I[0]&&I[0]<=L)){var Q=yp(w,(-T+R)/M);return Zv(Q,A),[I,cy(Q)]}}}function h(d,u){var c=i?s:ie-s,p=0;return d<-c?p|=1:d>c&&(p|=2),u<-c?p|=4:u>c&&(p|=8),p}return EE(a,o,r,i?[0,-s]:[-ie,s-ie])}function az(s,t,e,i,n,r){var a=s[0],o=s[1],l=t[0],h=t[1],d=0,u=1,c=l-a,p=h-o,g;if(g=e-a,!(!c&&g>0)){if(g/=c,c<0){if(g<d)return;g<u&&(u=g)}else if(c>0){if(g>u)return;g>d&&(d=g)}if(g=n-a,!(!c&&g<0)){if(g/=c,c<0){if(g>u)return;g>d&&(d=g)}else if(c>0){if(g<d)return;g<u&&(u=g)}if(g=i-o,!(!p&&g>0)){if(g/=p,p<0){if(g<d)return;g<u&&(u=g)}else if(p>0){if(g>u)return;g>d&&(d=g)}if(g=r-o,!(!p&&g<0)){if(g/=p,p<0){if(g>u)return;g>d&&(d=g)}else if(p>0){if(g<d)return;g<u&&(u=g)}return d>0&&(s[0]=a+d*c,s[1]=o+d*p),u<1&&(t[0]=a+u*c,t[1]=o+u*p),!0}}}}}var Cd=1e9,xp=-Cd;function RE(s,t,e,i){function n(h,d){return s<=h&&h<=e&&t<=d&&d<=i}function r(h,d,u,c){var p=0,g=0;if(h==null||(p=a(h,u))!==(g=a(d,u))||l(h,d)<0^u>0)do c.point(p===0||p===3?s:e,p>1?i:t);while((p=(p+u+4)%4)!==g);else c.point(d[0],d[1])}function a(h,d){return xe(h[0]-s)<Vt?d>0?0:3:xe(h[0]-e)<Vt?d>0?2:1:xe(h[1]-t)<Vt?d>0?1:0:d>0?3:2}function o(h,d){return l(h.x,d.x)}function l(h,d){var u=a(h,1),c=a(d,1);return u!==c?u-c:u===0?d[1]-h[1]:u===1?h[0]-d[0]:u===2?h[1]-d[1]:d[0]-h[0]}return function(h){var d=h,u=TE(),c,p,g,f,_,m,v,y,b,x,S,A={point:k,lineStart:C,lineEnd:R,polygonStart:T,polygonEnd:M};function k(O,L){n(O,L)&&d.point(O,L)}function w(){for(var O=0,L=0,D=p.length;L<D;++L)for(var j=p[L],H=1,W=j.length,V=j[0],X,Q,J=V[0],nt=V[1];H<W;++H)X=J,Q=nt,V=j[H],J=V[0],nt=V[1],Q<=i?nt>i&&(J-X)*(i-Q)>(nt-Q)*(s-X)&&++O:nt<=i&&(J-X)*(i-Q)<(nt-Q)*(s-X)&&--O;return O}function T(){d=u,c=[],p=[],S=!0}function M(){var O=w(),L=S&&O,D=(c=PE(c)).length;(L||D)&&(h.polygonStart(),L&&(h.lineStart(),r(null,null,1,h),h.lineEnd()),D&&ME(c,o,O,r,h),h.polygonEnd()),d=h,c=p=g=null}function C(){A.point=I,p&&p.push(g=[]),x=!0,b=!1,v=y=NaN}function R(){c&&(I(f,_),m&&b&&u.rejoin(),c.push(u.result())),A.point=k,b&&d.lineEnd()}function I(O,L){var D=n(O,L);if(p&&g.push([O,L]),x)f=O,_=L,m=D,x=!1,D&&(d.lineStart(),d.point(O,L));else if(D&&b)d.point(O,L);else{var j=[v=Math.max(xp,Math.min(Cd,v)),y=Math.max(xp,Math.min(Cd,y))],H=[O=Math.max(xp,Math.min(Cd,O)),L=Math.max(xp,Math.min(Cd,L))];az(j,H,s,t,e,i)?(b||(d.lineStart(),d.point(j[0],j[1])),d.point(H[0],H[1]),D||d.lineEnd(),S=!1):D&&(d.lineStart(),d.point(O,L),S=!1)}v=O,y=L,b=D}return A}}function xu(s){return s}var t0=tm(),_y=tm(),OE,IE,my,vy,wr={point:sn,lineStart:sn,lineEnd:sn,polygonStart:function(){wr.lineStart=oz,wr.lineEnd=hz},polygonEnd:function(){wr.lineStart=wr.lineEnd=wr.point=sn,t0.add(xe(_y)),_y.reset()},result:function(){var s=t0/2;return t0.reset(),s}};function oz(){wr.point=lz}function lz(s,t){wr.point=LE,OE=my=s,IE=vy=t}function LE(s,t){_y.add(vy*s-my*t),my=s,vy=t}function hz(){LE(OE,IE)}var Ah=1/0,Eg=Ah,Su=-Ah,Rg=Su,Og={point:dz,lineStart:sn,lineEnd:sn,polygonStart:sn,polygonEnd:sn,result:function(){var s=[[Ah,Eg],[Su,Rg]];return Su=Rg=-(Eg=Ah=1/0),s}};function dz(s,t){s<Ah&&(Ah=s),s>Su&&(Su=s),t<Eg&&(Eg=t),t>Rg&&(Rg=t)}var yy=0,by=0,Pd=0,Ig=0,Lg=0,fl=0,xy=0,Sy=0,Ed=0,BE,DE,Xn,Kn,Qs={point:So,lineStart:D1,lineEnd:F1,polygonStart:function(){Qs.lineStart=pz,Qs.lineEnd=gz},polygonEnd:function(){Qs.point=So,Qs.lineStart=D1,Qs.lineEnd=F1},result:function(){var s=Ed?[xy/Ed,Sy/Ed]:fl?[Ig/fl,Lg/fl]:Pd?[yy/Pd,by/Pd]:[NaN,NaN];return yy=by=Pd=Ig=Lg=fl=xy=Sy=Ed=0,s}};function So(s,t){yy+=s,by+=t,++Pd}function D1(){Qs.point=uz}function uz(s,t){Qs.point=cz,So(Xn=s,Kn=t)}function cz(s,t){var e=s-Xn,i=t-Kn,n=Ts(e*e+i*i);Ig+=n*(Xn+s)/2,Lg+=n*(Kn+t)/2,fl+=n,So(Xn=s,Kn=t)}function F1(){Qs.point=So}function pz(){Qs.point=fz}function gz(){FE(BE,DE)}function fz(s,t){Qs.point=FE,So(BE=Xn=s,DE=Kn=t)}function FE(s,t){var e=s-Xn,i=t-Kn,n=Ts(e*e+i*i);Ig+=n*(Xn+s)/2,Lg+=n*(Kn+t)/2,fl+=n,n=Kn*s-Xn*t,xy+=n*(Xn+s),Sy+=n*(Kn+t),Ed+=n*3,So(Xn=s,Kn=t)}function jE(s){this._context=s}jE.prototype={_radius:4.5,pointRadius:function(s){return this._radius=s,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(s,t){switch(this._point){case 0:{this._context.moveTo(s,t),this._point=1;break}case 1:{this._context.lineTo(s,t);break}default:{this._context.moveTo(s+this._radius,t),this._context.arc(s,t,this._radius,0,js);break}}},result:sn};var Ay=tm(),e0,zE,HE,Rd,Od,Au={point:sn,lineStart:function(){Au.point=_z},lineEnd:function(){e0&&NE(zE,HE),Au.point=sn},polygonStart:function(){e0=!0},polygonEnd:function(){e0=null},result:function(){var s=+Ay;return Ay.reset(),s}};function _z(s,t){Au.point=NE,zE=Rd=s,HE=Od=t}function NE(s,t){Rd-=s,Od-=t,Ay.add(Ts(Rd*Rd+Od*Od)),Rd=s,Od=t}function GE(){this._string=[]}GE.prototype={_radius:4.5,_circle:j1(4.5),pointRadius:function(s){return(s=+s)!==this._radius&&(this._radius=s,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(s,t){switch(this._point){case 0:{this._string.push("M",s,",",t),this._point=1;break}case 1:{this._string.push("L",s,",",t);break}default:{this._circle==null&&(this._circle=j1(this._radius)),this._string.push("M",s,",",t,this._circle);break}}},result:function(){if(this._string.length){var s=this._string.join("");return this._string=[],s}else return null}};function j1(s){return"m0,"+s+"a"+s+","+s+" 0 1,1 0,"+-2*s+"a"+s+","+s+" 0 1,1 0,"+2*s+"z"}function Fx(s,t){var e=4.5,i,n;function r(a){return a&&(typeof e=="function"&&n.pointRadius(+e.apply(this,arguments)),ol(a,i(n))),n.result()}return r.area=function(a){return ol(a,i(wr)),wr.result()},r.measure=function(a){return ol(a,i(Au)),Au.result()},r.bounds=function(a){return ol(a,i(Og)),Og.result()},r.centroid=function(a){return ol(a,i(Qs)),Qs.result()},r.projection=function(a){return arguments.length?(i=a==null?(s=null,xu):(s=a).stream,r):s},r.context=function(a){return arguments.length?(n=a==null?(t=null,new GE):new jE(t=a),typeof e!="function"&&n.pointRadius(e),r):t},r.pointRadius=function(a){return arguments.length?(e=typeof a=="function"?a:(n.pointRadius(+a),+a),r):e},r.projection(s).context(t)}function em(s){return function(t){var e=new ky;for(var i in s)e[i]=s[i];return e.stream=t,e}}function ky(){}ky.prototype={constructor:ky,point:function(s,t){this.stream.point(s,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function jx(s,t,e){var i=s.clipExtent&&s.clipExtent();return s.scale(150).translate([0,0]),i!=null&&s.clipExtent(null),ol(e,s.stream(Og)),t(Og.result()),i!=null&&s.clipExtent(i),s}function im(s,t,e){return jx(s,function(i){var n=t[1][0]-t[0][0],r=t[1][1]-t[0][1],a=Math.min(n/(i[1][0]-i[0][0]),r/(i[1][1]-i[0][1])),o=+t[0][0]+(n-a*(i[1][0]+i[0][0]))/2,l=+t[0][1]+(r-a*(i[1][1]+i[0][1]))/2;s.scale(150*a).translate([o,l])},e)}function zx(s,t,e){return im(s,[[0,0],t],e)}function Hx(s,t,e){return jx(s,function(i){var n=+t,r=n/(i[1][0]-i[0][0]),a=(n-r*(i[1][0]+i[0][0]))/2,o=-r*i[0][1];s.scale(150*r).translate([a,o])},e)}function Nx(s,t,e){return jx(s,function(i){var n=+t,r=n/(i[1][1]-i[0][1]),a=-r*i[0][0],o=(n-r*(i[1][1]+i[0][1]))/2;s.scale(150*r).translate([a,o])},e)}var z1=16,mz=Zt(30*Ye);function H1(s,t){return+t?yz(s,t):vz(s)}function vz(s){return em({point:function(t,e){t=s(t,e),this.stream.point(t[0],t[1])}})}function yz(s,t){function e(i,n,r,a,o,l,h,d,u,c,p,g,f,_){var m=h-i,v=d-n,y=m*m+v*v;if(y>4*t&&f--){var b=a+c,x=o+p,S=l+g,A=Ts(b*b+x*x+S*S),k=hn(S/=A),w=xe(xe(S)-1)<Vt||xe(r-u)<Vt?(r+u)/2:Fr(x,b),T=s(w,k),M=T[0],C=T[1],R=M-i,I=C-n,O=v*R-m*I;(O*O/y>t||xe((m*R+v*I)/y-.5)>.3||a*c+o*p+l*g<mz)&&(e(i,n,r,a,o,l,M,C,w,b/=A,x/=A,S,f,_),_.point(M,C),e(M,C,w,b,x,S,h,d,u,c,p,g,f,_))}}return function(i){var n,r,a,o,l,h,d,u,c,p,g,f,_={point:m,lineStart:v,lineEnd:b,polygonStart:function(){i.polygonStart(),_.lineStart=x},polygonEnd:function(){i.polygonEnd(),_.lineStart=v}};function m(k,w){k=s(k,w),i.point(k[0],k[1])}function v(){u=NaN,_.point=y,i.lineStart()}function y(k,w){var T=Sh([k,w]),M=s(k,w);e(u,c,d,p,g,f,u=M[0],c=M[1],d=k,p=T[0],g=T[1],f=T[2],z1,i),i.point(u,c)}function b(){_.point=m,i.lineEnd()}function x(){v(),_.point=S,_.lineEnd=A}function S(k,w){y(n=k,w),r=u,a=c,o=p,l=g,h=f,_.point=y}function A(){e(u,c,d,p,g,f,r,a,n,o,l,h,z1,i),_.lineEnd=b,b()}return _}}var bz=em({point:function(s,t){this.stream.point(s*Ye,t*Ye)}});function xz(s){return em({point:function(t,e){var i=s(t,e);return this.stream.point(i[0],i[1])}})}function Sz(s,t,e,i,n){function r(a,o){return a*=i,o*=n,[t+s*a,e-s*o]}return r.invert=function(a,o){return[(a-t)/s*i,(e-o)/s*n]},r}function N1(s,t,e,i,n,r){var a=Zt(r),o=Ut(r),l=a*s,h=o*s,d=a/s,u=o/s,c=(o*e-a*t)/s,p=(o*t+a*e)/s;function g(f,_){return f*=i,_*=n,[l*f-h*_+t,e-h*f-l*_]}return g.invert=function(f,_){return[i*(d*f-u*_+c),n*(p-u*f-d*_)]},g}function Gr(s){return WE(function(){return s})()}function WE(s){var t,e=150,i=480,n=250,r=0,a=0,o=0,l=0,h=0,d,u=0,c=1,p=1,g=null,f=B1,_=null,m,v,y,b=xu,x=.5,S,A,k,w,T;function M(O){return k(O[0]*Ye,O[1]*Ye)}function C(O){return O=k.invert(O[0],O[1]),O&&[O[0]*$i,O[1]*$i]}M.stream=function(O){return w&&T===O?w:w=bz(xz(d)(f(S(b(T=O)))))},M.preclip=function(O){return arguments.length?(f=O,g=void 0,I()):f},M.postclip=function(O){return arguments.length?(b=O,_=m=v=y=null,I()):b},M.clipAngle=function(O){return arguments.length?(f=+O?rz(g=O*Ye):(g=null,B1),I()):g*$i},M.clipExtent=function(O){return arguments.length?(b=O==null?(_=m=v=y=null,xu):RE(_=+O[0][0],m=+O[0][1],v=+O[1][0],y=+O[1][1]),I()):_==null?null:[[_,m],[v,y]]},M.scale=function(O){return arguments.length?(e=+O,R()):e},M.translate=function(O){return arguments.length?(i=+O[0],n=+O[1],R()):[i,n]},M.center=function(O){return arguments.length?(r=O[0]%360*Ye,a=O[1]%360*Ye,R()):[r*$i,a*$i]},M.rotate=function(O){return arguments.length?(o=O[0]%360*Ye,l=O[1]%360*Ye,h=O.length>2?O[2]%360*Ye:0,R()):[o*$i,l*$i,h*$i]},M.angle=function(O){return arguments.length?(u=O%360*Ye,R()):u*$i},M.reflectX=function(O){return arguments.length?(c=O?-1:1,R()):c<0},M.reflectY=function(O){return arguments.length?(p=O?-1:1,R()):p<0},M.precision=function(O){return arguments.length?(S=H1(A,x=O*O),I()):Ts(x)},M.fitExtent=function(O,L){return im(M,O,L)},M.fitSize=function(O,L){return zx(M,O,L)},M.fitWidth=function(O,L){return Hx(M,O,L)},M.fitHeight=function(O,L){return Nx(M,O,L)};function R(){var O=N1(e,0,0,c,p,u).apply(null,t(r,a)),L=(u?N1:Sz)(e,i-O[0],n-O[1],c,p,u);return d=wE(o,l,h),A=gy(t,L),k=gy(d,A),S=H1(A,x),I()}function I(){return w=T=null,M}return function(){return t=s.apply(this,arguments),M.invert=t.invert&&C,R()}}function Gx(s){var t=0,e=ie/3,i=WE(s),n=i(t,e);return n.parallels=function(r){return arguments.length?i(t=r[0]*Ye,e=r[1]*Ye):[t*$i,e*$i]},n}function Az(s){var t=Zt(s);function e(i,n){return[i*t,Ut(n)/t]}return e.invert=function(i,n){return[i/t,hn(n*t)]},e}function kz(s,t){var e=Ut(s),i=(e+Ut(t))/2;if(xe(i)<Vt)return Az(s);var n=1+e*(2*i-e),r=Ts(n)/i;function a(o,l){var h=Ts(n-2*i*Ut(l))/i;return[h*Ut(o*=i),r-h*Zt(o)]}return a.invert=function(o,l){var h=r-l,d=Fr(o,xe(h))*en(h);return h*i<0&&(d-=ie*en(o)*en(h)),[d/i,hn((n-(o*o+h*h)*i*i)/(2*i))]},a}function Bg(){return Gx(kz).scale(155.424).center([0,33.6442])}function VE(){return Bg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function wz(s){var t=s.length;return{point:function(e,i){for(var n=-1;++n<t;)s[n].point(e,i)},sphere:function(){for(var e=-1;++e<t;)s[e].sphere()},lineStart:function(){for(var e=-1;++e<t;)s[e].lineStart()},lineEnd:function(){for(var e=-1;++e<t;)s[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<t;)s[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<t;)s[e].polygonEnd()}}}function Tz(){var s,t,e=VE(),i,n=Bg().rotate([154,0]).center([-2,58.5]).parallels([55,65]),r,a=Bg().rotate([157,0]).center([-3,19.9]).parallels([8,18]),o,l,h={point:function(c,p){l=[c,p]}};function d(c){var p=c[0],g=c[1];return l=null,i.point(p,g),l||(r.point(p,g),l)||(o.point(p,g),l)}d.invert=function(c){var p=e.scale(),g=e.translate(),f=(c[0]-g[0])/p,_=(c[1]-g[1])/p;return(_>=.12&&_<.234&&f>=-.425&&f<-.214?n:_>=.166&&_<.234&&f>=-.214&&f<-.115?a:e).invert(c)},d.stream=function(c){return s&&t===c?s:s=wz([e.stream(t=c),n.stream(c),a.stream(c)])},d.precision=function(c){return arguments.length?(e.precision(c),n.precision(c),a.precision(c),u()):e.precision()},d.scale=function(c){return arguments.length?(e.scale(c),n.scale(c*.35),a.scale(c),d.translate(e.translate())):e.scale()},d.translate=function(c){if(!arguments.length)return e.translate();var p=e.scale(),g=+c[0],f=+c[1];return i=e.translate(c).clipExtent([[g-.455*p,f-.238*p],[g+.455*p,f+.238*p]]).stream(h),r=n.translate([g-.307*p,f+.201*p]).clipExtent([[g-.425*p+Vt,f+.12*p+Vt],[g-.214*p-Vt,f+.234*p-Vt]]).stream(h),o=a.translate([g-.205*p,f+.212*p]).clipExtent([[g-.214*p+Vt,f+.166*p+Vt],[g-.115*p-Vt,f+.234*p-Vt]]).stream(h),u()},d.fitExtent=function(c,p){return im(d,c,p)},d.fitSize=function(c,p){return zx(d,c,p)},d.fitWidth=function(c,p){return Hx(d,c,p)},d.fitHeight=function(c,p){return Nx(d,c,p)};function u(){return s=t=null,d}return d.scale(1070)}function UE(s){return function(t,e){var i=Zt(t),n=Zt(e),r=s(i*n);return[r*n*Ut(t),r*Ut(e)]}}function Sc(s){return function(t,e){var i=Ts(t*t+e*e),n=s(i),r=Ut(n),a=Zt(n);return[Fr(t*r,i*a),hn(i&&e*r/i)]}}var $E=UE(function(s){return Ts(2/(1+s))});$E.invert=Sc(function(s){return 2*hn(s/2)});function Mz(){return Gr($E).scale(124.75).clipAngle(180-.001)}var YE=UE(function(s){return(s=kE(s))&&s/Ut(s)});YE.invert=Sc(function(s){return s});function Cz(){return Gr(YE).scale(79.4188).clipAngle(180-.001)}function sm(s,t){return[s,Mg(Dx((ti+t)/2))]}sm.invert=function(s,t){return[s,2*Yh(AE(t))-ti]};function Pz(){return XE(sm).scale(961/js)}function XE(s){var t=Gr(s),e=t.center,i=t.scale,n=t.translate,r=t.clipExtent,a=null,o,l,h;t.scale=function(u){return arguments.length?(i(u),d()):i()},t.translate=function(u){return arguments.length?(n(u),d()):n()},t.center=function(u){return arguments.length?(e(u),d()):e()},t.clipExtent=function(u){return arguments.length?(u==null?a=o=l=h=null:(a=+u[0][0],o=+u[0][1],l=+u[1][0],h=+u[1][1]),d()):a==null?null:[[a,o],[l,h]]};function d(){var u=ie*i(),c=t(Kj(t.rotate()).invert([0,0]));return r(a==null?[[c[0]-u,c[1]-u],[c[0]+u,c[1]+u]]:s===sm?[[Math.max(c[0]-u,a),o],[Math.min(c[0]+u,l),h]]:[[a,Math.max(c[1]-u,o)],[l,Math.min(c[1]+u,h)]])}return d()}function Sp(s){return Dx((ti+s)/2)}function Ez(s,t){var e=Zt(s),i=s===t?Ut(s):Mg(e/Zt(t))/Mg(Sp(t)/Sp(s)),n=e*qv(Sp(s),i)/i;if(!i)return sm;function r(a,o){n>0?o<-ti+Vt&&(o=-ti+Vt):o>ti-Vt&&(o=ti-Vt);var l=n/qv(Sp(o),i);return[l*Ut(i*a),n-l*Zt(i*a)]}return r.invert=function(a,o){var l=n-o,h=en(i)*Ts(a*a+l*l),d=Fr(a,xe(l))*en(l);return l*i<0&&(d-=ie*en(a)*en(l)),[d/i,2*Yh(qv(n/h,1/i))-ti]},r}function Rz(){return Gx(Ez).scale(109.5).parallels([30,30])}function Dg(s,t){return[s,t]}Dg.invert=Dg;function Oz(){return Gr(Dg).scale(152.63)}function Iz(s,t){var e=Zt(s),i=s===t?Ut(s):(e-Zt(t))/(t-s),n=e/i+s;if(xe(i)<Vt)return Dg;function r(a,o){var l=n-o,h=i*a;return[l*Ut(h),n-l*Zt(h)]}return r.invert=function(a,o){var l=n-o,h=Fr(a,xe(l))*en(l);return l*i<0&&(h-=ie*en(a)*en(l)),[h/i,n-en(i)*Ts(a*a+l*l)]},r}function Lz(){return Gx(Iz).scale(131.154).center([0,13.9389])}var Ud=1.340264,$d=-.081106,Yd=893e-6,Xd=.003796,Fg=Ts(3)/2,Bz=12;function KE(s,t){var e=hn(Fg*Ut(t)),i=e*e,n=i*i*i;return[s*Zt(e)/(Fg*(Ud+3*$d*i+n*(7*Yd+9*Xd*i))),e*(Ud+$d*i+n*(Yd+Xd*i))]}KE.invert=function(s,t){for(var e=t,i=e*e,n=i*i*i,r=0,a,o,l;r<Bz&&(o=e*(Ud+$d*i+n*(Yd+Xd*i))-t,l=Ud+3*$d*i+n*(7*Yd+9*Xd*i),e-=a=o/l,i=e*e,n=i*i*i,!(xe(a)<Xj));++r);return[Fg*s*(Ud+3*$d*i+n*(7*Yd+9*Xd*i))/Zt(e),hn(Ut(e)/Fg)]};function Dz(){return Gr(KE).scale(177.158)}function qE(s,t){var e=Zt(t),i=Zt(s)*e;return[e*Ut(s)/i,Ut(t)/i]}qE.invert=Sc(Yh);function Fz(){return Gr(qE).scale(144.049).clipAngle(60)}function jz(){var s=1,t=0,e=0,i=1,n=1,r=0,a,o,l=null,h,d,u,c=1,p=1,g=em({point:function(b,x){var S=y([b,x]);this.stream.point(S[0],S[1])}}),f=xu,_,m;function v(){return c=s*i,p=s*n,_=m=null,y}function y(b){var x=b[0]*c,S=b[1]*p;if(r){var A=S*a-x*o;x=x*a+S*o,S=A}return[x+t,S+e]}return y.invert=function(b){var x=b[0]-t,S=b[1]-e;if(r){var A=S*a+x*o;x=x*a-S*o,S=A}return[x/c,S/p]},y.stream=function(b){return _&&m===b?_:_=g(f(m=b))},y.postclip=function(b){return arguments.length?(f=b,l=h=d=u=null,v()):f},y.clipExtent=function(b){return arguments.length?(f=b==null?(l=h=d=u=null,xu):RE(l=+b[0][0],h=+b[0][1],d=+b[1][0],u=+b[1][1]),v()):l==null?null:[[l,h],[d,u]]},y.scale=function(b){return arguments.length?(s=+b,v()):s},y.translate=function(b){return arguments.length?(t=+b[0],e=+b[1],v()):[t,e]},y.angle=function(b){return arguments.length?(r=b%360*Ye,o=Ut(r),a=Zt(r),v()):r*$i},y.reflectX=function(b){return arguments.length?(i=b?-1:1,v()):i<0},y.reflectY=function(b){return arguments.length?(n=b?-1:1,v()):n<0},y.fitExtent=function(b,x){return im(y,b,x)},y.fitSize=function(b,x){return zx(y,b,x)},y.fitWidth=function(b,x){return Hx(y,b,x)},y.fitHeight=function(b,x){return Nx(y,b,x)},y}function ZE(s,t){var e=t*t,i=e*e;return[s*(.8707-.131979*e+i*(-.013791+i*(.003971*e-.001529*i))),t*(1.007226+e*(.015085+i*(-.044475+.028874*e-.005916*i)))]}ZE.invert=function(s,t){var e=t,i=25,n;do{var r=e*e,a=r*r;e-=n=(e*(1.007226+r*(.015085+a*(-.044475+.028874*r-.005916*a)))-t)/(1.007226+r*(.015085*3+a*(-.044475*7+.028874*9*r-.005916*11*a)))}while(xe(n)>Vt&&--i>0);return[s/(.8707+(r=e*e)*(-.131979+r*(-.013791+r*r*r*(.003971-.001529*r)))),e]};function zz(){return Gr(ZE).scale(175.295)}function JE(s,t){return[Zt(t)*Ut(s),Ut(t)]}JE.invert=Sc(hn);function Hz(){return Gr(JE).scale(249.5).clipAngle(90+Vt)}function QE(s,t){var e=Zt(t),i=1+Zt(s)*e;return[e*Ut(s)/i,Ut(t)/i]}QE.invert=Sc(function(s){return 2*Yh(s)});function Nz(){return Gr(QE).scale(250).clipAngle(142)}function tR(s,t){return[Mg(Dx((ti+t)/2)),-s]}tR.invert=function(s,t){return[-t,2*Yh(AE(s))-ti]};function Gz(){var s=XE(tR),t=s.center,e=s.rotate;return s.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},s.rotate=function(i){return arguments.length?e([i[0],i[1],i.length>2?i[2]+90:90]):(i=e(),[i[0],i[1],i[2]-90])},e([0,0,90]).scale(159.155)}function Wz(s){return s}function Vz(s){if(s==null)return Wz;var t,e,i=s.scale[0],n=s.scale[1],r=s.translate[0],a=s.translate[1];return function(o,l){l||(t=e=0);var h=2,d=o.length,u=new Array(d);for(u[0]=(t+=o[0])*i+r,u[1]=(e+=o[1])*n+a;h<d;)u[h]=o[h],++h;return u}}function Uz(s,t){for(var e,i=s.length,n=i-t;n<--i;)e=s[n],s[n++]=s[i],s[i]=e}function $z(s,t){return typeof t=="string"&&(t=s.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(e){return G1(s,e)})}:G1(s,t)}function G1(s,t){var e=t.id,i=t.bbox,n=t.properties==null?{}:t.properties,r=Yz(s,t);return e==null&&i==null?{type:"Feature",properties:n,geometry:r}:i==null?{type:"Feature",id:e,properties:n,geometry:r}:{type:"Feature",id:e,bbox:i,properties:n,geometry:r}}function Yz(s,t){var e=Vz(s.transform),i=s.arcs;function n(d,u){u.length&&u.pop();for(var c=i[d<0?~d:d],p=0,g=c.length;p<g;++p)u.push(e(c[p],p));d<0&&Uz(u,g)}function r(d){return e(d)}function a(d){for(var u=[],c=0,p=d.length;c<p;++c)n(d[c],u);return u.length<2&&u.push(u[0]),u}function o(d){for(var u=a(d);u.length<4;)u.push(u[0]);return u}function l(d){return d.map(o)}function h(d){var u=d.type,c;switch(u){case"GeometryCollection":return{type:u,geometries:d.geometries.map(h)};case"Point":c=r(d.coordinates);break;case"MultiPoint":c=d.coordinates.map(r);break;case"LineString":c=a(d.arcs);break;case"MultiLineString":c=d.arcs.map(a);break;case"Polygon":c=l(d.arcs);break;case"MultiPolygon":c=d.arcs.map(l);break;default:return null}return{type:u,coordinates:c}}return h(t)}var eR={exports:{}},Bn=function(s,t){this.p1=s,this.p2=t};Bn.prototype.rise=function(){return this.p2[1]-this.p1[1]};Bn.prototype.run=function(){return this.p2[0]-this.p1[0]};Bn.prototype.slope=function(){return this.rise()/this.run()};Bn.prototype.yIntercept=function(){return this.p1[1]-this.p1[0]*this.slope(this.p1,this.p2)};Bn.prototype.isVertical=function(){return!isFinite(this.slope())};Bn.prototype.isHorizontal=function(){return this.p1[1]==this.p2[1]};Bn.prototype._perpendicularDistanceHorizontal=function(s){return Math.abs(this.p1[1]-s[1])};Bn.prototype._perpendicularDistanceVertical=function(s){return Math.abs(this.p1[0]-s[0])};Bn.prototype._perpendicularDistanceHasSlope=function(s){var t=this.slope(),e=this.yIntercept();return Math.abs(t*s[0]-s[1]+e)/Math.sqrt(Math.pow(t,2)+1)};Bn.prototype.perpendicularDistance=function(s){return this.isVertical()?this._perpendicularDistanceVertical(s):this.isHorizontal()?this._perpendicularDistanceHorizontal(s):this._perpendicularDistanceHasSlope(s)};var Xz=Bn,Kz=Xz,wy=function(s,t){for(var e=0,i=0,n=1;n<=s.length-2;n++){var r=new Kz(s[0],s[s.length-1]).perpendicularDistance(s[n]);r>e&&(i=n,e=r)}if(e>t)var a=wy(s.slice(0,i),t),o=wy(s.slice(i,s.length),t),l=a.concat(o);else s.length>1?l=[s[0],s[s.length-1]]:l=[s[0]];return l},qz=wy;(function(s){var t=qz;s.exports=function(n,r,a){return a||(n=JSON.parse(JSON.stringify(n))),n.features?i(n,r):n.type&&n.type==="Feature"?e(n,r):new Error("FeatureCollection or individual Feature required")},s.exports.simplify=function(n,r){return t(n,r)};function e(n,r){var a=n.geometry,o=a.type;if(o==="LineString")a.coordinates=s.exports.simplify(a.coordinates,r);else if(o==="Polygon"||o==="MultiLineString")for(var l=0;l<a.coordinates.length;l++)a.coordinates[l]=s.exports.simplify(a.coordinates[l],r);else if(o==="MultiPolygon")for(var h=0;h<a.coordinates.length;h++)for(var d=0;d<a.coordinates[h].length;d++)a.coordinates[h][d]=s.exports.simplify(a.coordinates[h][d],r);return n}function i(n,r){for(var a=0;a<n.features.length;a++)n.features[a]=e(n.features[a],r);return n}})(eR);var Zz=eR.exports;const Jz=aE(Zz),nm=function(s,...t){return t3(bi(s),...t)};function iR(s,t,e){const i=t[e];if(i===void 0)s[e]=null;else if($t(i)){$t(s[e])||(s[e]={});for(const n in i)iR(s[e],i,n)}else s[e]=i}function Qz(s,t){if($t(t)&&s!==t)for(const e in t)iR(s,t,e)}function t3(s,...t){s||(s={});let e=-1;const i=t.length;for(;++e<i;)Qz(s,t[e]);return s}const e3={tolerance:.01},sR=(s,t)=>{const e=nm(e3,t),{tolerance:i}=e;return Jz(s,i)};var Ao;(function(s){s.DSV="dsv",s.TREE="tree",s.GEO="geo",s.BYTE="bytejson",s.HEX="hex",s.GRAPH="graph",s.TABLE="table",s.GEO_GRATICULE="geo-graticule"})(Ao||(Ao={}));const i3=(s,t)=>{const{fields:e,key:i,value:n,retains:r}=t,a=[];for(let o=0;o<s.length;o++)e.forEach(l=>{const h={};if(h[i]=l,h[n]=s[o][l],r)r.forEach(d=>{h[d]=s[o][d]});else for(const d in s[o])e.indexOf(d)===-1&&(h[d]=s[o][d]);a.push(h)});return a},nR=(s,t)=>{var e,i;if(!(t!=null&&t.fields)||s.length===0)return s;const n=t.fields,r=s[0],a={},o=[];for(const l in n)if(Object.prototype.hasOwnProperty.call(n,l)){const h=n[l];if(!h.type){let u=r;l in r||(u=(e=s.find(c=>l in c))!==null&&e!==void 0?e:r),h.type=typeof u[l]=="number"?"linear":"ordinal"}let d;if(typeof h.sortIndex=="number"&&(d={key:l,type:h.type,index:h.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:h.sortReverse===!0},o.push(d)),((i=h.domain)===null||i===void 0?void 0:i.length)>0)if(h.type==="ordinal"){h._domainCache={},a[l]=h;const u={};h.domain.forEach((c,p)=>{u[c]=p,h._domainCache[c]=p}),d&&(d.sortIndex=u,d.sortIndexCount=h.domain.length)}else h.domain.length>=2&&(a[l]=h)}return Object.keys(a).length>0&&(s=s.filter(l=>{for(const h in a){const d=a[h];if(d.type==="ordinal"){if(!(l[h]in d._domainCache))return!1}else if(d.domain[0]>l[h]||d.domain[1]<l[h])return!1}return!0})),o.sort((l,h)=>l.index-h.index),s.sort((l,h)=>s3(l,h,o)),s};function s3(s,t,e){for(let i=0;i<e.length;i++){const n=e[i];let r=0;if(n.type==="ordinal"?(n.sortIndex[t[n.key]]===void 0&&(n.sortIndex[t[n.key]]=n.sortIndexCount++),n.sortIndex[s[n.key]]===void 0&&(n.sortIndex[s[n.key]]=n.sortIndexCount++),r=n.sortIndex[s[n.key]]-n.sortIndex[t[n.key]]):n.type==="linear"&&(r=s[n.key]-t[n.key]),n.sortReverse&&(r=-r),r!==0)return r}return 0}var W1={},i0={},s0=34,ud=10,n0=13;function rR(s){return new Function("d","return {"+s.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function n3(s,t){var e=rR(s);return function(i,n){return t(e(i),n,s)}}function V1(s){var t=Object.create(null),e=[];return s.forEach(function(i){for(var n in i)n in t||e.push(t[n]=n)}),e}function As(s,t){var e=s+"",i=e.length;return i<t?new Array(t-i+1).join(0)+e:e}function r3(s){return s<0?"-"+As(-s,6):s>9999?"+"+As(s,6):As(s,4)}function a3(s){var t=s.getUTCHours(),e=s.getUTCMinutes(),i=s.getUTCSeconds(),n=s.getUTCMilliseconds();return isNaN(s)?"Invalid Date":r3(s.getUTCFullYear())+"-"+As(s.getUTCMonth()+1,2)+"-"+As(s.getUTCDate(),2)+(n?"T"+As(t,2)+":"+As(e,2)+":"+As(i,2)+"."+As(n,3)+"Z":i?"T"+As(t,2)+":"+As(e,2)+":"+As(i,2)+"Z":e||t?"T"+As(t,2)+":"+As(e,2)+"Z":"")}function Wx(s){var t=new RegExp('["'+s+`
|
||
\r]`),e=s.charCodeAt(0);function i(u,c){var p,g,f=n(u,function(_,m){if(p)return p(_,m-1);g=_,p=c?n3(_,c):rR(_)});return f.columns=g||[],f}function n(u,c){var p=[],g=u.length,f=0,_=0,m,v=g<=0,y=!1;u.charCodeAt(g-1)===ud&&--g,u.charCodeAt(g-1)===n0&&--g;function b(){if(v)return i0;if(y)return y=!1,W1;var S,A=f,k;if(u.charCodeAt(A)===s0){for(;f++<g&&u.charCodeAt(f)!==s0||u.charCodeAt(++f)===s0;);return(S=f)>=g?v=!0:(k=u.charCodeAt(f++))===ud?y=!0:k===n0&&(y=!0,u.charCodeAt(f)===ud&&++f),u.slice(A+1,S-1).replace(/""/g,'"')}for(;f<g;){if((k=u.charCodeAt(S=f++))===ud)y=!0;else if(k===n0)y=!0,u.charCodeAt(f)===ud&&++f;else if(k!==e)continue;return u.slice(A,S)}return v=!0,u.slice(A,g)}for(;(m=b())!==i0;){for(var x=[];m!==W1&&m!==i0;)x.push(m),m=b();c&&(x=c(x,_++))==null||p.push(x)}return p}function r(u,c){return u.map(function(p){return c.map(function(g){return d(p[g])}).join(s)})}function a(u,c){return c==null&&(c=V1(u)),[c.map(d).join(s)].concat(r(u,c)).join(`
|
||
`)}function o(u,c){return c==null&&(c=V1(u)),r(u,c).join(`
|
||
`)}function l(u){return u.map(h).join(`
|
||
`)}function h(u){return u.map(d).join(s)}function d(u){return u==null?"":u instanceof Date?a3(u):t.test(u+="")?'"'+u.replace(/"/g,'""')+'"':u}return{parse:i,parseRows:n,format:a,formatBody:o,formatRows:l,formatRow:h,formatValue:d}}var o3=Wx(","),l3=o3.parse,h3=Wx(" "),d3=h3.parse;const u3={delimiter:","},aR=(s,t={},e)=>{e.type=Ao.DSV;const i=nm(u3,t),{delimiter:n}=i;if(!ht(n))throw new TypeError("Invalid delimiter: must be a string!");return Wx(n).parse(s)},oR=(s,t={},e)=>(e.type=Ao.DSV,l3(s)),lR=(s,t={},e)=>(e.type=Ao.DSV,d3(s));function c3(s){if(!s)throw new Error("geojson is required");switch(s.type){case"Feature":return hR(s);case"FeatureCollection":return p3(s);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Vx(s);default:throw new Error("unknown GeoJSON type")}}function hR(s){var t={type:"Feature"};return Object.keys(s).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:t[e]=s[e]}}),t.properties=dR(s.properties),t.geometry=Vx(s.geometry),t}function dR(s){var t={};return s&&Object.keys(s).forEach(function(e){var i=s[e];typeof i=="object"?i===null?t[e]=null:Array.isArray(i)?t[e]=i.map(function(n){return n}):t[e]=dR(i):t[e]=i}),t}function p3(s){var t={type:"FeatureCollection"};return Object.keys(s).forEach(function(e){switch(e){case"type":case"features":return;default:t[e]=s[e]}}),t.features=s.features.map(function(e){return hR(e)}),t}function Vx(s){var t={type:s.type};return s.bbox&&(t.bbox=s.bbox),s.type==="GeometryCollection"?(t.geometries=s.geometries.map(function(e){return Vx(e)}),t):(t.coordinates=uR(s.coordinates),t)}function uR(s){var t=s;return typeof t[0]!="object"?t.slice():t.map(function(e){return uR(e)})}function Id(s){if(Array.isArray(s))return s;if(s.type==="Feature"){if(s.geometry!==null)return s.geometry.coordinates}else if(s.coordinates)return s.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Ty(s){for(var t=Id(s),e=0,i=1,n,r;i<t.length;)n=r||t[0],r=t[i],e+=(r[0]-n[0])*(r[1]+n[1]),i++;return e>0}function U1(s,t){if(s.type==="Feature")t(s,0);else if(s.type==="FeatureCollection")for(var e=0;e<s.features.length&&t(s.features[e],e)!==!1;e++);}function Ux(s,t){var e,i,n,r,a,o,l,h,d,u,c=0,p=s.type==="FeatureCollection",g=s.type==="Feature",f=p?s.features.length:1;for(e=0;e<f;e++){for(o=p?s.features[e].geometry:g?s.geometry:s,h=p?s.features[e].properties:g?s.properties:{},d=p?s.features[e].bbox:g?s.bbox:void 0,u=p?s.features[e].id:g?s.id:void 0,l=o?o.type==="GeometryCollection":!1,a=l?o.geometries.length:1,n=0;n<a;n++){if(r=l?o.geometries[n]:o,r===null){if(t(null,c,h,d,u)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(r,c,h,d,u)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(t(r.geometries[i],c,h,d,u)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}c++}}function g3(s,t){Ux(s,function(e,i,n,r,a){var o=e===null?null:e.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return t(k1(e,n,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(o){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var h=0;h<e.coordinates.length;h++){var d=e.coordinates[h],u={type:l,coordinates:d};if(t(k1(u,n),i,h)===!1)return!1}})}function f3(s,t){if(t=t||{},!Wj(t))throw new Error("options is invalid");var e=t.reverse||!1,i=t.mutate||!1;if(!s)throw new Error("<geojson> is required");if(typeof e!="boolean")throw new Error("<reverse> must be a boolean");if(typeof i!="boolean")throw new Error("<mutate> must be a boolean");i===!1&&(s=c3(s));var n=[];switch(s.type){case"GeometryCollection":return Ux(s,function(r){hg(r,e)}),s;case"FeatureCollection":return U1(s,function(r){U1(hg(r,e),function(a){n.push(a)})}),SE(n)}return hg(s,e)}function hg(s,t){var e=s.type==="Feature"?s.geometry.type:s.type;switch(e){case"GeometryCollection":return Ux(s,function(i){hg(i,t)}),s;case"LineString":return $1(Id(s),t),s;case"Polygon":return Y1(Id(s),t),s;case"MultiLineString":return Id(s).forEach(function(i){$1(i,t)}),s;case"MultiPolygon":return Id(s).forEach(function(i){Y1(i,t)}),s;case"Point":case"MultiPoint":return s}}function $1(s,t){Ty(s)===t&&s.reverse()}function Y1(s,t){Ty(s[0])!==t&&s[0].reverse();for(var e=1;e<s.length;e++)Ty(s[e])===t&&s[e].reverse()}function _3(s){if(!s)throw new Error("geojson is required");var t=[];return g3(s,function(e){t.push(e)}),SE(t)}const X1=Fx(),cR={centroid:!1,name:!1,bbox:!1,rewind:!1},K1=s=>{if(s.geometry.type.startsWith("Multi")){const t=_3(s).features[0];return Object.assign(Object.assign({},t),t.properties)}return Object.assign(Object.assign({},s),s.properties)},m3=s=>{const t=[];return s.forEach(e=>{e.type==="FeatureCollection"?e.features.forEach(i=>{t.push(K1(i))}):t.push(K1(e))}),t},pR=(s,t={},e)=>{e.type=Ao.GEO;const i=nm(cR,t),{centroid:n,name:r,bbox:a,rewind:o}=i;if(Array.isArray(s))return m3(s);let l=s.features;return o&&(l=f3(s,{reverse:!$t(o)||o.reverse}).features),l.forEach(h=>{if(n){const d=X1.centroid(h);h.centroidX=d[0],h.centroidY=d[1]}if(r&&(h.name=h.properties.name),a){const d=X1.bounds(h);h.bbox=d}}),s.features=l,s},v3={},y3=(s,t,e)=>{e.type=Ao.GEO;const i=nm(cR,v3,t),{object:n}=i;if(!ht(n))throw new TypeError("Invalid object: must be a string!");const r=$z(s,s.objects[n]);return pR(r,i,e)},rm=(s,t,e)=>{const i=!ye(t==null?void 0:t.dependencyUpdate)||(t==null?void 0:t.dependencyUpdate);if(!s||!$(s))throw new TypeError("Invalid data: must be DataView array!");return $(e.rawData)&&e.rawData.forEach(n=>{n.target&&(n.target.removeListener("change",e.reRunAllTransform),n.target.removeListener("markRunning",e.markRunning))}),i&&s.forEach(n=>{n.target.addListener("change",e.reRunAllTransform),n.target.addListener("markRunning",e.markRunning)}),s};let r0=0;const b3=1e8;function gR(s="dataset"){return r0>b3&&(r0=0),s+"_"+r0++}class ko{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new jo,i=t!=null&&t.name?t.name:gR("dataset"),this.name=i,this._logger=(e=t==null?void 0:t.logger)!==null&&e!==void 0?e:Nt.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&((i=this._logger)===null||i===void 0||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&((i=this._logger)===null||i===void 0||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&((i=this._logger)===null||i===void 0||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let n=this._callMap.get(i);n||(n=()=>{t.some(r=>r.isRunning)||i()}),t.forEach(r=>{r.target.addListener(e,n)}),this._callMap.set(i,n)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const n=this._callMap.get(i);n&&t.forEach(r=>{r.target.removeListener(e,n)}),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach(e=>{var i;return(i=this.getDataView(e.name))===null||i===void 0?void 0:i.markRunning()}),t.forEach(e=>{var i;return(i=this.getDataView(e.name))===null||i===void 0?void 0:i.parseNewData(e.data,e.options)})}multipleDataViewUpdateInRawData(t){t.forEach(e=>{var i;return(i=this.getDataView(e.name))===null||i===void 0?void 0:i.markRunning()}),t.forEach(e=>{var i;return(i=this.getDataView(e.name))===null||i===void 0?void 0:i.updateRawData(e.data,e.options)})}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const a0="_data-view-diff-rank";class Jt{constructor(t,e){let i;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new jo,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(n={pushHistory:!0,emitMessage:!0})=>(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach(r=>{this.executeTransform(r,{pushHistory:n.pushHistory,emitMessage:!1}),this.isLastTransform(r)&&this.diffLastData()}),this.isRunning=!1,n.emitMessage!==!1&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=e!=null&&e.name?e.name:gR("dataview"),this.name=i,e!=null&&e.history&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(e==null?void 0:e.fields)}parse(t,e,i=!1){var n;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const r=this.cloneParseData(t,e);if(e!=null&&e.type){const a=((n=this.dataSet.getParser(e.type))!==null&&n!==void 0?n:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=a,this.history&&this.historyData.push(r,a),this.latestData=a}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if(t.type==="fields"){this._fields=t.options.fields;const n=this.transformsArr.findIndex(r=>r.type===t.type);n>=0&&(i=!1,this.transformsArr[n].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const n=this.isLastTransform(t);this.executeTransform(t),n&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort((t,e)=>{var i,n;return((i=t.level)!==null&&i!==void 0?i:0)-((n=e.level)!==null&&n!==void 0?n:0)})}executeTransform(t,e={pushHistory:!0,emitMessage:!0}){const{pushHistory:i,emitMessage:n}=e,r=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&i!==!1&&this.historyData.push(r),this.latestData=r,n!==!1&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData||!this.latestData.forEach||!(!((t=this._diffKeys)===null||t===void 0)&&t.length))return;const e=this._diffRank+1;if(this._diffRank===0)this.latestData.forEach(i=>{i[a0]=e,this._diffMap.set(this._diffKeys.reduce((n,r)=>n+i[r],""),i)}),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let i;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach(n=>{n[a0]=e,i=this._diffKeys.reduce((r,a)=>r+n[a],""),this._diffMap.get(i)?this.latestDataAUD.update.push(n):this.latestDataAUD.add.push(n),this._diffMap.set(i,n)}),this._diffMap.forEach((n,r)=>{n[a0]<e&&(this.latestDataAUD.del.push(n),this._diffMap.delete(r))})}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof Jt||(e==null?void 0:e.clone)!==!0||(i=!0),i?bi(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:((t=this.parseOption)===null||t===void 0?void 0:t.type)==="dataview"&&this.rawData.length===1&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?lt({},this._fields,t):t;const i=this.transformsArr.find(n=>n.type==="fields");!P(this._fields)&&P(i)?(this.dataSet.registerTransform("fields",nR),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}class ua{static getInstance(){return ua.instance||(ua.instance=new ua),ua.instance}constructor(){this.locale_shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.locale_periods=["AM","PM"],this.locale_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.locale_shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.numberRe=/^\s*\d+/,this.pads={"-":"",_:" ",0:"0"},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.formatShortWeekday=t=>this.locale_shortWeekdays[t.getDay()],this.formatWeekday=t=>this.locale_weekdays[t.getDay()],this.formatShortMonth=t=>this.locale_shortMonths[t.getMonth()],this.formatMonth=t=>this.locale_months[t.getMonth()],this.formatDayOfMonth=(t,e)=>this.pad(t.getDate(),e,2),this.formatHour24=(t,e)=>this.pad(t.getHours(),e,2),this.formatHour12=(t,e)=>this.pad(t.getHours()%12||12,e,2),this.formatMilliseconds=(t,e)=>this.pad(t.getMilliseconds(),e,3),this.formatMonthNumber=(t,e)=>this.pad(t.getMonth()+1,e,2),this.formatMinutes=(t,e)=>this.pad(t.getMinutes(),e,2),this.formatPeriod=t=>this.locale_periods[+(t.getHours()>=12)],this.formatSeconds=(t,e)=>this.pad(t.getSeconds(),e,2),this.formatFullYear=(t,e)=>this.pad(t.getFullYear()%1e4,e,4),this.formatUTCShortWeekday=t=>this.locale_shortWeekdays[t.getUTCDay()],this.formatUTCWeekday=t=>this.locale_weekdays[t.getUTCDay()],this.formatUTCShortMonth=t=>this.locale_shortMonths[t.getUTCMonth()],this.formatUTCMonth=t=>this.locale_months[t.getUTCMonth()],this.formatUTCDayOfMonth=(t,e)=>this.pad(t.getUTCDate(),e,2),this.formatUTCHour24=(t,e)=>this.pad(t.getUTCHours(),e,2),this.formatUTCHour12=(t,e)=>this.pad(t.getUTCHours()%12||12,e,2),this.formatUTCMilliseconds=(t,e)=>this.pad(t.getUTCMilliseconds(),e,3),this.formatUTCMonthNumber=(t,e)=>this.pad(t.getUTCMonth()+1,e,2),this.formatUTCMinutes=(t,e)=>this.pad(t.getUTCMinutes(),e,2),this.formatUTCPeriod=t=>this.locale_periods[+(t.getUTCHours()>=12)],this.formatUTCSeconds=(t,e)=>this.pad(t.getUTCSeconds(),e,2),this.formatUTCFullYear=(t,e)=>this.pad(t.getUTCFullYear()%1e4,e,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(t,e,i)=>{const n=this.shortWeekdayRe.exec(e.slice(i));return n?(t.w=this.shortWeekdayLookup.get(n[0].toLowerCase()),i+n[0].length):-1},this.parseWeekday=(t,e,i)=>{const n=this.weekdayRe.exec(e.slice(i));return n?(t.w=this.weekdayLookup.get(n[0].toLowerCase()),i+n[0].length):-1},this.parseShortMonth=(t,e,i)=>{const n=this.shortMonthRe.exec(e.slice(i));return n?(t.m=this.shortMonthLookup.get(n[0].toLowerCase()),i+n[0].length):-1},this.parseMonth=(t,e,i)=>{const n=this.monthRe.exec(e.slice(i));return n?(t.m=this.monthLookup.get(n[0].toLowerCase()),i+n[0].length):-1},this.parseDayOfMonth=(t,e,i)=>{const n=this.numberRe.exec(e.slice(i,i+2));return n?(t.d=+n[0],i+n[0].length):-1},this.parseHour24=(t,e,i)=>{const n=this.numberRe.exec(e.slice(i,i+2));return n?(t.H=+n[0],i+n[0].length):-1},this.parseMilliseconds=(t,e,i)=>{const n=this.numberRe.exec(e.slice(i,i+3));return n?(t.L=+n[0],i+n[0].length):-1},this.parseMonthNumber=(t,e,i)=>{const n=this.numberRe.exec(e.slice(i,i+2));return n?(t.m=n-1,i+n[0].length):-1},this.parseMinutes=(t,e,i)=>{const n=this.numberRe.exec(e.slice(i,i+2));return n?(t.M=+n[0],i+n[0].length):-1},this.parsePeriod=(t,e,i)=>{const n=this.periodRe.exec(e.slice(i));return n?(t.p=this.periodLookup.get(n[0].toLowerCase()),i+n[0].length):-1},this.parseSeconds=(t,e,i)=>{const n=this.numberRe.exec(e.slice(i,i+2));return n?(t.S=+n[0],i+n[0].length):-1},this.parseFullYear=(t,e,i)=>{const n=this.numberRe.exec(e.slice(i,i+4));return n?(t.y=+n[0],i+n[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(t,e)=>this.newFormat(t,this.formats)(new Date(this.getFullTimeStamp(e))),this.timeUTCFormat=(t,e)=>this.newFormat(t,this.utcFormats)(new Date(this.getFullTimeStamp(e))),this.timeParse=(t,e)=>this.newParse(t,!1)(e+""),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(t){return t.replace(this.requoteRe,"\\$&")}localDate(t){if(0<=t.y&&t.y<100){const e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}utcDate(t){if(0<=t.y&&t.y<100){const e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}newDate(t,e,i){return{y:t,m:e,d:i,H:0,M:0,S:0,L:0}}formatRe(t){return new RegExp("^(?:"+t.map(this.requoteF).join("|")+")","i")}formatLookup(t){return new Map(t.map((e,i)=>[e.toLowerCase(),i]))}pad(t,e,i){const n=t<0?"-":"",r=(n?-t:t)+"",a=r.length;return n+(a<i?new Array(i-a+1).join(e)+r:r)}parseSpecifier(t,e,i,n){let r=0;const a=e.length,o=i.length;let l,h;for(;r<a;){if(n>=o)return-1;if(l=e.charCodeAt(r++),l===37){if(l=e.charAt(r++),h=this.parses[l in this.pads?e.charAt(r++):l],!h||(n=h(t,i,n))<0)return-1}else if(l!==i.charCodeAt(n++))return-1}return n}newParse(t,e){const i=this;return function(n){const r=i.newDate(1900,void 0,1);return i.parseSpecifier(r,t,n+="",0)!==n.length?null:"Q"in r?new Date(r.Q):"s"in r?new Date(1e3*r.s+("L"in r?r.L:0)):(e&&!("Z"in r)&&(r.Z=0),"p"in r&&(r.H=r.H%12+12*r.p),r.m===void 0&&(r.m="q"in r?r.q:0),"Z"in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,i.utcDate(r)):i.localDate(r))}}newFormat(t,e){const i=this;return function(n){const r=[];let a=-1,o=0;const l=t.length;let h,d,u;for(n instanceof Date||(n=new Date(+n));++a<l;)t.charCodeAt(a)===37&&(r.push(t.slice(o,a)),(d=i.pads[h=t.charAt(++a)])?h=t.charAt(++a):d=h==="e"?" ":"0",u=e[h],h=u(n,d),r.push(h),o=a+1);return r.push(t.slice(o,a)),r.join("")}}getFullTimeStamp(t){const e=parseInt(t+"",10);return String(e).length===10?1e3*e:e}}const Na=(s,t)=>(K(jg.warnHandler)&&jg.warnHandler.call(null,s,t),Nt.getInstance().warn(`[VChart warn]: ${s}`)),kh=(s,t,e)=>{{if(!K(jg.errorHandler))throw new Error(s);jg.errorHandler.call(null,s,t)}},jg={warnHandler:!1,errorHandler:!1};class ii{static GenAutoIncrementId(){return ii.auto_increment_id++}}ii.auto_increment_id=0;class Et{constructor(t){this.id=ii.GenAutoIncrementId(),this.registry=t}}const am="named",fR="inject",_R="multi_inject",mR="inversify:tagged",vR="inversify:paramtypes";class $x{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===am?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var q1={};const rh=function(s){var t;return function(e){const i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",r=n&&Symbol.toPrimitive!==void 0?Symbol.toPrimitive:"@@toPrimitive",a=n&&Symbol.iterator!==void 0?Symbol.iterator:"@@iterator",o=typeof Object.create=="function",l={__proto__:[]}instanceof Array,h=!o&&!l,d={create:o?function(){return nt(Object.create(null))}:l?function(){return nt({__proto__:null})}:function(){return nt({})},has:h?function(q,U){return i.call(q,U)}:function(q,U){return U in q},get:h?function(q,U){return i.call(q,U)?q[U]:void 0}:function(q,U){return q[U]}},u=Object.getPrototypeOf(Function),c=typeof process=="object"&&q1&&q1.REFLECT_METADATA_USE_MAP_POLYFILL==="true",p=c||typeof Map!="function"||typeof Map.prototype.entries!="function"?X():Map,g=((c||typeof Set!="function"||typeof Set.prototype.entries!="function")&&Q(),new(c||typeof WeakMap!="function"?J():WeakMap));function f(q,U,it,ut){if(!R(it))throw new TypeError;return k(q,U,it,ut)}function _(q,U,it){if(!R(U))throw new TypeError;return T(it)||(it=j(it)),b(q,U,it)}function m(q,U,it){if(!R(U))throw new TypeError;return T(it)||(it=j(it)),x(q,U,it)}function v(q,U,it){if(!R(U))throw new TypeError;return T(it)||(it=j(it)),S(q,U,it)}function y(q,U,it){let ut=g.get(q);if(T(ut)){if(!it)return;ut=new p,g.set(q,ut)}let ct=ut.get(U);if(T(ct)){if(!it)return;ct=new p,ut.set(U,ct)}return ct}function b(q,U,it){if(x(q,U,it))return!0;const ut=V(U);return!M(ut)&&b(q,ut,it)}function x(q,U,it){const ut=y(U,it,!1);return!T(ut)&&L(ut.has(q))}function S(q,U,it){if(x(q,U,it))return A(q,U,it);const ut=V(U);return M(ut)?void 0:S(q,ut,it)}function A(q,U,it){const ut=y(U,it,!1);if(!T(ut))return ut.get(q)}function k(q,U,it,ut){y(it,ut,!0).set(q,U)}function w(q){if(q===null)return 1;switch(typeof q){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return q===null?1:6;default:return 6}}function T(q){return q===void 0}function M(q){return q===null}function C(q){return typeof q=="symbol"}function R(q){return typeof q=="object"?q!==null:typeof q=="function"}function I(q,U){switch(w(q)){case 0:case 1:case 2:case 3:case 4:case 5:return q}const it="string",ut=W(q,r);if(ut!==void 0){const ct=ut.call(q,it);if(R(ct))throw new TypeError;return ct}return O(q)}function O(q,U){{const it=q.toString;if(H(it)){const ct=it.call(q);if(!R(ct))return ct}const ut=q.valueOf;if(H(ut)){const ct=ut.call(q);if(!R(ct))return ct}}throw new TypeError}function L(q){return!!q}function D(q){return""+q}function j(q){const U=I(q);return C(U)?U:D(U)}function H(q){return typeof q=="function"}function W(q,U){const it=q[U];if(it!=null){if(!H(it))throw new TypeError;return it}}function V(q){const U=Object.getPrototypeOf(q);if(typeof q!="function"||q===u||U!==u)return U;const it=q.prototype,ut=it&&Object.getPrototypeOf(it);if(ut==null||ut===Object.prototype)return U;const ct=ut.constructor;return typeof ct!="function"||ct===q?U:ct}function X(){const q={},U=[],it=function(){function mt(Tt,kt,Lt){this._index=0,this._keys=Tt,this._values=kt,this._selector=Lt}return mt.prototype["@@iterator"]=function(){return this},mt.prototype[a]=function(){return this},mt.prototype.next=function(){const Tt=this._index;if(Tt>=0&&Tt<this._keys.length){const kt=this._selector(this._keys[Tt],this._values[Tt]);return Tt+1>=this._keys.length?(this._index=-1,this._keys=U,this._values=U):this._index++,{value:kt,done:!1}}return{value:void 0,done:!0}},mt.prototype.throw=function(Tt){throw this._index>=0&&(this._index=-1,this._keys=U,this._values=U),Tt},mt.prototype.return=function(Tt){return this._index>=0&&(this._index=-1,this._keys=U,this._values=U),{value:Tt,done:!0}},mt}();return function(){function mt(){this._keys=[],this._values=[],this._cacheKey=q,this._cacheIndex=-2}return Object.defineProperty(mt.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),mt.prototype.has=function(Tt){return this._find(Tt,!1)>=0},mt.prototype.get=function(Tt){const kt=this._find(Tt,!1);return kt>=0?this._values[kt]:void 0},mt.prototype.set=function(Tt,kt){const Lt=this._find(Tt,!0);return this._values[Lt]=kt,this},mt.prototype.delete=function(Tt){const kt=this._find(Tt,!1);if(kt>=0){const Lt=this._keys.length;for(let Ot=kt+1;Ot<Lt;Ot++)this._keys[Ot-1]=this._keys[Ot],this._values[Ot-1]=this._values[Ot];return this._keys.length--,this._values.length--,Tt===this._cacheKey&&(this._cacheKey=q,this._cacheIndex=-2),!0}return!1},mt.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=q,this._cacheIndex=-2},mt.prototype.keys=function(){return new it(this._keys,this._values,ut)},mt.prototype.values=function(){return new it(this._keys,this._values,ct)},mt.prototype.entries=function(){return new it(this._keys,this._values,Rt)},mt.prototype["@@iterator"]=function(){return this.entries()},mt.prototype[a]=function(){return this.entries()},mt.prototype._find=function(Tt,kt){return this._cacheKey!==Tt&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=Tt)),this._cacheIndex<0&&kt&&(this._cacheIndex=this._keys.length,this._keys.push(Tt),this._values.push(void 0)),this._cacheIndex},mt}();function ut(mt,Tt){return mt}function ct(mt,Tt){return Tt}function Rt(mt,Tt){return[mt,Tt]}}function Q(){return function(){function q(){this._map=new p}return Object.defineProperty(q.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),q.prototype.has=function(U){return this._map.has(U)},q.prototype.add=function(U){return this._map.set(U,U),this},q.prototype.delete=function(U){return this._map.delete(U)},q.prototype.clear=function(){this._map.clear()},q.prototype.keys=function(){return this._map.keys()},q.prototype.values=function(){return this._map.values()},q.prototype.entries=function(){return this._map.entries()},q.prototype["@@iterator"]=function(){return this.keys()},q.prototype[a]=function(){return this.keys()},q}()}function J(){const U=d.create(),it=ut();return function(){function kt(){this._key=ut()}return kt.prototype.has=function(Lt){const Ot=ct(Lt,!1);return Ot!==void 0&&d.has(Ot,this._key)},kt.prototype.get=function(Lt){const Ot=ct(Lt,!1);return Ot!==void 0?d.get(Ot,this._key):void 0},kt.prototype.set=function(Lt,Ot){return ct(Lt,!0)[this._key]=Ot,this},kt.prototype.delete=function(Lt){const Ot=ct(Lt,!1);return Ot!==void 0&&delete Ot[this._key]},kt.prototype.clear=function(){this._key=ut()},kt}();function ut(){let kt;do kt="@@WeakMap@@"+Tt();while(d.has(U,kt));return U[kt]=!0,kt}function ct(kt,Lt){if(!i.call(kt,it)){if(!Lt)return;Object.defineProperty(kt,it,{value:d.create()})}return kt[it]}function Rt(kt,Lt){for(let Ot=0;Ot<Lt;++Ot)kt[Ot]=255*Math.random()|0;return kt}function mt(kt){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(kt)):Rt(new Uint8Array(kt),kt):Rt(new Array(kt),kt)}function Tt(){const kt=mt(16);kt[6]=79&kt[6]|64,kt[8]=191&kt[8]|128;let Lt="";for(let Ot=0;Ot<16;++Ot){const fi=kt[Ot];Ot!==4&&Ot!==6&&Ot!==8||(Lt+="-"),fi<16&&(Lt+="0"),Lt+=fi.toString(16).toLowerCase()}return Lt}}function nt(q){return q.__=void 0,delete q.__,q}e("defineMetadata",f),e("hasMetadata",_),e("hasOwnMetadata",m),e("getMetadata",v)}((t=s,function(e,i){typeof t[e]!="function"&&Object.defineProperty(t,e,{configurable:!0,writable:!0,value:i})})),s}({});function x3(s,t,e,i){const n=[i];let r={};rh.hasOwnMetadata(s,t)&&(r=rh.getMetadata(s,t));let a=r[e];a===void 0&&(a=[]),a.push(...n),r[e]=a,rh.defineMetadata(s,r,t)}function S3(s,t,e,i){x3(mR,s,e.toString(),i)}function yR(s){return(t,e,i)=>{S3(t,e,i,s)}}function bR(s){return t=>(e,i,n)=>yR(new $x(s,t))(e,i,n)}const Bt=bR(fR),xR=bR(_R);function ft(){return function(s){return rh.defineMetadata(vR,null,s),s}}function wi(s){return yR(new $x(am,s))}const wo={Singleton:"Singleton",Transient:"Transient"},ca={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid"};class Yx{constructor(t,e){this.id=ii.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=ca.Invalid,this.constraint=i=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Yx(this.serviceIdentifier,this.scope);return t.activated=t.scope===wo.Singleton&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class A3{getConstructorMetadata(t){return{compilerGeneratedMetadata:rh.getMetadata(vR,t),userGeneratedMetadata:rh.getMetadata(mR,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const k3=s=>t=>{const e=i=>{if(i==null)return!1;if(i.key===s&&i.value===t)return!0;if(i.constructorArgsMetadata==null)return!1;const n=i.constructorArgsMetadata;for(let r=0;r<n.length;r++)if(n[r].key===s&&n[r].value===t)return!0;return!1};return e.metaData=new $x(s,t),e},w3=k3(am);class Ap{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=wo.Singleton,this}inTransientScope(){return this._binding.scope=wo.Transient,this}whenTargetNamed(t){return this._binding.constraint=w3(t),this}}class T3{constructor(t){this._binding=t}to(t){return this._binding.type=ca.Instance,this._binding.implementationType=t,new Ap(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=ca.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Ap(this._binding)}toConstantValue(t){return this._binding.type=ca.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=wo.Singleton,new Ap(this._binding)}toFactory(t){return this._binding.type=ca.Factory,this._binding.factory=t,this._binding.scope=wo.Singleton,new Ap(this._binding)}toService(t){this.toDynamicValue(e=>e.container.get(t))}}class M3{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||wo.Transient,this.options=e,this.id=ii.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new A3}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,am,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Yx(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new T3(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(a,o)=>{a._binding.moduleId=o},e=a=>o=>{const l=this.bind(o);return t(l,a),l},i=()=>a=>this.unbind(a),n=()=>a=>this.isBound(a),r=a=>o=>{const l=this.rebind(o);return t(l,a),l};return a=>({bindFunction:e(a),isboundFunction:n(),rebindFunction:r(a),unbindFunction:i(),unbindAsyncFunction:o=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter(i=>i.constraint(t)).forEach(i=>{e.push(this._resolveFromBinding(i))}),t.isMultiInject||e.length!==1?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),r=[];for(let a=0;a<n.length;a++){const o=i[a],l={};o.forEach(p=>{l[p.key]=p.value});const h={inject:l[fR],multiInject:l[_R]},d=h.inject||h.multiInject,u={serviceIdentifier:d,constructorArgsMetadata:o},c={injectIdentifier:d,metadata:o,bindings:this._bindingDictionary.get(d).filter(p=>p.constraint(u))};r.push(c)}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case ca.ConstantValue:case ca.Function:e=t.cache;break;case ca.Instance:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map(e=>e.bindings.length>1?e.bindings.map(i=>this._resolveFromBinding(i)):this._resolveFromBinding(e.bindings[0]))}_saveToScope(t,e){t.scope===wo.Singleton&&(t.cache=e,t.activated=!0)}}const oi=Symbol("ContributionProvider");class SR{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function Fi(s,t){s(oi).toDynamicValue(({container:e})=>new SR(t,e)).inSingletonScope().whenTargetNamed(t)}function C3(s,t){s(oi).toDynamicValue(({container:e})=>new SR(t,e)).whenTargetNamed(t)}class P3{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i=typeof t=="string"?t.trim():t.name;i&&(this.taps=this.taps.filter(n=>n.name!==i&&(!e||n.fn===e)))}_parseOptions(t,e,i){let n;if(typeof e=="string")n={name:e.trim()};else if(typeof e!="object"||e===null)throw new Error("Invalid tap options");if(typeof n.name!="string"||n.name==="")throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;typeof t.before=="string"?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;typeof t.stage=="number"&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const r=this.taps[n];this.taps[n+1]=r;const a=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(a>i)){n++;break}}this.taps[n]=t}}class Is extends P3{call(...t){this.taps.map(e=>e.fn).forEach(e=>e(...t))}}const om=Symbol.for("EnvContribution"),Xx=Symbol.for("VGlobal");var E3=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},R3=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},Z1=function(s,t){return function(e,i){t(e,i,s)}};let My=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(s){this._env||this.setEnv("browser"),this.envContribution.supportEvent=s}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(s){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=s}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(s){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=s}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(s){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=s}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(s){this._env||this.setEnv("browser"),this.envContribution.applyStyles=s}constructor(s){this.contributions=s,this.id=ii.GenAutoIncrementId(),this.hooks={onSetEnv:new Is(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(s){const t=[];if(this.contributions.getContributions().forEach(e=>{const i=e.configure(this,s);i&&i.then&&t.push(i)}),t.length)return Promise.all(t)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(s,t){if(t&&t.force===!0||this._env!==s)return this.deactiveCurrentEnv(),this.activeEnv(s,t)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(s,t){const e=this._env;this._env=s;const i=this.bindContribution(t);if(i&&i.then)return i.then(()=>{this.envParams=t,this.hooks.onSetEnv.call(e,s,this)});this.envParams=t,this.hooks.onSetEnv.call(e,s,this)}setActiveEnvContribution(s){this.envContribution=s}createCanvas(s){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(s)}createOffscreenCanvas(s){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(s)}releaseCanvas(s){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(s)}addEventListener(s,t,e){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(s,t,e)}removeEventListener(s,t,e){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(s,t,e)}dispatchEvent(s){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(s)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(s){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(s):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(s,t){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(s,t):null}loadImage(s){return this._env||this.setEnv("browser"),this.envContribution.loadImage(s)}loadSvg(s){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(s)}loadJson(s){return this._env||this.setEnv("browser"),this.envContribution.loadJson(s)}loadArrayBuffer(s){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(s)}loadBlob(s){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(s)}isChrome(){return this._isChrome!=null||(this._env||this.setEnv("browser"),this._isChrome=this._env==="browser"&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return this._isSafari!=null||(this._env||this.setEnv("browser"),this._isSafari=this._env==="browser"&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(s){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(s)}removeDom(s){return this._env||this.setEnv("browser"),this.envContribution.removeDom(s)}createDom(s){return this._env||this.setEnv("browser"),this.envContribution.createDom(s)}getElementTop(s,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(s,t)}getElementLeft(s,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(s,t)}getElementTopLeft(s,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(s,t)}};My=E3([ft(),Z1(0,Bt(oi)),Z1(0,wi(om)),R3("design:paramtypes",[Object])],My);const O3=pi-1e-8;class AR{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,a){if(Math.abs(r-n)>O3)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,l,h,d,u=1/0,c=-1/0,p=1/0,g=-1/0;function f(_){h=i*Math.cos(_),d=i*Math.sin(_),h<u&&(u=h),h>c&&(c=h),d<p&&(p=d),d>g&&(g=d)}if(f(n),f(r),r!==n)if((n%=pi)<0&&(n+=pi),(r%=pi)<0&&(r+=pi),r<n&&(a=!a,o=n,n=r,r=o),a)for(r-=pi,o=n-n%Js,l=0;l<4&&o>r;++l,o-=Js)f(o);else for(o=n-n%Js+Js,l=0;l<4&&o<r;++l,o+=Js)f(o);this.bounds.add(t+u,e+p),this.bounds.add(t+c,e+g)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,a){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,a)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class I3{constructor(){this.curves=[],this.bounds=new Le}getCurveLengths(){return this.curves.map(t=>t.getLength())}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const L3=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,B3={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Ft={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let o0,J1,kp,Q1,l0,wp;function D3(s){if(!s)return[];const t=s.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(t===null)return[];let e,i;const n=[];for(let r=0,a=t.length;r<a;r++)if(o0=t[r],J1=o0.slice(1),kp=o0[0],e=[kp],i=J1.match(L3),i!==null){for(let o=0,l=i.length;o<l;o++)Q1=i[o],l0=parseFloat(Q1),Number.isNaN(l0)||e.push(l0);if(wp=B3[kp],e.length-1>wp){let o;for(let l=1,h=e.length;l<h;l+=wp){o=[kp];for(let d=l,u=l+wp;d<u;d++)o.push(e[d]);n.push(o)}}else n.push(e)}else n.push(e);return n}var fe;(function(s){s[s.NONE=0]="NONE",s[s.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",s[s.UPDATE_SHAPE=2]="UPDATE_SHAPE",s[s.CLEAR_SHAPE=253]="CLEAR_SHAPE",s[s.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",s[s.INIT=179]="INIT",s[s.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",s[s.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",s[s.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",s[s.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",s[s.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",s[s.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",s[s.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",s[s.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"})(fe||(fe={}));var ku;(function(s){s[s.GLOBAL=1]="GLOBAL",s[s.LOCAL=16]="LOCAL",s[s.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",s[s.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"})(ku||(ku={}));var je;(function(s){s[s.INIT=0]="INIT",s[s.DEFAULT=1]="DEFAULT",s[s.STATE=2]="STATE",s[s.ANIMATE_BIND=10]="ANIMATE_BIND",s[s.ANIMATE_PLAY=11]="ANIMATE_PLAY",s[s.ANIMATE_START=12]="ANIMATE_START",s[s.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",s[s.ANIMATE_END=14]="ANIMATE_END",s[s.TRANSLATE=20]="TRANSLATE",s[s.TRANSLATE_TO=21]="TRANSLATE_TO",s[s.SCALE=22]="SCALE",s[s.SCALE_TO=23]="SCALE_TO",s[s.ROTATE=24]="ROTATE",s[s.ROTATE_TO=25]="ROTATE_TO"})(je||(je={}));var Ui;(function(s){s[s.INITIAL=0]="INITIAL",s[s.RUNNING=1]="RUNNING",s[s.PAUSED=2]="PAUSED",s[s.END=3]="END"})(Ui||(Ui={}));var wh;(function(s){s[s.NORMAL=0]="NORMAL",s[s.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"})(wh||(wh={}));var _l;(function(s){s.wait="wait",s.from="from",s.to="to",s.customAnimate="customAnimate"})(_l||(_l={}));var Te;(function(s){s[s.ROW=1]="ROW",s[s.COLUMN=2]="COLUMN"})(Te||(Te={}));var zg;(function(s){s[s.CubicBezierCurve=0]="CubicBezierCurve",s[s.QuadraticBezierCurve=1]="QuadraticBezierCurve",s[s.ArcCurve=2]="ArcCurve",s[s.LineCurve=3]="LineCurve",s[s.EllipseCurve=4]="EllipseCurve",s[s.MoveCurve=5]="MoveCurve"})(zg||(zg={}));var Ti;(function(s){s[s.beforeFillStroke=0]="beforeFillStroke",s[s.afterFillStroke=1]="afterFillStroke"})(Ti||(Ti={}));function F3(s,t,e,i,n,r,a,o,l){const h=ue(a),d=Math.sin(h),u=Math.cos(h),c=u*(o-s)*.5+d*(l-t)*.5,p=u*(l-t)*.5-d*(o-s)*.5;let g=c*c/((e=Math.abs(e))*e)+p*p/((i=Math.abs(i))*i);g>1&&(g=Math.sqrt(g),e*=g,i*=g);const f=u/e,_=d/e,m=-d/i,v=u/i,y=f*o+_*l,b=m*o+v*l,x=f*s+_*t,S=m*s+v*t;let A=1/((x-y)*(x-y)+(S-b)*(S-b))-.25;A<0&&(A=0);let k=Math.sqrt(A);r===n&&(k=-k);const w=.5*(y+x)-k*(S-b),T=.5*(b+S)+k*(x-y),M=Math.atan2(b-T,y-w);let C=Math.atan2(S-T,x-w)-M;C<0&&r===1?C+=pi:C>0&&r===0&&(C-=pi);const R=Math.ceil(Math.abs(C/(Js+.001))),I=[];for(let O=0;O<R;++O){const L=M+O*C/R,D=M+(O+1)*C/R;I[O]=[w,T,L,D,e,i,d,u]}return I}function j3(s){const t=s[0],e=s[1],i=s[2],n=s[3],r=s[4],a=s[5],o=s[6],l=s[7],h=l*r,d=-o*a,u=o*r,c=l*a,p=Math.cos(i),g=Math.sin(i),f=Math.cos(n),_=Math.sin(n),m=.5*(n-i),v=Math.sin(.5*m),y=8/3*v*v/Math.sin(m),b=t+p-y*g,x=e+g+y*p,S=t+f,A=e+_,k=S+y*_,w=A-y*f;return[h*b+d*x,u*b+c*x,h*k+d*w,u*k+c*w,h*S+d*A,u*S+c*A]}function tk(s,t,e,i){const n=F3(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,e);for(let r=0;r<n.length;++r){const a=j3(n[r]);s.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5])}}const dg=(s,t,e,i,n,r,a)=>{const o=Math.abs(e-t),l=4*Math.tan(o/4)/3,h=e<t?-1:1,d=Math.cos(t),u=Math.sin(t),c=Math.cos(e),p=Math.sin(e),g=d*r+i,f=u*a+n,_=c*r+i,m=p*a+n,v=r*l*h,y=a*l*h;s.push(g-v*u,f+y*d,_+v*p,m-y*c,_,m)},z3=[(s,t,e,i,n,r,a)=>t.arc(s[1]*n+e,s[2]*r+i,s[3]*(n+r)/2,s[4],s[5],s[6],a),(s,t,e,i,n,r,a)=>t.arcTo(s[1]*n+e,s[2]*r+i,s[3]*n+e,s[4]*r+i,s[5]*(n+r)/2,a),(s,t,e,i,n,r,a)=>t.bezierCurveTo(s[1]*n+e,s[2]*r+i,s[3]*n+e,s[4]*r+i,s[5]*n+e,s[6]*r+i,a),(s,t,e,i)=>t.closePath(),(s,t,e,i,n,r)=>t.ellipse(s[1]*n+e,s[2]*r+i,s[3]*n,s[4]*r,s[5],s[6],s[7],s[8]),(s,t,e,i,n,r,a)=>t.lineTo(s[1]*n+e,s[2]*r+i,a),(s,t,e,i,n,r,a)=>t.moveTo(s[1]*n+e,s[2]*r+i,a),(s,t,e,i,n,r,a)=>t.quadraticCurveTo(s[1]*n+e,s[2]*r+i,s[3]*n+e,s[4]*r+i,a),(s,t,e,i,n,r,a)=>t.rect(s[1]*n+e,s[2]*r+i,s[3]*n,s[4]*r,a)];function Cr(s,t,e=0,i=0,n=1,r=1,a){for(let o=0;o<s.length;o++){const l=s[o];z3[l[0]](l,t,e,i,n,r,a)}}class kR{getLength(t){return t!=null?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function H3(s,t){let e=0;const i=s.length;for(let n=0;n<i;n++){const r=s[n],a=t[n],o=s[(n+1)%i],l=t[(n+1)%i];e+=ze.distanceNN(r,a,o,l)}return e/2}function N3(s,t,e,i,n){return H3([s.x,t.x,e.x,i.x],[s.y,t.y,e.y,i.y])}function ek(s,t,e,i,n){const r=1-n;return r*r*r*s+3*t*n*r*r+3*e*n*n*r+i*n*n*n}function wR(s,t,e,i,n){const r=ek(s.x,t.x,e.x,i.x,n),a=ek(s.y,t.y,e.y,i.y,n);return new We(r,a)}function Cy(s,t){const{p0:e,p1:i,p2:n,p3:r}=s,a=wR(e,i,n,r,t),o=ze.pointAtPP(e,i,t),l=ze.pointAtPP(i,n,t),h=ze.pointAtPP(n,r,t),d=ze.pointAtPP(o,l,t),u=ze.pointAtPP(l,h,t);return[new Py(e,o,d,a),new Py(a,u,h,r)]}class Py extends kR{constructor(t,e,i,n){super(),this.type=zg.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(this.defined!==!1)return wR(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?N3(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Te.ROW?Kt(this.p0.x-this.p3.x):t===Te.COLUMN?Kt(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ps(t-.01,0),i=Ci(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return he(r.y-n.y,r.x-n.x)}}function ik(s,t){const{p0:e,p1:i}=s,n=ze.pointAtPP(e,i,t);return[new Ey(e,n),new Ey(n,i)]}class Ey extends kR{constructor(t,e){super(),this.type=zg.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(this.defined!==!1)return ze.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return this.angle==null&&(this.angle=he(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?ze.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Te.ROW?Kt(this.p0.x-this.p1.x):t===Te.COLUMN?Kt(this.p0.y-this.p1.y):0}}class Kx{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,a,o,l){const h=new Py(new We(this._lastX,this._lastY),new We(t,e),new We(i,n),new We(r,a));h.originP1=this._lastOriginP,h.originP2=l,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=a,this._lastOriginP=l}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,r){const a=new Ey(new We(this._lastX,this._lastY),new We(t,e));return a.originP1=n,a.originP2=r,a.defined=i,a}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Te.COLUMN){if(!this.curves.length)return 0;const n=this.curves[0],r=this.curves[this.curves.length-1],a=(e=r.p3)!==null&&e!==void 0?e:r.p1;return Kt(n.p0.y-a.y)}if(t===Te.ROW){if(!this.curves.length)return 0;const n=this.curves[0],r=this.curves[this.curves.length-1],a=(i=r.p3)!==null&&i!==void 0?i:r.p1;return Kt(n.p0.x-a.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((n,r)=>n+r.getLength(),0)),this.length}}class G3 extends Kx{bezierCurveTo(t,e,i,n,r,a,o,l){return super.bezierCurveTo(e,t,n,i,a,r,o,l)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Xh(s,t,e=1){let i=!1;for(let n=0,r=t.length;n<=r;n++)n>=r===i&&((i=!i)?s.lineStart():s.lineEnd()),i&&s.point(t[n])}function Ac(s,t,e){const i=t??(Kt(e[e.length-1].x-e[0].x)>Kt(e[e.length-1].y-e[0].y)?Te.ROW:Te.COLUMN);return s==="monotoneY"?new G3(s,i):new Kx(s,i)}class TR{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,this._lastDefined!==!1&&t.defined!==!1,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,this._lastDefined!==!1&&t.defined!==!1,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function kc(s,t={}){const{direction:e,startPoint:i}=t;if(s.length<2-+!!i)return null;const n=Ac("linear",e,s);return W3(new TR(n,i),s),n}function W3(s,t){return Xh(s,t,1)}function sk(s,t,e,i,n){s.context.bezierCurveTo((2*s._x0+s._x1)/3,(2*s._y0+s._y1)/3,(s._x0+2*s._x1)/3,(s._y0+2*s._y1)/3,(s._x0+4*s._x1+t)/6,(s._y0+4*s._y1+e)/6,i,s.lastPoint1)}class V3{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){this._point===2&&sk(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1),(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,this._lastDefined1!==!1&&this._lastDefined2!==!1,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:sk(this,e,i,this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function U3(s,t){return Xh(s,t,2)}function MR(s,t={}){const{direction:e,startPoint:i}=t;if(s.length<2-+!!i)return null;if(s.length<3-+!!i)return kc(s,t);const n=Ac("basis",e,s);return U3(new V3(n,i),s),n}function nk(s){return s<0?-1:1}function rk(s,t,e){const i=s._x1-s._x0,n=t-s._x1,r=(s._y1-s._y0)/(i||Number(n<0&&-0)),a=(e-s._y1)/(n||Number(i<0&&-0)),o=(r*n+a*i)/(i+n);return(nk(r)+nk(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function ak(s,t){const e=s._x1-s._x0;return e?(3*(s._y1-s._y0)/e-t)/2:t}function h0(s,t,e,i,n){const r=s._x0,a=s._y0,o=s._x1,l=s._y1,h=(o-r)/3;s.context.bezierCurveTo(r+h,a+h*t,o-h,l-h*e,o,l,i,s.lastPoint1)}class CR{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1);break;case 3:h0(this,this._t0,ak(this,this._t0),this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1)}(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,this._lastDefined1!==!1&&this._lastDefined2!==!1,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,h0(this,ak(this,e=rk(this,i,n)),e,this._lastDefined1!==!1&&this._lastDefined2!==!1);break;default:h0(this,this._t0,e=rk(this,i,n),this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined!==!1,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class $3 extends CR{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Y3(s,t){return Xh(s,t,2)}function PR(s,t={}){const{direction:e,startPoint:i}=t;if(s.length<2-+!!i)return null;if(s.length<3-+!!i)return kc(s,t);const n=Ac("monotoneX",e,s);return Y3(new CR(n,i),s),n}function X3(s,t){return Xh(s,t,2)}function ER(s,t={}){const{direction:e,startPoint:i}=t;if(s.length<2-+!!i)return null;if(s.length<3-+!!i)return kc(s,t);const n=Ac("monotoneY",e,s);return X3(new $3(n,i),s),n}let K3=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&this._point===2&&this.context.lineTo(this._x,this._y,this._lastDefined!==!1,this.lastPoint),(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,this._lastDefined!==!1&&t.defined!==!1,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,this._lastDefined!==!1&&t.defined!==!1,this.lastPoint),this.context.lineTo(e,i,this._lastDefined!==!1&&t.defined!==!1,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,this._lastDefined!==!1&&t.defined!==!1,this.lastPoint),this.context.lineTo(n,i,this._lastDefined!==!1&&t.defined!==!1,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function ah(s,t,e={}){const{direction:i,startPoint:n}=e;if(s.length<2-+!!n)return null;const r=new Kx("step",i??(Kt(s[s.length-1].x-s[0].x)>Kt(s[s.length-1].y-s[0].y)?Te.ROW:Te.COLUMN));return q3(new K3(r,t,n),s),r}function q3(s,t){return Xh(s,t,1)}class Z3 extends TR{lineEnd(){this.context.closePath()}}function RR(s,t={}){const{direction:e,startPoint:i}=t;if(s.length<2-+!!i)return null;const n=Ac("linear",e,s);return J3(new Z3(n,i),s),n}function J3(s,t){return Xh(s,t,1)}function Ry(s,t,e){switch(t){case"linear":default:return kc(s,e);case"basis":return MR(s,e);case"monotoneX":return PR(s,e);case"monotoneY":return ER(s,e);case"step":return ah(s,.5,e);case"stepBefore":return ah(s,0,e);case"stepAfter":return ah(s,1,e);case"linearClosed":return RR(s,e)}}class ai extends I3{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new AR(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Ft.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Ft.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Ft.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,a){return this.commandList.push([Ft.C,t,e,i,n,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,a),this}arcTo(t,e,i,n,r){return this.commandList.push([Ft.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,a,o,l){return this.commandList.push([Ft.E,t,e,i,n,r,a,o,l]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,a,o,l),this}rect(t,e,i,n){return this.commandList.push([Ft.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,a){return this.commandList.push([Ft.A,t,e,i,n,r,a]),this._ctx&&this._ctx.arc(t,e,i,n,r,a),this}closePath(){return this.commandList.push([Ft.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}toString(){if(!this.toStringCbList){const i=[];i[Ft.M]=n=>`M${n[1]} ${n[2]}`,i[Ft.L]=n=>`L${n[1]} ${n[2]}`,i[Ft.Q]=n=>`Q${n[1]} ${n[2]} ${n[3]} ${n[4]}`,i[Ft.C]=n=>`C${n[1]} ${n[2]} ${n[3]} ${n[4]} ${n[5]} ${n[6]}`,i[Ft.A]=n=>{const r=[];dg(r,n[4],n[5],n[1],n[2],n[3],n[3]);let a="";for(let o=0;o<r.length;o+=6)a+=`C${r[o]} ${r[o+1]} ${r[o+2]} ${r[o+3]} ${r[o+4]} ${r[o+5]}`;return a},i[Ft.Z]=n=>"Z",this.toStringCbList=i}const t=this.toStringCbList;let e="";return this.commandList.forEach(i=>{e+=t[i[0]](i)}),e}fromString(t,e,i,n,r){this.clear();const a=D3(t);return this._runCommandStrList(a,e,i,n,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const r=Ry(e,i);n==="x"?this.direction=Te.ROW:n==="y"?this.direction=Te.COLUMN:n==="auto"&&(this.direction=r.direction),this.curves=r.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const a=[];a[Ft.M]=this.moveToTransform,a[Ft.L]=this.lineToTransform,a[Ft.Q]=this.quadraticCurveToTransform,a[Ft.C]=this.bezierCurveToTransform,a[Ft.AT]=this.arcToTransform,a[Ft.E]=this.ellipseTransform,a[Ft.R]=this.rectTransform,a[Ft.A]=this.arcTransform,a[Ft.Z]=this.closePathTransform,this.transformCbList=a}r.forEach(a=>{this.transformCbList[a[0]](a,t,e,i,n)}),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,r=1){let a,o,l,h,d,u=null,c=0,p=0,g=0,f=0;for(let _=0,m=t.length;_<m;++_){switch(a=t[_],n===1&&r===1||(a=Q3(a,n,r)),a[0]){case"l":c+=a[1],p+=a[2],this.lineTo(c+e,p+i);break;case"L":c=a[1],p=a[2],this.lineTo(c+e,p+i);break;case"h":c+=a[1],this.lineTo(c+e,p+i);break;case"H":c=a[1],this.lineTo(c+e,p+i);break;case"v":p+=a[1],this.lineTo(c+e,p+i);break;case"V":p=a[1],this.lineTo(c+e,p+i);break;case"m":c+=a[1],p+=a[2],this.moveTo(c+e,p+i);break;case"M":c=a[1],p=a[2],this.moveTo(c+e,p+i);break;case"c":o=c+a[5],l=p+a[6],g=c+a[3],f=p+a[4],this.bezierCurveTo(c+a[1]+e,p+a[2]+i,g+e,f+i,o+e,l+i),c=o,p=l;break;case"C":c=a[5],p=a[6],g=a[3],f=a[4],this.bezierCurveTo(a[1]+e,a[2]+i,g+e,f+i,c+e,p+i);break;case"s":o=c+a[3],l=p+a[4],g=2*c-g,f=2*p-f,this.bezierCurveTo(g+e,f+i,c+a[1]+e,p+a[2]+i,o+e,l+i),g=c+a[1],f=p+a[2],c=o,p=l;break;case"S":o=a[3],l=a[4],g=2*c-g,f=2*p-f,this.bezierCurveTo(g+e,f+i,a[1]+e,a[2]+i,o+e,l+i),c=o,p=l,g=a[1],f=a[2];break;case"q":o=c+a[3],l=p+a[4],g=c+a[1],f=p+a[2],this.quadraticCurveTo(g+e,f+i,o+e,l+i),c=o,p=l;break;case"Q":o=a[3],l=a[4],this.quadraticCurveTo(a[1]+e,a[2]+i,o+e,l+i),c=o,p=l,g=a[1],f=a[2];break;case"t":o=c+a[1],l=p+a[2],u[0].match(/[QqTt]/)===null?(g=c,f=p):u[0]==="t"?(g=2*c-h,f=2*p-d):u[0]==="q"&&(g=2*c-g,f=2*p-f),h=g,d=f,this.quadraticCurveTo(g+e,f+i,o+e,l+i),c=o,p=l,g=c+a[1],f=p+a[2];break;case"T":o=a[1],l=a[2],g=2*c-g,f=2*p-f,this.quadraticCurveTo(g+e,f+i,o+e,l+i),c=o,p=l;break;case"a":tk(this,c+e,p+i,[a[1],a[2],a[3],a[4],a[5],a[6]+c+e,a[7]+p+i]),c+=a[6],p+=a[7];break;case"A":tk(this,c+e,p+i,[a[1],a[2],a[3],a[4],a[5],a[6]+e,a[7]+i]),c=a[6],p=a[7];break;case"z":case"Z":this.closePath()}u=a}}_runCommandList(t,e=0,i=0,n=1,r=1){if(e!==0||i!==0||n!==1||r!==1)for(let a=0,o=t.length;a<o;++a){const l=t[a].slice();switch(l[0]){case Ft.L:this.lineToTransform(l,e,i,n,r);break;case Ft.M:this.moveToTransform(l,e,i,n,r);break;case Ft.C:this.bezierCurveToTransform(l,e,i,n,r);break;case Ft.Q:this.quadraticCurveToTransform(l,e,i,n,r);break;case Ft.A:this.arcToTransform(l,e,i,n,r);break;case Ft.E:this.ellipseTransform(l,e,i,n,r);break;case Ft.R:this.rectTransform(l,e,i,n,r);break;case Ft.AT:this.arcToTransform(l,e,i,n,r);break;case Ft.Z:this.closePath()}}else this.commandList=t.map(a=>a.slice())}_updateBounds(){this.bounds.clear(),Cr(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Te.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kt(t.p0.y-e.p1.y)}if(this.direction===Te.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Kt(t.p0.x-e.p1.x)}return this.curves.reduce((t,e)=>t+e.getLength(),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let r=0;r<this.curves.length;r++){e=this.curves[r];const a=e.getLength(this.direction);if(i+a>=t)break;i+=a}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const Ws=["l",0,0,0,0,0,0,0];function Q3(s,t,e){const i=Ws[0]=s[0];if(i==="a"||i==="A")Ws[1]=t*s[1],Ws[2]=e*s[2],Ws[3]=s[3],Ws[4]=s[4],Ws[5]=s[5],Ws[6]=t*s[6],Ws[7]=e*s[7];else if(i==="h"||i==="H")Ws[1]=t*s[1];else if(i==="v"||i==="V")Ws[1]=e*s[1];else for(let n=1,r=s.length;n<r;++n)Ws[n]=(n%2==1?t:e)*s[n];return Ws}const tH={alignSelf:"auto"},vi={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Ke},OR={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},d0={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},IR=Object.assign({outerBorder:Object.assign(Object.assign({},d0),{distance:0}),innerBorder:Object.assign(Object.assign({},d0),{distance:0})},d0),Ir={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:`PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,
|
||
Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",disableAutoClipedPoptip:void 0},eH={pickStrokeBuffer:0},iH=Object.assign(Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null},OR),IR),tH),eH),LR={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},sH={_debug_bounds:!1},He=Object.assign(Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden"},sH),iH),vi),nH=Object.assign(Object.assign({},He),{startAngle:0,endAngle:jt,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),rH=Object.assign(Object.assign(Object.assign({},He),LR),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),aH=Object.assign(Object.assign({},He),{radius:1,startAngle:0,endAngle:jt}),oH=Object.assign(Object.assign({},He),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start"}),lH=Object.assign(Object.assign({},He),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),hH=Object.assign(Object.assign(Object.assign({},He),LR),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),dH=Object.assign(Object.assign({},He),{path:new ai,customPath:()=>{Nt.getInstance().warn("空函数")}}),uH=Object.assign(Object.assign({},He),{points:[],cornerRadius:0,closePath:!0}),cH=Object.assign(Object.assign({},He),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),pH=Object.assign(Object.assign({},He),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),gH=Object.assign(Object.assign({},He),{symbolType:"circle",size:10,keepDirIn3d:!0}),BR=Object.assign(Object.assign(Object.assign({},He),Ir),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Wn=Object.assign(Object.assign({},He),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),wu=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},He),{fill:!0,cornerRadius:0}),fH=Object.assign(Object.assign({},wu),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});class _H{}const et=new _H,qx={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},DR={fill:!0,stroke:!1},ok=/\w|\(|\)|-/,mH=/[.?!,;:/,。?!、;:]/,vH=/\S/;function yH(s,t){const e=t&&t.fill||DR.fill;s.globalAlpha=1,s.fillStyle=e;let i=t.fontSize||16;switch(t.script){case"super":case"sub":i*=.8}s.setTextStyle({textAlign:"left",textBaseline:t.textBaseline||"alphabetic",fontStyle:t.fontStyle||"",fontWeight:t.fontWeight||"",fontSize:i,fontFamily:t.fontFamily||"sans-serif"})}function bH(s,t){const e=t&&t.stroke||DR.stroke;if(!e)return void(s.globalAlpha=0);s.globalAlpha=1,s.lineWidth=t&&typeof t.lineHeight=="number"?t.lineHeight:1,s.strokeStyle=e;let i=t.fontSize||16;switch(t.script){case"super":case"sub":i*=.8}s.setTextStyle({textAlign:"left",textBaseline:t.textBaseline||"alphabetic",fontStyle:t.fontStyle||"",fontWeight:t.fontWeight||"",fontSize:i,fontFamily:t.fontFamily||"sans-serif"})}function Oy(s,t,e,i,n){if(!t||t<=0)return 0;const r=et.graphicUtil.textMeasure;let a=i,o=s.slice(0,a),l=Math.floor(r.measureText(o,e).width),h=s.slice(0,a+1),d=Math.floor(r.measureText(h,e).width);for(;l>t||d<=t;){if(l>t?a--:a++,a>s.length){a=s.length;break}if(a<0){a=0;break}o=s.slice(0,a),l=Math.floor(r.measureText(o,e).width),h=s.slice(0,a+1),d=Math.floor(r.measureText(h,e).width)}return n&&(a=ug(s,a)),a}function ug(s,t){let e=t;for(;ok.test(s[e-1])&&ok.test(s[e])||mH.test(s[e]);)if(e--,e<=0)return t;return e}function ml(s,t){const e=et.graphicUtil.textMeasure.measureText(s,t),i={ascent:0,height:0,descent:0,width:0};return typeof e.actualBoundingBoxAscent!="number"||typeof e.actualBoundingBoxDescent!="number"?(i.width=Math.floor(e.width),i.height=t.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(e.width),i.height=Math.floor(e.actualBoundingBoxAscent+e.actualBoundingBoxDescent),i.ascent=Math.floor(e.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var xH=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Iy=class{configure(s,t){this.canvas=s.canvas,this.context=s.context,s.bindTextMeasure(this)}measureTextWidth(s,t){return this.context?(this.context.setTextStyleWithoutAlignBaseline(t),this.context.measureText(s).width):this.estimate(s,t).width}estimate(s,{fontSize:t=BR.fontSize}){let e=0,i=0;for(let n=0;n<s.length;n++)s.charCodeAt(n)<128?e++:i++;return{width:~~(.8*e*t+i*t),height:t}}measureTextPixelHeight(s,t){var e;if(!this.context)return(e=t.fontSize)!==null&&e!==void 0?e:Ir.fontSize;this.context.setTextStyleWithoutAlignBaseline(t);const i=this.context.measureText(s);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}measureTextBoundHieght(s,t){var e;if(!this.context)return(e=t.fontSize)!==null&&e!==void 0?e:Ir.fontSize;this.context.setTextStyleWithoutAlignBaseline(t);const i=this.context.measureText(s);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}measureText(s,t){return this.context?(this.context.setTextStyleWithoutAlignBaseline(t),this.context.measureText(s)):this.estimate(s,t)}clipTextVertical(s,t,e,i){if(s.length===0)return{verticalList:s,width:0};const{fontSize:n=12}=t;s.forEach(l=>{l.width=l.direction===0?n:this.measureTextWidth(l.text,t)});const r=[];let a=0,o=0;for(;o<s.length&&a+s[o].width<e;o++)a+=s[o].width,r.push(s[o]);if(s[o]&&s[o].text.length>1){const l=this._clipText(s[o].text,t,e-a,0,s[o].text.length-1,"end",!1);if(i&&l.str!==s[o].text){let h="",d=0;for(let p=0;p<o;p++){const g=s[p];h+=g.text,d+=g.text.length}h+=s[o].text;const u=d+l.str.length;let c=ug(h,u);c-=d,c!==l.str.length-1&&(l.str=l.str.substring(0,c),l.width=this.measureTextWidth(l.str,t))}r.push(Object.assign(Object.assign({},s[o]),{text:l.str,width:l.width})),a+=l.width}return{verticalList:r,width:a}}clipText(s,t,e,i){if(s.length===0)return{str:"",width:0};let n=this.measureTextWidth(s,t);if(n<=e)return{str:s,width:n};if(n=this.measureTextWidth(s[0],t),n>e)return{str:"",width:0};const r=this._clipText(s,t,e,0,s.length-1,"end",!1);if(i&&r.str!==s){const a=ug(s,r.str.length);a!==r.str.length&&(r.str=s.substring(0,a),r.width=this.measureTextWidth(r.str,t))}return r}_clipText(s,t,e,i,n,r,a){let o;if(r==="start")o=this._clipTextStart(s,t,e,i,n),a&&(o.result=a+o.str);else if(r==="middle"){const l=this._clipTextMiddle(s,t,e,"","",0,0,1);o={str:"none",width:l.width,result:l.left+a+l.right}}else o=this._clipTextEnd(s,t,e,i,n),a&&(o.result=o.str+a);return o}_clipTextEnd(s,t,e,i,n){const r=Math.floor((i+n)/2),a=s.substring(0,r+1),o=this.measureTextWidth(a,t);let l;if(o>e){if(a.length<=1)return{str:"",width:0};const h=s.substring(0,r);return l=this.measureTextWidth(h,t),l<=e?{str:h,width:l}:this._clipTextEnd(s,t,e,i,r)}if(o<e){if(r>=s.length-1)return{str:s,width:this.measureTextWidth(s,t)};const h=s.substring(0,r+2);return l=this.measureTextWidth(h,t),l>=e?{str:a,width:o}:this._clipTextEnd(s,t,e,r,n)}return{str:a,width:o}}_clipTextStart(s,t,e,i,n){const r=Math.ceil((i+n)/2),a=s.substring(r-1,s.length-1),o=this.measureTextWidth(a,t);let l;if(o>e){if(a.length<=1)return{str:"",width:0};const h=s.substring(r,s.length-1);return l=this.measureTextWidth(h,t),l<=e?{str:h,width:l}:this._clipTextStart(s,t,e,r,s.length-1)}if(o<e){if(r<=0)return{str:s,width:this.measureTextWidth(s,t)};const h=s.substring(r-2,s.length-1);return l=this.measureTextWidth(h,t),l>=e?{str:a,width:o}:this._clipTextStart(s,t,e,i,r)}return{str:a,width:o}}_clipTextMiddle(s,t,e,i,n,r,a,o){const l=s.substring(0,o),h=this.measureTextWidth(l,t);if(h+a>e)return{left:i,right:n,width:r+a};const d=s.substring(s.length-o,s.length),u=this.measureTextWidth(d,t);return h+u>e?{left:l,right:n,width:h+a}:this._clipTextMiddle(s,t,e,l,d,h,u,o+1)}clipTextWithSuffixVertical(s,t,e,i,n,r){if(i==="")return this.clipTextVertical(s,t,e,n);if(s.length===0)return{verticalList:s,width:0};const a=this.clipTextVertical(s,t,e,n);if(a.verticalList.length===s.length&&a.verticalList[a.verticalList.length-1].width===s[s.length-1].width)return a;const o=this.measureTextWidth(i,t);if(o>e)return a;let l;if(e-=o,r==="start"){const h=this.revertVerticalList(s);l=this.clipTextVertical(h,t,e,n);const d=this.revertVerticalList(l.verticalList);d.unshift({text:i,direction:1,width:o}),l.verticalList=d}else if(r==="middle"){const h=this.clipTextVertical(s,t,e/2,n),d=this.revertVerticalList(s),u=this.clipTextVertical(d,t,e/2,n);h.verticalList.push({text:i,direction:1,width:o}),this.revertVerticalList(u.verticalList).forEach(c=>h.verticalList.push(c)),l={verticalList:h.verticalList,width:h.width+u.width}}else l=this.clipTextVertical(s,t,e,n),l.verticalList.push({text:i,direction:1,width:o});return l.width+=o,l}revertVerticalList(s){return s.reverse().map(t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})})}clipTextWithSuffix(s,t,e,i,n,r){if(i==="")return this.clipText(s,t,e,n);if(s.length===0)return{str:"",width:0};const a=this.measureTextWidth(s,t);if(a<=e)return{str:s,width:a};const o=this.measureTextWidth(i,t);if(o>e)return{str:"",width:0};e-=o;const l=this._clipText(s,t,e,0,s.length-1,r,i);if(n&&l.str!==s){const h=ug(s,l.str.length);h!==l.str.length&&(l.str=s.substring(0,h),l.width=this.measureTextWidth(l.str,t))}return l.str=l.result,l.width+=o,l}};Iy=xH([ft()],Iy);var SH=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};const Ly=Symbol.for("TextMeasureContribution");let By=class extends Iy{};By=SH([ft()],By);const Pt=new M3,FR=Symbol.for("CanvasFactory"),AH=Symbol.for("Context2dFactory");function Hg(s){return Pt.getNamed(FR,et.global.env)(s)}function kH(s){return typeof s=="number"&&Number.isFinite(s)}class wH{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const i=Hg(Object.assign({nativeCanvas:et.global.createCanvas(t)},t));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const i={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},n=Hg(Object.assign({nativeCanvas:et.global.createCanvas(i)},i));return this.allocatedCanvas.push(n),n}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Th=new wH;var TH=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},MH=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};const Ng=Symbol.for("VWindow"),Zx=Symbol.for("WindowHandlerContribution");let Dy=class{get width(){if(this._handler){const s=this._handler.getWH();return this._width=s.width}return this._width}get height(){if(this._handler){const s=this._handler.getWH();return this._height=s.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new Is(["x","y","width","height"])},this._uid=ii.GenAutoIncrementId(),this.global=et.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",()=>{this.active()}),this.active()}active(){const s=this.global;!s.env||this.actived||(Pt.getNamed(Zx,s.env).configure(this,s),this.actived=!0)}get style(){return this._handler.getStyle()}set style(s){this._handler.setStyle(s)}create(s){this._handler.createWindow(s);const t=this._handler.getWH();this._width=t.width,this._height=t.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(s){this._handler=s}setDpr(s){return this._handler.setDpr(s)}resize(s,t){return this._handler.resizeWindow(s,t)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(s){return this._handler.getImageBuffer?this._handler.getImageBuffer(s):null}addEventListener(s,t,e){return this._handler.addEventListener(s,t,e)}removeEventListener(s,t,e){return this._handler.removeEventListener(s,t,e)}dispatchEvent(s){return this._handler.dispatchEvent(s)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(s,t){this._handler.clearViewBox(s,t)}isVisible(s){return this._handler.isVisible(s)}onVisibleChange(s){return this._handler.onVisibleChange(s)}getTopLeft(s){return this._handler.getTopLeft(s)}};Dy=TH([ft(),MH("design:paramtypes",[])],Dy);var jR=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},zR=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},lk=function(s,t){return function(e,i){t(e,i,s)}};let Fy=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(s){this.contributions=s,this.configured=!1,this.global=et.global,this.global.hooks.onSetEnv.tap("graphic-util",(t,e,i)=>{this.configured=!1,this.configure(i,e)})}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(s,t){this.configured||(this.contributions.getContributions().forEach(e=>{e.configure(this,t)}),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const s=Th.shareCanvas();this._canvas=s,this._context=s.getContext("2d")}}bindTextMeasure(s){this._textMeasure=s}measureText(s,t,e="native"){var i;this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=e;const r={width:this._textMeasure.measureTextWidth(s,t),height:(i=t.fontSize)!==null&&i!==void 0?i:Ir.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(s,t,e){return this.configure(this.global,this.global.env),new yi(Object.assign({defaultFontParams:{fontFamily:Ir.fontFamily,fontSize:Ir.fontSize},getCanvasForMeasure:e||(()=>this.canvas),getTextBounds:void 0,specialCharSet:`-/: .,@%'"~`+yi.ALPHABET_CHAR_SET+yi.ALPHABET_CHAR_SET.toUpperCase()},t??{}),s)}drawGraphicToCanvas(s,t,e){if(!t.defaultLayer)return null;const i=Pt.get(Ng),n=s.AABBBounds,r=n.width(),a=n.height();i.create({width:r,height:a,canvas:e,dpr:t.window.dpr,canvasControled:!0,offscreen:!0,title:""});const o=-n.x1,l=-n.y1,h=t.params.optimize.disableCheckGraphicWidthOutRange;t.params.optimize.disableCheckGraphicWidthOutRange=!0,t.defaultLayer.getNativeHandler().drawTo(i,[s],{x:o,y:l,width:r,height:a,stage:t,layer:t.defaultLayer,renderService:t.renderService,background:"transparent",clear:!0,updateBounds:!1}),t.params.optimize.disableCheckGraphicWidthOutRange=h;const d=i.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};Fy=jR([ft(),lk(0,Bt(oi)),lk(0,wi(Ly)),zR("design:paramtypes",[Object])],Fy);var na;(function(s){s[s.transform=0]="transform",s[s.matrix=1]="matrix"})(na||(na={}));const ni=new Ke;let jy=class{constructor(){this.matrix=new Ke}init(s){return this.mode=na.transform,this.originTransform=s,this.matrix.reset(),this}fromMatrix(s,t){return this.mode=na.matrix,this.outSourceMatrix=s,this.outTargetMatrix=t,this}scaleMatrix(s,t,e){const i=this.outSourceMatrix;if(ni.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:n,y:r}=e;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(s,t),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(s,t);return this.outTargetMatrix.multiply(ni.a,ni.b,ni.c,ni.d,ni.e,ni.f),this}rotateMatrix(s,t){const e=this.outSourceMatrix;if(ni.setValue(e.a,e.b,e.c,e.d,e.e,e.f),this.outTargetMatrix.reset(),t){const{x:i,y:n}=t;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(s),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(s);return this.outTargetMatrix.multiply(ni.a,ni.b,ni.c,ni.d,ni.e,ni.f),this}scale(s,t,e){return this.mode===na.matrix?this.scaleMatrix(s,t,e):this}rotate(s,t){return this.mode===na.matrix?this.rotateMatrix(s,t):this}translateMatrix(s,t){const e=this.outSourceMatrix;return ni.setValue(e.a,e.b,e.c,e.d,e.e,e.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(s,t),this.outTargetMatrix.multiply(ni.a,ni.b,ni.c,ni.d,ni.e,ni.f),this}translate(s,t){return this.mode===na.matrix?this.translateMatrix(s,t):this}simplify(s){return this.mode===na.matrix?this.simplifyMatrix(s):this}simplifyMatrix(s){return this}};jy=jR([ft(),zR("design:paramtypes",[])],jy);const Vi={arc:nH,area:rH,circle:aH,line:hH,path:dH,symbol:gH,text:BR,rect:cH,rect3d:pH,polygon:uH,richtext:Wn,richtextIcon:fH,image:wu,group:oH,glyph:lH},u0=Object.keys(Vi);function CH(){return{arc:Object.assign({},Vi.arc),area:Object.assign({},Vi.area),circle:Object.assign({},Vi.circle),line:Object.assign({},Vi.line),path:Object.assign({},Vi.path),symbol:Object.assign({},Vi.symbol),text:Object.assign({},Vi.text),rect:Object.assign({},Vi.rect),rect3d:Object.assign({},Vi.rect3d),polygon:Object.assign({},Vi.polygon),richtext:Object.assign({},Vi.richtext),richtextIcon:Object.assign({},Vi.richtextIcon),image:Object.assign({},Vi.image),group:Object.assign({},Vi.group),glyph:Object.assign({},Vi.glyph)}}function Tp(s,t){Object.keys(t).forEach(e=>{s[e]=t[e]})}const hk=CH();class Tu{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},u0.forEach(t=>{this._defaultTheme[t]=Object.create(hk[t])}),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const r=n.theme;(r.dirty||i)&&r.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,Nt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;u0.forEach(n=>{const r=Object.create(hk[n]);t&&t[n]&&Tp(r,t[n]),i[n]&&Tp(r,i[n]),e[n]&&Tp(r,e[n]),this.combinedTheme[n]=r}),e.common&&u0.forEach(n=>{Tp(this.combinedTheme[n],e.common)}),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach(n=>{i[n]?Object.assign(i[n],t[n]):i[n]=Object.assign({},t[n])}):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren(e=>{e.isContainer&&(e.theme&&(e.theme.dirty=!0),this.dirtyChildren(e))})}}const HR=new Tu;function at(s,t){return s.glyphHost?at(s.glyphHost):t?(s.isContainer,t):PH(s)||HR.getTheme()}function PH(s){let t;if(t=s.isContainer?s:s.parent,t){for(;t&&!t.theme;)t=t.parent;return t?(t.theme||t.createTheme(),t.theme.getTheme(t)):HR.getTheme()}return null}var EH=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};class RH extends jo{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=ii.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let i=this._lastChild,n=0;for(;i;){if(t(i,n++))return;i=i._prev}}else{let i=this._firstChild,n=0;for(;i;){if(t(i,n++))return;i=i._next}}}forEachChildrenAsync(t,e=!1){return EH(this,void 0,void 0,function*(){if(e){let i=this._lastChild,n=0;for(;i;){let r=t(i,n++);if(r.then&&(r=yield r),r)return;i=i._prev}}else{let i=this._firstChild,n=0;for(;i;){let r=t(i,n++);if(r.then&&(r=yield r),r)return;i=i._next}}})}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&Nt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,e===0)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let n=0;n<e;n++){if(!i)return null;n>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const r=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,r)}let i;this._nodeList[e]=t;for(let r=e-1;r>=0&&(i=this._nodeList[r],!i);r--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap||!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex(i=>i===t);e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren((n,r)=>!(n===this||!t(n,r))&&(i=n,!0)),e&&this.forEachChildren(n=>{if(n.isContainer){const r=n.find(t,!0);if(r)return i=r,!0}return!1}),i}findAll(t,e=!1){let i=[];return this.forEachChildren((n,r)=>{n!==this&&t(n,r)&&i.push(n)}),e&&this.forEachChildren(n=>{if(n.isContainer){const r=n.findAll(t,!0);r.length&&(i=i.concat(r))}}),i}getElementById(t){return this.find(e=>e.id===t,!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll(e=>e.name===t,!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll(e=>e.type===t,!0)}getChildByName(t,e=!1){return this.find(i=>i.name===t,e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;t!=null&&t.parent;)t=t.parent;return t||this}hasChildNodes(){return this._firstChild!==null}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(e!==null);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do e._count+=t,e=e.parent;while(e!==null)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=ye(i,!0)&&i||$t(i)&&i.capture,r=$t(i)&&i.once,a=K(e)?void 0:e;return t=n?`${t}capture`:t,e=K(e)?e:e.handleEvent,r?super.once(t,e,a):super.on(t,e,a),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=ye(i,!0)&&i||$t(i)&&i.capture,r=K(e)?void 0:e;t=n?`${t}capture`:t,e=K(e)?e:e.handleEvent;const a=$t(i)&&i.once;return super.off(t,e,r,a),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return $t(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class wc{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=wc.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Gg extends wc{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,a,o,l,h,d,u,c,p,g,f){throw new Error("Method not implemented.")}}class Rs extends Gg{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new Rs(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,(t=this.manager)===null||t===void 0||t.copyPointerData(this,n),(e=this.manager)===null||e===void 0||e.copyMouseData(this,n),(i=this.manager)===null||i===void 0||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}class Ca extends Gg{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new Ca(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,(t=this.manager)===null||t===void 0||t.copyWheelData(this,n),(e=this.manager)===null||e===void 0||e.copyMouseData(this,n),(i=this.manager)===null||i===void 0||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}Ca.DOM_DELTA_PIXEL=0,Ca.DOM_DELTA_LINE=1,Ca.DOM_DELTA_PAGE=2;class Jx extends wc{constructor(t,e){super(),this.type=t,this.detail=e}}const NR="*",po=typeof performance=="object"&&performance.now?performance:Date;function Zr(s){return s==="mouse"||s==="pen"}class OH{constructor(t,e){this.dispatch=new jo,this.cursorTarget=null,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(i,n)=>{if(!(i instanceof Rs))return void Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(i,i.type,n);if(this.dispatchEvent(r,"pointerdown"),r.pointerType==="touch")this.dispatchEvent(r,"touchstart");else if(Zr(r.pointerType)){const a=r.button===2;this.dispatchEvent(r,a?"rightdown":"mousedown")}this.trackingData(i.pointerId).pressTargetsByButton[i.button]=r.composedPath(),this.freeEvent(r)},this.onPointerMove=(i,n)=>{var r,a;if(!(i instanceof Rs))return void Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const o=this.createPointerEvent(i,i.type,n),l=Zr(o.pointerType),h=this.trackingData(i.pointerId),d=this.findMountedTarget(h.overTargets);if(h.overTargets&&d&&d!==this.rootTarget&&d!==o.target){const u=i.type==="mousemove"?"mouseout":"pointerout",c=this.createPointerEvent(i,u,d||void 0);if(this.dispatchEvent(c,"pointerout"),l&&this.dispatchEvent(c,"mouseout"),!o.composedPath().includes(d)){const p=this.createPointerEvent(i,"pointerleave",d||void 0);for(p.eventPhase=p.AT_TARGET;p.target&&!o.composedPath().includes(p.target);)p.currentTarget=p.target,this.notifyTarget(p),l&&this.notifyTarget(p,"mouseleave"),p.target=p.target.parent;this.freeEvent(p)}this.freeEvent(c)}if(d!==o.target){const u=i.type==="mousemove"?"mouseover":"pointerover",c=this.clonePointerEvent(o,u);this.dispatchEvent(c,"pointerover"),l&&this.dispatchEvent(c,"mouseover");let p=d==null?void 0:d.parent;for(;p&&p!==this.rootTarget.parent&&p!==o.target;)p=p.parent;if(!p||p===this.rootTarget.parent){const g=this.clonePointerEvent(o,"pointerenter");for(g.eventPhase=g.AT_TARGET;g.target&&g.target!==d&&g.target!==this.rootTarget.parent;)g.currentTarget=g.target,this.notifyTarget(g),l&&this.notifyTarget(g,"mouseenter"),g.target=g.target.parent;this.freeEvent(g)}this.freeEvent(c)}this.dispatchEvent(o,"pointermove"),o.pointerType==="touch"&&this.dispatchEvent(o,"touchmove"),l&&(this.dispatchEvent(o,"mousemove"),this.cursorTarget=o.target,this.cursor=((a=(r=o.target)===null||r===void 0?void 0:r.attribute)===null||a===void 0?void 0:a.cursor)||this.rootTarget.getCursor()),h.overTargets=o.composedPath(),this.freeEvent(o)},this.onPointerOver=(i,n)=>{var r,a;if(!(i instanceof Rs))return void Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const o=this.trackingData(i.pointerId),l=this.createPointerEvent(i,i.type,n),h=Zr(l.pointerType);this.dispatchEvent(l,"pointerover"),h&&this.dispatchEvent(l,"mouseover"),l.pointerType==="mouse"&&(this.cursorTarget=l.target,this.cursor=((a=(r=l.target)===null||r===void 0?void 0:r.attribute)===null||a===void 0?void 0:a.cursor)||this.rootTarget.getCursor());const d=this.clonePointerEvent(l,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),h&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;o.overTargets=l.composedPath(),this.freeEvent(l),this.freeEvent(d)},this.onPointerOut=(i,n)=>{if(!(i instanceof Rs))return void Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(i.pointerId);if(r.overTargets){const a=Zr(i.pointerType),o=this.findMountedTarget(r.overTargets),l=this.createPointerEvent(i,"pointerout",o||void 0);this.dispatchEvent(l),a&&this.dispatchEvent(l,"mouseout");const h=this.createPointerEvent(i,"pointerleave",o||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==this.rootTarget.parent;)h.currentTarget=h.target,this.notifyTarget(h),a&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;r.overTargets=[],this.freeEvent(l),this.freeEvent(h)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(i,n)=>{var r;if(!(i instanceof Rs))return void Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const a=po.now(),o=this.createPointerEvent(i,i.type,n);if(this.dispatchEvent(o,"pointerup"),o.pointerType==="touch")this.dispatchEvent(o,"touchend");else if(Zr(o.pointerType)){const u=o.button===2;this.dispatchEvent(o,u?"rightup":"mouseup")}const l=this.trackingData(i.pointerId),h=this.findMountedTarget(l.pressTargetsByButton[i.button]);let d=h;if(h&&!o.composedPath().includes(h)){let u=h;for(;u&&!o.composedPath().includes(u);){if(o.currentTarget=u,this.notifyTarget(o,"pointerupoutside"),o.pointerType==="touch")this.notifyTarget(o,"touchendoutside");else if(Zr(o.pointerType)){const c=o.button===2;this.notifyTarget(o,c?"rightupoutside":"mouseupoutside")}u=u.parent}delete l.pressTargetsByButton[i.button],d=u}if(d){const u=this.clonePointerEvent(o,"click");u.target=d,u.path=[],l.clicksByButton[i.button]||(l.clicksByButton[i.button]={clickCount:0,target:u.target,timeStamp:a});const c=l.clicksByButton[i.button];c.target===u.target&&a-c.timeStamp<((r=this._config.clickInterval)!==null&&r!==void 0?r:200)?++c.clickCount:c.clickCount=1,c.target=u.target,c.timeStamp=a,u.detail=c.clickCount,Zr(u.pointerType)?(this.dispatchEvent(u,"click"),c.clickCount===2&&this.dispatchEvent(u,"dblclick")):u.pointerType==="touch"&&(this.dispatchEvent(u,"tap"),c.clickCount===2&&this.dispatchEvent(u,"dbltap")),this.dispatchEvent(u,"pointertap"),this.freeEvent(u)}this.freeEvent(o)},this.onPointerUpOutside=(i,n)=>{if(!(i instanceof Rs))return void Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(i.pointerId),a=this.findMountedTarget(r.pressTargetsByButton[i.button]),o=this.createPointerEvent(i,i.type,n);if(a){let l=a;for(;l;)o.currentTarget=l,this.notifyTarget(o,"pointerupoutside"),o.pointerType==="touch"?this.notifyTarget(o,"touchendoutside"):Zr(o.pointerType)&&this.notifyTarget(o,o.button===2?"rightupoutside":"mouseupoutside"),l=l.parent;delete r.pressTargetsByButton[i.button]}this.freeEvent(o)},this.onWheel=(i,n)=>{if(!(i instanceof Ca))return void Nt.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const r=this.createWheelEvent(i,n);this.dispatchEvent(r),this.freeEvent(r)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((i,n)=>i.priority-n.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,n,r,a,o,l;if(!this.rootTarget)return;const h=this.mappingTable[t.type];let d;const u=`${t.canvasX}-${t.canvasY}`;if(!((e=this._prePointTargetCache)===null||e===void 0)&&e[u]&&(!((n=(i=this._prePointTargetCache)===null||i===void 0?void 0:i[u])===null||n===void 0)&&n.stage)&&((a=(r=this._prePointTargetCache)===null||r===void 0?void 0:r[u])===null||a===void 0?void 0:a.stage.renderCount)===((o=this._prePointTargetCache)===null||o===void 0?void 0:o.stageRenderCount)?d=this._prePointTargetCache[u]:(d=this.pickTarget(t.canvasX,t.canvasY,t),t.pickParams||(this._prePointTargetCache={[u]:d,stageRenderCount:(l=d==null?void 0:d.stage.renderCount)!==null&&l!==void 0?l:-1})),h)for(let c=0,p=h.length;c<p;c++)h[c].fn(t,d);else Nt.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){e=e??t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const n=this.allocateEvent(Rs);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.global.x,n.global.y,n),typeof e=="string"&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(Ca);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.global.x,i.global.y,i),i}clonePointerEvent(t,e){const i=this.allocateEvent(Rs);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=e??i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Rs&&e instanceof Rs&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Gg&&e instanceof Gg&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach(i=>{e[i].x=t[i].x,e[i].y=t[i].y}))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=po.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=((e=this.eventPool.get(t))===null||e===void 0?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),(e=this.eventPool.get(i))===null||e===void 0||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events[NR];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),n}}const IH={pickable:!0,visible:!0,dispatchEvent(s){var t;if(!(s instanceof wc))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return s.defaultPrevented=!1,s.path=[],s.target=this,(t=s==null?void 0:s.manager)===null||t===void 0||t.dispatchEvent(s),!s.defaultPrevented},emit(s,t){return this.dispatchEvent(new Jx(s,t))}},LH={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class BH{constructor(t){this.resolution=1,this.onPointerDown=u=>{if(this.supportsTouchEvents&&u.pointerType==="touch")return;const c=this.normalizeToPointerData(u);this.autoPreventDefault&&c[0].isNormalized&&(u.cancelable||!("cancelable"in u))&&u.preventDefault();for(let p=0,g=c.length;p<g;p++){const f=c[p],_=this.bootstrapEvent(this.rootPointerEvent,f);this.manager.mapEvent(_)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerMove=u=>{if(this.supportsTouchEvents&&u.pointerType==="touch"||this.isEventOutsideOfTargetElement(u))return;const c=this.normalizeToPointerData(u);for(let p=0,g=c.length;p<g;p++){const f=this.bootstrapEvent(this.rootPointerEvent,c[p]);this.manager.mapEvent(f)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerUp=u=>{if(this.supportsTouchEvents&&u.pointerType==="touch")return;const c=this.isEventOutsideOfTargetElement(u)?"outside":"",p=this.normalizeToPointerData(u);for(let g=0,f=p.length;g<f;g++){const _=this.bootstrapEvent(this.rootPointerEvent,p[g]);_.type+=c,this.manager.mapEvent(_)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerOverOut=u=>{if(this.supportsTouchEvents&&u.pointerType==="touch")return;const c=this.normalizeToPointerData(u);for(let p=0,g=c.length;p<g;p++){const f=this.bootstrapEvent(this.rootPointerEvent,c[p]);this.manager.mapEvent(f)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onWheel=u=>{const c=this.normalizeWheelEvent(u);this.manager.mapEvent(c)};const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:a,autoPreventDefault:o=!1,clickInterval:l,supportsTouchEvents:h=r.supportsTouchEvents,supportsPointerEvents:d=r.supportsPointerEvents}=t;this.manager=new OH(n,{clickInterval:l}),this.globalObj=r,this.supportsPointerEvents=d,this.supportsTouchEvents=h,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=o,this.eventsAdded=!1,this.viewport=a,this.rootPointerEvent=new Rs,this.rootWheelEvent=new Ca,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.setTargetElement(null)}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:n}=this;if(this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];r?typeof r=="string"&&i?n.style.cursor=r:typeof r=="function"?r(t):typeof r=="object"&&i&&Object.assign(n.style,r):i&&ht(t)&&!Zs(this.cursorStyles,t)&&(n.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){const e=this.viewport,{x:i,y:n}=t;return{x:i-e.x,y:n-e.y}}mapToCanvasPoint(t){var e;const i=(e=this.globalObj)===null||e===void 0?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;const{clientX:n,clientY:r}=t,a=this.domElement.getBoundingClientRect();return{x:n-a.left,y:r-a.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const r=t.changedTouches[i];Re(r.button)&&(r.button=0),Re(r.buttons)&&(r.buttons=1),Re(r.isPrimary)&&(r.isPrimary=t.touches.length===1&&t.type==="touchstart"),Re(r.width)&&(r.width=r.radiusX||1),Re(r.height)&&(r.height=r.radiusY||1),Re(r.tiltX)&&(r.tiltX=0),Re(r.tiltY)&&(r.tiltY=0),Re(r.pointerType)&&(r.pointerType="touch"),Re(r.pointerId)&&(r.pointerId=r.identifier||0),Re(r.pressure)&&(r.pressure=r.force||.5),Re(r.twist)&&(r.twist=0),Re(r.tangentialPressure)&&(r.tangentialPressure=0),Re(r.layerX)&&(r.layerX=r.offsetX=r.clientX),Re(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent))e.push(t);else{const i=t;Re(i.isPrimary)&&(i.isPrimary=!0),Re(i.width)&&(i.width=1),Re(i.height)&&(i.height=1),Re(i.tiltX)&&(i.tiltX=0),Re(i.tiltY)&&(i.tiltY=0),Re(i.pointerType)&&(i.pointerType="mouse"),Re(i.pointerId)&&(i.pointerId=1),Re(i.pressure)&&(i.pressure=.5),Re(i.twist)&&(i.twist=0),Re(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.x=i,e.global.y=n,e.offset.x=i,e.offset.y=n;const{x:r,y:a}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=a,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.x=i,t.global.y=n,t.offset.x=i,t.offset.y=n;const{x:r,y:a}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=a,t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=LH[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=po.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}class Wg{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Wg.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class Vg{static Avaliable(){return!0}avaliable(){return Vg.Avaliable()}tick(t,e){this.timerId=setTimeout(()=>{e(this)},t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Kd{static Avaliable(){return!!et.global.getRequestAnimationFrame()}avaliable(){return Kd.Avaliable()}tick(t,e){et.global.getRequestAnimationFrame()(()=>{this.released||e(this)})}release(){this.released=!0}getTime(){return Date.now()}}var $s;(function(s){s[s.INITIAL=0]="INITIAL",s[s.RUNNING=1]="RUNNING",s[s.PAUSE=2]="PAUSE"})($s||($s={}));class DH{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(e,i)=>{const{once:n=!1}=i??{};this.ifCanStop()?this.stop():(this._handlerTick(e),n||e.tick(this.interval,this.handleTick))},this._handlerTick=e=>{const i=this.tickerHandler.getTime();let n=0;this.lastFrameTime>=0&&(n=i-this.lastFrameTime),this.lastFrameTime=i,this.status===$s.RUNNING&&(this.tickCounts++,this.timelines.forEach(r=>{r.tick(n)}))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=$s.INITIAL,et.global.hooks.onSetEnv.tap("default-ticker",()=>{this.initHandler()}),et.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter(e=>e!==t)}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Kd},{mode:"timeout",cons:Vg},{mode:"manual",cons:Wg}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new Kd;break;case"timeout":t=new Vg;break;case"manual":t=new Wg;break;default:Nt.getInstance().warn("非法的计时器模式"),t=new Kd}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,e=>{this.handleTick(e,{once:!0})})}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,e=>{this.handleTick(e,{once:!0})})}pause(){return this.status!==$s.INITIAL&&(this.status=$s.PAUSE,!0)}resume(){return this.status!==$s.INITIAL&&(this.status=$s.RUNNING,!0)}ifCanStop(){return!!(this.autoStop&&(!this.timelines.length||this.timelines.reduce((t,e)=>t+e.animateCount,0)===0))}start(t=!1){return this.status===$s.RUNNING||!this.tickerHandler||!t&&(this.status===$s.PAUSE||!this.timelines.length||this.timelines.reduce((e,i)=>e+i.animateCount,0)===0)?!1:(this.status=$s.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0)}stop(){this.status=$s.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Wt{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return t===0?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return t===0?0:Math.pow(2,10*t-10)}static expoOut(t){return t===1?1:1-Math.pow(2,-10*t)}static expoInOut(t){return t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(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}static bounceIn(t){return 1-Wt.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Wt.bounceIn(2*t):.5*Wt.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(i===0||i===1)return i;const n=e/jt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*jt/e)}}static getElasticOut(t,e){return function(i){if(i===0||i===1)return i;const n=e/jt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*jt/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/jt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*jt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*jt/e)*.5+1}}}Wt.quadIn=Wt.getPowIn(2),Wt.quadOut=Wt.getPowOut(2),Wt.quadInOut=Wt.getPowInOut(2),Wt.cubicIn=Wt.getPowIn(3),Wt.cubicOut=Wt.getPowOut(3),Wt.cubicInOut=Wt.getPowInOut(3),Wt.quartIn=Wt.getPowIn(4),Wt.quartOut=Wt.getPowOut(4),Wt.quartInOut=Wt.getPowInOut(4),Wt.quintIn=Wt.getPowIn(5),Wt.quintOut=Wt.getPowOut(5),Wt.quintInOut=Wt.getPowInOut(5),Wt.backIn=Wt.getBackIn(1.7),Wt.backOut=Wt.getBackOut(1.7),Wt.backInOut=Wt.getBackInOut(1.7),Wt.elasticIn=Wt.getElasticIn(1,.3),Wt.elasticOut=Wt.getElasticOut(1,.3),Wt.elasticInOut=Wt.getElasticInOut(1,.3*1.5);class GR{constructor(){this.id=ii.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Ui.END?this.removeAnimate(e):e.status===Ui.RUNNING||e.status===Ui.INITIAL?(this.animateCount++,e.advance(t)):e.status===Ui.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach(i=>i()),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const WR=new GR;class ms{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},(t=this.step.prev.getLastProps())!==null&&t!==void 0?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(this.updateCount===0){this.onFirstRun();const n=this.step.getLastProps();Object.keys(n).forEach(r=>{this.subAnimate.animate.validAttr(r)&&(i[r]=n[r])})}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class FH extends ms{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}let Ug=class Ld{constructor(t=ii.GenAutoIncrementId(),e=WR){this.id=t,this.timeline=e,this.status=Ui.INITIAL,this.tailAnimate=new dk(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce((t,e)=>t+e.totalDuration,0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach(i=>{e=ps(i.getDuration(),e)}),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Ld.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this.subAnimates.length===1&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=Ld.mode){t&&e&wh.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:je.ANIMATE_PLAY})}runCb(t){const e=new FH(()=>{t(this,e.step.prev)});return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,a){const o=Ld.interpolateMap.get(t)||Ld.interpolateMap.get("");return!!o&&o(t,e,i,n,r,a)}pause(){this.status===Ui.RUNNING&&(this.status=Ui.PAUSED)}resume(){this.status===Ui.PAUSED&&(this.status=Ui.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const r=this.target.stage;r&&r.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const r=this.target.stage;r&&r.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}subAnimate(){const t=new dk(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach(e=>this.preventAttr(e))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach(e=>{e.bind(t)}),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Ui.INITIAL&&(this.status=Ui.RUNNING,this._onStart&&this._onStart.forEach(e=>e())),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===Ui.RUNNING&&(this.status=Ui.END,this._onEnd&&this._onEnd.forEach(e=>e()))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce((o,l)=>o+l.totalDuration,0);t<0&&(t=0);const a=t>=r;if(a&&(t=r),t===n)return a;for(let o=0;o<this.subAnimates.length&&(e=this.subAnimates[o],!(i+e.totalDuration>=t));o++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),a}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Ui.END}stop(t){t||this.target.onStop(),t==="start"?this.target.onStop(this.getStartProps()):t==="end"?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}};Ug.mode=wh.NORMAL,Ug.interpolateMap=new Map;class dk{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new uk(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(e==null||e<0)&&(e=0);const i=t.easing,n=typeof i=="string"?Wt[i]:i,r=this._addStep(e,null,n);return r.type=_l.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}to(t,e,i,n){(e==null||e<0)&&(e=0);const r=typeof i=="string"?Wt[i]:i,a=this._addStep(e,null,r);return a.type=_l.to,this._appendProps(t,a,!!n&&n.tempProps),a.propKeys||(a.propKeys=Object.keys(a.props)),n&&n.noPreventAttrs||this.target.animates.forEach(o=>{o.id!==this.animate.id&&o.preventAttrs(a.propKeys)}),this}from(t,e,i,n){this.to(t,0,i,n);const r={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach(a=>{r[a]=this.getLastPropByName(a,this.stepTail)}),this.to(r,e,i,n),this.stepTail.type=_l.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return(t=this.stepHead)===null||t===void 0?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=_l.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const n=new uk(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach(o=>{e.props[o]===void 0&&(e.props[o]=this.target.getDefaultAttribute(o))});n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach(o=>{r[o]===void 0&&(r[o]=n.props[o])})),e.propKeys=Object.keys(e.props),n=n.prev;const a=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach(o=>{if(a[o]===void 0){const l=this.animate.getStartProps();a[o]=l[o]=this.target.getComputedAttribute(o)}}),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let a,o,l=!1;const h=(e=this._startAt)!==null&&e!==void 0?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0)return l=!0,l;if(a=Math.floor(t/i),o=t-a*i,l=t>=n*i+i,l&&(o=i,a=n,t=o*a+i),t===r)return l;const d=!this.reversed!=!(this.bounce&&a%2);return d&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(l,d),l}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let a=i.next;for(;a&&a.position<=n;)i=a,a=i.next;let o=t?r===0?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach(l=>l(i,o))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let n=e.prev;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let n=e.next;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=n.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&i.props[t]!==void 0)return i.props[t];if(i.customAnimate){const n=i.customAnimate.getEndProps()[t];if(n!==void 0)return n}i=i.prev}return Nt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){t.props==null&&t.customAnimate==null||this.target.onStep(this,this.animate,t,e,i)}}class uk{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const ck={duration:200,easing:"cubicOut"},vl={duration:1e3,easing:"quadInOut"};var pk;(function(s){s[s.Top=1]="Top",s[s.Right=2]="Right",s[s.Bottom=4]="Bottom",s[s.Left=8]="Left",s[s.ALL=15]="ALL"})(pk||(pk={}));const pr=[!1,!1,!1,!1],jH=s=>{var t;let e=!0;if(ye(s,!0)){for(let i=0;i<4;i++)pr[i]=s,e&&(e=!((t=pr[i])!==null&&t!==void 0&&!t));e=s}else if(Array.isArray(s))for(let i=0;i<4;i++)pr[i]=!!s[i],e&&(e=!!pr[i]);else pr[0]=!1,pr[1]=!1,pr[2]=!1,pr[3]=!1;return{isFullStroke:e,stroke:pr}},cd=[0,0,0,0],Ei=s=>s?$(s)?s.length===0?0:s.length===1?s[0]:s.length===2?(cd[0]=s[0],cd[2]=s[0],cd[1]=s[1],cd[3]=s[1],cd):s:s:0,Zo=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Mp=[1,2,3,0,1,2,3,0];function c0(s,t,e,i){for(;s>=jt;)s-=jt;for(;s<0;)s+=jt;for(;s>t;)t+=jt;Zo[0].x=e,Zo[1].y=e,Zo[2].x=-e,Zo[3].y=-e;const n=Math.ceil(s/Js)%4,r=Math.ceil(t/Js)%4;if(i.add(de(s)*e,se(s)*e),i.add(de(t)*e,se(t)*e),n!==r||t-s>le){let a=!1;for(let o=0;o<Mp.length;o++)if(a||n!==Mp[o]){if(a&&r===Mp[o])break;if(a){const l=Zo[Mp[o]];i.add(l.x,l.y)}}else{a=!0;const l=Zo[n];i.add(l.x,l.y)}}}function zy(s,t,e){const{x:i,y:n}=f1(s.x,s.y,t.x,t.y,e),{x:r,y:a}=f1(s.x1,s.y1,t.x1,t.y1,e),o=new We(i,n,r,a);return o.defined=t.defined,o}function Qx(s,t,e){if(!s||!t)return[];Array.isArray(s)||(s=[s]),Array.isArray(t)||(t=[t]);let i=[];if(s.length>t.length){i=t.map(n=>{const r=new We(n.x,n.y,n.x1,n.y1);return r.defined=n.defined,r});for(let n=0;n<t.length;n++)i[n]=zy(s[n],t[n],e)}else{i=t.map(n=>{const r=new We(n.x,n.y,n.x1,n.y1);return r.defined=n.defined,r});for(let n=0;n<s.length;n++)i[n]=zy(s[n],t[n],e)}return i}const zH=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],HH=s=>zH.includes(s);function Cp(s,t){if($(s)){let e;for(let i=0;i<s.length&&e===void 0;i++)e=s[i][t];return e}return s[t]}class lm{constructor(){this.durations=[],this.timeout=lm.TimeOut,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout(()=>{this.appendDuration(Date.now()-this.lastDate),t(0)},this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce((e,i)=>e+i,0)/this.durations.length,1e3/60),1e3/30)}}lm.TimeOut=1e3/60;const gk=new lm,qn=(s,t)=>ht(s)&&s[s.length-1]==="%"?t*(Number.parseFloat(s.substring(0,s.length-1))/100):s;class NH extends ms{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return this.valid===!1?{}:{text:this.to}}onBind(){var t,e,i,n,r,a,o,l;this.fromNumber=dt((t=this.from)===null||t===void 0?void 0:t.text)?(e=this.from)===null||e===void 0?void 0:e.text:Number.parseFloat((i=this.from)===null||i===void 0?void 0:i.text),this.toNumber=dt((n=this.to)===null||n===void 0?void 0:n.text)?(r=this.to)===null||r===void 0?void 0:r.text:Number.parseFloat((a=this.to)===null||a===void 0?void 0:a.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),this.valid!==!1&&(this.decimalLength=(l=(o=this.params)===null||o===void 0?void 0:o.fixed)!==null&&l!==void 0?l:Math.max(bh(this.fromNumber),bh(this.toNumber)))}onEnd(){}onUpdate(t,e,i){this.valid!==!1&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}var fk;(function(s){s[s.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",s[s.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",s[s.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",s[s.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",s[s.STROKE=4]="STROKE"})(fk||(fk={}));class VR extends ms{constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType=(r==null?void 0:r.newPointAnimateType)==="appear"?"appear":"grow"}onBind(){var t,e;const i=(t=this.from)===null||t===void 0?void 0:t.points,n=(e=this.to)===null||e===void 0?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=n?Array.isArray(n)?n:[n]:[];const r=new Map;this.fromPoints.forEach(u=>{u.context&&r.set(u.context,u)});let a,o,l=1/0,h=-1/0;for(let u=0;u<this.toPoints.length;u+=1)if(r.has(this.toPoints[u].context)){l=u,a=r.get(this.toPoints[u].context);break}for(let u=this.toPoints.length-1;u>=0;u-=1)if(r.has(this.toPoints[u].context)){h=u,o=r.get(this.toPoints[u].context);break}let d=this.toPoints[0];this.interpolatePoints=this.toPoints.map((u,c)=>{const p=r.get(u.context);return p?(d=p,[p,u]):this.newPointAnimateType==="appear"?[u,u]:c<l&&a?[a,u]:c>h&&o?[o,u]:[d,u]}),this.points=this.interpolatePoints.map(u=>{const c=u[0],p=u[1],g=new We(c.x,c.y,c.x1,c.y1);return g.defined=p.defined,g.context=p.context,g})}onUpdate(t,e,i){this.points=this.points.map((n,r)=>{const a=zy(this.interpolatePoints[r][0],this.interpolatePoints[r][1],e);return a.context=n.context,a}),i.points=this.points}}class UR extends ms{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=r==null?void 0:r.group,this._clipGraphic=r==null?void 0:r.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:je.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:je.ANIMATE_END})}onUpdate(t,e,i){if(!this._clipGraphic)return;const n={};Object.keys(this.clipFromAttribute).forEach(r=>{n[r]=this.clipFromAttribute[r]+(this.clipToAttribute[r]-this.clipFromAttribute[r])*e}),this._clipGraphic.setAttributes(n,!1,{type:je.ANIMATE_UPDATE,animationState:{ratio:e,end:t}})}}class GH extends UR{constructor(t,e,i,n,r){var a,o,l,h,d,u,c,p,g,f,_,m;const v=(o=(a=r==null?void 0:r.group)===null||a===void 0?void 0:a.attribute)!==null&&o!==void 0?o:{},y=(l=v.width)!==null&&l!==void 0?l:0,b=(h=v.height)!==null&&h!==void 0?h:0,x=(d=r==null?void 0:r.animationType)!==null&&d!==void 0?d:"in",S=(u=r==null?void 0:r.startAngle)!==null&&u!==void 0?u:0,A=(c=r==null?void 0:r.orient)!==null&&c!==void 0?c:"clockwise";let k=0,w=0;A==="anticlockwise"?(w=x==="in"?S+2*Math.PI:S,w=S+2*Math.PI):(k=S,w=x==="out"?S+2*Math.PI:S);const T=et.graphicService.creator.arc({x:(g=(p=r==null?void 0:r.center)===null||p===void 0?void 0:p.x)!==null&&g!==void 0?g:y/2,y:(_=(f=r==null?void 0:r.center)===null||f===void 0?void 0:f.y)!==null&&_!==void 0?_:b/2,outerRadius:(m=r==null?void 0:r.radius)!==null&&m!==void 0?m:(y+b)/2,innerRadius:0,startAngle:k,endAngle:w,fill:!0});let M,C;A==="anticlockwise"?(M={startAngle:S+2*Math.PI},C={startAngle:S}):(M={endAngle:S},C={endAngle:S+2*Math.PI}),super(x==="in"?M:C,x==="in"?C:M,i,n,{group:r==null?void 0:r.group,clipGraphic:T})}}class _k extends UR{constructor(t,e,i,n,r){var a,o,l,h,d,u,c,p,g;const f=(o=(a=r==null?void 0:r.group)===null||a===void 0?void 0:a.attribute)!==null&&o!==void 0?o:{},_=(h=(l=r==null?void 0:r.width)!==null&&l!==void 0?l:f.width)!==null&&h!==void 0?h:0,m=(u=(d=r==null?void 0:r.height)!==null&&d!==void 0?d:f.height)!==null&&u!==void 0?u:0,v=(c=r==null?void 0:r.animationType)!==null&&c!==void 0?c:"in",y=(p=r==null?void 0:r.direction)!==null&&p!==void 0?p:"x",b=(g=r==null?void 0:r.orient)!==null&&g!==void 0?g:"positive",x=et.graphicService.creator.rect({x:0,y:0,width:v==="in"&&y==="x"?0:_,height:v==="in"&&y==="y"?0:m,fill:!0});let S={},A={};y==="y"?b==="negative"?(S={y:m,height:0},A={y:0,height:m}):(S={height:0},A={height:m}):b==="negative"?(S={x:_,width:0},A={x:0,width:_}):(S={width:0},A={width:_}),super(v==="in"?S:A,v==="in"?A:S,i,n,{group:r==null?void 0:r.group,clipGraphic:x})}}class WH extends ms{onStart(){const{center:t,r:e}=typeof this.params=="function"?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),a=Math.acos((n-t.y)/e);let o=Math.acos((i-t.x)/e/Math.sin(a));r-t.z<0&&(o=jt-o),this.theta=o,this.phi=a}onBind(){}onEnd(){}onUpdate(t,e,i){if(this.phi==null||this.theta==null)return;const{center:n,r,cb:a}=typeof this.params=="function"?this.params():this.params,o=2*Math.PI*e,l=this.theta+o,h=this.phi,d=r*Math.sin(h)*Math.cos(l)+n.x,u=r*Math.cos(h)+n.y,c=r*Math.sin(h)*Math.sin(l)+n.z;for(i.x=d,i.y=u,i.z=c,i.alpha=l+le/2;i.alpha>jt;)i.alpha-=jt;i.alpha=jt-i.alpha,i.zIndex=-1e4*i.z,a&&a(i)}}class VH extends ms{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}}class UH extends ms{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach(t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target})}getEndProps(){const t={};return this.customAnimates.forEach(e=>{Object.assign(t,e.getEndProps())}),t}onBind(){this.initAnimates(),this.customAnimates.forEach(t=>{t.onBind()})}onEnd(){this.customAnimates.forEach(t=>{t.onEnd()})}onStart(){this.customAnimates.forEach(t=>{t.onStart()})}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach(n=>{const r=n.easing;e=(typeof r=="string"?Wt[r]:r)(e),n.onUpdate(t,e,i)}),this.updating=!1)}}function mk(s,t,e,i,n,r){const a=(t-s)*n+s,o=(e-t)*n+t,l=(i-e)*n+e,h=(o-a)*n+a,d=(l-o)*n+o,u=(d-h)*n+h;r[0]=s,r[1]=a,r[2]=h,r[3]=u,r[4]=u,r[5]=d,r[6]=l,r[7]=i}function $H(s,t){const e=s.length,i=t.length;if(e===i)return[s,t];const n=[],r=[],a=e<i?s:t,o=Math.min(e,i),l=Math.abs(i-e)/6,h=(o-2)/6,d=Math.ceil(l/h),u=[a[0],a[1]];let c=l;for(let p=2;p<o;p+=6){let g=a[p-2],f=a[p-1],_=a[p],m=a[p+1],v=a[p+2],y=a[p+3];const b=a[p+4],x=a[p+5];if(c<=0){u.push(_,m,v,y,b,x);continue}const S=Math.min(c,d)+1;for(let A=1;A<=S;A++){const k=A/S;mk(g,_,v,b,k,n),mk(f,m,y,x,k,r),g=n[3],f=r[3],u.push(n[1],r[1],n[2],r[2],g,f),_=n[5],m=r[5],v=n[6],y=r[6]}c-=S-1}return a===s?[u,t]:[s,u]}function vk(s,t){const e=s||t,i=e.length,n=e[i-2],r=e[i-1],a=[];for(let o=0;o<t.length;o+=2)a[o]=n,a[o+1]=r;return a}function YH(s){const t=[],e=s.length;for(let i=0;i<e;i+=2)t[i]=s[e-i-2],t[i+1]=s[e-i-1];return t}function yk(s){let t=0,e=0,i=0;const n=s.length;for(let r=0,a=n-2;r<n;a=r,r+=2){const o=s[a],l=s[a+1],h=s[r],d=s[r+1],u=o*d-h*l;t+=u,e+=(o+h)*u,i+=(l+d)*u}return t===0?[s[0]||0,s[1]||0,0]:[e/t/3,i/t/3,t]}function XH(s,t,e,i){const n=(s.length-2)/6;let r=1/0,a=0;const o=s.length,l=o-2;for(let h=0;h<n;h++){const d=6*h;let u=0;for(let c=0;c<o;c+=2){const p=c===0?d:(d+c-2)%l+2,g=s[p]-e[0],f=s[p+1]-e[1],_=t[c]-i[0]-g,m=t[c+1]-i[1]-f;u+=_*_+m*m}u<r&&(r=u,a=h)}return a}function KH(s,t,e,i){const n=[];let r;for(let a=0;a<s.length;a++){let o=s[a];const l=t[a],h=yk(o),d=yk(l);r==null&&(r=h[2]<0!=d[2]<0);const u=[],c=[];let p=0,g=1/0;const f=[],_=o.length;r&&(o=YH(o));const m=6*XH(o,l,h,d),v=_-2;for(let y=0;y<v;y+=2){const b=(m+y)%v+2;u[y+2]=o[b]-h[0],u[y+3]=o[b+1]-h[1]}if(u[0]=o[m]-h[0],u[1]=o[m+1]-h[1],e>0){const y=i/e;for(let b=-i/2;b<=i/2;b+=y){const x=Math.sin(b),S=Math.cos(b);let A=0;for(let k=0;k<o.length;k+=2){const w=u[k],T=u[k+1],M=l[k]-d[0],C=l[k+1]-d[1],R=M*S-C*x,I=M*x+C*S;f[k]=R,f[k+1]=I;const O=R-w,L=I-T;A+=O*O+L*L}if(A<g){g=A,p=b;for(let k=0;k<f.length;k++)c[k]=f[k]}}}n.push({from:u,to:c,fromCp:h,toCp:d,rotation:-p})}return n}function qH(s,t){let e,i;const n=[],r=[];for(let a=0;a<Math.max(s.length,t.length);a++){const o=s[a],l=t[a];let h,d;o?l?([h,d]=$H(o,l),e=h,i=d):(d=vk(i,o),h=o):(h=vk(e,l),d=l),n.push(h),r.push(d)}return[n,r]}const gr=(s,t,e,i,n)=>{gs(t,i)&&gs(e,n)||s.push(t,e,i,n,i,n)};function Hy(s){const t=s.commandList,e=[];let i,n=0,r=0,a=0,o=0;const l=(p,g)=>{i&&i.length>2&&e.push(i),i=[p,g]};let h,d,u,c;for(let p=0,g=t.length;p<g;p++){const f=t[p],_=p===0;switch(_&&(a=n=f[1],o=r=f[2],[Ft.L,Ft.C,Ft.Q].includes(f[0])&&(i=[a,o])),f[0]){case Ft.M:n=a=f[1],r=o=f[2],l(a,o);break;case Ft.L:h=f[1],d=f[2],gr(i,n,r,h,d),n=h,r=d;break;case Ft.C:i.push(f[1],f[2],f[3],f[4],n=f[5],r=f[6]);break;case Ft.Q:h=f[1],d=f[2],u=f[3],c=f[4],i.push(n+2/3*(h-n),r+2/3*(d-r),u+2/3*(h-u),c+2/3*(d-c),u,c),n=u,r=c;break;case Ft.A:{const m=f[1],v=f[2],y=f[3],b=y,x=f[4],S=f[5],A=!!f[6];h=Math.cos(x)*y+m,d=Math.sin(x)*y+v,_?(a=h,o=d,l(a,o)):gr(i,n,r,h,d),n=Math.cos(S)*y+m,r=Math.sin(S)*y+v;const k=(A?-1:1)*Math.PI/2;for(let w=x;A?w>S:w<S;w+=k){const T=A?Math.max(w+k,S):Math.min(w+k,S);dg(i,w,T,m,v,y,b)}break}case Ft.E:{const m=f[1],v=f[2],y=f[3],b=f[4],x=f[5],S=f[6],A=f[7]+S,k=!!f[8],w=!gs(x,0),T=Math.cos(x),M=Math.sin(x);let C=Math.cos(S)*y,R=Math.sin(S)*b;w?(h=C*T-R*M+m,d=C*M+R*T+v):(h=C+m,d=R+v),_?(a=h,o=d,l(a,o)):gr(i,n,r,h,d),C=Math.cos(A)*y,R=Math.sin(A)*b,w?(n=C*T-R*M+m,r=C*M+R*T+v):(n=C+m,r=R+v);const I=(k?-1:1)*Math.PI/2;for(let O=S;k?O>A:O<A;O+=I){const L=k?Math.max(O+I,A):Math.min(O+I,A);if(dg(i,O,L,m,v,y,b),w){const D=i.length;for(let j=D-6;j<=D-1;j+=2)C=i[j],R=i[j+1],i[j]=(C-m)*T-(R-v)*M+m,i[j+1]=(C-m)*M+(R-v)*T+v}}break}case Ft.R:a=n=f[1],o=r=f[2],h=a+f[3],d=o+f[4],l(h,o),gr(i,h,o,h,d),gr(i,h,d,a,d),gr(i,a,d,a,o),gr(i,a,o,h,o);break;case Ft.AT:{const m=f[1],v=f[2],y=f[3],b=f[4],x=f[5],S=ze.distancePP({x:n,y:r},{x:m,y:v}),A=ze.distancePP({x:y,y:b},{x:m,y:v}),k=((n-m)*(y-m)+(r-v)*(b-v))/(S*A),w=x/Math.sin(k/2),T=(n+y-2*m)/2,M=(r+b-2*v)/2,C=ze.distancePP({x:T,y:M},{x:0,y:0}),R=m+w*T/C,I=y+w*M/C,O=Math.sqrt(w*w-x*x);a=m+O*(n-m)/S,o=v+O*(r-v)/S,gr(i,n,r,a,o),n=m+O*(y-m)/A,r=v+O*(b-v)/A;const L=kg({x:R,y:I},{x:a,y:o}),D=kg({x:R,y:I},{x:n,y:r});dg(i,L,D,R,I,x,x);break}case Ft.Z:i&&gr(i,n,r,a,o),n=a,r=o}}return i&&i.length>2&&e.push(i),e}function bk(s,t){for(let e=0;e<s.length;e++){const i=s[e];for(let n=0;n<i.length;n+=2){const r=i[n],a=i[n+1],o={x:r,y:a};t.transformPoint({x:r,y:a},o),i[n]=o.x,i[n+1]=o.y}}}function ZH(s){const t=new ai;for(let e=0;e<s.length;e++){const i=s[e];if(i.length>2){t.moveTo(i[0],i[1]);for(let n=2;n<i.length;n+=6)t.bezierCurveTo(i[n],i[n+1],i[n+2],i[n+3],i[n+4],i[n+5])}}return t}const $R=s=>{if(!s)return{x:0,y:0,width:0,height:0};let t=P(s.width)?s.x1-s.x:s.width,e=P(s.height)?s.y1-s.y:s.height,i=0,n=0;return t<0?(i=t,t=-t):Number.isNaN(t)&&(t=0),e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),{x:i,y:n,width:t,height:e}};function tS(s,t,e){const i=s/t;let n,r;s>=t?(r=Math.ceil(Math.sqrt(e*i)),n=Math.floor(e/r),n===0&&(n=1,r=e)):(n=Math.ceil(Math.sqrt(e/i)),r=Math.floor(e/n),r===0&&(r=1,n=e));const a=[];for(let l=0;l<n;l++)a.push(r);const o=e-n*r;if(o>0)for(let l=0;l<o;l+=r)l+r<o?a.push(r):a.push(o-l);return a}const JH=(s,t)=>{const{width:e,height:i}=$R(s.attribute),n=tS(e,i,t),r=[],a=i/n.length;for(let o=0,l=n.length;o<l;o++){const h=n[o],d=e/h;for(let u=0;u<h;u++)r.push({x:0+u*d,y:0+o*a,width:d,height:a})}return r},QH=(s,t)=>{const e=s.getParsedAngle(),i=e.startAngle,n=e.endAngle,r=s.getComputedAttribute("innerRadius"),a=s.getComputedAttribute("outerRadius"),o=Math.abs(i-n),l=Math.abs(a-r),h=tS(o*(r+a)/2,l,t),d=[],u=l/h.length,c=a>=r?1:-1,p=n>=i?1:-1;for(let g=0,f=h.length;g<f;g++){const _=h[g],m=o/_;for(let v=0;v<_;v++)d.push({innerRadius:a-u*g*c,outerRadius:a-u*(g+1)*c,startAngle:i+m*v*p,endAngle:i+m*(v+1)*p})}return d},tN=(s,t)=>{const e=s.getComputedAttribute("startAngle"),i=s.getComputedAttribute("endAngle"),n=s.getComputedAttribute("radius"),r=Math.abs(e-i),a=tS(r*n,n,t),o=[],l=r/a[0],h=n/a.length,d=i>=e?1:-1;for(let u=0,c=a.length;u<c;u++)for(let p=0,g=a[u];p<g;p++)o.push({innerRadius:h*u,outerRadius:h*(u+1),startAngle:e+l*p*d,endAngle:e+l*(p+1)*d});return o},xk=(s,t)=>{const e=s.filter(o=>o.defined!==!1&&dt(o.x)&&dt(o.y));if(e.length===0)return[];if(e.length===1)return new Array(t).fill(0).map(o=>e[0]);const i=[];if(t<=e.length){const o=e.length/t;let l=0,h=0;for(;l<t;)i.push(e[Math.floor(h)]),h+=o,l++;return i}const n=t-e.length,r=1/(n/(e.length-1)+1);let a=0;for(let o=0,l=s.length;o<l;o++)if(i.push(s[o]),o<l-1){let h=r;const d=s[o].x,u=s[o].y,c=s[o+1].x,p=s[o+1].y;for(;h<1&&a<n;)i.push({x:d+(c-d)*h,y:u+(p-u)*h}),h+=r,a+=1}return i},eN=(s,t)=>{var e,i;const n=s.attribute;let r=n.points;const a=n.segments;r||(r=a.reduce((d,u)=>{var c;return d.concat((c=u.points)!==null&&c!==void 0?c:[])},[]));const o=r.filter(d=>d.defined!==!1&&dt(d.x)&&dt(d.y));if(!o.length)return[];const l=[];o.forEach(d=>{l.push({x:d.x,y:d.y})});for(let d=o.length-1;d>=0;d--){const u=o[d];l.push({x:(e=u.x1)!==null&&e!==void 0?e:u.x,y:(i=u.y1)!==null&&i!==void 0?i:u.y})}const h=[];return Mu(r,t,h),h},iN=(s,t)=>{const e=s.attribute,i=e.points;if(i)return xk(i,t);if(e.segments){const n=e.segments.reduce((r,a)=>{var o;return r.concat((o=a.points)!==null&&o!==void 0?o:[])},[]);return xk(n,t)}return[]};function sN(s,t){return s[0]*t[1]-s[1]*t[0]}const Ny=s=>s.map(t=>({x:t.x,y:t.y})),Sk=(s,t,e)=>{const i=s.length,n=[];for(let u=0;u<i;u++){const c=s[u],p=u===i-1?s[0]:s[u+1],g=bE([t.x,t.y],[e.x,e.y],[c.x,c.y],[p.x,p.y]);g&&typeof g!="boolean"&&n.push({dot:sN([g[0]-t.x,g[1]-t.x],[e.x-t.x,e.y-t.x]),point:{x:g[0],y:g[1]},edgeIndex:u})}if(n.length<2)return[Ny(s),Ny(s)];n.sort((u,c)=>u.dot-c.dot);let r=n[0],a=n[n.length-1];r.edgeIndex>a.edgeIndex&&([r,a]=[a,r]);const o=r.point,l=a.point,h=[{x:o.x,y:o.y}];for(let u=r.edgeIndex+1;u<=a.edgeIndex;u++)h.push({x:s[u].x,y:s[u].y});h.push({x:l.x,y:l.y});const d=[{x:l.x,y:l.y}];for(let u=a.edgeIndex+1,c=r.edgeIndex+i;u<=c;u++){const p=s[u%i];d.push({x:p.x,y:p.y})}return d.push({x:o.x,y:o.y}),[h,d]},nN=s=>{const t=new Pi;s.forEach(r=>{t.add(r.x,r.y)});const e=t.width(),i=t.height();if(e>=i){const r=t.x1+e/2;return Sk(s,{x:r,y:t.y1},{x:r,y:t.y2})}const n=t.y1+i/2;return Sk(s,{x:t.x1,y:n},{x:t.x2,y:n})},Mu=(s,t,e)=>{if(t===1)e.push({points:s});else{const i=Math.floor(t/2),n=nN(s);Mu(n[0],i,e),Mu(n[1],t-i,e)}},rN=(s,t)=>{const e=s.attribute.points;if(!e||!e.length)return[];if(t===1)return[{points:Ny(e)}];const i=[];return Mu(e,t,i),i},aN=(s,t)=>{const e=s.getParsedPathShape(),i=Hy(e);if(!i.length||t<0)return[];const n=i.length;if(i.length>=t){const l=[],h=Math.floor(i.length/t);for(let d=0;d<t;d++){const u=i.slice(d*h,d===t-1?n:(d+1)*h);l.push({path:ZH(u)})}return l}const r=[],a=Math.floor(t/n);let o=t;for(let l=0;l<n;l++){const h=[];for(let d=2,u=i[l].length;d<u;d+=2)h.push({x:i[0][d],y:i[0][d+1]});Mu(h,l===n-1?o:a,r),o-=a}return r};var is;(function(s){s[s.Color255=0]="Color255",s[s.Color1=1]="Color1"})(is||(is={}));class Oe{static Get(t,e=is.Color1,i=[0,0,0,1]){if(e===is.Color1){const a=Oe.store1[t];if(a)return i[0]=a[0],i[1]=a[1],i[2]=a[2],i[3]=a[3],i;const o=Qe.parseColorString(t);if(o){const l=[o.r/255,o.g/255,o.b/255,o.opacity];Oe.store1[t]=l,Oe.store255[t]=[o.r,o.g,o.b,o.opacity],i[0]=l[0],i[1]=l[1],i[2]=l[2],i[3]=l[3]}return i}const n=Oe.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;const r=Qe.parseColorString(t);return r&&(Oe.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],Oe.store255[t]=[r.r,r.g,r.b,r.opacity],i[0]=r.r,i[1]=r.g,i[2]=r.b,i[3]=r.opacity),i}static Set(t,e,i){if(e===is.Color1){if(Oe.store1[t])return;Oe.store1[t]=i,Oe.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Oe.store255[t])return;Oe.store255[t]=i,Oe.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}Oe.store255={},Oe.store1={};function Pp(s,t=!1){return Array.isArray(s)?t?`rgb(${Math.round(s[0])},${Math.round(s[1])},${Math.round(s[2])},${s[3].toFixed(2)})`:`rgb(${Math.round(s[0])},${Math.round(s[1])},${Math.round(s[2])})`:s}function _o(s,t,e,i,n){if(!s||!t)return s&&Pp(s)||t&&Pp(t)||!1;let r,a,o=!1,l=!1;if(Array.isArray(s)?r=s:typeof s=="string"?r=Oe.Get(s,is.Color255):o=!0,Array.isArray(t)?a=t:typeof t=="string"?a=Oe.Get(t,is.Color255):l=!0,o!==l){const h=o?s:t,d=o?t:s,u=Object.assign(Object.assign({},h),{stops:h.stops.map(c=>Object.assign(Object.assign({},c),{color:Pp(d)}))});return o?_o(h,u,e,i,n):_o(u,h,e,i,n)}if(o){if(s.gradient===t.gradient){const h=s,d=t,u=h.stops,c=d.stops;if(u.length!==c.length)return!1;if(h.gradient==="linear")return oN(h,d,e);if(h.gradient==="radial")return lN(h,d,e);if(h.gradient==="conical")return hN(h,d,e)}return!1}return n&&n(r,a),Pp(dN(r,a,e),i)}function oN(s,t,e){const i=s.stops,n=t.stops;return{gradient:"linear",x0:s.x0+(t.x0-s.x0)*e,x1:s.x1+(t.x1-s.x1)*e,y0:s.y0+(t.y0-s.y0)*e,y1:s.y1+(t.y1-s.y1)*e,stops:new Array(i.length).fill(0).map((r,a)=>({color:eS(i[a].color,n[a].color,e),offset:i[a].offset+(n[a].offset-i[a].offset)*e}))}}function lN(s,t,e){const i=s.stops,n=t.stops;return{gradient:"radial",x0:s.x0+(t.x0-s.x0)*e,x1:s.x1+(t.x1-s.x1)*e,y0:s.y0+(t.y0-s.y0)*e,y1:s.y1+(t.y1-s.y1)*e,r0:s.r0+(t.r0-s.r0)*e,r1:s.r1+(t.r1-s.r1)*e,stops:new Array(i.length).fill(0).map((r,a)=>({color:eS(i[a].color,n[a].color,e),offset:i[a].offset+(n[a].offset-i[a].offset)*e}))}}function hN(s,t,e){const i=s.stops,n=t.stops;return{gradient:"conical",startAngle:s.startAngle+(t.startAngle-s.startAngle)*e,endAngle:s.endAngle+(t.endAngle-s.endAngle)*e,x:s.x+(t.x-s.x)*e,y:s.y+(t.y-s.y)*e,stops:new Array(i.length).fill(0).map((r,a)=>({color:eS(i[a].color,n[a].color,e),offset:i[a].offset+(n[a].offset-i[a].offset)*e}))}}function dN(s,t,e){return[s[0]+(t[0]-s[0])*e,s[1]+(t[1]-s[1])*e,s[2]+(t[2]-s[2])*e,s[3]+(t[3]-s[3])*e]}const fr=[0,0,0,0],pd=[0,0,0,0];function eS(s,t,e){return Oe.Get(s,is.Color255,fr),Oe.Get(t,is.Color255,pd),`rgba(${Math.round(fr[0]+(pd[0]-fr[0])*e)},${Math.round(fr[1]+(pd[1]-fr[1])*e)},${Math.round(fr[2]+(pd[2]-fr[2])*e)},${fr[3]+(pd[3]-fr[3])*e})`}const YR=(s,t,e)=>{s.forEach(i=>{if(Number.isFinite(i.to))t[i.key]=i.from+(i.to-i.from)*e;else if(i.key==="fill"||i.key==="stroke"){const n=_o(i.from,i.to,e,!1);n&&(t[i.key]=n)}})},XR=(s,t,e)=>{const i=[],n=[];t.clear();for(let r=0;r<s.length;r++){const a=s[r],o=a.from,l=a.to,h=a.rotation*e,d=a.fromCp,u=a.toCp,c=Math.sin(h),p=Math.cos(h);n[0]=d[0]+(u[0]-d[0])*e,n[1]=d[1]+(u[1]-d[1])*e;for(let _=0;_<o.length;_+=2){const m=o[_],v=o[_+1],y=m*(1-e)+l[_]*e,b=v*(1-e)+l[_+1]*e;i[_]=y*p-b*c+n[0],i[_+1]=y*c+b*p+n[1]}let g=i[0],f=i[1];t.moveTo(g,f);for(let _=2;_<o.length;_+=6){const m=i[_],v=i[_+1],y=i[_+2],b=i[_+3],x=i[_+4],S=i[_+5];g===m&&f===v&&y===x&&b===S?t.lineTo(x,S):t.bezierCurveTo(m,v,y,b,x,S),g=x,f=S}}},KR=(s,t,e)=>{const i=s?Hy(s):[],n=Hy(t);e&&i&&(e.fromTransform&&bk(i,e.fromTransform.clone().getInverse()),bk(i,e.toTransfrom));const[r,a]=qH(i,n);return s?KH(r,a,10,Math.PI):a.map((o,l)=>({from:r[l],to:o,fromCp:[0,0],toCp:[0,0],rotation:0}))},uN=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],qR=(s,t)=>{if(!s||!t)return null;const e=[];let i=!1;return Object.keys(s).forEach(n=>{if(!uN.includes(n))return;const r=t[n];P(r)||P(s[n])||r===s[n]||(n==="fill"||n==="stroke"?e.push({from:typeof s[n]=="string"?Oe.Get(s[n],is.Color255):s[n],to:typeof r=="string"?Oe.Get(r,is.Color255):r,key:n}):e.push({from:s[n],to:r,key:n}),i=!0)}),i?e:null};class ZR extends ms{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r=typeof n.pathProxy=="function"?n.pathProxy(n.attribute):n.pathProxy;XR(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&YR(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const JR=(s,t,e,i)=>{var n,r,a;if(s&&(!s.valid||!s.toCustomPath))return __DEV__&&console.error(s," is not validate"),null;if(!t.valid||!t.toCustomPath)return __DEV__&&console.error(t," is not validate"),null;let o=s==null?void 0:s.globalTransMatrix;i&&o&&(o=i.clone().multiply(o.a,o.b,o.c,o.d,o.e,o.f));const l=KR((n=s==null?void 0:s.toCustomPath)===null||n===void 0?void 0:n.call(s),t.toCustomPath(),{fromTransform:o,toTransfrom:t.globalTransMatrix}),h=qR(s==null?void 0:s.attribute,t.attribute),d=t.animate(e);return e!=null&&e.delay&&d.wait(e.delay),d.play(new ZR({morphingData:l,otherAttrs:h},(r=e==null?void 0:e.duration)!==null&&r!==void 0?r:vl.duration,(a=e==null?void 0:e.easing)!==null&&a!==void 0?a:vl.easing)),d},cN=(s,t,e)=>{var i;const n=t.filter(h=>h&&h.toCustomPath&&h.valid);n.length||__DEV__&&console.error(n," is not validate"),s.valid&&s.toCustomPath||__DEV__&&console.error(s," is not validate");const r=((e==null?void 0:e.splitPath)==="clone"?tO:(i=e==null?void 0:e.splitPath)!==null&&i!==void 0?i:eO)(s,n.length,!1),a=e==null?void 0:e.onEnd;let o=n.length;const l=()=>{o--,o===0&&a&&a()};n.forEach((h,d)=>{var u;const c=r[d],p=((u=e==null?void 0:e.delay)!==null&&u!==void 0?u:0)+(e!=null&&e.individualDelay?e.individualDelay(d,n.length,c,h):0);JR(c,h,Object.assign({},e,{onEnd:l,delay:p}),s.globalTransMatrix)})};class pN extends ms{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren(t=>{t.createPathProxy()}),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren(t=>{t.pathProxy=null})}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren((n,r)=>{var a;XR(this.morphingData[r],typeof n.pathProxy=="function"?n.pathProxy(n.attribute):n.pathProxy,e),!((a=this.otherAttrs)===null||a===void 0)&&a[r]&&this.otherAttrs[r].length&&YR(this.otherAttrs[r],n.attribute,e)}),t&&(this.clearPathProxy(),this.morphingData=null)}}const iS=s=>{const t={};return Object.keys(s).forEach(e=>{HH(e)||(t[e]=s[e])}),t},QR=(s,t,e)=>{const i=iS(s.attribute),n=s.attachShadow();if(t.length)n.setTheme({[t[0].type]:i}),t.forEach(r=>{n.appendChild(r)});else{const r=s.AABBBounds,a=r.width(),o=r.height();n.setTheme({rect:i}),new Array(e).fill(0).forEach(l=>{const h=et.graphicService.creator.rect({x:0,y:0,width:a,height:o});n.appendChild(h),t.push(h)})}},tO=(s,t,e)=>{const i=[],n=e?null:iS(s.attribute),r=s.toCustomPath();for(let a=0;a<t;a++){const o={path:new ai().fromCustomPath2D(r)};i.push(et.graphicService.creator.path(e?o:Object.assign({},n,o)))}return e&&QR(s,i,t),i},eO=(s,t,e)=>{const i=[],n=e?null:iS(s.attribute);if(s.type==="rect")JH(s,t).forEach(r=>{i.push(et.graphicService.creator.rect(e?r:Object.assign({},n,r)))});else if(s.type==="arc")QH(s,t).forEach(r=>{i.push(et.graphicService.creator.arc(e?r:Object.assign({},n,r)))});else if(s.type==="circle")tN(s,t).forEach(r=>{i.push(et.graphicService.creator.arc(e?r:Object.assign({},n,r)))});else if(s.type==="line"){const r=iN(s,t),a={size:10,symbolType:"circle"};r.forEach(o=>{i.push(et.graphicService.creator.symbol(e?Object.assign({},o,a):Object.assign({},n,o,a)))})}else s.type==="polygon"?rN(s,t).forEach(r=>{i.push(et.graphicService.creator.polygon(e?r:Object.assign({},n,r)))}):s.type==="area"?eN(s,t).forEach(r=>{i.push(et.graphicService.creator.polygon(e?r:Object.assign({},n,r)))}):s.type==="path"&&aN(s,t).forEach(r=>{"path"in r?i.push(et.graphicService.creator.path(e?r:Object.assign({},n,r))):i.push(et.graphicService.creator.polygon(e?r:Object.assign({},n,r)))});return e&&QR(s,i,t),i},gN=(s,t,e)=>{var i,n,r;const a=s.filter(u=>u.toCustomPath&&u.valid);a.length||__DEV__&&console.error(s," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const o=((e==null?void 0:e.splitPath)==="clone"?tO:(i=e==null?void 0:e.splitPath)!==null&&i!==void 0?i:eO)(t,a.length,!0),l=t.attribute;t.setAttribute("visible",!1);const h=a.map((u,c)=>KR(u.toCustomPath(),o[c].toCustomPath(),{fromTransform:u.globalTransMatrix,toTransfrom:o[c].globalTransMatrix})),d=a.map((u,c)=>qR(u.attribute,l));if(e!=null&&e.individualDelay){const u=e.onEnd;let c=a.length;const p=()=>{c--,c===0&&(t.setAttributes({visible:!0,ratio:null},!1,{type:je.ANIMATE_END}),t.detachShadow(),u&&u())};o.forEach((g,f)=>{var _,m,v;const y=((_=e.delay)!==null&&_!==void 0?_:0)+e.individualDelay(f,a.length,s[f],g),b=g.animate(Object.assign({},e,{onEnd:p}));b.wait(y),b.play(new ZR({morphingData:h[f],saveOnEnd:!0,otherAttrs:d[f]},(m=e.duration)!==null&&m!==void 0?m:vl.duration,(v=e.easing)!==null&&v!==void 0?v:vl.easing))})}else{const u=e==null?void 0:e.onEnd,c=e?Object.assign({},e):{};c.onEnd=()=>{t.setAttribute("visible",!0,!1,{type:je.ANIMATE_END}),t.detachShadow(),u&&u()};const p=t.animate(c);e!=null&&e.delay&&p.wait(e.delay),p.play(new pN({morphingData:h,otherAttrs:d},(n=e==null?void 0:e.duration)!==null&&n!==void 0?n:vl.duration,(r=e==null?void 0:e.easing)!==null&&r!==void 0?r:vl.easing))}};class $n{static GetImage(t,e){var i;let n=$n.cache.get(t);n?n.loadState==="fail"?et.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):n.loadState==="init"||n.loadState==="loading"?(i=n.waitingMark)===null||i===void 0||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},$n.cache.set(t,n),n.dataPromise=et.global.loadImage(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then(r=>{var a;n.loadState=r!=null&&r.data?"success":"fail",n.data=r==null?void 0:r.data,(a=n.waitingMark)===null||a===void 0||a.map((o,l)=>{r!=null&&r.data?(n.loadState="success",n.data=r.data,o.imageLoadSuccess(t,r.data)):(n.loadState="fail",o.imageLoadFail(t))})})):(n.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var i;let n=$n.cache.get(t);n?n.loadState==="fail"?et.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):n.loadState==="init"||n.loadState==="loading"?(i=n.waitingMark)===null||i===void 0||i.push(e):e&&et.global.getRequestAnimationFrame()(()=>{e.imageLoadSuccess(t,n.data)}):(n={type:"image",loadState:"init"},$n.cache.set(t,n),n.dataPromise=et.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then(r=>{var a;n.loadState=r!=null&&r.data?"success":"fail",n.data=r==null?void 0:r.data,(a=n.waitingMark)===null||a===void 0||a.map((o,l)=>{r!=null&&r.data?(n.loadState="success",n.data=r.data,o.imageLoadSuccess(t,r.data)):(n.loadState="fail",o.imageLoadFail(t))})})):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=$n.cache.get(t);return i?i.loadState==="init"||i.loadState==="fail"?Promise.reject():i.loadState==="loading"?i.dataPromise.then(n=>n.data):Promise.resolve(i.data):(i={type:e,loadState:"init"},$n.cache.set(t,i),e==="arrayBuffer"?i.dataPromise=et.global.loadArrayBuffer(t):e==="blob"?i.dataPromise=et.global.loadBlob(t):e==="json"&&(i.dataPromise=et.global.loadJson(t)),i.dataPromise.then(n=>n.data))}}$n.cache=new Map;const fN=new Ke,Ak=new Le,zs=["lineWidth","scaleX","scaleY","angle","anchor","visible"],kk=["x","y"],wk=["scaleX","scaleY"],Tk=["angle"],gd=new We,Ni={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class ss extends RH{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(ss.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise")}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new Le,this._updateTag=fe.INIT,this.attribute=t,this.valid=this.isValid(),t.background&&this.loadImage((e=t.background.background)!==null&&e!==void 0?e:t.background,!0)}setMode(t){t==="3d"?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,n;const{dx:r=t.dx,dy:a=t.dy}=this.attribute;if(e&&this.parent){const o=this.parent.attribute;gd.x=r+((i=o.scrollX)!==null&&i!==void 0?i:0),gd.y=a+((n=o.scrollY)!==null&&n!==void 0?n:0)}else gd.x=r,gd.y=a;return gd}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;et.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),et.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new Ke),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&fe.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&fe.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&fe.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&fe.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&fe.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite(((t=i.x)!==null&&t!==void 0?t:0)+((e=i.y)!==null&&e!==void 0?e:0))}_validNumber(t){return t==null||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&fe.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=fe.CLEAR_SHAPE}containsPoint(t,e,i,n){if(!n)return!1;if(i===ku.GLOBAL){const r=new We(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),t=r.x,e=r.y}return n.containsPoint(this,{x:t,y:e})}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let r=0;r<n.length;r++){const a=n[r];this.attribute[a]=t[a]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);a?this._setAttributes(a,i,n):P((r=this.normalAttrs)===null||r===void 0?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,t==="background"&&this.loadImage(e,!0)}needUpdateTags(t,e=zs){for(let i=0;i<e.length;i++){const n=e[i];if(t.indexOf(n)!==-1)return!0}return!1}needUpdateTag(t,e=zs){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:je.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=fe.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(t===0&&e===0)return this;const r={type:je.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,kk,r);a&&(t=a.x,e=a.y,delete a.x,delete a.y,this._setAttributes(a));const o=this.attribute,l=o.postMatrix;return l?et.transformUtil.fromMatrix(l,l).translate(t,e):(o.x=((i=o.x)!==null&&i!==void 0?i:vi.x)+t,o.y=((n=o.y)!==null&&n!==void 0?n:vi.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:je.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,kk,n);return r?(this._setAttributes(r,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,i){var n,r;if(t===1&&e===1)return this;const a={type:je.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,wk,a);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const l=this.attribute;if(i){let{postMatrix:h}=this.attribute;h||(h=new Ke,l.postMatrix=h),et.transformUtil.fromMatrix(h,h).scale(t,e,i)}else l.scaleX=((n=l.scaleX)!==null&&n!==void 0?n:vi.scaleX)*t,l.scaleY=((r=l.scaleY)!==null&&r!==void 0?r:vi.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:je.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,wk,n);return r?(this._setAttributes(r,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var i;if(t===0)return this;const n={type:je.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Tk,n);r&&(delete r.angle,this._setAttributes(r,!1,n));const a=this.attribute;if(e){let{postMatrix:o}=this.attribute;o||(o=new Ke,a.postMatrix=o),et.transformUtil.fromMatrix(o,o).rotate(t,e)}else a.angle=((i=a.angle)!==null&&i!==void 0?i:vi.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:je.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Tk,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new Ug(t==null?void 0:t.id).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:a}=t;i!=null&&e.onStart(i),n!=null&&e.onFrame(n),r!=null&&e.onEnd(r),a!=null&&e.onRemove(a),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove(()=>{this.animates.delete(e.id)}),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(et.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise"),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise"),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!P(t)||this.currentStates.includes(t))}getState(t){var e;return(e=this.states)===null||e===void 0?void 0:e[t]}applyStateAttrs(t,e,i,n){var r,a,o,l;if(i){const h=Object.keys(t),d=this.getNoWorkAnimateAttr(),u={};let c;n?h.forEach(g=>{d[g]?(c||(c={}),c[g]=t[g]):u[g]=t[g]===void 0?this.getDefaultAttribute(g):t[g]}):h.forEach(g=>{d[g]?(c||(c={}),c[g]=t[g]):u[g]=t[g]});const p=this.animate();p.stateNames=e,p.to(u,(a=(r=this.stateAnimateConfig)===null||r===void 0?void 0:r.duration)!==null&&a!==void 0?a:ck.duration,(l=(o=this.stateAnimateConfig)===null||o===void 0?void 0:o.easing)!==null&&l!==void 0?l:ck.easing),c&&this.setAttributes(c,!1,{type:je.STATE})}else this.setAttributes(t,!1,{type:je.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach(i=>{i in this.normalAttrs?(e[i]=this.normalAttrs[i],delete this.normalAttrs[i]):e[i]=this.getNormalAttribute(i)}),Object.keys(this.normalAttrs).forEach(i=>{t[i]=this.normalAttrs[i]})):Object.keys(t).forEach(i=>{e[i]=this.getNormalAttribute(i)}),this.normalAttrs=e}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach(i=>{if(i.stateNames){const n=i.getEndProps();Zs(n,t)&&(e=n[t])}}),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter(n=>n!==t);this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||this.currentStates.length===1))return;const r=e&&(!((n=this.currentStates)===null||n===void 0)&&n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!(((i=this.currentStates)===null||i===void 0?void 0:i.length)!==t.length||t.some((r,a)=>this.currentStates[a]!==r)))return;const n={};t.forEach(r=>{var a;const o=this.stateProxy?this.stateProxy(r,t):(a=this.states)===null||a===void 0?void 0:a[r];o&&Object.assign(n,o)}),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=fe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=fe.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=fe.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&fe.UPDATE_SHAPE_AND_BOUNDS)===fe.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=fe.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=fe.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=fe.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=fe.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=fe.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=fe.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=fe.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&fe.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:r,scaleY:a,angle:o}=this.attribute;return Ak.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Ak),this.setAttributes({scaleX:r,scaleY:a,angle:o}),e.b};if(typeof t[0]=="string"){const r=parseFloat(t[0])/100,a=n();i[0]=a.x1+(a.x2-a.x1)*r}else i[0]=t[0];if(typeof t[1]=="string"){const r=parseFloat(t[1])/100,a=n();i[1]=a.y1+(a.y2-a.y1)*r}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=vi.x,y:e=vi.y,scaleX:i=vi.scaleX,scaleY:n=vi.scaleY,angle:r=vi.angle,scaleCenter:a,anchor:o,postMatrix:l}=this.attribute;let h=[0,0];const d={};if(o&&(h=this.getAnchor(o,d)),!a||i===1&&n===1)Mj(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,o&&h);else{const c=this._transMatrix;c.reset(),c.translate(h[0],h[1]),c.rotate(r),c.translate(-h[0],-h[1]),c.translate(t,e),h=this.getAnchor(a,d),et.transformUtil.fromMatrix(c,c).scale(i,n,{x:h[0],y:h[1]})}const u=this.getOffsetXY(vi);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,l){const c=fN.setValue(l.a,l.b,l.c,l.d,l.e,l.f),p=this._transMatrix;c.multiply(p.a,p.b,p.c,p.d,p.e,p.f),p.setValue(c.a,c.b,c.c,c.d,c.e,c.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const i=t.getTimeline();this.animates.forEach(n=>{n.setTimeline(i)})}this._onSetStage&&this._onSetStage(this,t,e),et.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:je.ANIMATE_END})}onStep(t,e,i,n,r){const a={};if(i.customAnimate)i.customAnimate.update(r,n,a);else{const o=i.props,l=i.parsedProps,h=i.propKeys;this.stepInterpolate(t,e,a,i,n,r,o,void 0,l,h)}this.setAttributes(a,!1,{type:je.ANIMATE_UPDATE,animationState:{ratio:n,end:r,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,a,o,l,h,d){d||(d=Object.keys(o),n.propKeys=d),a?n.propKeys.forEach(u=>{e.validAttr(u)&&(i[u]=o[u])}):d.forEach(u=>{var c;if(!e.validAttr(u))return;const p=o[u],g=(c=l&&l[u])!==null&&c!==void 0?c:t.getLastPropByName(u,n);if(p==null||g==null)return void(i[u]=p);let f;f=e.interpolateFunc&&e.interpolateFunc(u,r,g,p,i),f||(f=e.customInterpolate(u,r,g,p,this,i),f||this.defaultInterpolate(p,g,u,i,h,r)||this._interpolate(u,r,g,p,i))}),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,a){if(Number.isFinite(t))return n[i]=e+(t-e)*a,!0;if(i==="fill"){r||(r={});const o=r.fillColorArray,l=_o(e,o??t,a,!1,(h,d)=>{r.fillColorArray=d});return l&&(n[i]=l),!0}if(i==="stroke"){r||(r={});const o=r.strokeColorArray,l=_o(e,o??t,a,!1,(h,d)=>{r.strokeColorArray=d});return l&&(n[i]=l),!0}if(i==="shadowColor"){r||(r={});const o=r.shadowColorArray,l=_o(e,o??t,a,!0,(h,d)=>{r.shadowColorArray=d});return l&&(n[i]=l),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return at(this)[this.type][t]}getComputedAttribute(t){var e;return(e=this.attribute[t])!==null&&e!==void 0?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=t??et.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map(t=>t.toJson())}}createPathProxy(t){return ht(t,!0)?this.pathProxy=new ai().fromString(t):this.pathProxy=new ai,this.pathProxy}loadImage(t,e=!1){if(!t||e&&_N(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),typeof t=="string"?(n.state="loading",t.startsWith("<svg")?($n.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(lE(t)||t.includes("/")||hE(t))&&($n.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e)}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach(e=>{e.stop()})}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren(e=>{e.stopAnimates(t)})}release(){this.releaseStatus="released",et.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Jx(t,e);r.bubbles=!1,r.manager=(n=(i=this.stage)===null||i===void 0?void 0:i.eventSystem)===null||n===void 0?void 0:n.manager,this.dispatchEvent(r)}}}function _N(s){return!(!s.fill&&!s.stroke)}ss.mixin(IH);function mN(s,t){const e=[];let i=t.exec(s);for(;i;){const n=[];n.startIndex=t.lastIndex-i[0].length;const r=i.length;for(let a=0;a<r;a++)n.push(i[a]);e.push(n),i=t.exec(s)}return e}class p0{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Mk(s,t,e,i){const n=s.indexOf(t,e);if(n===-1)throw new Error(i);return n+t.length-1}function vN(s,t,e=">"){let i,n="";for(let r=t;r<s.length;r++){let a=s[r];if(i)a===i&&(i="");else if(a==='"'||a==="'")i=a;else if(a===e[0]){if(!e[1])return{data:n,index:r};if(s[r+1]===e[1])return{data:n,index:r}}else a===" "&&(a=" ");n+=a}}function Ck(s,t,e,i=">"){const n=vN(s,t+1,i);if(!n)return;let r=n.data;const a=n.index,o=r.search(/\s/);let l=r,h=!0;return o!==-1&&(l=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1)),{tagName:l,tagExp:r,closeIndex:a,attrExpPresent:h,rawTagName:l}}const yN=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");class bN{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;typeof n=="string"&&(e.tagname=n),t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const r=mN(t,yN),a=r.length;for(let o=0;o<a;o++){const l=r[o][1],h=r[o][4],d=l;l&&(n[d]=h===void 0||(isNaN(h)?h:Number(h)))}return n}parseXml(t){t=t.replace(/\r\n?/g,`
|
||
`);const e=new p0("!xml");let i=e,n="",r="";for(let a=0;a<t.length;a++)if(t[a]==="<")if(t[a+1]==="/"){const o=Mk(t,">",a,"Closing Tag is not closed."),l=r.lastIndexOf(".");r=r.substring(0,l),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",a=o}else if(t[a+1]==="?")a=Ck(t,a,!1,"?>").closeIndex+1;else if(t.substr(a+1,3)==="!--")a=Mk(t,"-->",a+4,"Comment is not closed.");else{const o=Ck(t,a);let l=o.tagName,h=o.tagExp;const d=o.attrExpPresent,u=o.closeIndex;if(l!==e.tagname&&(r+=r?"."+l:l),h.length>0&&h.lastIndexOf("/")===h.length-1){l[l.length-1]==="/"?(l=l.substr(0,l.length-1),r=r.substr(0,r.length-1),h=l):h=h.substr(0,h.length-1);const c=new p0(l);l!==h&&d&&(c[":@"]=this.buildAttributesMap(h,r,l)),this.addChild(i,c,r),r=r.substr(0,r.lastIndexOf("."))}else{const c=new p0(l);this.tagsNodeStack.push(i),l!==h&&d&&(c[":@"]=this.buildAttributesMap(h,r,l)),this.addChild(i,c,r),i=c}n="",a=u}else n+=t[a];return e.child}}function xN(s,t){return iO(s)}function iO(s,t){const e={};for(let i=0;i<s.length;i++){const n=s[i],r=SN(n);if(r!==void 0&&n[r]){const a=iO(n[r]);kN(a),n[":@"]&&AN(a,n[":@"]),e[r]!==void 0&&e.hasOwnProperty(r)?(Array.isArray(e[r])||(e[r]=[e[r]]),e[r].push(a)):e[r]=a}}return e}function SN(s){const t=Object.keys(s);for(let e=0;e<t.length;e++){const i=t[e];if(i!==":@")return i}}function AN(s,t,e){if(t){const i=Object.keys(t),n=i.length;for(let r=0;r<n;r++){const a=i[r];s[a]=t[a]}}}function kN(s){return Object.keys(s).length===0}class hm{constructor(t){this.options=Object.assign({},hm.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;const e=new bN(this.options).parseXml(t);return xN(e,this.options)}}hm.defaultOptions={};function wN(s){return s.startsWith("<svg")||s.startsWith("<?xml")}var TN=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};function MN(s){return TN(this,void 0,void 0,function*(){const t=[],e=s.getChildren();yield new Promise(i=>{et.global.getRequestAnimationFrame()(()=>{i(null)})}),e.forEach(i=>{i.subLayers.size&&i.subLayers.forEach(n=>{n.drawContribution&&n.drawContribution.hooks&&n.drawContribution.rendering&&t.push(new Promise(r=>{n.drawContribution.hooks.completeDraw.tap("outWait",()=>{n.drawContribution.hooks.completeDraw.taps=n.drawContribution.hooks.completeDraw.taps.filter(a=>a.name!=="outWait"),r(null)})}))})}),yield Promise.all(t)})}function cg(s,t,e,i=0){return s.expand(t+(i/2+(e?CN(e,t):0))),s}function CN(s,t){return s?t:0}let PN=0;function ns(){return PN++}var mo;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(mo||(mo={}));function Pk(s){const t=[];let e=0,i="";for(let n=0;n<s.length;n++)ON(s[n])?e?i+=s[n]:(e=1,i=s[n]):(e&&(t.push({text:i,direction:mo.VERTICAL}),i="",e=0),t.push({text:s[n],direction:mo.HORIZONTAL}));return i&&t.push({text:i,direction:mo.VERTICAL}),t}const EN=["…","(",")","—","【","】","「","」","《","》"],sO=new Map;EN.forEach(s=>sO.set(s,!0));const RN=[""],nO=new Map;function ON(s){if(sO.has(s))return!0;if(nO.has(s))return!1;let t=!1;return s.codePointAt(0)<256&&(t=!0),t}RN.forEach(s=>nO.set(s,!0));const dm=ns(),Tc=ns(),Mc=ns(),um=ns(),cm=ns(),sS=ns(),pm=ns(),Cc=ns(),gm=ns(),fm=ns(),nS=ns(),_m=ns(),rS=ns(),aS=ns(),mm=ns(),vm=ns(),rO=Symbol.for("GraphicService"),aO=Symbol.for("GraphicCreator"),oO={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},IN=Object.keys(oO);var Ek;(function(s){s[s.LESS_GROUP=0]="LESS_GROUP",s[s.MORE_GROUP=1]="MORE_GROUP"})(Ek||(Ek={}));let Kh=class Gy extends ss{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=sS,this._childUpdateTag=fe.UPDATE_BOUNDS}setMode(t){t==="3d"?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Tu),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Tu)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren(t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)})}showAll(){this.setAttribute("visible",!0),this.forEachChildren(t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)})}containsPoint(t,e,i){if(i===ku.GLOBAL){const n=new We(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&fe.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;et.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),et.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=vi.x,y:e=vi.y,dx:i=vi.dx,dy:n=vi.dy,scaleX:r=vi.scaleX,scaleY:a=vi.scaleY,angle:o=vi.angle,postMatrix:l}=this.attribute;if(t!==0||e!==0||i!==0||n!==0||r!==1||a!==1||o!==0||l)return super.doUpdateLocalMatrix();this._transMatrix.reset()}doUpdateAABBBounds(){const t=this.attribute,e=at(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=et.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=Ei(n);return r&&i.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=fe.CLEAR_BOUNDS,this._childUpdateTag&=fe.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=fe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&fe.UPDATE_BOUNDS||(this._childUpdateTag|=fe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),et.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),et.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,et.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren(t=>{et.graphicService.onRemove(t)}),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),et.graphicService.onSetStage(this,t),this.forEachChildren(i=>{i.setStage(t,this.layer)}))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren(t=>{t.isContainer&&t.addUpdateGlobalPositionTag()})}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren(t=>{t.isContainer&&t.addUpdateGlobalPositionTag()})}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&fe.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find(i=>i.name===t,e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=et.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Gy(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Gy.NOWORK_ANIMATE_ATTR}};Kh.NOWORK_ANIMATE_ATTR=Ni;function oS(s){return new Kh(s)}class LN extends Kh{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=n.layerHandler,this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:(r=n.zIndex)!==null&&r!==void 0?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Tu,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort((i,n)=>i.zIndex-n.zIndex);this.layerHandler.merge(e.map(i=>(i.layer.subLayers.size&&i.layer.combineSubLayer(t),i.layer.getNativeHandler()))),t&&e.forEach(i=>{i.group&&(i.group.incremental=0)}),e.forEach(i=>{et.layerService.releaseLayer(this.stage,i.layer)}),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach(i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)})}render(t,e){var i;const n=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:n.x,y:n.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:(i=t.background)!==null&&i!==void 0?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach(r=>r(this)),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var i,n,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:(i=e.background)!==null&&i!==void 0?i:this.background,renderService:e.renderService,x:(n=e.x)!==null&&n!==void 0?n:this.stage.x,y:(r=e.y)!==null&&r!==void 0?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach(a=>a(this)))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach(t=>{et.layerService.releaseLayer(this.stage,t.layer)})}drawTo(t,e){var i,n,r;this.layerHandler.drawTo(t,[this],Object.assign({background:(i=e.background)!==null&&i!==void 0?i:this.background,renderService:e.renderService,x:(n=e.x)!==null&&n!==void 0?n:this.stage.x,y:(r=e.y)!==null&&r!==void 0?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach(a=>a(this))}}const lO=Symbol.for("TransformUtil"),hO=Symbol.for("GraphicUtil"),lS=Symbol.for("LayerService"),dO=Symbol.for("StaticLayerHandlerContribution"),uO=Symbol.for("DynamicLayerHandlerContribution"),cO=Symbol.for("VirtualLayerHandlerContribution");var Bd,BN=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},DN=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let Dd=Bd=class{static GenerateLayerId(){return`${Bd.idprefix}_${Bd.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=et.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(s){return this.layerMap.get(s)}getRecommendedLayerType(s){return s||(this.staticLayerCountInEnv!==0?"static":this.dynamicLayerCountInEnv!==0?"dynamic":"virtual")}getLayerHandler(s){let t;return t=s==="static"?Pt.get(dO):s==="dynamic"?Pt.get(uO):Pt.get(cO),t}createLayer(s,t={main:!1}){var e;this.tryInit();let i=this.getRecommendedLayerType(t.layerMode);i=t.main||t.canvasId?"static":i;const n=this.getLayerHandler(i),r=new LN(s,this.global,s.window,Object.assign(Object.assign({main:!1},t),{layerMode:i,canvasId:(e=t.canvasId)!==null&&e!==void 0?e:Bd.GenerateLayerId(),layerHandler:n})),a=this.layerMap.get(s)||[];return a.push(r),this.layerMap.set(s,a),this.staticLayerCountInEnv--,r}prepareStageLayer(s){let t;s.forEachChildren(e=>{const i=e.getNativeHandler();i.type==="virtual"?(i.mainHandler=t,t.secondaryHandlers.push(i)):(t=i,t.secondaryHandlers=[])})}releaseLayer(s,t){t.release();const e=this.layerMap.get(s)||[];this.layerMap.set(s,e.filter(i=>i!==t))}layerCount(s){return(this.layerMap.get(s)||[]).length}restLayerCount(s){return this.global.env==="browser"?10:0}};Dd.idprefix="visactor_layer",Dd.prefix_count=0,Dd=Bd=BN([ft(),DN("design:paramtypes",[])],Dd);const FN=new Et(s=>{s(Xx).to(My).inSingletonScope(),s(Ng).to(Dy),s(hO).to(Fy).inSingletonScope(),s(lO).to(jy).inSingletonScope(),s(lS).to(Dd).inSingletonScope()});function zo(s,t){return!(!s&&!t)}function qh(s,t){let e;return e=$(s)?s.some(i=>i||i===void 0):!!s,e&&t>0}function To(s,t,e){return e&&s*t>0}function hS(s,t,e,i,n){return n&&s*t>0&&e!==0&&i!==0}function dS(s,t){return s*t>0}function uS(s,t,e,i){return s*t>0&&e!==0&&i!==0}function jN(s,t,e,i,n,r,a,o){if(!s.pathProxy)return!1;const l=at(s,r==null?void 0:r.theme)[s.type],{fill:h=l.fill,stroke:d=l.stroke,opacity:u=l.opacity,fillOpacity:c=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible}=s.attribute,_=To(u,c,h),m=dS(u,g),v=zo(h),y=qh(d,p);if(!f||!v&&!y||!(_||m||a||o))return!0;t.beginPath();const b=typeof s.pathProxy=="function"?s.pathProxy(s.attribute):s.pathProxy;return Cr(b.commandList,t,e,i),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,l),y&&m&&(t.setStrokeStyle(s,s.attribute,e,i,l),t.stroke()),v&&_&&(t.setCommonStyle(s,s.attribute,e,i,l),t.fill()),!0}function pO(s,t,e,i,n,r,a,o){const l=e-s,h=i-t,d=a-n,u=o-r;let c=u*l-d*h;return c*c<re?[]:(c=(d*(t-r)-u*(s-n))/c,[s+c*l,t+c*h])}function pa(s,t,e,i,n,r,a){const o=s-e,l=t-i,h=(a?r:-r)/Math.sqrt(o*o+l*l),d=h*l,u=-h*o,c=s+d,p=t+u,g=e+d,f=i+u,_=(c+g)/2,m=(p+f)/2,v=g-c,y=f-p,b=v*v+y*y,x=n-r,S=c*f-g*p,A=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S));let k=(S*y-v*A)/b,w=(-S*v-y*A)/b;const T=(S*y+v*A)/b,M=(-S*v+y*A)/b,C=k-_,R=w-m,I=T-_,O=M-m;return C*C+R*R>I*I+O*O&&(k=T,w=M),{cx:k,cy:w,x01:-d,y01:-u,x11:k*(n/x-1),y11:w*(n/x-1)}}function $g(s,t,e,i,n,r,a){const{startAngle:o,endAngle:l}=s.getParsedAngle(),h=Kt(l-o),d=l>o;let u=!1;if(n<r){const c=n;n=r,r=c}if(n<=re)t.moveTo(e,i);else if(h>=jt-re)t.moveTo(e+n*de(o),i+n*se(o)),t.arc(e,i,n,o,l,!d),r>re&&(t.moveTo(e+r*de(l),i+r*se(l)),t.arc(e,i,r,l,o,d));else{const c=s.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:g,outerStartAngle:f,outerEndAngle:_,innerEndAngle:m,innerStartAngle:v}=s.getParsePadAngle(o,l),y=c,b=c,x=c,S=c,A=Math.max(b,y),k=Math.max(x,S);let w=A,T=k;const M=n*de(f),C=n*se(f),R=r*de(m),I=r*se(m);let O,L,D,j;if((k>re||A>re)&&(O=n*de(_),L=n*se(_),D=r*de(v),j=r*se(v),h<le)){const H=pO(M,C,D,j,O,L,R,I);if(H){const W=M-H[0],V=C-H[1],X=O-H[0],Q=L-H[1],J=1/se(_E((W*X+V*Q)/(fs(W*W+V*V)*fs(X*X+Q*Q)))/2),nt=fs(H[0]*H[0]+H[1]*H[1]);T=Ci(k,(r-nt)/(J-1)),w=Ci(A,(n-nt)/(J+1))}}if(p<.001)a&&(a[3]||a[1])&&t.moveTo(e+M,i+C),u=!0;else if(w>re){const H=Ci(y,w),W=Ci(b,w),V=pa(D,j,M,C,n,H,Number(d)),X=pa(O,L,R,I,n,W,Number(d));w<A&&H===W?!a||a[0]?(t.moveTo(e+V.cx+V.x01,i+V.cy+V.y01),t.arc(e+V.cx,i+V.cy,w,he(V.y01,V.x01),he(X.y01,X.x01),!d)):t.moveTo(e+V.cx+w*de(he(X.y01,X.x01)),i+V.cy+w*se(he(X.y01,X.x01))):!a||a[0]?(t.moveTo(e+V.cx+V.x01,i+V.cy+V.y01),H>0&&t.arc(e+V.cx,i+V.cy,H,he(V.y01,V.x01),he(V.y11,V.x11),!d),t.arc(e,i,n,he(V.cy+V.y11,V.cx+V.x11),he(X.cy+X.y11,X.cx+X.x11),!d),W>0&&t.arc(e+X.cx,i+X.cy,W,he(X.y11,X.x11),he(X.y01,X.x01),!d)):W>0?t.moveTo(e+X.cx+W*de(he(X.y01,X.x01)),i+X.cy+W*se(he(X.y01,X.x01))):t.moveTo(e+O,i+n*se(_))}else!a||a[0]?(t.moveTo(e+M,i+C),t.arc(e,i,n,f,_,!d)):t.moveTo(e+n*de(_),i+n*se(_));if(!(r>re)||g<.001)!a||a[1]?t.lineTo(e+R,i+I):t.moveTo(e+R,i+I),u=!0;else if(T>re){const H=Ci(S,T),W=Ci(x,T),V=pa(R,I,O,L,r,-W,Number(d)),X=pa(M,C,D,j,r,-H,Number(d));if(!a||a[1]?t.lineTo(e+V.cx+V.x01,i+V.cy+V.y01):t.moveTo(e+V.cx+V.x01,i+V.cy+V.y01),T<k&&H===W){const Q=he(X.y01,X.x01);!a||a[2]?t.arc(e+V.cx,i+V.cy,T,he(V.y01,V.x01),Q,!d):t.moveTo(e+V.cx+de(Q),i+V.cy+se(Q))}else!a||a[2]?(W>0&&t.arc(e+V.cx,i+V.cy,W,he(V.y01,V.x01),he(V.y11,V.x11),!d),t.arc(e,i,r,he(V.cy+V.y11,V.cx+V.x11),he(X.cy+X.y11,X.cx+X.x11),d),H>0&&t.arc(e+X.cx,i+X.cy,H,he(X.y11,X.x11),he(X.y01,X.x01),!d)):H>0?t.moveTo(e+X.cx+H*de(he(X.y01,X.x01)),i+X.cy+H*se(he(X.y01,X.x01))):t.moveTo(e+D,i+j)}else!a||a[1]?t.lineTo(e+R,i+I):t.moveTo(e+R,i+I),!a||a[2]?t.arc(e,i,r,m,v,d):t.moveTo(e+r*de(v),i+r*se(v))}return a?a[3]&&t.lineTo(e+n*de(o),i+n*se(o)):t.closePath(),u}class Ks{static GetCanvas(){try{return Ks.canvas||(Ks.canvas=et.global.createCanvas({})),Ks.canvas}catch{return null}}static GetCtx(){if(!Ks.ctx){const t=Ks.GetCanvas();Ks.ctx=t.getContext("2d")}return Ks.ctx}}class uo extends Cj{static getInstance(){return uo._instance||(uo._instance=new uo),uo._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Ks.GetCanvas(),n=Ks.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach(a=>{r.addColorStop(a[0],a[1])}),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,n,r=[],a=100){let o=`${t}${e}${i}${n}`;r.forEach(h=>o+=h.join()),o+=a;let l=this.dataMap.get(o);return l||(l={data:new uo(r,a),timestamp:[]},this.addLimitedTimestamp(l,Date.now(),{}),this.dataMap.set(o,l)),this.clearCache(this.dataMap,this.cacheParams),l.data}}class Yi{static GetSize(t){for(let e=0;e<Yi.ImageSize.length;e++)if(Yi.ImageSize[e]>=t)return Yi.ImageSize[e];return t}static Get(t,e,i,n,r,a,o){const l=Yi.GenKey(t,e,i,n,r),h=Yi.cache[l];if(!h||h.length===0)return null;for(let d=0;d<h.length;d++)if(h[d].width>=a&&h[d].height>=o)return h[d].pattern;return null}static Set(t,e,i,n,r,a,o,l){const h=Yi.GenKey(t,e,i,n,r);Yi.cache[h]?Yi.cache[h].push({width:o,height:l,pattern:a}):Yi.cache[h]=[{width:o,height:l,pattern:a}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}Yi.cache={},Yi.ImageSize=[20,40,80,160,320,640,1280,2560];function zN(s,t,e,i){const{stops:n,startAngle:r,endAngle:a}=i;for(;e<0;)e+=jt;for(;e>jt;)e-=jt;if(e<r||e>a)return n[0].color;let o,l,h=(e-r)/(a-r);for(let d=0;d<n.length;d++)if(n[d].offset>=h){o=n[d-1],l=n[d];break}return h=(h-o.offset)/(l.offset-o.offset),_o(o.color,l.color,h,!1)}function HN(s,t,e,i,n,r,a,o,l){const h=Math.floor(180*n/Math.PI),d=Ks.GetCanvas(),u=Ks.GetCtx();if(!u)return null;const c=Yi.GetSize(o),p=Yi.GetSize(l);let g=Yi.Get(t,e,i,r,a,c,p);if(g)return g;const f=Math.sqrt(Math.max(Math.max(Math.pow(e,2)+Math.pow(i,2),Math.pow(c-e,2)+Math.pow(i,2)),Math.max(Math.pow(c-e,2)+Math.pow(p-i,2),Math.pow(e,2)+Math.pow(p-i,2)))),_=h+1,m=n/Math.max(1,_-1),v=uo.getInstance().GetOrCreate(e,i,c,p,t,_),y=2*Math.PI*f/360;d.width=c,d.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,c,p),u.translate(e,i),u.rotate(r);for(let x=0,S=_-1;x<S&&!(r+x*m>a);x++){const A=v.getColor(x);u.beginPath(),u.rotate(m),u.moveTo(0,0),u.lineTo(f,-2*y),u.lineTo(f,0),u.fillStyle=A,u.closePath(),u.fill()}const b=u.getImageData(0,0,c,p);return d.width=b.width,d.height=b.height,u.putImageData(b,0,0),g=s.createPattern(d,"no-repeat"),g&&Yi.Set(t,e,i,r,a,g,c,p),g}const Wy=Symbol.for("ArcRenderContribution"),Vy=Symbol.for("AreaRenderContribution"),Uy=Symbol.for("CircleRenderContribution"),gO=Symbol.for("GroupRenderContribution"),$y=Symbol.for("ImageRenderContribution"),Yy=Symbol.for("PathRenderContribution"),Xy=Symbol.for("PolygonRenderContribution"),Fd=Symbol.for("RectRenderContribution"),Ky=Symbol.for("SymbolRenderContribution"),qy=Symbol.for("TextRenderContribution"),cS=Symbol.for("InteractiveSubRenderContribution"),Rk=["radius","startAngle","endAngle",...zs];class Cu extends ss{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=um}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}doUpdateAABBBounds(t){const e=at(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=et.graphicService.updateCircleAABBBounds(i,at(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,a=Ei(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return at(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,Rk)}needUpdateTag(t){return super.needUpdateTag(t,Rk)}toCustomPath(){var t,e,i;const n=this.attribute,r=(t=n.radius)!==null&&t!==void 0?t:this.getDefaultAttribute("radius"),a=(e=n.startAngle)!==null&&e!==void 0?e:this.getDefaultAttribute("startAngle"),o=(i=n.endAngle)!==null&&i!==void 0?i:this.getDefaultAttribute("endAngle"),l=new ai;return l.arc(0,0,r,a,o),l}clone(){return new Cu(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Cu.NOWORK_ANIMATE_ATTR}}Cu.NOWORK_ANIMATE_ATTR=Ni;function NN(s){return new Cu(s)}function Zy(s,t={},e){e||(e=1);const{fontStyle:i=t.fontStyle,fontVariant:n=t.fontVariant,fontWeight:r=t.fontWeight,fontSize:a=t.fontSize,fontFamily:o=t.fontFamily}=s;return(i?i+" ":"")+(n?n+" ":"")+(r?r+" ":"")+a*e+"px "+(o||"sans-serif")}function Sr(s,t){return s==="end"||s==="right"?-t:s==="center"?-t/2:0}function Ar(s,t,e,i=0){return s==="middle"?-t/2:s==="top"?0:s==="bottom"?i-t:s&&s!=="alphabetic"?0:(e||(e=t),-(t-e)/2-.79*e)}class Jy{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if(e==="left"||e==="start")t.xOffset=0;else if(e==="center")t.xOffset=t.width/-2;else{if(e!=="right"&&e!=="end")throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset=i==="top"?0:i==="middle"?t.height/-2:i==="alphabetic"?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,a,o,l,h){const d=[],u=[e,i],c=[0,0];for(;t.length>0;){const{str:g}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,l,h);d.push({str:g,width:this.textMeasure.measureTextWidth(g,this.textOptions)}),t=t.substring(g.length)}n==="left"||n==="start"||(n==="center"?c[0]=u[0]/-2:n!=="right"&&n!=="end"||(c[0]=-u[0])),r==="top"||(r==="middle"?c[1]=u[1]/-2:r==="bottom"&&(c[1]=-u[1]));const p={xOffset:c[0],yOffset:c[1],width:u[0],height:u[1]};return this.layoutWithBBox(p,d,n,r,a)}GetLayoutByLines(t,e,i,n,r="",a,o,l="end"){t=t.map(c=>c.toString());const h=[],d=[0,0];if(typeof o=="number"&&o!==1/0){let c;for(let p=0,g=t.length;p<g;p++)c=Math.min(this.textMeasure.measureTextWidth(t[p],this.textOptions),o),h.push({str:this.textMeasure.clipTextWithSuffix(t[p],this.textOptions,c,r,a,l).str,width:c});d[0]=o}else{let c,p;o=0;for(let g=0,f=t.length;g<f;g++)p=t[g],c=this.textMeasure.measureTextWidth(p,this.textOptions),o=Math.max(o,c),h.push({str:p,width:c});d[0]=o}d[1]=h.length*n,d[0]=h.reduce((c,p)=>Math.max(c,p.width),0);const u={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(u,e,i),this.layoutWithBBox(u,h,e,i,n)}layoutWithBBox(t,e,i,n,r){const a=[0,0],o=e.length*r;n==="top"||(n==="middle"?a[1]=(t.height-o)/2:n==="bottom"&&(a[1]=t.height-o));for(let l=0;l<e.length;l++)this.lineOffset(t,e[l],i,n,r,a);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,a){return i==="left"||i==="start"?e.leftOffset=0:i==="center"?e.leftOffset=(t.width-e.width)/2:i!=="right"&&i!=="end"||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+a[1],a[1]+=r,e}}const Ok=["text","maxLineWidth","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...zs];let qd=class vr extends ss{get font(){const t=at(this).text;return this._font||(this._font=Zy(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=at(this).text;if(!this.isSimplify())return;const{maxLineWidth:n=i.maxLineWidth}=e;return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):((t=e.text)!==null&&t!==void 0?t:i.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=at(this).text,e=this.attribute;if(this.isMultiLine)return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),e.direction==="vertical"&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map(n=>n.text).join("")!==e.text.toString():this.clipedText!=null&&this.clipedText!==e.text.toString())}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&this.attribute.direction!=="vertical"}get isMultiLine(){return Array.isArray(this.attribute.text)||this.attribute.whiteSpace==="normal"}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=vm,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return $(t)?!t.every(e=>e==null||e===""):t!=null&&t!==""}doUpdateAABBBounds(){const t=at(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateWrapAABBBounds(t){var e,i,n,r;const a=at(this).text,{fontFamily:o=a.fontFamily,textAlign:l=a.textAlign,textBaseline:h=a.textBaseline,fontSize:d=a.fontSize,ellipsis:u=a.ellipsis,maxLineWidth:c,stroke:p=a.stroke,lineWidth:g=a.lineWidth,wordBreak:f=a.wordBreak,fontWeight:_=a.fontWeight,ignoreBuf:m=a.ignoreBuf,suffixPosition:v=a.suffixPosition,heightLimit:y=0,lineClamp:b}=this.attribute,x=(e=qn(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))!==null&&e!==void 0?e:this.attribute.fontSize||a.fontSize,S=m?0:2;if(!this.shouldUpdateShape()&&(!((i=this.cache)===null||i===void 0)&&i.layoutData)){const O=this.cache.layoutData.bbox;return this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const A=et.graphicUtil.textMeasure,k=new Jy(o,{fontSize:d,fontWeight:_,fontFamily:o},A),w=$(t)?t.map(O=>O.toString()):[t.toString()],T=[],M=[0,0];let C=1/0;if(y>0&&(C=Math.max(Math.floor(y/x),1)),b&&(C=Math.min(C,b)),typeof c=="number"&&c!==1/0){if(c>0)for(let L=0;L<w.length;L++){const D=w[L];let j=!0;if(L===C-1){const W=k.textMeasure.clipTextWithSuffix(D,k.textOptions,c,u,!1,v);T.push({str:W.str,width:W.width});break}const H=k.textMeasure.clipText(D,k.textOptions,c,f==="break-word");if(D!==""&&H.str===""){if(u){const W=k.textMeasure.clipTextWithSuffix(D,k.textOptions,c,u,!1,v);H.str=(n=W.str)!==null&&n!==void 0?n:"",H.width=(r=W.width)!==null&&r!==void 0?r:0}else H.str="",H.width=0;j=!1}if(T.push({str:H.str,width:H.width}),H.str.length!==D.length){if(j){const W=D.substring(H.str.length);w.splice(L+1,0,W)}}}let O=0;T.forEach(L=>{O=Math.max(O,L.width)}),M[0]=O}else{let O,L,D=0;for(let j=0,H=w.length;j<H;j++){if(j===C-1){const W=k.textMeasure.clipTextWithSuffix(w[j],k.textOptions,c,u,!1,v);T.push({str:W.str,width:W.width}),D=Math.max(D,W.width);break}L=w[j],O=k.textMeasure.measureTextWidth(L,k.textOptions,f==="break-word"),D=Math.max(D,O),T.push({str:L,width:O})}M[0]=D}M[1]=T.length*(x+S);const R={xOffset:0,yOffset:0,width:M[0],height:M[1]};k.LayoutBBox(R,l,h);const I=k.layoutWithBBox(R,T,l,h,x);return this.cache.layoutData=I,this.clearUpdateShapeTag(),this._AABBBounds.set(R.xOffset,R.yOffset,R.xOffset+R.width,R.yOffset+R.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=at(this).text,{direction:i=e.direction}=this.attribute;return i==="horizontal"?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=at(this).text,{direction:i=e.direction}=this.attribute;return i==="horizontal"?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,i;const n=at(this).text,{wrap:r=n.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds([t]);const a=et.graphicUtil.textMeasure;let o,l;const h=this.attribute,{maxLineWidth:d=n.maxLineWidth,ellipsis:u=n.ellipsis,textAlign:c=n.textAlign,textBaseline:p=n.textBaseline,fontFamily:g=n.fontFamily,fontSize:f=n.fontSize,fontWeight:_=n.fontWeight,stroke:m=n.stroke,lineWidth:v=n.lineWidth,ignoreBuf:y=n.ignoreBuf,whiteSpace:b=n.whiteSpace,suffixPosition:x=n.suffixPosition}=h;if(b==="normal")return this.updateWrapAABBBounds(t);const S=y?0:Math.max(2,.075*f),A=h.fontSize||n.fontSize,k=(e=qn(h.lineHeight,A))!==null&&e!==void 0?e:A+S;if(!this.shouldUpdateShape()&&this.cache){o=(i=this.cache.clipedWidth)!==null&&i!==void 0?i:0;const C=Sr(c,o),R=Ar(p,k,f);return this._AABBBounds.set(C,R,C+o,R+k),m&&this._AABBBounds.expand(v/2),this._AABBBounds}if(Number.isFinite(d)){if(u){const C=u===!0?n.ellipsis:u,R=a.clipTextWithSuffix(t.toString(),{fontSize:f,fontWeight:_,fontFamily:g},d,C,!1,x);l=R.str,o=R.width}else{const C=a.clipText(t.toString(),{fontSize:f,fontWeight:_,fontFamily:g},d,!1);l=C.str,o=C.width}this.cache.clipedText=l,this.cache.clipedWidth=o}else o=a.measureTextWidth(t.toString(),{fontSize:f,fontWeight:_,fontFamily:g}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=o;this.clearUpdateShapeTag();const w=Sr(c,o);let T=k;et.global&&et.global.isSafari()&&(T+=.2*f);const M=Ar(p,T,f,S);return this._AABBBounds.set(w,M,w+o,M+T),m&&this._AABBBounds.expand(v/2),this._AABBBounds}getBaselineMapAlign(){return vr.baselineMapAlign}getAlignMapBaseline(){return vr.alignMapBaseline}updateVerticalSinglelineAABBBounds(t){var e,i,n;const r=at(this).text,a=et.graphicUtil.textMeasure;let o;const l=this.attribute,{ignoreBuf:h=r.ignoreBuf}=l,d=h?0:2,{maxLineWidth:u=r.maxLineWidth,ellipsis:c=r.ellipsis,fontSize:p=r.fontSize,fontWeight:g=r.fontWeight,fontFamily:f=r.fontFamily,stroke:_=r.stroke,lineWidth:m=r.lineWidth,verticalMode:v=r.verticalMode,suffixPosition:y=r.suffixPosition}=l,b=(e=qn(l.lineHeight,l.fontSize||r.fontSize))!==null&&e!==void 0?e:(l.fontSize||r.fontSize)+d;let{textAlign:x=r.textAlign,textBaseline:S=r.textBaseline}=l;if(!v){const T=x;x=(i=vr.baselineMapAlign[S])!==null&&i!==void 0?i:"left",S=(n=vr.alignMapBaseline[T])!==null&&n!==void 0?n:"top"}if(!this.shouldUpdateShape()&&this.cache){o=this.cache.clipedWidth;const T=Sr(x,o),M=Ar(S,b,p);return this._AABBBounds.set(M,T,M+b,T+o),_&&this._AABBBounds.expand(m/2),this._AABBBounds}let A=[Pk(t.toString())];if(Number.isFinite(u)){if(c){const T=c===!0?r.ellipsis:c,M=a.clipTextWithSuffixVertical(A[0],{fontSize:p,fontWeight:g,fontFamily:f},u,T,!1,y);A=[M.verticalList],o=M.width}else{const T=a.clipTextVertical(A[0],{fontSize:p,fontWeight:g,fontFamily:f},u,!1);A=[T.verticalList],o=T.width}this.cache.verticalList=A,this.cache.clipedWidth=o}else o=0,A[0].forEach(T=>{const M=T.direction===mo.HORIZONTAL?p:a.measureTextWidth(T.text,{fontSize:p,fontWeight:g,fontFamily:f});o+=M,T.width=M}),this.cache.verticalList=A,this.cache.clipedWidth=o;this.clearUpdateShapeTag();const k=Sr(x,o),w=Ar(S,b,p);return this._AABBBounds.set(w,k,w+b,k+o),_&&this._AABBBounds.expand(m/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const n=at(this).text,{wrap:r=n.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds(t);const a=this.attribute,{fontFamily:o=n.fontFamily,textAlign:l=n.textAlign,textBaseline:h=n.textBaseline,fontSize:d=n.fontSize,fontWeight:u=n.fontWeight,ellipsis:c=n.ellipsis,maxLineWidth:p,stroke:g=n.stroke,lineWidth:f=n.lineWidth,whiteSpace:_=n.whiteSpace,suffixPosition:m=n.suffixPosition}=a,v=(e=qn(a.lineHeight,a.fontSize||n.fontSize))!==null&&e!==void 0?e:a.fontSize||n.fontSize;if(_==="normal")return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(!((i=this.cache)===null||i===void 0)&&i.layoutData)){const S=this.cache.layoutData.bbox;return this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}const y=et.graphicUtil.textMeasure,b=new Jy(o,{fontSize:d,fontWeight:u,fontFamily:o},y).GetLayoutByLines(t,l,h,v,c===!0?n.ellipsis:c||void 0,!1,p,m),{bbox:x}=b;return this.cache.layoutData=b,this.clearUpdateShapeTag(),this._AABBBounds.set(x.xOffset,x.yOffset,x.xOffset+x.width,x.yOffset+x.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,n;const r=at(this).text,a=et.graphicUtil.textMeasure;let o;const l=this.attribute,{ignoreBuf:h=r.ignoreBuf}=l,d=h?0:2,{maxLineWidth:u=r.maxLineWidth,ellipsis:c=r.ellipsis,fontFamily:p=r.fontFamily,fontSize:g=r.fontSize,fontWeight:f=r.fontWeight,stroke:_=r.stroke,lineWidth:m=r.lineWidth,verticalMode:v=r.verticalMode,suffixPosition:y=r.suffixPosition}=l,b=(e=qn(l.lineHeight,l.fontSize||r.fontSize))!==null&&e!==void 0?e:(l.fontSize||r.fontSize)+d;let{textAlign:x=r.textAlign,textBaseline:S=r.textBaseline}=l;if(!v){const M=x;x=(i=vr.baselineMapAlign[S])!==null&&i!==void 0?i:"left",S=(n=vr.alignMapBaseline[M])!==null&&n!==void 0?n:"top"}if(o=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach(I=>{const O=I.reduce((L,D)=>L+D.width,0);o=ps(O,o)});const M=Sr(x,o),C=this.cache.verticalList.length*b,R=Ar(S,C,g);return this._AABBBounds.set(R,M,R+C,M+o),_&&this._AABBBounds.expand(m/2),this._AABBBounds}const A=t.map(M=>Pk(M.toString()));A.forEach((M,C)=>{if(Number.isFinite(u))if(c){const R=c===!0?r.ellipsis:c,I=a.clipTextWithSuffixVertical(M,{fontSize:g,fontWeight:f,fontFamily:p},u,R,!1,y);A[C]=I.verticalList,o=I.width}else{const R=a.clipTextVertical(M,{fontSize:g,fontWeight:f,fontFamily:p},u,!1);A[C]=R.verticalList,o=R.width}else o=0,M.forEach(R=>{const I=R.direction===mo.HORIZONTAL?g:a.measureTextWidth(R.text,{fontSize:g,fontWeight:f,fontFamily:p});o+=I,R.width=I})}),this.cache.verticalList=A,this.clearUpdateShapeTag(),this.cache.verticalList.forEach(M=>{const C=M.reduce((R,I)=>R+I.width,0);o=ps(C,o)});const k=Sr(x,o),w=this.cache.verticalList.length*b,T=Ar(S,w,g);return this._AABBBounds.set(T,k,T+w,k+o),_&&this._AABBBounds.expand(m/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return at(this).text[t]}needUpdateTags(t,e=Ok){return super.needUpdateTags(t,e)}needUpdateTag(t,e=Ok){return super.needUpdateTag(t,e)}clone(){return new vr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return vr.NOWORK_ANIMATE_ATTR}};qd.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Ni),qd.baselineMapAlign={top:"left",bottom:"right",middle:"center"},qd.alignMapBaseline={left:"top",right:"bottom",center:"middle"};function Mo(s){return new qd(s)}const Ep=["heightLimit","lineClamp"];class pS extends qd{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return $(t)?!t.every(e=>e==null||e===""):t!=null&&t!==""}updateMultilineAABBBounds(t){var e,i,n,r;const a=at(this).text,{fontFamily:o=a.fontFamily,textAlign:l=a.textAlign,textBaseline:h=a.textBaseline,fontSize:d=a.fontSize,ellipsis:u=a.ellipsis,maxLineWidth:c,stroke:p=a.stroke,lineWidth:g=a.lineWidth,wordBreak:f=a.wordBreak,fontWeight:_=a.fontWeight,ignoreBuf:m=a.ignoreBuf,heightLimit:v=0,suffixPosition:y=a.suffixPosition,lineClamp:b}=this.attribute,x=(e=qn(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))!==null&&e!==void 0?e:this.attribute.fontSize||a.fontSize,S=m?0:2;if(!this.shouldUpdateShape()&&(!((i=this.cache)===null||i===void 0)&&i.layoutData)){const O=this.cache.layoutData.bbox;return this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const A=et.graphicUtil.textMeasure,k=new Jy(o,{fontSize:d,fontWeight:_,fontFamily:o},A),w=t.map(O=>O.toString()),T=[],M=[0,0];let C=1/0;if(v>0&&(C=Math.max(Math.floor(v/x),1)),b&&(C=Math.min(C,b)),typeof c=="number"&&c!==1/0){if(c>0)for(let L=0;L<w.length;L++){const D=w[L];let j=!0;if(L===C-1){const W=k.textMeasure.clipTextWithSuffix(D,k.textOptions,c,u,!1,y);T.push({str:W.str,width:W.width});break}const H=k.textMeasure.clipText(D,k.textOptions,c,f==="break-word");if(D!==""&&H.str===""){if(u){const W=k.textMeasure.clipTextWithSuffix(D,k.textOptions,c,u,!1,y);H.str=(n=W.str)!==null&&n!==void 0?n:"",H.width=(r=W.width)!==null&&r!==void 0?r:0}else H.str="",H.width=0;j=!1}if(T.push({str:H.str,width:H.width}),H.str.length!==D.length){if(j){const W=D.substring(H.str.length);w.splice(L+1,0,W)}}}let O=0;T.forEach(L=>{O=Math.max(O,L.width)}),M[0]=O}else{let O,L,D=0;for(let j=0,H=w.length;j<H;j++){if(j===C-1){const W=k.textMeasure.clipTextWithSuffix(w[j],k.textOptions,c,u,!1,y);T.push({str:W.str,width:W.width}),D=Math.max(D,W.width);break}L=w[j],O=k.textMeasure.measureTextWidth(L,k.textOptions,f==="break-word"),D=Math.max(D,O),T.push({str:L,width:O})}M[0]=D}M[1]=T.length*(x+S);const R={xOffset:0,yOffset:0,width:M[0],height:M[1]};k.LayoutBBox(R,l,h);const I=k.layoutWithBBox(R,T,l,h,x);return this.cache.layoutData=I,this.clearUpdateShapeTag(),this._AABBBounds.set(R.xOffset,R.yOffset,R.xOffset+R.width,R.yOffset+R.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<Ep.length;e++){const i=Ep[e];if(t.indexOf(i)!==-1)return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Ep.length;e++)if(t===Ep[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return pS.NOWORK_ANIMATE_ATTR}}function GN(s){return new pS(s)}class li{bounds(t,e){if(dt(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function Ik(s,t,e,i,n){return n?s.arc(e,i,t,0,pi,!1,n):s.arc(e,i,t,0,pi),!1}class WN extends li{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,r){return Ik(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,a){return Ik(t,e/2+r,i,n,a)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}}const VN=new WN;function UN(s,t,e,i,n){return s.moveTo(-3*t+e,-t+i,n),s.lineTo(-t+e,-t+i,n),s.lineTo(-t+e,-3*t+i,n),s.lineTo(t+e,-3*t+i,n),s.lineTo(t+e,-t+i,n),s.lineTo(3*t+e,-t+i,n),s.lineTo(3*t+e,t+i,n),s.lineTo(t+e,t+i,n),s.lineTo(t+e,3*t+i,n),s.lineTo(-t+e,3*t+i,n),s.lineTo(-t+e,t+i,n),s.lineTo(-3*t+e,t+i,n),s.closePath(),!0}function $N(s,t,e,i,n,r){return s.moveTo(-3*t+e-n,-t+i-n,r),s.lineTo(-t+e-n,-t+i-n,r),s.lineTo(-t+e-n,-3*t+i-n,r),s.lineTo(t+e+n,-3*t+i-n,r),s.lineTo(t+e+n,-t+i-n,r),s.lineTo(3*t+e+n,-t+i-n,r),s.lineTo(3*t+e+n,t+i+n,r),s.lineTo(t+e+n,t+i+n,r),s.lineTo(t+e+n,3*t+i+n,r),s.lineTo(-t+e-n,3*t+i+n,r),s.lineTo(-t+e-n,t+i+n,r),s.lineTo(-3*t+e-n,t+i+n,r),s.closePath(),!0}class YN extends li{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,r){return UN(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,a){return $N(t,e/6,i,n,r,a)}}const XN=new YN;function g0(s,t,e,i,n){return s.moveTo(e,i-t,n),s.lineTo(t+e,i,n),s.lineTo(e,i+t,n),s.lineTo(e-t,i,n),s.closePath(),!0}class KN extends li{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return g0(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return g0(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,a){return g0(t,e/2+r,i,n,a)}}const qN=new KN;function Lk(s,t,e,i){const n=2*t;return s.rect(e-t,i-t,n,n),!1}class ZN extends li{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Lk(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Lk(t,e/2+r,i,n)}}const JN=new ZN;function QN(s,t,e,i){return s.moveTo(e+t,t+i),s.lineTo(e-t,t+i),s.lineTo(e,i-t),s.closePath(),!0}function tG(s,t,e,i,n){return s.moveTo(e+t+2*n,t+i+n),s.lineTo(e-t-2*n,t+i+n),s.lineTo(e,i-t-2*n),s.closePath(),!0}class gS extends li{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return QN(t,e/2,i,n)}drawOffset(t,e,i,n,r){return tG(t,e/2,i,n,r)}}const eG=new gS;class iG extends gS{constructor(){super(...arguments),this.type="triangle"}}const sG=new iG,fO=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),nG=Math.sin(pi/10)*fO,rG=-Math.cos(pi/10)*fO;function Bk(s,t,e,i){const n=nG*t,r=rG*t;s.moveTo(e,-t+i),s.lineTo(n+e,r+i);for(let a=1;a<5;++a){const o=pi*a/5,l=Math.cos(o),h=Math.sin(o);s.lineTo(h*t+e,-l*t+i),s.lineTo(l*n-h*r+e,h*n+l*r+i)}return s.closePath(),!0}class aG extends li{constructor(){super(...arguments),this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return Bk(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Bk(t,e/2+r,i,n)}}const oG=new aG,lG=fs(3);function Dk(s,t,e,i){const n=t,r=n/lG,a=r/5,o=t;return s.moveTo(0+e,-n+i),s.lineTo(r/2+e,i),s.lineTo(a/2+e,i),s.lineTo(a/2+e,o+i),s.lineTo(-a/2+e,o+i),s.lineTo(-a/2+e,i),s.lineTo(-r/2+e,i),s.closePath(),!0}class hG extends li{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return Dk(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Dk(t,e/2+r,i,n)}}const dG=new hG;function Fk(s,t,e,i){const n=2*t;return s.moveTo(e,-t+i),s.lineTo(n/3/2+e,t+i),s.lineTo(-n/3/2+e,t+i),s.closePath(),!0}class uG extends li{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Fk(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Fk(t,e/2+r,i,n)}}const cG=new uG;function jk(s,t,e,i){return s.moveTo(-t+e,i),s.lineTo(e,t+i),!1}class pG extends li{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return jk(t,e/2,i,n)}drawOffset(t,e,i,n,r){return jk(t,e/2+r,i,n)}}const gG=new pG,Vs=-.5,Us=fs(3)/2,zk=1/fs(12);function Hk(s,t,e,i){const n=t/2,r=t*zk,a=n,o=t*zk+t,l=-a,h=o;return s.moveTo(n+e,r+i),s.lineTo(a+e,o+i),s.lineTo(l+e,h+i),s.lineTo(Vs*n-Us*r+e,Us*n+Vs*r+i),s.lineTo(Vs*a-Us*o+e,Us*a+Vs*o+i),s.lineTo(Vs*l-Us*h+e,Us*l+Vs*h+i),s.lineTo(Vs*n+Us*r+e,Vs*r-Us*n+i),s.lineTo(Vs*a+Us*o+e,Vs*o-Us*a+i),s.lineTo(Vs*l+Us*h+e,Vs*h-Us*l+i),s.closePath(),!1}class fG extends li{constructor(){super(...arguments),this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return Hk(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Hk(t,e/2+r,i,n)}}const _G=new fG;function mG(s,t,e,i){return s.moveTo(-t+e,i),s.lineTo(t+e,t+i),s.lineTo(t+e,i-t),s.closePath(),!0}function vG(s,t,e,i,n){return s.moveTo(-t+e-2*n,i),s.lineTo(t+e+n,t+i+2*n),s.lineTo(t+e+n,i-t-2*n),s.closePath(),!0}class yG extends li{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return mG(t,e/2,i,n)}drawOffset(t,e,i,n,r){return vG(t,e/2,i,n,r)}}const bG=new yG;function xG(s,t,e,i){return s.moveTo(e-t,t+i),s.lineTo(t+e,i),s.lineTo(e-t,i-t),s.closePath(),!0}function SG(s,t,e,i,n){return s.moveTo(e-t-n,t+i+2*n),s.lineTo(t+e+2*n,i),s.lineTo(e-t-n,i-t-2*n),s.closePath(),!0}class AG extends li{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return xG(t,e/2,i,n)}drawOffset(t,e,i,n,r){return SG(t,e/2,i,n,r)}}const kG=new AG;function wG(s,t,e,i){return s.moveTo(e-t,i-t),s.lineTo(e+t,i-t),s.lineTo(e,i+t),s.closePath(),!0}function TG(s,t,e,i,n){return s.moveTo(e-t-2*n,i-t-n),s.lineTo(e+t+2*n,i-t-n),s.lineTo(e,i+t+2*n),s.closePath(),!0}class MG extends li{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return wG(t,e/2,i,n)}drawOffset(t,e,i,n,r){return TG(t,e/2,i,n,r)}}const CG=new MG,Qy=fs(3);function Nk(s,t,e,i){const n=t*Qy;return s.moveTo(e,i+-n/3*2),s.lineTo(t+e,i+n),s.lineTo(e-t,i+n),s.closePath(),!0}class PG extends gS{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Nk(t,e/2/Qy,i,n)}drawOffset(t,e,i,n,r){return Nk(t,e/2/Qy+r,i,n)}}const EG=new PG;function Gk(s,t,e,i){const n=2*t;return s.moveTo(t+e,i-n),s.lineTo(e-t,i),s.lineTo(t+e,n+i),!0}class RG extends li{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return Gk(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Gk(t,e/4+r,i,n)}}const OG=new RG;function Wk(s,t,e,i){const n=2*t;return s.moveTo(e-t,i-n),s.lineTo(e+t,i),s.lineTo(e-t,n+i),!0}class IG extends li{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return Wk(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Wk(t,e/4+r,i,n)}}const LG=new IG;function Vk(s,t,e,i){const n=2*t;return s.moveTo(e-n,i+t),s.lineTo(e,i-t),s.lineTo(e+n,i+t),!0}class BG extends li{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return Vk(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Vk(t,e/4+r,i,n)}}const DG=new BG;function Uk(s,t,e,i){const n=2*t;return s.moveTo(e-n,i-t),s.lineTo(e,i+t),s.lineTo(e+n,i-t),!0}class FG extends li{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return Uk(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Uk(t,e/4+r,i,n)}}const jG=new FG;function $k(s,t,e,i,n){return s.moveTo(e,i-t),s.lineTo(e,i+t),!0}class zG extends li{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return $k(t,e/2,i,n)}drawOffset(t,e,i,n,r,a){return $k(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e}, ${i-r} L ${e},${i+r}`}}const HG=new zG;function Yk(s,t,e,i,n){return s.moveTo(e-t,i),s.lineTo(e+t,i),!0}class NG extends li{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return Yk(t,e/2,i,n)}drawOffset(t,e,i,n,r,a){return Yk(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} L ${e+r},${i}`}}const GG=new NG;function Xk(s,t,e,i,n){return s.moveTo(e-t,i-t),s.lineTo(e+t,i+t),s.moveTo(e+t,i-t),s.lineTo(e-t,i+t),!0}class WG extends li{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,r){return Xk(t,e/2,i,n)}drawOffset(t,e,i,n,r,a){return Xk(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}}const VG=new WG;function Kk(s,t,e,i){return s.rect(e-t[0]/2,i-t[1]/2,t[0],t[1]),!1}function qk(s,t,e,i){const n=t,r=t/2;return s.rect(e-n/2,i-r/2,n,r),!1}class UG extends li{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return dt(e)?qk(t,e,i,n):Kk(t,e,i,n)}drawOffset(t,e,i,n,r){return dt(e)?qk(t,e+2*r,i,n):Kk(t,[e[0]+2*r,e[1]+2*r],i,n)}}const $G=new UG,fd=new Le;class Zk{constructor(t,e,i=!1){this.pathStr="",this.type=t,$(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,r,a,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach(l=>{t.beginPath(),Cr(l.path.commandList,t,i,n,e,e),o&&o(l.path,l.attribute)}),!1):(Cr(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach(o=>{t.beginPath(),Cr(o.path.commandList,t,i,n,e,e),a&&a(o.path,o.attribute)}),!1):(Cr(this.path.commandList,t,i,n,e,e),!1)}bounds(t,e){if(this.isSvg)return this.svgCache?(e.clear(),void this.svgCache.forEach(({path:i})=>{fd.x1=i.bounds.x1*t,fd.y1=i.bounds.y1*t,fd.x2=i.bounds.x2*t,fd.y2=i.bounds.y2*t,e.union(fd)})):void 0;this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const YG=[VN,XN,qN,JN,EG,sG,oG,dG,cG,gG,_G,bG,kG,eG,CG,OG,LG,DG,jG,$G,HG,GG,VG],Yg={};YG.forEach(s=>{Yg[s.type]=s});const XG={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},Rp=new Le,Jk=["symbolType","size",...zs];let Pu=class ll extends ss{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=mm}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return $(t)?t.length===2&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const t=at(this).symbol;let{symbolType:e=t.symbolType}=this.attribute,i=Yg[e];if(i)return this._parsedPath=i,i;if(i=ll.userSymbolMap[e],i)return this._parsedPath=i,i;if(e=XG[e]||e,wN(e)===!0){const l=new hm,{svg:h}=l.parse(e);if(!h)return null;const d=$(h.path)?h.path:[h.path];Rp.clear();const u=[];d.forEach(f=>{const _=new ai().fromString(f.d),m={};IN.forEach(v=>{f[v]&&(m[oO[v]]=f[v])}),u.push({path:_,attribute:m}),Rp.union(_.bounds)});const c=Rp.width(),p=Rp.height(),g=1/ps(c,p);return u.forEach(f=>f.path.transform(0,0,g,g)),this._parsedPath=new Zk(e,u,!0),ll.userSymbolMap[e]=this._parsedPath,this._parsedPath}const n=new ai().fromString(e),r=n.bounds.width(),a=n.bounds.height(),o=1/ps(r,a);return n.transform(0,0,o,o),this._parsedPath=new Zk(e,n),ll.userSymbolMap[e]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=at(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=et.graphicService.updateSymbolAABBBounds(i,at(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,a=Ei(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return at(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,Jk)}needUpdateTag(t){return super.needUpdateTag(t,Jk)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=$(e)?e:[e,e];return t.path?new ai().fromCustomPath2D(t.path,0,0,i[0],i[1]):new ai().fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new ll(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ll.NOWORK_ANIMATE_ATTR}};Pu.userSymbolMap={},Pu.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Ni);function ym(s){return new Pu(s)}const Qk=["segments","points","curveType",...zs];let _O=class tb extends ss{constructor(t={}){super(t),this.type="line",this.numberType=Cc}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?e.length!==0:!!t&&!(t.length<=1)}_interpolate(t,e,i,n,r){t==="points"&&(r.points=Qx(i,n,e))}doUpdateAABBBounds(){const t=at(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updateLineAABBBounds(e,at(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return at(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,Qk)}needUpdateTag(t){return super.needUpdateTag(t,Qk)}toCustomPath(){const t=this.attribute,e=new ai,i=t.segments,n=r=>{if(r&&r.length){let a=!0;r.forEach(o=>{o.defined!==!1&&(a?e.moveTo(o.x,o.y):e.lineTo(o.x,o.y),a=!1)})}};return i&&i.length?i.forEach(r=>{n(r.points)}):t.points&&n(t.points),e}clone(){return new tb(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return tb.NOWORK_ANIMATE_ATTR}};_O.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ni);function fS(s){return new _O(s)}const tw=["width","x1","y1","height","cornerRadius",...zs];class Mh extends ss{constructor(t){super(t),this.type="rect",this.numberType=_m}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}doUpdateAABBBounds(){const t=at(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updateRectAABBBounds(e,at(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return at(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,tw)}needUpdateTag(t){return super.needUpdateTag(t,tw)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:n,height:r}=$R(t),a=new ai;return a.moveTo(e,i),a.rect(e,i,n,r),a}clone(){return new Mh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Mh.NOWORK_ANIMATE_ATTR}}Mh.NOWORK_ANIMATE_ATTR=Ni;function Ch(s){return new Mh(s)}const ew=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class bm extends Mh{constructor(t){super(t),this.type="rect3d",this.numberType=rS}findFace(){const t={polygons:[],vertices:[],edges:[]},e=at(this).rect3d,{x1:i,y1:n,x:r,y:a,length:o=Ci(e.width,e.height)}=this.attribute;let{width:l,height:h}=this.attribute;l=l??i-r,h=h??n-a;for(let d=0;d<ew.length;d++){const u=ew[d];t.vertices.push([u[0]*l,u[1]*h,u[2]*o])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return bm.NOWORK_ANIMATE_ATTR}}bm.NOWORK_ANIMATE_ATTR=Ni;function mO(s){return new bm(s)}class Eu extends ss{constructor(t){super(t),this.type="glyph",this.numberType=cm,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach(e=>{e.glyphHost=this,Object.setPrototypeOf(e.attribute,this.attribute)}),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach(t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})})}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach(r=>{r.addUpdateShapeAndBoundsTag(),r.addUpdatePositionTag()})}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach(n=>{n.addUpdateShapeAndBoundsTag(),n.addUpdatePositionTag()})}translate(t,e){return super.translate(t,e),this.subGraphic.forEach(i=>{i.addUpdatePositionTag(),i.addUpdateBoundTag()}),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach(i=>{i.addUpdatePositionTag(),i.addUpdateBoundTag()}),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach(n=>{n.addUpdatePositionTag(),n.addUpdateBoundTag()}),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach(i=>{i.addUpdatePositionTag(),i.addUpdateBoundTag()}),this}rotate(t){return super.rotate(t),this.subGraphic.forEach(e=>{e.addUpdatePositionTag(),e.addUpdateBoundTag()}),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach(e=>{e.addUpdatePositionTag(),e.addUpdateBoundTag()}),this}doUpdateAABBBounds(){this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const t=et.graphicService.updateGlyphAABBBounds(this.attribute,at(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!(((i=this.currentStates)===null||i===void 0?void 0:i.length)!==t.length||t.some((a,o)=>this.currentStates[o]!==a)))return;const n={},r=this.subGraphic.map(()=>({}));t.forEach(a=>{var o;const l=this.glyphStateProxy?this.glyphStateProxy(a,t):this.glyphStates[a];l&&(Object.assign(n,l.attributes),!((o=l.subAttributes)===null||o===void 0)&&o.length&&r.forEach((h,d)=>{Object.assign(h,l.subAttributes[d])}))}),this.subGraphic.forEach((a,o)=>{a.updateNormalAttrs(r[o]),a.applyStateAttrs(r[o],t,e)}),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach(e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null}),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new Eu(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map(e=>e.clone())),t}getNoWorkAnimateAttr(){return Eu.NOWORK_ANIMATE_ATTR}}Eu.NOWORK_ANIMATE_ATTR=Ni;function vO(s){return new Eu(s)}class KG{constructor(t,e,i,n,r,a,o,l,h,d,u,c,p,g){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=a,this.verticalDirection=o,this.lines=[],this.globalAlign=l,this.globalBaseline=h,this.layoutDirection=d,this.directionKey=qx[this.layoutDirection],this.isWidthMax=u,this.isHeightMax=c,this.singleLine=p,g?(g.clear(),this.icons=g):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let a=this.isHeightMax?Math.min(this.height,n):this.height||n||0;a=Math.min(a,n);let o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-a/2;break;case"bottom":o=-a}let l=0;switch(this.globalAlign){case"left":l=0;break;case"center":l=-r/2;break;case"right":l=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let d=!1;if(this.verticalDirection==="middle")if(this.actualHeight>=h&&h!==0)for(let u=0;u<this.lines.length;u++){const{top:c,height:p}=this.lines[u];if(c+p<this[this.directionKey.top]||c+p>this[this.directionKey.top]+h)return d;let g=!1;this.ellipsis&&this.lines[u+1]&&this.lines[u+1].top+this.lines[u+1].height>this[this.directionKey.top]+h&&(g=!0,d=!0),this.lines[u].draw(t,g,this.lines[u][this.directionKey.left]+l,this.lines[u][this.directionKey.top]+o,e)}else{const u=Math.floor((h-this.actualHeight)/2);this.layoutDirection==="vertical"?l+=u:o+=u;for(let c=0;c<this.lines.length;c++)this.lines[c].draw(t,!1,this.lines[c][this.directionKey.left]+l,this.lines[c][this.directionKey.top]+o,e)}else if(this.verticalDirection==="bottom"&&this.layoutDirection!=="vertical")for(let u=0;u<this.lines.length;u++){const{top:c,height:p}=this.lines[u],g=h-this.lines[u].top-this.lines[u].height;if(h===0)this.lines[u].draw(t,!1,l,g+o,e);else{if(g+p>this[this.directionKey.top]+h||g<this[this.directionKey.top])return d;{let f=!1;this.ellipsis&&this.lines[u+1]&&g-this.lines[u+1].height<this[this.directionKey.top]&&(f=!0,d=!0),this.lines[u].draw(t,f,l,g+o,e)}}}else{this.verticalDirection==="bottom"&&this.layoutDirection==="vertical"&&this.singleLine&&this.isWidthMax&&(l+=this.lines[0].height+1);for(let u=0;u<this.lines.length;u++){this.verticalDirection==="bottom"&&this.layoutDirection==="vertical"&&(l-=this.lines[u].height+this.lines[u].top);const{top:c,height:p}=this.lines[u];if(h===0)this.lines[u].draw(t,!1,this.lines[u][this.directionKey.left]+l,this.lines[u][this.directionKey.top]+o,e);else{if(c+p<this[this.directionKey.top]||c+p>this[this.directionKey.top]+h)return d;{let g=!1;this.ellipsis&&this.lines[u+1]&&this.lines[u+1].top+this.lines[u+1].height>this[this.directionKey.top]+h&&(g=!0,d=!0),this.lines[u].draw(t,g,this.lines[u][this.directionKey.left]+l,this.lines[u][this.directionKey.top]+o,e)}}}}return d}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:this.layoutDirection==="vertical"?e:t,height:this.layoutDirection==="vertical"?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),this.verticalDirection==="middle")if(this.actualHeight>=r&&r!==0)for(let a=0;a<this.lines.length;a++){const{top:o,height:l}=this.lines[a];if(!(o+l<this[this.directionKey.top]||o+l>this[this.directionKey.top]+r))if(this.ellipsis&&this.lines[a+1]&&this.lines[a+1].top+this.lines[a+1].height>this[this.directionKey.top]+r){const h=this.lines[a].getWidthWithEllips();h>t&&(t=h),e+=this.lines[a].height}else this.lines[a].actualWidth>t&&(t=this.lines[a].actualWidth),e+=this.lines[a].height}else{Math.floor((r-this.actualHeight)/2);for(let a=0;a<this.lines.length;a++)this.lines[a].actualWidth>t&&(t=this.lines[a].actualWidth),e+=this.lines[a].height}else if(this.verticalDirection==="bottom")for(let a=0;a<this.lines.length;a++){const{top:o,height:l}=this.lines[a],h=r-this.lines[a].top-this.lines[a].height;if(r===0)this.lines[a].actualWidth>t&&(t=this.lines[a].actualWidth),e+=this.lines[a].height;else if(!(h+l>this[this.directionKey.top]+r||h<this[this.directionKey.top]))if(this.ellipsis&&this.lines[a+1]&&h-this.lines[a+1].height<this[this.directionKey.top]){const d=this.lines[a].getWidthWithEllips();d>t&&(t=d),e+=this.lines[a].height}else this.lines[a].actualWidth>t&&(t=this.lines[a].actualWidth),e+=this.lines[a].height}else for(let a=0;a<this.lines.length;a++){const{top:o,height:l}=this.lines[a];if(r===0)this.lines[a].actualWidth>t&&(t=this.lines[a].actualWidth),e+=this.lines[a].height;else if(!(o+l<this[this.directionKey.top]||o+l>this[this.directionKey.top]+r))if(this.ellipsis&&this.lines[a+1]&&this.lines[a+1].top+this.lines[a+1].height>this[this.directionKey.top]+r){const h=this.lines[a].getWidthWithEllips();h>t&&(t=h),e+=this.lines[a].height}else this.lines[a].actualWidth>t&&(t=this.lines[a].actualWidth),e+=this.lines[a].height}return{width:this.layoutDirection==="vertical"?e:t,height:this.layoutDirection==="vertical"?t:e}}}class Ru{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const n=qn(i.lineHeight,this.fontSize);this.lineHeight=typeof n=="number"?n>this.fontSize?n:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:a,descent:o,width:l}=ml(t,i);let h=0,d=0,u=0;this.height>a&&(h=(this.height-a)/2,d=Math.ceil(h),u=Math.floor(h)),this.textBaseline==="top"?(this.ascent=h,this.descent=a-h):this.textBaseline==="bottom"?(this.ascent=a-h,this.descent=h):this.textBaseline==="middle"?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+d,this.descent=o+u),this.length=t.length,this.width=l||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,i.direction==="vertical"&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=ml(this.text,this.character);this.width=t,this.direction==="vertical"&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let a=this.text,o=this.left+i;e+=this.top;let l=this.direction;if(this.verticalEllipsis)a="...",l="vertical",e-=this.ellipsisWidth/2;else{if(this.ellipsis==="hide")return;if(this.ellipsis==="add")a+="...",r==="right"&&(o-=this.ellipsisWidth);else if(this.ellipsis==="replace"){const h=Oy(a,(l==="vertical"?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,a.length-1);if(a=a.slice(0,h),a+="...",r==="right"){const{width:d}=ml(this.text.slice(h),this.character);l==="vertical"||(o-=this.ellipsisWidth-d)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}l==="vertical"&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(bH(t,this.character),t.strokeText(a,o,e)),yH(t,this.character),this.character.fill&&t.fillText(a,o,e),this.character.fill&&(typeof this.character.lineThrough=="boolean"||typeof this.character.underline=="boolean"?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):this.character.textDecoration==="underline"?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):this.character.textDecoration==="line-through"&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),l==="vertical"&&t.restore()}getWidthWithEllips(t){let e=this.text;const i=t==="vertical"?this.height:this.width;if(this.ellipsis==="hide")return i;if(this.ellipsis==="add")return i+this.ellipsisWidth;if(this.ellipsis==="replace"){const n=Oy(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,n),e+="...";const{width:r}=ml(this.text.slice(n),this.character);return i+this.ellipsisWidth-r}return i}}function qG(s,t){const e=s.text.slice(0,t),i=s.text.slice(t);return[new Ru(e,s.newLine,s.character),new Ru(i,!0,s.character)]}const iw=["width","height","image",...zs];class Ph extends ss{constructor(t){super(t),this.type="image",this.numberType=pm,this.loadImage(this.attribute.image)}get width(){var t;return(t=this.attribute.width)!==null&&t!==void 0?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return(t=this.attribute.height)!==null&&t!==void 0?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return(t=this.attribute.repeatX)!==null&&t!==void 0?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return(t=this.attribute.repeatY)!==null&&t!==void 0?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,()=>{this.successCallback&&this.successCallback()})}imageLoadFail(t,e){super.imageLoadFail(t,()=>{this.failCallback&&this.failCallback()})}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return t==="image"&&this.loadImage(e),super.setAttribute(t,e,i,n)}doUpdateAABBBounds(){const t=at(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updateImageAABBBounds(e,at(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return wu[t]}needUpdateTags(t){return super.needUpdateTags(t,iw)}needUpdateTag(t){return super.needUpdateTag(t,iw)}clone(){return new Ph(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ph.NOWORK_ANIMATE_ATTR}}Ph.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Ni);function _S(s){return new Ph(s)}class kr extends Ph{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],t.backgroundShowMode==="always"&&(this._hovered=!0),t.margin){const e=Ei(t.margin);this._marginArray=typeof e=="number"?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(e,i,n)=>{if($(n)&&n.indexOf("margin")!==-1||n==="margin")if(i.margin){const r=Ei(i.margin);this._marginArray=typeof r=="number"?[r,r,r,r]:r}else this._marginArray=[0,0,0,0]}}get width(){var t;return((t=this.attribute.width)!==null&&t!==void 0?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return((t=this.attribute.height)!==null&&t!==void 0?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=wu.width,height:e=wu.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,a=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*a,0]),this._AABBBounds}setHoverState(t){this.attribute.backgroundShowMode==="hover"&&this._hovered!==t&&(this._hovered=t)}}class ZG{constructor(t,e,i,n,r,a,o,l){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=a.map(d=>d),this.textAlign=(this.paragraphs[0]instanceof kr?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=qx[this.direction],this.actualWidth=0;let h=0;this.paragraphs.forEach((d,u)=>{if(u===0&&d instanceof Ru){const c=vH.exec(d.text);(c==null?void 0:c.index)!==0&&(d.text=d.text.slice(c==null?void 0:c.index),d.updateWidth())}this.actualWidth+=d[this.directionKey.width],h=Math.max(d[this.directionKey.height],h)}),this.height=h,this.blankWidth=l?0:this.width-this.actualWidth,this.calcOffset(e,l)}calcOffset(t,e){const i=this.directionKey,n=this.height;let r=this.left,a=0;if(this.actualWidth<t&&!e)switch(this.textAlign){case"right":r=t-this.actualWidth;break;case"center":r=(t-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?r=(t-this.actualWidth)/2:a=(t-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map(function(o){o instanceof kr?(o["_"+i.x]=r,r+=o[i.width]+a,o["_"+i.y]=o.attribute.textBaseline==="top"?0:o.attribute.textBaseline==="bottom"?n-o.height:(n-o.height)/2):(o[i.left]=r,r+=o[i.width]+a)})}draw(t,e,i,n,r){if(e){let a=0;for(let o=this.paragraphs.length-1;o>=0;o--){const l=this.paragraphs[o];if(l instanceof kr)break;if(this.direction==="vertical"&&l.direction!=="vertical"){l.verticalEllipsis=!0;break}const{width:h}=ml("...",l.character),d=h||0;if(d<=this.blankWidth+a){l.ellipsis="add";break}if(d<=this.blankWidth+a+l.width){l.ellipsis="replace",l.ellipsisWidth=d,l.ellipsisOtherParagraphWidth=this.blankWidth+a;break}l.ellipsis="hide",a+=l.width}}this.paragraphs.map((a,o)=>{if(a instanceof kr)return a.setAttributes({x:i+a._x,y:n+a._y}),void r(a,t,i+a._x,n+a._y,this.ascent);a.draw(t,n+this.ascent,i,o===0,this.textAlign)})}getWidthWithEllips(){let t=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof kr)break;const{width:r}=ml("...",n.character),a=r||0;if(a<=this.blankWidth+t){n.ellipsis="add",n.ellipsisWidth=a;break}if(a<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=a,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}let e=0;return this.paragraphs.map((i,n)=>{e+=i instanceof kr?i.width:i.getWidthWithEllips(this.direction)}),e}}class JG{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=qx[this.direction]}store(t){if(t instanceof kr){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;t.attribute.textBaseline==="top"?(e=0,i=t.height):t.attribute.textBaseline==="bottom"?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),t.text.length!==0?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(this.lineBuffer.length===0)return;const t=this.maxAscent===0?this.maxAscentForBlank:this.maxAscent,e=this.maxDescent===0?this.maxDescentForBlank:this.maxDescent,i=new ZG(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,this.direction==="horizontal"?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof kr?this.direction==="horizontal"&&this.width===0||this.direction==="vertical"&&this.height===0||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineBuffer.length===0?(this.store(t),this.send()):(this.send(),this.deal(t)):typeof this.width!="number"||this.width<0||(t.newLine&&this.send(),t.text.length!==0&&(this.direction==="horizontal"&&this.width===0||this.direction==="vertical"&&this.height===0||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}cut(t){const e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,n=Oy(t.text,e,t.character,i,this.frame.wordBreak==="break-word");if(n!==0){const[r,a]=qG(t,n);this.store(r),this.deal(a)}else this.lineBuffer.length!==0&&(this.send(),this.deal(t))}}const sw=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...zs];class Ou extends ss{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=aS}get width(){var t;return(t=this.attribute.width)!==null&&t!==void 0?t:Wn.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return(t=this.attribute.height)!==null&&t!==void 0?t:Wn.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return(t=this.attribute.ellipsis)!==null&&t!==void 0?t:Wn.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return(t=this.attribute.wordBreak)!==null&&t!==void 0?t:Wn.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return(t=this.attribute.verticalDirection)!==null&&t!==void 0?t:Wn.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return(t=this.attribute.textAlign)!==null&&t!==void 0?t:Wn.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return(t=this.attribute.textBaseline)!==null&&t!==void 0?t:Wn.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return(t=this.attribute.textConfig)!==null&&t!==void 0?t:Wn.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=at(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updateRichTextAABBBounds(e,at(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Wn[t]}needUpdateTags(t){return super.needUpdateTags(t,sw)}needUpdateTag(t){return super.needUpdateTag(t,sw)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e=[],maxWidth:i,maxHeight:n,width:r,height:a,ellipsis:o,wordBreak:l,verticalDirection:h,textAlign:d,textBaseline:u,layoutDirection:c,singleLine:p}=this.attribute,g=[];for(let x=0;x<e.length;x++)if("image"in e[x]){const S=e[x],A=S.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(S.id);if(A)g.push(A);else{const k=new kr(S);k.successCallback=()=>{var w;this.addUpdateBoundTag(),(w=this.stage)===null||w===void 0||w.renderNextFrame()},k.richtextId=S.id,g.push(k)}}else if(e[x].text.includes(`
|
||
`)){const S=e[x].text.split(`
|
||
`);for(let A=0;A<S.length;A++)g.push(new Ru(S[A],A!==0,e[x]))}else g.push(new Ru(e[x].text,!1,e[x]));const f=typeof i=="number"&&Number.isFinite(i)&&i>0,_=typeof n=="number"&&Number.isFinite(n)&&n>0,m=typeof r=="number"&&Number.isFinite(r)&&r>0&&(!f||r<=i),v=typeof a=="number"&&Number.isFinite(a)&&a>0&&(!_||a<=n),y=new KG(0,0,(m?r:f?i:0)||0,(v?a:_?n:0)||0,o,l,h,d,u,c||"horizontal",!m&&f,!v&&_,p||!1,(t=this._frameCache)===null||t===void 0?void 0:t.icons),b=new JG(y);for(let x=0;x<g.length;x++)b.deal(g[x]);if(b.send(),!(y.layoutDirection==="horizontal"?m:v)){const x=y.getActualSizeWidthEllipsis();let S=y.layoutDirection==="horizontal"?x.width:x.height;(y.layoutDirection==="horizontal"?f:_)&&(S=Math.min(S,y.layoutDirection==="horizontal"?i:n)),y.lines.forEach(function(A){A.calcOffset(S,!1)})}this._frameCache=y}clone(){return new Ou(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach(i=>{i.setStage(t,e)})}bindIconEvent(){this.addEventListener("pointermove",t=>{var e,i,n,r,a;const o=this.pickIcon(t.global);o&&o===this._currentHoverIcon||(o?((e=this._currentHoverIcon)===null||e===void 0||e.setHoverState(!1),this._currentHoverIcon=o,this._currentHoverIcon.setHoverState(!0),(i=this.stage)===null||i===void 0||i.setCursor(o.attribute.cursor),(n=this.stage)===null||n===void 0||n.renderNextFrame()):!o&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,(r=this.stage)===null||r===void 0||r.setCursor(),(a=this.stage)===null||a===void 0||a.renderNextFrame()))}),this.addEventListener("pointerleave",t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,(e=this.stage)===null||e===void 0||e.setCursor(),(i=this.stage)===null||i===void 0||i.renderNextFrame())})}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach(a=>{var o,l;a.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=a,r.globalX=((o=r.attribute.x)!==null&&o!==void 0?o:0)+i,r.globalY=((l=r.attribute.y)!==null&&l!==void 0?l:0)+n)}),r}getNoWorkAnimateAttr(){return Ou.NOWORK_ANIMATE_ATTR}}Ou.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Ni);function yO(s){return new Ou(s)}const nw=["path","customPath",...zs];class Iu extends ss{constructor(t){super(t),this.type="path",this.numberType=gm}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return t!=null&&t!==""}getParsedPathShape(){const t=at(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof ai?e.path:(P(this.cache)&&this.doUpdatePathShape(),this.cache instanceof ai?this.cache:t.path)}doUpdateAABBBounds(){const t=at(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updatePathAABBBounds(e,at(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;ht(t.path,!0)?this.cache=new ai().fromString(t.path):t.customPath&&(this.cache=new ai,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return at(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,nw)}needUpdateTag(t){return super.needUpdateTag(t,nw)}toCustomPath(){return new ai().fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Iu(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Iu.NOWORK_ANIMATE_ATTR}}Iu.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Ni);function bO(s){return new Iu(s)}const rw=["segments","points","curveType",...zs];class Lu extends ss{constructor(t){super(t),this.type="area",this.numberType=Mc}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?e.length!==0:!!t&&t.length!==0}doUpdateAABBBounds(){const t=at(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updateAreaAABBBounds(e,at(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){t==="points"&&(r.points=Qx(i,n,e))}getDefaultAttribute(t){return at(this).area[t]}needUpdateTags(t){return super.needUpdateTags(t,rw)}needUpdateTag(t){return super.needUpdateTag(t,rw)}toCustomPath(){const t=new ai,e=this.attribute,i=e.segments,n=r=>{if(r&&r.length){let a=!0;const o=[];if(r.forEach(l=>{var h,d;l.defined!==!1&&(a?t.moveTo(l.x,l.y):t.lineTo(l.x,l.y),o.push({x:(h=l.x1)!==null&&h!==void 0?h:l.x,y:(d=l.y1)!==null&&d!==void 0?d:l.y}),a=!1)}),o.length){for(let l=o.length-1;l>=0;l--)t.lineTo(o[l].x,o[l].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach(r=>{n(r.points)}),t}clone(){return new Lu(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Lu.NOWORK_ANIMATE_ATTR}}Lu.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ni);function xO(s){return new Lu(s)}const aw=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...zs];class Eh extends ss{constructor(t){super(t),this.type="arc",this.numberType=dm}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=at(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:i=t.outerRadius,innerRadius:n=t.innerRadius}=this.attribute;if(e===0||e==="0%")return 0;const r=Math.abs(i-n);return Math.min(dt(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=at(this).arc;let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,r=i-e>=0?1:-1,a=i-e;if(e=Tj(e),i=e+a,n&&Kt(a)<jt-re){let o=1,l=1;n.length&&(o=Number(n[0]),l=Number(n[1]));const{outerRadius:h=t.outerRadius,innerRadius:d=t.innerRadius}=this.attribute,u=Math.abs(h-d)/2,c=u/h;if(u>re&&h>re)return{startAngle:e-r*c*o,endAngle:i+r*c*l,sc:r*c*o,ec:r*c*l}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=at(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:a=i.padAngle}=this.attribute,{padRadius:o=fs(n*n+r*r)}=this.attribute,l=Kt(e-t);let h=t,d=e,u=t,c=e;const p=a/2;let g=l,f=l;if(p>re&&o>re){const _=e>t?1:-1;let m=g1(Number(o)/r*se(p)),v=g1(Number(o)/n*se(p));return(g-=2*m)>re?(m*=_,u+=m,c-=m):(g=0,u=c=(t+e)/2),(f-=2*v)>re?(v*=_,h+=v,d-=v):(f=0,h=d=(t+e)/2),{outerStartAngle:h,outerEndAngle:d,innerStartAngle:u,innerEndAngle:c,innerDeltaAngle:g,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:d,innerStartAngle:u,innerEndAngle:c,innerDeltaAngle:g,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=at(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=et.graphicService.updateArcAABBBounds(i,at(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,a=Ei(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,aw)}needUpdateTag(t){return super.needUpdateTag(t,aw)}getDefaultAttribute(t){return at(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const a=Kt(i-e),o=i>e;if(r<n){const h=r;r=n,n=h}const l=new ai;if(r<=re)l.moveTo(0,0);else if(a>=jt-re)l.moveTo(0+r*de(e),0+r*se(e)),l.arc(0,0,r,e,i,!o),n>re&&(l.moveTo(0+n*de(i),0+n*se(i)),l.arc(0,0,n,i,e,o));else{const h=r*de(e),d=r*se(e),u=n*de(i),c=n*se(i);l.moveTo(0+h,0+d),l.arc(0,0,r,e,i,!o),l.lineTo(0+u,0+c),l.arc(0,0,n,i,e,o),l.closePath()}return l}clone(){return new Eh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Eh.NOWORK_ANIMATE_ATTR}}Eh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Ni);function mS(s){return new Eh(s)}class xm extends Eh{constructor(t){super(t),this.type="arc3d",this.numberType=Tc}doUpdateAABBBounds(){const t=at(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updateArc3dAABBBounds(e,at(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return xm.NOWORK_ANIMATE_ATTR}}xm.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Ni);function SO(s){return new xm(s)}const ow=["points","cornerRadius",...zs];class Rh extends ss{constructor(t){super(t),this.type="polygon",this.numberType=fm}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=at(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updatePolygonAABBBounds(e,at(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){t==="points"&&(r.points=Qx(i,n,e))}getDefaultAttribute(t){return at(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,ow)}needUpdateTag(t){return super.needUpdateTag(t,ow)}toCustomPath(){const t=this.attribute.points,e=new ai;return t.forEach((i,n)=>{n===0?e.moveTo(i.x,i.y):e.lineTo(i.x,i.y)}),e.closePath(),e}clone(){return new Rh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Rh.NOWORK_ANIMATE_ATTR}}Rh.NOWORK_ANIMATE_ATTR=Ni;function AO(s){return new Rh(s)}class Sm extends Rh{constructor(t){super(t),this.type="pyramid3d",this.numberType=nS}doUpdateAABBBounds(){const t=at(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=et.graphicService.updatePyramid3dAABBBounds(e,at(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Ei(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){const{points:t}=this.attribute,e=t.map((o,l)=>{const h=l===3?t[0]:t[l+1],d=o.x-h.x;return d===0?0:(o.y-h.y)/d}),i=t.map(o=>({p:o,d:0}));let n=!1,r=0;for(let o=0;o<e.length-1;o++){for(let l=o+1;l<e.length;l++){if(e[o]===e[l]){n=!0;const h=ze.distancePP(i[o].p,i[o+1].p);i[o].d=h,i[o+1].d=h,r=ps(r,h);const d=ze.distancePP(i[l].p,i[l+1].p);i[l].d=d,i[l+1].d=d,r=ps(r,d)}if(n)break}if(n)break}for(let o=t.length-1;o>=0;o--){const l=t[o];i.unshift({p:l,d:0})}for(let o=0;o<t.length;o++){const l=(r-i[o+t.length].d)/2;i[o].d+=l,i[o+t.length].d+=l}const a={polygons:[],vertices:[],edges:[]};return i.forEach(o=>{a.vertices.push([o.p.x,o.p.y,o.d])}),a.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),a.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),a.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),a.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),a.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),a.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),a.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],a}_isValid(){return super._isValid()&&this.attribute.points.length===4}getNoWorkAnimateAttr(){return Sm.NOWORK_ANIMATE_ATTR}}Sm.NOWORK_ANIMATE_ATTR=Ni;function kO(s){return new Sm(s)}class QG extends Kh{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function tW(s){return new QG(s)}class jd{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:a=e.shadowBlur}=t;if(r){const o=e.outerBorder,{distance:l=o.distance,lineWidth:h=o.lineWidth}=r;i.expand(l+(a+h)/2)}return i}}class eW extends jd{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:a=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const l=e.outerBorder,{distance:h=l.distance,lineWidth:d=l.lineWidth}=r;cg(i,h+(a+d)/2,!0,o)}return i}}function lw(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class iW{constructor(){this.pools=[]}allocate(t,e,i,n,r,a){if(!this.pools.length)return new Ke(t,e,i,n,r,a);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=r,o.f=a,o}allocateByObj(t){if(!this.pools.length)return new Ke(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}class Am{constructor(){this.pools=[]}static identity(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}allocate(){if(!this.pools.length)return lw();const t=this.pools.pop();return Am.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():lw();for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const nn=new iW,ve=new Am;var sW=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},nW=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},rW=function(s,t){return function(e,i){t(e,i,s)}};function aW(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s}function oW(s,t,e){const i=Math.sin(e),n=Math.cos(e),r=t[4],a=t[5],o=t[6],l=t[7],h=t[8],d=t[9],u=t[10],c=t[11];return t!==s&&(s[0]=t[0],s[1]=t[1],s[2]=t[2],s[3]=t[3],s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15]),s[4]=r*n+h*i,s[5]=a*n+d*i,s[6]=o*n+u*i,s[7]=l*n+c*i,s[8]=h*n-r*i,s[9]=d*n-a*i,s[10]=u*n-o*i,s[11]=c*n-l*i,s}function lW(s,t,e){const i=Math.sin(e),n=Math.cos(e),r=t[0],a=t[1],o=t[2],l=t[3],h=t[8],d=t[9],u=t[10],c=t[11];return t!==s&&(s[4]=t[4],s[5]=t[5],s[6]=t[6],s[7]=t[7],s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15]),s[0]=r*n-h*i,s[1]=a*n-d*i,s[2]=o*n-u*i,s[3]=l*n-c*i,s[8]=r*i+h*n,s[9]=a*i+d*n,s[10]=o*i+u*n,s[11]=l*i+c*n,s}function hW(s,t,e){const i=Math.sin(e),n=Math.cos(e),r=t[0],a=t[1],o=t[2],l=t[3],h=t[4],d=t[5],u=t[6],c=t[7];return t!==s&&(s[8]=t[8],s[9]=t[9],s[10]=t[10],s[11]=t[11],s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15]),s[0]=r*n+h*i,s[1]=a*n+d*i,s[2]=o*n+u*i,s[3]=l*n+c*i,s[4]=h*n-r*i,s[5]=d*n-a*i,s[6]=u*n-o*i,s[7]=c*n-l*i,s}function _d(s,t,e){const i=e[0],n=e[1],r=e[2];let a,o,l,h,d,u,c,p,g,f,_,m;return t===s?(s[12]=t[0]*i+t[4]*n+t[8]*r+t[12],s[13]=t[1]*i+t[5]*n+t[9]*r+t[13],s[14]=t[2]*i+t[6]*n+t[10]*r+t[14],s[15]=t[3]*i+t[7]*n+t[11]*r+t[15]):(a=t[0],o=t[1],l=t[2],h=t[3],d=t[4],u=t[5],c=t[6],p=t[7],g=t[8],f=t[9],_=t[10],m=t[11],s[0]=a,s[1]=o,s[2]=l,s[3]=h,s[4]=d,s[5]=u,s[6]=c,s[7]=p,s[8]=g,s[9]=f,s[10]=_,s[11]=m,s[12]=a*i+d*n+g*r+t[12],s[13]=o*i+u*n+f*r+t[13],s[14]=l*i+c*n+_*r+t[14],s[15]=h*i+p*n+m*r+t[15]),s}function eb(s,t){s[0]=t.a,s[1]=t.b,s[2]=0,s[3]=0,s[4]=t.c,s[5]=t.d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=t.e,s[13]=t.f,s[14]=0,s[15]=1}function dW(s,t,e){const i=e[0],n=e[1],r=e[2];return s[0]=t[0]*i,s[1]=t[1]*i,s[2]=t[2]*i,s[3]=t[3]*i,s[4]=t[4]*n,s[5]=t[5]*n,s[6]=t[6]*n,s[7]=t[7]*n,s[8]=t[8]*r,s[9]=t[9]*r,s[10]=t[10]*r,s[11]=t[11]*r,s[12]=t[12],s[13]=t[13],s[14]=t[14],s[15]=t[15],s}function Pc(s,t,e){const i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],l=t[5],h=t[6],d=t[7],u=t[8],c=t[9],p=t[10],g=t[11],f=t[12],_=t[13],m=t[14],v=t[15];let y=e[0],b=e[1],x=e[2],S=e[3];return s[0]=y*i+b*o+x*u+S*f,s[1]=y*n+b*l+x*c+S*_,s[2]=y*r+b*h+x*p+S*m,s[3]=y*a+b*d+x*g+S*v,y=e[4],b=e[5],x=e[6],S=e[7],s[4]=y*i+b*o+x*u+S*f,s[5]=y*n+b*l+x*c+S*_,s[6]=y*r+b*h+x*p+S*m,s[7]=y*a+b*d+x*g+S*v,y=e[8],b=e[9],x=e[10],S=e[11],s[8]=y*i+b*o+x*u+S*f,s[9]=y*n+b*l+x*c+S*_,s[10]=y*r+b*h+x*p+S*m,s[11]=y*a+b*d+x*g+S*v,y=e[12],b=e[13],x=e[14],S=e[15],s[12]=y*i+b*o+x*u+S*f,s[13]=y*n+b*l+x*c+S*_,s[14]=y*r+b*h+x*p+S*m,s[15]=y*a+b*d+x*g+S*v,s}function wO(s,t,e){var i;const{x:n=e.x,y:r=e.y,z:a=e.z,dx:o=e.dx,dy:l=e.dy,dz:h=e.dz,scaleX:d=e.scaleX,scaleY:u=e.scaleY,scaleZ:c=e.scaleZ,alpha:p=e.alpha,beta:g=e.beta,angle:f=e.angle,anchor3d:_=t.attribute.anchor,anchor:m}=t.attribute,v=[0,0,0];if(_){if(typeof _[0]=="string"){const y=parseFloat(_[0])/100,b=t.AABBBounds;v[0]=b.x1+(b.x2-b.x1)*y}else v[0]=_[0];if(typeof _[1]=="string"){const y=parseFloat(_[1])/100,b=t.AABBBounds;v[1]=b.x1+(b.x2-b.x1)*y}else v[1]=_[1];v[2]=(i=_[2])!==null&&i!==void 0?i:0}if(aW(s),_d(s,s,[n+o,r+l,a+h]),_d(s,s,[v[0],v[1],v[2]]),oW(s,s,g),lW(s,s,p),_d(s,s,[-v[0],-v[1],v[2]]),dW(s,s,[d,u,c]),f){const y=ve.allocate(),b=[0,0];if(m){if(typeof _[0]=="string"){const x=parseFloat(_[0])/100,S=t.AABBBounds;b[0]=S.x1+(S.x2-S.x1)*x}else b[0]=_[0];if(typeof _[1]=="string"){const x=parseFloat(_[1])/100,S=t.AABBBounds;b[1]=S.x1+(S.x2-S.x1)*x}else b[1]=_[1]}_d(y,y,[b[0],b[1],0]),hW(y,y,f),_d(y,y,[-b[0],-b[1],0]),Pc(s,s,y)}}function uW(s){const{alpha:t,beta:e}=s.attribute;return t||e}let ib=class{constructor(s){this.creator=s,this.hooks={onAttributeUpdate:new Is(["graphic"]),onSetStage:new Is(["graphic","stage"]),onRemove:new Is(["graphic"]),onRelease:new Is(["graphic"]),onAddIncremental:new Is(["graphic","group","stage"]),onClearIncremental:new Is(["graphic","group","stage"]),beforeUpdateAABBBounds:new Is(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Is(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Le,this.tempAABBBounds2=new Le,this._rectBoundsContribitions=[new jd],this._symbolBoundsContribitions=[new eW],this._circleBoundsContribitions=[new jd],this._arcBoundsContribitions=[new jd],this._pathBoundsContribitions=[new jd]}onAttributeUpdate(s){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(s)}onSetStage(s,t){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(s,t)}onRemove(s){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(s)}onRelease(s){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(s)}onAddIncremental(s,t,e){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(s,t,e)}onClearIncremental(s,t){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(s,t)}beforeUpdateAABBBounds(s,t,e,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(s,t,e,i)}afterUpdateAABBBounds(s,t,e,i,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(s,t,e,i,n)}updatePathProxyAABBBounds(s,t){const e=typeof t.pathProxy=="function"?t.pathProxy(t.attribute):t.pathProxy;if(!e)return!1;const i=new AR(s);return Cr(e.commandList,i,0,0),!0}updateRectAABBBounds(s,t,e,i){if(!this._validCheck(s,t,e,i))return e;if(!this.updatePathProxyAABBBounds(e,i)){let{width:a,height:o}=s;const{x1:l,y1:h,x:d,y:u}=s;a=a??l-d,o=o??h-u,e.set(0,0,a||0,o||0)}const n=this.tempAABBBounds1,r=this.tempAABBBounds2;return n.setValue(e.x1,e.y1,e.x2,e.y2),r.setValue(e.x1,e.y1,e.x2,e.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach(a=>{a.updateBounds(s,t,n,i),e.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2)}),this.transformAABBBounds(s,e,t,!1,i),e}updateGroupAABBBounds(s,t,e,i){const{width:n,height:r,path:a,clip:o=t.clip}=s;a&&a.length?a.forEach(d=>{e.union(d.AABBBounds)}):n!=null&&r!=null&&e.set(0,0,n,r),o||i.forEachChildren(d=>{e.union(d.AABBBounds)});const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(e.x1,e.y1,e.x2,e.y2),h.setValue(e.x1,e.y1,e.x2,e.y2),this.transformAABBBounds(s,e,t,!1,i),e}updateGlyphAABBBounds(s,t,e,i){return this._validCheck(s,t,e,i)&&i.getSubGraphic().forEach(n=>{e.union(n.AABBBounds)}),e}updateRichTextAABBBounds(s,t,e,i){if(!this._validCheck(s,t,e,i)||!i)return e;const{width:n=t.width,height:r=t.height,maxWidth:a=t.maxWidth,maxHeight:o=t.maxHeight,textAlign:l=t.textAlign,textBaseline:h=t.textBaseline}=s;if(n>0&&r>0)e.set(0,0,n,r);else{const g=i.getFrameCache(),{width:f,height:_}=g.getActualSize();let m=n||f||0,v=r||_||0;v=typeof o=="number"&&v>o?o:v||0,m=typeof a=="number"&&m>a?a:m||0,e.set(0,0,m,v)}let d=0;switch(h){case"top":d=0;break;case"middle":d=-e.height()/2;break;case"bottom":d=-e.height()}let u=0;switch(l){case"left":u=0;break;case"center":u=-e.width()/2;break;case"right":u=-e.width()}e.translate(u,d);const c=this.tempAABBBounds1,p=this.tempAABBBounds2;return c.setValue(e.x1,e.y1,e.x2,e.y2),p.setValue(e.x1,e.y1,e.x2,e.y2),this.transformAABBBounds(s,e,t,!1,i),e}updateTextAABBBounds(s,t,e,i){if(!this._validCheck(s,t,e,i)||!i)return e;const{text:n=t.text}=i.attribute;Array.isArray(n)?i.updateMultilineAABBBounds(n):i.updateSingallineAABBBounds(n);const r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(e.x1,e.y1,e.x2,e.y2),a.setValue(e.x1,e.y1,e.x2,e.y2);const{scaleX:o=t.scaleX,scaleY:l=t.scaleY,shadowBlur:h=t.shadowBlur,strokeBoundsBuffer:d=t.strokeBoundsBuffer}=s;if(h){const u=h/Math.abs(o+l);cg(r,u,!0,d),e.union(r)}return this.combindShadowAABBBounds(e,i),ly(e,e,i.transMatrix),e}updatePathAABBBounds(s,t,e,i){if(!this._validCheck(s,t,e,i))return e;this.updatePathProxyAABBBounds(e,i)||this.updatePathAABBBoundsImprecise(s,t,e,i);const n=this.tempAABBBounds1,r=this.tempAABBBounds2;n.setValue(e.x1,e.y1,e.x2,e.y2),r.setValue(e.x1,e.y1,e.x2,e.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach(o=>{o.updateBounds(s,t,n,i),e.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2)});const{lineJoin:a=t.lineJoin}=s;return this.transformAABBBounds(s,e,t,a==="miter",i),e}updatePathAABBBoundsImprecise(s,t,e,i){if(!i)return e;const n=i.getParsedPathShape();return e.union(n.getBounds()),e}updatePyramid3dAABBBounds(s,t,e,i){if(!i)return e;const n=i.stage;if(!n||!n.camera)return e;i.findFace().vertices.forEach(o=>{const l=o[0],h=o[1];e.add(l,h)});const r=this.tempAABBBounds1,a=this.tempAABBBounds2;return r.setValue(e.x1,e.y1,e.x2,e.y2),a.setValue(e.x1,e.y1,e.x2,e.y2),this.transformAABBBounds(s,e,t,!1,i),e}updateArc3dAABBBounds(s,t,e,i){if(!i)return e;const n=i.stage;if(!n||!n.camera)return e;const{outerRadius:r=t.outerRadius,height:a=0}=s,o=r+a;e.setValue(-o,-o,o,o);const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(e.x1,e.y1,e.x2,e.y2),h.setValue(e.x1,e.y1,e.x2,e.y2),this.transformAABBBounds(s,e,t,!1,i),e}updatePolygonAABBBounds(s,t,e,i){if(!this._validCheck(s,t,e,i))return e;this.updatePathProxyAABBBounds(e,i)||this.updatePolygonAABBBoundsImprecise(s,t,e,i);const n=this.tempAABBBounds1,r=this.tempAABBBounds2;n.setValue(e.x1,e.y1,e.x2,e.y2),r.setValue(e.x1,e.y1,e.x2,e.y2);const{lineJoin:a=t.lineJoin}=s;return this.transformAABBBounds(s,e,t,a==="miter",i),e}updatePolygonAABBBoundsImprecise(s,t,e,i){const{points:n=t.points}=s;return n.forEach(r=>{e.add(r.x,r.y)}),e}updateLineAABBBounds(s,t,e,i){if(!this._validCheck(s,t,e,i))return e;this.updatePathProxyAABBBounds(e,i)||(s.segments?this.updateLineAABBBoundsBySegments(s,t,e,i):this.updateLineAABBBoundsByPoints(s,t,e,i));const n=this.tempAABBBounds1,r=this.tempAABBBounds2;n.setValue(e.x1,e.y1,e.x2,e.y2),r.setValue(e.x1,e.y1,e.x2,e.y2);const{lineJoin:a=t.lineJoin}=s;return this.transformAABBBounds(s,e,t,a==="miter",i),e}updateLineAABBBoundsByPoints(s,t,e,i){const{points:n=t.points}=s,r=e;return n.forEach(a=>{r.add(a.x,a.y)}),r}updateLineAABBBoundsBySegments(s,t,e,i){const{segments:n=t.segments}=s,r=e;return n.forEach(a=>{a.points.forEach(o=>{r.add(o.x,o.y)})}),r}updateAreaAABBBounds(s,t,e,i){if(!this._validCheck(s,t,e,i))return e;this.updatePathProxyAABBBounds(e,i)||(s.segments?this.updateAreaAABBBoundsBySegments(s,t,e,i):this.updateAreaAABBBoundsByPoints(s,t,e,i));const n=this.tempAABBBounds1,r=this.tempAABBBounds2;n.setValue(e.x1,e.y1,e.x2,e.y2),r.setValue(e.x1,e.y1,e.x2,e.y2);const{lineJoin:a=t.lineJoin}=s;return this.transformAABBBounds(s,e,t,a==="miter",i),e}updateAreaAABBBoundsByPoints(s,t,e,i){const{points:n=t.points}=s,r=e;return n.forEach(a=>{var o,l;r.add(a.x,a.y),r.add((o=a.x1)!==null&&o!==void 0?o:a.x,(l=a.y1)!==null&&l!==void 0?l:a.y)}),r}updateAreaAABBBoundsBySegments(s,t,e,i){const{segments:n=t.segments}=s,r=e;return n.forEach(a=>{a.points.forEach(o=>{var l,h;r.add(o.x,o.y),r.add((l=o.x1)!==null&&l!==void 0?l:o.x,(h=o.y1)!==null&&h!==void 0?h:o.y)})}),r}updateCircleAABBBounds(s,t,e,i,n){if(!this._validCheck(s,t,e,n))return e;this.updatePathProxyAABBBounds(e,n)||(i?this.updateCircleAABBBoundsImprecise(s,t,e,n):this.updateCircleAABBBoundsAccurate(s,t,e,n));const r=this.tempAABBBounds1,a=this.tempAABBBounds2;return r.setValue(e.x1,e.y1,e.x2,e.y2),a.setValue(e.x1,e.y1,e.x2,e.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach(o=>{o.updateBounds(s,t,r,n),e.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2)}),this.transformAABBBounds(s,e,t,!1,n),e}updateCircleAABBBoundsImprecise(s,t,e,i){const{radius:n=t.radius}=s;return e.set(-n,-n,n,n),e}updateCircleAABBBoundsAccurate(s,t,e,i){const{startAngle:n=t.startAngle,endAngle:r=t.endAngle,radius:a=t.radius}=s;return r-n>jt-re?e.set(-a,-a,a,a):c0(n,r,a,e),e}updateArcAABBBounds(s,t,e,i,n){if(!this._validCheck(s,t,e,n))return e;this.updatePathProxyAABBBounds(e,n)||(i?this.updateArcAABBBoundsImprecise(s,t,e,n):this.updateArcAABBBoundsAccurate(s,t,e,n));const r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(e.x1,e.y1,e.x2,e.y2),a.setValue(e.x1,e.y1,e.x2,e.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach(l=>{l.updateBounds(s,t,r,n),e.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2)});const{lineJoin:o=t.lineJoin}=s;return this.transformAABBBounds(s,e,t,o==="miter",n),e}updateArcAABBBoundsImprecise(s,t,e,i){const{innerRadius:n=t.innerRadius}=s;let{outerRadius:r=t.outerRadius}=s;return r<n&&(r=n),e.set(-r,-r,r,r),e}updateArcAABBBoundsAccurate(s,t,e,i){let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=s;if(n<r){const l=n;n=r,r=l}let{endAngle:a=t.endAngle,startAngle:o=t.startAngle}=s;if(o>a){const l=o;o=a,a=l}return n<=re?e.set(0,0,0,0):Math.abs(a-o)>jt-re?e.set(-n,-n,n,n):(c0(o,a,n,e),c0(o,a,r,e)),e}updateSymbolAABBBounds(s,t,e,i,n){if(!this._validCheck(s,t,e,n))return e;this.updatePathProxyAABBBounds(e,n)||(i?this.updateSymbolAABBBoundsImprecise(s,t,e,n):this.updateSymbolAABBBoundsAccurate(s,t,e,n));const r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(e.x1,e.y1,e.x2,e.y2),a.setValue(e.x1,e.y1,e.x2,e.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach(l=>{l.updateBounds(s,t,r,n),e.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2)});const{lineJoin:o=t.lineJoin}=s;return this.transformAABBBounds(s,e,t,o==="miter",n),e}updateSymbolAABBBoundsImprecise(s,t,e,i){const{size:n=t.size}=s;if($(n))e.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const r=n/2;e.set(-r,-r,r,r)}return e}updateSymbolAABBBoundsAccurate(s,t,e,i){if(!i)return e;const{size:n=t.size}=s;return i.getParsedPath().bounds(n,e),e}updateImageAABBBounds(s,t,e,i){if(!this._validCheck(s,t,e,i))return e;if(!this.updatePathProxyAABBBounds(e,i)){const{width:a=t.width,height:o=t.height}=s;e.set(0,0,a,o)}const n=this.tempAABBBounds1,r=this.tempAABBBounds2;return n.setValue(e.x1,e.y1,e.x2,e.y2),r.setValue(e.x1,e.y1,e.x2,e.y2),this.transformAABBBounds(s,e,t,!1,i),e}combindShadowAABBBounds(s,t){if(t&&t.shadowRoot){const e=t.shadowRoot.AABBBounds;s.union(e)}}transformAABBBounds(s,t,e,i,n){const{scaleX:r=e.scaleX,scaleY:a=e.scaleY,stroke:o=e.stroke,shadowBlur:l=e.shadowBlur,lineWidth:h=e.lineWidth,pickStrokeBuffer:d=e.pickStrokeBuffer,strokeBoundsBuffer:u=e.strokeBoundsBuffer}=s,c=this.tempAABBBounds1,p=this.tempAABBBounds2;if(o&&h){const _=(h+d)/Math.abs(r+a);cg(c,_,i,u),t.union(c),c.setValue(p.x1,p.y1,p.x2,p.y2)}if(l){const{shadowOffsetX:_=e.shadowOffsetX,shadowOffsetY:m=e.shadowOffsetY}=s,v=l/Math.abs(r+a)*2;cg(c,v,!1,u+1),c.translate(_,m),t.union(c)}this.combindShadowAABBBounds(t,n);let g=!0;const f=n.transMatrix;n&&n.isContainer&&(g=!(f.a===1&&f.b===0&&f.c===0&&f.d===1&&f.e===0&&f.f===0)),g&&ly(t,t,f)}_validCheck(s,t,e,i){if(!i)return!0;if(!i.valid)return e.clear(),!1;const{visible:n=t.visible}=s;return!!n||(e.clear(),!1)}};ib=sW([ft(),rW(0,Bt(aO)),nW("design:paramtypes",[Object])],ib);class cW{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}}const _t=new cW;let Op,Ip;function Ec(s){return Op||(Op=_t.CreateGraphic("text",{})),Op.initAttributes(s),Op.AABBBounds}function pW(s){return Ip||(Ip=_t.CreateGraphic("richtext",{})),Ip.setAttributes(s),Ip.AABBBounds}const Ze={x:0,y:0,z:0,lastModelMatrix:null};class vs{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach(e=>this._renderContribitions.push(e)),this._renderContribitions.length&&(this._renderContribitions.sort((e,i)=>i.order-e.order),this._beforeRenderContribitions=this._renderContribitions.filter(e=>e.time===Ti.beforeFillStroke),this._afterRenderContribitions=this._renderContribitions.filter(e=>e.time===Ti.afterFillStroke))}beforeRenderStep(t,e,i,n,r,a,o,l,h,d,u,c,p){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach(g=>{g.drawShape(t,e,i,n,r,a,o,l,h,d,u,c,p)})}afterRenderStep(t,e,i,n,r,a,o,l,h,d,u,c,p){this._afterRenderContribitions&&this._afterRenderContribitions.forEach(g=>{g.drawShape(t,e,i,n,r,a,o,l,h,d,u,c,p)})}valid(t,e,i,n){const{fill:r=e.fill,background:a,stroke:o=e.stroke,opacity:l=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:d=e.lineWidth,strokeOpacity:u=e.strokeOpacity,visible:c=e.visible}=t.attribute,p=To(l,h,r),g=dS(l,u),f=zo(r,a),_=qh(o,d);return!(!t.valid||!c)&&!(!f&&!_)&&!!(p||g||i||n||a)&&{fVisible:p,sVisible:g,doFill:f,doStroke:_}}transform(t,e,i,n=!1){const{x:r=e.x,y:a=e.y,z:o=e.z,scaleX:l=e.scaleX,scaleY:h=e.scaleY,angle:d=e.angle,postMatrix:u}=t.attribute,c=i.modelMatrix,p=i.camera;Ze.x=r,Ze.y=a,Ze.z=o,Ze.lastModelMatrix=c;const g=p&&(n||uW(t)),f=g?t.transMatrix.onlyTranslate()&&!u:l===1&&h===1&&d===0&&!u;if(g){const _=ve.allocate(),m=ve.allocate();wO(m,t,e),Pc(_,c||_,m),Ze.x=0,Ze.y=0,Ze.z=0,i.modelMatrix=_,i.setTransform(1,0,0,1,0,0,!0),ve.free(m)}if(f&&!c){const _=t.getOffsetXY(e);Ze.x+=_.x,Ze.y+=_.y,Ze.z=o,i.setTransformForCurrent()}else if(g)Ze.x=0,Ze.y=0,Ze.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(p&&i.project){const _=t.getOffsetXY(e);Ze.x+=_.x,Ze.y+=_.y,this.transformWithoutTranslate(i,Ze.x,Ze.y,Ze.z,l,h,d)}else i.transformFromMatrix(t.transMatrix,!0),Ze.x=0,Ze.y=0,Ze.z=0;return Ze}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const a=t.AABBBounds,o=a.x2-a.x1,l=a.y2-a.y1,h=n.project(0,0,i),d=n.project(o,0,i),u=n.project(o,l,i),c={x:0,y:0},p={x:o,y:0},g={x:o,y:l};n.camera=null;const f=1/(c.x*(g.y-p.y)-p.x*g.y+g.x*p.y+(p.x-g.x)*c.y),_=-(c.y*(u.x-d.x)-p.y*u.x+g.y*d.x+(p.y-g.y)*h.x)*f,m=(p.y*u.y+c.y*(d.y-u.y)-g.y*d.y+(g.y-p.y)*h.y)*f,v=(c.x*(u.x-d.x)-p.x*u.x+g.x*d.x+(p.x-g.x)*h.x)*f,y=-(p.x*u.y+c.x*(d.y-u.y)-g.x*d.y+(g.x-p.x)*h.y)*f,b=(c.x*(g.y*d.x-p.y*u.x)+c.y*(p.x*u.x-g.x*d.x)+(g.x*p.y-p.x*g.y)*h.x)*f,x=(c.x*(g.y*d.y-p.y*u.y)+c.y*(p.x*u.y-g.x*d.y)+(g.x*p.y-p.x*g.y)*h.y)*f;n.setTransform(_,m,v,y,b,x,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,a,o){const l=t.project(e,i,n);t.translate(l.x,l.y,!1),t.scale(r,a,!1),t.rotate(o,!1),t.translate(-l.x,-l.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,r){const{context:a}=n;if(!a)return;a.highPerformanceSave();const o=this.transform(t,e,a,i),{x:l,y:h,z:d,lastModelMatrix:u}=o;this.z=d,jN(t,a,l,h,n,r)||(this.drawShape(t,a,l,h,n,r),this.z=0,a.modelMatrix!==u&&ve.free(a.modelMatrix),a.modelMatrix=u),a.highPerformanceRestore()}}const gW=function(){const s={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i};let t="";function e(b){const x=new Error(t+": "+b);throw x.source=t,x}function i(){const b=p(n);return t.length>0&&e("Invalid input not EOF"),b}function n(){return r("linear",s.linearGradient,a)||r("radial",s.radialGradient,l)||r("conic",s.conicGradient,o)}function r(b,x,S){return function(A,k){const w=v(A);if(w){v(s.startCall)||e("Missing (");const T=k(w);return v(s.endCall)||e("Missing )"),T}}(x,function(A){const k=S();return k&&(v(s.comma)||e("Missing comma before color stops")),{type:b,orientation:k,colorStops:p(g)}})}function a(){return m("directional",s.sideOrCorner,1)||m("angular",s.angleValue,1)}function o(){return m("angular",s.fromAngleValue,1)}function l(){let b,x,S=h();return S&&(b=[],b.push(S),x=t,v(s.comma)&&(S=h(),S?b.push(S):t=x)),b}function h(){let b=function(){const x=m("shape",/^(circle)/i,0);return x&&(x.style=_()||d()),x}()||function(){const x=m("shape",/^(ellipse)/i,0);return x&&(x.style=f()||d()),x}();if(b)b.at=u();else{const x=d();if(x){b=x;const S=u();S&&(b.at=S)}else{const S=c();S&&(b={type:"default-radial",at:S})}}return b}function d(){return m("extent-keyword",s.extentKeywords,1)}function u(){if(m("position",/^at/,0)){const b=c();return b||e("Missing positioning value"),b}}function c(){const b={x:f(),y:f()};if(b.x||b.y)return{type:"position",value:b}}function p(b){let x=b();const S=[];if(x)for(S.push(x);v(s.comma);)x=b(),x?S.push(x):e("One extra comma");return S}function g(){const b=m("hex",s.hexColor,1)||m("rgba",s.rgbaColor,1)||m("rgb",s.rgbColor,1)||m("literal",s.literalColor,0);return b||e("Expected color definition"),b.length=f(),b}function f(){return m("%",s.percentageValue,1)||m("position-keyword",s.positionKeywords,1)||_()}function _(){return m("px",s.pixelValue,1)||m("em",s.emValue,1)}function m(b,x,S){const A=v(x);if(A)return{type:b,value:A[S]}}function v(b){const x=/^[\n\r\t\s]+/.exec(t);x&&y(x[0].length);const S=b.exec(t);return S&&y(S[0].length),S}function y(b){t=t.substr(b)}return function(b){return t=b.toString(),i()}}();class yl{static IsGradient(t){return!(typeof t=="string"&&t.length<10)}static IsGradientStr(t){return typeof t=="string"&&t.length>10}static Parse(t){if(yl.IsGradientStr(t))try{const e=gW(t)[0];if(e){if(e.type==="linear")return yl.ParseLinear(e);if(e.type==="radial")return yl.ParseRadial(e);if(e.type==="conic")return yl.ParseConic(e)}}catch{return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=le/2,r=parseFloat(e.value)/180*le-n;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+jt,stops:i.map(a=>({color:a.value,offset:parseFloat(a.length.value)/100}))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map(i=>({color:i.value,offset:parseFloat(i.length.value)/100}))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=le/2;let r=e.type==="angular"?parseFloat(e.value)/180*le:0;for(;r<0;)r+=jt;for(;r>jt;)r-=jt;let a=0,o=0,l=0,h=0;return r<n?(a=0,o=1,l=Math.sin(r),h=Math.cos(r)):r<le?(a=0,o=0,l=Math.cos(r-n),h=Math.sin(r-n)):r<le+n?(a=1,o=0,l=a-Math.sin(r-le),h=Math.cos(r-le)):(a=1,l=a-Math.cos(r-n-le),h-=Math.sin(r-n-le)),{gradient:"linear",x0:a,y0:o,x1:l,y1:h,stops:i.map(d=>({color:d.value,offset:parseFloat(d.length.value)/100}))}}}function zi(s,t,e){let i=t;const{a:n,b:r,c:a,d:o}=s.currentMatrix,l=Math.sign(n)*Math.sqrt(n*n+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(i=i/Math.abs(l+h)*2*e,i)}function sb(s,t,e,i,n){if(!t||t===!0)return"black";let r,a;if($(t))for(let o=0;o<t.length&&(a=t[o],!a);o++);else a=t;return a=yl.Parse(a),typeof a=="string"?a:(a.gradient==="linear"?r=fW(s,a,e,i,n):a.gradient==="conical"?r=mW(s,a,e,i,n):a.gradient==="radial"&&(r=_W(s,a,e,i,n)),r||"orange")}function fW(s,t,e,i=0,n=0){var r,a,o,l;const h=e.AABBBounds;if(!h)return;let d=h.x2-h.x1,u=h.y2-h.y1,c=h.x1-i,p=h.y1-n;if(e.attribute){const{scaleX:f=1,scaleY:_=1}=e.attribute;if(f*_==0)return;d/=f,u/=_,c/=f,p/=_}const g=s.createLinearGradient(c+((r=t.x0)!==null&&r!==void 0?r:0)*d,p+((a=t.y0)!==null&&a!==void 0?a:0)*u,c+((o=t.x1)!==null&&o!==void 0?o:1)*d,p+((l=t.y1)!==null&&l!==void 0?l:0)*u);return t.stops.forEach(f=>{g.addColorStop(f.offset,f.color)}),g}function _W(s,t,e,i=0,n=0){var r,a,o,l,h,d;const u=e.AABBBounds;if(!u)return;let c=u.x2-u.x1,p=u.y2-u.y1,g=u.x1-i,f=u.y1-n;if(e.attribute){const{scaleX:m=1,scaleY:v=1}=e.attribute;if(m*v==0)return;g/=m,f/=v,c/=m,p/=v}const _=s.createRadialGradient(g+((r=t.x0)!==null&&r!==void 0?r:.5)*c,f+((a=t.y0)!==null&&a!==void 0?a:.5)*p,Math.max(c,p)*((o=t.r0)!==null&&o!==void 0?o:0),g+((l=t.x1)!==null&&l!==void 0?l:.5)*c,f+((h=t.y1)!==null&&h!==void 0?h:.5)*p,Math.max(c,p)*((d=t.r1)!==null&&d!==void 0?d:.5));return t.stops.forEach(m=>{_.addColorStop(m.offset,m.color)}),_}function mW(s,t,e,i=0,n=0){var r,a;const o=e.AABBBounds;if(!o)return;let l=o.x2-o.x1,h=o.y2-o.y1,d=o.x1-i,u=o.y1-n;if(e.attribute){const{scaleX:p=1,scaleY:g=1}=e.attribute;if(p*g==0)return;l/=p,h/=g,d/=p,u/=g}const c=s.createConicGradient(d+((r=t.x)!==null&&r!==void 0?r:0)*l,u+((a=t.y)!==null&&a!==void 0?a:0)*h,t.startAngle,t.endAngle);return t.stops.forEach(p=>{c.addColorStop(p.offset,p.color)}),c.GetPattern(l+d,h+u,void 0)}var vW=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},yW=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},hw=function(s,t){return function(e,i){t(e,i,s)}};class Rc{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,a,o,l,h,d,u,c,p){const{background:g,backgroundMode:f=h.backgroundMode,backgroundFit:_=h.backgroundFit}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const m=t.resources.get(g);if(m.state!=="success"||!m.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const y=at(t.parent).group,{scrollX:b=y.scrollX,scrollY:x=y.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(b,x)}e.clip();const v=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),this.doDrawImage(e,m.data,v,f,_),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n,r){if(n==="no-repeat")t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const a=i.width(),o=i.height();let l=a,h=o;if(r&&n!=="repeat"&&(e.width||e.height)){const c=e.width,p=e.height;n==="repeat-x"?(l=c*(o/p),h=o):n==="repeat-y"&&(h=p*(a/c),l=a);const g=t.dpr,f=Th.allocate({width:l,height:h,dpr:g}),_=f.getContext("2d");_&&(_.inuse=!0,_.clearMatrix(),_.setTransformForCurrent(!0),_.clearRect(0,0,l,h),_.drawImage(e,0,0,l,h),e=f.nativeCanvas),Th.free(f)}const d=t.dpr,u=t.createPattern(e,n);u.setTransform&&u.setTransform(new DOMMatrix([1/d,0,0,1/d,0,0])),t.fillStyle=u,t.translate(i.x1,i.y1),t.fillRect(0,0,a,o),t.translate(-i.x1,-i.y1)}}}const Ho=new Rc;let dn=class{constructor(s){this.subRenderContribitions=s,this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(s,t,e,i,n,r,a,o,l,h,d,u,c){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach(p=>{p.render(s,t,e,i,n,r,a,o,l,h,d,u,c)})}};dn=vW([ft(),hw(0,Bt(oi)),hw(0,wi(cS)),yW("design:paramtypes",[Object])],dn);class vS{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const a=(t-2*e)/2,o=n.dpr,l=Th.allocate({width:t,height:t,dpr:o}),h=l.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),r(a,h);const d=n.createPattern(l.nativeCanvas,"repeat");return d.setTransform&&d.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),Th.free(l),d}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,(r,a)=>{a.fillStyle=i,a.arc(r,r,r,0,jt),a.fill()})}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,(r,a)=>{const o=t/2,l=o;a.fillStyle=i,a.moveTo(o,l-r),a.lineTo(r+o,l),a.lineTo(o,l+r),a.lineTo(o-r,l),a.closePath(),a.fill()})}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,(r,a)=>{const o=e,l=o;a.fillStyle=i,a.fillRect(o,l,2*r,2*r)})}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,(r,a)=>{const o=e;a.fillStyle=i,a.fillRect(o,0,2*r,t)})}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,(r,a)=>{const o=e;a.fillStyle=i,a.fillRect(0,o,t,2*r)})}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,(r,a)=>{a.strokeStyle=i,a.lineWidth=r,a.moveTo(0,0),a.lineTo(t,t);const o=t/2,l=-o;a.moveTo(o,l),a.lineTo(o+t,l+t),a.moveTo(-o,-l),a.lineTo(-o+t,-l+t),a.stroke()})}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,(r,a)=>{a.strokeStyle=i,a.lineWidth=r,a.moveTo(t,0),a.lineTo(0,t);const o=t/2,l=o;a.moveTo(t+o,l),a.lineTo(o,l+t),a.moveTo(t-o,-l),a.lineTo(-o,-l+t),a.stroke()})}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,(r,a)=>{const o=e,l=o;a.fillStyle=i,a.fillRect(o,l,r,r),a.fillRect(o+r,l+r,r,r)})}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,a,o,l,h,d,u,c,p){this.textureMap||this.initTextureMap(e,t.stage);const{texture:g=h.texture,textureColor:f=h.textureColor,textureSize:_=h.textureSize,texturePadding:m=h.texturePadding}=t.attribute;g&&this.drawTexture(g,t,e,i,n,h,f,_,m)}drawTexture(t,e,i,n,r,a,o,l,h){let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(l,h,o,i);break;case"diamond":d=this.createDiamondPattern(l,h,o,i);break;case"rect":d=this.createRectPattern(l,h,o,i);break;case"vertical-line":d=this.createVerticalLinePattern(l,h,o,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(l,h,o,i);break;case"bias-lr":d=this.createBiasLRLinePattern(l,h,o,i);break;case"bias-rl":d=this.createBiasRLLinePattern(l,h,o,i);break;case"grid":d=this.createGridPattern(l,h,o,i)}d&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,r,a),i.fillStyle=d,i.fill(),i.highPerformanceRestore())}}const Zh=new vS;class bW{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,a,o,l,h,d,u,c){const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&p.visible!==!1,_=g&&g.visible!==!1;if(!f&&!_)return;const{innerRadius:m=h.innerRadius,outerRadius:v=h.outerRadius,startAngle:y=h.startAngle,endAngle:b=h.endAngle,opacity:x=h.opacity,x:S=h.x,y:A=h.y,scaleX:k=h.scaleX,scaleY:w=h.scaleY}=t.attribute,T=!(!p||!p.stroke),M=!(!g||!g.stroke);if(f){const{distance:C=h.outerBorder.distance}=p,R=zi(e,C,e.dpr),I=C/v;if(t.setAttributes({outerRadius:v+R,innerRadius:m-R,startAngle:y-I,endAngle:b+I}),e.beginPath(),$g(t,e,i,n,v+R,m-R),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,p,h.outerBorder);else if(T){const O=h.outerBorder.opacity;h.outerBorder.opacity=x,e.setStrokeStyle(t,p,(S-i)/k,(A-n)/w,h.outerBorder),h.outerBorder.opacity=O,e.stroke()}}if(_){const{distance:C=h.innerBorder.distance}=g,R=zi(e,C,e.dpr),I=C/v;if(t.setAttributes({outerRadius:v-R,innerRadius:m+R,startAngle:y+I,endAngle:b-I}),e.beginPath(),$g(t,e,i,n,v-R,m+R),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,g,h.innerBorder);else if(M){const O=h.innerBorder.opacity;h.innerBorder.opacity=x,e.setStrokeStyle(t,g,(S-i)/k,(A-n)/w,h.innerBorder),h.innerBorder.opacity=O,e.stroke()}}t.setAttributes({outerRadius:v,innerRadius:m,startAngle:y,endAngle:b})}}const xW=new bW,SW=Zh,AW=Ho;class kW{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,a,o,l,h,d,u,c){const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&p.visible!==!1,_=g&&g.visible!==!1;if(!f&&!_)return;const{radius:m=h.radius,startAngle:v=h.startAngle,endAngle:y=h.endAngle,opacity:b=h.opacity,x=h.x,y:S=h.y,scaleX:A=h.scaleX,scaleY:k=h.scaleY}=t.attribute,w=!(!p||!p.stroke),T=!(!g||!g.stroke);if(f){const{distance:M=h.outerBorder.distance}=p,C=zi(e,M,e.dpr);if(e.beginPath(),e.arc(i,n,m+C,v,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,p,h.outerBorder);else if(w){const R=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(S-n)/k,h.outerBorder),h.outerBorder.opacity=R,e.stroke()}}if(_){const{distance:M=h.innerBorder.distance}=g,C=zi(e,M,e.dpr);if(e.beginPath(),e.arc(i,n,m-C,v,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,g,h.innerBorder);else if(T){const R=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,g,(x-i)/A,(S-n)/k,h.innerBorder),h.innerBorder.opacity=R,e.stroke()}}}}const wW=new kW,TW=Zh,MW=Ho;class CW extends Rc{constructor(){super(...arguments),this.time=Ti.beforeFillStroke}drawShape(t,e,i,n,r,a,o,l,h,d,u,c){const{background:p,backgroundMode:g=h.backgroundMode,backgroundFit:f=h.backgroundFit}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const _=t.resources.get(p);if(_.state!=="success"||!_.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const m=t.AABBBounds;this.doDrawImage(e,_.data,m,g,f),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}}const PW=new CW,Lp=le/2;function Co(s,t,e,i,n,r){let a;if(i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n),dt(r,!0))a=[r=Kt(r),r,r,r];else if(Array.isArray(r)){const x=r;let S,A;switch(x.length){case 0:a=[0,0,0,0];break;case 1:S=Kt(x[0]),a=[S,S,S,S];break;case 2:case 3:S=Kt(x[0]),A=Kt(x[1]),a=[S,A,S,A];break;default:a=x,a[0]=Kt(a[0]),a[1]=Kt(a[1]),a[2]=Kt(a[2]),a[3]=Kt(a[3])}}else a=[0,0,0,0];if(i<0||a[0]+a[1]+a[2]+a[3]<1e-12)return s.rect(t,e,i,n);const[o,l,h,d]=[[t,e],[t+i,e],[t+i,e+n],[t,e+n]],u=Math.min(i/2,n/2),c=[Math.min(u,a[0]),Math.min(u,a[1]),Math.min(u,a[2]),Math.min(u,a[3])],p=[o[0]+c[0],o[1]],g=[o[0],o[1]+c[0]],f=[l[0]-c[1],l[1]],_=[l[0],l[1]+c[1]],m=[h[0]-c[2],h[1]],v=[h[0],h[1]-c[2]],y=[d[0]+c[3],d[1]],b=[d[0],d[1]-c[3]];if(s.moveTo(p[0],p[1]),s.lineTo(f[0],f[1]),!hp(f,_)){const x=f[0],S=f[1]+c[1];s.arc(x,S,c[1],-Lp,0,!1)}if(s.lineTo(v[0],v[1]),!hp(m,v)){const x=v[0]-c[2],S=v[1];s.arc(x,S,c[2],0,Lp,!1)}if(s.lineTo(y[0],y[1]),!hp(y,b)){const x=y[0],S=y[1]-c[3];s.arc(x,S,c[3],Lp,le,!1)}if(s.lineTo(g[0],g[1]),!hp(p,g)){const x=p[0],S=p[1]+c[0];s.arc(x,S,c[0],le,le+Lp,!1)}return s.closePath(),s}class EW extends Rc{constructor(){super(...arguments),this.time=Ti.beforeFillStroke}drawShape(t,e,i,n,r,a,o,l,h,d,u,c){const{background:p,backgroundMode:g=h.backgroundMode,backgroundFit:f=h.backgroundFit}=t.attribute;if(p)if(t.backgroundImg){const _=t.resources.get(p);if(_.state!=="success"||!_.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const v=at(t.parent).group,{scrollX:y=v.scrollX,scrollY:b=v.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(y,b)}const m=t.AABBBounds;this.doDrawImage(e,_.data,m,g,f),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if($t(p)){const{stroke:_,fill:m,lineWidth:v=1,cornerRadius:y=0,expandX:b=0,expandY:x=0}=p;if(!_&&!m)return;e.beginPath();const{x:S,y:A,width:k,height:w}=RW(t);y?Co(e,S-b,A-x,k+2*b,w+2*x,y):e.rect(S-b,A-x,k+2*b,w+2*x),e.globalAlpha=1,m&&(e.fillStyle=m,e.fill()),_&&v>0&&(e.lineWidth=v,e.strokeStyle=_,e.stroke())}else{e.beginPath();const _=t.AABBBounds;e.rect(i,n,_.width(),_.height()),e.fillStyle=p,e.globalAlpha=1,e.fill()}}}function RW(s){const t=Ei(s.attribute.boundsPadding),e=s.AABBBounds;let i=e.x1,n=e.y1,r=e.width(),a=e.height();return dt(t)?(i+=t,n+=t,r-=2*t,a-=2*t):(i+=t[3],n+=t[0],r-=t[1]+t[3],a-=t[0]+t[2]),{x:i,y:n,width:r,height:a}}const OW=new EW;var TO=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};class IW{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,a,o,l,h,d,u,c){const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&p.visible!==!1,_=g&&g.visible!==!1;if(!f&&!_)return;const{cornerRadius:m=h.cornerRadius,opacity:v=h.opacity,x:y=h.x,y:b=h.y,scaleX:x=h.scaleX,scaleY:S=h.scaleY,x1:A,y1:k}=t.attribute;let{width:w,height:T}=t.attribute;w=(w??A-i)||0,T=(T??k-n)||0;const M=!(!p||!p.stroke),C=!(!g||!g.stroke);if(f){const{distance:R=h.outerBorder.distance}=p,I=zi(e,R,e.dpr),O=i-I,L=n-I,D=2*I;if(m===0||$(m)&&m.every(j=>j===0)?(e.beginPath(),e.rect(O,L,w+D,T+D)):(e.beginPath(),Co(e,O,L,w+D,T+D,m)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,p,h.outerBorder);else if(M){const j=h.outerBorder.opacity;h.outerBorder.opacity=v,e.setStrokeStyle(t,p,(y-i)/x,(b-n)/S,h.outerBorder),h.outerBorder.opacity=j,e.stroke()}}if(_){const{distance:R=h.innerBorder.distance}=g,I=zi(e,R,e.dpr),O=i+I,L=n+I,D=2*I;if(m===0||$(m)&&m.every(j=>j===0)?(e.beginPath(),e.rect(O,L,w-D,T-D)):(e.beginPath(),Co(e,O,L,w-D,T-D,m)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,g,h.innerBorder);else if(C){const j=h.innerBorder.opacity;h.innerBorder.opacity=v,e.setStrokeStyle(t,g,(y-i)/x,(b-n)/S,h.innerBorder),h.innerBorder.opacity=j,e.stroke()}}}}let Xg=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(s,t,e,i,n,r,a,o,l,h,d,u,c){const{stroke:p=l.stroke}=s.attribute;Array.isArray(p)&&p.some(g=>g===!1)&&(c.doStroke=!1)}};Xg=TO([ft()],Xg);let Kg=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(s,t,e,i,n,r,a,o,l,h,d,u){const{width:c=l.width,height:p=l.height,stroke:g=l.stroke}=s.attribute;if(Array.isArray(g)&&g.some(f=>f===!1)){if(t.setStrokeStyle(s,s.attribute,e,i,l),t.beginPath(),t.moveTo(e,i),g[0]?t.lineTo(e+c,i):t.moveTo(e+c,i),g[1]?t.lineTo(e+c,i+p):t.moveTo(e+c,i+p),g[2]?t.lineTo(e,i+p):t.moveTo(e,i+p),g[3]){const f=g[0]?i-t.lineWidth/2:i;t.lineTo(e,f)}else t.moveTo(e,i);t.stroke()}}};Kg=TO([ft()],Kg);const LW=new IW,BW=Zh,DW=Ho;class FW{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,a,o,l,h,d,u,c){const p=t.getParsedPath();if(!p)return;const{outerBorder:g,innerBorder:f}=t.attribute,_=g&&g.visible!==!1,m=f&&f.visible!==!1;if(!_&&!m)return;const{size:v=h.size,opacity:y=h.opacity,x:b=h.x,y:x=h.y,scaleX:S=h.scaleX,scaleY:A=h.scaleY}=t.attribute,k=!(!g||!g.stroke),w=!(!f||!f.stroke);if(_){const{distance:T=h.outerBorder.distance}=g,M=zi(e,T,e.dpr);if(e.beginPath(),p.drawOffset(e,v,i,n,M)===!1&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,g,h.outerBorder);else if(k){const C=h.outerBorder.opacity;h.outerBorder.opacity=y,e.setStrokeStyle(t,g,(b-i)/S,(x-n)/A,h.outerBorder),h.outerBorder.opacity=C,e.stroke()}}if(m){const{distance:T=h.innerBorder.distance}=f,M=zi(e,T,e.dpr);if(e.beginPath(),p.drawOffset(e,v,i,n,-M)===!1&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,f,h.innerBorder);else if(w){const C=h.innerBorder.opacity;h.innerBorder.opacity=y,e.setStrokeStyle(t,f,(b-i)/S,(x-n)/A,h.innerBorder),h.innerBorder.opacity=C,e.stroke()}}}}const jW=new FW,zW=Zh,HW=Ho;class NW extends vS{constructor(){super(...arguments),this.time=Ti.afterFillStroke}drawShape(t,e,i,n,r,a,o,l,h,d,u,c,p){var g,f,_,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:v=t.attribute}=p||{},{texture:y=(g=t.attribute.texture)!==null&&g!==void 0?g:Cp(h,"texture"),textureColor:b=(f=t.attribute.textureColor)!==null&&f!==void 0?f:Cp(h,"textureColor"),textureSize:x=(_=t.attribute.textureSize)!==null&&_!==void 0?_:Cp(h,"textureSize"),texturePadding:S=(m=t.attribute.texturePadding)!==null&&m!==void 0?m:Cp(h,"texturePadding")}=v;y&&this.drawTexture(y,t,e,i,n,h,b,x,S)}}var GW=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},WW=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},dw=function(s,t){return function(e,i){t(e,i,s)}};let qg=class extends vs{constructor(s){super(),this.arcRenderContribitions=s,this.numberType=dm,this.builtinContributions=[xW,AW,SW],this.init(s)}drawArcTailCapPath(s,t,e,i,n,r,a,o){const l=o-a,h=s.getParsedAngle(),d=h.startAngle;let u=h.endAngle;u=o;const c=Kt(u-d),p=u>d;let g=!1;if(n<r){const X=n;n=r,r=X}const f=s.getParsedCornerRadius(),{outerDeltaAngle:_,innerDeltaAngle:m,outerStartAngle:v,outerEndAngle:y,innerEndAngle:b,innerStartAngle:x}=s.getParsePadAngle(d,u),S=f,A=f,k=f,w=f,T=Math.max(A,S),M=Math.max(k,w);let C=T,R=M;const I=n*de(v),O=n*se(v),L=r*de(b),D=r*se(b);let j,H,W,V;if((M>re||T>re)&&(j=n*de(y),H=n*se(y),W=r*de(x),V=r*se(x),c<le)){const X=pO(I,O,W,V,j,H,L,D);if(X){const Q=I-X[0],J=O-X[1],nt=j-X[0],q=H-X[1],U=1/se(_E((Q*nt+J*q)/(fs(Q*Q+J*J)*fs(nt*nt+q*q)))/2),it=fs(X[0]*X[0]+X[1]*X[1]);R=Ci(M,(r-it)/(U-1)),C=Ci(T,(n-it)/(U+1))}}if(C>re){const X=Ci(S,C),Q=Ci(A,C),J=pa(W,V,I,O,n,X,Number(p)),nt=pa(j,H,L,D,n,Q,Number(p));if(C<T&&X===Q)t.moveTo(e+J.cx+J.x01,i+J.cy+J.y01),t.arc(e+J.cx,i+J.cy,C,he(J.y01,J.x01),he(nt.y01,nt.x01),!p);else{const q=u-l-.03,U=he(nt.y11,nt.x11);t.arc(e,i,n,q,U,!p),Q>0&&t.arc(e+nt.cx,i+nt.cy,Q,he(nt.y11,nt.x11),he(nt.y01,nt.x01),!p)}}else t.moveTo(e+I,i+O);if(!(r>re)||m<.001)t.lineTo(e+L,i+D),g=!0;else if(R>re){const X=Ci(w,R),Q=Ci(k,R),J=pa(L,D,j,H,r,-Q,Number(p)),nt=pa(I,O,W,V,r,-X,Number(p));if(t.lineTo(e+J.cx+J.x01,i+J.cy+J.y01),R<M&&X===Q){const q=he(nt.y01,nt.x01);t.arc(e+J.cx,i+J.cy,R,he(J.y01,J.x01),q,!p)}else{Q>0&&t.arc(e+J.cx,i+J.cy,Q,he(J.y01,J.x01),he(J.y11,J.x11),!p);const q=he(J.cy+J.y11,J.cx+J.x11),U=u-l-.03;t.arc(e,i,r,q,U,p)}}else t.lineTo(e+r*de(x),i+r*se(x));return g}drawShape(s,t,e,i,n,r,a,o){const l=at(s,r==null?void 0:r.theme).arc,{fill:h=l.fill,stroke:d=l.stroke,x:u=l.x,y:c=l.y}=s.attribute,p=this.valid(s,l,a,o);if(!p)return;const{fVisible:g,sVisible:f,doFill:_,doStroke:m}=p,{outerRadius:v=l.outerRadius,innerRadius:y=l.innerRadius,cap:b=l.cap,forceShowCap:x=l.forceShowCap}=s.attribute;let S=0;const A=(ye(b)&&b||b[0])&&h.gradient==="conical";if(A){const{sc:M,startAngle:C,endAngle:R}=s.getParsedAngle();Kt(R-C)<jt-re&&(S=M||0,h.startAngle-=S,h.endAngle-=S)}let k=!1;const{isFullStroke:w,stroke:T}=jH(d);if((_||w)&&(t.beginPath(),$g(s,t,e,i,v,y),k=!0,t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,l),this.beforeRenderStep(s,t,e,i,_,m,g,f,l,n,a,o),_&&(a?a(t,s.attribute,l):g&&(t.setCommonStyle(s,s.attribute,u-e,c-i,l),t.fill())),m&&w&&(o?o(t,s.attribute,l):f&&(t.setStrokeStyle(s,s.attribute,u-e,c-i,l),t.stroke()))),!w&&m&&(t.beginPath(),$g(s,t,e,i,v,y,T),k||this.beforeRenderStep(s,t,e,i,_,m,g,f,l,n,a,o),o?o(t,s.attribute,l):f&&(t.setStrokeStyle(s,s.attribute,e,i,l),t.stroke())),(ye(b)&&b||b[1])&&x){const{startAngle:M,endAngle:C}=s.getParsedAngle();if(Kt(C-M)>=jt-re){t.beginPath();const R=Math.abs(v-y)/2/v,{endAngle:I=l.endAngle,fill:O=l.fill}=s.attribute,L=I;if(this.drawArcTailCapPath(s,t,e,i,v,y,L,L+R),k||this.beforeRenderStep(s,t,e,i,_,m,g,f,l,n,a,o),_){const D=O;if(D.gradient==="conical"){const j=zN(0,0,I,D);a||To&&(t.setCommonStyle(s,s.attribute,e,i,l),t.fillStyle=j,t.fill())}}m&&(o||f&&(t.setStrokeStyle(s,s.attribute,e,i,l),t.stroke()))}}this.afterRenderStep(s,t,e,i,_,m,g,f,l,n,a,o),A&&(h.startAngle+=S,h.endAngle+=S)}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).arc;this._draw(s,n,!1,e,i)}};qg=GW([ft(),dw(0,Bt(oi)),dw(0,wi(Wy)),WW("design:paramtypes",[Object])],qg);var VW=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},UW=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},uw=function(s,t){return function(e,i){t(e,i,s)}};let Zg=class extends vs{constructor(s){super(),this.circleRenderContribitions=s,this.numberType=um,this.builtinContributions=[wW,MW,TW],this.init(s)}drawShape(s,t,e,i,n,r,a,o){const l=at(s,r==null?void 0:r.theme).circle,{radius:h=l.radius,startAngle:d=l.startAngle,endAngle:u=l.endAngle,x:c=l.x,y:p=l.y}=s.attribute,g=this.valid(s,l,a,o);if(!g)return;const{fVisible:f,sVisible:_,doFill:m,doStroke:v}=g;t.beginPath(),t.arc(e,i,h,d,u),t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,l),this.beforeRenderStep(s,t,e,i,m,v,f,_,l,n,a,o),m&&(a?a(t,s.attribute,l):f&&(t.setCommonStyle(s,s.attribute,c-e,p-i,l),t.fill())),v&&(o?o(t,s.attribute,l):_&&(t.setStrokeStyle(s,s.attribute,c-e,p-i,l),t.stroke())),this.afterRenderStep(s,t,e,i,m,v,f,_,l,n,a,o)}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).circle;this._draw(s,n,!1,e,i)}};Zg=VW([ft(),uw(0,Bt(oi)),uw(0,wi(Uy)),UW("design:paramtypes",[Object])],Zg);function Jg(s,t,e,i){if(!t.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=i||{};if(e===1)t.p2&&t.p3?s.bezierCurveTo(n+t.p1.x,r+t.p1.y,n+t.p2.x,r+t.p2.y,n+t.p3.x,r+t.p3.y,a):s.lineTo(n+t.p1.x,r+t.p1.y,a);else if(t.p2&&t.p3){const[o]=Cy(t,e);s.bezierCurveTo(n+o.p1.x,r+o.p1.y,n+o.p2.x,r+o.p2.y,n+o.p3.x,r+o.p3.y,a)}else{const o=t.getPointAt(e);s.lineTo(n+o.x,r+o.y,a)}}function nb(s,t,e,i,n){var r;const{offsetX:a=0,offsetY:o=0,offsetZ:l=0,mode:h="none",drawConnect:d=!1,zeroX:u=0,zeroY:c=0}=n||{};if(d&&h==="none"||!t)return;let p=!0;const{curves:g}=t;if(e>=1){if(d){let b,x=!0;g.forEach((S,A)=>{var k;let w=S.p0;if(S.originP1!==S.originP2){if(b&&b.originP1===b.originP2&&(w=b.p0),S.defined)x||(s.lineTo(w.x+a,w.y+o,l),x=!x);else{const{originP1:T,originP2:M}=S;let C;if(T&&T.defined!==!1?C=w:T&&M.defined!==!1&&(C=(k=S.p3)!==null&&k!==void 0?k:S.p1),x){x=!x;const R=C?C.x:S.p0.x,I=C?C.y:S.p0.y;s.moveTo(R+a,I+o,l)}else C&&(x=!x,s.lineTo(C.x+a,C.y+o,l))}b=S}else b=S})}else g.forEach(b=>{b.defined?(p&&s.moveTo(b.p0.x+a,b.p0.y+o,l),Jg(s,b,1,n),p=!1):p=!0});return}if(e<=0)return;let f;i==="x"?f=Te.ROW:i==="y"?f=Te.COLUMN:i==="auto"&&(f=t.direction);const _=e*t.tryUpdateLength(f);let m=0,v=!0,y=null;for(let b=0,x=g.length;b<x;b++){const S=g[b],A=S.getLength(f),k=(_-m)/A;if(m+=A,k<0)break;if(d){let w=S.p0;if(S.originP1===S.originP2){y=S;continue}if(y&&y.originP1===y.originP2&&(w=y.p0),S.defined)v||(s.lineTo(w.x+a,w.y+o,l),v=!v);else{const{originP1:T,originP2:M}=S;let C;if(T&&T.defined!==!1?C=w:T&&M.defined!==!1&&(C=(r=S.p3)!==null&&r!==void 0?r:S.p1),v){v=!v;const R=C?C.x:S.p0.x,I=C?C.y:S.p0.y;s.moveTo(R+a,I+o,l)}else C&&(v=!v,s.lineTo(C.x+a,C.y+o,l))}y=S}else{if(!S.defined){p=!0;continue}p&&s.moveTo(S.p0.x+a,S.p0.y+o,l),Jg(s,S,Ci(k,1),n),p=!1}}}function $W(s,t,e,i){const{offsetX:n=0,offsetY:r=0}=i||{},a=t?t.points[t.points.length-1]:e.points[0];s.moveTo(a.x+n,a.y+r),e.points.forEach(o=>{o.defined!==!1?s.lineTo(o.x+n,o.y+r):s.moveTo(o.x+n,o.y+r)})}function YW(s,t,e,i){const{offsetX:n=0,offsetY:r=0}=i||{},{points:a}=e,o=[];for(let l=0;l<a.length;l++)a[l].defined;o.push(a),o.forEach((l,h)=>{var d,u,c,p;const g=t&&h===0?t.points[t.points.length-1]:l[0];s.moveTo(g.x+n,g.y+r),l.forEach(f=>{f.defined!==!1?s.lineTo(f.x+n,f.y+r):s.moveTo(f.x+n,f.y+r)});for(let f=l.length-1;f>=0;f--){const _=l[f];s.lineTo((d=_.x1)!==null&&d!==void 0?d:_.x,(u=_.y1)!==null&&u!==void 0?u:_.y)}s.lineTo((c=g.x1)!==null&&c!==void 0?c:g.x,(p=g.y1)!==null&&p!==void 0?p:g.y),s.closePath()})}var XW=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Bu=class extends vs{constructor(){super(...arguments),this.numberType=Cc}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).line;this._draw(s,n,!1,e,i)}drawSegmentItem(s,t,e,i,n,r,a,o,l,h,d,u,c,p,g){var f,_,m,v,y;if(!t)return;s.beginPath();const b=(f=this.z)!==null&&f!==void 0?f:0;nb(s.camera?s:s.nativeContext,t,l,h,{offsetX:d,offsetY:u,offsetZ:b}),c.cache&&!$(c.cache)&&c.cache.curves.every(M=>M.defined)&&c.attribute.curveType&&c.attribute.curveType.includes("Closed")&&s.closePath(),s.setShadowBlendStyle&&s.setShadowBlendStyle(c,a,o);const{x=0,x:S=0}=a;e!==!1&&(p?p(s,a,o):n&&(s.setCommonStyle(c,a,x-d,S-u,o),s.fill())),i!==!1&&(g?g(s,a,o):r&&(s.setStrokeStyle(c,a,x-d,S-u,o),s.stroke()));let{connectedType:A,connectedX:k,connectedY:w,connectedStyle:T}=a;if($(o)?(A=(_=A??o[0].connectedType)!==null&&_!==void 0?_:o[1].connectedType,k=(m=k??o[0].connectedX)!==null&&m!==void 0?m:o[1].connectedX,w=(v=w??o[0].connectedY)!==null&&v!==void 0?v:o[1].connectedY,T=(y=T??o[0].connectedStyle)!==null&&y!==void 0?y:o[1].connectedStyle):(A=A??o.connectedType,k=k??o.connectedX,w=w??o.connectedY,T=T??o.connectedStyle),A!=="connect"&&A!=="zero"&&(A="none"),A!=="none"){s.beginPath(),nb(s.camera?s:s.nativeContext,t,l,h,{offsetX:d,offsetY:u,offsetZ:b,drawConnect:!0,mode:A,zeroX:k,zeroY:w});const M=[];$(o)?o.forEach(C=>M.push(C)):M.push(o),M.push(a),e!==!1&&(p?p(s,a,o):n&&(s.setCommonStyle(c,T,x-d,S-u,M),s.fill())),i!==!1&&(g?g(s,a,o):r&&(s.setStrokeStyle(c,T,x-d,S-u,M),s.stroke()))}return!1}drawLinearLineHighPerformance(s,t,e,i,n,r,a,o,l,h,d,u,c){var p;t.beginPath();const g=(p=this.z)!==null&&p!==void 0?p:0,{points:f}=s.attribute,_=f[0];t.moveTo(_.x+a,_.y+o,g);for(let y=1;y<f.length;y++){const b=f[y];t.lineTo(b.x+a,b.y+o,g)}t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,l);const{x:m=0,x:v=0}=s.attribute;e!==!1&&(u?u(t,s.attribute,l):n&&(t.setCommonStyle(s,s.attribute,m-a,v-o,l),t.fill())),i!==!1&&(c?c(t,s.attribute,l):r&&(t.setStrokeStyle(s,s.attribute,m-a,v-o,l),t.stroke()))}drawShape(s,t,e,i,n,r,a,o){const l=at(s,r==null?void 0:r.theme).line,{fill:h=l.fill,stroke:d=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:c=l.strokeOpacity,segments:p,points:g,closePath:f}=s.attribute;if(!this.valid(s,l,a,o))return;let{curveType:_=l.curveType}=s.attribute;f&&_==="linear"&&(_="linearClosed");const{clipRange:m=l.clipRange,clipRangeByDimension:v=l.clipRangeByDimension}=s.attribute;if(m===1&&!p&&!g.some(y=>y.defined===!1)&&_==="linear")return this.drawLinearLineHighPerformance(s,t,!!h,!!d,u,c,e,i,l,n,r,a,o);if(s.shouldUpdateShape()){const{points:y,segments:b}=s.attribute,x=y;if(b&&b.length){let S,A;if(s.cache=b.map((k,w)=>{if(k.points.length<=1&&w===0)return k.points[0]&&(A={endX:k.points[0].x,endY:k.points[0].y,curves:[{defined:k.points[0].defined!==!1}]}),null;w===1?S={x:A.endX,y:A.endY,defined:A.curves[A.curves.length-1].defined}:w>1&&(S.x=A.endX,S.y=A.endY,S.defined=A.curves[A.curves.length-1].defined);const T=Ry(k.points,_,{startPoint:S});return A=T,T}).filter(k=>!!k),_==="linearClosed"){let k;for(let w=0;w<s.cache.length;w++){const T=s.cache[w];for(let M=0;M<T.curves.length;M++)if(T.curves[M].defined){k=T.curves[M].p0;break}if(k)break}s.cache[s.cache.length-1]&&s.cache[s.cache.length-1].lineTo(k.x,k.y,!0)}}else{if(!y||!y.length)return s.cache=null,void s.clearUpdateShapeTag();s.cache=Ry(x,_)}s.clearUpdateShapeTag()}if(Array.isArray(s.cache)){const y=s.attribute.segments.filter(b=>b.points.length);if(y[0].points.length===1&&y.shift(),m===1){let b=!1;s.cache.forEach((x,S)=>{b||(b=this.drawSegmentItem(t,x,!!h,!!d,u,c,y[S],[l,s.attribute],m,v,e,i,s,a,o))})}else{const b=s.cache.reduce((k,w)=>k+w.getLength(),0),x=m*b;let S=0,A=!1;s.cache.forEach((k,w)=>{if(A)return;const T=k.getLength(),M=(x-S)/T;S+=T,M>0&&(A=this.drawSegmentItem(t,k,!!h,!!d,u,c,y[w],[l,s.attribute],Ci(M,1),v,e,i,s,a,o))})}}else this.drawSegmentItem(t,s.cache,!!h,!!d,u,c,s.attribute,l,m,v,e,i,s,a,o)}};Bu=XW([ft()],Bu);function KW(s,t,e,i){var n;const{drawConnect:r=!1,mode:a="none"}=i||{};if(r&&a==="none")return;const{top:o,bottom:l}=t;if(o.curves.length!==l.curves.length)return;if(e>=1){const S=[],A=[];let k=!0;if(r){let w,T,M=!0;const C=o.curves.length;o.curves.forEach((R,I)=>{const O=l.curves[C-I-1];let L=R,D=O;if(R.originP1===R.originP2)return w=R,void(T=O);if(w&&w.originP1===w.originP2&&(L=w,D=T),R.defined)M||(S.push(L),A.push(D),Jo(s,S,A,i),S.length=0,A.length=0,M=!M);else{const{originP1:j,originP2:H}=R;let W,V;j&&j.defined!==!1?(W=L,V=D):j&&H.defined!==!1&&(W=R,V=O),M?(M=!M,S.push(W||R),A.push(V||O)):W&&(M=!M,S.push(W||R),A.push(V||O),Jo(s,S,A,i),S.length=0,A.length=0)}w=R}),Jo(s,S,A,i)}else{for(let w=0,T=o.curves.length;w<T;w++){const M=o.curves[w];k!==M.defined?(k?(Bp(s,S,A,i),S.length=0,A.length=0):(S.push(M),A.push(l.curves[T-w-1])),k=!k):k&&(S.push(M),A.push(l.curves[T-w-1]))}Bp(s,S,A,i)}return}if(e<=0)return;let{direction:h}=i||{};const{curves:d}=o,u=(n=d[d.length-1].p3)!==null&&n!==void 0?n:d[d.length-1].p1,c=Kt(u.x-d[0].p0.x),p=Kt(u.y-d[0].p0.y);h=h??(c>p?Te.ROW:Te.COLUMN),Number.isFinite(c)||(h=Te.COLUMN),Number.isFinite(p)||(h=Te.ROW);const g=e*(h===Te.ROW?c:p);let f=0,_=!0;const m=[],v=[];let y,b,x=!0;for(let S=0,A=o.curves.length;S<A;S++){const k=o.curves[S],w=k.getLength(h),T=(g-f)/w;if(T<0)break;if(f+=w,r){const M=l.curves[A-S-1];let C=k,R=M;if(k.originP1===k.originP2){y=k,b=M;continue}if(y&&y.originP1===y.originP2&&(C=y,R=b),k.defined)x||(m.push(C),v.push(R),Jo(s,m,v,i),m.length=0,v.length=0,x=!x);else{const{originP1:I,originP2:O}=k;let L,D;I&&I.defined!==!1?(L=C,D=R):I&&O.defined!==!1&&(L=k,D=M),x?(x=!x,m.push(L||k),v.push(D||M)):L&&(x=!x,m.push(L||k),v.push(D||M),Jo(s,m,v,i),m.length=0,v.length=0)}y=k}else{let M=null,C=null;_!==k.defined?(_?(Bp(s,m,v,i),m.length=0,v.length=0):(M=k,C=l.curves[A-S-1]),_=!_):_&&(M=k,C=l.curves[A-S-1]),M&&C&&(T<1&&(M=M.p2&&M.p3?Cy(M,T)[0]:ik(M,T)[0],C=C.p2&&C.p3?Cy(C,1-T)[1]:ik(C,1-T)[1]),M.defined=_,C.defined=_,m.push(M),v.push(C)),M=null,C=null}}r?Jo(s,m,v,i):Bp(s,m,v,i)}function Jo(s,t,e,i){if(t.length<2)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=i||{};let o=t[0];s.moveTo(o.p0.x+n,o.p0.y+r,a),o=t[t.length-1];let l=o.p3||o.p1;s.lineTo(l.x+n,l.y+r,a),o=e[e.length-1],s.lineTo(o.p0.x+n,o.p0.y+r,a),o=e[0],l=o.p3||o.p1,s.lineTo(l.x+n,l.y+r,a),s.closePath()}function Bp(s,t,e,i){const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=i||{};let o=!0;t.forEach(l=>{l.defined?(o&&s.moveTo(l.p0.x+n,l.p0.y+r,a),Jg(s,l,1,i),o=!1):o=!0}),o=!0;for(let l=e.length-1;l>=0;l--){const h=e[l];h.defined?(o&&s.lineTo(h.p0.x+n,h.p0.y+r,a),Jg(s,h,1,i),o=!1):o=!0}s.closePath()}const qW=new NW,ZW=Ho;var JW=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},QW=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},cw=function(s,t){return function(e,i){t(e,i,s)}};function Dp(s,t,e){switch(t){case"linear":default:return kc(s,e);case"basis":return MR(s,e);case"monotoneX":return PR(s,e);case"monotoneY":return ER(s,e);case"step":return ah(s,.5,e);case"stepBefore":return ah(s,0,e);case"stepAfter":return ah(s,1,e);case"linearClosed":return RR(s,e)}}let Du=class extends vs{constructor(s){super(),this.areaRenderContribitions=s,this.numberType=Mc,this.builtinContributions=[qW,ZW],this.init(s)}drawLinearAreaHighPerformance(s,t,e,i,n,r,a,o,l,h,d,u,c){var p,g,f,_,m;t.beginPath();const v=(p=this.z)!==null&&p!==void 0?p:0,{points:y}=s.attribute,b=y[0];t.moveTo(b.x+a,b.y+o,v);for(let A=1;A<y.length;A++){const k=y[A];t.lineTo(k.x+a,k.y+o,v)}for(let A=y.length-1;A>=0;A--){const k=y[A];t.lineTo(((g=k.x1)!==null&&g!==void 0?g:k.x)+a,((f=k.y1)!==null&&f!==void 0?f:k.y)+o,v)}t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,l),this.beforeRenderStep(s,t,a,o,!!n,!1,e,!1,l,h,u,null,{attribute:s.attribute});const{x=0,x:S=0}=s.attribute;if(e!==!1&&(u?u(t,s.attribute,l):n&&(t.setCommonStyle(s,s.attribute,x-a,S-o,l),t.fill())),this.afterRenderStep(s,t,a,o,!!n,!1,e,!1,l,h,u,null,{attribute:s.attribute}),i){const{stroke:A=l&&l.stroke}=s.attribute;if($(A)&&(A[0]||A[2])&&A[1]===!1){if(t.beginPath(),A[0]){t.moveTo(b.x+a,b.y+o,v);for(let k=1;k<y.length;k++){const w=y[k];t.lineTo(w.x+a,w.y+o,v)}}else if(A[2]){const k=y[y.length-1];t.moveTo(k.x+a,k.y+o,v);for(let w=y.length-2;w>=0;w--){const T=y[w];t.lineTo(((_=T.x1)!==null&&_!==void 0?_:T.x)+a,((m=T.y1)!==null&&m!==void 0?m:T.y)+o,v)}}}c?c(t,s.attribute,l):(t.setStrokeStyle(s,s.attribute,x-a,S-o,l),t.stroke())}}drawShape(s,t,e,i,n,r,a,o){var l,h,d,u,c,p;const g=at(s,r==null?void 0:r.theme).area,{fill:f=g.fill,stroke:_=g.stroke,fillOpacity:m=g.fillOpacity,z:v=g.z,strokeOpacity:y=g.strokeOpacity}=s.attribute,b=this.valid(s,g,a,o);if(!b)return;const{doFill:x,doStroke:S}=b,{clipRange:A=g.clipRange,closePath:k,points:w,segments:T}=s.attribute;let{curveType:M=g.curveType}=s.attribute;if(k&&M==="linear"&&(M="linearClosed"),A===1&&!T&&!w.some(C=>C.defined===!1)&&M==="linear")return this.drawLinearAreaHighPerformance(s,t,!!f,S,m,y,e,i,g,n,r,a,o);if(s.shouldUpdateShape()){if(T&&T.length){let C,R;const I=T.map((D,j)=>{if(D.points.length<=1&&j===0)return D.points[0]&&(R={endX:D.points[0].x,endY:D.points[0].y}),null;j===1?C={x:R.endX,y:R.endY}:j>1&&(C.x=R.endX,C.y=R.endY);const H=Dp(D.points,M,{startPoint:C});return R=H,H}).filter(D=>!!D);let O;const L=[];for(let D=T.length-1;D>=0;D--){const j=T[D].points,H=[];for(let W=j.length-1;W>=0;W--)H.push({x:(l=j[W].x1)!==null&&l!==void 0?l:j[W].x,y:(h=j[W].y1)!==null&&h!==void 0?h:j[W].y});if(D!==0){const W=T[D-1].points,V=W[W.length-1];V&&H.push({x:(d=V.x1)!==null&&d!==void 0?d:V.x,y:(u=V.y1)!==null&&u!==void 0?u:V.y})}H.length>1&&(O=Dp(H,M==="stepBefore"?"stepAfter":M==="stepAfter"?"stepBefore":M),L.unshift(O))}s.cacheArea=L.map((D,j)=>({top:I[j],bottom:D}))}else{if(!w||!w.length)return s.cacheArea=null,void s.clearUpdateShapeTag();{const C=w,R=[];for(let L=w.length-1;L>=0;L--)R.push({x:(c=w[L].x1)!==null&&c!==void 0?c:w[L].x,y:(p=w[L].y1)!==null&&p!==void 0?p:w[L].y});const I=Dp(C,M),O=Dp(R,M==="stepBefore"?"stepAfter":M==="stepAfter"?"stepBefore":M);s.cacheArea={top:I,bottom:O}}}s.clearUpdateShapeTag()}if(Array.isArray(s.cacheArea)){const C=s.attribute.segments.filter(R=>R.points.length);if(C[0].points.length===1&&C.shift(),A===1){let R=!1;s.cacheArea.forEach((I,O)=>{R||(R=this.drawSegmentItem(t,I,x,m,S,y,C[O],[g,s.attribute],A,e,i,v,s,n,a,o))})}else{const R=s.cacheArea.reduce((D,j)=>D+j.top.getLength(),0),I=A*R;let O=0,L=!1;s.cacheArea.forEach((D,j)=>{if(L)return;const H=D.top.getLength(),W=(I-O)/H;O+=H,W>0&&(L=this.drawSegmentItem(t,D,x,m,S,y,C[j],[g,s.attribute],Ci(W,1),e,i,v,s,n,a,o))})}}else this.drawSegmentItem(t,s.cacheArea,x,m,S,y,s.attribute,g,A,e,i,v,s,n,a,o)}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).area;this._draw(s,n,!1,e,i)}drawSegmentItem(s,t,e,i,n,r,a,o,l,h,d,u,c,p,g,f){let _=!1;return _=_||this._drawSegmentItem(s,t,e,i,n,r,a,o,l,h,d,u,c,p,!1,g,f),_=_||this._drawSegmentItem(s,t,e,i,n,r,a,o,l,h,d,u,c,p,!0,g,f),_}_drawSegmentItem(s,t,e,i,n,r,a,o,l,h,d,u,c,p,g,f,_){var m,v,y,b;let{connectedType:x,connectedX:S,connectedY:A,connectedStyle:k}=a;const w=[];if(g&&($(o)?(x=(m=x??o[0].connectedType)!==null&&m!==void 0?m:o[1].connectedType,S=(v=S??o[0].connectedX)!==null&&v!==void 0?v:o[1].connectedX,A=(y=A??o[0].connectedY)!==null&&y!==void 0?y:o[1].connectedY,k=(b=k??o[0].connectedStyle)!==null&&b!==void 0?b:o[1].connectedStyle):(x=x??o.connectedType,S=S??o.connectedX,A=A??o.connectedY,k=k??o.connectedStyle),x!=="connect"&&x!=="zero"&&(x="none"),$(o)?o.forEach(D=>w.push(D)):w.push(o),w.push(a)),g&&x==="none")return!1;if(!t)return;s.beginPath();const{points:T,segments:M}=c.attribute;let C,R,I=Te.ROW;if(M){const D=M[M.length-1];R=M[0].points[0],C=D.points[D.points.length-1]}else R=T[0],C=T[T.length-1];I=Kt(C.x-R.x)>Kt(C.y-R.y)?Te.ROW:Te.COLUMN,KW(s.camera?s:s.nativeContext,t,l,{offsetX:h,offsetY:d,offsetZ:u,direction:I,drawConnect:g,mode:x}),this.beforeRenderStep(c,s,h,d,!!i,!1,e,!1,o,p,f,null,{attribute:a}),s.setShadowBlendStyle&&s.setShadowBlendStyle(c,a,o);const{x:O=0,x:L=0}=a;if(e!==!1&&(f?f(s,a,o):i&&(s.setCommonStyle(c,g?k:a,O-h,L-d,g?w:o),s.fill())),this.afterRenderStep(c,s,h,d,!!i,!1,e,!1,o,p,f,null,{attribute:a}),n!==!1)if(_)_(s,a,o);else{const{stroke:D=o&&o[1]&&o[1].stroke}=a;$(D)&&(D[0]||D[2])&&D[1]===!1&&(s.beginPath(),nb(s.camera?s:s.nativeContext,D[0]?t.top:t.bottom,l,I===Te.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:u,drawConnect:g,mode:x,zeroX:S,zeroY:A})),s.setStrokeStyle(c,g?k:a,O-h,L-d,g?w:o),s.stroke()}return!1}};Du=JW([ft(),cw(0,Bt(oi)),cw(0,wi(Vy)),QW("design:paramtypes",[Object])],Du);const t5=Zh,e5=Ho;var i5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},s5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},pw=function(s,t){return function(e,i){t(e,i,s)}};let Qg=class extends vs{constructor(s){super(),this.pathRenderContribitions=s,this.numberType=gm,this.builtinContributions=[e5,t5],this.init(s)}drawShape(s,t,e,i,n,r,a,o){var l,h,d;const u=(l=this.tempTheme)!==null&&l!==void 0?l:at(s,r==null?void 0:r.theme).path,{x:c=u.x,y:p=u.y}=s.attribute,g=(h=this.z)!==null&&h!==void 0?h:0,f=this.valid(s,u,a,o);if(!f)return;const{fVisible:_,sVisible:m,doFill:v,doStroke:y}=f;if(t.beginPath(),s.pathShape)Cr(s.pathShape.commandList,t,e,i,1,1,g);else{const b=(d=s.attribute.path)!==null&&d!==void 0?d:u.path;Cr(b.commandList,t,e,i,1,1,g)}t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,u),this.beforeRenderStep(s,t,e,i,v,y,_,m,u,n,a,o),y&&(o?o(t,s.attribute,u):m&&(t.setStrokeStyle(s,s.attribute,c-e,p-i,u),t.stroke())),v&&(a?a(t,s.attribute,u):_&&(t.setCommonStyle(s,s.attribute,c-e,p-i,u),t.fill())),this.afterRenderStep(s,t,e,i,v,y,_,m,u,n,a,o)}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).path;this.tempTheme=n,this._draw(s,n,!1,e,i),this.tempTheme=null}};Qg=i5([ft(),pw(0,Bt(oi)),pw(0,wi(Yy)),s5("design:paramtypes",[Object])],Qg);var n5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},r5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},gw=function(s,t){return function(e,i){t(e,i,s)}};let tf=class extends vs{constructor(s){super(),this.rectRenderContribitions=s,this.type="rect",this.numberType=_m,this.builtinContributions=[LW,DW,BW],this.init(s)}drawShape(s,t,e,i,n,r,a,o){var l;const h=(l=this.tempTheme)!==null&&l!==void 0?l:at(s,r==null?void 0:r.theme).rect,{fill:d=h.fill,background:u,stroke:c=h.stroke,cornerRadius:p=h.cornerRadius,opacity:g=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:_=h.lineWidth,strokeOpacity:m=h.strokeOpacity,visible:v=h.visible,x1:y,y1:b,x=h.x,y:S=h.y}=s.attribute;let{width:A,height:k}=s.attribute;A=(A??y-x)||0,k=(k??b-S)||0;const w=hS(g,f,A,k,d),T=uS(g,m,A,k),M=zo(d,u),C=qh(c,_);if(!s.valid||!v||!M&&!C||!(w||T||a||o||u))return;p===0||$(p)&&p.every(I=>I===0)?(t.beginPath(),t.rect(e,i,A,k)):(t.beginPath(),Co(t,e,i,A,k,p));const R={doFill:M,doStroke:C};t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,h),this.beforeRenderStep(s,t,e,i,M,C,w,T,h,n,a,o,R),R.doFill&&(a?a(t,s.attribute,h):w&&(t.setCommonStyle(s,s.attribute,x-e,S-i,h),t.fill())),R.doStroke&&(o?o(t,s.attribute,h):T&&(t.setStrokeStyle(s,s.attribute,x-e,S-i,h),t.stroke())),this.afterRenderStep(s,t,e,i,M,C,w,T,h,n,a,o)}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).rect;this.tempTheme=n,this._draw(s,n,!1,e,i),this.tempTheme=null}};tf=n5([ft(),gw(0,Bt(oi)),gw(0,wi(Fd)),r5("design:paramtypes",[Object])],tf);var a5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},o5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},fw=function(s,t){return function(e,i){t(e,i,s)}};let ef=class extends vs{constructor(s){super(),this.symbolRenderContribitions=s,this.numberType=mm,this.builtinContributions=[jW,HW,zW],this.init(s)}drawShape(s,t,e,i,n,r,a,o){var l;const h=at(s,r==null?void 0:r.theme).symbol,{size:d=h.size,x:u=h.x,y:c=h.y,scaleX:p=h.scaleX,scaleY:g=h.scaleY}=s.attribute,f=this.valid(s,h,a,o);if(!f)return;const{fVisible:_,sVisible:m,doFill:v,doStroke:y}=f,b=s.getParsedPath();if(!b)return;const{keepDirIn3d:x=h.keepDirIn3d}=s.attribute,S=(l=this.z)!==null&&l!==void 0?l:0;if(t.beginPath(),x&&t.camera&&t.project){const A=t.project(e,i,S),k=t.camera;t.camera=null,b.draw(t,$(d)?[d[0]*p,d[1]*g]:d*p,A.x,A.y,void 0,(w,T)=>{var M,C,R;if(s._parsedPath.svgCache){const I=Object.assign({},T);I.fill=(M=T.fill)!==null&&M!==void 0?M:s.attribute.fill,I.opacity=(C=T.fill)!==null&&C!==void 0?C:s.attribute.opacity,I.fillOpacity=s.attribute.fillOpacity,I.stroke=(R=T.stroke)!==null&&R!==void 0?R:s.attribute.stroke,T=I}T.fill&&(a?a(t,s.attribute,h):(t.setCommonStyle(s,T,u-e,c-i,h),t.fill())),T.stroke&&(o?o(t,s.attribute,h):(t.setStrokeStyle(s,T,(u-e)/p,(c-i)/g,h),t.stroke()))})===!1&&t.closePath(),t.camera=k}else b.draw(t,d,e,i,S,(A,k)=>{var w,T,M;if(s._parsedPath.svgCache){const C=Object.assign({},k);C.fill=(w=k.fill)!==null&&w!==void 0?w:s.attribute.fill,C.opacity=(T=k.opacity)!==null&&T!==void 0?T:s.attribute.opacity,C.fillOpacity=s.attribute.fillOpacity,C.stroke=(M=k.stroke)!==null&&M!==void 0?M:s.attribute.stroke,k=C}k.fill&&(a?a(t,s.attribute,h):(t.setCommonStyle(s,k,u-e,c-i,h),t.fill())),k.stroke&&(o?o(t,s.attribute,h):(t.setStrokeStyle(s,k,(u-e)/p,(c-i)/g,h),t.stroke()))})===!1&&t.closePath();t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,h),this.beforeRenderStep(s,t,e,i,v,y,_,m,h,n,a,o),v&&!b.isSvg&&(a?a(t,s.attribute,h):_&&(t.setCommonStyle(s,s.attribute,u-e,c-i,h),t.fill())),y&&!b.isSvg&&(o?o(t,s.attribute,h):m&&(t.setStrokeStyle(s,s.attribute,(u-e)/p,(c-i)/g,h),t.stroke())),this.afterRenderStep(s,t,e,i,v,y,_,m,h,n,a,o)}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).symbol;this._draw(s,n,!1,e,i)}};ef=a5([ft(),fw(0,Bt(oi)),fw(0,wi(Ky)),o5("design:paramtypes",[Object])],ef);class l5{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Le)}allocate(t,e,i,n){if(!this.pools.length)return new Le().setValue(t,e,i,n);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=n,r}allocateByObj(t){if(!this.pools.length)return new Le(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const sf=new l5;class h5 extends Rc{constructor(){super(...arguments),this.time=Ti.beforeFillStroke}drawShape(t,e,i,n,r,a,o,l,h,d,u,c){var p,g,f,_,m,v,y,b,x,S;const{backgroundMode:A=h.backgroundMode,backgroundFit:k=h.backgroundFit}=t.attribute;let w,{background:T}=t.attribute;if(!T)return;const M=$t(T)&&T.background,C=t.transMatrix.onlyTranslate();if(M){const R=t.AABBBounds,I=((p=T.x)!==null&&p!==void 0?p:R.x1)+((g=T.dx)!==null&&g!==void 0?g:0),O=((f=T.y)!==null&&f!==void 0?f:R.y1)+((_=T.dy)!==null&&_!==void 0?_:0),L=(m=T.width)!==null&&m!==void 0?m:R.width(),D=(v=T.height)!==null&&v!==void 0?v:R.height();if(w=sf.allocate(I,O,I+L,O+D),T=T.background,!C){const j=w.width(),H=w.height();w.set(((y=T.x)!==null&&y!==void 0?y:0)+((b=T.dx)!==null&&b!==void 0?b:0),((x=T.y)!==null&&x!==void 0?x:0)+((S=T.dy)!==null&&S!==void 0?S:0),j,H)}}else w=t.AABBBounds,C||w.set(0,0,w.width(),w.height());if(t.backgroundImg&&t.resources){const R=t.resources.get(T);if(R.state!=="success"||!R.data)return;e.highPerformanceSave(),C&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,h),this.doDrawImage(e,R.data,w,A,k),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=T,e.fillRect(w.x1,w.y1,w.width(),w.height()),e.highPerformanceRestore();M&&sf.free(w)}}const MO=new h5;var d5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},u5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},_w=function(s,t){return function(e,i){t(e,i,s)}};let rb=class extends vs{constructor(s){super(),this.textRenderContribitions=s,this.numberType=vm,this.builtinContributions=[MO],this.init(s)}drawShape(s,t,e,i,n,r,a,o){var l,h,d;const u=at(s,r==null?void 0:r.theme).text,{text:c,underline:p=u.underline,lineThrough:g=u.lineThrough,keepDirIn3d:f=u.keepDirIn3d,direction:_=u.direction,whiteSpace:m=u.whiteSpace,fontSize:v=u.fontSize,verticalMode:y=u.verticalMode,x:b=u.x,y:x=u.y}=s.attribute;let{textAlign:S=u.textAlign,textBaseline:A=u.textBaseline}=s.attribute;if(!y&&_==="vertical"){const D=S;S=(l=s.getBaselineMapAlign()[A])!==null&&l!==void 0?l:"left",A=(h=s.getAlignMapBaseline()[D])!==null&&h!==void 0?h:"top"}const k=(d=qn(s.attribute.lineHeight,v))!==null&&d!==void 0?d:v,w=this.valid(s,u,a,o);if(!w)return;const{fVisible:T,sVisible:M,doFill:C,doStroke:R}=w,I=!f,O=this.z||0;t.beginPath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,u),this.beforeRenderStep(s,t,e,i,C,R,T,M,u,n,a,o),I&&this.transformUseContext2d(s,u,O,t);const L=(D,j,H,W)=>{let V=e+j;const X=i+H;if(W){t.highPerformanceSave(),V+=v;const Q=nn.allocate(1,0,0,1,0,0);Q.rotateByCenter(Math.PI/2,V,X),t.transformFromMatrix(Q,!0),nn.free(Q)}R&&(o?o(t,s.attribute,u):M&&(t.setStrokeStyle(s,s.attribute,b-e,x-i,u),t.strokeText(D,V,X,O))),C&&(a?a(t,s.attribute,u):T&&(t.setCommonStyle(s,s.attribute,b-e,x-i,u),t.fillText(D,V,X,O),this.drawUnderLine(p,g,s,V,X,O,u,t))),W&&(t.highPerformanceRestore(),t.setTransformForCurrent())};if(s.isMultiLine)if(t.setTextStyleWithoutAlignBaseline(s.attribute,u,O),_==="horizontal"){const{multilineLayout:D}=s;if(!D)return void t.highPerformanceRestore();const{xOffset:j,yOffset:H}=D.bbox;R&&(o?o(t,s.attribute,u):M&&(t.setStrokeStyle(s,s.attribute,b-e,x-i,u),D.lines.forEach(W=>{t.strokeText(W.str,(W.leftOffset||0)+j+e,(W.topOffset||0)+H+i,O)}))),C&&(a?a(t,s.attribute,u):T&&(t.setCommonStyle(s,s.attribute,b-e,x-i,u),D.lines.forEach(W=>{t.fillText(W.str,(W.leftOffset||0)+j+e,(W.topOffset||0)+H+i,O),this.drawMultiUnderLine(p,g,s,(W.leftOffset||0)+e,(W.topOffset||0)+H+i,O,W.width,u,t)})))}else{s.tryUpdateAABBBounds();const D=s.cache,{verticalList:j}=D;t.textAlign="left",t.textBaseline="top";const H=k*j.length;let W=0;j.forEach(Q=>{const J=Q.reduce((nt,q)=>nt+(q.width||0),0);W=ps(J,W)});let V=0,X=0;A==="bottom"?X=-H:A==="middle"&&(X=-H/2),S==="center"?V-=W/2:S==="right"&&(V-=W),j.forEach((Q,J)=>{const nt=Q.reduce((it,ut)=>it+(ut.width||0),0),q=W-nt;let U=V;S==="center"?U+=q/2:S==="right"&&(U+=q),Q.forEach(it=>{const{text:ut,width:ct,direction:Rt}=it;L(ut,H-(J+1)*k+X,U,Rt),U+=ct})})}else if(_==="horizontal"){t.setTextStyle(s.attribute,u,O);const D=s.clipedText;let j=0;k!==v&&(A==="top"?j=(k-v)/2:A==="middle"||A==="bottom"&&(j=-(k-v)/2)),L(D,0,j,0)}else{s.tryUpdateAABBBounds();const D=s.cache;if(D){t.setTextStyleWithoutAlignBaseline(s.attribute,u,O);const{verticalList:j}=D;let H=0;const W=j[0].reduce((X,Q)=>X+(Q.width||0),0);let V=0;A==="bottom"?V=-k:A==="middle"&&(V=-k/2),S==="center"?H-=W/2:S==="right"&&(H-=W),t.textAlign="left",t.textBaseline="top",j[0].forEach(X=>{const{text:Q,width:J,direction:nt}=X;L(Q,V,H,nt),H+=J})}}I&&this.restoreTransformUseContext2d(s,u,O,t),this.afterRenderStep(s,t,e,i,C,R,T,M,u,n,a,o)}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=s.attribute,a=!r;this._draw(s,n,a,e,i)}drawUnderLine(s,t,e,i,n,r,a,o){if(t+s<=0)return;const{textAlign:l=a.textAlign,textBaseline:h=a.textBaseline,fontSize:d=a.fontSize,fill:u=a.fill,opacity:c=a.opacity,fillOpacity:p=a.fillOpacity}=e.attribute,g=e.clipedWidth,f=Sr(l,g),_=Ar(h,d,d),m={lineWidth:0,stroke:u,opacity:c,strokeOpacity:p};if(s){m.lineWidth=s,o.setStrokeStyle(e,m,i,n,a),o.beginPath();const v=n+_+d;o.moveTo(i+f,v,r),o.lineTo(i+f+g,v,r),o.stroke()}if(t){m.lineWidth=t,o.setStrokeStyle(e,m,i,n,a),o.beginPath();const v=n+_+d/2;o.moveTo(i+f,v,r),o.lineTo(i+f+g,v,r),o.stroke()}}drawMultiUnderLine(s,t,e,i,n,r,a,o,l){if(t+s<=0)return;const{textAlign:h=o.textAlign,fontSize:d=o.fontSize,fill:u=o.fill,opacity:c=o.opacity,fillOpacity:p=o.fillOpacity}=e.attribute,g=Sr(h,a),f=Ar("alphabetic",d,d),_={lineWidth:0,stroke:u,opacity:c,strokeOpacity:p};let m=-3;if(s){_.lineWidth=s,l.setStrokeStyle(e,_,i,n,o),l.beginPath();const v=n+f+d+m;l.moveTo(i+g,v,r),l.lineTo(i+g+a,v,r),l.stroke()}if(m=-1,t){_.lineWidth=t,l.setStrokeStyle(e,_,i,n,o),l.beginPath();const v=n+f+d/2+m;l.moveTo(i+g,v,r),l.lineTo(i+g+a,v,r),l.stroke()}}};rb=d5([ft(),_w(0,Bt(oi)),_w(0,wi(qy)),u5("design:paramtypes",[Object])],rb);function CO(s,t,e,i){s.moveTo(t[0].x+e,t[0].y+i);for(let n=1;n<t.length;n++)s.lineTo(t[n].x+e,t[n].y+i)}function c5(s,t,e,i,n,r=!0){var a;if(t.length<3)return void CO(s,t,e,i);let o=0,l=t.length-1;r||(o+=1,l-=1,s.moveTo(t[0].x+e,t[0].y+i));for(let h=o;h<=l;h++){const d=t[h===0?l:(h-1)%t.length],u=t[h%t.length],c=t[(h+1)%t.length],p=u.x-d.x,g=u.y-d.y,f=u.x-c.x,_=u.y-c.y,m=(Math.atan2(g,p)-Math.atan2(_,f))/2,v=Math.abs(Math.tan(m));let y=Array.isArray(n)?(a=n[h%t.length])!==null&&a!==void 0?a:0:n,b=y/v;const x=Fp(p,g),S=Fp(f,_),A=Math.min(x,S);b>A&&(b=A,y=A*v);const k=f0(u,b,x,p,g),w=f0(u,b,S,f,_),T=2*u.x-k.x-w.x,M=2*u.y-k.y-w.y,C=Fp(T,M),R=f0(u,Fp(b,y),C,T,M);let I=Math.atan2(k.y-R.y,k.x-R.x);const O=Math.atan2(w.y-R.y,w.x-R.x);let L=O-I;L<0&&(I=O,L=-L),L>Math.PI&&(L-=Math.PI),h===0?s.moveTo(k.x+e,k.y+i):s.lineTo(k.x+e,k.y+i),L&&s.arcTo(u.x+e,u.y+i,w.x+e,w.y+i,y),s.lineTo(w.x+e,w.y+i)}r||s.lineTo(t[l+1].x+e,t[l+1].y+i)}function Fp(s,t){return Math.sqrt(s*s+t*t)}function f0(s,t,e,i,n){const r=t/e;return{x:s.x-i*r,y:s.y-n*r}}const p5=Zh,g5=Ho;var f5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},_5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},mw=function(s,t){return function(e,i){t(e,i,s)}};let ab=class extends vs{constructor(s){super(),this.polygonRenderContribitions=s,this.numberType=fm,this.builtinContributions=[g5,p5],this.init(s)}drawShape(s,t,e,i,n,r,a,o){const l=at(s,r==null?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:d=l.cornerRadius,x:u=l.x,y:c=l.y,closePath:p=l.closePath}=s.attribute,g=this.valid(s,l,a,o);if(!g)return;const{fVisible:f,sVisible:_,doFill:m,doStroke:v}=g;t.beginPath(),d<=0||$(d)&&d.every(y=>y===0)?CO(t.camera?t:t.nativeContext,h,e,i):c5(t.camera?t:t.nativeContext,h,e,i,d,p),p&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,l),this.beforeRenderStep(s,t,e,i,m,v,f,_,l,n,a,o),m&&(a?a(t,s.attribute,l):f&&(t.setCommonStyle(s,s.attribute,u-e,c-i,l),t.fill())),v&&(o?o(t,s.attribute,l):_&&(t.setStrokeStyle(s,s.attribute,u-e,c-i,l),t.stroke())),this.afterRenderStep(s,t,e,i,m,v,f,_,l,n,a,o)}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).polygon;this._draw(s,n,!1,e,i)}};ab=f5([ft(),mw(0,Bt(oi)),mw(0,wi(Xy)),_5("design:paramtypes",[Object])],ab);var m5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},v5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},vw=function(s,t){return function(e,i){t(e,i,s)}};const y5=["","repeat-x","repeat-y","repeat"];let ob=class extends vs{constructor(s){super(),this.imageRenderContribitions=s,this.numberType=pm,this.builtinContributions=[OW],this.init(s)}drawShape(s,t,e,i,n,r,a){const o=at(s).image,{width:l=o.width,height:h=o.height,repeatX:d=o.repeatX,repeatY:u=o.repeatY,cornerRadius:c=o.cornerRadius,image:p}=s.attribute,g=this.valid(s,o,a);if(!g)return;const{fVisible:f,sVisible:_,doFill:m,doStroke:v}=g;if(t.setShadowBlendStyle&&t.setShadowBlendStyle(s,o),this.beforeRenderStep(s,t,e,i,m,!1,f,!1,o,n,a),m){if(a)a(t,s.attribute,o);else if(f){if(!p||!s.resources)return;const y=s.resources.get(p);if(y.state!=="success")return;let b=!1;c===0||$(c)&&c.every(S=>S===0)||(t.beginPath(),Co(t,e,i,l,h,c),t.save(),t.clip(),b=!0),t.setCommonStyle(s,s.attribute,e,i,o);let x=0;if(d==="repeat"&&(x|=1),u==="repeat"&&(x|=2),x){const S=t.createPattern(y.data,y5[x]);t.fillStyle=S,t.translate(e,i,!0),t.fillRect(0,0,l,h),t.translate(-e,-i,!0)}else t.drawImage(y.data,e,i,l,h);b&&t.restore()}}this.afterRenderStep(s,t,e,i,m,!1,f,!1,o,n,a)}draw(s,t,e){const{image:i}=s.attribute;if(!i||!s.resources||s.resources.get(i).state!=="success")return;const{context:n}=t.drawParams;if(!n)return;const r=at(s).image;this._draw(s,r,!1,e)}};ob=m5([ft(),vw(0,Bt(oi)),vw(0,wi($y)),v5("design:paramtypes",[Object])],ob);const PO=Symbol.for("IncrementalDrawContribution"),nf=Symbol.for("ArcRender"),lb=Symbol.for("Arc3dRender"),rf=Symbol.for("AreaRender"),af=Symbol.for("CircleRender"),Mi=Symbol.for("GraphicRender"),yw=Symbol.for("GroupRender"),of=Symbol.for("LineRender"),lf=Symbol.for("PathRender"),hf=Symbol.for("PolygonRender"),df=Symbol.for("RectRender"),hb=Symbol.for("Rect3DRender"),uf=Symbol.for("SymbolRender"),db=Symbol.for("TextRender"),ub=Symbol.for("RichTextRender"),cb=Symbol.for("Pyramid3dRender"),cf=Symbol.for("GlyphRender"),bw=Symbol.for("ImageRender"),yS=Symbol.for("DrawContribution");var b5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},x5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},S5=function(s,t){return function(e,i){t(e,i,s)}};const EO=Symbol.for("RenderService");let pb=class{constructor(s){this.drawContribution=s}prepare(s){s&&this.renderTreeRoots.forEach(t=>{this._prepare(t,s)})}_prepare(s,t){s.forEachChildren(e=>{this._prepare(e,t)}),s.update({bounds:t,trans:!0})}prepareRenderList(){}beforeDraw(s){}draw(s){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(s){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(s,t){this.renderTreeRoots=s,this.drawParams=t;const e=t.updateBounds;this.prepare(e),this.prepareRenderList(),this.beforeDraw(t),this.draw(t),this.afterDraw(t)}};pb=b5([ft(),S5(0,Bt(yS)),x5("design:paramtypes",[Object])],pb);const A5=new Et(s=>{s(EO).to(pb).inSingletonScope()}),oh=Symbol.for("PickerService"),xw=Symbol.for("GlobalPickerService");var bS=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};const bl=Symbol.for("PickItemInterceptor");let pf=class{constructor(){this.order=1}afterPickItem(s,t,e,i,n){return s.attribute.shadowRootIdx>0||!s.attribute.shadowRootIdx?this._pickItem(s,t,e,i,n):null}beforePickItem(s,t,e,i,n){return s.attribute.shadowRootIdx<0?this._pickItem(s,t,e,i,n):null}_pickItem(s,t,e,i,n){if(!s.shadowRoot)return null;const{parentMatrix:r}=n||{};if(!r)return null;const a=t.pickContext;a.highPerformanceSave();const o=s.shadowRoot,l=nn.allocateByObj(r),h=new We(l.a*e.x+l.c*e.y+l.e,l.b*e.x+l.d*e.y+l.f),d=t.pickGroup(o,h,l,i);return a.highPerformanceRestore(),d}};pf=bS([ft()],pf);let gf=class{constructor(){this.order=1}beforePickItem(s,t,e,i,n){const r=s.baseGraphic;if(r&&r.parent){const a=new We(e.x,e.y),o=t.pickContext;o.highPerformanceSave();const l=r.parent.globalTransMatrix;l.transformPoint(a,a);const h=r.isContainer?t.pickGroup(r,a.clone(),l,i):t.pickItem(r,a.clone(),l,i);return o.highPerformanceRestore(),h}return null}};gf=bS([ft()],gf);let ff=class{constructor(){this.order=1}beforePickItem(s,t,e,i,n){if(!s.in3dMode||i.in3dInterceptor)return null;const r=t.pickContext,a=s.stage;if(!r||!a)return null;if(i.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=a.camera,s.isContainer){let o,l=!1,h=!1;if(s.forEachChildren(d=>(l=d.numberType===Tc,!l)),s.forEachChildren(d=>(h=!!d.findFace,!h)),l){const d=s.getChildren(),u=[...d];u.sort((c,p)=>{var g,f,_,m;let v=((f=(g=c.attribute.startAngle)!==null&&g!==void 0?g:0+c.attribute.endAngle)!==null&&f!==void 0?f:0)/2,y=((m=(_=p.attribute.startAngle)!==null&&_!==void 0?_:0+p.attribute.endAngle)!==null&&m!==void 0?m:0)/2;for(;v<0;)v+=jt;for(;y<0;)y+=jt;return y-v}),u.forEach(c=>{c._next=null,c._prev=null}),s.removeAllChild(),s.update(),u.forEach(c=>{s.appendChild(c)}),i.hack_pieFace="outside",o=t.pickGroup(s,e,n.parentMatrix,i),o.graphic||(i.hack_pieFace="inside",o=t.pickGroup(s,e,n.parentMatrix,i)),o.graphic||(i.hack_pieFace="top",o=t.pickGroup(s,e,n.parentMatrix,i)),s.removeAllChild(),d.forEach(c=>{c._next=null,c._prev=null}),d.forEach(c=>{s.appendChild(c)})}else if(h){const d=s.getChildren(),u=d.map(c=>({ave_z:c.findFace().vertices.map(p=>{var g;return r.view(p[0],p[1],(g=p[2]+c.attribute.z)!==null&&g!==void 0?g:0)[2]}).reduce((p,g)=>p+g,0),g:c}));u.sort((c,p)=>p.ave_z-c.ave_z),s.removeAllChild(),u.forEach(c=>{c.g._next=null,c.g._prev=null}),s.update(),u.forEach(c=>{s.add(c.g)}),o=t.pickGroup(s,e,n.parentMatrix,i),s.removeAllChild(),d.forEach(c=>{c._next=null,c._prev=null}),s.update(),d.forEach(c=>{s.add(c)})}else o=t.pickGroup(s,e,n.parentMatrix,i);return r.camera=null,i.in3dInterceptor=!1,r.restore(),o}return r.restore(),null}initCanvasCtx(s){s.setTransformForCurrent()}};ff=bS([ft()],ff);const k5=new Et((s,t,e)=>{e(oh)||(s(xw).toSelf(),s(oh).toService(xw)),s(ff).toSelf().inSingletonScope(),s(bl).toService(ff),s(pf).toSelf().inSingletonScope(),s(bl).toService(pf),s(gf).toSelf().inSingletonScope(),s(bl).toService(gf),Fi(s,bl)}),w5=new Et(s=>{s(rO).to(ib).inSingletonScope(),s(aO).toConstantValue(_t)}),Fu=Symbol.for("AutoEnablePlugins"),RO=Symbol.for("PluginService");var T5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},M5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},Sw=function(s,t){return function(e,i){t(e,i,s)}};let gb=class{constructor(s){this.autoEnablePlugins=s,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(s,t){this.stage=s,this.actived=!0;const{pluginList:e}=t;e&&Pt.isBound(Fu)&&this.autoEnablePlugins.getContributions().forEach(i=>{e.includes(i.name)&&this.register(i)})}findPluginsByName(s){const t=[];return this.onStartupFinishedPlugin.forEach(e=>{e.name===s&&t.push(e)}),this.onRegisterPlugin.forEach(e=>{e.name===s&&t.push(e)}),t}register(s){s.activeEvent==="onStartupFinished"?this.onStartupFinishedPlugin.push(s):s.activeEvent==="onRegister"&&(this.onRegisterPlugin.push(s),s.activate(this))}unRegister(s){s.activeEvent==="onStartupFinished"?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(s),1):s.activeEvent==="onRegister"&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(s),1),s.deactivate(this)}release(...s){this.onStartupFinishedPlugin.forEach(t=>{t.deactivate(this)}),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach(t=>{t.deactivate(this)}),this.onRegisterPlugin=[]}};gb=T5([ft(),Sw(0,Bt(oi)),Sw(0,wi(Fu)),M5("design:paramtypes",[Object])],gb);const C5=new Et(s=>{s(RO).to(gb),C3(s,Fu)}),P5=new Et(s=>{Fi(s,om)}),E5=new Et(s=>{s(Ly).to(By).inSingletonScope(),Fi(s,Ly)});var R5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},O5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let _f=class{constructor(){this.type="static",this.offscreen=!1,this.global=et.global}setDpr(s){this.canvas.dpr=s}init(s,t,e){if(this.layer=s,this.window=t,e.main)this.main=!0,this.context=t.getContext(),this.canvas=this.context.getCanvas();else{let i;this.main=!1,e.canvasId&&(i=this.global.getElementById(e.canvasId)),i||(i=this.global.createCanvas({width:t.width,height:t.height})),i.style&&(i.style["pointer-events"]="none");const n=t.getContext().getCanvas().nativeCanvas,r=Hg({nativeCanvas:i,width:t.width,height:t.height,dpr:t.dpr,id:e.canvasId,canvasControled:!0,container:t.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(s,t){this.canvas.resize(s,t)}resizeView(s,t){}render(s,t,e){var i;if(!this.main){const n=this.window.getContext().getCanvas().nativeCanvas;!n||this.canvas.x===n.offsetLeft&&this.canvas.y===n.offsetTop||(this.canvas.x=n.offsetLeft,this.canvas.y=n.offsetTop,this.canvas.applyPosition())}t.renderService.render(s,Object.assign(Object.assign({context:this.context,clear:(i=t.background)!==null&&i!==void 0?i:"#ffffff"},t),e))}merge(s){s.forEach(t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)})}prepare(s,t){}drawTo(s,t,e){var i;const n=s.getContext();e.renderService.render(t,Object.assign(Object.assign({context:n},e),{clear:e.clear?(i=e.background)!==null&&i!==void 0?i:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};_f=R5([ft(),O5("design:paramtypes",[])],_f);var I5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},L5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let mf=class{constructor(){this.offscreen=!1,this.type="virtual",this.global=et.global}setDpr(s){}init(s,t,e){if(this.layer=s,this.window=t,e.main)throw new Error("virtual layer不能作为main layer");this.main=!1,this.canvas=null,this.context=null}resize(s,t){}resizeView(s,t){}render(s,t,e){this.mainHandler.render(s,t,Object.assign(Object.assign({},e),{clear:!1}))}merge(s){}prepare(s,t){}drawTo(s,t,e){var i;const n=s.getContext();e.renderService.render(t,Object.assign(Object.assign({context:n},e),{clear:e.clear?(i=e.background)!==null&&i!==void 0?i:"#fff":void 0}))}getContext(){return null}release(){}};mf=I5([ft(),L5("design:paramtypes",[])],mf);var B5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},D5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let vf=class{constructor(){this.offscreen=!0,this.type="dynamic",this.global=et.global}setDpr(s){this.canvas.dpr=s}init(s,t,e){this.layer=s;const i=this.global.createOffscreenCanvas({width:e.width,height:e.height,dpr:t.dpr}),n=Hg({nativeCanvas:i,width:e.width,height:e.height,dpr:t.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(s,t){this.canvas.resize(s,t)}resizeView(s,t){this.canvas.resize(s,t)}render(s,t){var e;t.renderService.render(s,Object.assign(Object.assign({context:this.context},t),{x:0,y:0,clear:(e=t.background)!==null&&e!==void 0?e:"#ffffff"}))}prepare(s,t){}release(){this.canvas.release()}getContext(){return this.context}drawTo(s,t,e){const i=s.getContext(),n=s.dpr,{x:r=0,y:a=0,width:o=this.layer.viewWidth,height:l=this.layer.viewHeight}=e;i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),e.clear&&i.clearRect(r,a,o,l),i.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,r,a,o,l),i.nativeContext.restore()}merge(s){}};vf=B5([ft(),D5("design:paramtypes",[])],vf);const F5=new Et(s=>{s(_f).toSelf(),s(vf).toSelf(),s(mf).toSelf(),s(dO).toService(_f),s(uO).toService(vf),s(cO).toService(mf)});function j5(s){s.load(P5),s.load(E5),s.load(F5)}var z5=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};function OO(s,t,e,i=!1,n=!1){const r={},a=[];let o=!1;if(n)o=!0;else{let l;s.forEachChildren((h,d)=>{const{zIndex:u=t}=h.attribute;if(d===0)l=u;else if(l!==u)return o=!0,!0;return!1},i)}if(o){s.forEachChildren(h=>{const{zIndex:d=t}=h.attribute;r[d]?r[d].push(h):(r[d]=[h],a.push(d))},i),a.sort((h,d)=>i?d-h:h-d);let l=!1;for(let h=0;h<a.length&&!l;h++){const d=a[h],u=r[d];n&&u.sort((c,p)=>{var g,f;return(i?-1:1)*(((g=p.attribute.z)!==null&&g!==void 0?g:0)-((f=c.attribute.z)!==null&&f!==void 0?f:0))});for(let c=0;c<u.length;c++)if(e(u[c],c)){l=!0;break}}}else s.forEachChildren(e,i)}function Aw(s,t,e,i=!1){return z5(this,void 0,void 0,function*(){yield s.forEachChildrenAsync(e,i)})}function H5(s,t,e,i=!1){const n={},r=[];let a=!1;s.forEachChildren((h,d)=>{const{zIndex:u=e}=h.attribute;if(d!==0){if(u!==void 0)return a=!0,!0}return!1},i);let o=null,l=!1;if(a){s.forEachChildren(d=>{const{zIndex:u=e}=d.attribute;n[u]?n[u].push(d):(n[u]=[d],r.push(u))},i),r.sort((d,u)=>i?u-d:d-u);let h=!1;for(let d=0;d<r.length&&!h;d++){const u=r[d],c=n[u];for(let p=0;p<c.length;p++){if(l){h=!0,o=c[p];break}c[p]._uid!==t||(l=!0)}}}else s.forEachChildren(h=>l?(o=h,!0):(h._uid===t&&(l=!0),!1),i);return o}var N5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},G5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};const yf=Symbol.for("DrawItemInterceptor"),kw=new Le;class W5{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:a}=i;if(a.highPerformanceSave(),a.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){kw.copy(n.dirtyBounds);const o=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(o)}return n.renderGroup(t.shadowRoot,i,t.parent.globalTransMatrix),a.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(kw),!0}}class V5{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:a}=i;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const o=t.AABBBounds;return t.attribute._debug_bounds!==!0&&t.attribute._debug_bounds(a,t),a.strokeRect(o.x1,o.y1,o.width(),o.height()),a.highPerformanceRestore(),!0}}let bf=class{constructor(){this.order=1,this.interceptors=[new W5,new $5,new U5,new V5]}afterDrawItem(s,t,e,i,n){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(s,t,e,i,n))return!0;return!1}beforeDrawItem(s,t,e,i,n){if((!s.in3dMode||e.in3dInterceptor)&&!s.shadowRoot&&!(s.baseGraphic||s.attribute.globalZIndex||s.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(s,t,e,i,n))return!0;return!1}};bf=N5([ft(),G5("design:paramtypes",[])],bf);class U5{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}beforeSetInteractive(t,e,i,n,r){let a=t.interactiveGraphic;if(t.attribute.globalZIndex){a||(a=t.clone(),t.interactiveGraphic=a,a.baseGraphic=t),a.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const o=i.stage.getLayer("_builtin_interactive");return o&&this.getShadowRoot(o).add(a),!0}if(a){i.stage.tryInitInteractiveLayer();const o=i.stage.getLayer("_builtin_interactive");o&&this.getShadowRoot(o).removeChild(a),t.interactiveGraphic=null,a.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,r){const a=t.baseGraphic;if(a){this.processing=!0;const{context:o}=i;return o.highPerformanceSave(),o.setTransformFromMatrix(a.parent.globalTransMatrix,!0),a.isContainer?n.renderGroup(a,i,a.parent.globalTransMatrix):n.renderItem(a,i),o.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=_t.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),(e=i.shadowRoot)!==null&&e!==void 0?e:i.attachShadow()}}class $5{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:a,stage:o}=e.drawParams;a.canvas,a.save(),this.initCanvasCtx(a),a.camera=o.camera;const l=a.currentMatrix;l.a/=a.dpr,l.b/=a.dpr,l.c/=a.dpr,l.d/=a.dpr,l.e/=a.dpr,l.f/=a.dpr;const h=ve.allocate();eb(h,l);const d=a.modelMatrix;if(d){if(h){const u=ve.allocate();a.modelMatrix=Pc(u,d,h)}}else a.modelMatrix=h;if(a.setTransform(1,0,0,1,0,0,!0),t.isContainer){let u=!1,c=!1;if(t.forEachChildren(p=>(u=p.numberType===Tc,!u)),t.forEachChildren(p=>(c=!!p.findFace,!c)),u){const p=t.getChildren(),g=[...p];g.sort((_,m)=>{var v,y,b,x;let S=(((v=_.attribute.startAngle)!==null&&v!==void 0?v:0)+((y=_.attribute.endAngle)!==null&&y!==void 0?y:0))/2,A=(((b=m.attribute.startAngle)!==null&&b!==void 0?b:0)+((x=m.attribute.endAngle)!==null&&x!==void 0?x:0))/2;for(;S<0;)S+=jt;for(;A<0;)A+=jt;return A-S}),g.forEach(_=>{_._next=null,_._prev=null}),t.removeAllChild(),t.update(),g.forEach(_=>{t.appendChild(_)});const f=t.parent.globalTransMatrix;i.hack_pieFace="outside",n.renderGroup(t,i,f),i.hack_pieFace="inside",n.renderGroup(t,i,f),i.hack_pieFace="top",n.renderGroup(t,i,f),t.removeAllChild(),p.forEach(_=>{_._next=null,_._prev=null}),p.forEach(_=>{t.appendChild(_)})}else if(c){const p=t.getChildren(),g=p.map(f=>({ave_z:f.findFace().vertices.map(_=>{var m;return a.view(_[0],_[1],(m=_[2]+f.attribute.z)!==null&&m!==void 0?m:0)[2]}).reduce((_,m)=>_+m,0),g:f}));g.sort((f,_)=>_.ave_z-f.ave_z),t.removeAllChild(),g.forEach(f=>{f.g._next=null,f.g._prev=null}),t.update(),g.forEach(f=>{t.add(f.g)}),n.renderGroup(t,i,t.parent.globalTransMatrix,!0),t.removeAllChild(),p.forEach(f=>{f._next=null,f._prev=null}),t.update(),p.forEach(f=>{t.add(f)})}else n.renderGroup(t,i,t.parent.globalTransMatrix)}else n.renderItem(t,i);return a.camera=null,a.restore(),a.modelMatrix!==d&&ve.free(a.modelMatrix),a.modelMatrix=d,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Y5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},X5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},_0=function(s,t){return function(e,i){t(e,i,s)}};let xf=class{constructor(s,t){this.contributions=s,this.drawItemInterceptorContributions=t,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Pi,this.backupDirtyBounds=new Pi,this.global=et.global,this.layerService=et.layerService,this.init()}init(){this.contributions.forEach(s=>{if(s.style){const t=this.styleRenderMap.get(s.style)||new Map;t.set(s.numberType,s),this.styleRenderMap.set(s.style,t)}else this.defaultRenderMap.set(s.numberType,s)}),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((s,t)=>s.order-t.order)}prepareForDraw(s,t){t.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!t.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(s,t){this.prepareForDraw(s,t),t.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(t.renderStyle)||this.defaultRenderMap,this.currentRenderService=s;const{context:e,stage:i,x:n=0,y:r=0,width:a,height:o}=t;if(!e)return;const l=this.dirtyBounds.setValue(0,0,a,o);if(i.dirtyBounds&&!i.dirtyBounds.empty()){const u=xE(l,i.dirtyBounds);l.x1=Math.floor(u.x1),l.y1=Math.floor(u.y1),l.x2=Math.ceil(u.x2),l.y2=Math.ceil(u.y2)}const h=e.dpr%1;(h||h!==.5)&&(l.x1=Math.floor(l.x1*e.dpr)/e.dpr,l.y1=Math.floor(l.y1*e.dpr)/e.dpr,l.x2=Math.ceil(l.x2*e.dpr)/e.dpr,l.y2=Math.ceil(l.y2*e.dpr)/e.dpr),this.backupDirtyBounds.copy(l),e.inuse=!0,e.clearMatrix(),e.setTransformForCurrent(!0);const d=l.width()*e.dpr<e.canvas.width||l.height()*e.dpr<e.canvas.height;e.save(),e.translate(n,r,!0),d&&(e.beginPath(),e.rect(l.x1,l.y1,l.width(),l.height()),e.clip()),i.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(s,e,t),e.save(),s.renderTreeRoots.sort((u,c)=>{var p,g;return((p=u.attribute.zIndex)!==null&&p!==void 0?p:He.zIndex)-((g=c.attribute.zIndex)!==null&&g!==void 0?g:He.zIndex)}).forEach(u=>{u.isContainer?this.renderGroup(u,t,nn.allocate(1,0,0,1,0,0)):this.renderItem(u,t)}),e.restore(),e.restore(),e.draw(),e.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(s){let t=s.parent,e=s._uid;for(;t;){const i=H5(t,e,He.zIndex);if(i)return i;e=t._uid,t=t.parent}return null}renderGroup(s,t,e,i){if(t.break||s.attribute.visibleAll===!1)return;if(s.incremental&&(t.startAtId==null||t.startAtId===s._uid))return t.break=!0,void this._increaseRender(s,t);if(this.useDirtyBounds&&!bu(s.AABBBounds,this.dirtyBounds,!1))return;let n,r=e;if(this.useDirtyBounds){n=sf.allocateByObj(this.dirtyBounds);const a=s.transMatrix;r=nn.allocateByObj(e).multiply(a.a,a.b,a.c,a.d,a.e,a.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(s,t,{drawingCb:()=>{var a;i?s.forEachChildren(o=>{t.break||(o.isContainer?this.renderGroup(o,t,r):this.renderItem(o,t))}):OO(s,He.zIndex,o=>{t.break||(o.isContainer?this.renderGroup(o,t,r):this.renderItem(o,t))},!1,!!(!((a=t.context)===null||a===void 0)&&a.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(n),sf.free(n),nn.free(r))}_increaseRender(s,t){const{layer:e,stage:i}=t,{subLayers:n}=e;let r=n.get(s._uid);r||(r={layer:this.layerService.createLayer(i),zIndex:n.size,group:s},n.set(s._uid,r));const a=r.layer.getNativeHandler().getContext(),o=r.drawContribution||Pt.get(PO);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},t),{drawContribution:o,clear:"transparent",layer:r.layer,context:a,startAtId:s._uid,break:!1})),r.drawContribution=o;const l=this._findNextGraphic(s);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,t);else{let h=n.get(l._uid);h||(h={layer:this.layerService.createLayer(i),zIndex:n.size},n.set(l._uid,h));const d=h.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},t),{drawContribution:o,clear:"transparent",layer:h.layer,context:d,startAtId:l._uid,break:!1}))}}getRenderContribution(s){let t;return t||(t=this.selectRenderByNumberType(s.numberType)),t||(t=this.selectRenderByType(s.type)),t}renderItem(s,t,e){if(this.InterceptorContributions.length)for(let o=0;o<this.InterceptorContributions.length;o++){const l=this.InterceptorContributions[o];if(l.beforeDrawItem&&l.beforeDrawItem(s,this.currentRenderService,t,this,e))return}const i=this.getRenderContribution(s);if(!i)return;let n,r=!1;if(s.parent){const{scrollX:o=0,scrollY:l=0}=s.parent.attribute;if(r=!(!o&&!l),r){n=this.dirtyBounds.clone();const h=s.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(h),this.dirtyBounds.translate(-o,-l)}}if(this.useDirtyBounds&&!s.isContainer&&!bu(s.AABBBounds,this.dirtyBounds,!1))return void(r&&this.dirtyBounds.copy(n));const a=t.startAtId!=null&&s._uid!==t.startAtId;if(s._uid===t.startAtId&&(t.startAtId=null),e&&(e.skipDraw=a),a?s.isContainer&&i.draw(s,this.currentRenderService,t,e):i.draw(s,this.currentRenderService,t,e),r&&this.dirtyBounds.copy(n),this.InterceptorContributions.length)for(let o=0;o<this.InterceptorContributions.length;o++){const l=this.InterceptorContributions[o];if(l.afterDrawItem&&l.afterDrawItem(s,this.currentRenderService,t,this))return}}selectRenderByType(s){return Nt.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(s){return this.currentRenderMap.get(s)||this.defaultRenderMap.get(s)}clearScreen(s,t,e){var i,n;const{clear:r}=e;if(r){const a=t.getCanvas(),{width:o=a.width,height:l=a.height}=e,h=0,d=0;t.clearRect(h,d,o,l);const u=(i=s.drawParams)===null||i===void 0?void 0:i.stage;if(u&&(t.globalAlpha=(n=u.attribute.opacity)!==null&&n!==void 0?n:1),u&&u.backgroundImg&&u.resources){const c=u.resources.get(r);c&&c.state==="success"&&c.data&&t.drawImage(c.data,h,d,o,l)}else t.fillStyle=sb(t,r,{AABBBounds:{x1:h,y1:d,x2:h+o,y2:d+l}},0,0),t.fillRect(h,d,o,l)}}afterDraw(s,t){}};xf=Y5([ft(),_0(0,xR(Mi)),_0(1,Bt(oi)),_0(1,wi(yf)),X5("design:paramtypes",[Array,Object])],xf);var K5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},q5=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},ww=function(s,t){return function(e,i){t(e,i,s)}};let fb=class{constructor(s){this.groupRenderContribitions=s,this.numberType=sS}drawShape(s,t,e,i,n,r,a,o){const l=at(s,r==null?void 0:r.theme).group,{fill:h=l.fill,background:d,stroke:u=l.stroke,opacity:c=l.opacity,width:p=l.width,height:g=l.height,clip:f=l.clip,fillOpacity:_=l.fillOpacity,strokeOpacity:m=l.strokeOpacity,cornerRadius:v=l.cornerRadius,path:y=l.path,lineWidth:b=l.lineWidth,visible:x=l.visible}=s.attribute,S=hS(c,_,p,g,h),A=uS(c,m,p,g),k=zo(h,d),w=qh(u,b);if(!s.valid||!x||!f&&(!k&&!w||!(S||A||a||o||d)))return;if(y&&y.length&&n.drawContribution){const M=t.disableFill,C=t.disableStroke,R=t.disableBeginPath;t.disableFill=!0,t.disableStroke=!0,t.disableBeginPath=!0,y.forEach(I=>{n.drawContribution.getRenderContribution(I).draw(I,n.renderService,n,r)}),t.disableFill=M,t.disableStroke=C,t.disableBeginPath=R}else v===0||$(v)&&v.every(M=>M===0)?(t.beginPath(),t.rect(e,i,p,g)):(t.beginPath(),Co(t,e,i,p,g,v));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(PW));const T={doFill:k,doStroke:w};this._groupRenderContribitions.forEach(M=>{M.time===Ti.beforeFillStroke&&M.drawShape(s,t,e,i,k,w,S,A,l,n,a,o,T)}),f&&t.clip(),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,l),T.doFill&&(a?a(t,s.attribute,l):S&&(t.setCommonStyle(s,s.attribute,e,i,l),t.fill())),T.doStroke&&(o?o(t,s.attribute,l):A&&(t.setStrokeStyle(s,s.attribute,e,i,l),t.stroke())),this._groupRenderContribitions.forEach(M=>{M.time===Ti.afterFillStroke&&M.drawShape(s,t,e,i,k,w,S,A,l,n,a,o)})}draw(s,t,e,i){const{context:n}=e;if(!n)return;const{clip:r}=s.attribute;r?n.save():n.highPerformanceSave();const a=at(s,i==null?void 0:i.theme).group,o=n.modelMatrix;if(n.camera){const u=ve.allocate(),c=ve.allocate();wO(c,s,a),Pc(u,o||u,c),n.modelMatrix=u,ve.free(c),n.setTransform(1,0,0,1,0,0,!0)}else n.transformFromMatrix(s.transMatrix,!0);n.beginPath(),i.skipDraw?this.drawShape(s,n,0,0,e,i,()=>!1,()=>!1):this.drawShape(s,n,0,0,e);const{scrollX:l=a.scrollX,scrollY:h=a.scrollY}=s.attribute;let d;(l||h)&&n.translate(l,h),i&&i.drawingCb&&(d=i.drawingCb()),n.modelMatrix!==o&&ve.free(n.modelMatrix),n.modelMatrix=o,d&&d.then?d.then(()=>{r?n.restore():n.highPerformanceRestore()}):r?n.restore():n.highPerformanceRestore()}};fb=K5([ft(),ww(0,Bt(oi)),ww(0,wi(gO)),q5("design:paramtypes",[Object])],fb);var Z5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Sf=class extends Bu{constructor(){super(...arguments),this.numberType=Cc}drawShape(s,t,e,i,n,r,a,o){if(s.incremental&&n.multiGraphicOptions){const{startAtIdx:l,length:h}=n.multiGraphicOptions,{segments:d=[]}=s.attribute;if(l>d.length)return;const u=at(s).line,{fill:c=u.fill,stroke:p=u.stroke,opacity:g=u.opacity,fillOpacity:f=u.fillOpacity,strokeOpacity:_=u.strokeOpacity,lineWidth:m=u.lineWidth,visible:v=u.visible}=s.attribute,y=To(g,f,c),b=dS(g,_),x=zo(c),S=qh(p,m);if(!s.valid||!v||!x&&!S||!(y||b||a||o))return;const{context:A}=n;for(let k=l;k<l+h;k++)this.drawIncreaseSegment(s,A,d[k-1],d[k],s.attribute.segments[k],[u,s.attribute],e,i)}else super.drawShape(s,t,e,i,n,r,a,o)}drawIncreaseSegment(s,t,e,i,n,r,a,o){i&&(t.beginPath(),$W(t.nativeContext,e,i,{offsetX:a,offsetY:o}),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,n,r),t.setStrokeStyle(s,n,a,o,r),t.stroke())}};Sf=Z5([ft()],Sf);var J5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Af=class extends Du{constructor(){super(...arguments),this.numberType=Mc}drawShape(s,t,e,i,n,r,a){if(s.incremental&&n.multiGraphicOptions){const{startAtIdx:o,length:l}=n.multiGraphicOptions,{segments:h=[]}=s.attribute;if(o>h.length)return;const d=at(s).area,{fill:u=d.fill,fillOpacity:c=d.fillOpacity,opacity:p=d.opacity,visible:g=d.visible}=s.attribute,f=To(p,c,u),_=zo(u);if(!s.valid||!g||!_||!f&&!a)return;for(let m=o;m<o+l;m++)this.drawIncreaseSegment(s,t,h[m-1],h[m],s.attribute.segments[m],[d,s.attribute],e,i)}else super.drawShape(s,t,e,i,n,r,a)}drawIncreaseSegment(s,t,e,i,n,r,a,o){i&&(t.beginPath(),YW(t.camera?t:t.nativeContext,e,i,{offsetX:a,offsetY:o}),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,n,r),t.setCommonStyle(s,n,a,o,r),t.fill())}};Af=J5([ft()],Af);var xl,Q5=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},tV=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},md=function(s,t){return function(e,i){t(e,i,s)}},Hn=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};(function(s){s[s.NORMAL=0]="NORMAL",s[s.STOP=1]="STOP"})(xl||(xl={}));let _b=class extends xf{constructor(s,t,e,i){super(s,i),this.contributions=s,this.lineRender=t,this.areaRender=e,this.drawItemInterceptorContributions=i,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=xl.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new Is([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(s,t){return Hn(this,void 0,void 0,function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=s,this.lastDrawContext=t,this.checkingForDrawPromise=this.checkForDraw(t);const e=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,e)return;this.currentRenderService=s;const{context:i,x:n=0,y:r=0}=t;i&&(i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0),i.save(),t.restartIncremental&&this.clearScreen(this.currentRenderService,i,t),i.translate(n,r,!0),i.save(),s.renderTreeRoots.sort((a,o)=>{var l,h;return((l=a.attribute.zIndex)!==null&&l!==void 0?l:He.zIndex)-((h=o.attribute.zIndex)!==null&&h!==void 0?h:He.zIndex)}).forEach(a=>{this.renderGroup(a,t)}),this.hooks.completeDraw.tap("top-draw",()=>{i.restore(),i.restore(),i.draw(),i.inuse=!1,this.rendering=!1}))})}_increaseRender(s,t){return Hn(this,void 0,void 0,function*(){this.rendering=!0,yield this._renderIncrementalGroup(s,t)})}_renderIncrementalGroup(s,t){return Hn(this,void 0,void 0,function*(){this.count=s.count,yield new Promise(e=>{this.renderItem(s,t,{drawingCb:()=>Hn(this,void 0,void 0,function*(){if(s.count!==2)yield Aw(s,He.zIndex,(i,n)=>{if(this.status===xl.STOP)return!0;if(i.isContainer||n<this.currentIdx)return!1;const r=this.currFrameStartAt+s.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,t)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())}),e(!1);else{const i=s.getChildAt(0);if(i.incremental&&i.attribute.segments)for(i.incrementalAt||(i.incrementalAt=0);i.incrementalAt<i.attribute.segments.length;)t.multiGraphicOptions={startAtIdx:i.incrementalAt,length:i.incremental},this.renderItem(i,t),i.incrementalAt+=i.incremental,yield this.waitToNextFrame();else this.renderItem(i,t);e(!1)}})})}),this.hooks.completeDraw.call()})}waitToNextFrame(){return Hn(this,void 0,void 0,function*(){return new Promise(s=>{this.global.getRequestAnimationFrame()(()=>{s(!1)})})})}checkForDraw(s){return Hn(this,void 0,void 0,function*(){let t=this.rendering;return s.restartIncremental&&(t=!1,yield this.forceStop(),this.resetToInit()),t})}forceStop(){return Hn(this,void 0,void 0,function*(){this.rendering&&(this.status=xl.STOP,yield new Promise(s=>{this.hooks.completeDraw.tap("stopCb",()=>{this.status=xl.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter(t=>t.name!=="stopCb"),s(!1)})}))})}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(s,t){return Hn(this,void 0,void 0,function*(){if(!t.break&&s.attribute.visibleAll!==!1)return s.incremental&&t.startAtId===s._uid?(yield this._increaseRender(s,t),void(t.break=!0)):void(yield new Promise(e=>{this.renderItem(s,t,{drawingCb:()=>Hn(this,void 0,void 0,function*(){yield Aw(s,He.zIndex,i=>Hn(this,void 0,void 0,function*(){t.break||i.isContainer&&(yield this.renderGroup(i,t))})),e(!1)})})}))})}};_b=Q5([ft(),md(0,xR(Mi)),md(1,Bt(Sf)),md(2,Bt(Af)),md(3,Bt(oi)),md(3,wi(yf)),tV("design:paramtypes",[Array,Object,Object,Object])],_b);const eV=new Et(s=>{s(Rc).toSelf().inSingletonScope(),s(vS).toSelf().inSingletonScope(),s(yS).to(xf),s(PO).to(_b),s(yw).to(fb).inSingletonScope(),s(Mi).toService(yw),Fi(s,gO),s(dn).toSelf().inSingletonScope(),Fi(s,cS),Fi(s,Mi),s(bf).toSelf().inSingletonScope(),s(yf).toService(bf),Fi(s,yf)});function iV(s){s.load(eV)}function kf(){kf.__loaded||(kf.__loaded=!0,Pt.load(FN),Pt.load(w5),Pt.load(A5),Pt.load(k5),Pt.load(C5),j5(Pt),iV(Pt))}kf.__loaded=!1,kf();const Gt=Pt.get(Xx);et.global=Gt;const sV=Pt.get(hO);et.graphicUtil=sV;const nV=Pt.get(lO);et.transformUtil=nV;const rV=Pt.get(rO);et.graphicService=rV;const aV=Pt.get(lS);et.layerService=aV;class oV{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=ii.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,et.graphicService.hooks.onAttributeUpdate.tap(this.key,e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&e.stage!=null&&e.stage.renderNextFrame()}),et.graphicService.hooks.onSetStage.tap(this.key,e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&e.stage!=null&&e.stage.renderNextFrame()})}deactivate(t){et.graphicService.hooks.onAttributeUpdate.taps=et.graphicService.hooks.onAttributeUpdate.taps.filter(e=>e.name!==this.key),et.graphicService.hooks.onSetStage.taps=et.graphicService.hooks.onSetStage.taps.filter(e=>e.name!==this.key)}}class lV{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=ii.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,a=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const o=r/100,l=a/100;this.option3d.alpha=((e=this.option3d.alpha)!==null&&e!==void 0?e:0)+o,this.option3d.beta=((i=this.option3d.beta)!==null&&i!==void 0?i:0)+l,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class hV{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=ii.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,et.graphicService.hooks.onAddIncremental.tap(this.key,(e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&e.stage!=null&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))}),et.graphicService.hooks.onClearIncremental.tap(this.key,(e,i)=>{e.stage===t.stage&&e.stage!=null&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))})}deactivate(t){et.graphicService.hooks.onAddIncremental.taps=et.graphicService.hooks.onAddIncremental.taps.filter(e=>e.name!==this.key),et.graphicService.hooks.onClearIncremental.taps=et.graphicService.hooks.onClearIncremental.taps.filter(e=>e.name!==this.key)}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,et.global.getRequestAnimationFrame()(()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1}))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach(e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,Object.assign({x:t.x,y:t.y,width:i.viewWidth,height:i.viewHeight,stage:t,layer:i,clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))}),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class dV{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=ii.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}),et.graphicService.hooks.onRelease.tap(this.key,e=>{this.removeDom(e)})}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter(e=>e.name!==this.key)}drawHTML(t){et.global.env==="browser"&&t.renderTreeRoots.sort((e,i)=>{var n,r;return((n=e.attribute.zIndex)!==null&&n!==void 0?n:He.zIndex)-((r=i.attribute.zIndex)!==null&&r!==void 0?r:He.zIndex)}).forEach(e=>{this.renderGroupHTML(e)})}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren(e=>{e.isContainer?this.renderGroupHTML(e):this.renderGraphicHTML(e)})}removeDom(t){t.bindDom&&t.bindDom.size&&(t.bindDom.forEach(e=>{e.dom&&e.dom.parentElement.removeChild(e.dom)}),t.bindDom.clear())}renderGraphicHTML(t){const{html:e}=t.attribute;if(!e)return void(t.bindDom&&t.bindDom.size&&(t.bindDom.forEach(S=>{S.dom&&S.dom.parentElement.removeChild(S.dom)}),t.bindDom.clear()));const i=t.stage;if(!i)return;const{dom:n,container:r,width:a,height:o,style:l,anchorType:h="boundsLeftTop"}=e;t.bindDom||(t.bindDom=new Map);const d=t.bindDom.get(n);if(d&&(!r||r===d.container))return;let u,c;t.bindDom.forEach(({wrapGroup:S})=>{et.global.removeDom(S)}),typeof n=="string"?(u=new DOMParser().parseFromString(n,"text/html").firstChild,u.lastChild&&(u=u.lastChild.firstChild)):u=n;const p=r||(i.params.enableHtmlAttribute===!0?null:i.params.enableHtmlAttribute);c=p?typeof p=="string"?et.global.getElementById(p):p:t.stage.window.getContainer();const g=et.global.createDom({tagName:"div",width:a,height:o,style:l,parent:c});g&&(g.appendChild(u),t.bindDom.set(n,{dom:u,container:r,wrapGroup:g})),g.style.pointerEvents="none",g.style.position||(g.style.position="absolute",c.style.position="relative");let f=0,_=0;const m=t.globalAABBBounds;if(h==="position"||m.empty()){const S=t.globalTransMatrix;f=S.e,_=S.f}else f=m.x1,_=m.y1;const v=et.global.getElementTopLeft(c,!1),y=i.window.getTopLeft(!1),b=f+y.left-v.left,x=_+y.top-v.top;g.style.left=`${b}px`,g.style.top=`${x}px`}}const Tw=new Le;class uV{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=ii.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,e=>{e&&e===this.pluginService.stage&&e.dirtyBounds.clear()}),et.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(e,i,n,r)=>{e.glyphHost&&(e=e.glyphHost),i&&i===this.pluginService.stage&&i.renderCount&&(e.isContainer&&!e.shouldSelfChangeUpdateAABBBounds()||n&&(Tw.setValue(r.x1,r.y1,r.x2,r.y2),i.dirty(Tw,e.parent&&e.parent.globalTransMatrix)))}),et.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(e,i,n,r,a)=>{i&&i===this.pluginService.stage&&i.renderCount&&(e.isContainer&&!a||i.dirty(r.globalAABBBounds))}),et.graphicService.hooks.onRemove.tap(this.key,e=>{const i=e.stage;i&&i===this.pluginService.stage&&i.renderCount&&i&&i.dirty(e.globalAABBBounds)})}deactivate(t){et.graphicService.hooks.beforeUpdateAABBBounds.taps=et.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(e=>e.name!==this.key),et.graphicService.hooks.afterUpdateAABBBounds.taps=et.graphicService.hooks.afterUpdateAABBBounds.taps.filter(e=>e.name!==this.key),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter(e=>e.name!==this.key),et.graphicService.hooks.onRemove.taps=et.graphicService.hooks.onRemove.taps.filter(e=>e.name!==this.key)}}const Mw=new Le;class cV{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=ii.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new Le}tryLayout(t){if(this.layouting)return;this.layouting=!0;const e=t.parent;if(!e||!t.needUpdateLayout())return;const i=at(e).group,{display:n=i.display}=e.attribute;if(n!=="flex")return;const{flexDirection:r=i.flexDirection,flexWrap:a=i.flexWrap,justifyContent:o=i.justifyContent,alignItems:l=i.alignItems,alignContent:h=i.alignContent,clip:d=i.clip}=e.attribute;let u=0,c=0,p=0;if(e.forEachChildren(w=>{const T=w.AABBBounds;r==="column"||r==="column-reverse"?(c+=T.height(),u=Math.max(u,T.width())):(u+=T.width(),c=Math.max(c,T.height())),p+=T.x1,p+=T.y1,p+=T.x2,p+=T.y2}),!isFinite(p))return;const g=e.attribute.width||u,f=e.attribute.height||c;e.attribute.width||(e.attribute.width=0),e.attribute.height||(e.attribute.height=0),this.tempBounds.copy(e._AABBBounds);const _={main:{len:g,field:"x"},cross:{len:f,field:"y"},dir:1},m=_.main,v=_.cross;r==="row-reverse"?_.dir=-1:r==="column"?(m.len=f,v.len=g,m.field="y",v.field="x"):r==="column-reverse"&&(m.len=f,v.len=g,m.field="y",v.field="x",_.dir=-1);let y=0,b=0;const x=[];e.forEachChildren(w=>{const T=w.AABBBounds,M=m.field==="x"?T.width():T.height(),C=v.field==="x"?T.width():T.height();x.push({mainLen:M,crossLen:C}),y+=M,b=Math.max(b,C)});const S=[];if(y>m.len&&a==="wrap"){let w=0,T=0;x.forEach(({mainLen:M,crossLen:C},R)=>{w+M>m.len?w===0?(S.push({idx:R,mainLen:w+M,crossLen:C}),w=0,T=0):(S.push({idx:R-1,mainLen:w,crossLen:C}),w=M,T=C):(w+=M,T=Math.max(T,C))}),S.push({idx:x.length-1,mainLen:w,crossLen:T})}else S.push({idx:x.length-1,mainLen:y,crossLen:b});const A=e.getChildren();let k=0;if(S.forEach(w=>{this.layoutMain(e,A,o,m,x,k,w),k=w.idx+1}),b=S.reduce((w,T)=>w+T.crossLen,0),S.length===1)if(l==="flex-end"){const w=v.len;this.layoutCross(A,l,v,w,x,S[0],0)}else if(l==="center"){const w=v.len/2;this.layoutCross(A,l,v,w,x,S[0],0)}else A.forEach(w=>{w.attribute[v.field]=vn(w,v.field)});else if(h==="flex-start"){k=0;let w=0;S.forEach((T,M)=>{this.layoutCross(A,"flex-start",v,w,x,S[M],k),k=T.idx+1,w+=T.crossLen})}else if(h==="center"){k=0;let w=Math.max(0,(v.len-b)/2);S.forEach((T,M)=>{this.layoutCross(A,"center",v,w+T.crossLen/2,x,S[M],k),k=T.idx+1,w+=T.crossLen})}else if(h==="space-around"){k=0;const w=Math.max(0,(v.len-b)/S.length/2);let T=w;S.forEach((M,C)=>{this.layoutCross(A,"flex-start",v,T,x,S[C],k),k=M.idx+1,T+=M.crossLen+2*w})}else if(h==="space-between"){k=0;const w=Math.max(0,(v.len-b)/(2*S.length-2));let T=0;S.forEach((M,C)=>{this.layoutCross(A,"flex-start",v,T,x,S[C],k),k=M.idx+1,T+=M.crossLen+2*w})}A.forEach((w,T)=>{w.addUpdateBoundTag(),w.addUpdatePositionTag(),w.clearUpdateLayoutTag()}),e.addUpdateLayoutTag(),d||this.tempBounds.equals(e.AABBBounds)||(this.tryLayout(e),this.layouting=!1)}layoutMain(t,e,i,n,r,a,o){if(i==="flex-start"){let l=0;for(let h=a;h<=o.idx;h++)e[h].attribute[n.field]=l+vn(e[h],n.field),l+=r[h].mainLen}else if(i==="flex-end"){let l=n.len;for(let h=a;h<=o.idx;h++)l-=r[h].mainLen,e[h].attribute[n.field]=l+vn(e[h],n.field)}else if(i==="space-around")if(o.mainLen>=n.len){let l=0;for(let h=a;h<=o.idx;h++)e[h].attribute[n.field]=l+vn(e[h],n.field),l+=r[h].mainLen}else{const l=o.idx-a+1,h=(n.len-o.mainLen)/l/2;let d=h;for(let u=a;u<=o.idx;u++)e[u].attribute[n.field]=d+vn(e[u],n.field),d+=r[u].mainLen+2*h}else if(i==="space-between")if(o.mainLen>=n.len){let l=0;for(let h=a;h<=o.idx;h++)e[h].attribute[n.field]=l+vn(e[h],n.field),l+=r[h].mainLen}else{const l=o.idx-a+1,h=(n.len-o.mainLen)/(2*l-2);let d=0;for(let u=a;u<=o.idx;u++)e[u].attribute[n.field]=d+vn(e[u],n.field),d+=r[u].mainLen+2*h}else if(i==="center"){let l=(n.len-o.mainLen)/2;for(let h=a;h<=o.idx;h++)e[h].attribute[n.field]=l+vn(e[h],n.field),l+=r[h].mainLen}}layoutCross(t,e,i,n,r,a,o){if(e==="flex-end")for(let l=o;l<=a.idx;l++)t[l].attribute[i.field]=n-r[l].crossLen+vn(t[l],i.field);else if(e==="center")for(let l=o;l<=a.idx;l++)t[l].attribute[i.field]=n-r[l].crossLen/2+vn(t[l],i.field);else for(let l=o;l<=a.idx;l++)t[l].attribute[i.field]=n+vn(t[l],i.field)}activate(t){this.pluginService=t,et.graphicService.hooks.onAttributeUpdate.tap(this.key,e=>{e.glyphHost&&(e=e.glyphHost),this.tryLayout(e),this.layouting=!1}),et.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(e,i,n,r)=>{e.glyphHost&&(e=e.glyphHost),i&&i===this.pluginService.stage&&e.isContainer&&Mw.copy(r)}),et.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(e,i,n,r,a)=>{i&&i===this.pluginService.stage&&e.isContainer&&(Mw.equals(n)||(this.tryLayout(e),this.layouting=!1))}),et.graphicService.hooks.onSetStage.tap(this.key,e=>{e.glyphHost&&(e=e.glyphHost),this.tryLayout(e),this.layouting=!1})}deactivate(t){et.graphicService.hooks.onAttributeUpdate.taps=et.graphicService.hooks.onAttributeUpdate.taps.filter(e=>e.name!==this.key),et.graphicService.hooks.onSetStage.taps=et.graphicService.hooks.onSetStage.taps.filter(e=>e.name!==this.key)}}function vn(s,t){if(!s.attribute.boundsPadding)return 0;if(kH(s.attribute.boundsPadding))return s.attribute.boundsPadding;if($(s.attribute.boundsPadding)&&s.attribute.boundsPadding.length===1)return s.attribute.boundsPadding[0];const e=Ei(s.attribute.boundsPadding);return t==="x"?e[3]:t==="y"?e[0]:0}const xS=new DH;xS.addTimeline(WR);xS.setFPS(60);class pV{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Oe.Get(e,is.Color1),this.ambient=i;const n=fs(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/n,t[1]/n,t[2]/n]}computeColor(t,e){const i=this.formatedDir,n=Ci(ps((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let r;r=ht(e)?Oe.Get(e,is.Color1):e;const a=this.colorRgb;return`rgb(${a[0]*r[0]*n}, ${a[1]*r[1]*n}, ${a[2]*r[2]*n})`}}function gV(s,t,e,i){let n,r,a,o,l,h,d,u,c,p;const g=t[0],f=t[1],_=t[2],m=i[0],v=i[1],y=i[2],b=e[0],x=e[1],S=e[2];return Math.abs(g-b)<re&&Math.abs(f-x)<re&&Math.abs(_-S)<re?Am.identity(s):(d=g-b,u=f-x,c=_-S,p=1/Math.hypot(d,u,c),d*=p,u*=p,c*=p,n=v*c-y*u,r=y*d-m*c,a=m*u-v*d,p=Math.hypot(n,r,a),p?(p=1/p,n*=p,r*=p,a*=p):(n=0,r=0,a=0),o=u*a-c*r,l=c*n-d*a,h=d*r-u*n,p=Math.hypot(o,l,h),p?(p=1/p,o*=p,l*=p,h*=p):(o=0,l=0,h=0),s[0]=n,s[1]=o,s[2]=d,s[3]=0,s[4]=r,s[5]=l,s[6]=u,s[7]=0,s[8]=a,s[9]=h,s[10]=c,s[11]=0,s[12]=-(n*g+r*f+a*_),s[13]=-(o*g+l*f+h*_),s[14]=-(d*g+u*f+c*_),s[15]=1,s)}function fV(s,t,e,i,n,r,a){const o=1/(t-e),l=1/(i-n),h=1/(r-a);return s[0]=-2*o,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=-2*l,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2*h,s[11]=0,s[12]=(t+e)*o,s[13]=(n+i)*l,s[14]=(a+r)*h,s[15]=1,s}function Cw(s,t,e){const i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],l=t[5],h=t[6],d=t[7],u=t[8],c=t[9],p=t[10],g=t[11],f=t[12],_=t[13],m=t[14],v=t[15];let y=e[0],b=e[1],x=e[2],S=e[3];return s[0]=y*i+b*o+x*u+S*f,s[1]=y*n+b*l+x*c+S*_,s[2]=y*r+b*h+x*p+S*m,s[3]=y*a+b*d+x*g+S*v,y=e[4],b=e[5],x=e[6],S=e[7],s[4]=y*i+b*o+x*u+S*f,s[5]=y*n+b*l+x*c+S*_,s[6]=y*r+b*h+x*p+S*m,s[7]=y*a+b*d+x*g+S*v,y=e[8],b=e[9],x=e[10],S=e[11],s[8]=y*i+b*o+x*u+S*f,s[9]=y*n+b*l+x*c+S*_,s[10]=y*r+b*h+x*p+S*m,s[11]=y*a+b*d+x*g+S*v,y=e[12],b=e[13],x=e[14],S=e[15],s[12]=y*i+b*o+x*u+S*f,s[13]=y*n+b*l+x*c+S*_,s[14]=y*r+b*h+x*p+S*m,s[15]=y*a+b*d+x*g+S*v,s}function Es(s,t,e){const i=t[0],n=t[1],r=t[2];let a=e[3]*i+e[7]*n+e[11]*r+e[15];return a=a||1,s[0]=(e[0]*i+e[4]*n+e[8]*r+e[12])/a,s[1]=(e[1]*i+e[5]*n+e[9]*r+e[13])/a,s[2]=(e[2]*i+e[6]*n+e[10]*r+e[14])/a,s}class _V{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=ve.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=ve.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return gV(this._viewMatrixCached,t,e,i),this._vp||(this._vp=ve.allocate()),this._vp=Cw(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=ve.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=ve.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return fV(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=ve.allocate()),this._vp=Cw(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(e??n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return Es(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;Es(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const a=this.getProjectionScale(i);return{x:t*a+r[0],y:e*a+r[1]}}}let hl;function mV(){if(hl==null)try{hl=globalThis===window,hl&&(hl=!!document.createElement)}catch{hl=!1}}function SS(){mV();const s=et.global&&et.global.env;return s?s==="browser":hl}const Pw={BACKGROUND:"white"};class vV extends Kh{set viewBox(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}get viewBox(){return this._viewBox}get x(){return this._viewBox.x1}set x(t){this._viewBox.translate(t-this._viewBox.x1,0)}get y(){return this._viewBox.y1}set y(t){this._viewBox.translate(0,t-this._viewBox.y1)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this._viewBox.width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this._viewBox.height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return(t=this._background)!==null&&t!==void 0?t:Pw.BACKGROUND}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(t={}){var e;super({}),this._onVisibleChange=i=>{this._skipRender<0||(i?(this.dirtyBounds&&this.dirtyBounds.setValue(0,0,this._viewBox.width(),this._viewBox.height()),this._skipRender>1&&this.renderNextFrame(),this._skipRender=0):this._skipRender=1)},this.beforeRender=i=>{this._beforeRender&&this._beforeRender(i)},this.afterRender=i=>{this.renderCount++,this._afterRender&&this._afterRender(i),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach(n=>n(i)),this._afterNextRenderCbs=null},this.params=t,this.theme=new Tu,this.hooks={beforeRender:new Is(["stage"]),afterRender:new Is(["stage"])},this.global=et.global,!this.global.env&&SS()&&this.global.setEnv("browser"),this.window=Pt.get(Ng),this.renderService=Pt.get(EO),this.pluginService=Pt.get(RO),this.layerService=Pt.get(lS),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:t.canvasControled!==!1,title:t.title||"",canvas:t.canvas}),this._viewBox=new Le,t.viewBox?this._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):this._viewBox.setValue(0,0,this.width,this.height),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._subView=!(this._viewBox.width()===this.width&&this._viewBox.height()===this.height),this._background=(e=t.background)!==null&&e!==void 0?e:Pw.BACKGROUND,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),t.disableDirtyBounds===!1&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||xS,this.supportInteractiveLayer=t.interactiveLayer!==!1,this.timeline=new GR,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&ht(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new BH(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents,viewport:{viewBox:this._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:this.params.optimize.skipRenderWithOutRange!==!1?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(t=!1){t&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:a,fieldRatio:o=1,fieldDepth:l}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:a,fieldRatio:o,fieldDepth:l})}set3dOptions(t){var e,i,n,r,a,o;this.option3d=t;const l=this.get3dOptions(t),{light:h,center:d,camera:u,alpha:c,beta:p,fieldRatio:g,fieldDepth:f}=l,{dir:_=[1,1,-1],color:m="white",ambient:v}=h,y=((e=d.x)!==null&&e!==void 0?e:this.width/2)+((i=d.dx)!==null&&i!==void 0?i:0),b=((n=d.y)!==null&&n!==void 0?n:this.height/2)+((r=d.dy)!==null&&r!==void 0?r:0),x=[y,b,((a=d.z)!==null&&a!==void 0?a:0)+((o=d.dz)!==null&&o!==void 0?o:0)];let S=0,A=0,k=0;u||(S=Math.sin(c)+y,A=Math.sin(p)+b,k=Math.cos(c)*Math.cos(p)*1),this.light=new pV(_,m,v);const w={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:g,fieldDepth:f,viewParams:{pos:[S,A,k],center:x,up:[0,1,0]}};this.camera?this.camera.params=w:this.camera=new _V(w),t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new lV))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new oV))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new hV))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Pi;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new uV,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new cV))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new dV))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach(t=>{this.pluginService.unRegister(t)}))}tryUpdateAABBBounds(){const t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach(i=>{this.appendChild(i)})}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach(i=>{this.nextFrameRenderLayerSet.add(i)}),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()(()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1}))}_doRenderInThisFrame(){this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear()),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let n=0;n<t.length;n++){let r=t[n];r.layerMode==="virtual"&&(r=r.getNativeHandler().mainHandler.layer),i.includes(r)||i.push(r)}i.forEach(n=>{n.renderCount>this.renderCount||(n.renderCount=this.renderCount+1,n.render({renderService:this.renderService,background:n===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())},Object.assign({renderStyle:this.renderStyle},e)))}),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())},Object.assign({renderStyle:this.renderStyle},e))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.resize(t,e),this.forEachChildren(n=>{n.resize(t,e)}),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren(n=>{n.resizeView(t,e)}),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render()}setViewBox(t,e,i,n,r){let a=!0;typeof t=="object"?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),e===!1&&(a=!1)):(this.viewBox.setValue(t,e,t+i,e+n),r===!1&&(a=!1)),this.forEachChildren(o=>{o.resizeView(this.viewBox.width(),this.viewBox.height())}),a&&this.render()}setDpr(t,e=!0){this.forEachChildren(i=>{i.setDpr(t)}),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){this.pickerService||(this.pickerService=Pt.get(oh));const i=this.pickerService.pick(this.children,new We(t,e),{bounds:this.AABBBounds});return!(!(i!=null&&i.graphic)&&!(i!=null&&i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.eventSystem&&this.eventSystem.release(),this.pluginService.release(),this.forEach(t=>{t.release()}),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}getLayer(t){return this.children.filter(e=>e.name===t)[0]}renderTo(t,e){this.forEachChildren((i,n)=>{i.drawTo(t,Object.assign(Object.assign({},e),{renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:n===0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())}))})}renderToNewWindow(t=!0,e){const i=Pt.get(Ng);if(t)i.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""});else{const a=e?e.width():Math.min(this.viewWidth,this.window.width-this.x),o=e?e.height():Math.min(this.viewHeight,this.window.height-this.y);i.create({width:a,height:o,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""})}const n=e?-e.x1:0,r=e?-e.y1:0;return this.renderTo(i,{x:n,y:r,width:e?e.x2:i.width,height:e?e.y2:i.height}),i}toCanvas(t=!0,e){const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}}function yV(s){return new vV(s)}var bV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},xV=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};const m0={WIDTH:500,HEIGHT:500,DPR:1};let Zd=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(s){this._x=s}get y(){return this._y}set y(s){this._y=s}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(s){this._pixelWidth=s,this._displayWidth=s/(this._dpr||1)}get height(){return this._pixelHeight}set height(s){this._pixelHeight=s,this._displayHeight=s/(this._dpr||1)}getContext(s){return this._context}get visiable(){return this._visiable}set visiable(s){this._visiable=s,s?this.show():this.hide()}get dpr(){return this._dpr}set dpr(s){this._dpr=s,this.resize(this._displayWidth,this._displayHeight)}constructor(s){var t;const{nativeCanvas:e,width:i=m0.WIDTH,height:n=m0.HEIGHT,dpr:r=m0.DPR,x:a,y:o,id:l,canvasControled:h=!0}=s;this._x=a??0,this._y=o??0,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=s.visiable!==!1,this.controled=h,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._id=(t=e.id)!==null&&t!==void 0?t:l,l&&(e.id=l),this.init(s)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(s){}resize(s,t){}toDataURL(s,t){return""}readPixels(s,t,e,i){return this._context.getImageData(s,t,e,i)}convertToBlob(s){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...s){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}};Zd.env="browser",Zd=bV([ft(),xV("design:paramtypes",[Object])],Zd);var SV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let wf=class{configure(s,...t){s.env===this.type&&s.setActiveEnvContribution(this)}getNativeAABBBounds(s){return new Le}removeDom(s){return!1}createDom(s){return null}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(s){return document.getElementById(s)}getRootElement(){return document.body}loadJson(s){const t=fetch(s).then(e=>e.json());return t.then(e=>({data:e,state:"success"})).catch(()=>({data:null,state:"fail"})),t}loadArrayBuffer(s){return fetch(s).then(t=>t.arrayBuffer()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadBlob(s){return fetch(s).then(t=>t.blob()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}getElementTop(s,t){return 0}getElementLeft(s,t){return 0}getElementTopLeft(s,t){return{top:0,left:0}}};wf=SV([ft()],wf);var AV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},kV=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let Tf=class{constructor(){this._uid=ii.GenAutoIncrementId()}onChange(s){this._onChangeCb=s}configure(s,t){t.env===this.type&&s.setWindowHandler(this)}release(...s){this.releaseWindow()}isVisible(s){return!0}onVisibleChange(s){}getTopLeft(s){return{top:0,left:0}}};Tf=AV([ft(),kV("design:paramtypes",[])],Tf);var wV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},TV=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},Ew=function(s,t){return function(e,i){t(e,i,s)}};let mb=class{constructor(s){this.pickItemInterceptorContributions=s,this.type="default",this.global=et.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((s,t)=>s.order-t.order)}pick(s,t,e){let i={graphic:null,group:null};e.pickerService=this;let n=0,r=0;if(e&&e.bounds){if(!e.bounds.contains(t.x,t.y))return i;n=e.bounds.x1,r=e.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),e.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new Ke(1,0,0,1,n,r);let o;for(let l=s.length-1;l>=0&&(i=s[l].isContainer?this.pickGroup(s[l],t,a,e):this.pickItem(s[l],t,a,e),!i.graphic);l--)o||(o=i.group);if(i.graphic||(i.group=o),this.pickContext&&(this.pickContext.inuse=!1),i.graphic){let l=i.graphic;for(;l.parent;)l=l.parent;l.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=l.shadowHost)}return i}containsPoint(s,t,e){var i;return!!(!((i=this.pickItem(s,t,null,e??{pickContext:this.pickContext,pickerService:this}))===null||i===void 0)&&i.graphic)}pickGroup(s,t,e,i){let n={group:null,graphic:null};if(s.attribute.visibleAll===!1)return n;const r=i.pickContext,a=r.modelMatrix;if(r.camera){const p=s.transMatrix,g=ve.allocate();if(eb(g,p),a){if(g){const f=ve.allocate();r.modelMatrix=Pc(f,a,g),ve.free(g)}}else eb(g,s.globalTransMatrix),r.modelMatrix=g}if(this.InterceptorContributions.length)for(let p=0;p<this.InterceptorContributions.length;p++){const g=this.InterceptorContributions[p];if(g.beforePickItem){const f=g.beforePickItem(s,this,t,i,{parentMatrix:e});if(f)return r.modelMatrix!==a&&ve.free(r.modelMatrix),r.modelMatrix=a,f}}const o=s.transMatrix,l=nn.allocateByObj(e),h=new We(t.x,t.y);l.transformPoint(h,h);const d=s.AABBBounds.containsPoint(h);if(!d&&!s.stage.camera)return n;const u=this.pickItem(s,h.clone(),e,i);u&&u.graphic&&(n.graphic=u.graphic,n.params=u.params);const c=s.attribute.pickable!==!1&&d;return l.multiply(o.a,o.b,o.c,o.d,o.e,o.f),s.attribute.childrenPickable===!1||u&&u.graphic||OO(s,He.zIndex,p=>{if(p.isContainer){const g=new We(t.x,t.y),f=at(s).group,{scrollX:_=f.scrollX,scrollY:m=f.scrollY}=s.attribute;g.x-=_,g.y-=m,n=this.pickGroup(p,g,l,i)}else{const g=new We(t.x,t.y);l.transformPoint(g,g);const f=at(s).group,{scrollX:_=f.scrollX,scrollY:m=f.scrollY}=s.attribute;g.x-=_,g.y-=m;const v=this.pickItem(p,g,e,i);v&&v.graphic&&(n.graphic=v.graphic,n.params=v.params)}return!!n.graphic||!!n.group},!0,!!r.camera),r.modelMatrix!==a&&ve.free(r.modelMatrix),r.modelMatrix=a,n.graphic||n.group||!c||s.stage.camera||(n.group=s),nn.free(l),n}selectPicker(s){return this.pickerMap.get(s.numberType)||null}};mb=wV([ft(),Ew(0,Bt(oi)),Ew(0,wi(bl)),TV("design:paramtypes",[Object])],mb);let Rw=!1;const MV=new Et(s=>{Rw||(Rw=!0,s(qg).toSelf().inSingletonScope(),s(nf).to(qg).inSingletonScope(),s(Mi).toService(nf),s(Wy).toService(dn),Fi(s,Wy))});let Ow=!1;const CV=new Et(s=>{Ow||(Ow=!0,s(tf).toSelf().inSingletonScope(),s(df).to(tf).inSingletonScope(),s(Mi).toService(df),s(Kg).toSelf(),s(Xg).toSelf(),s(Fd).toService(Kg),s(Fd).toService(Xg),s(Fd).toService(dn),Fi(s,Fd))});let Iw=!1;const PV=new Et(s=>{Iw||(Iw=!0,s(Bu).toSelf().inSingletonScope(),s(Sf).toSelf().inSingletonScope(),s(of).to(Bu).inSingletonScope(),s(Mi).toService(of))});let Lw=!1;const EV=new Et(s=>{Lw||(Lw=!0,s(Du).toSelf().inSingletonScope(),s(rf).to(Du).inSingletonScope(),s(Mi).toService(rf),s(Vy).toService(dn),Fi(s,Vy),s(Af).toSelf().inSingletonScope())});let Bw=!1;const RV=new Et(s=>{Bw||(Bw=!0,s(ef).toSelf().inSingletonScope(),s(uf).to(ef).inSingletonScope(),s(Mi).toService(uf),s(Ky).toService(dn),Fi(s,Ky))});let Dw=!1;const OV=new Et(s=>{Dw||(Dw=!0,s(Zg).toSelf().inSingletonScope(),s(af).to(Zg).inSingletonScope(),s(Mi).toService(af),s(Uy).toService(dn),Fi(s,Uy))});let Fw=!1;const IV=new Et(s=>{Fw||(Fw=!0,s(db).to(rb).inSingletonScope(),s(Mi).toService(db),s(qy).toService(dn),Fi(s,qy))});let jw=!1;const LV=new Et(s=>{jw||(jw=!0,s(Qg).toSelf().inSingletonScope(),s(lf).to(Qg).inSingletonScope(),s(Mi).toService(lf),s(Yy).toService(dn),Fi(s,Yy))});let zw=!1;const BV=new Et(s=>{zw||(zw=!0,s(hf).to(ab).inSingletonScope(),s(Mi).toService(hf),s(Xy).toService(dn),Fi(s,Xy))});var DV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let vb=class{constructor(){this.numberType=cm}drawShape(s,t,e,i,n,r,a,o){n.drawContribution&&s.getSubGraphic().forEach(l=>{const h=n.drawContribution.getRenderContribution(l);h&&h.drawShape&&h.drawShape(l,t,e,i,n,r,a,o)})}draw(s,t,e,i){const{context:n}=e;if(!n||(n.highPerformanceSave(),!e.drawContribution))return;const r=at(s),a=s.getSubGraphic();a.length&&a.forEach(o=>{e.drawContribution.renderItem(o,e,{theme:r})}),n.highPerformanceRestore()}};vb=DV([ft()],vb);let Hw=!1;const FV=new Et(s=>{Hw||(Hw=!0,s(cf).to(vb).inSingletonScope(),s(Mi).toService(cf))});var jV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},zV=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let yb=class extends vs{constructor(){super(),this.numberType=aS,this.builtinContributions=[MO],this.init()}drawShape(s,t,e,i,n){const r=at(s).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=s.attribute;if(!s.valid||!h)return;const d=To(o,l,!0),u=To(o,a,!0);d&&(t.translate(e,i),this.beforeRenderStep(s,t,e,i,d,u,d,u,r,n),s.getFrameCache().draw(t,this.drawIcon),this.afterRenderStep(s,t,e,i,d,u,d,u,r,n))}drawIcon(s,t,e,i,n){var r;const a=at(s).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:d,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:c=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:_}=s.attribute,{backgroundWidth:m=o,backgroundHeight:v=l}=s.attribute;if(_&&(e+=s._marginArray[3],i+=s._marginArray[0]),s._hovered){const b=(m-o)/2,x=(v-l)/2;f===0?(t.beginPath(),t.rect(e-b,i-x,m,v)):(t.beginPath(),Co(t,e-b,i-x,m,v,f)),u&&(t.globalAlpha=c,t.fillStyle=u,t.fill()),p&&(t.globalAlpha=g,t.strokeStyle=p,t.stroke())}const y=d&&((r=s==null?void 0:s.resources)===null||r===void 0?void 0:r.get(d));y&&y.state==="success"&&(t.globalAlpha=h,t.drawImage(y.data,e,i,o,l))}draw(s,t,e){const i=at(s).richtext;this._draw(s,i,!1,e)}};yb=jV([ft(),zV("design:paramtypes",[])],yb);let Nw=!1;const HV=new Et(s=>{Nw||(Nw=!0,s(ub).to(yb).inSingletonScope(),s(Mi).toService(ub))});let Gw=!1;const NV=new Et(s=>{Gw||(Gw=!0,s(bw).to(ob).inSingletonScope(),s(Mi).toService(bw),s($y).toService(dn),Fi(s,$y))});var GV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let bb=class extends vs{constructor(){super(...arguments),this.type="rect3d",this.numberType=rS}drawShape(s,t,e,i,n,r,a,o){var l;const h=at(s,r==null?void 0:r.theme).rect3d,{fill:d=h.fill,stroke:u=h.stroke,x1:c,y1:p,x:g,y:f,opacity:_=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:v=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:b=h.visible}=s.attribute;let{width:x,height:S}=s.attribute;x=(x??c-g)||0,S=(S??p-f)||0;const A=(l=this.z)!==null&&l!==void 0?l:0,k=hS(_,m,x,S,d),w=uS(_,y,x,S),T=zo(d),M=qh(u,v);if(!s.valid||!b||!T&&!M||!(k||w||a||o))return;const{light:C,camera:R}=n.stage||{},I=s.findFace();if(d!==!1){t.setCommonStyle(s,s.attribute,e,i,h);let O=d;typeof O!="string"&&(O="black"),this.fill(e,i,A,I,O,t,C,a)}u!==!1&&(t.setStrokeStyle(s,s.attribute,e,i,h),this.stroke(e,i,A,I,t))}stroke(s,t,e,i,n){const r=i.vertices;i.edges.forEach(a=>{const o=r[a[0]],l={x:s+o[0],y:t+o[1],z:e+o[2]},h=r[a[1]],d={x:s+h[0],y:t+h[1],z:e+h[2]};n.beginPath(),n.moveTo(l.x,l.y,l.z),n.lineTo(d.x,d.y,d.z),n.stroke()})}fill(s,t,e,i,n,r,a,o){const l=Oe.Get(n,is.Color255),h=i.vertices,d=h.map(c=>r.view(c[0],c[1],c[2])[2]),u=[];i.polygons.forEach((c,p)=>{u.push({faceIdx:p,polygon:c});const{polygon:g,normal:f}=c,_=d[g[0]],m=d[g[1]],v=d[g[2]],y=d[g[3]];c.ave_z=_+m+v+y}),u.sort((c,p)=>p.polygon.ave_z-c.polygon.ave_z),u.forEach(c=>{const{polygon:p,normal:g}=c.polygon,f=h[p[0]],_=h[p[1]],m=h[p[2]],v=h[p[3]],y={x:s+f[0],y:t+f[1],z:e+f[2]},b={x:s+_[0],y:t+_[1],z:e+_[2]},x={x:s+m[0],y:t+m[1],z:e+m[2]},S={x:s+v[0],y:t+v[1],z:e+v[2]};r.beginPath(),r.moveTo(y.x,y.y,y.z),r.lineTo(b.x,b.y,b.z),r.lineTo(x.x,x.y,x.z),r.lineTo(S.x,S.y,S.z),r.closePath(),o?o(r,null,null):(r.fillStyle=a?a.computeColor(g,l):n,r.fill())})}draw(s,t,e){const i=at(s).rect;this._draw(s,i,!1,e)}};bb=GV([ft()],bb);let Ww=!1;const WV=new Et(s=>{Ww||(Ww=!0,s(hb).to(bb).inSingletonScope(),s(Mi).toService(hb))});var VV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};function UV(s,t,e,i,n,r,a){const{startAngle:o,endAngle:l}=s.getParsedAngle(),h=Kt(l-o),d=l>o;let u=!1;if(r<a){const c=r;r=a,a=c}if(r<=re)t.moveTo(e,i,n);else if(h>=jt-re)t.moveTo(e+r*de(o),i+r*se(o),n),t.arc(e,i,r,o,l,!d,n),a>re&&(t.moveTo(e+a*de(l),i+a*se(l),n),t.arc(e,i,a,l,o,d,n));else{const{outerDeltaAngle:c,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:f,innerEndAngle:_,innerStartAngle:m}=s.getParsePadAngle(o,l),v=r*de(g),y=r*se(g),b=a*de(_),x=a*se(_);c<.001?u=!0:(t.moveTo(e+v,i+y,n),t.arc(e,i,r,g,f,!d,n)),!(a>re)||p<.001?(t.lineTo(e+b,i+x,n),u=!0):(t.lineTo(e+b,i+x,n),t.arc(e,i,a,_,m,d,n))}return t.closePath(),u}function $V(s,t,e,i,n,r,a,o){const{startAngle:l,endAngle:h}=s.getParsedAngle(),d=Kt(h-l),u=h>l;let c=!1;if(a<=re)t.moveTo(e,i,n);else if(d>=jt-re)t.moveTo(e+a*de(l),i+a*se(l),n),t.arc(e,i,a,l,h,!u,n),t.lineTo(e+a*de(h),i+a*se(h),r),t.arc(e,i,a,h,l,u,r);else{const{innerouterDeltaAngle:p,innerouterStartAngle:g,innerouterEndAngle:f}=o(l,h),_=a*de(g),m=a*se(g),v=a*de(f),y=a*se(f);p<.001?c=!0:(t.moveTo(e+_,i+m,n),t.arc(e,i,a,g,f,!u,n),t.lineTo(e+v,i+y,r),t.arc(e,i,a,f,g,u,r))}return t.closePath(),c}let xb=class extends vs{constructor(){super(...arguments),this.numberType=Tc}drawShape(s,t,e,i,n,r,a,o){var l;const h=at(s,r==null?void 0:r.theme).arc,{fill:d=h.fill}=s.attribute,u=this.valid(s,h,a,o);if(!u)return;const{fVisible:c,sVisible:p,doFill:g,doStroke:f}=u,_=(l=this.z)!==null&&l!==void 0?l:0,{outerRadius:m=h.outerRadius,innerRadius:v=h.innerRadius,height:y=10}=s.attribute,b=Oe.Get(d,is.Color255),{light:x}=n.stage||{},S=n.hack_pieFace,A={top:_,bottom:_+y},k={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};S==="bottom"||S==="top"?(t.beginPath(),UV(s,t,e,i,A[S],m,v),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,h),g&&(a?a(t,s.attribute,h):c&&(t.setCommonStyle(s,s.attribute,e,i,h),t.fillStyle=x?x.computeColor(k[S],b):d,t.fill())),f&&(o?o(t,s.attribute,h):p&&(t.setStrokeStyle(s,s.attribute,e,i,h),t.stroke()))):S!=="outside"&&S!=="inside"||(S==="inside"&&(t.save(),t.beginPath(),t.arc(e,i,v,0,jt,!0,A.top),t.clip()),t.beginPath(),$V(s,t,e,i,A.top,A.bottom,S==="outside"?m:v,(w,T)=>{const{outerDeltaAngle:M,innerDeltaAngle:C,outerStartAngle:R,outerEndAngle:I,innerEndAngle:O,innerStartAngle:L}=s.getParsePadAngle(w,T);return S==="outside"?{innerouterDeltaAngle:M,innerouterEndAngle:I,innerouterStartAngle:R}:{innerouterDeltaAngle:C,innerouterEndAngle:O,innerouterStartAngle:L}}),t.setShadowBlendStyle&&t.setShadowBlendStyle(s,s.attribute,h),g&&(a?a(t,s.attribute,h):c&&(t.setCommonStyle(s,s.attribute,e,i,h),t.fillStyle=x?x.computeColor(k[S],b):d,t.fill())),f&&(o?o(t,s.attribute,h):p&&(t.setStrokeStyle(s,s.attribute,e,i,h),t.stroke())),S==="inside"&&t.restore())}draw(s,t,e,i){const n=at(s,i==null?void 0:i.theme).arc;this._draw(s,n,!1,e,i)}};xb=VV([ft()],xb);let Vw=!1;const YV=new Et(s=>{Vw||(Vw=!0,s(lb).to(xb).inSingletonScope(),s(Mi).toService(lb))});var XV=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Sb=class extends vs{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=nS}drawShape(s,t,e,i,n,r,a,o){var l;const h=at(s,r==null?void 0:r.theme).polygon,{fill:d=h.fill,stroke:u=h.stroke,face:c=[!0,!0,!0,!0,!0,!0]}=s.attribute,p=(l=this.z)!==null&&l!==void 0?l:0;if(!this.valid(s,h,a,o))return;const{light:g,camera:f}=n.stage||{},_=s.findFace();if(d!==!1){t.setCommonStyle(s,s.attribute,e,i,h);let m=d;typeof m!="string"&&(m="black"),this.fill(e,i,p,_,c,m,t,g,f,s,h,a)}u!==!1&&(t.setStrokeStyle(s,s.attribute,e,i,h),this.stroke(e,i,p,_,t))}stroke(s,t,e,i,n){const r=i.vertices;i.edges.forEach(a=>{const o=r[a[0]],l=r[a[1]],h={x:s+o[0],y:t+o[1],z:e+o[2]},d={x:s+l[0],y:t+l[1],z:e+l[2]};n.beginPath(),n.moveTo(h.x,h.y,h.z),n.lineTo(d.x,d.y,d.z),n.stroke()})}fill(s,t,e,i,n,r,a,o,l,h,d,u){const c=Oe.Get(r,is.Color255),p=i.vertices,g=p.map(_=>a.view(_[0],_[1],_[2])[2]),f=[];i.polygons.forEach((_,m)=>{if(!n[m])return;f.push({faceIdx:m,polygon:_});const{polygon:v,normal:y}=_,b=g[v[0]],x=g[v[1]],S=g[v[2]],A=g[v[3]];_.ave_z=b+x+S+A}),f.sort((_,m)=>m.polygon.ave_z-_.polygon.ave_z),f.forEach(_=>{const{polygon:m,normal:v}=_.polygon,y=p[m[0]],b=p[m[1]],x=p[m[2]],S=p[m[3]],A={x:s+y[0],y:t+y[1],z:e+y[2]},k={x:s+b[0],y:t+b[1],z:e+b[2]},w={x:s+x[0],y:t+x[1],z:e+x[2]},T={x:s+S[0],y:t+S[1],z:e+S[2]};a.beginPath(),a.moveTo(A.x,A.y,A.z),a.lineTo(k.x,k.y,k.z),a.lineTo(w.x,w.y,w.z),a.lineTo(T.x,T.y,T.z),a.closePath(),u?u(a,h.attribute,d):(a.fillStyle=o?o.computeColor(v,c):r,a.fill())})}draw(s,t,e){const i=at(s).polygon;this._draw(s,i,!1,e)}};Sb=XV([ft()],Sb);let Uw=!1;const KV=new Et(s=>{Uw||(Uw=!0,s(cb).to(Sb).inSingletonScope(),s(Mi).toService(cb))});function qV(){_t.RegisterGraphicCreator("arc",mS)}function ZV(){_t.RegisterGraphicCreator("arc3d",SO)}function JV(){_t.RegisterGraphicCreator("area",xO)}function QV(){_t.RegisterGraphicCreator("circle",NN)}function tU(){_t.RegisterGraphicCreator("glyph",vO)}function eU(){_t.RegisterGraphicCreator("group",oS)}function iU(){_t.RegisterGraphicCreator("image",_S)}function sU(){_t.RegisterGraphicCreator("line",fS)}function nU(){_t.RegisterGraphicCreator("path",bO)}function rU(){_t.RegisterGraphicCreator("polygon",AO)}function aU(){_t.RegisterGraphicCreator("pyramid3d",kO)}function oU(){_t.RegisterGraphicCreator("rect",Ch)}function lU(){_t.RegisterGraphicCreator("rect3d",mO)}function hU(){_t.RegisterGraphicCreator("richtext",yO)}function dU(){_t.RegisterGraphicCreator("symbol",ym)}function uU(){_t.RegisterGraphicCreator("text",Mo)}function cU(){_t.RegisterGraphicCreator("shadowRoot",tW)}function pU(){_t.RegisterGraphicCreator("wrapText",GN)}const IO=SS(),ga=IO&&globalThis?globalThis.document:void 0;function rn(s){return(s==="desktop-browser"||s==="mobile-browser")&&IO}function Ga(s){return Wa(s)||s==="mobile-browser"}function Wa(s){return s.includes("miniApp")||s==="lynx"||s==="wx"}let v0=0;function No(){return v0>=9999999&&(v0=0),v0++}function rr(s){return s!=null&&s!==""&&(!!dt(s)||+s==+s)}function gU(s){if(N(s))return s;const t=+s;return N(t)?t:0}function Sl(s){return!(!s||s.length===0)&&!P(s[0])&&!P(s[0].dataId)&&$(s[0].fields)}const Go=(s,t,e)=>(s.fields=t||[],s.fname=e,s),fU=s=>t=>It(t,s),vo=s=>{Nt.getInstance().error(s)},_U=s=>{const t=[],e=s.length;let i,n,r,a=null,o=0,l="";s+="";const h=()=>{t.push(l+s.substring(i,n)),l="",i=n+1};for(i=0,n=0;n<e;n+=1)if(r=s[n],r==="\\")l+=s.substring(i,n),l+=s.substring(++n,++n),i=n;else if(r===a)h(),a=null,o=-1;else{if(a)continue;i===o&&r==='"'||i===o&&r==="'"?(i=n+1,a=r):r!=="."||o?r==="["?(n>i&&h(),i=n+1,o=i):r==="]"&&(o||vo("Access path missing open bracket: "+s),o>0&&h(),o=0,i=n+1):n>i?h():i=n+1}return o&&vo("Access path missing closing bracket: "+s),a&&vo("Access path missing closing quote: "+s),n>i&&(n+=1,h()),t},$w=(s,t,e={})=>{if(K(s))return s;const i=_U(s),n=i.length===1?i[0]:s;return Go((e&&e.get||fU)(i),[n],n)},In=(s,t,e={})=>{if($(s)){const i=s.map(n=>$w(n,t,e));return n=>i.map(r=>r(n))}return $w(s,t,e)};In("id");const mU=Go(function(s){return s},[],"identity"),vU=Go(function(){return 0},[],"zero");Go(function(){return 1},[],"one");Go(function(){return!0},[],"true");Go(function(){return!1},[],"false");Go(function(){return{}},[],"emptyObject");const Ab=(s,t)=>{const e=K(t)?t:r=>r;let i,n;if(s&&s.length){const r=s.length;for(let a=0;a<r;a+=1){let o=e(s[a]);P(o)||!dt(o=+o)||Number.isNaN(o)||(P(i)?(i=o,n=o):(i=Math.min(i,o),n=Math.max(n,o)))}return[i,n]}return[i,n]},km=(s,t,e,i=!0)=>{if(t===e)return!0;if(P(t)||P(e))return P(t)&&P(e);if(!ny(t)&&!ny(e))return t===e;const n=$(t)?t:t[s],r=$(e)?e:e[s];return n===r||i!==!1&&($(r)?!(!$(n)||r.length!==n.length||!r.every((a,o)=>a===n[o])):!!$t(r)&&!(!$t(n)||Object.keys(r).length!==Object.keys(n).length||!Object.keys(r).every(a=>km(a,r,n))))},Ds=(s,t)=>P(s)?t:ht(s)?t*parseFloat(s)/100:s;function yU(s,t,e,i){const n=i-s*s,r=Math.abs(n)<1e-24?0:(e-s*t)/n;return[t-r*s,r]}function LO(s,t,e,i){let n,r,a=-1;s.forEach(o=>{n=t(o),r=e(o),!P(n)&&(n=+n)>=n&&!P(r)&&(r=+r)>=r&&i(n,r,++a)})}function bU(s,t,e,i,n){let r=0,a=0;return LO(s,t,e,(o,l)=>{const h=l-n(o),d=l-i;r+=h*h,a+=d*d}),1-r/a}function xU(s,t=i=>i.x,e=i=>i.y){let i=0,n=0,r=0,a=0,o=0;LO(s,t,e,(d,u)=>{++o,i+=(d-i)/o,n+=(u-n)/o,r+=(d*u-r)/o,a+=(d*d-a)/o});const l=yU(i,n,r,a),h=d=>l[0]+l[1]*d;return{coef:l,predict:h,rSquared:bU(s,t,e,n,h)}}function Di(s){return s==="horizontal"}function Yw(s){return s==="vertical"}var Ve;(function(s){s.Identity="identity",s.Linear="linear",s.Log="log",s.Pow="pow",s.Sqrt="sqrt",s.Symlog="symlog",s.Time="time",s.Quantile="quantile",s.Quantize="quantize",s.Threshold="threshold",s.Ordinal="ordinal",s.Point="point",s.Band="band"})(Ve||(Ve={}));const BO={};Object.values(Ve).forEach(s=>{BO[s]=!0});function qt(s){switch(s){case Ve.Linear:case Ve.Log:case Ve.Pow:case Ve.Sqrt:case Ve.Symlog:case Ve.Time:return!0;default:return!1}}function kb(s){return!!BO[s]}function ji(s){switch(s){case Ve.Ordinal:case Ve.Point:case Ve.Band:return!0;default:return!1}}function dl(s){return s}const SU=s=>s<0?-Math.sqrt(-s):Math.sqrt(s),AU=s=>s<0?-s*s:s*s,kU=s=>-Math.log(-s),wU=s=>-Math.exp(-s),TU=s=>isFinite(s)?Math.pow(10,s):s<0?0:s,Xw=s=>s===10?TU:s===Math.E?Math.exp:t=>Math.pow(s,t),Kw=s=>s===Math.E?Math.log:s===10?Math.log10:s===2?Math.log2:(s=Math.log(s),t=>Math.log(t)/s),qw=s=>t=>Math.sign(t)*Math.log1p(Math.abs(t/s)),Zw=s=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*s;function wb(s,t){if(s=Number(s),t=Number(t),t-=s)return i=>(i-s)/t;const e=Number.isNaN(t)?NaN:.5;return()=>e}function Jw(s,t,e){const i=s[0],n=s[1],r=t[0],a=t[1];let o,l;return n<i?(o=wb(n,i),l=e(a,r)):(o=wb(i,n),l=e(r,a)),h=>l(o(h))}function AS(s,t,e){let i;return i=s===1?s+2*e:s-t+2*e,s?i>0?i:1:0}function DO(s,t,e,i){return e===1&&(e=0),AS(s,e,i)*(t/(1-e))}function MU(s,t,e,i,n){const r=AS(s,e,i);let a=t/Math.max(1,r||1);n&&(a=Math.floor(a));let o=a*(1-e);return n&&(o=Math.round(o)),o}function FO(s,t){const e=(s[1]-s[0])/(t[1]-t[0]),i=s[0]-e*t[0];return[i,e+i]}function CU(s,t,e){const i=Math.min(s.length,t.length)-1,n=new Array(i),r=new Array(i);let a=-1;for(s[i]<s[0]&&(s=s.slice().reverse(),t=t.slice().reverse());++a<i;)n[a]=wb(s[a],s[a+1]),r[a]=e(t[a],t[a+1]);return function(o){const l=fE(s,o,1,i)-1;return r[l](n[l](o))}}const jO=(s,t)=>{const e=s.slice();let i=0,n=e.length-1,r=e[i],a=e[n];return a<r&&([i,n]=[n,i],[r,a]=[a,r]),e[i]=t.floor(r),e[n]=t.ceil(a),e},zO=(s,t=!1)=>{const e=Math.floor(Math.log10(s)),i=s/Math.pow(10,e);let n;return n=t?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10,n*Math.pow(10,e)},PU=(s,t)=>{let e,i;return t[0]<t[1]?(e=t[0],i=t[1]):(e=t[1],i=t[0]),Math.min(Math.max(s,e),i)};class HO{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:E(this._rangeFactorStart)&&E(this._rangeFactorEnd)&&t.length===2?(this._wholeRange=FO(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(t.length===2&&t.every(n=>n>=0&&n<=1)&&(this._wholeRange=null,t[0]===0&&t[1]===1?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):E(this._rangeFactorStart)&&E(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return P(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,t!==0||!P(this._rangeFactorEnd)&&this._rangeFactorEnd!==1?(this._rangeFactorStart=t,this._rangeFactorEnd=(i=this._rangeFactorEnd)!==null&&i!==void 0?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return P(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,t!==0||!P(this._rangeFactorStart)&&this._rangeFactorStart!==0?(this._rangeFactorEnd=t,this._rangeFactorStart=(i=this._rangeFactorStart)!==null&&i!==void 0?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:n}=this._fishEyeOptions,r=this.range(),a=r[0],o=r[r.length-1],l=Math.min(a,o),h=Math.max(a,o),d=xi((t=this._fishEyeOptions.focus)!==null&&t!==void 0?t:0,l,h),u=P(n)?(h-l)*i:n;let c=Math.exp(e);c=c/(c-1)*u;const p=e/u;this._fishEyeTransform=g=>{const f=Math.abs(g-d);if(f>=u)return g;if(f<=1e-6)return d;const _=c*(1-Math.exp(-f*p))/f*.75+.25;return d+(g-d)*_}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}const Tb=Symbol("implicit");class Po extends HO{specified(t){var e;return t?(this._specified=Object.assign((e=this._specified)!==null&&e!==void 0?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=Ve.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Tb}clone(){return new Po().domain(this._domain).range(this._ordinalRange).unknown(this._unknown)}calculateVisibleDomain(t){return E(this._rangeFactorStart)&&E(this._rangeFactorEnd)&&t.length===2?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){const e=`${t}`,i=this._getSpecifiedValue(e);if(i!==void 0)return i;let n=this._index.get(e);if(!n){if(this._unknown!==Tb)return this._unknown;n=this._domain.push(t),this._index.set(e,n)}const r=this._ordinalRange[(n-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(r):r}invert(t){let e=0;for(;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}domain(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;for(const e of t){const i=`${e}`;this._index.has(i)||this._index.set(i,this._domain.push(e))}return this}range(t){if(!t)return this._ordinalRange.slice();const e=Array.from(t);return this._ordinalRange=e,this}}function Qw(s,t,e,i){let n;const r=[];let a;if(t=Math.floor(+t),s=Math.floor(+s),!(e=Math.floor(+e)))return[];if(s===t)return[s];if(n=t<s){const h=s;s=t,t=h}let o=Bx(1,t-s+1)(e);if(a=Math.floor((t-s+1)/o),!i)for(;Math.ceil((t-s+1)/a)>e&&o>1;)o-=1,a=Math.floor((t-s)/o);let l=s;for(;l<=t;)r.push(l),l+=a;return n&&r.reverse(),r}function EU(s,t,e){const i=[];let n;if(t=Math.floor(+t),s=Math.floor(+s),e=Bx(1,t-s+1)(Math.floor(+e)),n=t<s){const a=s;s=t,t=a}let r=s;for(;r<=t;)i.push(r),r+=e;return n&&i.reverse(),i}class Wo extends Po{constructor(t){super(),this.type=Ve.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;const i=this._calculateWholeRange(this._range,e),n=super.domain().length,r=i[1]<i[0];let a=i[Number(r)-0];const o=i[1-Number(r)],l=AS(n,this._paddingInner,this._paddingOuter);return this._step=(o-a)/Math.max(1,l||1),this._round&&(this._step=Math.floor(this._step)),a+=(o-a-this._step*(n-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(a=Math.round(a),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:r,start:r?a+this._step*(n-1):a,count:n},this.generateFishEyeTransform(),this}scale(t){if(!this._bandRangeState)return;const e=`${t}`,i=this._getSpecifiedValue(e);if(i!==void 0)return i;let n=this._index.get(e);if(!n){if(this._unknown!==Tb)return this._unknown;n=this._domain.push(t),this._index.set(e,n)}const{count:r,start:a,reverse:o}=this._bandRangeState,l=a+(o?-1:1)*((n-1)%r)*this._step;return this._fishEyeTransform?this._fishEyeTransform(l):l}_calculateWholeRange(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){let i;if(E(this._rangeFactorStart)&&E(this._rangeFactorEnd)&&t.length===2){const r=FO(t,[this._rangeFactorStart,this._rangeFactorEnd]);i=Math.abs(r[1]-r[0])}else i=Math.abs(t[1]-t[0]);const n=MU(super.domain().length,i,this._paddingInner,this._paddingOuter,this._round);n<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):n>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=n,this._isFixed=!1)}if(this.isBandwidthFixed()){const i=DO(super.domain().length,this._bandwidth,this._paddingInner,this._paddingOuter)*Math.sign(t[1]-t[0]),n=Math.min((t[1]-t[0])/i,1);if(E(this._rangeFactorStart)&&E(this._rangeFactorEnd)){if(i>0){const o=t[0]-i*this._rangeFactorStart,l=o+i;this._wholeRange=[o,l]}else{const o=t[1]+i*(1-this._rangeFactorEnd),l=o-i;this._wholeRange=[l,o]}const r=this._rangeFactorStart+n<=1,a=this._rangeFactorEnd-n>=0;e==="rangeFactorStart"&&r?this._rangeFactorEnd=this._rangeFactorStart+n:e==="rangeFactorEnd"&&a?this._rangeFactorStart=this._rangeFactorEnd-n:t[0]<=t[1]?r?this._rangeFactorEnd=this._rangeFactorStart+n:a?this._rangeFactorStart=this._rangeFactorEnd-n:(this._rangeFactorStart=0,this._rangeFactorEnd=n):a?this._rangeFactorStart=this._rangeFactorEnd-n:r?this._rangeFactorEnd=this._rangeFactorStart+n:(this._rangeFactorStart=1-n,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=n,this._wholeRange=[t[0],t[0]+i];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(E(this._rangeFactorStart)&&E(this._rangeFactorEnd)&&e.length){const i=this._getInvertIndex(t[0]),n=this._getInvertIndex(t[1]);return e.slice(Math.min(i,n),Math.max(i,n)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[Qn(t[0]),Qn(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[Qn(t[0]),Qn(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return t===-1?e:Qw(0,e.length-1,t,!1).map(i=>e[i])}tickData(t=10){return this.ticks(t).map((e,i)=>({index:i,tick:e,value:(this.scale(e)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])}))}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Qw(0,e.length-1,t,!0).filter(i=>i<e.length).map(i=>e[i])}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return EU(0,e.length-1,t).map(i=>e[i])}_getInvertIndex(t){let e=0;const i=this.step()/2,n=this.bandwidth()/2,r=this._domain.length,a=this.range(),o=a[0]>a[a.length-1];for(e=0;e<r;e++){const l=this.scale(this._domain[e])+n;if(e===0&&(!o&&!Vn(t,l+i)||o&&!bn(t,l-i))||e===r-1||!bn(t,l-i)&&!Vn(t,l+i))break}return e>=0&&e<=r-1?e:r-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return t!==void 0?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return t!==void 0?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return t!==void 0?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return t!==void 0?(this._round=t,this.rescale(e)):this._round}align(t,e){return t!==void 0?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return P(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return P(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?(t==="auto"?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth=t==="auto"?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth=t==="auto"?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&dt(this._userBandwidth)}clone(){var t,e,i;return new Wo(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth((t=this._userBandwidth)!==null&&t!==void 0?t:"auto",!0).maxBandwidth((e=this._maxBandwidth)!==null&&e!==void 0?e:"auto",!0).minBandwidth((i=this._maxBandwidth)!==null&&i!==void 0?i:"auto")}}const{interpolateRgb:y0}=Rj;function RU(s,t){const e=typeof t;let i;if(P(t)||e==="boolean")return()=>t;if(e==="number")return Wd(s,t);if(e==="string"){if(i=Qe.parseColorString(t)){const n=y0(Qe.parseColorString(s),i);return r=>n(r).formatRgb()}return Wd(Number(s),Number(t))}return t instanceof Bi?y0(s,t):t instanceof Qe?y0(s.color,t.color):t instanceof Date?vj(s,t):Wd(Number(s),Number(t))}class NO extends HO{constructor(t=dl,e=dl){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=dl,this._piecewise=Jw,this._interpolate=RU}calculateVisibleDomain(t){var e;return E(this._rangeFactorStart)&&E(this._rangeFactorEnd)&&t.length===2?[this.invert(t[0]),this.invert(t[1])]:(e=this._niceDomain)!==null&&e!==void 0?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise(((e=this._niceDomain)!==null&&e!==void 0?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),((e=this._niceDomain)!==null&&e!==void 0?e:this._domain).map(this.transformer),Wd)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return((i=this._niceDomain)!==null&&i!==void 0?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const n=Array.from(t,Qn);return this._domain=n,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=mj,this.rescale(e)}rescale(t){var e;if(t)return this;const i=(e=this._niceDomain)!==null&&e!==void 0?e:this._domain,n=i.length,r=this._range.length;let a=Math.min(n,r);if(n&&n<r&&this._forceAlign){const o=r-n+1,l=i[n-1],h=n>=2?(l-i[n-2])/o:0;for(let d=1;d<=o;d++)i[n-2+d]=l-h*(o-d);a=r}return this._autoClamp&&(this._clamp=Bx(i[0],i[a-1])),this._piecewise=a>2?CU:Jw,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:dl),this.rescale(i)):this._clamp!==dl}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(e??[]).map((i,n)=>({index:n,tick:i,value:(this.scale(i)-this._range[0])/(this._range[1]-this._range[0])}))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return P(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return P(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const OU=Math.sqrt(50),IU=Math.sqrt(10),LU=Math.sqrt(2),jp=[1,2,5,10],tT=(s,t,e)=>{let i=1,n=s;const r=Math.floor((t-1)/2),a=Math.abs(s);return s>=0&&s<=Number.MIN_VALUE?n=0:s<0&&s>=-Number.MIN_VALUE?n=-(t-1):!e&&a<1?i=GO(a).step:(e||a>1)&&(n=Math.floor(s)-r*i),i>0?(s>0?n=Math.max(n,0):s<0&&(n=Math.min(n,-(t-1)*i)),pE(0,t).map(o=>n+o*i)):s>0?Mf(0,-(t-1)/i,i):Mf((t-1)/i,0,i)},BU=$h((s,t,e,i)=>{let n,r,a,o,l=-1;if(e=+e,(s=+s)==(t=+t))return[s];if(Math.abs(s-t)<=Number.MIN_VALUE&&e>0)return[s];if((n=t<s)&&(r=s,s=t,t=r),o=kS(s,t,e).step,!isFinite(o))return[];if(o>0){let h=Math.round(s/o),d=Math.round(t/o);for(h*o<s&&++h,d*o>t&&--d,a=new Array(r=d-h+1);++l<r;)a[l]=(h+l)*o}else if(o<0&&(i!=null&&i.noDecimals)){o=1;const h=Math.ceil(s),d=Math.floor(t);if(!(h<=d))return[];for(a=new Array(r=d-h+1);++l<r;)a[l]=h+l}else{o=-o;let h=Math.round(s*o),d=Math.round(t*o);for(h/o<s&&++h,d/o>t&&--d,a=new Array(r=d-h+1);++l<r;)a[l]=(h+l)/o}return n&&a.reverse(),a}),Mf=(s,t,e)=>{let i,n,r=-1;if(e>0){let a=Math.floor(s/e),o=Math.ceil(t/e);for((a+1)*e<s&&++a,(o-1)*e>t&&--o,n=new Array(i=o-a+1);++r<i;)n[r]=(a+r)*e}else{e=-e;let a=Math.floor(s*e),o=Math.ceil(t*e);for((a+1)/e<s&&++a,(o-1)/e>t&&--o,n=new Array(i=o-a+1);++r<i;)n[r]=(a+r)/e}return n},DU=(s,t,e)=>{let i;const n=s[0],r=s[s.length-1],a=t-s.length;if(r<=0){const h=[];for(i=a;i>=1;i--)h.push(n-i*e);return h.concat(s)}if(n>=0){for(i=1;i<=a;i++)s.push(r+i*e);return s}let o=[];const l=[];for(i=1;i<=a;i++)i%2==0?o=[n-Math.floor(i/2)*e].concat(o):l.push(r+Math.ceil(i/2)*e);return o.concat(s).concat(l)},Cf=$h((s,t,e,i)=>{let n,r,a;if(e=+e,(s=+s)==(t=+t)||Math.abs(s-t)<=Number.MIN_VALUE&&e>0)return tT(s,e,i==null?void 0:i.noDecimals);(n=t<s)&&(a=s,s=t,t=a);const o=kS(s,t,e);let l=o.step;if(!isFinite(l))return[];if(l>0){let h=1;const{power:d,gap:u}=o,c=u===10?2*10**d:1*10**d;for(;h<=5&&(r=Mf(s,t,l),r.length>e+1)&&e>2;)l+=c,h+=1;e>2&&r.length<e-1&&(r=DU(r,e,l))}else i!=null&&i.noDecimals&&l<0&&(l=1),r=Mf(s,t,l);return n&&r.reverse(),r}),GO=s=>{const t=Math.floor(Math.log(s)/Math.LN10),e=s/10**t;let i=jp[0];return e>=OU?i=jp[3]:e>=IU?i=jp[2]:e>=LU&&(i=jp[1]),t>=0?{step:i*10**t,gap:i,power:t}:{step:-(10**-t)/i,gap:i,power:t}};function kS(s,t,e){const i=(t-s)/Math.max(0,e);return GO(i)}function WO(s,t,e){let i;if(e=+e,(s=+s)==(t=+t)&&e>0)return[s];if(e<=0||(i=FU(s,t,e))===0||!isFinite(i))return[];const n=new Array(e);for(let r=0;r<e;r++)n[r]=s+r*i;return n}function FU(s,t,e){return(t-s)/Math.max(1,e-1)}function jU(s,t,e){let i,n,r=-1;if(e=+e,(n=(t=+t)<(s=+s))&&(i=s,s=t,t=i),!isFinite(e)||t-s<=e)return[s];const a=Math.floor((t-s)/e+1),o=new Array(a);for(;++r<a;)o[r]=s+r*e;return n&&o.reverse(),o}function b0(s,t=10){let e,i,n=0,r=s.length-1,a=s[n],o=s[r],l=10;for(o<a&&(i=a,a=o,o=i,i=n,n=r,r=i);l-- >0;){if(i=kS(a,o,t).step,i===e)return s[n]=a,s[r]=o,s;if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else{if(!(i<0))break;a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i}e=i}}function wS(s,t){const e=dt(t.forceMin),i=dt(t.forceMax);let n=null;const r=[];let a=null;const o=e&&i?l=>l>=t.forceMin&&l<=t.forceMax:e?l=>l>=t.forceMin:i?l=>l<=t.forceMax:null;return e?r[0]=t.forceMin:dt(t.min)&&t.min<=Math.min(s[0],s[s.length-1])&&(r[0]=t.min),i?r[1]=t.forceMax:dt(t.max)&&t.max>=Math.max(s[0],s[s.length-1])&&(r[1]=t.max),dt(r[0])&&dt(r[1])?(a=s.slice(),a[0]=r[0],a[a.length-1]=r[1]):n=dt(r[0])||dt(r[1])?dt(r[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:r,domainValidator:o}}const x0=(s,t,e)=>Math.abs(t-s)<1?+e.toFixed(1):Math.round(+e),VO=$h((s,t,e,i,n,r,a)=>{let o=s,l=t;const h=l<o;h&&([o,l]=[l,o]);let d,u,c=n(o),p=n(l),g=[];if(!(i%1)&&p-c<e){if(c=Math.floor(c),p=Math.ceil(p),o>0){for(;c<=p;++c)for(d=1;d<i;++d)if(u=c<0?d/r(-c):d*r(c),!(u<o)){if(u>l)break;g.push(u)}}else for(;c<=p;++c)for(d=i-1;d>=1;--d)if(u=c>0?d/r(-c):d*r(c),!(u<o)){if(u>l)break;g.push(u)}2*g.length<e&&(g=Cf(o,l,e))}else g=Cf(c,p,Math.min(p-c,e)).map(r);return g=g.filter(f=>f!==0),a!=null&&a.noDecimals&&(g=Array.from(new Set(g.map(f=>Math.floor(f))))),h?g.reverse():g}),UO=$h((s,t,e,i,n,r)=>{const a=[],o={},l=n(s),h=n(t);let d=[];if(Number.isInteger(i))d=Cf(l,h,e);else{const u=(h-l)/(e-1);for(let c=0;c<e;c++)d.push(l+c*u)}return d.forEach(u=>{const c=r(u),p=Number.isInteger(i)?x0(s,t,c):x0(s,t,zO(c)),g=x0(s,t,PU(p,[s,t]));!o[g]&&!isNaN(g)&&d.length>1&&(o[g]=1,a.push(g))}),a}),Pf=$h((s,t,e,i,n)=>WO(i(s),i(t),e).map(r=>zO(n(r))));class un extends NO{constructor(){super(...arguments),this.type=Ve.Linear}clone(){return new un().domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return BU(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(E(this._rangeFactorStart)&&E(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&this._range.length===2||!this._niceType)return this.d3Ticks(t,e);const n=(i=this._niceDomain)!==null&&i!==void 0?i:this._domain,r=this._domain,a=n[0],o=n[n.length-1];let l=Cf(r[0],r[r.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==a||l[l.length-1]!==o)&&this._niceType){const h=n.slice();if(this._niceType==="all"?(h[0]=l[0],h[h.length-1]=l[l.length-1],this._niceDomain=h,this.rescale()):this._niceType==="min"&&l[0]!==a?(h[0]=l[0],this._niceDomain=h,this.rescale()):this._niceType==="max"&&l[l.length-1]!==o&&(h[h.length-1]=l[l.length-1],this._niceDomain=h,this.rescale()),this._niceType!=="all"){const d=Math.min(h[0],h[h.length-1]),u=Math.max(h[0],h[h.length-1]);l=l.filter(c=>c>=d&&c<=u)}}return l}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return WO(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return jU(e[0],e[e.length-1],t)}nice(t=10,e){var i,n;const r=this._domain;let a=[];if(e){const o=wS(r,e);if(a=o.niceMinMax,this._domainValidator=o.domainValidator,this._niceType=o.niceType,o.niceDomain)return this._niceDomain=o.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const o=b0(r.slice(),t);this._niceType==="min"?o[o.length-1]=(i=a[1])!==null&&i!==void 0?i:o[o.length-1]:this._niceType==="max"&&(o[0]=(n=a[0])!==null&&n!==void 0?n:o[0]),this._niceDomain=o,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=b0(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=b0(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}function eT(s){return t=>-s(-t)}function iT(s=Number.EPSILON){return t=>Math.max(t,s)}function zU(s=Number.EPSILON){return t=>Math.min(t,-s)}class TS extends NO{constructor(){super(Kw(10),Xw(10)),this.type=Ve.Log,this._limit=iT(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return new TS().domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e;if(t)return this;super.rescale();const i=Kw(this._base),n=Xw(this._base);return((e=this._niceDomain)!==null&&e!==void 0?e:this._domain)[0]<0?(this._logs=eT(i),this._pows=eT(n),this._limit=zU(),this.transformer=kU,this.untransformer=wU):(this._logs=i,this._pows=n,this._limit=iT(),this.transformer=this._logs,this.untransformer=n),this}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise(((e=this._niceDomain)!==null&&e!==void 0?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return dl}d3Ticks(t=10,e){const i=this.domain(),n=this._limit(i[0]),r=this._limit(i[i.length-1]);return VO(n,r,t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return UO(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Pf(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Pf(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}nice(t=10,e){var i,n;const r=this._domain;let a=[],o=null;if(e){const l=wS(r,e);if(a=l.niceMinMax,this._domainValidator=l.domainValidator,o=l.niceType,l.niceDomain)return this._niceDomain=l.niceDomain,this.rescale(),this}else o="all";if(o){const l=jO(r.slice(),{floor:h=>this._pows(Math.floor(this._logs(this._limit(h)))),ceil:h=>Math.abs(h)>=1?Math.ceil(h):this._pows(Math.ceil(this._logs(this._limit(h))))});return o==="min"?l[l.length-1]=(i=a[1])!==null&&i!==void 0?i:l[l.length-1]:o==="max"&&(l[0]=(n=a[0])!==null&&n!==void 0?n:l[0]),this._niceDomain=l,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}class HU extends Wo{constructor(t){super(!1),this.type=Ve.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}}class Ef extends un{constructor(){super(SU,AU),this.type=Ve.Sqrt}clone(){return new Ef().domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}class MS extends un{constructor(){super(qw(1),Zw(1)),this.type=Ve.Symlog,this._const=1}clone(){return new MS().domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=qw(t),this.untransformer=Zw(t),this.rescale(e)):this._const}d3Ticks(t=10,e){const i=this.domain(),n=i[0],r=i[i.length-1];return VO(n,r,t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return UO(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Pf(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Pf(e[0],e[e.length-1],t,this.transformer,this.untransformer)}nice(t=10,e){var i,n;const r=this._domain;let a=[],o=null;if(e){const l=wS(r,e);if(a=l.niceMinMax,this._domainValidator=l.domainValidator,o=l.niceType,l.niceDomain)return this._niceDomain=l.niceDomain,this.rescale(),this}else o="all";if(o){const l=jO(r.slice(),{floor:h=>Math.floor(h),ceil:h=>Math.ceil(h)});return o==="min"?l[l.length-1]=(i=a[1])!==null&&i!==void 0?i:l[l.length-1]:o==="max"&&(l[0]=(n=a[0])!==null&&n!==void 0?n:l[0]),this._niceDomain=l,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}class CS{constructor(){this.type=Ve.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!P(t)&&N(+t)?this._range[fE(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}domain(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}range(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}clone(){return new CS().domain(this._domain).range(this._range).unknown(this._unknown)}}const sT=5,PS=(s,t,e,i)=>new yi(Object.assign({defaultFontParams:Object.assign({fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14},i),getTextBounds:e?void 0:Ec,specialCharSet:`-/: .,@%'"~`+yi.ALPHABET_CHAR_SET+yi.ALPHABET_CHAR_SET.toUpperCase()},t??{}),s);function ES(s){for(;s<0;)s+=2*Math.PI;for(;s>=2*Math.PI;)s-=2*Math.PI;return s}function $O(s){let t="center",e="middle";return t=(s=ES(s))>=Math.PI*(5/3)||s<=Math.PI*(1/3)?"left":s>=Math.PI*(2/3)&&s<=Math.PI*(4/3)?"right":"center",e=s>=Math.PI*(7/6)&&s<=Math.PI*(11/6)?"bottom":s>=Math.PI*(1/6)&&s<=Math.PI*(5/6)?"top":"middle",{align:t,baseline:e}}const nr=s=>s.map((t,e)=>({index:e,value:t})),nT=(s,t,e=0)=>{const i=new Le(s).expand(e/2),n=new Le(t).expand(e/2);return i.intersects(n)};function YO(s,t,e){return e>Math.max(t.x1-s.x2,s.x1-t.x2,t.y1-s.y2,s.y1-t.y2)}function NU(s,t){for(let e,i=1,n=s.length,r=s[0];i<n;r=e,++i)if(e=s[i],YO(r.AABBBounds,e.AABBBounds,t))return!0;return!1}const XO=(s,t,e)=>{var i;const{labelStyle:n,axisOrientType:r,labelFlush:a,labelFormatter:o,startAngle:l=0}=e;let h=(i=n.angle)!==null&&i!==void 0?i:0;n.direction==="vertical"&&(h+=ue(90));const d=["bottom","top"].includes(r),u=["left","right"].includes(r);let c=1,p=0;d||(u?(c=0,p=1):l&&(c=Math.cos(l),p=-Math.sin(l)));const g=PS(n);return t.map((_,m)=>{var v,y;const b=o?o(_):`${_}`,{width:x,height:S}=g.quickMeasure(b),A=Math.max(x,12),k=Math.max(S,12),w=s.scale(_),T=c*w,M=p*w;let C,R,I=T,O=M;C=a&&d&&m===0?"left":a&&d&&m===t.length-1?"right":(v=n.textAlign)!==null&&v!==void 0?v:"center",C==="right"?I-=A:C==="center"&&(I-=A/2),R=a&&u&&m===0?"top":a&&u&&m===t.length-1?"bottom":(y=n.textBaseline)!==null&&y!==void 0?y:"middle",R==="bottom"?O-=k:R==="middle"&&(O-=k/2);const L=new Le().set(I,O,I+A,O+k);return h&&L.rotate(h,T,M),L})},GU=(s,t,e)=>{var i;const{labelStyle:n,getRadius:r,labelOffset:a,labelFormatter:o}=e,l=r==null?void 0:r(),h=(i=n.angle)!==null&&i!==void 0?i:0,d=PS(n);return t.map(u=>{const c=o?o(u):`${u}`,{width:p,height:g}=d.quickMeasure(c),f=Math.max(p,12),_=Math.max(g,12),m=s.scale(u);let v=0,y=0;const b=$O(m),{x,y:S}=xn({x:0,y:0},l+a,m);return v=x+(b.align==="right"?-f:b.align==="center"?-f/2:0),y=S+(b.baseline==="bottom"?-_:b.baseline==="middle"?-_/2:0),new Le().set(v,y,v+f,y+_).rotate(h,v+f/2,y+_/2)})},WU=s=>["bottom","top","z"].includes(s),VU=(s,t)=>{if(!qt(s.type))return nr(s.domain());const e=s.range(),i=Math.abs(e[e.length-1]-e[0]);if(i<2)return nr([s.domain()[0]]);const{tickCount:n,forceTickCount:r,tickStep:a,noDecimals:o=!1,labelStyle:l}=t;let h;if(E(a))h=s.stepTicks(a);else if(E(r))h=s.forceTicks(r);else if(t.tickMode==="d3"){const d=K(n)?n({axisLength:i,labelStyle:l}):n;h=s.d3Ticks(d??sT,{noDecimals:o})}else{const d=K(n)?n({axisLength:i,labelStyle:l}):n;h=s.ticks(d??sT,{noDecimals:o})}if(t.sampling&&(t.coordinateType==="cartesian"||t.coordinateType==="polar"&&t.axisOrientType==="radius")){const{labelGap:d=4,labelFlush:u}=t;let c=XO(s,h,t).map((g,f)=>({AABBBounds:g,value:h[f]}));for(;c.length>=3&&NU(c,d);)c=UU.parity(c);const p=c.map(g=>g.value);p.length<3&&u&&(p.length>1&&p.pop(),Ma(p)!==Ma(h)&&p.push(Ma(h))),h=p}return nr(h)},UU={parity:function(s){return s.filter((t,e)=>e%2==0)},greedy:function(s,t){let e;return s.filter((i,n)=>(!n||!YO(e.AABBBounds,i.AABBBounds,t))&&(e=i,!0))}},rT=(s,t)=>KO(0,s.length,e=>t(s[e])),KO=(s,t,e)=>{let i=s,n=t;for(;i<n;){const r=Math.floor((i+n)/2);e(r)>=0?n=r:i=r+1}return i},aT=(s,t,e,i)=>XO(s,t,e).map(n=>i?[n.x1,n.x2,n.width()]:[n.y1,n.y2,n.height()]),oT=(s,t,e=0)=>Math.max(s[0],t[0])-e/2<=Math.min(s[1],t[1])+e/2,lT=(s,t)=>s[1]<t[0]?t[0]-s[1]:t[1]<s[0]?s[0]-t[1]:0,$U=(s,t)=>{var e;const i=s.domain();if(!i.length)return[];const{tickCount:n,forceTickCount:r,tickStep:a,labelGap:o=4,axisOrientType:l,labelStyle:h}=t,d=WU(l),u=s.range(),c=s.calculateWholeRangeSize();if(c<2)return t.labelLastVisible?nr([i[i.length-1]]):nr([i[0]]);let p;if(E(a))p=s.stepTicks(a);else if(E(r))p=s.forceTicks(r);else if(E(n)){const g=K(n)?n({axisLength:c,labelStyle:h}):n;p=s.ticks(g)}else if(t.sampling){const g=((e=t.labelStyle.fontSize)!==null&&e!==void 0?e:12)+2,f=ki(u),_=ei(u);if(i.length<=c/g){const m=(_-f)/i.length,v=aT(s,i,t,d),y=Math.min(...v.map(x=>x[2])),b=YU(i,v,o,t.labelLastVisible,Math.floor(y/m));p=s.stepTicks(b.step),t.labelLastVisible&&(b.delCount&&(p=p.slice(0,p.length-b.delCount)),p.push(i[i.length-1]))}else{const m=[i[0],i[Math.floor(i.length/2)],i[i.length-1]],v=aT(s,m,t,d);let y=null;v.forEach(x=>{y?y[2]<x[2]&&(y=x):y=x});const b=_-f-o>0?Math.ceil(i.length*(o+y[2])/(_-f-o)):i.length-1;p=s.stepTicks(b),!t.labelLastVisible||p.length&&p[p.length-1]===i[i.length-1]||(p.length&&Math.abs(s.scale(p[p.length-1])-s.scale(i[i.length-1]))<y[2]&&(p=p.slice(0,-1)),p.push(i[i.length-1]))}}else p=s.domain();return nr(p)},YU=(s,t,e,i,n,r)=>{let a=0,o=0,l=-1,h=Number.MAX_VALUE;const d=p=>{let g=!0,f=0;do f+p<s.length&&oT(t[f],t[f+p],e)&&(g=!1),f+=p;while(g&&f<s.length);return g},u=KO(n,s.length,p=>d(p)?1:-1);let c=u;do if(c>u&&!d(c))c++;else{if(!i){o=c;break}{const p=s.length-1;let g,f=0;g=s.length%c>0?s.length-s.length%c+c:s.length;do{if(g-=c,g!==p&&!oT(t[g],t[p],e))break;f++}while(g>0);if(g===p){o=c,a=f;break}{const _=Math.floor(s.length/c)-f+1;if(_<l)break;{l=_;const m=lT(t[g],t[p]),v=g-c>=0?lT(t[g-c],t[g]):m,y=Math.abs(m-v);if(y<h&&(h=y,o=c,a=f),m<=v)break}}}c++}while(c<=s.length);return{step:o,delCount:a}},XU=(s,t)=>{const{tickCount:e,forceTickCount:i,tickStep:n,getRadius:r,labelOffset:a,labelGap:o=0,labelStyle:l}=t,h=r==null?void 0:r();if(!h)return nr(s.domain());let d;if(E(n))d=s.stepTicks(n);else if(E(i))d=s.forceTicks(i);else if(E(e)){const u=s.range(),c=Math.abs(u[u.length-1]-u[0]),p=K(e)?e({axisLength:c,labelStyle:l}):e;d=s.ticks(p)}else if(t.sampling){const u=s.domain(),c=s.range(),p=GU(s,u,t),g=ki(c),f=ei(c),_=Math.abs(f-g)*(h+a)/u.length,{step:m,delCount:v}=KU(u,p,o,Math.floor(p.reduce((y,b)=>Math.min(y,b.width(),b.height()),Number.MAX_VALUE)/_));d=s.stepTicks(m),d=d.slice(0,d.length-v)}else d=s.domain();return nr(d)},KU=(s,t,e,i)=>{let n=i;do{let a=!0;n++;let o=0;do o+n<s.length&&nT(t[o],t[o+n],e)&&(a=!1),o+=n;while(a&&o<s.length);if(a)break}while(n<=s.length);let r=0;if(s.length>2){let a=s.length-s.length%n;for(a>=s.length&&(a-=n);a>0&&nT(t[0],t[a]);)r++,a-=n}return{step:n,delCount:r}},qU=(s,t)=>{if(qt(s.type))return VU(s,t);if(ji(s.type)){if(t.coordinateType==="cartesian")return $U(s,t);if(t.coordinateType==="polar"&&t.axisOrientType==="angle")return XU(s,t)}return nr(s.domain())},pg=(s,t,e)=>{if(P(t))return s;const i=t[0];return P(i)?s:t.length===1?(s[i]=e,s):(P(s[i])&&(typeof t[1]=="number"?s[i]=[]:s[i]={}),pg(s[i],t.slice(1),e))},ZU=(s,t,e)=>{if(!P(t))return It(s,t,e)};function fa(s){return s.radius?{x:Math.cos(s.angle)*s.radius,y:Math.sin(s.angle)*s.radius}:{x:0,y:0}}function JU(s){return(s=ES(s))>0&&s<=Math.PI/2?2:s>Math.PI/2&&s<=Math.PI?3:s>Math.PI&&s<=3*Math.PI/2?4:1}function QU(s,t){let e=0,i=2*Math.PI;const n=E(s),r=E(t);for(n||r?r?n?(e=s,i=t):(e=t-2*Math.PI,i=t):(e=s,i=s+2*Math.PI):(e=0,i=2*Math.PI);i<=e;)i+=2*Math.PI;for(;e>2*Math.PI;)e-=2*Math.PI,i-=2*Math.PI;for(;i<0;)e+=2*Math.PI,i+=2*Math.PI;return{startAngle:e,endAngle:i}}function t4(s,t,e){return s.x1>t||s.x2<t||s.y1>e||s.y2<e}function qO(s,t){const e=[];return s.forEach(i=>{const n=+i[t];N(n)&&e.push(n)}),e.length===0?null:ki(e)}function RS(s,t){const e=[];return s.forEach(i=>{const n=+i[t];N(n)&&e.push(n)}),e.length===0?null:ei(e)}function ZO(s,t){return s.reduce((e,i)=>{const n=t?+i[t]:+i;return N(n)&&(e+=n),e},0)}function JO(s,t){let e=0,i=0;return s.forEach(n=>{const r=t?+n[t]:+n;N(r)&&(e+=r,i++)}),e/i}function QO(s,t){const e=JO(s,t);return s.length<=1?0:s.reduce((n,r)=>n+(t?+r[t]:+r-e)**2,0)/(s.length-1)}function e4(s,t){return Math.sqrt(QO(s,t))}function i4(s,t){return gj(s.map(e=>e[t]))}function s4(s,t,e){const{predict:i}=xU(s,l=>l[t],l=>l[e]),n=qO(s,t),r=RS(s,t),a=i(n),o=i(r);return[{[t]:n,[e]:a},{[t]:r,[e]:o}]}function n4(s){let t="center",e="middle";return t=(s=ES(s))>=Math.PI*(7/6)&&s<=Math.PI*(11/6)?"right":s>=Math.PI*(1/6)&&s<=Math.PI*(5/6)?"left":"center",e=s>=Math.PI*(5/3)||s<=Math.PI*(1/3)?"bottom":s>=Math.PI*(2/3)&&s<=Math.PI*(4/3)?"top":"middle",{align:t,baseline:e}}function hT(s,t){const e=Rf(s),i=Rf(t),n=Math.asin((s.x*t.y-t.x*s.y)/e/i),r=Math.acos((s.x*t.x+s.y*t.y)/e/i);return n<0?-r:r}function Rf(s,t={x:0,y:0}){return ze.distancePP(s,t)}function Ie(s,t,e){let i=!1;if(t&&K(t)){for(const n of s)for(const r of n.getSeries(e))if(i=!!t.call(null,r),i)return i}return i}function r4(s,t){const e=[];for(const i of s)for(const n of i.getSeries(t))e.push(n);return e}const OS=(s,t)=>{for(let e=0;e<s.length;e++){const i=s[e].getSeries();for(let n=0;n<i.length;n++){const r=i[n];if(t&&r&&r.coordinate===t||!t&&r)return r}}return null};function gg(s){return function(t){let e;return e=$(s)?s.reduce((i,n)=>i==null?void 0:i[n],t):t==null?void 0:t[s],e}}var z;(function(s){s.area="area",s.line="line",s.bar="bar",s.bar3d="bar3d",s.rangeColumn="rangeColumn",s.rangeColumn3d="rangeColumn3d",s.rangeArea="rangeArea",s.dot="dot",s.geo="geo",s.link="link",s.map="map",s.pie="pie",s.pie3d="pie3d",s.radar="radar",s.rose="rose",s.scatter="scatter",s.circularProgress="circularProgress",s.wordCloud="wordCloud",s.wordCloud3d="wordCloud3d",s.funnel="funnel",s.funnel3d="funnel3d",s.linearProgress="linearProgress",s.boxPlot="boxPlot",s.sankey="sankey",s.gaugePointer="gaugePointer",s.gauge="gauge",s.treemap="treemap",s.sunburst="sunburst",s.circlePacking="circlePacking",s.waterfall="waterfall",s.heatmap="heatmap",s.correlation="correlation"})(z||(z={}));var dT;(function(s){s.label="label",s.point="point",s.line="line",s.area="area",s.bar="bar",s.bar3d="bar3d",s.boxPlot="boxPlot",s.outlier="outlier",s.circlePacking="circlePacking",s.group="group",s.gridBackground="gridBackground",s.grid="grid",s.dot="dot",s.title="title",s.subTitle="subTitle",s.symbol="symbol",s.funnel="funnel",s.funnel3d="funnel3d",s.transform="transform",s.transform3d="transform3d",s.transformLabel="transformLabel",s.outerLabel="outerLabel",s.outerLabelLine="outerLabelLine",s.pin="pin",s.pinBackground="pinBackground",s.pointer="pointer",s.segment="segment",s.track="track",s.cell="cell",s.cellBackground="cellBackground",s.link="link",s.arrow="arrow",s.pie="pie",s.pie3d="pie3d",s.labelLine="labelLine",s.progress="progress",s.minLabel="minLabel",s.maxLabel="maxLabel",s.rose="rose",s.node="node",s.sunburst="sunburst",s.nonLeaf="nonLeaf",s.leaf="leaf",s.nonLeafLabel="nonLeafLabel",s.leaderLine="leaderLine",s.stackLabel="stackLabel",s.word="word",s.fillingWord="fillingWord",s.nodePoint="nodePoint",s.ripplePoint="ripplePoint",s.centerPoint="centerPoint",s.centerLabel="centerLabel",s.barBackground="barBackground",s.lineLabel="lineLabel",s.areaLabel="areaLabel"})(dT||(dT={}));const At="__VCHART",Al=500,kl=500,a4=`${At}_LABEL_VISIBLE`,S0=`${At}_ARC_TRANSFORM_VALUE`,tI=`${At}_ARC_RATIO`,uT=`${At}_ARC_START_ANGLE`,cT=`${At}_ARC_END_ANGLE`,o4=`${At}_ARC_K`,Pr=`${At}_ARC_MIDDLE_ANGLE`,l4=`${At}_ARC_QUADRANT`,h4=`${At}_ARC_RADIAN`,wm=-Math.PI/2,IS=3*Math.PI/2,Jd=-90,fg=270,ju=.6,ra=9,ks=0;var Zn;(function(s){s.enter="enter",s.update="update",s.exit="exit",s.group="group"})(Zn||(Zn={}));var ne;(function(s){s.enter="enter",s.update="update",s.exit="exit",s.unChange="unChange"})(ne||(ne={}));var rt;(function(s){s.arc="arc",s.arc3d="arc3d",s.area="area",s.image="image",s.line="line",s.path="path",s.rect="rect",s.rect3d="rect3d",s.rule="rule",s.shape="shape",s.symbol="symbol",s.text="text",s.richtext="richtext",s.polygon="polygon",s.pyramid3d="pyramid3d",s.circle="circle",s.cell="cell",s.interval="interval",s.group="group",s.glyph="glyph",s.component="component",s.largeRects="largeRects",s.largeSymbols="largeSymbols"})(rt||(rt={}));var be;(function(s){s.axis="axis",s.grid="grid",s.legend="legend",s.slider="slider",s.label="label",s.datazoom="datazoom",s.player="player",s.title="title",s.scrollbar="scrollbar"})(be||(be={}));var pT;(function(s){s[s.player=1]="player",s[s.rollUp=2]="rollUp",s[s.drillDown=3]="drillDown",s[s.slider=4]="slider",s[s.datazoom=5]="datazoom",s[s.legend=6]="legend",s[s.scrollbar=7]="scrollbar",s[s.brush=8]="brush",s[s.normal=9]="normal"})(pT||(pT={}));var tr;(function(s){s.lineAxis="lineAxis",s.circleAxis="circleAxis"})(tr||(tr={}));var mi;(function(s){s.lineAxisGrid="lineAxisGrid",s.circleAxisGrid="circleAxisGrid"})(mi||(mi={}));var gT;(function(s){s.discreteLegend="discreteLegend",s.colorLegend="colorLegend",s.sizeLegend="sizeLegend"})(gT||(gT={}));var fT;(function(s){s.lineCrosshair="lineCrosshair",s.rectCrosshair="rectCrosshair",s.sectorCrosshair="sectorCrosshair",s.circleCrosshair="circleCrosshair",s.polygonCrosshair="polygonCrosshair",s.ringCrosshair="ringCrosshair"})(fT||(fT={}));var _T;(function(s){s.symbolLabel="symbolLabel",s.rectLabel="rectLabel",s.lineLabel="lineLabel",s.dataLabel="dataLabel"})(_T||(_T={}));var mT;(function(s){s.continuousPlayer="continuousPlayer",s.discretePlayer="discretePlayer"})(mT||(mT={}));var Ys;(function(s){s.before="before",s.layouting="layouting",s.reevaluate="reevaluate",s.after="after"})(Ys||(Ys={}));var gt;(function(s){s.BEFORE_EVALUATE_DATA="beforeEvaluateData",s.AFTER_EVALUATE_DATA="afterEvaluateData",s.BEFORE_EVALUATE_SCALE="beforeEvaluateScale",s.AFTER_EVALUATE_SCALE="afterEvaluateScale",s.BEFORE_PARSE_VIEW="beforeParseView",s.AFTER_PARSE_VIEW="afterParseView",s.BEFORE_TRANSFORM="beforeTransform",s.AFTER_TRANSFORM="afterTransform",s.BEFORE_CREATE_VRENDER_STAGE="beforeCreateVRenderStage",s.AFTER_CREATE_VRENDER_STAGE="afterCreateVRenderStage",s.BEFORE_CREATE_VRENDER_LAYER="beforeCreateVRenderLayer",s.AFTER_CREATE_VRENDER_LAYER="afterCreateVRenderLayer",s.BEFORE_STAGE_RESIZE="beforeStageResize",s.AFTER_STAGE_RESIZE="afterStageResize",s.BEFORE_VRENDER_DRAW="beforeVRenderDraw",s.AFTER_VRENDER_DRAW="afterVRenderDraw",s.BEFORE_MARK_JOIN="beforeMarkJoin",s.AFTER_MARK_JOIN="afterMarkJoin",s.BEFORE_MARK_UPDATE="beforeMarkUpdate",s.AFTER_MARK_UPDATE="afterMarkUpdate",s.BEFORE_MARK_STATE="beforeMarkState",s.AFTER_MARK_STATE="afterMarkState",s.BEFORE_MARK_ENCODE="beforeMarkEncode",s.AFTER_MARK_ENCODE="afterMarkEncode",s.BEFORE_DO_LAYOUT="beforeDoLayout",s.AFTER_DO_LAYOUT="afterDoLayout",s.BEFORE_MARK_LAYOUT_END="beforeMarkLayoutEnd",s.AFTER_MARK_LAYOUT_END="afterMarkLayoutEnd",s.BEFORE_DO_RENDER="beforeDoRender",s.AFTER_DO_RENDER="afterDoRender",s.BEFORE_MARK_RENDER_END="beforeMarkRenderEnd",s.AFTER_MARK_RENDER_END="afterMarkRenderEnd",s.BEFORE_CREATE_VRENDER_MARK="beforeCreateVRenderMark",s.AFTER_CREATE_VRENDER_MARK="afterCreateVRenderMark",s.BEFORE_ADD_VRENDER_MARK="beforeAddVRenderMark",s.AFTER_ADD_VRENDER_MARK="afterAddVRenderMark",s.AFTER_VRENDER_NEXT_RENDER="afterVRenderNextRender",s.BEFORE_ELEMENT_UPDATE_DATA="beforeElementUpdateData",s.AFTER_ELEMENT_UPDATE_DATA="afterElementUpdateData",s.BEFORE_ELEMENT_STATE="beforeElementState",s.AFTER_ELEMENT_STATE="afterElementState",s.BEFORE_ELEMENT_ENCODE="beforeElementEncode",s.AFTER_ELEMENT_ENCODE="afterElementEncode",s.ANIMATION_START="animationStart",s.ANIMATION_END="animationEnd",s.ELEMENT_ANIMATION_START="elementAnimationStart",s.ELEMENT_ANIMATION_END="elementAnimationEnd",s.ALL_ANIMATION_START="allAnimationStart",s.ALL_ANIMATION_END="allAnimationEnd"})(gt||(gt={}));var Mb;(function(s){s.signal="signal",s.data="data",s.scale="scale",s.coordinate="coordinate",s.mark="mark"})(Mb||(Mb={}));var vT;(function(s){s.active="active",s.selected="selected",s.highlight="highlight",s.blur="blur"})(vT||(vT={}));const Eo="__vgrammar_scene_item__",eI=[rt.line,rt.area],d4=[rt.arc3d,rt.rect3d,rt.pyramid3d],er="key",_g=[{}],u4=["key"],c4=!0,p4=!0,g4=!1,f4=null,_4=!0,yT="VGRAMMAR_IMMEDIATE_ANIMATION",bT=0,iI=1e3,Cb=0,xT=0,ST=!1,Pb=!1,Eb="quintInOut",AT={stopWhenStateChange:!1,immediatelyApply:!0},m4="VGRAMMAR_ANIMATION_PARAMETERS";function LS(s,t){return Y(s).reduce((e,i)=>{const n=ht(i)?t.getGrammarById(i):i;return n&&e.push(n),e},[])}function v4(s){return!K(s)&&!!(s!=null&&s.signal)}function y4(s){return!K(s)&&!!(s!=null&&s.callback)}function Ki(s,t){if(P(s))return[];if(v4(s)){const e=s.signal;if(ht(e))return Y(t.getGrammarById(e));if((e==null?void 0:e.grammarType)==="signal")return[e]}else if(y4(s))return LS(s.dependency,t);return[]}function _a(s){return K(s)||(s==null?void 0:s.signal)||!!(s!=null&&s.callback)}function Ue(s,t,e,i){if(P(s))return s;if(K(s))return i?s.call(null,e,i,t):s.call(null,e,t);if(s.signal){const n=s.signal;return ht(n)?t==null?void 0:t[n]:n.output()}return s.callback?i?s.callback.call(null,e,i,t):s.callback.call(null,e,t):s}function A0(s,t){if(P(s))return s;if(K(s))return s.call(null,t);if(s.signal){const e=s.signal;return ht(e)?t==null?void 0:t[e]:e.output()}return s.callback?s.callback.call(null,t):s}function zu(s,t){return Oc(s)?s.output():t[s]}function b4(s){return s&&(s.signal||s.callback)}const Oc=s=>s&&!P(s.grammarType),lh=s=>K(s)?s:t=>t[s];function Tm(s){return!!(s!=null&&s.scale)}function BS(s){return!!(s!=null&&s.field)}function no(s,t){if(!s)return[];let e=[];return s.scale&&(e=Oc(s.scale)?[s.scale]:Y(t.getScaleById(s.scale))),e.concat(Ki(s,t))}function Of(s,t){switch(t){case"line":return s.some(e=>["x","y","defined"].includes(e));case"area":return s.some(e=>["x","y","x1","y1","defined"].includes(e));case"largeRects":return s.some(e=>["x","y","width","y1"].includes(e));case"largeSymbols":return s.some(e=>["x","y"].includes(e))}return!1}function x4(s){const{x:t,y:e,x1:i,y1:n}=s;return N(t)&&N(e)&&N(i)&&N(n)?[{x:t,y:e},{x:i,y:n}]:[]}function S4(s,t,e,i){return!s||!s.length||s.length===1&&t?[]:s.some(n=>Of(Object.keys(n.nextAttrs),"line"))?s.map((n,r)=>{var a;const o=n.nextAttrs,{x:l,y:h,x1:d,y1:u,defined:c}=(a=e==null?void 0:e[r])!==null&&a!==void 0?a:{};return P(o.x)&&(o.x=l),P(o.y)&&(o.y=h),P(o.defined)&&c===!1&&(o.defined=!1),o.context=n.key,i&&(P(o.x1)&&(o.x1=d),P(o.y1)&&(o.y1=u)),o}):e??[]}function A4(s,t,e=[]){if(!s||!s.length||s.length===1&&t)return[];const i=new Float32Array(4*s.length);return s.forEach((n,r)=>{var a,o,l,h;const d=n.nextAttrs,u=(a=d.x)!==null&&a!==void 0?a:e[4*r],c=(o=d.y)!==null&&o!==void 0?o:e[4*r+1],p=(l=d.width)!==null&&l!==void 0?l:e[4*r+2],g=(h=d.y1)!==null&&h!==void 0?h:e[4*r+3];i[4*r]=u,i[4*r+1]=c,i[4*r+2]=p,i[4*r+3]=g-c}),i}function k4(s,t,e=[]){if(!s||!s.length||s.length===1&&t)return[];const i=new Float32Array(2*s.length);return s.forEach((n,r)=>{var a,o;const l=n.nextAttrs,h=(a=l.x)!==null&&a!==void 0?a:e[2*r],d=(o=l.y)!==null&&o!==void 0?o:e[2*r+1];i[2*r]=h,i[2*r+1]=d}),i}function If(s,t){if(["x","y","dx","dy"].includes(t))return!0;switch(s){case rt.arc:return["innerRadius","outerRadius","startAngle","endAngle"].includes(t);case rt.group:case rt.rect:case rt.image:return["width","height","y1"].includes(t);case rt.path:case rt.shape:return["path","customPath"].includes(t);case rt.line:return t==="defined";case rt.area:return["x1","y1","defined"].includes(t);case rt.rule:return["x1","y1"].includes(t);case rt.symbol:return t==="size";case rt.polygon:return t==="points";case rt.text:return t==="text"}return!1}function w4(s){return[rt.line,rt.area,rt.largeRects,rt.largeSymbols].includes(s)}class T4{constructor(t,e,i,n){this.channelEncoder={},this.marks=t,e&&this.registerChannelEncoder(e),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(n)}getMarks(){return this.marks}registerChannelEncoder(t,e){return ht(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}registerFunctionEncoder(t){return this.functionEncoder=t,this}registerDefaultEncoder(t){return this.defaultEncoder=t,this}registerProgressiveChannels(t){return this.progressiveChannels=Y(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}let st=class $e{static registerPlotMarks(t,e){$e._plotMarks[t]=e}static createPlotMark(t,e){return $e._plotMarks[t]?new $e._plotMarks[t](e):null}static registerMark(t,e){$e._marks[t]=e}static createMark(t,e,i){return $e._marks[t]?new $e._marks[t](e,t,i):null}static hasMark(t){return!!$e._marks[t]}static registerComponent(t,e){$e._components[t]=e}static createComponent(t,e,i,n){const r=$e._components[t];return r?new r(e,i,n):null}static hasComponent(t){return!!$e._components[t]}static registerGraphicComponent(t,e){$e._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const n=$e._graphicComponents[t];return n?n(e,i):null}static registerTransform(t,e,i){$e._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return $e._transforms[t]}static unregisterRuntimeTransforms(){Object.keys($e._transforms).forEach(t=>{$e._transforms[t]&&!$e._transforms[t].isBuiltIn&&($e._transforms[t]=null)})}static registerGrammar(t,e,i){$e._grammars[t]={grammarClass:e,specKey:i??t}}static createGrammar(t,e,i){var n;const r=(n=$e._grammars[t])===null||n===void 0?void 0:n.grammarClass;return r?new r(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return $e._glyphs[t]}static createInteraction(t,e,i){const n=$e._interactions[t];return n?new n(e,i):null}};st._plotMarks={},st._marks={},st._components={},st._graphicComponents={},st._transforms={},st._grammars={},st._glyphs={},st._animations={},st._interactions={},st._graphics={},st.registerGlyph=(s,t,e,i,n)=>(st._glyphs[s]=new T4(t,e,i,n),st._glyphs[s]),st.registerAnimationType=(s,t)=>{st._animations[s]=t},st.getAnimationType=s=>st._animations[s],st.registerInteraction=(s,t)=>{st._interactions[s]=t},st.registerGraphic=(s,t)=>{st._graphics[s]=t},st.getGraphicType=s=>st._graphics[s],st.createGraphic=(s,t)=>{const e=st._graphics[s];return e?e(t):null};function xr(s,t,e,i,n){e&&(_a(e)?t.forEach(r=>{const a=Ue(e,i,r.datum,s);Object.assign(r.nextAttrs,a)}):Object.keys(e).forEach(r=>{var a,o;const l=e[r],h=n&&!If(s.mark.markType,r)?[t[0]]:t;if(Tm(l)){const d=zu(l.scale,i),u=(a=l==null?void 0:l.offset)!==null&&a!==void 0?a:0,c=!P(l.band)&&d.bandwidth?d.bandwidth()*l.band:null,p=ht(l==null?void 0:l.field),g=p?In(l.field):null;let f=p?null:P(l==null?void 0:l.value)?0:(o=d.scale)===null||o===void 0?void 0:o.call(d,l.value);h.forEach(_=>{var m;p&&(f=(m=d.scale)===null||m===void 0?void 0:m.call(d,g(_.datum))),_.nextAttrs[r]=dt(f)||dt(c)?f+u+c:f})}else if(BS(l)){const d=In(l.field);h.forEach(u=>{u.nextAttrs[r]=d(u.datum)})}else h.forEach(d=>{d.nextAttrs[r]=Ue(l,i,d.datum,s)})}))}function yo(s,t,e,i){if(!s)return null;if(_a(s))return Ue(s,i,t,e);const n={};return Object.keys(s).forEach(r=>{var a,o,l;const h=s[r];if(Tm(h)){const d=zu(h.scale,i),u=(a=h==null?void 0:h.offset)!==null&&a!==void 0?a:0,c=!P(h.band)&&d.bandwidth?d.bandwidth()*h.band:null,p=ht(h==null?void 0:h.field),g=p?In(h.field):null,f=p?(o=d.scale)===null||o===void 0?void 0:o.call(d,g(t)):P(h==null?void 0:h.value)?0:(l=d.scale)===null||l===void 0?void 0:l.call(d,h.value);n[r]=dt(f)||dt(c)?f+u+c:f}else if(BS(h)){const d=In(h.field);n[r]=d(t)}else n[r]=Ue(h,i,t,e)}),n}function M4(s,t,e){if(_a(t))return{themeEncoder:{},positionEncoder:t};const i={},n={};if(s===rt.glyph&&st.getGlyph(e)){const r=st.getGlyph(e),a=r.getProgressiveChannels();if(a)Object.keys(t).forEach(o=>{a.includes(o)?n[o]=t[o]:i[o]=t[o]});else{const o=Array.from(new Set(Object.values(r.getMarks())));Object.keys(t).forEach(l=>{o.some(h=>If(h,l))?n[l]=t[l]:i[l]=t[l]})}}else Object.keys(t).forEach(r=>{If(s,r)?n[r]=t[r]:i[r]=t[r]});return{positionEncoder:n,themeEncoder:i}}const sI=s=>!!rt[s];function Qd(s,t,e={}){var i;const n=st.getGraphicType(t)?st.createGraphic(t,e):st.createGraphicComponent(t,e,{skipDefault:(i=s==null?void 0:s.spec)===null||i===void 0?void 0:i.skipTheme});return n||Nt.getInstance().error(`create ${t} graphic failed!`),n}function C4(s,t,e={}){if(!st.getGraphicType(rt.glyph))return;const i=st.createGraphic(rt.glyph,e),n=t.getMarks(),r=Object.keys(n).map(a=>{if(st.getGraphicType(n[a])){const o=st.createGraphic(n[a]);if(o)return o.name=a,o}});return i.setSubGraphic(r),i}const Lf=s=>{s&&(s[Eo]=null,s.release(),s.parent&&s.parent.removeChild(s))},kT=["fillOpacity"],wT=(s,t,e)=>{var i;return t==="fillOpacity"?(s.fillOpacity=(i=e.fillOpacity)!==null&&i!==void 0?i:1,["fillOpacity"]):[]};function P4(s,t,e,i,n,r){const a=n.getGraphicAttribute(s,!1,r);if(a)return t.forEach(l=>{l in i&&(a[l]=i[l])}),a;const o={};return t.forEach(l=>{o[l]=i[l]}),e[s]=o,o}const Ro={rect3d:[{channels:["x","y","z","x1","y1","width","height","length"],transform:(s,t,e)=>{var i,n,r,a,o,l,h,d,u,c,p,g;N(t.width)||!N(t.x1)&&N(e.width)?(s.x=Math.min((i=e.x)!==null&&i!==void 0?i:0,(n=e.x1)!==null&&n!==void 0?n:1/0),s.width=e.width):N(t.x1)||!N(t.width)&&N(e.x1)?(s.x=Math.min(e.x,e.x1),s.width=Math.abs(e.x1-e.x)):(s.x=Math.min((r=e.x)!==null&&r!==void 0?r:0,(a=e.x1)!==null&&a!==void 0?a:1/0),s.width=e.width),N(t.height)||!N(t.y1)&&N(e.height)?(s.y=Math.min((o=e.y)!==null&&o!==void 0?o:0,(l=e.y1)!==null&&l!==void 0?l:1/0),s.height=e.height):N(t.y1)||!N(t.height)&&N(e.y1)?(s.y=Math.min(e.y,e.y1),s.height=Math.abs(e.y1-e.y)):(s.y=Math.min((h=e.y)!==null&&h!==void 0?h:0,(d=e.y1)!==null&&d!==void 0?d:1/0),s.height=e.height),N(t.length)||!N(t.z1)&&N(e.length)?(s.z=Math.min((u=e.z)!==null&&u!==void 0?u:0,(c=e.z1)!==null&&c!==void 0?c:1/0),s.length=e.length):N(t.z1)||!N(t.length)&&N(e.z1)?(s.z=Math.min(e.z,e.z1),s.length=Math.abs(e.z1-e.z)):(s.z=Math.min((p=e.z)!==null&&p!==void 0?p:0,(g=e.z1)!==null&&g!==void 0?g:1/0),s.length=e.length)},storedAttrs:"sizeAttrs"}],[rt.text]:[{channels:["text","limit","autoLimit","maxLineWidth"],transform:(s,t,e)=>{var i,n,r,a;const o=(i=e.limit)!==null&&i!==void 0?i:1/0,l=(n=e.autoLimit)!==null&&n!==void 0?n:1/0,h=Math.min(o,l),d=Rn(e.text)&&!P(e.text.text),u=d?e.text.text:e.text;s.maxLineWidth=h===1/0?e.maxLineWidth:h,d?e.text.type==="html"?(s.html={dom:u,width:(r=t.width)!==null&&r!==void 0?r:h,height:(a=t.height)!==null&&a!==void 0?a:t.fontSize,anchorType:"position"},s.text=""):e.text.type==="rich"?s.textConfig=u:s.text=u:s.text=u},storedAttrs:"limitAttrs"}],[rt.rule]:[{channels:["x","y","x1","y1"],transform:(s,t,e)=>{const i=x4(e);s.points=i,s.x=0,s.y=0},storedAttrs:"pointAttrs"}],[rt.symbol]:[{channels:["shape","symbolType"],transform:(s,t,e)=>{var i;s.symbolType=(i=t.shape)!==null&&i!==void 0?i:t.symbolType}},{channels:["image","fill","background"],transform:(s,t,e)=>{t.image?(s.background=t.image,s.fill=!1):e.image?(s.background=e.image,s.fill=!1):(s.fill=e.fill,s.background=e.background)},storedAttrs:"imageAttrs"}],[rt.richtext]:[{channels:["text","textConfig"],transform:(s,t,e)=>{var i,n,r,a;s.text=null,((i=t.text)===null||i===void 0?void 0:i.type)==="rich"?s.textConfig=t.text.text:((n=t.textConfig)===null||n===void 0?void 0:n.type)==="html"?(s.html={dom:t.textConfig.text,width:t.width,height:(r=t.height)!==null&&r!==void 0?r:t.fontSize,anchorType:"position"},s.text=""):((a=t.textConfig)===null||a===void 0?void 0:a.type)==="rich"?s.textConfig=t.textConfig.text:s.textConfig=t.textConfig}}]};function E4(s,t){var e;return((e=Ro[s])!==null&&e!==void 0?e:[]).reduce((i,n)=>(n.channels.forEach(r=>{Zs(t,r)&&(i[r]=t[r])}),i),{})}const Hu=(s,t,e,i)=>{const n={},r=t?Object.keys(t):[],a=ht(s)?Ro[s]:s;if(a&&a.length){const o=[];r.forEach(l=>{let h=!1;a.forEach((d,u)=>{if(d.channels.includes(l)){if(!o[u])if(d.storedAttrs){const c=P4(d.storedAttrs,d.channels,n,t,e,i);d.transform(n,t,c)}else d.transform(n,t,null);o[u]=!0,h=!0}}),h||(kT.includes(l)?wT(n,l,t):n[l]=t[l])})}else r.forEach(o=>{kT.includes(o)?wT(n,o,t):n[o]=t[o]});return n},R4=(s,t)=>{var e,i;if(s===t)return!0;const n=(e=s&&s.length)!==null&&e!==void 0?e:0;return n===((i=t&&t.length)!==null&&i!==void 0?i:0)&&n!==0&&s.every((r,a)=>!r&&!t[a]||r&&t[a]&&r.color===t[a].color&&r.offset===t[a].offset)},O4=(s,t)=>{if(s===t)return!0;if(typeof s!=typeof t||ht(s)||s.gradient!==t.gradient)return!1;const e=Object.keys(s),i=Object.keys(t);return e.length===i.length&&e.every(n=>n==="stops"?R4(s[n],t[n]):s[n]===t[n])},I4=(s,t)=>s.length===t.length&&s.join("-")===t.join("-"),L4=(s,t,e)=>!(!P(s)||!P(t))||!P(s)&&!P(t)&&(e==="lineDash"?I4(s,t):e==="stroke"||e==="fill"?O4(s,t):s===t),B4=["fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"],nI=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"],D4=B4.concat(nI);function F4(s,t,e){var i;if(!s||s.length<=1)return null;const n=((i=e==null?void 0:e.mark)===null||i===void 0?void 0:i.markType)==="area"?D4:nI,r=[];let a=null;return s.forEach((o,l)=>{a&&n.every(h=>L4(a[h],o[h],h))||(r.length&&(r[r.length-1].endIndex=l),a=o,r.push({attrs:a,startIndex:l}))}),r.length>=2?r.map(o=>{const l=Hu(rt.line,rI(o.attrs),e);return l.points=t.slice(o.startIndex,P(o.endIndex)?t.length:o.endIndex),l}):null}function j4(s){return s?s.reduce((t,e)=>t.concat(e.points),[]):null}function rI(s){const t={};return s&&Object.keys(s).forEach(e=>{e!=="x"&&e!=="y"&&e!=="x1"&&e!=="y1"&&e!=="defined"&&e!=="size"&&e!=="width"&&e!=="height"&&e!=="context"&&(t[e]=s[e])}),t}let aI=class{constructor(t){this.data=null,this.states=[],this.diffState=ne.enter,this.isReserved=!1,this.runtimeStatesEncoder=null,this.items=[],this.getStateAttrs=(e,i)=>{var n,r,a;const o=!P((n=this.runtimeStatesEncoder)===null||n===void 0?void 0:n[e]),l=o?this.runtimeStatesEncoder[e]:(r=this.mark.getSpec().encode)===null||r===void 0?void 0:r[e];if(!l)return{};if(K(l))return l(this.getDatum(),this,e,i);if(!o&&(!((a=this.graphicItem.states)===null||a===void 0)&&a[e]))return this.graphicItem.states[e];const h=this.items.map(u=>Object.assign({},u,{nextAttrs:{}}));xr(this,h,l,this.mark.parameters());const d=this.transformElementItems(h,this.mark.markType);return this.graphicItem.states?this.graphicItem.states[e]||(this.graphicItem.states[e]=d):this.graphicItem.states={[e]:d},d},this.mark=t}initGraphicItem(t={}){if(this.graphicItem)return;const e=this.mark.getAttributeTransforms();this.graphicItem=this.mark.addGraphicItem(e?Hu(e,t,this):t,this.groupKey),this.graphicItem&&(this.graphicItem[Eo]=this,e&&(this.graphicItem.onBeforeAttributeUpdate=i=>this.mark?Hu(e,i,this):i),this.clearGraphicAttributes(),this.mark.needAnimate()&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(t),this.setFinalGraphicAttributes(t)))}updateGraphicItem(t){if(!this.graphicItem)return;P(t.clip)||this.graphicItem.setAttribute("clip",t.clip),P(t.interactive)||this.graphicItem.setAttribute("pickable",t.interactive),P(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),this.diffState===ne.exit?this.graphicItem.releaseStatus="willRelease":this.graphicItem.releaseStatus=void 0;const e=this.mark.animate.getAnimationConfigs("state");e.length!==0&&(this.graphicItem.stateAnimateConfig=e[0].originConfig)}getGraphicItem(){return this.graphicItem}removeGraphicItem(){var t,e;this.graphicItem&&((e=(t=this.graphicItem.animates)===null||t===void 0?void 0:t.forEach)===null||e===void 0||e.call(t,i=>i.stop())),this.graphicItem&&(Lf(this.graphicItem),this.graphicItem[Eo]=null,this.graphicItem=null)}resetGraphicItem(){this.graphicItem&&(this.graphicItem=null)}getBounds(){var t;return(t=this.graphicItem)===null||t===void 0?void 0:t.AABBBounds}getStates(){return this.states}updateData(t,e,i){var n;this.mark.emit(gt.BEFORE_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.data=e;const r=lh(i);return this.items=e.map(a=>({datum:a,key:r(a),view:this.mark.view,nextAttrs:{}})),this.groupKey=t,this.key=this.mark.isCollectionMark()?t:(n=this.items)===null||n===void 0?void 0:n[0].key,this.mark.emit(gt.AFTER_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.items}state(t,e){var i;const n=this.mark.isCollectionMark(),r=this.states,a=Y(Ue(t,e,this.getDatum(),this)),o=(i=this.mark.getSpec())===null||i===void 0?void 0:i.stateSort;o&&o.sort(o);const l=a.length!==r.length||a.some((h,d)=>h!==r[d]);this.states=a,!n&&l&&this.diffState===ne.unChange&&(this.diffState=ne.update)}encodeGraphic(t){this.coordinateTransformEncode(this.items);const e=this.transformElementItems(this.items,this.mark.markType);t&&(this.mark.isCollectionMark()&&delete t.defined,Object.assign(e,t)),this.graphicItem?(this.graphicItem.clearStates(),this.graphicItem.states={},this.graphicItem.stateProxy=null,this.applyGraphicAttributes(e)):this.initGraphicItem(e),this.diffState!==ne.enter&&this.diffState!==ne.update||!this.states.length||this.useStates(this.states),this.mark.markType===rt.shape&&(this.graphicItem.datum=this.items[0].datum),this.items.forEach(i=>{i.nextAttrs={}}),this._setCustomizedShape()}_setCustomizedShape(){var t;if(!this.graphicItem)return;const e=(t=this.mark.getSpec())===null||t===void 0?void 0:t.setCustomizedShape;e&&(this.graphicItem.pathProxy=i=>e(this.data,i,new ai))}encodeItems(t,e,i=!1,n){const r=this.mark.isCollectionMark(),a=e[Zn.update],o=e[Zn.enter],l=e[Zn.exit],h=this.mark.isLargeMode()||r&&!this.mark.getSpec().enableSegments;this.diffState===ne.enter?(o&&xr(this,t,o,n,h),a&&xr(this,t,a,n,h)):this.diffState===ne.update?((r&&o||i)&&xr(this,t,o,n,h),a&&xr(this,t,a,n,h)):this.diffState===ne.exit&&l&&(i&&xr(this,t,o,n,h),xr(this,t,l,n,h))}coordinateTransformEncode(t){if(!this.mark.coord||this.mark.markType==="arc"||this.mark.disableCoordinateTransform===!0)return;const e=this.mark.coord.output();t.forEach(i=>{const n=i.nextAttrs,r=e.convert(n);Object.assign(n,r)})}clearStates(t){const e=ye(t)?t:this.mark.animate.getAnimationConfigs("state").length!==0;this.states=[],this.graphicItem&&this.graphicItem.clearStates(e),this.runtimeStatesEncoder&&(this.runtimeStatesEncoder={})}_updateRuntimeStates(t,e){this.runtimeStatesEncoder||(this.runtimeStatesEncoder={}),this.runtimeStatesEncoder[t]=e}hasState(t){return this.states&&t&&this.states.includes(t)}addState(t,e){var i;if(!this.graphicItem)return!1;if(e&&ht(t)&&!Se(e,(i=this.runtimeStatesEncoder)===null||i===void 0?void 0:i[t])){const a=this.states.slice();return a.includes(t)?this.graphicItem.clearStates():a.push(t),this._updateRuntimeStates(t,e),this.useStates(a),!0}const n=this.mark.getSpec().encode,r=Y(t).reduce((a,o)=>(o&&!a.includes(o)&&(n!=null&&n[o])&&a.push(o),a),this.states.slice());return r.length!==this.states.length&&(this.useStates(r),!0)}removeState(t){if(!this.graphicItem)return!1;const e=Y(t);if(!e.length)return!1;const i=this.states.filter(n=>!e.includes(n));return i.length!==this.states.length&&(this.runtimeStatesEncoder&&e.forEach(n=>{this.runtimeStatesEncoder[n]=null}),this.useStates(i),!0)}useStates(t,e){var i;if(!this.graphicItem)return!1;this.mark.emit(gt.BEFORE_ELEMENT_STATE,{states:t},this);const n=(i=this.mark.getSpec())===null||i===void 0?void 0:i.stateSort;n&&t.sort(n),this.states=t;const r=ye(e)?e:this.mark.animate.getAnimationConfigs("state").length!==0;return this.graphicItem.stateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,r),this.mark.emit(gt.AFTER_ELEMENT_STATE,{states:t},this),!0}diffAttributes(t){const e={},i=this.getFinalGraphicAttributes();for(const n in t)km(n,i,t)&&Zs(i,n)||(e[n]=t[n]);return e}transformElementItems(t,e,i){var n,r,a,o;const l=t[0];if(!l.nextAttrs||Object.keys(l.nextAttrs).length===0)return{};let h=l.nextAttrs;if(w4(e)&&t&&t.length&&P((n=l.nextAttrs)===null||n===void 0?void 0:n.points)&&(i===!0||Of(Object.keys(l.nextAttrs),this.mark.markType))){const d=this.getGraphicAttribute("points",!1),u=this.getGraphicAttribute("segments",!1),c=this.mark.getSpec().enableSegments,p=t.map(f=>f.nextAttrs),g=this.mark.isProgressive();if(h=rI(h),e===rt.line||e===rt.area){const f=S4(t,!0,d,e===rt.area);if(c&&!g){const _=f&&f.length!==0?f:j4(u),m=F4(p,_,this);m?(h.segments=m,h.points=null):(h.segments=null,h.points=_)}else g?h.segments=((o=(a=(r=this.graphicItem)===null||r===void 0?void 0:r.attribute)===null||a===void 0?void 0:a.segments)!==null&&o!==void 0?o:[]).concat([{points:f}]):(h.points=f,h.segments=null)}else e===rt.largeRects?h.points=A4(t,!0,d):e===rt.largeSymbols&&(h.points=k4(t,!0,d))}return h}applyGraphicAttributes(t){var e,i;if(!vt(t))if(this.mark.needAnimate()){const n=this.diffAttributes(t),r=(e=this.getPrevGraphicAttributes())!==null&&e!==void 0?e:{},a=(i=this.getFinalGraphicAttributes())!==null&&i!==void 0?i:{};Object.keys(n).forEach(h=>{r[h]=this.getGraphicAttribute(h),a[h]=n[h]}),this.setNextGraphicAttributes(n),this.setPrevGraphicAttributes(r),this.setFinalGraphicAttributes(a);const o=this.mark.animate.getElementAnimators(this).reduce((h,d)=>Object.assign(h,d.getEndAttributes()),{}),l=Object.assign({},o,a);this.graphicItem.setAttributes(l)}else this.graphicItem.setAttributes(t)}getGraphicAttribute(t,e=!1){var i;if(!this.graphicItem)return;if(e){let a;const o=this.getPrevGraphicAttributes();if(!P(a=It(o,t)))return a}const n=this.mark.getAttributeTransforms();let r=[t];if(n&&n.length){const a=n.find(o=>o.storedAttrs&&o.channels.includes(t));a&&(r=[a.storedAttrs,t])}return It((i=this.graphicItem)===null||i===void 0?void 0:i.attribute,r)}setGraphicAttribute(t,e,i=!0){if(!this.graphicItem)return;const n=this.getFinalGraphicAttributes(),r=this.getPrevGraphicAttributes();i&&n&&(n[t]=e),r&&!Zs(r,t)&&(r[t]=this.graphicItem.attribute[t]),this.graphicItem.setAttribute(t,e)}setGraphicAttributes(t,e=!0){if(!this.graphicItem)return;const i=this.getFinalGraphicAttributes(),n=this.getPrevGraphicAttributes();Object.keys(t).forEach(r=>{i&&e&&(i[r]=t[r]),n&&!Zs(n,r)&&(n[r]=this.graphicItem.attribute[r])}),this.graphicItem.setAttributes(t)}getFinalGraphicAttributes(){return this.graphicItem.finalAttrs}setFinalGraphicAttributes(t){this.graphicItem.finalAttrs=t}getPrevGraphicAttributes(){return this.graphicItem.prevAttrs}setPrevGraphicAttributes(t){this.graphicItem.prevAttrs=t}getNextGraphicAttributes(){return this.graphicItem.nextAttrs}setNextGraphicAttributes(t){this.graphicItem.nextAttrs=t}clearChangedGraphicAttributes(){this.graphicItem&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null))}clearGraphicAttributes(){this.graphicItem&&(this.graphicItem.prevAttrs&&this.setPrevGraphicAttributes(null),this.graphicItem.nextAttrs&&this.setNextGraphicAttributes(null),this.graphicItem.finalAttrs&&this.setFinalGraphicAttributes(null))}remove(){this.graphicItem&&(Lf(this.graphicItem),this.graphicItem=null)}release(){this.removeGraphicItem(),this.mark=null,this.data=null,this.items=null}getItemAttribute(t){var e,i;if(!((e=this.items)===null||e===void 0)&&e.length)return this.mark.isCollectionMark()?P(t)?this.items.map(n=>n.nextAttrs):this.items.map(n=>{var r;return(r=n.nextAttrs)===null||r===void 0?void 0:r[t]}):P(t)?this.items[0].nextAttrs:(i=this.items[0].nextAttrs)===null||i===void 0?void 0:i[t]}setItemAttributes(t){var e;!((e=this.items)===null||e===void 0)&&e.length&&(this.mark.isCollectionMark()?$(t)&&this.items.forEach((i,n)=>{Object.assign(i.nextAttrs,t[n])}):Object.assign(this.items[0].nextAttrs,t))}getItem(){var t,e;return this.mark.isCollectionMark()?(t=this.items)!==null&&t!==void 0?t:[]:(e=this.items)===null||e===void 0?void 0:e[0]}getDatum(){var t,e;return this.mark.isCollectionMark()?(t=this.data)!==null&&t!==void 0?t:[]:(e=this.data)===null||e===void 0?void 0:e[0]}};const TT=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class gi extends Kh{constructor(t,e){super(t),e!=null&&e.mode&&(this.mode=e.mode,this.setMode(e.mode)),e!=null&&e.skipDefault&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage(()=>{this.render(),this.bindEvents()})}setAttribute(t,e,i){Rn(this.attribute[t])&&Rn(e)&&!K(this.attribute[t])&&!K(e)?lt(this.attribute[t],e):this.attribute[t]=e,TT.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every(n=>TT.includes(n))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){P(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const n=e[i];!Rn(this.attribute[n])||K(this.attribute[n])||K(t[n])?this.attribute[n]=t[n]:lt(this.attribute[n],t[n])}}bindEvents(){}_getNodeId(t){return`${this.id}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const n=new Jx(t,e);n.manager=(i=this.stage)===null||i===void 0?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}class z4{constructor(t){this.onPointerDown=e=>{const i=e.target,n=this.rootNode,r=i===n;if(i&&!r){let l=function(d){if(o||(d.type="dragstart",i==null||i.dispatchEvent(d),o=!0),d.type="drag",i==null||i.dispatchEvent(d),!r){i.pickable=!1;const u=(n==null?void 0:n.pick(d.global.x,d.global.y)).graphic;i.pickable=!0,a!==u&&(a&&(d.type="dragleave",d.target=a,a.dispatchEvent(d)),u&&(d.type="dragenter",d.target=u,u.dispatchEvent(d)),a=u,a&&(d.type="dragover",d.target=a,a.dispatchEvent(d)))}},a,o=!1;n==null||n.addEventListener("pointermove",l);const h=function(){o&&(a&&(e.type="drop",e.target=a,a.dispatchEvent(e)),e.type="dragend",i.dispatchEvent(e),o=!1),n==null||n.removeEventListener("pointermove",l)};i.addEventListener("pointerup",h,{once:!0}),i.addEventListener("pointerupoutside",h,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;(t=this.rootNode)===null||t===void 0||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;(t=this.rootNode)===null||t===void 0||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}}const MT=(s,t)=>{const e=t.x-s.x,i=t.y-s.y;return Math.abs(e)>Math.abs(i)?e>0?"right":"left":i>0?"down":"up"},zp=(s,t)=>{const e=Math.abs(t.x-s.x),i=Math.abs(t.y-s.y);return Math.sqrt(e*e+i*i)},H4=s=>{const t=s.length;if(t===1)return{x:Math.round(s[0].x),y:Math.round(s[0].y)};let e=0,i=0,n=0;for(;n<t;)e+=s[n].x,i+=s[n].y,n++;return{x:Math.round(e/t),y:Math.round(i/t)}};class N4 extends jo{constructor(t,e={}){var i,n,r,a,o,l,h,d,u,c;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=p=>{this.reset(),this.startTime=po.now();const{cachedEvents:g,startPoints:f}=this;p&&g.push(p.clone()),f.length=g.length;for(let _=0;_<g.length;_++){const{x:m,y:v}=g[_],y={x:m,y:v};f[_]=y}if(f.length!==1)this.startDistance=zp(f[0],f[1]),this.center=H4([f[0],f[1]]);else{const _=g[0];this.pressTimeout=setTimeout(()=>{_.direction="none",_.deltaX=0,_.deltaY=0,_.points=f,this.triggerStartEvent("press",_),this.triggerEvent("press",_),this.eventType="press",this.direction="none"},this.config.press.time)}},this.onMove=p=>{this.clearPressTimeout();const{startPoints:g,cachedEvents:f}=this;if(!g.length)return;const _=p.clone(),{x:m,y:v,pointerId:y}=_;for(let w=0,T=f.length;w<T;w++)if(y===f[w].pointerId){f[w]=_;break}const b={x:m,y:v},x=f.map(w=>({x:w.x,y:w.y})),S=po.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=S,this.lastMovePoint=b,g.length===1){const w=g[0],T=m-w.x,M=v-w.y,C=this.direction||MT(w,b);this.direction=C;const R=this.getEventType(b);return _.direction=C,_.deltaX=T,_.deltaY=M,_.points=x,this.triggerStartEvent(R,_),void this.triggerEvent(R,_)}const{startDistance:A}=this,k=zp(x[0],x[1]);_.scale=k/A,_.center=this.center,_.points=x,this.triggerStartEvent("pinch",_),this.triggerEvent("pinch",_)},this.onEnd=p=>{const g=p.clone(),{cachedEvents:f,startPoints:_}=this,m=f.map(v=>({x:v.x,y:v.y}));if(g.points=m,this.triggerEndEvent(g),f.length===1){const v=po.now(),y=this.lastMoveTime;if(v-y<100){const b=y-(this.prevMoveTime||this.startTime);if(b>0){const x=this.prevMovePoint||_[0],S=this.lastMovePoint||_[0],A=zp(x,S),k=A/b;k>this.config.swipe.velocity&&A>this.config.swipe.threshold&&(g.velocity=k,g.direction=MT(x,S),this.triggerEvent("swipe",g))}}v-this.lastTapTime<this.config.tap.interval&&p.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=v,this.lastTapTarget=p.target,this.tapCount===1?this.triggerEvent("tap",g):this.tapCount===2&&(this.triggerEvent("doubletap",g),this.tapCount=0)}for(let v=0,y=f.length;v<y;v++)if(f[v].pointerId===g.pointerId){f.splice(v,1),_.splice(v,1);break}this.reset(),f.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:(n=(i=e==null?void 0:e.press)===null||i===void 0?void 0:i.time)!==null&&n!==void 0?n:251,threshold:(a=(r=e==null?void 0:e.press)===null||r===void 0?void 0:r.threshold)!==null&&a!==void 0?a:9},swipe:{threshold:(l=(o=e==null?void 0:e.swipe)===null||o===void 0?void 0:o.threshold)!==null&&l!==void 0?l:10,velocity:(d=(h=e==null?void 0:e.swipe)===null||h===void 0?void 0:h.velocity)!==null&&d!==void 0?d:.3},tap:{interval:(c=(u=e==null?void 0:e.tap)===null||u===void 0?void 0:u.interval)!==null&&c!==void 0?c:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if(e)return e;let r;return r=po.now()-i>this.config.press.time&&zp(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,n={type:t,ev:e};for(let r=0,a=i.length;r<a;r++)if(i[r].type===t)return void i.splice(r,1,n);i.push(n)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:n}=this;i||(this.throttleTimer=et.global.getRequestAnimationFrame()(()=>{for(let r=0,a=n.length;r<a;r++){const{type:o,ev:l}=n[r];this.emitEvent(o,l)}this.throttleTimer=0,this.emitThrottles.length=0}))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach(i=>{this.triggerEvent(`${i}end`,t),i==="press"&&this.triggerEvent(`${i}up`,t),delete e[i]})}emitEvent(t,e){const i=this.element._events[NR];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}}var G4=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},W4=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};const Ht=[0,0,0],V4=new Ke(1,0,0,1,0,0),U4=(s,t,e,i,n,r,a,o)=>{if(o)for(;e>t;)e-=jt;else for(;e<t;)e+=jt;const l=le/3*(e>t?1:-1);let h=t,d=h;for(;d!==e;){d=l>0?Math.min(d+l,e):Math.max(d+l,e);const u=Math.abs(d-h),c=4*Math.tan(u/4)/3,p=d<h?-1:1,g=Math.cos(h),f=Math.sin(h),_=Math.cos(d),m=Math.sin(d),v=g*r+i,y=f*a+n,b=_*r+i,x=m*a+n,S=r*c*p,A=a*c*p;s.push([v-S*f,y+A*g,b+S*m,x-A*_,b,x]),h=d}};let hh=class{set fillStyle(s){this.nativeContext.fillStyle=s}get fillStyle(){return this.nativeContext.fillStyle}set font(s){this.nativeContext.font=s}get font(){return this.nativeContext.font}set globalAlpha(s){this.nativeContext.globalAlpha=s}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(s){this.nativeContext.lineCap=s}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(s){this.nativeContext.lineDashOffset=s}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(s){this.nativeContext.lineJoin=s}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(s){this.nativeContext.lineWidth=s}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(s){this.nativeContext.miterLimit=s}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(s){this.nativeContext.shadowBlur=s}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(s){this.nativeContext.shadowColor=s}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(s){this.nativeContext.shadowOffsetX=s}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(s){this.nativeContext.shadowOffsetY=s}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(s){this.nativeContext.strokeStyle=s}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(s){this.nativeContext.textAlign=s}get textAlign(){return this.nativeContext.textAlign}set textBaseline(s){this.nativeContext.textBaseline=s}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(s){s!==!!this._inuse&&(this._inuse=s,s?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(s,t){this.fillAttributes=Object.assign(Object.assign({},OR),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},IR),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Ir),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const e=s.nativeCanvas.getContext("2d");if(!e)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=e,this.canvas=s,this.matrix=new Ke(1,0,0,1,0,0),this.stack=[],this.dpr=t,this.applyedMatrix=new Ke(1,0,0,1,0,0)}reset(){this.stack.length&&Nt.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Ke(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(s=!1){!s&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(s){return nn.allocateByObj(s)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(nn.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(nn.free(this.matrix),this.matrix=this.stack.pop())}rotate(s,t=!0){this.matrix.rotate(s),t&&this.setTransformForCurrent()}save(){const s=this.cloneMatrix(this.matrix);this.stack.push(s),this.nativeContext.save()}highPerformanceSave(){const s=this.cloneMatrix(this.matrix);this.stack.push(s)}scale(s,t,e=!0){this.matrix.scale(s,t),e&&this.setTransformForCurrent()}setScale(s,t,e=!0){this.matrix.setScale(s,t),e&&this.setTransformForCurrent()}scalePoint(s,t,e,i,n=!0){this.translate(e,i,!1),this.scale(s,t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}setTransform(s,t,e,i,n,r,a=!0,o=this.dpr){this.matrix.setValue(o*s,o*t,o*e,o*i,o*n,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(s,t=!0,e=this.dpr){this.matrix.setValue(s.a*e,s.b*e,s.c*e,s.d*e,s.e*e,s.f*e),t&&this.setTransformForCurrent()}resetTransform(s=!0,t=this.dpr){this.setTransform(t,0,0,t,0,0),s&&this.setTransformForCurrent()}transform(s,t,e,i,n,r,a=!0){this.matrix.multiply(s,t,e,i,n,r),a&&this.setTransformForCurrent()}transformFromMatrix(s,t){this.matrix.multiply(s.a,s.b,s.c,s.d,s.e,s.f),t&&this.setTransformForCurrent()}translate(s,t,e=!0){this.matrix.translate(s,t),e&&this.setTransformForCurrent()}rotateDegrees(s,t=!0){const e=s*Math.PI/180;this.rotate(e,t)}rotateAbout(s,t,e,i=!0){this.translate(t,e,!1),this.rotate(s,!1),this.translate(-t,-e,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(s,t,e,i=!0){this.translate(t,e,!1),this.rotateDegrees(s,!1),this.translate(-t,-e,!1),i&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(s,t){s?typeof s=="string"?this.nativeContext.clip(s):this.nativeContext.clip(s,t):this.nativeContext.clip()}arc(s,t,e,i,n,r,a){if(a=a||0,this.camera){const o=[];U4(o,i,n,s,t,e,e,r);for(let l=0;l<o.length;++l){const h=o[l];this.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5],a)}}else this.nativeContext.arc(s,t,e,i,n,r)}arcTo(s,t,e,i,n){this.nativeContext.arcTo(s,t,e,i,n)}bezierCurveTo(s,t,e,i,n,r,a){if(a=a||0,this.camera){let o=a,l=a;this.modelMatrix&&(Es(Ht,[s,t,a],this.modelMatrix),s=Ht[0],t=Ht[1],o=Ht[2],Es(Ht,[e,i,a],this.modelMatrix),e=Ht[0],i=Ht[1],l=Ht[2],Es(Ht,[n,r,a],this.modelMatrix),n=Ht[0],r=Ht[1],a=Ht[2]);let h=this.camera.vp(n,r,a);n=h.x,r=h.y,h=this.camera.vp(s,t,o),s=h.x,t=h.y,h=this.camera.vp(e,i,l),e=h.x,i=h.y}this.nativeContext.bezierCurveTo(s,t,e,i,n,r)}closePath(){this.nativeContext.closePath()}ellipse(s,t,e,i,n,r,a,o){o==null?this.nativeContext.ellipse(s,t,e,i,n,r,a):this.nativeContext.ellipse(s,t,e,i,n,r,a,o)}lineTo(s,t,e){if(e=e||0,this.camera){this.modelMatrix&&(Es(Ht,[s,t,e],this.modelMatrix),s=Ht[0],t=Ht[1],e=Ht[2]);const i=this.camera.vp(s,t,e);s=i.x,t=i.y}this.nativeContext.lineTo(s,t)}moveTo(s,t,e){if(e=e||0,this.camera){this.modelMatrix&&(Es(Ht,[s,t,e],this.modelMatrix),s=Ht[0],t=Ht[1],e=Ht[2]);const i=this.camera.vp(s,t,e);s=i.x,t=i.y}this.nativeContext.moveTo(s,t)}quadraticCurveTo(s,t,e,i,n){if(n=n||0,this.camera){let r=n;this.modelMatrix&&(Es(Ht,[s,t,n],this.modelMatrix),s=Ht[0],t=Ht[1],r=Ht[2],Es(Ht,[e,i,n],this.modelMatrix),e=Ht[0],i=Ht[1],n=Ht[2]);let a=this.camera.vp(e,i,n);e=a.x,i=a.y,a=this.camera.vp(s,t,r),s=a.x,t=a.y}this.nativeContext.quadraticCurveTo(s,t,e,i)}rect(s,t,e,i,n){n=n||0,this.camera?(this.moveTo(s,t,n),this.lineTo(s+e,t,n),this.lineTo(s+e,t+i,n),this.lineTo(s,t+i,n),this.closePath()):this.nativeContext.rect(s,t,e,i)}createImageData(){const s=arguments;return s.length===2?this.nativeContext.createImageData(s[0],s[1]):s.length===1?this.nativeContext.createImageData(s[0]):null}createLinearGradient(s,t,e,i){return this.nativeContext.createLinearGradient(s,t,e,i)}createPattern(s,t){return s.width===0||s.height===0?null:this.nativeContext.createPattern(s,t)}createRadialGradient(s,t,e,i,n,r){return this.nativeContext.createRadialGradient(s,t,e,i,n,r)}createConicGradient(s,t,e,i){let n,r=!1;const a=this;return{stops:[],addColorStop(o,l){this.stops.push([o,l]),r=!0},GetPattern(o,l,h){return r&&(h||(h=i-e),n=HN(a,this.stops,s,t,h,e,i,o,l),r=!1),n}}}fill(s,t){this.disableFill||(s?this.nativeContext.fill(s):this.nativeContext.fill())}fillRect(s,t,e,i){this.nativeContext.fillRect(s,t,e,i)}clearRect(s,t,e,i){this.nativeContext.clearRect(s,t,e,i)}project(s,t,e){if(e=e||0,this.camera){this.modelMatrix&&(Es(Ht,[s,t,e],this.modelMatrix),s=Ht[0],t=Ht[1],e=Ht[2]);const i=this.camera.vp(s,t,e);s=i.x,t=i.y}return{x:s,y:t}}view(s,t,e){return e=e||0,this.camera?(this.modelMatrix&&(Es(Ht,[s,t,e],this.modelMatrix),s=Ht[0],t=Ht[1],e=Ht[2]),this.camera.view(s,t,e)):[s,t,e]}fillText(s,t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Es(Ht,[t,e,i],this.modelMatrix),t=Ht[0],e=Ht[1],i=Ht[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.fillText(s,t,e)}getImageData(s,t,e,i){return this.nativeContext.getImageData(s,t,e,i)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(s,t){return this.nativeContext.isPointInPath(s,t)}isPointInStroke(s,t){return this.nativeContext.isPointInStroke(s,t)}measureText(s,t=et.global.measureTextMethod){var e,i;if(!t||t==="native")return this.nativeContext.measureText(s);this.mathTextMeasure||(this.mathTextMeasure=et.graphicUtil.createTextMeasureInstance({},{},()=>this.canvas.nativeCanvas));const n=(e=this.fontFamily)!==null&&e!==void 0?e:Ir.fontFamily,r=(i=this.fontSize)!==null&&i!==void 0?i:Ir.fontSize;return this.mathTextMeasure.textSpec.fontFamily===n&&this.mathTextMeasure.textSpec.fontSize===r||(this.mathTextMeasure.textSpec.fontFamily=n,this.mathTextMeasure.textSpec.fontSize=r,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(s,t)}putImageData(s,t,e){this.nativeContext.putImageData(s,t,e)}setLineDash(s){const t=arguments,e=this.nativeContext;this.nativeContext.setLineDash?e.setLineDash(t[0]):"mozDash"in e?e.mozDash=t[0]:"webkitLineDash"in e&&(e.webkitLineDash=t[0])}stroke(s){this.disableStroke||(s?this.nativeContext.stroke(s):this.nativeContext.stroke())}strokeRect(s,t,e,i){this.nativeContext.strokeRect(s,t,e,i)}strokeText(s,t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Es(Ht,[t,e,i],this.modelMatrix),t=Ht[0],e=Ht[1],i=Ht[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.strokeText(s,t,e)}drawImage(){const s=this.nativeContext,t=arguments;t.length===3?s.drawImage(t[0],t[1],t[2]):t.length===5?s.drawImage(t[0],t[1],t[2],t[3],t[4]):t.length===9&&s.drawImage(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}setCommonStyle(s,t,e,i,n){if(Array.isArray(n)){if(n.length<=1)return this._setCommonStyle(s,t,e,i,n[0]);const r=Object.create(n[0]);return n.forEach((a,o)=>{o!==0&&Object.assign(r,a)}),this._setCommonStyle(s,t,e,i,r)}return this._setCommonStyle(s,t,e,i,n)}_setCommonStyle(s,t,e,i,n){const r=this.nativeContext;n||(n=this.fillAttributes);const{fillOpacity:a=n.fillOpacity,opacity:o=n.opacity,fill:l=n.fill}=t;a>1e-12&&o>1e-12?(r.globalAlpha=a*o,r.fillStyle=sb(this,l,s,e,i)):r.globalAlpha=a*o}setShadowBlendStyle(s,t,e){if(Array.isArray(e)){if(e.length<=1)return this._setShadowBlendStyle(s,e[0]);const i=Object.create(e[0]);return e.forEach((n,r)=>{r!==0&&Object.assign(i,n)}),this._setShadowBlendStyle(s,t,i)}return this._setShadowBlendStyle(s,t,e)}_setShadowBlendStyle(s,t,e){const i=this.nativeContext;e||(e=this.fillAttributes);const{opacity:n=e.opacity,shadowBlur:r=e.shadowBlur,shadowColor:a=e.shadowColor,shadowOffsetX:o=e.shadowOffsetX,shadowOffsetY:l=e.shadowOffsetY,blur:h=e.blur,globalCompositeOperation:d=e.globalCompositeOperation}=t;n<=1e-12||(r||o||l?(i.shadowBlur=r*this.dpr,i.shadowColor=a,i.shadowOffsetX=o*this.dpr,i.shadowOffsetY=l*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),h?(i.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1),d?(i.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(i.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(s,t,e,i,n){if(Array.isArray(n)){if(n.length<=1)return this._setStrokeStyle(s,t,e,i,n[0]);const r=Object.create(n[0]);return n.forEach((a,o)=>{o!==0&&Object.assign(r,a)}),this._setStrokeStyle(s,t,e,i,r)}return this._setStrokeStyle(s,t,e,i,n)}_setStrokeStyle(s,t,e,i,n){const r=this.nativeContext;n||(n=this.strokeAttributes);const{strokeOpacity:a=n.strokeOpacity,opacity:o=n.opacity}=t;if(a>1e-12&&o>1e-12){const{lineWidth:l=n.lineWidth,stroke:h=n.stroke,lineJoin:d=n.lineJoin,lineDash:u=n.lineDash,lineCap:c=n.lineCap,miterLimit:p=n.miterLimit}=t;r.globalAlpha=a*o,r.lineWidth=zi(this,l,this.dpr),r.strokeStyle=sb(this,h,s,e,i),r.lineJoin=d,r.setLineDash(u),r.lineCap=c,r.miterLimit=p}}setTextStyleWithoutAlignBaseline(s,t,e){const i=this.nativeContext;t||(t=this.textAttributes);const{scaleIn3d:n=t.scaleIn3d}=s;s.font?i.font=s.font:i.font=Zy(s,t,n&&this.camera&&this.camera.getProjectionScale(e));const{fontFamily:r=t.fontFamily,fontSize:a=t.fontSize}=s;this.fontFamily=r,this.fontSize=a,i.textAlign="left",i.textBaseline="alphabetic"}setTextStyle(s,t,e){var i,n;const r=this.nativeContext;t||(t=this.textAttributes),s.font?r.font=s.font:r.font=Zy(s,t,this.camera&&this.camera.getProjectionScale(e));const{fontFamily:a=t.fontFamily,fontSize:o=t.fontSize}=s;this.fontFamily=a,this.fontSize=o,r.textAlign=(i=s.textAlign)!==null&&i!==void 0?i:t.textAlign,r.textBaseline=(n=s.textBaseline)!==null&&n!==void 0?n:t.textBaseline}draw(){}clearMatrix(s=!0,t=this.dpr){this.setTransformFromMatrix(V4,s,t)}onlyTranslate(s=this.dpr){return this.matrix.a===s&&this.matrix.b===0&&this.matrix.c===0&&this.matrix.d===s}release(...s){this.stack.forEach(t=>nn.free(t)),this.stack.length=0}};hh.env="browser",hh=G4([ft(),W4("design:paramtypes",[Object,Number])],hh);var $4=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},Y4=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let dh=class extends Zd{constructor(s){super(s)}init(s){const{container:t}=s;if(typeof t=="string"){const e=et.global.getElementById(t);e&&(this._container=e)}else this._container=t;this._context=new hh(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:s}=this;s.width=this._pixelWidth,s.height=this._pixelHeight,!s.style||this.setCanvasStyle(s,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(s),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const s=this._nativeCanvas;s.style.position="absolute",s.style.top=`${this._y}px`,s.style.left=`${this._x}px`}resetStyle(s){if(!this.controled)return;const{width:t=this._displayWidth,height:e=this._displayHeight,dpr:i=this._dpr,x:n=this._x,y:r=this._y}=s,{nativeCanvas:a}=this;a.width=t*i,a.height=e*i,!a.style||this.setCanvasStyle(a,n,r,t,e),s.id&&(a.id=s.id),this.visiable||this.hide()}setCanvasStyle(s,t,e,i,n){this.controled&&(s.style.width=`${i}px`,s.style.height=`${n}px`)}toDataURL(s,t){return s==="image/jpeg"?this._nativeCanvas.toDataURL(s,t):s==="image/png"?this._nativeCanvas.toDataURL(s):this._nativeCanvas.toDataURL(s,t)}resize(s,t){this.controled&&(this._pixelWidth=s*this._dpr,this._pixelHeight=t*this._dpr,this._displayWidth=s,this._displayHeight=t,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${s}px`,this._nativeCanvas.style.height=`${t}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};dh.env="browser",dh=$4([ft(),Y4("design:paramtypes",[Object])],dh);function oI(s,t){return new Et(e=>{e(FR).toDynamicValue(()=>i=>new s(i)).whenTargetNamed(s.env),e(AH).toDynamicValue(()=>(i,n)=>new t(i,n)).whenTargetNamed(t.env)})}const X4=oI(dh,hh),Wr=Symbol.for("MathPickerContribution"),CT=Symbol.for("MathArcPicker"),PT=Symbol.for("MathAreaPicker"),ET=Symbol.for("MathCirclePicker"),Bf=Symbol.for("MathImagePicker"),RT=Symbol.for("MathLinePicker"),OT=Symbol.for("MathPathPicker"),IT=Symbol.for("MathRectPicker"),LT=Symbol.for("MathSymbolPicker"),BT=Symbol.for("MathTextPicker"),DT=Symbol.for("MathPolygonPicker"),FT=Symbol.for("MathGlyphPicker"),jT=Symbol.for("CanvasArcPicker"),zT=Symbol.for("CanvasArc3dPicker"),HT=Symbol.for("CanvasAreaPicker"),NT=Symbol.for("CanvasCirclePicker"),GT=Symbol.for("CanvasImagePicker"),WT=Symbol.for("CanvasLinePicker"),VT=Symbol.for("CanvasPathPicker"),UT=Symbol.for("CanvasRectPicker"),$T=Symbol.for("CanvasRect3dPicker"),YT=Symbol.for("CanvasSymbolPicker"),XT=Symbol.for("CanvasTextPicker"),KT=Symbol.for("CanvasPolygonPicker"),qT=Symbol.for("CanvasPyramid3dPicker"),ZT=Symbol.for("CanvasRichTextPicker"),JT=Symbol.for("CanvasGlyphPicker"),QT=Symbol.for("CanvasGroupPicker"),Ri=Symbol.for("CanvasPickerContribution");var K4=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},q4=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},vd=function(s,t){return function(e,i){t(e,i,s)}};let wl=class extends mb{constructor(s,t,e){super(e),this.contributions=s,this.drawContribution=t,this.pickItemInterceptorContributions=e,this.global.hooks.onSetEnv.tap("canvas-picker-service",(i,n,r)=>{this.configure(r,n)}),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach(s=>{this.pickerMap.set(s.numberType,s)}),super._init()}configure(s,t){this.pickCanvas=Th.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(s,t,e,i){if(s.attribute.pickable===!1)return null;if(this.InterceptorContributions.length)for(let o=0;o<this.InterceptorContributions.length;o++){const l=this.InterceptorContributions[o];if(l.beforePickItem){const h=l.beforePickItem(s,this,t,i,{parentMatrix:e});if(h)return h}}const n=this.pickerMap.get(s.numberType);if(!n)return null;const r=n.contains(s,t,i)?s:null,a={graphic:r};if(r)return a;if(this.InterceptorContributions.length)for(let o=0;o<this.InterceptorContributions.length;o++){const l=this.InterceptorContributions[o];if(l.afterPickItem){const h=l.afterPickItem(s,this,t,i,{parentMatrix:e});if(h)return h}}return a}};wl=K4([ft(),vd(0,Bt(oi)),vd(0,wi(Ri)),vd(1,Bt(yS)),vd(2,Bt(oi)),vd(2,wi(bl)),q4("design:paramtypes",[Object,Object,Object])],wl);var Z4=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Rb=class{constructor(){this.type="group",this.numberType=sS}contains(s,t,e){return!1}};Rb=Z4([ft()],Rb);const Df=new Et((s,t,e,i)=>{Df.__vloaded||(Df.__vloaded=!0,s(QT).to(Rb).inSingletonScope(),s(Ri).toService(QT),Fi(s,Ri))});Df.__vloaded=!1;const J4=new Et((s,t,e,i)=>{e(wl)||s(wl).toSelf().inSingletonScope(),e(oh)?i(oh).toService(wl):s(oh).toService(wl)});function Q4(s){s.load(Df),s.load(J4)}var zd,t$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},e$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let la=zd=class extends Tf{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${zd.idprefix}_${zd.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=et.global}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(s){s.canvas?this.createWindowByCanvas(s):this.createWindowByConfig(s),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch{console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(s){const t=s.getBoundingClientRect(),e=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(t.right<0||t.bottom<0||t.left>e||t.top>i)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const s=new IntersectionObserver((t,e)=>{t.forEach(i=>{this._canvasIsIntersecting!==i.isIntersecting?(this._canvasIsIntersecting=i.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(i.isIntersecting)):this._canvasIsIntersecting=i.isIntersecting})});s&&s.observe(this.canvas.nativeCanvas)}createWindowByConfig(s){const t=this.global.createCanvas({width:s.width,height:s.height});let e;if(e=typeof s.container=="string"?this.global.getElementById(s.container):s.container?s.container:this.global.getRootElement(),!e)throw new Error("发生错误,containerId可能传入有误");s.offscreen?e=null:e.appendChild(t);const i={width:s.width,height:s.height,dpr:s.dpr,nativeCanvas:t,container:e,id:zd.GenerateCanvasId(),canvasControled:!0};this.canvas=new dh(i)}createWindowByCanvas(s){var t;let e;if(typeof s.canvas=="string"){if(e=this.global.getElementById(s.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=s.canvas;if(!e)throw new Error("发生错误,传入的canvas不正确");let i=s.width,n=s.height;if(i==null||n==null||!s.canvasControled){const a=e.getBoundingClientRect();i=a.width,n=a.height}let r=s.dpr;r==null&&(r=(t=e.getContext("2d").pixelRatio)!==null&&t!==void 0?t:e.width/i),this.canvas=new dh({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:s.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(s,t){this.canvas.resize(s,t)}setDpr(s){this.canvas.dpr=s}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(s,t,e){return this.canvas.nativeCanvas.addEventListener(s,t,e)}removeEventListener(s,t,e){return this.canvas.nativeCanvas.removeEventListener(s,t,e)}dispatchEvent(s){return this.canvas.nativeCanvas.dispatchEvent(s)}getStyle(){return this.canvas.nativeCanvas.style}setStyle(s){this.canvas.nativeCanvas.style=s}getBoundingClientRect(){const s=this.canvas.nativeCanvas,t=this.getWH();return s.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(s,t){const e=this.getContext(),i=this.getDpr();e.nativeContext.save(),e.nativeContext.setTransform(i,0,0,i,0,0),e.clearRect(s.x1,s.y1,s.x2-s.x1,s.y2-s.y1),t&&(e.fillStyle=t,e.fillRect(s.x1,s.y1,s.x2-s.x1,s.y2-s.y1)),e.nativeContext.restore()}isVisible(s){return this._canvasIsIntersecting}onVisibleChange(s){this._onVisibleChangeCb=s}getTopLeft(s){return this.global.getElementTopLeft(this.canvas.nativeCanvas,s)}};la.env="browser",la.idprefix="visactor_window",la.prefix_count=0,la=zd=t$([ft(),e$("design:paramtypes",[])],la);const i$=new Et(s=>{s(la).toSelf(),s(Zx).toDynamicValue(t=>t.container.get(la)).whenTargetNamed(la.env)});var s$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},n$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};class r${get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function tM(s,t=!1){const e=document.createElement("img");if(e.crossOrigin="anonymous",t){const i=new Blob([s],{type:"image/svg+xml"});s=window.URL.createObjectURL(i)}return e.src=s,e.complete?Promise.resolve(e):new Promise((i,n)=>{e.onload=()=>{i(e)},e.onerror=()=>{n(new Error("加载失败"))}})}let Ff=class extends wf{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch{this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(s,t){var e;if(t){const{clientX:i,clientY:n}=s,r=t.getBoundingClientRect(),a=(e=t.getNativeHandler)===null||e===void 0?void 0:e.call(t).nativeCanvas;let o,l;return a&&(o=r.width/a.offsetWidth,l=r.height/a.offsetHeight),{x:(i-r.left)/(N(o)?o:1),y:(n-r.top)/(N(l)?l:1)}}return{x:s.offsetX,y:s.offsetY}}getNativeAABBBounds(s){let t=s;if(typeof s=="string"&&(t=new DOMParser().parseFromString(s,"text/html").firstChild,t.lastChild&&(t=t.lastChild.firstChild)),t.getBoundingClientRect){const e=t.getBoundingClientRect();return new r$(e)}return new Le}removeDom(s){return s.parentElement.removeChild(s),!0}createDom(s){const{tagName:t="div",width:e,height:i,style:n,parent:r}=s,a=document.createElement(t);if(n&&(ht(n)?a.setAttribute("style",n):Object.keys(n).forEach(o=>{a.setAttribute(o,n[o])})),e!=null&&(a.style.width=`${e}px`),i!=null&&(a.style.height=`${i}px`),r){const o=ht(r)?this.getElementById(r):r;o&&o.appendChild&&o.appendChild(a)}return a}loadImage(s){return tM(s,!1).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadSvg(s){return tM(s,!0).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}createCanvas(s){var t,e;const i=document.createElement("canvas");s.id&&(i.id=(t=s.id)!==null&&t!==void 0?t:ii.GenAutoIncrementId().toString());const n=(e=s.dpr)!==null&&e!==void 0?e:window.devicePixelRatio;return s.width&&s.height&&(i.style.width=`${s.width}px`,i.style.height=`${s.height}px`,i.width=s.width*n,i.height=s.height*n),i}createOffscreenCanvas(s){var t;const e=(t=s.dpr)!==null&&t!==void 0?t:window.devicePixelRatio;return new OffscreenCanvas(s.width*e,s.height*e)}releaseCanvas(s){let t;t=typeof s=="string"?document.getElementById(s):s,t&&t.parentElement&&t.parentElement.removeChild(t)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(s,t,e){return document.addEventListener(s,t,e)}removeEventListener(s,t,e){return document.removeEventListener(s,t,e)}dispatchEvent(s){return document.dispatchEvent(s)}getElementById(s){return document.getElementById(s)}getRootElement(){return document.body}getDocument(){return document}release(...s){}getElementTop(s,t){let e=s.offsetTop,i=s.offsetParent;for(;i!==null;)e+=i.offsetTop,i=i.offsetParent;return e}getElementLeft(s,t){let e=s.offsetLeft,i=s.offsetParent;for(;i!==null;)e+=i.offsetLeft,i=i.offsetParent;return e}getElementTopLeft(s,t){let e=s.offsetTop,i=s.offsetLeft,n=s.offsetParent;for(;n!==null;)e+=n.offsetTop,i+=n.offsetLeft,n=n.offsetParent;return{top:e,left:i}}};Ff=s$([ft(),n$("design:paramtypes",[])],Ff);const jf=new Et(s=>{jf.isBrowserBound||(jf.isBrowserBound=!0,s(Ff).toSelf().inSingletonScope(),s(om).toService(Ff))});jf.isBrowserBound=!1;function zf(s,t=!0){zf.__loaded||(zf.__loaded=!0,s.load(jf),s.load(X4),s.load(i$),t&&Q4(s))}zf.__loaded=!1;var a$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},o$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let tu=class extends hh{constructor(s,t){super(s,t);const e=s.nativeCanvas.getContext("2d");if(!e)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=e,this.canvas=s,this.matrix=new Ke(1,0,0,1,0,0),this.stack=[],this.dpr=t??1}release(...s){}};tu.env="node",tu=a$([ft(),o$("design:paramtypes",[Object,Number])],tu);var l$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},h$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)};let uh=class extends Zd{constructor(s){super(s)}init(){this._context=new tu(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(...s){this._nativeCanvas.release&&K(this._nativeCanvas.release)&&this._nativeCanvas.release()}};uh.env="node",uh=l$([ft(),h$("design:paramtypes",[Object])],uh);const d$=oI(uh,tu);var u$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},c$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},p$=function(s,t){return function(e,i){t(e,i,s)}};let ch=class extends Tf{get container(){return null}constructor(s){super(),this.global=s,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(s){s.canvas?this.createWindowByCanvas(s):this.createWindowByConfig(s)}createWindowByConfig(s){const t=this.global.createCanvas({width:s.width,height:s.height}),e={width:s.width,height:s.height,dpr:s.dpr,nativeCanvas:t,id:ii.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new uh(e)}createWindowByCanvas(s){const t=s.canvas;let e=s.width,i=s.height;e!=null&&i!=null&&s.canvasControled||(e=t.width,i=t.height),this.canvas=new uh({width:e,height:i,dpr:1,nativeCanvas:t,canvasControled:s.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(s,t){this.canvas.resize(s,t)}setDpr(s){this.canvas.dpr=s}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(s="image/png"){return this.canvas.nativeCanvas.toBuffer(s)}addEventListener(s,t,e){}dispatchEvent(s){return!0}removeEventListener(s,t,e){}getStyle(){}setStyle(s){}getBoundingClientRect(){return null}clearViewBox(s,t){}};ch.env="node",ch=u$([ft(),p$(0,Bt(Xx)),c$("design:paramtypes",[Object])],ch);const g$=new Et(s=>{s(ch).toSelf(),s(Zx).toDynamicValue(t=>t.container.get(ch)).whenTargetNamed(ch.env)});var f$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Hf=class extends wf{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(s,t){s.env===this.type&&(s.setActiveEnvContribution(this),this.pkg=t)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(s){const t=fetch(s).then(e=>e.json());return t.then(e=>({data:e,state:"success"})).catch(()=>({data:null,state:"fail"})),t}loadArrayBuffer(s){return fetch(s).then(t=>t.arrayBuffer()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadImage(s){const{loadImage:t}=this.pkg;return t?t(s).then(e=>({loadState:e?"success":"fail",data:e})).catch(()=>({loadState:"fail",data:null})):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(s){const t=this.pkg.Resvg;if(!t)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const e=new t(s).render().asPng();return this.loadImage(e)}createCanvas(s){return this.pkg.createCanvas(s.width,s.height)}releaseCanvas(s){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(s){return gk.call(s)}}getCancelAnimationFrame(){return s=>{gk.clear(s)}}addEventListener(s,t,e){}removeEventListener(s,t,e){}getElementById(s){return null}getRootElement(){return null}dispatchEvent(s){}release(...s){}createOffscreenCanvas(s){}};Hf=f$([ft()],Hf);const Nf=new Et(s=>{Nf.isNodeBound||(Nf.isNodeBound=!0,s(Hf).toSelf().inSingletonScope(),s(om).toService(Hf))});Nf.isNodeBound=!1;function Gf(s,t=!0){Gf.__loaded||(Gf.__loaded=!0,s.load(Nf),s.load(d$),s.load(g$))}Gf.__loaded=!1;var _$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},m$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},v$=function(s,t){return function(e,i){t(e,i,s)}};let Ob=class{constructor(s){this.canvasRenderer=s,this.type="arc",this.numberType=dm}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).arc;i.highPerformanceSave();let{x:r=n.x,y:a=n.y}=s.attribute;if(s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,(l,h,d)=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=zi(i,u+c,i.dpr),o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Ob=_$([ft(),v$(0,Bt(nf)),m$("design:paramtypes",[Object])],Ob);let eM=!1;const y$=new Et((s,t,e,i)=>{eM||(eM=!0,s(jT).to(Ob).inSingletonScope(),s(Ri).toService(jT))});var b$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},x$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},S$=function(s,t){return function(e,i){t(e,i,s)}};let Ib=class{constructor(s){this.canvasRenderer=s,this.type="arc",this.numberType=dm}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).arc;i.highPerformanceSave();let{x:r=n.x,y:a=n.y}=s.attribute;if(s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,(l,h,d)=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=u+c,o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Ib=b$([ft(),S$(0,Bt(nf)),x$("design:paramtypes",[Object])],Ib);let iM=!1;const A$=new Et((s,t,e,i)=>{iM||(iM=!0,s(CT).to(Ib).inSingletonScope(),s(Wr).toService(CT))});var k$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},w$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},T$=function(s,t){return function(e,i){t(e,i,s)}};const k0=new Le;let Lb=class{constructor(s){this.canvasRenderer=s,this.type="rect",this.numberType=_m}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).rect,{cornerRadius:r=n.cornerRadius}=s.attribute;let{x:a=n.x,y:o=n.y}=s.attribute;i.highPerformanceSave();let l=!0;if(s.transMatrix.onlyTranslate()){const d=s.getOffsetXY(n);a+=d.x,o+=d.y,i.setTransformForCurrent()}else a=0,o=0,l=!1,i.transformFromMatrix(s.transMatrix,!0);let h=!0;if(!l||s.shadowRoot||dt(r,!0)&&r!==0||$(r)&&r.some(d=>d!==0))h=!1,this.canvasRenderer.drawShape(s,i,a,o,{},null,(d,u,c)=>!!h||(h=d.isPointInPath(t.x,t.y),h),(d,u,c)=>{if(h)return!0;const p=u.lineWidth||c.lineWidth,g=u.pickStrokeBuffer||c.pickStrokeBuffer;return i.lineWidth=zi(i,p+g,i.dpr),h=d.isPointInStroke(t.x,t.y),h});else{const{fill:d=n.fill,stroke:u=n.stroke,lineWidth:c=n.lineWidth}=s.attribute;if(d)h=!0;else if(u){const p=s.AABBBounds;k0.setValue(p.x1,p.y1,p.x2,p.y2),k0.expand(-c/2),h=!k0.containsPoint(t)}}return i.highPerformanceRestore(),h}};Lb=k$([ft(),T$(0,Bt(df)),w$("design:paramtypes",[Object])],Lb);let sM=!1;const M$=new Et((s,t,e,i)=>{sM||(sM=!0,s(UT).to(Lb).inSingletonScope(),s(Ri).toService(UT))});var C$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},P$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},E$=function(s,t){return function(e,i){t(e,i,s)}};const w0=new Le;let Bb=class{constructor(s){this.canvasRenderer=s,this.type="rect",this.numberType=_m}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).rect,{cornerRadius:r=n.cornerRadius}=s.attribute;let{x:a=n.x,y:o=n.y}=s.attribute;i.highPerformanceSave();let l=!0;if(s.transMatrix.onlyTranslate()){const d=s.getOffsetXY(n);a+=d.x,o+=d.y,i.setTransformForCurrent()}else a=0,o=0,l=!1,i.transformFromMatrix(s.transMatrix,!0);let h=!0;if(!l||dt(r,!0)&&r!==0||$(r)&&r.some(d=>d!==0))h=!1,this.canvasRenderer.drawShape(s,i,a,o,{},null,(d,u,c)=>!!h||(h=d.isPointInPath(t.x,t.y),h),(d,u,c)=>{if(h)return!0;const p=u.lineWidth||c.lineWidth,g=u.pickStrokeBuffer||c.pickStrokeBuffer;return i.lineWidth=p+g,h=d.isPointInStroke(t.x,t.y),h});else if(h){const{fill:d=n.fill,stroke:u=n.stroke,lineWidth:c=n.lineWidth}=s.attribute;if(d)h=!0;else if(u){const p=s.AABBBounds;w0.setValue(p.x1,p.y1,p.x2,p.y2),w0.expand(-c/2),h=!w0.containsPoint(t)}}return i.highPerformanceRestore(),h}};Bb=C$([ft(),E$(0,Bt(df)),P$("design:paramtypes",[Object])],Bb);let nM=!1;const R$=new Et((s,t,e,i)=>{nM||(nM=!0,s(IT).to(Bb).inSingletonScope(),s(Wr).toService(IT))});var O$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let jr=class extends vs{};jr=O$([ft()],jr);var I$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},L$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},B$=function(s,t){return function(e,i){t(e,i,s)}};let Db=class extends jr{constructor(s){super(),this.canvasRenderer=s,this.type="line",this.numberType=Cc}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;i.highPerformanceSave();const n=at(s).line,r=this.transform(s,n,i),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=t;if(i.camera){d=t.clone();const c=s.parent.globalTransMatrix;d.x=c.a*t.x+c.c*t.y+c.e,d.y=c.b*t.x+c.d*t.y+c.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(s,i,a,o,{},null,c=>!!u||(u=c.isPointInPath(d.x,d.y),u),(c,p,g)=>{if(u)return!0;const f=p.lineWidth||g.lineWidth,_=p.pickStrokeBuffer||g.pickStrokeBuffer;return i.lineWidth=zi(i,f+_,i.dpr),u=c.isPointInStroke(d.x,d.y),u}),this.canvasRenderer.z=0,i.modelMatrix!==h&&ve.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};Db=I$([ft(),B$(0,Bt(of)),L$("design:paramtypes",[Object])],Db);let rM=!1;const D$=new Et((s,t,e,i)=>{rM||(rM=!0,s(WT).to(Db).inSingletonScope(),s(Ri).toService(WT))});var F$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},j$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},z$=function(s,t){return function(e,i){t(e,i,s)}};let Fb=class{constructor(s){this.canvasRenderer=s,this.type="line",this.numberType=Cc}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).line;let{x:r=n.x,y:a=n.y}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,l=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=u+c,o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Fb=F$([ft(),z$(0,Bt(of)),j$("design:paramtypes",[Object])],Fb);let aM=!1;const H$=new Et((s,t,e,i)=>{aM||(aM=!0,s(RT).to(Fb).inSingletonScope(),s(Wr).toService(RT))});var N$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},G$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},W$=function(s,t){return function(e,i){t(e,i,s)}};let jb=class{constructor(s){this.canvasRenderer=s,this.type="area",this.numberType=Mc}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).area;let{x:r=n.x,y:a=n.y}=s.attribute;const{fillPickable:o=n.fillPickable,strokePickable:l=n.strokePickable}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const d=s.getOffsetXY(n);r+=d.x,a+=d.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let h=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,d=>!!h||!!o&&(h=d.isPointInPath(t.x,t.y),h),(d,u,c)=>{if(h)return!0;if(!l)return!1;const p=u.lineWidth||c.lineWidth,g=u.pickStrokeBuffer||c.pickStrokeBuffer;return i.lineWidth=zi(i,p+g,i.dpr),h=d.isPointInStroke(t.x,t.y),h}),i.highPerformanceRestore(),h}};jb=N$([ft(),W$(0,Bt(rf)),G$("design:paramtypes",[Object])],jb);let oM=!1;const V$=new Et((s,t,e,i)=>{oM||(oM=!0,s(HT).to(jb).inSingletonScope(),s(Ri).toService(HT))});var U$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},$$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},Y$=function(s,t){return function(e,i){t(e,i,s)}};let zb=class{constructor(s){this.canvasRenderer=s,this.type="area",this.numberType=Mc}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).area;let{x:r=n.x,y:a=n.y}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,l=>!!o||(o=l.isPointInPath(t.x,t.y),o)),i.highPerformanceRestore(),o}};zb=U$([ft(),Y$(0,Bt(rf)),$$("design:paramtypes",[Object])],zb);let lM=!1;const X$=new Et((s,t,e,i)=>{lM||(lM=!0,s(PT).to(zb).inSingletonScope(),s(Wr).toService(PT))});var K$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},q$=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},Z$=function(s,t){return function(e,i){t(e,i,s)}};let Hb=class extends jr{constructor(s){super(),this.canvasRenderer=s,this.type="symbol",this.numberType=mm}contains(s,t,e){const{pickContext:i}=e??{};if(!i)return!1;const n=s.getParsedPath();if(!i.camera){if(!s.AABBBounds.containsPoint(t))return!1;if(n.isSvg||s.attribute.pickMode==="imprecise")return!0}i.highPerformanceSave();const r=at(s).symbol,a=this.transform(s,r,i),{x:o,y:l,z:h,lastModelMatrix:d}=a;let u=t;if(i.camera){u=t.clone();const p=s.parent.globalTransMatrix;u.x=p.a*t.x+p.c*t.y+p.e,u.y=p.b*t.x+p.d*t.y+p.f}this.canvasRenderer.z=h;let c=!1;return this.canvasRenderer.drawShape(s,i,o,l,{},null,(p,g,f)=>!!c||(c=p.isPointInPath(u.x,u.y),c),(p,g,f)=>{if(c)return!0;const _=g.lineWidth||f.lineWidth,m=g.pickStrokeBuffer||f.pickStrokeBuffer;return i.lineWidth=zi(i,_+m,i.dpr),c=p.isPointInStroke(u.x,u.y),c}),this.canvasRenderer.z=0,i.modelMatrix!==d&&ve.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),c}};Hb=K$([ft(),Z$(0,Bt(uf)),q$("design:paramtypes",[Object])],Hb);let hM=!1;const J$=new Et((s,t,e,i)=>{hM||(hM=!0,s(YT).to(Hb).inSingletonScope(),s(Ri).toService(YT))});var Q$=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},t8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},e8=function(s,t){return function(e,i){t(e,i,s)}};let Nb=class{constructor(s){this.canvasRenderer=s,this.type="symbol",this.numberType=mm}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).symbol;let{x:r=n.x,y:a=n.y}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,(l,h,d)=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=u+c,o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Nb=Q$([ft(),e8(0,Bt(uf)),t8("design:paramtypes",[Object])],Nb);let dM=!1;const i8=new Et((s,t,e,i)=>{dM||(dM=!0,s(LT).to(Nb).inSingletonScope(),s(Wr).toService(LT))});var s8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},n8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},r8=function(s,t){return function(e,i){t(e,i,s)}};let Gb=class{constructor(s){this.canvasRenderer=s,this.type="circle",this.numberType=um}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).circle;let{x:r=n.x,y:a=n.y}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,(l,h,d)=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=zi(i,u+c,i.dpr),o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Gb=s8([ft(),r8(0,Bt(af)),n8("design:paramtypes",[Object])],Gb);let uM=!1;const a8=new Et((s,t,e,i)=>{uM||(uM=!0,s(NT).to(Gb).inSingletonScope(),s(Ri).toService(NT))});var o8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},l8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},h8=function(s,t){return function(e,i){t(e,i,s)}};let Wb=class{constructor(s){this.canvasRenderer=s,this.type="circle",this.numberType=um}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).circle;let{x:r=n.x,y:a=n.y}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,(l,h,d)=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=u+c,o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Wb=o8([ft(),h8(0,Bt(af)),l8("design:paramtypes",[Object])],Wb);let cM=!1;const d8=new Et((s,t,e,i)=>{cM||(cM=!0,s(ET).to(Wb).inSingletonScope(),s(Wr).toService(ET))});var u8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},c8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},p8=function(s,t){return function(e,i){t(e,i,s)}};let Vb=class extends jr{constructor(s){super(),this.canvasRenderer=s,this.type="text",this.numberType=vm}contains(s,t,e){const{pickContext:i}=e??{};if(!i)return!1;const n=s.AABBBounds;if(!i.camera)return!!n.containsPoint(t);i.highPerformanceSave();const r=at(s).text,{keepDirIn3d:a=r.keepDirIn3d}=s.attribute,o=!a,l=this.transform(s,r,i,o),{x:h,y:d,z:u,lastModelMatrix:c}=l;this.canvasRenderer.z=u;let p=t;if(i.camera){p=t.clone();const f=s.parent.globalTransMatrix;p.x=f.a*t.x+f.c*t.y+f.e,p.y=f.b*t.x+f.d*t.y+f.f}let g=!1;return this.canvasRenderer.drawShape(s,i,h,d,{},null,(f,_,m)=>{if(g)return!0;const{fontSize:v=r.fontSize,textBaseline:y=r.textBaseline,textAlign:b=r.textAlign}=s.attribute,x=s.AABBBounds,S=x.height(),A=x.width(),k=Ar(y,S,v),w=Sr(b,A);return f.rect(w+h,k+d,A,S,u),g=f.isPointInPath(p.x,p.y),g},(f,_,m)=>g),this.canvasRenderer.z=0,i.modelMatrix!==c&&ve.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),g}};Vb=u8([ft(),p8(0,Bt(db)),c8("design:paramtypes",[Object])],Vb);let pM=!1;const g8=new Et((s,t,e,i)=>{pM||(pM=!0,s(XT).to(Vb).inSingletonScope(),s(Ri).toService(XT))});var f8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Ub=class{constructor(){this.type="text",this.numberType=vm}contains(s,t,e){return!!s.AABBBounds.containsPoint(t)}};Ub=f8([ft()],Ub);let gM=!1;const _8=new Et((s,t,e,i)=>{gM||(gM=!0,s(BT).to(Ub).inSingletonScope(),s(Wr).toService(BT))});var m8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},v8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},y8=function(s,t){return function(e,i){t(e,i,s)}};let $b=class extends jr{constructor(s){super(),this.canvasRenderer=s,this.type="path",this.numberType=gm}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).path;i.highPerformanceSave();const r=this.transform(s,n,i),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=t;if(i.camera){d=t.clone();const c=s.parent.globalTransMatrix;d.x=c.a*t.x+c.c*t.y+c.e,d.y=c.b*t.x+c.d*t.y+c.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(s,i,a,o,{},null,(c,p,g)=>!!u||(u=c.isPointInPath(d.x,d.y),u),(c,p,g)=>{if(u)return!0;const f=p.lineWidth||g.lineWidth,_=p.pickStrokeBuffer||g.pickStrokeBuffer;return i.lineWidth=zi(i,f+_,i.dpr),u=c.isPointInStroke(d.x,d.y),u}),this.canvasRenderer.z=0,i.modelMatrix!==h&&ve.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};$b=m8([ft(),y8(0,Bt(lf)),v8("design:paramtypes",[Object])],$b);let fM=!1;const b8=new Et((s,t,e,i)=>{fM||(fM=!0,s(VT).to($b).inSingletonScope(),s(Ri).toService(VT))});var x8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},S8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},A8=function(s,t){return function(e,i){t(e,i,s)}};let Yb=class{constructor(s){this.canvasRenderer=s,this.type="path",this.numberType=gm}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).path;let{x:r=n.x,y:a=n.y}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,(l,h,d)=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=u+c,o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Yb=x8([ft(),A8(0,Bt(lf)),S8("design:paramtypes",[Object])],Yb);let _M=!1;const k8=new Et((s,t,e,i)=>{_M||(_M=!0,s(OT).to(Yb).inSingletonScope(),s(Wr).toService(OT))});var w8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},T8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},M8=function(s,t){return function(e,i){t(e,i,s)}};let Xb=class{constructor(s){this.canvasRenderer=s,this.type="polygon",this.numberType=fm}contains(s,t,e){if(!s.AABBBounds.contains(t.x,t.y))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).polygon;let{x:r=n.x,y:a=n.y}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,(l,h,d)=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=zi(i,u+c,i.dpr),o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Xb=w8([ft(),M8(0,Bt(hf)),T8("design:paramtypes",[Object])],Xb);let mM=!1;const C8=new Et((s,t,e,i)=>{mM||(mM=!0,s(KT).to(Xb).inSingletonScope(),s(Ri).toService(KT))});var P8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},E8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},R8=function(s,t){return function(e,i){t(e,i,s)}};let Kb=class{constructor(s){this.canvasRenderer=s,this.type="polygon",this.numberType=fm}contains(s,t,e){if(!s.AABBBounds.contains(t.x,t.y))return!1;const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).polygon;let{x:r=n.x,y:a=n.y}=s.attribute;if(i.highPerformanceSave(),s.transMatrix.onlyTranslate()){const l=s.getOffsetXY(n);r+=l.x,a+=l.y,i.setTransformForCurrent()}else r=0,a=0,i.transformFromMatrix(s.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(s,i,r,a,{},null,(l,h,d)=>!!o||(o=l.isPointInPath(t.x,t.y),o),(l,h,d)=>{if(o)return!0;const u=h.lineWidth||d.lineWidth,c=h.pickStrokeBuffer||d.pickStrokeBuffer;return i.lineWidth=u+c,o=l.isPointInStroke(t.x,t.y),o}),i.highPerformanceRestore(),o}};Kb=P8([ft(),R8(0,Bt(hf)),E8("design:paramtypes",[Object])],Kb);let vM=!1;const O8=new Et((s,t,e,i)=>{vM||(vM=!0,s(DT).to(Kb).inSingletonScope(),s(Wr).toService(DT))});var I8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},L8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},B8=function(s,t){return function(e,i){t(e,i,s)}};let qb=class{constructor(s){this.canvasRenderer=s,this.type="glyph",this.numberType=cm}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=e==null?void 0:e.pickerService;if(n){let r=!1;return s.getSubGraphic().forEach(a=>{if(r)return;const o=n.pickItem(a,t,null,e);r=!(!o||!o.graphic)}),r}return!1}};qb=I8([ft(),B8(0,Bt(cf)),L8("design:paramtypes",[Object])],qb);let yM=!1;const D8=new Et((s,t,e,i)=>{yM||(yM=!0,s(JT).to(qb).inSingletonScope(),s(Ri).toService(JT))});var F8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},j8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},z8=function(s,t){return function(e,i){t(e,i,s)}};let Wf=class{constructor(s){this.canvasRenderer=s,this.type="glyph",this.numberType=cm}contains(s,t,e){if(!s.AABBBounds.containsPoint(t))return!1;if(s.attribute.pickMode==="imprecise")return!0;const{pickContext:i}=e??{};if(!i)return!1;const n=e==null?void 0:e.pickerService;if(n){let r=!1;return s.getSubGraphic().forEach(a=>{r||(r=!!n.pickItem(a,t,null,e))}),r}return!1}};Wf=F8([ft(),z8(0,Bt(cf)),j8("design:paramtypes",[Object])],Wf);let bM=!1;const H8=new Et((s,t,e,i)=>{bM||(bM=!0,s(FT).to(Wf).inSingletonScope(),s(Wf).toService(FT))});var N8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},G8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},W8=function(s,t){return function(e,i){t(e,i,s)}};let Zb=class{constructor(s){this.canvasRenderer=s,this.type="richtext",this.numberType=aS}contains(s,t,e){return!!s.AABBBounds.containsPoint(t)}};Zb=N8([ft(),W8(0,Bt(ub)),G8("design:paramtypes",[Object])],Zb);let xM=!1;const V8=new Et((s,t,e,i)=>{xM||(xM=!0,s(ZT).to(Zb).inSingletonScope(),s(Ri).toService(ZT))});var U8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Oh=class{constructor(){this.type="image",this.numberType=pm}contains(s,t,e){const{pickContext:i}=e??{};return!!i&&!!s.AABBBounds.containsPoint(t)}};Oh=U8([ft()],Oh);let SM=!1;const $8=new Et((s,t,e,i)=>{SM||(SM=!0,s(Bf).to(Oh).inSingletonScope(),s(Oh).toService(Bf))});var Y8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let Jb=class{constructor(){this.type="image",this.numberType=pm}contains(s,t,e){const{pickContext:i}=e??{};return!!i&&!!s.AABBBounds.containsPoint(t)}};Jb=Y8([ft()],Jb);let AM=!1;const X8=new Et((s,t,e,i)=>{AM||(AM=!0,s(GT).to(Jb).inSingletonScope(),s(Ri).toService(GT))});let kM=!1;const K8=new Et((s,t,e,i)=>{kM||(kM=!0,s(Bf).to(Oh).inSingletonScope(),s(Oh).toService(Bf))});var q8=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},Z8=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},J8=function(s,t){return function(e,i){t(e,i,s)}};new Le;let Qb=class extends jr{constructor(s){super(),this.canvasRenderer=s,this.type="rect3d",this.numberType=rS}contains(s,t,e){const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).rect;i.highPerformanceSave();const r=this.transform(s,n,i),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=t;if(i.camera){d=t.clone();const c=s.parent.globalTransMatrix;d.x=c.a*t.x+c.c*t.y+c.e,d.y=c.b*t.x+c.d*t.y+c.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(s,i,a,o,e,null,(c,p,g)=>!!u||(u=c.isPointInPath(d.x,d.y),u)),this.canvasRenderer.z=0,i.modelMatrix!==h&&ve.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};Qb=q8([ft(),J8(0,Bt(hb)),Z8("design:paramtypes",[Object])],Qb);let wM=!1;const Q8=new Et((s,t,e,i)=>{wM||(wM=!0,s($T).to(Qb).inSingletonScope(),s(Ri).toService($T))});var tY=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},eY=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},iY=function(s,t){return function(e,i){t(e,i,s)}};let tx=class extends jr{constructor(s){super(),this.canvasRenderer=s,this.type="arc3d",this.numberType=Tc}contains(s,t,e){const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).arc;i.highPerformanceSave();const r=this.transform(s,n,i),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=t;if(i.camera){d=t.clone();const c=s.parent.globalTransMatrix;d.x=c.a*t.x+c.c*t.y+c.e,d.y=c.b*t.x+c.d*t.y+c.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(s,i,a,o,e,null,(c,p,g)=>!!u||(u=c.isPointInPath(d.x,d.y),u)),this.canvasRenderer.z=0,i.modelMatrix!==h&&ve.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};tx=tY([ft(),iY(0,Bt(lb)),eY("design:paramtypes",[Object])],tx);let TM=!1;const sY=new Et((s,t,e,i)=>{TM||(TM=!0,s(zT).to(tx).inSingletonScope(),s(Ri).toService(zT))});var nY=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a},rY=function(s,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,t)},aY=function(s,t){return function(e,i){t(e,i,s)}};let ex=class extends jr{constructor(s){super(),this.canvasRenderer=s,this.type="pyramid3d",this.numberType=nS}contains(s,t,e){const{pickContext:i}=e??{};if(!i)return!1;const n=at(s).polygon;i.highPerformanceSave();const r=this.transform(s,n,i),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=t;if(i.camera){d=t.clone();const c=s.parent.globalTransMatrix;d.x=c.a*t.x+c.c*t.y+c.e,d.y=c.b*t.x+c.d*t.y+c.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(s,i,a,o,{},null,(c,p,g)=>!!u||(u=c.isPointInPath(d.x,d.y),u),(c,p,g)=>!1),this.canvasRenderer.z=0,i.modelMatrix!==h&&ve.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};ex=nY([ft(),aY(0,Bt(cb)),rY("design:paramtypes",[Object])],ex);let MM=!1;const oY=new Et((s,t,e,i)=>{MM||(MM=!0,s(qT).to(ex).inSingletonScope(),s(Ri).toService(qT))}),cn=SS();function Vf(){Vf.__loaded||(Vf.__loaded=!0,qV(),Pt.load(MV),Pt.load(cn?y$:A$))}Vf.__loaded=!1;const DS=Vf;function Uf(){Uf.__loaded||(Uf.__loaded=!0,ZV(),Pt.load(YV),Pt.load(sY))}Uf.__loaded=!1;const lY=Uf;function $f(){$f.__loaded||($f.__loaded=!0,JV(),Pt.load(EV),Pt.load(cn?V$:X$))}$f.__loaded=!1;const lI=$f;function Yf(){Yf.__loaded||(Yf.__loaded=!0,QV(),Pt.load(OV),Pt.load(cn?a8:d8))}Yf.__loaded=!1;const hY=Yf;function Xf(){Xf.__loaded||(Xf.__loaded=!0,tU(),Pt.load(FV),Pt.load(cn?D8:H8))}Xf.__loaded=!1;const dY=Xf;function Kf(){Kf.__loaded||(Kf.__loaded=!0,eU())}Kf.__loaded=!1;const qe=Kf;function qf(){qf.__loaded||(qf.__loaded=!0,iU(),Pt.load(NV),Pt.load(cn?X8:K8))}qf.__loaded=!1;const hI=qf;function Zf(){Zf.__loaded||(Zf.__loaded=!0,sU(),Pt.load(PV),Pt.load(cn?D$:H$))}Zf.__loaded=!1;const qa=Zf;function Jf(){Jf.__loaded||(Jf.__loaded=!0,nU(),Pt.load(LV),Pt.load(cn?b8:k8))}Jf.__loaded=!1;const Ic=Jf;function Qf(){Qf.__loaded||(Qf.__loaded=!0,rU(),Pt.load(BV),Pt.load(cn?C8:O8))}Qf.__loaded=!1;const Mm=Qf;function t_(){t_.__loaded||(t_.__loaded=!0,aU(),Pt.load(KV),Pt.load(oY))}t_.__loaded=!1;const uY=t_;function e_(){e_.__loaded||(e_.__loaded=!0,oU(),Pt.load(CV),Pt.load(cn?M$:R$))}e_.__loaded=!1;const Vr=e_;function i_(){i_.__loaded||(i_.__loaded=!0,lU(),Pt.load(WV),Pt.load(Q8))}i_.__loaded=!1;const cY=i_;function s_(){s_.__loaded||(s_.__loaded=!0,hU(),Pt.load(HV),Pt.load(cn?V8:$8))}s_.__loaded=!1;const Za=s_;function n_(){n_.__loaded||(n_.__loaded=!0,cU())}n_.__loaded=!1;const Gi=n_;function r_(){r_.__loaded||(r_.__loaded=!0,dU(),Pt.load(RV),Pt.load(cn?J$:i8))}r_.__loaded=!1;const Dn=r_;function a_(){a_.__loaded||(a_.__loaded=!0,uU(),Pt.load(IV),Pt.load(cn?g8:_8))}a_.__loaded=!1;const Ja=a_;function o_(){o_.__loaded||(o_.__loaded=!0,pU())}o_.__loaded=!1;const dI=o_;function pY(){qe(),Vr()}const CM={debounce:lr,throttle:Ka};pY();let uI=class cI extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},cI.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=i=>{const{viewX:n,viewY:r}=i,{direction:a,width:o,height:l,range:h}=this.attribute,d=this._sliderSize,[u,c]=this._getScrollRange();let p;if(a==="vertical"){const g=r-this._viewPosition.y,f=xi(g-d/2,u,c);p=g/l,this._slider.setAttribute("y",f,!0)}else{const g=n-this._viewPosition.x,f=xi(g-d/2,u,c);p=g/o,this._slider.setAttribute("x",f,!0)}this.setScrollRange([p-(h[1]-h[0])/2,p+(h[1]-h[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=i=>{i.stopPropagation();const{direction:n}=this.attribute;this._prePos=n==="horizontal"?i.clientX:i.clientY,this._dispatchEvent("scrollDown",{pos:this._prePos,event:i}),Gt.env==="browser"?(Gt.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),Gt.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=i=>{const{direction:n}=this.attribute;let r,a,o=0;const{width:l,height:h}=this._getSliderRenderBounds();return n==="vertical"?(a=i.clientY,o=a-this._prePos,r=o/h):(a=i.clientX,o=a-this._prePos,r=o/l),[a,r]},this._onSliderPointerMove=CM[this.attribute.delayType](i=>{i.stopPropagation();const n=this.getScrollRange(),[r,a]=this._computeScrollValue(i);this.setScrollRange([n[0]+a,n[1]+a],!0),this._prePos=r},this.attribute.delayTime),this._onSliderPointerUp=i=>{i.preventDefault();const{realTime:n=!0,range:r,limitRange:a=[0,1]}=this.attribute,o=this.getScrollRange(),[l,h]=this._computeScrollValue(i),d=[o[0]+h,o[1]+h];n||this._dispatchEvent("scroll",{pre:r,value:sa(d,a[0],a[1])}),this._dispatchEvent("scrollUp",{pre:r,value:sa(d,a[0],a[1])}),Gt.env==="browser"?(Gt.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),Gt.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){const{direction:i="horizontal",limitRange:n=[0,1],range:r,realTime:a=!0}=this.attribute,o=sa(t,n[0],n[1]);if(e){const l=this._getSliderPos(o);this._slider&&(i==="horizontal"?this._slider.setAttribute("x",l[0],!0):this._slider.setAttribute("y",l[0],!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame())}this.attribute.range=o,a&&(this._dispatchEvent("scroll",{pre:r,value:o}),this._dispatchEvent("scrollDrag",{pre:r,value:o}))}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",CM[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:i,range:n,limitRange:r=[0,1],railStyle:a,sliderStyle:o,padding:l=2}=this.attribute,h=this.createOrUpdateChild("scrollbar-container",{},"group"),d=h.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:e,height:i},a),"rect");this._rail=d;const u=this._getSliderRenderBounds(),c=this._getSliderPos(sa(n,r[0],r[1])),p=c[1]-c[0];let g;this._sliderSize=p,g=t==="horizontal"?{x:c[0],y:u.y1,width:p,height:u.height}:{x:u.x1,y:c[0],width:u.width,height:p};const f=h.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},g),{cornerRadius:this._getDefaultSliderCornerRadius()}),o),{boundsPadding:_s(l),pickMode:"imprecise"}),"rect");this._slider=f,this._container=h;const _=this._container.AABBBounds;this._viewPosition={x:_.x1,y:_.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:i=2}=this.attribute,[n,r,a,o]=_s(i),l={x1:o,y1:n,x2:t-r,y2:e-a,width:Math.max(0,t-(o+r)),height:Math.max(0,e-(n+a))};return this._sliderRenderBounds=l,l}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:i,height:n}=this._getSliderRenderBounds();return t==="horizontal"?n:i}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:n,x1:r,y1:a}=this._getSliderRenderBounds();return e==="horizontal"?[i*t[0]+r,i*t[1]+r]:[n*t[0]+a,n*t[1]+a]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[i,n]=sa(t,0,1),{width:r,height:a,x1:o,y1:l}=this._getSliderRenderBounds(),h=this._sliderSize;return e==="horizontal"?sa([o+i*r,o+n*r],o,r-h):sa([l+i*a,l+n*a],l,a-h)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}};uI.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};function Cn(s,t){s.forEachChildren(e=>{const i=t(e);e.isContainer&&!i&&Cn(e,t)})}const Je=s=>!P(s)&&s.visible!==!1;function gY(s,t){if(!t)return[];const e=s.find(i=>i.name===t,!0);return e?e.getChildren():[]}function fY(s,t){if(!t)return[];const e=s.find(i=>i.name===t,!0);return e?e.findAll(i=>i.type!=="group",!0):[]}const _Y=["#ffffff","#000000"];function PM(s,t,e,i,n,r){if(typeof s!="string"||typeof t!="string")return s;const a=new Qe(s).toHex(),o=new Qe(t).toHex();return FS(a,o,e,i,r)?a:mY(a,o,e,i,n,r)}function mY(s,t,e,i,n,r){const a=[];n&&(n instanceof Array?a.push(...n):a.push(n)),a.push(..._Y);for(const o of a)if(s!==o&&FS(o,t,e,i,r))return o}function FS(s,t,e,i,n){if(n==="lightness"){const r=Qe.getColorBrightness(new Qe(t));return Qe.getColorBrightness(new Qe(s))<.5?r>=.5:r<.5}return i?T0(s,t)>i:e==="largeText"?T0(s,t)>3:T0(s,t)>4.5}function T0(s,t){const e=EM(s),i=EM(t);return((e>i?e:i)+.05)/((e>i?i:e)+.05)}function EM(s){const t=vE(s),e=t[0]/255,i=t[1]/255,n=t[2]/255;let r,a,o;return r=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),a=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),o=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4),.2126*r+.7152*a+.0722*o}function Qo(s,t,e,i){let n;switch(s){case"base":n=t;break;case"invertBase":n=e;break;case"similarBase":n=i}return n}function pI(s,t){return[s[0]*t,s[1]*t]}function vY(s){const[t,e]=s;return Math.sqrt(t*t+e*e)}function yY(s){const[t,e]=s;let i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i)),[s[0]*i,s[1]*i]}function bY(s,t){const[e,i]=s,[n,r]=t,a=Math.sqrt((e*e+i*i)*(n*n+r*r)),o=a&&(e*n+i*r)/a;return Math.acos(Math.min(Math.max(o,-1),1))}function xY(s,t){return s[0]*t[1]-t[0]*s[1]}function SY(s,t,e){const i=bY(s,t),n=xY(s,t)>=0;return e?n?2*Math.PI-i:i:n?i:2*Math.PI-i}const Ih=-.5*Math.PI,Lh=1.5*Math.PI,eu="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",AY=11;var Xe;(function(s){s.selected="selected",s.selectedReverse="selected_reverse",s.hover="hover",s.hoverReverse="hover_reverse"})(Xe||(Xe={}));const tl={[Xe.selectedReverse]:{},[Xe.selected]:{},[Xe.hover]:{},[Xe.hoverReverse]:{}},zr={container:"",width:30,height:30,style:{}},M0=(s,t,e)=>new yi(Object.assign({defaultFontParams:{fontFamily:eu,fontSize:AY},getTextBounds:Ec,specialCharSet:`-/: .,@%'"~`+yi.ALPHABET_CHAR_SET+yi.ALPHABET_CHAR_SET.toUpperCase()},{}),s);function Cm(s,t,e=eu){var i,n;if(!s)return{width:0,height:0};const r=Ec({text:s,fontFamily:(i=t.fontFamily)!==null&&i!==void 0?i:e,fontSize:t.fontSize||12,fontWeight:t.fontWeight,textAlign:(n=t.textAlign)!==null&&n!==void 0?n:"center",textBaseline:t.textBaseline,ellipsis:!!t.ellipsis,maxLineWidth:t.maxLineWidth||1/0,lineHeight:t.fontSize||12});return{width:r.width(),height:r.height()}}function Pm(){qe(),Vr(),Dn(),Za(),Ja()}var Hp=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};Pm();class Fn extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Fn.defaultAttributes,t)),this.name="tag"}render(){var t,e,i,n;const{text:r="",textStyle:a={},shape:o={},panel:l={},space:h=4,minWidth:d,maxWidth:u,padding:c=4,visible:p,state:g,type:f,textAlwaysCenter:_}=this.attribute,m=_s(c),v=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let y,b=m[1]+m[3],x=m[0]+m[2],S=0,A=0;const{visible:k}=o,w=Hp(o,["visible"]);if(ye(k)){const M=(w==null?void 0:w.size)||10,C=dt(M)?M:Math.max(M[0],M[1]);y=v.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:M,strokeBoundsBuffer:0},w),{visible:k,x:C/2,y:C/2}),"symbol"),vt(g==null?void 0:g.shape)||(y.states=g.shape),k&&(A=C+h)}let T;if(b+=A,S+=A,f==="rich"){const M=Object.assign(Object.assign({textConfig:r,visible:E(r)&&p!==!1},a),{x:S,y:0,width:(t=a.width)!==null&&t!==void 0?t:0,height:(e=a.height)!==null&&e!==void 0?e:0});T=v.createOrUpdateChild("tag-text",M,"richtext");const{visible:C}=l,R=Hp(l,["visible"]);if(p&&ye(C)){const I=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},R),{visible:C&&!!r,x:T.AABBBounds.x1,y:T.AABBBounds.y1,width:T.AABBBounds.width(),height:T.AABBBounds.height()}),"rect");vt(g==null?void 0:g.panel)||(I.states=g.panel)}}else if(f==="html"){const M=Object.assign(Object.assign({textConfig:[],visible:E(r)&&p!==!1,html:Object.assign(Object.assign({dom:r},zr),a)},a),{x:S,y:0});T=v.createOrUpdateChild("tag-text",M,"richtext");const{visible:C}=l,R=Hp(l,["visible"]);if(p&&ye(C)){const I=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},R),{visible:C&&!!r,x:T.AABBBounds.x1,y:T.AABBBounds.y1,width:T.AABBBounds.width(),height:T.AABBBounds.height()}),"rect");vt(g==null?void 0:g.panel)||(I.states=g.panel)}}else{const M=Object.assign(Object.assign({text:r,visible:E(r)&&p!==!1,lineHeight:a==null?void 0:a.fontSize},a),{x:S,y:0});P(M.lineHeight)&&(M.lineHeight=a.fontSize),T=v.createOrUpdateChild("tag-text",M,"text"),vt(g==null?void 0:g.text)||(T.states=g.text);const C=Cm(M.text,a,(i=this.stage)===null||i===void 0?void 0:i.getTheme().text.fontFamily),R=C.width,I=C.height;b+=R;const O=(n=o.size)!==null&&n!==void 0?n:10,L=dt(O)?O:Math.max(O[0],O[1]);x+=Math.max(I,o.visible?L:0);const{textAlign:D,textBaseline:j}=a;(E(d)||E(u))&&(E(d)&&b<d&&(b=d),E(u)&&b>u&&(b=u,T.setAttribute("maxLineWidth",u-m[1]-m[2])));let H=0,W=0;D==="center"?(H-=b/2,y&&y.setAttribute("x",(y.attribute.x||0)-R/2),v.setAttribute("x",-A/2)):D==="right"||D==="end"?(H-=b,y&&y.setAttribute("x",(y.attribute.x||0)-R),v.setAttribute("x",-m[1]-A)):D!=="left"&&D!=="start"||v.setAttribute("x",m[3]),!_||D!=="left"&&D!=="start"||T.setAttributes({x:S+b/2,textAlign:"center"}),j==="middle"?(W-=x/2,y&&y.setAttribute("y",0)):j==="bottom"?(W-=x,y&&y.setAttribute("y",-I/2),v.setAttribute("y",-m[2])):j==="top"&&(v.setAttribute("y",m[0]),y&&y.setAttribute("y",I/2));const{visible:V}=l,X=Hp(l,["visible"]);if(p&&ye(V)){const Q=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},X),{visible:V&&!!r,x:H,y:W,width:b,height:x}),"rect");vt(g==null?void 0:g.panel)||(Q.states=g.panel)}}}}Fn.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const gI={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},fI={poptip:lt({},gI)};function kY(){qe(),dI(),Dn(),Vr()}function wY(s){lt(fI.poptip,gI,s)}var TY=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};const RM=new Le;kY();class Nu extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Nu.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,i,n,r,a,o,l;const{titleStyle:h={},position:d,contentStyle:u={},panel:c={},space:p=4,minWidth:g=0,maxWidth:f=1/0,padding:_=4,maxWidthPercent:m,visible:v,state:y,dx:b=0,dy:x=0}=this.attribute;let{title:S="",content:A=""}=this.attribute;S=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(S):S,A=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(A):A;const k=_s(_),w=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),T=f-k[1]-k[3],M=E(S)&&v!==!1,C=Object.assign(Object.assign({text:$(S)?S:[S],visible:M},h),{x:k[3],y:k[0],maxLineWidth:T,textAlign:"left",textBaseline:"top"}),R=w.createOrUpdateChild("poptip-title",C,"wrapText");vt(y==null?void 0:y.title)||(R.states=y.title);const I=R.AABBBounds,O=I.height(),L=I.width();let D=O+p;M||(D=0);const j=E(A)&&v!==!1,H=Object.assign(Object.assign({text:$(A)?A:[A],visible:j},u),{x:k[3],y:k[0]+D,maxLineWidth:T,textAlign:"left",textBaseline:"top"}),W=w.createOrUpdateChild("poptip-content",H,"wrapText");vt(y==null?void 0:y.content)||(W.states=y.content);const V=W.AABBBounds,X=V.height(),Q=V.width();j&&(D+=X);let J=ps(L+k[1]+k[3],Q+k[1]+k[3]);J>f?J=f:J<g&&(J=g);let nt=k[0]+k[2]+D;const{visible:q}=c,U=TY(c,["visible"]),it=(t=U.size)!==null&&t!==void 0?t:12,ut=$(it)?[it[0]+((e=U.space)!==null&&e!==void 0?e:0),it[1]+((i=U.space)!==null&&i!==void 0?i:0)]:it+((n=U.space)!==null&&n!==void 0?n:0),ct=(r=U.lineWidth)!==null&&r!==void 0?r:1,Rt=this.stage?[(a=this.stage.viewWidth)!==null&&a!==void 0?a:this.stage.width,(o=this.stage.viewHeight)!==null&&o!==void 0?o:this.stage.height]:void 0;if(Rt){const Lt=this.AABBBounds,Ot=(l=this.attribute.x)!==null&&l!==void 0?l:Lt.x1,fi=Rt[0]-Lt.x1;let Pe=Math.max(Ot,fi);const Wi=($(it)?it[0]:12)+3;if(Pe=Math.min(Pe-Wi,Pe*m),Pe<J){J=Pe;const si=k[1]+k[3];R.setAttribute("maxLineWidth",Pe-si),W.setAttribute("maxLineWidth",Pe-si),nt=k[0]+k[2],M&&(nt+=R.AABBBounds.height()+p),nt+=W.AABBBounds.height()}}const mt=d==="auto";let Tt,kt=-1/0;for(let Lt=0;Lt<this.positionList.length+1;Lt++){const Ot=mt?this.positionList[Lt===this.positionList.length?Tt:Lt]:d,{angle:fi,offset:Pe,rectOffset:Wi}=this.getAngleAndOffset(Ot,J,nt,$(ut)?ut:[ut,ut-ct]);if(ye(q)){const si=($(it)?it[0]:it)/4,xs=w.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},U),{visible:q&&(j||M),x:si,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:fi,dx:Pe[0],dy:Pe[1],size:it,zIndex:-9}),"symbol");vt(y==null?void 0:y.panel)||(xs.states=y.panel);const pe=w.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},U),{visible:q&&(j||M),x:0,y:0,width:J,height:nt,zIndex:-8}),"rect");vt(y==null?void 0:y.panel)||(pe.states=y.panel)}if(w.setAttributes({x:-Pe[0]+b,y:-Pe[1]+x}),!mt||!Rt)break;{RM.setValue(0,0,J,nt).transformWithMatrix(w.globalTransMatrix);const si=RM,xs=new Pi().setValue(0,0,Rt[0],Rt[1]);if(Oj(si,xs))break;{const pe=xE(si,xs),Ae=(pe.x2-pe.x1)*(pe.y2-pe.y1);Ae>kt&&(kt=Ae,Tt=Lt)}}}}getAngleAndOffset(t,e,i,n){const r=n[1]/2;switch(t){case"tl":return{angle:le/2*3,offset:[e/4,i+r],rectOffset:[-e/4,-i-n[1]]};case"top":return{angle:le/2*3,offset:[e/2,i+r],rectOffset:[0,-i-n[1]]};case"tr":return{angle:le/2*3,offset:[e/4*3,i+r],rectOffset:[e/4*3,-i-n[1]]};case"rt":return{angle:0,offset:[-r,i/5],rectOffset:[e/4*3,-i-n[1]]};case"right":return{angle:0,offset:[-r,i/2],rectOffset:[e/4*3,-i-n[1]]};case"rb":return{angle:0,offset:[-r,i/5*4],rectOffset:[e/4*3,-i-n[1]]};case"bl":return{angle:le/2,offset:[e/4,-r],rectOffset:[-e/4,-i-n[1]]};case"bottom":return{angle:le/2,offset:[e/2,-r],rectOffset:[0,-i-n[1]]};case"br":return{angle:le/2,offset:[e/4*3,-r],rectOffset:[e/4*3,-i-n[1]]};case"lt":return{angle:le,offset:[e+r,i/5],rectOffset:[-e/4,-i-n[1]]};case"left":return{angle:le,offset:[e+r,i/2],rectOffset:[0,-i-n[1]]};case"lb":return{angle:le,offset:[e+r,i/5*4],rectOffset:[e/4*3,-i-n[1]]}}}}Nu.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};var MY=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};function CY(s,t){return lt(s,fI.poptip,t),s}let iu=class{render(s,t,e,i,n,r,a,o,l,h,d,u,c){var p;if(s._showPoptip===1){const{visible:g,visibleCb:f}=s.attribute.poptip||{};if(g===!1||f&&f(s)===!1)return;const _={};lt(_,Nu.defaultAttributes,s.attribute.poptip?s.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(_):this.poptipComponent=new Nu(_);let m=s.attribute.poptip||{};if(s.type==="text"&&m.title==null&&m.content==null){const b={};CY(b,m),m=b,m.content=(p=m.content)!==null&&p!==void 0?p:s.attribute.text}const v=s.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},m),{x:v.e,y:v.f})),h.stage.tryInitInteractiveLayer();const y=h.stage.getLayer("_builtin_interactive");y&&y.add(this.poptipComponent)}else s._showPoptip===2&&(s._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};iu=MY([ft()],iu);var _I=function(s,t,e,i){var n,r=arguments.length,a=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,t,e,i);else for(var o=s.length-1;o>=0;o--)(n=s[o])&&(a=(r<3?n(a):r>3?n(t,e,a):n(t,e))||a);return r>3&&a&&Object.defineProperty(t,e,a),a};let su=class{constructor(){this.name="poptip",this.activeEvent="onRegister",this._uid=ii.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=s=>{const t=s.target;if(t.isContainer||!t.attribute)return void this.unpoptip(s);if(t===this.activeGraphic)return;const{poptip:e}=t.attribute;e&&(t.setAttributes({}),t._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(t,!0)},this.unpoptip=s=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(s){this.pluginService=s;const{stage:t}=this.pluginService;t.addEventListener("pointerover",this.poptip)}setActiveGraphic(s,t){this.activeGraphic=s,this.pluginService.stage.renderNextFrame()}deactivate(s){const{stage:t}=this.pluginService;t.removeEventListener("pointerover",this.poptip)}};su=_I([ft()],su);let nu=class{constructor(){this.name="poptipForText",this.activeEvent="onRegister",this._uid=ii.GenAutoIncrementId(),this.key=this.name+this._uid,this.pointerlave=s=>{const{stage:t}=this.pluginService;s.target===t&&this.unpoptip(s)},this.poptip=s=>{const t=s.target;if(t.type!=="text"||!t.cliped||t.isContainer||!t.attribute||t.attribute.disableAutoClipedPoptip)return void this.unpoptip(s);if(t===this.activeGraphic)return;const{poptip:e={}}=t.attribute;e&&(t.setAttributes({}),t._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(t,!0)},this.unpoptip=s=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(s){this.pluginService=s;const{stage:t}=this.pluginService;t.addEventListener("pointerover",this.poptip),t.addEventListener("pointerleave",this.pointerlave)}setActiveGraphic(s,t){this.activeGraphic=s,this.pluginService.stage.renderNextFrame()}deactivate(s){const{stage:t}=this.pluginService;t.removeEventListener("pointerover",this.poptip),t.removeEventListener("pointerleave",this.pointerlave)}};nu=_I([ft()],nu);const PY=new Et((s,t,e,i)=>{e(iu)||(s(iu).toSelf().inSingletonScope(),s(cS).toService(iu)),e(su)||(s(su).toSelf(),s(Fu).toService(su)),e(nu)||(s(nu).toSelf(),s(Fu).toService(nu))});function EY(){Pt.load(PY)}class Lc extends gi{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}function RY(){qe(),qa()}function OY(){qe(),DS()}function IY(){qe(),Ic()}function LY(){qe(),Vr()}function BY(){qe(),DS()}RY();class Bc extends Lc{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Bc.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},n),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}Bc.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};LY();class Em extends Lc{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Em.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},n),"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}Em.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}};OY();class Rm extends Lc{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Rm.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),n),"arc")}setLocation(t){const{center:e}=this.attribute,i=ze.distancePP(t,e);this.setAttribute("radius",i)}}Rm.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};BY();class Om extends Lc{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Om.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:n=0,sectorStyle:r}=this.attribute,{startAngle:a,endAngle:o}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:n,startAngle:a,endAngle:o}),r),"arc")}setLocation(t){const{center:e,startAngle:i=Ih,endAngle:n=Lh}=this.attribute,r=n-i,a=xh(kg(e,t));this.setAttributes({startAngle:a-r/2,endAngle:a+r/2})}}Om.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}};IY();class Im extends Lc{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Im.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,sides:n=6,lineStyle:r}=this.attribute,{startAngle:a,endAngle:o}=this.attribute,l=(o-a)%(2*Math.PI)==0,h=(o-a)/n;let d;for(let u=0;u<=n;u++){const c=xn(e,i,a+h*u);u===0?d=`M${c.x},${c.y}`:d+=`L${c.x},${c.y}`,u===n&&l&&(d+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:d},r),"path")}setLocation(t){const{center:e}=this.attribute,i=ze.distancePP(t,e);this.setAttribute("radius",i)}}Im.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const aa=new Uint32Array(33),Sn=new Uint32Array(33);Sn[0]=0,aa[0]=~Sn[0];for(let s=1;s<=32;++s)Sn[s]=Sn[s-1]<<1|1,aa[s]=~Sn[s];function DY(s,t){const e=new Uint32Array(~~((s*t+32)/32));function i(r,a){e[r]|=a}function n(r,a){e[r]&=a}return{array:e,get:(r,a)=>{const o=a*s+r;return e[o>>>5]&1<<(31&o)},set:(r,a)=>{const o=a*s+r;i(o>>>5,1<<(31&o))},clear:(r,a)=>{const o=a*s+r;n(o>>>5,~(1<<(31&o)))},getRange:({x1:r,y1:a,x2:o,y2:l})=>{if(o<0||l<0||r>s||a>t)return!0;let h,d,u,c,p=l;for(;p>=a;--p)if(h=p*s+r,d=p*s+o,u=h>>>5,c=d>>>5,u===c){if(e[u]&aa[31&h]&Sn[1+(31&d)])return!0}else{if(e[u]&aa[31&h]||e[c]&Sn[1+(31&d)])return!0;for(let g=u+1;g<c;++g)if(e[g])return!0}return!1},setRange:({x1:r,y1:a,x2:o,y2:l})=>{if(o<0||l<0||r>s||a>t)return;let h,d,u,c,p;for(;a<=l;++a)if(h=a*s+r,d=a*s+o,u=h>>>5,c=d>>>5,u===c)i(u,aa[31&h]&Sn[1+(31&d)]);else for(i(u,aa[31&h]),i(c,Sn[1+(31&d)]),p=u+1;p<c;++p)i(p,4294967295)},clearRange:({x1:r,y1:a,x2:o,y2:l})=>{let h,d,u,c,p;for(;a<=l;++a)if(h=a*s+r,d=a*s+o,u=h>>>5,c=d>>>5,u===c)n(u,Sn[31&h]|aa[1+(31&d)]);else for(n(u,Sn[31&h]),n(c,aa[1+(31&d)]),p=u+1;p<c;++p)n(p,0)},outOfBounds:({x1:r,y1:a,x2:o,y2:l})=>r<0||a<0||l>=t||o>=s,toImageData:r=>{const a=r.createImageData(s,t),o=a.data;for(let l=0;l<t;++l)for(let h=0;h<s;++h){const d=l*s+h,u=4*d,c=e[d>>>5]&1<<(31&d);o[u+0]=255*c,o[u+1]=255*c,o[u+2]=255*c,o[u+3]=31}return a}}}function mI(s,t,e=0){const i=Math.max(1,Math.sqrt(s*t/1e6)),n=~~((s+2*e+i)/i),r=~~((t+2*e+i)/i),a=o=>~~((o+e)/i);return a.invert=o=>o*i-e,a.bitmap=()=>DY(n,r),a.ratio=i,a.padding=e,a.width=s,a.height=t,a}function Un(s,t,e=!1){if(e){const{x1:i,x2:n,y1:r,y2:a}=t,o=xi(i,0,s.width),l=xi(n,0,s.width),h=xi(r,0,s.height),d=xi(a,0,s.height);return{x1:s(o),x2:s(l),y1:s(h),y2:s(d)}}return{x1:s(t.x1),x2:s(t.x2),y1:s(t.y1),y2:s(t.y2)}}function mg(s,t,e,i=!0,n=0){let r=e;return n>0&&(r={x1:e.x1-n,x2:e.x2+n,y1:e.y1-n,y2:e.y2+n}),r=Un(s,r),!(i&&t.outOfBounds(r))&&!t.getRange(r)}function C0(s,t,e,i=[],n=!0,r=0){const a=i.filter(o=>E(o));for(let o=0;o<a.length;o++){const l=e.clone();if(l.setAttributes(a[o]),l.update(),mg(s,t,Un(s,l.AABBBounds),n,r))return t.setRange(Un(s,l.AABBBounds,!0)),a[o]}return!1}function FY(s,t,e,i,n,r,a){var o,l;const h=(o=i.overlap)===null||o===void 0?void 0:o.clampForce,d=(l=i.overlap)===null||l===void 0?void 0:l.overlapPadding;if(e.type==="bound"||e.type==="position"){if(K(a)){const u=((K(e.position)?e.position(n.attribute):e.position)||HY(i.type)).map(c=>a(n.AABBBounds,r,c,i.offset));return C0(s,t,n,u,h,d)}return!1}if(e.type==="moveY"){const u=(e.offset?K(e.offset)?e.offset(n.attribute):e.offset:[]).map(c=>({x:n.attribute.x,y:n.attribute.y+c}));return C0(s,t,n,u,h,d)}if(e.type==="moveX"){const u=(e.offset?K(e.offset)?e.offset(n.attribute):e.offset:[]).map(c=>({x:n.attribute.x+c,y:n.attribute.y}));return C0(s,t,n,u,h,d)}return!1}const jY=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],zY=["top","inside-top","inside"];function HY(s){return s==="rect"?zY:jY}function NY(s,t,e){const{x1:i,x2:n,y1:r,y2:a}=s.AABBBounds,o=Math.min(i,n),l=Math.max(i,n),h=Math.min(r,a),d=Math.max(r,a);let u=0,c=0;return o<0&&l-o<=t?u=-o:l>t&&o-(l-t)>=0&&(u=t-l),h<0&&d-h<=e?c=-h:d>e&&h-(d-e)>=0&&(c=e-d),{dx:u,dy:c}}const GY=(s={})=>{var t,e,i;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:(t=s.opacity)!==null&&t!==void 0?t:1,fillOpacity:(e=s.fillOpacity)!==null&&e!==void 0?e:1,strokeOpacity:(i=s.strokeOpacity)!==null&&i!==void 0?i:1}}},WY=(s={})=>{var t,e,i;return{from:{opacity:(t=s.opacity)!==null&&t!==void 0?t:1,fillOpacity:(e=s.fillOpacity)!==null&&e!==void 0?e:1,strokeOpacity:(i=s.strokeOpacity)!==null&&i!==void 0?i:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}},OM={fadeIn:GY,fadeOut:WY};function IM(s,t){var e,i;return(i=(e=OM[t])===null||e===void 0?void 0:e.call(OM,s))!==null&&i!==void 0?i:{from:{},to:{}}}function VY(s,t,e){if(!$(e)){const{duration:i,easing:n,increaseEffect:r=!0}=e;return s.animate().to(t.attribute,i,n),void(r&&LM(s,t,i,n))}e.forEach((i,n)=>{const{duration:r,easing:a,increaseEffect:o=!0,channel:l}=i,{from:h,to:d}=UY(s,t,l,i.options);vt(d)||s.animate().to(d,r,a),"text"in h&&"text"in d&&o&&LM(s,t,r,a)})}const UY=(s,t,e,i)=>{const n=Object.assign({},s.attribute),r=Object.assign({},t.attribute);return Y(i==null?void 0:i.excludeChannels).forEach(a=>{delete r[a]}),Object.keys(r).forEach(a=>{e&&!e.includes(a)&&delete r[a]}),{from:n,to:r}};function LM(s,t,e,i){s.attribute.text!==t.attribute.text&&N(Number(s.attribute.text)*Number(t.attribute.text))&&s.animate().play(new NH({text:s.attribute.text},{text:t.attribute.text},e,i))}const P0={mode:"same-time",duration:300,easing:"linear"};function $Y(s){return s.radius?{x:Math.cos(s.angle)*s.radius,y:Math.sin(s.angle)*s.radius}:{x:0,y:0}}function Np(s,t,e,i){const n=$Y({radius:e,angle:i});return{x:s+n.x,y:t+n.y}}function YY(s){return(s=XY(s))>0&&s<=Math.PI/2?2:s>Math.PI/2&&s<=Math.PI?3:s>Math.PI&&s<=3*Math.PI/2?4:1}function XY(s){for(;s<0;)s+=2*Math.PI;for(;s>=2*Math.PI;)s-=2*Math.PI;return s}function ro(s){return s===3||s===4}function KY(s){return s===1||s===2}function qY(s,t,e,i,n,r){if(s===0&&t===0||r<=0)return[];if(s===0){const c=-e/t,p=r**2-(c-n)**2;return p<0?[]:p===0?[{x:i,y:c}]:[{x:Math.sqrt(p)+i,y:c},{x:-Math.sqrt(p)+i,y:c}]}if(t===0){const c=-e/s,p=r**2-(c-i)**2;return p<0?[]:p===0?[{x:c,y:n}]:[{x:c,y:Math.sqrt(p)+n},{x:c,y:-Math.sqrt(p)+n}]}const a=(t/s)**2+1,o=2*((e/s+i)*(t/s)-n),l=o**2-4*a*((e/s+i)**2+n**2-r**2);if(l<0)return[];const h=(-o+Math.sqrt(l))/(2*a),d=(-o-Math.sqrt(l))/(2*a),u=-(t*h+e)/s;return l===0?[{x:u,y:h}]:[{x:u,y:h},{x:-(t*d+e)/s,y:d}]}function ZY(s,t){return t>2*s?NaN:2*Math.asin(t/2/s)}function JY(s,t){const{x1:e,y1:i,x2:n,y2:r}=s,{x1:a,y1:o,x2:l,y2:h}=t;return!(e<=a&&n<=a||e>=l&&n>=l||i<=o&&r<=o||i>=h&&r>=h)}const vI=(s,t,e="top",i=0)=>{if(!s)return;const{x1:n,y1:r,x2:a,y2:o}=s,l=Math.abs(a-n),h=Math.abs(o-r),d=(t.x1+t.x2)/2,u=(t.y1+t.y2)/2;let c=0,p=0,g=0,f=0;t&&(g=Math.abs(t.x1-t.x2)/2,f=Math.abs(t.y1-t.y2)/2);const _={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(e){case"top":p=-1;break;case"bottom":p=1;break;case"left":c=-1;break;case"right":c=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":c=Math.sin(_[e]*(Math.PI/180)),p=Math.cos(_[e]*(Math.PI/180));break;case"center":c=0,p=0}return{x:d+c*(i+g)+Math.sign(c)*(l/2),y:u+p*(i+f)+Math.sign(p)*(h/2)}},QY=s=>{if(!s||!s.attribute)return[];const{points:t,segments:e}=s.attribute;if(e&&e.length){const i=[];return e.forEach(n=>{n.points.forEach(r=>{i.push(r)})}),i}return t};function yI(s,t,e="end",i=0){if(!s||!t)return{x:1/0,y:1/0};const{x1:n,x2:r}=s,a=Math.abs(r-n),o=t.x1;let l=o;return e==="end"?l=o+a/2+i:e==="start"&&(l=o-a/2-i),{x:l,y:t.y1}}function t6(s,t){if(!s||!t||bu(s,t,!0))return;const e=Math.min(s.x1,s.x2),i=Math.min(s.y1,s.y2),n=Math.min(t.x1,t.x2),r=Math.min(t.y1,t.y2),a=Math.abs(s.x2-e)/2,o=Math.abs(s.y2-i)/2,l=Math.abs(t.x2-n)/2,h=Math.abs(t.y2-r)/2,d=e+a,u=i+o,c=n+l,p=r+h,g=c-d,f=p-u;return[BM(g,f,d,u,a,o),BM(-g,-f,c,p,l,h)]}function BM(s,t,e,i,n,r){return Math.abs(t/s)<r/n?{x:e+(s>0?n:-n),y:i+t*n/Math.abs(s)}:{x:e+s*r/Math.abs(t),y:i+(t>0?r:-r)}}function e6(){qe(),Ja(),Za(),qa()}e6();class hr extends gi{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},hr.defaultAttributes,t)),this.name="label",this._onHover=i=>{const n=i.target;n===this._lastHover||vt(n.states)||(n.addState(Xe.hover,!0),Cn(this,r=>{r===n||vt(r.states)||r.addState(Xe.hoverReverse,!0)}),this._lastHover=n)},this._onUnHover=i=>{this._lastHover&&(Cn(this,n=>{vt(n.states)||(n.removeState(Xe.hoverReverse),n.removeState(Xe.hover))}),this._lastHover=null)},this._onClick=i=>{const n=i.target;if(this._lastSelect===n&&n.hasState("selected"))return this._lastSelect=null,void Cn(this,r=>{vt(r.states)||(r.removeState(Xe.selectedReverse),r.removeState(Xe.selected))});vt(n.states)||(n.addState(Xe.selected,!0),Cn(this,r=>{r===n||vt(r.states)||r.addState(Xe.selectedReverse,!0)}),this._lastSelect=n)},this._handleRelatedGraphicSetState=i=>{var n,r,a,o,l;if(((n=i.detail)===null||n===void 0?void 0:n.type)===je.STATE||((r=i.detail)===null||r===void 0?void 0:r.type)===je.ANIMATE_UPDATE&&(!((a=i.detail.animationState)===null||a===void 0)&&a.isFirstFrameOfStep)){const h=(l=(o=i.target)===null||o===void 0?void 0:o.currentStates)!==null&&l!==void 0?l:[];(this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(i.target)]).forEach(d=>{d&&(d.text&&d.text.useStates(h),d.labelLine&&d.labelLine.useStates(h))})}}}labeling(t,e,i,n){}_createLabelLine(t,e){const i=t6(t.AABBBounds,e==null?void 0:e.AABBBounds);if(i){const n=_t.line({points:i});return e&&e.attribute.fill&&n.setAttribute("stroke",e.attribute.fill),this.attribute.line&&!vt(this.attribute.line.style)&&n.setAttributes(this.attribute.line.style),this._setStatesOfLabelLine(n),n}}render(){if(this._prepare(),P(this._idToGraphic)||this._isCollectionBase&&P(this._idToPoint))return;const{overlap:t,smartInvert:e,dataFilter:i,customLayoutFunc:n,customOverlapFunc:r}=this.attribute;let a,o=this.attribute.data;K(i)&&(o=i(o)),a=K(n)?n(o,this.getRelatedGraphic.bind(this),this._isCollectionBase?l=>this._idToPoint.get(l.id):null):this._layout(o),K(r)?a=r(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?l=>this._idToPoint.get(l.id):null):t!==!1&&(a=this._overlapping(a)),a&&a.length&&a.forEach(l=>{this._bindEvent(l),this._setStatesOfText(l)}),e!==!1&&this._smartInvert(a),this._renderLabels(a)}_bindEvent(t){if(this.attribute.disableTriggerEvent||!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;const e=this.attribute.state;e&&!vt(e)&&(t.states=e)}_setStatesOfLabelLine(t){if(!t)return;const e=this.attribute.labelLineState;e&&!vt(e)&&(t.states=e)}_createLabelText(t){var e,i;return t.textType==="rich"?(t.textConfig=t.text,t.width=(e=t.width)!==null&&e!==void 0?e:0,t.height=(i=t.height)!==null&&i!==void 0?i:0,_t.richtext(t)):t.textType==="html"?(t.textConfig=[],t.html=Object.assign(Object.assign({dom:t.text},zr),t),_t.richtext(t)):_t.text(t)}_prepare(){var t,e,i,n,r;const a=[];let o;if(o=K(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():gY(this.getRootNode(),this.attribute.baseMarkGroupName),o.forEach(h=>{h.releaseStatus!=="willRelease"&&a.push(h)}),(t=this._idToGraphic)===null||t===void 0||t.clear(),(e=this._idToPoint)===null||e===void 0||e.clear(),this._baseMarks=a,this._isCollectionBase=this.attribute.type==="line-data",!a||a.length===0)return;const{data:l}=this.attribute;if(l&&l.length!==0){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let h=0;for(let d=0;d<a.length;d++){const u=a[d],c=QY(u);if(c&&c.length)for(let p=0;p<c.length;p++){const g=l[h];g&&c[p]&&(E(g.id)||(g.id=`vrender-component-${this.name}-${h}`),this._idToPoint.set(g.id,c[p]),this._idToGraphic.set(g.id,u)),h++}}}else for(let h=0;h<a.length;h++){const d=l[h],u=a[h];d&&u&&(E(d.id)||(d.id=`vrender-component-${this.name}-${h}`),this._idToGraphic.set(d.id,u))}if(this.attribute.animation!==!1){const h=$t(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:lt({},P0,h,(i=this.attribute.animationEnter)!==null&&i!==void 0?i:{}),exit:lt({},P0,h,(n=this.attribute.animationExit)!==null&&n!==void 0?n:{}),update:$(this.attribute.animationUpdate)?this.attribute.animationUpdate:lt({},P0,h,(r=this.attribute.animationUpdate)!==null&&r!==void 0?r:{})}}}}getRelatedGraphic(t){return this._idToGraphic.get(t.id)}_layout(t=[]){const{textStyle:e={},position:i,offset:n}=this.attribute,r=[];for(let a=0;a<t.length;a++){const o=t[a],l=this.getRelatedGraphic(o);if(!l)continue;const h=Object.assign(Object.assign({fill:this._isCollectionBase?$(l.attribute.stroke)?l.attribute.stroke.find(f=>!!f&&f!==!0):l.attribute.stroke:l.attribute.fill},e),o),d=this._createLabelText(h),u=this.getGraphicBounds(d),c=K(i)?i(o):i,p=this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(o.id),c):this.getGraphicBounds(l,{x:o.x,y:o.y},c),g=this.labeling(u,p,c,n);g&&(h.x=g.x,h.y=g.y,d.setAttributes(g)),r.push(d)}return r}_overlapping(t){var e,i,n,r;if(t.length===0)return[];const a=$t(this.attribute.overlap)?this.attribute.overlap:{},o=[],l=this.getBaseMarkGroup(),h=(e=a.size)!==null&&e!==void 0?e:{width:(i=l==null?void 0:l.AABBBounds.width())!==null&&i!==void 0?i:0,height:(n=l==null?void 0:l.AABBBounds.height())!==null&&n!==void 0?n:0};if(h.width===0||h.height===0)return t;const{avoidBaseMark:d,strategy:u=[],hideOnHit:c=!0,clampForce:p=!0,avoidMarks:g=[],overlapPadding:f}=a,_=this._bmpTool||mI(h.width,h.height),m=this._bitmap||_.bitmap(),v=u.some(y=>y.type==="bound");d&&((r=this._baseMarks)===null||r===void 0||r.forEach(y=>{y.AABBBounds&&m.setRange(Un(_,y.AABBBounds,!0))})),g.length>0&&g.forEach(y=>{ht(y)?fY(this.getRootNode(),y).forEach(b=>{b.AABBBounds&&m.setRange(Un(_,b.AABBBounds,!0))}):y.AABBBounds&&m.setRange(Un(_,y.AABBBounds,!0))});for(let y=0;y<t.length;y++){if(t[y].visible===!1)continue;const b=t[y],x=this.getRelatedGraphic(b.attribute);if(b.update(),!bu(x.AABBBounds,{x1:0,x2:_.width,y1:0,y2:_.height},!0))continue;if(mg(_,m,b.AABBBounds,p,f)){if(!v){m.setRange(Un(_,b.AABBBounds,!0)),o.push(b);continue}if(v&&x&&x.AABBBounds&&this._canPlaceInside(b.AABBBounds,x.AABBBounds)){m.setRange(Un(_,b.AABBBounds,!0)),o.push(b);continue}}let S=!1;for(let A=0;A<u.length;A++)if(S=FY(_,m,u[A],this.attribute,b,this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(t[y].attribute.id)):this.getGraphicBounds(x,t[y].attribute),this.labeling),S!==!1){b.setAttributes({x:S.x,y:S.y}),o.push(b);break}if(!S&&p){const{dx:A=0,dy:k=0}=NY(b,_.width,_.height);if(A===0&&k===0){if(mg(_,m,b.AABBBounds)){m.setRange(Un(_,b.AABBBounds,!0)),o.push(b);continue}}else if(mg(_,m,{x1:b.AABBBounds.x1+A,x2:b.AABBBounds.x2+A,y1:b.AABBBounds.y1+k,y2:b.AABBBounds.y2+k})){b.setAttributes({x:b.attribute.x+A,y:b.attribute.y+k}),m.setRange(Un(_,b.AABBBounds,!0)),o.push(b);continue}}!S&&!c&&o.push(b)}return K(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(m),o}getBaseMarkGroup(){const{baseMarkGroupName:t}=this.attribute;if(t)return this.getRootNode().find(e=>e.name===t,!0)}getGraphicBounds(t,e={}){if(t){if(t.attribute.visible!==!1)return t.AABBBounds;const{x:r,y:a}=t.attribute;return{x1:r,x2:r,y1:a,y2:a}}const{x:i,y:n}=e;return{x1:i,x2:i,y1:n,y2:n}}_renderLabels(t){this._enableAnimation===!1||this.attribute.animation===!1?this._renderWithOutAnimation(t):this._renderWithAnimation(t)}_renderWithAnimation(t){var e;const i=new Map,n=this._graphicToText||new Map,r=[],a=[],{visible:o}=(e=this.attribute.line)!==null&&e!==void 0?e:{};t.forEach((l,h)=>{const d=this.getRelatedGraphic(l.attribute),u=l.attribute.id,c=this._isCollectionBase?u:d,p=n!=null&&n.get(c)?"update":"enter";let g;if(o&&(g=this._createLabelLine(l,d)),p==="enter"){if(r.push(l),i.set(c,g?{text:l,labelLine:g}:{text:l}),d){const{from:f,to:_}=IM(l.attribute,"fadeIn");this.add(l),g&&(a.push(g),this.add(g)),this._syncStateWithRelatedGraphic(d),this._animationConfig.enter.duration>0&&d.once("animate-bind",m=>{l.setAttributes(f),g&&g.setAttributes(f);const v=this._afterRelatedGraphicAttributeUpdate(l,r,g,a,h,d,_,this._animationConfig.enter);d.on("afterAttributeUpdate",v)})}}else if(p==="update"){const f=n.get(c);n.delete(c),i.set(c,f);const _=f.text,{duration:m,easing:v}=this._animationConfig.update;VY(_,l,this._animationConfig.update),f.labelLine&&g&&f.labelLine.animate().to(g.attribute,m,v)}}),n.forEach(l=>{var h;(h=l.text)===null||h===void 0||h.animate().to(IM(l.text.attribute,"fadeOut").to,this._animationConfig.exit.duration,this._animationConfig.exit.easing).onEnd(()=>{this.removeChild(l.text),l.labelLine&&this.removeChild(l.labelLine)})}),this._graphicToText=i}_renderWithOutAnimation(t){var e;const i=new Map,n=this._graphicToText||new Map,{visible:r}=(e=this.attribute.line)!==null&&e!==void 0?e:{};t.forEach(a=>{const o=this.getRelatedGraphic(a.attribute),l=n!=null&&n.get(o)?"update":"enter",h=this._isCollectionBase?a.attribute.id:o;let d;if(r&&(d=this._createLabelLine(a,o)),l==="enter")i.set(h,d?{text:a,labelLine:d}:{text:a}),this.add(a),d&&this.add(d),this._syncStateWithRelatedGraphic(o);else if(l==="update"){const u=n.get(h);n.delete(h),i.set(h,u),u.text.setAttributes(a.attribute),u.labelLine&&d&&u.labelLine.setAttributes(d.attribute)}}),n.forEach(a=>{this.removeChild(a.text),a.labelLine&&this.removeChild(a.labelLine)}),this._graphicToText=i}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,n,r,a,o,{mode:l,duration:h,easing:d,delay:u}){const c=p=>{var g,f,_;const{detail:m}=p;if(!m)return{};const v=(g=m.animationState)===null||g===void 0?void 0:g.step;if(!(m.type===je.ANIMATE_UPDATE&&v&&!(v.type==="wait"&&((f=v.prev)===null||f===void 0?void 0:f.type)==null)))return{};if(m.type===je.ANIMATE_END)return t.setAttributes(o),void(i&&i.setAttributes(o));const y=()=>{a&&(a.onAnimateBind=void 0,a.removeEventListener("afterAttributeUpdate",c))};switch(l){case"after":m.animationState.end&&(t.animate({onStart:y}).wait(u).to(o,h,d),i&&i.animate().wait(u).to(o,h,d));break;case"after-all":r===e.length-1&&m.animationState.end&&(e.forEach(b=>{b.animate({onStart:y}).wait(u).to(o,h,d)}),n.forEach(b=>{b.animate().wait(u).to(o,h,d)}));break;default:if(this._isCollectionBase){const b=this._idToPoint.get(t.attribute.id);!b||t.animates&&t.animates.has("label-animate")||!a.containsPoint(b.x,b.y,ku.LOCAL,(_=this.stage)===null||_===void 0?void 0:_.pickerService)||(t.animate({onStart:y}).wait(u).to(o,h,d),i&&i.animate().wait(u).to(o,h,d))}else m.animationState.isFirstFrameOfStep&&(t.animate({onStart:y}).wait(u).to(o,h,d),i&&i.animate().wait(u).to(o,h,d))}};return c}_smartInvert(t){var e,i,n,r,a;const o=$t(this.attribute.smartInvert)?this.attribute.smartInvert:{},{textType:l,contrastRatiosThreshold:h,alternativeColors:d,mode:u}=o,c=(e=o.fillStrategy)!==null&&e!==void 0?e:"invertBase",p=(i=o.strokeStrategy)!==null&&i!==void 0?i:"base",g=(n=o.brightColor)!==null&&n!==void 0?n:"#ffffff",f=(r=o.darkColor)!==null&&r!==void 0?r:"#000000",_=(a=o.outsideEnable)!==null&&a!==void 0&&a;if(c!=="null"||p!=="null")for(let m=0;m<t.length;m++){const v=t[m];if(!v)continue;const y=this.getRelatedGraphic(v.attribute),b=y.attribute.fill,x=v.attribute.fill,S=b,A=PM(x,b,l,h,d,u),k=FS(A,g)?g:f;if(_){const w=Qo(c,S,A,k);if(w&&v.setAttributes({fill:w}),v.attribute.lineWidth===0)continue;const T=Qo(p,S,A,k);T&&v.setAttributes({stroke:T})}else if(this._canPlaceInside(v.AABBBounds,y.AABBBounds)){const w=Qo(c,S,A,k);if(w&&v.setAttributes({fill:w}),v.attribute.lineWidth===0)continue;const T=Qo(p,S,A,k);T&&v.setAttributes({stroke:T})}else{if(v.attribute.lineWidth===0)continue;if(v.attribute.stroke){v.setAttributes({fill:PM(v.attribute.fill,v.attribute.stroke,l,h,d,u)});continue}const w=Qo(c,S,A,k);w&&v.setAttributes({fill:w});const T=Qo(p,S,A,k);T&&v.setAttributes({stroke:T})}}}_canPlaceInside(t,e){return!(!t||!e)&&e.encloses(t)}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}hr.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},offset:0,pickable:!1};class Lm extends hr{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Lm.defaultAttributes,t)),this.name="symbol-label"}labeling(t,e,i="top",n=0){return vI(t,e,i,n)}}Lm.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class Gu extends hr{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Gu.defaultAttributes,t))}labeling(t,e,i="top",n=0){if(!t||!e)return;const{x1:r,y1:a,x2:o,y2:l}=t,h=Math.abs(o-r),d=Math.abs(l-a),u=Math.abs(e.x2-e.x1),c=Math.abs(e.y2-e.y1);let p=(e.x1+e.x2)/2,g=(e.y1+e.y2)/2,f=0,_=0;switch(i){case"top":case"inside-top":_=-.5;break;case"bottom":case"inside-bottom":_=.5;break;case"left":case"inside-left":f=-.5;break;case"right":case"inside-right":f=.5;break;case"top-right":f=.5,_=-.5;break;case"top-left":f=-.5,_=-.5;break;case"bottom-right":f=.5,_=.5;break;case"bottom-left":f=-.5,_=.5}p+=f*u,g+=_*c;let m=0,v=0;const y=i.includes("inside");switch(i.includes("top")?v=y?1:-1:i.includes("bottom")?v=y?-1:1:i.includes("left")?m=y?1:-1:i.includes("right")&&(m=y?-1:1),i){case"top-right":case"bottom-right":m=-1;break;case"top-left":case"bottom-left":m=1}return{x:p+m*n+m*h/2,y:g+v*n+v*d/2}}}Gu.tag="rect-label",Gu.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};let bI=class xI extends hr{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},xI.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){if(!t||t.type!=="line")return super.getGraphicBounds(t,e);const n=t.attribute.points||[e],r=i==="start"?0:n.length-1;return n[r]?{x1:n[r].x,x2:n[r].x,y1:n[r].y,y2:n[r].y}:void 0}labeling(t,e,i="end",n=0){return yI(t,e,i,n)}};bI.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class i6{constructor(t,e,i,n,r,a,o,l,h){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=n,this.radian=r,this.middleAngle=a,this.innerRadius=o,this.outerRadius=l,this.circleCenter=h,this.labelVisible=!0,this.labelLimit=0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class Bm extends hr{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Bm.defaultAttributes,t)),this.name="arc-label",this._ellipsisWidth=0,this._arcLeft=new Map,this._arcRight=new Map}_overlapping(t){return t}labeling(t,e,i="outside",n=0){if(t&&e)return{x:0,y:0}}_layout(t=[]){const e=super._layout(t),i=e.map(h=>this.getGraphicBounds(h)),n=Object.assign(Object.assign({},this.attribute.textStyle),{text:"…"}),r=this._createLabelText(n),a=this.getGraphicBounds(r),o=a.x2-a.x1,l=this.layoutArcLabels(this.attribute.position,this.attribute,Array.from(this._idToGraphic.values()),t,i,o);for(let h=0;h<t.length;h++){const d=t[h],u=l.find(c=>{var p;return((p=c.refDatum)===null||p===void 0?void 0:p.id)===d.id});if(u){const c={visible:u.labelVisible,x:u.labelPosition.x,y:u.labelPosition.y,angle:u.angle,maxLineWidth:u.labelLimit,points:u.pointA&&u.pointB&&u.pointC?[u.pointA,u.pointB,u.pointC]:void 0,line:u.labelLine};e[h].setAttributes(c)}}return e}layoutArcLabels(t,e,i,n,r,a){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=a;let o=0;i.forEach(u=>{u.attribute.outerRadius>o&&(o=u.attribute.outerRadius)}),n.forEach((u,c)=>{var p,g;const f=this._idToGraphic.get(u.id).attribute,_={x:(p=f==null?void 0:f.x)!==null&&p!==void 0?p:0,y:(g=f==null?void 0:f.y)!==null&&g!==void 0?g:0};if(!P(n[c])&&!P(r[c])){const m=n[c]?n[c]:null,v=r[c]?r[c]:{x1:0,x2:0,y1:0,y2:0},y=(f.startAngle+f.endAngle)/2,b=f.endAngle-f.startAngle,x=YY(f.endAngle-b/2),S=Np(_.x,_.y,f.outerRadius,y),A=Np(_.x,_.y,o+e.line.line1MinLength,y),k=new i6(m,S,A,x,b,y,f.innerRadius,f.outerRadius,_);k.pointA=Np(_.x,_.y,this.computeDatumRadius(2*_.x,2*_.y,f.outerRadius),k.middleAngle),k.labelSize={width:v.x2-v.x1,height:v.y2-v.y1},KY(k.quadrant)?this._arcRight.set(k.refDatum,k):ro(k.quadrant)&&this._arcLeft.set(k.refDatum,k)}});const l=Array.from(this._arcLeft.values()),h=Array.from(this._arcRight.values()),d=[];switch(t){case"inside":case"inside-inner":case"inside-outer":d.push(...this._layoutInsideLabels(h,e,i)),d.push(...this._layoutInsideLabels(l,e,i));break;default:d.push(...this._layoutOutsideLabels(h,e,i)),d.push(...this._layoutOutsideLabels(l,e,i))}return d}_layoutInsideLabels(t,e,i){var n,r;const a=e,o=a.spaceWidth,l=(n=a.position)!==null&&n!==void 0?n:"inside",h=(r=a.offsetRadius)!==null&&r!==void 0?r:-o;return t.forEach(d=>{var u,c,p;const{labelSize:g,radian:f}=d,_=d.innerRadius,m=d.outerRadius;let v;if(f<ZY(m,g.height))v=0;else{let w;w=f>=Math.PI?_:Math.max(_,g.height/2/Math.tan(f/2)),v=m-w-o}a.rotate!==!0&&(v=m-o);const y=this._getFormatLabelText(d.refDatum,v);d.labelText=y;const b=Math.min(v,d.labelSize.width),x=this._computeAlign(d,e);let S,A=0;l==="inside"&&(A=x==="left"?b:x==="right"?0:b/2),S=l==="inside-inner"?_-h+A:m+h-A,d.labelPosition=Np(d.circleCenter.x,d.circleCenter.y,S,d.middleAngle),d.labelLimit=b,Vn(b,0)||(d.labelVisible=!1),d.angle=(c=(u=e.textStyle)===null||u===void 0?void 0:u.angle)!==null&&c!==void 0?c:d.middleAngle;let k=(p=a.offsetAngle)!==null&&p!==void 0?p:0;["inside-inner","inside-outer"].includes(l)&&(k+=Math.PI/2),d.angle+=k}),t}_layoutOutsideLabels(t,e,i){var n,r,a;const o=(n=i[0].attribute.x)!==null&&n!==void 0?n:0,l=2*((r=i[0].attribute.y)!==null&&r!==void 0?r:0),h=e.line.line2MinLength,d=e.layout,u=e.spaceWidth;if(t.forEach(p=>{const g=ro(p.quadrant)?-1:1;p.labelPosition={x:p.outerCenter.x+g*(p.labelSize.width/2+h+u),y:p.outerCenter.y}}),t.sort((p,g)=>p.labelPosition.y-g.labelPosition.y),e.coverEnable!==!1||d.strategy==="none"){for(const p of t){const{labelPosition:g,labelSize:f}=p;p.labelLimit=f.width,p.pointB=ro(p.quadrant)?{x:g.x+f.width/2+h+u,y:g.y}:{x:g.x-f.width/2-h-u,y:g.y},this._computeX(p,e,i)}e.coverEnable===!1&&d.strategy==="none"&&this._coverLabels(t)}else{const p=l/(((a=e.textStyle)===null||a===void 0?void 0:a.fontSize)||16);this._adjustY(t,p,e,i);const{minY:g,maxY:f}=t.reduce((v,y)=>{const{y1:b,y2:x}=y.getLabelBounds();return v.minY=Math.max(0,Math.min(b,v.minY)),v.maxY=Math.min(l,Math.max(x,v.maxY)),v},{minY:1/0,maxY:-1/0}),_=Math.max(Math.abs(l/2-g),Math.abs(f-l/2)),m=this._computeLayoutRadius(_,e,i);for(const v of t)this._computePointB(v,m,e,i),this._computeX(v,e,i)}const c=2*o;return t.forEach(p=>{var g,f;p.labelVisible&&(bn(p.pointB.x,h+u)||Vn(p.pointB.x,c-h-u))&&(p.labelVisible=!1),p.angle=(f=(g=e.textStyle)===null||g===void 0?void 0:g.angle)!==null&&f!==void 0?f:0,e.offsetAngle&&(p.angle+=e.offsetAngle),p.labelLine=Object.assign({},e.line)}),t}_computeX(t,e,i){var n;const r=t.circleCenter,a=2*r.x;r.y;let o=0;i.forEach(A=>{A.attribute.outerRadius>o&&(o=A.attribute.outerRadius)});const l=this.computeLayoutOuterRadius(o,e.width,e.height),h=e.line.line1MinLength,d=e.line.line2MinLength,u=(n=e.layout)===null||n===void 0?void 0:n.align,c=e.spaceWidth,{labelPosition:p,quadrant:g,pointB:f}=t;N(f.x*f.y)||(t.pointC={x:NaN,y:NaN},p.x=NaN,t.labelLimit=0);const _=this.computeRadius(l,e.width,e.height),m=ro(g)?-1:1;let v=0,y=(m>0?a-f.x:f.x)-d-c;u==="labelLine"&&(v=(_+h+d)*m+r.x,y=(m>0?a-v:v)-c);const b=this._getFormatLabelText(t.refDatum,y);t.labelText=b;let x=Math.min(y,t.labelSize.width);switch(u){case"labelLine":break;case"edge":v=m>0?a-x-c:x+c;break;default:v=f.x+m*d}x=Math.max(this._ellipsisWidth,x),t.labelLimit=x,t.pointC={x:v,y:p.y};const S=.5*(t.labelLimit<t.labelSize.width?t.labelLimit:t.labelSize.width);u==="edge"?p.x=(m>0?a+0:0)-m*S:p.x=v+0+m*(c+S)}_computeAlign(t,e){var i,n,r,a,o,l;const h=e,d=(n=(i=h.textStyle)===null||i===void 0?void 0:i.textAlign)!==null&&n!==void 0?n:(r=h.textStyle)===null||r===void 0?void 0:r.align,u=(o=(a=h.layout)===null||a===void 0?void 0:a.textAlign)!==null&&o!==void 0?o:(l=h.layout)===null||l===void 0?void 0:l.align;return h.position!=="inside"?P(d)||d==="auto"?u==="edge"?ro(t.quadrant)?"left":"right":ro(t.quadrant)?"right":"left":d:P(d)||d==="auto"?"center":d}_getFormatLabelText(t,e){var i;return(i=t==null?void 0:t.text)!==null&&i!==void 0?i:""}_adjustY(t,e,i,n){var r;n[0].attribute.x;const a=2*((r=n[0].attribute.y)!==null&&r!==void 0?r:0),o=i.layout;if(o.strategy==="vertical"){let l,h=0;const d=t.length;if(d<=0)return;for(let c=0;c<d;c++){const{y1:p}=t[c].getLabelBounds();if(l=p-h,bn(l,0)){const f=this._shiftY(t,c,d-1,-l);this._shiftY(t,f,0,l/2)}const{y2:g}=t[c].getLabelBounds();h=g}const{y1:u}=t[0].getLabelBounds();l=u-0,bn(l,0)&&this._shiftY(t,0,d-1,-l);for(let c=t.length-1;c>=0&&t[c].getLabelBounds().y2>a;c--)t[c].labelVisible=!1}else if(o.strategy!=="none"){const l=t.map((u,c)=>({arc:u,originIndex:c,priorityIndex:0}));l.sort((u,c)=>c.arc.radian-u.arc.radian),l.forEach((u,c)=>{u.priorityIndex=c,u.arc.labelVisible=!1});let h=1/0,d=-1/0;for(let u=0;u<e&&u<t.length;u++){this._storeY(t);const c=l[u].arc;this._computeYRange(c,i,n),c.labelVisible=!0;const p=c.labelPosition.y,{lastIndex:g,nextIndex:f}=this._findNeighborIndex(t,l[u]),_=t[g],m=t[f];if(g===-1&&f!==-1){const x=m.labelPosition.y;p>x?c.labelPosition.y=x-m.labelSize.height/2-c.labelSize.height/2:this._twoWayShift(t,c,m,f)}else if(g!==-1&&f===-1){const x=_.labelPosition.y;p<x?c.labelPosition.y=x+_.labelSize.height/2+c.labelSize.height/2:this._twoWayShift(t,_,c,l[u].originIndex)}else if(g!==-1&&f!==-1){const x=_.labelPosition.y,S=m.labelPosition.y;p>S?(c.labelPosition.y=S-m.labelSize.height/2-c.labelSize.height/2,this._twoWayShift(t,_,c,l[u].originIndex)):p<x?(c.labelPosition.y=x+_.labelSize.height/2+c.labelSize.height/2,this._twoWayShift(t,c,m,f)):(this._twoWayShift(t,_,c,l[u].originIndex),this._twoWayShift(t,c,m,f))}const v=Math.min(h,l[u].originIndex),y=Math.max(d,l[u].originIndex);let b;if(b=t[y].getLabelBounds().y2-a,Vn(b,0)&&this._shiftY(t,y,0,-b),b=t[v].getLabelBounds().y1-0,bn(b,0)&&this._shiftY(t,v,t.length-1,-b),b=t[y].getLabelBounds().y2-a,Vn(b,0)){c.labelVisible=!1,this._restoreY(t);break}o.tangentConstraint&&!this._checkYRange(t)?(c.labelVisible=!1,this._restoreY(t)):(h=v,d=y)}}}_shiftY(t,e,i,n){const r=e<i?1:-1;let a=e;for(;a!==-1;){t[a].labelPosition.y+=n;const o=this._findNextVisibleIndex(t,a,i,r);if(o>=0&&o<t.length){const{y1:l,y2:h}=t[a].getLabelBounds(),{y1:d,y2:u}=t[o].getLabelBounds();if(r>0&&h<d||r<0&&l>u)return a}a=o}return i}_findNextVisibleIndex(t,e,i,n){const r=(i-e)*n;for(let a=1;a<=r;a++){const o=e+a*n;if(t[o].labelVisible)return o}return-1}_computePointB(t,e,i,n){const r=i;let a=0;n.forEach(h=>{h.attribute.outerRadius>a&&(a=h.attribute.outerRadius)});const o=this.computeLayoutOuterRadius(a,i.width,i.height),l=r.line.line1MinLength;if(r.layout.strategy==="none")t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const h=t.circleCenter,d=this.computeRadius(o,i.width,i.height),{labelPosition:u,quadrant:c}=t,p=e-Math.max(d+l,t.outerRadius),g=Math.sqrt(e**2-Math.abs(h.y-u.y)**2)-p;N(g)?t.pointB={x:h.x+g*(ro(c)?-1:1),y:u.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,i){const n=t.circleCenter,r={width:2*n.x,height:2*n.y};let a=0;i.forEach(x=>{x.attribute.outerRadius>a&&(a=x.attribute.outerRadius)});const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=e.line.line1MinLength,{width:h,height:d}=r,u=this.computeRadius(o,e.width,e.height),c=this._computeLayoutRadius(d/2,e,i),p=Math.abs(t.center.x-h/2),g=t.center.y-d/2;let f,_,m;if(gs(h/2,p))f=0,_=1,m=-g;else if(gs(d/2,g))f=1,_=0,m=-p;else{const x=-1/(g/p);f=x,_=-1,m=g-x*p}const v=qY(f,_,m,l+u-c,0,c);if(v.length<2)return;let y,b;v[0].x>v[1].x&&v.reverse(),v[0].x<0?gs(v[0].y,v[1].y)?Vn(t.middleAngle,-Math.PI)&&bn(t.middleAngle,0)||Vn(t.middleAngle,Math.PI)&&bn(t.middleAngle,2*Math.PI)?(y=0,b=v[1].y+d/2):(y=v[1].y+d/2,b=d):v[0].y<v[1].y?(y=0,b=v[1].y+d/2):(y=v[1].y+d/2,b=r.height):(y=Math.min(v[0].y,v[1].y)+d/2,b=Math.max(v[0].y,v[1].y)+d/2),t.labelYRange=[y,b]}_computeLayoutRadius(t,e,i){const n=e,r=n.layoutArcGap,a=n.line.line1MinLength;let o=0;i.forEach(u=>{u.attribute.outerRadius>o&&(o=u.attribute.outerRadius)});const l=this.computeLayoutOuterRadius(o,e.width,e.height),h=this.computeRadius(l,e.width,e.height)+a,d=h-r;return Math.max((d**2+t**2)/(2*d),h)}_findNeighborIndex(t,e){const i=e.originIndex;let n=-1,r=-1;for(let a=i-1;a>=0;a--)if(t[a].labelVisible){n=a;break}for(let a=i+1;a<t.length;a++)if(t[a].labelVisible){r=a;break}return{lastIndex:n,nextIndex:r}}_twoWayShift(t,e,i,n){const r=i.getLabelBounds().y1-e.getLabelBounds().y2;if(bn(r,0)){const a=this._shiftY(t,n,t.length-1,-r);this._shiftY(t,a,0,r/2)}}_restoreY(t){for(const e of t)e.labelVisible&&(e.labelPosition.y=e.lastLabelY)}_checkYRange(t){for(const e of t){const{labelYRange:i,labelPosition:n}=e;if(e.labelVisible&&i&&(bn(n.y,i[0])||Vn(n.y,i[1])))return!1}return!0}_coverLabels(t){if(t.length<=1)return;let e=t[0].getLabelBounds();for(let i=1;i<t.length;i++){const n=t[i].getLabelBounds();JY(e,n)?t[i].labelVisible=!1:e=n}}_createLabelLine(t,e){var i,n,r,a,o,l,h;const{points:d,line:u={},visible:c,fill:p}=t.attribute,g=t.attribute.points?_t.line({visible:(r=(i=u.visible&&c)!==null&&i!==void 0?i:(n=t.attribute)===null||n===void 0?void 0:n.visible)===null||r===void 0||r,stroke:(o=(a=u.style)===null||a===void 0?void 0:a.stroke)!==null&&o!==void 0?o:p,lineWidth:(h=(l=u.style)===null||l===void 0?void 0:l.lineWidth)!==null&&h!==void 0?h:1,points:d,curveType:u.smooth?"basis":null}):void 0;return g&&this._setStatesOfLabelLine(g),g}computeRadius(t,e,i,n){return this.computeLayoutRadius(e||0,i||0)*t*(P(n)?1:n)}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}_canPlaceInside(t,e){return this.attribute.position==="inside"}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i){const n=this.computeLayoutOuterRadius(i,t,e);return this.computeLayoutRadius(t||0,e||0)*n}}Bm.defaultAttributes={coverEnable:!1,spaceWidth:5,layoutArcGap:6,textStyle:{visible:!0,fontSize:14,fontWeight:"normal",fillOpacity:1,textAlign:"center",textBaseline:"middle"},position:"outside",offset:0,line:{visible:!0,line1MinLength:20,line2MinLength:10},layout:{align:"arc",strategy:"priority",tangentConstraint:!0},pickable:!1};class Dm extends hr{constructor(t){super(lt({},Dm.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){var n;if(t.type!=="area")return super.getGraphicBounds(t,e);const r=((n=t==null?void 0:t.attribute)===null||n===void 0?void 0:n.points)||[e],a=i==="start"?0:r.length-1;return{x1:r[a].x,x2:r[a].x,y1:r[a].y,y2:r[a].y}}labeling(t,e,i="end",n=0){return yI(t,e,i,n)}}Dm.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class Fm extends hr{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Fm.defaultAttributes,t)),this.name="line-data-label"}labeling(t,e,i="top",n=0){return vI(t,e,i,n)}}Fm.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};const s6={rect:Gu,symbol:Lm,arc:Bm,line:bI,area:Dm,"line-data":Fm};class jm extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},jm.defaultAttributes,t)),this.name="data-label"}render(){var t;const{dataLabels:e,size:i}=this.attribute;if(!e||e.length===0)return;const{width:n=0,height:r=0}=i||{};if(!n||!r||!N(r*n))return;this._componentMap||(this._componentMap=new Map);const a=mI(n,r),o=a.bitmap(),l=new Map,h=this._componentMap;for(let d=0;d<e.length;d++){const u=e[d],c=s6[u.type]||hr;if(c){const{baseMarkGroupName:p,type:g}=u,f=(t=u.id)!==null&&t!==void 0?t:`${p}-${g}-${d}`;let _=this._componentMap.get(f);_?(_.setBitmapTool(a),_.setBitmap(o),_.setAttributes(u),l.set(f,_)):(_=new c(u),_.setBitmap(o),_.setBitmapTool(a),this.add(_),l.set(f,_))}}h.forEach((d,u)=>{l.get(u)||this.removeChild(d)}),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach(t=>{t.disableAnimation()})}enableAnimation(){this._componentMap.forEach(t=>{t.enableAnimation()})}}jm.defaultAttributes={pickable:!1};function jS(){qe(),qa(),Mm(),Dn()}jS();class Jh extends gi{getStartAngle(){return this._startAngle}getEndAngle(){return this._endAngle}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Jh.defaultAttributes,t)),this.name="segment"}render(){this.removeAllChild(),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:r=!0,multiSegment:a,mainSegmentIndex:o}=this.attribute;if(!r)return;this._computeLineAngle();const l=this._renderSymbol(t,"start"),h=this._renderSymbol(e,"end");if(this.startSymbol=l,this.endSymbol=h,a){const d=[...this.attribute.points];if(N(o))d[o]=this._clipPoints(d[o]);else{const u=this._clipPoints(ry(d));d[0][0]=u[0],d[d.length-1][d[d.length-1].length-1]=u[u.length-1]}d.forEach((u,c)=>{var p,g;const f=_t.line(Object.assign(Object.assign({points:u},$(i)?(p=i[c])!==null&&p!==void 0?p:i[i.length-1]:i),{fill:!1}));f.name=`${this.name}-line`,f.id=this._getNodeId("line"+c),vt(n==null?void 0:n.line)||(f.states=$(n.line)?(g=n.line[c])!==null&&g!==void 0?g:n.line[n.line.length-1]:n.line),this.add(f)})}else{const d=_t.polygon(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},Y(i)[0]),{fill:!1,closePath:!1}));d.name=`${this.name}-line`,d.id=this._getNodeId("line"),vt(n==null?void 0:n.line)||(d.states=[].concat(n.line)[0]),this.add(d)}}_renderSymbol(t,e){const i=this._getMainSegmentPoints();if(!i.length)return;const{autoRotate:n=!0}=t;let r;if(t&&t.visible){const a=this._startAngle,o=this._endAngle,{state:l}=this.attribute,h=i[0],d=i[i.length-1],{refX:u=0,refY:c=0,refAngle:p=0,style:g,symbolType:f,size:_=12}=t;let m,v;e==="start"?(m={x:h.x+(N(a)?u*Math.cos(a)+c*Math.cos(a-Math.PI/2):0),y:h.y+(N(a)?u*Math.sin(a)+c*Math.sin(a-Math.PI/2):0)},v=a+Math.PI/2):(m={x:d.x+(N(o)?u*Math.cos(o)+c*Math.cos(o-Math.PI/2):0),y:d.y+(N(o)?u*Math.sin(o)+c*Math.sin(o-Math.PI/2):0)},v=o+Math.PI/2),r=_t.symbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:f,size:_,angle:n?v+p:0,strokeBoundsBuffer:0}),g)),r.name=`${this.name}-${e}-symbol`,r.id=this._getNodeId(`${e}-symbol`),vt(l==null?void 0:l.symbol)||(r.states=l.symbol),this.add(r)}return r}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let n;return n=e?N(i)?t[i]:ry(t):t,this._mainSegmentPoints=n,n}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const r=e.clip?e.size||10:0;n=[{x:t[0].x-r/2*(Math.cos(this._startAngle)||0),y:t[0].y-r/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const r=i.clip?i.size||10:0,a={x:t[t.length-1].x-r/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-r/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),a]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],r=t[t.length-1],a=[e.x-i.x,e.y-i.y],o=Math.atan2(a[1],a[0]),l=[r.x-n.x,r.y-n.y],h=Math.atan2(l[1],l[0]);this._startAngle=o,this._endAngle=h}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}Jh.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}};var qi;(function(s){s.innerView="inner-view",s.axisContainer="axis-container",s.labelContainer="axis-label-container",s.tickContainer="axis-tick-container",s.tick="axis-tick",s.subTick="axis-sub-tick",s.label="axis-label",s.title="axis-title",s.gridContainer="axis-grid-container",s.grid="axis-grid",s.gridRegion="axis-grid-region",s.line="axis-line",s.background="axis-background",s.axisLabelBackground="axis-label-background"})(qi||(qi={}));var Tl;(function(s){s.selected="selected",s.selectedReverse="selected_reverse",s.hover="hover",s.hoverReverse="hover_reverse"})(Tl||(Tl={}));const Yn={[Tl.selectedReverse]:{},[Tl.selected]:{},[Tl.hover]:{},[Tl.hoverReverse]:{}},l_={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}};class SI extends gi{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{const e=t.target;e!==this._lastHover&&e.name&&!vt(e.states)&&(e.addState(Xe.hover,!0),Cn(this.axisContainer,i=>{i!==e&&i.name&&!vt(i.states)&&i.addState(Xe.hoverReverse,!0)}),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(Cn(this.axisContainer,e=>{e.name&&!vt(e.states)&&(e.removeState(Xe.hoverReverse),e.removeState(Xe.hover))}),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState(Xe.selected))return this._lastSelect=null,void Cn(this.axisContainer,i=>{i.name&&!vt(i.states)&&(i.removeState(Xe.selectedReverse),i.removeState(Xe.selected))});e.name&&!vt(e.states)&&(e.addState(Xe.selected,!0),Cn(this.axisContainer,i=>{i!==e&&i.name&&!vt(i.states)&&i.addState(Xe.selectedReverse,!0)}),this._lastSelect=e)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const e=bi(this.attribute);lt(this.attribute,t);const i=_t.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=_t.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){const{title:e,label:i,tick:n,line:r,items:a}=this.attribute,o=_t.group({x:0,y:0,zIndex:1});if(o.name=qi.axisContainer,o.id=this._getNodeId("container"),o.setMode(this.mode),this.axisContainer=o,t.add(o),r&&r.visible&&this.renderLine(o),a&&a.length&&(this.data=this._transformItems(a[0]),n&&n.visible&&this.renderTicks(o),i&&i.visible)){const l=_t.group({x:0,y:0,pickable:!1});l.name=qi.labelContainer,l.id=this._getNodeId("label-container"),this.axisLabelsContainer=l,o.add(l),a.forEach((h,d)=>{const u=this.renderLabels(l,h,d),c=u.getChildren();this.beforeLabelsOverlap(c,h,u,d,a.length),this.handleLabelsOverlap(c,h,u,d,a.length),this.afterLabelsOverlap(c,h,u,d,a.length);let p=0,g=0,f="center",_="middle";c.forEach(m=>{var v;const y=m.attribute,b=(v=y.angle)!==null&&v!==void 0?v:0,x=m.AABBBounds;let S=x.width(),A=x.height();b&&(S=Math.abs(S*Math.cos(b)),A=Math.abs(A*Math.sin(b))),p=Math.max(p,S),g=Math.max(g,A),f=y.textAlign,_=y.textBaseline}),this.axisLabelLayerSize[d]={width:p,height:g,textAlign:f,textBaseline:_}})}e&&e.visible&&this.renderTitle(o)}renderTicks(t){const e=this.getTickLineItems(),i=_t.group({x:0,y:0,pickable:!1});i.name=qi.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach((r,a)=>{var o;const l=_t.line(Object.assign({},this._getTickLineAttribute("tick",r,a,e)));if(l.name=qi.tick,l.id=this._getNodeId(r.id),vt((o=this.attribute.tick)===null||o===void 0?void 0:o.state))l.states=tl;else{const h=this.data[a],d=lt({},tl,this.attribute.tick.state);Object.keys(d).forEach(u=>{K(d[u])&&(d[u]=d[u](h.rawValue,a,h,this.data))}),l.states=d}i.add(l)}),this.tickLineItems=e;const{subTick:n}=this.attribute;if(n&&n.visible){const r=this.getSubTickLineItems();r.length&&r.forEach((a,o)=>{const l=_t.line(Object.assign({},this._getTickLineAttribute("subTick",a,o,e)));if(l.name=qi.subTick,l.id=this._getNodeId(`${o}`),vt(n.state))l.states=tl;else{const h=lt({},tl,n.state);Object.keys(h).forEach(d=>{K(h[d])&&(h[d]=h[d](a.value,o,a,e))}),l.states=h}i.add(l)}),this.subTickLineItems=r}}renderLabels(t,e,i){const{dataFilter:n}=this.attribute.label;n&&K(n)&&(e=n(e,i));const r=this._transformItems(e),a=_t.group({x:0,y:0,pickable:!1});return a.name=`${qi.labelContainer}-layer-${i}`,a.id=this._getNodeId(`label-container-layer-${i}`),t.add(a),r.forEach((o,l)=>{var h,d,u;const c=this._getLabelAttribute(o,l,r,i);let p;if(c.type==="rich"?(c.textConfig=c.text,c.width=(h=c.width)!==null&&h!==void 0?h:0,c.height=(d=c.height)!==null&&d!==void 0?d:0,p=_t.richtext(c)):c.type==="html"?(c.textConfig=[],c.html=Object.assign(Object.assign({dom:c.text},zr),c),p=_t.richtext(c)):p=_t.text(c),p.name=qi.label,p.id=this._getNodeId(`layer${i}-label-${o.id}`),vt((u=this.attribute.label)===null||u===void 0?void 0:u.state))p.states=tl;else{const g=lt({},tl,this.attribute.label.state);Object.keys(g).forEach(f=>{K(g[f])&&(g[f]=g[f](o,l,r,i))}),p.states=g}a.add(p)}),a}renderTitle(t){const e=this.getTitleAttribute(),i=new Fn(Object.assign({},e));i.name=qi.title,i.id=this._getNodeId("title"),t.add(i)}getVerticalCoord(t,e,i){const n=this.getVerticalVector(e,i,t);return{x:t.x+n[0],y:t.y+n[1]}}getTextAlign(t){let e="center";return gs(t[0],0)?gs(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:n,inside:r=!1,length:a,dataFilter:o}=t;let l=1;return e.length>=2&&(l=e[1].value-e[0].value),(o&&K(o)?o(e):e).forEach(h=>{let d=h.point,u=h.value;if(!n){const p=h.value-l/2;if(this.isInValidValue(p))return;d=this.getTickCoord(p),u=p}const c=this.getVerticalCoord(d,a,r);if(this.mode==="3d"){const p=this.getVerticalVector(a,r,d);let g=0,f=0;Kt(p[0])>Kt(p[1])?g=le/2*(c.x>d.x?1:-1):f=le/2*(c.y>d.y?-1:1),i.push({start:d,end:c,value:u,id:`tick-${h.id}`,anchor:[d.x,d.y],alpha:g,beta:f})}else i.push({start:d,end:c,value:u,id:`tick-${h.id}`})}),i}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:n=!1,length:r=2}=t,a=this.tickLineItems,o=a.length;if(o>=2)for(let l=0;l<o-1;l++){const h=a[l],d=a[l+1];for(let u=0;u<i;u++){const c=(u+1)/(i+1),p=(1-c)*h.value+c*d.value,g=this.getTickCoord(p),f=this.getVerticalCoord(g,r,n);e.push({start:g,end:f,value:p,id:`sub-tick-${p}`})}}return e}_getTickLineAttribute(t,e,i,n){let r=It(this.attribute,`${t}.style`);const a=this.data[i];r=K(r)?lt({},It(l_,`${t}.style`),t==="tick"?r(a.rawValue,i,a,this.data):r(e.value,i,e,n)):r;const{start:o,end:l,anchor:h,alpha:d,beta:u}=e;return Object.assign({points:[o,l],anchor:h,alpha:d,beta:u},r)}_getLabelAttribute(t,e,i,n){var r,a;const{space:o=4,inside:l=!1,formatMethod:h,type:d="text",text:u}=this.attribute.label;let c=o,p=0;!((r=this.attribute.tick)===null||r===void 0)&&r.visible&&this.attribute.tick.inside===l&&(p=this.attribute.tick.length||4),!((a=this.attribute.subTick)===null||a===void 0)&&a.visible&&this.attribute.subTick.inside===l&&(p=Math.max(p,this.attribute.subTick.length||2)),c+=p;const g=this.getRelativeVector(t.point);n>0&&(g[1]===0?c+=(this.axisLabelLayerSize[n-1].height+It(this.attribute,"label.space",4))*n:c+=(this.axisLabelLayerSize[n-1].width+It(this.attribute,"label.space",4))*n);const f=this.getVerticalCoord(t.point,c,l),_=this.getVerticalVector(c||1,l,f),m=h?h(`${t.label}`,t,e,i,n):t.label;let{style:v}=this.attribute.label;v=K(v)?lt({},l_.label.style,v(t,e,i,n)):v;const y=this.getLabelAlign(_,l,v.angle);return v=lt(y,v),K(v.text)&&(v.text=v.text({label:t.label,value:t.rawValue,index:t.index,layer:n})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(f,_,m,v)),{text:u??m,lineHeight:v==null?void 0:v.fontSize,type:d}),v)}getLabelPosition(t,e,i,n){return t}_transformItems(t){const e=[];return t.forEach(i=>{var n;e.push(Object.assign(Object.assign({},i),{point:this.getTickCoord(i.value),id:(n=i.id)!==null&&n!==void 0?n:i.label}))}),e}}function n6(s,t,e,i,n){return{x:(s-i)*Math.cos(e)+(t-n)*Math.sin(e)+i,y:(s-i)*Math.sin(e)+(n-t)*Math.cos(e)+n}}function r6(s){const t=s.AABBBounds;return{x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2,centerX:s.attribute.x,centerY:s.attribute.y,angle:s.attribute.angle}}function AI(s){s.forEach(t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=r6(t),i=n6(e.centerX,e.centerY,e.angle,t.attribute.x,t.attribute.y),n=i.x-e.centerX,r=i.y-e.centerY;e.x1+=n,e.x2+=n,e.y1+=r,e.y2+=r,e.centerX+=n,e.centerY+=r,t.rotatedBounds=e})}function a6(s,t){return bu(s.AABBBounds,t.AABBBounds,!1)&&(!s.rotatedBounds||!t.rotatedBounds||Ij(s.rotatedBounds,t.rotatedBounds,!0))}const DM={parity:function(s){return s.filter((t,e)=>e%2?t.setAttribute("opacity",0):1)},greedy:function(s,t){let e;return s.filter((i,n)=>n&&zS(e,i,t)?i.setAttribute("opacity",0):(e=i,1))}};function zS(s,t,e){const i=s.AABBBounds,n=t.AABBBounds;return e>Math.max(n.x1-i.x2,i.x1-n.x2,n.y1-i.y2,i.y1-n.y2)&&(!s.rotatedBounds||!t.rotatedBounds||e>Math.max(t.rotatedBounds.x1-s.rotatedBounds.x2,s.rotatedBounds.x1-t.rotatedBounds.x2,t.rotatedBounds.y1-s.rotatedBounds.y2,s.rotatedBounds.y1-t.rotatedBounds.y2))}function FM(s,t){for(let e,i=1,n=s.length,r=s[0];i<n;r=e,++i)if(zS(r,e=s[i],t))return!0}function o6(s){const t=s.AABBBounds;return t.width()>1&&t.height()>1}function l6(s){return s.forEach(t=>t.setAttribute("opacity",1)),s}function h6(s,t){if(vt(s))return;const e=s.filter(o6);if(vt(e))return;let i;i=l6(e),AI(i);const{method:n="parity",separation:r=0}=t,a=K(n)?n:DM[n]||DM.parity;if(i.length>=3&&FM(i,r)){do i=a(i,r);while(i.length>=3&&FM(i,r));if(i.length<3||t.lastVisible){const o=Ma(e);if(!o.attribute.opacity){const l=i.length;if(l>1){o.setAttribute("opacity",1);for(let h=l-1;h>=0&&zS(i[h],o,r);h--)i[h].setAttribute("opacity",0)}}}}e.forEach(o=>{o.setAttribute("visible",!!o.attribute.opacity)})}function d6(s,t){if(vt(s))return;const{orient:e,labelRotateAngle:i=[0,45,90]}=t;if(i.length===0||s.some(a=>!!a.attribute.angle))return;let n=0,r=0;for(i&&i.length>0&&(r=i.length);n<r;){const a=i[n++];if(s.forEach(o=>{o.attribute.angle=ue(a)}),c6(e,s),!u6(s))break}}function u6(s){for(let t=1;t<s.length;t++)if(a6(s[t-1],s[t]))return!0;return!1}function c6(s,t){s!=="bottom"&&s!=="top"||g6(s,t),s!=="left"&&s!=="right"||p6(s,t),AI(t)}function zm(s=0){if(s<0)for(;s<0;)s+=2*Math.PI;if(s>0)for(;s>=2*Math.PI;)s-=2*Math.PI;return s}function p6(s,t){t.forEach((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},wI(s,e.attribute.angle)),{angle:zm(e.attribute.angle)}))})}function g6(s,t){t.forEach(e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},kI(s,e.attribute.angle)),{angle:zm(e.attribute.angle)}))})}function kI(s,t=0){let e=["center","left","left","left","center","right","right","right","left"],i=["top","top","middle","bottom","bottom","bottom","middle","top","top"];s==="top"&&(e=["center","right","right","right","center","left","left","left","right"],i=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(t=zm(t))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:e[r],textBaseline:i[r]}}function wI(s,t=0){let e=["right","right","center","left","center","left","center","right","right"],i=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];s==="right"&&(e=["left","right","right","right","left","left","left","left","right"],i=["middle","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(t=zm(t))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:e[r],textBaseline:i[r]}}function f6(s,t){const{limitLength:e,verticalLimitLength:i,ellipsis:n="...",orient:r}=t;!vt(s)&&N(e)&&s.forEach(a=>{if((r==="top"||r==="bottom")&&Math.floor(a.AABBBounds.height())<=e)return;const o=a.attribute.direction;if((r==="left"||r==="right")&&(o==="vertical"&&Math.floor(a.AABBBounds.height())<=i||o!=="vertical"&&Math.floor(a.AABBBounds.width())<=e))return;const l=a.attribute.angle;let h=l===0||P(l)?r==="top"||r==="bottom"?null:o==="vertical"?i:e:Math.abs(e/Math.sin(l));N(a.attribute.maxLineWidth)&&(h=N(h)?Math.min(a.attribute.maxLineWidth,h):a.attribute.maxLineWidth),a.setAttributes({maxLineWidth:h,ellipsis:a.attribute.ellipsis||n})})}function _6(s,t,e,i,n){if(i==="right"||i==="left"){if(n==="left"){const r=i==="right"?0:-1;s.forEach(a=>{a.setAttributes({x:t+e*r,textAlign:"left"})})}else if(n==="right"){const r=i==="right"?1:0;s.forEach(a=>{a.setAttributes({x:t+e*r,textAlign:"right"})})}else if(n==="center"){const r=i==="right"?1:-1;s.forEach(a=>{a.setAttributes({x:t+.5*e*r,textAlign:"center"})})}}else if(i==="bottom"||i==="top"){if(n==="top"){const r=i==="bottom"?0:-1;s.forEach(a=>{a.setAttributes({y:t+e*r,textBaseline:"top"})})}else if(n==="bottom"){const r=i==="bottom"?1:0;s.forEach(a=>{a.setAttributes({y:t+e*r,textBaseline:"bottom"})})}else if(n==="middle"){const r=i==="bottom"?1:-1;s.forEach(a=>{a.setAttributes({y:t+.5*e*r,textBaseline:"middle"})})}}}class TI{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:n=1}=this.attribute,r=this.getRelativeVector(),a=yY(r),o=[a[1],-1*a[0]];return pI(o,t*(e?1:-1)*n)}}function MI(){qe(),qa(),Za(),Ja()}function m6(){MI(),Vr()}function v6(){MI(),hY()}function y6(){qe(),Ic()}function b6(){qe(),Ic()}var jM=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};m6();class Wu extends SI{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Wu.defaultAttributes,t),e)}_renderInner(t){var e;super._renderInner(t);const{panel:i}=this.attribute;if(i&&i.visible){const n=this.axisContainer,r=n.AABBBounds,a=_t.rect(Object.assign({x:r.x1,y:r.y1,width:r.width(),height:r.height()},i.style));a.name=qi.background,a.id=this._getNodeId("background"),a.states=lt({},Yn,(e=i.state)!==null&&e!==void 0?e:{}),n.insertBefore(a,n.firstChild)}}renderLine(t){const{start:e,end:i,line:n}=this.attribute,r=n,{startSymbol:a,endSymbol:o,style:l,breakRange:h,breakShape:d,breakShapeStyle:u,state:c}=r,p=jM(r,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]),g=Object.assign({points:[e,i],startSymbol:a,endSymbol:o,lineStyle:l},p);vt(c)||(g.state={line:lt({},Yn,c),symbol:lt({},Yn,c)});const f=new Jh(g);f.name=qi.line,f.id=this._getNodeId("line"),t.add(f)}getTitleAttribute(){var t,e,i;const n=this.attribute.title,{position:r="middle",space:a=4,textStyle:o={},autoRotate:l=!0,shape:h,background:d,state:u={}}=n,c=jM(n,["position","space","textStyle","autoRotate","shape","background","state"]);let p=.5;r==="start"?p=0:r==="end"&&(p=1);const{verticalFactor:g=1}=this.attribute,f=-1*g,_=this.getTickCoord(p),m=this.getRelativeVector();let v=0;if(!((t=this.attribute.label)===null||t===void 0)&&t.visible&&this.attribute.label.inside===!1){const M=+It(this.attribute,"label.space",4);v+=M;const C=Object.keys(this.axisLabelLayerSize).length;if(m[1]===0){const R=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(R)?v+=R+(C-1)*M:v=0}else{if(m[0]===0){const D=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.width():0;isFinite(D)?v+=D+(C-1)*M:v=0}else Object.keys(this.axisLabelLayerSize).forEach((D,j)=>{v+=this.axisLabelLayerSize[D].width+(j>0?M:0)});const R=this.axisLabelLayerSize[0].textAlign,I=R==="start"||R==="left",O=R==="center",L=m[1]>0;v=f===1?L?I?v:O?v/2:M:I?M:O?v/2:v:L?I?M:O?v/2:v:I?v:O?v/2:M}}let y=0;!((e=this.attribute.tick)===null||e===void 0)&&e.visible&&this.attribute.tick.inside===!1&&(y=this.attribute.tick.length||4),!((i=this.attribute.subTick)===null||i===void 0)&&i.visible&&this.attribute.subTick.inside===!1&&(y=Math.max(y,this.attribute.subTick.length||2));const b=y+v+a,x=this.getVerticalCoord(_,b,!1),S=this.getVerticalVector(b,!1,{x:0,y:0});let A,k,{angle:w}=c;if(A=r==="start"?"start":r==="end"?"end":"center",P(w)&&l){w=SY(m,[1,0],!0);const{verticalFactor:M=1}=this.attribute;k=-1*M===1?"bottom":"top"}else A=this.getTextAlign(S),k=this.getTextBaseline(S,!1);const T=Object.assign(Object.assign(Object.assign({},x),c),{textStyle:Object.assign({textAlign:A,textBaseline:k},o),state:{text:lt({},Yn,u.text),shape:lt({},Yn,u.shape),panel:lt({},Yn,u.background)}});return T.angle=w,h&&h.visible&&(T.shape=Object.assign({visible:!0},h.style),h.space&&(T.space=h.space)),d&&d.visible&&(T.panel=Object.assign({visible:!0},d.style)),T}getTextBaseline(t,e){let i="middle";const{verticalFactor:n=1}=this.attribute,r=(e?1:-1)*n;return gs(t[1],0)?i=!gs(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":r===1?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){const n=this.attribute.orient;if(N(i)||t[0]===0&&t[1]===0){if(n==="top"||n==="bottom")return kI(n,i);if(n==="left"||n==="right")return wI(n,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,n,r){var a,o,l,h;const{flush:d=!1}=this.attribute.label||{};if(d&&t.length){const{orient:u,start:c,end:p}=this.attribute,g=u==="bottom"||u==="top",f=t[0],_=Ma(t),m=g?f.attribute.x>_.attribute.x:f.attribute.y<_.attribute.y;if(g){const v=m?_:f,y=m?f:_,b=c.x,x=p.x,S=v.AABBBounds.x1,A=y.AABBBounds.x2;S<b&&(v.attribute.angle?v.setAttributes({dx:((a=v.attribute.dx)!==null&&a!==void 0?a:0)+b-S}):v.setAttributes({x:b,textAlign:"left"})),A>x&&(y.attribute.angle?y.setAttributes({dx:((o=y.attribute.dx)!==null&&o!==void 0?o:0)+x-A}):y.setAttributes({x,textAlign:"right"}))}else{const v=m?_:f,y=m?f:_,b=v.AABBBounds.y2,x=y.AABBBounds.y1,S=c.y,A=p.y;x<S&&(y.attribute.angle?y.setAttributes({dy:((l=y.attribute.dy)!==null&&l!==void 0?l:0)+S-x}):y.setAttributes({y:S,textBaseline:"top"})),b>A&&(v.attribute.angle?v.setAttributes({dy:((h=v.attribute.dy)!==null&&h!==void 0?h:0)+A-b}):v.setAttributes({y:A,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,n,r){if(vt(t))return;const{verticalLimitSize:a,label:o,orient:l}=this.attribute,h=this._getAxisLabelLimitLength(a,r),{layoutFunc:d,autoRotate:u,autoRotateAngle:c,autoLimit:p,limitEllipsis:g,autoHide:f,autoHideMethod:_,autoHideSeparation:m,lastVisible:v}=o;if(K(d))d(t,e,n,this);else{if(u&&d6(t,{labelRotateAngle:c,orient:l}),p&&N(h)&&h>0){const y=l!=="left"&&l!=="right"||!t.some(b=>b.attribute.direction==="vertical")?1/0:Math.abs(this.attribute.start.y-this.attribute.end.y)/t.length;f6(t,{limitLength:h,verticalLimitLength:y,ellipsis:g,orient:l})}f&&h6(t,{method:_,separation:m,lastVisible:v})}}afterLabelsOverlap(t,e,i,n,r){const{verticalLimitSize:a,orient:o}=this.attribute,l=o==="bottom"||o==="top",h=i.AABBBounds;let d=l?h.height():h.width();const{verticalMinSize:u}=this.attribute;if(N(u)&&(!N(a)||u<=a)){const c=this._getAxisLabelLimitLength(u,r);let p,g;d=Math.max(d,c),o==="left"?(p=h.x2-d,g=h.y1):o==="right"?(p=h.x1,g=h.y1):o==="top"?(p=h.x1,g=h.y2-d):o==="bottom"&&(p=h.x1,g=h.y1);const f=_t.rect({x:p,y:g,width:l?h.width():d,height:l?d:h.height(),pickable:!1});f.name=qi.axisLabelBackground,f.id=this._getNodeId("axis-label-background"),i.insertBefore(f,i.firstChild)}if(E(this.attribute.label.containerAlign)){let c;o==="left"?c=h.x2:o==="right"?c=h.x1:o==="top"?c=h.y2:o==="bottom"&&(c=h.y1),_6(t,c,d,o,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,n,r,a;const{label:o,title:l,line:h,tick:d}=this.attribute,u=(i=o.space)!==null&&i!==void 0?i:4;let c=t,p=0,g=0;const f=h&&h.visible?(n=h.style.lineWidth)!==null&&n!==void 0?n:1:0,_=d&&d.visible?(r=d.length)!==null&&r!==void 0?r:4:0;if(l&&l.visible&&typeof l.text=="string"){p=Cm(l.text,l.textStyle,(a=this.stage)===null||a===void 0?void 0:a.getTheme().text.fontFamily).height;const m=_s(l.padding);g=l.space+m[0]+m[2]}return c&&(c=(c-u-g-p-f-_)/e),c}}Wu.defaultAttributes=l_,Ai(Wu,TI);class CI{isInValidValue(t){const{startAngle:e=Ih,endAngle:i=Lh}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=Ih,endAngle:i=Lh,center:n,radius:r,inside:a=!1,innerRadius:o=0}=this.attribute;return xn(n,a&&o>0?o:r,e+(i-e)*t)}getVerticalVector(t,e=!1,i){const{inside:n=!1}=this.attribute,{center:r}=this.attribute,a=[i.x-r.x,i.y-r.y];return pI(a,(e?-1:1)*(n?-1:1)*t/vY(a))}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}const zM=(s=0)=>{if(s<0)for(;s<0;)s+=pi;else if(s>0)for(;s>pi;)s-=pi;return s};function Gp(s,t,e){return!bn(s,t,0,1e-6)&&!Vn(s,e,0,1e-6)}function x6(s,t,e,i){const n=Ec(Object.assign({text:e},i)),r=n.width(),a=n.height(),o=zM(Math.atan2(t[1],t[0]))-Math.PI,l=3*Math.PI/4,h=Math.PI/4,d=Math.PI/2,u=s.x;let c=0;c=Gp(o,-l,-h)?((o+l)/d-.5)*r:Gp(o,h,l)?(.5-(o-h)/d)*r:Math.cos(o)>=0?.5*r:.5*-r;const p=u-c,g=s.y;let f=0;return f=Gp(o,-l,-h)?.5*-a:Gp(o,h,l)?.5*a:Math.cos(o)>=0?(.5-(h-o)/d)*a:(.5-zM(o-l)/d)*a,{x:p,y:g-f}}var S6=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};v6();class Vu extends SI{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Vu.defaultAttributes,t))}renderLine(t){const{startAngle:e=Ih,endAngle:i=Lh,radius:n,center:r,innerRadius:a=0,line:o={},inside:l=!1}=this.attribute;let h=n,d=a;l&&a>0&&(h=a,d=0);const u=Object.assign(Object.assign(Object.assign({},r),{startAngle:e,endAngle:i,radius:h,innerRadius:d}),o.style),c=_t.circle(u);c.name=qi.line,c.id=this._getNodeId("line"),vt(o.state)||(c.states=lt({},Yn,o.state)),t.add(c)}getTitleAttribute(){var t,e,i;const{center:n,radius:r,innerRadius:a=0}=this.attribute,o=this.attribute.title,{space:l=4,textStyle:h={},shape:d,background:u,state:c={}}=o,p=S6(o,["space","textStyle","shape","background","state"]);let g=n,f=0;!((t=this.attribute.label)===null||t===void 0)&&t.visible&&this.attribute.label.inside===!1&&(f=It(this.attribute.label,"style.fontSize",12)+It(this.attribute.label,"space",4));let _=0;!((e=this.attribute.tick)===null||e===void 0)&&e.visible&&this.attribute.tick.inside===!1&&(_=this.attribute.tick.length||4),!((i=this.attribute.subTick)===null||i===void 0)&&i.visible&&this.attribute.subTick.inside===!1&&(_=Math.max(_,this.attribute.subTick.length||2));const m=r+_+f+l;let v="middle",{position:y}=this.attribute.title;P(y)&&(y=a===0?"end":"middle"),y==="start"?(v="bottom",g={x:n.x,y:n.y-m}):y==="end"&&(v="top",g={x:n.x,y:n.y+m});const b=Object.assign(Object.assign(Object.assign({},g),p),{textStyle:Object.assign({textBaseline:v,textAlign:"center"},h),state:{text:lt({},Yn,c.text),shape:lt({},Yn,c.shape),panel:lt({},Yn,c.background)}}),{angle:x}=p;return b.angle=x,d&&d.visible&&(b.shape=Object.assign({visible:!0},d.style),d.space&&(b.space=d.space)),u&&u.visible&&(b.panel=Object.assign({visible:!0},u.style)),b}getSubTickLineItems(){var t,e;const{subTick:i}=this.attribute,n=[],{count:r=4,inside:a=!1,length:o=2}=i,l=this.tickLineItems,h=l.length;if(h>=2){const d=this.data[1].value-this.data[0].value,u=(e=(t=this.attribute)===null||t===void 0?void 0:t.tick)===null||e===void 0?void 0:e.alignWithLabel;for(let c=0;c<h;c++){const p=l[c],g=l[c+1];for(let f=0;f<r;f++){const _=(f+1)/(r+1),m=(1-_)*p.value+_*(g?g.value:u?1:p.value+d),v=this.getTickCoord(m),y=this.getVerticalCoord(v,o,a);n.push({start:v,end:y,value:m})}}}return n}getTextBaseline(t){let e="middle";return gs(t[1],0)?e="middle":t[1]>0&&t[1]>Math.abs(t[0])?e="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(e="bottom"),e}beforeLabelsOverlap(t,e,i,n,r){}handleLabelsOverlap(t,e,i,n,r){}afterLabelsOverlap(t,e,i,n,r){}getLabelAlign(t,e,i){return{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,n){return x6(t,e,i,n)}}Vu.defaultAttributes=l_,Ai(Vu,CI);function A6(s){const t={};return Cn(s,e=>{e.type!=="group"&&e.id&&(t[e.id]=e)}),t}class k6 extends ms{constructor(){super(...arguments),this.mode=wh.NORMAL}onBind(){const t=this.target.getInnerView(),e=this.target.getPrevInnerView();e&&(this._oldElementMap=A6(e),this._newElementAttrMap={},Cn(t,i=>{var n,r,a,o,l,h;if(i.type!=="group"&&i.id){const d=this._oldElementMap[i.id];if(d){if(!Se(i.attribute,d.attribute)){const u=bi(i.attribute);this._newElementAttrMap[i.id]={state:"update",node:i,attrs:Object.assign(Object.assign({},u),{opacity:(n=u.opacity)!==null&&n!==void 0?n:1,fillOpacity:(r=u.fillOpacity)!==null&&r!==void 0?r:1,strokeOpacity:(a=u.strokeOpacity)!==null&&a!==void 0?a:1})},i.setAttributes(d.attribute)}}else{const u={opacity:(o=i.attribute.opacity)!==null&&o!==void 0?o:1,fillOpacity:(l=i.attribute.fillOpacity)!==null&&l!==void 0?l:1,strokeOpacity:(h=i.attribute.strokeOpacity)!==null&&h!==void 0?h:1};this._newElementAttrMap[i.id]={state:"enter",node:i,attrs:u},i.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}}))}onStart(){let t=this.duration,e=this.easing;Object.keys(this._newElementAttrMap).forEach(i=>{var n;const{node:r,attrs:a,state:o}=this._newElementAttrMap[i];if(o==="enter"){const{enter:l={}}=(n=this.params)!==null&&n!==void 0?n:{};t=N(l.duration)?l.duration:t,e=l.easing?l.easing:e}r.type==="path"?r.animate({interpolate:(l,h,d,u,c)=>l==="path"&&(c.path=xj(d,u)(h),!0)}).to(a,t,e):r.animate().to(a,t,e)})}onUpdate(t,e,i){}}class w6 extends ms{constructor(t,e,i,n){super(null,null,i,n)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}}function Ml(s,t){let e="";return s.length===0||(s.forEach((i,n)=>{n===0?e=`M${i.x},${i.y}`:e+=`L${i.x},${i.y}`}),t&&(e+="Z")),e}function ix(s,t,e,i){let n="";if(!s||t.length===0)return n;const r=t[0],a=ze.distancePP(s,r),o=e?0:1;return i?n+=`M${s.x},${s.y-a}A${a},${a},0,0,${o},${s.x},${s.y+a}A${a},${a},0,0,${o},${s.x},${s.y-a}Z`:t.forEach((l,h)=>{h===0?n=`M${l.x},${l.y}`:n+=`A${a},${a},0,0,${o},${l.x},${l.y}`}),n}function T6(s,t,e){const{type:i,closed:n}=e,r=t.slice(0).reverse();let a="",o="";if(i==="line"&&e.smoothLink&&e.center){const l=s[0],h=r[0],d=e.center;a=Ml(s,!!n),o=Ml(r,!!n);const u=ze.distancePP(h,d),c=ze.distancePP(l,d);a+=`A${u},${u},0,0,1,${h.x},${h.y}L${h.x},${h.y}`,o+=`A${c},${c},0,0,0,${l.x},${l.y}`}else if(i==="circle"){const{center:l}=e;a=ix(l,s,!1,!!n),o=ix(l,r,!0,!!n)}else i!=="line"&&i!=="polygon"||(a=Ml(s,!!n),o=Ml(r,!!n));return n?a+=o:(o="L"+o.substring(1),a+=o,a+="Z"),a}class Va extends gi{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=_t.group({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:e}=this.attribute;t&&t.length&&e!==!1&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){const n=this.getVerticalVector(e,i,t);return{x:t.x+n[0],y:t.y+n[1]}}_transformItems(t){const e=[];return t.forEach(i=>{var n;e.push(Object.assign(Object.assign({},i),{point:this.getTickCoord(i.value),id:(n=i.id)!==null&&n!==void 0?n:i.label}))}),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(t,e){const i=lt({},this.attribute,this.getGridAttribute(t)),{type:n,items:r,style:a,closed:o,alternateColor:l,depth:h=0}=i,d=t?`${qi.grid}-sub`:`${qi.grid}`;if(r.forEach((u,c)=>{const{id:p,points:g}=u;let f="";if(n==="line"||n==="polygon")f=Ml(g,!!o);else if(n==="circle"){const{center:m}=this.attribute;f=ix(m,g,!1,!!o)}const _=_t.path(Object.assign({path:f,z:h},K(a)?lt({},this.skipDefault?null:Va.defaultAttributes.style,a(u,c)):a));_.name=`${d}-line`,_.id=this._getNodeId(`${d}-path-${p}`),e.add(_)}),h&&n==="line"&&r.forEach((u,c)=>{const{id:p,points:g}=u,f=[];f.push(g[0]);const _=g[1].x-g[0].x,m=g[1].y-g[0].y,v=Math.sqrt(_*_+m*m),y=h/v;f.push({x:g[0].x+_*y,y:g[0].y+m*y});const b=Ml(f,!!o),x=Kt(f[0].x-f[1].x),S=Kt(f[0].y-f[1].y),A=_t.path(Object.assign({path:b,z:0,alpha:x>S?(g[1].x-g[0].x>0?-1:1)*le/2:0,beta:x<S?-le/2:0,anchor3d:x>S?[f[0].x,0]:[0,f[0].y]},K(a)?lt({},this.skipDefault?null:Va.defaultAttributes.style,a(u,c)):a));A.name=`${d}-line`,A.id=this._getNodeId(`${d}-path-${p}`),e.add(A)}),r.length>1&&l){const u=$(l)?l:[l,"transparent"],c=p=>u[p%u.length];for(let p=0;p<r.length-1;p++){const[g,f]=[r[p].points,r[p+1].points],_=T6(g,f,i),m=_t.path({path:_,fill:c(p)});m.name=`${d}-region`,m.id=this._getNodeId(`${d}-region-${p}`),e.add(m)}}}_getNodeId(t){return`${this.id}-${t}`}}Va.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}};function M6(s,t,e,i,n){const r=[],a=n-i;for(let o=0;o<t;o++){const l=i+o*a/t;r.push(xn(s,e,l))}return r}y6();class PI extends Va{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Va.defaultAttributes,t),e)}_getGridPoint(t,e){let i;if(t==="line"){const{length:n}=this.attribute;i=[e,this.getVerticalCoord(e,n,!0)]}else if(t==="circle"||t==="polygon"){const{center:n,sides:r=6,startAngle:a=Ih,endAngle:o=Lh}=this.attribute;i=M6(n,r,ze.distancePP(n,e),a,o)}return i}getGridAttribute(t){const{type:e,alignWithLabel:i=!0}=this.attribute;let n=1,r;this.data.length>=2&&(n=this.data[1].value-this.data[0].value);let a=[];if(t){r=lt({},this.attribute,this.attribute.subGrid);const o=[],{count:l=4}=this.attribute.subGrid||{};if(this.data.length>=2){const h=[];this.data.forEach(d=>{let u=d.value;if(!i){const c=d.value-n/2;if(this.isInValidValue(c))return;u=c}h.push({value:u})});for(let d=0;d<h.length-1;d++){const u=h[d],c=h[d+1];o.push({id:`sub-${d}-0`,points:this._getGridPoint(e,this.getTickCoord(u.value)),datum:{}});for(let p=0;p<l;p++){const g=(p+1)/(l+1),f=(1-g)*u.value+g*c.value,_=this.getTickCoord(f);o.push({id:`sub-${d}-${p+1}`,points:this._getGridPoint(e,_),datum:{}})}d===h.length-2&&o.push({id:`sub-${d}-${l+1}`,points:this._getGridPoint(e,this.getTickCoord(c.value)),datum:{}})}a=o}}else{r=this.attribute;const o=[];this.data.forEach(l=>{let{point:h}=l;if(!i){const d=l.value-n/2;if(this.isInValidValue(d))return;h=this.getTickCoord(d)}o.push({id:l.label,datum:l,points:this._getGridPoint(e,h)})}),a=o}return Object.assign(Object.assign({},r),{items:a})}}Ai(PI,TI);var C6=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};b6();class EI extends Va{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Va.defaultAttributes,t),e)}getGridAttribute(t){let e,i=[];const n=this.attribute,{radius:r,innerRadius:a=0,startAngle:o=Ih,endAngle:l=Lh,center:h,subGrid:d}=n,u=C6(n,["radius","innerRadius","startAngle","endAngle","center","subGrid"]),{alignWithLabel:c=!0}=u||{},p=r-a;let g=1;if(this.data.length>=2&&(g=this.data[1].value-this.data[0].value),t){e=lt({},u,d);const f=[],{count:_=4}=d||{},m=this.data.length;if(m>=2){const v=[];this.data.forEach(y=>{let b=y.value;if(!c){const x=y.value-g/2;if(this.isInValidValue(x))return;b=x}v.push({value:b})});for(let y=0;y<m;y++){const b=v[y],x=v[y+1];f.push({id:`sub-${y}-0`,points:[this.getTickCoord(b.value),this.getVerticalCoord(this.getTickCoord(b.value),p,!0)],datum:{}});for(let S=0;S<_;S++){const A=(S+1)/(_+1),k=(1-A)*b.value+A*(x?x.value:c?1:b.value+g),w=this.getTickCoord(k),T=this.getVerticalCoord(w,p,!0);f.push({id:`sub-${y}-${S+1}`,points:[w,T],datum:{}})}}Math.abs(l-o)%(2*Math.PI)==0&&f.push(f[0]),i=f}}else{e=u;const f=[];let _;_=Math.abs(l-o)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data,_.forEach(m=>{let{point:v}=m;if(!c){const b=m.value-g/2;if(this.isInValidValue(b))return;v=this.getTickCoord(b)}const y=this.getVerticalCoord(v,p,!0);f.push({id:m.id,points:[v,y],datum:m})}),i=f}return Object.assign(Object.assign({},e),{items:i,center:h,type:"line"})}}Ai(EI,CI);const HM="M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",P6={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:HM,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:HM,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},Jr={horizontal:{angle:0,strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",cursor:"ew-resize"},vertical:{angle:Math.PI/180*90,cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0}};var ls;(function(s){s.startHandler="startHandler",s.endHandler="endHandler",s.middleHandler="middleHandler",s.background="background"})(ls||(ls={}));function E6(){Pm(),Vr(),Dn(),lI(),qa()}var NM=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};const R6={debounce:lr,throttle:Ka};E6();let RI=class OI extends gi{setPropsFromAttrs(){const{start:t,end:e,orient:i,previewData:n,previewPointsX:r,previewPointsY:a,previewPointsX1:o,previewPointsY1:l}=this.attribute;t&&(this.state.start=t),e&&(this.state.end=e);const{width:h,height:d}=this.getLayoutAttrFromConfig();this._spanCache=this.state.end-this.state.start,this._isHorizontal=i==="top"||i==="bottom",this._layoutCache.max=this._isHorizontal?h:d,this._layoutCache.attPos=this._isHorizontal?"x":"y",this._layoutCache.attSize=this._isHorizontal?"width":"height",n&&(this._previewData=n),K(r)&&(this._previewPointsX=r),K(a)&&(this._previewPointsY=a),K(o)&&(this._previewPointsX1=o),K(l)&&(this._previewPointsY1=l)}constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},OI.defaultAttributes,t)),this.name="dataZoom",this._previewData=[],this._activeState=!1,this._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}},this._layoutCache={attPos:"x",attSize:"width",max:0},this.state={start:0,end:1},this._statePointToData=r=>r,this._onHandlerPointerDown=(r,a)=>{r.stopPropagation(),a==="start"?(this._activeTag=ls.startHandler,this._activeItem=this._startHandlerMask):a==="end"?(this._activeTag=ls.endHandler,this._activeItem=this._endHandlerMask):a==="middleRect"?(this._activeTag=ls.middleHandler,this._activeItem=this._middleHandlerRect):a==="middleSymbol"?(this._activeTag=ls.middleHandler,this._activeItem=this._middleHandlerSymbol):a==="background"&&(this._activeTag=ls.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(r),this._activeCache.lastPos=this.eventPosToStagePos(r),Gt.env==="browser"&&(Gt.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),Gt.addEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})},this._onHandlerPointerMove=R6[this.attribute.delayType](r=>{r.stopPropagation();const{start:a,end:o,brushSelect:l,realTime:h=!0}=this.attribute,d=this.eventPosToStagePos(r),{attPos:u,max:c}=this._layoutCache,p=(d[u]-this._activeCache.lastPos[u])/c;let{start:g,end:f}=this.state;this._activeState&&(this._activeTag===ls.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+p):this._activeTag===ls.startHandler?g+p>f?(g=f,f=g+p,this._activeTag=ls.endHandler):g+=p:this._activeTag===ls.endHandler&&(f+p<g?(f=g,g=f+p,this._activeTag=ls.startHandler):f+=p),this._activeCache.lastPos=d,l&&this.renderDragMask()),g=Math.min(Math.max(g,0),1),f=Math.min(Math.max(f,0),1),a===g&&o===f||(this.setStateAttr(g,f,!0),this._dispatchEvent("change",{start:g,end:f,tag:this._activeTag}))},this.attribute.delayTime);const{position:i,showDetail:n}=t;this._activeCache.startPos=i,this._activeCache.lastPos=i,this._showText=n!=="auto"&&n,this.setPropsFromAttrs()}setAttributes(t,e){super.setAttributes(t,e),this.setPropsFromAttrs()}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{showDetail:t,brushSelect:e}=this.attribute;this._startHandlerMask&&this._startHandlerMask.addEventListener("pointerdown",n=>this._onHandlerPointerDown(n,"start")),this._endHandlerMask&&this._endHandlerMask.addEventListener("pointerdown",n=>this._onHandlerPointerDown(n,"end")),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",n=>this._onHandlerPointerDown(n,"middleSymbol")),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",n=>this._onHandlerPointerDown(n,"middleRect"));const i=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",n=>this._onHandlerPointerDown(n,i)),e&&this._background&&this._background.addEventListener("pointerdown",n=>this._onHandlerPointerDown(n,"background")),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",n=>this._onHandlerPointerDown(n,"background")),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",n=>this._onHandlerPointerDown(n,i)),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),t==="auto"&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){const{zoomLock:n=!1,minSpan:r=0,maxSpan:a=1}=this.attribute,o=e-t;o!==this._spanCache&&(n||o<r||o>a)||(this._spanCache=o,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){var e,i;const{x:n,y:r}=Gt.mapToCanvasPoint(t);return{x:n-(((e=this.stage)===null||e===void 0?void 0:e.x)||0),y:r-(((i=this.stage)===null||i===void 0?void 0:i.y)||0)}}_onHandlerPointerUp(t){t.preventDefault();const{start:e,end:i,brushSelect:n,realTime:r=!0}=this.attribute;if(this._activeState&&this._activeTag===ls.background){const a=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,a)}this._activeState=!1,n&&this.renderDragMask(),r&&e===this.state.start&&i===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),this._dispatchEvent("change",{start:this.state.start,end:this.state.end,tag:this._activeTag})),Gt.env==="browser"&&(Gt.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),Gt.removeEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:n}=this._layoutCache,{position:r}=this.attribute,a=t[i]-r[i],o=e[i]-r[i],l=Math.min(Math.max(Math.min(a,o)/n,0),1),h=Math.min(Math.max(Math.max(a,o)/n,0),1);Math.abs(l-h)<.01?this.moveZoomWithMiddle(l):this.setStateAttr(l,h,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;e!==0&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){const{dragMaskStyle:t}=this.attribute,{position:e,width:i,height:n}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:xi(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,e.x,e.x+i),y:e.y,width:this._activeState&&this._activeTag===ls.background&&Math.abs(this.dragMaskSize())||0,height:n},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.x,y:xi(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,e.y,e.y+n),width:i,height:this._activeState&&this._activeTag===ls.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}isTextOverflow(t,e,i){if(!e)return!1;if(this._isHorizontal){if(i==="start"){if(e.x1<t.x1)return!0}else if(e.x2>t.x2)return!0}else if(i==="start"){if(e.y1<t.y1)return!0}else if(e.y2>t.y2)return!0;return!1}setTextAttr(t,e){const{startTextStyle:i,endTextStyle:n}=this.attribute,{formatMethod:r}=i,a=NM(i,["formatMethod"]),{formatMethod:o}=n,l=NM(n,["formatMethod"]),{start:h,end:d}=this.state;this._startValue=this._statePointToData(h),this._endValue=this._statePointToData(d);const{position:u,width:c,height:p}=this.getLayoutAttrFromConfig(),g=r?r(this._startValue):this._startValue,f=o?o(this._endValue):this._endValue,_={x1:u.x,y1:u.y,x2:u.x+c,y2:u.y+p};let m,v,y,b;this._isHorizontal?(m={x:u.x+h*c,y:u.y+p/2},v={x:u.x+d*c,y:u.y+p/2},y={textAlign:this.isTextOverflow(_,t,"start")?"left":"right",textBaseline:"middle"},b={textAlign:this.isTextOverflow(_,e,"end")?"right":"left",textBaseline:"middle"}):(m={x:u.x+c/2,y:u.y+h*p},v={x:u.x+c/2,y:u.y+d*p},y={textAlign:"center",textBaseline:this.isTextOverflow(_,t,"start")?"top":"bottom"},b={textAlign:"center",textBaseline:this.isTextOverflow(_,e,"end")?"bottom":"top"}),this._startText=this.maybeAddLabel(this._container,lt({},a,{text:g,x:m.x,y:m.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:y}),`data-zoom-start-text-${u}`),this._endText=this.maybeAddLabel(this._container,lt({},l,{text:f,x:v.x,y:v.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:b}),`data-zoom-end-text-${u}`)}renderText(){let t=null,e=null;this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds,this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds;const{x1:i,x2:n,y1:r,y2:a}=t,{dx:o=0,dy:l=0}=this.attribute.startTextStyle;if(new Pi().set(i,r,n,a).intersects(e)){const h=this.attribute.orient==="bottom"||this.attribute.orient==="right"?-1:1;this._isHorizontal?this._startText.setAttribute("dy",l+h*Math.abs(e.y1-e.y2)):this._startText.setAttribute("dx",o+h*Math.abs(e.x1-e.x2))}else this._isHorizontal?this._startText.setAttribute("dy",l):this._startText.setAttribute("dx",o)}getLayoutAttrFromConfig(){var t,e,i,n;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:r,size:a,orient:o,middleHandlerStyle:l={},startHandlerStyle:h={},endHandlerStyle:d={}}=this.attribute,{width:u,height:c}=a,p=(e=(t=l.background)===null||t===void 0?void 0:t.size)!==null&&e!==void 0?e:10;let g,f,_;l.visible?this._isHorizontal?(g=u,f=c-p,_={x:r.x,y:r.y+p}):(g=u-p,f=c,_={x:r.x+(o==="left"?p:0),y:r.y}):(g=u,f=c,_=r);const m=(i=h.size)!==null&&i!==void 0?i:this._isHorizontal?f:g,v=(n=d.size)!==null&&n!==void 0?n:this._isHorizontal?f:g;return h.visible&&(this._isHorizontal?(g-=(m+v)/2,_={x:_.x+m/2,y:_.y}):(f-=(m+v)/2,_={x:_.x,y:_.y+m})),this._layoutAttrFromConfig={position:_,width:g,height:f},this._layoutAttrFromConfig}render(){var t,e,i,n,r,a,o,l,h,d,u,c,p,g,f,_,m,v;this._layoutAttrFromConfig=null;const{orient:y,backgroundStyle:b,backgroundChartStyle:x={},selectedBackgroundStyle:S={},selectedBackgroundChartStyle:A={},middleHandlerStyle:k={},startHandlerStyle:w={},endHandlerStyle:T={},brushSelect:M,zoomLock:C}=this.attribute,{start:R,end:I}=this.state,{position:O,width:L,height:D}=this.getLayoutAttrFromConfig(),j=(t=w.triggerMinSize)!==null&&t!==void 0?t:40,H=(e=T.triggerMinSize)!==null&&e!==void 0?e:40,W=this.createOrUpdateChild("dataZoom-container",{},"group");if(this._container=W,this._background=W.createOrUpdateChild("background",Object.assign(Object.assign({x:O.x,y:O.y,width:L,height:D,cursor:M?"crosshair":"auto"},b),{pickable:!C}),"rect"),!((i=x.line)===null||i===void 0)&&i.visible&&this.setPreviewAttributes("line",W),!((n=x.area)===null||n===void 0)&&n.visible&&this.setPreviewAttributes("area",W),M&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=W.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:O.x+R*L,y:O.y,width:(I-R)*L,height:D,cursor:M?"crosshair":"move"},S),{pickable:!C}),"rect"):this._selectedBackground=W.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:O.x,y:O.y+R*D,width:L,height:(I-R)*D,cursor:M?"crosshair":"move"},S),{pickable:!C}),"rect"),!((r=A.line)===null||r===void 0)&&r.visible&&this.setSelectedPreviewAttributes("line",W),!((a=A.area)===null||a===void 0)&&a.visible&&this.setSelectedPreviewAttributes("area",W),this._isHorizontal){if(k.visible){const nt=((o=k.background)===null||o===void 0?void 0:o.size)||10;this._middleHandlerRect=W.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:O.x+R*L,y:O.y-nt,width:(I-R)*L,height:nt},(l=k.background)===null||l===void 0?void 0:l.style),{pickable:!C}),"rect"),this._middleHandlerSymbol=W.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:O.x+(R+I)/2*L,y:O.y-nt/2,strokeBoundsBuffer:0,angle:0,symbolType:(d=(h=k.icon)===null||h===void 0?void 0:h.symbolType)!==null&&d!==void 0?d:"square"},k.icon),{pickable:!C}),"symbol")}this._startHandler=W.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:O.x+R*L,y:O.y+D/2,size:D,symbolType:(u=w.symbolType)!==null&&u!==void 0?u:"square"},Jr.horizontal),w),{pickable:!C}),"symbol"),this._endHandler=W.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:O.x+I*L,y:O.y+D/2,size:D,symbolType:(c=T.symbolType)!==null&&c!==void 0?c:"square"},Jr.horizontal),T),{pickable:!C}),"symbol");const V=Math.max(this._startHandler.AABBBounds.width(),j),X=Math.max(this._startHandler.AABBBounds.height(),j),Q=Math.max(this._endHandler.AABBBounds.width(),H),J=Math.max(this._endHandler.AABBBounds.height(),H);this._startHandlerMask=W.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:O.x+R*L-V/2,y:O.y+D/2-X/2,width:V,height:X,fill:"white",fillOpacity:0,zIndex:999},Jr.horizontal),{pickable:!C}),"rect"),this._endHandlerMask=W.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:O.x+I*L-Q/2,y:O.y+D/2-J/2,width:Q,height:J,fill:"white",fillOpacity:0,zIndex:999},Jr.horizontal),{pickable:!C}),"rect")}else{if(k.visible){const nt=((p=k.background)===null||p===void 0?void 0:p.size)||10;this._middleHandlerRect=W.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:y==="left"?O.x-nt:O.x+L,y:O.y+R*D,width:nt,height:(I-R)*D},(g=k.background)===null||g===void 0?void 0:g.style),{pickable:!C}),"rect"),this._middleHandlerSymbol=W.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:y==="left"?O.x-nt/2:O.x+L+nt/2,y:O.y+(R+I)/2*D,angle:Math.PI/180*90,symbolType:(_=(f=k.icon)===null||f===void 0?void 0:f.symbolType)!==null&&_!==void 0?_:"square",strokeBoundsBuffer:0},k.icon),{pickable:!C}),"symbol")}this._startHandler=W.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:O.x+L/2,y:O.y+R*D,size:L,symbolType:(m=w.symbolType)!==null&&m!==void 0?m:"square"},Jr.vertical),w),{pickable:!C}),"symbol"),this._endHandler=W.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:O.x+L/2,y:O.y+I*D,size:L,symbolType:(v=T.symbolType)!==null&&v!==void 0?v:"square"},Jr.vertical),T),{pickable:!C}),"symbol");const V=Math.max(this._startHandler.AABBBounds.width(),j),X=Math.max(this._startHandler.AABBBounds.height(),j),Q=Math.max(this._endHandler.AABBBounds.width(),H),J=Math.max(this._endHandler.AABBBounds.height(),H);this._startHandlerMask=W.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:O.x+L/2+V/2,y:O.y+R*D-X/2,width:J,height:Q,fill:"white",fillOpacity:0,zIndex:999},Jr.vertical),{pickable:!C}),"rect"),this._endHandlerMask=W.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:O.x+L/2+Q/2,y:O.y+I*D-J/2,width:J,height:Q,fill:"white",fillOpacity:0,zIndex:999},Jr.vertical),{pickable:!C}),"rect")}this._showText&&this.renderText()}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:n}=this.getLayoutAttrFromConfig();let r,a;return this._isHorizontal?(r=[{x:e.x,y:e.y+n}],a=[{x:e.x+i,y:e.y+n}]):t==="left"?(r=[{x:e.x+i,y:e.y}],a=[{x:e.x+i,y:e.y+n}]):(r=[{x:e.x,y:e.y+n}],a=[{x:e.x,y:e.y}]),{basePointStart:r,basePointEnd:a}}getPreviewLinePoints(){const t=this._previewData.map(n=>({x:this._previewPointsX&&this._previewPointsX(n),y:this._previewPointsY&&this._previewPointsY(n)}));if(t.length===0)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){const t=this._previewData.map(n=>({x:this._previewPointsX&&this._previewPointsX(n),y:this._previewPointsY&&this._previewPointsY(n),x1:this._previewPointsX1&&this._previewPointsX1(n),y1:this._previewPointsY1&&this._previewPointsY1(n)}));if(t.length===0)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),t==="line"?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i={}}=this.attribute;t==="line"&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),t==="area"&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),t==="line"?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i={}}=this.attribute,{start:n,end:r}=this.state,{position:a,width:o,height:l}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?a.x+n*o:a.x,y:this._isHorizontal?a.y:a.y+n*l,width:this._isHorizontal?(r-n)*o:o,height:this._isHorizontal?l:(r-n)*l,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?a.x+n*o:a.x),y:-(this._isHorizontal?a.y:a.y+n*l),width:this._isHorizontal?(r-n)*o:o,height:this._isHorizontal?l:(r-n)*l,pickable:!1}),t==="line"&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),t==="area"&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}maybeAddLabel(t,e,i){let n=this.find(r=>r.name===i,!0);return n?n.setAttributes(e):(n=new Fn(e),n.name=i),t.add(n),n}setStartAndEnd(t,e){const{start:i,end:n}=this.attribute;E(t)&&E(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,i===this.state.start&&n===this.state.end||(this.setStateAttr(t,e,!0),this._dispatchEvent("change",{start:t,end:e,tag:this._activeTag})))}setPreviewData(t){this._previewData=t}setText(t,e){e==="start"?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,e,i,n;const{middleHandlerStyle:r={}}=this.attribute,a=(e=(t=r.background)===null||t===void 0?void 0:t.size)!==null&&e!==void 0?e:10,o=(n=(i=r.icon)===null||i===void 0?void 0:i.size)!==null&&n!==void 0?n:10;return Math.max(a,...Y(o))}setPreviewPointsX(t){K(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){K(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){K(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){K(t)&&(this._previewPointsY1=t)}setStatePointToData(t){K(t)&&(this._statePointToData=t)}};RI.defaultAttributes=P6;var sx;(function(s){s.start="start",s.middle="middle",s.end="end",s.insideStartTop="insideStartTop",s.insideStartBottom="insideStartBottom",s.insideMiddleTop="insideMiddleTop",s.insideMiddleBottom="insideMiddleBottom",s.insideEndTop="insideEndTop",s.insideEndBottom="insideEndBottom"})(sx||(sx={}));var nx;(function(s){s.left="left",s.right="right",s.top="top",s.bottom="bottom",s.middle="middle",s.insideLeft="insideLeft",s.insideRight="insideRight",s.insideTop="insideTop",s.insideBottom="insideBottom"})(nx||(nx={}));var rx;(function(s){s.top="top",s.bottom="bottom",s.middle="middle",s.insideTop="insideTop",s.insideBottom="insideBottom",s.insideMiddle="insideMiddle"})(rx||(rx={}));class HS extends gi{constructor(){super(...arguments),this.name="marker"}setAttribute(t,e,i){super.setAttribute(t,e,i),t==="visible"&&this.render()}_initContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;let r;if(n){const a=_t.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));r=_t.group({x:-((t=i.x)!==null&&t!==void 0?t:0),y:-((e=i.y)!==null&&e!==void 0?e:0),pickable:!1}),a.add(r),this._containerClip=a,this.add(a)}else r=_t.group({x:0,y:0,pickable:!1}),this.add(r);r.name="marker-container",this._container=r}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:n?-((t=i.x)!==null&&t!==void 0?t:0):0,y:n?-((e=i.y)!==null&&e!==void 0?e:0):0})}render(){var t;this.setAttribute("pickable",!1);const e=(t=this.attribute.visible)===null||t===void 0||t;this.attribute.interactive===!1&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker()):(this._initContainer(),this.initMarker(this._container)):(this._container=null,this.removeAllChild())}}const O6={startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:sx.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},I6={start:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},L6={label:{position:nx.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},B6={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},D6={itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10,symbolStyle:{symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},textStyle:{dx:0,dy:0},imageStyle:{width:80,height:80},richTextStyle:{width:100,height:100}}},F6={top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}};function II(s,t){const{x1:e,y1:i,x2:n,y2:r}=t,{x1:a,y1:o,x2:l,y2:h}=s.AABBBounds;let d=0,u=0;return a<e&&(d=e-a),o<i&&(u=i-o),l>n&&(d=n-l),h>r&&(u=r-h),{dx:d,dy:u}}function LI(s,t){const{dx:e,dy:i}=II(s,t),{dx:n=0,dy:r=0}=s.attribute;e&&s.setAttribute("dx",e+n),i&&s.setAttribute("dy",i+r)}function NS(){qe(),Pm()}function j6(){NS(),jS()}function z6(){NS(),Mm()}function H6(){NS(),jS(),Dn(),hI(),qa()}j6();let BI=class DI extends HS{getLine(){return this._line}getLabel(){return this._label}constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},DI.defaultAttributes,t)),this.name="markLine"}setLabelPos(){var t,e;const{label:i={},limitRect:n}=this.attribute,{position:r="end",refX:a=0,refY:o=0,confine:l}=i,h=this._line.getMainSegmentPoints(),d=(t=this._line.getEndAngle())!==null&&t!==void 0?t:0,u=a*Math.cos(d)+o*Math.cos(d-Math.PI/2),c=a*Math.sin(d)+o*Math.sin(d-Math.PI/2);let p;if(p=r.includes("start")||r.includes("Start")?{x:h[0].x+u,y:h[0].y+c}:r.includes("middle")||r.includes("Middle")?{x:(h[0].x+h[h.length-1].x)/2+u,y:(h[0].y+h[h.length-1].y)/2+c}:{x:h[h.length-1].x+u,y:h[h.length-1].y+c},this._label.setAttributes(Object.assign(Object.assign({},p),{angle:i.autoRotate?d+((e=i.refAngle)!==null&&e!==void 0?e:0):0,textStyle:Object.assign(Object.assign({},I6[r]),i.textStyle)})),n&&l){const{x:g,y:f,width:_,height:m}=n;LI(this._label,{x1:g,y1:f,x2:g+_,y2:f+m})}}initMarker(t){const{points:e,startSymbol:i,endSymbol:n,label:r,lineStyle:a,mainSegmentIndex:o,multiSegment:l}=this.attribute,h=new Jh({points:e,startSymbol:i,endSymbol:n,lineStyle:a,mainSegmentIndex:o,multiSegment:l,pickable:!1});h.name="mark-line-line",this._line=h,t.add(h);const d=new Fn(Object.assign({},r));d.name="mark-line-label",this._label=d,t.add(d),this.setLabelPos()}updateMarker(){const{points:t,startSymbol:e,endSymbol:i,label:n,lineStyle:r,mainSegmentIndex:a,multiSegment:o}=this.attribute;this._line&&this._line.setAttributes({points:t,startSymbol:e,endSymbol:i,lineStyle:r,mainSegmentIndex:a,multiSegment:o}),this._label&&this._label.setAttributes(Object.assign({dx:0,dy:0},n)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<2)return!1;let e=!0;return t.forEach(i=>{if(i.length)i.forEach(n=>{N(n.x)&&N(n.y)||(e=!1)});else if(!N(i.x)||!N(i.y))return void(e=!1)}),e}};BI.defaultAttributes=O6;z6();let FI=class jI extends HS{getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},jI.defaultAttributes,t)),this.name="markArea"}_getPositionByDirection(t,e){const{x1:i,x2:n,y1:r,y2:a}=this._area.AABBBounds;return e.includes("left")||e.includes("Left")?{x:i,y:(r+a)/2}:e.includes("right")||e.includes("Right")?{x:n,y:(r+a)/2}:e.includes("top")||e.includes("Top")?{x:(i+n)/2,y:r}:e.includes("bottom")||e.includes("Bottom")?{x:(i+n)/2,y:a}:{x:(i+n)/2,y:(r+a)/2}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,i=(t=e.position)!==null&&t!==void 0?t:"middle",n=this._getPositionByDirection(this._area,i);if(this._label.setAttributes(Object.assign(Object.assign({},n),{textStyle:Object.assign(Object.assign({},B6[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:r,y:a,width:o,height:l}=this.attribute.limitRect;LI(this._label,{x1:r,y1:a,x2:r+o,y2:a+l})}}}initMarker(t){const{points:e,label:i,areaStyle:n}=this.attribute,r=_t.polygon(Object.assign({points:e},n));r.name="mark-area-area",this._area=r,t.add(r);const a=new Fn(Object.assign({},i));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){const{points:t,label:e,areaStyle:i}=this.attribute;this._area&&this._area.setAttributes(Object.assign({points:t},i)),this._area&&this._label.setAttributes(Object.assign({dx:0,dy:0},e)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<3)return!1;let e=!0;return t.forEach(i=>{N(i.x)&&N(i.y)||(e=!1)}),e}};FI.defaultAttributes=L6;H6();let GS=class zI extends HS{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},zI.defaultAttributes,t)),this.name="markPoint"}setLabelPos(){}setItemAttributes(t,e,i,n){var r;if(!t)return;const{autoRotate:a=!0,refX:o=0,refY:l=0,refAngle:h=0,textStyle:d={},richTextStyle:u={},imageStyle:c={},position:p=rx.middle}=e,g=((r=this._line)===null||r===void 0?void 0:r.getEndAngle())||0,f=o*Math.cos(g)+l*Math.cos(g-Math.PI/2),_=o*Math.sin(g)+l*Math.sin(g-Math.PI/2);n==="text"?t.setAttributes(Object.assign(Object.assign({},d),{textStyle:Object.assign(Object.assign({},F6[(e==null?void 0:e.position)||"end"]),d.textStyle)})):n==="richText"?t.setAttributes({dx:this.getItemDx(t,p,u)+(u.dx||0),dy:this.getItemDy(t,p,u)+(u.dy||0)}):n==="image"&&t.setAttributes({dx:this.getItemDx(t,p,c)+(c.dx||0),dy:this.getItemDy(t,p,c)+(c.dy||0)}),t.setAttributes({x:i.x+(f||0),y:i.y+(_||0),angle:a&&g+h})}getItemDx(t,e,i){var n,r;const a=(r=(n=t==null?void 0:t.AABBBounds)===null||n===void 0?void 0:n.width())!==null&&r!==void 0?r:(i==null?void 0:i.width)||0;return e.includes("inside")?-a:0}getItemDy(t,e,i){var n,r;const a=(r=(n=t==null?void 0:t.AABBBounds)===null||n===void 0?void 0:n.height())!==null&&r!==void 0?r:(i==null?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-a:e.includes("middle")||e.includes("Middle")?-a/2:0}initItem(t,e){const{type:i="text",symbolStyle:n,richTextStyle:r,imageStyle:a,renderCustomCallback:o}=t;let l;return i==="symbol"?l=_t.symbol(Object.assign(Object.assign({},e),n)):i==="text"?l=new Fn(Object.assign({},e)):i==="richText"?l=_t.richtext(Object.assign(Object.assign({},e),r)):i==="image"?l=_t.image(Object.assign(Object.assign({},e),a)):i==="custom"&&o&&(l=o()),this.setItemAttributes(l,t,e,i),l}getItemLineAttr(t,e,i){let n=[];const{type:r="type-s"}=t;return n=r==="type-do"?[e,{x:(e.x+i.x)/2,y:i.y},i]:r==="type-po"?[e,{x:i.x,y:e.y},i]:r==="type-op"?[e,{x:e.x,y:i.y},i]:[e,i],n}setItemLineAttr(t,e,i,n){if(this._line){const{startSymbol:r,endSymbol:a,lineStyle:o}=t,l=this.getItemLineAttr(t,e,i);this._line.setAttributes({points:l,startSymbol:r,endSymbol:a,lineStyle:o,visible:n})}}getDecorativeLineAttr(t,e){var i;const n=((i=t==null?void 0:t.decorativeLine)===null||i===void 0?void 0:i.length)||10,r=this._line.getEndAngle()||0;return{startPointOffsetX:n/2*Math.cos(r-Math.PI/2),startPointOffsetY:n/2*Math.sin(r-Math.PI/2),endPointOffsetX:-n/2*Math.cos(r-Math.PI/2),endPointOffsetY:-n/2*Math.sin(r-Math.PI/2)}}setDecorativeLineAttr(t,e,i){if(this._decorativeLine){const{lineStyle:n}=t,{startPointOffsetX:r,startPointOffsetY:a,endPointOffsetX:o,endPointOffsetY:l}=this.getDecorativeLineAttr(t,e);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+r,y:e.y+a},{x:e.x+o,y:e.y+l}]},n),{visible:i}))}}setAllOfItemsAttr(t){var e;const{position:i,itemLine:n={},itemContent:r={},limitRect:a}=this.attribute,{type:o="text",confine:l}=r;if(a&&l){const{x:h,y:d,width:u,height:c}=a,{dx:p,dy:g}=II(this._item,{x1:h,y1:d,x2:h+u,y2:d+c});t.x=t.x+p,t.y=t.y+g}this.setItemAttributes(this._item,r,t,o),this.setItemLineAttr(n,i,t,n.visible),this.setDecorativeLineAttr(n,t,(e=n.decorativeLine)===null||e===void 0?void 0:e.visible)}initMarker(t){const{position:e,itemContent:i={}}=this.attribute,n={x:e.x+(i.offsetX||0),y:e.y+(i.offsetY||0)},r=new Jh({points:[],pickable:!1});r.name="mark-point-line",this._line=r,t.add(r);const a=_t.line({points:[]});a.name="mark-point-decorativeLine",this._decorativeLine=a,t.add(a);const o=this.initItem(i,n);this._item=o,this.setAllOfItemsAttr(n),t.add(o)}updateMarker(){const{position:t,itemContent:e={}}=this.attribute,{type:i="text"}=e,n={x:t.x+(e.offsetX||0),y:t.y+(e.offsetY||0)};this.setItemAttributes(this._item,e,n,i),this.setAllOfItemsAttr(n)}isValidPoints(){const{position:t}=this.attribute;return!(!N(t.x)||!N(t.y))}};GS.defaultAttributes=D6;function HI(){qe(),Dn(),Ja()}const NI={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};HI();class Uu extends gi{getCurrent(){return this._current}constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Uu.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=i=>{const n=i.target;n.hasState("disable")||n.addState("hover")},this._onUnHover=i=>{i.target.removeState("hover")},this._onClick=i=>{const n=i.target;if(n.name==="preHandler"){if(this._current===1)return;this._current-=1,this._current===1?n.addState("disable"):n.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:i})}if(n.name==="nextHandler"){if(this._current===this._total)return;this._current+=1,this._current===this._total?n.addState("disable"):n.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:i})}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",`${this._current}/${this._total}`)}}render(){var t,e;this._reset();const{layout:i="horizontal",handler:n=NI,total:r,defaultCurrent:a=1,textStyle:o,padding:l=0}=this.attribute;this._current=a;const h=_s(l),d=i==="horizontal",u=_t.group({x:0,y:0}),c=n.style||{},p=c.size||15,g=(t=n.space)!==null&&t!==void 0?t:8,f=n.state||{};let{preShape:_,nextShape:m}=n;_||(_=d?"triangleLeft":"triangleUp"),m||(m=d?"triangleRight":"triangleDown");const v=_t.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:0,y:0,symbolType:_,size:p}));v.states=f,v.name="preHandler",this.preHandler=v,u.add(v);const{width:y,height:b}=Cm(`${r}/${r}`,Object.assign({textAlign:"center",textBaseline:"middle"},o),(e=this.stage)===null||e===void 0?void 0:e.getTheme().text.fontFamily),x=dt(p)?p:p[0],S=dt(p)?p:p[1],A=_t.text(Object.assign({x:d?x/2+g+y/2:0,y:d?0:S/2+g+b/2,text:`${a}/${r}`,textAlign:"center",textBaseline:"middle",lineHeight:o==null?void 0:o.fontSize},o));this.text=A,u.add(A);const k=_t.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:d?x+2*g+y:0,y:d?0:S+2*g+b,symbolType:m,size:p}));k.name="nextHandler",k.states=f,this.nextHandler=k,u.add(k),this._total===1?(v.addState("disable"),k.addState("disable")):this._current===1?v.addState("disable"):this._current===r&&k.addState("disable");const w=u.AABBBounds,T=w.width(),M=w.height();u.translateTo(0-w.x1+h[3],0-w.y1+h[0]),this.add(u),this.attribute.width=T+h[1]+h[3],this.attribute.height=M+h[0]+h[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}}Uu.defaultAttributes={handler:NI,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const h_=10,GI=8,WI=8,N6=8,ax=16,ox=8,Dc=12,VI=12;var Mt;(function(s){s.selected="selected",s.unSelected="unSelected",s.selectedHover="selectedHover",s.unSelectedHover="unSelectedHover",s.focus="focus"})(Mt||(Mt={}));var qs;(function(s){s.legendItemHover="legendItemHover",s.legendItemUnHover="legendItemUnHover",s.legendItemClick="legendItemClick",s.legendItemAttributeUpdate="legendItemAttributeUpdate"})(qs||(qs={}));var Li;(function(s){s.innerView="innerView",s.title="legendTitle",s.item="legendItem",s.itemShape="legendItemShape",s.itemLabel="legendItemLabel",s.itemValue="legendItemValue",s.focus="legendItemFocus"})(Li||(Li={}));class WS extends gi{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild();const{interactive:t=!0,title:e,padding:i=0}=this.attribute,n=_s(i),r=_t.group({x:n[3],y:n[0],pickable:t,childrenPickable:t});r.name=Li.innerView,this.add(r),this._innerView=r,e!=null&&e.visible&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();const a=this._innerView.AABBBounds;this.attribute.width=a.width()+n[1]+n[3],this.attribute.height=a.height()+n[0]+n[2]}_renderTitle(t){const{text:e="",textStyle:i,padding:n=0,background:r,minWidth:a,maxWidth:o,shape:l}=t,h={x:0,y:0,text:e,textStyle:i,padding:_s(n),minWidth:a,maxWidth:o};l&&l.visible&&(h.shape=Object.assign({visible:!0},l.style),E(l.space)&&(h.space=l.space)),r&&r.visible&&(h.panel=Object.assign({visible:!0},r.style));const d=new Fn(h);d.name=Li.title,this._title=d,this._innerView.add(d)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),n=(t=this.attribute.title)===null||t===void 0?void 0:t.align;n==="center"?this._title.setAttribute("x",(e-i)/2):n==="end"&&this._title.setAttribute("x",e-i)}}}function Hm(){qe(),Ja(),Vr(),Dn()}function VS(){qe(),Pm()}function G6(){VS(),HI()}function W6(){VS(),Hm()}function V6(){VS(),Hm(),Ic()}var U6=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};const $6={[Mt.focus]:{},[Mt.selected]:{},[Mt.selectedHover]:{},[Mt.unSelected]:{},[Mt.unSelectedHover]:{}};G6();let UI=class $I extends WS{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},$I.defaultAttributes,t)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=i=>{const n=i.target;if(n&&n.name&&n.name.startsWith(Li.item)){const r=n.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===r.id)return;this._unHover(this._lastActiveItem,i)}this._hover(r,i)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,i),this._lastActiveItem=null)},this._onUnHover=i=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,i),this._lastActiveItem=null)},this._onClick=i=>{var n,r,a,o;const l=i.target;if(l&&l.name&&l.name.startsWith(Li.item)){const h=l.delegate;if(l.name===Li.focus){const d=h.hasState(Mt.focus);h.toggleState(Mt.focus),d?(n=this._itemsContainer)===null||n===void 0||n.getChildren().forEach(u=>{this._removeLegendItemState(u,[Mt.unSelected,Mt.unSelectedHover,Mt.focus],i),this._setLegendItemState(u,Mt.selected,i)}):(this._setLegendItemState(h,Mt.selected,i),this._removeLegendItemState(h,[Mt.unSelected,Mt.unSelectedHover],i),(r=this._itemsContainer)===null||r===void 0||r.getChildren().forEach(u=>{h!==u&&(this._removeLegendItemState(u,[Mt.selected,Mt.selectedHover,Mt.focus],i),this._setLegendItemState(u,Mt.unSelected,i))}))}else{(a=this._itemsContainer)===null||a===void 0||a.getChildren().forEach(g=>{g.removeState(Mt.focus)});const{selectMode:d="multiple",allowAllCanceled:u=!0}=this.attribute,c=h.hasState(Mt.selected),p=this._getSelectedLegends();if(d==="multiple"){if(u===!1&&c&&p.length===1)return void this._dispatchLegendEvent(qs.legendItemClick,h,i);c?(this._removeLegendItemState(h,[Mt.selected,Mt.selectedHover],i),this._setLegendItemState(h,Mt.unSelected,i)):(this._setLegendItemState(h,Mt.selected,i),this._removeLegendItemState(h,[Mt.unSelected,Mt.unSelectedHover],i))}else this._setLegendItemState(h,Mt.selected,i),this._removeLegendItemState(h,[Mt.unSelected,Mt.unSelectedHover],i),(o=this._itemsContainer)===null||o===void 0||o.getChildren().forEach(g=>{h!==g&&(this._removeLegendItemState(g,[Mt.selected,Mt.selectedHover],i),this._setLegendItemState(g,Mt.unSelected,i))})}this._dispatchLegendEvent(qs.legendItemClick,h,i)}}}setSelected(t){var e;((e=this._itemsContainer)===null||e===void 0?void 0:e.getChildren()).forEach(i=>{const n=i.data;t.includes(n.label)?(this._setLegendItemState(i,Mt.selected),this._removeLegendItemState(i,[Mt.unSelected,Mt.unSelectedHover])):(this._removeLegendItemState(i,[Mt.selected,Mt.selectedHover]),this._setLegendItemState(i,Mt.unSelected))})}_renderContent(){const{item:t={},items:e,reversed:i,maxCol:n=1,maxRow:r=2}=this.attribute;if(t.visible===!1||vt(e))return;let a=e;i&&(a=e==null?void 0:e.reverse());const o=_t.group({x:0,y:0});this._itemsContainer=o;const{layout:l,maxWidth:h,maxHeight:d,defaultSelected:u=[],autoPage:c}=this.attribute,p=l==="horizontal",{spaceCol:g=ax,spaceRow:f=ox,maxWidth:_,width:m,height:v}=t;E(_)?E(m)?this._itemWidthByUser=Math.min(_,m):this._itemWidthByUser=_:E(m)&&(this._itemWidthByUser=m),E(v)&&(this._itemHeightByUser=v);let y=!1,b=0,x=0,S=0,A=1,k=1;a.forEach((T,M)=>{T.id||(T.id=T.label),T.index=M;const C=this._renderEachItem(T,!!vt(u)||(u==null?void 0:u.includes(T.label)),M,a),R=C.attribute.width,I=C.attribute.height;this._itemHeight=Math.max(this._itemHeight,I),b=Math.max(R,b),this._itemMaxWidth=Math.max(R,this._itemMaxWidth),p?(A=r,E(h)&&(R>=h?(y=!0,M>0&&(x=0,S+=I+f,k+=1)):h<x+R&&(y=!0,x=0,S+=I+f,k+=1)),M>0&&C.setAttributes({x,y:S}),x+=g+R):(A=n,E(d)&&d<S+I&&(y=!0,S=0,x+=b+g,b=0,k+=1),M>0&&C.setAttributes({x,y:S}),S+=f+I),o.add(C)});let w=!1;y&&c&&k>A&&(w=this._renderPager(p)),w||(o.setAttribute("y",this._title?this._title.AABBBounds.height()+It(this.attribute,"title.space",8):0),this._innerView.add(o))}_bindEvents(){if(this.attribute.disableTriggerEvent||!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_renderEachItem(t,e,i,n){var r,a;const{id:o,label:l,value:h,shape:d}=t,{padding:u=0,focus:c,focusIconStyle:p}=this.attribute.item,{shape:g,label:f,value:_,background:m}=this.attribute.item,v=this._handleStyle(g,t,e,i,n),y=this._handleStyle(f,t,e,i,n),b=this._handleStyle(_,t,e,i,n),x=this._handleStyle(m,t,e,i,n),S=_s(u);let A;m.visible===!1?(A=_t.group({x:0,y:0,cursor:(r=x.style)===null||r===void 0?void 0:r.cursor}),this._appendDataToShape(A,Li.item,t,A)):(A=_t.group(Object.assign({x:0,y:0},x.style)),this._appendDataToShape(A,Li.item,t,A,x.state)),A.id=`${o??l}-${i}`,A.addState(e?Mt.selected:Mt.unSelected);const k=_t.group({x:0,y:0,pickable:!1});A.add(k);let w,T=0,M=0,C=0;if(g&&g.visible!==!1){const V=It(v,"style.size",h_);M=$(V)?V[0]||0:V,C=It(g,"space",GI);const X=_t.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},d),v.style));Object.keys(v.state||{}).forEach(Q=>{const J=v.state[Q].fill||v.state[Q].stroke;d.fill&&P(v.state[Q].fill)&&J&&(v.state[Q].fill=J),d.stroke&&P(v.state[Q].stroke)&&J&&(v.state[Q].stroke=J)}),this._appendDataToShape(X,Li.itemShape,t,A,v.state),X.addState(e?Mt.selected:Mt.unSelected),k.add(X)}let R=0;if(c){const V=It(p,"size",h_);w=_t.symbol(Object.assign(Object.assign({x:0,y:-V/2-1,strokeBoundsBuffer:0},p),{visible:!0,pickMode:"imprecise",boundsPadding:S})),this._appendDataToShape(w,Li.focus,t,A),R=V}const I=_t.text(Object.assign(Object.assign({x:M/2+C,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(a=y.style)===null||a===void 0?void 0:a.fontSize},y.style),{text:f.formatMethod?f.formatMethod(l,t,i):l}));this._appendDataToShape(I,Li.itemLabel,t,A,y.state),I.addState(e?Mt.selected:Mt.unSelected),k.add(I);const O=It(f,"space",WI);if(E(h)){const V=It(_,"space",c?N6:0),X=_t.text(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:b.style.fontSize},b.style),{text:_.formatMethod?_.formatMethod(h,t,i):h}));if(this._appendDataToShape(X,Li.itemValue,t,A,b.state),X.addState(e?Mt.selected:Mt.unSelected),this._itemWidthByUser){const Q=this._itemWidthByUser-S[1]-S[3]-M-C-O-R-V,J=X.AABBBounds,nt=I.AABBBounds,q=J.width(),U=nt.width();U>Q?(Q-q)/U>.4?I.setAttribute("maxLineWidth",Q-q):(X.setAttribute("maxLineWidth",.5*Q),I.setAttribute("maxLineWidth",.5*Q)):X.setAttribute("maxLineWidth",Q-U),_.alignRight?X.setAttributes({textAlign:"right",x:this._itemWidthByUser-M/2-S[1]-S[3]-R-V}):X.setAttribute("x",I.AABBBounds.x2+V)}else X.setAttribute("x",I.AABBBounds.x2+V);T=X.AABBBounds.x2+V,k.add(X)}else this._itemWidthByUser&&I.setAttribute("maxLineWidth",this._itemWidthByUser-S[1]-S[3]-M-C-R),T=I.AABBBounds.x2+O;w&&(w.setAttribute("x",T),k.add(w));const L=k.AABBBounds,D=L.width(),j=L.height(),H=E(this.attribute.item.width)?this.attribute.item.width:D+S[1]+S[3],W=this._itemHeightByUser||j+S[0]+S[2];return A.attribute.width=H,A.attribute.height=W,w&&w.setAttribute("visible",!1),k.translateTo(-L.x1+S[3],-L.y1+S[0]),A}_renderPager(t){const e=this._title?this._title.AABBBounds.height()+It(this.attribute,"title.space",8):0,{maxWidth:i,maxHeight:n,maxCol:r=1,maxRow:a=2,item:o={},pager:l={},disableTriggerEvent:h}=this.attribute,{spaceCol:d=ax,spaceRow:u=ox}=o,c=this._itemsContainer,{animation:p=!0,animationDuration:g=450,animationEasing:f="quadIn",space:_=VI,position:m="middle"}=l,v=U6(l,["animation","animationDuration","animationEasing","space","position"]);let y,b=0,x=0,S=0,A=0,k=1;if(t){if(y=new Uu(Object.assign(Object.assign({layout:a===1?"horizontal":"vertical",total:99},lt({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},v)),{disableTriggerEvent:h})),this._pager=y,this._innerView.add(y),b=(a-1)*u+this._itemHeight*a,x=i-y.AABBBounds.width()-_,x<=0)return this._innerView.removeChild(y),!1;let M;c.getChildren().forEach((C,R)=>{const{width:I,height:O}=C.attribute;x<S+I&&(S=0,A+=O+u,k+=1),R>0&&C.setAttributes({x:S,y:A}),S+=d+I}),y.setAttribute("total",Math.ceil(k/a)),M=m==="start"?e:m==="end"?e+b-y.AABBBounds.height()/2:e+b/2-y.AABBBounds.height()/2,y.setAttributes({x,y:M})}else{if(y=new Uu(Object.assign({layout:"horizontal",total:99,disableTriggerEvent:h},v)),this._pager=y,this._innerView.add(y),x=this._itemMaxWidth*r+(r-1)*d,b=n-y.AABBBounds.height()-_-e,b<=0)return this._innerView.removeChild(y),!1;let M;c.getChildren().forEach((C,R)=>{const{height:I}=C.attribute;b<A+I&&(A=0,S+=this._itemMaxWidth+d,k+=1),R>0&&C.setAttributes({x:S,y:A}),A+=u+I}),y.setAttribute("total",Math.ceil(k/r)),M=m==="start"?0:m==="end"?x-y.AABBBounds.width():(x-y.AABBBounds.width())/2,y.setAttributes({x:M,y:n-y.AABBBounds.height()})}l.defaultCurrent>1&&(t?c.setAttribute("y",-(l.defaultCurrent-1)*(b+u)):c.setAttribute("x",-(l.defaultCurrent-1)*(x+d)));const w=_t.group({x:0,y:e,width:x,height:b,clip:!0,pickable:!1});w.add(c),this._innerView.add(w);const T=M=>{const{current:C}=M.detail;p?c.animate().to(t?{y:-(C-1)*(b+u)}:{x:-(C-1)*(x+d)},g,f):t?c.setAttribute("y",-(C-1)*(b+u)):c.setAttribute("x",-(C-1)*(x+d))};return this._pager.addEventListener("toPrev",T),this._pager.addEventListener("toNext",T),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(Mt.selected)?this._setLegendItemState(t,Mt.selectedHover,e):this._setLegendItemState(t,Mt.unSelectedHover,e);const i=t.getChildren()[0].find(n=>n.name===Li.focus,!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(qs.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(Mt.unSelectedHover)||t.hasState(Mt.selectedHover))&&(i=!0),t.removeState(Mt.unSelectedHover),t.removeState(Mt.selectedHover),t.getChildren()[0].getChildren().forEach(r=>{i||!r.hasState(Mt.unSelectedHover)&&!r.hasState(Mt.selectedHover)||(i=!0),r.removeState(Mt.unSelectedHover),r.removeState(Mt.selectedHover)});const n=t.getChildren()[0].find(r=>r.name===Li.focus,!1);n&&n.setAttribute("visible",!1),i&&this._dispatchLegendEvent(qs.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(qs.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let n=!1;t.hasState(e)||(n=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach(r=>{r.name!==Li.focus&&(n||r.hasState(e)||(n=!0),r.addState(e,!0))}),n&&this._dispatchLegendEvent(qs.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let n=!1;e.forEach(r=>{!n&&t.hasState(r)&&(n=!0),t.removeState(r)}),t.getChildren()[0].getChildren().forEach(r=>{r.name!==Li.focus&&e.forEach(a=>{!n&&r.hasState(a)&&(n=!0),r.removeState(a)})}),n&&this._dispatchLegendEvent(qs.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;const e=[];return(t=this._itemsContainer)===null||t===void 0||t.getChildren().forEach(i=>{i.hasState(Mt.selected)&&e.push(i.data)}),e}_appendDataToShape(t,e,i,n,r={}){t.name=e,t.data=i,t.delegate=n,t.states=lt({},$6,r)}_dispatchLegendEvent(t,e,i){const n=this._getSelectedLegends();n.sort((a,o)=>a.index-o.index);const r=n.map(a=>a.label);this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(Mt.selected),currentSelectedItems:n,currentSelected:r,event:i})}_handleStyle(t,e,i,n,r){const a={};return t.style&&(K(t.style)?a.style=t.style(e,i,n,r):a.style=t.style),t.state&&(a.state={},Object.keys(t.state).forEach(o=>{t.state[o]&&(K(t.state[o])?a.state[o]=t.state[o](e,i,n,r):a.state[o]=t.state[o])})),a}};UI.defaultAttributes={layout:"horizontal",title:{align:"start",space:Dc,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:ax,spaceRow:ox,shape:{space:GI,style:{size:h_,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:WI,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:h_,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:VI,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0};var Ii;(function(s){s.innerView="innerView",s.railContainer="sliderRailContainer",s.rail="sliderRail",s.startText="sliderStartText",s.endText="sliderEndText",s.startHandler="sliderStartHandler",s.startHandlerText="startHandlerText",s.endHandler="sliderEndHandler",s.endHandlerText="sliderEndHandlerText",s.track="sliderTrack",s.trackContainer="sliderTrackContainer"})(Ii||(Ii={}));function E0(s){return $(s)?s:[s,s]}function Wp(s){return s?"ew-resize":"ns-resize"}Hm();class Qh extends gi{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Qh.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onHandlerPointerdown=i=>{i.stopPropagation(),this._currentHandler=i.target,this._prePos=this._isHorizontal?i.clientX:i.clientY,Gt.env==="browser"?(Gt.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),Gt.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=i=>{var n,r;i.stopPropagation();const{railWidth:a,railHeight:o,min:l,max:h}=this.attribute;if(h===l)return;let d,u,c,p=0;this._isHorizontal?(d=i.clientX,p=d-this._prePos,u=(r=this._currentHandler)===null||r===void 0?void 0:r.attribute.x,c=a):(d=i.clientY,p=d-this._prePos,u=(n=this._currentHandler)===null||n===void 0?void 0:n.attribute.y,c=o);const g=xi(u+p,0,c),f=g/c*(h-l)+l;this._currentHandler.type==="text"?this._updateHandlerText(this._currentHandler,g,f):this._updateHandler(this._currentHandler,g,f),this._updateTrack(),this._prePos=d,this._dispatchChangeEvent()},this._onHandlerPointerUp=i=>{i.preventDefault(),this._currentHandler=null,Gt.env==="browser"?(Gt.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),Gt.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=i=>{i.stopPropagation(),this._prePos=this._isHorizontal?i.clientX:i.clientY,Gt.env==="browser"?(Gt.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),Gt.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=i=>{i.stopPropagation();const{railWidth:n,railHeight:r,min:a,max:o}=this.attribute;if(o===a)return;const{startHandler:l,endHandler:h}=this._getHandlers();let d,u,c;this._isHorizontal?(d=i.clientX,u=this._track.attribute.width,c=n):(d=i.clientY,u=this._track.attribute.height,c=r);const p=d-this._prePos;if(l){const g=this._isHorizontal?l.attribute.x:l.attribute.y,f=xi(g+p,0,c-u),_=f/c*(o-a)+a;this._updateHandler(l,f,_)}if(h){const g=this._isHorizontal?h.attribute.x:h.attribute.y,f=xi(g+p,u,c),_=f/c*(o-a)+a,m=l==null?void 0:l.attribute;this._updateHandler(h,f,_),this._track.setAttributes(this._isHorizontal?{x:Math.min(m.x,h.attribute.x),width:Math.abs(m.x-h.attribute.x)}:{y:Math.min(m.y,h.attribute.y),height:Math.abs(m.y-h.attribute.y)})}this._prePos=d,this._dispatchChangeEvent()},this._onTrackPointerUp=i=>{i.preventDefault(),Gt.env==="browser"?(Gt.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),Gt.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=i=>{i.stopPropagation();const{railWidth:n,railHeight:r,min:a,max:o}=this.attribute;if(o===a)return;const l=this._startHandler,h=this._endHandler;let d,u,c,p;this._isHorizontal?(d=i.viewX-this._rail.globalAABBBounds.x1,u=l==null?void 0:l.attribute.x,c=h==null?void 0:h.attribute.x,p=n):(d=i.viewY-this._rail.globalAABBBounds.y1,u=l==null?void 0:l.attribute.y,c=h==null?void 0:h.attribute.y,p=r);const g=d/p*(o-a)+a;if(E(c)){const f=Math.abs(d-u)>Math.abs(d-c)?h:l;this._updateHandler(f,d,g)}else this._updateHandler(l,d,g);this._updateTrack(),this._dispatchChangeEvent()}}setValue(t){const{layout:e,railWidth:i,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const[o,l]=Y(t),{startHandler:h,endHandler:d}=this._getHandlers(),u=e==="vertical"?n:i,c=(o-r)/(a-r)*u;if(h&&this._updateHandler(h,c,o),d){const p=(l-r)/(a-r)*u;this._updateHandler(d,p,l)}this._updateTrack()}render(){var t,e;this.removeAllChild();const{layout:i="horizontal",railWidth:n,railHeight:r,startText:a,endText:o,min:l,max:h,showHandler:d=!0}=this.attribute;let{value:u}=this.attribute;P(u)&&(u=[l,h]),this._currentValue={startValue:E0(u)[0],endValue:E0(u)[1]};const c=i==="horizontal";this._isHorizontal=c;const p=_t.group({x:0,y:0});p.name=Ii.innerView,this.add(p),this._innerView=p;let g,f=0;if(a&&a.visible){g=_t.text(Object.assign({x:c?0:n/2,y:c?r/2:0,textAlign:c?"start":"center",textBaseline:c?"middle":"top",text:a.text,lineHeight:(t=a.style)===null||t===void 0?void 0:t.fontSize},a.style)),g.name=Ii.startText,p.add(g);const y=E(a.space)?a.space:0;f+=(c?g.AABBBounds.width():g.AABBBounds.height())+y}const _=_t.group({x:c?f:0,y:c?0:f});p.add(_);const m=_t.group({x:0,y:0});let v;if(m.name=Ii.railContainer,this._railContainer=m,_.add(m),this._renderRail(m),f+=c?n:r,o&&o.visible){const y=E(o.space)?o.space:0;v=_t.text(Object.assign({x:c?f+y:n/2,y:c?r/2:f+y,textAlign:c?"start":"center",textBaseline:c?"middle":"top",text:o.text,lineHeight:(e=o.style)===null||e===void 0?void 0:e.fontSize},o.style)),v.name=Ii.endText,p.add(v)}this._renderTrack(m),d&&(this._renderHandlers(_),this._bindEvents())}_renderRail(t){const{railWidth:e,railHeight:i,railStyle:n,slidable:r}=this.attribute;let a="default";r!==!1&&(a="pointer");const o=_t.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:a},n));return o.name=Ii.rail,t.add(o),this._rail=o,o}_renderHandlers(t){const{range:e,min:i,max:n,handlerSize:r=14,handlerStyle:a,handlerText:o,railHeight:l,railWidth:h,slidable:d}=this.attribute;let{value:u}=this.attribute;P(u)&&(u=[i,n]);const c=o&&o.visible,p=this._isHorizontal,g=p?h:l,[f,_]=E0(u),m=n===i?e?0:g:(f-i)/(n-i)*g,v=this._renderHandler(Object.assign({x:p?m:h/2,y:p?l/2:m,size:r,strokeBoundsBuffer:0,cursor:d===!1?"default":Wp(p)},a));if(v.name=Ii.startHandler,this._startHandler=v,t.add(v),this._currentValue.startPos=m,c){const y=this._renderHandlerText(f,e?"start":"end");y.name=Ii.startHandlerText,t.add(y),this._startHandlerText=y}if(e){const y=n===i?g:(_-i)/(n-i)*g,b=this._renderHandler(Object.assign({x:p?y:h/2,y:p?l/2:y,size:r,strokeBoundsBuffer:0,cursor:d===!1?"default":Wp(p)},a));if(b.name=Ii.endHandler,this._endHandler=b,t.add(b),this._currentValue.endPos=y,c){const x=this._renderHandlerText(_,"end");x.name=Ii.endHandlerText,t.add(x),this._endHandlerText=x}}}_renderTrack(t){const{range:e,min:i,max:n,railHeight:r,railWidth:a,trackStyle:o,railStyle:l,slidable:h,value:d}=this.attribute;let u,c;if(P(d))e?(u=i,c=n):u=c=i;else if(e){const x=sa(d,i,n);u=x[0],c=x[1]}else u=i,c=xi(d,i,n);const p=this._isHorizontal,g=p?a:r;e||(u=i);const f=_t.group({x:0,y:0,width:a,height:r,cornerRadius:l==null?void 0:l.cornerRadius,clip:!0,pickable:!1});f.name=Ii.trackContainer;const _=$t(e)&&e.draggableTrack===!0;let m;m=h===!1?"default":e===!1||_===!1?"pointer":Wp(p);const v=n===i?g:(c-u)/(n-i)*g,y=n===i?0:(u-i)/(n-i)*g,b=_t.rect(Object.assign({x:p?y:0,y:p?0:y,width:p?v:a,height:p?r:v,cursor:m},o));b.name=Ii.track,this._track=b,f.add(b),t.add(f)}_renderHandler(t){return _t.symbol(t)}_renderHandlerText(t,e){var i,n,r;const{align:a,min:o,max:l,handlerSize:h=14,handlerText:d={},railHeight:u,railWidth:c,slidable:p}=this.attribute,g=this._isHorizontal,f=g?c:u,_=l===o?e==="start"?0:f:(t-o)/(l-o)*f,m=(i=d.space)!==null&&i!==void 0?i:4,v={text:d.formatter?d.formatter(t):t.toFixed((n=d.precision)!==null&&n!==void 0?n:0),lineHeight:(r=d.style)===null||r===void 0?void 0:r.lineHeight,cursor:p===!1?"default":Wp(g)};return g?a==="top"?(v.textBaseline="bottom",v.textAlign="center",v.x=_,v.y=(u-h)/2-m):(v.textBaseline="top",v.textAlign="center",v.x=_,v.y=(u+h)/2+m):a==="left"?(v.textBaseline="middle",v.textAlign="end",v.x=(c-h)/2-m,v.y=_):(v.textBaseline="middle",v.textAlign="start",v.x=(c+h)/2+m,v.y=_),_t.text(Object.assign(Object.assign({},v),d.style))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),$t(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_updateTrack(){const t=this._startHandler,e=this._endHandler;if(this._isHorizontal){const i=t==null?void 0:t.attribute.x;if(e){const n=e==null?void 0:e.attribute.x;this._track.setAttributes({x:Math.min(i,n),width:Math.abs(i-n)})}else this._track.setAttributes({width:i})}else{const i=t==null?void 0:t.attribute.y;if(e){const n=e==null?void 0:e.attribute.y;this._track.setAttributes({y:Math.min(i,n),height:Math.abs(i-n)})}else this._track.setAttributes({height:i})}}_updateHandler(t,e,i){var n;const r=this._isHorizontal;t.setAttribute(r?"x":"y",e);const a=t.name===Ii.startHandler?this._startHandlerText:this._endHandlerText;if(a){const{handlerText:o={}}=this.attribute;a.setAttributes({text:o.formatter?o.formatter(i):i.toFixed((n=o.precision)!==null&&n!==void 0?n:0),[r?"x":"y"]:e})}t.name===Ii.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var n;const r=this._isHorizontal,{handlerText:a={}}=this.attribute;t.setAttributes({[r?"x":"y"]:e,text:a.formatter?a.formatter(i):i.toFixed((n=a.precision)!==null&&n!==void 0?n:0)});const o=t.name===Ii.startHandlerText?this._startHandler:this._endHandler;o&&o.setAttributes({[r?"x":"y"]:e}),t.name===Ii.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_getHandlers(){let t,e=this._startHandler,i=this._endHandler;return this._isHorizontal?i&&i.attribute.x<(e==null?void 0:e.attribute.x)&&(t=e,e=i,i=t):i&&i.attribute.y<(e==null?void 0:e.attribute.y)&&(t=e,e=i,i=t),{startHandler:e,endHandler:i}}}Qh.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}};W6();class Nm extends WS{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Nm.defaultAttributes,t)),this.name="colorLegend",this._onSliderChange=i=>{this._updateColor(),this.dispatchEvent(i)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:i,align:n,min:r,max:a,value:o,railWidth:l,railHeight:h,showHandler:d=!0,handlerSize:u,handlerStyle:c,railStyle:p,trackStyle:g,startText:f,endText:_,handlerText:m,showTooltip:v,tooltip:y,disableTriggerEvent:b}=this.attribute,x=[],S=(a-r)/(t.length-1);for(let k=0;k<t.length;k++)x.push(r+S*k);this._colorScale=new un().domain(x,!0).range(t),this._color=this._getTrackColor();const A=new Qh({x:0,y:0,range:{draggableTrack:!0},slidable:e,layout:i,align:n,min:r,max:a,value:o,railWidth:l,railHeight:h,showHandler:d,handlerSize:u,handlerStyle:c,railStyle:p,trackStyle:Object.assign({fill:this._color},g),startText:f,endText:_,handlerText:m,showTooltip:v,tooltip:y,disableTriggerEvent:b});this._innerView.add(A),this._slider=A,A.translateTo(0-A.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+It(this.attribute,"title.space",Dc):0)-A.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}_getTrackColor(){const{colors:t,layout:e}=this.attribute;if(vt(t))return;const i=t.length;if(i===1)return t[0];const n=[];for(let a=0;a<i;a++){const o=a/(i-1);n.push({offset:o,color:t[a]})}const r=e==="horizontal";return{gradient:"linear",stops:n,x0:0,y0:0,x1:r?1:0,y1:r?0:1}}_updateColor(){const{layout:t="horizontal",colors:e,railWidth:i,railHeight:n}=this.attribute,{startHandler:r,endHandler:a,track:o}=this._slider,{startValue:l,endValue:h,startPos:d,endPos:u}=this._slider.currentValue,c=this._colorScale.scale(l),p=this._colorScale.scale(h);r==null||r.setAttribute("fill",c),a==null||a.setAttribute("fill",p);const g=t==="horizontal"?i:n;if(Math.abs(d-u)!==g&&e&&e.length>1){const f=this._color.stops,_=Math.min(d,u),m=Math.max(d,u),v=_/g,y=m/g,b=y-v,x=f.filter(M=>M.offset>v&&M.offset<y),S=Math.min(l,h),A=Math.max(l,h),k=this._colorScale.scale(S),w=this._colorScale.scale(A),T=[{offset:0,color:k}];x.forEach(M=>{T.push({offset:(M.offset-v)/b,color:M.color})}),T.push({offset:1,color:w}),o.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:T}))}}}Nm.defaultAttributes={layout:"horizontal",title:{align:"start",space:Dc,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}}};function Y6(s="bottom"){let t=0;return s==="top"?`
|
||
M${t},-6L${t-3.5},-2.5
|
||
v5
|
||
h7
|
||
v-5
|
||
Z
|
||
`:s==="left"?(t=1,`
|
||
M${t-6},0L${t-6+2.5},-3.5
|
||
h5
|
||
v7
|
||
h-5
|
||
Z
|
||
`):s==="right"?(t=-1,`
|
||
M${t+6},0L${t+6-2.5},-3.5
|
||
h-5
|
||
v7
|
||
h5
|
||
Z
|
||
`):`
|
||
M${t},6L${t-3.5},2.5
|
||
v-5
|
||
h7
|
||
v5
|
||
Z
|
||
`}V6();class Gm extends WS{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Gm.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=i=>{this.dispatchEvent(i)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:e,align:i,min:n,max:r,value:a,railWidth:o,railHeight:l,showHandler:h=!0,handlerSize:d,handlerStyle:u,railStyle:c,trackStyle:p,startText:g,endText:f,handlerText:_,showTooltip:m,tooltip:v,sizeBackground:y,disableTriggerEvent:b}=this.attribute,x=_t.group({x:0,y:0});this._innerView.add(x);const S=new Qh({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:n,max:r,value:a,railWidth:o,railHeight:l,showHandler:h,handlerSize:d,handlerStyle:Object.assign({symbolType:Y6(i)},u),railStyle:c,trackStyle:p,startText:g,endText:f,handlerText:_,showTooltip:m,tooltip:v,disableTriggerEvent:b});x.add(S);let A,k=0;e==="horizontal"?i==="top"?(A=`M0,0L${o},0L${o},12Z`,k=l):(A=`M0,12L${o},12L${o},0Z`,S.setAttribute("y",12)):i==="left"?A=`M${o},0L${o},0L${o+12},${l}L${o},${l}Z`:(A=`M0,${l}L12,${l}L12,0Z`,S.setAttribute("x",12));const w=_t.path(Object.assign(Object.assign({x:0,y:k,path:A},y),{zIndex:0}));x.add(w);const T=this._title?this._title.AABBBounds.height()+It(this.attribute,"title.space",Dc):0;x.translate(0-x.AABBBounds.x1,T-x.AABBBounds.y1),this._slider=S}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}Gm.defaultAttributes={layout:"horizontal",title:{align:"start",space:Dc,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};function X6(){qe(),dI(),Za()}X6();let YI=class XI extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},XI.defaultAttributes,t)),this.name="title"}render(){var t,e,i,n,r,a,o,l,h,d,u,c,p,g,f,_,m,v,y,b,x,S,A,k,w,T,M,C,R,I,O,L,D,j,H,W,V,X,Q,J,nt,q;const{textType:U,text:it,subtextType:ut,textStyle:ct={},subtext:Rt,subtextStyle:mt={},width:Tt,height:kt,minWidth:Lt,maxWidth:Ot,minHeight:fi,maxHeight:Pe,align:Wi,verticalAlign:si,padding:xs=0}=this.attribute,pe=_s(xs),Ae=this.createOrUpdateChild("title-container",{x:pe[3],y:pe[0],zIndex:1},"group");if(this.attribute.visible!==!1&&ct.visible!==!1)if(U==="rich"||E(ct.character)){const oe=Object.assign({x:(t=ct.x)!==null&&t!==void 0?t:0,y:(e=ct.y)!==null&&e!==void 0?e:0,width:(n=(i=ct.width)!==null&&i!==void 0?i:Tt)!==null&&n!==void 0?n:0,height:(a=(r=ct.height)!==null&&r!==void 0?r:kt)!==null&&a!==void 0?a:0,ellipsis:(o=ct.ellipsis)===null||o===void 0||o,wordBreak:(l=ct.wordBreak)!==null&&l!==void 0?l:"break-word",maxHeight:ct.maxHeight,maxWidth:ct.maxWidth,textConfig:(h=ct.character)!==null&&h!==void 0?h:it},ct);this._mainTitle=Ae.createOrUpdateChild("mainTitle",oe,"richtext")}else if(U==="html"){const oe=Object.assign({html:Object.assign(Object.assign({dom:it},zr),ct),x:(d=ct.x)!==null&&d!==void 0?d:0,y:(u=ct.y)!==null&&u!==void 0?u:0,width:(p=(c=ct.width)!==null&&c!==void 0?c:Tt)!==null&&p!==void 0?p:0,height:(f=(g=ct.height)!==null&&g!==void 0?g:kt)!==null&&f!==void 0?f:0,ellipsis:(_=ct.ellipsis)===null||_===void 0||_,wordBreak:(m=ct.wordBreak)!==null&&m!==void 0?m:"break-word",maxHeight:ct.maxHeight,maxWidth:ct.maxWidth,textConfig:[]},ct);this._mainTitle=Ae.createOrUpdateChild("mainTitle",oe,"richtext")}else E(it)&&(this._mainTitle=Ae.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:$(it)?it:[it]},ct),{maxLineWidth:(v=ct.maxLineWidth)!==null&&v!==void 0?v:Tt,heightLimit:ct.heightLimit,lineClamp:ct.lineClamp,ellipsis:(y=ct.ellipsis)===null||y===void 0||y,x:0,y:0}),"wrapText"));const Ms=this._mainTitle?this._mainTitle.AABBBounds.height():0,rs=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(this.attribute.visible!==!1&&mt.visible!==!1)if(ut==="rich"||E(mt.character)){const oe=Object.assign({x:(b=mt.x)!==null&&b!==void 0?b:0,y:(x=mt.y)!==null&&x!==void 0?x:0,width:(A=(S=mt.width)!==null&&S!==void 0?S:Tt)!==null&&A!==void 0?A:0,height:(w=(k=mt.height)!==null&&k!==void 0?k:kt)!==null&&w!==void 0?w:0,ellipsis:(T=mt.ellipsis)===null||T===void 0||T,wordBreak:(M=mt.wordBreak)!==null&&M!==void 0?M:"break-word",maxHeight:mt.maxHeight,maxWidth:mt.maxWidth,textConfig:(C=mt.character)!==null&&C!==void 0?C:Rt},mt);this._subTitle=Ae.createOrUpdateChild("subTitle",oe,"richtext")}else if(ut==="html"){const oe=Object.assign({html:Object.assign(Object.assign({dom:Rt},zr),mt),x:(R=mt.x)!==null&&R!==void 0?R:0,y:(I=mt.y)!==null&&I!==void 0?I:0,width:(L=(O=mt.width)!==null&&O!==void 0?O:Tt)!==null&&L!==void 0?L:0,height:(j=(D=mt.height)!==null&&D!==void 0?D:kt)!==null&&j!==void 0?j:0,ellipsis:(H=mt.ellipsis)===null||H===void 0||H,wordBreak:(W=mt.wordBreak)!==null&&W!==void 0?W:"break-word",maxHeight:mt.maxHeight,maxWidth:mt.maxWidth,textConfig:[]},mt);this._subTitle=Ae.createOrUpdateChild("subTitle",oe,"richtext")}else E(Rt)&&(this._subTitle=Ae.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:$(Rt)?Rt:[Rt]},mt),{maxLineWidth:(V=mt.maxLineWidth)!==null&&V!==void 0?V:Tt,heightLimit:mt.heightLimit,lineClamp:mt.lineClamp,ellipsis:(X=mt.ellipsis)===null||X===void 0||X,x:0,y:Ms}),"wrapText"));const dr=this._subTitle?this._subTitle.AABBBounds.height():0,zn=this._subTitle?this._subTitle.AABBBounds.width():0;let hi=Math.max(rs,zn),Be=Ms+((Q=mt.height)!==null&&Q!==void 0?Q:dr);if(E(Tt)&&(hi=Tt,this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",Tt),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",Tt)),E(kt)&&(Be=kt),E(Lt)&&hi<Lt&&(hi=Lt),E(Ot)&&(this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",Ot),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",Ot),this._mainTitle&&this._mainTitle.setAttribute("maxWidth",Ot),this._subTitle&&this._subTitle.setAttribute("maxWidth",Ot),hi>Ot&&(hi=Ot)),E(fi)&&Be<fi&&(Be=fi),E(Pe)&&(this._mainTitle&&this._mainTitle.setAttribute("maxHeight",Pe),this._subTitle&&this._subTitle.setAttribute("maxHeight",Pe-Ms),Be>Pe&&(Be=Pe)),Ae.attribute.width=hi,Ae.attribute.height=Be,Ae.attribute.boundsPadding=pe,this._mainTitle){if(E(Wi)||E(ct.align)){const oe=ct.align?ct.align:Wi,Ne=(J=ct.width)!==null&&J!==void 0?J:rs;oe==="left"?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):oe==="center"?(this._mainTitle.setAttribute("x",Ne/2),this._mainTitle.setAttribute("textAlign","center")):oe==="right"&&(this._mainTitle.setAttribute("x",Ne),this._mainTitle.setAttribute("textAlign","right"))}if(E(si)||E(ct.verticalAlign)){const oe=ct.verticalAlign?ct.verticalAlign:si,Ne=ct.height?ct.height:Be;oe==="top"?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):oe==="middle"?(this._mainTitle.setAttribute("y",Ne/2),this._mainTitle.setAttribute("textBaseline","middle")):oe==="bottom"&&(this._mainTitle.setAttribute("y",Ne),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(E(Wi)||E(mt.align)){const oe=mt.align?mt.align:Wi,Ne=(nt=mt.width)!==null&&nt!==void 0?nt:zn;oe==="left"?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):oe==="center"?(this._subTitle.setAttribute("x",Ne/2),this._subTitle.setAttribute("textAlign","center")):oe==="right"&&(this._subTitle.setAttribute("x",Ne),this._subTitle.setAttribute("textAlign","right"))}if(E(si)||E(ct.verticalAlign)){const oe=mt.verticalAlign?mt.verticalAlign:si,Ne=Ms,fn=(q=mt.height)!==null&&q!==void 0?q:0;oe==="top"?(this._subTitle.setAttribute("y",Ne),this._subTitle.setAttribute("textBaseline","top")):oe==="middle"?(this._subTitle.setAttribute("y",Ne+fn/2),this._subTitle.setAttribute("textBaseline","middle")):oe==="bottom"&&(this._subTitle.setAttribute("y",Ne+fn),this._subTitle.setAttribute("textBaseline","bottom"))}}}};YI.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};const GM={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};function K6(){qe(),Ja(),Za()}K6();let q6=class extends gi{constructor(){super(...arguments),this.name="indicator"}render(){var t,e,i;const{visible:n,title:r={},content:a,size:o,limitRatio:l=1/0}=this.attribute,h=Math.min(o.width,o.height)*l,d=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1},"group");if(n!==!0)return void(d&&d.hideAll());if(E(r))if(r.visible!==!1){const c=lt({},It(GM,"title.style"),r.style);c.type==="rich"?this._title=d.createOrUpdateChild("indicator-title",Object.assign(Object.assign({textConfig:c.text},c),{visible:r.visible,x:0,y:0,width:(t=c.width)!==null&&t!==void 0?t:0,height:(e=c.height)!==null&&e!==void 0?e:0}),"richtext"):c.type==="html"?this._title=d.createOrUpdateChild("indicator-title",Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:c.text},zr),c)},c),{visible:r.visible,x:0,y:0}),"richtext"):this._title=d.createOrUpdateChild("indicator-title",Object.assign(Object.assign({},c),{lineHeight:E(c.lineHeight)?c.lineHeight:c.fontSize,visible:r.visible,x:0,y:0}),"text"),r.autoFit&&N(h)&&this._setLocalAutoFit(h,this._title,r),r.autoLimit&&N(l)&&this._title.setAttribute("maxLineWidth",h)}else{const c=d.find(p=>p.name==="indicator-title",!1);c&&d.removeChild(c),this._title=void 0}if(E(a)){const c=Y(a),p=[];c.forEach((g,f)=>{var _,m;if(g.visible!==!1){const v=lt({},It(GM,"content.style"),g.style);let y;y=v.type==="rich"?d.createOrUpdateChild("indicator-content-"+f,Object.assign(Object.assign({textConfig:v.text},v),{visible:r.visible,x:0,y:0,width:(_=v.width)!==null&&_!==void 0?_:0,height:(m=v.height)!==null&&m!==void 0?m:0}),"richtext"):v.type==="html"?d.createOrUpdateChild("indicator-content-"+f,Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:v.text},zr),v)},v),{visible:r.visible,x:0,y:0}),"richtext"):d.createOrUpdateChild("indicator-content-"+f,Object.assign(Object.assign({},v),{lineHeight:E(v.lineHeight)?v.lineHeight:v.fontSize,visible:g.visible,x:0,y:0}),"text"),g.autoFit&&N(h)&&this._setLocalAutoFit(h,y,g),g.autoLimit&&N(l)&&y.setAttribute("maxLineWidth",h),p.push(y)}else{const v=d.find(y=>y.name==="indicator-content-"+f,!1);v&&d.removeChild(v)}}),this._content=p}this._setGlobalAutoFit(h),this._setYPosition();const u=(i=d==null?void 0:d.AABBBounds.height())!==null&&i!==void 0?i:0;d.setAttribute("y",o.height/2-u/2),d.setAttribute("x",o.width/2)}_setLocalAutoFit(t,e,i){var n,r,a,o,l,h,d,u;if(((n=i.fitStrategy)!==null&&n!==void 0?n:"default")!=="default")return;const c=Cm((a=(r=i.style)===null||r===void 0?void 0:r.text)!==null&&a!==void 0?a:"",(o=i.style)!==null&&o!==void 0?o:{},(l=this.stage)===null||l===void 0?void 0:l.getTheme().text.fontFamily).width;if(c>0){const p=t*((h=i.fitPercent)!==null&&h!==void 0?h:.5)/c,g=Math.floor(((u=(d=i.style)===null||d===void 0?void 0:d.fontSize)!==null&&u!==void 0?u:20)*p);e.setAttribute("fontSize",g),e.setAttribute("lineHeight",E(i.style.lineHeight)?i.style.lineHeight:g)}}_setGlobalAutoFit(t){var e,i,n,r,a,o,l;const h=t/2,d=[];let u=0;const c=(e=this.attribute.title)!==null&&e!==void 0?e:{};c.autoFit&&c.fitStrategy==="inscribed"?(this._title.setAttribute("fontSize",12),d.push({text:this._title,spec:(i=this.attribute.title)!==null&&i!==void 0?i:{}})):u+=(o=(a=(r=(n=this._title)===null||n===void 0?void 0:n.AABBBounds)===null||r===void 0?void 0:r.height)===null||a===void 0?void 0:a.call(r))!==null&&o!==void 0?o:0;const p=(l=c.space)!==null&&l!==void 0?l:0;if(u+=p,Y(this.attribute.content).filter(x=>x.visible!==!1).forEach((x,S)=>{var A,k,w,T;const M=this._content[S];x.autoFit&&x.fitStrategy==="inscribed"?(M.setAttribute("fontSize",12),d.push({text:M,spec:x})):u+=(w=(k=(A=M==null?void 0:M.AABBBounds)===null||A===void 0?void 0:A.height)===null||k===void 0?void 0:k.call(A))!==null&&w!==void 0?w:0;const C=(T=x.space)!==null&&T!==void 0?T:0;u+=C}),d.length<=0)return;const g=12/d.reduce((x,S)=>Math.max(x,S.text.AABBBounds.width()),0)*d.length,f=u/2,_=g**2+1,m=2*f*g,v=f**2-h**2,y=2*(g*((-m+Math.sqrt(m**2-4*_*v))/(2*_))+f),b=(y-u)/d.length;N(y)&&d.forEach(x=>{var S;const A=(S=x.spec.style)===null||S===void 0?void 0:S.lineHeight;x.text.setAttribute("fontSize",b),x.text.setAttribute("lineHeight",E(A)?A:b)})}_setYPosition(){var t,e,i,n,r,a;let o=0;const l=(n=(i=(e=(t=this._title)===null||t===void 0?void 0:t.AABBBounds)===null||e===void 0?void 0:e.height)===null||i===void 0?void 0:i.call(e))!==null&&n!==void 0?n:0,h=(a=(r=this.attribute.title)===null||r===void 0?void 0:r.space)!==null&&a!==void 0?a:0;Y(this.attribute.content).filter(d=>d.visible!==!1).forEach((d,u)=>{var c;const p=this._content[u];p.setAttribute("y",l+h+o);const g=(c=d.space)!==null&&c!==void 0?c:0;o+=p.AABBBounds.height()+g})}};const Z6="M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z",J6="M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z",Q6="M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",t7="M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z",e7="m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",i7="M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z";class R0 extends Pu{constructor(t){super(t)}}var ir;(function(s){s.OnPlay="onPlay",s.OnPause="onPause",s.OnForward="onForward",s.OnBackward="onBackward"})(ir||(ir={}));var Cl;(function(s){s.Start="start",s.Pause="pause",s.Forward="forward",s.Backward="backward"})(Cl||(Cl={}));class Tr extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Tr.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:Z6},Tr.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:J6},Tr.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},Tr.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},Tr.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var i,n,r,a;this._layout=this.attribute.layout,this._layout==="horizontal"?(this._backwardAttr.style.symbolType=(i=this._backwardAttr.style.symbolType)!==null&&i!==void 0?i:Q6,this._forwardAttr.style.symbolType=(n=this._forwardAttr.style.symbolType)!==null&&n!==void 0?n:i7):this._layout==="vertical"&&(this._backwardAttr.style.symbolType=(r=this._backwardAttr.style.symbolType)!==null&&r!==void 0?r:e7,this._forwardAttr.style.symbolType=(a=this._forwardAttr.style.symbolType)!==null&&a!==void 0?a:t7)},this._initPlay=()=>{P(this._playController)&&(this._playController=new R0(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{P(this._backwardController)&&(this._backwardController=new R0(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{P(this._forwardController)&&(this._forwardController=new R0(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",i=>{i.stopPropagation(),this._isPaused===!0?this.play():this.pause()}),this._backwardController.addEventListener("pointerdown",i=>{i.stopPropagation(),this.backward()}),this._forwardController.addEventListener("pointerdown",i=>{i.stopPropagation(),this.forward()}))},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{this._dispatchEvent("ControllerEventEnum.OnPlay")},this.pause=()=>{this._dispatchEvent("ControllerEventEnum.OnPause")},this.forward=()=>{this._dispatchEvent("ControllerEventEnum.OnForward")},this.backward=()=>{this._dispatchEvent("ControllerEventEnum.OnBackward")},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}Tr.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},Tr.defaultAttributes={[Cl.Start]:{},[Cl.Pause]:{},[Cl.Backward]:{},[Cl.Forward]:{}};const Vp={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},O0=[200,10];var Ua;(function(s){s.Default="default",s.Reverse="reverse"})(Ua||(Ua={}));var Ge;(function(s){s.change="change",s.play="play",s.pause="pause",s.backward="backward",s.forward="forward",s.end="end",s.OnChange="change",s.OnPlay="play",s.OnPause="pause",s.OnBackward="backward",s.OnForward="forward",s.OnEnd="end"})(Ge||(Ge={}));const s7=({direction:s,maxIndex:t,dataIndex:e})=>s===Ua.Default&&e===t,n7=({direction:s,minIndex:t,dataIndex:e})=>s===Ua.Reverse&&e===t,r7=({direction:s,maxIndex:t,minIndex:e,dataIndex:i})=>s7({direction:s,maxIndex:t,dataIndex:i})||n7({direction:s,minIndex:e,dataIndex:i}),a7=({direction:s,minIndex:t,dataIndex:e})=>s===Ua.Default&&e===t,o7=({direction:s,maxIndex:t,dataIndex:e})=>s===Ua.Reverse&&e===t,l7=({direction:s,maxIndex:t,minIndex:e,dataIndex:i})=>a7({direction:s,minIndex:e,dataIndex:i})||o7({direction:s,maxIndex:t,dataIndex:i}),Nn=s=>s==="top"||s==="bottom",h7=(s,t,e,i)=>s==="default"?Math.min(t+1,i):Math.max(t-1,e);class Fc extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Fc.defaultAttributes,t)),this._data=[],this._layoutInfo={},this._updateSliderAttrs=()=>{var i,n,r;let a;N(this._handlerStyle.size)?a=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(a=ps(this._handlerStyle.size[0],this._handlerStyle.size[1]));const o={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:(i=this.attribute.dataIndex)!==null&&i!==void 0?i:0,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:N(a)?a:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(Nn(this._orient)){const l=Math.max(0,this._layoutInfo.slider.size),h=(n=this._railStyle.height)!==null&&n!==void 0?n:O0[1];o.layout="horizontal",o.railHeight=h,o.railWidth=l,o.x=this._layoutInfo.slider.x,o.y=this._layoutInfo.slider.y}else{const l=Math.max(0,this._layoutInfo.slider.size),h=(r=this._railStyle.width)!==null&&r!==void 0?r:O0[1];o.layout="vertical",o.railWidth=h,o.railHeight=l,o.x=this._layoutInfo.slider.x,o.y=this._layoutInfo.slider.y}return o},this._initSlider=()=>{const i=this._updateSliderAttrs();this._slider=new Qh(i),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const i={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return Nn(this._orient)?(i.layout="horizontal",i.start=Object.assign(Object.assign({},i.start),{style:Object.assign(Object.assign({},i.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),i.pause=Object.assign(Object.assign({},i.pause),{style:Object.assign(Object.assign({},i.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),i.backward=Object.assign(Object.assign({},i.backward),{style:Object.assign(Object.assign({},i.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),i.forward=Object.assign(Object.assign({},i.forward),{style:Object.assign(Object.assign({},i.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})):(i.layout="vertical",i.start=Object.assign(Object.assign({},i.start),{style:Object.assign(Object.assign({},i.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),i.pause=Object.assign(Object.assign({},i.pause),{style:Object.assign(Object.assign({},i.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),i.backward=Object.assign(Object.assign({},i.backward),{style:Object.assign(Object.assign({},i.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),i.forward=Object.assign(Object.assign({},i.forward),{style:Object.assign(Object.assign({},i.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})),i},this._initController=()=>{const i=this._updateControllerAttrs();this._controller=new Tr(i),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1;const{slider:t={},controller:e={}}=this.attribute;this._sliderVisible=t.visible,this._railStyle=Object.assign({},t.railStyle),this._trackStyle=Object.assign({},t.trackStyle),this._handlerStyle=Object.assign({},t.handlerStyle),this._controllerVisible=e.visible,this._start=Object.assign({},e.start),this._pause=Object.assign({},e.pause),this._forward=Object.assign({},e.forward),this._backward=Object.assign({},e.backward)}_initLayoutInfo(){var t,e,i;const n=[this._start,this._backward,this._forward].sort((c,p)=>c.order-p.order),r=n.filter(c=>c.position!=="end"),a=n.filter(c=>c.position==="end"),o=(t=Nn(this._orient)?this._railStyle.height:this._railStyle.width)!==null&&t!==void 0?t:O0[1],l=n.reduce((c,p)=>{const g=p.style.size,f=dt(g)?g:ps(g[0],g[1]);return c+p.space+f},0),h=this._sliderVisible?(Nn(this._orient)?(e=this._size)===null||e===void 0?void 0:e.width:(i=this._size)===null||i===void 0?void 0:i.height)-l:0,d=h-this.attribute.slider.space,u=r.reduce((c,p)=>{const{key:g,space:f,style:{size:_}}=p,m=dt(_)?_:ps(_[0],_[1]);return this._layoutInfo[g]=Object.assign(Object.assign({},this._layoutInfo[g]),{size:m,x:Nn(this._orient)?c+f:(this._size.width-m)/2,y:Nn(this._orient)?(this._size.height-m)/2:c+f}),c+f+m},0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:d,x:Nn(this._orient)?u+this.attribute.slider.space:(this._size.width-o)/2,y:Nn(this._orient)?(this._size.height-o)/2:u+this.attribute.slider.space}),a.reduce((c,p)=>{const{key:g,space:f,style:{size:_}}=p,m=dt(_)?_:ps(_[0],_[1]);return this._layoutInfo[g]=Object.assign(Object.assign({},this._layoutInfo[g]),{size:m,x:Nn(this._orient)?c+f:(this._size.width-m)/2,y:Nn(this._orient)?(this._size.height-m)/2:c+f}),c+f+m},u+h)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}}Fc.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},Vp),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},Vp),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},Vp),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},Vp),{key:"backward",position:"start"})}};function KI(){Hm(),qe(),Dn()}function d7(){KI()}function u7(){KI()}d7();class c7 extends Fc{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},t)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var i,n,r,a;super._initAttributes(),this._alternate=(i=this.attribute.alternate)!==null&&i!==void 0&&i,this._interval=(n=this.attribute.interval)!==null&&n!==void 0?n:1e3,this._direction=(r=this.attribute.direction)!==null&&r!==void 0?r:Ua.Default,this._dataIndex=P(this.attribute.dataIndex)?this._direction==="default"?this._minIndex:this._maxIndex:(a=this.attribute.dataIndex)!==null&&a!==void 0?a:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(ir.OnPlay,i=>{i.stopPropagation(),this.play()}),this._controller.addEventListener(ir.OnPause,i=>{i.stopPropagation(),this.pause()}),this._controller.addEventListener(ir.OnForward,i=>{i.stopPropagation(),this.forward()}),this._controller.addEventListener(ir.OnBackward,i=>{i.stopPropagation(),this.backward()}),this._slider.addEventListener("change",i=>{const n=Math.floor(i.detail.value)+.5;this._dataIndex=i.detail.value>=n?Math.ceil(i.detail.value):Math.floor(i.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(Ge.change)}))},this.play=()=>{this._isPlaying||this._data.length!==1&&(this._controller.togglePause(),this._isPlaying=!0,(r7({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||l7({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===Ua.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(Ge.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=Gt.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=i=>{const n=Date.now();if(this._isReachEnd&&n-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();i&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(Ge.change),this._activeIndex=this._dataIndex):n-this._tickTime>=this._interval&&(this._tickTime=n,this._updateDataIndex(h7(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(Ge.change)),(this._direction==="default"&&this._dataIndex>=this._maxIndex||this._direction==="reverse"&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=Gt.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=i=>{this._dataIndex=i,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),Gt.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(Ge.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,Gt.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(Ge.pause))},this.backward=()=>{const i=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(i),this.dispatchCustomEvent(Ge.change),this.dispatchCustomEvent(Ge.backward)},this.forward=()=>{const i=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(i),this.dispatchCustomEvent(Ge.change),this.dispatchCustomEvent(Ge.forward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}}var p7=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};u7();class g7 extends Fc{constructor(t){super(t),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var e,i;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=(e=this.attribute.interval)!==null&&e!==void 0?e:1e3,this._dataIndex=(i=this.attribute.dataIndex)!==null&&i!==void 0?i:this._minIndex;const n=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(n??1)):(this._totalDuration=this._interval*n,this._interval=this.attribute.interval)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(ir.OnPlay,e=>{e.stopPropagation(),this.play()}),this._controller.addEventListener(ir.OnPause,e=>{e.stopPropagation(),this.pause()}),this._controller.addEventListener(ir.OnForward,e=>{e.stopPropagation(),this.forward()}),this._controller.addEventListener(ir.OnBackward,e=>{e.stopPropagation(),this.backward()}),this._slider.addEventListener("change",e=>{var i;e.stopPropagation();const n=(i=e.detail)===null||i===void 0?void 0:i.value,r=n/this._maxIndex;this._elapsed=r*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(n)}))},this._getSliderValue=()=>{const e=this._elapsed/this._totalDuration;return Math.min(e*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const e=this._getSliderValue();this._dataIndex=Math.floor(e),this._slider.setValue(Math.min(e,this._maxIndex)),this._dispatchChange(Math.floor(e))},this._dispatchChange=e=>{const i=Math.floor(e);i!==this._activeIndex&&(this._dataIndex=i,this._activeIndex=i,i!==this._maxIndex&&this.dispatchCustomEvent(Ge.change))},this.play=()=>p7(this,void 0,void 0,function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(Ge.play),this._rafId=Gt.getRequestAnimationFrame()(this._play.bind(this)))}),this._play=()=>{this._elapsed=Date.now()-this._startTime;const e=this._getSliderValue();this._updateSlider(),e>=this._maxIndex?this._playEnd():this._rafId=Gt.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,Gt.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(Ge.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,Gt.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(Ge.pause))},this.backward=()=>{const e=Date.now(),i=1*this._interval,n=this._elapsed-i;n<=0?(this._elapsed=0,this._startTime=e):(this._elapsed=n,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(Ge.backward)},this.forward=()=>{const e=Date.now(),i=1*this._interval,n=this._elapsed+i;n>=this._totalDuration?(this._startTime=e-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-i,this._elapsed=n),this._updateSlider(),this.dispatchCustomEvent(Ge.forward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}}var Zi;(function(s){s.drawStart="drawStart",s.drawEnd="drawEnd",s.drawing="drawing",s.moving="moving",s.moveStart="moveStart",s.moveEnd="moveEnd",s.brushClear="brushClear"})(Zi||(Zi={}));const yr={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},f7=5;function _7(){qe(),Mm()}const WM={debounce:lr,throttle:Ka};_7();let qI=class ZI extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},ZI.defaultAttributes,t)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=i=>{var n;if(this._outOfInteractiveRange(i))return;i.stopPropagation();const r=(n=this.attribute.brushMoved)===null||n===void 0||n;this._activeMoveState=r&&this._isPosInBrushMask(i),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(i),this._activeMoveState&&this._initMove(i)},this._onBrushing=i=>{this._outOfInteractiveRange(i)||((this._activeDrawState||this._activeMoveState)&&i.stopPropagation(),this._activeDrawState&&this._drawing(i),this._activeMoveState&&this._moving(i))},this._onBrushEnd=i=>{i.preventDefault();const{removeOnClick:n=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&n?(this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={},this._dispatchEvent(Zi.brushClear,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:i})):(this._activeDrawState&&this._dispatchEvent(Zi.drawEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:i}),this._activeMoveState&&this._dispatchEvent(Zi.moveEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:i})),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,this._operatingMask&&this._operatingMask.setAttribute("pickable",!1)}}_bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0,trigger:i=yr.trigger,updateTrigger:n=yr.updateTrigger,endTrigger:r=yr.endTrigger,resetTrigger:a=yr.resetTrigger}=this.attribute;this.stage.addEventListener(i,this._onBrushStart),this.stage.addEventListener(n,WM[t](this._onBrushing,e)),this.stage.addEventListener(r,this._onBrushEnd),this.stage.addEventListener(a,this._onBrushEnd)}_isPosInBrushMask(t){const e=this.eventPosToStagePos(t),i=this._container.getChildren();for(let n=0;n<i.length;n++){const{points:r=[],dx:a=0,dy:o=0}=i[n].attribute,l=r.map(h=>({x:h.x+a,y:h.y+o}));if(co(l,e.x,e.y))return this._operatingMask=i[n],!0}return!1}_initDraw(t){const{brushMode:e}=this.attribute,i=this.eventPosToStagePos(t);this._cacheDrawPoints=[i],this._isDrawedBeforeEnd=!1,e==="single"&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._dispatchEvent(Zi.drawStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_initMove(t){var e,i;this._cacheMovePoint=this.eventPosToStagePos(t),this._operatingMaskMoveDx=(e=this._operatingMask.attribute.dx)!==null&&e!==void 0?e:0,this._operatingMaskMoveDy=(i=this._operatingMask.attribute.dy)!==null&&i!==void 0?i:0;const{interactiveRange:n}=this.attribute,{minY:r=-1/0,maxY:a=1/0,minX:o=-1/0,maxX:l=1/0}=n,{x1:h,x2:d,y1:u,y2:c}=this._operatingMask.globalAABBBounds,p=o-h,g=l-d,f=r-u,_=a-c;this._operatingMaskMoveRangeX=[p,g],this._operatingMaskMoveRangeY=[f,_],this._operatingMask.setAttribute("pickable",!0),this._dispatchEvent(Zi.moveStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_drawing(t){var e,i;const n=this.eventPosToStagePos(t),{x1:r=0,x2:a=0,y1:o=0,y2:l=0}=(e=this._operatingMask)===null||e===void 0?void 0:e._AABBBounds,{sizeThreshold:h=f7,brushType:d}=this.attribute,u=this._cacheDrawPoints.length;if(this._isDrawedBeforeEnd=Math.abs(a-r)>h||Math.abs(o-l)>h,u>0){const p=(i=this._cacheDrawPoints[this._cacheDrawPoints.length-1])!==null&&i!==void 0?i:{};if(n.x===p.x&&n.y===p.y)return}d==="polygon"||u<=1?this._cacheDrawPoints.push(n):this._cacheDrawPoints[u-1]=n;const c=this._computeMaskPoints();this._operatingMask.setAttribute("points",c),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(Zi.drawing,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_moving(t){const e=this._cacheMovePoint,i=this.eventPosToStagePos(t);if(i.x===(e==null?void 0:e.x)&&i.y===(e==null?void 0:e.y))return;const n=i.x-e.x,r=i.y-e.y,a=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],n))+this._operatingMaskMoveDx,o=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],r))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:a,dy:o}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(Zi.moving,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_computeMaskPoints(){const{brushType:t,xRange:e=[0,0],yRange:i=[0,0]}=this.attribute;let n=[];const r=this._cacheDrawPoints[0],a=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return n=t==="rect"?[r,{x:a.x,y:r.y},a,{x:r.x,y:a.y}]:t==="x"?[{x:r.x,y:i[0]},{x:a.x,y:i[0]},{x:a.x,y:i[1]},{x:r.x,y:i[1]}]:t==="y"?[{x:e[0],y:r.y},{x:e[0],y:a.y},{x:e[1],y:a.y},{x:e[1],y:r.y}]:bi(this._cacheDrawPoints),n}_addBrushMask(){var t;const{brushStyle:e,hasMask:i}=this.attribute,n=_t.polygon(Object.assign(Object.assign({points:bi(this._cacheDrawPoints),cursor:"move",pickable:!1},e),{opacity:i?(t=e.opacity)!==null&&t!==void 0?t:1:0}));n.name=`brush-${Date.now()}`,this._operatingMask=n,this._container.add(n),this._brushMaskAABBBoundsDict[n.name]=n.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:n=1/0,minX:r=-1/0,maxX:a=1/0}=e,o=this.eventPosToStagePos(t);return o.x>a||o.x<r||o.y>n||o.y<i}eventPosToStagePos(t){var e,i;const{x:n,y:r}=Gt.mapToCanvasPoint(t);return{x:n-(((e=this.stage)===null||e===void 0?void 0:e.x)||0),y:r-(((i=this.stage)===null||i===void 0?void 0:i.y)||0)}}render(){this._bindBrushEvents();const t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}releaseBrushEvents(){const{delayType:t="throttle",delayTime:e=0,trigger:i=yr.trigger,updateTrigger:n=yr.updateTrigger,endTrigger:r=yr.endTrigger,resetTrigger:a=yr.resetTrigger}=this.attribute;this.stage.removeEventListener(i,this._onBrushStart),this.stage.removeEventListener(n,WM[t](this._onBrushing,e)),this.stage.removeEventListener(r,this._onBrushEnd),this.stage.removeEventListener(a,this._onBrushEnd)}};qI.defaultAttributes=yr;const VM=(s,...t)=>{const e=[s.shape,...t.map(r=>r==null?void 0:r.shape)],i=[s.key,...t.map(r=>r==null?void 0:r.key)],n=[s.value,...t.map(r=>r==null?void 0:r.value)];return lt(s,...t,{shape:e.every(P)?void 0:lt({},...e),key:i.every(P)?void 0:lt({},...i),value:n.every(P)?void 0:lt({},...n)})},el=s=>{const{width:t,height:e,wordBreak:i="break-word",textAlign:n,textBaseline:r,text:a}=s;return Array.isArray(a)?{width:t,height:e,wordBreak:i,textAlign:n,textBaseline:r,singleLine:!1,textConfig:Y(a).map(o=>Object.assign(Object.assign({},s),{text:o}))}:{width:t,height:e,wordBreak:i,textAlign:n,textBaseline:r,singleLine:!1,textConfig:a.text}},m7={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:eu,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:eu,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:eu,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:new Le().setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},v7=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];function y7(){qe(),Vr(),Dn(),Ja(),Za()}y7();let JI=class Ps extends gi{constructor(t,e){super(e!=null&&e.skipDefault?t:lt({},Ps.defaultAttributes,t),e),this.name="tooltip"}render(){var t;const{visible:e,content:i,panel:n,keyWidth:r,valueWidth:a,hasContentShape:o,autoCalculatePosition:l,autoMeasure:h}=this.attribute;if(!e)return void this.hideAll();h&&Ps.measureTooltip(this.attribute),l&&Ps.calculateTooltipPosition(this.attribute);const d=_s(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},n),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild("tooltip-title",{visible:!0,x:d[3],y:d[0]},"group");const u=Ps.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape",lt({symbolType:"circle"},u.shape,{visible:Je(u)&&Je(u.shape)}),"symbol"),typeof u.value.text!="object"||u.value.text===null||u.value.text.type!=="rich"&&u.value.text.type!=="html"?u.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:Je(u)&&Je(u.value)},el(u.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({text:(t=u.value.text)!==null&&t!==void 0?t:"",visible:Je(u)&&Je(u.value)},u.value),"text"):u.value.text.type==="rich"?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:Je(u)&&Je(u.value)},el(u.value)),"richtext"):u.value.text.type==="html"&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({html:Object.assign(Object.assign({dom:u.value.text.text},zr),u.value),visible:Je(u)&&Je(u.value),width:u.value.width,height:u.value.height,wordBreak:u.value.wordBreak,textAlign:u.value.textAlign,textBaseline:u.value.textBaseline,singleLine:!1,textConfig:[]},u.value),"richtext"));const c=Je(u.shape)?u.shape.size+u.shape.spacing:0,{textAlign:p,textBaseline:g}=u.value,f=n.width-d[3]-d[0]-c;p==="center"?this._tooltipTitle.setAttribute("x",c+f/2):p==="right"||p==="end"?this._tooltipTitle.setAttribute("x",c+f):this._tooltipTitle.setAttribute("x",c),g==="bottom"?this._tooltipTitle.setAttribute("y",u.height):g==="middle"?this._tooltipTitle.setAttribute("y",u.height/2):this._tooltipTitle.setAttribute("y",0);const _=Je(u)?u.height+u.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild("tooltip-content",{visible:!0},"group"),this._tooltipContent.removeAllChild(),i&&i.length){this._tooltipContent.setAttribute("x",d[3]),this._tooltipContent.setAttribute("y",d[0]+_);let m=0;i.forEach((v,y)=>{var b,x,S;const A=Ps.getContentAttr(this.attribute,y);if(!Je(A))return;const k=`tooltip-content-${y}`,w=this._tooltipContent.createOrUpdateChild(k,{visible:!0,x:0,y:m},"group");let T=0;if(Je(A.shape)&&w.createOrUpdateChild(`${k}-shape`,Object.assign({visible:!0,x:A.shape.size/2,y:A.shape.size/2+(((b=qn(A.key.lineHeight,A.key.fontSize))!==null&&b!==void 0?b:A.key.fontSize)-A.shape.size)/2},A.shape),"symbol"),o&&(T+=A.shape.size+A.shape.spacing),Je(A.key)){let M;M=A.key.multiLine?w.createOrUpdateChild(`${k}-key`,Object.assign(Object.assign({visible:!0},el(A.key)),{textBaseline:"top"}),"richtext"):typeof A.key.text!="object"||A.key.text===null||A.key.text.type!=="rich"&&A.key.text.type!=="html"?w.createOrUpdateChild(`${k}-key`,Object.assign(Object.assign({visible:!0,text:(x=A.key.text)!==null&&x!==void 0?x:""},A.key),{textBaseline:"top"}),"text"):A.key.text.type==="rich"?w.createOrUpdateChild(`${k}-value`,Object.assign(Object.assign({visible:!0},el(A.key)),{textBaseline:"top"}),"richtext"):w.createOrUpdateChild(`${k}-value`,{html:Object.assign(Object.assign({dom:A.key.text.text},zr),A.key)},"richtext");const{textAlign:C}=A.key;C==="center"?M.setAttribute("x",T+r/2):C==="right"||C==="end"?M.setAttribute("x",T+r):M.setAttribute("x",T),M.setAttribute("y",0),T+=r+A.key.spacing}if(Je(A.value)){let M;M=A.value.multiLine?w.createOrUpdateChild(`${k}-value`,Object.assign(Object.assign({visible:!0},el(A.value)),{textBaseline:"top"}),"richtext"):typeof A.value.text!="object"||A.value.text===null||A.value.text.type!=="rich"&&A.value.text.type!=="html"?w.createOrUpdateChild(`${k}-value`,Object.assign(Object.assign({visible:!0,text:(S=A.value.text)!==null&&S!==void 0?S:""},A.value),{textBaseline:"top"}),"text"):A.value.text.type==="rich"?w.createOrUpdateChild(`${k}-value`,Object.assign(Object.assign({visible:!0},el(A.value)),{textBaseline:"top"}),"richtext"):w.createOrUpdateChild(`${k}-value`,{html:Object.assign({dom:A.value.text.text,container:"",width:30,height:30,style:{}},A.value)},"richtext");let C="right";E(A.value.textAlign)?C=A.value.textAlign:Je(A.key)||(C="left"),M.setAttribute("textAlign",C),C==="center"?M.setAttribute("x",T+a/2):C==="right"||C==="end"?M.setAttribute("x",T+a):M.setAttribute("x",T),T+=a,M.setAttribute("y",0),w.add(M)}m+=A.height+A.spaceRow})}}setAttributes(t,e){const i=Object.keys(t);this.attribute.autoCalculatePosition&&i.every(n=>v7.includes(n))?(this._mergeAttributes(t,i),P(this.attribute.panel.width)&&this.attribute.autoMeasure&&Ps.measureTooltip(this.attribute),Ps.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:n,offsetY:r,pointerX:a,pointerY:o,positionX:l,positionY:h,parentBounds:d}=t;let u=a,c=o;return l==="left"?u-=e+n:l==="center"?u-=e/2:u+=n,h==="top"?c-=i+r:h==="middle"?c-=i/2:c+=r,u+e>d.x2&&(u-=e+n),c+i>d.y2&&(c-=i+r),u<d.x1&&(u=d.x1),c<d.y1&&(c=d.y1),t.x=u,t.y=c,t}static measureTooltip(t){const{content:e,contentStyle:i}=t,n=_s(t.padding),r=Ps.getTitleAttr(t);let a=0,o=n[0]+n[2],l=0;const{value:h,shape:d}=r,{visible:u=!1,symbolType:c=""}=d??{};if(E(h)&&typeof r.value.text!="object"){const{width:p,height:g}=M0(h).quickMeasure(h.text);a=p,l=g}if(u&&Yg[c]&&(a+=d.size+d.spacing,l=Math.max(d.size,l)),t.title&&(t.title.width=a,t.title.height=l),Je(r)&&(o+=l+r.spaceRow),e&&e.length){const p=[];if(e.forEach((g,f)=>{const _=Ps.getContentAttr(t,f);(g.key||g.value)&&Je(_)&&p.push([g,_])}),p.length){let g=!1;const f=[],_=[],m=[];p.forEach(([x,S],A)=>{var k;const{key:w,value:T,shape:M,spaceRow:C}=S,R=Je(M),I=(k=M==null?void 0:M.symbolType)!==null&&k!==void 0?k:"",O=M0(w),L=M0(T);let D=0;if(Je(w)){const{width:j,height:H}=O.quickMeasure(w.text);_.push(j),D=Math.max(D,H)}if(Je(T)){const{width:j,height:H}=L.quickMeasure(T.text);m.push(j),D=Math.max(D,H)}R&&Yg[I]&&(g=!0,f.push(M.size),D=Math.max(M.size,D)),x.height=D,o+=D,A<p.length-1&&(o+=C??i.spaceRow)});const v=f.length?Math.max(...f):0,y=_.length?Math.max(..._):0,b=m.length?Math.max(...m):0;a=Math.max(y+b+i.key.spacing+i.value.spacing+(g?v+i.shape.spacing:0),a),e.forEach(x=>{x.width=a}),t.hasContentShape=g,t.keyWidth=y,t.valueWidth=b}}return t.panel.width=a+n[1]+n[3],t.panel.height=o,t}static getTitleAttr(t){return VM({},Ps.defaultAttributes.titleStyle,Ps.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return VM({},Ps.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}};JI.defaultAttributes=m7;function UM(s){if(s)return s.type===Ve.Band?s.bandwidth():s.type===Ve.Point?s.step():void 0}const $M=(s,t)=>Oc(s)?s.output():s&&$t(s)?K(s.callback)?e=>s.callback(e,t):K(s.value)?s.value(t):s:s,YM=(s,t)=>s&&($t(s)?Object.keys(s).reduce((e,i)=>{const n=s[i];return e[i]=$M(n,t),e},{}):s.map(e=>$M(e,t)));var b7=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};let x7=-1;class Wm extends jo{constructor(t){super(),this.spec={},this.references=new Map,this.targets=[],this.transforms=[],this.view=t,this.uid=++x7}parse(t){return this.id(t.id),this.name(t.name),this.depend(t.dependency),this}depend(t){var e;if(!((e=this.spec)===null||e===void 0)&&e.dependency){const n=Y(this.spec.dependency).map(r=>ht(r)?this.view.getGrammarById(r):r);this.detach(n)}this.spec.dependency=t;const i=Y(t).map(n=>ht(n)?this.view.getGrammarById(n):n);return this.attach(i),this.commit(),this}addEventListener(t,e,i){let n=e;return i&&i.trap===!1||(n=e,n.raw=e),i&&i.target&&(n.target=i.target),this.on(t,n),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}emit(t,...e){var i,n;return(n=(i=this.view)===null||i===void 0?void 0:i.emit)===null||n===void 0||n.call(i,t,...e),super.emit(t,...e)}emitGrammarEvent(t,...e){return super.emit(t,...e)}evaluateTransform(t,e,i){return b7(this,void 0,void 0,function*(){if(!t||!t.length)return e;let n=e,r=0;const a=t.length;for(;r<a;){const o=t[r];this.emit(gt.BEFORE_TRANSFORM,o.type),n=o.transform(o.isRawOptions?o.options:YM(o.options,i),n,i,this.view),n!=null&&n.then&&(n=yield n),r++,this.emit(gt.AFTER_TRANSFORM,o.type)}return n})}evaluateTransformSync(t,e,i){if(!t||!t.length)return e;let n=e,r=0;const a=t.length;for(;r<a;){const o=t[r];this.emit(gt.BEFORE_TRANSFORM,o.type),n=o.transform(o.isRawOptions?o.options:YM(o.options,i),n,i,this.view),r++,this.emit(gt.AFTER_TRANSFORM,o.type)}return n}set(t){return!1}id(t){return arguments.length?(this.view.grammars.unrecord(this),this._id=t,this.view.grammars.record(this),this):this._id}name(t){return arguments.length?(this._name=t,this):this._name}attach(t,e=1){return Y(t).filter(i=>!P(i)).forEach(i=>{var n;P(t)||(i.targets.includes(this)||i.targets.push(this),this.references.set(i,((n=this.references.get(i))!==null&&n!==void 0?n:0)+e))}),this}detach(t,e=1){return Y(t).filter(i=>!P(i)).forEach(i=>{const n=this.references.get(i)-e;n>0?this.references.set(i,n-1):(this.references.delete(i),i.targets.includes(this)&&(i.targets=i.targets.filter(r=>r!==this)))}),this}detachAll(){this.references.forEach((t,e)=>{this.detach(e,t)})}link(t){this.grammarSource=t}run(){var t;const e=(t=this.grammarSource)===null||t===void 0?void 0:t.output(),i=this.parameters();return this.evaluate(e,i)}runSync(){var t;const e=(t=this.grammarSource)===null||t===void 0?void 0:t.output(),i=this.parameters();return this.evaluateSync?this.evaluateSync(e,i):this.evaluate(e,i)}commit(){this.view.commit(this)}parameters(){const t={};return this.references.forEach((e,i)=>{E(i.id())&&(t[i.id()]=i.output())}),t}getSpec(){return this.spec}reuse(t){return this}clear(){this.spec=null,this.view=null}release(){this.clear()}setFunctionSpec(t,e){return P(this.spec[e])||this.detach(Ki(this.spec[e],this.view)),this.spec[e]=t,this.attach(Ki(t,this.view)),this.commit(),this}}const XM=(s,t,e)=>{var i;if(s==="callback"&&K(t))return{references:[],value:{callback:t,dependency:[]}};if(!P(t.data)){const n=e.getDataById(t.data);return{references:[n],value:n}}if(!P(t.customized)){const n=e.getCustomizedById(t.customized);return{references:[n],value:n}}if(!P(t.scale)){const n=e.getScaleById(t.scale);return{references:[n],value:n}}if(b4(t)){const n=Ki(t,e);return{references:n,value:t.callback?{value:t.callback,dependency:n}:(i=n==null?void 0:n[0])!==null&&i!==void 0?i:t}}return{value:t}},S7=(s,t,e)=>{if(P(t))return{value:t};if($(t)){const i=t.map(n=>XM(s,n,e));return{references:i.reduce((n,r)=>(r.references&&n.concat(r.references),n),[]),value:i.map(n=>n.value)}}return XM(s,t,e)},A7=(s,t)=>{const e=st.getTransform(s.type);if(!e)return;const i={};let n=[];return Object.keys(s).forEach(r=>{var a;if(r==="type")return;const o=s[r];if(r==="dependency")return void((o==null?void 0:o.length)&&(n=n.concat(LS(o,t))));const l=S7(r,o,t);l&&(!((a=l.references)===null||a===void 0)&&a.length&&(n=n.concat(l.references)),i[r]=l.value)}),{markPhase:e.markPhase,transform:e.transform,canProgressive:e.canProgressive,type:e.type,options:i,references:n}},d_=(s,t)=>{if(s!=null&&s.length){const e=[];let i=[];return s.forEach(n=>{var r;const a=A7(n,t);a&&(!((r=a.references)===null||r===void 0)&&r.length&&(i=i.concat(a.references)),e.push(a))}),{transforms:e,refs:i}}return null};var k7=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};const w7=(s,t={},e)=>{if(!ht(s))return Y(s);try{return Y(JSON.parse(s))}catch{return[]}},KM={csv:oR,dsv:aR,tsv:lR,json:w7},T7=(s,t)=>{if(!t||!KM[t.type])return Y(s);const e=t.type==="dsv"?{delimiter:t.delimiter}:{};return KM[t.type](s,e,new Jt(new ko))},M7=s=>k7(void 0,void 0,void 0,function*(){try{return(yield fetch(s)).text()}catch{return null}});var C7=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};class P7 extends Wm{constructor(t,e,i){super(t),this.grammarType="data",this.spec={},this._dataIDKey=`VGRAMMAR_DATA_ID_KEY_${this.uid}`,this._loadTasks=[],this._postFilters=[],this.ingest=n=>{const r=A0(n.format,this.parameters());return this._input=T7(n.values,r),this._input},this.load=n=>{var r;if(n.values)return this.ingest(n);const a=A0(n.url,this.parameters()),o=(r=A0(n.format,this.parameters()))!==null&&r!==void 0?r:{type:"json"};return M7(a).then(l=>this.ingest({values:l,format:o}))},this.relay=n=>n[0],this.evaluateSync=(n,r)=>{this.view.emit(gt.BEFORE_EVALUATE_DATA);const a=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms),o=this.evaluateTransformSync(a,this.grammarSource?n:this._input,r),l=this._evaluateFilter(o,r);return this.setValues(l),this._isLoaded=!0,this.view.emit(gt.AFTER_EVALUATE_DATA),this},this._loadTasks=[],P(e)||this.values(e,i)}parse(t){return super.parse(t),this._isLoaded=!1,this.source(t.source,t.format,!1),this.url(t.url,t.format,!1),this.values(t.values,t.format,!1),this.transform(t.transform),this.parseLoad(t),this.commit(),this}parseDataSource(t){const e=[],i=[],n=t.format?Ki(t.format,this.view)[0]:null;if(n&&e.push(n),t.values){const r=Ki(t.values,this.view)[0];r&&e.push(r),i.push({type:"ingest",transform:this.ingest,isRawOptions:!0,options:{values:t.values,format:t.format}})}else if(t.url){const r=Ki(t.url,this.view)[0];r&&e.push(r),i.push({type:"load",transform:this.load,options:{url:r??t.url,format:n??t.format}})}else if(t.source){const r=[];Y(t.source).forEach(a=>{const o=Oc(a)?a:this.view.getDataById(a);o&&(e.push(o),r.push(o))}),r.length&&(i.push({type:"relay",transform:this.relay,options:r}),this.grammarSource=r[0])}return{transforms:i,refs:e}}evaluate(t,e){return C7(this,void 0,void 0,function*(){this.view.emit(gt.BEFORE_EVALUATE_DATA);const i=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms);this.grammarSource&&(this._input=t);const n=yield this.evaluateTransform(i,this._input,e),r=this._evaluateFilter(n,e);return this.setValues(r),this._isLoaded=!0,this.view.emit(gt.AFTER_EVALUATE_DATA),this})}output(){return this._values}getDataIDKey(){return this._dataIDKey}values(t,e,i=!0){const n=Object.assign({},this.spec,{values:t,format:e});return P(t)||(n.url=void 0,n.source=void 0),i?this.parseLoad(n):this}url(t,e,i=!0){const n=Object.assign({},this.spec,{url:t,format:e});return P(t)||(n.values=void 0,n.source=void 0),i?this.parseLoad(n):this}source(t,e,i=!0){const n=Object.assign({},this.spec,{source:t,format:e});return P(t)||(n.values=void 0,n.url=void 0),i?this.parseLoad(n):this}parseLoad(t){this.detach(this.parseDataSource(this.spec).refs),this.spec=t;const e=this.parseDataSource(this.spec);return this.attach(e.refs),this._loadTasks=e.transforms,this._isLoaded=!1,this.commit(),this}setValues(t){this._values=Y(t).map((e,i)=>{const n=e===Object(e)?e:{data:e};return n[this._dataIDKey]=i,n})}field(t){return this._values.map(e=>e[t])}transform(t){const e=d_(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]),this.spec.transform=t;const i=d_(this.spec.transform,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.commit(),this}getValue(){return this._values}getInput(){return this._input}addDataFilter(t){return this._postFilters=this._postFilters.concat(Y(t)),this._postFilters.sort((e,i)=>{var n,r;return((n=e.rank)!==null&&n!==void 0?n:0)-((r=i.rank)!==null&&r!==void 0?r:0)}),this}removeDataFilter(t){const e=Y(t);return this._postFilters=this._postFilters.filter(i=>!e.includes(i)),this}_evaluateFilter(t,e){return this._postFilters.reduce((i,n)=>n.filter(i,e),t)}reuse(t){return t.grammarType!==this.grammarType||(this._isLoaded=!1,this._values=t.output()),this}clear(){super.clear(),this._input=null,this._values=null}}const bo="window",go="view",E7="browser",R7={trap:!1},ma="width",va="height",ph="viewWidth",gh="viewHeight",Xs="padding",US="viewBox",ru="autoFit";function O7(s){const t=Object.assign({defaults:{}},s),e=(i,n)=>{n.forEach(r=>{$(i[r])&&(i[r]=i[r].reduce((a,o)=>(a[o]=!0,a),{}))})};return e(t.defaults,["prevent","allow"]),e(t,[go,bo]),t}function I7(s,t){const e=s.defaults,i=e.prevent,n=e.allow;return i!==!1&&n!==!0&&(i===!0||n===!1||(i?i[t]:!!n&&!n[t]))}function L7(s,t,e){const i=s==null?void 0:s[t];return!(i===!1||$t(i)&&!i[e])}function vg(s,t,e,i){let n,r;const a=s[t];for(;t>e&&(r=Math.floor((t-1)/2),n=s[r],a&&n&&i(a,n)<0);)s[t]=n,t=r;return s[t]=a}function I0(s,t,e,i){const n=t,r=s.length,a=s[t];let o,l=2*t+1;for(;l<r;)o=l+1,o<r&&i(s[l],s[o])>=0&&(l=o),s[t]=s[l],l=2*(t=l)+1;return s[t]=a,vg(s,t,n,i)}class B7{constructor(t){this.compare=t,this.nodes=[]}size(){return this.nodes.length}last(){return this.nodes[0]}validate(){for(let t=this.nodes.length-1;t>0;t-=1){const e=Math.floor((t-1)/2);if(this.compare(this.nodes[e],this.nodes[t])>0)return!1}return!0}push(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);return vg(this.nodes,e,0,this.compare),I0(this.nodes,e,null,this.compare)}return this.nodes.push(t),vg(this.nodes,this.nodes.length-1,0,this.compare)}remove(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);this.nodes=this.nodes.slice(0,e).concat(this.nodes.slice(e+1)),vg(this.nodes,e,0,this.compare),I0(this.nodes,e,null,this.compare)}}pop(){const t=this.nodes.pop();let e;return this.nodes.length?(e=this.nodes[0],this.nodes[0]=t,I0(this.nodes,0,null,this.compare)):e=t,e}clear(){this.nodes=[]}}class qM{constructor(t){this.list=[],this.ids={},this.idFunc=t||mU}add(t){const e=this.idFunc(t);return this.ids[e]||(this.ids[e]=1,this.list.push(t)),this}remove(t){const e=this.idFunc(t);return this.ids[e]&&(this.ids[e]=0,this.list=this.list.filter(i=>i!==t)),this}forEach(t,e){e?this.list.slice().reverse().forEach(t):this.list.forEach(t)}filter(t){return this.list.filter(t)}get length(){return this.list.length}getElementByIndex(t){return this.list[t]}}var ZM=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};class D7{constructor(){this.grammars=[],this.logger=Nt.getInstance(),this._curRank=0,this._committed=new qM(t=>t.uid),this._heap=new B7((t,e)=>(t==null?void 0:t.qrank)-(e==null?void 0:e.qrank)),this._beforeRunner=null,this._afterRunner=null,this._isRunning=!1,this._updateCounter=0,this._finishFirstRender=!1}asyncCallback(t){return ZM(this,void 0,void 0,function*(){try{yield t(this)}catch(e){this.logger.error(e)}})}add(t){if(t)return this._setRankOfGrammar(t),this.commit(t),!this.grammars.includes(t)&&(this.grammars.push(t),!0)}remove(t){t&&(this._committed.remove(t),this._heap.remove(t),this.grammars=this.grammars.filter(e=>e!==t))}_setRankOfGrammar(t){t&&(t.rank=++this._curRank)}_reRank(t){const e=[t];for(;e.length;){const i=e.pop();this._setRankOfGrammar(i);const n=i.targets;n&&n.forEach(r=>{e.push(r),r===t&&this.logger.error("Cycle detected in dataflow graph.")})}}_enqueue(t){t&&(t.qrank=t.rank,this._heap.push(t))}_logGrammarRunInfo(t){if(this.logger.canLogError()){const e=[{key:"id",value:t.id()},{key:"name",value:t.name()}].reduce((i,n,r)=>P(n.value)?i:`${i}${r?" , ":""}${n.key}: ${n.value}`,"");this.logger.debug("Run Operator: ",t,e)}}hasCommitted(){return!!this._committed.length}commit(t){return this._isRunning?this._enqueue(t):this._committed.add(t),this}_beforeEvaluate(){this.grammars.forEach(t=>{t.targets.some(e=>(e==null?void 0:e.rank)<(t==null?void 0:t.rank))&&this._reRank(t)}),this._committed.forEach(t=>this._enqueue(t)),this._committed=new qM(t=>t.uid)}_enqueueTargets(t){t.targets&&t.targets.length&&this._finishFirstRender&&t.targets.forEach(e=>this._enqueue(e))}evaluate(){return ZM(this,void 0,void 0,function*(){if(this._isReleased)return;if(this._beforeRunner&&(yield this.asyncCallback(this._beforeRunner)),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._isRunning=!0,this._updateCounter+=1;let t,e,i,n,r=0;this.logger.canLogInfo()&&(i=Date.now(),this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)),this._beforeEvaluate();try{for(;this._heap.size()>0&&!this._isReleased;)if(t=this._heap.pop(),t)if(t.rank===t.qrank){if(e=t.run(),e&&e.then&&(e=yield e),!this._isRunning)return!1;this._logGrammarRunInfo(t),this._enqueueTargets(t),r+=1}else this._enqueue(t)}catch(a){this._heap.clear(),n=a}return!this._isReleased&&(this._isRunning=!1,this.logger.canLogInfo()&&(i=Date.now()-i,this.logger.info(`> ${r} grammars; ${i} ms`)),n?this.logger.error(n):this._afterRunner&&(yield this.asyncCallback(this._afterRunner)),this._finishFirstRender=!0,!0)})}evaluateSync(){if(this._beforeRunner&&this._beforeRunner(this),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._isRunning=!0,this._updateCounter+=1;let t,e,i=0;for(this.logger.canLogInfo()&&(e=Date.now(),this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)),this._beforeEvaluate();this._heap.size()>0;)t=this._heap.pop(),t&&(t.rank===t.qrank?(t.runSync(),this._logGrammarRunInfo(t),this._enqueueTargets(t),i+=1):this._enqueue(t));return this._isRunning=!1,this.logger.canLogInfo()&&(e=Date.now()-e,this.logger.info(`> ${i} grammars updated; ${e} ms`)),this._afterRunner&&this._afterRunner(this),this._finishFirstRender=!0,!0}stop(){this._isRunning&&(this._isRunning=!1)}runBefore(t){this._beforeRunner=t}runAfter(t){this._afterRunner=t}release(){this.stop(),this._isReleased=!0,this._heap&&(this._heap.clear(),this._heap=null),this.logger=null,this._committed=null}}const L0=(s,t,e,i,n)=>{const r=a=>{if(n||!a||i&&!i(a)||e.call(null,a),a.markType===rt.group){const o=a[t];o&&o.forEach(l=>{r(l)})}n&&(!a||i&&!i(a)||e.call(null,a))};r(s)};class F7{constructor(t){this.handleAfterNextRender=()=>{this._stage&&!this._viewOptions.disableDirtyBounds&&this._stage.enableDirtyBounds(),this._view.emit(gt.AFTER_VRENDER_DRAW),this._view.emit(gt.AFTER_VRENDER_NEXT_RENDER)},this._view=t}initialize(t,e,i,n){return this._width=t,this._height=e,this._viewOptions=i,this._eventConfig=n,this.initStage(),this}stage(){var t;return(t=this._stage)!==null&&t!==void 0?t:null}gestureController(){var t;return(t=this._gestureController)!==null&&t!==void 0?t:null}canvas(){return this._stage?this._stage.window.getNativeHandler().nativeCanvas:null}context(){return this._stage?this._stage.window.getContext().nativeContext:null}combineIncrementalLayers(){return this._stage&&MN(this._stage).then(()=>{this._stage&&this._stage.defaultLayer.combineSubLayer()}),this}background(t){if(this._stage)return this._stage.background=t,this}setDpr(t,e){var i,n;return(n=(i=this._stage)===null||i===void 0?void 0:i.setDpr)===null||n===void 0||n.call(i,t),e&&this.renderNextFrame(),this}shouldResize(t,e){return t!==this._width||e!==this._height}resize(t,e){return this._view.emit(gt.BEFORE_STAGE_RESIZE),this.shouldResize(t,e)&&(this._width=t,this._height=e,this._stage&&this._stage.resize(t,e)),this._view.emit(gt.AFTER_STAGE_RESIZE),this}setViewBox(t,e=!0){return this._stage?(!t||this._viewBox&&t.x1===this._viewBox.x1&&t.x2===this._viewBox.x2&&t.y1===this._viewBox.y1&&t.y2===this._viewBox.y2||(this._viewBox=t,this._stage.setViewBox(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1,e)),this):this}render(t=!1){return this._view.emit(gt.BEFORE_VRENDER_DRAW),this.initStage(),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this.handleAfterNextRender),t&&(this._stage.render(),this._view.emit(gt.AFTER_VRENDER_DRAW)),this}renderNextFrame(){return this.initStage(),this._stage.renderNextFrame(),this}toCanvas(){return this._stage?this._stage.toCanvas():null}preventRender(t){this._stage&&this._stage.preventRender(t)}release(){var t;this._view.traverseMarkTree(e=>{e.release()}),this._dragController&&this._dragController.release(),this._gestureController&&this._gestureController.release(),this._stage!==((t=this._viewOptions)===null||t===void 0?void 0:t.stage)&&this._stage.release(),this._stage=null,this._layer=null,this._dragController=null,this._gestureController=null}createStage(){var t,e,i,n,r;this._view.emit(gt.BEFORE_CREATE_VRENDER_STAGE);const a=this._viewOptions,o=(t=a.stage)!==null&&t!==void 0?t:yV({width:this._width,height:this._height,renderStyle:a.renderStyle,viewBox:a.viewBox,dpr:a.dpr,canvas:a.renderCanvas,canvasControled:a.canvasControled,container:a.container,title:a.rendererTitle,beforeRender:a.beforeRender,afterRender:a.afterRender,disableDirtyBounds:!0,autoRender:!0,pluginList:a.pluginList,enableHtmlAttribute:a.enableHtmlAttribute,optimize:a.optimize,supportsTouchEvents:a.supportsTouchEvents,supportsPointerEvents:a.supportsPointerEvents});!((e=a.options3d)===null||e===void 0)&&e.enable&&o.set3dOptions(a.options3d),o.enableIncrementalAutoRender(),this._viewBox=a.viewBox,this._view.emit(gt.AFTER_CREATE_VRENDER_STAGE),this._view.emit(gt.BEFORE_CREATE_VRENDER_LAYER);const l=(i=a.layer)!==null&&i!==void 0?i:o.defaultLayer;if(this._view.emit(gt.AFTER_CREATE_VRENDER_LAYER),!((n=this._eventConfig)===null||n===void 0)&&n.drag&&(this._dragController=new z4(o)),(r=this._eventConfig)===null||r===void 0?void 0:r.gesture){const h=$t(this._eventConfig.gesture)?this._eventConfig.gesture:{};this._gestureController=new N4(o,h)}return{stage:o,layer:l}}initStage(){if(!this._stage){const{stage:t,layer:e}=this.createStage();this._stage=t,this._layer=e;const i=this._view.background();this.background(i)}}}function j7(s){["touches","changedTouches","targetTouches"].forEach(e=>{s[e]&&s[e].length&&Array.from(s[e]).forEach(i=>{QM(i,JM(i),!1)})});const t=JM(s);return QM(s,t)}function JM(s){return P(s.offsetX)?P(s.x)?s.changedTouches&&s.changedTouches.length?N7(s):{canvasX:0,canvasY:0}:H7(s):z7(s)}function z7(s){return{canvasX:s.offsetX,canvasY:s.offsetY}}function H7(s){return{canvasX:s.x,canvasY:s.y}}function N7(s){return{canvasX:s.changedTouches[0].x,canvasY:s.changedTouches[0].y}}function QM(s,t,e=!0){return N(t.canvasX)&&Object.defineProperty(s,"canvasX",{value:t.canvasX,writable:!0}),N(t.canvasY)&&Object.defineProperty(s,"canvasY",{value:t.canvasY,writable:!0}),e&&N(t.clientX)&&Object.defineProperty(s,"clientX",{value:t.clientX,writable:!0}),e&&N(t.clientY)&&Object.defineProperty(s,"clientY",{value:t.clientY,writable:!0}),[t.canvasX,t.canvasY]}function lx(s,t,e,i,n){if(n===bo){const r=t.changedTouches?t.changedTouches[0]:t;j7(r)}return t.element=e,t}class G7 extends Wm{constructor(){super(...arguments),this.grammarType="signal",this.spec={value:null,update:null}}parse(t){return super.parse(t),this.value(t.value),this.update(t.update),this.commit(),this}evaluate(t,e){return this._signal=this.spec.update?Ue(this.spec.update,e,this._signal):this.spec.value,this.spec.value=this._signal,this}output(){return this._signal}getValue(){return this.output()}set(t){if($(t)&&$(this.value)&&t.length===this.value.length){for(let e=0;e<t.length;e++)if(this.value[e]!==t[e])return this._signal=t,this.spec.value=t,!0;return!1}return this._signal!==t&&(this._signal=t,this.spec.value=t,!0)}update(t){return P(t)||this.value(void 0),this.setFunctionSpec(t,"update")}value(t){return P(t)||this.update(void 0),this.spec.value=t,this.commit(),this}reuse(t){return t.grammarType!==this.grammarType||(this._signal=t.output()),this}clear(){super.clear(),this._signal=null}}let W7=-1;const tC=[ma,va,Xs,ph,gh,US,ru],V7=(s,t,e)=>{var i,n,r,a,o;return[{id:ma,value:(i=s[ma])!==null&&i!==void 0?i:0},{id:va,value:(n=s[va])!==null&&n!==void 0?n:0},{id:Xs,value:ya((a=(r=s[Xs])!==null&&r!==void 0?r:t[Xs])!==null&&a!==void 0?a:e==null?void 0:e.padding)},{id:ph,update:{callback:(l,h)=>{const d=ya(h[Xs]);return h[ma]-d.left-d.right},dependency:[ma,Xs]}},{id:gh,update:{callback:(l,h)=>{const d=ya(h[Xs]);return h[va]-d.top-d.bottom},dependency:[va,Xs]}},{id:US,update:{callback:(l,h)=>{const d=ya(h[Xs]);return(l||new Pi).setValue(d.left,d.top,d.left+h[ph],d.top+h[gh])},dependency:[ph,gh,Xs]}},{id:ru,value:(o=s[ru])!==null&&o!==void 0?o:t[ru]}]},ya=s=>{var t,e,i,n;return dt(s)?{top:s,bottom:s,left:s,right:s}:{top:(t=s==null?void 0:s.top)!==null&&t!==void 0?t:0,bottom:(e=s==null?void 0:s.bottom)!==null&&e!==void 0?e:0,left:(i=s==null?void 0:s.left)!==null&&i!==void 0?i:0,right:(n=s==null?void 0:s.right)!==null&&n!==void 0?n:0}},U7=s=>{var t;const e=(i,n)=>{var r,a;i.group=n;const o=(r=i.id)!==null&&r!==void 0?r:"VGRAMMAR_MARK_"+ ++W7;i.id=o,((a=i.marks)!==null&&a!==void 0?a:[]).forEach(l=>e(l,o))};return((t=s.marks)!==null&&t!==void 0?t:[]).forEach(i=>e(i,"root")),s},eC=s=>{var t,e,i,n,r;const{reuse:a=c4,morph:o=p4,morphAll:l=g4,animation:h={},enableExitAnimation:d=_4}=s??{};return{reuse:a,morph:o,morphAll:l,animation:{easing:(t=h.easing)!==null&&t!==void 0?t:Eb,delay:(e=h.delay)!==null&&e!==void 0?e:Cb,duration:(i=h.duration)!==null&&i!==void 0?i:iI,oneByOne:(n=h.oneByOne)!==null&&n!==void 0?n:Pb,splitPath:(r=h.splitPath)!==null&&r!==void 0?r:f4},enableExitAnimation:d}},$7=s=>P(s.markId)?t=>t&&t.mark.id()===s.markId:P(s.markName)?t=>t&&t.mark.name()===s.markName:P(s.type)?t=>t&&t.mark.markType===s.type:()=>!0,Y7=(s,t)=>t&&t.debounce?lr(s,t.debounce):t&&t.throttle?Ka(s,t.throttle):s,X7="@",K7="#",q7=(s,t=go)=>{const e={},i=s.split(":");if(i.length===2){const[n,r]=i;n[0]==="#"?(e.markId=n.slice(1),e.source=t):n[0]==="@"?(e.markName=n.slice(1),e.source=t):sI(n)?(e.markType=n,e.source=t):e.source=n===bo?bo:t,e.type=r}else i.length===1&&(e.type=s,e.source=t);return e};function Z7(s){s.mode&&Gt.setEnv(s.mode,s.modeParams||{})}class J7 extends aI{constructor(t){super(t),this.getStateAttrs=(e,i)=>{var n,r,a;const o=!P((n=this.runtimeStatesEncoder)===null||n===void 0?void 0:n[e]),l=o?this.runtimeStatesEncoder[e]:(r=this.mark.getSpec().encode)===null||r===void 0?void 0:r[e],h={};if(!l)return h;if(K(l))return h.attributes=l(this.getDatum(),this,e,i),h;if(!o&&(!((a=this.graphicItem.glyphStates)===null||a===void 0)&&a[e]))return this.graphicItem.glyphStates[e];if(l){const d=this.items[0],u=[Object.assign({},d,{nextAttrs:{}})];return xr(this,u,l,this.mark.parameters()),this.coordinateTransformEncode(u),h.attributes=u[0].nextAttrs,this.graphicItem.glyphStates?this.graphicItem.glyphStates[e]||(this.graphicItem.glyphStates[e]=h):this.graphicItem.glyphStates={[e]:h},h}return h},this.glyphMeta=this.mark.getGlyphMeta()}getGlyphGraphicItems(){return this.glyphGraphicItems}initGraphicItem(t={}){if(this.graphicItem)return;this.graphicItem=this.mark.addGraphicItem(t,this.groupKey),this.graphicItem[Eo]=this,this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1);const e=this.glyphMeta.getMarks();this.glyphGraphicItems={},this.graphicItem.getSubGraphic().forEach(i=>{const n=e[i.name];this.glyphGraphicItems[i.name]=i,i.onBeforeAttributeUpdate=r=>this.mark?Hu(n,r,this,i.name):r}),this.clearGraphicAttributes()}useStates(t,e){if(!this.graphicItem)return!1;this.mark.emit(gt.BEFORE_ELEMENT_STATE,{states:t},this),this.states=t.slice();const i=ye(e)?e:this.mark.animate.getAnimationConfigs("state").length!==0;return this.graphicItem.glyphStateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,i),this.mark.emit(gt.AFTER_ELEMENT_STATE,{states:t},this),!0}encodeGraphic(){this.coordinateTransformEncode(this.items);const t=this.transformElementItems(this.items,this.mark.markType);this.graphicItem||this.initGraphicItem(),this.diffState===ne.enter?(this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!0),this.applyGraphicAttributes(t),this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1)):this.applyGraphicAttributes(t),this.diffState!==ne.enter&&this.diffState!==ne.update||!this.states.length||(Object.values(this.glyphGraphicItems).forEach(e=>{e.states={}}),this.useStates(this.states)),this.items.map(e=>{e.nextAttrs={}})}encodeCustom(t){var e;let i={};const n=this.glyphMeta.getChannelEncoder(),r=this.glyphMeta.getFunctionEncoder();if(r&&(i=r.call(null,Object.assign({},(e=this.graphicItem)===null||e===void 0?void 0:e.attribute,t),this.getDatum(),this,this.mark.getGlyphConfig())),n){let a;Object.keys(n).forEach(o=>{var l;if(!P(t[o])){a||(a=Object.assign({},(l=this.graphicItem)===null||l===void 0?void 0:l.attribute,t));const h=n[o].call(null,o,t[o],a,this.getDatum(),this,this.mark.getGlyphConfig());Object.keys(h??{}).forEach(d=>{var u;i[d]=Object.assign((u=i[d])!==null&&u!==void 0?u:{},h[d])})}})}return i}encodeDefault(){const t={};if(this.diffState===ne.enter&&this.glyphMeta.getDefaultEncoder()){const e=this.glyphMeta.getDefaultEncoder().call(null,this.getDatum(),this,this.mark.getGlyphConfig());Object.assign(t,e)}return t}_onGlyphAttributeUpdate(t=!1){return e=>{if(!this.mark)return e;const i=this.glyphMeta.getMarks(),n=Hu(this.mark.getAttributeTransforms(),e,this),r=t?this.encodeDefault():null,a=this.encodeCustom(e);return Object.keys(i).forEach(o=>{const l=i[o],h=this.glyphGraphicItems[o],d=a==null?void 0:a[o],u=Object.assign({},d);if(t){const f=r==null?void 0:r[o];Object.keys(f??{}).forEach(_=>{Zs(this.items[0].nextAttrs,_)||Zs(u,_)||(u[_]=f[_])})}const c=Object.assign({},E4(l,e),u),p=this._generateGlyphItems(l,this.items,c);this.coordinateTransformEncode(p);const g=this.transformElementItems(p,l);this.applyGlyphGraphicAttributes(g,o,h),l===rt.shape&&(h.datum=p[0].datum)}),n}}_generateGlyphItems(t,e,i){const n=e.map(r=>Object.assign({},r,{nextAttrs:i}));return eI.includes(t)&&this.mark.getSpec().enableSegments&&n.forEach((r,a)=>{r.nextAttrs=Object.assign({},e[a].nextAttrs,i)}),n}getGraphicAttribute(t,e=!1,i){if(!this.graphicItem)return;const n=this.getPrevGraphicAttributes(i);return e&&Zs(n,t)?n[t]:(i?this.glyphGraphicItems[i]:this.graphicItem).attribute[t]}setGraphicAttribute(t,e,i=!0,n){if(!this.graphicItem)return;const r=n?this.glyphGraphicItems[n]:this.graphicItem,a=this.getFinalGraphicAttributes(n),o=this.getPrevGraphicAttributes(n);i&&(a[t]=e),Zs(o,t)||(o[t]=r.attribute[t]),r.setAttribute(t,e)}setGraphicAttributes(t,e=!0,i){if(!this.graphicItem)return;const n=i?this.glyphGraphicItems[i]:this.graphicItem,r=this.getFinalGraphicAttributes(i),a=this.getPrevGraphicAttributes(i);Object.keys(t).forEach(o=>{e&&(r[o]=t[o]),Zs(a,o)||(a[o]=n.attribute[o])}),n.setAttributes(t)}diffAttributes(t,e){const i={},n=this.getFinalGraphicAttributes(e);for(const r in t)km(r,n,t)||(i[r]=t[r]);return i}applyGlyphGraphicAttributes(t,e,i){var n,r;if(this.mark.needAnimate()){const a=this.diffAttributes(t,e),o=(n=this.getPrevGraphicAttributes(e))!==null&&n!==void 0?n:{},l=(r=this.getFinalGraphicAttributes(e))!==null&&r!==void 0?r:{};Object.keys(a).forEach(h=>{o[h]=i.attribute[h],l[h]=a[h]}),this.setNextGraphicAttributes(a,e),this.setPrevGraphicAttributes(o,e),this.setFinalGraphicAttributes(l,e),i.setAttributes(a)}else i.setAttributes(t)}getFinalGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).finalAttrs}setFinalGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).finalAttrs=t}getPrevGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).prevAttrs}setPrevGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).prevAttrs=t}getNextGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).nextAttrs}setNextGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).nextAttrs=t}clearChangedGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach(t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t)})}clearGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),this.setFinalGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach(t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t),this.setFinalGraphicAttributes(null,t)})}remove(){this.glyphGraphicItems=null,super.remove()}release(){this.glyphGraphicItems&&(Object.values(this.glyphGraphicItems).forEach(t=>{t[Eo]=null}),this.glyphGraphicItems=null),super.release()}}const yg=s=>s.markType===rt.glyph?new J7(s):new aI(s);function Er(s,t,e){const i=new Map;if(!s||s.length===0)return{keys:[],data:i};if(!t)return i.set(er,e?s.slice().sort(e):s.slice()),{keys:u4,data:i};const n=lh(t);if(s.length===1){const a=n(s[0]);return i.set(a,[s[0]]),{keys:[a],data:i}}const r=new Set;return s.forEach(a=>{var o;const l=n(a),h=(o=i.get(l))!==null&&o!==void 0?o:[];h.push(a),i.set(l,h),r.add(l)}),e&&r.forEach(a=>{i.get(a).sort(e)}),{keys:Array.from(r),data:i}}class $S{constructor(t,e,i){this.prevData=t!=null&&t.length?Er(t,e??null,i):null}setCurrentData(t){this.currentData=t}getCurrentData(){return this.currentData}doDiff(){if(this.callback)if(this.currentData&&this.prevData){const t=new Map(this.prevData.data);this.currentData.keys.forEach(e=>{this.callback(e,this.currentData.data.get(e),t.get(e)),t.delete(e)}),this.prevData.keys.forEach(e=>{t.has(e)&&this.callback(e,null,t.get(e))})}else this.currentData?this.currentData.keys.forEach(t=>{this.callback(t,this.currentData.data.get(t),null)}):this.prevData&&this.prevData.keys.forEach(t=>{this.callback(t,null,this.prevData.data.get(t))})}setCallback(t){this.callback=t}updateToCurrent(){this.prevData=this.currentData,this.currentData=null}reset(){this.prevData=null}}function Q7(s,t,e){const i={enter:[],exit:[],update:[]},n=new $S(s,e);return n.setCallback((r,a,o)=>{P(a)?i.exit.push({prev:o[0]}):P(o)?i.enter.push({next:a[0]}):i.update.push({next:a[0],prev:o[0]})}),n.setCurrentData(Er(t,e)),n.doDiff(),i}function tX(s,t,e){const i={enter:[],exit:[],update:[]},n=new $S(s,e);return n.setCallback((r,a,o)=>{P(a)?i.exit.push({prev:o}):P(o)?i.enter.push({next:a}):i.update.push({next:a,prev:o})}),n.setCurrentData(Er(t,e)),n.doDiff(),i}const QI=(s,t)=>{if(!s)return null;if(s.from){const e=s.from,i=Object.keys(e);i.forEach(r=>{P(e[r])&&delete e[r]});const n=Of(i,t.mark.markType)&&!E(e.segments);if(n){const r=t.items.map(a=>Object.assign({},a,{nextAttrs:Object.assign({},e)}));s.from=t.transformElementItems(r,t.mark.markType,n)}}if(s.to){const e=s.to,i=Object.keys(e);i.forEach(r=>{P(e[r])&&delete e[r]});const n=Of(i,t.mark.markType)&&!E(e.segments);if(n){const r=t.items.map(a=>Object.assign({},a,{nextAttrs:Object.assign({},e)}));s.to=t.transformElementItems(r,t.mark.markType,n)}}return s};function eX(s,t,e,i){const n=K(t.options)?t.options.call(null,s.getDatum(),s,i):t.options;if(!t.type||!st.getAnimationType(t.type))return null;const r=st.getAnimationType(t.type)(s,n,e);return QI(r,s)}const iC=(s,t,e,i,n)=>K(e)?e(s.getDatum(),s,n):e;function iX(s,t,e,i){const n=t.channel;let r=null;return $(n)?r=n.reduce((a,o)=>(a.from[o]=s.getGraphicAttribute(o,!0),a.to[o]=s.getGraphicAttribute(o,!1),a),{from:{},to:{}}):$t(n)&&(r=Object.keys(n).reduce((a,o)=>{var l,h;const d=!P((l=n[o])===null||l===void 0?void 0:l.from),u=!P((h=n[o])===null||h===void 0?void 0:h.to);return(d||u)&&(a.from[o]=d?iC(s,0,n[o].from,0,i):void 0,a.to[o]=u?iC(s,0,n[o].to,0,i):s.getGraphicAttribute(o,!1)),a},{from:{},to:{}})),QI(r,s)}class sX extends ms{constructor(t,e,i,n,r){super(t,e,i,n,r),this._interpolator=r==null?void 0:r.interpolator,this._element=r==null?void 0:r.element}onBind(){var t,e;this.from=(t=this.from)!==null&&t!==void 0?t:{},this.to=(e=this.to)!==null&&e!==void 0?e:{}}getEndProps(){return this.to}onUpdate(t,e,i){this._interpolator&&this._element&&this._interpolator.call(this,e,this.from,this.to,i,this._element.getDatum(),this._element,this.params.parameters)}}class nX extends ms{getEndProps(){return this.to}onBind(){var t,e;this.from=(t=this.from)!==null&&t!==void 0?t:{},this.to=(e=this.to)!==null&&e!==void 0?e:{}}onStart(){var t;const e=(t=this.target.constructor.NOWORK_ANIMATE_ATTR)!==null&&t!==void 0?t:Ni,i=Object.keys(e).filter(a=>e[a]!==0);this.subAnimate.animate.preventAttrs(i);const n=Object.assign({},this.from),r=Object.assign({},this.to);Object.keys(r).forEach(a=>{i.includes(a)?(n[a]=r[a],this.from[a]=r[a]):P(n[a])&&(n[a]=this.target.getComputedAttribute(a))}),this.target.setAttributes(n,!1,{type:je.ANIMATE_UPDATE,animationState:{ratio:0,end:!1}}),this._fromAttribute=n,this._toAttribute=r}onEnd(){this.target.setAttributes(this._toAttribute,!1,{type:je.ANIMATE_END})}update(t,e,i){this.updateCount===0&&this.onFirstRun(),this.updateCount+=1;const n=this.step.getLastProps();Object.keys(n).forEach(r=>{this.subAnimate.animate.validAttr(r)&&(i[r]=n[r])}),this.onUpdate(t,e,i),t&&this.onEnd()}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this._toAttribute,this._fromAttribute)}}Ug.mode|=wh.SET_ATTR_IMMEDIATELY;let rX=0;const sC=s=>!P(s)&&s.prototype instanceof ms;class aX{constructor(t,e,i){this.id=rX++,this.isAnimating=!1,this.runnings=[],this.element=t,this.animationOptions=i,this.unit=e}callback(t){return this.callbackFunction=t,this}animate(t,e){return this.isAnimating=!0,this.animateElement(t,e),this.runnings.length===0&&this.animationEnd(),this}stop(t="end",e=!0){return this.runnings.forEach(i=>i.stop(t)),this.animationEnd(e),this}pause(){return this.runnings.forEach(t=>t.pause()),this}resume(){return this.runnings.forEach(t=>t.resume()),this}startAt(t){return this.runnings.forEach(e=>{const i=this.unit.initialDelay;e.startAt(i+t)}),this}getTotalAnimationTime(){var t;const e=this.unit.initialDelay+this.unit.loopDuration*this.unit.loopCount;return(t=this.unit.totalTime)!==null&&t!==void 0?t:e}getEndAttributes(){return this.runnings.reduce((t,e)=>Object.assign(t,e.getEndProps()),{})}animationEnd(t=!0){var e;this.isAnimating=!1,this.runnings=null,t&&((e=this.callbackFunction)===null||e===void 0||e.call(null))}animateElement(t,e){const i=this.element.getGraphicItem();if(!i)return;const n=i.animate();this.runnings.push(n),n.startAt(this.unit.initialDelay),n.wait(this.unit.loopDelay),this.unit.timeSlices.forEach(r=>{this.animateTimeSlice(n,r,t,e)}),n.wait(this.unit.loopDelayAfter),n.loop(this.unit.loopCount-1),N(this.unit.totalTime)&&setTimeout(()=>{n&&n.stop("end")},this.unit.totalTime),n.onEnd(()=>{this.runnings=this.runnings.filter(r=>r!==n),this.runnings.length===0&&this.animationEnd()})}animateTimeSlice(t,e,i,n){const r=e.delay,a=e.delayAfter,o=e.duration,l=e.effects;if(r>0&&t.wait(r),l.length<0)t.wait(o);else{const h=l.map((d,u)=>{var c;const p=(c=d.type?eX(this.element,d,i,n):d.channel?iX(this.element,d,i,n):void 0)!==null&&c!==void 0?c:{},g=p.custom||(d==null?void 0:d.custom),f=(p==null?void 0:p.customParameters)||(d==null?void 0:d.customParameters);p.from&&Object.keys(p.from).length&&this.unit&&this.animationOptions.timeline.controlOptions.immediatelyApply&&this.element.mark.markType!=="component"&&this.element.getGraphicItem().setAttributes(p.from);const _=sC(g);return!P(g)&&!sC(g)?new sX(p.from,p.to,o,d.easing,{interpolator:g,element:this.element,parameters:f}):_?new g(p.from,p.to,o,d.easing,f):p.to?new nX(p.from,p.to,o,d.easing):void 0}).filter(d=>!P(d));h.length===1?t.play(h[0]):h.length>1&&t.play(new UH(o,h))}a>0&&t.wait(a)}}function oX(s){var t,e,i,n,r,a,o,l,h,d,u,c;if(P(s.timeSlices)){const g=s;return{startTime:(t=g.startTime)!==null&&t!==void 0?t:bT,totalTime:g.totalTime,oneByOne:(e=g.oneByOne)!==null&&e!==void 0?e:Pb,loop:(i=g.loop)!==null&&i!==void 0?i:ST,controlOptions:lt({},AT,(n=g.controlOptions)!==null&&n!==void 0?n:{}),timeSlices:[{duration:(r=g.duration)!==null&&r!==void 0?r:iI,delay:(a=g.delay)!==null&&a!==void 0?a:Cb,delayAfter:(o=g.delayAfter)!==null&&o!==void 0?o:xT,effects:[{type:g.type,channel:g.channel,custom:g.custom,easing:(l=g.easing)!==null&&l!==void 0?l:Eb,customParameters:g.customParameters,options:g.options}]}]}}const p=Y(s.timeSlices).filter(g=>g.effects&&Y(g.effects).filter(f=>f.channel||f.type).length);if(p.length)return{startTime:(h=s.startTime)!==null&&h!==void 0?h:bT,totalTime:s.totalTime,oneByOne:(d=s.oneByOne)!==null&&d!==void 0?d:Pb,loop:(u=s.loop)!==null&&u!==void 0?u:ST,controlOptions:lt({},AT,(c=s.controlOptions)!==null&&c!==void 0?c:{}),timeSlices:p.map(g=>{var f,_;return{duration:g.duration,delay:(f=g.delay)!==null&&f!==void 0?f:Cb,delayAfter:(_=g.delayAfter)!==null&&_!==void 0?_:xT,effects:Y(g.effects).filter(m=>m.channel||m.type).map(m=>{var v;return{type:m.type,channel:m.channel,custom:m.custom,easing:(v=m.easing)!==null&&v!==void 0?v:Eb,customParameters:m.customParameters,options:m.options}})}}),partitioner:s.partitioner,sort:s.sort}}function nC(s){let t=[];return Object.keys(s).forEach(e=>{t=t.concat(tL(e,s[e]))}),t}function tL(s,t,e=0){const i=[];let n=e;return Y(t).forEach(r=>{var a;const o=oX(r);o&&(i.push({state:s,id:(a=o.id)!==null&&a!==void 0?a:`${s}-${n}`,timeline:o,originConfig:r}),n+=1)}),i}function Qr(s,t,e){return K(s)?s.call(null,t.getDatum(),t,e):s}class rC{constructor(t){this.parallelArrangers=[this],this.totalTime=0,this.startTime=0,this.endTime=0,this.animators=t.filter(e=>!P(e)),this.totalTime=this.animators.reduce((e,i)=>Math.max(e,i.getTotalAnimationTime()),0)}parallel(t){const e=Array.from(new Set(this.parallelArrangers.concat(t.parallelArrangers)));return e.forEach(i=>{i.parallelArrangers=e}),this.arrangeTime(),this}after(t){return this.afterArranger=t,this.arrangeTime(),this}arrangeTime(){const t=this.parallelArrangers.reduce((i,n)=>Math.max(i,n.totalTime),this.totalTime),e=this.parallelArrangers.reduce((i,n)=>{var r,a;return Math.max(i,(a=(r=n.afterArranger)===null||r===void 0?void 0:r.endTime)!==null&&a!==void 0?a:0)},0);this.parallelArrangers.forEach(i=>{i.startTime=e,i.endTime=e+t,i.animators.forEach(n=>{n.startAt(e)})})}}class aC{constructor(t,e){this.state=null,this.immediateConfigs=[],this.isEnabled=!0,this.disabledStates=[],this.animators=new Map,this.elementRecorder=new WeakMap,this.timelineCount={},this.mark=t,this.configs=nC(e??{})}getAnimationConfigs(t){var e;return this.isEnabled?((e=this.configs)!==null&&e!==void 0?e:[]).filter(i=>i.state===t):[]}updateConfig(t){this.configs=nC(t??{})}updateState(t){this.state=t}animate(){if(!this.isEnabled||!this.configs||!this.configs.length)return;const t=this.mark.getAllElements(),e=this.mark.parameters();return t.forEach(i=>{var n;i.isReserved&&i.diffState!==ne.exit&&(i.isReserved=!1);const r=(n=this.elementRecorder.get(i))===null||n===void 0?void 0:n.prevState;this.configs.some(a=>r!==i.diffState&&a.state===r&&a.timeline.controlOptions.stopWhenStateChange)&&this.clearElementAnimation(i,!1)}),this.configs.forEach(i=>{this.animateByTimeline(i,t,e)}),this.mark.cleanExitElements(),this}runAnimationByState(t){if(!this.isEnabled)return;const e=this.configs.filter(a=>a.state===t),i=this.mark.getAllElements(),n=this.mark.parameters(),r=e.reduce((a,o)=>a.concat(this.animateByTimeline(o,i,n,!0)),[]);return new rC(r)}stopAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach(i=>i.stop()),this}pauseAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach(i=>i.pause()),this}resumeAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach(i=>i.resume()),this}run(t){if(!this.isEnabled)return;const e=tL(yT,t,this.immediateConfigs.length);this.immediateConfigs=this.immediateConfigs.concat(e);const i=this.mark.getAllElements(),n=this.mark.parameters(),r=e.reduce((a,o)=>a.concat(this.animateByTimeline(o,i,n,!0)),[]);return new rC(r)}stop(){return this.animators.forEach(t=>{t.forEach(e=>e.stop())}),this}pause(){return this.animators.forEach(t=>t.forEach(e=>e.pause())),this}resume(){return this.animators.forEach(t=>t.forEach(e=>e.resume())),this}reverse(){return this}restart(){return this}record(){return this}recordEnd(){return this}isAnimating(){let t=!1;return this.animators.forEach(e=>{t=t||e.some(i=>i.isAnimating)}),t}isElementAnimating(t){var e;const i=(e=this.elementRecorder.get(t))===null||e===void 0?void 0:e.count;return P(i)||Object.values(i).every(n=>n===0)}getAnimatorCount(){let t=0;return this.animators.forEach(e=>t+=e.length),t}getAllAnimators(){const t=[];return this.animators.forEach(e=>{t.push(...e)}),t}getElementAnimators(t,e){var i;const n=Y(t);let r=[];return e?r=(i=this.animators.get(e))!==null&&i!==void 0?i:[]:this.animators.forEach(a=>{r=r.concat(a)}),r.filter(a=>n.includes(a.element))}enable(){return this.isEnabled=!0,this}disable(){return this.isEnabled=!1,this.stop(),this.animators.clear(),this}enableAnimationState(t){const e=Y(t);return this.disabledStates=this.disabledStates.filter(i=>!e.includes(i)),this}disableAnimationState(t){const e=Y(t);return this.disabledStates=this.disabledStates.concat(e),this}release(){this.stop(),this.animators.clear(),this.configs=null,this.animators=null,this.elementRecorder=null,this.timelineCount=null}animateByTimeline(t,e,i,n=!1){var r;const a=[],o=e.filter(l=>{const h=!(l.isReserved&&l.diffState===ne.exit),d=this.getAnimationState(l),u=!this.disabledStates.includes(d),c=n||d===t.state,p=!t.timeline.partitioner||t.timeline.partitioner(l.getDatum(),l,i);return h&&u&&c&&p});if(o.length){P(this.timelineCount[t.id])&&(this.timelineCount[t.id]=0),t.timeline.sort&&o.sort((h,d)=>t.timeline.sort(h.getDatum(),d.getDatum(),h,d,i));const l={width:this.mark.view.width(),height:this.mark.view.height(),group:(r=this.mark.group)!==null&&r!==void 0?r:null,mark:this.mark,view:this.mark.view,elementCount:o.length,elementIndex:0};o.forEach((h,d)=>{l.elementIndex=d;const u=Object.assign({[m4]:l},i),c=this.getAnimationUnit(t.timeline,h,d,o.length,u);a.push(this.animateElement(t,c,h,l,u))})}return a}animateElement(t,e,i,n,r){var a,o;const l=new aX(i,e,t);if(l.animate(n,r),!l.isAnimating)return;i.diffState===ne.exit&&(i.isReserved=!0);const h=this.timelineCount[t.id]===0;this.timelineCount[t.id]+=1;const d=(a=this.elementRecorder.get(i))!==null&&a!==void 0?a:{prevState:t.state,count:{}};d.prevState=t.state,d.count[t.state]=((o=d.count[t.state])!==null&&o!==void 0?o:0)+1,this.elementRecorder.set(i,d);const u=this.animators.get(t.state);u?u.push(l):this.animators.set(t.state,[l]),l.callback(()=>{this.handleAnimatorEnd(l)});const c={mark:this.mark,animationState:t.state,animationConfig:t.originConfig};return h&&this.mark.emit(gt.ANIMATION_START,c),this.mark.emit(gt.ELEMENT_ANIMATION_START,c,i),l}getAnimationState(t){const e=Ue(this.state,this.mark.parameters(),t.getDatum(),t);return e??t.diffState}getAnimationUnit(t,e,i,n,r){const a=[],o=Qr(t.startTime,e,r),l=Qr(t.totalTime,e,r),h=Qr(t.oneByOne,e,r),d=Qr(t.loop,e,r);let u=0;t.timeSlices.forEach(p=>{var g;const f=Qr(p.delay,e,r),_=Qr(p.delayAfter,e,r),m=(g=Qr(p.duration,e,r))!==null&&g!==void 0?g:l/n,v=Y(p.effects).map(y=>Object.assign({},y,{customParameters:Qr(y.customParameters,e,r)}));a.push({effects:v,duration:m,delay:f,delayAfter:_}),u+=f+m+_});const c=dt(h)?h:h===!0?u:0;return{initialDelay:o,loopCount:dt(d)?d:d===!0?1/0:1,loopDelay:c*i,loopDelayAfter:c*(n-i-1),loopAnimateDuration:u,loopDuration:u+c*(n-1),totalTime:l,timeSlices:a}}clearElementAnimation(t,e=!0){this.animators.forEach(i=>{i.forEach(n=>{n.element===t&&(n.animationOptions.state===ne.exit?n.stop("start",!1):n.stop("end",!1),this.handleAnimatorEnd(n,e))})}),this.elementRecorder.delete(t)}clearAllElements(){const t=this.mark.getAllElements();t&&t.forEach((e,i)=>{this.clearElement(e,i===t.length-1)})}clearElement(t,e=!0){this.clearElementAnimation(t),t.getGraphicItem()&&(t.clearGraphicAttributes(),t.diffState===ne.exit&&(t.isReserved=!1),e&&this.mark.cleanExitElements())}handleAnimatorEnd(t,e=!0){const i=t.element,n=t.animationOptions,r=n.state,a=r===yT,o=this.elementRecorder.get(i).count;o[r]-=1,this.animators.set(r,this.animators.get(r).filter(u=>u!==t)),this.animators.get(r).length===0&&this.animators.delete(r),this.timelineCount[n.id]-=1;const l=this.timelineCount[n.id]===0,h=a?this.immediateConfigs.find(u=>u.id===n.id).originConfig:this.configs.find(u=>u.id===n.id).originConfig;l&&(delete this.timelineCount[n.id],a&&(this.immediateConfigs=this.immediateConfigs.filter(u=>u.id!==n.id))),e&&(Object.keys(this.timelineCount).length===0?this.clearAllElements():r===ne.exit&&o[ne.exit]===0&&this.clearElement(i));const d={mark:this.mark,animationState:r,animationConfig:h};l&&this.mark.emit(gt.ANIMATION_END,d),this.mark.emit(gt.ELEMENT_ANIMATION_END,d,i)}}var lX=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};class td extends Wm{constructor(t,e,i){super(t),this.grammarType="mark",this.elements=[],this.elementMap=new Map,this.isUpdated=!0,this._isReentered=!1,this.animate=new aC(this,{}),this.differ=new $S([]),this.evaluateSync=(n,r)=>{var a;return this.evaluateMainTasks(n,r),!((a=this.renderContext)===null||a===void 0)&&a.progressive||this.evaluateTransformSync(this._getTransformsAfterEncode(),this.elements,r),this},this.markType=e,this.spec.type=e,this.spec.encode={update:{}},this.spec.group=i,i&&(this.group=i,this.attach(i),i.appendChild(this))}parse(t){var e,i,n;if(super.parse(t),this.spec.group){const a=ht(this.spec.group)?this.view.getMarkById(this.spec.group):this.spec.group;this.detach(a)}const r=ht(t.group)?this.view.getMarkById(t.group):t.group;return this.attach(r),this.join((e=t.from)===null||e===void 0?void 0:e.data,t.key,t.sort,t.groupBy,t.groupSort),this.coordinate(t.coordinate),this.state(t.state,this.spec.stateSort),Object.keys((i=this.spec.encode)!==null&&i!==void 0?i:{}).forEach(a=>{this.encodeState(a,{},!0)}),Object.keys((n=t.encode)!==null&&n!==void 0?n:{}).forEach(a=>{this.encodeState(a,t.encode[a])}),this.animation(t.animation),this.animationState(t.animationState),this.morph(t.morph,t.morphKey,t.morphElementKey),this.layout(t.layout),this.configure(t),this.transform(t.transform),this.parseAddition(t),this.spec=t,this.markType=t.type,this.commit(),this}parameters(){var t;return(t=this._finalParameters)!==null&&t!==void 0?t:super.parameters()}parseAddition(t){return this}reuse(t){if(t.grammarType!==this.grammarType)return this;const e=t;return this.markType=e.markType,this.coord=e.coord,this.elementMap=e.elementMap,this.elements=e.elements,this.elementMap.forEach(i=>i.mark=this),this.differ=e.differ,this.animate=e.animate,this.animate.mark=this,this._context=e._context,this.graphicItem=e.graphicItem,this.graphicIndex=e.graphicIndex,this.graphicParent=e.graphicParent,this.needClear=e.needClear,this.isUpdated=e.isUpdated,this}needLayout(){return!P(this.spec.layout)}handleLayoutEnd(){}handleRenderEnd(){this.needClear&&(this.cleanExitElements(),this.elementMap.forEach(t=>{t.diffState===ne.exit?t.clearGraphicAttributes():t.clearChangedGraphicAttributes()}),this.differ.updateToCurrent(),this.needClear=!1)}evaluateMainTasks(t,e){var i;if(this.needSkipBeforeLayout()&&this.view.getLayoutState()===Ys.before)return this;const n=(i=this.view.renderer)===null||i===void 0?void 0:i.stage();this.init(n,e);const r=this.evaluateTransformSync(this._getTransformsBeforeJoin(),t??_g,e);let a=r!=null&&r.progressive?t:r;return this.evaluateGroup(a),this.renderContext=this.parseRenderContext(a,e),this.renderContext.progressive?(this.differ.reset(),this.elementMap.clear(),this.evaluateProgressive()):(r!=null&&r.progressive&&(this.renderContext.parameters=e,this.renderContext.beforeTransformProgressive=r.progressive,a=r.progressive.output()),this.emit(gt.BEFORE_MARK_JOIN),this.evaluateJoin(a),this.emit(gt.AFTER_MARK_JOIN),this.emit(gt.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,e),this.emit(gt.AFTER_MARK_STATE),this.emit(gt.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),e),this.emit(gt.AFTER_MARK_ENCODE)),this.emit(gt.BEFORE_MARK_UPDATE),this.update(this.spec),this.emit(gt.AFTER_MARK_UPDATE),this}evaluateGroup(t){if(this.markType===rt.group)return;const e=Er(t??_g,this.spec.groupBy,this.spec.groupSort),i=e.keys;this._groupKeys=i,this.differ.setCurrentData(e)}_getTransformsAfterEncodeItems(){return this.transforms&&this.transforms.filter(t=>t.markPhase==="afterEncodeItems")}_getTransformsAfterEncode(){return this.transforms&&this.transforms.filter(t=>P(t.markPhase)||t.markPhase==="afterEncode")}_getTransformsBeforeJoin(){return this.transforms?this.transforms.filter(t=>t.markPhase==="beforeJoin"):[]}evaluate(t,e){var i;return lX(this,void 0,void 0,function*(){return this.evaluateMainTasks(t,e),!((i=this.renderContext)===null||i===void 0)&&i.progressive||(yield this.evaluateTransform(this._getTransformsAfterEncode(),this.elements,e)),this})}output(){return this}join(t,e,i,n,r){return this.grammarSource&&(this.detach(this.grammarSource),this.grammarSource=null),this.spec.from=null,P(t)||(ht(t)?this.grammarSource=this.view.getDataById(t):this.grammarSource=t,this.spec.from={data:t},this.attach(this.grammarSource)),this.spec.key=e,this.spec.sort=i,this.spec.groupBy=n,this.spec.groupSort=r,this.commit(),this}coordinate(t){return ht(t)?this.coord=this.view.getCoordinateById(t):this.coord=t,this.attach(this.coord),this.commit(),this}state(t,e){return this.spec.stateSort=e,this.setFunctionSpec(t,"state")}encode(t,e,i){return this.encodeState(ne.update,t,e,i)}encodeState(t,e,i,n){if(t===ne.enter&&(this._isReentered=!0),this.spec.encode[t]){const r=this.spec.encode[t];if(_a(r))this.detach(no(r,this.view));else{const a=ht(e);a&&n||!a&&i?(Object.keys(r).forEach(o=>{this.detach(no(r[o],this.view))}),this.spec.encode[t]={}):a?this.detach(no(r[e],this.view)):Object.keys(e).forEach(o=>{this.detach(no(r[o],this.view))})}}return e&&(this.spec.encode[t]||(this.spec.encode[t]={}),ht(e)?(this.spec.encode[t][e]=i,this.attach(no(i,this.view))):_a(e)?(this.spec.encode[t]=e,this.attach(no(e,this.view))):e&&(Object.assign(this.spec.encode[t],e),Object.values(e).forEach(r=>{this.attach(no(r,this.view))}))),this.commit(),this}_getEncoders(){var t;return(t=this.spec.encode)!==null&&t!==void 0?t:{}}animation(t){return this.spec.animation=t,this}animationState(t){return this.setFunctionSpec(t,"animationState")}layout(t){return this.spec.layout=t,this.commit(),this}morph(t,e,i){return this.spec.morph=t,this.spec.morphKey=e,this.spec.morphElementKey=i,this}transform(t){const e=d_(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]);const i=d_(t,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.spec.transform=t,this.commit(),this}configure(t){const e=["clip","zIndex","interactive","context","setCustomizedShape","large","largeThreshold","progressiveStep","progressiveThreshold","support3d","morph","morphKey","morphElementKey","attributeTransforms","skipTheme","enableSegments"];return t===null?(e.forEach(i=>{P(this.spec[i])||(this.spec[i]=void 0)}),this):(e.forEach(i=>{P(t[i])||(this.spec[i]=t[i])}),this)}context(t){return this.spec.context=t,this._context=t,this}isCollectionMark(){return eI.includes(this.markType)}needAnimate(){var t;return!(!((t=this.renderContext)===null||t===void 0)&&t.progressive)&&!P(this.spec.animation)}getAllElements(){const t=this.elements.slice();return this.elementMap.forEach(e=>{e.diffState!==ne.exit||t.includes(e)||t.push(e)}),this.spec.sort&&t.sort((e,i)=>this.spec.sort(e.getDatum(),i.getDatum())),t}getScales(){const t={};return this.references.forEach((e,i)=>{i.grammarType===Mb.scale&&(t[i.id()]=i.output())}),t}getScalesByChannel(){const t=this.spec.encode;if(!t)return{};const e={},i=this.parameters();return Object.keys(t).forEach(n=>{const r=t[n];r&&!_a(r)&&Object.keys(r).forEach(a=>{Tm(r[a])&&(e[a]=zu(r[a].scale,i))})}),e}getFieldsByChannel(){const t=this.spec.encode;if(!t)return{};const e={};return Object.keys(t).forEach(i=>{const n=t[i];_a(n)||Object.keys(n).forEach(r=>{BS(n[r])&&(e[r]=n[r].field)})}),e}init(t,e){var i,n,r,a;if(this._delegateEvent||(this._delegateEvent=(h,d)=>{var u;const c=(u=h.target)===null||u===void 0?void 0:u[Eo];if((c==null?void 0:c.mark)===this){const p=lx(this.view,h,c,d,go);this.emitGrammarEvent(d,p,c)}},this.initEvent()),this.animate||(this.animate=new aC(this,this.spec.animation),this.needAnimate()&&this.animate.updateState(this.spec.animationState)),!this.group){const h=zu(this.spec.group,e);this.group=h,h&&h.appendChild(this)}const o=this.group?this.group.getGroupGraphicItem():t.defaultLayer,l=(r=(n=(i=this.group)===null||i===void 0?void 0:i.children)===null||n===void 0?void 0:n.indexOf(this))!==null&&r!==void 0?r:0;if(this.markType!==rt.group){if(!this.graphicItem){const h=Qd(this,rt.group,{pickable:!1,zIndex:(a=this.spec.zIndex)!==null&&a!==void 0?a:0});(this.spec.support3d||d4.includes(this.markType))&&h.setMode("3d"),h.name=`${this.id()||this.markType}`,this.graphicItem=h}this.graphicParent=this.graphicItem,!o||this.graphicIndex===l&&this.graphicItem.parent===o||o.insertIntoKeepIdx(this.graphicItem,l)}else this.graphicParent=o;this.graphicIndex=l}update(t){this._context=this.spec.context,this.isUpdated=!0,this.renderContext.progressive||(t.animation&&this.animate.updateConfig(t.animation),this.animate.updateState(t.animationState)),this.markType!==rt.group?(P(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),P(t.clip)||this.graphicItem.setAttribute("clip",t.clip),this.elementMap.forEach(e=>{e.updateGraphicItem({interactive:t.interactive})})):this.elementMap.forEach(e=>{e.updateGraphicItem({clip:t.clip,zIndex:t.zIndex,interactive:t.interactive})})}evaluateJoin(t){var e,i,n,r;this.needClear=!0;const a=lh((n=(e=this.spec.key)!==null&&e!==void 0?e:(i=this.grammarSource)===null||i===void 0?void 0:i.getDataIDKey())!==null&&n!==void 0?n:()=>er),o=lh((r=this.spec.groupBy)!==null&&r!==void 0?r:()=>er),l=this.spec.sort,h=this.isCollectionMark(),d=new Set(this.elements.filter(p=>p.diffState===ne.enter)),u=[];this.differ.setCallback((p,g,f)=>{const _=p;let m;if(P(g))m=this.elementMap.get(_),m&&(m.diffState=ne.exit);else if(P(f)){m=this.elementMap.has(_)?this.elementMap.get(_):yg(this),m.diffState===ne.exit&&(m.diffState=ne.enter,this.animate.getElementAnimators(m,ne.exit).forEach(y=>y.stop("start"))),m.diffState=ne.enter;const v=h?p:o(g[0]);m.updateData(v,g,a,this.view),this.elementMap.set(_,m),u.push(m)}else if(m=this.elementMap.get(_),m){m.diffState=ne.update;const v=h?p:o(g[0]);m.updateData(v,g,a,this.view),u.push(m)}d.delete(m)});const c=t??_g;h||this.differ.setCurrentData(Er(c,p=>`${o(p)}-${a(p)}`,void 0)),this.differ.doDiff(),d.forEach(p=>{this.elementMap.delete(h?p.groupKey:`${p.groupKey}-${p.key}`),p.remove(),p.release()}),this.elements=u,l&&this.elements.length>=2&&this.elements.sort((p,g)=>l(p.getDatum(),g.getDatum()))}evaluateState(t,e,i){e&&t.forEach(n=>{n.state(e,i)})}evaluateGroupEncode(t,e,i){var n;if(this.markType===rt.group){const a=this.elements[0],o={},l=[Object.assign({},(n=a.items)===null||n===void 0?void 0:n[0],{nextAttrs:o})];return xr(a,l,e,i),o}if(!this._groupKeys||!e)return;const r={};return this._groupKeys.forEach(a=>{const o=t.find(l=>l.groupKey===a);o&&(r[a]=yo(e,o.items&&o.items[0]&&o.items[0].datum,o,i))}),r}evaluateEncode(t,e,i){if(e){this.emit(gt.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const n=this.evaluateGroupEncode(t,e[Zn.group],i);t.forEach(r=>{this.markType===rt.group&&n?r.items.forEach(a=>{a.nextAttrs=Object.assign(a.nextAttrs,n)}):n!=null&&n[r.groupKey]&&!this.isCollectionMark()&&r.items.forEach(a=>{a.nextAttrs=Object.assign(a.nextAttrs,n[r.groupKey])}),r.encodeItems(r.items,e,this._isReentered,i)}),this._isReentered=!1,this.evaluateTransformSync(this._getTransformsAfterEncodeItems(),t,i),t.forEach(r=>{r.encodeGraphic(this.isCollectionMark()?n==null?void 0:n[r.groupKey]:null)}),this.emit(gt.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach(n=>{n.initGraphicItem()})}addGraphicItem(t,e,i){var n;const r=i??Qd(this,this.markType,t);if(r){if(!((n=this.renderContext)===null||n===void 0)&&n.progressive){let a;if(this._groupKeys){const o=this._groupKeys.indexOf(e);o>=0&&(a=this.graphicParent.getChildAt(o))}else a=this.graphicParent.at(0);this.isCollectionMark()?(r.incremental=1,a.appendChild(r)):a.incrementalAppendChild(r)}else this.graphicParent.appendChild(r);return r}}parseRenderContext(t,e){const i=this.markType!==rt.group&&this.spec.progressiveStep>0&&this.spec.progressiveThreshold>0&&this.spec.progressiveStep<this.spec.progressiveThreshold,n=this.spec.large&&this.spec.largeThreshold>0&&t.length>=this.spec.largeThreshold;if(i){const r=this.differ.getCurrentData();return r&&r.keys&&r.keys.some(a=>r.data.get(a).length>this.spec.progressiveThreshold)?{large:n,parameters:e,progressive:{data:t,step:this.spec.progressiveStep,currentIndex:0,totalStep:r.keys.reduce((a,o)=>Math.max(Math.ceil(r.data.get(o).length/this.spec.progressiveStep),a),1),groupedData:r.data}}:{large:n}}return{large:n}}isProgressive(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}isDoingProgressive(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex<this.renderContext.progressive.totalStep||this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.unfinished())}clearProgressive(){this.renderContext&&this.renderContext.progressive&&(this.elements=[],this.graphicParent.children.forEach(t=>{t.incrementalClearChild()}),this.graphicParent.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}restartProgressive(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}evaluateJoinProgressive(){var t,e,i;const n=this.renderContext.progressive.currentIndex,r=lh((i=(t=this.spec.key)!==null&&t!==void 0?t:(e=this.grammarSource)===null||e===void 0?void 0:e.getDataIDKey())!==null&&i!==void 0?i:()=>er),a=[];if(this.isCollectionMark())return this._groupKeys.forEach((l,h)=>{const d=this.renderContext.progressive.groupedData.get(l),u=this.renderContext.progressive.step,c=d.slice(n*u,(n+1)*u);if(n===0){const p=yg(this);p.diffState=ne.enter,p.updateData(l,c,r,this.view),a.push(p)}else{const p=this.elements[h];p.updateData(l,c,r,this.view),a.push(p)}}),a;const o={};return this._groupKeys.forEach(l=>{const h=this.renderContext.progressive.groupedData.get(l),d=this.renderContext.progressive.step,u=h.slice(n*d,(n+1)*d),c=[];u.forEach(p=>{const g=yg(this);g.diffState=ne.enter,g.updateData(l,[p],r,this.view),c.push(g),a.push(g)}),o[l]=c}),{groupElements:o,elements:a}}evaluateEncodeProgressive(t,e,i){if(!e)return void t.forEach(l=>{l.initGraphicItem()});const n=Object.keys(e).reduce((l,h)=>(!e[h]||h!==Zn.enter&&h!==Zn.exit&&h!==Zn.update||(l[h]=M4(this.markType,e[h],this.glyphType).positionEncoder),l),{}),r=this.renderContext.progressive.currentIndex,a=this.isCollectionMark();this.emit(gt.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const o=this.evaluateGroupEncode(t,e[Zn.group],i);if(t.forEach((l,h)=>{const d=r>0||!a&&h>0;!d&&(o!=null&&o[l.groupKey])&&l.items.forEach(u=>{u.nextAttrs=Object.assign(u.nextAttrs,o[l.groupKey])}),l.encodeItems(l.items,d?n:e,this._isReentered,i)}),this._isReentered=!1,this.evaluateTransformSync(this._getTransformsAfterEncodeItems(),t,i),t.forEach(l=>{l.encodeGraphic()}),this.emit(gt.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this),r===0&&!a){const l=t[0].getGraphicItem(),h=l==null?void 0:l.parent;if(h){const d=l.attribute,u={},c={};Object.keys(d).forEach(p=>{["pickable","zIndex"].includes(p)||(If(this.markType,p)?c[p]=d[p]:u[p]=d[p])}),h.setTheme({common:u}),l.initAttributes(c)}}}evaluateProgressive(){var t,e,i;if(!((t=this.renderContext)===null||t===void 0)&&t.beforeTransformProgressive){this.renderContext.beforeTransformProgressive.progressiveRun();const l=this.renderContext.beforeTransformProgressive.output();return this.emit(gt.BEFORE_MARK_JOIN),this.evaluateJoin(l),this.emit(gt.AFTER_MARK_JOIN),this.emit(gt.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,this.renderContext.parameters),this.emit(gt.AFTER_MARK_STATE),this.emit(gt.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),this.renderContext.parameters),void this.emit(gt.AFTER_MARK_ENCODE)}if(!(!((e=this.renderContext)===null||e===void 0)&&e.progressive))return;const n=this.renderContext.parameters;this.emit(gt.BEFORE_MARK_JOIN);const r=this.evaluateJoinProgressive(),a=Array.isArray(r)?r:r.elements;if(this.emit(gt.AFTER_MARK_JOIN),this.renderContext.progressive.currentIndex===0?(this.graphicParent.removeAllChild(),this._groupKeys.forEach(l=>{const h=Qd(this,rt.group,{pickable:!1,zIndex:this.spec.zIndex});h.incremental=this.renderContext.progressive.step,this.graphicParent.appendChild(h)}),this.elements=a):this.elements=this.elements.concat(a),this.emit(gt.BEFORE_MARK_STATE),this.evaluateState(a,this.spec.state,n),this.emit(gt.AFTER_MARK_STATE),this.emit(gt.BEFORE_MARK_ENCODE),Array.isArray(r))this.evaluateEncodeProgressive(a,this._getEncoders(),n);else{const l=r.groupElements;Object.keys(l).forEach(h=>{this.evaluateEncodeProgressive(l[h],this._getEncoders(),n)})}this.emit(gt.AFTER_MARK_ENCODE);const o=(i=this._getTransformsAfterEncode())===null||i===void 0?void 0:i.filter(l=>l.canProgressive===!0);o!=null&&o.length&&this.evaluateTransformSync(o,this.elements,n),this.renderContext.progressive.currentIndex+=1}isLargeMode(){return this.renderContext&&this.renderContext.large}cleanExitElements(){this.elementMap.forEach((t,e)=>{t.diffState!==ne.exit||t.isReserved||(this.elementMap.delete(e),t.remove(),t.release())})}getGroupGraphicItem(){if(this.elements&&this.elements[0]&&this.elements[0].getGraphicItem)return this.elements[0].getGraphicItem()}getBounds(){var t;return this.graphicItem?this.graphicItem.AABBBounds:(t=this.getGroupGraphicItem())===null||t===void 0?void 0:t.AABBBounds}getMorphConfig(){var t;return{morph:(t=this.spec.morph)!==null&&t!==void 0&&t,morphKey:this.spec.morphKey,morphElementKey:this.spec.morphElementKey}}getAttributeTransforms(){var t;return(t=this.spec.attributeTransforms)!==null&&t!==void 0?t:Ro[this.markType]}getContext(){return this._context}needSkipBeforeLayout(){var t,e;if(((t=this.spec.layout)===null||t===void 0?void 0:t.skipBeforeLayouted)===!0)return!0;let i=this.group;for(;i;){if(((e=i.getSpec().layout)===null||e===void 0?void 0:e.skipBeforeLayouted)===!0)return!0;i=i.group}return!1}initEvent(){this._delegateEvent&&this.view.renderer.stage().on("*",this._delegateEvent)}releaseEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.off("*",this._delegateEvent)}}clear(){var t;super.clear(),this.transforms=null,this.elementMap=null,this.elements=null,this.graphicItem=null,this.animate=null,(t=this.group)===null||t===void 0||t.removeChild(this),this.group=null}prepareRelease(){this.animate.stop(),this.elementMap.forEach(t=>t.diffState=ne.exit),this._finalParameters=this.parameters()}release(){this.releaseEvent(),this.elements.forEach(t=>t.release()),this.elementMap.clear(),this._finalParameters=null,this.animate&&this.animate.release(),this.graphicItem&&Lf(this.graphicItem),this.detachAll(),super.release()}}let hX=class extends td{constructor(t,e){super(t,rt.group,e),this.children=[]}parseRenderContext(){return{large:!1}}appendChild(t){return this.children.push(t),this}removeChild(t){return this.children=this.children.filter(e=>e!==t),this}includesChild(t,e=!0){return!!this.children.includes(t)||!!e&&this.children.some(i=>i.markType===rt.group&&i.includesChild(t,!0))}updateLayoutChildren(){return this.children.length?(this.layoutChildren||(this.layoutChildren=[]),this.layoutChildren=this.children.filter(t=>t.needLayout()),this):this}getAttributeTransforms(){return Ro.rect}evaluateJoin(t){if(!this.elements.length){const e=yg(this);e.updateData(er,_g,()=>"",this.view),this.elements=[e],this.elementMap.set(er,e)}}addGraphicItem(t,e,i){const n=i??Qd(this,this.markType,t);if(n)return this.emit(gt.BEFORE_ADD_VRENDER_MARK),n.name=`${this.id()||this.markType}`,this.graphicParent.insertIntoKeepIdx(n,this.graphicIndex),this.emit(gt.AFTER_ADD_VRENDER_MARK),n}};function oC(s,t){if(N(s))return s;const e=s.trim();if(e==="auto")return 0;if(e.endsWith("%")){const i=parseFloat(e.substring(0,e.length-1));return N(i)?i*t:0}return 0}function dX(s,t,e){var i,n,r,a;const o=(i=s.gridTemplateRows)!==null&&i!==void 0?i:[e],l=(n=s.gridTemplateColumns)!==null&&n!==void 0?n:[t],h=(r=s.gridRowGap)!==null&&r!==void 0?r:0,d=(a=s.gridColumnGap)!==null&&a!==void 0?a:0,u=o.map(y=>oC(y,e)),c=l.map(y=>oC(y,t)),p=Math.max(0,u.reduce((y,b)=>y-b,e)-u.length*h)/o.filter(y=>y==="auto").length,g=Math.max(0,c.reduce((y,b)=>y-b,t)-c.length*d)/l.filter(y=>y==="auto").length;let f=0;const _=u.map((y,b)=>{const x=o[b]==="auto"?p:y,S=f;return f+=x+h,S});_.push(f);let m=0;const v=c.map((y,b)=>{const x=l[b]==="auto"?g:y,S=m;return m+=x+d,S});return v.push(m),{rows:_,columns:v,rowGap:h,columnGap:d}}function Up(s,t){return Math.min(s<0?s+t:s-1,t)}function lC(s,t,e){let i=Up(s,e),n=Up(t,e);if(N(s)||N(t)?N(s)?N(t)||(i=Up(Math.max(0,n-1),e)):n=Up(i+1,e):(i=1,n=2),i>n){const r=n;n=i,i=r}return{start:i,end:n}}function uX(s,t,e,i,n){const r=s.rows.length,a=s.columns.length,{start:o,end:l}=lC(t,e,r),{start:h,end:d}=lC(i,n,a),u=s.columns[o],c=s.columns[l]-(d===a?0:s.columnGap),p=s.rows[h],g=s.rows[d]-(l===r?0:s.rowGap);return new Pi().set(u,p,c,g)}const cX=(s,t,e,i)=>{const n=dX(s.getSpec().layout,e.width(),e.height());t&&t.forEach(r=>{const a=r.getSpec().layout;r.layoutBounds=uX(n,a.gridRowStart,a.gridRowEnd,a.gridColumnStart,a.gridColumnEnd),r.commit()})},pX={[be.axis]:0,[be.legend]:1,[be.slider]:2,[be.player]:3,[be.datazoom]:4},hC=s=>{var t,e,i;return(e=(t=s.getSpec().layout)===null||t===void 0?void 0:t.order)!==null&&e!==void 0?e:s.markType==="component"&&(i=pX[s.componentType])!==null&&i!==void 0?i:1/0},dC=(s,t,e,i)=>{const n=e.clone(),r=s.getSpec().layout,a=Ds(r.maxChildWidth,n.width()),o=Ds(r.maxChildHeight,n.width());let l=0,h=0,d=0,u=0;t.forEach(m=>{const v=m.getSpec().layout,y=ya(v.padding),b=i.parseMarkBounds?i.parseMarkBounds(m.getBounds(),m):m.getBounds();if(v.position==="top"||v.position==="bottom"){const x=Math.min(b.height()+y.top+y.bottom,o);v.position==="top"?n.y1+=x:n.y2-=x,b.x1<e.x1&&(l=Math.max(l,e.x1-b.x1)),b.x2>e.x2&&(h=Math.max(h,b.x2-e.x2))}if(v.position==="left"||v.position==="right"){const x=Math.min(b.width()+y.left+y.right,a);v.position==="left"?n.x1+=x:n.x2-=x,b.y1<e.y1&&(d=Math.max(d,e.y1-b.y1)),b.y2>e.y2&&(u=Math.max(u,b.y2-e.y2))}v.position==="outside"&&(n.x1+=Math.max(e.x1-b.x1,0)+y.left,n.x2-=Math.max(b.x2-e.x2,0)+y.right,n.y1+=Math.max(e.y1-b.y1,0)+y.top,n.y2-=Math.max(b.y2-e.y2)+y.bottom)}),l>n.x1-e.x1&&l<e.width()&&(n.x1=e.x1+l),h>e.x2-n.x2&&h<e.width()&&(n.x2=e.x2-h),d>n.y1-e.y1&&d<e.height()&&(n.y1=e.y1+d),u>e.y2-n.y2&&u<e.height()&&(n.y2=e.y2-u);let c=n.y1,p=n.y2,g=n.x1,f=n.x2;const _=t.slice().sort((m,v)=>hC(m)-hC(v));for(let m=0,v=_.length;m<v;m++){const y=_[m],b=y.getSpec().layout,x=ya(b.padding),S=i.parseMarkBounds?i.parseMarkBounds(y.getBounds(),y):y.getBounds();if(b.position==="top"||b.position==="bottom"){const A=Math.min(S.height()+x.top+x.bottom,o);if(b.position==="top"?(y.layoutBounds=new Pi().set(n.x1,c-A,n.x2,c),c-=A):(y.layoutBounds=new Pi().set(n.x1,p,n.x2,p+A),p+=A),y.relativePosition={top:y.layoutBounds.y1-n.y1,bottom:y.layoutBounds.y1-n.y2},b.align){const k=S.width()+x.left+x.right;k<n.width()&&(b.align==="center"?(y.layoutBounds.x1=(n.x1+n.x2)/2-k/2,y.layoutBounds.x2=y.layoutBounds.x1+k,y.relativePosition.left=y.relativePosition.right=(n.width()-k)/2):b.align==="right"?(y.layoutBounds.x1=n.x2-k,y.layoutBounds.x2=n.x2,y.relativePosition.right=0,y.relativePosition.left=n.width()-k):b.align==="left"&&(y.layoutBounds.x1=n.x1,y.layoutBounds.x2=n.x1+k,y.relativePosition.left=0,y.relativePosition.right=n.width()-k))}}else if(b.position==="left"||b.position==="right"){const A=Math.min(S.width()+x.left+x.right,a);if(b.position==="left"?(y.layoutBounds=new Pi().set(g-A,n.y1,g,n.y2),g-=A):(y.layoutBounds=new Pi().set(f,n.y1,f+A,n.y2),f+=A),y.relativePosition={left:y.layoutBounds.x1-n.x1,right:y.layoutBounds.x1-n.x2},b.align){const k=S.height()+x.top+x.bottom;A<n.width()&&(b.align==="middle"?(y.layoutBounds.y1=(n.y1+n.y2)/2-k/2,y.layoutBounds.y2=y.layoutBounds.y1+k,y.relativePosition.top=y.relativePosition.bottom=(n.height()-k)/2):b.align==="bottom"?(y.layoutBounds.y1=n.y2-k,y.layoutBounds.y2=n.y2,y.relativePosition.top=n.height()-k,y.relativePosition.bottom=0):b.align==="top"&&(y.layoutBounds.y1=n.y1,y.layoutBounds.y2=n.y1+k,y.relativePosition.bottom=n.height()-k,y.relativePosition.top=0))}}else b.position==="outside"?(g-=Math.max(e.x1-S.x1,0)+x.left,f-=Math.max(S.x2-e.x2,0)+x.right,c-=Math.max(e.y1-S.y1,0)+x.top,p+=Math.max(S.y2-e.y2)+x.bottom):y.layoutBounds=n}return n},eL=(s,t,e)=>{s==null||s.forEach(i=>{var n;if(i.markType!==rt.group)return;const r=i.layoutChildren,a=i.getSpec().layout,o=(n=i.layoutBounds)!==null&&n!==void 0?n:i.getBounds();if(o){if(K(a))a.call(null,i,r,o,t);else if(K(a.callback))a.callback.call(null,i,r,o,t);else if(a.display==="relative")if(a.updateViewSignals){const l=e.getViewBox();l&&o.intersect(l);const h=dC(i,r,o,t),d=h.width(),u=h.height(),c={top:h.y1,right:e.width()-h.x2,left:h.x1,bottom:e.height()-h.y2};e.updateSignal(ph,d),e.updateSignal(gh,u),e.updateSignal(Xs,c)}else dC(i,r,o,t);else a.display==="grid"&&cX(i,r,o);eL(r,t,e)}})};class gX extends td{constructor(t,e,i){super(t,rt.glyph,i),this.glyphType=e,this.glyphMeta=st.getGlyph(e)}configureGlyph(t){return this.spec.glyphConfig=t,this.commit(),this}getGlyphMeta(){return this.glyphMeta}getGlyphConfig(){return this.spec.glyphConfig}addGraphicItem(t,e){const i=C4(this,this.glyphMeta,t);return super.addGraphicItem(t,e,i)}}const B0=Symbol.for("key");class fX{diffGrammar(t,e){return Q7(t,e,i=>{var n;return(n=i.id())!==null&&n!==void 0?n:Symbol()})}diffMark(t,e,i){const n={enter:[],exit:[],update:[]};let r=[],a=[];t.forEach(u=>{u.markType!==rt.group&&(i.morph&&u.getMorphConfig().morph||i.morphAll||i.reuse)?r.push(u):n.exit.push({prev:[u]})}),e.forEach(u=>{u.markType!==rt.group&&(i.morph&&u.getMorphConfig().morph||i.morphAll||i.reuse)?a.push(u):n.enter.push({next:[u]})});const o=this.diffUpdateByGroup(r,a,u=>u.getMorphConfig().morphKey,u=>u.getMorphConfig().morphKey);r=o.prev,a=o.next,n.update=n.update.concat(o.update);const l=this.diffUpdateByGroup(r,a,u=>u.id(),u=>u.id());r=l.prev,a=l.next,n.update=n.update.concat(l.update);const h=Er(r,u=>{var c,p;return(p=(c=u.group)===null||c===void 0?void 0:c.id)===null||p===void 0?void 0:p.call(c)}),d=Er(a,u=>{var c,p;return(p=(c=u.group)===null||c===void 0?void 0:c.id)===null||p===void 0?void 0:p.call(c)});return Object.keys(d).forEach(u=>{const c=h.data.get(u),p=d.data.get(u);if(c&&p){for(let g=0;g<Math.max(c.length,p.length);g+=1){const f=c[g],_=p[g];f&&_?n.update.push({prev:[f],next:[_]}):f?n.exit.push({prev:[f]}):_&&n.enter.push({next:[_]})}r=r.filter(g=>!c.includes(g)),a=a.filter(g=>!p.includes(g))}}),r.forEach(u=>n.exit.push({prev:[u]})),a.forEach(u=>n.enter.push({next:[u]})),n}_appendMorphKeyToElements(t){const e=t.getMorphConfig();if(!P(e.morphElementKey)){const i=lh(e.morphElementKey);t.elements&&t.elements.forEach(n=>{n.morphKey=i(n.getDatum())})}}morph(t,e,i){const n=t.reduce((d,u)=>(this._appendMorphKeyToElements(u),d.concat(u.elements)),[]),r=e.reduce((d,u)=>(this._appendMorphKeyToElements(u),d.concat(u.elements)),[]),a=tX(n,r,d=>{var u;return(u=d.morphKey)!==null&&u!==void 0?u:d.key});t.forEach(d=>{var u,c;return(c=(u=d.animate)===null||u===void 0?void 0:u.disable)===null||c===void 0?void 0:c.call(u)}),e.forEach(d=>{var u,c;return(c=(u=d.animate)===null||u===void 0?void 0:u.disable)===null||c===void 0?void 0:c.call(u)});const o=t.concat(e).reduce((d,u)=>(Object.assign(d,u.parameters()),d),{});let l=0;const h=()=>{l-=1,l===0&&e.forEach(d=>{var u,c;(c=(u=d.animate)===null||u===void 0?void 0:u.enable)===null||c===void 0||c.call(u)})};a.enter.forEach(d=>{d.next.forEach(u=>{this.doMorph([],[u],i,h,o)}),l+=1}),a.update.forEach(d=>{const u=Math.min(d.prev.length,d.next.length),c=this.divideElements(d.prev,u),p=this.divideElements(d.next,u);for(let g=0;g<u;g++)this.doMorph(c[g],p[g],i,h,o),l+=1})}diffUpdateByGroup(t,e,i,n){const r=Er(t,d=>{var u;return(u=i(d))!==null&&u!==void 0?u:B0}),a=Er(e,d=>{var u;return(u=n(d))!==null&&u!==void 0?u:B0});let o=t,l=e;const h=[];return a.keys.forEach(d=>{if(d!==B0){const u=r.data.get(d),c=a.data.get(d);u&&c&&(h.push({prev:u,next:c}),o=o.filter(p=>!u.includes(p)),l=l.filter(p=>!c.includes(p)))}}),{prev:o,next:l,update:h}}doMorph(t,e,i,n,r){var a,o;const l={prev:t.map(_=>_.getDatum()),next:e.map(_=>_.getDatum())},h={prev:t.slice(),next:e.slice()},d=i.animation.easing,u=Ue(i.animation.delay,r,l,h),c=Ue(i.animation.duration,r,l,h),p=Ue(i.animation.oneByOne,r,l,h),g=Ue(i.animation.splitPath,r,l,h),f=N(p)&&p>0?_=>dt(p)?_*p:p===!0?_*c:0:void 0;t.length!==1&&t.length!==0||e.length!==1?t.length===1&&e.length>1?cN(t[0].getGraphicItem(),e.map(_=>_.getGraphicItem()),{delay:u,duration:c,easing:d,onEnd:n,individualDelay:f,splitPath:g}):t.length>1&&e.length===1&&gN(t.map(_=>_.getGraphicItem()),e[0].getGraphicItem(),{delay:u,duration:c,easing:d,onEnd:n,individualDelay:f,splitPath:g}):JR((o=(a=t[0])===null||a===void 0?void 0:a.getGraphicItem)===null||o===void 0?void 0:o.call(a),e[0].getGraphicItem(),{delay:u,duration:c,easing:d,onEnd:n})}divideElements(t,e){const i=Math.floor(t.length/e);return new Array(e).fill(0).map((n,r)=>t.slice(i*r,r===e-1?t.length:i*(r+1)))}}class iL{constructor(t,e){this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}},this._size=0,this._mapKey=ht(t)?i=>i[t]:t,this._warning=e}record(t){var e,i;const n=t.grammarType,r=this._mapKey(t);return this._grammarMap[n]?(this._grammars[n].push(t),P(r)||(this._grammarMap[n][r]?(e=this._warning)===null||e===void 0||e.call(this,r,t):this._grammarMap[n][r]=t)):(this._grammars.customized.push(t),P(r)||(this._grammarMap.customized[r]?(i=this._warning)===null||i===void 0||i.call(this,r,t):this._grammarMap.customized[r]=t)),this._size+=1,this}unrecord(t){const e=t.grammarType,i=this._mapKey(t);return this._grammarMap[e]?(this._grammars[e]=this._grammars[e].filter(n=>n!==t),P(i)||this._grammarMap[e][i]!==t||delete this._grammarMap[e][i]):(this._grammars.customized=this._grammars.customized.filter(n=>n!==t),P(i)||this._grammarMap.customized[i]!==t||delete this._grammarMap.customized[i]),this._size-=1,this}size(){return this._size}getSignal(t){var e;return(e=this._grammarMap.signal[t])!==null&&e!==void 0?e:null}getData(t){var e;return(e=this._grammarMap.data[t])!==null&&e!==void 0?e:null}getScale(t){var e;return(e=this._grammarMap.scale[t])!==null&&e!==void 0?e:null}getCoordinate(t){var e;return(e=this._grammarMap.coordinate[t])!==null&&e!==void 0?e:null}getMark(t){var e;return(e=this._grammarMap.mark[t])!==null&&e!==void 0?e:null}getCustomized(t){var e;return(e=this._grammarMap.customized[t])!==null&&e!==void 0?e:null}getGrammar(t){return this._grammarMap.data[t]?this._grammarMap.data[t]:this._grammarMap.signal[t]?this._grammarMap.signal[t]:this._grammarMap.scale[t]?this._grammarMap.scale[t]:this._grammarMap.coordinate[t]?this._grammarMap.coordinate[t]:this._grammarMap.mark[t]?this._grammarMap.mark[t]:this._grammarMap.customized[t]?this._grammarMap.customized[t]:null}getAllSignals(){return this._grammars.signal}getAllData(){return this._grammars.data}getAllScales(){return this._grammars.scale}getAllCoordinates(){return this._grammars.coordinate}getAllMarks(){return this._grammars.mark}getAllCustomized(){return this._grammars.customized}traverse(t){var e;Object.values((e=this._grammars)!==null&&e!==void 0?e:{}).forEach(i=>(i??[]).forEach(n=>{t.call(null,n)}))}find(t){let e=null;return this.traverse(i=>t.call(null,i)===!0&&(e=i,!0)),e}filter(t){const e=[];return this.traverse(i=>{t.call(null,i)===!0&&e.push(i)}),e}clear(){this._size=0,this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}}}release(){this._size=0,this._grammars=null,this._grammarMap=null}}class _X extends iL{constructor(){super(...arguments),this._markNodes=[]}record(t){if(super.record(t),t.grammarType==="mark"){const e=t,i={mark:e,parent:null,children:[]};this._markNodes.forEach(n=>{const r=n.mark;r.markType===rt.group&&r.includesChild(e,!1)?(n.children.push(i),i.parent=n):e.markType===rt.group&&e.includesChild(r,!1)&&(i.children.push(n),n.parent=i)}),this._markNodes.push(i)}return this}unrecord(t){if(super.unrecord(t),t.grammarType==="mark"){const e=t,i=this._markNodes.find(n=>n.mark===e);this._markNodes.forEach(n=>{const r=n.mark;r.markType===rt.group&&r.includesChild(e,!1)?(n.children=n.children.filter(a=>a!==i),i.parent=null):e.markType===rt.group&&e.includesChild(r,!1)&&(i.children=i.children.filter(a=>a!==n),n.parent=null)}),this._markNodes=this._markNodes.filter(n=>n!==i)}return this}getAllMarkNodes(){return this._markNodes}clear(){super.clear(),this._markNodes=[]}release(){super.release(),this._markNodes=null}}class mX{constructor(t){this._animations=[],this._additionalAnimateMarks=[],this.isEnabled=!0,this._onAnimationStart=e=>{this._additionalAnimateMarks=this._additionalAnimateMarks.filter(i=>{var n;return(n=i==null?void 0:i.animate)===null||n===void 0?void 0:n.isAnimating()}),this._animations.length===0&&this._additionalAnimateMarks.length===0&&this._view.emit(gt.ALL_ANIMATION_START,{}),this._animations=this._animations.concat({config:e.animationConfig,mark:e.mark})},this._onAnimationEnd=e=>{this._additionalAnimateMarks=this._additionalAnimateMarks.filter(i=>{var n;return(n=i==null?void 0:i.animate)===null||n===void 0?void 0:n.isAnimating()}),this._animations=this._animations.filter(i=>i.config!==e.animationConfig||i.mark!==e.mark),this._animations.length===0&&this._additionalAnimateMarks.length===0&&this._view.emit(gt.ALL_ANIMATION_END,{})},this._view=t,this._view.addEventListener(gt.ANIMATION_START,this._onAnimationStart),this._view.addEventListener(gt.ANIMATION_END,this._onAnimationEnd)}stop(){return this._view.traverseMarkTree(t=>{var e,i;t.animate&&((i=(e=t.animate).stop)===null||i===void 0||i.call(e))}),this._additionalAnimateMarks.forEach(t=>{var e,i;t.view&&t.animate&&((i=(e=t.animate).stop)===null||i===void 0||i.call(e))}),this._additionalAnimateMarks=[],this}pause(){return this._view.traverseMarkTree(t=>{var e,i;t.animate&&((i=(e=t.animate).pause)===null||i===void 0||i.call(e))}),this._additionalAnimateMarks.forEach(t=>{var e,i;t.view&&t.animate&&((i=(e=t.animate).pause)===null||i===void 0||i.call(e))}),this}resume(){return this._view.traverseMarkTree(t=>{var e,i;t.animate&&((i=(e=t.animate).resume)===null||i===void 0||i.call(e))}),this._additionalAnimateMarks.forEach(t=>{var e,i;t.view&&t.animate&&((i=(e=t.animate).resume)===null||i===void 0||i.call(e))}),this}enable(){return this.isEnabled=!0,this._view.traverseMarkTree(t=>{var e,i;t.animate&&((i=(e=t.animate).enable)===null||i===void 0||i.call(e))}),this}disable(){return this.isEnabled=!1,this._view.traverseMarkTree(t=>{var e,i;t.animate&&((i=(e=t.animate).disable)===null||i===void 0||i.call(e))}),this._additionalAnimateMarks.forEach(t=>{var e,i;t.view&&t.animate&&((i=(e=t.animate).stop)===null||i===void 0||i.call(e))}),this._additionalAnimateMarks=[],this}enableAnimationState(t){return this._view.traverseMarkTree(e=>{var i,n;e.animate&&((n=(i=e.animate).enableAnimationState)===null||n===void 0||n.call(i,t))}),this}disableAnimationState(t){return this._view.traverseMarkTree(e=>{var i,n;e.animate&&((n=(i=e.animate).disableAnimationState)===null||n===void 0||n.call(i,t))}),this}isAnimating(){return this._animations.length!==0||this._additionalAnimateMarks.some(t=>{var e;return((e=t==null?void 0:t.animate)===null||e===void 0?void 0:e.isAnimating())||!1})}animate(){return this.isEnabled?(this._view.traverseMarkTree(t=>{t.isUpdated&&t.animate&&t.animate.animate(),t.cleanExitElements(),t.isUpdated=!1},null,!0),this):this}animateAddition(t){return t.animate.animate(),this._additionalAnimateMarks.push(t),this}release(){this._additionalAnimateMarks=[],this._view.removeEventListener(gt.ALL_ANIMATION_START,this._onAnimationStart),this._view.removeEventListener(gt.ALL_ANIMATION_END,this._onAnimationEnd)}}let sL=class extends td{addGraphicItem(t,e){const i=t==null?void 0:t.text,n=(i==null?void 0:i.type)==="rich",r=Qd(this,n?rt.richtext:rt.text,t);return n&&(t.textConfig=[]),super.addGraphicItem(t,e,r)}getAttributeTransforms(){var t;return((t=this.getGroupGraphicItem())===null||t===void 0?void 0:t.type)==="richtext"?Ro.richtext:Ro.text}release(){super.release()}};sL.markType=rt.text;const vX={label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#89909d",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],start:{x:0,y:0},end:{x:100,y:0},x:0,y:0},yX={title:{space:4,padding:[0,0,0,0],textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1},text:"theta"},label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#6F6F6F",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],startAngle:0,endAngle:2*Math.PI,radius:100,innerRadius:0,center:{x:0,y:0},x:0,y:0},bX={style:{stroke:"#f1f2f5"}},xX={style:{stroke:"#f1f2f5"}},SX={layout:"vertical",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:10,spaceRow:10,shape:{space:4,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",stroke:"#D8D8D8",fillOpacity:.5}}},label:{space:4,style:{fontSize:12,fill:"black",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",fillOpacity:.5}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"},state:{selectedHover:{fillOpacity:.7,fill:"gray"},unSelectedHover:{fillOpacity:.2,fill:"gray"}}},focus:!1,focusIconStyle:{size:10,fill:"#333",cursor:"pointer"},visible:!0,padding:{top:2,bottom:2,left:2,right:2}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!1,items:[{index:0,id:"",label:"",shape:{fill:"#6690F2",stroke:"#6690F2",symbolType:"circle"}}]},AX={title:{visible:!1,text:""},colors:[],layout:"horizontal",railWidth:200,railHeight:8,railStyle:{cornerRadius:5}},kX={title:{visible:!1,text:""},trackStyle:{fill:"#ccc"},layout:"horizontal",align:"bottom",railWidth:200,railHeight:6,min:0,max:1,value:[0,1]},wX={start:{x:0,y:0},end:{x:0,y:0}},TX={start:{x:0,y:0},end:{x:0,y:0},rectStyle:{width:10,height:10}},MX={center:{x:0,y:0},radius:100,startAngle:0,endAngle:Math.PI/6},CX={center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI},PX={center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI,sides:6},EX={layout:"horizontal",railWidth:200,railHeight:10,railStyle:{cornerRadius:5},range:{draggableTrack:!0},startText:{visible:!0,text:"",space:8},endText:{visible:!0,text:"",space:8},min:0,max:1,value:[0,1]},RX={size:{width:400,height:400},dataLabels:[]},OX={type:"line-data",data:[{text:""}],position:"top",overlap:{avoidBaseMark:!1,clampForce:!1},smartInvert:!1},IX={type:"line",data:[{text:"",data:{}}],position:"start",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},LX={type:"area",data:[{text:"",data:{}}],position:"end",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},BX={type:"rect",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},DX={type:"symbol",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{avoidBaseMark:!0,size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},FX={type:"arc",data:[{text:"",fill:"#606773",data:{}}],width:800,height:600,position:"outside",zIndex:302},jX={data:[{text:"",fill:"#606773",data:{}}],overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},zX={orient:"bottom",showDetail:"auto",brushSelect:!0,start:0,end:1,position:{x:0,y:0},size:{width:500,height:40},previewData:[]},HX={},NX={},GX={},WX={textStyle:{fill:"#21252c"},subtextStyle:{fill:"#606773"}},VX={width:12,height:12,padding:[2,2],railStyle:{fill:"rgba(0, 0, 0, .1)"}},nL={axis:vX,circleAxis:yX,grid:bX,circleGrid:xX,discreteLegend:SX,colorLegend:AX,sizeLegend:kX,lineCrosshair:wX,rectCrosshair:TX,sectorCrosshair:MX,circleCrosshair:CX,polygonCrosshair:PX,slider:EX,dataLabel:RX,pointLabel:jX,lineLabel:IX,areaLabel:LX,rectLabel:BX,symbolLabel:DX,arcLabel:FX,lineDataLabel:OX,datazoom:zX,continuousPlayer:HX,discretePlayer:NX,tooltip:GX,title:WX,scrollbar:VX},rL=5,aL={symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}},Oi=Object.assign({},nL);Oi.axis=Object.assign({},Oi.axis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Oi.circleAxis=Object.assign({},Oi.circleAxis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Oi.grid=Object.assign({},Oi.grid,{style:{stroke:"#404349"}}),Oi.circleGrid=Object.assign({},Oi.circleGrid,{style:{stroke:"#404349"}}),Oi.rectLabel=Object.assign({},Oi.rectLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Oi.lineLabel=Object.assign({},Oi.lineLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Oi.symbolLabel=Object.assign({},Oi.symbolLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Oi.title=Object.assign({},Oi.title,{textStyle:{fill:"#fdfdfd"},subtextStyle:{fill:"#888c93"}});const UX={name:"dark",padding:rL,background:"#202226",palette:{default:["#5383F4","#7BCF8E","#FF9D2C","#FFDB26","#7568D9","#80D8FB","#1857A3","#CAB0E8","#FF8867","#B9E493","#2CB4A8","#B9E4E3"]},marks:aL,components:Oi},$X={name:"default",padding:rL,palette:{default:["#6690F2","#70D6A3","#B4E6E2","#63B5FC","#FF8F62","#FFDC83","#BCC5FD","#A29BFE","#63C4C7","#F68484"]},marks:aL,components:nL};let fo=class Hd{static registerTheme(t,e){t&&Hd._themes.set(t,e)}static unregisterTheme(t){Hd._themes.delete(t)}static getTheme(t){return Hd._themes.get(t)}static getDefaultTheme(){return Hd.getTheme("default")}};fo._themes=new Map,fo.registerTheme("default",$X),fo.registerTheme("dark",UX);class YS extends td{constructor(t,e,i,n){super(t,rt.component,i),this._componentDatum={[er]:0},this.componentType=e,this.spec.type="component",this.spec.componentType=e,this.mode=n,this._updateComponentEncoders()}configureComponent(t){return this.spec.componentConfig=t,this.commit(),this}addGraphicItem(t,e,i){const n=i??st.createGraphicComponent(this.componentType,t,{mode:this.mode,skipDefault:this.spec.skipTheme});return this.emit(gt.BEFORE_ADD_VRENDER_MARK),this.graphicParent.appendChild(n),this.emit(gt.AFTER_ADD_VRENDER_MARK),n}join(t){return super.join(t,er)}encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(),this}parseRenderContext(){return{large:!1}}_prepareRejoin(){this._componentDatum[er]+=1}evaluateJoin(t){return this.spec.key=er,super.evaluateJoin([this._componentDatum])}_updateComponentEncoders(){this._encoders=this.spec.encode}_getEncoders(){var t;return(t=this._encoders)!==null&&t!==void 0?t:{}}}var yd=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};class Vo extends jo{static useRegisters(t){t.forEach(e=>{e()})}constructor(t={},e={}){super(),this._observer=null,this._onResize=lr((...i)=>{const n=this._getContainerSize();n&&this.resize(n.width,n.height)},100),this.delegateEvent=(i,n)=>{var r;const a=(r=i.target)===null||r===void 0?void 0:r[Eo],o=lx(this,i,a,n,go);this.emit(n,o,a)},this.handleProgressiveFrame=()=>{this._progressiveMarks.length&&this._progressiveMarks.forEach(i=>{i.isDoingProgressive()&&i.evaluateProgressive()}),this.doPreProgressive()},this._config=e,this._options=Object.assign({mode:E7},t),this.initialize()}getGrammarById(t){return this.grammars.getGrammar(t)}getSignalById(t){return this.grammars.getSignal(t)}getDataById(t){return this.grammars.getData(t)}getScaleById(t){return this.grammars.getScale(t)}getCoordinateById(t){return this.grammars.getCoordinate(t)}getMarkById(t){return this.grammars.getMark(t)}getCustomizedById(t){return this.grammars.getCustomized(t)}getGrammarsByName(t){return this.grammars.filter(e=>e.name()===t)}getGrammarsByType(t){return this.grammars.filter(e=>e.grammarType===t)}getMarksByType(t){return this.grammars.getAllMarks().filter(e=>e.markType===t)}getMarksByName(t){return this.grammars.getAllMarks().filter(e=>e.name()===t)}getMarksBySelector(t){if(!t)return null;const e=Y(t),i=[];return e.forEach(n=>{if(Oc(n))return void i.push(n);if(n[0]===K7){const a=this.getMarkById(n.slice(1));return void(a&&i.push(a))}const r=n[0]===X7?this.getMarksByName(n.slice(1)):sI(n)?this.getMarksByType(n):null;r&&r.length&&r.forEach(a=>{i.push(a)})}),i}updateSignal(t,e){ht(t)&&(t=this.getSignalById(t)),t.set(e),this.commit(t)}signal(t,e){const i=new G7(this);return arguments.length>=1&&i.value(t),arguments.length>=2&&i.update(e),this.grammars.record(i),this._dataflow.add(i),i}data(t){const e=new P7(this,t);return this.grammars.record(e),this._dataflow.add(e),e}scale(t){const e=st.createGrammar("scale",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}coordinate(t){const e=st.createGrammar("coordinate",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}mark(t,e,i){const n=ht(e)?this.getMarkById(e):e;let r;switch(t){case rt.group:r=new hX(this,n);break;case rt.glyph:r=new gX(this,i==null?void 0:i.glyphType,n);break;case rt.component:r=st.hasComponent(i==null?void 0:i.componentType)?st.createComponent(i==null?void 0:i.componentType,this,n,i==null?void 0:i.mode):new YS(this,i==null?void 0:i.componentType,n,i==null?void 0:i.mode);break;case rt.text:r=new sL(this,t,n);break;default:r=st.hasMark(t)?st.createMark(t,this,n):new td(this,t,n)}return this.grammars.record(r),this._dataflow.add(r),r}group(t){return this.mark(rt.group,t)}glyph(t,e){return this.mark(rt.glyph,e,{glyphType:t})}component(t,e,i="2d"){return this.mark(rt.component,e,{componentType:t,mode:i})}axis(t,e="2d"){return this.mark(rt.component,t,{componentType:be.axis,mode:e})}grid(t,e="2d"){return this.mark(rt.component,t,{componentType:be.grid,mode:e})}legend(t){return this.mark(rt.component,t,{componentType:be.legend})}slider(t){return this.mark(rt.component,t,{componentType:be.slider})}label(t){return this.mark(rt.component,t,{componentType:be.label})}datazoom(t){return this.mark(rt.component,t,{componentType:be.datazoom})}player(t){return this.mark(rt.component,t,{componentType:be.player})}title(t){return this.mark(rt.component,t,{componentType:be.title})}scrollbar(t){return this.mark(rt.component,t,{componentType:be.scrollbar})}customized(t,e){const i=st.createGrammar(t,this,e==null?void 0:e.type);if(i)return i.parse(e),this.grammars.record(i),this._dataflow.add(i),i}addGrammar(t){return this.grammars.find(e=>e.uid===t.uid)||(this.grammars.record(t),this._dataflow.add(t),t.parse(t.getSpec()),this._needBuildLayoutTree=!0),this}removeGrammar(t){const e=ht(t)?this.getGrammarById(t):t;return e&&this.grammars.find(i=>i.uid===e.uid)?(e.grammarType==="mark"&&e.prepareRelease(),this._cachedGrammars.record(e),this._dataflow.remove(e),this.grammars.unrecord(e),this._needBuildLayoutTree=!0,this):this}removeAllGrammars(){return this.grammars.traverse(t=>{t.grammarType==="signal"&&tC.includes(t.id())||t.grammarType==="mark"&&t.id()==="root"||this.removeGrammar(t)}),this}removeAllGraphicItems(){return this.traverseMarkTree(t=>{t.graphicItem&&(Lf(t.graphicItem),t.elementMap.forEach(e=>{e.resetGraphicItem()}),t.graphicItem=null)}),this}parseSpec(t){var e,i,n,r,a,o;if(this.emit(gt.BEFORE_PARSE_VIEW),this._spec=t,U7(t),t.theme?this.theme(t.theme):this.theme(fo.getDefaultTheme()),t.width&&this.width(t.width),t.height&&this.height(t.height),this.padding((i=(e=t.padding)!==null&&e!==void 0?e:this._options.padding)!==null&&i!==void 0?i:this._theme.padding),!this.width()||!this.height()){const h=this._getContainerSize();h&&(this.updateSignal(ma,h.width),this.updateSignal(va,h.height))}!((n=t.signals)===null||n===void 0)&&n.length&&t.signals.forEach(h=>{this.signal().parse(h)}),!((r=t.data)===null||r===void 0)&&r.length&&t.data.forEach(h=>{this.data(null).parse(h)}),!((a=t.coordinates)===null||a===void 0)&&a.length&&t.coordinates.forEach(h=>{var d;(d=this.coordinate(h.type))===null||d===void 0||d.parse(h)}),!((o=t.scales)===null||o===void 0)&&o.length&&t.scales.forEach(h=>{var d;(d=this.scale(h.type))===null||d===void 0||d.parse(h)});const l=st.getGrammars();return Object.keys(l).forEach(h=>{const{specKey:d}=l[h];t[d]&&t[d].length&&t[d].forEach(u=>{this.customized(h,u)})}),t.marks&&t.marks.length&&t.marks.forEach(h=>{this.parseMarkSpec(h)}),t.events&&t.events.length&&t.events.forEach(h=>{this.event(h)}),t.interactions&&t.interactions.length&&t.interactions.forEach(h=>{this.interaction(h.type,h)}),t.animation===!1?this.animate.disable():this.animate.enable(),this.emit(gt.AFTER_PARSE_VIEW),this._needBuildLayoutTree=!0,this._layoutState=Ys.before,this}updateSpec(t){return this.removeAllInteractions(),this.removeAllGrammars(),this.parseSpec(t)}parseBuiltIn(){V7(this._options,this._config,this.getCurrentTheme()).forEach(t=>{const e=this.signal().parse(t);t.value&&e.set(t.value)}),this.parseMarkSpec({id:"root",type:"group",encode:{enter:{x:0,y:0},update:{width:{signal:"width"},height:{signal:"height"}}}}),this.rootMark=this.getMarkById("root")}parseMarkSpec(t){var e;const i=t.type===rt.glyph?{glyphType:t.glyphType}:t.type===rt.component?{componentType:t.componentType,mode:t.mode}:null;this.mark(t.type,t.group,i).parse(t),(e=t.marks)===null||e===void 0||e.forEach(n=>{this.parseMarkSpec(n)})}theme(t){var e,i,n,r,a,o;ht(t)?this._theme=(e=fo.getTheme(t))!==null&&e!==void 0?e:fo.getDefaultTheme():this._theme=t;const{background:l,padding:h}=(i=this._spec)!==null&&i!==void 0?i:{};return this._theme?(this.background((n=l??this._options.background)!==null&&n!==void 0?n:this._theme.background),this.padding((r=h??this._options.padding)!==null&&r!==void 0?r:this._theme.padding),(o=(a=this.renderer.stage())===null||a===void 0?void 0:a.setTheme)===null||o===void 0||o.call(a,Object.assign({},this._theme.marks))):(this.background(l??this._options.background),this.padding(h??this._options.padding)),this}getCurrentTheme(){return this._theme}setCurrentTheme(t,e=!0){return yd(this,void 0,void 0,function*(){if(!this._isReleased){if(this.theme(t),this.grammars.getAllMarks().forEach(i=>{i.commit()}),e){if(yield this.evaluate(),this._isReleased)return;this.renderer.render(!0)}else yield this._dataflow.evaluate();return this}})}background(t){return arguments.length?(this._background=t,this.renderer.background(t),t):this._background}width(t){const e=this.getSignalById(ma);return arguments.length?(this._options.width=t,this.updateSignal(e,t),t):e.output()}height(t){const e=this.getSignalById(va);return arguments.length?(this._options.height=t,this.updateSignal(e,t),t):e.output()}viewWidth(t){const e=this.getSignalById(ph);if(arguments.length){const i=this.padding();return this.width(t+i.left+i.right),t}return e.output()}viewHeight(t){const e=this.getSignalById(gh);if(arguments.length){const i=this.padding();return this.height(t+i.top+i.bottom),t}return e.output()}padding(t){const e=this.getSignalById(Xs);if(arguments.length){const i=ya(t);return this.updateSignal(e,i),i}return ya(e.output())}autoFit(t){const e=this.getSignalById(ru);return arguments.length?(this.updateSignal(e,t),t):e.output()}getViewBox(){const t=this.getSignalById(US);return t==null?void 0:t.output()}updateLayoutTag(){return this._layoutState=Ys.before,this}getLayoutState(){return this._layoutState}buildLayoutTree(){const t={},e=[];this.traverseMarkTree(i=>{t[i.id()]=!0,i.group&&t[i.group.id()]||e.push(i),i.markType===rt.group&&i.updateLayoutChildren()},i=>i.needLayout()),this._layoutMarks=e}doLayout(){var t;const e=this._options.doLayout||eL;e&&(!((t=this._layoutMarks)===null||t===void 0)&&t.length)&&(this.emit(gt.BEFORE_DO_LAYOUT),e(this._layoutMarks,this._options,this),this.emit(gt.AFTER_DO_LAYOUT))}handleLayoutEnd(){this.emit(gt.BEFORE_MARK_LAYOUT_END),this._layoutMarks.forEach(t=>{L0(t,"layoutChildren",e=>{e.handleLayoutEnd()},e=>e!==t)}),this.emit(gt.AFTER_MARK_LAYOUT_END)}handleRenderEnd(){this.emit(gt.BEFORE_MARK_RENDER_END),L0(this.rootMark,"children",t=>{t.handleRenderEnd()}),this.emit(gt.AFTER_MARK_RENDER_END)}commit(t){return this._dataflow.commit(t),this}run(t){return this.evaluate(t),this}runSync(t){return this.evaluateSync(t),this}isRunning(){return this._running}runAsync(t){return yd(this,void 0,void 0,function*(){if(this._isReleased)return;for(;this._running&&(yield this._running,!this._isReleased););const e=()=>{this._running=null};return(this._running=this.evaluate(t)).then(e,e),this._running})}runNextTick(t){return yd(this,void 0,void 0,function*(){return this._currentDataflow||(this._currentDataflow=Promise.resolve().then(()=>this.runAsync(t).then(()=>{this._currentDataflow=null}).catch(e=>{this._currentDataflow=null,this.logger.error(e)}))),yield this._currentDataflow,this})}doRender(t){this.emit(gt.BEFORE_DO_RENDER),this.renderer&&(this._progressiveMarks||this.animate.animate(),this.renderer.render(t),this.handleRenderEnd()),this.emit(gt.AFTER_DO_RENDER)}evaluate(t){var e,i,n,r;return yd(this,void 0,void 0,function*(){if(this._isReleased)return;const a=eC(t),o=this._cachedGrammars.size()>0;o&&(this.reuseCachedGrammars(a),this.detachCachedGrammar());const l=this._resizeRenderer(),h=this._dataflow.hasCommitted();if(!(o||h||this._layoutState||l))return this;if(this.clearProgressive(),(e=this.renderer)===null||e===void 0||e.preventRender(!0),yield this._dataflow.evaluate(),!this._isReleased){if(this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState){if(this._layoutState=Ys.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=Ys.reevaluate,yield this._dataflow.evaluate(),this._isReleased))return;this._layoutState=Ys.after,!((i=this._layoutMarks)===null||i===void 0)&&i.length&&this.handleLayoutEnd()}return(n=this.renderer)===null||n===void 0||n.preventRender(!1),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),this.doRender(!1),(r=this._willMorphMarks)===null||r===void 0||r.forEach(d=>{this._morph.morph(d.prev,d.next,a)}),this._willMorphMarks=null,this.releaseCachedGrammars(a),this.doPreProgressive(),this}})}evaluateSync(t){var e,i;const n=eC(t),r=this._cachedGrammars.size()>0;r&&(this.reuseCachedGrammars(n),this.detachCachedGrammar());const a=this._resizeRenderer(),o=this._dataflow.hasCommitted();return r||o||this._layoutState||a?(this.clearProgressive(),this._dataflow.evaluateSync(),this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState&&(this._layoutState=Ys.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=Ys.reevaluate,this._dataflow.evaluateSync()),this._layoutState=Ys.after,!((e=this._layoutMarks)===null||e===void 0)&&e.length&&this.handleLayoutEnd()),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),this.doRender(!0),(i=this._willMorphMarks)===null||i===void 0||i.forEach(l=>{this._morph.morph(l.prev,l.next,n)}),this._willMorphMarks=null,this.releaseCachedGrammars(n),this.doPreProgressive(),this):this}reuseCachedGrammars(t){if(this._willMorphMarks||(this._willMorphMarks=[]),t.reuse){const e=i=>{i.next.reuse(i.prev),i.prev.detachAll(),i.prev.clear(),this._cachedGrammars.unrecord(i.prev)};this._morph.diffGrammar(this._cachedGrammars.getAllSignals(),this.grammars.getAllSignals().filter(i=>!tC.includes(i.id()))).update.forEach(e),this._morph.diffGrammar(this._cachedGrammars.getAllData(),this.grammars.getAllData()).update.forEach(e),this._morph.diffGrammar(this._cachedGrammars.getAllScales(),this.grammars.getAllScales()).update.forEach(e),this._morph.diffGrammar(this._cachedGrammars.getAllCoordinates(),this.grammars.getAllCoordinates()).update.forEach(e)}this._morph.diffMark(this._cachedGrammars.getAllMarks(),this.grammars.getAllMarks().filter(e=>e.id()!=="root"),t).update.forEach(e=>{const i=e.prev.length===1&&e.next.length===1&&e.prev[0].markType===e.next[0].markType,n=e.prev.every(r=>r.getMorphConfig().morph)&&e.next.every(r=>r.getMorphConfig().morph);i&&t.reuse?(e.next[0].reuse(e.prev[0]),e.prev[0].detachAll(),e.prev[0].clear(),this._cachedGrammars.unrecord(e.prev[0])):(t.morph&&n||t.morphAll)&&this._willMorphMarks.push({prev:e.prev,next:e.next})})}detachCachedGrammar(){this._cachedGrammars.traverse(t=>{var e,i;if(t.detachAll(),t.grammarType==="mark"){const n=t;(i=(e=n.group)===null||e===void 0?void 0:e.removeChild)===null||i===void 0||i.call(e,n)}})}releaseCachedGrammars(t){this._cachedGrammars.traverse(n=>{n.grammarType!=="mark"&&n.release()});const e=this._cachedGrammars.getAllMarkNodes();e.forEach(n=>{n.mark.animate.stop(),t.enableExitAnimation&&this.animate.animateAddition(n.mark)});const i=n=>{if(n.mark.view&&n.mark.animate.getAnimatorCount()===0&&(!n.children||n.children.length===0)){n.mark.release();const r=n.parent;r&&(n.parent.children=n.parent.children.filter(a=>a!==n),n.parent=null,i(r))}};e.forEach(n=>{const r=n.mark;r.animate.getAnimatorCount()===0?i(n):r.addEventListener("animationEnd",()=>{r.animate.getAnimatorCount()===0&&i(n)})}),this._cachedGrammars.clear()}runAfter(t){return this._dataflow.runAfter(()=>{t.call(null,this)}),this}runBefore(t){return this._dataflow.runBefore(()=>{t.call(null,this)}),this}getImageBuffer(){var t,e;if(this._options.mode!=="node")return void this.logger.error(new TypeError("getImageBuffer() now only support node environment."));const i=(e=(t=this.renderer)===null||t===void 0?void 0:t.stage)===null||e===void 0?void 0:e.call(t);return i?(i.render(),i.window.getImageBuffer()):(this.logger.error(new ReferenceError("render is not defined")),null)}traverseMarkTree(t,e,i){return L0(this.rootMark,"children",t,e,i),this}_bindResizeEvent(){var t,e,i,n,r,a;if(this.autoFit()){const o=(r=(n=(i=(e=(t=this.renderer)===null||t===void 0?void 0:t.stage)===null||e===void 0?void 0:e.call(t))===null||i===void 0?void 0:i.window)===null||n===void 0?void 0:n.getContainer)===null||r===void 0?void 0:r.call(n);if(o){const l=window.ResizeObserver;this._observer=new l(this._onResize),(a=this._observer)===null||a===void 0||a.observe(o)}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this.autoFit()&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}_getContainerSize(){var t,e,i,n,r,a,o,l,h,d,u;const c=(r=(n=(i=(e=(t=this.renderer)===null||t===void 0?void 0:t.stage)===null||e===void 0?void 0:e.call(t))===null||i===void 0?void 0:i.window)===null||n===void 0?void 0:n.getContainer)===null||r===void 0?void 0:r.call(n);if(c){const{width:p,height:g}=dy(c);return{width:(l=(o=(a=this._spec)===null||a===void 0?void 0:a.width)!==null&&o!==void 0?o:this._options.width)!==null&&l!==void 0?l:p,height:(u=(d=(h=this._spec)===null||h===void 0?void 0:h.height)!==null&&d!==void 0?d:this._options.height)!==null&&u!==void 0?u:g}}return null}resize(t,e,i=!0){return yd(this,void 0,void 0,function*(){let n=!1;return t!==this.width()&&(n=!0,this.updateSignal(ma,t)),e!==this.height()&&(n=!0,this.updateSignal(va,e)),n&&(i?yield this.evaluate():yield this._dataflow.evaluate()),this})}_resizeRenderer(){const t=this.width(),e=this.height();return!!this.renderer.shouldResize(t,e)&&(this.renderer.resize(t,e),this.emit("resize",{},{width:t,height:e}),!0)}bindEvents(t){if(this._eventConfig.disable)return;const{type:e,filter:i,callback:n,throttle:r,debounce:a,consume:o,target:l,dependency:h}=t,d=q7(e);if(!d)return;const{source:u,type:c}=d,p=$7(d),g=(Array.isArray(l)&&l.length?l.map(m=>({signal:this.getSignalById(m.target),callback:m.callback})):[{signal:ht(l)?this.getSignalById(l):null,callback:n}]).filter(m=>m.signal||m.callback),f=LS(h,this),_=Y7((m,v)=>{const y=u===go&&I7(this._eventConfig,c)||o&&(m.cancelable===void 0||m.cancelable);u===bo&&(m=lx(this,m,v,c,bo));let b=!1;if((!i||i(m))&&(!p||p(v))&&g.length){const x=f.reduce((S,A)=>(S[A.id()]=A.output(),S),{});g.forEach(S=>{S.callback&&S.signal?S.signal.set(S.callback(m,x))&&(this.commit(S.signal),b=!0):S.callback?S.callback(m,x):(this.commit(S.signal),b=!0)})}y&&m.preventDefault(),o&&m.stopPropagation(),b&&this.runAsync()},{throttle:r,debounce:a});if(u===go){if(L7(this._eventConfig,go,c))return this.addEventListener(c,_,R7),()=>{this.removeEventListener(c,_)}}else if(u===bo)return Gt.addEventListener(c,_),this._eventListeners.push({type:c,source:Gt,handler:_}),()=>{Gt.removeEventListener(c,_);const m=this._eventListeners.findIndex(v=>v.type===c&&v.source===Gt&&v.handler===_);m>=0&&this._eventListeners.splice(m,1)}}event(t){if("between"in t){const[e,i]=t.between,n=`${e.type}-${t.type}-${i.type}`;let r;this.bindEvents(Object.assign({},e,{callback:()=>{if(this._eventCache||(this._eventCache={}),!this._eventCache[n]){const a=this.bindEvents(t);this._eventCache[n]=a}r||(r=this.bindEvents(Object.assign({},i,{callback:()=>{this._eventCache[n]&&(this._eventCache[n](),this._eventCache[n]=null)}})))}}))}else"merge"in t?t.merge.forEach(e=>{const i=Object.assign({},t);ht(e)?i.type=e:$t(e)&&Object.assign(i,e),i.debounce=50,this.bindEvents(i)}):this.bindEvents(t)}interaction(t,e){const i=st.createInteraction(t,this,e);return i&&(i.bind(),this._boundInteractions||(this._boundInteractions=[]),this._boundInteractions.push(i)),i}removeInteraction(t,e){if(this._boundInteractions){const i=this._boundInteractions.filter(n=>{var r;return P(e)?ht(t)?n.type===t:t?n===t:void 0:((r=n.options)===null||r===void 0?void 0:r.id)===e});i.length&&i.forEach(n=>{n.unbind()})}return this}removeAllInteractions(){return this._boundInteractions&&(this._boundInteractions.forEach(t=>{t.unbind()}),this._boundInteractions=null),this}initEvent(){const t=this.renderer.stage();t&&t.on("*",this.delegateEvent)}addEventListener(t,e,i){let n=e;return i&&i.trap===!1||(n=e,n.raw=e),i&&i.target&&(n.target=i.target),this.on(t,n),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}initializeRenderer(){const t=this._options.width,e=this._options.height;this.renderer=new F7(this),this.renderer.initialize(t,e,this._options,this._eventConfig).background(this._background)}initialize(){var t;this.grammars=new iL(e=>e.id(),(e,i)=>this.logger.warn(`Grammar id '${e}' has been occupied`,i)),this._cachedGrammars=new _X(e=>e.id()),this._options.logger&&Nt.setInstance(this._options.logger),this.logger=Nt.getInstance((t=this._options.logLevel)!==null&&t!==void 0?t:0),this._dataflow=new D7,this.animate=new mX(this),this._morph=new fX,this._options.hooks&&(Object.keys(this._options.hooks).forEach(e=>{this.on(e,this._options.hooks[e])}),this.hooks=this._options.hooks),this.container=null,this.renderer=null,this._eventListeners=[],this._eventConfig=O7(this._options.eventConfig),this._theme=this._options.disableTheme?null:fo.getDefaultTheme(),this.parseBuiltIn(),Z7(this._options),this.initializeRenderer(),this._eventConfig.disable||this.initEvent(),this._bindResizeEvent(),this._currentDataflow=null,this._needBuildLayoutTree=!0,this._layoutState=Ys.before,this.theme(this._theme)}pauseProgressive(){return!1}resumeProgressive(){return!1}restartProgressive(){return!1}findProgressiveMarks(){const t=[];return this.traverseMarkTree(e=>{t.push(e)},e=>e.markType!==rt.group&&e.isProgressive()),t.length?(this._progressiveMarks=t,this.renderer&&this.renderer.combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}doPreProgressive(){if(this._progressiveMarks&&this._progressiveMarks.some(t=>t.isDoingProgressive())){const t=Gt.getRequestAnimationFrame();this._progressiveRafId=t(this.handleProgressiveFrame)}}clearProgressive(){this._progressiveRafId&&Gt.getCancelAnimationFrame()(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach(t=>{t.clearProgressive()}),this._progressiveMarks=null)}release(){var t,e,i;this._isReleased=!0,this._unBindResizeEvent(),this.clearProgressive(),st.unregisterRuntimeTransforms(),this.animate.stop(),this.grammars.release(),this._cachedGrammars.release(),this._dataflow.release(),this._dataflow=null,(e=(t=this.renderer)===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t),this.renderer=null,this._boundInteractions=null,this.removeAllListeners(),(i=this._eventListeners)===null||i===void 0||i.forEach(n=>{n.source.removeEventListener(n.type,n.handler)}),this._eventListeners=null}}const oL=()=>{Gi(),DS(),st.registerGraphic(rt.arc,mS)},YX=()=>{Gi(),lY(),st.registerGraphic(rt.arc3d,SO)},XX=()=>{Gi(),uY(),st.registerGraphic(rt.pyramid3d,kO)},KX=()=>{Gi(),lI(),st.registerGraphic(rt.area,xO)},qX=()=>{Gi(),qe(),st.registerGraphic(rt.group,oS)},ZX=()=>{Gi(),hI(),st.registerGraphic(rt.image,_S)},JX=()=>{Gi(),qa(),st.registerGraphic(rt.line,fS)},lL=()=>{Gi(),Ic(),st.registerGraphic(rt.path,bO)},XS=()=>{Gi(),Vr(),st.registerGraphic(rt.rect,Ch)},QX=()=>{Gi(),cY(),st.registerGraphic(rt.rect3d,mO)},KS=()=>{Gi(),qa(),st.registerGraphic(rt.rule,fS)},hL=()=>{Gi(),Dn(),st.registerGraphic(rt.symbol,ym)},dL=()=>{Gi(),Ja(),Za(),st.registerGraphic(rt.text,Mo)},t9=()=>{Gi(),Mm(),st.registerGraphic(rt.polygon,AO)},e9=()=>{Gi(),Za(),st.registerGraphic(rt.richtext,yO)},i9=()=>{Gi(),Dn(),st.registerGraphic(rt.cell,ym)},Vm=()=>{Gi(),dY(),st.registerGraphic(rt.glyph,vO)},uL=s=>(t,e,i)=>{var n,r,a;const o=(a=(n=t.getGraphicAttribute("direction",!1))!==null&&n!==void 0?n:(r=t.mark.getGlyphConfig())===null||r===void 0?void 0:r.direction)!==null&&a!==void 0?a:"vertical",l=s(t,o,e);if(!N(l))return{};const h=t.getGraphicAttribute("x",!1),d=t.getGraphicAttribute("y",!1),u=t.getGraphicAttribute("min",!1),c=t.getGraphicAttribute("max",!1),p=t.getGraphicAttribute("q1",!1),g=t.getGraphicAttribute("q3",!1),f=t.getGraphicAttribute("median",!1),_={from:{x:h,y:d},to:{x:h,y:d}};return N(u)&&(_.from.min=l,_.to.min=u),N(c)&&(_.from.max=l,_.to.max=c),N(p)&&(_.from.q1=l,_.to.q1=p),N(g)&&(_.from.q3=l,_.to.q3=g),N(f)&&(_.from.median=l,_.to.median=f),_},cL=s=>(t,e,i)=>{var n,r,a;const o=(a=(n=t.getGraphicAttribute("direction",!1))!==null&&n!==void 0?n:(r=t.mark.getGlyphConfig())===null||r===void 0?void 0:r.direction)!==null&&a!==void 0?a:"vertical",l=s(t,o,e);if(!N(l))return{};const h=t.getGraphicAttribute("x",!0),d=t.getGraphicAttribute("y",!0),u=t.getGraphicAttribute("min",!0),c=t.getGraphicAttribute("max",!0),p=t.getGraphicAttribute("q1",!0),g=t.getGraphicAttribute("q3",!0),f=t.getGraphicAttribute("median",!0),_={from:{x:h,y:d},to:{x:h,y:d}};return N(u)&&(_.to.min=l,_.from.min=u),N(c)&&(_.to.max=l,_.from.max=c),N(p)&&(_.to.q1=l,_.from.q1=p),N(g)&&(_.to.q3=l,_.from.q3=g),N(f)&&(_.to.median=l,_.from.median=f),_},pL=(s,t,e)=>{var i,n,r,a,o,l,h,d,u,c,p,g;if(e&&N(e.center))return e.center;let f,_,m,v,y;if(Di(t)){f=(n=(i=s.getGraphicAttribute("points",!1,"median"))===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.x,_=(a=(r=s.getGraphicAttribute("points",!1,"max"))===null||r===void 0?void 0:r[0])===null||a===void 0?void 0:a.x,m=(l=(o=s.getGraphicAttribute("points",!1,"min"))===null||o===void 0?void 0:o[0])===null||l===void 0?void 0:l.x;const b=s.getGraphicAttribute("width",!1,"box"),x=s.getGraphicAttribute("x",!1,"box");v=x,y=x+b}else{f=(d=(h=s.getGraphicAttribute("points",!1,"median"))===null||h===void 0?void 0:h[0])===null||d===void 0?void 0:d.y,_=(c=(u=s.getGraphicAttribute("points",!1,"max"))===null||u===void 0?void 0:u[0])===null||c===void 0?void 0:c.y,m=(g=(p=s.getGraphicAttribute("points",!1,"min"))===null||p===void 0?void 0:p[0])===null||g===void 0?void 0:g.y;const b=s.getGraphicAttribute("height",!1,"box"),x=s.getGraphicAttribute("y",!1,"box");v=x,y=x+b}return N(f)?f:N(v)&&N(y)?(v+y)/2:N(_)&&N(m)?(_+m)/2:N(m)?m:N(_)?_:NaN},s9=(s,t,e,i)=>{var n,r,a,o,l,h,d,u;const c={shaft:{},box:{},max:{},min:{},median:{}},p=(n=s.x)!==null&&n!==void 0?n:e.getGraphicAttribute("x",!1),g=(r=s.y)!==null&&r!==void 0?r:e.getGraphicAttribute("y",!1),f=(a=s.width)!==null&&a!==void 0?a:e.getGraphicAttribute("width",!1),_=(o=s.height)!==null&&o!==void 0?o:e.getGraphicAttribute("height",!1),m=(l=s.boxWidth)!==null&&l!==void 0?l:e.getGraphicAttribute("boxWidth",!1),v=(h=s.boxHeight)!==null&&h!==void 0?h:e.getGraphicAttribute("boxHeight",!1),y=(d=s.ruleWidth)!==null&&d!==void 0?d:e.getGraphicAttribute("ruleWidth",!1),b=(u=s.ruleHeight)!==null&&u!==void 0?u:e.getGraphicAttribute("ruleHeight",!1);return i&&Di(i.direction)?(N(v)?(Object.assign(c.box,{y:g-v/2,y1:g+v/2}),Object.assign(c.median,{y:g-v/2,y1:g+v/2})):(Object.assign(c.box,{y:g-_/2,y1:g+_/2}),Object.assign(c.median,{y:g-_/2,y1:g+_/2})),N(b)?(Object.assign(c.max,{y:g-b/2,y1:g+b/2}),Object.assign(c.min,{y:g-b/2,y1:g+b/2})):(Object.assign(c.max,{y:g-_/2,y1:g+_/2}),Object.assign(c.min,{y:g-_/2,y1:g+_/2}))):(N(m)?(Object.assign(c.box,{x:p-m/2,x1:p+m/2}),Object.assign(c.median,{x:p-m/2,x1:p+m/2})):(Object.assign(c.box,{x:p-f/2,x1:p+f/2}),Object.assign(c.median,{x:p-f/2,x1:p+f/2})),N(y)?(Object.assign(c.max,{x:p-y/2,x1:p+y/2}),Object.assign(c.min,{x:p-y/2,x1:p+y/2})):(Object.assign(c.max,{x:p-f/2,x1:p+f/2}),Object.assign(c.min,{x:p-f/2,x1:p+f/2}))),c},n9=uL(pL),r9=cL(pL);function a9(){st.registerGlyph("boxplot",{shaft:"rule",box:"rect",max:"rule",min:"rule",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","boxWidth","boxHeight","ruleWidth","ruleHeight"]).registerFunctionEncoder(s9).registerChannelEncoder("x",(s,t,e,i,n,r)=>r&&Di(r.direction)?null:{shaft:{x:t,x1:t}}).registerChannelEncoder("y",(s,t,e,i,n,r)=>r&&Di(r.direction)?{shaft:{y:t,y1:t}}:null).registerChannelEncoder("q1",(s,t,e,i,n,r)=>r&&Di(r.direction)?{box:{x:t}}:{box:{y:t}}).registerChannelEncoder("q3",(s,t,e,i,n,r)=>r&&Di(r.direction)?{box:{x1:t}}:{box:{y1:t}}).registerChannelEncoder("min",(s,t,e,i,n,r)=>r&&Di(r.direction)?{shaft:{x:t},min:{x:t,x1:t,visible:!0}}:{shaft:{y:t},min:{y:t,y1:t,visible:!0}}).registerChannelEncoder("max",(s,t,e,i,n,r)=>r&&Di(r.direction)?{shaft:{x1:t},max:{x:t,x1:t,visible:!0}}:{shaft:{y1:t},max:{y:t,y1:t,visible:!0}}).registerChannelEncoder("median",(s,t,e,i,n,r)=>r&&Di(r.direction)?{median:{x:t,x1:t,visible:!0}}:{median:{y:t,y1:t,visible:!0}}).registerChannelEncoder("angle",(s,t,e,i,n,r)=>{var a;const o=r&&Di(r.direction)?[(e.min+e.max)/2,e.y]:[e.x,(e.min+e.max)/2],l=(a=e.anchor)!==null&&a!==void 0?a:o;return{shaft:{angle:t,anchor:l},box:{angle:t,anchor:l},max:{angle:t,anchor:l},min:{angle:t,anchor:l},median:{angle:t,anchor:l}}}).registerDefaultEncoder(()=>({max:{visible:!1},min:{visible:!1},median:{visible:!1}})),st.registerAnimationType("boxplotScaleIn",n9),st.registerAnimationType("boxplotScaleOut",r9),Vm(),XS(),KS()}const gL=(s,t,e)=>{var i,n,r,a;if(N(e==null?void 0:e.center))return e.center;let o,l,h,d,u;if(Di(t)){o=(n=(i=s.getGraphicAttribute("points",!1,"median"))===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.x;const c=s.getGraphicAttribute("width",!1,"minMaxBox"),p=s.getGraphicAttribute("x",!1,"minMaxBox");h=p,l=p+c;const g=s.getGraphicAttribute("width",!1,"q1q3Box"),f=s.getGraphicAttribute("x",!1,"q1q3Box");d=f,u=f+g}else{o=(a=(r=s.getGraphicAttribute("points",!1,"median"))===null||r===void 0?void 0:r[0])===null||a===void 0?void 0:a.y;const c=s.getGraphicAttribute("height",!1,"minMaxBox"),p=s.getGraphicAttribute("y",!1,"minMaxBox");h=p,l=p+c;const g=s.getGraphicAttribute("height",!1,"q1q3Box"),f=s.getGraphicAttribute("y",!1,"q1q3Box");d=f,u=f+g}return N(o)?o:N(d)&&N(u)?(d+u)/2:N(l)&&N(h)?(l+h)/2:N(h)?h:N(l)?l:NaN},o9=(s,t,e,i)=>{var n,r,a,o,l,h,d,u;const c={minMaxBox:{},q1q3Box:{},median:{}},p=(n=s.x)!==null&&n!==void 0?n:e.getGraphicAttribute("x",!1),g=(r=s.y)!==null&&r!==void 0?r:e.getGraphicAttribute("y",!1),f=(a=s.width)!==null&&a!==void 0?a:e.getGraphicAttribute("width",!1),_=(o=s.minMaxWidth)!==null&&o!==void 0?o:e.getGraphicAttribute("minMaxWidth",!1),m=(l=s.q1q3Width)!==null&&l!==void 0?l:e.getGraphicAttribute("q1q3Width",!1),v=(h=s.height)!==null&&h!==void 0?h:e.getGraphicAttribute("height",!1),y=(d=s.minMaxHeight)!==null&&d!==void 0?d:e.getGraphicAttribute("minMaxHeight",!1),b=(u=s.q1q3Height)!==null&&u!==void 0?u:e.getGraphicAttribute("q1q3Height",!1);return i&&Di(i.direction)?(N(y)?Object.assign(c.minMaxBox,{y:g-y/2,y1:g+y/2}):Object.assign(c.minMaxBox,{y:g-v/2,y1:g+v/2}),N(b)?(Object.assign(c.q1q3Box,{y:g-b/2,y1:g+b/2}),Object.assign(c.median,{y:g-b/2,y1:g+b/2})):(Object.assign(c.q1q3Box,{y:g-v/2,y1:g+v/2}),Object.assign(c.median,{y:g-v/2,y1:g+v/2}))):(N(_)?Object.assign(c.minMaxBox,{x:p-_/2,x1:p+_/2}):Object.assign(c.minMaxBox,{x:p-f/2,x1:p+f/2}),N(m)?(Object.assign(c.q1q3Box,{x:p-m/2,x1:p+m/2}),Object.assign(c.median,{x:p-m/2,x1:p+m/2})):(Object.assign(c.q1q3Box,{x:p-f/2,x1:p+f/2}),Object.assign(c.median,{x:p-f/2,x1:p+f/2}))),c},l9=uL(gL),h9=cL(gL);function d9(){st.registerGlyph("barBoxplot",{minMaxBox:"rect",q1q3Box:"rect",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","minMaxWidth","q1q3Width","minMaxHeight","q1q3Height"]).registerFunctionEncoder(o9).registerChannelEncoder("q1",(s,t,e,i,n,r)=>r&&Di(r.direction)?{q1q3Box:{x:t}}:{q1q3Box:{y:t}}).registerChannelEncoder("q3",(s,t,e,i,n,r)=>r&&Di(r.direction)?{q1q3Box:{x1:t}}:{q1q3Box:{y1:t}}).registerChannelEncoder("min",(s,t,e,i,n,r)=>r&&Di(r.direction)?{minMaxBox:{x:t}}:{minMaxBox:{y:t}}).registerChannelEncoder("max",(s,t,e,i,n,r)=>r&&Di(r.direction)?{minMaxBox:{x1:t}}:{minMaxBox:{y1:t}}).registerChannelEncoder("median",(s,t,e,i,n,r)=>r&&Di(r.direction)?{median:{x:t,x1:t,visible:!0}}:{median:{y:t,y1:t,visible:!0}}).registerChannelEncoder("angle",(s,t,e,i,n,r)=>{var a;const o=(a=e.anchor)!==null&&a!==void 0?a:[e.x,(e.min+e.max)/2];return{minMaxBox:{angle:t,anchor:o},q1q3Box:{angle:t,anchor:o},median:{angle:t,anchor:o}}}).registerChannelEncoder("lineWidth",(s,t,e,i,n,r)=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0}})).registerChannelEncoder("minMaxFillOpacity",(s,t,e,i,n,r)=>({minMaxBox:{fillOpacity:t}})).registerChannelEncoder("stroke",(s,t,e,i,n,r)=>({minMaxBox:{stroke:!1},q1q3Box:{stroke:!1}})).registerDefaultEncoder(()=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0},median:{visible:!1}})),st.registerAnimationType("barBoxplotScaleIn",l9),st.registerAnimationType("barBoxplotScaleOut",h9),Vm(),XS(),KS()}const u9=()=>{st.registerGlyph("ripplePoint",{symbol:"symbol",ripple0:"symbol",ripple1:"symbol",ripple2:"symbol"}).registerFunctionEncoder((s,t,e,i)=>{var n;const r=Math.max(0,Math.min(s.ripple,1)),a=(n=s.size)!==null&&n!==void 0?n:e.getGraphicAttribute("size"),o=.5*a;return{ripple0:{size:a+o*r,fillOpacity:.75-.25*r},ripple1:{size:a+o*(1+r),fillOpacity:.5-.25*r},ripple2:{size:a+o*(2+r),fillOpacity:.25-.25*r}}}).registerDefaultEncoder(()=>({ripple0:{fillOpacity:.75},ripple1:{fillOpacity:.5},ripple2:{fillOpacity:.25}})),Vm(),hL()},c9=(s,t)=>{var e;const i=(e=s.curvature)!==null&&e!==void 0?e:.5,n=typeof t=="number"?s.thickness*t:s.thickness;let r=s.x0,a=s.x1,o=s.y0,l=s.y1,h=r+i*(a-r),d=a+i*(r-a),u=m=>m;s.round!==!1&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d),u=Math.round),s.pathType==="line"||s.pathType,s.align==="center"?(o=u(s.y0-n/2),l=u(s.y1-n/2)):s.align==="end"?(o=u(s.y0+s.thickness/2-n),l=u(s.y1+s.thickness/2-n)):(o=u(s.y0-s.thickness/2),l=u(s.y1-s.thickness/2));const c=u(o+n),p=u(l+n),g=Math.abs(a-r)>1e-6,f=s.endArrow&&g?`L${a},${u(l-n/2)}L${u(a+n)},${u((l+p)/2)}L${a},${u(p+n/2)}`:"",_=s.startArrow&&g?`L${r},${u(c+n/2)}L${u(r-n)},${u((o+c)/2)}L${r},${u(o-n/2)}`:"";return s.pathType==="line"?`M${r},${o}L${a},${l}${f}L${a},${p}L${r},${c}${_}Z`:s.pathType==="polyline"?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}
|
||
${f}L${a},${p}L${h},${p}L${h},${c}L${r},${c}${_}Z`:`M${r},${o}C${h},${o},${d},${l},${a},${l}
|
||
${f}L${a},${p}C${d},${p},${h},${c},${r},${c}${_}Z`},p9=(s,t)=>{var e;const i=(e=s.curvature)!==null&&e!==void 0?e:.5,n=typeof t=="number"?s.thickness*t:s.thickness;let r=s.y0,a=s.y1,o=s.x0,l=s.x1,h=r+i*(a-r),d=a+i*(r-a),u=m=>m;s.round!==!1&&(u=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d)),s.pathType==="line"||s.pathType,s.align==="center"?(o=u(s.x0-n/2),l=u(s.x1-n/2)):s.align==="end"?(o=u(s.x0+s.thickness/2-n),l=u(s.x1+s.thickness/2-n)):(o=u(s.x0-s.thickness/2),l=u(s.x1-s.thickness/2));const c=u(o+n),p=u(l+n),g=Math.abs(a-r)>1e-6,f=s.endArrow&&g?`L${u(l-n/2)},${a}L${u((l+p)/2)},${u(a+n)}L${u(p+n/2)},${a}`:"",_=s.startArrow&&g?`L${u(c+n/2)},${r}L${u((c+o)/2)},${u(r-n)}L${u(o-n/2)},${r}`:"";return s.pathType==="line"?`M${o},${r}L${l},${a}${f}L${p},${a}L${c},${r}${_}Z`:s.pathType==="polyline"?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}
|
||
${f}L${p},${a}L${p},${h}L${c},${h}L${c},${r}${_}Z`:`M${o},${r}C${o},${h},${l},${d},${l},${a}
|
||
${f}L${p},${a}C${p},${d},${c},${h},${c},${r}${_}Z`},g9=(s,t,e,i)=>{var n;const r=(n=s.direction)!==null&&n!==void 0?n:i==null?void 0:i.direction,a=["vertical","TB","BT"].includes(r)?p9:c9,o=typeof s.ratio=="number"&&s.ratio>=0&&s.ratio<=1,l=Object.keys(s);return["x0","y0","x1","y1"].every(h=>l.includes(h))?{back:{path:o?a(s,1):""},front:{path:a(s,o?s.ratio:1)}}:{}},f9=(s,t,e)=>{const i={x0:s.getGraphicAttribute("x0",!1),x1:s.getGraphicAttribute("x1",!1),y0:s.getGraphicAttribute("y0",!1),y1:s.getGraphicAttribute("y1",!1),thickness:s.getGraphicAttribute("thickness",!1),round:s.getGraphicAttribute("round",!1),align:s.getGraphicAttribute("align",!1),pathType:s.getGraphicAttribute("pathType",!1),endArrow:s.getGraphicAttribute("endArrow",!1),startArrow:s.getGraphicAttribute("startArrow",!1)};return Object.keys(i).forEach(n=>{P(i[n])&&delete i[n]}),{from:Object.assign({},i,{x1:i.x0,y1:i.y0}),to:i}},_9=(s,t,e)=>{const i={x0:s.getGraphicAttribute("x0",!0),x1:s.getGraphicAttribute("x1",!0),y0:s.getGraphicAttribute("y0",!0),y1:s.getGraphicAttribute("y1",!0),thickness:s.getGraphicAttribute("thickness",!0),round:s.getGraphicAttribute("round",!0),align:s.getGraphicAttribute("align",!0),pathType:s.getGraphicAttribute("pathType",!0),endArrow:s.getGraphicAttribute("endArrow",!0),startArrow:s.getGraphicAttribute("startArrow",!0)};return Object.keys(i).forEach(n=>{P(i[n])&&delete i[n]}),{from:i,to:Object.assign({},i,{x1:i.x0,y1:i.y0})}},m9=(s,t,e)=>{const i={thickness:s.getGraphicAttribute("thickness",!1),round:s.getGraphicAttribute("round",!1),align:s.getGraphicAttribute("align",!1),pathType:s.getGraphicAttribute("pathType",!1),endArrow:s.getGraphicAttribute("endArrow",!1),startArrow:s.getGraphicAttribute("startArrow",!1)};return Object.keys(i).forEach(n=>{P(i[n])&&delete i[n]}),{from:Object.assign(Object.assign({x0:s.getGraphicAttribute("x0",!0),x1:s.getGraphicAttribute("x1",!0),y0:s.getGraphicAttribute("y0",!0),y1:s.getGraphicAttribute("y1",!0)},i),i),to:Object.assign({x0:s.getGraphicAttribute("x0",!1),x1:s.getGraphicAttribute("x1",!1),y0:s.getGraphicAttribute("y0",!1),y1:s.getGraphicAttribute("y1",!1)},i)}},v9=()=>{st.registerGlyph("linkPath",{back:"path",front:"path"}).registerFunctionEncoder(g9).registerChannelEncoder("backgroundStyle",(s,t)=>({back:t})).registerDefaultEncoder(()=>({back:{zIndex:0},front:{zIndex:1}})),st.registerAnimationType("linkPathGrowIn",f9),st.registerAnimationType("linkPathGrowOut",_9),st.registerAnimationType("linkPathUpdate",m9),Vm(),lL()};class fL extends YS{parseAddition(t){return super.parseAddition(t),this.scale(t.scale),this}scale(t){if(this.spec.scale){const i=ht(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this.detach(i),this.spec.scale=void 0}const e=ht(t)?this.view.getScaleById(t):t;return this.spec.scale=e,this.attach(e),this._updateComponentEncoders(),this.commit(),this}getScale(){return ht(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale}}const y9=(s,t,e,i)=>{var n,r,a,o;const l=(r=(n=t==null?void 0:t.components)===null||n===void 0?void 0:n.axis)!==null&&r!==void 0?r:{};if(!s)return lt({},l,e??{});const h=[((o=(a=s.tickData)===null||a===void 0?void 0:a.call(s,i))!==null&&o!==void 0?o:[]).map(d=>({id:d.index,label:d.tick,value:d.value,rawValue:d.tick}))];return lt({},l,{items:h},e??{})},b9=(s,t,e,i)=>{var n,r,a,o;const l=(r=(n=t==null?void 0:t.components)===null||n===void 0?void 0:n.circleAxis)!==null&&r!==void 0?r:{};if(!s)return lt({},l,e??{});const h=[((o=(a=s.tickData)===null||a===void 0?void 0:a.call(s,i))!==null&&o!==void 0?o:[]).map(d=>({id:d.index,label:d.tick,value:d.value,rawValue:d.tick}))];return lt({},l,{items:h},e??{})},_L=(s,t,e,i,n,r)=>{var a;const o=s.getCoordinateAxisPosition();n&&n.position==="auto"&&(n.position=e?"content":o);const l=s.getCoordinateAxisPoints(i);if(l){const u={start:l[0],end:l[1],verticalFactor:(o==="top"||o==="left"?-1:1)*(e?-1:1)*(!((a=s.getSpec().range)===null||a===void 0)&&a.reversed?-1:1)};if(r&&t.type==="polar"){const c=t.angle();u.center=t.origin(),u.startAngle=c[0],u.endAngle=c[1]}return u}const h=t.radius(),d=t.angle();return{center:t.origin(),radius:h[1],innerRadius:h[0],inside:e,startAngle:d[0],endAngle:d[1]}};class mL extends fL{constructor(t,e,i){super(t,be.axis,e),this.spec.componentType=be.axis,this.mode=i}parseAddition(t){return super.parseAddition(t),this.axisType(t.axisType),this.tickCount(t.tickCount),this.inside(t.inside),this.baseValue(t.baseValue),this}scale(t){return super.scale(t),this._axisComponentType=null,this}axisType(t){return this.spec.axisType=t,this._axisComponentType=null,this._prepareRejoin(),this.commit(),this}addGraphicItem(t,e){const i=lt({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),n=st.createGraphicComponent(this._getAxisComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,n)}tickCount(t){const e=ht(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}getAxisComponentType(){return this._axisComponentType}_updateComponentEncoders(){const t=ht(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale,e=Object.assign({update:{}},this.spec.encode),i=Object.keys(e).reduce((n,r)=>{const a=e[r];return a&&(n[r]={callback:(o,l,h)=>{var d,u;const c=this.spec.skipTheme?null:this.view.getCurrentTheme();let p=yo(a,o,l,h);const g=Ue(this.spec.inside,h,o,l),f=Ue(this.spec.baseValue,h,o,l),_=(d=t==null?void 0:t.getCoordinate)===null||d===void 0?void 0:d.call(t);_&&(p=Object.assign(_L(t,_,g,f,this.spec.layout),p));const m=(u=t==null?void 0:t.getScale)===null||u===void 0?void 0:u.call(t),v=Ue(this.spec.tickCount,h,o,l);switch(this._getAxisComponentType()){case tr.lineAxis:return y9(m,c,p,v);case tr.circleAxis:return b9(m,c,p,v)}return p}}),n},{});this._encoders=i}_getAxisComponentType(){var t;if(this._axisComponentType)return this._axisComponentType;let e=this.spec.axisType;if(P(e)){const i=ht(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;e=!((t=i==null?void 0:i.getCoordinate)===null||t===void 0)&&t.call(i)?i.getCoordinateAxisPoints()?"line":"circle":"line"}return this._axisComponentType=e==="circle"?tr.circleAxis:tr.lineAxis,this._axisComponentType}}mL.componentType=be.axis;const x9=()=>{st.registerGraphicComponent(tr.lineAxis,(s,t)=>new Wu(s,t)),st.registerGraphicComponent(tr.circleAxis,s=>new Vu(s)),st.registerComponent(be.axis,mL)},S9=(s,t,e,i,n,r={})=>{var a;const o=(a=r.components)===null||a===void 0?void 0:a.dataLabel,l=s.map((h,d)=>{var u,c,p,g,f;const _=Object.assign(Object.assign({},n),{labelIndex:d}),m=(u=Ue(i,_,h))!==null&&u!==void 0?u:{},{components:v={}}=r;let y={};switch(h.markType){case rt.line:case rt.area:y=m.type==="line"?v.lineLabel:m.type==="area"?v.areaLabel:v.lineDataLabel;break;case rt.rect:case rt.rect3d:case rt.interval:y=v.rectLabel;break;case rt.symbol:case rt.circle:case rt.cell:y=v.symbolLabel;break;case rt.arc:case rt.arc3d:y=v.arcLabel;break;case rt.polygon:case rt.path:default:y=v.pointLabel}const b=(c=m.data)!==null&&c!==void 0?c:[],x=(g=(p=y==null?void 0:y.data)===null||p===void 0?void 0:p[0])!==null&&g!==void 0?g:{};b&&b.length>0?b.forEach((A,k)=>{if(h.elements[k]){const w=yo(e,A,h.elements[k],_);lt(A,x,w)}}):h.elements.forEach(A=>{if(A.getGraphicItem().releaseStatus!=="willRelease")if(h.isCollectionMark())A.getDatum().forEach(k=>{const w=yo(e,k,A,_);b.push(lt({},x,w))});else{const k=yo(e,A.getDatum(),A,_),w=lt({},x,k);b.push(w)}});const S=(f=h.graphicItem)===null||f===void 0?void 0:f.name;return lt({},y,{data:b,baseMarkGroupName:S,getBaseMarks:()=>h.elements.map(A=>A.getGraphicItem())},m??{})}).filter(h=>!P(h));return lt({},o,{size:t,dataLabels:l})};let vL=class extends YS{constructor(t,e){super(t,be.label,e),this.spec.componentType=be.label}parseAddition(t){return super.parseAddition(t),this.labelStyle(t.labelStyle),this.size(t.size),this.target(t.target),this}labelStyle(t){return this.setFunctionSpec(t,"labelStyle")}size(t){return this.setFunctionSpec(t,"size")}target(t){if(this.spec.target){const e=Y(this.spec.target).map(i=>ht(i)?this.view.getMarkById(i):i);this.detach(e)}if(this.spec.target=t,t){const e=Y(t).map(i=>ht(i)?this.view.getMarkById(i):i);this.attach(e)}return this.commit(),this}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce((i,n)=>{const r=t[n];return r&&(i[n]={callback:(a,o,l)=>{var h,d,u,c;const p=Y(this.spec.target).map(m=>ht(m)?this.view.getMarkById(m):m),g=(d=(h=this.group)===null||h===void 0?void 0:h.getGroupGraphicItem)===null||d===void 0?void 0:d.call(h);let f=Ue(this.spec.size,l);f||(f=g?{width:(u=g.attribute.width)!==null&&u!==void 0?u:g.AABBBounds.width(),height:(c=g.attribute.height)!==null&&c!==void 0?c:g.AABBBounds.height()}:{width:1/0,height:1/0});const _=this.spec.skipTheme?null:this.view.getCurrentTheme();return S9(p,f,r,this.spec.labelStyle,l,_)}}),i},{});this._encoders=e}};vL.componentType=be.label;const yL=()=>{st.registerGraphicComponent(be.label,s=>new jm(s)),st.registerComponent(be.label,vL)},A9=(s,t,e,i)=>{var n,r,a,o;const l=(r=(n=t==null?void 0:t.components)===null||n===void 0?void 0:n.grid)!==null&&r!==void 0?r:{};if(!s)return lt({},l,e??{});const h=((o=(a=s.tickData)===null||a===void 0?void 0:a.call(s,i))!==null&&o!==void 0?o:[]).map(d=>({id:d.index,label:d.tick,value:d.value,rawValue:d.tick}));return lt({},l,{items:h},e??{})},k9=(s,t,e,i)=>{var n,r,a,o;const l=(r=(n=t==null?void 0:t.components)===null||n===void 0?void 0:n.circleGrid)!==null&&r!==void 0?r:{};if(!s)return lt({},l,e??{});const h=((o=(a=s.tickData)===null||a===void 0?void 0:a.call(s,i))!==null&&o!==void 0?o:[]).map(d=>({id:d.index,label:d.tick,value:d.value,rawValue:d.tick}));return lt({},l,{items:h},e??{})};class bL extends fL{constructor(t,e,i){super(t,be.grid,e),this.spec.componentType=be.grid,this.mode=i}parseAddition(t){return super.parseAddition(t),this.target(t.target),this.gridType(t.gridType),this.gridShape(t.gridShape),this}scale(t){return super.scale(t),this._gridComponentType=null,this}gridType(t){return this.spec.gridType=t,this._gridComponentType=null,this._prepareRejoin(),this.commit(),this}gridShape(t){return this.spec.gridShape=t,this.commit(),this}target(t){if(this.spec.target){const i=ht(this.spec.target)?this.view.getMarkById(this.spec.target):this.spec.target;this.detach(i)}this.spec.target=t;const e=ht(t)?this.view.getMarkById(t):t;return this.attach(e),this._targetAxis=e,this._gridComponentType=null,this._updateComponentEncoders(),this.commit(),this}tickCount(t){const e=ht(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}addGraphicItem(t,e){const i=lt({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),n=st.createGraphicComponent(this._getGridComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,n)}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce((i,n)=>{const r=t[n];return r&&(i[n]={callback:(a,o,l)=>{var h,d,u,c;const p=this.spec.skipTheme?null:this.view.getCurrentTheme();let g,f=yo(r,a,o,l);const _=Ue(this.spec.baseValue,l,a,o);if(this._targetAxis){const y=(h=this._targetAxis.getSpec())===null||h===void 0?void 0:h.scale;g=ht(y)?this.view.getScaleById(y):y;const b=this._targetAxis.elements[0];if(b)switch(this._getGridComponentType()){case mi.lineAxisGrid:f=Object.assign({x:b.getGraphicAttribute("x"),y:b.getGraphicAttribute("y"),start:b.getGraphicAttribute("start"),end:b.getGraphicAttribute("end"),verticalFactor:(d=b.getGraphicAttribute("verticalFactor"))!==null&&d!==void 0?d:1},f);break;case mi.circleAxisGrid:f=Object.assign({x:b.getGraphicAttribute("x"),y:b.getGraphicAttribute("y"),center:b.getGraphicAttribute("center"),radius:b.getGraphicAttribute("radius"),innerRadius:b.getGraphicAttribute("innerRadius"),inside:b.getGraphicAttribute("inside"),startAngle:b.getGraphicAttribute("startAngle"),endAngle:b.getGraphicAttribute("endAngle")},f)}}else{g=ht(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;const y=Ue(this.spec.inside,l,a,o),b=(u=g==null?void 0:g.getCoordinate)===null||u===void 0?void 0:u.call(g);b&&(f=Object.assign(_L(g,b,y,_,this.spec.layout,!0),f))}this._getGridComponentType()===mi.lineAxisGrid&&(f=this.spec.gridShape!=="line"&&this.spec.gridShape?Object.assign({center:f.start,closed:!0},f,{type:this.spec.gridShape}):Object.assign({},f,{type:"line"}));const m=(c=g==null?void 0:g.getScale)===null||c===void 0?void 0:c.call(g),v=Ue(this.spec.tickCount,l,a,o);switch(this._getGridComponentType()){case mi.lineAxisGrid:return A9(m,p,f,v);case mi.circleAxisGrid:return k9(m,p,f,v)}return f}}),i},{});this._encoders=e}_getGridComponentType(){var t;if(this._gridComponentType)return this._gridComponentType;if(this.spec.gridType)this.spec.gridType==="circle"?this._gridComponentType=mi.circleAxisGrid:this._gridComponentType=mi.lineAxisGrid;else if(this._targetAxis)switch(this._targetAxis.getAxisComponentType()){case tr.circleAxis:this._gridComponentType=mi.circleAxisGrid;break;case tr.lineAxis:default:this._gridComponentType=mi.lineAxisGrid}else if(this.spec.scale){const e=ht(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this._gridComponentType=!((t=e==null?void 0:e.getCoordinate)===null||t===void 0)&&t.call(e)?e.getCoordinateAxisPoints()?mi.lineAxisGrid:mi.circleAxisGrid:mi.lineAxisGrid}else this._gridComponentType=mi.lineAxisGrid;return this._gridComponentType}}bL.componentType=be.grid;const w9=()=>{st.registerGraphicComponent(mi.lineAxisGrid,(s,t)=>new PI(s,t)),st.registerGraphicComponent(mi.circleAxisGrid,(s,t)=>new EI(s,t)),st.registerComponent(be.grid,bL)},T9=(s,t,e)=>t.filter(i=>s.callback(i,e)),M9=(s,t,e)=>{const i=s.callback,n=s.as;if(!s.all)return t.forEach(a=>{const o=i(a,e);if(!P(n)){if(P(a))return;a[n]=o}return o}),t;const r=i(t,e);return P(n)||P(t)?r:(t[n]=r,t)};function xL(s){return s.reduce((t,e)=>t+e,0)}function C9(s){return s.length===0?0:xL(s)/s.length}const P9={min:ki,max:ei,average:C9,sum:xL};function E9(s,t,e,i){const n=Math.floor(t.length/s),r=[],a=t.length;let o,l,h,d=0,u=0;r[u++]=d;for(let c=1;c<a-1;c+=n){const p=Math.min(c+n,a-1),g=Math.min(c+2*n,a),f=(g+p)/2;let _=0;for(let x=p;x<g;x++){const S=t[x][i];Number.isNaN(S)||(_+=S)}_/=g-p;const m=c,v=Math.min(c+n,a),y=c-1,b=t[d][i];o=-1,h=m;for(let x=m;x<v;x++){const S=t[x][i];Number.isNaN(i)||(l=Math.abs((y-f)*(S-b)-(y-x)*(_-b)),l>o&&(o=l,h=x))}r[u++]=h,d=h}return r[u-1]!==a-1&&(r[u++]=a-1),r.map(c=>e?t[c].i:c)}function Um(s,t,e,i,n){let r=Math.floor(t.length/s);const a=[],o=t.length;let l=0,h=[];a.push(l),t[l][n]=t[l][n];for(let d=1;d<o-1;d+=r){r>o-d&&(r=o-d,h.length=r),h=[];for(let c=0;c<r;c++)h.push(t[d+c][n]);const u=P9[i](h);l=Math.min(Math.round(d+h.length/2)||0,o-1),t[l][n]=u,a.push(l)}return a.map(d=>e?t[d].i:d)}function R9(s,t,e,i){return Um(s,t,e,"min",i)}function O9(s,t,e,i){return Um(s,t,e,"max",i)}function I9(s,t,e,i){return Um(s,t,e,"average",i)}function L9(s,t,e,i){return Um(s,t,e,"sum",i)}const B9=(s,t)=>{let e=s.size;const i=s.factor||1;if(Array.isArray(e)&&(e=Math.floor(e[1]-e[0])),e*=i,e<=0)return[];if(t.length<=e)return t;if(s.skipfirst)return t.slice(0,1);const{mode:n,yfield:r,groupBy:a}=s,o=r??"y";let l=E9;if(n==="min"?l=R9:n==="max"?l=O9:n==="average"?l=I9:n==="sum"&&(l=L9),t.length){const h={};if(a){for(let u=0,c=t.length;u<c;u++){const p=t[u],g=p[a];h[g]?h[g].push({[o]:p[o],i:u}):(h[g]=[],h[g].push({[o]:p[o],i:u}))}let d=[];return Object.keys(h).forEach(u=>{const c=h[u];if(c.length<=e){const p=c.map(g=>g.i);d=d.concat(p)}else{const p=l(e,c,!0,o);d=d.concat(p),c.forEach(g=>t[g.i][o]=g[o])}}),d.sort((u,c)=>u-c),d.map(u=>t[u])}return l(e,t,!1,o).map(d=>t[d])}return[]},$m="_mo_hide_";function D9(s){return s.forEach(t=>{t.getGraphicAttribute("HIDE_KEY")&&(t.setGraphicAttribute("visible",!0),t.setGraphicAttribute($m,!1))}),s}function F9(s,t,e,i){if(i){let n=-1/0,r=0;const a=P(t);let o=t;s.forEach(l=>{if(l.getGraphicAttribute("visible")===!1)return;const h=l.getGraphicAttribute("size")/2,d=l.getGraphicAttribute("x");a&&(o=(h+r)*e),Math.abs(d-n)<o+r+h?l.getGraphicAttribute("forceShow")||(l.setGraphicAttribute($m,!0),l.setGraphicAttribute("visible",!1)):n=d,r=h})}}function j9(s,t,e,i){if(i){let n=-1/0,r=0;const a=P(t);let o=t;s.forEach(l=>{if(l.getGraphicAttribute("visible")===!1)return;const h=l.getGraphicAttribute("size")/2,d=l.getGraphicAttribute("y");a&&(o=(h+r)*e),Math.abs(d-n)<o+r+h?l.getGraphicAttribute("forceShow")||(l.setGraphicAttribute($m,!0),l.setGraphicAttribute("visible",!1)):n=d,r=h})}}function z9(s,t,e,i){if(i){let r=-1/0,a=0,o=0;const l=P(t);let h=t;s.forEach(d=>{if(d.getGraphicAttribute("visible")===!1)return;const u=d.getGraphicAttribute("size")/2,c=d.getGraphicAttribute("x"),p=d.getGraphicAttribute("y");l&&(h=(u+a)*e),o=(-1/0-c)**2+(r-p)**2,o<(h+a+u)**2?d.getGraphicAttribute("forceShow")||(d.setGraphicAttribute($m,!0),d.setGraphicAttribute("visible",!1)):r=p,a=u})}}const H9=(s,t)=>{if(!t||t.length===0)return;let{radius:e}=s;P(e)&&t[0].mark.markType==="symbol"&&(e=!0);const{direction:i,delta:n,deltaMul:r=1,groupBy:a}=s,o=l=>{D9(l);const h=l.slice().sort((d,u)=>d.getGraphicAttribute("x")-u.getGraphicAttribute("x"));i===0?z9(h,n,r,e):i===1?F9(h,n,r,e):j9(h,n,r,e)};if(a){const l=t.reduce((h,d)=>{const u=d.getDatum()[a];return h[u]?h[u].push(d):h[u]=[d],h},{});Object.keys(l).forEach(h=>{o(l[h])})}else o(t);return t},N9=()=>{st.registerTransform("filter",{transform:T9,markPhase:"beforeJoin"},!0)},G9=()=>{st.registerTransform("map",{transform:M9,markPhase:"beforeJoin"},!0)},qS=()=>{st.registerTransform("sampling",{transform:B9,markPhase:"afterEncode"},!0)},ZS=()=>{st.registerTransform("markoverlap",{transform:H9,markPhase:"afterEncode"},!0)},W9=(s,t,e)=>{var i;const n=s.getGraphicAttribute("clipRangeByDimension",!1),r=(i=s.getGraphicAttribute("clipRange",!1))!==null&&i!==void 0?i:1;return t&&t.clipDimension?{from:{clipRange:0,clipRangeByDimension:t.clipDimension},to:{clipRange:r,clipRangeByDimension:n}}:{from:{clipRange:0},to:{clipRange:r}}},V9=(s,t,e)=>{var i;const n=s.getGraphicAttribute("clipRangeByDimension",!0),r=(i=s.getGraphicAttribute("clipRange",!0))!==null&&i!==void 0?i:1;return t&&t.clipDimension?{from:{clipRange:r,clipRangeByDimension:t.clipDimension},to:{clipRange:0,clipRangeByDimension:n}}:{from:{clipRange:r},to:{clipRange:0}}},U9=(s,t,e)=>{var i,n,r;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:(i=s.getGraphicAttribute("opacity",!1))!==null&&i!==void 0?i:1,fillOpacity:(n=s.getGraphicAttribute("fillOpacity",!1))!==null&&n!==void 0?n:1,strokeOpacity:(r=s.getGraphicAttribute("strokeOpacity",!1))!==null&&r!==void 0?r:1}}},$9=(s,t,e)=>{var i,n,r;return{from:{opacity:(i=s.getGraphicAttribute("opacity",!0))!==null&&i!==void 0?i:1,fillOpacity:(n=s.getGraphicAttribute("fillOpacity",!0))!==null&&n!==void 0?n:1,strokeOpacity:(r=s.getGraphicAttribute("strokeOpacity",!0))!==null&&r!==void 0?r:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}},Y9=(s,t,e)=>{switch(t==null?void 0:t.direction){case"x":{const i=s.getGraphicAttribute("x",!1),n=s.getGraphicAttribute("x1",!1),r=s.getGraphicAttribute("width",!1);return{from:E(r)?{x:i+r/2,x1:void 0,width:0}:{x:(i+n)/2,x1:(i+n)/2,width:void 0},to:{x:i,x1:n,width:r}}}case"y":{const i=s.getGraphicAttribute("y",!1),n=s.getGraphicAttribute("y1",!1),r=s.getGraphicAttribute("height",!1);return{from:E(r)?{y:i+r/2,y1:void 0,height:0}:{y:(i+n)/2,y1:(i+n)/2,height:void 0},to:{y:i,y1:n,height:r}}}default:{const i=s.getGraphicAttribute("x",!1),n=s.getGraphicAttribute("x1",!1),r=s.getGraphicAttribute("width",!1),a=s.getGraphicAttribute("y",!1),o=s.getGraphicAttribute("y1",!1),l=s.getGraphicAttribute("height",!1),h={};return E(r)?(h.x=i+r/2,h.width=0,h.x1=void 0):(h.x=(i+n)/2,h.x1=(i+n)/2,h.width=void 0),E(l)?(h.y=a+l/2,h.height=0,h.y1=void 0):(h.y=(a+o)/2,h.y1=(a+o)/2,h.height=void 0),{from:h,to:{x:i,y:a,x1:n,y1:o,width:r,height:l}}}}},X9=(s,t,e)=>{switch(t==null?void 0:t.direction){case"x":{const i=s.getGraphicAttribute("x",!1),n=s.getGraphicAttribute("x1",!1),r=s.getGraphicAttribute("width",!1);return{to:E(r)?{x:i+r/2,x1:void 0,width:0}:{x:(i+n)/2,x1:(i+n)/2,width:void 0}}}case"y":{const i=s.getGraphicAttribute("y",!1),n=s.getGraphicAttribute("y1",!1),r=s.getGraphicAttribute("height",!1);return{to:E(r)?{y:i+r/2,y1:void 0,height:0}:{y:(i+n)/2,y1:(i+n)/2,height:void 0}}}default:{const i=s.getGraphicAttribute("x",!1),n=s.getGraphicAttribute("y",!1),r=s.getGraphicAttribute("x1",!1),a=s.getGraphicAttribute("y1",!1),o=s.getGraphicAttribute("width",!1),l=s.getGraphicAttribute("height",!1),h={};return E(o)?(h.x=i+o/2,h.width=0,h.x1=void 0):(h.x=(i+r)/2,h.x1=(i+r)/2,h.width=void 0),E(l)?(h.y=n+l/2,h.height=0,h.y1=void 0):(h.y=(n+a)/2,h.y1=(n+a)/2,h.height=void 0),{to:h}}}};function K9(s,t,e){const i=s.getGraphicAttribute("x",!1),n=s.getGraphicAttribute("x1",!1),r=s.getGraphicAttribute("width",!1);if(t&&t.orient==="negative"){const o=E(r)?Math.max(i,i+r):Math.max(i,n);return{from:{x:o,x1:P(n)?void 0:o,width:P(r)?void 0:0},to:{x:i,x1:n,width:r}}}const a=E(r)?Math.min(i,i+r):Math.min(i,n);return{from:{x:a,x1:P(n)?void 0:a,width:P(r)?void 0:0},to:{x:i,x1:n,width:r}}}function q9(s,t,e){var i;const n=s.getGraphicAttribute("x",!1),r=s.getGraphicAttribute("x1",!1),a=s.getGraphicAttribute("width",!1);let o;return t&&t.orient==="negative"?dt(t.overall)?o=t.overall:e.group?(o=(i=e.groupWidth)!==null&&i!==void 0?i:e.group.getBounds().width(),e.groupWidth=o):o=e.width:o=dt(t==null?void 0:t.overall)?t==null?void 0:t.overall:0,{from:{x:o,x1:P(r)?void 0:o,width:P(a)?void 0:0},to:{x:n,x1:r,width:a}}}const Z9=(s,t,e)=>{var i;return((i=t==null?void 0:t.overall)!==null&&i!==void 0&&i)!==!1?q9(s,t,e):K9(s,t)};function J9(s,t,e){const i=s.getGraphicAttribute("x",!1),n=s.getGraphicAttribute("x1",!1),r=s.getGraphicAttribute("width",!1);if(t&&t.orient==="negative"){const o=E(r)?Math.max(i,i+r):Math.max(i,n);return{to:{x:o,x1:P(n)?void 0:o,width:P(r)?void 0:0}}}const a=E(r)?Math.min(i,i+r):Math.min(i,n);return{to:{x:a,x1:P(n)?void 0:a,width:P(r)?void 0:0}}}function Q9(s,t,e){var i;const n=s.getGraphicAttribute("x1",!1),r=s.getGraphicAttribute("width",!1);let a;return t&&t.orient==="negative"?dt(t.overall)?a=t.overall:e.group?(a=(i=e.groupWidth)!==null&&i!==void 0?i:e.group.getBounds().width(),e.groupWidth=a):a=e.width:a=dt(t==null?void 0:t.overall)?t.overall:0,{to:{x:a,x1:P(n)?void 0:a,width:P(r)?void 0:0}}}const tK=(s,t,e)=>{var i;return((i=t==null?void 0:t.overall)!==null&&i!==void 0&&i)!==!1?Q9(s,t,e):J9(s,t)};function eK(s,t,e){const i=s.getGraphicAttribute("y",!1),n=s.getGraphicAttribute("y1",!1),r=s.getGraphicAttribute("height",!1);if(t&&t.orient==="negative"){const o=E(r)?Math.max(i,i+r):Math.max(i,n);return{from:{y:o,y1:P(n)?void 0:o,height:P(r)?void 0:0},to:{y:i,y1:n,height:r}}}const a=E(r)?Math.min(i,i+r):Math.min(i,n);return{from:{y:a,y1:P(n)?void 0:a,height:P(r)?void 0:0},to:{y:i,y1:n,height:r}}}function iK(s,t,e){var i;const n=s.getGraphicAttribute("y",!1),r=s.getGraphicAttribute("y1",!1),a=s.getGraphicAttribute("height",!1);let o;return t&&t.orient==="negative"?dt(t.overall)?o=t.overall:e.group?(o=(i=e.groupHeight)!==null&&i!==void 0?i:e.group.getBounds().height(),e.groupHeight=o):o=e.height:o=dt(t==null?void 0:t.overall)?t.overall:0,{from:{y:o,y1:P(r)?void 0:o,height:P(a)?void 0:0},to:{y:n,y1:r,height:a}}}const sK=(s,t,e)=>{var i;return((i=t==null?void 0:t.overall)!==null&&i!==void 0&&i)!==!1?iK(s,t,e):eK(s,t)};function nK(s,t,e){const i=s.getGraphicAttribute("y",!1),n=s.getGraphicAttribute("y1",!1),r=s.getGraphicAttribute("height",!1);if(t&&t.orient==="negative"){const o=E(r)?Math.max(i,i+r):Math.max(i,n);return{to:{y:o,y1:P(n)?void 0:o,height:P(r)?void 0:0}}}const a=E(r)?Math.min(i,i+r):Math.min(i,n);return{to:{y:a,y1:P(n)?void 0:a,height:P(r)?void 0:0}}}function rK(s,t,e){var i;const n=s.getGraphicAttribute("y1",!1),r=s.getGraphicAttribute("height",!1);let a;return t&&t.orient==="negative"?dt(t.overall)?a=t.overall:e.group?(a=(i=e.groupHeight)!==null&&i!==void 0?i:e.group.getBounds().height(),e.groupHeight=a):a=e.height:a=dt(t==null?void 0:t.overall)?t.overall:0,{to:{y:a,y1:P(n)?void 0:a,height:P(r)?void 0:0}}}const aK=(s,t,e)=>{var i;return((i=t==null?void 0:t.overall)!==null&&i!==void 0&&i)!==!1?rK(s,t,e):nK(s,t)},oK=(s,t,e)=>t&&t.orient==="anticlockwise"?{from:{startAngle:s.getGraphicAttribute("endAngle",!1)},to:{startAngle:s.getGraphicAttribute("startAngle",!1)}}:{from:{endAngle:s.getGraphicAttribute("startAngle",!1)},to:{endAngle:s.getGraphicAttribute("endAngle",!1)}},lK=(s,t,e)=>{if(t&&t.orient==="anticlockwise"){const n=dt(t.overall)?t.overall:2*Math.PI;return{from:{startAngle:n,endAngle:n},to:{startAngle:s.getGraphicAttribute("startAngle",!1),endAngle:s.getGraphicAttribute("endAngle",!1)}}}const i=dt(t==null?void 0:t.overall)?t.overall:0;return{from:{startAngle:i,endAngle:i},to:{startAngle:s.getGraphicAttribute("startAngle",!1),endAngle:s.getGraphicAttribute("endAngle",!1)}}},hK=(s,t,e)=>{var i;return((i=t==null?void 0:t.overall)!==null&&i!==void 0&&i)!==!1?lK(s,t):oK(s,t)},dK=(s,t,e)=>t&&t.orient==="anticlockwise"?{from:{startAngle:s.getGraphicAttribute("startAngle",!0)},to:{startAngle:s.getGraphicAttribute("endAngle",!1)}}:{from:{endAngle:s.getGraphicAttribute("endAngle",!0)},to:{endAngle:s.getGraphicAttribute("startAngle",!1)}},uK=(s,t,e)=>{if(t&&t.orient==="anticlockwise"){const n=dt(t.overall)?t.overall:2*Math.PI;return{from:{startAngle:s.getGraphicAttribute("startAngle",!0),endAngle:s.getGraphicAttribute("endAngle",!0)},to:{startAngle:n,endAngle:n}}}const i=dt(t==null?void 0:t.overall)?t.overall:0;return{from:{startAngle:s.getGraphicAttribute("startAngle",!0),endAngle:s.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}},cK=(s,t,e)=>{var i;return((i=t==null?void 0:t.overall)!==null&&i!==void 0&&i)!==!1?uK(s,t):dK(s,t)},pK=(s,t,e)=>t&&t.orient==="inside"?{from:{innerRadius:s.getGraphicAttribute("outerRadius",!1)},to:{innerRadius:s.getGraphicAttribute("innerRadius",!1)}}:{from:{outerRadius:s.getGraphicAttribute("innerRadius",!1)},to:{outerRadius:s.getGraphicAttribute("outerRadius",!1)}},gK=(s,t,e)=>{const i=dt(t==null?void 0:t.overall)?t.overall:0;return{from:{innerRadius:i,outerRadius:i},to:{innerRadius:s.getGraphicAttribute("innerRadius",!1),outerRadius:s.getGraphicAttribute("outerRadius",!1)}}},fK=(s,t,e)=>{var i;return((i=t==null?void 0:t.overall)!==null&&i!==void 0&&i)!==!1?gK(s,t):pK(s,t)},_K=(s,t,e)=>t&&t.orient==="inside"?{from:{innerRadius:s.getGraphicAttribute("innerRadius",!0)},to:{innerRadius:s.getGraphicAttribute("outerRadius",!1)}}:{from:{outerRadius:s.getGraphicAttribute("outerRadius",!0)},to:{outerRadius:s.getGraphicAttribute("innerRadius",!1)}},mK=(s,t,e)=>{const i=dt(t==null?void 0:t.overall)?t.overall:0;return{from:{innerRadius:s.getGraphicAttribute("innerRadius",!0),outerRadius:s.getGraphicAttribute("outerRadius",!0)},to:{innerRadius:i,outerRadius:i}}},vK=(s,t,e)=>{var i;return((i=t==null?void 0:t.overall)!==null&&i!==void 0&&i)!==!1?mK(s,t):_K(s,t)},SL=(s,t,e)=>{const i=s.getGraphicAttribute("points",!1),n={x:0,y:0};return i.forEach(r=>{n.x+=r.x,n.y+=r.y}),n.x/=i.length,n.y/=i.length,t&&t.center&&(N(t.center.x)&&(n.x=t.center.x),N(t.center.y)&&(n.y=t.center.y)),s.mark.markType==="area"&&(n.x1=n.x,n.y1=n.y),i.map(()=>Object.assign(n))},yK=(s,t,e)=>({from:{points:SL(s,t)},to:{points:s.getGraphicAttribute("points",!1)}}),bK=(s,t,e)=>({from:{points:s.getGraphicAttribute("points",!0)},to:{points:SL(s,t)}}),AL=(s,t,e)=>s.getGraphicAttribute("points",!1).map(i=>{var n;if(t&&t.orient==="negative"){let r=e.width;return e.group&&(r=(n=e.groupWidth)!==null&&n!==void 0?n:e.group.getBounds().width(),e.groupWidth=r),{x:r,y:i.y,x1:r,y1:i.y1,defined:i.defined!==!1}}return{x:0,y:i.y,x1:0,y1:i.y1,defined:i.defined!==!1}}),xK=(s,t,e)=>({from:{points:AL(s,t,e)},to:{points:s.getGraphicAttribute("points",!1)}}),SK=(s,t,e)=>({from:{points:s.getGraphicAttribute("points",!0)},to:{points:AL(s,t,e)}}),kL=(s,t,e)=>s.getGraphicAttribute("points",!1).map(i=>{var n;if(t&&t.orient==="negative"){let r=e.height;return e.group&&(r=(n=e.groupHeight)!==null&&n!==void 0?n:e.group.getBounds().height(),e.groupHeight=r),{x:i.x,y:r,x1:i.x1,y1:r,defined:i.defined!==!1}}return{x:i.x,y:0,x1:i.x1,y1:0,defined:i.defined!==!1}}),AK=(s,t,e)=>({from:{points:kL(s,t,e)},to:{points:s.getGraphicAttribute("points",!1)}}),kK=(s,t,e)=>({from:{points:s.getGraphicAttribute("points",!0)},to:{points:kL(s,t,e)}}),wK=(s,t,e)=>{var i,n;const{offset:r=0,orient:a,direction:o,point:l}=t??{};let h=0,d=0;a==="negative"&&(e.group?(h=(i=e.groupWidth)!==null&&i!==void 0?i:e.group.getBounds().width(),d=(n=e.groupHeight)!==null&&n!==void 0?n:e.group.getBounds().height(),e.groupWidth=h,e.groupHeight=d):(h=e.width,d=e.height)),h+=r,d+=r;const u=K(l)?l.call(null,s.getDatum(),s,e):l,c=u&&N(u.x)?u.x:h,p=u&&N(u.y)?u.y:d;switch(o){case"x":return{from:{x:c},to:{x:s.getGraphicAttribute("x",!1)}};case"y":return{from:{y:p},to:{y:s.getGraphicAttribute("y",!1)}};default:return{from:{x:c,y:p},to:{x:s.getGraphicAttribute("x",!1),y:s.getGraphicAttribute("y",!1)}}}},TK=(s,t,e)=>{var i,n;const{offset:r=0,orient:a,direction:o,point:l}=t??{},h=e.group?e.group.getBounds():null,d=(i=h==null?void 0:h.width())!==null&&i!==void 0?i:e.width,u=(n=h==null?void 0:h.height())!==null&&n!==void 0?n:e.height,c=(a==="negative"?d:0)+r,p=(a==="negative"?u:0)+r,g=K(l)?l.call(null,s.getDatum(),s,e):l,f=g&&N(g.x)?g.x:c,_=g&&N(g.y)?g.y:p;switch(o){case"x":return{from:{x:s.getGraphicAttribute("x",!0)},to:{x:f}};case"y":return{from:{y:s.getGraphicAttribute("y",!0)},to:{y:_}};default:return{from:{x:s.getGraphicAttribute("x",!0),y:s.getGraphicAttribute("y",!0)},to:{x:f,y:_}}}},MK=(s,t,e)=>{var i,n,r,a;switch(t==null?void 0:t.direction){case"x":return{from:{scaleX:0},to:{scaleX:(i=s.getGraphicAttribute("scaleX",!1))!==null&&i!==void 0?i:1}};case"y":return{from:{scaleY:0},to:{scaleY:(n=s.getGraphicAttribute("scaleY",!1))!==null&&n!==void 0?n:1}};default:return{from:{scaleX:0,scaleY:0},to:{scaleX:(r=s.getGraphicAttribute("scaleX",!1))!==null&&r!==void 0?r:1,scaleY:(a=s.getGraphicAttribute("scaleY",!1))!==null&&a!==void 0?a:1}}}},CK=(s,t,e)=>{var i,n,r,a;switch(t==null?void 0:t.direction){case"x":return{from:{scaleX:(i=s.getGraphicAttribute("scaleX",!0))!==null&&i!==void 0?i:1},to:{scaleX:0}};case"y":return{from:{scaleY:(n=s.getGraphicAttribute("scaleY",!0))!==null&&n!==void 0?n:1},to:{scaleY:0}};default:return{from:{scaleX:(r=s.getGraphicAttribute("scaleX",!0))!==null&&r!==void 0?r:1,scaleY:(a=s.getGraphicAttribute("scaleY",!0))!==null&&a!==void 0?a:1},to:{scaleX:0,scaleY:0}}}},PK=(s,t,e)=>{const i=Object.assign({},s.getPrevGraphicAttributes()),n=Object.assign({},s.getNextGraphicAttributes());return t&&Y(t.excludeChannels).forEach(r=>{delete i[r],delete n[r]}),Object.keys(n).forEach(r=>{km(r,i,n)&&(delete i[r],delete n[r])}),{from:i,to:n}},EK=(s,t,e)=>{var i;const n=(i=s.getGraphicAttribute("angle",!1))!==null&&i!==void 0?i:0;let r=0;return r=gs(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:N(t==null?void 0:t.angle)?t.angle:(t==null?void 0:t.orient)==="anticlockwise"?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:r},to:{angle:n}}},RK=(s,t,e)=>{var i;const n=(i=s.getGraphicAttribute("angle",!0))!==null&&i!==void 0?i:0;let r=0;return r=gs(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:N(t==null?void 0:t.angle)?t.angle:(t==null?void 0:t.orient)==="anticlockwise"?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:n},to:{angle:r}}},OK=()=>{st.registerAnimationType("clipIn",W9)},IK=()=>{st.registerAnimationType("clipOut",V9)},LK=()=>{st.registerAnimationType("fadeIn",U9)},BK=()=>{st.registerAnimationType("fadeOut",$9)},DK=()=>{st.registerAnimationType("growCenterIn",Y9)},FK=()=>{st.registerAnimationType("growCenterOut",X9)},jK=()=>{st.registerAnimationType("growHeightIn",sK)},zK=()=>{st.registerAnimationType("growHeightOut",aK)},HK=()=>{st.registerAnimationType("growWidthIn",Z9)},NK=()=>{st.registerAnimationType("growWidthOut",tK)},wL=()=>{st.registerAnimationType("growPointsIn",yK)},TL=()=>{st.registerAnimationType("growPointsOut",bK)},GK=()=>{st.registerAnimationType("growPointsXIn",xK)},WK=()=>{st.registerAnimationType("growPointsXOut",SK)},VK=()=>{st.registerAnimationType("growPointsYIn",AK)},UK=()=>{st.registerAnimationType("growPointsYOut",kK)},$K=()=>{st.registerAnimationType("growAngleIn",hK)},YK=()=>{st.registerAnimationType("growAngleOut",cK)},XK=()=>{st.registerAnimationType("growRadiusIn",fK)},KK=()=>{st.registerAnimationType("growRadiusOut",vK)},qK=()=>{st.registerAnimationType("moveIn",wK)},ZK=()=>{st.registerAnimationType("moveOut",TK)},JK=()=>{st.registerAnimationType("scaleIn",MK)},QK=()=>{st.registerAnimationType("scaleOut",CK)},tq=()=>{st.registerAnimationType("rotateIn",EK)},eq=()=>{st.registerAnimationType("rotateOut",RK)},iq=()=>{st.registerAnimationType("update",PK)};class ML extends td{encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(t),this}_updateComponentEncoders(t){this._encoders||(this._encoders={});const e=this.spec.encode[t];if(e&&t==="update"){const i=this.parameters(),n=_a(e)?null:Object.keys(e).reduce((r,a)=>(Tm(e[a])&&(r[a]=zu(e[a].scale,i)),r),{});this._encoders[t]={callback:(r,a,o)=>{const l=yo(e,r,a,o);if(P(l.size)){const h=n.x?UM(n.x):void 0,d=n.y?UM(n.y):void 0;P(h)&&P(d)?l.size=10:P(h)?l.size=d:P(d)&&(l.size=h),l.size=[h,d]}return P(l.shape)&&(l.shape="rect"),l}}}else this._encoders[t]=e}_getEncoders(){var t;return(t=this._encoders)!==null&&t!==void 0?t:{}}getAttributeTransforms(){return[{channels:["size","padding"],transform:(t,e,i)=>{if(dt(i.padding)&&i.padding>0)t.size=$(i.size)?i.size.map(n=>Math.max(n-i.padding,1)):Math.max(i.size-i.padding,1);else if($(i.padding)&&i.padding.length===2){const n=$(i.size)?i.size:[i.size,i.size];t.size=[Math.max(n[0]-i.padding[0],1),Math.max(n[1]-i.padding[1],1)]}else t.size=i.size},storedAttrs:"paddingAttrs"}].concat(Ro.symbol)}release(){super.release(),this._encoders=null}}ML.markType=rt.cell;const sq=()=>{st.registerMark(rt.cell,ML)},nq=["pointerdown","pointerup","pointerupoutside","pointertap","pointerover","pointermove","pointerenter","pointerleave","pointerout","mousedown","mouseup","mouseupoutside","rightdown","rightup","rightupoutside","click","dblclick","mousemove","mouseover","mouseout","mouseenter","mouseleave","wheel","touchstart","touchend","touchendoutside","touchmove","touchcancel","tap","dragstart","drag","dragenter","dragleave","dragover","dragend","drop","pan","panstart","panend","press","pressup","pressend","pinch","pinchstart","pinchend","swipe"];var St;(function(s){s.initialized="initialized",s.rendered="rendered",s.renderFinished="renderFinished",s.animationFinished="animationFinished",s.regionSeriesDataFilterOver="regionSeriesDataFilterOver",s.afterInitData="afterInitData",s.afterInitEvent="afterInitEvent",s.afterInitMark="afterInitMark",s.rawDataUpdate="rawDataUpdate",s.viewDataFilterOver="viewDataFilterOver",s.viewDataUpdate="viewDataUpdate",s.viewDataStatisticsUpdate="viewDataStatisticsUpdate",s.markDeltaYUpdate="markDeltaYUpdate",s.viewDataLabelUpdate="viewDataLabelUpdate",s.scaleDomainUpdate="scaleDomainUpdate",s.scaleUpdate="scaleUpdate",s.dataZoomChange="dataZoomChange",s.drill="drill",s.layoutStart="layoutStart",s.layoutEnd="layoutEnd",s.layoutRectUpdate="layoutRectUpdate",s.playerPlay="playerPlay",s.playerPause="playerPause",s.playerEnd="playerEnd",s.playerChange="playerChange",s.playerForward="playerForward",s.playerBackward="playerBackward",s.scrollBarChange="scrollBarChange",s.brushStart="brushStart",s.brushChange="brushChange",s.brushEnd="brushEnd",s.brushClear="brushClear",s.legendSelectedDataChange="legendSelectedDataChange",s.legendFilter="legendFilter",s.legendItemClick="legendItemClick",s.legendItemHover="legendItemHover",s.legendItemUnHover="legendItemUnHover",s.tooltipShow="tooltipShow",s.tooltipHide="tooltipHide",s.tooltipRelease="tooltipRelease",s.afterResize="afterResize",s.afterRender="afterRender",s.afterLayout="afterLayout"})(St||(St={}));var te;(function(s){s.chart="chart",s.window="window",s.canvas="canvas"})(te||(te={}));var Xt;(function(s){s.vchart="vchart",s.chart="chart",s.model="model",s.mark="mark"})(Xt||(Xt={}));const u_=`${At}_waterfall_default_seriesField`,CL=`${At}_CORRELATION_X`,PL=`${At}_CORRELATION_Y`,EL=`${At}_CORRELATION_SIZE`,Si=`${At}_DEFAULT_DATA_INDEX`,ar=`${At}_DEFAULT_DATA_KEY`,Fs=`${At}_DEFAULT_DATA_SERIES_FIELD`,uC=`${At}_DEFAULT_SERIES_STYLE_NAME`;var tt;(function(s){s[s.Default=0]="Default",s[s.Theme=1]="Theme",s[s.Chart=2]="Chart",s[s.Base_Series=3]="Base_Series",s[s.Series=4]="Series",s[s.Mark=5]="Mark",s[s.User_Chart=6]="User_Chart",s[s.User_Series=7]="User_Series",s[s.User_Mark=8]="User_Mark",s[s.Built_In=99]="Built_In"})(tt||(tt={}));const ln=`${At}_STACK_START`,ui=`${At}_STACK_END`,$u=`${At}_STACK_START_PERCENT`,$a=`${At}_STACK_END_PERCENT`,hx=`${At}_STACK_START_OffsetSilhouette`,dx=`${At}_STACK_END_OffsetSilhouette`,RL=`${At}_STACK_TOTAL`,rq=`${At}_STACK_TOTAL_PERCENT`,ux=`${At}_STACK_TOTAL_TOP`,bg=`${At}_SEGMENT_START`,D0=`${At}_SEGMENT_END`;var ce;(function(s){s[s.Axis_Grid=50]="Axis_Grid",s[s.CrossHair_Grid=100]="CrossHair_Grid",s[s.Region=450]="Region",s[s.Mark=300]="Mark",s[s.Node=400]="Node",s[s.Axis=100]="Axis",s[s.MarkLine=500]="MarkLine",s[s.MarkArea=100]="MarkArea",s[s.MarkPoint=500]="MarkPoint",s[s.DataZoom=500]="DataZoom",s[s.ScrollBar=500]="ScrollBar",s[s.Player=500]="Player",s[s.Legend=500]="Legend",s[s.CrossHair=500]="CrossHair",s[s.Indicator=500]="Indicator",s[s.Title=500]="Title",s[s.Label=500]="Label",s[s.Brush=500]="Brush",s[s.CustomMark=500]="CustomMark",s[s.Interaction=700]="Interaction"})(ce||(ce={}));var Ln;(function(s){s[s.Indicator=10]="Indicator",s[s.Region=20]="Region",s[s.Axis=30]="Axis",s[s.DataZoom=40]="DataZoom",s[s.Player=40]="Player",s[s.ScrollBar=40]="ScrollBar",s[s.Legend=50]="Legend",s[s.Title=70]="Title",s[s.CustomMark=70]="CustomMark"})(Ln||(Ln={}));const cC=["linear","radial","conical"],aq={x0:0,y0:0,x1:1,y1:1},oq={x0:0,y0:0,x1:1,y1:1,r0:0,r1:1},lq={x:.5,y:.5,startAngle:0,endAngle:2*Math.PI},hq={linear:aq,radial:oq,conical:lq},Me={label:{name:"label",type:"text"}},F0=`${At}_rect_x`,j0=`${At}_rect_x1`,z0=`${At}_rect_y`,H0=`${At}_rect_y1`,Ym=Object.assign(Object.assign({},Me),{bar:{name:"bar",type:"rect"},barBackground:{name:"barBackground",type:"rect"}}),JS=Object.assign(Object.assign({},Me),{bar3d:{name:"bar3d",type:"rect3d"}}),ha={point:{name:"point",type:"symbol"},line:{name:"line",type:"line"}},OL=Object.assign(Object.assign({},Me),ha),IL=Object.assign(Object.assign({},Me),{point:{name:"point",type:"symbol"}}),QS=Object.assign(Object.assign(Object.assign({},Me),ha),{area:{name:"area",type:"area"}}),LL=Object.assign(Object.assign(Object.assign({},Me),ha),{area:{name:"area",type:"area"}}),BL=Object.assign(Object.assign({},Me),{pie:{name:"pie",type:"arc"},labelLine:{name:"labelLine",type:"path"}}),DL=Object.assign(Object.assign({},Me),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}}),FL=Object.assign(Object.assign({},Me),{rose:{name:"rose",type:"arc"}}),jL=Object.assign(Object.assign({},Me),{area:{name:"area",type:"path"}}),tA=Object.assign(Object.assign({},Me),{group:{name:"group",type:"group"}}),zL=Object.assign(Object.assign({},tA),{track:{name:"track",type:"progressArc"},progress:{name:"progress",type:"progressArc"}}),HL=Object.assign(Object.assign({},Me),{group:{name:"group",type:"group"},link:{name:"link",type:"rule"},arrow:{name:"arrow",type:"symbol"}}),NL=Object.assign(Object.assign({},Me),{group:{name:"group",type:"group"},grid:{name:"grid",type:"rule"},gridBackground:{name:"gridBackground",type:"rect"},dot:{name:"dot",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},symbol:{name:"symbol",type:"symbol"}}),cx=Object.assign(Object.assign({},Me),{word:{name:"word",type:"text"},fillingWord:{name:"fillingWord",type:"text"}}),GL=Object.assign(Object.assign({},Me),{funnel:{name:"funnel",type:"polygon"},transform:{name:"transform",type:"polygon"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}}),WL=Object.assign(Object.assign({},Me),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}}),VL=Object.assign(Object.assign({},Me),{track:{name:"track",type:"rect"},progress:{name:"progress",type:"rect"},group:{name:"group",type:"group"}}),UL=Object.assign(Object.assign({},Ym),{leaderLine:{name:"leaderLine",type:"rule"},stackLabel:{name:"stackLabel",type:"text"}}),$L=Object.assign(Object.assign({},Me),{boxPlot:{name:"boxPlot",type:"boxPlot"},outlier:{name:"outlier",type:"symbol"}}),YL=Object.assign(Object.assign({},Me),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),XL=Object.assign(Object.assign({},Me),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}}),KL=Object.assign(Object.assign({},tA),{segment:{name:"segment",type:"progressArc"},track:{name:"track",type:"progressArc"}}),qL=Object.assign(Object.assign({},Me),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),ZL=Object.assign(Object.assign({},Me),{sunburst:{name:"sunburst",type:"arc"}}),JL=Object.assign(Object.assign({},Ym),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}}),QL=Object.assign(Object.assign({},JS),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}}),tB=Object.assign(Object.assign({},Me),{circlePacking:{name:"circlePacking",type:"arc"}}),eB=Object.assign(Object.assign({},Me),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}}),iB=Object.assign(Object.assign({},Me),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),sB=Object.assign({},QS);var pC;(function(s){s.area_horizontal="area_horizontal",s.area_vertical="area_vertical",s.line_horizontal="line_horizontal",s.line_vertical="line_vertical",s.bar_horizontal="bar_horizontal",s.bar_vertical="bar_vertical",s.bar3d_horizontal="bar3d_horizontal",s.bar3d_vertical="bar3d_vertical",s.rangeColumn_horizontal="rangeColumn_horizontal",s.rangeColumn_vertical="rangeColumn_vertical",s.rangeColumn3d_horizontal="rangeColumn3d_horizontal",s.rangeColumn3d_vertical="rangeColumn3d_vertical",s.rangeArea_horizontal="rangeArea_horizontal",s.rangeArea_vertical="rangeArea_vertical",s.linearProgress_horizontal="linearProgress_horizontal",s.linearProgress_vertical="linearProgress_vertical",s.boxPlot_horizontal="boxPlot_horizontal",s.boxPlot_vertical="boxPlot_vertical",s.sankey_horizontal="sankey_horizontal",s.sankey_vertical="sankey_vertical",s.waterfall_horizontal="waterfall_horizontal",s.waterfall_vertical="waterfall_vertical"})(pC||(pC={}));const c_={[z.bar]:Ym,[z.bar3d]:JS,[z.line]:OL,[z.scatter]:IL,[z.area]:QS,[z.radar]:LL,[z.pie]:BL,[z.pie3d]:DL,[z.rose]:FL,[z.geo]:Me,[z.map]:jL,[z.circularProgress]:zL,[z.link]:HL,[z.dot]:NL,[z.wordCloud]:cx,[z.wordCloud3d]:cx,[z.funnel]:GL,[z.funnel3d]:WL,[z.linearProgress]:VL,[z.waterfall]:UL,[z.boxPlot]:$L,[z.treemap]:YL,[z.sankey]:XL,[z.gauge]:KL,[z.gaugePointer]:qL,[z.sunburst]:ZL,[z.rangeColumn]:JL,[z.rangeColumn3d]:QL,[z.circlePacking]:tB,[z.heatmap]:eB,[z.correlation]:iB,[z.rangeArea]:sB};function nB(s){var t,e;const{type:i}=s;return i===z.sankey?(t=s.direction)!==null&&t!==void 0?t:"horizontal":(e=s.direction)!==null&&e!==void 0?e:"vertical"}const dq={primaryFontColor:"titleFontColor",tertiaryFontColor:"labelFontColor",axisLabelFontColor:"axisFontColor",axisMarkerFontColor:"labelReverseFontColor",dataZoomHandleStrokeColor:"dataZoomHandlerStrokeColor",sliderHandleColor:"dataZoomHandlerFillColor",sliderRailColor:"dataZoomBackgroundColor",sliderTrackColor:"dataZoomSelectedColor",playerControllerColor:"dataZoomSelectedColor",popupBackgroundColor:"tooltipBackgroundColor",hoverBackgroundColor:"axisGridColor"},uq={titleFontColor:"primaryFontColor",labelFontColor:"tertiaryFontColor",axisFontColor:"axisLabelFontColor",labelReverseFontColor:"axisMarkerFontColor",dataZoomHandlerStrokeColor:"dataZoomHandleStrokeColor",dataZoomHandlerFillColor:"sliderHandleColor",dataZoomBackgroundColor:"sliderRailColor",dataZoomSelectedColor:"sliderTrackColor",tooltipBackgroundColor:"popupBackgroundColor"};function cq(s,t){const e=dq[t];if(e&&s[e])return s[e];if(s[t])return s[t];const i=uq[t];return i?s[i]:void 0}function Yu(s,t){var e;if(!s)return[];const i=rB(s,t);if(!i||$(i))return(e=i)!==null&&e!==void 0?e:[];if($t(i)){const{dataScheme:n}=i;return n?eA(n)?n.map(r=>Object.assign(Object.assign({},r),{scheme:r.scheme.map(a=>p_(a)?gx(s,a,t):a).filter(E)})):n.map(r=>p_(r)?gx(s,r,t):r).filter(E):[]}return[]}function px(s,t){var e,i;return eA(s)?(i=(e=s.find(n=>E(n.isAvailable)?K(n.isAvailable)?n.isAvailable(t):!!n.isAvailable:!E(n.maxDomainLength)||(t==null?void 0:t.length)<=n.maxDomainLength))===null||e===void 0?void 0:e.scheme)!==null&&i!==void 0?i:s[s.length-1].scheme:s}function gx(s,t,e){var i;const n=rB(s,e);if(!n)return;let r;const{palette:a}=n;if($t(a)&&(r=(i=cq(a,t.key))!==null&&i!==void 0?i:t.default),!r)return;if(P(t.a)&&P(t.l)||!ht(r))return r;let o=new Qe(r);if(E(t.l)){const{r:l,g:h,b:d}=o.color,{h:u,s:c}=Q_(l,h,d),p=wg(u,c,t.l),g=new Qe(`rgb(${p.r}, ${p.g}, ${p.b})`);g.setOpacity(o.color.opacity),o=g}return E(t.a)&&o.setOpacity(t.a),o.toRGBA()}const pq=(s,t,e)=>{if(t&&p_(s)){const i=gx(t,s,e);if(i)return i}return s};function p_(s){return s&&s.type==="palette"&&!!s.key}function eA(s){return!(!$(s)||s.length===0)&&s.every(t=>E(t.scheme))}function gq(s){return $(s)?{dataScheme:s}:s}function rB(s,t){var e,i;const{type:n}=t??{};let r;if(!t||P(n))r=s==null?void 0:s.default;else{const a=nB(t);r=(i=(e=s==null?void 0:s[`${n}_${a}`])!==null&&e!==void 0?e:s==null?void 0:s[n])!==null&&i!==void 0?i:s==null?void 0:s.default}return r}class jc extends Po{range(t){return t?(this._range=t,this._resetRange(),this):super.range()}domain(t){return t?(super.domain(t),this._resetRange(),this):super.domain()}_resetRange(){if(!eA(this._range))return void super.range(this._range);const t=px(this._range,this._domain);super.range(t)}}const fq={linear:un,band:Wo,point:HU,ordinal:Po,threshold:CS,colorOrdinal:jc};function fx(s){const t=fq[s];return t?new t:null}function _q(s,t){if("scale"in s&&s.scale)return ht(s.scale)&&(t!=null&&t.globalScale)?t.globalScale.registerMarkAttributeScale(s,t.seriesId):s.scale;const e=fx(s.type);return e&&mq(e,s),e}function mq(s,t){s&&t&&(t.domain&&s.domain(t.domain),t.range&&s.range(t.range),t.specified&&s.specified&&s.specified(t.specified))}function ee(s,t){if(!t)return s;const e=t.range(),i=Math.min(e[0],e[e.length-1]),n=Math.max(e[0],e[e.length-1]);return Math.min(Math.max(i,s),n)}function gC(s){return E(s==null?void 0:s.field)&&E(s==null?void 0:s.scale)}function iA(s){switch(s){case"left":case"right":case"top":case"bottom":return!0;default:return!1}}function ws(s){return!!ht(s)&&!!s.endsWith("%")&&rr(s.substring(0,s.length-1))}function vq(s){return!!$t(s)&&("percent"in s||"offset"in s)}function Xi(s,t,e){var i,n;return dt(s)?s:ws(s)?Number(s.substring(0,s.length-1))*t/100:K(s)?s(e):$t(s)?t*((i=s.percent)!==null&&i!==void 0?i:0)+((n=s.offset)!==null&&n!==void 0?n:0):0}function aB(s,t,e){var i,n,r,a;const o={top:0,bottom:0,left:0,right:0};return Object.values(s).every(l=>dt(l))?(o.top=(i=s.top)!==null&&i!==void 0?i:0,o.right=(n=s.right)!==null&&n!==void 0?n:0,o.bottom=(r=s.bottom)!==null&&r!==void 0?r:0,o.left=(a=s.left)!==null&&a!==void 0?a:0,o):([{orients:["left","right"],size:t.width},{orients:["top","bottom"],size:t.height}].forEach(l=>{l.orients.forEach(h=>{o[h]=Xi(s[h],l.size,e)})}),o)}function yq(s,t){return s?{width:Math.ceil(Math.min(s.x2-s.x1,t.width)),height:Math.ceil(Math.min(s.y2-s.y1,t.height))}:{width:0,height:0}}function Hr(s){let t={};return $(s)?(P(s[0])||(t.top=t.left=t.bottom=t.right=s[0]),P(s[1])||(t.left=t.right=s[1]),P(s[2])||(t.bottom=s[2]),P(s[3])||(t.left=s[3]),t):dt(s)||ws(s)||K(s)||vq(s)?(t.top=t.left=t.bottom=t.right=s,t):($t(s)&&(t=Object.assign({},s)),t)}function fC(s,t,e){return e?{x:s.x+t.x,y:s.y+t.y}:s}const Pl=(s,t)=>{const e=Number(s),i=s.toString();return isNaN(e)&&i[i.length-1]==="%"?t*(Number(i.slice(0,i.length-1))/100):e};function bq(s){if(!s)return null;if(typeof s=="string")return{fill:s,fillOpacity:1};if(typeof s!="object")return null;const t=yh(s,["x","y","width","height","x1","y1","image"]);return t.background=s.image,t}const oB=[{maxDomainLength:10,scheme:["#1664FF","#1AC6FF","#FF8A00","#3CC780","#7442D4","#FFC400","#304D77","#B48DEB","#009488","#FF7DDA"]},{scheme:["#1664FF","#B2CFFF","#1AC6FF","#94EFFF","#FF8A00","#FFCE7A","#3CC780","#B9EDCD","#7442D4","#DDC5FA","#FFC400","#FAE878","#304D77","#8B959E","#B48DEB","#EFE3FF","#009488","#59BAA8","#FF7DDA","#FFCFEE"]}],xq={default:{dataScheme:oB,palette:{backgroundColor:"#ffffff",borderColor:"#e3e5e8",shadowColor:"rgba(33,37,44,0.1)",hoverBackgroundColor:"#f1f2f5",sliderRailColor:"#f1f3f4",sliderHandleColor:"#ffffff",sliderTrackColor:"#0040ff",popupBackgroundColor:"#ffffff",primaryFontColor:"#21252c",secondaryFontColor:"#606773",tertiaryFontColor:"#89909d",axisLabelFontColor:"#89909d",disableFontColor:"#bcc1cb",axisMarkerFontColor:"#ffffff",axisGridColor:"#f1f2f5",axisDomainColor:"#d9dde4",dataZoomHandleStrokeColor:"#aeb5be",dataZoomChartColor:"#c9ced8",playerControllerColor:"#0040ff",scrollBarSliderColor:"rgba(0,0,0,0.3)",axisMarkerBackgroundColor:"#21252c",markLabelBackgroundColor:"#f1f2f5",markLineStrokeColor:"#606773",dangerColor:"#e33232",warningColor:"#ffc528",successColor:"#07a35a",infoColor:"#3073f2"}}},Sq={label:{visible:!1,offset:5,position:"top",style:{stroke:{type:"palette",key:"backgroundColor"},lineWidth:2}},point:{style:{symbolType:"circle"}}},Aq={label:{visible:!1,position:"outside",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},kq={bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}},wq={outerRadius:.8,innerRadius:.6,progress:{style:{fillOpacity:1}},track:{style:{fillOpacity:.2}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},xt={defaultFontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",defaultFontSize:14,l1FontSize:32,l2FontSize:20,l3FontSize:16,l3LineHeight:"150%",l4FontSize:14,l4LineHeight:"150%",l5FontSize:12,l5LineHeight:"130%",l6FontSize:10,l6LineHeight:"120%",axisTickSize:4,areaOpacity:.2},Tq={dot:{style:{size:10,fillOpacity:1}},symbol:{style:{size:10}},title:{style:{textAlign:"left",textBaseline:"middle",fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight}},subTitle:{style:{textAlign:"left",textBaseline:"top",fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight}}},Mq={transform:{style:{fill:{type:"palette",key:"axisGridColor"}}},label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fill:{type:"palette",key:"secondaryFontColor"}},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fill:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle"}}},Cq={transform3d:{style:{fill:"#f5f5f5"}},label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fill:"#707070"},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fill:"#707070",textBaseline:"middle"}}},Pq={outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},Eq="M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z",_C="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",Rq={pointer:{type:"path",width:.4,height:.4,style:{path:Eq}},pin:{width:.025,height:.025,style:{path:_C,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:_C,fill:"#ddd"}}},Oq={label:{visible:!1,position:"top",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},Iq={bandWidth:30,progress:{style:{fillOpacity:1}},track:{style:{fill:"#E7EBED",fillOpacity:1}}},Lq={arrow:{style:{size:10}}},Bq={defaultFillColor:"#f3f3f3",area:{style:{lineWidth:.5,strokeOpacity:1,stroke:"black",fillOpacity:1}},label:{interactive:!1,style:{fontSize:xt.l6FontSize,lineHeight:xt.l6LineHeight,textBaseline:"middle",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},stroke:{type:"palette",key:"backgroundColor"}}}},Dq={outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,position:"outside",style:{fontWeight:"normal",stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1}},innerLabel:{style:{lineWidth:2}}},Fq={outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,position:"outside"}},jq={label:{visible:!1,offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},zq={point:{style:{size:8,symbolType:"circle",lineWidth:0,fillOpacity:.8}},label:{visible:!1,offset:5,position:"top",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},Hq={seriesFieldName:{total:"total",increase:"increase",decrease:"decrease"},leaderLine:{style:{stroke:"black",lineWidth:1,lineDash:[4,4]}},stackLabel:{visible:!0,offset:12,position:"withChange",style:{fill:"black",fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight}},label:{visible:!1,offset:12,position:"inside"}},Nq={word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},Gq={word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},Wq={gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight}},nonLeafLabel:{padding:2*xt.l5FontSize,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,textBaseline:"middle",textAlign:"center"}}},Vq={innerRadius:0,outerRadius:1,startAngle:Jd,endAngle:fg,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight}}},Uq={label:{visible:!1,offset:5,position:"inside",style:{fill:{type:"palette",key:"axisMarkerFontColor"}},minLabel:{position:"end"},maxLabel:{position:"start"}}},$q={layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight}}},Yq={cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}},Xq={link:{style:{fillOpacity:.15,round:!0}}},Kq={rose:{style:{fillOpacity:1}},label:{style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"},textAlign:"center",textBaseline:"middle"}}},qq={boxPlot:{style:{lineWidth:1}}},Zq={centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}},Jq={scatter:zq,line:Oq,area:Sq,bar:Aq,bar3d:kq,pie:Dq,pie3d:Fq,map:Bq,radar:jq,dot:Tq,link:Lq,wordCloud:Nq,wordCloud3d:Gq,funnel:Mq,funnel3d:Cq,linearProgress:Iq,circularProgress:wq,waterfall:Hq,gauge:Pq,gaugePointer:Rq,treemap:Wq,sunburst:Vq,rangeColumn:Uq,circlePacking:$q,heatmap:Yq,sankey:Xq,rose:Kq,boxPlot:qq,correlation:Zq},Qq={text:{style:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fontWeight:"normal",fillOpacity:1}}},tZ={label:{style:{fontSize:xt.l4FontSize,fontWeight:"normal",fillOpacity:1}},area:{style:{fillOpacity:xt.areaOpacity}},line:{style:{lineWidth:2,lineCap:"round",lineJoin:"round"}},point:{style:{size:8,stroke:{type:"palette",key:"backgroundColor"},lineWidth:1,fillOpacity:1}},word:{style:{fontSize:null}},fillingWord:{style:{fontSize:null}},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},circlePacking:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},funnel3d:{style:{stroke:!1}},barBackground:{visible:!1,style:{fill:{type:"palette",key:"primaryFontColor",a:.06}}}},eZ={domainLine:{visible:!0},grid:{visible:!1},subGrid:{visible:!1},tick:{visible:!0},subTick:{visible:!1}},lB={label:{space:8},title:{space:8},maxHeight:"30%",unit:{visible:!1,style:{fontSize:xt.l5FontSize,fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},iZ={label:{space:12,autoLimit:!0},title:{space:12,autoRotate:!0},maxWidth:"30%",unit:{visible:!1,style:{fontSize:xt.l5FontSize,fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},sZ=Object.assign(Object.assign({},lB),{label:{space:0}}),nZ={domainLine:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,inside:!1,tickSize:xt.axisTickSize,alignWithLabel:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},subTick:{visible:!1,tickSize:xt.axisTickSize/2,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},label:{visible:!0,inside:!1,space:10,style:{fontSize:xt.l5FontSize,fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}},title:{space:10,padding:0,style:{fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,fill:{type:"palette",key:"secondaryFontColor"},fontWeight:"normal",fillOpacity:1}}},rZ={domainLine:{visible:!1},grid:{visible:!0},subGrid:{visible:!1},tick:{visible:!1},subTick:{visible:!1}},aZ={grid:{smooth:!0,visible:!0},subGrid:{smooth:!0,visible:!1}},oZ={grid:{visible:!0,style:{lineDash:[6,6]}},label:{space:5}},lZ={style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0},mC=()=>({visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:xt.l5FontSize},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}),hZ={trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineDash:[]}},label:mC()},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineDash:[2,3]}},label:mC()}},vC=`M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3
|
||
C-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6
|
||
C-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6
|
||
C0.3-1.4,0.3-1.4,0.3-1.4z;`,dZ={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:{area:{style:{visible:!1,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:!1,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}},startHandler:{style:{symbolType:vC,fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:vC,fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:{area:{style:{stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}},uZ={title:{visible:!0,autoLimit:!1,autoFit:!1,style:{fontSize:xt.l1FontSize,fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{visible:!0,style:{fontSize:xt.l2FontSize,fill:{type:"palette",key:"tertiaryFontColor"},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}},g_={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},yC={style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}},cZ={horizontal:Object.assign(Object.assign({},g_),{rail:{width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}},handler:yC}),vertical:Object.assign(Object.assign({},g_),{rail:{width:8,height:200,style:{fill:{type:"palette",key:"sliderRailColor"}}},handler:yC})},pZ={orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:xt.l5FontSize,lineHeight:xt.l5LineHeight,opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1},bC={style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}},gZ={horizontal:Object.assign(Object.assign({},g_),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:{width:200,height:4,style:{fill:{type:"palette",key:"sliderRailColor"}}},handler:bC}),vertical:Object.assign(Object.assign({},g_),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:{width:4,height:200,style:{fill:{type:"palette",key:"sliderRailColor"}}},handler:bC})},fZ={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:xt.l6FontSize}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:xt.l6FontSize}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"red"}}},_Z={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:xt.l4FontSize,fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},mZ={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:{visible:!1,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{visible:!0,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},label:{refY:5,style:{fontSize:xt.l4FontSize,fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},vZ={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}},yZ={visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:0,style:{size:25,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:0,style:{size:25,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"end",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},bZ={padding:{top:4,bottom:20},textStyle:{fontSize:xt.l3FontSize,lineHeight:xt.l3LineHeight,fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fill:{type:"palette",key:"tertiaryFontColor"}}},xZ={offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textAlign:"left",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fontColor:{type:"palette",key:"secondaryFontColor"},textAlign:"left",textBaseline:"middle",spacing:26},valueLabel:{fontSize:xt.l4FontSize,lineHeight:xt.l4LineHeight,fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},SZ={visible:!0,position:"auto",padding:8,titleStyle:{fontSize:xt.l5FontSize,fontWeight:"bold",fill:{type:"palette",key:"primaryFontColor"}},contentStyle:{fontSize:xt.l5FontSize,fill:{type:"palette",key:"primaryFontColor"}},panel:{visible:!0,fill:{type:"palette",key:"popupBackgroundColor"},cornerRadius:3,lineWidth:0,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"},size:0,space:12}},AZ={visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:xt.l4FontSize,fill:{type:"palette",key:"primaryFontColor"}}},kZ={horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}},wZ={discreteLegend:pZ,colorLegend:cZ,sizeLegend:gZ,axis:nZ,axisBand:eZ,axisLinear:rZ,axisX:lB,axisY:iZ,axisZ:sZ,axisAngle:oZ,axisRadius:aZ,markLine:mZ,markArea:_Z,markPoint:vZ,tooltip:xZ,dataZoom:dZ,crosshair:hZ,player:yZ,brush:lZ,indicator:uZ,title:bZ,mapLabel:fZ,poptip:SZ,totalLabel:AZ,scrollBar:kZ},_x={name:"light",background:{type:"palette",key:"backgroundColor"},padding:20,fontFamily:xt.defaultFontFamily,colorScheme:xq,mark:Qq,markByName:tZ,series:Jq,component:wZ,animationThreshold:2e3},TZ={default:{dataScheme:oB,palette:{backgroundColor:"#202226",borderColor:"#404349",shadowColor:"rgba(0,0,0,0.1)",hoverBackgroundColor:"#404349",sliderRailColor:"#404349",sliderHandleColor:"#202226",sliderTrackColor:"#4284FF",popupBackgroundColor:"#404349",primaryFontColor:"#fdfdfd",secondaryFontColor:"#bbbdc3",tertiaryFontColor:"#888c93",axisLabelFontColor:"#888c93",disableFontColor:"#55595f",axisMarkerFontColor:"#202226",axisGridColor:"#404349",axisDomainColor:"#4b4f54",dataZoomHandleStrokeColor:"#bbbdc3",dataZoomChartColor:"#55595F",playerControllerColor:"#4284FF",scrollBarSliderColor:"rgba(255,255,255,0.3)",axisMarkerBackgroundColor:"#fdfdfd",markLabelBackgroundColor:"#404349",markLineStrokeColor:"#bbbdc3",dangerColor:"#eb4b4b",warningColor:"#f0bd30",successColor:"#14b267",infoColor:"#4284ff"}}},xC={name:"dark",colorScheme:TZ,component:{dataZoom:{selectedBackground:{style:{fillOpacity:.4,outerBorder:{strokeOpacity:.4}}}}}};function hB(s,t,e=!1){if(t){if(s===t)return;if(E(t)&&typeof t=="object"){const i=Object(t),n=[];for(const o in i)n.push(o);let{length:r}=n,a=-1;for(;r--;){const o=n[++a];E(i[o])&&typeof i[o]=="object"&&!$(s[o])?MZ(s,t,o,e):dB(s,o,i[o])}}}}function MZ(s,t,e,i=!1){const n=s[e],r=t[e];let a=t[e],o=!0;if($(r)){if(i)a=[];else if($(n))a=n;else if(J_(n)){a=new Array(n.length);let l=-1;const h=n.length;for(;++l<h;)a[l]=n[l]}}else Rn(r)?(a=n??{},typeof n!="function"&&typeof n=="object"||(a={})):o=!1;o&&hB(a,r,i),dB(s,e,a)}function dB(s,t,e){(e!==void 0&&!CZ(s[t],e)||e===void 0&&!(t in s))&&(s[t]=e)}function CZ(s,t){return s===t||Number.isNaN(s)&&Number.isNaN(t)}function yt(s,...t){let e=-1;const i=t.length;for(;++e<i;)hB(s,t[e],!0);return s}function SC(s,t,e,i){Object.keys(s).forEach(n=>{if($t(t))t.type===n&&($(s[n])?s[n].length>=t.index&&(s[n][t.index]=i?yt({},s[n][t.index],e):e):s[n]=i?yt({},s[n],e):e);else if($(s[n])){const r=s[n].findIndex(a=>a.id===t);r>=0&&(s[n][r]=i?yt({},s[n][r],e):e)}else s.id===t&&(s[n]=i?yt({},s[n],e):e)})}function mx(s,...t){return yt(AC(s),...t.map(AC))}function AC(s){if(!s)return s;const t=PZ(s.colorScheme),{series:e}=s,{mark:i,markByName:n}=s;let r;return(i||n)&&(r=Object.keys(c_).reduce((a,o)=>{var l;const h=(l=e==null?void 0:e[o])!==null&&l!==void 0?l:{};return a[o]=vx(h,o,i,n),a},{})),Object.assign({},s,{colorScheme:t,series:Object.assign({},s.series,r)})}function PZ(s){return s&&(s=Object.keys(s).reduce((t,e)=>{const i=s[e];return t[e]=gq(i),t},{})),s}function vx(s,t,e,i){if(!c_[t])return s;const n={};return Object.values(c_[t]).forEach(({type:r,name:a})=>{n[a]=yt({},e==null?void 0:e[Y(r)[0]],i==null?void 0:i[a],s==null?void 0:s[a])}),Object.assign(Object.assign({},s),n)}const EZ=["animationThreshold","colorScheme","fontFamily","name","padding"];function Xm(s,t,e){if(!s)return s;const i={};return Object.keys(s).forEach(n=>{const r=s[n];EZ.includes(n)?i[n]=r:Rn(r)?p_(r)?i[n]=pq(r,t,e):i[n]=Xm(r,t,e):i[n]=r}),i}const fh={[_x.name]:_x},zc=_x.name,Bh=new Map(Object.keys(fh).map(s=>[s,fh[s]])),sA=new Map(Object.keys(fh).map(s=>[s,Xm(fh[s],fh[s].colorScheme)])),f_=new Map(Object.keys(fh).map(s=>[s,s===zc])),nA=(s,t)=>{if(!s)return;const e=IZ(t);Bh.set(s,e),sA.set(s,Xm(e,e.colorScheme)),f_.set(s,!0)},uB=(s=zc,t=!1)=>(f_.has(s)&&!f_.get(s)&&nA(s,Bh.get(s)),t?sA.get(s):Bh.get(s)),RZ=s=>Bh.delete(s)&&sA.delete(s)&&f_.delete(s),OZ=s=>!!ht(s)&&Bh.has(s),IZ=s=>{var t;const e=(t=s.type)!==null&&t!==void 0?t:zc,i=uB(e);return mx({},i,s)};class tn{static registerInstance(t){tn.instances.set(t.id,t)}static unregisterInstance(t){tn.instances.delete(t.id)}static getInstance(t){return tn.instances.get(t)}static instanceExist(t){return tn.instances.has(t)}static forEach(t,e=[],i){const n=Y(e);return tn.instances.forEach((r,a,o)=>{n.includes(a)||t(r,a,o)},i)}}tn.instances=new Map;class us{static registerTheme(t,e){nA(t,e)}static getTheme(t,e=!1){return uB(t,e)}static removeTheme(t){return RZ(t)}static themeExist(t){return OZ(t)}static getDefaultTheme(){return us.themes.get(zc)}static setCurrentTheme(t){us.themeExist(t)&&(us._currentThemeName=t,tn.forEach(e=>e==null?void 0:e.setCurrentTheme(t)))}static getCurrentTheme(){return us.getTheme(us._currentThemeName)}static getCurrentThemeName(){return us._currentThemeName}}us.themes=Bh,us._currentThemeName=zc;function ta(s,t){return ht(s)?us.themeExist(s)?us.getTheme(s,t):{}:$t(s)?s:{}}function yx(s,t={data:e=>e}){if(!s)return s;if(s.constructor===Object){const e={};for(const i in s)if(Object.prototype.hasOwnProperty.call(s,i)){if(t[i]){e[i]=t[i](s[i]);continue}e[i]=yx(s[i],t)}return e}return $(s)?s.map(e=>yx(e,t)):s}function bx(s,t){if(!s)return s;if(Rn(s)){const e={};for(const i in s)if(Object.prototype.hasOwnProperty.call(s,i)){if(ht(s[i])&&t.getFunction(s[i])){e[i]=t.getFunction(s[i]);continue}e[i]=bx(s[i],t)}return e}return $(s)?s.map(e=>bx(e,t)):s}const LZ=(s,t,e)=>PS(s,t,e,{fontFamily:xt.defaultFontFamily,fontSize:xt.defaultFontSize}),BZ=(s,t,e,i)=>LZ(t,e,i).measure(s);function _h(s,t){for(let e=0;e<t.length;e++){const i=t[e],n=DZ(s,i.key);n?n.operations=[...new Set(n.operations.concat(i.operations))]:s.push(i)}return s}function DZ(s,t){return s.find(e=>e.key===t)}function __(s,t){var e;if(!s)return t??null;const i=s.getFields();return i&&i[t]?(e=i[t].alias)!==null&&e!==void 0?e:t:t??null}function cB(s,t,e){const i={};return s.getSeries().forEach(n=>{var r;const a=n.getStackData(),o=n.getStackValue(),l=n.getStackValueField(),h=!e||e(n);a&&l&&h&&(i[o]=(r=i[o])!==null&&r!==void 0?r:{nodes:{}},fB(n,a,i[o],l,t))}),i}function pB(s,t){if("values"in s&&s.values.length){const e=ZO(s.values,t),i=RS(s.values,$a);s.values.forEach(r=>{r[RL]=e,r[rq]=i,delete r[ux]});const n=s.values.reduce((r,a)=>a[ui]>r[ui]?a:r);n[ux]=!0}else for(const e in s.nodes)pB(s.nodes[e],t)}function FZ(s){if(!s.values.length)return;const t=s.values[s.values.length-1][ui]/2;for(let e=0;e<s.values.length;e++)s.values[e][hx]=s.values[e][ln]-t,s.values[e][dx]=s.values[e][ui]-t}function gB(s,t,e){if(s.values.length>0){let i=0,n=0,r=1,a=0;const o=s.values.length;for(let l=0;l<o;l++){const h=s.values[t?o-1-l:l];a=h[ui],a>=0?(h[ln]=i,i+=h[ui],h[ui]=i):(h[ln]=n,n+=h[ui],h[ui]=n)}if(e)for(let l=0;l<o;l++){const h=s.values[t?o-1-l:l];a=h[ui];const d=a>=0?i:n;r=a>=0?1:-1,h[$u]=d===0?0:Math.min(1,h[ln]/d)*r,h[$a]=d===0?0:Math.min(1,h[ui]/d)*r}}for(const i in s.nodes)gB(s.nodes[i],t,e)}function fB(s,t,e,i,n){if("values"in t)return n&&t.values.forEach(r=>r[ui]=gU(r[i])),e.values.push(...t.values),void e.series.push({s,values:t.values});for(const r in t.nodes)!e.nodes[r]&&(e.nodes[r]={values:[],series:[],nodes:{}}),fB(s,t.nodes[r],e.nodes[r],i,n)}const _B=(s,t,e="key",i="children")=>{for(let n=0;n<s.length;n++){const r=s[n];if(r[e]===t)return r;if(r[i]){const a=_B(r[i],t,e,i);if(a)return a}}return null},mB=(s,t,e="key",i="children")=>{for(let n=0;n<s.length;n++){const r=s[n];if(r[i])for(let a=0;a<r[i].length;a++){const o=r[i][a];if(o[e]===t)return r;const l=mB([o],t,e,i);if(l)return l}}return null},jZ=(s,t,e="key",i="children")=>{const n=[],r=(a,o)=>{for(const l of a){if(l[e]===t)return n.push(...o,l[e].toString()),!0;if(l[i]){const h=r(l[i],[...o,l[e]]);if(h===!0)return h}}return!1};return r(s,[]),n};function Mn(s={}){const t=Object.assign({},s);if(K(s.style)?t.style=(e,i,n,r)=>wt(s.style(e,i,n,r)):vt(s.style)||(t.style=wt(s.style)),!vt(s.state)){const e={};Object.keys(s.state).forEach(i=>{K(s.state[i])?e[i]=(n,r,a,o)=>wt(s.state[i](n,r,a,o)):vt(s.state[i])||(e[i]=wt(s.state[i]))}),t.state=e}return t}function il(s){if(vt(s))return null;const t={};return Object.keys(s).forEach(e=>{K(s[e])?t[e]=(i,n,r,a)=>wt(s[e](i,n,r,a)):vt(s[e])||(t[e]=wt(s[e]))}),t}function zZ(s){if(vt(s))return null;const t={};return Object.keys(s).forEach(e=>{K(s[e])?t[e]=(i,n,r,a)=>wt(s[e](i.rawValue,n,i,r,a)):vt(s[e])||(t[e]=wt(s[e]))}),t}function wt(s){return s!=null&&s.angle&&(s.angle=ue(s.angle)),s}class F{static registerChart(t,e){F._charts[t]=e}static registerSeries(t,e){F._series[t]=e}static registerComponent(t,e,i){F._components[t]={cmp:e,alwaysCheck:i}}static registerMark(t,e){F._marks[t]=e}static registerRegion(t,e){F._regions[t]=e}static registerTransform(t,e){F.transforms[t]=e}static registerLayout(t,e){F._layout[t]=e}static registerAnimation(t,e){F._animations[t]=e}static registerImplement(t,e){F._implements[t]=e}static registerChartPlugin(t,e){F._chartPlugin[t]=e}static createChart(t,e,i){return F._charts[t]?new F._charts[t](e,i):null}static createChartSpecTransformer(t,e){if(!F._charts[t])return null;const i=F._charts[t];return new i.transformerConstructor(Object.assign({seriesType:i.seriesType},e))}static createRegion(t,e,i){return F._regions[t]?new F._regions[t](e,i):null}static createRegionSpecTransformer(t,e){return F._regions[t]?new F._regions[t].transformerConstructor(e):null}static createSeries(t,e,i){return F._series[t]?new F._series[t](e,i):null}static createSeriesSpecTransformer(t,e){return F._series[t]?new F._series[t].transformerConstructor(e):null}static createMark(t,e,i){if(!F._marks[t])return null;const n=new F._marks[t](e,i);return n.type==="group"&&n.setInteractive(!1),n}static getComponents(){return Object.values(F._components)}static getComponentInKey(t){return F._components[t].cmp}static getLayout(){return Object.values(F._layout)}static getLayoutInKey(t){return F._layout[t]}static getSeries(){return Object.values(F._series)}static getSeriesInType(t){return F._series[t]}static getRegionInType(t){return F._regions[t]}static getAnimationInKey(t){return F._animations[t]}static getImplementInKey(t){return F._implements[t]}static getSeriesMarkMap(t){return F._series[t]?F._series[t].mark:{}}static getChartPlugins(){return Object.values(F._chartPlugin)}}F._charts={},F._series={},F._components={},F._marks={},F._regions={},F._animations={},F._implements={},F._chartPlugin={},F.transforms={simplify:sR,fields:nR,filter:Yj,fold:i3},F.dataParser={csv:oR,dsv:aR,tsv:lR},F._layout={};const HZ=(s,t,e)=>s.x>=t.x&&s.x<=e.x&&s.y>=t.y&&s.y<=e.y,NZ=(s,t,e)=>{const i=s.getRegionsInIds(Y(t.layout.layoutBindRegionID));return i==null?void 0:i.some(n=>{const r=n.getLayoutRect(),a=n.getLayoutStartPoint();return HZ(e,{x:a.x,y:a.y},{x:r.width+a.x,y:r.height+a.y})})},vB=(s,t)=>{var e,i;return s===t||!P(s)&&!P(t)&&s.value===t.value&&((e=s.axis)===null||e===void 0?void 0:e.id)===((i=t.axis)===null||i===void 0?void 0:i.id)},xx=(s,t,e,i)=>{var n;const r=t.getScale(),a=ji(r.type),o=[],l=t.getRegions();for(const h of l){const d=h.getSeries();for(const u of d)if(u.coordinate===e){const c=Y(i(u)),p=(n=u.getViewData())===null||n===void 0?void 0:n.latestData;if(c&&p)if(a)o.push({series:u,datum:p.filter(g=>{var f;return((f=g[c[0]])===null||f===void 0?void 0:f.toString())===(s==null?void 0:s.toString())})});else if(E(c[1]))o.push({series:u,datum:p.filter(g=>{var f;return((f=g[c[0]])===null||f===void 0?void 0:f.toString())===(s==null?void 0:s.toString())||E(g[c[0]])&&E(g[c[1]])&&s>=g[c[0]]&&s<g[c[1]]})});else{const g=t.getSpec().tooltipFilterRange,f=N(g)?[-g,g]:g;let _=[];if(f)p.forEach(m=>{if(E(m[c[0]])){const v=m[c[0]]-s;v>=f[0]&&v<=f[1]&&_.push(m)}});else{let m=1/0,v=0;p.forEach(y=>{if(E(y[c[0]])){const b=Math.abs(y[c[0]]-s),x=Math.sign(y[c[0]]-s);b<m?(m=b,_=[y],v=x):b===m&&x===v&&_.push(y)}})}o.push({series:u,datum:_})}}}return o},m_=(s,t,e)=>{const i=s.getAllComponents().filter(n=>n.specKey==="axes"&&t(n)&&NZ(s,n,e));return i.length?i:null},GZ=(s,t)=>{const e=2*Math.PI,i=ki(t),n=ei(t);return s<i?s+=Math.ceil((i-s)/e)*e:s>n&&(s-=Math.ceil((s-n)/e)*e),s},yB=(s,t)=>{if(!s||!OS(s.getRegionsInIndex(),"polar"))return null;const{x:e,y:i}=t,n=m_(s,l=>l.getOrient()==="angle",t),r=m_(s,l=>l.getOrient()==="radius",t),a=[],o=l=>l.getDimensionField()[0];return n&&n.forEach(l=>{var h;const d=l.getScale();if(d&&ji(d.type)){const u=d.domain(),c=d.range(),p=l.getCenter(),g={x:e-l.getLayoutStartPoint().x-p.x,y:i-l.getLayoutStartPoint().y-p.y};let f=hT({x:1,y:0},g);f=GZ(f,c);const _=Rf(g),m=(h=r[0])===null||h===void 0?void 0:h.getScale(),v=m==null?void 0:m.range();if((f-(c==null?void 0:c[0]))*(f-(c==null?void 0:c[1]))>0||(_-(v==null?void 0:v[0]))*(_-(v==null?void 0:v[1]))>0)return;const y=l.invert(f);if(P(y))return;let b=u.findIndex(S=>(S==null?void 0:S.toString())===y.toString());b<0&&(b=void 0);const x=xx(y,l,"polar",o);a.push({index:b,value:y,axis:l,data:x})}}),r&&r.forEach(l=>{var h;const d=l.getScale(),u=d==null?void 0:d.range();if(d&&ji(d.type)){const c=l.getCenter(),p={x:e-l.getLayoutStartPoint().x-c.x,y:i-l.getLayoutStartPoint().y-c.y};let g=hT({x:1,y:0},p);g<-Math.PI/2&&(g=2*Math.PI+g);const f=Rf(p),_=(h=n[0])===null||h===void 0?void 0:h.getScale(),m=_==null?void 0:_.range();if((g-(m==null?void 0:m[0]))*(g-(m==null?void 0:m[1]))>0||(f-(u==null?void 0:u[0]))*(f-(u==null?void 0:u[1]))>0)return;const v=d.invert(f);if(P(v))return;let y=d.domain().findIndex(x=>(x==null?void 0:x.toString())===v.toString());y<0&&(y=void 0);const b=xx(v,l,"polar",o);a.push({index:y,value:v,axis:l,data:b})}}),a.length?a:null};function Fe(s){return s==="bottom"||s==="top"}function Mr(s){return s==="left"||s==="right"}function ea(s){return s==="z"}function WZ(s,t){return t?Fe(s)?"linear":"band":Fe(s)?"band":"linear"}function oa(s,t){return iA(s.orient)||t&&t.includes(s.orient)?s.orient:"left"}function bB(s){return s==="top"||s==="bottom"?"horizontal":"vertical"}function VZ(s,t){let e=s.inverse;return t&&!Fe(s.orient)&&(e=!E(s.inverse)||!s.inverse),e}function kC(s,t){var e;const i=(e=s.type)!==null&&e!==void 0?e:WZ(s.orient,t);return{axisType:i,componentName:`${Z.cartesianAxis}-${i}`}}const xB=s=>s.fieldX[0],SB=s=>s.fieldY[0],UZ=s=>[s.fieldX[0],s.fieldX2],$Z=s=>[s.fieldY[0],s.fieldY2],AB=(s,t)=>{var e,i;if(!s||!OS(s.getRegionsInIndex(),"cartesian"))return null;const{x:n,y:r}=t,a=(e=m_(s,c=>Fe(c.getOrient()),t))!==null&&e!==void 0?e:[],o=(i=m_(s,c=>Mr(c.getOrient()),t))!==null&&i!==void 0?i:[],l=new Set,h=new Set;[a,o].forEach(c=>c.forEach(p=>{ji(p.getScale().type)?l.add(p):h.add(p)}));const d=[],u=(c,p)=>{(c==="x"?a:o).forEach(g=>{if((p?l:h).has(g)){const f=YZ(g,c==="x"?n:r,c,c==="x"?p?xB:UZ:p?SB:$Z);f&&d.push(f)}})};return s.getSpec().direction==="horizontal"?(u("y",l.size>0),d.length===0&&u("x",l.size>0)):(u("x",l.size>0),d.length===0&&u("y",l.size>0)),d.length?d:null},YZ=(s,t,e,i)=>{const n=s.getScale(),r=t-s.getLayoutStartPoint()[e];if((r-n.range()[0])*(r-n.range()[1])>0)return null;const a=n.invert(r);return kB(s,a,i)},kB=(s,t,e)=>{const i=s.getScale();if(P(t))return null;let n=i.domain().findIndex(a=>(a==null?void 0:a.toString())===t.toString());n<0&&(n=void 0);const r=xx(t,s,"cartesian",e??(Fe(s.getOrient())?xB:SB));return{index:n,value:t,axis:s,data:r}};class wB{constructor(t,e){this._eventDispatcher=t,this._mode=e}get chart(){var t,e;return this._chart||(this._chart=(e=(t=this._eventDispatcher.globalInstance).getChart)===null||e===void 0?void 0:e.call(t)),this._chart}register(t,e){var i,n;((n=(i=this.chart)===null||i===void 0?void 0:i.getOption().onError)!==null&&n!==void 0?n:kh)("Method not implemented.")}unregister(){var t,e;((e=(t=this.chart)===null||t===void 0?void 0:t.getOption().onError)!==null&&e!==void 0?e:kh)("Method not implemented.")}getTargetDimensionInfo(t,e){var i,n;const r=(i=AB(this.chart,{x:t,y:e}))!==null&&i!==void 0?i:[],a=(n=yB(this.chart,{x:t,y:e}))!==null&&n!==void 0?n:[],o=[].concat(r,a);return o.length===0?null:o}dispatch(t,e){var i;const n=(i=this.chart)===null||i===void 0?void 0:i.getAllComponents().filter(a=>{if(a.specKey!=="axes")return!1;const o=a.getScale();return!!ji(o.type)&&(!(e!=null&&e.filter)||e.filter(a))}),r=[];return n.forEach(a=>{const o=kB(a,t);o&&r.push(o)}),this._callback.call(null,{action:"enter",dimensionInfo:r}),r}}class XZ extends wB{constructor(){super(...arguments),this.onClick=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,n=this.getTargetDimensionInfo(e,i);n&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"click",dimensionInfo:n.slice()}))}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointertap",{query:Object.assign(Object.assign({},e.query),{source:te.chart}),callback:this.onClick})}unregister(){this._eventDispatcher.unregister("pointertap",{query:null,callback:this.onClick})}}class KZ extends wB{constructor(){super(...arguments),this._cacheDimensionInfo=null,this.onMouseMove=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,n=this.getTargetDimensionInfo(e,i);n===null&&this._cacheDimensionInfo!==null?(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo.slice()})),this._cacheDimensionInfo=n):n===null||this._cacheDimensionInfo!==null&&n.length===this._cacheDimensionInfo.length&&!n.some((r,a)=>!vB(r,this._cacheDimensionInfo[a]))?n!==null&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"move",dimensionInfo:n.slice()})):(this._callback.call(null,Object.assign(Object.assign({},t),{action:"enter",dimensionInfo:n.slice()})),this._cacheDimensionInfo=n)},this.onMouseOut=t=>{t&&(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo?this._cacheDimensionInfo.slice():[]})),this._cacheDimensionInfo=null)}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointermove",{query:Object.assign(Object.assign({},e.query),{source:te.chart}),callback:this.onMouseMove}),this._eventDispatcher.register("pointerout",{query:Object.assign(Object.assign({},e.query),{source:te.canvas}),callback:this.onMouseOut}),Ga(this._mode)&&this._eventDispatcher.register("pointerdown",{query:Object.assign(Object.assign({},e.query),{source:te.chart}),callback:this.onMouseMove})}unregister(){this._eventDispatcher.unregister("pointermove",{query:null,callback:this.onMouseMove}),Ga(this._mode)&&this._eventDispatcher.unregister("pointerdown",{query:null,callback:this.onMouseMove})}}var Nr;(function(s){s.dimensionHover="dimensionHover",s.dimensionClick="dimensionClick"})(Nr||(Nr={}));const N0={[Nr.dimensionHover]:KZ,[Nr.dimensionClick]:XZ};let Hc=class{getComposedEventMap(){return this._composedEventMap}constructor(t,e){this._composedEventMap=new Map,this._eventDispatcher=t,this._mode=e}on(t,e,i){const n=typeof e=="function"?{query:null,callback:e}:{query:e,callback:i};if(N0[t]){const r=new N0[t](this._eventDispatcher,this._mode);r.register(t,n),this._composedEventMap.set(i,{eventType:t,event:r})}else this._eventDispatcher.register(t,n);return this}off(t,e,i){var n,r;const a=i??e;if(N0[t])if(a)(n=this._composedEventMap.get(a))===null||n===void 0||n.event.unregister(),this._composedEventMap.delete(a);else for(const o of this._composedEventMap.entries())o[1].eventType===t&&((r=this._composedEventMap.get(o[0]))===null||r===void 0||r.event.unregister(),this._composedEventMap.delete(o[0]));else if(a){const o={callback:a,query:null,filter:{nodeName:null,type:t,level:null,source:e.source,markName:null,filter:null,userId:null}};this._eventDispatcher.unregister(t,o)}else this._eventDispatcher.unregister(t);return this}emit(t,e,i){return this._eventDispatcher.dispatch(t,e,i),this}release(){this._eventDispatcher.release(),this._composedEventMap.clear()}};class qZ{constructor(){this._map=new Map,this._levelNodes=new Map,this._levelNodes.set(Xt.vchart,[]),this._levelNodes.set(Xt.chart,[]),this._levelNodes.set(Xt.model,[]),this._levelNodes.set(Xt.mark,[])}addHandler(t,e){var i;const n={level:e,handler:t};return(i=this._levelNodes.get(e))===null||i===void 0||i.push(n),this._map.set(t.callback,n),this}removeHandler(t){const e=this._map.get(t.callback);if(!e)return this;this._map.delete(t.callback);const i=this._levelNodes.get(e.level),n=i==null?void 0:i.findIndex(r=>r.handler.callback===t.callback);return n!==void 0&&n>=0&&(i==null||i.splice(n,1)),this}getHandlers(t){var e;return((e=this._levelNodes.get(t))===null||e===void 0?void 0:e.map(i=>i.handler))||[]}getCount(){return this._map.size}release(){this._map.clear(),this._levelNodes.clear()}}const wC={cartesianAxis:"axis","cartesianAxis-band":"axis","cartesianAxis-linear":"axis","cartesianAxis-time":"axis",polarAxis:"axis","polarAxis-band":"axis","polarAxis-linear":"axis",discreteLegend:"legend",continuousLegend:"legend",colorLegend:"legend",sizeLegend:"legend",label:"label"};class ZZ{constructor(t,e){this._viewBubbles=new Map,this._windowBubbles=new Map,this._canvasBubbles=new Map,this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.globalInstance=t,this._compiler=e}register(t,e){var i,n,r,a;this._parseQuery(e);const o=this.getEventBubble(((i=e.filter)===null||i===void 0?void 0:i.source)||te.chart),l=this.getEventListeners(((n=e.filter)===null||n===void 0?void 0:n.source)||te.chart);if(o.get(t)||o.set(t,new qZ),o.get(t).addHandler(e,(r=e.filter)===null||r===void 0?void 0:r.level),this._isValidEvent(t)&&!l.has(t)){const h=this._onDelegate.bind(this);this._compiler.addEventListener((a=e.filter)===null||a===void 0?void 0:a.source,t,h),l.set(t,h)}return this}unregister(t,e){var i,n,r,a;let o=!1;const l=this.getEventBubble(((i=e==null?void 0:e.filter)===null||i===void 0?void 0:i.source)||te.chart),h=this.getEventListeners(((n=e==null?void 0:e.filter)===null||n===void 0?void 0:n.source)||te.chart);if(e){const d=l.get(t);d==null||d.removeHandler(e),(d==null?void 0:d.getCount())===0&&(d==null||d.release(),l.delete(t),o=!0),!((r=e==null?void 0:e.wrappedCallback)===null||r===void 0)&&r.cancel&&e.wrappedCallback.cancel()}else{const d=l.get(t);d==null||d.release(),l.delete(t),o=!0}if(o&&this._isValidEvent(t)){const d=h.get(t);this._compiler.removeEventListener(((a=e==null?void 0:e.filter)===null||a===void 0?void 0:a.source)||te.chart,t,d),h.delete(t)}return this}dispatch(t,e,i){const n=this.getEventBubble(e.source||te.chart).get(t);if(!n)return this;let r=!1;if(i){const a=n.getHandlers(i);r=this._invoke(a,t,e)}else{const a=n.getHandlers(Xt.mark);if(r=this._invoke(a,t,e),!r){const o=n.getHandlers(Xt.model);r=this._invoke(o,t,e)}if(!r){const o=n.getHandlers(Xt.chart);r=this._invoke(o,t,e)}if(!r){const o=n.getHandlers(Xt.vchart);r=this._invoke(o,t,e)}}return this}release(){for(const t of this._viewListeners.entries())this._compiler.removeEventListener(te.chart,t[0],t[1]);this._viewListeners.clear();for(const t of this._windowListeners.entries())this._compiler.removeEventListener(te.window,t[0],t[1]);this._windowListeners.clear();for(const t of this._canvasListeners.entries())this._compiler.removeEventListener(te.canvas,t[0],t[1]);this._canvasListeners.clear();for(const t of this._viewBubbles.values())t.release();this._viewBubbles.clear();for(const t of this._windowBubbles.values())t.release();this._windowBubbles.clear();for(const t of this._canvasBubbles.values())t.release();this._canvasBubbles.clear()}_filter(t,e,i){var n,r,a;if(K(t.filter)&&!t.filter(i)||t.nodeName&&It(i,"node.name")!==t.nodeName||t.markName&&((n=i==null?void 0:i.mark)===null||n===void 0?void 0:n.name)!==t.markName)return!1;let o=(r=i.model)===null||r===void 0?void 0:r.type;return wC[o]&&(o=wC[o]),(!t.type||o===t.type)&&!(t.level==="mark"&&!t.type&&!(i!=null&&i.mark))&&!(t.level==="model"&&!t.type&&!(i!=null&&i.model))&&(!E(t.userId)||((a=i.model)===null||a===void 0?void 0:a.userId)===t.userId)}_prepareParams(t,e){if(t.markName&&e.mark&&e.itemMap){const i=e.mark.getProductId(),n=e.itemMap.get(i),r=n==null?void 0:n.getDatum();return Object.assign(Object.assign({},e),{item:n,datum:r})}return Object.assign({},e)}_onDelegate(t){var e;const i=this.globalInstance.getChart(),n=E(t.modelId)&&(i==null?void 0:i.getModelById(t.modelId))||void 0,r=E(t.markId)&&(i==null?void 0:i.getMarkById(t.markId))||null,a=new Map;let o=(e=t.item)===null||e===void 0?void 0:e.mark;for(o&&E(o.id())&&a.set(o.id(),t.item);o!=null&&o.elements;){const h=o.id();E(h)&&!a.has(h)&&a.set(h,o.elements[0]),o=o.group}const l={event:t.event,item:t.item,datum:t.datum,source:t.source,itemMap:a,chart:i,model:n,mark:r??void 0,node:It(t.event,"target")};this.dispatch(t.type,l)}_invoke(t,e,i){return t.map(n=>{var r,a,o;const l=n.filter;if(!n.query||this._filter(l,e,i)){const h=(n.wrappedCallback||n.callback).call(null,this._prepareParams(l,i)),d=h??((r=n.query)===null||r===void 0?void 0:r.consume);return d&&((a=i.event)===null||a===void 0||a.stopPropagation(),(o=i.event)===null||o===void 0||o.preventDefault()),!!d}}).some(n=>n===!0)}_getQueryLevel(t){return t?t.level?t.level:E(t.id)?Xt.model:Xt.vchart:Xt.vchart}_parseQuery(t){var e;const i=t.query;i!=null&&i.throttle?t.wrappedCallback=Ka(t.callback,i.throttle):i!=null&&i.debounce&&(t.wrappedCallback=lr(t.callback,i.debounce));let n=this._getQueryLevel(i),r=null,a=te.chart,o=null,l=null,h=null;return i!=null&&i.nodeName&&(o=i.nodeName),i!=null&&i.markName&&(l=i.markName),!(i!=null&&i.type)||n!==Xt.model&&n!==Xt.mark||(r=i.type),i!=null&&i.source&&(a=i.source),E(i==null?void 0:i.id)&&(h=i==null?void 0:i.id,n=Xt.model),t.filter={level:n,markName:l,type:r,source:a,nodeName:o,userId:h,filter:(e=i==null?void 0:i.filter)!==null&&e!==void 0?e:null},t}getEventBubble(t){switch(t){case te.chart:return this._viewBubbles;case te.window:return this._windowBubbles;case te.canvas:return this._canvasBubbles;default:return this._viewBubbles}}getEventListeners(t){switch(t){case te.chart:return this._viewListeners;case te.window:return this._windowListeners;case te.canvas:return this._canvasListeners;default:return this._viewListeners}}_isValidEvent(t){return nq.includes(t)||Object.values(gt).includes(t)||Object.values(St).includes(t)}}function Ct(s,t,e){s.getTransform(t)||s.registerTransform(t,e)}function Lr(s,t,e){s.getParser(t)||s.registerParser(t,e)}const Oo=new Map;let ul;function JZ(){ul||(ul=new ko,Lr(ul,"geojson",pR),Lr(ul,"topojson",y3),Ct(ul,"simplify",sR))}function QZ(s,t,e={type:"geojson",centroid:!0}){Oo.has(s)&&Na(`map type of '${s}' already exists, will be overwritten.`),JZ();const i=new Jt(ul),n=lt({},{centroid:!0,simplify:!1},e);e.type==="topojson"?i.parse(t,{type:"topojson",options:n}):i.parse(t,{type:"geojson",options:n}),e.simplify===!0&&i.transform({type:"simplify"}),Oo.set(s,i)}function tJ(s){Oo.has(s)?Oo.delete(s):Na(`map type of '${s}' does not exists.`)}function eJ(s){return Oo.get(s)}function TC(s,t=!1){let e=t;return s.latestData instanceof Jt&&(e=!1),e?bi(s.latestData):s.latestData.slice()}const Km=(s,t)=>s.length===0?[]:s.length===1?TC(s[0],t==null?void 0:t.deep):s.map(e=>TC(e,t==null?void 0:t.deep));function Sx(s,t,e){t=t instanceof ko?t:s.dataSet,Ct(t,"copyDataView",Km);const i=new Jt(t,e);return i.parse([s],{type:"dataview"}),i.transform({type:"copyDataView",level:Hs.copyDataView}),i}function v_(s,t,e=[],i={}){var n,r,a;if(s instanceof Jt)return s;const{id:o,values:l=[],fromDataIndex:h,fromDataId:d,transforms:u=[]}=s,c=s.parser?bi(s.parser):{clone:!0},p=bi(s.fields);let g;c.clone=c.clone!==!1;const f=e.find(_=>_.name===o);if(f)g=f;else{const _={name:o};if(p&&(_.fields=p),g=new Jt(t,_),typeof d=="string"){const m=e.find(v=>v.name===d);if(!m)return((n=i.onError)!==null&&n!==void 0?n:kh)(`no data matches fromDataId ${d}`),null;g.parse([m],{type:"dataview"}),g.transform({type:"copyDataView"})}else if(typeof h=="number"){const m=e[h];if(!m)return((r=i.onError)!==null&&r!==void 0?r:kh)(`no data matches fromDataIndex ${h}`),null;g.parse([m],{type:"dataview"}),g.transform({type:"copyDataView"})}else Array.isArray(l)?g.parse(l,c):!ht(l)||c&&!["csv","dsv","tsv"].includes(c.type)?(g.parse([]),Na("values should be array")):g.parse(l,(a=c)!==null&&a!==void 0?a:{type:"csv"});u&&u.length&&u.forEach(m=>{t.getTransform(m.type)&&g.transform(m)})}return g}function rA(s,t,e){s&&(t.fields&&s.setFields(t.fields,e),s.parseNewData(t.values,t.parser))}var Hs;(function(s){s[s.copyDataView=-10]="copyDataView",s[s.treemapFilter=-8]="treemapFilter",s[s.treemapFlatten=-7]="treemapFlatten",s[s.dotObjFlat=-7]="dotObjFlat",s[s.linkDotInfo=-7]="linkDotInfo",s[s.sankeyLayout=-7]="sankeyLayout",s[s.dataZoomFilter=-6]="dataZoomFilter",s[s.legendFilter=-5]="legendFilter"})(Hs||(Hs={}));const iJ=(s,t)=>{const e={nodes:{}},{fields:i}=t;if(!(i!=null&&i.length))return e;const n=i.length-1;let r,a,o=e;return s.forEach(l=>{l.latestData.forEach(h=>{o=e;for(let d=0;d<i.length;d++){const u=h[i[d]];if(P(u))break;o.nodes[u]||(d===n?o.nodes[u]={values:[]}:(r={nodes:{}},o.nodes[u]=r)),d===n?(a=o.nodes[u],a.values.push(h)):o=o.nodes[u]}})}),e};var ci;(function(s){s.appear="appear",s.disappear="disappear",s.enter="enter",s.update="update",s.state="state",s.exit="exit",s.normal="normal",s.none="none"})(ci||(ci={}));var Pa;(function(s){s.data="data",s.signal="signal",s.mark="mark"})(Pa||(Pa={}));function sJ(s){switch(s){case ri["desktop-browser"]:case ri["mobile-browser"]:return"browser";case ri.node:case ri.worker:return"node";case ri.miniApp:case ri["desktop-miniApp"]:return"feishu";case ri.lynx:return"lynx";case ri.wx:return"wx"}return"browser"}var nJ=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};class rJ{getVGrammarView(){return this._view}getModel(){return this._model}constructor(t,e){this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.isInited=!1,this.isReleased=!1,this._model={[Pa.signal]:{},[Pa.data]:{},[Pa.mark]:{}},this._compileChart=null,this._container=t,this._option=e}getRenderer(){var t;return(t=this._view)===null||t===void 0?void 0:t.renderer}getCanvas(){var t;return(t=this._view)===null||t===void 0?void 0:t.renderer.canvas()}getStage(){var t;return(t=this._view)===null||t===void 0?void 0:t.renderer.stage()}initView(){var t,e,i,n;if(this.isReleased||(this.isInited=!0,this._view))return;const r=new Nt((t=this._option.logLevel)!==null&&t!==void 0?t:Os.Error);!((e=this._option)===null||e===void 0)&&e.onError&&r.addErrorHandler((...a)=>{var o,l;(l=(o=this._option)===null||o===void 0?void 0:o.onError)===null||l===void 0||l.call(o,...a)}),this._view=new Vo(Object.assign(Object.assign({width:this._width,height:this._height,container:(i=this._container.dom)!==null&&i!==void 0?i:null,renderCanvas:(n=this._container.canvas)!==null&&n!==void 0?n:null,hooks:this._option.performanceHook},this._option),{mode:sJ(this._option.mode),autoFit:!1,eventConfig:{gesture:Ga(this._option.mode),disable:this._option.interactive===!1},doLayout:()=>{var a;(a=this._compileChart)===null||a===void 0||a.onLayout(this._view)},logger:r,logLevel:r.level()})),this._setCanvasStyle(),this.getStage().hooks.afterRender.tap("chart-event",()=>{var a,o;(o=(a=this._compileChart)===null||a===void 0?void 0:a.getEvent())===null||o===void 0||o.emit(St.afterRender,{chart:this._compileChart})}),this._option.interactive!==!1&&this._viewListeners.forEach(a=>{var o;(o=this._view)===null||o===void 0||o.addEventListener(a.type,a.callback)})}_setCanvasStyle(){if(this._view&&this._container.dom&&!ht(this._container.dom)){this._container.dom.style.display="block",this._container.dom.style.position="relative";const t=this.getCanvas();t&&(t.style.display="block")}}compile(t,e){const{chart:i}=t;this._compileChart=i,this.initView(),this._view&&(i.compile(),i.afterCompile(),this.updateDepend())}clear(t,e=!1){const{chart:i}=t;i.clear(),this.releaseGrammar(e)}renderAsync(t){var e;return nJ(this,void 0,void 0,function*(){if(!this.isReleased)return this.initView(),this._view?(yield(e=this._view)===null||e===void 0?void 0:e.runNextTick(t),this):Promise.reject("srView init fail")})}renderSync(t){var e;this.initView(),this._view&&((e=this._view)===null||e===void 0||e.runSync(t))}updateViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}resize(t,e,i=!0){return this._view?(this._width=t,this._height=e,this._view.resize(t,e),i?this.renderAsync({morph:!1}):this):Promise.reject()}setBackground(t){var e;(e=this._view)===null||e===void 0||e.background(t)}setSize(t,e){this._width=t,this._height=e,this._view&&(this._view.width(t),this._view.height(e))}setViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}addEventListener(t,e,i){var n,r;if(this._option.interactive!==!1){if(t===te.chart){const a=(function(o,l){var h,d,u;const c=(d=(h=l==null?void 0:l.mark)===null||h===void 0?void 0:h.getContext())!==null&&d!==void 0?d:{},p=E(c.modelId)?c.modelId:null,g=E(c.markId)?c.markId:null,f=E(c.modelUserId)?c.modelUserId:null,_=E(c.markUserId)?c.markUserId:null,m={event:o,type:e,source:t,item:l,datum:((u=l==null?void 0:l.getDatum)===null||u===void 0?void 0:u.call(l))||null,markId:g,modelId:p,markUserId:_,modelUserId:f};i.call(null,m)}).bind(this);this._viewListeners.set(i,{type:e,callback:a}),(n=this._view)===null||n===void 0||n.addEventListener(e,a)}else if(t===te.window){const a=(function(l){const h={event:l,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,h)}).bind(this);this._windowListeners.set(i,{type:e,callback:a});const o=this._getGlobalThis();o==null||o.addEventListener(e,a)}else if(t===te.canvas){const a=(function(l){const h={event:l,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,h)}).bind(this);this._canvasListeners.set(i,{type:e,callback:a});const o=(r=this.getStage())===null||r===void 0?void 0:r.window;o==null||o.addEventListener(e,a)}}}removeEventListener(t,e,i){var n,r,a,o;if(this._option.interactive!==!1){if(t===te.chart){const l=(n=this._viewListeners.get(i))===null||n===void 0?void 0:n.callback;l&&((r=this._view)===null||r===void 0||r.removeEventListener(e,l)),this._viewListeners.delete(i)}else if(t===te.window){const l=this._getGlobalThis(),h=(a=this._windowListeners.get(i))===null||a===void 0?void 0:a.callback;h&&(l==null||l.removeEventListener(e,h)),this._windowListeners.delete(i)}else if(t===te.canvas){const l=this._getGlobalThis(),h=(o=this._canvasListeners.get(i))===null||o===void 0?void 0:o.callback;h&&(l==null||l.removeEventListener(e,h)),this._canvasListeners.delete(i)}}}releaseEvent(){this._viewListeners.clear(),this._windowListeners.clear(),this._canvasListeners.clear()}release(){var t;this.releaseEvent(),this._option=this._container=null,this._releaseModel(),(t=this._view)===null||t===void 0||t.release(),this._view=null,this.isInited=!1,this.isReleased=!0}releaseGrammar(t=!1){var e,i;this._releaseModel(),t&&((e=this._view)===null||e===void 0||e.removeAllGraphicItems()),(i=this._view)===null||i===void 0||i.removeAllGrammars()}_releaseModel(){Object.keys(this._model).forEach(t=>{Object.values(this._model[t]).forEach(e=>{Object.values(e).forEach(i=>{i.removeProduct(!0)})}),this._model[t]={}})}addGrammarItem(t){const e=t.getProduct();if(P(e))return;const i=e.id(),n=t.grammarType;P(this._model[n][i])&&(this._model[n][i]={}),this._model[n][i][t.id]=t}removeGrammarItem(t,e){var i;const n=t.getProduct();if(P(n))return;const r=n.id(),a=t.grammarType,o=this._model[a][r];E(o)&&(delete o[t.id],Object.keys(o).length===0&&delete this._model[a][r]),e||(i=this._view)===null||i===void 0||i.removeGrammar(n)}updateDepend(t){return E(t)&&t.length>0?t.every(e=>e.updateDepend()):(Object.values(this._model).forEach(e=>{Object.values(e).forEach(i=>{const n=Object.values(i),r=n[0].getProduct(),a=n.reduce((o,l)=>l.getDepend().length>0?o.concat(l.getDepend()):o,[]).filter(o=>!!o).map(o=>o.getProduct());r.depend(a)})}),!0)}_getGlobalThis(){var t;return rn(this._option.mode)?globalThis:(t=this.getStage())===null||t===void 0?void 0:t.window}}var aJ=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};function oJ(s="vchart",t){const e=document.createElement("a");e.setAttribute("href",t),e.setAttribute("target","_blank"),e.setAttribute("download",`${s}.png`),e.dispatchEvent(new MouseEvent("click"))}function lJ(s){return new Promise(t=>{s.convertToBlob().then(e=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>{t(i.result)}})})}function hJ(s,t){var e;return aJ(this,void 0,void 0,function*(){if(!s)return"";try{if(OffscreenCanvas!==void 0&&s instanceof OffscreenCanvas)return lJ(s)}catch(i){((e=t==null?void 0:t.onError)!==null&&e!==void 0?e:kh)(`getCanvasDataURL error : ${i.toString()}`)}return s.toDataURL()})}function Qa(s){s.crosshair=Y(s.crosshair||{}).map(t=>yt({[s.direction==="horizontal"?"yField":"xField"]:{visible:!0,line:{visible:!0,type:"rect"}}},t))}function TB(s,t,e){var i;const{width:n,height:r}=s;if(E(n)&&E(r))return{width:n,height:r};let a=e.width,o=e.height;const l=t.container,h=t.canvas;if(l){const{width:d,height:u}=dy(l,e.width,e.height);a=d,o=u}else if(h&&rn(t.mode)){let d;d=ht(h)?document==null?void 0:document.getElementById(h):h;const{width:u,height:c}=dy(d,e.width,e.height);a=u,o=c}else if(Wa(t.mode)&&(!((i=t.modeParams)===null||i===void 0)&&i.domref)){const d=t.modeParams.domref;a=d.width,o=d.height}return a=n??a,o=r??o,{width:a,height:o}}function cl(s,...t){const e=i=>t.reduce((n,r)=>n||(r==null?void 0:r[i]),s[i]);return Object.assign(s,{change:e("change"),reCompile:e("reCompile"),reMake:e("reMake"),reRender:e("reRender"),reSize:e("reSize")}),s}function MB(s,t){return s==="line"||s==="area"||s==="common"&&t.series.every(e=>e.type==="area"||e.type==="line")?{paddingInner:1,paddingOuter:0}:{paddingOuter:0}}var bt;(function(s){s.STATE_NORMAL="normal",s.STATE_HOVER="hover",s.STATE_HOVER_REVERSE="hover_reverse",s.STATE_DIMENSION_HOVER="dimension_hover",s.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",s.STATE_SELECTED="selected",s.STATE_SELECTED_REVERSE="selected_reverse"})(bt||(bt={}));var au;(function(s){s.STATE_HOVER_REVERSE="hover_reverse",s.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",s.STATE_SELECTED_REVERSE="selected_reverse"})(au||(au={}));class Ya{constructor(){this._children=[],this._markNameMap={},this._infoMap=new Map}getMarkNameMap(){return this._markNameMap}addMark(t,e){P(t)||(this._children.push(t),this._markNameMap[t.name]=t,this._infoMap.set(t,lt({},Ya.defaultMarkInfo,e)))}removeMark(t){const e=this._children.findIndex(i=>i.name===t);e>=0&&(this._infoMap.delete(this._children[e]),delete this._markNameMap[t],this._children.splice(e,1))}clear(){this._children=[],this._markNameMap={},this._infoMap.clear()}forEach(t){this._children.forEach(t)}includes(t,e){return this._children.includes(t,e)}get(t){return isNaN(Number(t))?this._markNameMap[t]:this._children[t]}getMarks(){return this._children.slice()}getMarksInType(t){const e=Y(t);return this._children.filter(i=>e.includes(i.type))}getMarkInId(t){return this._children.find(e=>e.id===t)}getMarkWithInfo(t){return this._children.find(e=>Object.keys(t).every(i=>t[i]===this._infoMap.get(e)[i]))}}Ya.defaultMarkInfo={};class dJ{get hover(){return this._hover}get select(){return this._select}constructor(t){this._marks=new Ya,this._markReverse=new Ya,this._lastDimensionEvent=null,this.onHover=e=>{const i=this.getEventElement(e);switch(e.action){case"enter":this.interaction.getEventElement(bt.STATE_DIMENSION_HOVER).forEach(n=>{this.interaction.addEventElement(bt.STATE_DIMENSION_HOVER_REVERSE,n)}),this.interaction.clearEventElement(bt.STATE_DIMENSION_HOVER,!1),i.forEach(({el:n,mark:r})=>{this.interaction.addEventElement(bt.STATE_DIMENSION_HOVER,n)}),this.interaction.reverseEventElement(bt.STATE_DIMENSION_HOVER);break;case"leave":this.interaction.clearEventElement(bt.STATE_DIMENSION_HOVER,!0),e=null}this._lastDimensionEvent=e},this._option=t,this.event=this._option.model.getOption().getChart().getEvent(),this.interaction=t.interaction,this.initConfig(t.mode)}setStateKeys(t){}registerMark(t){vt(t.stateStyle[bt.STATE_DIMENSION_HOVER])||this._marks.addMark(t),vt(t.stateStyle[bt.STATE_DIMENSION_HOVER_REVERSE])||this._markReverse.addMark(t)}init(){this.initEvent()}release(){this.releaseEvent()}initEvent(){this.event.on(Nr.dimensionHover,this.onHover)}releaseEvent(){this.event.release()}initConfig(t){}getEventElement(t,e=!1){const i=[];return t.dimensionInfo.forEach(n=>{n.data.forEach(r=>{(e?this._markReverse:this._marks).getMarks().filter(a=>a.model===r.series&&a.getVisible()).forEach(a=>{const o=a.getProduct().elements.filter(l=>{const h=l.getDatum();let d;return d=$(h)?h.every((u,c)=>u===r.datum[c]):r.datum.some(u=>u===h),e?!d:d}).map(l=>({el:l,mark:a}));i.push(...o)})})}),i}dimensionDataEqual(t){if(this._lastDimensionEvent===t)return!0;if(!this._lastDimensionEvent||!t||this._lastDimensionEvent.dimensionInfo.length!==t.dimensionInfo.length)return!1;for(let e=0;e<this._lastDimensionEvent.dimensionInfo.length;e++){const i=this._lastDimensionEvent.dimensionInfo[e],n=t.dimensionInfo[e];if(i.value!==n.value||i.axis!==n.axis||i.data.length!==n.data.length)return!1;for(let r=0;r<i.data.length;r++){const a=i.data[r],o=n.data[r];if(a.series!==o.series||a.datum.length!==o.datum.length)return!1;for(let l=0;l<a.datum.length;l++)if(a.datum[l]!==o.datum[l])return!1}}return!0}}function uJ(s,t,e){var i;const n=(i=t[s])===null||i===void 0?void 0:i.style;return cJ(s,n)||K(n)?!0:!(!(n!=null&&n.scale)||n.field===e)}function cJ(s,t){return(s==="fill"||s==="stroke")&&(t==null?void 0:t.gradient)&&(t==null?void 0:t.stops)}const CB={};Object.values(bt).forEach(s=>{CB[s]=!0});function pJ(s){return!!CB[s]}const gJ={[bt.STATE_HOVER]:bt.STATE_HOVER_REVERSE,[bt.STATE_SELECTED]:bt.STATE_SELECTED_REVERSE,[bt.STATE_DIMENSION_HOVER]:bt.STATE_DIMENSION_HOVER_REVERSE};function $p(s){return gJ[s]}class fJ{constructor(){this._stateMarks=new Map,this._stateElements=new Map,this._disableTriggerEvent=!1}static markStateEnable(t,e){return!vt(t.stateStyle[e])}setDisableActiveEffect(t){this._disableTriggerEvent=t}registerMark(t,e){var i;this._stateMarks.has(t)||this._stateMarks.set(t,[]),(i=this._stateMarks.get(t))===null||i===void 0||i.push(e)}getStateMark(t){return this._stateMarks.get(t)}filterEventMark(t,e){var i;return!(!t.mark||!(!((i=this._stateMarks.get(e))===null||i===void 0)&&i.includes(t.mark)))}getEventElement(t){var e;return(e=this._stateElements.get(t))!==null&&e!==void 0?e:[]}getEventElementData(t){return this.getEventElement(t).map(e=>e.getDatum())}exchangeEventElement(t,e){var i;if(this._disableTriggerEvent)return;const n=$p(t);(i=this._stateElements.get(t))===null||i===void 0||i.forEach(r=>{r.removeState(t),n&&this.addEventElement(n,r)}),e.getStates().includes(t)||(e.addState(t),n&&e.removeState(n)),this._stateElements.set(t,[e])}removeEventElement(t,e){var i,n;if(this._disableTriggerEvent)return;e.removeState(t);const r=(n=(i=this._stateElements.get(t))===null||i===void 0?void 0:i.filter(o=>o!==e))!==null&&n!==void 0?n:[];this._stateElements.set(t,r);const a=$p(t);a&&(r.length===0?this.clearEventElement(a,!1):this.addEventElement(a,e))}addEventElement(t,e){var i;if(this._disableTriggerEvent)return;e.getStates().includes(t)||e.addState(t);const n=(i=this._stateElements.get(t))!==null&&i!==void 0?i:[];n.push(e),this._stateElements.set(t,n)}clearEventElement(t,e){var i;if(!this._disableTriggerEvent&&((i=this._stateElements.get(t))===null||i===void 0||i.forEach(n=>{n.removeState(t)}),this._stateElements.set(t,[]),e)){const n=$p(t);n&&this.clearEventElement(n,!1)}}reverseEventElement(t){if(this._disableTriggerEvent)return;const e=$p(t);if(!e)return;const i=this.getStateMark(e);if(!i)return;const n=this.getEventElement(t);n.length&&(this.getEventElement(e).length||(n.length===1?i.forEach(r=>{r.getProduct().elements.filter(a=>a!==n[0]).forEach(a=>{this.addEventElement(e,a)})}):i.forEach(r=>{r.getProduct().elements.filter(a=>!n.includes(a)).forEach(a=>{this.addEventElement(e,a)})})))}}class qm{getOption(){return this._option}constructor(t){this._option=t,this.getCompiler=this._option.getCompiler}getVGrammarView(){var t;return(t=this.getCompiler())===null||t===void 0?void 0:t.getVGrammarView()}release(){this._option=null}}class aA extends qm{constructor(){super(...arguments),this.id=No(),this._compiledProductId=null,this._depend=[]}getProduct(){if(E(this._product))return this._product;const t=this.getVGrammarView(),e=this.getProductId();return E(e)&&E(t)&&(this._product=this._lookupGrammar(e)),this._product}getProductId(){var t;return(t=this._compiledProductId)!==null&&t!==void 0?t:this.generateProductId()}getDepend(){return this._depend}setDepend(...t){this._depend=t}compile(t){this._compileProduct(t),this._afterCompile(t)}_afterCompile(t){var e;E(this._product)&&((e=this.getCompiler())===null||e===void 0||e.addGrammarItem(this))}updateDepend(){if(E(this._product)){const t=this.getDepend().map(e=>e.getProduct()).filter(E);return this._product.depend(t),t.length===this.getDepend().length}return!1}release(){this.removeProduct(),super.release(),this._depend=[]}removeProduct(t){this.getCompiler().removeGrammarItem(this,t),this._product=null,this._compiledProductId=null}}class _J extends aA{getValue(){return this._value}getUpdateFunc(){return this._updateFunc}constructor(t,e,i,n){super(t),this.grammarType=Pa.signal,this.name=e,this._value=i,this._updateFunc=n}updateSignal(t,e){this._value=t,this._updateFunc=e,this.compile()}_compileProduct(){const t=this.getVGrammarView();if(t){if(!this.getProduct()){const e=this.getProductId();this._product=t.signal().id(e),this._compiledProductId=e}E(this._value)&&this._product.value(this._value),E(this._updateFunc)&&this._product.update(this._updateFunc)}}generateProductId(){return this.name}_lookupGrammar(t){var e;return(e=this.getCompiler().getVGrammarView())===null||e===void 0?void 0:e.getSignalById(t)}}class mJ extends qm{constructor(){super(...arguments),this._signalMap={}}getSignalMap(){return this._signalMap}getSignal(t){return this._signalMap[t]}updateSignal(t,e,i){this._signalMap[t]?this._signalMap[t].updateSignal(e,i):(this._signalMap[t]=new _J(this._option,t,e,i),this._signalMap[t].compile())}compile(){Object.values(this._signalMap).forEach(t=>{t.compile()})}release(){super.release(),Object.values(this._signalMap).forEach(t=>{t.release()}),this._signalMap={}}}class PB extends mJ{getStateMap(){return this._stateMap}_getDefaultStateMap(){return{}}constructor(t){super(t),t.stateKeyToSignalName?this.stateKeyToSignalName=t.stateKeyToSignalName:this.stateKeyToSignalName=()=>"state_signal",this.initStateMap()}initStateMap(t){this._stateMap=t??this._getDefaultStateMap()}compile(t){const e=t??this._stateMap;Object.keys(e).forEach(i=>{const n=this.stateKeyToSignalName(i),r=e[i];this.updateSignal(n,r)})}updateState(t,e){return t?(lt(this._stateMap,t),this.compile(t),e?Promise.resolve():this.getCompiler().renderAsync()):Promise.resolve()}}class EB extends PB{constructor(){super(...arguments),this.id=No(),this.stateKeyToSignalName=t=>`${At}_animate_${this.id}_${t}`}getAnimationStateSignalName(){return this.stateKeyToSignalName("animationState")}updateAnimateState(t,e){t===ci.update?this.updateState({animationState:{callback:(i,n)=>n.diffState}},e):t===ci.appear?this.updateState({animationState:{callback:(i,n)=>n.diffState==="exit"?ci.none:ci.appear}},e):this.updateState({animationState:{callback:(i,n)=>t}},e)}_getDefaultStateMap(){return{animationState:{callback:(t,e)=>e.diffState==="exit"?ci.exit:ci.appear}}}}class Zm{constructor(t){this._option=t,this.type=t.type}_initTheme(t,e){return this._theme=this.getTheme(t,e),this._mergeThemeToSpec(t,e)}getTheme(t,e){}transformSpec(t,e,i){this._transformSpecBeforeMergingTheme(t,e,i);const n=this._initTheme(t,e);return this._transformSpecAfterMergingTheme(n.spec,e,i),n}_transformSpecBeforeMergingTheme(t,e,i){}_transformSpecAfterMergingTheme(t,e,i){}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const n=this._getDefaultSpecFromChart(e),r=a=>yt({},i,n,a);return $(t)?{spec:t.map(a=>r(a)),theme:i}:{spec:r(t),theme:i}}return{spec:t,theme:i}}_shouldMergeThemeToSpec(){return!0}_getDefaultSpecFromChart(t){}}class oA extends qm{getSpec(){return this._spec||{}}getSpecPath(){return this._option.specPath}getSpecInfoPath(){var t;return(t=this._option.specInfoPath)!==null&&t!==void 0?t:this._option.specPath}getData(){return this._data}get layout(){return this._layout}getSpecIndex(){return this._specIndex}getOption(){return this._option}getMarks(){var t,e;return(e=(t=this._marks)===null||t===void 0?void 0:t.getMarks())!==null&&e!==void 0?e:[]}getMarkNameMap(){var t;return(t=this._marks)===null||t===void 0?void 0:t.getMarkNameMap()}getMarkSet(){return this._marks}getMarkInfoList(){return this.getMarks().map(t=>({type:t.type,name:t.name}))}getChart(){return this._option.getChart()}get _theme(){var t;return(t=this.getSpecInfo())===null||t===void 0?void 0:t.theme}constructor(t,e){var i,n;super(e),this.transformerConstructor=Zm,this.type="null",this.modelType="null",this.userId=void 0,this._data=null,this._layout=null,this._specIndex=0,this.specKey="",this._marks=new Ya,this._lastLayoutRect=null,this.id=No(),this.userId=t.id,this._spec=t,this._specIndex=(i=e.specIndex)!==null&&i!==void 0?i:0,this.effect={},this.event=new Hc(e.eventDispatcher,e.mode),(n=e.map)===null||n===void 0||n.set(this.id,this)}_releaseEvent(){this.event.release()}created(){this.setAttrFromSpec()}init(t){}afterInit(){}getVisible(){var t;return((t=this._spec)===null||t===void 0?void 0:t.visible)!==!1}onLayoutStart(t,e,i){var n;(n=this._layout)===null||n===void 0||n.onLayoutStart(t,e,i)}onLayoutEnd(t){var e;(e=this._layout)===null||e===void 0||e.onLayoutEnd(t),this.getMarks().forEach(i=>i.updateLayoutState(!0,!0))}onEvaluateEnd(t){}onDataUpdate(){}beforeRelease(){}release(){var t;this._releaseEvent(),this._spec=void 0,this.getMarks().forEach(e=>e.release()),(t=this._data)===null||t===void 0||t.release(),this._data=this._specIndex=null,this._marks.clear(),super.release()}updateSpec(t){const e=this._compareSpec(t,this._spec);return this._spec=t,e.reMake||this.reInit(),e}_compareSpec(t,e){return{change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1}}reInit(t){t&&(this._spec=t),this.setAttrFromSpec()}updateLayoutAttribute(){}setAttrFromSpec(){var t;(t=this._layout)===null||t===void 0||t.setAttrFromSpec(this._spec,this._option.getChartViewRect())}_convertMarkStyle(t){return Object.assign({},t)}setMarkStyle(t,e,i,n){E(t)&&E(e)&&t.setStyle(this._convertMarkStyle(e),i,n)}initMarkStyleWithSpec(t,e,i){if(!E(t)||!E(e))return;const{style:n,state:r}=e,a=Object.assign({},e);n&&(a.style=this._convertMarkStyle(n)),r&&(a.state={},Object.keys(r).forEach(o=>{a.state[o]=this._convertMarkStyle(r[o])})),t.initStyleWithSpec(a,i)}stateKeyToSignalName(t,e){let i=`${At}_${this.modelType}_${this.type}_${this.id}_${t}`;return e&&(i+=`_${e}`),i}compileData(){var t;(t=this._data)===null||t===void 0||t.compile()}compileMarks(t){this.getMarks().forEach(e=>{e.compile({group:t})})}_createMark(t,e={}){const{type:i,name:n}=t,r=F.createMark(i,n,Object.assign({model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._option.globalScale},e));return r==null||r.created(),r}_getDataIdKey(){}getColorScheme(){var t,e;return(e=(t=this._option).getTheme)===null||e===void 0?void 0:e.call(t).colorScheme}getSpecInfo(){var t,e,i;const n=(i=(e=(t=this._option).getSpecInfo)===null||e===void 0?void 0:e.call(t))!==null&&i!==void 0?i:{};return ZU(n,this.getSpecInfoPath())}}class vJ{getSpec(){return this._spec||{}}getLayoutStartPoint(){return this._layoutStartPoint}get layoutRectLevelMap(){return this._layoutRectLevelMap}get minWidth(){return this._minWidth}set minWidth(t){this._minWidth=t}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth=t}get minHeight(){return this._minHeight}set minHeight(t){this._minHeight=t}get maxHeight(){return this._maxHeight}set maxHeight(t){this._maxHeight=t}getLastComputeOutBounds(){return this._lastComputeOutBounds}get layoutOrient(){return this._layoutOrient}set layoutOrient(t){this._layoutOrient=t}get model(){return this._model}get type(){return this._model.type}constructor(t,e){var i;this.layoutClip=!1,this.autoIndent=!1,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:0,height:0},this._layoutRectLevelMap={width:ks,height:ks},this._minWidth=null,this._maxWidth=null,this._minHeight=null,this._maxHeight=null,this._lastComputeRect=null,this._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0},this.getLayoutRect=()=>this._layoutRect,this.layoutType="normal",this._layoutOrient="left",this.layoutPaddingLeft=0,this.layoutPaddingTop=0,this.layoutPaddingRight=0,this.layoutPaddingBottom=0,this.layoutOffsetX=0,this.layoutOffsetY=0,this.layoutLevel=Ln.Region,this._model=t,this._option=e,this.layoutLevel=e.layoutLevel,this.layoutType=e.layoutType,e.layoutOrient&&(this.layoutOrient=e.layoutOrient),this._spec=(i=t==null?void 0:t.getSpec)===null||i===void 0?void 0:i.call(t)}_setLayoutAttributeFromSpec(t,e){var i,n,r,a;if(this._spec&&this._spec.visible!==!1){const o=Hr(t.padding),l=aB(o,e,e);this.layoutPaddingLeft=l.left,this.layoutPaddingRight=l.right,this.layoutPaddingTop=l.top,this.layoutPaddingBottom=l.bottom,this._minHeight=P(t.minHeight)?(i=this._minHeight)!==null&&i!==void 0?i:null:Xi(t.minHeight,e.height,e),this._maxHeight=P(t.maxHeight)?(n=this._maxHeight)!==null&&n!==void 0?n:null:Xi(t.maxHeight,e.height,e),this._minWidth=P(t.minWidth)?(r=this._minWidth)!==null&&r!==void 0?r:null:Xi(t.minWidth,e.width,e),this._maxWidth=P(t.maxWidth)?(a=this._maxWidth)!==null&&a!==void 0?a:null:Xi(t.maxWidth,e.width,e),t.width&&this.setLayoutRect({width:Xi(t.width,e.width,e)},{width:ra}),t.height&&this.setLayoutRect({height:Xi(t.height,e.height,e)},{height:ra}),P(t.offsetX)||(this.layoutOffsetX=Xi(t.offsetX,e.width,e)),P(t.offsetY)||(this.layoutOffsetY=Xi(t.offsetY,e.height,e)),t.alignSelf&&(this.alignSelf=t.alignSelf)}}setAttrFromSpec(t,e){var i,n,r,a;this._spec=t,this.layoutType=(i=t.layoutType)!==null&&i!==void 0?i:this.layoutType,this.layoutLevel=(n=t.layoutLevel)!==null&&n!==void 0?n:this.layoutLevel,this.layoutOrient=(r=t.orient)!==null&&r!==void 0?r:this.layoutOrient,this._setLayoutAttributeFromSpec(t,e),this.layoutClip=(a=t.clip)!==null&&a!==void 0?a:this.layoutClip}onLayoutStart(t,e,i){this._setLayoutAttributeFromSpec(this._spec,e)}onLayoutEnd(t){}_getAbsoluteSpecValue(t){const e={top:null,bottom:null,left:null,right:null};return["top","bottom","left","right"].forEach(i=>{P(this._spec[i])||(e[i]=Xi(this._spec[i],i==="top"||i==="bottom"?t.height:t.width,t))}),e}absoluteLayoutInRect(t){const{top:e,bottom:i,left:n,right:r}=this._getAbsoluteSpecValue(t),a={width:t.width-this.layoutPaddingLeft-this.layoutPaddingRight,height:t.height-this.layoutPaddingTop-this.layoutPaddingBottom};P(n)||(a.width-=n),P(r)||(a.width-=r),P(e)||(a.height-=e),P(i)||(a.height-=i),this.setLayoutRect(a);const{width:o,height:l}=this.computeBoundsInRect(this.getLayoutRect());this.setLayoutRect({width:o,height:l});const h={x:t.x,y:t.y};this._spec.center===!0?(h.x=t.x+.5*t.width-.5*o,h.y=t.y+.5*t.height-.5*l):(P(n)?P(r)||(h.x=t.x+t.width-this.layoutPaddingRight-r-o):h.x=t.x+n+this.layoutPaddingLeft,P(e)?P(i)||(h.y=t.y+t.height-this.layoutPaddingBottom-i-l):h.y=t.y+e+this.layoutPaddingTop),this.setLayoutStartPosition(h)}setLayoutStartPosition(t){var e,i;this._option.transformLayoutPosition&&(t=this._option.transformLayoutPosition(t)),N(t.x)&&(this._layoutStartPoint.x=t.x),N(t.y)&&(this._layoutStartPoint.y=t.y),(i=(e=this._model).afterSetLayoutStartPoint)===null||i===void 0||i.call(e,this._layoutStartPoint)}setLayoutRect({width:t,height:e},i){var n,r,a,o;N(t)&&((n=i==null?void 0:i.width)!==null&&n!==void 0?n:ks)>=this._layoutRectLevelMap.width&&(this._layoutRect.width=t,this._layoutRectLevelMap.width=(r=i==null?void 0:i.width)!==null&&r!==void 0?r:ks),N(e)&&((a=i==null?void 0:i.height)!==null&&a!==void 0?a:ks)>=this._layoutRectLevelMap.height&&(this._layoutRect.height=e,this._layoutRectLevelMap.height=(o=i==null?void 0:i.height)!==null&&o!==void 0?o:ks),this.setRectInSpec(this._layoutRect)}getLayout(){return{x:this._layoutStartPoint.x,y:this._layoutStartPoint.y,width:this._layoutRect.width,height:this._layoutRect.height}}mergeLayoutRect({width:t,height:e}){const i={width:t,height:e};return this._layoutRectLevelMap.width>ks&&(i.width=this._layoutRect.width),this._layoutRectLevelMap.height>ks&&(i.height=this._layoutRect.height),i}getOrientPosAttribute(){return this._layoutOrient==="bottom"||this._layoutOrient==="top"?"x":"y"}getOrientSizeAttribute(){return this._layoutOrient==="bottom"||this._layoutOrient==="top"?"width":"height"}changeBoundsBySetting(t){return this._layoutRectLevelMap.width>ks&&(t.x2=t.x1+this._layoutRect.width),this._layoutRectLevelMap.height>ks&&(t.y2=t.y1+this._layoutRect.height),t.x1-=this._layoutStartPoint.x,t.x2-=this._layoutStartPoint.x,t.y1-=this._layoutStartPoint.y,t.y2-=this._layoutStartPoint.y,t}setRectInSpec(t){const e=Object.assign({},t);return this._layoutRectLevelMap.width<ra?(P(this._minWidth)||(e.width=Math.max(e.width,this._minWidth)),P(this._maxWidth)||(e.width=Math.min(e.width,this._maxWidth))):e.width=this._layoutRect.width,this._layoutRectLevelMap.height<ra?(P(this._minHeight)||(e.height=Math.max(e.height,this._minHeight)),P(this._maxHeight)||(e.height=Math.min(e.height,this._maxHeight))):e.height=this._layoutRect.height,e}computeBoundsInRect(t){if(this._lastComputeRect=t,this.layoutType==="region-relative"&&(this._layoutRectLevelMap.width===ra&&(this.layoutOrient==="left"||this.layoutOrient==="right")||this._layoutRectLevelMap.height===ra&&(this.layoutOrient==="bottom"||this.layoutOrient==="top")))return this._layoutRect;const e=Object.assign({},this._model.getBoundsInRect(this.setRectInSpec(t),t));this.changeBoundsBySetting(e),this.autoIndent&&e.x2-e.x1>0&&e.y2-e.y1>0&&(this._lastComputeOutBounds.x1=Math.ceil(-e.x1),this._lastComputeOutBounds.x2=Math.ceil(e.x2-t.width),this._lastComputeOutBounds.y1=Math.ceil(-e.y1),this._lastComputeOutBounds.y2=Math.ceil(e.y2-t.height));let i=this.setRectInSpec(yq(e,t));return this._option.transformLayoutRect&&(i=this._option.transformLayoutRect(i)),i}getModelId(){return this._model.id}getModelVisible(){return this._model.getVisible()}}class RB extends oA{constructor(){super(...arguments),this.layoutType="normal",this.layoutLevel=0,this.layoutZIndex=0,this._forceLayoutTag=!1,this._layout=null,this._orient=null,this._layoutRect={width:0,height:0},this._layoutStartPos={x:0,y:0},this._isLayout=!0,this.getGraphicBounds=()=>this._layout?{x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}:{x1:0,x2:0,y1:0,y2:0},this._transformLayoutRect=null,this._transformLayoutPosition=null}get layoutOrient(){return this._orient}set layoutOrient(t){this._orient=t,this._layout&&(this._layout.layoutOrient=t)}initLayout(){this.layoutType!=="none"&&(this._layout=new vJ(this,{layoutType:this.layoutType,layoutLevel:this.layoutLevel,layoutOrient:this._orient,transformLayoutRect:this._transformLayoutRect,transformLayoutPosition:this._transformLayoutPosition}),this._orient&&this._orient!=="radius"&&this._orient!=="angle"&&this.layout&&(this._layout.layoutOrient=this._orient))}onLayoutStart(t,e,i){this._isLayout=!0,super.onLayoutStart(t,e,i)}onLayoutEnd(t){super.onLayoutEnd(t),this.updateLayoutAttribute();const e=this.getLayoutRect();!this._forceLayoutTag&&Se(this._lastLayoutRect,e)||(this._lastLayoutRect=Object.assign({},e)),this._forceLayoutTag=!1,this._isLayout=!1}afterSetLayoutStartPoint(t){}_forceLayout(){var t;this._isLayout||(this._forceLayoutTag=!0,(t=this._option.globalInstance.getChart())===null||t===void 0||t.setLayoutTag(!0))}getLayoutStartPoint(){return this._layout?this._layout.getLayoutStartPoint():this._layoutStartPos}setLayoutStartPosition(t){return this._layout?this._layout.setLayoutStartPosition(t):this._layoutStartPos=lt(this._layoutStartPos,t)}getLayoutRect(){return this._layout?this._layout.getLayoutRect():this._layoutRect}setLayoutRect(t,e){return this._layout?this._layout.setLayoutRect(t):this._lastLayoutRect=lt(this._layoutRect,t)}getLastComputeOutBounds(){var t;return(t=this._layout)===null||t===void 0?void 0:t.getLastComputeOutBounds()}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.layoutClip=(t=this._spec.clip)!==null&&t!==void 0?t:this.layoutClip,this.layoutZIndex=(e=this._spec.zIndex)!==null&&e!==void 0?e:this.layoutZIndex,this.layoutType=(i=this._spec.layoutType)!==null&&i!==void 0?i:this.layoutType}}class OB extends Zm{_initTheme(t,e){return{spec:t,theme:this._theme}}}class mh extends RB{getMaxWidth(){return this._layout.maxWidth}setMaxWidth(t){this._layout.maxWidth=t}getMaxHeight(){return this._layout.maxHeight}setMaxHeight(t){this._layout.maxHeight=t}getGroupMark(){return this._groupMark}getInteractionMark(){return this._interactionMark}getStackInverse(){return this._spec.stackInverse===!0}constructor(t,e){var i;super(t,e),this.transformerConstructor=OB,this.modelType="region",this.specKey="region",this.type=mh.type,this._series=[],this.layoutType="region",this.layoutZIndex=ce.Region,this.interaction=new fJ,this.seriesDataFilterOver=()=>{this.event.emit(St.regionSeriesDataFilterOver,{model:this}),this._series.forEach(n=>{n.getViewDataFilter()&&n.reTransformViewData()})},this.getBoundsInRect=()=>({x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}),this.userId=t.id,this.coordinate=(i=t.coordinate)!==null&&i!==void 0?i:"cartesian",this._option.animation&&(this.animate=new EB({getCompiler:e.getCompiler})),this.interaction.setDisableActiveEffect(this._option.disableTriggerEvent)}_getClipDefaultValue(){var t,e,i,n;const r=this._option.getChart().getSpec(),a=(e=(t=r.dataZoom)===null||t===void 0?void 0:t.some)===null||e===void 0?void 0:e.call(t,l=>{var h;return((h=l.filterMode)!==null&&h!==void 0?h:"filter")==="axis"}),o=(n=(i=r.scrollBar)===null||i===void 0?void 0:i.some)===null||n===void 0?void 0:n.call(i,l=>{var h;return((h=l.filterMode)!==null&&h!==void 0?h:"axis")==="axis"});return!(!a&&!o)||this._layout.layoutClip}created(){var t;this.initLayout(),super.created();const e=(t=this._spec.clip)!==null&&t!==void 0?t:this._getClipDefaultValue();this._groupMark=this._createGroupMark("regionGroup",this.userId,this.layoutZIndex),this._interactionMark=this._createGroupMark("regionInteractionGroup",this.userId+"_interaction",ce.Interaction),this._spec.style&&(this._backgroundMark=this._createMark({type:"rect",name:"regionBackground"}),e&&(this._foregroundMark=this._createMark({type:"rect",name:"regionForeground"})),[this._backgroundMark,this._foregroundMark].forEach(i=>{i&&(i.created(),this.setMarkStyle(i,{width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height},"normal",tt.Built_In),this._groupMark.addMark(i))}),this._backgroundMark&&this._backgroundMark.setZIndex(0),this._foregroundMark&&this._foregroundMark.setZIndex(ce.Mark+1)),this.createTrigger()}_createGroupMark(t,e,i){var n,r;const a=this._createMark({type:"group",name:t});a.setUserId(e),a.setZIndex(i);const o=(n=this._spec.clip)!==null&&n!==void 0?n:this._getClipDefaultValue();return this.setMarkStyle(a,{x:()=>this.getLayoutStartPoint().x,y:()=>this.getLayoutStartPoint().y,width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height,clip:o},"normal",tt.Built_In),this.setMarkStyle(a,{cornerRadius:(r=this._spec.style)===null||r===void 0?void 0:r.cornerRadius},"normal",tt.User_Mark),this._marks.addMark(a),a}init(t){super.init(t),this.initMark(),this.initSeriesDataflow(),this.initInteraction(),this.initTrigger()}initMark(){this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}_initBackgroundMarkStyle(){var t,e;this._backgroundMark&&(this.setMarkStyle(this._backgroundMark,Object.assign({fillOpacity:!((t=this._spec.style)===null||t===void 0)&&t.fill?1:0},this._spec.style),"normal",tt.User_Mark),((e=this._spec.clip)!==null&&e!==void 0?e:this._getClipDefaultValue())&&this.setMarkStyle(this._backgroundMark,{strokeOpacity:0},"normal",tt.Built_In))}_initForegroundMarkStyle(){this._foregroundMark&&this.setMarkStyle(this._foregroundMark,Object.assign(Object.assign({},this._spec.style),{fillOpacity:0}),"normal",tt.User_Mark)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Se(e==null?void 0:e.style,t==null?void 0:t.style)||(i.reMake=!0),i}reInit(t){super.reInit(t),this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}addSeries(t){t&&(this._series.includes(t)||this._series.push(t))}removeSeries(t){if(!t)return;const e=this._series.findIndex(i=>i===t);e>=0&&this._series.splice(e,1)}getSeries(t={}){return this._series.filter(e=>{var i,n;return(!t.name||(e==null?void 0:e.name)===t.name)&&(!t.userId||Y(t.userId).includes(e.userId))&&(!E(t.specIndex)||!e.getSpecIndex||Y(t.specIndex).includes(e.getSpecIndex()))&&(!t.id||e.id===t.id)&&(!t.type||e.type===t.type)&&(!t.coordinateType||e.coordinate===t.coordinateType)&&(!t.dataName||((n=(i=e.getRawData)===null||i===void 0?void 0:i.call(e))===null||n===void 0?void 0:n.name)===t.dataName)})}getSeriesInName(t){return this.getSeries({name:t})[0]}getSeriesInUserId(t){return this.getSeries({userId:t})[0]}getSeriesInId(t){return this.getSeries({id:t})[0]}getSeriesInType(t){return this.getSeries({type:t})}getSeriesInCoordinateType(t){return this.getSeries({coordinateType:t})}getSeriesInDataName(t){return this.getSeries({dataName:t})}onRender(t){}initSeriesDataflow(){const t=this._series.map(e=>{var i;return(i=e.getViewDataFilter())!==null&&i!==void 0?i:e.getViewData()}).filter(e=>!!e);this._option.dataSet.multipleDataViewAddListener(t,"change",this.seriesDataFilterOver)}release(){super.release(),this._series=[]}createTrigger(){const t=Object.assign(Object.assign({},this._option),{model:this,interaction:this.interaction});this._trigger=new dJ(t)}initTrigger(){this._series.forEach(t=>{t.getMarksWithoutRoot().forEach(e=>{this._trigger.registerMark(e)})}),this._trigger.init()}initInteraction(){this._series.forEach(t=>{t.getMarksWithoutRoot().forEach(e=>{for(const i in au)vt(e.stateStyle[au[i]])||this.interaction.registerMark(au[i],e)})})}compileMarks(t){this.getMarks().forEach(e=>{var i;e.compile({group:t}),(i=e.getProduct())===null||i===void 0||i.configure({context:{model:this}}).layout((n,r,a,o)=>{})})}compile(){var t;(t=this.animate)===null||t===void 0||t.compile(),this.compileMarks()}onLayoutEnd(t){this._series.forEach(e=>e.onLayoutEnd(t)),super.onLayoutEnd(t)}}mh.type="region",mh.transformerConstructor=OB,mh.specKey="region";function Jm(s){const t=[],e=[],i=[];return s.forEach(n=>{P(n.getSpec().position)||n.getSpec().position==="start"?t.push(n):n.getSpec().position==="middle"?e.push(n):n.getSpec().position==="end"&&i.push(n)}),{startItems:t,endItems:i,middleItems:e}}function IB(s,t,e){t?s.forEach(i=>{const n=Ma(i),r=n.getLayoutStartPoint().y+n.getLayoutRect().height-i[0].getLayoutStartPoint().y,a=(e-r)/2;i.forEach(o=>{o.setLayoutStartPosition({x:o.getLayoutStartPoint().x,y:o.getLayoutStartPoint().y+a})})}):s.forEach(i=>{const n=Ma(i),r=n.getLayoutStartPoint().x+n.getLayoutRect().width-i[0].getLayoutStartPoint().x,a=(e-r)/2;i.forEach(o=>{o.setLayoutStartPosition({x:o.getLayoutStartPoint().x+a,y:o.getLayoutStartPoint().y})})})}function Qm(s,t,e,i){let n;s.forEach((r,a)=>{r.length>1&&(n=e[a],r.forEach(o=>{if(!o.alignSelf||o.alignSelf==="start")return;const l=o.getLayoutStartPoint(),h=o.alignSelf==="middle"?.5:1,d=t?n-(o.getLayoutRect().width+o.layoutPaddingLeft+o.layoutPaddingRight):n-(o.getLayoutRect().height+o.layoutPaddingTop+o.layoutPaddingBottom);t?o.setLayoutStartPosition({x:l.x+i*d*h,y:l.y}):o.setLayoutStartPosition({x:l.x,y:l.y+i*d*h})}))})}function y_(s,t,e,i,n){if(s.length){let r=0;const a=n==="right",o=a?-1:1;let l=a?t.rightCurrent:t.leftCurrent,h=t.topCurrent;const d=[];let u=[];const c=[];s.forEach(p=>{const g=t.getItemComputeLayoutRect(p),f=p.computeBoundsInRect(g);p.setLayoutRect(f);const _=f.height+p.layoutPaddingTop+p.layoutPaddingBottom,m=f.width+p.layoutPaddingLeft+p.layoutPaddingRight,v=a?-f.width-p.layoutPaddingRight:p.layoutPaddingLeft;p.setLayoutStartPosition({x:l+p.layoutOffsetX+v,y:h+p.layoutOffsetY+p.layoutPaddingTop}),h+=_,h>e&&u.length?(c.push(r),l+=o*r,r=m,h=t.topCurrent+_,p.setLayoutStartPosition({x:l+p.layoutOffsetX+v,y:t.topCurrent+p.layoutOffsetY+p.layoutPaddingTop}),d.push(u),u=[p]):(r=Math.max(r,m),u.push(p))}),c.push(r),d.push(u),Qm(d,!0,c,o),i&&IB(d,!0,e),a?t.rightCurrent=l+o*r:t.leftCurrent=l+o*r}}function LB(s,t,e,i){if(s.length){let n=0;const r=i==="right",a=r?-1:1;let o=r?t.rightCurrent:t.leftCurrent,l=t.bottomCurrent;const h=[];let d=[];const u=[];s.forEach(c=>{const p=t.getItemComputeLayoutRect(c),g=c.computeBoundsInRect(p);c.setLayoutRect(g);const f=g.height+c.layoutPaddingTop+c.layoutPaddingBottom,_=g.width+c.layoutPaddingLeft+c.layoutPaddingRight,m=r?-g.width-c.layoutPaddingRight:c.layoutPaddingLeft;l<f&&d.length?(u.push(n),o+=a*n,n=_,l=t.bottomCurrent,c.setLayoutStartPosition({x:o+c.layoutOffsetX+m,y:l+c.layoutOffsetY-g.height-c.layoutPaddingBottom}),h.push(d),d=[c]):(c.setLayoutStartPosition({x:o+c.layoutOffsetX+m,y:l+c.layoutOffsetY-g.height-c.layoutPaddingBottom}),n=Math.max(n,_),l-=f,d.push(c))}),u.push(n),h.push(d),Qm(h,!0,u,a),r?t.rightCurrent=o+a*n:t.leftCurrent=o+a*n}}function b_(s,t,e,i,n){if(s.length){const r=n==="top",a=r?1:-1;let o=0,l=t.leftCurrent,h=r?t.topCurrent:t.bottomCurrent;const d=[];let u=[];const c=[];s.forEach(p=>{const g=t.getItemComputeLayoutRect(p),f=p.computeBoundsInRect(g);p.setLayoutRect(f);const _=f.height+p.layoutPaddingTop+p.layoutPaddingBottom,m=f.width+p.layoutPaddingLeft+p.layoutPaddingRight,v=r?p.layoutPaddingTop:-f.height-p.layoutPaddingBottom;p.setLayoutStartPosition({x:l+p.layoutOffsetX+p.layoutPaddingLeft,y:h+p.layoutOffsetY+v}),l+=m,l>e&&u.length?(c.push(o),l=t.leftCurrent+m,h+=a*o,o=_,p.setLayoutStartPosition({x:t.leftCurrent+p.layoutOffsetX+p.layoutPaddingLeft,y:h+p.layoutOffsetY+v}),d.push(u),u=[p]):(o=Math.max(o,_),u.push(p))}),c.push(o),d.push(u),Qm(d,!1,c,a),i&&IB(d,!1,e),r?t.topCurrent=h+a*o:t.bottomCurrent=h+a*o}}function BB(s,t,e,i){if(s.length){const n=i==="top",r=n?1:-1;let a=0,o=t.rightCurrent,l=n?t.topCurrent:t.bottomCurrent;const h=[];let d=[];const u=[];s.forEach(c=>{const p=t.getItemComputeLayoutRect(c),g=c.computeBoundsInRect(p);c.setLayoutRect(g);const f=g.height+c.layoutPaddingTop+c.layoutPaddingBottom,_=g.width+c.layoutPaddingLeft+c.layoutPaddingRight,m=n?c.layoutPaddingTop:-g.height-c.layoutPaddingBottom;o<_&&d.length?(o=t.rightCurrent,l+=r*a,a=f,c.setLayoutStartPosition({x:t.rightCurrent+c.layoutOffsetX-g.width-c.layoutPaddingRight,y:l+c.layoutOffsetY+m}),h.push(d),d=[c]):(d.push(c),c.setLayoutStartPosition({x:o+c.layoutOffsetX-g.width-c.layoutPaddingRight,y:l+c.layoutOffsetY+m}),a=Math.max(a,f),o-=_)}),u.push(a),h.push(d),Qm(h,!1,u,r),n?t.topCurrent=l+r*a:t.bottomCurrent=l+r*a}}function yJ(s,t,e){const{startItems:i,middleItems:n,endItems:r}=Jm(s);i.length&&y_(i,t,e,!1,"left"),n.length&&y_(n,t,e,!0,"left"),r.length&&LB(r,t,e,"left")}function bJ(s,t,e){const{startItems:i,middleItems:n,endItems:r}=Jm(s);i.length&&y_(i,t,e,!1,"right"),n.length&&y_(n,t,e,!0,"right"),r.length&&LB(r,t,e,"right")}function xJ(s,t,e){const{startItems:i,middleItems:n,endItems:r}=Jm(s);i.length&&b_(i,t,e,!1,"top"),n.length&&b_(n,t,e,!0,"top"),r.length&&BB(r,t,e,"top")}function SJ(s,t,e){const{startItems:i,middleItems:n,endItems:r}=Jm(s);i.length&&b_(i,t,e,!1,"bottom"),n.length&&b_(n,t,e,!0,"bottom"),r.length&&BB(r,t,e,"bottom")}class lA{constructor(t,e){this.leftCurrent=0,this.topCurrent=0,this.rightCurrent=0,this.bottomCurrent=0,this._onError=e==null?void 0:e.onError}_layoutInit(t,e,i,n){this._chartLayoutRect=i,this._chartViewBox=n,this.leftCurrent=i.x,this.topCurrent=i.y,this.rightCurrent=i.x+i.width,this.bottomCurrent=i.height+i.y,e.sort((r,a)=>a.layoutLevel-r.layoutLevel)}_layoutNormalItems(t){this.layoutNormalInlineItems(t.filter(e=>e.layoutType==="normal-inline")),this.layoutNormalItems(t.filter(e=>e.layoutType==="normal"))}_groupItems(t){const e=t.filter(o=>o.layoutType==="region"),i=t.filter(o=>o.layoutType==="region-relative"),n=t.filter(o=>o.layoutType==="region-relative-overlap"),r=i.concat(n),a={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}};return n.forEach(o=>{a[o.layoutOrient].items.push(o)}),{regionItems:e,relativeItems:i,relativeOverlapItems:n,allRelatives:r,overlapItems:a}}layoutItems(t,e,i,n){this._layoutInit(t,e,i,n),this._layoutNormalItems(e);const r={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},{regionItems:a,relativeItems:o,relativeOverlapItems:l,allRelatives:h,overlapItems:d}=this._groupItems(e);this.layoutRegionItems(a,o,l,d),this._processAutoIndent(a,o,l,d,h,r),this.layoutAbsoluteItems(e.filter(u=>u.layoutType==="absolute"))}_processAutoIndent(t,e,i,n={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},r,a){if(r.some(o=>o.autoIndent)){const{top:o,bottom:l,left:h,right:d}=this._checkAutoIndent(r,a);(o||l||h||d)&&(this.topCurrent=a.top+o,this.bottomCurrent=a.bottom-l,this.leftCurrent=a.left+h,this.rightCurrent=a.right-d,this.layoutRegionItems(t,e,i,n))}}layoutNormalItems(t){t.forEach(e=>{const i=this.getItemComputeLayoutRect(e),n=e.computeBoundsInRect(i);e.setLayoutRect(n),e.layoutOrient==="left"?(e.setLayoutStartPosition({x:this.leftCurrent+e.layoutOffsetX+e.layoutPaddingLeft,y:this.topCurrent+e.layoutOffsetY+e.layoutPaddingTop}),this.leftCurrent+=n.width+e.layoutPaddingLeft+e.layoutPaddingRight):e.layoutOrient==="top"?(e.setLayoutStartPosition({x:this.leftCurrent+e.layoutOffsetX+e.layoutPaddingLeft,y:this.topCurrent+e.layoutOffsetY+e.layoutPaddingTop}),this.topCurrent+=n.height+e.layoutPaddingTop+e.layoutPaddingBottom):e.layoutOrient==="right"?(e.setLayoutStartPosition({x:this.rightCurrent+e.layoutOffsetX-n.width-e.layoutPaddingRight,y:this.topCurrent+e.layoutOffsetY+e.layoutPaddingTop}),this.rightCurrent-=n.width+e.layoutPaddingLeft+e.layoutPaddingRight):e.layoutOrient==="bottom"&&(e.setLayoutStartPosition({x:this.leftCurrent+e.layoutOffsetX+e.layoutPaddingRight,y:this.bottomCurrent+e.layoutOffsetY-n.height-e.layoutPaddingBottom}),this.bottomCurrent-=n.height+e.layoutPaddingTop+e.layoutPaddingBottom)})}layoutNormalInlineItems(t){const e=t.filter(l=>l.layoutOrient==="left"),i=t.filter(l=>l.layoutOrient==="right"),n=t.filter(l=>l.layoutOrient==="top"),r=t.filter(l=>l.layoutOrient==="bottom"),a=this._chartLayoutRect.width+this._chartLayoutRect.x,o=this._chartLayoutRect.height+this._chartLayoutRect.y;e.length&&yJ(e,this,o),n.length&&xJ(n,this,a),i.length&&bJ(i,this,o),r.length&&SJ(r,this,a)}_layoutRelativeOverlap(t,e){e.items.forEach(i=>{const n=this.getItemComputeLayoutRect(i),r=i.computeBoundsInRect(n);e.rect.width=Math.max(r.width,e.rect.width),e.rect.height=Math.max(r.height,e.rect.height)}),e.items.forEach(i=>{i.setLayoutRect(e.rect),t==="left"?i.setLayoutStartPosition({x:this.leftCurrent+i.layoutOffsetX+i.layoutPaddingLeft}):t==="right"?i.setLayoutStartPosition({x:this.rightCurrent+i.layoutOffsetX+i.layoutPaddingLeft}):t==="top"?i.setLayoutStartPosition({x:this.topCurrent+i.layoutOffsetX+i.layoutPaddingLeft}):i.setLayoutStartPosition({x:this.bottomCurrent+i.layoutOffsetX+i.layoutPaddingLeft})}),t==="left"?this.leftCurrent+=e.rect.width:t==="right"?this.rightCurrent-=e.rect.width:t==="top"?this.topCurrent+=e.rect.height:this.bottomCurrent-=e.rect.height}_layoutRelativeItem(t,e){const i=t.computeBoundsInRect(e);t.layoutOrient==="left"||t.layoutOrient==="right"?t.setLayoutRect({width:i.width}):t.setLayoutRect({height:i.height}),t.layoutOrient==="left"?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):t.layoutOrient==="right"?(this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight,t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX+t.layoutPaddingLeft})):t.layoutOrient==="top"?(t.setLayoutStartPosition({y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):t.layoutOrient==="bottom"&&(this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom,t.setLayoutStartPosition({y:this.bottomCurrent+t.layoutOffsetY+t.layoutPaddingTop}))}_layoutRegionItem(t,e,i){const n=Math.max(Math.min(e,...t.map(a=>{var o;return(o=a.maxWidth)!==null&&o!==void 0?o:Number.MAX_VALUE})),0),r=Math.max(Math.min(i,...t.map(a=>{var o;return(o=a.maxHeight)!==null&&o!==void 0?o:Number.MAX_VALUE})),0);return t.forEach(a=>{a.setLayoutRect({width:n,height:r}),a.setLayoutStartPosition({x:this.leftCurrent+a.layoutOffsetX+a.layoutPaddingLeft,y:this.topCurrent+a.layoutOffsetY+a.layoutPaddingTop})}),{regionHeight:r,regionWidth:n}}layoutRegionItems(t,e,i,n={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}}){let r=this.rightCurrent-this.leftCurrent,a=this.bottomCurrent-this.topCurrent;e.filter(h=>h.layoutOrient==="left"||h.layoutOrient==="right").forEach(h=>{this._layoutRelativeItem(h,this.getItemComputeLayoutRect(h))}),this._layoutRelativeOverlap("left",n.left),this._layoutRelativeOverlap("right",n.right),r=this.rightCurrent-this.leftCurrent,e.filter(h=>h.layoutOrient==="top"||h.layoutOrient==="bottom").forEach(h=>{this._layoutRelativeItem(h,this.getItemComputeLayoutRect(h))}),this._layoutRelativeOverlap("top",n.top),this._layoutRelativeOverlap("bottom",n.bottom),a=this.bottomCurrent-this.topCurrent;const{regionWidth:o,regionHeight:l}=this._layoutRegionItem(t,r,a);e.concat(i).forEach(h=>{if(["left","right"].includes(h.layoutOrient)){const d=this.filterRegionsWithID(t,h.layoutBindRegionID[0]);h.setLayoutRect({height:d.getLayoutRect().height}),h.setLayoutStartPosition({y:d.getLayoutStartPoint().y+h.layoutOffsetY+h.layoutPaddingTop}),h.layoutOrient==="right"&&h.setLayoutStartPosition({x:h.getLayoutStartPoint().x+o-r})}else if(["top","bottom"].includes(h.layoutOrient)){const d=this.filterRegionsWithID(t,h.layoutBindRegionID[0]);h.setLayoutRect({width:d.getLayoutRect().width}),h.setLayoutStartPosition({x:d.getLayoutStartPoint().x+h.layoutOffsetX+h.layoutPaddingLeft}),h.layoutOrient==="bottom"&&h.setLayoutStartPosition({y:h.getLayoutStartPoint().y+l-a})}})}layoutAbsoluteItems(t){t.forEach(e=>{e.absoluteLayoutInRect(this._chartLayoutRect)})}filterRegionsWithID(t,e){var i;const n=t.find(r=>r.getModelId()===e);return n||((i=this._onError)!==null&&i!==void 0?i:kh)("can not find target region item, invalid id"),n}getItemComputeLayoutRect(t){return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight,height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom}}_checkAutoIndent(t,e){const i={top:0,left:0,bottom:0,right:0};return t.forEach(n=>{if(!n.getModelVisible()||!n.autoIndent)return;const r=n.layoutOrient==="left"||n.layoutOrient==="right",a=n.getLastComputeOutBounds(),o=this._getOutInLayout(a,n,e);r?(i.top=Math.max(i.top,o.top),i.bottom=Math.max(i.bottom,o.bottom)):(i.left=Math.max(i.left,o.left),i.right=Math.max(i.right,o.right))}),i}_getOutInLayout(t,e,i){const{x:n,y:r}=e.getLayoutStartPoint(),{width:a,height:o}=e.getLayoutRect();return{left:i.left-(n-t.x1),right:n+a+t.x2-i.right,top:i.top-(r-t.y1),bottom:r+o+t.y2-i.bottom}}}lA.type="base";const AJ=["line","area","trail"];function G0(s){return AJ.includes(s)}class kJ extends PB{getStateInfoList(){return this._stateInfoList}constructor(t,e){super(t),this._stateInfoList=[],this._mark=e}_getDefaultStateMap(){return{markUpdateRank:1}}getStateInfo(t){return this._stateInfoList.find(e=>e.stateValue===t)}addStateInfo(t){if(this.getStateInfo(t.stateValue))return;t.level=t.level||0;let e=!0;for(let i=0;i<this._stateInfoList.length;i++){const n=this._stateInfoList[i].level;if(n&&n>t.level){this._stateInfoList.splice(i,0,t),e=!1;break}}e&&this._stateInfoList.push(t)}_clearStateBeforeSet(t){t.datums=null,t.items=null,t.fields=null,t.filter=null}changeStateInfo(t){const e=this.getStateInfo(t.stateValue);if(e){if(t.datums!==void 0&&(this._clearStateBeforeSet(e),e.datums=t.datums,e.datumKeys=t.datumKeys),t.items!==void 0&&(this._clearStateBeforeSet(e),e.items=t.items),t.fields!==void 0)if(this._clearStateBeforeSet(e),t.fields===null)e.fields=t.fields;else{e.fields=e.fields||{};for(const i in t.fields){const n=t.fields[i];e.fields[i]=e.fields[i]||{};const r=e.fields[i];E(n.domain)&&(r.domain=n.domain),E(n.type)&&(r.type=n.type)}}t.filter&&(this._clearStateBeforeSet(e),e.filter=t.filter)}else this.addStateInfo(t)}clearStateInfo(t){t.forEach(e=>{this.getStateInfo(e)&&this.changeStateInfo({stateValue:e,datumKeys:null,datums:null,fields:null,items:null,filter:null,cache:{}})})}checkOneState(t,e,i,n){var r;n=ye(G0)?n:!t.mark||G0(t.mark.markType);let a=!1,o=!1;if(E(i.datums)&&i.datums.length>0)a=this.checkDatumState(i,e,n),o=!0;else if(i.items)a=(r=this.checkItemsState(i,t))!==null&&r!==void 0&&r,o=!0;else if(i.fields)a=this.checkFieldsState(i,e,t,n),o=!0;else if(!a&&i.filter){const l={mark:this._mark,renderNode:t,type:t.mark.markType};a=i.filter(e,l),o=!0}return o?a?"in":"out":"skip"}checkState(t,e){const i=t.getStates().filter(r=>pJ(r)).map(r=>[r,10]),n=!t.mark||G0(t.mark.markType);for(let r=0;r<this._stateInfoList.length;r++){const a=this._stateInfoList[r],o=this.checkOneState(t,e,a,n);o!=="skip"&&o==="in"&&i.push([a.stateValue,a.level])}return i.map(r=>r[0])}checkDatumState(t,e,i){let n=!1;const r=i?e[0]:e;if($(t.datums)){const a=t.datumKeys||Object.keys(t.datums[0]).filter(o=>!o.startsWith(At));n=t.datums.some(o=>i&&$(o==null?void 0:o.items)?a.every(l=>{var h,d;return((d=(h=o==null?void 0:o.items)===null||h===void 0?void 0:h[0])===null||d===void 0?void 0:d[l])===(r==null?void 0:r[l])}):a.every(l=>(o==null?void 0:o[l])===(r==null?void 0:r[l])))}else $t(t.datums)?n=(t.datumKeys||Object.keys(t.datums).filter(a=>!a.startsWith(At))).every(a=>{var o,l;return i?((o=t.datums.items)===null||o===void 0?void 0:o[0][a])===r[a]:((l=t.datums)===null||l===void 0?void 0:l[a])===r[a]}):n=e===t.datums;return n}checkItemsState(t,e){var i;return(i=t.items)===null||i===void 0?void 0:i.includes(e)}checkFieldsState(t,e,i,n){var r;let a=!0;for(const o in t.fields){const l=t.fields[o],h=l.type,d=l.domain,u=n?(r=e[0])===null||r===void 0?void 0:r[o]:e[o];if(qt(h)&&d.length>1){if(this.checkLinearFieldState(d,o,e,i,n)){a=!1;break}a=!0}else{if(!d.some(c=>c===u)){a=!1;break}a=!0}}return a}checkLinearFieldState(t,e,i,n,r){var a;const o=r?(a=i[0])===null||a===void 0?void 0:a[e]:i[e];return o<t[0]||o>t[t.length-1]}updateLayoutState(t){return this._stateMap.markUpdateRank++,this.updateState({markUpdateRank:this._stateMap.markUpdateRank},t)}compileState(t){t.state({callback:(e,i)=>this.checkState(i,e)})}}class Ur extends aA{getDataView(){return this._data}setDataView(t){this._data=t}getLatestData(){var t;return(t=this._data)===null||t===void 0?void 0:t.latestData}constructor(t,e){super(t),this.grammarType=Pa.data,this._data=null,this._data=e}release(){super.release(),this._data=null}updateData(t){const e=this.getProduct(),i=this.getLatestData();return e&&i&&(e.values(i),!t)?this.getCompiler().renderAsync():Promise.resolve()}_compileProduct(){const t=this.getLatestData();P(t)||(P(this.getProduct())?this._initProduct(t):this._product.values(t))}_initProduct(t){const e=this.getVGrammarView();if(!e||!t)return;const i=this.getProductId();this._product=e.data(t).id(i),this._compiledProductId=i}generateProductId(){var t;return`${(t=this.getDataView())===null||t===void 0?void 0:t.name}`}_lookupGrammar(t){var e,i;return(i=(e=this.getCompiler().getVGrammarView())===null||e===void 0?void 0:e.getDataById)===null||i===void 0?void 0:i.call(e,t)}}class wJ extends Ur{constructor(t){super(t),this._mark=t.mark}setCompiledProductId(t){this._compiledProductId=t}generateProductId(){const t=super.generateProductId();return E(t)?t:`${At}_markData_${this._mark.id}`}_compileProduct(){var t;const e=(t=this._data)===null||t===void 0?void 0:t.latestData;P(e)||E(this.getProduct())||this._initProduct(e)}}var MC=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};class TJ extends aA{getSkipTheme(){return this._skipTheme}setSkipTheme(t){this._skipTheme=t}getSupport3d(){return this._support3d}setSupport3d(t){this._support3d=t}getFacet(){return this._facet}setFacet(t){this._facet=t}getInteractive(){return this._interactive}setInteractive(t){this._interactive=t}getZIndex(){return this._zIndex}setZIndex(t){this._zIndex=t}getVisible(){return this._visible}setVisible(t){this._visible=t}getUserId(){return this._userId}setUserId(t){E(t)&&(this._userId=t)}getDataView(){var t;return(t=this._data)===null||t===void 0?void 0:t.getDataView()}setDataView(t,e){P(this._data)&&this.initMarkData(Object.assign(Object.assign({},this._option),{mark:this})),E(e)&&this._data.setCompiledProductId(e),this._data.setDataView(t)}getData(){return this._data}setData(t){this._data=t}hasState(t){return t in this.state.getStateMap()}getState(t){return this.state.getStateMap()[t]}getAnimationConfig(){return this._animationConfig}setAnimationConfig(t){this._animationConfig=t}setSkipBeforeLayouted(t){this._skipBeforeLayouted=t}getSkipBeforeLayouted(){return this._skipBeforeLayouted}getMorph(){return this._morph}setMorph(t){this._morph=t}getMorphKey(){return this._morphKey}setMorphKey(t){this._morphKey=t}getMorphElementKey(){return this._morphElementKey}setMorphElementKey(t){this._morphElementKey=t}getGroupKey(){return this._groupKey}setGroupKey(t){this._groupKey=t}getProgressiveConfig(){return this._progressiveConfig}setProgressiveConfig(t){this._progressiveConfig=t}setCustomizedShapeCallback(t){this._setCustomizedShape=t}setEnableSegments(t){this._enableSegments=t}constructor(t,e,i){super(t),this.grammarType=Pa.mark,this.type=void 0,this.name="mark",this._interactive=!0,this._zIndex=ce.Mark,this._visible=!0,this.stateStyle={},this._unCompileChannel={},this._skipBeforeLayouted=!1,this._morph=!1,this.name=e,this.model=i,this.key=t.key,this.state=new kJ(Object.assign(Object.assign({},t),{stateKeyToSignalName:this.stateKeyToSignalName.bind(this)}),this),this._option.support3d&&this.setSupport3d(!0),this._option.skipTheme&&this.setSkipTheme(!0),this._event=new Hc(i.getOption().eventDispatcher,i.getOption().mode)}setTransform(t){this._transform=t}initMarkData(t){this._data=new wJ(t)}stateKeyToSignalName(t){return`${At}_${this.type}_${this.id}_${t}`}getAttribute(t,e,i,n){}_compileProduct(t){const e=this.getProduct();if(!this.getVisible())return void(E(e)&&this.removeProduct());E(e)||this.getCompiler().isInited&&(this._initProduct(t==null?void 0:t.group),P(this._product)||(this.compileSignal(),this.compileData(),this.compileState(),this.compileEncode(),this.compileAnimation(),this.compileContext(),this.compileTransform()))}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.mark(this.type,t??e.rootMark).id(i),this._compiledProductId=i}generateProductId(){return this._userId?`${this._userId}`:`${this.name}_${this.id}`}compileData(){var t;if(P(this._data))return;this._data.compile();const e=this._data.getProduct();E(this._product)&&E(e)&&this._product.join(e,this.key,void 0,(t=this._groupKey)!==null&&t!==void 0?t:this._facet)}updateStaticEncode(){if(!this._product)return;const{enterStyles:t,updateStyles:e}=this._separateStyle();this._product.encodeState("group",t,!0),this._product.encode(e,!0)}_separateStyle(){const t=this.stateStyle,e=bt.STATE_NORMAL,i=t[e],n=(MC(t,[typeof e=="symbol"?e:e+""]),this._option.noSeparateStyle?null:{}),r={};return Object.keys(i).forEach(a=>{this._unCompileChannel[a]||(this._option.noSeparateStyle||uJ(a,i,this.getFacet())?r[a]={callback:this.compileCommonAttributeCallback(a,"normal"),dependency:[this.stateKeyToSignalName("markUpdateRank")]}:n[a]=this.compileCommonAttributeCallback(a,"normal"))}),{enterStyles:n,updateStyles:r}}compileEncode(){const t=this.stateStyle,e=bt.STATE_NORMAL,i=(t[e],MC(t,[typeof e=="symbol"?e:e+""])),{enterStyles:n,updateStyles:r}=this._separateStyle();this._product.encode(r,!0),this._product.encodeState("group",n,!0),Object.keys(i).forEach(a=>{const o={};Object.keys(i[a]).forEach(l=>{this._unCompileChannel[l]||(o[l]={callback:this.compileCommonAttributeCallback(l,a),dependency:[this.stateKeyToSignalName("markUpdateRank")]})}),this._product.encodeState(a,o,!0)}),this._skipBeforeLayouted&&this._product.layout({skipBeforeLayouted:this._skipBeforeLayouted})}compileState(){this.state.compileState(this._product)}compileAnimation(){var t,e;if(this._animationConfig){let i;this.type==="component"?i=(t=this.model.animate)===null||t===void 0?void 0:t.getAnimationStateSignalName():i=(e=this.model.getRegion().animate)===null||e===void 0?void 0:e.getAnimationStateSignalName(),this._product.animation(this._animationConfig),this._product.animationState({callback:(n,r,a)=>{var o;return(o=a[i])===null||o===void 0?void 0:o.callback(n,r)},dependency:i}),this._animationConfig.normal&&this._event.on(gt.ANIMATION_END,({event:n})=>{n.mark===this.getProduct()&&n.animationState===ci.appear&&this.runAnimationByState(ci.normal)})}}compileContext(){const t={interactive:this.getInteractive(),zIndex:this.getZIndex(),context:{markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId},skipTheme:this.getSkipTheme(),support3d:this.getSupport3d(),enableSegments:!!this._enableSegments};this._progressiveConfig&&(t.progressiveStep=this._progressiveConfig.progressiveStep,t.progressiveThreshold=this._progressiveConfig.progressiveThreshold,t.large=this._progressiveConfig.large,t.largeThreshold=this._progressiveConfig.largeThreshold),this._morph&&this._morphKey&&(t.morph=this._morph,t.morphKey=this._morphKey,t.morphElementKey=this._morphElementKey),this._setCustomizedShape&&(t.setCustomizedShape=this._setCustomizedShape),this._product.configure(t)}compileSignal(){this.state.compile()}_computeAttribute(t,e){return(i,n)=>{}}compileCommonAttributeCallback(t,e){const i=this._computeAttribute(t,e),n={mark:null,parent:null,element:null};return(r,a)=>(n.mark=a.mark,n.parent=a.mark.group,n.element=a,i(r,n))}compileTransform(){var t;!((t=this._transform)===null||t===void 0)&&t.length&&this.getProduct().transform(this._transform)}_lookupGrammar(t){var e;return(e=this.getCompiler().getVGrammarView())===null||e===void 0?void 0:e.getMarkById(t)}updateState(t,e){return this.state.updateState(t,e)}updateLayoutState(t,e){return e&&this.getMarks().length>0&&this.getMarks().forEach(i=>i.state.updateLayoutState(!0)),this.state.updateLayoutState(t)}updateMarkState(t){if(!this._product)return;const e=this.state.getStateInfo(t);this._product.elements.forEach(i=>{this.state.checkOneState(i,i.getDatum(),e)==="in"?i.addState(t):i.removeState(t)})}getMarks(){return[]}runAnimationByState(t){var e,i;return(i=(e=this.getProduct())===null||e===void 0?void 0:e.animate)===null||i===void 0?void 0:i.runAnimationByState(t)}stopAnimationByState(t){var e,i;return(i=(e=this.getProduct())===null||e===void 0?void 0:e.animate)===null||i===void 0?void 0:i.stopAnimationByState(t)}pauseAnimationByState(t){var e,i;return(i=(e=this.getProduct())===null||e===void 0?void 0:e.animate)===null||i===void 0?void 0:i.pauseAnimationByState(t)}resumeAnimationByState(t){var e,i;return(i=(e=this.getProduct())===null||e===void 0?void 0:e.animate)===null||i===void 0?void 0:i.resumeAnimationByState(t)}release(){super.release(),this.state.release()}}var CC=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};class Hi extends TJ{constructor(t,e){var i;super(e,t,e.model),this._extensionChannel={},this._computeExChannel={},this._attributeContext=e.attributeContext,(i=e.map)===null||i===void 0||i.set(this.id,this)}created(){this._initStyle()}initStyleWithSpec(t,e){t&&(E(t.id)&&(this._userId=t.id),ye(t.interactive)&&(this._interactive=t.interactive),E(t.zIndex)&&this.setZIndex(t.zIndex),ye(t.visible)&&this.setVisible(t.visible),this._initSpecStyle(t,this.stateStyle,e))}convertAngleToRadian(t){if(dt(t))return ue(t);if(t.scale){const e=t.scale.range();return t.scale.range(e.map(ue)),t}return typeof t=="function"?(e,i,n,r)=>ue(t(e,i,n,r)):t}isUserLevel(t){return[tt.User_Mark,tt.User_Series,tt.User_Chart].includes(t)}setStyle(t,e="normal",i=0,n=this.stateStyle){if(P(t))return;t=this._filterStyle(t,e,i,n),n[e]===void 0&&(n[e]={});const r=this.isUserLevel(i);Object.keys(t).forEach(a=>{let o=t[a];P(o)||(o=this._filterAttribute(a,o,e,i,r,n),this.setAttribute(a,o,e,i,n))})}getStyle(t,e="normal"){var i;return(i=this.stateStyle[e][t])===null||i===void 0?void 0:i.style}_filterStyle(t,e,i,n=this.stateStyle){return t}_filterAttribute(t,e,i,n,r,a=this.stateStyle){let o=this._styleConvert(e);return r&&t==="angle"&&(o=this.convertAngleToRadian(o)),o}setReferer(t,e,i,n=this.stateStyle){var r;if(t)if(e&&i){const a=(r=n[i])!==null&&r!==void 0?r:{[e]:{}};n[i][e]=Object.assign(Object.assign({},a[e]),{referer:t})}else Object.entries(n).forEach(([a,o])=>{Object.entries(o).forEach(([l,h])=>{n[a][l].referer=t})})}setPostProcess(t,e,i="normal"){var n;!((n=this.stateStyle[i])===null||n===void 0)&&n[t]&&(this.stateStyle[i][t].postProcess=e)}getAttribute(t,e,i="normal",n){return this._computeAttribute(t,i)(e,n)}setAttribute(t,e,i="normal",n=0,r=this.stateStyle){var a;r[i]===void 0&&(r[i]={}),r[i][t]===void 0&&(r[i][t]={level:n,style:e,referer:void 0});const o=(a=r[i][t])===null||a===void 0?void 0:a.level;E(o)&&o<=n&&yt(r[i][t],{style:e,level:n}),i!=="normal"&&t in this._extensionChannel&&this._extensionChannel[t].forEach(l=>{r[i][l]===void 0&&(r[i][l]=r.normal[l])})}_getDefaultStyle(){return{visible:!0,x:0,y:0}}_styleConvert(t){if(!t)return t;if(kb(t.type)||t.scale){const e=_q(t,{globalScale:this._option.globalScale,seriesId:this._option.seriesId});if(e)return{scale:e,field:t.field,changeDomain:t.changeDomain}}return t}_computeAttribute(t,e){var i;let n=(i=this.stateStyle[e])===null||i===void 0?void 0:i[t];n||(n=this.stateStyle.normal[t]);const r=this._computeStateAttribute(n,t,e),a=K(n==null?void 0:n.postProcess),o=t in this._computeExChannel;if(a&&o){const l=this._computeExChannel[t];return(h,d)=>{let u=r(h,d);return u=n.postProcess(u,h,this._attributeContext,d,this.getDataView()),l(t,h,e,d,u)}}if(a)return(l,h)=>n.postProcess(r(l,h),l,this._attributeContext,h,this.getDataView());if(o){const l=this._computeExChannel[t];return(h,d)=>l(t,h,e,d,r(h,d))}return r}_computeStateAttribute(t,e,i){var n;return t?t.referer?t.referer._computeAttribute(e,i):typeof t.style=="function"?(r,a)=>t.style(r,this._attributeContext,a,this.getDataView()):cC.includes(t.style.gradient)?this._computeGradientAttr(t.style):["outerBorder","innerBorder"].includes(e)?this._computeBorderAttr(t.style):kb((n=t.style.scale)===null||n===void 0?void 0:n.type)?(r,a)=>t.style.scale.scale(r[t.style.field]):(r,a)=>t.style:(r,a)=>{}}_initStyle(){const t=this._getDefaultStyle();this.setStyle(t,"normal",0)}_initSpecStyle(t,e,i){t.style&&this.setStyle(t.style,"normal",tt.User_Mark,e);const n=t.state;n&&Object.keys(n).forEach(r=>{const a=n[r];if("style"in a){const o=a.style;let l={stateValue:r};"level"in a&&(l.level=a.level),"filter"in a&&(l=K(a.filter)?Object.assign({filter:a.filter},l):Object.assign(Object.assign({},a.filter),l)),this.state.addStateInfo(l),this.setStyle(o,r,tt.User_Mark,e)}else this.setStyle(a,r,tt.User_Mark,e)})}_computeGradientAttr(t){var e,i;const{gradient:n,scale:r,field:a}=t,o=CC(t,["gradient","scale","field"]);let l=r,h=a;if(!(r&&a||this.model.modelType!=="series")){const{scale:c,field:p}=this.model.getColorAttribute();r||(l=c),h||(h=p)}const d=px(Yu(this.model.getColorScheme(),this.model.modelType==="series"?(i=(e=this.model).getSpec)===null||i===void 0?void 0:i.call(e):void 0),this.model.getDefaultColorDomain()),u=Object.assign(Object.assign({},hq[n]),o);return(c,p)=>{const g={},f=this.getDataView();return Object.keys(u).forEach(_=>{const m=u[_];_==="stops"?g.stops=m.map(v=>{const{opacity:y,color:b,offset:x}=v;let S=b??(l==null?void 0:l.scale(c[h]));return K(b)&&(S=b(c,this._attributeContext,p,f)),E(y)&&(S=Qe.SetOpacity(S,y)),{offset:K(x)?x(c,this._attributeContext,p,f):x,color:S||d[0]}}):K(m)?g[_]=m(c,this._attributeContext,p,f):g[_]=m}),g.gradient=n,g}}_computeBorderAttr(t){const{scale:e,field:i}=t,n=CC(t,["scale","field"]);return(r,a)=>{var o,l,h;const d={};if(Object.keys(n).forEach(u=>{const c=n[u];K(c)?d[u]=c(r,this._attributeContext,a,this.getDataView()):d[u]=c}),"stroke"in d)cC.includes((h=n.stroke)===null||h===void 0?void 0:h.gradient)&&(d.stroke=this._computeGradientAttr(n.stroke)(r,a));else{const u=px(Yu(this.model.getColorScheme(),this.model.modelType==="series"?(l=(o=this.model).getSpec)===null||l===void 0?void 0:l.call(o):void 0),this.model.getDefaultColorDomain());let c=e,p=i;if(!(e&&i||this.model.modelType!=="series")){const{scale:g,field:f}=this.model.getColorAttribute();e||(c=g),p||(p=f),d.stroke=(c==null?void 0:c.scale(r[p]))||u[0]}}return d}}}class Xu extends Hi{constructor(){super(...arguments),this.type=Xu.type,this._marks=[]}getMarks(){return this._marks}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{clip:!1})}isMarkExist(t){return this._marks.find(e=>e.id===t.id||e.name===t.name)!==void 0}addMark(t){return this.isMarkExist(t)?(Na("Mark already exists, add mark failed."),!1):(this._marks.push(t),!0)}removeMark(t){const e=this._marks.findIndex(i=>i.id===t.id||i.name===t.name);return e===-1?(Na("Mark does not exists, removeMark failed."),!1):(this._marks.splice(e,1),!0)}getMarkInType(t){return this._marks.filter(e=>e.type===t)}getMarkInId(t){return this._marks.find(e=>e.id===t)}getMarkInName(t){return this._marks.find(e=>e.name===t)}_compileProduct(t){super._compileProduct(t),this._product.configure({zIndex:this.getZIndex()}),t!=null&&t.ignoreChildren||this.getMarks().forEach(e=>{e.getProduct()&&e.removeProduct(),e.compile({group:this._product})})}}Xu.type="group";const MJ=()=>{qX(),F.registerMark(Xu.type,Xu)},CJ={type:"clipIn"},PJ={type:"fadeIn"},EJ=s=>({type:s.direction==="horizontal"?"growPointsXIn":"growPointsYIn",options:{orient:s.direction==="horizontal"?"positive":"negative"}});function RJ(s,t){switch(t){case"grow":return EJ(s);case"fadeIn":return PJ;default:return CJ}}const ba={appear:{duration:1e3,easing:"cubicOut"},update:{type:"update",duration:300,easing:"linear"},enter:{duration:300,easing:"linear"},exit:{duration:300,easing:"linear"},disappear:{duration:500,easing:"cubicIn"}},hA={appear:{type:"scaleIn"},enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:{type:"scaleOut"}},tv={appear:{type:"fadeIn"},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}},ev=()=>{F.registerAnimation("scaleInOut",()=>hA)},$r=()=>{F.registerAnimation("fadeInOut",()=>tv)},OJ=()=>{F.registerAnimation("cartesianGroupClip",s=>({appear:{custom:_k,customParameters:(t,e)=>({animationType:"in",group:e.getGraphicItem(),direction:s.direction(),width:s.width(),height:s.height(),orient:s.orient()})},disappear:{custom:_k,customParameters:(t,e)=>({animationType:"out",group:e.getGraphicItem(),direction:s.direction(),width:s.width(),height:s.height(),orient:s.orient()})}}))},DB=()=>{F.registerAnimation("line",(s,t)=>({appear:RJ(s,t),enter:{type:"fadeIn"},exit:{type:"fadeOut"},update:[{type:"update",options:{excludeChannels:["points","defined"]}},{channel:["points"],custom:VR,duration:ba.update.duration,easing:ba.update.easing}],disappear:{type:"clipOut"}}))},IJ=()=>{Vo.useRegisters([JK,QK,LK,BK,qK,ZK,tq,eq,iq])},FB=()=>{Vo.useRegisters([jK,zK,HK,NK,DK,FK])},dA=()=>{Vo.useRegisters([XK,KK,$K,YK])},jB=()=>{Vo.useRegisters([wL,TL,GK,WK,VK,UK,OK,IK])},zB=()=>{Vo.useRegisters([wL,TL])},LJ={measureText:BZ};class Ls{static instance(){return Ls.instance_||(Ls.instance_=new Ls),Ls.instance_}constructor(){this.functions={}}registerFunction(t,e){t&&e&&(this.functions[t]=e)}unregisterFunction(t){t&&delete this.functions[t]}getFunction(t){return this.functions[t]||null}getFunctionNameList(){return Object.keys(this.functions)}}const BJ=()=>{zf(Pt)},DJ=()=>{Gf(Pt)};class HB{constructor(){this.id=No(),this._plugins=[]}add(t){if(!t||t.length===0)return null;const e=[];return t.forEach(i=>{this._plugins.find(n=>n.id===i.id)?Na("不要重复添加相同的plugin"):(this._plugins.push(i),e.push(i),i.onAdd&&i.onAdd(this))}),e}load(t){const e=this.add(t);e&&e.length&&this.activate(t)}activate(t){t.length&&t.forEach(e=>{e.init&&e.init()})}get(t){return this._plugins.find(e=>e.id===t)}getAll(){return this._plugins.slice()}dispose(t){const e=this._plugins.find(i=>i.id===t);e&&e.dispose&&e.dispose(this)}disposeAll(){this._plugins.forEach(t=>{t.dispose&&t.dispose(this)})}}class FJ extends HB{constructor(t){super(),this.globalInstance=t}onInit(t){this._plugins.forEach(e=>{e.onInit&&e.onInit(this,t)})}onBeforeResize(t,e){this._plugins.forEach(i=>{i.onBeforeResize&&i.onBeforeResize(this,t,e)})}onAfterChartSpecTransform(t,e){this._plugins.forEach(i=>{i.onAfterChartSpecTransform&&i.onAfterChartSpecTransform(this,t,e)})}onBeforeInitChart(t,e){this._plugins.forEach(i=>{i.onBeforeInitChart&&i.onBeforeInitChart(this,t,e)})}}var yn=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})},jJ=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};let an=class xg{static useRegisters(t){t.forEach(e=>{typeof e=="function"?e():console.error("Invalid function:",e)})}static useChart(t){t.forEach(e=>F.registerChart(e.type,e))}static useSeries(t){t.forEach(e=>F.registerSeries(e.type,e))}static useComponent(t){t.forEach(e=>F.registerComponent(e.type,e))}static useMark(t){t.forEach(e=>{var i;return F.registerMark((i=e.constructorType)!==null&&i!==void 0?i:e.type,e)})}static useLayout(t){t.forEach(e=>F.registerLayout(e.type,e))}static registerDataSetTransform(t,e){F.registerTransform(t,e)}static registerFunction(t,e){t&&e&&Ls.instance().registerFunction(t,e)}static unregisterFunction(t){t&&Ls.instance().unregisterFunction(t)}static getFunction(t){return t?Ls.instance().getFunction(t):null}static getFunctionList(){return Ls.instance().getFunctionNameList()}static registerMap(t,e,i){const n=F.getImplementInKey("registerMap");n&&n(t,e,i)}static unregisterMap(t){const e=F.getImplementInKey("unregisterMap");e&&e(t)}static getMap(t){return eJ(t)}static hideTooltip(t=[]){tn.forEach(e=>{var i;return(i=e==null?void 0:e.hideTooltip)===null||i===void 0?void 0:i.call(e)},t)}static getLogger(){return Nt.getInstance()}getSpec(){return this._spec}getSpecInfo(){return this._specInfo}getDataSet(){return this._dataSet}constructor(t,e){var i,n,r,a,o,l,h;this.id=No(),this._userEvents=[],this._autoSize=!0,this._option={mode:ri["desktop-browser"],onError:v=>{throw new Error(v)},optimize:{disableCheckGraphicWidthOutRange:!0}},this._observer=null,this._context={},this._onResize=lr((...v)=>{this._doResize()},100),this._option=lt(this._option,{animation:t.animation!==!1},e),this._onError=(i=this._option)===null||i===void 0?void 0:i.onError;const d=this._option,{dom:u,renderCanvas:c,mode:p,stage:g,poptip:f}=d,_=jJ(d,["dom","renderCanvas","mode","stage","poptip"]),m=rn(p);m&&u&&(this._container=ht(u)?document==null?void 0:document.getElementById(u):u),c&&(this._canvas=c),g&&(this._stage=g),p==="node"||this._container||this._canvas||this._stage?(m?BJ():p==="node"&&DJ(),this._viewBox=this._option.viewBox,this._currentThemeName=us.getCurrentThemeName(),this._setNewSpec(t),this._updateCurrentTheme(),this._currentSize=this.getCurrentSize(),this._compiler=new rJ({dom:(r=this._container)!==null&&r!==void 0?r:"none",canvas:c},Object.assign(Object.assign({mode:this._option.mode,stage:g,pluginList:f!==!1?["poptipForText"]:[]},_),{background:this._getBackground(),onError:this._onError})),this._compiler.setSize(this._currentSize.width,this._currentSize.height),this._eventDispatcher=new ZZ(this,this._compiler),this._event=new Hc(this._eventDispatcher,p),this._compiler.initView(),(a=this.getStage())===null||a===void 0||a.setTheme({text:{fontFamily:(o=this._currentTheme)===null||o===void 0?void 0:o.fontFamily}}),this._initDataSet(this._option.dataSet),this._autoSize=!!m&&((h=(l=t.autoFit)!==null&&l!==void 0?l:this._option.autoFit)===null||h===void 0||h),this._bindResizeEvent(),this._bindVGrammarViewEvent(),this._initChartPlugin(),tn.registerInstance(this)):(n=this._option)===null||n===void 0||n.onError("please specify container or renderCanvas!")}_setNewSpec(t,e){return!!t&&(ht(t)&&(t=JSON.parse(t)),e&&this._originalSpec&&(t=yt({},this._originalSpec,t)),this._originalSpec=t,this._spec=this._getSpecFromOriginalSpec(),!0)}_getSpecFromOriginalSpec(){var t;const e=yx(this._originalSpec);return e.data=(t=e.data)!==null&&t!==void 0?t:[],e}_initChartSpec(t,e){var i;xg.getFunctionList()&&xg.getFunctionList().length&&(t=bx(t,xg)),this._spec=t,this._chartSpecTransformer||(this._chartSpecTransformer=F.createChartSpecTransformer(this._spec.type,{type:this._spec.type,getTheme:()=>{var n;return(n=this._currentTheme)!==null&&n!==void 0?n:{}},animation:this._option.animation})),this._chartSpecTransformer.transformSpec(this._spec),this._chartPluginApply("onAfterChartSpecTransform",this._spec,e),this._specInfo=(i=this._chartSpecTransformer)===null||i===void 0?void 0:i.transformModelSpec(this._spec),this._chartPluginApply("onAfterModelSpecTransform",this._spec,this._specInfo,e)}_updateSpecInfo(){var t;this._chartSpecTransformer||(this._chartSpecTransformer=F.createChartSpecTransformer(this._spec.type,{type:this._spec.type,getTheme:()=>{var e;return(e=this._currentTheme)!==null&&e!==void 0?e:{}}})),this._specInfo=(t=this._chartSpecTransformer)===null||t===void 0?void 0:t.createSpecInfo(this._spec)}_initChart(t){var e,i;if(!this._compiler)return void((e=this._option)===null||e===void 0||e.onError("compiler is not initialized"));const n=F.createChart(t.type,t,{type:t.type,globalInstance:this,eventDispatcher:this._eventDispatcher,dataSet:this._dataSet,container:this._container,canvas:this._canvas,map:new Map,mode:this._option.mode||ri["desktop-browser"],modeParams:this._option.modeParams,getCompiler:()=>this._compiler,performanceHook:this._option.performanceHook,viewBox:this._viewBox,animation:this._option.animation,getTheme:()=>{var r;return(r=this._currentTheme)!==null&&r!==void 0?r:{}},getSpecInfo:()=>{var r;return(r=this._specInfo)!==null&&r!==void 0?r:{}},layout:this._option.layout,onError:this._onError,disableTriggerEvent:this._option.disableTriggerEvent===!0});n?(this._chart=n,this._chart.setCanvasRect(this._currentSize.width,this._currentSize.height),this._chart.created(),this._chart.init(),this._event.emit(St.initialized,{})):(i=this._option)===null||i===void 0||i.onError("init chart fail")}_releaseData(){this._dataSet&&(this._dataSet.dataViewMap={},this._dataSet=null)}_bindVGrammarViewEvent(){this._compiler&&!this._compiler.isReleased&&(this._compiler.getVGrammarView().addEventListener(gt.ALL_ANIMATION_END,()=>{this._event.emit(St.animationFinished,{})}),this._compiler.getVGrammarView().addEventListener(gt.AFTER_VRENDER_NEXT_RENDER,()=>{this._event.emit(St.renderFinished,{})}))}_bindResizeEvent(){var t;if(this._autoSize){if(this._container){const e=window.ResizeObserver;this._observer=new e(this._onResize),(t=this._observer)===null||t===void 0||t.observe(this._container)}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this._autoSize&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}getCurrentSize(){var t,e,i,n;return TB(this._spec,{container:this._container,canvas:this._canvas,mode:this._option.mode||ri["desktop-browser"],modeParams:this._option.modeParams},{width:(e=(t=this._currentSize)===null||t===void 0?void 0:t.width)!==null&&e!==void 0?e:Al,height:(n=(i=this._currentSize)===null||i===void 0?void 0:i.height)!==null&&n!==void 0?n:kl})}_doResize(){const{width:t,height:e}=this.getCurrentSize();this._currentSize.width===t&&this._currentSize.height===e||(this._currentSize={width:t,height:e},this.resize(t,e))}_initDataSet(t){this._dataSet=t instanceof ko?t:new ko,Lr(this._dataSet,"dataview",rm),Lr(this._dataSet,"array",QF),Ct(this._dataSet,"stackSplit",iJ),Ct(this._dataSet,"copyDataView",Km);for(const e in F.transforms)Ct(this._dataSet,e,F.transforms[e]);for(const e in F.dataParser)Lr(this._dataSet,e,F.dataParser[e])}updateCustomConfigAndRerender(t,e,i={}){if(!this._isReleased&&t)return K(t)&&(t=t()),this._reCompile(t),e?this._renderSync(i):this._renderAsync(i)}_updateCustomConfigAndRecompile(t,e={}){return!!t&&(this._reCompile(t),this._beforeRender(e))}_reCompile(t,e){var i,n,r,a,o,l,h;if(t.reMake)this._releaseData(),this._initDataSet(),this._chartSpecTransformer=null,this._chart.release(),this._chart=null,(i=this._compiler)===null||i===void 0||i.releaseGrammar(((n=this._option)===null||n===void 0?void 0:n.animation)===!1||((r=this._spec)===null||r===void 0?void 0:r.animation)===!1),this._userEvents.forEach(d=>{var u;return(u=this._event)===null||u===void 0?void 0:u.on(d.eType,d.query,d.handler)}),t.reSize&&this._doResize();else if(t.reCompile&&((a=this._compiler)===null||a===void 0||a.clear({chart:this._chart,vChart:this},!this._option.animation||!this._spec.animation),(o=this._compiler)===null||o===void 0||o.compile({chart:this._chart,vChart:this},{})),t.reSize){const{width:d,height:u}=this.getCurrentSize();this._chart.onResize(d,u,!1),(h=(l=this._compiler).resize)===null||h===void 0||h.call(l,d,u,!1)}}_beforeRender(t={}){var e,i,n,r,a,o,l,h;if(this._isReleased)return!1;if(this._chart)return!0;const{transformSpec:d,actionSource:u}=t;return d&&this._initChartSpec(this._spec,"render"),this._chartPluginApply("onBeforeInitChart",this._spec,u),(i=(e=this._option.performanceHook)===null||e===void 0?void 0:e.beforeInitializeChart)===null||i===void 0||i.call(e),this._initChart(this._spec),(r=(n=this._option.performanceHook)===null||n===void 0?void 0:n.afterInitializeChart)===null||r===void 0||r.call(n),!(!this._chart||!this._compiler)&&((o=(a=this._option.performanceHook)===null||a===void 0?void 0:a.beforeCompileToVGrammar)===null||o===void 0||o.call(a),this._compiler.compile({chart:this._chart,vChart:this},{performanceHook:this._option.performanceHook}),(h=(l=this._option.performanceHook)===null||l===void 0?void 0:l.afterCompileToVGrammar)===null||h===void 0||h.call(l),!0)}_afterRender(){return!this._isReleased&&(this._updateAnimateState(),this._event.emit(St.rendered,{}),!0)}renderSync(t){return this._renderSync({morphConfig:t,transformSpec:!0,actionSource:"render"})}renderAsync(t){return yn(this,void 0,void 0,function*(){return this._renderAsync({morphConfig:t,transformSpec:!0,actionSource:"render"})})}_renderSync(t={}){var e;const i=this;return this._beforeRender(t)&&((e=this._compiler)===null||e===void 0||e.renderSync(t.morphConfig),this._afterRender()),i}_renderAsync(t={}){var e;return yn(this,void 0,void 0,function*(){const i=this;return this._beforeRender(t)&&(yield(e=this._compiler)===null||e===void 0?void 0:e.renderAsync(t.morphConfig),this._afterRender()),i})}_updateAnimateState(){var t,e;this._option.animation&&((t=this._chart)===null||t===void 0||t.getAllRegions().forEach(i=>{var n;(n=i.animate)===null||n===void 0||n.updateAnimateState(ci.update,!0)}),(e=this._chart)===null||e===void 0||e.getAllComponents().forEach(i=>{var n;(n=i.animate)===null||n===void 0||n.updateAnimateState(ci.update,!0)}))}release(){var t,e,i,n;!((t=this._onResize)===null||t===void 0)&&t.cancel&&this._onResize.cancel(),this._chartPluginApply("disposeAll"),this._chartSpecTransformer=null,(e=this._chart)===null||e===void 0||e.release(),(i=this._compiler)===null||i===void 0||i.release(),(n=this._eventDispatcher)===null||n===void 0||n.release(),this._unBindResizeEvent(),this._releaseData(),this._chart=null,this._compiler=null,this._spec=null,this._originalSpec=null,this._userEvents=null,this._event=null,this._eventDispatcher=null,this._isReleased=!0,tn.unregisterInstance(this)}updateData(t,e,i){return yn(this,void 0,void 0,function*(){if(P(this._dataSet))return this;if(this._chart)return this._chart.updateData(t,e,!0,i),yield this._compiler.renderAsync(),this;this._spec.data=Y(this._spec.data);const n=this._spec.data.find(r=>r.name===t||r.id===t);return n?n.id===t?n.values=e:n.name===t&&n.parse(e,i):$(e)?this._spec.data.push({id:t,values:e}):this._spec.data.push(e),this})}updateDataInBatches(t){return yn(this,void 0,void 0,function*(){return this._chart?(this._chart.updateFullData(t.map(({id:e,data:i,options:n})=>({id:e,values:i,parser:n}))),this._chart.updateGlobalScaleDomain(),yield this._compiler.renderAsync(),this):(t.forEach(({id:e,data:i,options:n})=>{const r=this._spec.data.find(a=>a.name===e);if(r)r.parse(i,n);else{const a=new Jt(this._dataSet,{name:e});a.parse(i,n),this._spec.data.push(a)}}),this)})}updateDataSync(t,e,i){if(P(this._dataSet))return this;if(this._chart)return this._chart.updateData(t,e,!0,i),this._compiler.renderSync(),this;const n=this._spec.data.find(r=>r.name===t);if(n)n.parse(e,i);else{const r=new Jt(this._dataSet,{name:t});r.parse(e,i),this._spec.data.push(r)}return this}updateFullDataSync(t,e=!0){return this._chart?(this._chart.updateFullData(t),e&&this._compiler.renderSync(),this):(Y(t).forEach(i=>{var n;const{id:r,values:a,parser:o,fields:l}=i,h=this._spec.data.find(d=>d.name===r);if(h)h.setFields(bi(l)),h.parse(a,bi(o));else{const d=v_(i,this._dataSet,this._spec.data,{onError:(n=this._option)===null||n===void 0?void 0:n.onError});this._spec.data.push(d)}}),this)}updateFullData(t,e=!0){return yn(this,void 0,void 0,function*(){return this._chart?(this._chart.updateFullData(t),e&&(yield this._compiler.renderAsync()),this):(Y(t).forEach(i=>{var n;const{id:r,values:a,parser:o,fields:l}=i,h=this._spec.data.find(d=>d.name===r);if(h)h.setFields(bi(l)),h.parse(a,bi(o));else{const d=v_(i,this._dataSet,this._spec.data,{onError:(n=this._option)===null||n===void 0?void 0:n.onError});this._spec.data.push(d)}}),this)})}updateSpec(t,e=!1,i){return yn(this,void 0,void 0,function*(){const n=this._updateSpec(t,e);return yield this.updateCustomConfigAndRerender(n,!1,{morphConfig:i,transformSpec:!0,actionSource:"updateSpec"}),this})}updateSpecSync(t,e=!1,i){const n=this._updateSpec(t,e);return this.updateCustomConfigAndRerender(n,!0,{morphConfig:i,transformSpec:!0,actionSource:"updateSpec"}),this}updateSpecAndRecompile(t,e=!1,i={}){const n=this._updateSpec(t,e);return this._updateCustomConfigAndRecompile(n,Object.assign({actionSource:"updateSpecAndRecompile"},i))}_updateSpec(t,e=!1){var i,n;const r=this._spec;if(!this._setNewSpec(t,e))return;Se(r.theme,this._spec.theme)||this._setCurrentTheme();const a=this._shouldChartResize(r);return(n=(i=this._compiler)===null||i===void 0?void 0:i.getVGrammarView())===null||n===void 0||n.updateLayoutTag(),cl(this._chart.updateSpec(this._spec),{change:a,reMake:!1,reCompile:!1,reSize:a})}updateModelSpec(t,e,i=!1,n){return yn(this,void 0,void 0,function*(){if(!e||!this._spec)return this;if(ht(e)&&(e=JSON.parse(e)),K(t)||SC(this._spec,t,e,i),this._chart){const r=this._chart.getModelInFilter(t);if(r)return this._updateModelSpec(r,e,!1,i,n)}return this})}updateModelSpecSync(t,e,i=!1,n){if(!e||!this._spec)return this;if(ht(e)&&(e=JSON.parse(e)),K(t)||SC(this._spec,t,e,i),this._chart){const r=this._chart.getModelInFilter(t);if(r)return this._updateModelSpec(r,e,!0,i,n)}return this}_updateModelSpec(t,e,i=!1,n=!1,r){n&&(e=yt({},t.getSpec(),e));const a=t.updateSpec(e);return t.reInit(e),(a.change||a.reCompile||a.reMake||a.reSize||a.reRender)&&this._chart.reDataFlow(),this.updateCustomConfigAndRerender(a,i,{morphConfig:r,transformSpec:!1,actionSource:"updateModelSpec"})}resize(t,e){var i,n,r,a,o,l;return yn(this,void 0,void 0,function*(){if(!this._chart||!this._compiler)return this;const h=this._chart.getCanvasRect();return h&&h.width===t&&h.height===e?this:(this._chartPluginApply("onBeforeResize",t,e),(n=(i=this._option.performanceHook)===null||i===void 0?void 0:i.beforeResizeWithUpdate)===null||n===void 0||n.call(i),this._chart.onResize(t,e,!1),(a=(r=this._option.performanceHook)===null||r===void 0?void 0:r.afterResizeWithUpdate)===null||a===void 0||a.call(r),yield(l=(o=this._compiler).resize)===null||l===void 0?void 0:l.call(o,t,e),this._isReleased||this._event.emit(St.afterResize,{chart:this._chart}),this)})}updateViewBox(t,e=!0,i=!0){return this._chart&&this._compiler?(this._viewBox=t,this._chart.updateViewBox(t,i),i&&(this._compiler.renderSync(),this._chart.onEvaluateEnd()),this._compiler.updateViewBox(t,e),this):this}on(t,e,i){var n;this._userEvents&&(this._userEvents.push({eType:t,query:typeof e=="function"?null:e,handler:typeof e=="function"?e:i}),(n=this._event)===null||n===void 0||n.on(t,e,i))}off(t,e){var i;if(this._userEvents&&this._userEvents.length!==0)if(e){const n=this._userEvents.findIndex(r=>r.eType===t&&r.handler===e);n>=0&&(this._userEvents.splice(n,1),(i=this._event)===null||i===void 0||i.off(t,e))}else this._userEvents.forEach(n=>{var r;n.eType===t&&((r=this._event)===null||r===void 0||r.off(t,n.handler))}),this._userEvents=this._userEvents.filter(n=>n.eType!==t)}updateState(t,e){this._chart&&this._chart.updateState(t,e)}setSelected(t,e,i){this._chart&&this._chart.setSelected(t,e,i)}setHovered(t,e,i){this._chart&&this._chart.setHovered(t,e,i)}_updateCurrentTheme(t){var e,i;const n=this._option.theme,r=(e=this._spec)===null||e===void 0?void 0:e.theme;if(t&&(this._currentThemeName=t),vt(n)&&vt(r))this._currentTheme=ta(this._currentThemeName,!0);else if(ht(n)&&(!r||ht(r))||ht(r)&&(!n||ht(n))){const a=mx({},ta(this._currentThemeName,!0),ta(n,!0),ta(r,!0));this._currentTheme=a}else{const a=mx({},ta(this._currentThemeName),ta(n),ta(r));this._currentTheme=Xm(a,a.colorScheme)}wY(It(this._currentTheme,"component.poptip")),(i=this._compiler)===null||i===void 0||i.setBackground(this._getBackground())}_shouldChartResize(t){var e,i;let n=!1;P(this._spec.width)?this._spec.width=t.width:this._spec.width!==t.width&&(n=!0),P(this._spec.height)?this._spec.height=t.height:this._spec.height!==t.height&&(n=!0);const r=this._autoSize;return this._autoSize=!!rn(this._option.mode)&&((i=(e=this._spec.autoFit)!==null&&e!==void 0?e:this._option.autoFit)===null||i===void 0||i),this._autoSize!==r&&(n=!0),n}_getBackground(){return(typeof this._spec.background=="string"?this._spec.background:null)||this._currentTheme.background||this._option.background}getCurrentTheme(){return ta(this._currentThemeName)}getCurrentThemeName(){return this._currentThemeName}setCurrentTheme(t){return yn(this,void 0,void 0,function*(){if(!us.themeExist(t))return this;const e=this._setCurrentTheme(t);return yield this.updateCustomConfigAndRerender(e,!1,{transformSpec:!1,actionSource:"setCurrentTheme"}),this})}setCurrentThemeSync(t){if(!us.themeExist(t))return this;const e=this._setCurrentTheme(t);return this.updateCustomConfigAndRerender(e,!0,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}_setCurrentTheme(t){var e;return this._updateCurrentTheme(t),this._initChartSpec(this._getSpecFromOriginalSpec(),"setCurrentTheme"),(e=this._chart)===null||e===void 0||e.setCurrentTheme(),{change:!0,reMake:!1}}_getTooltipComponent(){var t;return(t=this._chart)===null||t===void 0?void 0:t.getAllComponents().find(e=>e.type===Z.tooltip)}setTooltipHandler(t){var e,i;this._context.tooltipHandler=t;const n=this._getTooltipComponent();n&&((i=(e=n.tooltipHandler)===null||e===void 0?void 0:e.release)===null||i===void 0||i.call(e),n.tooltipHandler=t)}getTooltipHandlerByUser(){var t;return(t=this._context)===null||t===void 0?void 0:t.tooltipHandler}getTooltipHandler(){const t=this._getTooltipComponent();return t?t.tooltipHandler:this._context.tooltipHandler}showTooltip(t,e){var i;const n=this._getTooltipComponent();return(i=E(t)&&(n==null?void 0:n.showTooltip(t,e))!=="none")!==null&&i!==void 0&&i}hideTooltip(){var t;const e=this._getTooltipComponent();return(t=e==null?void 0:e.hideTooltip())!==null&&t!==void 0&&t}getLegendDataById(t){var e;const i=(e=this._chart)===null||e===void 0?void 0:e.getComponentByUserId(t);return i?i.getLegendData():[]}getLegendDataByIndex(t=0){var e;const i=(e=this._chart)===null||e===void 0?void 0:e.getAllComponents().filter(n=>n.type===Z.discreteLegend);return i[t]?i[t].getLegendData():[]}getLegendSelectedDataById(t){var e;const i=(e=this._chart)===null||e===void 0?void 0:e.getComponentByUserId(t);return i?i.getSelectedData():[]}getLegendSelectedDataByIndex(t=0){var e;const i=(e=this._chart)===null||e===void 0?void 0:e.getAllComponents().filter(n=>n.type===Z.discreteLegend);return i[t]?i[t].getSelectedData():[]}setLegendSelectedDataById(t,e){var i;const n=(i=this._chart)===null||i===void 0?void 0:i.getComponentByUserId(t);n&&n.setSelectedData(e)}setLegendSelectedDataByIndex(t=0,e){var i;const n=(i=this._chart)===null||i===void 0?void 0:i.getAllComponents().filter(r=>r.type===Z.discreteLegend);n[t]&&n[t].setSelectedData(e)}getDataURL(){var t;return yn(this,void 0,void 0,function*(){const e=this.getStage();if(this._chart&&e){e.render();const i=this._chart.getCanvas();return yield hJ(i,{onError:this._onError})}return(t=this._option)===null||t===void 0||t.onError(new ReferenceError("render is not defined")),null})}exportImg(t){var e,i;return yn(this,void 0,void 0,function*(){if(!rn(this._option.mode))return void((e=this._option)===null||e===void 0||e.onError(new TypeError("non-browser environment can not export img")));const n=yield this.getDataURL();n?oJ(t,n):(i=this._option)===null||i===void 0||i.onError(new ReferenceError("render is not defined"))})}exportCanvas(){var t;const e=this.getStage();if(this._chart&&e)return e.toCanvas();(t=this._option)===null||t===void 0||t.onError(new ReferenceError("render is not defined"))}getImageBuffer(){var t,e;if(this._option.mode!=="node")return void((t=this._option)===null||t===void 0||t.onError(new TypeError("getImageBuffer() now only support node environment.")));const i=this.getStage();return i?(i.render(),i.window.getImageBuffer()):((e=this._option)===null||e===void 0||e.onError(new ReferenceError("render is not defined")),null)}setLayout(t){var e;this._option.layout=t,(e=this._chart)===null||e===void 0||e.setLayout(t)}reLayout(){var t;(t=this._chart)===null||t===void 0||t.setLayoutTag(!0)}getCompiler(){return this._compiler}getChart(){return this._chart}getStage(){return this._compiler.getStage()}getCanvas(){var t;return(t=this._compiler)===null||t===void 0?void 0:t.getCanvas()}getContainer(){var t;if(E(this._container))return this._container;let e;return e=ht(this._canvas)?document==null?void 0:document.getElementById(this._canvas):this._canvas,E(e)?e.parentElement:(t=this.getCanvas())===null||t===void 0?void 0:t.parentElement}getComponents(){return this._chart.getAllComponents()}setDimensionIndex(t,e={}){var i;return(i=this._chart)===null||i===void 0?void 0:i.setDimensionIndex(t,e)}stopAnimation(){var t,e,i;(i=(e=(t=this._compiler)===null||t===void 0?void 0:t.getVGrammarView())===null||e===void 0?void 0:e.animate)===null||i===void 0||i.stop()}pauseAnimation(){var t,e,i;(i=(e=(t=this._compiler)===null||t===void 0?void 0:t.getVGrammarView())===null||e===void 0?void 0:e.animate)===null||i===void 0||i.pause()}resumeAnimation(){var t,e,i;(i=(e=(t=this._compiler)===null||t===void 0?void 0:t.getVGrammarView())===null||e===void 0?void 0:e.animate)===null||i===void 0||i.resume()}convertDatumToPosition(t,e={},i=!1){var n;if(!this._chart||vt(t))return null;const{seriesId:r,seriesIndex:a=0}=e;let o;if(E(r)?o=this._chart.getSeriesInUserId(r):E(a)&&(o=(n=this._chart.getSeriesInIndex([a]))===null||n===void 0?void 0:n[0]),o){const l=Object.keys(t),h=o.getViewData().latestData.find(c=>l.every(p=>c[p]==t[p])),d=o.getRegion().getLayoutStartPoint();let u;return u=h?o.dataToPosition(h):o.dataToPosition(t),fC(u,d,i)}return null}convertValueToPosition(t,e,i=!1){var n,r;if(!this._chart||P(t)||vt(e))return null;if(!$(t)){const{axisId:h,axisIndex:d}=e;let u;if(E(h)?u=this._chart.getComponentsByKey("axes").find(p=>p.userId===h):E(d)&&(u=(n=this._chart.getComponentsByKey("axes"))===null||n===void 0?void 0:n[d]),!u)return Na("Please check whether the `axisId` or `axisIndex` is set!"),null;const c=u==null?void 0:u.valueToPosition(t);if(i){const p=u.getLayoutStartPoint(),g=u.getOrient();return c+(g==="bottom"||g==="top"?p.x:p.y)}return c}const{seriesId:a,seriesIndex:o}=e;let l;return E(a)?l=this._chart.getSeriesInUserId(a):E(o)&&(l=(r=this._chart.getSeriesInIndex([o]))===null||r===void 0?void 0:r[0]),l?fC(l.valueToPosition(t[0],t[1]),l.getRegion().getLayoutStartPoint(),i):(Na("Please check whether the `seriesId` or `seriesIndex` is set!"),null)}getFunction(t){return Ls.instance().getFunction(t)}registerFunction(t,e){t&&e&&Ls.instance().registerFunction(t,e)}unregisterFunction(t){t&&Ls.instance().unregisterFunction(t)}getFunctionList(){return Ls.instance().getFunctionNameList()}setRuntimeSpec(t){this._spec=t,this._updateSpecInfo()}_initChartPlugin(){const t=F.getChartPlugins();t.length>0&&(this._chartPlugin=new FJ(this),this._chartPlugin.load(t.map(e=>new e)),this._chartPluginApply("onInit",this._spec))}_chartPluginApply(t,...e){this._chartPlugin&&this._chartPlugin[t]&&this._chartPlugin[t].apply(this._chartPlugin,e)}};an.InstanceManager=tn,an.ThemeManager=us,an.globalConfig={uniqueTooltip:!0},an.Utils=LJ;F.registerRegion("region",mh),F.registerLayout("base",lA),MJ(),Vo.useRegisters([N9,G9]),IJ(),nA(xC.name,xC),Nt.getInstance(Os.Error);class zJ{constructor(t){this.id=No(),this.name=`${t}_${this.id}`}onAdd(t){this.service=t}}const ed=(s,t)=>{const e=t.beforeCall();return s.forEach((i,n)=>t.call(i,n,e)),e.keyMap&&(e.keyMap.clear(),e.keyMap=null),s};function HJ(s){return s===ri["desktop-browser"]||s===ri["desktop-miniApp"]?{hover:{enable:!0,trigger:"pointermove",triggerOff:"pointerleave"},select:{enable:!0,trigger:"pointertap"}}:Ga(s)||Wa(s)?{hover:{enable:!0,trigger:["pointerdown","pointermove"],triggerOff:"pointerleave"},select:{enable:!0,trigger:"tap"}}:null}class NJ{get hover(){return this._hover}get select(){return this._select}constructor(t,e){this._fields=null,this._marks=new Ya,this._markReverse=new Ya,this.onHover=i=>{this.filterEventMark(i)?(this._isHovered=!0,this.hoverItem(i)):this._isHovered&&(this._isHovered=!1,this.unhoverItem())},this.onUnHover=i=>{this.filterEventMark(i)||this.interaction.filterEventMark(i,bt.STATE_HOVER)||this.interaction.getEventElement(bt.STATE_HOVER)[0]&&this.unhoverItem()},this.onSelect=i=>{this.handleSingleEventSelect(i)},this.onUnSelect=i=>{this.interaction.filterEventMark(i,bt.STATE_SELECTED)||this.clearSelectedItems()},this._spec=t,this._option=e,this.event=new Hc(e.eventDispatcher,e.mode),this.interaction=e.interaction,this.initConfig(e.mode)}setStateKeys(t){this._fields=t.slice()}registerMark(t){this._marks.addMark(t),this._hover.enable&&this.interaction.registerMark(bt.STATE_HOVER,t),this._select.enable&&this.interaction.registerMark(bt.STATE_SELECTED,t)}init(){this.initEvent()}release(){this.releaseEvent(),this._marks.clear()}initEvent(){const t=this.event,{enable:e,trigger:i,triggerOff:n}=this._hover,{enable:r,trigger:a,triggerOff:o}=this._select;e&&(Y(i).forEach(l=>{t.on(l,{level:Xt.chart},this.onHover)}),n&&n!=="none"&&Y(n).forEach(l=>{t.on(l,{level:Xt.vchart,source:te.chart},this.onUnHover)})),r&&(Y(a).forEach(l=>{t.on(l,{level:Xt.mark},this.onSelect)}),o&&o!=="none"&&Y(o).forEach(l=>{t.on(l,{level:Xt.mark},this.onUnSelect)}),o||Y(o??a).forEach(l=>{t.on(l,{level:Xt.vchart},this.onUnSelect)}))}releaseEvent(){this.event.release()}initConfig(t){const e=HJ(t);this._hover=Object.assign({},e==null?void 0:e.hover),this._select=Object.assign({},e==null?void 0:e.select);const i=this._spec.hover;ye(i)?this._hover.enable=i:$t(i)&&(this._hover.enable=!0,this._hover=yt(this._hover,i));const n=this._spec.select;ye(n)?this._select.enable=n:$t(n)&&(this._select.enable=!0,this._select=yt(this._select,n))}hoverItem(t){const{datum:e}=t,i=this.interaction.getEventElement(bt.STATE_HOVER)[0];t.item!==i&&(this.interaction.exchangeEventElement(bt.STATE_HOVER,t.item),this.interaction.reverseEventElement(bt.STATE_HOVER),this.event.emit("hovered",{model:this._option.model,value:[e]}))}unhoverItem(){const t=this.interaction.getEventElementData(bt.STATE_HOVER);this.interaction.clearEventElement(bt.STATE_HOVER,!0),this.event.emit("unhovered",{model:this._option.model,value:t})}handleSingleEventHover(t){this.filterEventMark(t)?this.hoverItem(t):this.interaction.getEventElement(bt.STATE_HOVER)[0]&&!this.interaction.filterEventMark(t,bt.STATE_HOVER)&&this.unhoverItem()}selectItems(t){this.event.emit("selected",{model:this._option.model,value:t})}clearSelectedItems(){const t=this.interaction.getEventElementData(bt.STATE_SELECTED);this.interaction.clearEventElement(bt.STATE_SELECTED,!0),this.event.emit("unselected",{model:this._option.model,value:t})}unselectItems(t){const{triggerOff:e}=this._select;e!=="none"&&(this.interaction.removeEventElement(bt.STATE_SELECTED,t.item),this.event.emit("unselected",{model:this._option.model,value:t.item}))}handleSingleEventSelect(t){if(this.filterEventMark(t))if(t.item.getStates().includes(bt.STATE_SELECTED))this.unselectItems(t);else{this._select.mode==="multiple"?this.interaction.addEventElement(bt.STATE_SELECTED,t.item):this.interaction.exchangeEventElement(bt.STATE_SELECTED,t.item),this.interaction.reverseEventElement(bt.STATE_SELECTED);const e=this.interaction.getEventElementData(bt.STATE_SELECTED);this.selectItems(e)}else this.interaction.filterEventMark(t,bt.STATE_SELECTED)||this.clearSelectedItems()}filterEventMark(t){return!(!t.mark||!this._marks.includes(t.mark))}isDatumEqual(t,e){return(this._fields?this._fields:Object.keys(t)).every(i=>t[i]===e[i])}}class GJ{constructor(){this.activeTriggerSet={mark:new Set,dimension:new Set},this.ignoreTriggerSet={mark:new Set,dimension:new Set}}}const xa=s=>{var t,e;if((s==null?void 0:s.visible)===!1)return[];const i={mark:((t=s==null?void 0:s.mark)===null||t===void 0?void 0:t.visible)!==!1,dimension:((e=s==null?void 0:s.dimension)===null||e===void 0?void 0:e.visible)!==!1};return E(s==null?void 0:s.activeType)&&Object.keys(i).forEach(n=>{var r;i[n]=(r=s==null?void 0:s.activeType)===null||r===void 0?void 0:r.includes(n)}),Object.keys(i).filter(n=>i[n])};function WJ(s){return P(s.mark)&&P(s.model)&&P(s.datum)}class ys extends GJ{constructor(t){super(),this._getSeriesCacheInfo=()=>{var e,i,n;const{series:r}=this,a=r.getSeriesField();return{seriesFields:E(a)?Y(a):(e=r.getSeriesKeys())!==null&&e!==void 0?e:[],dimensionFields:(i=r.getDimensionField())!==null&&i!==void 0?i:[],measureFields:(n=r.getMeasureField())!==null&&n!==void 0?n:[],type:r.type}},this._getDimensionData=e=>{const{dimensionFields:i}=this._seriesCacheInfo;return i[0]&&(e==null?void 0:e[i[0]])},this._getMeasureData=e=>{const{measureFields:i}=this._seriesCacheInfo;return i[0]&&(e==null?void 0:e[i[0]])},this._getSeriesStyle=(e,i,n)=>{var r;for(const a of Y(i)){const o=(r=this.series.getSeriesStyle(e))===null||r===void 0?void 0:r(a);if(E(o))return o}return n},this.contentKeyCallback=(e,i)=>{const{dimensionFields:n,seriesFields:r}=this._seriesCacheInfo,a=n[n.length-1];return E(r[0])&&(e!=null&&e[r[0]])?e==null?void 0:e[r[0]]:(n.length>1&&(r.length===0||this.series.getSeriesKeys().length),e==null?void 0:e[a])},this.contentValueCallback=(e,i)=>this._getMeasureData(e),this.contentShapeTypeCallback=(e,i)=>{var n;return(n=this._getSeriesStyle(e,"shape",null))!==null&&n!==void 0?n:this._getSeriesStyle(e,"symbolType",this.series.getDefaultShapeType())},this.contentShapeColorCallback=(e,i)=>this._getSeriesStyle(e,["fill","stroke"]),this.titleValueCallback=(e,i)=>this._getDimensionData(e),this.series=t,this.updateTooltipSpec()}updateTooltipSpec(){var t,e,i,n;const r=(e=(t=this.series.getSpec())===null||t===void 0?void 0:t.tooltip)!==null&&e!==void 0?e:{},a=(n=(i=this.series.getChart().getSpec())===null||i===void 0?void 0:i.tooltip)!==null&&n!==void 0?n:{},o=Object.assign(Object.assign({},a),r);["mark","dimension"].forEach(l=>{const h=o[l];E(h)&&(o[l]=Object.assign(Object.assign({},h),{title:E(h.title)?K(h.title)?h.title:Object.assign(Object.assign({},h.title),{seriesId:this.series.id}):void 0,content:E(h.content)?K(h.content)?h.content:Y(h.content).map(d=>K(d)?d:Object.assign(Object.assign({},d),{seriesId:this.series.id})):void 0}))}),this.spec=o,this.activeType=xa(o),this._seriesCacheInfo=this._getSeriesCacheInfo()}getDefaultTooltipPattern(t,e){if(t==="mark")return{visible:!0,activeType:t,title:{key:void 0,value:this.titleValueCallback,hasShape:!1},content:[{seriesId:this.series.id,key:this.contentKeyCallback,value:this.contentValueCallback,hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1}]};if(t==="dimension"&&e){const i={key:void 0,value:this._getDimensionData,hasShape:!1},n=[];return e.forEach(({data:r})=>r.forEach(({series:a})=>{n.push({seriesId:a.id,key:this.contentKeyCallback,value:this.contentValueCallback,hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1})})),{visible:!0,activeType:t,title:i,content:n}}return null}}const VJ={min:s=>s.length?ki(s.map(t=>1*t)):0,max:s=>s.length?ei(s.map(t=>1*t)):0,"array-min":s=>s.length?ki(s.map(t=>1*t)):0,"array-max":s=>s.length?ei(s.map(t=>1*t)):0,values:s=>{const t={},e=[];for(const i of s)t[i]||(e.push(i),t[i]=1);return e}},Ax=(s,t)=>{var e,i;let n=t.fields;if(K(n)&&(n=n()),!(n!=null&&n.length)||!(s!=null&&s.length))return{};n=_h([],n);const r=t.target==="parser"?"parserData":"latestData",a=s[0][r]?s[0][r]:s||[],o=(i=(e=s[0]).getFields)===null||i===void 0?void 0:i.call(e);return NB(a,n,o)},NB=(s,t,e)=>{const i={};let n=[],r=[];return t.forEach(a=>{const o=a.key;i[o]={};const l=e==null?void 0:e[o],h=a.operations,d=h.some(p=>p==="min"||p==="max"||p==="allValid");let u=!0;n.length=0,s.forEach(p=>{p&&n.push(p[o])});const c=n.length;if(d){r.length=0,n.forEach((g,f)=>{rr(g)&&r.push(g)});const p=n;n=r,r=p,u=n.length===c}else n=h.some(p=>p==="array-min"||p==="array-max")?n.reduce((p,g)=>(g&&g.forEach(f=>{rr(f)&&p.push(f)}),p),[]):n.filter(p=>p!==void 0);h.forEach(p=>{if(a.customize)i[o][p]=a.customize;else{if(l&&l.lockStatisticsByDomain&&!P(l.domain)){if(p==="values")return void(i[o][p]=l.domain.slice())}else if(p==="allValid")return;i[o][p]=VJ[p](n),p==="array-max"&&(i[o].max=i[o][p]),p==="array-min"&&(i[o].min=i[o][p])}}),d&&(i[o].allValid=u)}),i},UJ=(s,t)=>{const{config:e}=t;if(!e)return s;const{invalidType:i,checkField:n}=e();return i!=="zero"||s.forEach(r=>{rr(r[n])||(r[n]=0)}),s};class or extends Ur{_compileProduct(){var t;const e=(t=this._data)===null||t===void 0?void 0:t.latestData;P(e)||E(this.getProduct())||this._initProduct([])}generateProductId(){var t;return(t=this._data)===null||t===void 0?void 0:t.name}}const Ku=`${At}_HIERARCHY_DEPTH`,Xa=`${At}_HIERARCHY_ROOT`,$J=`${At}_HIERARCHY_ROOT_INDEX`;function qu(){return{keyMap:new Map,needDefaultSeriesField:!this._seriesField,defaultSeriesField:this._seriesField?null:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey)}}function Dh(s,t,e){s&&(e.needDefaultSeriesField&&(s[Fs]=e.defaultSeriesField),s[Si]=t,s[ar]=e.getKey(s,t,e))}function uA(){return{keyMap:new Map,needDefaultSeriesField:!0,defaultSeriesField:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey),categoryField:this.getCategoryField()}}function iv(s,t,e,i=0,n,r){r===void 0&&(r=t),Dh(s,t,e),s[Ku]=i,s[Xa]=n||s[e.categoryField],s[$J]=r,s.children&&s.children.length&&s.children.forEach((a,o)=>iv(a,o,e,s[Ku]+1,s[Xa],r))}const PC=["appear","enter","update","exit","disappear","normal"];function zt(s={},t,e){const i={};for(let n=0;n<PC.length;n++){const r=PC[n],a=t?t[r]:void 0;if(a===!1)continue;if(r==="normal"){a&&(i.normal=a);continue}if(r!=="update"&&!a&&!s[r])continue;let o,l;o=$(s[r])?s[r]:[Object.assign(Object.assign({},ba[r]),s[r])],r==="exit"&&o.forEach(h=>{h.controlOptions={stopWhenStateChange:!0}}),a?(l=$(a)?a.map((h,d)=>{var u;let c=h;return OC(c)&&delete c.type,c.oneByOne&&(c=EC(c,(u=e==null?void 0:e.dataIndex)!==null&&u!==void 0?u:RC,e==null?void 0:e.dataCount)),c}):o.map((h,d)=>{var u;let c=yt({},o[d],a);return OC(c)&&delete c.type,c.oneByOne&&(c=EC(c,(u=e==null?void 0:e.dataIndex)!==null&&u!==void 0?u:RC,e==null?void 0:e.dataCount)),c}),i[r]=l):i[r]=o}return i.state=i.update,i}function Yt(s,t,e){var i,n,r,a,o;const l={};return t.animationAppear&&(l.appear=(i=t.animationAppear[s])!==null&&i!==void 0?i:t.animationAppear),t.animationDisappear&&(l.disappear=(n=t.animationDisappear[s])!==null&&n!==void 0?n:t.animationDisappear),t.animationEnter&&(l.enter=(r=t.animationEnter[s])!==null&&r!==void 0?r:t.animationEnter),t.animationExit&&(l.exit=(a=t.animationExit[s])!==null&&a!==void 0?a:t.animationExit),t.animationUpdate&&(l.update=(o=t.animationUpdate[s])!==null&&o!==void 0?o:t.animationUpdate),t.animationNormal&&t.animationNormal[s]&&(l.normal=t.animationNormal[s]),XJ(l,e)}function EC(s,t,e){const{oneByOne:i,duration:n,delay:r,delayAfter:a}=s;return s.delay=(o,l,h)=>{const d=t(o),u=K(n)?n(o,l,h):N(n)?n:0,c=K(r)?r(o,l,h):N(r)?r:0;let p=K(i)?i(o,l,h):i;return p===!1?c:(p=p===!0?0:p,c+d*(u+p))},s.delayAfter=(o,l,h)=>{const d=t(o),u=K(n)?n(o,l,h):N(n)?n:0,c=K(a)?a(o,l,h):N(a)?a:0;let p=K(i)?i(o,l,h):i;return p===!1?c:(p=p===!0?0:p,c+((e?e():l.mark.elements.length)-d)*(u+p))},delete s.oneByOne,s}function RC(s){return s==null?void 0:s[Si]}function Yr(s,t){var e,i,n,r,a;if(s.animation===!1||((e=s.morph)===null||e===void 0?void 0:e.enable)===!1)return!1;const o=((n=(i=s.animationAppear)===null||i===void 0?void 0:i[t])!==null&&n!==void 0?n:s.animationAppear)!==!1,l=((a=(r=s.animationUpdate)===null||r===void 0?void 0:r[t])!==null&&a!==void 0?a:s.animationUpdate)!==!1;return!(!o||!l)}function YJ(s){return E(s.timeSlices)}function OC(s){return!YJ(s)&&E(s.channel)}function XJ(s,t){return s&&(kx(s=bi(s),e=>{var i;return K(e)&&((i=e.prototype)===null||i===void 0?void 0:i.constructor)!==e?(...n)=>e(...n,t):e}),s)}function kx(s,t){if($(s))s.forEach((e,i)=>{s[i]=t(s[i],i),kx(s[i],t)});else if($t(s))for(const e in s)s[e]=t(s[e],e),kx(s[e],t)}function KJ(s){return s.getSpec().animation!==!1&&E(s.getRegion().animate)}class Ns extends Zm{constructor(){super(...arguments),this.markLabelSpec={}}getLabelSpec(t){return this.markLabelSpec[t]}setLabelSpec(t,e){this.markLabelSpec[t]=Y(e)}addLabelSpec(t,e,i=!1){this.markLabelSpec[t]||(this.markLabelSpec[t]=[]),i?this.markLabelSpec[t].unshift(e):this.markLabelSpec[t].push(e)}getTheme(t,e){var i;const n=nB(t),r=(i=this._option)===null||i===void 0?void 0:i.getTheme(),{markByName:a,mark:o}=r,l=this._option.type,h=vx(It(r,`series.${l}`),l,o,a),d=vx(It(r,`series.${l}_${n}`),`${l}_${n}`,o,a);return yt({},h,d)}transformSpec(t,e,i){const n=super.transformSpec(t,e,i);return this._transformLabelSpec(n.spec),Object.assign(Object.assign({},n),{markLabelSpec:this.markLabelSpec})}_transformLabelSpec(t){}_addMarkLabelSpec(t,e,i="label",n="initLabelMarkStyle",r,a){const o=t==null?void 0:t[i];o!=null&&o.visible&&this.addLabelSpec(e,Object.assign(Object.assign({animation:r??t.animation},o),{getStyleHandler:l=>{var h;return(h=l[n])===null||h===void 0?void 0:h.bind(l)}}),a)}_getDefaultSpecFromChart(t){var e;const i=(e=super._getDefaultSpecFromChart(t))!==null&&e!==void 0?e:{},{outerRadius:n,innerRadius:r}=t;return E(n)&&(i.outerRadius=n),E(r)&&(i.innerRadius=r),Object.keys(i).length>0?i:void 0}}class Io extends oA{getTrigger(){return this._trigger}getRegion(){return this._region}getLayoutStartPoint(){return this._region.getLayoutStartPoint()}getRootMark(){return this._rootMark}getRawData(){return this._rawData}getViewDataFilter(){return this._viewDataFilter}getViewData(){var t;return(t=this._data)===null||t===void 0?void 0:t.getDataView()}getViewDataProductId(){var t;return(t=this._data)===null||t===void 0?void 0:t.getProductId()}getViewDataStatistics(){return this._viewDataStatistics}getViewStackData(){return this._viewStackData}getSeriesField(){return this._seriesField}setSeriesField(t){E(t)&&(this._seriesField=t,this.getMarks().filter(e=>e.getDataView()===this.getViewData()).forEach(e=>{e.setFacet(this._seriesField)}))}getGroups(){return this._groups}getStack(){return this._stack}getStackValue(){var t;return(t=this._spec.stackValue)!==null&&t!==void 0?t:`${At}_series_${this.type}`}getPercent(){return this._percent}getStackOffsetSilhouette(){return this._stackOffsetSilhouette}get tooltipHelper(){return this._tooltipHelper||this.initTooltip(),this._tooltipHelper}getInvalidType(){return this._invalidType}setInvalidType(t){var e;this._invalidType=t,(e=this.getViewData())===null||e===void 0||e.reRunAllTransform()}getMarkAttributeContext(){return this._markAttributeContext}constructor(t,e){var i;super(t,e),this.specKey="series",this.type="series",this.layoutType="absolute",this.modelType="series",this.name=void 0,this.transformerConstructor=Ns,this.coordinate="none",this._region=null,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:null,height:null},this.getLayoutRect=()=>{var n,r;return{width:(n=this._layoutRect.width)!==null&&n!==void 0?n:this._region.getLayoutRect().width,height:(r=this._layoutRect.height)!==null&&r!==void 0?r:this._region.getLayoutRect().height}},this._rootMark=null,this._seriesMark=null,this._viewDataMap=new Map,this._viewDataFilter=null,this._data=null,this._percent=!1,this._stackOffsetSilhouette=!1,this.layoutZIndex=0,this._invalidType="break",this._getInvalidDefined=n=>rr(n[this.getStackValueField()]),this._region=e.region,this._dataSet=e.dataSet,!((i=this._spec)===null||i===void 0)&&i.name&&(this.name=this._spec.name)}created(){super.created(),this._buildMarkAttributeContext(),this.initData(),this.initGroups(),this.initStatisticalData(),this.event.emit(St.afterInitData,{model:this}),this.initTrigger(),this.initRootMark(),this.initMark();const t=KJ(this);this._initExtensionMark({hasAnimation:t}),this.initMarkStyle(),this.initMarkState(),t&&this.initAnimation(),this.afterInitMark(),this.initEvent(),this.event.emit(St.afterInitEvent,{model:this})}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return(i=this._option.globalScale.getScale(t))===null||i===void 0?void 0:i.scale(e)},seriesColor:t=>{var e;return P(t)&&(t=this.getSeriesKeys()[0]),(e=this._option.globalScale.getScale("color"))===null||e===void 0?void 0:e.scale(t)},getRegion:()=>this._region}}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),ye(this._spec.stack)&&(this._stack=this._spec.stack),ye(this._spec.percent)&&(this._percent=this._spec.percent,this._stack=this._spec.percent||this._stack),ye(this._spec.stackOffsetSilhouette)&&(this._stackOffsetSilhouette=this._spec.stackOffsetSilhouette,this._stack=this._spec.stackOffsetSilhouette||this._stack),E(this._spec.stackValue)&&(this._stack=!0),P(this._stack)&&this._supportStack&&this._seriesField&&(this._stack=!0),E(this._spec.invalidType)&&(this._invalidType=this._spec.invalidType)}initData(){var t,e,i,n,r,a;const o=(t=this._spec.data)!==null&&t!==void 0?t:this._option.getSeriesData(this._spec.dataId,this._spec.dataIndex);if(o&&(this._rawData=v_(o,this._dataSet,this._option.sourceDataList,{onError:(e=this._option)===null||e===void 0?void 0:e.onError})),(n=(i=this._rawData)===null||i===void 0?void 0:i.target)===null||n===void 0||n.addListener("change",this.rawDataUpdate.bind(this)),this._addDataIndexAndKey(),this._rawData){this._stack&&(this._viewDataFilter=Sx(this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewDataFilter`}));const l=Sx(this._stack?this._viewDataFilter:this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewData`});this._data=new or(this._option,l),this._stack&&this._viewDataFilter.target.removeListener("change",l.reRunAllTransform)}this._invalidType==="zero"&&(!((r=this._rawData)===null||r===void 0)&&r.dataSet)&&(Ct(this._rawData.dataSet,"invalidTravel",UJ),(a=this._rawData)===null||a===void 0||a.transform({type:"invalidTravel",options:{config:()=>({invalidType:this._invalidType,checkField:this.getStackValueField()})}},!1))}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups={fields:t})}initStatisticalData(){this._data&&this._statisticViewData()}getRawDataStatisticsByField(t,e){var i,n;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]){if(this._viewDataStatistics&&(!this._viewDataFilter||this._viewDataFilter.transformsArr.length<=1)&&this.getViewData().transformsArr.length<=1&&(!((i=this._viewDataStatistics.latestData)===null||i===void 0)&&i[t]))this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t];else if(this._rawData){const r=(n=this._rawData.getFields())===null||n===void 0?void 0:n[t];r&&r.lockStatisticsByDomain&&r.domain?(this._rawStatisticsCache[t]={},e?(this._rawStatisticsCache[t].min=ki(r.domain),this._rawStatisticsCache[t].max=ei(r.domain)):this._rawStatisticsCache[t].values=r.domain):this._rawStatisticsCache[t]=NB(this._rawData.latestData,[{key:t,operations:e?["min","max"]:["values"]}])[t]}}return e&&(P(this._rawStatisticsCache[t].min)||P(this._rawStatisticsCache[t].max))&&(this._rawStatisticsCache[t].min=ki(this._rawStatisticsCache[t].values),this._rawStatisticsCache[t].max=ei(this._rawStatisticsCache[t].values)),this._rawStatisticsCache[t]}_statisticViewData(){Ct(this._dataSet,"dimensionStatistics",Ax);const t=`${this.type}_${this.id}_viewDataStatic`;this._viewDataStatistics=new Jt(this._dataSet,{name:t}),this._viewDataStatistics.parse([this._data.getDataView()],{type:"dataview"}),this._viewDataStatistics.transform({type:"dimensionStatistics",options:{fields:()=>{const e=this.getStatisticFields();return this._seriesField&&_h(e,[{key:this._seriesField,operations:["values"]}]),e},target:"latest"}},!1),this._data.getDataView().target.removeListener("change",this._viewDataStatistics.reRunAllTransform),this._stack&&this.createdStackData()}createStatisticalData(t,e,i){Ct(this._dataSet,"dimensionStatistics",Ax);const n=new Jt(this._dataSet,{name:t});return n.parse([e],{type:"dataview"}),n.transform({type:"dimensionStatistics",options:{operations:["max","min","values"],fields:()=>{var r;const a=_h(this.getStatisticFields(),(r=i==null?void 0:i(e.name))!==null&&r!==void 0?r:[]);return this._seriesField&&_h(a,[{key:this._seriesField,operations:["values"]}]),a},target:"latest"}},!1),n}createdStackData(){const t=`${this.type}_${this.id}_viewStackData`;this._viewStackData=new Jt(this._dataSet,{name:t}),this._viewStackData.parse([this._viewDataFilter],{type:"dataview"}),this._viewStackData.transform({type:"stackSplit",options:{fields:this.getStackGroupFields()}},!1)}_noAnimationDataKey(t,e){return e}generateDefaultDataKey(t){var e;return P(t)?(i,n,r)=>{if(this._spec.animation===!1){const l=this._noAnimationDataKey(i,n);if(l!==void 0)return l}const{keyMap:a}=r,o=this._getSeriesDataKey(i);return a.get(o)===void 0?(a.set(o,0),o):(a.set(o,a.get(o)+1),`${o}_${a.get(o)}`)}:ht(t)?i=>i[t]:$(t)&&t.every(i=>ht(i))?i=>t.map(n=>i[n]).join("-"):K(t)?(i,n)=>t(i,n):((e=this._option)===null||e===void 0||e.onError(`invalid dataKey: ${t}`),(i,n)=>{})}_addDataIndexAndKey(){var t;!((t=this._rawData)===null||t===void 0)&&t.dataSet&&(Ct(this._rawData.dataSet,"addVChartProperty",ed),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:qu.bind(this),call:Dh}},!1))}updateRawData(t){this._rawData&&this._rawData.updateRawData(t)}rawDataUpdate(t){var e;(e=this._rawDataStatistics)===null||e===void 0||e.reRunAllTransform(),this._rawStatisticsCache=null,this.event.emit(St.rawDataUpdate,{model:this})}viewDataFilterOver(t){this.event.emit(St.viewDataFilterOver,{model:this})}viewDataUpdate(t){var e;this.event.emit(St.viewDataUpdate,{model:this}),(e=this._data)===null||e===void 0||e.updateData(),this._viewDataStatistics&&this._viewDataStatistics.reRunAllTransform()}viewDataStatisticsUpdate(t){this.event.emit(St.viewDataStatisticsUpdate,{model:this})}getDatumPositionValue(t,e){return!t||P(e)?null:t[e]}getDatumPositionValues(t,e){return!t||P(e)?[]:ht(e)?[t[e]]:e.map(i=>t[i])}setValueFieldToStack(){}setValueFieldToPercent(){}setValueFieldToStackOffsetSilhouette(){}initRootMark(){var t,e;this._rootMark=this._createMark({type:"group",name:`seriesGroup_${this.type}_${this.id}`},{parent:(e=(t=this._region).getGroupMark)===null||e===void 0?void 0:e.call(t),dataView:!1}),this._rootMark.setZIndex(this.layoutZIndex)}_initExtensionMark(t){var e;this._spec.extensionMark&&((e=this._spec.extensionMark)===null||e===void 0||e.forEach((i,n)=>{this._createExtensionMark(i,null,`${At}_series_${this.id}_extensionMark`,n,t)}))}_createExtensionMark(t,e,i,n,r){var a;const o=this._createMark({type:t.type,name:`${i}_${n}`},{skipBeforeLayouted:!0,markSpec:t,parent:e,dataView:!1,customShape:t==null?void 0:t.customShape});if(o){if(r.hasAnimation){const l=zt({},Yt(t.type,t,this._markAttributeContext));o.setAnimationConfig(l)}if(t.type==="group")i=`${i}_${n}`,(a=t.children)===null||a===void 0||a.forEach((l,h)=>{this._createExtensionMark(l,o,i,h,r)});else if(!(e||P(t.dataId)&&P(t.dataIndex))){const l=this._option.getSeriesData(t.dataId,t.dataIndex);l===this._rawData?o.setDataView(this.getViewData(),this.getViewDataProductId()):o.setDataView(l)}}}_updateExtensionMarkSpec(t){var e;(e=this._spec.extensionMark)===null||e===void 0||e.forEach((i,n)=>{var r;const a=this._marks.getMarkWithInfo({name:`${this.type}_${this.id}_extensionMark_${n}`});a&&(t&&Se((r=t.extensionMark)===null||r===void 0?void 0:r[n],i)||(this.initMarkStyleWithSpec(a,i),a.updateStaticEncode(),a.updateLayoutState()))})}getStackData(){var t;return(t=this._viewStackData)===null||t===void 0?void 0:t.latestData}initTrigger(){const t={hover:this._spec.hover,select:this._spec.select},e=Object.assign(Object.assign({},this._option),{model:this,interaction:this._region.interaction});this._trigger=new NJ(t,e)}initAnimation(){}initMarkState(){this.initSeriesStyleState()}initSeriesStyleState(){var t;const e=this._spec.seriesStyle;if(!e||!e.length)return;const i=(t=this._seriesField)!==null&&t!==void 0?t:Fs;this.getMarksWithoutRoot().forEach(n=>{const r={},a={},o={};e.forEach(h=>{var d;const u=(d=h[n.name])===null||d===void 0?void 0:d.style;u&&(r[h.name]=!0,o[h.name]=o[h.name]||{},Object.keys(u).forEach(c=>{a[c]=!0,o[h.name][c]=u[c]}))}),n.state.addStateInfo({stateValue:uC,level:-1,filter:h=>Array.isArray(h)?h.length!==0&&r[h[0][i]]===!0:r[h[i]]===!0});const l={};Object.keys(a).forEach(h=>{l[h]=d=>{var u,c;let p;if(Array.isArray(d)){if(d.length===0)return;p=(u=o[d[0][i]])===null||u===void 0?void 0:u[h]}return p=(c=o[d[i]])===null||c===void 0?void 0:c[h],p||n.getAttribute(h,d)}}),this.setMarkStyle(n,l,uC)})}afterInitMark(){var t,e,i;this.event.emit(St.afterInitMark,{model:this}),this.setSeriesField(this._spec.seriesField);let n=(t=this._spec.animationThreshold)!==null&&t!==void 0?t:Number.MAX_SAFE_INTEGER;this.getMarks().forEach(r=>{var a,o;!((o=(a=r.stateStyle)===null||a===void 0?void 0:a.normal)===null||o===void 0)&&o.lineWidth&&r.setAttribute("stroke",this.getColorAttribute(),"normal",tt.Base_Series);const l=r.getProgressiveConfig();l&&(l.large&&l.largeThreshold&&(n=Math.min(n,l.largeThreshold)),l.progressiveThreshold&&(n=Math.min(n,l.progressiveThreshold)))}),((i=(e=this._rawData)===null||e===void 0?void 0:e.latestData)===null||i===void 0?void 0:i.length)>=n&&(this._spec.animation=!1)}getMarksWithoutRoot(){return this.getMarks().filter(t=>!t.name.includes("seriesGroup"))}getMarksInType(t){return this._marks.getMarksInType(t)}getMarkInName(t){return this._marks.get(t)}getMarkInId(t){return this.getMarks().find(e=>e.id===t)}initEvent(){var t,e,i;this._trigger.init(),(e=(t=this._data)===null||t===void 0?void 0:t.getDataView())===null||e===void 0||e.target.addListener("change",this.viewDataUpdate.bind(this)),(i=this._viewDataStatistics)===null||i===void 0||i.target.addListener("change",this.viewDataStatisticsUpdate.bind(this))}_releaseEvent(){super._releaseEvent(),this._trigger.release()}initTooltip(){this._tooltipHelper=new ys(this)}_compareSpec(t,e,i){var n,r;const a=super._compareSpec(t,e),o=Object.keys(e||{}).sort(),l=Object.keys(t||{}).sort();return Se(o,l)?((i=i??{data:!0}).invalidType=!0,t.invalidType!==e.invalidType&&(a.reCompile=!0),i.extensionMark=!0,(Y(t.extensionMark).length!==Y(e.extensionMark).length||!((n=e.extensionMark)===null||n===void 0)&&n.some((h,d)=>h.type!==t.extensionMark[d].type||h.id!==t.extensionMark[d].id))&&(a.reMake=!0),a.reMake?a:(!((r=e.extensionMark)===null||r===void 0)&&r.some((h,d)=>h.visible!==t.extensionMark[d].visible)&&(a.reCompile=!0),this._marks.getMarks().some(h=>{var d,u;return i[h.name]=!0,((d=e[h.name])===null||d===void 0?void 0:d.visible)!==((u=t[h.name])===null||u===void 0?void 0:u.visible)})&&(a.reCompile=!0),o.some(h=>!i[h]&&!Se(t[h],e[h]))&&(a.reMake=!0),a)):(a.reMake=!0,a)}_updateSpecData(){!this._rawData||!this._spec.data||this._spec.data instanceof Jt||rA(this._rawData,this._spec.data,!0)}reInit(t){super.reInit(t);const e=this.getMarksWithoutRoot();e.forEach(i=>{this._spec[i.name]&&this.initMarkStyleWithSpec(i,this._spec[i.name])}),this.initMarkStyle(),e.forEach(i=>{i.updateStaticEncode(),i.updateLayoutState(!0)}),this._updateExtensionMarkSpec(t),this._updateSpecData(),this._tooltipHelper&&this._tooltipHelper.updateTooltipSpec()}onEvaluateEnd(t){this._data.updateData()}onRender(t){}release(){var t,e,i;super.release(),this._viewDataMap.clear();const n=(e=(t=this._rawData)===null||t===void 0?void 0:t.transformsArr)===null||e===void 0?void 0:e.findIndex(r=>r.type==="addVChartProperty");n>=0&&this._rawData.transformsArr.splice(n,1),(i=this._data)===null||i===void 0||i.release(),this._dataSet=this._data=this._rawData=this._rawDataStatistics=this._spec=this._region=this._viewDataStatistics=this._viewStackData=null}setLayoutStartPosition(t){N(t.x)&&(this._layoutStartPoint.x=t.x),N(t.y)&&(this._layoutStartPoint.y=t.y)}setLayoutRect({width:t,height:e},i){N(t)&&(this._layoutRect.width=t),N(e)&&(this._layoutRect.height=e)}getSeriesKeys(){var t,e;return this._seriesField?(e=(t=this.getRawDataStatisticsByField(this._seriesField))===null||t===void 0?void 0:t.values)!==null&&e!==void 0?e:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}getSeriesStyle(t){return e=>{var i,n;return(n=(i=this._seriesMark)===null||i===void 0?void 0:i.getAttribute(e,t))!==null&&n!==void 0?n:void 0}}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map(n=>({key:n,style:this.getSeriesStyle({[t]:n}),shapeType:i}))}getSeriesInfoInField(t){var e,i;return this._getSeriesInfo(t,(i=(e=this.getRawDataStatisticsByField(t))===null||e===void 0?void 0:e.values)!==null&&i!==void 0?i:[])}getSeriesInfoList(){var t;return this._getSeriesInfo((t=this._seriesField)!==null&&t!==void 0?t:Fs,this.getSeriesKeys())}_getDefaultColorScale(){var t,e;const i=this.getDefaultColorDomain(),n=this._getDataScheme();return(e=(t=new jc().domain(i)).range)===null||e===void 0?void 0:e.call(t,n)}_getDataScheme(){return Yu(this.getColorScheme(),this.type)}getDefaultColorDomain(){var t,e;return this._seriesField?(e=(t=this.getViewDataStatistics())===null||t===void 0?void 0:t.latestData[this._seriesField])===null||e===void 0?void 0:e.values:[]}getColorAttribute(){var t,e;return{scale:(t=this._option.globalScale.getScale("color"))!==null&&t!==void 0?t:this._getDefaultColorScale(),field:(e=this._seriesField)!==null&&e!==void 0?e:Fs}}getDimensionField(){return[]}getMeasureField(){return[]}onMarkPositionUpdate(){this.onMarkTreePositionUpdate(this.getMarksWithoutRoot())}onMarkTreePositionUpdate(t){}_createMark(t,e={}){var i,n,r,a;const{key:o,groupKey:l,skipBeforeLayouted:h,themeSpec:d={},markSpec:u,dataView:c,dataProductId:p,parent:g,isSeriesMark:f,depend:_,progressive:m,support3d:v=this._spec.support3d||!!this._spec.zField,morph:y=!1,customShape:b}=e,x=super._createMark(t,{key:o??this._getDataIdKey(),support3d:v,seriesId:this.id,attributeContext:this._markAttributeContext});if(E(x)){this._marks.addMark(x,{name:t.name}),f&&(this._seriesMark=x),P(g)?(i=this._rootMark)===null||i===void 0||i.addMark(x):g!==!1&&g.addMark(x),P(c)?(x.setDataView(this.getViewData(),this.getViewDataProductId()),x.setSkipBeforeLayouted(!0)):c!==!1&&x.setDataView(c,p),ye(h)&&x.setSkipBeforeLayouted(h),E(_)&&x.setDepend(...Y(_));const S=this.getSpec()||{};x.setMorph(y),x.setMorphKey(((n=S.morph)===null||n===void 0?void 0:n.morphKey)||`${this._specIndex}`),x.setMorphElementKey((a=(r=S.morph)===null||r===void 0?void 0:r.morphElementKey)!==null&&a!==void 0?a:e.defaultMorphElementKey),P(m)||x.setProgressiveConfig(m),P(l)||x.setGroupKey(l),b&&x.setCustomizedShapeCallback(b),this.initMarkStyleWithSpec(x,yt({},d,u||S[x.name]))}return x}_getDataIdKey(){var t;return(t=super._getDataIdKey())!==null&&t!==void 0?t:ar}_getSeriesDataKey(t){let e="";if(!t)return e;const i=this.getDimensionField();e=i.map(r=>t[r]).join("_");const n=this.getSeriesField();return n&&!i.includes(n)&&(e+=`_${t[n]}`),e}addViewDataFilter(t){var e,i;(i=(e=this._viewDataFilter)!==null&&e!==void 0?e:this.getViewData())===null||i===void 0||i.transform(t,!1)}reFilterViewData(){var t,e;(e=(t=this._viewDataFilter)!==null&&t!==void 0?t:this.getViewData())===null||e===void 0||e.reRunAllTransform()}reTransformViewData(){var t,e;(e=(t=this._data)===null||t===void 0?void 0:t.getDataView())===null||e===void 0||e.reRunAllTransform()}fillData(){var t;(t=this.getRawData())===null||t===void 0||t.reRunAllTransform()}compile(){this.compileData()}getDefaultShapeType(){return"circle"}getFieldAlias(t){var e;return t!==ui&&t!==$a&&t!==ln&&t!==$u||(t=this.getStackValueField()),(e=__(this.getRawData(),t))!==null&&e!==void 0?e:t}getMarkInfoList(){var t;const e=super.getMarkInfoList();return e.length?e:Object.values((t=c_[this.type])!==null&&t!==void 0?t:{})}_getInvalidConnectType(){return this._invalidType==="zero"?"zero":this._invalidType==="link"?"connect":"none"}}Io.mark=Me,Io.transformerConstructor=Ns;function qJ(s){return[z.rose,z.radar,z.circularProgress].includes(s)}function GB(s,t,e){const i=s.getScale(0),n="isInverse"in s&&s.isInverse();qt(i.type)?e.sort((r,a)=>(r[t]-a[t])*(n?-1:1)):e.sort((r,a)=>(i._index.get(r[t])-i._index.get(a[t]))*(n?-1:1))}function to(s){return{dataIndex:t=>{var e,i;const n=s.direction==="horizontal"?s.fieldY[0]:s.fieldX[0],r=t==null?void 0:t[n],a=s.direction==="horizontal"?s.scaleY:s.scaleX;return((i=(e=a==null?void 0:a.domain)===null||e===void 0?void 0:e.call(a))!==null&&i!==void 0?i:[]).indexOf(r)||0},dataCount:()=>{var t,e,i;const n=s.direction==="horizontal"?s.scaleY:s.scaleX;return(i=((e=(t=n==null?void 0:n.domain)===null||t===void 0?void 0:t.call(n))!==null&&e!==void 0?e:[]).length)!==null&&i!==void 0?i:0}}}class pn extends Io{constructor(){super(...arguments),this.coordinate="cartesian",this._bandPosition=.5,this._scaleConfig={bandPosition:this._bandPosition},this._direction="vertical",this._sortDataByAxis=!1,this._getInvalidDefined=t=>{var e,i;return!(!((e=this._xAxisHelper)===null||e===void 0)&&e.isContinuous&&!rr(t[this._specXField[0]]))&&!(!((i=this._yAxisHelper)===null||i===void 0)&&i.isContinuous&&!rr(t[this._specYField[0]]))}}_buildScaleConfig(){this._scaleConfig={bandPosition:this._bandPosition}}get fieldX(){return this._fieldX}setFieldX(t){this._fieldX=Y(t)}get fieldY(){return this._fieldY}setFieldY(t){this._fieldY=Y(t)}get fieldZ(){return this._fieldZ}setFieldZ(t){this._fieldZ=t&&Y(t)}get fieldX2(){return this._fieldX2}setFieldX2(t){this._fieldX2=t}get fieldY2(){return this._fieldY2}setFieldY2(t){this._fieldY2=t}get direction(){return this._direction}get scaleX(){return this._scaleX}setScaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}setScaleY(t){this._scaleY=t}get scaleZ(){return this._scaleZ}setScaleZ(t){this._scaleZ=t}getXAxisHelper(){return this._xAxisHelper}setXAxisHelper(t){this._xAxisHelper=t,this.onXAxisHelperUpdate()}getYAxisHelper(){return this._yAxisHelper}setYAxisHelper(t){this._yAxisHelper=t,this.onYAxisHelperUpdate()}getZAxisHelper(){return this._zAxisHelper}setZAxisHelper(t){this._zAxisHelper=t,this.onYAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}getStatisticFields(){var t,e,i;const n=[];return!((t=this.getXAxisHelper())===null||t===void 0)&&t.getScale&&(this._fieldX2?[...this._fieldX,this._fieldX2]:this._fieldX).forEach(r=>{const a={key:r,operations:[]};qt(this.getXAxisHelper().getScale(0).type)?a.operations=["max","min"]:a.operations=["values"],n.push(a)}),!((e=this.getYAxisHelper())===null||e===void 0)&&e.getScale&&(this._fieldY2?[...this._fieldY,this._fieldY2]:this._fieldY).forEach(r=>{const a={key:r,operations:[]};qt(this.getYAxisHelper().getScale(0).type)?a.operations=["max","min"]:a.operations=["values"],n.push(a)}),this._fieldZ&&(!((i=this.getZAxisHelper())===null||i===void 0)&&i.getScale)&&this._fieldZ.forEach(r=>{const a={key:r,operations:[]};qt(this.getZAxisHelper().getScale(0).type)?a.operations=["max","min"]:a.operations=["values"],n.push(a)}),this.getStack()&&n.push({key:this.getStackValueField(),operations:["allValid"]}),n}getGroupFields(){return this.direction==="vertical"?this._fieldX:this._fieldY}getStackGroupFields(){return this.getGroupFields()}getStackValue(){var t;return(t=this._spec.stackValue)!==null&&t!==void 0?t:`${At}_series_${this.type}_${(this.direction==="horizontal"?this.getXAxisHelper():this.getYAxisHelper()).getAxisId()}`}getStackValueField(){return this.direction==="vertical"?Y(this._spec.yField)[0]:Y(this._spec.xField)[0]}setValueFieldToStack(){this.direction==="vertical"?(this.setFieldY(ui),this.setFieldY2(ln)):(this.setFieldX(ui),this.setFieldX2(ln))}setValueFieldToPercent(){this.direction==="vertical"?(this.setFieldY($a),this.setFieldY2($u)):(this.setFieldX($a),this.setFieldX2($u))}setValueFieldToStackOffsetSilhouette(){this.direction==="vertical"?(this.setFieldY(dx),this.setFieldY2(hx)):(this.setFieldX(dx),this.setFieldX2(hx))}onXAxisHelperUpdate(){this.onMarkPositionUpdate()}onYAxisHelperUpdate(){this.onMarkPositionUpdate()}onZAxisHelperUpdate(){this.onMarkPositionUpdate()}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setFieldX(this._spec.xField),this.setFieldY(this._spec.yField),this.setFieldZ(this._spec.zField),this._specXField=Y(this._spec.xField),this._specYField=Y(this._spec.yField),E(this._spec.direction)&&(this._direction=this._spec.direction),this.setFieldX2((t=this._spec)===null||t===void 0?void 0:t.x2Field),this.setFieldY2((e=this._spec)===null||e===void 0?void 0:e.y2Field),this._stack&&this.setValueFieldToStack(),this._percent&&this.setValueFieldToPercent(),this._stackOffsetSilhouette&&this.setValueFieldToStackOffsetSilhouette(),E(this._spec.sortDataByAxis)&&(this._sortDataByAxis=this._spec.sortDataByAxis===!0)}dataToPosition(t){return t?{x:this.dataToPositionX(t),y:this.dataToPositionY(t)}:null}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToX=this.valueToPositionX.bind(this),this._markAttributeContext.valueToY=this.valueToPositionY.bind(this),this._markAttributeContext.xBandwidth=(t=0)=>{var e,i,n;return(n=(i=(e=this.getXAxisHelper()).getBandwidth)===null||i===void 0?void 0:i.call(e,t))!==null&&n!==void 0?n:0},this._markAttributeContext.yBandwidth=(t=0)=>{var e,i,n;return(n=(i=(e=this.getYAxisHelper()).getBandwidth)===null||i===void 0?void 0:i.call(e,t))!==null&&n!==void 0?n:0},this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this)}valueToPosition(t,e){return{x:this.valueToPositionX(t),y:this.valueToPositionY(e)}}_axisPosition(t,e,i){return this._scaleConfig.datum=i,t.isContinuous?t.valueToPosition(e,this._scaleConfig):t.dataToPosition(Y(e),this._scaleConfig)}valueToPositionX(t,e){return this._axisPosition(this._xAxisHelper,t,e)}valueToPositionY(t,e){return this._axisPosition(this._yAxisHelper,t,e)}dataToPositionX(t){if(this._positionXEncoder)return this._positionXEncoder(t);if(!this._xAxisHelper)return this._positionXEncoder=i=>Number.NaN,Number.NaN;const e=this._xAxisHelper.getFields?this._xAxisHelper.getFields():this._fieldX;return e&&e.length!==0?(this._xAxisHelper.isContinuous?this._positionXEncoder=i=>(this._scaleConfig.datum=i,this._xAxisHelper.valueToPosition(this.getDatumPositionValue(i,e[0]),this._scaleConfig)):this._positionXEncoder=i=>(this._scaleConfig.datum=i,this._xAxisHelper.dataToPosition(Y(this.getDatumPositionValues(i,e)),this._scaleConfig)),this._positionXEncoder(t)):(this._positionXEncoder=i=>null,null)}dataToPositionY(t){if(this._positionYEncoder)return this._positionYEncoder(t);if(!this._yAxisHelper)return this._positionYEncoder=i=>Number.NaN,Number.NaN;const e=this._yAxisHelper.getFields?this._yAxisHelper.getFields():this._fieldY;return e&&e.length!==0?(this._yAxisHelper.isContinuous?this._positionYEncoder=i=>(this._scaleConfig.datum=i,this._yAxisHelper.valueToPosition(this.getDatumPositionValue(i,e[0]),this._scaleConfig)):this._positionYEncoder=i=>(this._scaleConfig.datum=i,this._yAxisHelper.dataToPosition(Y(this.getDatumPositionValues(i,e)),this._scaleConfig)),this._positionYEncoder(t)):(this._positionYEncoder=i=>null,null)}dataToPositionZ(t){if(!this._zAxisHelper)return Number.NaN;const{dataToPosition:e}=this._zAxisHelper;return e(this.getDatumPositionValues(t,this._fieldZ),{bandPosition:this._bandPosition})}dataToPositionX1(t){return this._xAxisHelper?this._fieldX2&&this._fieldX2 in t?this.valueToPositionX(this.getDatumPositionValues(t,this._fieldX2)):this.valueToPositionX(0):Number.NaN}dataToPositionY1(t){return this._yAxisHelper?this._fieldY2&&this._fieldY2 in t?this.valueToPositionY(this.getDatumPositionValues(t,this._fieldY2)):this.valueToPositionY(0):Number.NaN}positionToData(t){return t?{x:this.positionToDataX(t.x),y:this.positionToDataY(t.y)}:null}positionToDataX(t){return this._scaleX?this._scaleX.invert(t):null}positionToDataY(t){return this._scaleY?this._scaleY.invert(t):null}getRegionRectLeft(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[0]}getRegionRectRight(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[1]}afterInitMark(){super.afterInitMark(),this.setFieldX(this._fieldX),this.setFieldY(this._fieldY),this._trigger.setStateKeys([...this._fieldX,...this._fieldY]),this._buildScaleConfig()}getDimensionField(){return this._direction==="vertical"?this._specXField:this._specYField}getMeasureField(){return this._direction==="vertical"?this._specYField:this._specXField}viewDataUpdate(t){super.viewDataUpdate(t),this.sortDataByAxis&&this._sortDataInAxisDomain()}_sortDataInAxisDomain(){var t,e,i;!((e=(t=this.getViewData())===null||t===void 0?void 0:t.latestData)===null||e===void 0)&&e.length&&(GB(this._direction==="horizontal"?this._yAxisHelper:this._xAxisHelper,this._direction==="horizontal"?this._fieldY[0]:this._fieldX[0],this.getViewData().latestData),(i=this._data)===null||i===void 0||i.updateData(!0))}reInit(t){this._positionXEncoder&&(this._positionXEncoder=null),this._positionYEncoder&&(this._positionYEncoder=null),super.reInit(t)}}const cA="monotone",WB="linear",ZJ="bevel";class pA{addSamplingCompile(){if(this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],n=this._fieldY,r=this._fieldX;i.push({type:"sampling",size:this._direction==="vertical"?t:e,factor:this._spec.samplingFactor,yfield:this._direction==="vertical"?n[0]:r[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}addOverlapCompile(){var t;if(this._spec.markOverlap){const e=[];e.push({type:"markoverlap",direction:this._direction==="horizontal"&&this.coordinate==="cartesian"?2:1,delta:this._spec.pointDis,deltaMul:this._spec.pointDisMul,groupBy:this._seriesField}),(t=this._symbolMark)===null||t===void 0||t.getProduct().transform(e)}}reCompileSampling(){this._spec.sampling&&this.compile()}initLineMark(t,e){var i;return this._lineMark=this._createMark(ha.line,{defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:e==null||e,progressive:t,customShape:(i=this._spec.line)===null||i===void 0?void 0:i.customShape}),this._lineMark}initLineMarkStyle(t,e){var i,n;const r=this._lineMark;if(r){if(this.setMarkStyle(r,{stroke:this.getColorAttribute()},"normal",tt.Series),this._invalidType!=="zero"&&this.setMarkStyle(r,{defined:this._getInvalidDefined,connectedType:this._getInvalidConnectType()},"normal",tt.Series),this.event.on(St.viewDataStatisticsUpdate,{filter:a=>a.model===this},()=>{this.encodeDefined(r,"defined")}),this.coordinate==="polar")this.setMarkStyle(r,{lineJoin:ZJ,curveType:WB,closePath:!0},"normal",tt.Series);else{const a=e??((n=(i=this.getSpec().line)===null||i===void 0?void 0:i.style)===null||n===void 0?void 0:n.curveType),o=a===cA?t==="vertical"?"monotoneX":"monotoneY":a;this.setMarkStyle(r,{curveType:o},"normal",tt.Built_In)}this.setMarkStyle(r,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",tt.Series),this._trigger.registerMark(r)}return r}_getEventElement(t,e=!1){let i=[];return t.dimensionInfo.some(n=>(n.data.some(r=>r.series===this&&(i=r.datum,!0)),!i.length)),i}_dimensionTrigger(t){const e=this._getEventElement(t);switch(t.action){case"enter":this._symbolActiveMark.getDataView().parse(e),this._symbolActiveMark.getData().updateData(!1);break;case"leave":this._symbolActiveMark.getDataView().parse([]),this._symbolActiveMark.getData().updateData(!1)}}initSymbolMark(t,e){var i,n,r;if(((i=this._spec.point)===null||i===void 0?void 0:i.visible)!==!1&&(this._symbolMark=this._createMark(ha.point,{morph:Yr(this._spec,ha.point.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,progressive:t,isSeriesMark:!!e,customShape:(n=this._spec.point)===null||n===void 0?void 0:n.customShape})),this._spec.activePoint===!0){const a=new Jt(this._option.dataSet,{name:`${At}_series_${this.id}_active_point`});a.parse([]),this._symbolActiveMark=this._createMark({name:"active_point",type:"symbol"},{morph:!1,groupKey:this._seriesField,isSeriesMark:!1,dataView:a,parent:this._region.getInteractionMark(),customShape:(r=this._spec.point)===null||r===void 0?void 0:r.customShape}),this._symbolActiveMark.setVisible(!1)}return this._symbolMark}initSymbolMarkStyle(){const t=this._symbolMark;if(!t)return this._initSymbolActiveMarkAlone(),t;if(this._initSymbolMark(t),this._trigger.registerMark(t),this._symbolActiveMark&&this._symbolMark.stateStyle.dimension_hover){this._symbolActiveMark.setVisible(!0),this.event.on(Nr.dimensionHover,this._dimensionTrigger.bind(this));for(const e in this._symbolMark.stateStyle){this._symbolActiveMark.stateStyle[e]={};for(const i in this._symbolMark.stateStyle[e])this._symbolActiveMark.stateStyle[e][i]={style:null,level:tt.Series,referer:t}}this._symbolActiveMark.state.changeStateInfo({stateValue:bt.STATE_DIMENSION_HOVER,filter:()=>!0})}return t}_initSymbolMark(t){t&&(this.setMarkStyle(t,{fill:this.getColorAttribute()},"normal",tt.Series),this._invalidType!=="zero"&&this.setMarkStyle(t,{visible:this._getInvalidDefined},"normal",tt.Series),this.event.on(St.viewDataStatisticsUpdate,{filter:e=>e.model===this},()=>{this.encodeDefined(t,"visible")}),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",tt.Series))}_initSymbolActiveMarkAlone(){var t,e;const i=this._symbolActiveMark;i&&(this._initSymbolMark(i),i&&(!((e=(t=this._spec[ha.point.name])===null||t===void 0?void 0:t.state)===null||e===void 0)&&e.dimension_hover)&&(i.setVisible(!0),this.event.on(Nr.dimensionHover,this._dimensionTrigger.bind(this)),this.initMarkStyleWithSpec(i,yt({},this._spec[ha.point.name],{visible:!0})),this._symbolActiveMark.state.changeStateInfo({stateValue:bt.STATE_DIMENSION_HOVER,filter:()=>!0})))}initLabelMarkStyle(t){var e;t&&(((e=t.getTarget())===null||e===void 0?void 0:e.type)!=="symbol"&&t.setRule("line-data"),this.setMarkStyle(t,{fill:this.getColorAttribute(),text:i=>i[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null}),this._invalidType!=="zero"&&this.setMarkStyle(t,{visible:this._getInvalidDefined},"normal",tt.Series),this.event.on(St.viewDataStatisticsUpdate,{filter:i=>i.model===this},()=>{this.encodeDefined(t,"visible")}))}initLineLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:e=>e[this.getSeriesField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}encodeDefined(t,e){var i,n,r,a,o,l;if(!t)return;const h=(n=(i=this.getViewDataStatistics())===null||i===void 0?void 0:i.latestData)===null||n===void 0?void 0:n[this.getStackValueField()];if(this._invalidType==="zero"||h&&(h!=null&&h.allValid)){if(((a=(r=t.stateStyle.normal)===null||r===void 0?void 0:r[e])===null||a===void 0?void 0:a.style)===!0)return;this.setMarkStyle(t,{[e]:!0},"normal",tt.Series)}else{if(((l=(o=t.stateStyle.normal)===null||o===void 0?void 0:o[e])===null||l===void 0?void 0:l.style)!==!0)return;this.setMarkStyle(t,{[e]:this._getInvalidDefined},"normal",tt.Series)}t.getProduct()&&t.compileEncode()}}class VB extends Hi{setStyle(t,e="normal",i=0,n=this.stateStyle){if(P(t))return;n[e]===void 0&&(n[e]={});const r=this._getIgnoreAttributes(),a=["strokeWidth","lineWidth","lineDash","strokeDash","lineJoin","stroke","strokeOpacity","opacity","fill","fillOpacity","texture","texturePadding","textureSize","textureColor"],o=this.isUserLevel(i);let l=!1;Object.keys(t).forEach(h=>{const d=t[h];if(P(d)||r.includes(h))return;o&&a.includes(h)&&(kb(d==null?void 0:d.type)||d!=null&&d.scale||K(d))&&(l=!0);let u=this._styleConvert(d);o&&h==="angle"&&(u=this.convertAngleToRadian(u)),this.setAttribute(h,u,e,i,n)}),l&&this.setEnableSegments(l)}}class Zu extends VB{constructor(){super(...arguments),this.type=Zu.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:1})}_getIgnoreAttributes(){var t,e;return((t=this.model)===null||t===void 0?void 0:t.type)===z.radar&&((e=this.model)===null||e===void 0?void 0:e.coordinate)==="polar"?[]:["fill","fillOpacity"]}}Zu.type="line";const gA=()=>{F.registerMark(Zu.type,Zu),JX(),jB()};class UB extends Hi{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{size:1,symbolType:"circle",fill:void 0,lineWidth:0})}}class Ju extends UB{constructor(){super(...arguments),this.type=Ju.type}}Ju.type="symbol";const eo=()=>{F.registerMark(Ju.type,Ju),hL()};class Nc extends Ns{_transformLabelSpec(t){var e,i,n;((e=t.point)===null||e===void 0?void 0:e.visible)!==!1&&((n=(i=t.point)===null||i===void 0?void 0:i.style)===null||n===void 0?void 0:n.visible)!==!1?this._addMarkLabelSpec(t,"point"):this._addMarkLabelSpec(t,"line"),this._addMarkLabelSpec(t,"line","lineLabel","initLineLabelMarkStyle",void 0,!0)}}class El extends pn{constructor(){super(...arguments),this.type=z.line,this.transformerConstructor=Nc,this._sortDataByAxis=!1}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}initMark(){var t;const e={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},i=(t=this._spec.seriesMark)!==null&&t!==void 0?t:"line";this.initLineMark(e,i==="line"),this.initSymbolMark(e,i==="point")}initTooltip(){super.initTooltip(),this._lineMark&&this._tooltipHelper.activeTriggerSet.dimension.add(this._lineMark),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark)}initMarkStyle(){this.initLineMarkStyle(this._direction),this.initSymbolMarkStyle()}initAnimation(){var t,e,i,n;const r={direction:this.direction},a=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;if(this._lineMark.setAnimationConfig(zt((i=F.getAnimationInKey("line"))===null||i===void 0?void 0:i(r,a),Yt("line",this._spec,this._markAttributeContext))),this._symbolMark){const o=to(this);this._symbolMark.setAnimationConfig(zt((n=F.getAnimationInKey("scaleInOut"))===null||n===void 0?void 0:n(),Yt("point",this._spec,this._markAttributeContext),o))}}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){var e;const i=((e=this._spec)===null||e===void 0?void 0:e.seriesMark)!=="point";return n=>{var r,a;return i&&n==="fill"&&(n="stroke"),(a=(r=this._seriesMark)===null||r===void 0?void 0:r.getAttribute(n,t))!==null&&a!==void 0?a:void 0}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._lineMark,this._symbolMark]}}El.type=z.line,El.mark=OL,El.transformerConstructor=Nc,Ai(El,pA);const JJ=()=>{qS(),ZS(),gA(),eo(),DB(),ev(),F.registerSeries(El.type,El)};class QJ{get dataList(){return this._dataArr}constructor(t,e){this._dataArr=[],this._onError=e,this._dataSet=t}parseData(t){this._dataArr=[];const e=Y(t);for(let i=0;i<e.length;i++)this._dataArr.push(v_(e[i],this._dataSet,this._dataArr,{onError:this._onError}))}updateData(t,e=!1,i=!0){const n=Y(t);return(!e||n.length===this._dataArr.length)&&(this._dataValueForEach(n,(r,a)=>{a.markRunning()}),this._dataValueForEach(n,(r,a)=>{rA(a,r,i)}),!0)}_dataValueForEach(t,e){t.forEach((i,n)=>{if(i instanceof Jt)return;const r=this.getSeriesData(i.id,n);r&&e(i,r,n)})}getSeriesData(t,e){var i,n;if(!this._dataArr.length)return null;if(typeof t=="string"){const r=this._dataArr.filter(a=>a.name===t);return r[0]?r[0]:((i=this._onError)===null||i===void 0||i.call(this,`no data matches dataId ${t}!`),null)}return typeof e=="number"?this._dataArr[e]?this._dataArr[e]:((n=this._onError)===null||n===void 0||n.call(this,`no data matches dataIndex ${e}!`),null):this._dataArr[0]}}class tQ{constructor(t,e){this._scaleSpecMap=new Map,this._scaleMap=new Map,this._modelScaleSpecMap=new Map,this._markAttributeScaleMap=new Map,this._spec=null,this._chart=null,this.getStatisticalFields=i=>{const n=[];return this._scaleSpecMap.forEach((r,a)=>{Sl(r.domain)&&r.domain.forEach(o=>{o.dataId===i&&o.fields.forEach(l=>{_h(n,[{key:l,operations:qt(r.type)?["max","min"]:["values"]}])})})}),this._markAttributeScaleMap.forEach((r,a)=>{const o=this.getScale(a);r.forEach(l=>{this._getSeriesBySeriesId(l.seriesId).getRawData().name===i&&l.field&&_h(n,[{key:l.field,operations:qt(o.type)?["max","min"]:["values"]}])})}),n},this._spec=t,this._chart=e,this._setAttrFromSpec()}_createFromSpec(t){if(!t.id)return null;let e=this._scaleMap.get(t.id);return e||(e=t.type==="ordinal"&&t.id==="color"?fx("colorOrdinal"):fx(t.type)),e?($(t.range)&&e.range(t.range),$(t.domain)&&(Sl(t.domain)||e.domain(t.domain)),t.specified&&e.specified&&e.specified(t.specified),e):null}_setAttrFromSpec(){var t;if(!(!((t=this._spec)===null||t===void 0)&&t.length))return;const e=new Map,i=new Map;this._spec.forEach(n=>{const r=this._createFromSpec(n);r&&(e.set(n.id,r),i.set(n.id,n))}),this._modelScaleSpecMap.forEach(n=>{const r=this._createFromSpec(n);r&&(e.set(n.id,r),i.set(n.id,n))}),this._scaleSpecMap=i,this._scaleMap=e}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(Se(t,this._spec))return e;e.change=!0;for(let i=0;i<t.length;i++){const n=t[i],r=this._scaleMap.get(n.id);if(!r)return e.reMake=!0,e;const a=this._spec.find(o=>o.id===n.id);if(!a.id||a.type!==n.type)return e.reMake=!0,e;n.range&&!Se(n.range,r.range())&&(r.range(n.range),e.reRender=!0),Sl(n.domain)?e.reRender=!0:Se(n.domain,r.domain())||(r.domain(n.domain),e.reRender=!0),this._scaleSpecMap.set(n.id,n)}return this._spec=t,e}registerModelScale(t){const e=this._createFromSpec(t);e&&(this._modelScaleSpecMap.set(t.id,t),this._scaleSpecMap.set(t.id,t),this._scaleMap.set(t.id,e))}removeModelScale(t){this._modelScaleSpecMap.forEach(e=>{t(e)&&(this._modelScaleSpecMap.delete(e.id),this._scaleSpecMap.delete(e.id),this._scaleMap.delete(e.id))})}getScale(t){return this._scaleMap.get(t)}getScaleSpec(t){return this._scaleSpecMap.get(t)}_getSeriesByRawDataId(t){const e=this._chart.getAllSeries();for(let i=0;i<e.length;i++){const n=e[i];if(n.getRawData().name===t)return n}return null}_getSeriesBySeriesId(t){const e=this._chart.getAllSeries();for(let i=0;i<e.length;i++){const n=e[i];if(n.id===t)return n}return null}updateScaleDomain(t){this._scaleSpecMap.forEach((e,i)=>{const n=this._scaleMap.get(i);if(!n)return;if(!Sl(e.domain))return e.domain&&e.domain.length!==0||n.domain(t),void this._updateMarkScale(i,n,n.domain().slice());let r;r=qt(e.type)?[null,null]:new Set,e.domain.forEach(o=>{const l=this._getSeriesByRawDataId(o.dataId);if(!l)return;const h=qt(e.type);o.fields.forEach(d=>{const u=l.getRawDataStatisticsByField(d,h);u&&(h?(P(r[0])?r[0]=u.min:r[0]=Math.min(u.min,r[0]),P(r[1])?r[1]=u.max:r[1]=Math.max(u.max,r[1])):u.values.forEach(c=>{r.add(c)}))})});const a=r;qt(e.type)||(r=Array.from(r)),n.domain(r),this._updateMarkScale(i,n,a)})}_updateMarkScale(t,e,i){const n=this._markAttributeScaleMap.get(t);n&&n.length!==0&&n.forEach(r=>{if(!r.field||!r.markScale||r.markScale===e)return;if(P(r.changeDomain)||r.changeDomain==="none"||P(r.seriesId))return void(qt(e.type)?r.markScale.domain(i):e.domain(Array.from(i)));const a=this._getSeriesBySeriesId(r.seriesId),o=qt(e.type),l=a.getRawDataStatisticsByField(r.field,o);if(!vt(l))return r.changeDomain==="expand"?(o?(i[0]=Math.min(i[0],l.min),i[1]=Math.max(i[1],l.max)):(l.values.forEach(h=>{i.add(h)}),i=Array.from(i)),void r.markScale.domain(i)):void(r.changeDomain!=="replace"||(o?r.markScale.domain([l.min,l.max]):r.markScale.domain(l.values)));qt(e.type)?r.markScale.domain(i):e.domain(Array.from(i))})}registerMarkAttributeScale(t,e){const i=this._scaleMap.get(t.scale);let n=this._markAttributeScaleMap.get(t.scale);n||(n=[],this._markAttributeScaleMap.set(t.scale,n));let r=i;return(P(t.field)||!P(t.changeDomain)&&t.changeDomain!=="none"&&!P(e))&&(r=i.clone()),n.push(Object.assign(Object.assign({},t),{seriesId:e,markScale:r})),r}}class eQ{constructor(t){this.stackRegion=({model:e})=>{const i=e.getSeries();if(!i.some(l=>l.getStack()))return;const n=i.some(l=>{var h,d;return(d=(h=l.getSpec())===null||h===void 0?void 0:h.totalLabel)===null||d===void 0?void 0:d.visible}),r=n||i.some(l=>l.getPercent()),a=i.some(l=>l.getStackOffsetSilhouette()),o=cB(e,!0);for(const l in o)for(const h in o[l].nodes)gB(o[l].nodes[h],e.getStackInverse(),r);if(a)for(const l in o)for(const h in o[l].nodes)FZ(o[l].nodes[h]);n&&e.getSeries().forEach(l=>{const h=l.getStackData(),d=l.getStackValue(),u=l.getStackValueField();h&&u&&pB(o[d],u)})},this._chart=t}init(){this._chart.getAllRegions().forEach(t=>{t.event.on(St.regionSeriesDataFilterOver,{filter:({model:e})=>(e==null?void 0:e.id)===t.id},this.stackRegion)})}stackAll(){this._chart.getAllRegions().forEach(t=>{this.stackRegion({model:t})})}}var IC=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};let Ce=class extends qm{getSpec(){return this._spec}setSpec(t){this._spec=t}getOption(){return this._option}getLayoutRect(){return this._layoutRect}getViewRect(){return this._viewRect}getLayoutTag(){return this._layoutTag}setLayoutTag(t,e,i=!0){var n;return this._layoutTag=t,!((n=this.getCompiler())===null||n===void 0)&&n.getVGrammarView()&&(this.getCompiler().getVGrammarView().updateLayoutTag(),t&&i&&this.getCompiler().renderAsync(e)),this._layoutTag}getEvent(){return this._event}get chartData(){return this._chartData}constructor(t,e){var i,n,r,a;super(e),this.type="chart",this.id=No(),this._regions=[],this._series=[],this._components=[],this._layoutRect={x:0,y:0,width:Al,height:kl},this._viewRect={width:Al,height:kl},this._viewBox={x1:0,y1:0,x2:Al,y2:kl},this._layoutTag=!0,this._idMap=new Map,this.state={layoutUpdateRank:1},this.padding={top:0,left:0,right:0,bottom:0},this.getAllSeries=()=>{var o;return(o=this._series)!==null&&o!==void 0?o:[]},this.getRegionsInIndex=o=>o&&o.length!==0?this._regions.filter((l,h)=>o.includes(h)):[this._regions[0]],this.getAllRegions=()=>this._regions,this.getRegionsInIds=o=>o?this._regions.filter(l=>o.includes(l.id)):[],this.getRegionsInQuerier=o=>o?this._regions.filter((l,h)=>Y(o).some(d=>E(d.regionId)&&d.regionId===l.userId||d.regionIndex===h)):this._regions,this.getRegionsInUserId=o=>{if(o)return this._regions.find(l=>l.userId===o)},this.getRegionsInUserIdOrIndex=(o,l)=>this.getAllRegions().filter(h=>o!=null&&o.length?h.userId&&o.includes(h.userId):!(l!=null&&l.length)||l.includes(h.getSpecIndex())),this.getComponents=()=>this._components,this.getSeriesInIndex=o=>o&&o.length!==0?this._series.filter((l,h)=>o.includes(h)):[this._series[0]],this.getSeriesInIds=o=>o?this._series.filter(l=>o.includes(l.id)):[],this.getSeriesInUserId=o=>{if(o)return this._series.find(l=>l.userId===o)},this.getSeriesInUserIdOrIndex=(o,l)=>this.getAllSeries().filter(h=>o!=null&&o.length?h.userId&&o.includes(h.userId):!(l!=null&&l.length)||l.includes(h.getSpecIndex())),this.getComponentByIndex=(o,l)=>{const h=this._components.filter(d=>(d.specKey||d.type)===o);if(h&&h.length!==0)return h[l]},this.getComponentsByKey=o=>this._components.filter(l=>(l.specKey||l.type)===o),this.getComponentByUserId=o=>{const l=this._components.find(h=>h.userId===o);if(l)return l},this._paddingSpec=Hr((i=t.padding)!==null&&i!==void 0?i:e.getTheme().padding),this._event=new Hc(e.eventDispatcher,e.mode),this._dataSet=e.dataSet,this._chartData=new QJ(this._dataSet,(n=this._option)===null||n===void 0?void 0:n.onError),this._modelOption=Object.assign(Object.assign({},e),{mode:this._option.mode,map:this._idMap,getChartLayoutRect:()=>this._layoutRect,getChartViewRect:()=>this._viewRect,getChart:()=>this,globalScale:this._globalScale,onError:(r=this._option)===null||r===void 0?void 0:r.onError,disableTriggerEvent:((a=this._option)===null||a===void 0?void 0:a.disableTriggerEvent)===!0,getSeriesData:this._chartData.getSeriesData.bind(this._chartData)}),this._spec=t}created(){this._transformer=new this.transformerConstructor({type:this.type,seriesType:this.seriesType,getTheme:this._option.getTheme,animation:this._option.animation}),this._chartData.parseData(this._spec.data),this._createGlobalScale(),this._spec.background&&typeof this._spec.background=="object"&&this._createBackground(),this._createLayout(),this._transformer.forEachRegionInSpec(this._spec,this._createRegion.bind(this)),this._transformer.forEachSeriesInSpec(this._spec,this._createSeries.bind(this)),this._transformer.forEachComponentInSpec(this._spec,this._createComponent.bind(this),this._option.getSpecInfo())}init(){this._regions.forEach(t=>t.init({})),this._series.forEach(t=>t.init({})),this._components.forEach(t=>t.init({dataSet:this._dataSet})),this._initEvent(),this._canStack&&(this._stack=new eQ(this),this._stack.init()),this.reDataFlow()}reDataFlow(){this._series.forEach(t=>{var e;return(e=t.getRawData())===null||e===void 0?void 0:e.markRunning()}),this._series.forEach(t=>t.fillData()),this.updateGlobalScaleDomain()}onResize(t,e,i=!0){const n={width:t,height:e};this._canvasRect=n,this._updateLayoutRect(this._option.viewBox),this.setLayoutTag(!0,null,i)}updateViewBox(t,e){this._option.viewBox=t,this._updateLayoutRect(t),this.setLayoutTag(!0,null,e)}_createBackground(){const t=bq(this._spec.background);t&&(this._backgroundMark=F.createMark("group","chart-background",{model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._globalScale}),this._backgroundMark.created(),this._backgroundMark.setStyle(Object.assign(Object.assign({},t),{x:()=>this._viewBox.x1,y:()=>this._viewBox.y1,width:()=>this._viewBox.x2-this._viewBox.x1,height:()=>this._viewBox.y2-this._viewBox.y1})))}_createRegion(t,e){if(!t)return;const{spec:i}=e,n=IC(e,["spec"]),r=new t(i,Object.assign(Object.assign({},this._modelOption),n));r&&(r.created(),this._regions.push(r))}_createSeries(t,e){if(!t)return;const{spec:i}=e,n=IC(e,["spec"]);let r;if(E(i.regionId)?r=this.getRegionsInUserId(i.regionId):E(i.regionIndex)&&(r=this.getRegionsInIndex([i.regionIndex])[0]),!r&&!(r=this._regions[0]))return;const a=new t(i,Object.assign(Object.assign(Object.assign({},this._modelOption),n),{type:i.type,region:r,globalScale:this._globalScale,sourceDataList:this._chartData.dataList}));a&&(a.created(),this._series.push(a),r.addSeries(a))}getSeriesById(t){return this._series.find(e=>e.id===t)}_createComponent(t,e){const i=t.createComponent(e,Object.assign(Object.assign({},this._modelOption),{type:t.type,getAllRegions:this.getAllRegions,getRegionsInIndex:this.getRegionsInIndex,getRegionsInIds:this.getRegionsInIds,getRegionsInUserIdOrIndex:this.getRegionsInUserIdOrIndex,getAllSeries:this.getAllSeries,getSeriesInIndex:this.getSeriesInIndex,getSeriesInIds:this.getSeriesInIds,getSeriesInUserIdOrIndex:this.getSeriesInUserIdOrIndex,getAllComponents:this.getComponents,getComponentByIndex:this.getComponentByIndex,getComponentByUserId:this.getComponentByUserId,getComponentsByKey:this.getComponentsByKey}));i&&(i.created(),this._components.push(i))}getAllComponents(){return this._components}getAllModels(){return[].concat(this.getAllSeries(),this.getAllComponents(),this.getAllRegions())}getModelInFilter(t){if(ht(t))return this.getAllModels().find(i=>i.userId===t);if(K(t))return this.getAllModels().find(i=>t(i));let e=0;return this.getAllModels().find(i=>{var n;if(((n=i.specKey)!==null&&n!==void 0?n:i.type)===t.type){if(e===t.index)return!0;e++}return!1})}_createLayout(){this._updateLayoutRect(this._option.viewBox),this._initLayoutFunc()}setLayout(t){this._option.layout=t,this._initLayoutFunc()}_initLayoutFunc(){var t,e,i;if(this._layoutFunc=this._option.layout,!this._layoutFunc){let n=!1;(this._spec.zField||this._spec.series&&this._spec.series.some(a=>a.zField))&&(n=!0);const r=F.getLayoutInKey((e=(t=this._spec.layout)===null||t===void 0?void 0:t.type)!==null&&e!==void 0?e:n?"layout3d":"base");if(r){const a=new r(this._spec.layout,{onError:(i=this._option)===null||i===void 0?void 0:i.onError});this._layoutFunc=a.layoutItems.bind(a)}}}layout(t){var e,i,n,r;if((i=(e=this._option.performanceHook)===null||e===void 0?void 0:e.beforeLayoutWithSceneGraph)===null||i===void 0||i.call(e),this.getLayoutTag()){this._event.emit(St.layoutStart,{chart:this}),this.onLayoutStart(t);const a=this.getLayoutElements();this._layoutFunc(this,a,this._layoutRect,this._viewBox),this._event.emit(St.afterLayout,{elements:a}),this.setLayoutTag(!1),this.onLayoutEnd(t),this._event.emit(St.layoutEnd,{chart:this})}(r=(n=this._option.performanceHook)===null||n===void 0?void 0:n.afterLayoutWithSceneGraph)===null||r===void 0||r.call(n)}onLayoutStart(t){this.getAllModels().forEach(e=>e.onLayoutStart(this._layoutRect,this._viewRect,t))}onLayoutEnd(t){this.getAllModels().forEach(e=>e.onLayoutEnd(t))}onEvaluateEnd(t){[...this._components,...this._regions,...this._series].forEach(e=>e.onEvaluateEnd(t))}getLayoutElements(){return this.getAllModels().map(t=>t.layout).filter(t=>!!t)}getModelById(t){const e=this._idMap.get(t);if(e&&e instanceof oA)return e}getModelByUserId(t){const e=this._series.find(r=>r.userId===t);if(e)return e;const i=this._regions.find(r=>r.userId===t);return i||this._components.find(r=>r.userId===t)||void 0}getAllMarks(){return Array.from(this._idMap.values()).filter(t=>t&&t instanceof Hi)}getMarkById(t){const e=this._idMap.get(t);if(e&&e instanceof Hi)return e}updateData(t,e,i=!0,n){const r=this._dataSet.getDataView(t);r&&(r.markRunning(),r.parseNewData(e,n)),i&&this.updateGlobalScaleDomain(),this.getAllModels().forEach(a=>a.onDataUpdate())}updateFullData(t,e=!0){Y(t).forEach(i=>{const n=this._dataSet.getDataView(i.id);n&&n.markRunning()}),Y(t).forEach(i=>{const n=this._dataSet.getDataView(i.id);n&&rA(n,i,!0)}),e&&this.updateGlobalScaleDomain(),this.getAllModels().forEach(i=>i.onDataUpdate())}onRender(t){}setCanvasRect(t,e){this._canvasRect={width:t,height:e}}getCanvasRect(){return this._canvasRect||(this._canvasRect=TB(this._spec,this._option,{width:Al,height:kl})),this._canvasRect}getSeriesData(t,e){return this._chartData.getSeriesData(t,e)}_transformSpecScale(){var t,e;const i=(t=this._spec.scales)!==null&&t!==void 0?t:[];let n=i.find(a=>a.id==="color");const r=this.getColorScheme();if(!n&&(n={type:"ordinal",id:"color",domain:null,range:null},i.push(n),this._spec.color)){const a=this._spec.color;if($(a))n.range=a;else{const o=a;Object.prototype.hasOwnProperty.call(o,"type")&&(n.type=o.type),Object.prototype.hasOwnProperty.call(o,"domain")&&(n.domain=o.domain),Object.prototype.hasOwnProperty.call(o,"range")&&(n.range=o.range),Object.prototype.hasOwnProperty.call(o,"specified")&&(n.specified=o.specified)}}return!((e=n.range)===null||e===void 0)&&e.length||(n.range=Yu(r),n.rangeTheme=!0),i}_createGlobalScale(){this._globalScale=new tQ(this._transformSpecScale(),this),this._modelOption.globalScale=this._globalScale}updateGlobalScaleDomain(){const t=new Set;this._series.forEach(i=>{const n=i.getSeriesKeys();n&&n.forEach(r=>t.add(r))});const e=Array.from(t);this._globalScale.updateScaleDomain(e)}updateGlobalScale(t){cl(t,this._globalScale.updateSpec(this._transformSpecScale()))}updateGlobalScaleTheme(){const t=this._globalScale.getScaleSpec("color"),e=this.getColorScheme();t.rangeTheme&&(t.range=Yu(e),this._globalScale.getScale("color").range(t.range))}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(this.setLayoutTag(!0,null,!1),t.type!==this.type)return e.reMake=!0,e;const i=Object.keys(this._spec).sort(),n=Object.keys(t).sort();if(JSON.stringify(i)!==JSON.stringify(n))return e.reMake=!0,e;const r=this._spec;return this._spec=t,this.updateChartConfig(e,r),e.reMake?e:(this.updateGlobalScale(e),e.reMake?e:(this.updateRegionSpec(e),e.reMake?e:(this.updateComponentSpec(e),e.reMake?e:(this.updateSeriesSpec(e),e.reMake||(this.updateDataSpec(e),e.reMake||this.updateGlobalScaleDomain()),e))))}updateChartConfig(t,e){var i,n;this._paddingSpec=Hr((i=this._spec.padding)!==null&&i!==void 0?i:(n=this._option)===null||n===void 0?void 0:n.getTheme().padding),this._updateLayoutRect(this._viewBox),Se(this._spec.background,e.background)||(t.reMake=!0)}updateDataSpec(t){this._spec.data&&this._chartData.updateData(this._spec.data,!1,!0)}updateRegionSpec(t){var e;!((e=this._spec)===null||e===void 0)&&e.region&&(this._spec.region.length===this._regions.length?this._regions.forEach(i=>{cl(t,i.updateSpec(this._spec.region[i.getSpecIndex()]))}):t.reMake=!0)}updateComponentSpec(t){const e={};this._components.forEach(i=>{var n,r;const a=i.specKey||i.type,o=(n=this._spec[a])!==null&&n!==void 0?n:{};$(o)?(e[a]=e[a]||{specCount:o.length,componentCount:0},e[a].componentCount++,cl(t,i.updateSpec((r=o[i.getSpecIndex()])!==null&&r!==void 0?r:{},o))):cl(t,i.updateSpec(o))});for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const n=e[i];n.componentCount!==n.specCount&&(t.reMake=!0)}}updateSeriesSpec(t){this._spec.series.length===this._series.length?this._series.forEach(e=>{const i=this._spec.series[e.getSpecIndex()];cl(t,e.updateSpec(i))}):t.reMake=!0}getCanvas(){var t,e;return(e=(t=this.getCompiler())===null||t===void 0?void 0:t.getCanvas())!==null&&e!==void 0?e:null}_updateLayoutRect(t){let e=this.getCanvasRect();if(t){this._viewBox=t;const{x1:i=0,y1:n=0,x2:r,y2:a}=t;e={width:r-i,height:a-n}}else this._viewBox={x1:0,y1:0,x2:e.width,y2:e.height};this._viewRect=e,this.padding=aB(this._paddingSpec,e,e),this._layoutRect.width=e.width-this.padding.left-this.padding.right,this._layoutRect.height=e.height-this.padding.top-this.padding.bottom,this._layoutRect.x=this.padding.left,this._layoutRect.y=this.padding.top,this._event.emit(St.layoutRectUpdate,{})}setCurrentTheme(){this.updateChartConfig({change:!0,reMake:!1},this._spec),this.setLayoutTag(!0,null,!1),this.updateGlobalScaleTheme(),this._regions.forEach(t=>t.reInit(t.getSpecInfo().spec)),this._series.forEach(t=>t.reInit(t.getSpecInfo().spec)),this._components.forEach(t=>t.reInit(t.getSpecInfo().spec))}clear(){this.getAllModels().forEach(t=>{var e;return(e=t.clear)===null||e===void 0?void 0:e.call(t)})}compile(){this.compileBackground(),this.compileLayout(),this.compileRegions(),this.compileSeries(),this.compileComponents()}afterCompile(){this.getAllRegions().forEach(t=>{var e;(e=t.afterCompile)===null||e===void 0||e.call(t)}),this.getAllSeries().forEach(t=>{var e;(e=t.afterCompile)===null||e===void 0||e.call(t)}),this.getAllComponents().forEach(t=>{var e;(e=t.afterCompile)===null||e===void 0||e.call(t)})}compileLayout(){const{width:t,height:e}=this.getCanvasRect();this.getCompiler().setSize(t,e)}compileBackground(){var t;this._backgroundMark&&(this._backgroundMark.compile(),(t=this._backgroundMark.getProduct())===null||t===void 0||t.configure({context:{model:this}}).layout(()=>{}))}compileRegions(){var t,e,i,n;(e=(t=this._option.performanceHook)===null||t===void 0?void 0:t.beforeRegionCompile)===null||e===void 0||e.call(t),this.getAllRegions().forEach(r=>{r.compile()}),(n=(i=this._option.performanceHook)===null||i===void 0?void 0:i.afterRegionCompile)===null||n===void 0||n.call(i)}compileSeries(){var t,e,i,n;(e=(t=this._option.performanceHook)===null||t===void 0?void 0:t.beforeSeriesCompile)===null||e===void 0||e.call(t),this.getAllSeries().forEach(r=>{r.compile()}),(n=(i=this._option.performanceHook)===null||i===void 0?void 0:i.afterSeriesCompile)===null||n===void 0||n.call(i)}compileComponents(){var t,e,i,n;(e=(t=this._option.performanceHook)===null||t===void 0?void 0:t.beforeComponentCompile)===null||e===void 0||e.call(t),this.getAllComponents().forEach(r=>{r.compile()}),(n=(i=this._option.performanceHook)===null||i===void 0?void 0:i.afterComponentCompile)===null||n===void 0||n.call(i)}release(){[...this._components,...this._regions,...this._series].forEach(t=>{t.beforeRelease()}),super.release(),this.clear(),[...this._components,...this._regions,...this._series].forEach(t=>{t.release()}),this._components=this._regions=this._series=[],this._spec={},this._dataSet=this._globalScale=this._layoutFunc=null,this._layoutTag=!1,this._idMap.clear()}onLayout(t){const e=t.rootMark;this.layout({group:e,srView:t})}updateState(t,e){const i=this.getAllSeries();for(const n in t){if(vt(t[n]))continue;const r=t[n];let a={stateValue:n};a=K(r.filter)?Object.assign({filter:r.filter},a):Object.assign(Object.assign({},r.filter),a),r.level&&(a.level=r.level),i.forEach(o=>{o.getMarks().forEach(l=>{l.stateStyle[n]&&(e&&!e(o,l,n)||(l.state.changeStateInfo(a),l.updateMarkState(n)))})})}}setSelected(t,e,i){this._setStateInDatum(bt.STATE_SELECTED,!0,t,e,i)}setHovered(t,e,i){this._setStateInDatum(bt.STATE_HOVER,!0,t,e,i)}_initEvent(){[St.dataZoomChange,St.scrollBarChange].forEach(t=>{this._event.on(t,({value:e})=>{if(!e.filterData)return;this._disableMarkAnimation(["exit","update"]);const i=()=>{this._enableMarkAnimation(["exit","update"]),this._event.off(gt.AFTER_MARK_RENDER_END,i)};this._event.on(gt.AFTER_MARK_RENDER_END,i)})})}_enableMarkAnimation(t){this.getAllMarks().forEach(e=>{const i=e.getProduct();i&&i.animate&&i.animate.enableAnimationState(t)})}_disableMarkAnimation(t){this.getAllMarks().forEach(e=>{const i=e.getProduct();i&&i.animate&&i.animate.disableAnimationState(t)})}_setStateInDatum(t,e,i,n,r){const a=(i=i?Y(i):null)?Object.keys(i[0]):null;this.getRegionsInQuerier(r).forEach(o=>{i?(o.getSeries().forEach(l=>{l.getMarks().forEach(h=>{if(h.getProduct()&&(!n||K(n)&&n(l,h))){const d=h.getProduct().isCollectionMark(),u=h.getProduct().elements;let c=u;if(d)c=u.filter(p=>{const g=p.getDatum();i.every((f,_)=>a.every(m=>f[m]==g[_][m]))});else if(i.length>1){const p=i.slice();c=u.filter(g=>{if(p.length===0)return!1;const f=g.getDatum(),_=p.findIndex(m=>a.every(v=>m[v]==f[v]));return _>=0&&(p.splice(_,1),!0)})}else{const p=u.find(g=>a.every(f=>i[0][f]==g.getDatum()[f]));p&&(c=[p])}c.forEach(p=>{o.interaction.addEventElement(t,p)})}})}),e&&o.interaction.reverseEventElement(t)):o.interaction.clearEventElement(t,!0)})}setDimensionIndex(t,e){var i,n,r,a;let o=null;Array.from(this._event.getComposedEventMap().values()).forEach(h=>{const{eventType:d,event:u}=h;if(d===Nr.dimensionHover||d===Nr.dimensionClick){const c=u.dispatch(t,e);c!=null&&c.length&&(o=c)}});const l=P(t)||!o||o.every(h=>ji(h.axis.getScale().type)&&P(h.index));if(e.tooltip!==!1){const h=this._components.find(d=>d.type===Z.tooltip);if(h!=null&&h.getVisible())if(l)(n=(i=h).hideTooltip)===null||n===void 0||n.call(i);else{const d={};o.forEach(u=>{const{axis:c,value:p,data:g}=u,f=c.getOrient()==="left"||c.getOrient()==="right";g.forEach(_=>{f?d[_.series.fieldY[0]]=p:d[_.series.fieldX[0]]=p})}),h.showTooltip(d,e.showTooltipOption)}}if(e.crosshair!==!1){const h=this._components.find(d=>d.type===Z.cartesianCrosshair);h&&h.clearAxisValue&&h.setAxisValue&&(l?((r=h.clearAxisValue)===null||r===void 0||r.call(h),(a=h.hide)===null||a===void 0||a.call(h)):o.forEach(d=>{const{axis:u,value:c}=d;h.clearAxisValue(),h.setAxisValue(c,u),h.layoutByValue()}))}}getColorScheme(){var t,e;return(e=(t=this._option).getTheme)===null||e===void 0?void 0:e.call(t).colorScheme}};class gn{constructor(t){this._option=t,this.type=t.type,this.seriesType=t.seriesType}initChartSpec(t){return this.transformSpec(t),this.transformModelSpec(t)}transformSpec(t){t.region&&t.region.length!==0||(t.region=[{}]),Zs(t,"tooltip")||(t.tooltip={}),E(t.stackInverse)&&t.region.forEach(e=>!E(e.stackInverse)&&(e.stackInverse=t.stackInverse))}transformModelSpec(t){return this.createSpecInfo(t,(e,i,n)=>{const{spec:r,specPath:a,specInfoPath:o,type:l}=i,h=new e.transformerConstructor({type:l,getTheme:this._option.getTheme}).transformSpec(r,t,n);pg(t,a,h.spec),pg(n,o??a,Object.assign(Object.assign({},i),h))})}createSpecInfo(t,e){var i;e||(e=(a,o,l)=>{const{spec:h,specPath:d,specInfoPath:u,type:c}=o,p=new a.transformerConstructor({type:c,getTheme:this._option.getTheme});pg(l,u??d,Object.assign(Object.assign({},o),{theme:p.getTheme(h,t)}))});const n={};let r;return this.forEachRegionInSpec(t,e,n),this.forEachSeriesInSpec(t,e,n),(i=n.series)===null||i===void 0||i.forEach(({spec:{regionId:a,regionIndex:o}},l)=>{var h,d,u;E(a)?r=(h=n.region)===null||h===void 0?void 0:h.find(({spec:c})=>c.id===a):E(o)&&(r=(d=n.region)===null||d===void 0?void 0:d[o]),(r||(r=(u=n.region)===null||u===void 0?void 0:u[0]))&&(r.seriesIndexes||(r.seriesIndexes=[]),r.seriesIndexes.push(l))}),this.forEachComponentInSpec(t,e,n),n}_isValidSeries(t){return!0}_getDefaultSeriesSpec(t){var e,i,n,r;return{dataKey:t.dataKey,hover:t.hover,select:t.select,label:t.label,seriesStyle:t.seriesStyle,animation:(e=t.animation)!==null&&e!==void 0?e:this._option.animation,animationThreshold:(i=t.animationThreshold)!==null&&i!==void 0?i:(r=(n=this._option).getTheme)===null||r===void 0?void 0:r.call(n).animationThreshold,animationAppear:t.animationAppear,animationDisappear:t.animationDisappear,animationEnter:t.animationEnter,animationUpdate:t.animationUpdate,animationExit:t.animationExit,animationNormal:t.animationNormal,extensionMark:t.extensionMark,large:t.large,largeThreshold:t.largeThreshold,progressiveStep:t.progressiveStep,progressiveThreshold:t.progressiveThreshold,background:t.seriesBackground,invalidType:t.invalidType,seriesField:t.seriesField,morph:t.morph}}forEachRegionInSpec(t,e,i){var n;return((n=t.region)!==null&&n!==void 0?n:[]).map((r,a)=>e(F.getRegionInType("region"),{spec:r,specIndex:a,specPath:["region",a],type:"region"},i))}forEachSeriesInSpec(t,e,i){var n;return((n=t.series)!==null&&n!==void 0?n:[]).map((r,a)=>e(F.getSeriesInType(r.type),{spec:r,specIndex:a,specPath:["series",a],type:r.type},i))}forEachComponentInSpec(t,e,i){var n,r,a,o;const l=[],h=F.getComponents();let d,u,c,p,g;const f=[];for(let m=0;m<h.length;m++){const{cmp:v,alwaysCheck:y}=h[m];v.type.startsWith(Z.cartesianAxis)?d=v:v.type.startsWith(Z.polarAxis)?u=v:v.type===Z.geoCoordinate?c=v:(y||t[(n=v.specKey)!==null&&n!==void 0?n:v.type])&&(v.type===Z.label?p=v:v.type===Z.totalLabel&&(g=v),f.push(v))}let _=!1;if(d){const m=d.getSpecInfo(t);(m==null?void 0:m.length)>0&&(_=!0,m.forEach(v=>{const y=F.getComponentInKey(v.type);l.push(e(y,v,i))}))}if(u&&!_){const m=u.getSpecInfo(t);(m==null?void 0:m.length)>0&&(_=!0,m.forEach(v=>{const y=F.getComponentInKey(v.type);l.push(e(y,v,i))}))}return c&&!_&&((r=c.getSpecInfo(t))===null||r===void 0||r.forEach(m=>{l.push(e(c,m,i))})),p&&i&&((a=p.getSpecInfo(t,i))===null||a===void 0||a.forEach(m=>{l.push(e(p,m,i))})),g&&i&&((o=g.getSpecInfo(t,i))===null||o===void 0||o.forEach(m=>{l.push(e(g,m,i))})),f.forEach(m=>{var v;(v=m.getSpecInfo(t))===null||v===void 0||v.forEach(y=>{l.push(e(m,y,i))})}),l}}class jn extends gn{needAxes(){return!0}_isValidSeries(t){return!this.seriesType||t===this.seriesType}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{xField:t.xField,yField:t.yField,zField:t.zField,seriesField:t.seriesField,seriesStyle:t.seriesStyle,direction:t.direction,stack:t.stack,percent:t.percent,stackOffsetSilhouette:t.stackOffsetSilhouette,totalLabel:t.totalLabel,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={x:!1,y:!1,z:!1};t.axes.forEach(n=>{const{orient:r}=n;r!=="top"&&r!=="bottom"||(i.x=!0),r!=="left"&&r!=="right"||(i.y=!0),r==="z"&&(i.z=!0),It(n,"trimPadding")&&yt(n,MB(this.type,t))}),i.x||t.axes.push({orient:"bottom"}),i.y||t.axes.push({orient:"left"}),t.zField&&!i.z&&t.axes.push({orient:"z"})}const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class $B extends jn{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,seriesMark:(e=t.seriesMark)!==null&&e!==void 0?e:"line",activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,lineLabel:t.lineLabel})}transformSpec(t){super.transformSpec(t),Qa(t)}}class Rl extends Ce{constructor(){super(...arguments),this.transformerConstructor=$B,this.type="line",this.seriesType=z.line,this._canStack=!0}}Rl.type="line",Rl.seriesType=z.line,Rl.view="singleDefault",Rl.transformerConstructor=$B;const iQ=()=>{JJ(),F.registerChart(Rl.type,Rl)};class Qu extends VB{constructor(){super(...arguments),this.type=Qu.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}_getIgnoreAttributes(){return[]}}Qu.type="area";const fA=()=>{F.registerMark(Qu.type,Qu),KX(),jB()};class sQ extends ys{constructor(){super(...arguments),this._getSeriesStyle=(t,e,i)=>{var n,r,a,o;for(const l of Y(e)){let h=(n=this.series.getSeriesStyle(t))===null||n===void 0?void 0:n(l);if(h!==!1||l!=="fill"&&l!=="stroke"||(h=l==="fill"?(a=(r=this.series.getSeriesStyle(t))===null||r===void 0?void 0:r("stroke"))===null||a===void 0?void 0:a[0]:(o=this.series.getSeriesStyle(t))===null||o===void 0?void 0:o("fill")),E(h))return h}return i}}}const nQ={type:"clipIn"},rQ=s=>({type:s.direction==="horizontal"?"growPointsXIn":"growPointsYIn",options:{orient:s.direction==="horizontal"?"positive":"negative"}}),aQ={type:"fadeIn"};function oQ(s,t){if(t===!1)return{};switch(t){case"grow":return rQ(s);case"fadeIn":return aQ;default:return nQ}}const lQ=()=>{F.registerAnimation("area",(s,t)=>({appear:oQ(s,t),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"clipOut"}})),DB(),ev()};class YB extends Nc{_transformLabelSpec(t){var e,i,n;super._transformLabelSpec(t),this._addMarkLabelSpec(t,"area","areaLabel","initLineLabelMarkStyle",void 0,!0),((e=t.point)===null||e===void 0?void 0:e.visible)!==!1&&((n=(i=t.point)===null||i===void 0?void 0:i.style)===null||n===void 0?void 0:n.visible)!==!1||this._addMarkLabelSpec(t,"area")}_transformSpecAfterMergingTheme(t,e,i){var n,r,a,o,l;super._transformSpecAfterMergingTheme(t,e,i);const{area:h={},line:d={},seriesMark:u="area"}=t,c=h.visible!==!1&&((n=h.style)===null||n===void 0?void 0:n.visible)!==!1,p=d.visible!==!1&&((r=d.style)===null||r===void 0?void 0:r.visible)!==!1;h.interactive=!(!h.interactive&&(a=d.interactive)!==null&&a!==void 0&&!a),h.support3d=!(!h.support3d&&!d.support3d),h.zIndex=E(h.zIndex)||E(d.zIndex)?Math.max((o=h.zIndex)!==null&&o!==void 0?o:0,(l=d.zIndex)!==null&&l!==void 0?l:0):void 0,h.style&&delete h.style.stroke,h.state&&Object.keys(h.state).forEach(_=>{"style"in h.state[_]?delete h.state[_].style.stroke:delete h.state[_].stroke});let g=h,f=d;(u==="line"||p&&!c)&&(g=d,f=h),h.style=yt({},f.style,g.style),h.state=yt({},f.state,g.state),c||(h.style.fill=!1),p||(h.style.stroke=!1),h.visible=!(!c&&!p),t.area=h,t.line=d}}class Rr extends pn{constructor(){super(...arguments),this.type=z.area,this.transformerConstructor=YB,this._supportStack=!0,this._sortDataByAxis=!1}initMark(){var t,e,i,n,r;const a={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},o=((t=this._spec.area)===null||t===void 0?void 0:t.visible)!==!1&&((i=(e=this._spec.area)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.visible)!==!1,l=(n=this._spec.seriesMark)!==null&&n!==void 0?n:"area";this._areaMark=this._createMark(Rr.mark.area,{groupKey:this._seriesField,defaultMorphElementKey:this.getDimensionField()[0],progressive:a,isSeriesMark:o&&l!=="point",customShape:(r=this._spec.area)===null||r===void 0?void 0:r.customShape}),this.initSymbolMark(a,l==="point")}initMarkStyle(){var t,e,i,n,r;const a=(i=(e=(t=this.getSpec().area)===null||t===void 0?void 0:t.style)===null||e===void 0?void 0:e.curveType)!==null&&i!==void 0?i:(r=(n=this.getSpec().line)===null||n===void 0?void 0:n.style)===null||r===void 0?void 0:r.curveType,o=a===cA?this._direction==="vertical"?"monotoneX":"monotoneY":a,l=this._areaMark;l&&(this._direction==="vertical"?this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),y1:h=>{var d,u;return ee(this.dataToPositionY1(h),(u=(d=this._yAxisHelper)===null||d===void 0?void 0:d.getScale)===null||u===void 0?void 0:u.call(d,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",tt.Series):this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:h=>{var d,u;return ee(this.dataToPositionX1(h),(u=(d=this._xAxisHelper)===null||d===void 0?void 0:d.getScale)===null||u===void 0?void 0:u.call(d,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,orient:this._direction},"normal",tt.Series),this.setMarkStyle(l,{fill:this.getColorAttribute(),stroke:this.getColorAttribute()},"normal",tt.Series),this._invalidType!=="zero"&&this.setMarkStyle(l,{defined:this._getInvalidDefined,connectedType:this._getInvalidConnectType()},"normal",tt.Series),this.setMarkStyle(l,{curveType:o},"normal",tt.Built_In),this._trigger.registerMark(l),Object.keys(l.stateStyle).forEach(h=>{l.stateStyle[h].stroke&&l.setPostProcess("stroke",d=>[d,!1,!1,!1],h)})),this.initLineMarkStyle(this._direction,a),this.initSymbolMarkStyle()}initAnimation(){var t,e,i,n;const r={direction:this.direction},a=(t=this._spec.animationAppear)===null||t===void 0?void 0:t.preset;if(this._lineMark&&this._lineMark.setAnimationConfig(zt((e=F.getAnimationInKey("line"))===null||e===void 0?void 0:e(r,a),Yt("line",this._spec,this._markAttributeContext))),this._areaMark&&this._areaMark.setAnimationConfig(zt((i=F.getAnimationInKey("area"))===null||i===void 0?void 0:i(r,a),Yt("area",this._spec,this._markAttributeContext))),this._symbolMark){const o=to(this);this._symbolMark.setAnimationConfig(zt((n=F.getAnimationInKey("scaleInOut"))===null||n===void 0?void 0:n(),Yt("point",this._spec,this._markAttributeContext),o))}}initTooltip(){this._tooltipHelper=new sQ(this),this._areaMark&&this._tooltipHelper.activeTriggerSet.dimension.add(this._areaMark),this._lineMark&&this._tooltipHelper.activeTriggerSet.dimension.add(this._lineMark),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark)}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t),this.encodeDefined(this._areaMark,"defined")}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){return e=>{var i,n,r,a,o;const l=(i=this._spec.seriesMark)!==null&&i!==void 0?i:"area";let h=(r=(n=this._seriesMark)===null||n===void 0?void 0:n.getAttribute(e,t))!==null&&r!==void 0?r:void 0;return e!=="fill"||h&&l!=="line"||(e="stroke",h=(o=(a=this._seriesMark)===null||a===void 0?void 0:a.getAttribute(e,t))!==null&&o!==void 0?o:void 0),e==="stroke"&&$(h)?h[0]:h}}}Rr.type=z.area,Rr.mark=QS,Rr.transformerConstructor=YB,Ai(Rr,pA);const hQ=()=>{qS(),ZS(),gA(),fA(),eo(),lQ(),F.registerSeries(Rr.type,Rr)};class XB extends jn{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,area:t.area,seriesMark:(e=t.seriesMark)!==null&&e!==void 0?e:"area",activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,areaLabel:t.areaLabel})}transformSpec(t){super.transformSpec(t),Qa(t)}}class Ol extends Ce{constructor(){super(...arguments),this.transformerConstructor=XB,this.type="area",this.seriesType=z.area,this._canStack=!0}}Ol.type="area",Ol.seriesType=z.area,Ol.view="singleDefault",Ol.transformerConstructor=XB;const dQ=()=>{hQ(),F.registerChart(Ol.type,Ol)};function KB(s,t=!0){return(e,i,n)=>{const r=s.direction==="vertical"?s.yField:s.xField,a=e==null?void 0:e[r];return s.direction==="vertical"?{overall:t&&s.growFrom(),orient:a>0?"negative":"positive"}:{overall:!!t&&s.growFrom(),orient:a>0?"positive":"negative"}}}const Gc=(s,t=!0)=>({type:s.direction==="horizontal"?"growWidthIn":"growHeightIn",options:KB(s,t)}),Fh=(s,t=!0)=>({type:s.direction==="horizontal"?"growWidthOut":"growHeightOut",options:KB(s,t)}),uQ={type:"fadeIn"},cQ={type:"growCenterIn"};function qB(s,t){if(t===!1)return{};switch(t){case"fadeIn":return uQ;case"scaleIn":return cQ;default:return Gc(s)}}const pQ=()=>{F.registerAnimation("bar",(s,t)=>({appear:qB(s,t),enter:Gc(s,!1),exit:Fh(s,!1),disappear:Fh(s)}))},gQ=()=>{F.registerAnimation("bar3d",(s,t)=>({appear:qB(s,t),enter:Gc(s,!1),exit:Fh(s,!1),disappear:Fh(s)}))};class tc extends Hi{constructor(){super(...arguments),this.type=tc.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}tc.type="rect";const io=()=>{F.registerMark(tc.type,tc),XS(),FB()};function ZB(s,t,e){if(s.values.length>0){let i,n=s.series;t&&(n=n.slice().reverse()),n.forEach(({s:r,values:a},o)=>{var l,h;const d=r.getSpec().barMinHeight,u=(h=(l=r[e.axisHelper]).getScale)===null||h===void 0?void 0:h.call(l,0),c=r[e.axisHelper].isInverse();for(let p=0;p<a.length;p++){const g=a[t?a.length-1-p:p],f=ee(r[e.startMethod](g),u);let _=ee(r[e.endMethod](g),u);p===0&&o===0&&(i=f);let m=Math.abs(f-_);m<d&&(m=d);let v=1;_<f?v=-1:_===f&&(v=e.isVertical?c?1:-1:c?-1:1),_=i+v*m,g[e.start]=i,g[e.end]=_,i=_}})}for(const i in s.nodes)ZB(s.nodes[i],t,e)}class sv extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar")}}class On extends pn{constructor(){super(...arguments),this.type=z.bar,this._barMarkName="bar",this._barMarkType="rect",this.transformerConstructor=sv,this._supportStack=!0,this._bandPosition=0}initMark(){var t;const e={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._initBarBackgroundMark(e),this._barMark=this._createMark(Object.assign(Object.assign({},On.mark.bar),{name:this._barMarkName,type:this._barMarkType}),{morph:Yr(this._spec,this._barMarkName),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,progressive:e,customShape:(t=this._spec.bar)===null||t===void 0?void 0:t.customShape})}_initBarBackgroundMark(t){var e,i;!((e=this._spec.barBackground)===null||e===void 0)&&e.visible&&(this._barBackgroundMark=this._createMark(On.mark.barBackground,{dataView:this._barBackgroundViewData.getDataView(),dataProductId:this._barBackgroundViewData.getProductId(),progressive:t,customShape:(i=this._spec.barBackground)===null||i===void 0?void 0:i.customShape}))}initMarkStyle(){this._barMark&&(this.setMarkStyle(this._barMark,{fill:this.getColorAttribute()},"normal",tt.Series),this._trigger.registerMark(this._barMark))}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:e=>e[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}initTooltip(){super.initTooltip(),this._barMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._barMark)}_statisticViewData(){var t,e;if(super._statisticViewData(),!(!((t=this._spec.barBackground)===null||t===void 0)&&t.visible))return;Ct(this._option.dataSet,"addVChartProperty",ed),Ct(this._option.dataSet,"dimensionItems",([n],r)=>{var a;let o=[{}];const l=this.getDimensionField();for(let h=0;h<l.length;h++){const d=l[h],u=(a=n.latestData[d])===null||a===void 0?void 0:a.values;if(!(u!=null&&u.length))continue;const c=[];for(let p=0;p<u.length;p++)for(let g=0;g<o.length;g++)c.push(Object.assign(Object.assign({},o[g]),{[d]:u[p]}));o=c}return o});const i=new Jt(this._option.dataSet).parse([this._viewDataStatistics],{type:"dataview"}).transform({type:"dimensionItems"},!1).transform({type:"addVChartProperty",options:{beforeCall:qu.bind(this),call:Dh}},!1);(e=this._viewDataStatistics)===null||e===void 0||e.target.addListener("change",i.reRunAllTransform),this._barBackgroundViewData=new or(this._option,i)}init(t){var e,i;super.init(t),this.direction==="vertical"?((e=this._xAxisHelper)===null||e===void 0?void 0:e.getScale(0).type)==="band"?this.initBandRectMarkStyle():this.initLinearRectMarkStyle():((i=this._yAxisHelper)===null||i===void 0?void 0:i.getScale(0).type)==="band"?this.initBandRectMarkStyle():this.initLinearRectMarkStyle()}_shouldDoPreCalculate(){const t=this.getRegion();return this._stack&&t.getSeries().filter(e=>e.type===this.type&&e.getSpec().barMinHeight).length}_calculateStackRectPosition(t){const e=this.getRegion();if(e._bar_series_position_calculated)return;let i,n,r,a,o;e._bar_series_position_calculated=!0,t?(i=H0,n=z0,r="_dataToPosY1",a="_dataToPosY",o="_yAxisHelper"):(i=j0,n=F0,r="_dataToPosX1",a="_dataToPosX",o="_xAxisHelper");const l=cB(e,!1,h=>h.type===this.type);for(const h in l)for(const d in l[h].nodes)ZB(l[h].nodes[d],e.getStackInverse(),{isVertical:t,start:i,end:n,startMethod:r,endMethod:a,axisHelper:o})}_calculateRectPosition(t,e){var i,n;let r,a,o;e?(r="_dataToPosY1",a="_dataToPosY",o="_yAxisHelper"):(r="_dataToPosX1",a="_dataToPosX",o="_xAxisHelper");const l=(n=(i=this[o]).getScale)===null||n===void 0?void 0:n.call(i,0),h=this[o].isInverse(),d=this._spec.barMinHeight,u=ee(this[r](t),l),c=ee(this[a](t),l);let p=Math.abs(u-c);p<d&&(p=d);let g=1;return c<u?g=-1:c===u&&(g=e?h?1:-1:h?-1:1),u+g*p}_dataToPosX(t){return this.dataToPositionX(t)}_dataToPosX1(t){return this.dataToPositionX1(t)}_dataToPosY(t){return this.dataToPositionY(t)}_dataToPosY1(t){return this.dataToPositionY1(t)}initBandRectMarkStyle(){var t,e,i,n;const r=(e=(t=this._xAxisHelper)===null||t===void 0?void 0:t.getScale)===null||e===void 0?void 0:e.call(t,0),a=(n=(i=this._yAxisHelper)===null||i===void 0?void 0:i.getScale)===null||n===void 0?void 0:n.call(i,0);this.direction==="horizontal"?this.setMarkStyle(this._barMark,{x:o=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),o[F0]):this._spec.barMinHeight?this._calculateRectPosition(o,!1):ee(this._dataToPosX(o),r),x1:o=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),o[j0]):ee(this._dataToPosX1(o),r),y:o=>this._getPosition(this.direction,o),height:()=>this._getBarWidth(this._yAxisHelper)},"normal",tt.Series):this.setMarkStyle(this._barMark,{x:o=>this._getPosition(this.direction,o),y:(o,l,h,d)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),o[z0]):this._spec.barMinHeight?this._calculateRectPosition(o,!0):ee(this._dataToPosY(o),a),y1:o=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),o[H0]):ee(this._dataToPosY1(o),a),width:()=>this._getBarWidth(this._xAxisHelper)},"normal",tt.Series),this._initBarBackgroundMarkStyle()}_initBarBackgroundMarkStyle(){var t,e,i,n;if(!this._barBackgroundMark)return;const r=(e=(t=this._xAxisHelper)===null||t===void 0?void 0:t.getScale)===null||e===void 0?void 0:e.call(t,0),a=(n=(i=this._yAxisHelper)===null||i===void 0?void 0:i.getScale)===null||n===void 0?void 0:n.call(i,0);this.direction==="horizontal"?this.setMarkStyle(this._barBackgroundMark,{x:()=>{const o=r.range();return Math.min(o[0],o[o.length-1])},x1:()=>{const o=r.range();return Math.max(o[0],o[o.length-1])},y:o=>this._getPosition(this.direction,o),height:()=>this._getBarWidth(this._yAxisHelper)},"normal",tt.Series):this.setMarkStyle(this._barBackgroundMark,{x:o=>this._getPosition(this.direction,o),y:()=>{const o=a.range();return Math.min(o[0],o[o.length-1])},y1:()=>{const o=a.range();return Math.max(o[0],o[o.length-1])},width:()=>this._getBarWidth(this._xAxisHelper)},"normal",tt.Series)}initLinearRectMarkStyle(){var t,e,i,n;const r=(e=(t=this._xAxisHelper)===null||t===void 0?void 0:t.getScale)===null||e===void 0?void 0:e.call(t,0),a=(n=(i=this._yAxisHelper)===null||i===void 0?void 0:i.getScale)===null||n===void 0?void 0:n.call(i,0);this.direction==="vertical"?this.setMarkStyle(this._barMark,{x:o=>ee(this.dataToPositionX(o),r),x1:o=>ee(this.dataToPositionX1(o),r),y:(o,l,h,d)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),o[z0]):this._spec.barMinHeight?this._calculateRectPosition(o,!0):ee(this.dataToPositionY(o),a),y1:o=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),o[H0]):ee(this.dataToPositionY1(o),a)},"normal",tt.Series):this.setMarkStyle(this._barMark,{x:o=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),o[F0]):this._spec.barMinHeight?this._calculateRectPosition(o,!1):ee(this.dataToPositionX(o),r),x1:o=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),o[j0]):ee(this.dataToPositionX1(o),r),y:o=>ee(this.dataToPositionY(o),a),y1:o=>ee(this.dataToPositionY1(o),a)},"normal",tt.Series)}initAnimation(){var t,e;const i={yField:this._fieldY[0],xField:this._fieldX[0],direction:this.direction,growFrom:()=>{var a,o;return this.direction==="horizontal"?(a=this._xAxisHelper)===null||a===void 0?void 0:a.getScale(0).scale(0):(o=this._yAxisHelper)===null||o===void 0?void 0:o.getScale(0).scale(0)}},n=(t=this._spec.animationAppear)===null||t===void 0?void 0:t.preset,r=to(this);this._barMark.setAnimationConfig(zt((e=F.getAnimationInKey("bar"))===null||e===void 0?void 0:e(i,n),Yt(this._barMarkName,this._spec,this._markAttributeContext),r))}_getBarWidth(t){var e,i;const n=this._spec.barWidth!==void 0,r=(i=(e=t.getBandwidth)===null||e===void 0?void 0:e.call(t,this._groups?this._groups.fields.length-1:0))!==null&&i!==void 0?i:6;if(n)return Pl(this._spec.barWidth,r);const a=this._spec.barMinWidth!==void 0,o=this._spec.barMaxWidth!==void 0;let l=r;return a&&(l=Math.max(l,Pl(this._spec.barMinWidth,r))),o&&(l=Math.min(l,Pl(this._spec.barMaxWidth,r))),l}_getPosition(t,e){var i,n,r,a,o,l,h,d,u;let c,p,g;t==="horizontal"?(c=this.getYAxisHelper(),p="height",g=this.dataToPositionY.bind(this)):(c=this.getXAxisHelper(),p="width",g=this.dataToPositionX.bind(this));const f=c.getScale(0),_=this._barMark.getAttribute(p,e),m=(n=(i=c.getBandwidth)===null||i===void 0?void 0:i.call(c,this._groups?this._groups.fields.length-1:0))!==null&&n!==void 0?n:6;if(((a=(r=this._groups)===null||r===void 0?void 0:r.fields)===null||a===void 0?void 0:a.length)>1&&E(this._spec.barGapInGroup)){const y=this._groups.fields,b=Y(this._spec.barGapInGroup);let x=0,S=0;for(let A=y.length-1;A>=1;A--){const k=y[A],w=(d=(h=(l=(o=this.getViewDataStatistics())===null||o===void 0?void 0:o.latestData)===null||l===void 0?void 0:l[k])===null||h===void 0?void 0:h.values)!==null&&d!==void 0?d:[],T=w.length,M=Pl((u=b[A-1])!==null&&u!==void 0?u:Ma(b),m),C=w.indexOf(e[k]);A===y.length-1?(x+=T*_+(T-1)*M,S+=C*(_+M)):(S+=C*(x+M),x+=x+(T-1)*M)}return f.scale(e[y[0]])+c.getBandwidth(0)/2-x/2+S}const v=qt(f.type||"band");return g(e)+.5*(m-_)+(v?-m/2:0)}onLayoutEnd(t){super.onLayoutEnd(t),this.getRegion()._bar_series_position_calculated=!1,this._spec.sampling&&this.compile()}compile(){if(super.compile(),this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],n=this._fieldY,r=this._fieldX;i.push({type:"sampling",size:this._direction==="vertical"?t:e,factor:this._spec.samplingFactor,yfield:this._direction==="vertical"?n[0]:r[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._barMark]}compileData(){var t;super.compileData(),(t=this._barBackgroundViewData)===null||t===void 0||t.compile()}fillData(){var t,e;super.fillData(),(e=(t=this._barBackgroundViewData)===null||t===void 0?void 0:t.getDataView())===null||e===void 0||e.reRunAllTransform()}viewDataUpdate(t){var e,i,n;super.viewDataUpdate(t),(i=(e=this._barBackgroundViewData)===null||e===void 0?void 0:e.getDataView())===null||i===void 0||i.reRunAllTransform(),(n=this._barBackgroundViewData)===null||n===void 0||n.updateData()}release(){var t;super.release(),(t=this._barBackgroundViewData)===null||t===void 0||t.release(),this._barBackgroundViewData=null}}On.type=z.bar,On.mark=Ym,On.transformerConstructor=sv;const JB=()=>{qS(),io(),pQ(),F.registerSeries(On.type,On)};class nv extends jn{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barMinHeight:t.barMinHeight,sampling:t.sampling,samplingFactor:t.samplingFactor,barBackground:t.barBackground})}transformSpec(t){super.transformSpec(t),Qa(t)}}class Sa extends Ce{constructor(){super(...arguments),this.transformerConstructor=nv,this.type="bar",this.seriesType=z.bar,this._canStack=!0}}Sa.type="bar",Sa.seriesType=z.bar,Sa.view="singleDefault",Sa.transformerConstructor=nv;const fQ=()=>{JB(),F.registerChart(Sa.type,Sa)};class ec extends Hi{constructor(){super(...arguments),this.type=ec.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}}ec.type="rect3d";const QB=()=>{F.registerMark(ec.type,ec),QX(),FB()};class x_ extends On{constructor(){super(...arguments),this.type=z.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d"}}x_.type=z.bar3d,x_.mark=JS;const tD=()=>{gQ(),QB(),F.registerSeries(x_.type,x_)};class eD extends nv{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup})}}class Il extends Sa{constructor(){super(...arguments),this.transformerConstructor=eD,this.type="bar3d",this.seriesType=z.bar3d}}Il.type="bar3d",Il.seriesType=z.bar3d,Il.view="singleDefault",Il.transformerConstructor=eD;const _Q=()=>{tD(),F.registerChart(Il.type,Il)},LC=10,mQ=[10,20],vQ=Ve.Linear,BC="circle",yQ=Ve.Ordinal,bQ=["circle","square","triangle","diamond","star"],xQ=(s,t)=>t==="fadeIn"?{type:"fadeIn"}:{type:"scaleIn"},SQ=()=>{F.registerAnimation("scatter",(s,t)=>Object.assign({appear:xQ(0,t)},hA))};class iD extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"point")}}class Ea extends pn{constructor(){super(...arguments),this.type=z.scatter,this.transformerConstructor=iD,this._invalidType="zero"}setAttrFromSpec(){super.setAttrFromSpec(),this._size=this._spec.size,this._sizeField=this._spec.sizeField,this._shape=this._spec.shape,this._shapeField=this._spec.shapeField}_getSeriesAttribute(t,e,{defaultScaleType:i,defaultRange:n},r){var a,o,l,h;if(K(e))return e;if($(e)){if(P(t))return(a=this._option)===null||a===void 0||a.onError(`${r}Field is required.`),e;if(i!=="ordinal"&&e.length>2)return(o=this._option)===null||o===void 0||o.onError(`${r} length is invalid, specify up to 2 ${r}s.`),e;const d=`${At}_series_scatter_${this.id}_scale_${r}`;return this._option.globalScale.registerModelScale({id:d,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:e}),{scale:d,field:t}}if($t(e)){if(P(t))return(l=this._option)===null||l===void 0||l.onError(`${r}Field is required.`),e;const d=`${At}_series_scatter_${this.id}_scale_${r}`,u=Object.assign({id:d,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:n},e);return this._option.globalScale.registerModelScale(u),{scale:u.id,field:t}}return(h=this._option)===null||h===void 0||h.onError(`${r} attribute is invalid.`),e}getSizeAttribute(t,e){return P(e)?LC:dt(e)?e:ht(e)&&ij(e)?parseFloat(e):this._getSeriesAttribute(t,e,{defaultScaleType:vQ,defaultRange:mQ},"size")}getShapeAttribute(t,e){return P(e)?BC:ht(e)?e:this._getSeriesAttribute(t,e,{defaultScaleType:yQ,defaultRange:bQ},"shape")}initMark(){var t;const e={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._symbolMark=this._createMark(Ea.mark.point,{morph:Yr(this._spec,Ea.mark.point.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,progressive:e,isSeriesMark:!0,customShape:(t=this._spec.point)===null||t===void 0?void 0:t.customShape})}initMarkStyle(){this.initSymbolMarkStyle()}initAnimation(){var t,e,i;const n=to(this),r=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;this._symbolMark.setAnimationConfig(zt((i=F.getAnimationInKey("scatter"))===null||i===void 0?void 0:i({},r),Yt("point",this._spec,this._markAttributeContext),n))}initSymbolMarkStyle(){const t=this._symbolMark;t&&(this._invalidType!=="zero"&&this.setMarkStyle(t,{visible:this._getInvalidDefined}),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,fill:this.getColorAttribute(),size:dt(this._size)||K(this._size)?this._size:LC,symbolType:ht(this._shape)||K(this._shape)?this._shape:BC},bt.STATE_NORMAL,tt.Series),(E(this._sizeField)||E(this._size))&&this.setMarkStyle(t,{size:this.getSizeAttribute(this._sizeField,this._size)},bt.STATE_NORMAL,tt.User_Mark),(E(this._shapeField)||E(this._shape))&&this.setMarkStyle(t,{symbolType:this.getShapeAttribute(this._shapeField,this._shape)},bt.STATE_NORMAL,tt.User_Mark),this._trigger.registerMark(t))}initTooltip(){super.initTooltip(),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark)}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t);const e=[this.getDimensionField()[0],this.getStackValueField()].every(i=>{var n,r,a;return i&&((a=(r=(n=this.getViewDataStatistics())===null||n===void 0?void 0:n.latestData)===null||r===void 0?void 0:r[i])===null||a===void 0?void 0:a.allValid)});this._invalidType==="zero"||e?this.setMarkStyle(this._symbolMark,{visible:!0},"normal",tt.Series):this.setMarkStyle(this._symbolMark,{visible:this._getInvalidDefined},"normal",tt.Series)}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{fill:this.getColorAttribute(),text:e=>e[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null},bt.STATE_NORMAL,tt.Series),this._invalidType!=="zero"&&this.setMarkStyle(t,{visible:this._getInvalidDefined},bt.STATE_NORMAL,tt.Series))}handleZoom(t){var e,i;this.getMarksWithoutRoot().forEach(r=>{const a=r.getProduct();!a||!a.elements||!a.elements.length||a.elements.forEach((o,l)=>{const h=o.getGraphicItem(),d=o.getDatum(),u=this.dataToPosition(d);u&&h&&h.translateTo(u.x,u.y)})});const n=(i=(e=this._labelMark)===null||e===void 0?void 0:e.getComponent())===null||i===void 0?void 0:i.getProduct();n&&n.evaluateSync(null,null)}handlePan(t){var e,i;this.getMarksWithoutRoot().forEach(r=>{const a=r.getProduct();!a||!a.elements||!a.elements.length||a.elements.forEach((o,l)=>{const h=o.getGraphicItem(),d=o.getDatum(),u=this.dataToPosition(d);u&&h&&h.translateTo(u.x,u.y)})});const n=(i=(e=this._labelMark)===null||e===void 0?void 0:e.getComponent())===null||i===void 0?void 0:i.getProduct();n&&n.evaluateSync(null,null)}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._symbolMark]}}Ea.type=z.scatter,Ea.mark=IL,Ea.transformerConstructor=iD;const AQ=()=>{eo(),SQ(),F.registerSeries(Ea.type,Ea)};class sD extends jn{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,size:t.size,sizeField:t.sizeField,shape:t.shape,shapeField:t.shapeField})}}class Ll extends Ce{constructor(){super(...arguments),this.transformerConstructor=sD,this.type="scatter",this.seriesType=z.scatter,this._canStack=!0}}Ll.type="scatter",Ll.seriesType=z.scatter,Ll.view="singleDefault",Ll.transformerConstructor=sD;const kQ=()=>{AQ(),F.registerChart(Ll.type,Ll)};Fx();const DC={},_A=["clipAngle","clipExtent","scale","translate","center","rotate","precision","reflectX","reflectY","parallels","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function wQ(s,t){return function e(){const i=t();return i.type=s,i.path=Fx().projection(i),i.copy=i.copy||function(){const n=e();return _A.forEach(r=>{i[r]&&n[r](i[r]())}),n.path.pointRadius(i.path.pointRadius()),n},i}}function da(s,t){s&&ht(s)||vo("Projection type must be a name string.");const e=s.toLowerCase();return arguments.length>1&&(DC[e]=wQ(e,t)),DC[e]||null}const FC={albers:VE,albersusa:Tz,azimuthalequalarea:Mz,azimuthalequidistant:Cz,conicconformal:Rz,conicequalarea:Bg,conicequidistant:Lz,equalEarth:Dz,equirectangular:Oz,gnomonic:Fz,identity:jz,mercator:Pz,naturalEarth1:zz,orthographic:Hz,stereographic:Nz,transversemercator:Gz};Object.keys(FC).forEach(s=>{da(s,FC[s])});const jC="Feature",nD="FeatureCollection";function TQ(s){return s.type===nD?s.features:Y(s).filter(t=>!P(t)).map(t=>t.type===jC?t:{type:jC,geometry:t})}function MQ(s){const t=Y(s);return t.length===1?t[0]:{type:nD,features:t.reduce((e,i)=>e.concat(TQ(i)),[])}}function CQ(s){const t=da((s||"mercator").toLowerCase());return t||vo("Unrecognized projection type: "+s),t()}function PQ(s,t,e){K(s[t])&&s[t](e)}const EQ=_A.concat(["pointRadius","fit","extent","size"]);function zC(s,t){let e=[];return s&&Object.keys(s).forEach(i=>{EQ.includes(i)&&(e=e.concat(Ki(s[i],t)))}),e}let RQ=class extends Wm{constructor(t){super(t),this.grammarType="projection"}parse(t){return super.parse(t),this.pointRadius(t.pointRadius),this.size(t.size),this.extent(t.extent),this.fit(t.fit),this.configure(t),this.commit(),this}pointRadius(t){return P(this.spec.pointRadius)||this.detach(Ki(this.spec.pointRadius,this.view)),this.spec.pointRadius=t,this.attach(Ki(t,this.view)),this.commit(),this}size(t){return P(this.spec.size)||this.detach(Ki(this.spec.size,this.view)),this.spec.size=t,this.attach(Ki(t,this.view)),this.commit(),this}extent(t){return P(this.spec.extent)||this.detach(Ki(this.spec.extent,this.view)),this.spec.extent=t,this.attach(Ki(t,this.view)),this.commit(),this}fit(t){return P(this.spec.fit)||this.detach(Ki(this.spec.fit,this.view)),this.spec.fit=t,this.attach(Ki(t,this.view)),this.commit(),this}configure(t){return this.detach(zC(this.spec,this.view)),P(t)?this.spec={type:this.spec.type,fit:this.spec.fit,extent:this.spec.extent,size:this.spec.size,pointRadius:this.spec.pointRadius}:(Object.assign(this.spec,t),this.attach(zC(this.spec,this.view))),this.commit(),this}evaluate(t,e){if(this.projection&&this.projection.type===this.spec.type||(this.projection=CQ(this.spec.type),this.projection.type=this.spec.type),_A.forEach(i=>{P(this.spec[i])||PQ(this.projection,i,Ue(this.spec[i],e,da))}),P(this.spec.pointRadius)||this.projection.path.pointRadius(Ue(this.spec.pointRadius,e,da)),!(P(this.spec.fit)||P(this.spec.extent)&&P(this.spec.size))){const i=MQ(Ue(this.spec.fit,e,da));this.spec.extent?this.projection.fitExtent(Ue(this.spec.extent,e,da),i):this.spec.size&&this.projection.fitSize(Ue(this.spec.size,e,da),i)}return this.projection}output(){return this.projection}};const OQ=()=>{st.registerGrammar("projection",RQ,"projections")},IQ=(s,t)=>{if(!t.from||!t.from())return s;const e=t.fields,i=t.key,n=t.values,r=t.default,a=t.as||[e],o=t.from().reduce(function(h,d){return d[e]&&h.set(d[e],d),h},new Map);let l;if(K(t.set))l=function(h){const d=o.get(h[i]);t.set(h,d)};else if(n){const h=n.length;l=function(d){const u=o.get(d[i]);if(P(u))for(let c=0;c<h;++c)d[a[c]]=r;else for(let c=0;c<h;++c)d[a[c]]=u[n[c]]}}else l=function(h){const d=o.get(h[i]);h[a[0]]=E(d)?d:r};return s.length===0?[]:s.map(h=>(l(h),h))};class LQ extends Io{constructor(){super(...arguments),this.type=z.geo,this.coordinate="geo",this._nameProperty="name"}getMapViewData(){var t;return(t=this._mapViewData)===null||t===void 0?void 0:t.getDataView()}get nameField(){return this._nameField}set nameField(t){this._nameField=t}get valueField(){return this._valueField}set valueField(t){this._valueField=t}getNameProperty(){return this._nameProperty}getCentroidProperty(){return this._centroidProperty}getCoordinateHelper(){return this._coordinateHelper}setCoordinateHelper(t){this._coordinateHelper=t}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t){var e;let i=null;if(!t)return i;const{dataToPosition:n,latitudeField:r,longitudeField:a}=this._coordinateHelper;if(i=this.nameToPosition(t),i===null){const o=a?t==null?void 0:t[a]:Number.NaN,l=r?t==null?void 0:t[r]:Number.NaN;i=(e=n==null?void 0:n([o,l]))!==null&&e!==void 0?e:null}return i}nameToPosition(t){var e,i;const n=this.getDatumName(t);if(P(n))return null;const r=(i=(e=this.getMapViewData())===null||e===void 0?void 0:e.latestData)===null||i===void 0?void 0:i.filter(h=>this.getDatumName(h)===n)[0];if(P(r))return null;const{dataToPosition:a}=this._coordinateHelper,o=this.getDatumCenter(r),l=a==null?void 0:a(o);return P(l)||isNaN(l.x)||isNaN(l.y)?null:l}dataToLatitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}dataToLongitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}valueToPosition(t,e){return{x:this.dataToLongitude(t),y:this.dataToLatitude(e)}}positionToData(t){}latitudeToData(t){}longitudeToData(t){}dataToPositionX(t){var e;return(e=this._option)===null||e===void 0||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return(e=this._option)===null||e===void 0||e.onError("Method not implemented."),0}dataToPositionZ(t){var e;return(e=this._option)===null||e===void 0||e.onError("Method not implemented."),0}release(){super.release(),this._mapViewData.release(),this._mapViewData=this._mapViewDataStatistics=null}getStackGroupFields(){return[this._nameField]}getStackValueField(){return this._spec.valueField}compileData(){var t;(t=this._mapViewData)===null||t===void 0||t.compile()}initStatisticalData(){if(super.initStatisticalData(),this._mapViewData){const t=`${At}_series_${this.id}_mapViewDataStatic`;this._mapViewDataStatistics=this.createStatisticalData(t,this._mapViewData.getDataView()),this._mapViewData.getDataView().target.removeListener("change",this._mapViewDataStatistics.reRunAllTransform)}}getSeriesKeys(){var t,e,i,n,r;return this._seriesField?(r=(e=(t=this.getRawDataStatisticsByField(this._seriesField))===null||t===void 0?void 0:t.values)!==null&&e!==void 0?e:(n=(i=this._mapViewDataStatistics)===null||i===void 0?void 0:i.latestData[this._seriesField])===null||n===void 0?void 0:n.values)!==null&&r!==void 0?r:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}fillData(){var t,e;super.fillData(),(t=this._mapViewData.getDataView())===null||t===void 0||t.reRunAllTransform(),(e=this._mapViewDataStatistics)===null||e===void 0||e.reRunAllTransform()}getActiveMarks(){return[]}}const S_=`${At}_MAP_LOOK_UP_KEY`,BQ=(s,t)=>(s.features&&s.features.forEach((e,i)=>{var n,r;e[Si]=i,t.nameMap?e[S_]=t.nameMap[(n=e.properties)===null||n===void 0?void 0:n[t.nameProperty]]:e[S_]=(r=e.properties)===null||r===void 0?void 0:r[t.nameProperty]}),s.features);class DQ extends ys{constructor(){super(...arguments),this.titleValueCallback=t=>{var e;const i=this.series;return(e=this._getDimensionData(t))!==null&&e!==void 0?e:i.getDatumName(t)}}}class ic extends Hi{constructor(){super(...arguments),this.type=ic.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0,path:""})}}ic.type="path";const rD=()=>{F.registerMark(ic.type,ic),lL()};class FQ{constructor(t){this.projection=da(t.type)()}fit(t,e,i){const n={type:"FeatureCollection",features:i};this.projection.fitExtent([t,e],n)}center(t){var e,i;(i=(e=this.projection)===null||e===void 0?void 0:e.center)===null||i===void 0||i.call(e,t)}project(t){var e;return(e=this.projection)===null||e===void 0?void 0:e.call(this,t)}shape(t){var e,i;return(i=(e=this.projection)===null||e===void 0?void 0:e.path)===null||i===void 0?void 0:i.call(e,t)}invert(t){var e,i;return(i=(e=this.projection)===null||e===void 0?void 0:e.invert)===null||i===void 0?void 0:i.call(e,t)}scale(t){var e;if(!((e=this.projection)===null||e===void 0)&&e.scale){if(t===void 0)return this.projection.scale();this.projection.scale(t)}}translate(t){var e;if(!((e=this.projection)===null||e===void 0)&&e.scale){if(t===void 0)return this.projection.translate();this.projection.translate(t)}}evaluate(t,e,i){const n=this.projection.copy();return n==null?void 0:n.fitExtent([t,e],{type:"FeatureCollection",features:i})}}class jQ extends HB{constructor(t){super(),this.component=t}}function cs(s,t){return It(t,`component.${s}`)}const zQ={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}};function HQ(s){return(s=Mn(s)).startSymbol=Mn(s.startSymbol),s.endSymbol=Mn(s.endSymbol),s}function sc(s){let t=0;return It(s,"tick.visible")&&(t+=It(s,"tick.tickSize")),It(s,"label.visible")&&(t+=It(s,"label.space")),t}function nc(s,t){var e,i,n,r,a,o;return{min:(n=(e=s.min)!==null&&e!==void 0?e:(i=s.range)===null||i===void 0?void 0:i.min)!==null&&n!==void 0?n:t==null?void 0:t.min,max:(o=(r=s.max)!==null&&r!==void 0?r:(a=s.range)===null||a===void 0?void 0:a.max)!==null&&o!==void 0?o:t==null?void 0:t.max}}function HC(s){const t=s==null?void 0:s.orient;return t==="top"||t==="bottom"||t==="left"||t==="right"||t==="z"}function NC(s){const t=s==null?void 0:s.orient;return t==="angle"||t==="radius"}const bd=(s,t,e)=>{var i;const n=(i=t==="band"?cs("axisBand",e):["linear","log","symlog"].includes(t)?cs("axisLinear",e):{})!==null&&i!==void 0?i:{},r=Fe(s)?cs("axisX",e):Mr(s)?cs("axisY",e):cs("axisZ",e);return yt({},cs("axis",e),n,r)},W0=(s,t,e)=>{var i;const n=(i=t==="band"?cs("axisBand",e):t==="linear"?cs("axisLinear",e):{})!==null&&i!==void 0?i:{},r=cs(s==="angle"?"axisAngle":"axisRadius",e);return yt({},cs("axis",e),n,r)},aD=s=>s==="band"||s==="ordinal"||s==="point";function oD(s,t){const{x1:e,y1:i,x2:n,y2:r}=t,{x1:a,y1:o,x2:l,y2:h}=s.AABBBounds,{dx:d=0,dy:u=0}=s.attribute;let c=0,p=0;a<e&&(c=e-a),o<i&&(p=i-o),l>n&&(c=n-l),h>r&&(p=r-h),c&&s.setAttribute("dx",c+d),p&&s.setAttribute("dy",p+u)}function GC(s,t,e,i){let n=0,r=s.length-1;for(;n<=r;){const a=Math.floor((n+r)/2),o=s[a];if(o[e]<=t&&o[i||e]>=t)return o;o[e]>t?r=a-1:n=a+1}return null}const NQ=(s,t)=>{var e,i;const n=Y((e=t.axes)!==null&&e!==void 0?e:[]),{bandField:r,linearField:a,xField:o,yField:l}=(i=cs(Z.crosshair,s))!==null&&i!==void 0?i:{},h=n.find(p=>Fe(p.orient));let d;d=E(h)?yt({},aD(h.type)?r:a,o):o;const u=n.find(p=>Mr(p.orient));let c;return c=E(u)?yt({},ji(u.type)?r:a,l):l,{xField:d,yField:c}},GQ=(s,t)=>{var e,i;const n=Y((e=t.axes)!==null&&e!==void 0?e:[]),{bandField:r,linearField:a,categoryField:o,valueField:l}=(i=cs(Z.crosshair,s))!==null&&i!==void 0?i:{},h=n.find(p=>p.orient==="angle");let d;d=E(h)?yt({},aD(h.type)?r:a,o):o;const u=n.find(p=>p.orient==="radius");let c;return c=E(u)?yt({},ji(u.type)?r:a,l):l,{categoryField:d,valueField:c}},WQ=(s,t)=>{const{getNewDomain:e,isContinuous:i,field:n}=t,r=n(),a=e();if(P(a)||P(r))return s;if(a.length===0)return[];let o=null;return o=i()?l=>l[r]>=a[0]&&l[r]<=a[1]:l=>a.indexOf(l[r]+"")>=0||a.indexOf(l[r])>=0,s.filter(o)},VQ=(s,t)=>{const{stateFields:e,valueFields:i,dataCollection:n}=t.input,{stateField:r,valueField:a}=t.output,o={},l=[];return n.forEach((h,d)=>{var u;if(P(e[d]))return;const c=(u=h.getFields())===null||u===void 0?void 0:u[e[d]];c&&c.lockStatisticsByDomain&&c.domain.forEach(p=>{o[p]=0}),h.latestData.forEach(p=>{Y(e[d]).forEach(g=>{P(p[g])||(P(o[p[g]])&&(o[p[g]]=0),P(i[d])||(o[p[g]]+=isNaN(parseFloat(p[i[d]]))?1:parseFloat(p[i[d]])))})})}),Object.keys(o).forEach((h,d)=>{const u={[r]:h};a&&(u[a]=o[h]),l.push(u)}),l},UQ=(s,t,e)=>{const i=cs(t,e),n=i[bB(s)],r=yt({},i,n);return delete r.horizontal,delete r.vertical,r};function lD(s){var t,e;const i=Object.assign({},s);return vt(s.style)||(i.textStyle=wt(s.style)),vt(s.textStyle)||yt(i.textStyle,wt(s.textStyle)),!((t=s.shape)===null||t===void 0)&&t.style&&wt(i.shape.style),!((e=s.background)===null||e===void 0)&&e.style&&wt(i.background.style),i}function $Q(s){return s.orient==="bottom"||s.orient==="top"?"horizontal":"vertical"}function YQ(s,t,e,i){switch(s){case Z.cartesianBandAxis:return bd(oa(e,["z"]),"band",t);case Z.cartesianLinearAxis:return bd(oa(e,["z"]),"linear",t);case Z.cartesianLogAxis:return bd(oa(e,["z"]),"log",t);case Z.cartesianSymlogAxis:return bd(oa(e,["z"]),"symlog",t);case Z.cartesianAxis:case Z.cartesianTimeAxis:return bd(oa(e),void 0,t);case Z.polarBandAxis:return W0(e.orient,"band",t);case Z.polarLinearAxis:return W0(e.orient,"linear",t);case Z.polarAxis:return W0(e.orient,void 0,t);case Z.cartesianCrosshair:return NQ(t,i);case Z.polarCrosshair:return GQ(t,i);case Z.colorLegend:case Z.sizeLegend:return cs(`${s}.${$Q(e)}`,t);case Z.dataZoom:case Z.scrollBar:return UQ(oa(e),s,t);default:return cs(s,t)}}class Wc extends Zm{getTheme(t,e){return YQ(this.type,this._option.getTheme(),t,e)}_mergeThemeToSpec(t,e){const{spec:i,theme:n}=super._mergeThemeToSpec(t,e);return this._adjustPadding(i),{spec:i,theme:n}}_adjustPadding(t){const{padding:e,noOuterPadding:i=!0,orient:n}=t;i&&e&&n&&(t.padding=Object.assign(Object.assign({},Hr(e)),{[n]:0}))}}var XQ=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};class bs extends RB{static createComponent(t,e){const{spec:i}=t,n=XQ(t,["spec"]);return new this(i,Object.assign(Object.assign({},e),n))}getRegions(){return this._regions}created(){this.initLayout(),super.created(),this.pluginService=new jQ(this)}constructor(t,e){super(t,e),this.name="component",this.modelType="component",this.transformerConstructor=Wc,this._delegateEvent=(i,n,r,a=null,o=null)=>{var l,h;this.event.emit(r,{model:this,node:i,event:n,item:a,datum:o,source:te.chart,chart:(h=(l=this._option)===null||l===void 0?void 0:l.globalInstance)===null||h===void 0?void 0:h.getChart()},"model")},this._option.animation&&(this.animate=new EB({getCompiler:e.getCompiler}))}initLayout(){var t;super.initLayout(),this._regions=(t=this._regions)!==null&&t!==void 0?t:this._option.getRegionsInIndex(),this._layout&&(this._layout.layoutBindRegionID=this._regions.map(e=>e==null?void 0:e.id))}changeRegions(t){throw new Error("Method not implemented.")}_getNeedClearVRenderComponents(){throw new Error("Method not implemented.")}onRender(t){throw new Error("Method not implemented.")}getVRenderComponents(){return this._getNeedClearVRenderComponents()}callPlugin(t){this.pluginService&&this.pluginService.getAll().forEach(e=>t(e))}eventPos(t){return{x:t.event.viewX-this.getLayoutStartPoint().x,y:t.event.viewY-this.getLayoutStartPoint().y}}getContainer(){var t;return this._container||(this._container=(t=this._option)===null||t===void 0?void 0:t.globalInstance.getStage().find(e=>e.name==="root",!0)),this._container}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||(i.reMake=["seriesId","seriesIndex","regionId","regionIndex"].some(n=>Se(e==null?void 0:e[n],t[n]))),(e==null?void 0:e.visible)!==t.visible&&(i.reCompile=!0),i}release(){super.release(),this.clear()}clear(){var t;const e=this._getNeedClearVRenderComponents();e&&e.length&&e.forEach(i=>{var n;i&&((n=this.getContainer())===null||n===void 0||n.removeChild(i),i=null)}),this._container=null,(t=this.pluginService)===null||t===void 0||t.disposeAll(),this.pluginService=null}compile(){this.compileMarks()}compileMarks(t){this.getMarks().forEach(e=>{var i;e.compile({group:t}),(i=e.getProduct())===null||i===void 0||i.configure({context:{model:this}})})}getBoundsInRect(t,e){return{x1:0,x2:0,y1:0,y2:0}}}bs.transformerConstructor=Wc;class KQ{parserScrollEvent(t){return t&&!(t.ctrlKey||t.deltaY===0&&t.deltaX===0)&&(t.scrollX=t.deltaX,t.scrollY=t.deltaY,t)}parserZoomEvent(t){if(!t)return t;const e=Math.pow(1.0005,-t.deltaY*Math.pow(16,t.deltaMode));return t.zoomDelta=e,t.zoomX=t.canvasX,t.zoomY=t.canvasY,t}clearZoom(){}clearScroll(){}clearDrag(){}parserDragEvent(){return!0}}class qQ{constructor(){this._lastScale=0}clearZoom(){this._lastScale=0,this.pointerId=null}parserDragEvent(t){return this.pointerId?this.pointerId===t.pointerId:(this.pointerId=t.pointerId,!0)}parserZoomEvent(t){const e=t.scale;if(this._lastScale===0)return this._lastScale=e,t;t.zoomDelta=e/this._lastScale;const i=t.center;return t.zoomX=i.x,t.zoomY=i.y,this._lastScale=e,t}parserScrollEvent(t){return t}clearScroll(){}clearDrag(){}}function br(s){return s===ri["desktop-browser"]||s===ri["desktop-miniApp"]?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"wheel",zoomEnd:"pointerup",scroll:"wheel",trigger:KQ}:Ga(s)||Wa(s)?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"pinch",zoomEnd:"pinchend",scroll:"pan",scrollEnd:"panend",trigger:qQ}:null}const sl={debounce:lr,throttle:Ka};class mA{constructor(){this._isGestureListener=!1}initZoomable(t,e=ri["desktop-browser"]){this._eventObj=t,this._renderMode=e,this._gestureController=this._option.getChart().getVGrammarView().renderer._gestureController,this._isGestureListener=Ga(this._renderMode)||Wa(this._renderMode),br(this._renderMode)&&(this._clickEnable=!0,this._zoomableTrigger=new(this._getZoomTriggerEvent("trigger")))}_getZoomTriggerEvent(t){return br(this._renderMode)[t]}_zoomEventDispatch(t,e,i){if(!this._isGestureListener&&!t.event)return;const n=this._isGestureListener?t:t.event.clone();this._zoomableTrigger.parserZoomEvent(n);const{zoomDelta:r,zoomX:a,zoomY:o}=n;P(r)||Vd({x:a,y:o},this._getRegionOrSeriesLayout(e),!1)&&(this._clickEnable=!1,i&&i({zoomDelta:r,zoomX:a,zoomY:o},n),this._eventObj.emit("zoom",{scale:n.zoomDelta,scaleCenter:{x:n.zoomX,y:n.zoomY},model:this}))}_getRegionOrSeriesLayout(t){t.type!=="region"&&(t=t.getRegion());const{x:e,y:i,width:n,height:r}=t.layout.getLayout();return{x1:e,y1:i,x2:e+n,y2:i+r}}_bindZoomEventAsRegion(t,e,i,n){var r,a;const o=(r=n==null?void 0:n.delayType)!==null&&r!==void 0?r:"throttle",l=(a=n==null?void 0:n.delayTime)!==null&&a!==void 0?a:0,h=this._isGestureListener?this._gestureController:t,d=this._isGestureListener?[this._getZoomTriggerEvent("zoom")]:[this._getZoomTriggerEvent("zoom"),{level:Xt.chart,consume:!0}],u=this._isGestureListener?[this._getZoomTriggerEvent("zoomEnd")]:[this._getZoomTriggerEvent("zoomEnd"),{level:Xt.chart,consume:!1}];h.on(...u,sl[o](c=>{this._zoomableTrigger.clearZoom()},l)),h.on(...d,sl[o](c=>{this._zoomEventDispatch(c,e,i)},l))}initZoomEventOfSeries(t,e,i){this._option.disableTriggerEvent||br(this._renderMode)&&this._bindZoomEventAsRegion(t.event,t,e,i)}initZoomEventOfRegions(t,e,i,n){this._option.disableTriggerEvent||br(this._renderMode)&&t.forEach(r=>{e?r.getSeries().forEach(a=>{e(a)&&this._bindZoomEventAsRegion(a.event,a,i,n)}):this._bindZoomEventAsRegion(this._eventObj,r,i,n)})}_scrollEventDispatch(t,e,i){let n=!1;if(!this._isGestureListener&&(!t.event||this._option.disableTriggerEvent))return n;const r=this._isGestureListener?t:t.event;this._zoomableTrigger.parserScrollEvent(r);const{scrollX:a,scrollY:o,canvasX:l,canvasY:h}=r;return P(a)&&P(o)||Vd({x:l,y:h},this._getRegionOrSeriesLayout(e),!1)&&(this._clickEnable=!1,i&&(n=i({scrollX:a,scrollY:o},r)),this._eventObj.emit("scroll",{scrollX:a,scrollY:o,model:this})),n}_bindScrollEventAsRegion(t,e,i,n){var r,a;const o=(r=n==null?void 0:n.delayType)!==null&&r!==void 0?r:"throttle",l=(a=n==null?void 0:n.delayTime)!==null&&a!==void 0?a:0,h=this._isGestureListener?this._gestureController:t,d=this._isGestureListener?[this._getZoomTriggerEvent("scroll")]:[this._getZoomTriggerEvent("scroll"),{level:Xt.chart,consume:!0}],u=this._isGestureListener?[this._getZoomTriggerEvent("scrollEnd")]:[this._getZoomTriggerEvent("scrollEnd"),{level:Xt.chart,consume:!1}];h.on(...u,sl[o](c=>{this._zoomableTrigger.clearScroll()},l)),h.on(...d,sl[o](c=>this._scrollEventDispatch(c,e,i),l))}initScrollEventOfSeries(t,e,i){br(this._renderMode)&&this._bindScrollEventAsRegion(t.event,t,e,i)}initScrollEventOfRegions(t,e,i,n){this._option.disableTriggerEvent||br(this._renderMode)&&t.forEach(r=>{e?r.getSeries().forEach(a=>{e(a)&&this._bindScrollEventAsRegion(a.event,a,i,n)}):this._bindScrollEventAsRegion(this._eventObj,r,i,n)})}_bindDragEventAsRegion(t,e,i,n){t.on(this._getZoomTriggerEvent("start"),{level:Xt.chart},r=>{if(!r.event)return;const{event:a}=r;Vd({x:a.canvasX,y:a.canvasY},this._getRegionOrSeriesLayout(e),!1)&&this._handleDrag(r,i,n)}),t.on("click",{level:Xt.chart},()=>!this._clickEnable)}initDragEventOfSeries(t,e,i){this._option.disableTriggerEvent||br(this._renderMode)&&t.event.on(this._getZoomTriggerEvent("start"),{level:Xt.model,filter:({model:n})=>(n==null?void 0:n.id)===t.id},n=>{this._handleDrag(n,e,i)})}initDragEventOfRegions(t,e,i,n){this._option.disableTriggerEvent||br(this._renderMode)&&t.forEach(r=>{e?r.getSeries().forEach(a=>{e(a)&&(a.event.on(this._getZoomTriggerEvent("start"),{level:Xt.model,filter:({model:o})=>(o==null?void 0:o.id)===a.id},o=>{this._handleDrag(o,i)}),a.event.on("click",{level:Xt.model,filter:({model:o})=>(o==null?void 0:o.id)===a.id},()=>!this._clickEnable))}):this._bindDragEventAsRegion(this._eventObj,r,i,n)})}_handleDrag(t,e,i){var n,r,a;if(this._option.disableTriggerEvent||(this._clickEnable=!0,!this._zoomableTrigger.parserDragEvent(t.event)))return;const o=(n=i==null?void 0:i.delayType)!==null&&n!==void 0?n:"throttle",l=(r=i==null?void 0:i.delayTime)!==null&&r!==void 0?r:0,h=(a=i==null?void 0:i.realTime)===null||a===void 0||a,d=this._getZoomTriggerEvent("move"),u=this._getZoomTriggerEvent("end"),c=t.event;let p=c.canvasX,g=c.canvasY,f=c.canvasX,_=c.canvasY;const m=sl[o](y=>{this._clickEnable=!1;const b=y.event,x=[b.canvasX-f,b.canvasY-_];f=b.canvasX,_=b.canvasY,!h&&e&&e(x,y.event),this._eventObj.emit("panend",{delta:x,model:this}),this._zoomableTrigger.pointerId=null,this._eventObj.off(d,{level:Xt.chart,source:te.chart},v),this._eventObj.off(u,{level:Xt.chart,source:te.window},m)},l),v=sl[o](y=>{if(!this._zoomableTrigger.parserDragEvent(y.event))return;this._clickEnable=!1;const b=y.event,x=[b.canvasX-p,b.canvasY-g];p=b.canvasX,g=b.canvasY,h&&e&&e(x,y.event),this._eventObj.emit("panmove",{delta:x,model:this})},l);this._eventObj.on(d,{level:Xt.chart,source:te.chart},v),this._eventObj.on(u,{level:Xt.chart,source:te.chart},m)}}function ZQ(s,t){return`${At}_${t}_${s}`}class A_ extends bs{constructor(){super(...arguments),this.type=Z.geoCoordinate,this.name=Z.geoCoordinate,this.layoutType="none",this.layoutZIndex=ce.Mark,this._projectionSpec={name:ZQ(this.type,this.id),type:"mercator"},this._actualScale=1,this._initialScale=1,this.effect={scaleUpdate:()=>{this.coordinateHelper()}},this._handleChartZoom=(t,e)=>{var i,n,r,a,o,l;let h=t.zoomDelta;const d=this._actualScale;return this._actualScale*=h,this._actualScale<((i=this._spec.zoomLimit)===null||i===void 0?void 0:i.min)?(this._actualScale=(n=this._spec.zoomLimit)===null||n===void 0?void 0:n.min,h=((r=this._spec.zoomLimit)===null||r===void 0?void 0:r.min)/d):this._actualScale>((a=this._spec.zoomLimit)===null||a===void 0?void 0:a.max)&&(this._actualScale=(o=this._spec.zoomLimit)===null||o===void 0?void 0:o.max,h=((l=this._spec.zoomLimit)===null||l===void 0?void 0:l.max)/d),e&&(e.zoomDelta=h),this.zoom(h,[t.zoomX,t.zoomY]),h},this.pan=(t=[0,0])=>{var e,i,n;const r=(i=(e=this._projection)===null||e===void 0?void 0:e.translate())!==null&&i!==void 0?i:[0,0];let a=r[0],o=r[1];a+=t[0],o+=t[1],(n=this._projection)===null||n===void 0||n.translate([a,o])}}get longitudeField(){return this._longitudeField}get latitudeField(){return this._latitudeField}get projectionSpec(){return this._projectionSpec}setProjection(t){this._projectionSpec=Object.assign(Object.assign({},t),{name:this._projectionSpec.name})}getZoom(){return this._actualScale}static getSpecInfo(t){if(P(t))return null;const e=[];return t.region.forEach((i,n)=>{if(i.coordinate==="geo"){const r=Object.assign(Object.assign({},i),{padding:0});e.push({spec:r,regionIndex:n,type:Z.geoCoordinate,specInfoPath:["region",n,"geoCoordinate"]})}}),e}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this._spec.roam&&this.initZoomable(this.event,this._option.mode),this._projectionSpec=yt(this._projectionSpec,this._spec.projection),this._projectionSpec.zoom>((t=this._spec.zoomLimit)===null||t===void 0?void 0:t.max)&&(this._projectionSpec.zoom=this._spec.zoomLimit.max),this._projectionSpec.zoom<((e=this._spec.zoomLimit)===null||e===void 0?void 0:e.min)&&(this._projectionSpec.zoom=this._spec.zoomLimit.min),this._actualScale=(i=this._projectionSpec.zoom)!==null&&i!==void 0?i:1,this._initialScale=this._actualScale,this._longitudeField=this._spec.longitudeField,this._latitudeField=this._spec.latitudeField}created(){super.created(),this._regions=this._option.getRegionsInIndex([this._option.regionIndex]),this.initProjection(),this.coordinateHelper(),this.initEvent(),this._initCenterCache()}dispatchZoom(t,e){const i=e||{x:this.getLayoutStartPoint().x+this.getLayoutRect().width/2,y:this.getLayoutStartPoint().y+this.getLayoutRect().height/2},n=this._handleChartZoom({zoomDelta:t,zoomX:i.x,zoomY:i.y});n!==1&&this.event.emit("zoom",{scale:n,scaleCenter:i,model:this})}initEvent(){this.event.on(St.scaleUpdate,{filter:({model:t})=>(t==null?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this)),this._spec.roam&&(this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom),this.initDragEventOfRegions(this._regions,()=>!0,this.pan),this._regions.forEach(t=>{t.getSeries().forEach(e=>{e.event.on("zoom",i=>(e.handleZoom(i),!0)),e.event.on("panmove",i=>(e.handlePan(i),!0))})}))}initProjection(){var t;this._projection=new FQ(this._projectionSpec),this._projection.projection!==null||(t=this._option)===null||t===void 0||t.onError("unsupported projection type!")}coordinateHelper(){const t={longitudeField:this._longitudeField,latitudeField:this._latitudeField,dataToPosition:this.dataToPosition.bind(this),dataToLongitude:this.dataToLongitude.bind(this),dataToLatitude:this.dataToLatitude.bind(this),shape:this.shape.bind(this),getCoordinateId:()=>this.id};this._regions.forEach(e=>{e.getSeries().forEach(i=>{i.type===z.map?i.setCoordinateHelper(t):(i.setXAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(n,r)=>{var a;let o=n[0];if(P(o)&&(r!=null&&r.datum)){const l=r.datum[i.getDimensionField()[0]];o=(a=this._centerCache.get(l))===null||a===void 0?void 0:a.x}return this.dataToLongitude(o)},valueToPosition:(n,r)=>{var a;if(P(n)&&(r!=null&&r.datum)){const o=r.datum[i.getDimensionField()[0]];n=(a=this._centerCache.get(o))===null||a===void 0?void 0:a.x}return this.dataToLongitude(n)},getFields:()=>[this._longitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})),i.setYAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(n,r)=>{var a;let o=n[0];if(P(o)&&(r!=null&&r.datum)){const l=r.datum[i.getDimensionField()[0]];o=(a=this._centerCache.get(l))===null||a===void 0?void 0:a.y}return this.dataToLatitude(o)},valueToPosition:(n,r)=>{var a;if(P(n)&&(r!=null&&r.datum)){const o=r.datum[i.getDimensionField()[0]];n=(a=this._centerCache.get(o))===null||a===void 0?void 0:a.y}return this.dataToLatitude(n)},getFields:()=>[this._latitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})))})})}onLayoutEnd(t){this.setLayoutRect(this._regions[0].getLayoutRect()),this.setLayoutStartPosition(this._regions[0].getLayoutStartPoint());const{width:e,height:i}=this.getLayoutRect(),{translate:n,scale:r,center:a}=this.evaluateProjection([0,0],[e,i]);n&&this._projection.translate(n),r&&this._projection.scale(r),a&&this._projection.center(a),Ie(this._regions,o=>{var l;if(o.type===z.map){o.areaPath.clear();const h=(l=o.getRootMark().getProduct())===null||l===void 0?void 0:l.getGroupGraphicItem();h&&h.attribute.postMatrix&&h.setAttributes({postMatrix:new Ke})}}),this._actualScale=this._initialScale,super.onLayoutEnd(t)}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}collectFeatures(){const t=[];return this._regions.forEach(e=>{e.getSeries().forEach(i=>{var n,r;i.type===z.map&&t.push(...(r=(n=i.getMapViewData())===null||n===void 0?void 0:n.latestData)!==null&&r!==void 0?r:[])})}),t}dataToPosition(t=[]){var e;const i=(e=this._projection)===null||e===void 0?void 0:e.project([t[0],t[1]]);return{x:i==null?void 0:i[0],y:i==null?void 0:i[1]}}dataToLatitude(t){var e;const i=(e=this._projection)===null||e===void 0?void 0:e.project([0,t]);return i==null?void 0:i[1]}dataToLongitude(t){var e;const i=(e=this._projection)===null||e===void 0?void 0:e.project([t,0]);return i==null?void 0:i[0]}zoom(t,e=[0,0]){var i,n,r,a,o,l;let h=(n=(i=this._projection)===null||i===void 0?void 0:i.scale())!==null&&n!==void 0?n:0;const d=(a=(r=this._projection)===null||r===void 0?void 0:r.translate())!==null&&a!==void 0?a:[0,0];let u=d[0],c=d[1];h*=t,u-=(e[0]-u)*(t-1),c-=(e[1]-c)*(t-1),(o=this._projection)===null||o===void 0||o.scale(h),(l=this._projection)===null||l===void 0||l.translate([u,c])}shape(t){return this._projection.shape(t)}invert(t){return this._projection.invert(t)}evaluateProjection(t,e){var i;const n=this._projection.evaluate(t,e,this.collectFeatures());let r=n.translate();const a=n.scale()*this._initialScale,o=(i=this._projectionSpec.center)!==null&&i!==void 0?i:n.invert([e[0]/2,e[1]/2]);return o&&(r=[e[0]/2,e[1]/2]),{translate:r,scale:a,center:o}}_initCenterCache(){this._centerCache||(this._centerCache=new Map),this._regions.forEach(t=>{t.getSeries().forEach(e=>{var i,n;e.type==="map"&&((n=(i=e.getMapViewData())===null||i===void 0?void 0:i.latestData)!==null&&n!==void 0?n:[]).forEach((r={})=>{const a=r[e.getDimensionField()[0]]||r[S_],o=e.getDatumCenter(r);a&&E(o)&&this._centerCache.set(a,{x:o[0],y:o[1]})})})})}release(){super.release(),this._centerCache&&this._centerCache.clear(),this._centerCache=null}}A_.type=Z.geoCoordinate,Ai(A_,mA);const hD=()=>{F.registerComponent(A_.type,A_)};class dD extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"area",void 0,void 0,!1)}}class Ra extends LQ{constructor(){super(...arguments),this.type=z.map,this.transformerConstructor=dD,this._areaCache=new Map}getNameMap(){return this._nameMap}get areaPath(){return this._areaCache}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.map=this._spec.map,this._nameMap=this._spec.nameMap,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._spec.nameProperty&&(this._nameProperty=this._spec.nameProperty),this._spec.centroidProperty&&(this._centroidProperty=this._spec.centroidProperty),this.map||(t=this._option)===null||t===void 0||t.onError(`map type '${this.map}' is not specified !`),Oo.get(this.map)||(e=this._option)===null||e===void 0||e.onError(`'${this.map}' data is not registered !`)}initData(){var t,e;super.initData(),Ct(this._dataSet,"copyDataView",Km),Ct(this._dataSet,"map",BQ),Ct(this._dataSet,"lookup",IQ);const i=Oo.get(this.map);i||(t=this._option)===null||t===void 0||t.onError("no valid map data found!");const n=new Jt(this._dataSet,{name:`map_${this.id}_data`});n.parse([i],{type:"dataview"}).transform({type:"copyDataView",options:{deep:!0},level:Hs.copyDataView}).transform({type:"map",options:{nameMap:this._nameMap,nameProperty:this._nameProperty}}).transform({type:"lookup",options:{from:()=>{var r;return(r=this._data)===null||r===void 0?void 0:r.getLatestData()},key:S_,fields:this._nameField,set:(r,a)=>{a&&Object.keys(a).forEach(o=>{o in r||(r[o]=a[o])})}}}),(e=this._data)===null||e===void 0||e.getDataView().target.addListener("change",n.reRunAllTransform),this._mapViewData=new or(this._option,n)}initMark(){this._pathMark=this._createMark(Ra.mark.area,{morph:Yr(this._spec,Ra.mark.area.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0,dataView:this._mapViewData.getDataView(),dataProductId:this._mapViewData.getProductId()})}initMarkStyle(){const t=this._pathMark;t&&(this.setMarkStyle(t,{fill:e=>{var i,n,r,a;return E(e[(i=this._seriesField)!==null&&i!==void 0?i:Fs])?((n=this._option.globalScale.getScale("color"))!==null&&n!==void 0?n:this._getDefaultColorScale()).scale(e[(r=this._seriesField)!==null&&r!==void 0?r:Fs]):(a=this._spec)===null||a===void 0?void 0:a.defaultFillColor},path:this.getPath.bind(this)},"normal",tt.Series),t.setPostProcess("fill",e=>E(e)?e:this._spec.defaultFillColor),this.setMarkStyle(t,{smoothScale:!0},"normal",tt.Built_In),this._trigger.registerMark(t))}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{text:e=>this.getDatumName(e),x:e=>{var i;return(i=this.dataToPosition(e))===null||i===void 0?void 0:i.x},y:e=>{var i;return(i=this.dataToPosition(e))===null||i===void 0?void 0:i.y}}))}initAnimation(){var t;this._pathMark.setAnimationConfig(zt((t=F.getAnimationInKey("fadeInOut"))===null||t===void 0?void 0:t(),Yt("area",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new DQ(this),this._pathMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pathMark)}getPath(t){var e;const i=this._areaCache.get(t[Si]);if(i)return i.shape;const n=(e=this._coordinateHelper)===null||e===void 0?void 0:e.shape(t);return this._areaCache.set(t[Si],{shape:n}),n}onEvaluateEnd(){this._mapViewData.updateData()}getDimensionField(){return[this.nameField]}getMeasureField(){return[this.valueField]}release(){super.release(),this._areaCache.clear(),this._nameMap={},this._trigger=this._mapViewData=null}handleZoom(t){var e,i,n;const{scale:r,scaleCenter:a}=t;if(r===1)return;const o=(e=this.getRootMark().getProduct())===null||e===void 0?void 0:e.getGroupGraphicItem();o&&(o.attribute.postMatrix||o.setAttributes({postMatrix:new Ke}),o.scale(r,r,a));const l=(n=(i=this._labelMark)===null||i===void 0?void 0:i.getComponent())===null||n===void 0?void 0:n.getProduct();l&&l.evaluateSync(null,null)}handlePan(t){var e,i,n;const{delta:r}=t;if(r[0]===0&&r[1]===0)return;const a=(e=this.getRootMark().getProduct())===null||e===void 0?void 0:e.getGroupGraphicItem();a&&(a.attribute.postMatrix||a.setAttributes({postMatrix:new Ke}),a.translate(r[0],r[1]));const o=(n=(i=this._labelMark)===null||i===void 0?void 0:i.getComponent())===null||n===void 0?void 0:n.getProduct();o&&o.evaluateSync(null,null)}getDatumCenter(t){var e,i,n,r;return this._centroidProperty&&(!((e=t.properties)===null||e===void 0)&&e[this._centroidProperty])?(i=t.properties)===null||i===void 0?void 0:i[this._centroidProperty]:N(t.centroidX*t.centroidY)?[t.centroidX,t.centroidY]:!((n=t.properties)===null||n===void 0)&&n.center?t.properties.center:!((r=t.properties)===null||r===void 0)&&r.centroid?t.properties.centroid:[Number.NaN,Number.NaN]}getDatumName(t){var e,i,n,r;return t[this.nameField]?t[this.nameField]:!((e=t.properties)===null||e===void 0)&&e[this._nameProperty]?!((i=this._spec)===null||i===void 0)&&i.nameMap?(n=this._spec.nameMap[t.properties[this._nameProperty]])!==null&&n!==void 0?n:"":(r=t.properties[this._nameProperty])!==null&&r!==void 0?r:"":""}dataToPositionX(t){var e;return(e=this._option)===null||e===void 0||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return(e=this._option)===null||e===void 0||e.onError("Method not implemented."),0}viewDataUpdate(t){var e,i,n;super.viewDataUpdate(t),(i=(e=this._mapViewData)===null||e===void 0?void 0:e.getDataView())===null||i===void 0||i.reRunAllTransform(),(n=this._mapViewData)===null||n===void 0||n.updateData()}_getDataIdKey(){return Si}getActiveMarks(){return[this._pathMark]}}Ra.type=z.map,Ra.mark=jL,Ra.transformerConstructor=dD;const JQ=()=>{OQ(),hD(),rD(),F.registerSeries(Ra.type,Ra),F.registerImplement("registerMap",QZ),F.registerImplement("unregisterMap",tJ),$r()},QQ=(s,t)=>{if(!s||s.length===0)return s;const{indexField:e,valueField:i,startAs:n,endAs:r,total:a,seriesField:o,seriesFieldName:l,groupData:h}=t,d=[],{dimensionValues:u,dimensionData:c}=h().latestData,p=Array.from(u[e]);let g={start:0,end:0,lastIndex:null};return p.forEach((f,_)=>{const m={start:g.end,end:g.end,lastIndex:g.lastIndex,lastEnd:g.end,index:f,isTotal:!1};c[f].forEach(v=>{let y=!1;if(a&&a.type!=="end"){if((a.type==="field"||a.type==="custom")&&v[a.tagField])if(y=!0,a.type==="custom"){const{start:b,end:x}=a.product(v,g);v[n]=b,v[r]=x,m.end=x,m.start=b}else{let b=0,x=m.end;if(a.collectCountField&&!P(v[a.collectCountField])){const S=d.length-+v[a.collectCountField],A=d.length-1;S<0?console.warn("total.collectCountField error"):b=d[S].start,A<0?console.warn("total.collectCountField error"):x=d[A].end}else a.startField&&!P(v[a.startField])&&(b=+v[a.startField]),a.valueField&&!P(v[a.valueField])&&(x=oy(b,+v[a.valueField]));v[n]=b,v[r]=x,v[i]=x-b,m.start=b,m.end=x}}else _===p.length-1&&(m.start=0,v[n]=m.start,v[r]=m.end,y=!0);y||(v[n]=+m.end,v[r]=oy(v[n],+v[i]),m.end=v[r]),m.isTotal=y,(P(o)||o===u_)&&(v[u_]=y?l.total:+v[i]>=0?l.increase:l.decrease)}),g=Object.assign(Object.assign({},m),{lastIndex:f}),d.push(m)}),d},ttt=(s,t)=>{if(!s)return s;const{indexField:e,valueField:i,total:n,seriesField:r}=t,a={[e]:(n==null?void 0:n.text)||"total",[i]:s.reduce((o,l)=>oy(o,+l[i]),0)};return r&&(a[r]="total"),s.push(a),s},ett={type:"fadeIn"},itt={type:"growCenterIn"};function stt(s,t){switch(t){case"fadeIn":return ett;case"scaleIn":return itt;default:return Gc(s,!1)}}const ntt=()=>{F.registerAnimation("waterfall",(s,t)=>({appear:stt(s,t),enter:Gc(s,!1),exit:Fh(s,!1),disappear:Fh(s,!1)}))};class rc extends Hi{constructor(){super(...arguments),this.type=rc.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x1:0,y1:0})}}rc.type="rule";const Vc=()=>{F.registerMark(rc.type,rc),KS()},rtt=(s,t)=>{if(!t.fields)return s;const e={};return{dimensionValues:e,dimensionData:uD(s.map(i=>i.latestData).flat(),t.fields,e)}};function uD(s,t,e){if(t.length===0)return s;const i=t[0],n=t.slice(1);e[i]=new Set;const r=att(s,i,e[i]);return n.length?ott(r,(a,o)=>uD(a,n,e)):r}function att(s,t,e){const i={};return s.forEach(n=>{const r=n[t];i[r]||(i[r]=[],e.add(r)),i[r].push(n)}),i}function ott(s,t){return Object.keys(s).reduce((e,i)=>(e[i]=t(s[i],i),e),{})}class ltt{get fields(){return this._fields}get groupData(){return this._groupData}constructor(t){this._fields=[],this._fields=t}initData(t,e){const i=t.name,n=new Jt(e instanceof ko?e:t.dataSet);n.name=i,n.parse([t],{type:"dataview"}),Ct(e,"dimensionTree",rtt),n.transform({type:"dimensionTree",options:{fields:this._fields}},!1),n.target.addListener("change",this.groupDataUpdate.bind(this)),this._groupData=n}groupDataUpdate(){}getGroupValueInField(t){var e,i,n;const r=(n=(i=(e=this.groupData)===null||e===void 0?void 0:e.latestData)===null||i===void 0?void 0:i.dimensionValues)===null||n===void 0?void 0:n[t];return r?Array.from(r):[]}}class cD extends sv{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar"),this._addMarkLabelSpec(t,"bar","stackLabel")}}class xo extends On{constructor(){super(...arguments),this.type=z.waterfall,this.transformerConstructor=cD,this._stack=!1,this._leaderLineMark=null,this._stackLabelMark=null,this._labelMark=null}getTotalData(){var t;return(t=this._totalData)===null||t===void 0?void 0:t.getLatestData()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups=new ltt(t),this._data&&this._groups.initData(this._data.getDataView(),this._dataSet))}setAttrFromSpec(){super.setAttrFromSpec(),this.setValueFieldToStack(),this._fieldX=[this._fieldX[0]],this._fieldY=[this._fieldY[0]],P(this._seriesField)&&(this._seriesField=u_)}getSeriesKeys(){return this._seriesField===u_?[this._theme.seriesFieldName.increase,this._theme.seriesFieldName.decrease,this._theme.seriesFieldName.total]:super.getSeriesKeys()}initData(){var t;super.initData(),Ct(this._dataSet,"waterfallFillTotal",ttt),Ct(this._dataSet,"waterfall",QQ),(P(this._spec.total)||this._spec.total.type==="end")&&((t=this._rawData)===null||t===void 0||t.transform({type:"waterfallFillTotal",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,total:this._spec.total}},!1));const e=Sx(this.getViewData(),this._dataSet,{name:`${At}_series_${this.id}_totalData`});this.getViewData().target.removeListener("change",e.reRunAllTransform),this._totalData=new or(this._option,e),e.transform({type:"waterfall",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,startAs:ln,endAs:ui,total:this._spec.total,groupData:()=>this.getGroups().groupData}},!1)}initAnimation(){var t,e,i,n;const r={yField:this.direction==="horizontal"?this._fieldY[0]:this.getStackValueField(),xField:this.direction==="horizontal"?this.getStackValueField():this._fieldX[0],direction:this.direction,growFrom:()=>{var l,h;return this.direction==="horizontal"?(l=this._xAxisHelper)===null||l===void 0?void 0:l.getScale(0).scale(0):(h=this._yAxisHelper)===null||h===void 0?void 0:h.getScale(0).scale(0)}},a=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset,o=to(this);this._barMark.setAnimationConfig(zt((i=F.getAnimationInKey("waterfall"))===null||i===void 0?void 0:i(r,a),Yt("bar",this._spec,this._markAttributeContext),o)),this._leaderLineMark&&this._leaderLineMark.setAnimationConfig(zt((n=F.getAnimationInKey("fadeInOut"))===null||n===void 0?void 0:n(),Yt("leaderLine",this._spec,this._markAttributeContext)))}viewDataUpdate(t){this._totalData.getDataView().reRunAllTransform(),this._totalData.updateData(),super.viewDataUpdate(t)}addViewDataFilter(t){}reFilterViewData(){}onEvaluateEnd(t){super.onEvaluateEnd(t),this._totalData.updateData()}initMark(){var t;super.initMark();const e=this._createMark(xo.mark.leaderLine,{key:"index",customShape:(t=this._spec.leaderLine)===null||t===void 0?void 0:t.customShape});e&&(this._leaderLineMark=e,e.setDataView(this._totalData.getDataView(),this._totalData.getProductId()))}initLabelMarkStyle(t){var e;if(t){if(!this._labelMark&&(!((e=this._spec.label)===null||e===void 0)&&e.visible))return super.initLabelMarkStyle(t),void(this._labelMark=t);this._stackLabelMark=t,t.skipEncode=!0,t.setRule("stackLabel"),t.setDataView(this._totalData.getDataView(),this._totalData.getProductId()),this.setMarkStyle(t,{text:i=>{var n;return((n=this._spec.stackLabel)===null||n===void 0?void 0:n.valueType)==="absolute"?i.end:kj(i.end,i.start)}})}}totalPositionX(t,e,i=.5){const{dataToPosition:n,getBandwidth:r}=this._xAxisHelper;return this._direction==="vertical"?n([t[e]],{bandPosition:this._bandPosition})+.5*r(0)-this._barMark.getAttribute("width",t)*(.5-i):ee(n([t[e]],{bandPosition:this._bandPosition}))}totalPositionY(t,e,i=.5){const{dataToPosition:n,getBandwidth:r}=this._yAxisHelper;return this._direction==="vertical"?ee(n([t[e]],{bandPosition:this._bandPosition})):n([t[e]],{bandPosition:this._bandPosition})+.5*r(0)-this._barMark.getAttribute("height",t)*(.5-i)}initMarkStyle(){super.initMarkStyle(),this._leaderLineMark&&(this._direction==="vertical"?this.setMarkStyle(this._leaderLineMark,{visible:t=>!P(t.lastIndex),x:t=>t.lastIndex?this.totalPositionX(t,"lastIndex",1):0,x1:t=>this.totalPositionX(t,"index",0),y:t=>this.totalPositionY(t,"lastEnd",0),y1:t=>this.totalPositionY(t,t.isTotal?"end":"start",0)},"normal",tt.Series):this.setMarkStyle(this._leaderLineMark,{visible:t=>!P(t.lastIndex),x:t=>this.totalPositionX(t,"lastEnd",0),x1:t=>this.totalPositionX(t,t.isTotal?"end":"start",0),y:t=>t.lastIndex?this.totalPositionY(t,"lastIndex",1):0,y1:t=>this.totalPositionY(t,"index",0)},"normal",tt.Series))}}xo.type=z.waterfall,xo.mark=UL,xo.transformerConstructor=cD;const htt=()=>{Vc(),io(),ntt(),$r(),F.registerSeries(xo.type,xo)},ac=`${At}_BOX_PLOT_OUTLIER_VALUE`;var ge;(function(s){s.OUTLIER="outlier",s.MAX="max",s.MIN="min",s.MEDIAN="median",s.Q1="q1",s.Q3="q3",s.SERIES_FIELD="seriesField"})(ge||(ge={}));const dtt=(s,t)=>{const e=[],{outliersField:i,dimensionField:n}=t;return(s[0].latestData||[]).forEach(r=>{let a=r[i];$(a)||(a=[a]),e.push(...a.map(o=>{const l={[ac]:o};return n.forEach(h=>{l[h]=r[h]}),l}))}),e};class utt extends ys{constructor(){super(...arguments),this.getContentKey=t=>e=>{if(this.isOutlierMark(e))return t===ge.OUTLIER?this.series.getOutliersField():t===ge.SERIES_FIELD?this.series.getSeriesField():null;switch(t){case ge.MIN:return this.series.getMinField();case ge.MAX:return this.series.getMaxField();case ge.MEDIAN:return this.series.getMedianField();case ge.Q1:return this.series.getQ1Field();case ge.Q3:return this.series.getQ3Field();case ge.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{if(this.isOutlierMark(e))return t===ge.OUTLIER?e[ac]:t===ge.SERIES_FIELD?e[this.series.getSeriesField()]:null;switch(t){case ge.MIN:return e[this.series.getMinField()];case ge.MAX:return e[this.series.getMaxField()];case ge.MEDIAN:return e[this.series.getMedianField()];case ge.Q1:return e[this.series.getQ1Field()];case ge.Q3:return e[this.series.getQ3Field()];case ge.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.contentShapeColorCallback=t=>this.series.getShaftShape()==="line"?this.series.getMarkInName("boxPlot").getAttribute("stroke",t):this.series.getMarkInName("boxPlot").getAttribute("fill",t),this.getOutlierFillColor=t=>{var e;const i=this.series.getOutliersStyle();return(e=i==null?void 0:i.fill)!==null&&e!==void 0?e:this.series.getMarkInName("outlier").getAttribute("fill",t)},this.isOutlierMark=t=>E(t[ac])}getDefaultTooltipPattern(t){return{visible:!0,activeType:t,title:{key:void 0,value:this.titleValueCallback,hasShape:!1},content:[{key:this.getContentKey(ge.OUTLIER),value:this.getContentValue(ge.OUTLIER),hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.getOutlierFillColor,shapeStroke:this.getOutlierFillColor,shapeHollow:!1},{key:this.getContentKey(ge.MAX),value:this.getContentValue(ge.MAX),hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1},{key:this.getContentKey(ge.Q3),value:this.getContentValue(ge.Q3),hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1},{key:this.getContentKey(ge.MEDIAN),value:this.getContentValue(ge.MEDIAN),hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1},{key:this.getContentKey(ge.Q1),value:this.getContentValue(ge.Q1),hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1},{key:this.getContentKey(ge.MIN),value:this.getContentValue(ge.MIN),hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1},{key:this.getContentKey(ge.SERIES_FIELD),value:this.getContentValue(ge.SERIES_FIELD),hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1}]}}}class oc extends Hi{constructor(){super(...arguments),this.type=oc.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:2,boxWidth:30,shaftWidth:20,shaftShape:"line"})}_initProduct(t){const e=this.getStyle("shaftShape"),i=this.getVGrammarView(),n=this.getProductId(),r=e==="bar"?"barBoxplot":"boxplot",a=this.getStyle("direction");this._product=i.glyph(r,t??i.rootMark).id(n).configureGlyph({direction:a}),this._compiledProductId=n}}oc.type="boxPlot";const ctt=()=>{F.registerMark(oc.type,oc),a9(),d9()};class Lo extends pn{constructor(){super(...arguments),this.type=z.boxPlot}getMinField(){return this._minField}getMaxField(){return this._maxField}getQ1Field(){return this._q1Field}getMedianField(){return this._medianField}getQ3Field(){return this._q3Field}getOutliersField(){return this._outliersField}getShaftShape(){return this._shaftShape}getBoxFillColor(){return this._boxFillColor}getStrokeColor(){return this._strokeColor}getOutliersStyle(){return this._outliersStyle}setAttrFromSpec(){var t,e,i,n,r;super.setAttrFromSpec();const a=(e=(t=this._spec.boxPlot)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{};this._minField=this._spec.minField,this._maxField=this._spec.maxField,this._q1Field=this._spec.q1Field,this._medianField=this._spec.medianField,this._q3Field=this._spec.q3Field,this._outliersField=this._spec.outliersField,this._lineWidth=(i=a.lineWidth)!==null&&i!==void 0?i:2,this._boxWidth=a.boxWidth,this._shaftShape=(n=a.shaftShape)!==null&&n!==void 0?n:"line",this._shaftWidth=a.shaftWidth,this._boxFillColor=a.boxFill,this._strokeColor=a.stroke,this._shaftFillOpacity=this._shaftShape==="bar"?(r=a.shaftFillOpacity)!==null&&r!==void 0?r:.5:void 0,this._outliersStyle=this._spec.outliersStyle}initMark(){const t={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._boxPlotMark=this._createMark(Lo.mark.boxPlot,{isSeriesMark:!0,progressive:t}),this._outlierMark=this._createMark(Lo.mark.outlier,{progressive:t,key:Si,dataView:this._outlierDataView.getDataView(),dataProductId:this._outlierDataView.getProductId()})}initMarkStyle(){var t,e,i,n,r;const a=this._boxPlotMark;if(a){const l={direction:this._direction,lineWidth:this._lineWidth,shaftShape:this._shaftShape,fill:(t=this._boxFillColor)!==null&&t!==void 0?t:this._shaftShape==="line"?"#FFF":this.getColorAttribute(),minMaxFillOpacity:this._shaftFillOpacity,stroke:(e=this._strokeColor)!==null&&e!==void 0?e:this._shaftShape==="line"?this.getColorAttribute():"#000"},h=this._direction==="vertical"?Object.assign(Object.assign({x:this.dataToPositionX.bind(this)},l),{boxWidth:()=>{var d;return(d=this._boxWidth)!==null&&d!==void 0?d:this._getMarkWidth()},ruleWidth:()=>{var d;return(d=this._shaftWidth)!==null&&d!==void 0?d:this._getMarkWidth()},q1q3Width:()=>{var d;return(d=this._boxWidth)!==null&&d!==void 0?d:this._getMarkWidth()},minMaxWidth:()=>{var d;return(d=this._shaftWidth)!==null&&d!==void 0?d:this._getMarkWidth()}}):Object.assign(Object.assign({y:this.dataToPositionY.bind(this)},l),{boxHeight:()=>{var d;return(d=this._boxWidth)!==null&&d!==void 0?d:this._getMarkWidth()},ruleHeight:()=>{var d;return(d=this._shaftWidth)!==null&&d!==void 0?d:this._getMarkWidth()},q1q3Height:()=>{var d;return(d=this._boxWidth)!==null&&d!==void 0?d:this._getMarkWidth()},minMaxHeight:()=>{var d;return(d=this._shaftWidth)!==null&&d!==void 0?d:this._getMarkWidth()}});this.setMarkStyle(a,h,bt.STATE_NORMAL,tt.Series),this._trigger.registerMark(a)}const o=this._outlierMark;o&&(this.setMarkStyle(o,{fill:(n=(i=this._outliersStyle)===null||i===void 0?void 0:i.fill)!==null&&n!==void 0?n:this.getColorAttribute(),size:dt((r=this._outliersStyle)===null||r===void 0?void 0:r.size)?this._outliersStyle.size:10,symbolType:"circle"},bt.STATE_NORMAL,tt.Series),this._trigger.registerMark(o))}initBoxPlotMarkStyle(){var t,e;const i=this._boxPlotMark,n=this._direction==="vertical"?this._yAxisHelper:this._xAxisHelper;if(i&&n){const{dataToPosition:a}=n,o=(t=n==null?void 0:n.getScale)===null||t===void 0?void 0:t.call(n,0);this.setMarkStyle(i,{min:l=>ee(a(this.getDatumPositionValues(l,this._minField),{bandPosition:this._bandPosition}),o),q1:l=>ee(a(this.getDatumPositionValues(l,this._q1Field),{bandPosition:this._bandPosition}),o),median:l=>ee(a(this.getDatumPositionValues(l,this._medianField),{bandPosition:this._bandPosition}),o),q3:l=>ee(a(this.getDatumPositionValues(l,this._q3Field),{bandPosition:this._bandPosition}),o),max:l=>ee(a(this.getDatumPositionValues(l,this._maxField),{bandPosition:this._bandPosition}),o)},bt.STATE_NORMAL,tt.Series)}const r=this._outlierMark;if(r&&n){const{dataToPosition:a}=n,o=(e=n==null?void 0:n.getScale)===null||e===void 0?void 0:e.call(n,0),l=this._direction==="vertical"?{x:this.dataToPositionX.bind(this),y:h=>ee(a(this.getDatumPositionValues(h,ac),{bandPosition:this._bandPosition}),o)}:{y:this.dataToPositionY.bind(this),x:h=>ee(a(this.getDatumPositionValues(h,ac),{bandPosition:this._bandPosition}),o)};this.setMarkStyle(r,l,bt.STATE_NORMAL,tt.Series)}}initData(){if(super.initData(),!this._data)return;Ct(this._dataSet,"foldOutlierData",dtt),Ct(this._dataSet,"addVChartProperty",ed);const t=new Jt(this._dataSet,{name:`${this.type}_outlier_${this.id}_data`});t.parse([this.getViewData()],{type:"dataview"}),t.name=`${At}_series_${this.id}_outlierData`,t.transform({type:"foldOutlierData",options:{dimensionField:this._direction==="vertical"?this._fieldX:this._fieldY,outliersField:this._outliersField}}),t.transform({type:"addVChartProperty",options:{beforeCall:qu.bind(this),call:Dh}},!1),this._outlierDataView=new or(this._option,t)}init(t){super.init(t),this.initBoxPlotMarkStyle()}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t=this._direction==="vertical"?this._xAxisHelper:this._yAxisHelper,e=this._direction==="vertical"?this._fieldX:this._fieldY,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(t){super.onLayoutEnd(t),this._autoBoxWidth=null}_initAnimationSpec(t={}){const e=lt({},t);return["appear","enter","update","exit","disappear"].forEach(i=>{e[i]&&e[i].type==="scaleIn"?e[i].type=this._shaftShape==="line"?"boxplotScaleIn":"barBoxplotScaleIn":e[i]&&e[i].type==="scaleOut"&&(e[i].type=this._shaftShape==="line"?"boxplotScaleOut":"barBoxplotScaleOut")}),e}initAnimation(){var t,e,i,n,r,a,o;const l=to(this);if(this._boxPlotMark){const h=this._initAnimationSpec((t=F.getAnimationInKey("scaleInOut"))===null||t===void 0?void 0:t()),d=this._initAnimationSpec(Yt("boxPlot",this._spec,this._markAttributeContext));this._boxPlotMark.setAnimationConfig(zt(h,d,l))}if(this._outlierMark){const h={appear:(e=this._spec.animationAppear)===null||e===void 0?void 0:e.symbol,disappear:(i=this._spec.animationDisappear)===null||i===void 0?void 0:i.symbol,enter:(n=this._spec.animationEnter)===null||n===void 0?void 0:n.symbol,exit:(r=this._spec.animationExit)===null||r===void 0?void 0:r.symbol,update:(a=this._spec.animationUpdate)===null||a===void 0?void 0:a.symbol};this._outlierMark.setAnimationConfig(zt((o=F.getAnimationInKey("scaleInOut"))===null||o===void 0?void 0:o(),h,l))}}initTooltip(){this._tooltipHelper=new utt(this),this._boxPlotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._boxPlotMark),this._outlierMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._outlierMark)}getStatisticFields(){const t=super.getStatisticFields(),e=t.find(i=>i.key===this._outliersField);return e&&(e.operations=["array-min","array-max"]),t}onEvaluateEnd(t){super.onEvaluateEnd(t),this._outlierDataView.updateData()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._boxPlotMark]}}Lo.type=z.boxPlot,Lo.mark=$L;const ptt=()=>{ctt(),eo(),ev(),F.registerSeries(Lo.type,Lo)};class jh extends Hi{constructor(){super(...arguments),this.type=jh.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{angle:0,textAlign:"center",lineWidth:0,textConfig:[]})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this.getStyle("textType")==="rich"?this._product=e.mark(rt.richtext,t??e.rootMark).id(i):this._product=e.mark(rt.text,t??e.rootMark).id(i),this._compiledProductId=i}}jh.type="text";const Gs=()=>{F.registerMark(jh.type,jh),dL(),e9()};function WC(s,t,e,i,n,r,a,o,l){s.setMarkStyle(t,{textAlign:h=>{if(l()==="vertical")return"center";const d=n(h),u=r(h);if(e==="middle")return"center";if(d>=u){if(e==="start")return"left";if(e==="end")return"right";if(e==="outside")return"left"}else{if(e==="start")return"right";if(e==="end")return"left";if(e==="outside")return"right"}return"center"},textBaseline:h=>{if(l()==="horizontal")return"middle";const d=a(h),u=o(h);if(e==="middle")return"middle";if(u>=d){if(e==="start")return"bottom";if(e==="end")return"top";if(e==="outside")return"bottom"}else{if(e==="start")return"top";if(e==="end")return"bottom";if(e==="outside")return"top"}return"middle"}}),s.setMarkStyle(t,{x:h=>{const d=l(),u=n(h),c=r(h);if(d==="vertical"||e==="middle")return(u+c)/2;if(u>=c){if(e==="start")return c+i;if(e==="end")return u-i;if(e==="outside")return u+i}else{if(e==="start")return c-i;if(e==="end")return u+i;if(e==="outside")return u-i}return(u+c)/2},y:h=>{const d=l(),u=a(h),c=o(h);if(d==="horizontal"||e==="middle")return(u+c)/2;if(u>=c){if(e==="start")return c+i;if(e==="end")return u-i;if(e==="outside")return u+i}else{if(e==="start")return c-i;if(e==="end")return u+i;if(e==="outside")return u-i}return(u+c)/2}},"normal",tt.Series)}class gtt extends ys{getDefaultTooltipPattern(t){return{visible:!0,activeType:t,title:{key:void 0,value:this.titleValueCallback,hasShape:!1},content:[{key:this.contentKeyCallback,value:e=>this.series.getSpec().direction==="horizontal"?e[this.series.getSpec().xField[0]]+"-"+e[this.series.getSpec().xField[1]]:e[this.series.getSpec().yField[0]]+"-"+e[this.series.getSpec().yField[1]],hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1}]}}}const pD=s=>({type:"growCenterIn",options:{direction:s.direction==="horizontal"?"x":"y"}}),ftt={type:"fadeIn"},VC=s=>({type:"growCenterOut",options:{direction:s.direction==="horizontal"?"x":"y"}});function _tt(s,t){return t==="fadeIn"?ftt:pD(s)}const mtt=()=>{F.registerAnimation("rangeColumn",(s,t)=>({appear:_tt(s,t),enter:pD(s),exit:VC(s),disappear:VC(s)}))};class gD extends sv{_transformLabelSpec(t){var e;((e=t.label)===null||e===void 0?void 0:e.position)!=="bothEnd"&&this._addMarkLabelSpec(t,"bar")}}class Pn extends On{constructor(){super(...arguments),this.type=z.rangeColumn,this._barMarkType="rect",this._barName=z.bar,this.transformerConstructor=gD,this._stack=!1}initMark(){var t,e,i,n,r,a,o,l,h;this._initBarBackgroundMark();const d=(t=this._spec.label)===null||t===void 0?void 0:t.position;this._barMark=this._createMark(Pn.mark.bar,{morph:Yr(this._spec,Pn.mark.bar.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:(e=this._spec.bar)===null||e===void 0?void 0:e.customShape}),((i=this._spec.label)===null||i===void 0?void 0:i.visible)!==!1&&d==="bothEnd"&&(((r=(n=this._spec.label)===null||n===void 0?void 0:n.minLabel)===null||r===void 0?void 0:r.visible)!==!1&&(this._minLabelMark=this._createMark(Pn.mark.minLabel,{markSpec:(a=this._spec.label)===null||a===void 0?void 0:a.minLabel})),((l=(o=this._spec.label)===null||o===void 0?void 0:o.maxLabel)===null||l===void 0?void 0:l.visible)!==!1&&(this._maxLabelMark=this._createMark(Pn.mark.maxLabel,{markSpec:(h=this._spec.label)===null||h===void 0?void 0:h.maxLabel})))}initMarkStyle(){var t,e,i,n,r,a,o,l,h,d;super.initMarkStyle();const u=this._minLabelMark,c=(t=this._spec.label)===null||t===void 0?void 0:t.minLabel;if(u){this.setMarkStyle(u,{fill:(i=(e=c==null?void 0:c.style)===null||e===void 0?void 0:e.fill)!==null&&i!==void 0?i:this.getColorAttribute(),text:m=>{const v=this._spec.direction==="horizontal"?m[this._spec.xField[0]]:m[this._spec.yField[0]];return c!=null&&c.formatMethod?c.formatMethod(v,m):v}});const f=(n=c==null?void 0:c.position)!==null&&n!==void 0?n:"end",_=(r=c==null?void 0:c.offset)!==null&&r!==void 0?r:this._direction==="vertical"?-20:-25;WC(this,u,f,_,m=>this._barMark.getAttribute("x",m),m=>this._direction==="vertical"?this._barMark.getAttribute("x",m)+this._barMark.getAttribute("width",m):this._barMark.getAttribute("x1",m),m=>this._barMark.getAttribute("y",m),m=>this._direction==="vertical"?this._barMark.getAttribute("y1",m):this._barMark.getAttribute("y",m)+this._barMark.getAttribute("height",m),()=>this._direction)}const p=this._maxLabelMark,g=(a=this._spec.label)===null||a===void 0?void 0:a.maxLabel;if(p){this.setMarkStyle(p,{fill:(l=(o=g==null?void 0:g.style)===null||o===void 0?void 0:o.fill)!==null&&l!==void 0?l:this.getColorAttribute(),text:m=>{const v=this._spec.direction==="horizontal"?m[this._spec.xField[1]]:m[this._spec.yField[1]];return g!=null&&g.formatMethod?g.formatMethod(v,m):v}});const f=(h=g==null?void 0:g.position)!==null&&h!==void 0?h:"start",_=(d=g==null?void 0:g.offset)!==null&&d!==void 0?d:this._direction==="vertical"?-20:-25;WC(this,p,f,_,m=>this._barMark.getAttribute("x",m),m=>this._direction==="vertical"?this._barMark.getAttribute("x",m)+this._barMark.getAttribute("width",m):this._barMark.getAttribute("x1",m),m=>this._barMark.getAttribute("y",m),m=>this._direction==="vertical"?this._barMark.getAttribute("y1",m):this._barMark.getAttribute("y",m)+this._barMark.getAttribute("height",m),()=>this._direction)}}initLabelMarkStyle(t){t&&(this.setMarkStyle(t,{text:e=>{let i,n;return this._spec.direction==="horizontal"?(i=e[this._spec.xField[0]],n=e[this._spec.xField[1]]):(i=e[this._spec.yField[0]],n=e[this._spec.yField[1]]),i+"-"+n},z:this._fieldZ?this.dataToPositionZ.bind(this):null}),this._labelMark=t)}_dataToPosX(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[0]),{bandPosition:this._bandPosition})}_dataToPosX1(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}_dataToPosY(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[0]),{bandPosition:this._bandPosition})}_dataToPosY1(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}initAnimation(){var t,e,i,n,r;const a=to(this),o=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;this._barMark.setAnimationConfig(zt((i=F.getAnimationInKey("rangeColumn"))===null||i===void 0?void 0:i({direction:this.direction},o),Yt("bar",this._spec,this._markAttributeContext),a)),this._minLabelMark&&this._minLabelMark.setAnimationConfig(zt((n=F.getAnimationInKey("fadeInOut"))===null||n===void 0?void 0:n(),Yt("label",this._spec,this._markAttributeContext),a)),this._maxLabelMark&&this._maxLabelMark.setAnimationConfig(zt((r=F.getAnimationInKey("fadeInOut"))===null||r===void 0?void 0:r(),Yt("label",this._spec,this._markAttributeContext),a))}initTooltip(){this._tooltipHelper=new gtt(this),this._barMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._barMark),this._minLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._minLabelMark),this._maxLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._maxLabelMark),this._labelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._labelMark)}}Pn.type=z.rangeColumn,Pn.mark=JL,Pn.transformerConstructor=gD;const vtt=()=>{io(),Gs(),mtt(),$r(),F.registerSeries(Pn.type,Pn)};class k_ extends Pn{constructor(){super(...arguments),this.type=z.rangeColumn3d,this._barMarkType="rect3d",this._barName=z.bar3d}}k_.type=z.rangeColumn3d,k_.mark=QL;const ytt=()=>{QB(),F.registerSeries(k_.type,k_)};class btt extends ys{getDefaultTooltipPattern(t,e){if(t==="mark")return{visible:!0,activeType:t,title:{key:void 0,value:this.titleValueCallback,hasShape:!1},content:[{key:this.contentKeyCallback,value:this.contentValueCallback,hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1}]};if(t==="dimension"&&e){const i={key:void 0,value:this._getDimensionData,hasShape:!1},n=[];return e.forEach(({data:r})=>r.forEach(({series:a})=>{a.type==="rangeArea"&&n.push({seriesId:a.id,key:this.contentKeyCallback,value:o=>this.series.getSpec().direction==="horizontal"?o[this.series.getSpec().xField[0]]+"-"+o[this.series.getSpec().xField[1]]:o[this.series.getSpec().yField[0]]+"-"+o[this.series.getSpec().yField[1]],hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1})})),{visible:!0,activeType:t,title:i,content:n}}return null}}class zh extends Rr{constructor(){super(...arguments),this.type=z.rangeArea}initMark(){var t;this._areaMark=this._createMark(zh.mark.area,{defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:(t=this._spec.area)===null||t===void 0?void 0:t.customShape})}initMarkStyle(){var t,e,i,n,r;const a=(i=(e=(t=this.getSpec().area)===null||t===void 0?void 0:t.style)===null||e===void 0?void 0:e.curveType)!==null&&i!==void 0?i:(r=(n=this.getSpec().line)===null||n===void 0?void 0:n.style)===null||r===void 0?void 0:r.curveType,o=a===cA?this._direction==="vertical"?"monotoneX":"monotoneY":a,l=this._areaMark;l&&(this._direction==="vertical"?this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),y1:h=>{if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:d}=this._yAxisHelper;return d(this.getDatumPositionValues(h,this._spec.yField[1]),{bandPosition:this._bandPosition})},y:this.dataToPositionY.bind(this)},"normal",tt.Series):this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:h=>{if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:d}=this._xAxisHelper;return d(this.getDatumPositionValues(h,this._spec.xField[1]),{bandPosition:this._bandPosition})},y:this.dataToPositionY.bind(this),orient:this._direction},"normal",tt.Series),this.setMarkStyle(l,{fill:this.getColorAttribute(),stroke:!1},"normal",tt.Series),this._invalidType!=="zero"&&this.setMarkStyle(l,{defined:this._getInvalidDefined,connectedType:this._getInvalidConnectType()},"normal",tt.Series),this.setMarkStyle(l,{curveType:o},"normal",tt.Built_In),this._trigger.registerMark(l))}initTooltip(){this._tooltipHelper=new btt(this),this._areaMark&&this._tooltipHelper.activeTriggerSet.dimension.add(this._areaMark)}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t),this.encodeDefined(this._areaMark,"defined")}}zh.type=z.rangeArea,zh.mark=sB;const xtt=()=>{fA(),F.registerSeries(zh.type,zh)};class Uc extends Io{constructor(){super(...arguments),this.coordinate="polar",this._outerRadius=ju,this._innerRadius=0,this._angleField=[],this._radiusField=[],this._sortDataByAxis=!1,this._getInvalidDefined=t=>!(this.angleAxisHelper.isContinuous&&!rr(t[this._angleField[0]]))&&!(this.radiusAxisHelper.isContinuous&&!rr(t[this._radiusField[0]]))}get outerRadius(){return this._outerRadius}get innerRadius(){return this._innerRadius}getAngleField(){return this._angleField}setAngleField(t){return this._angleField=E(t)?Y(t):[],this._angleField}getRadiusField(){return this._radiusField}setRadiusField(t){return this._radiusField=E(t)?Y(t):[],this._radiusField}get innerRadiusField(){return this._innerRadiusField}setInnerRadiusField(t){return this._innerRadiusField=Y(t),this._innerRadiusField}get radiusScale(){return this._radiusScale}setRadiusScale(t){return this._radiusScale=t,t}get angleScale(){return this._angleScale}setAngleScale(t){return this._angleScale=t,t}get angleAxisHelper(){return this._angleAxisHelper}set angleAxisHelper(t){this._angleAxisHelper=t,this.onAngleAxisHelperUpdate()}get radiusAxisHelper(){return this._radiusAxisHelper}set radiusAxisHelper(t){this._radiusAxisHelper=t,this.onRadiusAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getCenter=()=>this.angleAxisHelper.center(),this._markAttributeContext.getLayoutRadius=()=>this._computeLayoutRadius()}valueToPosition(t,e){if(P(t)||P(e)||!this.angleAxisHelper||!this.radiusAxisHelper)return{x:Number.NaN,y:Number.NaN};const i=this.angleAxisHelper.dataToPosition(Y(t)),n=this.radiusAxisHelper.dataToPosition(Y(e));return this.angleAxisHelper.coordToPoint({angle:i,radius:n})}dataToPosition(t){return t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getDatumPositionValues(t,this._radiusField)):{x:Number.NaN,y:Number.NaN}}dataToPositionX(t){return this.dataToPosition(t).x}dataToPositionY(t){return this.dataToPosition(t).y}dataToPositionZ(t){return 0}positionToData(t){}radiusToData(t){}angleToData(t){}getStatisticFields(){var t,e;const i=[];return!((t=this.radiusAxisHelper)===null||t===void 0)&&t.getScale&&this._radiusField.forEach(n=>{const r={key:n,operations:[]};qt(this.radiusAxisHelper.getScale(0).type)?r.operations=["max","min"]:r.operations=["values"],i.push(r)}),!((e=this.angleAxisHelper)===null||e===void 0)&&e.getScale&&this._angleField.forEach(n=>{const r={key:n,operations:[]};qt(this.angleAxisHelper.getScale(0).type)?r.operations=["max","min"]:r.operations=["values"],i.push(r)}),i}setAttrFromSpec(){super.setAttrFromSpec(),E(this._spec.outerRadius)&&(this._outerRadius=this._spec.outerRadius),E(this._spec.radius)&&(this._outerRadius=this._spec.radius),E(this._spec.innerRadius)&&(this._innerRadius=this._spec.innerRadius),E(this._spec.sortDataByAxis)&&(this._sortDataByAxis=this._spec.sortDataByAxis===!0)}onRadiusAxisHelperUpdate(){this.onMarkPositionUpdate()}onAngleAxisHelperUpdate(){this.onMarkPositionUpdate()}afterInitMark(){super.afterInitMark(),this._trigger.setStateKeys([...this._angleField,...this._radiusField])}_computeLayoutRadius(){const{width:t,height:e}=this._region.getLayoutRect();return Math.min(t/2,e/2)}fillData(){super.fillData(),this.sortDataByAxis&&this._sortDataInAxisDomain()}_sortDataInAxisDomain(){var t,e;!((e=(t=this.getViewData())===null||t===void 0?void 0:t.latestData)===null||e===void 0)&&e.length&&GB(this.angleAxisHelper,this._angleField[0],this.getViewData().latestData)}}function Stt(s){return rr(s)?Number.parseFloat(s):0}const Att=(s,t)=>{const e=s.map(x=>Object.assign({},x));if(!e||e.length===0)return e;const{angleField:i,startAngle:n,endAngle:r,minAngle:a,asStartAngle:o,asEndAngle:l,asMiddleAngle:h,asRadian:d,asRatio:u,asQuadrant:c,asK:p}=t,g=(x,S,A)=>{x[o]=S,x[l]=S+A,x[h]=S+A/2,x[d]=A,x[c]=JU(S+A/2)};let f=0,_=-1/0;for(let x=0;x<e.length;x++){const S=Stt(e[x][i]);f+=S,_=Math.max(S,_),e[x][S0]=S}const m=r-n;let v=n,y=m,b=0;if(e.forEach(x=>{const S=x[S0],A=f?S/f:0;let k=A*m;k<a?(k=a,y-=a):b+=S;const w=v,T=v+k;x[u]=A,x[p]=_?S/_:0,g(x,w,k),v=T}),y<m)if(y<=.001){const x=m/e.length;e.forEach((S,A)=>{g(S,n+A*x,x)})}else{const x=y/b;v=n,e.forEach(S=>{const A=S[d]===a?a:S[S0]*x;g(S,v,A),v+=A})}return f!==0&&(e[e.length-1][l]=r),e};function rv(s,t,e){return(i,n,r)=>t?s.growField==="radius"?{overall:0}:{overall:s.growFrom(i,n,e)}:{overall:!1}}const UC=s=>({type:s.growField==="radius"?"growRadiusIn":"growAngleIn",options:rv(s,!0,ci.appear)}),ktt={type:"fadeIn"},fD=s=>({type:s.growField==="radius"?"growRadiusIn":"growAngleIn",easing:"linear",options:rv(s,!0,ci.enter)}),_D=s=>({type:s.growField==="radius"?"growRadiusOut":"growAngleOut",easing:"linear",options:rv(s,!0,ci.exit)}),mD=s=>({type:s.growField==="radius"?"growRadiusOut":"growAngleOut",options:rv(s,!0,ci.exit)});function vD(s,t){if(t===!1)return{};switch(t){case"fadeIn":return ktt;case"growRadius":return UC(Object.assign(Object.assign({},s),{growField:"radius"}));default:return UC(Object.assign(Object.assign({},s),{growField:"angle"}))}}const wtt=()=>{F.registerAnimation("pie",(s,t)=>({appear:vD(s,t),enter:fD(s),exit:_D(s),disappear:mD(s)}))},Ttt=()=>{F.registerAnimation("pie3d",(s,t)=>({appear:vD(s,t),enter:fD(s),exit:_D(s),disappear:mD(s)}))};function Mtt(s,t){var e,i,n,r;const a=(i=(e=t.options)===null||e===void 0?void 0:e.distance)!==null&&i!==void 0?i:10,o=N(t.duration)?t.duration/2:1e3,l=(n=t.options.easing)!==null&&n!==void 0?n:"cubicOut";return{oneByOne:t.oneByOne,loop:(r=t.loop)!==null&&r!==void 0&&r,timeSlices:[{duration:o,effects:{easing:l,channel:{x:{from:h=>s.getAttribute("x",h),to:h=>s.getAttribute("x",h)+fa({angle:h[Pr],radius:a}).x},y:{from:h=>s.getAttribute("y",h),to:h=>s.getAttribute("y",h)+fa({angle:h[Pr],radius:a}).y}}}},{duration:o,effects:{easing:l,channel:{x:{to:h=>s.getAttribute("x",h),from:h=>s.getAttribute("x",h)+fa({angle:h[Pr],radius:a}).x},y:{to:h=>s.getAttribute("y",h),from:h=>s.getAttribute("y",h)+fa({angle:h[Pr],radius:a}).y}}}}]}}class vA extends Hi{constructor(t,e){super(t,e),this.type=Hh.type,this._unCompileChannel={centerOffset:!0,radiusOffset:!0},this.computeOuterRadius=(i,n,r="normal",a,o)=>{var l;return o+((l=this.getAttribute("radiusOffset",n,r,a))!==null&&l!==void 0?l:0)},this.computeCenter=(i,n,r="normal",a,o)=>o+fa({angle:n[Pr],radius:this.getAttribute("centerOffset",n,r,a)})[i],this._computeExChannel.x=this.computeCenter,this._computeExChannel.y=this.computeCenter,this._computeExChannel.outerRadius=this.computeOuterRadius,this._extensionChannel.centerOffset=["x","y"],this._extensionChannel.radiusOffset=["outerRadius"]}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{startAngle:0,endAngle:0,outerRadius:0,innerRadius:0,cornerRadius:0,lineWidth:0})}}class Hh extends vA{constructor(){super(...arguments),this.type=Hh.type}}Hh.type="arc";const $c=()=>{oL(),dA(),F.registerMark(Hh.type,Hh)};class yA extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie")}_mergeThemeToSpec(t,e){const i=this._theme;let n=t;if(this._shouldMergeThemeToSpec()){const r=this._getDefaultSpecFromChart(e);n=yt({},this._theme,r,t),n.label.position==="inside"?n.label=yt({},this._theme.innerLabel,n.label):n.label=yt({},this._theme.outerLabel,n.label)}return{spec:n,theme:i}}}class Nh extends Uc{constructor(){super(...arguments),this.transformerConstructor=yA,this._pieMarkName="pie",this._pieMarkType="arc",this._startAngle=wm,this._endAngle=IS,this._pieMark=null,this._labelMark=null,this._labelLineMark=null,this.dataToCentralPosition=t=>{const e=t[Pr];if(P(e))return null;const i=this.computeDatumRadius(t),n=this.computeDatumInnerRadius(t),r=this.computeCenter(t),a=fa({angle:e,radius:(i+n)/2});return{x:r.x+a.x,y:r.y+a.y}}}get center(){var t,e,i,n;return{x:(e=(t=this._spec)===null||t===void 0?void 0:t.centerX)!==null&&e!==void 0?e:this._region.getLayoutRect().width/2,y:(n=(i=this._spec)===null||i===void 0?void 0:i.centerY)!==null&&n!==void 0?n:this._region.getLayoutRect().height/2}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>{var t,e;return(e=(t=this._center)===null||t===void 0?void 0:t.x)!==null&&e!==void 0?e:this._region.getLayoutRect().width/2},y:()=>{var t,e;return(e=(t=this._center)===null||t===void 0?void 0:t.y)!==null&&e!==void 0?e:this._region.getLayoutRect().height/2}}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._centerOffset=(t=this._spec.centerOffset)!==null&&t!==void 0?t:0,this._cornerRadius=(e=this._spec.cornerRadius)!==null&&e!==void 0?e:0;const i=QU(E(this._spec.startAngle)?ue(this._spec.startAngle):this._startAngle,E(this._spec.endAngle)?ue(this._spec.endAngle):this._endAngle);this._startAngle=i.startAngle,this._endAngle=i.endAngle,this._padAngle=E(this._spec.padAngle)?ue(this._spec.padAngle):0,this.setAngleField(this._spec.valueField||this._spec.angleField),this._spec.categoryField&&this.setSeriesField(this._spec.categoryField),this._radiusField=[],this._specAngleField=this._angleField.slice(),this._specRadiusField=[]}initData(){super.initData();const t=this.getViewData();if(!t)return;Ct(this._dataSet,"pie",Att),t.transform({type:"pie",options:{angleField:this._angleField[0],startAngle:this._startAngle,endAngle:this._endAngle,minAngle:E(this._spec.minAngle)?ue(this._spec.minAngle):0,asStartAngle:uT,asEndAngle:cT,asRatio:tI,asMiddleAngle:Pr,asRadian:h4,asQuadrant:l4,asK:o4}},!1);const e=new Jt(this._dataSet,{name:`${At}_series_${this.id}_viewDataLabel`});e.parse([this.getViewData()],{type:"dataview"}),this._viewDataLabel=new or(this._option,e)}initMark(){var t;this._pieMark=this._createMark(Object.assign(Object.assign({},Nh.mark.pie),{name:this._pieMarkName,type:this._pieMarkType}),{morph:Yr(this._spec,this._pieMarkName),defaultMorphElementKey:this._seriesField,key:ar,groupKey:this._seriesField,skipBeforeLayouted:!0,isSeriesMark:!0,customShape:(t=this._spec.pie)===null||t===void 0?void 0:t.customShape})}startAngleScale(t){return gg(uT)(t)}endAngleScale(t){return gg(cT)(t)}initMarkStyle(){const t=this._pieMark;t&&(this.setMarkStyle(t,{x:()=>{var e,i;return(i=(e=this._center)===null||e===void 0?void 0:e.x)!==null&&i!==void 0?i:this._region.getLayoutRect().width/2},y:()=>{var e,i;return(i=(e=this._center)===null||e===void 0?void 0:e.y)!==null&&i!==void 0?i:this._region.getLayoutRect().height/2},fill:this.getColorAttribute(),outerRadius:gC(this._outerRadius)?this._outerRadius:()=>this.computeLayoutRadius()*this._outerRadius,innerRadius:gC(this._innerRadius)?this._innerRadius:()=>this.computeLayoutRadius()*this._innerRadius,cornerRadius:()=>this.computeLayoutRadius()*this._cornerRadius,startAngle:e=>this.startAngleScale(e),endAngle:e=>this.endAngleScale(e),padAngle:this._padAngle,centerOffset:this._centerOffset},"normal",tt.Series),this._trigger.registerMark(t))}initTooltip(){super.initTooltip(),this._pieMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pieMark)}initMarkStyleWithSpec(t,e,i){if(super.initMarkStyleWithSpec(t,e,i),t.name===this._pieMarkName){const n=this.getSpec()[t.name];if(n)for(const r in n.state||{})this.setMarkStyle(t,this.generateRadiusStyle(n.state[r]),r,tt.User_Mark)}}initLabelMarkStyle(t){var e,i,n,r,a,o;t&&this.setMarkStyle(t,{visible:gg(a4).bind(this),text:l=>l[this.getDimensionField()[0]],fill:((i=(e=this._spec.label)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.fill)||this.getColorAttribute(),angle:(r=(n=this._spec.label)===null||n===void 0?void 0:n.style)===null||r===void 0?void 0:r.angle,limit:(o=(a=this._spec.label)===null||a===void 0?void 0:a.style)===null||o===void 0?void 0:o.limit,z:this.dataToPositionZ.bind(this)})}afterInitMark(){super.afterInitMark(),this._trigger.setStateKeys([this._seriesField,...this._radiusField])}initEvent(){var t;super.initEvent(),(t=this._viewDataLabel.getDataView())===null||t===void 0||t.target.addListener("change",this.viewDataLabelUpdate.bind(this))}initGroups(){}onLayoutEnd(t){this._viewDataLabel.getDataView().reRunAllTransform(),this.onMarkPositionUpdate(),super.onLayoutEnd(t)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return this._specAngleField}viewDataLabelUpdate(){this.event.emit(St.viewDataLabelUpdate,{model:this}),this._viewDataLabel.updateData()}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this.computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this.computeLayoutRadius()*t.innerRadius),t.cornerRadius&&(e.cornerRadius=()=>this.computeLayoutRadius()*t.cornerRadius),e}computeLayoutRadius(){const{width:t,height:e}=this._region.getLayoutRect();return Math.min(t/2,e/2)}computeCenter(t){return{x:this._pieMark.getAttribute("x",t,"normal"),y:this._pieMark.getAttribute("y",t,"normal")}}getRadius(t="normal"){var e,i,n,r,a,o,l;const h=t==="normal"?(n=(i=this.getSpec()[((e=this._pieMark)===null||e===void 0?void 0:e.name)||"pie"])===null||i===void 0?void 0:i.style)===null||n===void 0?void 0:n.outerRadius:(l=(o=(a=this.getSpec()[((r=this._pieMark)===null||r===void 0?void 0:r.name)||"pie"])===null||a===void 0?void 0:a.state)===null||o===void 0?void 0:o[t])===null||l===void 0?void 0:l.outerRadius;return h??this._outerRadius}getInnerRadius(t="normal"){var e,i,n,r,a,o,l;const h=t==="normal"?(n=(i=this.getSpec()[((e=this._pieMark)===null||e===void 0?void 0:e.name)||"pie"])===null||i===void 0?void 0:i.style)===null||n===void 0?void 0:n.innerRadius:(l=(o=(a=this.getSpec()[((r=this._pieMark)===null||r===void 0?void 0:r.name)||"pie"])===null||a===void 0?void 0:a.state)===null||o===void 0?void 0:o[t])===null||l===void 0?void 0:l.innerRadius;return h??this._innerRadius}computeRadius(t,e){return this.computeLayoutRadius()*t*(P(e)?1:e)+this._centerOffset}computeDatumRadius(t,e){return this.computeLayoutRadius()*this.getRadius(e)+this._centerOffset}_compareSpec(t,e,i){(i=i??{data:!0}).centerX=!0,i.centerX=!0,i.centerY=!0,i.centerOffset=!0,i.radius=!0,i.innerRadius=!0,i.cornerRadius=!0,i.startAngle=!0,i.endAngle=!0,i.padAngle=!0;const{centerX:n,centerY:r,centerOffset:a,radius:o,innerRadius:l,cornerRadius:h,startAngle:d,endAngle:u,padAngle:c}=e,p=super._compareSpec(t,e,i);return(t=t??{}).centerY===r&&t.centerX===n&&t.centerOffset===a&&t.radius===o&&t.innerRadius===l&&t.cornerRadius===h&&t.startAngle===d&&t.endAngle===u&&t.padAngle===c||(p.reRender=!0,p.change=!0),p}computeDatumInnerRadius(t,e){return this.computeLayoutRadius()*this.getInnerRadius(e)+this._centerOffset}dataToPosition(t){const e=t[Pr];if(P(e))return null;const i=this.computeDatumRadius(t),n=this.computeCenter(t),r=fa({angle:e,radius:i});return{x:n.x+r.x,y:n.y+r.y}}initAnimation(){var t,e;const i={growFrom:(r,a,o)=>{var l;if(o===ci.appear)return this._startAngle;if(o===ci.disappear)return this._endAngle;const h=[ci.disappear,ci.exit],d=a.mark.elements,u=r,c=u==null?void 0:u[Si];if(d.find(g=>{var f;return((f=g.data[0])===null||f===void 0?void 0:f[Si])<c})===void 0)return this._startAngle;if(d.find(g=>{var f;return((f=g.data[0])===null||f===void 0?void 0:f[Si])>c})===void 0)return this._endAngle;const p=[...d].reverse().find(g=>{var f;return((f=g.data[0])===null||f===void 0?void 0:f[Si])<c});return h.includes(o)?(l=p==null?void 0:p.getNextGraphicAttributes())===null||l===void 0?void 0:l.endAngle:p==null?void 0:p.getGraphicAttribute("endAngle",!0)}},n=(t=this._spec.animationAppear)===null||t===void 0?void 0:t.preset;if(this._pieMark){const r=zt((e=F.getAnimationInKey("pie"))===null||e===void 0?void 0:e(i,n),Yt("pie",this._spec,this._markAttributeContext));r.normal&&r.normal.type&&(r.normal=Mtt(this._pieMark,r.normal)),this._pieMark.setAnimationConfig(r)}}getDefaultShapeType(){return"circle"}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){return e}getActiveMarks(){return[this._pieMark]}}Nh.transformerConstructor=yA,Nh.mark=BL;class wx extends Nh{constructor(){super(...arguments),this.type=z.pie}}wx.type=z.pie;const Ctt=()=>{$c(),wtt(),F.registerSeries(wx.type,wx)};class lc extends vA{constructor(){super(...arguments),this.type=lc.type,this._support3d=!0}}lc.type="arc3d";const Ptt=()=>{dA(),YX(),F.registerMark(lc.type,lc)};class yD extends yA{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class ou extends Nh{constructor(){super(...arguments),this.type=z.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=yD}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=(e=(t=this._spec)===null||t===void 0?void 0:t.angle3d)!==null&&e!==void 0?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",tt.Series)}initLabelMarkStyle(t){if(!t)return;super.initLabelMarkStyle(t);const e={};t.setSupport3d(!0),e.beta=this._angle3d,e.anchor3d=i=>{var n,r,a,o;return[(r=(n=this._center)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:this._region.getLayoutRect().width/2,(o=(a=this._center)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:this._region.getLayoutRect().height/2]},e.angle=i=>{var n;const r=i[Pr];return((n=this._spec.label)===null||n===void 0?void 0:n.position)==="inside"?xh(r):0},this.setMarkStyle(t,Object.assign(Object.assign({},e),{z:100}),void 0,tt.Mark)}}ou.type=z.pie3d,ou.mark=DL,ou.transformerConstructor=yD;const Ett=()=>{Ttt(),Ptt(),F.registerSeries(ou.type,ou)},$C=s=>{const t=s.growField==="angle"?0:s.innerRadius;return s.growField==="angle"?{type:s.growField==="angle"?"growAngleIn":"growRadiusIn"}:{channel:{innerRadius:{from:t,to:(e,i)=>i.getGraphicAttribute("innerRadius")},outerRadius:{from:t,to:(e,i)=>i.getGraphicAttribute("outerRadius")}}}},Rtt={type:"fadeIn"},Ott=s=>({type:s.growField==="angle"?"growAngleIn":"growRadiusIn"}),Itt=s=>({type:s.growField==="angle"?"growAngleOut":"growRadiusOut"}),Ltt=s=>({type:s.growField==="angle"?"growAngleOut":"growRadiusOut"});function Btt(s,t){if(t===!1)return{};switch(t){case"fadeIn":return Rtt;case"growAngle":return $C(Object.assign(Object.assign({},s),{growField:"angle"}));default:return $C(Object.assign(Object.assign({},s),{growField:"radius"}))}}const Dtt=()=>{F.registerAnimation("rose",(s,t)=>({appear:Btt(s,t),enter:Ott(s),exit:Itt(s),disappear:Ltt(s)}))};class bD extends Uc{getStackGroupFields(){return this._angleField}getStackValueField(){return Y(this._spec.valueField)[0]||Y(this._spec.radiusField)[0]}getGroupFields(){return this._angleField}setAttrFromSpec(){super.setAttrFromSpec(),this.setAngleField(this._spec.categoryField||this._spec.angleField),this.setRadiusField(this._spec.valueField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice(),this.setInnerRadiusField(this._spec.valueField||this._spec.radiusField),this._stack&&this.setValueFieldToStack(),this._percent&&this.setValueFieldToPercent()}setValueFieldToStack(){this.setRadiusField(ui),this.setInnerRadiusField(ln)}setValueFieldToPercent(){this.setRadiusField($a),this.setInnerRadiusField($u)}getDimensionField(){return this._specAngleField}getMeasureField(){return this._specRadiusField}getDefaultShapeType(){return"square"}}class xD extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"rose")}}class Oa extends bD{constructor(){super(...arguments),this.type=z.rose,this.transformerConstructor=xD,this._supportStack=!0,this._roseMark=null,this._labelMark=null}initMark(){this.initRoseMark()}initMarkStyle(){this.initRoseMarkStyle()}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}initRoseMark(){var t;this._roseMark=this._createMark(Oa.mark.rose,{morph:Yr(this._spec,Oa.mark.rose.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:(t=this._spec.rose)===null||t===void 0?void 0:t.customShape})}getRoseAngle(){var t,e,i;return(i=(e=(t=this.angleAxisHelper).getBandwidth)===null||e===void 0?void 0:e.call(t,this._groups?this._groups.fields.length-1:0))!==null&&i!==void 0?i:.5}startAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}endAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+this.getRoseAngle()-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}initRoseMarkStyle(){const t=this._roseMark;t&&(this.setMarkStyle(t,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:e=>this.startAngleScale(e),endAngle:e=>this.endAngleScale(e),fill:this.getColorAttribute(),outerRadius:e=>ee(this.radiusAxisHelper.dataToPosition([e[this._radiusField[0]]]),this.radiusAxisHelper.getScale(0)),innerRadius:e=>{var i;if(!this._stack)return 0;const n=ee(this.radiusAxisHelper.dataToPosition([e[this._innerRadiusField[0]]]),this.radiusAxisHelper.getScale(0));return n<=Number.MIN_VALUE?this._computeLayoutRadius()*((i=this._spec.innerRadius)!==null&&i!==void 0?i:0):n}}),this._trigger.registerMark(t))}initTooltip(){super.initTooltip(),this._roseMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._roseMark)}initLabelMarkStyle(t){var e,i,n,r,a,o,l,h;t&&this.setMarkStyle(t,{visible:(i=(e=this._spec)===null||e===void 0?void 0:e.label)===null||i===void 0?void 0:i.visible,text:d=>d[this.getDimensionField()[0]],fill:((r=(n=this._spec.label)===null||n===void 0?void 0:n.style)===null||r===void 0?void 0:r.fill)||this.getColorAttribute(),angle:(o=(a=this._spec.label)===null||a===void 0?void 0:a.style)===null||o===void 0?void 0:o.angle,limit:(h=(l=this._spec.label)===null||l===void 0?void 0:l.style)===null||h===void 0?void 0:h.limit,z:0})}initAnimation(){var t,e,i;const n=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;if(this._roseMark){const r={innerRadius:()=>{var a;return this._computeLayoutRadius()*((a=this._spec.innerRadius)!==null&&a!==void 0?a:0)}};this._roseMark.setAnimationConfig(zt((i=F.getAnimationInKey("rose"))===null||i===void 0?void 0:i(r,n),Yt("rose",this._spec,this._markAttributeContext)))}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._roseMark]}}Oa.type=z.rose,Oa.mark=FL,Oa.transformerConstructor=xD;const Ftt=()=>{F.registerSeries(Oa.type,Oa),$c(),Dtt()};class jtt extends ms{constructor(t,e,i,n,r){super(t,e,i,n,r);const a=this.params.pointToCoord,o=this.params.coordToPoint;K(a)&&K(o)||(this.valid=!1),this._pointToCoord=a,this._coordToPoint=o}getEndProps(){return this.valid===!1?{}:this._coordToPoint({angle:this._toAngle,radius:this._toRadius})}onBind(){const{angle:t,radius:e}=this._pointToCoord(this.from);N(t*e)||(this.valid=!1),this._fromAngle=t,this._fromRadius=e;const{angle:i,radius:n}=this._pointToCoord(this.to);N(i*n)||(this.valid=!1),this._toAngle=i,this._toRadius=n}onUpdate(t,e,i){if(this.valid!==!1)if(t){const{x:n,y:r}=this.getEndProps();i.x=n,i.y=r}else{const{x:n,y:r}=this._coordToPoint({angle:this._fromAngle+(this._toAngle-this._fromAngle)*e,radius:this._fromRadius+(this._toRadius-this._fromRadius)*e});i.x=n,i.y=r}}}class ztt extends VR{constructor(t,e,i,n,r){super(t,e,i,n,r);const a=this.params.pointToCoord,o=this.params.coordToPoint;this._pointToCoord=a,this._coordToPoint=o}onUpdate(t,e,i){this.points=this.points.map((n,r)=>{const a=this.polarPointInterpolation(this.interpolatePoints[r][0],this.interpolatePoints[r][1],e);return a.context=n.context,a}),i.points=this.points}polarPointInterpolation(t,e,i){const n=this._pointToCoord(t),r=this._pointToCoord({x:t.x1,y:t.y1}),a=this._pointToCoord(e),o=this._pointToCoord({x:e.x1,y:e.y1}),l=n.angle+(a.angle-n.angle)*i,h=n.radius+(a.radius-n.radius)*i,d=r.angle+(o.angle-r.angle)*i,u=r.radius+(o.radius-r.radius)*i,{x:c,y:p}=this._coordToPoint({angle:l,radius:h}),{x:g,y:f}=this._coordToPoint({angle:d,radius:u}),_=new We(c,p,g,f);return _.defined=e.defined,_}}const SD=s=>({type:s==="in"?"fadeIn":"fadeOut"}),Htt=(s,t)=>({type:t==="in"?"growPointsIn":"growPointsOut",options:()=>({center:s.center()})});function Yp(s,t,e){return t==="fadeIn"?SD(e):Htt(s,e)}const Ntt=(s,t)=>{const e=()=>{var a;return(a=s.center())===null||a===void 0?void 0:a.x},i=(a,o)=>o.getGraphicAttribute("x"),n=()=>{var a;return(a=s.center())===null||a===void 0?void 0:a.y},r=(a,o)=>o.getGraphicAttribute("y");return t==="in"?{channel:{x:{from:e,to:i},y:{from:n,to:r}}}:{channel:{x:{from:i,to:e},y:{from:r,to:n}}}};function YC(s,t,e){return t==="fadeIn"?SD(e):Ntt(s,e)}const XC=(s,t)=>({custom:GH,customParameters:(e,i)=>{var n;return{group:i.getGraphicItem(),startAngle:(n=s.startAngle)!==null&&n!==void 0?n:Math.PI/2,orient:"clockwise",center:s.center(),radius:s.radius(),animationType:t}}}),Gtt=()=>{F.registerAnimation("radar",(s,t)=>({appear:t==="clipIn"?void 0:Yp(s,t,"in"),enter:Yp(s,t,"in"),exit:Yp(s,t,"out"),disappear:t==="clipIn"?void 0:Yp(s,t,"out"),update:[{options:{excludeChannels:["points","defined"]}},{channel:["points"],custom:ztt,customParameters:s,duration:ba.update.duration,easing:ba.update.easing}]})),F.registerAnimation("radarSymbol",(s,t)=>({appear:t==="clipIn"?void 0:YC(s,t,"in"),enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:t==="clipIn"?void 0:YC(s,t,"out"),update:[{options:{excludeChannels:["x","y"]}},{channel:["x","y"],custom:jtt,customParameters:s,duration:ba.update.duration,easing:ba.update.easing}]})),F.registerAnimation("radarGroup",(s,t)=>({appear:XC(s,"in"),disappear:XC(s,"out")}))};class Aa extends bD{constructor(){super(...arguments),this.type=z.radar,this.transformerConstructor=Nc,this._sortDataByAxis=!1}initGroups(){}compile(){super.compile(),this.addOverlapCompile()}initMark(){var t,e,i,n;const r={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},a=((t=this._spec.area)===null||t===void 0?void 0:t.visible)!==!1&&((i=(e=this._spec.area)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.visible)!==!1,o=(n=this._spec.seriesMark)!==null&&n!==void 0?n:"area";this.initAreaMark(r,a&&o==="area"),this.initLineMark(r,o==="line"||o==="area"&&!a),this.initSymbolMark(r,o==="point")}initMarkStyle(){this.initAreaMarkStyle(),this.initLineMarkStyle(),this.initSymbolMarkStyle()}initAreaMark(t,e){var i;this._areaMark=this._createMark(Aa.mark.area,{progressive:t,isSeriesMark:e,customShape:(i=this._spec.area)===null||i===void 0?void 0:i.customShape})}initAreaMarkStyle(){const t=this._areaMark;t&&(this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),x1:e=>e&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(e,this._angleField),this._stack?this.getDatumPositionValues(e,this._innerRadiusField):this.radiusScale.domain()[0]).x:Number.NaN,y1:e=>!e||!this.angleAxisHelper||!this.radiusAxisHelper?Number.NaN:this.valueToPosition(this.getDatumPositionValues(e,this._angleField),this._stack?this.getDatumPositionValues(e,this._innerRadiusField):this.radiusScale.domain()[0]).y,fill:this.getColorAttribute(),curveType:WB,closePath:!0},"normal",tt.Series),this._invalidType!=="zero"&&this.setMarkStyle(t,{defined:this._getInvalidDefined,connectedType:this._getInvalidConnectType()},"normal",tt.Series),this.event.on(St.viewDataStatisticsUpdate,{filter:e=>e.model===this},()=>{this.encodeDefined(t,"defined")}),this._trigger.registerMark(t))}initTooltip(){super.initTooltip(),this._lineMark&&this._tooltipHelper.activeTriggerSet.dimension.add(this._lineMark),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark),this._areaMark&&this._tooltipHelper.activeTriggerSet.dimension.add(this._areaMark)}initAnimation(){var t,e,i,n;const r={center:()=>{var o;return(o=this.angleAxisHelper)===null||o===void 0?void 0:o.center()},radius:()=>{const o=this.getLayoutRect();return Math.min(o.width,o.height)},startAngle:E(this._spec.startAngle)?ue(this._spec.startAngle):wm,pointToCoord:o=>{var l;return(l=this.angleAxisHelper)===null||l===void 0?void 0:l.pointToCoord(o)},coordToPoint:o=>this.angleAxisHelper.coordToPoint(o)},a=(i=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset)!==null&&i!==void 0?i:"clipIn";a==="clipIn"&&this._rootMark&&this._rootMark.setAnimationConfig(zt((n=F.getAnimationInKey("radarGroup"))===null||n===void 0?void 0:n(r,a),Yt("group",this._spec,this._markAttributeContext))),[[this._areaMark,"radar"],[this._lineMark,"radar"],[this._symbolMark,"radarSymbol"]].forEach(([o,l])=>{if(E(o)){const h=F.getAnimationInKey(l);o.setAnimationConfig(zt(h==null?void 0:h(r,a),Yt(o.name,this._spec,this._markAttributeContext)))}})}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}getSeriesStyle(t){return e=>{var i,n,r,a;let o=(n=(i=this._seriesMark)===null||i===void 0?void 0:i.getAttribute(e,t))!==null&&n!==void 0?n:void 0;return e!=="fill"||o||(e="stroke",o=(a=(r=this._seriesMark)===null||r===void 0?void 0:r.getAttribute(e,t))!==null&&a!==void 0?a:void 0),e==="stroke"&&$(o)?o[0]:o}}}Aa.type=z.radar,Aa.mark=LL,Aa.transformerConstructor=Nc,Ai(Aa,pA);const Wtt=()=>{ZS(),fA(),gA(),eo(),Gtt(),F.registerSeries(Aa.type,Aa)};class Vtt extends ys{updateTooltipSpec(){var t;super.updateTooltipSpec(),E((t=this.spec)===null||t===void 0?void 0:t.mark)&&(this.spec.mark.updateContent=(e,i,n)=>{const r=[],a=e.filter(o=>o.key==="children");return a.length>0&&a[0].value.forEach(o=>{let l=!0;for(const h in o)r.push({shapeType:"circle",hasShape:l,shapeColor:this.contentShapeColorCallback(i[0].datum[0]),shapeStroke:this.contentShapeColorCallback(i[0].datum[0]),key:h,value:o[h]+""}),l=!1}),e.concat(r)})}getDefaultTooltipPattern(t){return t==="mark"?{visible:!0,activeType:t,title:{key:"event info",value:"event info"},content:[{hasShape:!0,shapeType:"square",shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,key:e=>e.type,value:e=>e.id},{hasShape:!0,shapeType:"square",shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,key:"event_time",value:e=>ua.getInstance().timeFormat("%Y%m%d",e.event_time)},{hasShape:!0,shapeType:"square",shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,key:"action_type",value:e=>e.action_type},{shapeType:"square",hasShape:!0,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,key:"children",value:e=>e.children}],updateContent:(e,i,n)=>{const r=[];return e[3].value.forEach(a=>{let o=!0;for(const l in a)r.push({shapeType:"circle",hasShape:o,shapeColor:this.contentShapeColorCallback(i[0].datum[0]),shapeStroke:this.contentShapeColorCallback(i[0].datum[0]),key:l,value:a[l]+""}),o=!1}),e.concat(r)}}:null}}const Utt=(s,t)=>{var e;const i=!((e=s[0])===null||e===void 0)&&e.latestData?s[0].latestData:s||[],n=[];return i.forEach(r=>{const a={};for(const l in r)l!==t&&(a[l]=r[l]);const o=r[t];o==null||o.forEach(l=>{n.push(Object.assign({},a,l))})}),n},$tt={fill:"#bbb",fillOpacity:.2};class Bs extends pn{constructor(){super(...arguments),this.type=z.dot}getSeriesGroupField(){return this._seriesField}setSeriesGroupField(t){E(t)&&(this._seriesGroupField=t)}getTitleField(){return this._titleField}setTitleField(t){E(t)&&(this._titleField=t)}getSubTitleField(){return this._subTitleField}setSubTitleField(t){E(t)&&(this._subTitleField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){E(t)&&(this._dotTypeField=t)}getHighLightSeriesGroup(){return this._highLightSeriesGroup}setHighLightSeriesGroup(t){E(t)&&(this._highLightSeriesGroup=t)}setGridBackground(t){E(t)&&(this._gridBackground=t)}initData(){var t;super.initData(),this._xDimensionStatisticsDomain=this.getRawData().latestData.map(e=>e[this._fieldY[0]]),Ct(this._option.dataSet,"objFlat",Utt),Ct(this._option.dataSet,"copyDataView",Km),Lr(this._option.dataSet,"dataview",rm),(t=this.getViewData())===null||t===void 0||t.transform({type:"objFlat",options:"dots",level:Hs.dotObjFlat},!1)}setSeriesField(t){E(t)&&(this._seriesField=t,this.getMarksInType(["line","area"]).forEach(e=>{e.setFacet(this._seriesField)}))}getStatisticFields(){return[{key:this._fieldY[0],operations:["values"],customize:this._xDimensionStatisticsDomain}]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setSeriesGroupField(this._spec.seriesGroupField),this.setTitleField(this._spec.titleField),this.setSubTitleField(this._spec.subTitleField),this.setDotTypeField(this._spec.dotTypeField),this.setHighLightSeriesGroup(this._spec.highLightSeriesGroup),this.setGridBackground(yt($tt,((t=this._spec.grid)===null||t===void 0?void 0:t.background)||{}))}initMark(){this._clipMark=this._createMark(Bs.mark.group),this._containerMark=this._createMark(Bs.mark.group,{parent:this._clipMark,dataView:this.getRawData()}),this._gridBackgroundMark=this._createMark(Bs.mark.gridBackground,{parent:this._containerMark,dataView:this.getRawData()}),this._gridMark=this._createMark(Bs.mark.grid,{parent:this._containerMark,dataView:this.getRawData()}),this._dotMark=this._createMark(Bs.mark.dot,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark}),this._titleMark=this._createMark(Bs.mark.title,{parent:this._containerMark,dataView:this.getRawData()}),this._subTitleMark=this._createMark(Bs.mark.subTitle,{parent:this._containerMark,dataView:this.getRawData()}),this._symbolMark=this._createMark(Bs.mark.symbol,{parent:this._containerMark,dataView:this.getRawData()})}initMarkStyle(){const t=this._clipMark;t&&(this.setMarkStyle(t,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight,clip:!0},"normal",tt.Series),t.setInteractive(!1));const e=this._containerMark;e&&(this.setMarkStyle(e,{x:this._spec.leftAppendPadding},"normal",tt.Series),e.setInteractive(!1));const i=this._gridBackgroundMark;i&&(this.setMarkStyle(i,{x:this.getRegionRectLeft.bind(this),x1:this.getRegionRectRight.bind(this),y:this.dataToGridBackgroundPositionY.bind(this),y1:this.dataToGridBackgroundPositionY1.bind(this),fill:this._gridBackground.fill,fillOpacity:this.dataToGridBackgroundOpacity.bind(this)},"normal",tt.Series),this._trigger.registerMark(i));const n=this._gridMark;n&&(this.setMarkStyle(n,{stroke:this.getColorAttribute(),x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),x1:this.getRegionRectRight.bind(this),y1:this.dataToPositionY.bind(this)},"normal",tt.Series),this._trigger.registerMark(n));const r=this._dotMark;r&&(this.setMarkStyle(r,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),fill:this.getDotColorAttribute(),fillOpacity:this.dataToOpacity.bind(this)},"normal",tt.Series),this._trigger.registerMark(r));const a=this._titleMark;a&&(this.setMarkStyle(a,{fill:this.getColorAttribute(),text:h=>h[this.getTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",tt.Series),this._trigger.registerMark(a));const o=this._subTitleMark;o&&(this.setMarkStyle(o,{fill:this.getColorAttribute(),text:h=>h[this.getSubTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",tt.Series),this._trigger.registerMark(o));const l=this._symbolMark;l&&(this.setMarkStyle(l,{x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),fill:this.getColorAttribute()},"normal",tt.Series),this._trigger.registerMark(l))}dataToGridBackgroundPositionY(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})-i(0)/2}dataToGridBackgroundPositionY1(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})+i(0)/2}dataToOpacity(t){var e,i,n,r;if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:a,getScale:o}=this._xAxisHelper;return a(this.getDatumPositionValues(t,this._fieldX),{bandPosition:this._bandPosition})<o(0).range()[0]||a(this.getDatumPositionValues(t,this._fieldX),{bandPosition:this._bandPosition})>o(0).range()[1]?0:(r=(n=(i=(e=this._theme)===null||e===void 0?void 0:e.dot)===null||i===void 0?void 0:i.style)===null||n===void 0?void 0:n.fillOpacity)!==null&&r!==void 0?r:1}dataToGridBackgroundOpacity(t){return t[this._seriesGroupField]===this._highLightSeriesGroup?this._gridBackground.fillOpacity:0}onLayoutEnd(t){var e,i;super.onLayoutEnd(t);const n=(i=(e=this._spec)===null||e===void 0?void 0:e.leftAppendPadding)!==null&&i!==void 0?i:0;this.setMarkStyle(this._clipMark,{width:this.getLayoutRect().width+n},"normal",tt.Series)}getDefaultColorDomain(){var t,e;return this._seriesGroupField?(t=this.getViewDataStatistics())===null||t===void 0?void 0:t.latestData[this._seriesGroupField].values:this._seriesField?(e=this.getViewDataStatistics())===null||e===void 0?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:(t=this._option.globalScale.getScale("color"))!==null&&t!==void 0?t:this._getDefaultColorScale(),field:(i=(e=this._seriesGroupField)!==null&&e!==void 0?e:this._seriesField)!==null&&i!==void 0?i:Fs}}getDotColorScale(){var t,e,i;const n=this._dotTypeField?(t=this.getViewDataStatistics())===null||t===void 0?void 0:t.latestData[this._dotTypeField].values:this._seriesGroupField?(e=this.getViewDataStatistics())===null||e===void 0?void 0:e.latestData[this._seriesGroupField].values:this._seriesField?(i=this.getViewDataStatistics())===null||i===void 0?void 0:i.latestData[this._seriesField].values:[],r=this._getDataScheme();return new jc().domain(n).range(r)}getDotColorAttribute(){var t,e,i,n;return{scale:(t=this._option.globalScale.getScale("color"))!==null&&t!==void 0?t:this.getDotColorScale(),field:(n=(i=(e=this._dotTypeField)!==null&&e!==void 0?e:this._seriesGroupField)!==null&&i!==void 0?i:this._seriesField)!==null&&n!==void 0?n:Fs}}initTooltip(){this._tooltipHelper=new Vtt(this),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark)}onEvaluateEnd(t){super.onEvaluateEnd(t)}onMarkTreePositionUpdate(t){t.forEach(e=>{e.type==="group"?this.onMarkTreePositionUpdate(e.getMarks()):e.updateLayoutState()})}getDotData(){var t;return(t=this._dotMark)===null||t===void 0?void 0:t.getData()}_getDataIdKey(){}getStackValueField(){return null}getActiveMarks(){return[this._dotMark]}}Bs.type=z.dot,Bs.mark=NL;const Ytt=()=>{eo(),Vc(),io(),Gs(),F.registerSeries(Bs.type,Bs)};class Xtt extends ys{getDefaultTooltipPattern(t){return t==="mark"?{visible:!0,activeType:t,title:{key:"link info",value:"link info"},content:[{hasShape:!0,shapeType:"square",shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,key:"time",value:e=>ua.getInstance().timeFormat("%Y%m%d %H:%M",e.from.split("_")[1])},{hasShape:!0,shapeType:"square",shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,key:"type",value:e=>e.action_type},{hasShape:!0,shapeType:"square",shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,key:"from",value:e=>e.from},{hasShape:!0,shapeType:"square",shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,key:"to",value:e=>e.to}]}:null}}const Ktt=(s,t)=>{const{infoKey:e,fields:i,linkData:n,dotData:r}=t,{fromField:a,toField:o,xField:l,yField:h}=i(),d=n(),u=r(),c={};return u.forEach(p=>{const g={};for(const _ in p)_!==e&&(g[_]=p[_]);const f=p[e];f==null||f.forEach(_=>{c[_.node_name]=Object.assign({},g,_)})}),d.forEach(p=>{var g,f,_,m;p[a+"_xField"]=(g=c==null?void 0:c[p[a]])===null||g===void 0?void 0:g[l],p[a+"_yField"]=(f=c==null?void 0:c[p[a]])===null||f===void 0?void 0:f[h],p[o+"_xField"]=(_=c==null?void 0:c[p[o]])===null||_===void 0?void 0:_[l],p[o+"_yField"]=(m=c==null?void 0:c[p[o]])===null||m===void 0?void 0:m[h]}),d};class Or extends pn{constructor(){super(...arguments),this.type=z.link}getFromField(){return this._fromField}setFromField(t){E(t)&&(this._fromField=t)}getToField(){return this._toField}setToField(t){E(t)&&(this._toField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){E(t)&&(this._dotTypeField=t)}getDotSeriesSpec(){return this._dotSeriesSpec}setDotSeriesSpec(t){E(t)&&(this._dotSeriesSpec=t)}_getDotData(){const t=this._option.getChart().getSeriesInIndex([this._spec.dotSeriesIndex])[0];return t?t.getRawData().latestData:[]}initData(){var t;super.initData(),Ct(this._option.dataSet,"linkDotInfo",Ktt),(t=this.getViewData())===null||t===void 0||t.transform({type:"linkDotInfo",options:{infoKey:"dots",fields:()=>({fromField:this._fromField,toField:this._toField,xField:this._dotSeriesSpec.xField,yField:this._dotSeriesSpec.yField}),linkData:()=>this._rawData.latestData,dotData:()=>this._getDotData()},level:Hs.linkDotInfo},!1)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFromField(this._spec.fromField),this.setToField(this._spec.toField),this.setDotTypeField(this._spec.dotTypeField),this.setDotSeriesSpec(this._spec.dotSeriesSpec)}initMark(){this._clipMark=this._createMark(Or.mark.group),this._containerMark=this._createMark(Or.mark.group,{parent:this._clipMark}),this._linkMark=this._createMark(Or.mark.link,{skipBeforeLayouted:!1,parent:this._containerMark}),this._arrowMark=this._createMark(Or.mark.arrow,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark})}initMarkStyle(){var t,e,i,n;const r=this._clipMark;r&&(this.setMarkStyle(r,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight,clip:!0},"normal",tt.Series),r.setInteractive(!1));const a=this._containerMark;a&&(this.setMarkStyle(a,{x:this._spec.leftAppendPadding,width:this.getLayoutRect().width},"normal",tt.Series),a.setInteractive(!1));const o=this._linkMark;o&&(this.setMarkStyle(o,{stroke:this.getColorAttribute(),strokeOpacity:this.dataToOpacity.bind(this),x:this.dataToPositionXFrom.bind(this),y:this.dataToPositionYFrom.bind(this),x1:this.dataToPositionXTo.bind(this),y1:this.dataToPositionYTo.bind(this)},"normal",tt.Series),this._trigger.registerMark(o));const l=this._arrowMark;if(l){const h=(n=(i=(e=(t=this._theme)===null||t===void 0?void 0:t.arrow)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.size)!==null&&n!==void 0?n:10;this.setMarkStyle(l,{x:this.dataToPositionXTo.bind(this),y:d=>this.dataToPositionArrowYTo(d,h),fill:this.getColorAttribute(),fillOpacity:this.dataToOpacity.bind(this),size:h,symbolType:d=>this.isPositionYFromHigher(d)?"triangleDown":"triangleUp"},"normal",tt.Series),this._trigger.registerMark(l)}}afterInitMark(){super.afterInitMark(),this._trigger.setStateKeys([this._seriesField,this._fromField])}dataToPositionXFrom(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYFrom(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_yField"))}dataToPositionXTo(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYTo(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})}dataToPositionArrowYTo(t,e){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:i}=this._yAxisHelper,n=this.isPositionYFromHigher(t)?-e/2:e/2;return i(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})+n}dataToOpacity(t){return this.isPositionXOuterRange(t,this._fromField+"_xField")||this.isPositionXOuterRange(t,this._toField+"_xField")||t[this._fromField]===t[this._toField]?0:1}isPositionYFromHigher(t){return this.dataToPositionYFrom(t)<this.dataToPositionYTo(t)}isPositionXOuterRange(t,e){if(!this._xAxisHelper)return!1;const{dataToPosition:i,getScale:n}=this._xAxisHelper;return i(this.getDatumPositionValues(t,e),{bandPosition:this._bandPosition})<n(0).range()[0]||i(this.getDatumPositionValues(t,e),{bandPosition:this._bandPosition})>n(0).range()[1]}getDefaultColorDomain(){var t,e;return this._dotTypeField?(t=this.getViewDataStatistics())===null||t===void 0?void 0:t.latestData[this._dotTypeField].values:this._seriesField?(e=this.getViewDataStatistics())===null||e===void 0?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:(t=this._option.globalScale.getScale("color"))!==null&&t!==void 0?t:this._getDefaultColorScale(),field:(i=(e=this._dotTypeField)!==null&&e!==void 0?e:this._seriesField)!==null&&i!==void 0?i:Fs}}initTooltip(){this._tooltipHelper=new Xtt(this),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}onMarkTreePositionUpdate(t){t.forEach(e=>{e.type==="group"?this.onMarkTreePositionUpdate(e.getMarks()):e.updateLayoutState()})}getDotInfoData(){var t,e;return(e=(t=this._linkMark)!==null&&t!==void 0?t:this._arrowMark)===null||e===void 0?void 0:e.getData()}getActiveMarks(){return[this._linkMark,this._arrowMark]}}Or.type=z.link,Or.mark=HL;const qtt=()=>{Vc(),eo(),F.registerSeries(Or.type,Or)};class id extends Uc{constructor(){super(...arguments),this._supportStack=!0,this._arcGroupMark=null,this._getAngleValueStart=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if(i!=null&&i.forceAlign&&this._isTickMaskVisible(e)){const n=t[this._stack?ln:bg],r=this._getAngleAxisSubTickData(e),a=r[1].value-r[0].value,o=ue(i.offsetAngle);let l;if(E(n)){const h=rT(r,u=>u.value-n),d=n>r[h].value-a/2?Math.min(h,r.length-1):h>0?h-1:void 0;d!==void 0&&(l=this.angleAxisHelper.dataToPosition([r[d].value-a/2]))}return P(l)&&(l=this.angleAxisHelper.dataToPosition([r[0].value-a/2])),l+o}return this._getAngleValueStartWithoutMask(t)},this._getAngleValueEnd=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if(i!=null&&i.forceAlign&&this._isTickMaskVisible(e)){const n=t[this._stack?ui:this._angleField[0]],r=this._getAngleAxisSubTickData(e),a=r[1].value-r[0].value,o=ue(i.offsetAngle),l=rT(r,u=>u.value-n),h=n>r[l].value-a/2?Math.min(l,r.length-1):l>0?l-1:void 0;let d;return d=h!==void 0?this.angleAxisHelper.dataToPosition([r[h].value+a/2]):this.angleAxisHelper.dataToPosition([r[0].value-a/2]),d+o}return this._getAngleValueEndWithoutMask(t)}}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec();const n=(t=this._option.globalInstance.getChart())===null||t===void 0?void 0:t.getSpec(),r=(e=this._spec.startAngle)!==null&&e!==void 0?e:n==null?void 0:n.startAngle;this._startAngle=E(r)?ue(r):wm;const a=(i=this._spec.endAngle)!==null&&i!==void 0?i:n==null?void 0:n.endAngle;this._endAngle=E(a)?ue(a):IS,this.setAngleField(this._spec.valueField||this._spec.angleField),this.setRadiusField(this._spec.categoryField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice()}getStackGroupFields(){return this._radiusField}getStackValueField(){var t;return(t=this._angleField)===null||t===void 0?void 0:t[0]}getGroupFields(){return this._angleField}_convertMarkStyle(t){const e=super._convertMarkStyle(t);if(e.fill){const i=t.fill;(i==null?void 0:i.gradient)!=="conical"||E(i==null?void 0:i.startAngle)||E(i==null?void 0:i.endAngle)||(e.fill=Object.assign(Object.assign({},i),{startAngle:this._startAngle,endAngle:this._endAngle}))}return e}_getAngleValueStartWithoutMask(t){if(this._stack){const e=ee(this.angleAxisHelper.dataToPosition([t[ln]]),this.angleAxisHelper.getScale(0));if(N(e))return e}return this._startAngle}_getAngleValueEndWithoutMask(t){if(this._stack){const e=ee(this.angleAxisHelper.dataToPosition([t[ui]]),this.angleAxisHelper.getScale(0));if(N(e))return e}return this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])}getDimensionField(){return this._specRadiusField}getMeasureField(){return this._specAngleField}initMark(){this._initArcGroupMark()}initMarkStyle(){this._initArcGroupMarkStyle()}_initArcGroupMark(){return this._arcGroupMark=this._createMark(id.mark.group,{skipBeforeLayouted:!1}),this._arcGroupMark}_initArcGroupMarkStyle(){const t=this._arcGroupMark;t.setZIndex(this.layoutZIndex),t.created(),this.setMarkStyle(t,{clip:!0,x:0,y:0,path:()=>{const e=this._getAngleAxis();if(this._isTickMaskVisible(e)){const{tickMask:r}=this._spec,{angle:a,offsetAngle:o,style:l={}}=r,h=this._getAngleAxisSubTickData(e),{x:d,y:u}=this.angleAxisHelper.center(),c=this._computeLayoutRadius(),p=l;return h.map(({value:g})=>{const f=this.angleAxisHelper.dataToPosition([g])+ue(o),_=ue(a)/2;return mS(Object.assign(Object.assign({},p),{x:d,y:u,startAngle:f-_,endAngle:f+_,innerRadius:c*this._innerRadius,outerRadius:c*this._outerRadius,fill:!0}))})}const{width:i,height:n}=this.getLayoutRect();return[Ch({width:i,height:n,fill:!0})]}},"normal",tt.Series),this._arcGroupMark.setInteractive(!1)}_getAngleAxis(){if(!this.angleAxisHelper)return;const t=this.angleAxisHelper.getAxisId();return this._option.getChart().getAllComponents().find(e=>e.id===t)}_getAngleAxisTickData(t){var e;return(e=t==null?void 0:t.getTickData())===null||e===void 0?void 0:e.getLatestData()}_isTickMaskVisible(t){const e=this._getAngleAxisTickData(t),{tickMask:i}=this._spec;return i&&i.visible!==!1&&(e==null?void 0:e.length)>1}_getAngleAxisSubTickData(t){var e;const i=this._getAngleAxisTickData(t),n=[],{subTick:r={},tick:a={}}=(e=t==null?void 0:t.getSpec())!==null&&e!==void 0?e:{},{tickCount:o=4}=r,{alignWithLabel:l}=a;if((i==null?void 0:i.length)>=2){const h=i[1].value-i[0].value;for(let d=0;d<i.length-1;d++){const u=i[d],c=i[d+1];n.push(u);for(let p=0;p<o;p++){const g=(p+1)/(o+1),f=(1-g)*u.value+g*(c?c.value:l?1:u.value+h);n.push({value:f})}}return n.push(i[i.length-1]),n}return i}}id.mark=tA;class w_ extends vA{constructor(){super(...arguments),this._cacheStateStyle={}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{innerPadding:0,outerPadding:0})}_filterStyle(t,e,i,n=this.stateStyle){var r,a,o,l,h,d,u,c,p,g,f,_,m,v,y,b,x,S;E(t.innerRadius)&&this.setAttribute("innerRadius",this._styleConvert(t.innerRadius),e,i,this._cacheStateStyle),E(t.outerRadius)&&this.setAttribute("outerRadius",this._styleConvert(t.outerRadius),e,i,this._cacheStateStyle);const A=(r=t.innerPadding)!==null&&r!==void 0?r:(o=(a=n[e])===null||a===void 0?void 0:a.innerPadding)===null||o===void 0?void 0:o.style,k=(l=t.outerPadding)!==null&&l!==void 0?l:(d=(h=n[e])===null||h===void 0?void 0:h.outerPadding)===null||d===void 0?void 0:d.style,w=(g=(u=t.innerRadius)!==null&&u!==void 0?u:(p=(c=this._cacheStateStyle[e])===null||c===void 0?void 0:c.innerRadius)===null||p===void 0?void 0:p.style)!==null&&g!==void 0?g:(_=(f=n[e])===null||f===void 0?void 0:f.innerRadius)===null||_===void 0?void 0:_.style,T=(b=(m=t.outerRadius)!==null&&m!==void 0?m:(y=(v=this._cacheStateStyle[e])===null||v===void 0?void 0:v.outerRadius)===null||y===void 0?void 0:y.style)!==null&&b!==void 0?b:(S=(x=n[e])===null||x===void 0?void 0:x.outerRadius)===null||S===void 0?void 0:S.style;if(w===0&&T===0)return t;const M=E(t.innerPadding)&&E(w)||E(t.outerPadding)&&E(T),C=E(t.innerRadius)&&A||E(t.outerRadius)&&k;if(M||C){const R=Object.assign({},t);return A&&E(w)&&(K(w)?R.innerRadius=(I,O,L,D)=>w(I,O,L,D)+(K(A)?A(I,O,L,D):A):K(A)?R.innerRadius=(I,O,L,D)=>{const j=A(I,O,L,D);return w+j}:R.innerRadius=w+A),k&&E(T)&&(K(T)?R.outerRadius=(I,O,L,D)=>T(I,O,L,D)-(K(k)?k(I,O,L,D):k):K(k)?R.outerRadius=(I,O,L,D)=>{const j=k(I,O,L,D);return T-j}:R.outerRadius=T-k),R}return t}}w_.type="arc",w_.constructorType="progressArc";const AD=()=>{oL(),dA(),F.registerMark(w_.constructorType,w_)},Ztt=s=>({type:"growAngleIn",options:{overall:s.startAngle}}),Jtt={type:"fadeIn"};function Qtt(s,t){return t==="fadeIn"?Jtt:Ztt(s)}const kD=()=>{F.registerAnimation("circularProgress",(s,t)=>({appear:Qtt(s,t),enter:{type:"growAngleIn"},disappear:{type:"growAngleOut"}}))};class Bo extends id{constructor(){super(...arguments),this.type=z.circularProgress,this._progressMark=null,this._trackMark=null,this._getRadiusValueStart=t=>{if(this.getGroupFields().length>1){const e=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()));if(N(e))return e}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])},this._getRadiusValueEnd=t=>{var e,i;if(this.getGroupFields().length>1){const n=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+((i=(e=this.radiusAxisHelper).getBandwidth)===null||i===void 0?void 0:i.call(e,this._groups?this._groups.fields.length-1:0));if(N(n))return n}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])+this.radiusAxisHelper.getScale(0).step()}}getStackGroupFields(){return this.getGroupFields()}getGroupFields(){return this._radiusField}initMark(){super.initMark(),this._initTrackMark(),this._initProgressMark()}initMarkStyle(){super.initMarkStyle(),this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t;return this._progressMark=this._createMark(Bo.mark.progress,{parent:this._arcGroupMark,isSeriesMark:!0,customShape:(t=this._spec.progress)===null||t===void 0?void 0:t.customShape}),this._progressMark}_initProgressMarkStyle(){var t;const e=this._progressMark;e&&(this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart,endAngle:this._getAngleValueEnd,innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cap:(t=this._spec.roundCap)!==null&&t!==void 0&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0},"normal",tt.Series),this._trigger.registerMark(e))}initTooltip(){super.initTooltip(),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark)}_initTrackMark(){var t;return this._trackMark=this._createMark(Bo.mark.track,{parent:this._arcGroupMark,customShape:(t=this._spec.track)===null||t===void 0?void 0:t.customShape}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&(this.setMarkStyle(t,{visible:e=>{const i=this.angleAxisHelper.getScale(0).range(),n=Math.min(i[0],i[i.length-1]),r=this._getAngleValueStartWithoutMask(e);return Math.abs(r-n)<=1e-14},x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:()=>{const e=this._stack?ln:this._angleField[0],i=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueStart({[e]:i[0]})},endAngle:()=>{const e=this._stack?ui:this._angleField[0],i=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueEnd({[e]:i[i.length-1]})},innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:100},"normal",tt.Series),this._trigger.registerMark(t))}initAnimation(){var t,e,i,n;const r=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;this._progressMark.setAnimationConfig(zt((i=F.getAnimationInKey("circularProgress"))===null||i===void 0?void 0:i({startAngle:this._startAngle},r),Yt("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(zt((n=F.getAnimationInKey("fadeInOut"))===null||n===void 0?void 0:n(),Yt("track",this._spec,this._markAttributeContext)))}getActiveMarks(){return[this._progressMark]}}Bo.type=z.circularProgress,Bo.mark=zL;const tet=()=>{AD(),$c(),kD(),$r(),F.registerSeries(Bo.type,Bo)};function wD(s){return()=>s.direction==="vertical"?{orient:"negative"}:{orient:"positive"}}const eet=s=>({type:s.direction==="horizontal"?"growWidthIn":"growHeightIn",options:wD(s)}),iet=s=>({type:s.direction==="horizontal"?"growWidthOut":"growHeightOut",options:wD(s)}),set={type:"fadeIn"};function net(s,t){return t===!1?{}:t==="fadeIn"?set:eet(s)}const ret=()=>{F.registerAnimation("linearProgress",(s,t)=>({appear:net(s,t),enter:{type:"grow"},disappear:iet(s)}))};class aet extends ys{getDefaultTooltipPattern(t,e){const i=super.getDefaultTooltipPattern(t,e);return t==="mark"?i:t==="dimension"?(i.visible=!1,i):null}}class Ia extends pn{constructor(){super(...arguments),this.type=z.linearProgress,this._progressMark=null,this._trackMark=null,this._progressGroupMark=null}initMark(){this._initProgressGroupMark(),this._initTrackMark(),this._initProgressMark()}initMarkStyle(){this._initProgressGroupMarkStyle(),this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t;return this._progressMark=this._createMark(Ia.mark.progress,{isSeriesMark:!0,parent:this._progressGroupMark,customShape:(t=this._spec.progress)===null||t===void 0?void 0:t.customShape}),this._progressMark}_initProgressMarkStyle(){var t,e,i,n,r,a,o,l;const h=this._progressMark;if(h){if(this._spec.direction==="vertical"){const d=(e=(t=this._spec.progress)===null||t===void 0?void 0:t.leftPadding)!==null&&e!==void 0?e:0,u=(n=(i=this._spec.progress)===null||i===void 0?void 0:i.rightPadding)!==null&&n!==void 0?n:0;this.setMarkStyle(h,{x:c=>{var p,g;return ee(this.dataToPositionX(c),(g=(p=this._xAxisHelper)===null||p===void 0?void 0:p.getScale)===null||g===void 0?void 0:g.call(p,0))-this._spec.bandWidth/2+d},y:c=>{var p,g;return ee(this.dataToPositionY(c),(g=(p=this._yAxisHelper)===null||p===void 0?void 0:p.getScale)===null||g===void 0?void 0:g.call(p,0))},height:()=>{var c;return(c=this._yAxisHelper)===null||c===void 0?void 0:c.dataToPosition([0],{bandPosition:this._bandPosition})},width:this._spec.bandWidth-d-u,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",tt.Series)}else{const d=(a=(r=this._spec.progress)===null||r===void 0?void 0:r.topPadding)!==null&&a!==void 0?a:0,u=(l=(o=this._spec.progress)===null||o===void 0?void 0:o.bottomPadding)!==null&&l!==void 0?l:0;this.setMarkStyle(h,{x:c=>{var p,g;return ee(this.dataToPositionX(c),(g=(p=this._xAxisHelper)===null||p===void 0?void 0:p.getScale)===null||g===void 0?void 0:g.call(p,0))-this._xAxisHelper.dataToPosition([1],{bandPosition:this._bandPosition})},y:c=>{var p,g;return ee(this.dataToPositionY(c),(g=(p=this._yAxisHelper)===null||p===void 0?void 0:p.getScale)===null||g===void 0?void 0:g.call(p,0))-this._spec.bandWidth/2+d},height:this._spec.bandWidth-d-u,width:()=>{var c;return(c=this._xAxisHelper)===null||c===void 0?void 0:c.dataToPosition([1],{bandPosition:this._bandPosition})},cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",tt.Series)}this._trigger.registerMark(h)}}_initTrackMark(){var t;return this._trackMark=this._createMark(Ia.mark.track,{parent:this._progressGroupMark,customShape:(t=this._spec.track)===null||t===void 0?void 0:t.customShape}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&(this._spec.direction==="vertical"?this.setMarkStyle(t,{x:e=>{var i,n;return ee(this.dataToPositionX(e),(n=(i=this._xAxisHelper)===null||i===void 0?void 0:i.getScale)===null||n===void 0?void 0:n.call(i,0))-this._spec.bandWidth/2},y:0,width:this._spec.bandWidth,height:()=>this._scaleY.range()[0],cornerRadius:this._spec.cornerRadius},"normal",tt.Series):this.setMarkStyle(t,{x:0,y:e=>{var i,n;return ee(this.dataToPositionY(e),(n=(i=this._yAxisHelper)===null||i===void 0?void 0:i.getScale)===null||n===void 0?void 0:n.call(i,0))-this._spec.bandWidth/2},height:this._spec.bandWidth,width:()=>this._scaleX.range()[1],cornerRadius:this._spec.cornerRadius},"normal",tt.Series),this._trigger.registerMark(t))}_initProgressGroupMark(){return this._progressGroupMark=this._createMark(Ia.mark.group,{skipBeforeLayouted:!1}),this._progressGroupMark}_initProgressGroupMarkStyle(){const t=this._progressGroupMark;t.setZIndex(this.layoutZIndex),t.created(),this.setMarkStyle(t,{clip:!0,x:0,y:0,path:()=>{var e;const i=[];return(e=this._rawData)===null||e===void 0||e.rawData.forEach((n,r)=>{var a,o,l,h;if(this._spec.direction==="vertical"){const d=ee(this.dataToPositionX(n),(o=(a=this._xAxisHelper)===null||a===void 0?void 0:a.getScale)===null||o===void 0?void 0:o.call(a,0))-this._spec.bandWidth/2,u=this._scaleY.range()[0];i.push(Ch({x:d,y:0,height:u,width:this._spec.bandWidth,cornerRadius:this._spec.cornerRadius,fill:!0}))}else{const d=ee(this.dataToPositionY(n),(h=(l=this._yAxisHelper)===null||l===void 0?void 0:l.getScale)===null||h===void 0?void 0:h.call(l,0))-this._spec.bandWidth/2,u=this._scaleX.range()[1];i.push(Ch({x:0,y:d,height:this._spec.bandWidth,width:u,cornerRadius:this._spec.cornerRadius,fill:!0}))}}),i}},"normal",tt.Series),this._progressGroupMark.setInteractive(!1)}initAnimation(){var t,e,i,n;const r={direction:this.direction},a=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;this._progressMark.setAnimationConfig(zt((i=F.getAnimationInKey("linearProgress"))===null||i===void 0?void 0:i(r,a),Yt("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(zt((n=F.getAnimationInKey("fadeInOut"))===null||n===void 0?void 0:n(),Yt("track",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new aet(this),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark),this._trackMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._trackMark)}getActiveMarks(){return[this._progressMark]}}Ia.type=z.linearProgress,Ia.mark=VL;const oet=()=>{io(),ret(),$r(),F.registerSeries(Ia.type,Ia)},KC=[0],het="hidden",qC=20,det=[20,40],uet=[200,500],cet="circle",pet={shrink:!1,enlarge:!1,fontSizeLimitMin:0},get=!0,ZC=1,fet=["triangleForward","triangle","diamond","square","star","cardioid","circle","pentagon"],JC=`${At}_WORD_CLOUD_ANGLE`,_et=`${At}_WORD_CLOUD_FILLING_ANGLE`,V0=`${At}_WORD_CLOUD_WEIGHT`,QC=`${At}_WORD_CLOUD_TEXT`;class La extends Io{constructor(){super(...arguments),this._fontSizeRange=[qC,qC],this._isWordCloudShape=!1}setValueField(t){E(t)&&(this._valueField=t)}setFontSizeRange(t){E(t)?this._fontSizeRange=t:this._fontSizeRange=det}setAttrFromSpec(){var t,e,i,n,r,a,o,l,h,d;super.setAttrFromSpec(),this._padding=this._option.getChart().padding,this._nameField=this._spec.nameField,this._fontFamilyField=this._spec.fontFamilyField,this._fontWeightField=this._spec.fontWeightField,this._fontStyleField=this._spec.fontStyleField,this._colorHexField=this._spec.colorHexField,this._colorMode=(t=this._spec.colorMode)!==null&&t!==void 0?t:"ordinal",this._colorList=this._spec.colorList,this.setValueField(this._spec.valueField),this._fontWeightRange=(e=this._spec.fontWeightRange)!==null&&e!==void 0?e:uet,this._rotateAngles=(i=this._spec.rotateAngles)!==null&&i!==void 0?i:KC,this.setFontSizeRange(this._spec.fontSizeRange),this._maskShape=(n=this._spec.maskShape)!==null&&n!==void 0?n:cet,this._keepAspect=this._spec.keepAspect,this._random=(r=this._spec.random)!==null&&r!==void 0?r:get,this._fontPadding=(o=(a=this._spec.word)===null||a===void 0?void 0:a.padding)!==null&&o!==void 0?o:ZC,this._textField=!((l=this._spec.word)===null||l===void 0)&&l.formatMethod?QC:this._nameField,this._wordCloudConfig=Object.assign({drawOutOfBound:het,layoutMode:"default",zoomToFit:pet},this._spec.wordCloudConfig),this._wordCloudShapeConfig=Object.assign({fillingSeriesField:this.getSeriesField(),fillingRotateAngles:KC,layoutMode:"default"},this._spec.wordCloudShapeConfig),this._fillingFontPadding=(d=(h=this._spec.fillingWord)===null||h===void 0?void 0:h.padding)!==null&&d!==void 0?d:ZC,this._isWordCloudShape=!fet.includes(this._maskShape),this._defaultFontFamily=this._option.getTheme().fontFamily}initMark(){this._wordMark=this._createMark(La.mark.word,{defaultMorphElementKey:this._seriesField,groupKey:this._seriesField,isSeriesMark:!0}),this._isWordCloudShape&&(this._fillingWordMark=this._createMark(La.mark.fillingWord))}initMarkStyle(){var t,e,i,n,r;const a=this._wordMark,o=this._fillingWordMark,l=(t=this._spec.word)!==null&&t!==void 0?t:{};a&&(this.setMarkStyle(a,{fill:this._colorHexField?h=>h[this._colorHexField]:this.getWordColorAttribute(this._seriesField,!1),text:h=>h[this._textField],x:h=>h.x,y:h=>h.y,fontFamily:h=>h.fontFamily,fontSize:h=>h.fontSize,fontStyle:h=>h.fontStyle,fontWeight:h=>h.fontWeight,angle:h=>h.angle,visible:h=>!h.isFillingWord&&h.visible},"normal",tt.Series),this.setMarkStyle(a,{fontFamily:(i=(e=l.style)===null||e===void 0?void 0:e.fontFamily)!==null&&i!==void 0?i:this._defaultFontFamily},"normal",tt.User_Mark)),o&&(this.setMarkStyle(o,{fill:this._wordCloudShapeConfig.fillingColorHexField?h=>h[this._wordCloudShapeConfig.fillingColorHexField]:this.getWordColorAttribute(this._wordCloudShapeConfig.fillingSeriesField,!0),text:h=>h[this._textField],x:h=>h.x,y:h=>h.y,fontFamily:h=>h.fontFamily,fontSize:h=>h.fontSize,fontStyle:h=>h.fontStyle,fontWeight:h=>h.fontWeight,angle:h=>h.angle,visible:h=>h.isFillingWord&&h.visible},"normal",tt.Series),this.setMarkStyle(o,{fontFamily:(r=(n=l.style)===null||n===void 0?void 0:n.fontFamily)!==null&&r!==void 0?r:this._defaultFontFamily},"normal",tt.User_Mark)),this._trigger.registerMark(a),this._trigger.registerMark(o)}initTooltip(){super.initTooltip(),this._wordMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._wordMark),this._fillingWordMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._fillingWordMark)}initAnimation(){[this._wordMark,this._fillingWordMark].forEach(t=>{var e,i;if(t){const n=(i=(e=this._spec)===null||e===void 0?void 0:e.animationAppear)===null||i===void 0?void 0:i.preset,r={animationConfig:()=>{var a,o;return(o=(a=t.getAnimationConfig())===null||a===void 0?void 0:a.appear)===null||o===void 0?void 0:o[0]}};t.setAnimationConfig(zt(F.getAnimationInKey("wordCloud")(r,n),Yt("word",this._spec,this._markAttributeContext)))}})}getWordOrdinalColorScale(t,e){var i,n,r,a,o;const l=e?this._wordCloudShapeConfig.fillingColorList:this._colorList,h=t?(i=this.getViewData())===null||i===void 0?void 0:i.latestData.map(u=>u[t]):[],d=(r=l??((n=this._option.globalScale.getScale("color"))===null||n===void 0?void 0:n.range()))!==null&&r!==void 0?r:this._getDataScheme();return(o=(a=new jc().domain(h)).range)===null||o===void 0?void 0:o.call(a,d)}getWordColorAttribute(t,e){var i,n;if(this._colorMode==="ordinal")return{scale:this.getWordOrdinalColorScale(t,e),field:(i=this._seriesField)!==null&&i!==void 0?i:Fs};let r=(n=e?this._colorList:this._wordCloudShapeConfig.fillingColorList)!==null&&n!==void 0?n:this._option.globalScale.getScale("color").range();return r.length===1&&(r=[r[0],r[0]]),a=>r[0]}compile(){var t,e;super.compile();const{width:i,height:n}=this._region.getLayoutRect();if(!N(i)||!N(n)||!(n>0&&i>0))return;const r=[],a=this._valueField,o=new un,l=this._fontWeightRange,h=this._rotateAngles,d=this._wordCloudShapeConfig.fillingRotateAngles;if(a){const[c,p]=Ab((t=this.getViewData())===null||t===void 0?void 0:t.latestData.map(g=>+g[a]));o.domain([c,p],!0).range(l),r.push({type:"map",as:V0,callback:g=>c===p?o.scale(p):o.scale(g[a])})}r.push({type:"map",as:JC,callback:()=>h[Math.floor(Math.random()*h.length)]}),r.push({type:"map",as:_et,callback:()=>d[Math.floor(Math.random()*d.length)]});const u=(e=this._spec.word)!==null&&e!==void 0?e:{};u.formatMethod&&r.push({type:"map",as:QC,callback:u.formatMethod}),this._isWordCloudShape?r.push(Object.assign({type:"wordcloudShape"},this._wordCloudShapeTransformOption())):(r.push(Object.assign({type:"wordcloud"},this._wordCloudTransformOption())),this._wordMark.getProduct().transform(r)),this._data.getProduct().transform(r)}_wordCloudTransformOption(){var t,e,i,n,r;const{width:a,height:o}=this._region.getLayoutRect(),l=(e=(t=this._spec.word)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{};return{layoutType:rn(this._option.mode)?this._wordCloudConfig.layoutMode:"fast",size:[a,o],shape:this._maskShape,dataIndexKey:ar,text:{field:this._textField},fontSize:this._valueField?{field:this._valueField}:this._fontSizeRange[0],fontSizeRange:this._fontSizeRange==="auto"?null:this._fontSizeRange,padding:this._fontPadding,rotate:{field:JC},fontFamily:(n=(i=this._fontFamilyField)!==null&&i!==void 0?i:l.fontFamily)!==null&&n!==void 0?n:this._defaultFontFamily,fontWeight:this._fontWeightField?{field:this._fontWeightField}:this._valueField?{field:V0}:null,fontStyle:(r=this._fontStyleField)!==null&&r!==void 0?r:l.fontStyle,randomVisible:this._random,clip:this._wordCloudConfig.drawOutOfBound==="clip",shrink:this._wordCloudConfig.zoomToFit.shrink,enlarge:this._wordCloudConfig.zoomToFit.enlarge,minFontSize:this._wordCloudConfig.zoomToFit.fontSizeLimitMin,progressiveTime:this._wordCloudConfig.progressiveTime,progressiveStep:this._wordCloudConfig.progressiveStep}}_wordCloudShapeTransformOption(){var t,e,i,n,r,a,o,l,h,d;const{width:u,height:c}=this._region.getLayoutRect(),p=(e=(t=this._spec.word)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{},g=(i=this._wordCloudShapeConfig)!==null&&i!==void 0?i:{},f=this._wordCloudShapeConfig.fillingRotateAngles;return{dataIndexKey:ar,size:[u,c],shape:this._maskShape,text:{field:this._textField},fontSize:this._valueField?{field:this._valueField}:this._fontSizeRange[0],fontSizeRange:this._fontSizeRange==="auto"?null:this._fontSizeRange,padding:this._fontPadding,rotateList:this._rotateAngles,fontFamily:(r=(n=this._fontFamilyField)!==null&&n!==void 0?n:p.fontFamily)!==null&&r!==void 0?r:this._defaultFontFamily,fontWeight:this._fontWeightField?{field:this._fontWeightField}:this._valueField?{field:V0}:null,fontStyle:(a=this._fontStyleField)!==null&&a!==void 0?a:p.fontStyle,fillingFontFamily:(l=(o=g.fillingFontFamilyField)!==null&&o!==void 0?o:p.fontFamily)!==null&&l!==void 0?l:this._defaultFontFamily,fillingPadding:this._fillingFontPadding,fillingFontStyle:(h=g.fillingFontStyleField)!==null&&h!==void 0?h:p.fontStyle,fillingFontWeight:(d=g.fillingFontWeightField)!==null&&d!==void 0?d:p.fontWeight,fillingRotateList:f,fillingTimes:g.fillingTimes,fillingXStep:g.fillingXStep,fillingYStep:g.fillingYStep,fillingXRatioStep:g.fillingXRatioStep,fillingYRatioStep:g.fillingYRatioStep,fillingInitialOpacity:g.fillingInitialOpacity,fillingDeltaOpacity:g.fillingDeltaOpacity,fillingInitialFontSize:g.fillingInitialFontSize,fillingDeltaFontSize:g.fillingDeltaFontSize,ratio:g.ratio,fillingRatio:g.fillingRatio,removeWhiteBorder:g.removeWhiteBorder,textLayoutTimes:g.textLayoutTimes,fontSizeShrinkFactor:g.fontSizeShrinkFactor,stepFactor:g.stepFactor,layoutMode:g.layoutMode,importantWordCount:g.importantWordCount,globalShinkLimit:g.globalShinkLimit,fontSizeEnlargeFactor:g.fontSizeEnlargeFactor,fillingDeltaFontSizeFactor:g.fillingDeltaFontSizeFactor}}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}dataToPositionZ(t){return null}valueToPosition(t,e){return null}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}onLayoutEnd(t){super.onLayoutEnd(t),this.compile()}getActiveMarks(){return[this._wordMark,this._fillingWordMark]}}La.mark=cx;const met=s=>({custom:WH,customParameters:(t,e)=>s,easing:"linear",loop:1/0,duration:6e3});function vet(s,t,e){return s*e<t?s+(t-e*s)/(e-1):(t-s)/(e-1)}const yet=s=>({channel:{fontSize:{from:0}},duration:200,delay:(t,e,i)=>{const n=s.animationConfig(),r=(n==null?void 0:n.duration)||200,a=(n==null?void 0:n.totalTime)||ba.appear.duration,o=i.VGRAMMAR_ANIMATION_PARAMETERS.elementCount;return i.VGRAMMAR_ANIMATION_PARAMETERS.elementIndex*vet(r,a,o)}});function bet(s,t){return t===!1?{}:t==="fadeIn"?{type:"fadeIn"}:yet(s)}const TD=()=>{F.registerAnimation("wordCloud",(s,t)=>({appear:bet(s,t),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))},MD=()=>{F.registerAnimation("wordCloud3d",s=>({appear:met(s)}))},U0={triangleForward:wet,triangleUpright:tP,triangle:tP,diamond:xet,square:ket,star:Aet,cardioid:Tet,circle:Met,pentagon:Cet};function xet(){return function(s){const t=s%(2*Math.PI/4);return 1/(Math.cos(t)+Math.sin(t))}}function Aet(){return function(s){const t=(s+.955)%(2*Math.PI/10);return(s+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-t)+3.07768*Math.sin(2*Math.PI/10-t)):1/(Math.cos(t)+3.07768*Math.sin(t))}}function ket(){return function(s){return Math.min(1/Math.abs(Math.cos(s)),1/Math.abs(Math.sin(s)))}}function tP(){return function(s){const t=(s+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(t)+Math.sqrt(3)*Math.sin(t))}}function wet(){return function(s){const t=s%(2*Math.PI/3);return 1/(Math.cos(t)+Math.sqrt(3)*Math.sin(t))}}function Tet(){return function(s){return 1-Math.sin(s)}}function Met(){return function(){return 1}}function Cet(){return function(s){const t=(s+.955)%(2*Math.PI/5);return 1/(Math.cos(t)+.726543*Math.sin(t))}}function CD(s,t){const e=t[0],i=t[1];let n=1;const r=[t[0]>>1,t[1]>>1];switch(s){case"cardioid":r[1]=~~(i/2.7*.6),n=Math.floor(Math.min(e/2.3,i/2.6));break;case"triangleForward":n=i/Math.sqrt(.75)>e?Math.floor(e/2):Math.floor(i/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(i/1.5),n=Math.floor(Math.min(i/1.5,e/2));break;case"rect":n=Math.floor(Math.max(i/2,e/2));break;default:n=Math.floor(Math.min(e/2,i/2))}return{maxRadius:n,center:r}}const Pet=s=>U0[s]?U0[s]():U0.circle(),eP=(s,t)=>"hsl("+(360*Math.random()).toFixed()+","+(30*Math.random()+70).toFixed()+"%,"+(Math.random()*(t-s)+s).toFixed()+"%)";function ho(s){return K(s)?s:function(){return s}}class sd{constructor(t){var e,i;switch(this.options=lt({},sd.defaultOptions,t),K(this.options.shape)?this.shape=this.options.shape:this.shape=Pet(this.options.shape),this.getText=(e=ho(this.options.text))!==null&&e!==void 0?e:n=>n,this.getTextFontWeight=ho(this.options.fontWeight),this.getTextFontSize=ho(this.options.fontSize),this.getTextFontStyle=ho(this.options.fontStyle),this.getTextFontFamily=ho(this.options.fontFamily),this.outputCallback=(i=this.options.outputCallback)!==null&&i!==void 0?i:n=>n,this.options.color){case"random-dark":this.getTextColor=()=>eP(10,50);break;case"random-light":this.getTextColor=()=>eP(50,90);break;default:this.getTextColor=ho(this.options.color)}if(P(this.options.rotate))if(this.options.useRandomRotate){const n=Math.abs(this.options.maxRotation-this.options.minRotation),r=Math.abs(Math.floor(this.options.rotationSteps)),a=Math.min(this.options.maxRotation,this.options.minRotation);this.getTextRotate=()=>this.options.rotateRatio===0||Math.random()>this.options.rotateRatio?0:n===0?a:r>0?a+Math.floor(Math.random()*r)*n/(r-1):a+Math.random()*n}else this.getTextRotate=()=>0;else this.getTextRotate=K(this.options.rotate)?n=>{var r;return ue((r=this.options.rotate(n))!==null&&r!==void 0?r:0)}:()=>{var n;return ue((n=this.options.rotate)!==null&&n!==void 0?n:0)}}exceedTime(){var t;return this.options.progressiveStep>0?this.progressiveIndex>=(((t=this.currentStepIndex)!==null&&t!==void 0?t:0)+1)*this.options.progressiveStep:this.options.progressiveTime>0&&new Date().getTime()-this.escapeTime>this.options.progressiveTime}progressiveRun(){var t;if(this.options.progressiveStep>0?this.currentStepIndex=((t=this.currentStepIndex)!==null&&t!==void 0?t:0)+1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.data&&this.progressiveIndex&&this.progressiveIndex<this.data.length){this.progressiveResult=[];const e=this.data.length;let i=this.progressiveIndex;for(;i<e&&(this.layoutWord(i),i++,this.progressiveIndex=i,!this.exceedTime()););return this.progressiveResult}return this.result}initProgressive(){this.progressiveIndex=-1,this.options.progressiveStep>0?this.currentStepIndex=0:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.progressiveResult=[]}output(){return this.result?this.outputCallback(this.result):null}progressiveOutput(){return this.progressiveResult?this.outputCallback(this.progressiveResult):null}unfinished(){return this.data&&this.data.length&&!P(this.progressiveIndex)&&this.progressiveIndex<this.data.length}release(){this.data=null,this.result=null,this.progressiveIndex=null,this.progressiveResult=null}}sd.defaultOptions={fontFamily:'"Trebuchet MS", "Heiti TC", "微軟正黑體", "Arial Unicode MS", "Droid Fallback Sans", sans-serif',fontWeight:"normal",color:"random-dark",fontStyle:"normal",minFontSize:12,drawOutOfBound:!1,shrink:!1,minRotation:-Math.PI/2,maxRotation:Math.PI/2,rotationSteps:0,rotateRatio:.1,random:!1,shape:"circle",progressiveTime:0,progressiveStep:0,backgroundColor:"#fff"};const iP={archimedean:Eet,rectangular:Ret};function Eet(s){const t=s[0]/s[1];return e=>[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}function Ret(s){const t=4*s[0]/s[1];let e=0,i=0;return n=>{const r=n<0?-1:1;switch(Math.sqrt(1+4*r*n)-r&3){case 0:e+=t;break;case 1:i+=4;break;case 2:e-=t;break;default:i-=4}return[e,i]}}class vh extends sd{constructor(t){var e;super(lt({},vh.defaultOptions,t)),this.cw=64,this.ch=2048,this._size=[256,256],this._isBoardExpandCompleted=!1,this._placeStatus=0,this._tTemp=null,this._dtTemp=null,this._dy=0,this.cacheMap=new Map,this.options.minFontSize<=vh.defaultOptions.minFontSize&&(this.options.minFontSize=vh.defaultOptions.minFontSize),this.spiral=ht(this.options.spiral)?(e=iP[this.options.spiral])!==null&&e!==void 0?e:iP.archimedean:this.options.spiral,this.random=this.options.random?Math.random:()=>1,this.getTextPadding=ho(this.options.padding)}zoomRatio(){return this._originSize[0]/this._size[0]}dy(){return this._dy}layoutWord(t){const e=this.data[t];if((""+e.text).trim()==="")return!0;const{maxRadius:i,center:n}=CD(this.options.shape,this._size);if(e.x=n[0],e.y=n[1],Oet(this.contextAndRatio,e,this.data,t,this.cw,this.ch),this._placeStatus=0,e.hasText&&this.place(this._board,e,this._bounds,i))return this.result.push(e),this._bounds?Let(this._bounds,e):this._bounds=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=this._size[0]>>1,e.y-=this._size[1]>>1,this._tTemp=null,this._dtTemp=null,!0;if(this.updateBoardExpandStatus(e.fontSize),e.hasText&&this.shouldShrinkContinue()){if(this._placeStatus===1){const r=e.fontSize*this._originSize[0]/this.options.minFontSize,a=Math.max(e.width,e.height);if(a<=r)this.expandBoard(this._board,this._bounds,a/this._size[0]);else{if(!this.options.clip)return!0;this.expandBoard(this._board,this._bounds,r/this._size[0])}}else this._placeStatus,this.expandBoard(this._board,this._bounds);return this.updateBoardExpandStatus(e.fontSize),!1}return this._tTemp=null,this._dtTemp=null,!0}layout(t,e){this.initProgressive(),this.result=[],this._size=[e.width,e.height],this.clearCache(),this._originSize=[...this._size];const i=this.getContext(Gt.createCanvas({width:1,height:1}));this.contextAndRatio=i,this._board=new Array((this._size[0]>>5)*this._size[1]).fill(0),this._bounds=null;const n=t.length;let r=0;this.result=[];const a=t.map(l=>({text:this.getText(l),fontFamily:this.getTextFontFamily(l),fontStyle:this.getTextFontStyle(l),fontWeight:this.getTextFontWeight(l),angle:this.getTextRotate(l),fontSize:~~this.getTextFontSize(l),padding:this.getTextPadding(l),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:l,x:0,y:0,width:0,height:0})).sort(function(l,h){return h.fontSize-l.fontSize});this.data=a;let o=0;for(;r<n&&(this.layoutWord(r)||o>=2?(r++,o=0):o++,this.progressiveIndex=r,!this.exceedTime()););if(!this.options.clip&&this.options.enlarge&&this._bounds&&this.shrinkBoard(this._bounds),this._bounds&&["cardioid","triangle","triangle-upright"].includes(this.options.shape)){const l=(this._bounds[0].y+this._bounds[1].y)/2;this._dy=-(l-this._size[1]/2)}return this.result}formatTagItem(t){const e=this._size,i=this.zoomRatio(),n=this.dy(),r=e[0]>>1,a=e[1]>>1,o=t.length,l=[];let h,d;for(let u=0;u<o;++u)h=t[u],d={},d.datum=h.datum,d.x=(h.x+r)*i,d.y=(h.y+a+n)*i,d.fontFamily=h.fontFamily,d.fontSize=h.fontSize*i,d.fontStyle=h.fontStyle,d.fontWeight=h.fontWeight,d.angle=h.angle,l.push(d);return l}output(){return this.outputCallback?this.outputCallback(this.formatTagItem(this.result)):this.formatTagItem(this.result)}progressiveOutput(){return this.outputCallback?this.outputCallback(this.formatTagItem(this.progressiveResult)):this.formatTagItem(this.progressiveResult)}updateBoardExpandStatus(t){this._isBoardExpandCompleted=t*(this._originSize[0]/this._size[0])<this.options.minFontSize}shouldShrinkContinue(){return!this.options.clip&&this.options.shrink&&!this._isBoardExpandCompleted}shrinkBoard(t){const e=t[0],i=t[1];if(i.x>=this._size[0]||i.y>=this._size[1])return;const n=Math.min(e.x,this._size[0]-i.x),r=Math.min(e.y,this._size[1]-i.y),a=2*Math.min(n/this._size[0],r/this._size[1]);this._size=this._size.map(o=>o*(1-a))}expandBoard(t,e,i){const n=this._size[0]*(i||1.1)-this._size[0]>>5;let r=2*n>2?n:2;r%2!=0&&r++;let a=Math.ceil(this._size[1]*(r<<5)/this._size[0]);a%2!=0&&a++;const o=this._size[0],l=this._size[1],h=new Array(r).fill(0),d=new Array(a/2*(r+(o>>5))).fill(0);this.insertZerosToArray(t,l*(o>>5),d.length+r/2);for(let u=l-1;u>0;u--)this.insertZerosToArray(t,u*(o>>5),h.length);this.insertZerosToArray(t,0,d.length+r/2),this._size=[o+(r<<5),l+a],e&&(e[0].x+=(r<<5)/2,e[0].y+=a/2,e[1].x+=(r<<5)/2,e[1].y+=a/2)}insertZerosToArray(t,e,i){const n=Math.floor(i/6e4),r=i%6e4;for(let a=0;a<n;a++)t.splice(e+6e4*a,0,...new Array(6e4).fill(0));t.splice(e+6e4*n,0,...new Array(r).fill(0))}getContext(t){t.width=1,t.height=1;const e=t.getContext("2d").getImageData(0,0,1,1),i=Math.sqrt(e.data.length>>2);t.width=(this.cw<<5)/i,t.height=this.ch/i;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:i,canvas:t}}place(t,e,i,n){let r=!1;if(this.shouldShrinkContinue()&&(e.width>this._size[0]||e.height>this._size[1]))return this._placeStatus=1,!1;const a=this.random()<.5?1:-1;if(!this.shouldShrinkContinue()&&this.isSizeLargerThanMax(e,a))return null;const o=e.x,l=e.y,h=Math.sqrt(this._size[0]*this._size[0]+this._size[1]*this._size[1]),d=this.spiral(this._size);let u,c,p,g,f=-a;for(this._tTemp=null,this._dtTemp=null;u=d(f+=a);){c=u[0],p=u[1];const _=Math.sqrt(c**2+p**2);let m=Math.atan(p/c);c<0?m+=Math.PI:p<0&&(m=2*Math.PI+m);const v=this.shape(m);if(Math.min(Math.abs(c),Math.abs(p))>=h)break;if(_>=n)r&&this._tTemp===null&&(this._tTemp=f,this._dtTemp=a);else{if(e.x=o+~~(_*v*Math.cos(-m)),e.y=l+~~(_*v*Math.sin(-m)),g=e,this.options.clip)if(this.shouldShrinkContinue()){if($0(g,this._size)){r&&this._tTemp===null&&(this._tTemp=f,this._dtTemp=a);continue}}else{if(Det(g,this._size)){r&&this._tTemp===null&&(this._tTemp=f,this._dtTemp=a);continue}$0(g,this._size)&&(g=Fet(g,this._size))}else if($0(g,this._size)){r&&this._tTemp===null&&(this._tTemp=f,this._dtTemp=a);continue}if(r=!0,(!i||Bet(g,i))&&(!i||!Iet(g,t,this._size))){const y=g.sprite,b=g.width>>5,x=this._size[0]>>5,S=g.x-(b<<4),A=127&S,k=32-A,w=g.y1-g.y0;let T,M=(g.y+g.y0)*x+(S>>5);for(let C=0;C<w;C++){T=0;for(let R=0;R<=b;R++)t[M+R]|=T<<k|(R<b?(T=y[C*b+R])>>>A:0);M+=x}return e.sprite=null,g.sprite=null,!0}}}return this._tTemp!==null&&(this._placeStatus=3),!this.shouldShrinkContinue()&&this.setCache(g,a),!1}clearCache(){this.cacheMap.clear()}setCache(t,e){const i=`${t.angle}-${e}`,n=t.x1-t.x0,r=t.y1-t.y0;if(!this.cacheMap.has(i))return void this.cacheMap.set(i,{width:n,height:r});const{width:a,height:o}=this.cacheMap.get(i);(n<a&&r<o||n<=a&&r<o)&&this.cacheMap.set(i,{width:n,height:r})}isSizeLargerThanMax(t,e){const i=`${t.angle}-${e}`;if(!this.cacheMap.has(i))return!1;const{width:n,height:r}=this.cacheMap.get(i),a=t.x1-t.x0,o=t.y1-t.y0;return a>=n&&o>=r}}function Oet(s,t,e,i,n,r){if(t.sprite)return;const a=s.context,o=s.ratio;a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,(n<<5)/o,r/o);let l=0,h=0,d=0;const u=e.length;let c,p,g,f,_;for(--i;++i<u;){if(t=e[i],a.save(),a.font=t.fontStyle+" "+t.fontWeight+" "+~~((t.fontSize+1)/o)+"px "+t.fontFamily,c=a.measureText(t.text+"m").width*o,g=t.fontSize<<1,t.angle){const y=Math.sin(t.angle),b=Math.cos(t.angle),x=c*b,S=c*y,A=g*b,k=g*y;c=Math.max(Math.abs(x+k),Math.abs(x-k))+31>>5<<5,g=~~Math.max(Math.abs(S+A),Math.abs(S-A))}else c=c+31>>5<<5;if(g>d&&(d=g),l+c>=n<<5&&(l=0,h+=d,d=0),h+g>=r)break;a.translate((l+(c>>1))/o,(h+(g>>1))/o),t.angle&&a.rotate(t.angle),a.fillText(t.text,0,0),t.padding&&(a.lineWidth=2*t.padding,a.strokeText(t.text,0,0)),a.restore(),t.width=c,t.height=g,t.xoff=l,t.yoff=h,t.x1=c>>1,t.y1=g>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,l+=c}const m=a.getImageData(0,0,(n<<5)/o,r/o).data,v=[];for(;--i>=0;){if(!(t=e[i]).hasText)continue;for(c=t.width,p=c>>5,g=t.y1-t.y0,f=0;f<g*p;f++)v[f]=0;if(l=t.xoff,l==null)return;h=t.yoff;let y=0,b=-1;for(_=0;_<g;_++){for(f=0;f<c;f++){const x=p*_+(f>>5),S=m[(h+_)*(n<<5)+(l+f)<<2]?1<<31-f%32:0;v[x]|=S,y|=S}y?b=_:(t.y0++,g--,_--,h++)}t.y1=t.y0+b,t.sprite=v.slice(0,(t.y1-t.y0)*p)}}function Iet(s,t,e){const i=e[0]>>5,n=s.sprite,r=s.width>>5,a=s.x-(r<<4),o=127&a,l=32-o,h=s.y1-s.y0;let d,u=(s.y+s.y0)*i+(a>>5);for(let c=0;c<h;c++){d=0;for(let p=0;p<=r;p++)if((d<<l|(p<r?(d=n[c*r+p])>>>o:0))&t[u+p])return!0;u+=i}return!1}function Let(s,t){const e=s[0],i=s[1];t.x+t.x0<e.x&&(e.x=t.x+t.x0),t.y+t.y0<e.y&&(e.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function Bet(s,t){return s.x+s.x1>t[0].x&&s.x+s.x0<t[1].x&&s.y+s.y1>t[0].y&&s.y+s.y0<t[1].y}vh.defaultOptions={enlarge:!1,minFontSize:2};const Det=(s,t)=>s.x+s.x0>t[0]||s.y+s.y0>t[0]||s.x+s.x1<0||s.y+s.y1<0,$0=(s,t)=>s.x+s.x0<0||s.y+s.y0<0||s.x+s.x1>t[0]||s.y+s.y1>t[1];function Fet(s,t){const e=s.sprite,i=s.y1-s.y0,n=s.width>>5;let r=0;const a=[],o=Math.max(-(s.y0+s.y),0),l=Math.min(i+(t[1]-(s.y1+s.y)),i),h=Math.max(-(s.x0+s.x),0)>>5,d=Math.min(n+(t[0]-(s.x1+s.x)>>5)+1,n);for(let f=0;f<i;f++){for(let _=0;_<n;_++)f<o||l<=f||_<h||d<=_||a.push(e[r+_]);r+=n}const u=h<<5,c=n-d<<5,p=o,g=i-l;return Object.assign(Object.assign({},s),{width:s.width-u-c,height:s.height-p-g,x0:s.x0+u,x1:s.x1-c,y0:s.y0+p,y1:s.y1-g,x:s.x+u/2-c/2,sprite:a})}let PD=class ED extends sd{constructor(t){super(lt({},ED.defaultOptions,t)),this.fillGridAt=(e,i)=>{e>=this.ngx||i>=this.ngy||e<0||i<0||(this.grid[e][i]=!1)},this.updateGrid=(e,i,n,r,a)=>{const o=a.occupied;let l=o.length;for(;l--;){const h=e+o[l][0],d=i+o[l][1];h>=this.ngx||d>=this.ngy||h<0||d<0||this.fillGridAt(h,d)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const n=[];for(t===0&&n.push([this.center[0],this.center[1],0]);i--;){const r=this.shape(i/e*2*Math.PI);n.push([this.center[0]+t*r*Math.cos(-i/e*2*Math.PI),this.center[1]+t*r*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=n,n}getTextInfo(t,e=1){var i;const n=this.options.clip?1:e,r=Math.max(Math.floor(this.getTextFontSize(t)*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&(i=this.getTextRotate(t))!==null&&i!==void 0?i:0,d=this.getTextFontFamily(t),u=document.createElement("canvas"),c=u.getContext("2d",{willReadFrequently:!0});c.font=l+" "+o+" "+r.toString(10)+"px "+d;const p=c.measureText(a).width,g=Math.max(r,c.measureText("m").width,c.measureText("W").width);let f=p+2*g,_=3*g;const m=Math.ceil(f/this.gridSize),v=Math.ceil(_/this.gridSize);f=m*this.gridSize,_=v*this.gridSize;const y=-p/2,b=.4*-g,x=Math.ceil((f*Math.abs(Math.sin(h))+_*Math.abs(Math.cos(h)))/this.gridSize),S=Math.ceil((f*Math.abs(Math.cos(h))+_*Math.abs(Math.sin(h)))/this.gridSize),A=S*this.gridSize,k=x*this.gridSize;u.setAttribute("width",""+A),u.setAttribute("height",""+k),c.scale(1,1),c.translate(A/2,k/2),c.rotate(-h),c.font=l+" "+o+" "+r.toString(10)+"px "+d,c.fillStyle="#000",c.textBaseline="middle",c.fillText(a,y,b);const w=c.getImageData(0,0,A,k).data;if(this.exceedTime())return null;const T=[];let M,C=S;const R=[x/2,S/2,x/2,S/2],I=(O,L,D)=>{let j=this.gridSize;for(;j--;){let H=this.gridSize;for(;H--;)if(w[4*((L*this.gridSize+j)*A+(O*this.gridSize+H))+3])return D.push([O,L]),O<R[3]&&(R[3]=O),O>R[1]&&(R[1]=O),L<R[0]&&(R[0]=L),void(L>R[2]&&(R[2]=L))}};for(;C--;)for(M=x;M--;)I(C,M,T);return{datum:t,occupied:T,bounds:R,gw:S,gh:x,fillTextOffsetX:y,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:d,angle:h,text:a}}canFitText(t,e,i,n,r){let a=r.length;for(;a--;){const o=t+r[a][0],l=e+r[a][1];if(o>=this.ngx||l>=this.ngy||o<0||l<0){if(!this.options.drawOutOfBound)return!1}else if(!this.grid[o][l])return!1}return!0}layoutWord(t,e=1){const i=this.data[t],n=this.getTextInfo(i,e);if(!n||this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||n.fontSize<=this.options.minFontSize)&&!this.options.clip){const o=n.bounds;if(o[1]-o[3]+1>this.ngx||o[2]-o[0]+1>this.ngy)return!1}let r=this.maxRadius+1;const a=o=>{const l=Math.floor(o[0]-n.gw/2),h=Math.floor(o[1]-n.gh/2),d=n.gw,u=n.gh;return!!this.canFitText(l,h,d,u,n.occupied)&&(n.distance=this.maxRadius-r,n.theta=o[2],this.outputText(l,h,n),this.updateGrid(l,h,d,u,n),!0)};for(;r--;){let o=this.getPointsAtRadius(this.maxRadius-r);if(this.options.random&&(o=[].concat(o),cE(o)),o.some(a))return!0}return(this.options.clip||!!(this.options.shrink&&n.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const n=this.getTextColor(i),r={text:i.text,datum:i.datum,color:n,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(r),this.progressiveResult&&this.progressiveResult.push(r)}initGrid(t){let e;if(this.grid=[],t){let i=document.createElement("canvas").getContext("2d");i.fillStyle=this.options.backgroundColor,i.fillRect(0,0,1,1);let n=i.getImageData(0,0,1,1).data,r=t.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize).data;const a=(l,h)=>{let d=this.gridSize;for(;d--;){let u=this.gridSize;for(;u--;)for(e=4;e--;)if(r[4*((h*this.gridSize+d)*this.ngx*this.gridSize+(l*this.gridSize+u))+e]!==n[e])return void(this.grid[l][h]=!1)}};let o=this.ngx;for(;o--;){this.grid[o]=[];let l=this.ngy;for(;l--;)a(o,l),this.grid[o][l]!==!1&&(this.grid[o][l]=!0)}r=i=n=void 0}else{let i=this.ngx;for(;i--;){this.grid[i]=[];let n=this.ngy;for(;n--;)this.grid[i][n]=!0}}}layout(t,e){this.initProgressive(),this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:n}=CD(this.options.shape,[e.width,e.height]);this.center=e.origin?[e.origin[0]/this.gridSize,e.origin[1]/this.gridSize]:[i[0]/this.gridSize,i[1]/this.gridSize],this.maxRadius=Math.floor(n/this.gridSize),this.initGrid(e.canvas),this.result=[];let r=0;for(;r<t.length&&(this.layoutWord(r),r++,this.progressiveIndex=r,!this.exceedTime()););return this.result}};PD.defaultOptions={gridSize:8,ellipticity:1};class av extends sd{constructor(t){super(lt({},av.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let e=0,i=this.result.length;e<i;e++)if(jet(t,this.result[e]))return!1;return!0}getTextInfo(t){const e={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},i=Ec(e);return e.width=i.width(),e.height=i.height(),e.top=this.center[1]-e.height+.21*e.height,e.left=this.center[0]-e.width/2,e}layoutWord(t){const e=this.getTextInfo(this.data[t]);let i=2*Math.PI,n=0,r=e.left,a=e.top;const o=e.width,l=e.height;let h=1,d=this.fit(e);for(;!d&&n<this.maxRadius;)n+=.5,h=this.shape(n/this.maxRadius*2*Math.PI),i+=.5*(this.options.random?this.random()>.5?1:-1:t%2==0?1:-1),r=this.center[0]-o/2+n*h*Math.cos(i)*this.aspectRatio,a=this.center[1]-l/2+n*h*Math.sin(i),e.left=r,e.top=a,e.x=r+o/2,e.y=a+l/2,d=this.fit(e);return!!d&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(t!=null&&t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort((n,r)=>this.getTextFontSize(r)-this.getTextFontSize(n));let i=0;for(;i<t.length&&(this.layoutWord(i),i++,this.progressiveIndex=i,!this.exceedTime()););return this.result}}function jet(s,t){return!(s.left+s.width<t.left||s.top+s.height<t.top||s.left>t.left+t.width||s.top>t.top+t.height)}av.defaultOptions={enlarge:!1};const zet={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},Het=(s,t)=>{var e,i,n,r,a,o;if(s.size&&(s.size[0]<=0||s.size[1]<=0))return Nt.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=t,h=((e=s.size)!==null&&e!==void 0?e:[500,500]).slice();h[0]=Math.floor(h[0]),h[1]=Math.floor(h[1]);const d=s.fontFamily?ao(s.fontFamily):"sans-serif",u=s.fontStyle?ao(s.fontStyle):"normal",c=s.fontWeight?ao(s.fontWeight):"normal",p=s.rotate?ao(s.rotate):0,g=ao(s.text),f=(i=s.spiral)!==null&&i!==void 0?i:"archimedean",_=s.padding?ao(s.padding):1,m=(n=s.shape)!==null&&n!==void 0?n:"square",v=(r=s.shrink)!==null&&r!==void 0&&r,y=(a=s.enlarge)!==null&&a!==void 0&&a,b=(o=s.clip)!==null&&o!==void 0&&o,x=s.minFontSize,S=s.randomVisible,A=s.as||zet,k=s.depth_3d,w=s.postProjection;let T=s.fontSize?ao(s.fontSize):14;const M=s.fontSizeRange;if(M&&!dt(T)){const I=T,O=Net(Get(I,l),M);T=L=>O(I(L))}let C=vh;s.layoutType==="fast"?C=av:s.layoutType==="grid"&&(C=PD);const R=new C({text:g,padding:_,spiral:f,shape:m,rotate:p,fontFamily:d,fontStyle:u,fontWeight:c,fontSize:T,shrink:v,clip:b,enlarge:y,minFontSize:x,random:S,progressiveStep:s.progressiveStep,progressiveTime:s.progressiveTime,outputCallback:I=>{const O=[];let L,D;for(let j=0,H=I.length;j<H;j++)D=I[j],L=D.datum,L[A.x]=D.x,L[A.y]=D.y,L[A.fontFamily]=D.fontFamily,L[A.fontSize]=D.fontSize,L[A.fontStyle]=D.fontStyle,L[A.fontWeight]=D.fontWeight,L[A.angle]=D.angle,w==="StereographicProjection"&&Wet(h,D,L,A,k),O.push(L);return O}});return R.layout(l,{width:h[0],height:h[1]}),s.progressiveStep>0||s.progressiveTime>0?{progressive:R}:R.output()},ao=s=>ht(s)||dt(s)||K(s)?s:t=>t[s.field],Y0=s=>s<0?-Math.sqrt(-s):Math.sqrt(s),Net=(s,t)=>{if(s[0]===s[1])return a=>t[0];const e=Y0(s[0]),i=Y0(s[1]),n=Math.min(e,i),r=Math.max(e,i);return a=>(Y0(a)-n)/(r-n)*(t[1]-t[0])+t[0]},Get=(s,t)=>{let e=1/0,i=-1/0;const n=t.length;let r;for(let a=0;a<n;++a)r=Qn(s(t[a])),r<e&&(e=r),r>i&&(i=r);return t.length===1&&e===i&&(e-=1e4),[e,i]};function Wet(s,t,e,i,n){const r=Math.max(s[0],s[1])/2,a=Vet(s[0],s[1],r,{x:r,y:r,z:n??r},t);e[i.x]=a.x,e[i.y]=a.y,e[i.z]=a.z}function Vet(s,t,e,i,n){const{x:r,y:a}=n,o=r/s*Math.PI*2;let l=Math.PI-a/t*Math.PI;return l+=(l<Math.PI/2?1:-1)*Math.pow(Math.min(l-Math.PI/2,1),2)/5,{x:e*Math.sin(l)*Math.cos(o)+i.x,y:e*Math.cos(l)+i.y,z:e*Math.sin(l)*Math.sin(o)+i.z}}const ov=()=>{st.registerTransform("wordcloud",{transform:Het,markPhase:"beforeJoin"},!0)};var T_;(function(s){s.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",s.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout"})(T_||(T_={}));const Uet=(s,t)=>{if(t.length===1&&t[0]==="#537EF5")return!0;if(!Array.isArray(s)||!Array.isArray(t)||s.length!==t.length)return!1;for(let e=0;e<s.length;e++)if(s[e]!==t[e])return!1;return!0},$et=()=>{let s=-1;const t=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(s=(s+1)%t.length,t[s])},Yet=s=>/^[\u4e00-\u9fa5]+$/.test(s),RD=(s,t)=>{if(P(s))return 0;let e=0;for(const i of s)Yet(i)?e+=1:e+=.53;return e};function Xet(s){return s&&(lE(s)||hE(s)||s.startsWith("<svg"))?new Promise((t,e)=>{var i;const n=_S({image:s}),r=(i=n.resources)===null||i===void 0?void 0:i.get(s);r&&r.state==="success"&&r.data?t(r.data):(n.successCallback=()=>{var a;if(n){const o=(a=n.resources)===null||a===void 0?void 0:a.get(s);o&&o.state==="success"&&o.data?t(o.data):e(new Error("image load failed"+s))}else e(new Error("image load failed"+s))},n.failCallback=()=>{Nt.getInstance().error("image 加载失败!",s)})}):null}function Ket(s){return typeof s=="function"?s:function(){return s}}var qet=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};function Zet(s){return qet(this,void 0,void 0,function*(){const t=yield Xet(s.shapeUrl);return s.removeWhiteBorder&&t?Qet(t,s.tempCanvas,s.tempCtx):t})}function Jet(s,t){const{size:e,tempCanvas:i,tempCtx:n}=t,r=tit(s,e);i.width=e[0],i.height=e[1],n.clearRect(0,0,i.width,i.height),n.drawImage(s,r.x,r.y,r.width,r.height);const a=n.getImageData(0,0,e[0],e[1]),o=new Array(e[0]*e[1]).fill(0);let l=1;const h=[[0,1],[1,0],[-1,0],[0,-1]];let d=[];for(let M=0;M<e[1];M++)for(let C=0;C<e[0];C++)if(o[M*e[0]+C]===0&&!M_(a,M,C)){o[M*e[0]+C]=l,d.push([M,C]);for(let R=0;R<d.length;R++)for(let I=0;I<4;I++){let O=d[R][0]+h[I][0],L=d[R][1]+h[I][1];O=O<0?0:O>=e[1]?e[1]-1:O,L=L<0?0:L>=e[0]?e[0]-1:L,o[O*e[0]+L]!==0||M_(a,O,L)||(o[O*e[0]+L]=l,d.push([O,L]))}l++,d=[]}const u={},c={},p={},g={},f={},_={},m={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0};for(let M=0;M<e[1];M++)for(let C=0;C<e[0];C++){const R=o[M*e[0]+C];R!==0&&(T(M,C)&&(u[R]=u[R]||[],u[R].push([C,M]),g[R]||(g[R]=[1/0,-1/0,1/0,-1/0]),M<g[R][0]&&(g[R][0]=M),M>g[R][1]&&(g[R][1]=M),C<g[R][2]&&(g[R][2]=C),C>g[R][3]&&(g[R][3]=C),C<m.x1&&(m.x1=C),C>m.x2&&(m.x2=C),M<m.y1&&(m.y1=M),M>m.y2&&(m.y2=M)),c[R]=c[R]||0,c[R]++)}const v=[];for(const M in u){const C=u[M],R=~~(C.reduce((H,W)=>H+W[0],0)/C.length),I=~~(C.reduce((H,W)=>H+W[1],0)/C.length);p[M]=[R,I],v.push(...C);const[O,L,D,j]=g[M];f[M]=~~Math.max(Math.sqrt((R-D)**2+(I-O)**2),Math.sqrt((R-j)**2+(I-L)**2),Math.sqrt((R-D)**2+(I-L)**2),Math.sqrt((R-j)**2+(I-O)**2)),_[M]=(j-D)/(L-O)}const y=Object.keys(p).map(M=>({label:M-1,boundary:u[M],area:c[M],center:p[M],maxPoint:g[M],maxR:f[M],ratio:_[M]}));m.width=m.x2-m.x1+1,m.height=m.y2-m.y1+1;const b=~~(v.reduce((M,C)=>M+C[0],0)/v.length),x=~~(v.reduce((M,C)=>M+C[1],0)/v.length),S=~~Math.max(Math.sqrt((b-m.x1)**2+(x-m.y1)**2),Math.sqrt((b-m.x2)**2+(x-m.y2)**2),Math.sqrt((b-m.x1)**2+(x-m.y2)**2),Math.sqrt((b-m.x2)**2+(x-m.y1)**2)),A=m.width/m.height,k=Object.keys(c).reduce((M,C)=>M+c[C],0),w={regions:y,labels:o,labelNumber:l-1};return Object.assign(t,{segmentation:w,shapeConfig:r,shapeBounds:m,shapeMaxR:S,shapeRatio:A,shapeCenter:[b,x],shapeArea:k});function T(M,C){const R=[[0,1],[1,0],[-1,0],[0,-1]];if(M===0||C===0||M===e[1]-1||C===e[0]-1)return!0;for(let I=0;I<4;I++){let O=M+R[I][0],L=C+R[I][1];if(O=O<0?0:O>=e[1]?e[1]-1:O,L=L<0?0:L>=e[0]?e[0]-1:L,o[O*e[0]+L]===0)return!0}return!1}}function M_(s,t,e){const i=s.width;return s.data[t*i*4+4*e+3]===0||s.data[t*i*4+4*e+0]===255&&s.data[t*i*4+4*e+1]===255&&s.data[t*i*4+4*e+2]===255}function Qet(s,t,e){t.width=s.width,t.height=s.height,e.clearRect(0,0,t.width,t.height),e.drawImage(s,0,0);const i=t.width,n=e.getImageData(0,0,t.width,t.height);let r=0,a=n.height,o=0,l=n.width;for(;r<a&&sP(n,i,r);)++r;for(;a-1>r&&sP(n,i,a-1);)--a;for(;o<l&&nP(n,i,o,r,a);)++o;for(;l-1>o&&nP(n,i,l-1,r,a);)--l;const h=e.getImageData(o,r,l-o,a-r);return t.width=h.width,t.height=h.height,e.clearRect(0,0,t.width,t.height),e.putImageData(h,0,0),t}function sP(s,t,e){for(let i=0;i<t;++i)if(!M_(s,e,i))return!1;return!0}function nP(s,t,e,i,n){for(let r=i;r<n;++r)if(!M_(s,r,e))return!1;return!0}function tit(s,t){const e=s.width,i=s.height;let n=t[0]/e;i*n>t[1]&&(n=t[1]/i);const r=Math.floor(n*e),a=Math.floor(n*i);return{x:(t[0]-r)/2,y:(t[1]-a)/2,width:r,height:a,scale:n}}function eit(s,t){const{segmentation:{regions:e}}=t;let i=-1/0,n=0,r=0;e.forEach((h,d)=>{const u=h.area;u>i&&(i=u,r=d),n+=u});let a=0;e.forEach(h=>{const d=h.area,u=Math.ceil(d/n*s.length),c=d/i;h.words=[],h.regionNum=u,h.regionWeight=c,a+=u}),a<s.length&&(e[r].wordsNum+=s.length-a);let o=r;const l=e.map(h=>h.regionNum);s.forEach(h=>{let d=0,u=0;h.regionIndex=-1;do{if(l[o]>0&&h.weight<=e[o].regionWeight){h.regionIndex=o,e[o].words.push(h),l[o]--,o=(o+1)%e.length;break}o=(o+1)%e.length,d++,u++,u>e.length+1&&(e.forEach(c=>{c.regionWeight+=.15}),u=0)}while(h.regionIndex===-1&&d<3*e.length);h.regionIndex===-1&&(h.regionIndex=r,e[r].words.push(h),l[r]--)}),e.forEach(h=>{h.words.sort((d,u)=>u.weight-d.weight)})}function iit(s,t,e){const{size:i,stepFactor:n}=t,{segmentation:{regions:r},tempCtx:a,tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:d,shapeRatio:u}=e,c=bA(e);for(const p of r){const{words:g,center:f,maxR:_,ratio:m}=p;for(let v=0;v<g.length;v++){Do(o,a,s,v);const y=g[v];y.x=f[0],y.y=f[1],y.hasText&&y.sprite&&Gh(c,y,_,m,i,l,n)&&(y.hasPlaced=!0)}}for(let p=0;p<t.textLayoutTimes;p++){const g=s.filter(f=>(f.hasPlaced||(f.hasText=!1,f.sprite=null,f.fontSize=Math.max(~~(f.fontSize*t.fontSizeShrinkFactor),t.minFontSize)),!f.hasPlaced));if(g.length===0)break;for(let f=0;f<g.length;f++){const _=g[f];Do(o,a,g,f),_.x=h[0],_.y=h[1],_.hasText&&Gh(c,_,d,u,i,l,n)&&(_.hasPlaced=!0)}}t.board=c}function OD(s,t,e){const{stepFactor:i,importantWordCount:n,globalShinkLimit:r}=t,{size:a,segmentation:{regions:o},tempCtx:l,tempCanvas:h,boardSize:d,shapeCenter:u,shapeMaxR:c,shapeRatio:p}=e,g=bA(e);let f=g.slice(0);const _=t.fontSizeShrinkFactor;let m=null,v=1,y=1;const b=n;let x=0;s.length>b&&(x=s.sort((S,A)=>A.weight-S.weight)[b].weight);for(let S=0;S<o.length;S++){const A=o[S],{words:k,center:w,maxR:T,ratio:M}=A;let C=!1;for(let R=0;R<k.length;R++){Do(h,l,s,R);const I=k[R];if(I.x=w[0],I.y=w[1],!I.skip&&I.hasText&&I.sprite&&Gh(f,I,T,M,a,d,i))I.hasPlaced=!0;else{if(!I.skip&&I.weight>x&&y>r){const O=I.datum[Symbol.for("vGrammar_id")];O!==m&&(m=O,v=y),y*=_,s.forEach(L=>{L.hasText=!1,L.sprite=null,L.fontSize=L.fontSize*_}),f=g.slice(0),C=!0;break}if(!I.skip&&I.datum[Symbol.for("vGrammar_id")]===m){s.forEach(O=>{O.hasText=!1,O.sprite=null,O.fontSize=O.fontSize/y}),I.skip=!0,y=v,m=null,f=g.slice(0),C=!0;break}}}C&&(S=-1)}for(let S=0;S<t.textLayoutTimes;S++){const A=s.filter(k=>(k.hasPlaced||(k.hasText=!1,k.sprite=null,k.fontSize=Math.max(~~(k.fontSize*t.fontSizeShrinkFactor),t.minFontSize)),!k.hasPlaced));if(A.length===0)break;for(let k=0;k<A.length;k++){const w=A[k];Do(h,l,A,k),w.x=u[0],w.y=u[1],w.hasText&&Gh(f,w,c,p,a,d,i)&&(w.hasPlaced=!0)}}t.board=f}function sit(s,t,e){const{size:i,stepFactor:n,importantWordCount:r}=t,{segmentation:{regions:a},tempCtx:o,tempCanvas:l,boardSize:h,shapeCenter:d,shapeMaxR:u,shapeRatio:c}=e,p=bA(e);let g=p.slice(0);const f=t.fontSizeEnlargeFactor,_=Math.min(r,s.length);let m=0;s.length>_&&(m=s.sort((x,S)=>S.weight-x.weight)[_-1].weight);let v=0,y=1,b=!1;for(let x=0;x<a.length;x++){const S=a[x],{words:A,center:k,maxR:w,ratio:T}=S;let M=!1;for(let C=0;C<A.length;C++){Do(l,o,s,C);const R=A[C];if(R.x=k[0],R.y=k[1],R.hasText&&R.sprite&&Gh(g,R,w,T,i,h,n)){if(R.hasPlaced=!0,R.weight>=m&&v++,v>=_&&!b){y*=f,s.forEach(I=>{I.hasText=!1,I.sprite=null,I.fontSize=I.fontSize*f}),g=p.slice(0),M=!0,v=0;break}}else{if(R.weight>=m&&y>1){s.forEach(I=>{I.hasText=!1,I.sprite=null,I.fontSize=I.fontSize/f}),y/=f,b=!0,g=p.slice(0),M=!0;break}if(R.weight>=m)return OD(s,t,e)}}M&&(x=-1)}for(let x=0;x<t.textLayoutTimes;x++){const S=s.filter(A=>(A.hasPlaced||(A.hasText=!1,A.sprite=null,A.fontSize=Math.max(~~(A.fontSize*t.fontSizeShrinkFactor),t.minFontSize)),!A.hasPlaced));if(S.length===0)break;for(let A=0;A<S.length;A++){const k=S[A];Do(l,o,S,A),k.x=d[0],k.y=d[1],k.hasText&&Gh(g,k,u,c,i,h,n)&&(k.hasPlaced=!0)}}t.board=g}function Gh(s,t,e,i,n,r,a){const o=t.x,l=t.y,h=nit(i),d=1*a;let u,c,p,g=-d;for(;u=h(g+=d);){const{wordSize:f,bounds:{dTop:_,dBottom:m,dLeft:v,dRight:y}}=t;if(c=u[0],p=u[1],Math.min(Math.abs(c),Math.abs(p))>=e)break;if(t.x=~~(o+c),t.y=~~(l+p),!(t.x-v<0||t.x+y>n[0]||t.y-_<0||t.y+m>n[1]||LD(t,s,r)))return ID(t,s,r),!0}return!1}function ID(s,t,e){const{wordSize:i}=s,n=s.sprite,r=i[0]>>5,a=e[0]>>5,o=s.x-(r<<4),l=o%32,h=32-l,d=i[1];let u,c=(s.y-(i[1]>>1))*a+(o>>5);if(l===0)for(let p=0;p<d;p++){for(let g=0;g<r;g++)t[c+g]|=n[p*r+g];c+=a}else for(let p=0;p<d;p++){u=0;for(let g=0;g<=r;g++)t[c+g]|=u<<h|(g<r?(u=n[p*r+g])>>>l:0);c+=a}}function LD(s,t,e){const{sprite:i,wordSize:n}=s,r=e[0]>>5,a=n[0]>>5,o=s.x-(a<<4),l=o%32,h=32-l,d=n[1];let u,c=(s.y-(n[1]>>1))*r+(o>>5);if(l===0)for(let p=0;p<d;p++){for(let g=0;g<a;g++)if(t[c+g]&i[p*a+g])return!0;c+=r}else for(let p=0;p<d;p++){u=0;for(let g=0;g<=a;g++)if((u<<h|(g<a?(u=i[p*a+g])>>>l:0))&t[c+g])return!0;c+=r}return!1}function nit(s){return function(t){return[s*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Do(s,t,e,i){if(e[i].sprite||e[i].fontSize===0)return;const n=2048,r=Math.PI/180,a=e.length;s.width=n,s.height=2048,t.clearRect(0,0,n,2048),t.textAlign="center";let o,l,h=0,d=0,u=0,c=0;const p=i;for(--i;++i<a;){const m=e[i],v=Math.max(m.fontSize,2);if(t.save(),t.font=m.fontStyle+" "+m.fontWeight+" "+v+"px "+m.fontFamily,o=t.measureText(m.text+"m").width+2*m.padding,l=2*v+2*m.padding,m.rotate!==0){const y=Math.sin(m.rotate*r),b=Math.cos(m.rotate*r),x=o*b,S=o*y,A=l*b,k=l*y;o=Math.max(Math.abs(x+k),Math.abs(x-k)),l=~~Math.max(Math.abs(S+A),Math.abs(S-A))}if(o=o+31>>5<<5,l=Math.ceil(l),l>u&&(u=l),h+o>=n&&(h=0,d+=u,u=l),d+l>=2048){if(d===0){m.hasText=!1;continue}break}d+l>=c&&(c=d+l),t.translate(h+(o>>1),d+(l>>1)),m.rotate!==0&&t.rotate(m.rotate*r),t.fillText(m.text,0,0),m.padding&&(t.lineWidth=2*m.padding,t.strokeText(m.text,0,0)),t.restore(),m.LT=[h,d],m.wordSize=[o,l],m.hasText=!0,h+=o}if(c===0)return;const g=t.getImageData(0,0,n,c).data;let f,_;for(;--i>=p;){const m=e[i];if(!m.hasText){m.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:v=[0,0],wordSize:y}=m;[h,d]=v;const b=y[0]>>5,x=new Array(b*y[1]).fill(0);let[S,A,k,w]=[1/0,-1/0,1/0,-1/0];for(_=0;_<y[1];_++){let T;for(f=0;f<y[0];f++)if(g[4*((d+_)*n+(h+f))+3]>0){const M=1<<31-f%32;x[b*_+(f>>5)]|=M,f<k&&(k=f),f>w&&(w=f),T|=M}T&&(_<S&&(S=_),_>A&&(A=_))}m.bounds={dTop:(y[1]>>1)-S,dBottom:A-(y[1]>>1),dLeft:(y[0]>>1)-k,dRight:w-(y[0]>>1)},m.sprite=x,delete m.LT}}function bA(s){const{segmentation:{labels:t},boardSize:e,size:i}=s,n=e[0]>>5,r=new Array(n*i[1]).fill(0);for(let a=0;a<i[1];a++)for(let o=0;o<i[0];o++)if(t[a*i[0]+o]===0){const l=1<<31-o%32;r[n*a+(o>>5)]|=l}if(e[0]>i[0]){const a=(1<<e[0]-i[0])-1;for(let o=0;o<i[1];o++)r[n*o+n-1]|=a}return r}function rit(s,t,e){const{size:i,fillingTimes:n,fillingXStep:r,fillingYStep:a,getFillingFontStyle:o,getFillingFontWeight:l,getFillingFontFamily:h,fillingInitialFontSize:d,fillingDeltaFontSize:u,fillingInitialOpacity:c,fillingDeltaOpacity:p,fillingRotateList:g,getFillingPadding:f,random:_,board:m,minFillFoontSize:v}=t,{boardSize:y,shapeBounds:b,tempCtx:x,tempCanvas:S,randomGenerator:A}=e;let k=d,w=c;const T=[];for(let R=0;R<n;R++)M(k,w),k=Math.max(k>u?k-u:u,v),w=w>p?w-p:p;return T;function M(R,I){const O=s.map(Q=>{const{text:J,color:nt,fillingColor:q,hasPlaced:U,datum:it}=Q;return{x:0,y:0,weight:0,text:J,fontFamily:h(it),fontStyle:o(it),fontWeight:l(it),fontSize:R,rotate:g[~~(A()*g.length)],padding:f(it),opacity:I,visible:!0,color:nt,fillingColor:q,hasPlaced:U,datum:it}});C(O);let L=0;const{x1:D,y1:j,x2:H,y2:W}=b,[V,X]=[D+~~(A()*r*2),j+~~(A()*a*2)];for(let Q=X;Q<=W;Q+=a)for(let J=V;J<=H;J+=r){Do(S,x,O,L);const nt=O[L];nt.x=J,nt.y=Q;const{wordSize:q,bounds:U,hasPlaced:it}=nt;if(!it||!U){++L===O.length&&(L=0,_&&C(O));continue}const{dTop:ut,dBottom:ct,dLeft:Rt,dRight:mt}=U;nt.x-Rt<0||nt.x+mt>i[0]||nt.y-ut<0||nt.y+ct>i[1]||nt.hasText&&nt.sprite&&!LD(nt,m,y)&&(ID(nt,m,y),T.push(Object.assign({},nt)),++L===O.length&&(L=0,_&&C(O)))}}function C(R){return R.sort(()=>A()-.5)}}function ait(s,t,e){eit(s,e),t.layoutMode==="ensureMapping"?OD(s,t,e):t.layoutMode==="ensureMappingEnlarge"?sit(s,t,e):iit(s,t,e);const i=rit(s,t,e),n=[],r=[];for(let a=0;a<s.length;a++)s[a].hasPlaced?r.push(s[a]):n.push(s[a]);return n.forEach(a=>a.visible=!1),{fillingWords:i,successedWords:r,failedWords:n}}var oit=function(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(h){try{l(i.next(h))}catch(d){r(d)}}function o(h){try{l(i.throw(h))}catch(d){r(d)}}function l(h){var d;h.done?n(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(a,o)}l((i=i.apply(s,t||[])).next())})};const lit={x:"x",y:"y",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle",opacity:"opacity",visible:"visible",isFillingWord:"isFillingWord",color:"color"},hit=(s,t,e,i)=>oit(void 0,void 0,void 0,function*(){var n,r,a;if(!s.size||P(s.size[0])||P(s.size[1])||s.size[0]<=0||s.size[1]<=0)return Nt.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];s.size=[Math.ceil(s.size[0]),Math.ceil(s.size[1])],s.shape||vo("WordcloudShape shape must be specified."),s.text||vo("WordcloudShape text must be specified."),i!=null&&i.emit&&i.emit(T_.BEFORE_WORDCLOUD_SHAPE_LAYOUT);const o=t,l=s.as||lit;if(!o||o.length===0)return[];const h={shapeUrl:s.shape,size:s.size,ratio:s.ratio||.8,tempCanvas:void 0,tempCtx:void 0,removeWhiteBorder:s.removeWhiteBorder||!1,boardSize:[0,0],random:!1,randomGenerator:void 0},d=Gt.createCanvas({width:s.size[0],height:s.size[1]}),u=d.getContext("2d");u.textAlign="center",u.textBaseline="middle",h.tempCanvas=d,h.tempCtx=u;const c=s.size[0]+31>>5<<5;h.boardSize=[c,s.size[1]],h.random?h.randomGenerator=Math.random:h.randomGenerator=$et();const p=yield Zet(h);if(!p)return[];const g=Jet(p,h),f=s.colorMode||"ordinal",_={getText:as(s.text),getFontSize:as(s.fontSize),fontSizeRange:s.fontSizeRange,colorMode:f,getColor:s.colorField?as(s.colorField):as(s.text),getFillingColor:as(s.fillingColorField),colorList:s.colorList||(f==="ordinal"?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:as(s.colorHexField),getFontFamily:as(s.fontFamily||"sans-serif"),rotateList:s.rotateList||[0],getPadding:as(s.padding||1),getFontStyle:as(s.fontStyle||"normal"),getFontWeight:as(s.fontWeight||"normal"),getFontOpacity:s.fontOpacity?as(s.fontOpacity):()=>1};uit(o,_,g);const m={size:s.size,ratio:s.ratio||.8,shapeUrl:s.shape,random:s.random===void 0||s.random,textLayoutTimes:s.textLayoutTimes||3,removeWhiteBorder:s.removeWhiteBorder||!1,layoutMode:s.layoutMode||"default",fontSizeShrinkFactor:s.fontSizeShrinkFactor||.8,stepFactor:s.stepFactor||1,importantWordCount:s.importantWordCount||10,globalShinkLimit:s.globalShinkLimit||.2,fontSizeEnlargeFactor:s.fontSizeEnlargeFactor||1.5,fillingRatio:s.fillingRatio||.7,fillingTimes:s.fillingTimes||4,fillingXStep:s.fillingXRatioStep?Math.max(Math.floor(s.size[0]*s.fillingXRatioStep),1):s.fillingXStep||4,fillingYStep:s.fillingYRatioStep?Math.max(Math.floor(s.size[1]*s.fillingYRatioStep),1):s.fillingYStep||4,fillingInitialFontSize:s.fillingInitialFontSize,fillingDeltaFontSize:s.fillingDeltaFontSize,fillingInitialOpacity:s.fillingInitialOpacity||.8,fillingDeltaOpacity:s.fillingDeltaOpacity||.05,getFillingFontFamily:as(s.fillingFontFamily||"sans-serif"),getFillingFontStyle:as(s.fillingFontStyle||"normal"),getFillingFontWeight:as(s.fillingFontWeight||"normal"),getFillingPadding:as(s.fillingPadding||.4),fillingRotateList:s.fillingRotateList||[0,90],fillingDeltaFontSizeFactor:s.fillingDeltaFontSizeFactor||.2,fillingColorList:s.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:s.minInitFontSize||10,minFontSize:s.minFontSize||4,minFillFoontSize:s.minFillFoontSize||2},v=Uet(_.colorList,m.fillingColorList);m.sameColorList=v,dit(o,_,m,s),cit(o,_,m,g);const{getText:y,getFontFamily:b,getFontStyle:x,getFontWeight:S,getPadding:A,getColor:k,getFillingColor:w,getColorHex:T,fontSizeScale:M,colorScale:C,fillingColorScale:R,getFontOpacity:I,rotateList:O}=_,L=o.map(U=>{var it,ut;return{x:0,y:0,weight:0,text:y(U),fontFamily:b(U),fontWeight:S(U),fontStyle:x(U),rotate:O[~~(h.randomGenerator()*O.length)],fontSize:Math.max(m.minInitFontSize,~~M(U)),opacity:I(U),padding:A(U),color:T&&T(U)||C&&C(k(U))||"black",fillingColor:!w||((it=s.colorField)===null||it===void 0?void 0:it.field)===((ut=s.fillingColorField)===null||ut===void 0?void 0:ut.field)&&v?void 0:T&&T(U)||R&&R(w(U))||"black",datum:U,visible:!0,hasPlaced:!1}}),D=ei(L.map(U=>U.fontSize));L.forEach(U=>U.weight=U.fontSize/D),L.sort((U,it)=>it.weight-U.weight);const{fillingWords:j,successedWords:H,failedWords:W}=ait(L,m,g);let V,X;const Q=[];for(let U=0;U<L.length;++U)V=L[U],X=V.datum,X[l.x]=V.x,X[l.y]=V.y,X[l.fontFamily]=V.fontFamily,X[l.fontSize]=V.fontSize,X[l.fontStyle]=V.fontStyle,X[l.fontWeight]=V.fontWeight,X[l.angle]=ue(V.rotate),X[l.opacity]=V.opacity,X[l.visible]=V.visible,X[l.isFillingWord]=!1,X[l.color]=V.color,Q.push(X);const J=(r=(n=s.text)===null||n===void 0?void 0:n.field)!==null&&r!==void 0?r:"textKey",nt=(a=s.dataIndexKey)!==null&&a!==void 0?a:"defaultDataIndexKey",q=[];return j.forEach((U,it)=>{var ut,ct;const Rt={};Rt[l.x]=U.x,Rt[l.y]=U.y,Rt[l.fontFamily]=U.fontFamily,Rt[l.fontSize]=U.fontSize,Rt[l.fontStyle]=U.fontStyle,Rt[l.fontWeight]=U.fontWeight,Rt[l.angle]=ue(U.rotate),Rt[l.opacity]=U.opacity,Rt[l.visible]=U.visible,Rt[l.isFillingWord]=!0,Rt[l.color]=w?((ut=s.colorField)===null||ut===void 0?void 0:ut.field)===((ct=s.fillingColorField)===null||ct===void 0?void 0:ct.field)&&v?U.color:U.fillingColor:m.fillingColorList[~~(h.randomGenerator()*m.fillingColorList.length)],Rt[J]=U.text,Rt[nt]=`${U.text}_${it}_fillingWords`,q.push(Rt)}),i!=null&&i.emit&&i.emit(T_.AFTER_WORDCLOUD_SHAPE_LAYOUT,{successedWords:H,failedWords:W}),Q.concat(q)}),dit=(s,t,e,i)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:d}=t,{sameColorList:u}=e;let c,p,g=t.colorList,f=e.fillingColorList;if(l==="ordinal"){const _=s.map(m=>h(m));if(c=m=>new Po().domain(_).range(g).scale(m),d&&(((n=i.colorField)===null||n===void 0?void 0:n.field)!==((r=i.fillingColorField)===null||r===void 0?void 0:r.field)||!u)){const m=s.map(v=>d(v));p=v=>new Po().domain(m).range(f).scale(v)}}else{g.length===1&&(g=[g[0],g[0]]);const _=new un().domain(lu(h,s)).range(g);if(c=m=>_.scale(m),d&&(((a=i.colorField)===null||a===void 0?void 0:a.field)!==((o=i.fillingColorField)===null||o===void 0?void 0:o.field)||!u)){f.length===1&&(f=[f[0],f[0]]);const m=new un().domain(lu(d,s)).range(f);p=v=>m.scale(v)}}Object.assign(t,{colorScale:c,fillingColorScale:p})},uit=(s,t,e)=>{let{fontSizeRange:i}=t;const{getFontSize:n,getText:r}=t;let a;if(n){if(n&&i){const o=new Ef().domain(lu(n,s)).range(i);a=l=>o.scale(n(l))}else if(n&&K(n)&&!i){const[l,h]=lu(n,s),d=s.map(p=>({text:r(p),value:n(p),weight:h===l?1:(n(p)-l)/(h-l)})),u=rP(d,e,!0);i=[~~(.5*u),~~u];const c=new Ef().domain(lu(n,s)).range(i);a=p=>c.scale(n(p))}}else{const o=s.map(h=>({text:r(h)})),l=rP(o,e,!1);a=Ket(l)}Object.assign(t,{getFontSize:n,fontSizeRange:i,fontSizeScale:a})},rP=(s,t,e)=>{const i=t.shapeArea,n=t.ratio,r=t.segmentation.regions,a=Math.ceil(Math.sqrt(i)/12),o=s.reduce((h,d)=>{const u=RD(d.text);return u<a?h+u*(e?(.5+.5*d.weight)**2:1):h},0);if(o===0)return 12;let l=20;if(r.length===1)l=Math.sqrt(n*(i/(1.7*o)));else{const h=[];for(let d=0;d<r.length;d++){const u=r[d].area,c=r[d].ratio,p=u/i;if(p<.1)continue;const g=p*(o*(c<1?2.7-c:1.7)),f=Math.sqrt(n*(u/g));h.push(f)}l=h.length?Math.min(...h):Math.sqrt(n*(i/(1.7*o)))}return l};function cit(s,t,e,i){const{getText:n}=t;let{fillingInitialFontSize:r,fillingDeltaFontSize:a}=e;const{fillingRatio:o}=e,l=Math.ceil(Math.sqrt(i.shapeArea)/4);if(!r||!a){const h=o/100,d=s.reduce((c,p)=>{const g=RD(n(p));return g>l?c:c+g},0)/s.length;let u;if(d===0)u=8;else{const c=.2*i.shapeArea;u=Math.sqrt(h*(c/d))}r=~~u,a=u*e.fillingDeltaFontSizeFactor,Object.assign(e,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}const lu=(s,t)=>{let e=1/0,i=-1/0;const n=t.length;let r;for(let a=0;a<n;++a)r=Qn(s(t[a])),r<e&&(e=r),r>i&&(i=r);return t.length===1&&e===i&&(e-=1e4),[e,i]},as=s=>s?typeof s=="string"||typeof s=="number"?()=>s:K(s)?s:t=>t[s.field]:null,BD=()=>{st.registerTransform("wordcloudShape",{transform:hit,markPhase:"beforeJoin"},!0)};class hc extends La{constructor(){super(...arguments),this.type=z.wordCloud}}hc.type=z.wordCloud;const DD=()=>{ov(),Gs(),TD(),F.registerSeries(hc.type,hc)},pit=()=>{BD(),ov(),Gs(),TD(),F.registerSeries(hc.type,hc)};class dc extends La{constructor(){super(...arguments),this.type=z.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:(t=this._spec.postProjection)!==null&&t!==void 0?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:(t=this._spec.postProjection)!==null&&t!==void 0?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(La.mark.word,{groupKey:this._seriesField,support3d:!0,isSeriesMark:!0}),this._isWordCloudShape&&(this._fillingWordMark=this._createMark(La.mark.fillingWord,{groupKey:this._seriesField,support3d:!0,isSeriesMark:!0}))}initMarkStyle(){super.initMarkStyle();const t=this._wordMark,e=this._fillingWordMark;t&&this.setMarkStyle(t,{z:i=>{var n;return(n=i.z)!==null&&n!==void 0?n:0}},"normal",tt.Series),e&&this.setMarkStyle(e,{z:i=>{var n;return(n=i.z)!==null&&n!==void 0?n:0}},"normal",tt.Series)}initAnimation(){var t,e,i;const n=(t=this._padding)!==null&&t!==void 0?t:{};this._wordMark&&this._wordMark.setAnimationConfig(zt((e=F.getAnimationInKey("wordCloud3d"))===null||e===void 0?void 0:e(()=>{var r;const a=this.getCompiler().getVGrammarView(),o=a.width()-n.left||0-n.right||0,l=a.height()-n.top||0-n.bottom||0,h=Math.max(o,l)/2;return{center:{x:h,y:h,z:(r=this._spec.depth_3d)!==null&&r!==void 0?r:h},r:h}}),Yt("word",this._spec,this._markAttributeContext))),this._fillingWordMark&&this._fillingWordMark.setAnimationConfig(zt((i=F.getAnimationInKey("wordCloud3d"))===null||i===void 0?void 0:i(()=>{var r;const a=this.getCompiler().getVGrammarView(),o=a.width()-n.left||0-n.right||0,l=a.height()-n.top||0-n.bottom||0,h=Math.max(o,l)/2;return{center:{x:h,y:h,z:(r=this._spec.depth_3d)!==null&&r!==void 0?r:h},r:h}}),Yt("fillingWord",this._spec,this._markAttributeContext)))}}dc.type=z.wordCloud3d;const FD=()=>{ov(),Gs(),MD(),F.registerSeries(dc.type,dc)},git=()=>{BD(),ov(),Gs(),MD(),F.registerSeries(dc.type,dc)},fit=(s,t)=>{var e,i;const n=s.map(x=>Object.assign({},x));if(!n||n.length===0)return n;const{valueField:r,asTransformRatio:a,asReachRatio:o,asHeightRatio:l,asValueRatio:h,asNextValueRatio:d,asLastValueRatio:u,asLastValue:c,asCurrentValue:p,asNextValue:g,heightVisual:f=!1,isCone:_=!0,range:m}=t,v=n.reduce((x,S)=>Math.max(x,Number.parseFloat(S[r])||-1/0),-1/0),y=n.reduce((x,S)=>Math.min(x,Number.parseFloat(S[r])||1/0),1/0),b=[(e=m==null?void 0:m.min)!==null&&e!==void 0?e:y,(i=m==null?void 0:m.max)!==null&&i!==void 0?i:v];return n.forEach((x,S)=>{var A,k;const w=Number.parseFloat(x[r]),T=Number.parseFloat((A=n[S-1])===null||A===void 0?void 0:A[r]),M=Number.parseFloat((k=n[S+1])===null||k===void 0?void 0:k[r]),C=N(M*w)&&w!==0?M/w:0,R=N(w*T)&&T!==0?w/T:0;c&&(x[c]=T),g&&(x[g]=M),a&&(x[a]=C),o&&(x[o]=S===0?1:R),l&&(x[l]=f===!0?C:1/n.length),h&&(x[h]=w/b[1]),d&&(x[d]=S===n.length-1?_?0:x[h]:M/b[1]),u&&(x[u]=S===0?1:T/b[1]),p&&(x[p]=w)}),n},_it=(s,t)=>{var e,i;const n=(i=(e=s[0])===null||e===void 0?void 0:e.latestData)===null||i===void 0?void 0:i.map(r=>Object.assign({},r));return n&&n.length!==0&&(n.shift(),n.forEach(r=>{r[t.asIsTransformLevel]=!0})),n},mit=`${At}_FUNNEL_TRANSFORM_RATIO`,Tx=`${At}_FUNNEL_REACH_RATIO`,vit=`${At}_FUNNEL_HEIGHT_RATIO`,Xp=`${At}_FUNNEL_VALUE_RATIO`,aP=`${At}_FUNNEL_LAST_VALUE_RATIO`,oP=`${At}_FUNNEL_NEXT_VALUE_RATIO`,yit=`${At}_FUNNEL_LAST_VALUE`,bit=`${At}_FUNNEL_CURRENT_VALUE`,xit=`${At}_FUNNEL_NEXT_VALUE`,lP=`${At}_FUNNEL_TRANSFORM_LEVEL`,_r=20,oo=5,Sit="80%",Ait=0;class kit extends ys{constructor(){super(...arguments),this.titleValueCallback=(t,e)=>{var i,n,r;const a=this.series;return((i=e==null?void 0:e.mark)===null||i===void 0?void 0:i.name)==="transform"?"转化率":(n=this._getDimensionData(t))!==null&&n!==void 0?n:(r=t.properties)===null||r===void 0?void 0:r[`${a.getCategoryField()}`]},this.contentValueCallback=(t,e)=>{var i;return((i=e==null?void 0:e.mark)===null||i===void 0?void 0:i.name)==="transform"?`${(100*(t==null?void 0:t[Tx])).toFixed(1)}%`:this._getMeasureData(t)},this.contentKeyCallback=(t,e)=>{var i;if(((i=e==null?void 0:e.mark)===null||i===void 0?void 0:i.name)==="transform")return"转化率";const{dimensionFields:n,seriesFields:r}=this._seriesCacheInfo,a=n[n.length-1];return E(r[0])?t==null?void 0:t[r[0]]:t==null?void 0:t[a]}}}class jD extends Hi{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class uc extends jD{constructor(){super(...arguments),this.type=uc.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}uc.type="polygon";const wit=()=>{F.registerMark(uc.type,uc),t9(),zB()};class xA extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class En extends Io{constructor(){super(...arguments),this.type=z.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=xA,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=(t=this._spec.funnelOrient)!==null&&t!==void 0?t:"top",this._shape=(e=this._spec.shape)!==null&&e!==void 0?e:"trapezoid",this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;Ct(this._dataSet,"funnel",fit),Ct(this._dataSet,"funnelTransform",_it);const t=new Jt(this._dataSet,{name:`${At}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new or(this._option,t)}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t,e,i,n,r,a,o,l,h;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:bit,asTransformRatio:mit,asReachRatio:Tx,asHeightRatio:vit,asValueRatio:Xp,asNextValueRatio:oP,asLastValueRatio:aP,asLastValue:yit,asNextValue:xit,range:{min:(e=(t=this._spec.range)===null||t===void 0?void 0:t.min)!==null&&e!==void 0?e:(n=(i=this.getViewDataStatistics().latestData)===null||i===void 0?void 0:i[this.getValueField()])===null||n===void 0?void 0:n.min,max:(a=(r=this._spec.range)===null||r===void 0?void 0:r.max)!==null&&a!==void 0?a:(l=(o=this.getViewDataStatistics().latestData)===null||o===void 0?void 0:o[this.getValueField()])===null||l===void 0?void 0:l.max}}}),(h=this._viewDataTransform.getDataView())===null||h===void 0||h.transform({type:"funnelTransform",options:{asIsTransformLevel:lP}})}initMark(){var t,e,i,n,r,a,o,l,h,d;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},En.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:(t=this._theme)===null||t===void 0?void 0:t.funnel,morph:Yr(this._spec,this._funnelMarkName),defaultMorphElementKey:this._seriesField,groupKey:this._seriesField,isSeriesMark:!0,customShape:(e=this._spec.funnel)===null||e===void 0?void 0:e.customShape}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},En.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:(i=this._theme)===null||i===void 0?void 0:i.transform,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId(),customShape:(n=this._spec.transform)===null||n===void 0?void 0:n.customShape})),(a=(r=this._spec)===null||r===void 0?void 0:r.outerLabel)===null||a===void 0?void 0:a.visible){const{line:u}=(o=this._spec.outerLabel)!==null&&o!==void 0?o:{},{line:c}=(h=(l=this._theme)===null||l===void 0?void 0:l.outerLabel)!==null&&h!==void 0?h:{};this._funnelOuterLabelMark.label=this._createMark(En.mark.outerLabel,{themeSpec:(d=this._theme)===null||d===void 0?void 0:d.outerLabel,markSpec:this._spec.outerLabel,skipBeforeLayouted:!0}),this._funnelOuterLabelMark.line=this._createMark(En.mark.outerLabelLine,{themeSpec:c,markSpec:u,depend:[this._funnelOuterLabelMark.label]})}}initTooltip(){this._tooltipHelper=new kit(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return[this._valueField]}getGroupFields(){return null}initMarkStyle(){const t=this._funnelMark;t&&(this.setMarkStyle(t,{points:r=>this.getPoints(r),visible:r=>E(r[this._valueField]),fill:this.getColorAttribute()},"normal",tt.Series),this._trigger.registerMark(t));const e=this._funnelTransformMark;e&&(this.setMarkStyle(e,{points:r=>this.getPoints(r)},"normal",tt.Series),this._trigger.registerMark(e));const i=this._funnelOuterLabelMark.label;i&&this.setMarkStyle(i,{text:r=>{const a=`${r[this.getCategoryField()]}`;return K(this._spec.outerLabel.formatMethod)?this._spec.outerLabel.formatMethod(a,r):a},x:r=>this._computeOuterLabelPosition(r).x,y:r=>this._computeOuterLabelPosition(r).y,textAlign:r=>this._computeOuterLabelPosition(r).align,textBaseline:r=>this._computeOuterLabelPosition(r).textBaseline,limit:r=>this._computeOuterLabelLimit(r)},"normal",tt.Series);const n=this._funnelOuterLabelMark.line;n&&i&&this.setMarkStyle(n,{x:r=>this._computeOuterLabelLinePosition(r).x1,y:r=>this._computeOuterLabelLinePosition(r).y1,x1:r=>this._computeOuterLabelLinePosition(r).x2,y1:r=>this._computeOuterLabelLinePosition(r).y2},"normal",tt.Series)}initLabelMarkStyle(t){var e,i;if(!t)return;const n=t.getTarget(),r=t.getComponent();n===this._funnelMark?(this._labelMark=t,this.setMarkStyle(t,{text:a=>`${a[this.getCategoryField()]} ${a[this.getValueField()]}`,x:a=>this._computeLabelPosition(a).x,y:a=>this._computeLabelPosition(a).y,maxLineWidth:a=>this._computeLabelLimit(a,this._spec.label),stroke:this.getColorAttribute()},"normal",tt.Series),!((e=this._funnelOuterLabelMark)===null||e===void 0)&&e.label&&this._funnelOuterLabelMark.label.setDepend(r),!((i=this._funnelOuterLabelMark)===null||i===void 0)&&i.line&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())):this._funnelTransformMark&&n===this._funnelTransformMark&&(this._transformLabelMark=t,this.setMarkStyle(t,{text:a=>`${(100*gg(Tx).bind(this)(a)).toFixed(1)}%`,x:a=>this._computeLabelPosition(a).x,y:a=>this._computeLabelPosition(a).y,maxLineWidth:a=>this._computeLabelLimit(a,this._spec.transformLabel)},"normal",tt.Series))}initAnimation(){var t,e,i,n,r,a,o;const l=(i=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset)!==null&&i!==void 0?i:"clipIn";l==="clipIn"&&this._rootMark&&this._rootMark.setAnimationConfig(zt((n=F.getAnimationInKey("cartesianGroupClip"))===null||n===void 0?void 0:n({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const h=this.getRootMark().getProduct();if(h){const{x1:d,x2:u}=h.getBounds();return Math.max(d,u)}return this.getLayoutRect().width},height:()=>{const h=this.getRootMark().getProduct();if(h){const{y1:d,y2:u}=h.getBounds();return Math.max(d,u)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},l),Yt("group",this._spec,this._markAttributeContext))),[(r=this._funnelOuterLabelMark)===null||r===void 0?void 0:r.label].forEach(h=>{h&&h.setAnimationConfig(zt(F.getAnimationInKey("fadeInOut")(),Yt(h.name,this._spec,this._markAttributeContext)))}),[this._funnelMark,this._funnelTransformMark].forEach(h=>{h&&h.setAnimationConfig(zt(F.getAnimationInKey("funnel")({},l),Yt(h.name,this._spec,this._markAttributeContext)))}),!((a=this._funnelOuterLabelMark)===null||a===void 0)&&a.line&&this._funnelOuterLabelMark.line.setAnimationConfig(zt((o=F.getAnimationInKey("fadeInOut"))===null||o===void 0?void 0:o(),Yt("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),(t=this._viewDataTransform.getDataView())===null||t===void 0||t.target.addListener("change",e=>{this._viewDataTransform.updateData()})}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let n,r;e?(n=this._shape==="rect"?this._getSecondaryAxisLength(t[aP])/2:this._getSecondaryAxisLength(t[Xp])/2,r=this._getSecondaryAxisLength(t[Xp])/2):(n=this._getSecondaryAxisLength(t[Xp])/2,r=this._shape==="rect"?n:this._getSecondaryAxisLength(t[oP])/2);const{x:a,y:o}=this._getPositionByData(t),l=this._getPolygonPoints([a,o],n,r,n,r,i);return this._funnelAlign!=="center"&&this._adjustPoints(l),l}isTransformLevel(t){return!!(t!=null&&t[lP])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this)}valueToPosition(t){var e,i,n;const r=(n=(i=(e=this.getViewData())===null||e===void 0?void 0:e.latestData)===null||i===void 0?void 0:i.find)===null||n===void 0?void 0:n.call(i,a=>a[this._categoryField]===t);return E(r)?this._getPolygonCenter(this.getPoints(r)):null}dataToPosition(t){return this.valueToPosition(t[this._categoryField])}dataToPositionX(t){return this.dataToPosition(t).x}dataToPositionY(t){return this.dataToPosition(t).y}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,n=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,r=!!this._spec.isTransform,a=r?0:(e=this._spec.gap)!==null&&e!==void 0?e:0,o=r?Math.max(0,i-1):0,l=(n-a*Math.max(0,i-1))/(i+.5*o);return t?r?.5*l:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),n=this._computeMinSize();return n+(i-n)*e}_getPositionByData(t){var e;const i=(e=this.getViewData().latestData)===null||e===void 0?void 0:e.findIndex(c=>c[this._categoryField]===t[this._categoryField]&&c[ar]===t[ar]);if(!E(i)||i<0)return{};const n=this.isTransformLevel(t),r=this._isHorizontal(),a=r?this.getLayoutRect().height:this.getLayoutRect().width,o=r?this.getLayoutRect().width:this.getLayoutRect().height,l=a/2;let h=0;const d=this._getMainAxisLength(),u=this._getMainAxisLength(!0);return h+=i*(d+u),h+=n?-u/2:d/2,!this._spec.isTransform&&this._spec.gap&&(h+=this._spec.gap*i),this._isReverse()&&(h=o-h),this._isHorizontal()?{x:h,y:l}:{x:l,y:h}}_getPolygonPoints(t,e,i,n,r,a){const o=t[0],l=t[1];switch(this._funnelOrient){case"left":return[{x:o-a,y:l+e},{x:o-a,y:l-n},{x:o+a,y:l-r},{x:o+a,y:l+i}];case"right":return[{x:o+a,y:l-n},{x:o+a,y:l+n},{x:o-a,y:l+i},{x:o-a,y:l-i}];case"bottom":return[{x:o+e,y:l+a},{x:o-n,y:l+a},{x:o-r,y:l-a},{x:o+i,y:l-a}];default:return[{x:o-e,y:l-a},{x:o+n,y:l-a},{x:o+r,y:l+a},{x:o-i,y:l+a}]}}_getPolygonCenter(t){if(this._isHorizontal()){const n=(t[0].x+t[3].x)/2,r=(t[0].y+t[3].y)/2;return{x:(n+(t[1].x+t[2].x)/2)/2,y:(r+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,n;return this._isHorizontal()?(n="y",this._funnelOrient==="left"?(e=this._funnelAlign==="bottom"?-t[1].y:t[1].y,i=this._funnelAlign==="bottom"?-t[2].y:t[2].y):(e=this._funnelAlign==="bottom"?-t[0].y:t[0].y,i=this._funnelAlign==="bottom"?-t[3].y:t[3].y)):(n="x",this._funnelOrient==="top"?(e=this._funnelAlign==="left"?t[0].x:-t[0].x,i=this._funnelAlign==="left"?t[3].x:-t[3].x):(e=this._funnelAlign==="left"?t[1].x:-t[1].x,i=this._funnelAlign==="left"?t[2].x:-t[2].x)),t[0][n]-=e,t[1][n]-=e,t[2][n]-=i,t[3][n]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=e==null?void 0:e.limit;if(dt(i))return i;const n=this.getPoints(t);return i==="shapeSize"?this._isHorizontal()?Math.abs(n[3].x-n[0].x):(Math.abs(n[0].x-n[1].x)+Math.abs(n[2].x-n[3].x))/2:this._isHorizontal()?Math.abs(n[3].x-n[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let n,r,a=(e=this._spec.outerLabel)===null||e===void 0?void 0:e.position,o="center",l="middle";if(a=this._isHorizontal()?["top","bottom"].includes(a)?a:this._funnelAlign==="bottom"?"top":"bottom":["left","right"].includes(a)?a:this._funnelAlign==="left"?"right":"left",((i=this._spec.outerLabel)===null||i===void 0?void 0:i.alignLabel)!==!1)({x:n,y:r}=this._getPositionByData(t)),a==="left"?(n=0,o="left"):a==="right"?(n=this.getLayoutRect().width,o="right"):a==="top"?(r=0,l="top"):a==="bottom"&&(r=this.getLayoutRect().height,l="bottom");else{const{x2:h,y2:d}=this._computeOuterLabelLinePosition(t);n=h,r=d,a==="left"?(n-=oo,o="right"):a==="right"?(n+=oo,o="left"):a==="top"?(r-=oo,l="bottom"):a==="bottom"&&(r+=oo,l="top")}return{x:n,y:r,align:o,textBaseline:l}}_computeOuterLabelLimit(t){var e,i,n,r,a;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const o=this.getPoints(t),l=(Math.abs(o[0].x-o[1].x)+Math.abs(o[2].x-o[3].x))/2,h=this.getCategoryField(),d=(n=(i=(e=this._labelMark)===null||e===void 0?void 0:e.getComponent())===null||i===void 0?void 0:i.getProduct().getGroupGraphicItem().find(({attribute:c,type:p})=>{var g;return p==="text"&&((g=c.data)===null||g===void 0?void 0:g[h])===t[h]},!0))===null||n===void 0?void 0:n.AABBBounds,u=d?d.x2-d.x1:0;return this.getLayoutRect().width/2-Math.max(l/2,u/2)-_r-2*((a=(r=this._spec.outerLabel)===null||r===void 0?void 0:r.spaceWidth)!==null&&a!==void 0?a:oo)}_computeOuterLabelLinePosition(t){var e,i,n,r,a,o,l,h,d,u,c;const p=this.getCategoryField(),g=(a=(r=(n=(i=(e=this._funnelOuterLabelMark)===null||e===void 0?void 0:e.label)===null||i===void 0?void 0:i.getProduct())===null||n===void 0?void 0:n.elements)===null||r===void 0?void 0:r.find(w=>{var T;return((T=w.data[0])===null||T===void 0?void 0:T[p])===t[p]}))===null||a===void 0?void 0:a.getBounds(),f=(h=(l=(o=this._labelMark)===null||o===void 0?void 0:o.getComponent())===null||l===void 0?void 0:l.getProduct().getGroupGraphicItem().find(({attribute:w,type:T})=>{var M;return T==="text"&&((M=w.data)===null||M===void 0?void 0:M[p])===t[p]},!0))===null||h===void 0?void 0:h.AABBBounds,_=(d=this._spec.outerLabel)!==null&&d!==void 0?d:{};let m,v,y,b;if(this._isHorizontal()){const w=(u=_.spaceWidth)!==null&&u!==void 0?u:oo,T=this.getPoints(t),M=(Math.abs(T[0].y-T[1].y)+Math.abs(T[2].y-T[3].y))/2;return this._spec.outerLabel.position==="top"||this._funnelAlign==="bottom"?(y=this._getPolygonCenter(T).y-M/2-w,b=_.alignLabel!==!1?(g==null?void 0:g.y2)+w:y-w,m=this._getPolygonCenter(T).x,y-b<_r&&(b=y-_r),v=m):(y=this._getPolygonCenter(T).y+M/2+w,b=_.alignLabel!==!1?(g==null?void 0:g.y1)-w:y+w,m=this._getPolygonCenter(T).x,b-y<_r&&(b=y+_r),v=m),{x1:m,x2:v,y1:y,y2:b}}const x=this.getPoints(t),S=(Math.abs(x[0].x-x[1].x)+Math.abs(x[2].x-x[3].x))/2,A=(f==null?void 0:f.x2)-(f==null?void 0:f.x1)||0,k=(c=_.spaceWidth)!==null&&c!==void 0?c:oo;return this._spec.outerLabel.position==="right"||this._funnelAlign==="left"?(m=this._getPolygonCenter(x).x+Math.max(A/2,S/2)+k,v=_.alignLabel!==!1?(g==null?void 0:g.x1)-k:m+k,y=this._getPolygonCenter(x).y,v-m<_r&&(v=m+_r),b=y):(m=this._getPolygonCenter(x).x-Math.max(A/2,S/2)-k,v=_.alignLabel!==!1?(g==null?void 0:g.x2)+k:m-k,y=this._getPolygonCenter(x).y,m-v<_r&&(v=m-_r),b=y),{x1:m,x2:v,y1:y,y2:b}}_computeMaxSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width,i=(t=this._spec.maxSize)!==null&&t!==void 0?t:Sit;return Xi(i,e)}_computeMinSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width,i=(t=this._spec.minSize)!==null&&t!==void 0?t:Ait;return Xi(i,e)}_isHorizontal(){return this._funnelOrient==="left"||this._funnelOrient==="right"}_isReverse(){return this._funnelOrient==="bottom"||this._funnelOrient==="right"}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._funnelMark]}}En.type=z.funnel,En.mark=GL,En.transformerConstructor=xA;const Tit=()=>{wit(),Gs(),Vc(),F.registerSeries(En.type,En),F.registerAnimation("funnel",(s,t)=>Object.assign({appear:t==="clipIn"?void 0:{type:"fadeIn"}},tv)),OJ(),$r()};class cc extends jD{constructor(){super(...arguments),this.type=cc.type}}cc.type="pyramid3d";const Mit=()=>{F.registerMark(cc.type,cc),XX(),zB()};class zD extends xA{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class sr extends En{constructor(){super(...arguments),this.type=z.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=zD}initMark(){var t,e,i,n,r,a,o,l;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},sr.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:(t=this._theme)===null||t===void 0?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0,support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},sr.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:(e=this._theme)===null||e===void 0?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),(n=(i=this._spec)===null||i===void 0?void 0:i.outerLabel)===null||n===void 0?void 0:n.visible){const{line:h}=(r=this._spec.outerLabel)!==null&&r!==void 0?r:{},{line:d}=(o=(a=this._theme)===null||a===void 0?void 0:a.outerLabel)!==null&&o!==void 0?o:{};this._funnelOuterLabelMark.label=this._createMark(sr.mark.outerLabel,{themeSpec:(l=this._theme)===null||l===void 0?void 0:l.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(sr.mark.outerLabelLine,{themeSpec:d,key:this._seriesField,markSpec:h,depend:[this._funnelOuterLabelMark.label]})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:e=>{if(this._isHorizontal())return 0;const i=this.getPoints(e),n=Math.max(Math.abs(i[0].x-i[1].x),Math.abs(i[2].x-i[3].x));return(this._computeMaxSize()-n)/2}},"normal",tt.Series)}initLabelMarkStyle(t){var e,i;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:n=>{if(this._isHorizontal())return 0;const r=this.getPoints(n),a=Math.max(Math.abs(r[0].x-r[1].x),Math.abs(r[2].x-r[3].x));return(this._computeMaxSize()-a)/2}},"normal",tt.Series),this._labelMark=t,!((e=this._funnelOuterLabelMark)===null||e===void 0)&&e.label&&this._funnelOuterLabelMark.label.setDepend(t.getComponent()),!((i=this._funnelOuterLabelMark)===null||i===void 0)&&i.line&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())}}sr.type=z.funnel3d,sr.mark=WL,sr.transformerConstructor=zD;const Cit=()=>{Mit(),Gs(),Vc(),F.registerSeries(sr.type,sr)},C_=(s,t)=>{const e=(s-t[0])/(t[1]-t[0]||1);return Math.max(0,Math.min(1,e))},P_=s=>{const t=s.mark.elements.filter(i=>i.diffState===ne.update),e=ki(t.map(i=>{var n;return(n=i==null?void 0:i.data)===null||n===void 0?void 0:n[0].depth}));return t.filter(i=>{var n;return((n=i==null?void 0:i.data)===null||n===void 0?void 0:n[0].depth)===e})},hP=(s,t,e)=>vt(s)?[t,e]:[ki(s.map(i=>1*i.getGraphicAttribute("startAngle",!1))),ei(s.map(i=>1*i.getGraphicAttribute("endAngle",!1)))],Pit=s=>({channel:{startAngle:{from:(t,e)=>{const{startAngle:i,endAngle:n}=s.animationInfo(),r=P_(e),a=hP(r,i,n);return C_(t.startAngle,a)*(n-i)+i},to:t=>t.startAngle},endAngle:{from:(t,e)=>{const{startAngle:i,endAngle:n}=s.animationInfo(),r=P_(e),a=hP(r,i,n);return C_(t.endAngle,a)*(n-i)+i},to:t=>t.endAngle},outerRadius:{from:t=>t.innerRadius,to:t=>t.outerRadius},innerRadius:{from:t=>t.innerRadius,to:t=>t.innerRadius}}}),dP=s=>[ki(s.map(t=>1*t.getGraphicAttribute("startAngle",!1))),ei(s.map(t=>1*t.getGraphicAttribute("endAngle",!1)))],uP=s=>({channel:{startAngle:{from:(t,e)=>e.getGraphicAttribute("startAngle",!1),to:(t,e)=>{const{startAngle:i,endAngle:n}=s.animationInfo(),r=P_(e),a=dP(r);return C_(e.getGraphicAttribute("startAngle",!1),a)*(n-i)+i}},endAngle:{from:(t,e)=>e.getGraphicAttribute("endAngle",!1),to:(t,e)=>{const{startAngle:i,endAngle:n}=s.animationInfo(),r=P_(e),a=dP(r);return C_(e.getGraphicAttribute("endAngle",!1),a)*(n-i)+i}},outerRadius:{from:(t,e)=>e.getGraphicAttribute("outerRadius",!1),to:()=>s.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getGraphicAttribute("innerRadius",!1),to:()=>s.animationInfo().innerRadius}}}),Eit=(s,t)=>{switch(t){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},Rit=()=>{F.registerAnimation("sunburst",(s,t)=>({appear:Eit(s,t),enter:Pit(s),exit:uP(s),disappear:uP(s)}))},HD=(s,t=[],e)=>{const i=(e==null?void 0:e.maxDepth)>=0;return s.forEach(n=>{(!i||n.depth<=e.maxDepth)&&(t.push(e!=null&&e.callback?e.callback(n):n),n.children&&(i&&n.depth===e.maxDepth?(n.children=null,n.isLeaf=!0):HD(n.children,t,e)))}),t};function Oit(s,t,e,i,n){const r=s.children,a=r.length;let o=0;const l=new Array(a+1);l[0]=0;for(let d=0;d<a;++d)o+=r[d].value,l[d+1]=o;const h=(d,u,c,p,g,f,_)=>{if(d>=u-1){const A=r[d];return A.x0=p,A.y0=g,A.x1=f,void(A.y1=_)}const m=l[d],v=c/2+m;let y=d+1,b=u-1;for(;y<b;){const A=y+b>>>1;l[A]<v?y=A+1:b=A}v-l[y-1]<l[y]-v&&d+1<y&&--y;const x=l[y]-m,S=c-x;if(f-p>_-g){const A=c?(p*S+f*x)/c:f;h(d,y,x,p,g,A,_),h(y,u,S,A,g,f,_)}else{const A=c?(g*S+_*x)/c:_;h(d,y,x,p,g,f,A),h(y,u,S,p,A,f,_)}};h(0,a,s.value,t,e,i,n)}function lv(s,t,e,i,n,r={x0:"x0",x1:"x1",y0:"y0",y1:"y1"}){const a=s.children;let o,l=-1;const h=a.length,d=s.value&&(i-t)/s.value;for(;++l<h;)o=a[l],o[r.y0]=e,o[r.y1]=n,o[r.x0]=t,o[r.x1]=t+=o.value*d}function SA(s,t,e,i,n){const r=s.children;let a,o=-1;const l=r.length,h=s.value&&(n-e)/s.value;for(;++o<l;)a=r[o],a.x0=t,a.x1=i,a.y0=e,e+=a.value*h,a.y1=e}function Iit(s,t,e,i,n){(s.depth%2==1?SA:lv)(s,t,e,i,n)}function Lit(s,t,e,i,n,r){const a=[],o=t.children;let l,h,d=0,u=0;const c=o.length;let p,g,f,_,m,v,y,b,x,S=t.value;for(;d<c;){p=n-e,g=r-i;do f=o[u++].value;while(!f&&u<c);for(_=f,m=f,b=Math.max(g/p,p/g)/(S*s),x=f*f*b,y=Math.max(m/x,x/_);u<c;++u){if(h=o[u].value,f+=h,h<_&&(_=h),h>m&&(m=h),x=f*f*b,v=Math.max(m/x,x/_),v>y){f-=h;break}y=v}l=Object.assign({},t,{value:f,children:o.slice(d,u)}),a.push(l),p<g?lv(l,e,i,n,S?i+=g*f/S:r):SA(l,e,i,S?e+=p*f/S:n,r),S-=f,d=u}return a}const Bit=s=>(t,e,i,n,r)=>{Lit(s,t,e,i,n,r)},hv=(s,t,e=0,i=-1,n,r)=>{let a=0,o=i??-1,l=e;return s.forEach((h,d)=>{var u,c;const p={flattenIndex:++o,key:r?r(h):`${(u=n==null?void 0:n.key)!==null&&u!==void 0?u:""}-${d}`,maxDepth:-1,depth:e,index:d,value:h.value,isLeaf:!0,datum:n?n.datum.concat(h):[h],parentKey:n==null?void 0:n.key};if(!((c=h.children)===null||c===void 0)&&c.length){p.children=[],p.isLeaf=!1;const g=hv(h.children,p.children,e+1,o,p,r);p.value=P(h.value)?g.sum:Math.max(g.sum,p.value),o=g.flattenIndex,l=Math.max(g.maxDepth,l)}else p.isLeaf=!0,p.value=P(h.value)?0:h.value;a+=Math.abs(p.value),t.push(p)}),{sum:a,maxDepth:l,flattenIndex:o}},pl=(s,t,e,i)=>{let n=i;return s.forEach((r,a)=>{var o;n=t(r,a,e,n),!((o=r.children)===null||o===void 0)&&o.length&&(n=pl(r.children,t,r,n))}),i},Sg=(s,t,e,i)=>{let n=i;return s.forEach((r,a)=>{var o;!((o=r.children)===null||o===void 0)&&o.length&&(n=Sg(r.children,t,r,n)),n=t(r,a,e,n)}),n},cP={binary:Oit,dice:lv,slice:SA,sliceDice:Iit};class dv{constructor(t){var e;this._filterByArea=(r,a)=>{var o;const l=this._getMinAreaByDepth(r.depth);if(l>0&&r.value*a<l)return!1;if(!((o=r.children)===null||o===void 0)&&o.length){const h=r.children.filter(d=>this._filterByArea(d,a));h.length?h.length!==r.children.length&&(r.children=h):(r.isLeaf=!0,r.children=null)}return!0},this._getMinAreaByDepth=r=>{var a;return r<0?0:(a=$(this.options.minVisibleArea)?this.options.minVisibleArea[r]:this.options.minVisibleArea)!==null&&a!==void 0?a:0},this._getGapWidthByDepth=r=>{var a;return r<0?0:(a=$(this.options.gapWidth)?this.options.gapWidth[r]:this.options.gapWidth)!==null&&a!==void 0?a:0},this._getPaddingByDepth=r=>{var a;return r<0?0:(a=$(this.options.padding)?this.options.padding[r]:this.options.padding)!==null&&a!==void 0?a:0},this._getLabelPaddingByDepth=r=>{var a;return r<0?0:(a=$(this.options.labelPadding)?this.options.labelPadding[r]:this.options.labelPadding)!==null&&a!==void 0?a:0},this._layoutNode=r=>{const a=this._getGapWidthByDepth(r.depth);let o=r.x0,l=r.y0,h=r.x1,d=r.y1;if(r.maxDepth=this._maxDepth,a>0&&(o+=a/2,h-=a/2,l+=a/2,d-=a/2,o>h&&(o=(o+h)/2,h=o),l>d&&(l=(l+d)/2,d=l),r.x0=o,r.x1=h,r.y0=l,r.y1=d),r.children){const u=this._getLabelPaddingByDepth(r.depth),c=this._getPaddingByDepth(r.depth);c>0&&c<Math.min(h-o,d-l)/2&&(l+=c,d-=c,o+=c,h-=c),u>0&&(this.options.labelPosition==="top"&&l+u<d?(r.labelRect={x0:o,y0:l,x1:h,y1:l+u},l+=u):this.options.labelPosition==="bottom"&&d-u>l?(r.labelRect={x0:o,y0:d-u,x1:h,y1:d},d-=u):this.options.labelPosition==="left"&&o+u<h?(r.labelRect={x0:o,y0:l,x1:o+u,y1:d},o+=u):this.options.labelPosition==="right"&&h-u>o&&(r.labelRect={x0:h-u,y0:l,x1:h,y1:d},h-=u));const p=this._getGapWidthByDepth(r.depth+1);p>0&&(o-=p/2,h+=p/2,l-=p/2,d+=p/2),this._splitNode(r,o,l,h,d)}},this.options=Object.assign({},dv.defaultOpionts,t);const i=this.options.nodeKey,n=K(i)?i:i?In(i):null;this._getNodeKey=n,this._splitNode=this.options.splitType==="squarify"?Bit(this.options.aspectRatio):(e=cP[this.options.splitType])!==null&&e!==void 0?e:cP.binary,this._maxDepth=-1}layout(t,e){var i;if(!t||!t.length)return[];const n="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)},r=[],a=hv(t,r,0,-1,null,this._getNodeKey);if(this._maxDepth=a.maxDepth,a.sum<=0)return[];const o={flattenIndex:-1,maxDepth:-1,key:"-1",depth:-1,index:-1,value:a.sum,datum:null,x0:n.x0,x1:n.x1,y0:n.y0,y1:n.y1,children:r},l=n.width*n.height/a.sum;return this._filterByArea(o,l),this._layout(o),(i=o.children)!==null&&i!==void 0?i:[]}_filterChildren(t){const e=this.options.maxDepth;if(dt(e)&&e>=0&&t.depth>=e)return!1;const i=this.options.minChildrenVisibleArea;if(dt(i)&&Math.abs((t.x1-t.x0)*(t.y1-t.y0))<i)return!1;const n=this.options.minChildrenVisibleSize;return!dt(n)||!(Math.abs(t.x1-t.x0)<n||Math.abs(t.y1-t.y0)<n)}_layout(t){var e;this._filterChildren(t)||(t.children=null,t.isLeaf=!0),this._layoutNode(t),!((e=t.children)===null||e===void 0)&&e.length&&t.children.forEach(i=>{var n;!((n=i==null?void 0:i.children)===null||n===void 0)&&n.length?this._layout(i):this._layoutNode(i)})}}dv.defaultOpionts={aspectRatio:(1+Math.sqrt(5))/2,gapWidth:0,labelPadding:0,labelPosition:"top",splitType:"binary",minVisibleArea:10};const Dit={x0:"startAngle",x1:"endAngle",y0:"innerRadius",y1:"outerRadius"};class pc{constructor(t){this._layoutNode=n=>{if(n.maxDepth=this._maxDepth,n.children){const r=this._parsedInnerRadius[n.depth+1],a=this._parsedOutterRadius[n.depth+1];lv(n,n.startAngle,Math.min(r,a),n.endAngle,Math.max(r,a),Dit);const o=$(this.options.label)?this.options.label[n.depth+1]:this.options.label;n.children.forEach(l=>{if(l.x=this._parsedCenter[0],l.y=this._parsedCenter[1],o)return this._layoutLabel(l,ye(o)?{align:"center",rotate:"radial"}:o)})}},this.options=t?Object.assign({},pc.defaultOpionts,t):Object.assign({},pc.defaultOpionts);const e=this.options.nodeKey,i=K(e)?e:e?In(e):null;this._getNodeKey=i,this._maxDepth=-1}_parseRadius(t,e){const i=t.x0+Ds(this.options.center[0],t.width),n=t.y0+Ds(this.options.center[1],t.height),r=Math.min(t.width/2,t.height/2),a=this.options.innerRadius,o=this.options.outerRadius,l=$(a),h=l?a.map(g=>Ds(g,r)):Ds(a,r),d=$(o),u=this.options.gapRadius,c=d?o.map(g=>Ds(g,r)):Ds(o,r),p=pE(0,e+1);if(l)this._parsedInnerRadius=p.map((g,f)=>{const _=h[f];return P(_)?r:_}),this._parsedOutterRadius=p.map((g,f)=>{var _;return d?c[f]:f<e?this._parsedInnerRadius[f+1]-($(u)?(_=u[f])!==null&&_!==void 0?_:0:u):c});else if(d)this._parsedOutterRadius=p.map((g,f)=>P(c[f])?r:c[f]),this._parsedInnerRadius=p.map((g,f)=>{var _;return f===0?h:this._parsedOutterRadius[f-1]-($(u)?(_=u[f])!==null&&_!==void 0?_:0:u)});else{const g=Ds(a,r),f=(c-g)/(e+1);this._parsedInnerRadius=p.map((_,m)=>g+m*f),this._parsedOutterRadius=p.map((_,m)=>{var v;return this._parsedInnerRadius[m]+f-($(u)?(v=u[m])!==null&&v!==void 0?v:0:u)})}this._parsedCenter=[i,n],this._maxRadius=r}layout(t,e){const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const n=[],r=hv(t,n,0,-1,null,this._getNodeKey);return this._parseRadius(i,r.maxDepth),this._maxDepth=r.maxDepth,this._layout(n,{flattenIndex:-1,maxDepth:-1,key:"-1",depth:-1,index:-1,value:r.sum,datum:null,children:n,startAngle:this.options.startAngle,endAngle:this.options.endAngle}),n}_layout(t,e){this._layoutNode(e),t.forEach(i=>{var n;!((n=i==null?void 0:i.children)===null||n===void 0)&&n.length?this._layout(i.children,i):this._layoutNode(i)})}_layoutLabel(t,e){var i;const n=(t.startAngle+t.endAngle)/2,r=(e.align==="start"?t.innerRadius:e.align==="end"?t.outerRadius:(t.innerRadius+t.outerRadius)/2)+((i=e.offset)!==null&&i!==void 0?i:0),a=xn({x:this._parsedCenter[0],y:this._parsedCenter[1]},r,n);if(t.label={x:a.x,y:a.y,textBaseline:"middle"},e.rotate==="tangential")t.label.angle=n-Math.PI/2,t.label.textAlign="center",t.label.maxLineWidth=Math.abs(t.endAngle-t.startAngle)*r;else{const o=n%(2*Math.PI),l=o<0?o+2*Math.PI:o;l>Math.PI/2&&l<1.5*Math.PI?(t.label.angle=l+Math.PI,t.label.textAlign=e.align==="start"?"end":e.align==="end"?"start":"center"):(t.label.angle=l,t.label.textAlign=e.align),t.label.maxLineWidth=t.isLeaf?void 0:Math.abs(t.outerRadius-t.innerRadius)}}}pc.defaultOpionts={startAngle:Math.PI/2,endAngle:-3*Math.PI/2,center:["50%","50%"],gapRadius:0,innerRadius:0,outerRadius:"70%"};const Fit=1664525,jit=1013904223,pP=4294967296;function zit(s=1){let t=s;return()=>(t=(Fit*t+jit)%pP)/pP}function Hit(s,t){let e=0;const i=cE(Array.from(s),t),n=i.length;let r,a,o=[];for(;e<n;)r=i[e],a&&ND(a,r)?++e:(o=Nit(o,r),a=Git(o),e=0);return a}function Nit(s,t){let e,i;if(X0(t,s))return[t];for(e=0;e<s.length;++e)if(Kp(t,s[e])&&X0(Nd(s[e],t),s))return[s[e],t];for(e=0;e<s.length-1;++e)for(i=e+1;i<s.length;++i)if(Kp(Nd(s[e],s[i]),t)&&Kp(Nd(s[e],t),s[i])&&Kp(Nd(s[i],t),s[e])&&X0(GD(s[e],s[i],t),s))return[s[e],s[i],t];Nt.getInstance().error("error when packEncloseRandom")}function Kp(s,t){const e=s.radius-t.radius,i=t.x-s.x,n=t.y-s.y;return e<0||e*e<i*i+n*n}function ND(s,t){const e=s.radius-t.radius+1e-9*Math.max(s.radius,t.radius,1),i=t.x-s.x,n=t.y-s.y;return e>0&&e*e>i*i+n*n}function X0(s,t){for(let e=0;e<t.length;++e)if(!ND(s,t[e]))return!1;return!0}function Git(s){switch(s.length){case 1:return Wit(s[0]);case 2:return Nd(s[0],s[1]);case 3:return GD(s[0],s[1],s[2])}}function Wit(s){return{x:s.x,y:s.y,radius:s.radius}}function Nd(s,t){const e=s.x,i=s.y,n=s.radius,r=t.x,a=t.y,o=t.radius,l=r-e,h=a-i,d=o-n,u=Math.sqrt(l*l+h*h);return{x:(e+r+l/u*d)/2,y:(i+a+h/u*d)/2,radius:(u+n+o)/2}}function GD(s,t,e){const i=s.x,n=s.y,r=s.radius,a=t.x,o=t.y,l=t.radius,h=e.x,d=e.y,u=e.radius,c=i-a,p=i-h,g=n-o,f=n-d,_=l-r,m=u-r,v=i*i+n*n-r*r,y=v-a*a-o*o+l*l,b=v-h*h-d*d+u*u,x=p*g-c*f,S=(g*b-f*y)/(2*x)-i,A=(f*_-g*m)/x,k=(p*y-c*b)/(2*x)-n,w=(c*m-p*_)/x,T=A*A+w*w-1,M=2*(r+S*A+k*w),C=S*S+k*k-r*r,R=-(Math.abs(T)>1e-6?(M+Math.sqrt(M*M-4*T*C))/(2*T):C/M);return{x:i+S+A*R,y:n+k+w*R,radius:R}}function gP(s,t,e){const i=s.x-t.x;let n,r;const a=s.y-t.y;let o,l;const h=i*i+a*a;h?(r=t.radius+e.radius,r*=r,l=s.radius+e.radius,l*=l,r>l?(n=(h+l-r)/(2*h),o=Math.sqrt(Math.max(0,l/h-n*n)),e.x=s.x-n*i-o*a,e.y=s.y-n*a+o*i):(n=(h+r-l)/(2*h),o=Math.sqrt(Math.max(0,r/h-n*n)),e.x=t.x+n*i-o*a,e.y=t.y+n*a+o*i)):(e.x=t.x+e.radius,e.y=t.y)}function fP(s,t){const e=s.radius+t.radius-1e-6,i=t.x-s.x,n=t.y-s.y;return e>0&&e*e>i*i+n*n}function _P(s){const t=s._,e=s.next._,i=t.radius+e.radius,n=(t.x*e.radius+e.x*t.radius)/i,r=(t.y*e.radius+e.y*t.radius)/i;return n*n+r*r}function qp(s){return{_:s,next:null,prev:null}}function Vit(s,t){const e=(s=Y(s)).length;if(!e)return 0;let i=s[0];if(i.x=0,i.y=0,e===1)return i.radius;const n=s[1];if(i.x=-n.radius,n.x=i.radius,n.y=0,e===2)return i.radius+n.radius;let r=s[2];gP(n,i,r);let a,o,l,h,d,u,c,p=qp(i),g=qp(n),f=qp(r);p.next=g,f.prev=g,g.next=f,p.prev=f,f.next=p,g.prev=p;for(let m=3;m<e;++m){c=!1,r=s[m],gP(p._,g._,r),f=qp(r),a=g.next,o=p.prev,l=g._.radius,h=p._.radius;do if(l<=h){if(fP(a._,f._)){g=a,p.next=g,g.prev=p,--m,c=!0;break}l+=a._.radius,a=a.next}else{if(fP(o._,f._)){p=o,p.next=g,g.prev=p,--m,c=!0;break}h+=o._.radius,o=o.prev}while(a!==o.next);if(!c){for(f.prev=p,f.next=g,p.next=g.prev=g=f,d=_P(p),f=f.next;f!==g;)u=_P(f),u<d&&(p=f,d=u),f=f.next;g=p.next}}const _=[g._];for(f=g.next;f!==g;)_.push(f._),f=f.next;r=Hit(_,t);for(let m=0;m<e;++m)i=s[m],i.x-=r.x,i.y-=r.y;return r.radius}function mP(s){return function(t){t.children||(t.radius=Math.max(0,+s(t)||0))}}function K0(s,t,e){return function(i){const n=i==null?void 0:i.children;if(n){let r;const a=n.length,o=s(i)*t||0;if(o)for(r=0;r<a;++r)n[r].radius+=o;const l=Vit(n,e);if(o)for(r=0;r<a;++r)n[r].radius-=o;i.radius=l+o}}}function vP(s,t){return function(e,i,n){e.radius*=s,e.maxDepth=t,n&&(e.x=n.x+s*e.x,e.y=n.y+s*e.y)}}class gc{constructor(t){this.options=t;const e=t==null?void 0:t.nodeKey,i=K(e)?e:e?In(e):null;this._getNodeKey=i,this._getPadding=dt(t==null?void 0:t.padding)?n=>t.padding:$(t==null?void 0:t.padding)?n=>{var r;return(r=t.padding[n.depth+1])!==null&&r!==void 0?r:0}:()=>0,this._maxDepth=-1}layout(t,e){var i;const n="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const r=[],a=hv(t,r,0,-1,null,this._getNodeKey);this._maxDepth=a.maxDepth;const o=zit(),l={flattenIndex:-1,maxDepth:-1,key:"root",depth:-1,index:-1,value:a.sum,datum:null,children:r,x:n.x0+n.width/2,y:n.y0+n.height/2},{nodeSort:h,setRadius:d,padding:u,includeRoot:c}=(i=this.options)!==null&&i!==void 0?i:{};if(h!==!1){const p=K(h)?this.options.nodeKey:gc.defaultOpionts.nodeSort;pl([l],g=>{g.children&&g.children.length&&g.children.sort(p)})}if(d)pl([l],mP(d)),Sg([l],K0(this._getPadding,.5,o)),pl([l],vP(1,this._maxDepth));else{const p=Math.min(n.width,n.height);pl([l],mP(gc.defaultOpionts.setRadius)),Sg([l],K0(vU,1,o)),u&&Sg([l],K0(this._getPadding,l.radius/p,o)),pl([l],vP(p/(2*l.radius),this._maxDepth))}return c?[l]:r}}gc.defaultOpionts={setRadius:s=>Math.sqrt(s.value),padding:0,nodeSort:(s,t)=>t.value-s.value};const Wh=(s,t={})=>{if(!s)return[];const e=[];return HD(s,e,t),e},Uit=(s,t)=>{if(!s)return s;const e=t(),{width:i,height:n}=e;return new pc(e).layout(s,{width:i,height:n})},$it=10;class Yit extends ys{constructor(){super(...arguments),this.contentKeyCallback=t=>t==null?void 0:t[this.series.getDimensionField()[0]]}}var ka;(function(s){s.DrillDown="drillDown",s.DrillUp="drillUp"})(ka||(ka={}));const Xit=(s,t)=>{const e=t.info(),i=t.keyField(),n=e==null?void 0:e.key;if(P(n))return s;if(e.type===ka.DrillDown){const r=_B(s,n,i,"children");return Y(r)}if(e.type===ka.DrillUp){const r=mB(s,n,i,"children");if(r)return Y(r)}return s};class AA{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return(e=br(i))===null||e===void 0?void 0:e[t]}_hideTooltip(){const t=this.getChart().getAllComponents().find(e=>e.type===Z.tooltip);t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;Ct(t,"drillFilter",Xit),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,n=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),r=>{var a,o,l;if(P(r.datum)||P((a=r.datum)===null||a===void 0?void 0:a[n]))return void this.drillUp();this._hideTooltip();const h=r.datum[n],d=(l=(o=this._drillInfo)===null||o===void 0?void 0:o.path)!==null&&l!==void 0?l:[],u=jZ(e().rawData,h,n,"children");d[d.length-1]===u[u.length-1]?this.drillUp():this.drillDown(u)})}drillDown(t=[]){const{getRawData:e,event:i}=this._drillParams;if(!$(t)||vt(t))return t;const n=t[t.length-1];return this._drillInfo={key:n,path:t,type:ka.DrillDown},e().reRunAllTransform(),i.emit(St.drill,{value:{path:t,type:ka.DrillDown},model:this}),t}drillUp(){var t,e;const{getRawData:i,event:n}=this._drillParams,r=(e=(t=this._drillInfo)===null||t===void 0?void 0:t.path)!==null&&e!==void 0?e:[];if(!$(r)||vt(r))return r;const a=r.pop();return this._drillInfo={key:a,path:r,type:ka.DrillUp},i().reRunAllTransform(),n.emit(St.drill,{value:{path:r,type:ka.DrillUp},model:this}),r}}class Ba extends Uc{constructor(){super(...arguments),this.type=z.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField((t=this._spec.seriesField)!==null&&t!==void 0?t:Xa),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var e;return(e=this._spec.drillField)!==null&&e!==void 0?e:ar},getRawData:()=>this.getRawData()}),this._startAngle=ue(this._spec.startAngle),this._endAngle=ue(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),Ct(this._dataSet,"sunburstLayout",Uit),Ct(this._dataSet,"flatten",Wh),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:e,outerRadius:i,gap:n,label:r}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[E(this._centerX)?this._centerX:this.getLayoutRect().width/2,E(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:e,outerRadius:i,gapRadius:n,label:r}}}),t.transform({type:"flatten",options:{callback:e=>{if(e.datum){const i=e.datum[e.depth];return Object.assign(Object.assign({},e),i)}return e}}}))}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:Ku,operations:["max","min","values"]},{key:Xa,operations:["values"]}])}_addDataIndexAndKey(){const t=this.getRawData();P(t==null?void 0:t.dataSet)||(Ct(t.dataSet,"addVChartProperty",ed),t.transform({type:"addVChartProperty",options:{beforeCall:uA.bind(this),call:iv}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){var t;if(this._sunburst.visible===!1)return;const e=this._createMark(Ba.mark.sunburst,{isSeriesMark:!0,customShape:(t=this._spec.sunburst)===null||t===void 0?void 0:t.customShape});this._sunburstMark=e,this._trigger.registerMark(this._sunburstMark)}_initArcMarkStyle(){P(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(E(this._offsetX)?this._offsetX:0),y:t=>t.y+(E(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},bt.STATE_NORMAL,tt.Series)}_initLabelMark(){if(this._label.visible!==!0)return;const t=this._createMark(Ba.mark.label,{isSeriesMark:!1});this._labelMark=t,this._trigger.registerMark(t)}_initLabelMarkStyle(){P(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return $t(i)&&i.enable===!0?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>((e=i==null?void 0:i.circumference)!==null&&e!==void 0?e:$it):this._spec.label.visible},x:t=>{var e;return((e=t.label)===null||e===void 0?void 0:e.x)+(E(this._offsetX)?this._offsetX:0)},y:t=>{var e;return((e=t.label)===null||e===void 0?void 0:e.y)+(E(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return(e=t.label)===null||e===void 0?void 0:e.textBaseline},textAlign:t=>{var e;return(e=t.label)===null||e===void 0?void 0:e.textAlign},angle:t=>{var e,i;return(i=(e=t.label)===null||e===void 0?void 0:e.angle)!==null&&i!==void 0?i:0},fontSize:10,text:t=>t.name},bt.STATE_NORMAL,tt.Series)}initTooltip(){this._tooltipHelper=new Yit(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Y(this.__innerRadius))[0],outerRadius:this._computeRadius(Y(this.__outerRadius))[0],startAngle:Y(this._startAngle)[0],endAngle:Y(this._endAngle)[0]})},n=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;this.getMarksInType("arc").forEach(r=>{var a;r.setAnimationConfig(zt((a=F.getAnimationInKey("sunburst"))===null||a===void 0?void 0:a(i,n),Yt(r.name,this._spec,this._markAttributeContext)))}),this.getMarksInType("text").forEach(r=>{var a;r.setAnimationConfig(zt((a=F.getAnimationInKey("fadeInOut"))===null||a===void 0?void 0:a(),Yt(r.name,this._spec,this._markAttributeContext)))})}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_computeRadius(t){if($(t))return t.map(n=>{const{width:r,height:a}=this.getRegion().getLayoutRect();return Math.min(r/2,a/2)*n});const{width:e,height:i}=this.getRegion().getLayoutRect();return Math.min(e/2,i/2)*t}_computeLevel(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._sunburstMark]}}Ba.type=z.sunburst,Ba.mark=ZL,Ai(Ba,AA);const Kit=()=>{F.registerSeries(Ba.type,Ba),$c(),Gs(),$r(),Rit()},qit=(s,t)=>{if(!s)return s;const e=t(),{width:i,height:n}=e;return i===0||n===0?s:new gc(e).layout(s,{width:i,height:n})};class Zit extends ys{constructor(){super(...arguments),this.contentKeyCallback=t=>t==null?void 0:t[this.series.getDimensionField()[0]]}}const Jit=s=>s==="fadeIn"?{type:"fadeIn"}:{type:"growRadiusIn"},Qit=()=>{F.registerAnimation("circlePacking",(s,t)=>({appear:Jit(t),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))};class Da extends pn{constructor(){super(...arguments),this.type=z.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField((t=this._spec.seriesField)!==null&&t!==void 0?t:Xa),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var e;return(e=this._spec.drillField)!==null&&e!==void 0?e:ar},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();P(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),Ct(this._dataSet,"circlePackingLayout",qit),Ct(this._dataSet,"flatten",Wh),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:e=>{if(e.datum){const i=e.datum[e.depth];return Object.assign(Object.assign({},e),i)}return e}}}))}_addDataIndexAndKey(){const t=this.getRawData();P(t==null?void 0:t.dataSet)||(Ct(t.dataSet,"addVChartProperty",ed),t.transform({type:"addVChartProperty",options:{beforeCall:uA.bind(this),call:iv}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t,e;if(((t=this._circlePacking)===null||t===void 0?void 0:t.visible)===!1)return;const i=this._createMark(Da.mark.circlePacking,{isSeriesMark:!0,customShape:(e=this._spec.circlePacking)===null||e===void 0?void 0:e.customShape});this._circlePackingMark=i,this._trigger.registerMark(i)}_initCirclePackingMarkStyle(){P(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:t=>t.x,y:t=>t.y,outerRadius:t=>t.radius,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:t=>t.depth},bt.STATE_NORMAL,tt.Series)}_initLabelMark(){var t;if(((t=this._label)===null||t===void 0?void 0:t.visible)===!1)return;const e=this._createMark(Da.mark.label,{isSeriesMark:!1});this._labelMark=e,this._trigger.registerMark(e)}_initLabelMarkStyle(){P(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},bt.STATE_NORMAL,tt.Series)}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:Ku,operations:["max","min","values"]},{key:Xa,operations:["values"]}])}initTooltip(){this._tooltipHelper=new Zit(this),this._tooltipHelper.updateTooltipSpec(),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=(t=this._spec.animationAppear)===null||t===void 0?void 0:t.preset;this.getMarksInType("arc").forEach(i=>{var n;i.setAnimationConfig(zt((n=F.getAnimationInKey("circlePacking"))===null||n===void 0?void 0:n(void 0,e),Yt(i.name,this._spec,this._markAttributeContext)))}),this.getMarksInType("text").forEach(i=>{var n;i.setAnimationConfig(zt((n=F.getAnimationInKey("scaleInOut"))===null||n===void 0?void 0:n(),Yt(i.name,this._spec,this._markAttributeContext)))})}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._circlePackingMark]}}Da.type=z.circlePacking,Da.mark=tB,Ai(Da,AA);const tst=()=>{F.registerSeries(Da.type,Da),$c(),Gs(),ev(),Qit()},WD=s=>{let t=0;return s.forEach((e,i)=>{var n;P(e.value)&&(!((n=e.children)===null||n===void 0)&&n.length?e.value=WD(e.children):e.value=0),t+=Math.abs(e.value)}),t};function yP(s){return s.depth}function bP(s,t){return t-1-s.endDepth}function est(s,t){return s.sourceLinks.length?s.depth:t-1}function ist(s,t,e){return s.targetLinks.length?s.depth:s.sourceLinks.length?ki(s.sourceLinks.map(i=>e[i.target].depth))-1:0}const Zp=(s,t)=>s.y0-t.y0,xP=(s,t)=>{if(P(s.value))return null;const e=(t?s.targetLinks:s.sourceLinks).reduce((i,n)=>(P(n.value)?i.count+=1:i.sum+=n.value,i),{sum:0,count:0});return e.count>0?(s.value-e.sum)/e.count:null},sst={left:yP,right:bP,justify:est,center:ist,start:yP,end:bP};class Yc{constructor(t){this._ascendingSourceBreadth=(n,r)=>Zp(this._nodeMap[n.source],this._nodeMap[r.source])||n.index-r.index,this._ascendingTargetBreadth=(n,r)=>Zp(this._nodeMap[n.target],this._nodeMap[r.target])||n.index-r.index,this.options=Object.assign({},Yc.defaultOptions,t);const e=this.options.nodeKey,i=K(e)?e:e?In(e):null;this._getNodeKey=i,this._logger=Nt.getInstance(),this._alignFunc=K(this.options.setNodeLayer)?n=>this.options.setNodeLayer(n.datum):sst[this.options.nodeAlign]}layout(t,e){if(!t)return null;const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};Yw(this.options.direction)?this._viewBox={x0:i.y0,x1:i.y1,y0:i.x0,y1:i.x1,width:i.height,height:i.width}:this._viewBox=i;const n=this.computeNodeLinks(t),r=n.nodes,a=n.links;if(this._nodeMap=n.nodeMap,this.computeNodeValues(r),this.computeNodeDepths(r),["right","end","justify"].includes(this.options.nodeAlign)&&this.computeNodeEndDepths(r),this._maxDepth<=1)return null;const o=this.computeNodeBreadths(r);return this.computeLinkBreadths(r),Yw(this.options.direction)&&(r.forEach(l=>{const h=l.y0,d=l.y1;l.y0=l.x0,l.y1=l.x1,l.x0=h,l.x1=d}),a.forEach(l=>{l.vertical=!0;const h=l.x0,d=l.x1;l.x0=l.y0,l.x1=l.y1,l.y0=h,l.y1=d})),a.forEach(l=>{const h=this._nodeMap[l.source],d=this._nodeMap[l.target];l.sourceRect={x0:h.x0,x1:h.x1,y0:h.y0,y1:h.y1},l.targetRect={x0:d.x0,x1:d.x1,y1:d.y1,y0:d.y0}}),{nodes:r,links:a,columns:o}}computeHierarchicNodeLinks(t){const e=[],i=[],n={},r={},a=[];WD(t);const o=(l,h,d)=>{l.forEach((u,c)=>{var p,g;const f=this._getNodeKey?this._getNodeKey(u):d?`${d[d.length-1].key}-${c}`:`${h}-${c}`;if(n[f])n[f].value=void 0;else{const _={depth:h,datum:u,index:c,key:f,value:(p=u.value)!==null&&p!==void 0?p:0,sourceLinks:[],targetLinks:[]};n[f]=_,e.push(_)}d&&a.push({source:d[d.length-1].key,target:f,value:(g=u.value)!==null&&g!==void 0?g:0,parents:d}),u.children&&u.children.length&&o(u.children,h+1,d?d.concat([n[f]]):[n[f]])})};return o(t,0,null),a.forEach((l,h)=>{const d=`${l.source}-${l.target}`;if(r[d])return r[d].value+=l.value,void r[d].datum.push(l);const u={index:h,key:`${l.source}-${l.target}`,source:l.source,target:l.target,datum:[l],value:l.value,parents:l.parents.map(c=>c.key)};i.push(u),n[l.source].sourceLinks.push(u),n[l.target].targetLinks.push(u),r[d]=u}),{nodes:e,links:i,nodeMap:n}}computeSourceTargetNodeLinks(t){const e=[],i=[],n={};t.nodes&&t.nodes.forEach((a,o)=>{const l={depth:-1,datum:a,index:o,key:this._getNodeKey?this._getNodeKey(a):o,value:a.value,sourceLinks:[],targetLinks:[]};n[l.key]=l,e.push(l)});const r=[];return t.links.forEach((a,o)=>{if(P(a.source)||P(a.target)||t.nodes&&(!n[a.source]||!n[a.target]))return;t.nodes||n[a.source]||(n[a.source]={value:void 0,depth:-1,index:e.length,key:a.source,datum:null,sourceLinks:[],targetLinks:[]},e.push(n[a.source])),t.nodes||n[a.target]||(n[a.target]={value:void 0,depth:-1,index:e.length,key:a.target,datum:null,sourceLinks:[],targetLinks:[]},e.push(n[a.target]));const l={index:o,source:a.source,target:a.target,datum:a,value:a.value};this.options.divideNodeValueToLink&&P(a.value)&&r.push(l),i.push(l),n[a.source].sourceLinks.push(l),n[a.target].targetLinks.push(l)}),this.options.divideNodeValueToLink&&r.length&&r.forEach(a=>{const o=[xP(n[a.source]),xP(n[a.target],!0)].filter(l=>!P(l));o.length&&(a.value=ki(o))}),{nodeMap:n,nodes:e,links:i}}computeNodeLinks(t){let e;"links"in t?e=this.computeSourceTargetNodeLinks(t):(this._isHierarchic=!0,e=this.computeHierarchicNodeLinks(t.nodes));let i=e.nodes;const n=e.links;if(this.options.linkSortBy)for(let r=0,a=i.length;r<a;r++)i[r].sourceLinks.sort(this.options.linkSortBy),i[r].targetLinks.sort(this.options.linkSortBy);return this.options.dropIsolatedNode&&(i=i.filter(r=>r.targetLinks.length||r.sourceLinks.length)),{nodes:i,links:n,nodeMap:e.nodeMap}}computeNodeValues(t){for(let e=0,i=t.length;e<i;e++){const n=t[e];n.value=Math.max(P(n.value)?0:n.value,n.sourceLinks.reduce((r,a)=>{var o;return r+((o=a.value)!==null&&o!==void 0?o:0)},0),n.targetLinks.reduce((r,a)=>{var o;return r+((o=a.value)!==null&&o!==void 0?o:0)},0))}}computeNodeDepths(t){const e=t.length;let i,n,r=t,a=0;for(;r.length&&a<e;){i=[],n={};for(let o=0,l=r.length;o<l;o++){const h=r[o];h.depth=a;for(let d=0,u=h.sourceLinks.length;d<u;d++){const c=h.sourceLinks[d];n[c.target]||(i.push(this._nodeMap[c.target]),n[c.target]=!0)}}r=i,a+=1}a>e&&this._logger.warn("Error: there is a circular link"),this._maxDepth=a}computeNodeEndDepths(t){const e=t.length;let i,n,r=t,a=0;for(;r.length&&a<e;){i=[],n={};for(let o=0,l=r.length;o<l;o++){const h=r[o];h.endDepth=a;for(let d=0,u=h.targetLinks.length;d<u;d++){const c=h.targetLinks[d];n[c.source]||(i.push(this._nodeMap[c.source]),n[c.source]=!0)}}r=i,a+=1}a>e&&this._logger.warn("Error: there is a circular link")}computeNodeLayers(t){const e=this.options.nodeWidth,i=this.options.linkWidth,n=this.options.minStepWidth,r=this._viewBox.width;let a=null,o=null,l=!1;if(ht(e)){const d=xi(parseFloat(e.replace("%",""))/100,0,1);let u=r/(this._maxDepth-1+d);n>0&&(u=Math.max(n,u)),a=u*d,o=u*(1-d),l=!0}else if(dt(e)){if(a=e,dt(i))o=i;else if(P(i)){let d=(r-e)/(this._maxDepth-1);n>0&&(d=Math.max(n,d)),o=d-e}l=!0}else K(e)&&dt(i)&&(o=i);const h=[];for(let d=0,u=t.length;d<u;d++){const c=t[d];c.layer=this._isHierarchic?c.depth:xi(Math.floor(this._alignFunc(c,this._maxDepth,this._nodeMap)),0,this._maxDepth-1);const p=c.layer;p===this._maxDepth-1&&(c.isLastLayer=!0),l&&(c.x0=this._viewBox.x0+p*(a+o),c.x1=c.x0+a),h[p]?h[p].push(c):h[p]=[c]}if(this.options.nodeSortBy)for(let d=0,u=h.length;d<u;d++)h[d].sort(this.options.nodeSortBy);if(!l&&K(e)){let d=this._viewBox.x0;for(let u=0;u<this._maxDepth;u++){const c=h[u];let p=0;for(let g=0,f=c.length;g<f;g++){const _=c[g],m=e(_);_.x0=d,_.x1=d+m,p=Math.max(a,m);const v=_.sourceLinks;for(let y=0,b=v.length;y<b;y++){const x=v[y];K(i)&&i(x)}}d+=p}}return h}initializeNodeBreadths(t){const e=this.options.minLinkHeight;let i=this.options.minNodeHeight;(P(i)||i<e)&&(i=e);let n=0,r=null;if(K(this.options.nodeGap))r=this.options.nodeGap,n=t.reduce((l,h)=>{const d=h.reduce((c,p)=>c+p.value,0),u=h.reduce((c,p)=>c+this.options.nodeGap(p),0);return Math.min(l,(this._viewBox.height-u)/d)},1/0);else{const l=t.reduce((d,u)=>Math.max(d,u.length),0),h=Math.min(i>0?Math.max(this.options.nodeGap,i):this.options.nodeGap,this._viewBox.height/l);r=()=>h,this._gapY=h,n=t.reduce((d,u)=>{const c=u.reduce((p,g)=>p+g.value,0);return Math.min(d,(this._viewBox.height-(u.length-1)*h)/c)},1/0)}const a=this.options.gapPosition==="start",o=!a&&this.options.gapPosition!=="end";for(let l=0,h=t.length;l<h;l++){const d=t[l];let u=this._viewBox.y0,c=0;for(let g=0,f=d.length;g<f;g++){const _=d[g];c=r(_),a&&(u+=c),_.y0=u,_.y1=u+(i>0&&_.value!==0?Math.max(_.value*n,i):_.value*n),u=a?_.y1:_.y1+c;for(let m=0,v=_.sourceLinks.length;m<v;m++){const y=_.sourceLinks[m];y.thickness=e>0&&y.value!==0?Math.max(y.value*n,e):y.value*n}}let p=this._viewBox.y1-u+(o?c:0);if(p>0){if(this.options.crossNodeAlign!=="start")if(this.options.crossNodeAlign==="end")for(let g=0,f=d.length;g<f;++g){const _=d[g];_.y0+=p,_.y1+=p}else{p/=d.length+1;for(let g=0,f=d.length;g<f;++g){const _=d[g];_.y0+=p*(g+1),_.y1+=p*(g+1)}}}else if(p<0&&d.length>1&&(p/=d.length-1,c+p>0)){c+=p;for(let g=1,f=d.length;g<f;++g){const _=d[g];_.y0+=p*g,_.y1+=p*g}}this.reorderLinks(d)}}computeNodeBreadths(t){const e=this.computeNodeLayers(t);this.initializeNodeBreadths(e);const i=this.options.iterations;if(!this._isHierarchic&&!K(this.options.setNodeLayer)&&!K(this.options.nodeGap))for(let n=0;n<i;++n){const r=Math.pow(.99,n),a=Math.max(1-r,(n+1)/i);this.relaxRightToLeft(e,r,a),this.relaxLeftToRight(e,r,a)}return e}relaxLeftToRight(t,e,i){for(let n=1,r=t.length;n<r;++n){const a=t[n];for(let o=0,l=a.length;o<l;o++){const h=a[o];let d=0,u=0;for(let p=0,g=h.targetLinks.length;p<g;p++){const f=h.targetLinks[p],_=f.value*(h.layer-this._nodeMap[f.source].layer);d+=this.targetTop(this._nodeMap[f.source],h)*_,u+=_}if(!(u>0))continue;const c=(d/u-h.y0)*e;h.y0+=c,h.y1+=c,this.reorderNodeLinks(h)}P(this.options.nodeSortBy)&&a.sort(Zp),this.resolveCollisions(a,i)}}relaxRightToLeft(t,e,i){for(let n=t.length-2;n>=0;--n){const r=t[n];for(let a=0,o=r.length;a<o;a++){const l=r[a];let h=0,d=0;for(let c=0,p=l.sourceLinks.length;c<p;c++){const g=l.sourceLinks[c],f=g.value*(this._nodeMap[g.target].layer-l.layer);h+=this.sourceTop(l,this._nodeMap[g.target])*f,d+=f}if(!(d>0))continue;const u=(h/d-l.y0)*e;l.y0+=u,l.y1+=u,this.reorderNodeLinks(l)}this.options.nodeSortBy===void 0&&r.sort(Zp),this.resolveCollisions(r,i)}}resolveCollisions(t,e){const i=t.length>>1,n=t[i];this.resolveCollisionsBottomToTop(t,n.y0-this._gapY,i-1,e),this.resolveCollisionsTopToBottom(t,n.y1+this._gapY,i+1,e),this.resolveCollisionsBottomToTop(t,this._viewBox.y1,t.length-1,e),this.resolveCollisionsTopToBottom(t,this._viewBox.y0,0,e)}resolveCollisionsTopToBottom(t,e,i,n){for(;i<t.length;++i){const r=t[i],a=(e-r.y0)*n;a>1e-6&&(r.y0+=a,r.y1+=a),e=r.y1+this._gapY}}resolveCollisionsBottomToTop(t,e,i,n){for(;i>=0;--i){const r=t[i],a=(r.y1-e)*n;a>1e-6&&(r.y0-=a,r.y1-=a),e=r.y0-this._gapY}}targetTop(t,e){let i,n,r,a=t.y0-(t.sourceLinks.length-1)*this._gapY/2;for(i=0,n=t.sourceLinks.length;i<n&&(r=t.sourceLinks[i],r.target!==e.key);i++)a+=r.thickness+this._gapY;for(i=0,n=e.targetLinks.length;i<n&&(r=e.targetLinks[i],r.source!==t.key);i++)a-=r.thickness;return a}sourceTop(t,e){let i,n,r,a=e.y0-(e.targetLinks.length-1)*this._gapY/2;for(i=0,n=e.targetLinks.length;i<n&&(r=e.targetLinks[i],r.source!==t.key);i++)a+=r.thickness+this._gapY;for(i=0,n=t.sourceLinks.length;i<n&&(r=t.sourceLinks[i],r.target!==e.key);i++)a-=r.thickness;return a}computeLinkBreadths(t){for(let e=0,i=t.length;e<i;e++){const n=t[e];let r=n.y0,a=r;for(let o=0,l=n.sourceLinks.length;o<l;o++){const h=n.sourceLinks[o];h.y0=r+h.thickness/2,h.x0=n.x1,r+=h.thickness}for(let o=0,l=n.targetLinks.length;o<l;o++){const h=n.targetLinks[o];h.y1=a+h.thickness/2,h.x1=n.x0,a+=h.thickness}}}reorderNodeLinks(t){if(P(this.options.linkSortBy)){const e=t.targetLinks,i=t.sourceLinks;for(let n=0,r=e.length;n<r;n++){const a=e[n];this._nodeMap[a.source].sourceLinks.sort(this._ascendingTargetBreadth)}for(let n=0,r=i.length;n<r;n++){const a=i[n];this._nodeMap[a.target].targetLinks.sort(this._ascendingSourceBreadth)}}}reorderLinks(t){if(P(this.options.linkSortBy))for(let e=0,i=t.length;e<i;e++){const n=t[e];n.sourceLinks.sort(this._ascendingTargetBreadth),n.targetLinks.sort(this._ascendingSourceBreadth)}}}Yc.defaultOptions={iterations:6,nodeAlign:"justify",direction:"horizontal",nodeWidth:24,nodeGap:8,crossNodeAlign:"middle",dropIsolatedNode:!0};const nst=(s,t)=>{const e=new Yc(s).layout(Array.isArray(t)?t[0]:t,"width"in s?{width:s.width,height:s.height}:{x0:s.x0,x1:s.x1,y0:s.y0,y1:s.y1});return e?[e]:[]},rst=()=>{st.registerTransform("sankey",{transform:nst,markPhase:"beforeJoin"},!0)},VD=(s,t,e)=>{t.forEach(i=>{P(i[e])||s.add(i[e]),i.children&&i.children.length>0&&VD(s,i.children,e)})},UD=s=>{s.forEach(t=>{t.value=ht(t.value)?+t.value:t.value,t.children&&t.children.length>0&&UD(t.children)})},ast=s=>{var t;if(!s||!$(s))return[];if(s.length>1){const e={links:[],nodes:[]};return s.forEach(i=>{i.id!=="links"&&i.id!=="nodes"||(e[i.id]=i.values)}),[e]}return!((t=s[0])===null||t===void 0)&&t.latestData?s[0].latestData:s},ost=(s,t)=>{var e,i;if(!s||!(t!=null&&t.view)||!s.length)return[];const n=t.view();if(n.x1-n.x0==0||n.y1-n.y0==0||n.x1-n.x0==-1/0||n.x1-n.x0==1/0||n.y1-n.y0==-1/0||n.y1-n.y0==1/0)return[];const r=s[0];if((t.sourceField!=="source"||t.targetField!=="target"||t.valueField!=="value")&&r.links){const l=[];r.links.forEach(h=>{const d={};for(const u in h)u===t.sourceField?d.source=h[t.sourceField]:u===t.targetField?d.target=h[t.targetField]:u===t.valueField?d.value=h[t.valueField]:d[u]=h[u];l.push(d)}),r.links=l}if(r.links){const l=[];r.links.forEach(h=>{const d={};for(const u in h)u==="value"?d.value=ht(h.value)?+h.value:h.value:d[u]=h[u];l.push(d)}),r.links=l}else!((i=(e=r.nodes)===null||e===void 0?void 0:e[0])===null||i===void 0)&&i.children&&UD(r.nodes);const a=new Yc(t),o=[];return o.push(a.layout(r,n)),o},lst=s=>{var t,e;return s&&$(s)&&(!((t=s[0])===null||t===void 0)&&t.latestData)&&s[0].latestData.length&&s[0].latestData[0]&&(e=s[0].latestData[0].nodes)!==null&&e!==void 0?e:[]},hst=s=>{var t,e;return s&&$(s)&&(!((t=s[0])===null||t===void 0)&&t.latestData)&&s[0].latestData.length&&s[0].latestData[0]&&(e=s[0].latestData[0].links)!==null&&e!==void 0?e:[]};class dst extends ys{getDefaultTooltipPattern(t,e){if(t==="mark")return{visible:!0,activeType:t,title:{key:void 0,value:i=>{if(i.source){if(dt(i.source)){const n=this.series.getSeriesKeys();return n[i.source]+" => "+n[i.target]}return i.source+" => "+i.target}return i.datum[this.series.getSpec().categoryField]},hasShape:!1},content:[{key:this.contentKeyCallback,value:i=>i.value,hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1}]};if(t==="dimension"&&e){const i={key:void 0,value:this._getDimensionData,hasShape:!1},n=[];return e.forEach(({data:r})=>r.forEach(({series:a})=>{n.push({seriesId:a.id,key:this.contentKeyCallback,value:this.contentValueCallback,hasShape:!0,shapeType:this.contentShapeTypeCallback,shapeColor:this.contentShapeColorCallback,shapeStroke:this.contentShapeColorCallback,shapeHollow:!1})})),{visible:!0,activeType:t,title:i,content:n}}return null}}const ust=(s,t=!0)=>({type:s.direction==="horizontal"?"growWidthIn":"growHeightIn",options:{overall:t&&s.growFrom(),orient:"positive"}}),cst=(s,t)=>t==="fadeIn"?{type:"fadeIn"}:ust(s),pst=s=>s==="fadeIn"?{type:"fadeIn"}:{type:"linkPathGrowIn"},gst=()=>{F.registerAnimation("sankeyNode",(s,t)=>Object.assign({appear:cst(s,t)},tv)),F.registerAnimation("sankeyLinkPath",(s,t)=>({appear:pst(t),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{type:"linkPathGrowOut"}}))};class fc extends Hi{constructor(){super(...arguments),this.type=fc.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId(),n=this.getStyle("direction");this._product=e.glyph("linkPath",t??e.rootMark).id(i).configureGlyph({direction:n}),this._compiledProductId=i}}fc.type="linkPath";const fst=()=>{v9(),F.registerMark(fc.type,fc)};class Fa extends pn{constructor(){super(...arguments),this.type=z.sankey,this._nodeLayoutZIndex=ce.Node,this._labelLayoutZIndex=ce.Label,this._viewBox=new Pi,this._handleAdjacencyClick=t=>{const e=t.item;e&&e.mark.id().includes("node")?this._handleNodeAdjacencyClick(e):e&&e.mark.id().includes("link")?this._handleLinkAdjacencyClick(e):this._handleClearEmpty()},this._handleRelatedClick=t=>{const e=t.item;e&&e.mark.id().includes("node")?this._handleNodeRelatedClick(e):e&&e.mark.id().includes("link")?this._handleLinkRelatedClick(e):this._handleClearEmpty()},this._handleClearEmpty=()=>{const t=this._nodeMark.getProduct();if(!t||!t.elements||!t.elements.length)return;const e=t.elements,i=this._linkMark.getProduct();if(!i||!i.elements||!i.elements.length)return;const n=i.elements,r=this._labelMark.getProduct();if(!r||!r.elements||!r.elements.length)return;const a=r.elements;e.forEach(o=>{o.clearStates()}),n.forEach(o=>{o.clearStates()}),a.forEach(o=>{o.clearStates()})},this._handleNodeAdjacencyClick=t=>{const e=t.getDatum(),i=[e.key];if(this._linkMark){const n=this._linkMark.getProduct();if(!n||!n.elements||!n.elements.length)return;n.elements.forEach((r,a)=>{r.clearStates();const o=r.getDatum(),l=o!=null&&o.parents?"parents":"source";if(Y(o[l]).includes(e.key)){let h;if(i.includes(o.source)||i.push(o.source),i.includes(o.target)||i.push(o.target),l==="parents"){const d=o.datum;h=(d?d.filter(u=>u.parents.some(c=>c.key===e.key)).reduce((u,c)=>u+c.value,0):0)/o.value}r.addState("selected",{ratio:h})}else o.target===e.key?i.includes(o.source)||i.push(o.source):r.useStates(["blur"])})}if(this._nodeMark){const n=this._nodeMark.getProduct();if(!n||!n.elements||!n.elements.length)return;n.elements.forEach(r=>{r.clearStates(),i.includes(r.getDatum().key)||r.useStates(["blur"])})}if(this._labelMark){const n=this._labelMark.getProduct();if(!n||!n.elements||!n.elements.length)return;n.elements.forEach(r=>{r.clearStates(),i.includes(r.getDatum().key)||r.useStates(["blur"])})}},this._handleLinkAdjacencyClick=t=>{const e=t.getDatum(),i=[e.source,e.target];if(this._linkMark){const n=this._linkMark.getProduct();if(!n||!n.elements||!n.elements.length)return;n.elements.forEach(r=>{r.clearStates(),r===t?r.addState("selected",{ratio:1}):r.useStates(["blur"])})}if(this._nodeMark){const n=this._nodeMark.getProduct();if(!n||!n.elements||!n.elements.length)return;n.elements.forEach(r=>{r.clearStates(),i.includes(r.getDatum().key)||r.useStates(["blur"])})}if(this._labelMark){const n=this._labelMark.getProduct();if(!n||!n.elements||!n.elements.length)return;n.elements.forEach(r=>{r.clearStates(),i.includes(r.getDatum().key)||r.useStates(["blur"])})}},this._handleNodeRelatedClick=t=>{var e;const i=t.getDatum(),n=this._nodeMark.getProduct();if(!n||!n.elements||!n.elements.length)return;const r=n.elements,a=this._linkMark.getProduct();if(!a||!a.elements||!a.elements.length)return;const o=a.elements;if((!((e=o[0].getDatum())===null||e===void 0)&&e.parents?"parents":"source")=="source"){const l=[i.key],h=[];if(o.forEach((d,u)=>{var c,p,g,f;d.clearStates();const _=d.getDatum(),m=_!=null&&_.parents?"parents":"source";if(Y(_[m]).includes(i.key)){if(h.includes((c=_.key)!==null&&c!==void 0?c:_.index)||h.push((p=_.key)!==null&&p!==void 0?p:_.index),l.includes(_.source)||l.push(_.source),!l.includes(_.target)){l.push(_.target);let v=r.find(y=>y.data[0].key===_.target).data[0].sourceLinks;for(;(v==null?void 0:v.length)>0;){const y=[];return v.forEach(b=>{var x,S;if(!h.includes((x=b.key)!==null&&x!==void 0?x:b.index)&&(h.push((S=b.key)!==null&&S!==void 0?S:b.index),!l.includes(b.target))){l.push(b.target);const A=r.find(k=>k.data[0].key===b.target);y.push(A.data[0].targetLinks)}}),void(v=y)}}}else if(_.target===i.key&&(h.includes((g=_.key)!==null&&g!==void 0?g:_.index)||h.push((f=_.key)!==null&&f!==void 0?f:_.index),!l.includes(_.source))){l.push(_.source);let v=r.find(y=>y.data[0].key===_.source).data[0].targetLinks;for(;(v==null?void 0:v.length)>0;){const y=[];return v.forEach(b=>{var x,S;if(!h.includes((x=b.key)!==null&&x!==void 0?x:b.index)&&(h.push((S=b.key)!==null&&S!==void 0?S:b.index),!l.includes(b.source))){l.push(b.source);const A=r.find(k=>k.data[0].key===b.source);y.push(A.data[0].targetLinks)}}),void(v=y)}}}),this._linkMark){const d=this._linkMark.getProduct();if(!d||!d.elements||!d.elements.length)return;d.elements.forEach((u,c)=>{var p;u.clearStates(),h.includes((p=u.getDatum().key)!==null&&p!==void 0?p:u.getDatum().index)?u.useStates(["selected"]):u.useStates(["blur"])})}if(this._nodeMark){const d=this._nodeMark.getProduct();if(!d||!d.elements||!d.elements.length)return;d.elements.forEach(u=>{u.clearStates(),l.includes(u.getDatum().key)||u.useStates(["blur"])})}if(this._labelMark){const d=this._labelMark.getProduct();if(!d||!d.elements||!d.elements.length)return;d.elements.forEach(u=>{u.clearStates(),l.includes(u.getDatum().key)||u.useStates(["blur"])})}}else{const l=[i.key],h=i.targetLinks.reduce((d,u)=>(Y(u.datum).forEach(c=>{const p=c.parents,g=p.length;for(let f=0;f<g;f++){const _=p[f].key,m=p[f+1]?p[f+1].key:i.key,v=c.value,y=d.find(b=>b.source===_&&b.target===m);y?y.value+=v:d.push({source:_,target:m,value:v})}}),d),[]);if(o.forEach((d,u)=>{d.clearStates();const c=d.getDatum(),p=c!=null&&c.parents?"parents":"source",g=c.datum,f=g?g.filter(m=>m[p].some(v=>v.key===i.key)):null,_=h.find(m=>m.source===c.source&&m.target===c.target);if(f&&f.length){l.includes(c.source)||l.push(c.source),l.includes(c.target)||l.push(c.target);const m=f.reduce((v,y)=>v+y.value,0)/c.value;return d.useStates(["selected"]),void d.addState("selected",{ratio:m})}if(_)return l.includes(c.source)||l.push(c.source),l.includes(c.target)||l.push(c.target),d.useStates(["selected"]),void d.addState("selected",{ratio:_.value/c.value});d.useStates(["blur"])}),this._nodeMark){const d=this._nodeMark.getProduct();if(!d||!d.elements||!d.elements.length)return;d.elements.forEach(u=>{u.clearStates(),l.includes(u.getDatum().key)||u.useStates(["blur"])})}if(this._labelMark){const d=this._labelMark.getProduct();if(!d||!d.elements||!d.elements.length)return;d.elements.forEach(u=>{u.clearStates(),l.includes(u.getDatum().key)||u.useStates(["blur"])})}}},this._handleLinkRelatedClick=t=>{var e;const i=this._nodeMark.getProduct();if(!i||!i.elements||!i.elements.length)return;const n=i.elements,r=this._linkMark.getProduct();if(!r||!r.elements||!r.elements.length)return;const a=r.elements;if((!((e=t.getDatum())===null||e===void 0)&&e.parents?"parents":"source")=="source"){if(this._linkMark){const o=this._linkMark.getProduct();if(!o||!o.elements||!o.elements.length)return;o.elements.forEach(l=>{l.clearStates()})}if(this._nodeMark){const o=this._nodeMark.getProduct();if(!o||!o.elements||!o.elements.length)return;o.elements.forEach(l=>{l.clearStates()})}if(this._labelMark){const o=this._labelMark.getProduct();if(!o||!o.elements||!o.elements.length)return;o.elements.forEach(l=>{l.clearStates()})}}else{const o=t.getDatum(),l=[o.source,o.target],h=[];if(Y(o.datum).forEach(d=>{const u=d.parents,c=u.length;for(let p=0;p<c-1;p++){const g=u[p].key,f=u[p+1].key,_=d.value,m=h.find(v=>v.source===g&&v.target===f);h.push({source:u[p].key,target:u[p+1].key,value:d.value}),m?m.value+=_:h.push({source:g,target:f,value:_})}}),a.forEach(d=>{d.clearStates();const u=d.getDatum(),c=u.datum;if(u.source===o.source&&u.target===o.target)return d.useStates(["selected"]),void d.addState("selected",{ratio:1});const p=c?c.filter(f=>{const _=f.parents.map(m=>m.key);return _.includes(o.source)&&_.includes(o.target)}):null;if(p&&p.length){l.includes(u.source)||l.push(u.source),l.includes(u.target)||l.push(u.target);const f=p.filter(m=>m.parents.some((v,y)=>{var b;return v.key===o.source&&((b=m.parents[y+1])===null||b===void 0?void 0:b.key)===o.target})).reduce((m,v)=>m+v.value,0),_=f/u.value;return d.useStates(["selected"]),void d.addState("selected",{ratio:_})}const g=h.find(f=>f.source===u.source&&f.target===u.target);if(g)return l.includes(u.source)||l.push(u.source),l.includes(u.target)||l.push(u.target),d.useStates(["selected"]),void d.addState("selected",{ratio:g.value/u.value});d.useStates(["blur"])}),n.forEach(d=>{d.clearStates(),l.includes(d.getDatum().key)||d.useStates(["blur"])}),this._labelMark){const d=this._labelMark.getProduct();if(!d||!d.elements||!d.elements.length)return;d.elements.forEach(u=>{u.clearStates(),l.includes(u.getDatum().key)||u.useStates(["blur"])})}}}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField((t=this._spec.seriesField)!==null&&t!==void 0?t:this._spec.categoryField),this._labelLimit=(i=(e=this._spec.label)===null||e===void 0?void 0:e.limit)!==null&&i!==void 0?i:100}initData(){var t,e,i,n;super.initData();const r=this.getViewData(),a=this.getRawData();if(a&&r){Ct(this._dataSet,"sankeyLayout",ost),Ct(this._dataSet,"sankeyFormat",ast),a.transform({type:"sankeyFormat"},!1),r.transform({type:"sankeyLayout",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),sourceField:this._spec.sourceField,targetField:this._spec.targetField,valueField:this._spec.valueField,direction:this._spec.direction,nodeAlign:(t=this._spec.nodeAlign)!==null&&t!==void 0?t:"justify",nodeGap:(e=this._spec.nodeGap)!==null&&e!==void 0?e:8,nodeWidth:(i=this._spec.nodeWidth)!==null&&i!==void 0?i:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:(n=this._spec.minNodeHeight)!==null&&n!==void 0?n:4,minLinkHeight:this._spec.minLinkHeight,iterations:this._spec.iterations,nodeKey:this._spec.nodeKey,linkSortBy:this._spec.linkSortBy,nodeSortBy:this._spec.nodeSortBy,setNodeLayer:this._spec.setNodeLayer},level:Hs.sankeyLayout});const{dataSet:o}=this._option;Ct(o,"sankeyNodes",lst),Ct(o,"flatten",Wh);const l=new Jt(o,{name:`sankey-node-${this.id}-data`});l.parse([this.getViewData()],{type:"dataview"}),l.transform({type:"sankeyNodes"}),l.transform({type:"flatten",options:{callback:d=>{if(d.datum){const u=d.datum[d.depth];return Object.assign(Object.assign({},d),u)}return d}}},!1),l.transform({type:"addVChartProperty",options:{beforeCall:qu.bind(this),call:Dh}},!1),this._nodesSeriesData=new or(this._option,l),Ct(o,"sankeyLinks",hst);const h=new Jt(o,{name:`sankey-link-${this.id}-data`});h.parse([this.getViewData()],{type:"dataview"}),h.transform({type:"sankeyLinks"}),h.transform({type:"addVChartProperty",options:{beforeCall:qu.bind(this),call:Dh}},!1),this._linksSeriesData=new or(this._option,h)}}initMark(){var t,e,i;const n=this._createMark(Fa.mark.node,{isSeriesMark:!0,key:Si,dataView:this._nodesSeriesData.getDataView(),dataProductId:this._nodesSeriesData.getProductId(),customShape:(t=this._spec.node)===null||t===void 0?void 0:t.customShape});n&&(n.setZIndex(this._nodeLayoutZIndex),this._nodeMark=n);const r=this._createMark(Fa.mark.link,{key:Si,dataView:this._linksSeriesData.getDataView(),dataProductId:this._linksSeriesData.getProductId(),customShape:(e=this._spec.link)===null||e===void 0?void 0:e.customShape});if(r&&(this._linkMark=r),(i=this._spec.label)===null||i===void 0?void 0:i.visible){const a=this._createMark(Fa.mark.label,{key:Si,dataView:this._nodesSeriesData.getDataView(),dataProductId:this._nodesSeriesData.getProductId()});a&&(this._labelMark=a)}}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle(),this._initLabelMarkStyle()}_initNodeMarkStyle(){const t=this._nodeMark;t&&(this.setMarkStyle(t,{x:e=>e.x0,x1:e=>e.x1,y:e=>e.y0,y1:e=>e.y1,fill:e=>{var i,n,r,a;return(r=(n=(i=this._spec.node)===null||i===void 0?void 0:i.style)===null||n===void 0?void 0:n.fill)!==null&&r!==void 0?r:(a=this._colorScale)===null||a===void 0?void 0:a.scale(this._getNodeNameFromData(e))}},bt.STATE_NORMAL,tt.Mark),this._trigger.registerMark(t))}_initLinkMarkStyle(){var t;const e=this._linkMark;e&&(this.setMarkStyle(e,{x0:i=>i.x0,x1:i=>i.x1,y0:i=>i.y0,y1:i=>i.y1,thickness:i=>i.thickness,fill:i=>{var n,r,a,o,l,h;const d=(r=(n=this._spec.link)===null||n===void 0?void 0:n.style)===null||r===void 0?void 0:r.fill;if(d)return d;const u=this._spec.nodeKey||!((l=(o=(a=this._rawData.latestData[0])===null||a===void 0?void 0:a.nodes)===null||o===void 0?void 0:o[0])===null||l===void 0)&&l.children?i.source:this.getNodeList()[i.source];return(h=this._colorScale)===null||h===void 0?void 0:h.scale(u)},direction:(t=this._spec.direction)!==null&&t!==void 0?t:"horizontal"},bt.STATE_NORMAL,tt.Series),this._trigger.registerMark(e))}_initLabelMarkStyle(){this._labelMark&&(this._spec.direction==="vertical"?this._spec.label.position==="inside-start"?this.setMarkStyle(this._labelMark,{x:t=>t.x0,y:t=>(t.y0+t.y1)/2,fill:"#ffffff",text:t=>this._createText(t),limit:t=>{var e;return(e=this._spec.label.limit)!==null&&e!==void 0?e:t.x1-t.x0},textAlign:"left",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series):this._spec.label.position==="inside-middle"?this.setMarkStyle(this._labelMark,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,fill:"#ffffff",text:t=>this._createText(t),limit:t=>{var e;return(e=this._spec.label.limit)!==null&&e!==void 0?e:t.x1-t.x0},textAlign:"center",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series):this._spec.label.position==="inside-end"?this.setMarkStyle(this._labelMark,{x:t=>t.x1,y:t=>(t.y0+t.y1)/2,fill:"#ffffff",text:t=>this._createText(t),limit:t=>{var e;return(e=this._spec.label.limit)!==null&&e!==void 0?e:t.x1-t.x0},textAlign:"right",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series):this.setMarkStyle(this._labelMark,{x:t=>(t.x0+t.x1)/2,y:t=>t.y1>=this._viewBox.y2?t.y0:t.y1,fill:t=>{var e,i,n,r;return(n=(i=(e=this._spec.node)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.fill)!==null&&n!==void 0?n:(r=this._colorScale)===null||r===void 0?void 0:r.scale(this._getNodeNameFromData(t))},text:t=>this._createText(t),limit:this._labelLimit,textAlign:"center",textBaseline:t=>t.y1>=this._viewBox.y2?"bottom":"top"},bt.STATE_NORMAL,tt.Series):this._spec.label.position==="inside-start"?this.setMarkStyle(this._labelMark,{x:t=>t.x0,y:t=>(t.y0+t.y1)/2,fill:"#ffffff",text:t=>this._createText(t),limit:t=>{var e;return(e=this._spec.label.limit)!==null&&e!==void 0?e:t.x1-t.x0},textAlign:"left",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series):this._spec.label.position==="inside-middle"?this.setMarkStyle(this._labelMark,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,fill:"#ffffff",text:t=>this._createText(t),limit:t=>{var e;return(e=this._spec.label.limit)!==null&&e!==void 0?e:t.x1-t.x0},textAlign:"center",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series):this._spec.label.position==="inside-end"?this.setMarkStyle(this._labelMark,{x:t=>t.x1,y:t=>(t.y0+t.y1)/2,fill:"#ffffff",text:t=>this._createText(t),limit:t=>{var e;return(e=this._spec.label.limit)!==null&&e!==void 0?e:t.x1-t.x0},textAlign:"right",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series):this._spec.label.position==="left"?this.setMarkStyle(this._labelMark,{x:t=>t.x0,y:t=>(t.y0+t.y1)/2,fill:t=>{var e,i,n,r;return(n=(i=(e=this._spec.node)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.fill)!==null&&n!==void 0?n:(r=this._colorScale)===null||r===void 0?void 0:r.scale(this._getNodeNameFromData(t))},text:t=>this._createText(t),limit:this._labelLimit,textAlign:"right",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series):this._spec.label.position==="right"?this.setMarkStyle(this._labelMark,{x:t=>t.x1,y:t=>(t.y0+t.y1)/2,fill:t=>{var e,i,n,r;return(n=(i=(e=this._spec.node)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.fill)!==null&&n!==void 0?n:(r=this._colorScale)===null||r===void 0?void 0:r.scale(this._getNodeNameFromData(t))},text:t=>this._createText(t),limit:this._labelLimit,textAlign:"left",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series):this.setMarkStyle(this._labelMark,{x:t=>t.x1>=this._viewBox.x2?t.x0:t.x1,y:t=>(t.y0+t.y1)/2,fill:t=>{var e,i,n,r;return(n=(i=(e=this._spec.node)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.fill)!==null&&n!==void 0?n:(r=this._colorScale)===null||r===void 0?void 0:r.scale(this._getNodeNameFromData(t))},text:t=>this._createText(t),limit:this._labelLimit,textAlign:t=>t.x1>=this._viewBox.x2?"right":"left",textBaseline:"middle"},bt.STATE_NORMAL,tt.Series),this._labelMark.setZIndex(this._labelLayoutZIndex),this._trigger.registerMark(this._labelMark))}_createText(t){var e;if(P(t)||P(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";return!((e=this._spec.label)===null||e===void 0)&&e.formatMethod&&(i=this._spec.label.formatMethod(i,t.datum)),i}initAnimation(){var t,e,i,n,r;const a={direction:this.direction,growFrom:()=>{var l,h;return this.direction==="horizontal"?(l=this._xAxisHelper)===null||l===void 0?void 0:l.getScale(0).scale(0):(h=this._yAxisHelper)===null||h===void 0?void 0:h.getScale(0).scale(0)}},o=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(zt((i=F.getAnimationInKey("sankeyNode"))===null||i===void 0?void 0:i(a,o),Yt("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(zt((n=F.getAnimationInKey("sankeyLinkPath"))===null||n===void 0?void 0:n(a,o),Yt("link",this._spec,this._markAttributeContext))),this._labelMark&&this._labelMark.setAnimationConfig(zt((r=F.getAnimationInKey("fadeInOut"))===null||r===void 0?void 0:r(),Yt("label",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),(t=this._nodesSeriesData.getDataView())===null||t===void 0||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),(e=this._linksSeriesData.getDataView())===null||e===void 0||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const n=(i=this._spec.emphasis)!==null&&i!==void 0?i:{};this._option.disableTriggerEvent!==!0&&(n.enable&&n.effect==="adjacency"&&(n.trigger==="hover"?this.event.on("pointerover",{level:Xt.chart},this._handleAdjacencyClick):this.event.on("pointerdown",{level:Xt.chart},this._handleAdjacencyClick)),n.enable&&n.effect==="related"&&(n.trigger==="hover"?this.event.on("pointerover",{level:Xt.chart},this._handleRelatedClick):this.event.on("pointerdown",{level:Xt.chart},this._handleRelatedClick)))}nodesSeriesDataUpdate(){this._nodesSeriesData.updateData(),this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linksSeriesData.updateData()}initTooltip(){this._tooltipHelper=new dst(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}_setNodeOrdinalColorScale(){var t,e,i,n,r;const a=(e=(t=this._option)===null||t===void 0?void 0:t.globalScale)===null||e===void 0?void 0:e.getScale("color");if(a!=null&&a._specified)return void(this._colorScale=a);let o,l;a&&(o=a.domain(),l=a.range()),l||(l=this._getDataScheme()),o&&!P(o[0])||(o=this.getNodeList(),o.length>10&&(l=(i=this._getDataScheme()[1])===null||i===void 0?void 0:i.scheme));const h=new jc;(r=(n=h.domain(o)).range)===null||r===void 0||r.call(n,l),this._colorScale=h}getNodeList(){var t,e,i;return!((t=this._rawData.latestData[0])===null||t===void 0)&&t.nodes?!((e=this._rawData.latestData[0].nodes[0])===null||e===void 0)&&e.children?Array.from(this.extractNamesFromTree(this._rawData.latestData[0].nodes,this._spec.categoryField)):this._rawData.latestData[0].nodes.map((n,r)=>n[this._spec.categoryField]):(i=this._rawData.latestData[0])===null||i===void 0?void 0:i.values.map((n,r)=>n[this._spec.categoryField])}_getNodeNameFromData(t){return t!=null&&t.datum?t==null?void 0:t.datum[this._spec.categoryField]:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach(n=>{i.add(n[e]),n.children&&this.extractNamesFromTree(n.children,e).forEach(r=>i.add(r))}),i}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(!((i=this._viewDataStatistics.latestData)===null||i===void 0)&&i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}_collectByField(t){var e,i,n;const r=[],a=(i=(e=this.getRawData())===null||e===void 0?void 0:e.latestData)===null||i===void 0?void 0:i[0];if(!a)return[];if(a.links)!((n=a.nodes)===null||n===void 0)&&n.length&&a.nodes.forEach(o=>{o[this._seriesField]&&r.push(o[this._seriesField])});else if(a.nodes){const o=new Set;return VD(o,a.nodes,this._seriesField),Array.from(o)}return r}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform(),this._nodesSeriesData.updateData(),this._linksSeriesData.updateData()}getDefaultShapeType(){return"square"}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._nodeMark,this._linkMark]}}Fa.type=z.sankey,Fa.mark=XL;const _st=()=>{rst(),io(),fst(),Gs(),gst(),$r(),F.registerSeries(Fa.type,Fa)},mst=(s,t)=>{if(!s||!(t!=null&&t.range))return s;const e=t.range();return e.x1-e.x0==0||e.y1-e.y0==0?s:new dv(t).layout(s,e)},vst=(s,t)=>{let e={},i=t.fields;if(K(i)&&(i=i()),!(i!=null&&i.length)||!(s!=null&&s.length)||!s[0].latestData)return e;const n=s[0].latestData,r=Wh(n);return e=Ax([{latestData:r}],t),e};class yst extends ys{constructor(){super(...arguments),this.contentKeyCallback=t=>t==null?void 0:t[this.series.getDimensionField()[0]]}get defaultShapeType(){return"square"}}const bst=s=>s==="fadeIn"?{type:"fadeIn"}:{type:"growCenterIn"},xst=()=>{F.registerAnimation("treemap",(s,t)=>({appear:bst(t),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{type:"growCenterOut"}}))};class $D extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}class Jn extends pn{constructor(){super(...arguments),this.type=z.treemap,this.transformerConstructor=$D,this._viewBox=new Pi,this._enableAnimationHook=this.enableMarkAnimation.bind(this)}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField((t=this._spec.seriesField)!==null&&t!==void 0?t:Xa),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new Ke),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var e,i;return(i=(e=this._spec.drillField)!==null&&e!==void 0?e:this._categoryField)!==null&&i!==void 0?i:ar},getRawData:()=>this.getRawData()}),N(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){var t,e,i,n;super.initData(),this.getViewData()&&(this._spec.drill&&this.initDrillableData(this._dataSet),Ct(this._dataSet,"treemap",mst),Ct(this._dataSet,"flatten",Wh),this.addViewDataFilter({type:"treemap",options:{range:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),maxDepth:this._maxDepth,gapWidth:this._spec.gapWidth,padding:this._spec.nodePadding,splitType:this._spec.splitType,aspectRatio:this._spec.aspectRatio,labelPadding:!((t=this._spec.nonLeafLabel)===null||t===void 0)&&t.visible?(e=this._spec.nonLeafLabel)===null||e===void 0?void 0:e.padding:0,labelPosition:(i=this._spec.nonLeafLabel)===null||i===void 0?void 0:i.position,minVisibleArea:(n=this._spec.minVisibleArea)!==null&&n!==void 0?n:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize},level:Hs.treemapFilter}),this.addViewDataFilter({type:"flatten",options:{callback:r=>{if(r.datum){const a=r.datum[r.depth];return Object.assign(Object.assign({},r),a)}return r}},level:Hs.treemapFlatten}))}_addDataIndexAndKey(){var t;!((t=this._rawData)===null||t===void 0)&&t.dataSet&&(Ct(this._rawData.dataSet,"addVChartProperty",ed),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:uA.bind(this),call:iv}}))}getRawDataStatisticsByField(t,e){var i;if(!this._rawDataStatistics){const n=`${this.type}_${this.id}_rawDataStatic`;this._rawDataStatistics=this._createHierarchyDataStatistics(n,[this._rawData]),this._rawData.target.removeListener("change",this._rawDataStatistics.reRunAllTransform),this._rawDataStatistics.reRunAllTransform()}return(i=this._rawDataStatistics.latestData)===null||i===void 0?void 0:i[t]}_createHierarchyDataStatistics(t,e){Ct(this._dataSet,"hierarchyDimensionStatistics",vst),Ct(this._dataSet,"flatten",Wh);const i=new Jt(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const n=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&n.push({key:this._seriesField,operations:["values"]}),n}}},!1),i}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:Ku,operations:["max","min","values"]},{key:Xa,operations:["values"]}])}initMark(){var t,e;const i=this._createMark(Jn.mark.nonLeaf,{isSeriesMark:!0,customShape:(t=this._spec.nonLeaf)===null||t===void 0?void 0:t.customShape});i&&(i.setTransform([{type:"filter",callback:r=>!this._shouldFilterElement(r,"nonLeaf")}]),this._trigger.registerMark(i),this._nonLeafMark=i);const n=this._createMark(Jn.mark.leaf,{isSeriesMark:!0,customShape:(e=this._spec.leaf)===null||e===void 0?void 0:e.customShape});n&&(n.setTransform([{type:"filter",callback:r=>!this._shouldFilterElement(r,"leaf")}]),this._leafMark=n,this._trigger.registerMark(n))}initMarkStyle(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}_initLeafMarkStyle(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},bt.STATE_NORMAL,tt.Series)}_initNonLeafMarkStyle(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},bt.STATE_NORMAL,tt.Series)}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:e=>(e.x0+e.x1)/2,y:e=>(e.y0+e.y1)/2,text:e=>{var i;return(i=e.datum[e.depth])===null||i===void 0?void 0:i[this.getDimensionField()[0]]},maxLineWidth:e=>e.x1===e.x0?Number.MIN_VALUE:e.x1-e.x0},bt.STATE_NORMAL,tt.Series))}initNonLeafLabelMarkStyle(t){t&&(this._nonLeafLabelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:e=>e.labelRect?(e.labelRect.x0+e.labelRect.x1)/2:(e.x0+e.x1)/2,y:e=>e.labelRect?(e.labelRect.y0+e.labelRect.y1)/2:(e.y0+e.y1)/2,text:e=>{var i;return(i=e.datum[e.depth])===null||i===void 0?void 0:i[this.getDimensionField()[0]]},maxLineWidth:e=>e.x1===e.x0?Number.MIN_VALUE:e.x1-e.x0},bt.STATE_NORMAL,tt.Series))}initAnimation(){this.getMarksInType("rect").forEach(t=>{var e;t.setAnimationConfig(zt((e=F.getAnimationInKey("treemap"))===null||e===void 0?void 0:e(),Yt(t.name,this._spec,this._markAttributeContext)))}),this.getMarksInType("text").forEach(t=>{var e;t.setAnimationConfig(zt((e=F.getAnimationInKey("fadeInOut"))===null||e===void 0?void 0:e(),Yt(t.name,this._spec,this._markAttributeContext)))})}initEvent(){super.initEvent(),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",t=>{this.handlePan(t)}),this.initZoomEventOfSeries(this),this.event.on("zoom",t=>{this.handleZoom(t)})),this._spec.drill&&this.bindDrillEvent()}_getDataIdKey(){return"key"}initTooltip(){this._tooltipHelper=new yst(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return e==="leaf"?!i:i}handlePan(t){const{delta:e}=t;if(e[0]===0&&e[1]===0)return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:n,c:r,d:a,e:o,f:l}=this._matrix;this._matrix.multiply(i,n,r,a,o,l),this._viewBox.transformWithMatrix(this._matrix),this.reFilterViewData()}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(e===1)return;this._matrix.reset();const{x:n,y:r}=i;this._matrix.translate(n,r),this._matrix.scale(e,e),this._matrix.translate(-n,-r);const{a,b:o,c:l,d:h,e:d,f:u}=this._matrix;this._matrix.multiply(a,o,l,h,d,u),this.disableMarkAnimation(),this.event.on(gt.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this.reFilterViewData()}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._rawData.reRunAllTransform()}enableMarkAnimation(){this.getMarks().forEach(t=>{var e;(e=t.getProduct().animate)===null||e===void 0||e.enable()}),[this._labelMark,this._nonLeafLabelMark].forEach(t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().enableAnimation()}),this.event.off(gt.AFTER_DO_RENDER,this._enableAnimationHook)}disableMarkAnimation(){this.getMarks().forEach(t=>{var e;(e=t.getProduct().animate)===null||e===void 0||e.disable()}),[this._labelMark,this._nonLeafLabelMark].forEach(t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().disableAnimation()})}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._nonLeafMark,this._leafMark]}}Jn.type=z.treemap,Jn.mark=YL,Jn.transformerConstructor=$D,Ai(Jn,AA),Ai(Jn,mA);const Sst=()=>{io(),Gs(),xst(),$r(),F.registerSeries(Jn.type,Jn)},Ast=s=>({channel:{angle:{from:s.startAngle+Math.PI/2}}}),kst={type:"fadeIn"};function wst(s,t){return t==="fadeIn"?kst:Ast(s)}const Tst=()=>{F.registerAnimation("gaugePointer",(s,t)=>{const e=wst(s,t);return{appear:e,enter:e,disappear:{type:"fadeOut"}}})};class ja extends id{constructor(){super(...arguments),this.type=z.gaugePointer,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null,this._stack=!1}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType=((t=this._spec.pointer)===null||t===void 0?void 0:t.type)==="rect"?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(ja.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},ja.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(ja.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:i=>{var n,r;const{x:a}=this._getPointerAnchor(i,e);return a-this._getPointerWidth()*((r=(n=e==null?void 0:e.center)===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:0)},y:i=>{var n,r;const{y:a}=this._getPointerAnchor(i,e);return a-this._getPointerHeight(i)*((r=(n=e==null?void 0:e.center)===null||n===void 0?void 0:n[1])!==null&&r!==void 0?r:0)},anchor:i=>{const{x:n,y:r}=this._getPointerAnchor(i,e);return[n,r]},fill:this.getColorAttribute(),zIndex:200}),this._pointerType==="path"?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:i=>this._getPointerAngle(i)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:i=>this._getPointerAngle(i)-Math.PI/2}),this._trigger.registerMark(t))}initTooltip(){super.initTooltip(),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return(i=e.isOnCenter)===null||i===void 0||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const n=this._spec.pointer,r=this._radiusField[0];return E(this.radiusAxisHelper)&&E(r)?this.radiusAxisHelper.dataToPosition([t[r]])-((e=n==null?void 0:n.innerPadding)!==null&&e!==void 0?e:0)-((i=n==null?void 0:n.outerPadding)!==null&&i!==void 0?i:10):n.height*this._computeLayoutRadius()}_getPointerAngle(t){return this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])}_getRotatedPointerCenterOffset(t){var e,i,n,r;const a=this._spec.pointer,o=this._getPointerWidth()*((i=(e=a==null?void 0:a.center)===null||e===void 0?void 0:e[0])!==null&&i!==void 0?i:0),l=-this._getPointerHeight(t)*((r=(n=a==null?void 0:a.center)===null||n===void 0?void 0:n[1])!==null&&r!==void 0?r:0),h=this._getPointerAngle(t)-Math.PI/2,d=Math.cos(h),u=Math.sin(h);return{x:o*d+l*u,y:-(l*d-o*u)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:i=>this._getPointerAnchor(i,e).x,y:i=>this._getPointerAnchor(i,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:i=>this._getPointerAnchor(i,e).x,y:i=>this._getPointerAnchor(i,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}initAnimation(){var t,e,i;const n=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;this._pointerMark.setAnimationConfig(zt((i=F.getAnimationInKey("gaugePointer"))===null||i===void 0?void 0:i({startAngle:this._startAngle},n),Yt("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}ja.type=z.gaugePointer,ja.mark=qL;const Mst=()=>{rD(),io(),Tst(),F.registerSeries(ja.type,ja)};class YD extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class za extends id{constructor(){super(...arguments),this.type=z.gauge,this.transformerConstructor=YD,this._segmentMark=null,this._trackMark=null,this._stack=!1,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=ue((t=this._spec.padAngle)!==null&&t!==void 0?t:0)}initData(){var t;super.initData(),Ct(this._option.dataSet,"spiltSegment",(e,i)=>{const n=e.slice();return n.sort((r,a)=>r[this._angleField[0]]-a[this._angleField[0]]),n.forEach((r,a)=>{r[D0]=r[this._angleField[0]],r[bg]=a>0?n[a-1][D0]:void 0}),n}),(t=this.getViewData())===null||t===void 0||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark(za.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(za.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&(this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var i;return this._computeLayoutRadius()*((i=this._spec.innerRadius)!==null&&i!==void 0?i:0)},outerRadius:()=>{var i,n;return this._computeLayoutRadius()*((n=(i=this._spec.radius)!==null&&i!==void 0?i:this._spec.outerRadius)!==null&&n!==void 0?n:1)},cap:(t=this._spec.roundCap)!==null&&t!==void 0&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0}),this._trigger.registerMark(e))}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&(this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var i;return this._computeLayoutRadius()*((i=this._spec.innerRadius)!==null&&i!==void 0?i:0)},outerRadius:()=>{var i,n;return this._computeLayoutRadius()*((n=(i=this._spec.radius)!==null&&i!==void 0?i:this._spec.outerRadius)!==null&&n!==void 0?n:1)},cap:(t=this._spec.roundCap)!==null&&t!==void 0&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100}),this._trigger.registerMark(e))}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Math.min(e+this._padAngle/2,(e+i)/2)}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Math.max(i-this._padAngle/2,(e+i)/2)}_getAngleValueStartWithoutPadAngle(t){return E(t[bg])?this.angleAxisHelper.dataToPosition([t[bg]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[D0]])}initAnimation(){var t,e,i;const n=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset;this._segmentMark.setAnimationConfig(zt((i=F.getAnimationInKey("circularProgress"))===null||i===void 0?void 0:i({startAngle:this._startAngle},n),Yt("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}za.type=z.gauge,za.mark=KL,za.transformerConstructor=YD;const Cst=()=>{AD(),kD(),F.registerSeries(za.type,za)};class _c extends UB{constructor(){super(...arguments),this.type=_c.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{padding:0})}}_c.type="cell";const Pst=()=>{F.registerMark(_c.type,_c),i9(),sq()};function Est(s){return s===!1?{}:{type:"fadeIn"}}const Rst=()=>{F.registerAnimation("heatmap",(s,t)=>Object.assign(Object.assign({},tv),{appear:Est(t)}))};class Ost extends ys{getDefaultTooltipPattern(t,e){const i=super.getDefaultTooltipPattern(t,e);return E(i)&&t==="dimension"&&(i.visible=!1),i}}class XD extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}class Br extends pn{constructor(){super(...arguments),this.type=z.heatmap,this.transformerConstructor=XD}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Y(t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._cellMark=this._createMark(Br.mark.cell,{morph:Yr(this._spec,Br.mark.cell.name),defaultMorphElementKey:this.getDimensionField()[0],isSeriesMark:!0,progressive:i,customShape:(t=this._spec.cell)===null||t===void 0?void 0:t.customShape}),this._backgroundMark=this._createMark(Br.mark.cellBackground,{progressive:i,customShape:(e=this._spec.cellBackground)===null||e===void 0?void 0:e.customShape})}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:e=>e[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",tt.Series),this._trigger.registerMark(this._cellMark)}initCellBackgroundMarkStyle(){var t,e,i;const n=_s((i=(e=(t=this._spec.cellBackground)===null||t===void 0?void 0:t.style)===null||e===void 0?void 0:e.padding)!==null&&i!==void 0?i:0);this.setMarkStyle(this._backgroundMark,{x:r=>{const a=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(r)-a/2+n[3]},y:r=>{const a=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(r)-a/2+n[0]},width:()=>this.getCellSize(this._xAxisHelper)-n[1]-n[3],height:()=>this.getCellSize(this._yAxisHelper)-n[0]-n[2]},"normal",tt.Series)}getColorAttribute(){var t;return{scale:(t=this._option.globalScale.getScale("color"))!==null&&t!==void 0?t:this._getDefaultColorScale(),field:this.getFieldValue[0]}}initAnimation(){var t,e,i;const n=(e=(t=this._spec)===null||t===void 0?void 0:t.animationAppear)===null||e===void 0?void 0:e.preset,r=to(this);this._cellMark.setAnimationConfig(zt((i=F.getAnimationInKey("heatmap"))===null||i===void 0?void 0:i(n),Yt("cell",this._spec,this._markAttributeContext),r))}getCellSize(t){var e,i;return(i=(e=t.getBandwidth)===null||e===void 0?void 0:e.call(t,0))!==null&&i!==void 0?i:6}initTooltip(){this._tooltipHelper=new Ost(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"square"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}Br.type=z.heatmap,Br.mark=eB,Br.transformerConstructor=XD;const Ist=()=>{Gs(),Pst(),Rst(),F.registerSeries(Br.type,Br)},Lst=(s,t)=>{var e,i,n,r,a,o,l,h,d,u,c,p,g,f,_;if(!s||!(t!=null&&t.view)||!$(s))return s;const m=t.view();if(m.x1-m.x0==0||m.y1-m.y0==0||m.x1-m.x0==-1/0||m.x1-m.x0==1/0||m.y1-m.y0==-1/0||m.y1-m.y0==1/0)return s;const v=ue((e=t.startAngle)!==null&&e!==void 0?e:-90),y=ue((i=t.endAngle)!==null&&i!==void 0?i:270),b=Math.max((m.x1-m.x0)/2,(m.y1-m.y0)/2),x=Ds((n=t.innerRadius)!==null&&n!==void 0?n:0,b),S=Ds(t.outerRadius,b),A=[dt((r=t.center)===null||r===void 0?void 0:r[0])?t.center[0]:m.x0+Ds((o=(a=t.center)===null||a===void 0?void 0:a[0])!==null&&o!==void 0?o:"50%",m.x1-m.x0),dt((l=t.center)===null||l===void 0?void 0:l[1])?t.center[1]:m.y0+Ds((d=(h=t.center)===null||h===void 0?void 0:h[1])!==null&&d!==void 0?d:"50%",m.y1-m.y0)],k=In(t.field),w=s.map(k),[T,M]=Ab(w),C=T===M?V=>(x+S)/2:V=>x+(S-x)*(V-T)/(M-T),R=P(t.radiusField)?k:In(t.radiusField),I=(c=(u=t==null?void 0:t.radiusRange)===null||u===void 0?void 0:u[1])!==null&&c!==void 0?c:5;let O=V=>I;if(R){const[V,X]=R!==k?Ab(s.map(R)):[T,M],Q=(g=(p=t.radiusRange)===null||p===void 0?void 0:p[0])!==null&&g!==void 0?g:5,J=(_=(f=t.radiusRange)===null||f===void 0?void 0:f[1])!==null&&_!==void 0?_:5;V!==X&&(O=nt=>Q+(J-Q)*(R(nt)-V)/(X-V))}const L=Math.min(v,y),D=Math.max(v,y),j=Bst(L,D,s.length),H=[],W=(D-L)/60;return s.forEach((V,X)=>{const Q=C(w[X]),J=O(V);let nt,q,U=j[X];for(let it=0;it<60&&(nt=A[0]+Q*Math.cos(U),q=A[1]+Q*Math.sin(U),Dst({x:nt,y:q,size:J},H)||nt-J<m.x0||nt+J>m.x1||q-J<m.y0||q+J>m.y1);it++)it<59&&(U+=W,U>D?U=L:U<L&&(U=D));H.push(Object.assign({[CL]:nt,[PL]:q,[EL]:J},V))}),H},Bst=(s,t,e)=>{let i=0,n=Math.max(Math.ceil(2*(t-s)/Math.PI),2),r=(t-s)/n,a=0,o=1,l=0,h=0;const d=[];let u=s;for(;l<e;)h<n&&(d.push(u+(h%2?Math.floor(h/2)+Math.floor(n/2):h/2)*r*o),h++),l++,h===n&&(h=0,a+=1,o*=-1,i===0?i=r/2:i/=2,u=o===-1?t-i:s+i,a>=2&&(r/=2,n*=2));return d},Dst=(s,t)=>!(!t||!t.length)&&t.some(e=>Math.pow(s.x-e.x,2)+Math.pow(s.y-e.y,2)<Math.pow(s.size+e.size,2)),Fst=(s,t)=>{if(!s||!$(s))return[];const{keyword:e,categoryField:i}=t,n=s[0].latestData[0];return{[i]:e,[Si]:n==null?void 0:n[Si],[Fs]:n==null?void 0:n[Fs]}};class mc extends Hi{constructor(){super(...arguments),this.type=mc.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.glyph("ripplePoint",t??e.rootMark).id(i),this._compiledProductId=i}}mc.type="ripple";const jst=()=>{F.registerMark(mc.type,mc),u9()},zst=(s,t)=>t==="fadeIn"?{type:"fadeIn"}:{type:"scaleIn"},Hst=()=>{F.registerAnimation("correlation",(s,t)=>Object.assign({appear:zst(0,t)},hA))};class KD extends Ns{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class Dr extends Uc{constructor(){super(...arguments),this.type=z.correlation,this.transformerConstructor=KD,this._viewBox=new Pi}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}getSeriesField(){return this._seriesField}setSeriesField(t){E(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){E(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){E(t)&&(this._sizeRange=t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(this._spec.seriesField),this.setSizeField(this._spec.sizeField),this.setSizeRange(this._spec.sizeRange)}initData(){var t,e,i;if(super.initData(),!this._data)return;Ct(this._dataSet,"correlation",Lst);const n=new ko;Lr(n,"dataview",rm),Ct(n,"correlationCenter",Fst);const r=new Jt(n,{name:`${this.type}_${this.id}_center`});r.parse([this.getViewData()],{type:"dataview"}),r.transform({type:"correlationCenter",options:{keyword:(i=(e=(t=this._spec.centerLabel)===null||t===void 0?void 0:t.style)===null||e===void 0?void 0:e.text)!==null&&i!==void 0?i:"",categoryField:this._spec.categoryField}}),this._centerSeriesData=new or(this._option,r)}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:this._spec.valueField,radiusRange:this._spec.sizeRange,radiusField:this._spec.sizeField,center:[this._spec.centerX,this._spec.centerY],innerRadius:this._spec.innerRadius,outerRadius:this._spec.outerRadius,startAngle:this._spec.startAngle,endAngle:this._spec.endAngle}})}initMark(){var t,e;const i=this._createMark(Dr.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:Si,customShape:(t=this._spec.nodePoint)===null||t===void 0?void 0:t.customShape});i&&(i.setZIndex(ce.Node),this._nodePointMark=i);const n=this._createMark(Dr.mark.ripplePoint,{key:Si,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});n&&(this._ripplePointMark=n);const r=this._createMark(Dr.mark.centerPoint,{key:Si,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId(),customShape:(e=this._spec.centerPoint)===null||e===void 0?void 0:e.customShape});r&&(r.setZIndex(ce.Node),this._centerPointMark=r)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var t,e,i,n;const r=this._nodePointMark;if(!r)return;const a=(e=(t=this._spec.nodePoint)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{};this.setMarkStyle(r,{x:o=>o[CL],y:o=>o[PL],size:o=>o[EL],fill:(i=a.fill)!==null&&i!==void 0?i:this.getColorAttribute(),fillOpacity:(n=a.fillOpacity)!==null&&n!==void 0?n:1,lineWidth:0},bt.STATE_NORMAL,tt.Series),this._trigger.registerMark(r)}_initRipplePointMarkStyle(){var t,e,i,n,r;const a=this._ripplePointMark;if(!a)return;const o=(e=(t=this._spec.ripplePoint)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{};this.setMarkStyle(a,{x:()=>{var l;return(l=this._spec.centerX)!==null&&l!==void 0?l:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var l;return(l=this._spec.centerY)!==null&&l!==void 0?l:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:(i=o.fill)!==null&&i!==void 0?i:this.getColorAttribute(),opacity:(n=o.fillOpacity)!==null&&n!==void 0?n:.2,ripple:(r=o.ripple)!==null&&r!==void 0?r:0},bt.STATE_NORMAL,tt.Series)}_initCenterPointMarkStyle(){var t,e,i,n,r,a;const o=this._centerPointMark;o&&(this.setMarkStyle(o,{x:()=>{var l;return(l=this._spec.centerX)!==null&&l!==void 0?l:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var l;return(l=this._spec.centerY)!==null&&l!==void 0?l:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:(i=(e=(t=this._spec.centerPoint)===null||t===void 0?void 0:t.style)===null||e===void 0?void 0:e.fill)!==null&&i!==void 0?i:this.getColorAttribute(),fillOpacity:(a=(r=(n=this._spec.centerPoint)===null||n===void 0?void 0:n.style)===null||r===void 0?void 0:r.fillOpacity)!==null&&a!==void 0?a:1},bt.STATE_NORMAL,tt.Series),this._trigger.registerMark(o))}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:e=>e[this._categoryField],z:this.dataToPositionZ.bind(this)},bt.STATE_NORMAL,tt.Series)}initAnimation(){var t,e;const i=(t=this._spec.animationAppear)===null||t===void 0?void 0:t.preset;this._nodePointMark.setAnimationConfig(zt((e=F.getAnimationInKey("correlation"))===null||e===void 0?void 0:e({},i),Yt("nodePoint",this._spec,this._markAttributeContext)))}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._nodePointMark,this._centerPointMark]}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}Dr.type=z.correlation,Dr.mark=iB,Dr.transformerConstructor=KD;const Nst=()=>{eo(),jst(),F.registerSeries(Dr.type,Dr),Hst()};class qD extends gn{_isValidSeries(t){return t===z.map}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:t.type,nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,map:t.map,nameProperty:t.nameProperty,centroidProperty:t.centroidProperty,nameMap:t.nameMap,area:t.area,defaultFillColor:t.defaultFillColor})}transformSpec(t){super.transformSpec(t),t.region.forEach(i=>{i.coordinate="geo"});const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class Bl extends Ce{constructor(){super(...arguments),this.transformerConstructor=qD,this.type="map",this.seriesType=z.map}}Bl.type="map",Bl.seriesType=z.map,Bl.view="singleDefault",Bl.transformerConstructor=qD;const Gst=()=>{JQ(),F.registerChart(Bl.type,Bl)};class kA extends gn{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,n;const r=Y(t.indicator),a=(e=t.innerRadius)!==null&&e!==void 0?e:(n=(i=t.series)===null||i===void 0?void 0:i[0])===null||n===void 0?void 0:n.innerRadius;return E(a)&&r.forEach(o=>{P(o.limitRatio)&&(o.limitRatio=a)}),r}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:t.radius,outerRadius:t.outerRadius,innerRadius:t.innerRadius,startAngle:t.startAngle,endAngle:t.endAngle,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),$(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach(i=>{i.filterMode==="axis"&&(i.filterMode="filter")});const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e],E(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class ZD extends kA{needAxes(){return!1}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,categoryField:t.categoryField||t.radiusField,valueField:t.valueField||t.angleField,startAngle:t.startAngle,endAngle:t.endAngle,radius:t.radius,innerRadius:t.innerRadius,centerX:t.centerX,centerY:t.centerY})}_transformProgressAxisSpec(t,e,i,n,r){var a,o;t.axes||(t.axes=[]);let l=((a=t.axes)!==null&&a!==void 0?a:[]).find(u=>u.orient==="radius"),h=((o=t.axes)!==null&&o!==void 0?o:[]).find(u=>u.orient==="angle");h||(h=e,t.axes.push(h)),l||(l=i,t.axes.push(l)),P(h.type)&&(h.type="linear"),P(l.type)&&(l.type="band");const d=nc(h,{min:0,max:1});P(h.min)&&(h.min=d.min),P(h.max)&&(h.max=d.max),n&&Object.assign(h,yt({},n,h)),r&&Object.assign(l,yt({},r,l))}}class JD extends kA{needAxes(){return!0}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.angleField,valueField:t.valueField||t.radiusField})}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};((e=t.axes)!==null&&e!==void 0?e:[]).forEach(n=>{const{orient:r}=n;r==="radius"&&(i.radius=!0),r==="angle"&&(i.angle=!0)}),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class Xc extends kA{needAxes(){return!1}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.seriesField,valueField:t.valueField||t.angleField,center:t.center,centerOffset:t.centerOffset,cornerRadius:t.cornerRadius,padAngle:t.padAngle,minAngle:t.minAngle})}}class wA extends Ce{constructor(){super(...arguments),this.transformerConstructor=Xc}}wA.transformerConstructor=Xc;class Dl extends wA{constructor(){super(...arguments),this.transformerConstructor=Xc,this.type="pie",this.seriesType=z.pie}}Dl.type="pie",Dl.seriesType=z.pie,Dl.view="singleDefault",Dl.transformerConstructor=Xc;const Wst=()=>{Ctt(),F.registerChart(Dl.type,Dl)};class QD extends Xc{transformSpec(t){super.transformSpec(t),t.series.forEach(e=>{e.type==="pie3d"&&(e.angle3d=t.angle3d)})}}class Fl extends wA{constructor(){super(...arguments),this.transformerConstructor=QD,this.type="pie3d",this.seriesType=z.pie3d}}Fl.type="pie3d",Fl.seriesType=z.pie3d,Fl.view="singleDefault",Fl.transformerConstructor=QD;const Vst=()=>{Ett(),F.registerChart(Fl.type,Fl)};class t2 extends JD{_getDefaultSeriesSpec(t){var e,i,n;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:(e=t.radius)!==null&&e!==void 0?e:ju,outerRadius:(i=t.outerRadius)!==null&&i!==void 0?i:ju,innerRadius:(n=t.innerRadius)!==null&&n!==void 0?n:0,seriesField:t.seriesField,stack:t.stack,percent:t.percent})}transformSpec(t){var e;super.transformSpec(t),((e=t.axes)!==null&&e!==void 0?e:[]).forEach(i=>{["domainLine","grid","label","tick"].forEach(n=>{i[n]||(i[n]={visible:!1})}),i.orient==="angle"&&P(i.bandPosition)&&(i.bandPosition=.5)}),t.crosshair=Y(t.crosshair||{}).map(i=>yt({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},i))}}class jl extends Ce{constructor(){super(...arguments),this.transformerConstructor=t2,this.type="rose",this.seriesType=z.rose,this._canStack=!0}}jl.type="rose",jl.seriesType=z.rose,jl.view="singleDefault",jl.transformerConstructor=t2;const Ust=()=>{Ftt(),F.registerChart(jl.type,jl)};class e2 extends JD{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,line:t.line,point:t.point,stack:t.stack,percent:t.percent,area:yt({visible:!1},t.area),seriesMark:(e=t.seriesMark)!==null&&e!==void 0?e:"area",activePoint:t.activePoint,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap})}transformSpec(t){var e;super.transformSpec(t),((e=t.axes)!==null&&e!==void 0?e:[]).forEach(i=>{i.orient==="radius"&&(["domainLine","label","tick"].forEach(n=>{i[n]||(i[n]={visible:!1})}),i.grid||(i.grid={visible:!0,smooth:!0}))}),t.crosshair=Y(t.crosshair||{}).map(i=>yt({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},i))}}class zl extends Ce{constructor(){super(...arguments),this.transformerConstructor=e2,this.type="radar",this.seriesType=z.radar,this._canStack=!0}}zl.type="radar",zl.seriesType=z.radar,zl.view="singleDefault",zl.transformerConstructor=e2;const $st=()=>{Wtt(),F.registerChart(zl.type,zl)};class i2 extends gn{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})})}t.axes&&t.axes.length&&t.axes.forEach(e=>{It(e,"trimPadding")&&yt(e,MB(this.type,t))})}}class hu extends Ce{constructor(){super(...arguments),this.transformerConstructor=i2,this.type="common",this._canStack=!0}}hu.type="common",hu.view="singleDefault",hu.transformerConstructor=i2;const Yst=()=>{F.registerChart(hu.type,hu)},Mx=12;class s2 extends gn{_getSeriesDataLength(t,e){var i,n;if(e.data){const a=Y(e.data)[0];return a instanceof Jt?(i=a.latestData)===null||i===void 0?void 0:i.length:(n=a.values)===null||n===void 0?void 0:n.length}const r=Y(t.data).find((a,o)=>e.dataId?a instanceof Jt?a.name===e.dataId:a.id===e.dataId:e.dataIndex===o);return r?r instanceof Jt?r.latestData.length:r.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}transformSpec(t){var e,i,n,r,a,o,l,h,d,u,c;super.transformSpec(t);let p=0;const g=[],f=[],_=[],m=[],v=[],y=t.series.filter(k=>k.type!==z.link).length,b=(500-20*(y-1))/y,x=((e=t==null?void 0:t.appendPadding)===null||e===void 0?void 0:e.left)||0,S=((i=t==null?void 0:t.appendPadding)===null||i===void 0?void 0:i.right)||0;if(t!=null&&t.legends){g.push({modelId:`legendRow${p}`,col:1,row:p}),this.addAttrToComponentSpec(t.legends,"id",`legendRow${p}`);const k=Y(t.legends);let w=(n=k[0].height)!==null&&n!==void 0?n:40;if(k[0].padding){const T=Hr(k[0].padding);w+=Number((r=T==null?void 0:T.bottom)!==null&&r!==void 0?r:0),w+=Number((a=T==null?void 0:T.top)!==null&&a!==void 0?a:0),k[0].offsetY=Number((l=(o=k[0])===null||o===void 0?void 0:o.offsetY)!==null&&l!==void 0?l:0)+Number((h=T==null?void 0:T.top)!==null&&h!==void 0?h:0)}v.push({index:p,size:w}),p++}t!=null&&t.dataZoom&&(g.push({modelId:`dataZoomRow${p}`,col:1,row:p}),this.addAttrToComponentSpec(t.dataZoom,"id",`dataZoomRow${p}`),p++,v.push({index:p,size:10}),p++),f.push({id:`regionAxesRow${p}`}),g.push({modelId:`axesRow${p}`,col:1,row:p}),t.axes[0].id=`axesRow${p}`,t.axes[0].regionIndex=Array.from(Array(t.series.length),(k,w)=>w+1),p++,(d=t==null?void 0:t.series)===null||d===void 0||d.forEach(k=>{var w,T;if([z.bar,z.line,z.area,z.dot].includes(k.type)){if(g.push({modelId:`${k.type}Row${p}`,col:1,row:p}),g.push({modelId:`axesLeftRow${p}`,col:0,row:p}),f.push({id:`${k.type}Row${p}`,clip:!1}),v.push({index:p,size:(k==null?void 0:k.height)||b}),_.push({orient:"left",id:`axesLeftRow${p}`,type:k.type===z.dot?"band":"linear",visible:k.type!==z.dot,title:{visible:!0,autoRotate:!1,style:{text:k==null?void 0:k.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:typeof((w=k==null?void 0:k.grid)===null||w===void 0?void 0:w.visible)!="boolean"||((T=k==null?void 0:k.grid)===null||T===void 0?void 0:T.visible),style:(M,C)=>{var R,I,O,L,D;let j=0;if(C===0){const H=(R=k==null?void 0:k.grid)===null||R===void 0?void 0:R.style;j=(O=(I=H==null?void 0:H.lineWidth)!==null&&I!==void 0?I:H==null?void 0:H.strokeWidth)!==null&&O!==void 0?O:1}return{lineWidth:j,stroke:((D=(L=k==null?void 0:k.grid)===null||L===void 0?void 0:L.style)===null||D===void 0?void 0:D.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:f.length-1}),k.type===z.dot){g.push({modelId:`scrollBarRightRow${p}`,col:2,row:p});const M=this._getSeriesDataLength(t,k);let C=0;M&&(C=((k==null?void 0:k.height)||b)/(30*M)),m.push(Object.assign({orient:"right",visible:k.type===z.dot&&C<1,id:`scrollBarRightRow${p}`,start:0,end:Math.min(C,1),filterMode:"axis",regionIndex:f.length-1,axisId:`axesLeftRow${p}`},Y(t==null?void 0:t.scrollBar)[0]))}k.regionIndex=f.length-1,p++,v.push({index:p,size:(k==null?void 0:k.padding)||20}),p++,k.leftAppendPadding=x,k.type===z.dot&&(k.title.style.dx=-x,k.subTitle.style.dx=-x)}}),(u=t==null?void 0:t.series)===null||u===void 0||u.forEach(k=>{if(k.type===z.link){const w=k.dotSeriesIndex+1;g.push({modelId:`${k.type}Row${w}`,col:1,row:w-1}),k.regionIndex=t.series[k.dotSeriesIndex].regionIndex,k.leftAppendPadding=x,k.height=t.series[k.dotSeriesIndex].height,k.clipHeight=t.series[k.dotSeriesIndex].clipHeight}}),t!=null&&t.legends&&this.addAttrToComponentSpec(t.legends,"regionIndex",[f.length-1]);const A={type:"grid",col:4,row:p,colWidth:[{index:0,size:x},{index:2,size:Mx},{index:3,size:S}],rowHeight:v,elements:g};t.layout=A,t.region=f,(c=t.axes)===null||c===void 0||c.push(..._),t.scrollBar=m}}var Xst=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};class du extends Ce{constructor(){super(...arguments),this.transformerConstructor=s2,this.type="sequence"}_createSeries(t,e){if(!t)return;const{spec:i}=e,n=Xst(e,["spec"]);let r;if(i.type===z.link&&(i.dotSeriesSpec=this._spec.series[i.dotSeriesIndex]),i.regionId&&(r=this.getRegionsInUserId(i.regionId)),r||(r=this.getRegionsInIndex(i.regionIndex?[i.regionIndex]:void 0)[0]),!r)return;const a=new t(i,Object.assign(Object.assign(Object.assign({},this._modelOption),n),{region:r,specKey:"series",globalScale:this._globalScale}));a&&(a.created(),this._series.push(a),r.addSeries(a))}}du.type="sequence",du.view="singleDefault",du.transformerConstructor=s2;const Kst=()=>{Ytt(),qtt(),F.registerChart(du.type,du)};class TA extends jn{transformSpec(t){super.transformSpec(t),t.axes.forEach(e=>e.type="linear")}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{x2Field:t==null?void 0:t.x2Field,y2Field:t==null?void 0:t.y2Field,barMinHeight:t==null?void 0:t.barMinHeight})}}class MA extends Ce{constructor(){super(...arguments),this.transformerConstructor=TA,this._canStack=!0}}MA.transformerConstructor=TA;class uv extends TA{transformSpec(t){super.transformSpec(t),Qa(t)}}class Hl extends MA{constructor(){super(...arguments),this.transformerConstructor=uv,this.type="histogram",this.seriesType=z.bar}}Hl.type="histogram",Hl.seriesType=z.bar,Hl.view="singleDefault",Hl.transformerConstructor=uv;const qst=()=>{JB(),F.registerChart(Hl.type,Hl)};class Nl extends MA{constructor(){super(...arguments),this.transformerConstructor=uv,this.type="histogram3d",this.seriesType=z.bar3d}}Nl.type="histogram3d",Nl.seriesType=z.bar3d,Nl.view="singleDefault",Nl.transformerConstructor=uv;const Zst=()=>{tD(),F.registerChart(Nl.type,Nl)};class n2 extends ZD{_getDefaultSeriesSpec(t){var e,i;const n=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},n),{cornerRadius:(e=t.cornerRadius)!==null&&e!==void 0?e:0,roundCap:(i=t.roundCap)!==null&&i!==void 0&&i,progress:t.progress,track:t.track,tickMask:t.tickMask})}transformSpec(t){super.transformSpec(t),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1})}}class Gl extends Ce{constructor(){super(...arguments),this.transformerConstructor=n2,this.type="circularProgress",this.seriesType=z.circularProgress,this._canStack=!0}}Gl.type="circularProgress",Gl.seriesType=z.circularProgress,Gl.view="singleDefault",Gl.transformerConstructor=n2;const Jst=()=>{tet(),F.registerChart(Gl.type,Gl)};class r2 extends ZD{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{radiusField:t.radiusField,pin:t.pin,pinBackground:t.pinBackground,pointer:t.pointer})}_getDefaultCircularProgressSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:z.circularProgress})}transformSpec(t){var e,i,n,r,a;super.transformSpec(t);let o=(e=t.series)===null||e===void 0?void 0:e.find(l=>l.type===z.gauge||l.type===z.circularProgress);P(o)&&(o=(i=t.gauge)!==null&&i!==void 0?i:this._getDefaultCircularProgressSeriesSpec(t),o.type==="circularProgress"&&(P(o.radiusField)&&P(o.categoryField)&&(o.radiusField=(r=(n=t.radiusField)!==null&&n!==void 0?n:t.categoryField)!==null&&r!==void 0?r:t.seriesField),P(o.valueField)&&P(o.angleField)&&(o.valueField=(a=t.valueField)!==null&&a!==void 0?a:t.angleField)),t.series.length===1?t.series.push(o):t.series.forEach(l=>{l.type===o.type&&Object.keys(o).forEach(h=>{h in l||(l[h]=o[h])})})),o.type===z.circularProgress?this._transformProgressAxisSpec(t,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:ce.Region+50}):this._transformGaugeAxisSpec(t)}_transformGaugeAxisSpec(t){var e;t.axes||(t.axes=[]);const i={radius:null,angle:null};((e=t.axes)!==null&&e!==void 0?e:[]).forEach(n=>{const{orient:r}=n;r==="radius"&&(i.radius=n),r==="angle"&&(i.angle=n)}),i.angle||(i.angle={orient:"angle",visible:!0},t.axes.push(i.angle)),i.radius||(i.radius={orient:"radius",visible:!1},t.axes.push(i.radius)),P(i.angle.type)&&(i.angle.type="linear"),P(i.radius.type)&&(i.radius.type="linear"),P(i.angle.zIndex)&&(i.angle.zIndex=ce.Region+50)}}class Wl extends Ce{constructor(){super(...arguments),this.transformerConstructor=r2,this.type="gauge",this.seriesType=z.gaugePointer}}Wl.type="gauge",Wl.seriesType=z.gaugePointer,Wl.view="singleDefault",Wl.transformerConstructor=r2;const Qst=()=>{Mst(),Cst(),F.registerChart(Wl.type,Wl)};class cv extends gn{transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class CA extends Ce{constructor(){super(...arguments),this.transformerConstructor=cv,this.type="wordCloud",this.seriesType=z.wordCloud}}CA.transformerConstructor=cv;class a2 extends cv{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class wa extends CA{constructor(){super(...arguments),this.transformerConstructor=a2,this.type="wordCloud",this.seriesType=z.wordCloud}}wa.type="wordCloud",wa.seriesType=z.wordCloud,wa.view="singleDefault",wa.transformerConstructor=a2;const tnt=()=>{DD(),F.registerChart(wa.type,wa)},ent=()=>{pit(),DD(),F.registerChart(wa.type,wa)};class o2 extends cv{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,depth_3d:t.depth_3d,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class Ta extends CA{constructor(){super(...arguments),this.transformerConstructor=o2,this.type="wordCloud3d",this.seriesType=z.wordCloud3d}}Ta.type="wordCloud3d",Ta.seriesType=z.wordCloud3d,Ta.view="singleDefault",Ta.transformerConstructor=o2;const int=()=>{FD(),F.registerChart(Ta.type,Ta)},snt=()=>{git(),FD(),F.registerChart(Ta.type,Ta)};class pv extends gn{needAxes(){return!1}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,funnelAlign:t.funnelAlign,funnelOrient:t.funnelOrient,shape:t.shape,funnel:t.funnel,transform:t.transform,outerLabel:t.outerLabel,transformLabel:t.transformLabel,isTransform:t.isTransform,maxSize:t.maxSize,minSize:t.minSize,gap:t.gap,isCone:t.isCone,range:t.range}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class Vl extends Ce{constructor(){super(...arguments),this.transformerConstructor=pv,this.type="funnel",this.seriesType=z.funnel}}Vl.type="funnel",Vl.seriesType=z.funnel,Vl.view="singleDefault",Vl.transformerConstructor=pv;const nnt=()=>{Tit(),F.registerChart(Vl.type,Vl)};class Ul extends Ce{constructor(){super(...arguments),this.transformerConstructor=pv,this.type="funnel3d",this.seriesType=z.funnel3d}}Ul.type="funnel3d",Ul.seriesType=z.funnel3d,Ul.view="singleDefault",Ul.transformerConstructor=pv;const rnt=()=>{Cit(),F.registerChart(Ul.type,Ul)};class l2 extends jn{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const n=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},n),{direction:(e=t.direction)!==null&&e!==void 0?e:"horizontal",cornerRadius:(i=t.cornerRadius)!==null&&i!==void 0?i:0,bandWidth:t.bandWidth,progress:t.progress,track:t.track})}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),t.direction==="vertical"){let n=null,r=null;((e=t.axes)!==null&&e!==void 0?e:[]).forEach(o=>{const{orient:l}=o;l==="left"&&(n=o),l==="bottom"&&(r=o)}),n||(n={orient:"left",visible:!1},t.axes.push(n)),r||(r={orient:"bottom",visible:!1},t.axes.push(r)),P(r.type)&&(r.type="band"),P(n.type)&&(n.type="linear");const a=nc(n,{min:0,max:1});P(n.min)&&(n.min=a.min),P(n.max)&&(n.max=a.max)}else{let n=null,r=null;((i=t.axes)!==null&&i!==void 0?i:[]).forEach(o=>{const{orient:l}=o;l==="left"&&(n=o),l==="bottom"&&(r=o)}),n||(n={type:"band",orient:"left",visible:!1},t.axes.push(n)),r||(r={orient:"bottom",visible:!1},t.axes.push(r)),P(r.type)&&(r.type="linear"),P(n.type)&&(n.type="band");const a=nc(r,{min:0,max:1});P(r.min)&&(r.min=a.min),P(r.max)&&(r.max=a.max)}}}class $l extends Ce{constructor(){super(...arguments),this.transformerConstructor=l2,this.type="linearProgress",this.seriesType=z.linearProgress,this._canStack=!0}}$l.type="linearProgress",$l.seriesType=z.linearProgress,$l.view="singleDefault",$l.transformerConstructor=l2;const ant=()=>{oet(),F.registerChart($l.type,$l)};class h2 extends jn{_getDefaultSeriesSpec(t){var e,i;const n=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barGapInGroup:t.barGapInGroup,barBackground:t.barBackground,barMinHeight:t.barMinHeight});return n.bar=t.bar,t.direction==="horizontal"?n.xField=(e=t.xField)!==null&&e!==void 0?e:[t.minField,t.maxField]:n.yField=(i=t.yField)!==null&&i!==void 0?i:[t.minField,t.maxField],n}transformSpec(t){super.transformSpec(t),Qa(t)}}class Yl extends Ce{constructor(){super(...arguments),this.transformerConstructor=h2,this.type="rangeColumn",this.seriesType=z.rangeColumn}}Yl.type="rangeColumn",Yl.seriesType=z.rangeColumn,Yl.view="singleDefault",Yl.transformerConstructor=h2;const ont=()=>{vtt(),F.registerChart(Yl.type,Yl)};class d2 extends jn{_getDefaultSeriesSpec(t){var e,i;const n=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barGapInGroup:t.barGapInGroup});return n.bar3d=t.bar3d,t.direction==="horizontal"?n.xField=(e=t.xField)!==null&&e!==void 0?e:[t.minField,t.maxField]:n.yField=(i=t.yField)!==null&&i!==void 0?i:[t.minField,t.maxField],n}}class Xl extends Ce{constructor(){super(...arguments),this.transformerConstructor=d2,this.type="rangeColumn3d",this.seriesType=z.rangeColumn3d}}Xl.type="rangeColumn3d",Xl.seriesType=z.rangeColumn3d,Xl.view="singleDefault",Xl.transformerConstructor=d2;const lnt=()=>{ytt(),F.registerChart(Xl.type,Xl)};class u2 extends gn{_getDefaultSeriesSpec(t){const e=E(t.startAngle)?t.startAngle:Jd,i=E(t.endAngle)?t.endAngle:e+xh(2*Math.PI),n=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,centerX:t.centerX,centerY:t.centerY,offsetX:t.offsetX,offsetY:t.offsetY,startAngle:e,endAngle:i,innerRadius:t.innerRadius,outerRadius:t.outerRadius,gap:t.gap,labelLayout:t.labelLayout,label:t.label,labelAutoVisible:t.labelAutoVisible,drill:t.drill,drillField:t.drillField}),r=z.sunburst;return n.type=r,n[r]=t[r],n}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class Kl extends Ce{constructor(){super(...arguments),this.transformerConstructor=u2,this.type="sunburst",this.seriesType=z.sunburst}}Kl.type="sunburst",Kl.seriesType=z.sunburst,Kl.view="singleDefault",Kl.transformerConstructor=u2;const hnt=()=>{Kit(),F.registerChart(Kl.type,Kl)};class c2 extends gn{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,layoutPadding:t.layoutPadding,label:t.label,circlePacking:t.circlePacking,drill:t.drill,drillField:t.drillField}),i=z.circlePacking;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class ql extends Ce{constructor(){super(...arguments),this.transformerConstructor=c2,this.type="circlePacking",this.seriesType=z.circlePacking}}ql.type="circlePacking",ql.seriesType=z.circlePacking,ql.view="singleDefault",ql.transformerConstructor=c2;const dnt=()=>{tst(),F.registerChart(ql.type,ql)};class p2 extends gn{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,aspectRatio:t.aspectRatio,splitType:t.splitType,maxDepth:t.maxDepth,gapWidth:t.gapWidth,nodePadding:t.nodePadding,minVisibleArea:t.minVisibleArea,minChildrenVisibleArea:t.minChildrenVisibleArea,minChildrenVisibleSize:t.minChildrenVisibleSize,roam:t.roam,drill:t.drill,drillField:t.drillField,leaf:t.leaf,nonLeaf:t.nonLeaf,nonLeafLabel:t.nonLeafLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class Zl extends Ce{constructor(){super(...arguments),this.transformerConstructor=p2,this.type="treemap",this.seriesType=z.treemap}}Zl.type="treemap",Zl.seriesType=z.treemap,Zl.view="singleDefault",Zl.transformerConstructor=p2;const unt=()=>{Sst(),F.registerChart(Zl.type,Zl)};class g2 extends nv{transformSpec(t){super.transformSpec(t),t.legends&&Y(t.legends).forEach(e=>{e.select=!1,e.hover=!1,e.filter=!1}),Qa(t)}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{bar:t.bar,stackLabel:t.stackLabel,leaderLine:t.leaderLine,total:t.total})}}class Jl extends Sa{constructor(){super(...arguments),this.transformerConstructor=g2,this.type="waterfall",this.seriesType=z.waterfall}}Jl.type="waterfall",Jl.seriesType=z.waterfall,Jl.view="singleDefault",Jl.transformerConstructor=g2;const cnt=()=>{htt(),F.registerChart(Jl.type,Jl)};class f2 extends jn{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],n=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{boxPlot:t.boxPlot,direction:(e=t.direction)!==null&&e!==void 0?e:"vertical",minField:t.minField,maxField:t.maxField,q1Field:t.q1Field,medianField:t.medianField,q3Field:t.q3Field,outliersField:t.outliersField,outliersStyle:t.outliersStyle});return n[n.direction==="vertical"?"yField":"xField"]=i,n}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),Qa(t)}}class Ql extends Ce{constructor(){super(...arguments),this.transformerConstructor=f2,this.type="boxPlot",this.seriesType=z.boxPlot}}Ql.type="boxPlot",Ql.seriesType=z.boxPlot,Ql.view="singleDefault",Ql.transformerConstructor=f2;const pnt=()=>{ptt(),F.registerChart(Ql.type,Ql)};class _2 extends gn{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,sourceField:t.sourceField,targetField:t.targetField,direction:t.direction,nodeAlign:t.nodeAlign,nodeGap:t.nodeGap,nodeWidth:t.nodeWidth,linkWidth:t.linkWidth,minStepWidth:t.minStepWidth,minNodeHeight:t.minNodeHeight,minLinkHeight:t.minLinkHeight,iterations:t.iterations,nodeKey:t.nodeKey,linkSortBy:t.linkSortBy,nodeSortBy:t.nodeSortBy,setNodeLayer:t.setNodeLayer,node:t.node,link:t.link,label:t.label,emphasis:t.emphasis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class th extends Ce{constructor(){super(...arguments),this.transformerConstructor=_2,this.type="sankey",this.seriesType=z.sankey}}th.type="sankey",th.seriesType=z.sankey,th.view="singleDefault",th.transformerConstructor=_2;const gnt=()=>{_st(),F.registerChart(th.type,th)};class m2 extends jn{_getDefaultSeriesSpec(t){var e,i;const n=Object.assign({},super._getDefaultSeriesSpec(t));return n.area=t.area,t.direction==="horizontal"?n.xField=(e=t.xField)!==null&&e!==void 0?e:[t.minField,t.maxField]:n.yField=(i=t.yField)!==null&&i!==void 0?i:[t.minField,t.maxField],n.stack=!1,n}transformSpec(t){super.transformSpec(t),Qa(t)}}class eh extends Ce{constructor(){super(...arguments),this.transformerConstructor=m2,this.type="rangeArea",this.seriesType=z.rangeArea}}eh.type="rangeArea",eh.seriesType=z.rangeArea,eh.view="singleDefault",eh.transformerConstructor=m2;const fnt=()=>{xtt(),F.registerChart(eh.type,eh)};class v2 extends jn{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{valueField:t.valueField,cell:t.cell})}}class ih extends Ce{constructor(){super(...arguments),this.transformerConstructor=v2,this.type="heatmap",this.seriesType=z.heatmap}}ih.type="heatmap",ih.seriesType=z.heatmap,ih.view="singleDefault",ih.transformerConstructor=v2;const _nt=()=>{Ist(),F.registerChart(ih.type,ih)};class y2 extends gn{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,sizeField:t.sizeField,sizeRange:t.sizeRange,centerX:t.centerX,centerY:t.centerY,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,ripplePoint:t.ripplePoint,centerPoint:t.centerPoint,centerLabel:t.centerLabel,nodePoint:t.nodePoint,label:t.label}),i=z.correlation;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&t.series.length!==0?t.series.forEach(i=>{this._isValidSeries(i.type)&&Object.keys(e).forEach(n=>{n in i||(i[n]=e[n])})}):t.series=[e]}}class sh extends Ce{constructor(){super(...arguments),this.transformerConstructor=y2,this.type="correlation",this.seriesType=z.correlation}}sh.type="correlation",sh.seriesType=z.correlation,sh.view="singleDefault",sh.transformerConstructor=y2;const mnt=()=>{Nst(),F.registerChart(sh.type,sh)};function SP(s){return s.length===2&&N(s[0])&&N(s[1])&&s[1]>=s[0]}function AP(s,t){const e=t[1]-t[0],i=t[1]*t[0]<0;let n=t[0]<=0?0-t[0]:0,r=t[1]>0?t[1]-0:0;e===0?t[0]<0?(n=1,r=0):t[0]>0&&(n=0,r=1):(n/=e,r/=e);const a=s.getDomainSpec();return{total:e,negative:n,positive:r,includeZero:i,domain:t,extendable_min:!N(a.min),extendable_max:!N(a.max)}}function kP(s,t){const{positive:e,negative:i,extendable_min:n,extendable_max:r,domain:a}=s,{positive:o,negative:l,extendable_min:h,extendable_max:d,domain:u}=t;if(o>0){if(!h)return!1;let c=i/e;r&&(c=i/Math.max(e,o),a[1]=-a[0]/c),u[0]=-u[1]*c}else if(l>0){if(!d)return!1;let c=e/i;n&&(c=e/Math.max(i,i),a[0]=-a[1]/c),u[1]=-u[0]*c}return!0}function wP(s,t){const{extendable_min:e,extendable_max:i,domain:n}=s,{positive:r,negative:a,domain:o}=t;return(r!==0||a!==0)&&!(r>0&&!i)&&!(a>0&&!e)&&(n[0]=o[0],n[1]=o[1],!0)}function TP(s,t){const{positive:e,negative:i,extendable_max:n,domain:r}=s,{positive:a,negative:o,extendable_min:l,domain:h}=t;if(n&&l){const d=Math.max(i,o)/Math.max(e,a);r[1]=-r[0]/d,h[0]=-h[1]*d}else if(l){const d=i/e;h[0]=-h[1]*d}else{if(!n)return!1;{const d=o/a;r[1]=-r[0]/d}}return!0}function MP(s,t){const{extendable_min:e,domain:i}=s,{extendable_max:n,domain:r}=t;return!(!e||!n)&&(i[0]=-i[1],r[1]=-r[0],!0)}const vnt=(s,t)=>{const e=s.getScale(),i=t.getScale();if(!e||!i||!qt(e.type)||!qt(i.type))return;const n=e.domain().slice(),r=i.domain().slice();if(!SP(n)||!SP(r))return;const a=AP(s,n),o=AP(t,r),{positive:l,negative:h,extendable_min:d,extendable_max:u,includeZero:c}=a,{positive:p,negative:g,extendable_min:f,extendable_max:_,includeZero:m}=o;if(l===0&&h===0){if(!wP(a,o))return}else if(p===0&&g===0){if(!wP(o,a))return}else if(c||m)if(c&&!m){if(!kP(a,o))return}else if(m&&!c){if(!kP(o,a))return}else{if(h===g)return;if(h>g){if(!TP(a,o))return}else if(!TP(o,a))return}else{if(h===0&&p===0){if(!MP(a,o))return}else if(g===0&&l===0&&!MP(o,a))return;if(h===0&&g===0)if(n[0]===0&&r[0]>0){if(!f)return;r[0]=0}else{if(!(r[0]===0&&n[0]>0)||!d)return;n[0]=0}if(l===0&&p===0)if(n[1]===0&&r[1]>0){if(!_)return;r[1]=0}else{if(!(r[1]===0&&n[1]>0)||!u)return;n[1]=0}}e.domain(n),i.domain(r)},ynt=(s,t)=>{var e,i,n,r,a;if(!s)return s;const o=(e=t==null?void 0:t.targetAxis)===null||e===void 0?void 0:e.call(t);if(!o)return s;const l=(i=t==null?void 0:t.currentAxis)===null||i===void 0?void 0:i.call(t);if(!l)return s;const h=(n=l.getTickData())===null||n===void 0?void 0:n.getDataView();if(!h||!h.transformsArr.find(v=>v.type==="ticks"))return s;const d=l.getScale();if(!d)return s;const u=(a=(r=o.getTickData())===null||r===void 0?void 0:r.getDataView())===null||a===void 0?void 0:a.latestData;if(!(u!=null&&u.length))return s;const c=o.getScale();if(!c)return s;const p=c.domain(),g=p[1]-p[0];if(g===0)return s;const f=d.domain(),_=f[1]-f[0];if(g===0)return s;const m=u.map(v=>{const y=(v.value-p[0])/g;return _*y+f[0]});return nr(m)};class vc extends zJ{constructor(){super(vc.type),this.type="AxisSyncPlugin"}_checkEnableSync(t){if(!qt(t.getScale().type))return!1;const e=t.getSpec().sync;return!!(e!=null&&e.axisId)&&e}_getTargetAxis(t,e){const i=t.getOption().getChart().getComponentByUserId(e.axisId);return i!=null&&i.type.startsWith("cartesianAxis")?i:null}onInit(t,e){const i=this._checkEnableSync(e);if(!i||!i.zeroAlign)return;const n=this._getTargetAxis(e,i);n&&e.event.on(St.scaleDomainUpdate,{filter:({model:r})=>r.id===e.id||r.id===n.id},()=>{vnt(n,e)})}onDidCompile(t,e){const i=this._checkEnableSync(e);if(!i)return;const n=this._getTargetAxis(e,i);if(n&&i.tickAlign){Ct(e.getOption().dataSet,"tickAlign",ynt);const r={targetAxis:()=>n,currentAxis:()=>e};e.addTransformToTickData({type:"tickAlign",options:r,level:Number.MAX_SAFE_INTEGER},!1)}}}vc.pluginType="component",vc.type="AxisSyncPlugin";const bnt={AxisSyncPlugin:vc};class Cx extends Hi{constructor(t,e){super(t,e),this.type="component",this._componentType=e.componentType,this._mode=e.mode}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.mark(rt.component,t??e.rootMark,{componentType:this._componentType,mode:this._mode}).id(i),this._compiledProductId=i}}Cx.type="component";const PA=()=>{F.registerMark(Cx.type,Cx)},xnt=s=>s;class EA extends bs{getOrient(){return this._orient}getScale(){return this._scale}getScales(){return this._scales}getTickData(){return this._tickData}get visible(){return this._visible}getInverse(){return this._inverse}constructor(t,e){var i;super(t,e),this.specKey="axes",this._scales=[],this._visible=!0,this._tick=void 0,this._visible=(i=t.visible)===null||i===void 0||i}_getNeedClearVRenderComponents(){return[]}getVRenderComponents(){var t,e;return Y((e=(t=this._axisMark)===null||t===void 0?void 0:t.getProduct())===null||e===void 0?void 0:e.getGroupGraphicItem())}created(){var t,e,i,n,r,a,o,l,h,d,u,c,p,g,f,_,m;if(super.created(),this.setSeriesAndRegionsFromSpec(),this.initEvent(),this.initScales(),this.updateSeriesScale(),this.getVisible()&&this._initData(),this._visible){const v=this._createMark({type:"component",name:`axis-${this.getOrient()}`},{componentType:this.getOrient()==="angle"?"circleAxis":"axis",mode:this._spec.mode,noSeparateStyle:!0,skipTheme:!0});if(this._axisMark=v,v.setZIndex(this.layoutZIndex),E(this._spec.id)&&v.setUserId(this._spec.id),this._marks.addMark(v),(t=this._spec.grid)===null||t===void 0?void 0:t.visible){const y=this._createMark({type:"component",name:`axis-${this.getOrient()}-grid`},{componentType:this.getOrient()==="angle"?mi.circleAxisGrid:mi.lineAxisGrid,mode:this._spec.mode,noSeparateStyle:!0,skipTheme:!0});y.setZIndex((a=(n=(i=(e=this._spec.grid)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.zIndex)!==null&&n!==void 0?n:(r=this._spec.grid)===null||r===void 0?void 0:r.zIndex)!==null&&a!==void 0?a:ce.Axis_Grid),this._marks.addMark(y),this._gridMark=y}if(ye(this._spec.interactive)&&this._marks.forEach(y=>y.setInteractive(this._spec.interactive)),this._option.animation!==!1&&It(this._option.getChart().getSpec(),"animation")!==!1&&this._spec.animation===!0){const y=zt((o=F.getAnimationInKey("axis"))===null||o===void 0?void 0:o(),{appear:(h=(l=this._spec.animationAppear)!==null&&l!==void 0?l:It(this._option.getChart().getSpec(),"animationAppear.axis"))!==null&&h!==void 0?h:It(this._option.getChart().getSpec(),"animationAppear"),disappear:(u=(d=this._spec.animationDisappear)!==null&&d!==void 0?d:It(this._option.getChart().getSpec(),"animationDisappear.axis"))!==null&&u!==void 0?u:It(this._option.getChart().getSpec(),"animationDisappear"),enter:(p=(c=this._spec.animationEnter)!==null&&c!==void 0?c:It(this._option.getChart().getSpec(),"animationEnter.axis"))!==null&&p!==void 0?p:It(this._option.getChart().getSpec(),"animationEnter"),exit:(f=(g=this._spec.animationExit)!==null&&g!==void 0?g:It(this._option.getChart().getSpec(),"animationExit.axis"))!==null&&f!==void 0?f:It(this._option.getChart().getSpec(),"animationExit"),update:(m=(_=this._spec.animationUpdate)!==null&&_!==void 0?_:It(this._option.getChart().getSpec(),"animationUpdate.axis"))!==null&&m!==void 0?m:It(this._option.getChart().getSpec(),"animationUpdate")});y.enter&&(y.update[0].customParameters={enter:y.enter[0]}),this._marks.forEach(b=>b.setAnimationConfig(y))}}}isSeriesDataEnable(){let t=!0;return Ie(this._regions,e=>{var i;$((i=e.getViewDataStatistics())===null||i===void 0?void 0:i.latestData)&&(t=!1)},{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}setSeriesAndRegionsFromSpec(){const{seriesId:t,seriesIndex:e,regionId:i,regionIndex:n}=this._spec;E(t)&&(this._seriesUserId=Y(t)),E(i)&&(this._regionUserId=Y(i)),E(e)&&(this._seriesIndex=Y(e)),E(n)&&(this._regionIndex=Y(n)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionIndex),this.layout.layoutBindRegionID=this._regions.map(r=>r.id)}getBindSeriesFilter(){return{userId:this._seriesUserId,specIndex:this._seriesIndex}}initEvent(){this.event.on(St.scaleUpdate,{filter:({model:e})=>(e==null?void 0:e.id)===this.id},this.effect.scaleUpdate.bind(this));const t=r4(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}).map(e=>e.getViewDataStatistics()).filter(e=>!!e);t.length>1?this._option.dataSet.multipleDataViewAddListener(t,"change",()=>{this.updateScaleDomain()}):t.length===1&&t[0].target.addListener("change",()=>{this.updateScaleDomain()}),Ie(this._regions,e=>{e.event.on(St.rawDataUpdate,{filter:({model:i})=>(i==null?void 0:i.id)===e.id},()=>{this._clearRawDomain()})},{userId:this._seriesUserId,specIndex:this._seriesIndex})}updateScaleDomain(){}_clearRawDomain(){}computeData(t){!this._tickData||t!=="force"&&Se(this._scale.range(),[0,1])||(this._tickData.getDataView().reRunAllTransform(),this._tickData.updateData())}initScales(){this._scales=[this._scale];const t=[];if(Ie(this._regions,e=>{const i=e.getGroups();i&&t.push(i)},{userId:this._seriesUserId,specIndex:this._seriesIndex}),t.length!==0){const e=ei(t.map(i=>i.fields.length));for(let i=1;i<e;i++){const n=this._scale.clone();this._scales.push(n)}}}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,(e==null?void 0:e.type)!==(t==null?void 0:t.type)&&(i.reMake=!0),i}getLabelFormatMethod(){return this._spec.label.formatMethod?(t,e,i)=>this._spec.label.formatMethod(e.rawValue,e):null}getLabelItems(t){return $(this._tickData.getLatestData())?[this._tickData.getLatestData().map(e=>({id:e.value,label:e.value,value:t===0?0:this.dataToPosition([e.value])/t,rawValue:e.value})).filter(e=>e.value>=0&&e.value<=1)]:[]}_delegateAxisContainerEvent(t){t.addEventListener("*",(e,i)=>this._delegateEvent(t,e,i))}_getAxisAttributes(){var t,e,i,n,r,a,o,l,h,d,u;const c=this._spec;let p,g=c.title.angle;c.orient!=="left"&&c.orient!=="right"||!((t=c.title)===null||t===void 0)&&t.autoRotate&&P(c.title.angle)&&(g=c.orient==="left"?-90:90,p=zQ[c.orient]);const f=yh(c.label,["style","formatMethod","state"]),_=(e=c.background)!==null&&e!==void 0?e:{},m=(i=c.title.background)!==null&&i!==void 0?i:{};return{orient:this.getOrient(),select:this._option.disableTriggerEvent!==!0&&c.select,hover:this._option.disableTriggerEvent!==!0&&c.hover,line:HQ(c.domainLine),label:Object.assign({style:K(c.label.style)?(v,y,b,x)=>{var S;const A=c.label.style(v.rawValue,y,v,b,x);return wt(yt({},(S=this._theme.label)===null||S===void 0?void 0:S.style,A))}:wt(c.label.style),formatMethod:c.label.formatMethod?(v,y,b)=>c.label.formatMethod(y.rawValue,y):null,state:zZ(c.label.state)},f),tick:c.tick.visible===!1?{visible:!1}:{visible:c.tick.visible,length:c.tick.tickSize,inside:c.tick.inside,alignWithLabel:c.tick.alignWithLabel,style:K(c.tick.style)?(v,y,b,x)=>{var S;const A=c.tick.style(v,y,b,x);return wt(yt({},(S=this._theme.tick)===null||S===void 0?void 0:S.style,A))}:wt(c.tick.style),state:il(c.tick.state),dataFilter:c.tick.dataFilter},subTick:c.subTick.visible===!1?{visible:!1}:{visible:c.subTick.visible,length:c.subTick.tickSize,inside:c.subTick.inside,count:c.subTick.tickCount,style:K(c.subTick.style)?(v,y,b,x)=>{var S;const A=c.subTick.style(v,y,b,x);return wt(yt({},(S=this._theme.subTick)===null||S===void 0?void 0:S.style,A))}:wt(c.subTick.style),state:il(c.subTick.state)},title:c.title.visible===!1?{visible:!1}:Object.assign({visible:c.title.visible,position:c.title.position,space:c.title.space,autoRotate:!1,angle:g?ue(g):null,textStyle:yt({},p,wt(c.title.style)),padding:c.title.padding,shape:((n=c.title.shape)===null||n===void 0?void 0:n.visible)===!1?{visible:!1}:{visible:(r=c.title.shape)===null||r===void 0?void 0:r.visible,space:(a=c.title.shape)===null||a===void 0?void 0:a.space,style:wt((o=c.title.shape)===null||o===void 0?void 0:o.style)},background:m.visible===!1?{visible:!1}:{visible:m.visible,style:wt(m.style)},state:{text:il(c.title.state),shape:il((l=c.title.shape)===null||l===void 0?void 0:l.state),background:il((h=c.title.background)===null||h===void 0?void 0:h.state)},pickable:((d=c.title.style)===null||d===void 0?void 0:d.pickable)!==!1,childrenPickable:((u=c.title.style)===null||u===void 0?void 0:u.pickable)!==!1},c.title),panel:_.visible===!1?{visible:!1}:{visible:_.visible,style:wt(_.style),state:il(_.state)}}}_getGridAttributes(){const t=this._spec;return{alternateColor:t.grid.alternateColor,alignWithLabel:t.grid.alignWithLabel,style:K(t.grid.style)?()=>(e,i)=>{var n,r;const a=t.grid.style((n=e.datum)===null||n===void 0?void 0:n.rawValue,i,e.datum);return wt(yt({},(r=this._theme.grid)===null||r===void 0?void 0:r.style,a))}:wt(t.grid.style),subGrid:t.subGrid.visible===!1?{visible:!1}:{type:"line",visible:t.subGrid.visible,alternateColor:t.subGrid.alternateColor,style:wt(t.subGrid.style)}}}_initTickDataSet(t){return Lr(this._option.dataSet,"scale",xnt),Ct(this._option.dataSet,"ticks",qU),new Jt(this._option.dataSet,{name:`${this.type}_${this.id}_ticks`}).parse(this._scale,{type:"scale"}).transform({type:"ticks",options:t},!1)}_tickTransformOption(t){const e=this._tick||{},i=this._spec.label||{},{tickCount:n,forceTickCount:r,tickStep:a,tickMode:o}=e,{style:l,formatMethod:h,minGap:d}=i;return{sampling:this._spec.sampling!==!1,tickCount:n,forceTickCount:r,tickStep:a,tickMode:o,axisOrientType:this._orient,coordinateType:t,labelStyle:l,labelFormatter:h,labelGap:d}}addTransformToTickData(t,e){var i,n;(n=(i=this._tickData)===null||i===void 0?void 0:i.getDataView())===null||n===void 0||n.transform(t,e)}dataToPosition(t){return this._scale.scale(t)}}EA.specKey="axes";const Uo=()=>{x9(),w9(),PA(),F.registerAnimation("axis",()=>({appear:{custom:w6},update:{custom:k6},exit:{custom:VH}}))};var CP=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};const Snt=[bnt.AxisSyncPlugin];class E_ extends EA{getOrient(){return this._orient}set autoIndentOnce(t){this._autoIndentOnce=t}getScales(){return this._scales}constructor(t,e){super(t,e),this.type=Z.cartesianAxis,this.name=Z.cartesianAxis,this._defaultBandPosition=.5,this._defaultBandInnerPadding=.1,this._defaultBandOuterPadding=.3,this.layoutType="region-relative",this.layoutZIndex=ce.Axis,this.layoutLevel=Ln.Axis,this._orient="left",this._autoIndentOnce=!1,this._hasAutoIndent=!1,this._scales=[],this._tick=void 0,this._layoutCache={width:0,height:0,_lastComputeOutBounds:{x1:0,x2:0,y1:0,y2:0}},this._innerOffset={top:0,bottom:0,left:0,right:0},this.effect={scaleUpdate:i=>{this.computeData(i==null?void 0:i.value),Ie(this._regions,n=>{const r=this.getOrient();Fe(r)?n.setXAxisHelper(this.axisHelper()):Mr(r)?n.setYAxisHelper(this.axisHelper()):ea(r)&&n.setZAxisHelper(this.axisHelper())},{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=i=>{let{x:n,y:r}=i;return N(n)&&(n+=+(this._orient==="left")*this.getLayoutRect().width),N(r)&&(r+=+(this._orient==="top")*this.getLayoutRect().height),{x:n,y:r}},this._transformLayoutRect=i=>{if(!this._visible)return i;const n=this._latestBounds.clone().translate(-this.getLayoutStartPoint().x,-this.getLayoutStartPoint().y);switch(this._layout.layoutOrient){case"left":this._layout.layoutRectLevelMap.width===ks&&(i.width=n.x1<0?-n.x1:0);break;case"right":this._layout.layoutRectLevelMap.width===ks&&(i.width=n.x2>0?n.x2:0);break;case"top":this._layout.layoutRectLevelMap.height===ks&&(i.height=n.y1<0?-n.y1:0);break;case"bottom":this._layout.layoutRectLevelMap.height===ks&&(i.height=n.y2>0?n.y2:0)}return i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),this._layout.setRectInSpec(this._layoutCacheProcessing(i))},this._fixAxisOnZero=()=>{const{onZero:i,visible:n}=this._spec.domainLine;if(this.visible&&i&&n!==!1){const{onZeroAxisId:r,onZeroAxisIndex:a}=this._spec.domainLine,o=this._option.getComponentsByKey("axes"),l=Fe(this.getOrient()),h=u=>{var c;return(l?!Fe(u.getOrient()):Fe(u.getOrient()))&&qt(u.getScale().type)&&u.getTickData()?(c=u.getTickData().getLatestData())===null||c===void 0?void 0:c.find(p=>p.value===0):u.getScale().ticks().includes(0)},d=o.filter(u=>h(u));if(d.length){let u;if(E(r))u=d.find(c=>c.id===r);else if(E(a)){const c=o[a];h(c)&&(u=c)}else u=d[0];if(u){const c=this._axisMark.getProduct(),p=u.valueToPosition(0);l?c.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dy:this._orient==="bottom"?-(u.getScale().range()[0]-p):p})}):c.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dx:this._orient==="left"?p:-(u.getScale().range()[1]-p)})})}}}},this._orient=oa(t,["z"]),ea(this._orient)&&(this.layoutType="absolute"),this._dataSet=e.dataSet}static getSpecInfo(t){const e=t[this.specKey];if(!e)return null;const i=t.direction==="horizontal";if(!$(e)){if(!HC(e))return null;const{axisType:o,componentName:l}=kC(e,i);return e.type=o,[{spec:e,specPath:[this.specKey],type:l}]}let n=!0;if(e.filter(o=>o.orient==="z")[0]){const o=e.filter(h=>h.orient==="bottom")[0],l=e.filter(h=>Mr(h.orient))[0];n=e.length===3&&o&&l}let r=e.map((o,l)=>({spec:o,index:l}));n||(r=r.filter(({spec:o})=>o.orient!=="z"));const a=[];return r.forEach(({spec:o,index:l})=>{if(!HC(o))return;const{axisType:h,componentName:d}=kC(o,i);o.type=h,a.push({spec:o,specIndex:l,specPath:[this.specKey,l],type:d})}),a}static createComponent(t,e){const{spec:i}=t,n=CP(t,["spec"]),r=F.getComponentInKey(n.type);return r?new r(i,Object.assign(Object.assign({},e),n)):(e.onError(`Component ${n.type} not found`),null)}initLayout(){super.initLayout(),this._layout.autoIndent=this._spec.autoIndent!==!1,this._layout.layoutOrient=this._orient}setLayout3dBox(t){this.layout3dBox=t}updateScaleRange(){let t=!1;const{width:e,height:i}=this.getLayoutRect(),{left:n,right:r,top:a,bottom:o}=this._innerOffset;let l=[];Fe(this.getOrient())?N(e)&&(l=this._inverse?[e-r,n]:[n,e-r]):ea(this.getOrient())?N(e)&&(l=this._inverse?[e-r,n]:[n,e-r],this._scale.range(l)):N(i)&&(l=this._inverse?[a,i-o]:[i-o,a]);const[h,d]=this._scale.range();return l[0]===h&&l[1]===d||(t=!0,this._scale.range(l)),t}init(t){var e;super.init(t),(e=this.pluginService)===null||e===void 0||e.load(Snt.map(i=>new i)),this.callPlugin(i=>{this.pluginService&&i.onInit&&i.onInit(this.pluginService,this)})}setAttrFromSpec(){var t;if(super.setAttrFromSpec(),this.visible){Fe(this.getOrient())?Re(this._spec.maxHeight)&&(this._spec.maxHeight="30%"):Re(this._spec.maxWidth)&&(this._spec.maxWidth="30%");const i=this._getAxisAttributes();i.label.formatMethod=this.getLabelFormatMethod(),i.verticalFactor=this.getOrient()==="top"||this.getOrient()==="right"?-1:1,this._axisStyle=i}this._tick=this._spec.tick;const e=(t=this._option.getChart())===null||t===void 0?void 0:t.getSpec();this._inverse=VZ(this._spec,(e==null?void 0:e.direction)==="horizontal")}onLayoutStart(t,e,i){if(super.onLayoutStart(t,e,i),!ea(this.getOrient())&&this._spec.innerOffset){const n=this._spec;Mr(this.getOrient())?["top","bottom"].forEach(r=>{this._innerOffset[r]=Xi(n.innerOffset[r],e.height,e)}):["left","right"].forEach(r=>{this._innerOffset[r]=Xi(n.innerOffset[r],e.width,e)})}}getSeriesStatisticsField(t){let e;return e=Fe(this.getOrient())?t.fieldX:ea(this.getOrient())?t.fieldZ:t.fieldY,qt(this._scale.type)?e:[e[0]]}_tickTransformOption(t){var e,i;return Object.assign(Object.assign({},super._tickTransformOption(t)),{noDecimals:this._tick.noDecimals,labelLastVisible:(e=this._spec.label)===null||e===void 0?void 0:e.lastVisible,labelFlush:(i=this._spec.label)===null||i===void 0?void 0:i.flush})}_initData(){const t=this._initTickDataSet(this._tickTransformOption("cartesian"));t.target.addListener("change",this._forceLayout.bind(this)),this._tickData=new Ur(this._option,t)}axisHelper(){return{isContinuous:qt(this._scale.type),dataToPosition:this.dataToPosition.bind(this),getScale:(t=0)=>this._scales[t],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>this._inverse===!0}}afterCompile(){var t;const e=(t=this._axisMark)===null||t===void 0?void 0:t.getProduct();e&&e.addEventListener(gt.AFTER_ELEMENT_ENCODE,()=>{if(this._isLayout===!1&&(Fe(this.getOrient())?this.callPlugin(i=>{this.pluginService&&i.onDidLayoutHorizontal&&i.onDidLayoutHorizontal(this.pluginService,this)}):this.callPlugin(i=>{this.pluginService&&i.onDidLayoutVertical&&i.onDidLayoutVertical(this.pluginService,this)}),this._delegateAxisContainerEvent(e.getGroupGraphicItem()),this._unitText)){const i=e.graphicItem.AABBBounds,n=Fe(this._orient)?{x:i.x2,y:this.getLayoutStartPoint().y}:{x:this.getLayoutStartPoint().x,y:i.y1};this._unitText.setAttributes(n)}}),this.callPlugin(i=>{this.pluginService&&i.onDidCompile&&i.onDidCompile(this.pluginService,this)})}onLayoutEnd(t){this.updateScaleRange()?this.event.emit(St.scaleUpdate,{model:this,value:"range"}):this.updateSeriesScale(),super.onLayoutEnd(t)}onRender(t){}changeRegions(t){}update(t){}resize(t){}collectScale(){const t=[];return Ie(this._regions,e=>{t.push(this.getOrient()==="left"||this.getOrient()==="right"?e.scaleY:e.scaleX)},{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}collectData(t,e){const i=[];return Ie(this._regions,n=>{var r,a,o;let l;if(l=t>0?(a=(r=n.getGroups())===null||r===void 0?void 0:r.fields)===null||a===void 0?void 0:a[t]:Fe(this.getOrient())?n.fieldX2?[...n.fieldX,n.fieldX2]:n.fieldX:ea(this.getOrient())?n.fieldZ:n.fieldY,l=$(l)?qt(this._scale.type)?l:[l[0]]:[l],t||(this._dataFieldText=n.getFieldAlias(l[0])),l){const h=n.getViewData();if(e)l.forEach(d=>{i.push(n.getRawDataStatisticsByField(d,!1))});else if(h&&h.latestData&&h.latestData.length){const d=(o=n.getViewDataStatistics)===null||o===void 0?void 0:o.call(n);l.forEach(u=>{var c;!((c=d==null?void 0:d.latestData)===null||c===void 0)&&c[u]&&i.push(d.latestData[u])})}}},{userId:this._seriesUserId,specIndex:this._seriesIndex}),i}updateSeriesScale(){const t=this.getOrient();Ie(this._regions,e=>{Fe(t)?(e.setScaleX(this._scale),e.setXAxisHelper(this.axisHelper())):Mr(t)?(e.setScaleY(this._scale),e.setYAxisHelper(this.axisHelper())):ea(t)&&(e.setScaleZ(this._scale),e.setZAxisHelper(this.axisHelper()))},{userId:this._seriesUserId,specIndex:this._seriesIndex})}getBoundsInRect(t){let e={x1:0,y1:0,x2:0,y2:0};if(!this._visible)return e;this._verticalLimitSize=Fe(this.getOrient())?t.height:t.width,this.setLayoutRect(t),!this.updateScaleRange()&&$(this._tickData.getLatestData())||this.computeData("range");const i={skipLayout:!1},n=Fe(this.getOrient());this.pluginService&&(n?this.callPlugin(o=>{o.onWillLayoutHorizontal&&o.onWillLayoutHorizontal(this.pluginService,i,this)}):this.callPlugin(o=>{o.onWillLayoutVertical&&o.onWillLayoutVertical(this.pluginService,i,this)}));const r=this._axisMark.getProduct();let a=!1;if(!i.skipLayout){const o=this._getUpdateAttribute(!0),l=r.getGroupGraphicItem(),h=yt(Object.assign({},this.getLayoutStartPoint()),this._axisStyle,o,{line:{visible:!1}}),d=l.getBoundsWithoutRender(h);a=!0,this._latestBounds=d,isFinite(d.width())&&(e=this._appendAxisUnit(d,n))}return a||(this._latestBounds=r.getBounds()),e}updateLayoutAttribute(){if(!this.visible)return;const t=this.getLayoutStartPoint(),e=this._getUpdateAttribute(!1),{grid:i}=e,n=CP(e,["grid"]),r=this._axisMark.getProduct(),a=yt({x:t.x,y:t.y},this._axisStyle,n);r.encode(a),this._gridMark&&this._gridMark.getProduct().encode(yt({x:t.x,y:t.y},this._getGridAttributes(),i)),super.updateLayoutAttribute()}_getTitleLimit(t){var e,i,n,r,a;if(this._spec.title.visible&&P((e=this._spec.title.style)===null||e===void 0?void 0:e.maxLineWidth)){const o=(a=(n=(i=this._axisStyle.title)===null||i===void 0?void 0:i.angle)!==null&&n!==void 0?n:(r=this._spec.title.style)===null||r===void 0?void 0:r.angle)!==null&&a!==void 0?a:0;if(t){const d=this.getLayoutRect().width,u=Math.abs(Math.cos(o));return u<1e-6?1/0:d/u}const l=this.getLayoutRect().height,h=Math.abs(Math.sin(o));return h<1e-6?1/0:l/h}return null}_getUpdateAttribute(t){var e;let i=0,n=0;if(!t){const m=this.getRegions();let{x:v,y}=m[0].getLayoutStartPoint(),b=v+m[0].getLayoutRect().width,x=y+m[0].getLayoutRect().height;for(let S=1;S<m.length;S++){const A=m[S],{x:k,y:w}=A.getLayoutStartPoint(),{width:T,height:M}=A.getLayoutRect();v=Math.min(v,k),b=Math.max(b,T+k),y=Math.min(y,w),x=Math.max(x,M+w)}i=Math.abs(x-y),n=Math.abs(b-v)}const{width:r,height:a}=this.getLayoutRect(),o=Fe(this._orient),l=Mr(this._orient),h=ea(this._orient);let d={x:0,y:0},u=0,c=0;const p=this.layout3dBox?this.layout3dBox.length:0;if(o?(d={x:r,y:0},u=i,c=r):l&&(d={x:0,y:a},u=n,c=a),h){const m=(e=this.directionStr)!==null&&e!==void 0?e:"r2l",v=this.layout3dBox?this.layout3dBox.width:0;let y=[0,0],b=-Math.PI/2,x=0;m==="l2r"&&(x=this.layout3dBox.length,y=[0,0,0],b=Math.PI/2);const S=this.getLabelItems(r),A={start:{x:0,y:0},end:{x:p,y:0},z:x,alpha:b,anchor3d:y,title:{text:this._spec.title.text||this._dataFieldText,maxWidth:this._getTitleLimit(o)},items:S};return t||(A.grid={type:"line",start:{x:0,y:0},end:{x:p,y:0},items:S[0],verticalFactor:this._axisStyle.verticalFactor,depth:v,length:i,z:x,alpha:b,anchor3d:y}),A}let g=o?this.layout.minHeight:this.layout.minWidth;(o&&this._layout.layoutRectLevelMap.height===ra||l&&this._layout.layoutRectLevelMap.width===ra)&&(g=this._verticalLimitSize);const f=this.getLabelItems(c),_={start:{x:0,y:0},end:d,title:{text:this._spec.title.text||this._dataFieldText,maxWidth:this._getTitleLimit(o)},items:f,verticalLimitSize:this._verticalLimitSize,verticalMinSize:g};return t||(_.grid={type:"line",start:{x:0,y:0},end:d,items:f[0],verticalFactor:this._axisStyle.verticalFactor,depth:p,length:u}),_}initEvent(){super.initEvent(),this.visible&&(this.event.on(St.layoutEnd,this._fixAxisOnZero),this.event.on(St.layoutRectUpdate,()=>{this._clearLayoutCache()}))}_layoutCacheProcessing(t){return["width","height"].forEach(e=>{t[e]<this._layoutCache[e]?t[e]=this._layoutCache[e]:this._layoutCache[e]=t[e]}),this._autoIndentOnce&&this._hasAutoIndent?["x1","x2","y1","y2"].forEach(e=>{this.layout.getLastComputeOutBounds()[e]=this._layoutCache._lastComputeOutBounds[e]}):(this._hasAutoIndent=!0,["x1","x2","y1","y2"].forEach(e=>{this.layout.getLastComputeOutBounds()[e]<this._layoutCache._lastComputeOutBounds[e]?this.layout.getLastComputeOutBounds()[e]=this._layoutCache._lastComputeOutBounds[e]:this._layoutCache._lastComputeOutBounds[e]=this.layout.getLastComputeOutBounds()[e]})),t}_clearLayoutCache(){this._hasAutoIndent=!1,this._layoutCache.width=0,this._layoutCache.height=0,this._layoutCache._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0}}onDataUpdate(){this._clearLayoutCache()}_appendAxisUnit(t,e){var i;if(this._spec.unit&&this._spec.unit.visible){const{text:n,style:r}=this._spec.unit;let a,o;e?(a={x:t.x2,y:this.getLayoutStartPoint().y},o={textAlign:"left",textBaseline:"middle"}):(a={x:this.getLayoutStartPoint().x,y:t.y1},o={textAlign:this._orient==="left"?"left":"right",textBaseline:"bottom"}),o=Object.assign(Object.assign(Object.assign({},o),r),{x:a.x,y:a.y,text:n}),this._unitText?this._unitText.setAttributes(o):(this._unitText=Mo(o),this._unitText.name="axis-unit",(i=this.getContainer())===null||i===void 0||i.add(this._unitText));const l=this._unitText.AABBBounds;e?(t.x2+=l.x2>t.x2?l.x2-t.x2:0,t.y2+=l.y2>t.y2?l.y2-t.y2:0):(t.x1+=l.x1<t.x1?l.x1-t.x1:0,t.y1+=l.y1<t.y1?l.y1-t.y1:0)}return t}_getNeedClearVRenderComponents(){return this._unitText?[this._unitText]:[]}}E_.type=Z.cartesianAxis,E_.specKey="axes";const Ant=Math.sqrt(50),knt=Math.sqrt(10),wnt=Math.sqrt(2);class gv{constructor(){this._extend={}}setExtraAttrFromSpec(){E(this._spec.nice)&&(this._nice=this._spec.nice),E(this._spec.zero)&&(this._zero=this._spec.zero),this._expand=this._spec.expand,this._domain=nc(this._spec)}transformScaleDomain(){this.setScaleNice()}setLinearScaleNice(){var t;let e=5;const i=this._spec.tick||{};if(N(i.forceTickCount))e=i.forceTickCount;else if(K(i.tickCount)){const a=this._scale.range();let o=Math.abs(a[a.length-1]-a[0]);o===1&&this._option&&(o=Fe(this._orient)?this._option.getChartViewRect().width:this._option.getChartViewRect().height),e=i.tickCount({rangeSize:o,labelStyle:this._spec.label&&this._spec.label.style})}else e=N(i.tickCount)?i.tickCount:5;this._spec.niceType==="accurateFirst"&&(e=Math.max(5,e));const{min:n,max:r}=(t=this._domain)!==null&&t!==void 0?t:{};P(n)&&P(r)?this._nice&&this._scale.nice(e):E(n)&&P(r)?this._nice&&this._scale.niceMax(e):P(n)&&E(r)&&this._nice&&this._scale.niceMin(e)}setLogScaleNice(){var t;const{min:e,max:i}=(t=this._domain)!==null&&t!==void 0?t:{};P(e)&&P(i)?this._nice&&this._scale.nice():E(e)&&P(i)?this._nice&&this._scale.niceMax():P(e)&&E(i)&&this._nice&&this._scale.niceMin()}setScaleNice(){this._spec.type==="log"?this.setLogScaleNice():this.setLinearScaleNice()}dataToPosition(t,e){return this.valueToPosition(t[0])}valueToPosition(t){return this._spec.type!=="log"||P(t)||t!==0&&t[0]!==0?this._scale.scale(t):this._scale.range()[0]}computeLinearDomain(t){const e=[];return t.length?t.forEach(i=>{const{min:n,max:r}=i;e[0]=e[0]===void 0?n:Math.min(e[0],n),e[1]=e[1]===void 0?r:Math.max(e[1],r)}):(e[0]=0,e[1]=0),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this._expand)return;let e=t[0],i=t[t.length-1];e===i&&(i===0?i=1:i>0?e=0:i<0&&(i=0)),E(this._expand.min)&&(t[0]=e-(i-e)*this._expand.min),E(this._expand.max)&&(t[t.length-1]=i+(i-e)*this._expand.max)}niceDomain(t){const{min:e,max:i}=nc(this._spec);if(E(e)||E(i)||this._spec.type!=="linear")return t;if(Math.abs(ki(t)-ei(t))<=1e-12){let n=t[0];const r=n>=0?1:-1;if(n=Math.abs(n),n<1)t[0]=0,t[1]=1;else{let a=n/5;const o=Math.floor(Math.log(a)/Math.LN10),l=a/Math.pow(10,o);a=(l>=Ant?10:l>=knt?5:l>=wnt?2:1)*Math.pow(10,o),t[0]=0,t[1]=10*a}r<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}includeZero(t){this._zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(t[t.length-1],0))}setExtendDomain(t,e){if(e===void 0)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this._nice),this.setScaleNice(),this.event.emit(St.scaleUpdate,{model:this,value:"domain"})}extendDomain(t){let e;const i=t.length-1,n=t[0]-t[i]>0,r=n?i:0,a=n?0:i;for(const o in this._extend)e=this._extend[o],e>t[a]&&(t[a]=e),e<t[r]&&(t[r]=e)}getDomainSpec(){return this._domain}setDomainMinMax(t){if(!this._domain)return;const{min:e,max:i}=this._domain;E(e)&&(t[0]=e),E(i)&&(t[1]=i)}setZero(t){this._zero!==t&&(this._zero=t,this.updateScaleDomain())}updateScaleDomain(){if(!this.isSeriesDataEnable())return;const t=this.collectData(),e=this.computeDomain(t);this.updateScaleDomainByModel(e)}updateScaleDomainByModel(t){t=t??this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this._nice),this.setScaleNice(),this.event.emit(St.scaleDomainUpdate,{model:this}),this.event.emit(St.scaleUpdate,{model:this,value:"domain"})}}class Ha extends E_{constructor(){super(...arguments),this.type=Z.cartesianLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new un}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){var t,e;super.initScales();const i=[0,1];E((t=this._domain)===null||t===void 0?void 0:t.min)&&(i[0]=this._domain.min),E((e=this._domain)===null||e===void 0?void 0:e.max)&&(i[1]=this._domain.max),this._scale.domain(i)}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t.valueToPosition=this.valueToPosition.bind(this),t}}Ha.type=Z.cartesianLinearAxis,Ha.specKey="axes",Ai(Ha,gv);const Tnt=()=>{Uo(),F.registerComponent(Ha.type,Ha)};class b2{constructor(){this._rawDomainIndex=[]}dataToPosition(t,e={}){var i,n;if(t.length===0||this._scales.length===0)return 0;const{position:r,bandScale:a}=this.getPosition(t);return r+a.bandwidth()*((n=(i=e.bandPosition)!==null&&i!==void 0?i:this._spec.bandPosition)!==null&&n!==void 0?n:this._defaultBandPosition)}valueToPosition(t){return this._scale.scale(t)}updateGroupScaleRange(){let t=this._scale;this._scales.forEach((e,i)=>{i>0&&(e.range([0,t.bandwidth()]),t=e)})}getPosition(t){let e=0,i=this._scale;if(this._scales.length===1||t.length===1)e=this.valueToPosition(t[0]);else{const n=Math.min(t.length,this._scales.length);for(let r=0;r<n;r++)e+=this._scales[r].scale(t[r]);i=this._scales[n-1]}return{position:e,bandScale:i}}calcScales(t,e){var i,n;const{bandPadding:r,paddingInner:a,paddingOuter:o}=this._spec,l=$(r),h=$(a),d=$(o);for(let u=0;u<this._scales.length;u++){const c=l?r[u]:r,p=h?a[u]:a,g=d?o[u]:o;this._scales[u].paddingInner((i=p??c)!==null&&i!==void 0?i:t,!0).paddingOuter((n=g??c)!==null&&n!==void 0?n:e,!0)}}computeBandDomain(t){if(!t.length)return[];if(t.length===1)return t[0].values;const e=new Set;for(let i=0;i<t.length;i++)for(let n=0;n<t[i].values.length;n++)e.add(t[i].values[n]);return Array.from(e)}updateScaleDomain(){var t;if(!this.isSeriesDataEnable())return;!(!((t=this._rawDomainIndex)===null||t===void 0)&&t.length)&&this._scales.length&&this._updateRawDomain();const e=this._spec.domain;for(let i=0;i<this._scales.length;i++)if(e&&e.length&&i===0)this._scales[i].domain(e);else{const n=this.collectData(i),r=this.computeDomain(n);this._scales[i].domain(r.sort((a,o)=>this._rawDomainIndex[i][a]-this._rawDomainIndex[i][o]))}this.transformScaleDomain(),this.event.emit(St.scaleDomainUpdate,{model:this}),this.event.emit(St.scaleUpdate,{model:this,value:"domain"})}_updateRawDomain(){this._rawDomainIndex=[];const t=this._spec.domain;for(let e=0;e<this._scales.length;e++)if(t&&t.length&&e===0)this._scales[e].domain(t);else{const i=this.collectData(e,!0),n=this.computeDomain(i);this._rawDomainIndex[e]={},n.forEach((r,a)=>this._rawDomainIndex[e][r]=a)}}_clearRawDomain(){this._rawDomainIndex=[]}}class uu extends E_{constructor(){super(...arguments),this.type=Z.cartesianBandAxis,this._scale=new Wo}computeDomain(t){return this.computeBandDomain(t)}updateScaleRange(){const t=super.updateScaleRange();return this.updateGroupScaleRange(),t}initScales(){super.initScales(),this.calcScales(this._defaultBandInnerPadding,this._defaultBandOuterPadding)}axisHelper(){const t=e=>this._scales[e];return{isContinuous:!1,dataToPosition:this.dataToPosition.bind(this),getScale:t,getBandwidth:e=>t(e).bandwidth(),getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>this._inverse}}transformScaleDomain(){this.updateFixedWholeLength()}updateFixedWholeLength(){var t;if(this._scale&&(this._spec.bandSize&&this._scale.bandwidth(this._spec.bandSize),this._spec.maxBandSize&&this._scale.maxBandwidth(this._spec.maxBandSize),this._spec.minBandSize&&this._scale.minBandwidth(this._spec.minBandSize),this._scale.isBandwidthFixed()&&this._spec.autoRegionSize&&(this._spec.bandSize||this._spec.maxBandSize))){const e=DO(this._scale.domain().length,(t=this._spec.bandSize)!==null&&t!==void 0?t:this._spec.maxBandSize,this._scale.paddingInner(),this._scale.paddingOuter());["bottom","top"].includes(this._orient)?this._regions.forEach(i=>i.setMaxWidth(e)):["left","right"].includes(this._orient)&&this._regions.forEach(i=>i.setMaxHeight(e))}}}uu.type=Z.cartesianBandAxis,uu.specKey="axes",Ai(uu,b2);const Mnt=()=>{Uo(),F.registerComponent(uu.type,uu)};class R_ extends Ha{constructor(){super(...arguments),this.type=Z.cartesianTimeAxis,this._zero=!1,this.effect={scaleUpdate:t=>{this.computeData(t==null?void 0:t.value),Ie(this._regions,e=>{Fe(this.getOrient())?e.setXAxisHelper(this.axisHelper()):e.setYAxisHelper(this.axisHelper())},{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._tick=yt({},this._spec.tick,(t=this._spec.layers)===null||t===void 0?void 0:t[0])}_initData(){var t;if(super._initData(),(t=this._spec.layers)===null||t===void 0?void 0:t[1]){const e=new Jt(this._option.dataSet,{name:`${this.type}_${this.id}_layer_1_ticks`}).parse(this._scale,{type:"scale"}).transform({type:"ticks",options:Object.assign(Object.assign({},this._tickTransformOption("cartesian")),{tickCount:this._spec.layers[1].tickCount,forceTickCount:this._spec.layers[1].forceTickCount,tickStep:this._spec.layers[1].tickStep})},!1);this._layerTickData=new Ur(this._option,e)}}computeData(t){super.computeData(t),this._layerTickData&&(this._layerTickData.getDataView().reRunAllTransform(),this._layerTickData.updateData())}getLabelFormatMethod(){var t,e,i,n,r,a,o,l;const h=ua.getInstance(),d=((e=(t=this._spec.layers)===null||t===void 0?void 0:t[1])===null||e===void 0?void 0:e.timeFormat)||"%Y%m%d",u=(((n=(i=this._spec.layers)===null||i===void 0?void 0:i[1])===null||n===void 0?void 0:n.timeFormatMode)||"local")==="local"?h.timeFormat:h.timeUTCFormat,c=((a=(r=this._spec.layers)===null||r===void 0?void 0:r[0])===null||a===void 0?void 0:a.timeFormat)||"%Y%m%d",p=(((l=(o=this._spec.layers)===null||o===void 0?void 0:o[0])===null||l===void 0?void 0:l.timeFormatMode)||"local")==="local"?h.timeFormat:h.timeUTCFormat;return(g,f,_,m,v)=>{var y;let b;return b=v===0?p(c,g):u(d,g),!((y=this._spec.label)===null||y===void 0)&&y.formatMethod?this._spec.label.formatMethod(b,f):b}}getLabelItems(t){const e=[];return $(this._tickData.getLatestData())&&e.push(this._tickData.getLatestData().map(i=>({id:i.value,label:i.value,value:t===0?0:this.dataToPosition([i.value])/t,rawValue:i.value}))),this._layerTickData&&$(this._layerTickData.getLatestData())&&e.push(this._layerTickData.getLatestData().map(i=>{const n=this.dataToPosition([i.value]);return{id:i.value,label:i.value,value:n/t,rawValue:i.value}})),e}transformScaleDomain(){}}R_.type=Z.cartesianTimeAxis,R_.specKey="axes";const Cnt=()=>{Uo(),F.registerComponent(R_.type,R_)};class cu extends Ha{constructor(){super(...arguments),this.type=Z.cartesianLogAxis,this._zero=!1,this._scale=new TS}initScales(){var t;super.initScales(),this._scale.base((t=this._spec.base)!==null&&t!==void 0?t:10)}transformScaleDomain(){}}cu.type=Z.cartesianLogAxis,cu.specKey="axes",Ai(cu,gv);const Pnt=()=>{Uo(),F.registerComponent(cu.type,cu)};class pu extends Ha{constructor(){super(...arguments),this.type=Z.cartesianSymlogAxis,this._zero=!1,this._scale=new MS}initScales(){var t;super.initScales(),this._scale.constant((t=this._spec.constant)!==null&&t!==void 0?t:10)}transformScaleDomain(){}}pu.type=Z.cartesianSymlogAxis,pu.specKey="axes",Ai(pu,gv);const Ent=()=>{Uo(),F.registerComponent(pu.type,pu)},PP=s=>{var t;const e=(t=s.type)!==null&&t!==void 0?t:s.orient==="angle"?"band":"linear";return{axisType:e,componentName:`${Z.polarAxis}-${e}`}};var EP=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};class O_ extends EA{constructor(){super(...arguments),this.type=Z.polarAxis,this.name=Z.polarAxis,this._defaultBandPosition=0,this._defaultBandInnerPadding=0,this._defaultBandOuterPadding=0,this.layoutType="absolute",this.layoutZIndex=ce.Axis,this._tick=void 0,this._center=null,this._startAngle=wm,this._endAngle=IS,this._orient="radius",this._groupScales=[],this.effect={scaleUpdate:t=>{this.computeData(t==null?void 0:t.value),Ie(this._regions,e=>{this.getOrient()==="radius"?e.radiusAxisHelper=this.axisHelper():e.angleAxisHelper=this.axisHelper()},{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{var e;const i=(e=this.getRegions())===null||e===void 0?void 0:e[0];return i?i.getLayoutStartPoint():t}}get center(){return this._center}get startAngle(){return this._startAngle}get endAngle(){return this._endAngle}getOrient(){return this._orient}getGroupScales(){return this._groupScales}static getSpecInfo(t){var e,i;const n=t[this.specKey];if(!n)return null;if(!$(n)){if(!NC(n))return null;const{axisType:l,componentName:h}=PP(n);return n.center=t.center,n.startAngle=(e=t.startAngle)!==null&&e!==void 0?e:Jd,n.endAngle=(i=t.endAngle)!==null&&i!==void 0?i:E(t.startAngle)?t.startAngle+360:fg,n.type=l,[{spec:n,specPath:[this.specKey],type:h}]}const r=[];let a;const o=[];return n.forEach((l,h)=>{var d,u,c,p,g;if(!NC(l))return;const{axisType:f,componentName:_}=PP(l);l.center=t.center,l.startAngle=(d=t.startAngle)!==null&&d!==void 0?d:Jd,l.endAngle=(u=t.endAngle)!==null&&u!==void 0?u:E(t.startAngle)?t.startAngle+360:fg,l.outerRadius=(g=(p=(c=l.radius)!==null&&c!==void 0?c:t.outerRadius)!==null&&p!==void 0?p:t.radius)!==null&&g!==void 0?g:ju,l.type=f;const m={spec:l,specIndex:h,specPath:[this.specKey,h],type:_};r.push(m),l.orient==="radius"?o.push(m):a=h}),o.forEach(l=>{l.angleAxisIndex=a}),r}static createComponent(t,e){const{spec:i}=t,n=EP(t,["spec"]),r=F.getComponentInKey(n.type);return r?new r(i,Object.assign(Object.assign({},e),n)):(e.onError(`Component ${n.type} not found`),null)}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.visible&&(this._axisStyle=this._getAxisAttributes(),this._gridStyle=this._getGridAttributes()),this._tick=this._spec.tick,this._orient=this._spec.orient==="angle"?"angle":"radius",this._center=this._spec.center;const i=this.getChart().getSpec(),n=(t=this._spec.startAngle)!==null&&t!==void 0?t:i.startAngle,r=(e=this._spec.endAngle)!==null&&e!==void 0?e:i.endAngle;this._startAngle=ue(n??Jd),this._endAngle=ue(r??(E(n)?n+360:fg)),this._inverse=this._spec.inverse}onLayoutEnd(t){this.updateScaleRange()&&(this.updateSeriesScale(),this.event.emit(St.scaleUpdate,{model:this,value:"range"})),super.onLayoutEnd(t)}onRender(t){}changeRegions(){}_initData(){const t=this._initTickDataSet(this._tickTransformOption("polar"));t.target.addListener("change",this._forceLayout.bind(this)),this._tickData=new Ur(this._option,t)}_tickTransformOption(t){return Object.assign(Object.assign({},super._tickTransformOption(t)),{noDecimal:this._tick.noDecimals,startAngle:this.startAngle,labelOffset:sc(this._spec),getRadius:()=>this.getOuterRadius()})}afterCompile(){var t;const e=(t=this._axisMark)===null||t===void 0?void 0:t.getProduct();e&&e.addEventListener(gt.AFTER_ELEMENT_ENCODE,()=>{this._isLayout===!1&&this._delegateAxisContainerEvent(e.getGroupGraphicItem())})}updateScaleRange(){const t=this._scale.range();let e;return e=this.getOrient()==="radius"?this._inverse?[this.computeLayoutOuterRadius(),this.computeLayoutInnerRadius()]:[this.computeLayoutInnerRadius(),this.computeLayoutOuterRadius()]:this._inverse?[this._endAngle,this._startAngle]:[this._startAngle,this._endAngle],(!t||!e||t[0]!==e[0]||t[1]!==e[1])&&(this._scale.range(e),!0)}collectData(t,e){const i=[];return Ie(this._regions,n=>{var r,a,o;let l;if(l=t>0?(a=(r=n.getGroups())===null||r===void 0?void 0:r.fields)===null||a===void 0?void 0:a[t]:this.getOrient()==="radius"?n.getRadiusField():n.getAngleField(),l=$(l)?qt(this._scale.type)?l:[l[0]]:[l],t||(this._dataFieldText=n.getFieldAlias(l[0])),l){const h=n.getViewData();if(e)l.forEach(d=>{i.push(n.getRawDataStatisticsByField(d,!1))});else if(h&&h.latestData&&h.latestData.length){const d=(o=n.getViewDataStatistics)===null||o===void 0?void 0:o.call(n);l.forEach(u=>{var c;!((c=d==null?void 0:d.latestData)===null||c===void 0)&&c[u]&&i.push(d.latestData[u])})}}},{userId:this._seriesUserId,specIndex:this._seriesIndex}),i}updateSeriesScale(){Ie(this._regions,t=>{this.getOrient()==="radius"?(t.setRadiusScale(this._scale),t.radiusAxisHelper=this.axisHelper()):(t.setAngleScale(this._scale),t.angleAxisHelper=this.axisHelper())},{userId:this._seriesUserId,specIndex:this._seriesIndex})}getSeriesStatisticsField(t){const e=this.getOrient()==="radius"?t.getRadiusField():t.getAngleField();return qt(this._scale.type)?e:[e[0]]}initGroupScales(){}axisHelper(){return{isContinuous:qt(this._scale.type),dataToPosition:this.dataToPosition.bind(this),coordToPoint:this.coordToPoint.bind(this),pointToCoord:this.pointToCoord.bind(this),center:this.getCenter.bind(this),getScale:t=>this._scales[t],getAxisId:()=>this.id}}positionToData(t){const e=this.pointToCoord(t);return this.getOrient()==="radius"?this.invert(e.radius):this.invert(e.angle)}coordToPoint(t){const e=t.angle,{x:i,y:n}=this.getCenter(),r=fa({angle:e,radius:t.radius});return{x:r.x+i,y:r.y+n}}pointToCoord(t){const{x:e,y:i}=this.getCenter();let n=t.x-e,r=t.y-i;const a=this._startAngle,o=this._endAngle,l=Math.sqrt(n*n+r*r);n/=l,r/=l;let h=Math.atan2(r,n);if(h<a)for(;h<=a;)h+=2*Math.PI;if(h>o)for(;h>=o;)h-=2*Math.PI;return{radius:l,angle:h}}getCenter(){var t,e;return{x:((t=this._center)===null||t===void 0?void 0:t.x)||this.getRefLayoutRect().width/2,y:((e=this._center)===null||e===void 0?void 0:e.y)||this.getRefLayoutRect().height/2}}getOuterRadius(){return this.computeLayoutOuterRadius()}getInnerRadius(){return this.computeLayoutInnerRadius()}tickValues(){if(this._tickData){const t=this._tickData.getLatestData();if(!t||$(t))return t||[];this.computeData("force")}return this._scale.ticks()}updateLayoutAttribute(){this._visible&&(this.getOrient()==="radius"?this._layoutRadiusAxis():this._layoutAngleAxis()),super.updateLayoutAttribute()}_layoutAngleAxis(){const t=this.getCenter(),e=this.computeLayoutOuterRadius(),i=this.computeLayoutInnerRadius(),n=this._endAngle-this._startAngle,r=$(this._tickData.getLatestData())?this._tickData.getLatestData().map(l=>{const h=this.dataToPosition([l.value]);return{id:l.value,label:l.value,value:(h-this._startAngle)/n,rawValue:l.value}}):[],a=Object.assign(Object.assign({},this.getLayoutStartPoint()),{inside:this._spec.inside,center:t,radius:e,innerRadius:i,startAngle:this._startAngle,endAngle:this._endAngle}),o=Object.assign(Object.assign({},a),{title:{text:this._spec.title.text||this._dataFieldText},items:r.length?[r]:[],orient:"angle"});this._spec.grid.visible&&(o.grid=Object.assign({type:"line",smoothLink:!0,items:r},a)),this._update(o)}_layoutRadiusAxis(){var t,e,i;const n=this.getCenter(),r=this.computeLayoutOuterRadius(),a=this.computeLayoutInnerRadius(),o=this.coordToPoint({angle:this._startAngle,radius:r}),l=this.coordToPoint({angle:this._startAngle,radius:a}),h=ze.distancePP(l,o),d=$(this._tickData.getLatestData())?this._tickData.getLatestData().map(p=>{const g=this.dataToPosition([p.value]);return{id:p.value,label:p.value,value:(g-a)/h,rawValue:p.value}}):[],u=Object.assign(Object.assign({},this.getLayoutStartPoint()),{start:l,end:o,verticalFactor:-1}),c=Object.assign(Object.assign({},u),{title:{text:this._spec.title.text||this._dataFieldText},items:d.length?[d]:[],orient:"radius"});!((t=this._spec.grid)===null||t===void 0)&&t.visible&&(c.grid=Object.assign({items:d,type:!((e=this._spec.grid)===null||e===void 0)&&e.smooth?"circle":"polygon",center:n,closed:!0,sides:(i=this._getRelatedAngleAxis())===null||i===void 0?void 0:i.tickValues().length,startAngle:this._startAngle,endAngle:this._endAngle},u)),this._update(c)}_getRelatedAngleAxis(){const t=this._option.angleAxisIndex;if(E(t))return this._option.getComponentByIndex(this.specKey,t)}computeLayoutOuterRadius(){var t;const e=(t=this._spec.outerRadius)!==null&&t!==void 0?t:this._spec.radius,i=e??this.getRefSeriesRadius().outerRadius,{width:n,height:r}=this.getRefLayoutRect();return Math.min(n,r)/2*i}computeLayoutInnerRadius(){var t;const e=(t=this._spec.innerRadius)!==null&&t!==void 0?t:this.getRefSeriesRadius().innerRadius,{width:i,height:n}=this.getRefLayoutRect();return Math.min(i,n)/2*e}getRefLayoutRect(){return this.getRegions()[0].getLayoutRect()}getRefSeriesRadius(){let t=ju,e=0;const i=this.getChart().getSpec();return Ie(this.getRegions(),n=>{const r=n;if(qJ(r.type)){const{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=r;N(a)&&(t=a),N(o)&&(e=o)}},{userId:this._seriesUserId,specIndex:this._seriesIndex}),{outerRadius:t,innerRadius:e}}_update(t){const{grid:e}=t,i=EP(t,["grid"]);this._axisMark.getProduct().encode(yt({},this._axisStyle,i)),this._gridMark&&this._gridMark.getProduct().encode(yt({},this._gridStyle,e))}invert(t){var e;if(this.getOrient()==="angle"&&this._scale.type==="band"){const i=this._scale.range(),n=i[i.length-1]-i[0],r=((e=this.getSpec().bandPosition)!==null&&e!==void 0?e:this._defaultBandPosition)===.5?0:this._scale.bandwidth()/2;if(i[0]<0){const a=(t+r+Math.abs(i[0]))%n-Math.abs(i[0]);return this._scale.invert(a)}return this._scale.invert((t+r)%n)}return this._scale.invert(t)}}O_.type=Z.polarAxis,O_.specKey="axes";class gu extends O_{constructor(){super(...arguments),this.type=Z.polarLinearAxis,this._zero=!0,this._nice=!0,this._scale=new un}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){super.initScales(),this.setScaleNice()}computeDomain(t){return this.computeLinearDomain(t)}}gu.type=Z.polarLinearAxis,gu.specKey="axes",Ai(gu,gv);const Rnt=()=>{Uo(),F.registerComponent(gu.type,gu)};class fu extends O_{constructor(){super(...arguments),this.type=Z.polarBandAxis,this._scale=new Wo}computeDomain(t){return this.computeBandDomain(t)}updateScaleRange(){const t=super.updateScaleRange();return this.updateGroupScaleRange(),t}axisHelper(){const t=super.axisHelper();return Object.assign(Object.assign({},t),{getBandwidth:e=>t.getScale(e).bandwidth()})}initScales(){super.initScales(),this.calcScales(this._defaultBandInnerPadding,this._defaultBandOuterPadding)}transformScaleDomain(){}}fu.type=Z.polarBandAxis,fu.specKey="axes",Ai(fu,b2);const Ont=()=>{Uo(),F.registerComponent(fu.type,fu)};var Int=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};function Lnt(s,t){const{title:e={},item:i={},pager:n={},background:r={},type:a,id:o,visible:l,orient:h,position:d,data:u,filter:c,regionId:p,regionIndex:g,seriesIndex:f,seriesId:_,padding:m}=s,v=Int(s,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return e.visible&&(v.title=lD(e)),vt(i.focusIconStyle)||wt(i.focusIconStyle),i.shape=Mn(i.shape),i.label=Mn(i.label),i.value=Mn(i.value),i.background=Mn(i.background),ws(i.maxWidth)&&(i.maxWidth=Number(i.maxWidth.substring(0,i.maxWidth.length-1))*t.width/100),ws(i.width)&&(i.width=Number(i.width.substring(0,i.width.length-1))*t.width/100),ws(i.height)&&(i.height=Number(i.height.substring(0,i.height.length-1))*t.width/100),v.item=i,vt(n.textStyle)||wt(n.textStyle),Mn(n.handler),v.pager=n,r.visible&&!vt(r.style)&&(yt(v,r.style),E(r.padding)&&(v.padding=r.padding)),v}const Bnt=(s,t)=>{const e=[],i={},{series:n,seriesField:r}=t;return n().forEach(a=>{const o=r(a);let l;l=o===a.getSeriesField()?a.getSeriesInfoList():a.getSeriesInfoInField(o),l.forEach(h=>{i[h.key]||(i[h.key]=!0,e.push(h))})}),e},Dnt=(s,t)=>{var e,i,n;const{selected:r,field:a,data:o}=t,l=r(),h=o();if(l.length===0&&h.length)return[];if(l.length===h.length)return s;const d={};l.forEach(c=>{d[c]=!0});const u=(e=a())!==null&&e!==void 0?e:Fs;return $(s)&&(!((i=s[0])===null||i===void 0)&&i.nodes)?(s[0].nodes=s[0].nodes.filter(c=>d[c.key]===!0),!((n=s[0])===null||n===void 0)&&n.links&&(s[0].links=s[0].links.filter(c=>d[c.source]===!0&&d[c.target]===!0))):E(u)&&(s=s.filter(c=>d[c[u]]===!0)),s};class RA extends bs{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=ce.Legend,this.layoutLevel=Ln.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{Ie(this._regions,t=>{var e;(e=t.getViewData())===null||e===void 0||e.markRunning()},{userId:this._seriesUserId,specIndex:this._seriesIndex}),Ie(this._regions,t=>{t.reFilterViewData()},{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}get orient(){return this._orient}get visible(){return this._visible}get position(){return this._position}getLegendData(){return this._legendData.getLatestData()}getSelectedData(){return this._selectedData}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._orient=iA(this._spec.orient)?this._spec.orient:"left",this._position=(t=this._spec.position)!==null&&t!==void 0?t:"middle",this._visible=this._spec.visible!==!1;const{regionId:e,regionIndex:i,seriesId:n,seriesIndex:r}=this._spec;E(n)&&(this._seriesUserId=Y(n)),E(e)&&(this._regionUserId=Y(e)),E(r)&&(this._seriesIndex=Y(r)),E(i)&&(this._regionUserIndex=Y(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,(t==null?void 0:t.orient)!==(e==null?void 0:e.orient)?(i.reMake=!0,i):(Se(e,t)||(i.reCompile=!0),i)}changeRegions(t){}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData()}initData(){const t=this._initLegendData();t.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new Ur(this._option,t),this._initSelectedData(),Ie(this._regions,e=>{e.event.on(St.rawDataUpdate,{filter:({model:i})=>(i==null?void 0:i.id)===e.id},()=>{this._legendData.getDataView().reRunAllTransform()})},{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(t){var e,i,n;const r=this._selectedData;P(t)||JSON.stringify(r)===JSON.stringify(t)||(this._selectedData=[...t],(i=(e=this.effect).onSelectedDataChange)===null||i===void 0||i.call(e),this.event.emit(St.legendSelectedDataChange,{model:this}),(n=this._legendComponent)===null||n===void 0||n.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;N(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},n=this._getLegendAttributes(t);if(n.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)Se(n,this._cacheAttrs)||this._legendComponent.setAttributes(yt({},n,{defaultSelected:this._selectedData}));else{const o=new(this._getLegendConstructor())(yt({},n,{defaultSelected:this._selectedData}));o.name="legend",this._legendComponent=o,this.getContainer().add(o),this._option.disableTriggerEvent||this._initEvent(),o.on("*",(l,h)=>this._delegateEvent(this._legendComponent,l,h))}this._cacheAttrs=n;const r=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,a=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if(this.layoutType!=="normal-inline"){const o=this.layoutOrient==="bottom"||this.layoutOrient==="top"?"horizontal":"vertical",l=this._position,{width:h,height:d}=e;let u=0,c=0;o==="horizontal"?l==="middle"?u=(h-r)/2:l==="end"&&(u=h-r):l==="middle"?c=(d-a)/2:l==="end"&&(c=d-a),this._legendComponent.setAttributes({dx:u,dy:c})}return i.x2=i.x1+r,i.y2=i.y1+a,i}onDataUpdate(){var t,e;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const i=this._getLegendAttributes(this.getLayoutRect());Se(i,this._cacheAttrs)||this._legendComponent.setAttributes(yt({},i,{defaultSelected:this._selectedData}))}(e=(t=this.effect).onSelectedDataChange)===null||e===void 0||e.call(t),this.event.emit(St.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}RA.specKey="legends";class I_ extends RA{constructor(){super(...arguments),this.type=Z.discreteLegend,this.name=Z.discreteLegend}static getSpecInfo(t){const e=t[this.specKey];if(!e)return;if(!$(e))return e.type&&e.type!=="discrete"?void 0:[{spec:e,specIndex:0,specPath:[this.specKey],type:Z.discreteLegend}];const i=[];return e.forEach((n,r)=>{n.type&&n.type!=="discrete"||i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.discreteLegend})}),i}init(t){super.init(t),Ie(this._regions,e=>{e.addViewDataFilter({type:"discreteLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(e),data:()=>this._getLegendDefaultData()},level:Hs.legendFilter})},{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){Ct(this._option.dataSet,"discreteLegendFilter",Dnt),Ct(this._option.dataSet,"discreteLegendDataMake",Bnt);const t=new Jt(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const e=[];return Ie(this._regions,i=>{e.push(i)},{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),e},seriesField:e=>this._getSeriesLegendField(e)}}),t}_getSeriesLegendField(t){var e,i;const n=t.getSeriesField();if(!this._spec.scaleName||!t.getRawData())return n;const r=this._option.globalScale.getScaleSpec(this._spec.scaleName);if(!r)return n;if(this._spec.field)return this._spec.field;if(!Sl(r.domain))return n;const a=r.domain.find(o=>o.dataId===t.getRawData().name);return a&&(i=(e=a.fields)===null||e===void 0?void 0:e[0])!==null&&i!==void 0?i:n}_initSelectedData(){this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=this._getLegendDefaultData()}_getLegendDefaultData(){return K(this._spec.data)?this._getLegendItems().map(t=>t.label):this._legendData.getLatestData().map(t=>t.key)}_addDefaultTitleText(t){var e,i,n,r;if(!((e=t.title)===null||e===void 0)&&e.visible&&P(t.title.text)&&P((i=t.title.style)===null||i===void 0?void 0:i.text)){const a=(r=(n=this._regions)===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.getSeries()[0];if(!a)return;t.title.text=__(a.getRawData(),a.getSeriesField())}}_getLegendAttributes(t){const e=this.layoutOrient==="bottom"||this.layoutOrient==="top"?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},Lnt(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(i),i}_getLegendConstructor(){return UI}_initEvent(){if(this._legendComponent){const t=this._spec.filter!==!1;this._legendComponent.addEventListener(qs.legendItemClick,e=>{const i=It(e,"detail.currentSelected");t&&this.setSelectedData(i),this.event.emit(St.legendItemClick,{model:this,value:i,event:e})}),this._legendComponent.addEventListener(qs.legendItemHover,e=>{const i=It(e,"detail");this.event.emit(St.legendItemHover,{model:this,value:i,event:e})}),this._legendComponent.addEventListener(qs.legendItemUnHover,e=>{const i=It(e,"detail");this.event.emit(St.legendItemUnHover,{model:this,value:i,event:e})})}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map(e=>{var i,n;const r=e.style("fillOpacity"),a=e.style("strokeOpacity"),o=e.style("opacity"),l=e.style("texture");return{label:e.key,shape:{symbolType:(n=(i=e.style("symbolType"))!==null&&i!==void 0?i:e.shapeType)!==null&&n!==void 0?n:"circle",fillOpacity:N(r)?r:1,strokeOpacity:N(a)?a:1,opacity:N(o)?o:1,texturePadding:l?1:null,textureSize:l?4:null,texture:l,fill:e.style("fill"),stroke:e.style("stroke"),textureColor:e.style("textureColor"),innerBorder:e.style("innerBorder"),outerBorder:e.style("outerBorder"),lineDash:e.style("lineDash"),lineDashOffset:e.style("lineDashOffset"),lineWidth:e.style("lineWidth")}}});return K(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}}I_.specKey="legends",I_.type=Z.discreteLegend;const Fnt=()=>{F.registerComponent(I_.type,I_)},jnt=(s,t)=>{const{series:e,field:i,scale:n}=t,r=i();if(i&&r){let a=Number.MAX_VALUE,o=Number.MIN_VALUE;return e().forEach(l=>{const h=l.getRawDataStatisticsByField(r,!0),d=h==null?void 0:h.min,u=h==null?void 0:h.max;N(d)&&(a=d),N(u)&&(o=u)}),[a,o]}if(n){const a=n();return a?a.domain():[]}return[]},znt=(s,t)=>{const{selected:e,field:i,data:n}=t,r=e(),a=i();if(r===n())return s;if(a&&!vt(r)){const[o,l]=r;return s.filter(h=>h[a]>=o&&h[a]<=l)}return s};var Hnt=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};function Nnt(s){const t=yt({},s),{title:e={},handler:i={},rail:n={},track:r={},startText:a,endText:o,handlerText:l,sizeBackground:h,background:d={},type:u,id:c,visible:p,orient:g,position:f,data:_,defaultSelected:m,field:v,filter:y,regionId:b,regionIndex:x,seriesIndex:S,seriesId:A,padding:k}=t,w=Hnt(t,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return e.visible&&(w.title=lD(e)),w.showHandler=i.visible!==!1,vt(i.style)||(w.handlerStyle=wt(i.style)),E(n.width)&&(w.railWidth=n.width),E(n.height)&&(w.railHeight=n.height),vt(n.style)||(w.railStyle=wt(n.style)),vt(r.style)||(w.trackStyle=wt(r.style)),w.startText=Mn(a),w.endText=Mn(o),w.handlerText=Mn(l),vt(h)||(w.sizeBackground=wt(h)),d.visible&&!vt(d.style)&&(yt(w,d.style),E(d.padding)&&(w.padding=d.padding)),w}function RP(s){return s==="color"||s==="size"}const Gnt={color:Nm,size:Gm},Wnt=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],Vnt=[2,10];class L_ extends RA{static getSpecInfo(t){const e=t[this.specKey];if(!e)return;if(!$(e))return RP(e.type)?[{spec:e,specIndex:0,specPath:[this.specKey],type:e.type==="color"?Z.colorLegend:Z.sizeLegend}]:void 0;const i=[];return e.forEach((n,r)=>{RP(n.type)&&i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:n.type==="color"?Z.colorLegend:Z.sizeLegend})}),i}constructor(t,e){super(t,e),this.type=Z.colorLegend,this.name=Z.colorLegend;const i=this._spec.type==="color"?Z.colorLegend:Z.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(t){super.init(t),Ie(this._regions,e=>{e.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData()},level:Hs.legendFilter})},{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){Ct(this._option.dataSet,"continuousLegendFilter",znt),Ct(this._option.dataSet,"continuousLegendDataMake",jnt);const t=new Jt(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>this._regions.reduce((e,i)=>(e.push(...i.getSeries()),e),[]),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,n,r;if(!((e=t.title)===null||e===void 0)&&e.visible&&P(t.title.text)&&P((i=t.title.style)===null||i===void 0?void 0:i.text)){const a=this._field;if(a){const d=(r=(n=this._regions)===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.getSeries()[0];return d?void(t.title.text=__(d.getRawData(),a)):void 0}let o=this._spec.scale;o||(o=this._legendType);const l=this._option.globalScale.getScaleSpec(o);if(!Sl(l==null?void 0:l.domain))return;const h=l.domain[0];if(h.fields.length===0)return;t.title.text=__(this._option.dataSet.getDataView(h.dataId),h.fields[0])}}_getLegendAttributes(t){var e,i;const n=this.layoutOrient==="bottom"||this.layoutOrient==="top"?"horizontal":"vertical",r=n==="horizontal"?"bottom":this.layoutOrient;let a=[];const o=this._getScaleInGlobal();o&&o.type==="linear"&&(a=o.range()),vt(a)&&(a=this._legendType==="color"?Wnt:Vnt);let l=(e=this._legendData.getLatestData()[0])!==null&&e!==void 0?e:0,h=(i=this._legendData.getLatestData()[1])!==null&&i!==void 0?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(l=Math.min(0,this._legendData.getLatestData()[0]),h=this._legendData.getLatestData()[0]===0?1:Math.max(0,this._legendData.getLatestData()[0]));const d=Object.assign({layout:n,align:r,zIndex:this.layoutZIndex,min:l,max:h,value:this._spec.defaultSelected,[this._legendType==="color"?"colors":"sizeRange"]:a},Nnt(this._spec));return this._addDefaultTitleText(d),d}_getLegendConstructor(){return Gnt[this._legendType]}_initEvent(){if(this._legendComponent){const t=this._spec.filter!==!1;this._legendComponent.addEventListener("change",lr(e=>{const i=It(e,"detail.value");t&&this.setSelectedData(i),this.event.emit(St.legendFilter,{model:this,value:i,event:e})},30))}}}L_.specKey="legends",L_.type=Z.continuousLegend;const Unt=()=>{F.registerComponent(L_.type,L_)};function $nt(s){return String(s).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\(/g,"(").replace(/ /g," ")}const hs=(s,t,e)=>P(s)?s:K(s)?s(t,e):s,_u=(s,t,e)=>{if(P(s))return s;if($(s)){const i=[];return s.forEach(n=>{if(K(n)){const r=n(t,e);E(r)&&i.push(r)}else i.push(n)}),i}return K(s)?s(t,e):s};function Ynt(s){var t;const e=!((t=s[0])===null||t===void 0)&&t.series?[{data:s,value:""}]:s;for(const{data:i}of e)for(const{datum:n}of i)for(const r of n??[])if(r)return r}const Jp=(s,t)=>s?(t||(t=s.getBoundingClientRect()),s.offsetWidth>0?t.width/s.offsetWidth:t.height/s.offsetHeight):1,q0=(s,t)=>{var e;let i,n;(s==null?void 0:s.type)!=="rich"&&(s==null?void 0:s.type)!=="html"?(s=(s??"").toString(),t.multiLine?(i=s.split(`
|
||
`),i=i.map((a,o)=>o<i.length-1?a+`
|
||
`:a)):i=[s],n=i.map(a=>Object.assign(Object.assign({},t),{text:a}))):(n=s.text,i=s);const r=pW({wordBreak:(e=t.wordBreak)!==null&&e!==void 0?e:"break-word",maxWidth:t.maxWidth?t.maxWidth:void 0,width:0,height:0,textConfig:n});return{width:r.width(),height:r.height(),text:i}},Xnt="vchart-tooltip-element",OP="vchart-tooltip-container",Knt=20,IP="",LP={key:"其他",value:"..."},Z0={offsetX:10,offsetY:10,sanitize:$nt};class B_{}B_.dom=`${At}_TOOLTIP_HANDLER_DOM`,B_.canvas=`${At}_TOOLTIP_HANDLER_CANVAS`;const Qp=(s,t)=>{let e;if(E(s)){if(dt(s))e=s;else if(K(s)){const i=s(t);dt(i)&&(e=i)}}return e},x2={left:["left","middle"],right:["right","middle"],inside:["middle","middle"],top:["middle","top"],lt:["left","top"],tl:["left","top"],rt:["right","top"],tr:["right","top"],bottom:["middle","bottom"],bl:["left","bottom"],lb:["left","bottom"],br:["right","bottom"],rb:["right","bottom"]},xd=(s,t)=>{var e,i;return(i=(e=x2[s])===null||e===void 0?void 0:e[0])!==null&&i!==void 0?i:t},Sd=(s,t)=>{var e,i;return(i=(e=x2[s])===null||e===void 0?void 0:e[1])!==null&&i!==void 0?i:t},qnt=(s,t,e)=>{var i,n,r,a,o;if(!t||((i=e==null?void 0:e.event)===null||i===void 0?void 0:i.type)==="mouseout")return null;const l=_u(s.title,t,e),h=Y(_u(s.content,t,e)),d={title:{value:(n=l==null?void 0:l.value)===null||n===void 0?void 0:n.toString(),hasShape:!1,shapeType:void 0,shapeHollow:void 0},content:[]},{maxLineCount:u=Knt}=s,c=hs(l==null?void 0:l.visible,t,e)!==!1;if(l&&c){const p=Ynt(t);d.title={value:hs(l==null?void 0:l.value,p,e),valueStyle:hs(l==null?void 0:l.valueStyle,p,e),hasShape:l.hasShape}}else d.title={hasShape:!1,visible:!1};if(s.activeType==="mark")for(const p of h??[]){const g=BP((r=t[0])===null||r===void 0?void 0:r.datum[0],p,e);if(g.visible!==!1){if(d.content.length===u-1){d.content.push(Object.assign(Object.assign({},g),LP));break}if(!(d.content.length<u))break;d.content.push(g)}}else if(s.activeType==="dimension")for(const{data:p}of t){for(const{datum:g,series:f}of p){if(!xa((a=f.tooltipHelper)===null||a===void 0?void 0:a.spec).includes("dimension"))continue;const _=(o=h==null?void 0:h.filter(m=>P(m.seriesId)||m.seriesId===f.id))!==null&&o!==void 0?o:[];for(const m of g){for(const v of _){const y=BP(m,v,e);if(y.visible!==!1){if(d.content.length===u-1){d.content.push(Object.assign(Object.assign({},y),LP));break}if(!(d.content.length<u))break;d.content.push(y)}}if(d.content.length>=u)break}if(d.content.length>=u)break}if(d.content.length>=u)break}return d.title&&(d.content.length>0&&d.content[0].shapeType?(P(d.title.shapeType)&&(d.title.shapeType=d.content[0].shapeType),P(d.title.shapeColor)&&(d.title.shapeColor=d.content[0].shapeColor)):d.title.hasShape=!1),d},BP=(s,t,e)=>{const i=hs(t.key,s,e),n=hs(t.value,s,e),r=hs(t.visible,s,e)!==!1&&(E(i)||E(n)),a=hs(t.isKeyAdaptive,s,e),o=hs(t.spaceRow,s,e),l=hs(t.shapeType,s,e),h=hs(t.shapeColor,s,e),d=hs(t.shapeFill,s,e),u=hs(t.shapeStroke,s,e),c=hs(t.shapeLineWidth,s,e),p=hs(t.keyStyle,s,e),g=hs(t.valueStyle,s,e);return{key:i,value:n,visible:r,isKeyAdaptive:a,hasShape:t.hasShape,shapeType:l,shapeFill:d,shapeStroke:u,shapeLineWidth:c,shapeHollow:t.shapeHollow,shapeColor:h,keyStyle:p,valueStyle:g,spaceRow:o,datum:s}},DP=(s,t,e)=>{var i,n;return(n=(i=s.tooltipHelper)===null||i===void 0?void 0:i.getDefaultTooltipPattern(t,e))!==null&&n!==void 0?n:null},Znt=(s,t,e,i)=>{var n,r,a,o,l,h,d;const u=Object.assign(Object.assign({},t),{activeType:s});if(s==="mark"&&e){const v=(r=(n=e.tooltipHelper)===null||n===void 0?void 0:n.spec)!==null&&r!==void 0?r:{};if(E(v.visible)||E(v.activeType)?u.visible=xa(v).includes("mark"):E(t.visible)||E(t.activeType)?u.visible=xa(t).includes("mark"):u.visible=!0,u.handler=(o=(a=v.handler)!==null&&a!==void 0?a:t.handler)!==null&&o!==void 0?o:void 0,(l=u.handler)===null||l===void 0?void 0:l.showTooltip)return u}else if(s==="dimension"&&(i!=null&&i.length)&&(S2(i).every(v=>{var y;return!xa((y=v.tooltipHelper)===null||y===void 0?void 0:y.spec).includes("dimension")})?u.visible=!1:E(t.visible)||E(t.activeType)?u.visible=xa(t).includes("dimension"):u.visible=!0,u.handler=(h=t.handler)!==null&&h!==void 0?h:void 0,(d=u.handler)===null||d===void 0?void 0:d.showTooltip))return u;const c=Jnt(s,e,i),p=Qnt(s,e,i),g=yt({},bi(t[s]),p),f=c.title,_=tg(void 0,g,void 0,f);if(E(g.title))if(K(g.title)){const v=g.title;g.title=(y,b)=>{var x;const S=(x=v(y,b))!==null&&x!==void 0?x:{};return Object.assign(Object.assign({},_),S)}}else g.title=Object.assign(Object.assign(Object.assign({},c.title),_),g.title);else g.title=Object.assign(Object.assign({},c.title),_);const m=Y(c.content);if(E(g.content)){const v=trt(m);if(K(g.content)){const y=g.content;g.content=(b,x)=>{var S;const A=[];return Y((S=y(b,x))!==null&&S!==void 0?S:[]).forEach(k=>{A.push(Object.assign(Object.assign({},tg(k,g,v)),k))}),A}}else{const y=[];Y(g.content).forEach(b=>{y.push(Object.assign(Object.assign({},tg(b,g,v)),b))}),g.content=y}}else g.content=m.map(v=>Object.assign(Object.assign({},v),tg(void 0,g,void 0,v)));return u[s]=Object.assign(Object.assign(Object.assign({},c),g),{activeType:s}),u},Jnt=(s,t,e)=>{var i;let n={};if(s==="mark"&&t)n=(i=DP(t,"mark"))!==null&&i!==void 0?i:{};else if(s==="dimension"&&(e!=null&&e.length)){const r=[];e[0].data.forEach(o=>{const{series:l}=o,h=[Object.assign(Object.assign({},e[0]),{data:[o]})],d=DP(l,"dimension",h);d&&r.push(d)});const a=[];r.forEach(({content:o})=>{K(o)?a.push(o):a.push(...Y(o))}),n=Object.assign(Object.assign({},r[0]),{content:a})}return n},Qnt=(s,t,e)=>{var i,n;let r={};if(s==="mark"&&t){const a=(n=(i=t.tooltipHelper)===null||i===void 0?void 0:i.spec)!==null&&n!==void 0?n:{};r=a.mark?bi(a.mark):{}}else if(s==="dimension"&&(e!=null&&e.length)){const a=S2(e).filter(o=>{var l;const h=(l=o.tooltipHelper)===null||l===void 0?void 0:l.spec;return E(h==null?void 0:h.dimension)&&xa(h).includes("dimension")}).map(o=>o.tooltipHelper.spec.dimension);if(a.length){let o=[];a.every(({content:l})=>P(l))?o=void 0:a.forEach(({content:l})=>{P(l)||(K(l)?o==null||o.push(l):o==null||o.push(...Y(l)))}),r=Object.assign(Object.assign({},a[0]),{content:o})}}return r},S2=$h(s=>s.reduce((t,e)=>t.concat(e.data.map(i=>i.series).filter(E)),[])),trt=s=>{const t={};return s.forEach(e=>{var i;const n=(i=e.seriesId)!==null&&i!==void 0?i:0;t[n]||(t[n]=e)}),t},tg=(s,t,e,i)=>{var n,r;const a=(r=e==null?void 0:e[(n=s==null?void 0:s.seriesId)!==null&&n!==void 0?n:0])!==null&&r!==void 0?r:e==null?void 0:e[0],o=new Set([].concat(Object.keys(s??{}),Object.keys(t??{}),Object.keys(a??{}),Object.keys(i??{})).filter(h=>h.toLowerCase().includes("shape"))),l={};return o.forEach(h=>{var d,u,c;const p=(c=(u=(d=s==null?void 0:s[h])!==null&&d!==void 0?d:t==null?void 0:t[h])!==null&&u!==void 0?u:a==null?void 0:a[h])!==null&&c!==void 0?c:i==null?void 0:i[h];p!==void 0&&(l[h]=p)}),l};var di;(function(s){s[s.success=0]="success",s[s.failed=1]="failed"})(di||(di={}));const ert={fontFamily:xt.defaultFontFamily,spacing:10,wordBreak:"break-word"};function nl(s={},t,e){var i,n;return Object.assign(Object.assign({},e??ert),{fill:(i=s.fill)!==null&&i!==void 0?i:s.fontColor,textAlign:s.textAlign,textBaseline:s.textBaseline,fontFamily:(n=s.fontFamily)!==null&&n!==void 0?n:t==null?void 0:t.fontFamily,fontSize:s.fontSize,fontWeight:s.fontWeight,lineHeight:s.lineHeight,spacing:s.spacing,multiLine:s.multiLine,maxWidth:s.maxWidth,wordBreak:s.wordBreak,autoWidth:s.autoWidth})}const irt=s=>{var t;const{backgroundColor:e,border:i,shadow:n}=s,r={lineWidth:(t=i==null?void 0:i.width)!==null&&t!==void 0?t:0,shadow:!!n};i!=null&&i.color&&(r.stroke=i.color),e&&(r.fill=e),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=i??{};return E(a)&&(r.cornerRadius=[a,a,a,a]),r},srt=(s,t,e)=>{var i,n,r,a,o;const{style:l={},enterable:h,transitionDuration:d}=t,{panel:u={},titleLabel:c,shape:p,keyLabel:g,valueLabel:f,spaceRow:_}=l,m=_s(u.padding),v=Hr(u.padding),y=nl(c,e),b=nl(g,e),x=nl(f,e),S={fill:!0,size:(i=p==null?void 0:p.size)!==null&&i!==void 0?i:8,spacing:(n=p==null?void 0:p.spacing)!==null&&n!==void 0?n:6},A={panel:irt(u),padding:m,title:{},content:[],titleStyle:{value:y,spaceRow:_},contentStyle:{shape:S,key:b,value:x,spaceRow:_},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:h,transitionDuration:d},{title:k={},content:w=[]}=s;let T=v.left+v.right,M=v.top+v.bottom,C=0;const R=w.filter(U=>(U.key||U.value)&&U.visible!==!1),I=!!R.length;let O=0,L=0,D=0,j=0;if(I){const U=[],it=[],ut=[],ct=[];A.content=R.map((Rt,mt)=>{let Tt=0;const{hasShape:kt,key:Lt,shapeType:Ot="",shapeFill:fi,shapeStroke:Pe,shapeLineWidth:Wi,shapeSize:si,value:xs,isKeyAdaptive:pe,spaceRow:Ae,keyStyle:Ms,valueStyle:rs,shapeColor:dr,shapeHollow:zn}=Rt,hi={height:0,spaceRow:Ae??_};if(E(Lt)){const Be=yt({},b,nl(Ms,void 0,{})),{width:oe,height:Ne,text:fn}=q0(Lt,Be);hi.key=Object.assign(Object.assign({width:oe,height:Ne},Be),{text:fn}),pe?it.push(oe):U.push(oe),Tt=Math.max(Tt,Ne)}if(E(xs)){const Be=yt({},x,nl(rs,void 0,{})),{width:oe,height:Ne,text:fn}=q0(xs,Be);hi.value=Object.assign(Object.assign({width:oe,height:Ne},Be),{text:fn}),ut.push(oe),Tt=Math.max(Tt,Ne)}if(kt){const Be={visible:!0,symbolType:Ot},oe=fi??dr;zn?Be.stroke=oe:Be.fill=oe,Be.stroke=Pe??oe,Be.lineWidth=Wi,hi.shape=Be;const Ne=si??S.size;Tt=Math.max(Ne,Tt),ct.push(Ne)}else hi.shape={visible:!1};return hi.height=Tt,M+=Tt,mt<R.length-1&&(M+=hi.spaceRow),hi}),O=U.length?ei(U):0,L=it.length?ei(it):0,D=ut.length?ei(ut):0,j=ct.length?ei(ct)+S.spacing:0,C=Math.max(j+O+b.spacing+D+x.spacing,j+L,C),A.hasContentShape=!!ct.length,A.keyWidth=O,A.valueWidth=D}let H=0,W=0;const{visible:V=!0,value:X="",valueStyle:Q,spaceRow:J}=k;A.title.visible=V,A.title.spaceRow=J??_;let nt={};const q=()=>nt.autoWidth&&nt.multiLine!==!1;if(V){nt=yt({},y,nl(Q,void 0,{})),q()&&(nt.multiLine=(r=nt.multiLine)===null||r===void 0||r,nt.maxWidth=(a=nt.maxWidth)!==null&&a!==void 0?a:I?Math.ceil(C):void 0);const{text:U,width:it,height:ut}=q0(X,nt);A.title.value=Object.assign(Object.assign({width:q()?Math.min(it,(o=nt.maxWidth)!==null&&o!==void 0?o:Number.MAX_VALUE):it,height:ut},nt),{text:U}),H=A.title.value.width,W=A.title.value.height,M+=W+(I?A.title.spaceRow:0)}return A.title.width=H,A.title.height=W,q()?T+=C||H:T+=Math.max(H,C),I&&A.content.forEach(U=>{var it;const ut=U.value;ut&&((it=ut.autoWidth)===null||it===void 0||it)&&(ut.width=T-v.left-v.right-j-O-b.spacing-x.spacing,ut.maxWidth||(ut.maxWidth=Math.ceil(ut.width)),A.valueWidth=Math.max(A.valueWidth,ut.width))}),A.panel.width=T,A.panel.height=M,A};class A2{get id(){return this._id}get env(){return this._env}constructor(t,e){this._visible=!0,this._id="",this._attributes=null,this._isReleased=!1,this.showTooltip=(i,n,r)=>{var a;let o=!!r.changePositionOnly;return r.changePositionOnly&&((a=this._cacheActualTooltip)===null||a===void 0?void 0:a.activeType)===i||(o=!1,this._clearCacheOfContent()),o&&this._cacheViewSpec&&this._cacheActualTooltip?this.changeTooltipPosition(o,n,r):this.changeTooltip(!0,r,o,i,n)},this._changeTooltip=(i,n,r,a,o)=>{var l,h,d,u,c,p,g,f,_,m,v,y,b;const x=this._component.getSpec();if(this._isReleased||!x)return di.failed;if(!i)return this._clearAllCache(),x.handler?(d=(h=(l=x.handler).hideTooltip)===null||h===void 0?void 0:h.call(l,n))!==null&&d!==void 0?d:di.success:(this._updateTooltip(!1,n),di.success);if(P(a)||P(o))return di.failed;let S;if(r&&this._cacheViewSpec?S=this._cacheViewSpec:(S=Znt(a,x,n.model,n.dimensionInfo),this._cacheViewSpec=S),S.visible===!1)return di.failed;if(S.handler)return(p=(c=(u=S.handler).showTooltip)===null||c===void 0?void 0:c.call(u,a,o,n))!==null&&p!==void 0?p:di.success;const A=S[a];if(!A)return di.failed;let k;return r&&this._cacheActualTooltip?k=this._cacheActualTooltip:(k=this._getActualTooltipContent(A,o,n),k.title=(f=(g=A.updateTitle)===null||g===void 0?void 0:g.call(A,k.title,o,n))!==null&&f!==void 0?f:k.title,k.content=(m=(_=A.updateContent)===null||_===void 0?void 0:_.call(A,k.content,o,n))!==null&&m!==void 0?m:k.content),P((v=k.title)===null||v===void 0?void 0:v.key)&&P((y=k.title)===null||y===void 0?void 0:y.value)&&!(!((b=k.content)===null||b===void 0)&&b.length)?di.failed:(this._cacheActualTooltip=k,this._changeTooltipPosition(!!r,o,n))},this._changeTooltipPosition=(i,n,r)=>{var a,o,l;if(this._isReleased)return di.failed;const h=r.event,d=this._cacheViewSpec,u=this._cacheActualTooltip;if(!d||!u)return di.failed;if(d.enterable){if(!this._isPointerEscaped&&this._isPointerMovingToTooltip(r))return this._isTooltipPaused||(this._isTooltipPaused=!0,this._cachePointerTimer=setTimeout(()=>{this._isPointerEscaped=!0},300)),di.success;this._isTooltipPaused=!1,this._isPointerEscaped=!1,clearTimeout(this._cachePointerTimer),this._cachePointerPosition=this._getPointerPositionRelativeToTooltipParent(r)}const c=u.activeType;if(d.handler)return(l=(o=(a=d.handler).showTooltip)===null||o===void 0?void 0:o.call(a,c,n,r))!==null&&l!==void 0?l:di.success;const p=d[c];if(!p)return di.failed;const g=this._getActualTooltipPosition(u,r,this._getTooltipBoxSize(u,i));u.position=g,p.updatePosition&&(u.position=p.updatePosition(u.position,n,r));let f=(p==null?void 0:p.visible)!==!1;return n&&h.type!=="pointerout"&&u.visible&&(u.title||u.content)||(f=!1),this._updateTooltip(f,Object.assign(Object.assign({},r),{changePositionOnly:i}),u),di.success},this._getActualTooltipContent=(i,n,r)=>{const a=_u(i.visible,n,r);let o=null;return o=qnt(i,n,r),Object.assign(Object.assign({},o),{visible:!!E(o)&&a!==!1,activeType:i.activeType,data:n})},this._getActualTooltipPosition=(i,n,r)=>{var a,o,l,h,d;const u=n.event,c={x:1/0,y:1/0},{offsetX:p,offsetY:g}=this._option,f=this._cacheViewSpec;if(!f)return this._cacheTooltipPosition=void 0,c;const{activeType:_,data:m}=i,v=f[_],y=_u(v.position,m,n),b=_u(v.positionMode,m,n),x=this._getParentElement(f),{width:S=0,height:A=0}=r??{},k=f.renderMode==="canvas",w=(a=n==null?void 0:n.chart)===null||a===void 0?void 0:a.getCanvasRect(),T=(o=w==null?void 0:w.width)!==null&&o!==void 0?o:Al,M=(l=w==null?void 0:w.height)!==null&&l!==void 0?l:kl;let C=!1;const R={width:0,height:0};let I={x:0,y:0},O={x:0,y:0},L=1,D=1;if(rn(this._env)&&!f.confine){if(R.width=window.innerWidth,R.height=window.innerHeight,!k){O=(h=x==null?void 0:x.getBoundingClientRect())!==null&&h!==void 0?h:c;const pe=(d=this._compiler.getCanvas())!==null&&d!==void 0?d:this._chartContainer,Ae=pe==null?void 0:pe.getBoundingClientRect();I={x:Ae.x-O.x,y:Ae.y-O.y},L=Jp(pe,Ae),D=Jp(x,O)}}else R.width=T,R.height=M;const j=D/L;let H,W,V,X,Q,J;if($t(y)){const{left:pe,right:Ae,top:Ms,bottom:rs}=y;H=Qp(pe,u),W=Qp(Ms,u),V=Qp(Ae,u),X=Qp(rs,u)}else if(E(y)&&b!=="pointer"&&i.activeType==="mark"){C=!0;const pe=n.item,Ae=n.model,Ms=pe==null?void 0:pe.getBounds(),rs=Ae==null?void 0:Ae.getLayoutStartPoint();if(Ms&&rs){let{x1:dr,y1:zn,x2:hi,y2:Be}=Ms;switch(dr+=rs.x,hi+=rs.x,zn+=rs.y,Be+=rs.y,xd(y)){case"left":H=dr-S*j-p;break;case"right":H=hi+p;break;case"middle":H=(dr+hi)/2-S*j/2}switch(Sd(y)){case"top":W=zn-A*j-g;break;case"bottom":W=Be+g;break;case"middle":W=(zn+Be)/2-A*j/2}}}const{canvasX:nt,canvasY:q}=u;if(N(H))Q=H;else if(N(V))Q=T-S*j-V;else{const pe=nt;switch(xd(y,"right")){case"middle":Q=pe-S*j/2;break;case"left":Q=pe-S*j-p;break;case"right":Q=pe+p}}if(N(W))J=W;else if(N(X))J=M-A*j-X;else{const pe=q;switch(Sd(y,"bottom")){case"middle":J=pe-A*j/2;break;case"top":J=pe-A*j-g;break;case"bottom":J=pe+g}}Q*=L,J*=L,rn(this._env)&&(Q+=I.x,J+=I.y),Q/=D,J/=D;const{width:U,height:it}=R,ut=()=>Q*D+O.x<0,ct=()=>(Q+S)*D+O.x>U,Rt=()=>J*D+O.y<0,mt=()=>(J+A)*D+O.y>it,Tt=()=>{ut()&&(C?Q=-O.x/D:xd(y,"right")==="middle"?Q+=p+S/2:Q+=2*p+S)},kt=()=>{ut()&&(Q=-O.x/D)},Lt=()=>{ct()&&(C?Q=(U-O.x)/D-S:xd(y,"right")==="middle"?Q-=p+S/2:Q-=2*p+S)},Ot=()=>{ct()&&(Q=(U-O.x)/D-S)},fi=()=>{Rt()&&(C?J=-O.y/D:Sd(y,"bottom")==="middle"?J+=g+A/2:J+=2*g+A)},Pe=()=>{Rt()&&(J=0-O.y/D)},Wi=()=>{mt()&&(C?J=(it-O.y)/D-A:Sd(y,"bottom")==="middle"?J-=g+A/2:J-=2*g+A)},si=()=>{mt()&&(J=(it-O.y)/D-A)};switch(xd(y,"right")){case"middle":ut()?(Tt(),Ot()):(Lt(),kt());break;case"left":Tt(),Ot();break;case"right":Lt(),kt()}switch(Sd(y,"bottom")){case"middle":Rt()?(fi(),si()):(Wi(),Pe());break;case"top":fi(),si();break;case"bottom":Wi(),Pe()}const xs={x:Q,y:J};return this._cacheTooltipPosition=xs,this._cacheTooltipSize={width:S,height:A},xs},this._component=e,this._chartOption=e.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=e.getCompiler(),this._id=t,this._initFromSpec()}hideTooltip(t){return this.changeTooltip(!1,t)}release(){var t,e,i;this._clearAllCache();const n=(t=this._component.getSpec())!==null&&t!==void 0?t:{};n.handler?(i=(e=n.handler).release)===null||i===void 0||i.call(e):(this._removeTooltip(),this._isReleased=!0)}_clearAllCache(){this._clearCacheOfContent(),this._clearCacheOfPosition()}_clearCacheOfContent(){this._cacheViewSpec=void 0,this._cacheActualTooltip=void 0}_clearCacheOfPosition(){this._isTooltipPaused=!1,this._isPointerEscaped=!1,clearTimeout(this._cachePointerTimer),this._cachePointerTimer=-1,this._cachePointerPosition=void 0,this._cacheTooltipPosition=void 0,this._cacheTooltipSize=void 0}_throttle(t){const e=this._component.getSpec();let i;return i=dt(e.throttleInterval)?e.throttleInterval:e.renderMode==="html"&&e.transitionDuration?50:10,Ka(t,i)}_getDefaultOption(){var t,e;const{offset:i}=this._component.getSpec();return Object.assign(Object.assign({},Z0),{offsetX:(t=i==null?void 0:i.x)!==null&&t!==void 0?t:Z0.offsetX,offsetY:(e=i==null?void 0:i.y)!==null&&e!==void 0?e:Z0.offsetY})}_getTooltipBoxSize(t,e){var i,n,r,a,o,l;if(!e||P(this._attributes)){const h=(n=(i=this._chartOption)===null||i===void 0?void 0:i.getTheme())!==null&&n!==void 0?n:{};this._attributes=srt(t,this._component.getSpec(),h)}return{width:(a=(r=this._attributes)===null||r===void 0?void 0:r.panel)===null||a===void 0?void 0:a.width,height:(l=(o=this._attributes)===null||o===void 0?void 0:o.panel)===null||l===void 0?void 0:l.height}}_getPointerPositionRelativeToTooltipParent(t){var e,i;let{canvasX:n,canvasY:r}=t.event;const a={x:1/0,y:1/0},o=this._cacheViewSpec,l=o.renderMode==="canvas",h=this._getParentElement(o);let d={x:0,y:0},u={x:0,y:0},c=1,p=1;if(rn(this._env)&&!o.confine&&!l){u=(e=h==null?void 0:h.getBoundingClientRect())!==null&&e!==void 0?e:a;const g=(i=this._compiler.getCanvas())!==null&&i!==void 0?i:this._chartContainer,f=g==null?void 0:g.getBoundingClientRect();d={x:f.x-u.x,y:f.y-u.y},c=Jp(g,f),p=Jp(h,u)}return n*=c,r*=c,rn(this._env)&&(n+=d.x,r+=d.y),n/=p,r/=p,{x:n,y:r}}_isPointerMovingToTooltip(t){if(!this._cacheTooltipPosition||!this._cacheTooltipSize||!this._cachePointerPosition)return!1;const{width:e,height:i}=this._cacheTooltipSize,{x:n=0,y:r}=this._cacheTooltipPosition,a=this._getPointerPositionRelativeToTooltipParent(t);if(Vd(a,{x1:n,y1:r,x2:n+e,y2:r+i},!1))return!0;const o={x:n,y:r},l={x:o.x+e,y:o.y},h={x:o.x,y:o.y+i},d={x:l.x,y:h.y},u=this._cachePointerPosition;return co([u,o,l],a.x,a.y)||co([u,h,d],a.x,a.y)||co([u,o,d],a.x,a.y)||co([u,l,h],a.x,a.y)}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption(),this.changeTooltip=this._throttle(this._changeTooltip),this.changeTooltipPosition=this._throttle(this._changeTooltipPosition)}reInit(){this._initFromSpec()}}const we=(s,t)=>E(s)?$(s)?s.map(e=>`${e}px`).join(" "):`${s}px`:t??"initial",nrt=s=>{const t=s.split(" ").map(e=>Number.isNaN(e)?Number.parseFloat(e.substring(0,e.length-2)):Number.parseFloat(e));return t.length===1?t[0]:t};function rrt(s){var t,e,i,n,r;const{panel:a={},title:o,content:l,titleStyle:h={},contentStyle:d={},padding:u,keyWidth:c,valueWidth:p,enterable:g,transitionDuration:f}=s??{},{fill:_,shadow:m,shadowBlur:v,shadowColor:y,shadowOffsetX:b,shadowOffsetY:x,shadowSpread:S,cornerRadius:A,stroke:k,lineWidth:w=0,width:T=0,height:M=0}=a,{value:C={}}=h,{shape:R={},key:I={},value:O={}}=d,L=art(R),D=Ad(I),j=Ad(O),{bottom:H,left:W,right:V,top:X}=Hr(u);return{panel:{width:we(T+2*w),minHeight:we(M+2*w),paddingBottom:we(H),paddingLeft:we(W),paddingRight:we(V),paddingTop:we(X),borderColor:k,borderWidth:we(w),borderRadius:we(A),backgroundColor:_?`${_}`:"transparent",boxShadow:m?`${b}px ${x}px ${v}px ${S}px ${y}`:"initial",pointerEvents:g?"auto":"none",transitionDuration:f?`${f}ms`:"initial",transitionProperty:f?"transform":"initial",transitionTimingFunction:f?"ease-out":"initial"},title:Object.assign({marginTop:"0px",marginBottom:l!=null&&l.length?we(o==null?void 0:o.spaceRow):"0px"},Ad(yt({},C,o==null?void 0:o.value))),content:{},shapeColumn:{common:L,items:[],width:we(R.size),marginRight:we((t=R.spacing)!==null&&t!==void 0?t:8),marginBottom:we(-((i=(e=l==null?void 0:l[(l==null?void 0:l.length)-1])===null||e===void 0?void 0:e.spaceRow)!==null&&i!==void 0?i:0))},keyColumn:{common:D,items:l==null?void 0:l.map(({key:Q,spaceRow:J},nt)=>Object.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:nt<l.length-1?we(J):"0px"},D),Ad(Q)),Q!=null&&Q.multiLine?{width:we(Math.ceil(Q.width))}:void 0)),width:we(c),marginRight:we((n=I.spacing)!==null&&n!==void 0?n:26)},valueColumn:{common:j,items:l==null?void 0:l.map(({value:Q,spaceRow:J},nt)=>Object.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:nt<l.length-1?we(J):"0px"},j),Ad(Q)),Q!=null&&Q.multiLine?{width:we(Math.ceil(Q.width))}:void 0)),width:we(p),marginRight:we((r=O.spacing)!==null&&r!==void 0?r:0)}}}function Ad(s,t){if(!s)return;const{fontFamily:e,fontSize:i,fill:n,textAlign:r,lineHeight:a,fontWeight:o,multiLine:l,wordBreak:h,maxWidth:d}=yt({},t,s),u={};return u.fontFamily=e,u.fontSize=we(i),u.color=n,u.textAlign=r,u.lineHeight=we(qn(a,i)),u.fontWeight=o,u.whiteSpace=l?"initial":"nowrap",u.wordBreak=l?h??"break-word":"normal",u.maxWidth=we(d),u}function art(s,t){if(!s)return;const{size:e}=yt({},t,s),i={};return i.width=we(e),i}class on{static isInstance(t){return!!t&&t.type===on.type}setOption(t){this._option=t,Object.values(this.children).forEach(e=>e.setOption(t))}getParentEl(){return on.isInstance(this.parent)?this.parent.product:this.parent}constructor(t,e,i){this.type=on.type,this._renderContentCache=null,this.children={},this.parent=t,this._option=e,this.childIndex=i??0}init(t,e){}initAll(){this.init(),Object.values(this.children).forEach(t=>t.initAll())}setStyle(t){this.product&&t&&Object.keys(t).forEach(e=>{this.product.style[e]!==t[e]&&(this.product.style[e]=t[e])})}setContent(t){}setVisibility(t){if(!this.product)return;const{style:e}=this.product;e.visibility=t?"visible":"hidden",Object.values(this.children).forEach(i=>i.setVisibility(t))}getVisibility(){var t,e;return!!(!((e=(t=this.product)===null||t===void 0?void 0:t.style)===null||e===void 0)&&e.visibility)&&this.product.style.visibility!=="hidden"}release(){var t;if(Object.values(this.children).forEach(e=>e.release()),this.children={},this.product){try{(t=this.getParentEl())===null||t===void 0||t.removeChild(this.product)}catch{}this.product=null}}createElement(t,e,i,n){const r=ga==null?void 0:ga.createElement(t),a=this.getParentEl();if(!r||!a)return;e&&r.classList.add(...e),i&&Object.keys(i).forEach(l=>{r.style[l]=i[l]}),n&&(r.id=n);let o=this.childIndex;if(on.isInstance(this.parent)){let l=Number.MAX_VALUE;for(let h=0;h<a.children.length;h++){const d=Object.values(this.parent.children).find(u=>u.product===a.children[h]);d.childIndex>this.childIndex&&d.childIndex<l&&(l=d.childIndex,o=h)}}return o>=a.children.length?a.appendChild(r):a.insertBefore(r,a.children[o]),r}}on.type="tooltipModel";const ort={fontSize:"13px",marginBottom:"0px",fontWeight:"normal"},lrt={boxSizing:"border-box"},hrt={display:"flex",whiteSpace:"nowrap"},drt={display:"flex",flexDirection:"column",justifyContent:"space-around",fontSize:"0"},urt={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},crt={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},prt={paddingTop:"0px",paddingBottom:"0px",textAlign:"right",fontWeight:"normal"},grt={lineHeight:"normal"};class k2 extends on{init(t,e,i){if(!this.product){const n=this.createElement(i??"div",[...t??[],"shape"],void 0,e);this.product=n}}setStyle(t,e){super.setStyle(t),this.setSvg(e)}setContent(t){this.setSvg(t)}setSvg(t){const e=_rt(t,this._option.valueToHtml);this.product&&e!==this._svgHtmlCache&&(this._svgHtmlCache=e,this.product.innerHTML=e)}release(){super.release(),this._svgHtmlCache=""}}const frt={star:"M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"};function _rt(s,t){var e,i,n,r,a,o,l;if(!(s!=null&&s.hasShape)||!s.symbolType)return"";const{symbolType:h,fill:d,stroke:u,hollow:c=!1}=s,p=s.size?t(s.size):"8px",g=s.marginTop?t(s.marginTop):"0px",f=s.lineWidth?t(s.lineWidth)+"px":"0px";let _="currentColor";const m=()=>u?t(u):_,v=nrt(p),y=T=>new Pu({symbolType:T,size:v,fill:!0});let b=y((e=frt[h])!==null&&e!==void 0?e:h);const x=b.getParsedPath();x.path||(b=y(x.pathStr));const S=b.getParsedPath().path,A=S.toString(),k=S.bounds;let w=`${k.x1} ${k.y1} ${k.width()} ${k.height()}`;if(f!=="0px"){const[T,M,C,R]=w.split(" ").map(O=>Number(O)),I=Number(f.slice(0,-2));w=`${T-I/2} ${M-I/2} ${C+I} ${R+I}`}if(!d||ht(d)||c)return _=c?"none":d?t(d):"currentColor",`
|
||
<svg width="${p}" height="${p}" viewBox="${w}"
|
||
style="display: inline-block; vertical-align: middle; margin-top: ${g};">
|
||
<path
|
||
d="${A}"
|
||
style="fill: ${_}; stroke: ${m()}; stroke-width: ${f}"
|
||
>
|
||
</path>
|
||
</svg>`;if($t(d)){_=(i="gradientColor"+s.index)!==null&&i!==void 0?i:"";let T="";const M=((n=d.stops)!==null&&n!==void 0?n:[]).map(C=>`<stop offset="${t(C.offset.toString())}" stop-color="${t(C.color)}"/>`).join("");return d.gradient==="radial"?T=`<radialGradient id="${_}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">
|
||
${M}
|
||
</radialGradient>`:d.gradient==="linear"&&(T=`<linearGradient id="${_}" x1="${100*((r=d.x0)!==null&&r!==void 0?r:0)}%" y1="${100*((a=d.y0)!==null&&a!==void 0?a:0)}%" x2="${100*((o=d.x1)!==null&&o!==void 0?o:0)}%" y2="${100*((l=d.y1)!==null&&l!==void 0?l:0)}%">
|
||
${M}
|
||
</linearGradient>`),`
|
||
<svg width="${p}" height="${p}" viewBox="-0.5 -0.5 1 1"
|
||
style="display: inline-block; vertical-align: middle; margin-top: ${g};">
|
||
${T}
|
||
<path
|
||
d="${A}"
|
||
style="fill: url(#${_}); stroke: ${m()}; stroke-width: ${f}"
|
||
>
|
||
</path>
|
||
</svg>`}return""}class w2 extends on{init(t,e,i){this.product||(this.product=this.createElement(i??"span",t,void 0,e))}setContent(t,e){if(!this.product)return;let i=this._option.valueToHtml(t);e&&(i=i.replaceAll(`
|
||
`,"<br>")),i!==this.product.innerHTML&&(this.product.innerHTML=i)}}const FP={overflowWrap:"normal",wordWrap:"normal"};class J0 extends on{constructor(t,e,i,n){super(t,e,n),this.className=i}init(){var t,e;this.product||(this.product=this.createElement("div",[this.className]));const i=(e=(t=this._option.getTooltipActual())===null||t===void 0?void 0:t.content)!==null&&e!==void 0?e:[];if(this.className!=="shape-box"||i.some(n=>n.hasShape&&n.shapeType)){Object.keys(this.children).forEach(n=>{const r=Qn(n);r>=i.length&&(this.children[r].release(),delete this.children[r])});for(let n=0;n<i.length;n++)if(!this.children[n]){if(this.className==="key-box"||this.className==="value-box"){const r=new w2(this.product,this._option,n);r.init([this.className.substring(0,this.className.indexOf("-"))],void 0,"div"),this.children[n]=r}else if(this.className==="shape-box"){const r=new k2(this.product,this._option,n);r.init(["shape"],void 0,"div"),this.children[n]=r}}}else Object.keys(this.children).forEach(n=>{const r=Qn(n);this.children[r].release(),delete this.children[r]})}setStyle(){var t,e,i,n;const r=this._option.getTooltipStyle();super.setStyle(yt({},drt,r.content,this._getContentColumnStyle()));const a=(e=(t=this._option.getTooltipActual())===null||t===void 0?void 0:t.content)!==null&&e!==void 0?e:[],o=(n=(i=this._option.getTooltipAttributes())===null||i===void 0?void 0:i.content)!==null&&n!==void 0?n:[];a.forEach((l,h)=>{var d,u,c,p,g;let f={};if(this.className==="key-box"){const{key:_,isKeyAdaptive:m}=l;f=yt({},m?crt:urt,Object.assign(Object.assign(Object.assign({height:we(o[h].height)},FP),r.keyColumn.common),(d=r.keyColumn.items)===null||d===void 0?void 0:d[h])),ht(_)&&((u=_==null?void 0:_.trim)===null||u===void 0?void 0:u.call(_))!==""||dt(_)||f.visibility?f.visibility="visible":f.visibility="hidden",this.children[h].setStyle(f)}else this.className==="value-box"?(f=yt({},prt,Object.assign(Object.assign(Object.assign({height:we(o[h].height)},FP),r.valueColumn.common),(c=r.valueColumn.items)===null||c===void 0?void 0:c[h])),this.children[h].setStyle(f)):this.className==="shape-box"&&(f=yt({},grt,Object.assign(Object.assign({height:we(o[h].height+o[h].spaceRow)},r.shapeColumn.common),(p=r.shapeColumn.items)===null||p===void 0?void 0:p[h])),(g=this.children[h])===null||g===void 0||g.setStyle(f,this._getShapeSvgOption(l,h)))})}setContent(){var t,e,i,n;const r=(e=(t=this._option.getTooltipActual())===null||t===void 0?void 0:t.content)!==null&&e!==void 0?e:[],a=(n=(i=this._option.getTooltipAttributes())===null||i===void 0?void 0:i.content)!==null&&n!==void 0?n:[];r.forEach((o,l)=>{var h,d,u,c,p,g,f;let _;if(this.className==="key-box"){const m=o.key;_=ht(m)&&((h=m==null?void 0:m.trim)===null||h===void 0?void 0:h.call(m))!==""||dt(m)?m:IP,(d=this.children[l])===null||d===void 0||d.setContent(_,(u=a[l].key)===null||u===void 0?void 0:u.multiLine)}else if(this.className==="value-box"){const m=o.value;_=ht(m)&&((c=m==null?void 0:m.trim)===null||c===void 0?void 0:c.call(m))!==""||dt(m)?m:IP,(p=this.children[l])===null||p===void 0||p.setContent(_,(g=a[l].value)===null||g===void 0?void 0:g.multiLine)}else this.className==="shape-box"&&(_=this._getShapeSvgOption(o,l),(f=this.children[l])===null||f===void 0||f.setContent(_))})}_getContentColumnStyle(){var t,e;const i=this._option.getTooltipStyle();switch(this.className){case"shape-box":const n=(e=(t=this._option.getTooltipActual())===null||t===void 0?void 0:t.content)!==null&&e!==void 0?e:[];return Object.assign(Object.assign({},i.shapeColumn),this.className!=="shape-box"||n.some(r=>r.hasShape&&r.shapeType)?{}:{display:"none"});case"key-box":return i.keyColumn;case"value-box":return i.valueColumn}}_getShapeSvgOption(t,e){var i,n,r,a,o,l;const h=this._option.getTooltipStyle(),d=Object.assign(Object.assign({},h.shapeColumn),(i=h.shapeColumn.items)===null||i===void 0?void 0:i[e]),u=Object.assign(Object.assign({},h.keyColumn),(n=h.keyColumn.items)===null||n===void 0?void 0:n[e]);return{hasShape:t.hasShape,symbolType:t.shapeType,size:d.width,fill:(r=t.shapeFill)!==null&&r!==void 0?r:t.shapeColor,stroke:t.shapeStroke,lineWidth:t.shapeLineWidth,hollow:t.shapeHollow,marginTop:`calc((${(o=(a=u.lineHeight)!==null&&a!==void 0?a:u.fontSize)!==null&&o!==void 0?o:"18px"} - ${(l=d.width)!==null&&l!==void 0?l:"8px"}) / 2)`,index:e}}}class mrt extends on{init(){this.product||(this.product=this.createElement("div",["container-box"])),this.shapeBox||this._initShapeBox(),this.keyBox||this._initKeyBox(),this.valueBox||this._initValueBox()}_initShapeBox(){const t=new J0(this.product,this._option,"shape-box",0);t.init(),this.shapeBox=t,this.children[t.childIndex]=t}_initKeyBox(){const t=new J0(this.product,this._option,"key-box",1);t.init(),this.keyBox=t,this.children[t.childIndex]=t}_initValueBox(){const t=new J0(this.product,this._option,"value-box",2);t.init(),this.valueBox=t,this.children[t.childIndex]=t}setStyle(t){super.setStyle(yt({},hrt,t)),Object.values(this.children).forEach(e=>{e.setStyle()})}setContent(){Object.values(this.children).forEach(t=>{t.setContent()})}release(){super.release(),this.shapeBox=null,this.keyBox=null,this.valueBox=null}}class vrt extends on{init(){const t=this._option.getTooltipActual();this.product||(this.product=this.createElement("h2"));const{title:e}=t;e!=null&&e.hasShape&&(e!=null&&e.shapeType)?this.shape||this._initShape():this.shape&&this._releaseShape(),this.textSpan||this._initTextSpan()}_initShape(){const t=new k2(this.product,this._option,0);t.init(),this.shape=t,this.children[t.childIndex]=t}_releaseShape(){this.shape&&(this.shape.release(),delete this.children[this.shape.childIndex],this.shape=null)}_initTextSpan(){const t=new w2(this.product,this._option,1);t.init(),this.textSpan=t,this.children[t.childIndex]=t}setStyle(t){var e,i,n,r;const a=this._option.getTooltipStyle(),o=this._option.getTooltipActual(),{title:l}=o;super.setStyle(yt({},ort,a.title,t)),(e=this.shape)===null||e===void 0||e.setStyle({paddingRight:(i=a.shapeColumn.common)===null||i===void 0?void 0:i.marginRight},{hasShape:l==null?void 0:l.hasShape,symbolType:l==null?void 0:l.shapeType,size:(n=a.shapeColumn.common)===null||n===void 0?void 0:n.width,fill:l==null?void 0:l.shapeColor,hollow:l==null?void 0:l.shapeHollow}),(r=this.textSpan)===null||r===void 0||r.setStyle({color:"inherit"})}setContent(){var t,e,i,n,r,a;const o=this._option.getTooltipStyle(),l=this._option.getTooltipActual(),h=this._option.getTooltipAttributes(),{title:d}=l;this.init(),(t=this.shape)===null||t===void 0||t.setStyle(void 0,{hasShape:d==null?void 0:d.hasShape,symbolType:d==null?void 0:d.shapeType,size:(e=o.shapeColumn.common)===null||e===void 0?void 0:e.width,fill:d==null?void 0:d.shapeColor,hollow:d==null?void 0:d.shapeHollow}),(i=this.textSpan)===null||i===void 0||i.setStyle({color:"inherit"}),(n=this.textSpan)===null||n===void 0||n.setContent(d==null?void 0:d.value,(a=(r=h.title)===null||r===void 0?void 0:r.value)===null||a===void 0?void 0:a.multiLine)}release(){super.release(),this.shape=null,this.textSpan=null}}class yrt extends on{constructor(t,e,i,n){super(t,e,0),this.title=null,this.content=null,this._classList=i,this._id=n}setVisibility(t){if(super.setVisibility(t),!this.product)return;const{classList:e}=this.product;t?e.add("visible"):e.remove("visible")}init(){var t;const e=this._option.getTooltipActual();this.product||this._initPanel(this._classList,this._id);const{title:i}=e;(i==null?void 0:i.visible)!==!1&&E(i==null?void 0:i.value)?this.title||this._initTitle():this.title&&this._releaseTitle(),((t=e.content)!==null&&t!==void 0?t:[]).length>0?this.content||this._initContent():this.content&&this._releaseContent()}_initPanel(t,e){const i=this.createElement("div",t,{left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:"99999999999999",fontFamily:"sans-serif",fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh"},e);this.product=i}_initTitle(){const t=new vrt(this.product,this._option,0);t.init(),this.title=t,this.children[t.childIndex]=t}_releaseTitle(){this.title&&(this.title.release(),delete this.children[this.title.childIndex],this.title=null)}_initContent(){const t=new mrt(this.product,this._option,1);t.init(),this.content=t,this.children[t.childIndex]=t}_releaseContent(){this.content&&(this.content.release(),delete this.children[this.content.childIndex],this.content=null)}setStyle(){const t=this._option.getTooltipStyle();super.setStyle(yt({},lrt,t.panel)),Object.values(this.children).forEach(e=>e.setStyle())}setContent(){Object.values(this.children).forEach(t=>{t.setContent()})}release(){super.release(),this.title=null,this.content=null}}class brt extends A2{getVisibility(){var t;return!!(!((t=this.model)===null||t===void 0)&&t.getVisibility())}setVisibility(t){var e;t!==this.getVisibility()&&((e=this.model)===null||e===void 0||e.setVisibility(t))}constructor(t,e){super(t,e),this.type=B_.dom,this._tooltipContainer=ga==null?void 0:ga.body,this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec(),e=t.parentElement;if(ga&&e){for(let i=0;i<e.children.length;i++)if(e.children[i].classList.contains(OP)){this._container=e.children[i];break}this._container||(this._container=ga.createElement("div"),this._container.style.position="relative",this._container.classList.add(OP),e.appendChild(this._container)),this.model=new yrt(this._container,{valueToHtml:this._option.sanitize,getTooltipStyle:()=>this._domStyle,getTooltipActual:()=>this._tooltipActual,getTooltipAttributes:()=>this._attributes},[t.className],this.id)}}_removeTooltip(){var t;(t=this.model)===null||t===void 0||t.release(),this._container=null}_updateTooltip(t,e,i){var n,r;if(t&&this.model){e.changePositionOnly||(this._tooltipActual=i,this._initStyle(),this.model.initAll(),this.model.setStyle(),this.model.setContent()),this.setVisibility(t);let{x:a=0,y:o=0}=(n=i.position)!==null&&n!==void 0?n:{};const l=this.model.product;if(l){if(!((r=this._cacheViewSpec)===null||r===void 0)&&r.updateElement){this._cacheViewSpec.updateElement(l,i,e);const h=this._getActualTooltipPosition(i,e,{width:l.offsetWidth,height:l.offsetHeight});a=h.x,o=h.y}l.style.transform=`translate3d(${a}px, ${o}px, 0)`}}else this.setVisibility(t)}_initStyle(){this._domStyle=rrt(this._attributes)}_getParentElement(t){var e;return(e=this._container)!==null&&e!==void 0?e:super._getParentElement(t)}isTooltipShown(){return this.getVisibility()}reInit(){super.reInit(),this._initStyle()}}class xrt extends A2{constructor(t,e){var i;super(t,e),this.type=B_.canvas,this._tooltipCanvasId=(i=this._chartOption.modeParams)===null||i===void 0?void 0:i.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new JI({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e,i){this._visible=t;const n=this._compiler.getStage();if(!n)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(n);const r=i==null?void 0:i.position;e.changePositionOnly?E(r)&&this._tooltipComponent.setAttributes(r):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),r)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return(t=this._tooltipComponent)===null||t===void 0?void 0:t.attribute.visibleAll}release(){var t;super.release(),(t=this._layer)===null||t===void 0||t.release()}}const ia=(s,t)=>E(t)?s.map(e=>t[e]):void 0,mr=(s,t)=>e=>s.every((i,n)=>e[i]===(t==null?void 0:t[n])),lo=s=>!P(s)&&($(s)?s.length>0&&s.every(E):Object.keys(s).length>0);function Srt(s,t,e,i){var n,r,a,o,l;const h=Object.assign({regionIndex:0},t),d=i.getRegionsInUserIdOrIndex(E(h.regionId)?[h.regionId]:void 0,E(h.regionIndex)?[h.regionIndex]:void 0)[0];if(!d)return"none";const u=d.getSeries(),c=[];u.forEach(b=>{var x,S,A,k,w,T,M,C;const R=b.getDimensionField(),I=b.getMeasureField(),O=b.getSeriesField(),L=E(O)?s[O]:void 0,D=E(O)&&(k=(A=(S=(x=b.getViewDataStatistics)===null||x===void 0?void 0:x.call(b))===null||S===void 0?void 0:S.latestData[O])===null||A===void 0?void 0:A.values)!==null&&k!==void 0?k:[],j=ia(R,s);let H=ia(I,s);const W=lo(H),V=!W&&E(O)&&P(L)&&D.length>0;if(b.coordinate==="cartesian"){const X=b,Q=R.map((nt,q)=>[nt,q]).filter(([,nt])=>P(j==null?void 0:j[nt]));let J=[j??[]];Q.length>0&&Q.forEach(([nt,q])=>{var U,it,ut,ct;const Rt=(ct=(ut=(it=(U=b.getViewDataStatistics)===null||U===void 0?void 0:U.call(b))===null||it===void 0?void 0:it.latestData[nt])===null||ut===void 0?void 0:ut.values)!==null&&ct!==void 0?ct:[],mt=[];J.forEach(Tt=>{Rt.forEach(kt=>{var Lt;const Ot=(Lt=Tt==null?void 0:Tt.slice())!==null&&Lt!==void 0?Lt:[];Ot[q]=kt,mt.push(Ot)})}),J=mt}),J.forEach(nt=>{var q,U;if(V){const it=(q=X.getViewData())===null||q===void 0?void 0:q.latestData.filter(mr(R,nt));D.forEach(ut=>{const ct=it.find(mt=>mt[O]===ut);if(H=ia(I,ct),!lo(H))return;const Rt=X.dataToPosition(ct);P(Rt)||isNaN(Rt.x)||isNaN(Rt.y)||c.push({pos:Rt,data:{dimensionFields:R,dimensionData:nt,measureFields:I,measureData:H,hasMeasureData:W,groupField:O,groupData:ut},series:b})})}else{const it=(U=X.getViewData())===null||U===void 0?void 0:U.latestData.find(mr(R,nt));if(!W&&(H=ia(I,it),!lo(H)))return;const ut=X.dataToPosition(it);if(P(ut)||isNaN(ut.x)||isNaN(ut.y))return;c.push({pos:ut,data:{dimensionFields:R,dimensionData:nt,measureFields:I,measureData:H,hasMeasureData:W,groupField:O,groupData:L},series:b})}})}else if(b.coordinate==="polar")if(b.type===z.pie){const X=b,Q=(w=X.getViewData())===null||w===void 0?void 0:w.latestData.find(mr(R,j));if(!W&&(H=ia(I,Q),!lo(H)))return;const J=X.dataToCentralPosition(Q);if(P(J)||isNaN(J.x)||isNaN(J.y))return;c.push({pos:J,data:{dimensionFields:R,dimensionData:j,measureFields:I,measureData:H,hasMeasureData:W,groupField:O,groupData:L},series:b})}else{const X=b;if(V){const Q=((T=X.getViewData())===null||T===void 0?void 0:T.latestData.filter(mr(R,j))).find(J=>J[O]===L);D.forEach(J=>{if(H=ia(I,Q),!lo(H))return;const nt=X.dataToPosition(Q);P(nt)||isNaN(nt.x)||isNaN(nt.y)||c.push({pos:nt,data:{dimensionFields:R,dimensionData:j,measureFields:I,measureData:H,hasMeasureData:W,groupField:O,groupData:J},series:b})})}else{const Q=(M=X.getViewData())===null||M===void 0?void 0:M.latestData.find(mr(R,j));if(!W&&(H=ia(I,Q),!lo(H)))return;const J=X.dataToPosition(Q);if(P(J)||isNaN(J.x)||isNaN(J.y))return;c.push({pos:J,data:{dimensionFields:R,dimensionData:j,measureFields:I,measureData:H,hasMeasureData:W,groupField:O,groupData:L},series:b})}}else if(b.coordinate==="geo"){const X=b,Q=(C=X.getViewData())===null||C===void 0?void 0:C.latestData.find(mr(R,j));if(!W&&(H=ia(I,Q),!lo(H)))return;const J=X.dataToPosition(Q);if(P(J)||isNaN(J.x)||isNaN(J.y))return;c.push({pos:J,data:{dimensionFields:R,dimensionData:j,measureFields:I,measureData:H,hasMeasureData:W,groupField:O,groupData:L},series:b})}});const p=(n=h.activeType)!==null&&n!==void 0?n:c.length>1?"dimension":"mark",g=d.getLayoutStartPoint(),f=d.getLayoutRect(),_=i.globalInstance.getContainer(),m=Object.assign({x:0,y:0},_?zj(_):{}),v=b=>{var x;const{dimensionFields:S,dimensionData:A,measureFields:k,measureData:w,groupField:T,groupData:M}=b.data;return(x=b.series.getViewData())===null||x===void 0?void 0:x.latestData.find(R=>mr(S,A)(R)&&mr(k,w)(R)&&(P(T)||mr([T],[M])(R)))},y=b=>{var x,S;const A=(T=>({x:Math.min(Math.max(T.x,0),f.width),y:Math.min(Math.max(T.y,0),f.height)}))(b),k=(x=h.x)!==null&&x!==void 0?x:g.x+A.x,w=(S=h.y)!==null&&S!==void 0?S:g.y+A.y;return{canvasX:k,canvasY:w,clientX:m.x+k,clientY:m.y+w}};if(p==="dimension"){const b=c[0];if(!b)return"none";const x=new Map;c.forEach(w=>{var T;x.has(w.series)||x.set(w.series,[]),(T=x.get(w.series))===null||T===void 0||T.push(w)});const S=[{value:s[b.data.dimensionFields[0]],data:[...x.keys()].map(w=>{var T,M;return{series:w,datum:(M=(T=x.get(w))===null||T===void 0?void 0:T.map(C=>v(C)))!==null&&M!==void 0?M:[]}})}],A={changePositionOnly:!1,dimensionInfo:S,chart:(r=i.globalInstance.getChart())!==null&&r!==void 0?r:void 0,datum:void 0,model:void 0,source:te.chart,event:y({x:c.reduce((w,T)=>w+T.pos.x,0)/c.length,y:c.reduce((w,T)=>w+T.pos.y,0)/c.length}),item:void 0,itemMap:new Map};(a=e==null?void 0:e.showTooltip)===null||a===void 0||a.call(e,p,S,A);const k=i.globalInstance;return an.globalConfig.uniqueTooltip&&an.hideTooltip(k.id),p}if(p==="mark"){const b=c[0];if(!b)return"none";const x=Object.assign(Object.assign({},v(b)),s),S={changePositionOnly:!1,chart:(o=i.globalInstance.getChart())!==null&&o!==void 0?o:void 0,datum:x,model:b.series,source:te.chart,event:y(b.pos),item:void 0,itemMap:new Map};(l=e==null?void 0:e.showTooltip)===null||l===void 0||l.call(e,p,[{datum:[x],series:b.series}],S);const A=i.globalInstance;return an.globalConfig.uniqueTooltip&&an.hideTooltip(A.id),p}return"none"}class T2{constructor(t){this._showTooltipByHandler=(e,i)=>{var n,r;return this.component.event.emit(St.tooltipShow,Object.assign(Object.assign({},i),{tooltipData:e,activeType:this.activeType,tooltip:this.component})),!((n=this.component.tooltipHandler)===null||n===void 0)&&n.showTooltip&&E(e)?(r=this.component.tooltipHandler.showTooltip(this.activeType,e,i))!==null&&r!==void 0?r:di.success:di.failed},this.component=t}_preprocessDimensionInfo(t){const e=[];if(t==null||t.forEach(i=>{const n=Object.assign(Object.assign({},i),{data:i.data.filter(({series:r})=>{var a,o;return((o=(a=r.getSpec())===null||a===void 0?void 0:a.tooltip)===null||o===void 0?void 0:o.visible)!==!1})});n.data.length>0&&e.push(n)}),e.length>0)return e}_getDimensionInfo(t){var e,i;let n;const r=this.component.getChart(),a=r.getCompiler().getStage().getLayer(void 0),o={x:t.event.viewX,y:t.event.viewY};if(a.globalTransMatrix.transformPoint({x:t.event.viewX,y:t.event.viewY},o),n=[...(e=AB(r,o))!==null&&e!==void 0?e:[],...(i=yB(r,o))!==null&&i!==void 0?i:[]],n.length===0)n=void 0;else if(n.length>1){const l=n.filter(h=>{var d;const u=h.axis;if(!ji(u.getScale().type))return!1;let c;for(const p of(d=u==null?void 0:u.getRegions())!==null&&d!==void 0?d:[]){for(const g of p.getSeries())if(g.coordinate==="cartesian"){c=g;break}if(E(c))break}return E(c)&&c.getDimensionField()[0]===c.fieldY[0]?u.getOrient()==="left"||u.getOrient()==="right":u.getOrient()==="bottom"||u.getOrient()==="top"});n=l.length?l:n.slice(0,1)}return n}}class Art extends T2{constructor(){super(...arguments),this.activeType="dimension"}showTooltip(t,e,i){const n=Object.assign(Object.assign({},e),{dimensionInfo:this._preprocessDimensionInfo(t),changePositionOnly:i});return this._showTooltipByHandler(t,n)}shouldHandleTooltip(t,e){var i,n;const{tooltipInfo:r}=e;if(P(r))return!1;const a=(i=t.model)===null||i===void 0?void 0:i.tooltipHelper;return!!((n=a==null?void 0:a.activeType)!==null&&n!==void 0?n:this.component.getSpec().activeType).includes("dimension")}getMouseEventData(t){var e;return{tooltipInfo:this._getDimensionInfo(t),ignore:[...(e=this.component.getOption().getAllSeries())!==null&&e!==void 0?e:[]].some(i=>{var n;const r=(n=i.tooltipHelper)===null||n===void 0?void 0:n.ignoreTriggerSet.dimension;return t.model&&(r==null?void 0:r.has(t.model))||t.mark&&(r==null?void 0:r.has(t.mark))})}}}const jP=s=>E(s)&&!$(s),Q0=s=>E(s)&&$(s);class krt extends T2{constructor(){super(...arguments),this.activeType="mark"}showTooltip(t,e,i){const{datum:n,series:r,dimensionInfo:a}=t,o=[{datum:[n],series:r}],l=Object.assign(Object.assign({},e),{dimensionInfo:this._preprocessDimensionInfo(a),changePositionOnly:i});return this._showTooltipByHandler(o,l)}shouldHandleTooltip(t,e){var i;const{tooltipInfo:n}=e;if(P(n))return!1;const r=(i=t.model)===null||i===void 0?void 0:i.tooltipHelper;return!!(r!=null&&r.activeType.includes("mark"))}getMouseEventData(t){var e;let i,n;if(((e=t.model)===null||e===void 0?void 0:e.modelType)==="series"){const r=t.model,a=r.tooltipHelper,o=a==null?void 0:a.activeTriggerSet.mark,l=a==null?void 0:a.ignoreTriggerSet.mark;o!=null&&o.has(t.model)||o!=null&&o.has(t.mark)?i={mark:t.mark,datum:t.datum,series:r,dimensionInfo:this._getDimensionInfo(t)}:(l!=null&&l.has(t.model)||l!=null&&l.has(t.mark))&&(n=!0)}return{tooltipInfo:i,ignore:n}}}class M2 extends Wc{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){const{spec:i,theme:n}=super._initTheme(t,e);return i.style=yt({},this._theme,i.style),{spec:i,theme:n}}}class mu extends bs{constructor(){super(...arguments),this.layoutZIndex=1,this.type=Z.tooltip,this.name=Z.tooltip,this.transformerConstructor=M2,this.specKey="tooltip",this.layoutType="none",this._alwaysShow=!1,this._eventList=[],this._isTooltipShown=!1,this._mountEvent=(t,e,i)=>{this.event.on(t,e,i),this._eventList.push({eventType:t,handler:i})},this._getMouseOutHandler=t=>e=>{var i,n;if(this._alwaysShow||!this._isTooltipShown&&!(!((n=(i=this.tooltipHandler)===null||i===void 0?void 0:i.isTooltipShown)===null||n===void 0)&&n.call(i)))return;const r=rn(this._option.mode),{clientX:a,clientY:o}=e.event;r&&this._isPointerOnTooltip(e)||r&&t&&this._isPointerInChart({x:a,y:o})||this._handleChartMouseOut(e)},this._handleChartMouseOut=t=>{this._alwaysShow||this._spec.triggerOff!=="none"&&(this._hideTooltipByHandler(Object.assign({},t)),this._cacheInfo=void 0)},this._handleMouseMove=t=>{if(this.tooltipHandler||this._initHandler(),this._processor||this._initProcessor(),this._alwaysShow||this._isPointerOnTooltip(t))return;const e=this._getMouseEventData(t),{tooltipInfo:{dimension:i},ignore:{mark:n,dimension:r}}=e;let a=!1,o=!1;a=this._showTooltipByMouseEvent("mark",e,t),a||(o=this._showTooltipByMouseEvent("dimension",e,t)),a||o||WJ(t)||(n&&jP(this._cacheInfo)?a=this._showTooltipByMouseEvent("mark",e,t,!0):r&&Q0(this._cacheInfo)?o=this._showTooltipByMouseEvent("dimension",e,t,!0):E(i)&&(o=this._showTooltipByMouseEvent("dimension",e,t))),a||o&&!P(i)||this._handleChartMouseOut(t)},this._showTooltipByMouseEvent=(t,e,i,n)=>{const r=this._processor[t];if(!r.shouldHandleTooltip(i,{tooltipInfo:e.tooltipInfo[t],ignore:e.ignore[t]}))return!1;let a;if(n)a=!r.showTooltip(this._cacheInfo,i,!0);else{const l=e.tooltipInfo[t],h=this._isSameAsCacheInfo(l);a=!r.showTooltip(l,i,h),a&&(this._cacheInfo=l)}a&&(this._isTooltipShown=!0);const o=this._option.globalInstance;return a&&an.globalConfig.uniqueTooltip&&an.hideTooltip(o.id),a},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this._processor).forEach(i=>{const{tooltipInfo:n,ignore:r}=this._processor[i].getMouseEventData(t);e.tooltipInfo[i]=n,e.ignore[i]=r}),e},this._hideTooltipByHandler=t=>{var e,i,n;if(!this._isTooltipShown&&!(!((i=(e=this.tooltipHandler)===null||e===void 0?void 0:e.isTooltipShown)===null||i===void 0)&&i.call(e)))return di.success;if(this.event.emit(St.tooltipHide,Object.assign(Object.assign({},t),{source:te.chart,tooltip:this})),(n=this.tooltipHandler)===null||n===void 0?void 0:n.hideTooltip){const r=this.tooltipHandler.hideTooltip(t);return r||(this._isTooltipShown=!1),r}return di.failed}}static getSpecInfo(t){const e=t[this.specKey];if(!e)return null;if(!$(e))return[{spec:e,specPath:[this.specKey],type:Z.tooltip}];const i=[];return e.forEach((n,r)=>{i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.tooltip})}),i}isTooltipShown(){return this._isTooltipShown}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}_registerEvent(){}_releaseEvent(){}onLayout(t){}onLayoutEnd(t){}onRender(t){}created(){super.created(),this._regions=this._option.getAllRegions(),this._initEvent()}release(){var t,e;super.release(),this._eventList.forEach(({eventType:i,handler:n})=>{this.event.off(i,n)}),this._eventList=[],(e=(t=this.tooltipHandler)===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(St.tooltipHide,{tooltip:this}),this.event.emit(St.tooltipRelease,{tooltip:this})}_initHandler(){var t,e,i;const n=(t=this._spec.renderMode)!==null&&t!==void 0?t:"html",r=this._option.globalInstance.getTooltipHandlerByUser();if(r)this.tooltipHandler=r;else{const a=n==="canvas"?xrt:brt,o=`${this._spec.className}-${(e=this._option.globalInstance.id)!==null&&e!==void 0?e:0}-${(i=this._option.specIndex)!==null&&i!==void 0?i:0}`;this.tooltipHandler=new a(o,this)}}_initProcessor(){this._processor={mark:new krt(this),dimension:new Art(this)}}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=(t=this._spec.trigger)!==null&&t!==void 0?t:"hover",i=this._option.mode;e==="hover"?(this._mountEvent("pointermove",{level:Xt.chart},this._handleMouseMove),(Ga(i)||Wa(i))&&(this._mountEvent("pointerdown",{level:Xt.chart},this._handleMouseMove),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))),this._mountEvent("pointerout",{source:"canvas"},this._getMouseOutHandler(!1))):e==="click"&&(this._mountEvent("pointertap",{level:Xt.chart},this._handleMouseMove),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0)))}reInit(t){var e,i;super.reInit(t),this.tooltipHandler?(i=(e=this.tooltipHandler).reInit)===null||i===void 0||i.call(e):this._initHandler()}setAttrFromSpec(){var t;super.setAttrFromSpec();const e=this._spec;this._spec=Object.assign(Object.assign({},e),{visible:!E(e.visible)||e.visible,activeType:xa(e),renderMode:"html",trigger:E(e.trigger)?e.trigger:"hover",className:E(e.className)?e.className:Xnt,enterable:!!E(e.enterable)&&e.enterable,transitionDuration:E(e.transitionDuration)?e.transitionDuration:150}),this._spec.triggerOff=E(e.triggerOff)?e.triggerOff:this._spec.trigger,E(e.renderMode)?this._spec.renderMode=e.renderMode:Wa(this._option.mode)&&(this._spec.renderMode="canvas"),E(e.mark)&&(this._spec.mark=Object.assign(Object.assign({},bi(e.mark)),{activeType:"mark"})),E(e.dimension)&&(this._spec.dimension=Object.assign(Object.assign({},bi(e.dimension)),{activeType:"dimension"})),E(e.parentElement)?ht(e.parentElement)?this._spec.parentElement=(t=globalThis==null?void 0:globalThis.document)===null||t===void 0?void 0:t.getElementById(e.parentElement):this._spec.parentElement=e.parentElement:rn(this._option.mode)&&(this._spec.parentElement=ga==null?void 0:ga.body),E(e.confine)?this._spec.confine=e.confine:this._spec.confine=this._spec.renderMode==="canvas"}showTooltip(t,e){var i;if(this.tooltipHandler||this._initHandler(),this._processor||this._initProcessor(),!(!((i=this.tooltipHandler)===null||i===void 0)&&i.showTooltip))return!1;const n=Srt(t,e,this.tooltipHandler,this._option);return n!=="none"&&(this._alwaysShow=!!(e!=null&&e.alwaysShow)),n}hideTooltip(){const t={changePositionOnly:!1,item:void 0,datum:void 0,source:te.chart};return this._alwaysShow=!1,!this._hideTooltipByHandler(t)}_isSameAsCacheInfo(t){if(t===this._cacheInfo)return!0;if(P(this._cacheInfo)||P(t))return!1;if(Q0(t)){if(jP(this._cacheInfo))return!1;const i=this._cacheInfo;return i.length===t.length&&t.every((n,r)=>vB(n,i[r]))}if(Q0(this._cacheInfo))return!1;const e=this._cacheInfo;return(t==null?void 0:t.datum)===e.datum&&(t==null?void 0:t.mark)===e.mark&&(t==null?void 0:t.series)===e.series}_isPointerInChart(t){const e=this._option.globalInstance;if(!e.getChart())return!1;const{x:i,y:n}=t,r=e.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return i>=a&&i<=a+l&&n>=o&&n<=o+h}_isPointerOnTooltip(t){var e,i;if(this._spec.enterable&&this._spec.renderMode==="html"){const{event:n}=t;let r;if(E(n.nativeEvent)){const o=n.nativeEvent;r=o.relatedTarget,o.composedPath&&o.composedPath().length>0&&(r=o.composedPath()[0])}else r=n.relatedTarget;const a=(i=(e=this.tooltipHandler)===null||e===void 0?void 0:e.getTooltipContainer)===null||i===void 0?void 0:i.call(e);if(E(a)&&E(r)&&Hj(r,a))return!0}return!1}getVisible(){return this._spec.visible!==!1}}mu.type=Z.tooltip,mu.transformerConstructor=M2,mu.specKey="tooltip";const wrt=()=>{F.registerComponent(mu.type,mu)};function Trt(s){return s===ri["desktop-browser"]||s===ri["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:Ga(s)||Wa(s)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}var zP;(function(s){s[s.ALL=3]="ALL",s[s.HORIZONTAL=2]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL",s[s.NONE=0]="NONE"})(zP||(zP={}));var HP=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};const Mrt={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]};class OA extends bs{get enableRemain(){return this.triggerOff==="none"}constructor(t,e){super(t,e),this.specKey="crosshair",this.layoutType="none",this.gridZIndex=ce.CrossHair_Grid,this.labelZIndex=ce.CrossHair,this.trigger="hover",this.triggerOff="hover",this._handleEvent=Ka(i=>{if(!this._option)return;const{event:n}=i,r=this._option.getCompiler().getStage().getLayer(void 0),a={x:n.viewX,y:n.viewY};r.globalTransMatrix.transformPoint({x:n.viewX,y:n.viewY},a);const o=a.x-this.getLayoutStartPoint().x,l=a.y-this.getLayoutStartPoint().y;this.showDefault=!1,this._layoutCrosshair(o,l)},10),this.enable=!0,this.showDefault=!0}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:n}=(e=(t=this._option.globalInstance.getChart())===null||t===void 0?void 0:t.getCanvasRect())!==null&&e!==void 0?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:n}}return this._limitBounds}_showDefaultCrosshair(){this.showDefault&&this._showDefaultCrosshairBySpec()}setAttrFromSpec(){super.setAttrFromSpec(),this._parseCrosshairSpec()}created(){super.created(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Se(e,t)||(i.reRender=!0,i.reMake=!0),i}_initEvent(){if(this._option.disableTriggerEvent)return;const t=this._getTriggerEvent();if(t){const{in:e,out:i}=t;Y(e).forEach((n,r)=>this._registerEvent(n,$(i)?i[r]:i))}}_registerEvent(t,e){this.event.on(t,{source:te.chart},this._handleEvent),this.event.on(e,{level:Xt.chart},(...i)=>{this.enableRemain||this.hide()})}_eventOff(t){this.event.off(t,this._handleEvent)}updateLayoutAttribute(){this._limitBounds=null,this._showDefaultCrosshair()}_getTriggerEvent(){const{mode:t=ri["desktop-browser"]}=this._option,e=Trt(t);if(e){const i=this.trigger||"hover",n=r=>r==="click"?"clickOut":"hoverOut";if($(i)){let r=[],a=[];return i.forEach(o=>{r=r.concat(e[o]),a=a.concat(e[n(o)])}),{in:r,out:a}}return{in:e[i],out:e[n(i)]}}return null}_getAxisInfoByField(t){var e,i;const n=(i=(e=this._option)===null||e===void 0?void 0:e.getComponentsByKey)===null||i===void 0?void 0:i.call(e,"axes");if(!(n!=null&&n.length))return null;let r=It(this._spec,`${t}Field.bindingAxesIndex`);if(r||(r=[],n.forEach((p,g)=>{Mrt[t].includes(p.getOrient())&&r.push(g)})),!r.length)return null;const a=new Map;let o=1/0,l=1/0,h=-1/0,d=-1/0;const{x:u,y:c}=this.getLayoutStartPoint();return r.forEach(p=>{o=1/0,l=1/0,h=-1/0,d=-1/0;const g=n.find(f=>f.getSpecIndex()===p);g&&(g.getRegions().forEach(f=>{const{x:_,y:m}=f.getLayoutStartPoint();o=Math.min(o,_-u),l=Math.min(l,m-c),h=Math.max(h,_+f.getLayoutRect().width-u),d=Math.max(d,m+f.getLayoutRect().height-c)}),a.set(p,{x1:o,y1:l,x2:h,y2:d,axis:g}))}),a}changeRegions(t){}onLayoutEnd(t){const e=this._regions[0];this.setLayoutRect(e.getLayoutRect()),this.setLayoutStartPosition(e.getLayoutStartPoint()),super.onLayoutEnd(t)}onRender(t){}_releaseEvent(){const t=this._getTriggerEvent();if(t){const{in:e,out:i}=t;$(e)?e.forEach(n=>this._eventOff(n)):this._eventOff(e),$(i)?i.forEach(n=>this._eventOff(n)):this._eventOff(i)}}_firstSeries(){for(let t=0;t<this._regions.length;t++){const e=this._regions[t].getSeries();for(let i=0;i<e.length;i++){const n=e[i];if(n)return n}}return null}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:n}=this._spec;t&&(this.trigger=t),this.triggerOff=e||this.trigger,i!==void 0&&(this.labelZIndex=i),n!==void 0&&(this.gridZIndex=n)}_parseField(t,e){var i,n,r,a;const o={},{line:l={},label:h={},visible:d}=t;o.visible=d,o.type=l.type||"line";const u=l.style||{},{strokeOpacity:c,fillOpacity:p,opacity:g,stroke:f,fill:_,lineWidth:m}=u,v=HP(u,["strokeOpacity","fillOpacity","opacity","stroke","fill","lineWidth"]),y=o.type==="line";let b=y?c:p;if(dt(g)&&(b=(b??1)*g),o.style=(l==null?void 0:l.visible)===!1?{visible:!1}:Object.assign({opacity:b,pickable:!1,visible:!0},v),y)o.style.stroke=f||_,o.style.lineWidth=It(l,"width",m||2);else{o.style.fill=_||f,!((r=(n=(i=this._spec[e])===null||i===void 0?void 0:i.line)===null||n===void 0?void 0:n.style)===null||r===void 0)&&r.stroke&&(o.style.stroke=this._spec[e].line.style.stroke);const C=It(l,"width");if(typeof C=="string"){const R=parseInt(C.substring(0,C.length-1),10)/100;o.style.sizePercent=R}else typeof C!="number"&&typeof C!="function"||(o.style.size=C)}const x=h.labelBackground||{},S=h.style||{},A=x.style||{},{fill:k="rgba(47, 59, 82, 0.9)",stroke:w,outerBorder:T}=A,M=HP(A,["fill","stroke","outerBorder"]);return o.label=h!=null&&h.visible?{visible:!0,formatMethod:h.formatMethod,minWidth:x.minWidth,maxWidth:x.maxWidth,padding:x.padding,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},S),{fill:(a=S.fill)!==null&&a!==void 0?a:"#fff",stroke:It(S,"stroke")}),panel:(ye(x==null?void 0:x.visible)?x!=null&&x.visible:x)?Object.assign({visible:!0,pickable:!1,fill:k,stroke:w,outerBorder:Object.assign({stroke:k,distance:0,lineWidth:3},T)},M):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}:{visible:!1},o}_filterAxisByPoint(t,e,i){return t&&t.forEach(n=>{const r=n.axis;if(t4(n,e,i)&&t.delete(r.getSpecIndex()),r.type.startsWith("polarAxis")){const a=r.getCenter(),o=r.getInnerRadius(),l=r.getOuterRadius(),h=ze.distancePP({x:e,y:i},a);(h>l||h<o)&&t.delete(r.getSpecIndex())}}),t}}OA.specKey="crosshair";class D_ extends OA{static getSpecInfo(t){const e=t[this.specKey];if(P(e))return;if(!$(e))return e.xField||e.yField?[{spec:e,specPath:[this.specKey],type:Z.cartesianCrosshair}]:void 0;const i=[];return e.forEach((n,r)=>{(n.xField||n.yField)&&i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.cartesianCrosshair})}),i}constructor(t,e){super(t,e),this.type=Z.cartesianCrosshair,this.name=Z.cartesianCrosshair,this._currValueX=new Map,this._currValueY=new Map}_showDefaultCrosshairBySpec(){const{xField:t,yField:e}=this._spec;if(t!=null&&t.visible&&t.defaultSelect){const{axisIndex:i,datum:n}=t.defaultSelect;this._defaultCrosshair(i,n,1)}if(e!=null&&e.visible&&e.defaultSelect){const{axisIndex:i,datum:n}=e.defaultSelect;this._defaultCrosshair(i,n,2)}}_defaultCrosshair(t,e,i){const n=this._option.getComponentsByKey("axes").find(r=>r.getSpecIndex()===t);n&&(i===1?(this._currValueX.clear(),this._currValueX.set(t,{axis:n,v:e})):(this._currValueY.clear(),this._currValueY.set(t,{axis:n,v:e})),this.layoutByValue(i))}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("x"),n=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(n,t,e)}}_getValueAt(t,e){let i=t.getScale().invert(e);return qt(t.getScale().type)&&N(+i)&&(i=(+i).toFixed(2)),i}clearAxisValue(){this._currValueX.clear(),this._currValueY.clear()}setAxisValue(t,e){Fe(e.getOrient())?this._currValueX.set(e.getSpecIndex(),{v:t,axis:e}):this._currValueY.set(e.getSpecIndex(),{v:t,axis:e})}_getAllAxisValues(t,e,i,n){let r=!1;return t.forEach(a=>{ji(a.axis.getScale().type)&&(r?this.enable=!1:r=!0)}),!!this.enable&&(t.forEach((a,o)=>{const l=a.axis;i.set(o,{v:this._getValueAt(l,e-(n?l.getLayoutStartPoint().x-this.getLayoutStartPoint().x:l.getLayoutStartPoint().y-this.getLayoutStartPoint().y)),axis:l})}),!0)}_layoutCrosshair(t,e){const{xAxisMap:i,yAxisMap:n}=this._findAllAxisContains(t,e);if(i&&i.size===0||n&&n.size===0){if(this.enableRemain)return;this.hide()}else this._currValueX.clear(),this._currValueY.clear(),i&&i.size&&this._getAllAxisValues(i,t,this._currValueX,!0),n&&n.size&&this._getAllAxisValues(n,e,this._currValueY,!1),this.layoutByValue(3)}hide(){this._xCrosshair&&this._xCrosshair.hideAll(),this._xTopLabel&&this._xTopLabel.hideAll(),this._xBottomLabel&&this._xBottomLabel.hideAll(),this._yCrosshair&&this._yCrosshair.hideAll(),this._yLeftLabel&&this._yLeftLabel.hideAll(),this._yRightLabel&&this._yRightLabel.hideAll()}layoutByValue(t=3){var e,i,n,r;if(!this.enable)return;const a=this._firstSeries();if(!a)return;let o={height:0,leftPos:0,rightPos:0,topPos:0,x:0,bottom:{visible:!1,text:"",dx:0,dy:0},top:{visible:!1,text:"",dx:0,dy:0},visible:!1,axis:null},l={width:0,leftPos:0,topPos:0,bottomPos:0,y:0,left:{visible:!1,text:"",dx:0,dy:0},right:{visible:!1,text:"",dx:0,dy:0},visible:!1,axis:null};const h=(v,y)=>{y.forEach(({axis:b})=>{b.getRegions().forEach(x=>{v.x1=Math.min(v.x1,x.getLayoutStartPoint().x),v.y1=Math.min(v.y1,x.getLayoutStartPoint().y),v.x2=Math.max(v.x2,x.getLayoutStartPoint().x+x.getLayoutRect().width),v.y2=Math.max(v.y2,x.getLayoutStartPoint().y+x.getLayoutRect().height)})})};let d=0,u=0;if(this._currValueX.size){const v=Array.from(this._currValueX.values())[0];d=v.axis.getScale().scale(v.v)+v.axis.getLayoutStartPoint().x-this.getLayoutStartPoint().x,o.axis=v.axis}if(this._currValueY.size){const v=Array.from(this._currValueY.values())[0];u=v.axis.getScale().scale(v.v)+v.axis.getLayoutStartPoint().y-this.getLayoutStartPoint().y,l.axis=v.axis}o.visible=!!this._currValueX.size&&Number.isFinite(d),l.visible=!!this._currValueY.size&&Number.isFinite(u);const c={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0},p={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};let g;h(c,this._currValueX),h(p,this._currValueY);let f,_=0,m=0;if(this._xHair&&this._currValueX.forEach(({axis:v,v:y})=>{var b;y=y??"";const x=v.getScale();if(ji(x.type))g=x.bandwidth(),g===0&&x.step&&(_=x.step());else if(qt(x.type)){const S=a.fieldX[0],A=a.fieldX2,k=GC(a.getViewData().latestData,+y,S,A);if(k){const w=a.dataToPositionX(k);A?(g=Math.abs(w-a.dataToPositionX1(k)),y=`${k[S]} ~ ${k[A]}`):g=1,d=w}}if(!((b=this._xHair.label)===null||b===void 0)&&b.visible){const S=sc(v.getSpec());v.getOrient()==="bottom"?(o.bottom.visible=!0,o.bottom.text=y,o.bottom.dx=0,o.bottom.dy=S):v.getOrient()==="top"&&(o.top.visible=!0,o.top.text=y,o.top.dx=0,o.top.dy=-S)}}),this._yHair&&this._currValueY.forEach(({axis:v,v:y})=>{var b;y=y??"";const x=v.getScale();if(ji(x.type))f=x.bandwidth(),f===0&&x.step&&(m=x.step());else if(qt(x.type)){const S=a.fieldY[0],A=a.fieldY2,k=GC(a.getViewData().latestData,+y,S,A);if(k){const w=a.dataToPositionY(k);A?(f=Math.abs(w-a.dataToPositionY1(k)),y=`${k[S]} ~ ${k[A]}`):f=1,u=w}}if(!((b=this._yHair.label)===null||b===void 0)&&b.visible){const S=sc(v.getSpec());v.getOrient()==="left"?(l.left.visible=!0,l.left.text=y,l.left.dx=-S,l.left.dy=0):v.getOrient()==="right"&&(l.right.visible=!0,l.right.text=y,l.right.dx=S,l.right.dy=0)}}),this.enableRemain&&!o.visible&&E(this._cacheXCrossHairInfo))o=this._cacheXCrossHairInfo;else if(o.leftPos=c.x1,o.rightPos=c.x2,o.topPos=c.y1,o.height=c.y2-c.y1,o.x=d+this.getLayoutStartPoint().x,(i=(e=this._xHair)===null||e===void 0?void 0:e.label)===null||i===void 0?void 0:i.formatMethod){const{top:v,bottom:y}=o;y.visible&&(y.text=this._xHair.label.formatMethod(y.text,"bottom")),v.visible&&(v.text=this._xHair.label.formatMethod(v.text,"top"))}if(this.enableRemain&&!l.visible&&E(this._cacheYCrossHairInfo))l=this._cacheYCrossHairInfo;else if(l.leftPos=p.x1,l.topPos=p.y1,l.bottomPos=p.y2,l.width=p.x2-p.x1,l.y=u+this.getLayoutStartPoint().y,(r=(n=this._yHair)===null||n===void 0?void 0:n.label)===null||r===void 0?void 0:r.formatMethod){const{left:v,right:y}=l;v.visible&&(v.text=this._yHair.label.formatMethod(v.text,"left")),y.visible&&(y.text=this._yHair.label.formatMethod(y.text,"right"))}t&&(this._layoutHorizontal(l,f??0,m),this._layoutVertical(o,g??0,_)),this.enableRemain&&(this._cacheXCrossHairInfo=Object.assign(Object.assign({},o),{_isCache:!0}),this._cacheYCrossHairInfo=Object.assign(Object.assign({},l),{_isCache:!0}))}_layoutVertical(t,e,i){var n,r;if(t._isCache&&this.enableRemain||!this._xHair)return;const{x:a,topPos:o,height:l,top:h,bottom:d,visible:u}=t;if(u){const c=this._xHair.type;let p;if(c==="line")p={start:{x:a+e/2,y:o},end:{x:a+e/2,y:o+l}};else if(c==="rect"){const g=this._getRectSize(this._xHair,e,t.axis),{leftPos:f,rightPos:_}=t;p={start:{x:Math.max(a-g/2-i/2,f),y:o},end:{x:Math.min(a+e+g/2+i/2,_),y:o+l}}}if(this._updateCrosshair("x",c,p),h.visible){const g=Object.assign(Object.assign(Object.assign({x:a+e/2,y:o},h),this._xHair.label),{textStyle:Object.assign(Object.assign({},(n=this._xHair.label)===null||n===void 0?void 0:n.textStyle),{textAlign:"center",textBaseline:"bottom"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._xTopLabel,g,f=>{f.name="crosshair-x-top-label",this._xTopLabel=f})}else this._xTopLabel&&this._xTopLabel.hideAll();if(d.visible){const g=Object.assign(Object.assign(Object.assign({x:a+e/2,y:o+l},d),this._xHair.label),{textStyle:Object.assign(Object.assign({},(r=this._xHair.label)===null||r===void 0?void 0:r.textStyle),{textAlign:"center",textBaseline:"top"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._xBottomLabel,g,f=>{f.name="crosshair-x-bottom-label",this._xBottomLabel=f})}else this._xBottomLabel&&this._xBottomLabel.hideAll()}}_layoutHorizontal(t,e,i){var n,r;if(t._isCache&&this.enableRemain||!this._yHair)return;const{leftPos:a,width:o,y:l,left:h,right:d,visible:u}=t;if(u){const c=this._yHair.type;let p;if(c==="line")p={start:{x:a,y:l+e/2},end:{x:a+o,y:l+e/2}};else if(c==="rect"){const g=this._getRectSize(this._yHair,e,t.axis),{topPos:f,bottomPos:_}=t;p={start:{x:a,y:Math.max(l-g/2-i/2,f)},end:{x:a+o,y:Math.min(l+e+g/2+i/2,_)}}}if(this._updateCrosshair("y",c,p),h.visible){const g=Object.assign(Object.assign(Object.assign({x:a,y:l+e/2},h),this._yHair.label),{textStyle:Object.assign(Object.assign({},(n=this._yHair.label)===null||n===void 0?void 0:n.textStyle),{textAlign:"right",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yLeftLabel,g,f=>{f.name="crosshair-y-left-label",this._yLeftLabel=f})}else this._yLeftLabel&&this._yLeftLabel.hideAll();if(d.visible){const g=Object.assign(Object.assign(Object.assign({x:a+o,y:l+e},d),this._yHair.label),{textStyle:Object.assign(Object.assign({},(r=this._yHair.label)===null||r===void 0?void 0:r.textStyle),{textAlign:"left",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yRightLabel,g,f=>{f.name="crosshair-y-right-label",this._yRightLabel=f})}else this._yRightLabel&&this._yRightLabel.hideAll()}}_getRectSize(t,e,i){var n,r,a;let o=0;if(!((n=t.style)===null||n===void 0)&&n.sizePercent)o=(t.style.sizePercent-1)*e;else if(typeof((r=t.style)===null||r===void 0?void 0:r.size)=="number")o=t.style.size-e;else if(typeof((a=t.style)===null||a===void 0?void 0:a.size)=="function"){const l=i.getLayoutRect();o=t.style.size(l,i)-e}return o}_parseFieldInfo(){const{xField:t,yField:e}=this._spec;t&&t.visible&&(this._xHair=this._parseField(t,"xField")),e&&e.visible&&(this._yHair=this._parseField(e,"yField"))}_updateCrosshair(t,e,i){const n=this.getContainer();let r,a;t==="x"?(r=this._xCrosshair,a=this._xHair.style):(r=this._yCrosshair,a=this._yHair.style),r?r.setAttributes(i):(e==="line"?r=new Bc(Object.assign(Object.assign({},i),{lineStyle:a,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent})):e==="rect"&&(r=new Em(Object.assign(Object.assign({},i),{rectStyle:a,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent}))),n==null||n.add(r),t==="x"?this._xCrosshair=r:this._yCrosshair=r)}_updateCrosshairLabel(t,e,i){const n=this.getContainer();t?t.setAttributes(e):(i(t=new Fn(e)),n==null||n.add(t)),oD(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._xCrosshair,this._xTopLabel,this._xBottomLabel,this._yCrosshair,this._yLeftLabel,this._yRightLabel]}}D_.specKey="crosshair",D_.type=Z.cartesianCrosshair;const Crt=()=>{F.registerComponent(D_.type,D_)};var NP=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};class F_ extends OA{static getSpecInfo(t){const e=t[this.specKey];if(P(e))return;if(!$(e))return e.categoryField||e.valueField?[{spec:e,specPath:[this.specKey],type:Z.polarCrosshair}]:void 0;const i=[];return e.forEach((n,r)=>{(n.categoryField||n.valueField)&&i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.polarCrosshair})}),i}constructor(t,e){super(t,e),this.type=Z.polarCrosshair,this.name=Z.polarCrosshair,this._currValueAngle=new Map,this._currValueRadius=new Map}_showDefaultCrosshairBySpec(){const{categoryField:t,valueField:e}=this._spec;if(t!=null&&t.visible&&t.defaultSelect){const{axisIndex:i,datum:n}=t.defaultSelect;this._defaultCrosshair(i,n,1)}if(e!=null&&e.visible&&e.defaultSelect){const{axisIndex:i,datum:n}=e.defaultSelect;this._defaultCrosshair(i,n,2)}}_defaultCrosshair(t,e,i){const n=this._option.getComponentsByKey("axes").find(r=>r.getSpecIndex()===t);if(n){if(i===1){this._currValueAngle.clear();const r={angle:n.valueToPosition(e),radius:n.getOuterRadius()},a=n.coordToPoint(r);this._currValueAngle.set(t,this._getValueByAxis(n,a))}else{this._currValueRadius.clear();const r={angle:n.startAngle,radius:n.valueToPosition(e)},a=n.coordToPoint(r);this._currValueRadius.set(t,this._getValueByAxis(n,a))}this.layoutByValue(3)}}hide(){this._radiusCrosshair&&this._radiusCrosshair.hideAll(),this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll(),this._angleCrosshair&&this._angleCrosshair.hideAll(),this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("category"),n=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(n,t,e)}}_getAllAxisValues(t,e,i){let n=!1;return t.forEach(r=>{ji(r.axis.getScale().type)&&(n?this.enable=!1:n=!0)}),!!this.enable&&(t.forEach((r,a)=>{const o=r.axis;i.set(a,this._getValueByAxis(o,e))}),!0)}_getValueByAxis(t,e){const{x:i,y:n}=t.getLayoutStartPoint(),{x:r,y:a}=this.getLayoutStartPoint();let o=t.positionToData({x:e.x-(i-r),y:e.y-(n-a)});qt(t.getScale().type)&&N(+o)&&(o=(+o).toFixed(2));const l={x:t.getCenter().x+this.getLayoutStartPoint().x,y:t.getCenter().y+this.getLayoutStartPoint().y};return{v:o,axis:t,center:l,innerRadius:t.getInnerRadius(),radius:t.getOuterRadius(),startAngle:t.startAngle,endAngle:t.endAngle,distance:ze.distancePP(e,t.getCenter()),coord:t.pointToCoord(e),point:e}}_layoutCrosshair(t,e){const{angleAxisMap:i,radiusAxisMap:n}=this._findAllAxisContains(t,e);if(i.size!==0||n.size!==0)this._currValueAngle.clear(),this._currValueRadius.clear(),i&&this._getAllAxisValues(i,{x:t,y:e},this._currValueAngle),n&&this._getAllAxisValues(n,{x:t,y:e},this._currValueRadius),this.layoutByValue(3);else{if(this.enableRemain)return;this.hide()}}layoutByValue(t=3){var e,i,n,r;if(!this.enable)return;const a=this._firstSeries();if(!a)return;let o={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,label:{visible:!1,text:"",offset:0}},l={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,sides:a.angleAxisHelper.getScale(0).ticks().length,label:{visible:!1,text:"",offset:0}};if(this._angleHair){o.visible=!!this._currValueAngle.size;const h=a.angleAxisHelper.getBandwidth(0);this._currValueAngle.forEach(d=>{var u,{axis:c,v:p,coord:g}=d,f=NP(d,["axis","v","coord"]);p=p??"",yt(o,f);const _=a.angleAxisHelper.dataToPosition([p]);o.angle=_,!((u=this._angleHair.label)===null||u===void 0)&&u.visible&&(o.label.visible=!0,o.label.text=p,o.label.offset=sc(c.getSpec())),o.startAngle=_-h/2,o.endAngle=_+h/2})}if(this._radiusHair&&(l.visible=!!this._currValueRadius.size,this._currValueRadius.forEach(h=>{var d,{axis:u,v:c,coord:p}=h,g=NP(h,["axis","v","coord"]);c=c??"",!((d=this._radiusHair.label)===null||d===void 0)&&d.visible&&(l.label.visible=!0,l.label.text=c,l.label.offset=sc(u.getSpec())),l.angle=p.angle,l.axis=u,yt(l,g)})),this.enableRemain&&!o.visible&&E(this._cacheAngleCrossHairInfo))o=this._cacheAngleCrossHairInfo;else if(!((i=(e=this._angleHair)===null||e===void 0?void 0:e.label)===null||i===void 0)&&i.formatMethod&&o.label.visible){const{label:h}=o;h.text=this._angleHair.label.formatMethod(h.text,"angle")}if(this.enableRemain&&!l.visible&&E(this._cacheRadiusCrossHairInfo))l=this._cacheRadiusCrossHairInfo;else if(!((r=(n=this._radiusHair)===null||n===void 0?void 0:n.label)===null||r===void 0)&&r.formatMethod&&l.label.visible){const{label:h}=l;h.text=this._radiusHair.label.formatMethod(h.text,"radius")}t&&(this._layoutHorizontal(l),this._layoutVertical(o)),this.enableRemain&&(this._cacheAngleCrossHairInfo=Object.assign(Object.assign({},o),{_isCache:!0}),this._cacheRadiusCrossHairInfo=Object.assign(Object.assign({},l),{_isCache:!0}))}_layoutVertical(t){var e;if(t._isCache&&this.enableRemain)return;const i=this.getContainer(),{angle:n,innerRadius:r,radius:a,label:o,startAngle:l,endAngle:h,center:d,visible:u}=t;if(u){const c=this._angleHair.type==="rect"?"sector":"line";let p;if(p=c==="sector"?{center:d,innerRadius:r,radius:a,startAngle:l,endAngle:h}:{start:xn(d,r,n),end:xn(d,a,n)},this._angleCrosshair)this._angleCrosshair.setAttributes(p);else{let g;c==="line"?g=new Bc(Object.assign(Object.assign({},p),{lineStyle:this._angleHair.style,zIndex:this.gridZIndex})):c==="sector"&&(g=new Om(Object.assign(Object.assign({},p),{sectorStyle:this._angleHair.style,zIndex:this.gridZIndex}))),this._angleCrosshair=g,i.add(g)}if(o.visible){const g=$O(n),f=Object.assign(Object.assign(Object.assign(Object.assign({},xn(d,a+o.offset,n)),this._angleHair.label),o),{textStyle:Object.assign(Object.assign({},(e=this._angleHair.label)===null||e===void 0?void 0:e.textStyle),{textAlign:g.align,textBaseline:g.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._angleLabelCrosshair,f,_=>{_.name="crosshair-angle-label",this._angleLabelCrosshair=_})}else this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}}_layoutHorizontal(t){var e;if(t._isCache&&this.enableRemain)return;const{center:i,startAngle:n,endAngle:r,distance:a,sides:o,axis:l,label:h,point:d,radius:u,innerRadius:c,visible:p}=t,g=this.getContainer();if(p){const f=this._radiusHair.smooth?"circle":"polygon";let _=a;if(f==="polygon"){const v=l.getCenter(),y=kg(v,d),b=(r-n)/o,x=Math.floor((y-n)/b),S=x*b+n,A=Math.min((x+1)*b+n,r),k=xn(v,a,S),w=xn(v,a,A),T=bE([w.x,w.y],[k.x,k.y],[v.x,v.y],[d.x,d.y]);T&&(_=xi(ze.distancePN(d,T[0],T[1])+a,c,u))}const m={center:i,startAngle:n,endAngle:r,radius:_,sides:o};if(this._radiusCrosshair)this._radiusCrosshair.setAttributes(m);else{let v;v=f==="polygon"?new Im(Object.assign(Object.assign({},m),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex+1})):new Rm(Object.assign(Object.assign({},m),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex})),this._radiusCrosshair=v,g.add(v)}if(h.visible){const v=n4(n),y=Object.assign(Object.assign(Object.assign(Object.assign({},xn(i,_,n)),this._radiusHair.label),h),{textStyle:Object.assign(Object.assign({},(e=this._radiusHair.label)===null||e===void 0?void 0:e.textStyle),{textAlign:v.align,textBaseline:v.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._radiusLabelCrosshair,y,b=>{b.name="crosshair-radius-label",this._radiusLabelCrosshair=b})}else this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll()}}_parseFieldInfo(){var t;const{categoryField:e,valueField:i}=this._spec;e&&e.visible&&(this._angleHair=this._parseField(e,"categoryField")),i&&i.visible&&(this._radiusHair=this._parseField(i,"valueField"),this._radiusHair.smooth=(t=i==null?void 0:i.line)===null||t===void 0?void 0:t.smooth)}_updateCrosshairLabel(t,e,i){const n=this.getContainer();t?t.setAttributes(e):(t=new Fn(e),n==null||n.add(t),i(t)),oD(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._radiusCrosshair,this._radiusLabelCrosshair,this._angleCrosshair,this._angleLabelCrosshair]}}F_.specKey="crosshair",F_.type=Z.polarCrosshair;const Prt=()=>{F.registerComponent(F_.type,F_)};class IA extends bs{get orient(){return this._orient}setStartAndEnd(t,e,i=["percent","percent"]){const[n="percent",r="percent"]=i,a=n==="percent"?t:this._dataToStatePoint(t),o=r==="percent"?e:this._dataToStatePoint(e);this._handleChange(a,o,!0)}enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this._handleChartZoom({zoomDelta:1.2,zoomX:t==null?void 0:t.x,zoomY:t==null?void 0:t.y})}zoomOut(t){this._handleChartZoom({zoomDelta:.8,zoomX:t==null?void 0:t.x,zoomY:t==null?void 0:t.y})}_handleChange(t,e,i){var n,r;(r=(n=this._spec)===null||n===void 0?void 0:n.zoomLock)!==null&&r!==void 0&&r||e-t<this._minSpan||this._maxSpan}_isReverse(){const t=this._relatedAxisComponent;if(!t)return!1;const e=t.getScale();return e.range()[0]>e.range()[1]&&(!t.getInverse()||this._isHorizontal)}_updateRangeFactor(t,e){const i=this._relatedAxisComponent.getScale(),n=this._isReverse(),r=n?[1-this._end,1-this._start]:[this._start,this._end];if(n)switch(t){case"startHandler":i.rangeFactorEnd(r[1]);break;case"endHandler":i.rangeFactorStart(r[0]);break;default:i.rangeFactorStart(r[0],!0),i.rangeFactorEnd(r[1])}else switch(t){case"startHandler":i.rangeFactorStart(r[0]);break;case"endHandler":i.rangeFactorEnd(r[1]);break;default:i.rangeFactorEnd(r[1],!0),i.rangeFactorStart(r[0])}const a=i.rangeFactor();a?(this._start=n?1-a[1]:a[0],this._end=n?1-a[0]:a[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._stateField="x",this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.effect={onZoomChange:i=>{var n,r;const a=this._relatedAxisComponent;if(a&&this._filterMode==="axis"){const o=a.getScale(),l=a.getSpec();this._auto&&this._getAxisBandSize(l)&&this._spec.ignoreBandSize&&(o.bandwidth("auto"),o.maxBandwidth("auto"),o.minBandwidth("auto")),this._updateRangeFactor(i,"zoomChange"),(r=(n=this._component)===null||n===void 0?void 0:n.setStartAndEnd)===null||r===void 0||r.call(n,this._start,this._end),a.effect.scaleUpdate()}else Ie(this._regions,o=>{var l;(l=o.getViewData())===null||l===void 0||l.markRunning()},{userId:this._seriesUserId,specIndex:this._seriesIndex}),Ie(this._regions,o=>{o.reFilterViewData()},{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._handleStateChange=(i,n,r)=>{var a,o;return this._startValue=i,this._endValue=n,this._newDomain=this._parseDomainFromState(this._startValue,this._endValue),(o=(a=this.effect).onZoomChange)===null||o===void 0||o.call(a,r),!0},this._handleChartZoom=i=>{var n,r;if(!this._activeRoam)return;const{zoomDelta:a,zoomX:o,zoomY:l}=i,{x:h,y:d}=this._regions[0].getLayoutStartPoint(),{width:u,height:c}=this._regions[0].getLayoutRect(),p=Math.abs(this._start-this._end),g=(r=(n=this._spec.roamZoom)===null||n===void 0?void 0:n.rate)!==null&&r!==void 0?r:1;if(p>=1&&a<1||p<=.01&&a>1)return;const f=this._isHorizontal?o:l,_=p*(a-1)*g;let m=_/2,v=_/2;if(f){const x=this._isHorizontal?h:d,S=this._isHorizontal?u:c;m=Math.abs(x-f)/Math.abs(S-x)*_,v=Math.abs(S-f)/Math.abs(S-x)*_}const y=xi(this._start+m,0,1),b=xi(this._end-v,0,1);this._handleChange(Math.min(y,b),Math.max(y,b),!0)},this._handleChartScroll=(i,n)=>{var r;if(!this._activeRoam)return!1;const{scrollX:a,scrollY:o}=i;let l=this._isHorizontal?a:o;const h=this._isHorizontal?Kt(a/o)>=.5:Kt(o/a)>=.5;return this._scrollAttr.reverse||(l=-l),h&&this._handleChartMove(l,(r=this._scrollAttr.rate)!==null&&r!==void 0?r:1),h},this._handleChartDrag=(i,n)=>{var r;if(!this._activeRoam)return;const[a,o]=i;let l=this._isHorizontal?a:o;this._dragAttr.reverse&&(l=-l),this._handleChartMove(l,(r=this._dragAttr.rate)!==null&&r!==void 0?r:1)},this._handleChartMove=(i,n)=>{const r=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(i)>=1e-6){if(i>0&&this._end<1){const a=Math.min(1-this._end,i/r)*n;this._handleChange(this._start+a,this._end+a,!0)}else if(i<0&&this._start>0){const a=Math.max(-this._start,i/r)*n;this._handleChange(this._start+a,this._end+a,!0)}}},this._orient=oa(t),this._isHorizontal=bB(this._orient)==="horizontal"}created(){super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}_setAxisFromSpec(){if(E(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):E(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),P(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find(i=>i._orient===this._orient);if(e)this._relatedAxisComponent=e;else{const i=t.find(n=>!qt(n.getScale().type));this._relatedAxisComponent=i}}this._relatedAxisComponent&&this._filterMode==="axis"&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?(e=(t=this._relatedAxisComponent).getBindSeriesFilter)===null||e===void 0?void 0:e.call(t):null;if(E(i)&&(E(i.userId)&&(this._seriesUserId=Y(i.userId)),E(i.specIndex)&&(this._seriesIndex=Y(i.specIndex))),E(this._spec.seriesId)){const n=Y(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter(r=>n.includes(r)):this._seriesUserId=n}if(E(this._spec.seriesIndex)){const n=Y(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter(r=>n.includes(r)):this._seriesIndex=n}if(E(this._spec.regionIndex)){const n=this._option.getRegionsInIndex(Y(this._spec.regionIndex));this._regions=this._regions.filter(r=>n.includes(r))}else if(E(this._spec.regionId)){const n=Y(this._spec.regionId);this._regions=n.length?this._regions.filter(r=>n.includes(r.id)):[]}}onDataUpdate(){const t=this._computeDomainOfStateScale(qt(this._stateScale.type));this._stateScale.domain(t,!0),this._handleChange(this._start,this._end,!0)}_computeDomainOfStateScale(t){const e=this._data.getLatestData().map(i=>i[this._stateField]);if(t){const i=e.map(n=>1*n);return e.length?[ki(i),ei(i)]:[-1/0,1/0]}return e}_initEvent(){this._initCommonEvent()}_initData(){const t=[],e=[],i=[];if(this._relatedAxisComponent){const a={};Ie(this._regions,o=>{var l,h;const d=o.coordinate==="cartesian"?o.getXAxisHelper():o.coordinate==="polar"?o.angleAxisHelper:null,u=o.coordinate==="cartesian"?o.getYAxisHelper():o.coordinate==="polar"?o.radiusAxisHelper:null;if(!d||!u)return;const c=d.getAxisId()===this._relatedAxisComponent.id?d:u.getAxisId()===this._relatedAxisComponent.id?u:this._isHorizontal?d:u,p=c===d?u:d,g=qt(p.getScale(0).type);t.push(o.getRawData());const f=o.getSpec(),_=Y(f.xField),m=Y(f.yField),v=o.coordinate==="cartesian"?_[0]:(l=f.angleField)!==null&&l!==void 0?l:f.categoryField,y=o.coordinate==="cartesian"?m[0]:(h=f.radiusField)!==null&&h!==void 0?h:f.valueField;if(a[o.id]=o.type==="link"?"from_xField":c===d?v:y,e.push(a[o.id]),this._valueField){const b=o.type==="link"?"from_yField":p===d?v:y;i.push(g?b:null)}},{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=a}else P(this._spec.valueField),Ie(this._regions,a=>{t.push(a.getRawData()),e.push(this._field),this._valueField&&i.push(this._spec.valueField)},{userId:this._seriesUserId,specIndex:this._seriesIndex});const{dataSet:n}=this._option;Lr(n,"dataview",rm),Ct(n,"dataFilterComputeDomain",VQ);const r=new Jt(n,{name:`${this.type}_${this.id}_data`});r.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,stateFields:e,valueFields:i},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new Ur(this._option,r),r.reRunAllTransform(),n.multipleDataViewAddListener(t,"change",this._handleDataCollectionChange.bind(this))}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._spec.roamZoom===!0||this._spec.roamZoom?this._zoomAttr=lt({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,this._spec.roamDrag===!0||this._spec.roamDrag?this._dragAttr=lt({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,this._spec.roamScroll===!0||this._spec.roamScroll?this._scrollAttr=lt({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=(t=this._spec.visible)===null||t===void 0||t}_statePointToData(t){const e=this._stateScale;let i=e.range();this._isReverse()&&(i=i.slice().reverse());const n=i[0]+(i[1]-i[0])*t;return e.invert(n)}_dataToStatePoint(t){const e=this._stateScale,i=e.scale(t);let n=e.range();return!this._isHorizontal&&qt(e.type)&&(n=n.slice().reverse()),(i-n[0])/(n[1]-n[0])}_modeCheck(t,e){return t==="start"?e==="percent"&&this._spec.start||e==="value"&&this._spec.startValue:e==="percent"&&this._spec.end||e==="value"&&this._spec.endValue}_setStateFromSpec(){var t,e;let i,n;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[r,a]=this._spec.rangeMode;this._modeCheck("start",r)&&this._modeCheck("end",a)&&(i=r==="percent"?this._spec.start:this._dataToStatePoint(this._spec.startValue),n=a==="percent"?this._spec.end:this._dataToStatePoint(this._spec.endValue))}else i=this._spec.start?this._spec.start:this._spec.startValue?this._dataToStatePoint(this._spec.startValue):0,n=this._spec.end?this._spec.end:this._spec.endValue?this._dataToStatePoint(this._spec.endValue):1;this._startValue=this._statePointToData(i),this._endValue=this._statePointToData(n),this._start=i,this._end=n,this._minSpan=(t=this._spec.minSpan)!==null&&t!==void 0?t:0,this._maxSpan=(e=this._spec.maxSpan)!==null&&e!==void 0?e:1,qt(this._stateScale.type)&&this._stateScale.domain[0]!==this._stateScale.domain[1]&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(this._stateScale.domain()[1]-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(this._stateScale.domain()[1]-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),this._relatedAxisComponent&&this._filterMode==="axis"||this._start===0&&this._end===1||(this._newDomain=this._parseDomainFromState(this._startValue,this._endValue))}_parseFieldOfSeries(t){var e;return(e=this._originalStateFields)===null||e===void 0?void 0:e[t.id]}_initStateScale(){const t=[0,1];if(this._relatedAxisComponent){const e=this._relatedAxisComponent.getScale(),i=qt(e.type),n=this._computeDomainOfStateScale(i);if(this._stateScale=e.clone(),i){const r=n.map(a=>1*a);this._stateScale.domain(n.length?[ki(r),ei(r)]:[0,1],!0).range(t)}else this._stateScale.domain(n,!0).range(t)}else this._stateScale=new Wo,this._stateScale.domain(this._computeDomainOfStateScale(),!0).range(t)}init(t){super.init(t),this._addTransformToSeries(),this._start===0&&this._end===1||this.effect.onZoomChange()}_addTransformToSeries(){this._relatedAxisComponent&&this._filterMode==="axis"||(Ct(this._option.dataSet,"dataFilterWithNewDomain",WQ),Ie(this._regions,t=>{t.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var e;return(e=this._field)!==null&&e!==void 0?e:this._parseFieldOfSeries(t)},isContinuous:()=>qt(this._stateScale.type)},level:Hs.dataZoomFilter})},{userId:this._seriesUserId,specIndex:this._seriesIndex}))}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Se(e,t)||(i.reRender=!0,i.reMake=!0),i}reInit(t){super.reInit(t),this._marks.forEach(e=>{e.getMarks().forEach(i=>{this.initMarkStyleWithSpec(i,this._spec[i.name])})})}changeRegions(){}update(t){}resize(t){}_parseDomainFromState(t,e){if(qt(this._stateScale.type))return[Math.min(e,t),Math.max(e,t)];const i=this._stateScale.domain(),n=i.indexOf(t),r=i.indexOf(e);return i.slice(Math.min(n,r),Math.max(n,r)+1)}_initCommonEvent(){var t,e,i,n,r,a,o;const l={delayType:(e=(t=this._spec)===null||t===void 0?void 0:t.delayType)!==null&&e!==void 0?e:"throttle",delayTime:E((i=this._spec)===null||i===void 0?void 0:i.delayType)?(r=(n=this._spec)===null||n===void 0?void 0:n.delayTime)!==null&&r!==void 0?r:30:0,realTime:(o=(a=this._spec)===null||a===void 0?void 0:a.realTime)===null||o===void 0||o};this._zoomAttr.enable&&this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom,l),this._scrollAttr.enable&&this.initScrollEventOfRegions(this._regions,null,this._handleChartScroll,l),this._dragAttr.enable&&this.initDragEventOfRegions(this._regions,null,this._handleChartDrag,l)}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),super.updateLayoutAttribute()}onLayoutStart(t,e,i){super.onLayoutStart(t,e,i);const n=this._autoUpdate(t),r=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[r]:n?this[`_${r}`]:0},{[r]:tt.Built_In})}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}hide(){var t;(t=this._component)===null||t===void 0||t.hideAll()}show(){var t;(t=this._component)===null||t===void 0||t.showAll()}_getAxisBandSize(t){const e=t==null?void 0:t.bandSize,i=t==null?void 0:t.maxBandSize,n=t==null?void 0:t.minBandSize;if(e||n||i)return{bandSize:e,maxBandSize:i,minBandSize:n}}_autoUpdate(t){var e,i,n,r,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=l==null?void 0:l.getSpec(),d=l==null?void 0:l.getScale(),u=this._getAxisBandSize(h);if(ji(d.type)&&(t==null?void 0:t.height)===((e=this._cacheRect)===null||e===void 0?void 0:e.height)&&(t==null?void 0:t.width)===((i=this._cacheRect)===null||i===void 0?void 0:i.width)&&this._fixedBandSize===(u==null?void 0:u.bandSize))return this._cacheVisibility;let c=!0;if(this._isHorizontal&&(t==null?void 0:t.width)!==((n=this._cacheRect)===null||n===void 0?void 0:n.width)?d.range(l.getInverse()?[t.width,0]:[0,t.width]):(t==null?void 0:t.height)!==((r=this._cacheRect)===null||r===void 0?void 0:r.height)&&d.range(l.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:t==null?void 0:t.width,height:t==null?void 0:t.height},this._fixedBandSize=u==null?void 0:u.bandSize,ji(d.type)){u&&(this._start||this._end)&&this._updateRangeFactor(null,"auto");const[p,g]=(a=d.rangeFactor())!==null&&a!==void 0?a:[];c=(!P(p)||!P(g))&&!(p===0&&g===1)}else{const[p,g]=(o=d.rangeFactor())!==null&&o!==void 0?o:[this._start,this._end];c=!(p===0&&g===1)}return this.setStartAndEnd(this._start,this._end),c?this.show():this.hide(),this._cacheVisibility=c,c}_getNeedClearVRenderComponents(){return[this._component]}}Ai(IA,mA);class C2 extends Wc{_mergeThemeToSpec(t,e){const i=this._theme;let n=t;if(this._shouldMergeThemeToSpec()){const r=o=>{const l=yt({selectedBackgroundChart:{line:{},area:{}}},this._theme,o),{selectedBackgroundChart:h={}}=o,{line:d,area:u}=h;return d&&d.visible!==!1&&(l.selectedBackgroundChart.line.style=Object.assign(Object.assign({},l.selectedBackgroundChart.line.style),{visible:!0})),u&&u.visible!==!1&&(l.selectedBackgroundChart.area.style=Object.assign(Object.assign({},l.selectedBackgroundChart.area.style),{visible:!0})),l},a=t;n=$(a)?a.map(o=>r(o)):r(a)}return this._adjustPadding(n),{spec:n,theme:i}}}class vu extends IA{static getSpecInfo(t){const e=t[this.specKey];if(P(e))return;if(!$(e))return[{spec:e,specPath:[this.specKey],type:Z.dataZoom}];const i=[];return e.forEach((n,r)=>{i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.dataZoom})}),i}constructor(t,e){var i;super(t,e),this.type=Z.dataZoom,this.name=Z.dataZoom,this.transformerConstructor=C2,this.specKey="dataZoom",this.layoutZIndex=ce.DataZoom,this.layoutLevel=Ln.DataZoom,this.layoutType="region-relative",this._dataToPositionX=n=>{const r=this._orient==="left"?this._middleHandlerSize:0,a=this._isHorizontal?this._startHandlerSize/2:0,o=this._isHorizontal?this._stateScale:this._valueScale,l=this._isHorizontal?this._stateField:this._valueField;return o.scale(n[l])+this.getLayoutStartPoint().x+r+a},this._dataToPositionX2=n=>{const r=this._orient==="left"?this._middleHandlerSize:0,a=this._isHorizontal?this._startHandlerSize/2:0,o=this._isHorizontal?this._stateScale:this._valueScale,l=o.domain()[0];return o.scale(l)+this.getLayoutStartPoint().x+r+a},this._dataToPositionY=n=>{const r=this._isHorizontal?this._middleHandlerSize:0,a=this._isHorizontal?0:this._startHandlerSize/2,o=this._isHorizontal?this._valueScale:this._stateScale,l=this._isHorizontal?this._valueField:this._stateField;return o.scale(n[l])+this.getLayoutStartPoint().y+r+a},this._dataToPositionY2=n=>{const r=this._isHorizontal?this._middleHandlerSize:0,a=this._isHorizontal?0:this._startHandlerSize/2,o=this._isHorizontal?this._valueScale:this._stateScale,l=o.domain()[0];return o.scale(l)+this.getLayoutStartPoint().y+r+a},this._valueField="y",this._filterMode=(i=t.filterMode)!==null&&i!==void 0?i:"filter"}created(){super.created(),this._initValueScale()}setAttrFromSpec(){var t,e,i,n,r,a,o,l,h,d;super.setAttrFromSpec(),ye(this._spec.roam)&&(this._zoomAttr.enable=this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode),this._backgroundSize=(e=(t=this._spec.background)===null||t===void 0?void 0:t.size)!==null&&e!==void 0?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),this._width=this._computeWidth(),this._height=this._computeHeight(),P((r=(n=(i=this._spec)===null||i===void 0?void 0:i.startHandler)===null||n===void 0?void 0:n.style)===null||r===void 0?void 0:r.size)&&(this._spec.startHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize),P((l=(o=(a=this._spec)===null||a===void 0?void 0:a.endHandler)===null||o===void 0?void 0:o.style)===null||l===void 0?void 0:l.size)&&(this._spec.endHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize);const u=(h=this._spec.startHandler.style.visible)===null||h===void 0||h,c=(d=this._spec.endHandler.style.visible)===null||d===void 0||d;this._startHandlerSize=u?this._spec.startHandler.style.size:0,this._endHandlerSize=c?this._spec.endHandler.style.size:0}onLayoutEnd(t){this._updateScaleRange(),this._cacheVisibility!==!1&&super.onLayoutEnd(t)}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new un;e.domain(t),this._valueScale=e}}_updateScaleRange(){var t,e;const i=(this._startHandlerSize+this._endHandlerSize)/2;if(!this._stateScale||!this._valueScale)return;let n;const r=this._isHorizontal?this.getLayoutRect().width-i:this.getLayoutRect().height-i,a=(e=(t=this._relatedAxisComponent)===null||t===void 0?void 0:t.getScale().range())!==null&&e!==void 0?e:[0,r];this._isHorizontal?(n=this._visible?[0,this._computeWidth()-i]:a,this._stateScale.range(n),this._valueScale.range([this._computeHeight()-this._middleHandlerSize,0])):this.layoutOrient==="left"?(n=this._visible?[0,this._computeHeight()-i]:a,this._stateScale.range(n),this._valueScale.range([this._computeWidth()-this._middleHandlerSize,0])):(n=this._visible?[0,this._computeHeight()-i]:a,this._stateScale.range(n),this._valueScale.range([0,this._computeWidth()-this._middleHandlerSize])),this._component&&this._cacheVisibility!==!1&&this._component.setAttributes({size:{width:this._computeWidth(),height:this._computeHeight()},position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y}})}_computeDomainOfValueScale(){const t=this._data.getLatestData().map(i=>i[this._valueField]),e=t.map(i=>1*i);return t.length?[ki(e),ei(e)]:null}_computeMiddleHandlerSize(){var t,e,i,n;let r=0;if(!((e=(t=this._spec)===null||t===void 0?void 0:t.middleHandler)===null||e===void 0)&&e.visible){const a=(i=this._spec.middleHandler.icon.style.size)!==null&&i!==void 0?i:8,o=(n=this._spec.middleHandler.background.size)!==null&&n!==void 0?n:40;r+=Math.max(a,o)}return r}_computeWidth(){return this._visible===!1?0:dt(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:this._backgroundSize+this._middleHandlerSize}_computeHeight(){return this._visible===!1?0:dt(this._spec.height)?this._spec.height:this._isHorizontal?this._backgroundSize+this._middleHandlerSize:this.getLayoutRect().height-(this._startHandlerSize+this._endHandlerSize)/2}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return(!qt(t.type)||e[0]!==e[1])&&(!ji(t.type)||cj(e).length!==1)}_getAttrs(t){var e,i,n,r,a;const o=(e=this._spec)!==null&&e!==void 0?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this.getLayoutRect().width,height:this.getLayoutRect().height},showDetail:o.showDetail,brushSelect:(i=o.brushSelect)!==null&&i!==void 0&&i,zoomLock:(n=o.zoomLock)!==null&&n!==void 0&&n,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:o.delayType,delayTime:E(o.delayType)?(r=o.delayTime)!==null&&r!==void 0?r:30:0,realTime:(a=o.realTime)===null||a===void 0||a,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY},this._getComponentAttrs())}_createOrUpdateComponent(){if(this._visible){const t=this._isHorizontal?this._stateScale:this._valueScale,e=this._isHorizontal?this._valueScale:this._stateScale,i=this._isScaleValid(t)&&this._isScaleValid(e),n=this._getAttrs(i);if(this._component)this._component.setAttributes(n);else{const r=this.getContainer();this._component=new RI(n),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData(a=>this._statePointToData(a)),this._component.addEventListener("change",a=>{const{start:o,end:l,tag:h}=a.detail;this._handleChange(o,l,void 0,h)}),r.add(this._component),this._updateScaleRange()}}}_handleChange(t,e,i,n){super._handleChange(t,e,i),i&&this._component&&this._component.setStartAndEnd(t,e),this._start=t,this._end=e,this._handleStateChange(this._statePointToData(t),this._statePointToData(e),n)&&this.event.emit(St.dataZoomChange,{model:this,value:{filterData:this._filterMode!=="axis",start:t,end:e,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}_handleDataCollectionChange(){var t;const e=this._data.getDataView();if(e.reRunAllTransform(),(t=this._component)===null||t===void 0||t.setPreviewData(e.latestData),this._valueScale){const i=this._computeDomainOfValueScale();i&&this._valueScale.domain(i)}}_getComponentAttrs(){var t,e,i,n,r,a,o,l,h,d,u;const{middleHandler:c={},startText:p={},endText:g={},backgroundChart:f={},selectedBackgroundChart:_={}}=this._spec;return{backgroundStyle:wt((t=this._spec.background)===null||t===void 0?void 0:t.style),startHandlerStyle:wt((e=this._spec.startHandler)===null||e===void 0?void 0:e.style),middleHandlerStyle:c.visible?{visible:!0,icon:wt((i=c.icon)===null||i===void 0?void 0:i.style),background:{size:(n=c.background)===null||n===void 0?void 0:n.size,style:wt((r=c.background)===null||r===void 0?void 0:r.style)}}:{visible:!1},endHandlerStyle:wt((a=this._spec.endHandler)===null||a===void 0?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:p.formatMethod,textStyle:wt(p.style)},endTextStyle:{padding:g.padding,formatMethod:g.formatMethod,textStyle:wt(g.style)},selectedBackgroundStyle:wt(this._spec.selectedBackground.style),dragMaskStyle:wt((o=this._spec.dragMask)===null||o===void 0?void 0:o.style),backgroundChartStyle:{line:yt(wt((l=f.line)===null||l===void 0?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},wt((h=f.area)===null||h===void 0?void 0:h.style))},selectedBackgroundChartStyle:{line:yt(wt((d=_.line)===null||d===void 0?void 0:d.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},wt((u=_.area)===null||u===void 0?void 0:u.style))},disableTriggerEvent:this._option.disableTriggerEvent}}_getNeedClearVRenderComponents(){return[this._component]}}vu.type=Z.dataZoom,vu.transformerConstructor=C2,vu.specKey="dataZoom";const Ert=()=>{F.registerComponent(vu.type,vu)};class j_ extends IA{static getSpecInfo(t){const e=t[this.specKey];if(P(e))return;if(!$(e))return[{spec:e,specPath:[this.specKey],type:Z.scrollBar}];const i=[];return e.forEach((n,r)=>{i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.scrollBar})}),i}constructor(t,e){var i;super(t,e),this.type=Z.scrollBar,this.name=Z.scrollBar,this.specKey="scrollBar",this.layoutZIndex=ce.DataZoom,this.layoutLevel=Ln.DataZoom,this.layoutType="region-relative",this._filterMode=(i=t.filterMode)!==null&&i!==void 0?i:"axis"}setAttrFromSpec(){super.setAttrFromSpec(),ye(this._spec.roam)&&(this._zoomAttr.enable=!1,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode)}onLayoutEnd(t){var e,i;this._updateScaleRange(),(i=(e=this.effect).onZoomChange)===null||i===void 0||i.call(e),super.onLayoutEnd(t)}_updateScaleRange(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return dt(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:Mx}_computeHeight(){return dt(this._spec.height)?this._spec.height:this._isHorizontal?Mx:this.getLayoutRect().height}_getAttrs(){var t,e,i,n,r,a;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:(t=this._spec)===null||t===void 0?void 0:t.delayType,delayTime:E((e=this._spec)===null||e===void 0?void 0:e.delayType)?(n=(i=this._spec)===null||i===void 0?void 0:i.delayTime)!==null&&n!==void 0?n:30:0,realTime:(a=(r=this._spec)===null||r===void 0?void 0:r.realTime)===null||a===void 0||a},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new uI(t),this._component.addEventListener("scroll",i=>{const n=i.detail.value;this._handleChange(n[0],n[1])}),e.add(this._component)}}_handleChange(t,e,i){super._handleChange(t,e,i),i&&this._component&&this._component.setAttribute("range",[t,e]),this._start=t,this._end=e,this._handleStateChange(this._statePointToData(t),this._statePointToData(e))&&this.event.emit(St.scrollBarChange,{model:this,value:{filterData:this._filterMode!=="axis",start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}_handleDataCollectionChange(){}_initCommonEvent(){super._initCommonEvent(),this._component&&this._component.on("scroll",t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,n={};return P(i)||(n.padding=i),vt(t==null?void 0:t.style)||(n.railStyle=wt(t.style)),vt(e==null?void 0:e.style)||(n.sliderStyle=wt(e.style)),n.disableTriggerEvent=this._option.disableTriggerEvent,n}_getNeedClearVRenderComponents(){return[this._component]}}j_.type=Z.scrollBar,j_.specKey="scrollBar";const Rrt=()=>{F.registerComponent(j_.type,j_)},Ort=(s,t)=>{const{datum:e,title:i,content:n}=t,r=[],a=e.call(null);return i.visible&&r.push({type:"title",index:0,datum:a,spec:i}),Y(n).forEach((o,l)=>{o.visible&&r.push({type:"content",index:l,datum:a,spec:o})}),r};class Vh extends bs{constructor(){super(...arguments),this.type=Z.indicator,this.name=Z.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=ce.Indicator,this.layoutLevel=Ln.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){if(this.type!==Vh.type)return null;const e=t[this.specKey];if(!$(e))return e.visible===!1?[]:[{spec:e,specPath:[this.specKey],type:Z.indicator}];const i=[];return e.forEach((n,r)=>{n&&n.visible!==!1&&i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.indicator})}),i}created(){super.created(),this.initData(),this.initEvent()}setAttrFromSpec(){super.setAttrFromSpec(),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=Y(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex))}onRender(t){}changeRegions(t){}initEvent(){this._option.disableTriggerEvent||this._spec.trigger!=="none"&&(this._spec.trigger==="hover"?(this.event.on("hovered",t=>{t.model&&!this.isRelativeModel(t.model)||this.updateDatum(t.value[0])}),this.event.on("unhovered",t=>{t.model&&!this.isRelativeModel(t.model)||this.updateDatum(null)})):(this.event.on("selected",t=>{t.model&&!this.isRelativeModel(t.model)||this.updateDatum(t.value[0])}),this.event.on("unselected",t=>{t.model&&!this.isRelativeModel(t.model)||this.updateDatum(null)})))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){Ct(this._option.dataSet,"indicatorFilter",Ort);const t=new Jt(this._option.dataSet,{name:`${this.type}_${this.id}_data`});t.transform({type:"indicatorFilter",options:{title:this._title,content:this._content,datum:()=>this._activeDatum}}),t.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new Ur(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect(),{x:n,y:r}=t.getLayoutStartPoint(),a=[];return Y(this._spec.content).forEach(o=>{const l=yt({},this._theme.content,o);a.push({visible:l.visible!==!1&&(!l.field||this._activeDatum!==null),space:l.space||this._gap,autoLimit:l.autoLimit,autoFit:l.autoFit,fitPercent:l.fitPercent,style:Object.assign(Object.assign({},wt(l.style)),{text:this._createText(l.field,l.style.text)})})}),{visible:this._spec.visible!==!1&&(this._spec.fixed!==!1||this._activeDatum!==null),size:{width:e,height:i},zIndex:this.layoutZIndex,x:n,y:r,dx:this._spec.offsetX?Pl(this._spec.offsetX,this._computeLayoutRadius()):0,dy:this._spec.offsetY?Pl(this._spec.offsetY,this._computeLayoutRadius()):0,limitRatio:this._spec.limitRatio||1/0,title:{visible:this._spec.title.visible!==!1&&(!E(this._spec.title.field)||this._activeDatum!==null),space:this._spec.title.space||this._gap,autoLimit:this._spec.title.autoLimit,autoFit:this._spec.title.autoFit,fitPercent:this._spec.title.fitPercent,style:Object.assign(Object.assign({},wt(this._spec.title.style)),{text:this._createText(this._spec.title.field,this._spec.title.style.text)})},content:a}}_createOrUpdateIndicatorComponent(t){if(this._indicatorComponent)Se(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new q6(t);i.name="indicator",e.add(i),this._indicatorComponent=i,this._indicatorComponent.on("*",(n,r)=>this._delegateEvent(this._indicatorComponent,n,r))}return this._cacheAttrs=t,this._indicatorComponent}_createText(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":K(e)?(i=e(this._activeDatum,void 0))!==null&&i!==void 0?i:"":e??""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return Ie(this._regions,e=>t===e)||this._regions.includes(t)}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}}Vh.type=Z.indicator,Vh.specKey="indicator";const Irt=()=>{F.registerComponent(Vh.type,Vh)},Lrt=(s,t)=>{const e=s[0].latestData;return qO(e,t.field)},Brt=(s,t)=>{const e=s[0].latestData;return RS(e,t.field)};function Drt(s,t){const e=s[0].latestData;return ZO(e,t.field)}function Frt(s,t){const e=s[0].latestData;return JO(e,t.field)}function jrt(s,t){const e=s[0].latestData;return QO(e,t.field)}function zrt(s,t){const e=s[0].latestData;return e4(e,t.field)}function Hrt(s,t){const e=s[0].latestData;return i4(e,t.field)}function LA(s,t){const e=[];return t.forEach(i=>{const n={x:null,y:null};if(E(i.x)){const r=i.x;$(r)?n.x=r.map(a=>eg(a,s,i)):n.x=eg(r,s,i)}if(E(i.y)){const r=i.y;$(r)?n.y=r.map(a=>eg(a,s,i)):n.y=eg(r,s,i)}i.getRefRelativeSeries&&(n.getRefRelativeSeries=i.getRefRelativeSeries),e.push(n)}),e}const Nrt={min:Lrt,max:Brt,sum:Drt,average:Frt,variance:jrt,standardDeviation:zrt,median:Hrt};function eg(s,t,e){const i=e.getRelativeSeries(),n=e.getStartRelativeSeries(),r=e.getEndRelativeSeries(),a=i.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(K(s))return s(a,o,l,i,n,r);if(Rn(s)){const{aggrType:h,field:d}=s;return Nrt[h](t,{field:d})}return s}const Grt=["sum","average","min","max","variance","standardDeviation","median"];var Wrt=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};function z_(s,t,e){if(!e)return!1;const i=s.map(a=>1*a),n=ki(i),r=ei(i);return t<n||t>r}function GP(s,t,e,i,n,r){var a,o;const{relativeSeries:l}=i;let h;return dt(s.x)&&z_(t,s.x,e)&&((o=l==null?void 0:(a=l.getXAxisHelper()).setExtendDomain)===null||o===void 0||o.call(a,"marker_xAxis_extend",s.x)),h=ws(s.x)?nh(s.x,n)+r.x:l.getXAxisHelper().dataToPosition([s.x])+r.x,h}function WP(s,t,e,i,n,r){var a,o;const{relativeSeries:l}=i;let h;return dt(s.y)&&z_(t,s.y,e)&&((o=(a=l.getYAxisHelper())===null||a===void 0?void 0:a.setExtendDomain)===null||o===void 0||o.call(a,"marker_yAxis_extend",s.y)),h=ws(s.y)?nh(s.y,n)+r.y:l.getYAxisHelper().dataToPosition([s.y])+r.y,h}function nh(s,t){return Number(s.substring(0,s.length-1))*t/100}function ty(s){return Grt.includes(s)}function H_(s,t,e,i,n){const r=t.getRegion(),a=r.getLayoutStartPoint(),o=e.getRegion(),l=o.getLayoutStartPoint(),h=Math.abs(Math.min(a.x,l.x)-Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width)),d=Math.abs(Math.min(a.y,l.y)-Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height)),u={relativeSeries:i},c=[],p=s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData,g=i.getXAxisHelper().getScale(0).domain(),f=i.getYAxisHelper().getScale(0).domain();return p.forEach(_=>{const m=E(_.x),v=E(_.y);if(m&&v){const y=GP(_,g,n,u,h,a),b=WP(_,f,n,u,d,a);c.push([{x:y,y:b}])}else if(E(_.x)){const y=GP(_,g,n,u,h,a),b=Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height),x=Math.min(a.y,l.y);c.push([{x:y,y:b},{x:y,y:x}])}else if(E(_.y)){const y=Math.min(a.x,l.x),b=WP(_,f,n,u,d,a),x=Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width);c.push([{x:y,y:b},{x,y:b}])}}),c}function BA(s,t,e,i){const n=[],r=s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData,a=$(i);return r.forEach((o,l)=>{var h,d,u,c;const p=o!=null&&o.getRefRelativeSeries?o.getRefRelativeSeries():t,g=p.getRegion(),f=g.getLayoutStartPoint(),{width:_,height:m}=g.getLayoutRect();let v=0,y=0;if(i){const k=a?i[l]:i,w=k.x,T=k.y;w&&(v=ws(w)?Number(w.substring(0,w.length-1))*_/100:w),T&&(y=ws(T)?Number(T.substring(0,T.length-1))*m/100:T)}const b=p.getXAxisHelper().getScale(0).domain(),x=p.getYAxisHelper().getScale(0).domain(),S=Y(o.x),A=Y(o.y);S.length===1&&dt(S[0])&&z_(b,S[0],e)&&((d=(h=p.getXAxisHelper())===null||h===void 0?void 0:h.setExtendDomain)===null||d===void 0||d.call(h,"marker_xAxis_extend",S[0])),A.length===1&&dt(A[0])&&z_(x,A[0],e)&&((c=(u=p.getYAxisHelper())===null||u===void 0?void 0:u.setExtendDomain)===null||c===void 0||c.call(u,"marker_yAxis_extend",A[0])),n.push({x:p.getXAxisHelper().dataToPosition(S)+f.x+v,y:p.getYAxisHelper().dataToPosition(A)+f.y+y})}),n}function DA(s,t,e){if(e){const r=t.getRegion(),{x:a,y:o}=r.getLayoutStartPoint(),{width:l,height:h}=r.getLayoutRect();return s.map(d=>{let{x:u,y:c}=d;return ws(u)&&(u=nh(u,l)),u+=a,ws(c)&&(c=nh(c,h)),c+=o,{x:u,y:c}})}const{width:i,height:n}=t.getOption().getChart().getCanvasRect();return s.map(r=>{let{x:a,y:o}=r;return ws(a)&&(a=nh(a,i)),ws(o)&&(o=nh(o,n)),{x:a,y:o}})}function FA(s){let t=1/0,e=-1/0,i=1/0,n=-1/0;return s.forEach(r=>{const a=r.getLayoutStartPoint(),o=r.getLayoutRect();a.x<t&&(t=a.x),a.x+o.width>e&&(e=a.x+o.width),a.y<i&&(i=a.y),a.y+o.height>n&&(n=a.y+o.height)}),{minX:t,maxX:e,minY:i,maxY:n}}function jA(s){const{labelBackground:t={},style:e,shape:i}=s,n=Wrt(s,["labelBackground","style","shape"]);if(s.visible!==!1){const r=n;return i!=null&&i.visible?r.shape=Object.assign({visible:!0},wt(i.style)):r.shape={visible:!1},t.visible!==!1?(r.panel=Object.assign({visible:!0},wt(t.style)),E(t.padding)&&(r.padding=_s(t.padding))):(r.panel={visible:!1},r.padding=0),e&&(r.textStyle=wt(e)),r}return{visible:!1}}class zA extends bs{constructor(){super(...arguments),this.layoutType="none",this._layoutOffsetX=0,this._layoutOffsetY=0}getRelativeSeries(){return this._relativeSeries}created(){super.created(),this.initEvent(),this._bindSeries(),this._initDataView()}_getAllRelativeSeries(){return{getRelativeSeries:()=>this._relativeSeries,getStartRelativeSeries:()=>this._startRelativeSeries,getEndRelativeSeries:()=>this._endRelativeSeries}}_getFieldInfoFromSpec(t,e,i){const n=t==="x"?i.getSpec().xField:i.getSpec().yField;return ht(e)&&ty(e)?{field:n,aggrType:e}:e}_processSpecX(t){const e=this._relativeSeries;return Object.assign({x:this._getFieldInfoFromSpec("x",t,e)},this._getAllRelativeSeries())}_processSpecY(t){const e=this._relativeSeries;return Object.assign({y:this._getFieldInfoFromSpec("y",t,e)},this._getAllRelativeSeries())}_processSpecXY(t,e){const i=this._relativeSeries;return Object.assign({x:this._getFieldInfoFromSpec("x",t,i),y:this._getFieldInfoFromSpec("y",e,i)},this._getAllRelativeSeries())}_processSpecCoo(t){var e;return((e=t.coordinates)!==null&&e!==void 0?e:Y(t.coordinate)).map(i=>{const n=this._getSeriesByIdOrIndex(i.refRelativeSeriesId,i.refRelativeSeriesIndex),{xField:r,yField:a}=n.getSpec(),{xFieldDim:o,xFieldIndex:l,yFieldDim:h,yFieldIndex:d}=i;let u=r;E(l)&&(u=Y(r)[l]),o&&Y(r).includes(o)&&(u=o);let c=a;E(d)&&(c=Y(a)[d]),h&&Y(a).includes(h)&&(c=h);const p=Object.assign({x:void 0,y:void 0},this._getAllRelativeSeries());return ht(i[u])&&ty(i[u])?p.x={field:u,aggrType:i[u]}:p.x=Y(u).map(g=>i[g]),ht(i[c])&&ty(i[c])?p.y={field:c,aggrType:i[c]}:p.y=Y(c).map(g=>i[g]),p.getRefRelativeSeries=()=>n,p})}updateLayoutAttribute(){var t,e,i;if((t=this._spec.visible)===null||t===void 0||t){if(!this._markerComponent){const n=this._createMarkerComponent();n.name=(e=this._spec.name)!==null&&e!==void 0?e:this.type,n.id=(i=this._spec.id)!==null&&i!==void 0?i:`${this.type}-${this.id}`,this._markerComponent=n,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",(r,a)=>this._delegateEvent(this._markerComponent,r,a))}this._markerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,n;let r;return r=(i=this._option.getSeriesInUserIdOrIndex(E(t)?[t]:[],[e]))===null||i===void 0?void 0:i[0],r||(r=(n=this._relativeSeries)!==null&&n!==void 0?n:this._getFirstSeries()),r}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex)}initEvent(){}onRender(t){}changeRegions(t){}clear(){super.clear(),this._firstSeries=null}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=OS(this._regions);return e?(this._firstSeries=e,e):((t=this._option)===null||t===void 0||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e,i){P(this._spec.offsetX)||(this._layoutOffsetX=Xi(this._spec.offsetX,e.width,e)),P(this._spec.offsetY)||(this._layoutOffsetY=Xi(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e,i)}}function Vrt(s,t){const e=s[0].latestData;return s4(e,t.fieldX,t.fieldY)}function Urt(s,t,e,i=0){const n=[],r=s.y-t.y,a=s.x-t.x;switch(e){case"top":n.push(s),n.push({x:s.x,y:r>0?s.y-i-Math.abs(r):s.y-i}),n.push({x:t.x,y:r>0?t.y-i:t.y-i-Math.abs(r)}),n.push(t);break;case"bottom":n.push(s),n.push({x:s.x,y:r<0?s.y+i+Math.abs(r):s.y+i}),n.push({x:t.x,y:r<0?t.y+i:t.y+i+Math.abs(r)}),n.push(t);break;case"left":n.push(s),n.push({x:a>0?s.x-i-Math.abs(a):s.x-i,y:s.y}),n.push({x:a>0?t.x-i:t.x-i-Math.abs(a),y:t.y}),n.push(t);break;case"right":n.push(s),n.push({x:a>0?s.x+i:s.x+i+Math.abs(a),y:s.y}),n.push({x:a>0?t.x+i+Math.abs(a):t.x+i,y:t.y}),n.push(t)}return n}function $rt(s,t,e,i=0){const n=s.y-t.y,r=s.x-t.x;return e==="bottom"?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?i:Math.abs(n)+i}:e==="top"?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+i):-i}:e==="left"?{dx:r>0?-r-i:-i,dy:n>0?-n/2:Math.abs(n/2)}:e==="right"?{dx:r>0?i:Math.abs(r)+i,dy:n>0?-n/2:Math.abs(n/2)}:{}}function HA(s,t){if(t&&t.getRelativeSeries){const e=t.getRelativeSeries();if(e){const i=e.getViewData();return i&&i.latestData&&i.latestData.length?s:[]}}return s}class N_ extends zA{constructor(){super(...arguments),this.type=Z.markLine,this.name=Z.markLine,this.specKey="markLine",this.layoutZIndex=ce.MarkLine}static getSpecInfo(t){const e=t[this.specKey];if(vt(e))return;if(!$(e)&&e.visible!==!1)return[{spec:e,specPath:[this.specKey],type:Z.markLine}];const i=[];return e.forEach((n,r)=>{n.visible!==!1&&i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.markLine})}),i}_createMarkerComponent(){var t,e,i;const{label:n={},startSymbol:r={},endSymbol:a={}}=this._spec,o={zIndex:this.layoutZIndex,interactive:(t=this._spec.interactive)!==null&&t!==void 0&&t,points:[{x:0,y:0},{x:0,y:0}],lineStyle:(e=this._spec.line)===null||e===void 0?void 0:e.style,clipInRange:(i=this._spec.clip)!==null&&i!==void 0&&i,label:jA(n)};return r.visible?o.startSymbol=Object.assign(Object.assign({},r),{visible:!0,style:wt(r.style)}):o.startSymbol={visible:!1},a.visible?o.endSymbol=Object.assign(Object.assign({},a),{visible:!0,style:wt(a.style)}):o.endSymbol={visible:!1},new BI(o)}_markerLayout(){var t,e,i,n,r,a,o;const l=this._spec,h=this._markerData,d=this._startRelativeSeries,u=this._endRelativeSeries,c=this._relativeSeries,p=E(l.coordinates),g=E(l.process),f=g&&E(l.process.x),_=g&&E(l.process.y),m=p&&(!g||"process"in l&&"xy"in l.process),v=E(l.positions),y=(t=l.autoRange)!==null&&t!==void 0&&t;let b=[];if(this._isXYLayout||p&&f||p&&_){const T=H_(h,d,u,c,y);b=T.length===1?T[0]:T.map(M=>M[0])}else m?b=BA(h,c,y,l.coordinatesOffset):v&&(b=DA(l.positions,c,l.regionRelative));const x=this._relativeSeries.getViewData().latestData,S=h.latestData[0]&&h.latestData[0].latestData?h.latestData[0].latestData:h.latestData;let A;if(l.clip||!((e=l.label)===null||e===void 0)&&e.confine){const{minX:T,maxX:M,minY:C,maxY:R}=FA([d.getRegion(),u.getRegion(),c.getRegion()]);A={x:T,y:C,width:M-T,height:R-C}}const k=(n=(i=this._markerComponent)===null||i===void 0?void 0:i.attribute)!==null&&n!==void 0?n:{},w=Object.assign(Object.assign({},k.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(S,x):(r=k.label)===null||r===void 0?void 0:r.text});if(this._spec.type==="type-step"){const{multiSegment:T,mainSegmentIndex:M}=this._spec.line||{},{connectDirection:C,expandDistance:R=0}=this._spec;let I;if(ws(R)){const D=d.getRegion(),j=D.getLayoutStartPoint(),H=u.getRegion(),W=H.getLayoutStartPoint();if(C==="bottom"||C==="top"){const V=Math.abs(Math.min(j.y,W.y)-Math.max(j.y+D.getLayoutRect().height,W.y+H.getLayoutRect().height));I=Number(R.substring(0,R.length-1))*V/100}else{const V=Math.abs(Math.min(j.x,W.x)-Math.max(j.x+D.getLayoutRect().width,W.x+H.getLayoutRect().width));I=Number(R.substring(0,R.length-1))*V/100}}else I=R;const O=Urt(b[0],b[1],C,I);let L;L=T&&E(M)?{position:"middle",autoRotate:!1,refX:0,refY:0}:Object.assign(Object.assign({position:"start",autoRotate:!1},$rt(b[0],b[1],C,I)),{refX:0,refY:0}),(a=this._markerComponent)===null||a===void 0||a.setAttributes({points:T?[[O[0],O[1]],[O[1],O[2]],[O[2],O[3]]]:O,label:Object.assign(Object.assign(Object.assign({},w),L),{textStyle:Object.assign(Object.assign({},k.label.textStyle),{textAlign:"center",textBaseline:"middle"})}),limitRect:A,multiSegment:T,mainSegmentIndex:M,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else(o=this._markerComponent)===null||o===void 0||o.setAttributes({points:b,label:w,limitRect:A,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_initDataView(){const t=this._spec,e=this._relativeSeries,i="x"in t,n="y"in t,r="x1"in t,a="y1"in t,o="coordinates"in t,l=i&&!n&&!a,h=i&&n&&a,d=n&&!i&&!r,u=n&&i&&r,c=i&&n&&r&&a;if(this._markerData=e.getViewData(),!(l||d||h||u||c||o))return;let p;Ct(this._option.dataSet,"markerAggregation",LA),Ct(this._option.dataSet,"markerRegression",Vrt),Ct(this._option.dataSet,"markerFilter",HA),this._isXYLayout=l||h||d||u||c;let g=e.getViewData(),f=!0,_=!1;if(c){const{x:v,x1:y,y:b,y1:x}=t;p=[this._processSpecXY(v,b),this._processSpecXY(y,x)]}else if(l)p=[this._processSpecX(t.x)];else if(d)p=[this._processSpecY(t.y)];else if(h){const{x:v,y,y1:b}=t;p=[this._processSpecXY(v,y),this._processSpecXY(v,b)]}else if(u){const{x:v,x1:y,y:b}=t;p=[this._processSpecXY(v,b),this._processSpecXY(y,b)]}else if(o){if(p=this._processSpecCoo(t),f=!1,g=new Jt(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([e.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:p}),t.process&&"x"in t.process&&(p=[this._processSpecX(t.process.x)],f=!0),t.process&&"y"in t.process&&(p=[this._processSpecY(t.process.y)],f=!0),t.process&&"xy"in t.process){const{xField:v,yField:y}=e.getSpec();p={fieldX:v,fieldY:y},_=!0}}else f=!1;const m=new Jt(this._option.dataSet);m.parse([g],{type:"dataview"}),f&&m.transform({type:"markerAggregation",options:p}),_&&m.transform({type:"markerRegression",options:p}),(f||_)&&m.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),m.target.on("change",()=>{this._markerLayout()}),this._markerData=m}}N_.type=Z.markLine,N_.specKey="markLine";const Yrt=()=>{F.registerComponent(N_.type,N_)};let G_=class extends bs{get orient(){return this._orient}constructor(t,e){super(t,e),this.type=Z.title,this.specKey=Z.title,this.layoutType="normal",this.layoutZIndex=ce.Title,this.layoutLevel=Ln.Title,this._orient="top",this._orient=iA(t.orient)?t.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){const e=t[this.specKey];if(!e||e.visible===!1)return null;if(!$(e))return[{spec:e,specPath:[this.specKey],type:Z.title}];const i=[];return e.forEach((n,r)=>{n.visible!==!1&&i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.title})}),i}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return(e==null?void 0:e.orient)!==(t==null?void 0:t.orient)&&(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}update(t){}resize(t){}afterSetLayoutStartPoint(t){N(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),N(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:n,y:r}=this.getLayoutStartPoint();return{x1:n,y1:r,x2:n+e.width,y2:r+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:N(t.width())?t.width():0,height:this._spec.height?this._spec.height:N(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,n,r,a,o,l,h;const d=Math.max(0,(t=this._spec.width)!==null&&t!==void 0?t:this.getLayoutRect().width);return Object.assign(Object.assign({},yh(this._spec,["padding"])),{textType:(e=this._spec.textType)!==null&&e!==void 0?e:"text",text:(i=this._spec.text)!==null&&i!==void 0?i:"",subtextType:(n=this._spec.subtextType)!==null&&n!==void 0?n:"text",subtext:(r=this._spec.subtext)!==null&&r!==void 0?r:"",x:(a=this._spec.x)!==null&&a!==void 0?a:0,y:(o=this._spec.y)!==null&&o!==void 0?o:0,width:d,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:this._spec.maxWidth,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:(l=this._spec.align)!==null&&l!==void 0?l:"left",verticalAlign:(h=this._spec.verticalAlign)!==null&&h!==void 0?h:"top",textStyle:Object.assign({width:d},this._spec.textStyle),subtextStyle:Object.assign({width:d},this._spec.subtextStyle)})}_createOrUpdateTitleComponent(t){if(this._titleComponent)Se(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new YI(t);i.name="title",e.add(i),this._titleComponent=i,i.on("*",(n,r)=>this._delegateEvent(i,n,r))}return this._cacheAttrs=t,this._titleComponent}_getNeedClearVRenderComponents(){return[this._titleComponent]}clear(){super.clear(),this._cacheAttrs=null}};G_.type=Z.title,G_.specKey=Z.title;const Xrt=()=>{F.registerComponent(G_.type,G_)};class W_ extends zA{constructor(){super(...arguments),this.type=Z.markArea,this.name=Z.markArea,this.specKey="markArea",this.layoutZIndex=ce.MarkArea}static getSpecInfo(t){const e=t[this.specKey];if(vt(e))return;if(!$(e)&&e.visible!==!1)return[{spec:e,specPath:[this.specKey],type:Z.markArea}];const i=[];return e.forEach((n,r)=>{n.visible!==!1&&i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.markArea})}),i}_createMarkerComponent(){var t,e,i,n;const r=(t=this._spec.label)!==null&&t!==void 0?t:{},a={zIndex:this.layoutZIndex,interactive:(e=this._spec.interactive)!==null&&e!==void 0&&e,points:[{x:0,y:0}],areaStyle:wt((i=this._spec.area)===null||i===void 0?void 0:i.style),clipInRange:(n=this._spec.clip)!==null&&n!==void 0&&n,label:jA(r)};return new FI(a)}_markerLayout(){var t,e,i,n,r;const a=this._spec,o=this._markerData,l=this._startRelativeSeries,h=this._endRelativeSeries,d=this._relativeSeries,u=E(a.x)&&E(a.x1),c=E(a.y)&&E(a.y1),p=u&&c,g=E(a.coordinates),f=E(a.positions),_=(t=a.autoRange)!==null&&t!==void 0&&t;let m=[],v=[];p?(v=H_(o,l,h,d,_),m=[{x:v[0][0].x,y:v[1][0].y},v[0][0],{x:v[1][0].x,y:v[0][0].y},v[1][0]]):u||c?(v=H_(o,l,h,d,_),m=[...v[0],v[1][1],v[1][0]]):g?m=BA(o,d,_,a.coordinatesOffset):f&&(m=DA(a.positions,d,a.regionRelative));const y=this._relativeSeries.getViewData().latestData,b=o?o.latestData[0]&&o.latestData[0].latestData?o.latestData[0].latestData:o.latestData:y;let x;if(a.clip||!((e=a.label)===null||e===void 0)&&e.confine){const{minX:S,maxX:A,minY:k,maxY:w}=FA([l.getRegion(),h.getRegion(),d.getRegion()]);x={x:S,y:k,width:A-S,height:w-k}}this._markerComponent&&this._markerComponent.setAttributes({points:m,label:Object.assign(Object.assign({},(i=this._markerComponent.attribute)===null||i===void 0?void 0:i.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(b,y):(r=(n=this._markerComponent.attribute)===null||n===void 0?void 0:n.label)===null||r===void 0?void 0:r.text}),limitRect:x,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_initDataView(){const t=this._spec,e=this._relativeSeries,i=E(t.x)&&E(t.x1),n=E(t.y)&&E(t.y1),r=i&&n,a=E(t.coordinates);if(!i&&!n&&!a)return null;let o;r?o=[this._processSpecXY(t.x,t.y),this._processSpecXY(t.x1,t.y1)]:i?o=[this._processSpecX(t.x),this._processSpecX(t.x1)]:n?o=[this._processSpecY(t.y),this._processSpecY(t.y1)]:a&&(o=this._processSpecCoo(t));const l=e.getViewData();Ct(this._option.dataSet,"markerAggregation",LA),Ct(this._option.dataSet,"markerFilter",HA);const h=new Jt(this._option.dataSet,{name:`${this.type}_${this.id}_data`});h.parse([l],{type:"dataview"}),h.transform({type:"markerAggregation",options:o}),o&&h.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),h.target.on("change",()=>{this._markerLayout()}),this._markerData=h}}W_.type=Z.markArea,W_.specKey="markArea";const Krt=()=>{F.registerComponent(W_.type,W_)},VP=s=>{const t=Object.assign({},s);return wt(t)},qrt=s=>{const t=Object.assign({},s);return wt(t)},ig=s=>Object.assign(Object.assign({},s),{style:Object.assign({},wt(s.style))}),P2=s=>{var t,e,i,n,r,a,o,l,h,d,u,c,p,g;const f=VP((e=(t=s==null?void 0:s.slider)===null||t===void 0?void 0:t.trackStyle)!==null&&e!==void 0?e:{}),_=VP((n=(i=s==null?void 0:s.slider)===null||i===void 0?void 0:i.railStyle)!==null&&n!==void 0?n:{}),m=qrt((a=(r=s==null?void 0:s.slider)===null||r===void 0?void 0:r.handlerStyle)!==null&&a!==void 0?a:{}),v=ig((l=(o=s==null?void 0:s.controller)===null||o===void 0?void 0:o.start)!==null&&l!==void 0?l:{}),y=ig((d=(h=s==null?void 0:s.controller)===null||h===void 0?void 0:h.pause)!==null&&d!==void 0?d:{}),b=ig((c=(u=s==null?void 0:s.controller)===null||u===void 0?void 0:u.backward)!==null&&c!==void 0?c:{}),x=ig((g=(p=s==null?void 0:s.controller)===null||p===void 0?void 0:p.forward)!==null&&g!==void 0?g:{});return Object.assign(Object.assign({},s),{direction:s.direction,interval:s.interval,visible:s.visible,orient:s.orient,slider:Object.assign(Object.assign({},s.slider),{trackStyle:f,railStyle:_,handlerStyle:m}),controller:Object.assign(Object.assign({},s.controller),{start:v,pause:y,backward:b,forward:x})})},Zrt=(s,t)=>Object.assign(Object.assign({},P2(s)),{data:t,type:"continuous"}),Jrt=(s,t)=>Object.assign(Object.assign({},P2(s)),{data:t,type:"discrete"}),kd=s=>s==="left"||s==="right",ey=s=>s==="top"||s==="bottom";class V_ extends bs{constructor(){super(...arguments),this.layoutZIndex=ce.Player,this.layoutLevel=Ln.Player,this.specKey="player",this.type=Z.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e;const i=this._spec.type,n={size:{width:this._width,height:this._height},dx:(t=this._spec.dx)!==null&&t!==void 0?t:0+this._dx,dy:(e=this._spec.dy)!==null&&e!==void 0?e:0+this._dy};return i==="discrete"?Object.assign(Object.assign(Object.assign({},Jrt(this._spec,this._specs)),n),{disableTriggerEvent:this._option.disableTriggerEvent}):Object.assign(Object.assign(Object.assign({},Zrt(this._spec,this._specs)),n),{disableTriggerEvent:this._option.disableTriggerEvent})},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?Se(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):(t.type==="discrete"?this._playerComponent=new c7(t):this._playerComponent=new g7(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,n,r,a,o,l,h;return Math.max(...Y((e=(t=this._spec.controller.start)===null||t===void 0?void 0:t.style)===null||e===void 0?void 0:e.size),...Y((n=(i=this._spec.controller.pause)===null||i===void 0?void 0:i.style)===null||n===void 0?void 0:n.size),...Y((a=(r=this._spec.controller.backward)===null||r===void 0?void 0:r.style)===null||a===void 0?void 0:a.size),...Y((l=(o=this._spec.controller.forward)===null||o===void 0?void 0:o.style)===null||l===void 0?void 0:l.size),(h=kd(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)!==null&&h!==void 0?h:10)},this._sliderExceededSize=()=>{var t,e,i,n,r,a,o,l,h;const d=(t=kd(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)!==null&&t!==void 0?t:10,u=Math.max(...Y((i=(e=this._spec.controller.start)===null||e===void 0?void 0:e.style)===null||i===void 0?void 0:i.size),...Y((r=(n=this._spec.controller.pause)===null||n===void 0?void 0:n.style)===null||r===void 0?void 0:r.size),...Y((o=(a=this._spec.controller.backward)===null||a===void 0?void 0:a.style)===null||o===void 0?void 0:o.size),...Y((h=(l=this._spec.controller.forward)===null||l===void 0?void 0:l.style)===null||h===void 0?void 0:h.size));return d>=u?d-u:0},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.on(St.rendered,()=>{var t;!((t=this._spec)===null||t===void 0)&&t.auto&&this._playerComponent.play()}),this._playerComponent.addEventListener(Ge.OnEnd,()=>{var t;this.event.emit(St.playerEnd,{model:this}),this._alternate&&this._spec.type==="discrete"&&(this._direction=this._direction==="default"?"reverse":"default",this._playerComponent.setAttributes({direction:this._direction,dataIndex:this._direction==="reverse"?this._specs.length-2:1})),!((t=this._spec)===null||t===void 0)&&t.loop&&this._playerComponent.play()}),this._playerComponent.addEventListener(Ge.OnChange,t=>{const{index:e}=t.detail,i=this._specs[e];Y(i.data).forEach(n=>{var r,a;(a=(r=this._option)===null||r===void 0?void 0:r.globalInstance)===null||a===void 0||a.updateData(n.id,n.values)}),this.event.emit(St.playerChange,{model:this,value:{spec:i,index:e,specs:this._specs}})}),this._playerComponent.addEventListener(Ge.OnBackward,t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(St.playerBackward,{model:this,value:{spec:i,index:e,specs:this._specs}})}),this._playerComponent.addEventListener(Ge.OnForward,t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(St.playerForward,{model:this,value:{spec:i,index:e,specs:this._specs}})}),this._playerComponent.addEventListener(Ge.OnPlay,t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(St.playerPlay,{model:this,value:{spec:i,index:e,specs:this._specs}})}),this._playerComponent.addEventListener(Ge.OnPause,t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(St.playerPause,{model:this,value:{spec:i,index:e,specs:this._specs}})}))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}static getSpecInfo(t){const e=t[this.specKey];return P(e)||e.visible===!1?null:[{spec:e,specPath:[this.specKey],type:Z.player}]}setAttrFromSpec(){var t,e,i,n,r,a,o;super.setAttrFromSpec(),this._orient=(t=this._spec.orient)!==null&&t!==void 0?t:"bottom",this._specs=(e=this._spec.specs)!==null&&e!==void 0?e:[],this._direction=(i=this._spec.direction)!==null&&i!==void 0?i:"default",this._alternate=(n=this._spec.alternate)!==null&&n!==void 0&&n,this._dx=(r=this._spec.dx)!==null&&r!==void 0?r:0,this._dy=(a=this._spec.dy)!==null&&a!==void 0?a:0,this._position=(o=this._spec.position)!==null&&o!==void 0?o:"middle"}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),N(t.x)){const e=kd(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(N(t.y)){const e=ey(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}changeRegions(t){}onRender(t){}_getNeedClearVRenderComponents(){return[this._playerComponent]}_computeLayoutRect(t,e,i){switch(this._orient){case"top":case"left":return{x1:0,y1:0,x2:e,y2:i};case"right":return{x1:t.width-e,y1:0,x2:t.width,y2:t.height};default:return{x1:0,y1:t.height-i,x2:t.width,y2:t.height}}}_computeWidth(t){return dt(this._spec.width)?Math.min(t.width,Number(this._spec.width)):kd(this._orient)?this._maxSize():t.width}_computeHeight(t){return dt(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):ey(this._orient)?this._maxSize():t.height}_computeDx(t){return kd(this._orient)||this._position==="start"?0:this._position==="middle"?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return ey(this._orient)||this._position==="start"?0:this._position==="middle"?(t.height-this._height)/2:t.height-this._height}}V_.specKey="player",V_.type=Z.player;const Qrt=()=>{F.registerComponent(V_.type,V_)},UP={rect:$P,symbol:E2,arc:YP,point:nat,"line-data":eat,stackLabel:rat,line:XP,area:XP,rect3d:$P,arc3d:YP,treemap:aat};function tat(s,t){var e;const{labelSpec:i}=t;return i.overlap&&!$t(i.overlap)&&(i.overlap={}),((e=UP[s])!==null&&e!==void 0?e:UP.point)(t)}function fv(s,t,e,i){var n;const{labelMark:r,series:a}=s,o={text:t[a.getMeasureField()[0]],data:t,textType:(n=s.labelSpec.textType)!==null&&n!==void 0?n:"text"},l=Object.keys(r.stateStyle.normal);for(const h of l){const d=r.getAttribute(h,t);o[h]=d}return e&&(o.text=e(o.text,t,{series:a})),i&&(a.type==="pie"?t._percent_=(100*t[tI]).toFixed(2)+"%":t[$a]&&(t._percent_=(100*t[$a]).toFixed(2)+"%"),o.text=Sj(i,t)),o}function NA(s){return K(s)?t=>s(t.data):s}function E2(s){var t,e,i;const{series:n,labelSpec:r}=s,a=n.direction==="horizontal"?"right":"top",o=(t=NA(r.position))!==null&&t!==void 0?t:a;let l;return l=r.overlap!==!1&&{strategy:(i=(e=r.overlap)===null||e===void 0?void 0:e.strategy)!==null&&i!==void 0?i:iat(),avoidBaseMark:o!=="center"},{position:o,overlap:l}}function eat(s){const t=E2(s);return ye(t.overlap)||(t.overlap.avoidBaseMark=!1),t}function iat(){return[{type:"position",position:["top","bottom","right","left","top-right","top-left","bottom-left","bottom-right"]}]}function $P(s){var t,e,i,n,r,a;const{series:o,labelSpec:l={}}=s,h=(t=NA(l.position))!==null&&t!==void 0?t:"outside",d=(e=o.direction)!==null&&e!==void 0?e:"vertical",u=o.direction==="horizontal"?(i=o.getXAxisHelper())===null||i===void 0?void 0:i.isInverse():(n=o.getYAxisHelper())===null||n===void 0?void 0:n.isInverse();let c,p=h;ht(h)&&p!=="inside"&&(p=f=>{const{data:_}=f,m=o.getMeasureField()[0];if(h==="outside"){const v={vertical:["top","bottom"],horizontal:["right","left"]},y=(_==null?void 0:_[m])>=0&&u||(_==null?void 0:_[m])<0&&!u?1:0;return v[d][y]}return h==="inside-bottom"?o.direction==="horizontal"?"inside-left":"inside-bottom":h==="inside-top"?o.direction==="horizontal"?"inside-right":"inside-top":h}),c=l.overlap!==!1&&{strategy:(a=(r=l.overlap)===null||r===void 0?void 0:r.strategy)!==null&&a!==void 0?a:sat(o)};let g=!1;return ht(h)&&h.includes("inside")&&(g=!0),{position:p,overlap:c,smartInvert:g}}function sat(s){return[{type:"position",position:t=>{var e,i;const{data:n}=t,r=s.getMeasureField()[0];return(s.direction==="horizontal"?!((e=s.getXAxisHelper())===null||e===void 0)&&e.isInverse():!((i=s.getYAxisHelper())===null||i===void 0)&&i.isInverse())?(n==null?void 0:n[r])>=0?s.direction==="horizontal"?["left","inside-left"]:["bottom","inside-bottom"]:s.direction==="horizontal"?["right","inside-right"]:["top","inside-top"]:(n==null?void 0:n[r])>=0?s.direction==="horizontal"?["right","inside-right"]:["top","inside-top"]:s.direction==="horizontal"?["left","inside-left"]:["bottom","inside-bottom"]}}]}function nat(s){const{labelSpec:t}=s;let e;return e=t.overlap!==!1&&{avoidBaseMark:!1},{position:"center",overlap:e}}function YP(s){var t;const{labelSpec:e}=s,i=(t=NA(e.position))!==null&&t!==void 0?t:"outside",n=i;let r;return r=e.smartInvert?e.smartInvert:ht(i)&&i.includes("inside"),{position:n,smartInvert:r}}function rat(s){const t=s.series,e=s.labelSpec||{},i=t.getTotalData();return{customLayoutFunc:n=>n.map(r=>{const a=e.position||"withChange",o=e.offset||0,l=r.data,h=fv(s,l,e.formatMethod);return h.x=(d=>t.direction==="vertical"?t.totalPositionX(d,"index",.5):a==="middle"?.5*(t.totalPositionX(d,"end")+t.totalPositionY(d,"start")):a==="max"?t.totalPositionX(d,d.end>=d.start?"end":"start")+o:a==="min"?t.totalPositionX(d,d.end>=d.start?"start":"end")-o:t.totalPositionX(d,"end")+(d.end>=d.start?o:-o))(l),h.y=(d=>t.direction==="vertical"?a==="middle"?.5*(t.totalPositionY(d,"end")+t.totalPositionY(d,"start")):a==="max"?t.totalPositionY(d,d.end>=d.start?"end":"start")-o:a==="min"?t.totalPositionY(d,d.end>=d.start?"start":"end")+o:t.totalPositionY(d,"end")+(d.end>=d.start?-o:o):t.totalPositionY(d,"index",.5))(l),t.direction==="vertical"?h.textBaseline=a==="middle"?a:a==="withChange"&&l.end-l.start>=0||a==="max"?"bottom":"top":h.textAlign=a==="middle"?"center":a==="withChange"&&l.end-l.start>=0||a==="max"?"left":"right",Mo(Object.assign(Object.assign({},h),{id:r.id}))}),dataFilter:n=>{const r=[];return i.forEach(a=>{const o=n.find(l=>{var h;return a.index===((h=l.data)===null||h===void 0?void 0:h[t.getDimensionField()[0]])});o&&(o.data=a,r.push(o))}),r},overlap:{strategy:[]}}}function aat(s){const t=s.labelSpec;return{customLayoutFunc:e=>e.map(i=>{const n=i.data,r=fv(s,n,t.formatMethod);return Mo(Object.assign(Object.assign({},r),{id:i.id,pickable:!1}))}),overlap:!1}}function XP(s){var t,e,i,n;const{labelSpec:r,series:a}=s,o=(i=(e=(t=a.getViewDataStatistics)===null||t===void 0?void 0:t.call(a).latestData)===null||e===void 0?void 0:e[a.getSeriesField()])===null||i===void 0?void 0:i.values,l=o?o.map((h,d)=>({[a.getSeriesField()]:h,index:d})):[];return{position:(n=r.position)!==null&&n!==void 0?n:"end",data:l}}class GA extends bs{constructor(t,e){super(t,e),this.type=Z.label,this.name=Z.label,this.layoutType="none",this.layoutZIndex=ce.Label,this._regions=e.getRegionsInIndex([e.specIndex])}_interactiveConfig(t){const{interactive:e}=t;if(e!==!0)return{hover:!1,select:!1};const i={hover:!1,select:!1,state:t.state},{hover:n,select:r}=this._option.getChart().getSpec();return n===!1&&n.enable===!1||(i.hover=!0),r===!1&&r.enable===!1||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,Se(e,t)||(i.reMake=!0),i}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}}GA.type=Z.label;class U_ extends jh{constructor(){super(...arguments),this.skipEncode=!1}getRule(){return this._rule}setRule(t){this._rule=t}getTarget(){return this._target}setTarget(t){this._target=t,this._rule||this.setRule(t.type)}getComponent(){return this._component}setComponent(t){this._component=t}}U_.type="text",U_.constructorType="label";const R2=()=>{F.registerMark(U_.constructorType,U_),dL()};class O2 extends Wc{_initTheme(t,e){return{spec:t,theme:this._theme}}}class yu extends GA{constructor(t,e){super(t,e),this.type=Z.label,this.name=Z.label,this.specKey="label",this.transformerConstructor=O2,this.layoutZIndex=ce.Label,this._layoutRule=t.labelLayout||"series"}static getSpecInfo(t,e){const i=[];return((e==null?void 0:e.region)||[]).forEach((r,a)=>{const o=(r.seriesIndexes||[]).some(l=>{const h=e.series[l],{markLabelSpec:d={}}=h;return Object.values(d).some(u=>Array.isArray(u)&&(c=>c.some(p=>p.visible))(u))});(t.labelLayout!=="region"||o)&&i.push({spec:t,type:Z.label,specInfoPath:["region",a,"markLabel"],specIndex:a})}),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initTextMarkStyle()}initEvent(){this.event.on(St.dataZoomChange,()=>{this._labelComponentMap.forEach((e,i)=>{const n=i.getProduct().getGroupGraphicItem();n&&n.disableAnimation()}),this.event.on(gt.AFTER_MARK_RENDER_END,t)});const t=()=>{this._labelComponentMap.forEach((e,i)=>{const n=i.getProduct().getGroupGraphicItem();n&&n.enableAnimation()}),this.event.off(gt.AFTER_MARK_RENDER_END,t)};this.event.on("afterElementEncode",e=>{var i;const n=e.item;this._option.getChart().getLayoutTag()===!1&&((i=n.getContext())===null||i===void 0?void 0:i.model)===this&&this._delegateLabelEvent(n.getGroupGraphicItem())})}_delegateLabelEvent(t){const e=t==null?void 0:t.findAll(i=>i.type==="text",!0).filter(i=>!i.__vchart_event);e&&e.length>0&&e.forEach(i=>{i.__vchart_event=!0,i.addEventListener("*",(n,r)=>this._delegateEvent(t,n,r,i,i.attribute.data))})}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),Ie(this._regions,t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),n=t.getRegion();this._labelInfoMap.get(n)||this._labelInfoMap.set(n,[]);for(let r=0;r<i.length;r++){const a=i[r],o=t.getMarkInName(a);o&&e[a].forEach((l,h)=>{if(l.visible){const d=this._labelInfoMap.get(n),u=this._createMark({type:"label",name:`${a}-label-${h}`},{noSeparateStyle:!0,attributeContext:t.getMarkAttributeContext()});u.setTarget(o),d.push({labelMark:u,baseMark:o,series:t,labelSpec:l})}})}})}_initLabelComponent(){this._labelInfoMap.forEach((t,e)=>{if(this._layoutRule==="region"){const i=this._createMark({type:"component",name:`${e.getGroupMark().name}-label-component`},{componentType:"label",noSeparateStyle:!0,support3d:this._spec.support3d});i&&(i.setSkipBeforeLayouted(!0),this._marks.addMark(i),this._labelComponentMap.set(i,()=>this._labelInfoMap.get(e)))}else t.forEach((i,n)=>{const r=this._createMark({type:"component",name:`${i.labelMark.name}-component`},{componentType:"label",noSeparateStyle:!0,support3d:i.baseMark.getSupport3d()});r&&(r.setSkipBeforeLayouted(!0),this._marks.addMark(r),this._labelComponentMap.set(r,()=>this._labelInfoMap.get(e)[n]),i.labelMark.setComponent(r))})})}_initTextMarkStyle(){this._labelInfoMap.forEach(t=>{t.forEach(e=>{var i,n;const{labelMark:r,labelSpec:a,series:o}=e;if(this.initMarkStyleWithSpec(r,a,void 0),K(a==null?void 0:a.getStyleHandler)){const l=a.getStyleHandler(o);l==null||l.call(o,r)}!((n=(i=r.stateStyle)===null||i===void 0?void 0:i.normal)===null||n===void 0)&&n.lineWidth&&r.setAttribute("stroke",o.getColorAttribute(),"normal",tt.Base_Series)})})}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach((t,e)=>{const i=t();$(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)})}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e.getProduct(),t.map(({baseMark:i})=>i.getProduct()),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e.getProduct(),i.getProduct(),[t])}_updateLabelComponentAttribute(t,e,i){const n=this._option.getAllComponents().filter(r=>r.type==="totalLabel");t.target(e).configure({interactive:!1}).depend(n.map(r=>r.getMarks()[0].getProduct())).labelStyle((r,a)=>{var o,l;const h=i[a.labelIndex];if(h){const{labelSpec:d,labelMark:u}=h,c=u.getRule(),p=this._interactiveConfig(d),g=(l=(o=this._spec)===null||o===void 0?void 0:o.centerOffset)!==null&&l!==void 0?l:0,f=yt({textStyle:Object.assign({pickable:d.interactive===!0},d.style),overlap:{avoidMarks:this._option.getAllComponents().filter(_=>_.type==="totalLabel").map(_=>_.getMarks()[0].getProductId())},x:0,y:0},tat(c,h),Object.assign(Object.assign(Object.assign({},yh(d,["position","style","state","type"])),p),{centerOffset:g}));return c!=="line"&&c!=="area"||(f.type=c),f}}).encode((r,a,o)=>{if(i[o.labelIndex]){const{labelSpec:l,labelMark:h}=i[o.labelIndex];return h.skipEncode?{data:r}:fv(i[o.labelIndex],r,l.formatMethod,l.formatter)}}).size(()=>i[0].series.getRegion().getLayoutRect())}compileMarks(){this.getMarks().forEach(t=>{var e;const i=this._labelComponentMap.get(t)();let n;n=$(i)?i[0].series.getRegion().getGroupMark().getProduct():i.series.getRegion().getGroupMark().getProduct(),t.compile({group:n}),(e=t.getProduct())===null||e===void 0||e.configure({context:{model:this,labelInfo:i}})})}getVRenderComponents(){const t=[];return this._labelComponentMap.forEach((e,i)=>{const n=i.getProduct().getGroupGraphicItem();n&&t.push(n)}),t}}yu.type=Z.label,yu.specKey="label",yu.transformerConstructor=O2;const oat=()=>{yL(),R2(),PA(),F.registerComponent(yu.type,yu,!0)};class $_ extends GA{constructor(){super(...arguments),this.type=Z.totalLabel,this.name=Z.totalLabel,this.specKey="totalLabel",this.layoutZIndex=ce.Label}static getSpecInfo(t,e){var i;const n=[];return(i=e==null?void 0:e.region)===null||i===void 0||i.forEach((r,a)=>{var o;(o=r.seriesIndexes)===null||o===void 0||o.forEach(l=>{const{spec:h}=e.series[l],d=h[this.specKey];d!=null&&d.visible&&n.push({spec:d,type:Z.totalLabel,specPath:["series",l,this.specKey],specIndex:a})})}),n}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}_initTextMark(){var t;const e=this._getSeries();if(!((t=e.getSpec().totalLabel)===null||t===void 0)&&t.visible){const i=e.getMarksInType(["rect","symbol"])[0],n=this._createMark({type:"label",name:`${i.name}-total-label`});this._baseMark=i,this._textMark=n,this._initTextMarkStyle()}}_initTextMarkStyle(){super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[RL]},"normal",tt.Default)}_initLabelComponent(){const t=this._getSeries(),e=this._createMark({type:"component",name:`${t.name}-total-label-component`},{componentType:"label",noSeparateStyle:!0,support3d:this._spec.support3d});e&&this._marks.addMark(e)}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach((e,i)=>{e.getProduct().target(this._baseMark.getProduct()).configure({interactive:!1}).labelStyle(()=>{if(this._baseMark){const{offset:n,animation:r,overlap:a}=this._spec,o=this._interactiveConfig(this._spec);return yt({textStyle:{pickable:this._spec.interactive===!0},position:lat(t,this._baseMark.type),x:0,y:0},Object.assign({offset:n,animation:r,overlap:a,dataFilter:l=>l.filter(h=>h.data[ux])},o))}}).encode(n=>fv({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},n,this._spec.formatMethod)).size(()=>this._regions[0].getLayoutRect())})}compileMarks(){this.getMarks().forEach(t=>{var e;const i=this._regions[0].getGroupMark().getProduct();t.compile({group:i}),(e=t.getProduct())===null||e===void 0||e.configure({context:{model:this}})})}getVRenderComponents(){const t=[];return this.getMarks().forEach(e=>{const i=e.getProduct().getGroupGraphicItem();i&&t.push(i)}),t}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}$_.type=Z.totalLabel,$_.specKey="totalLabel";function lat(s,t){let e;return t==="rect"?e=s.direction==="horizontal"?"right":"top":e="top",e}const hat=()=>{yL(),R2(),PA(),F.registerComponent($_.type,$_,!0)};var KP=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};class Y_ extends zA{constructor(){super(...arguments),this.type=Z.markPoint,this.name=Z.markPoint,this.specKey="markPoint",this.layoutZIndex=ce.MarkPoint}static getSpecInfo(t){const e=t[this.specKey];if(vt(e))return;if(!$(e)&&e.visible!==!1)return[{spec:e,specPath:[this.specKey],type:Z.markPoint}];const i=[];return e.forEach((n,r)=>{n.visible!==!1&&i.push({spec:n,specIndex:r,specPath:[this.specKey,r],type:Z.markPoint})}),i}_createMarkerComponent(){var t,e;const{itemContent:i={},itemLine:n={}}=this._spec,{text:r={},symbol:a,image:o,richText:l}=i,h=KP(i,["text","symbol","image","richText"]),d={zIndex:this.layoutZIndex,interactive:(t=this._spec.interactive)!==null&&t!==void 0&&t,position:{x:0,y:0},clipInRange:(e=this._spec.clip)!==null&&e!==void 0&&e,itemContent:Object.assign({symbolStyle:wt(a==null?void 0:a.style),imageStyle:o==null?void 0:o.style,textStyle:jA(r),richTextStyle:l==null?void 0:l.style},h)},{visible:u,line:c={}}=n,p=KP(n,["visible","line"]);return d.itemLine=u!==!1?Object.assign(Object.assign({},p),{visible:!0,lineStyle:wt(c.style)}):{visible:!1},new GS(d)}_markerLayout(){var t,e,i,n,r,a;const o=this._spec,l=this._markerData,h=this._relativeSeries,d="x"in o&&"y"in o,u="coordinate"in o,c="position"in o,p=(t=o==null?void 0:o.autoRange)!==null&&t!==void 0&&t;let g;d?g=H_(l,h,h,h,p)[0][0]:u?g=BA(l,h,p,o.coordinatesOffset)[0]:c&&(g=DA([o.position],h,o.regionRelative)[0]);const f=this._relativeSeries.getViewData().latestData,_=l?l.latestData[0]&&l.latestData[0].latestData?l.latestData[0].latestData:l.latestData:f;let m;if(o.clip||!((e=o.itemContent)===null||e===void 0)&&e.confine){const{minX:v,maxX:y,minY:b,maxY:x}=FA([h.getRegion()]);m={x:v,y:b,width:y-v,height:x-b}}if(this._markerComponent){const v=(i=this._markerComponent.attribute)!==null&&i!==void 0?i:{},y=(r=(n=v.itemContent)===null||n===void 0?void 0:n.textStyle)!==null&&r!==void 0?r:{};this._markerComponent.setAttributes({position:g,itemContent:Object.assign(Object.assign({},v.itemContent),{textStyle:Object.assign(Object.assign({},y),{text:!((a=this._spec.itemContent.text)===null||a===void 0)&&a.formatMethod?this._spec.itemContent.text.formatMethod(_,f):y.text})}),limitRect:m,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}_initDataView(){const t=this._spec,e=this._relativeSeries,i=E(t.x)&&E(t.y),n=E(t.coordinate);if(!n&&!i)return;let r;Ct(this._option.dataSet,"markerAggregation",LA),Ct(this._option.dataSet,"markerFilter",HA),i?r=[this._processSpecXY(t.x,t.y)]:n&&(r=this._processSpecCoo(t));const a=new Jt(this._option.dataSet,{name:`${this.type}_${this.id}_data`});a.parse([e.getViewData()],{type:"dataview"}),a.transform({type:"markerAggregation",options:r}),r&&a.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),a.target.on("change",()=>{this._markerLayout()}),this._markerData=a}}Y_.type=Z.markPoint,Y_.specKey="markPoint";const dat=()=>{F.registerComponent(Y_.type,Y_)};class X_ extends bs{constructor(){super(...arguments),this.layoutType="none",this.type=Z.brush,this.name=Z.brush,this.specKey="brush",this.layoutZIndex=ce.Brush,this._linkedSeries=[],this._itemMap={},this._linkedItemMap={},this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._needInitOutState=!0,this._cacheInteractiveRangeAttrs=[],this._needDisablePickable=!1}init(){const t=this._transformBrushedMarkAttr(this._spec.inBrush),e=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach(i=>{i.getActiveMarks().forEach(n=>{n&&(i.setMarkStyle(n,Object.assign({},t),"inBrush",tt.Series),i.setMarkStyle(n,Object.assign({},e),"outOfBrush",tt.Series))})})}static getSpecInfo(t){const e=t[this.specKey];if(!P(e)&&e.visible!==!1)return[{spec:e,specPath:[this.specKey],type:Z.brush}]}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initNeedOperatedItem()}_extendDataInBrush(t){const e=[];for(const i in t)for(const n in t[i])e.push(t[i][n].data[0]);return e}_extendDatumOutOfBrush(t){const e=[];for(const i in t)e.push(t[i].data[0]);return e}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),n=e.x,r=n+i.width,a=e.y,o=a+i.height;return{interactiveRange:{minY:a,maxY:o,minX:n,maxX:r},xRange:[n,r],yRange:[a,o]}}_updateBrushComponent(t,e){const i=this._getBrushInteractiveAttr(t),n=this._brushComponents[e];n.setAttributes(i),this._initMarkBrushState(e,""),n.children[0].removeAllChild(),this._needInitOutState=!0}_createBrushComponent(t,e){var i,n;const r=this._getBrushInteractiveAttr(t),a=new qI(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:wt((i=this._spec)===null||i===void 0?void 0:i.style)},r),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));a.id=(n=this._spec.id)!==null&&n!==void 0?n:`brush-${this.id}`,this.getContainer().add(a);const{brushMode:o="single"}=this._spec;this._brushComponents.push(a),this._cacheInteractiveRangeAttrs.push(r),a.addEventListener(Zi.drawStart,l=>{this._emitEvent(St.brushStart,t)}),a.addEventListener(Zi.moveStart,l=>{this._emitEvent(St.brushStart,t)}),a.addEventListener(Zi.drawing,l=>{this._needInitOutState&&o==="single"&&this._initMarkBrushState(e,"outOfBrush"),this._needInitOutState=!1,this._needDisablePickable=!0,this._handleBrushChange(St.brushChange,t,l)}),a.addEventListener(Zi.moving,l=>{this._handleBrushChange(St.brushChange,t,l)}),a.addEventListener(Zi.brushClear,l=>{this._initMarkBrushState(e,""),this._needInitOutState=!0,this._needDisablePickable=!1,this._handleBrushChange(St.brushChange,t,l),this._handleBrushChange(St.brushClear,t,l)}),a.addEventListener(Zi.drawEnd,l=>{this._needInitOutState=!0,this._needDisablePickable=!1,this._handleBrushChange(St.brushEnd,t,l)}),a.addEventListener(Zi.moveEnd,l=>{this._handleBrushChange(St.brushEnd,t,l)})}_handleBrushChange(t,e,i){const{operateMask:n}=i.detail;this._reconfigItem(n,e),this._reconfigLinkedItem(n,e),this._emitEvent(t,e)}_emitEvent(t,e){this.event.emit(t,{model:this,value:{operateType:t,operateRegion:e,inBrushData:this._extendDataInBrush(this._inBrushElementsMap),outOfBrushData:this._extendDatumOutOfBrush(this._outOfBrushElementsMap),linkInBrushData:this._extendDataInBrush(this._linkedInBrushElementsMap),linkOutOfBrushData:this._extendDatumOutOfBrush(this._linkedOutOfBrushElementsMap),inBrushElementsMap:this._inBrushElementsMap,outOfBrushElementsMap:this._outOfBrushElementsMap,linkedInBrushElementsMap:this._linkedInBrushElementsMap,linkedOutOfBrushElementsMap:this._linkedOutOfBrushElementsMap}})}_transformBrushedMarkAttr(t){const e={};return t!=null&&t.symbol&&(e.symbolType=t.symbol),t!=null&&t.symbolSize&&(e.size=t.symbolSize),t!=null&&t.color&&(e.fill=t.color),t!=null&&t.colorAlpha&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},wt(t)),e)}_reconfigItem(t,e){this._itemMap[e.id].forEach(i=>{const n=i.getProduct();!n||!n.elements||!n.elements.length||n.elements.forEach(r=>{var a,o,l;const h=r.getGraphicItem(),d=i.id+"_"+r.key;!((a=this._outOfBrushElementsMap)===null||a===void 0)&&a[d]&&this._isBrushContainItem(t,h)?(r.addState("inBrush"),this._inBrushElementsMap[t==null?void 0:t.name]||(this._inBrushElementsMap[t==null?void 0:t.name]={}),this._inBrushElementsMap[t==null?void 0:t.name][d]=r,delete this._outOfBrushElementsMap[d]):!((l=(o=this._inBrushElementsMap)===null||o===void 0?void 0:o[t==null?void 0:t.name])===null||l===void 0)&&l[d]&&!this._isBrushContainItem(t,h)&&(r.removeState("inBrush"),r.addState("outOfBrush"),this._outOfBrushElementsMap[d]=r,delete this._inBrushElementsMap[t.name][d]),h.setAttribute("pickable",!this._needDisablePickable)})})}_reconfigLinkedItem(t,e){const i=e.getLayoutStartPoint(),n=e.getSeries().map(r=>r.id);this._linkedSeries.forEach(r=>{if(!n.includes(r.id)){const a=r.getRegion().getLayoutStartPoint(),o=a.x-i.x,l=a.y-i.y;this._linkedItemMap[r.id].forEach(h=>{const d=h.getProduct();!d||!d.elements||!d.elements.length||d.elements.forEach(u=>{var c,p,g;const f=u.getGraphicItem(),_=h.id+"_"+u.key;!((c=this._linkedOutOfBrushElementsMap)===null||c===void 0)&&c[_]&&this._isBrushContainItem(t,f,{dx:o,dy:l})?(u.addState("inBrush"),this._linkedInBrushElementsMap[t==null?void 0:t.name]||(this._linkedInBrushElementsMap[t==null?void 0:t.name]={}),this._linkedInBrushElementsMap[t==null?void 0:t.name][_]=u,delete this._linkedOutOfBrushElementsMap[_]):!((g=(p=this._linkedInBrushElementsMap)===null||p===void 0?void 0:p[t==null?void 0:t.name])===null||g===void 0)&&g[_]&&!this._isBrushContainItem(t,f,{dx:o,dy:l})&&(u.removeState("inBrush"),u.addState("outOfBrush"),this._linkedOutOfBrushElementsMap[_]=u),f.setAttribute("pickable",!this._needDisablePickable)})})}})}_isBrushContainItem(t,e,i){var n,r,a;if(!(t!=null&&t.globalTransMatrix)||!(!((n=t==null?void 0:t.attribute)===null||n===void 0)&&n.points))return!1;const o=(a=(r=t==null?void 0:t.attribute)===null||r===void 0?void 0:r.points)!==null&&a!==void 0?a:[],{a:l,b:h,c:d,d:u,e:c,f:p}=t.globalTransMatrix,g=(i==null?void 0:i.dx)||0,f=(i==null?void 0:i.dy)||0,_=o.map(b=>({x:l*b.x+d*b.y+c+g,y:h*b.x+u*b.y+p+f}));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+g,t.globalAABBBounds.y1+f,t.globalAABBBounds.x2+g,t.globalAABBBounds.y2+f);const m=e.globalTransMatrix.e,v=e.globalTransMatrix.f;let y=[];if(e.type==="symbol"){const{size:b=0}=e==null?void 0:e.attribute,x=Y(b)[0]/2;return y=[{x:m-x,y:v-x},{x:m+x,y:v-x},{x:m+x,y:v+x},{x:m-x,y:v+x}],S1(_,y)}if(e.type==="rect"){const{x1:b,x2:x,y1:S,y2:A}=e==null?void 0:e.AABBBounds,k=Math.abs(b-x),w=Math.abs(S-A);return y=[{x:m,y:v},{x:m+k,y:v},{x:m+k,y:v+w},{x:m,y:v+w}],S1(_,y)}return t.globalAABBBounds.intersects(e.globalAABBBounds)}_bindRegions(){E(this._spec.regionId)&&E(this._spec.regionIndex)&&(this._relativeRegions=this._option.getAllRegions()),this._relativeRegions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex))}_bindLinkedSeries(){E(this._spec.brushLinkSeriesId)&&E(this._spec.brushLinkSeriesIndex)||(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(Y(this._spec.brushLinkSeriesId),Y(this._spec.brushLinkSeriesIndex)))}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach(i=>{const n=[];i.getSeries().forEach(r=>{(t&&Y(t).includes(r.userId.toString())||e&&Y(e).includes(r.getSpecIndex())||!e&&!t)&&n.push(...r.getMarksWithoutRoot()),this._itemMap[i.id]=n})}),this._linkedSeries.forEach(i=>{this._linkedItemMap[i.id]=i.getMarksWithoutRoot()})}_initMarkBrushState(t,e){this._brushComponents.forEach((i,n)=>{n!==t&&i.children[0].removeAllChild()}),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._option.getAllSeries().forEach(i=>{i.getMarksWithoutRoot().forEach(n=>{const r=n.getProduct();!r||!r.elements||!r.elements.length||r.elements.forEach(a=>{const o=n.id+"_"+a.key;a.removeState("inBrush"),a.removeState("outOfBrush"),a.addState(e),this._outOfBrushElementsMap[o]=a,this._linkedOutOfBrushElementsMap[o]=a})})})}initEvent(){}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return this._brushComponents}_compareSpec(t,e){this._brushComponents&&this._relativeRegions.forEach((n,r)=>{this._updateBrushComponent(n,r)});const i=super._compareSpec(t,e);return Se(e,t)||(i.reRender=!0,i.reMake=!0),i}onLayoutEnd(t){var e;super.onLayoutEnd(t),!this._option.disableTriggerEvent&&((e=this._spec.visible)===null||e===void 0||e)&&(this._brushComponents?this._relativeRegions.forEach((i,n)=>{this._updateBrushComponent(i,n)}):(this._brushComponents=[],this._relativeRegions.forEach((i,n)=>{this._createBrushComponent(i,n)})))}clearGraphic(){this._brushComponents&&this._brushComponents.forEach(t=>{t._container.incrementalClearChild()})}clear(){var t;this._brushComponents&&((t=this.getContainer())===null||t===void 0||t.removeChild(this._brushComponents),this._brushComponents.forEach(e=>{e.removeAllChild(),e.releaseBrushEvents()}),this._brushComponents=null),super.clear()}}X_.type=Z.brush,X_.specKey="brush";const uat=()=>{F.registerComponent(X_.type,X_)};class yc extends Hi{constructor(){super(...arguments),this.type=yc.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}yc.type="image";const cat=()=>{F.registerMark(yc.type,yc),ZX()};class K_ extends bs{constructor(){super(...arguments),this.type=Z.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=ce.CustomMark,this.layoutLevel=Ln.CustomMark}static getSpecInfo(t){const e=t[this.specKey];return e?[{spec:e,specIndex:0,specPath:[this.specKey],type:Z.customMark}]:null}created(){super.created(),this.initMarks(),this.initEvent()}initMarks(){this._spec&&this._spec.forEach((t,e)=>{this._createExtensionMark(t,null,`${At}_series_${this.id}_extensionMark`,e)})}_createExtensionMark(t,e,i,n){var r;const a=this._createMark({type:t.type,name:`${At}_${n}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext()});if(a&&(P(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),t.type==="group"&&(i=`${i}_${n}`,(r=t.children)===null||r===void 0||r.forEach((o,l)=>{this._createExtensionMark(o,a,i,l)})),E(t.dataId)||N(t.dataIndex))){const o=this.getChart().getSeriesData(t.dataId,t.dataIndex);o&&(o.target.addListener("change",()=>{a.getData().updateData()}),a.setDataView(o))}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return Se(e,t)||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}onRender(t){}_getMarkAttributeContext(){return{vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return(i=this._option.globalScale.getScale(t))===null||i===void 0?void 0:i.scale(e)}}}}K_.type=Z.customMark,K_.specKey="customMark";const pat=()=>{cat(),F.registerComponent(K_.type,K_)};function qP(s,t,e=0){return e>Math.max(t.x1-s.x2,s.x1-t.x2,t.y1-s.y2,s.y1-t.y2)}function gat(s){return{x1:s.x,x2:s.x+s.width,y1:s.y,y2:s.y+s.height}}function fat(s){return{x:s.x1,y:s.y1,width:s.x2-s.x1,height:s.y2-s.y1}}function I2(s){var t;if(!s||s.length===0)return[];if(s.length===1)return[s[0].rect];const e=s.map(n=>{var r;return Object.assign(Object.assign({},n),{bound:gat(n.rect),anchorCandidates:vat((r=n.anchors)!==null&&r!==void 0?r:[],n.point,n.rect,n.offset)})}),i=[];i.push(e[0].bound);for(let n=1;n<=e.length-1;n++){const r=e[n],a=r.bound;let o=i.some(l=>qP(l,a));if(r.anchorCandidates)if(o&&((t=r.anchorCandidates)===null||t===void 0?void 0:t.length)>0){for(let l=0;l<r.anchorCandidates.length;l++){const h=r.anchorCandidates[l],d={x1:h.x,y1:h.y,x2:h.x+a.x2-a.x1,y2:h.y+a.y2-a.y1,anchor:h};if(!i.some(u=>qP(u,d))){i.push(d),o=!1;break}}o&&i.push(r.bound)}else i.push(r.bound)}return i.map(n=>fat(n))}function _at(s,t,e){const i=s.map(h=>h.pointCoord),{x1:n,x2:r,y1:a,y2:o}=Lj(i),l=e([(n+r)/2,(a+o)/2]);return l?I2(s.map(h=>{const d=h.rect,u=L2(t,h.pointCoord)?e(mat(t,[h.pointCoord.x,h.pointCoord.y],ZP(JP(h.point,l)))):h.point;u&&(d.x=u.x,d.y=u.y);const c=ZP(JP(h.point,l));let p;const g=[];return c>=-45&&c<45?(p="top",g.push("left","right")):c>=45&&c<135?p="right":c>=-135&&c<-45?(p="left",g.push("left")):(p="bottom",g.push("left","right")),h.anchors=g,h.offset=20,h.rect=WA(h.rect,p,0),h})):[]}function ZP(s){return s>180?s-360:s}function JP(s,t){return 180*Math.atan2(s.y-t.y,s.x-t.x)/Math.PI+90}function mat(s,t,e,i=200){const n=5621/i;let r=t;for(let a=1;a<=n;a++){const o=$j(r,i,e);if(!L2(s,o))return[o.x,o.y];r=[o.x,o.y]}return t}function L2(s,t){for(let e=0;e<s.length;e++)if(Uj(t,s[e]))return!0;return!1}function WA(s,t,e=0){const i=Object.assign({},s);return t==="top"?(i.x-=s.width/2,i.y-=e+s.height/2):t==="bottom"?(i.x-=s.width/2,i.y+=e-s.height/2):t==="left"?(i.x-=e+s.width,i.y-=s.height/2):t==="right"&&(i.x+=e,i.y-=s.height/2),i}function vat(s,t,e,i=0){const n=[];return s.forEach(r=>{const{x:a,y:o}=WA(Object.assign(Object.assign({},t),{width:e.width,height:e.height}),r,i);n.push({x:a,y:o})}),n}class q_ extends bs{constructor(){super(...arguments),this.type=Z.mapLabel,this.name=Z.mapLabel,this.specKey="mapLabel",this.layoutType="none",this.layoutZIndex=ce.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){const e=t[this.specKey];return e&&e.visible&&!E(e.series)?[{spec:e,specPath:[this.specKey],type:Z.mapLabel}]:null}setAttrFromSpec(){var t,e,i,n;this.nameField=(t=this._spec.nameField)!==null&&t!==void 0?t:(e=this._series)===null||e===void 0?void 0:e.getDimensionField()[0],this.valueField=(i=this._spec.valueField)!==null&&i!==void 0?i:(n=this._series)===null||n===void 0?void 0:n.getMeasureField()[0]}created(){super.created(),this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,n,r,a,o,l;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],this._spec.position==="outer"&&(this._map=(e=(t=this._regions[0].getSeriesInType("map")[0])===null||t===void 0?void 0:t.getMapViewData())===null||e===void 0?void 0:e.latestData,this._longitudeField=(r=(n=(i=this._regions[0]).getSpec)===null||n===void 0?void 0:n.call(i))===null||r===void 0?void 0:r.longitudeField,this._latitudeField=(l=(o=(a=this._regions[0]).getSpec)===null||o===void 0?void 0:o.call(a))===null||l===void 0?void 0:l.latitudeField)}initData(){const t=this._series;if(!t)return;const e=t.getViewData();if(e){const i=new Jt(this._option.dataSet,{name:`${this.name}_data`});i.parse([e],{type:"dataview"}),i.transform({type:"copyDataView",level:Hs.copyDataView},!1),this._data=new Ur(this._option,i),i.target.addListener("change",()=>{this._spec.trigger!=="hover"&&this._spec.trigger!=="click"&&(this._activeDatum=this._data.getLatestData())})}}initEvent(){this.event.on("zoom",{filter:e=>this._isRelativeModel(e.model)},e=>(this.handleZoom(e),!0)),this.event.on("panmove",{filter:e=>this._isRelativeModel(e.model)},e=>(this.handlePan(e),!0));const t=this._spec.trigger;t!=="none"&&(t==="hover"?(this.event.on("hovered",{filter:e=>this._isRelativeSeries(e.model)},e=>{this._updateDatum(e.value)}),this.event.on("unhovered",()=>{this._updateDatum([])})):t==="click"&&(this.event.on("selected",{filter:e=>this._isRelativeSeries(e.model)},e=>{this._updateDatum(e.value)}),this.event.on("unselected",()=>{this._updateDatum([])})))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach(i=>{i.translate(e[0],e[1])})}handleZoom(t){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach((e,i)=>{var n;const r=(n=this._data)===null||n===void 0?void 0:n.getLatestData()[i];this._activeDatum.includes(r)?e.setAttribute("visible",!0):e.setAttribute("visible",!1)})}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=(t=this._data)===null||t===void 0?void 0:t.getLatestData();e&&e.length!==0&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=(t=this._data)===null||t===void 0?void 0:t.getLatestData().map((r,a)=>{var o;const l=new GS({position:void 0});return l&&(l.name=`${this.name}_marker_${a}`,l.id=(o=this._spec.id)!==null&&o!==void 0?o:`${this.name}_marker_${this.id}`,l.setAttribute("zIndex",this.layoutZIndex)),l})),this._markerComponents.forEach((r,a)=>{r.removeAllChild();const{pairInfo:o,contentMarks:l}=this._evaluateMarker(this._data.getLatestData()[a],a);o&&e.push(o),l&&i.push(l)});const n=this._layoutLabels(e);this._layoutMarkers(n,i),this._renderMarkers()}_evaluateMarker(t,e){var i,n,r,a,o,l,h,d,u,c,p,g;let f=0,_=0,m=0,v=0,y=0;const b=this._spec.position||"top",x=this._spec.offset,S=Hr((i=this._spec.background)===null||i===void 0?void 0:i.padding),A=this._spec.space||0;_+=((S==null?void 0:S.left)||0)+((S==null?void 0:S.right)||0),m+=((S==null?void 0:S.top)||0)+((S==null?void 0:S.bottom)||0);const k={},w=this.dataToPosition(t),T=oS({});if(T.name=`${this.name}_marker_itemContainer_${e}`,k.container=T,(n=this._spec.background)===null||n===void 0?void 0:n.visible){const O=Ch(wt(Object.assign({},this._spec.background.style)));O.setAttributes(w),k.labelBackground=O,T.appendChild(O)}if(!((r=this._spec.icon)===null||r===void 0)&&r.visible){const O=ym(wt(Object.assign({},this._spec.icon.style)));O.setAttributes(w),O.setAttribute("symbolType",(a=this._spec.icon.style)===null||a===void 0?void 0:a.shape);const L=O.AABBBounds,D=(o=(L==null?void 0:L.y2)-(L==null?void 0:L.y1))!==null&&o!==void 0?o:0,j=(l=(L==null?void 0:L.x2)-(L==null?void 0:L.x1))!==null&&l!==void 0?l:0;k.icon=O,T.appendChild(O),y=D,v+=j,f++}if(!((h=this._spec.nameLabel)===null||h===void 0)&&h.visible){const O=Mo(wt(Object.assign({},this._spec.nameLabel.style)));O.setAttributes(w),O.setAttribute("text",t[this.nameField]);const L=O.AABBBounds,D=(d=(L==null?void 0:L.y2)-(L==null?void 0:L.y1))!==null&&d!==void 0?d:0,j=(u=(L==null?void 0:L.x2)-(L==null?void 0:L.x1))!==null&&u!==void 0?u:0;k.nameLabel=O,T.appendChild(O),y=Math.max(y,D),v+=j,f++}if(!((c=this._spec.valueLabel)===null||c===void 0)&&c.visible&&E(t[this.valueField])){const O=Mo(wt(Object.assign({},this._spec.valueLabel.style)));O.setAttributes(w),O.setAttribute("text",t[this.valueField]);const L=O.AABBBounds,D=(p=(L==null?void 0:L.y2)-(L==null?void 0:L.y1))!==null&&p!==void 0?p:0,j=(g=(L==null?void 0:L.x2)-(L==null?void 0:L.x1))!==null&&g!==void 0?g:0;k.valueLabel=O,T.appendChild(O),y=Math.max(y,D),v+=j,f++}const M=Object.values(k).find(O=>!!O&&O.type!=="group"),C={x:M==null?void 0:M.getComputedAttribute("x"),y:M==null?void 0:M.getComputedAttribute("y")},R={x:C.x,y:C.y,width:0,height:0};R.width=_+v+(f-1)*A,R.height=m+y;const I={rect:R,point:C,index:e};if(b!=="outer"){const O=["top","right","left","bottom"].filter(L=>L!==b);I.rect=WA(R,b,x),I.anchors=O,I.offset=x}else I.pointCoord={x:+(t==null?void 0:t[this._longitudeField]),y:+(t==null?void 0:t[this._latitudeField])};return{pairInfo:I,contentMarks:k}}_layoutMarkers(t,e){var i,n,r;for(let a=0;a<e.length;a++){if(!t[a]||!e[a])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:d,container:u}=e[a],c=t[a],p=Hr((i=this._spec.background)===null||i===void 0?void 0:i.padding),g=this._spec.space||0,f=c.height/2;let _=(p==null?void 0:p.left)||0;[o,l,h].forEach((x,S)=>{var A,k;if(x){const w=x.AABBBounds;let T=0;x.type==="symbol"&&(T+=((A=w.x2-w.x1)!==null&&A!==void 0?A:0)/2),x.setAttributes({x:_+T,y:f}),_+=(k=w.x2-w.x1)!==null&&k!==void 0?k:0,S!==2&&(_+=g)}}),d==null||d.setAttributes({x:0,y:0,width:c.width,height:c.height}),u==null||u.setAttributes({dx:-c.width/2,dy:-c.height/2});const m=this._data.getLatestData()[a],v=this.dataToPosition(m),y=this.getRegions()[0].getLayoutStartPoint(),b=!(!(!((n=this._spec.leader)===null||n===void 0)&&n.visible)||!(o||l||h));this._markerComponents[a].setAttributes({x:y.x,y:y.y,position:v,visible:this._activeDatum.includes(m),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>u,autoRotate:!1,offsetX:c.x+c.width/2-v.x,offsetY:c.y+c.height/2-v.y},itemLine:{visible:b,type:"type-po",lineStyle:wt(Object.assign({},(r=this._spec.leader)===null||r===void 0?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return this._spec.position==="outer"&&this._map?_at(t,this._map,e=>this._series.dataToPosition({[this._longitudeField]:e[0],[this._latitudeField]:e[1]})):I2(t)}_isRelativeModel(t){var e,i,n;const r=(i=(e=this._series.getXAxisHelper())===null||e===void 0?void 0:e.getAxisId())!==null&&i!==void 0?i:(n=this._series.getCoordinateHelper())===null||n===void 0?void 0:n.getCoordinateId();return(t==null?void 0:t.id)===r}_isRelativeSeries(t){return(t==null?void 0:t.id)===this._series.id}onRender(t){}changeRegions(){}_getNeedClearVRenderComponents(){return this._markerComponents}}q_.type=Z.mapLabel,q_.specKey="mapLabel";const yat=()=>{F.registerComponent(q_.type,q_)};class Px{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=e==null?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,n;t.col=(e=t.col)!==null&&e!==void 0?e:1,t.row=(i=t.row)!==null&&i!==void 0?i:1,t.elements=(n=t.elements)!==null&&n!==void 0?n:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}),this._rowSize.forEach((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})}setSizeFromUserSetting(t,e,i,n){t.forEach(r=>{r.index<0&&r.index>=i||(N(r.size)?e[r.index]={value:+r.size,isUserSetting:!0,isLayoutSetting:!1}:K(r.size)&&(e[r.index]={value:r.size(n),isUserSetting:!0,isLayoutSetting:!1}))})}clearLayoutSize(){this._colSize.forEach(t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}),this._rowSize.forEach(t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let n;return n=(e=this._gridInfo.elements)===null||e===void 0?void 0:e.find(r=>{var a;if("modelId"in r&&E(r.modelId)){if(E(t.model.userId)&&t.model.userId===r.modelId)return!0}else if("modelKey"in r&&E(r.modelKey)&&"modelIndex"in r&&E(r.modelIndex)&&((a=t.model.specKey)!==null&&a!==void 0?a:t.model.type)===r.modelKey&&t.model.getSpecIndex()===r.modelIndex)return!0;return!1}),n||(n={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,n),n}getSizeFromGird(t,e){var i;const n=e==="col"?this._colSize:this._rowSize;let r=0;for(let a=t[e];a<t[e]+((i=t[`${e}Span`])!==null&&i!==void 0?i:1);a++)r+=n[a].value;return r}getSizeFromUser(t,e){var i,n;const r=e==="col"?this._colSize:this._rowSize;if(!(!((i=r[t[e]])===null||i===void 0)&&i.isUserSetting))return;let a=0;for(let o=t[e];o<t[e]+((n=t[`${e}Span`])!==null&&n!==void 0?n:1);o++){if(!r[o].isUserSetting)return;a+=r[o].value}return a}setItemLayoutSizeToGrid(t,e){if(wd(t)){if(e.colSpan&&e.colSpan>1||this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1||this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e=t==="col"?this._colSize:this._rowSize;let i=t==="col"?this._chartLayoutRect.width:this._chartLayoutRect.height;const n=[];e.forEach(r=>{r.isUserSetting||r.isLayoutSetting?i-=r.value:n.push(r)}),i<0&&console.warn(`layout content ${t} size bigger than chart`),n.forEach(r=>r.value=i/n.length)}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let n=0;n<e.col;n++)i.x+=this._colSize[n].value;for(let n=0;n<e.row;n++)i.y+=this._rowSize[n].value;return i.x+=t.layoutPaddingLeft+t.layoutOffsetX,i.y+=t.layoutPaddingTop+t.layoutOffsetY,i}getItemLayoutRect(t){var e,i;const n=this.getItemGridInfo(t);return{width:((e=this.getSizeFromGird(n,"col"))!==null&&e!==void 0?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:((i=this.getSizeFromGird(n,"row"))!==null&&i!==void 0?i:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom}}layoutItems(t,e,i,n){this._chartLayoutRect=i,this._chartViewBox=n,this.clearLayoutSize(),e.sort((u,c)=>c.layoutLevel-u.layoutLevel);const r=e.filter(u=>u.layoutType==="normal"&&u.getModelVisible()!==!1),a=r.filter(u=>wd(u)),o=r.filter(u=>!wd(u));r.forEach(u=>{this.layoutOneItem(u,"user",!1)});const l=e.filter(u=>u.layoutType==="region-relative"),h=l.filter(u=>wd(u)),d=l.filter(u=>!wd(u));h.forEach(u=>this.layoutOneItem(u,"user",!1)),this.layoutGrid("col"),o.forEach(u=>this.layoutOneItem(u,"colGrid",!1)),d.forEach(u=>{this.layoutOneItem(u,"colGrid",!1)}),this.layoutGrid("row"),d.forEach(u=>{this.layoutOneItem(u,"grid",!1)}),a.forEach(u=>this.layoutOneItem(u,"grid",!1)),h.forEach(u=>{this.layoutOneItem(u,"grid",!0)}),this.layoutGrid("col"),e.filter(u=>u.layoutType==="region").forEach(u=>this.layoutOneItem(u,"grid",!1)),this.layoutAbsoluteItems(e.filter(u=>u.layoutType==="absolute")),e.filter(u=>u.layoutType!=="absolute").forEach(u=>{u.setLayoutStartPosition(this.getItemPosition(u))})}layoutAbsoluteItems(t){t.forEach(e=>{e.absoluteLayoutInRect(this._chartLayoutRect)})}layoutOneItem(t,e,i){var n,r;const a=e==="rowGrid"||e==="grid"?this.getSizeFromGird.bind(this):this.getSizeFromUser.bind(this),o=e==="colGrid"||e==="grid"?this.getSizeFromGird.bind(this):this.getSizeFromUser.bind(this),l=this.getItemGridInfo(t),h={width:((n=o(l,"col"))!==null&&n!==void 0?n:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:((r=a(l,"row"))!==null&&r!==void 0?r:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},d=t.computeBoundsInRect(h);N(d.width)||(d.width=h.width),N(d.height)||(d.height=h.height),t.setLayoutRect(e!=="grid"?d:h),this.setItemLayoutSizeToGrid(t,l)}}function wd(s){return s.layoutOrient==="left"||s.layoutOrient==="right"}Px.type="grid";const bat=()=>{F.registerLayout(Px.type,Px)};class Ex extends lA{layoutItems(t,e,i,n){this._layoutInit(t,e,i,n),this._layoutNormalItems(e);const r={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},a=e.filter(m=>m.layoutType==="absolute"),o=a.filter(m=>m.layoutOrient==="z");let l={width:0,height:0};o.length&&(l=o[0].getLayoutRect()),this.leftCurrent+=l.width/8,this.rightCurrent-=l.width/8,this.topCurrent+=l.height/8,this.bottomCurrent-=l.height/8;const{regionItems:h,relativeItems:d,relativeOverlapItems:u,allRelatives:c,overlapItems:p}=this._groupItems(e);this.layoutRegionItems(h,d,u,p),this._processAutoIndent(h,d,u,p,c,r);const g=a.filter(m=>m.layoutOrient!=="z");this.layoutAbsoluteItems(g);const f=d.filter(m=>m.model.specKey==="axes"&&Fe(m.layoutOrient))[0],_=d.filter(m=>m.model.specKey==="axes"&&Mr(m.layoutOrient))[0];if(f&&o.length){const m=f.getLayoutStartPoint(),v=f.getLayoutRect(),y={x:_.layoutOrient==="left"?m.x+v.width:m.x,y:m.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};o[0].model.directionStr=_.layoutOrient==="left"?"r2l":"l2r";const b=f.getLayoutRect(),x=_.getLayoutRect(),S={length:o[0].getLayoutRect().width,width:b.width,height:x.height};f.model.setLayout3dBox&&f.model.setLayout3dBox(S),_.model.setLayout3dBox&&_.model.setLayout3dBox(S),o[0].model.setLayout3dBox&&o[0].model.setLayout3dBox(S),this.layoutZAxisItems(o,y)}}layoutZAxisItems(t,e){t.forEach(i=>{i.absoluteLayoutInRect(e)})}getItemComputeLayoutRect(t,e){return e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0}),{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,n=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach(r=>{if(!r.getModelVisible()||!r.autoIndent)return;const a=r.layoutOrient==="left"||r.layoutOrient==="right",o=r.getLastComputeOutBounds();a?(e.top=Math.max(e.top,o.y1-this.topCurrent),e.bottom=Math.max(e.bottom,o.y2-n)):(e.left=Math.max(e.left,o.x1-this.leftCurrent),e.right=Math.max(e.right,o.x2-i))}),e}}Ex.type="layout3d";const xat=()=>{F.registerLayout(Ex.type,Ex)},Sat=()=>{EY()};an.useRegisters([iQ,dQ,fQ,kQ,Wst,Ust,$st,qst,Gst,Qst,tnt,ent,nnt,cnt,pnt,Jst,ant,ont,fnt,hnt,dnt,unt,gnt,_nt,Kst,mnt,Yst,_Q,Vst,Zst,rnt,lnt,int,snt,Tnt,Mnt,Cnt,Pnt,Ent,Ont,Rnt,Fnt,Unt,wrt,Crt,Prt,Ert,Rrt,Irt,hD,dat,Yrt,Krt,Xrt,Qrt,oat,hat,uat,pat,yat,Sat,bat,xat]);var Aat=function(s,t){var e={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&t.indexOf(i)<0&&(e[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(s);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(e[i[n]]=s[i[n]])}return e};function kat(s,t="ChartContainer",e){const i=ds.forwardRef((n,r)=>{const a=ot.useRef(),[o,l]=ot.useState(!1),{className:h,style:d,width:u}=n,c=Aat(n,["className","style","width"]);return ot.useLayoutEffect(()=>{l(!0)},[]),ds.createElement("div",{ref:a,className:h,style:Object.assign({position:"relative",height:n.height||"100%",width:n.width||"100%"},d)},o?ds.createElement(s,Object.assign({ref:r,container:a.current},e?e(c):c)):ds.createElement(ds.Fragment,null))});return i.displayName=t||s.name,i}const B2=ds.createContext(null);B2.displayName="ChartContext";const D2=ds.createContext(null);D2.displayName="ViewContext";const F2=s=>{let t=[];return ds.Children.forEach(s,e=>{P(e)||(zF.isFragment(e)?t=t.concat(F2(e.props.children)):t.push(e))}),t},wat=["children","hooks","ref"],bc={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},Tat={onLegendItemHover:"legendItemHover",onLegendItemUnHover:"legendItemUnHover",onLegendItemClick:"legendItemClick",onLegendFilter:"legendFilter",onLegendSelectedDataChange:"legendSelectedDataChange"},Mat={onBrushStart:"brushStart",onBrushChange:"brushChange",onBrushEnd:"brushEnd",onBrushClear:"brushClear"},Cat={onDataZoomChange:"dataZoomChange"},Pat={onPlayerPlay:"playerPlay",onPlayerPause:"playerPause",onPlayerEnd:"playerEnd",onPlayerChange:"playerChange",onPlayerForward:"playerForward",onPlayerBackward:"playerBackward"},Eat={onScrollBarChange:"scrollBarChange"},Rat={onDimensionHover:"dimensionHover",onDimensionClick:"dimensionClick"},Oat={onDrill:"drill"},Iat={onInitialized:"initialized",onRendered:"rendered",onRenderFinished:"renderFinished",onAnimationFinished:"animationFinished",onLayoutStart:"layoutStart",onLayoutEnd:"layoutEnd"},Rx=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Tat),Mat),Pat),Cat),Eat),Rat),Iat),Oat),bc),Lat=Object.keys(Rx);Object.keys(bc).reduce((s,t)=>(s[bc[t]]=t,s),{});const QP=(s,t=bc)=>{const e={};return Object.keys(s).forEach(i=>{t[i]&&(e[i]=s[i])}),e},tE=(s,t,e,i=bc)=>{if(!t&&!e||!s)return!1;const n=e?QP(e,i):null,r=t?QP(t,i):null;return n&&Object.keys(n).forEach(a=>{(!r||!r[a]||r[a]!==n[a])&&s.off(i[a],e[a])}),r&&Object.keys(r).forEach(a=>{n&&n[a]&&n[a]===r[a]||s.on(i[a],r[a])}),!0},eE=[...wat,...Lat,"skipFunctionDiff","onError","onReady","spec","container","options"],Bat=ds.forwardRef((s,t)=>{const[e,i]=ot.useState(0),n=ot.useRef({specFromChildren:{}});ot.useImperativeHandle(t,()=>{var f;return(f=n.current)===null||f===void 0?void 0:f.chart});const r=!!s.spec,[a,o]=ot.useState(null),l=ot.useRef(!1),h=ot.useRef(yh(s,eE)),d=ds.useRef(null),u=!!s.skipFunctionDiff,c=!!s.useSyncRender,p=f=>{var _;return r&&f.spec?f.spec:Object.assign(Object.assign({},h.current),(_=n.current)===null||_===void 0?void 0:_.specFromChildren)},g=()=>{if(!l.current){if(!n.current||!n.current.chart)return;tE(n.current.chart,s,d.current,Rx);const f=n.current.chart.getCompiler().getVGrammarView();i(e+1),s.onReady&&s.onReady(n.current.chart,e===0),o(f)}};return ot.useEffect(()=>{var f;if(!(!((f=n.current)===null||f===void 0)&&f.chart))return(m=>{const v=new m.vchartConstrouctor(p(m),Object.assign(Object.assign({},m.options),{onError:m.onError,autoFit:!0,dom:m.container}));n.current=Object.assign(Object.assign({},n.current),{chart:v})})(s),n.current.chart&&(c?(n.current.chart.renderSync(),g()):n.current.chart.renderAsync().then(g)),tE(n.current.chart,s,null,Rx),n.current=Object.assign(Object.assign({},n.current),{isChildrenUpdated:!1}),void(d.current=s);if(r)return void(Se(d.current.spec,s.spec,{skipFunction:u})||(d.current=s,c?(n.current.chart.updateSpecSync(p(s),void 0,{morph:!1,enableExitAnimation:!1}),g()):n.current.chart.updateSpec(p(s),void 0,{morph:!1,enableExitAnimation:!1}).then(g)));const _=yh(s,eE);Se(_,h.current,{skipFunction:u})&&!n.current.isChildrenUpdated||(h.current=_,c?(n.current.chart.updateSpecSync(p(s),void 0,{morph:!1,enableExitAnimation:!1}),g()):n.current.chart.updateSpec(p(s),void 0,{morph:!1,enableExitAnimation:!1}).then(g)),n.current=Object.assign(Object.assign({},n.current),{isChildrenUpdated:!1})},[s]),ot.useEffect(()=>()=>{n&&(n.current.chart&&n.current.chart.release(),n.current=null),l.current=!0},[]),ds.createElement(B2.Provider,{value:n.current},ds.createElement(D2.Provider,{value:a},F2(s.children).map((f,_)=>{var m,v,y;return ds.createElement(ds.Fragment,{key:(y=(v=(m=f==null?void 0:f.props)===null||m===void 0?void 0:m.id)!==null&&v!==void 0?v:f==null?void 0:f.id)!==null&&y!==void 0?y:`child-${_}`},ds.cloneElement(f,{updateId:e}))})))}),Dat=(s,t,e)=>{const i=kat(Bat,s,n=>t?Object.assign(n,t):n);return i.displayName=s,i},rl=Dat("VChart",{vchartConstrouctor:an}),{Text:sg,Title:Fat}=Z_;function Ox(s){const t=Number(s||0);if(!Number.isFinite(t)||t<=0)return 0;const{type:e,rate:i}=Lx();let n=GF();if(n=Number(n),(!Number.isFinite(n)||n<=0)&&(n=parseFloat(localStorage.getItem("quota_per_unit")||"500000")),!Number.isFinite(n)||n<=0)return 0;const r=t/n;return e==="TOKENS"||e==="USD"?r:r*(i||1)}function iy(s){const t=Number(s);if(!Number.isFinite(t))return"";const{symbol:e,type:i}=Lx();return i==="TOKENS"?`$${t.toFixed(2)}`:`${e}${t.toFixed(2)}`}function sy(s){const{type:t,symbol:e}=Lx();return t==="TOKENS"?s("金额约美元"):`${s("金额")}(${e})`}function jat(s,t){var i;const e=[];for(const n of s||[])for(const{key:r,label:a}of t){const o=Number(n[r]??0),l=Number.isFinite(o)?Math.max(0,Math.round(o)):0;e.push({date:((i=n.date)==null?void 0:i.slice(5))||n.date,type:a,value:l})}return e}function zat(s,t){var i;const e=[];for(const n of s||[])for(const{key:r,label:a}of t)e.push({date:((i=n.date)==null?void 0:i.slice(5))||n.date,type:a,value:Ox(n[r]??0)});return e}const iE=s=>{const t=Number(s);return Number.isFinite(t)?String(Math.round(t)):String(s)},Hat=5;function Nat({adminMode:s=!1}){const{t}=xc(),[e,i]=ot.useState(!0),[n,r]=ot.useState(30),[a,o]=ot.useState([]),[l,h]=ot.useState([]),[d,u]=ot.useState([]),[c,p]=ot.useState([]),[g,f]=ot.useState([]),[_,m]=ot.useState(0),v=ot.useCallback(async()=>{i(!0);try{const T=s?`/api/distributor/admin/analytics?days=${n}`:`/api/distributor/analytics?days=${n}`,M=await _i.get(T),{success:C,message:R,data:I}=M.data||{};if(!C){Qt(R||t("加载失败"));return}o((I==null?void 0:I.series)||[]),s?(u((I==null?void 0:I.top_total_reward)||[]),p((I==null?void 0:I.top_period_reward)||[]),f((I==null?void 0:I.top_invitee_count)||[]),h([])):(h((I==null?void 0:I.top_invitees)||[]),m((I==null?void 0:I.effective_commission_bps)??0),u([]),p([]),f([]))}catch{Qt(t("加载失败"))}finally{i(!1)}},[s,n,t]);ot.useEffect(()=>{v()},[v]);const y=ot.useMemo(()=>{const T=a||[];return T.length<=7?T:T.slice(T.length-7)},[a]),b=ot.useMemo(()=>{const T=["short_link_clicks","register_page_views","new_registrations"];let M=0;for(const C of y||[])for(const R of T)M=Math.max(M,Math.round(Number(C[R]??0)));return Math.max(5,M)},[y]),x=ot.useMemo(()=>{const T=[{key:"short_link_clicks",label:t("邀请链接点击")},{key:"register_page_views",label:t("注册页浏览")},{key:"new_registrations",label:t("新增邀请注册")}],M=jat(y,T);return{type:"line",title:{visible:!1},data:{values:M},xField:"date",yField:"value",seriesField:"type",legends:{visible:!0,orient:"bottom"},point:{visible:!0},axes:[{orient:"bottom",label:{formatMethod:C=>String(C)}},{orient:"left",title:{visible:!0,text:t("次数")},label:{formatMethod:iE},min:0,max:b,tick:{tickMode:"d3"}}]}},[y,t,b]),S=ot.useMemo(()=>{const T=[{key:"reward_quota",label:t("分销收益金额")},{key:"invitee_quota_added",label:t("下级充值入账金额")}],M=zat(a,T);return{type:"line",title:{visible:!1},data:{values:M},xField:"date",yField:"value",seriesField:"type",legends:{visible:!0,orient:"bottom"},point:{visible:!0},axes:[{orient:"bottom"},{orient:"left",title:{visible:!0,text:sy(t)},label:{formatMethod:iy},min:0}]}},[a,t]),A=ot.useMemo(()=>{const T=(l||[]).slice(0,10),M=new Array(10).fill(null);for(let C=0;C<T.length;C++)M[C]=T[C];return M},[l]),k=ot.useMemo(()=>{const T=C=>`Top ${C+1}`,M=A.map((C,R)=>{if(!C)return{name:`${T(R)} ${t("虚位以待")}`,value:0,idx:R};const I=String(C.display_name||C.username||`#${C.invitee_user_id}`).slice(0,12);return{name:`${T(R)} ${I}`,value:Ox(C.total_reward_quota||0),idx:R}});return{type:"bar",title:{visible:!1},data:{values:M},xField:"name",yField:"value",axes:[{orient:"bottom",label:{autoRotate:!0}},{orient:"left",title:{visible:!0,text:sy(t)},label:{formatMethod:iy},min:0}]}},[A,t]),w=ot.useCallback((T,M,C)=>{const R=[...T||[]];for(;R.length<Hat;)R.push(null);const I=L=>`Top ${L+1}`,O=R.map((L,D)=>{if(!L)return{name:`${I(D)} ${t("虚位以待")}`,value:0,idx:D};const j=String(L.username||L.display_name||`#${L.user_id}`).slice(0,10);return{name:`${I(D)} ${j}`,value:C?Ox(L[M]??0):Math.max(0,Math.round(Number(L[M]??0))),idx:D}});return{type:"bar",title:{visible:!1},data:{values:O},xField:"name",yField:"value",axes:[{orient:"bottom",label:{autoRotate:!0}},{orient:"left",title:{visible:!0,text:C?sy(t):t("邀请人数")},label:{formatMethod:C?iy:iE},min:0}]}},[t]);return B.jsxs("div",{className:"space-y-6 w-full",children:[B.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[B.jsxs("div",{children:[B.jsxs(Fat,{heading:5,className:"!mb-1 flex items-center gap-2",children:[B.jsx(HF,{size:18}),t(s?"分销数据大盘":"数据看板")]}),!s&&_>0?B.jsxs(sg,{type:"tertiary",size:"small",children:[t("当前默认分销比例"),":",al(_)]}):null]}),B.jsxs(RF,{children:[B.jsx(sg,{type:"tertiary",size:"small",children:t("统计区间")}),B.jsx(ke,{value:n,onChange:T=>r(Number(T)),style:{width:120},optionList:[{label:t("近7日"),value:7},{label:t("近30日"),value:30},{label:t("近90日"),value:90}]})]})]}),B.jsx(OF,{spinning:e,children:B.jsxs("div",{className:"flex flex-col gap-6",children:[B.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-6",children:[B.jsx(Xo,{title:B.jsxs("span",{className:"flex items-center gap-2",children:[B.jsx(u1,{size:16}),t("近7日流量与注册")]}),className:"!rounded-2xl",bodyStyle:{paddingBottom:8},children:B.jsx("div",{className:"h-80",children:B.jsx(rl,{spec:x,option:Ko})})}),B.jsx(Xo,{title:B.jsxs("span",{className:"flex items-center gap-2",children:[B.jsx(u1,{size:16}),t("收益与充值带动"),B.jsxs(sg,{type:"tertiary",size:"small",className:"!font-normal",children:["(",t("所选区间")," · ",t("金额为展示货币"),")"]})]}),className:"!rounded-2xl",bodyStyle:{paddingBottom:8},children:B.jsx("div",{className:"h-80",children:B.jsx(rl,{spec:S,option:Ko})})})]}),s?B.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[B.jsx(Xo,{title:t("代理累计收益 TOP"),className:"!rounded-2xl",bodyStyle:{paddingBottom:8},children:B.jsx("div",{className:"h-64",children:B.jsx(rl,{spec:w(d,"total_reward_quota",!0),option:Ko})})}),B.jsx(Xo,{title:t("代理近30日收益 TOP"),className:"!rounded-2xl",bodyStyle:{paddingBottom:8},children:B.jsx("div",{className:"h-64",children:B.jsx(rl,{spec:w(c,"total_reward_quota",!0),option:Ko})})}),B.jsx(Xo,{title:t("代理邀请人数 TOP"),className:"!rounded-2xl",bodyStyle:{paddingBottom:8},children:B.jsx("div",{className:"h-64",children:B.jsx(rl,{spec:w(g,"invitee_count",!1),option:Ko})})})]}):B.jsxs(Xo,{title:B.jsxs("span",{className:"flex items-center gap-2",children:[B.jsx(NF,{size:16}),t("被邀请人收益 TOP10")]}),className:"!rounded-2xl",bodyStyle:{paddingBottom:8},children:[B.jsx(sg,{type:"tertiary",size:"small",className:"block mb-2",children:t("按累计分销收益排序;纵轴为展示货币金额。")}),B.jsx("div",{className:"h-72",children:B.jsx(rl,{spec:k,option:Ko})})]})]})})]})}const{Text:Fo}=Z_;function _v(s){return/\.pdf(\?|$)/i.test(s||"")}function Gat(s,t){try{const i=new URL(s,window.location.origin).pathname.split("/").filter(Boolean).pop();if(i)return decodeURIComponent(i)}catch{}return t}async function Wat(s,t){const e=String(s||"").trim();if(!e)return;const i=t||"download";try{const n=await fetch(e,{mode:"cors"});if(!n.ok)throw new Error("fetch failed");const r=await n.blob(),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=i,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)}catch{const n=document.createElement("a");n.href=e,n.download=i,n.target="_blank",n.rel="noopener noreferrer",document.body.appendChild(n),n.click(),n.remove()}}function os({label:s,value:t}){const e=t!=null?String(t).trim():"";return e?B.jsxs("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:gap-2",children:[B.jsx(Fo,{type:"tertiary",size:"small",className:"sm:w-36 flex-shrink-0",children:s}),B.jsx(Fo,{size:"small",className:"break-all",children:e})]}):null}function Vat({label:s,url:t,onPreview:e}){const i=String(t||"").trim();if(!i)return null;const n=_v(i);return B.jsxs("div",{className:"flex items-center gap-2",children:[B.jsx(Fo,{type:"tertiary",size:"small",className:"w-36 flex-shrink-0",children:s}),B.jsx("button",{type:"button",className:"text-sm text-[var(--semi-color-link)] hover:underline",onClick:()=>{n?window.open(i,"_blank","noopener,noreferrer"):e==null||e(i)},children:n?"PDF":s})]})}function sE({label:s,url:t}){const{t:e}=xc(),i=String(t||"").trim();if(!i)return null;const n=_v(i),r=Gat(i,n?"invoice.pdf":"invoice");return B.jsxs("div",{className:"inline-flex w-28 flex-col gap-1.5",children:[B.jsx(Fo,{type:"tertiary",size:"small",className:"leading-tight",children:s}),B.jsx("button",{type:"button",className:"relative h-28 w-28 shrink-0 cursor-pointer overflow-hidden rounded-lg border border-[var(--semi-color-border)] bg-[var(--semi-color-fill-0)] p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--semi-color-primary)]",onClick:()=>Wat(i,r),title:e("点击下载"),children:n?B.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center",children:[B.jsx(Ix,{size:"large"}),B.jsx("span",{className:"mt-1 text-xs text-[var(--semi-color-text-2)]",children:"PDF"})]}):B.jsx("img",{src:i,alt:s,className:"h-full w-full object-cover"})})]})}function Td({label:s,url:t,onPreview:e}){const{t:i}=xc(),n=String(t||"").trim();return n?_v(n)?B.jsx(Vat,{label:s,url:n,onPreview:e}):B.jsxs("div",{className:"inline-flex w-28 flex-col gap-1.5",children:[B.jsx(Fo,{type:"tertiary",size:"small",className:"leading-tight",children:s}),B.jsx("button",{type:"button",className:"relative h-28 w-28 shrink-0 cursor-zoom-in overflow-hidden rounded-lg border border-[var(--semi-color-border)] bg-[var(--semi-color-fill-0)] p-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--semi-color-primary)]",onClick:()=>e==null?void 0:e(n),title:i("点击放大"),children:B.jsx("img",{src:n,alt:s,className:"h-full w-full object-cover"})})]}):null}function Uat({row:s,onImagePreview:t}){const{t:e}=xc(),i=$F(s),n=YF(s==null?void 0:s.voucher_urls),r=i.account_type;return B.jsxs("div",{className:"space-y-4 text-sm",children:[B.jsxs(Fo,{strong:!0,children:[e("账户类型"),":",XF(e,r)]}),r===KF?B.jsxs(B.Fragment,{children:[B.jsx(os,{label:e("企业名称"),value:i.real_name}),B.jsx(os,{label:e("统一社会信用代码"),value:i.credit_code}),B.jsx(os,{label:e("法人姓名"),value:i.legal_person_name}),B.jsx(os,{label:e("法人手机号"),value:i.legal_person_phone}),B.jsx(os,{label:e("对公卡号"),value:i.bank_account}),B.jsx(os,{label:e("开户行"),value:i.bank_name}),B.jsx(os,{label:e("联行号"),value:i.bank_branch_code}),B.jsx(os,{label:e("联系人"),value:i.contact_person}),B.jsxs("div",{className:"flex flex-wrap gap-4 pt-1",children:[B.jsx(Td,{label:e("营业执照"),url:i.business_license_url,onPreview:t}),B.jsx(Td,{label:e("对公账户证明"),url:i.corporate_account_proof_url,onPreview:t}),B.jsx(sE,{label:e("发票"),url:i.invoice_url})]})]}):B.jsxs(B.Fragment,{children:[B.jsx(os,{label:e("姓名"),value:i.real_name}),B.jsx(os,{label:e("身份证号"),value:i.id_card_no}),B.jsx(os,{label:e("身份证有效期"),value:i.id_card_expiry}),B.jsx(os,{label:e("手机号"),value:i.mobile}),B.jsx(os,{label:e("银行卡号"),value:i.bank_account}),B.jsx(os,{label:e("开户行"),value:i.bank_name}),B.jsx(os,{label:e("银行预留手机号"),value:i.bank_reserved_phone}),B.jsxs("div",{className:"flex flex-wrap gap-4 pt-1",children:[B.jsx(Td,{label:e("身份证正面"),url:i.id_card_front_url,onPreview:t}),B.jsx(Td,{label:e("身份证反面"),url:i.id_card_back_url,onPreview:t}),B.jsx(Td,{label:e("银行卡照"),url:i.bank_card_photo_url,onPreview:t}),B.jsx(sE,{label:e("发票"),url:i.invoice_url})]})]}),n.length>0?B.jsxs("div",{children:[B.jsx(Fo,{type:"tertiary",size:"small",className:"block mb-1",children:e("历史票据")}),B.jsx("div",{className:"flex flex-wrap gap-2",children:n.map((a,o)=>B.jsxs("button",{type:"button",className:"text-xs text-[var(--semi-color-link)]",onClick:()=>{_v(a)?window.open(a,"_blank"):t==null||t(a)},children:[e("附件")," ",o+1]},`lv-${o}`))})]}):null]})}const{Text:De}=Z_,Gn=120,ng=5;function rg(s){if(s==null)return[];if(Array.isArray(s))return s.filter(Boolean);if(typeof s=="string"){const t=s.trim();if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e.filter(Boolean):[]}catch{return[]}}return[]}function j2(s){return/\.pdf(\?|$)/i.test(s||"")}function nE({urls:s,onImagePreview:t,compact:e}){const i=s||[];if(!i.length)return B.jsx(De,{type:"tertiary",size:"small",children:"—"});const n=e?4:12,r=i.slice(0,n),a=i.length-r.length,o=e?"h-10 w-10":"h-24 w-24";return B.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.map((l,h)=>j2(l)?B.jsxs("button",{type:"button",title:"PDF",className:`flex ${o} flex-shrink-0 flex-col items-center justify-center rounded-lg border border-[var(--semi-color-border)] bg-[var(--semi-color-fill-0)] hover:bg-[var(--semi-color-fill-1)]`,onClick:()=>window.open(l,"_blank","noopener,noreferrer"),children:[B.jsx(Ix,{size:e?"default":"large"}),!e&&B.jsx("span",{className:"mt-0.5 text-[10px] text-[var(--semi-color-text-2)]",children:"PDF"})]},`pdf-${h}-${l.slice(-20)}`):B.jsx("button",{type:"button",className:`relative flex-shrink-0 overflow-hidden rounded-lg border border-[var(--semi-color-border)] bg-[var(--semi-color-fill-0)] ${o} cursor-zoom-in p-0`,onClick:()=>t==null?void 0:t(l),children:B.jsx("img",{src:l,alt:"",className:"h-full w-full object-cover"})},`img-${h}-${l.slice(-24)}`)),a>0?B.jsxs("span",{className:"text-xs text-[var(--semi-color-text-2)]",children:["+",a]}):null]})}function rE(s,t){const e=Number(t);return e===1?B.jsx(Gd,{color:"light-blue",size:"small",children:s("待审核")}):e===2?B.jsx(Gd,{color:"green",size:"small",children:s("已通过")}):e===3?B.jsx(Gd,{color:"red",size:"small",children:s("已驳回")}):B.jsx(De,{type:"tertiary",size:"small",children:"—"})}function ag(s,t){const e=Number(t);return e===2?B.jsx(Gd,{color:"orange",size:"small",children:s("企业")}):e===1?B.jsx(Gd,{color:"blue",size:"small",children:s("个人")}):B.jsx(De,{type:"tertiary",size:"small",children:"—"})}function hot(){const{t:s}=xc(),t=WF(),[e,i]=ot.useState("app"),[n,r]=ot.useState(!1),[a,o]=ot.useState([]),[l,h]=ot.useState(0),[d,u]=ot.useState(1),[c,p]=ot.useState(10),[g,f]=ot.useState(""),[_,m]=ot.useState(0),[v,y]=ot.useState(0),[b,x]=ot.useState(!1),[S,A]=ot.useState(null),[k,w]=ot.useState(null),[T,M]=ot.useState(!1),[C,R]=ot.useState(null),[I,O]=ot.useState(""),[L,D]=ot.useState(!1),[j,H]=ot.useState(null),[W,V]=ot.useState("0"),[X,Q]=ot.useState(1e3),[J,nt]=ot.useState(!1),[q,U]=ot.useState([]),[it,ut]=ot.useState(0),[ct,Rt]=ot.useState(1),[mt,Tt]=ot.useState(10),[kt,Lt]=ot.useState(""),[Ot,fi]=ot.useState(0),[Pe,Wi]=ot.useState(!1),[si,xs]=ot.useState(null),[pe,Ae]=ot.useState("0"),[Ms,rs]=ot.useState(!1),[dr,zn]=ot.useState([]),[hi,Be]=ot.useState(0),[oe,Ne]=ot.useState(1),[fn,z2]=ot.useState(10),[Cs,H2]=ot.useState(null),[mv,Kc]=ot.useState(""),[N2,vv]=ot.useState("topup"),[G2,yv]=ot.useState(!1),[qc,W2]=ot.useState(null),[VA,V2]=ot.useState(""),[U2,$2]=ot.useState([]),[Y2,X2]=ot.useState(0),[K2,UA]=ot.useState(1),[$A,YA]=ot.useState(10),[q2,XA]=ot.useState(!1),[Z2,bv]=ot.useState(!1),[J2,KA]=ot.useState(!1),[Q2,qA]=ot.useState(!1),[xv,tF]=ot.useState(null),[eF,iF]=ot.useState(""),[sF,Sv]=ot.useState(!1),[ZA,Av]=ot.useState(null),[kv,Zc]=ot.useState(""),[wv,Jc]=ot.useState(""),[Tv,Qc]=ot.useState(""),[nd,$o]=ot.useState([]),[Yo,tp]=ot.useState(1),[JA,Mv]=ot.useState(null),[QA,t1]=ot.useState(!1),[nF,rF]=ot.useState([]),[aF,oF]=ot.useState(0),[Cv,Pv]=ot.useState(1),[Ev,lF]=ot.useState(10),[ep,e1]=ot.useState(""),[ip,i1]=ot.useState(0),[sp,s1]=ot.useState(0),[hF,Rv]=ot.useState(!1),[np,Ov]=ot.useState(null),[dF,Iv]=ot.useState(!1),[uF,cF]=ot.useState(null),[Lv,Bv]=ot.useState(""),rd=ot.useCallback(async()=>{r(!0);try{const G=new URLSearchParams({p:String(d),page_size:String(c)});g.trim()&&G.set("keyword",g.trim()),_&&G.set("status",String(_)),v&&G.set("apply_type",String(v));const pt=await _i.get(`/api/distributor/admin/applications?${G}`),{success:ae,message:_e,data:Dt}=pt.data;if(!ae){Qt(_e);return}o((Dt==null?void 0:Dt.items)||[]),h((Dt==null?void 0:Dt.total)??0)}catch{Qt(s("加载失败"))}finally{r(!1)}},[d,c,g,_,v,s]),ad=ot.useCallback(async()=>{nt(!0);try{const G=new URLSearchParams({p:String(ct),page_size:String(mt)});kt.trim()&&G.set("keyword",kt.trim()),Ot&&G.set("apply_type",String(Ot));const pt=await _i.get(`/api/distributor/admin/distributors?${G}`),{success:ae,message:_e,data:Dt}=pt.data;if(!ae){Qt(_e);return}U((Dt==null?void 0:Dt.items)||[]),ut((Dt==null?void 0:Dt.total)??0)}catch{Qt(s("加载失败"))}finally{nt(!1)}},[ct,mt,kt,Ot,s]),Dv=ot.useCallback(async()=>{try{const G=await _i.get("/api/status"),{success:pt,data:ae}=G.data||{};pt&&String((ae==null?void 0:ae.distributor_commission_mode)||"").toLowerCase()==="profit_share"?vv("profit_share"):vv("topup")}catch{vv("topup")}},[]);ot.useEffect(()=>{Dv()},[Dv]),ot.useEffect(()=>{e==="app"&&rd()},[e,rd]),ot.useEffect(()=>{e==="dist"&&ad()},[e,ad]);const od=ot.useCallback(async()=>{t1(!0);try{const G=new URLSearchParams({p:String(Cv),page_size:String(Ev)});ep.trim()&&G.set("keyword",ep.trim()),ip&&G.set("status",String(ip)),sp&&G.set("account_type",String(sp));const pt=await _i.get(`/api/distributor/admin/withdrawals?${G}`),{success:ae,message:_e,data:Dt}=pt.data;if(!ae){Qt(_e);return}rF((Dt==null?void 0:Dt.items)||[]),oF((Dt==null?void 0:Dt.total)??0)}catch{Qt(s("加载失败"))}finally{t1(!1)}},[Cv,Ev,ep,ip,sp,s]);ot.useEffect(()=>{e==="wd"&&od()},[e,od]);const pF=async G=>{tF(G.id),iF(G.username||""),bv(!0),KA(!0),Sv(!1),Av(null),Zc(""),Jc(""),Qc(""),$o([]),tp(1);try{const pt=await _i.get(`/api/distributor/admin/distributors/${G.id}/application`),{success:ae,message:_e,data:Dt}=pt.data;if(!ae){Qt(_e);return}Sv(!!(Dt!=null&&Dt.needs_manual_entry));const me=Dt==null?void 0:Dt.application;me&&(Av(me.status??null),Zc(me.real_name||""),Jc(me.id_card_no||""),Qc(me.contact||""),$o(rg(me.qualification_urls)),tp(Number(me.apply_type)===2?2:1))}catch{Qt(s("加载失败"))}finally{KA(!1)}},gF=async()=>{var pt;if(!xv)return;const G=nd.filter(Boolean);if(!kv.trim()){Qt(s("请填写姓名或企业名称"));return}if(!wv.trim()){Qt(s("请填写证件号码"));return}if(!Tv.trim()){Qt(s("请填写联系方式"));return}if(G.length===0){Qt(s("请上传资格证书"));return}qA(!0);try{const ae=await _i.put(`/api/distributor/admin/distributors/${xv}/application`,{apply_type:Yo,real_name:kv.trim(),id_card_no:wv.trim(),contact:Tv.trim(),qualification_urls:G});if(ae.data.success){qr(s("已保存"));try{const _e=await _i.get(`/api/distributor/admin/distributors/${xv}/application`),Dt=(pt=_e.data)==null?void 0:pt.data;if(_e.data.success&&Dt){Sv(!!Dt.needs_manual_entry);const me=Dt.application;me&&(Av(me.status??null),Zc(me.real_name||""),Jc(me.id_card_no||""),Qc(me.contact||""),$o(rg(me.qualification_urls)),tp(Number(me.apply_type)===2?2:1))}}catch{}}else Qt(ae.data.message)}catch{Qt(s("保存失败"))}finally{qA(!1)}},fF=async G=>{try{const pt=await _i.get(`/api/distributor/admin/applications/${G}`),{success:ae,message:_e,data:Dt}=pt.data;if(!ae){Qt(_e);return}A(Dt),x(!0)}catch{Qt(s("加载失败"))}},_F=async G=>{H(G);let pt=1e3;try{const ae=await _i.get("/api/status"),{success:_e,data:Dt}=ae.data||{};if(_e&&(Dt==null?void 0:Dt.affiliate_default_commission_bps)!=null){const me=Number(Dt.affiliate_default_commission_bps);Number.isFinite(me)&&me>=0&&(pt=me)}}catch{}Q(pt),V(Hv(pt)),D(!0)},mF=async()=>{if(!j)return;const G=h1(W);if(Number.isNaN(G)){Qt(s("请输入 0~100 之间的百分比"));return}try{const pt=await _i.post(`/api/distributor/admin/applications/${j}/approve`,{distributor_commission_bps:G});pt.data.success?(qr(s("已通过")),D(!1),H(null),rd()):Qt(pt.data.message)}catch{Qt(s("操作失败"))}},vF=async()=>{if(!I.trim()){Qt(s("请填写驳回原因"));return}try{const G=await _i.post(`/api/distributor/admin/applications/${C}/reject`,{reason:I});G.data.success?(qr(s("已驳回")),M(!1),O(""),rd()):Qt(G.data.message)}catch{Qt(s("操作失败"))}},rp=ot.useCallback(async(G,pt,ae,_e)=>{if(!(!G||!pt)){XA(!0);try{const Dt=await _i.get(`/api/distributor/admin/distributors/${G}/invitees/${pt}/profit-shares?p=${ae}&page_size=${_e}`),{success:me,message:so,data:_n}=Dt.data;if(!me){Qt(so||s("加载失败"));return}$2((_n==null?void 0:_n.items)||[]),X2((_n==null?void 0:_n.total)??0),UA(ae),YA(_e)}catch{Qt(s("加载失败"))}finally{XA(!1)}}},[s]),n1=ot.useCallback(async G=>{const pt=G==null?void 0:G.invitee_id;!pt||!Cs||(W2(pt),V2(String(G.display_name||G.username||`#${pt}`).trim()),yv(!0),UA(1),YA(10),await rp(Cs,pt,1,10))},[Cs,rp]),yF=async G=>{H2(G),Kc(""),Ne(1),rs(!0),await Dv(),await ap(G,1,fn,"")},ap=async(G,pt,ae,_e=void 0)=>{const me=String((_e!==void 0?_e:mv)??"").trim().slice(0,Gn),so=new URLSearchParams({p:String(pt),page_size:String(ae)});me&&so.set("keyword",me);const _n=await _i.get(`/api/distributor/admin/distributors/${G}/invitees?${so}`),{success:Xr,message:zv,data:ur}=_n.data;if(!Xr){Qt(zv);return}zn((ur==null?void 0:ur.items)||[]),Be((ur==null?void 0:ur.total)??0),Ne(pt),z2(ae)},r1=()=>{if(!Cs)return;const G=mv.trim().slice(0,Gn);Kc(G),ap(Cs,1,fn,G)},bF=async()=>{if(!si)return;const G=h1(pe);if(Number.isNaN(G)){Qt(s("请输入 0~100 之间的百分比"));return}try{const pt=await _i.put(`/api/distributor/admin/distributors/${si.id}/commission`,{distributor_commission_bps:G});pt.data.success?(qr(s("已保存")),Wi(!1),ad()):Qt(pt.data.message)}catch{Qt(s("保存失败"))}},xF=async G=>{try{const pt=await _i.post(`/api/distributor/admin/withdrawals/${G}/approve`);pt.data.success?(qr(s("已通过")),od()):Qt(pt.data.message)}catch{Qt(s("操作失败"))}},SF=async()=>{if(!Lv.trim()){Qt(s("请填写驳回原因"));return}try{const G=await _i.post(`/api/distributor/admin/withdrawals/${uF}/reject`,{reason:Lv});G.data.success?(qr(s("已驳回")),Iv(!1),Bv(""),od()):Qt(G.data.message)}catch{Qt(s("操作失败"))}},AF=G=>G===1?s("提现中"):G===2?s("提现成功"):G===3?s("提现失败"):G===4?s("已取消"):"—",kF=async G=>{mn.confirm({title:s("确认结账"),content:s("将清空该代理的待使用收益额度,是否继续?"),onOk:async()=>{try{const pt=await _i.post(`/api/distributor/admin/distributors/${G}/settle`);pt.data.success?(qr(s("已结账")),ad()):Qt(pt.data.message)}catch{Qt(s("操作失败"))}}})},wF=[{title:s("用户名"),dataIndex:"username",width:120},{title:s("类型"),dataIndex:"apply_type",width:96,render:G=>ag(s,G)},{title:s("姓名/企业名称"),dataIndex:"real_name",ellipsis:!0},{title:s("身份证/统一社会信用代码"),dataIndex:"id_card_no_mask",width:168,ellipsis:!0},{title:s("联系方式"),dataIndex:"contact",ellipsis:!0},{title:s("资格证书"),dataIndex:"qualification_urls",width:220,render:(G,pt)=>B.jsx(nE,{urls:rg(pt.qualification_urls),compact:!0,onImagePreview:ae=>w(ae)})},{title:s("状态"),dataIndex:"status",width:100,render:G=>rE(s,G)},{title:s("提交时间"),dataIndex:"created_at",render:G=>G?lp.unix(Number(G)).format("YYYY-MM-DD HH:mm"):"—"},{title:s("操作"),render:(G,pt)=>B.jsxs("div",{className:"flex flex-wrap gap-1",children:[B.jsx(Ee,{size:"small",onClick:()=>fF(pt.id),children:s("详情")}),pt.status===1&&B.jsxs(B.Fragment,{children:[B.jsx(Ee,{size:"small",type:"primary",onClick:()=>_F(pt.id),children:s("通过")}),B.jsx(Ee,{size:"small",type:"danger",onClick:()=>{R(pt.id),O(""),M(!0)},children:s("驳回")})]})]})}],TF=[{title:s("用户名"),dataIndex:"username"},{title:s("类型"),dataIndex:"application_apply_type",width:96,render:G=>ag(s,G)},{title:s("姓名/企业名称"),dataIndex:"application_real_name",render:G=>(G!=null?String(G).trim():"")||"—"},{title:"aff",dataIndex:"aff_code",width:90},{title:s("默认分成"),dataIndex:"effective_commission_bps",render:G=>al(G)},{title:s("待结算"),dataIndex:"aff_quota",render:G=>dd(G||0)},{title:s("操作"),render:(G,pt)=>B.jsxs("div",{className:"flex flex-wrap gap-1",children:[B.jsx(Ee,{size:"small",type:pt.needs_supplement?"warning":"tertiary",onClick:()=>pF(pt),children:pt.needs_supplement?s("补充资料"):s("查看资料")}),B.jsx(Ee,{size:"small",onClick:()=>yF(pt.id),children:s("收益明细")}),B.jsx(Ee,{size:"small",onClick:()=>{xs(pt),Ae(Hv(pt.distributor_commission_bps||0)),Wi(!0)},children:s("分成比例")}),B.jsx(Ee,{size:"small",type:"warning",onClick:()=>kF(pt.id),children:s("结账")})]})}],MF=[{title:s("用户名"),dataIndex:"username",width:110},{title:s("类型"),dataIndex:"account_type",width:72,render:G=>ag(s,G||1)},{title:s("主体/账户"),width:140,render:(G,pt)=>B.jsxs("div",{className:"text-xs space-y-0.5 max-w-[200px]",children:[B.jsx("div",{className:"font-medium",children:pt.real_name}),B.jsx("div",{className:"text-[var(--semi-color-text-2)]",children:pt.bank_name}),B.jsx("div",{className:"text-[var(--semi-color-text-2)] break-all",children:pt.bank_account})]})},{title:s("提现月份"),dataIndex:"withdraw_month",width:100},{title:s("额度"),dataIndex:"quota_amount",render:G=>dd(G||0)},{title:s("状态"),dataIndex:"status",width:90,render:G=>AF(G)},{title:s("申请时间"),dataIndex:"created_at",width:160,render:G=>G?lp.unix(Number(G)).format("YYYY-MM-DD HH:mm"):"—"},{title:s("操作"),width:200,render:(G,pt)=>B.jsxs("div",{className:"flex flex-wrap gap-1",children:[B.jsx(Ee,{size:"small",type:"tertiary",onClick:()=>{Ov(pt),Rv(!0)},children:s("查看资料")}),pt.status===1&&B.jsxs(B.Fragment,{children:[B.jsx(Ee,{size:"small",type:"primary",onClick:()=>xF(pt.id),children:s("通过")}),B.jsx(Ee,{size:"small",type:"danger",onClick:()=>{cF(pt.id),Bv(""),Iv(!0)},children:s("驳回")})]})]})}],Fv=N2==="profit_share",CF=ot.useMemo(()=>[{title:s("时间"),dataIndex:"created_at",width:166,render:G=>G?lp.unix(Number(G)).format("YYYY-MM-DD HH:mm:ss"):"—"},{title:s("模型与路由"),width:220,render:(G,pt)=>{const ae=String((pt==null?void 0:pt.model_name)||"").trim(),_e=String((pt==null?void 0:pt.route_slug)||"").trim();return!ae&&!_e?"—":_e?`${ae}/${_e}`:ae}},{title:s("用户消耗额度"),dataIndex:"user_quota_charged",width:120,render:G=>d1(G)},{title:B.jsx(IF,{content:s("加价切片额度说明"),children:B.jsx("span",{className:"cursor-help border-b border-dotted border-gray-400",children:s("加价切片额度")})}),dataIndex:"markup_slice_quota",width:120,render:G=>d1(G)},{title:s("当时分成比例"),dataIndex:"commission_bps",width:100,render:G=>typeof G=="number"&&G>0?al(G):"—"},{title:B.jsx(ZF,{t:s}),dataIndex:"reward_quota",width:110,render:(G,pt)=>qF(pt,s)}],[s]),PF=ot.useMemo(()=>Fv?[{title:s("用户"),dataIndex:"username",render:(G,pt)=>pt.display_name||pt.username||pt.invitee_id},{title:s("邀请时间"),dataIndex:"created_at",width:168,render:G=>G?lp.unix(Number(G)).format("YYYY-MM-DD HH:mm"):"—"},{title:s("分润比例"),dataIndex:"commission_ratio_bps",width:100,render:G=>al(G)},{title:s("累计利润分成额度"),dataIndex:"profit_share_earned_quota",render:G=>dd(G||0)},{title:s("操作"),width:120,render:(G,pt)=>B.jsx(Ee,{size:"small",type:"tertiary",onClick:()=>n1(pt),children:s("消费明细")})}]:[{title:s("用户"),dataIndex:"username"},{title:s("分成"),dataIndex:"commission_ratio_bps",render:G=>al(G)},{title:s("累计分成额度"),dataIndex:"commission_earned_quota",render:G=>dd(G||0)}],[Fv,s,n1]),jv=B.jsx(LF,{image:B.jsx(UF,{style:{width:150,height:150}}),darkModeImage:B.jsx(VF,{style:{width:150,height:150}}),description:s("搜索无结果"),style:{padding:30}});return B.jsxs("div",{className:"mt-[60px] px-2 pb-16",children:[B.jsx(Z_.Title,{heading:3,children:s("代理管理中心")}),B.jsxs(hd,{activeKey:e,onChange:i,type:"line",className:"mt-4 w-full distributor-admin-tabs",children:[B.jsx(hd.TabPane,{tab:s("分销数据大盘"),itemKey:"dash",children:B.jsx(Nat,{adminMode:!0})}),B.jsx(hd.TabPane,{tab:s("申请审核"),itemKey:"app",children:B.jsx(Nv,{className:"w-full",type:"type1",actionsArea:B.jsx("div",{className:"flex flex-col md:flex-row justify-end items-center gap-2 w-full",children:B.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 w-full md:w-auto",children:[B.jsx("div",{className:"relative w-full md:w-64",children:B.jsx(cr,{value:g,maxLength:Gn,prefix:B.jsx(op,{}),showClear:!0,pure:!0,size:"small",placeholder:s("搜索姓名/企业、用户名、联系方式、证件号"),onChange:G=>f(String(G??"").slice(0,Gn))})}),B.jsx("div",{className:"w-full md:w-36",children:B.jsxs(ke,{value:v,className:"w-full",size:"small",onChange:G=>y(Number(G)),children:[B.jsx(ke.Option,{value:0,children:s("全部类型")}),B.jsx(ke.Option,{value:1,children:s("个人")}),B.jsx(ke.Option,{value:2,children:s("企业")})]})}),B.jsx("div",{className:"w-full md:w-48",children:B.jsxs(ke,{value:_,className:"w-full",size:"small",onChange:G=>m(Number(G)),children:[B.jsx(ke.Option,{value:0,children:s("全部状态")}),B.jsx(ke.Option,{value:1,children:s("待审核")}),B.jsx(ke.Option,{value:2,children:s("已通过")}),B.jsx(ke.Option,{value:3,children:s("已驳回")})]})}),B.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[B.jsx(Ee,{type:"tertiary",size:"small",className:"flex-1 md:flex-initial",loading:n,onClick:()=>rd(),children:s("查询")}),B.jsx(Ee,{type:"tertiary",size:"small",className:"flex-1 md:flex-initial",onClick:()=>{f(""),m(0),y(0),u(1)},children:s("重置")})]})]})}),paginationArea:Wv({currentPage:d,pageSize:c,total:l,onPageChange:G=>u(G),onPageSizeChange:G=>{p(G),u(1)},isMobile:t,t:s}),t:s,children:B.jsx(Gv,{rowKey:"id",loading:n,columns:wF,dataSource:a,hidePagination:!0,empty:jv,className:"w-full min-w-0 overflow-hidden",style:{width:"100%"},size:"middle"})})}),B.jsx(hd.TabPane,{tab:s("提现审核"),itemKey:"wd",children:B.jsx(Nv,{className:"w-full",type:"type1",actionsArea:B.jsx("div",{className:"flex flex-col md:flex-row justify-end items-center gap-2 w-full",children:B.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 w-full md:w-auto",children:[B.jsx("div",{className:"relative w-full md:w-64",children:B.jsx(cr,{value:ep,maxLength:Gn,prefix:B.jsx(op,{}),showClear:!0,pure:!0,size:"small",placeholder:s("搜索姓名/企业、卡号、证件号、用户名"),onChange:G=>e1(String(G??"").slice(0,Gn))})}),B.jsx("div",{className:"w-full md:w-36",children:B.jsxs(ke,{value:sp,className:"w-full",size:"small",onChange:G=>s1(Number(G)),children:[B.jsx(ke.Option,{value:0,children:s("全部类型")}),B.jsx(ke.Option,{value:1,children:s("个人")}),B.jsx(ke.Option,{value:2,children:s("企业")})]})}),B.jsx("div",{className:"w-full md:w-48",children:B.jsxs(ke,{value:ip,className:"w-full",size:"small",onChange:G=>i1(Number(G)),children:[B.jsx(ke.Option,{value:0,children:s("全部状态")}),B.jsx(ke.Option,{value:1,children:s("提现中")}),B.jsx(ke.Option,{value:2,children:s("提现成功")}),B.jsx(ke.Option,{value:3,children:s("提现失败")}),B.jsx(ke.Option,{value:4,children:s("已取消")})]})}),B.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[B.jsx(Ee,{type:"tertiary",size:"small",className:"flex-1 md:flex-initial",loading:QA,onClick:()=>od(),children:s("查询")}),B.jsx(Ee,{type:"tertiary",size:"small",className:"flex-1 md:flex-initial",onClick:()=>{e1(""),i1(0),s1(0),Pv(1)},children:s("重置")})]})]})}),paginationArea:Wv({currentPage:Cv,pageSize:Ev,total:aF,onPageChange:G=>Pv(G),onPageSizeChange:G=>{lF(G),Pv(1)},isMobile:t,t:s}),t:s,children:B.jsx(Gv,{rowKey:"id",loading:QA,columns:MF,dataSource:nF,hidePagination:!0,empty:jv,className:"w-full min-w-0 overflow-hidden",style:{width:"100%"},size:"middle"})})}),B.jsx(hd.TabPane,{tab:s("代理人员"),itemKey:"dist",children:B.jsx(Nv,{className:"w-full",type:"type1",actionsArea:B.jsx("div",{className:"flex flex-col md:flex-row justify-end items-center gap-2 w-full",children:B.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 w-full md:w-auto",children:[B.jsx("div",{className:"relative w-full md:w-64",children:B.jsx(cr,{value:kt,maxLength:Gn,prefix:B.jsx(op,{}),showClear:!0,pure:!0,size:"small",placeholder:s("搜索用户名、显示名、姓名/企业、联系方式、证件号"),onChange:G=>Lt(String(G??"").slice(0,Gn))})}),B.jsx("div",{className:"w-full md:w-36",children:B.jsxs(ke,{value:Ot,className:"w-full",size:"small",onChange:G=>fi(Number(G)),children:[B.jsx(ke.Option,{value:0,children:s("全部类型")}),B.jsx(ke.Option,{value:1,children:s("个人")}),B.jsx(ke.Option,{value:2,children:s("企业")})]})}),B.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[B.jsx(Ee,{type:"tertiary",size:"small",className:"flex-1 md:flex-initial",loading:J,onClick:()=>ad(),children:s("查询")}),B.jsx(Ee,{type:"tertiary",size:"small",className:"flex-1 md:flex-initial",onClick:()=>{Lt(""),fi(0),Rt(1)},children:s("重置")})]})]})}),paginationArea:Wv({currentPage:ct,pageSize:mt,total:it,onPageChange:G=>Rt(G),onPageSizeChange:G=>{Tt(G),Rt(1)},isMobile:t,t:s}),t:s,children:B.jsx(Gv,{rowKey:"id",loading:J,columns:TF,dataSource:q,hidePagination:!0,empty:jv,className:"w-full min-w-0 overflow-hidden",style:{width:"100%"},size:"middle"})})})]}),B.jsx(mn,{title:s("申请详情"),visible:b,onCancel:()=>x(!1),footer:B.jsx(Ee,{onClick:()=>x(!1),children:s("关闭")}),width:800,children:S&&B.jsxs("div",{className:"space-y-3 text-sm",children:[B.jsxs("div",{children:[B.jsx(De,{strong:!0,children:s("用户名")}),":",S.username]}),B.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[B.jsx(De,{strong:!0,children:s("类型")}),B.jsx("span",{children:":"}),ag(s,S.apply_type)]}),B.jsxs("div",{children:[B.jsx(De,{strong:!0,children:Number(S.apply_type)===2?s("企业名称"):s("姓名")}),":",S.real_name]}),B.jsxs("div",{children:[B.jsx(De,{strong:!0,children:Number(S.apply_type)===2?s("统一社会信用代码"):s("身份证")}),":",S.id_card_no]}),B.jsxs("div",{children:[B.jsx(De,{strong:!0,children:s("联系方式")}),":",S.contact]}),B.jsxs("div",{children:[B.jsx(De,{strong:!0,className:"block mb-2",children:s("资格证书")}),B.jsx(nE,{urls:rg(S.qualification_urls),onImagePreview:G=>w(G)})]})]})}),B.jsx(mn,{title:s("代理申请资料"),visible:Z2,onCancel:()=>bv(!1),width:720,footer:B.jsxs("div",{className:"flex justify-end gap-2",children:[B.jsx(Ee,{onClick:()=>bv(!1),children:s("关闭")}),B.jsx(Ee,{type:"primary",loading:Q2,onClick:gF,children:s("保存资料")})]}),children:J2?B.jsxs("div",{className:"py-8 text-center text-[var(--semi-color-text-2)]",children:[s("加载中"),"…"]}):B.jsxs("div",{className:"space-y-3 text-sm",children:[B.jsxs("div",{children:[B.jsx(De,{strong:!0,children:s("用户名")}),":",eF]}),ZA!=null?B.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[B.jsx(De,{strong:!0,children:s("申请状态")}),B.jsx("span",{children:":"}),rE(s,ZA)]}):null,sF?B.jsx(BF,{type:"warning",fullMode:!1,bordered:!0,description:s("该用户为管理员手动开通代理,暂无完整申请资料,请代为补全并保存。")}):null,B.jsxs("div",{children:[B.jsx("div",{className:"mb-1",children:B.jsx(De,{strong:!0,children:s("类型")})}),B.jsxs(ke,{value:Yo,className:"w-full max-w-md",onChange:G=>tp(Number(G)),children:[B.jsx(ke.Option,{value:1,children:s("个人")}),B.jsx(ke.Option,{value:2,children:s("企业")})]})]}),B.jsxs("div",{children:[B.jsx("div",{className:"mb-1",children:B.jsx(De,{strong:!0,children:s(Yo===2?"企业名称":"姓名")})}),B.jsx(cr,{value:kv,onChange:G=>Zc(String(G??"")),placeholder:s(Yo===2?"企业名称":"真实姓名")})]}),B.jsxs("div",{children:[B.jsx("div",{className:"mb-1",children:B.jsx(De,{strong:!0,children:s(Yo===2?"统一社会信用代码":"身份证号码")})}),B.jsx(cr,{value:wv,onChange:G=>Jc(String(G??"")),placeholder:s(Yo===2?"统一社会信用代码":"身份证号码")})]}),B.jsxs("div",{children:[B.jsx("div",{className:"mb-1",children:B.jsx(De,{strong:!0,children:s("联系方式")})}),B.jsx(cr,{value:Tv,onChange:G=>Qc(String(G??"")),placeholder:s("手机或邮箱等")})]}),B.jsxs("div",{children:[B.jsx(De,{strong:!0,className:"block mb-2",children:s("资格证书")}),B.jsx(DF,{action:"",accept:"image/*,.pdf",showUploadList:!1,customRequest:async({file:G,onSuccess:pt,onError:ae,onProgress:_e})=>{var so,_n;const Dt=new FormData,me=G.fileInstance||G;Dt.append("file",me),Mv(0);try{const Xr=await _i.post("/api/oss/upload",Dt,{skipErrorHandler:!0,onUploadProgress:Kr=>{const a1=Kr.total||Kr.loaded||1,EF=Math.min(100,Math.round(Kr.loaded*100/a1));Mv(EF),typeof _e=="function"&&_e({total:a1,loaded:Kr.loaded})}}),{success:zv,message:ur,data:ld}=Xr.data||{};if(!zv||!(ld!=null&&ld.url)){ae(new Error(ur||"upload")),Qt(ur||s("上传失败"));return}$o(Kr=>Kr.length>=ng?Kr:[...Kr,ld.url]),pt(ld),qr(s("已上传"))}catch(Xr){ae(Xr),Qt(((_n=(so=Xr==null?void 0:Xr.response)==null?void 0:so.data)==null?void 0:_n.message)||s("上传失败"))}finally{Mv(null)}},limit:ng,multiple:!0,disabled:nd.length>=ng,children:B.jsx(Ee,{disabled:nd.length>=ng,children:s("上传文件")})}),JA!=null?B.jsx(FF,{percent:JA,showInfo:!0,className:"mt-2"}):null,B.jsx(De,{type:"tertiary",size:"small",className:"block mt-1",children:s("支持图片或 PDF,最多 5 个;点击图片可大图预览")}),nd.length>0&&B.jsx("div",{className:"mt-3 flex flex-wrap gap-3",children:nd.map((G,pt)=>j2(G)?B.jsxs("div",{className:"relative flex h-24 w-24 flex-col items-center justify-center rounded-lg border border-[var(--semi-color-border)] bg-[var(--semi-color-fill-0)]",children:[B.jsx(Ix,{size:"large"}),B.jsx("span",{className:"mt-1 text-xs text-[var(--semi-color-text-2)]",children:"PDF"}),B.jsx("button",{type:"button",className:"absolute inset-0 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",title:s("在新窗口打开"),onClick:()=>window.open(G,"_blank","noopener,noreferrer")}),B.jsx(Ee,{size:"small",type:"danger",theme:"borderless",className:"!absolute -right-1 -top-1 !min-w-0 z-10",onClick:ae=>{ae.stopPropagation(),$o(_e=>_e.filter((Dt,me)=>me!==pt))},children:"×"})]},`prof-pdf-${G}-${pt}`):B.jsxs("div",{className:"relative h-24 w-24 overflow-hidden rounded-lg border border-[var(--semi-color-border)] bg-[var(--semi-color-fill-0)]",children:[B.jsx("button",{type:"button",className:"block h-full w-full cursor-zoom-in border-0 bg-transparent p-0",onClick:()=>w(G),children:B.jsx("img",{src:G,alt:"",className:"h-full w-full object-cover"})}),B.jsx(Ee,{size:"small",type:"danger",theme:"borderless",className:"!absolute -right-1 -top-1 !min-w-0",onClick:ae=>{ae.stopPropagation(),$o(_e=>_e.filter((Dt,me)=>me!==pt))},children:"×"})]},`prof-img-${G}-${pt}`))})]})]})}),B.jsx(mn,{title:s("提现资料"),visible:hF,onCancel:()=>{Rv(!1),Ov(null)},footer:B.jsx(Ee,{onClick:()=>{Rv(!1),Ov(null)},children:s("关闭")}),width:Math.min(960,typeof window<"u"?window.innerWidth-48:960),bodyStyle:{maxHeight:"calc(100vh - 200px)",overflowY:"auto"},children:np?B.jsxs("div",{className:"space-y-3 min-w-0",children:[B.jsxs(De,{type:"tertiary",size:"small",children:[s("用户"),":",np.username," · ",s("额度"),":",dd(np.quota_amount||0)]}),B.jsx(Uat,{row:np,onImagePreview:w})]}):null}),B.jsx(mn,{title:s("预览"),visible:!!k,onCancel:()=>w(null),footer:null,width:Math.min(960,typeof window<"u"?window.innerWidth-48:960),children:k?B.jsx("div",{className:"flex max-h-[85vh] justify-center overflow-auto p-2",children:B.jsx("img",{src:k,alt:"",className:"max-h-[85vh] max-w-full object-contain"})}):null}),B.jsx(mn,{title:s("驳回原因"),visible:T,onOk:vF,onCancel:()=>M(!1),children:B.jsx(o1,{value:I,onChange:O,placeholder:s("请填写驳回原因"),rows:3})}),B.jsxs(mn,{title:s("审核通过"),visible:L,onOk:mF,onCancel:()=>{D(!1),H(null)},children:[B.jsx(De,{type:"tertiary",size:"small",className:"mb-2 block",children:s("请确认该代理的默认分成比例;默认已填入当前系统全局配置,可直接提交或修改。")}),B.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[B.jsxs(De,{type:"tertiary",size:"small",children:[s("当前系统默认分成"),":",al(X)]}),B.jsx(Ee,{size:"small",type:"tertiary",onClick:()=>V(Hv(X)),children:s("使用系统默认")})]}),B.jsx(De,{type:"tertiary",size:"small",className:"mb-2 block",children:s("填写 0~100 之间的百分比,例如 10 表示 10%,10.5 表示 10.5%。填 0 表示跟随系统默认。")}),B.jsx(cr,{value:W,onChange:G=>V(String(G??"")),suffix:"%",placeholder:s("如 10 或 10.5")})]}),B.jsxs(mn,{title:s("驳回提现"),visible:dF,onOk:SF,onCancel:()=>Iv(!1),children:[B.jsx(De,{type:"tertiary",size:"small",className:"block mb-2",children:s("驳回后将退回该笔暂扣的分成收益")}),B.jsx(o1,{value:Lv,onChange:Bv,placeholder:s("请填写驳回原因"),rows:3})]}),B.jsxs(mn,{title:s("设置默认分销比例"),visible:Pe,onOk:bF,onCancel:()=>Wi(!1),children:[B.jsx(De,{type:"tertiary",size:"small",children:s("填写 0~100 之间的百分比,例如 10 表示 10%,10.5 表示 10.5%。填 0 表示跟随系统默认。")}),B.jsx(cr,{className:"mt-2",value:pe,onChange:G=>Ae(String(G??"")),suffix:"%",placeholder:s("如 10 或 10.5")})]}),B.jsxs(mn,{title:s("邀请用户明细"),visible:Ms,onCancel:()=>{rs(!1),yv(!1),Kc("")},footer:null,width:Fv?960:800,children:[B.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[B.jsx(cr,{size:"small",className:"w-[200px]",prefix:B.jsx(op,{}),showClear:!0,placeholder:s("邀请用户搜索占位"),maxLength:Gn,value:mv,onChange:G=>Kc(String(G??"").slice(0,Gn)),onEnterPress:r1}),B.jsx(Ee,{type:"primary",size:"small",onClick:r1,children:s("搜索")})]}),B.jsx(l1,{columns:PF,dataSource:dr,pagination:{currentPage:oe,pageSize:fn,total:hi,onPageChange:G=>Cs&&ap(Cs,G,fn),onPageSizeChange:G=>Cs&&ap(Cs,1,G)}})]}),B.jsxs(mn,{title:B.jsxs("span",{children:[s("消费明细"),VA?B.jsx(De,{type:"tertiary",size:"small",className:"ml-2 font-normal",children:VA}):null]}),visible:G2,onCancel:()=>yv(!1),footer:null,width:1180,bodyStyle:{overflow:"visible"},children:[B.jsx(De,{type:"tertiary",size:"small",className:"block mb-3",children:s("利润分成明细说明")}),B.jsx(l1,{loading:q2,rowKey:"id",columns:CF,dataSource:U2,pagination:{currentPage:K2,pageSize:$A,total:Y2,onPageChange:G=>Cs&&qc&&rp(Cs,qc,G,$A),onPageSizeChange:G=>Cs&&qc&&rp(Cs,qc,1,G)}})]})]})}export{hot as default};
|